@cocoar/vue-document-viewer 2.3.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
- import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, mergeProps as u, nextTick as d, normalizeClass as f, normalizeStyle as p, onBeforeUnmount as m, onMounted as h, openBlock as g, ref as _, renderList as v, renderSlot as y, resolveComponent as b, shallowReactive as x, shallowRef as S, toDisplayString as C, toHandlers as w, unref as T, vModelText as E, vShow as D, watch as O, withCtx as k, withDirectives as A, withKeys as j, withModifiers as M } from "vue";
2
- import * as N from "pdfjs-dist";
3
- import { TextLayer as P } from "pdfjs-dist";
4
- import { CoarIcon as F, CoarMenu as I, CoarMenuItem as L, CoarPopover as ee, CoarSegmentedControl as te, CoarSidebar as R, CoarSidebarDivider as ne, CoarSidebarGroup as z, CoarSidebarItem as B } from "@cocoar/vue-ui";
1
+ import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, mergeModels as u, mergeProps as d, nextTick as f, normalizeClass as p, normalizeStyle as m, onBeforeUnmount as h, onMounted as g, openBlock as _, ref as v, renderList as y, renderSlot as b, resolveComponent as x, shallowReactive as S, shallowRef as C, toDisplayString as w, toHandlers as T, unref as E, useModel as D, vModelText as O, vShow as k, watch as A, withCtx as j, withDirectives as M, withKeys as N, withModifiers as P } from "vue";
2
+ import * as F from "pdfjs-dist";
3
+ import { TextLayer as I } from "pdfjs-dist";
4
+ import { CoarIcon as L, CoarMenu as R, CoarMenuItem as ee, CoarPopover as te, CoarSegmentedControl as ne, CoarSidebar as re, CoarSidebarDivider as z, CoarSidebarGroup as ie, CoarSidebarItem as B } from "@cocoar/vue-ui";
5
5
  //#region src/internal/page-provider.ts
6
6
  function V(e) {
7
7
  let t = e?.name;
8
8
  return t === "RenderingCancelledException" || t === "AbortException" || t === "AbortError";
9
9
  }
