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