@alfadocs/ui-kit 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/_commonjsHelpers-C6fGbg64.js +7 -0
- package/dist/_chunks/{ai-prompt-input-bAJwYu84.js → ai-prompt-input-noh-N3cf.js} +2 -2
- package/dist/_chunks/{contact-card-VJIUqKB2.js → contact-card-DTQUMetD.js} +22 -38
- package/dist/_chunks/external-link-C6F25E6k.js +16 -0
- package/dist/_chunks/{file-upload-DIecAfC-.js → file-upload-nMh-1jDD.js} +2 -2
- package/dist/_chunks/{index-CeY1nNvd.js → index-CFoBa86t.js} +61 -63
- package/dist/_chunks/{link-BGpwaFik.js → link-DmM5IevO.js} +16 -26
- package/dist/_chunks/map-pin-B8STOPMJ.js +21 -0
- package/dist/_chunks/map-view-Dd48BxVB.js +1941 -0
- package/dist/_chunks/{pdf-viewer-CNETPubN.js → pdf-viewer-CnEJvmXC.js} +407 -382
- package/dist/_chunks/whatsapp-button-Bj5FIhpC.js +175 -0
- package/dist/agent-catalog.json +53 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/contact-card/index.js +1 -1
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/link/index.js +1 -1
- package/dist/components/map-view/index.d.ts +3 -0
- package/dist/components/map-view/index.js +5 -0
- package/dist/components/map-view/map-view.agent.d.ts +4 -0
- package/dist/components/map-view/map-view.d.ts +78 -0
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/pdf-viewer/pdf-viewer.d.ts +62 -0
- package/dist/components/whatsapp-button/index.d.ts +3 -0
- package/dist/components/whatsapp-button/index.js +5 -0
- package/dist/components/whatsapp-button/whatsapp-button.d.ts +32 -0
- package/dist/i18n/config.js +47 -5
- package/dist/i18n/resources.d.ts +42 -0
- package/dist/index.js +348 -344
- package/dist/locales/de.json +15 -1
- package/dist/locales/en.json +15 -1
- package/dist/locales/it.json +15 -1
- package/dist/tokens/google-maps-theme.d.ts +15 -0
- package/dist/tokens.css +1 -1
- package/package.json +15 -1
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import * as
|
|
4
|
-
import { c as
|
|
5
|
-
import { useTranslation as
|
|
6
|
-
import * as
|
|
7
|
-
import
|
|
8
|
-
import { S as
|
|
9
|
-
import { A as
|
|
10
|
-
import { u as
|
|
11
|
-
import { X as
|
|
12
|
-
import { C as
|
|
13
|
-
import { C as
|
|
14
|
-
import { c as
|
|
15
|
-
import { S as
|
|
16
|
-
import { P as
|
|
1
|
+
import { jsx as n, jsxs as Z } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Fe, useId as Ee, useMemo as xe, useState as h, useEffect as k, useRef as T, useCallback as L, useImperativeHandle as _e } from "react";
|
|
3
|
+
import * as fe from "pdfjs-dist";
|
|
4
|
+
import { c as J } from "./index-D2ZczOXr.js";
|
|
5
|
+
import { useTranslation as pe } from "react-i18next";
|
|
6
|
+
import * as ee from "@radix-ui/react-popover";
|
|
7
|
+
import Me from "pdfjs-dist/build/pdf.worker.min.mjs?url";
|
|
8
|
+
import { S as Le } from "./spinner-DirtWZNG.js";
|
|
9
|
+
import { A as we } from "./alert-pgdXrEO5.js";
|
|
10
|
+
import { u as Ze } from "./registry-C9nwlNyL.js";
|
|
11
|
+
import { X as Be } from "./x-CCcI3eJp.js";
|
|
12
|
+
import { C as Ke } from "./chevron-left-CX1jqD2M.js";
|
|
13
|
+
import { C as He } from "./chevron-right-BrpYejk0.js";
|
|
14
|
+
import { c as Ne } from "./createLucideIcon-CrFbzy84.js";
|
|
15
|
+
import { S as We } from "./search-BonnQsHv.js";
|
|
16
|
+
import { P as Qe } from "./printer-CeVEWfQq.js";
|
|
17
17
|
/**
|
|
18
18
|
* @license lucide-react v1.8.0 - ISC
|
|
19
19
|
*
|
|
20
20
|
* This source code is licensed under the ISC license.
|
|
21
21
|
* See the LICENSE file in the root directory of this source tree.
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const qe = [
|
|
24
24
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
|
|
25
25
|
["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65", key: "13gj7c" }],
|
|
26
26
|
["line", { x1: "11", x2: "11", y1: "8", y2: "14", key: "1vmskp" }],
|
|
27
27
|
["line", { x1: "8", x2: "14", y1: "11", y2: "11", key: "durymu" }]
|
|
28
|
-
],
|
|
28
|
+
], Ue = Ne("zoom-in", qe);
|
|
29
29
|
/**
|
|
30
30
|
* @license lucide-react v1.8.0 - ISC
|
|
31
31
|
*
|
|
32
32
|
* This source code is licensed under the ISC license.
|
|
33
33
|
* See the LICENSE file in the root directory of this source tree.
|
|
34
34
|
*/
|
|
35
|
-
const
|
|
35
|
+
const Je = [
|
|
36
36
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
|
|
37
37
|
["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65", key: "13gj7c" }],
|
|
38
38
|
["line", { x1: "8", x2: "14", y1: "11", y2: "11", key: "durymu" }]
|
|
39
|
-
],
|
|
39
|
+
], $e = Ne("zoom-out", Je), Xe = {
|
|
40
40
|
id: "pdf-viewer",
|
|
41
41
|
capabilities: ["paginate", "view_change", "filter"],
|
|
42
42
|
state: {},
|
|
@@ -82,8 +82,8 @@ const qe = [
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
|
-
|
|
86
|
-
const
|
|
85
|
+
fe.GlobalWorkerOptions.workerSrc = Me;
|
|
86
|
+
const ke = J(
|
|
87
87
|
[
|
|
88
88
|
"ds:pdf-viewer-alfadocs ds:flex ds:flex-col",
|
|
89
89
|
"ds:gap-[var(--spacing-sm)]",
|
|
@@ -95,7 +95,7 @@ const xe = W(
|
|
|
95
95
|
"ds:focus-visible:outline-[var(--ring)]",
|
|
96
96
|
"ds:forced-colors:focus-visible:outline-[CanvasText]"
|
|
97
97
|
].join(" ")
|
|
98
|
-
),
|
|
98
|
+
), Ge = J(
|
|
99
99
|
[
|
|
100
100
|
"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
101
101
|
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
|
|
@@ -103,7 +103,7 @@ const xe = W(
|
|
|
103
103
|
"ds:bg-[var(--background)]",
|
|
104
104
|
"ds:border-b ds:border-[color:var(--border)]"
|
|
105
105
|
].join(" ")
|
|
106
|
-
),
|
|
106
|
+
), ze = J(
|
|
107
107
|
[
|
|
108
108
|
"ds:inline-flex ds:items-center ds:justify-center",
|
|
109
109
|
"ds:min-block-size-[var(--min-target-size)]",
|
|
@@ -120,7 +120,7 @@ const xe = W(
|
|
|
120
120
|
"ds:forced-colors:focus-visible:outline-[CanvasText]",
|
|
121
121
|
"ds:aria-disabled:opacity-[var(--opacity-50)] ds:aria-disabled:cursor-not-allowed"
|
|
122
122
|
].join(" ")
|
|
123
|
-
),
|
|
123
|
+
), Pe = J(
|
|
124
124
|
[
|
|
125
125
|
"ds:min-block-size-[var(--min-target-size)]",
|
|
126
126
|
"ds:inline-size-[4rem] ds:text-center",
|
|
@@ -132,7 +132,7 @@ const xe = W(
|
|
|
132
132
|
"ds:focus-visible:outline-[var(--ring)]",
|
|
133
133
|
"ds:forced-colors:focus-visible:outline-[CanvasText]"
|
|
134
134
|
].join(" ")
|
|
135
|
-
),
|
|
135
|
+
), Ye = J(
|
|
136
136
|
[
|
|
137
137
|
"ds:min-block-size-[var(--min-target-size)]",
|
|
138
138
|
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
|
|
@@ -143,7 +143,7 @@ const xe = W(
|
|
|
143
143
|
"ds:focus-visible:outline-[var(--ring)]",
|
|
144
144
|
"ds:forced-colors:focus-visible:outline-[CanvasText]"
|
|
145
145
|
].join(" ")
|
|
146
|
-
),
|
|
146
|
+
), et = J(
|
|
147
147
|
[
|
|
148
148
|
"ds:relative ds:flex ds:flex-col ds:items-center",
|
|
149
149
|
"ds:gap-[var(--spacing-md)]",
|
|
@@ -153,14 +153,14 @@ const xe = W(
|
|
|
153
153
|
"ds:min-block-size-[30rem]",
|
|
154
154
|
"ds:max-block-size-[80vh]"
|
|
155
155
|
].join(" ")
|
|
156
|
-
),
|
|
156
|
+
), tt = J(
|
|
157
157
|
[
|
|
158
158
|
"ds:relative ds:flex ds:items-center ds:justify-center",
|
|
159
159
|
"ds:bg-[var(--background)]",
|
|
160
160
|
"ds:shadow-[var(--shadow-md)]",
|
|
161
161
|
"ds:rounded-[var(--radius-sm)]"
|
|
162
162
|
].join(" ")
|
|
163
|
-
),
|
|
163
|
+
), rt = [
|
|
164
164
|
"fit-width",
|
|
165
165
|
"fit-page",
|
|
166
166
|
"actual-size",
|
|
@@ -171,64 +171,66 @@ const xe = W(
|
|
|
171
171
|
1.5,
|
|
172
172
|
2
|
|
173
173
|
];
|
|
174
|
-
function
|
|
174
|
+
function X(i) {
|
|
175
175
|
return typeof i == "number";
|
|
176
176
|
}
|
|
177
|
-
function
|
|
178
|
-
if (
|
|
177
|
+
function Se(i, t, u) {
|
|
178
|
+
if (X(i)) return i;
|
|
179
179
|
if (i === "actual-size" || !u) return 1;
|
|
180
|
-
const
|
|
181
|
-
return i === "fit-width" ?
|
|
180
|
+
const v = window.getComputedStyle(u), b = parseFloat(v.paddingInlineStart || "0") + parseFloat(v.paddingInlineEnd || "0"), g = parseFloat(v.paddingBlockStart || "0") + parseFloat(v.paddingBlockEnd || "0"), z = Math.max(u.clientWidth - b, 1), m = Math.max(u.clientHeight - g, 1), P = t.width, S = t.height;
|
|
181
|
+
return i === "fit-width" ? z / P : Math.min(z / P, m / S);
|
|
182
182
|
}
|
|
183
|
-
const
|
|
183
|
+
const nt = Fe(
|
|
184
184
|
({
|
|
185
185
|
id: i,
|
|
186
186
|
src: t,
|
|
187
187
|
initialPage: u = 1,
|
|
188
|
-
initialZoom:
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
188
|
+
initialZoom: v = "fit-width",
|
|
189
|
+
pageRotation: b,
|
|
190
|
+
renderPageOverlay: g,
|
|
191
|
+
onPageChange: z,
|
|
192
|
+
onLoadComplete: m,
|
|
193
|
+
onError: P,
|
|
194
|
+
toolbar: S = !0,
|
|
195
|
+
ariaLabel: B,
|
|
196
|
+
className: A
|
|
197
|
+
}, V) => {
|
|
198
|
+
const { t: C } = pe(), F = Ee(), E = xe(
|
|
199
|
+
() => `pdf-${F.replace(/[^a-zA-Z0-9-_]/g, "")}`,
|
|
200
|
+
[F]
|
|
201
|
+
), [y, K] = h(!1), [f, H] = h(!1);
|
|
202
|
+
k(() => {
|
|
201
203
|
if (typeof document > "u") return;
|
|
202
|
-
|
|
203
|
-
const e = window.matchMedia("(prefers-reduced-motion: reduce)"), r = () =>
|
|
204
|
+
K(document.documentElement.dir === "rtl");
|
|
205
|
+
const e = window.matchMedia("(prefers-reduced-motion: reduce)"), r = () => H(e.matches);
|
|
204
206
|
return r(), e.addEventListener("change", r), () => e.removeEventListener("change", r);
|
|
205
207
|
}, []);
|
|
206
|
-
const [s,
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}, [
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}, [s]),
|
|
208
|
+
const [s, W] = h(null), [Q, d] = h(null), [c, N] = h(u), [x, p] = h(v), [a, w] = h({ start: Math.max(1, u - 1), end: u + 1 }), [O, te] = h(""), [G, j] = h(!1), [I, me] = h(""), [Ie, De] = h({ current: 0, total: 0 }), re = T(z), ne = T(m), ae = T(P);
|
|
209
|
+
k(() => {
|
|
210
|
+
re.current = z, ne.current = m, ae.current = P;
|
|
211
|
+
}, [z, m, P]);
|
|
212
|
+
const de = T(null);
|
|
213
|
+
k(() => {
|
|
214
|
+
de.current = s;
|
|
215
|
+
}, [s]), k(() => {
|
|
214
216
|
let e = !1;
|
|
215
|
-
|
|
217
|
+
W(null), d(null);
|
|
216
218
|
const r = {
|
|
217
219
|
disableJavaScript: !0,
|
|
218
220
|
isEvalSupported: !1
|
|
219
|
-
},
|
|
221
|
+
}, l = fe.getDocument(
|
|
220
222
|
typeof t == "string" ? { url: t, ...r } : t instanceof Uint8Array ? { data: t, ...r } : { data: new Uint8Array(t), ...r }
|
|
221
223
|
);
|
|
222
|
-
return
|
|
224
|
+
return l.promise.then(
|
|
223
225
|
async (o) => {
|
|
224
|
-
var
|
|
226
|
+
var q;
|
|
225
227
|
if (e) return;
|
|
226
|
-
let
|
|
228
|
+
let M;
|
|
227
229
|
try {
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
+
const U = await o.getMetadata(), R = U == null ? void 0 : U.info;
|
|
231
|
+
M = R == null ? void 0 : R.Title;
|
|
230
232
|
} catch {
|
|
231
|
-
|
|
233
|
+
M = void 0;
|
|
232
234
|
}
|
|
233
235
|
if (e) {
|
|
234
236
|
try {
|
|
@@ -237,70 +239,70 @@ const tt = je(
|
|
|
237
239
|
}
|
|
238
240
|
return;
|
|
239
241
|
}
|
|
240
|
-
const _ = { doc: o, numPages: o.numPages, title:
|
|
241
|
-
|
|
242
|
+
const _ = { doc: o, numPages: o.numPages, title: M };
|
|
243
|
+
W(_), (q = ne.current) == null || q.call(ne, { numPages: o.numPages, title: M });
|
|
242
244
|
},
|
|
243
245
|
(o) => {
|
|
244
246
|
var _;
|
|
245
247
|
if (e) return;
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
+
const M = o instanceof Error ? o : new Error(String(o));
|
|
249
|
+
d(M), (_ = ae.current) == null || _.call(ae, M);
|
|
248
250
|
}
|
|
249
251
|
), () => {
|
|
250
|
-
e = !0,
|
|
251
|
-
const o =
|
|
252
|
+
e = !0, l.destroy();
|
|
253
|
+
const o = de.current;
|
|
252
254
|
if (o) {
|
|
253
255
|
try {
|
|
254
256
|
o.doc.destroy();
|
|
255
257
|
} catch {
|
|
256
258
|
}
|
|
257
|
-
|
|
259
|
+
de.current = null;
|
|
258
260
|
}
|
|
259
261
|
};
|
|
260
|
-
}, [t]),
|
|
262
|
+
}, [t]), k(() => {
|
|
261
263
|
var e;
|
|
262
|
-
s && (
|
|
263
|
-
|
|
264
|
-
), (e =
|
|
265
|
-
}, [
|
|
266
|
-
const
|
|
264
|
+
s && (te(
|
|
265
|
+
C("pdf.pageOf", { current: c, total: s.numPages })
|
|
266
|
+
), (e = re.current) == null || e.call(re, c));
|
|
267
|
+
}, [c, s, C]);
|
|
268
|
+
const se = T(null), ce = T([]), D = L(
|
|
267
269
|
(e) => {
|
|
268
270
|
if (!s) return;
|
|
269
271
|
const r = Math.max(1, Math.min(e, s.numPages));
|
|
270
|
-
|
|
271
|
-
const
|
|
272
|
-
|
|
272
|
+
N(r);
|
|
273
|
+
const l = ce.current[r - 1];
|
|
274
|
+
l && l.scrollIntoView({
|
|
273
275
|
behavior: "auto",
|
|
274
276
|
block: "start"
|
|
275
277
|
});
|
|
276
278
|
},
|
|
277
|
-
[s,
|
|
278
|
-
),
|
|
279
|
-
|
|
280
|
-
}, []),
|
|
279
|
+
[s, f]
|
|
280
|
+
), ge = L((e) => {
|
|
281
|
+
p(e);
|
|
282
|
+
}, []), Y = L(() => {
|
|
281
283
|
typeof window < "u" && window.print();
|
|
282
|
-
}, []),
|
|
283
|
-
|
|
284
|
-
}, []),
|
|
284
|
+
}, []), he = L((e) => {
|
|
285
|
+
me(e), j(e.length > 0);
|
|
286
|
+
}, []), le = xe(
|
|
285
287
|
() => ({
|
|
286
288
|
goToPage: D,
|
|
287
|
-
setZoom:
|
|
288
|
-
search:
|
|
289
|
-
print:
|
|
289
|
+
setZoom: ge,
|
|
290
|
+
search: he,
|
|
291
|
+
print: Y
|
|
290
292
|
}),
|
|
291
|
-
[D,
|
|
293
|
+
[D, ge, he, Y]
|
|
292
294
|
);
|
|
293
|
-
|
|
294
|
-
const
|
|
295
|
+
_e(V, () => le, [le]), Ze(Xe, le, i);
|
|
296
|
+
const Re = L(
|
|
295
297
|
(e) => {
|
|
296
298
|
if (!s) return;
|
|
297
299
|
const r = e.metaKey || e.ctrlKey;
|
|
298
300
|
if (e.key === "PageDown") {
|
|
299
|
-
e.preventDefault(), D(
|
|
301
|
+
e.preventDefault(), D(c + 1);
|
|
300
302
|
return;
|
|
301
303
|
}
|
|
302
304
|
if (e.key === "PageUp") {
|
|
303
|
-
e.preventDefault(), D(
|
|
305
|
+
e.preventDefault(), D(c - 1);
|
|
304
306
|
return;
|
|
305
307
|
}
|
|
306
308
|
if (e.key === "Home") {
|
|
@@ -312,89 +314,89 @@ const tt = je(
|
|
|
312
314
|
return;
|
|
313
315
|
}
|
|
314
316
|
if (r && e.key.toLowerCase() === "f") {
|
|
315
|
-
e.preventDefault(),
|
|
317
|
+
e.preventDefault(), j(!0);
|
|
316
318
|
return;
|
|
317
319
|
}
|
|
318
320
|
if (r && (e.key === "+" || e.key === "=")) {
|
|
319
|
-
e.preventDefault(),
|
|
321
|
+
e.preventDefault(), p((l) => X(l) ? Math.min(l * 1.25, 4) : 1.25);
|
|
320
322
|
return;
|
|
321
323
|
}
|
|
322
324
|
if (r && e.key === "-") {
|
|
323
|
-
e.preventDefault(),
|
|
324
|
-
(
|
|
325
|
+
e.preventDefault(), p(
|
|
326
|
+
(l) => X(l) ? Math.max(l / 1.25, 0.25) : 0.75
|
|
325
327
|
);
|
|
326
328
|
return;
|
|
327
329
|
}
|
|
328
330
|
if (r && e.key === "0") {
|
|
329
|
-
e.preventDefault(),
|
|
331
|
+
e.preventDefault(), p("fit-width");
|
|
330
332
|
return;
|
|
331
333
|
}
|
|
332
|
-
r && e.key.toLowerCase() === "p" && (e.preventDefault(),
|
|
334
|
+
r && e.key.toLowerCase() === "p" && (e.preventDefault(), Y());
|
|
333
335
|
},
|
|
334
|
-
[
|
|
335
|
-
),
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
}, [
|
|
336
|
+
[c, D, Y, s]
|
|
337
|
+
), ue = T(c);
|
|
338
|
+
k(() => {
|
|
339
|
+
ue.current = c;
|
|
340
|
+
}, [c]), k(() => {
|
|
339
341
|
if (!s) return;
|
|
340
|
-
const e =
|
|
342
|
+
const e = se.current;
|
|
341
343
|
if (!e) return;
|
|
342
|
-
const r = /* @__PURE__ */ new Map(),
|
|
344
|
+
const r = /* @__PURE__ */ new Map(), l = new IntersectionObserver(
|
|
343
345
|
(o) => {
|
|
344
|
-
for (const
|
|
345
|
-
const
|
|
346
|
-
if (
|
|
347
|
-
const
|
|
348
|
-
r.set(
|
|
346
|
+
for (const R of o) {
|
|
347
|
+
const $ = R.target.dataset.pageNumber;
|
|
348
|
+
if (!$) continue;
|
|
349
|
+
const Ve = Number($);
|
|
350
|
+
r.set(Ve, R.intersectionRatio);
|
|
349
351
|
}
|
|
350
|
-
let
|
|
351
|
-
for (const [
|
|
352
|
-
|
|
353
|
-
_ > 0 &&
|
|
354
|
-
start: Math.max(1,
|
|
355
|
-
end: Math.min(s.numPages,
|
|
352
|
+
let M = ue.current, _ = 0, q = 1 / 0, U = -1 / 0;
|
|
353
|
+
for (const [R, $] of r.entries())
|
|
354
|
+
$ > _ && (M = R, _ = $), $ > 0 && (q = Math.min(q, R), U = Math.max(U, R));
|
|
355
|
+
_ > 0 && M !== ue.current && N(M), q !== 1 / 0 && w({
|
|
356
|
+
start: Math.max(1, q - 1),
|
|
357
|
+
end: Math.min(s.numPages, U + 1)
|
|
356
358
|
});
|
|
357
359
|
},
|
|
358
360
|
{ root: e, threshold: [0, 0.25, 0.5, 0.75, 1] }
|
|
359
361
|
);
|
|
360
|
-
return
|
|
361
|
-
o &&
|
|
362
|
-
}), () =>
|
|
362
|
+
return ce.current.forEach((o) => {
|
|
363
|
+
o && l.observe(o);
|
|
364
|
+
}), () => l.disconnect();
|
|
363
365
|
}, [s]);
|
|
364
|
-
const [
|
|
365
|
-
|
|
366
|
-
const e =
|
|
366
|
+
const [Te, Ae] = h(0);
|
|
367
|
+
k(() => {
|
|
368
|
+
const e = se.current;
|
|
367
369
|
if (!e || typeof ResizeObserver > "u") return;
|
|
368
370
|
const r = new ResizeObserver(() => {
|
|
369
|
-
(
|
|
371
|
+
(x === "fit-width" || x === "fit-page") && Ae((l) => l + 1);
|
|
370
372
|
});
|
|
371
373
|
return r.observe(e), () => r.disconnect();
|
|
372
|
-
}, [
|
|
373
|
-
const
|
|
374
|
+
}, [x]);
|
|
375
|
+
const ve = T([]), [oe, be] = h(0), Oe = L(
|
|
374
376
|
(e) => (r) => {
|
|
375
|
-
|
|
377
|
+
ve.current[e] = r;
|
|
376
378
|
},
|
|
377
379
|
[]
|
|
378
|
-
),
|
|
379
|
-
const r =
|
|
380
|
+
), ye = L((e) => {
|
|
381
|
+
const r = ve.current[e];
|
|
380
382
|
r && r.focus();
|
|
381
|
-
}, []),
|
|
383
|
+
}, []), ie = 8, je = L(
|
|
382
384
|
(e) => {
|
|
383
|
-
const r =
|
|
385
|
+
const r = y ? "ArrowLeft" : "ArrowRight", l = y ? "ArrowRight" : "ArrowLeft";
|
|
384
386
|
let o = null;
|
|
385
|
-
e.key === r ? o = (
|
|
387
|
+
e.key === r ? o = (oe + 1) % ie : e.key === l ? o = (oe - 1 + ie) % ie : e.key === "Home" ? o = 0 : e.key === "End" && (o = ie - 1), o !== null && (e.preventDefault(), be(o), ye(o));
|
|
386
388
|
},
|
|
387
|
-
[
|
|
389
|
+
[ye, y, oe]
|
|
388
390
|
);
|
|
389
|
-
return
|
|
391
|
+
return Q ? /* @__PURE__ */ n(
|
|
390
392
|
"div",
|
|
391
393
|
{
|
|
392
|
-
className: [
|
|
393
|
-
"aria-label":
|
|
394
|
-
children: /* @__PURE__ */
|
|
395
|
-
|
|
394
|
+
className: [ke(), A].filter(Boolean).join(" "),
|
|
395
|
+
"aria-label": B ?? C("pdf.error"),
|
|
396
|
+
children: /* @__PURE__ */ n("div", { className: "ds:p-[var(--spacing-lg)]", children: /* @__PURE__ */ n(we, { variant: "error", live: "polite", children: /* @__PURE__ */ Z(we.Description, { children: [
|
|
397
|
+
C("pdf.error"),
|
|
396
398
|
": ",
|
|
397
|
-
|
|
399
|
+
Q.message
|
|
398
400
|
] }) }) })
|
|
399
401
|
}
|
|
400
402
|
) : (
|
|
@@ -402,87 +404,89 @@ const tt = je(
|
|
|
402
404
|
/* @__PURE__ */ Z(
|
|
403
405
|
"div",
|
|
404
406
|
{
|
|
405
|
-
id:
|
|
407
|
+
id: E,
|
|
406
408
|
role: "region",
|
|
407
|
-
"aria-label":
|
|
408
|
-
className: [
|
|
409
|
-
dir:
|
|
410
|
-
onKeyDown:
|
|
409
|
+
"aria-label": B ?? C("pdf.toolbarLabel"),
|
|
410
|
+
className: [ke(), A].filter(Boolean).join(" "),
|
|
411
|
+
dir: y ? "rtl" : void 0,
|
|
412
|
+
onKeyDown: Re,
|
|
411
413
|
tabIndex: -1,
|
|
412
414
|
"data-component": "pdf-viewer",
|
|
413
415
|
"data-component-id": i,
|
|
414
|
-
"data-pdfjs-worker-src":
|
|
416
|
+
"data-pdfjs-worker-src": Me,
|
|
415
417
|
children: [
|
|
416
|
-
|
|
417
|
-
|
|
418
|
+
S ? /* @__PURE__ */ n(
|
|
419
|
+
at,
|
|
418
420
|
{
|
|
419
|
-
currentPage:
|
|
421
|
+
currentPage: c,
|
|
420
422
|
numPages: (s == null ? void 0 : s.numPages) ?? 0,
|
|
421
|
-
zoom:
|
|
422
|
-
onPrev: () => D(
|
|
423
|
-
onNext: () => D(
|
|
423
|
+
zoom: x,
|
|
424
|
+
onPrev: () => D(c - 1),
|
|
425
|
+
onNext: () => D(c + 1),
|
|
424
426
|
onJump: (e) => D(e),
|
|
425
427
|
onZoomIn: () => {
|
|
426
|
-
|
|
427
|
-
(e) =>
|
|
428
|
+
p(
|
|
429
|
+
(e) => X(e) ? Math.min(e * 1.25, 4) : 1.25
|
|
428
430
|
);
|
|
429
431
|
},
|
|
430
432
|
onZoomOut: () => {
|
|
431
|
-
|
|
432
|
-
(e) =>
|
|
433
|
+
p(
|
|
434
|
+
(e) => X(e) ? Math.max(e / 1.25, 0.25) : 0.75
|
|
433
435
|
);
|
|
434
436
|
},
|
|
435
|
-
onZoomPreset: (e) =>
|
|
436
|
-
onOpenSearch: () =>
|
|
437
|
-
onPrint:
|
|
438
|
-
searchOpen:
|
|
439
|
-
onSearchOpenChange:
|
|
440
|
-
searchQuery:
|
|
437
|
+
onZoomPreset: (e) => p(e),
|
|
438
|
+
onOpenSearch: () => j(!0),
|
|
439
|
+
onPrint: Y,
|
|
440
|
+
searchOpen: G,
|
|
441
|
+
onSearchOpenChange: j,
|
|
442
|
+
searchQuery: I,
|
|
441
443
|
onSearchQueryChange: (e) => {
|
|
442
|
-
|
|
444
|
+
me(e);
|
|
443
445
|
},
|
|
444
|
-
searchMatches:
|
|
445
|
-
register:
|
|
446
|
-
focusIndex:
|
|
447
|
-
setFocusIndex:
|
|
448
|
-
onToolbarKeyDown:
|
|
449
|
-
isRtl:
|
|
446
|
+
searchMatches: Ie,
|
|
447
|
+
register: Oe,
|
|
448
|
+
focusIndex: oe,
|
|
449
|
+
setFocusIndex: be,
|
|
450
|
+
onToolbarKeyDown: je,
|
|
451
|
+
isRtl: y
|
|
450
452
|
}
|
|
451
453
|
) : null,
|
|
452
|
-
/* @__PURE__ */
|
|
453
|
-
/* @__PURE__ */
|
|
454
|
+
/* @__PURE__ */ n("div", { "aria-live": "polite", "aria-atomic": "true", className: "ds:sr-only", children: O }),
|
|
455
|
+
/* @__PURE__ */ n(
|
|
454
456
|
"div",
|
|
455
457
|
{
|
|
456
|
-
ref:
|
|
457
|
-
className:
|
|
458
|
+
ref: se,
|
|
459
|
+
className: et(),
|
|
458
460
|
"data-testid": "pdf-pages-container",
|
|
459
461
|
children: s ? Array.from({ length: s.numPages }, (e, r) => r + 1).map(
|
|
460
|
-
(e) => /* @__PURE__ */
|
|
461
|
-
|
|
462
|
+
(e) => /* @__PURE__ */ n(
|
|
463
|
+
st,
|
|
462
464
|
{
|
|
463
465
|
pageNumber: e,
|
|
464
466
|
totalPages: s.numPages,
|
|
465
467
|
doc: s.doc,
|
|
466
|
-
zoom:
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
468
|
+
zoom: x,
|
|
469
|
+
pageRotation: b,
|
|
470
|
+
renderPageOverlay: g,
|
|
471
|
+
container: se.current,
|
|
472
|
+
resizeTick: Te,
|
|
473
|
+
shouldRender: e >= a.start && e <= a.end,
|
|
470
474
|
registerRef: (r) => {
|
|
471
|
-
|
|
475
|
+
ce.current[e - 1] = r;
|
|
472
476
|
},
|
|
473
|
-
searchQuery:
|
|
477
|
+
searchQuery: I,
|
|
474
478
|
onMatchCount: (r) => {
|
|
475
|
-
|
|
476
|
-
current: Math.min(
|
|
477
|
-
total: Math.max(
|
|
479
|
+
De((l) => r === 0 && l.total === 0 ? l : {
|
|
480
|
+
current: Math.min(l.current || 1, r || 1),
|
|
481
|
+
total: Math.max(l.total, r)
|
|
478
482
|
});
|
|
479
483
|
}
|
|
480
484
|
},
|
|
481
485
|
e
|
|
482
486
|
)
|
|
483
487
|
) : /* @__PURE__ */ Z("div", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)] ds:text-[var(--muted-foreground)] ds:p-[var(--spacing-lg)]", children: [
|
|
484
|
-
/* @__PURE__ */
|
|
485
|
-
/* @__PURE__ */
|
|
488
|
+
/* @__PURE__ */ n(Le, { size: "sm", label: C("pdf.loading") }),
|
|
489
|
+
/* @__PURE__ */ n("span", { children: C("pdf.loading") })
|
|
486
490
|
] })
|
|
487
491
|
}
|
|
488
492
|
)
|
|
@@ -492,59 +496,59 @@ const tt = je(
|
|
|
492
496
|
);
|
|
493
497
|
}
|
|
494
498
|
);
|
|
495
|
-
|
|
496
|
-
function
|
|
497
|
-
const { t } =
|
|
499
|
+
nt.displayName = "PDFViewer";
|
|
500
|
+
function at(i) {
|
|
501
|
+
const { t } = pe(), {
|
|
498
502
|
currentPage: u,
|
|
499
|
-
numPages:
|
|
500
|
-
zoom:
|
|
503
|
+
numPages: v,
|
|
504
|
+
zoom: b,
|
|
501
505
|
onPrev: g,
|
|
502
|
-
onNext:
|
|
503
|
-
onJump:
|
|
504
|
-
onZoomIn:
|
|
505
|
-
onZoomOut:
|
|
506
|
-
onZoomPreset:
|
|
507
|
-
onOpenSearch:
|
|
506
|
+
onNext: z,
|
|
507
|
+
onJump: m,
|
|
508
|
+
onZoomIn: P,
|
|
509
|
+
onZoomOut: S,
|
|
510
|
+
onZoomPreset: B,
|
|
511
|
+
onOpenSearch: A,
|
|
508
512
|
onPrint: V,
|
|
509
|
-
searchOpen:
|
|
510
|
-
onSearchOpenChange:
|
|
511
|
-
searchQuery:
|
|
512
|
-
onSearchQueryChange:
|
|
513
|
+
searchOpen: C,
|
|
514
|
+
onSearchOpenChange: F,
|
|
515
|
+
searchQuery: E,
|
|
516
|
+
onSearchQueryChange: y,
|
|
513
517
|
searchMatches: K,
|
|
514
|
-
register:
|
|
515
|
-
focusIndex:
|
|
516
|
-
setFocusIndex:
|
|
517
|
-
onToolbarKeyDown:
|
|
518
|
-
} = i, [
|
|
519
|
-
|
|
520
|
-
|
|
518
|
+
register: f,
|
|
519
|
+
focusIndex: H,
|
|
520
|
+
setFocusIndex: s,
|
|
521
|
+
onToolbarKeyDown: W
|
|
522
|
+
} = i, [Q, d] = h(String(u));
|
|
523
|
+
k(() => {
|
|
524
|
+
d(String(u));
|
|
521
525
|
}, [u]);
|
|
522
|
-
const
|
|
523
|
-
function
|
|
524
|
-
const
|
|
525
|
-
Number.isFinite(
|
|
526
|
+
const c = u <= 1, N = u >= v;
|
|
527
|
+
function x() {
|
|
528
|
+
const a = Number(Q);
|
|
529
|
+
Number.isFinite(a) && a >= 1 ? m(Math.min(a, v)) : d(String(u));
|
|
526
530
|
}
|
|
527
|
-
function
|
|
528
|
-
return /* @__PURE__ */
|
|
531
|
+
function p(a) {
|
|
532
|
+
return /* @__PURE__ */ n(
|
|
529
533
|
"button",
|
|
530
534
|
{
|
|
531
535
|
type: "button",
|
|
532
|
-
ref:
|
|
533
|
-
tabIndex:
|
|
534
|
-
onFocus: () =>
|
|
535
|
-
onKeyDown:
|
|
536
|
-
"aria-label":
|
|
537
|
-
"aria-disabled":
|
|
538
|
-
title:
|
|
539
|
-
onClick: (
|
|
540
|
-
if (
|
|
541
|
-
|
|
536
|
+
ref: f(a.index),
|
|
537
|
+
tabIndex: a.index === H ? 0 : -1,
|
|
538
|
+
onFocus: () => s(a.index),
|
|
539
|
+
onKeyDown: W,
|
|
540
|
+
"aria-label": a.label,
|
|
541
|
+
"aria-disabled": a.disabled || void 0,
|
|
542
|
+
title: a.label,
|
|
543
|
+
onClick: (w) => {
|
|
544
|
+
if (a.disabled) {
|
|
545
|
+
w.preventDefault();
|
|
542
546
|
return;
|
|
543
547
|
}
|
|
544
|
-
|
|
548
|
+
a.onActivate();
|
|
545
549
|
},
|
|
546
|
-
className:
|
|
547
|
-
children:
|
|
550
|
+
className: ze(),
|
|
551
|
+
children: a.icon
|
|
548
552
|
}
|
|
549
553
|
);
|
|
550
554
|
}
|
|
@@ -553,86 +557,86 @@ function rt(i) {
|
|
|
553
557
|
{
|
|
554
558
|
role: "toolbar",
|
|
555
559
|
"aria-label": t("pdf.toolbarLabel"),
|
|
556
|
-
className:
|
|
560
|
+
className: Ge(),
|
|
557
561
|
children: [
|
|
558
|
-
|
|
562
|
+
p({
|
|
559
563
|
index: 0,
|
|
560
564
|
label: t("pdf.previousPage"),
|
|
561
|
-
disabled:
|
|
565
|
+
disabled: c,
|
|
562
566
|
onActivate: g,
|
|
563
|
-
icon: /* @__PURE__ */
|
|
564
|
-
|
|
567
|
+
icon: /* @__PURE__ */ n(
|
|
568
|
+
Ke,
|
|
565
569
|
{
|
|
566
570
|
"aria-hidden": "true",
|
|
567
571
|
className: "ds:block-size-4 ds:inline-size-4 ds:rtl:rotate-180"
|
|
568
572
|
}
|
|
569
573
|
)
|
|
570
574
|
}),
|
|
571
|
-
|
|
575
|
+
p({
|
|
572
576
|
index: 1,
|
|
573
577
|
label: t("pdf.nextPage"),
|
|
574
|
-
disabled:
|
|
575
|
-
onActivate:
|
|
576
|
-
icon: /* @__PURE__ */
|
|
577
|
-
|
|
578
|
+
disabled: N,
|
|
579
|
+
onActivate: z,
|
|
580
|
+
icon: /* @__PURE__ */ n(
|
|
581
|
+
He,
|
|
578
582
|
{
|
|
579
583
|
"aria-hidden": "true",
|
|
580
584
|
className: "ds:block-size-4 ds:inline-size-4 ds:rtl:rotate-180"
|
|
581
585
|
}
|
|
582
586
|
)
|
|
583
587
|
}),
|
|
584
|
-
/* @__PURE__ */
|
|
588
|
+
/* @__PURE__ */ n(
|
|
585
589
|
"input",
|
|
586
590
|
{
|
|
587
591
|
type: "number",
|
|
588
592
|
min: 1,
|
|
589
|
-
max: Math.max(
|
|
590
|
-
value:
|
|
591
|
-
onChange: (
|
|
592
|
-
onKeyDown: (
|
|
593
|
-
|
|
593
|
+
max: Math.max(v, 1),
|
|
594
|
+
value: Q,
|
|
595
|
+
onChange: (a) => d(a.target.value),
|
|
596
|
+
onKeyDown: (a) => {
|
|
597
|
+
a.key === "Enter" && (a.preventDefault(), x());
|
|
594
598
|
},
|
|
595
|
-
onBlur:
|
|
596
|
-
onFocus: () =>
|
|
597
|
-
ref:
|
|
598
|
-
tabIndex:
|
|
599
|
+
onBlur: x,
|
|
600
|
+
onFocus: () => s(2),
|
|
601
|
+
ref: f(2),
|
|
602
|
+
tabIndex: H === 2 ? 0 : -1,
|
|
599
603
|
"aria-label": t("pdf.currentPageInput"),
|
|
600
|
-
className:
|
|
604
|
+
className: Pe()
|
|
601
605
|
}
|
|
602
606
|
),
|
|
603
|
-
/* @__PURE__ */
|
|
607
|
+
/* @__PURE__ */ n(
|
|
604
608
|
"span",
|
|
605
609
|
{
|
|
606
610
|
"aria-hidden": "true",
|
|
607
611
|
className: "type-body-sm ds:text-[var(--muted-foreground)]",
|
|
608
|
-
children: t("pdf.pageOf", { current: u, total:
|
|
612
|
+
children: t("pdf.pageOf", { current: u, total: v || 0 })
|
|
609
613
|
}
|
|
610
614
|
),
|
|
611
|
-
/* @__PURE__ */
|
|
615
|
+
/* @__PURE__ */ n(
|
|
612
616
|
"span",
|
|
613
617
|
{
|
|
614
618
|
"aria-hidden": "true",
|
|
615
619
|
className: "ds:inline-block ds:block-size-6 ds:inline-size-px ds:bg-[var(--border)] ds:ms-[var(--spacing-xs)] ds:me-[var(--spacing-xs)]"
|
|
616
620
|
}
|
|
617
621
|
),
|
|
618
|
-
|
|
622
|
+
p({
|
|
619
623
|
index: 3,
|
|
620
624
|
label: t("pdf.zoom.out"),
|
|
621
|
-
onActivate:
|
|
622
|
-
icon: /* @__PURE__ */
|
|
623
|
-
|
|
625
|
+
onActivate: S,
|
|
626
|
+
icon: /* @__PURE__ */ n(
|
|
627
|
+
$e,
|
|
624
628
|
{
|
|
625
629
|
"aria-hidden": "true",
|
|
626
630
|
className: "ds:block-size-4 ds:inline-size-4"
|
|
627
631
|
}
|
|
628
632
|
)
|
|
629
633
|
}),
|
|
630
|
-
|
|
634
|
+
p({
|
|
631
635
|
index: 4,
|
|
632
636
|
label: t("pdf.zoom.in"),
|
|
633
|
-
onActivate:
|
|
634
|
-
icon: /* @__PURE__ */
|
|
635
|
-
|
|
637
|
+
onActivate: P,
|
|
638
|
+
icon: /* @__PURE__ */ n(
|
|
639
|
+
Ue,
|
|
636
640
|
{
|
|
637
641
|
"aria-hidden": "true",
|
|
638
642
|
className: "ds:block-size-4 ds:inline-size-4"
|
|
@@ -643,44 +647,44 @@ function rt(i) {
|
|
|
643
647
|
"select",
|
|
644
648
|
{
|
|
645
649
|
"aria-label": t("pdf.zoom.preset"),
|
|
646
|
-
value: typeof
|
|
647
|
-
onChange: (
|
|
648
|
-
const
|
|
649
|
-
if (
|
|
650
|
-
|
|
650
|
+
value: typeof b == "number" ? String(b) : b,
|
|
651
|
+
onChange: (a) => {
|
|
652
|
+
const w = a.target.value;
|
|
653
|
+
if (w === "fit-width" || w === "fit-page" || w === "actual-size")
|
|
654
|
+
B(w);
|
|
651
655
|
else {
|
|
652
|
-
const
|
|
653
|
-
Number.isFinite(
|
|
656
|
+
const O = Number(w);
|
|
657
|
+
Number.isFinite(O) && B(O);
|
|
654
658
|
}
|
|
655
659
|
},
|
|
656
|
-
ref:
|
|
657
|
-
tabIndex:
|
|
658
|
-
onFocus: () =>
|
|
659
|
-
onKeyDown:
|
|
660
|
-
className:
|
|
660
|
+
ref: f(5),
|
|
661
|
+
tabIndex: H === 5 ? 0 : -1,
|
|
662
|
+
onFocus: () => s(5),
|
|
663
|
+
onKeyDown: W,
|
|
664
|
+
className: Ye(),
|
|
661
665
|
children: [
|
|
662
|
-
/* @__PURE__ */
|
|
663
|
-
/* @__PURE__ */
|
|
664
|
-
/* @__PURE__ */
|
|
665
|
-
|
|
666
|
+
/* @__PURE__ */ n("option", { value: "fit-width", children: t("pdf.zoom.fitWidth") }),
|
|
667
|
+
/* @__PURE__ */ n("option", { value: "fit-page", children: t("pdf.zoom.fitPage") }),
|
|
668
|
+
/* @__PURE__ */ n("option", { value: "actual-size", children: t("pdf.zoom.actualSize") }),
|
|
669
|
+
rt.filter(X).map((a) => /* @__PURE__ */ n("option", { value: String(a), children: `${Math.round(a * 100)}%` }, a))
|
|
666
670
|
]
|
|
667
671
|
}
|
|
668
672
|
),
|
|
669
|
-
/* @__PURE__ */ Z(
|
|
670
|
-
/* @__PURE__ */
|
|
673
|
+
/* @__PURE__ */ Z(ee.Root, { open: C, onOpenChange: F, children: [
|
|
674
|
+
/* @__PURE__ */ n(ee.Trigger, { asChild: !0, children: p({
|
|
671
675
|
index: 6,
|
|
672
676
|
label: t("pdf.search.open"),
|
|
673
|
-
onActivate:
|
|
674
|
-
icon: /* @__PURE__ */
|
|
675
|
-
|
|
677
|
+
onActivate: A,
|
|
678
|
+
icon: /* @__PURE__ */ n(
|
|
679
|
+
We,
|
|
676
680
|
{
|
|
677
681
|
"aria-hidden": "true",
|
|
678
682
|
className: "ds:block-size-4 ds:inline-size-4"
|
|
679
683
|
}
|
|
680
684
|
)
|
|
681
685
|
}) }),
|
|
682
|
-
/* @__PURE__ */
|
|
683
|
-
|
|
686
|
+
/* @__PURE__ */ n(ee.Portal, { children: /* @__PURE__ */ Z(
|
|
687
|
+
ee.Content,
|
|
684
688
|
{
|
|
685
689
|
sideOffset: 8,
|
|
686
690
|
className: [
|
|
@@ -692,21 +696,21 @@ function rt(i) {
|
|
|
692
696
|
"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]"
|
|
693
697
|
].join(" "),
|
|
694
698
|
children: [
|
|
695
|
-
/* @__PURE__ */
|
|
699
|
+
/* @__PURE__ */ n(
|
|
696
700
|
"input",
|
|
697
701
|
{
|
|
698
702
|
type: "search",
|
|
699
703
|
autoFocus: !0,
|
|
700
|
-
value:
|
|
701
|
-
onChange: (
|
|
704
|
+
value: E,
|
|
705
|
+
onChange: (a) => y(a.target.value),
|
|
702
706
|
placeholder: t("pdf.search.placeholder"),
|
|
703
707
|
"aria-label": t("pdf.search.placeholder"),
|
|
704
|
-
className:
|
|
708
|
+
className: Pe({
|
|
705
709
|
className: "ds:inline-size-[16rem] ds:text-start"
|
|
706
710
|
})
|
|
707
711
|
}
|
|
708
712
|
),
|
|
709
|
-
/* @__PURE__ */
|
|
713
|
+
/* @__PURE__ */ n(
|
|
710
714
|
"span",
|
|
711
715
|
{
|
|
712
716
|
"aria-live": "polite",
|
|
@@ -714,17 +718,17 @@ function rt(i) {
|
|
|
714
718
|
children: K.total > 0 ? t("pdf.search.countOfTotal", {
|
|
715
719
|
current: K.current,
|
|
716
720
|
total: K.total
|
|
717
|
-
}) :
|
|
721
|
+
}) : E ? t("pdf.search.noResults") : ""
|
|
718
722
|
}
|
|
719
723
|
),
|
|
720
|
-
/* @__PURE__ */
|
|
724
|
+
/* @__PURE__ */ n(ee.Close, { asChild: !0, children: /* @__PURE__ */ n(
|
|
721
725
|
"button",
|
|
722
726
|
{
|
|
723
727
|
type: "button",
|
|
724
728
|
"aria-label": t("pdf.search.close"),
|
|
725
|
-
className:
|
|
726
|
-
children: /* @__PURE__ */
|
|
727
|
-
|
|
729
|
+
className: ze(),
|
|
730
|
+
children: /* @__PURE__ */ n(
|
|
731
|
+
Be,
|
|
728
732
|
{
|
|
729
733
|
"aria-hidden": "true",
|
|
730
734
|
className: "ds:block-size-4 ds:inline-size-4"
|
|
@@ -736,12 +740,12 @@ function rt(i) {
|
|
|
736
740
|
}
|
|
737
741
|
) })
|
|
738
742
|
] }),
|
|
739
|
-
|
|
743
|
+
p({
|
|
740
744
|
index: 7,
|
|
741
745
|
label: t("pdf.print"),
|
|
742
746
|
onActivate: V,
|
|
743
|
-
icon: /* @__PURE__ */
|
|
744
|
-
|
|
747
|
+
icon: /* @__PURE__ */ n(
|
|
748
|
+
Qe,
|
|
745
749
|
{
|
|
746
750
|
"aria-hidden": "true",
|
|
747
751
|
className: "ds:block-size-4 ds:inline-size-4"
|
|
@@ -752,112 +756,117 @@ function rt(i) {
|
|
|
752
756
|
}
|
|
753
757
|
);
|
|
754
758
|
}
|
|
755
|
-
function
|
|
759
|
+
function st(i) {
|
|
756
760
|
const {
|
|
757
761
|
pageNumber: t,
|
|
758
762
|
totalPages: u,
|
|
759
|
-
doc:
|
|
760
|
-
zoom:
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
763
|
+
doc: v,
|
|
764
|
+
zoom: b,
|
|
765
|
+
pageRotation: g,
|
|
766
|
+
renderPageOverlay: z,
|
|
767
|
+
container: m,
|
|
768
|
+
resizeTick: P,
|
|
769
|
+
shouldRender: S,
|
|
770
|
+
registerRef: B,
|
|
771
|
+
searchQuery: A,
|
|
772
|
+
onMatchCount: V
|
|
773
|
+
} = i, { t: C } = pe(), F = T(null), E = T(null), [y, K] = h({
|
|
768
774
|
width: 612,
|
|
769
775
|
height: 792
|
|
770
|
-
}), [
|
|
771
|
-
|
|
772
|
-
let
|
|
773
|
-
return
|
|
774
|
-
|
|
776
|
+
}), [f, H] = h(null);
|
|
777
|
+
k(() => {
|
|
778
|
+
let d = !1;
|
|
779
|
+
return v.getPage(t).then((c) => {
|
|
780
|
+
d || H(c);
|
|
775
781
|
}), () => {
|
|
776
|
-
|
|
782
|
+
d = !0;
|
|
777
783
|
};
|
|
778
|
-
}, [
|
|
779
|
-
if (!
|
|
780
|
-
const
|
|
781
|
-
|
|
782
|
-
width: Math.floor(
|
|
783
|
-
height: Math.floor(
|
|
784
|
+
}, [v, t]), k(() => {
|
|
785
|
+
if (!f) return;
|
|
786
|
+
const d = (p) => g === void 0 ? { scale: p } : { scale: p, rotation: g }, c = f.getViewport(d(1)), N = Se(b, c, m), x = f.getViewport(d(N));
|
|
787
|
+
K({
|
|
788
|
+
width: Math.floor(x.width),
|
|
789
|
+
height: Math.floor(x.height)
|
|
784
790
|
});
|
|
785
|
-
}, [
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
791
|
+
}, [f, b, m, P, g]);
|
|
792
|
+
const s = g ?? (f == null ? void 0 : f.rotate) ?? 0;
|
|
793
|
+
k(() => {
|
|
794
|
+
if (!f || !S) {
|
|
795
|
+
const I = F.current;
|
|
796
|
+
I && !S && (I.width = 0);
|
|
789
797
|
return;
|
|
790
798
|
}
|
|
791
|
-
const
|
|
792
|
-
if (!
|
|
793
|
-
const
|
|
794
|
-
if (!
|
|
795
|
-
const
|
|
796
|
-
|
|
797
|
-
const
|
|
798
|
-
canvas:
|
|
799
|
-
canvasContext:
|
|
800
|
-
viewport:
|
|
799
|
+
const d = F.current, c = E.current;
|
|
800
|
+
if (!d) return;
|
|
801
|
+
const N = d.getContext("2d");
|
|
802
|
+
if (!N) return;
|
|
803
|
+
const x = (I) => g === void 0 ? { scale: I } : { scale: I, rotation: g }, p = f.getViewport(x(1)), a = Se(b, p, m), w = f.getViewport(x(a)), O = Math.max(1, window.devicePixelRatio || 1);
|
|
804
|
+
d.width = Math.floor(w.width * O), d.height = Math.floor(w.height * O), N.setTransform(O, 0, 0, O, 0, 0);
|
|
805
|
+
const te = f.render({
|
|
806
|
+
canvas: d,
|
|
807
|
+
canvasContext: N,
|
|
808
|
+
viewport: w
|
|
801
809
|
});
|
|
802
|
-
let
|
|
803
|
-
return
|
|
804
|
-
if (
|
|
805
|
-
|
|
806
|
-
const
|
|
807
|
-
|
|
808
|
-
textContentSource:
|
|
809
|
-
container:
|
|
810
|
-
viewport:
|
|
811
|
-
}), await
|
|
810
|
+
let G = !1, j = null;
|
|
811
|
+
return te.promise.then(async () => {
|
|
812
|
+
if (G || !c) return;
|
|
813
|
+
c.textContent = "";
|
|
814
|
+
const I = await f.getTextContent();
|
|
815
|
+
G || (j = new fe.TextLayer({
|
|
816
|
+
textContentSource: I,
|
|
817
|
+
container: c,
|
|
818
|
+
viewport: w
|
|
819
|
+
}), await j.render(), Ce(c, A, V));
|
|
812
820
|
}).catch(() => {
|
|
813
821
|
}), () => {
|
|
814
|
-
|
|
822
|
+
G = !0;
|
|
815
823
|
try {
|
|
816
|
-
|
|
824
|
+
te.cancel();
|
|
817
825
|
} catch {
|
|
818
826
|
}
|
|
819
|
-
if (
|
|
827
|
+
if (j)
|
|
820
828
|
try {
|
|
821
|
-
|
|
829
|
+
j.cancel();
|
|
822
830
|
} catch {
|
|
823
831
|
}
|
|
824
832
|
};
|
|
825
833
|
}, [
|
|
826
|
-
v,
|
|
827
|
-
p,
|
|
828
834
|
f,
|
|
829
|
-
|
|
830
|
-
|
|
835
|
+
S,
|
|
836
|
+
b,
|
|
837
|
+
m,
|
|
831
838
|
P,
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
839
|
+
A,
|
|
840
|
+
V,
|
|
841
|
+
g
|
|
842
|
+
]), k(() => {
|
|
843
|
+
if (!S) return;
|
|
844
|
+
const d = E.current;
|
|
845
|
+
d && Ce(d, A, V);
|
|
846
|
+
}, [A, S, V]);
|
|
847
|
+
const W = {
|
|
848
|
+
width: y.width,
|
|
849
|
+
height: y.height
|
|
850
|
+
}, Q = {
|
|
851
|
+
width: y.width,
|
|
852
|
+
height: y.height
|
|
844
853
|
};
|
|
845
854
|
return /* @__PURE__ */ Z(
|
|
846
855
|
"article",
|
|
847
856
|
{
|
|
848
|
-
ref: (
|
|
849
|
-
|
|
857
|
+
ref: (d) => {
|
|
858
|
+
B(d);
|
|
850
859
|
},
|
|
851
860
|
"data-page-number": t,
|
|
852
|
-
"aria-label":
|
|
853
|
-
className:
|
|
854
|
-
style:
|
|
861
|
+
"aria-label": C("pdf.pageOf", { current: t, total: u }),
|
|
862
|
+
className: tt(),
|
|
863
|
+
style: Q,
|
|
855
864
|
children: [
|
|
856
|
-
/* @__PURE__ */
|
|
857
|
-
/* @__PURE__ */
|
|
865
|
+
/* @__PURE__ */ n("canvas", { ref: F, style: W }),
|
|
866
|
+
/* @__PURE__ */ n(
|
|
858
867
|
"div",
|
|
859
868
|
{
|
|
860
|
-
ref:
|
|
869
|
+
ref: E,
|
|
861
870
|
"aria-hidden": "false",
|
|
862
871
|
className: [
|
|
863
872
|
"ds:absolute ds:inset-0",
|
|
@@ -870,26 +879,42 @@ function nt(i) {
|
|
|
870
879
|
"ds:[&_[data-match=current]]:bg-[color-mix(in_srgb,var(--warning)_60%,transparent)]"
|
|
871
880
|
].join(" ")
|
|
872
881
|
}
|
|
873
|
-
)
|
|
882
|
+
),
|
|
883
|
+
S && z ? /* @__PURE__ */ n(
|
|
884
|
+
"div",
|
|
885
|
+
{
|
|
886
|
+
role: "group",
|
|
887
|
+
"aria-label": C("pdf.pageOverlay", { page: t }),
|
|
888
|
+
className: "ds:absolute ds:inset-0 ds:pointer-events-auto",
|
|
889
|
+
"data-pdf-page-overlay": "",
|
|
890
|
+
"data-page-number": t,
|
|
891
|
+
children: z({
|
|
892
|
+
pageNumber: t,
|
|
893
|
+
pageWidthCss: y.width,
|
|
894
|
+
pageHeightCss: y.height,
|
|
895
|
+
rotation: s
|
|
896
|
+
})
|
|
897
|
+
}
|
|
898
|
+
) : null
|
|
874
899
|
]
|
|
875
900
|
}
|
|
876
901
|
);
|
|
877
902
|
}
|
|
878
|
-
function
|
|
879
|
-
if (i.querySelectorAll("[data-match]").forEach((
|
|
880
|
-
|
|
903
|
+
function Ce(i, t, u) {
|
|
904
|
+
if (i.querySelectorAll("[data-match]").forEach((m) => {
|
|
905
|
+
m.removeAttribute("data-match");
|
|
881
906
|
}), !t) {
|
|
882
907
|
u(0);
|
|
883
908
|
return;
|
|
884
909
|
}
|
|
885
|
-
const
|
|
910
|
+
const b = t.toLowerCase();
|
|
886
911
|
let g = 0;
|
|
887
|
-
i.querySelectorAll("span").forEach((
|
|
888
|
-
(
|
|
912
|
+
i.querySelectorAll("span").forEach((m) => {
|
|
913
|
+
(m.textContent ?? "").toLowerCase().includes(b) && (m.setAttribute("data-match", "true"), g += 1);
|
|
889
914
|
}), u(g);
|
|
890
915
|
}
|
|
891
916
|
export {
|
|
892
|
-
|
|
893
|
-
|
|
917
|
+
nt as P,
|
|
918
|
+
Xe as p
|
|
894
919
|
};
|
|
895
|
-
//# sourceMappingURL=pdf-viewer-
|
|
920
|
+
//# sourceMappingURL=pdf-viewer-CnEJvmXC.js.map
|