@pdf-viewer/react 1.7.0-beta.1 → 1.7.0-beta.3
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.
- package/dist/{RPDefaultLayout-aa575bb0.js → RPDefaultLayout-d16fdf0e.js} +655 -654
- package/dist/assets/PasswordModal.css +1 -1
- package/dist/assets/RPDefaultLayout.css +1 -1
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +1 -1
- package/dist/components/RPProvider.js +1 -1
- package/dist/components/layout/LayoutContainer.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +1 -1
- package/dist/components/layout/toolbar/OtherTool.js +1 -1
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +1 -1
- package/dist/components/page/AnnotationLayer.js +1 -1
- package/dist/components/page/CanvasLayer.js +1 -1
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +1 -1
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +1 -1
- package/dist/components/page/TextLayer.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/PasswordModal.js +14 -14
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/main.js +1 -1
- package/dist/types/utils/types.d.ts +1 -0
- package/dist/utils/hooks/useFileDownload.js +1 -1
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/useLoadPdf.js +21 -25
- package/dist/utils/hooks/usePaginate.js +1 -1
- package/dist/utils/hooks/usePresentPage.js +1 -1
- package/dist/utils/hooks/usePrint.js +1 -1
- package/dist/utils/hooks/useScrollToPage.js +1 -1
- package/dist/utils/hooks/useSearch.js +1 -1
- package/dist/utils/hooks/useThumbnail.js +1 -1
- package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
- package/dist/utils/types.js +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as i, Fragment as fe, jsxs as F } from "react/jsx-runtime";
|
|
2
2
|
import * as B from "react";
|
|
3
|
-
import { useRef as H, useEffect as k, useCallback as N, useState as $,
|
|
3
|
+
import { useRef as H, useEffect as k, useCallback as N, useState as $, createContext as Ye, useContext as Je, useMemo as M, forwardRef as $e, useImperativeHandle as cn, createElement as Ue, PureComponent as Jn, Component as Qn, memo as er } from "react";
|
|
4
4
|
import { ChevronUpIcon as Me } from "./components/icons/ChevronUpIcon.js";
|
|
5
5
|
import { UIButton as re } from "./components/ui/Button.js";
|
|
6
6
|
import { UIInput as ln } from "./components/ui/Input.js";
|
|
7
|
-
import { ViewMode as He, ScrollMode as ee, AnnotationSubType as
|
|
7
|
+
import { ViewMode as He, ScrollMode as ee, AnnotationSubType as At, SelectionMode as tr, ZoomLevel as at } from "./utils/types.js";
|
|
8
8
|
import { useScrollModeContext as De } from "./contexts/ScrollModeContext.js";
|
|
9
9
|
import { useDocumentContext as J } from "./contexts/RPDocumentContext.js";
|
|
10
10
|
import { useDocumentPasswordContext as nr } from "./contexts/DocumentPasswordContext.js";
|
|
@@ -12,7 +12,7 @@ import { useDarkModeContext as rr } from "./contexts/DarkModeContext.js";
|
|
|
12
12
|
import { useRotationContext as Ge } from "./contexts/RotationContext.js";
|
|
13
13
|
import { useLayerContext as or } from "./contexts/LayerContext.js";
|
|
14
14
|
import { useZoomContext as Qe } from "./contexts/ZoomContext.js";
|
|
15
|
-
import { useViewModeContext as
|
|
15
|
+
import { useViewModeContext as Ae } from "./contexts/ViewModeContext.js";
|
|
16
16
|
import { useVirtualScrollContext as et } from "./contexts/VirtualScrollContext.js";
|
|
17
17
|
import { useVirtualGridContext as dn } from "./contexts/VirtualGridContext.js";
|
|
18
18
|
import { useSelectionModeContext as ir } from "./contexts/SelectionModeContext.js";
|
|
@@ -47,8 +47,8 @@ import { useThemeContext as Pr } from "./contexts/ThemeContext.js";
|
|
|
47
47
|
import * as Sr from "pdfjs-dist";
|
|
48
48
|
import { PixelsPerInch as yr, AnnotationMode as xr, RenderingCancelledException as Ir, AnnotationLayer as Rr } from "pdfjs-dist";
|
|
49
49
|
import { SimpleLinkService as Lr } from "./utils/link_service.js";
|
|
50
|
-
import { annotationsEvents as Er, annotationEventsHandler as Nr, handleClick as
|
|
51
|
-
import { normalizeSingleKeyword as
|
|
50
|
+
import { annotationsEvents as Er, annotationEventsHandler as Nr, handleClick as zt, handleAnnotationWidget as Or, handleAnnotationLink as Dr, bindLayerEvents as Ar, unbindLayerEvents as Ft } from "./utils/annotations.js";
|
|
51
|
+
import { normalizeSingleKeyword as zr, sortHighlightPosition as Fr, unwrap as kr } from "./components/page/searchHighlight.js";
|
|
52
52
|
import { _ as Wr, U as Mr } from "./Popover-b7402893.js";
|
|
53
53
|
import { useMousePressed as Hr } from "./utils/hooks/useMousePressed.js";
|
|
54
54
|
import { useGrabScroll as $r } from "./utils/hooks/useGrabScroll.js";
|
|
@@ -94,14 +94,14 @@ import { UICheckbox as $t } from "./components/ui/Checkbox.js";
|
|
|
94
94
|
import { ClearIcon as To } from "./components/icons/ClearIcon.js";
|
|
95
95
|
import { InfoIcon as Gt } from "./components/icons/InfoIcon.js";
|
|
96
96
|
import './assets/RPDefaultLayout.css';const vn = () => {
|
|
97
|
-
const { viewMode: e } =
|
|
97
|
+
const { viewMode: e } = Ae(), { scrollMode: t } = De(), { virtualScrollRef: n, virtualScrollableElementRef: o, pageScrollElementRef: r } = et(), { setFocusedPage: a } = ie(), c = H(), { columnCount: l } = dn(), { widths: u, heights: p } = qe(), m = H(t), v = H(e), h = H(l), { targetScrollPage: w } = un();
|
|
98
98
|
k(() => {
|
|
99
|
-
n != null && n.scrollToItem && (
|
|
99
|
+
n != null && n.scrollToItem && (c.current = n);
|
|
100
100
|
}, [n]), k(() => {
|
|
101
101
|
m.current = t, v.current = e;
|
|
102
102
|
}, [t, e]);
|
|
103
103
|
const T = N(
|
|
104
|
-
(C,
|
|
104
|
+
(C, y) => {
|
|
105
105
|
if (!r)
|
|
106
106
|
return;
|
|
107
107
|
const d = Math.ceil(C / 2) * 2 - 1;
|
|
@@ -111,7 +111,7 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
111
111
|
top: 0
|
|
112
112
|
};
|
|
113
113
|
return new Promise(
|
|
114
|
-
(
|
|
114
|
+
(s) => st(r, g, s)
|
|
115
115
|
);
|
|
116
116
|
}
|
|
117
117
|
const f = {
|
|
@@ -120,7 +120,7 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
120
120
|
};
|
|
121
121
|
return r == null ? void 0 : r.scrollTo({
|
|
122
122
|
...f,
|
|
123
|
-
behavior:
|
|
123
|
+
behavior: y
|
|
124
124
|
});
|
|
125
125
|
},
|
|
126
126
|
[r, u, st]
|
|
@@ -128,52 +128,52 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
128
128
|
return k(() => {
|
|
129
129
|
m.current = t, v.current = e;
|
|
130
130
|
}, [t, e]), k(() => {
|
|
131
|
-
|
|
131
|
+
h.current = l;
|
|
132
132
|
}, [l]), { scrollToPage: N(
|
|
133
|
-
(C,
|
|
133
|
+
(C, y = "smooth") => {
|
|
134
134
|
a(C);
|
|
135
135
|
const d = C - 1;
|
|
136
136
|
let f = d, g = 0;
|
|
137
137
|
if (v.current === He.DUAL_PAGE && m.current === ee.PAGE_SCROLLING) {
|
|
138
|
-
T(C,
|
|
138
|
+
T(C, y);
|
|
139
139
|
return;
|
|
140
140
|
}
|
|
141
141
|
if (m.current === ee.PAGE_SCROLLING) {
|
|
142
142
|
a(C);
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
|
-
if (!
|
|
145
|
+
if (!c.current || !o)
|
|
146
146
|
return;
|
|
147
|
-
const
|
|
147
|
+
const s = o;
|
|
148
148
|
if (w.current = C, m.current === ee.HORIZONTAL_SCROLLING) {
|
|
149
149
|
g = d;
|
|
150
|
-
const
|
|
150
|
+
const S = {
|
|
151
151
|
left: Oe(u, g),
|
|
152
152
|
top: 0
|
|
153
153
|
};
|
|
154
|
-
return
|
|
155
|
-
...
|
|
156
|
-
behavior:
|
|
154
|
+
return s.scrollTo({
|
|
155
|
+
...S,
|
|
156
|
+
behavior: y
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
if (v.current === He.DUAL_PAGE) {
|
|
160
160
|
g = d % 2, f = Math.floor(d / 2);
|
|
161
|
-
const
|
|
161
|
+
const S = {
|
|
162
162
|
left: Oe(u, g),
|
|
163
|
-
top: Oe(
|
|
163
|
+
top: Oe(p, f)
|
|
164
164
|
};
|
|
165
|
-
return
|
|
166
|
-
...
|
|
167
|
-
behavior:
|
|
165
|
+
return s.scrollTo({
|
|
166
|
+
...S,
|
|
167
|
+
behavior: y
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
const b = {
|
|
171
171
|
left: 0,
|
|
172
|
-
top: Oe(
|
|
172
|
+
top: Oe(p, f)
|
|
173
173
|
};
|
|
174
|
-
return
|
|
174
|
+
return s.scrollTo({
|
|
175
175
|
...b,
|
|
176
|
-
behavior:
|
|
176
|
+
behavior: y
|
|
177
177
|
});
|
|
178
178
|
},
|
|
179
179
|
[
|
|
@@ -182,44 +182,45 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
182
182
|
T,
|
|
183
183
|
a,
|
|
184
184
|
st,
|
|
185
|
-
|
|
185
|
+
p,
|
|
186
186
|
u
|
|
187
187
|
]
|
|
188
188
|
) };
|
|
189
189
|
}, Po = (e = 1) => {
|
|
190
|
-
const [t, n] = $(e), [o, r] = $(0), { scrollToPage: a } = vn(),
|
|
190
|
+
const [t, n] = $(e), [o, r] = $(0), { scrollToPage: a } = vn(), c = H(1), { viewMode: l } = Ae(), { scrollMode: u } = De(), { widths: p } = qe(), { pagesRef: m } = ge(), v = Tt(t, 100), h = N(
|
|
191
191
|
(d) => {
|
|
192
192
|
if (!/^[0-9]*$/g.test(d.toString()) || !d)
|
|
193
|
-
return { success: !1, currentPage:
|
|
193
|
+
return { success: !1, currentPage: c.current };
|
|
194
194
|
const g = +d;
|
|
195
|
-
return g < 0 || g > o ? { success: !1, currentPage:
|
|
195
|
+
return g < 0 || g > o ? { success: !1, currentPage: c.current } : (n(g), c.current = g, { success: !0, currentPage: +d });
|
|
196
196
|
},
|
|
197
197
|
[o]
|
|
198
|
-
), w = N(
|
|
198
|
+
), w = N(h, [h]), T = N(
|
|
199
199
|
(d) => {
|
|
200
|
-
const f =
|
|
200
|
+
const f = h(d);
|
|
201
201
|
return f.success && a(f.currentPage), f;
|
|
202
202
|
},
|
|
203
|
-
[
|
|
204
|
-
),
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}, [T, t, l, u]), C = W(() => {
|
|
208
|
-
if (!m)
|
|
203
|
+
[h, a]
|
|
204
|
+
), P = N((d) => {
|
|
205
|
+
const f = d % 2 === 1;
|
|
206
|
+
if (!m || f)
|
|
209
207
|
return !1;
|
|
210
|
-
const d =
|
|
211
|
-
return
|
|
212
|
-
}, [
|
|
208
|
+
const g = f ? p[d] : p[d - 1], s = f ? p[d + 1] : p[d];
|
|
209
|
+
return l === He.DUAL_PAGE && g + s < m.clientWidth;
|
|
210
|
+
}, [l, p, m, o]), C = N(() => {
|
|
211
|
+
let d = t - 1;
|
|
212
|
+
P(d) && (d = t - 2), T(d);
|
|
213
|
+
}, [T, t, l, u, P]), y = N(() => {
|
|
213
214
|
let d = t + 1;
|
|
214
|
-
|
|
215
|
-
}, [T, t,
|
|
215
|
+
P(d) && (d = t + 2), T(d);
|
|
216
|
+
}, [T, t, P, l, u]);
|
|
216
217
|
return {
|
|
217
218
|
focusedPage: v,
|
|
218
219
|
totalPages: o,
|
|
219
220
|
setFocusedPage: w,
|
|
220
221
|
setTotalPages: r,
|
|
221
|
-
nextPage:
|
|
222
|
-
prevPage:
|
|
222
|
+
nextPage: y,
|
|
223
|
+
prevPage: C,
|
|
223
224
|
goToPage: T
|
|
224
225
|
};
|
|
225
226
|
}, wn = Ye({
|
|
@@ -238,7 +239,7 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
238
239
|
const e = Je(wn);
|
|
239
240
|
return typeof (e == null ? void 0 : e.focusedPage) > "u" && Zr.error("Please use this hooks inside children component of RPProvider"), e;
|
|
240
241
|
}, Ms = ({ children: e }) => {
|
|
241
|
-
const { pdf: t } = J(), { focusedPage: n, totalPages: o, setFocusedPage: r, setTotalPages: a, goToPage:
|
|
242
|
+
const { pdf: t } = J(), { focusedPage: n, totalPages: o, setFocusedPage: r, setTotalPages: a, goToPage: c, nextPage: l, prevPage: u } = Po();
|
|
242
243
|
return k(() => {
|
|
243
244
|
t != null && t.numPages && (a(t.numPages), r(1));
|
|
244
245
|
}, [t, a, r]), /* @__PURE__ */ i(
|
|
@@ -251,7 +252,7 @@ import './assets/RPDefaultLayout.css';const vn = () => {
|
|
|
251
252
|
setTotalPages: a,
|
|
252
253
|
nextPage: l,
|
|
253
254
|
prevPage: u,
|
|
254
|
-
goToPage:
|
|
255
|
+
goToPage: c
|
|
255
256
|
},
|
|
256
257
|
children: e
|
|
257
258
|
}
|
|
@@ -262,7 +263,7 @@ const So = () => {
|
|
|
262
263
|
loadedPages: 0,
|
|
263
264
|
totalPages: 0,
|
|
264
265
|
percentage: 0
|
|
265
|
-
}), [r, a] = $(!1), [
|
|
266
|
+
}), [r, a] = $(!1), [c, l] = $(!1), [u, p] = $(null), m = H(!1);
|
|
266
267
|
k(() => {
|
|
267
268
|
m.current;
|
|
268
269
|
}, [m]);
|
|
@@ -270,8 +271,8 @@ const So = () => {
|
|
|
270
271
|
document.documentElement.classList.remove("rp-print-html-printing"), document.body.classList.remove("rp-print-body-printing");
|
|
271
272
|
const f = document.querySelector(".rp-print-zone");
|
|
272
273
|
f && f.remove();
|
|
273
|
-
}, []),
|
|
274
|
-
m.current = !1, a(!1), l(!1),
|
|
274
|
+
}, []), h = N(() => {
|
|
275
|
+
m.current = !1, a(!1), l(!1), p(null), o({
|
|
275
276
|
loadedPages: 0,
|
|
276
277
|
totalPages: 0,
|
|
277
278
|
percentage: 0
|
|
@@ -281,91 +282,91 @@ const So = () => {
|
|
|
281
282
|
}, T = async ({
|
|
282
283
|
scratchCanvas: f,
|
|
283
284
|
pdfDocument: g,
|
|
284
|
-
pageNumber:
|
|
285
|
+
pageNumber: s,
|
|
285
286
|
viewerPdfPage: b,
|
|
286
287
|
printResolution: _,
|
|
287
|
-
optionalContentConfigPromise:
|
|
288
|
+
optionalContentConfigPromise: S,
|
|
288
289
|
printAnnotationStoragePromise: E
|
|
289
290
|
}) => {
|
|
290
291
|
if (m.current) {
|
|
291
|
-
|
|
292
|
+
h();
|
|
292
293
|
return;
|
|
293
294
|
}
|
|
294
295
|
const x = _ / yr.PDF;
|
|
295
296
|
f.width = Math.floor(b.width * x), f.height = Math.floor(b.height * x);
|
|
296
297
|
const R = f.getContext("2d");
|
|
297
298
|
R.save(), R.fillStyle = "rgb(255, 255, 255)", R.fillRect(0, 0, f.width, f.height), R.restore();
|
|
298
|
-
const [D,
|
|
299
|
-
g.getPage(
|
|
299
|
+
const [D, A] = await Promise.all([
|
|
300
|
+
g.getPage(s),
|
|
300
301
|
E
|
|
301
302
|
]);
|
|
302
303
|
if (m.current) {
|
|
303
|
-
|
|
304
|
+
h();
|
|
304
305
|
return;
|
|
305
306
|
}
|
|
306
|
-
const
|
|
307
|
+
const z = {
|
|
307
308
|
canvasContext: R,
|
|
308
309
|
transform: [x, 0, 0, x, 0, 0],
|
|
309
310
|
viewport: D.getViewport({ scale: 1, rotation: b.rotation }),
|
|
310
311
|
intent: "print",
|
|
311
312
|
annotationMode: xr.ENABLE_STORAGE,
|
|
312
|
-
optionalContentConfigPromise:
|
|
313
|
-
printAnnotationStorage:
|
|
313
|
+
optionalContentConfigPromise: S,
|
|
314
|
+
printAnnotationStorage: A
|
|
314
315
|
};
|
|
315
316
|
try {
|
|
316
|
-
return D.render(
|
|
317
|
+
return D.render(z).promise;
|
|
317
318
|
} catch (L) {
|
|
318
319
|
throw L instanceof Ir || console.error(L), L;
|
|
319
320
|
}
|
|
320
|
-
},
|
|
321
|
+
}, P = N(() => {
|
|
321
322
|
const f = window.print;
|
|
322
323
|
return new Promise((g) => {
|
|
323
|
-
const
|
|
324
|
+
const s = (S) => {
|
|
324
325
|
setTimeout(() => {
|
|
325
|
-
f.call(window), setTimeout(() =>
|
|
326
|
+
f.call(window), setTimeout(() => S(), 20);
|
|
326
327
|
}, 0);
|
|
327
328
|
};
|
|
328
329
|
if (document.querySelector(".rp-print-zone")) {
|
|
329
|
-
|
|
330
|
+
s(g);
|
|
330
331
|
return;
|
|
331
332
|
}
|
|
332
333
|
const _ = new MutationObserver(() => {
|
|
333
|
-
document.querySelector(".rp-print-zone") && (
|
|
334
|
+
document.querySelector(".rp-print-zone") && (s(g), _.disconnect());
|
|
334
335
|
});
|
|
335
336
|
_.observe(document.body, { childList: !0, subtree: !0 });
|
|
336
337
|
});
|
|
337
338
|
}, []), C = async (f) => {
|
|
338
|
-
const g = document.createElement("img"),
|
|
339
|
-
return
|
|
340
|
-
f.toBlob((
|
|
341
|
-
|
|
339
|
+
const g = document.createElement("img"), s = document.createElement("div");
|
|
340
|
+
return s.classList.add("rp-print-page"), await new Promise((b, _) => {
|
|
341
|
+
f.toBlob((S) => {
|
|
342
|
+
S ? (g.src = URL.createObjectURL(S), g.onload = () => {
|
|
342
343
|
URL.revokeObjectURL(g.src), b();
|
|
343
344
|
}, g.onerror = _) : _(new Error("Failed to create blob"));
|
|
344
345
|
});
|
|
345
346
|
}).catch(() => {
|
|
346
|
-
}),
|
|
347
|
-
},
|
|
348
|
-
const
|
|
349
|
-
|
|
347
|
+
}), s.appendChild(g), s;
|
|
348
|
+
}, y = (f, g) => {
|
|
349
|
+
const s = document.createElement("div");
|
|
350
|
+
s.classList.add("rp-print-zone");
|
|
350
351
|
const b = document.createElement("style"), _ = g.get(1);
|
|
351
352
|
if (_) {
|
|
352
|
-
const { width:
|
|
353
|
-
b.innerHTML = `@page { size: ${
|
|
353
|
+
const { width: S, height: E } = _ == null ? void 0 : _.page.getViewport({ scale: 1 });
|
|
354
|
+
b.innerHTML = `@page { size: ${S}px ${E}px }`;
|
|
354
355
|
}
|
|
355
|
-
return
|
|
356
|
+
return s.appendChild(b), s.append(...f), s;
|
|
356
357
|
}, d = N(async () => {
|
|
357
358
|
if (!e)
|
|
358
359
|
return;
|
|
359
|
-
|
|
360
|
+
h();
|
|
360
361
|
const f = document.createElement("canvas"), g = [];
|
|
361
362
|
try {
|
|
362
363
|
e.isPureXfa && console.warn("[rp] XFA Form is not supported at the moment.");
|
|
363
364
|
const b = e.getOptionalContentConfig({ intent: "print" }), _ = Promise.resolve(
|
|
364
365
|
e.annotationStorage.print ?? void 0
|
|
365
|
-
),
|
|
366
|
+
), S = t.size;
|
|
366
367
|
for (const [x, R] of t) {
|
|
367
368
|
if (m.current) {
|
|
368
|
-
|
|
369
|
+
h();
|
|
369
370
|
return;
|
|
370
371
|
}
|
|
371
372
|
const D = R.page.getViewport({ scale: 1 });
|
|
@@ -378,43 +379,43 @@ const So = () => {
|
|
|
378
379
|
optionalContentConfigPromise: b,
|
|
379
380
|
printAnnotationStoragePromise: _
|
|
380
381
|
}), m.current) {
|
|
381
|
-
|
|
382
|
+
h();
|
|
382
383
|
return;
|
|
383
384
|
}
|
|
384
|
-
const
|
|
385
|
-
g.push(
|
|
386
|
-
const
|
|
385
|
+
const A = await C(f);
|
|
386
|
+
g.push(A);
|
|
387
|
+
const z = parseFloat((g.length / S * 100).toFixed(2));
|
|
387
388
|
o({
|
|
388
389
|
loadedPages: x,
|
|
389
|
-
totalPages:
|
|
390
|
-
percentage:
|
|
390
|
+
totalPages: S,
|
|
391
|
+
percentage: z
|
|
391
392
|
});
|
|
392
393
|
}
|
|
393
394
|
if (m.current) {
|
|
394
|
-
|
|
395
|
+
h();
|
|
395
396
|
return;
|
|
396
397
|
}
|
|
397
|
-
const E =
|
|
398
|
-
document.body.appendChild(E), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), a(!0), await
|
|
399
|
-
} catch (
|
|
400
|
-
l(!0),
|
|
398
|
+
const E = y(g, t);
|
|
399
|
+
document.body.appendChild(E), document.documentElement.classList.add("rp-print-html-printing"), document.body.classList.add("rp-print-body-printing"), a(!0), await P();
|
|
400
|
+
} catch (s) {
|
|
401
|
+
l(!0), s instanceof Error && p(s);
|
|
401
402
|
} finally {
|
|
402
403
|
f.height = 0, f.width = 0;
|
|
403
404
|
}
|
|
404
405
|
}, [e, t, m]);
|
|
405
406
|
return k(() => {
|
|
406
407
|
const f = () => {
|
|
407
|
-
|
|
408
|
+
h(), v();
|
|
408
409
|
};
|
|
409
410
|
return window.addEventListener("afterprint", f, !0), () => {
|
|
410
411
|
window.removeEventListener("afterprint", f, !0);
|
|
411
412
|
};
|
|
412
|
-
}, [v,
|
|
413
|
+
}, [v, h]), {
|
|
413
414
|
print: d,
|
|
414
415
|
cancel: w,
|
|
415
416
|
progress: n,
|
|
416
417
|
isComplete: r,
|
|
417
|
-
isError:
|
|
418
|
+
isError: c,
|
|
418
419
|
error: u
|
|
419
420
|
};
|
|
420
421
|
}, _n = Ye({
|
|
@@ -435,9 +436,9 @@ const So = () => {
|
|
|
435
436
|
}
|
|
436
437
|
}
|
|
437
438
|
}), Hs = ({ children: e }) => {
|
|
438
|
-
const [t, n] = $(null), [o, r] = $(null), { print: a, cancel:
|
|
439
|
+
const [t, n] = $(null), [o, r] = $(null), { print: a, cancel: c, progress: l, isComplete: u, isError: p, error: m } = So(), v = N((C) => {
|
|
439
440
|
C && typeof C == "function" && r(() => C);
|
|
440
|
-
}, []),
|
|
441
|
+
}, []), h = (C) => {
|
|
441
442
|
m && C(m);
|
|
442
443
|
}, w = N(
|
|
443
444
|
(C) => {
|
|
@@ -448,50 +449,50 @@ const So = () => {
|
|
|
448
449
|
k(() => {
|
|
449
450
|
u && o && T();
|
|
450
451
|
}, [u, o]), k(() => {
|
|
451
|
-
|
|
452
|
+
p && h((C) => {
|
|
452
453
|
console.error(C);
|
|
453
454
|
});
|
|
454
|
-
}, [
|
|
455
|
+
}, [p]), k(() => {
|
|
455
456
|
l && t && t(l);
|
|
456
457
|
}, [l, t]);
|
|
457
458
|
const T = () => {
|
|
458
459
|
o && (o(), r(null));
|
|
459
|
-
},
|
|
460
|
+
}, P = {
|
|
460
461
|
print: a,
|
|
461
|
-
cancel:
|
|
462
|
+
cancel: c,
|
|
462
463
|
setOnProgress: w,
|
|
463
464
|
setOnComplete: v,
|
|
464
|
-
setOnError:
|
|
465
|
+
setOnError: h,
|
|
465
466
|
progress: l
|
|
466
467
|
};
|
|
467
|
-
return /* @__PURE__ */ i(_n.Provider, { value:
|
|
468
|
+
return /* @__PURE__ */ i(_n.Provider, { value: P, children: e });
|
|
468
469
|
}, tt = () => {
|
|
469
470
|
const e = Je(_n);
|
|
470
471
|
if (!e)
|
|
471
472
|
throw new Error("usePrintContext must be used within a PrintProvider");
|
|
472
473
|
return e;
|
|
473
474
|
}, yo = () => {
|
|
474
|
-
const [e, t] = $({}), { pages: n } = J(), { rotate: o } = Ge(), r =
|
|
475
|
+
const [e, t] = $({}), { pages: n } = J(), { rotate: o } = Ge(), r = M(() => Object.keys(e).length, [e]), a = N(
|
|
475
476
|
(l) => {
|
|
476
477
|
if (!n.size || l > n.size)
|
|
477
478
|
return;
|
|
478
479
|
const u = Array.from(n.values()).slice(0, l).map((v) => {
|
|
479
|
-
const { thumbnailViewport:
|
|
480
|
+
const { thumbnailViewport: h, scale: w } = kt(v.page, o);
|
|
480
481
|
return {
|
|
481
482
|
scale: w,
|
|
482
483
|
page: v.page,
|
|
483
484
|
loading: !0,
|
|
484
|
-
viewport:
|
|
485
|
+
viewport: h
|
|
485
486
|
};
|
|
486
|
-
}),
|
|
487
|
-
t(
|
|
487
|
+
}), p = u.reduce((v, h) => (v[h.page.pageNumber] = h, v), {});
|
|
488
|
+
t(p);
|
|
488
489
|
const m = [];
|
|
489
490
|
for (const v of u) {
|
|
490
|
-
const
|
|
491
|
+
const h = document.createElement("canvas"), w = vt(v.page, h, {
|
|
491
492
|
scale: v.scale,
|
|
492
493
|
rotate: o
|
|
493
494
|
}).promise.then(() => {
|
|
494
|
-
const T =
|
|
495
|
+
const T = h.toDataURL();
|
|
495
496
|
return {
|
|
496
497
|
...v,
|
|
497
498
|
thumbnailSrc: T,
|
|
@@ -501,11 +502,11 @@ const So = () => {
|
|
|
501
502
|
m.push(w);
|
|
502
503
|
}
|
|
503
504
|
Promise.all(m).then((v) => {
|
|
504
|
-
const
|
|
505
|
+
const h = v.reduce(
|
|
505
506
|
(w, T) => (w[T.page.pageNumber] = T, w),
|
|
506
507
|
{}
|
|
507
508
|
);
|
|
508
|
-
t((w) => ({ ...w, ...
|
|
509
|
+
t((w) => ({ ...w, ...h }));
|
|
509
510
|
}).catch(() => {
|
|
510
511
|
});
|
|
511
512
|
},
|
|
@@ -514,7 +515,7 @@ const So = () => {
|
|
|
514
515
|
k(() => {
|
|
515
516
|
a(10);
|
|
516
517
|
}, [a]);
|
|
517
|
-
const
|
|
518
|
+
const c = N(
|
|
518
519
|
(l) => {
|
|
519
520
|
if (!n)
|
|
520
521
|
return;
|
|
@@ -530,11 +531,11 @@ const So = () => {
|
|
|
530
531
|
scale: u.thumbnailScale
|
|
531
532
|
}
|
|
532
533
|
}));
|
|
533
|
-
const
|
|
534
|
-
vt(u.page,
|
|
535
|
-
const m =
|
|
534
|
+
const p = document.createElement("canvas");
|
|
535
|
+
vt(u.page, p, { scale: u.thumbnailScale, rotate: o }).promise.then(() => {
|
|
536
|
+
const m = p.toDataURL(), { thumbnailViewport: v, scale: h } = kt(u.page, o);
|
|
536
537
|
return {
|
|
537
|
-
scale:
|
|
538
|
+
scale: h,
|
|
538
539
|
thumbnailSrc: m,
|
|
539
540
|
page: u.page,
|
|
540
541
|
loading: !1,
|
|
@@ -546,7 +547,7 @@ const So = () => {
|
|
|
546
547
|
},
|
|
547
548
|
[n, o]
|
|
548
549
|
);
|
|
549
|
-
return { thumbnailPages: e, addPage:
|
|
550
|
+
return { thumbnailPages: e, addPage: c, addToPage: a, thumbnailLength: r };
|
|
550
551
|
}, bn = Ye({
|
|
551
552
|
thumbnailPages: {},
|
|
552
553
|
addPage: (e) => {
|
|
@@ -561,16 +562,16 @@ const So = () => {
|
|
|
561
562
|
children: e,
|
|
562
563
|
initialThumbnailsVisible: t
|
|
563
564
|
}) => {
|
|
564
|
-
const { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength: a } = yo(), [
|
|
565
|
+
const { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength: a } = yo(), [c, l] = $(t);
|
|
565
566
|
return /* @__PURE__ */ i(
|
|
566
567
|
bn.Provider,
|
|
567
568
|
{
|
|
568
|
-
value: { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength: a, active:
|
|
569
|
+
value: { thumbnailPages: n, addPage: o, addToPage: r, thumbnailLength: a, active: c, setActive: l },
|
|
569
570
|
children: e
|
|
570
571
|
}
|
|
571
572
|
);
|
|
572
573
|
}, xo = (e = {}, t = "") => {
|
|
573
|
-
const [n, o] = $(t), [r, a] = $(!1), { pdf:
|
|
574
|
+
const [n, o] = $(t), [r, a] = $(!1), { pdf: c, pages: l } = J(), { widths: u, heights: p } = qe(), m = H(!n), { currentZoom: v } = Qe(), [h, w] = $([]), { setFocusedPage: T } = ie(), { columnCount: P } = Ae(), { rotate: C } = Ge(), [y, d] = $(0), { pageScrollElementRef: f, virtualScrollableElementRef: g } = et(), { scrollMode: s } = De(), { pagesRef: b } = ge(), [_, S] = $(null), E = H({}), x = M(() => y === 0 ? null : h[y - 1], [y, h]), R = M(() => h.length, [h]);
|
|
574
575
|
k(() => {
|
|
575
576
|
if (!x || !l)
|
|
576
577
|
return;
|
|
@@ -578,19 +579,19 @@ const So = () => {
|
|
|
578
579
|
if (!L || !b)
|
|
579
580
|
return;
|
|
580
581
|
const I = l.get(x.page);
|
|
581
|
-
if (
|
|
582
|
+
if (s === ee.PAGE_SCROLLING && T(x.page), !I)
|
|
582
583
|
return;
|
|
583
|
-
let O = 0,
|
|
584
|
-
if (
|
|
585
|
-
const ae = x.page - 1, de =
|
|
586
|
-
O = Oe(
|
|
584
|
+
let O = 0, W = 0;
|
|
585
|
+
if (s === ee.VERTICAL_SCROLLING) {
|
|
586
|
+
const ae = x.page - 1, de = P, te = ae % de, ze = Math.floor(ae / de);
|
|
587
|
+
O = Oe(p, ze), W = Oe(u, te);
|
|
587
588
|
}
|
|
588
|
-
|
|
589
|
+
s === ee.HORIZONTAL_SCROLLING && (W = u.slice(0, x.page - 1).reduce((ae, de) => ae + de, 0));
|
|
589
590
|
const G = {
|
|
590
591
|
top: b.clientHeight / 2,
|
|
591
592
|
left: b.clientWidth / 2
|
|
592
593
|
}, Z = {
|
|
593
|
-
height:
|
|
594
|
+
height: p[x.page - 1],
|
|
594
595
|
width: u[x.page - 1]
|
|
595
596
|
}, { leftInPage: j, topInPage: U } = Br(
|
|
596
597
|
Z,
|
|
@@ -598,7 +599,7 @@ const So = () => {
|
|
|
598
599
|
x.rect,
|
|
599
600
|
v,
|
|
600
601
|
C
|
|
601
|
-
), Q =
|
|
602
|
+
), Q = W + j, X = O + U, le = {
|
|
602
603
|
left: Math.max(Q, 0),
|
|
603
604
|
top: Math.max(X, 0)
|
|
604
605
|
};
|
|
@@ -609,26 +610,26 @@ const So = () => {
|
|
|
609
610
|
l,
|
|
610
611
|
T,
|
|
611
612
|
u,
|
|
612
|
-
|
|
613
|
+
p,
|
|
613
614
|
x,
|
|
614
|
-
|
|
615
|
+
s,
|
|
615
616
|
g,
|
|
616
617
|
f,
|
|
617
618
|
b
|
|
618
619
|
]);
|
|
619
620
|
const D = N(() => {
|
|
620
621
|
d((L) => R ? L + 1 > R ? 1 : L + 1 : 0);
|
|
621
|
-
}, [R]),
|
|
622
|
+
}, [R]), A = N(() => {
|
|
622
623
|
d((L) => R ? L - 1 <= 0 ? R : L - 1 : 0);
|
|
623
|
-
}, [R]),
|
|
624
|
+
}, [R]), z = N(async (L) => {
|
|
624
625
|
if (!L)
|
|
625
626
|
return {};
|
|
626
627
|
const I = L.numPages, O = {};
|
|
627
|
-
for (let
|
|
628
|
+
for (let W = 1; W <= I; W++) {
|
|
628
629
|
if (m.current)
|
|
629
630
|
throw "close pop over";
|
|
630
|
-
const G = await L.getPage(
|
|
631
|
-
O[
|
|
631
|
+
const G = await L.getPage(W);
|
|
632
|
+
O[W.toString()] = await G.getTextContent();
|
|
632
633
|
}
|
|
633
634
|
return O;
|
|
634
635
|
}, []);
|
|
@@ -637,33 +638,33 @@ const So = () => {
|
|
|
637
638
|
m.current = !0, w([]), d(0);
|
|
638
639
|
return;
|
|
639
640
|
}
|
|
640
|
-
m.current = !1, a(!0), w([]), d(0),
|
|
641
|
+
m.current = !1, a(!0), w([]), d(0), z(c).then((L) => {
|
|
641
642
|
E.current = L;
|
|
642
|
-
const O = Object.keys(L).reduce((
|
|
643
|
+
const O = Object.keys(L).reduce((W, G) => {
|
|
643
644
|
const Z = cr(
|
|
644
645
|
[n],
|
|
645
646
|
L[G],
|
|
646
647
|
Number(G) - 1,
|
|
647
648
|
e
|
|
648
649
|
).map((j, U) => ({ ...j, page: Number(G), pageMatchIdx: U }));
|
|
649
|
-
return [...
|
|
650
|
+
return [...W, ...Z];
|
|
650
651
|
}, []);
|
|
651
652
|
w(O), d(O.length ? 1 : 0);
|
|
652
653
|
}).catch(() => {
|
|
653
654
|
w([]), d(0);
|
|
654
655
|
}).finally(() => a(!1));
|
|
655
|
-
}, [n,
|
|
656
|
+
}, [n, z, c, e]), {
|
|
656
657
|
search: n,
|
|
657
658
|
setSearch: o,
|
|
658
659
|
loading: r,
|
|
659
|
-
matches:
|
|
660
|
+
matches: h,
|
|
660
661
|
totalMatches: R,
|
|
661
|
-
currentMatchPosition:
|
|
662
|
+
currentMatchPosition: y,
|
|
662
663
|
currentMatch: x,
|
|
663
664
|
nextMatch: D,
|
|
664
|
-
prevMatch:
|
|
665
|
+
prevMatch: A,
|
|
665
666
|
currentMatchElement: _,
|
|
666
|
-
setCurrentMatchElement:
|
|
667
|
+
setCurrentMatchElement: S
|
|
667
668
|
};
|
|
668
669
|
}, Tn = Ye({
|
|
669
670
|
search: "",
|
|
@@ -690,13 +691,13 @@ const So = () => {
|
|
|
690
691
|
const [n, o] = $({}), {
|
|
691
692
|
loading: r,
|
|
692
693
|
setSearch: a,
|
|
693
|
-
totalMatches:
|
|
694
|
+
totalMatches: c,
|
|
694
695
|
currentMatchPosition: l,
|
|
695
696
|
currentMatch: u,
|
|
696
|
-
search:
|
|
697
|
+
search: p,
|
|
697
698
|
matches: m,
|
|
698
699
|
nextMatch: v,
|
|
699
|
-
prevMatch:
|
|
700
|
+
prevMatch: h,
|
|
700
701
|
currentMatchElement: w,
|
|
701
702
|
setCurrentMatchElement: T
|
|
702
703
|
} = xo(n, t);
|
|
@@ -708,12 +709,12 @@ const So = () => {
|
|
|
708
709
|
setSearchOptions: o,
|
|
709
710
|
loading: r,
|
|
710
711
|
setSearch: a,
|
|
711
|
-
totalMatches:
|
|
712
|
+
totalMatches: c,
|
|
712
713
|
currentMatchPosition: l,
|
|
713
714
|
currentMatch: u,
|
|
714
715
|
nextMatch: v,
|
|
715
|
-
prevMatch:
|
|
716
|
-
search:
|
|
716
|
+
prevMatch: h,
|
|
717
|
+
search: p,
|
|
717
718
|
matches: m,
|
|
718
719
|
currentMatchElement: w,
|
|
719
720
|
setCurrentMatchElement: T
|
|
@@ -735,18 +736,18 @@ const So = () => {
|
|
|
735
736
|
"rp-page": "_rp-page_h7a2q_1",
|
|
736
737
|
"rp-loader-wrapper": "_rp-loader-wrapper_h7a2q_14"
|
|
737
738
|
}, Io = (e) => {
|
|
738
|
-
const { pageNumber: t, onLoaded: n, onLoading: o } = e, r = H(null), { pages: a } = J(), { rotate:
|
|
739
|
+
const { pageNumber: t, onLoaded: n, onLoading: o } = e, r = H(null), { pages: a } = J(), { rotate: c } = Ge(), l = H(), { currentZoom: u } = Qe();
|
|
739
740
|
return k(() => {
|
|
740
741
|
if (!a || u === 0)
|
|
741
742
|
return;
|
|
742
|
-
const
|
|
743
|
-
if (r.current &&
|
|
743
|
+
const p = a.get(t);
|
|
744
|
+
if (r.current && p) {
|
|
744
745
|
const m = r.current;
|
|
745
746
|
m.hidden = !0;
|
|
746
747
|
const v = l.current;
|
|
747
|
-
v && v.cancel(), o && o(), l.current = vt(
|
|
748
|
+
v && v.cancel(), o && o(), l.current = vt(p.page, m, {
|
|
748
749
|
scale: u,
|
|
749
|
-
rotate:
|
|
750
|
+
rotate: c,
|
|
750
751
|
renderForms: !0
|
|
751
752
|
}), l.current.promise.then(() => {
|
|
752
753
|
m.hidden = !1;
|
|
@@ -759,58 +760,58 @@ const So = () => {
|
|
|
759
760
|
var m;
|
|
760
761
|
(m = l.current) == null || m.cancel();
|
|
761
762
|
};
|
|
762
|
-
}, [a, t,
|
|
763
|
+
}, [a, t, c, u, o, n]), /* @__PURE__ */ i("canvas", { "data-rp": `page-${t}-canvas`, ref: r });
|
|
763
764
|
}, Ro = "_selecting_1x8te_9", Lo = "_endOfContent_1x8te_24", he = {
|
|
764
765
|
"rp-text-layer": "_rp-text-layer_1x8te_1",
|
|
765
766
|
selecting: Ro,
|
|
766
767
|
endOfContent: Lo,
|
|
767
768
|
"rp-text-layer-text": "_rp-text-layer-text_1x8te_38"
|
|
768
769
|
}, Eo = (e) => {
|
|
769
|
-
const { pageNumber: t } = e, { pages: n } = J(), o = H(null), { matches: r, currentMatch: a, setCurrentMatchElement:
|
|
770
|
+
const { pageNumber: t } = e, { pages: n } = J(), o = H(null), { matches: r, currentMatch: a, setCurrentMatchElement: c } = xt(), [l, u] = $(
|
|
770
771
|
[]
|
|
771
|
-
),
|
|
772
|
-
(f, g,
|
|
773
|
-
if (
|
|
772
|
+
), p = H(), m = H(), v = H(), h = M(() => r.filter((f) => f.pageIndex === t - 1), [r, t]), w = N(
|
|
773
|
+
(f, g, s = !1) => {
|
|
774
|
+
if (s && lr(f, g), !h.length) {
|
|
774
775
|
v.current = void 0, u([]);
|
|
775
776
|
return;
|
|
776
777
|
}
|
|
777
|
-
const b = dr(
|
|
778
|
+
const b = dr(h, f, g);
|
|
778
779
|
u(b);
|
|
779
780
|
},
|
|
780
|
-
[
|
|
781
|
-
), T = H(),
|
|
781
|
+
[h]
|
|
782
|
+
), T = H(), P = H(!1), C = N(() => Array.from(document.querySelectorAll('[data-rp$="-textLayer"]')), []);
|
|
782
783
|
k(() => ((() => {
|
|
783
784
|
if (T.current)
|
|
784
785
|
return;
|
|
785
786
|
T.current = new AbortController();
|
|
786
|
-
const { signal: g } = T.current,
|
|
787
|
+
const { signal: g } = T.current, s = () => {
|
|
787
788
|
C().forEach((_) => {
|
|
788
|
-
const
|
|
789
|
-
|
|
789
|
+
const S = _.querySelector(".endOfContent");
|
|
790
|
+
S && (_.appendChild(S), S.style.width = "", S.style.height = "", _.classList.remove(he.selecting));
|
|
790
791
|
});
|
|
791
792
|
};
|
|
792
793
|
document.addEventListener(
|
|
793
794
|
"pointerdown",
|
|
794
795
|
() => {
|
|
795
|
-
|
|
796
|
+
P.current = !0;
|
|
796
797
|
},
|
|
797
798
|
{ signal: g }
|
|
798
799
|
), document.addEventListener(
|
|
799
800
|
"pointerup",
|
|
800
801
|
() => {
|
|
801
|
-
|
|
802
|
+
P.current = !1, s();
|
|
802
803
|
},
|
|
803
804
|
{ signal: g }
|
|
804
805
|
), window.addEventListener(
|
|
805
806
|
"blur",
|
|
806
807
|
() => {
|
|
807
|
-
|
|
808
|
+
P.current = !1, s();
|
|
808
809
|
},
|
|
809
810
|
{ signal: g }
|
|
810
811
|
), document.addEventListener(
|
|
811
812
|
"keyup",
|
|
812
813
|
() => {
|
|
813
|
-
|
|
814
|
+
P.current || s();
|
|
814
815
|
},
|
|
815
816
|
{ signal: g }
|
|
816
817
|
);
|
|
@@ -818,23 +819,23 @@ const So = () => {
|
|
|
818
819
|
document.addEventListener(
|
|
819
820
|
"selectionchange",
|
|
820
821
|
() => {
|
|
821
|
-
var
|
|
822
|
+
var z, L;
|
|
822
823
|
const _ = document.getSelection();
|
|
823
824
|
if (!_)
|
|
824
825
|
return;
|
|
825
826
|
if (_.rangeCount === 0) {
|
|
826
|
-
|
|
827
|
+
s();
|
|
827
828
|
return;
|
|
828
829
|
}
|
|
829
|
-
const
|
|
830
|
+
const S = /* @__PURE__ */ new Set();
|
|
830
831
|
for (let I = 0; I < _.rangeCount; I++) {
|
|
831
832
|
const O = _.getRangeAt(I);
|
|
832
|
-
C().forEach((
|
|
833
|
-
O.intersectsNode(
|
|
833
|
+
C().forEach((W) => {
|
|
834
|
+
O.intersectsNode(W) && !S.has(W) && S.add(W);
|
|
834
835
|
});
|
|
835
836
|
}
|
|
836
837
|
C().forEach((I) => {
|
|
837
|
-
if (
|
|
838
|
+
if (S.has(I))
|
|
838
839
|
I.classList.add(he.selecting);
|
|
839
840
|
else {
|
|
840
841
|
const O = I.querySelector(".endOfContent");
|
|
@@ -844,10 +845,10 @@ const So = () => {
|
|
|
844
845
|
const E = _.getRangeAt(0);
|
|
845
846
|
let R = b && (E.compareBoundaryPoints(Range.END_TO_END, b) === 0 || E.compareBoundaryPoints(Range.START_TO_END, b) === 0) ? E.startContainer : E.endContainer;
|
|
846
847
|
R.nodeType === Node.TEXT_NODE && (R = R.parentNode);
|
|
847
|
-
const D = (
|
|
848
|
+
const D = (z = R.parentElement) == null ? void 0 : z.closest(
|
|
848
849
|
he["rp-text-layer"]
|
|
849
|
-
),
|
|
850
|
-
|
|
850
|
+
), A = D == null ? void 0 : D.querySelector(".endOfContent");
|
|
851
|
+
A && D && (A.style.width = D.style.width, A.style.height = D.style.height, (L = R.parentElement) == null || L.insertBefore(A, R.nextSibling)), b = E.cloneRange();
|
|
851
852
|
},
|
|
852
853
|
{ signal: g }
|
|
853
854
|
);
|
|
@@ -855,54 +856,54 @@ const So = () => {
|
|
|
855
856
|
var g;
|
|
856
857
|
(g = T.current) == null || g.abort(), T.current = void 0;
|
|
857
858
|
}), [C]);
|
|
858
|
-
const
|
|
859
|
+
const y = N(() => {
|
|
859
860
|
o.current && o.current.classList.add(he.selecting);
|
|
860
861
|
}, []), d = N(() => {
|
|
861
862
|
o.current && o.current.classList.remove(he.selecting);
|
|
862
863
|
}, []);
|
|
863
864
|
return k(() => {
|
|
864
|
-
var
|
|
865
|
-
if ((
|
|
865
|
+
var s;
|
|
866
|
+
if ((s = v.current) == null || s.classList.remove("selected"), !l.length || !a || a.pageIndex !== t - 1)
|
|
866
867
|
return;
|
|
867
|
-
const f =
|
|
868
|
+
const f = h.findIndex(
|
|
868
869
|
(b) => JSON.stringify(b) === JSON.stringify(a)
|
|
869
870
|
);
|
|
870
871
|
if (f === -1)
|
|
871
872
|
return;
|
|
872
873
|
const g = l.find((b) => b.index === f);
|
|
873
|
-
g && (v.current = g.element,
|
|
874
|
-
}, [a, l,
|
|
874
|
+
g && (v.current = g.element, c(g.element), g.element.classList.add("selected"));
|
|
875
|
+
}, [a, l, h]), k(() => {
|
|
875
876
|
const f = n.get(t);
|
|
876
877
|
if (!f || !o.current)
|
|
877
878
|
return;
|
|
878
879
|
const g = o.current;
|
|
879
|
-
return
|
|
880
|
+
return p.current && p.current.cancel(), f.page.getTextContent().then((s) => {
|
|
880
881
|
const b = f.page.getViewport({ scale: 1 });
|
|
881
|
-
return
|
|
882
|
+
return p.current = new Sr.TextLayer({
|
|
882
883
|
viewport: b,
|
|
883
|
-
textContentSource:
|
|
884
|
+
textContentSource: s,
|
|
884
885
|
container: g
|
|
885
|
-
}), m.current =
|
|
886
|
+
}), m.current = s, g && (g.innerText = ""), p.current.render();
|
|
886
887
|
}).then(() => {
|
|
887
|
-
var
|
|
888
|
+
var S, E;
|
|
888
889
|
[].slice.call(g.children).forEach((x) => {
|
|
889
890
|
x.classList.add(he["rp-text-layer-text"]), x.setAttribute("data-rp", "rp-text-layer-text");
|
|
890
891
|
});
|
|
891
|
-
const b = (
|
|
892
|
+
const b = (S = p.current) == null ? void 0 : S.textDivs;
|
|
892
893
|
b && m.current && w(m.current, b);
|
|
893
894
|
const _ = document.createElement("div");
|
|
894
895
|
_.className = "endOfContent", (E = o.current) == null || E.appendChild(_);
|
|
895
896
|
}).catch(() => {
|
|
896
897
|
}), () => {
|
|
897
|
-
var
|
|
898
|
-
(
|
|
898
|
+
var s;
|
|
899
|
+
(s = p.current) == null || s.cancel();
|
|
899
900
|
};
|
|
900
901
|
}, [n, t]), k(() => {
|
|
901
|
-
var
|
|
902
|
+
var s;
|
|
902
903
|
[].slice.call(o.current.children).forEach((b) => {
|
|
903
904
|
b.classList.add(he["rp-text-layer-text"]);
|
|
904
905
|
});
|
|
905
|
-
const g = (
|
|
906
|
+
const g = (s = p.current) == null ? void 0 : s.textDivs;
|
|
906
907
|
g && m.current && w(m.current, g, !0);
|
|
907
908
|
}, [w]), /* @__PURE__ */ i(
|
|
908
909
|
"div",
|
|
@@ -910,7 +911,7 @@ const So = () => {
|
|
|
910
911
|
"data-rp": `page-${t}-textLayer`,
|
|
911
912
|
className: he["rp-text-layer"],
|
|
912
913
|
ref: o,
|
|
913
|
-
onMouseDown:
|
|
914
|
+
onMouseDown: y,
|
|
914
915
|
onMouseUp: d
|
|
915
916
|
}
|
|
916
917
|
);
|
|
@@ -919,7 +920,7 @@ const So = () => {
|
|
|
919
920
|
};
|
|
920
921
|
let Oo = "https://unpkg.com/pdfjs-dist@4.4.168/web/images/";
|
|
921
922
|
const Do = (e) => {
|
|
922
|
-
const { pageNumber: t } = e, n = H(null), { pages: o, pdf: r } = J(), a = H(), [
|
|
923
|
+
const { pageNumber: t } = e, n = H(null), { pages: o, pdf: r } = J(), a = H(), [c, l] = $(), { setFocusedPage: u, goToPage: p } = ie(), { scrollMode: m } = De(), { print: v } = tt(), { download: h } = Hn(), w = M(() => o.get(t), [o, t]), T = M(() => w == null ? void 0 : w.page.getViewport(), [w]);
|
|
923
924
|
k(() => {
|
|
924
925
|
a.current && (a.current.div.replaceChildren(), a.current = void 0);
|
|
925
926
|
}, [r]), k(() => {
|
|
@@ -927,17 +928,17 @@ const Do = (e) => {
|
|
|
927
928
|
a.current = void 0, l(C), n.current && (n.current.innerText = "");
|
|
928
929
|
});
|
|
929
930
|
}, [w]);
|
|
930
|
-
const
|
|
931
|
+
const P = N(
|
|
931
932
|
(C) => {
|
|
932
|
-
!
|
|
933
|
+
!c || !r || (Er(C), Nr(C, r, c).then((y) => {
|
|
933
934
|
var d, f;
|
|
934
|
-
((d =
|
|
935
|
-
}), m === ee.PAGE_SCROLLING ?
|
|
935
|
+
((d = y == null ? void 0 : y.data) == null ? void 0 : d.action) === "Print" ? v() : ((f = y == null ? void 0 : y.data) == null ? void 0 : f.action) === "SaveAs" && h();
|
|
936
|
+
}), m === ee.PAGE_SCROLLING ? zt(C, c, r, (y) => u(y.pageIndex + 1)) : zt(C, c, r, (y) => p(y.pageIndex + 1)));
|
|
936
937
|
},
|
|
937
|
-
[r,
|
|
938
|
+
[r, c, p, u, m, v, h]
|
|
938
939
|
);
|
|
939
940
|
return k(() => {
|
|
940
|
-
if (!w || !
|
|
941
|
+
if (!w || !c)
|
|
941
942
|
return;
|
|
942
943
|
const C = w.page.getViewport();
|
|
943
944
|
if (a.current) {
|
|
@@ -946,15 +947,15 @@ const Do = (e) => {
|
|
|
946
947
|
});
|
|
947
948
|
return;
|
|
948
949
|
}
|
|
949
|
-
const
|
|
950
|
-
for (const g of
|
|
951
|
-
const { annotationType:
|
|
952
|
-
switch (
|
|
953
|
-
case
|
|
950
|
+
const y = /* @__PURE__ */ new Map([]);
|
|
951
|
+
for (const g of c) {
|
|
952
|
+
const { annotationType: s } = g;
|
|
953
|
+
switch (s) {
|
|
954
|
+
case At.Link:
|
|
954
955
|
Dr(g);
|
|
955
956
|
break;
|
|
956
|
-
case
|
|
957
|
-
Or(g, C,
|
|
957
|
+
case At.Widget:
|
|
958
|
+
Or(g, C, y);
|
|
958
959
|
break;
|
|
959
960
|
}
|
|
960
961
|
}
|
|
@@ -969,15 +970,15 @@ const Do = (e) => {
|
|
|
969
970
|
structTreeLayer: null,
|
|
970
971
|
page: w.page,
|
|
971
972
|
viewport: C.clone({ dontFlip: !0 })
|
|
972
|
-
}), n.current && Ft(n.current,
|
|
973
|
-
const g = await (r == null ? void 0 : r.hasJSActions()),
|
|
973
|
+
}), n.current && Ft(n.current, P);
|
|
974
|
+
const g = await (r == null ? void 0 : r.hasJSActions()), s = await (r == null ? void 0 : r.getFieldObjects());
|
|
974
975
|
if (d.signal.aborted)
|
|
975
976
|
throw "abort";
|
|
976
977
|
return (b = a.current) == null ? void 0 : b.render({
|
|
977
|
-
annotations:
|
|
978
|
+
annotations: c,
|
|
978
979
|
annotationStorage: r == null ? void 0 : r.annotationStorage,
|
|
979
980
|
hasJSActions: g,
|
|
980
|
-
fieldObjects:
|
|
981
|
+
fieldObjects: s,
|
|
981
982
|
div: n.current,
|
|
982
983
|
viewport: C.clone({ dontFlip: !0 }),
|
|
983
984
|
page: w.page,
|
|
@@ -988,14 +989,14 @@ const Do = (e) => {
|
|
|
988
989
|
enableScripting: !1
|
|
989
990
|
});
|
|
990
991
|
})().then(() => {
|
|
991
|
-
n.current &&
|
|
992
|
+
n.current && Ar(n.current, P);
|
|
992
993
|
}).catch((g) => {
|
|
993
994
|
if (g !== "abort")
|
|
994
995
|
throw g;
|
|
995
996
|
}), () => {
|
|
996
|
-
d.abort("clear"), n.current && Ft(n.current,
|
|
997
|
+
d.abort("clear"), n.current && Ft(n.current, P);
|
|
997
998
|
};
|
|
998
|
-
}, [r,
|
|
999
|
+
}, [r, c, P]), /* @__PURE__ */ i(
|
|
999
1000
|
"div",
|
|
1000
1001
|
{
|
|
1001
1002
|
"data-rp": `page-${t}-annotationLayer`,
|
|
@@ -1004,12 +1005,12 @@ const Do = (e) => {
|
|
|
1004
1005
|
ref: n
|
|
1005
1006
|
}
|
|
1006
1007
|
);
|
|
1007
|
-
},
|
|
1008
|
+
}, Ao = {
|
|
1008
1009
|
"rp-text-highlight": "_rp-text-highlight_jdkf8_1"
|
|
1009
|
-
},
|
|
1010
|
-
const [n, o] = $(), { pages: r } = J(), { highlightKeywords: a } = pr(),
|
|
1010
|
+
}, zo = ({ pageNumber: e, viewport: t }) => {
|
|
1011
|
+
const [n, o] = $(), { pages: r } = J(), { highlightKeywords: a } = pr(), c = !0, l = H(null), [u, p] = $(null), [m, v] = $([]);
|
|
1011
1012
|
k(() => {
|
|
1012
|
-
l.current &&
|
|
1013
|
+
l.current && p(l.current.parentElement);
|
|
1013
1014
|
}, [l]), k(() => {
|
|
1014
1015
|
(async () => {
|
|
1015
1016
|
const f = r.get(e);
|
|
@@ -1019,10 +1020,10 @@ const Do = (e) => {
|
|
|
1019
1020
|
o(g);
|
|
1020
1021
|
})();
|
|
1021
1022
|
}, [r, e]);
|
|
1022
|
-
const
|
|
1023
|
+
const h = M(() => a ? a.map((d) => {
|
|
1023
1024
|
var f, g;
|
|
1024
1025
|
return {
|
|
1025
|
-
...
|
|
1026
|
+
...zr(d.keyword, (f = d.options) == null ? void 0 : f.matchCase, (g = d.options) == null ? void 0 : g.wholeWords),
|
|
1026
1027
|
color: d.highlightColor
|
|
1027
1028
|
};
|
|
1028
1029
|
}) : [], [a]);
|
|
@@ -1030,15 +1031,15 @@ const Do = (e) => {
|
|
|
1030
1031
|
if (!d)
|
|
1031
1032
|
return;
|
|
1032
1033
|
const g = `[data-rp="page-${f}-textLayer"]`;
|
|
1033
|
-
return new Promise((
|
|
1034
|
+
return new Promise((s) => {
|
|
1034
1035
|
const b = d.querySelector(g);
|
|
1035
1036
|
if (b) {
|
|
1036
|
-
|
|
1037
|
+
s(b);
|
|
1037
1038
|
return;
|
|
1038
1039
|
}
|
|
1039
|
-
new MutationObserver((
|
|
1040
|
+
new MutationObserver((S, E) => {
|
|
1040
1041
|
const x = d.querySelector(g);
|
|
1041
|
-
x && (
|
|
1042
|
+
x && (s(x), E.disconnect());
|
|
1042
1043
|
}).observe(d, { childList: !0, subtree: !0 });
|
|
1043
1044
|
});
|
|
1044
1045
|
}
|
|
@@ -1052,32 +1053,32 @@ const Do = (e) => {
|
|
|
1052
1053
|
return;
|
|
1053
1054
|
}
|
|
1054
1055
|
new MutationObserver((b, _) => {
|
|
1055
|
-
const
|
|
1056
|
+
const S = d.querySelectorAll(
|
|
1056
1057
|
".vpv-text-layer-text"
|
|
1057
1058
|
);
|
|
1058
|
-
|
|
1059
|
+
S.length && (f(Array.from(S)), _.disconnect());
|
|
1059
1060
|
}).observe(d, { childList: !0, subtree: !0 });
|
|
1060
1061
|
});
|
|
1061
1062
|
}
|
|
1062
|
-
const
|
|
1063
|
+
const P = (d, f, g, s) => {
|
|
1063
1064
|
var Z;
|
|
1064
1065
|
const b = document.createRange(), _ = g.firstChild;
|
|
1065
1066
|
if (!_ || _.nodeType !== Node.TEXT_NODE)
|
|
1066
1067
|
return null;
|
|
1067
|
-
const
|
|
1068
|
-
if (E >
|
|
1068
|
+
const S = ((Z = _.textContent) == null ? void 0 : Z.length) ?? 0, E = s[0].charIdxInSpan, x = s.length === 1 ? E : s[s.length - 1].charIdxInSpan;
|
|
1069
|
+
if (E > S || x + 1 > S)
|
|
1069
1070
|
return null;
|
|
1070
1071
|
b.setStart(_, E), b.setEnd(_, x + 1);
|
|
1071
1072
|
const R = document.createElement("span");
|
|
1072
1073
|
R.style.width = "auto", b.surroundContents(R);
|
|
1073
|
-
const D = R.getBoundingClientRect(),
|
|
1074
|
+
const D = R.getBoundingClientRect(), A = d.getBoundingClientRect(), z = A.height, L = A.width, I = 100 * (D.left - A.left) / L, O = 100 * (D.top - A.top) / z, W = 100 * D.height / z, G = 100 * D.width / L;
|
|
1074
1075
|
return kr(R), {
|
|
1075
1076
|
keywordStr: f,
|
|
1076
1077
|
left: I,
|
|
1077
1078
|
top: O,
|
|
1078
|
-
height:
|
|
1079
|
+
height: W,
|
|
1079
1080
|
width: G,
|
|
1080
|
-
pageHeight:
|
|
1081
|
+
pageHeight: z,
|
|
1081
1082
|
pageWidth: L
|
|
1082
1083
|
};
|
|
1083
1084
|
};
|
|
@@ -1085,10 +1086,10 @@ const Do = (e) => {
|
|
|
1085
1086
|
const g = await w(u, d);
|
|
1086
1087
|
if (!g)
|
|
1087
1088
|
return;
|
|
1088
|
-
const
|
|
1089
|
-
if (
|
|
1090
|
-
const b =
|
|
1091
|
-
(
|
|
1089
|
+
const s = await T(g);
|
|
1090
|
+
if (s.length) {
|
|
1091
|
+
const b = s.map((S) => S.tagName === "BR" ? " " : S.textContent).reduce(
|
|
1092
|
+
(S, E, x) => S.concat(
|
|
1092
1093
|
E.split("").map((R, D) => ({
|
|
1093
1094
|
char: R,
|
|
1094
1095
|
charIdxInSpan: D,
|
|
@@ -1102,43 +1103,43 @@ const Do = (e) => {
|
|
|
1102
1103
|
spanIdx: 0
|
|
1103
1104
|
}
|
|
1104
1105
|
]
|
|
1105
|
-
).slice(1), _ =
|
|
1106
|
+
).slice(1), _ = y(g, f, s, b);
|
|
1106
1107
|
v(_);
|
|
1107
1108
|
}
|
|
1108
1109
|
}
|
|
1109
|
-
const
|
|
1110
|
+
const y = (d, f, g, s) => {
|
|
1110
1111
|
const b = f.length;
|
|
1111
|
-
if (!
|
|
1112
|
+
if (!s.length || !b)
|
|
1112
1113
|
return [];
|
|
1113
|
-
const _ = [],
|
|
1114
|
-
return
|
|
1115
|
-
const { keyword: x, regExp: R, wholeWords: D, color:
|
|
1116
|
-
if (!
|
|
1114
|
+
const _ = [], S = s.map((E) => E.char).join("");
|
|
1115
|
+
return h.forEach((E) => {
|
|
1116
|
+
const { keyword: x, regExp: R, wholeWords: D, color: A } = E, z = x;
|
|
1117
|
+
if (!z.trim())
|
|
1117
1118
|
return;
|
|
1118
1119
|
const L = R.flags.indexOf("g") === -1 ? new RegExp(R, `${R.flags}g`) : R;
|
|
1119
1120
|
let I;
|
|
1120
1121
|
const O = [];
|
|
1121
|
-
for (; (I = L.exec(
|
|
1122
|
-
D && !ur(
|
|
1122
|
+
for (; (I = L.exec(S)) !== null; )
|
|
1123
|
+
D && !ur(S, I.index, I[0].length) || O.push({
|
|
1123
1124
|
keyword: L,
|
|
1124
1125
|
startIndex: I.index,
|
|
1125
1126
|
endIndex: L.lastIndex
|
|
1126
1127
|
});
|
|
1127
|
-
const
|
|
1128
|
+
const W = O.map((G) => ({
|
|
1128
1129
|
keyword: G.keyword,
|
|
1129
|
-
indexes:
|
|
1130
|
-
color:
|
|
1130
|
+
indexes: s.slice(G.startIndex, G.endIndex),
|
|
1131
|
+
color: A
|
|
1131
1132
|
}));
|
|
1132
|
-
for (const G of
|
|
1133
|
+
for (const G of W) {
|
|
1133
1134
|
const Z = G.indexes.reduce(
|
|
1134
1135
|
(j, U) => (j[U.spanIdx] = (j[U.spanIdx] || []).concat([U]), j),
|
|
1135
1136
|
{}
|
|
1136
1137
|
);
|
|
1137
1138
|
for (const j of Object.values(Z))
|
|
1138
1139
|
if (j.length !== 1 || j[0].char.trim() !== "") {
|
|
1139
|
-
const U = j, Q = g[U[0].spanIdx], X =
|
|
1140
|
+
const U = j, Q = g[U[0].spanIdx], X = P(
|
|
1140
1141
|
d,
|
|
1141
|
-
|
|
1142
|
+
z,
|
|
1142
1143
|
Q,
|
|
1143
1144
|
U
|
|
1144
1145
|
);
|
|
@@ -1161,10 +1162,10 @@ const Do = (e) => {
|
|
|
1161
1162
|
console.error(f);
|
|
1162
1163
|
}
|
|
1163
1164
|
})();
|
|
1164
|
-
}, [
|
|
1165
|
+
}, [c, a, e, n, t]), /* @__PURE__ */ i(fe, { children: /* @__PURE__ */ i("div", { ref: l, "data-rp": `page-${e}-textHighlightLayer`, children: m.map((d, f) => /* @__PURE__ */ i(
|
|
1165
1166
|
"div",
|
|
1166
1167
|
{
|
|
1167
|
-
className:
|
|
1168
|
+
className: Ao["rp-text-highlight"],
|
|
1168
1169
|
style: {
|
|
1169
1170
|
top: `${d.top}%`,
|
|
1170
1171
|
left: `${d.left}%`,
|
|
@@ -1176,18 +1177,18 @@ const Do = (e) => {
|
|
|
1176
1177
|
f
|
|
1177
1178
|
)) }) });
|
|
1178
1179
|
}, It = $e((e, t) => {
|
|
1179
|
-
const { pageNumber: n, style: o, ...r } = e, { pages: a } = J(), { rotate:
|
|
1180
|
+
const { pageNumber: n, style: o, ...r } = e, { pages: a } = J(), { rotate: c } = Ge(), { textLayer: l } = or(), { currentZoom: u } = Qe(), p = H(a.get(n)), [m, v] = $(!1), h = H(null), [w, T] = $({
|
|
1180
1181
|
width: 0,
|
|
1181
1182
|
height: 0
|
|
1182
1183
|
});
|
|
1183
|
-
cn(t, () =>
|
|
1184
|
-
if (a && (
|
|
1185
|
-
const d =
|
|
1184
|
+
cn(t, () => h.current), k(() => {
|
|
1185
|
+
if (a && (p.current = a.get(n), p.current)) {
|
|
1186
|
+
const d = p.current.page.getViewport({ scale: u, rotation: c });
|
|
1186
1187
|
T(d);
|
|
1187
1188
|
}
|
|
1188
|
-
}, [a, n,
|
|
1189
|
-
const
|
|
1190
|
-
switch (
|
|
1189
|
+
}, [a, n, c, u]);
|
|
1190
|
+
const P = M(() => {
|
|
1191
|
+
switch (c) {
|
|
1191
1192
|
case 90:
|
|
1192
1193
|
return `${w.width / 2}px ${w.width / 2}px`;
|
|
1193
1194
|
case -90:
|
|
@@ -1196,22 +1197,22 @@ const Do = (e) => {
|
|
|
1196
1197
|
default:
|
|
1197
1198
|
return "center";
|
|
1198
1199
|
}
|
|
1199
|
-
}, [
|
|
1200
|
+
}, [c, w]), C = N(() => {
|
|
1200
1201
|
v(!0);
|
|
1201
|
-
}, []),
|
|
1202
|
+
}, []), y = N(() => {
|
|
1202
1203
|
v(!1);
|
|
1203
1204
|
}, []);
|
|
1204
1205
|
return /* @__PURE__ */ i(
|
|
1205
1206
|
"div",
|
|
1206
1207
|
{
|
|
1207
|
-
ref:
|
|
1208
|
+
ref: h,
|
|
1208
1209
|
id: `page-${n}`,
|
|
1209
1210
|
"data-rp": `page-${n}`,
|
|
1210
1211
|
...r,
|
|
1211
1212
|
style: {
|
|
1212
1213
|
...o,
|
|
1213
|
-
"--rp-rotate": `${
|
|
1214
|
-
"--rp-page-rotate-translate": `${
|
|
1214
|
+
"--rp-rotate": `${c}deg`,
|
|
1215
|
+
"--rp-page-rotate-translate": `${P}`,
|
|
1215
1216
|
"--scale-factor": u
|
|
1216
1217
|
},
|
|
1217
1218
|
className: lt["rp-page-wrapper"],
|
|
@@ -1224,10 +1225,10 @@ const Do = (e) => {
|
|
|
1224
1225
|
},
|
|
1225
1226
|
className: lt["rp-page"],
|
|
1226
1227
|
children: [
|
|
1227
|
-
/* @__PURE__ */ i(Io, { onLoading: C, onLoaded:
|
|
1228
|
+
/* @__PURE__ */ i(Io, { onLoading: C, onLoaded: y, pageNumber: n }),
|
|
1228
1229
|
m && /* @__PURE__ */ i("div", { className: lt["rp-loader-wrapper"], children: /* @__PURE__ */ i(Ct, {}) }),
|
|
1229
1230
|
l && /* @__PURE__ */ i(Eo, { pageNumber: n }),
|
|
1230
|
-
/* @__PURE__ */ i(
|
|
1231
|
+
/* @__PURE__ */ i(zo, { pageNumber: n, viewport: w }),
|
|
1231
1232
|
/* @__PURE__ */ i(Do, { pageNumber: n })
|
|
1232
1233
|
]
|
|
1233
1234
|
}
|
|
@@ -1265,12 +1266,12 @@ function Wo(e, t) {
|
|
|
1265
1266
|
function dt(e, t) {
|
|
1266
1267
|
t === void 0 && (t = Wo);
|
|
1267
1268
|
var n, o = [], r, a = !1;
|
|
1268
|
-
function
|
|
1269
|
+
function c() {
|
|
1269
1270
|
for (var l = [], u = 0; u < arguments.length; u++)
|
|
1270
1271
|
l[u] = arguments[u];
|
|
1271
1272
|
return a && n === this && t(l, o) || (r = e.apply(this, l), a = !0, n = this, o = l), r;
|
|
1272
1273
|
}
|
|
1273
|
-
return
|
|
1274
|
+
return c;
|
|
1274
1275
|
}
|
|
1275
1276
|
function Ut(e, t) {
|
|
1276
1277
|
if (e == null)
|
|
@@ -1328,130 +1329,130 @@ var Go = 150, qo = function(t) {
|
|
|
1328
1329
|
}, Be = null, Ze = null, je = null;
|
|
1329
1330
|
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (Be = /* @__PURE__ */ new WeakSet(), Ze = /* @__PURE__ */ new WeakSet(), je = /* @__PURE__ */ new WeakSet());
|
|
1330
1331
|
function Vo(e) {
|
|
1331
|
-
var t, n = e.getColumnOffset, o = e.getColumnStartIndexForOffset, r = e.getColumnStopIndexForStartIndex, a = e.getColumnWidth,
|
|
1332
|
-
return t = /* @__PURE__ */ function(
|
|
1333
|
-
Fo(d,
|
|
1332
|
+
var t, n = e.getColumnOffset, o = e.getColumnStartIndexForOffset, r = e.getColumnStopIndexForStartIndex, a = e.getColumnWidth, c = e.getEstimatedTotalHeight, l = e.getEstimatedTotalWidth, u = e.getOffsetForColumnAndAlignment, p = e.getOffsetForRowAndAlignment, m = e.getRowHeight, v = e.getRowOffset, h = e.getRowStartIndexForOffset, w = e.getRowStopIndexForStartIndex, T = e.initInstanceProps, P = e.shouldResetStyleCacheOnItemSizeChange, C = e.validateProps;
|
|
1333
|
+
return t = /* @__PURE__ */ function(y) {
|
|
1334
|
+
Fo(d, y);
|
|
1334
1335
|
function d(g) {
|
|
1335
|
-
var
|
|
1336
|
-
return
|
|
1337
|
-
instance: qt(
|
|
1336
|
+
var s;
|
|
1337
|
+
return s = y.call(this, g) || this, s._instanceProps = T(s.props, qt(s)), s._resetIsScrollingTimeoutId = null, s._outerRef = void 0, s.state = {
|
|
1338
|
+
instance: qt(s),
|
|
1338
1339
|
isScrolling: !1,
|
|
1339
1340
|
horizontalScrollDirection: "forward",
|
|
1340
|
-
scrollLeft: typeof
|
|
1341
|
-
scrollTop: typeof
|
|
1341
|
+
scrollLeft: typeof s.props.initialScrollLeft == "number" ? s.props.initialScrollLeft : 0,
|
|
1342
|
+
scrollTop: typeof s.props.initialScrollTop == "number" ? s.props.initialScrollTop : 0,
|
|
1342
1343
|
scrollUpdateWasRequested: !1,
|
|
1343
1344
|
verticalScrollDirection: "forward"
|
|
1344
|
-
},
|
|
1345
|
-
return
|
|
1345
|
+
}, s._callOnItemsRendered = void 0, s._callOnItemsRendered = dt(function(b, _, S, E, x, R, D, A) {
|
|
1346
|
+
return s.props.onItemsRendered({
|
|
1346
1347
|
overscanColumnStartIndex: b,
|
|
1347
1348
|
overscanColumnStopIndex: _,
|
|
1348
|
-
overscanRowStartIndex:
|
|
1349
|
+
overscanRowStartIndex: S,
|
|
1349
1350
|
overscanRowStopIndex: E,
|
|
1350
1351
|
visibleColumnStartIndex: x,
|
|
1351
1352
|
visibleColumnStopIndex: R,
|
|
1352
1353
|
visibleRowStartIndex: D,
|
|
1353
|
-
visibleRowStopIndex:
|
|
1354
|
+
visibleRowStopIndex: A
|
|
1354
1355
|
});
|
|
1355
|
-
}),
|
|
1356
|
-
return
|
|
1357
|
-
horizontalScrollDirection:
|
|
1356
|
+
}), s._callOnScroll = void 0, s._callOnScroll = dt(function(b, _, S, E, x) {
|
|
1357
|
+
return s.props.onScroll({
|
|
1358
|
+
horizontalScrollDirection: S,
|
|
1358
1359
|
scrollLeft: b,
|
|
1359
1360
|
scrollTop: _,
|
|
1360
1361
|
verticalScrollDirection: E,
|
|
1361
1362
|
scrollUpdateWasRequested: x
|
|
1362
1363
|
});
|
|
1363
|
-
}),
|
|
1364
|
-
var
|
|
1365
|
-
if (D.hasOwnProperty(
|
|
1366
|
-
|
|
1364
|
+
}), s._getItemStyle = void 0, s._getItemStyle = function(b, _) {
|
|
1365
|
+
var S = s.props, E = S.columnWidth, x = S.direction, R = S.rowHeight, D = s._getItemStyleCache(P && E, P && x, P && R), A = b + ":" + _, z;
|
|
1366
|
+
if (D.hasOwnProperty(A))
|
|
1367
|
+
z = D[A];
|
|
1367
1368
|
else {
|
|
1368
|
-
var L = n(
|
|
1369
|
-
D[
|
|
1369
|
+
var L = n(s.props, _, s._instanceProps), I = x === "rtl";
|
|
1370
|
+
D[A] = z = {
|
|
1370
1371
|
position: "absolute",
|
|
1371
1372
|
left: I ? void 0 : L,
|
|
1372
1373
|
right: I ? L : void 0,
|
|
1373
|
-
top: v(
|
|
1374
|
-
height: m(
|
|
1375
|
-
width: a(
|
|
1374
|
+
top: v(s.props, b, s._instanceProps),
|
|
1375
|
+
height: m(s.props, b, s._instanceProps),
|
|
1376
|
+
width: a(s.props, _, s._instanceProps)
|
|
1376
1377
|
};
|
|
1377
1378
|
}
|
|
1378
|
-
return
|
|
1379
|
-
},
|
|
1379
|
+
return z;
|
|
1380
|
+
}, s._getItemStyleCache = void 0, s._getItemStyleCache = dt(function(b, _, S) {
|
|
1380
1381
|
return {};
|
|
1381
|
-
}),
|
|
1382
|
-
var _ = b.currentTarget,
|
|
1383
|
-
|
|
1384
|
-
if (
|
|
1382
|
+
}), s._onScroll = function(b) {
|
|
1383
|
+
var _ = b.currentTarget, S = _.clientHeight, E = _.clientWidth, x = _.scrollLeft, R = _.scrollTop, D = _.scrollHeight, A = _.scrollWidth;
|
|
1384
|
+
s.setState(function(z) {
|
|
1385
|
+
if (z.scrollLeft === x && z.scrollTop === R)
|
|
1385
1386
|
return null;
|
|
1386
|
-
var L =
|
|
1387
|
+
var L = s.props.direction, I = x;
|
|
1387
1388
|
if (L === "rtl")
|
|
1388
1389
|
switch (jt()) {
|
|
1389
1390
|
case "negative":
|
|
1390
1391
|
I = -x;
|
|
1391
1392
|
break;
|
|
1392
1393
|
case "positive-descending":
|
|
1393
|
-
I =
|
|
1394
|
+
I = A - E - x;
|
|
1394
1395
|
break;
|
|
1395
1396
|
}
|
|
1396
|
-
I = Math.max(0, Math.min(I,
|
|
1397
|
-
var O = Math.max(0, Math.min(R, D -
|
|
1397
|
+
I = Math.max(0, Math.min(I, A - E));
|
|
1398
|
+
var O = Math.max(0, Math.min(R, D - S));
|
|
1398
1399
|
return {
|
|
1399
1400
|
isScrolling: !0,
|
|
1400
|
-
horizontalScrollDirection:
|
|
1401
|
+
horizontalScrollDirection: z.scrollLeft < x ? "forward" : "backward",
|
|
1401
1402
|
scrollLeft: I,
|
|
1402
1403
|
scrollTop: O,
|
|
1403
|
-
verticalScrollDirection:
|
|
1404
|
+
verticalScrollDirection: z.scrollTop < R ? "forward" : "backward",
|
|
1404
1405
|
scrollUpdateWasRequested: !1
|
|
1405
1406
|
};
|
|
1406
|
-
},
|
|
1407
|
-
},
|
|
1408
|
-
var _ =
|
|
1409
|
-
|
|
1410
|
-
},
|
|
1411
|
-
|
|
1412
|
-
},
|
|
1413
|
-
|
|
1407
|
+
}, s._resetIsScrollingDebounced);
|
|
1408
|
+
}, s._outerRefSetter = function(b) {
|
|
1409
|
+
var _ = s.props.outerRef;
|
|
1410
|
+
s._outerRef = b, typeof _ == "function" ? _(b) : _ != null && typeof _ == "object" && _.hasOwnProperty("current") && (_.current = b);
|
|
1411
|
+
}, s._resetIsScrollingDebounced = function() {
|
|
1412
|
+
s._resetIsScrollingTimeoutId !== null && Zt(s._resetIsScrollingTimeoutId), s._resetIsScrollingTimeoutId = Ho(s._resetIsScrolling, Go);
|
|
1413
|
+
}, s._resetIsScrolling = function() {
|
|
1414
|
+
s._resetIsScrollingTimeoutId = null, s.setState({
|
|
1414
1415
|
isScrolling: !1
|
|
1415
1416
|
}, function() {
|
|
1416
|
-
|
|
1417
|
+
s._getItemStyleCache(-1);
|
|
1417
1418
|
});
|
|
1418
|
-
},
|
|
1419
|
+
}, s;
|
|
1419
1420
|
}
|
|
1420
|
-
d.getDerivedStateFromProps = function(
|
|
1421
|
-
return Uo(
|
|
1421
|
+
d.getDerivedStateFromProps = function(s, b) {
|
|
1422
|
+
return Uo(s, b), C(s), null;
|
|
1422
1423
|
};
|
|
1423
1424
|
var f = d.prototype;
|
|
1424
|
-
return f.scrollTo = function(
|
|
1425
|
-
var b =
|
|
1426
|
-
b !== void 0 && (b = Math.max(0, b)), _ !== void 0 && (_ = Math.max(0, _)), this.setState(function(
|
|
1427
|
-
return b === void 0 && (b =
|
|
1428
|
-
horizontalScrollDirection:
|
|
1425
|
+
return f.scrollTo = function(s) {
|
|
1426
|
+
var b = s.scrollLeft, _ = s.scrollTop;
|
|
1427
|
+
b !== void 0 && (b = Math.max(0, b)), _ !== void 0 && (_ = Math.max(0, _)), this.setState(function(S) {
|
|
1428
|
+
return b === void 0 && (b = S.scrollLeft), _ === void 0 && (_ = S.scrollTop), S.scrollLeft === b && S.scrollTop === _ ? null : {
|
|
1429
|
+
horizontalScrollDirection: S.scrollLeft < b ? "forward" : "backward",
|
|
1429
1430
|
scrollLeft: b,
|
|
1430
1431
|
scrollTop: _,
|
|
1431
1432
|
scrollUpdateWasRequested: !0,
|
|
1432
|
-
verticalScrollDirection:
|
|
1433
|
+
verticalScrollDirection: S.scrollTop < _ ? "forward" : "backward"
|
|
1433
1434
|
};
|
|
1434
1435
|
}, this._resetIsScrollingDebounced);
|
|
1435
|
-
}, f.scrollToItem = function(
|
|
1436
|
-
var b =
|
|
1437
|
-
|
|
1438
|
-
var G =
|
|
1436
|
+
}, f.scrollToItem = function(s) {
|
|
1437
|
+
var b = s.align, _ = b === void 0 ? "auto" : b, S = s.columnIndex, E = s.rowIndex, x = this.props, R = x.columnCount, D = x.height, A = x.rowCount, z = x.width, L = this.state, I = L.scrollLeft, O = L.scrollTop, W = $o();
|
|
1438
|
+
S !== void 0 && (S = Math.max(0, Math.min(S, R - 1))), E !== void 0 && (E = Math.max(0, Math.min(E, A - 1)));
|
|
1439
|
+
var G = c(this.props, this._instanceProps), Z = l(this.props, this._instanceProps), j = Z > z ? W : 0, U = G > D ? W : 0;
|
|
1439
1440
|
this.scrollTo({
|
|
1440
|
-
scrollLeft:
|
|
1441
|
-
scrollTop: E !== void 0 ?
|
|
1441
|
+
scrollLeft: S !== void 0 ? u(this.props, S, _, I, this._instanceProps, U) : I,
|
|
1442
|
+
scrollTop: E !== void 0 ? p(this.props, E, _, O, this._instanceProps, j) : O
|
|
1442
1443
|
});
|
|
1443
1444
|
}, f.componentDidMount = function() {
|
|
1444
|
-
var
|
|
1445
|
+
var s = this.props, b = s.initialScrollLeft, _ = s.initialScrollTop;
|
|
1445
1446
|
if (this._outerRef != null) {
|
|
1446
|
-
var
|
|
1447
|
-
typeof b == "number" && (
|
|
1447
|
+
var S = this._outerRef;
|
|
1448
|
+
typeof b == "number" && (S.scrollLeft = b), typeof _ == "number" && (S.scrollTop = _);
|
|
1448
1449
|
}
|
|
1449
1450
|
this._callPropsCallbacks();
|
|
1450
1451
|
}, f.componentDidUpdate = function() {
|
|
1451
|
-
var
|
|
1452
|
+
var s = this.props.direction, b = this.state, _ = b.scrollLeft, S = b.scrollTop, E = b.scrollUpdateWasRequested;
|
|
1452
1453
|
if (E && this._outerRef != null) {
|
|
1453
1454
|
var x = this._outerRef;
|
|
1454
|
-
if (
|
|
1455
|
+
if (s === "rtl")
|
|
1455
1456
|
switch (jt()) {
|
|
1456
1457
|
case "negative":
|
|
1457
1458
|
x.scrollLeft = -_;
|
|
@@ -1466,30 +1467,30 @@ function Vo(e) {
|
|
|
1466
1467
|
}
|
|
1467
1468
|
else
|
|
1468
1469
|
x.scrollLeft = Math.max(0, _);
|
|
1469
|
-
x.scrollTop = Math.max(0,
|
|
1470
|
+
x.scrollTop = Math.max(0, S);
|
|
1470
1471
|
}
|
|
1471
1472
|
this._callPropsCallbacks();
|
|
1472
1473
|
}, f.componentWillUnmount = function() {
|
|
1473
1474
|
this._resetIsScrollingTimeoutId !== null && Zt(this._resetIsScrollingTimeoutId);
|
|
1474
1475
|
}, f.render = function() {
|
|
1475
|
-
var
|
|
1476
|
-
if (
|
|
1477
|
-
for (var Te = te; Te <=
|
|
1476
|
+
var s = this.props, b = s.children, _ = s.className, S = s.columnCount, E = s.direction, x = s.height, R = s.innerRef, D = s.innerElementType, A = s.innerTagName, z = s.itemData, L = s.itemKey, I = L === void 0 ? qo : L, O = s.outerElementType, W = s.outerTagName, G = s.rowCount, Z = s.style, j = s.useIsScrolling, U = s.width, Q = this.state.isScrolling, X = this._getHorizontalRangeToRender(), le = X[0], ae = X[1], de = this._getVerticalRangeToRender(), te = de[0], ze = de[1], Re = [];
|
|
1477
|
+
if (S > 0 && G)
|
|
1478
|
+
for (var Te = te; Te <= ze; Te++)
|
|
1478
1479
|
for (var we = le; we <= ae; we++)
|
|
1479
1480
|
Re.push(Ue(b, {
|
|
1480
1481
|
columnIndex: we,
|
|
1481
|
-
data:
|
|
1482
|
+
data: z,
|
|
1482
1483
|
isScrolling: j ? Q : void 0,
|
|
1483
1484
|
key: I({
|
|
1484
1485
|
columnIndex: we,
|
|
1485
|
-
data:
|
|
1486
|
+
data: z,
|
|
1486
1487
|
rowIndex: Te
|
|
1487
1488
|
}),
|
|
1488
1489
|
rowIndex: Te,
|
|
1489
1490
|
style: this._getItemStyle(Te, we)
|
|
1490
1491
|
}));
|
|
1491
|
-
var nt =
|
|
1492
|
-
return Ue(O ||
|
|
1492
|
+
var nt = c(this.props, this._instanceProps), rt = l(this.props, this._instanceProps);
|
|
1493
|
+
return Ue(O || W || "div", {
|
|
1493
1494
|
className: _,
|
|
1494
1495
|
onScroll: this._onScroll,
|
|
1495
1496
|
ref: this._outerRefSetter,
|
|
@@ -1502,7 +1503,7 @@ function Vo(e) {
|
|
|
1502
1503
|
willChange: "transform",
|
|
1503
1504
|
direction: E
|
|
1504
1505
|
}, Z)
|
|
1505
|
-
}, Ue(D ||
|
|
1506
|
+
}, Ue(D || A || "div", {
|
|
1506
1507
|
children: Re,
|
|
1507
1508
|
ref: R,
|
|
1508
1509
|
style: {
|
|
@@ -1512,27 +1513,27 @@ function Vo(e) {
|
|
|
1512
1513
|
}
|
|
1513
1514
|
}));
|
|
1514
1515
|
}, f._callPropsCallbacks = function() {
|
|
1515
|
-
var
|
|
1516
|
+
var s = this.props, b = s.columnCount, _ = s.onItemsRendered, S = s.onScroll, E = s.rowCount;
|
|
1516
1517
|
if (typeof _ == "function" && b > 0 && E > 0) {
|
|
1517
|
-
var x = this._getHorizontalRangeToRender(), R = x[0], D = x[1],
|
|
1518
|
-
this._callOnItemsRendered(R, D, I, O,
|
|
1518
|
+
var x = this._getHorizontalRangeToRender(), R = x[0], D = x[1], A = x[2], z = x[3], L = this._getVerticalRangeToRender(), I = L[0], O = L[1], W = L[2], G = L[3];
|
|
1519
|
+
this._callOnItemsRendered(R, D, I, O, A, z, W, G);
|
|
1519
1520
|
}
|
|
1520
|
-
if (typeof
|
|
1521
|
+
if (typeof S == "function") {
|
|
1521
1522
|
var Z = this.state, j = Z.horizontalScrollDirection, U = Z.scrollLeft, Q = Z.scrollTop, X = Z.scrollUpdateWasRequested, le = Z.verticalScrollDirection;
|
|
1522
1523
|
this._callOnScroll(U, Q, j, le, X);
|
|
1523
1524
|
}
|
|
1524
1525
|
}, f._getHorizontalRangeToRender = function() {
|
|
1525
|
-
var
|
|
1526
|
+
var s = this.props, b = s.columnCount, _ = s.overscanColumnCount, S = s.overscanColumnsCount, E = s.overscanCount, x = s.rowCount, R = this.state, D = R.horizontalScrollDirection, A = R.isScrolling, z = R.scrollLeft, L = _ || S || E || 1;
|
|
1526
1527
|
if (b === 0 || x === 0)
|
|
1527
1528
|
return [0, 0, 0, 0];
|
|
1528
|
-
var I = o(this.props,
|
|
1529
|
-
return [Math.max(0, I -
|
|
1529
|
+
var I = o(this.props, z, this._instanceProps), O = r(this.props, I, z, this._instanceProps), W = !A || D === "backward" ? Math.max(1, L) : 1, G = !A || D === "forward" ? Math.max(1, L) : 1;
|
|
1530
|
+
return [Math.max(0, I - W), Math.max(0, Math.min(b - 1, O + G)), I, O];
|
|
1530
1531
|
}, f._getVerticalRangeToRender = function() {
|
|
1531
|
-
var
|
|
1532
|
+
var s = this.props, b = s.columnCount, _ = s.overscanCount, S = s.overscanRowCount, E = s.overscanRowsCount, x = s.rowCount, R = this.state, D = R.isScrolling, A = R.verticalScrollDirection, z = R.scrollTop, L = S || E || _ || 1;
|
|
1532
1533
|
if (b === 0 || x === 0)
|
|
1533
1534
|
return [0, 0, 0, 0];
|
|
1534
|
-
var I =
|
|
1535
|
-
return [Math.max(0, I -
|
|
1535
|
+
var I = h(this.props, z, this._instanceProps), O = w(this.props, I, z, this._instanceProps), W = !D || A === "backward" ? Math.max(1, L) : 1, G = !D || A === "forward" ? Math.max(1, L) : 1;
|
|
1536
|
+
return [Math.max(0, I - W), Math.max(0, Math.min(x - 1, O + G)), I, O];
|
|
1536
1537
|
}, d;
|
|
1537
1538
|
}(Jn), t.defaultProps = {
|
|
1538
1539
|
direction: "ltr",
|
|
@@ -1541,9 +1542,9 @@ function Vo(e) {
|
|
|
1541
1542
|
}, t;
|
|
1542
1543
|
}
|
|
1543
1544
|
var Uo = function(t, n) {
|
|
1544
|
-
var o = t.children, r = t.direction, a = t.height,
|
|
1545
|
+
var o = t.children, r = t.direction, a = t.height, c = t.innerTagName, l = t.outerTagName, u = t.overscanColumnsCount, p = t.overscanCount, m = t.overscanRowsCount, v = t.width, h = n.instance;
|
|
1545
1546
|
if (process.env.NODE_ENV !== "production") {
|
|
1546
|
-
if (typeof
|
|
1547
|
+
if (typeof p == "number" && Be && !Be.has(h) && (Be.add(h), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof u == "number" || typeof m == "number") && Ze && !Ze.has(h) && (Ze.add(h), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (c != null || l != null) && je && !je.has(h) && (je.add(h), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), o == null)
|
|
1547
1548
|
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (o === null ? "null" : typeof o) + '" was specified.'));
|
|
1548
1549
|
switch (r) {
|
|
1549
1550
|
case "ltr":
|
|
@@ -1558,31 +1559,31 @@ var Uo = function(t, n) {
|
|
|
1558
1559
|
throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. ' + ('"' + (a === null ? "null" : typeof a) + '" was specified.'));
|
|
1559
1560
|
}
|
|
1560
1561
|
}, Kt = 50, Pn = function(t, n) {
|
|
1561
|
-
var o = t.rowCount, r = n.rowMetadataMap, a = n.estimatedRowHeight,
|
|
1562
|
-
if (
|
|
1563
|
-
var u = r[
|
|
1562
|
+
var o = t.rowCount, r = n.rowMetadataMap, a = n.estimatedRowHeight, c = n.lastMeasuredRowIndex, l = 0;
|
|
1563
|
+
if (c >= o && (c = o - 1), c >= 0) {
|
|
1564
|
+
var u = r[c];
|
|
1564
1565
|
l = u.offset + u.size;
|
|
1565
1566
|
}
|
|
1566
|
-
var
|
|
1567
|
+
var p = o - c - 1, m = p * a;
|
|
1567
1568
|
return l + m;
|
|
1568
1569
|
}, Sn = function(t, n) {
|
|
1569
|
-
var o = t.columnCount, r = n.columnMetadataMap, a = n.estimatedColumnWidth,
|
|
1570
|
-
if (
|
|
1571
|
-
var u = r[
|
|
1570
|
+
var o = t.columnCount, r = n.columnMetadataMap, a = n.estimatedColumnWidth, c = n.lastMeasuredColumnIndex, l = 0;
|
|
1571
|
+
if (c >= o && (c = o - 1), c >= 0) {
|
|
1572
|
+
var u = r[c];
|
|
1572
1573
|
l = u.offset + u.size;
|
|
1573
1574
|
}
|
|
1574
|
-
var
|
|
1575
|
+
var p = o - c - 1, m = p * a;
|
|
1575
1576
|
return l + m;
|
|
1576
1577
|
}, me = function(t, n, o, r) {
|
|
1577
|
-
var a,
|
|
1578
|
-
if (t === "column" ? (a = r.columnMetadataMap,
|
|
1578
|
+
var a, c, l;
|
|
1579
|
+
if (t === "column" ? (a = r.columnMetadataMap, c = n.columnWidth, l = r.lastMeasuredColumnIndex) : (a = r.rowMetadataMap, c = n.rowHeight, l = r.lastMeasuredRowIndex), o > l) {
|
|
1579
1580
|
var u = 0;
|
|
1580
1581
|
if (l >= 0) {
|
|
1581
|
-
var
|
|
1582
|
-
u =
|
|
1582
|
+
var p = a[l];
|
|
1583
|
+
u = p.offset + p.size;
|
|
1583
1584
|
}
|
|
1584
1585
|
for (var m = l + 1; m <= o; m++) {
|
|
1585
|
-
var v =
|
|
1586
|
+
var v = c(m);
|
|
1586
1587
|
a[m] = {
|
|
1587
1588
|
offset: u,
|
|
1588
1589
|
size: v
|
|
@@ -1592,34 +1593,34 @@ var Uo = function(t, n) {
|
|
|
1592
1593
|
}
|
|
1593
1594
|
return a[o];
|
|
1594
1595
|
}, Xt = function(t, n, o, r) {
|
|
1595
|
-
var a,
|
|
1596
|
-
t === "column" ? (a = o.columnMetadataMap,
|
|
1597
|
-
var l =
|
|
1598
|
-
return l >= r ? yn(t, n, o,
|
|
1599
|
-
}, yn = function(t, n, o, r, a,
|
|
1596
|
+
var a, c;
|
|
1597
|
+
t === "column" ? (a = o.columnMetadataMap, c = o.lastMeasuredColumnIndex) : (a = o.rowMetadataMap, c = o.lastMeasuredRowIndex);
|
|
1598
|
+
var l = c > 0 ? a[c].offset : 0;
|
|
1599
|
+
return l >= r ? yn(t, n, o, c, 0, r) : Bo(t, n, o, Math.max(0, c), r);
|
|
1600
|
+
}, yn = function(t, n, o, r, a, c) {
|
|
1600
1601
|
for (; a <= r; ) {
|
|
1601
1602
|
var l = a + Math.floor((r - a) / 2), u = me(t, n, l, o).offset;
|
|
1602
|
-
if (u ===
|
|
1603
|
+
if (u === c)
|
|
1603
1604
|
return l;
|
|
1604
|
-
u <
|
|
1605
|
+
u < c ? a = l + 1 : u > c && (r = l - 1);
|
|
1605
1606
|
}
|
|
1606
1607
|
return a > 0 ? a - 1 : 0;
|
|
1607
1608
|
}, Bo = function(t, n, o, r, a) {
|
|
1608
|
-
for (var
|
|
1609
|
+
for (var c = t === "column" ? n.columnCount : n.rowCount, l = 1; r < c && me(t, n, r, o).offset < a; )
|
|
1609
1610
|
r += l, l *= 2;
|
|
1610
|
-
return yn(t, n, o, Math.min(r,
|
|
1611
|
-
}, Yt = function(t, n, o, r, a,
|
|
1612
|
-
var u = t === "column" ? n.width : n.height,
|
|
1613
|
-
switch (r === "smart" && (a >=
|
|
1611
|
+
return yn(t, n, o, Math.min(r, c - 1), Math.floor(r / 2), a);
|
|
1612
|
+
}, Yt = function(t, n, o, r, a, c, l) {
|
|
1613
|
+
var u = t === "column" ? n.width : n.height, p = me(t, n, o, c), m = t === "column" ? Sn(n, c) : Pn(n, c), v = Math.max(0, Math.min(m - u, p.offset)), h = Math.max(0, p.offset - u + l + p.size);
|
|
1614
|
+
switch (r === "smart" && (a >= h - u && a <= v + u ? r = "auto" : r = "center"), r) {
|
|
1614
1615
|
case "start":
|
|
1615
1616
|
return v;
|
|
1616
1617
|
case "end":
|
|
1617
|
-
return
|
|
1618
|
+
return h;
|
|
1618
1619
|
case "center":
|
|
1619
|
-
return Math.round(
|
|
1620
|
+
return Math.round(h + (v - h) / 2);
|
|
1620
1621
|
case "auto":
|
|
1621
1622
|
default:
|
|
1622
|
-
return a >=
|
|
1623
|
+
return a >= h && a <= v ? a : h > v || a < h ? h : v;
|
|
1623
1624
|
}
|
|
1624
1625
|
}, Zo = /* @__PURE__ */ Vo({
|
|
1625
1626
|
getColumnOffset: function(t, n, o) {
|
|
@@ -1629,8 +1630,8 @@ var Uo = function(t, n) {
|
|
|
1629
1630
|
return Xt("column", t, o, n);
|
|
1630
1631
|
},
|
|
1631
1632
|
getColumnStopIndexForStartIndex: function(t, n, o, r) {
|
|
1632
|
-
for (var a = t.columnCount,
|
|
1633
|
-
m++,
|
|
1633
|
+
for (var a = t.columnCount, c = t.width, l = me("column", t, n, r), u = o + c, p = l.offset + l.size, m = n; m < a - 1 && p < u; )
|
|
1634
|
+
m++, p += me("column", t, m, r).size;
|
|
1634
1635
|
return m;
|
|
1635
1636
|
},
|
|
1636
1637
|
getColumnWidth: function(t, n, o) {
|
|
@@ -1638,11 +1639,11 @@ var Uo = function(t, n) {
|
|
|
1638
1639
|
},
|
|
1639
1640
|
getEstimatedTotalHeight: Pn,
|
|
1640
1641
|
getEstimatedTotalWidth: Sn,
|
|
1641
|
-
getOffsetForColumnAndAlignment: function(t, n, o, r, a,
|
|
1642
|
-
return Yt("column", t, n, o, r, a,
|
|
1642
|
+
getOffsetForColumnAndAlignment: function(t, n, o, r, a, c) {
|
|
1643
|
+
return Yt("column", t, n, o, r, a, c);
|
|
1643
1644
|
},
|
|
1644
|
-
getOffsetForRowAndAlignment: function(t, n, o, r, a,
|
|
1645
|
-
return Yt("row", t, n, o, r, a,
|
|
1645
|
+
getOffsetForRowAndAlignment: function(t, n, o, r, a, c) {
|
|
1646
|
+
return Yt("row", t, n, o, r, a, c);
|
|
1646
1647
|
},
|
|
1647
1648
|
getRowOffset: function(t, n, o) {
|
|
1648
1649
|
return me("row", t, n, o).offset;
|
|
@@ -1654,12 +1655,12 @@ var Uo = function(t, n) {
|
|
|
1654
1655
|
return Xt("row", t, o, n);
|
|
1655
1656
|
},
|
|
1656
1657
|
getRowStopIndexForStartIndex: function(t, n, o, r) {
|
|
1657
|
-
for (var a = t.rowCount,
|
|
1658
|
-
m++,
|
|
1658
|
+
for (var a = t.rowCount, c = t.height, l = me("row", t, n, r), u = o + c, p = l.offset + l.size, m = n; m < a - 1 && p < u; )
|
|
1659
|
+
m++, p += me("row", t, m, r).size;
|
|
1659
1660
|
return m;
|
|
1660
1661
|
},
|
|
1661
1662
|
initInstanceProps: function(t, n) {
|
|
1662
|
-
var o = t, r = o.estimatedColumnWidth, a = o.estimatedRowHeight,
|
|
1663
|
+
var o = t, r = o.estimatedColumnWidth, a = o.estimatedRowHeight, c = {
|
|
1663
1664
|
columnMetadataMap: {},
|
|
1664
1665
|
estimatedColumnWidth: r || Kt,
|
|
1665
1666
|
estimatedRowHeight: a || Kt,
|
|
@@ -1678,9 +1679,9 @@ var Uo = function(t, n) {
|
|
|
1678
1679
|
shouldForceUpdate: u
|
|
1679
1680
|
});
|
|
1680
1681
|
}, n.resetAfterIndices = function(l) {
|
|
1681
|
-
var u = l.columnIndex,
|
|
1682
|
-
typeof u == "number" && (
|
|
1683
|
-
},
|
|
1682
|
+
var u = l.columnIndex, p = l.rowIndex, m = l.shouldForceUpdate, v = m === void 0 ? !0 : m;
|
|
1683
|
+
typeof u == "number" && (c.lastMeasuredColumnIndex = Math.min(c.lastMeasuredColumnIndex, u - 1)), typeof p == "number" && (c.lastMeasuredRowIndex = Math.min(c.lastMeasuredRowIndex, p - 1)), n._getItemStyleCache(-1), v && n.forceUpdate();
|
|
1684
|
+
}, c;
|
|
1684
1685
|
},
|
|
1685
1686
|
shouldResetStyleCacheOnItemSizeChange: !1,
|
|
1686
1687
|
validateProps: function(t) {
|
|
@@ -1709,31 +1710,31 @@ function Xo(e, t) {
|
|
|
1709
1710
|
return !Jt(n, r) && !Jt(o, a);
|
|
1710
1711
|
}
|
|
1711
1712
|
const Yo = () => {
|
|
1712
|
-
const { viewMode: e } =
|
|
1713
|
-
const
|
|
1714
|
-
return (!T[
|
|
1715
|
-
}, []), [r.widths,
|
|
1713
|
+
const { viewMode: e } = Ae(), { scrollMode: t } = De(), { setColumnCount: n } = dn(), { virtualScrollableElementRef: o } = et(), r = qe(), a = M(() => r.heights.length, [r.heights]), c = M(() => t === ee.HORIZONTAL_SCROLLING ? a : e === He.DUAL_PAGE ? 2 : 1, [e, t, t, a, o]), l = M(() => r.widths.reduce((T, P, C) => {
|
|
1714
|
+
const y = C % c;
|
|
1715
|
+
return (!T[y] || P > T[y]) && (T[y] = P), T;
|
|
1716
|
+
}, []), [r.widths, c]), u = N(
|
|
1716
1717
|
(w) => {
|
|
1717
1718
|
const T = w % l.length;
|
|
1718
1719
|
return l[T] || 0;
|
|
1719
1720
|
},
|
|
1720
1721
|
[l]
|
|
1721
|
-
),
|
|
1722
|
+
), p = N(
|
|
1722
1723
|
(w) => r.heights[w] || 0,
|
|
1723
1724
|
[r.heights]
|
|
1724
1725
|
);
|
|
1725
1726
|
k(() => {
|
|
1726
|
-
n(
|
|
1727
|
-
}, [
|
|
1728
|
-
const m =
|
|
1727
|
+
n(c);
|
|
1728
|
+
}, [c, n]);
|
|
1729
|
+
const m = M(() => t === ee.HORIZONTAL_SCROLLING || t === ee.PAGE_SCROLLING ? 1 : Math.round(a / c), [c, a, t]), v = M(() => r.heights.reduce((w, T) => w + T, 0) / r.heights.length || 0, [r]), h = M(() => r.widths.reduce((w, T) => w + T, 0) / r.heights.length || 0, [r]);
|
|
1729
1730
|
return {
|
|
1730
1731
|
rowCount: m,
|
|
1731
|
-
rowHeight:
|
|
1732
|
-
columnCount:
|
|
1732
|
+
rowHeight: p,
|
|
1733
|
+
columnCount: c,
|
|
1733
1734
|
columnWidth: u,
|
|
1734
1735
|
pageDimension: r,
|
|
1735
1736
|
estimatedRowHeight: v,
|
|
1736
|
-
estimatedColumnWidth:
|
|
1737
|
+
estimatedColumnWidth: h
|
|
1737
1738
|
};
|
|
1738
1739
|
};
|
|
1739
1740
|
let oe;
|
|
@@ -1753,71 +1754,71 @@ ht == null || tn == null ? (_t = pt, bt = function(t) {
|
|
|
1753
1754
|
return [n, o];
|
|
1754
1755
|
});
|
|
1755
1756
|
function Jo(e) {
|
|
1756
|
-
let t, n, o, r, a,
|
|
1757
|
+
let t, n, o, r, a, c, l;
|
|
1757
1758
|
const u = typeof document < "u" && document.attachEvent;
|
|
1758
1759
|
if (!u) {
|
|
1759
|
-
|
|
1760
|
-
const d =
|
|
1761
|
-
g.scrollLeft = g.scrollWidth, g.scrollTop = g.scrollHeight,
|
|
1762
|
-
}, a = function(
|
|
1763
|
-
return
|
|
1764
|
-
}, l = function(
|
|
1765
|
-
if (
|
|
1760
|
+
c = function(y) {
|
|
1761
|
+
const d = y.__resizeTriggers__, f = d.firstElementChild, g = d.lastElementChild, s = f.firstElementChild;
|
|
1762
|
+
g.scrollLeft = g.scrollWidth, g.scrollTop = g.scrollHeight, s.style.width = f.offsetWidth + 1 + "px", s.style.height = f.offsetHeight + 1 + "px", f.scrollLeft = f.scrollWidth, f.scrollTop = f.scrollHeight;
|
|
1763
|
+
}, a = function(y) {
|
|
1764
|
+
return y.offsetWidth !== y.__resizeLast__.width || y.offsetHeight !== y.__resizeLast__.height;
|
|
1765
|
+
}, l = function(y) {
|
|
1766
|
+
if (y.target.className && typeof y.target.className.indexOf == "function" && y.target.className.indexOf("contract-trigger") < 0 && y.target.className.indexOf("expand-trigger") < 0)
|
|
1766
1767
|
return;
|
|
1767
1768
|
const d = this;
|
|
1768
|
-
|
|
1769
|
-
a(d) && (d.__resizeLast__.width = d.offsetWidth, d.__resizeLast__.height = d.offsetHeight, d.__resizeListeners__.forEach(function(
|
|
1770
|
-
|
|
1769
|
+
c(this), this.__resizeRAF__ && _t(this.__resizeRAF__), this.__resizeRAF__ = bt(function() {
|
|
1770
|
+
a(d) && (d.__resizeLast__.width = d.offsetWidth, d.__resizeLast__.height = d.offsetHeight, d.__resizeListeners__.forEach(function(s) {
|
|
1771
|
+
s.call(d, y);
|
|
1771
1772
|
}));
|
|
1772
1773
|
});
|
|
1773
1774
|
};
|
|
1774
|
-
let
|
|
1775
|
+
let h = !1, w = "";
|
|
1775
1776
|
o = "animationstart";
|
|
1776
1777
|
const T = "Webkit Moz O ms".split(" ");
|
|
1777
|
-
let
|
|
1778
|
+
let P = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), C = "";
|
|
1778
1779
|
{
|
|
1779
|
-
const
|
|
1780
|
-
if (
|
|
1780
|
+
const y = document.createElement("fakeelement");
|
|
1781
|
+
if (y.style.animationName !== void 0 && (h = !0), h === !1) {
|
|
1781
1782
|
for (let d = 0; d < T.length; d++)
|
|
1782
|
-
if (
|
|
1783
|
-
C = T[d], w = "-" + C.toLowerCase() + "-", o =
|
|
1783
|
+
if (y.style[T[d] + "AnimationName"] !== void 0) {
|
|
1784
|
+
C = T[d], w = "-" + C.toLowerCase() + "-", o = P[d], h = !0;
|
|
1784
1785
|
break;
|
|
1785
1786
|
}
|
|
1786
1787
|
}
|
|
1787
1788
|
}
|
|
1788
1789
|
n = "resizeanim", t = "@" + w + "keyframes " + n + " { from { opacity: 0; } to { opacity: 0; } } ", r = w + "animation: 1ms " + n + "; ";
|
|
1789
1790
|
}
|
|
1790
|
-
const
|
|
1791
|
-
if (!
|
|
1792
|
-
const w = (t || "") + ".resize-triggers { " + (r || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', T =
|
|
1793
|
-
|
|
1791
|
+
const p = function(h) {
|
|
1792
|
+
if (!h.getElementById("detectElementResize")) {
|
|
1793
|
+
const w = (t || "") + ".resize-triggers { " + (r || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', T = h.head || h.getElementsByTagName("head")[0], P = h.createElement("style");
|
|
1794
|
+
P.id = "detectElementResize", P.type = "text/css", e != null && P.setAttribute("nonce", e), P.styleSheet ? P.styleSheet.cssText = w : P.appendChild(h.createTextNode(w)), T.appendChild(P);
|
|
1794
1795
|
}
|
|
1795
1796
|
};
|
|
1796
1797
|
return {
|
|
1797
|
-
addResizeListener: function(
|
|
1798
|
+
addResizeListener: function(h, w) {
|
|
1798
1799
|
if (u)
|
|
1799
|
-
|
|
1800
|
+
h.attachEvent("onresize", w);
|
|
1800
1801
|
else {
|
|
1801
|
-
if (!
|
|
1802
|
-
const T =
|
|
1803
|
-
|
|
1802
|
+
if (!h.__resizeTriggers__) {
|
|
1803
|
+
const T = h.ownerDocument, P = oe.getComputedStyle(h);
|
|
1804
|
+
P && P.position === "static" && (h.style.position = "relative"), p(T), h.__resizeLast__ = {}, h.__resizeListeners__ = [], (h.__resizeTriggers__ = T.createElement("div")).className = "resize-triggers";
|
|
1804
1805
|
const C = T.createElement("div");
|
|
1805
1806
|
C.className = "expand-trigger", C.appendChild(T.createElement("div"));
|
|
1806
|
-
const
|
|
1807
|
-
|
|
1808
|
-
f.animationName === n &&
|
|
1809
|
-
},
|
|
1807
|
+
const y = T.createElement("div");
|
|
1808
|
+
y.className = "contract-trigger", h.__resizeTriggers__.appendChild(C), h.__resizeTriggers__.appendChild(y), h.appendChild(h.__resizeTriggers__), c(h), h.addEventListener("scroll", l, !0), o && (h.__resizeTriggers__.__animationListener__ = function(f) {
|
|
1809
|
+
f.animationName === n && c(h);
|
|
1810
|
+
}, h.__resizeTriggers__.addEventListener(o, h.__resizeTriggers__.__animationListener__));
|
|
1810
1811
|
}
|
|
1811
|
-
|
|
1812
|
+
h.__resizeListeners__.push(w);
|
|
1812
1813
|
}
|
|
1813
1814
|
},
|
|
1814
|
-
removeResizeListener: function(
|
|
1815
|
+
removeResizeListener: function(h, w) {
|
|
1815
1816
|
if (u)
|
|
1816
|
-
|
|
1817
|
-
else if (
|
|
1818
|
-
|
|
1817
|
+
h.detachEvent("onresize", w);
|
|
1818
|
+
else if (h.__resizeListeners__.splice(h.__resizeListeners__.indexOf(w), 1), !h.__resizeListeners__.length) {
|
|
1819
|
+
h.removeEventListener("scroll", l, !0), h.__resizeTriggers__.__animationListener__ && (h.__resizeTriggers__.removeEventListener(o, h.__resizeTriggers__.__animationListener__), h.__resizeTriggers__.__animationListener__ = null);
|
|
1819
1820
|
try {
|
|
1820
|
-
|
|
1821
|
+
h.__resizeTriggers__ = !h.removeChild(h.__resizeTriggers__);
|
|
1821
1822
|
} catch {
|
|
1822
1823
|
}
|
|
1823
1824
|
}
|
|
@@ -1839,16 +1840,16 @@ class Qo extends Qn {
|
|
|
1839
1840
|
onResize: r
|
|
1840
1841
|
} = this.props;
|
|
1841
1842
|
if (this._parentNode) {
|
|
1842
|
-
const a = window.getComputedStyle(this._parentNode) || {},
|
|
1843
|
-
(!n && (this.state.height !== w || this.state.scaledHeight !== v) || !o && (this.state.width !== T || this.state.scaledWidth !==
|
|
1843
|
+
const a = window.getComputedStyle(this._parentNode) || {}, c = parseFloat(a.paddingLeft || "0"), l = parseFloat(a.paddingRight || "0"), u = parseFloat(a.paddingTop || "0"), p = parseFloat(a.paddingBottom || "0"), m = this._parentNode.getBoundingClientRect(), v = m.height - u - p, h = m.width - c - l, w = this._parentNode.offsetHeight - u - p, T = this._parentNode.offsetWidth - c - l;
|
|
1844
|
+
(!n && (this.state.height !== w || this.state.scaledHeight !== v) || !o && (this.state.width !== T || this.state.scaledWidth !== h)) && (this.setState({
|
|
1844
1845
|
height: w,
|
|
1845
1846
|
width: T,
|
|
1846
1847
|
scaledHeight: v,
|
|
1847
|
-
scaledWidth:
|
|
1848
|
+
scaledWidth: h
|
|
1848
1849
|
}), typeof r == "function" && r({
|
|
1849
1850
|
height: w,
|
|
1850
1851
|
scaledHeight: v,
|
|
1851
|
-
scaledWidth:
|
|
1852
|
+
scaledWidth: h,
|
|
1852
1853
|
width: T
|
|
1853
1854
|
}));
|
|
1854
1855
|
}
|
|
@@ -1878,40 +1879,40 @@ class Qo extends Qn {
|
|
|
1878
1879
|
defaultWidth: o,
|
|
1879
1880
|
disableHeight: r = !1,
|
|
1880
1881
|
disableWidth: a = !1,
|
|
1881
|
-
doNotBailOutOnEmptyChildren:
|
|
1882
|
+
doNotBailOutOnEmptyChildren: c = !1,
|
|
1882
1883
|
nonce: l,
|
|
1883
1884
|
onResize: u,
|
|
1884
|
-
style:
|
|
1885
|
+
style: p = {},
|
|
1885
1886
|
tagName: m = "div",
|
|
1886
1887
|
...v
|
|
1887
1888
|
} = this.props, {
|
|
1888
|
-
height:
|
|
1889
|
+
height: h,
|
|
1889
1890
|
scaledHeight: w,
|
|
1890
1891
|
scaledWidth: T,
|
|
1891
|
-
width:
|
|
1892
|
+
width: P
|
|
1892
1893
|
} = this.state, C = {
|
|
1893
1894
|
overflow: "visible"
|
|
1894
|
-
},
|
|
1895
|
+
}, y = {};
|
|
1895
1896
|
let d = !1;
|
|
1896
|
-
return r || (
|
|
1897
|
+
return r || (h === 0 && (d = !0), C.height = 0, y.height = h, y.scaledHeight = w), a || (P === 0 && (d = !0), C.width = 0, y.width = P, y.scaledWidth = T), c && (d = !1), Ue(m, {
|
|
1897
1898
|
ref: this._setRef,
|
|
1898
1899
|
style: {
|
|
1899
1900
|
...C,
|
|
1900
|
-
...
|
|
1901
|
+
...p
|
|
1901
1902
|
},
|
|
1902
1903
|
...v
|
|
1903
|
-
}, !d && t(
|
|
1904
|
+
}, !d && t(y));
|
|
1904
1905
|
}
|
|
1905
1906
|
}
|
|
1906
1907
|
const ei = ({ widths: e, heights: t }) => {
|
|
1907
|
-
const { focusedPage: n, totalPages: o } = ie(), r =
|
|
1908
|
+
const { focusedPage: n, totalPages: o } = ie(), r = M(() => {
|
|
1908
1909
|
const l = [], u = Math.ceil(n / 2) * 2 - 1;
|
|
1909
1910
|
if (l.push(u), u + 1 < o) {
|
|
1910
|
-
const
|
|
1911
|
-
l.push(
|
|
1911
|
+
const p = u + 1;
|
|
1912
|
+
l.push(p);
|
|
1912
1913
|
}
|
|
1913
1914
|
return l;
|
|
1914
|
-
}, [n, o]), a =
|
|
1915
|
+
}, [n, o]), a = M(() => [
|
|
1915
1916
|
{
|
|
1916
1917
|
position: "absolute",
|
|
1917
1918
|
left: 0,
|
|
@@ -1925,14 +1926,14 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
1925
1926
|
width: e(n),
|
|
1926
1927
|
height: t(n)
|
|
1927
1928
|
}
|
|
1928
|
-
], [e, t, r]),
|
|
1929
|
-
return /* @__PURE__ */ i("div", { style: { width:
|
|
1929
|
+
], [e, t, r]), c = M(() => a.reduce((l, u) => l + Number(u.width || 0), 0), [a]);
|
|
1930
|
+
return /* @__PURE__ */ i("div", { style: { width: c, position: "relative" }, children: r.map((l, u) => /* @__PURE__ */ i(It, { style: a[u], pageNumber: l }, l)) });
|
|
1930
1931
|
}, ti = ({ widths: e, heights: t }) => {
|
|
1931
|
-
const { focusedPage: n } = ie(), o =
|
|
1932
|
+
const { focusedPage: n } = ie(), o = M(() => ({
|
|
1932
1933
|
position: "absolute",
|
|
1933
1934
|
width: e(n - 1),
|
|
1934
1935
|
height: t(n - 1)
|
|
1935
|
-
}), [e, t, n]), r =
|
|
1936
|
+
}), [e, t, n]), r = M(() => e(n - 1), [e]);
|
|
1936
1937
|
return /* @__PURE__ */ i(
|
|
1937
1938
|
"div",
|
|
1938
1939
|
{
|
|
@@ -1944,23 +1945,23 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
1944
1945
|
}
|
|
1945
1946
|
);
|
|
1946
1947
|
}, ni = (e, t, n) => {
|
|
1947
|
-
const o = H(), { contentRef: r } = ge(), { heights: a, widths:
|
|
1948
|
-
const C =
|
|
1948
|
+
const o = H(), { contentRef: r } = ge(), { heights: a, widths: c } = qe(), { setFocusedPage: l } = ie(), [u, p] = $([]), { targetScrollPage: m } = un(), v = Tt(u, 0, 500), h = M(() => a.map((T, P) => {
|
|
1949
|
+
const C = c[P], y = Vr(P + 1, e), d = C * y.columnIndex, f = T * y.rowIndex, g = d + C, s = f + T;
|
|
1949
1950
|
return {
|
|
1950
|
-
pageNumber:
|
|
1951
|
-
...
|
|
1951
|
+
pageNumber: P + 1,
|
|
1952
|
+
...y,
|
|
1952
1953
|
width: C,
|
|
1953
1954
|
height: T,
|
|
1954
1955
|
startX: d,
|
|
1955
1956
|
startY: f,
|
|
1956
1957
|
endX: g,
|
|
1957
|
-
endY:
|
|
1958
|
+
endY: s
|
|
1958
1959
|
};
|
|
1959
|
-
}), [a,
|
|
1960
|
+
}), [a, c, e, t]);
|
|
1960
1961
|
k(() => {
|
|
1961
|
-
var
|
|
1962
|
+
var P;
|
|
1962
1963
|
v.length > 0 && !m.current && l(v[0].pageNumber);
|
|
1963
|
-
let T = (
|
|
1964
|
+
let T = (P = v[0]) == null ? void 0 : P.ratio;
|
|
1964
1965
|
T && v.filter((C) => Math.round(C.ratio) === Math.round(T)).some((C) => C.pageNumber === m.current) && setTimeout(() => {
|
|
1965
1966
|
m.current = void 0;
|
|
1966
1967
|
}, 500);
|
|
@@ -1968,25 +1969,25 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
1968
1969
|
const w = N(
|
|
1969
1970
|
(T) => {
|
|
1970
1971
|
o.current && cancelAnimationFrame(o.current), o.current = requestAnimationFrame(() => {
|
|
1971
|
-
const
|
|
1972
|
-
startTop:
|
|
1973
|
-
startLeft:
|
|
1974
|
-
endTop:
|
|
1975
|
-
endLeft:
|
|
1976
|
-
},
|
|
1972
|
+
const P = T.target, C = {
|
|
1973
|
+
startTop: P.scrollTop,
|
|
1974
|
+
startLeft: P.scrollLeft,
|
|
1975
|
+
endTop: P.scrollTop + P.clientHeight,
|
|
1976
|
+
endLeft: P.scrollLeft + P.clientWidth
|
|
1977
|
+
}, y = h.filter((d) => {
|
|
1977
1978
|
const f = d.endX >= C.startLeft && d.endY >= C.startTop, g = d.startX <= C.endLeft && d.startY <= C.endTop;
|
|
1978
1979
|
return f && g;
|
|
1979
1980
|
}).map((d) => {
|
|
1980
|
-
const f = C.startLeft > d.startX ? C.startLeft : d.startX, g = C.startTop > d.startY ? C.startTop : d.startY,
|
|
1981
|
+
const f = C.startLeft > d.startX ? C.startLeft : d.startX, g = C.startTop > d.startY ? C.startTop : d.startY, s = C.endLeft < d.endX ? C.endLeft : d.endX, b = C.endTop < d.endY ? C.endTop : d.endY, _ = s - f, S = b - g, x = +(_ * S / (d.width * d.height) * 100).toFixed(2);
|
|
1981
1982
|
return {
|
|
1982
1983
|
pageNumber: d.pageNumber,
|
|
1983
1984
|
ratio: x
|
|
1984
1985
|
};
|
|
1985
1986
|
}).sort((d, f) => f.ratio - d.ratio);
|
|
1986
|
-
|
|
1987
|
+
p(y);
|
|
1987
1988
|
});
|
|
1988
1989
|
},
|
|
1989
|
-
[r,
|
|
1990
|
+
[r, h]
|
|
1990
1991
|
);
|
|
1991
1992
|
k(() => {
|
|
1992
1993
|
if (n)
|
|
@@ -1999,28 +2000,28 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
1999
2000
|
return /* @__PURE__ */ i(It, { style: o, pageNumber: r }, r);
|
|
2000
2001
|
}, Xo), qs = () => {
|
|
2001
2002
|
const { initialPage: e = 1, initialScrollMode: t, instanceId: n } = ar(), { pagesRef: o, setPagesRef: r } = ge(), { scrollToPage: a } = vn(), {
|
|
2002
|
-
virtualScrollRef:
|
|
2003
|
+
virtualScrollRef: c,
|
|
2003
2004
|
getVirtualScrollRef: l,
|
|
2004
2005
|
getPageScrollElementRef: u,
|
|
2005
|
-
getVirtualScrollableElementRef:
|
|
2006
|
+
getVirtualScrollableElementRef: p,
|
|
2006
2007
|
setTotalInnerDimensions: m,
|
|
2007
2008
|
virtualScrollableElementRef: v,
|
|
2008
|
-
totalInnerDimensions:
|
|
2009
|
+
totalInnerDimensions: h,
|
|
2009
2010
|
pageScrollElementRef: w
|
|
2010
|
-
} = et(), T = H(!0), { nextPage:
|
|
2011
|
-
|
|
2011
|
+
} = et(), T = H(!0), { nextPage: P, prevPage: C, setFocusedPage: y, focusedPage: d } = ie(), { scrollMode: f } = De(), { viewMode: g } = Ae(), s = H(null), { loading: b } = J(), { passwordRequired: _ } = nr(), { LoaderImageComponent: S } = pn(), E = H(
|
|
2012
|
+
h
|
|
2012
2013
|
), x = H({
|
|
2013
2014
|
viewMode: g,
|
|
2014
2015
|
scrollMode: f
|
|
2015
|
-
}), R = H(!1), D = H(), { isFullScreen:
|
|
2016
|
-
pageDimension:
|
|
2016
|
+
}), R = H(!1), D = H(), { isFullScreen: A } = sr(), {
|
|
2017
|
+
pageDimension: z,
|
|
2017
2018
|
rowCount: L,
|
|
2018
2019
|
rowHeight: I,
|
|
2019
2020
|
columnCount: O,
|
|
2020
|
-
columnWidth:
|
|
2021
|
+
columnWidth: W,
|
|
2021
2022
|
estimatedColumnWidth: G,
|
|
2022
2023
|
estimatedRowHeight: Z
|
|
2023
|
-
} = Yo(), j = Tt(
|
|
2024
|
+
} = Yo(), j = Tt(h, 100), U = H();
|
|
2024
2025
|
ni(O, L, v);
|
|
2025
2026
|
const Q = H({
|
|
2026
2027
|
scrollTop: 0,
|
|
@@ -2029,27 +2030,27 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2029
2030
|
Gr(o);
|
|
2030
2031
|
const { isPressed: X } = Hr(), { selectionMode: le } = ir(), { initializeGrabScroll: ae, resetGrabState: de } = $r({
|
|
2031
2032
|
isPressed: X
|
|
2032
|
-
}), te =
|
|
2033
|
+
}), te = M(() => le === tr.HAND, [le]), ze = M(() => ({
|
|
2033
2034
|
columnCount: O
|
|
2034
2035
|
}), [O]), Re = N(
|
|
2035
2036
|
(q) => {
|
|
2036
2037
|
const V = document.activeElement !== o;
|
|
2037
|
-
!
|
|
2038
|
+
!A && V || (["ArrowUp", "ArrowLeft"].includes(q.key) ? (q.preventDefault(), C()) : ["ArrowDown", "ArrowRight"].includes(q.key) && (q.preventDefault(), P()));
|
|
2038
2039
|
},
|
|
2039
|
-
[
|
|
2040
|
+
[P, C, A, f]
|
|
2040
2041
|
);
|
|
2041
2042
|
k(() => (window.addEventListener("keydown", Re), () => {
|
|
2042
2043
|
window.removeEventListener("keydown", Re);
|
|
2043
2044
|
}), [Re]), k(() => {
|
|
2044
|
-
if (
|
|
2045
|
+
if (s.current && (s.current.style.position = "relative"), !!c)
|
|
2045
2046
|
for (let q = 0; q < L; q++)
|
|
2046
2047
|
for (let V = 0; V < O; V++)
|
|
2047
|
-
|
|
2048
|
+
c.resetAfterIndices({
|
|
2048
2049
|
columnIndex: V,
|
|
2049
2050
|
rowIndex: q,
|
|
2050
2051
|
shouldForceUpdate: !0
|
|
2051
2052
|
});
|
|
2052
|
-
}, [L, O,
|
|
2053
|
+
}, [L, O, z, c]);
|
|
2053
2054
|
const Te = N(
|
|
2054
2055
|
(q, V) => {
|
|
2055
2056
|
if (!v)
|
|
@@ -2081,7 +2082,7 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2081
2082
|
const jn = Se / Ot * ye, Kn = ot / Dt * it, Xn = Math.round(Math.min(jn, ye)) || 0, Yn = Math.round(Math.min(Kn, it)) || 0;
|
|
2082
2083
|
D.current = setTimeout(() => {
|
|
2083
2084
|
requestAnimationFrame(() => {
|
|
2084
|
-
|
|
2085
|
+
c == null || c.scrollTo({
|
|
2085
2086
|
scrollTop: Xn,
|
|
2086
2087
|
scrollLeft: Yn
|
|
2087
2088
|
});
|
|
@@ -2091,7 +2092,7 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2091
2092
|
width: V.width
|
|
2092
2093
|
};
|
|
2093
2094
|
},
|
|
2094
|
-
[
|
|
2095
|
+
[c, g, f, a]
|
|
2095
2096
|
);
|
|
2096
2097
|
k(() => {
|
|
2097
2098
|
clearTimeout(D.current);
|
|
@@ -2099,14 +2100,14 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2099
2100
|
(Se, ot, ye) => Se + I(ye),
|
|
2100
2101
|
0
|
|
2101
2102
|
), V = Array.from({ length: O }).reduce(
|
|
2102
|
-
(Se, ot, ye) => Se +
|
|
2103
|
+
(Se, ot, ye) => Se + W(ye),
|
|
2103
2104
|
0
|
|
2104
2105
|
), Pe = Te(V, q);
|
|
2105
2106
|
Q.current = Pe, we(Pe, { height: q, width: V }), m({
|
|
2106
2107
|
height: q,
|
|
2107
2108
|
width: V
|
|
2108
2109
|
});
|
|
2109
|
-
}, [
|
|
2110
|
+
}, [z, L, O, we]);
|
|
2110
2111
|
const nt = N(
|
|
2111
2112
|
(q) => {
|
|
2112
2113
|
Q.current = {
|
|
@@ -2119,7 +2120,7 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2119
2120
|
k(() => () => {
|
|
2120
2121
|
U.current && clearTimeout(U.current);
|
|
2121
2122
|
}, []);
|
|
2122
|
-
const rt =
|
|
2123
|
+
const rt = M(() => ne(ue["rp-pages-container"], {
|
|
2123
2124
|
[ue["rp-cursor-grab"]]: te && !X,
|
|
2124
2125
|
[ue["rp-cursor-grabbing"]]: te && X
|
|
2125
2126
|
}), [te, X]), Zn = N(
|
|
@@ -2136,16 +2137,16 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2136
2137
|
}, [b]), k(() => {
|
|
2137
2138
|
if (!(j.height === 0 || !T.current)) {
|
|
2138
2139
|
if (t === ee.PAGE_SCROLLING) {
|
|
2139
|
-
e !== d && w &&
|
|
2140
|
+
e !== d && w && y(e), T.current = !1;
|
|
2140
2141
|
return;
|
|
2141
2142
|
}
|
|
2142
|
-
a(e, "auto"),
|
|
2143
|
+
a(e, "auto"), y(e), T.current = !1;
|
|
2143
2144
|
}
|
|
2144
2145
|
}, [
|
|
2145
2146
|
a,
|
|
2146
2147
|
t,
|
|
2147
2148
|
w,
|
|
2148
|
-
|
|
2149
|
+
y,
|
|
2149
2150
|
j
|
|
2150
2151
|
]), /* @__PURE__ */ F(fe, { children: [
|
|
2151
2152
|
/* @__PURE__ */ i("div", { id: n, ref: r, tabIndex: -1, className: rt, children: /* @__PURE__ */ i(Qo, { style: { minHeight: "50px" }, children: ({ width: q, height: V }) => /* @__PURE__ */ i("div", { "data-rp": "pages", ref: Zn, style: { width: q, height: V }, children: f === ee.PAGE_SCROLLING ? /* @__PURE__ */ i(
|
|
@@ -2154,18 +2155,18 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2154
2155
|
ref: u,
|
|
2155
2156
|
style: { width: q, height: V },
|
|
2156
2157
|
className: ne(ue["rp-pages"], ue["rp-page-scrolling-wrapper"]),
|
|
2157
|
-
children: g === He.DUAL_PAGE ? /* @__PURE__ */ i(ei, { widths:
|
|
2158
|
+
children: g === He.DUAL_PAGE ? /* @__PURE__ */ i(ei, { widths: W, heights: I }) : /* @__PURE__ */ i(ti, { widths: W, heights: I })
|
|
2158
2159
|
}
|
|
2159
2160
|
) : G ? /* @__PURE__ */ i(
|
|
2160
2161
|
Zo,
|
|
2161
2162
|
{
|
|
2162
2163
|
ref: l,
|
|
2163
|
-
itemData:
|
|
2164
|
-
outerRef:
|
|
2165
|
-
innerRef:
|
|
2164
|
+
itemData: ze,
|
|
2165
|
+
outerRef: p,
|
|
2166
|
+
innerRef: s,
|
|
2166
2167
|
onScroll: nt,
|
|
2167
2168
|
columnCount: O,
|
|
2168
|
-
columnWidth:
|
|
2169
|
+
columnWidth: W,
|
|
2169
2170
|
rowHeight: I,
|
|
2170
2171
|
height: V,
|
|
2171
2172
|
width: q,
|
|
@@ -2189,7 +2190,7 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2189
2190
|
height: "100%",
|
|
2190
2191
|
width: "100%"
|
|
2191
2192
|
},
|
|
2192
|
-
children:
|
|
2193
|
+
children: S && /* @__PURE__ */ i(S, {})
|
|
2193
2194
|
}
|
|
2194
2195
|
) }) }) }),
|
|
2195
2196
|
_ && /* @__PURE__ */ i(qr, {})
|
|
@@ -2211,23 +2212,23 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2211
2212
|
const { nextIcon: e } = pe();
|
|
2212
2213
|
return e || /* @__PURE__ */ i(Me, { style: { transform: "rotate(180deg" } });
|
|
2213
2214
|
}, ai = () => {
|
|
2214
|
-
const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: o, prevPage: r, goToPage: a } = ie(), [
|
|
2215
|
+
const { focusedPage: e, totalPages: t, setFocusedPage: n, nextPage: o, prevPage: r, goToPage: a } = ie(), [c, l] = $(e.toString()), { pageNavigationTool: u = !0 } = ve(), { isSmallScreen: p } = Ce(), { localeMessages: m } = se();
|
|
2215
2216
|
k(() => {
|
|
2216
2217
|
l(e.toString());
|
|
2217
2218
|
}, [e]);
|
|
2218
|
-
const v = N((
|
|
2219
|
-
const C =
|
|
2219
|
+
const v = N((P) => {
|
|
2220
|
+
const C = P.target.value;
|
|
2220
2221
|
l(C);
|
|
2221
|
-
}, []),
|
|
2222
|
-
const
|
|
2223
|
-
|
|
2224
|
-
}, [a,
|
|
2222
|
+
}, []), h = N(async () => {
|
|
2223
|
+
const P = a(c);
|
|
2224
|
+
P.success || l(P.currentPage.toString());
|
|
2225
|
+
}, [a, c, t]), w = N(() => {
|
|
2225
2226
|
l(e.toString());
|
|
2226
2227
|
}, [e]), T = N(
|
|
2227
|
-
(
|
|
2228
|
-
|
|
2228
|
+
(P) => {
|
|
2229
|
+
P.key === "Enter" && h();
|
|
2229
2230
|
},
|
|
2230
|
-
[
|
|
2231
|
+
[h]
|
|
2231
2232
|
);
|
|
2232
2233
|
return typeof u != "boolean" ? /* @__PURE__ */ i(
|
|
2233
2234
|
u,
|
|
@@ -2240,7 +2241,7 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2240
2241
|
changePage: n
|
|
2241
2242
|
}
|
|
2242
2243
|
) : u ? /* @__PURE__ */ F("div", { className: mt["rp-paginate"], children: [
|
|
2243
|
-
!
|
|
2244
|
+
!p && /* @__PURE__ */ i(K, { content: m == null ? void 0 : m.previousPageTooltip, children: /* @__PURE__ */ i(
|
|
2244
2245
|
re,
|
|
2245
2246
|
{
|
|
2246
2247
|
onClick: r,
|
|
@@ -2255,7 +2256,7 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2255
2256
|
onKeyDown: T,
|
|
2256
2257
|
onBlur: w,
|
|
2257
2258
|
onChange: v,
|
|
2258
|
-
value:
|
|
2259
|
+
value: c,
|
|
2259
2260
|
className: mt["rp-page-input"]
|
|
2260
2261
|
}
|
|
2261
2262
|
) }),
|
|
@@ -2263,7 +2264,7 @@ const ei = ({ widths: e, heights: t }) => {
|
|
|
2263
2264
|
"/",
|
|
2264
2265
|
t
|
|
2265
2266
|
] }),
|
|
2266
|
-
!
|
|
2267
|
+
!p && /* @__PURE__ */ i(K, { content: m == null ? void 0 : m.nextPageTooltip, children: /* @__PURE__ */ i(
|
|
2267
2268
|
re,
|
|
2268
2269
|
{
|
|
2269
2270
|
onClick: o,
|
|
@@ -2281,8 +2282,8 @@ var Rt = "Dialog", [xn, Vs] = Xr(Rt), [si, ce] = xn(Rt), In = (e) => {
|
|
|
2281
2282
|
open: o,
|
|
2282
2283
|
defaultOpen: r,
|
|
2283
2284
|
onOpenChange: a,
|
|
2284
|
-
modal:
|
|
2285
|
-
} = e, l = B.useRef(null), u = B.useRef(null), [
|
|
2285
|
+
modal: c = !0
|
|
2286
|
+
} = e, l = B.useRef(null), u = B.useRef(null), [p = !1, m] = Qr({
|
|
2286
2287
|
prop: o,
|
|
2287
2288
|
defaultProp: r,
|
|
2288
2289
|
onChange: a
|
|
@@ -2296,10 +2297,10 @@ var Rt = "Dialog", [xn, Vs] = Xr(Rt), [si, ce] = xn(Rt), In = (e) => {
|
|
|
2296
2297
|
contentId: ct(),
|
|
2297
2298
|
titleId: ct(),
|
|
2298
2299
|
descriptionId: ct(),
|
|
2299
|
-
open:
|
|
2300
|
+
open: p,
|
|
2300
2301
|
onOpenChange: m,
|
|
2301
2302
|
onOpenToggle: B.useCallback(() => m((v) => !v), [m]),
|
|
2302
|
-
modal:
|
|
2303
|
+
modal: c,
|
|
2303
2304
|
children: n
|
|
2304
2305
|
}
|
|
2305
2306
|
);
|
|
@@ -2328,7 +2329,7 @@ var Lt = "DialogPortal", [li, Ln] = xn(Lt, {
|
|
|
2328
2329
|
forceMount: void 0
|
|
2329
2330
|
}), En = (e) => {
|
|
2330
2331
|
const { __scopeDialog: t, forceMount: n, children: o, container: r } = e, a = ce(Lt, t);
|
|
2331
|
-
return /* @__PURE__ */ i(li, { scope: t, forceMount: n, children: B.Children.map(o, (
|
|
2332
|
+
return /* @__PURE__ */ i(li, { scope: t, forceMount: n, children: B.Children.map(o, (c) => /* @__PURE__ */ i(St, { present: n || a.open, children: /* @__PURE__ */ i(oo, { asChild: !0, container: r, children: c }) })) });
|
|
2332
2333
|
};
|
|
2333
2334
|
En.displayName = Lt;
|
|
2334
2335
|
var Xe = "DialogOverlay", Nn = B.forwardRef(
|
|
@@ -2377,12 +2378,12 @@ var ui = B.forwardRef(
|
|
|
2377
2378
|
trapFocus: n.open,
|
|
2378
2379
|
disableOutsidePointerEvents: !0,
|
|
2379
2380
|
onCloseAutoFocus: We(e.onCloseAutoFocus, (a) => {
|
|
2380
|
-
var
|
|
2381
|
-
a.preventDefault(), (
|
|
2381
|
+
var c;
|
|
2382
|
+
a.preventDefault(), (c = n.triggerRef.current) == null || c.focus();
|
|
2382
2383
|
}),
|
|
2383
2384
|
onPointerDownOutside: We(e.onPointerDownOutside, (a) => {
|
|
2384
|
-
const
|
|
2385
|
-
(
|
|
2385
|
+
const c = a.detail.originalEvent, l = c.button === 0 && c.ctrlKey === !0;
|
|
2386
|
+
(c.button === 2 || l) && a.preventDefault();
|
|
2386
2387
|
}),
|
|
2387
2388
|
onFocusOutside: We(
|
|
2388
2389
|
e.onFocusOutside,
|
|
@@ -2402,21 +2403,21 @@ var ui = B.forwardRef(
|
|
|
2402
2403
|
trapFocus: !1,
|
|
2403
2404
|
disableOutsidePointerEvents: !1,
|
|
2404
2405
|
onCloseAutoFocus: (a) => {
|
|
2405
|
-
var
|
|
2406
|
-
(
|
|
2406
|
+
var c, l;
|
|
2407
|
+
(c = e.onCloseAutoFocus) == null || c.call(e, a), a.defaultPrevented || (o.current || (l = n.triggerRef.current) == null || l.focus(), a.preventDefault()), o.current = !1, r.current = !1;
|
|
2407
2408
|
},
|
|
2408
2409
|
onInteractOutside: (a) => {
|
|
2409
|
-
var u,
|
|
2410
|
+
var u, p;
|
|
2410
2411
|
(u = e.onInteractOutside) == null || u.call(e, a), a.defaultPrevented || (o.current = !0, a.detail.originalEvent.type === "pointerdown" && (r.current = !0));
|
|
2411
|
-
const
|
|
2412
|
-
((
|
|
2412
|
+
const c = a.target;
|
|
2413
|
+
((p = n.triggerRef.current) == null ? void 0 : p.contains(c)) && a.preventDefault(), a.detail.originalEvent.type === "focusin" && r.current && a.preventDefault();
|
|
2413
2414
|
}
|
|
2414
2415
|
}
|
|
2415
2416
|
);
|
|
2416
2417
|
}
|
|
2417
2418
|
), Dn = B.forwardRef(
|
|
2418
2419
|
(e, t) => {
|
|
2419
|
-
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: a, ...
|
|
2420
|
+
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: a, ...c } = e, l = ce(Ie, n), u = B.useRef(null), p = Pt(t, u);
|
|
2420
2421
|
return no(), /* @__PURE__ */ F(fe, { children: [
|
|
2421
2422
|
/* @__PURE__ */ i(
|
|
2422
2423
|
ro,
|
|
@@ -2434,8 +2435,8 @@ var ui = B.forwardRef(
|
|
|
2434
2435
|
"aria-describedby": l.descriptionId,
|
|
2435
2436
|
"aria-labelledby": l.titleId,
|
|
2436
2437
|
"data-state": Nt(l.open),
|
|
2437
|
-
...
|
|
2438
|
-
ref:
|
|
2438
|
+
...c,
|
|
2439
|
+
ref: p,
|
|
2439
2440
|
onDismiss: () => l.onOpenChange(!1)
|
|
2440
2441
|
}
|
|
2441
2442
|
)
|
|
@@ -2447,20 +2448,20 @@ var ui = B.forwardRef(
|
|
|
2447
2448
|
] })
|
|
2448
2449
|
] });
|
|
2449
2450
|
}
|
|
2450
|
-
), Et = "DialogTitle",
|
|
2451
|
+
), Et = "DialogTitle", An = B.forwardRef(
|
|
2451
2452
|
(e, t) => {
|
|
2452
2453
|
const { __scopeDialog: n, ...o } = e, r = ce(Et, n);
|
|
2453
2454
|
return /* @__PURE__ */ i(Ve.h2, { id: r.titleId, ...o, ref: t });
|
|
2454
2455
|
}
|
|
2455
2456
|
);
|
|
2456
|
-
|
|
2457
|
-
var
|
|
2457
|
+
An.displayName = Et;
|
|
2458
|
+
var zn = "DialogDescription", hi = B.forwardRef(
|
|
2458
2459
|
(e, t) => {
|
|
2459
|
-
const { __scopeDialog: n, ...o } = e, r = ce(
|
|
2460
|
+
const { __scopeDialog: n, ...o } = e, r = ce(zn, n);
|
|
2460
2461
|
return /* @__PURE__ */ i(Ve.p, { id: r.descriptionId, ...o, ref: t });
|
|
2461
2462
|
}
|
|
2462
2463
|
);
|
|
2463
|
-
hi.displayName =
|
|
2464
|
+
hi.displayName = zn;
|
|
2464
2465
|
var Fn = "DialogClose", kn = B.forwardRef(
|
|
2465
2466
|
(e, t) => {
|
|
2466
2467
|
const { __scopeDialog: n, ...o } = e, r = ce(Fn, n);
|
|
@@ -2499,7 +2500,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
2499
2500
|
const r = (a = e.current) == null ? void 0 : a.getAttribute("aria-describedby");
|
|
2500
2501
|
t && r && (document.getElementById(t) || console.warn(o));
|
|
2501
2502
|
}, [o, e, t]), null;
|
|
2502
|
-
}, vi = In, wi = En, _i = Nn, bi = On, Ci =
|
|
2503
|
+
}, vi = In, wi = En, _i = Nn, bi = On, Ci = An, Ti = kn;
|
|
2503
2504
|
const xe = {
|
|
2504
2505
|
"rp-dialog-wrapper": "_rp-dialog-wrapper_slqo7_1",
|
|
2505
2506
|
"rp-dialog-overlay": "_rp-dialog-overlay_slqo7_7",
|
|
@@ -2509,32 +2510,32 @@ const xe = {
|
|
|
2509
2510
|
"rp-dialog-close": "_rp-dialog-close_slqo7_47",
|
|
2510
2511
|
"rp-properties-divider": "_rp-properties-divider_slqo7_55"
|
|
2511
2512
|
}, Pi = () => {
|
|
2512
|
-
const { pdfProperties: e } = J(), { container: t } = ge(), { activeDocumentProperties: n, setActiveDocumentProperties: o } = co(), { localeMessages: r } = se(), a =
|
|
2513
|
+
const { pdfProperties: e } = J(), { container: t } = ge(), { activeDocumentProperties: n, setActiveDocumentProperties: o } = co(), { localeMessages: r } = se(), a = M(() => {
|
|
2513
2514
|
if (!e)
|
|
2514
2515
|
return [];
|
|
2515
2516
|
const {
|
|
2516
|
-
fileSize:
|
|
2517
|
+
fileSize: c,
|
|
2517
2518
|
filename: l,
|
|
2518
2519
|
title: u,
|
|
2519
|
-
author:
|
|
2520
|
+
author: p,
|
|
2520
2521
|
subject: m,
|
|
2521
2522
|
createdOn: v,
|
|
2522
|
-
creator:
|
|
2523
|
+
creator: h,
|
|
2523
2524
|
keywords: w,
|
|
2524
2525
|
modifiedOn: T,
|
|
2525
|
-
pdfProducer:
|
|
2526
|
+
pdfProducer: P,
|
|
2526
2527
|
pdfVersion: C,
|
|
2527
|
-
pageCount:
|
|
2528
|
+
pageCount: y
|
|
2528
2529
|
} = e;
|
|
2529
2530
|
return [
|
|
2530
2531
|
{ label: r == null ? void 0 : r.propertiesFilenameLabel, value: l },
|
|
2531
|
-
{ label: r == null ? void 0 : r.propertiesFileSizeLabel, value:
|
|
2532
|
+
{ label: r == null ? void 0 : r.propertiesFileSizeLabel, value: c },
|
|
2532
2533
|
{ separate: !0 },
|
|
2533
2534
|
{ label: r == null ? void 0 : r.propertiesTitleLabel, value: u },
|
|
2534
|
-
{ label: r == null ? void 0 : r.propertiesAuthorLabel, value:
|
|
2535
|
+
{ label: r == null ? void 0 : r.propertiesAuthorLabel, value: p },
|
|
2535
2536
|
{ label: r == null ? void 0 : r.propertiesSubjectLabel, value: m },
|
|
2536
2537
|
{ label: r == null ? void 0 : r.propertiesKeywordLabel, value: w },
|
|
2537
|
-
{ label: r == null ? void 0 : r.propertiesCreatorLabel, value:
|
|
2538
|
+
{ label: r == null ? void 0 : r.propertiesCreatorLabel, value: h },
|
|
2538
2539
|
{
|
|
2539
2540
|
label: r == null ? void 0 : r.propertiesCreateOnLabel,
|
|
2540
2541
|
value: v ? Wt(v) : ""
|
|
@@ -2544,16 +2545,16 @@ const xe = {
|
|
|
2544
2545
|
value: T ? Wt(T) : ""
|
|
2545
2546
|
},
|
|
2546
2547
|
{ separate: !0 },
|
|
2547
|
-
{ label: r == null ? void 0 : r.propertiesPDFProducerLabel, value:
|
|
2548
|
+
{ label: r == null ? void 0 : r.propertiesPDFProducerLabel, value: P },
|
|
2548
2549
|
{ label: r == null ? void 0 : r.propertiesPDFVersionLabel, value: C },
|
|
2549
|
-
{ label: r == null ? void 0 : r.propertiesPageCountLabel, value:
|
|
2550
|
+
{ label: r == null ? void 0 : r.propertiesPageCountLabel, value: y }
|
|
2550
2551
|
];
|
|
2551
2552
|
}, [e, r]);
|
|
2552
2553
|
return /* @__PURE__ */ i(vi, { open: n, onOpenChange: o, children: /* @__PURE__ */ i(wi, { container: t, children: /* @__PURE__ */ F("div", { className: xe["rp-dialog-wrapper"], children: [
|
|
2553
2554
|
/* @__PURE__ */ i(_i, { className: xe["rp-dialog-overlay"] }),
|
|
2554
2555
|
/* @__PURE__ */ F(bi, { className: xe["rp-document-dialog"], children: [
|
|
2555
2556
|
/* @__PURE__ */ i(Ci, { className: xe["rp-dialog-title"], children: r == null ? void 0 : r.documentPropertiesLabel }),
|
|
2556
|
-
/* @__PURE__ */ i("div", { className: xe["rp-document-properties"], children: a.map((
|
|
2557
|
+
/* @__PURE__ */ i("div", { className: xe["rp-document-properties"], children: a.map((c, l) => /* @__PURE__ */ i("div", { children: c.separate ? /* @__PURE__ */ i("div", { className: xe["rp-properties-divider"] }) : /* @__PURE__ */ i(so, { label: c.label, value: c.value }) }, l)) }),
|
|
2557
2558
|
/* @__PURE__ */ i(Ti, { asChild: !0, className: xe["rp-dialog-close"], children: /* @__PURE__ */ i(ao, {}) })
|
|
2558
2559
|
] })
|
|
2559
2560
|
] }) }) });
|
|
@@ -2564,8 +2565,8 @@ const xe = {
|
|
|
2564
2565
|
return yi(n);
|
|
2565
2566
|
}, Hn = () => {
|
|
2566
2567
|
const { filename: e, pdfSrc: t } = J(), { downloadFilename: n } = hr(), o = (a) => {
|
|
2567
|
-
const
|
|
2568
|
-
return
|
|
2568
|
+
const c = n || a;
|
|
2569
|
+
return c.endsWith(nn) ? c : `${c}${nn}`;
|
|
2569
2570
|
};
|
|
2570
2571
|
return { download: N(async () => {
|
|
2571
2572
|
if (!e || !t)
|
|
@@ -2589,9 +2590,9 @@ const xe = {
|
|
|
2589
2590
|
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(Vn, {}) }),
|
|
2590
2591
|
t == null ? void 0 : t.printLabel
|
|
2591
2592
|
] }) }), Bn = () => {
|
|
2592
|
-
const { print: e, cancel: t, setOnProgress: n, setOnComplete: o, setOnError: r, progress: a } = tt(), { printTool:
|
|
2593
|
-
return
|
|
2594
|
-
|
|
2593
|
+
const { print: e, cancel: t, setOnProgress: n, setOnComplete: o, setOnError: r, progress: a } = tt(), { printTool: c = !0 } = ve(), { isSmallScreen: l } = Ce(), { localeMessages: u } = se();
|
|
2594
|
+
return c ? l ? /* @__PURE__ */ i(Ei, { print: e, localeMessages: u }) : typeof c == "function" ? /* @__PURE__ */ i(
|
|
2595
|
+
c,
|
|
2595
2596
|
{
|
|
2596
2597
|
print: e,
|
|
2597
2598
|
cancel: t,
|
|
@@ -2600,7 +2601,7 @@ const xe = {
|
|
|
2600
2601
|
setOnComplete: o,
|
|
2601
2602
|
progress: a
|
|
2602
2603
|
}
|
|
2603
|
-
) :
|
|
2604
|
+
) : c ? /* @__PURE__ */ i(Li, { print: e, localeMessages: u }) : null : null;
|
|
2604
2605
|
}, Ni = {
|
|
2605
2606
|
"rp-go-to-Top": "_rp-go-to-Top_4e0yd_1"
|
|
2606
2607
|
}, Oi = () => {
|
|
@@ -2609,8 +2610,8 @@ const xe = {
|
|
|
2609
2610
|
}, Di = () => {
|
|
2610
2611
|
const { goToLastPageIcon: e } = pe();
|
|
2611
2612
|
return e || /* @__PURE__ */ i(gn, {});
|
|
2612
|
-
}, rn = { width: "100%" },
|
|
2613
|
-
const { goToPage: e, totalPages: t, focusedPage: n } = ie(), { jumpNavigationTool: o = !0 } = ve(), { localeMessages: r } = se(), a =
|
|
2613
|
+
}, rn = { width: "100%" }, Ai = () => {
|
|
2614
|
+
const { goToPage: e, totalPages: t, focusedPage: n } = ie(), { jumpNavigationTool: o = !0 } = ve(), { localeMessages: r } = se(), a = M(() => n === 1, [n]), c = M(() => n === t, [n, t]), l = N(() => {
|
|
2614
2615
|
e(1);
|
|
2615
2616
|
}, [e]), u = N(() => {
|
|
2616
2617
|
e(t);
|
|
@@ -2620,34 +2621,34 @@ const xe = {
|
|
|
2620
2621
|
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(Oi, {}) }),
|
|
2621
2622
|
/* @__PURE__ */ i("span", { children: r == null ? void 0 : r.firstPageLabel })
|
|
2622
2623
|
] }) }) }),
|
|
2623
|
-
/* @__PURE__ */ i(be, { onClick: u, children: /* @__PURE__ */ i(K, { content: r == null ? void 0 : r.lastPageTooltip, style: rn, children: /* @__PURE__ */ F("div", { className: "rp-menu-item", "aria-disabled":
|
|
2624
|
+
/* @__PURE__ */ i(be, { onClick: u, children: /* @__PURE__ */ i(K, { content: r == null ? void 0 : r.lastPageTooltip, style: rn, children: /* @__PURE__ */ F("div", { className: "rp-menu-item", "aria-disabled": c, children: [
|
|
2624
2625
|
/* @__PURE__ */ i("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ i(Di, {}) }),
|
|
2625
2626
|
/* @__PURE__ */ i("span", { children: r == null ? void 0 : r.lastPageLabel })
|
|
2626
2627
|
] }) }) }),
|
|
2627
2628
|
/* @__PURE__ */ i(yt, {})
|
|
2628
2629
|
] }) : null;
|
|
2629
|
-
},
|
|
2630
|
+
}, zi = () => {
|
|
2630
2631
|
const { container: e } = ge(), { isSmallScreen: t } = Ce(), {
|
|
2631
2632
|
openFileTool: n,
|
|
2632
2633
|
downloadTool: o,
|
|
2633
2634
|
documentProperties: r,
|
|
2634
2635
|
scrollModeTool: a,
|
|
2635
|
-
rotateTool:
|
|
2636
|
+
rotateTool: c,
|
|
2636
2637
|
selectionModeTool: l,
|
|
2637
2638
|
jumpNavigationTool: u,
|
|
2638
|
-
printTool:
|
|
2639
|
+
printTool: p,
|
|
2639
2640
|
fullscreenTool: m
|
|
2640
2641
|
} = ve(), { localeMessages: v } = se();
|
|
2641
|
-
return
|
|
2642
|
-
const w = u ||
|
|
2642
|
+
return M(() => {
|
|
2643
|
+
const w = u || c || l || a || r;
|
|
2643
2644
|
let T = !1;
|
|
2644
|
-
return t && (T = !(!n && !o && !
|
|
2645
|
+
return t && (T = !(!n && !o && !p && !m)), w || T;
|
|
2645
2646
|
}, [
|
|
2646
2647
|
n,
|
|
2647
2648
|
o,
|
|
2648
2649
|
r,
|
|
2649
2650
|
a,
|
|
2650
|
-
|
|
2651
|
+
c,
|
|
2651
2652
|
l,
|
|
2652
2653
|
u,
|
|
2653
2654
|
t
|
|
@@ -2665,7 +2666,7 @@ const xe = {
|
|
|
2665
2666
|
/* @__PURE__ */ i(fn, {}),
|
|
2666
2667
|
/* @__PURE__ */ i(yt, {})
|
|
2667
2668
|
] }),
|
|
2668
|
-
/* @__PURE__ */ i(
|
|
2669
|
+
/* @__PURE__ */ i(Ai, {}),
|
|
2669
2670
|
/* @__PURE__ */ i(po, {}),
|
|
2670
2671
|
/* @__PURE__ */ i(vo, {}),
|
|
2671
2672
|
/* @__PURE__ */ i(ho, {}),
|
|
@@ -2686,7 +2687,7 @@ const xe = {
|
|
|
2686
2687
|
/* @__PURE__ */ i(Bn, {}),
|
|
2687
2688
|
/* @__PURE__ */ i(fn, {})
|
|
2688
2689
|
] }),
|
|
2689
|
-
/* @__PURE__ */ i(
|
|
2690
|
+
/* @__PURE__ */ i(zi, {})
|
|
2690
2691
|
] });
|
|
2691
2692
|
}, Ee = {
|
|
2692
2693
|
"rp-zoom-wrapper": "_rp-zoom-wrapper_cocqs_1",
|
|
@@ -2701,24 +2702,24 @@ const xe = {
|
|
|
2701
2702
|
const { zoomOutIcon: e } = pe();
|
|
2702
2703
|
return e || /* @__PURE__ */ i(_o, {});
|
|
2703
2704
|
}, $i = () => {
|
|
2704
|
-
const { zoomLevel: e, setZoomLevel: t } = Qe(), { container: n, contentRef: o } = ge(), { zoomTool: r = !0 } = ve(), { focusedPage: a } = ie(), { rotate:
|
|
2705
|
+
const { zoomLevel: e, setZoomLevel: t } = Qe(), { container: n, contentRef: o } = ge(), { zoomTool: r = !0 } = ve(), { focusedPage: a } = ie(), { rotate: c } = Ge(), { pages: l } = J(), { isSmallScreen: u } = Ce(), { localeMessages: p } = se(), { viewMode: m } = Ae(), v = N(() => {
|
|
2705
2706
|
t((d) => {
|
|
2706
2707
|
const f = Math.floor(d / 25) * 25;
|
|
2707
2708
|
return Math.min(f + 25, ft);
|
|
2708
2709
|
});
|
|
2709
|
-
}, [t]),
|
|
2710
|
+
}, [t]), h = N(() => {
|
|
2710
2711
|
t((d) => {
|
|
2711
2712
|
const f = Math.ceil(d / 25) * 25;
|
|
2712
2713
|
return Math.min(f - 25, ft);
|
|
2713
2714
|
});
|
|
2714
|
-
}, [t]), w =
|
|
2715
|
+
}, [t]), w = M(() => e === ki, [e]), T = M(() => e === ft, [e]), P = M(() => {
|
|
2715
2716
|
var d;
|
|
2716
|
-
return (d = l.get(a)) == null ? void 0 : d.page.getViewport({ scale: 1, rotation:
|
|
2717
|
-
}, [l, a,
|
|
2717
|
+
return (d = l.get(a)) == null ? void 0 : d.page.getViewport({ scale: 1, rotation: c });
|
|
2718
|
+
}, [l, a, c]), C = N(
|
|
2718
2719
|
(d) => {
|
|
2719
|
-
const f = ((
|
|
2720
|
+
const f = ((P == null ? void 0 : P.width) || 0) + 2 * Mt, g = ((P == null ? void 0 : P.height) || 0) + 2 * Mt, s = (o == null ? void 0 : o.clientWidth) || 0, b = (o == null ? void 0 : o.clientHeight) || 0, _ = bo(
|
|
2720
2721
|
d,
|
|
2721
|
-
|
|
2722
|
+
s,
|
|
2722
2723
|
b,
|
|
2723
2724
|
f,
|
|
2724
2725
|
g,
|
|
@@ -2726,20 +2727,20 @@ const xe = {
|
|
|
2726
2727
|
);
|
|
2727
2728
|
t(_);
|
|
2728
2729
|
},
|
|
2729
|
-
[t,
|
|
2730
|
-
),
|
|
2730
|
+
[t, P]
|
|
2731
|
+
), y = N(
|
|
2731
2732
|
(d) => {
|
|
2732
2733
|
typeof d == "number" ? t(d) : C(d);
|
|
2733
2734
|
},
|
|
2734
2735
|
[t, C]
|
|
2735
2736
|
);
|
|
2736
2737
|
return typeof r != "boolean" ? /* @__PURE__ */ i(r, { zoomLevel: e, setZoomLevel: t }) : r ? /* @__PURE__ */ F("div", { className: Ee["rp-zoom-wrapper"], children: [
|
|
2737
|
-
/* @__PURE__ */ i(K, { content:
|
|
2738
|
+
/* @__PURE__ */ i(K, { content: p == null ? void 0 : p.zoomOutTooltip, children: /* @__PURE__ */ i(
|
|
2738
2739
|
re,
|
|
2739
2740
|
{
|
|
2740
2741
|
disabled: w,
|
|
2741
|
-
onClick:
|
|
2742
|
-
"aria-label":
|
|
2742
|
+
onClick: h,
|
|
2743
|
+
"aria-label": p == null ? void 0 : p.zoomOutTooltip,
|
|
2743
2744
|
children: /* @__PURE__ */ i(Hi, {})
|
|
2744
2745
|
}
|
|
2745
2746
|
) }),
|
|
@@ -2747,11 +2748,11 @@ const xe = {
|
|
|
2747
2748
|
mn,
|
|
2748
2749
|
{
|
|
2749
2750
|
container: n,
|
|
2750
|
-
triggerComponent: /* @__PURE__ */ i("div", { role: "button", children: /* @__PURE__ */ i(K, { content:
|
|
2751
|
+
triggerComponent: /* @__PURE__ */ i("div", { role: "button", children: /* @__PURE__ */ i(K, { content: p == null ? void 0 : p.zoomSelectTooltip, children: /* @__PURE__ */ F(
|
|
2751
2752
|
re,
|
|
2752
2753
|
{
|
|
2753
2754
|
className: Ee["rp-current-zoom-wrapper"],
|
|
2754
|
-
"aria-label":
|
|
2755
|
+
"aria-label": p == null ? void 0 : p.zoomSelectTooltip,
|
|
2755
2756
|
children: [
|
|
2756
2757
|
/* @__PURE__ */ i("span", { className: Ee["rp-current-zoom-text"], children: e }),
|
|
2757
2758
|
/* @__PURE__ */ i("span", { className: Ee["rp-current-zoom-text"], children: "%" }),
|
|
@@ -2763,24 +2764,24 @@ const xe = {
|
|
|
2763
2764
|
align: "center",
|
|
2764
2765
|
children: /* @__PURE__ */ F("div", { className: Ee["rp-zoom-dropdown-content"], children: [
|
|
2765
2766
|
/* @__PURE__ */ F(Ke, { children: [
|
|
2766
|
-
/* @__PURE__ */ i(be, { onClick: () =>
|
|
2767
|
-
/* @__PURE__ */ i(be, { onClick: () =>
|
|
2768
|
-
/* @__PURE__ */ i(be, { onClick: () =>
|
|
2767
|
+
/* @__PURE__ */ i(be, { onClick: () => y(at.ACTUAL), children: p == null ? void 0 : p.zoomActualSize }),
|
|
2768
|
+
/* @__PURE__ */ i(be, { onClick: () => y(at.PAGE_FIT), children: p == null ? void 0 : p.zoomPageFit }),
|
|
2769
|
+
/* @__PURE__ */ i(be, { onClick: () => y(at.PAGE_WIDTH), children: p == null ? void 0 : p.zoomPageWidth })
|
|
2769
2770
|
] }),
|
|
2770
2771
|
/* @__PURE__ */ i(yt, {}),
|
|
2771
|
-
/* @__PURE__ */ i(Ke, { children: Wi.map((d) => /* @__PURE__ */ F(be, { onClick: () =>
|
|
2772
|
+
/* @__PURE__ */ i(Ke, { children: Wi.map((d) => /* @__PURE__ */ F(be, { onClick: () => y(d), children: [
|
|
2772
2773
|
d,
|
|
2773
2774
|
" %"
|
|
2774
2775
|
] }, d)) })
|
|
2775
2776
|
] })
|
|
2776
2777
|
}
|
|
2777
2778
|
),
|
|
2778
|
-
/* @__PURE__ */ i(K, { content:
|
|
2779
|
+
/* @__PURE__ */ i(K, { content: p == null ? void 0 : p.zoomInTooltip, children: /* @__PURE__ */ i(
|
|
2779
2780
|
re,
|
|
2780
2781
|
{
|
|
2781
2782
|
disabled: T,
|
|
2782
2783
|
onClick: v,
|
|
2783
|
-
"aria-label":
|
|
2784
|
+
"aria-label": p == null ? void 0 : p.zoomInTooltip,
|
|
2784
2785
|
children: /* @__PURE__ */ i(Mi, {})
|
|
2785
2786
|
}
|
|
2786
2787
|
) })
|
|
@@ -2813,32 +2814,32 @@ const xe = {
|
|
|
2813
2814
|
return e || /* @__PURE__ */ i(Co, {});
|
|
2814
2815
|
}, Gi = () => {
|
|
2815
2816
|
const { container: e } = ge(), [t, n] = $(!1), { pdf: o } = J(), [r, a] = $(null), {
|
|
2816
|
-
searchOptions:
|
|
2817
|
+
searchOptions: c,
|
|
2817
2818
|
setSearchOptions: l,
|
|
2818
2819
|
loading: u,
|
|
2819
|
-
setSearch:
|
|
2820
|
+
setSearch: p,
|
|
2820
2821
|
totalMatches: m,
|
|
2821
2822
|
currentMatchPosition: v,
|
|
2822
|
-
nextMatch:
|
|
2823
|
+
nextMatch: h,
|
|
2823
2824
|
prevMatch: w,
|
|
2824
2825
|
search: T
|
|
2825
|
-
} = xt(), { searchTool:
|
|
2826
|
+
} = xt(), { searchTool: P = !0 } = ve(), [C, y] = $(T), { localeMessages: d } = se(), { isSmallScreen: f } = Ce(), g = N(() => {
|
|
2826
2827
|
n(!0);
|
|
2827
|
-
}, []),
|
|
2828
|
-
|
|
2829
|
-
}, [
|
|
2830
|
-
const O = I.key === "Enter",
|
|
2831
|
-
(O ||
|
|
2828
|
+
}, []), s = N(() => {
|
|
2829
|
+
p(""), y(""), n(!1);
|
|
2830
|
+
}, [p]), b = (I) => {
|
|
2831
|
+
const O = I.key === "Enter", W = I.key === " ";
|
|
2832
|
+
(O || W) && s();
|
|
2832
2833
|
}, _ = N(
|
|
2833
2834
|
(I) => {
|
|
2834
|
-
I.key === "Escape" && t &&
|
|
2835
|
+
I.key === "Escape" && t && s();
|
|
2835
2836
|
},
|
|
2836
2837
|
[t]
|
|
2837
|
-
),
|
|
2838
|
+
), S = N(
|
|
2838
2839
|
(I) => {
|
|
2839
|
-
I.shiftKey && I.key === "Enter" ? w() : I.key === "Enter" && T !== C ?
|
|
2840
|
+
I.shiftKey && I.key === "Enter" ? w() : I.key === "Enter" && T !== C ? p(C) : I.key === "Enter" && h();
|
|
2840
2841
|
},
|
|
2841
|
-
[C, w,
|
|
2842
|
+
[C, w, h, p, T]
|
|
2842
2843
|
);
|
|
2843
2844
|
k(() => (window.addEventListener("keydown", _), () => {
|
|
2844
2845
|
window.removeEventListener("keydown", _);
|
|
@@ -2846,10 +2847,10 @@ const xe = {
|
|
|
2846
2847
|
r && r.focus();
|
|
2847
2848
|
}, [r]);
|
|
2848
2849
|
const E = N((I) => {
|
|
2849
|
-
|
|
2850
|
+
y(I.target.value);
|
|
2850
2851
|
}, []), x = N(() => {
|
|
2851
|
-
|
|
2852
|
-
}, [
|
|
2852
|
+
y(""), p("");
|
|
2853
|
+
}, [p]), R = M(() => `${v} / ${m}`, [v, m]), { wholeWords: D, matchCase: A } = M(() => c, [c]), z = N(
|
|
2853
2854
|
(I) => {
|
|
2854
2855
|
l((O) => ({ ...O, matchCase: I }));
|
|
2855
2856
|
},
|
|
@@ -2861,8 +2862,8 @@ const xe = {
|
|
|
2861
2862
|
[l]
|
|
2862
2863
|
);
|
|
2863
2864
|
return k(() => {
|
|
2864
|
-
|
|
2865
|
-
}, [o,
|
|
2865
|
+
s();
|
|
2866
|
+
}, [o, s]), P ? /* @__PURE__ */ i(fe, { children: /* @__PURE__ */ i(
|
|
2866
2867
|
Mr,
|
|
2867
2868
|
{
|
|
2868
2869
|
open: t,
|
|
@@ -2875,7 +2876,7 @@ const xe = {
|
|
|
2875
2876
|
ln,
|
|
2876
2877
|
{
|
|
2877
2878
|
value: C,
|
|
2878
|
-
onKeyDown:
|
|
2879
|
+
onKeyDown: S,
|
|
2879
2880
|
onChange: E,
|
|
2880
2881
|
icon: /* @__PURE__ */ i(an, {}),
|
|
2881
2882
|
placeholder: d == null ? void 0 : d.searchInputPlaceholder,
|
|
@@ -2885,11 +2886,11 @@ const xe = {
|
|
|
2885
2886
|
}
|
|
2886
2887
|
) }),
|
|
2887
2888
|
u ? /* @__PURE__ */ i("span", { children: /* @__PURE__ */ i(Ct, { className: Y["rp-search-loader-icon"] }) }) : /* @__PURE__ */ i("span", { children: R }),
|
|
2888
|
-
f && /* @__PURE__ */ i("div", { className: Y["rp-search-tool-controls"], children: /* @__PURE__ */ i(Ht, { onKeyPress: b, handleClose:
|
|
2889
|
+
f && /* @__PURE__ */ i("div", { className: Y["rp-search-tool-controls"], children: /* @__PURE__ */ i(Ht, { onKeyPress: b, handleClose: s }) })
|
|
2889
2890
|
] }),
|
|
2890
2891
|
/* @__PURE__ */ F("div", { className: Y["rp-search-tool-input-checkboxes"], children: [
|
|
2891
2892
|
f && /* @__PURE__ */ i(on, {}),
|
|
2892
|
-
/* @__PURE__ */ i($t, { name: "matchCase", value:
|
|
2893
|
+
/* @__PURE__ */ i($t, { name: "matchCase", value: A, onChange: z, children: d == null ? void 0 : d.searchMatchCaseLabel }),
|
|
2893
2894
|
!f && /* @__PURE__ */ i(K, { content: d == null ? void 0 : d.searchMatchCaseTooltip, children: /* @__PURE__ */ i("div", { className: Y["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ i(Gt, {}) }) }),
|
|
2894
2895
|
/* @__PURE__ */ i($t, { name: "wholeWord", value: D, onChange: L, children: d == null ? void 0 : d.searchWholeWordsLabel }),
|
|
2895
2896
|
!f && /* @__PURE__ */ i(K, { content: d == null ? void 0 : d.searchWholeWordsTooltip, children: /* @__PURE__ */ i("div", { className: Y["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ i(Gt, {}) }) })
|
|
@@ -2897,7 +2898,7 @@ const xe = {
|
|
|
2897
2898
|
] }),
|
|
2898
2899
|
!f && /* @__PURE__ */ F("div", { className: Y["rp-search-tool-controls"], children: [
|
|
2899
2900
|
/* @__PURE__ */ i(on, {}),
|
|
2900
|
-
/* @__PURE__ */ i(Ht, { onKeyPress: b, handleClose:
|
|
2901
|
+
/* @__PURE__ */ i(Ht, { onKeyPress: b, handleClose: s })
|
|
2901
2902
|
] })
|
|
2902
2903
|
] })
|
|
2903
2904
|
}
|
|
@@ -2927,9 +2928,9 @@ const xe = {
|
|
|
2927
2928
|
/* @__PURE__ */ i("button", { className: ne(Ne["rp-loading-cancel-button"]), onClick: t, children: n == null ? void 0 : n.printCancelLabel })
|
|
2928
2929
|
] }) });
|
|
2929
2930
|
}, Ui = $e((e, t) => {
|
|
2930
|
-
const { showPrintProgress: n } = ve(), { progress: o } = tt(), { isSmallScreen: r } = Ce(), { percentage: a } = o || {},
|
|
2931
|
+
const { showPrintProgress: n } = ve(), { progress: o } = tt(), { isSmallScreen: r } = Ce(), { percentage: a } = o || {}, c = () => r ? { gridTemplateColumns: "25% 60% 15%" } : void 0;
|
|
2931
2932
|
return /* @__PURE__ */ F("div", { children: [
|
|
2932
|
-
/* @__PURE__ */ i("div", { "data-rp": "topBar", ref: t, className: Fe["rp-toolbar-content"], children: /* @__PURE__ */ F("div", { className: Fe["rp-toolbar-wrapper"], style:
|
|
2933
|
+
/* @__PURE__ */ i("div", { "data-rp": "topBar", ref: t, className: Fe["rp-toolbar-content"], children: /* @__PURE__ */ F("div", { className: Fe["rp-toolbar-wrapper"], style: c(), children: [
|
|
2933
2934
|
/* @__PURE__ */ F("div", { "data-rp": "topBarLeft", className: Fe["rp-toolbar-start"], children: [
|
|
2934
2935
|
/* @__PURE__ */ i(Gi, {}),
|
|
2935
2936
|
/* @__PURE__ */ i(ai, {})
|
|
@@ -2951,7 +2952,7 @@ const xe = {
|
|
|
2951
2952
|
"rp-thumbnail-active": "_rp-thumbnail-active_3fenb_22",
|
|
2952
2953
|
"rp-thumbnail-loader": "_rp-thumbnail-loader_3fenb_31"
|
|
2953
2954
|
}, Bi = (e) => {
|
|
2954
|
-
const { thumbnailSrc: t, pageNumber: n, isFocused: o, viewport: r } = e, { goToPage: a } = ie(),
|
|
2955
|
+
const { thumbnailSrc: t, pageNumber: n, isFocused: o, viewport: r } = e, { goToPage: a } = ie(), c = M(() => o ? ke["rp-thumbnail-active"] : "", [o]), l = M(() => ({
|
|
2955
2956
|
width: Math.round(r.width),
|
|
2956
2957
|
height: Math.round(r.height)
|
|
2957
2958
|
}), [r]), u = N(() => {
|
|
@@ -2964,7 +2965,7 @@ const xe = {
|
|
|
2964
2965
|
id: `page-${n}`,
|
|
2965
2966
|
className: ke["rp-thumbnail-wrapper"],
|
|
2966
2967
|
children: [
|
|
2967
|
-
/* @__PURE__ */ i("div", { className: ne(
|
|
2968
|
+
/* @__PURE__ */ i("div", { className: ne(c, ke["rp-thumbnail"]), children: t ? /* @__PURE__ */ i(
|
|
2968
2969
|
"img",
|
|
2969
2970
|
{
|
|
2970
2971
|
src: t,
|
|
@@ -2994,20 +2995,20 @@ const xe = {
|
|
|
2994
2995
|
const n = e == null ? void 0 : e.querySelector(`#page-${t}`);
|
|
2995
2996
|
e && (n != null && n.offsetTop) && (e.scrollTop = (n == null ? void 0 : n.offsetTop) - Zi);
|
|
2996
2997
|
}, Ki = $e((e, t) => {
|
|
2997
|
-
const { show: n } = e, { focusedPage: o, totalPages: r } = ie(), { thumbnailPages: a, addPage:
|
|
2998
|
-
cn(t, () =>
|
|
2999
|
-
const v =
|
|
2998
|
+
const { show: n } = e, { focusedPage: o, totalPages: r } = ie(), { thumbnailPages: a, addPage: c, thumbnailLength: l, addToPage: u } = Cn(), p = H(null), m = H(1);
|
|
2999
|
+
cn(t, () => p.current);
|
|
3000
|
+
const v = M(() => Object.values(a), [a]), h = N(() => {
|
|
3000
3001
|
const w = l + 1;
|
|
3001
|
-
w <= r &&
|
|
3002
|
-
}, [
|
|
3002
|
+
w <= r && c(w);
|
|
3003
|
+
}, [c, r, l]);
|
|
3003
3004
|
return k(() => {
|
|
3004
|
-
o > l ? u(o) : n && m.current !== o && (ji(
|
|
3005
|
-
}, [o, l, u, n, v]), fr(
|
|
3006
|
-
var
|
|
3005
|
+
o > l ? u(o) : n && m.current !== o && (ji(p.current, o), m.current = o);
|
|
3006
|
+
}, [o, l, u, n, v]), fr(p.current, h), /* @__PURE__ */ i("div", { ref: p, className: sn["rp-thumbnails-container"], children: /* @__PURE__ */ i("div", { className: sn["rp-thumbnails"], children: n ? v.map((w, T) => {
|
|
3007
|
+
var P, C;
|
|
3007
3008
|
return /* @__PURE__ */ i(
|
|
3008
3009
|
Bi,
|
|
3009
3010
|
{
|
|
3010
|
-
isFocused: o === ((
|
|
3011
|
+
isFocused: o === ((P = w.page) == null ? void 0 : P.pageNumber),
|
|
3011
3012
|
pageNumber: (C = w.page) == null ? void 0 : C.pageNumber,
|
|
3012
3013
|
thumbnailSrc: w.thumbnailSrc,
|
|
3013
3014
|
loading: w.loading,
|
|
@@ -3020,9 +3021,9 @@ const xe = {
|
|
|
3020
3021
|
const { thumbnailIcon: e } = pe();
|
|
3021
3022
|
return e || /* @__PURE__ */ i(mr, {});
|
|
3022
3023
|
}, Yi = () => {
|
|
3023
|
-
const { active: e, setActive: t } = Cn(), [n, o] = $(200), r = H(null), { thumbnailTool: a, sidebarEnable:
|
|
3024
|
+
const { active: e, setActive: t } = Cn(), [n, o] = $(200), r = H(null), { thumbnailTool: a, sidebarEnable: c } = ve(), { localeMessages: l } = se(), u = N(() => {
|
|
3024
3025
|
t((m) => !m);
|
|
3025
|
-
}, []),
|
|
3026
|
+
}, []), p = M(() => typeof a != "boolean" && a ? /* @__PURE__ */ i(a, { onClick: u, active: e }) : a ? /* @__PURE__ */ i(K, { content: l == null ? void 0 : l.thumbnailTooltip, children: /* @__PURE__ */ i(
|
|
3026
3027
|
re,
|
|
3027
3028
|
{
|
|
3028
3029
|
onClick: u,
|
|
@@ -3031,14 +3032,14 @@ const xe = {
|
|
|
3031
3032
|
children: /* @__PURE__ */ i(Xi, {})
|
|
3032
3033
|
}
|
|
3033
3034
|
) }) : null, [a, e, u, l]);
|
|
3034
|
-
return /* @__PURE__ */ i(fe, { children:
|
|
3035
|
+
return /* @__PURE__ */ i(fe, { children: c && /* @__PURE__ */ F(
|
|
3035
3036
|
"div",
|
|
3036
3037
|
{
|
|
3037
3038
|
style: { "--rp-thumbnail-width": `${n}px` },
|
|
3038
3039
|
className: gt["rp-sidebar-content-wrapper"],
|
|
3039
3040
|
"data-rp": "sidebar",
|
|
3040
3041
|
children: [
|
|
3041
|
-
/* @__PURE__ */ i("div", { className: gt["rp-sidebar-content"], children:
|
|
3042
|
+
/* @__PURE__ */ i("div", { className: gt["rp-sidebar-content"], children: p }),
|
|
3042
3043
|
/* @__PURE__ */ F(
|
|
3043
3044
|
"div",
|
|
3044
3045
|
{
|
|
@@ -3055,16 +3056,16 @@ const xe = {
|
|
|
3055
3056
|
}
|
|
3056
3057
|
) });
|
|
3057
3058
|
}, _e = {
|
|
3058
|
-
"rp-layout": "_rp-
|
|
3059
|
-
"rp-content": "_rp-
|
|
3060
|
-
"rp-pages": "_rp-
|
|
3061
|
-
"rp-container": "_rp-
|
|
3062
|
-
"rp-loader": "_rp-
|
|
3063
|
-
"rp-theme-variables": "_rp-theme-
|
|
3064
|
-
"rp-dark-mode": "_rp-dark-
|
|
3059
|
+
"rp-layout": "_rp-layout_1uujy_1",
|
|
3060
|
+
"rp-content": "_rp-content_1uujy_5",
|
|
3061
|
+
"rp-pages": "_rp-pages_1uujy_11",
|
|
3062
|
+
"rp-container": "_rp-container_1uujy_16",
|
|
3063
|
+
"rp-loader": "_rp-loader_1uujy_52",
|
|
3064
|
+
"rp-theme-variables": "_rp-theme-variables_1uujy_56",
|
|
3065
|
+
"rp-dark-mode": "_rp-dark-mode_1uujy_162"
|
|
3065
3066
|
}, Ji = $e(
|
|
3066
3067
|
(e, t) => {
|
|
3067
|
-
const { children: n, toolbarRef: o, style: r, className: a } = e, { customVariables:
|
|
3068
|
+
const { children: n, toolbarRef: o, style: r, className: a } = e, { customVariables: c, customDarkVariables: l } = Pr(), { darkMode: u } = rr();
|
|
3068
3069
|
return /* @__PURE__ */ i(
|
|
3069
3070
|
"div",
|
|
3070
3071
|
{
|
|
@@ -3077,7 +3078,7 @@ const xe = {
|
|
|
3077
3078
|
),
|
|
3078
3079
|
style: {
|
|
3079
3080
|
"--rp-toolbar-height": `${(o == null ? void 0 : o.clientHeight) || 48}px`,
|
|
3080
|
-
...
|
|
3081
|
+
...c,
|
|
3081
3082
|
...u ? l : {},
|
|
3082
3083
|
...r
|
|
3083
3084
|
},
|
|
@@ -3091,18 +3092,18 @@ const xe = {
|
|
|
3091
3092
|
slots: o,
|
|
3092
3093
|
icons: r,
|
|
3093
3094
|
style: a,
|
|
3094
|
-
className:
|
|
3095
|
+
className: c,
|
|
3095
3096
|
mobileWidth: l,
|
|
3096
3097
|
onLoaded: u,
|
|
3097
|
-
cleanupOnLoaded:
|
|
3098
|
+
cleanupOnLoaded: p,
|
|
3098
3099
|
onLayoutWidthChange: m
|
|
3099
|
-
} = e, [v,
|
|
3100
|
+
} = e, [v, h] = $(null), { setContainer: w, setContentRef: T } = ge(), { loading: P } = J(), { LoaderImageComponent: C } = pn();
|
|
3100
3101
|
return k(() => (u && u(), () => {
|
|
3101
|
-
|
|
3102
|
-
}), [u,
|
|
3102
|
+
p && p();
|
|
3103
|
+
}), [u, p]), /* @__PURE__ */ i(Ji, { toolbarRef: v, ref: t, children: /* @__PURE__ */ i(Tr, { mobileWidth: l, onLayoutWidthChange: m, children: /* @__PURE__ */ i(vr, { slots: o, children: /* @__PURE__ */ i(wr, { icons: r, children: /* @__PURE__ */ F(_r, { getContainerRef: w, style: a, className: c, children: [
|
|
3103
3104
|
/* @__PURE__ */ F(br, { children: [
|
|
3104
3105
|
/* @__PURE__ */ F("div", { className: _e["rp-layout"], children: [
|
|
3105
|
-
/* @__PURE__ */ i(Ui, { ref:
|
|
3106
|
+
/* @__PURE__ */ i(Ui, { ref: h }),
|
|
3106
3107
|
/* @__PURE__ */ F("div", { className: _e["rp-content"], children: [
|
|
3107
3108
|
/* @__PURE__ */ i("div", { className: _e["rp-sidebar"], children: /* @__PURE__ */ i(Yi, {}) }),
|
|
3108
3109
|
/* @__PURE__ */ i("div", { ref: T, className: _e["rp-pages"], children: n })
|
|
@@ -3110,7 +3111,7 @@ const xe = {
|
|
|
3110
3111
|
] }),
|
|
3111
3112
|
/* @__PURE__ */ i(Cr, {})
|
|
3112
3113
|
] }),
|
|
3113
|
-
|
|
3114
|
+
P ? /* @__PURE__ */ i(
|
|
3114
3115
|
"div",
|
|
3115
3116
|
{
|
|
3116
3117
|
className: _e["rp-loader"],
|
|
@@ -3153,8 +3154,8 @@ export {
|
|
|
3153
3154
|
Yi as J,
|
|
3154
3155
|
Ji as K,
|
|
3155
3156
|
Vi as L,
|
|
3156
|
-
|
|
3157
|
-
|
|
3157
|
+
Ai as M,
|
|
3158
|
+
zi as O,
|
|
3158
3159
|
Ms as P,
|
|
3159
3160
|
qs as R,
|
|
3160
3161
|
Gs as S,
|
|
@@ -3176,7 +3177,7 @@ export {
|
|
|
3176
3177
|
xo as n,
|
|
3177
3178
|
Tn as o,
|
|
3178
3179
|
Eo as p,
|
|
3179
|
-
|
|
3180
|
+
zo as q,
|
|
3180
3181
|
It as r,
|
|
3181
3182
|
Yo as s,
|
|
3182
3183
|
ti as t,
|