10
- function re(e) {
10
+ function H(e) {
11
11
  let t = e.getViewport({
12
12
  scale: 1,
13
13
  rotation: 0
@@ -69,7 +69,7 @@ function re(e) {
69
69
  rotation: n.rotation
70
70
  });
71
71
  t.replaceChildren();
72
- let a = new P({
72
+ let a = new I({
73
73
  textContentSource: await e.getTextContent(),
74
74
  container: t,
75
75
  viewport: i
@@ -85,21 +85,21 @@ function re(e) {
85
85
  }
86
86
  //#endregion
87
87
  //#region src/sources/pdf-adapter.ts
88
- function ie(e) {
88
+ function ae(e) {
89
89
  if (!e) return;
90
90
  let t = e.match(/^D:(\d{4})(\d{2})(\d{2})(\d{2})?(\d{2})?(\d{2})?/);
91
91
  if (!t) return e;
92
92
  let [, n, r, i, a = "00", o = "00", s = "00"] = t;
93
93
  return `${n}-${r}-${i} ${a}:${o}:${s}`;
94
94
  }
95
- function H(e, t) {
95
+ function U(e, t) {
96
96
  let n = e?.[t];
97
97
  if (typeof n != "string") return;
98
98
  let r = n.trim();
99
99
  return r.length > 0 ? r : void 0;
100
100
  }
101
- function ae(e) {
102
- let t = _("idle"), n = S(null), r = S(null), i = S(null), a = _(null), o = {
101
+ function oe(e) {
102
+ let t = v("idle"), n = C(null), r = C(null), i = C(null), a = v(null), o = {
103
103
  loadingTask: null,
104
104
  doc: null,
105
105
  generation: 0
@@ -125,7 +125,7 @@ function ae(e) {
125
125
  t.value = "loading", a.value = null;
126
126
  let l = e.headers, u = Object.keys(l).length ? { ...l } : void 0, d;
127
127
  try {
128
- d = N.getDocument({
128
+ d = F.getDocument({
129
129
  url: e.url,
130
130
  withCredentials: e.withCredentials,
131
131
  httpHeaders: u
@@ -159,7 +159,7 @@ function ae(e) {
159
159
  } catch {}
160
160
  return;
161
161
  }
162
- p.push(re(t));
162
+ p.push(H(t));
163
163
  }
164
164
  } catch (e) {
165
165
  if (c !== o.generation) return;
@@ -169,15 +169,15 @@ function ae(e) {
169
169
  let m;
170
170
  try {
171
171
  let e = await f.getMetadata(), t = e.info, n = {
172
- title: H(t, "Title"),
173
- author: H(t, "Author"),
174
- subject: H(t, "Subject"),
175
- keywords: H(t, "Keywords"),
176
- creator: H(t, "Creator"),
177
- producer: H(t, "Producer"),
178
- creationDate: ie(H(t, "CreationDate")),
179
- modificationDate: ie(H(t, "ModDate")),
180
- version: H(t, "PDFFormatVersion")
172
+ title: U(t, "Title"),
173
+ author: U(t, "Author"),
174
+ subject: U(t, "Subject"),
175
+ keywords: U(t, "Keywords"),
176
+ creator: U(t, "Creator"),
177
+ producer: U(t, "Producer"),
178
+ creationDate: ae(U(t, "CreationDate")),
179
+ modificationDate: ae(U(t, "ModDate")),
180
+ version: U(t, "PDFFormatVersion")
181
181
  };
182
182
  m = {
183
183
  kind: "pdf",
@@ -199,9 +199,9 @@ function ae(e) {
199
199
  let t = e.value;
200
200
  t && c(t);
201
201
  }
202
- return O(e, (e) => {
202
+ return A(e, (e) => {
203
203
  e ? c(e) : s();
204
- }, { immediate: !0 }), m(() => {
204
+ }, { immediate: !0 }), h(() => {
205
205
  s();
206
206
  }), {
207
207
  status: t,
@@ -215,7 +215,7 @@ function ae(e) {
215
215
  }
216
216
  //#endregion
217
217
  //#region src/sources/image-adapter.ts
218
- function oe(e) {
218
+ function W(e) {
219
219
  if (e.startsWith("data:")) {
220
220
  let t = e.match(/^data:image\/([a-z0-9+.-]+)/i);
221
221
  if (t) {
@@ -258,7 +258,7 @@ function se(e) {
258
258
  };
259
259
  }
260
260
  function ce(e) {
261
- let t = _("idle"), n = S(null), r = S(null), i = _(null), a = 0, o = null;
261
+ let t = v("idle"), n = C(null), r = C(null), i = v(null), a = 0, o = null;
262
262
  async function s() {
263
263
  a += 1, o &&= (o.onload = null, o.onerror = null, o.src = "", null), n.value = null, r.value = null, t.value = "idle", i.value = null;
264
264
  }
@@ -270,7 +270,7 @@ function ce(e) {
270
270
  o = c, c.onload = () => {
271
271
  s === a && (n.value = [se(c)], r.value = {
272
272
  kind: "image",
273
- format: `Image · ${oe(e.url)}`,
273
+ format: `Image · ${W(e.url)}`,
274
274
  pageCount: 1
275
275
  }, t.value = "ready");
276
276
  }, c.onerror = () => {
@@ -282,9 +282,9 @@ function ce(e) {
282
282
  let t = e.value;
283
283
  t && c(t);
284
284
  }
285
- return O(e, (e) => {
285
+ return A(e, (e) => {
286
286
  e ? c(e) : s();
287
- }, { immediate: !0 }), m(() => {
287
+ }, { immediate: !0 }), h(() => {
288
288
  s();
289
289
  }), {
290
290
  status: t,
@@ -307,14 +307,14 @@ function le(e) {
307
307
  };
308
308
  }
309
309
  function ue(e) {
310
- let t = _("idle"), n = S(null), r = S(null), i = _(null), a = 0, o = [];
310
+ let t = v("idle"), n = C(null), r = C(null), i = v(null), a = 0, o = [];
311
311
  async function s() {
312
312
  a += 1;
313
313
  for (let e of o) e.onload = null, e.onerror = null, e.src = "";
314
314
  o = [], n.value = null, r.value = null, t.value = "idle", i.value = null;
315
315
  }
316
316
  function c(e, t) {
317
- let n = new Set(e.map(oe));
317
+ let n = new Set(e.map(W));
318
318
  return {
319
319
  kind: "image-gallery",
320
320
  format: n.size === 0 ? "Image gallery" : n.size === 1 ? `Image gallery · ${[...n][0]}` : "Image gallery · mixed",
@@ -344,9 +344,9 @@ function ue(e) {
344
344
  let t = e.value;
345
345
  t && l(t);
346
346
  }
347
- return O(e, (e) => {
347
+ return A(e, (e) => {
348
348
  e ? l(e) : s();
349
- }, { immediate: !0 }), m(() => {
349
+ }, { immediate: !0 }), h(() => {
350
350
  s();
351
351
  }), {
352
352
  status: t,
@@ -369,7 +369,7 @@ function de(e) {
369
369
  }), i = n(() => {
370
370
  let t = e.value;
371
371
  return t?.kind === "image-gallery" ? t : null;
372
- }), a = ae(t), o = ce(r), s = ue(i), c = n(() => {
372
+ }), a = oe(t), o = ce(r), s = ue(i), c = n(() => {
373
373
  let t = e.value;
374
374
  return t ? t.kind === "pdf" ? a.status.value : t.kind === "image" ? o.status.value : t.kind === "image-gallery" ? s.status.value : "idle" : "idle";
375
375
  }), l = n(() => {
@@ -403,7 +403,7 @@ function de(e) {
403
403
  //#region src/internal/usePageRenderer.ts
404
404
  var fe = 2;
405
405
  function pe(e) {
406
- let t = x([]), n = _(0), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = null;
406
+ let t = S([]), n = v(0), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = null;
407
407
  function o() {
408
408
  return e.devicePixelRatio ? e.devicePixelRatio() : typeof window > "u" ? 1 : Math.min(window.devicePixelRatio || 1, fe);
409
409
  }
@@ -503,9 +503,9 @@ function pe(e) {
503
503
  } finally {
504
504
  i.rendering = !1;
505
505
  }
506
- a.getTextLayer && await h(n, a);
506
+ a.getTextLayer && await m(n, a);
507
507
  }
508
- async function h(n, r) {
508
+ async function m(n, r) {
509
509
  if (!r.getTextLayer) return;
510
510
  let i = t[n];
511
511
  if (!i?.wrapper) return;
@@ -525,7 +525,7 @@ function pe(e) {
525
525
  let i = n instanceof HTMLDivElement ? n : null;
526
526
  r.wrapper !== i && (r.wrapper && a && a.unobserve(r.wrapper), r.wrapper = i, i && (i.dataset.pageIndex = String(e), a?.observe(i)));
527
527
  }
528
- function v(e, n = {}) {
528
+ function _(e, n = {}) {
529
529
  let r = t[e];
530
530
  r?.wrapper && r.wrapper.scrollIntoView({
531
531
  behavior: n.behavior ?? "auto",
@@ -538,19 +538,19 @@ function pe(e) {
538
538
  for (let e of t) e.rendered = !1;
539
539
  for (let [e, t] of i) t > 0 && p(e);
540
540
  }
541
- return O(() => e.pageProviders.value, (e) => {
541
+ return A(() => e.pageProviders.value, (e) => {
542
542
  if (s(), r.clear(), i.clear(), t.splice(0, t.length), n.value = 0, e && (d(e), a)) for (let e of t) e.wrapper && a.observe(e.wrapper);
543
- }, { immediate: !0 }), O(() => e.scrollContainer.value, () => {
543
+ }, { immediate: !0 }), A(() => e.scrollContainer.value, () => {
544
544
  c();
545
- }, { immediate: !0 }), O(() => [e.scale.value, e.rotation.value], () => {
545
+ }, { immediate: !0 }), A(() => [e.scale.value, e.rotation.value], () => {
546
546
  y();
547
- }), m(() => {
547
+ }), h(() => {
548
548
  a?.disconnect(), a = null, s(), r.clear();
549
549
  }), {
550
550
  pages: t,
551
551
  visiblePage: n,
552
552
  bindWrapper: g,
553
- scrollToPage: v,
553
+ scrollToPage: _,
554
554
  invalidateRenders: y
555
555
  };
556
556
  }
@@ -578,7 +578,7 @@ function ge(e, t) {
578
578
  } catch {}
579
579
  }
580
580
  function _e(e) {
581
- let t = _(!1), r = _(!1), i = null, a = null;
581
+ let t = v(!1), r = v(!1), i = null, a = null;
582
582
  function o() {
583
583
  let t = e.scrollContainer.value;
584
584
  if (!t) return null;
@@ -625,11 +625,11 @@ function _e(e) {
625
625
  }
626
626
  t.value = !0, typeof a.zoom == "number" && Number.isFinite(a.zoom) && (e.scale.value = a.zoom), (a.rotation === 0 || a.rotation === 90 || a.rotation === 180 || a.rotation === 270) && (e.rotation.value = a.rotation), await new Promise((e) => requestAnimationFrame(() => requestAnimationFrame(() => e()))), l(a), await new Promise((e) => setTimeout(e, 0)), t.value = !1, r.value = !0;
627
627
  }
628
- O(() => e.pages.length === 0, (e) => {
628
+ A(() => e.pages.length === 0, (e) => {
629
629
  e && (r.value = !1, a = null);
630
- }), O(() => [e.ready.value, e.pages.length], ([e, t]) => {
630
+ }), A(() => [e.ready.value, e.pages.length], ([e, t]) => {
631
631
  e && t > 0 && !r.value && u();
632
- }), O(() => [
632
+ }), A(() => [
633
633
  e.visiblePage.value,
634
634
  e.scale.value,
635
635
  e.rotation.value
@@ -643,9 +643,9 @@ function _e(e) {
643
643
  function p() {
644
644
  d &&= (d.removeEventListener("scroll", c), null);
645
645
  }
646
- return O(() => e.scrollContainer.value, f), h(f), m(() => {
646
+ return A(() => e.scrollContainer.value, f), g(f), h(() => {
647
647
  p(), i != null && clearTimeout(i);
648
- }), O(() => e.externalPosition.value, (n) => {
648
+ }), A(() => e.externalPosition.value, (n) => {
649
649
  if (!n || !e.ready.value || !r.value) return;
650
650
  let i = o();
651
651
  i && JSON.stringify(i) === JSON.stringify(n) || (t.value = !0, e.scale.value = n.zoom, e.rotation.value = n.rotation, requestAnimationFrame(() => {
@@ -675,17 +675,17 @@ function ve(e, t) {
675
675
  wrapper: n
676
676
  } : null;
677
677
  }
678
- var ye = 3, U = 18, W = 14, be = .25, G = .06, xe = [
678
+ var ye = 3, be = 18, G = 14, xe = .25, Se = .06, Ce = [
679
679
  1.5,
680
680
  3,
681
681
  6
682
- ], Se = [
682
+ ], we = [
683
683
  10,
684
684
  18,
685
685
  30
686
686
  ];
687
- function Ce(e) {
688
- let t = _(null), r = _(null), i = _(null), a = _(null), o = _(null), s = _(null), c = _(ye), l = _(""), u = _(U), d = _("");
687
+ function Te(e) {
688
+ let t = v(null), r = v(null), i = v(null), a = v(null), o = v(null), s = v(null), c = v(ye), l = v(""), u = v(be), d = v("");
689
689
  function f() {
690
690
  return e.pages;
691
691
  }
@@ -705,7 +705,7 @@ function Ce(e) {
705
705
  color: e.colors.value[0] ?? "#2563eb"
706
706
  };
707
707
  else {
708
- let t = be, n = G;
708
+ let t = xe, n = Se;
709
709
  i.value = {
710
710
  pageIndex: o,
711
711
  rect: {
@@ -723,11 +723,11 @@ function Ce(e) {
723
723
  function h(e) {
724
724
  if (!a.value || !m) return;
725
725
  let t = m.getBoundingClientRect(), n = {
726
- x: K((e.clientX - t.left) / Math.max(1, t.width)),
727
- y: K((e.clientY - t.top) / Math.max(1, t.height))
726
+ x: q((e.clientX - t.left) / Math.max(1, t.width)),
727
+ y: q((e.clientY - t.top) / Math.max(1, t.height))
728
728
  }, r = a.value.strokes, i = r[r.length - 1];
729
729
  if ((e.shiftKey || e.ctrlKey || e.metaKey) && i.length >= 1) {
730
- let t = i[0], a = e.shiftKey ? Te(t, n) : n;
730
+ let t = i[0], a = e.shiftKey ? Ee(t, n) : n;
731
731
  r[r.length - 1] = [t, a];
732
732
  } else i.push(n);
733
733
  a.value = {
@@ -742,7 +742,7 @@ function Ce(e) {
742
742
  return;
743
743
  }
744
744
  if (n === "eraser") {
745
- A(t);
745
+ k(t);
746
746
  return;
747
747
  }
748
748
  if (n !== "ink" && n !== "marker" || t.button !== 0 || !t.altKey && t.target?.closest("[data-annotation-id]")) return;
@@ -757,13 +757,13 @@ function Ce(e) {
757
757
  width: p?.width ?? (i ? u.value : c.value),
758
758
  color: p?.color || (i ? d.value : l.value) || e.colors.value[0] || (i ? "#fde68a" : "#dc2626"),
759
759
  appendToId: p?.id
760
- }, h(t), window.addEventListener("pointermove", v), window.addEventListener("pointerup", y), window.addEventListener("pointercancel", y);
760
+ }, h(t), window.addEventListener("pointermove", _), window.addEventListener("pointerup", y), window.addEventListener("pointercancel", y);
761
761
  }
762
- function v(e) {
762
+ function _(e) {
763
763
  a.value && h(e);
764
764
  }
765
765
  function y() {
766
- window.removeEventListener("pointermove", v), window.removeEventListener("pointerup", y), window.removeEventListener("pointercancel", y);
766
+ window.removeEventListener("pointermove", _), window.removeEventListener("pointerup", y), window.removeEventListener("pointercancel", y);
767
767
  let t = a.value;
768
768
  if (m = null, a.value = null, !t) return;
769
769
  let n = t.strokes.filter((e) => e.length >= 2);
@@ -801,7 +801,7 @@ function Ce(e) {
801
801
  color: n,
802
802
  rect: r.rect,
803
803
  text: t,
804
- fontSize: W
804
+ fontSize: G
805
805
  }), i.value = null;
806
806
  }
807
807
  }
@@ -853,7 +853,7 @@ function Ce(e) {
853
853
  startY: n.clientY,
854
854
  dx: 0,
855
855
  dy: 0
856
- }, n.target.setPointerCapture?.(n.pointerId), window.addEventListener("pointermove", D), window.addEventListener("pointerup", k), window.addEventListener("pointercancel", k);
856
+ }, n.target.setPointerCapture?.(n.pointerId), window.addEventListener("pointermove", D), window.addEventListener("pointerup", O), window.addEventListener("pointercancel", O);
857
857
  }
858
858
  function D(e) {
859
859
  let t = o.value;
@@ -861,19 +861,19 @@ function Ce(e) {
861
861
  let n = e.clientX - t.startX, r = e.clientY - t.startY;
862
862
  t.dx = n / Math.max(1, t.wrapperWidth), t.dy = r / Math.max(1, t.wrapperHeight), w.style.transform = `translate(${n}px, ${r}px)`;
863
863
  }
864
- function k() {
865
- window.removeEventListener("pointermove", D), window.removeEventListener("pointerup", k), window.removeEventListener("pointercancel", k);
864
+ function O() {
865
+ window.removeEventListener("pointermove", D), window.removeEventListener("pointerup", O), window.removeEventListener("pointercancel", O);
866
866
  let t = o.value, n = w;
867
867
  if (w = null, o.value = null, !t || !n || (n.style.transform = "", Math.abs(t.dx) < 1e-4 && Math.abs(t.dy) < 1e-4)) return;
868
868
  let r = e.annotations.value.find((e) => e.id === t.id);
869
869
  if (!r) return;
870
- let i = we(r, t.dx, t.dy);
870
+ let i = K(r, t.dx, t.dy);
871
871
  i && e.emitUpdate({
872
872
  id: t.id,
873
873
  patch: i
874
874
  });
875
875
  }
876
- function A(n) {
876
+ function k(n) {
877
877
  if (n.button !== 0) return;
878
878
  let r = T(n.target);
879
879
  if (!r) return;
@@ -907,13 +907,13 @@ function Ce(e) {
907
907
  t && (N = t, t.addEventListener("click", p), t.addEventListener("pointerdown", g));
908
908
  }
909
909
  function F() {
910
- N &&= (N.removeEventListener("click", p), N.removeEventListener("pointerdown", g), null), window.removeEventListener("pointermove", v), window.removeEventListener("pointerup", y), window.removeEventListener("pointercancel", y), window.removeEventListener("pointermove", D), window.removeEventListener("pointerup", k), window.removeEventListener("pointercancel", k);
910
+ N &&= (N.removeEventListener("click", p), N.removeEventListener("pointerdown", g), null), window.removeEventListener("pointermove", _), window.removeEventListener("pointerup", y), window.removeEventListener("pointercancel", y), window.removeEventListener("pointermove", D), window.removeEventListener("pointerup", O), window.removeEventListener("pointercancel", O);
911
911
  }
912
- O(() => e.scrollContainer.value, P, { immediate: !0 }), O(() => e.mode.value, () => {
912
+ A(() => e.scrollContainer.value, P, { immediate: !0 }), A(() => e.mode.value, () => {
913
913
  r.value = null, i.value = null, a.value = null, w &&= (w.style.transform = "", null), o.value = null, s.value = null, t.value = null;
914
914
  });
915
915
  let I = /* @__PURE__ */ new Set();
916
- return O(() => e.annotations.value, (e) => {
916
+ return A(() => e.annotations.value, (e) => {
917
917
  let t = [];
918
918
  for (let n of e) I.has(n.id) || t.push(n);
919
919
  I = new Set(e.map((e) => e.id));
@@ -947,11 +947,11 @@ function Ce(e) {
947
947
  detach: F
948
948
  };
949
949
  }
950
- function we(e, t, n) {
950
+ function K(e, t, n) {
951
951
  switch (e.type) {
952
952
  case "comment": return { anchor: {
953
- x: K(e.anchor.x + t),
954
- y: K(e.anchor.y + n)
953
+ x: q(e.anchor.x + t),
954
+ y: q(e.anchor.y + n)
955
955
  } };
956
956
  case "freetext": {
957
957
  let r = e, i = Math.max(0, 1 - r.rect.w), a = Math.max(0, 1 - r.rect.h);
@@ -964,29 +964,29 @@ function we(e, t, n) {
964
964
  }
965
965
  case "ink":
966
966
  case "marker": return { strokes: e.strokes.map((e) => e.map((e) => ({
967
- x: K(e.x + t),
968
- y: K(e.y + n)
967
+ x: q(e.x + t),
968
+ y: q(e.y + n)
969
969
  }))) };
970
970
  }
971
971
  }
972
- function K(e) {
972
+ function q(e) {
973
973
  return Math.max(0, Math.min(1, e));
974
974
  }
975
- var q = Math.PI / 12;
976
- function Te(e, t) {
975
+ var J = Math.PI / 12;
976
+ function Ee(e, t) {
977
977
  let n = t.x - e.x, r = t.y - e.y;
978
978
  if (n === 0 && r === 0) return t;
979
- let i = Math.round(Math.atan2(r, n) / q) * q, a = Math.hypot(n, r);
979
+ let i = Math.round(Math.atan2(r, n) / J) * J, a = Math.hypot(n, r);
980
980
  return {
981
- x: K(e.x + Math.cos(i) * a),
982
- y: K(e.y + Math.sin(i) * a)
981
+ x: q(e.x + Math.cos(i) * a),
982
+ y: q(e.y + Math.sin(i) * a)
983
983
  };
984
984
  }
985
985
  //#endregion
986
986
  //#region src/internal/usePdfSearch.ts
987
- var Ee = 350, De = 2;
988
- function Oe(e) {
989
- let t = _(""), r = _(!1), i = _([]), a = _(-1), o = _(!1), s = /* @__PURE__ */ new Map(), c = 0, l = null;
987
+ var De = 350, Oe = 2;
988
+ function ke(e) {
989
+ let t = v(""), r = v(!1), i = v([]), a = v(-1), o = v(!1), s = /* @__PURE__ */ new Map(), c = 0, l = null;
990
990
  async function u(t) {
991
991
  let n = s.get(t);
992
992
  if (n) return n;
@@ -1046,7 +1046,7 @@ function Oe(e) {
1046
1046
  }
1047
1047
  async function p(t) {
1048
1048
  let n = ++c, s = e.doc.value, l = t.trim();
1049
- if (!s || l.length < De) {
1049
+ if (!s || l.length < Oe) {
1050
1050
  i.value = [], a.value = -1, o.value = !1;
1051
1051
  return;
1052
1052
  }
@@ -1081,7 +1081,7 @@ function Oe(e) {
1081
1081
  return t.value = e, l != null && clearTimeout(l), new Promise((t) => {
1082
1082
  l = setTimeout(() => {
1083
1083
  p(e).then(t);
1084
- }, Ee);
1084
+ }, De);
1085
1085
  });
1086
1086
  }
1087
1087
  function h() {
@@ -1090,7 +1090,7 @@ function Oe(e) {
1090
1090
  function g() {
1091
1091
  i.value.length !== 0 && (a.value = (a.value - 1 + i.value.length) % i.value.length);
1092
1092
  }
1093
- function v() {
1093
+ function _() {
1094
1094
  c++, l != null && clearTimeout(l), t.value = "", i.value = [], a.value = -1, o.value = !1;
1095
1095
  }
1096
1096
  async function y(e) {
@@ -1105,10 +1105,10 @@ function Oe(e) {
1105
1105
  }
1106
1106
  }
1107
1107
  }
1108
- return O(r, () => {
1108
+ return A(r, () => {
1109
1109
  t.value && p(t.value);
1110
- }), O(() => e.doc.value, (e) => {
1111
- s.clear(), v(), e && y(e);
1110
+ }), A(() => e.doc.value, (e) => {
1111
+ s.clear(), _(), e && y(e);
1112
1112
  }, { immediate: !0 }), {
1113
1113
  query: t,
1114
1114
  caseSensitive: r,
@@ -1122,12 +1122,12 @@ function Oe(e) {
1122
1122
  setQuery: m,
1123
1123
  next: h,
1124
1124
  prev: g,
1125
- clear: v
1125
+ clear: _
1126
1126
  };
1127
1127
  }
1128
1128
  //#endregion
1129
1129
  //#region src/types.ts
1130
- var ke = /* @__PURE__ */ "sidebar-toggle.annotations-panel.separator.prev-page.page-input.next-page.separator.zoom-out.zoom-reset.zoom-in.separator.fit-width.fit-page.reset-view.separator.rotate-ccw.rotate-cw.separator.pan.select.eraser.separator.marker.note.ink.freetext.separator.search.print.download".split("."), Ae = [
1130
+ var Ae = /* @__PURE__ */ "sidebar-toggle.annotations-panel.separator.prev-page.page-input.next-page.separator.zoom-out.zoom-reset.zoom-in.separator.fit-width.fit-page.reset-view.separator.rotate-ccw.rotate-cw.separator.pan.select.eraser.separator.marker.note.ink.freetext.separator.search.print.download".split("."), je = [
1131
1131
  "pan",
1132
1132
  "select",
1133
1133
  "eraser",
@@ -1136,9 +1136,9 @@ var ke = /* @__PURE__ */ "sidebar-toggle.annotations-panel.separator.prev-page.p
1136
1136
  "ink",
1137
1137
  "freetext"
1138
1138
  ];
1139
- function je(e, t) {
1139
+ function Me(e, t) {
1140
1140
  let n = [];
1141
- for (let r of e) r === "sidebar-toggle" && !t.showSidebarToggle || r === "annotations-panel" && !t.showAnnotationsPanelToggle || r === "search" && !t.showSearch || (r === "print" || r === "download") && !t.showPrintDownload || !t.showAnnotationModes && Ae.includes(r) || n.push(r);
1141
+ for (let r of e) r === "sidebar-toggle" && !t.showSidebarToggle || r === "annotations-panel" && !t.showAnnotationsPanelToggle || r === "search" && !t.showSearch || (r === "print" || r === "download") && !t.showPrintDownload || !t.showAnnotationModes && je.includes(r) || n.push(r);
1142
1142
  for (; n.length > 0 && n[0] === "separator";) n.shift();
1143
1143
  for (; n.length > 0 && n[n.length - 1] === "separator";) n.pop();
1144
1144
  let r = [];
@@ -1147,29 +1147,29 @@ function je(e, t) {
1147
1147
  }
1148
1148
  //#endregion
1149
1149
  //#region src/internal/DocumentToolbar.vue?vue&type=script&setup=true&lang.ts
1150
- var Me = ["aria-label"], Ne = [
1150
+ var Ne = ["aria-label"], Y = [
1151
1151
  "aria-label",
1152
1152
  "title",
1153
1153
  "disabled"
1154
- ], J = { class: "coar-pdf-toolbar__page-total" }, Pe = ["aria-label"], Fe = ["aria-label", "title"], Ie = { class: "coar-pdf-toolbar__flyout" }, Le = ["aria-label"], Re = [
1154
+ ], Pe = { class: "coar-pdf-toolbar__page-total" }, Fe = ["aria-label"], Ie = ["aria-label", "title"], Le = { class: "coar-pdf-toolbar__flyout" }, Re = ["aria-label"], ze = [
1155
1155
  "title",
1156
1156
  "aria-label",
1157
1157
  "aria-pressed",
1158
1158
  "onClick"
1159
- ], ze = ["aria-label"], Be = [
1159
+ ], Be = ["aria-label"], Ve = [
1160
1160
  "title",
1161
1161
  "aria-label",
1162
1162
  "aria-checked",
1163
1163
  "onClick"
1164
- ], Ve = { class: "coar-pdf-toolbar__flyout" }, Y = ["aria-label"], He = [
1164
+ ], X = { class: "coar-pdf-toolbar__flyout" }, He = ["aria-label"], Ue = [
1165
1165
  "title",
1166
1166
  "aria-pressed",
1167
1167
  "onClick"
1168
- ], Ue = ["aria-label"], X = [
1168
+ ], Z = ["aria-label"], We = [
1169
1169
  "title",
1170
1170
  "aria-checked",
1171
1171
  "onClick"
1172
- ], We = /* @__PURE__ */ l({
1172
+ ], Ge = /* @__PURE__ */ l({
1173
1173
  __name: "DocumentToolbar",
1174
1174
  props: {
1175
1175
  currentPage: {},
@@ -1224,11 +1224,11 @@ var Me = ["aria-label"], Ne = [
1224
1224
  "download"
1225
1225
  ],
1226
1226
  setup(t, { emit: s }) {
1227
- let c = t, l = s, u = _(String(c.currentPage + 1)), d = _(null);
1228
- O(() => c.currentPage, (e) => {
1227
+ let c = t, l = s, u = v(String(c.currentPage + 1)), d = v(null);
1228
+ A(() => c.currentPage, (e) => {
1229
1229
  document.activeElement !== d.value && (u.value = String(e + 1));
1230
1230
  });
1231
- function m() {
1231
+ function f() {
1232
1232
  let e = u.value.trim(), t = Number(e);
1233
1233
  if (!e || !Number.isFinite(t)) {
1234
1234
  u.value = String(c.currentPage + 1);
@@ -1238,28 +1238,28 @@ var Me = ["aria-label"], Ne = [
1238
1238
  u.value = String(n), l("jump", n - 1);
1239
1239
  }
1240
1240
  function h(e) {
1241
- e.key === "Enter" ? (e.preventDefault(), m(), d.value?.blur()) : e.key === "Escape" && (e.preventDefault(), u.value = String(c.currentPage + 1), d.value?.blur());
1241
+ e.key === "Enter" ? (e.preventDefault(), f(), d.value?.blur()) : e.key === "Escape" && (e.preventDefault(), u.value = String(c.currentPage + 1), d.value?.blur());
1242
1242
  }
1243
- let b = _(String(Math.round(c.zoom * 100))), x = _(null);
1244
- O(() => c.zoom, (e) => {
1245
- document.activeElement !== x.value && (b.value = String(Math.round(e * 100)));
1243
+ let g = v(String(Math.round(c.zoom * 100))), x = v(null);
1244
+ A(() => c.zoom, (e) => {
1245
+ document.activeElement !== x.value && (g.value = String(Math.round(e * 100)));
1246
1246
  });
1247
1247
  function S() {
1248
- let e = b.value.trim().replace(/%$/, "").replace(",", ".").trim(), t = Number(e);
1248
+ let e = g.value.trim().replace(/%$/, "").replace(",", ".").trim(), t = Number(e);
1249
1249
  if (!e || !Number.isFinite(t) || t <= 0) {
1250
- b.value = String(Math.round(c.zoom * 100));
1250
+ g.value = String(Math.round(c.zoom * 100));
1251
1251
  return;
1252
1252
  }
1253
1253
  let n = Math.round(c.minZoom * 100), r = Math.round(c.maxZoom * 100), i = Math.max(n, Math.min(r, Math.round(t)));
1254
- b.value = String(i), l("set-zoom", i / 100);
1254
+ g.value = String(i), l("set-zoom", i / 100);
1255
1255
  }
1256
- function w(e) {
1257
- e.key === "Enter" ? (e.preventDefault(), S(), x.value?.blur()) : e.key === "Escape" && (e.preventDefault(), b.value = String(Math.round(c.zoom * 100)), x.value?.blur());
1256
+ function C(e) {
1257
+ e.key === "Enter" ? (e.preventDefault(), S(), x.value?.blur()) : e.key === "Escape" && (e.preventDefault(), g.value = String(Math.round(c.zoom * 100)), x.value?.blur());
1258
1258
  }
1259
- function D() {
1259
+ function T() {
1260
1260
  x.value?.select();
1261
1261
  }
1262
- let j = n(() => c.currentPage > 0), M = n(() => c.currentPage < c.pageCount - 1), N = n(() => c.zoom < c.maxZoom - 1e-6), P = n(() => c.zoom > c.minZoom + 1e-6);
1262
+ let D = n(() => c.currentPage > 0), k = n(() => c.currentPage < c.pageCount - 1), N = n(() => c.zoom < c.maxZoom - 1e-6), P = n(() => c.zoom > c.minZoom + 1e-6);
1263
1263
  function F(e, t) {
1264
1264
  return t === "marker" ? Math.min(22, Math.max(8, e * .7)) : Math.min(16, Math.max(3, e * 2));
1265
1265
  }
@@ -1277,14 +1277,14 @@ var Me = ["aria-label"], Ne = [
1277
1277
  function L(e, t) {
1278
1278
  return I(e) ? `${t} — ${c.labels.notAvailableForSource}` : t;
1279
1279
  }
1280
- let ee = n(() => je(c.tools ?? ke, {
1280
+ let R = n(() => Me(c.tools ?? Ae, {
1281
1281
  showSidebarToggle: c.showSidebarToggle,
1282
1282
  showAnnotationsPanelToggle: c.showAnnotationsPanelToggle,
1283
1283
  showSearch: c.showSearch,
1284
1284
  showPrintDownload: c.showPrintDownload,
1285
1285
  showAnnotationModes: c.showAnnotationModes
1286
1286
  }));
1287
- return (n, s) => (g(), r(T(R), {
1287
+ return (n, s) => (_(), r(E(re), {
1288
1288
  side: t.side,
1289
1289
  collapsed: !0,
1290
1290
  size: "s",
@@ -1293,31 +1293,31 @@ var Me = ["aria-label"], Ne = [
1293
1293
  "aria-label": t.labels.pageOf,
1294
1294
  class: "coar-pdf-toolbar"
1295
1295
  }, {
1296
- default: k(() => [(g(!0), a(e, null, v(ee.value, (n, c) => (g(), a(e, { key: `${n}-${c}` }, [n === "separator" ? (g(), r(T(ne), { key: 0 })) : n === "sidebar-toggle" ? (g(), r(T(B), {
1296
+ default: j(() => [(_(!0), a(e, null, y(R.value, (n, c) => (_(), a(e, { key: `${n}-${c}` }, [n === "separator" ? (_(), r(E(z), { key: 0 })) : n === "sidebar-toggle" ? (_(), r(E(B), {
1297
1297
  key: 1,
1298
1298
  icon: "panel-left",
1299
1299
  label: t.labels.thumbnails,
1300
1300
  active: t.sidebarOpen,
1301
1301
  onClick: s[0] ||= (e) => l("toggle-sidebar")
1302
- }, null, 8, ["label", "active"])) : n === "annotations-panel" ? (g(), r(T(B), {
1302
+ }, null, 8, ["label", "active"])) : n === "annotations-panel" ? (_(), r(E(B), {
1303
1303
  key: 2,
1304
1304
  icon: "panel-right",
1305
1305
  label: t.labels.annotationsPanel,
1306
1306
  active: t.annotationsPanelOpen,
1307
1307
  onClick: s[1] ||= (e) => l("toggle-annotations-panel")
1308
- }, null, 8, ["label", "active"])) : n === "prev-page" ? (g(), r(T(B), {
1308
+ }, null, 8, ["label", "active"])) : n === "prev-page" ? (_(), r(E(B), {
1309
1309
  key: 3,
1310
1310
  icon: "chevron-up",
1311
1311
  label: L("prev-page", t.labels.prevPage),
1312
- disabled: !j.value || I("prev-page"),
1312
+ disabled: !D.value || I("prev-page"),
1313
1313
  onClick: s[2] ||= (e) => l("prev")
1314
- }, null, 8, ["label", "disabled"])) : n === "page-input" ? (g(), a("div", {
1314
+ }, null, 8, ["label", "disabled"])) : n === "page-input" ? (_(), a("div", {
1315
1315
  key: 4,
1316
- class: f(["coar-pdf-toolbar__inline-page", { "coar-pdf-toolbar__inline-page--disabled": I("page-input") }]),
1316
+ class: p(["coar-pdf-toolbar__inline-page", { "coar-pdf-toolbar__inline-page--disabled": I("page-input") }]),
1317
1317
  role: "group",
1318
1318
  "aria-label": t.labels.pageJumpAria
1319
1319
  }, [
1320
- A(o("input", {
1320
+ M(o("input", {
1321
1321
  ref_for: !0,
1322
1322
  ref_key: "pageInputEl",
1323
1323
  ref: d,
@@ -1328,97 +1328,97 @@ var Me = ["aria-label"], Ne = [
1328
1328
  "aria-label": t.labels.pageJumpAria,
1329
1329
  title: L("page-input", t.labels.pageJumpAria),
1330
1330
  disabled: I("page-input"),
1331
- onBlur: m,
1331
+ onBlur: f,
1332
1332
  onKeydown: h
1333
- }, null, 40, Ne), [[E, u.value]]),
1333
+ }, null, 40, Y), [[O, u.value]]),
1334
1334
  s[23] ||= o("span", {
1335
1335
  class: "coar-pdf-toolbar__page-sep",
1336
1336
  "aria-hidden": "true"
1337
1337
  }, "/", -1),
1338
- o("span", J, C(t.pageCount), 1)
1339
- ], 10, Me)) : n === "next-page" ? (g(), r(T(B), {
1338
+ o("span", Pe, w(t.pageCount), 1)
1339
+ ], 10, Ne)) : n === "next-page" ? (_(), r(E(B), {
1340
1340
  key: 5,
1341
1341
  icon: "chevron-down",
1342
1342
  label: L("next-page", t.labels.nextPage),
1343
- disabled: !M.value || I("next-page"),
1343
+ disabled: !k.value || I("next-page"),
1344
1344
  onClick: s[4] ||= (e) => l("next")
1345
- }, null, 8, ["label", "disabled"])) : n === "zoom-out" ? (g(), r(T(B), {
1345
+ }, null, 8, ["label", "disabled"])) : n === "zoom-out" ? (_(), r(E(B), {
1346
1346
  key: 6,
1347
1347
  icon: "minus",
1348
1348
  label: t.labels.zoomOut,
1349
1349
  disabled: !P.value,
1350
1350
  onClick: s[5] ||= (e) => l("zoom-out")
1351
- }, null, 8, ["label", "disabled"])) : n === "zoom-reset" ? (g(), a("div", {
1351
+ }, null, 8, ["label", "disabled"])) : n === "zoom-reset" ? (_(), a("div", {
1352
1352
  key: 7,
1353
1353
  class: "coar-pdf-toolbar__zoom-readout",
1354
1354
  role: "group",
1355
1355
  "aria-label": t.labels.zoomLevel
1356
- }, [A(o("input", {
1356
+ }, [M(o("input", {
1357
1357
  ref_for: !0,
1358
1358
  ref_key: "zoomInputEl",
1359
1359
  ref: x,
1360
- "onUpdate:modelValue": s[6] ||= (e) => b.value = e,
1360
+ "onUpdate:modelValue": s[6] ||= (e) => g.value = e,
1361
1361
  class: "coar-pdf-toolbar__zoom-input",
1362
1362
  type: "text",
1363
1363
  inputmode: "numeric",
1364
1364
  "aria-label": t.labels.zoomLevel,
1365
1365
  title: t.labels.zoomLevel,
1366
1366
  onBlur: S,
1367
- onKeydown: w,
1368
- onFocus: D
1369
- }, null, 40, Fe), [[E, b.value]]), s[24] ||= o("span", {
1367
+ onKeydown: C,
1368
+ onFocus: T
1369
+ }, null, 40, Ie), [[O, g.value]]), s[24] ||= o("span", {
1370
1370
  class: "coar-pdf-toolbar__zoom-suffix",
1371
1371
  "aria-hidden": "true"
1372
- }, "%", -1)], 8, Pe)) : n === "zoom-in" ? (g(), r(T(B), {
1372
+ }, "%", -1)], 8, Fe)) : n === "zoom-in" ? (_(), r(E(B), {
1373
1373
  key: 8,
1374
1374
  icon: "plus",
1375
1375
  label: t.labels.zoomIn,
1376
1376
  disabled: !N.value,
1377
1377
  onClick: s[7] ||= (e) => l("zoom-in")
1378
- }, null, 8, ["label", "disabled"])) : n === "fit-width" ? (g(), r(T(B), {
1378
+ }, null, 8, ["label", "disabled"])) : n === "fit-width" ? (_(), r(E(B), {
1379
1379
  key: 9,
1380
1380
  icon: "move-horizontal",
1381
1381
  label: t.labels.fitWidth,
1382
1382
  onClick: s[8] ||= (e) => l("fit-width")
1383
- }, null, 8, ["label"])) : n === "fit-page" ? (g(), r(T(B), {
1383
+ }, null, 8, ["label"])) : n === "fit-page" ? (_(), r(E(B), {
1384
1384
  key: 10,
1385
1385
  icon: "file-text",
1386
1386
  label: t.labels.fitPage,
1387
1387
  onClick: s[9] ||= (e) => l("fit-page")
1388
- }, null, 8, ["label"])) : n === "reset-view" ? (g(), r(T(B), {
1388
+ }, null, 8, ["label"])) : n === "reset-view" ? (_(), r(E(B), {
1389
1389
  key: 11,
1390
1390
  icon: "refresh-cw",
1391
1391
  label: t.labels.resetView,
1392
1392
  onClick: s[10] ||= (e) => l("reset-view")
1393
- }, null, 8, ["label"])) : n === "rotate-ccw" ? (g(), r(T(B), {
1393
+ }, null, 8, ["label"])) : n === "rotate-ccw" ? (_(), r(E(B), {
1394
1394
  key: 12,
1395
1395
  icon: "rotate-ccw",
1396
1396
  label: t.labels.rotateCcw,
1397
1397
  onClick: s[11] ||= (e) => l("rotate-ccw")
1398
- }, null, 8, ["label"])) : n === "rotate-cw" ? (g(), r(T(B), {
1398
+ }, null, 8, ["label"])) : n === "rotate-cw" ? (_(), r(E(B), {
1399
1399
  key: 13,
1400
1400
  icon: "rotate-cw",
1401
1401
  label: t.labels.rotateCw,
1402
1402
  onClick: s[12] ||= (e) => l("rotate-cw")
1403
- }, null, 8, ["label"])) : n === "pan" ? (g(), r(T(B), {
1403
+ }, null, 8, ["label"])) : n === "pan" ? (_(), r(E(B), {
1404
1404
  key: 14,
1405
1405
  icon: "hand",
1406
1406
  label: t.labels.pan,
1407
1407
  active: t.pointerMode === "pan",
1408
1408
  onClick: s[13] ||= (e) => l("toggle-pan")
1409
- }, null, 8, ["label", "active"])) : n === "select" ? (g(), r(T(B), {
1409
+ }, null, 8, ["label", "active"])) : n === "select" ? (_(), r(E(B), {
1410
1410
  key: 15,
1411
1411
  icon: "mouse-pointer-2",
1412
1412
  label: t.labels.modeSelect,
1413
1413
  active: t.annotationMode === "select",
1414
1414
  onClick: s[14] ||= (e) => l("set-annotation-mode", t.annotationMode === "select" ? "view" : "select")
1415
- }, null, 8, ["label", "active"])) : n === "eraser" ? (g(), r(T(B), {
1415
+ }, null, 8, ["label", "active"])) : n === "eraser" ? (_(), r(E(B), {
1416
1416
  key: 16,
1417
1417
  icon: "eraser",
1418
1418
  label: t.labels.modeEraser,
1419
1419
  active: t.annotationMode === "eraser",
1420
1420
  onClick: s[15] ||= (e) => l("set-annotation-mode", t.annotationMode === "eraser" ? "view" : "eraser")
1421
- }, null, 8, ["label", "active"])) : n === "marker" ? (g(), r(T(z), {
1421
+ }, null, 8, ["label", "active"])) : n === "marker" ? (_(), r(E(ie), {
1422
1422
  key: 17,
1423
1423
  icon: "highlighter",
1424
1424
  label: t.labels.modeMarker,
@@ -1428,47 +1428,47 @@ var Me = ["aria-label"], Ne = [
1428
1428
  active: t.annotationMode === "marker",
1429
1429
  onTriggerClick: s[16] ||= (e) => l("set-annotation-mode", t.annotationMode === "marker" ? "view" : "marker")
1430
1430
  }, {
1431
- default: k(() => [o("div", Ie, [o("div", {
1431
+ default: j(() => [o("div", Le, [o("div", {
1432
1432
  class: "coar-pdf-toolbar__flyout-row",
1433
1433
  "aria-label": t.labels.strokeWidth
1434
- }, [(g(!0), a(e, null, v(t.markerWidthPresets, (e) => (g(), a("button", {
1434
+ }, [(_(!0), a(e, null, y(t.markerWidthPresets, (e) => (_(), a("button", {
1435
1435
  key: e,
1436
1436
  type: "button",
1437
- class: f(["coar-pdf-toolbar__flyout-width", { "coar-pdf-toolbar__flyout-width--active": Math.abs(t.markerWidth - e) < .01 }]),
1437
+ class: p(["coar-pdf-toolbar__flyout-width", { "coar-pdf-toolbar__flyout-width--active": Math.abs(t.markerWidth - e) < .01 }]),
1438
1438
  title: `${e}px`,
1439
1439
  "aria-label": `${e}px`,
1440
1440
  "aria-pressed": Math.abs(t.markerWidth - e) < .01,
1441
1441
  onClick: (t) => l("update:marker-width", e)
1442
1442
  }, [o("span", {
1443
1443
  class: "coar-pdf-toolbar__flyout-width-dot",
1444
- style: p({
1444
+ style: m({
1445
1445
  width: F(e, "marker") + "px",
1446
1446
  height: F(e, "marker") + "px",
1447
1447
  background: t.markerColor
1448
1448
  })
1449
- }, null, 4)], 10, Re))), 128))], 8, Le), o("div", {
1449
+ }, null, 4)], 10, ze))), 128))], 8, Re), o("div", {
1450
1450
  class: "coar-pdf-toolbar__flyout-row",
1451
1451
  role: "radiogroup",
1452
1452
  "aria-label": t.labels.annotationColor
1453
- }, [(g(!0), a(e, null, v(t.colors, (e) => (g(), a("button", {
1453
+ }, [(_(!0), a(e, null, y(t.colors, (e) => (_(), a("button", {
1454
1454
  key: e,
1455
1455
  type: "button",
1456
- class: f(["coar-pdf-toolbar__flyout-color", { "coar-pdf-toolbar__flyout-color--active": e === t.markerColor }]),
1456
+ class: p(["coar-pdf-toolbar__flyout-color", { "coar-pdf-toolbar__flyout-color--active": e === t.markerColor }]),
1457
1457
  title: e,
1458
1458
  "aria-label": e,
1459
1459
  "aria-checked": e === t.markerColor,
1460
1460
  role: "radio",
1461
- style: p({ background: e }),
1461
+ style: m({ background: e }),
1462
1462
  onClick: (t) => l("update:marker-color", e)
1463
- }, null, 14, Be))), 128))], 8, ze)])]),
1463
+ }, null, 14, Ve))), 128))], 8, Be)])]),
1464
1464
  _: 1
1465
- }, 8, ["label", "active"])) : n === "note" ? (g(), r(T(B), {
1465
+ }, 8, ["label", "active"])) : n === "note" ? (_(), r(E(B), {
1466
1466
  key: 18,
1467
1467
  icon: "message-square",
1468
1468
  label: t.labels.modeNote,
1469
1469
  active: t.annotationMode === "comment",
1470
1470
  onClick: s[17] ||= (e) => l("set-annotation-mode", t.annotationMode === "comment" ? "view" : "comment")
1471
- }, null, 8, ["label", "active"])) : n === "ink" ? (g(), r(T(z), {
1471
+ }, null, 8, ["label", "active"])) : n === "ink" ? (_(), r(E(ie), {
1472
1472
  key: 19,
1473
1473
  icon: "pencil",
1474
1474
  label: t.labels.modeInk,
@@ -1478,85 +1478,85 @@ var Me = ["aria-label"], Ne = [
1478
1478
  active: t.annotationMode === "ink",
1479
1479
  onTriggerClick: s[18] ||= (e) => l("set-annotation-mode", t.annotationMode === "ink" ? "view" : "ink")
1480
1480
  }, {
1481
- default: k(() => [o("div", Ve, [o("div", {
1481
+ default: j(() => [o("div", X, [o("div", {
1482
1482
  class: "coar-pdf-toolbar__flyout-row",
1483
1483
  "aria-label": t.labels.strokeWidth
1484
- }, [(g(!0), a(e, null, v(t.inkWidthPresets, (e) => (g(), a("button", {
1484
+ }, [(_(!0), a(e, null, y(t.inkWidthPresets, (e) => (_(), a("button", {
1485
1485
  key: e,
1486
1486
  type: "button",
1487
- class: f(["coar-pdf-toolbar__flyout-width", { "coar-pdf-toolbar__flyout-width--active": Math.abs(t.inkWidth - e) < .01 }]),
1487
+ class: p(["coar-pdf-toolbar__flyout-width", { "coar-pdf-toolbar__flyout-width--active": Math.abs(t.inkWidth - e) < .01 }]),
1488
1488
  title: `${e}px`,
1489
1489
  "aria-pressed": Math.abs(t.inkWidth - e) < .01,
1490
1490
  onClick: (t) => l("update:ink-width", e)
1491
1491
  }, [o("span", {
1492
1492
  class: "coar-pdf-toolbar__flyout-width-dot",
1493
- style: p({
1493
+ style: m({
1494
1494
  width: F(e, "ink") + "px",
1495
1495
  height: F(e, "ink") + "px",
1496
1496
  background: t.inkColor
1497
1497
  })
1498
- }, null, 4)], 10, He))), 128))], 8, Y), o("div", {
1498
+ }, null, 4)], 10, Ue))), 128))], 8, He), o("div", {
1499
1499
  class: "coar-pdf-toolbar__flyout-row",
1500
1500
  role: "radiogroup",
1501
1501
  "aria-label": t.labels.annotationColor
1502
- }, [(g(!0), a(e, null, v(t.colors, (e) => (g(), a("button", {
1502
+ }, [(_(!0), a(e, null, y(t.colors, (e) => (_(), a("button", {
1503
1503
  key: e,
1504
1504
  type: "button",
1505
- class: f(["coar-pdf-toolbar__flyout-color", { "coar-pdf-toolbar__flyout-color--active": e === t.inkColor }]),
1505
+ class: p(["coar-pdf-toolbar__flyout-color", { "coar-pdf-toolbar__flyout-color--active": e === t.inkColor }]),
1506
1506
  title: e,
1507
1507
  "aria-checked": e === t.inkColor,
1508
1508
  role: "radio",
1509
- style: p({ background: e }),
1509
+ style: m({ background: e }),
1510
1510
  onClick: (t) => l("update:ink-color", e)
1511
- }, null, 14, X))), 128))], 8, Ue)])]),
1511
+ }, null, 14, We))), 128))], 8, Z)])]),
1512
1512
  _: 1
1513
- }, 8, ["label", "active"])) : n === "freetext" ? (g(), r(T(B), {
1513
+ }, 8, ["label", "active"])) : n === "freetext" ? (_(), r(E(B), {
1514
1514
  key: 20,
1515
1515
  icon: "type",
1516
1516
  label: t.labels.modeFreetext,
1517
1517
  active: t.annotationMode === "freetext",
1518
1518
  onClick: s[19] ||= (e) => l("set-annotation-mode", t.annotationMode === "freetext" ? "view" : "freetext")
1519
- }, null, 8, ["label", "active"])) : n === "search" ? (g(), r(T(B), {
1519
+ }, null, 8, ["label", "active"])) : n === "search" ? (_(), r(E(B), {
1520
1520
  key: 21,
1521
1521
  icon: "search",
1522
1522
  label: L("search", t.labels.search),
1523
1523
  disabled: I("search"),
1524
1524
  onClick: s[20] ||= (e) => l("search")
1525
- }, null, 8, ["label", "disabled"])) : n === "print" ? (g(), r(T(B), {
1525
+ }, null, 8, ["label", "disabled"])) : n === "print" ? (_(), r(E(B), {
1526
1526
  key: 22,
1527
1527
  icon: "printer",
1528
1528
  label: L("print", t.labels.print),
1529
1529
  disabled: I("print"),
1530
1530
  onClick: s[21] ||= (e) => l("print")
1531
- }, null, 8, ["label", "disabled"])) : n === "download" ? (g(), r(T(B), {
1531
+ }, null, 8, ["label", "disabled"])) : n === "download" ? (_(), r(E(B), {
1532
1532
  key: 23,
1533
1533
  icon: "download",
1534
1534
  label: t.labels.download,
1535
1535
  onClick: s[22] ||= (e) => l("download")
1536
- }, null, 8, ["label"])) : i("", !0)], 64))), 128)), n.$slots.actions ? y(n.$slots, "actions", { key: 0 }, void 0, !0) : i("", !0)]),
1536
+ }, null, 8, ["label"])) : i("", !0)], 64))), 128)), n.$slots.actions ? b(n.$slots, "actions", { key: 0 }, void 0, !0) : i("", !0)]),
1537
1537
  _: 3
1538
1538
  }, 8, ["side", "aria-label"]));
1539
1539
  }
1540
- }), Z = (e, t) => {
1540
+ }), Q = (e, t) => {
1541
1541
  let n = e.__vccOpts || e;
1542
1542
  for (let [e, r] of t) n[e] = r;
1543
1543
  return n;
1544
- }, Ge = /* @__PURE__ */ Z(We, [["__scopeId", "data-v-131f9026"]]), Ke = {
1544
+ }, Ke = /* @__PURE__ */ Q(Ge, [["__scopeId", "data-v-131f9026"]]), qe = {
1545
1545
  class: "coar-pdf-searchbar",
1546
1546
  role: "search"
1547
- }, qe = [
1547
+ }, Je = [
1548
1548
  "placeholder",
1549
1549
  "aria-label",
1550
1550
  "value"
1551
- ], Je = ["data-empty"], Ye = [
1551
+ ], Ye = ["data-empty"], Xe = [
1552
1552
  "disabled",
1553
1553
  "title",
1554
1554
  "aria-label"
1555
- ], Xe = [
1555
+ ], Ze = [
1556
1556
  "disabled",
1557
1557
  "title",
1558
1558
  "aria-label"
1559
- ], Ze = /* @__PURE__ */ Z(/* @__PURE__ */ l({
1559
+ ], Qe = /* @__PURE__ */ Q(/* @__PURE__ */ l({
1560
1560
  __name: "DocumentSearchBar",
1561
1561
  props: {
1562
1562
  query: {},
@@ -1572,20 +1572,20 @@ var Me = ["aria-label"], Ne = [
1572
1572
  "close"
1573
1573
  ],
1574
1574
  setup(e, { emit: t }) {
1575
- let r = e, i = t, s = _(null), l = _(r.query);
1576
- O(() => r.query, (e) => {
1575
+ let r = e, i = t, s = v(null), l = v(r.query);
1576
+ A(() => r.query, (e) => {
1577
1577
  e !== l.value && (l.value = e);
1578
1578
  });
1579
1579
  function u(e) {
1580
1580
  let t = e.target.value;
1581
1581
  l.value = t, i("update:query", t);
1582
1582
  }
1583
- function f(e) {
1583
+ function d(e) {
1584
1584
  e.key === "Enter" ? (e.preventDefault(), e.shiftKey ? i("prev") : i("next")) : e.key === "Escape" && (e.preventDefault(), i("close"));
1585
1585
  }
1586
1586
  let p = n(() => r.searching ? "…" : r.matchCount === 0 ? r.query ? "0" : "" : r.labels.searchMatchOf.replace("{current}", String(r.currentIndex + 1)).replace("{total}", String(r.matchCount)));
1587
- return d(() => s.value?.focus()), (t, n) => (g(), a("div", Ke, [
1588
- c(T(F), {
1587
+ return f(() => s.value?.focus()), (t, n) => (_(), a("div", qe, [
1588
+ c(E(L), {
1589
1589
  name: "search",
1590
1590
  size: "s",
1591
1591
  class: "coar-pdf-searchbar__icon"
@@ -1599,13 +1599,13 @@ var Me = ["aria-label"], Ne = [
1599
1599
  "aria-label": e.labels.search,
1600
1600
  value: l.value,
1601
1601
  onInput: u,
1602
- onKeydown: f
1603
- }, null, 40, qe),
1602
+ onKeydown: d
1603
+ }, null, 40, Je),
1604
1604
  o("span", {
1605
1605
  class: "coar-pdf-searchbar__count",
1606
1606
  "aria-live": "polite",
1607
1607
  "data-empty": !p.value
1608
- }, C(p.value), 9, Je),
1608
+ }, w(p.value), 9, Ye),
1609
1609
  o("button", {
1610
1610
  type: "button",
1611
1611
  class: "coar-pdf-searchbar__btn",
@@ -1613,10 +1613,10 @@ var Me = ["aria-label"], Ne = [
1613
1613
  title: e.labels.searchPrev,
1614
1614
  "aria-label": e.labels.searchPrev,
1615
1615
  onClick: n[0] ||= (e) => i("prev")
1616
- }, [c(T(F), {
1616
+ }, [c(E(L), {
1617
1617
  name: "chevron-up",
1618
1618
  size: "s"
1619
- })], 8, Ye),
1619
+ })], 8, Xe),
1620
1620
  o("button", {
1621
1621
  type: "button",
1622
1622
  class: "coar-pdf-searchbar__btn",
@@ -1624,23 +1624,23 @@ var Me = ["aria-label"], Ne = [
1624
1624
  title: e.labels.searchNext,
1625
1625
  "aria-label": e.labels.searchNext,
1626
1626
  onClick: n[1] ||= (e) => i("next")
1627
- }, [c(T(F), {
1627
+ }, [c(E(L), {
1628
1628
  name: "chevron-down",
1629
1629
  size: "s"
1630
- })], 8, Xe),
1630
+ })], 8, Ze),
1631
1631
  o("button", {
1632
1632
  type: "button",
1633
1633
  class: "coar-pdf-searchbar__btn",
1634
1634
  title: "Close",
1635
1635
  "aria-label": "Close",
1636
1636
  onClick: n[2] ||= (e) => i("close")
1637
- }, [c(T(F), {
1637
+ }, [c(E(L), {
1638
1638
  name: "x",
1639
1639
  size: "s"
1640
1640
  })])
1641
1641
  ]));
1642
1642
  }
1643
- }), [["__scopeId", "data-v-ec33c527"]]), Qe = { class: "coar-pdf-sidebar__outline-list" }, $e = ["onClick"], et = /* @__PURE__ */ l({
1643
+ }), [["__scopeId", "data-v-ec33c527"]]), $e = { class: "coar-pdf-sidebar__outline-list" }, et = ["onClick"], tt = /* @__PURE__ */ l({
1644
1644
  __name: "PdfOutlineList",
1645
1645
  props: {
1646
1646
  nodes: {
@@ -1655,16 +1655,16 @@ var Me = ["aria-label"], Ne = [
1655
1655
  emits: ["jump"],
1656
1656
  setup(t) {
1657
1657
  return (n, s) => {
1658
- let c = b("PdfOutlineList", !0);
1659
- return g(), a("ul", Qe, [(g(!0), a(e, null, v(t.nodes, (e, l) => (g(), a("li", {
1658
+ let c = x("PdfOutlineList", !0);
1659
+ return _(), a("ul", $e, [(_(!0), a(e, null, y(t.nodes, (e, l) => (_(), a("li", {
1660
1660
  key: l,
1661
1661
  class: "coar-pdf-sidebar__outline-item"
1662
1662
  }, [o("button", {
1663
1663
  type: "button",
1664
1664
  class: "coar-pdf-sidebar__outline-link",
1665
- style: p({ paddingLeft: `${8 + t.depth * 12}px` }),
1665
+ style: m({ paddingLeft: `${8 + t.depth * 12}px` }),
1666
1666
  onClick: (t) => n.$emit("jump", e)
1667
- }, C(e.title || "(untitled)"), 13, $e), e.items && e.items.length > 0 ? (g(), r(c, {
1667
+ }, w(e.title || "(untitled)"), 13, et), e.items && e.items.length > 0 ? (_(), r(c, {
1668
1668
  key: 0,
1669
1669
  nodes: e.items,
1670
1670
  depth: t.depth + 1,
@@ -1672,19 +1672,19 @@ var Me = ["aria-label"], Ne = [
1672
1672
  }, null, 8, ["nodes", "depth"])) : i("", !0)]))), 128))]);
1673
1673
  };
1674
1674
  }
1675
- }), tt = ["aria-label"], nt = { class: "coar-pdf-sidebar__header" }, Q = {
1675
+ }), nt = ["aria-label"], $ = { class: "coar-pdf-sidebar__header" }, rt = {
1676
1676
  class: "coar-pdf-sidebar__tabs",
1677
1677
  role: "tablist"
1678
- }, rt = ["aria-selected"], it = ["aria-selected"], at = [
1678
+ }, it = ["aria-selected"], at = ["aria-selected"], ot = [
1679
1679
  "data-thumb-page",
1680
1680
  "aria-label",
1681
1681
  "aria-current",
1682
1682
  "onClick"
1683
- ], ot = { class: "coar-pdf-sidebar__thumb-label" }, st = {
1683
+ ], st = { class: "coar-pdf-sidebar__thumb-label" }, ct = {
1684
1684
  key: 0,
1685
1685
  class: "coar-pdf-sidebar__outline",
1686
1686
  role: "tabpanel"
1687
- }, ct = 120, lt = /* @__PURE__ */ Z(/* @__PURE__ */ l({
1687
+ }, lt = 120, ut = /* @__PURE__ */ Q(/* @__PURE__ */ l({
1688
1688
  __name: "DocumentSidebar",
1689
1689
  props: {
1690
1690
  doc: {},
@@ -1697,73 +1697,73 @@ var Me = ["aria-label"], Ne = [
1697
1697
  },
1698
1698
  emits: ["jump", "close"],
1699
1699
  setup(t, { emit: s }) {
1700
- let l = t, u = s, p = _("thumbnails"), h = S(null), y = _(!1);
1701
- O(() => l.doc, async (e) => {
1702
- if (h.value = null, e) {
1703
- y.value = !0;
1700
+ let l = t, u = s, d = v("thumbnails"), m = C(null), g = v(!1);
1701
+ A(() => l.doc, async (e) => {
1702
+ if (m.value = null, e) {
1703
+ g.value = !0;
1704
1704
  try {
1705
1705
  let t = await e.getOutline();
1706
- !t || t.length === 0 ? h.value = null : h.value = t;
1706
+ !t || t.length === 0 ? m.value = null : m.value = t;
1707
1707
  } catch {
1708
- h.value = null;
1708
+ m.value = null;
1709
1709
  } finally {
1710
- y.value = !1;
1710
+ g.value = !1;
1711
1711
  }
1712
1712
  }
1713
1713
  }, { immediate: !0 });
1714
- let b = n(() => h.value && h.value.length > 0);
1715
- O(b, (e) => {
1716
- !e && p.value === "outline" && (p.value = "thumbnails");
1714
+ let b = n(() => m.value && m.value.length > 0);
1715
+ A(b, (e) => {
1716
+ !e && d.value === "outline" && (d.value = "thumbnails");
1717
1717
  });
1718
- let x = _(null), w = /* @__PURE__ */ new Set(), E = /* @__PURE__ */ new Set(), k = null;
1719
- async function j(e) {
1720
- if (w.has(e) || E.has(e)) return;
1718
+ let x = v(null), S = /* @__PURE__ */ new Set(), T = /* @__PURE__ */ new Set(), D = null;
1719
+ async function O(e) {
1720
+ if (S.has(e) || T.has(e)) return;
1721
1721
  let t = x.value?.querySelector(`[data-thumb-page="${e}"]`);
1722
1722
  if (!t) return;
1723
1723
  let n = l.pageProviders?.[e];
1724
1724
  if (n) {
1725
- E.add(e);
1725
+ T.add(e);
1726
1726
  try {
1727
- let r = typeof window > "u" ? 1 : Math.min(window.devicePixelRatio || 1, 2), i = ct / n.intrinsicWidth, a = t.querySelector("canvas");
1728
- a || (a = document.createElement("canvas"), a.className = "coar-pdf-sidebar__thumb-canvas", t.insertBefore(a, t.firstChild)), a.style.width = `${ct}px`, a.style.height = `${Math.floor(n.intrinsicHeight * i)}px`, await n.render(a, {
1727
+ let r = typeof window > "u" ? 1 : Math.min(window.devicePixelRatio || 1, 2), i = lt / n.intrinsicWidth, a = t.querySelector("canvas");
1728
+ a || (a = document.createElement("canvas"), a.className = "coar-pdf-sidebar__thumb-canvas", t.insertBefore(a, t.firstChild)), a.style.width = `${lt}px`, a.style.height = `${Math.floor(n.intrinsicHeight * i)}px`, await n.render(a, {
1729
1729
  scale: i,
1730
1730
  rotation: 0,
1731
1731
  dpr: r
1732
- }), w.add(e);
1732
+ }), S.add(e);
1733
1733
  } catch {} finally {
1734
- E.delete(e);
1734
+ T.delete(e);
1735
1735
  }
1736
1736
  }
1737
1737
  }
1738
- function M() {
1739
- k?.disconnect();
1738
+ function j() {
1739
+ D?.disconnect();
1740
1740
  let e = x.value;
1741
1741
  if (!(!e || typeof IntersectionObserver > "u")) {
1742
- k = new IntersectionObserver((e) => {
1742
+ D = new IntersectionObserver((e) => {
1743
1743
  for (let t of e) {
1744
1744
  if (!t.isIntersecting) continue;
1745
1745
  let e = Number(t.target.dataset.thumbPage);
1746
- Number.isFinite(e) && j(e);
1746
+ Number.isFinite(e) && O(e);
1747
1747
  }
1748
1748
  }, {
1749
1749
  root: e,
1750
1750
  rootMargin: "200px 0px",
1751
1751
  threshold: 0
1752
1752
  });
1753
- for (let t of e.querySelectorAll("[data-thumb-page]")) k.observe(t);
1753
+ for (let t of e.querySelectorAll("[data-thumb-page]")) D.observe(t);
1754
1754
  }
1755
1755
  }
1756
- O(() => [l.pageProviders, l.pageCount], async () => {
1757
- w.clear(), E.clear(), await d(), M();
1758
- }, { immediate: !0 }), O(p, async () => {
1759
- p.value === "thumbnails" && (await d(), M());
1760
- }), O(() => l.visiblePage, async (e) => {
1761
- p.value === "thumbnails" && (await d(), (x.value?.querySelector(`[data-thumb-page="${e}"]`))?.scrollIntoView({
1756
+ A(() => [l.pageProviders, l.pageCount], async () => {
1757
+ S.clear(), T.clear(), await f(), j();
1758
+ }, { immediate: !0 }), A(d, async () => {
1759
+ d.value === "thumbnails" && (await f(), j());
1760
+ }), A(() => l.visiblePage, async (e) => {
1761
+ d.value === "thumbnails" && (await f(), (x.value?.querySelector(`[data-thumb-page="${e}"]`))?.scrollIntoView({
1762
1762
  block: "nearest",
1763
1763
  behavior: "smooth"
1764
1764
  }));
1765
- }), m(() => {
1766
- k?.disconnect(), k = null;
1765
+ }), h(() => {
1766
+ D?.disconnect(), D = null;
1767
1767
  });
1768
1768
  async function N(e) {
1769
1769
  if (e.resolvedPageIndex != null) return e.resolvedPageIndex;
@@ -1787,59 +1787,59 @@ var Me = ["aria-label"], Ne = [
1787
1787
  let t = await N(e);
1788
1788
  t != null && u("jump", t);
1789
1789
  }
1790
- return (n, s) => (g(), a("aside", {
1790
+ return (n, s) => (_(), a("aside", {
1791
1791
  class: "coar-pdf-sidebar",
1792
1792
  "aria-label": t.labels.thumbnails
1793
1793
  }, [
1794
- o("div", nt, [o("div", Q, [t.showThumbnails ? (g(), a("button", {
1794
+ o("div", $, [o("div", rt, [t.showThumbnails ? (_(), a("button", {
1795
1795
  key: 0,
1796
1796
  type: "button",
1797
- class: f(["coar-pdf-sidebar__tab", { "coar-pdf-sidebar__tab--active": p.value === "thumbnails" }]),
1797
+ class: p(["coar-pdf-sidebar__tab", { "coar-pdf-sidebar__tab--active": d.value === "thumbnails" }]),
1798
1798
  role: "tab",
1799
- "aria-selected": p.value === "thumbnails",
1800
- onClick: s[0] ||= (e) => p.value = "thumbnails"
1801
- }, C(t.labels.thumbnails), 11, rt)) : i("", !0), t.showOutline && b.value ? (g(), a("button", {
1799
+ "aria-selected": d.value === "thumbnails",
1800
+ onClick: s[0] ||= (e) => d.value = "thumbnails"
1801
+ }, w(t.labels.thumbnails), 11, it)) : i("", !0), t.showOutline && b.value ? (_(), a("button", {
1802
1802
  key: 1,
1803
1803
  type: "button",
1804
- class: f(["coar-pdf-sidebar__tab", { "coar-pdf-sidebar__tab--active": p.value === "outline" }]),
1804
+ class: p(["coar-pdf-sidebar__tab", { "coar-pdf-sidebar__tab--active": d.value === "outline" }]),
1805
1805
  role: "tab",
1806
- "aria-selected": p.value === "outline",
1807
- onClick: s[1] ||= (e) => p.value = "outline"
1808
- }, C(t.labels.outline), 11, it)) : i("", !0)]), o("button", {
1806
+ "aria-selected": d.value === "outline",
1807
+ onClick: s[1] ||= (e) => d.value = "outline"
1808
+ }, w(t.labels.outline), 11, at)) : i("", !0)]), o("button", {
1809
1809
  type: "button",
1810
1810
  class: "coar-pdf-sidebar__close",
1811
1811
  title: "Close",
1812
1812
  "aria-label": "Close",
1813
1813
  onClick: s[2] ||= (e) => u("close")
1814
- }, [c(T(F), {
1814
+ }, [c(E(L), {
1815
1815
  name: "x",
1816
1816
  size: "s"
1817
1817
  })])]),
1818
- A(o("div", {
1818
+ M(o("div", {
1819
1819
  ref_key: "thumbsContainer",
1820
1820
  ref: x,
1821
1821
  class: "coar-pdf-sidebar__thumbs",
1822
1822
  role: "tabpanel"
1823
- }, [(g(!0), a(e, null, v(t.pageCount, (e) => (g(), a("button", {
1823
+ }, [(_(!0), a(e, null, y(t.pageCount, (e) => (_(), a("button", {
1824
1824
  key: e,
1825
1825
  type: "button",
1826
- class: f(["coar-pdf-sidebar__thumb", { "coar-pdf-sidebar__thumb--current": e - 1 === t.visiblePage }]),
1826
+ class: p(["coar-pdf-sidebar__thumb", { "coar-pdf-sidebar__thumb--current": e - 1 === t.visiblePage }]),
1827
1827
  "data-thumb-page": e - 1,
1828
1828
  "aria-label": `Page ${e}`,
1829
1829
  "aria-current": e - 1 === t.visiblePage ? "page" : void 0,
1830
1830
  onClick: (t) => u("jump", e - 1)
1831
- }, [o("span", ot, C(e), 1)], 10, at))), 128))], 512), [[D, p.value === "thumbnails" && t.showThumbnails]]),
1832
- p.value === "outline" ? (g(), a("div", st, [h.value ? (g(), r(et, {
1831
+ }, [o("span", st, w(e), 1)], 10, ot))), 128))], 512), [[k, d.value === "thumbnails" && t.showThumbnails]]),
1832
+ d.value === "outline" ? (_(), a("div", ct, [m.value ? (_(), r(tt, {
1833
1833
  key: 0,
1834
- nodes: h.value,
1834
+ nodes: m.value,
1835
1835
  onJump: P
1836
1836
  }, null, 8, ["nodes"])) : i("", !0)])) : i("", !0)
1837
- ], 8, tt));
1837
+ ], 8, nt));
1838
1838
  }
1839
- }), [["__scopeId", "data-v-d8662946"]]), ut = ["aria-label"], dt = ["aria-expanded"], ft = { class: "coar-pdf-info__title" }, pt = {
1839
+ }), [["__scopeId", "data-v-d8662946"]]), dt = ["aria-label"], ft = ["aria-expanded"], pt = { class: "coar-pdf-info__title" }, mt = {
1840
1840
  key: 0,
1841
1841
  class: "coar-pdf-info__body"
1842
- }, mt = { class: "coar-pdf-info__rows" }, ht = { class: "coar-pdf-info__dt" }, gt = { class: "coar-pdf-info__dd" }, $ = { class: "coar-pdf-info__rows" }, _t = { class: "coar-pdf-info__dt" }, vt = { class: "coar-pdf-info__dd" }, yt = { class: "coar-pdf-info__rows" }, bt = { class: "coar-pdf-info__dt" }, xt = { class: "coar-pdf-info__dd" }, St = /* @__PURE__ */ Z(/* @__PURE__ */ l({
1842
+ }, ht = { class: "coar-pdf-info__rows" }, gt = { class: "coar-pdf-info__dt" }, _t = { class: "coar-pdf-info__dd" }, vt = { class: "coar-pdf-info__rows" }, yt = { class: "coar-pdf-info__dt" }, bt = { class: "coar-pdf-info__dd" }, xt = { class: "coar-pdf-info__rows" }, St = { class: "coar-pdf-info__dt" }, Ct = { class: "coar-pdf-info__dd" }, wt = /* @__PURE__ */ Q(/* @__PURE__ */ l({
1843
1843
  __name: "DocumentInfoSection",
1844
1844
  props: {
1845
1845
  info: {},
@@ -1847,7 +1847,7 @@ var Me = ["aria-label"], Ne = [
1847
1847
  labels: {}
1848
1848
  },
1849
1849
  setup(t) {
1850
- let r = t, s = _(!0);
1850
+ let r = t, s = v(!0);
1851
1851
  function l() {
1852
1852
  s.value = !s.value;
1853
1853
  }
@@ -1859,7 +1859,7 @@ var Me = ["aria-label"], Ne = [
1859
1859
  let n = t / 1024;
1860
1860
  return n < 1024 ? `${n.toFixed(+(n < 10))} MB` : `${(n / 1024).toFixed(2)} GB`;
1861
1861
  }
1862
- let p = n(() => {
1862
+ let f = n(() => {
1863
1863
  let e = r.info;
1864
1864
  if (!e) return [];
1865
1865
  let t = [{
@@ -1918,49 +1918,49 @@ var Me = ["aria-label"], Ne = [
1918
1918
  value: e.version
1919
1919
  }), t;
1920
1920
  });
1921
- return (n, r) => t.info ? (g(), a("section", {
1921
+ return (n, r) => t.info ? (_(), a("section", {
1922
1922
  key: 0,
1923
- class: f(["coar-pdf-info", { "coar-pdf-info--collapsed": !s.value }]),
1923
+ class: p(["coar-pdf-info", { "coar-pdf-info--collapsed": !s.value }]),
1924
1924
  "aria-label": t.labels.infoSection
1925
1925
  }, [o("button", {
1926
1926
  type: "button",
1927
1927
  class: "coar-pdf-info__header",
1928
1928
  "aria-expanded": s.value,
1929
1929
  onClick: l
1930
- }, [c(T(F), {
1930
+ }, [c(E(L), {
1931
1931
  name: s.value ? "chevron-down" : "chevron-right",
1932
1932
  size: "xs"
1933
- }, null, 8, ["name"]), o("span", ft, C(t.labels.infoSection), 1)], 8, dt), s.value ? (g(), a("div", pt, [
1934
- o("dl", mt, [(g(!0), a(e, null, v(p.value, (t) => (g(), a(e, { key: t.label }, [o("dt", ht, C(t.label), 1), o("dd", gt, C(t.value), 1)], 64))), 128))]),
1935
- m.value.length > 0 ? (g(), a(e, { key: 0 }, [r[0] ||= o("div", {
1933
+ }, null, 8, ["name"]), o("span", pt, w(t.labels.infoSection), 1)], 8, ft), s.value ? (_(), a("div", mt, [
1934
+ o("dl", ht, [(_(!0), a(e, null, y(f.value, (t) => (_(), a(e, { key: t.label }, [o("dt", gt, w(t.label), 1), o("dd", _t, w(t.value), 1)], 64))), 128))]),
1935
+ m.value.length > 0 ? (_(), a(e, { key: 0 }, [r[0] ||= o("div", {
1936
1936
  class: "coar-pdf-info__divider",
1937
1937
  role: "separator"
1938
- }, null, -1), o("dl", $, [(g(!0), a(e, null, v(m.value, (t) => (g(), a(e, { key: t.label }, [o("dt", _t, C(t.label), 1), o("dd", vt, C(t.value), 1)], 64))), 128))])], 64)) : i("", !0),
1939
- h.value.length > 0 ? (g(), a(e, { key: 1 }, [r[1] ||= o("div", {
1938
+ }, null, -1), o("dl", vt, [(_(!0), a(e, null, y(m.value, (t) => (_(), a(e, { key: t.label }, [o("dt", yt, w(t.label), 1), o("dd", bt, w(t.value), 1)], 64))), 128))])], 64)) : i("", !0),
1939
+ h.value.length > 0 ? (_(), a(e, { key: 1 }, [r[1] ||= o("div", {
1940
1940
  class: "coar-pdf-info__divider",
1941
1941
  role: "separator"
1942
- }, null, -1), o("dl", yt, [(g(!0), a(e, null, v(h.value, (t) => (g(), a(e, { key: t.label }, [o("dt", bt, C(t.label), 1), o("dd", xt, C(t.value), 1)], 64))), 128))])], 64)) : i("", !0)
1943
- ])) : i("", !0)], 10, ut)) : i("", !0);
1942
+ }, null, -1), o("dl", xt, [(_(!0), a(e, null, y(h.value, (t) => (_(), a(e, { key: t.label }, [o("dt", St, w(t.label), 1), o("dd", Ct, w(t.value), 1)], 64))), 128))])], 64)) : i("", !0)
1943
+ ])) : i("", !0)], 10, dt)) : i("", !0);
1944
1944
  }
1945
- }), [["__scopeId", "data-v-36bce3d9"]]), Ct = ["aria-label"], wt = { class: "coar-pdf-anno-panel__header" }, Tt = { class: "coar-pdf-anno-panel__title" }, Et = ["title"], Dt = { class: "coar-pdf-anno-panel__controls" }, Ot = { class: "coar-pdf-anno-panel__search-row" }, kt = ["placeholder", "aria-label"], At = ["aria-label"], jt = [
1945
+ }), [["__scopeId", "data-v-36bce3d9"]]), Tt = ["aria-label"], Et = { class: "coar-pdf-anno-panel__header" }, Dt = { class: "coar-pdf-anno-panel__title" }, Ot = ["title"], kt = { class: "coar-pdf-anno-panel__controls" }, At = { class: "coar-pdf-anno-panel__search-row" }, jt = ["placeholder", "aria-label"], Mt = ["aria-label"], Nt = [
1946
1946
  "title",
1947
1947
  "aria-label",
1948
1948
  "aria-pressed",
1949
1949
  "onClick"
1950
- ], Mt = {
1950
+ ], Pt = {
1951
1951
  class: "coar-pdf-anno-panel__list",
1952
1952
  role: "list"
1953
- }, Nt = {
1953
+ }, Ft = {
1954
1954
  key: 0,
1955
1955
  class: "coar-pdf-anno-panel__empty"
1956
- }, Pt = {
1956
+ }, It = {
1957
1957
  key: 0,
1958
1958
  class: "coar-pdf-anno-panel__group-header"
1959
- }, Ft = [
1959
+ }, Lt = [
1960
1960
  "aria-current",
1961
1961
  "onClick",
1962
1962
  "onKeydown"
1963
- ], It = { class: "coar-pdf-anno-panel__item-body" }, Lt = { class: "coar-pdf-anno-panel__item-text" }, Rt = { class: "coar-pdf-anno-panel__item-meta" }, zt = ["title", "aria-label"], Bt = /* @__PURE__ */ Z(/* @__PURE__ */ l({
1963
+ ], Rt = { class: "coar-pdf-anno-panel__item-body" }, zt = { class: "coar-pdf-anno-panel__item-text" }, Bt = { class: "coar-pdf-anno-panel__item-meta" }, Vt = ["title", "aria-label"], Ht = /* @__PURE__ */ Q(/* @__PURE__ */ l({
1964
1964
  __name: "DocumentAnnotationPanel",
1965
1965
  props: {
1966
1966
  annotations: {},
@@ -1975,12 +1975,12 @@ var Me = ["aria-label"], Ne = [
1975
1975
  "close"
1976
1976
  ],
1977
1977
  setup(t, { emit: r }) {
1978
- let l = t, u = r, d = _("page"), m = _(""), h = _(new Set([
1978
+ let l = t, u = r, d = v("page"), f = v(""), h = v(new Set([
1979
1979
  "marker",
1980
1980
  "comment",
1981
1981
  "ink",
1982
1982
  "freetext"
1983
- ])), y = {
1983
+ ])), g = {
1984
1984
  marker: "highlighter",
1985
1985
  comment: "message-square",
1986
1986
  ink: "pencil",
@@ -1995,9 +1995,9 @@ var Me = ["aria-label"], Ne = [
1995
1995
  return e.type === "freetext" ? e.text || "" : e.comment || "";
1996
1996
  }
1997
1997
  let S = n(() => {
1998
- let e = m.value.trim().toLowerCase();
1998
+ let e = f.value.trim().toLowerCase();
1999
1999
  return l.annotations.filter((t) => h.value.has(t.type) ? e ? x(t).toLowerCase().includes(e) : !0 : !1);
2000
- }), w = n(() => {
2000
+ }), C = n(() => {
2001
2001
  if (d.value === "chronological") return [{
2002
2002
  pageIndex: -1,
2003
2003
  items: [...S.value].sort((e, t) => (e.createdAt || "").localeCompare(t.createdAt || ""))
@@ -2012,11 +2012,11 @@ var Me = ["aria-label"], Ne = [
2012
2012
  items: t
2013
2013
  }));
2014
2014
  });
2015
- function D(e) {
2015
+ function T(e) {
2016
2016
  let t = new Set(h.value);
2017
2017
  t.has(e) ? t.delete(e) : t.add(e), h.value = t;
2018
2018
  }
2019
- function O(e) {
2019
+ function D(e) {
2020
2020
  if (!e) return "";
2021
2021
  let t = new Date(e).getTime();
2022
2022
  if (Number.isNaN(t)) return "";
@@ -2026,7 +2026,7 @@ var Me = ["aria-label"], Ne = [
2026
2026
  let i = Math.round(r / 60);
2027
2027
  return i < 24 ? `${i}h` : `${Math.round(i / 24)}d`;
2028
2028
  }
2029
- let N = n(() => [{
2029
+ let k = n(() => [{
2030
2030
  value: "page",
2031
2031
  label: l.labels.sortByPage,
2032
2032
  icon: "file-text"
@@ -2035,11 +2035,11 @@ var Me = ["aria-label"], Ne = [
2035
2035
  label: l.labels.sortChronological,
2036
2036
  icon: "clock"
2037
2037
  }]);
2038
- return (n, r) => (g(), a("aside", {
2038
+ return (n, r) => (_(), a("aside", {
2039
2039
  class: "coar-pdf-anno-panel",
2040
2040
  "aria-label": t.labels.annotationsPanel
2041
2041
  }, [
2042
- c(St, {
2042
+ c(wt, {
2043
2043
  info: t.info ?? null,
2044
2044
  "current-page": t.currentPageInfo ?? null,
2045
2045
  labels: t.labels
@@ -2048,144 +2048,144 @@ var Me = ["aria-label"], Ne = [
2048
2048
  "current-page",
2049
2049
  "labels"
2050
2050
  ]),
2051
- o("div", wt, [
2052
- o("span", Tt, C(t.labels.annotationsPanel), 1),
2051
+ o("div", Et, [
2052
+ o("span", Dt, w(t.labels.annotationsPanel), 1),
2053
2053
  o("span", {
2054
2054
  class: "coar-pdf-anno-panel__count",
2055
2055
  title: `${S.value.length} / ${t.annotations.length}`
2056
- }, C(S.value.length) + "/" + C(t.annotations.length), 9, Et),
2056
+ }, w(S.value.length) + "/" + w(t.annotations.length), 9, Ot),
2057
2057
  o("button", {
2058
2058
  type: "button",
2059
2059
  class: "coar-pdf-anno-panel__close",
2060
2060
  title: "Close",
2061
2061
  "aria-label": "Close",
2062
2062
  onClick: r[0] ||= (e) => u("close")
2063
- }, [c(T(F), {
2063
+ }, [c(E(L), {
2064
2064
  name: "x",
2065
2065
  size: "s"
2066
2066
  })])
2067
2067
  ]),
2068
- o("div", Dt, [
2069
- c(T(te), {
2068
+ o("div", kt, [
2069
+ c(E(ne), {
2070
2070
  modelValue: d.value,
2071
2071
  "onUpdate:modelValue": r[1] ||= (e) => d.value = e,
2072
2072
  size: "xs",
2073
2073
  "full-width": "",
2074
- options: N.value,
2074
+ options: k.value,
2075
2075
  "aria-label": t.labels.sortBy
2076
2076
  }, null, 8, [
2077
2077
  "modelValue",
2078
2078
  "options",
2079
2079
  "aria-label"
2080
2080
  ]),
2081
- o("div", Ot, [c(T(F), {
2081
+ o("div", At, [c(E(L), {
2082
2082
  name: "search",
2083
2083
  size: "xs",
2084
2084
  class: "coar-pdf-anno-panel__search-icon"
2085
- }), A(o("input", {
2086
- "onUpdate:modelValue": r[2] ||= (e) => m.value = e,
2085
+ }), M(o("input", {
2086
+ "onUpdate:modelValue": r[2] ||= (e) => f.value = e,
2087
2087
  type: "search",
2088
2088
  class: "coar-pdf-anno-panel__search-input",
2089
2089
  placeholder: t.labels.searchAnnotations,
2090
2090
  "aria-label": t.labels.searchAnnotations
2091
- }, null, 8, kt), [[E, m.value]])]),
2091
+ }, null, 8, jt), [[O, f.value]])]),
2092
2092
  o("div", {
2093
2093
  class: "coar-pdf-anno-panel__filters",
2094
2094
  role: "group",
2095
2095
  "aria-label": t.labels.filterBy
2096
- }, [(g(), a(e, null, v(b, (e) => o("button", {
2096
+ }, [(_(), a(e, null, y(b, (e) => o("button", {
2097
2097
  key: e,
2098
2098
  type: "button",
2099
- class: f(["coar-pdf-anno-panel__filter", { "coar-pdf-anno-panel__filter--off": !h.value.has(e) }]),
2099
+ class: p(["coar-pdf-anno-panel__filter", { "coar-pdf-anno-panel__filter--off": !h.value.has(e) }]),
2100
2100
  title: e,
2101
2101
  "aria-label": e,
2102
2102
  "aria-pressed": h.value.has(e),
2103
- onClick: (t) => D(e)
2104
- }, [c(T(F), {
2105
- name: y[e],
2103
+ onClick: (t) => T(e)
2104
+ }, [c(E(L), {
2105
+ name: g[e],
2106
2106
  size: "xs"
2107
- }, null, 8, ["name"])], 10, jt)), 64))], 8, At)
2107
+ }, null, 8, ["name"])], 10, Nt)), 64))], 8, Mt)
2108
2108
  ]),
2109
- o("div", Mt, [S.value.length === 0 ? (g(), a("div", Nt, C(t.annotations.length === 0 ? t.labels.noAnnotations : t.labels.noMatchingAnnotations), 1)) : (g(!0), a(e, { key: 1 }, v(w.value, (n) => (g(), a(e, { key: n.pageIndex }, [d.value === "page" ? (g(), a("div", Pt, C(t.labels.pagePrefix) + " " + C(n.pageIndex + 1), 1)) : i("", !0), (g(!0), a(e, null, v(n.items, (n) => (g(), a("div", {
2109
+ o("div", Pt, [S.value.length === 0 ? (_(), a("div", Ft, w(t.annotations.length === 0 ? t.labels.noAnnotations : t.labels.noMatchingAnnotations), 1)) : (_(!0), a(e, { key: 1 }, y(C.value, (n) => (_(), a(e, { key: n.pageIndex }, [d.value === "page" ? (_(), a("div", It, w(t.labels.pagePrefix) + " " + w(n.pageIndex + 1), 1)) : i("", !0), (_(!0), a(e, null, y(n.items, (n) => (_(), a("div", {
2110
2110
  key: n.id,
2111
- class: f(["coar-pdf-anno-panel__item", { "coar-pdf-anno-panel__item--selected": n.id === t.selectedId }]),
2111
+ class: p(["coar-pdf-anno-panel__item", { "coar-pdf-anno-panel__item--selected": n.id === t.selectedId }]),
2112
2112
  role: "listitem",
2113
2113
  tabindex: "0",
2114
2114
  "aria-current": n.id === t.selectedId ? "true" : void 0,
2115
2115
  onClick: (e) => u("select", n.id),
2116
- onKeydown: [j(M((e) => u("select", n.id), ["prevent"]), ["enter"]), j(M((e) => u("select", n.id), ["prevent"]), ["space"])]
2116
+ onKeydown: [N(P((e) => u("select", n.id), ["prevent"]), ["enter"]), N(P((e) => u("select", n.id), ["prevent"]), ["space"])]
2117
2117
  }, [
2118
2118
  o("span", {
2119
2119
  class: "coar-pdf-anno-panel__item-icon",
2120
- style: p({ color: n.color })
2121
- }, [c(T(F), {
2122
- name: y[n.type],
2120
+ style: m({ color: n.color })
2121
+ }, [c(E(L), {
2122
+ name: g[n.type],
2123
2123
  size: "s"
2124
2124
  }, null, 8, ["name"])], 4),
2125
- o("span", It, [o("span", Lt, C(x(n) || `(${n.type})`), 1), o("span", Rt, [
2126
- n.createdBy ? (g(), a(e, { key: 0 }, [s(C(n.createdBy), 1)], 64)) : i("", !0),
2127
- n.createdBy && (d.value === "chronological" || n.createdAt) ? (g(), a(e, { key: 1 }, [s(" · ")], 64)) : i("", !0),
2128
- d.value === "chronological" ? (g(), a(e, { key: 2 }, [s(C(t.labels.pagePrefix) + " " + C(n.pageIndex + 1) + " · ", 1)], 64)) : i("", !0),
2129
- s(" " + C(O(n.createdAt)), 1)
2125
+ o("span", Rt, [o("span", zt, w(x(n) || `(${n.type})`), 1), o("span", Bt, [
2126
+ n.createdBy ? (_(), a(e, { key: 0 }, [s(w(n.createdBy), 1)], 64)) : i("", !0),
2127
+ n.createdBy && (d.value === "chronological" || n.createdAt) ? (_(), a(e, { key: 1 }, [s(" · ")], 64)) : i("", !0),
2128
+ d.value === "chronological" ? (_(), a(e, { key: 2 }, [s(w(t.labels.pagePrefix) + " " + w(n.pageIndex + 1) + " · ", 1)], 64)) : i("", !0),
2129
+ s(" " + w(D(n.createdAt)), 1)
2130
2130
  ])]),
2131
2131
  o("span", {
2132
2132
  class: "coar-pdf-anno-panel__item-menu-wrap",
2133
- onClick: r[3] ||= M(() => {}, ["stop"]),
2134
- onKeydown: r[4] ||= M(() => {}, ["stop"])
2135
- }, [c(T(ee), {
2133
+ onClick: r[3] ||= P(() => {}, ["stop"]),
2134
+ onKeydown: r[4] ||= P(() => {}, ["stop"])
2135
+ }, [c(E(te), {
2136
2136
  mode: "click",
2137
2137
  offset: 4
2138
2138
  }, {
2139
- default: k(() => [o("button", {
2139
+ default: j(() => [o("button", {
2140
2140
  type: "button",
2141
2141
  class: "coar-pdf-anno-panel__item-menu",
2142
2142
  title: t.labels.moreActions,
2143
2143
  "aria-label": t.labels.moreActions
2144
- }, [c(T(F), {
2144
+ }, [c(E(L), {
2145
2145
  name: "more-vertical",
2146
2146
  size: "xs"
2147
- })], 8, zt)]),
2148
- content: k(() => [c(T(I), null, {
2149
- default: k(() => [c(T(L), {
2147
+ })], 8, Vt)]),
2148
+ content: j(() => [c(E(R), null, {
2149
+ default: j(() => [c(E(ee), {
2150
2150
  icon: "trash-2",
2151
2151
  onClick: (e) => u("delete", n.id)
2152
2152
  }, {
2153
- default: k(() => [s(C(t.labels.annotationDelete), 1)]),
2153
+ default: j(() => [s(w(t.labels.annotationDelete), 1)]),
2154
2154
  _: 1
2155
2155
  }, 8, ["onClick"])]),
2156
2156
  _: 2
2157
2157
  }, 1024)]),
2158
2158
  _: 2
2159
2159
  }, 1024)], 32)
2160
- ], 42, Ft))), 128))], 64))), 128))])
2161
- ], 8, Ct));
2160
+ ], 42, Lt))), 128))], 64))), 128))])
2161
+ ], 8, Tt));
2162
2162
  }
2163
- }), [["__scopeId", "data-v-bacf840c"]]), Vt = ["aria-hidden"], Ht = [
2163
+ }), [["__scopeId", "data-v-bacf840c"]]), Ut = ["aria-hidden"], Wt = [
2164
2164
  "width",
2165
2165
  "height",
2166
2166
  "viewBox"
2167
- ], Ut = ["data-annotation-id"], Wt = [
2167
+ ], Gt = ["data-annotation-id"], Kt = [
2168
2168
  "data-stroke-index",
2169
2169
  "points",
2170
2170
  "stroke",
2171
2171
  "stroke-width",
2172
2172
  "onClick"
2173
- ], Gt = [
2173
+ ], qt = [
2174
2174
  "width",
2175
2175
  "height",
2176
2176
  "viewBox"
2177
- ], Kt = ["data-annotation-id"], qt = [
2177
+ ], Jt = ["data-annotation-id"], Yt = [
2178
2178
  "data-stroke-index",
2179
2179
  "points",
2180
2180
  "stroke",
2181
2181
  "stroke-width",
2182
2182
  "onClick"
2183
- ], Jt = ["data-annotation-id", "onClick"], Yt = [
2183
+ ], Xt = ["data-annotation-id", "onClick"], Zt = [
2184
2184
  "data-annotation-id",
2185
2185
  "title",
2186
2186
  "aria-label",
2187
2187
  "onClick"
2188
- ], Xt = /* @__PURE__ */ Z(/* @__PURE__ */ l({
2188
+ ], Qt = /* @__PURE__ */ Q(/* @__PURE__ */ l({
2189
2189
  __name: "AnnotationLayer",
2190
2190
  props: {
2191
2191
  annotations: {},
@@ -2219,7 +2219,7 @@ var Me = ["aria-label"], Ne = [
2219
2219
  function f(e) {
2220
2220
  return e.map((e) => `${e.x * s.displayWidth},${e.y * s.displayHeight}`).join(" ");
2221
2221
  }
2222
- let m = n(() => {
2222
+ let p = n(() => {
2223
2223
  let e = s.rotation ?? 0, t = s.displayWidth, n = s.displayHeight;
2224
2224
  switch (e) {
2225
2225
  case 90: return `translate(${n}px, 0) rotate(90deg)`;
@@ -2227,27 +2227,27 @@ var Me = ["aria-label"], Ne = [
2227
2227
  case 270: return `translate(0, ${t}px) rotate(270deg)`;
2228
2228
  default: return "none";
2229
2229
  }
2230
- }), h = n(() => s.annotations.filter((e) => e.type === "comment")), _ = n(() => s.annotations.filter((e) => e.type === "ink")), y = n(() => s.annotations.filter((e) => e.type === "marker")), b = n(() => s.annotations.filter((e) => e.type === "freetext"));
2231
- return (n, r) => (g(), a("div", {
2230
+ }), h = n(() => s.annotations.filter((e) => e.type === "comment")), g = n(() => s.annotations.filter((e) => e.type === "ink")), v = n(() => s.annotations.filter((e) => e.type === "marker")), b = n(() => s.annotations.filter((e) => e.type === "freetext"));
2231
+ return (n, r) => (_(), a("div", {
2232
2232
  class: "coar-pdf-annotation-layer",
2233
- style: p({
2233
+ style: m({
2234
2234
  width: t.displayWidth + "px",
2235
2235
  height: t.displayHeight + "px",
2236
- transform: m.value
2236
+ transform: p.value
2237
2237
  }),
2238
2238
  "aria-hidden": t.annotations.length === 0
2239
2239
  }, [
2240
- y.value.length > 0 ? (g(), a("svg", {
2240
+ v.value.length > 0 ? (_(), a("svg", {
2241
2241
  key: 0,
2242
2242
  class: "coar-pdf-annotation-marker",
2243
2243
  width: t.displayWidth,
2244
2244
  height: t.displayHeight,
2245
2245
  viewBox: `0 0 ${t.displayWidth} ${t.displayHeight}`,
2246
2246
  "aria-hidden": "true"
2247
- }, [(g(!0), a(e, null, v(y.value, (t) => (g(), a("g", {
2247
+ }, [(_(!0), a(e, null, y(v.value, (t) => (_(), a("g", {
2248
2248
  key: t.id,
2249
2249
  "data-annotation-id": t.id
2250
- }, [(g(!0), a(e, null, v(t.strokes, (e, n) => (g(), a("polyline", {
2250
+ }, [(_(!0), a(e, null, y(t.strokes, (e, n) => (_(), a("polyline", {
2251
2251
  key: n,
2252
2252
  "data-stroke-index": n,
2253
2253
  points: f(e),
@@ -2257,19 +2257,19 @@ var Me = ["aria-label"], Ne = [
2257
2257
  "stroke-linecap": "butt",
2258
2258
  "stroke-linejoin": "round",
2259
2259
  class: "coar-pdf-annotation-marker__stroke",
2260
- onClick: M((e) => c("annotation-click", t.id), ["stop"])
2261
- }, null, 8, Wt))), 128))], 8, Ut))), 128))], 8, Ht)) : i("", !0),
2262
- _.value.length > 0 ? (g(), a("svg", {
2260
+ onClick: P((e) => c("annotation-click", t.id), ["stop"])
2261
+ }, null, 8, Kt))), 128))], 8, Gt))), 128))], 8, Wt)) : i("", !0),
2262
+ g.value.length > 0 ? (_(), a("svg", {
2263
2263
  key: 1,
2264
2264
  class: "coar-pdf-annotation-ink",
2265
2265
  width: t.displayWidth,
2266
2266
  height: t.displayHeight,
2267
2267
  viewBox: `0 0 ${t.displayWidth} ${t.displayHeight}`,
2268
2268
  "aria-hidden": "true"
2269
- }, [(g(!0), a(e, null, v(_.value, (t) => (g(), a("g", {
2269
+ }, [(_(!0), a(e, null, y(g.value, (t) => (_(), a("g", {
2270
2270
  key: t.id,
2271
2271
  "data-annotation-id": t.id
2272
- }, [(g(!0), a(e, null, v(t.strokes, (e, n) => (g(), a("polyline", {
2272
+ }, [(_(!0), a(e, null, y(t.strokes, (e, n) => (_(), a("polyline", {
2273
2273
  key: n,
2274
2274
  "data-stroke-index": n,
2275
2275
  points: f(e),
@@ -2279,24 +2279,24 @@ var Me = ["aria-label"], Ne = [
2279
2279
  "stroke-linecap": "round",
2280
2280
  "stroke-linejoin": "round",
2281
2281
  class: "coar-pdf-annotation-ink__stroke",
2282
- onClick: M((e) => c("annotation-click", t.id), ["stop"])
2283
- }, null, 8, qt))), 128))], 8, Kt))), 128))], 8, Gt)) : i("", !0),
2284
- (g(!0), a(e, null, v(b.value, (e) => (g(), a("div", {
2282
+ onClick: P((e) => c("annotation-click", t.id), ["stop"])
2283
+ }, null, 8, Yt))), 128))], 8, Jt))), 128))], 8, qt)) : i("", !0),
2284
+ (_(!0), a(e, null, y(b.value, (e) => (_(), a("div", {
2285
2285
  key: e.id,
2286
2286
  class: "coar-pdf-annotation-freetext",
2287
- style: p(d(e)),
2287
+ style: m(d(e)),
2288
2288
  "data-annotation-id": e.id,
2289
- onClick: M((t) => c("annotation-click", e.id), ["stop"])
2290
- }, C(e.text), 13, Jt))), 128)),
2291
- (g(!0), a(e, null, v(h.value, (e) => (g(), a("button", {
2289
+ onClick: P((t) => c("annotation-click", e.id), ["stop"])
2290
+ }, w(e.text), 13, Xt))), 128)),
2291
+ (_(!0), a(e, null, y(h.value, (e) => (_(), a("button", {
2292
2292
  key: e.id,
2293
2293
  type: "button",
2294
2294
  class: "coar-pdf-annotation-pin",
2295
- style: p(u(e)),
2295
+ style: m(u(e)),
2296
2296
  "data-annotation-id": e.id,
2297
2297
  title: e.comment,
2298
2298
  "aria-label": e.comment,
2299
- onClick: M((t) => c("annotation-click", e.id), ["stop"])
2299
+ onClick: P((t) => c("annotation-click", e.id), ["stop"])
2300
2300
  }, [...r[0] ||= [o("svg", {
2301
2301
  viewBox: "0 0 24 24",
2302
2302
  width: "12",
@@ -2307,14 +2307,14 @@ var Me = ["aria-label"], Ne = [
2307
2307
  "stroke-linecap": "round",
2308
2308
  "stroke-linejoin": "round",
2309
2309
  "aria-hidden": "true"
2310
- }, [o("path", { d: "M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z" })], -1)]], 12, Yt))), 128))
2311
- ], 12, Vt));
2310
+ }, [o("path", { d: "M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z" })], -1)]], 12, Zt))), 128))
2311
+ ], 12, Ut));
2312
2312
  }
2313
- }), [["__scopeId", "data-v-28755751"]]), Zt = ["aria-label"], Qt = ["aria-label"], $t = [
2313
+ }), [["__scopeId", "data-v-28755751"]]), $t = ["aria-label"], en = ["aria-label"], tn = [
2314
2314
  "aria-label",
2315
2315
  "aria-checked",
2316
2316
  "onClick"
2317
- ], en = ["placeholder", "aria-label"], tn = { class: "coar-pdf-annotation-popover__actions" }, nn = ["title", "aria-label"], rn = /* @__PURE__ */ Z(/* @__PURE__ */ l({
2317
+ ], nn = ["placeholder", "aria-label"], rn = { class: "coar-pdf-annotation-popover__actions" }, an = ["title", "aria-label"], on = /* @__PURE__ */ Q(/* @__PURE__ */ l({
2318
2318
  __name: "AnnotationPopover",
2319
2319
  props: {
2320
2320
  anchor: {},
@@ -2330,75 +2330,75 @@ var Me = ["aria-label"], Ne = [
2330
2330
  "close"
2331
2331
  ],
2332
2332
  setup(s, { emit: c }) {
2333
- let l = s, u = c, y = _(null), b = _(null), x = _(l.initialComment), S = _(l.initialColor), w = _({
2333
+ let l = s, u = c, d = v(null), b = v(null), x = v(l.initialComment), S = v(l.initialColor), C = v({
2334
2334
  top: 0,
2335
2335
  left: 0
2336
2336
  });
2337
2337
  function T() {
2338
- let e = y.value;
2338
+ let e = d.value;
2339
2339
  if (!e) return;
2340
2340
  let t = e.offsetWidth, n = e.offsetHeight, r = l.anchor, i = r.bottom + 6, a = r.left;
2341
- i + n > window.innerHeight - 8 && (i = r.top - 6 - n), a = Math.max(8, Math.min(a, window.innerWidth - t - 8)), w.value = {
2341
+ i + n > window.innerHeight - 8 && (i = r.top - 6 - n), a = Math.max(8, Math.min(a, window.innerWidth - t - 8)), C.value = {
2342
2342
  top: i,
2343
2343
  left: a
2344
2344
  };
2345
2345
  }
2346
- function D() {
2346
+ function E() {
2347
2347
  l.draft || u("save", {
2348
2348
  comment: x.value,
2349
2349
  color: S.value
2350
2350
  });
2351
2351
  }
2352
- function k(e) {
2352
+ function D(e) {
2353
2353
  e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), l.draft ? u("save", {
2354
2354
  comment: x.value,
2355
2355
  color: S.value
2356
- }) : D(), b.value?.blur());
2356
+ }) : E(), b.value?.blur());
2357
2357
  }
2358
- function j(e) {
2359
- y.value && (y.value.contains(e.target) || u("close"));
2358
+ function k(e) {
2359
+ d.value && (d.value.contains(e.target) || u("close"));
2360
2360
  }
2361
- function N(e) {
2361
+ function j(e) {
2362
2362
  e.key === "Escape" && (e.preventDefault(), u("close"));
2363
2363
  }
2364
- h(async () => {
2365
- await d(), T(), window.addEventListener("resize", T), window.addEventListener("scroll", T, !0), setTimeout(() => {
2366
- document.addEventListener("mousedown", j), document.addEventListener("keydown", N);
2364
+ g(async () => {
2365
+ await f(), T(), window.addEventListener("resize", T), window.addEventListener("scroll", T, !0), setTimeout(() => {
2366
+ document.addEventListener("mousedown", k), document.addEventListener("keydown", j);
2367
2367
  }, 0), l.draft && b.value && b.value.focus();
2368
- }), m(() => {
2369
- window.removeEventListener("resize", T), window.removeEventListener("scroll", T, !0), document.removeEventListener("mousedown", j), document.removeEventListener("keydown", N);
2370
- }), O(() => l.anchor, T, { flush: "post" });
2371
- let P = n(() => x.value !== l.initialComment || S.value !== l.initialColor);
2372
- return (n, c) => (g(), r(t, { to: "body" }, [o("div", {
2368
+ }), h(() => {
2369
+ window.removeEventListener("resize", T), window.removeEventListener("scroll", T, !0), document.removeEventListener("mousedown", k), document.removeEventListener("keydown", j);
2370
+ }), A(() => l.anchor, T, { flush: "post" });
2371
+ let N = n(() => x.value !== l.initialComment || S.value !== l.initialColor);
2372
+ return (n, c) => (_(), r(t, { to: "body" }, [o("div", {
2373
2373
  ref_key: "root",
2374
- ref: y,
2374
+ ref: d,
2375
2375
  class: "coar-pdf-annotation-popover",
2376
2376
  role: "dialog",
2377
2377
  "aria-label": s.draft ? s.labels.modeNote : s.labels.annotationEditComment,
2378
- style: p({
2379
- top: w.value.top + "px",
2380
- left: w.value.left + "px"
2378
+ style: m({
2379
+ top: C.value.top + "px",
2380
+ left: C.value.left + "px"
2381
2381
  }),
2382
- onMousedown: c[4] ||= M(() => {}, ["stop"]),
2383
- onClick: c[5] ||= M(() => {}, ["stop"])
2382
+ onMousedown: c[4] ||= P(() => {}, ["stop"]),
2383
+ onClick: c[5] ||= P(() => {}, ["stop"])
2384
2384
  }, [
2385
2385
  o("div", {
2386
2386
  class: "coar-pdf-annotation-popover__swatches",
2387
2387
  role: "radiogroup",
2388
2388
  "aria-label": s.labels.annotationColor
2389
- }, [(g(!0), a(e, null, v(s.colors, (e) => (g(), a("button", {
2389
+ }, [(_(!0), a(e, null, y(s.colors, (e) => (_(), a("button", {
2390
2390
  key: e,
2391
2391
  type: "button",
2392
- class: f(["coar-pdf-annotation-popover__swatch", { "coar-pdf-annotation-popover__swatch--active": e === S.value }]),
2393
- style: p({ background: e }),
2392
+ class: p(["coar-pdf-annotation-popover__swatch", { "coar-pdf-annotation-popover__swatch--active": e === S.value }]),
2393
+ style: m({ background: e }),
2394
2394
  "aria-label": e,
2395
2395
  "aria-checked": e === S.value,
2396
2396
  role: "radio",
2397
2397
  onClick: (t) => {
2398
- S.value = e, D();
2398
+ S.value = e, E();
2399
2399
  }
2400
- }, null, 14, $t))), 128))], 8, Qt),
2401
- A(o("textarea", {
2400
+ }, null, 14, tn))), 128))], 8, en),
2401
+ M(o("textarea", {
2402
2402
  ref_key: "textareaRef",
2403
2403
  ref: b,
2404
2404
  "onUpdate:modelValue": c[0] ||= (e) => x.value = e,
@@ -2406,10 +2406,10 @@ var Me = ["aria-label"], Ne = [
2406
2406
  rows: "3",
2407
2407
  placeholder: s.labels.annotationEditComment,
2408
2408
  "aria-label": s.labels.annotationEditComment,
2409
- onBlur: D,
2410
- onKeydown: k
2411
- }, null, 40, en), [[E, x.value]]),
2412
- o("div", tn, [s.draft ? (g(), a(e, { key: 0 }, [o("button", {
2409
+ onBlur: E,
2410
+ onKeydown: D
2411
+ }, null, 40, nn), [[O, x.value]]),
2412
+ o("div", rn, [s.draft ? (_(), a(e, { key: 0 }, [o("button", {
2413
2413
  type: "button",
2414
2414
  class: "coar-pdf-annotation-popover__btn coar-pdf-annotation-popover__btn--ghost",
2415
2415
  onClick: c[1] ||= (e) => u("close")
@@ -2420,35 +2420,35 @@ var Me = ["aria-label"], Ne = [
2420
2420
  comment: x.value,
2421
2421
  color: S.value
2422
2422
  })
2423
- }, "Save")], 64)) : (g(), a(e, { key: 1 }, [o("button", {
2423
+ }, "Save")], 64)) : (_(), a(e, { key: 1 }, [o("button", {
2424
2424
  type: "button",
2425
2425
  class: "coar-pdf-annotation-popover__btn coar-pdf-annotation-popover__btn--danger",
2426
2426
  title: s.labels.annotationDelete,
2427
2427
  "aria-label": s.labels.annotationDelete,
2428
2428
  onClick: c[3] ||= (e) => u("delete")
2429
- }, C(s.labels.annotationDelete), 9, nn), P.value ? (g(), a("button", {
2429
+ }, w(s.labels.annotationDelete), 9, an), N.value ? (_(), a("button", {
2430
2430
  key: 0,
2431
2431
  type: "button",
2432
2432
  class: "coar-pdf-annotation-popover__btn coar-pdf-annotation-popover__btn--primary",
2433
- onClick: D
2433
+ onClick: E
2434
2434
  }, "Save")) : i("", !0)], 64))])
2435
- ], 44, Zt)]));
2435
+ ], 44, $t)]));
2436
2436
  }
2437
- }), [["__scopeId", "data-v-a956f092"]]), an = ["data-status"], on = { class: "coar-pdf-viewer__center" }, sn = { class: "coar-pdf-viewer__body" }, cn = {
2437
+ }), [["__scopeId", "data-v-a956f092"]]), sn = ["data-status"], cn = { class: "coar-pdf-viewer__center" }, ln = { class: "coar-pdf-viewer__body" }, un = {
2438
2438
  key: 0,
2439
2439
  class: "coar-pdf-viewer__pages"
2440
- }, ln = ["data-page-index", "aria-label"], un = {
2440
+ }, dn = ["data-page-index", "aria-label"], fn = {
2441
2441
  key: 1,
2442
2442
  class: "coar-pdf-viewer__overlay coar-pdf-viewer__overlay--loading",
2443
2443
  role: "status",
2444
2444
  "aria-live": "polite"
2445
- }, dn = {
2445
+ }, pn = {
2446
2446
  key: 5,
2447
2447
  class: "coar-pdf-viewer__overlay coar-pdf-viewer__overlay--error",
2448
2448
  role: "alert"
2449
- }, fn = { class: "coar-pdf-viewer__error-body" }, pn = { class: "coar-pdf-viewer__error-title" }, mn = 32, hn = 220, gn = 160, _n = 280, vn = 220, yn = 320, bn = /* @__PURE__ */ Z(/* @__PURE__ */ l({
2449
+ }, mn = { class: "coar-pdf-viewer__error-body" }, hn = { class: "coar-pdf-viewer__error-title" }, gn = 32, _n = 220, vn = 160, yn = 280, bn = 220, xn = 320, Sn = /* @__PURE__ */ Q(/* @__PURE__ */ l({
2450
2450
  __name: "CoarDocumentViewer",
2451
- props: {
2451
+ props: /* @__PURE__ */ u({
2452
2452
  source: {},
2453
2453
  showToolbar: {
2454
2454
  type: Boolean,
@@ -2498,16 +2498,27 @@ var Me = ["aria-label"], Ne = [
2498
2498
  "#ec4899"
2499
2499
  ] },
2500
2500
  labels: { default: () => ({}) }
2501
- },
2502
- emits: [
2501
+ }, {
2502
+ sidebarOpen: {
2503
+ type: Boolean,
2504
+ default: !1
2505
+ },
2506
+ sidebarOpenModifiers: {},
2507
+ annotationsPanelOpen: {
2508
+ type: Boolean,
2509
+ default: !1
2510
+ },
2511
+ annotationsPanelOpenModifiers: {}
2512
+ }),
2513
+ emits: /* @__PURE__ */ u([
2503
2514
  "update:position",
2504
2515
  "update:annotationMode",
2505
2516
  "annotation:create",
2506
2517
  "annotation:update",
2507
2518
  "annotation:delete",
2508
2519
  "error"
2509
- ],
2510
- setup(t, { expose: l, emit: m }) {
2520
+ ], ["update:sidebarOpen", "update:annotationsPanelOpen"]),
2521
+ setup(t, { expose: l, emit: u }) {
2511
2522
  let h = [
2512
2523
  .25,
2513
2524
  .33,
@@ -2525,7 +2536,7 @@ var Me = ["aria-label"], Ne = [
2525
2536
  3,
2526
2537
  3.5,
2527
2538
  4
2528
- ], b = h[0], x = h[h.length - 1], S = t, E = m, D = {
2539
+ ], g = h[0], x = h[h.length - 1], S = t, C = u, O = D(t, "sidebarOpen"), k = D(t, "annotationsPanelOpen"), j = {
2529
2540
  loading: "Loading PDF…",
2530
2541
  errorTitle: "Could not load the PDF.",
2531
2542
  errorRetry: "Retry",
@@ -2588,36 +2599,36 @@ var Me = ["aria-label"], Ne = [
2588
2599
  infoCreated: "Created",
2589
2600
  infoModified: "Modified",
2590
2601
  infoPdfVersion: "PDF version"
2591
- }, k = n(() => ({
2592
- ...D,
2602
+ }, M = n(() => ({
2603
+ ...j,
2593
2604
  ...S.labels
2594
- })), A = _(1), j = _(0), M = _(null), N = _("select"), P = _(!1), { status: F, pdfDoc: I, pageProviders: L, info: ee, error: te, retry: R, destroy: ne } = de(n(() => S.source)), z = pe({
2595
- pageProviders: L,
2596
- scale: A,
2597
- rotation: j,
2598
- scrollContainer: M
2599
- }), B = n(() => z.pages.length);
2605
+ })), N = v(1), P = v(0), F = v(null), I = v("select"), L = v(!1), { status: R, pdfDoc: ee, pageProviders: te, info: ne, error: re, retry: z, destroy: ie } = de(n(() => S.source)), B = pe({
2606
+ pageProviders: te,
2607
+ scale: N,
2608
+ rotation: P,
2609
+ scrollContainer: F
2610
+ }), V = n(() => B.pages.length);
2600
2611
  _e({
2601
2612
  storageKey: n(() => S.storageKey),
2602
2613
  externalPosition: n(() => S.position),
2603
- ready: n(() => F.value === "ready"),
2604
- scrollContainer: M,
2605
- pages: z.pages,
2606
- visiblePage: z.visiblePage,
2607
- scale: A,
2608
- rotation: j,
2609
- emitPosition: (e) => E("update:position", e)
2614
+ ready: n(() => R.value === "ready"),
2615
+ scrollContainer: F,
2616
+ pages: B.pages,
2617
+ visiblePage: B.visiblePage,
2618
+ scale: N,
2619
+ rotation: P,
2620
+ emitPosition: (e) => C("update:position", e)
2610
2621
  });
2611
- let V = Ce({
2622
+ let H = Te({
2612
2623
  mode: n(() => S.annotationMode),
2613
2624
  annotations: n(() => S.annotations),
2614
- pages: z.pages,
2615
- scrollContainer: M,
2625
+ pages: B.pages,
2626
+ scrollContainer: F,
2616
2627
  colors: n(() => S.annotationColors),
2617
- emitCreate: (e) => E("annotation:create", e),
2618
- emitUpdate: (e) => E("annotation:update", e),
2619
- emitDelete: (e) => E("annotation:delete", e)
2620
- }), re = n(() => {
2628
+ emitCreate: (e) => C("annotation:create", e),
2629
+ emitUpdate: (e) => C("annotation:update", e),
2630
+ emitDelete: (e) => C("annotation:delete", e)
2631
+ }), ae = n(() => {
2621
2632
  let e = /* @__PURE__ */ new Map();
2622
2633
  for (let t of S.annotations) {
2623
2634
  let n = e.get(t.pageIndex);
@@ -2625,8 +2636,8 @@ var Me = ["aria-label"], Ne = [
2625
2636
  }
2626
2637
  return e;
2627
2638
  });
2628
- function ie(e) {
2629
- let t = re.value.get(e) ?? [], n = V.draftInk.value;
2639
+ function U(e) {
2640
+ let t = ae.value.get(e) ?? [], n = H.draftInk.value;
2630
2641
  if (n && n.pageIndex === e) {
2631
2642
  let r = {
2632
2643
  id: "__coar-pdf-draft-stroke__",
@@ -2641,93 +2652,92 @@ var Me = ["aria-label"], Ne = [
2641
2652
  }
2642
2653
  return t;
2643
2654
  }
2644
- function H(e) {
2645
- let t = M.value?.querySelector(`[data-annotation-id="${CSS.escape(e)}"]`);
2655
+ function oe(e) {
2656
+ let t = F.value?.querySelector(`[data-annotation-id="${CSS.escape(e)}"]`);
2646
2657
  return t ? t.getBoundingClientRect() : null;
2647
2658
  }
2648
- let ae = _(null);
2649
- function oe() {
2650
- let e = V.selectedAnnotationId.value;
2651
- ae.value = e ? H(e) : null;
2659
+ let W = v(null);
2660
+ function se() {
2661
+ let e = H.selectedAnnotationId.value;
2662
+ W.value = e ? oe(e) : null;
2652
2663
  }
2653
- O(() => V.selectedAnnotationId.value, oe, { flush: "post" }), O([
2654
- A,
2655
- j,
2664
+ A(() => H.selectedAnnotationId.value, se, { flush: "post" }), A([
2665
+ N,
2666
+ P,
2656
2667
  () => S.annotations
2657
2668
  ], () => {
2658
- V.selectedAnnotationId.value && requestAnimationFrame(() => requestAnimationFrame(oe));
2669
+ H.selectedAnnotationId.value && requestAnimationFrame(() => requestAnimationFrame(se));
2659
2670
  });
2660
- function se(e) {
2661
- S.annotationMode === "eraser" || S.annotationMode === "select" || V.selectAnnotation(e);
2662
- }
2663
2671
  function ce(e) {
2664
- E("update:annotationMode", e), V.selectAnnotation(null), e === "marker" && !V.markerColor.value ? V.markerColor.value = S.annotationColors[0] ?? "#fde68a" : e === "ink" && !V.inkColor.value && (V.inkColor.value = S.annotationColors[0] ?? "#dc2626");
2672
+ S.annotationMode === "eraser" || S.annotationMode === "select" || H.selectAnnotation(e);
2665
2673
  }
2666
- function le() {
2667
- return V.selectedAnnotation.value?.type === "freetext" ? "text" : "comment";
2674
+ function le(e) {
2675
+ C("update:annotationMode", e), H.selectAnnotation(null), e === "marker" && !H.markerColor.value ? H.markerColor.value = S.annotationColors[0] ?? "#fde68a" : e === "ink" && !H.inkColor.value && (H.inkColor.value = S.annotationColors[0] ?? "#dc2626");
2668
2676
  }
2669
- let ue = n(() => {
2670
- let e = V.selectedAnnotation.value;
2677
+ function ue() {
2678
+ return H.selectedAnnotation.value?.type === "freetext" ? "text" : "comment";
2679
+ }
2680
+ let fe = n(() => {
2681
+ let e = H.selectedAnnotation.value;
2671
2682
  return e ? (e.type === "freetext" ? e.text : e.comment) ?? "" : "";
2672
2683
  });
2673
- function fe(e) {
2674
- let t = V.selectedAnnotation.value;
2684
+ function me(e) {
2685
+ let t = H.selectedAnnotation.value;
2675
2686
  if (!t) return;
2676
- let n = le(), r = n === "text" && t.type === "freetext" ? t.text : t.comment, i = {};
2677
- e.comment !== r && (i[n] = e.comment), e.color !== t.color && (i.color = e.color), Object.keys(i).length !== 0 && E("annotation:update", {
2687
+ let n = ue(), r = n === "text" && t.type === "freetext" ? t.text : t.comment, i = {};
2688
+ e.comment !== r && (i[n] = e.comment), e.color !== t.color && (i.color = e.color), Object.keys(i).length !== 0 && C("annotation:update", {
2678
2689
  id: t.id,
2679
2690
  patch: i
2680
2691
  });
2681
2692
  }
2682
- function me() {
2683
- let e = V.selectedAnnotationId.value;
2684
- e && (E("annotation:delete", e), V.selectAnnotation(null));
2685
- }
2686
2693
  function he() {
2687
- V.selectAnnotation(null);
2694
+ let e = H.selectedAnnotationId.value;
2695
+ e && (C("annotation:delete", e), H.selectAnnotation(null));
2688
2696
  }
2689
- function ge(e) {
2690
- V.commitDraftPin(e.comment, e.color);
2697
+ function ge() {
2698
+ H.selectAnnotation(null);
2691
2699
  }
2692
2700
  function ve(e) {
2693
- V.commitDraftFreetext(e.comment, e.color);
2701
+ H.commitDraftPin(e.comment, e.color);
2702
+ }
2703
+ function ye(e) {
2704
+ H.commitDraftFreetext(e.comment, e.color);
2694
2705
  }
2695
- let ye = _(!1), U = Oe({ doc: I }), W = _(!1);
2696
- function be() {
2697
- W.value = !W.value;
2706
+ let be = v(!1), G = ke({ doc: ee });
2707
+ function xe() {
2708
+ O.value = !O.value;
2698
2709
  }
2699
- let G = _(!1);
2700
- function we() {
2701
- G.value = !G.value;
2710
+ function Se() {
2711
+ k.value = !k.value;
2702
2712
  }
2703
- let K = _(hn), q = _(_n), Te = _(null), Ee = _(null);
2713
+ let K = v(_n), q = v(yn), J = v(null), Ee = v(null);
2704
2714
  function De(e, t) {
2705
- t.preventDefault(), Te.value = e;
2715
+ t.preventDefault(), J.value = e;
2706
2716
  let n = t.clientX, r = K.value, i = q.value;
2707
2717
  function a(t) {
2708
2718
  let a = Ee.value?.getBoundingClientRect().width ?? 0;
2709
2719
  if (!a) return;
2710
- let o = e === "sidebar" ? G.value ? q.value : 0 : W.value ? K.value : 0, s = +!!W.value + +!!G.value, c = a - o - yn - s, l = t.clientX - n;
2711
- e === "sidebar" ? K.value = Math.min(Math.max(r + l, gn), Math.max(gn, c)) : q.value = Math.min(Math.max(i - l, vn), Math.max(vn, c));
2720
+ let o = e === "sidebar" ? k.value ? q.value : 0 : O.value ? K.value : 0, s = +!!O.value + +!!k.value, c = a - o - xn - s, l = t.clientX - n;
2721
+ e === "sidebar" ? K.value = Math.min(Math.max(r + l, vn), Math.max(vn, c)) : q.value = Math.min(Math.max(i - l, bn), Math.max(bn, c));
2712
2722
  }
2713
2723
  function o() {
2714
- Te.value = null, window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o), window.removeEventListener("pointercancel", o);
2724
+ J.value = null, window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o), window.removeEventListener("pointercancel", o);
2715
2725
  }
2716
2726
  window.addEventListener("pointermove", a), window.addEventListener("pointerup", o), window.addEventListener("pointercancel", o);
2717
2727
  }
2718
- function ke(e) {
2728
+ function Oe(e) {
2719
2729
  let t = S.annotations.find((t) => t.id === e);
2720
- t && (V.selectAnnotation(e), z.scrollToPage(t.pageIndex, { behavior: "smooth" }));
2730
+ t && (H.selectAnnotation(e), B.scrollToPage(t.pageIndex, { behavior: "smooth" }));
2721
2731
  }
2722
2732
  function Ae(e) {
2723
- E("annotation:delete", e), V.selectedAnnotationId.value === e && V.selectAnnotation(null);
2733
+ C("annotation:delete", e), H.selectedAnnotationId.value === e && H.selectAnnotation(null);
2724
2734
  }
2725
2735
  function je(e) {
2726
- z.scrollToPage(e, { behavior: "smooth" });
2736
+ B.scrollToPage(e, { behavior: "smooth" });
2727
2737
  }
2728
2738
  let Me = n(() => {
2729
2739
  let e = /* @__PURE__ */ new Map();
2730
- for (let t of U.matches.value) {
2740
+ for (let t of G.matches.value) {
2731
2741
  let n = e.get(t.pageIndex);
2732
2742
  n ? n.push(t) : e.set(t.pageIndex, [t]);
2733
2743
  }
@@ -2736,14 +2746,14 @@ var Me = ["aria-label"], Ne = [
2736
2746
  function Ne(e) {
2737
2747
  return Me.value.get(e) ?? [];
2738
2748
  }
2739
- function J(e, t) {
2749
+ function Y(e, t) {
2740
2750
  return {
2741
- w: e * A.value,
2742
- h: t * A.value
2751
+ w: e * N.value,
2752
+ h: t * N.value
2743
2753
  };
2744
2754
  }
2745
2755
  let Pe = n(() => (e, t) => {
2746
- switch (j.value) {
2756
+ switch (P.value) {
2747
2757
  case 90: return `translate(${t}px, 0) rotate(90deg)`;
2748
2758
  case 180: return `translate(${e}px, ${t}px) rotate(180deg)`;
2749
2759
  case 270: return `translate(0, ${e}px) rotate(270deg)`;
@@ -2751,21 +2761,21 @@ var Me = ["aria-label"], Ne = [
2751
2761
  }
2752
2762
  });
2753
2763
  function Fe(e) {
2754
- return U.currentMatch.value === e;
2764
+ return G.currentMatch.value === e;
2755
2765
  }
2756
2766
  function Ie() {
2757
- ye.value = !0;
2767
+ be.value = !0;
2758
2768
  }
2759
2769
  function Le() {
2760
- ye.value = !1, U.clear();
2770
+ be.value = !1, G.clear();
2761
2771
  }
2762
2772
  function Re(e) {
2763
- U.setQuery(e);
2773
+ G.setQuery(e);
2764
2774
  }
2765
- O(() => U.currentMatch.value, (e) => {
2766
- e && (z.scrollToPage(e.pageIndex, { behavior: "smooth" }), requestAnimationFrame(() => {
2775
+ A(() => G.currentMatch.value, (e) => {
2776
+ e && (B.scrollToPage(e.pageIndex, { behavior: "smooth" }), requestAnimationFrame(() => {
2767
2777
  requestAnimationFrame(() => {
2768
- let t = M.value, n = z.pages[e.pageIndex];
2778
+ let t = F.value, n = B.pages[e.pageIndex];
2769
2779
  if (!t || !n?.wrapper) return;
2770
2780
  let r = e.rects[0];
2771
2781
  if (!r) return;
@@ -2775,63 +2785,63 @@ var Me = ["aria-label"], Ne = [
2775
2785
  }));
2776
2786
  });
2777
2787
  function ze(e) {
2778
- return (t) => z.bindWrapper(e, t);
2788
+ return (t) => B.bindWrapper(e, t);
2779
2789
  }
2780
2790
  function Be(e) {
2781
- return Math.max(b, Math.min(x, e));
2791
+ return Math.max(g, Math.min(x, e));
2782
2792
  }
2783
2793
  function Ve(e) {
2784
2794
  return Math.round(e * 100) / 100;
2785
2795
  }
2786
- function Y(e) {
2787
- let t = M.value, n = z.visiblePage.value, r = z.pages[n], i = 0;
2796
+ function X(e) {
2797
+ let t = F.value, n = B.visiblePage.value, r = B.pages[n], i = 0;
2788
2798
  if (t && r?.wrapper) {
2789
2799
  let e = r.wrapper.offsetTop - t.offsetTop;
2790
2800
  i = Math.max(0, Math.min(1, (t.scrollTop - e) / Math.max(1, r.displayHeight)));
2791
2801
  }
2792
- e(), d(() => {
2793
- let e = M.value, t = z.pages[n];
2802
+ e(), f(() => {
2803
+ let e = F.value, t = B.pages[n];
2794
2804
  if (!e || !t?.wrapper) return;
2795
2805
  let r = e.style.scrollBehavior;
2796
2806
  e.style.scrollBehavior = "auto", e.scrollTop = t.wrapper.offsetTop - e.offsetTop + i * t.displayHeight, e.style.scrollBehavior = r;
2797
2807
  });
2798
2808
  }
2799
2809
  function He() {
2800
- let e = A.value, t = h.find((t) => t > e + 1e-6);
2801
- t !== void 0 && Y(() => {
2802
- A.value = t;
2810
+ let e = N.value, t = h.find((t) => t > e + 1e-6);
2811
+ t !== void 0 && X(() => {
2812
+ N.value = t;
2803
2813
  });
2804
2814
  }
2805
2815
  function Ue() {
2806
- let e = A.value, t;
2816
+ let e = N.value, t;
2807
2817
  for (let n of h) if (n < e - 1e-6) t = n;
2808
2818
  else break;
2809
- t !== void 0 && Y(() => {
2810
- A.value = t;
2819
+ t !== void 0 && X(() => {
2820
+ N.value = t;
2811
2821
  });
2812
2822
  }
2813
- function X(e) {
2814
- Y(() => {
2815
- A.value = Be(Ve(e));
2823
+ function Z(e) {
2824
+ X(() => {
2825
+ N.value = Be(Ve(e));
2816
2826
  });
2817
2827
  }
2818
2828
  function We() {
2819
- let e = M.value, t = z.pages[z.visiblePage.value] ?? z.pages[0];
2829
+ let e = F.value, t = B.pages[B.visiblePage.value] ?? B.pages[0];
2820
2830
  if (!e || !t) return;
2821
- let n = e.clientWidth - mn;
2822
- n <= 0 || X(n / (j.value === 90 || j.value === 270 ? t.intrinsicHeight : t.intrinsicWidth));
2831
+ let n = e.clientWidth - gn;
2832
+ n <= 0 || Z(n / (P.value === 90 || P.value === 270 ? t.intrinsicHeight : t.intrinsicWidth));
2823
2833
  }
2824
- function Z() {
2825
- let e = M.value, t = z.pages[z.visiblePage.value] ?? z.pages[0];
2834
+ function Ge() {
2835
+ let e = F.value, t = B.pages[B.visiblePage.value] ?? B.pages[0];
2826
2836
  if (!e || !t) return;
2827
- let n = e.clientWidth - mn, r = e.clientHeight - mn;
2837
+ let n = e.clientWidth - gn, r = e.clientHeight - gn;
2828
2838
  if (n <= 0 || r <= 0) return;
2829
- let i = j.value === 90 || j.value === 270, a = i ? t.intrinsicHeight : t.intrinsicWidth, o = i ? t.intrinsicWidth : t.intrinsicHeight;
2830
- X(Math.min(n / a, r / o));
2839
+ let i = P.value === 90 || P.value === 270, a = i ? t.intrinsicHeight : t.intrinsicWidth, o = i ? t.intrinsicWidth : t.intrinsicHeight;
2840
+ Z(Math.min(n / a, r / o));
2831
2841
  }
2832
- function Ke() {
2833
- Y(() => {
2834
- A.value = 1, j.value = 0;
2842
+ function Q() {
2843
+ X(() => {
2844
+ N.value = 1, P.value = 0;
2835
2845
  });
2836
2846
  }
2837
2847
  let qe = [
@@ -2841,8 +2851,8 @@ var Me = ["aria-label"], Ne = [
2841
2851
  270
2842
2852
  ];
2843
2853
  function Je(e) {
2844
- Y(() => {
2845
- j.value = qe[(qe.indexOf(j.value) + e + 4) % 4];
2854
+ X(() => {
2855
+ P.value = qe[(qe.indexOf(P.value) + e + 4) % 4];
2846
2856
  });
2847
2857
  }
2848
2858
  function Ye() {
@@ -2851,8 +2861,8 @@ var Me = ["aria-label"], Ne = [
2851
2861
  function Xe() {
2852
2862
  Je(-1);
2853
2863
  }
2854
- let Qe = n(() => {
2855
- let e = z.visiblePage.value, t = z.pages[e];
2864
+ let Ze = n(() => {
2865
+ let e = B.visiblePage.value, t = B.pages[e];
2856
2866
  return t ? {
2857
2867
  index: e,
2858
2868
  width: t.intrinsicWidth,
@@ -2860,7 +2870,7 @@ var Me = ["aria-label"], Ne = [
2860
2870
  } : null;
2861
2871
  }), $e = n(() => {
2862
2872
  let e = S.source;
2863
- return e.kind === "pdf" || e.kind === "image" ? e.url : e.kind === "image-gallery" ? e.urls[z.visiblePage.value] ?? e.urls[0] ?? "" : "";
2873
+ return e.kind === "pdf" || e.kind === "image" ? e.url : e.kind === "image-gallery" ? e.urls[B.visiblePage.value] ?? e.urls[0] ?? "" : "";
2864
2874
  });
2865
2875
  function et() {
2866
2876
  let e = $e.value;
@@ -2889,170 +2899,170 @@ var Me = ["aria-label"], Ne = [
2889
2899
  t.rel = "noopener", document.body.appendChild(t), t.click(), t.remove();
2890
2900
  }
2891
2901
  function nt() {
2892
- N.value = N.value === "pan" ? "select" : "pan";
2902
+ I.value = I.value === "pan" ? "select" : "pan";
2893
2903
  }
2894
- let Q = null, rt = null;
2904
+ let $ = null, rt = null;
2895
2905
  function it(e, t) {
2896
2906
  return Math.hypot(e.clientX - t.clientX, e.clientY - t.clientY);
2897
2907
  }
2898
2908
  function at(e) {
2899
- e.touches.length === 2 && (Q = it(e.touches[0], e.touches[1]), rt = A.value);
2909
+ e.touches.length === 2 && ($ = it(e.touches[0], e.touches[1]), rt = N.value);
2900
2910
  }
2901
2911
  function ot(e) {
2902
- if (e.touches.length !== 2 || Q === null || rt === null) return;
2912
+ if (e.touches.length !== 2 || $ === null || rt === null) return;
2903
2913
  e.preventDefault();
2904
- let t = M.value;
2914
+ let t = F.value;
2905
2915
  if (!t) return;
2906
- let n = Be(it(e.touches[0], e.touches[1]) / Q * rt), r = A.value;
2916
+ let n = Be(it(e.touches[0], e.touches[1]) / $ * rt), r = N.value;
2907
2917
  if (n === r) return;
2908
- let i = z.visiblePage.value, a = z.pages[i], o = 0;
2918
+ let i = B.visiblePage.value, a = B.pages[i], o = 0;
2909
2919
  if (a?.wrapper) {
2910
2920
  let e = a.wrapper.offsetTop - t.offsetTop;
2911
2921
  o = Math.max(0, Math.min(1, (t.scrollTop - e) / Math.max(1, a.displayHeight)));
2912
2922
  }
2913
2923
  let s = t.getBoundingClientRect(), c = (e.touches[0].clientX + e.touches[1].clientX) / 2 - s.left, l = t.scrollLeft + c, u = n / r;
2914
- A.value = Ve(n), d(() => {
2915
- let e = M.value;
2924
+ N.value = Ve(n), f(() => {
2925
+ let e = F.value;
2916
2926
  if (!e) return;
2917
2927
  let t = e.style.scrollBehavior;
2918
2928
  e.style.scrollBehavior = "auto", e.scrollLeft = l * u - c;
2919
- let n = z.pages[i];
2929
+ let n = B.pages[i];
2920
2930
  n?.wrapper && (e.scrollTop = n.wrapper.offsetTop - e.offsetTop + o * n.displayHeight), e.style.scrollBehavior = t;
2921
2931
  });
2922
2932
  }
2923
2933
  function st(e) {
2924
- e.touches.length < 2 && (Q = null, rt = null);
2934
+ e.touches.length < 2 && ($ = null, rt = null);
2925
2935
  }
2926
- O(() => M.value, (e, t) => {
2936
+ A(() => F.value, (e, t) => {
2927
2937
  t && (t.removeEventListener("touchstart", at), t.removeEventListener("touchmove", ot), t.removeEventListener("touchend", st), t.removeEventListener("touchcancel", st)), e && (e.addEventListener("touchstart", at, { passive: !0 }), e.addEventListener("touchmove", ot, { passive: !1 }), e.addEventListener("touchend", st, { passive: !0 }), e.addEventListener("touchcancel", st, { passive: !0 }));
2928
2938
  }, { immediate: !0 });
2929
- let ct = 0, ut = 0, dt = 0, ft = 0;
2939
+ let ct = 0, lt = 0, dt = 0, ft = 0;
2930
2940
  function pt(e) {
2931
- if (N.value !== "pan" || e.button !== 0) return;
2932
- let t = M.value;
2933
- t && (e.preventDefault(), P.value = !0, ct = e.clientX, ut = e.clientY, dt = t.scrollLeft, ft = t.scrollTop, window.addEventListener("mousemove", mt), window.addEventListener("mouseup", ht));
2941
+ if (I.value !== "pan" || e.button !== 0) return;
2942
+ let t = F.value;
2943
+ t && (e.preventDefault(), L.value = !0, ct = e.clientX, lt = e.clientY, dt = t.scrollLeft, ft = t.scrollTop, window.addEventListener("mousemove", mt), window.addEventListener("mouseup", ht));
2934
2944
  }
2935
2945
  function mt(e) {
2936
- let t = M.value;
2937
- t && (t.scrollLeft = dt - (e.clientX - ct), t.scrollTop = ft - (e.clientY - ut));
2946
+ let t = F.value;
2947
+ t && (t.scrollLeft = dt - (e.clientX - ct), t.scrollTop = ft - (e.clientY - lt));
2938
2948
  }
2939
2949
  function ht() {
2940
- P.value = !1, window.removeEventListener("mousemove", mt), window.removeEventListener("mouseup", ht);
2950
+ L.value = !1, window.removeEventListener("mousemove", mt), window.removeEventListener("mouseup", ht);
2941
2951
  }
2942
2952
  let gt = n(() => ({
2943
- currentPage: z.visiblePage.value,
2944
- pageCount: B.value,
2945
- zoom: A.value,
2946
- minZoom: b,
2953
+ currentPage: B.visiblePage.value,
2954
+ pageCount: V.value,
2955
+ zoom: N.value,
2956
+ minZoom: g,
2947
2957
  maxZoom: x,
2948
- pointerMode: N.value,
2958
+ pointerMode: I.value,
2949
2959
  annotationMode: S.annotationMode,
2950
- markerWidthPresets: Se,
2951
- inkWidthPresets: xe,
2952
- markerWidth: V.markerWidth.value,
2953
- markerColor: V.markerColor.value || S.annotationColors[0] || "#fde68a",
2954
- inkWidth: V.inkWidth.value,
2955
- inkColor: V.inkColor.value || S.annotationColors[0] || "#dc2626",
2960
+ markerWidthPresets: we,
2961
+ inkWidthPresets: Ce,
2962
+ markerWidth: H.markerWidth.value,
2963
+ markerColor: H.markerColor.value || S.annotationColors[0] || "#fde68a",
2964
+ inkWidth: H.inkWidth.value,
2965
+ inkColor: H.inkColor.value || S.annotationColors[0] || "#dc2626",
2956
2966
  colors: S.annotationColors,
2957
2967
  side: S.toolbarPosition,
2958
- labels: k.value,
2968
+ labels: M.value,
2959
2969
  showSearch: S.showSearch,
2960
2970
  showPrintDownload: S.showPrintDownload,
2961
2971
  showAnnotationModes: S.showAnnotationModes,
2962
2972
  showSidebarToggle: S.showThumbnails || S.showOutline,
2963
- sidebarOpen: W.value,
2973
+ sidebarOpen: O.value,
2964
2974
  showAnnotationsPanelToggle: S.showAnnotationsPanel,
2965
- annotationsPanelOpen: G.value,
2975
+ annotationsPanelOpen: k.value,
2966
2976
  tools: S.tools,
2967
2977
  capabilities: S.source.capabilities
2968
- })), $ = {
2969
- prev: _t,
2970
- next: vt,
2971
- jump: yt,
2978
+ })), _t = {
2979
+ prev: vt,
2980
+ next: yt,
2981
+ jump: bt,
2972
2982
  "zoom-in": He,
2973
2983
  "zoom-out": Ue,
2974
- "reset-zoom": () => X(1),
2975
- "set-zoom": (e) => X(e),
2976
- "reset-view": Ke,
2984
+ "reset-zoom": () => Z(1),
2985
+ "set-zoom": (e) => Z(e),
2986
+ "reset-view": Q,
2977
2987
  "toggle-pan": nt,
2978
- "toggle-sidebar": be,
2979
- "toggle-annotations-panel": we,
2988
+ "toggle-sidebar": xe,
2989
+ "toggle-annotations-panel": Se,
2980
2990
  "rotate-cw": Ye,
2981
2991
  "rotate-ccw": Xe,
2982
- "set-annotation-mode": ce,
2983
- "update:marker-width": (e) => V.markerWidth.value = e,
2984
- "update:marker-color": (e) => V.markerColor.value = e,
2985
- "update:ink-width": (e) => V.inkWidth.value = e,
2986
- "update:ink-color": (e) => V.inkColor.value = e,
2992
+ "set-annotation-mode": le,
2993
+ "update:marker-width": (e) => H.markerWidth.value = e,
2994
+ "update:marker-color": (e) => H.markerColor.value = e,
2995
+ "update:ink-width": (e) => H.inkWidth.value = e,
2996
+ "update:ink-color": (e) => H.inkColor.value = e,
2987
2997
  "fit-width": We,
2988
- "fit-page": Z,
2998
+ "fit-page": Ge,
2989
2999
  search: Ie,
2990
3000
  print: et,
2991
3001
  download: tt
2992
3002
  };
2993
- function _t() {
2994
- z.visiblePage.value > 0 && z.scrollToPage(z.visiblePage.value - 1, { behavior: "smooth" });
2995
- }
2996
3003
  function vt() {
2997
- z.visiblePage.value < z.pages.length - 1 && z.scrollToPage(z.visiblePage.value + 1, { behavior: "smooth" });
3004
+ B.visiblePage.value > 0 && B.scrollToPage(B.visiblePage.value - 1, { behavior: "smooth" });
2998
3005
  }
2999
- function yt(e) {
3000
- z.scrollToPage(e, { behavior: "smooth" });
3006
+ function yt() {
3007
+ B.visiblePage.value < B.pages.length - 1 && B.scrollToPage(B.visiblePage.value + 1, { behavior: "smooth" });
3001
3008
  }
3002
3009
  function bt(e) {
3010
+ B.scrollToPage(e, { behavior: "smooth" });
3011
+ }
3012
+ function xt(e) {
3003
3013
  if (!(e.ctrlKey || e.metaKey)) return;
3004
3014
  e.preventDefault();
3005
- let t = M.value;
3015
+ let t = F.value;
3006
3016
  if (!t) return;
3007
- let n = e.deltaY < 0 ? 1.1 : 1 / 1.1, r = A.value, i = Be(r * n);
3017
+ let n = e.deltaY < 0 ? 1.1 : 1 / 1.1, r = N.value, i = Be(r * n);
3008
3018
  if (i === r) return;
3009
- let a = z.visiblePage.value, o = z.pages[a], s = 0;
3019
+ let a = B.visiblePage.value, o = B.pages[a], s = 0;
3010
3020
  if (o?.wrapper) {
3011
3021
  let e = o.wrapper.offsetTop - t.offsetTop;
3012
3022
  s = Math.max(0, Math.min(1, (t.scrollTop - e) / Math.max(1, o.displayHeight)));
3013
3023
  }
3014
3024
  let c = t.getBoundingClientRect(), l = e.clientX - c.left, u = t.scrollLeft + l;
3015
- A.value = Ve(i);
3016
- let f = i / r;
3017
- d(() => {
3018
- let e = M.value;
3025
+ N.value = Ve(i);
3026
+ let d = i / r;
3027
+ f(() => {
3028
+ let e = F.value;
3019
3029
  if (!e) return;
3020
3030
  let t = e.style.scrollBehavior;
3021
- e.style.scrollBehavior = "auto", e.scrollLeft = u * f - l;
3022
- let n = z.pages[a];
3031
+ e.style.scrollBehavior = "auto", e.scrollLeft = u * d - l;
3032
+ let n = B.pages[a];
3023
3033
  n?.wrapper && (e.scrollTop = n.wrapper.offsetTop - e.offsetTop + s * n.displayHeight), e.style.scrollBehavior = t;
3024
3034
  });
3025
3035
  }
3026
- return O(() => te.value, (e) => {
3027
- e != null && E("error", {
3036
+ return A(() => re.value, (e) => {
3037
+ e != null && C("error", {
3028
3038
  error: e,
3029
3039
  src: $e.value
3030
3040
  });
3031
3041
  }), l({
3032
- reload: R,
3033
- destroy: ne,
3034
- scrollToPage: z.scrollToPage
3035
- }), (n, l) => (g(), a("div", {
3042
+ reload: z,
3043
+ destroy: ie,
3044
+ scrollToPage: B.scrollToPage
3045
+ }), (n, l) => (_(), a("div", {
3036
3046
  ref_key: "viewerRoot",
3037
3047
  ref: Ee,
3038
- class: f(["coar-pdf-viewer", { "coar-pdf-viewer--resizing": Te.value !== null }]),
3039
- "data-status": T(F)
3048
+ class: p(["coar-pdf-viewer", { "coar-pdf-viewer--resizing": J.value !== null }]),
3049
+ "data-status": E(R)
3040
3050
  }, [
3041
- W.value && T(F) === "ready" && (t.showThumbnails || t.showOutline) ? (g(), r(lt, {
3051
+ O.value && E(R) === "ready" && (t.showThumbnails || t.showOutline) ? (_(), r(ut, {
3042
3052
  key: 0,
3043
- doc: T(I),
3044
- "page-providers": T(L),
3045
- "page-count": B.value,
3046
- "visible-page": T(z).visiblePage.value,
3053
+ doc: E(ee),
3054
+ "page-providers": E(te),
3055
+ "page-count": V.value,
3056
+ "visible-page": E(B).visiblePage.value,
3047
3057
  "show-thumbnails": t.showThumbnails,
3048
3058
  "show-outline": t.showOutline,
3049
- labels: k.value,
3050
- style: p({
3059
+ labels: M.value,
3060
+ style: m({
3051
3061
  width: K.value + "px",
3052
3062
  flexBasis: K.value + "px"
3053
3063
  }),
3054
3064
  onJump: je,
3055
- onClose: l[0] ||= (e) => W.value = !1
3065
+ onClose: l[0] ||= (e) => O.value = !1
3056
3066
  }, null, 8, [
3057
3067
  "doc",
3058
3068
  "page-providers",
@@ -3063,25 +3073,25 @@ var Me = ["aria-label"], Ne = [
3063
3073
  "labels",
3064
3074
  "style"
3065
3075
  ])) : i("", !0),
3066
- W.value && T(F) === "ready" && (t.showThumbnails || t.showOutline) ? (g(), a("div", {
3076
+ O.value && E(R) === "ready" && (t.showThumbnails || t.showOutline) ? (_(), a("div", {
3067
3077
  key: 1,
3068
3078
  class: "coar-pdf-viewer__divider",
3069
3079
  role: "separator",
3070
3080
  "aria-orientation": "vertical",
3071
3081
  onPointerdown: l[1] ||= (e) => De("sidebar", e)
3072
3082
  }, null, 32)) : i("", !0),
3073
- o("div", on, [
3074
- t.showToolbar && (T(F) === "ready" || T(F) === "loading") && t.toolbarPosition === "top" ? (g(), r(Ge, u({ key: 0 }, gt.value, w($)), null, 16)) : i("", !0),
3075
- ye.value && T(F) === "ready" ? (g(), r(Ze, {
3083
+ o("div", cn, [
3084
+ t.showToolbar && (E(R) === "ready" || E(R) === "loading") && t.toolbarPosition === "top" ? (_(), r(Ke, d({ key: 0 }, gt.value, T(_t)), null, 16)) : i("", !0),
3085
+ be.value && E(R) === "ready" ? (_(), r(Qe, {
3076
3086
  key: 1,
3077
- query: T(U).query.value,
3078
- "match-count": T(U).matches.value.length,
3079
- "current-index": T(U).currentIndex.value,
3080
- searching: T(U).searching.value,
3081
- labels: k.value,
3087
+ query: E(G).query.value,
3088
+ "match-count": E(G).matches.value.length,
3089
+ "current-index": E(G).currentIndex.value,
3090
+ searching: E(G).searching.value,
3091
+ labels: M.value,
3082
3092
  "onUpdate:query": Re,
3083
- onNext: T(U).next,
3084
- onPrev: T(U).prev,
3093
+ onNext: E(G).next,
3094
+ onPrev: E(G).prev,
3085
3095
  onClose: Le
3086
3096
  }, null, 8, [
3087
3097
  "query",
@@ -3092,14 +3102,14 @@ var Me = ["aria-label"], Ne = [
3092
3102
  "onNext",
3093
3103
  "onPrev"
3094
3104
  ])) : i("", !0),
3095
- o("div", sn, [
3096
- t.showToolbar && (T(F) === "ready" || T(F) === "loading") && t.toolbarPosition === "left" ? (g(), r(Ge, u({ key: 0 }, gt.value, w($)), null, 16)) : i("", !0),
3105
+ o("div", ln, [
3106
+ t.showToolbar && (E(R) === "ready" || E(R) === "loading") && t.toolbarPosition === "left" ? (_(), r(Ke, d({ key: 0 }, gt.value, T(_t)), null, 16)) : i("", !0),
3097
3107
  o("div", {
3098
3108
  ref_key: "scrollContainer",
3099
- ref: M,
3100
- class: f(["coar-pdf-viewer__scroll", {
3101
- "coar-pdf-viewer__scroll--pan": N.value === "pan",
3102
- "coar-pdf-viewer__scroll--panning": P.value,
3109
+ ref: F,
3110
+ class: p(["coar-pdf-viewer__scroll", {
3111
+ "coar-pdf-viewer__scroll--pan": I.value === "pan",
3112
+ "coar-pdf-viewer__scroll--panning": L.value,
3103
3113
  "coar-pdf-viewer__scroll--annotate-comment": t.annotationMode === "comment",
3104
3114
  "coar-pdf-viewer__scroll--annotate-ink": t.annotationMode === "ink",
3105
3115
  "coar-pdf-viewer__scroll--annotate-marker": t.annotationMode === "marker",
@@ -3108,61 +3118,61 @@ var Me = ["aria-label"], Ne = [
3108
3118
  "coar-pdf-viewer__scroll--annotate-eraser": t.annotationMode === "eraser"
3109
3119
  }]),
3110
3120
  role: "document",
3111
- onWheel: bt,
3121
+ onWheel: xt,
3112
3122
  onMousedown: pt
3113
3123
  }, [
3114
- T(F) === "ready" || T(F) === "loading" ? (g(), a("div", cn, [(g(!0), a(e, null, v(T(z).pages, (t) => (g(), a("div", {
3124
+ E(R) === "ready" || E(R) === "loading" ? (_(), a("div", un, [(_(!0), a(e, null, y(E(B).pages, (t) => (_(), a("div", {
3115
3125
  key: t.index,
3116
3126
  ref_for: !0,
3117
3127
  ref: ze(t.index),
3118
3128
  class: "coar-pdf-page",
3119
- style: p({
3129
+ style: m({
3120
3130
  width: t.displayWidth + "px",
3121
3131
  height: t.displayHeight + "px"
3122
3132
  }),
3123
3133
  "data-page-index": t.index,
3124
- "aria-label": `Page ${t.index + 1} of ${B.value}`
3125
- }, [c(Xt, {
3126
- annotations: ie(t.index),
3127
- "display-width": J(t.intrinsicWidth, t.intrinsicHeight).w,
3128
- "display-height": J(t.intrinsicWidth, t.intrinsicHeight).h,
3129
- rotation: j.value,
3130
- onAnnotationClick: se
3134
+ "aria-label": `Page ${t.index + 1} of ${V.value}`
3135
+ }, [c(Qt, {
3136
+ annotations: U(t.index),
3137
+ "display-width": Y(t.intrinsicWidth, t.intrinsicHeight).w,
3138
+ "display-height": Y(t.intrinsicWidth, t.intrinsicHeight).h,
3139
+ rotation: P.value,
3140
+ onAnnotationClick: ce
3131
3141
  }, null, 8, [
3132
3142
  "annotations",
3133
3143
  "display-width",
3134
3144
  "display-height",
3135
3145
  "rotation"
3136
- ]), Ne(t.index).length > 0 ? (g(), a("div", {
3146
+ ]), Ne(t.index).length > 0 ? (_(), a("div", {
3137
3147
  key: 0,
3138
3148
  class: "coar-pdf-search-overlay",
3139
- style: p({
3140
- width: J(t.intrinsicWidth, t.intrinsicHeight).w + "px",
3141
- height: J(t.intrinsicWidth, t.intrinsicHeight).h + "px",
3142
- transform: Pe.value(J(t.intrinsicWidth, t.intrinsicHeight).w, J(t.intrinsicWidth, t.intrinsicHeight).h)
3149
+ style: m({
3150
+ width: Y(t.intrinsicWidth, t.intrinsicHeight).w + "px",
3151
+ height: Y(t.intrinsicWidth, t.intrinsicHeight).h + "px",
3152
+ transform: Pe.value(Y(t.intrinsicWidth, t.intrinsicHeight).w, Y(t.intrinsicWidth, t.intrinsicHeight).h)
3143
3153
  })
3144
- }, [(g(!0), a(e, null, v(Ne(t.index), (n, r) => (g(), a(e, { key: r }, [(g(!0), a(e, null, v(n.rects, (e, i) => (g(), a("div", {
3154
+ }, [(_(!0), a(e, null, y(Ne(t.index), (n, r) => (_(), a(e, { key: r }, [(_(!0), a(e, null, y(n.rects, (e, i) => (_(), a("div", {
3145
3155
  key: `${r}-${i}`,
3146
- class: f(["coar-pdf-search-rect", { "coar-pdf-search-rect--current": Fe(n) }]),
3147
- style: p({
3148
- left: e.x * J(t.intrinsicWidth, t.intrinsicHeight).w + "px",
3149
- top: e.y * J(t.intrinsicWidth, t.intrinsicHeight).h + "px",
3150
- width: e.w * J(t.intrinsicWidth, t.intrinsicHeight).w + "px",
3151
- height: e.h * J(t.intrinsicWidth, t.intrinsicHeight).h + "px"
3156
+ class: p(["coar-pdf-search-rect", { "coar-pdf-search-rect--current": Fe(n) }]),
3157
+ style: m({
3158
+ left: e.x * Y(t.intrinsicWidth, t.intrinsicHeight).w + "px",
3159
+ top: e.y * Y(t.intrinsicWidth, t.intrinsicHeight).h + "px",
3160
+ width: e.w * Y(t.intrinsicWidth, t.intrinsicHeight).w + "px",
3161
+ height: e.h * Y(t.intrinsicWidth, t.intrinsicHeight).h + "px"
3152
3162
  })
3153
- }, null, 6))), 128))], 64))), 128))], 4)) : i("", !0)], 12, ln))), 128))])) : i("", !0),
3154
- T(F) === "loading" ? (g(), a("div", un, [y(n.$slots, "loading", {}, () => [s(C(k.value.loading), 1)], !0)])) : i("", !0),
3155
- T(V).selectedAnnotation.value && ae.value ? (g(), r(rn, {
3163
+ }, null, 6))), 128))], 64))), 128))], 4)) : i("", !0)], 12, dn))), 128))])) : i("", !0),
3164
+ E(R) === "loading" ? (_(), a("div", fn, [b(n.$slots, "loading", {}, () => [s(w(M.value.loading), 1)], !0)])) : i("", !0),
3165
+ E(H).selectedAnnotation.value && W.value ? (_(), r(on, {
3156
3166
  key: 2,
3157
- anchor: ae.value,
3158
- "initial-comment": ue.value,
3159
- "initial-color": T(V).selectedAnnotation.value.color,
3167
+ anchor: W.value,
3168
+ "initial-comment": fe.value,
3169
+ "initial-color": E(H).selectedAnnotation.value.color,
3160
3170
  colors: t.annotationColors,
3161
3171
  draft: !1,
3162
- labels: k.value,
3163
- onSave: fe,
3164
- onDelete: me,
3165
- onClose: he
3172
+ labels: M.value,
3173
+ onSave: me,
3174
+ onDelete: he,
3175
+ onClose: ge
3166
3176
  }, null, 8, [
3167
3177
  "anchor",
3168
3178
  "initial-comment",
@@ -3170,16 +3180,16 @@ var Me = ["aria-label"], Ne = [
3170
3180
  "colors",
3171
3181
  "labels"
3172
3182
  ])) : i("", !0),
3173
- T(V).draftPin.value ? (g(), r(rn, {
3183
+ E(H).draftPin.value ? (_(), r(on, {
3174
3184
  key: 3,
3175
- anchor: T(V).draftPin.value.viewportRect,
3185
+ anchor: E(H).draftPin.value.viewportRect,
3176
3186
  "initial-comment": "",
3177
- "initial-color": T(V).draftPin.value.color,
3187
+ "initial-color": E(H).draftPin.value.color,
3178
3188
  colors: t.annotationColors,
3179
3189
  draft: !0,
3180
- labels: k.value,
3181
- onSave: ge,
3182
- onClose: T(V).cancelDraftPin
3190
+ labels: M.value,
3191
+ onSave: ve,
3192
+ onClose: E(H).cancelDraftPin
3183
3193
  }, null, 8, [
3184
3194
  "anchor",
3185
3195
  "initial-color",
@@ -3187,16 +3197,16 @@ var Me = ["aria-label"], Ne = [
3187
3197
  "labels",
3188
3198
  "onClose"
3189
3199
  ])) : i("", !0),
3190
- T(V).draftFreetext.value ? (g(), r(rn, {
3200
+ E(H).draftFreetext.value ? (_(), r(on, {
3191
3201
  key: 4,
3192
- anchor: T(V).draftFreetext.value.viewportRect,
3202
+ anchor: E(H).draftFreetext.value.viewportRect,
3193
3203
  "initial-comment": "",
3194
- "initial-color": T(V).draftFreetext.value.color,
3204
+ "initial-color": E(H).draftFreetext.value.color,
3195
3205
  colors: t.annotationColors,
3196
3206
  draft: !0,
3197
- labels: k.value,
3198
- onSave: ve,
3199
- onClose: T(V).cancelDraftFreetext
3207
+ labels: M.value,
3208
+ onSave: ye,
3209
+ onClose: E(H).cancelDraftFreetext
3200
3210
  }, null, 8, [
3201
3211
  "anchor",
3202
3212
  "initial-color",
@@ -3204,40 +3214,40 @@ var Me = ["aria-label"], Ne = [
3204
3214
  "labels",
3205
3215
  "onClose"
3206
3216
  ])) : i("", !0),
3207
- T(F) === "error" ? (g(), a("div", dn, [y(n.$slots, "error", {
3208
- error: T(te),
3209
- retry: T(R)
3210
- }, () => [o("div", fn, [o("p", pn, C(k.value.errorTitle), 1), o("button", {
3217
+ E(R) === "error" ? (_(), a("div", pn, [b(n.$slots, "error", {
3218
+ error: E(re),
3219
+ retry: E(z)
3220
+ }, () => [o("div", mn, [o("p", hn, w(M.value.errorTitle), 1), o("button", {
3211
3221
  type: "button",
3212
3222
  class: "coar-pdf-viewer__error-retry",
3213
- onClick: l[2] ||= (...e) => T(R) && T(R)(...e)
3214
- }, C(k.value.errorRetry), 1)])], !0)])) : i("", !0)
3223
+ onClick: l[2] ||= (...e) => E(z) && E(z)(...e)
3224
+ }, w(M.value.errorRetry), 1)])], !0)])) : i("", !0)
3215
3225
  ], 34),
3216
- t.showToolbar && (T(F) === "ready" || T(F) === "loading") && t.toolbarPosition === "right" ? (g(), r(Ge, u({ key: 1 }, gt.value, w($)), null, 16)) : i("", !0)
3226
+ t.showToolbar && (E(R) === "ready" || E(R) === "loading") && t.toolbarPosition === "right" ? (_(), r(Ke, d({ key: 1 }, gt.value, T(_t)), null, 16)) : i("", !0)
3217
3227
  ]),
3218
- t.showToolbar && (T(F) === "ready" || T(F) === "loading") && t.toolbarPosition === "bottom" ? (g(), r(Ge, u({ key: 2 }, gt.value, w($)), null, 16)) : i("", !0)
3228
+ t.showToolbar && (E(R) === "ready" || E(R) === "loading") && t.toolbarPosition === "bottom" ? (_(), r(Ke, d({ key: 2 }, gt.value, T(_t)), null, 16)) : i("", !0)
3219
3229
  ]),
3220
- G.value && T(F) === "ready" && t.showAnnotationsPanel ? (g(), a("div", {
3230
+ k.value && E(R) === "ready" && t.showAnnotationsPanel ? (_(), a("div", {
3221
3231
  key: 2,
3222
3232
  class: "coar-pdf-viewer__divider",
3223
3233
  role: "separator",
3224
3234
  "aria-orientation": "vertical",
3225
3235
  onPointerdown: l[3] ||= (e) => De("panel", e)
3226
3236
  }, null, 32)) : i("", !0),
3227
- G.value && T(F) === "ready" && t.showAnnotationsPanel ? (g(), r(Bt, {
3237
+ k.value && E(R) === "ready" && t.showAnnotationsPanel ? (_(), r(Ht, {
3228
3238
  key: 3,
3229
3239
  annotations: t.annotations,
3230
- "selected-id": T(V).selectedAnnotationId.value,
3231
- info: t.showInfoSection ? T(ee) : null,
3232
- "current-page-info": t.showInfoSection ? Qe.value : null,
3233
- labels: k.value,
3234
- style: p({
3240
+ "selected-id": E(H).selectedAnnotationId.value,
3241
+ info: t.showInfoSection ? E(ne) : null,
3242
+ "current-page-info": t.showInfoSection ? Ze.value : null,
3243
+ labels: M.value,
3244
+ style: m({
3235
3245
  width: q.value + "px",
3236
3246
  flexBasis: q.value + "px"
3237
3247
  }),
3238
- onSelect: ke,
3248
+ onSelect: Oe,
3239
3249
  onDelete: Ae,
3240
- onClose: l[4] ||= (e) => G.value = !1
3250
+ onClose: l[4] ||= (e) => k.value = !1
3241
3251
  }, null, 8, [
3242
3252
  "annotations",
3243
3253
  "selected-id",
@@ -3246,12 +3256,12 @@ var Me = ["aria-label"], Ne = [
3246
3256
  "labels",
3247
3257
  "style"
3248
3258
  ])) : i("", !0)
3249
- ], 10, an));
3259
+ ], 10, sn));
3250
3260
  }
3251
- }), [["__scopeId", "data-v-485161c5"]]);
3261
+ }), [["__scopeId", "data-v-f6ee397d"]]);
3252
3262
  //#endregion
3253
3263
  //#region src/sources/image.ts
3254
- function xn(e) {
3264
+ function Cn(e) {
3255
3265
  let t = {
3256
3266
  kind: "image",
3257
3267
  url: e.url,
@@ -3265,7 +3275,7 @@ function xn(e) {
3265
3275
  };
3266
3276
  return Object.freeze(t);
3267
3277
  }
3268
- function Sn(e) {
3278
+ function wn(e) {
3269
3279
  let t = {
3270
3280
  kind: "image-gallery",
3271
3281
  urls: Object.freeze([...e.urls]),
@@ -3280,4 +3290,4 @@ function Sn(e) {
3280
3290
  return Object.freeze(t);
3281
3291
  }
3282
3292
  //#endregion
3283
- export { ke as COAR_DOCUMENT_VIEWER_ALL_TOOLS, bn as CoarDocumentViewer, Sn as imageGallerySource, xn as imageSource };
3293
+ export { Ae as COAR_DOCUMENT_VIEWER_ALL_TOOLS, Sn as CoarDocumentViewer, wn as imageGallerySource, Cn as imageSource };