@soomo/text-annotator 3.0.0-staging.37 → 3.0.0-staging.38
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.
|
@@ -8,24 +8,24 @@ const q = {
|
|
|
8
8
|
var s, a;
|
|
9
9
|
const r = n ? typeof n == "function" ? n(e.annotation, e.state, i) || ((s = e.state) != null && s.selected ? gt : q) : n : (a = e.state) != null && a.selected ? gt : q;
|
|
10
10
|
return o && o.paint(e, t) || r;
|
|
11
|
-
}, ne = "not-annotatable",
|
|
11
|
+
}, ne = "not-annotatable", $ = `.${ne}`, Se = (e) => {
|
|
12
12
|
var n;
|
|
13
13
|
const t = e.commonAncestorContainer;
|
|
14
|
-
return t instanceof HTMLElement ? !t.closest(
|
|
15
|
-
},
|
|
14
|
+
return t instanceof HTMLElement ? !t.closest($) : !((n = t.parentElement) != null && n.closest($));
|
|
15
|
+
}, Ce = function* (e) {
|
|
16
16
|
const t = document.createNodeIterator(
|
|
17
17
|
e.commonAncestorContainer,
|
|
18
18
|
NodeFilter.SHOW_ELEMENT,
|
|
19
|
-
(o) => o instanceof HTMLElement && o.classList.contains(ne) && !o.parentElement.closest(
|
|
19
|
+
(o) => o instanceof HTMLElement && o.classList.contains(ne) && !o.parentElement.closest($) && e.intersectsNode(o) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP
|
|
20
20
|
);
|
|
21
21
|
let n;
|
|
22
22
|
for (; n = t.nextNode(); )
|
|
23
23
|
n instanceof HTMLElement && (yield n);
|
|
24
|
-
},
|
|
25
|
-
if (!
|
|
24
|
+
}, xe = (e) => {
|
|
25
|
+
if (!Se(e)) return [];
|
|
26
26
|
const t = [];
|
|
27
27
|
let n = null;
|
|
28
|
-
for (const o of
|
|
28
|
+
for (const o of Ce(e)) {
|
|
29
29
|
let i;
|
|
30
30
|
n ? (i = document.createRange(), i.setStartAfter(n), i.setEndBefore(o)) : (i = e.cloneRange(), i.setEndBefore(o)), i.collapsed || t.push(i), n = o;
|
|
31
31
|
}
|
|
@@ -36,20 +36,20 @@ const q = {
|
|
|
36
36
|
return t.length > 0 ? t : [e];
|
|
37
37
|
}, kt = (e) => {
|
|
38
38
|
const t = e.cloneContents();
|
|
39
|
-
return t.querySelectorAll(
|
|
40
|
-
},
|
|
39
|
+
return t.querySelectorAll($).forEach((n) => n.remove()), t;
|
|
40
|
+
}, Ee = (e) => e.addEventListener("click", (t) => {
|
|
41
41
|
// Allow clicks within not-annotatable elements
|
|
42
|
-
!t.target.closest(
|
|
43
|
-
}),
|
|
42
|
+
!t.target.closest($) && !t.target.closest("a") && t.preventDefault();
|
|
43
|
+
}), Le = (e) => {
|
|
44
44
|
!e.hasAttribute("tabindex") && e.tabIndex < 0 && e.setAttribute("tabindex", "-1"), e.classList.add("no-focus-outline");
|
|
45
45
|
}, Nt = (e, t = 10) => {
|
|
46
46
|
let n;
|
|
47
47
|
return (...o) => {
|
|
48
48
|
clearTimeout(n), n = setTimeout(() => e.apply(void 0, o), t);
|
|
49
49
|
};
|
|
50
|
-
},
|
|
50
|
+
}, So = (e) => {
|
|
51
51
|
const t = e.cloneContents();
|
|
52
|
-
return t.querySelectorAll(
|
|
52
|
+
return t.querySelectorAll($).forEach((n) => n.remove()), t;
|
|
53
53
|
}, Dt = (e, t) => {
|
|
54
54
|
const n = document.createNodeIterator(t);
|
|
55
55
|
let o = 0, i = n.nextNode();
|
|
@@ -64,7 +64,7 @@ const q = {
|
|
|
64
64
|
for (let i = 0; i < e + 1; i++)
|
|
65
65
|
o = n.nextNode();
|
|
66
66
|
return o;
|
|
67
|
-
},
|
|
67
|
+
}, Te = (e) => {
|
|
68
68
|
const {
|
|
69
69
|
commonAncestorContainer: t,
|
|
70
70
|
startContainer: n,
|
|
@@ -72,32 +72,32 @@ const q = {
|
|
|
72
72
|
endContainer: i,
|
|
73
73
|
endOffset: r
|
|
74
74
|
} = e, s = Array.from(t.childNodes).map((l) => {
|
|
75
|
-
const
|
|
76
|
-
return l.nodeName === "CANVAS" ? l :
|
|
75
|
+
const g = l.cloneNode(!0);
|
|
76
|
+
return l.nodeName === "CANVAS" ? l : g;
|
|
77
77
|
}), a = Dt(n, t), d = Dt(i, t), f = () => {
|
|
78
78
|
const l = t;
|
|
79
79
|
l.replaceChildren(...s);
|
|
80
|
-
const
|
|
81
|
-
return e.setStart(
|
|
82
|
-
},
|
|
83
|
-
const
|
|
84
|
-
return l.surroundContents(
|
|
80
|
+
const g = yt(a, l), c = yt(d, l);
|
|
81
|
+
return e.setStart(g, o), e.setEnd(c, r), e;
|
|
82
|
+
}, h = (l) => {
|
|
83
|
+
const g = document.createElement("SPAN");
|
|
84
|
+
return l.surroundContents(g), g;
|
|
85
85
|
};
|
|
86
86
|
if (n === i)
|
|
87
87
|
throw "Not implemented";
|
|
88
88
|
{
|
|
89
89
|
const l = document.createRange();
|
|
90
90
|
l.selectNodeContents(n), l.setStart(n, o);
|
|
91
|
-
const
|
|
91
|
+
const g = h(l), c = document.createRange();
|
|
92
92
|
c.selectNode(i), c.setEnd(i, r);
|
|
93
|
-
const
|
|
94
|
-
var
|
|
93
|
+
const A = h(c), b = Me(e).reverse().map((p) => {
|
|
94
|
+
var w;
|
|
95
95
|
const u = document.createElement("SPAN");
|
|
96
|
-
return (
|
|
96
|
+
return (w = p.parentNode) == null || w.insertBefore(u, p), u.appendChild(p), u;
|
|
97
97
|
});
|
|
98
|
-
return { unwrap: f, nodes: [
|
|
98
|
+
return { unwrap: f, nodes: [g, ...b, A] };
|
|
99
99
|
}
|
|
100
|
-
},
|
|
100
|
+
}, Me = (e) => {
|
|
101
101
|
const {
|
|
102
102
|
commonAncestorContainer: t,
|
|
103
103
|
startContainer: n,
|
|
@@ -113,10 +113,10 @@ const q = {
|
|
|
113
113
|
if (t === n)
|
|
114
114
|
return Array.from(e.getClientRects());
|
|
115
115
|
{
|
|
116
|
-
const { unwrap: o, nodes: i } =
|
|
116
|
+
const { unwrap: o, nodes: i } = Te(e), r = i.reduce((s, a) => [...s, ...a.getClientRects()], []);
|
|
117
117
|
return o(), r;
|
|
118
118
|
}
|
|
119
|
-
},
|
|
119
|
+
}, Be = (e, t, n = 10, o) => {
|
|
120
120
|
const i = o ? e.startContainer.parentElement.closest(o) : t, r = document.createRange();
|
|
121
121
|
r.setStart(i, 0), r.setEnd(e.startContainer, e.startOffset);
|
|
122
122
|
const s = kt(r).textContent, a = document.createRange();
|
|
@@ -126,7 +126,7 @@ const q = {
|
|
|
126
126
|
prefix: s.substring(s.length - n),
|
|
127
127
|
suffix: d.substring(0, n)
|
|
128
128
|
};
|
|
129
|
-
},
|
|
129
|
+
}, Re = /^\s*$/, ke = (e) => Re.test(e.toString()), z = (e) => e.every((t) => t.range instanceof Range && !t.range.collapsed), Ve = (e, t) => {
|
|
130
130
|
const n = (r) => Math.round(r * 10) / 10, o = {
|
|
131
131
|
top: n(e.top),
|
|
132
132
|
bottom: n(e.bottom),
|
|
@@ -150,17 +150,17 @@ const q = {
|
|
|
150
150
|
return "block-contains";
|
|
151
151
|
} else if (o.top >= i.top && o.bottom <= i.bottom && o.left >= i.left && o.right <= i.right)
|
|
152
152
|
return "block-is-contained";
|
|
153
|
-
},
|
|
153
|
+
}, Oe = (e, t) => {
|
|
154
154
|
const n = Math.min(e.left, t.left), o = Math.max(e.right, t.right), i = Math.min(e.top, t.top), r = Math.max(e.bottom, t.bottom);
|
|
155
155
|
return new DOMRect(n, i, o - n, r - i);
|
|
156
|
-
},
|
|
156
|
+
}, Ne = (e) => e.reduce((t, n) => {
|
|
157
157
|
if (n.width === 0 || n.height === 0)
|
|
158
158
|
return t;
|
|
159
159
|
let o = [...t], i = !1;
|
|
160
160
|
for (const r of t) {
|
|
161
|
-
const s =
|
|
161
|
+
const s = Ve(n, r);
|
|
162
162
|
if (s === "inline-adjacent") {
|
|
163
|
-
o = o.map((a) => a === r ?
|
|
163
|
+
o = o.map((a) => a === r ? Oe(n, r) : a), i = !0;
|
|
164
164
|
break;
|
|
165
165
|
} else if (s === "inline-contains") {
|
|
166
166
|
o = o.map((a) => a === r ? n : a), i = !0;
|
|
@@ -181,19 +181,19 @@ const q = {
|
|
|
181
181
|
for (let t = 0; t < this.length; t++)
|
|
182
182
|
yield this.item(t);
|
|
183
183
|
}
|
|
184
|
-
}),
|
|
184
|
+
}), Ie = (e, t, n) => {
|
|
185
185
|
const o = document.createRange(), i = n ? e.startContainer.parentElement.closest(n) : t;
|
|
186
186
|
o.setStart(i, 0), o.setEnd(e.startContainer, e.startOffset);
|
|
187
187
|
const r = kt(o).textContent, s = e.toString(), a = r.length || 0, d = a + s.length;
|
|
188
188
|
return n ? { quote: s, start: a, end: d, range: e, offsetReference: i } : { quote: s, start: a, end: d, range: e };
|
|
189
189
|
}, oe = (e, t) => {
|
|
190
|
-
var
|
|
190
|
+
var h, l;
|
|
191
191
|
const { start: n, end: o } = e, i = e.offsetReference || t, r = document.createNodeIterator(
|
|
192
192
|
t,
|
|
193
193
|
NodeFilter.SHOW_TEXT,
|
|
194
|
-
(
|
|
194
|
+
(g) => {
|
|
195
195
|
var c;
|
|
196
|
-
return (c =
|
|
196
|
+
return (c = g.parentElement) != null && c.closest($) ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;
|
|
197
197
|
}
|
|
198
198
|
);
|
|
199
199
|
let s = 0;
|
|
@@ -203,22 +203,22 @@ const q = {
|
|
|
203
203
|
let f = !i;
|
|
204
204
|
for (; d !== null; ) {
|
|
205
205
|
if (f || (f = i == null ? void 0 : i.contains(d)), f) {
|
|
206
|
-
const
|
|
207
|
-
if (s +
|
|
206
|
+
const g = ((h = d.textContent) == null ? void 0 : h.length) || 0;
|
|
207
|
+
if (s + g > n) {
|
|
208
208
|
a.setStart(d, n - s);
|
|
209
209
|
break;
|
|
210
210
|
}
|
|
211
|
-
s +=
|
|
211
|
+
s += g;
|
|
212
212
|
}
|
|
213
213
|
d = r.nextNode();
|
|
214
214
|
}
|
|
215
215
|
for (; d !== null; ) {
|
|
216
|
-
const
|
|
217
|
-
if (s +
|
|
216
|
+
const g = ((l = d.textContent) == null ? void 0 : l.length) || 0;
|
|
217
|
+
if (s + g >= o) {
|
|
218
218
|
a.setEnd(d, o - s);
|
|
219
219
|
break;
|
|
220
220
|
}
|
|
221
|
-
s +=
|
|
221
|
+
s += g, d = r.nextNode();
|
|
222
222
|
}
|
|
223
223
|
return {
|
|
224
224
|
...e,
|
|
@@ -227,16 +227,16 @@ const q = {
|
|
|
227
227
|
}, mt = (e, t) => z(e.selector) ? e : {
|
|
228
228
|
...e,
|
|
229
229
|
selector: e.selector.map((n) => n.range instanceof Range && !n.range.collapsed ? n : oe(n, t))
|
|
230
|
-
}, bt = (e, t) => z(e.target.selector) ? e : { ...e, target: mt(e.target, t) },
|
|
230
|
+
}, bt = (e, t) => z(e.target.selector) ? e : { ...e, target: mt(e.target, t) }, Fe = (e, t) => {
|
|
231
231
|
const n = e.cloneRange();
|
|
232
232
|
return t.contains(n.startContainer) || n.setStart(t, 0), t.contains(n.endContainer) || n.setEnd(t, t.childNodes.length), n;
|
|
233
|
-
},
|
|
233
|
+
}, Pe = (e, t) => {
|
|
234
234
|
const { left: n, top: o, right: i, bottom: r } = e;
|
|
235
235
|
return new DOMRect(n - t.left, o - t.top, i - n, r - o);
|
|
236
236
|
}, Eo = (e, t) => {
|
|
237
237
|
const { left: n, top: o, right: i, bottom: r } = e;
|
|
238
238
|
return new DOMRect(n + t.left, o + t.top, i - n, r - o);
|
|
239
|
-
},
|
|
239
|
+
}, De = (e) => ({
|
|
240
240
|
...e,
|
|
241
241
|
type: e.type,
|
|
242
242
|
x: e.x,
|
|
@@ -262,7 +262,7 @@ const q = {
|
|
|
262
262
|
pointerId: e.pointerId,
|
|
263
263
|
pointerType: e.pointerType,
|
|
264
264
|
timeStamp: e.timeStamp
|
|
265
|
-
}),
|
|
265
|
+
}), ye = (e) => ({
|
|
266
266
|
...e,
|
|
267
267
|
type: e.type,
|
|
268
268
|
key: e.key,
|
|
@@ -278,10 +278,10 @@ const q = {
|
|
|
278
278
|
defaultPrevented: e.defaultPrevented,
|
|
279
279
|
detail: e.detail,
|
|
280
280
|
timeStamp: e.timeStamp
|
|
281
|
-
}),
|
|
281
|
+
}), Ue = (e) => {
|
|
282
282
|
const { top: t, left: n } = e.getBoundingClientRect(), { innerWidth: o, innerHeight: i } = window, r = -n, s = -t, a = o - n, d = i - t;
|
|
283
283
|
return { top: t, left: n, minX: r, minY: s, maxX: a, maxY: d };
|
|
284
|
-
},
|
|
284
|
+
}, He = (e) => {
|
|
285
285
|
let t = /* @__PURE__ */ new Set();
|
|
286
286
|
return (o) => {
|
|
287
287
|
const i = o.map((r) => r.id);
|
|
@@ -290,83 +290,83 @@ const q = {
|
|
|
290
290
|
}, It = (e, t, n, o) => {
|
|
291
291
|
const { store: i, selection: r, hover: s } = t;
|
|
292
292
|
let a, d, f;
|
|
293
|
-
const
|
|
294
|
-
const { x:
|
|
295
|
-
|
|
293
|
+
const h = He(n), l = (T) => {
|
|
294
|
+
const { x: B, y: m } = e.getBoundingClientRect(), S = i.getAt(T.clientX - B, T.clientY - m, d);
|
|
295
|
+
S ? s.current !== S.id && (e.classList.add("hovered"), s.set(S.id)) : s.current && (e.classList.remove("hovered"), s.set(null));
|
|
296
296
|
};
|
|
297
297
|
e.addEventListener("pointermove", l);
|
|
298
|
-
const
|
|
298
|
+
const g = (T = !1) => {
|
|
299
299
|
f && f.clear();
|
|
300
|
-
const
|
|
301
|
-
const
|
|
302
|
-
return { annotation:
|
|
300
|
+
const B = Ue(e), { minX: m, minY: S, maxX: E, maxY: L } = B, R = d ? i.getIntersecting(m, S, E, L).filter(({ annotation: U }) => d(U)) : i.getIntersecting(m, S, E, L), N = r.selected.map(({ id: U }) => U), X = R.map(({ annotation: U, rects: be }) => {
|
|
301
|
+
const we = N.includes(U.id), Ae = U.id === s.current;
|
|
302
|
+
return { annotation: U, rects: be, state: { selected: we, hover: Ae } };
|
|
303
303
|
});
|
|
304
|
-
o.redraw(
|
|
304
|
+
o.redraw(X, B, a, f, T), setTimeout(() => h(R.map(({ annotation: U }) => U)), 1);
|
|
305
305
|
}, c = (T) => {
|
|
306
|
-
f = T,
|
|
307
|
-
},
|
|
308
|
-
a = T,
|
|
309
|
-
},
|
|
310
|
-
d = T,
|
|
311
|
-
},
|
|
312
|
-
i.observe(
|
|
313
|
-
const p = r.subscribe(() =>
|
|
306
|
+
f = T, g();
|
|
307
|
+
}, A = (T) => {
|
|
308
|
+
a = T, g();
|
|
309
|
+
}, C = (T) => {
|
|
310
|
+
d = T, g(!1);
|
|
311
|
+
}, b = () => g();
|
|
312
|
+
i.observe(b);
|
|
313
|
+
const p = r.subscribe(() => g()), u = () => g(!0);
|
|
314
314
|
document.addEventListener("scroll", u, { capture: !0, passive: !0 });
|
|
315
|
-
const
|
|
316
|
-
i.recalculatePositions(), f && f.reset(),
|
|
315
|
+
const w = Nt(() => {
|
|
316
|
+
i.recalculatePositions(), f && f.reset(), g();
|
|
317
317
|
});
|
|
318
|
-
window.addEventListener("resize",
|
|
319
|
-
const
|
|
320
|
-
|
|
321
|
-
const
|
|
322
|
-
T.every((
|
|
318
|
+
window.addEventListener("resize", w);
|
|
319
|
+
const x = new ResizeObserver(w);
|
|
320
|
+
x.observe(e);
|
|
321
|
+
const v = { attributes: !0, childList: !0, subtree: !0 }, M = new MutationObserver((T) => {
|
|
322
|
+
T.every((m) => m.target === e || e.contains(m.target)) || g(!0);
|
|
323
323
|
});
|
|
324
|
-
return
|
|
324
|
+
return M.observe(document.body, v), {
|
|
325
325
|
destroy: () => {
|
|
326
|
-
e.removeEventListener("pointermove", l), o.destroy(), i.unobserve(
|
|
326
|
+
e.removeEventListener("pointermove", l), o.destroy(), i.unobserve(b), p(), document.removeEventListener("scroll", u), window.removeEventListener("resize", w), x.disconnect(), M.disconnect();
|
|
327
327
|
},
|
|
328
|
-
redraw:
|
|
329
|
-
setStyle:
|
|
330
|
-
setFilter:
|
|
328
|
+
redraw: g,
|
|
329
|
+
setStyle: A,
|
|
330
|
+
setFilter: C,
|
|
331
331
|
setPainter: c,
|
|
332
332
|
setVisible: o.setVisible
|
|
333
333
|
};
|
|
334
|
-
},
|
|
334
|
+
}, _e = () => {
|
|
335
335
|
const e = document.createElement("canvas");
|
|
336
336
|
return e.width = window.innerWidth, e.height = window.innerHeight, e.className = "r6o-canvas-highlight-layer bg", e;
|
|
337
|
-
},
|
|
337
|
+
}, Ye = (e, t) => {
|
|
338
338
|
e.width = window.innerWidth, e.height = window.innerHeight;
|
|
339
|
-
},
|
|
339
|
+
}, Xe = (e) => {
|
|
340
340
|
e.classList.add("r6o-annotatable");
|
|
341
|
-
const t =
|
|
341
|
+
const t = _e(), n = t.getContext("2d");
|
|
342
342
|
document.body.appendChild(t);
|
|
343
|
-
const o = (a, d, f,
|
|
344
|
-
const { width: l, height:
|
|
345
|
-
n.clearRect(-0.5, -0.5, l + 1,
|
|
346
|
-
const { top: c, left:
|
|
347
|
-
[...a].sort((
|
|
348
|
-
const { annotation: { target: { created: u } } } =
|
|
349
|
-
return u.getTime() -
|
|
350
|
-
}).forEach((
|
|
351
|
-
var
|
|
352
|
-
const p = f ? typeof f == "function" ? f(
|
|
353
|
-
x:
|
|
354
|
-
y:
|
|
343
|
+
const o = (a, d, f, h) => requestAnimationFrame(() => {
|
|
344
|
+
const { width: l, height: g } = t;
|
|
345
|
+
n.clearRect(-0.5, -0.5, l + 1, g + 1), h && h.clear();
|
|
346
|
+
const { top: c, left: A } = d;
|
|
347
|
+
[...a].sort((b, p) => {
|
|
348
|
+
const { annotation: { target: { created: u } } } = b, { annotation: { target: { created: w } } } = p;
|
|
349
|
+
return u.getTime() - w.getTime();
|
|
350
|
+
}).forEach((b) => {
|
|
351
|
+
var x;
|
|
352
|
+
const p = f ? typeof f == "function" ? f(b.annotation, b.state) : f : (x = b.state) != null && x.selected ? gt : q, u = h && h.paint(b, d) || p, w = b.rects.map(({ x: v, y: M, width: k, height: T }) => ({
|
|
353
|
+
x: v + A,
|
|
354
|
+
y: M + c,
|
|
355
355
|
width: k,
|
|
356
356
|
height: T
|
|
357
357
|
}));
|
|
358
|
-
if (n.fillStyle = u.fill, n.globalAlpha = u.fillOpacity || 1,
|
|
359
|
-
({ x:
|
|
358
|
+
if (n.fillStyle = u.fill, n.globalAlpha = u.fillOpacity || 1, w.forEach(
|
|
359
|
+
({ x: v, y: M, width: k, height: T }) => n.fillRect(v, M, k, T)
|
|
360
360
|
), u.underlineColor) {
|
|
361
361
|
n.globalAlpha = 1, n.strokeStyle = u.underlineColor, n.lineWidth = u.underlineThickness ?? 1;
|
|
362
|
-
const
|
|
363
|
-
|
|
364
|
-
n.beginPath(), n.moveTo(
|
|
362
|
+
const v = u.underlineOffset ?? 0;
|
|
363
|
+
w.forEach(({ x: M, y: k, width: T, height: B }) => {
|
|
364
|
+
n.beginPath(), n.moveTo(M, k + B + v), n.lineTo(M + T, k + B + v), n.stroke();
|
|
365
365
|
});
|
|
366
366
|
}
|
|
367
367
|
});
|
|
368
368
|
}), i = Nt(() => {
|
|
369
|
-
|
|
369
|
+
Ye(t);
|
|
370
370
|
});
|
|
371
371
|
return window.addEventListener("resize", i), {
|
|
372
372
|
destroy: () => {
|
|
@@ -377,8 +377,8 @@ const q = {
|
|
|
377
377
|
},
|
|
378
378
|
redraw: o
|
|
379
379
|
};
|
|
380
|
-
},
|
|
381
|
-
var
|
|
380
|
+
}, $e = (e, t, n) => It(e, t, n, Xe(e));
|
|
381
|
+
var je = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, G = function(e) {
|
|
382
382
|
return typeof e == "string" ? e.length > 0 : typeof e == "number";
|
|
383
383
|
}, F = function(e, t, n) {
|
|
384
384
|
return t === void 0 && (t = 0), n === void 0 && (n = Math.pow(10, t)), Math.round(n * e) / n + 0;
|
|
@@ -390,7 +390,7 @@ var Ge = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, G = function(e) {
|
|
|
390
390
|
return { r: H(e.r, 0, 255), g: H(e.g, 0, 255), b: H(e.b, 0, 255), a: H(e.a) };
|
|
391
391
|
}, wt = function(e) {
|
|
392
392
|
return { r: F(e.r), g: F(e.g), b: F(e.b), a: F(e.a, 3) };
|
|
393
|
-
},
|
|
393
|
+
}, Ge = /^#([0-9a-f]{3,8})$/i, ct = function(e) {
|
|
394
394
|
var t = e.toString(16);
|
|
395
395
|
return t.length < 2 ? "0" + t : t;
|
|
396
396
|
}, re = function(e) {
|
|
@@ -411,16 +411,16 @@ var Ge = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, G = function(e) {
|
|
|
411
411
|
}, it = function(e) {
|
|
412
412
|
return { h: (t = re(e)).h, s: (i = (200 - (n = t.s)) * (o = t.v) / 100) > 0 && i < 200 ? n * o / 100 / (i <= 100 ? i : 200 - i) * 100 : 0, l: i / 2, a: t.a };
|
|
413
413
|
var t, n, o, i;
|
|
414
|
-
},
|
|
415
|
-
var t =
|
|
414
|
+
}, We = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, ze = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, qe = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, Ze = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, Xt = { string: [[function(e) {
|
|
415
|
+
var t = Ge.exec(e);
|
|
416
416
|
return t ? (e = t[1]).length <= 4 ? { r: parseInt(e[0] + e[0], 16), g: parseInt(e[1] + e[1], 16), b: parseInt(e[2] + e[2], 16), a: e.length === 4 ? F(parseInt(e[3] + e[3], 16) / 255, 2) : 1 } : e.length === 6 || e.length === 8 ? { r: parseInt(e.substr(0, 2), 16), g: parseInt(e.substr(2, 2), 16), b: parseInt(e.substr(4, 2), 16), a: e.length === 8 ? F(parseInt(e.substr(6, 2), 16) / 255, 2) : 1 } : null : null;
|
|
417
417
|
}, "hex"], [function(e) {
|
|
418
|
-
var t =
|
|
418
|
+
var t = qe.exec(e) || Ze.exec(e);
|
|
419
419
|
return t ? t[2] !== t[4] || t[4] !== t[6] ? null : Ut({ r: Number(t[1]) / (t[2] ? 100 / 255 : 1), g: Number(t[3]) / (t[4] ? 100 / 255 : 1), b: Number(t[5]) / (t[6] ? 100 / 255 : 1), a: t[7] === void 0 ? 1 : Number(t[7]) / (t[8] ? 100 : 1) }) : null;
|
|
420
420
|
}, "rgb"], [function(e) {
|
|
421
|
-
var t =
|
|
421
|
+
var t = We.exec(e) || ze.exec(e);
|
|
422
422
|
if (!t) return null;
|
|
423
|
-
var n, o, i = Ht({ h: (n = t[1], o = t[2], o === void 0 && (o = "deg"), Number(n) * (
|
|
423
|
+
var n, o, i = Ht({ h: (n = t[1], o = t[2], o === void 0 && (o = "deg"), Number(n) * (je[o] || 1)), s: Number(t[3]), l: Number(t[4]), a: t[5] === void 0 ? 1 : Number(t[5]) / (t[6] ? 100 : 1) });
|
|
424
424
|
return Yt(i);
|
|
425
425
|
}, "hsl"]], object: [[function(e) {
|
|
426
426
|
var t = e.r, n = e.g, o = e.b, i = e.a, r = i === void 0 ? 1 : i;
|
|
@@ -443,28 +443,28 @@ var Ge = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, G = function(e) {
|
|
|
443
443
|
if (o) return [o, t[n][1]];
|
|
444
444
|
}
|
|
445
445
|
return [null, void 0];
|
|
446
|
-
},
|
|
446
|
+
}, Je = function(e) {
|
|
447
447
|
return typeof e == "string" ? $t(e.trim(), Xt.string) : typeof e == "object" && e !== null ? $t(e, Xt.object) : [null, void 0];
|
|
448
448
|
}, At = function(e, t) {
|
|
449
449
|
var n = it(e);
|
|
450
450
|
return { h: n.h, s: H(n.s + 100 * t, 0, 100), l: n.l, a: n.a };
|
|
451
|
-
},
|
|
451
|
+
}, vt = function(e) {
|
|
452
452
|
return (299 * e.r + 587 * e.g + 114 * e.b) / 1e3 / 255;
|
|
453
453
|
}, jt = function(e, t) {
|
|
454
454
|
var n = it(e);
|
|
455
455
|
return { h: n.h, s: n.s, l: H(n.l + 100 * t, 0, 100), a: n.a };
|
|
456
456
|
}, Gt = function() {
|
|
457
457
|
function e(t) {
|
|
458
|
-
this.parsed =
|
|
458
|
+
this.parsed = Je(t)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 };
|
|
459
459
|
}
|
|
460
460
|
return e.prototype.isValid = function() {
|
|
461
461
|
return this.parsed !== null;
|
|
462
462
|
}, e.prototype.brightness = function() {
|
|
463
|
-
return F(
|
|
463
|
+
return F(vt(this.rgba), 2);
|
|
464
464
|
}, e.prototype.isDark = function() {
|
|
465
|
-
return
|
|
465
|
+
return vt(this.rgba) < 0.5;
|
|
466
466
|
}, e.prototype.isLight = function() {
|
|
467
|
-
return
|
|
467
|
+
return vt(this.rgba) >= 0.5;
|
|
468
468
|
}, e.prototype.toHex = function() {
|
|
469
469
|
return t = wt(this.rgba), n = t.r, o = t.g, i = t.b, s = (r = t.a) < 1 ? ct(F(255 * r)) : "", "#" + ct(n) + ct(o) + ct(i) + s;
|
|
470
470
|
var t, n, o, i, r, s;
|
|
@@ -482,39 +482,39 @@ var Ge = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, G = function(e) {
|
|
|
482
482
|
return t = re(this.rgba), { h: F(t.h), s: F(t.s), v: F(t.v), a: F(t.a, 3) };
|
|
483
483
|
var t;
|
|
484
484
|
}, e.prototype.invert = function() {
|
|
485
|
-
return
|
|
485
|
+
return _({ r: 255 - (t = this.rgba).r, g: 255 - t.g, b: 255 - t.b, a: t.a });
|
|
486
486
|
var t;
|
|
487
487
|
}, e.prototype.saturate = function(t) {
|
|
488
|
-
return t === void 0 && (t = 0.1),
|
|
488
|
+
return t === void 0 && (t = 0.1), _(At(this.rgba, t));
|
|
489
489
|
}, e.prototype.desaturate = function(t) {
|
|
490
|
-
return t === void 0 && (t = 0.1),
|
|
490
|
+
return t === void 0 && (t = 0.1), _(At(this.rgba, -t));
|
|
491
491
|
}, e.prototype.grayscale = function() {
|
|
492
|
-
return
|
|
492
|
+
return _(At(this.rgba, -1));
|
|
493
493
|
}, e.prototype.lighten = function(t) {
|
|
494
|
-
return t === void 0 && (t = 0.1),
|
|
494
|
+
return t === void 0 && (t = 0.1), _(jt(this.rgba, t));
|
|
495
495
|
}, e.prototype.darken = function(t) {
|
|
496
|
-
return t === void 0 && (t = 0.1),
|
|
496
|
+
return t === void 0 && (t = 0.1), _(jt(this.rgba, -t));
|
|
497
497
|
}, e.prototype.rotate = function(t) {
|
|
498
498
|
return t === void 0 && (t = 15), this.hue(this.hue() + t);
|
|
499
499
|
}, e.prototype.alpha = function(t) {
|
|
500
|
-
return typeof t == "number" ?
|
|
500
|
+
return typeof t == "number" ? _({ r: (n = this.rgba).r, g: n.g, b: n.b, a: t }) : F(this.rgba.a, 3);
|
|
501
501
|
var n;
|
|
502
502
|
}, e.prototype.hue = function(t) {
|
|
503
503
|
var n = it(this.rgba);
|
|
504
|
-
return typeof t == "number" ?
|
|
504
|
+
return typeof t == "number" ? _({ h: t, s: n.s, l: n.l, a: n.a }) : F(n.h);
|
|
505
505
|
}, e.prototype.isEqual = function(t) {
|
|
506
|
-
return this.toHex() ===
|
|
506
|
+
return this.toHex() === _(t).toHex();
|
|
507
507
|
}, e;
|
|
508
|
-
}(),
|
|
508
|
+
}(), _ = function(e) {
|
|
509
509
|
return e instanceof Gt ? e : new Gt(e);
|
|
510
510
|
};
|
|
511
|
-
const
|
|
512
|
-
`background-color:${
|
|
511
|
+
const Qe = (e) => [
|
|
512
|
+
`background-color:${_((e == null ? void 0 : e.fill) || q.fill).alpha((e == null ? void 0 : e.fillOpacity) === void 0 ? q.fillOpacity : e.fillOpacity).toHex()}`,
|
|
513
513
|
e != null && e.underlineThickness ? "text-decoration:underline" : void 0,
|
|
514
514
|
e != null && e.underlineColor ? `text-decoration-color:${e.underlineColor}` : void 0,
|
|
515
515
|
e != null && e.underlineOffset ? `text-underline-offset:${e.underlineOffset}px` : void 0,
|
|
516
516
|
e != null && e.underlineThickness ? `text-decoration-thickness:${e.underlineThickness}px` : void 0
|
|
517
|
-
].filter(Boolean).join(";"),
|
|
517
|
+
].filter(Boolean).join(";"), Ke = () => {
|
|
518
518
|
const e = document.createElement("style");
|
|
519
519
|
document.getElementsByTagName("head")[0].appendChild(e);
|
|
520
520
|
let t = /* @__PURE__ */ new Set();
|
|
@@ -529,19 +529,19 @@ const Ke = (e) => [
|
|
|
529
529
|
d && d.clear();
|
|
530
530
|
const f = new Set(r.map((l) => l.annotation.id));
|
|
531
531
|
Array.from(t).filter((l) => !f.has(l));
|
|
532
|
-
const
|
|
533
|
-
var
|
|
534
|
-
const
|
|
535
|
-
return `::highlight(_${l.annotation.id}) { ${
|
|
532
|
+
const h = r.map((l) => {
|
|
533
|
+
var A;
|
|
534
|
+
const g = a ? typeof a == "function" ? a(l.annotation, l.state) : a : (A = l.state) != null && A.selected ? gt : q, c = d && d.paint(l, s) || g;
|
|
535
|
+
return `::highlight(_${l.annotation.id}) { ${Qe(c)} }`;
|
|
536
536
|
});
|
|
537
|
-
e.innerHTML =
|
|
537
|
+
e.innerHTML = h.join(`
|
|
538
538
|
`), CSS.highlights.clear(), r.forEach(({ annotation: l }) => {
|
|
539
|
-
const
|
|
539
|
+
const g = l.target.selector.map((A) => A.range), c = new Highlight(...g);
|
|
540
540
|
CSS.highlights.set(`_${l.id}`, c);
|
|
541
541
|
}), t = f;
|
|
542
542
|
}
|
|
543
543
|
};
|
|
544
|
-
},
|
|
544
|
+
}, tn = (e, t, n) => It(e, t, n, Ke());
|
|
545
545
|
var Wt = Object.prototype.hasOwnProperty;
|
|
546
546
|
function Vt(e, t) {
|
|
547
547
|
var n, o;
|
|
@@ -563,10 +563,10 @@ function Vt(e, t) {
|
|
|
563
563
|
}
|
|
564
564
|
return e !== e && t !== t;
|
|
565
565
|
}
|
|
566
|
-
const
|
|
566
|
+
const en = (e, t) => {
|
|
567
567
|
const n = (r, s) => r.x <= s.x + s.width && r.x + r.width >= s.x && r.y <= s.y + s.height && r.y + r.height >= s.y, o = (r) => r.rects.reduce((s, a) => s + a.width, 0), i = t.filter(({ rects: r }) => r.some((s) => n(e, s)));
|
|
568
568
|
return i.sort((r, s) => o(s) - o(r)), i.findIndex((r) => r.rects.includes(e));
|
|
569
|
-
},
|
|
569
|
+
}, nn = (e) => {
|
|
570
570
|
e.classList.add("r6o-annotatable");
|
|
571
571
|
const t = document.createElement("div");
|
|
572
572
|
t.className = "r6o-span-highlight-layer", e.insertBefore(t, e.firstChild);
|
|
@@ -575,14 +575,14 @@ const nn = (e, t) => {
|
|
|
575
575
|
destroy: () => {
|
|
576
576
|
t.remove();
|
|
577
577
|
},
|
|
578
|
-
redraw: (s, a, d, f,
|
|
579
|
-
const
|
|
580
|
-
!f && !
|
|
581
|
-
c.rects.map((
|
|
582
|
-
const
|
|
583
|
-
if (
|
|
578
|
+
redraw: (s, a, d, f, h) => {
|
|
579
|
+
const g = !(Vt(n, s) && h);
|
|
580
|
+
!f && !g || (g && (t.innerHTML = ""), s.forEach((c) => {
|
|
581
|
+
c.rects.map((A) => {
|
|
582
|
+
const C = en(A, s), b = ve(c, a, d, f, C);
|
|
583
|
+
if (g) {
|
|
584
584
|
const p = document.createElement("span");
|
|
585
|
-
p.className = "r6o-annotation", p.dataset.annotation = c.annotation.id, p.style.left = `${
|
|
585
|
+
p.className = "r6o-annotation", p.dataset.annotation = c.annotation.id, p.style.left = `${A.x}px`, p.style.top = `${A.y}px`, p.style.width = `${A.width}px`, p.style.height = `${A.height}px`, p.style.backgroundColor = _((b == null ? void 0 : b.fill) || q.fill).alpha((b == null ? void 0 : b.fillOpacity) === void 0 ? q.fillOpacity : b.fillOpacity).toHex(), b.underlineStyle && (p.style.borderStyle = b.underlineStyle), b.underlineColor && (p.style.borderColor = b.underlineColor), b.underlineThickness && (p.style.borderBottomWidth = `${b.underlineThickness}px`), b.underlineOffset && (p.style.paddingBottom = `${b.underlineOffset}px`), t.appendChild(p);
|
|
586
586
|
}
|
|
587
587
|
});
|
|
588
588
|
}), n = s);
|
|
@@ -591,29 +591,29 @@ const nn = (e, t) => {
|
|
|
591
591
|
s ? t.classList.remove("hidden") : t.classList.add("hidden");
|
|
592
592
|
}
|
|
593
593
|
};
|
|
594
|
-
},
|
|
594
|
+
}, on = (e, t, n) => It(e, t, n, nn(e));
|
|
595
595
|
var P = [];
|
|
596
|
-
for (var
|
|
597
|
-
P.push((
|
|
598
|
-
function
|
|
596
|
+
for (var St = 0; St < 256; ++St)
|
|
597
|
+
P.push((St + 256).toString(16).slice(1));
|
|
598
|
+
function rn(e, t = 0) {
|
|
599
599
|
return (P[e[t + 0]] + P[e[t + 1]] + P[e[t + 2]] + P[e[t + 3]] + "-" + P[e[t + 4]] + P[e[t + 5]] + "-" + P[e[t + 6]] + P[e[t + 7]] + "-" + P[e[t + 8]] + P[e[t + 9]] + "-" + P[e[t + 10]] + P[e[t + 11]] + P[e[t + 12]] + P[e[t + 13]] + P[e[t + 14]] + P[e[t + 15]]).toLowerCase();
|
|
600
600
|
}
|
|
601
|
-
var dt,
|
|
602
|
-
function
|
|
601
|
+
var dt, an = new Uint8Array(16);
|
|
602
|
+
function sn() {
|
|
603
603
|
if (!dt && (dt = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !dt))
|
|
604
604
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
605
|
-
return dt(
|
|
605
|
+
return dt(an);
|
|
606
606
|
}
|
|
607
|
-
var
|
|
607
|
+
var ln = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
608
608
|
const zt = {
|
|
609
|
-
randomUUID:
|
|
609
|
+
randomUUID: ln
|
|
610
610
|
};
|
|
611
611
|
function se(e, t, n) {
|
|
612
612
|
if (zt.randomUUID && !t && !e)
|
|
613
613
|
return zt.randomUUID();
|
|
614
614
|
e = e || {};
|
|
615
|
-
var o = e.random || (e.rng ||
|
|
616
|
-
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128,
|
|
615
|
+
var o = e.random || (e.rng || sn)();
|
|
616
|
+
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, rn(o);
|
|
617
617
|
}
|
|
618
618
|
var qt = Object.prototype.hasOwnProperty;
|
|
619
619
|
function K(e, t) {
|
|
@@ -638,7 +638,7 @@ function K(e, t) {
|
|
|
638
638
|
}
|
|
639
639
|
function Ct() {
|
|
640
640
|
}
|
|
641
|
-
function
|
|
641
|
+
function cn(e, t) {
|
|
642
642
|
return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
|
|
643
643
|
}
|
|
644
644
|
const Z = [];
|
|
@@ -646,7 +646,7 @@ function Ft(e, t = Ct) {
|
|
|
646
646
|
let n;
|
|
647
647
|
const o = /* @__PURE__ */ new Set();
|
|
648
648
|
function i(a) {
|
|
649
|
-
if (
|
|
649
|
+
if (cn(e, a) && (e = a, n)) {
|
|
650
650
|
const d = !Z.length;
|
|
651
651
|
for (const f of o)
|
|
652
652
|
f[1](), Z.push(f, e);
|
|
@@ -668,7 +668,7 @@ function Ft(e, t = Ct) {
|
|
|
668
668
|
}
|
|
669
669
|
return { set: i, update: r, subscribe: s };
|
|
670
670
|
}
|
|
671
|
-
const
|
|
671
|
+
const dn = (e) => {
|
|
672
672
|
const { subscribe: t, set: n } = Ft();
|
|
673
673
|
let o;
|
|
674
674
|
return t((i) => o = i), e.observe(({ changes: i }) => {
|
|
@@ -685,8 +685,8 @@ const un = (e) => {
|
|
|
685
685
|
set: n
|
|
686
686
|
};
|
|
687
687
|
};
|
|
688
|
-
var
|
|
689
|
-
const xt = { selected: [] },
|
|
688
|
+
var un = /* @__PURE__ */ ((e) => (e.EDIT = "EDIT", e.SELECT = "SELECT", e.NONE = "NONE", e))(un || {});
|
|
689
|
+
const xt = { selected: [] }, fn = (e, t = "EDIT") => {
|
|
690
690
|
const { subscribe: n, set: o } = Ft(xt);
|
|
691
691
|
let i = t, r = xt;
|
|
692
692
|
n((c) => r = c);
|
|
@@ -696,40 +696,40 @@ const xt = { selected: [] }, pn = (e, t = "EDIT") => {
|
|
|
696
696
|
}, d = (c) => {
|
|
697
697
|
if (a())
|
|
698
698
|
return !1;
|
|
699
|
-
const
|
|
700
|
-
return r.selected.some((
|
|
701
|
-
}, f = (c,
|
|
702
|
-
const
|
|
703
|
-
if (!
|
|
699
|
+
const A = typeof c == "string" ? c : c.id;
|
|
700
|
+
return r.selected.some((C) => C.id === A);
|
|
701
|
+
}, f = (c, A) => {
|
|
702
|
+
const C = e.getAnnotation(c);
|
|
703
|
+
if (!C) {
|
|
704
704
|
console.warn("Invalid selection: " + c);
|
|
705
705
|
return;
|
|
706
706
|
}
|
|
707
|
-
switch (Zt(
|
|
707
|
+
switch (Zt(C, i)) {
|
|
708
708
|
case "EDIT":
|
|
709
|
-
o({ selected: [{ id: c, editable: !0 }], event:
|
|
709
|
+
o({ selected: [{ id: c, editable: !0 }], event: A });
|
|
710
710
|
break;
|
|
711
711
|
case "SELECT":
|
|
712
|
-
o({ selected: [{ id: c }], event:
|
|
712
|
+
o({ selected: [{ id: c }], event: A });
|
|
713
713
|
break;
|
|
714
714
|
default:
|
|
715
|
-
o({ selected: [], event:
|
|
715
|
+
o({ selected: [], event: A });
|
|
716
716
|
}
|
|
717
|
-
},
|
|
718
|
-
const
|
|
717
|
+
}, h = (c, A) => {
|
|
718
|
+
const C = Array.isArray(c) ? c : [c], b = C.map((p) => e.getAnnotation(p)).filter((p) => !!p);
|
|
719
719
|
o({
|
|
720
|
-
selected:
|
|
721
|
-
const u =
|
|
720
|
+
selected: b.map((p) => {
|
|
721
|
+
const u = A === void 0 ? Zt(p, i) === "EDIT" : A;
|
|
722
722
|
return { id: p.id, editable: u };
|
|
723
723
|
})
|
|
724
|
-
}),
|
|
724
|
+
}), b.length !== C.length && console.warn("Invalid selection", c);
|
|
725
725
|
}, l = (c) => {
|
|
726
726
|
if (a())
|
|
727
727
|
return !1;
|
|
728
|
-
const { selected:
|
|
729
|
-
|
|
730
|
-
},
|
|
728
|
+
const { selected: A } = r;
|
|
729
|
+
A.some(({ id: C }) => c.includes(C)) && o({ selected: A.filter(({ id: C }) => !c.includes(C)) });
|
|
730
|
+
}, g = (c) => i = c;
|
|
731
731
|
return e.observe(
|
|
732
|
-
({ changes: c }) => l((c.deleted || []).map((
|
|
732
|
+
({ changes: c }) => l((c.deleted || []).map((A) => A.id))
|
|
733
733
|
), {
|
|
734
734
|
get event() {
|
|
735
735
|
return r ? r.event : null;
|
|
@@ -740,8 +740,8 @@ const xt = { selected: [] }, pn = (e, t = "EDIT") => {
|
|
|
740
740
|
clear: s,
|
|
741
741
|
isEmpty: a,
|
|
742
742
|
isSelected: d,
|
|
743
|
-
setSelected:
|
|
744
|
-
setUserSelectAction:
|
|
743
|
+
setSelected: h,
|
|
744
|
+
setUserSelectAction: g,
|
|
745
745
|
subscribe: n,
|
|
746
746
|
userSelect: f
|
|
747
747
|
};
|
|
@@ -749,54 +749,54 @@ const xt = { selected: [] }, pn = (e, t = "EDIT") => {
|
|
|
749
749
|
var D = [];
|
|
750
750
|
for (var Et = 0; Et < 256; ++Et)
|
|
751
751
|
D.push((Et + 256).toString(16).slice(1));
|
|
752
|
-
function
|
|
752
|
+
function pn(e, t = 0) {
|
|
753
753
|
return (D[e[t + 0]] + D[e[t + 1]] + D[e[t + 2]] + D[e[t + 3]] + "-" + D[e[t + 4]] + D[e[t + 5]] + "-" + D[e[t + 6]] + D[e[t + 7]] + "-" + D[e[t + 8]] + D[e[t + 9]] + "-" + D[e[t + 10]] + D[e[t + 11]] + D[e[t + 12]] + D[e[t + 13]] + D[e[t + 14]] + D[e[t + 15]]).toLowerCase();
|
|
754
754
|
}
|
|
755
|
-
var ut,
|
|
756
|
-
function
|
|
755
|
+
var ut, hn = new Uint8Array(16);
|
|
756
|
+
function gn() {
|
|
757
757
|
if (!ut && (ut = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ut))
|
|
758
758
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
759
|
-
return ut(
|
|
759
|
+
return ut(hn);
|
|
760
760
|
}
|
|
761
|
-
var
|
|
761
|
+
var mn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
762
762
|
const Jt = {
|
|
763
|
-
randomUUID:
|
|
763
|
+
randomUUID: mn
|
|
764
764
|
};
|
|
765
|
-
function
|
|
765
|
+
function bn(e, t, n) {
|
|
766
766
|
if (Jt.randomUUID && !t && !e)
|
|
767
767
|
return Jt.randomUUID();
|
|
768
768
|
e = e || {};
|
|
769
|
-
var o = e.random || (e.rng ||
|
|
770
|
-
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128,
|
|
769
|
+
var o = e.random || (e.rng || gn)();
|
|
770
|
+
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, pn(o);
|
|
771
771
|
}
|
|
772
772
|
const Lo = (e, t, n, o) => ({
|
|
773
|
-
id:
|
|
773
|
+
id: bn(),
|
|
774
774
|
annotation: typeof e == "string" ? e : e.id,
|
|
775
775
|
created: n || /* @__PURE__ */ new Date(),
|
|
776
776
|
creator: o,
|
|
777
777
|
...t
|
|
778
|
-
}),
|
|
778
|
+
}), wn = (e, t) => {
|
|
779
779
|
const n = new Set(e.bodies.map((o) => o.id));
|
|
780
780
|
return t.bodies.filter((o) => !n.has(o.id));
|
|
781
|
-
},
|
|
781
|
+
}, An = (e, t) => {
|
|
782
782
|
const n = new Set(t.bodies.map((o) => o.id));
|
|
783
783
|
return e.bodies.filter((o) => !n.has(o.id));
|
|
784
784
|
}, vn = (e, t) => t.bodies.map((n) => {
|
|
785
785
|
const o = e.bodies.find((i) => i.id === n.id);
|
|
786
786
|
return { newBody: n, oldBody: o && !K(o, n) ? o : void 0 };
|
|
787
|
-
}).filter(({ oldBody: n }) => n).map(({ oldBody: n, newBody: o }) => ({ oldBody: n, newBody: o })),
|
|
788
|
-
const n =
|
|
787
|
+
}).filter(({ oldBody: n }) => n).map(({ oldBody: n, newBody: o }) => ({ oldBody: n, newBody: o })), Sn = (e, t) => !K(e.target, t.target), le = (e, t) => {
|
|
788
|
+
const n = wn(e, t), o = An(e, t), i = vn(e, t);
|
|
789
789
|
return {
|
|
790
790
|
oldValue: e,
|
|
791
791
|
newValue: t,
|
|
792
792
|
bodiesCreated: n.length > 0 ? n : void 0,
|
|
793
793
|
bodiesDeleted: o.length > 0 ? o : void 0,
|
|
794
794
|
bodiesUpdated: i.length > 0 ? i : void 0,
|
|
795
|
-
targetUpdated:
|
|
795
|
+
targetUpdated: Sn(e, t) ? { oldTarget: e.target, newTarget: t.target } : void 0
|
|
796
796
|
};
|
|
797
797
|
};
|
|
798
798
|
var V = /* @__PURE__ */ ((e) => (e.LOCAL = "LOCAL", e.REMOTE = "REMOTE", e))(V || {});
|
|
799
|
-
const
|
|
799
|
+
const Cn = (e, t) => {
|
|
800
800
|
var n, o;
|
|
801
801
|
const { changes: i, origin: r } = t;
|
|
802
802
|
if (!(!e.options.origin || e.options.origin === r))
|
|
@@ -804,7 +804,7 @@ const xn = (e, t) => {
|
|
|
804
804
|
if (e.options.ignore) {
|
|
805
805
|
const { ignore: s } = e.options, a = (d) => d && d.length > 0;
|
|
806
806
|
if (!(a(i.created) || a(i.deleted))) {
|
|
807
|
-
const d = (n = i.updated) == null ? void 0 : n.some((
|
|
807
|
+
const d = (n = i.updated) == null ? void 0 : n.some((h) => a(h.bodiesCreated) || a(h.bodiesDeleted) || a(h.bodiesUpdated)), f = (o = i.updated) == null ? void 0 : o.some((h) => h.targetUpdated);
|
|
808
808
|
if (s === "BODY_ONLY" && d && !f || s === "TARGET_ONLY" && f && !d)
|
|
809
809
|
return !1;
|
|
810
810
|
}
|
|
@@ -818,219 +818,219 @@ const xn = (e, t) => {
|
|
|
818
818
|
return !!(Array.isArray(e.options.annotations) ? e.options.annotations : [e.options.annotations]).find((a) => s.has(a));
|
|
819
819
|
} else
|
|
820
820
|
return !0;
|
|
821
|
-
},
|
|
821
|
+
}, xn = (e, t) => {
|
|
822
822
|
const n = new Set((e.created || []).map((l) => l.id)), o = new Set((e.updated || []).map(({ newValue: l }) => l.id)), i = new Set((t.created || []).map((l) => l.id)), r = new Set((t.deleted || []).map((l) => l.id)), s = new Set((t.updated || []).map(({ oldValue: l }) => l.id)), a = new Set((t.updated || []).filter(({ oldValue: l }) => n.has(l.id) || o.has(l.id)).map(({ oldValue: l }) => l.id)), d = [
|
|
823
|
-
...(e.created || []).filter((l) => !r.has(l.id)).map((l) => s.has(l.id) ? t.updated.find(({ oldValue:
|
|
823
|
+
...(e.created || []).filter((l) => !r.has(l.id)).map((l) => s.has(l.id) ? t.updated.find(({ oldValue: g }) => g.id === l.id).newValue : l),
|
|
824
824
|
...t.created || []
|
|
825
825
|
], f = [
|
|
826
826
|
...(e.deleted || []).filter((l) => !i.has(l.id)),
|
|
827
827
|
...(t.deleted || []).filter((l) => !n.has(l.id))
|
|
828
|
-
],
|
|
828
|
+
], h = [
|
|
829
829
|
...(e.updated || []).filter(({ newValue: l }) => !r.has(l.id)).map((l) => {
|
|
830
|
-
const { oldValue:
|
|
830
|
+
const { oldValue: g, newValue: c } = l;
|
|
831
831
|
if (s.has(c.id)) {
|
|
832
|
-
const
|
|
833
|
-
return le(
|
|
832
|
+
const A = t.updated.find((C) => C.oldValue.id === c.id).newValue;
|
|
833
|
+
return le(g, A);
|
|
834
834
|
} else
|
|
835
835
|
return l;
|
|
836
836
|
}),
|
|
837
837
|
...(t.updated || []).filter(({ oldValue: l }) => !a.has(l.id))
|
|
838
838
|
];
|
|
839
|
-
return { created: d, deleted: f, updated:
|
|
840
|
-
},
|
|
841
|
-
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (
|
|
842
|
-
const
|
|
843
|
-
|
|
844
|
-
}, r = (
|
|
845
|
-
const
|
|
846
|
-
origin:
|
|
839
|
+
return { created: d, deleted: f, updated: h };
|
|
840
|
+
}, En = (e) => e.id !== void 0, Ln = () => {
|
|
841
|
+
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (m, S = {}) => n.push({ onChange: m, options: S }), i = (m) => {
|
|
842
|
+
const S = n.findIndex((E) => E.onChange == m);
|
|
843
|
+
S > -1 && n.splice(S, 1);
|
|
844
|
+
}, r = (m, S) => {
|
|
845
|
+
const E = {
|
|
846
|
+
origin: m,
|
|
847
847
|
changes: {
|
|
848
|
-
created:
|
|
849
|
-
updated:
|
|
850
|
-
deleted:
|
|
848
|
+
created: S.created || [],
|
|
849
|
+
updated: S.updated || [],
|
|
850
|
+
deleted: S.deleted || []
|
|
851
851
|
},
|
|
852
852
|
state: [...e.values()]
|
|
853
853
|
};
|
|
854
854
|
n.forEach((L) => {
|
|
855
|
-
|
|
855
|
+
Cn(L, E) && L.onChange(E);
|
|
856
856
|
});
|
|
857
|
-
}, s = (
|
|
858
|
-
if (e.get(
|
|
859
|
-
throw Error(`Cannot add annotation ${
|
|
860
|
-
e.set(
|
|
861
|
-
}, a = (
|
|
862
|
-
const
|
|
857
|
+
}, s = (m, S = V.LOCAL) => {
|
|
858
|
+
if (e.get(m.id))
|
|
859
|
+
throw Error(`Cannot add annotation ${m.id} - exists already`);
|
|
860
|
+
e.set(m.id, m), m.bodies.forEach((E) => t.set(E.id, m.id)), r(S, { created: [m] });
|
|
861
|
+
}, a = (m, S) => {
|
|
862
|
+
const E = typeof m == "string" ? S : m, L = typeof m == "string" ? m : m.id, R = e.get(L);
|
|
863
863
|
if (R) {
|
|
864
|
-
const
|
|
865
|
-
return L ===
|
|
864
|
+
const N = le(R, E);
|
|
865
|
+
return L === E.id ? e.set(L, E) : (e.delete(L), e.set(E.id, E)), R.bodies.forEach((X) => t.delete(X.id)), E.bodies.forEach((X) => t.set(X.id, E.id)), N;
|
|
866
866
|
} else
|
|
867
867
|
console.warn(`Cannot update annotation ${L} - does not exist`);
|
|
868
|
-
}, d = (
|
|
869
|
-
const L =
|
|
868
|
+
}, d = (m, S = V.LOCAL, E = V.LOCAL) => {
|
|
869
|
+
const L = En(S) ? E : S, R = a(m, S);
|
|
870
870
|
R && r(L, { updated: [R] });
|
|
871
|
-
}, f = (
|
|
872
|
-
const
|
|
873
|
-
const
|
|
874
|
-
return
|
|
871
|
+
}, f = (m, S = V.LOCAL) => {
|
|
872
|
+
const E = m.reduce((L, R) => {
|
|
873
|
+
const N = a(R);
|
|
874
|
+
return N ? [...L, N] : L;
|
|
875
875
|
}, []);
|
|
876
|
-
|
|
877
|
-
},
|
|
878
|
-
const
|
|
879
|
-
if (
|
|
876
|
+
E.length > 0 && r(S, { updated: E });
|
|
877
|
+
}, h = (m, S = V.LOCAL) => {
|
|
878
|
+
const E = e.get(m.annotation);
|
|
879
|
+
if (E) {
|
|
880
880
|
const L = {
|
|
881
|
-
...
|
|
882
|
-
bodies: [...
|
|
881
|
+
...E,
|
|
882
|
+
bodies: [...E.bodies, m]
|
|
883
883
|
};
|
|
884
|
-
e.set(
|
|
885
|
-
oldValue:
|
|
884
|
+
e.set(E.id, L), t.set(m.id, L.id), r(S, { updated: [{
|
|
885
|
+
oldValue: E,
|
|
886
886
|
newValue: L,
|
|
887
|
-
bodiesCreated: [
|
|
887
|
+
bodiesCreated: [m]
|
|
888
888
|
}] });
|
|
889
889
|
} else
|
|
890
|
-
console.warn(`Attempt to add body to missing annotation: ${
|
|
891
|
-
}, l = () => [...e.values()],
|
|
892
|
-
const
|
|
893
|
-
e.clear(), t.clear(), r(
|
|
894
|
-
}, c = (
|
|
895
|
-
if (
|
|
890
|
+
console.warn(`Attempt to add body to missing annotation: ${m.annotation}`);
|
|
891
|
+
}, l = () => [...e.values()], g = (m = V.LOCAL) => {
|
|
892
|
+
const S = [...e.values()];
|
|
893
|
+
e.clear(), t.clear(), r(m, { deleted: S });
|
|
894
|
+
}, c = (m, S = !0, E = V.LOCAL) => {
|
|
895
|
+
if (S) {
|
|
896
896
|
const L = [...e.values()];
|
|
897
|
-
e.clear(), t.clear(),
|
|
898
|
-
e.set(R.id, R), R.bodies.forEach((
|
|
899
|
-
}), r(
|
|
897
|
+
e.clear(), t.clear(), m.forEach((R) => {
|
|
898
|
+
e.set(R.id, R), R.bodies.forEach((N) => t.set(N.id, R.id));
|
|
899
|
+
}), r(E, { created: m, deleted: L });
|
|
900
900
|
} else {
|
|
901
|
-
const L =
|
|
902
|
-
const
|
|
903
|
-
return
|
|
901
|
+
const L = m.reduce((R, N) => {
|
|
902
|
+
const X = e.get(N.id);
|
|
903
|
+
return X ? [...R, X] : R;
|
|
904
904
|
}, []);
|
|
905
905
|
if (L.length > 0)
|
|
906
906
|
throw Error(`Bulk insert would overwrite the following annotations: ${L.map((R) => R.id).join(", ")}`);
|
|
907
|
-
|
|
908
|
-
e.set(R.id, R), R.bodies.forEach((
|
|
909
|
-
}), r(
|
|
907
|
+
m.forEach((R) => {
|
|
908
|
+
e.set(R.id, R), R.bodies.forEach((N) => t.set(N.id, R.id));
|
|
909
|
+
}), r(E, { created: m });
|
|
910
910
|
}
|
|
911
|
-
},
|
|
912
|
-
const
|
|
913
|
-
if (
|
|
914
|
-
return e.delete(
|
|
915
|
-
console.warn(`Attempt to delete missing annotation: ${
|
|
916
|
-
},
|
|
917
|
-
const
|
|
918
|
-
|
|
919
|
-
},
|
|
920
|
-
const
|
|
921
|
-
const
|
|
922
|
-
return
|
|
911
|
+
}, A = (m) => {
|
|
912
|
+
const S = typeof m == "string" ? m : m.id, E = e.get(S);
|
|
913
|
+
if (E)
|
|
914
|
+
return e.delete(S), E.bodies.forEach((L) => t.delete(L.id)), E;
|
|
915
|
+
console.warn(`Attempt to delete missing annotation: ${S}`);
|
|
916
|
+
}, C = (m, S = V.LOCAL) => {
|
|
917
|
+
const E = A(m);
|
|
918
|
+
E && r(S, { deleted: [E] });
|
|
919
|
+
}, b = (m, S = V.LOCAL) => {
|
|
920
|
+
const E = m.reduce((L, R) => {
|
|
921
|
+
const N = A(R);
|
|
922
|
+
return N ? [...L, N] : L;
|
|
923
923
|
}, []);
|
|
924
|
-
|
|
925
|
-
}, p = (
|
|
926
|
-
const
|
|
927
|
-
if (
|
|
928
|
-
const
|
|
929
|
-
if (
|
|
930
|
-
t.delete(
|
|
924
|
+
E.length > 0 && r(S, { deleted: E });
|
|
925
|
+
}, p = (m) => {
|
|
926
|
+
const S = e.get(m.annotation);
|
|
927
|
+
if (S) {
|
|
928
|
+
const E = S.bodies.find((L) => L.id === m.id);
|
|
929
|
+
if (E) {
|
|
930
|
+
t.delete(E.id);
|
|
931
931
|
const L = {
|
|
932
|
-
...
|
|
933
|
-
bodies:
|
|
932
|
+
...S,
|
|
933
|
+
bodies: S.bodies.filter((R) => R.id !== m.id)
|
|
934
934
|
};
|
|
935
|
-
return e.set(
|
|
936
|
-
oldValue:
|
|
935
|
+
return e.set(S.id, L), {
|
|
936
|
+
oldValue: S,
|
|
937
937
|
newValue: L,
|
|
938
|
-
bodiesDeleted: [
|
|
938
|
+
bodiesDeleted: [E]
|
|
939
939
|
};
|
|
940
940
|
} else
|
|
941
|
-
console.warn(`Attempt to delete missing body ${
|
|
941
|
+
console.warn(`Attempt to delete missing body ${m.id} from annotation ${m.annotation}`);
|
|
942
942
|
} else
|
|
943
|
-
console.warn(`Attempt to delete body from missing annotation ${
|
|
944
|
-
}, u = (
|
|
945
|
-
const
|
|
946
|
-
|
|
947
|
-
},
|
|
948
|
-
const
|
|
949
|
-
|
|
950
|
-
},
|
|
951
|
-
const
|
|
952
|
-
return
|
|
953
|
-
},
|
|
954
|
-
const
|
|
955
|
-
if (
|
|
956
|
-
const
|
|
957
|
-
if (
|
|
958
|
-
return
|
|
959
|
-
console.error(`Store integrity error: body ${
|
|
943
|
+
console.warn(`Attempt to delete body from missing annotation ${m.annotation}`);
|
|
944
|
+
}, u = (m, S = V.LOCAL) => {
|
|
945
|
+
const E = p(m);
|
|
946
|
+
E && r(S, { updated: [E] });
|
|
947
|
+
}, w = (m, S = V.LOCAL) => {
|
|
948
|
+
const E = m.map((L) => p(L)).filter(Boolean);
|
|
949
|
+
E.length > 0 && r(S, { updated: E });
|
|
950
|
+
}, x = (m) => {
|
|
951
|
+
const S = e.get(m);
|
|
952
|
+
return S ? { ...S } : void 0;
|
|
953
|
+
}, v = (m) => {
|
|
954
|
+
const S = t.get(m);
|
|
955
|
+
if (S) {
|
|
956
|
+
const E = x(S).bodies.find((L) => L.id === m);
|
|
957
|
+
if (E)
|
|
958
|
+
return E;
|
|
959
|
+
console.error(`Store integrity error: body ${m} in index, but not in annotation`);
|
|
960
960
|
} else
|
|
961
|
-
console.warn(`Attempt to retrieve missing body: ${
|
|
962
|
-
},
|
|
963
|
-
if (
|
|
961
|
+
console.warn(`Attempt to retrieve missing body: ${m}`);
|
|
962
|
+
}, M = (m, S) => {
|
|
963
|
+
if (m.annotation !== S.annotation)
|
|
964
964
|
throw "Annotation integrity violation: annotation ID must be the same when updating bodies";
|
|
965
|
-
const
|
|
966
|
-
if (
|
|
967
|
-
const L =
|
|
968
|
-
...
|
|
969
|
-
bodies:
|
|
965
|
+
const E = e.get(m.annotation);
|
|
966
|
+
if (E) {
|
|
967
|
+
const L = E.bodies.find((N) => N.id === m.id), R = {
|
|
968
|
+
...E,
|
|
969
|
+
bodies: E.bodies.map((N) => N.id === L.id ? S : N)
|
|
970
970
|
};
|
|
971
|
-
return e.set(
|
|
972
|
-
oldValue:
|
|
971
|
+
return e.set(E.id, R), L.id !== S.id && (t.delete(L.id), t.set(S.id, R.id)), {
|
|
972
|
+
oldValue: E,
|
|
973
973
|
newValue: R,
|
|
974
|
-
bodiesUpdated: [{ oldBody: L, newBody:
|
|
974
|
+
bodiesUpdated: [{ oldBody: L, newBody: S }]
|
|
975
975
|
};
|
|
976
976
|
} else
|
|
977
|
-
console.warn(`Attempt to add body to missing annotation ${
|
|
978
|
-
}, k = (
|
|
979
|
-
const L =
|
|
980
|
-
L && r(
|
|
981
|
-
}, T = (
|
|
982
|
-
const
|
|
983
|
-
r(
|
|
984
|
-
},
|
|
985
|
-
const
|
|
986
|
-
if (
|
|
987
|
-
const
|
|
988
|
-
...
|
|
977
|
+
console.warn(`Attempt to add body to missing annotation ${m.annotation}`);
|
|
978
|
+
}, k = (m, S, E = V.LOCAL) => {
|
|
979
|
+
const L = M(m, S);
|
|
980
|
+
L && r(E, { updated: [L] });
|
|
981
|
+
}, T = (m, S = V.LOCAL) => {
|
|
982
|
+
const E = m.map((L) => M({ id: L.id, annotation: L.annotation }, L)).filter(Boolean);
|
|
983
|
+
r(S, { updated: E });
|
|
984
|
+
}, B = (m) => {
|
|
985
|
+
const S = e.get(m.annotation);
|
|
986
|
+
if (S) {
|
|
987
|
+
const E = {
|
|
988
|
+
...S,
|
|
989
989
|
target: {
|
|
990
|
-
...
|
|
991
|
-
...
|
|
990
|
+
...S.target,
|
|
991
|
+
...m
|
|
992
992
|
}
|
|
993
993
|
};
|
|
994
|
-
return e.set(
|
|
995
|
-
oldValue:
|
|
996
|
-
newValue:
|
|
994
|
+
return e.set(S.id, E), {
|
|
995
|
+
oldValue: S,
|
|
996
|
+
newValue: E,
|
|
997
997
|
targetUpdated: {
|
|
998
|
-
oldTarget:
|
|
999
|
-
newTarget:
|
|
998
|
+
oldTarget: S.target,
|
|
999
|
+
newTarget: m
|
|
1000
1000
|
}
|
|
1001
1001
|
};
|
|
1002
1002
|
} else
|
|
1003
|
-
console.warn(`Attempt to update target on missing annotation: ${
|
|
1003
|
+
console.warn(`Attempt to update target on missing annotation: ${m.annotation}`);
|
|
1004
1004
|
};
|
|
1005
1005
|
return {
|
|
1006
1006
|
addAnnotation: s,
|
|
1007
|
-
addBody:
|
|
1007
|
+
addBody: h,
|
|
1008
1008
|
all: l,
|
|
1009
1009
|
bulkAddAnnotation: c,
|
|
1010
|
-
bulkDeleteAnnotation:
|
|
1011
|
-
bulkDeleteBodies:
|
|
1010
|
+
bulkDeleteAnnotation: b,
|
|
1011
|
+
bulkDeleteBodies: w,
|
|
1012
1012
|
bulkUpdateAnnotation: f,
|
|
1013
1013
|
bulkUpdateBodies: T,
|
|
1014
|
-
bulkUpdateTargets: (
|
|
1015
|
-
const
|
|
1016
|
-
|
|
1014
|
+
bulkUpdateTargets: (m, S = V.LOCAL) => {
|
|
1015
|
+
const E = m.map((L) => B(L)).filter(Boolean);
|
|
1016
|
+
E.length > 0 && r(S, { updated: E });
|
|
1017
1017
|
},
|
|
1018
|
-
clear:
|
|
1019
|
-
deleteAnnotation:
|
|
1018
|
+
clear: g,
|
|
1019
|
+
deleteAnnotation: C,
|
|
1020
1020
|
deleteBody: u,
|
|
1021
|
-
getAnnotation:
|
|
1022
|
-
getBody:
|
|
1021
|
+
getAnnotation: x,
|
|
1022
|
+
getBody: v,
|
|
1023
1023
|
observe: o,
|
|
1024
1024
|
unobserve: i,
|
|
1025
1025
|
updateAnnotation: d,
|
|
1026
1026
|
updateBody: k,
|
|
1027
|
-
updateTarget: (
|
|
1028
|
-
const
|
|
1029
|
-
|
|
1027
|
+
updateTarget: (m, S = V.LOCAL) => {
|
|
1028
|
+
const E = B(m);
|
|
1029
|
+
E && r(S, { updated: [E] });
|
|
1030
1030
|
}
|
|
1031
1031
|
};
|
|
1032
1032
|
};
|
|
1033
|
-
let
|
|
1033
|
+
let Tn = () => ({
|
|
1034
1034
|
emit(e, ...t) {
|
|
1035
1035
|
for (let n = 0, o = this.events[e] || [], i = o.length; n < i; n++)
|
|
1036
1036
|
o[n](...t);
|
|
@@ -1044,119 +1044,119 @@ let Mn = () => ({
|
|
|
1044
1044
|
};
|
|
1045
1045
|
}
|
|
1046
1046
|
});
|
|
1047
|
-
const
|
|
1048
|
-
const t =
|
|
1047
|
+
const Mn = 250, Bn = (e) => {
|
|
1048
|
+
const t = Tn(), n = [];
|
|
1049
1049
|
let o = -1, i = !1, r = 0;
|
|
1050
1050
|
const s = (c) => {
|
|
1051
1051
|
if (!i) {
|
|
1052
|
-
const { changes:
|
|
1053
|
-
if (
|
|
1054
|
-
n.splice(o + 1), n.push(
|
|
1052
|
+
const { changes: A } = c, C = performance.now();
|
|
1053
|
+
if (C - r > Mn)
|
|
1054
|
+
n.splice(o + 1), n.push(A), o = n.length - 1;
|
|
1055
1055
|
else {
|
|
1056
|
-
const
|
|
1057
|
-
n[
|
|
1056
|
+
const b = n.length - 1;
|
|
1057
|
+
n[b] = xn(n[b], A);
|
|
1058
1058
|
}
|
|
1059
|
-
r =
|
|
1059
|
+
r = C;
|
|
1060
1060
|
}
|
|
1061
1061
|
i = !1;
|
|
1062
1062
|
};
|
|
1063
1063
|
e.observe(s, { origin: V.LOCAL });
|
|
1064
|
-
const a = (c) => c && c.length > 0 && e.bulkDeleteAnnotation(c), d = (c) => c && c.length > 0 && e.bulkAddAnnotation(c, !1), f = (c) => c && c.length > 0 && e.bulkUpdateAnnotation(c.map(({ oldValue:
|
|
1064
|
+
const a = (c) => c && c.length > 0 && e.bulkDeleteAnnotation(c), d = (c) => c && c.length > 0 && e.bulkAddAnnotation(c, !1), f = (c) => c && c.length > 0 && e.bulkUpdateAnnotation(c.map(({ oldValue: A }) => A)), h = (c) => c && c.length > 0 && e.bulkUpdateAnnotation(c.map(({ newValue: A }) => A)), l = (c) => c && c.length > 0 && e.bulkAddAnnotation(c, !1), g = (c) => c && c.length > 0 && e.bulkDeleteAnnotation(c);
|
|
1065
1065
|
return {
|
|
1066
1066
|
canRedo: () => n.length - 1 > o,
|
|
1067
1067
|
canUndo: () => o > -1,
|
|
1068
1068
|
destroy: () => e.unobserve(s),
|
|
1069
|
-
on: (c,
|
|
1069
|
+
on: (c, A) => t.on(c, A),
|
|
1070
1070
|
redo: () => {
|
|
1071
1071
|
if (n.length - 1 > o) {
|
|
1072
1072
|
i = !0;
|
|
1073
|
-
const { created: c, updated:
|
|
1074
|
-
d(c),
|
|
1073
|
+
const { created: c, updated: A, deleted: C } = n[o + 1];
|
|
1074
|
+
d(c), h(A), g(C), t.emit("redo", n[o + 1]), o += 1;
|
|
1075
1075
|
}
|
|
1076
1076
|
},
|
|
1077
1077
|
undo: () => {
|
|
1078
1078
|
if (o > -1) {
|
|
1079
1079
|
i = !0;
|
|
1080
|
-
const { created: c, updated:
|
|
1081
|
-
a(c), f(
|
|
1080
|
+
const { created: c, updated: A, deleted: C } = n[o];
|
|
1081
|
+
a(c), f(A), l(C), t.emit("undo", n[o]), o -= 1;
|
|
1082
1082
|
}
|
|
1083
1083
|
}
|
|
1084
1084
|
};
|
|
1085
|
-
},
|
|
1085
|
+
}, Rn = () => {
|
|
1086
1086
|
const { subscribe: e, set: t } = Ft([]);
|
|
1087
1087
|
return {
|
|
1088
1088
|
subscribe: e,
|
|
1089
1089
|
set: t
|
|
1090
1090
|
};
|
|
1091
|
-
},
|
|
1091
|
+
}, kn = (e, t, n, o) => {
|
|
1092
1092
|
const { store: i, selection: r, hover: s, viewport: a } = e, d = /* @__PURE__ */ new Map();
|
|
1093
|
-
let f = [],
|
|
1094
|
-
const l = (
|
|
1095
|
-
d.has(
|
|
1096
|
-
},
|
|
1097
|
-
const p = d.get(
|
|
1093
|
+
let f = [], h;
|
|
1094
|
+
const l = (C, b) => {
|
|
1095
|
+
d.has(C) ? d.get(C).push(b) : d.set(C, [b]);
|
|
1096
|
+
}, g = (C, b) => {
|
|
1097
|
+
const p = d.get(C);
|
|
1098
1098
|
if (p) {
|
|
1099
|
-
const u = p.indexOf(
|
|
1099
|
+
const u = p.indexOf(b);
|
|
1100
1100
|
u !== -1 && p.splice(u, 1);
|
|
1101
1101
|
}
|
|
1102
|
-
}, c = (
|
|
1103
|
-
d.has(
|
|
1104
|
-
d.get(
|
|
1102
|
+
}, c = (C, b, p) => {
|
|
1103
|
+
d.has(C) && setTimeout(() => {
|
|
1104
|
+
d.get(C).forEach((u) => {
|
|
1105
1105
|
if (n) {
|
|
1106
|
-
const
|
|
1107
|
-
u(
|
|
1106
|
+
const w = Array.isArray(b) ? b.map((v) => n.serialize(v)) : n.serialize(b), x = p ? p instanceof PointerEvent ? p : n.serialize(p) : void 0;
|
|
1107
|
+
u(w, x);
|
|
1108
1108
|
} else
|
|
1109
|
-
u(
|
|
1109
|
+
u(b, p);
|
|
1110
1110
|
});
|
|
1111
1111
|
}, 1);
|
|
1112
1112
|
};
|
|
1113
|
-
r.subscribe(({ selected:
|
|
1114
|
-
if (!(f.length === 0 &&
|
|
1115
|
-
if (f.length === 0 &&
|
|
1116
|
-
f =
|
|
1117
|
-
else if (f.length > 0 &&
|
|
1118
|
-
f.forEach((
|
|
1119
|
-
const p = i.getAnnotation(
|
|
1120
|
-
p && !K(p,
|
|
1113
|
+
r.subscribe(({ selected: C }) => {
|
|
1114
|
+
if (!(f.length === 0 && C.length === 0)) {
|
|
1115
|
+
if (f.length === 0 && C.length > 0)
|
|
1116
|
+
f = C.map(({ id: b }) => i.getAnnotation(b));
|
|
1117
|
+
else if (f.length > 0 && C.length === 0)
|
|
1118
|
+
f.forEach((b) => {
|
|
1119
|
+
const p = i.getAnnotation(b.id);
|
|
1120
|
+
p && !K(p, b) && c("updateAnnotation", p, b);
|
|
1121
1121
|
}), f = [];
|
|
1122
1122
|
else {
|
|
1123
|
-
const
|
|
1123
|
+
const b = new Set(f.map((u) => u.id)), p = new Set(C.map(({ id: u }) => u));
|
|
1124
1124
|
f.filter((u) => !p.has(u.id)).forEach((u) => {
|
|
1125
|
-
const
|
|
1126
|
-
|
|
1125
|
+
const w = i.getAnnotation(u.id);
|
|
1126
|
+
w && !K(w, u) && c("updateAnnotation", w, u);
|
|
1127
1127
|
}), f = [
|
|
1128
1128
|
// Remove annotations that were deselected
|
|
1129
1129
|
...f.filter((u) => p.has(u.id)),
|
|
1130
1130
|
// Add editable annotations that were selected
|
|
1131
|
-
...
|
|
1131
|
+
...C.filter(({ id: u }) => !b.has(u)).map(({ id: u }) => i.getAnnotation(u))
|
|
1132
1132
|
];
|
|
1133
1133
|
}
|
|
1134
1134
|
c("selectionChanged", f);
|
|
1135
1135
|
}
|
|
1136
|
-
}), s.subscribe((
|
|
1137
|
-
!
|
|
1138
|
-
}), a == null || a.subscribe((
|
|
1139
|
-
const { created:
|
|
1140
|
-
(
|
|
1136
|
+
}), s.subscribe((C) => {
|
|
1137
|
+
!h && C ? c("mouseEnterAnnotation", i.getAnnotation(C)) : h && !C ? c("mouseLeaveAnnotation", i.getAnnotation(h)) : h && C && (c("mouseLeaveAnnotation", i.getAnnotation(h)), c("mouseEnterAnnotation", i.getAnnotation(C))), h = C;
|
|
1138
|
+
}), a == null || a.subscribe((C) => c("viewportIntersect", C.map((b) => i.getAnnotation(b)))), i.observe((C) => {
|
|
1139
|
+
const { created: b, deleted: p } = C.changes;
|
|
1140
|
+
(b || []).forEach((u) => c("createAnnotation", u)), (p || []).forEach((u) => c("deleteAnnotation", u)), (C.changes.updated || []).filter((u) => [
|
|
1141
1141
|
...u.bodiesCreated || [],
|
|
1142
1142
|
...u.bodiesDeleted || [],
|
|
1143
1143
|
...u.bodiesUpdated || []
|
|
1144
|
-
].length > 0).forEach(({ oldValue: u, newValue:
|
|
1145
|
-
const
|
|
1146
|
-
f = f.map((
|
|
1144
|
+
].length > 0).forEach(({ oldValue: u, newValue: w }) => {
|
|
1145
|
+
const x = f.find((v) => v.id === u.id) || u;
|
|
1146
|
+
f = f.map((v) => v.id === u.id ? w : v), c("updateAnnotation", w, x);
|
|
1147
1147
|
});
|
|
1148
|
-
}, { origin: V.LOCAL }), i.observe((
|
|
1148
|
+
}, { origin: V.LOCAL }), i.observe((C) => {
|
|
1149
1149
|
if (f) {
|
|
1150
|
-
const
|
|
1151
|
-
p.length > 0 && (f = f.map((u) => p.find((
|
|
1150
|
+
const b = new Set(f.map((u) => u.id)), p = (C.changes.updated || []).filter(({ newValue: u }) => b.has(u.id)).map(({ newValue: u }) => u);
|
|
1151
|
+
p.length > 0 && (f = f.map((u) => p.find((x) => x.id === u.id) || u));
|
|
1152
1152
|
}
|
|
1153
1153
|
}, { origin: V.REMOTE });
|
|
1154
|
-
const
|
|
1155
|
-
const { updated: p } =
|
|
1156
|
-
|
|
1154
|
+
const A = (C) => (b) => {
|
|
1155
|
+
const { updated: p } = b;
|
|
1156
|
+
C ? (p || []).forEach((u) => c("updateAnnotation", u.oldValue, u.newValue)) : (p || []).forEach((u) => c("updateAnnotation", u.newValue, u.oldValue));
|
|
1157
1157
|
};
|
|
1158
|
-
return t.on("undo",
|
|
1159
|
-
},
|
|
1158
|
+
return t.on("undo", A(!0)), t.on("redo", A(!1)), { on: l, off: g, emit: c };
|
|
1159
|
+
}, Vn = (e) => (t) => t.reduce((n, o) => {
|
|
1160
1160
|
const { parsed: i, error: r } = e.parse(o);
|
|
1161
1161
|
return r ? {
|
|
1162
1162
|
parsed: n.parsed,
|
|
@@ -1167,21 +1167,21 @@ const Bn = 250, Rn = (e) => {
|
|
|
1167
1167
|
} : {
|
|
1168
1168
|
...n
|
|
1169
1169
|
};
|
|
1170
|
-
}, { parsed: [], failed: [] }),
|
|
1170
|
+
}, { parsed: [], failed: [] }), On = (e, t, n) => {
|
|
1171
1171
|
const { store: o, selection: i } = e, r = (p) => {
|
|
1172
1172
|
if (n) {
|
|
1173
|
-
const { parsed: u, error:
|
|
1174
|
-
u ? o.addAnnotation(u, V.REMOTE) : console.error(
|
|
1173
|
+
const { parsed: u, error: w } = n.parse(p);
|
|
1174
|
+
u ? o.addAnnotation(u, V.REMOTE) : console.error(w);
|
|
1175
1175
|
} else
|
|
1176
1176
|
o.addAnnotation(p, V.REMOTE);
|
|
1177
1177
|
}, s = () => i.clear(), a = () => o.clear(), d = (p) => {
|
|
1178
1178
|
const u = o.getAnnotation(p);
|
|
1179
1179
|
return n && u ? n.serialize(u) : u;
|
|
1180
|
-
}, f = () => n ? o.all().map(n.serialize) : o.all(),
|
|
1180
|
+
}, f = () => n ? o.all().map(n.serialize) : o.all(), h = () => {
|
|
1181
1181
|
var p;
|
|
1182
|
-
const u = (((p = i.selected) == null ? void 0 : p.map((
|
|
1182
|
+
const u = (((p = i.selected) == null ? void 0 : p.map((w) => w.id)) || []).map((w) => o.getAnnotation(w)).filter(Boolean);
|
|
1183
1183
|
return n ? u.map(n.serialize) : u;
|
|
1184
|
-
}, l = (p, u = !0) => fetch(p).then((
|
|
1184
|
+
}, l = (p, u = !0) => fetch(p).then((w) => w.json()).then((w) => (c(w, u), w)), g = (p) => {
|
|
1185
1185
|
if (typeof p == "string") {
|
|
1186
1186
|
const u = o.getAnnotation(p);
|
|
1187
1187
|
if (o.deleteAnnotation(p), u)
|
|
@@ -1193,18 +1193,18 @@ const Bn = 250, Rn = (e) => {
|
|
|
1193
1193
|
}
|
|
1194
1194
|
}, c = (p, u = !0) => {
|
|
1195
1195
|
if (n) {
|
|
1196
|
-
const { parsed:
|
|
1197
|
-
|
|
1196
|
+
const { parsed: w, failed: x } = Vn(n)(p);
|
|
1197
|
+
x.length > 0 && console.warn(`Discarded ${x.length} invalid annotations`, x), o.bulkAddAnnotation(w, u, V.REMOTE);
|
|
1198
1198
|
} else
|
|
1199
1199
|
o.bulkAddAnnotation(p, u, V.REMOTE);
|
|
1200
|
-
},
|
|
1200
|
+
}, A = (p, u) => {
|
|
1201
1201
|
p ? i.setSelected(p, u) : i.clear();
|
|
1202
|
-
},
|
|
1202
|
+
}, C = (p) => {
|
|
1203
1203
|
i.clear(), i.setUserSelectAction(p);
|
|
1204
|
-
},
|
|
1204
|
+
}, b = (p) => {
|
|
1205
1205
|
if (n) {
|
|
1206
|
-
const u = n.parse(p).parsed,
|
|
1207
|
-
return o.updateAnnotation(u),
|
|
1206
|
+
const u = n.parse(p).parsed, w = n.serialize(o.getAnnotation(u.id));
|
|
1207
|
+
return o.updateAnnotation(u), w;
|
|
1208
1208
|
} else {
|
|
1209
1209
|
const u = o.getAnnotation(p.id);
|
|
1210
1210
|
return o.updateAnnotation(p), u;
|
|
@@ -1218,18 +1218,18 @@ const Bn = 250, Rn = (e) => {
|
|
|
1218
1218
|
clearAnnotations: a,
|
|
1219
1219
|
getAnnotationById: d,
|
|
1220
1220
|
getAnnotations: f,
|
|
1221
|
-
getSelected:
|
|
1221
|
+
getSelected: h,
|
|
1222
1222
|
loadAnnotations: l,
|
|
1223
1223
|
redo: t.redo,
|
|
1224
|
-
removeAnnotation:
|
|
1224
|
+
removeAnnotation: g,
|
|
1225
1225
|
setAnnotations: c,
|
|
1226
|
-
setSelected:
|
|
1227
|
-
setUserSelectAction:
|
|
1226
|
+
setSelected: A,
|
|
1227
|
+
setUserSelectAction: C,
|
|
1228
1228
|
undo: t.undo,
|
|
1229
|
-
updateAnnotation:
|
|
1229
|
+
updateAnnotation: b
|
|
1230
1230
|
};
|
|
1231
|
-
},
|
|
1232
|
-
let
|
|
1231
|
+
}, Nn = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
1232
|
+
let In = (e) => crypto.getRandomValues(new Uint8Array(e)), Fn = (e, t, n) => {
|
|
1233
1233
|
let o = (2 << Math.log(e.length - 1) / Math.LN2) - 1, i = -~(1.6 * o * t / e.length);
|
|
1234
1234
|
return (r = t) => {
|
|
1235
1235
|
let s = "";
|
|
@@ -1239,13 +1239,13 @@ let Fn = (e) => crypto.getRandomValues(new Uint8Array(e)), Pn = (e, t, n) => {
|
|
|
1239
1239
|
if (s += e[a[d] & o] || "", s.length === r) return s;
|
|
1240
1240
|
}
|
|
1241
1241
|
};
|
|
1242
|
-
},
|
|
1242
|
+
}, Pn = (e, t = 21) => Fn(e, t, In), Dn = (e = 21) => {
|
|
1243
1243
|
let t = "", n = crypto.getRandomValues(new Uint8Array(e));
|
|
1244
1244
|
for (; e--; )
|
|
1245
|
-
t +=
|
|
1245
|
+
t += Nn[n[e] & 63];
|
|
1246
1246
|
return t;
|
|
1247
1247
|
};
|
|
1248
|
-
const
|
|
1248
|
+
const yn = () => ({ isGuest: !0, id: Pn("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_", 20)() }), Un = (e) => {
|
|
1249
1249
|
const t = JSON.stringify(e);
|
|
1250
1250
|
let n = 0;
|
|
1251
1251
|
for (let o = 0, i = t.length; o < i; o++) {
|
|
@@ -1253,10 +1253,10 @@ const Un = () => ({ isGuest: !0, id: Dn("1234567890abcdefghijklmnopqrstuvwxyzABC
|
|
|
1253
1253
|
n = (n << 5) - n + r, n |= 0;
|
|
1254
1254
|
}
|
|
1255
1255
|
return `${n}`;
|
|
1256
|
-
}, ce = (e) => e ? typeof e == "object" ? { ...e } : e : void 0,
|
|
1257
|
-
const { id: o, type: i, purpose: r, value: s, created: a, modified: d, creator: f, ...
|
|
1256
|
+
}, ce = (e) => e ? typeof e == "object" ? { ...e } : e : void 0, Hn = (e, t) => (Array.isArray(e) ? e : [e]).map((n) => {
|
|
1257
|
+
const { id: o, type: i, purpose: r, value: s, created: a, modified: d, creator: f, ...h } = n;
|
|
1258
1258
|
return {
|
|
1259
|
-
id: o || `temp-${
|
|
1259
|
+
id: o || `temp-${Un(n)}`,
|
|
1260
1260
|
annotation: t,
|
|
1261
1261
|
type: i,
|
|
1262
1262
|
purpose: r,
|
|
@@ -1264,9 +1264,9 @@ const Un = () => ({ isGuest: !0, id: Dn("1234567890abcdefghijklmnopqrstuvwxyzABC
|
|
|
1264
1264
|
creator: ce(f),
|
|
1265
1265
|
created: a ? new Date(a) : void 0,
|
|
1266
1266
|
updated: d ? new Date(d) : void 0,
|
|
1267
|
-
...
|
|
1267
|
+
...h
|
|
1268
1268
|
};
|
|
1269
|
-
}),
|
|
1269
|
+
}), _n = (e) => e.map((t) => {
|
|
1270
1270
|
var n;
|
|
1271
1271
|
const { annotation: o, created: i, updated: r, ...s } = t, a = {
|
|
1272
1272
|
...s,
|
|
@@ -1275,11 +1275,11 @@ const Un = () => ({ isGuest: !0, id: Dn("1234567890abcdefghijklmnopqrstuvwxyzABC
|
|
|
1275
1275
|
};
|
|
1276
1276
|
return (n = a.id) != null && n.startsWith("temp-") && delete a.id, a;
|
|
1277
1277
|
});
|
|
1278
|
-
|
|
1278
|
+
Dn();
|
|
1279
1279
|
const To = (e, t) => ({
|
|
1280
|
-
parse: (n) =>
|
|
1281
|
-
serialize: (n) =>
|
|
1282
|
-
}),
|
|
1280
|
+
parse: (n) => $n(n),
|
|
1281
|
+
serialize: (n) => jn(n, e, t)
|
|
1282
|
+
}), Yn = (e) => e.quote !== void 0 && e.start !== void 0 && e.end !== void 0, Xn = (e) => {
|
|
1283
1283
|
const {
|
|
1284
1284
|
id: t,
|
|
1285
1285
|
creator: n,
|
|
@@ -1298,36 +1298,36 @@ const To = (e, t) => ({
|
|
|
1298
1298
|
styleClass: s[0].styleClass
|
|
1299
1299
|
};
|
|
1300
1300
|
for (const d of s) {
|
|
1301
|
-
const
|
|
1302
|
-
switch (
|
|
1301
|
+
const h = (Array.isArray(d.selector) ? d.selector : [d.selector]).reduce((l, g) => {
|
|
1302
|
+
switch (g.type) {
|
|
1303
1303
|
case "TextQuoteSelector":
|
|
1304
|
-
l.quote =
|
|
1304
|
+
l.quote = g.exact;
|
|
1305
1305
|
break;
|
|
1306
1306
|
case "TextPositionSelector":
|
|
1307
|
-
l.start =
|
|
1307
|
+
l.start = g.start, l.end = g.end;
|
|
1308
1308
|
break;
|
|
1309
1309
|
}
|
|
1310
1310
|
return l;
|
|
1311
1311
|
}, {});
|
|
1312
|
-
if (
|
|
1313
|
-
a.selector.push({ id: d.id, ...
|
|
1312
|
+
if (Yn(h))
|
|
1313
|
+
a.selector.push({ id: d.id, ...h });
|
|
1314
1314
|
else {
|
|
1315
1315
|
const l = [
|
|
1316
|
-
|
|
1317
|
-
|
|
1316
|
+
h.start ? void 0 : "TextPositionSelector",
|
|
1317
|
+
h.quote ? void 0 : "TextQuoteSelector"
|
|
1318
1318
|
].filter(Boolean);
|
|
1319
1319
|
return { error: Error(`Missing selector types: ${l.join(" and ")} for annotation: ${e.id}`) };
|
|
1320
1320
|
}
|
|
1321
1321
|
}
|
|
1322
1322
|
return { parsed: a };
|
|
1323
|
-
},
|
|
1323
|
+
}, $n = (e) => {
|
|
1324
1324
|
const t = e.id || se(), {
|
|
1325
1325
|
creator: n,
|
|
1326
1326
|
created: o,
|
|
1327
1327
|
modified: i,
|
|
1328
1328
|
body: r,
|
|
1329
1329
|
...s
|
|
1330
|
-
} = e, a =
|
|
1330
|
+
} = e, a = Hn(r, t), d = Xn(e);
|
|
1331
1331
|
return "error" in d ? { error: d.error } : {
|
|
1332
1332
|
parsed: {
|
|
1333
1333
|
...s,
|
|
@@ -1336,29 +1336,29 @@ const To = (e, t) => ({
|
|
|
1336
1336
|
target: d.parsed
|
|
1337
1337
|
}
|
|
1338
1338
|
};
|
|
1339
|
-
},
|
|
1339
|
+
}, jn = (e, t, n) => {
|
|
1340
1340
|
const { bodies: o, target: i, ...r } = e, {
|
|
1341
1341
|
selector: s,
|
|
1342
1342
|
creator: a,
|
|
1343
1343
|
created: d,
|
|
1344
1344
|
updated: f,
|
|
1345
|
-
...
|
|
1346
|
-
} = i, l = s.map((
|
|
1347
|
-
const { quote: c, start:
|
|
1345
|
+
...h
|
|
1346
|
+
} = i, l = s.map((g) => {
|
|
1347
|
+
const { quote: c, start: A, end: C, range: b } = g, { prefix: p, suffix: u } = Be(b, n), w = [{
|
|
1348
1348
|
type: "TextQuoteSelector",
|
|
1349
1349
|
exact: c,
|
|
1350
1350
|
prefix: p,
|
|
1351
1351
|
suffix: u
|
|
1352
1352
|
}, {
|
|
1353
1353
|
type: "TextPositionSelector",
|
|
1354
|
-
start:
|
|
1355
|
-
end:
|
|
1354
|
+
start: A,
|
|
1355
|
+
end: C
|
|
1356
1356
|
}];
|
|
1357
1357
|
return {
|
|
1358
|
-
...
|
|
1359
|
-
id:
|
|
1358
|
+
...h,
|
|
1359
|
+
id: g.id,
|
|
1360
1360
|
source: t,
|
|
1361
|
-
selector:
|
|
1361
|
+
selector: w
|
|
1362
1362
|
};
|
|
1363
1363
|
});
|
|
1364
1364
|
return {
|
|
@@ -1366,38 +1366,38 @@ const To = (e, t) => ({
|
|
|
1366
1366
|
"@context": "http://www.w3.org/ns/anno.jsonld",
|
|
1367
1367
|
id: e.id,
|
|
1368
1368
|
type: "Annotation",
|
|
1369
|
-
body:
|
|
1369
|
+
body: _n(e.bodies),
|
|
1370
1370
|
creator: a,
|
|
1371
1371
|
created: d == null ? void 0 : d.toISOString(),
|
|
1372
1372
|
modified: f == null ? void 0 : f.toISOString(),
|
|
1373
1373
|
target: l
|
|
1374
1374
|
};
|
|
1375
1375
|
};
|
|
1376
|
-
function
|
|
1377
|
-
de(e, t, n || 0, o || e.length - 1, i ||
|
|
1376
|
+
function Gn(e, t, n, o, i) {
|
|
1377
|
+
de(e, t, n || 0, o || e.length - 1, i || Wn);
|
|
1378
1378
|
}
|
|
1379
1379
|
function de(e, t, n, o, i) {
|
|
1380
1380
|
for (; o > n; ) {
|
|
1381
1381
|
if (o - n > 600) {
|
|
1382
|
-
var r = o - n + 1, s = t - n + 1, a = Math.log(r), d = 0.5 * Math.exp(2 * a / 3), f = 0.5 * Math.sqrt(a * d * (r - d) / r) * (s - r / 2 < 0 ? -1 : 1),
|
|
1383
|
-
de(e, t,
|
|
1382
|
+
var r = o - n + 1, s = t - n + 1, a = Math.log(r), d = 0.5 * Math.exp(2 * a / 3), f = 0.5 * Math.sqrt(a * d * (r - d) / r) * (s - r / 2 < 0 ? -1 : 1), h = Math.max(n, Math.floor(t - s * d / r + f)), l = Math.min(o, Math.floor(t + (r - s) * d / r + f));
|
|
1383
|
+
de(e, t, h, l, i);
|
|
1384
1384
|
}
|
|
1385
|
-
var
|
|
1386
|
-
for (tt(e, n, t), i(e[o],
|
|
1387
|
-
for (tt(e, c,
|
|
1388
|
-
for (; i(e[
|
|
1385
|
+
var g = e[t], c = n, A = o;
|
|
1386
|
+
for (tt(e, n, t), i(e[o], g) > 0 && tt(e, n, o); c < A; ) {
|
|
1387
|
+
for (tt(e, c, A), c++, A--; i(e[c], g) < 0; ) c++;
|
|
1388
|
+
for (; i(e[A], g) > 0; ) A--;
|
|
1389
1389
|
}
|
|
1390
|
-
i(e[n],
|
|
1390
|
+
i(e[n], g) === 0 ? tt(e, n, A) : (A++, tt(e, A, o)), A <= t && (n = A + 1), t <= A && (o = A - 1);
|
|
1391
1391
|
}
|
|
1392
1392
|
}
|
|
1393
1393
|
function tt(e, t, n) {
|
|
1394
1394
|
var o = e[t];
|
|
1395
1395
|
e[t] = e[n], e[n] = o;
|
|
1396
1396
|
}
|
|
1397
|
-
function
|
|
1397
|
+
function Wn(e, t) {
|
|
1398
1398
|
return e < t ? -1 : e > t ? 1 : 0;
|
|
1399
1399
|
}
|
|
1400
|
-
class
|
|
1400
|
+
class zn {
|
|
1401
1401
|
constructor(t = 9) {
|
|
1402
1402
|
this._maxEntries = Math.max(4, t), this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4)), this.clear();
|
|
1403
1403
|
}
|
|
@@ -1468,9 +1468,9 @@ class qn {
|
|
|
1468
1468
|
let a, d, f;
|
|
1469
1469
|
for (; o || r.length; ) {
|
|
1470
1470
|
if (o || (o = r.pop(), d = r[r.length - 1], a = s.pop(), f = !0), o.leaf) {
|
|
1471
|
-
const
|
|
1472
|
-
if (
|
|
1473
|
-
return o.children.splice(
|
|
1471
|
+
const h = qn(t, o.children, n);
|
|
1472
|
+
if (h !== -1)
|
|
1473
|
+
return o.children.splice(h, 1), r.push(o), this._condense(r), this;
|
|
1474
1474
|
}
|
|
1475
1475
|
!f && !o.leaf && Tt(o, i) ? (r.push(o), s.push(a), a = 0, d = o, o = o.children[0]) : d ? (a++, o = d.children[a], f = !1) : o = null;
|
|
1476
1476
|
}
|
|
@@ -1505,12 +1505,12 @@ class qn {
|
|
|
1505
1505
|
i || (i = Math.ceil(Math.log(r) / Math.log(s)), s = Math.ceil(r / Math.pow(s, i - 1))), a = Q([]), a.leaf = !1, a.height = i;
|
|
1506
1506
|
const d = Math.ceil(r / s), f = d * Math.ceil(Math.sqrt(s));
|
|
1507
1507
|
Qt(t, n, o, f, this.compareMinX);
|
|
1508
|
-
for (let
|
|
1509
|
-
const l = Math.min(
|
|
1510
|
-
Qt(t,
|
|
1511
|
-
for (let
|
|
1512
|
-
const c = Math.min(
|
|
1513
|
-
a.children.push(this._build(t,
|
|
1508
|
+
for (let h = n; h <= o; h += f) {
|
|
1509
|
+
const l = Math.min(h + f - 1, o);
|
|
1510
|
+
Qt(t, h, l, d, this.compareMinY);
|
|
1511
|
+
for (let g = h; g <= l; g += d) {
|
|
1512
|
+
const c = Math.min(g + d - 1, l);
|
|
1513
|
+
a.children.push(this._build(t, g, c, i - 1));
|
|
1514
1514
|
}
|
|
1515
1515
|
}
|
|
1516
1516
|
return J(a, this.toBBox), a;
|
|
@@ -1519,8 +1519,8 @@ class qn {
|
|
|
1519
1519
|
for (; i.push(n), !(n.leaf || i.length - 1 === o); ) {
|
|
1520
1520
|
let r = 1 / 0, s = 1 / 0, a;
|
|
1521
1521
|
for (let d = 0; d < n.children.length; d++) {
|
|
1522
|
-
const f = n.children[d],
|
|
1523
|
-
l < s ? (s = l, r =
|
|
1522
|
+
const f = n.children[d], h = Lt(f), l = Qn(t, f) - h;
|
|
1523
|
+
l < s ? (s = l, r = h < r ? h : r, a = f) : l === s && h < r && (r = h, a = f);
|
|
1524
1524
|
}
|
|
1525
1525
|
n = a || n.children[0];
|
|
1526
1526
|
}
|
|
@@ -1545,14 +1545,14 @@ class qn {
|
|
|
1545
1545
|
_chooseSplitIndex(t, n, o) {
|
|
1546
1546
|
let i, r = 1 / 0, s = 1 / 0;
|
|
1547
1547
|
for (let a = n; a <= o - n; a++) {
|
|
1548
|
-
const d = nt(t, 0, a, this.toBBox), f = nt(t, a, o, this.toBBox),
|
|
1549
|
-
|
|
1548
|
+
const d = nt(t, 0, a, this.toBBox), f = nt(t, a, o, this.toBBox), h = Kn(d, f), l = Lt(d) + Lt(f);
|
|
1549
|
+
h < r ? (r = h, i = a, s = l < s ? l : s) : h === r && l < s && (s = l, i = a);
|
|
1550
1550
|
}
|
|
1551
1551
|
return i || o - n;
|
|
1552
1552
|
}
|
|
1553
1553
|
// sorts node children by the best axis for split
|
|
1554
1554
|
_chooseSplitAxis(t, n, o) {
|
|
1555
|
-
const i = t.leaf ? this.compareMinX :
|
|
1555
|
+
const i = t.leaf ? this.compareMinX : Zn, r = t.leaf ? this.compareMinY : Jn, s = this._allDistMargin(t, n, o, i), a = this._allDistMargin(t, n, o, r);
|
|
1556
1556
|
s < a && t.children.sort(i);
|
|
1557
1557
|
}
|
|
1558
1558
|
// total margin of all possible split distributions where each node is at least m full
|
|
@@ -1561,12 +1561,12 @@ class qn {
|
|
|
1561
1561
|
const r = this.toBBox, s = nt(t, 0, n, r), a = nt(t, o - n, o, r);
|
|
1562
1562
|
let d = ft(s) + ft(a);
|
|
1563
1563
|
for (let f = n; f < o - n; f++) {
|
|
1564
|
-
const
|
|
1565
|
-
ot(s, t.leaf ? r(
|
|
1564
|
+
const h = t.children[f];
|
|
1565
|
+
ot(s, t.leaf ? r(h) : h), d += ft(s);
|
|
1566
1566
|
}
|
|
1567
1567
|
for (let f = o - n - 1; f >= n; f--) {
|
|
1568
|
-
const
|
|
1569
|
-
ot(a, t.leaf ? r(
|
|
1568
|
+
const h = t.children[f];
|
|
1569
|
+
ot(a, t.leaf ? r(h) : h), d += ft(a);
|
|
1570
1570
|
}
|
|
1571
1571
|
return d;
|
|
1572
1572
|
}
|
|
@@ -1579,7 +1579,7 @@ class qn {
|
|
|
1579
1579
|
t[n].children.length === 0 ? n > 0 ? (o = t[n - 1].children, o.splice(o.indexOf(t[n]), 1)) : this.clear() : J(t[n], this.toBBox);
|
|
1580
1580
|
}
|
|
1581
1581
|
}
|
|
1582
|
-
function
|
|
1582
|
+
function qn(e, t, n) {
|
|
1583
1583
|
if (!n) return t.indexOf(e);
|
|
1584
1584
|
for (let o = 0; o < t.length; o++)
|
|
1585
1585
|
if (n(e, t[o])) return o;
|
|
@@ -1599,10 +1599,10 @@ function nt(e, t, n, o, i) {
|
|
|
1599
1599
|
function ot(e, t) {
|
|
1600
1600
|
return e.minX = Math.min(e.minX, t.minX), e.minY = Math.min(e.minY, t.minY), e.maxX = Math.max(e.maxX, t.maxX), e.maxY = Math.max(e.maxY, t.maxY), e;
|
|
1601
1601
|
}
|
|
1602
|
-
function
|
|
1602
|
+
function Zn(e, t) {
|
|
1603
1603
|
return e.minX - t.minX;
|
|
1604
1604
|
}
|
|
1605
|
-
function
|
|
1605
|
+
function Jn(e, t) {
|
|
1606
1606
|
return e.minY - t.minY;
|
|
1607
1607
|
}
|
|
1608
1608
|
function Lt(e) {
|
|
@@ -1611,10 +1611,10 @@ function Lt(e) {
|
|
|
1611
1611
|
function ft(e) {
|
|
1612
1612
|
return e.maxX - e.minX + (e.maxY - e.minY);
|
|
1613
1613
|
}
|
|
1614
|
-
function
|
|
1614
|
+
function Qn(e, t) {
|
|
1615
1615
|
return (Math.max(t.maxX, e.maxX) - Math.min(t.minX, e.minX)) * (Math.max(t.maxY, e.maxY) - Math.min(t.minY, e.minY));
|
|
1616
1616
|
}
|
|
1617
|
-
function
|
|
1617
|
+
function Kn(e, t) {
|
|
1618
1618
|
const n = Math.max(e.minX, t.minX), o = Math.max(e.minY, t.minY), i = Math.min(e.maxX, t.maxX), r = Math.min(e.maxY, t.maxY);
|
|
1619
1619
|
return Math.max(0, i - n) * Math.max(0, r - o);
|
|
1620
1620
|
}
|
|
@@ -1640,10 +1640,10 @@ function Qt(e, t, n, o, i) {
|
|
|
1640
1640
|
for (; r.length; ) {
|
|
1641
1641
|
if (n = r.pop(), t = r.pop(), n - t <= o) continue;
|
|
1642
1642
|
const s = t + Math.ceil((n - t) / o / 2) * o;
|
|
1643
|
-
|
|
1643
|
+
Gn(e, s, t, n, i), r.push(t, s, s, n);
|
|
1644
1644
|
}
|
|
1645
1645
|
}
|
|
1646
|
-
let
|
|
1646
|
+
let to = () => ({
|
|
1647
1647
|
emit(e, ...t) {
|
|
1648
1648
|
for (let n = 0, o = this.events[e] || [], i = o.length; n < i; n++)
|
|
1649
1649
|
o[n](...t);
|
|
@@ -1657,120 +1657,120 @@ let eo = () => ({
|
|
|
1657
1657
|
};
|
|
1658
1658
|
}
|
|
1659
1659
|
});
|
|
1660
|
-
const
|
|
1661
|
-
const n = new
|
|
1662
|
-
const
|
|
1660
|
+
const eo = (e, t) => {
|
|
1661
|
+
const n = new zn(), o = /* @__PURE__ */ new Map(), i = to(), r = (w, x) => {
|
|
1662
|
+
const v = w.selector.flatMap((k) => {
|
|
1663
1663
|
const T = z([k]) ? k.range : oe(k, t).range;
|
|
1664
1664
|
return Array.from(T.getClientRects());
|
|
1665
|
-
}),
|
|
1666
|
-
return
|
|
1667
|
-
const { x: T, y:
|
|
1665
|
+
}), M = Ne(v).map((k) => Pe(k, x));
|
|
1666
|
+
return M.map((k) => {
|
|
1667
|
+
const { x: T, y: B, width: m, height: S } = k;
|
|
1668
1668
|
return {
|
|
1669
1669
|
minX: T,
|
|
1670
|
-
minY:
|
|
1671
|
-
maxX: T +
|
|
1672
|
-
maxY:
|
|
1670
|
+
minY: B,
|
|
1671
|
+
maxX: T + m,
|
|
1672
|
+
maxY: B + S,
|
|
1673
1673
|
annotation: {
|
|
1674
|
-
id:
|
|
1675
|
-
rects:
|
|
1674
|
+
id: w.annotation,
|
|
1675
|
+
rects: M
|
|
1676
1676
|
}
|
|
1677
1677
|
};
|
|
1678
1678
|
});
|
|
1679
1679
|
}, s = () => [...o.values()], a = () => {
|
|
1680
1680
|
n.clear(), o.clear();
|
|
1681
|
-
}, d = (
|
|
1682
|
-
const
|
|
1683
|
-
|
|
1684
|
-
}, f = (
|
|
1685
|
-
const
|
|
1686
|
-
|
|
1687
|
-
},
|
|
1688
|
-
f(
|
|
1689
|
-
}, l = (
|
|
1690
|
-
|
|
1691
|
-
const
|
|
1692
|
-
|
|
1693
|
-
const k =
|
|
1681
|
+
}, d = (w) => {
|
|
1682
|
+
const x = r(w, t.getBoundingClientRect());
|
|
1683
|
+
x.forEach((v) => n.insert(v)), o.set(w.annotation, x);
|
|
1684
|
+
}, f = (w) => {
|
|
1685
|
+
const x = o.get(w.annotation);
|
|
1686
|
+
x && (x.forEach((v) => n.remove(v)), o.delete(w.annotation));
|
|
1687
|
+
}, h = (w) => {
|
|
1688
|
+
f(w), d(w);
|
|
1689
|
+
}, l = (w, x = !0) => {
|
|
1690
|
+
x && a();
|
|
1691
|
+
const v = t.getBoundingClientRect(), M = w.map((T) => ({ target: T, rects: r(T, v) }));
|
|
1692
|
+
M.forEach(({ target: T, rects: B }) => o.set(T.annotation, B));
|
|
1693
|
+
const k = M.flatMap(({ rects: T }) => T);
|
|
1694
1694
|
n.load(k);
|
|
1695
|
-
},
|
|
1696
|
-
const
|
|
1697
|
-
minX:
|
|
1698
|
-
minY:
|
|
1699
|
-
maxX:
|
|
1700
|
-
maxY:
|
|
1701
|
-
}), k = (T) => T.annotation.rects.reduce((
|
|
1702
|
-
return
|
|
1703
|
-
}, c = (
|
|
1704
|
-
const
|
|
1705
|
-
if (
|
|
1695
|
+
}, g = (w, x, v = !1) => {
|
|
1696
|
+
const M = n.search({
|
|
1697
|
+
minX: w,
|
|
1698
|
+
minY: x,
|
|
1699
|
+
maxX: w,
|
|
1700
|
+
maxY: x
|
|
1701
|
+
}), k = (T) => T.annotation.rects.reduce((B, m) => B + m.width * m.height, 0);
|
|
1702
|
+
return M.length > 0 ? (M.sort((T, B) => k(T) - k(B)), v ? M.map((T) => T.annotation.id) : [M[0].annotation.id]) : [];
|
|
1703
|
+
}, c = (w) => {
|
|
1704
|
+
const x = A(w);
|
|
1705
|
+
if (x.length === 0)
|
|
1706
1706
|
return;
|
|
1707
|
-
let
|
|
1708
|
-
for (let
|
|
1709
|
-
const
|
|
1710
|
-
|
|
1707
|
+
let v = x[0].left, M = x[0].top, k = x[0].right, T = x[0].bottom;
|
|
1708
|
+
for (let B = 1; B < x.length; B++) {
|
|
1709
|
+
const m = x[B];
|
|
1710
|
+
v = Math.min(v, m.left), M = Math.min(M, m.top), k = Math.max(k, m.right), T = Math.max(T, m.bottom);
|
|
1711
1711
|
}
|
|
1712
|
-
return new DOMRect(
|
|
1713
|
-
},
|
|
1714
|
-
const
|
|
1715
|
-
return
|
|
1712
|
+
return new DOMRect(v, M, k - v, T - M);
|
|
1713
|
+
}, A = (w) => {
|
|
1714
|
+
const x = o.get(w);
|
|
1715
|
+
return x ? x[0].annotation.rects : [];
|
|
1716
1716
|
};
|
|
1717
1717
|
return {
|
|
1718
1718
|
all: s,
|
|
1719
1719
|
clear: a,
|
|
1720
|
-
getAt:
|
|
1720
|
+
getAt: g,
|
|
1721
1721
|
getAnnotationBounds: c,
|
|
1722
|
-
getAnnotationRects:
|
|
1723
|
-
getIntersecting: (
|
|
1724
|
-
const k = n.search({ minX:
|
|
1725
|
-
return Array.from(T).map((
|
|
1726
|
-
annotation: e.getAnnotation(
|
|
1727
|
-
rects:
|
|
1728
|
-
})).filter((
|
|
1722
|
+
getAnnotationRects: A,
|
|
1723
|
+
getIntersecting: (w, x, v, M) => {
|
|
1724
|
+
const k = n.search({ minX: w, minY: x, maxX: v, maxY: M }), T = new Set(k.map((B) => B.annotation.id));
|
|
1725
|
+
return Array.from(T).map((B) => ({
|
|
1726
|
+
annotation: e.getAnnotation(B),
|
|
1727
|
+
rects: A(B)
|
|
1728
|
+
})).filter((B) => !!B.annotation);
|
|
1729
1729
|
},
|
|
1730
1730
|
insert: d,
|
|
1731
1731
|
recalculate: () => {
|
|
1732
|
-
l(e.all().map((
|
|
1732
|
+
l(e.all().map((w) => w.target), !0), i.emit("recalculate");
|
|
1733
1733
|
},
|
|
1734
1734
|
remove: f,
|
|
1735
1735
|
set: l,
|
|
1736
1736
|
size: () => n.all().length,
|
|
1737
|
-
update:
|
|
1738
|
-
on: (
|
|
1737
|
+
update: h,
|
|
1738
|
+
on: (w, x) => i.on(w, x)
|
|
1739
1739
|
};
|
|
1740
|
-
},
|
|
1741
|
-
const n =
|
|
1742
|
-
const u = bt(
|
|
1743
|
-
return
|
|
1744
|
-
}, d = (
|
|
1745
|
-
const
|
|
1746
|
-
return
|
|
1747
|
-
}, f = (
|
|
1748
|
-
const u =
|
|
1749
|
-
return
|
|
1750
|
-
n.getAnnotation(
|
|
1751
|
-
}),
|
|
1752
|
-
},
|
|
1753
|
-
const u = mt(
|
|
1740
|
+
}, no = (e, t) => {
|
|
1741
|
+
const n = Ln(), o = eo(n, e), i = fn(n, t), r = dn(n), s = Rn(), a = (b, p = V.LOCAL) => {
|
|
1742
|
+
const u = bt(b, e), w = z(u.target.selector);
|
|
1743
|
+
return w && n.addAnnotation(u, p), w;
|
|
1744
|
+
}, d = (b, p = !0, u = V.LOCAL) => {
|
|
1745
|
+
const w = b.map((v) => bt(v, e)), x = w.filter((v) => !z(v.target.selector));
|
|
1746
|
+
return x.length > 0 ? (console.warn("Could not revive all targets for these annotations:", x), n.bulkAddAnnotation(w, p, u), x) : (n.bulkAddAnnotation(w, p, u), []);
|
|
1747
|
+
}, f = (b, p = V.LOCAL) => {
|
|
1748
|
+
const u = b.map((x) => bt(x, e)), w = u.filter((x) => !z(x.target.selector));
|
|
1749
|
+
return w.length > 0 && console.warn("Could not revive all targets for these annotations:", w), u.forEach((x) => {
|
|
1750
|
+
n.getAnnotation(x.id) ? n.updateAnnotation(x, p) : n.addAnnotation(x, p);
|
|
1751
|
+
}), w;
|
|
1752
|
+
}, h = (b, p = V.LOCAL) => {
|
|
1753
|
+
const u = mt(b, e);
|
|
1754
1754
|
n.updateTarget(u, p);
|
|
1755
|
-
}, l = (
|
|
1756
|
-
const u =
|
|
1755
|
+
}, l = (b, p = V.LOCAL) => {
|
|
1756
|
+
const u = b.map((w) => mt(w, e));
|
|
1757
1757
|
n.bulkUpdateTargets(u, p);
|
|
1758
|
-
},
|
|
1759
|
-
const
|
|
1760
|
-
return
|
|
1761
|
-
}, c = (
|
|
1762
|
-
const
|
|
1763
|
-
if (
|
|
1758
|
+
}, g = (b, p, u) => {
|
|
1759
|
+
const w = o.getAt(b, p, !!u).map((v) => n.getAnnotation(v)), x = u ? w.filter(u) : w;
|
|
1760
|
+
return x.length > 0 ? x[0] : void 0;
|
|
1761
|
+
}, c = (b, p, u, w = 5) => {
|
|
1762
|
+
const x = o.getAnnotationRects(b);
|
|
1763
|
+
if (x.length !== 0) {
|
|
1764
1764
|
if (p && u) {
|
|
1765
|
-
const
|
|
1766
|
-
if (
|
|
1765
|
+
const v = x.find(({ top: M, right: k, bottom: T, left: B }) => p >= B - w && p <= k + w && u >= M - w && u <= T + w);
|
|
1766
|
+
if (v) return v;
|
|
1767
1767
|
}
|
|
1768
|
-
return o.getAnnotationBounds(
|
|
1768
|
+
return o.getAnnotationBounds(b);
|
|
1769
1769
|
}
|
|
1770
|
-
},
|
|
1771
|
-
return n.observe(({ changes:
|
|
1772
|
-
const p = (
|
|
1773
|
-
(p == null ? void 0 : p.length) > 0 && p.forEach((
|
|
1770
|
+
}, A = () => o.recalculate(), C = (b) => o.on("recalculate", b);
|
|
1771
|
+
return n.observe(({ changes: b }) => {
|
|
1772
|
+
const p = (b.deleted || []).filter((x) => z(x.target.selector)), u = (b.created || []).filter((x) => z(x.target.selector)), w = (b.updated || []).filter((x) => z(x.newValue.target.selector));
|
|
1773
|
+
(p == null ? void 0 : p.length) > 0 && p.forEach((x) => o.remove(x.target)), u.length > 0 && o.set(u.map((x) => x.target), !1), (w == null ? void 0 : w.length) > 0 && w.forEach(({ newValue: x }) => o.update(x.target));
|
|
1774
1774
|
}), {
|
|
1775
1775
|
store: {
|
|
1776
1776
|
...n,
|
|
@@ -1779,45 +1779,45 @@ const no = (e, t) => {
|
|
|
1779
1779
|
bulkUpdateTargets: l,
|
|
1780
1780
|
bulkUpsertAnnotations: f,
|
|
1781
1781
|
getAnnotationBounds: c,
|
|
1782
|
-
getAt:
|
|
1782
|
+
getAt: g,
|
|
1783
1783
|
getIntersecting: o.getIntersecting.bind(o),
|
|
1784
1784
|
getAnnotationRects: o.getAnnotationRects.bind(o),
|
|
1785
|
-
recalculatePositions:
|
|
1786
|
-
onRecalculatePositions:
|
|
1787
|
-
updateTarget:
|
|
1785
|
+
recalculatePositions: A,
|
|
1786
|
+
onRecalculatePositions: C,
|
|
1787
|
+
updateTarget: h
|
|
1788
1788
|
},
|
|
1789
1789
|
selection: i,
|
|
1790
1790
|
hover: r,
|
|
1791
1791
|
viewport: s
|
|
1792
1792
|
};
|
|
1793
|
-
},
|
|
1793
|
+
}, oo = () => {
|
|
1794
1794
|
const e = document.createElement("canvas");
|
|
1795
1795
|
e.width = 2 * window.innerWidth, e.height = 2 * window.innerHeight, e.className = "r6o-presence-layer";
|
|
1796
1796
|
const t = e.getContext("2d");
|
|
1797
1797
|
return t.scale(2, 2), t.translate(0.5, 0.5), e;
|
|
1798
|
-
},
|
|
1799
|
-
const o =
|
|
1798
|
+
}, io = (e, t, n = {}) => {
|
|
1799
|
+
const o = oo(), i = o.getContext("2d");
|
|
1800
1800
|
document.body.appendChild(o);
|
|
1801
|
-
const r = /* @__PURE__ */ new Map(), s = (l) => Array.from(r.entries()).filter(([
|
|
1802
|
-
return t.on("selectionChange", (l,
|
|
1803
|
-
s(l).forEach((
|
|
1801
|
+
const r = /* @__PURE__ */ new Map(), s = (l) => Array.from(r.entries()).filter(([g, c]) => c.presenceKey === l.presenceKey).map(([g, c]) => g);
|
|
1802
|
+
return t.on("selectionChange", (l, g) => {
|
|
1803
|
+
s(l).forEach((A) => r.delete(A)), g && g.forEach((A) => r.set(A, l));
|
|
1804
1804
|
}), {
|
|
1805
1805
|
clear: () => {
|
|
1806
|
-
const { width: l, height:
|
|
1807
|
-
i.clearRect(-0.5, -0.5, l + 1,
|
|
1806
|
+
const { width: l, height: g } = o;
|
|
1807
|
+
i.clearRect(-0.5, -0.5, l + 1, g + 1);
|
|
1808
1808
|
},
|
|
1809
1809
|
destroy: () => {
|
|
1810
1810
|
o.remove();
|
|
1811
1811
|
},
|
|
1812
|
-
paint: (l,
|
|
1812
|
+
paint: (l, g, c) => {
|
|
1813
1813
|
n.font && (i.font = n.font);
|
|
1814
|
-
const
|
|
1815
|
-
if (
|
|
1816
|
-
const { height:
|
|
1817
|
-
i.fillStyle =
|
|
1818
|
-
const u = i.measureText(
|
|
1819
|
-
return i.fillRect(
|
|
1820
|
-
fill:
|
|
1814
|
+
const A = r.get(l.annotation.id);
|
|
1815
|
+
if (A) {
|
|
1816
|
+
const { height: C } = l.rects[0], b = l.rects[0].x + g.left, p = l.rects[0].y + g.top;
|
|
1817
|
+
i.fillStyle = A.appearance.color, i.fillRect(b - 2, p - 2.5, 2, C + 5);
|
|
1818
|
+
const u = i.measureText(A.appearance.label), w = u.width + 6, x = u.actualBoundingBoxAscent + u.actualBoundingBoxDescent + 8, v = u.fontBoundingBoxAscent ? 8 : 6.5;
|
|
1819
|
+
return i.fillRect(b - 2, p - 2.5 - x, w, x), i.fillStyle = "#fff", i.fillText(A.appearance.label, b + 1, p - v), {
|
|
1820
|
+
fill: A.appearance.color,
|
|
1821
1821
|
fillOpacity: c ? 0.45 : 0.18
|
|
1822
1822
|
};
|
|
1823
1823
|
}
|
|
@@ -1833,9 +1833,9 @@ const no = (e, t) => {
|
|
|
1833
1833
|
return document.scrollingElement;
|
|
1834
1834
|
const { overflowY: t } = window.getComputedStyle(e);
|
|
1835
1835
|
return t !== "visible" && t !== "hidden" && e.scrollHeight > e.clientHeight ? e : ue(e.parentElement);
|
|
1836
|
-
},
|
|
1836
|
+
}, ro = (e, t) => (n) => {
|
|
1837
1837
|
const o = typeof n == "string" ? n : n.id, i = (s) => {
|
|
1838
|
-
const a = r.getBoundingClientRect(), d = r.clientHeight, f = r.clientWidth,
|
|
1838
|
+
const a = r.getBoundingClientRect(), d = r.clientHeight, f = r.clientWidth, h = s.selector[0].range.getBoundingClientRect(), { width: l, height: g } = t.getAnnotationBounds(o), c = h.top - a.top, A = h.left - a.left, C = r.parentElement ? r.scrollTop : 0, b = r.parentElement ? r.scrollLeft : 0, p = c + C - (d - g) / 2, u = A + b - (f - l) / 2;
|
|
1839
1839
|
r.scroll({ top: p, left: u, behavior: "smooth" });
|
|
1840
1840
|
}, r = ue(e);
|
|
1841
1841
|
if (r) {
|
|
@@ -1849,7 +1849,7 @@ const no = (e, t) => {
|
|
|
1849
1849
|
}
|
|
1850
1850
|
}
|
|
1851
1851
|
return !1;
|
|
1852
|
-
},
|
|
1852
|
+
}, ao = (e, t) => ({
|
|
1853
1853
|
...e,
|
|
1854
1854
|
annotatingEnabled: e.annotatingEnabled ?? t.annotatingEnabled,
|
|
1855
1855
|
user: e.user || t.user
|
|
@@ -1873,7 +1873,7 @@ function pe(e) {
|
|
|
1873
1873
|
t[n - 1] += ",", t.splice(n, 1), n = t.lastIndexOf("");
|
|
1874
1874
|
return t;
|
|
1875
1875
|
}
|
|
1876
|
-
function
|
|
1876
|
+
function so(e, t) {
|
|
1877
1877
|
const n = e.length >= t.length ? e : t, o = e.length >= t.length ? t : e;
|
|
1878
1878
|
let i = !0;
|
|
1879
1879
|
for (let r = 0; r < n.length; r++)
|
|
@@ -1932,7 +1932,7 @@ const at = {
|
|
|
1932
1932
|
"[": 219,
|
|
1933
1933
|
"]": 221,
|
|
1934
1934
|
"\\": 220
|
|
1935
|
-
},
|
|
1935
|
+
}, j = {
|
|
1936
1936
|
// shiftKey
|
|
1937
1937
|
"⇧": 16,
|
|
1938
1938
|
shift: 16,
|
|
@@ -1962,27 +1962,27 @@ const at = {
|
|
|
1962
1962
|
18: !1,
|
|
1963
1963
|
17: !1,
|
|
1964
1964
|
91: !1
|
|
1965
|
-
},
|
|
1965
|
+
}, I = {};
|
|
1966
1966
|
for (let e = 1; e < 20; e++)
|
|
1967
1967
|
at["f".concat(e)] = 111 + e;
|
|
1968
1968
|
let O = [], rt = null, he = "all";
|
|
1969
|
-
const W = /* @__PURE__ */ new Map(), lt = (e) => at[e.toLowerCase()] ||
|
|
1969
|
+
const W = /* @__PURE__ */ new Map(), lt = (e) => at[e.toLowerCase()] || j[e.toLowerCase()] || e.toUpperCase().charCodeAt(0), lo = (e) => Object.keys(at).find((t) => at[t] === e), co = (e) => Object.keys(j).find((t) => j[t] === e);
|
|
1970
1970
|
function ge(e) {
|
|
1971
1971
|
he = e || "all";
|
|
1972
1972
|
}
|
|
1973
1973
|
function st() {
|
|
1974
1974
|
return he || "all";
|
|
1975
1975
|
}
|
|
1976
|
-
function
|
|
1976
|
+
function uo() {
|
|
1977
1977
|
return O.slice(0);
|
|
1978
1978
|
}
|
|
1979
|
-
function
|
|
1980
|
-
return O.map((e) =>
|
|
1979
|
+
function fo() {
|
|
1980
|
+
return O.map((e) => lo(e) || co(e) || String.fromCharCode(e));
|
|
1981
1981
|
}
|
|
1982
|
-
function
|
|
1982
|
+
function po() {
|
|
1983
1983
|
const e = [];
|
|
1984
|
-
return Object.keys(
|
|
1985
|
-
|
|
1984
|
+
return Object.keys(I).forEach((t) => {
|
|
1985
|
+
I[t].forEach((n) => {
|
|
1986
1986
|
let {
|
|
1987
1987
|
key: o,
|
|
1988
1988
|
scope: i,
|
|
@@ -1998,7 +1998,7 @@ function ho() {
|
|
|
1998
1998
|
});
|
|
1999
1999
|
}), e;
|
|
2000
2000
|
}
|
|
2001
|
-
function
|
|
2001
|
+
function ho(e) {
|
|
2002
2002
|
const t = e.target || e.srcElement, {
|
|
2003
2003
|
tagName: n
|
|
2004
2004
|
} = t;
|
|
@@ -2006,15 +2006,15 @@ function go(e) {
|
|
|
2006
2006
|
const i = n === "INPUT" && !["checkbox", "radio", "range", "button", "file", "reset", "submit", "color"].includes(t.type);
|
|
2007
2007
|
return (t.isContentEditable || (i || n === "TEXTAREA" || n === "SELECT") && !t.readOnly) && (o = !1), o;
|
|
2008
2008
|
}
|
|
2009
|
-
function
|
|
2009
|
+
function go(e) {
|
|
2010
2010
|
return typeof e == "string" && (e = lt(e)), O.indexOf(e) !== -1;
|
|
2011
2011
|
}
|
|
2012
|
-
function
|
|
2012
|
+
function mo(e, t) {
|
|
2013
2013
|
let n, o;
|
|
2014
2014
|
e || (e = st());
|
|
2015
|
-
for (const i in
|
|
2016
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
2017
|
-
for (n =
|
|
2015
|
+
for (const i in I)
|
|
2016
|
+
if (Object.prototype.hasOwnProperty.call(I, i))
|
|
2017
|
+
for (n = I[i], o = 0; o < n.length; )
|
|
2018
2018
|
n[o].scope === e ? n.splice(o, 1).forEach((s) => {
|
|
2019
2019
|
let {
|
|
2020
2020
|
element: a
|
|
@@ -2023,18 +2023,18 @@ function bo(e, t) {
|
|
|
2023
2023
|
}) : o++;
|
|
2024
2024
|
st() === e && ge(t || "all");
|
|
2025
2025
|
}
|
|
2026
|
-
function
|
|
2026
|
+
function bo(e) {
|
|
2027
2027
|
let t = e.keyCode || e.which || e.charCode;
|
|
2028
2028
|
const n = O.indexOf(t);
|
|
2029
2029
|
if (n >= 0 && O.splice(n, 1), e.key && e.key.toLowerCase() === "meta" && O.splice(0, O.length), (t === 93 || t === 224) && (t = 91), t in y) {
|
|
2030
2030
|
y[t] = !1;
|
|
2031
|
-
for (const o in
|
|
2031
|
+
for (const o in j) j[o] === t && (Y[o] = !1);
|
|
2032
2032
|
}
|
|
2033
2033
|
}
|
|
2034
2034
|
function me(e) {
|
|
2035
2035
|
if (typeof e > "u")
|
|
2036
|
-
Object.keys(
|
|
2037
|
-
Array.isArray(
|
|
2036
|
+
Object.keys(I).forEach((i) => {
|
|
2037
|
+
Array.isArray(I[i]) && I[i].forEach((r) => ht(r)), delete I[i];
|
|
2038
2038
|
}), Pt(null);
|
|
2039
2039
|
else if (Array.isArray(e))
|
|
2040
2040
|
e.forEach((i) => {
|
|
@@ -2062,14 +2062,14 @@ const ht = (e) => {
|
|
|
2062
2062
|
splitKey: i = "+"
|
|
2063
2063
|
} = e;
|
|
2064
2064
|
pe(t).forEach((s) => {
|
|
2065
|
-
const a = s.split(i), d = a.length, f = a[d - 1],
|
|
2066
|
-
if (!
|
|
2065
|
+
const a = s.split(i), d = a.length, f = a[d - 1], h = f === "*" ? "*" : lt(f);
|
|
2066
|
+
if (!I[h]) return;
|
|
2067
2067
|
n || (n = st());
|
|
2068
|
-
const l = d > 1 ? fe(
|
|
2069
|
-
|
|
2070
|
-
const
|
|
2071
|
-
return
|
|
2072
|
-
}),
|
|
2068
|
+
const l = d > 1 ? fe(j, a) : [], g = [];
|
|
2069
|
+
I[h] = I[h].filter((c) => {
|
|
2070
|
+
const C = (o ? c.method === o : !0) && c.scope === n && so(c.mods, l);
|
|
2071
|
+
return C && g.push(c.element), !C;
|
|
2072
|
+
}), g.forEach((c) => Pt(c));
|
|
2073
2073
|
});
|
|
2074
2074
|
};
|
|
2075
2075
|
function Kt(e, t, n, o) {
|
|
@@ -2084,16 +2084,16 @@ function Kt(e, t, n, o) {
|
|
|
2084
2084
|
}
|
|
2085
2085
|
}
|
|
2086
2086
|
function te(e, t) {
|
|
2087
|
-
const n =
|
|
2087
|
+
const n = I["*"];
|
|
2088
2088
|
let o = e.keyCode || e.which || e.charCode;
|
|
2089
|
-
if (!
|
|
2089
|
+
if (!Y.filter.call(this, e)) return;
|
|
2090
2090
|
if ((o === 93 || o === 224) && (o = 91), O.indexOf(o) === -1 && o !== 229 && O.push(o), ["ctrlKey", "altKey", "shiftKey", "metaKey"].forEach((a) => {
|
|
2091
2091
|
const d = Ot[a];
|
|
2092
2092
|
e[a] && O.indexOf(d) === -1 ? O.push(d) : !e[a] && O.indexOf(d) > -1 ? O.splice(O.indexOf(d), 1) : a === "metaKey" && e[a] && O.length === 3 && (e.ctrlKey || e.shiftKey || e.altKey || (O = O.slice(O.indexOf(d))));
|
|
2093
2093
|
}), o in y) {
|
|
2094
2094
|
y[o] = !0;
|
|
2095
|
-
for (const a in
|
|
2096
|
-
|
|
2095
|
+
for (const a in j)
|
|
2096
|
+
j[a] === o && (Y[a] = !0);
|
|
2097
2097
|
if (!n) return;
|
|
2098
2098
|
}
|
|
2099
2099
|
for (const a in y)
|
|
@@ -2103,24 +2103,24 @@ function te(e, t) {
|
|
|
2103
2103
|
if (n)
|
|
2104
2104
|
for (let a = 0; a < n.length; a++)
|
|
2105
2105
|
n[a].scope === i && (e.type === "keydown" && n[a].keydown || e.type === "keyup" && n[a].keyup) && Kt(e, n[a], i, t);
|
|
2106
|
-
if (!(o in
|
|
2107
|
-
const r =
|
|
2106
|
+
if (!(o in I)) return;
|
|
2107
|
+
const r = I[o], s = r.length;
|
|
2108
2108
|
for (let a = 0; a < s; a++)
|
|
2109
2109
|
if ((e.type === "keydown" && r[a].keydown || e.type === "keyup" && r[a].keyup) && r[a].key) {
|
|
2110
2110
|
const d = r[a], {
|
|
2111
2111
|
splitKey: f
|
|
2112
|
-
} = d,
|
|
2113
|
-
for (let
|
|
2114
|
-
l.push(lt(g
|
|
2112
|
+
} = d, h = d.key.split(f), l = [];
|
|
2113
|
+
for (let g = 0; g < h.length; g++)
|
|
2114
|
+
l.push(lt(h[g]));
|
|
2115
2115
|
l.sort().join("") === O.sort().join("") && Kt(e, d, i, t);
|
|
2116
2116
|
}
|
|
2117
2117
|
}
|
|
2118
|
-
function
|
|
2118
|
+
function Y(e, t, n) {
|
|
2119
2119
|
O = [];
|
|
2120
2120
|
const o = pe(e);
|
|
2121
|
-
let i = [], r = "all", s = document, a = 0, d = !1, f = !0,
|
|
2122
|
-
for (n === void 0 && typeof t == "function" && (n = t), Object.prototype.toString.call(t) === "[object Object]" && (t.scope && (r = t.scope), t.element && (s = t.element), t.keyup && (d = t.keyup), t.keydown !== void 0 && (f = t.keydown), t.capture !== void 0 && (l = t.capture), typeof t.splitKey == "string" && (
|
|
2123
|
-
e = o[a].split(
|
|
2121
|
+
let i = [], r = "all", s = document, a = 0, d = !1, f = !0, h = "+", l = !1, g = !1;
|
|
2122
|
+
for (n === void 0 && typeof t == "function" && (n = t), Object.prototype.toString.call(t) === "[object Object]" && (t.scope && (r = t.scope), t.element && (s = t.element), t.keyup && (d = t.keyup), t.keydown !== void 0 && (f = t.keydown), t.capture !== void 0 && (l = t.capture), typeof t.splitKey == "string" && (h = t.splitKey), t.single === !0 && (g = !0)), typeof t == "string" && (r = t), g && me(e, r); a < o.length; a++)
|
|
2123
|
+
e = o[a].split(h), i = [], e.length > 1 && (i = fe(j, e)), e = e[e.length - 1], e = e === "*" ? "*" : lt(e), e in I || (I[e] = []), I[e].push({
|
|
2124
2124
|
keyup: d,
|
|
2125
2125
|
keydown: f,
|
|
2126
2126
|
scope: r,
|
|
@@ -2128,23 +2128,23 @@ function U(e, t, n) {
|
|
|
2128
2128
|
shortcut: o[a],
|
|
2129
2129
|
method: n,
|
|
2130
2130
|
key: o[a],
|
|
2131
|
-
splitKey:
|
|
2131
|
+
splitKey: h,
|
|
2132
2132
|
element: s
|
|
2133
2133
|
});
|
|
2134
2134
|
if (typeof s < "u" && window) {
|
|
2135
2135
|
if (!W.has(s)) {
|
|
2136
2136
|
const c = function() {
|
|
2137
|
-
let
|
|
2138
|
-
return te(
|
|
2139
|
-
},
|
|
2140
|
-
let
|
|
2141
|
-
te(
|
|
2137
|
+
let C = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.event;
|
|
2138
|
+
return te(C, s);
|
|
2139
|
+
}, A = function() {
|
|
2140
|
+
let C = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.event;
|
|
2141
|
+
te(C, s), bo(C);
|
|
2142
2142
|
};
|
|
2143
2143
|
W.set(s, {
|
|
2144
2144
|
keydownListener: c,
|
|
2145
|
-
keyupListenr:
|
|
2145
|
+
keyupListenr: A,
|
|
2146
2146
|
capture: l
|
|
2147
|
-
}), Bt(s, "keydown", c, l), Bt(s, "keyup",
|
|
2147
|
+
}), Bt(s, "keydown", c, l), Bt(s, "keyup", A, l);
|
|
2148
2148
|
}
|
|
2149
2149
|
if (!rt) {
|
|
2150
2150
|
const c = () => {
|
|
@@ -2157,16 +2157,16 @@ function U(e, t, n) {
|
|
|
2157
2157
|
}
|
|
2158
2158
|
}
|
|
2159
2159
|
}
|
|
2160
|
-
function
|
|
2160
|
+
function wo(e) {
|
|
2161
2161
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "all";
|
|
2162
|
-
Object.keys(
|
|
2163
|
-
|
|
2162
|
+
Object.keys(I).forEach((n) => {
|
|
2163
|
+
I[n].filter((i) => i.scope === t && i.shortcut === e).forEach((i) => {
|
|
2164
2164
|
i && i.method && i.method();
|
|
2165
2165
|
});
|
|
2166
2166
|
});
|
|
2167
2167
|
}
|
|
2168
2168
|
function Pt(e) {
|
|
2169
|
-
const t = Object.values(
|
|
2169
|
+
const t = Object.values(I).flat();
|
|
2170
2170
|
if (t.findIndex((o) => {
|
|
2171
2171
|
let {
|
|
2172
2172
|
element: i
|
|
@@ -2187,7 +2187,7 @@ function Pt(e) {
|
|
|
2187
2187
|
capture: a
|
|
2188
2188
|
} = W.get(i) || {};
|
|
2189
2189
|
r && s && (et(i, "keyup", s, a), et(i, "keydown", r, a), W.delete(i));
|
|
2190
|
-
}), W.clear(), Object.keys(
|
|
2190
|
+
}), W.clear(), Object.keys(I).forEach((i) => delete I[i]), rt)) {
|
|
2191
2191
|
const {
|
|
2192
2192
|
listener: i,
|
|
2193
2193
|
capture: r
|
|
@@ -2196,159 +2196,163 @@ function Pt(e) {
|
|
|
2196
2196
|
}
|
|
2197
2197
|
}
|
|
2198
2198
|
const Rt = {
|
|
2199
|
-
getPressedKeyString:
|
|
2199
|
+
getPressedKeyString: fo,
|
|
2200
2200
|
setScope: ge,
|
|
2201
2201
|
getScope: st,
|
|
2202
|
-
deleteScope:
|
|
2203
|
-
getPressedKeyCodes:
|
|
2204
|
-
getAllKeyCodes:
|
|
2205
|
-
isPressed:
|
|
2206
|
-
filter:
|
|
2207
|
-
trigger:
|
|
2202
|
+
deleteScope: mo,
|
|
2203
|
+
getPressedKeyCodes: uo,
|
|
2204
|
+
getAllKeyCodes: po,
|
|
2205
|
+
isPressed: go,
|
|
2206
|
+
filter: ho,
|
|
2207
|
+
trigger: wo,
|
|
2208
2208
|
unbind: me,
|
|
2209
2209
|
keyMap: at,
|
|
2210
|
-
modifier:
|
|
2210
|
+
modifier: j,
|
|
2211
2211
|
modifierMap: Ot
|
|
2212
2212
|
};
|
|
2213
2213
|
for (const e in Rt)
|
|
2214
|
-
Object.prototype.hasOwnProperty.call(Rt, e) && (
|
|
2214
|
+
Object.prototype.hasOwnProperty.call(Rt, e) && (Y[e] = Rt[e]);
|
|
2215
2215
|
if (typeof window < "u") {
|
|
2216
2216
|
const e = window.hotkeys;
|
|
2217
|
-
|
|
2217
|
+
Y.noConflict = (t) => (t && window.hotkeys === Y && (window.hotkeys = e), Y), window.hotkeys = Y;
|
|
2218
2218
|
}
|
|
2219
|
-
var
|
|
2219
|
+
var Ao = {};
|
|
2220
2220
|
(function(e) {
|
|
2221
2221
|
Object.defineProperty(e, "__esModule", { value: !0 }), function(t) {
|
|
2222
2222
|
t.Unidentified = "Unidentified", t.Alt = "Alt", t.AltGraph = "AltGraph", t.CapsLock = "CapsLock", t.Control = "Control", t.Fn = "Fn", t.FnLock = "FnLock", t.Hyper = "Hyper", t.Meta = "Meta", t.NumLock = "NumLock", t.ScrollLock = "ScrollLock", t.Shift = "Shift", t.Super = "Super", t.Symbol = "Symbol", t.SymbolLock = "SymbolLock", t.Enter = "Enter", t.Tab = "Tab", t.ArrowDown = "ArrowDown", t.ArrowLeft = "ArrowLeft", t.ArrowRight = "ArrowRight", t.ArrowUp = "ArrowUp", t.End = "End", t.Home = "Home", t.PageDown = "PageDown", t.PageUp = "PageUp", t.Backspace = "Backspace", t.Clear = "Clear", t.Copy = "Copy", t.CrSel = "CrSel", t.Cut = "Cut", t.Delete = "Delete", t.EraseEof = "EraseEof", t.ExSel = "ExSel", t.Insert = "Insert", t.Paste = "Paste", t.Redo = "Redo", t.Undo = "Undo", t.Accept = "Accept", t.Again = "Again", t.Attn = "Attn", t.Cancel = "Cancel", t.ContextMenu = "ContextMenu", t.Escape = "Escape", t.Execute = "Execute", t.Find = "Find", t.Finish = "Finish", t.Help = "Help", t.Pause = "Pause", t.Play = "Play", t.Props = "Props", t.Select = "Select", t.ZoomIn = "ZoomIn", t.ZoomOut = "ZoomOut", t.BrightnessDown = "BrightnessDown", t.BrightnessUp = "BrightnessUp", t.Eject = "Eject", t.LogOff = "LogOff", t.Power = "Power", t.PowerOff = "PowerOff", t.PrintScreen = "PrintScreen", t.Hibernate = "Hibernate", t.Standby = "Standby", t.WakeUp = "WakeUp", t.AllCandidates = "AllCandidates", t.Alphanumeric = "Alphanumeric", t.CodeInput = "CodeInput", t.Compose = "Compose", t.Convert = "Convert", t.Dead = "Dead", t.FinalMode = "FinalMode", t.GroupFirst = "GroupFirst", t.GroupLast = "GroupLast", t.GroupNext = "GroupNext", t.GroupPrevious = "GroupPrevious", t.ModeChange = "ModeChange", t.NextCandidate = "NextCandidate", t.NonConvert = "NonConvert", t.PreviousCandidate = "PreviousCandidate", t.Process = "Process", t.SingleCandidate = "SingleCandidate", t.HangulMode = "HangulMode", t.HanjaMode = "HanjaMode", t.JunjaMode = "JunjaMode", t.Eisu = "Eisu", t.Hankaku = "Hankaku", t.Hiragana = "Hiragana", t.HiraganaKatakana = "HiraganaKatakana", t.KanaMode = "KanaMode", t.KanjiMode = "KanjiMode", t.Katakana = "Katakana", t.Romaji = "Romaji", t.Zenkaku = "Zenkaku", t.ZenkakuHanaku = "ZenkakuHanaku", t.F1 = "F1", t.F2 = "F2", t.F3 = "F3", t.F4 = "F4", t.F5 = "F5", t.F6 = "F6", t.F7 = "F7", t.F8 = "F8", t.F9 = "F9", t.F10 = "F10", t.F11 = "F11", t.F12 = "F12", t.F13 = "F13", t.F14 = "F14", t.F15 = "F15", t.F16 = "F16", t.F17 = "F17", t.F18 = "F18", t.F19 = "F19", t.F20 = "F20", t.Soft1 = "Soft1", t.Soft2 = "Soft2", t.Soft3 = "Soft3", t.Soft4 = "Soft4", t.AppSwitch = "AppSwitch", t.Call = "Call", t.Camera = "Camera", t.CameraFocus = "CameraFocus", t.EndCall = "EndCall", t.GoBack = "GoBack", t.GoHome = "GoHome", t.HeadsetHook = "HeadsetHook", t.LastNumberRedial = "LastNumberRedial", t.Notification = "Notification", t.MannerMode = "MannerMode", t.VoiceDial = "VoiceDial", t.ChannelDown = "ChannelDown", t.ChannelUp = "ChannelUp", t.MediaFastForward = "MediaFastForward", t.MediaPause = "MediaPause", t.MediaPlay = "MediaPlay", t.MediaPlayPause = "MediaPlayPause", t.MediaRecord = "MediaRecord", t.MediaRewind = "MediaRewind", t.MediaStop = "MediaStop", t.MediaTrackNext = "MediaTrackNext", t.MediaTrackPrevious = "MediaTrackPrevious", t.AudioBalanceLeft = "AudioBalanceLeft", t.AudioBalanceRight = "AudioBalanceRight", t.AudioBassDown = "AudioBassDown", t.AudioBassBoostDown = "AudioBassBoostDown", t.AudioBassBoostToggle = "AudioBassBoostToggle", t.AudioBassBoostUp = "AudioBassBoostUp", t.AudioBassUp = "AudioBassUp", t.AudioFaderFront = "AudioFaderFront", t.AudioFaderRear = "AudioFaderRear", t.AudioSurroundModeNext = "AudioSurroundModeNext", t.AudioTrebleDown = "AudioTrebleDown", t.AudioTrebleUp = "AudioTrebleUp", t.AudioVolumeDown = "AudioVolumeDown", t.AudioVolumeMute = "AudioVolumeMute", t.AudioVolumeUp = "AudioVolumeUp", t.MicrophoneToggle = "MicrophoneToggle", t.MicrophoneVolumeDown = "MicrophoneVolumeDown", t.MicrophoneVolumeMute = "MicrophoneVolumeMute", t.MicrophoneVolumeUp = "MicrophoneVolumeUp", t.TV = "TV", t.TV3DMode = "TV3DMode", t.TVAntennaCable = "TVAntennaCable", t.TVAudioDescription = "TVAudioDescription", t.TVAudioDescriptionMixDown = "TVAudioDescriptionMixDown", t.TVAudioDescriptionMixUp = "TVAudioDescriptionMixUp", t.TVContentsMenu = "TVContentsMenu", t.TVDataService = "TVDataService", t.TVInput = "TVInput", t.TVInputComponent1 = "TVInputComponent1", t.TVInputComponent2 = "TVInputComponent2", t.TVInputComposite1 = "TVInputComposite1", t.TVInputComposite2 = "TVInputComposite2", t.TVInputHDMI1 = "TVInputHDMI1", t.TVInputHDMI2 = "TVInputHDMI2", t.TVInputHDMI3 = "TVInputHDMI3", t.TVInputHDMI4 = "TVInputHDMI4", t.TVInputVGA1 = "TVInputVGA1", t.TVMediaContext = "TVMediaContext", t.TVNetwork = "TVNetwork", t.TVNumberEntry = "TVNumberEntry", t.TVPower = "TVPower", t.TVRadioService = "TVRadioService", t.TVSatellite = "TVSatellite", t.TVSatelliteBS = "TVSatelliteBS", t.TVSatelliteCS = "TVSatelliteCS", t.TVSatelliteToggle = "TVSatelliteToggle", t.TVTerrestrialAnalog = "TVTerrestrialAnalog", t.TVTerrestrialDigital = "TVTerrestrialDigital", t.TVTimer = "TVTimer", t.AVRInput = "AVRInput", t.AVRPower = "AVRPower", t.ColorF0Red = "ColorF0Red", t.ColorF1Green = "ColorF1Green", t.ColorF2Yellow = "ColorF2Yellow", t.ColorF3Blue = "ColorF3Blue", t.ColorF4Grey = "ColorF4Grey", t.ColorF5Brown = "ColorF5Brown", t.ClosedCaptionToggle = "ClosedCaptionToggle", t.Dimmer = "Dimmer", t.DisplaySwap = "DisplaySwap", t.DVR = "DVR", t.Exit = "Exit", t.FavoriteClear0 = "FavoriteClear0", t.FavoriteClear1 = "FavoriteClear1", t.FavoriteClear2 = "FavoriteClear2", t.FavoriteClear3 = "FavoriteClear3", t.FavoriteRecall0 = "FavoriteRecall0", t.FavoriteRecall1 = "FavoriteRecall1", t.FavoriteRecall2 = "FavoriteRecall2", t.FavoriteRecall3 = "FavoriteRecall3", t.FavoriteStore0 = "FavoriteStore0", t.FavoriteStore1 = "FavoriteStore1", t.FavoriteStore2 = "FavoriteStore2", t.FavoriteStore3 = "FavoriteStore3", t.Guide = "Guide", t.GuideNextDay = "GuideNextDay", t.GuidePreviousDay = "GuidePreviousDay", t.Info = "Info", t.InstantReplay = "InstantReplay", t.Link = "Link", t.ListProgram = "ListProgram", t.LiveContent = "LiveContent", t.Lock = "Lock", t.MediaApps = "MediaApps", t.MediaAudioTrack = "MediaAudioTrack", t.MediaLast = "MediaLast", t.MediaSkipBackward = "MediaSkipBackward", t.MediaSkipForward = "MediaSkipForward", t.MediaStepBackward = "MediaStepBackward", t.MediaStepForward = "MediaStepForward", t.MediaTopMenu = "MediaTopMenu", t.NavigateIn = "NavigateIn", t.NavigateNext = "NavigateNext", t.NavigateOut = "NavigateOut", t.NavigatePrevious = "NavigatePrevious", t.NextFavoriteChannel = "NextFavoriteChannel", t.NextUserProfile = "NextUserProfile", t.OnDemand = "OnDemand", t.Pairing = "Pairing", t.PinPDown = "PinPDown", t.PinPMove = "PinPMove", t.PinPToggle = "PinPToggle", t.PinPUp = "PinPUp", t.PlaySpeedDown = "PlaySpeedDown", t.PlaySpeedReset = "PlaySpeedReset", t.PlaySpeedUp = "PlaySpeedUp", t.RandomToggle = "RandomToggle", t.RcLowBattery = "RcLowBattery", t.RecordSpeedNext = "RecordSpeedNext", t.RfBypass = "RfBypass", t.ScanChannelsToggle = "ScanChannelsToggle", t.ScreenModeNext = "ScreenModeNext", t.Settings = "Settings", t.SplitScreenToggle = "SplitScreenToggle", t.STBInput = "STBInput", t.STBPower = "STBPower", t.Subtitle = "Subtitle", t.Teletext = "Teletext", t.VideoModeNext = "VideoModeNext", t.Wink = "Wink", t.ZoomToggle = "ZoomToggle", t.SpeechCorrectionList = "SpeechCorrectionList", t.SpeechInputToggle = "SpeechInputToggle", t.Close = "Close", t.New = "New", t.Open = "Open", t.Print = "Print", t.Save = "Save", t.SpellCheck = "SpellCheck", t.MailForward = "MailForward", t.MailReply = "MailReply", t.MailSend = "MailSend", t.LaunchCalculator = "LaunchCalculator", t.LaunchCalendar = "LaunchCalendar", t.LaunchContacts = "LaunchContacts", t.LaunchMail = "LaunchMail", t.LaunchMediaPlayer = "LaunchMediaPlayer", t.LaunchMusicPlayer = "LaunchMusicPlayer", t.LaunchMyComputer = "LaunchMyComputer", t.LaunchPhone = "LaunchPhone", t.LaunchScreenSaver = "LaunchScreenSaver", t.LaunchSpreadsheet = "LaunchSpreadsheet", t.LaunchWebBrowser = "LaunchWebBrowser", t.LaunchWebCam = "LaunchWebCam", t.LaunchWordProcessor = "LaunchWordProcessor", t.LaunchApplication1 = "LaunchApplication1", t.LaunchApplication2 = "LaunchApplication2", t.LaunchApplication3 = "LaunchApplication3", t.LaunchApplication4 = "LaunchApplication4", t.LaunchApplication5 = "LaunchApplication5", t.LaunchApplication6 = "LaunchApplication6", t.LaunchApplication7 = "LaunchApplication7", t.LaunchApplication8 = "LaunchApplication8", t.LaunchApplication9 = "LaunchApplication9", t.LaunchApplication10 = "LaunchApplication10", t.LaunchApplication11 = "LaunchApplication11", t.LaunchApplication12 = "LaunchApplication12", t.LaunchApplication13 = "LaunchApplication13", t.LaunchApplication14 = "LaunchApplication14", t.LaunchApplication15 = "LaunchApplication15", t.LaunchApplication16 = "LaunchApplication16", t.BrowserBack = "BrowserBack", t.BrowserFavorites = "BrowserFavorites", t.BrowserForward = "BrowserForward", t.BrowserHome = "BrowserHome", t.BrowserRefresh = "BrowserRefresh", t.BrowserSearch = "BrowserSearch", t.BrowserStop = "BrowserStop", t.Decimal = "Decimal", t.Key11 = "Key11", t.Key12 = "Key12", t.Multiply = "Multiply", t.Add = "Add", t.Divide = "Divide", t.Subtract = "Subtract", t.Separator = "Separator";
|
|
2223
2223
|
}(e.Key || (e.Key = {}));
|
|
2224
|
-
})(
|
|
2225
|
-
const
|
|
2224
|
+
})(Ao);
|
|
2225
|
+
const vo = (e, t, n) => {
|
|
2226
2226
|
let o;
|
|
2227
|
-
const i = (
|
|
2227
|
+
const i = (v) => o = v;
|
|
2228
2228
|
let r;
|
|
2229
|
-
const s = (
|
|
2229
|
+
const s = (v) => r = v;
|
|
2230
2230
|
let a = !0;
|
|
2231
|
-
const d = (
|
|
2232
|
-
let l,
|
|
2233
|
-
const
|
|
2234
|
-
var
|
|
2235
|
-
if (!a ||
|
|
2231
|
+
const d = (v) => a = v, { store: f, selection: h } = t;
|
|
2232
|
+
let l, g, c;
|
|
2233
|
+
const A = (v) => {
|
|
2234
|
+
var k;
|
|
2235
|
+
if (!a || g === !1)
|
|
2236
2236
|
return;
|
|
2237
|
-
l = !((
|
|
2237
|
+
l = !((k = v.target.parentElement) != null && k.closest($)) ? {
|
|
2238
2238
|
annotation: se(),
|
|
2239
2239
|
selector: [],
|
|
2240
2240
|
creator: o,
|
|
2241
2241
|
created: /* @__PURE__ */ new Date()
|
|
2242
2242
|
} : void 0;
|
|
2243
2243
|
};
|
|
2244
|
-
e.addEventListener("selectstart",
|
|
2245
|
-
const
|
|
2246
|
-
var
|
|
2244
|
+
e.addEventListener("selectstart", A);
|
|
2245
|
+
const C = Nt((v) => {
|
|
2246
|
+
var L, R;
|
|
2247
2247
|
if (!a) return;
|
|
2248
|
-
const
|
|
2249
|
-
if (!!((
|
|
2248
|
+
const M = document.getSelection();
|
|
2249
|
+
if (!!((R = (L = M.anchorNode) == null ? void 0 : L.parentElement) != null && R.closest($))) {
|
|
2250
2250
|
l = void 0;
|
|
2251
2251
|
return;
|
|
2252
2252
|
}
|
|
2253
|
-
if (
|
|
2253
|
+
if (v.timeStamp - ((c == null ? void 0 : c.timeStamp) || v.timeStamp) < 1e3 && !l && A(c || v), !l)
|
|
2254
2254
|
return;
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2255
|
+
if (M.isCollapsed && f.getAnnotation(l.annotation)) {
|
|
2256
|
+
h.clear(), f.deleteAnnotation(l.annotation);
|
|
2257
|
+
return;
|
|
2258
|
+
}
|
|
2259
|
+
const B = M.getRangeAt(0), m = Fe(B, e);
|
|
2260
|
+
if (ke(m)) return;
|
|
2261
|
+
const S = xe(m.cloneRange());
|
|
2262
|
+
(S.length !== l.selector.length || S.some((N, X) => {
|
|
2263
|
+
var U;
|
|
2264
|
+
return N.toString() !== ((U = l.selector[X]) == null ? void 0 : U.quote);
|
|
2261
2265
|
})) && (l = {
|
|
2262
2266
|
...l,
|
|
2263
|
-
selector:
|
|
2267
|
+
selector: S.map((N) => Ie(N, e, n)),
|
|
2264
2268
|
updated: /* @__PURE__ */ new Date()
|
|
2265
|
-
}, f.getAnnotation(l.annotation) ? f.updateTarget(l, V.LOCAL) : (
|
|
2269
|
+
}, f.getAnnotation(l.annotation) ? f.updateTarget(l, V.LOCAL) : (h.clear(), f.addAnnotation({
|
|
2266
2270
|
id: l.annotation,
|
|
2267
2271
|
bodies: [],
|
|
2268
2272
|
target: l
|
|
2269
|
-
}, V.LOCAL),
|
|
2273
|
+
}, V.LOCAL), h.userSelect(l.annotation, c)));
|
|
2270
2274
|
});
|
|
2271
|
-
document.addEventListener("selectionchange",
|
|
2272
|
-
const
|
|
2273
|
-
c =
|
|
2275
|
+
document.addEventListener("selectionchange", C);
|
|
2276
|
+
const b = (v) => {
|
|
2277
|
+
c = De(v), g = c.button === 0;
|
|
2274
2278
|
};
|
|
2275
|
-
document.addEventListener("pointerdown",
|
|
2276
|
-
const p = (
|
|
2277
|
-
var
|
|
2278
|
-
if (!!((
|
|
2279
|
+
document.addEventListener("pointerdown", b);
|
|
2280
|
+
const p = (v) => {
|
|
2281
|
+
var B;
|
|
2282
|
+
if (!!((B = v.target.parentElement) != null && B.closest($)) || !g)
|
|
2279
2283
|
return;
|
|
2280
|
-
const
|
|
2281
|
-
const { x:
|
|
2282
|
-
if (
|
|
2283
|
-
const { selected:
|
|
2284
|
-
(
|
|
2285
|
-
} else
|
|
2286
|
-
},
|
|
2284
|
+
const k = () => {
|
|
2285
|
+
const { x: m, y: S } = e.getBoundingClientRect(), E = v.target instanceof Node && e.contains(v.target) && f.getAt(v.clientX - m, v.clientY - S, r);
|
|
2286
|
+
if (E) {
|
|
2287
|
+
const { selected: L } = h;
|
|
2288
|
+
(L.length !== 1 || L[0].id !== E.id) && h.userSelect(E.id, v);
|
|
2289
|
+
} else h.isEmpty() || h.clear();
|
|
2290
|
+
}, T = v.timeStamp - c.timeStamp;
|
|
2287
2291
|
setTimeout(() => {
|
|
2288
|
-
const { isCollapsed:
|
|
2289
|
-
|
|
2292
|
+
const { isCollapsed: m } = document.getSelection();
|
|
2293
|
+
m && T < 300 ? (l = void 0, k()) : l && h.userSelect(l.annotation, v);
|
|
2290
2294
|
});
|
|
2291
2295
|
};
|
|
2292
|
-
document.addEventListener("pointerup", p)
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
return
|
|
2299
|
-
|
|
2300
|
-
}),
|
|
2301
|
-
|
|
2296
|
+
document.addEventListener("pointerup", p);
|
|
2297
|
+
const u = ["up", "down", "left", "right"], w = [
|
|
2298
|
+
...u.map((v) => `shift+${v}`),
|
|
2299
|
+
"ctrl+a",
|
|
2300
|
+
"⌘+a"
|
|
2301
|
+
];
|
|
2302
|
+
return Y(w.join(","), { element: e, keydown: !0, keyup: !1 }, (v) => {
|
|
2303
|
+
v.repeat || (c = ye(v));
|
|
2304
|
+
}), Y(u.join(","), { element: e, keydown: !0 }, (v) => {
|
|
2305
|
+
v.repeat || (l = void 0, h.clear());
|
|
2302
2306
|
}), {
|
|
2303
2307
|
destroy: () => {
|
|
2304
|
-
e.removeEventListener("selectstart",
|
|
2308
|
+
e.removeEventListener("selectstart", A), document.removeEventListener("selectionchange", C), document.removeEventListener("pointerdown", b), document.removeEventListener("pointerup", p), Y.unbind();
|
|
2305
2309
|
},
|
|
2306
2310
|
setFilter: s,
|
|
2307
2311
|
setUser: i,
|
|
2308
2312
|
setAnnotatingEnabled: d
|
|
2309
2313
|
};
|
|
2310
2314
|
}, ee = "SPANS", Mo = (e, t = {}) => {
|
|
2311
|
-
|
|
2312
|
-
const n =
|
|
2315
|
+
Ee(e), Le(e);
|
|
2316
|
+
const n = ao(t, {
|
|
2313
2317
|
annotatingEnabled: !0,
|
|
2314
|
-
user:
|
|
2315
|
-
}), o =
|
|
2318
|
+
user: yn()
|
|
2319
|
+
}), o = no(e, n.userSelectAction), { selection: i, viewport: r } = o, s = o.store, a = Bn(s), d = kn(o, a, n.adapter);
|
|
2316
2320
|
let f = n.user;
|
|
2317
|
-
const
|
|
2321
|
+
const h = n.renderer === "CSS_HIGHLIGHTS" ? CSS.highlights ? "CSS_HIGHLIGHTS" : ee : n.renderer || ee, l = h === "SPANS" ? on(e, o, r) : h === "CSS_HIGHLIGHTS" ? tn(e, o, r) : h === "CANVAS" ? $e(e, o, r) : void 0;
|
|
2318
2322
|
if (!l)
|
|
2319
|
-
throw `Unknown renderer implementation: ${
|
|
2320
|
-
console.debug(`Using ${
|
|
2321
|
-
const
|
|
2322
|
-
|
|
2323
|
-
const c =
|
|
2324
|
-
|
|
2325
|
-
},
|
|
2326
|
-
l.setFilter(
|
|
2327
|
-
}, p = (
|
|
2328
|
-
f =
|
|
2329
|
-
}, u = (
|
|
2330
|
-
|
|
2331
|
-
},
|
|
2332
|
-
|
|
2323
|
+
throw `Unknown renderer implementation: ${h}`;
|
|
2324
|
+
console.debug(`Using ${h} renderer`), n.style && l.setStyle(n.style);
|
|
2325
|
+
const g = vo(e, o, n.offsetReferenceSelector);
|
|
2326
|
+
g.setUser(f), g.setAnnotatingEnabled(n.annotatingEnabled);
|
|
2327
|
+
const c = On(o, a, n.adapter), A = () => f, C = (v) => {
|
|
2328
|
+
g.setAnnotatingEnabled(v);
|
|
2329
|
+
}, b = (v) => {
|
|
2330
|
+
l.setFilter(v), g.setFilter(v);
|
|
2331
|
+
}, p = (v) => {
|
|
2332
|
+
f = v, g.setUser(v);
|
|
2333
|
+
}, u = (v) => {
|
|
2334
|
+
v && (l.setPainter(io(e, v, n.presence)), v.on("selectionChange", () => l.redraw()));
|
|
2335
|
+
}, w = (v) => {
|
|
2336
|
+
v ? i.setSelected(v) : i.clear();
|
|
2333
2337
|
};
|
|
2334
2338
|
return {
|
|
2335
2339
|
...c,
|
|
2336
2340
|
destroy: () => {
|
|
2337
|
-
l.destroy(),
|
|
2341
|
+
l.destroy(), g.destroy(), a.destroy();
|
|
2338
2342
|
},
|
|
2339
2343
|
element: e,
|
|
2340
|
-
getUser:
|
|
2341
|
-
setAnnotatingEnabled:
|
|
2342
|
-
setFilter:
|
|
2344
|
+
getUser: A,
|
|
2345
|
+
setAnnotatingEnabled: C,
|
|
2346
|
+
setFilter: b,
|
|
2343
2347
|
setStyle: l.setStyle.bind(l),
|
|
2344
2348
|
redraw: l.redraw.bind(l),
|
|
2345
2349
|
setUser: p,
|
|
2346
|
-
setSelected:
|
|
2350
|
+
setSelected: w,
|
|
2347
2351
|
setPresenceProvider: u,
|
|
2348
2352
|
setVisible: l.setVisible.bind(l),
|
|
2349
2353
|
on: d.on,
|
|
2350
2354
|
off: d.off,
|
|
2351
|
-
scrollIntoView:
|
|
2355
|
+
scrollIntoView: ro(e, s),
|
|
2352
2356
|
state: o
|
|
2353
2357
|
};
|
|
2354
2358
|
};
|
|
@@ -2356,42 +2360,42 @@ export {
|
|
|
2356
2360
|
gt as DEFAULT_SELECTED_STYLE,
|
|
2357
2361
|
q as DEFAULT_STYLE,
|
|
2358
2362
|
ne as NOT_ANNOTATABLE_CLASS,
|
|
2359
|
-
|
|
2363
|
+
$ as NOT_ANNOTATABLE_SELECTOR,
|
|
2360
2364
|
V as Origin,
|
|
2361
|
-
|
|
2365
|
+
un as UserSelectAction,
|
|
2362
2366
|
To as W3CTextFormat,
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2367
|
+
Ee as cancelSingleClickEvents,
|
|
2368
|
+
ye as cloneKeyboardEvent,
|
|
2369
|
+
De as clonePointerEvent,
|
|
2366
2370
|
Lo as createBody,
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
+
$e as createCanvasRenderer,
|
|
2372
|
+
tn as createHighlightsRenderer,
|
|
2373
|
+
Ke as createRenderer,
|
|
2374
|
+
on as createSpansRenderer,
|
|
2371
2375
|
Mo as createTextAnnotator,
|
|
2372
|
-
|
|
2376
|
+
no as createTextAnnotatorState,
|
|
2373
2377
|
Nt as debounce,
|
|
2374
2378
|
Eo as denormalizeRectWithOffset,
|
|
2375
|
-
|
|
2376
|
-
|
|
2379
|
+
ao as fillDefaults,
|
|
2380
|
+
So as getAnnotatableFragment,
|
|
2377
2381
|
Co as getClientRectsPonyfill,
|
|
2378
|
-
|
|
2382
|
+
Be as getQuoteContext,
|
|
2379
2383
|
kt as getRangeAnnotatableContents,
|
|
2380
2384
|
z as isRevived,
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2385
|
+
ke as isWhitespaceOrEmpty,
|
|
2386
|
+
Ne as mergeClientRects,
|
|
2387
|
+
Pe as normalizeRectWithOffset,
|
|
2384
2388
|
ve as paint,
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2389
|
+
$n as parseW3CTextAnnotation,
|
|
2390
|
+
Le as programmaticallyFocusable,
|
|
2391
|
+
Ie as rangeToSelector,
|
|
2388
2392
|
bt as reviveAnnotation,
|
|
2389
2393
|
oe as reviveSelector,
|
|
2390
2394
|
mt as reviveTarget,
|
|
2391
|
-
|
|
2392
|
-
|
|
2395
|
+
jn as serializeW3CTextAnnotation,
|
|
2396
|
+
xe as splitAnnotatableRanges,
|
|
2393
2397
|
xo as toDomRectList,
|
|
2394
|
-
|
|
2395
|
-
|
|
2398
|
+
Fe as trimRangeToContainer,
|
|
2399
|
+
Re as whitespaceOrEmptyRegex
|
|
2396
2400
|
};
|
|
2397
2401
|
//# sourceMappingURL=text-annotator.es.js.map
|