@peeekpage/viewer 0.3.19 → 0.4.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/index.d.ts +6 -0
- package/dist/index.js +591 -428
- package/dist/peeekviewer.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
1
|
+
import { jsxs as _, jsx as o, Fragment as Ye } from "react/jsx-runtime";
|
|
2
|
+
import { useState as T, useRef as j, useEffect as C, useCallback as E, useMemo as qe } from "react";
|
|
3
|
+
const Je = /* @__PURE__ */ new Set(["http:", "https:"]);
|
|
4
|
+
function G(t) {
|
|
5
5
|
if (typeof t != "string") return null;
|
|
6
6
|
const e = t.trim();
|
|
7
7
|
if (e === "" || e.includes(" ")) return null;
|
|
8
8
|
const n = typeof window < "u" ? window.location.href : void 0;
|
|
9
|
-
let
|
|
9
|
+
let a;
|
|
10
10
|
try {
|
|
11
|
-
|
|
11
|
+
a = new URL(e, n);
|
|
12
12
|
} catch {
|
|
13
13
|
return null;
|
|
14
14
|
}
|
|
15
|
-
return
|
|
15
|
+
return Je.has(a.protocol) ? a.href : null;
|
|
16
16
|
}
|
|
17
|
-
const
|
|
18
|
-
function
|
|
17
|
+
const Qe = /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, et = /^rgba?\([ \t]*\d{1,3}[ \t]*,[ \t]*\d{1,3}[ \t]*,[ \t]*\d{1,3}[ \t]*(?:,[ \t]*(?:0|1|0?\.\d+)[ \t]*)?\)$/;
|
|
18
|
+
function se(t) {
|
|
19
19
|
if (typeof t != "string") return null;
|
|
20
20
|
const e = t.trim();
|
|
21
|
-
return
|
|
21
|
+
return Qe.test(e) || et.test(e) ? e : null;
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
function
|
|
23
|
+
const tt = /url\(|image\(|image-set\(|element\(|expression|@|\/\*|;|\{|\}|<|>|\\/i, nt = /^(repeating-)?(linear|radial|conic)-gradient\([a-z0-9#.,%()\/\s-]*\)$/i, at = /^hsla?\([a-z0-9.,%\/\s-]*\)$/i;
|
|
24
|
+
function ot(t) {
|
|
25
25
|
if (typeof t != "string") return null;
|
|
26
26
|
const e = t.trim();
|
|
27
|
-
if (e === "" ||
|
|
28
|
-
const n =
|
|
29
|
-
return n !== null ? n :
|
|
27
|
+
if (e === "" || tt.test(e)) return null;
|
|
28
|
+
const n = se(e);
|
|
29
|
+
return n !== null ? n : at.test(e) || nt.test(e) ? e : null;
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const rt = ["en", "pt-BR"], ye = {
|
|
32
32
|
prev: "Previous page",
|
|
33
33
|
next: "Next page",
|
|
34
34
|
zoom: "Zoom level",
|
|
@@ -45,8 +45,12 @@ const qe = ["en", "pt-BR"], pe = {
|
|
|
45
45
|
about: "About",
|
|
46
46
|
aboutTagline: "Embeddable document viewer by Peeek Page",
|
|
47
47
|
aboutDescription: "Peeek Viewer shows document pages that live in your own storage, so your files stay yours.",
|
|
48
|
-
aboutClose: "Close"
|
|
49
|
-
|
|
48
|
+
aboutClose: "Close",
|
|
49
|
+
goToPage: "Go to page",
|
|
50
|
+
rotate: "Rotate page",
|
|
51
|
+
singlePage: "Single page",
|
|
52
|
+
doublePage: "Two pages"
|
|
53
|
+
}, lt = {
|
|
50
54
|
prev: "Página anterior",
|
|
51
55
|
next: "Próxima página",
|
|
52
56
|
zoom: "Nível de zoom",
|
|
@@ -63,35 +67,39 @@ const qe = ["en", "pt-BR"], pe = {
|
|
|
63
67
|
about: "Sobre",
|
|
64
68
|
aboutTagline: "Visualizador de documentos incorporável do Peeek Page",
|
|
65
69
|
aboutDescription: "O Peeek Viewer exibe as páginas de documentos que ficam no seu próprio armazenamento, então seus arquivos continuam seus.",
|
|
66
|
-
aboutClose: "Fechar"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
aboutClose: "Fechar",
|
|
71
|
+
goToPage: "Ir para a página",
|
|
72
|
+
rotate: "Girar página",
|
|
73
|
+
singlePage: "Página única",
|
|
74
|
+
doublePage: "Duas páginas"
|
|
75
|
+
}, it = { en: ye, "pt-BR": lt };
|
|
76
|
+
function st(t) {
|
|
77
|
+
return it[t] ?? ye;
|
|
70
78
|
}
|
|
71
|
-
const
|
|
79
|
+
const ct = "#6E79D6";
|
|
72
80
|
function I(t, e) {
|
|
73
81
|
return typeof t == "boolean" ? t : e;
|
|
74
82
|
}
|
|
75
|
-
function
|
|
83
|
+
function Y(t, e, n) {
|
|
76
84
|
return e.includes(t) ? t : n;
|
|
77
85
|
}
|
|
78
|
-
function
|
|
86
|
+
function ut(t) {
|
|
79
87
|
return {
|
|
80
88
|
src: typeof t.src == "string" ? t.src : "",
|
|
81
|
-
mode:
|
|
82
|
-
logo:
|
|
83
|
-
logoLink:
|
|
84
|
-
accentColor:
|
|
85
|
-
background:
|
|
86
|
-
backgroundColor:
|
|
87
|
-
backgroundImage:
|
|
88
|
-
layout:
|
|
89
|
+
mode: Y(t.mode, ["flip", "coverflow"], "flip"),
|
|
90
|
+
logo: G(t.logo),
|
|
91
|
+
logoLink: G(t.logoLink),
|
|
92
|
+
accentColor: se(t.accentColor) ?? ct,
|
|
93
|
+
background: Y(t.background, ["color", "image", "transparent"], "color"),
|
|
94
|
+
backgroundColor: ot(t.backgroundColor),
|
|
95
|
+
backgroundImage: G(t.backgroundImage),
|
|
96
|
+
layout: Y(t.layout, ["single", "double"], "double"),
|
|
89
97
|
fillHeight: I(t.fillHeight, !1),
|
|
90
98
|
pageShadows: I(t.pageShadows, !0),
|
|
91
99
|
rtl: I(t.rtl, !1),
|
|
92
100
|
animateInteractions: I(t.animateInteractions, !0),
|
|
93
|
-
skin:
|
|
94
|
-
language:
|
|
101
|
+
skin: Y(t.skin, ["classic", "minimal", "showcase"], "classic"),
|
|
102
|
+
language: Y(t.language, rt, "en"),
|
|
95
103
|
autoTransition: I(t.autoTransition, !1),
|
|
96
104
|
autoTransitionInterval: typeof t.autoTransitionInterval == "number" && t.autoTransitionInterval > 0 ? t.autoTransitionInterval : 5e3,
|
|
97
105
|
navigationControls: I(t.navigationControls, !0),
|
|
@@ -99,52 +107,58 @@ function tt(t) {
|
|
|
99
107
|
arrows: I(t.arrows, !0),
|
|
100
108
|
navigationBar: I(t.navigationBar, !0),
|
|
101
109
|
pagesOverview: I(t.pagesOverview, !0),
|
|
102
|
-
downloadUrl:
|
|
110
|
+
downloadUrl: G(t.downloadUrl),
|
|
103
111
|
aboutButton: I(t.aboutButton, !0),
|
|
112
|
+
goToPage: I(t.goToPage, !0),
|
|
113
|
+
rotateControl: I(t.rotateControl, !0),
|
|
114
|
+
layoutToggle: I(t.layoutToggle, !0),
|
|
115
|
+
loadingImage: G(t.loadingImage),
|
|
116
|
+
loadingCaption: typeof t.loadingCaption == "string" && t.loadingCaption.length > 0 ? t.loadingCaption : null,
|
|
117
|
+
loadingColor: se(t.loadingColor),
|
|
104
118
|
pollInterval: typeof t.pollInterval == "number" && t.pollInterval > 0 ? t.pollInterval : 2e3,
|
|
105
119
|
className: typeof t.className == "string" ? t.className : ""
|
|
106
120
|
};
|
|
107
121
|
}
|
|
108
|
-
const
|
|
109
|
-
function
|
|
122
|
+
const ce = 5e3;
|
|
123
|
+
function q(t) {
|
|
110
124
|
return typeof t == "string" ? t : "";
|
|
111
125
|
}
|
|
112
|
-
function
|
|
126
|
+
function dt(t) {
|
|
113
127
|
if (t === null || typeof t != "object" || Array.isArray(t))
|
|
114
128
|
return { ok: !1, error: "manifest is not an object" };
|
|
115
129
|
const e = t;
|
|
116
130
|
if (!Array.isArray(e.pages))
|
|
117
131
|
return { ok: !1, error: "manifest.pages is missing or not an array" };
|
|
118
|
-
if (e.pages.length >
|
|
132
|
+
if (e.pages.length > ce)
|
|
119
133
|
return { ok: !1, error: "manifest.pages exceeds the maximum" };
|
|
120
|
-
const n = e.total_pages,
|
|
121
|
-
if (
|
|
134
|
+
const n = e.total_pages, a = typeof n == "number" && Number.isFinite(n) && n >= 0 ? n : e.pages.length;
|
|
135
|
+
if (a > ce)
|
|
122
136
|
return { ok: !1, error: "manifest.total_pages exceeds the maximum" };
|
|
123
137
|
const l = [];
|
|
124
|
-
for (const
|
|
125
|
-
if (
|
|
126
|
-
const
|
|
127
|
-
|
|
138
|
+
for (const g of e.pages) {
|
|
139
|
+
if (g === null || typeof g != "object") continue;
|
|
140
|
+
const s = G(g.url);
|
|
141
|
+
s && l.push(s);
|
|
128
142
|
}
|
|
129
143
|
if (l.length === 0)
|
|
130
144
|
return { ok: !1, error: "manifest has no usable pages" };
|
|
131
|
-
const c = e.status === "wip" ? "wip" : "done",
|
|
132
|
-
fileId:
|
|
133
|
-
filename:
|
|
134
|
-
creationDate:
|
|
135
|
-
fileSize:
|
|
136
|
-
mimeType:
|
|
145
|
+
const c = e.status === "wip" ? "wip" : "done", b = e.metadata && typeof e.metadata == "object" ? e.metadata : {}, p = {
|
|
146
|
+
fileId: q(b.file_id),
|
|
147
|
+
filename: q(b.filename),
|
|
148
|
+
creationDate: q(b.creation_date),
|
|
149
|
+
fileSize: q(b.file_size),
|
|
150
|
+
mimeType: q(b.mime_type)
|
|
137
151
|
};
|
|
138
152
|
return {
|
|
139
153
|
ok: !0,
|
|
140
|
-
value: { status: c, totalPages:
|
|
154
|
+
value: { status: c, totalPages: a, pages: l, metadata: p }
|
|
141
155
|
};
|
|
142
156
|
}
|
|
143
|
-
function
|
|
144
|
-
if (!Array.isArray(t) || t.length >
|
|
157
|
+
function gt(t, e) {
|
|
158
|
+
if (!Array.isArray(t) || t.length > ce) return null;
|
|
145
159
|
const n = [];
|
|
146
160
|
for (const l of t) {
|
|
147
|
-
const c =
|
|
161
|
+
const c = G(l);
|
|
148
162
|
c && n.push(c);
|
|
149
163
|
}
|
|
150
164
|
return n.length === 0 ? null : {
|
|
@@ -160,44 +174,44 @@ function rt(t, e) {
|
|
|
160
174
|
}
|
|
161
175
|
};
|
|
162
176
|
}
|
|
163
|
-
function
|
|
164
|
-
const [n,
|
|
165
|
-
return
|
|
166
|
-
let
|
|
167
|
-
if (
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
},
|
|
171
|
-
let
|
|
177
|
+
function ft(t, e) {
|
|
178
|
+
const [n, a] = T("loading"), [l, c] = T(null), [b, p] = T(null), g = j(null);
|
|
179
|
+
return C(() => {
|
|
180
|
+
let s = !1;
|
|
181
|
+
if (a("loading"), c(null), p(null), !t) return;
|
|
182
|
+
const k = () => {
|
|
183
|
+
g.current !== null && (clearTimeout(g.current), g.current = null);
|
|
184
|
+
}, h = async () => {
|
|
185
|
+
let d;
|
|
172
186
|
try {
|
|
173
|
-
const
|
|
174
|
-
if (!
|
|
175
|
-
|
|
176
|
-
} catch (
|
|
177
|
-
if (
|
|
178
|
-
|
|
187
|
+
const i = await fetch(t);
|
|
188
|
+
if (!i.ok) throw new Error(`HTTP ${i.status}`);
|
|
189
|
+
d = await i.json();
|
|
190
|
+
} catch (i) {
|
|
191
|
+
if (s) return;
|
|
192
|
+
p(i instanceof Error ? i.message : "fetch failed"), a("error");
|
|
179
193
|
return;
|
|
180
194
|
}
|
|
181
|
-
if (
|
|
182
|
-
const
|
|
183
|
-
if (!
|
|
184
|
-
|
|
195
|
+
if (s) return;
|
|
196
|
+
const u = dt(d);
|
|
197
|
+
if (!u.ok) {
|
|
198
|
+
p(u.error), a("error");
|
|
185
199
|
return;
|
|
186
200
|
}
|
|
187
|
-
c(
|
|
201
|
+
c(u.value), a("ready"), u.value.status === "wip" && (g.current = setTimeout(h, e));
|
|
188
202
|
};
|
|
189
|
-
return
|
|
190
|
-
|
|
203
|
+
return h(), () => {
|
|
204
|
+
s = !0, k();
|
|
191
205
|
};
|
|
192
|
-
}, [t, e]), { state: n, manifest: l, error:
|
|
206
|
+
}, [t, e]), { state: n, manifest: l, error: b };
|
|
193
207
|
}
|
|
194
|
-
function
|
|
195
|
-
const [e, n] =
|
|
196
|
-
|
|
208
|
+
function mt(t) {
|
|
209
|
+
const [e, n] = T(!1);
|
|
210
|
+
C(() => {
|
|
197
211
|
const l = () => n(document.fullscreenElement != null);
|
|
198
212
|
return document.addEventListener("fullscreenchange", l), () => document.removeEventListener("fullscreenchange", l);
|
|
199
213
|
}, []);
|
|
200
|
-
const
|
|
214
|
+
const a = E(async () => {
|
|
201
215
|
const l = t.current;
|
|
202
216
|
if (l)
|
|
203
217
|
try {
|
|
@@ -205,116 +219,223 @@ function ot(t) {
|
|
|
205
219
|
} catch {
|
|
206
220
|
}
|
|
207
221
|
}, [t]);
|
|
208
|
-
return { isFullscreen: e, toggle:
|
|
222
|
+
return { isFullscreen: e, toggle: a };
|
|
209
223
|
}
|
|
210
|
-
const
|
|
211
|
-
function
|
|
212
|
-
const [t, e] =
|
|
224
|
+
const _e = "(prefers-reduced-motion: reduce)";
|
|
225
|
+
function ve() {
|
|
226
|
+
const [t, e] = T(() => {
|
|
213
227
|
var n;
|
|
214
|
-
return ((n = matchMedia == null ? void 0 : matchMedia(
|
|
228
|
+
return ((n = matchMedia == null ? void 0 : matchMedia(_e)) == null ? void 0 : n.matches) ?? !1;
|
|
215
229
|
});
|
|
216
|
-
return
|
|
217
|
-
const n = typeof matchMedia == "function" ? matchMedia(
|
|
230
|
+
return C(() => {
|
|
231
|
+
const n = typeof matchMedia == "function" ? matchMedia(_e) : void 0;
|
|
218
232
|
if (!(n != null && n.addEventListener)) return;
|
|
219
|
-
const
|
|
220
|
-
return n.addEventListener("change",
|
|
233
|
+
const a = () => e(n.matches);
|
|
234
|
+
return n.addEventListener("change", a), () => n.removeEventListener("change", a);
|
|
221
235
|
}, []), t;
|
|
222
236
|
}
|
|
223
|
-
function
|
|
237
|
+
function we({ go: t, jump: e, total: n, rtl: a }) {
|
|
238
|
+
return { onKeyDown: E(
|
|
239
|
+
(c) => {
|
|
240
|
+
switch (c.key) {
|
|
241
|
+
case "ArrowRight":
|
|
242
|
+
t(a ? -1 : 1);
|
|
243
|
+
break;
|
|
244
|
+
case "ArrowLeft":
|
|
245
|
+
t(a ? 1 : -1);
|
|
246
|
+
break;
|
|
247
|
+
case "Home":
|
|
248
|
+
c.preventDefault(), n > 0 && e(0);
|
|
249
|
+
break;
|
|
250
|
+
case "End":
|
|
251
|
+
c.preventDefault(), n > 0 && e(n - 1);
|
|
252
|
+
break;
|
|
253
|
+
case " ":
|
|
254
|
+
case "Spacebar":
|
|
255
|
+
c.preventDefault(), t(c.shiftKey ? -1 : 1);
|
|
256
|
+
break;
|
|
257
|
+
case "PageDown":
|
|
258
|
+
c.preventDefault(), t(1);
|
|
259
|
+
break;
|
|
260
|
+
case "PageUp":
|
|
261
|
+
c.preventDefault(), t(-1);
|
|
262
|
+
break;
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
[t, e, n, a]
|
|
266
|
+
) };
|
|
267
|
+
}
|
|
268
|
+
function Te(t, e) {
|
|
269
|
+
if (e <= 0) return null;
|
|
270
|
+
const n = t.trim();
|
|
271
|
+
if (!/^\d+$/.test(n)) return null;
|
|
272
|
+
const a = Number(n);
|
|
273
|
+
return Number.isFinite(a) ? Math.max(1, Math.min(e, a)) - 1 : null;
|
|
274
|
+
}
|
|
275
|
+
const pt = 640;
|
|
276
|
+
function bt(t, e) {
|
|
277
|
+
const [n, a] = T("auto"), [l, c] = T(null);
|
|
278
|
+
C(() => {
|
|
279
|
+
const s = t.current;
|
|
280
|
+
if (!s || (s.clientWidth > 0 && c(s.clientWidth), typeof ResizeObserver > "u")) return;
|
|
281
|
+
const k = new ResizeObserver((h) => {
|
|
282
|
+
var u;
|
|
283
|
+
const d = (u = h[0]) == null ? void 0 : u.contentRect.width;
|
|
284
|
+
typeof d == "number" && d > 0 && c(d);
|
|
285
|
+
});
|
|
286
|
+
return k.observe(s), () => k.disconnect();
|
|
287
|
+
}, [t]);
|
|
288
|
+
const b = l != null && l < pt ? "single" : e, p = n === "auto" ? b : n, g = E(() => {
|
|
289
|
+
a(p === "single" ? "double" : "single");
|
|
290
|
+
}, [p]);
|
|
291
|
+
return { layout: p, toggle: g };
|
|
292
|
+
}
|
|
293
|
+
function ue(t, e) {
|
|
224
294
|
return t <= 0 ? 0 : e === "single" ? t : 1 + Math.ceil((t - 1) / 2);
|
|
225
295
|
}
|
|
226
|
-
function
|
|
296
|
+
function ht(t, e) {
|
|
227
297
|
return e === "single" ? t : t <= 0 ? 0 : Math.floor((t - 1) / 2) + 1;
|
|
228
298
|
}
|
|
229
|
-
function
|
|
299
|
+
function te(t, e, n) {
|
|
230
300
|
if (e <= 0) return { left: -1, right: -1 };
|
|
231
301
|
if (n === "single")
|
|
232
302
|
return { left: -1, right: t >= 0 && t < e ? t : -1 };
|
|
233
303
|
if (t <= 0)
|
|
234
304
|
return { left: -1, right: 0 };
|
|
235
|
-
const
|
|
236
|
-
return { left:
|
|
305
|
+
const a = 2 * t - 1, l = 2 * t;
|
|
306
|
+
return { left: a < e ? a : -1, right: l < e ? l : -1 };
|
|
237
307
|
}
|
|
238
|
-
function
|
|
239
|
-
const { left:
|
|
240
|
-
return
|
|
308
|
+
function Ne(t, e, n) {
|
|
309
|
+
const { left: a, right: l } = te(t, e, n), c = [];
|
|
310
|
+
return a >= 0 && c.push(a), l >= 0 && c.push(l), c;
|
|
241
311
|
}
|
|
242
|
-
function
|
|
243
|
-
const
|
|
244
|
-
return t < 0 ? 0 : t >
|
|
312
|
+
function ie(t, e, n) {
|
|
313
|
+
const a = ue(e, n) - 1;
|
|
314
|
+
return t < 0 ? 0 : t > a ? a : t;
|
|
245
315
|
}
|
|
246
|
-
function
|
|
316
|
+
function _t(t) {
|
|
247
317
|
const {
|
|
248
318
|
strings: e,
|
|
249
319
|
label: n,
|
|
250
|
-
progress:
|
|
320
|
+
progress: a,
|
|
251
321
|
zoom: l,
|
|
252
322
|
minZoom: c,
|
|
253
|
-
maxZoom:
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
323
|
+
maxZoom: b,
|
|
324
|
+
total: p,
|
|
325
|
+
currentPage: g,
|
|
326
|
+
layout: s,
|
|
327
|
+
thumbsOpen: k,
|
|
328
|
+
isFullscreen: h,
|
|
329
|
+
downloadUrl: d,
|
|
330
|
+
show: u,
|
|
331
|
+
onZoomIn: i,
|
|
332
|
+
onZoomOut: L,
|
|
333
|
+
onZoomSet: D,
|
|
334
|
+
onJump: M,
|
|
335
|
+
onRotate: O,
|
|
336
|
+
onToggleLayout: x,
|
|
337
|
+
onToggleThumbs: $,
|
|
338
|
+
onToggleFullscreen: U,
|
|
339
|
+
onAbout: X
|
|
340
|
+
} = t, [A, z] = T(String(g));
|
|
341
|
+
C(() => z(String(g)), [g]);
|
|
342
|
+
const Z = () => {
|
|
343
|
+
const N = Te(A, p);
|
|
344
|
+
if (N === null) {
|
|
345
|
+
z(String(g));
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
M(N), z(String(N + 1));
|
|
349
|
+
};
|
|
350
|
+
return /* @__PURE__ */ _("div", { className: "peeek__toolbar", children: [
|
|
351
|
+
/* @__PURE__ */ o("span", { className: "peeek__label", children: n }),
|
|
352
|
+
u.bar && /* @__PURE__ */ o("div", { className: "peeek__scrubber", "aria-hidden": !0, children: /* @__PURE__ */ o("div", { className: "peeek__scrubber-fill", style: { width: `${a}%` } }) }),
|
|
353
|
+
u.goto && /* @__PURE__ */ o(
|
|
354
|
+
"input",
|
|
355
|
+
{
|
|
356
|
+
className: "peeek__goto",
|
|
357
|
+
type: "text",
|
|
358
|
+
inputMode: "numeric",
|
|
359
|
+
"aria-label": e.goToPage,
|
|
360
|
+
value: A,
|
|
361
|
+
onChange: (N) => z(N.target.value),
|
|
362
|
+
onBlur: Z,
|
|
363
|
+
onKeyDown: (N) => {
|
|
364
|
+
N.key === "Enter" && (N.preventDefault(), Z());
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
),
|
|
368
|
+
/* @__PURE__ */ o(
|
|
269
369
|
"button",
|
|
270
370
|
{
|
|
271
371
|
type: "button",
|
|
272
372
|
className: "peeek__btn",
|
|
273
373
|
"aria-label": e.zoomOut,
|
|
274
374
|
disabled: l <= c,
|
|
275
|
-
onClick:
|
|
375
|
+
onClick: L,
|
|
276
376
|
children: "−"
|
|
277
377
|
}
|
|
278
378
|
),
|
|
279
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ o(
|
|
280
380
|
"input",
|
|
281
381
|
{
|
|
282
382
|
type: "range",
|
|
283
383
|
"aria-label": e.zoom,
|
|
284
384
|
min: c,
|
|
285
|
-
max:
|
|
385
|
+
max: b,
|
|
286
386
|
step: 0.25,
|
|
287
387
|
value: l,
|
|
288
|
-
onChange: (N) =>
|
|
388
|
+
onChange: (N) => D(Number(N.target.value))
|
|
289
389
|
}
|
|
290
390
|
),
|
|
291
|
-
/* @__PURE__ */
|
|
391
|
+
/* @__PURE__ */ o(
|
|
292
392
|
"button",
|
|
293
393
|
{
|
|
294
394
|
type: "button",
|
|
295
395
|
className: "peeek__btn",
|
|
296
396
|
"aria-label": e.zoomIn,
|
|
297
|
-
disabled: l >=
|
|
298
|
-
onClick:
|
|
397
|
+
disabled: l >= b,
|
|
398
|
+
onClick: i,
|
|
299
399
|
children: "+"
|
|
300
400
|
}
|
|
301
401
|
),
|
|
302
|
-
|
|
402
|
+
u.rotate && /* @__PURE__ */ o(
|
|
303
403
|
"button",
|
|
304
404
|
{
|
|
305
405
|
type: "button",
|
|
306
|
-
className:
|
|
406
|
+
className: "peeek__btn",
|
|
407
|
+
"aria-label": e.rotate,
|
|
408
|
+
onClick: O,
|
|
409
|
+
children: "⟳"
|
|
410
|
+
}
|
|
411
|
+
),
|
|
412
|
+
u.layoutToggle && /* @__PURE__ */ o(
|
|
413
|
+
"button",
|
|
414
|
+
{
|
|
415
|
+
type: "button",
|
|
416
|
+
className: "peeek__btn",
|
|
417
|
+
"aria-label": s === "single" ? e.doublePage : e.singlePage,
|
|
418
|
+
"aria-pressed": s === "double",
|
|
419
|
+
onClick: x,
|
|
420
|
+
children: s === "single" ? "▭" : "▥"
|
|
421
|
+
}
|
|
422
|
+
),
|
|
423
|
+
u.thumbnails && /* @__PURE__ */ o(
|
|
424
|
+
"button",
|
|
425
|
+
{
|
|
426
|
+
type: "button",
|
|
427
|
+
className: `peeek__btn${k ? " peeek__btn--active" : ""}`,
|
|
307
428
|
"aria-label": e.thumbnails,
|
|
308
|
-
"aria-pressed":
|
|
309
|
-
onClick:
|
|
429
|
+
"aria-pressed": k,
|
|
430
|
+
onClick: $,
|
|
310
431
|
children: "▦"
|
|
311
432
|
}
|
|
312
433
|
),
|
|
313
|
-
|
|
434
|
+
d && /* @__PURE__ */ o(
|
|
314
435
|
"a",
|
|
315
436
|
{
|
|
316
437
|
className: "peeek__btn",
|
|
317
|
-
href:
|
|
438
|
+
href: d,
|
|
318
439
|
"aria-label": e.download,
|
|
319
440
|
target: "_blank",
|
|
320
441
|
rel: "noopener noreferrer",
|
|
@@ -322,211 +443,211 @@ function st(t) {
|
|
|
322
443
|
children: "↓"
|
|
323
444
|
}
|
|
324
445
|
),
|
|
325
|
-
|
|
446
|
+
u.fullscreen && /* @__PURE__ */ o(
|
|
326
447
|
"button",
|
|
327
448
|
{
|
|
328
449
|
type: "button",
|
|
329
|
-
className: `peeek__btn${
|
|
450
|
+
className: `peeek__btn${h ? " peeek__btn--active" : ""}`,
|
|
330
451
|
"aria-label": e.fullscreen,
|
|
331
|
-
"aria-pressed":
|
|
332
|
-
onClick:
|
|
452
|
+
"aria-pressed": h,
|
|
453
|
+
onClick: U,
|
|
333
454
|
children: "⛶"
|
|
334
455
|
}
|
|
335
456
|
),
|
|
336
|
-
|
|
457
|
+
u.about && /* @__PURE__ */ o(
|
|
337
458
|
"button",
|
|
338
459
|
{
|
|
339
460
|
type: "button",
|
|
340
461
|
className: "peeek__btn",
|
|
341
462
|
"aria-label": e.about,
|
|
342
|
-
onClick:
|
|
463
|
+
onClick: X,
|
|
343
464
|
children: "?"
|
|
344
465
|
}
|
|
345
466
|
)
|
|
346
467
|
] });
|
|
347
468
|
}
|
|
348
|
-
function
|
|
349
|
-
const c = t.length,
|
|
350
|
-
return /* @__PURE__ */
|
|
351
|
-
const
|
|
352
|
-
return /* @__PURE__ */
|
|
353
|
-
|
|
354
|
-
let
|
|
355
|
-
return
|
|
469
|
+
function kt({ pages: t, layout: e, rtl: n, activePages: a, onJump: l }) {
|
|
470
|
+
const c = t.length, b = new Set(a), p = ue(c, e);
|
|
471
|
+
return /* @__PURE__ */ o("div", { className: "peeek__thumbs", role: "group", "aria-label": "Pages", children: Array.from({ length: p }, (g, s) => {
|
|
472
|
+
const k = Ne(s, c, e), h = k.length === 2;
|
|
473
|
+
return /* @__PURE__ */ _("div", { className: "peeek__thumb-group", children: [
|
|
474
|
+
k.map((d, u) => {
|
|
475
|
+
let i = "";
|
|
476
|
+
return h && (i = (n ? u === 1 : u === 0) ? " peeek__thumb--flat-right" : " peeek__thumb--flat-left"), /* @__PURE__ */ o(
|
|
356
477
|
"button",
|
|
357
478
|
{
|
|
358
479
|
type: "button",
|
|
359
|
-
"aria-label": `Go to page ${
|
|
360
|
-
"aria-current":
|
|
361
|
-
className: `peeek__thumb${
|
|
362
|
-
onClick: () => l(
|
|
363
|
-
children: /* @__PURE__ */
|
|
480
|
+
"aria-label": `Go to page ${d + 1}`,
|
|
481
|
+
"aria-current": b.has(d),
|
|
482
|
+
className: `peeek__thumb${b.has(d) ? " peeek__thumb--active" : ""}${i}`,
|
|
483
|
+
onClick: () => l(d),
|
|
484
|
+
children: /* @__PURE__ */ o("img", { src: t[d], alt: "", loading: "lazy", referrerPolicy: "no-referrer" })
|
|
364
485
|
},
|
|
365
|
-
|
|
486
|
+
d
|
|
366
487
|
);
|
|
367
488
|
}),
|
|
368
|
-
/* @__PURE__ */
|
|
369
|
-
] },
|
|
489
|
+
/* @__PURE__ */ o("span", { className: "peeek__thumb-badge", "aria-hidden": !0, children: k.map((d) => d + 1).join("-") })
|
|
490
|
+
] }, s);
|
|
370
491
|
}) });
|
|
371
492
|
}
|
|
372
|
-
const
|
|
373
|
-
function
|
|
493
|
+
const J = 1, ee = 2, ke = 0.25;
|
|
494
|
+
function yt(t) {
|
|
374
495
|
const {
|
|
375
496
|
pages: e,
|
|
376
497
|
strings: n,
|
|
377
|
-
layout:
|
|
498
|
+
layout: a,
|
|
378
499
|
rtl: l,
|
|
379
500
|
pageShadows: c,
|
|
380
|
-
animateInteractions:
|
|
381
|
-
autoTransition:
|
|
382
|
-
autoTransitionInterval:
|
|
383
|
-
show:
|
|
384
|
-
downloadUrl:
|
|
385
|
-
isFullscreen:
|
|
386
|
-
onToggleFullscreen:
|
|
387
|
-
onAbout:
|
|
388
|
-
} = t,
|
|
389
|
-
|
|
501
|
+
animateInteractions: b,
|
|
502
|
+
autoTransition: p,
|
|
503
|
+
autoTransitionInterval: g,
|
|
504
|
+
show: s,
|
|
505
|
+
downloadUrl: k,
|
|
506
|
+
isFullscreen: h,
|
|
507
|
+
onToggleFullscreen: d,
|
|
508
|
+
onAbout: u
|
|
509
|
+
} = t, i = e.length, D = ve() || !b, [M, O] = T(0), [x, $] = T(1), [U, X] = T(!1), [A, z] = T({ x: 0, y: 0 }), [Z, N] = T(!1), [f, y] = T(0), S = j(null), F = j(null), { layout: v, toggle: Ce } = bt(F, a), ne = ue(i, v), [w, de] = T(null), ge = j(null), [fe, Pe] = T(0.707);
|
|
510
|
+
C(() => {
|
|
390
511
|
if (!e[0]) return;
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
},
|
|
512
|
+
const r = new globalThis.Image();
|
|
513
|
+
r.onload = () => {
|
|
514
|
+
r.naturalWidth && r.naturalHeight && Pe(r.naturalWidth / r.naturalHeight);
|
|
515
|
+
}, r.src = e[0];
|
|
395
516
|
}, [e]);
|
|
396
|
-
const
|
|
397
|
-
(
|
|
398
|
-
|
|
399
|
-
const
|
|
400
|
-
return
|
|
517
|
+
const R = ie(M, i, v), Ie = R <= 0, ae = R >= ne - 1, K = E(
|
|
518
|
+
(r) => {
|
|
519
|
+
w || O((m) => {
|
|
520
|
+
const P = ie(m + r, i, v);
|
|
521
|
+
return P === m ? m : D ? P : (de({ dir: r, to: P }), m);
|
|
401
522
|
});
|
|
402
523
|
},
|
|
403
|
-
[
|
|
404
|
-
),
|
|
405
|
-
|
|
524
|
+
[i, v, D, w]
|
|
525
|
+
), xe = E(() => {
|
|
526
|
+
de((r) => (r && O(r.to), null));
|
|
406
527
|
}, []);
|
|
407
|
-
|
|
408
|
-
if (!
|
|
409
|
-
const
|
|
410
|
-
if (!
|
|
411
|
-
|
|
528
|
+
C(() => {
|
|
529
|
+
if (!w) return;
|
|
530
|
+
const r = ge.current;
|
|
531
|
+
if (!r) return;
|
|
532
|
+
r.style.transform = "rotateY(0deg)";
|
|
412
533
|
let m = 0;
|
|
413
|
-
const
|
|
534
|
+
const P = requestAnimationFrame(() => {
|
|
414
535
|
m = requestAnimationFrame(() => {
|
|
415
|
-
|
|
536
|
+
r.style.transform = `rotateY(${w.dir === 1 ? -180 : 180}deg)`;
|
|
416
537
|
});
|
|
417
538
|
});
|
|
418
539
|
return () => {
|
|
419
|
-
cancelAnimationFrame(
|
|
540
|
+
cancelAnimationFrame(P), cancelAnimationFrame(m);
|
|
420
541
|
};
|
|
421
|
-
}, [
|
|
422
|
-
const
|
|
423
|
-
(
|
|
424
|
-
|
|
542
|
+
}, [w]);
|
|
543
|
+
const oe = E(
|
|
544
|
+
(r) => {
|
|
545
|
+
O(ie(ht(r, v), i, v));
|
|
425
546
|
},
|
|
426
|
-
[
|
|
427
|
-
),
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
);
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
if (!Q || x <= 1) return { x: 0, y: 0 };
|
|
441
|
-
const ue = (x - 1) * Q.clientWidth / 2, de = (x - 1) * Q.clientHeight / 2;
|
|
442
|
-
return { x: Math.max(-ue, Math.min(ue, o)), y: Math.max(-de, Math.min(de, m)) };
|
|
547
|
+
[i, v]
|
|
548
|
+
), { onKeyDown: ze } = we({ go: K, jump: oe, total: i, rtl: l });
|
|
549
|
+
C(() => {
|
|
550
|
+
if (!p || ae) return;
|
|
551
|
+
const r = setTimeout(() => K(1), g);
|
|
552
|
+
return () => clearTimeout(r);
|
|
553
|
+
}, [p, g, ae, R, K]);
|
|
554
|
+
const Se = () => $((r) => Math.min(ee, r + ke)), $e = () => $((r) => Math.max(J, r - ke)), Ae = () => {
|
|
555
|
+
w || $((r) => r > J ? J : ee);
|
|
556
|
+
}, Fe = () => y((r) => (r + 90) % 360), Me = f === 90 || f === 270 ? fe : 1, re = E((r, m, P) => {
|
|
557
|
+
const le = F.current;
|
|
558
|
+
if (!le || P <= 1) return { x: 0, y: 0 };
|
|
559
|
+
const be = (P - 1) * le.clientWidth / 2, he = (P - 1) * le.clientHeight / 2;
|
|
560
|
+
return { x: Math.max(-be, Math.min(be, r)), y: Math.max(-he, Math.min(he, m)) };
|
|
443
561
|
}, []);
|
|
444
|
-
|
|
445
|
-
const
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
562
|
+
C(() => z((r) => re(r.x, r.y, x)), [x, re]), C(() => z({ x: 0, y: 0 }), [R]);
|
|
563
|
+
const Ee = (r) => {
|
|
564
|
+
var m, P;
|
|
565
|
+
x <= 1 || (S.current = { x: r.clientX, y: r.clientY, px: A.x, py: A.y }, N(!0), (P = (m = r.currentTarget).setPointerCapture) == null || P.call(m, r.pointerId));
|
|
566
|
+
}, Le = (r) => {
|
|
567
|
+
const m = S.current;
|
|
568
|
+
m && z(re(m.px + (r.clientX - m.x), m.py + (r.clientY - m.y), x));
|
|
569
|
+
}, me = (r) => {
|
|
570
|
+
if (S.current) {
|
|
571
|
+
S.current = null, N(!1);
|
|
453
572
|
try {
|
|
454
|
-
|
|
573
|
+
r.currentTarget.releasePointerCapture(r.pointerId);
|
|
455
574
|
} catch {
|
|
456
575
|
}
|
|
457
576
|
}
|
|
458
|
-
},
|
|
459
|
-
["left",
|
|
460
|
-
["right",
|
|
577
|
+
}, W = Ne(R, i, v), Q = W[0] ?? 0, De = v === "double" && W.length === 2 ? `${W[0] + 1} - ${W[1] + 1} / ${i}` : `${Q + 1} / ${i}`, Oe = ne <= 1 ? 100 : R / (ne - 1) * 100, Re = n.prev, Be = n.next, Ue = w ? w.to : R, H = te(Ue, i, v), Ze = H.left < 0 && H.right >= 0, He = H.left >= 0 && H.right < 0, Ge = H.left >= 0 && H.right >= 0, je = Ze ? "-25%" : He ? "25%" : "0%", B = te(R, i, v), V = w ? te(w.to, i, v) : B, Ve = w ? w.dir === 1 ? B.right >= 0 ? B.right : B.left : B.left >= 0 ? B.left : B.right : Q, Xe = w ? w.dir === 1 ? V.left >= 0 ? V.left : V.right : V.right >= 0 ? V.right : V.left : Q, Ke = w ? w.dir === 1 ? "left" : "right" : null, pe = (r) => r === Ke ? B[r] : H[r], We = [
|
|
578
|
+
["left", pe("left")],
|
|
579
|
+
["right", pe("right")]
|
|
461
580
|
];
|
|
462
|
-
return /* @__PURE__ */
|
|
463
|
-
/* @__PURE__ */
|
|
581
|
+
return /* @__PURE__ */ _(Ye, { children: [
|
|
582
|
+
/* @__PURE__ */ _(
|
|
464
583
|
"div",
|
|
465
584
|
{
|
|
466
|
-
ref:
|
|
585
|
+
ref: F,
|
|
467
586
|
className: "peeek__stage",
|
|
587
|
+
"data-layout": v,
|
|
468
588
|
tabIndex: 0,
|
|
469
|
-
onKeyDown:
|
|
470
|
-
style: { "--peeek-aspect": `${
|
|
589
|
+
onKeyDown: ze,
|
|
590
|
+
style: { "--peeek-aspect": `${fe}` },
|
|
471
591
|
children: [
|
|
472
|
-
|
|
592
|
+
s.arrows && /* @__PURE__ */ o(
|
|
473
593
|
"button",
|
|
474
594
|
{
|
|
475
595
|
type: "button",
|
|
476
596
|
className: "peeek__arrow peeek__arrow--prev",
|
|
477
|
-
"aria-label":
|
|
478
|
-
disabled:
|
|
479
|
-
onClick: () =>
|
|
597
|
+
"aria-label": Re,
|
|
598
|
+
disabled: Ie,
|
|
599
|
+
onClick: () => K(-1),
|
|
480
600
|
children: "‹"
|
|
481
601
|
}
|
|
482
602
|
),
|
|
483
|
-
/* @__PURE__ */
|
|
603
|
+
/* @__PURE__ */ o(
|
|
484
604
|
"div",
|
|
485
605
|
{
|
|
486
|
-
className: `peeek__zoom${
|
|
606
|
+
className: `peeek__zoom${x > 1 ? " peeek__zoom--pannable" : ""}`,
|
|
487
607
|
style: {
|
|
488
|
-
transform: `translate(${
|
|
489
|
-
transition:
|
|
608
|
+
transform: `translate(${A.x}px, ${A.y}px) scale(${x * Me}) rotate(${f}deg)`,
|
|
609
|
+
transition: D || Z ? "none" : void 0
|
|
490
610
|
},
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
611
|
+
onDoubleClick: Ae,
|
|
612
|
+
onPointerDown: Ee,
|
|
613
|
+
onPointerMove: Le,
|
|
614
|
+
onPointerUp: me,
|
|
615
|
+
onPointerCancel: me,
|
|
616
|
+
children: /* @__PURE__ */ _(
|
|
496
617
|
"div",
|
|
497
618
|
{
|
|
498
|
-
className: `peeek__spread${c ? " peeek--shadows" : ""}${
|
|
499
|
-
style: { transform: `translateX(${
|
|
619
|
+
className: `peeek__spread${c ? " peeek--shadows" : ""}${Ge ? " peeek__spread--pair" : ""}`,
|
|
620
|
+
style: { transform: `translateX(${je})` },
|
|
500
621
|
children: [
|
|
501
|
-
|
|
502
|
-
const
|
|
503
|
-
return /* @__PURE__ */
|
|
622
|
+
We.map(([r, m]) => {
|
|
623
|
+
const P = m >= 0 && s.fullscreen && !h && !w && x === 1;
|
|
624
|
+
return /* @__PURE__ */ o(
|
|
504
625
|
"div",
|
|
505
626
|
{
|
|
506
|
-
className: `peeek__page peeek__page--${
|
|
507
|
-
children: m >= 0 && (
|
|
627
|
+
className: `peeek__page peeek__page--${r}${m < 0 ? " peeek__page--empty" : ""}`,
|
|
628
|
+
children: m >= 0 && (P ? /* @__PURE__ */ o(
|
|
508
629
|
"button",
|
|
509
630
|
{
|
|
510
631
|
type: "button",
|
|
511
632
|
className: "peeek__page-btn",
|
|
512
633
|
"aria-label": n.openFullscreen,
|
|
513
|
-
onClick:
|
|
514
|
-
children: /* @__PURE__ */
|
|
634
|
+
onClick: d,
|
|
635
|
+
children: /* @__PURE__ */ o("img", { src: e[m], alt: `Page ${m + 1}`, loading: "lazy", referrerPolicy: "no-referrer" })
|
|
515
636
|
}
|
|
516
|
-
) : /* @__PURE__ */
|
|
637
|
+
) : /* @__PURE__ */ o("img", { src: e[m], alt: `Page ${m + 1}`, loading: "lazy", referrerPolicy: "no-referrer" }))
|
|
517
638
|
},
|
|
518
|
-
|
|
639
|
+
r
|
|
519
640
|
);
|
|
520
641
|
}),
|
|
521
|
-
|
|
642
|
+
w && /* @__PURE__ */ _(
|
|
522
643
|
"div",
|
|
523
644
|
{
|
|
524
|
-
ref:
|
|
525
|
-
className: `peeek__leaf peeek__leaf--${
|
|
526
|
-
onTransitionEnd:
|
|
645
|
+
ref: ge,
|
|
646
|
+
className: `peeek__leaf peeek__leaf--${w.dir === 1 ? "fwd" : "back"}`,
|
|
647
|
+
onTransitionEnd: xe,
|
|
527
648
|
children: [
|
|
528
|
-
/* @__PURE__ */
|
|
529
|
-
/* @__PURE__ */
|
|
649
|
+
/* @__PURE__ */ o("div", { className: "peeek__leaf-face peeek__leaf-face--front", children: /* @__PURE__ */ o("img", { src: e[Ve], alt: "", referrerPolicy: "no-referrer" }) }),
|
|
650
|
+
/* @__PURE__ */ o("div", { className: "peeek__leaf-face peeek__leaf-face--back", children: /* @__PURE__ */ o("img", { src: e[Xe], alt: "", referrerPolicy: "no-referrer" }) })
|
|
530
651
|
]
|
|
531
652
|
}
|
|
532
653
|
)
|
|
@@ -535,114 +656,150 @@ function ct(t) {
|
|
|
535
656
|
)
|
|
536
657
|
}
|
|
537
658
|
),
|
|
538
|
-
|
|
659
|
+
s.arrows && /* @__PURE__ */ o(
|
|
539
660
|
"button",
|
|
540
661
|
{
|
|
541
662
|
type: "button",
|
|
542
663
|
className: "peeek__arrow peeek__arrow--next",
|
|
543
|
-
"aria-label":
|
|
544
|
-
disabled:
|
|
545
|
-
onClick: () =>
|
|
664
|
+
"aria-label": Be,
|
|
665
|
+
disabled: ae,
|
|
666
|
+
onClick: () => K(1),
|
|
546
667
|
children: "›"
|
|
547
668
|
}
|
|
548
669
|
)
|
|
549
670
|
]
|
|
550
671
|
}
|
|
551
672
|
),
|
|
552
|
-
|
|
553
|
-
|
|
673
|
+
s.toolbar && /* @__PURE__ */ o(
|
|
674
|
+
_t,
|
|
554
675
|
{
|
|
555
676
|
strings: n,
|
|
556
|
-
label:
|
|
557
|
-
progress:
|
|
558
|
-
zoom:
|
|
559
|
-
minZoom:
|
|
560
|
-
maxZoom:
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
677
|
+
label: De,
|
|
678
|
+
progress: Oe,
|
|
679
|
+
zoom: x,
|
|
680
|
+
minZoom: J,
|
|
681
|
+
maxZoom: ee,
|
|
682
|
+
total: i,
|
|
683
|
+
currentPage: Q + 1,
|
|
684
|
+
layout: v,
|
|
685
|
+
thumbsOpen: U,
|
|
686
|
+
isFullscreen: h,
|
|
687
|
+
downloadUrl: k,
|
|
688
|
+
show: {
|
|
689
|
+
bar: s.bar,
|
|
690
|
+
fullscreen: s.fullscreen,
|
|
691
|
+
thumbnails: s.thumbnails && s.overview,
|
|
692
|
+
about: s.about,
|
|
693
|
+
goto: s.goto,
|
|
694
|
+
rotate: s.rotate,
|
|
695
|
+
layoutToggle: s.layoutToggle
|
|
696
|
+
},
|
|
697
|
+
onZoomIn: Se,
|
|
698
|
+
onZoomOut: $e,
|
|
699
|
+
onZoomSet: (r) => $(Math.min(ee, Math.max(J, r))),
|
|
700
|
+
onJump: oe,
|
|
701
|
+
onRotate: Fe,
|
|
702
|
+
onToggleLayout: Ce,
|
|
703
|
+
onToggleThumbs: () => X((r) => !r),
|
|
704
|
+
onToggleFullscreen: d,
|
|
705
|
+
onAbout: u
|
|
571
706
|
}
|
|
572
707
|
),
|
|
573
|
-
|
|
708
|
+
s.overview && U && /* @__PURE__ */ o(kt, { pages: e, layout: v, rtl: l, activePages: W, onJump: oe })
|
|
574
709
|
] });
|
|
575
710
|
}
|
|
576
|
-
function
|
|
711
|
+
function vt(t, e) {
|
|
577
712
|
const n = e.toLowerCase();
|
|
578
713
|
if (n.includes("pdf")) return "PDF";
|
|
579
714
|
if (n.includes("wordprocessingml")) return "DOCX";
|
|
580
715
|
if (n.includes("msword")) return "DOC";
|
|
581
|
-
const
|
|
582
|
-
return
|
|
716
|
+
const a = t.toLowerCase().split(".").pop() ?? "";
|
|
717
|
+
return a ? a.toUpperCase().slice(0, 4) : "FILE";
|
|
583
718
|
}
|
|
584
|
-
function
|
|
719
|
+
function wt(t, e) {
|
|
585
720
|
if (t === 0) return { transform: "translateX(0) scale(1)", zIndex: 30, opacity: 1 };
|
|
586
|
-
const n = t < 0 ? -1 : 1,
|
|
721
|
+
const n = t < 0 ? -1 : 1, a = e ? -1 : 1;
|
|
587
722
|
return {
|
|
588
|
-
transform: `translateX(${
|
|
723
|
+
transform: `translateX(${a * n * 62}%) scale(0.82) rotateY(${-a * n * 28}deg)`,
|
|
589
724
|
zIndex: 20 - Math.abs(t),
|
|
590
725
|
opacity: 0.55
|
|
591
726
|
};
|
|
592
727
|
}
|
|
593
|
-
function
|
|
728
|
+
function Tt(t) {
|
|
594
729
|
const {
|
|
595
730
|
pages: e,
|
|
596
731
|
strings: n,
|
|
597
|
-
filename:
|
|
732
|
+
filename: a,
|
|
598
733
|
mimeType: l,
|
|
599
734
|
rtl: c,
|
|
600
|
-
autoTransition:
|
|
601
|
-
autoTransitionInterval:
|
|
602
|
-
downloadUrl:
|
|
603
|
-
isFullscreen:
|
|
604
|
-
onToggleFullscreen:
|
|
605
|
-
onAbout:
|
|
606
|
-
show:
|
|
607
|
-
} = t,
|
|
608
|
-
(
|
|
609
|
-
[
|
|
610
|
-
),
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
(
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
735
|
+
autoTransition: b,
|
|
736
|
+
autoTransitionInterval: p,
|
|
737
|
+
downloadUrl: g,
|
|
738
|
+
isFullscreen: s,
|
|
739
|
+
onToggleFullscreen: k,
|
|
740
|
+
onAbout: h,
|
|
741
|
+
show: d
|
|
742
|
+
} = t, u = e.length, [i, L] = T(0), D = ve(), M = E(
|
|
743
|
+
(f) => L((y) => Math.max(0, Math.min(u - 1, y + f))),
|
|
744
|
+
[u]
|
|
745
|
+
), O = E(
|
|
746
|
+
(f) => L(Math.max(0, Math.min(u - 1, f))),
|
|
747
|
+
[u]
|
|
748
|
+
), x = i <= 0, $ = i >= u - 1, U = j([]);
|
|
749
|
+
C(() => {
|
|
750
|
+
var f, y;
|
|
751
|
+
(y = (f = U.current[i]) == null ? void 0 : f.scrollIntoView) == null || y.call(f, { behavior: "smooth", inline: "center", block: "nearest" });
|
|
752
|
+
}, [i]), C(() => {
|
|
753
|
+
if (!b || D || $) return;
|
|
754
|
+
const f = setTimeout(() => M(1), p);
|
|
755
|
+
return () => clearTimeout(f);
|
|
756
|
+
}, [b, p, D, $, i, M]);
|
|
757
|
+
const { onKeyDown: X } = we({ go: M, jump: O, total: u, rtl: c }), [A, z] = T(String(i + 1));
|
|
758
|
+
C(() => z(String(i + 1)), [i]);
|
|
759
|
+
const Z = () => {
|
|
760
|
+
const f = Te(A, u);
|
|
761
|
+
if (f === null) {
|
|
762
|
+
z(String(i + 1));
|
|
763
|
+
return;
|
|
764
|
+
}
|
|
765
|
+
O(f);
|
|
766
|
+
}, N = vt(a, l);
|
|
767
|
+
return /* @__PURE__ */ _("div", { className: "peeek__cf", children: [
|
|
768
|
+
/* @__PURE__ */ _("div", { className: "peeek__cf-header", children: [
|
|
769
|
+
/* @__PURE__ */ o("span", { className: "peeek__cf-badge", children: N }),
|
|
770
|
+
/* @__PURE__ */ _("div", { className: "peeek__cf-meta", children: [
|
|
771
|
+
/* @__PURE__ */ o("span", { className: "peeek__cf-name", children: a }),
|
|
772
|
+
/* @__PURE__ */ _("span", { className: "peeek__cf-count", children: [
|
|
773
|
+
u,
|
|
632
774
|
" ",
|
|
633
|
-
|
|
775
|
+
u === 1 ? n.page : n.pages
|
|
634
776
|
] })
|
|
635
777
|
] }),
|
|
636
|
-
/* @__PURE__ */
|
|
637
|
-
|
|
778
|
+
/* @__PURE__ */ _("span", { className: "peeek__cf-indicator", children: [
|
|
779
|
+
i + 1,
|
|
638
780
|
" / ",
|
|
639
|
-
|
|
781
|
+
u
|
|
640
782
|
] }),
|
|
641
|
-
d && /* @__PURE__ */
|
|
783
|
+
d.goto && /* @__PURE__ */ o(
|
|
784
|
+
"input",
|
|
785
|
+
{
|
|
786
|
+
className: "peeek__goto",
|
|
787
|
+
type: "text",
|
|
788
|
+
inputMode: "numeric",
|
|
789
|
+
"aria-label": n.goToPage,
|
|
790
|
+
value: A,
|
|
791
|
+
onChange: (f) => z(f.target.value),
|
|
792
|
+
onBlur: Z,
|
|
793
|
+
onKeyDown: (f) => {
|
|
794
|
+
f.key === "Enter" && (f.preventDefault(), Z());
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
),
|
|
798
|
+
g && /* @__PURE__ */ o(
|
|
642
799
|
"a",
|
|
643
800
|
{
|
|
644
801
|
className: "peeek__btn",
|
|
645
|
-
href:
|
|
802
|
+
href: g,
|
|
646
803
|
"aria-label": n.download,
|
|
647
804
|
target: "_blank",
|
|
648
805
|
rel: "noopener noreferrer",
|
|
@@ -650,107 +807,107 @@ function ft(t) {
|
|
|
650
807
|
children: "↓"
|
|
651
808
|
}
|
|
652
809
|
),
|
|
653
|
-
|
|
810
|
+
d.fullscreen && /* @__PURE__ */ o(
|
|
654
811
|
"button",
|
|
655
812
|
{
|
|
656
813
|
type: "button",
|
|
657
|
-
className: `peeek__btn${
|
|
814
|
+
className: `peeek__btn${s ? " peeek__btn--active" : ""}`,
|
|
658
815
|
"aria-label": n.fullscreen,
|
|
659
|
-
"aria-pressed":
|
|
660
|
-
onClick:
|
|
816
|
+
"aria-pressed": s,
|
|
817
|
+
onClick: k,
|
|
661
818
|
children: "⛶"
|
|
662
819
|
}
|
|
663
820
|
),
|
|
664
|
-
|
|
821
|
+
d.about && /* @__PURE__ */ o(
|
|
665
822
|
"button",
|
|
666
823
|
{
|
|
667
824
|
type: "button",
|
|
668
825
|
className: "peeek__btn",
|
|
669
826
|
"aria-label": n.about,
|
|
670
|
-
onClick:
|
|
827
|
+
onClick: h,
|
|
671
828
|
children: "?"
|
|
672
829
|
}
|
|
673
830
|
)
|
|
674
831
|
] }),
|
|
675
|
-
/* @__PURE__ */
|
|
832
|
+
/* @__PURE__ */ _(
|
|
676
833
|
"div",
|
|
677
834
|
{
|
|
678
835
|
className: "peeek__cf-stage",
|
|
679
836
|
tabIndex: 0,
|
|
680
|
-
onKeyDown:
|
|
837
|
+
onKeyDown: X,
|
|
681
838
|
children: [
|
|
682
|
-
|
|
839
|
+
d.arrows && /* @__PURE__ */ o(
|
|
683
840
|
"button",
|
|
684
841
|
{
|
|
685
842
|
type: "button",
|
|
686
843
|
className: "peeek__arrow peeek__arrow--prev",
|
|
687
844
|
"aria-label": n.prev,
|
|
688
|
-
disabled:
|
|
689
|
-
onClick: () =>
|
|
845
|
+
disabled: x,
|
|
846
|
+
onClick: () => M(-1),
|
|
690
847
|
children: "‹"
|
|
691
848
|
}
|
|
692
849
|
),
|
|
693
|
-
e.map((
|
|
694
|
-
const
|
|
695
|
-
if (Math.abs(
|
|
696
|
-
const
|
|
697
|
-
return /* @__PURE__ */
|
|
850
|
+
e.map((f, y) => {
|
|
851
|
+
const S = y - i;
|
|
852
|
+
if (Math.abs(S) > 1) return null;
|
|
853
|
+
const F = S === 0, v = F && d.fullscreen;
|
|
854
|
+
return /* @__PURE__ */ o(
|
|
698
855
|
"button",
|
|
699
856
|
{
|
|
700
857
|
type: "button",
|
|
701
|
-
className: `peeek__cf-card${
|
|
702
|
-
style:
|
|
703
|
-
tabIndex:
|
|
704
|
-
"aria-label":
|
|
705
|
-
onClick: () =>
|
|
706
|
-
children: /* @__PURE__ */
|
|
858
|
+
className: `peeek__cf-card${F ? " peeek__cf-card--center" : ""}${v ? " peeek__cf-card--zoom" : ""}`,
|
|
859
|
+
style: wt(S, c),
|
|
860
|
+
tabIndex: F ? 0 : -1,
|
|
861
|
+
"aria-label": v ? n.openFullscreen : `Go to page ${y + 1}`,
|
|
862
|
+
onClick: () => v ? k() : L(y),
|
|
863
|
+
children: /* @__PURE__ */ o("img", { src: f, alt: F ? `Page ${y + 1}` : "", loading: "lazy", referrerPolicy: "no-referrer" })
|
|
707
864
|
},
|
|
708
|
-
|
|
865
|
+
y
|
|
709
866
|
);
|
|
710
867
|
}),
|
|
711
|
-
|
|
868
|
+
d.arrows && /* @__PURE__ */ o(
|
|
712
869
|
"button",
|
|
713
870
|
{
|
|
714
871
|
type: "button",
|
|
715
872
|
className: "peeek__arrow peeek__arrow--next",
|
|
716
873
|
"aria-label": n.next,
|
|
717
|
-
disabled:
|
|
718
|
-
onClick: () =>
|
|
874
|
+
disabled: $,
|
|
875
|
+
onClick: () => M(1),
|
|
719
876
|
children: "›"
|
|
720
877
|
}
|
|
721
878
|
)
|
|
722
879
|
]
|
|
723
880
|
}
|
|
724
881
|
),
|
|
725
|
-
|
|
726
|
-
const
|
|
727
|
-
return /* @__PURE__ */
|
|
882
|
+
d.thumbnails && /* @__PURE__ */ o("div", { className: "peeek__cf-thumbs", role: "group", "aria-label": "Pages", children: e.map((f, y) => {
|
|
883
|
+
const S = y === i;
|
|
884
|
+
return /* @__PURE__ */ _(
|
|
728
885
|
"button",
|
|
729
886
|
{
|
|
730
|
-
ref: (
|
|
731
|
-
|
|
887
|
+
ref: (F) => {
|
|
888
|
+
U.current[y] = F;
|
|
732
889
|
},
|
|
733
890
|
type: "button",
|
|
734
|
-
className: `peeek__cf-thumb${
|
|
735
|
-
"aria-label": `Go to page ${
|
|
736
|
-
"aria-current":
|
|
737
|
-
onClick: () =>
|
|
891
|
+
className: `peeek__cf-thumb${S ? " peeek__cf-thumb--active" : ""}`,
|
|
892
|
+
"aria-label": `Go to page ${y + 1}`,
|
|
893
|
+
"aria-current": S ? "page" : void 0,
|
|
894
|
+
onClick: () => L(y),
|
|
738
895
|
children: [
|
|
739
|
-
/* @__PURE__ */
|
|
740
|
-
/* @__PURE__ */
|
|
896
|
+
/* @__PURE__ */ o("img", { src: f, alt: "", loading: "lazy", referrerPolicy: "no-referrer" }),
|
|
897
|
+
/* @__PURE__ */ o("span", { className: "peeek__cf-thumb-num", children: String(y + 1).padStart(2, "0") })
|
|
741
898
|
]
|
|
742
899
|
},
|
|
743
|
-
|
|
900
|
+
y
|
|
744
901
|
);
|
|
745
902
|
}) })
|
|
746
903
|
] });
|
|
747
904
|
}
|
|
748
|
-
function
|
|
905
|
+
function Nt({ logo: t, logoLink: e }) {
|
|
749
906
|
if (!t) return null;
|
|
750
|
-
const n = /* @__PURE__ */
|
|
751
|
-
return /* @__PURE__ */
|
|
907
|
+
const n = /* @__PURE__ */ o("img", { src: t, alt: "Logo", loading: "lazy", referrerPolicy: "no-referrer" });
|
|
908
|
+
return /* @__PURE__ */ o("div", { className: "peeek__branding", children: e ? /* @__PURE__ */ o("a", { href: e, target: "_blank", rel: "noopener noreferrer", children: n }) : n });
|
|
752
909
|
}
|
|
753
|
-
const
|
|
910
|
+
const Ct = [
|
|
754
911
|
{ top: "12%", left: "10%", size: 3, v: "A", dur: 13, delay: 0 },
|
|
755
912
|
{ top: "22%", left: "82%", size: 2, v: "B", dur: 16, delay: 2 },
|
|
756
913
|
{ top: "40%", left: "16%", size: 2, v: "C", dur: 12, delay: 1 },
|
|
@@ -764,40 +921,40 @@ const gt = [
|
|
|
764
921
|
{ top: "16%", left: "50%", size: 2, v: "B", dur: 14, delay: 3 },
|
|
765
922
|
{ top: "62%", left: "34%", size: 2, v: "C", dur: 12, delay: 2 }
|
|
766
923
|
];
|
|
767
|
-
function
|
|
768
|
-
const n =
|
|
769
|
-
return
|
|
770
|
-
var
|
|
771
|
-
(
|
|
772
|
-
}, []),
|
|
773
|
-
const
|
|
924
|
+
function Pt({ strings: t, onClose: e }) {
|
|
925
|
+
const n = j(null);
|
|
926
|
+
return C(() => {
|
|
927
|
+
var a;
|
|
928
|
+
(a = n.current) == null || a.focus();
|
|
929
|
+
}, []), C(() => {
|
|
930
|
+
const a = (l) => {
|
|
774
931
|
l.key === "Escape" && e();
|
|
775
932
|
};
|
|
776
|
-
return document.addEventListener("keydown",
|
|
777
|
-
}, [e]), /* @__PURE__ */
|
|
933
|
+
return document.addEventListener("keydown", a), () => document.removeEventListener("keydown", a);
|
|
934
|
+
}, [e]), /* @__PURE__ */ o("div", { className: "peeek__about-backdrop", onClick: e, children: /* @__PURE__ */ _(
|
|
778
935
|
"div",
|
|
779
936
|
{
|
|
780
937
|
role: "dialog",
|
|
781
938
|
"aria-modal": "true",
|
|
782
939
|
"aria-label": "Peeek Viewer",
|
|
783
940
|
className: "peeek__about",
|
|
784
|
-
onClick: (
|
|
941
|
+
onClick: (a) => a.stopPropagation(),
|
|
785
942
|
children: [
|
|
786
|
-
/* @__PURE__ */
|
|
943
|
+
/* @__PURE__ */ o("span", { className: "peeek__about-particles", "aria-hidden": "true", children: Ct.map((a, l) => /* @__PURE__ */ o(
|
|
787
944
|
"span",
|
|
788
945
|
{
|
|
789
946
|
className: "peeek__about-particle",
|
|
790
947
|
style: {
|
|
791
|
-
top:
|
|
792
|
-
left:
|
|
793
|
-
width:
|
|
794
|
-
height:
|
|
795
|
-
animation: `peeekAboutDrift${
|
|
948
|
+
top: a.top,
|
|
949
|
+
left: a.left,
|
|
950
|
+
width: a.size,
|
|
951
|
+
height: a.size,
|
|
952
|
+
animation: `peeekAboutDrift${a.v} ${a.dur}s ease-in-out ${a.delay}s infinite`
|
|
796
953
|
}
|
|
797
954
|
},
|
|
798
955
|
l
|
|
799
956
|
)) }),
|
|
800
|
-
/* @__PURE__ */
|
|
957
|
+
/* @__PURE__ */ o(
|
|
801
958
|
"button",
|
|
802
959
|
{
|
|
803
960
|
ref: n,
|
|
@@ -808,10 +965,10 @@ function pt({ strings: t, onClose: e }) {
|
|
|
808
965
|
children: "×"
|
|
809
966
|
}
|
|
810
967
|
),
|
|
811
|
-
/* @__PURE__ */
|
|
812
|
-
/* @__PURE__ */
|
|
813
|
-
/* @__PURE__ */
|
|
814
|
-
/* @__PURE__ */
|
|
968
|
+
/* @__PURE__ */ _("div", { className: "peeek__about-content", children: [
|
|
969
|
+
/* @__PURE__ */ _("div", { className: "peeek__about-orbwrap", children: [
|
|
970
|
+
/* @__PURE__ */ o("span", { className: "peeek__about-ring", "aria-hidden": "true" }),
|
|
971
|
+
/* @__PURE__ */ _(
|
|
815
972
|
"svg",
|
|
816
973
|
{
|
|
817
974
|
className: "peeek__about-mark",
|
|
@@ -820,13 +977,13 @@ function pt({ strings: t, onClose: e }) {
|
|
|
820
977
|
viewBox: "0 0 256 256",
|
|
821
978
|
"aria-hidden": "true",
|
|
822
979
|
children: [
|
|
823
|
-
/* @__PURE__ */
|
|
824
|
-
/* @__PURE__ */
|
|
825
|
-
/* @__PURE__ */
|
|
826
|
-
/* @__PURE__ */
|
|
980
|
+
/* @__PURE__ */ o("defs", { children: /* @__PURE__ */ _("radialGradient", { id: "peeek-about-orb", cx: "38%", cy: "30%", r: "80%", children: [
|
|
981
|
+
/* @__PURE__ */ o("stop", { offset: "0%", stopColor: "#9aa2e6" }),
|
|
982
|
+
/* @__PURE__ */ o("stop", { offset: "55%", stopColor: "#6E79D6" }),
|
|
983
|
+
/* @__PURE__ */ o("stop", { offset: "100%", stopColor: "#535cc0" })
|
|
827
984
|
] }) }),
|
|
828
|
-
/* @__PURE__ */
|
|
829
|
-
/* @__PURE__ */
|
|
985
|
+
/* @__PURE__ */ o("circle", { cx: "128", cy: "128", r: "128", fill: "url(#peeek-about-orb)" }),
|
|
986
|
+
/* @__PURE__ */ o(
|
|
830
987
|
"path",
|
|
831
988
|
{
|
|
832
989
|
d: "M90 196 V70 H140 A38 38 0 0 1 140 146 H90",
|
|
@@ -841,69 +998,75 @@ function pt({ strings: t, onClose: e }) {
|
|
|
841
998
|
}
|
|
842
999
|
)
|
|
843
1000
|
] }),
|
|
844
|
-
/* @__PURE__ */
|
|
845
|
-
/* @__PURE__ */
|
|
846
|
-
/* @__PURE__ */
|
|
1001
|
+
/* @__PURE__ */ o("div", { className: "peeek__about-name", children: "Peeek Viewer" }),
|
|
1002
|
+
/* @__PURE__ */ o("div", { className: "peeek__about-tagline", children: t.aboutTagline }),
|
|
1003
|
+
/* @__PURE__ */ _("div", { className: "peeek__about-version", children: [
|
|
847
1004
|
"v",
|
|
848
|
-
"0.
|
|
1005
|
+
"0.4.1"
|
|
849
1006
|
] }),
|
|
850
|
-
/* @__PURE__ */
|
|
1007
|
+
/* @__PURE__ */ o("p", { className: "peeek__about-desc", children: t.aboutDescription })
|
|
851
1008
|
] })
|
|
852
1009
|
]
|
|
853
1010
|
}
|
|
854
1011
|
) });
|
|
855
1012
|
}
|
|
856
|
-
function
|
|
857
|
-
const e =
|
|
858
|
-
() =>
|
|
859
|
-
[
|
|
860
|
-
),
|
|
1013
|
+
function St(t) {
|
|
1014
|
+
const e = ut(t), n = st(e.language), a = j(null), { isFullscreen: l, toggle: c } = mt(a), [b, p] = T(!1), g = t.pages !== void 0, s = qe(
|
|
1015
|
+
() => g ? gt(t.pages, { filename: t.filename, mimeType: t.mimeType }) : null,
|
|
1016
|
+
[g, t.pages, t.filename, t.mimeType]
|
|
1017
|
+
), k = ft(g ? null : e.src, e.pollInterval), h = g ? s : k.manifest, d = g ? s ? "ready" : "loading" : k.state, u = {
|
|
861
1018
|
"--peeek-accent": e.accentColor
|
|
862
1019
|
};
|
|
863
|
-
e.background === "transparent" ?
|
|
864
|
-
const
|
|
1020
|
+
e.background === "transparent" ? u["--peeek-bg"] = "transparent" : e.background === "color" && e.backgroundColor ? u["--peeek-bg"] = e.backgroundColor : e.background === "image" && e.backgroundImage && (u["--peeek-bg"] = `center / cover no-repeat url("${e.backgroundImage}")`);
|
|
1021
|
+
const i = {
|
|
865
1022
|
toolbar: e.navigationControls,
|
|
866
1023
|
bar: e.navigationBar,
|
|
867
1024
|
fullscreen: e.fullscreen,
|
|
868
1025
|
thumbnails: e.pagesOverview,
|
|
869
1026
|
arrows: e.arrows,
|
|
870
1027
|
overview: e.pagesOverview,
|
|
871
|
-
about: e.aboutButton
|
|
1028
|
+
about: e.aboutButton,
|
|
1029
|
+
goto: e.goToPage,
|
|
1030
|
+
rotate: e.rotateControl,
|
|
1031
|
+
layoutToggle: e.layoutToggle
|
|
872
1032
|
};
|
|
873
|
-
return /* @__PURE__ */
|
|
1033
|
+
return /* @__PURE__ */ _(
|
|
874
1034
|
"div",
|
|
875
1035
|
{
|
|
876
|
-
ref:
|
|
1036
|
+
ref: a,
|
|
877
1037
|
className: `peeek${e.fillHeight ? " peeek--fill-height" : ""}${e.className ? " " + e.className : ""}`,
|
|
878
1038
|
"data-skin": e.skin,
|
|
879
1039
|
"data-layout": e.layout,
|
|
880
1040
|
dir: e.rtl ? "rtl" : void 0,
|
|
881
|
-
style:
|
|
1041
|
+
style: u,
|
|
882
1042
|
children: [
|
|
883
|
-
/* @__PURE__ */
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
1043
|
+
/* @__PURE__ */ o(Nt, { logo: e.logo, logoLink: e.logoLink }),
|
|
1044
|
+
d === "loading" && /* @__PURE__ */ _("div", { className: "peeek__state", style: e.loadingColor ? { color: e.loadingColor } : void 0, children: [
|
|
1045
|
+
e.loadingImage && /* @__PURE__ */ o("img", { className: "peeek__state-img", src: e.loadingImage, alt: "", referrerPolicy: "no-referrer" }),
|
|
1046
|
+
/* @__PURE__ */ o("span", { children: e.loadingCaption ?? n.loading })
|
|
1047
|
+
] }),
|
|
1048
|
+
d === "error" && /* @__PURE__ */ o("div", { className: "peeek__state", children: n.error }),
|
|
1049
|
+
d === "ready" && h && e.mode === "coverflow" && /* @__PURE__ */ o(
|
|
1050
|
+
Tt,
|
|
888
1051
|
{
|
|
889
|
-
pages:
|
|
1052
|
+
pages: h.pages,
|
|
890
1053
|
strings: n,
|
|
891
|
-
filename:
|
|
892
|
-
mimeType:
|
|
1054
|
+
filename: h.metadata.filename,
|
|
1055
|
+
mimeType: h.metadata.mimeType,
|
|
893
1056
|
rtl: e.rtl,
|
|
894
1057
|
autoTransition: e.autoTransition,
|
|
895
1058
|
autoTransitionInterval: e.autoTransitionInterval,
|
|
896
1059
|
downloadUrl: e.downloadUrl,
|
|
897
1060
|
isFullscreen: l,
|
|
898
1061
|
onToggleFullscreen: c,
|
|
899
|
-
onAbout: () =>
|
|
900
|
-
show: { arrows: e.arrows, thumbnails: e.pagesOverview, fullscreen: e.fullscreen, about: e.aboutButton }
|
|
1062
|
+
onAbout: () => p(!0),
|
|
1063
|
+
show: { arrows: e.arrows, thumbnails: e.pagesOverview, fullscreen: e.fullscreen, about: e.aboutButton, goto: e.goToPage }
|
|
901
1064
|
}
|
|
902
1065
|
),
|
|
903
|
-
|
|
904
|
-
|
|
1066
|
+
d === "ready" && h && e.mode === "flip" && /* @__PURE__ */ o(
|
|
1067
|
+
yt,
|
|
905
1068
|
{
|
|
906
|
-
pages:
|
|
1069
|
+
pages: h.pages,
|
|
907
1070
|
strings: n,
|
|
908
1071
|
layout: e.layout,
|
|
909
1072
|
rtl: e.rtl,
|
|
@@ -911,18 +1074,18 @@ function _t(t) {
|
|
|
911
1074
|
animateInteractions: e.animateInteractions,
|
|
912
1075
|
autoTransition: e.autoTransition,
|
|
913
1076
|
autoTransitionInterval: e.autoTransitionInterval,
|
|
914
|
-
show:
|
|
1077
|
+
show: i,
|
|
915
1078
|
downloadUrl: e.downloadUrl,
|
|
916
1079
|
isFullscreen: l,
|
|
917
1080
|
onToggleFullscreen: c,
|
|
918
|
-
onAbout: () =>
|
|
1081
|
+
onAbout: () => p(!0)
|
|
919
1082
|
}
|
|
920
1083
|
),
|
|
921
|
-
|
|
1084
|
+
b && /* @__PURE__ */ o(Pt, { strings: n, onClose: () => p(!1) })
|
|
922
1085
|
]
|
|
923
1086
|
}
|
|
924
1087
|
);
|
|
925
1088
|
}
|
|
926
1089
|
export {
|
|
927
|
-
|
|
1090
|
+
St as PeeekViewer
|
|
928
1091
|
};
|