@factorialco/f0-react 8.16.0 → 8.16.1
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/{ChatPdfThumbnail-C1SJmtGu.js → ChatPdfThumbnail-DOuDKXKf.js} +1 -1
- package/dist/{ChatPostComposerDialog-CWQjLNj_.js → ChatPostComposerDialog-D2ymoWVD.js} +3 -3
- package/dist/{DocumentToolbar-c6fYhage.js → DocumentToolbar-97n2nXUO.js} +2 -2
- package/dist/{DocxViewer-BuFtxAm5.js → DocxViewer-B3fLc2DK.js} +2 -2
- package/dist/{F0AiProcessingOverlay-C8BRJj9F.js → F0AiProcessingOverlay-CF4m9csf.js} +1 -1
- package/dist/{F0CanvasPanel-CqHQYY7O.js → F0CanvasPanel-CqwBZSlw.js} +309 -309
- package/dist/{F0Map-zPEzpa7c.js → F0Map-F7WNYPHU.js} +4 -4
- package/dist/{F0VideoPlayer-DTAJodv_.js → F0VideoPlayer-XnjKEpzT.js} +2 -2
- package/dist/{MapProvider-C0Pm68Nz.js → MapProvider--aDfTV7Z.js} +2 -2
- package/dist/{SheetViewer-DS9G1QPI.js → SheetViewer-CzYl8GLG.js} +2 -2
- package/dist/{TextViewer-BN5Dsxmb.js → TextViewer-B2jfln7v.js} +2 -2
- package/dist/ai.js +2 -2
- package/dist/component-status.js +1 -1
- package/dist/{experimental-CdsK3mLK.js → experimental-CzLTiYkz.js} +7 -7
- package/dist/experimental.js +71 -71
- package/dist/f0.js +10 -10
- package/dist/{index-DXJ4Y_fZ.js → index-BTZVSZUV.js} +2 -2
- package/dist/{index-D9SNDC4b.js → index-C6DiQWUC.js} +228 -217
- package/dist/index-Cywo9_7S.js +4 -0
- package/dist/{index-Bj9LskuL.js → index-DagDcfjo.js} +3 -3
- package/dist/{index-N4xGSF1m.js → index-QrmVaDiy.js} +1 -1
- package/dist/{pdfWorker-D4oJ8ZbR.js → pdfWorker-D58h5D59.js} +2 -2
- package/package.json +1 -1
- package/dist/index-BTASKoTh.js +0 -4
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { S as
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { lazy as
|
|
4
|
-
import { e as
|
|
5
|
-
import { F as
|
|
6
|
-
import { d as
|
|
7
|
-
import './index2.css';const
|
|
1
|
+
import { S as E, y as Ce, u as X, z as Te, w as Le, i as Fe, j as De, k as Ve, A as Ee, l as He, B as Ue, E as Oe, G as We, H as je } from "./F0CanvasPanel-CqwBZSlw.js";
|
|
2
|
+
import { jsx as r, jsxs as P } from "react/jsx-runtime";
|
|
3
|
+
import { lazy as Y, forwardRef as ce, Suspense as $e, useState as U, useRef as A, useCallback as w, useMemo as ie, useEffect as V } from "react";
|
|
4
|
+
import { e as ze, D as Me, P as Be, c as Ie } from "./pdfWorker-D58h5D59.js";
|
|
5
|
+
import { F as Ae } from "./Printer-BD-FEi_2.js";
|
|
6
|
+
import { d as G } from "./tooltip-CrXp1Uaz.js";
|
|
7
|
+
import './index2.css';const Ge = ({
|
|
8
8
|
label: e,
|
|
9
9
|
width: t,
|
|
10
10
|
height: o
|
|
11
|
-
}) => /* @__PURE__ */
|
|
11
|
+
}) => /* @__PURE__ */ r(
|
|
12
12
|
"div",
|
|
13
13
|
{
|
|
14
14
|
role: "status",
|
|
@@ -16,21 +16,21 @@ import './index2.css';const Ie = ({
|
|
|
16
16
|
"aria-live": "polite",
|
|
17
17
|
"aria-busy": !0,
|
|
18
18
|
className: "F0DocumentViewer__page mx-auto w-fit px-4 pt-4 last:pb-4",
|
|
19
|
-
children: /* @__PURE__ */
|
|
20
|
-
|
|
19
|
+
children: /* @__PURE__ */ r(
|
|
20
|
+
E,
|
|
21
21
|
{
|
|
22
22
|
style: { width: t, height: o },
|
|
23
23
|
className: "rounded-lg border border-solid border-f1-border-secondary shadow-md"
|
|
24
24
|
}
|
|
25
25
|
)
|
|
26
26
|
}
|
|
27
|
-
),
|
|
27
|
+
), _ = ({
|
|
28
28
|
label: e,
|
|
29
29
|
icon: t,
|
|
30
30
|
onClick: o,
|
|
31
31
|
size: i = "md"
|
|
32
|
-
}) => /* @__PURE__ */
|
|
33
|
-
|
|
32
|
+
}) => /* @__PURE__ */ r(
|
|
33
|
+
Ce,
|
|
34
34
|
{
|
|
35
35
|
label: e,
|
|
36
36
|
icon: t,
|
|
@@ -39,14 +39,14 @@ import './index2.css';const Ie = ({
|
|
|
39
39
|
variant: "outline",
|
|
40
40
|
size: i
|
|
41
41
|
}
|
|
42
|
-
),
|
|
42
|
+
), Ze = (e) => G(
|
|
43
43
|
"z-10 flex flex-row items-center gap-2",
|
|
44
44
|
e === "top" ? "F0DocumentViewer__surface sticky top-0 justify-between px-6 py-4" : "absolute bottom-4 left-1/2 w-max max-w-[calc(100%-2rem)] -translate-x-1/2 gap-4 rounded-xl bg-f1-background-inverse p-2 text-f1-foreground-inverse shadow-lg backdrop-blur-sm"
|
|
45
|
-
),
|
|
45
|
+
), qe = (e, t) => G(
|
|
46
46
|
"flex flex-row items-center gap-2",
|
|
47
47
|
e === "floating" && "dark",
|
|
48
48
|
t
|
|
49
|
-
),
|
|
49
|
+
), le = ({
|
|
50
50
|
toolbarRef: e,
|
|
51
51
|
currentPage: t,
|
|
52
52
|
totalPages: o,
|
|
@@ -57,15 +57,15 @@ import './index2.css';const Ie = ({
|
|
|
57
57
|
onNextPage: h,
|
|
58
58
|
onZoomIn: u,
|
|
59
59
|
onZoomOut: b,
|
|
60
|
-
onScaleChange:
|
|
60
|
+
onScaleChange: N,
|
|
61
61
|
rotatable: v,
|
|
62
62
|
onRotate: x,
|
|
63
|
-
onPrint:
|
|
63
|
+
onPrint: O,
|
|
64
64
|
onDownload: m,
|
|
65
65
|
actions: C,
|
|
66
66
|
placement: y
|
|
67
67
|
}) => {
|
|
68
|
-
const { pdfViewer: p } =
|
|
68
|
+
const { pdfViewer: p } = X(), g = qe(y);
|
|
69
69
|
return /* @__PURE__ */ P(
|
|
70
70
|
"div",
|
|
71
71
|
{
|
|
@@ -73,13 +73,13 @@ import './index2.css';const Ie = ({
|
|
|
73
73
|
role: "toolbar",
|
|
74
74
|
"aria-label": p.toolbar,
|
|
75
75
|
"data-placement": y,
|
|
76
|
-
className:
|
|
76
|
+
className: Ze(y),
|
|
77
77
|
children: [
|
|
78
78
|
i ? /* @__PURE__ */ P(
|
|
79
79
|
"span",
|
|
80
80
|
{
|
|
81
81
|
"aria-live": "polite",
|
|
82
|
-
className:
|
|
82
|
+
className: G(
|
|
83
83
|
"whitespace-nowrap text-sm font-medium",
|
|
84
84
|
y === "top" ? "text-f1-foreground-secondary" : "pl-2 text-f1-foreground-inverse"
|
|
85
85
|
),
|
|
@@ -91,80 +91,80 @@ import './index2.css';const Ie = ({
|
|
|
91
91
|
}
|
|
92
92
|
) : null,
|
|
93
93
|
/* @__PURE__ */ P("div", { className: g, children: [
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
|
|
94
|
+
/* @__PURE__ */ r(
|
|
95
|
+
_,
|
|
96
96
|
{
|
|
97
97
|
label: p.previousPage,
|
|
98
98
|
onClick: c,
|
|
99
|
-
icon:
|
|
99
|
+
icon: Te,
|
|
100
100
|
size: "sm"
|
|
101
101
|
}
|
|
102
102
|
),
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
|
|
103
|
+
/* @__PURE__ */ r(
|
|
104
|
+
_,
|
|
105
105
|
{
|
|
106
106
|
label: p.nextPage,
|
|
107
107
|
onClick: h,
|
|
108
|
-
icon:
|
|
108
|
+
icon: Le,
|
|
109
109
|
size: "sm"
|
|
110
110
|
}
|
|
111
111
|
)
|
|
112
112
|
] }),
|
|
113
113
|
/* @__PURE__ */ P("div", { className: g, children: [
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
|
|
114
|
+
/* @__PURE__ */ r(
|
|
115
|
+
_,
|
|
116
116
|
{
|
|
117
117
|
label: p.zoomOut,
|
|
118
118
|
onClick: b,
|
|
119
|
-
icon:
|
|
119
|
+
icon: Fe
|
|
120
120
|
}
|
|
121
121
|
),
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
|
|
122
|
+
/* @__PURE__ */ r(
|
|
123
|
+
_,
|
|
124
124
|
{
|
|
125
125
|
label: p.zoomIn,
|
|
126
126
|
onClick: u,
|
|
127
127
|
icon: De
|
|
128
128
|
}
|
|
129
129
|
),
|
|
130
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ r(
|
|
131
131
|
Ve,
|
|
132
132
|
{
|
|
133
133
|
hideLabel: !0,
|
|
134
134
|
label: p.scaleSelector,
|
|
135
135
|
options: s,
|
|
136
136
|
value: l,
|
|
137
|
-
onChange: (R) =>
|
|
137
|
+
onChange: (R) => N(R)
|
|
138
138
|
}
|
|
139
139
|
)
|
|
140
140
|
] }),
|
|
141
141
|
/* @__PURE__ */ P("div", { className: g, children: [
|
|
142
|
-
v ? /* @__PURE__ */
|
|
143
|
-
|
|
142
|
+
v ? /* @__PURE__ */ r(
|
|
143
|
+
_,
|
|
144
144
|
{
|
|
145
145
|
label: p.rotate,
|
|
146
146
|
onClick: x,
|
|
147
|
-
icon:
|
|
147
|
+
icon: Ee
|
|
148
148
|
}
|
|
149
149
|
) : null,
|
|
150
|
-
/* @__PURE__ */
|
|
151
|
-
|
|
150
|
+
/* @__PURE__ */ r(
|
|
151
|
+
_,
|
|
152
152
|
{
|
|
153
153
|
label: p.print,
|
|
154
|
-
onClick:
|
|
155
|
-
icon:
|
|
154
|
+
onClick: O,
|
|
155
|
+
icon: Ae
|
|
156
156
|
}
|
|
157
157
|
),
|
|
158
|
-
/* @__PURE__ */
|
|
159
|
-
|
|
158
|
+
/* @__PURE__ */ r(
|
|
159
|
+
_,
|
|
160
160
|
{
|
|
161
161
|
label: p.download,
|
|
162
162
|
onClick: m,
|
|
163
163
|
icon: He
|
|
164
164
|
}
|
|
165
165
|
),
|
|
166
|
-
C?.map((R, S) => /* @__PURE__ */
|
|
167
|
-
|
|
166
|
+
C?.map((R, S) => /* @__PURE__ */ r(
|
|
167
|
+
_,
|
|
168
168
|
{
|
|
169
169
|
label: R.label,
|
|
170
170
|
onClick: R.onClick,
|
|
@@ -176,15 +176,15 @@ import './index2.css';const Ie = ({
|
|
|
176
176
|
]
|
|
177
177
|
}
|
|
178
178
|
);
|
|
179
|
-
},
|
|
179
|
+
}, Je = (e, t) => t ? (Math.round(t * e) + 1e-3) / t : e, Ke = (e, t = window.devicePixelRatio || 1) => {
|
|
180
180
|
!e || e.width === 0 || e.height === 0 || (e.style.width = `${e.width / t}px`, e.style.height = `${e.height / t}px`);
|
|
181
|
-
},
|
|
181
|
+
}, de = async (e) => {
|
|
182
182
|
const t = await e.saveDocument();
|
|
183
183
|
return new Blob([new Uint8Array(t)], { type: "application/pdf" });
|
|
184
|
-
},
|
|
184
|
+
}, Qe = async (e) => {
|
|
185
185
|
if (!e)
|
|
186
186
|
return;
|
|
187
|
-
const t = URL.createObjectURL(await
|
|
187
|
+
const t = URL.createObjectURL(await de(e)), o = document.createElement("iframe");
|
|
188
188
|
o.style.display = "none", o.src = t, o.onload = () => {
|
|
189
189
|
o.focus(), o.contentWindow?.print();
|
|
190
190
|
const i = () => {
|
|
@@ -192,12 +192,12 @@ import './index2.css';const Ie = ({
|
|
|
192
192
|
};
|
|
193
193
|
o.contentWindow?.addEventListener("afterprint", i), setTimeout(i, 6e4);
|
|
194
194
|
}, document.body.appendChild(o);
|
|
195
|
-
},
|
|
195
|
+
}, Xe = async (e, t) => {
|
|
196
196
|
if (!e)
|
|
197
197
|
return;
|
|
198
|
-
const o = URL.createObjectURL(await
|
|
198
|
+
const o = URL.createObjectURL(await de(e)), i = document.createElement("a");
|
|
199
199
|
i.href = o, i.download = t.length > 0 ? t : "document.pdf", document.body.appendChild(i), i.click(), i.remove(), URL.revokeObjectURL(o);
|
|
200
|
-
},
|
|
200
|
+
}, gt = async (e, t, o = !0) => {
|
|
201
201
|
let i = e, l;
|
|
202
202
|
try {
|
|
203
203
|
const c = await fetch(e, {
|
|
@@ -210,7 +210,7 @@ import './index2.css';const Ie = ({
|
|
|
210
210
|
}
|
|
211
211
|
const s = document.createElement("a");
|
|
212
212
|
s.href = i, s.download = t ?? "", s.rel = "noreferrer", l || (s.target = "_blank"), document.body.appendChild(s), s.click(), s.remove(), l && URL.revokeObjectURL(l);
|
|
213
|
-
},
|
|
213
|
+
}, Q = [
|
|
214
214
|
"0.5",
|
|
215
215
|
"0.75",
|
|
216
216
|
"1",
|
|
@@ -219,12 +219,12 @@ import './index2.css';const Ie = ({
|
|
|
219
219
|
"2",
|
|
220
220
|
"3",
|
|
221
221
|
"4"
|
|
222
|
-
],
|
|
222
|
+
], fe = Q.map(Number), Ye = (e) => fe.find((t) => t > e), et = (e) => [...fe].reverse().find((t) => t < e), tt = (e, t, o) => {
|
|
223
223
|
let i = null, l = 0;
|
|
224
224
|
return t.forEach((s, c) => {
|
|
225
225
|
if (!s)
|
|
226
226
|
return;
|
|
227
|
-
const h = s.offsetHeight, u = s.offsetTop, b = u + h,
|
|
227
|
+
const h = s.offsetHeight, u = s.offsetTop, b = u + h, N = e.offsetHeight - o, v = e.scrollTop + o, x = v + N;
|
|
228
228
|
if (!(v < b && x > u))
|
|
229
229
|
return;
|
|
230
230
|
let m;
|
|
@@ -237,35 +237,35 @@ import './index2.css';const Ie = ({
|
|
|
237
237
|
m > l && (l = m, i = c + 1);
|
|
238
238
|
}), i;
|
|
239
239
|
};
|
|
240
|
-
|
|
241
|
-
const
|
|
240
|
+
ze();
|
|
241
|
+
const ot = Y(() => import("./SheetViewer-CzYl8GLG.js")), nt = Y(() => import("./DocxViewer-B3fLc2DK.js")), rt = Y(() => import("./TextViewer-B2jfln7v.js")), se = 48, at = 150, ue = ce((e, t) => {
|
|
242
242
|
const { kind: o = "pdf", mimeType: i, toolbar: l = "top", ...s } = e;
|
|
243
243
|
if (o === "pdf")
|
|
244
|
-
return /* @__PURE__ */
|
|
244
|
+
return /* @__PURE__ */ r(me, { ref: t, toolbar: l, ...s });
|
|
245
245
|
const {
|
|
246
246
|
url: c,
|
|
247
247
|
filename: h,
|
|
248
248
|
actions: u,
|
|
249
249
|
withCredentials: b = !0,
|
|
250
|
-
page:
|
|
250
|
+
page: N,
|
|
251
251
|
pagesToDisplay: v,
|
|
252
252
|
initialScale: x,
|
|
253
|
-
rotatable:
|
|
253
|
+
rotatable: O,
|
|
254
254
|
initialRotation: m,
|
|
255
255
|
onRotationChange: C,
|
|
256
256
|
onPdfLoaded: y,
|
|
257
257
|
onPageChange: p,
|
|
258
258
|
...g
|
|
259
259
|
} = s;
|
|
260
|
-
return /* @__PURE__ */
|
|
260
|
+
return /* @__PURE__ */ r(
|
|
261
261
|
"div",
|
|
262
262
|
{
|
|
263
263
|
ref: t,
|
|
264
264
|
...g,
|
|
265
265
|
className: "F0DocumentViewer__surface relative flex h-full w-full flex-col overflow-hidden border border-solid border-f1-border-secondary",
|
|
266
|
-
children: /* @__PURE__ */ P(
|
|
267
|
-
o === "sheet" ? /* @__PURE__ */
|
|
268
|
-
|
|
266
|
+
children: /* @__PURE__ */ P($e, { fallback: /* @__PURE__ */ r(E, { className: "h-full w-full rounded-none" }), children: [
|
|
267
|
+
o === "sheet" ? /* @__PURE__ */ r(
|
|
268
|
+
ot,
|
|
269
269
|
{
|
|
270
270
|
url: c,
|
|
271
271
|
filename: h,
|
|
@@ -274,8 +274,8 @@ const et = X(() => import("./SheetViewer-DS9G1QPI.js")), tt = X(() => import("./
|
|
|
274
274
|
toolbar: l
|
|
275
275
|
}
|
|
276
276
|
) : null,
|
|
277
|
-
o === "docx" ? /* @__PURE__ */
|
|
278
|
-
|
|
277
|
+
o === "docx" ? /* @__PURE__ */ r(
|
|
278
|
+
nt,
|
|
279
279
|
{
|
|
280
280
|
url: c,
|
|
281
281
|
filename: h,
|
|
@@ -284,8 +284,8 @@ const et = X(() => import("./SheetViewer-DS9G1QPI.js")), tt = X(() => import("./
|
|
|
284
284
|
toolbar: l
|
|
285
285
|
}
|
|
286
286
|
) : null,
|
|
287
|
-
o === "text" ? /* @__PURE__ */
|
|
288
|
-
|
|
287
|
+
o === "text" ? /* @__PURE__ */ r(
|
|
288
|
+
rt,
|
|
289
289
|
{
|
|
290
290
|
url: c,
|
|
291
291
|
name: h ?? "",
|
|
@@ -299,8 +299,8 @@ const et = X(() => import("./SheetViewer-DS9G1QPI.js")), tt = X(() => import("./
|
|
|
299
299
|
}
|
|
300
300
|
);
|
|
301
301
|
});
|
|
302
|
-
|
|
303
|
-
const
|
|
302
|
+
ue.displayName = "F0DocumentViewer";
|
|
303
|
+
const me = ce((e, t) => {
|
|
304
304
|
const {
|
|
305
305
|
url: o,
|
|
306
306
|
filename: i = "document.pdf",
|
|
@@ -310,132 +310,143 @@ const ue = se((e, t) => {
|
|
|
310
310
|
withCredentials: h = !0,
|
|
311
311
|
rotatable: u = !1,
|
|
312
312
|
initialRotation: b = 0,
|
|
313
|
-
onRotationChange:
|
|
313
|
+
onRotationChange: N,
|
|
314
314
|
onPdfLoaded: v,
|
|
315
315
|
onPageChange: x,
|
|
316
|
-
actions:
|
|
316
|
+
actions: O,
|
|
317
317
|
toolbar: m = "top",
|
|
318
318
|
...C
|
|
319
|
-
} = e, { pdfViewer: y } =
|
|
319
|
+
} = e, { pdfViewer: y } = X(), p = Math.max(
|
|
320
320
|
2,
|
|
321
321
|
typeof window > "u" ? 1 : window.devicePixelRatio || 1
|
|
322
|
-
), [g, R] =
|
|
323
|
-
() => m === "top" ?
|
|
322
|
+
), [g, R] = U(null), [S, ee] = U([]), [T, Z] = U(1), [k, te] = U(0), [L, q] = U(c), [F, ge] = U(b), $ = A(null), J = A(null), W = A([]), z = s.length > 0 ? s.length : g?.numPages, M = w(
|
|
323
|
+
() => m === "top" ? J.current?.offsetHeight ?? 0 : 0,
|
|
324
324
|
[m]
|
|
325
|
-
),
|
|
325
|
+
), oe = S.find(Boolean), ne = (oe?.originalWidth ?? 595) * T, re = (oe?.originalHeight ?? 842) * T, he = ie(
|
|
326
326
|
() => [
|
|
327
327
|
{ value: "page-width", label: y.pageWidth },
|
|
328
328
|
{ value: "page-fit", label: y.pageFit },
|
|
329
|
-
...
|
|
330
|
-
value:
|
|
331
|
-
label: `${Number(
|
|
329
|
+
...Q.map((n) => ({
|
|
330
|
+
value: n,
|
|
331
|
+
label: `${Number(n) * 100}%`
|
|
332
332
|
}))
|
|
333
333
|
],
|
|
334
334
|
[y.pageWidth, y.pageFit]
|
|
335
|
-
),
|
|
336
|
-
(
|
|
337
|
-
const
|
|
338
|
-
f && D instanceof HTMLElement && (D.scrollTop = f.offsetTop -
|
|
335
|
+
), be = ie(() => ({ url: o, withCredentials: h }), [o, h]), H = w(
|
|
336
|
+
(n) => {
|
|
337
|
+
const a = (z ?? 1) - 1, d = Math.min(Math.max(n, 0), a), f = W.current[d], D = f?.offsetParent;
|
|
338
|
+
f && D instanceof HTMLElement && (D.scrollTop = f.offsetTop - M() - 10);
|
|
339
339
|
},
|
|
340
|
-
[
|
|
341
|
-
),
|
|
342
|
-
(
|
|
343
|
-
const
|
|
344
|
-
if (!
|
|
340
|
+
[z, M]
|
|
341
|
+
), j = w(
|
|
342
|
+
(n) => {
|
|
343
|
+
const a = S[k - 1], d = $.current;
|
|
344
|
+
if (!a || !d)
|
|
345
345
|
return;
|
|
346
|
-
const f =
|
|
347
|
-
|
|
346
|
+
const f = J.current?.offsetHeight ?? 0, D = F === 90 || F === 270, I = D ? a.originalHeight : a.originalWidth, _e = D ? a.originalWidth : a.originalHeight, Ne = n === "page-width" ? (d.clientWidth - se) / I : (d.clientHeight - f - se) / _e;
|
|
347
|
+
Z(Ne), q(n);
|
|
348
348
|
},
|
|
349
|
-
[S, k,
|
|
350
|
-
),
|
|
351
|
-
(
|
|
352
|
-
if (
|
|
353
|
-
|
|
349
|
+
[S, k, F]
|
|
350
|
+
), we = w(
|
|
351
|
+
(n) => {
|
|
352
|
+
if (n === "page-width" || n === "page-fit") {
|
|
353
|
+
j(n);
|
|
354
354
|
return;
|
|
355
355
|
}
|
|
356
|
-
|
|
356
|
+
Z(Number(n)), q(n);
|
|
357
357
|
},
|
|
358
|
-
[
|
|
359
|
-
),
|
|
360
|
-
if (
|
|
358
|
+
[j]
|
|
359
|
+
), B = w((n) => {
|
|
360
|
+
if (n === void 0)
|
|
361
361
|
return;
|
|
362
|
-
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
}, []),
|
|
366
|
-
() =>
|
|
367
|
-
[
|
|
368
|
-
),
|
|
369
|
-
() =>
|
|
370
|
-
[
|
|
371
|
-
),
|
|
372
|
-
|
|
373
|
-
const
|
|
374
|
-
return
|
|
362
|
+
Z(n);
|
|
363
|
+
const a = Q.find((d) => Number(d) === n);
|
|
364
|
+
a && q(a);
|
|
365
|
+
}, []), xe = w(
|
|
366
|
+
() => B(Ye(T)),
|
|
367
|
+
[T, B]
|
|
368
|
+
), ye = w(
|
|
369
|
+
() => B(et(T)),
|
|
370
|
+
[T, B]
|
|
371
|
+
), ve = w(() => {
|
|
372
|
+
ge((n) => {
|
|
373
|
+
const a = (n + 90) % 360;
|
|
374
|
+
return N?.(a), a;
|
|
375
375
|
});
|
|
376
|
-
}, [
|
|
377
|
-
(
|
|
378
|
-
R(
|
|
379
|
-
|
|
376
|
+
}, [N]), Pe = w(
|
|
377
|
+
(n) => {
|
|
378
|
+
R(n), v?.(n), setTimeout(() => {
|
|
379
|
+
te(l + 1), H(l);
|
|
380
380
|
}, 0);
|
|
381
381
|
},
|
|
382
|
-
[v, l,
|
|
383
|
-
),
|
|
384
|
-
(
|
|
385
|
-
const
|
|
386
|
-
if (!(
|
|
382
|
+
[v, l, H]
|
|
383
|
+
), Re = w(
|
|
384
|
+
(n) => {
|
|
385
|
+
const a = n.target;
|
|
386
|
+
if (!(a instanceof HTMLElement))
|
|
387
387
|
return;
|
|
388
|
-
const d =
|
|
389
|
-
|
|
388
|
+
const d = tt(
|
|
389
|
+
a,
|
|
390
390
|
W.current,
|
|
391
|
-
|
|
391
|
+
M()
|
|
392
392
|
);
|
|
393
|
-
d &&
|
|
393
|
+
d && te(d);
|
|
394
394
|
},
|
|
395
|
-
[
|
|
396
|
-
),
|
|
397
|
-
|
|
398
|
-
}, [g]),
|
|
399
|
-
|
|
395
|
+
[M]
|
|
396
|
+
), Se = w(() => {
|
|
397
|
+
Qe(g);
|
|
398
|
+
}, [g]), ke = w(() => {
|
|
399
|
+
Xe(g, i);
|
|
400
400
|
}, [g, i]);
|
|
401
|
-
|
|
402
|
-
R(null),
|
|
403
|
-
}, [o]),
|
|
404
|
-
|
|
405
|
-
}, [l,
|
|
401
|
+
V(() => {
|
|
402
|
+
R(null), ee([]), W.current = [];
|
|
403
|
+
}, [o]), V(() => {
|
|
404
|
+
H(l);
|
|
405
|
+
}, [l, H]), V(() => {
|
|
406
406
|
k > 0 && x?.(k);
|
|
407
|
-
}, [k, x]),
|
|
408
|
-
S.length > 0 && (c === "page-width" || c === "page-fit") &&
|
|
409
|
-
}, [S.length, c]),
|
|
410
|
-
(
|
|
411
|
-
}, [
|
|
412
|
-
|
|
413
|
-
|
|
407
|
+
}, [k, x]), V(() => {
|
|
408
|
+
S.length > 0 && (c === "page-width" || c === "page-fit") && j(c);
|
|
409
|
+
}, [S.length, c]), V(() => {
|
|
410
|
+
(L === "page-width" || L === "page-fit") && j(L);
|
|
411
|
+
}, [F]);
|
|
412
|
+
const K = A();
|
|
413
|
+
Ue({
|
|
414
|
+
ref: $,
|
|
415
|
+
onResize: () => {
|
|
416
|
+
clearTimeout(K.current), K.current = setTimeout(() => {
|
|
417
|
+
(L === "page-width" || L === "page-fit") && j(L);
|
|
418
|
+
}, at);
|
|
419
|
+
}
|
|
420
|
+
}), V(function() {
|
|
421
|
+
return () => clearTimeout(K.current);
|
|
422
|
+
}, []), V(() => {
|
|
423
|
+
const n = $.current;
|
|
424
|
+
if (!n)
|
|
414
425
|
return;
|
|
415
|
-
const
|
|
426
|
+
const a = (d) => {
|
|
416
427
|
const f = d.target;
|
|
417
428
|
f instanceof HTMLAnchorElement && (f.target = "_blank", f.rel = "noopener noreferrer");
|
|
418
429
|
};
|
|
419
|
-
return
|
|
430
|
+
return n.addEventListener("click", a, !0), () => n.removeEventListener("click", a, !0);
|
|
420
431
|
}, []);
|
|
421
432
|
const ae = {
|
|
422
|
-
toolbarRef:
|
|
433
|
+
toolbarRef: J,
|
|
423
434
|
placement: m,
|
|
424
435
|
currentPage: k,
|
|
425
|
-
totalPages:
|
|
436
|
+
totalPages: z,
|
|
426
437
|
hasDocument: !!g?.numPages,
|
|
427
|
-
selectedScale:
|
|
428
|
-
scaleOptions:
|
|
429
|
-
onPreviousPage: () =>
|
|
430
|
-
onNextPage: () =>
|
|
431
|
-
onZoomIn:
|
|
432
|
-
onZoomOut:
|
|
433
|
-
onScaleChange:
|
|
438
|
+
selectedScale: L,
|
|
439
|
+
scaleOptions: he,
|
|
440
|
+
onPreviousPage: () => H(k - 2),
|
|
441
|
+
onNextPage: () => H(k),
|
|
442
|
+
onZoomIn: xe,
|
|
443
|
+
onZoomOut: ye,
|
|
444
|
+
onScaleChange: we,
|
|
434
445
|
rotatable: u,
|
|
435
|
-
onRotate:
|
|
436
|
-
onPrint:
|
|
437
|
-
onDownload:
|
|
438
|
-
actions:
|
|
446
|
+
onRotate: ve,
|
|
447
|
+
onPrint: Se,
|
|
448
|
+
onDownload: ke,
|
|
449
|
+
actions: O
|
|
439
450
|
};
|
|
440
451
|
return /* @__PURE__ */ P(
|
|
441
452
|
"div",
|
|
@@ -447,74 +458,74 @@ const ue = se((e, t) => {
|
|
|
447
458
|
/* @__PURE__ */ P(
|
|
448
459
|
"div",
|
|
449
460
|
{
|
|
450
|
-
ref:
|
|
451
|
-
onScroll:
|
|
461
|
+
ref: $,
|
|
462
|
+
onScroll: Re,
|
|
452
463
|
className: "F0DocumentViewer__surface relative flex h-full flex-col overflow-auto [scrollbar-gutter:stable_both-edges]",
|
|
453
464
|
children: [
|
|
454
|
-
m === "top" ? /* @__PURE__ */
|
|
455
|
-
o ? /* @__PURE__ */
|
|
456
|
-
|
|
465
|
+
m === "top" ? /* @__PURE__ */ r(le, { ...ae }) : null,
|
|
466
|
+
o ? /* @__PURE__ */ r(
|
|
467
|
+
Me,
|
|
457
468
|
{
|
|
458
|
-
file:
|
|
459
|
-
onLoadSuccess:
|
|
460
|
-
loading: /* @__PURE__ */
|
|
461
|
-
|
|
469
|
+
file: be,
|
|
470
|
+
onLoadSuccess: Pe,
|
|
471
|
+
loading: /* @__PURE__ */ r(
|
|
472
|
+
Ge,
|
|
462
473
|
{
|
|
463
474
|
label: y.loading,
|
|
464
|
-
width:
|
|
465
|
-
height:
|
|
475
|
+
width: ne,
|
|
476
|
+
height: re
|
|
466
477
|
}
|
|
467
478
|
),
|
|
468
|
-
children: g ? Array.from({ length:
|
|
469
|
-
const d = (s.length > 0 ? s[
|
|
470
|
-
return /* @__PURE__ */
|
|
479
|
+
children: g ? Array.from({ length: z ?? 0 }).map((n, a) => {
|
|
480
|
+
const d = (s.length > 0 ? s[a] : a) + 1;
|
|
481
|
+
return /* @__PURE__ */ r(
|
|
471
482
|
"div",
|
|
472
483
|
{
|
|
473
484
|
className: "F0DocumentViewer__page mx-auto w-fit px-4 pt-4 last:pb-4",
|
|
474
|
-
children: /* @__PURE__ */
|
|
485
|
+
children: /* @__PURE__ */ r(
|
|
475
486
|
Be,
|
|
476
487
|
{
|
|
477
488
|
className: "overflow-hidden rounded-lg border border-solid border-f1-border-secondary shadow-md",
|
|
478
489
|
pageNumber: d,
|
|
479
|
-
scale:
|
|
480
|
-
|
|
481
|
-
|
|
490
|
+
scale: Je(
|
|
491
|
+
T,
|
|
492
|
+
F === 90 || F === 270 ? S[a]?.originalHeight : S[a]?.originalWidth
|
|
482
493
|
),
|
|
483
|
-
rotate:
|
|
494
|
+
rotate: F,
|
|
484
495
|
devicePixelRatio: p,
|
|
485
|
-
loading: /* @__PURE__ */
|
|
486
|
-
|
|
496
|
+
loading: /* @__PURE__ */ r(
|
|
497
|
+
E,
|
|
487
498
|
{
|
|
488
499
|
style: {
|
|
489
|
-
width:
|
|
490
|
-
height:
|
|
500
|
+
width: ne,
|
|
501
|
+
height: re
|
|
491
502
|
}
|
|
492
503
|
}
|
|
493
504
|
),
|
|
494
505
|
renderForms: !0,
|
|
495
506
|
renderTextLayer: !0,
|
|
496
507
|
inputRef: (f) => {
|
|
497
|
-
W.current[
|
|
508
|
+
W.current[a] = f;
|
|
498
509
|
},
|
|
499
|
-
onRenderSuccess: () =>
|
|
500
|
-
W.current[
|
|
510
|
+
onRenderSuccess: () => Ke(
|
|
511
|
+
W.current[a]?.querySelector(
|
|
501
512
|
"canvas"
|
|
502
513
|
),
|
|
503
514
|
p
|
|
504
515
|
),
|
|
505
516
|
onLoadSuccess: (f) => {
|
|
506
|
-
|
|
507
|
-
const
|
|
508
|
-
return
|
|
517
|
+
ee((D) => {
|
|
518
|
+
const I = [...D];
|
|
519
|
+
return I[a] = {
|
|
509
520
|
originalWidth: f.originalWidth,
|
|
510
521
|
originalHeight: f.originalHeight
|
|
511
|
-
},
|
|
522
|
+
}, I;
|
|
512
523
|
});
|
|
513
524
|
}
|
|
514
525
|
}
|
|
515
526
|
)
|
|
516
527
|
},
|
|
517
|
-
|
|
528
|
+
a
|
|
518
529
|
);
|
|
519
530
|
}) : null
|
|
520
531
|
}
|
|
@@ -522,14 +533,14 @@ const ue = se((e, t) => {
|
|
|
522
533
|
]
|
|
523
534
|
}
|
|
524
535
|
),
|
|
525
|
-
m === "floating" ? /* @__PURE__ */
|
|
536
|
+
m === "floating" ? /* @__PURE__ */ r(le, { ...ae }) : null
|
|
526
537
|
]
|
|
527
538
|
}
|
|
528
539
|
);
|
|
529
540
|
});
|
|
530
|
-
|
|
531
|
-
const
|
|
532
|
-
const { pdfViewer: e } =
|
|
541
|
+
me.displayName = "PdfViewerBase";
|
|
542
|
+
const it = () => {
|
|
543
|
+
const { pdfViewer: e } = X();
|
|
533
544
|
return /* @__PURE__ */ P(
|
|
534
545
|
"div",
|
|
535
546
|
{
|
|
@@ -537,21 +548,21 @@ const nt = () => {
|
|
|
537
548
|
"aria-busy": "true",
|
|
538
549
|
"aria-live": "polite",
|
|
539
550
|
"aria-label": e.loading,
|
|
540
|
-
className:
|
|
551
|
+
className: G(
|
|
541
552
|
"F0DocumentViewer__surface flex h-full w-full flex-col overflow-hidden",
|
|
542
553
|
"border border-solid border-f1-border-secondary"
|
|
543
554
|
),
|
|
544
555
|
children: [
|
|
545
556
|
/* @__PURE__ */ P("div", { className: "flex flex-row items-center justify-between gap-2 px-6 py-4", children: [
|
|
546
|
-
/* @__PURE__ */
|
|
547
|
-
/* @__PURE__ */
|
|
548
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ r(E, { className: "h-8 w-24 rounded-md" }),
|
|
558
|
+
/* @__PURE__ */ r(E, { className: "h-8 w-40 rounded-md" }),
|
|
559
|
+
/* @__PURE__ */ r(E, { className: "h-8 w-20 rounded-md" })
|
|
549
560
|
] }),
|
|
550
|
-
/* @__PURE__ */
|
|
561
|
+
/* @__PURE__ */ r("div", { className: "flex flex-1 justify-center p-4", children: /* @__PURE__ */ r(E, { className: "h-full w-full max-w-[600px] rounded-md" }) })
|
|
551
562
|
]
|
|
552
563
|
}
|
|
553
564
|
);
|
|
554
|
-
},
|
|
565
|
+
}, lt = [
|
|
555
566
|
"page-width",
|
|
556
567
|
"page-fit",
|
|
557
568
|
"0.5",
|
|
@@ -562,28 +573,28 @@ const nt = () => {
|
|
|
562
573
|
"2",
|
|
563
574
|
"3",
|
|
564
575
|
"4"
|
|
565
|
-
],
|
|
566
|
-
|
|
576
|
+
], pe = Oe(
|
|
577
|
+
We(
|
|
567
578
|
"F0DocumentViewer",
|
|
568
|
-
|
|
579
|
+
je(ue, it)
|
|
569
580
|
)
|
|
570
|
-
),
|
|
581
|
+
), st = pe, ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
571
582
|
__proto__: null,
|
|
572
|
-
F0DocumentViewer:
|
|
573
|
-
F0PdfViewer:
|
|
574
|
-
configurePdfWorker:
|
|
575
|
-
pdfScales:
|
|
583
|
+
F0DocumentViewer: pe,
|
|
584
|
+
F0PdfViewer: st,
|
|
585
|
+
configurePdfWorker: Ie,
|
|
586
|
+
pdfScales: lt
|
|
576
587
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
577
588
|
export {
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
+
pe as F,
|
|
590
|
+
_ as T,
|
|
591
|
+
et as a,
|
|
592
|
+
qe as b,
|
|
593
|
+
st as c,
|
|
594
|
+
gt as d,
|
|
595
|
+
Q as f,
|
|
596
|
+
ht as i,
|
|
597
|
+
Ye as n,
|
|
598
|
+
lt as p,
|
|
599
|
+
Ze as t
|
|
589
600
|
};
|