@annotorious/annotorious 3.0.0-rc.14 → 3.0.0-rc.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Annotorious.d.ts +1 -1
- package/dist/Annotorious.d.ts.map +1 -1
- package/dist/AnnotoriousOpts.d.ts +2 -3
- package/dist/AnnotoriousOpts.d.ts.map +1 -1
- package/dist/annotorious.es.js +1070 -1046
- package/dist/annotorious.es.js.map +1 -1
- package/dist/annotorious.js +1 -1
- package/dist/annotorious.js.map +1 -1
- package/dist/model/w3c/W3CImageFormatAdapter.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Annotorious.ts +7 -2
- package/src/AnnotoriousOpts.ts +7 -7
- package/src/model/w3c/W3CImageFormatAdapter.ts +28 -9
package/dist/annotorious.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function F() {
|
|
2
2
|
}
|
|
3
|
-
function
|
|
3
|
+
function en(e, t) {
|
|
4
4
|
for (const n in t)
|
|
5
5
|
e[n] = t[n];
|
|
6
6
|
return e;
|
|
@@ -20,7 +20,7 @@ function j(e) {
|
|
|
20
20
|
function J(e, t) {
|
|
21
21
|
return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function tn(e) {
|
|
24
24
|
return Object.keys(e).length === 0;
|
|
25
25
|
}
|
|
26
26
|
function Vt(e, ...t) {
|
|
@@ -32,34 +32,34 @@ function Vt(e, ...t) {
|
|
|
32
32
|
function dt(e, t, n) {
|
|
33
33
|
e.$$.on_destroy.push(Vt(t, n));
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function nn(e, t, n, o) {
|
|
36
36
|
if (e) {
|
|
37
37
|
const i = Gt(e, t, n, o);
|
|
38
38
|
return e[0](i);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
function Gt(e, t, n, o) {
|
|
42
|
-
return e[1] && o ?
|
|
42
|
+
return e[1] && o ? en(n.ctx.slice(), e[1](o(t))) : n.ctx;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function on(e, t, n, o) {
|
|
45
45
|
if (e[2] && o) {
|
|
46
46
|
const i = e[2](o(n));
|
|
47
47
|
if (t.dirty === void 0)
|
|
48
48
|
return i;
|
|
49
49
|
if (typeof i == "object") {
|
|
50
|
-
const
|
|
51
|
-
for (let a = 0; a <
|
|
52
|
-
|
|
53
|
-
return
|
|
50
|
+
const r = [], s = Math.max(t.dirty.length, i.length);
|
|
51
|
+
for (let a = 0; a < s; a += 1)
|
|
52
|
+
r[a] = t.dirty[a] | i[a];
|
|
53
|
+
return r;
|
|
54
54
|
}
|
|
55
55
|
return t.dirty | i;
|
|
56
56
|
}
|
|
57
57
|
return t.dirty;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function rn(e, t, n, o, i, r) {
|
|
60
60
|
if (i) {
|
|
61
|
-
const
|
|
62
|
-
e.p(
|
|
61
|
+
const s = Gt(t, n, o, r);
|
|
62
|
+
e.p(s, i);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
function sn(e) {
|
|
@@ -71,7 +71,7 @@ function sn(e) {
|
|
|
71
71
|
}
|
|
72
72
|
return -1;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function se(e, t) {
|
|
75
75
|
e.appendChild(t);
|
|
76
76
|
}
|
|
77
77
|
function I(e, t, n) {
|
|
@@ -80,7 +80,7 @@ function I(e, t, n) {
|
|
|
80
80
|
function k(e) {
|
|
81
81
|
e.parentNode && e.parentNode.removeChild(e);
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function rt(e, t) {
|
|
84
84
|
for (let n = 0; n < e.length; n += 1)
|
|
85
85
|
e[n] && e[n].d(t);
|
|
86
86
|
}
|
|
@@ -93,7 +93,7 @@ function Ft(e) {
|
|
|
93
93
|
function $() {
|
|
94
94
|
return Ft(" ");
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function re() {
|
|
97
97
|
return Ft("");
|
|
98
98
|
}
|
|
99
99
|
function K(e, t, n, o) {
|
|
@@ -102,13 +102,13 @@ function K(e, t, n, o) {
|
|
|
102
102
|
function f(e, t, n) {
|
|
103
103
|
n == null ? e.removeAttribute(t) : e.getAttribute(t) !== n && e.setAttribute(t, n);
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function ln(e) {
|
|
106
106
|
return Array.from(e.childNodes);
|
|
107
107
|
}
|
|
108
108
|
function ht(e, t, n) {
|
|
109
109
|
e.classList[n ? "add" : "remove"](t);
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function an(e, t, { bubbles: n = !1, cancelable: o = !1 } = {}) {
|
|
112
112
|
const i = document.createEvent("CustomEvent");
|
|
113
113
|
return i.initCustomEvent(e, n, o, t), i;
|
|
114
114
|
}
|
|
@@ -129,10 +129,10 @@ function Se() {
|
|
|
129
129
|
return (t, n, { cancelable: o = !1 } = {}) => {
|
|
130
130
|
const i = e.$$.callbacks[t];
|
|
131
131
|
if (i) {
|
|
132
|
-
const
|
|
133
|
-
return i.slice().forEach((
|
|
134
|
-
|
|
135
|
-
}), !
|
|
132
|
+
const r = an(t, n, { cancelable: o });
|
|
133
|
+
return i.slice().forEach((s) => {
|
|
134
|
+
s.call(e, r);
|
|
135
|
+
}), !r.defaultPrevented;
|
|
136
136
|
}
|
|
137
137
|
return !0;
|
|
138
138
|
};
|
|
@@ -143,10 +143,10 @@ function Ae(e, t) {
|
|
|
143
143
|
}
|
|
144
144
|
const be = [], Ge = [];
|
|
145
145
|
let Te = [];
|
|
146
|
-
const mt = [],
|
|
146
|
+
const mt = [], cn = /* @__PURE__ */ Promise.resolve();
|
|
147
147
|
let tt = !1;
|
|
148
|
-
function
|
|
149
|
-
tt || (tt = !0,
|
|
148
|
+
function un() {
|
|
149
|
+
tt || (tt = !0, cn.then(zt));
|
|
150
150
|
}
|
|
151
151
|
function nt(e) {
|
|
152
152
|
Te.push(e);
|
|
@@ -161,7 +161,7 @@ function zt() {
|
|
|
161
161
|
try {
|
|
162
162
|
for (; pe < be.length; ) {
|
|
163
163
|
const t = be[pe];
|
|
164
|
-
pe++, ke(t),
|
|
164
|
+
pe++, ke(t), fn(t.$$);
|
|
165
165
|
}
|
|
166
166
|
} catch (t) {
|
|
167
167
|
throw be.length = 0, pe = 0, t;
|
|
@@ -178,14 +178,14 @@ function zt() {
|
|
|
178
178
|
mt.pop()();
|
|
179
179
|
tt = !1, Ke.clear(), ke(e);
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function fn(e) {
|
|
182
182
|
if (e.fragment !== null) {
|
|
183
183
|
e.update(), ie(e.before_update);
|
|
184
184
|
const t = e.dirty;
|
|
185
185
|
e.dirty = [-1], e.fragment && e.fragment.p(e.ctx, t), e.after_update.forEach(nt);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function dn(e) {
|
|
189
189
|
const t = [], n = [];
|
|
190
190
|
Te.forEach((o) => e.indexOf(o) === -1 ? t.push(o) : n.push(o)), n.forEach((o) => o()), Te = t;
|
|
191
191
|
}
|
|
@@ -219,27 +219,27 @@ function he(e) {
|
|
|
219
219
|
e && e.c();
|
|
220
220
|
}
|
|
221
221
|
function le(e, t, n, o) {
|
|
222
|
-
const { fragment: i, after_update:
|
|
222
|
+
const { fragment: i, after_update: r } = e.$$;
|
|
223
223
|
i && i.m(t, n), o || nt(() => {
|
|
224
|
-
const
|
|
225
|
-
e.$$.on_destroy ? e.$$.on_destroy.push(...
|
|
226
|
-
}),
|
|
224
|
+
const s = e.$$.on_mount.map(Nt).filter(j);
|
|
225
|
+
e.$$.on_destroy ? e.$$.on_destroy.push(...s) : ie(s), e.$$.on_mount = [];
|
|
226
|
+
}), r.forEach(nt);
|
|
227
227
|
}
|
|
228
228
|
function ae(e, t) {
|
|
229
229
|
const n = e.$$;
|
|
230
|
-
n.fragment !== null && (
|
|
230
|
+
n.fragment !== null && (dn(n.after_update), ie(n.on_destroy), n.fragment && n.fragment.d(t), n.on_destroy = n.fragment = null, n.ctx = []);
|
|
231
231
|
}
|
|
232
|
-
function
|
|
233
|
-
e.$$.dirty[0] === -1 && (be.push(e),
|
|
232
|
+
function hn(e, t) {
|
|
233
|
+
e.$$.dirty[0] === -1 && (be.push(e), un(), e.$$.dirty.fill(0)), e.$$.dirty[t / 31 | 0] |= 1 << t % 31;
|
|
234
234
|
}
|
|
235
|
-
function ee(e, t, n, o, i,
|
|
235
|
+
function ee(e, t, n, o, i, r, s, a = [-1]) {
|
|
236
236
|
const l = Ie;
|
|
237
237
|
ke(e);
|
|
238
|
-
const
|
|
238
|
+
const u = e.$$ = {
|
|
239
239
|
fragment: null,
|
|
240
240
|
ctx: [],
|
|
241
241
|
// state
|
|
242
|
-
props:
|
|
242
|
+
props: r,
|
|
243
243
|
update: F,
|
|
244
244
|
not_equal: i,
|
|
245
245
|
bound: ft(),
|
|
@@ -256,17 +256,17 @@ function ee(e, t, n, o, i, s, r, a = [-1]) {
|
|
|
256
256
|
skip_bound: !1,
|
|
257
257
|
root: t.target || l.$$.root
|
|
258
258
|
};
|
|
259
|
-
|
|
259
|
+
s && s(u.root);
|
|
260
260
|
let h = !1;
|
|
261
|
-
if (
|
|
261
|
+
if (u.ctx = n ? n(e, t.props || {}, (c, m, ...d) => {
|
|
262
262
|
const g = d.length ? d[0] : m;
|
|
263
|
-
return
|
|
264
|
-
}) : [],
|
|
263
|
+
return u.ctx && i(u.ctx[c], u.ctx[c] = g) && (!u.skip_bound && u.bound[c] && u.bound[c](g), h && hn(e, c)), m;
|
|
264
|
+
}) : [], u.update(), h = !0, ie(u.before_update), u.fragment = o ? o(u.ctx) : !1, t.target) {
|
|
265
265
|
if (t.hydrate) {
|
|
266
|
-
const
|
|
267
|
-
|
|
266
|
+
const c = ln(t.target);
|
|
267
|
+
u.fragment && u.fragment.l(c), c.forEach(k);
|
|
268
268
|
} else
|
|
269
|
-
|
|
269
|
+
u.fragment && u.fragment.c();
|
|
270
270
|
t.intro && C(e.$$.fragment), le(e, t.target, t.anchor, t.customElement), zt();
|
|
271
271
|
}
|
|
272
272
|
ke(l);
|
|
@@ -285,24 +285,24 @@ class te {
|
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
287
|
$set(t) {
|
|
288
|
-
this.$$set && !
|
|
288
|
+
this.$$set && !tn(t) && (this.$$.skip_bound = !0, this.$$set(t), this.$$.skip_bound = !1);
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
291
|
var z = /* @__PURE__ */ ((e) => (e.ELLIPSE = "ELLIPSE", e.POLYGON = "POLYGON", e.RECTANGLE = "RECTANGLE", e))(z || {});
|
|
292
|
-
const
|
|
292
|
+
const st = {}, lt = (e, t) => st[e] = t, ot = (e) => st[e.type].area(e), mn = (e, t, n) => st[e.type].intersects(e, t, n), Fe = (e) => {
|
|
293
293
|
let t = 1 / 0, n = 1 / 0, o = -1 / 0, i = -1 / 0;
|
|
294
|
-
return e.forEach(([
|
|
295
|
-
t = Math.min(t,
|
|
294
|
+
return e.forEach(([r, s]) => {
|
|
295
|
+
t = Math.min(t, r), n = Math.min(n, s), o = Math.max(o, r), i = Math.max(i, s);
|
|
296
296
|
}), { minX: t, minY: n, maxX: o, maxY: i };
|
|
297
|
-
},
|
|
297
|
+
}, gn = {
|
|
298
298
|
area: (e) => Math.PI * e.geometry.rx * e.geometry.ry,
|
|
299
299
|
intersects: (e, t, n) => {
|
|
300
|
-
const { cx: o, cy: i, rx:
|
|
301
|
-
return m * m / (
|
|
300
|
+
const { cx: o, cy: i, rx: r, ry: s } = e.geometry, a = 0, l = Math.cos(a), u = Math.sin(a), h = t - o, c = n - i, m = l * h + u * c, d = u * h - l * c;
|
|
301
|
+
return m * m / (r * r) + d * d / (s * s) <= 1;
|
|
302
302
|
}
|
|
303
303
|
};
|
|
304
|
-
lt(z.ELLIPSE,
|
|
305
|
-
const
|
|
304
|
+
lt(z.ELLIPSE, gn);
|
|
305
|
+
const pn = {
|
|
306
306
|
area: (e) => {
|
|
307
307
|
const { points: t } = e.geometry;
|
|
308
308
|
let n = 0, o = t.length - 1;
|
|
@@ -313,26 +313,26 @@ const gn = {
|
|
|
313
313
|
intersects: (e, t, n) => {
|
|
314
314
|
const { points: o } = e.geometry;
|
|
315
315
|
let i = !1;
|
|
316
|
-
for (let
|
|
317
|
-
const a = o[
|
|
318
|
-
l > n != h > n && t < (
|
|
316
|
+
for (let r = 0, s = o.length - 1; r < o.length; s = r++) {
|
|
317
|
+
const a = o[r][0], l = o[r][1], u = o[s][0], h = o[s][1];
|
|
318
|
+
l > n != h > n && t < (u - a) * (n - l) / (h - l) + a && (i = !i);
|
|
319
319
|
}
|
|
320
320
|
return i;
|
|
321
321
|
}
|
|
322
322
|
};
|
|
323
|
-
lt(z.POLYGON,
|
|
324
|
-
const
|
|
323
|
+
lt(z.POLYGON, pn);
|
|
324
|
+
const yn = {
|
|
325
325
|
area: (e) => e.geometry.w * e.geometry.h,
|
|
326
326
|
intersects: (e, t, n) => t >= e.geometry.x && t <= e.geometry.x + e.geometry.w && n >= e.geometry.y && n <= e.geometry.y + e.geometry.h
|
|
327
327
|
};
|
|
328
|
-
lt(z.RECTANGLE,
|
|
329
|
-
const
|
|
330
|
-
const n = typeof e == "string" ? e : e.value, o = /^(xywh)=(pixel|percent)?:?(.+?),(.+?),(.+?),(.+)*/g, i = [...n.matchAll(o)][0], [
|
|
331
|
-
if (
|
|
328
|
+
lt(z.RECTANGLE, yn);
|
|
329
|
+
const _n = (e, t = !1) => {
|
|
330
|
+
const n = typeof e == "string" ? e : e.value, o = /^(xywh)=(pixel|percent)?:?(.+?),(.+?),(.+?),(.+)*/g, i = [...n.matchAll(o)][0], [r, s, a, l, u, h, c] = i;
|
|
331
|
+
if (s !== "xywh")
|
|
332
332
|
throw new Error("Unsupported MediaFragment: " + n);
|
|
333
333
|
if (a && a !== "pixel")
|
|
334
334
|
throw new Error(`Unsupported MediaFragment unit: ${a}`);
|
|
335
|
-
const [m, d, g, _] = [l,
|
|
335
|
+
const [m, d, g, _] = [l, u, h, c].map(parseFloat);
|
|
336
336
|
return {
|
|
337
337
|
type: z.RECTANGLE,
|
|
338
338
|
geometry: {
|
|
@@ -348,7 +348,7 @@ const yn = (e, t = !1) => {
|
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
350
|
};
|
|
351
|
-
},
|
|
351
|
+
}, wn = (e) => {
|
|
352
352
|
const { x: t, y: n, w: o, h: i } = e;
|
|
353
353
|
return {
|
|
354
354
|
type: "FragmentSelector",
|
|
@@ -362,17 +362,17 @@ const yn = (e, t = !1) => {
|
|
|
362
362
|
});
|
|
363
363
|
}, n = e.getElementsByTagName("script");
|
|
364
364
|
return Array.from(n).reverse().forEach((o) => o.parentNode.removeChild(o)), Array.from(e.querySelectorAll("*")).forEach(t), e;
|
|
365
|
-
},
|
|
365
|
+
}, bn = (e) => {
|
|
366
366
|
const o = new XMLSerializer().serializeToString(e.documentElement).replace("<svg>", `<svg xmlns="${jt}">`);
|
|
367
367
|
return new DOMParser().parseFromString(o, "image/svg+xml").documentElement;
|
|
368
|
-
}, bn = (e) => {
|
|
369
|
-
const n = new DOMParser().parseFromString(e, "image/svg+xml"), o = n.lookupPrefix(jt), i = n.lookupNamespaceURI(null);
|
|
370
|
-
return o || i ? gt(n).firstChild : gt(wn(n)).firstChild;
|
|
371
368
|
}, En = (e) => {
|
|
369
|
+
const n = new DOMParser().parseFromString(e, "image/svg+xml"), o = n.lookupPrefix(jt), i = n.lookupNamespaceURI(null);
|
|
370
|
+
return o || i ? gt(n).firstChild : gt(bn(n)).firstChild;
|
|
371
|
+
}, An = (e) => {
|
|
372
372
|
const [t, n, o] = e.match(/(<polygon points=["|'])([^("|')]*)/) || [];
|
|
373
373
|
if (!o)
|
|
374
374
|
return;
|
|
375
|
-
const i = o.split(" ").map((
|
|
375
|
+
const i = o.split(" ").map((r) => r.split(",").map(parseFloat));
|
|
376
376
|
return {
|
|
377
377
|
type: z.POLYGON,
|
|
378
378
|
geometry: {
|
|
@@ -380,12 +380,12 @@ const yn = (e, t = !1) => {
|
|
|
380
380
|
bounds: Fe(i)
|
|
381
381
|
}
|
|
382
382
|
};
|
|
383
|
-
},
|
|
384
|
-
const t =
|
|
383
|
+
}, Tn = (e) => {
|
|
384
|
+
const t = En(e), n = parseFloat(t.getAttribute("cx")), o = parseFloat(t.getAttribute("cy")), i = parseFloat(t.getAttribute("rx")), r = parseFloat(t.getAttribute("ry")), s = {
|
|
385
385
|
minX: n - i,
|
|
386
|
-
minY: o -
|
|
386
|
+
minY: o - r,
|
|
387
387
|
maxX: n + i,
|
|
388
|
-
maxY: o +
|
|
388
|
+
maxY: o + r
|
|
389
389
|
};
|
|
390
390
|
return {
|
|
391
391
|
type: z.ELLIPSE,
|
|
@@ -393,17 +393,17 @@ const yn = (e, t = !1) => {
|
|
|
393
393
|
cx: n,
|
|
394
394
|
cy: o,
|
|
395
395
|
rx: i,
|
|
396
|
-
ry:
|
|
397
|
-
bounds:
|
|
396
|
+
ry: r,
|
|
397
|
+
bounds: s
|
|
398
398
|
}
|
|
399
399
|
};
|
|
400
|
-
},
|
|
400
|
+
}, Sn = (e) => {
|
|
401
401
|
const t = typeof e == "string" ? e : e.value;
|
|
402
402
|
if (t.includes("<polygon points="))
|
|
403
|
-
return En(t);
|
|
404
|
-
if (t.includes("<ellipse "))
|
|
405
403
|
return An(t);
|
|
406
|
-
|
|
404
|
+
if (t.includes("<ellipse "))
|
|
405
|
+
return Tn(t);
|
|
406
|
+
}, Mn = (e) => {
|
|
407
407
|
let t;
|
|
408
408
|
if (e.type === z.POLYGON) {
|
|
409
409
|
const n = e.geometry, { points: o } = n;
|
|
@@ -417,33 +417,33 @@ const yn = (e, t = !1) => {
|
|
|
417
417
|
throw `Unsupported shape type: ${e.type}`;
|
|
418
418
|
};
|
|
419
419
|
let Ce;
|
|
420
|
-
const
|
|
421
|
-
function
|
|
420
|
+
const Ln = new Uint8Array(16);
|
|
421
|
+
function On() {
|
|
422
422
|
if (!Ce && (Ce = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Ce))
|
|
423
423
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
424
|
-
return Ce(
|
|
424
|
+
return Ce(Ln);
|
|
425
425
|
}
|
|
426
426
|
const q = [];
|
|
427
427
|
for (let e = 0; e < 256; ++e)
|
|
428
428
|
q.push((e + 256).toString(16).slice(1));
|
|
429
|
-
function
|
|
429
|
+
function vn(e, t = 0) {
|
|
430
430
|
return q[e[t + 0]] + q[e[t + 1]] + q[e[t + 2]] + q[e[t + 3]] + "-" + q[e[t + 4]] + q[e[t + 5]] + "-" + q[e[t + 6]] + q[e[t + 7]] + "-" + q[e[t + 8]] + q[e[t + 9]] + "-" + q[e[t + 10]] + q[e[t + 11]] + q[e[t + 12]] + q[e[t + 13]] + q[e[t + 14]] + q[e[t + 15]];
|
|
431
431
|
}
|
|
432
|
-
const
|
|
433
|
-
randomUUID:
|
|
432
|
+
const kn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), pt = {
|
|
433
|
+
randomUUID: kn
|
|
434
434
|
};
|
|
435
435
|
function qt(e, t, n) {
|
|
436
436
|
if (pt.randomUUID && !t && !e)
|
|
437
437
|
return pt.randomUUID();
|
|
438
438
|
e = e || {};
|
|
439
|
-
const o = e.random || (e.rng ||
|
|
439
|
+
const o = e.random || (e.rng || On)();
|
|
440
440
|
if (o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, t) {
|
|
441
441
|
n = n || 0;
|
|
442
442
|
for (let i = 0; i < 16; ++i)
|
|
443
443
|
t[n + i] = o[i];
|
|
444
444
|
return t;
|
|
445
445
|
}
|
|
446
|
-
return
|
|
446
|
+
return vn(o);
|
|
447
447
|
}
|
|
448
448
|
var yt = Object.prototype.hasOwnProperty;
|
|
449
449
|
function de(e, t) {
|
|
@@ -473,7 +473,7 @@ function de(e, t) {
|
|
|
473
473
|
}
|
|
474
474
|
function We() {
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function In(e, t) {
|
|
477
477
|
return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
|
|
478
478
|
}
|
|
479
479
|
const ye = [];
|
|
@@ -481,36 +481,36 @@ function at(e, t = We) {
|
|
|
481
481
|
let n;
|
|
482
482
|
const o = /* @__PURE__ */ new Set();
|
|
483
483
|
function i(a) {
|
|
484
|
-
if (
|
|
484
|
+
if (In(e, a) && (e = a, n)) {
|
|
485
485
|
const l = !ye.length;
|
|
486
|
-
for (const
|
|
487
|
-
|
|
486
|
+
for (const u of o)
|
|
487
|
+
u[1](), ye.push(u, e);
|
|
488
488
|
if (l) {
|
|
489
|
-
for (let
|
|
490
|
-
ye[
|
|
489
|
+
for (let u = 0; u < ye.length; u += 2)
|
|
490
|
+
ye[u][0](ye[u + 1]);
|
|
491
491
|
ye.length = 0;
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function r(a) {
|
|
496
496
|
i(a(e));
|
|
497
497
|
}
|
|
498
|
-
function
|
|
499
|
-
const
|
|
500
|
-
return o.add(
|
|
501
|
-
o.delete(
|
|
498
|
+
function s(a, l = We) {
|
|
499
|
+
const u = [a, l];
|
|
500
|
+
return o.add(u), o.size === 1 && (n = t(i) || We), a(e), () => {
|
|
501
|
+
o.delete(u), o.size === 0 && n && (n(), n = null);
|
|
502
502
|
};
|
|
503
503
|
}
|
|
504
|
-
return { set: i, update:
|
|
504
|
+
return { set: i, update: r, subscribe: s };
|
|
505
505
|
}
|
|
506
|
-
const
|
|
506
|
+
const Bn = (e) => {
|
|
507
507
|
const { subscribe: t, set: n } = at(null);
|
|
508
508
|
let o = null;
|
|
509
509
|
return t((i) => o = i), e.observe(({ changes: i }) => {
|
|
510
510
|
if (o) {
|
|
511
|
-
i.deleted.some((
|
|
512
|
-
const
|
|
513
|
-
|
|
511
|
+
i.deleted.some((s) => s.id === o) && n(null);
|
|
512
|
+
const r = i.updated.find(({ oldValue: s }) => s.id === o);
|
|
513
|
+
r && n(r.newValue.id);
|
|
514
514
|
}
|
|
515
515
|
}), {
|
|
516
516
|
get current() {
|
|
@@ -521,36 +521,36 @@ const In = (e) => {
|
|
|
521
521
|
};
|
|
522
522
|
};
|
|
523
523
|
var Kt = /* @__PURE__ */ ((e) => (e.EDIT = "EDIT", e.SELECT = "SELECT", e.NONE = "NONE", e))(Kt || {});
|
|
524
|
-
const Je = { selected: [] },
|
|
524
|
+
const Je = { selected: [] }, Pn = (e, t = "EDIT") => {
|
|
525
525
|
const { subscribe: n, set: o } = at(Je);
|
|
526
526
|
let i = Je;
|
|
527
|
-
n((
|
|
528
|
-
const
|
|
529
|
-
var
|
|
530
|
-
return ((
|
|
531
|
-
}, a = (
|
|
527
|
+
n((c) => i = c);
|
|
528
|
+
const r = () => o(Je), s = () => {
|
|
529
|
+
var c;
|
|
530
|
+
return ((c = i.selected) == null ? void 0 : c.length) === 0;
|
|
531
|
+
}, a = (c) => {
|
|
532
532
|
if (i.selected.length === 0)
|
|
533
533
|
return !1;
|
|
534
|
-
const m = typeof
|
|
534
|
+
const m = typeof c == "string" ? c : c.id;
|
|
535
535
|
return i.selected.some((d) => d.id === m);
|
|
536
|
-
}, l = (
|
|
537
|
-
const d = e.getAnnotation(
|
|
536
|
+
}, l = (c, m) => {
|
|
537
|
+
const d = e.getAnnotation(c);
|
|
538
538
|
if (d) {
|
|
539
|
-
const g =
|
|
540
|
-
o(g === "EDIT" ? { selected: [{ id:
|
|
539
|
+
const g = Yn(d, t);
|
|
540
|
+
o(g === "EDIT" ? { selected: [{ id: c, editable: !0 }], pointerEvent: m } : g === "SELECT" ? { selected: [{ id: c }], pointerEvent: m } : { selected: [], pointerEvent: m });
|
|
541
541
|
} else
|
|
542
|
-
console.warn("Invalid selection: " +
|
|
543
|
-
},
|
|
544
|
-
const d = Array.isArray(
|
|
545
|
-
o({ selected: g.map(({ id: _ }) => ({ id: _, editable: m })) }), g.length !== d.length && console.warn("Invalid selection",
|
|
546
|
-
}, h = (
|
|
542
|
+
console.warn("Invalid selection: " + c);
|
|
543
|
+
}, u = (c, m = !0) => {
|
|
544
|
+
const d = Array.isArray(c) ? c : [c], g = d.map((_) => e.getAnnotation(_)).filter((_) => _);
|
|
545
|
+
o({ selected: g.map(({ id: _ }) => ({ id: _, editable: m })) }), g.length !== d.length && console.warn("Invalid selection", c);
|
|
546
|
+
}, h = (c) => {
|
|
547
547
|
if (i.selected.length === 0)
|
|
548
548
|
return !1;
|
|
549
549
|
const { selected: m } = i;
|
|
550
|
-
m.filter(({ id: d }) =>
|
|
550
|
+
m.filter(({ id: d }) => c.includes(d)).length > 0 && o({ selected: m.filter(({ id: d }) => !c.includes(d)) });
|
|
551
551
|
};
|
|
552
|
-
return e.observe(({ changes:
|
|
553
|
-
clear:
|
|
552
|
+
return e.observe(({ changes: c }) => h(c.deleted.map((m) => m.id))), {
|
|
553
|
+
clear: r,
|
|
554
554
|
clickSelect: l,
|
|
555
555
|
get selected() {
|
|
556
556
|
return i ? [...i.selected] : null;
|
|
@@ -558,82 +558,82 @@ const Je = { selected: [] }, Bn = (e, t = "EDIT") => {
|
|
|
558
558
|
get pointerEvent() {
|
|
559
559
|
return i ? i.pointerEvent : null;
|
|
560
560
|
},
|
|
561
|
-
isEmpty:
|
|
561
|
+
isEmpty: s,
|
|
562
562
|
isSelected: a,
|
|
563
|
-
setSelected:
|
|
563
|
+
setSelected: u,
|
|
564
564
|
subscribe: n
|
|
565
565
|
};
|
|
566
|
-
},
|
|
566
|
+
}, Yn = (e, t) => typeof t == "function" ? t(e) || "EDIT" : t || "EDIT", Dn = [];
|
|
567
567
|
for (let e = 0; e < 256; ++e)
|
|
568
|
-
|
|
568
|
+
Dn.push((e + 256).toString(16).slice(1));
|
|
569
569
|
typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
570
570
|
const Xn = (e, t) => {
|
|
571
571
|
const n = new Set(e.bodies.map((o) => o.id));
|
|
572
572
|
return t.bodies.filter((o) => !n.has(o.id));
|
|
573
|
-
},
|
|
573
|
+
}, Rn = (e, t) => {
|
|
574
574
|
const n = new Set(t.bodies.map((o) => o.id));
|
|
575
575
|
return e.bodies.filter((o) => !n.has(o.id));
|
|
576
|
-
},
|
|
576
|
+
}, Cn = (e, t) => t.bodies.map((n) => {
|
|
577
577
|
const o = e.bodies.find((i) => i.id === n.id);
|
|
578
578
|
return { newBody: n, oldBody: o && !de(o, n) ? o : void 0 };
|
|
579
|
-
}).filter(({ oldBody: n }) => n),
|
|
580
|
-
const n = Xn(e, t), o =
|
|
579
|
+
}).filter(({ oldBody: n }) => n), Un = (e, t) => !de(e.target, t.target), Wt = (e, t) => {
|
|
580
|
+
const n = Xn(e, t), o = Rn(e, t), i = Cn(e, t);
|
|
581
581
|
return {
|
|
582
582
|
oldValue: e,
|
|
583
583
|
newValue: t,
|
|
584
584
|
bodiesCreated: n.length > 0 ? n : void 0,
|
|
585
585
|
bodiesDeleted: o.length > 0 ? o : void 0,
|
|
586
586
|
bodiesUpdated: i.length > 0 ? i : void 0,
|
|
587
|
-
targetUpdated:
|
|
587
|
+
targetUpdated: Un(e, t) ? { oldTarget: e.target, newTarget: t.target } : void 0
|
|
588
588
|
};
|
|
589
589
|
};
|
|
590
590
|
var V = /* @__PURE__ */ ((e) => (e.LOCAL = "LOCAL", e.REMOTE = "REMOTE", e))(V || {});
|
|
591
|
-
const
|
|
591
|
+
const Nn = (e, t) => {
|
|
592
592
|
var n, o;
|
|
593
|
-
const { changes: i, origin:
|
|
594
|
-
if (!(!e.options.origin || e.options.origin ===
|
|
593
|
+
const { changes: i, origin: r } = t;
|
|
594
|
+
if (!(!e.options.origin || e.options.origin === r))
|
|
595
595
|
return !1;
|
|
596
596
|
if (e.options.ignore) {
|
|
597
|
-
const { ignore:
|
|
597
|
+
const { ignore: s } = e.options, a = (l) => (l == null ? void 0 : l.length) > 0;
|
|
598
598
|
if (!(a(i.created) || a(i.deleted))) {
|
|
599
|
-
const l = (n = i.updated) == null ? void 0 : n.some((h) => a(h.bodiesCreated) || a(h.bodiesDeleted) || a(h.bodiesUpdated)),
|
|
600
|
-
if (
|
|
599
|
+
const l = (n = i.updated) == null ? void 0 : n.some((h) => a(h.bodiesCreated) || a(h.bodiesDeleted) || a(h.bodiesUpdated)), u = (o = i.updated) == null ? void 0 : o.some((h) => h.targetUpdated);
|
|
600
|
+
if (s === "BODY_ONLY" && l && !u || s === "TARGET_ONLY" && u && !l)
|
|
601
601
|
return !1;
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
604
|
if (e.options.annotations) {
|
|
605
|
-
const
|
|
605
|
+
const s = /* @__PURE__ */ new Set([
|
|
606
606
|
...i.created.map((a) => a.id),
|
|
607
607
|
...i.deleted.map((a) => a.id),
|
|
608
608
|
...i.updated.map(({ oldValue: a }) => a.id)
|
|
609
609
|
]);
|
|
610
|
-
return !!(Array.isArray(e.options.annotations) ? e.options.annotations : [e.options.annotations]).find((a) =>
|
|
610
|
+
return !!(Array.isArray(e.options.annotations) ? e.options.annotations : [e.options.annotations]).find((a) => s.has(a));
|
|
611
611
|
} else
|
|
612
612
|
return !0;
|
|
613
|
-
},
|
|
614
|
-
const n = new Set((e.created || []).map((
|
|
615
|
-
...(e.created || []).filter((
|
|
613
|
+
}, Vn = (e, t) => {
|
|
614
|
+
const n = new Set((e.created || []).map((c) => c.id)), o = new Set((e.updated || []).map(({ newValue: c }) => c.id)), i = new Set((t.created || []).map((c) => c.id)), r = new Set((t.deleted || []).map((c) => c.id)), s = new Set((t.updated || []).map(({ oldValue: c }) => c.id)), a = new Set((t.updated || []).filter(({ oldValue: c }) => n.has(c.id) || o.has(c.id)).map(({ oldValue: c }) => c.id)), l = [
|
|
615
|
+
...(e.created || []).filter((c) => !r.has(c.id)).map((c) => s.has(c.id) ? t.updated.find(({ oldValue: m }) => m.id === c.id).newValue : c),
|
|
616
616
|
...t.created || []
|
|
617
|
-
],
|
|
618
|
-
...(e.deleted || []).filter((
|
|
619
|
-
...(t.deleted || []).filter((
|
|
617
|
+
], u = [
|
|
618
|
+
...(e.deleted || []).filter((c) => !i.has(c.id)),
|
|
619
|
+
...(t.deleted || []).filter((c) => !n.has(c.id))
|
|
620
620
|
], h = [
|
|
621
|
-
...(e.updated || []).filter(({ newValue:
|
|
622
|
-
const { oldValue: m, newValue: d } =
|
|
623
|
-
if (
|
|
621
|
+
...(e.updated || []).filter(({ newValue: c }) => !r.has(c.id)).map((c) => {
|
|
622
|
+
const { oldValue: m, newValue: d } = c;
|
|
623
|
+
if (s.has(d.id)) {
|
|
624
624
|
const g = t.updated.find((_) => _.oldValue.id === d.id).newValue;
|
|
625
625
|
return Wt(m, g);
|
|
626
626
|
} else
|
|
627
|
-
return
|
|
627
|
+
return c;
|
|
628
628
|
}),
|
|
629
|
-
...(t.updated || []).filter(({ oldValue:
|
|
629
|
+
...(t.updated || []).filter(({ oldValue: c }) => !a.has(c.id))
|
|
630
630
|
];
|
|
631
|
-
return { created: l, deleted:
|
|
632
|
-
},
|
|
631
|
+
return { created: l, deleted: u, updated: h };
|
|
632
|
+
}, Gn = (e) => e.id !== void 0, Fn = () => {
|
|
633
633
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (p, E = {}) => n.push({ onChange: p, options: E }), i = (p) => {
|
|
634
634
|
const E = n.findIndex((b) => b.onChange == p);
|
|
635
635
|
E > -1 && n.splice(E, 1);
|
|
636
|
-
},
|
|
636
|
+
}, r = (p, E) => {
|
|
637
637
|
const b = {
|
|
638
638
|
origin: p,
|
|
639
639
|
changes: {
|
|
@@ -643,91 +643,91 @@ const Un = (e, t) => {
|
|
|
643
643
|
},
|
|
644
644
|
state: [...e.values()]
|
|
645
645
|
};
|
|
646
|
-
n.forEach((
|
|
647
|
-
|
|
646
|
+
n.forEach((L) => {
|
|
647
|
+
Nn(L, b) && L.onChange(b);
|
|
648
648
|
});
|
|
649
|
-
},
|
|
649
|
+
}, s = (p, E = V.LOCAL) => {
|
|
650
650
|
if (e.get(p.id))
|
|
651
651
|
throw Error(`Cannot add annotation ${p.id} - exists already`);
|
|
652
|
-
e.set(p.id, p), p.bodies.forEach((b) => t.set(b.id, p.id)),
|
|
652
|
+
e.set(p.id, p), p.bodies.forEach((b) => t.set(b.id, p.id)), r(E, { created: [p] });
|
|
653
653
|
}, a = (p, E) => {
|
|
654
|
-
const b = typeof p == "string" ? E : p,
|
|
654
|
+
const b = typeof p == "string" ? E : p, L = typeof p == "string" ? p : p.id, B = e.get(L);
|
|
655
655
|
if (B) {
|
|
656
|
-
const
|
|
657
|
-
return
|
|
656
|
+
const X = Wt(B, b);
|
|
657
|
+
return L === b.id ? e.set(L, b) : (e.delete(L), e.set(b.id, b)), B.bodies.forEach((Z) => t.delete(Z.id)), b.bodies.forEach((Z) => t.set(Z.id, b.id)), X;
|
|
658
658
|
} else
|
|
659
|
-
console.warn(`Cannot update annotation ${
|
|
659
|
+
console.warn(`Cannot update annotation ${L} - does not exist`);
|
|
660
660
|
}, l = (p, E = V.LOCAL, b = V.LOCAL) => {
|
|
661
|
-
const
|
|
662
|
-
B &&
|
|
663
|
-
},
|
|
664
|
-
const b = p.reduce((
|
|
665
|
-
const
|
|
666
|
-
return
|
|
661
|
+
const L = Gn(E) ? b : E, B = a(p, E);
|
|
662
|
+
B && r(L, { updated: [B] });
|
|
663
|
+
}, u = (p, E = V.LOCAL) => {
|
|
664
|
+
const b = p.reduce((L, B) => {
|
|
665
|
+
const X = a(B);
|
|
666
|
+
return X ? [...L, X] : L;
|
|
667
667
|
}, []);
|
|
668
|
-
b.length > 0 &&
|
|
668
|
+
b.length > 0 && r(E, { updated: b });
|
|
669
669
|
}, h = (p, E = V.LOCAL) => {
|
|
670
670
|
const b = e.get(p.annotation);
|
|
671
671
|
if (b) {
|
|
672
|
-
const
|
|
672
|
+
const L = {
|
|
673
673
|
...b,
|
|
674
674
|
bodies: [...b.bodies, p]
|
|
675
675
|
};
|
|
676
|
-
e.set(b.id,
|
|
676
|
+
e.set(b.id, L), t.set(p.id, L.id), r(E, { updated: [{
|
|
677
677
|
oldValue: b,
|
|
678
|
-
newValue:
|
|
678
|
+
newValue: L,
|
|
679
679
|
bodiesCreated: [p]
|
|
680
680
|
}] });
|
|
681
681
|
} else
|
|
682
682
|
console.warn(`Attempt to add body to missing annotation: ${p.annotation}`);
|
|
683
|
-
},
|
|
683
|
+
}, c = () => [...e.values()], m = (p = V.LOCAL) => {
|
|
684
684
|
const E = [...e.values()];
|
|
685
|
-
e.clear(), t.clear(),
|
|
685
|
+
e.clear(), t.clear(), r(p, { deleted: E });
|
|
686
686
|
}, d = (p, E = !0, b = V.LOCAL) => {
|
|
687
687
|
if (E) {
|
|
688
|
-
const
|
|
688
|
+
const L = [...e.values()];
|
|
689
689
|
e.clear(), t.clear(), p.forEach((B) => {
|
|
690
|
-
e.set(B.id, B), B.bodies.forEach((
|
|
691
|
-
}),
|
|
690
|
+
e.set(B.id, B), B.bodies.forEach((X) => t.set(X.id, B.id));
|
|
691
|
+
}), r(b, { created: p, deleted: L });
|
|
692
692
|
} else {
|
|
693
|
-
const
|
|
694
|
-
const Z = e.get(
|
|
693
|
+
const L = p.reduce((B, X) => {
|
|
694
|
+
const Z = e.get(X.id);
|
|
695
695
|
return Z ? [...B, Z] : B;
|
|
696
696
|
}, []);
|
|
697
|
-
if (
|
|
698
|
-
throw Error(`Bulk insert would overwrite the following annotations: ${
|
|
697
|
+
if (L.length > 0)
|
|
698
|
+
throw Error(`Bulk insert would overwrite the following annotations: ${L.map((B) => B.id).join(", ")}`);
|
|
699
699
|
p.forEach((B) => {
|
|
700
|
-
e.set(B.id, B), B.bodies.forEach((
|
|
701
|
-
}),
|
|
700
|
+
e.set(B.id, B), B.bodies.forEach((X) => t.set(X.id, B.id));
|
|
701
|
+
}), r(b, { created: p });
|
|
702
702
|
}
|
|
703
703
|
}, g = (p) => {
|
|
704
704
|
const E = typeof p == "string" ? p : p.id, b = e.get(E);
|
|
705
705
|
if (b)
|
|
706
|
-
return e.delete(E), b.bodies.forEach((
|
|
706
|
+
return e.delete(E), b.bodies.forEach((L) => t.delete(L.id)), b;
|
|
707
707
|
console.warn(`Attempt to delete missing annotation: ${E}`);
|
|
708
708
|
}, _ = (p, E = V.LOCAL) => {
|
|
709
709
|
const b = g(p);
|
|
710
|
-
b &&
|
|
710
|
+
b && r(E, { deleted: [b] });
|
|
711
711
|
}, A = (p, E = V.LOCAL) => {
|
|
712
|
-
const b = p.reduce((
|
|
713
|
-
const
|
|
714
|
-
return
|
|
712
|
+
const b = p.reduce((L, B) => {
|
|
713
|
+
const X = g(B);
|
|
714
|
+
return X ? [...L, X] : L;
|
|
715
715
|
}, []);
|
|
716
|
-
b.length > 0 &&
|
|
716
|
+
b.length > 0 && r(E, { deleted: b });
|
|
717
717
|
}, w = (p, E = V.LOCAL) => {
|
|
718
718
|
const b = e.get(p.annotation);
|
|
719
719
|
if (b) {
|
|
720
|
-
const
|
|
721
|
-
if (
|
|
722
|
-
t.delete(
|
|
720
|
+
const L = b.bodies.find((B) => B.id === p.id);
|
|
721
|
+
if (L) {
|
|
722
|
+
t.delete(L.id);
|
|
723
723
|
const B = {
|
|
724
724
|
...b,
|
|
725
|
-
bodies: b.bodies.filter((
|
|
725
|
+
bodies: b.bodies.filter((X) => X.id !== p.id)
|
|
726
726
|
};
|
|
727
|
-
e.set(b.id, B),
|
|
727
|
+
e.set(b.id, B), r(E, { updated: [{
|
|
728
728
|
oldValue: b,
|
|
729
729
|
newValue: B,
|
|
730
|
-
bodiesDeleted: [
|
|
730
|
+
bodiesDeleted: [L]
|
|
731
731
|
}] });
|
|
732
732
|
} else
|
|
733
733
|
console.warn(`Attempt to delete missing body ${p.id} from annotation ${p.annotation}`);
|
|
@@ -739,7 +739,7 @@ const Un = (e, t) => {
|
|
|
739
739
|
}, T = (p) => {
|
|
740
740
|
const E = t.get(p);
|
|
741
741
|
if (E) {
|
|
742
|
-
const b = y(E).bodies.find((
|
|
742
|
+
const b = y(E).bodies.find((L) => L.id === p);
|
|
743
743
|
if (b)
|
|
744
744
|
return b;
|
|
745
745
|
console.error(`Store integrity error: body ${p} in index, but not in annotation`);
|
|
@@ -750,23 +750,23 @@ const Un = (e, t) => {
|
|
|
750
750
|
throw "Annotation integrity violation: annotation ID must be the same when updating bodies";
|
|
751
751
|
const b = e.get(p.annotation);
|
|
752
752
|
if (b) {
|
|
753
|
-
const
|
|
753
|
+
const L = b.bodies.find((X) => X.id === p.id), B = {
|
|
754
754
|
...b,
|
|
755
|
-
bodies: b.bodies.map((
|
|
755
|
+
bodies: b.bodies.map((X) => X.id === L.id ? E : X)
|
|
756
756
|
};
|
|
757
|
-
return e.set(b.id, B),
|
|
757
|
+
return e.set(b.id, B), L.id !== E.id && (t.delete(L.id), t.set(E.id, B.id)), {
|
|
758
758
|
oldValue: b,
|
|
759
759
|
newValue: B,
|
|
760
|
-
bodiesUpdated: [{ oldBody:
|
|
760
|
+
bodiesUpdated: [{ oldBody: L, newBody: E }]
|
|
761
761
|
};
|
|
762
762
|
} else
|
|
763
763
|
console.warn(`Attempt to add body to missing annotation ${p.annotation}`);
|
|
764
764
|
}, P = (p, E, b = V.LOCAL) => {
|
|
765
|
-
const
|
|
766
|
-
|
|
767
|
-
},
|
|
768
|
-
const b = p.map((
|
|
769
|
-
|
|
765
|
+
const L = S(p, E);
|
|
766
|
+
r(b, { updated: [L] });
|
|
767
|
+
}, D = (p, E = V.LOCAL) => {
|
|
768
|
+
const b = p.map((L) => S({ id: L.id, annotation: L.annotation }, L));
|
|
769
|
+
r(E, { updated: b });
|
|
770
770
|
}, U = (p) => {
|
|
771
771
|
const E = e.get(p.annotation);
|
|
772
772
|
if (E) {
|
|
@@ -789,16 +789,16 @@ const Un = (e, t) => {
|
|
|
789
789
|
console.warn(`Attempt to update target on missing annotation: ${p.annotation}`);
|
|
790
790
|
};
|
|
791
791
|
return {
|
|
792
|
-
addAnnotation:
|
|
792
|
+
addAnnotation: s,
|
|
793
793
|
addBody: h,
|
|
794
|
-
all:
|
|
794
|
+
all: c,
|
|
795
795
|
bulkAddAnnotation: d,
|
|
796
796
|
bulkDeleteAnnotation: A,
|
|
797
|
-
bulkUpdateAnnotation:
|
|
798
|
-
bulkUpdateBodies:
|
|
797
|
+
bulkUpdateAnnotation: u,
|
|
798
|
+
bulkUpdateBodies: D,
|
|
799
799
|
bulkUpdateTargets: (p, E = V.LOCAL) => {
|
|
800
|
-
const b = p.map(U).filter((
|
|
801
|
-
b.length > 0 &&
|
|
800
|
+
const b = p.map(U).filter((L) => L);
|
|
801
|
+
b.length > 0 && r(E, { updated: b });
|
|
802
802
|
},
|
|
803
803
|
clear: m,
|
|
804
804
|
deleteAnnotation: _,
|
|
@@ -811,17 +811,17 @@ const Un = (e, t) => {
|
|
|
811
811
|
updateBody: P,
|
|
812
812
|
updateTarget: (p, E = V.LOCAL) => {
|
|
813
813
|
const b = U(p);
|
|
814
|
-
b &&
|
|
814
|
+
b && r(E, { updated: [b] });
|
|
815
815
|
}
|
|
816
816
|
};
|
|
817
|
-
},
|
|
817
|
+
}, Hn = (e) => ({
|
|
818
818
|
...e,
|
|
819
819
|
subscribe: (t) => {
|
|
820
820
|
const n = (o) => t(o.state);
|
|
821
821
|
return e.observe(n), t(e.all()), () => e.unobserve(n);
|
|
822
822
|
}
|
|
823
823
|
});
|
|
824
|
-
let
|
|
824
|
+
let zn = () => ({
|
|
825
825
|
emit(e, ...t) {
|
|
826
826
|
let n = this.events[e] || [];
|
|
827
827
|
for (let o = 0, i = n.length; o < i; o++)
|
|
@@ -836,28 +836,28 @@ let Hn = () => ({
|
|
|
836
836
|
};
|
|
837
837
|
}
|
|
838
838
|
});
|
|
839
|
-
const
|
|
840
|
-
const t =
|
|
841
|
-
let o = -1, i = !1,
|
|
842
|
-
const
|
|
839
|
+
const jn = 250, qn = (e) => {
|
|
840
|
+
const t = zn(), n = [];
|
|
841
|
+
let o = -1, i = !1, r = 0;
|
|
842
|
+
const s = (d) => {
|
|
843
843
|
if (!i) {
|
|
844
844
|
const { changes: g } = d, _ = performance.now();
|
|
845
|
-
if (_ -
|
|
845
|
+
if (_ - r > jn)
|
|
846
846
|
n.splice(o + 1), n.push(g), o = n.length - 1;
|
|
847
847
|
else {
|
|
848
848
|
const A = n.length - 1;
|
|
849
|
-
n[A] =
|
|
849
|
+
n[A] = Vn(n[A], g);
|
|
850
850
|
}
|
|
851
|
-
|
|
851
|
+
r = _;
|
|
852
852
|
}
|
|
853
853
|
i = !1;
|
|
854
854
|
};
|
|
855
|
-
e.observe(
|
|
856
|
-
const a = (d) => (d == null ? void 0 : d.length) > 0 && e.bulkDeleteAnnotation(d), l = (d) => (d == null ? void 0 : d.length) > 0 && e.bulkAddAnnotation(d, !1),
|
|
855
|
+
e.observe(s, { origin: V.LOCAL });
|
|
856
|
+
const a = (d) => (d == null ? void 0 : d.length) > 0 && e.bulkDeleteAnnotation(d), l = (d) => (d == null ? void 0 : d.length) > 0 && e.bulkAddAnnotation(d, !1), u = (d) => (d == null ? void 0 : d.length) > 0 && e.bulkUpdateAnnotation(d.map(({ oldValue: g }) => g)), h = (d) => (d == null ? void 0 : d.length) > 0 && e.bulkUpdateAnnotation(d.map(({ newValue: g }) => g)), c = (d) => (d == null ? void 0 : d.length) > 0 && e.bulkAddAnnotation(d, !1), m = (d) => (d == null ? void 0 : d.length) > 0 && e.bulkDeleteAnnotation(d);
|
|
857
857
|
return {
|
|
858
858
|
canRedo: () => n.length - 1 > o,
|
|
859
859
|
canUndo: () => o > -1,
|
|
860
|
-
destroy: () => e.unobserve(
|
|
860
|
+
destroy: () => e.unobserve(s),
|
|
861
861
|
on: (d, g) => t.on(d, g),
|
|
862
862
|
redo: () => {
|
|
863
863
|
if (n.length - 1 > o) {
|
|
@@ -870,19 +870,19 @@ const zn = 250, jn = (e) => {
|
|
|
870
870
|
if (o > -1) {
|
|
871
871
|
i = !0;
|
|
872
872
|
const { created: d, updated: g, deleted: _ } = n[o];
|
|
873
|
-
a(d),
|
|
873
|
+
a(d), u(g), c(_), t.emit("undo", n[o]), o -= 1;
|
|
874
874
|
}
|
|
875
875
|
}
|
|
876
876
|
};
|
|
877
|
-
},
|
|
877
|
+
}, Kn = () => {
|
|
878
878
|
const { subscribe: e, set: t } = at([]);
|
|
879
879
|
return {
|
|
880
880
|
subscribe: e,
|
|
881
881
|
set: t
|
|
882
882
|
};
|
|
883
|
-
},
|
|
884
|
-
const { store: i, selection:
|
|
885
|
-
let
|
|
883
|
+
}, Wn = (e, t, n, o) => {
|
|
884
|
+
const { store: i, selection: r, hover: s, viewport: a } = e, l = /* @__PURE__ */ new Map();
|
|
885
|
+
let u = [], h, c;
|
|
886
886
|
const m = (w, y) => {
|
|
887
887
|
l.has(w) ? l.get(w).push(y) : l.set(w, [y]);
|
|
888
888
|
}, d = (w, y) => {
|
|
@@ -892,90 +892,90 @@ const zn = 250, jn = (e) => {
|
|
|
892
892
|
l.has(w) && setTimeout(() => {
|
|
893
893
|
l.get(w).forEach((S) => {
|
|
894
894
|
if (n) {
|
|
895
|
-
const P = Array.isArray(y) ? y.map((U) => n.serialize(U)) : n.serialize(y),
|
|
896
|
-
S(P,
|
|
895
|
+
const P = Array.isArray(y) ? y.map((U) => n.serialize(U)) : n.serialize(y), D = T ? T instanceof PointerEvent ? T : n.serialize(T) : void 0;
|
|
896
|
+
S(P, D);
|
|
897
897
|
} else
|
|
898
898
|
S(y, T);
|
|
899
899
|
});
|
|
900
900
|
}, 1);
|
|
901
901
|
}, _ = () => {
|
|
902
|
-
const { selected: w } =
|
|
902
|
+
const { selected: w } = r, y = w.map(({ id: T }) => i.getAnnotation(T));
|
|
903
903
|
y.forEach((T) => {
|
|
904
|
-
const S =
|
|
904
|
+
const S = u.find((P) => P.id === T.id);
|
|
905
905
|
(!S || !de(S, T)) && g("updateAnnotation", T, S);
|
|
906
|
-
}),
|
|
907
|
-
};
|
|
908
|
-
|
|
909
|
-
if (!(
|
|
910
|
-
if (
|
|
911
|
-
|
|
912
|
-
else if (
|
|
913
|
-
|
|
906
|
+
}), u = u.map((T) => y.find(({ id: P }) => P === T.id) || T);
|
|
907
|
+
};
|
|
908
|
+
r.subscribe(({ selected: w }) => {
|
|
909
|
+
if (!(u.length === 0 && w.length === 0)) {
|
|
910
|
+
if (u.length === 0 && w.length > 0)
|
|
911
|
+
u = w.map(({ id: y }) => i.getAnnotation(y));
|
|
912
|
+
else if (u.length > 0 && w.length === 0)
|
|
913
|
+
u.forEach((y) => {
|
|
914
914
|
const T = i.getAnnotation(y.id);
|
|
915
915
|
T && !de(T, y) && g("updateAnnotation", T, y);
|
|
916
|
-
}),
|
|
916
|
+
}), u = [];
|
|
917
917
|
else {
|
|
918
|
-
const y = new Set(
|
|
919
|
-
|
|
918
|
+
const y = new Set(u.map((S) => S.id)), T = new Set(w.map(({ id: S }) => S));
|
|
919
|
+
u.filter((S) => !T.has(S.id)).forEach((S) => {
|
|
920
920
|
const P = i.getAnnotation(S.id);
|
|
921
921
|
P && !de(P, S) && g("updateAnnotation", P, S);
|
|
922
|
-
}),
|
|
922
|
+
}), u = [
|
|
923
923
|
// Remove annotations that were deselected
|
|
924
|
-
...
|
|
924
|
+
...u.filter((S) => T.has(S.id)),
|
|
925
925
|
// Add editable annotations that were selected
|
|
926
926
|
...w.filter(({ id: S }) => !y.has(S)).map(({ id: S }) => i.getAnnotation(S))
|
|
927
927
|
];
|
|
928
928
|
}
|
|
929
|
-
g("selectionChanged",
|
|
929
|
+
g("selectionChanged", u);
|
|
930
930
|
}
|
|
931
|
-
}),
|
|
931
|
+
}), s.subscribe((w) => {
|
|
932
932
|
!h && w ? g("mouseEnterAnnotation", i.getAnnotation(w)) : h && !w ? g("mouseLeaveAnnotation", i.getAnnotation(h)) : h && w && (g("mouseLeaveAnnotation", i.getAnnotation(h)), g("mouseEnterAnnotation", i.getAnnotation(w))), h = w;
|
|
933
933
|
}), a == null || a.subscribe((w) => g("viewportIntersect", w.map(i.getAnnotation))), i.observe((w) => {
|
|
934
|
-
o && (
|
|
934
|
+
o && (c && clearTimeout(c), c = setTimeout(_, 1e3));
|
|
935
935
|
const { created: y, deleted: T } = w.changes;
|
|
936
936
|
y.forEach((S) => g("createAnnotation", S)), T.forEach((S) => g("deleteAnnotation", S)), w.changes.updated.filter((S) => [
|
|
937
937
|
...S.bodiesCreated || [],
|
|
938
938
|
...S.bodiesDeleted || [],
|
|
939
939
|
...S.bodiesUpdated || []
|
|
940
940
|
].length > 0).forEach(({ oldValue: S, newValue: P }) => {
|
|
941
|
-
const
|
|
942
|
-
|
|
941
|
+
const D = u.find((U) => U.id === S.id) || S;
|
|
942
|
+
u = u.map((U) => U.id === S.id ? P : U), g("updateAnnotation", P, D);
|
|
943
943
|
});
|
|
944
944
|
}, { origin: V.LOCAL }), i.observe((w) => {
|
|
945
|
-
if (
|
|
946
|
-
const y = new Set(
|
|
947
|
-
T.length > 0 && (
|
|
945
|
+
if (u) {
|
|
946
|
+
const y = new Set(u.map((S) => S.id)), T = w.changes.updated.filter(({ newValue: S }) => y.has(S.id)).map(({ newValue: S }) => S);
|
|
947
|
+
T.length > 0 && (u = u.map((S) => T.find((D) => D.id === S.id) || S));
|
|
948
948
|
}
|
|
949
949
|
}, { origin: V.REMOTE });
|
|
950
950
|
const A = (w) => (y) => {
|
|
951
951
|
const { created: T, deleted: S, updated: P } = y;
|
|
952
|
-
T.forEach((
|
|
952
|
+
T.forEach((D) => g("createAnnotation", D)), S.forEach((D) => g("deleteAnnotation", D)), w ? P.forEach((D) => g("updateAnnotation", D.oldValue, D.newValue)) : P.forEach((D) => g("updateAnnotation", D.newValue, D.oldValue));
|
|
953
953
|
};
|
|
954
954
|
return t.on("undo", A(!0)), t.on("redo", A(!1)), { on: m, off: d, emit: g };
|
|
955
|
-
},
|
|
956
|
-
const { parsed: i, error:
|
|
957
|
-
return
|
|
955
|
+
}, Jn = (e) => (t) => t.reduce((n, o) => {
|
|
956
|
+
const { parsed: i, error: r } = e.parse(o);
|
|
957
|
+
return r ? {
|
|
958
958
|
parsed: n.parsed,
|
|
959
959
|
failed: [...n.failed, o]
|
|
960
960
|
} : {
|
|
961
961
|
parsed: [...n.parsed, i],
|
|
962
962
|
failed: n.failed
|
|
963
963
|
};
|
|
964
|
-
}, { parsed: [], failed: [] }),
|
|
965
|
-
const { store: o, selection: i } = e,
|
|
964
|
+
}, { parsed: [], failed: [] }), Zn = (e, t, n) => {
|
|
965
|
+
const { store: o, selection: i } = e, r = (A) => {
|
|
966
966
|
if (n) {
|
|
967
967
|
const { parsed: w, error: y } = n.parse(A);
|
|
968
968
|
w ? o.addAnnotation(w, V.REMOTE) : console.error(y);
|
|
969
969
|
} else
|
|
970
970
|
o.addAnnotation(A, V.REMOTE);
|
|
971
|
-
},
|
|
971
|
+
}, s = () => i.clear(), a = () => o.clear(), l = (A) => {
|
|
972
972
|
const w = o.getAnnotation(A);
|
|
973
973
|
return n && w ? n.serialize(w) : w;
|
|
974
|
-
},
|
|
974
|
+
}, u = () => n ? o.all().map(n.serialize) : o.all(), h = () => {
|
|
975
975
|
var A;
|
|
976
976
|
const w = (((A = i.selected) == null ? void 0 : A.map((y) => y.id)) || []).map((y) => o.getAnnotation(y));
|
|
977
977
|
return n ? w.map(n.serialize) : w;
|
|
978
|
-
},
|
|
978
|
+
}, c = (A) => fetch(A).then((w) => w.json()).then((w) => (d(w), w)), m = (A) => {
|
|
979
979
|
if (typeof A == "string") {
|
|
980
980
|
const w = o.getAnnotation(A);
|
|
981
981
|
return o.deleteAnnotation(A), n ? n.serialize(w) : w;
|
|
@@ -985,7 +985,7 @@ const zn = 250, jn = (e) => {
|
|
|
985
985
|
}
|
|
986
986
|
}, d = (A) => {
|
|
987
987
|
if (n) {
|
|
988
|
-
const { parsed: w, failed: y } =
|
|
988
|
+
const { parsed: w, failed: y } = Jn(n)(A);
|
|
989
989
|
y.length > 0 && console.warn(`Discarded ${y.length} invalid annotations`, y), o.bulkAddAnnotation(w, !0, V.REMOTE);
|
|
990
990
|
} else
|
|
991
991
|
o.bulkAddAnnotation(A, !0, V.REMOTE);
|
|
@@ -1001,15 +1001,15 @@ const zn = 250, jn = (e) => {
|
|
|
1001
1001
|
}
|
|
1002
1002
|
};
|
|
1003
1003
|
return {
|
|
1004
|
-
addAnnotation:
|
|
1005
|
-
cancelSelected:
|
|
1004
|
+
addAnnotation: r,
|
|
1005
|
+
cancelSelected: s,
|
|
1006
1006
|
canRedo: t.canRedo,
|
|
1007
1007
|
canUndo: t.canUndo,
|
|
1008
1008
|
clearAnnotations: a,
|
|
1009
1009
|
getAnnotationById: l,
|
|
1010
|
-
getAnnotations:
|
|
1010
|
+
getAnnotations: u,
|
|
1011
1011
|
getSelected: h,
|
|
1012
|
-
loadAnnotations:
|
|
1012
|
+
loadAnnotations: c,
|
|
1013
1013
|
redo: t.redo,
|
|
1014
1014
|
removeAnnotation: m,
|
|
1015
1015
|
setAnnotations: d,
|
|
@@ -1018,71 +1018,90 @@ const zn = 250, jn = (e) => {
|
|
|
1018
1018
|
updateAnnotation: _
|
|
1019
1019
|
};
|
|
1020
1020
|
};
|
|
1021
|
-
let
|
|
1021
|
+
let Qn = (e) => crypto.getRandomValues(new Uint8Array(e)), xn = (e, t, n) => {
|
|
1022
1022
|
let o = (2 << Math.log(e.length - 1) / Math.LN2) - 1, i = -~(1.6 * o * t / e.length);
|
|
1023
|
-
return (
|
|
1024
|
-
let
|
|
1023
|
+
return (r = t) => {
|
|
1024
|
+
let s = "";
|
|
1025
1025
|
for (; ; ) {
|
|
1026
1026
|
let a = n(i), l = i;
|
|
1027
1027
|
for (; l--; )
|
|
1028
|
-
if (
|
|
1029
|
-
return
|
|
1028
|
+
if (s += e[a[l] & o] || "", s.length === r)
|
|
1029
|
+
return s;
|
|
1030
1030
|
}
|
|
1031
1031
|
};
|
|
1032
|
-
},
|
|
1033
|
-
const
|
|
1032
|
+
}, $n = (e, t = 21) => xn(e, t, Qn), eo = (e = 21) => crypto.getRandomValues(new Uint8Array(e)).reduce((t, n) => (n &= 63, n < 36 ? t += n.toString(36) : n < 62 ? t += (n - 26).toString(36).toUpperCase() : n > 62 ? t += "-" : t += "_", t), "");
|
|
1033
|
+
const to = () => ({ isGuest: !0, id: $n("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_", 20)() }), no = (e) => {
|
|
1034
1034
|
const t = JSON.stringify(e);
|
|
1035
1035
|
let n = 0;
|
|
1036
1036
|
for (let o = 0, i = t.length; o < i; o++) {
|
|
1037
|
-
let
|
|
1038
|
-
n = (n << 5) - n +
|
|
1037
|
+
let r = t.charCodeAt(o);
|
|
1038
|
+
n = (n << 5) - n + r, n |= 0;
|
|
1039
1039
|
}
|
|
1040
1040
|
return `${n}`;
|
|
1041
|
-
},
|
|
1042
|
-
const { id: o, type: i, purpose:
|
|
1041
|
+
}, Jt = (e) => e ? typeof e == "object" ? { ...e } : e : void 0, oo = (e, t) => (Array.isArray(e) ? e : [e]).map((n) => {
|
|
1042
|
+
const { id: o, type: i, purpose: r, value: s, created: a, creator: l, ...u } = n;
|
|
1043
1043
|
return {
|
|
1044
|
-
id: o || `temp-${
|
|
1044
|
+
id: o || `temp-${no(n)}`,
|
|
1045
1045
|
annotation: t,
|
|
1046
1046
|
type: i,
|
|
1047
|
-
purpose:
|
|
1048
|
-
value:
|
|
1049
|
-
created: a,
|
|
1050
|
-
creator: l
|
|
1051
|
-
...
|
|
1047
|
+
purpose: r,
|
|
1048
|
+
value: s,
|
|
1049
|
+
created: a ? new Date(a) : void 0,
|
|
1050
|
+
creator: Jt(l),
|
|
1051
|
+
...u
|
|
1052
1052
|
};
|
|
1053
|
-
}),
|
|
1053
|
+
}), io = (e) => e.map((t) => {
|
|
1054
1054
|
var n;
|
|
1055
1055
|
const o = { ...t };
|
|
1056
1056
|
return delete o.annotation, (n = o.id) != null && n.startsWith("temp-") && delete o.id, o;
|
|
1057
1057
|
});
|
|
1058
|
-
|
|
1059
|
-
const
|
|
1060
|
-
const n = e.id || qt(), {
|
|
1061
|
-
|
|
1058
|
+
eo();
|
|
1059
|
+
const wi = (e, t = !1) => ({ parse: (i) => ro(i, t), serialize: (i) => so(i, e) }), ro = (e, t = !1) => {
|
|
1060
|
+
const n = e.id || qt(), {
|
|
1061
|
+
creator: o,
|
|
1062
|
+
created: i,
|
|
1063
|
+
updatedBy: r,
|
|
1064
|
+
updated: s,
|
|
1065
|
+
body: a,
|
|
1066
|
+
...l
|
|
1067
|
+
} = e, u = oo(a, n), h = Array.isArray(e.target) ? e.target[0] : e.target, c = Array.isArray(h.selector) ? h.selector[0] : h.selector, m = c.type === "FragmentSelector" ? _n(c, t) : c.type === "SvgSelector" ? Sn(c) : void 0;
|
|
1068
|
+
return m ? {
|
|
1062
1069
|
parsed: {
|
|
1063
|
-
...
|
|
1070
|
+
...l,
|
|
1064
1071
|
id: n,
|
|
1065
|
-
bodies:
|
|
1072
|
+
bodies: u,
|
|
1066
1073
|
target: {
|
|
1067
|
-
|
|
1074
|
+
created: i ? new Date(i) : void 0,
|
|
1075
|
+
creator: Jt(o),
|
|
1076
|
+
...l.target,
|
|
1068
1077
|
annotation: n,
|
|
1069
|
-
selector:
|
|
1078
|
+
selector: m
|
|
1070
1079
|
}
|
|
1071
1080
|
}
|
|
1072
1081
|
} : {
|
|
1073
|
-
error: Error(`Unknown selector type: ${
|
|
1082
|
+
error: Error(`Unknown selector type: ${c.type}`)
|
|
1074
1083
|
};
|
|
1075
1084
|
}, so = (e, t) => {
|
|
1076
|
-
const
|
|
1085
|
+
const {
|
|
1086
|
+
selector: n,
|
|
1087
|
+
creator: o,
|
|
1088
|
+
created: i,
|
|
1089
|
+
updated: r,
|
|
1090
|
+
updatedBy: s,
|
|
1091
|
+
...a
|
|
1092
|
+
} = e.target, l = n.type == z.RECTANGLE ? wn(n.geometry) : Mn(n);
|
|
1077
1093
|
return {
|
|
1078
1094
|
...e,
|
|
1079
1095
|
"@context": "http://www.w3.org/ns/anno.jsonld",
|
|
1080
1096
|
id: e.id,
|
|
1081
1097
|
type: "Annotation",
|
|
1082
|
-
body:
|
|
1098
|
+
body: io(e.bodies),
|
|
1099
|
+
creator: o,
|
|
1100
|
+
created: i == null ? void 0 : i.toISOString(),
|
|
1083
1101
|
target: {
|
|
1102
|
+
...a,
|
|
1084
1103
|
source: t,
|
|
1085
|
-
selector:
|
|
1104
|
+
selector: l
|
|
1086
1105
|
}
|
|
1087
1106
|
};
|
|
1088
1107
|
};
|
|
@@ -1091,7 +1110,7 @@ function _t(e, t, n) {
|
|
|
1091
1110
|
return o[11] = t[n], o[13] = n, o;
|
|
1092
1111
|
}
|
|
1093
1112
|
function wt(e) {
|
|
1094
|
-
let t, n, o, i,
|
|
1113
|
+
let t, n, o, i, r;
|
|
1095
1114
|
return {
|
|
1096
1115
|
c() {
|
|
1097
1116
|
t = R("rect"), f(t, "class", "a9s-corner-handle"), f(t, "x", n = /*point*/
|
|
@@ -1110,22 +1129,22 @@ function wt(e) {
|
|
|
1110
1129
|
e[3]
|
|
1111
1130
|
);
|
|
1112
1131
|
},
|
|
1113
|
-
m(
|
|
1114
|
-
I(
|
|
1132
|
+
m(s, a) {
|
|
1133
|
+
I(s, t, a), i || (r = K(t, "pointerdown", function() {
|
|
1115
1134
|
j(
|
|
1116
1135
|
/*grab*/
|
|
1117
|
-
e[10](
|
|
1136
|
+
e[10](O(
|
|
1118
1137
|
/*idx*/
|
|
1119
1138
|
e[13]
|
|
1120
1139
|
))
|
|
1121
|
-
) && e[10](
|
|
1140
|
+
) && e[10](O(
|
|
1122
1141
|
/*idx*/
|
|
1123
1142
|
e[13]
|
|
1124
1143
|
)).apply(this, arguments);
|
|
1125
1144
|
}), i = !0);
|
|
1126
1145
|
},
|
|
1127
|
-
p(
|
|
1128
|
-
e =
|
|
1146
|
+
p(s, a) {
|
|
1147
|
+
e = s, a & /*geom, handleSize*/
|
|
1129
1148
|
24 && n !== (n = /*point*/
|
|
1130
1149
|
e[11][0] - /*handleSize*/
|
|
1131
1150
|
e[3] / 2) && f(t, "x", n), a & /*geom, handleSize*/
|
|
@@ -1145,51 +1164,51 @@ function wt(e) {
|
|
|
1145
1164
|
e[3]
|
|
1146
1165
|
);
|
|
1147
1166
|
},
|
|
1148
|
-
d(
|
|
1149
|
-
|
|
1167
|
+
d(s) {
|
|
1168
|
+
s && k(t), i = !1, r();
|
|
1150
1169
|
}
|
|
1151
1170
|
};
|
|
1152
1171
|
}
|
|
1153
|
-
function
|
|
1154
|
-
let t, n, o, i,
|
|
1172
|
+
function lo(e) {
|
|
1173
|
+
let t, n, o, i, r, s, a, l, u, h, c = (
|
|
1155
1174
|
/*geom*/
|
|
1156
1175
|
e[4].points
|
|
1157
1176
|
), m = [];
|
|
1158
|
-
for (let d = 0; d <
|
|
1159
|
-
m[d] = wt(_t(e,
|
|
1177
|
+
for (let d = 0; d < c.length; d += 1)
|
|
1178
|
+
m[d] = wt(_t(e, c, d));
|
|
1160
1179
|
return {
|
|
1161
1180
|
c() {
|
|
1162
|
-
t = R("polygon"), i = $(),
|
|
1181
|
+
t = R("polygon"), i = $(), r = R("polygon"), a = $();
|
|
1163
1182
|
for (let d = 0; d < m.length; d += 1)
|
|
1164
1183
|
m[d].c();
|
|
1165
|
-
l =
|
|
1184
|
+
l = re(), f(t, "class", "a9s-outer"), f(t, "style", n = /*computedStyle*/
|
|
1166
1185
|
e[1] ? "display:none;" : void 0), f(t, "points", o = /*geom*/
|
|
1167
|
-
e[4].points.map(bt).join(" ")), f(
|
|
1168
|
-
|
|
1186
|
+
e[4].points.map(bt).join(" ")), f(r, "class", "a9s-inner a9s-shape-handle"), f(
|
|
1187
|
+
r,
|
|
1169
1188
|
"style",
|
|
1170
1189
|
/*computedStyle*/
|
|
1171
1190
|
e[1]
|
|
1172
|
-
), f(
|
|
1191
|
+
), f(r, "points", s = /*geom*/
|
|
1173
1192
|
e[4].points.map(Et).join(" "));
|
|
1174
1193
|
},
|
|
1175
1194
|
m(d, g) {
|
|
1176
|
-
I(d, t, g), I(d, i, g), I(d,
|
|
1195
|
+
I(d, t, g), I(d, i, g), I(d, r, g), I(d, a, g);
|
|
1177
1196
|
for (let _ = 0; _ < m.length; _ += 1)
|
|
1178
1197
|
m[_] && m[_].m(d, g);
|
|
1179
|
-
I(d, l, g),
|
|
1198
|
+
I(d, l, g), u || (h = [
|
|
1180
1199
|
K(t, "pointerdown", function() {
|
|
1181
1200
|
j(
|
|
1182
1201
|
/*grab*/
|
|
1183
|
-
e[10](
|
|
1184
|
-
) && e[10](
|
|
1202
|
+
e[10](O.SHAPE)
|
|
1203
|
+
) && e[10](O.SHAPE).apply(this, arguments);
|
|
1185
1204
|
}),
|
|
1186
|
-
K(
|
|
1205
|
+
K(r, "pointerdown", function() {
|
|
1187
1206
|
j(
|
|
1188
1207
|
/*grab*/
|
|
1189
|
-
e[10](
|
|
1190
|
-
) && e[10](
|
|
1208
|
+
e[10](O.SHAPE)
|
|
1209
|
+
) && e[10](O.SHAPE).apply(this, arguments);
|
|
1191
1210
|
})
|
|
1192
|
-
],
|
|
1211
|
+
], u = !0);
|
|
1193
1212
|
},
|
|
1194
1213
|
p(d, g) {
|
|
1195
1214
|
if (e = d, g & /*computedStyle*/
|
|
@@ -1198,34 +1217,34 @@ function ro(e) {
|
|
|
1198
1217
|
16 && o !== (o = /*geom*/
|
|
1199
1218
|
e[4].points.map(bt).join(" ")) && f(t, "points", o), g & /*computedStyle*/
|
|
1200
1219
|
2 && f(
|
|
1201
|
-
|
|
1220
|
+
r,
|
|
1202
1221
|
"style",
|
|
1203
1222
|
/*computedStyle*/
|
|
1204
1223
|
e[1]
|
|
1205
1224
|
), g & /*geom*/
|
|
1206
|
-
16 &&
|
|
1207
|
-
e[4].points.map(Et).join(" ")) && f(
|
|
1225
|
+
16 && s !== (s = /*geom*/
|
|
1226
|
+
e[4].points.map(Et).join(" ")) && f(r, "points", s), g & /*geom, handleSize, grab, Handle*/
|
|
1208
1227
|
1048) {
|
|
1209
|
-
|
|
1228
|
+
c = /*geom*/
|
|
1210
1229
|
e[4].points;
|
|
1211
1230
|
let _;
|
|
1212
|
-
for (_ = 0; _ <
|
|
1213
|
-
const A = _t(e,
|
|
1231
|
+
for (_ = 0; _ < c.length; _ += 1) {
|
|
1232
|
+
const A = _t(e, c, _);
|
|
1214
1233
|
m[_] ? m[_].p(A, g) : (m[_] = wt(A), m[_].c(), m[_].m(l.parentNode, l));
|
|
1215
1234
|
}
|
|
1216
1235
|
for (; _ < m.length; _ += 1)
|
|
1217
1236
|
m[_].d(1);
|
|
1218
|
-
m.length =
|
|
1237
|
+
m.length = c.length;
|
|
1219
1238
|
}
|
|
1220
1239
|
},
|
|
1221
1240
|
d(d) {
|
|
1222
|
-
d && k(t), d && k(i), d && k(
|
|
1241
|
+
d && k(t), d && k(i), d && k(r), d && k(a), rt(m, d), d && k(l), u = !1, ie(h);
|
|
1223
1242
|
}
|
|
1224
1243
|
};
|
|
1225
1244
|
}
|
|
1226
|
-
function
|
|
1245
|
+
function ao(e) {
|
|
1227
1246
|
let t, n;
|
|
1228
|
-
return t = new
|
|
1247
|
+
return t = new Qt({
|
|
1229
1248
|
props: {
|
|
1230
1249
|
shape: (
|
|
1231
1250
|
/*shape*/
|
|
@@ -1241,7 +1260,7 @@ function lo(e) {
|
|
|
1241
1260
|
),
|
|
1242
1261
|
$$slots: {
|
|
1243
1262
|
default: [
|
|
1244
|
-
|
|
1263
|
+
lo,
|
|
1245
1264
|
({ grab: o }) => ({ 10: o }),
|
|
1246
1265
|
({ grab: o }) => o ? 1024 : 0
|
|
1247
1266
|
]
|
|
@@ -1268,13 +1287,13 @@ function lo(e) {
|
|
|
1268
1287
|
le(t, o, i), n = !0;
|
|
1269
1288
|
},
|
|
1270
1289
|
p(o, [i]) {
|
|
1271
|
-
const
|
|
1290
|
+
const r = {};
|
|
1272
1291
|
i & /*shape*/
|
|
1273
|
-
1 && (
|
|
1292
|
+
1 && (r.shape = /*shape*/
|
|
1274
1293
|
o[0]), i & /*transform*/
|
|
1275
|
-
4 && (
|
|
1294
|
+
4 && (r.transform = /*transform*/
|
|
1276
1295
|
o[2]), i & /*$$scope, geom, handleSize, grab, computedStyle*/
|
|
1277
|
-
17434 && (
|
|
1296
|
+
17434 && (r.$$scope = { dirty: i, ctx: o }), t.$set(r);
|
|
1278
1297
|
},
|
|
1279
1298
|
i(o) {
|
|
1280
1299
|
n || (C(t.$$.fragment, o), n = !0);
|
|
@@ -1288,45 +1307,45 @@ function lo(e) {
|
|
|
1288
1307
|
};
|
|
1289
1308
|
}
|
|
1290
1309
|
const bt = (e) => e.join(","), Et = (e) => e.join(",");
|
|
1291
|
-
function
|
|
1292
|
-
let o, i, { shape:
|
|
1293
|
-
const
|
|
1310
|
+
function co(e, t, n) {
|
|
1311
|
+
let o, i, { shape: r } = t, { computedStyle: s = void 0 } = t, { transform: a } = t, { viewportScale: l = 1 } = t;
|
|
1312
|
+
const u = (d, g, _) => {
|
|
1294
1313
|
let A;
|
|
1295
|
-
g ===
|
|
1314
|
+
g === O.SHAPE ? A = d.geometry.points.map(([y, T]) => [y + _[0], T + _[1]]) : A = d.geometry.points.map(([y, T], S) => g === O(S) ? [y + _[0], T + _[1]] : [y, T]);
|
|
1296
1315
|
const w = Fe(A);
|
|
1297
1316
|
return { ...d, geometry: { points: A, bounds: w } };
|
|
1298
1317
|
};
|
|
1299
1318
|
function h(d) {
|
|
1300
1319
|
Ae.call(this, e, d);
|
|
1301
1320
|
}
|
|
1302
|
-
function
|
|
1321
|
+
function c(d) {
|
|
1303
1322
|
Ae.call(this, e, d);
|
|
1304
1323
|
}
|
|
1305
1324
|
function m(d) {
|
|
1306
1325
|
Ae.call(this, e, d);
|
|
1307
1326
|
}
|
|
1308
1327
|
return e.$$set = (d) => {
|
|
1309
|
-
"shape" in d && n(0,
|
|
1328
|
+
"shape" in d && n(0, r = d.shape), "computedStyle" in d && n(1, s = d.computedStyle), "transform" in d && n(2, a = d.transform), "viewportScale" in d && n(6, l = d.viewportScale);
|
|
1310
1329
|
}, e.$$.update = () => {
|
|
1311
1330
|
e.$$.dirty & /*shape*/
|
|
1312
|
-
1 && n(4, o =
|
|
1331
|
+
1 && n(4, o = r.geometry), e.$$.dirty & /*viewportScale*/
|
|
1313
1332
|
64 && n(3, i = 10 / l);
|
|
1314
1333
|
}, [
|
|
1315
|
-
s,
|
|
1316
1334
|
r,
|
|
1335
|
+
s,
|
|
1317
1336
|
a,
|
|
1318
1337
|
i,
|
|
1319
1338
|
o,
|
|
1320
|
-
|
|
1339
|
+
u,
|
|
1321
1340
|
l,
|
|
1322
1341
|
h,
|
|
1323
|
-
|
|
1342
|
+
c,
|
|
1324
1343
|
m
|
|
1325
1344
|
];
|
|
1326
1345
|
}
|
|
1327
|
-
class
|
|
1346
|
+
class uo extends te {
|
|
1328
1347
|
constructor(t) {
|
|
1329
|
-
super(), ee(this, t,
|
|
1348
|
+
super(), ee(this, t, co, ao, J, {
|
|
1330
1349
|
shape: 0,
|
|
1331
1350
|
computedStyle: 1,
|
|
1332
1351
|
transform: 2,
|
|
@@ -1334,23 +1353,23 @@ class co extends te {
|
|
|
1334
1353
|
});
|
|
1335
1354
|
}
|
|
1336
1355
|
}
|
|
1337
|
-
function
|
|
1338
|
-
let t, n, o, i,
|
|
1356
|
+
function fo(e) {
|
|
1357
|
+
let t, n, o, i, r, s, a, l, u, h, c, m, d, g, _, A, w, y, T, S, P, D, U, p, E, b, L, B, X, Z, me, ge, Me, v, W, G, ce, H, ue, Pe, ze, Q, Ye, De, je, x, Xe, Re, qe, ut;
|
|
1339
1358
|
return {
|
|
1340
1359
|
c() {
|
|
1341
|
-
t = R("rect"), a = $(), l = R("rect"), d = $(), g = R("rect"), y = $(), T = R("rect"), U = $(), p = R("rect"), B = $(),
|
|
1360
|
+
t = R("rect"), a = $(), l = R("rect"), d = $(), g = R("rect"), y = $(), T = R("rect"), U = $(), p = R("rect"), B = $(), X = R("rect"), Me = $(), v = R("rect"), ce = $(), H = R("rect"), ze = $(), Q = R("rect"), je = $(), x = R("rect"), f(t, "class", "a9s-outer"), f(t, "style", n = /*computedStyle*/
|
|
1342
1361
|
e[1] ? "display:none;" : void 0), f(t, "x", o = /*geom*/
|
|
1343
1362
|
e[4].x), f(t, "y", i = /*geom*/
|
|
1344
|
-
e[4].y), f(t, "width",
|
|
1345
|
-
e[4].w), f(t, "height",
|
|
1363
|
+
e[4].y), f(t, "width", r = /*geom*/
|
|
1364
|
+
e[4].w), f(t, "height", s = /*geom*/
|
|
1346
1365
|
e[4].h), f(l, "class", "a9s-inner a9s-shape-handle"), f(
|
|
1347
1366
|
l,
|
|
1348
1367
|
"style",
|
|
1349
1368
|
/*computedStyle*/
|
|
1350
1369
|
e[1]
|
|
1351
|
-
), f(l, "x",
|
|
1370
|
+
), f(l, "x", u = /*geom*/
|
|
1352
1371
|
e[4].x), f(l, "y", h = /*geom*/
|
|
1353
|
-
e[4].y), f(l, "width",
|
|
1372
|
+
e[4].y), f(l, "width", c = /*geom*/
|
|
1354
1373
|
e[4].w), f(l, "height", m = /*geom*/
|
|
1355
1374
|
e[4].h), f(g, "class", "a9s-edge-handle a9s-edge-handle-top"), f(g, "x", _ = /*geom*/
|
|
1356
1375
|
e[4].x), f(g, "y", A = /*geom*/
|
|
@@ -1358,25 +1377,25 @@ function uo(e) {
|
|
|
1358
1377
|
e[4].w), f(T, "class", "a9s-edge-handle a9s-edge-handle-right"), f(T, "x", S = /*geom*/
|
|
1359
1378
|
e[4].x + /*geom*/
|
|
1360
1379
|
e[4].w), f(T, "y", P = /*geom*/
|
|
1361
|
-
e[4].y), f(T, "height",
|
|
1380
|
+
e[4].y), f(T, "height", D = /*geom*/
|
|
1362
1381
|
e[4].h), f(T, "width", 1), f(p, "class", "a9s-edge-handle a9s-edge-handle-bottom"), f(p, "x", E = /*geom*/
|
|
1363
1382
|
e[4].x), f(p, "y", b = /*geom*/
|
|
1364
1383
|
e[4].y + /*geom*/
|
|
1365
|
-
e[4].h), f(p, "height", 1), f(p, "width",
|
|
1366
|
-
e[4].w), f(
|
|
1367
|
-
e[4].x), f(
|
|
1368
|
-
e[4].y), f(
|
|
1369
|
-
e[4].h), f(
|
|
1384
|
+
e[4].h), f(p, "height", 1), f(p, "width", L = /*geom*/
|
|
1385
|
+
e[4].w), f(X, "class", "a9s-edge-handle a9s-edge-handle-left"), f(X, "x", Z = /*geom*/
|
|
1386
|
+
e[4].x), f(X, "y", me = /*geom*/
|
|
1387
|
+
e[4].y), f(X, "height", ge = /*geom*/
|
|
1388
|
+
e[4].h), f(X, "width", 1), f(v, "class", "a9s-corner-handle a9s-corner-handle-topleft"), f(v, "x", W = /*geom*/
|
|
1370
1389
|
e[4].x - /*handleSize*/
|
|
1371
|
-
e[3] / 2), f(
|
|
1390
|
+
e[3] / 2), f(v, "y", G = /*geom*/
|
|
1372
1391
|
e[4].y - /*handleSize*/
|
|
1373
1392
|
e[3] / 2), f(
|
|
1374
|
-
|
|
1393
|
+
v,
|
|
1375
1394
|
"height",
|
|
1376
1395
|
/*handleSize*/
|
|
1377
1396
|
e[3]
|
|
1378
1397
|
), f(
|
|
1379
|
-
|
|
1398
|
+
v,
|
|
1380
1399
|
"width",
|
|
1381
1400
|
/*handleSize*/
|
|
1382
1401
|
e[3]
|
|
@@ -1398,7 +1417,7 @@ function uo(e) {
|
|
|
1398
1417
|
), f(Q, "class", "a9s-corner-handle a9s-corner-handle-bottomright"), f(Q, "x", Ye = /*geom*/
|
|
1399
1418
|
e[4].x + /*geom*/
|
|
1400
1419
|
e[4].w - /*handleSize*/
|
|
1401
|
-
e[3] / 2), f(Q, "y",
|
|
1420
|
+
e[3] / 2), f(Q, "y", De = /*geom*/
|
|
1402
1421
|
e[4].y + /*geom*/
|
|
1403
1422
|
e[4].h - /*handleSize*/
|
|
1404
1423
|
e[3] / 2), f(
|
|
@@ -1411,7 +1430,7 @@ function uo(e) {
|
|
|
1411
1430
|
"width",
|
|
1412
1431
|
/*handleSize*/
|
|
1413
1432
|
e[3]
|
|
1414
|
-
), f(x, "class", "a9s-corner-handle a9s-corner-handle-bottomleft"), f(x, "x",
|
|
1433
|
+
), f(x, "class", "a9s-corner-handle a9s-corner-handle-bottomleft"), f(x, "x", Xe = /*geom*/
|
|
1415
1434
|
e[4].x - /*handleSize*/
|
|
1416
1435
|
e[3] / 2), f(x, "y", Re = /*geom*/
|
|
1417
1436
|
e[4].y + /*geom*/
|
|
@@ -1429,66 +1448,66 @@ function uo(e) {
|
|
|
1429
1448
|
);
|
|
1430
1449
|
},
|
|
1431
1450
|
m(Y, M) {
|
|
1432
|
-
I(Y, t, M), I(Y, a, M), I(Y, l, M), I(Y, d, M), I(Y, g, M), I(Y, y, M), I(Y, T, M), I(Y, U, M), I(Y, p, M), I(Y, B, M), I(Y,
|
|
1451
|
+
I(Y, t, M), I(Y, a, M), I(Y, l, M), I(Y, d, M), I(Y, g, M), I(Y, y, M), I(Y, T, M), I(Y, U, M), I(Y, p, M), I(Y, B, M), I(Y, X, M), I(Y, Me, M), I(Y, v, M), I(Y, ce, M), I(Y, H, M), I(Y, ze, M), I(Y, Q, M), I(Y, je, M), I(Y, x, M), qe || (ut = [
|
|
1433
1452
|
K(t, "pointerdown", function() {
|
|
1434
1453
|
j(
|
|
1435
1454
|
/*grab*/
|
|
1436
|
-
e[10](
|
|
1437
|
-
) && e[10](
|
|
1455
|
+
e[10](O.SHAPE)
|
|
1456
|
+
) && e[10](O.SHAPE).apply(this, arguments);
|
|
1438
1457
|
}),
|
|
1439
1458
|
K(l, "pointerdown", function() {
|
|
1440
1459
|
j(
|
|
1441
1460
|
/*grab*/
|
|
1442
|
-
e[10](
|
|
1443
|
-
) && e[10](
|
|
1461
|
+
e[10](O.SHAPE)
|
|
1462
|
+
) && e[10](O.SHAPE).apply(this, arguments);
|
|
1444
1463
|
}),
|
|
1445
1464
|
K(g, "pointerdown", function() {
|
|
1446
1465
|
j(
|
|
1447
1466
|
/*grab*/
|
|
1448
|
-
e[10](
|
|
1449
|
-
) && e[10](
|
|
1467
|
+
e[10](O.TOP)
|
|
1468
|
+
) && e[10](O.TOP).apply(this, arguments);
|
|
1450
1469
|
}),
|
|
1451
1470
|
K(T, "pointerdown", function() {
|
|
1452
1471
|
j(
|
|
1453
1472
|
/*grab*/
|
|
1454
|
-
e[10](
|
|
1455
|
-
) && e[10](
|
|
1473
|
+
e[10](O.RIGHT)
|
|
1474
|
+
) && e[10](O.RIGHT).apply(this, arguments);
|
|
1456
1475
|
}),
|
|
1457
1476
|
K(p, "pointerdown", function() {
|
|
1458
1477
|
j(
|
|
1459
1478
|
/*grab*/
|
|
1460
|
-
e[10](
|
|
1461
|
-
) && e[10](
|
|
1479
|
+
e[10](O.BOTTOM)
|
|
1480
|
+
) && e[10](O.BOTTOM).apply(this, arguments);
|
|
1462
1481
|
}),
|
|
1463
|
-
K(
|
|
1482
|
+
K(X, "pointerdown", function() {
|
|
1464
1483
|
j(
|
|
1465
1484
|
/*grab*/
|
|
1466
|
-
e[10](
|
|
1467
|
-
) && e[10](
|
|
1485
|
+
e[10](O.LEFT)
|
|
1486
|
+
) && e[10](O.LEFT).apply(this, arguments);
|
|
1468
1487
|
}),
|
|
1469
|
-
K(
|
|
1488
|
+
K(v, "pointerdown", function() {
|
|
1470
1489
|
j(
|
|
1471
1490
|
/*grab*/
|
|
1472
|
-
e[10](
|
|
1473
|
-
) && e[10](
|
|
1491
|
+
e[10](O.TOP_LEFT)
|
|
1492
|
+
) && e[10](O.TOP_LEFT).apply(this, arguments);
|
|
1474
1493
|
}),
|
|
1475
1494
|
K(H, "pointerdown", function() {
|
|
1476
1495
|
j(
|
|
1477
1496
|
/*grab*/
|
|
1478
|
-
e[10](
|
|
1479
|
-
) && e[10](
|
|
1497
|
+
e[10](O.TOP_RIGHT)
|
|
1498
|
+
) && e[10](O.TOP_RIGHT).apply(this, arguments);
|
|
1480
1499
|
}),
|
|
1481
1500
|
K(Q, "pointerdown", function() {
|
|
1482
1501
|
j(
|
|
1483
1502
|
/*grab*/
|
|
1484
|
-
e[10](
|
|
1485
|
-
) && e[10](
|
|
1503
|
+
e[10](O.BOTTOM_RIGHT)
|
|
1504
|
+
) && e[10](O.BOTTOM_RIGHT).apply(this, arguments);
|
|
1486
1505
|
}),
|
|
1487
1506
|
K(x, "pointerdown", function() {
|
|
1488
1507
|
j(
|
|
1489
1508
|
/*grab*/
|
|
1490
|
-
e[10](
|
|
1491
|
-
) && e[10](
|
|
1509
|
+
e[10](O.BOTTOM_LEFT)
|
|
1510
|
+
) && e[10](O.BOTTOM_LEFT).apply(this, arguments);
|
|
1492
1511
|
})
|
|
1493
1512
|
], qe = !0);
|
|
1494
1513
|
},
|
|
@@ -1500,22 +1519,22 @@ function uo(e) {
|
|
|
1500
1519
|
e[4].x) && f(t, "x", o), M & /*geom*/
|
|
1501
1520
|
16 && i !== (i = /*geom*/
|
|
1502
1521
|
e[4].y) && f(t, "y", i), M & /*geom*/
|
|
1503
|
-
16 && s !== (s = /*geom*/
|
|
1504
|
-
e[4].w) && f(t, "width", s), M & /*geom*/
|
|
1505
1522
|
16 && r !== (r = /*geom*/
|
|
1506
|
-
e[4].
|
|
1523
|
+
e[4].w) && f(t, "width", r), M & /*geom*/
|
|
1524
|
+
16 && s !== (s = /*geom*/
|
|
1525
|
+
e[4].h) && f(t, "height", s), M & /*computedStyle*/
|
|
1507
1526
|
2 && f(
|
|
1508
1527
|
l,
|
|
1509
1528
|
"style",
|
|
1510
1529
|
/*computedStyle*/
|
|
1511
1530
|
e[1]
|
|
1512
1531
|
), M & /*geom*/
|
|
1513
|
-
16 &&
|
|
1514
|
-
e[4].x) && f(l, "x",
|
|
1532
|
+
16 && u !== (u = /*geom*/
|
|
1533
|
+
e[4].x) && f(l, "x", u), M & /*geom*/
|
|
1515
1534
|
16 && h !== (h = /*geom*/
|
|
1516
1535
|
e[4].y) && f(l, "y", h), M & /*geom*/
|
|
1517
|
-
16 &&
|
|
1518
|
-
e[4].w) && f(l, "width",
|
|
1536
|
+
16 && c !== (c = /*geom*/
|
|
1537
|
+
e[4].w) && f(l, "width", c), M & /*geom*/
|
|
1519
1538
|
16 && m !== (m = /*geom*/
|
|
1520
1539
|
e[4].h) && f(l, "height", m), M & /*geom*/
|
|
1521
1540
|
16 && _ !== (_ = /*geom*/
|
|
@@ -1529,35 +1548,35 @@ function uo(e) {
|
|
|
1529
1548
|
e[4].w) && f(T, "x", S), M & /*geom*/
|
|
1530
1549
|
16 && P !== (P = /*geom*/
|
|
1531
1550
|
e[4].y) && f(T, "y", P), M & /*geom*/
|
|
1532
|
-
16 &&
|
|
1533
|
-
e[4].h) && f(T, "height",
|
|
1551
|
+
16 && D !== (D = /*geom*/
|
|
1552
|
+
e[4].h) && f(T, "height", D), M & /*geom*/
|
|
1534
1553
|
16 && E !== (E = /*geom*/
|
|
1535
1554
|
e[4].x) && f(p, "x", E), M & /*geom*/
|
|
1536
1555
|
16 && b !== (b = /*geom*/
|
|
1537
1556
|
e[4].y + /*geom*/
|
|
1538
1557
|
e[4].h) && f(p, "y", b), M & /*geom*/
|
|
1539
|
-
16 &&
|
|
1540
|
-
e[4].w) && f(p, "width",
|
|
1558
|
+
16 && L !== (L = /*geom*/
|
|
1559
|
+
e[4].w) && f(p, "width", L), M & /*geom*/
|
|
1541
1560
|
16 && Z !== (Z = /*geom*/
|
|
1542
|
-
e[4].x) && f(
|
|
1561
|
+
e[4].x) && f(X, "x", Z), M & /*geom*/
|
|
1543
1562
|
16 && me !== (me = /*geom*/
|
|
1544
|
-
e[4].y) && f(
|
|
1563
|
+
e[4].y) && f(X, "y", me), M & /*geom*/
|
|
1545
1564
|
16 && ge !== (ge = /*geom*/
|
|
1546
|
-
e[4].h) && f(
|
|
1565
|
+
e[4].h) && f(X, "height", ge), M & /*geom, handleSize*/
|
|
1547
1566
|
24 && W !== (W = /*geom*/
|
|
1548
1567
|
e[4].x - /*handleSize*/
|
|
1549
|
-
e[3] / 2) && f(
|
|
1568
|
+
e[3] / 2) && f(v, "x", W), M & /*geom, handleSize*/
|
|
1550
1569
|
24 && G !== (G = /*geom*/
|
|
1551
1570
|
e[4].y - /*handleSize*/
|
|
1552
|
-
e[3] / 2) && f(
|
|
1571
|
+
e[3] / 2) && f(v, "y", G), M & /*handleSize*/
|
|
1553
1572
|
8 && f(
|
|
1554
|
-
|
|
1573
|
+
v,
|
|
1555
1574
|
"height",
|
|
1556
1575
|
/*handleSize*/
|
|
1557
1576
|
e[3]
|
|
1558
1577
|
), M & /*handleSize*/
|
|
1559
1578
|
8 && f(
|
|
1560
|
-
|
|
1579
|
+
v,
|
|
1561
1580
|
"width",
|
|
1562
1581
|
/*handleSize*/
|
|
1563
1582
|
e[3]
|
|
@@ -1585,10 +1604,10 @@ function uo(e) {
|
|
|
1585
1604
|
e[4].x + /*geom*/
|
|
1586
1605
|
e[4].w - /*handleSize*/
|
|
1587
1606
|
e[3] / 2) && f(Q, "x", Ye), M & /*geom, handleSize*/
|
|
1588
|
-
24 &&
|
|
1607
|
+
24 && De !== (De = /*geom*/
|
|
1589
1608
|
e[4].y + /*geom*/
|
|
1590
1609
|
e[4].h - /*handleSize*/
|
|
1591
|
-
e[3] / 2) && f(Q, "y",
|
|
1610
|
+
e[3] / 2) && f(Q, "y", De), M & /*handleSize*/
|
|
1592
1611
|
8 && f(
|
|
1593
1612
|
Q,
|
|
1594
1613
|
"height",
|
|
@@ -1601,9 +1620,9 @@ function uo(e) {
|
|
|
1601
1620
|
/*handleSize*/
|
|
1602
1621
|
e[3]
|
|
1603
1622
|
), M & /*geom, handleSize*/
|
|
1604
|
-
24 &&
|
|
1623
|
+
24 && Xe !== (Xe = /*geom*/
|
|
1605
1624
|
e[4].x - /*handleSize*/
|
|
1606
|
-
e[3] / 2) && f(x, "x",
|
|
1625
|
+
e[3] / 2) && f(x, "x", Xe), M & /*geom, handleSize*/
|
|
1607
1626
|
24 && Re !== (Re = /*geom*/
|
|
1608
1627
|
e[4].y + /*geom*/
|
|
1609
1628
|
e[4].h - /*handleSize*/
|
|
@@ -1622,13 +1641,13 @@ function uo(e) {
|
|
|
1622
1641
|
);
|
|
1623
1642
|
},
|
|
1624
1643
|
d(Y) {
|
|
1625
|
-
Y && k(t), Y && k(a), Y && k(l), Y && k(d), Y && k(g), Y && k(y), Y && k(T), Y && k(U), Y && k(p), Y && k(B), Y && k(
|
|
1644
|
+
Y && k(t), Y && k(a), Y && k(l), Y && k(d), Y && k(g), Y && k(y), Y && k(T), Y && k(U), Y && k(p), Y && k(B), Y && k(X), Y && k(Me), Y && k(v), Y && k(ce), Y && k(H), Y && k(ze), Y && k(Q), Y && k(je), Y && k(x), qe = !1, ie(ut);
|
|
1626
1645
|
}
|
|
1627
1646
|
};
|
|
1628
1647
|
}
|
|
1629
|
-
function
|
|
1648
|
+
function ho(e) {
|
|
1630
1649
|
let t, n;
|
|
1631
|
-
return t = new
|
|
1650
|
+
return t = new Qt({
|
|
1632
1651
|
props: {
|
|
1633
1652
|
shape: (
|
|
1634
1653
|
/*shape*/
|
|
@@ -1644,7 +1663,7 @@ function fo(e) {
|
|
|
1644
1663
|
),
|
|
1645
1664
|
$$slots: {
|
|
1646
1665
|
default: [
|
|
1647
|
-
|
|
1666
|
+
fo,
|
|
1648
1667
|
({ grab: o }) => ({ 10: o }),
|
|
1649
1668
|
({ grab: o }) => o ? 1024 : 0
|
|
1650
1669
|
]
|
|
@@ -1671,13 +1690,13 @@ function fo(e) {
|
|
|
1671
1690
|
le(t, o, i), n = !0;
|
|
1672
1691
|
},
|
|
1673
1692
|
p(o, [i]) {
|
|
1674
|
-
const
|
|
1693
|
+
const r = {};
|
|
1675
1694
|
i & /*shape*/
|
|
1676
|
-
1 && (
|
|
1695
|
+
1 && (r.shape = /*shape*/
|
|
1677
1696
|
o[0]), i & /*transform*/
|
|
1678
|
-
4 && (
|
|
1697
|
+
4 && (r.transform = /*transform*/
|
|
1679
1698
|
o[2]), i & /*$$scope, geom, handleSize, grab, computedStyle*/
|
|
1680
|
-
3098 && (
|
|
1699
|
+
3098 && (r.$$scope = { dirty: i, ctx: o }), t.$set(r);
|
|
1681
1700
|
},
|
|
1682
1701
|
i(o) {
|
|
1683
1702
|
n || (C(t.$$.fragment, o), n = !0);
|
|
@@ -1690,39 +1709,39 @@ function fo(e) {
|
|
|
1690
1709
|
}
|
|
1691
1710
|
};
|
|
1692
1711
|
}
|
|
1693
|
-
function
|
|
1694
|
-
let o, i, { shape:
|
|
1695
|
-
const
|
|
1712
|
+
function mo(e, t, n) {
|
|
1713
|
+
let o, i, { shape: r } = t, { computedStyle: s = void 0 } = t, { transform: a } = t, { viewportScale: l = 1 } = t;
|
|
1714
|
+
const u = (d, g, _) => {
|
|
1696
1715
|
const A = d.geometry.bounds;
|
|
1697
1716
|
let [w, y] = [A.minX, A.minY], [T, S] = [A.maxX, A.maxY];
|
|
1698
|
-
const [P,
|
|
1699
|
-
if (g ===
|
|
1700
|
-
w += P, T += P, y +=
|
|
1717
|
+
const [P, D] = _;
|
|
1718
|
+
if (g === O.SHAPE)
|
|
1719
|
+
w += P, T += P, y += D, S += D;
|
|
1701
1720
|
else {
|
|
1702
1721
|
switch (g) {
|
|
1703
|
-
case
|
|
1704
|
-
case
|
|
1705
|
-
case
|
|
1706
|
-
y +=
|
|
1722
|
+
case O.TOP:
|
|
1723
|
+
case O.TOP_LEFT:
|
|
1724
|
+
case O.TOP_RIGHT: {
|
|
1725
|
+
y += D;
|
|
1707
1726
|
break;
|
|
1708
1727
|
}
|
|
1709
|
-
case
|
|
1710
|
-
case
|
|
1711
|
-
case
|
|
1712
|
-
S +=
|
|
1728
|
+
case O.BOTTOM:
|
|
1729
|
+
case O.BOTTOM_LEFT:
|
|
1730
|
+
case O.BOTTOM_RIGHT: {
|
|
1731
|
+
S += D;
|
|
1713
1732
|
break;
|
|
1714
1733
|
}
|
|
1715
1734
|
}
|
|
1716
1735
|
switch (g) {
|
|
1717
|
-
case
|
|
1718
|
-
case
|
|
1719
|
-
case
|
|
1736
|
+
case O.LEFT:
|
|
1737
|
+
case O.TOP_LEFT:
|
|
1738
|
+
case O.BOTTOM_LEFT: {
|
|
1720
1739
|
w += P;
|
|
1721
1740
|
break;
|
|
1722
1741
|
}
|
|
1723
|
-
case
|
|
1724
|
-
case
|
|
1725
|
-
case
|
|
1742
|
+
case O.RIGHT:
|
|
1743
|
+
case O.TOP_RIGHT:
|
|
1744
|
+
case O.BOTTOM_RIGHT: {
|
|
1726
1745
|
T += P;
|
|
1727
1746
|
break;
|
|
1728
1747
|
}
|
|
@@ -1748,34 +1767,34 @@ function ho(e, t, n) {
|
|
|
1748
1767
|
function h(d) {
|
|
1749
1768
|
Ae.call(this, e, d);
|
|
1750
1769
|
}
|
|
1751
|
-
function
|
|
1770
|
+
function c(d) {
|
|
1752
1771
|
Ae.call(this, e, d);
|
|
1753
1772
|
}
|
|
1754
1773
|
function m(d) {
|
|
1755
1774
|
Ae.call(this, e, d);
|
|
1756
1775
|
}
|
|
1757
1776
|
return e.$$set = (d) => {
|
|
1758
|
-
"shape" in d && n(0,
|
|
1777
|
+
"shape" in d && n(0, r = d.shape), "computedStyle" in d && n(1, s = d.computedStyle), "transform" in d && n(2, a = d.transform), "viewportScale" in d && n(6, l = d.viewportScale);
|
|
1759
1778
|
}, e.$$.update = () => {
|
|
1760
1779
|
e.$$.dirty & /*shape*/
|
|
1761
|
-
1 && n(4, o =
|
|
1780
|
+
1 && n(4, o = r.geometry), e.$$.dirty & /*viewportScale*/
|
|
1762
1781
|
64 && n(3, i = 10 / l);
|
|
1763
1782
|
}, [
|
|
1764
|
-
s,
|
|
1765
1783
|
r,
|
|
1784
|
+
s,
|
|
1766
1785
|
a,
|
|
1767
1786
|
i,
|
|
1768
1787
|
o,
|
|
1769
|
-
|
|
1788
|
+
u,
|
|
1770
1789
|
l,
|
|
1771
1790
|
h,
|
|
1772
|
-
|
|
1791
|
+
c,
|
|
1773
1792
|
m
|
|
1774
1793
|
];
|
|
1775
1794
|
}
|
|
1776
|
-
class
|
|
1795
|
+
class go extends te {
|
|
1777
1796
|
constructor(t) {
|
|
1778
|
-
super(), ee(this, t,
|
|
1797
|
+
super(), ee(this, t, mo, ho, J, {
|
|
1779
1798
|
shape: 0,
|
|
1780
1799
|
computedStyle: 1,
|
|
1781
1800
|
transform: 2,
|
|
@@ -1783,30 +1802,30 @@ class mo extends te {
|
|
|
1783
1802
|
});
|
|
1784
1803
|
}
|
|
1785
1804
|
}
|
|
1786
|
-
const
|
|
1787
|
-
[z.RECTANGLE,
|
|
1788
|
-
[z.POLYGON,
|
|
1789
|
-
]), At = (e) =>
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
const
|
|
1805
|
+
const Zt = /* @__PURE__ */ new Map([
|
|
1806
|
+
[z.RECTANGLE, go],
|
|
1807
|
+
[z.POLYGON, uo]
|
|
1808
|
+
]), At = (e) => Zt.get(e.type), po = (e, t) => Zt.set(e, t), O = (e) => `HANDLE-${e}`;
|
|
1809
|
+
O.SHAPE = "SHAPE";
|
|
1810
|
+
O.TOP = "TOP";
|
|
1811
|
+
O.RIGHT = "RIGHT";
|
|
1812
|
+
O.BOTTOM = "BOTTOM";
|
|
1813
|
+
O.LEFT = "LEFT";
|
|
1814
|
+
O.TOP_LEFT = "TOP_LEFT";
|
|
1815
|
+
O.TOP_RIGHT = "TOP_RIGHT";
|
|
1816
|
+
O.BOTTOM_RIGHT = "BOTTOM_RIGHT";
|
|
1817
|
+
O.BOTTOM_LEFT = "BOTTOM_LEFT";
|
|
1818
|
+
const yo = (e) => ({}), Tt = (e) => ({ grab: (
|
|
1800
1819
|
/*onGrab*/
|
|
1801
1820
|
e[0]
|
|
1802
1821
|
) });
|
|
1803
|
-
function
|
|
1822
|
+
function _o(e) {
|
|
1804
1823
|
let t, n, o, i;
|
|
1805
|
-
const
|
|
1824
|
+
const r = (
|
|
1806
1825
|
/*#slots*/
|
|
1807
1826
|
e[7].default
|
|
1808
|
-
),
|
|
1809
|
-
|
|
1827
|
+
), s = nn(
|
|
1828
|
+
r,
|
|
1810
1829
|
e,
|
|
1811
1830
|
/*$$scope*/
|
|
1812
1831
|
e[6],
|
|
@@ -1814,10 +1833,10 @@ function yo(e) {
|
|
|
1814
1833
|
);
|
|
1815
1834
|
return {
|
|
1816
1835
|
c() {
|
|
1817
|
-
t = R("g"),
|
|
1836
|
+
t = R("g"), s && s.c(), f(t, "class", "a9s-annotation selected");
|
|
1818
1837
|
},
|
|
1819
1838
|
m(a, l) {
|
|
1820
|
-
I(a, t, l),
|
|
1839
|
+
I(a, t, l), s && s.m(t, null), n = !0, o || (i = [
|
|
1821
1840
|
K(
|
|
1822
1841
|
t,
|
|
1823
1842
|
"pointerup",
|
|
@@ -1833,19 +1852,19 @@ function yo(e) {
|
|
|
1833
1852
|
], o = !0);
|
|
1834
1853
|
},
|
|
1835
1854
|
p(a, [l]) {
|
|
1836
|
-
|
|
1837
|
-
64) &&
|
|
1838
|
-
r,
|
|
1855
|
+
s && s.p && (!n || l & /*$$scope*/
|
|
1856
|
+
64) && rn(
|
|
1839
1857
|
s,
|
|
1858
|
+
r,
|
|
1840
1859
|
a,
|
|
1841
1860
|
/*$$scope*/
|
|
1842
1861
|
a[6],
|
|
1843
|
-
n ?
|
|
1844
|
-
|
|
1862
|
+
n ? on(
|
|
1863
|
+
r,
|
|
1845
1864
|
/*$$scope*/
|
|
1846
1865
|
a[6],
|
|
1847
1866
|
l,
|
|
1848
|
-
|
|
1867
|
+
yo
|
|
1849
1868
|
) : sn(
|
|
1850
1869
|
/*$$scope*/
|
|
1851
1870
|
a[6]
|
|
@@ -1854,76 +1873,76 @@ function yo(e) {
|
|
|
1854
1873
|
);
|
|
1855
1874
|
},
|
|
1856
1875
|
i(a) {
|
|
1857
|
-
n || (C(
|
|
1876
|
+
n || (C(s, a), n = !0);
|
|
1858
1877
|
},
|
|
1859
1878
|
o(a) {
|
|
1860
|
-
N(
|
|
1879
|
+
N(s, a), n = !1;
|
|
1861
1880
|
},
|
|
1862
1881
|
d(a) {
|
|
1863
|
-
a && k(t),
|
|
1882
|
+
a && k(t), s && s.d(a), o = !1, ie(i);
|
|
1864
1883
|
}
|
|
1865
1884
|
};
|
|
1866
1885
|
}
|
|
1867
|
-
function
|
|
1886
|
+
function wo(e, t, n) {
|
|
1868
1887
|
let { $$slots: o = {}, $$scope: i } = t;
|
|
1869
|
-
const
|
|
1870
|
-
let { shape:
|
|
1888
|
+
const r = Se();
|
|
1889
|
+
let { shape: s } = t, { editor: a } = t, { transform: l } = t, u = null, h, c = null;
|
|
1871
1890
|
const m = (_) => (A) => {
|
|
1872
|
-
|
|
1891
|
+
u = _, h = l.elementToImage(A.offsetX, A.offsetY), c = s, A.target.setPointerCapture(A.pointerId), r("grab");
|
|
1873
1892
|
}, d = (_) => {
|
|
1874
|
-
if (
|
|
1893
|
+
if (u) {
|
|
1875
1894
|
const [A, w] = l.elementToImage(_.offsetX, _.offsetY), y = [A - h[0], w - h[1]];
|
|
1876
|
-
n(3,
|
|
1895
|
+
n(3, s = a(c, u, y)), r("change", s);
|
|
1877
1896
|
}
|
|
1878
1897
|
}, g = (_) => {
|
|
1879
|
-
_.target.releasePointerCapture(_.pointerId),
|
|
1898
|
+
_.target.releasePointerCapture(_.pointerId), u = null, c = s, r("release");
|
|
1880
1899
|
};
|
|
1881
1900
|
return e.$$set = (_) => {
|
|
1882
|
-
"shape" in _ && n(3,
|
|
1883
|
-
}, [m, d, g,
|
|
1901
|
+
"shape" in _ && n(3, s = _.shape), "editor" in _ && n(4, a = _.editor), "transform" in _ && n(5, l = _.transform), "$$scope" in _ && n(6, i = _.$$scope);
|
|
1902
|
+
}, [m, d, g, s, a, l, i, o];
|
|
1884
1903
|
}
|
|
1885
|
-
class
|
|
1904
|
+
class Qt extends te {
|
|
1886
1905
|
constructor(t) {
|
|
1887
|
-
super(), ee(this, t,
|
|
1906
|
+
super(), ee(this, t, wo, _o, J, { shape: 3, editor: 4, transform: 5 });
|
|
1888
1907
|
}
|
|
1889
1908
|
}
|
|
1890
1909
|
const He = (e, t) => {
|
|
1891
1910
|
const n = typeof t == "function" ? t(e) : t;
|
|
1892
1911
|
if (n) {
|
|
1893
1912
|
const { fill: o, fillOpacity: i } = n;
|
|
1894
|
-
let
|
|
1895
|
-
return o && (
|
|
1913
|
+
let r = "";
|
|
1914
|
+
return o && (r += `fill:${o};stroke:${o};`), r += `fill-opacity:${i || "0.25"};`, r;
|
|
1896
1915
|
}
|
|
1897
1916
|
};
|
|
1898
|
-
function
|
|
1917
|
+
function bo(e, t, n) {
|
|
1899
1918
|
let o;
|
|
1900
1919
|
const i = Se();
|
|
1901
|
-
let { annotation:
|
|
1902
|
-
return Be(() => (n(6,
|
|
1920
|
+
let { annotation: r } = t, { editor: s } = t, { style: a = void 0 } = t, { target: l } = t, { transform: u } = t, { viewportScale: h } = t, c;
|
|
1921
|
+
return Be(() => (n(6, c = new s({
|
|
1903
1922
|
target: l,
|
|
1904
1923
|
props: {
|
|
1905
|
-
shape:
|
|
1924
|
+
shape: r.target.selector,
|
|
1906
1925
|
computedStyle: o,
|
|
1907
|
-
transform:
|
|
1926
|
+
transform: u,
|
|
1908
1927
|
viewportScale: h
|
|
1909
1928
|
}
|
|
1910
|
-
})),
|
|
1911
|
-
|
|
1912
|
-
}),
|
|
1913
|
-
|
|
1929
|
+
})), c.$on("change", (m) => {
|
|
1930
|
+
c.$$set({ shape: m.detail }), i("change", m.detail);
|
|
1931
|
+
}), c.$on("grab", (m) => i("grab", m.detail)), c.$on("release", (m) => i("release", m.detail)), () => {
|
|
1932
|
+
c.$destroy();
|
|
1914
1933
|
})), e.$$set = (m) => {
|
|
1915
|
-
"annotation" in m && n(0,
|
|
1934
|
+
"annotation" in m && n(0, r = m.annotation), "editor" in m && n(1, s = m.editor), "style" in m && n(2, a = m.style), "target" in m && n(3, l = m.target), "transform" in m && n(4, u = m.transform), "viewportScale" in m && n(5, h = m.viewportScale);
|
|
1916
1935
|
}, e.$$.update = () => {
|
|
1917
1936
|
e.$$.dirty & /*annotation, style*/
|
|
1918
|
-
5 && (o = He(
|
|
1919
|
-
65 &&
|
|
1920
|
-
80 &&
|
|
1921
|
-
96 &&
|
|
1922
|
-
}, [
|
|
1937
|
+
5 && (o = He(r, a)), e.$$.dirty & /*annotation, editorComponent*/
|
|
1938
|
+
65 && r && (c == null || c.$set({ shape: r.target.selector })), e.$$.dirty & /*editorComponent, transform*/
|
|
1939
|
+
80 && c && c.$set({ transform: u }), e.$$.dirty & /*editorComponent, viewportScale*/
|
|
1940
|
+
96 && c && c.$set({ viewportScale: h });
|
|
1941
|
+
}, [r, s, a, l, u, h, c];
|
|
1923
1942
|
}
|
|
1924
|
-
class
|
|
1943
|
+
class Eo extends te {
|
|
1925
1944
|
constructor(t) {
|
|
1926
|
-
super(), ee(this, t,
|
|
1945
|
+
super(), ee(this, t, bo, null, J, {
|
|
1927
1946
|
annotation: 0,
|
|
1928
1947
|
editor: 1,
|
|
1929
1948
|
style: 2,
|
|
@@ -1933,35 +1952,35 @@ class bo extends te {
|
|
|
1933
1952
|
});
|
|
1934
1953
|
}
|
|
1935
1954
|
}
|
|
1936
|
-
function
|
|
1955
|
+
function Ao(e, t, n) {
|
|
1937
1956
|
const o = Se();
|
|
1938
|
-
let { drawingMode: i } = t, { target:
|
|
1957
|
+
let { drawingMode: i } = t, { target: r } = t, { tool: s } = t, { transform: a } = t, { viewportScale: l } = t, u;
|
|
1939
1958
|
return Be(() => {
|
|
1940
|
-
const h =
|
|
1941
|
-
h.addEventListener(d, g, _),
|
|
1959
|
+
const h = r.closest("svg"), c = [], m = (d, g, _) => {
|
|
1960
|
+
h.addEventListener(d, g, _), c.push(() => h.removeEventListener(d, g, _));
|
|
1942
1961
|
};
|
|
1943
|
-
return n(5,
|
|
1944
|
-
target:
|
|
1962
|
+
return n(5, u = new s({
|
|
1963
|
+
target: r,
|
|
1945
1964
|
props: {
|
|
1946
1965
|
addEventListener: m,
|
|
1947
1966
|
drawingMode: i,
|
|
1948
1967
|
transform: a,
|
|
1949
1968
|
viewportScale: l
|
|
1950
1969
|
}
|
|
1951
|
-
})),
|
|
1952
|
-
|
|
1970
|
+
})), u.$on("create", (d) => o("create", d.detail)), () => {
|
|
1971
|
+
c.forEach((d) => d()), u.$destroy();
|
|
1953
1972
|
};
|
|
1954
1973
|
}), e.$$set = (h) => {
|
|
1955
|
-
"drawingMode" in h && n(0, i = h.drawingMode), "target" in h && n(1,
|
|
1974
|
+
"drawingMode" in h && n(0, i = h.drawingMode), "target" in h && n(1, r = h.target), "tool" in h && n(2, s = h.tool), "transform" in h && n(3, a = h.transform), "viewportScale" in h && n(4, l = h.viewportScale);
|
|
1956
1975
|
}, e.$$.update = () => {
|
|
1957
1976
|
e.$$.dirty & /*toolComponent, transform*/
|
|
1958
|
-
40 &&
|
|
1959
|
-
48 &&
|
|
1960
|
-
}, [i,
|
|
1977
|
+
40 && u && u.$set({ transform: a }), e.$$.dirty & /*toolComponent, viewportScale*/
|
|
1978
|
+
48 && u && u.$set({ viewportScale: l });
|
|
1979
|
+
}, [i, r, s, a, l, u];
|
|
1961
1980
|
}
|
|
1962
|
-
class
|
|
1981
|
+
class To extends te {
|
|
1963
1982
|
constructor(t) {
|
|
1964
|
-
super(), ee(this, t,
|
|
1983
|
+
super(), ee(this, t, Ao, null, J, {
|
|
1965
1984
|
drawingMode: 0,
|
|
1966
1985
|
target: 1,
|
|
1967
1986
|
tool: 2,
|
|
@@ -2075,7 +2094,7 @@ function St(e) {
|
|
|
2075
2094
|
}
|
|
2076
2095
|
};
|
|
2077
2096
|
}
|
|
2078
|
-
function
|
|
2097
|
+
function So(e) {
|
|
2079
2098
|
let t, n = (
|
|
2080
2099
|
/*origin*/
|
|
2081
2100
|
e[0] && St(e)
|
|
@@ -2098,21 +2117,21 @@ function To(e) {
|
|
|
2098
2117
|
}
|
|
2099
2118
|
};
|
|
2100
2119
|
}
|
|
2101
|
-
function
|
|
2120
|
+
function Mo(e, t, n) {
|
|
2102
2121
|
const o = Se();
|
|
2103
|
-
let { addEventListener: i } = t, { drawingMode:
|
|
2122
|
+
let { addEventListener: i } = t, { drawingMode: r } = t, { transform: s } = t, a, l, u, h, c, m, d;
|
|
2104
2123
|
const g = (y) => {
|
|
2105
|
-
a = performance.now(),
|
|
2124
|
+
a = performance.now(), r === "drag" && (n(0, l = s.elementToImage(y.offsetX, y.offsetY)), u = l, n(1, h = l[0]), n(2, c = l[1]), n(3, m = 1), n(4, d = 1));
|
|
2106
2125
|
}, _ = (y) => {
|
|
2107
|
-
l && (
|
|
2126
|
+
l && (u = s.elementToImage(y.offsetX, y.offsetY), n(1, h = Math.min(u[0], l[0])), n(2, c = Math.min(u[1], l[1])), n(3, m = Math.abs(u[0] - l[0])), n(4, d = Math.abs(u[1] - l[1])));
|
|
2108
2127
|
}, A = (y) => {
|
|
2109
2128
|
const T = performance.now() - a;
|
|
2110
|
-
if (
|
|
2129
|
+
if (r === "click") {
|
|
2111
2130
|
if (T > 300)
|
|
2112
2131
|
return;
|
|
2113
|
-
y.stopPropagation(), l ? w() : (n(0, l =
|
|
2132
|
+
y.stopPropagation(), l ? w() : (n(0, l = s.elementToImage(y.offsetX, y.offsetY)), u = l, n(1, h = l[0]), n(2, c = l[1]), n(3, m = 1), n(4, d = 1));
|
|
2114
2133
|
} else
|
|
2115
|
-
l && (T > 300 || m * d > 100 ? (y.stopPropagation(), w()) : (n(0, l = null),
|
|
2134
|
+
l && (T > 300 || m * d > 100 ? (y.stopPropagation(), w()) : (n(0, l = null), u = null));
|
|
2116
2135
|
}, w = () => {
|
|
2117
2136
|
if (m * d > 15) {
|
|
2118
2137
|
const y = {
|
|
@@ -2120,29 +2139,29 @@ function So(e, t, n) {
|
|
|
2120
2139
|
geometry: {
|
|
2121
2140
|
bounds: {
|
|
2122
2141
|
minX: h,
|
|
2123
|
-
minY:
|
|
2142
|
+
minY: c,
|
|
2124
2143
|
maxX: h + m,
|
|
2125
|
-
maxY:
|
|
2144
|
+
maxY: c + d
|
|
2126
2145
|
},
|
|
2127
2146
|
x: h,
|
|
2128
|
-
y:
|
|
2147
|
+
y: c,
|
|
2129
2148
|
w: m,
|
|
2130
2149
|
h: d
|
|
2131
2150
|
}
|
|
2132
2151
|
};
|
|
2133
2152
|
o("create", y);
|
|
2134
2153
|
}
|
|
2135
|
-
n(0, l = null),
|
|
2154
|
+
n(0, l = null), u = null;
|
|
2136
2155
|
};
|
|
2137
2156
|
return Be(() => {
|
|
2138
2157
|
i("pointerdown", g), i("pointermove", _), i("pointerup", A, !0);
|
|
2139
2158
|
}), e.$$set = (y) => {
|
|
2140
|
-
"addEventListener" in y && n(5, i = y.addEventListener), "drawingMode" in y && n(6,
|
|
2141
|
-
}, [l, h,
|
|
2159
|
+
"addEventListener" in y && n(5, i = y.addEventListener), "drawingMode" in y && n(6, r = y.drawingMode), "transform" in y && n(7, s = y.transform);
|
|
2160
|
+
}, [l, h, c, m, d, i, r, s];
|
|
2142
2161
|
}
|
|
2143
|
-
class
|
|
2162
|
+
class Lo extends te {
|
|
2144
2163
|
constructor(t) {
|
|
2145
|
-
super(), ee(this, t,
|
|
2164
|
+
super(), ee(this, t, Mo, So, J, {
|
|
2146
2165
|
addEventListener: 5,
|
|
2147
2166
|
drawingMode: 6,
|
|
2148
2167
|
transform: 7
|
|
@@ -2153,56 +2172,56 @@ const Ze = (e, t) => {
|
|
|
2153
2172
|
const n = Math.abs(t[0] - e[0]), o = Math.abs(t[1] - e[1]);
|
|
2154
2173
|
return Math.sqrt(Math.pow(n, 2) + Math.pow(o, 2));
|
|
2155
2174
|
}, _e = [];
|
|
2156
|
-
function
|
|
2175
|
+
function Oo(e, t = F) {
|
|
2157
2176
|
let n;
|
|
2158
2177
|
const o = /* @__PURE__ */ new Set();
|
|
2159
2178
|
function i(a) {
|
|
2160
2179
|
if (J(e, a) && (e = a, n)) {
|
|
2161
2180
|
const l = !_e.length;
|
|
2162
|
-
for (const
|
|
2163
|
-
|
|
2181
|
+
for (const u of o)
|
|
2182
|
+
u[1](), _e.push(u, e);
|
|
2164
2183
|
if (l) {
|
|
2165
|
-
for (let
|
|
2166
|
-
_e[
|
|
2184
|
+
for (let u = 0; u < _e.length; u += 2)
|
|
2185
|
+
_e[u][0](_e[u + 1]);
|
|
2167
2186
|
_e.length = 0;
|
|
2168
2187
|
}
|
|
2169
2188
|
}
|
|
2170
2189
|
}
|
|
2171
|
-
function
|
|
2190
|
+
function r(a) {
|
|
2172
2191
|
i(a(e));
|
|
2173
2192
|
}
|
|
2174
|
-
function
|
|
2175
|
-
const
|
|
2176
|
-
return o.add(
|
|
2177
|
-
o.delete(
|
|
2193
|
+
function s(a, l = F) {
|
|
2194
|
+
const u = [a, l];
|
|
2195
|
+
return o.add(u), o.size === 1 && (n = t(i) || F), a(e), () => {
|
|
2196
|
+
o.delete(u), o.size === 0 && n && (n(), n = null);
|
|
2178
2197
|
};
|
|
2179
2198
|
}
|
|
2180
|
-
return { set: i, update:
|
|
2199
|
+
return { set: i, update: r, subscribe: s };
|
|
2181
2200
|
}
|
|
2182
|
-
const
|
|
2201
|
+
const vo = (e, t) => {
|
|
2183
2202
|
const { naturalWidth: n, naturalHeight: o } = e;
|
|
2184
2203
|
if (!n && !o) {
|
|
2185
|
-
const { width: i, height:
|
|
2186
|
-
t.setAttribute("viewBox", `0 0 ${i} ${
|
|
2187
|
-
const a =
|
|
2204
|
+
const { width: i, height: r } = e;
|
|
2205
|
+
t.setAttribute("viewBox", `0 0 ${i} ${r}`), e.addEventListener("load", (s) => {
|
|
2206
|
+
const a = s.target;
|
|
2188
2207
|
t.setAttribute("viewBox", `0 0 ${a.naturalWidth} ${a.naturalHeight}`);
|
|
2189
2208
|
});
|
|
2190
2209
|
} else
|
|
2191
2210
|
t.setAttribute("viewBox", `0 0 ${n} ${o}`);
|
|
2192
|
-
},
|
|
2193
|
-
|
|
2194
|
-
const { subscribe: n, set: o } =
|
|
2211
|
+
}, ko = (e, t) => {
|
|
2212
|
+
vo(e, t);
|
|
2213
|
+
const { subscribe: n, set: o } = Oo(1);
|
|
2195
2214
|
let i;
|
|
2196
2215
|
return window.ResizeObserver && (i = new ResizeObserver(() => {
|
|
2197
|
-
const
|
|
2198
|
-
|
|
2199
|
-
|
|
2216
|
+
const s = t.getBoundingClientRect(), { width: a, height: l } = t.viewBox.baseVal, u = Math.max(
|
|
2217
|
+
s.width / a,
|
|
2218
|
+
s.height / l
|
|
2200
2219
|
);
|
|
2201
|
-
o(
|
|
2220
|
+
o(u);
|
|
2202
2221
|
}), i.observe(t.parentElement)), { destroy: () => {
|
|
2203
2222
|
i && i.disconnect();
|
|
2204
2223
|
}, subscribe: n };
|
|
2205
|
-
},
|
|
2224
|
+
}, bi = "ontouchstart" in window || navigator.maxTouchPoints > 0;
|
|
2206
2225
|
function Qe(e) {
|
|
2207
2226
|
const t = e.slice(), n = (
|
|
2208
2227
|
/*isClosable*/
|
|
@@ -2219,18 +2238,18 @@ function Qe(e) {
|
|
|
2219
2238
|
return t[15] = n, t;
|
|
2220
2239
|
}
|
|
2221
2240
|
function Mt(e) {
|
|
2222
|
-
let t, n, o, i,
|
|
2241
|
+
let t, n, o, i, r, s = (
|
|
2223
2242
|
/*isClosable*/
|
|
2224
|
-
e[2] &&
|
|
2243
|
+
e[2] && Lt(e)
|
|
2225
2244
|
);
|
|
2226
2245
|
return {
|
|
2227
2246
|
c() {
|
|
2228
|
-
t = R("polygon"), o = R("polygon"),
|
|
2247
|
+
t = R("polygon"), o = R("polygon"), s && s.c(), r = re(), f(t, "class", "a9s-outer"), f(t, "points", n = /*coords*/
|
|
2229
2248
|
e[15]), f(o, "class", "a9s-inner"), f(o, "points", i = /*coords*/
|
|
2230
2249
|
e[15]);
|
|
2231
2250
|
},
|
|
2232
2251
|
m(a, l) {
|
|
2233
|
-
I(a, t, l), I(a, o, l),
|
|
2252
|
+
I(a, t, l), I(a, o, l), s && s.m(a, l), I(a, r, l);
|
|
2234
2253
|
},
|
|
2235
2254
|
p(a, l) {
|
|
2236
2255
|
l & /*isClosable, points, cursor*/
|
|
@@ -2238,14 +2257,14 @@ function Mt(e) {
|
|
|
2238
2257
|
a[15]) && f(t, "points", n), l & /*isClosable, points, cursor*/
|
|
2239
2258
|
7 && i !== (i = /*coords*/
|
|
2240
2259
|
a[15]) && f(o, "points", i), /*isClosable*/
|
|
2241
|
-
a[2] ?
|
|
2260
|
+
a[2] ? s ? s.p(a, l) : (s = Lt(a), s.c(), s.m(r.parentNode, r)) : s && (s.d(1), s = null);
|
|
2242
2261
|
},
|
|
2243
2262
|
d(a) {
|
|
2244
|
-
a && k(t), a && k(o),
|
|
2263
|
+
a && k(t), a && k(o), s && s.d(a), a && k(r);
|
|
2245
2264
|
}
|
|
2246
2265
|
};
|
|
2247
2266
|
}
|
|
2248
|
-
function
|
|
2267
|
+
function Lt(e) {
|
|
2249
2268
|
let t, n, o;
|
|
2250
2269
|
return {
|
|
2251
2270
|
c() {
|
|
@@ -2265,23 +2284,23 @@ function vt(e) {
|
|
|
2265
2284
|
e[3]
|
|
2266
2285
|
);
|
|
2267
2286
|
},
|
|
2268
|
-
m(i,
|
|
2269
|
-
I(i, t,
|
|
2287
|
+
m(i, r) {
|
|
2288
|
+
I(i, t, r);
|
|
2270
2289
|
},
|
|
2271
|
-
p(i,
|
|
2272
|
-
|
|
2290
|
+
p(i, r) {
|
|
2291
|
+
r & /*points, handleSize*/
|
|
2273
2292
|
9 && n !== (n = /*points*/
|
|
2274
2293
|
i[0][0][0] - /*handleSize*/
|
|
2275
|
-
i[3] / 2) && f(t, "x", n),
|
|
2294
|
+
i[3] / 2) && f(t, "x", n), r & /*points, handleSize*/
|
|
2276
2295
|
9 && o !== (o = /*points*/
|
|
2277
2296
|
i[0][0][1] - /*handleSize*/
|
|
2278
|
-
i[3] / 2) && f(t, "y", o),
|
|
2297
|
+
i[3] / 2) && f(t, "y", o), r & /*handleSize*/
|
|
2279
2298
|
8 && f(
|
|
2280
2299
|
t,
|
|
2281
2300
|
"height",
|
|
2282
2301
|
/*handleSize*/
|
|
2283
2302
|
i[3]
|
|
2284
|
-
),
|
|
2303
|
+
), r & /*handleSize*/
|
|
2285
2304
|
8 && f(
|
|
2286
2305
|
t,
|
|
2287
2306
|
"width",
|
|
@@ -2294,7 +2313,7 @@ function vt(e) {
|
|
|
2294
2313
|
}
|
|
2295
2314
|
};
|
|
2296
2315
|
}
|
|
2297
|
-
function
|
|
2316
|
+
function Io(e) {
|
|
2298
2317
|
let t, n = (
|
|
2299
2318
|
/*cursor*/
|
|
2300
2319
|
e[1] && Mt(Qe(e))
|
|
@@ -2317,47 +2336,47 @@ function ko(e) {
|
|
|
2317
2336
|
}
|
|
2318
2337
|
};
|
|
2319
2338
|
}
|
|
2320
|
-
const
|
|
2321
|
-
function
|
|
2339
|
+
const Bo = 20;
|
|
2340
|
+
function Po(e, t, n) {
|
|
2322
2341
|
let o;
|
|
2323
2342
|
const i = Se();
|
|
2324
|
-
let { addEventListener:
|
|
2343
|
+
let { addEventListener: r } = t, { drawingMode: s } = t, { transform: a } = t, { viewportScale: l = 1 } = t, u, h = [], c = null, m = !1;
|
|
2325
2344
|
const d = (y) => {
|
|
2326
2345
|
const { timeStamp: T, offsetX: S, offsetY: P } = y;
|
|
2327
|
-
if (
|
|
2328
|
-
const
|
|
2329
|
-
h.push(
|
|
2346
|
+
if (u = { timeStamp: T, offsetX: S, offsetY: P }, s === "drag" && h.length === 0) {
|
|
2347
|
+
const D = a.elementToImage(y.offsetX, y.offsetY);
|
|
2348
|
+
h.push(D), n(1, c = D);
|
|
2330
2349
|
}
|
|
2331
2350
|
}, g = (y) => {
|
|
2332
|
-
if (h.length > 0 && (n(1,
|
|
2333
|
-
const T = Ze(
|
|
2334
|
-
n(2, m = T <
|
|
2351
|
+
if (h.length > 0 && (n(1, c = a.elementToImage(y.offsetX, y.offsetY)), h.length > 2)) {
|
|
2352
|
+
const T = Ze(c, h[0]) * l;
|
|
2353
|
+
n(2, m = T < Bo);
|
|
2335
2354
|
}
|
|
2336
2355
|
}, _ = (y) => {
|
|
2337
|
-
if (
|
|
2338
|
-
const T = y.timeStamp -
|
|
2356
|
+
if (s === "click") {
|
|
2357
|
+
const T = y.timeStamp - u.timeStamp, S = Ze([u.offsetX, u.offsetY], [y.offsetX, y.offsetY]);
|
|
2339
2358
|
if (T > 300 || S > 15)
|
|
2340
2359
|
return;
|
|
2341
2360
|
if (m)
|
|
2342
2361
|
w();
|
|
2343
2362
|
else if (h.length === 0) {
|
|
2344
2363
|
const P = a.elementToImage(y.offsetX, y.offsetY);
|
|
2345
|
-
h.push(P), n(1,
|
|
2364
|
+
h.push(P), n(1, c = P);
|
|
2346
2365
|
} else
|
|
2347
|
-
h.push(
|
|
2366
|
+
h.push(c);
|
|
2348
2367
|
} else {
|
|
2349
|
-
if (h.length === 1 && Ze(h[0],
|
|
2350
|
-
n(0, h = []), n(1,
|
|
2368
|
+
if (h.length === 1 && Ze(h[0], c) <= 4) {
|
|
2369
|
+
n(0, h = []), n(1, c = null);
|
|
2351
2370
|
return;
|
|
2352
2371
|
}
|
|
2353
|
-
y.stopImmediatePropagation(), m ? w() : h.push(
|
|
2372
|
+
y.stopImmediatePropagation(), m ? w() : h.push(c);
|
|
2354
2373
|
}
|
|
2355
2374
|
}, A = () => {
|
|
2356
|
-
const y = [...h,
|
|
2375
|
+
const y = [...h, c], T = {
|
|
2357
2376
|
type: z.POLYGON,
|
|
2358
2377
|
geometry: { bounds: Fe(y), points: y }
|
|
2359
2378
|
};
|
|
2360
|
-
ot(T) > 4 && (n(0, h = []), n(1,
|
|
2379
|
+
ot(T) > 4 && (n(0, h = []), n(1, c = null), i("create", T));
|
|
2361
2380
|
}, w = () => {
|
|
2362
2381
|
const y = {
|
|
2363
2382
|
type: z.POLYGON,
|
|
@@ -2366,29 +2385,29 @@ function Bo(e, t, n) {
|
|
|
2366
2385
|
points: [...h]
|
|
2367
2386
|
}
|
|
2368
2387
|
};
|
|
2369
|
-
n(0, h = []), n(1,
|
|
2388
|
+
n(0, h = []), n(1, c = null), i("create", y);
|
|
2370
2389
|
};
|
|
2371
2390
|
return Be(() => {
|
|
2372
|
-
|
|
2391
|
+
r("pointerdown", d, !0), r("pointermove", g), r("pointerup", _, !0), r("dblclick", A, !0);
|
|
2373
2392
|
}), e.$$set = (y) => {
|
|
2374
|
-
"addEventListener" in y && n(4,
|
|
2393
|
+
"addEventListener" in y && n(4, r = y.addEventListener), "drawingMode" in y && n(5, s = y.drawingMode), "transform" in y && n(6, a = y.transform), "viewportScale" in y && n(7, l = y.viewportScale);
|
|
2375
2394
|
}, e.$$.update = () => {
|
|
2376
2395
|
e.$$.dirty & /*viewportScale*/
|
|
2377
2396
|
128 && n(3, o = 10 / l);
|
|
2378
2397
|
}, [
|
|
2379
2398
|
h,
|
|
2380
|
-
|
|
2399
|
+
c,
|
|
2381
2400
|
m,
|
|
2382
2401
|
o,
|
|
2383
|
-
s,
|
|
2384
2402
|
r,
|
|
2403
|
+
s,
|
|
2385
2404
|
a,
|
|
2386
2405
|
l
|
|
2387
2406
|
];
|
|
2388
2407
|
}
|
|
2389
|
-
class
|
|
2408
|
+
class Yo extends te {
|
|
2390
2409
|
constructor(t) {
|
|
2391
|
-
super(), ee(this, t,
|
|
2410
|
+
super(), ee(this, t, Po, Io, J, {
|
|
2392
2411
|
addEventListener: 4,
|
|
2393
2412
|
drawingMode: 5,
|
|
2394
2413
|
transform: 6,
|
|
@@ -2397,11 +2416,11 @@ class Po extends te {
|
|
|
2397
2416
|
}
|
|
2398
2417
|
}
|
|
2399
2418
|
const ct = /* @__PURE__ */ new Map([
|
|
2400
|
-
["rectangle", { tool:
|
|
2401
|
-
["polygon", { tool:
|
|
2402
|
-
]), it = () => [...ct.keys()],
|
|
2419
|
+
["rectangle", { tool: Lo }],
|
|
2420
|
+
["polygon", { tool: Yo }]
|
|
2421
|
+
]), it = () => [...ct.keys()], xt = (e) => ct.get(e), Do = (e, t, n) => ct.set(e, { tool: t, opts: n });
|
|
2403
2422
|
function Xo(e) {
|
|
2404
|
-
let t, n, o, i,
|
|
2423
|
+
let t, n, o, i, r;
|
|
2405
2424
|
return {
|
|
2406
2425
|
c() {
|
|
2407
2426
|
t = R("g"), n = R("ellipse"), i = R("ellipse"), f(n, "class", "a9s-outer"), f(n, "style", o = /*computedStyle*/
|
|
@@ -2450,49 +2469,49 @@ function Xo(e) {
|
|
|
2450
2469
|
"ry",
|
|
2451
2470
|
/*ry*/
|
|
2452
2471
|
e[5]
|
|
2453
|
-
), f(t, "data-id",
|
|
2472
|
+
), f(t, "data-id", r = /*annotation*/
|
|
2454
2473
|
e[0].id);
|
|
2455
2474
|
},
|
|
2456
|
-
m(
|
|
2457
|
-
I(
|
|
2475
|
+
m(s, a) {
|
|
2476
|
+
I(s, t, a), se(t, n), se(t, i);
|
|
2458
2477
|
},
|
|
2459
|
-
p(
|
|
2478
|
+
p(s, [a]) {
|
|
2460
2479
|
a & /*computedStyle*/
|
|
2461
2480
|
2 && o !== (o = /*computedStyle*/
|
|
2462
|
-
|
|
2481
|
+
s[1] ? "display:none;" : void 0) && f(n, "style", o), a & /*computedStyle*/
|
|
2463
2482
|
2 && f(
|
|
2464
2483
|
i,
|
|
2465
2484
|
"style",
|
|
2466
2485
|
/*computedStyle*/
|
|
2467
|
-
|
|
2486
|
+
s[1]
|
|
2468
2487
|
), a & /*annotation*/
|
|
2469
|
-
1 &&
|
|
2470
|
-
|
|
2488
|
+
1 && r !== (r = /*annotation*/
|
|
2489
|
+
s[0].id) && f(t, "data-id", r);
|
|
2471
2490
|
},
|
|
2472
2491
|
i: F,
|
|
2473
2492
|
o: F,
|
|
2474
|
-
d(
|
|
2475
|
-
|
|
2493
|
+
d(s) {
|
|
2494
|
+
s && k(t);
|
|
2476
2495
|
}
|
|
2477
2496
|
};
|
|
2478
2497
|
}
|
|
2479
|
-
function
|
|
2480
|
-
let o, { annotation: i } = t, { geom:
|
|
2481
|
-
const { cx: a, cy: l, rx:
|
|
2482
|
-
return e.$$set = (
|
|
2483
|
-
"annotation" in
|
|
2498
|
+
function Ro(e, t, n) {
|
|
2499
|
+
let o, { annotation: i } = t, { geom: r } = t, { style: s = void 0 } = t;
|
|
2500
|
+
const { cx: a, cy: l, rx: u, ry: h } = r;
|
|
2501
|
+
return e.$$set = (c) => {
|
|
2502
|
+
"annotation" in c && n(0, i = c.annotation), "geom" in c && n(6, r = c.geom), "style" in c && n(7, s = c.style);
|
|
2484
2503
|
}, e.$$.update = () => {
|
|
2485
2504
|
e.$$.dirty & /*annotation, style*/
|
|
2486
|
-
129 && n(1, o = He(i,
|
|
2487
|
-
}, [i, o, a, l,
|
|
2505
|
+
129 && n(1, o = He(i, s));
|
|
2506
|
+
}, [i, o, a, l, u, h, r, s];
|
|
2488
2507
|
}
|
|
2489
|
-
class
|
|
2508
|
+
class Co extends te {
|
|
2490
2509
|
constructor(t) {
|
|
2491
|
-
super(), ee(this, t,
|
|
2510
|
+
super(), ee(this, t, Ro, Xo, J, { annotation: 0, geom: 6, style: 7 });
|
|
2492
2511
|
}
|
|
2493
2512
|
}
|
|
2494
|
-
function
|
|
2495
|
-
let t, n, o, i,
|
|
2513
|
+
function Uo(e) {
|
|
2514
|
+
let t, n, o, i, r;
|
|
2496
2515
|
return {
|
|
2497
2516
|
c() {
|
|
2498
2517
|
t = R("g"), n = R("polygon"), i = R("polygon"), f(n, "class", "a9s-outer"), f(n, "style", o = /*computedStyle*/
|
|
@@ -2500,7 +2519,7 @@ function Co(e) {
|
|
|
2500
2519
|
n,
|
|
2501
2520
|
"points",
|
|
2502
2521
|
/*points*/
|
|
2503
|
-
e[2].map(
|
|
2522
|
+
e[2].map(No).join(" ")
|
|
2504
2523
|
), f(i, "class", "a9s-inner"), f(
|
|
2505
2524
|
i,
|
|
2506
2525
|
"style",
|
|
@@ -2510,51 +2529,51 @@ function Co(e) {
|
|
|
2510
2529
|
i,
|
|
2511
2530
|
"points",
|
|
2512
2531
|
/*points*/
|
|
2513
|
-
e[2].map(
|
|
2514
|
-
), f(t, "data-id",
|
|
2532
|
+
e[2].map(Vo).join(" ")
|
|
2533
|
+
), f(t, "data-id", r = /*annotation*/
|
|
2515
2534
|
e[0].id);
|
|
2516
2535
|
},
|
|
2517
|
-
m(
|
|
2518
|
-
I(
|
|
2536
|
+
m(s, a) {
|
|
2537
|
+
I(s, t, a), se(t, n), se(t, i);
|
|
2519
2538
|
},
|
|
2520
|
-
p(
|
|
2539
|
+
p(s, [a]) {
|
|
2521
2540
|
a & /*computedStyle*/
|
|
2522
2541
|
2 && o !== (o = /*computedStyle*/
|
|
2523
|
-
|
|
2542
|
+
s[1] ? "display:none;" : void 0) && f(n, "style", o), a & /*computedStyle*/
|
|
2524
2543
|
2 && f(
|
|
2525
2544
|
i,
|
|
2526
2545
|
"style",
|
|
2527
2546
|
/*computedStyle*/
|
|
2528
|
-
|
|
2547
|
+
s[1]
|
|
2529
2548
|
), a & /*annotation*/
|
|
2530
|
-
1 &&
|
|
2531
|
-
|
|
2549
|
+
1 && r !== (r = /*annotation*/
|
|
2550
|
+
s[0].id) && f(t, "data-id", r);
|
|
2532
2551
|
},
|
|
2533
2552
|
i: F,
|
|
2534
2553
|
o: F,
|
|
2535
|
-
d(
|
|
2536
|
-
|
|
2554
|
+
d(s) {
|
|
2555
|
+
s && k(t);
|
|
2537
2556
|
}
|
|
2538
2557
|
};
|
|
2539
2558
|
}
|
|
2540
|
-
const
|
|
2541
|
-
function
|
|
2542
|
-
let o, { annotation: i } = t, { geom:
|
|
2543
|
-
const { points: a } =
|
|
2559
|
+
const No = (e) => e.join(","), Vo = (e) => e.join(",");
|
|
2560
|
+
function Go(e, t, n) {
|
|
2561
|
+
let o, { annotation: i } = t, { geom: r } = t, { style: s = void 0 } = t;
|
|
2562
|
+
const { points: a } = r;
|
|
2544
2563
|
return e.$$set = (l) => {
|
|
2545
|
-
"annotation" in l && n(0, i = l.annotation), "geom" in l && n(3,
|
|
2564
|
+
"annotation" in l && n(0, i = l.annotation), "geom" in l && n(3, r = l.geom), "style" in l && n(4, s = l.style);
|
|
2546
2565
|
}, e.$$.update = () => {
|
|
2547
2566
|
e.$$.dirty & /*annotation, style*/
|
|
2548
|
-
17 && n(1, o = He(i,
|
|
2549
|
-
}, [i, o, a,
|
|
2567
|
+
17 && n(1, o = He(i, s));
|
|
2568
|
+
}, [i, o, a, r, s];
|
|
2550
2569
|
}
|
|
2551
|
-
class
|
|
2570
|
+
class Fo extends te {
|
|
2552
2571
|
constructor(t) {
|
|
2553
|
-
super(), ee(this, t,
|
|
2572
|
+
super(), ee(this, t, Go, Uo, J, { annotation: 0, geom: 3, style: 4 });
|
|
2554
2573
|
}
|
|
2555
2574
|
}
|
|
2556
|
-
function
|
|
2557
|
-
let t, n, o, i,
|
|
2575
|
+
function Ho(e) {
|
|
2576
|
+
let t, n, o, i, r;
|
|
2558
2577
|
return {
|
|
2559
2578
|
c() {
|
|
2560
2579
|
t = R("g"), n = R("rect"), i = R("rect"), f(n, "class", "a9s-outer"), f(n, "style", o = /*computedStyle*/
|
|
@@ -2603,122 +2622,122 @@ function Fo(e) {
|
|
|
2603
2622
|
"height",
|
|
2604
2623
|
/*h*/
|
|
2605
2624
|
e[1]
|
|
2606
|
-
), f(t, "data-id",
|
|
2625
|
+
), f(t, "data-id", r = /*annotation*/
|
|
2607
2626
|
e[0].id);
|
|
2608
2627
|
},
|
|
2609
|
-
m(
|
|
2610
|
-
I(
|
|
2628
|
+
m(s, a) {
|
|
2629
|
+
I(s, t, a), se(t, n), se(t, i);
|
|
2611
2630
|
},
|
|
2612
|
-
p(
|
|
2631
|
+
p(s, [a]) {
|
|
2613
2632
|
a & /*computedStyle*/
|
|
2614
2633
|
32 && o !== (o = /*computedStyle*/
|
|
2615
|
-
|
|
2634
|
+
s[5] ? "display:none;" : void 0) && f(n, "style", o), a & /*x*/
|
|
2616
2635
|
16 && f(
|
|
2617
2636
|
n,
|
|
2618
2637
|
"x",
|
|
2619
2638
|
/*x*/
|
|
2620
|
-
|
|
2639
|
+
s[4]
|
|
2621
2640
|
), a & /*y*/
|
|
2622
2641
|
8 && f(
|
|
2623
2642
|
n,
|
|
2624
2643
|
"y",
|
|
2625
2644
|
/*y*/
|
|
2626
|
-
|
|
2645
|
+
s[3]
|
|
2627
2646
|
), a & /*w*/
|
|
2628
2647
|
4 && f(
|
|
2629
2648
|
n,
|
|
2630
2649
|
"width",
|
|
2631
2650
|
/*w*/
|
|
2632
|
-
|
|
2651
|
+
s[2]
|
|
2633
2652
|
), a & /*h*/
|
|
2634
2653
|
2 && f(
|
|
2635
2654
|
n,
|
|
2636
2655
|
"height",
|
|
2637
2656
|
/*h*/
|
|
2638
|
-
|
|
2657
|
+
s[1]
|
|
2639
2658
|
), a & /*computedStyle*/
|
|
2640
2659
|
32 && f(
|
|
2641
2660
|
i,
|
|
2642
2661
|
"style",
|
|
2643
2662
|
/*computedStyle*/
|
|
2644
|
-
|
|
2663
|
+
s[5]
|
|
2645
2664
|
), a & /*x*/
|
|
2646
2665
|
16 && f(
|
|
2647
2666
|
i,
|
|
2648
2667
|
"x",
|
|
2649
2668
|
/*x*/
|
|
2650
|
-
|
|
2669
|
+
s[4]
|
|
2651
2670
|
), a & /*y*/
|
|
2652
2671
|
8 && f(
|
|
2653
2672
|
i,
|
|
2654
2673
|
"y",
|
|
2655
2674
|
/*y*/
|
|
2656
|
-
|
|
2675
|
+
s[3]
|
|
2657
2676
|
), a & /*w*/
|
|
2658
2677
|
4 && f(
|
|
2659
2678
|
i,
|
|
2660
2679
|
"width",
|
|
2661
2680
|
/*w*/
|
|
2662
|
-
|
|
2681
|
+
s[2]
|
|
2663
2682
|
), a & /*h*/
|
|
2664
2683
|
2 && f(
|
|
2665
2684
|
i,
|
|
2666
2685
|
"height",
|
|
2667
2686
|
/*h*/
|
|
2668
|
-
|
|
2687
|
+
s[1]
|
|
2669
2688
|
), a & /*annotation*/
|
|
2670
|
-
1 &&
|
|
2671
|
-
|
|
2689
|
+
1 && r !== (r = /*annotation*/
|
|
2690
|
+
s[0].id) && f(t, "data-id", r);
|
|
2672
2691
|
},
|
|
2673
2692
|
i: F,
|
|
2674
2693
|
o: F,
|
|
2675
|
-
d(
|
|
2676
|
-
|
|
2694
|
+
d(s) {
|
|
2695
|
+
s && k(t);
|
|
2677
2696
|
}
|
|
2678
2697
|
};
|
|
2679
2698
|
}
|
|
2680
|
-
function
|
|
2681
|
-
let o, i,
|
|
2682
|
-
return e.$$set = (
|
|
2683
|
-
"annotation" in
|
|
2699
|
+
function zo(e, t, n) {
|
|
2700
|
+
let o, i, r, s, a, { annotation: l } = t, { geom: u } = t, { style: h = void 0 } = t;
|
|
2701
|
+
return e.$$set = (c) => {
|
|
2702
|
+
"annotation" in c && n(0, l = c.annotation), "geom" in c && n(6, u = c.geom), "style" in c && n(7, h = c.style);
|
|
2684
2703
|
}, e.$$.update = () => {
|
|
2685
2704
|
e.$$.dirty & /*annotation, style*/
|
|
2686
2705
|
129 && n(5, o = He(l, h)), e.$$.dirty & /*geom*/
|
|
2687
|
-
64 && n(4, { x: i, y:
|
|
2688
|
-
}, [l, a,
|
|
2706
|
+
64 && n(4, { x: i, y: r, w: s, h: a } = u, i, (n(3, r), n(6, u)), (n(2, s), n(6, u)), (n(1, a), n(6, u)));
|
|
2707
|
+
}, [l, a, s, r, i, o, u, h];
|
|
2689
2708
|
}
|
|
2690
|
-
class
|
|
2709
|
+
class jo extends te {
|
|
2691
2710
|
constructor(t) {
|
|
2692
|
-
super(), ee(this, t,
|
|
2711
|
+
super(), ee(this, t, zo, Ho, J, { annotation: 0, geom: 6, style: 7 });
|
|
2693
2712
|
}
|
|
2694
2713
|
}
|
|
2695
|
-
const
|
|
2714
|
+
const Ei = {
|
|
2696
2715
|
elementToImage: (e, t) => [e, t]
|
|
2697
|
-
},
|
|
2716
|
+
}, qo = (e) => ({
|
|
2698
2717
|
elementToImage: (t, n) => {
|
|
2699
2718
|
const o = e.getBoundingClientRect(), i = e.createSVGPoint();
|
|
2700
2719
|
i.x = t + o.x, i.y = n + o.y;
|
|
2701
|
-
const { x:
|
|
2702
|
-
return [
|
|
2720
|
+
const { x: r, y: s } = i.matrixTransform(e.getScreenCTM().inverse());
|
|
2721
|
+
return [r, s];
|
|
2703
2722
|
}
|
|
2704
|
-
}),
|
|
2723
|
+
}), Ko = 250, Wo = (e, t) => {
|
|
2705
2724
|
const n = Se();
|
|
2706
2725
|
let o;
|
|
2707
|
-
return { onPointerDown: () => o = performance.now(), onPointerUp: (
|
|
2708
|
-
if (performance.now() - o <
|
|
2709
|
-
const { x: l, y:
|
|
2710
|
-
h ? n("click", { originalEvent:
|
|
2726
|
+
return { onPointerDown: () => o = performance.now(), onPointerUp: (s) => {
|
|
2727
|
+
if (performance.now() - o < Ko) {
|
|
2728
|
+
const { x: l, y: u } = Jo(s, e), h = t.getAt(l, u);
|
|
2729
|
+
h ? n("click", { originalEvent: s, annotation: h }) : n("click", { originalEvent: s });
|
|
2711
2730
|
}
|
|
2712
2731
|
} };
|
|
2713
|
-
},
|
|
2714
|
-
const n = t.createSVGPoint(), o = t.getBoundingClientRect(), i = e.clientX - o.x,
|
|
2715
|
-
return n.x = i +
|
|
2732
|
+
}, Jo = (e, t) => {
|
|
2733
|
+
const n = t.createSVGPoint(), o = t.getBoundingClientRect(), i = e.clientX - o.x, r = e.clientY - o.y, { left: s, top: a } = t.getBoundingClientRect();
|
|
2734
|
+
return n.x = i + s, n.y = r + a, n.matrixTransform(t.getScreenCTM().inverse());
|
|
2716
2735
|
};
|
|
2717
|
-
function
|
|
2736
|
+
function Ot(e, t, n) {
|
|
2718
2737
|
const o = e.slice();
|
|
2719
2738
|
return o[29] = t[n], o;
|
|
2720
2739
|
}
|
|
2721
|
-
function
|
|
2740
|
+
function vt(e, t, n) {
|
|
2722
2741
|
const o = e.slice();
|
|
2723
2742
|
return o[32] = t[n], o;
|
|
2724
2743
|
}
|
|
@@ -2736,30 +2755,30 @@ function kt(e) {
|
|
|
2736
2755
|
), n, o, i = It(e);
|
|
2737
2756
|
return {
|
|
2738
2757
|
c() {
|
|
2739
|
-
i.c(), n =
|
|
2758
|
+
i.c(), n = re();
|
|
2740
2759
|
},
|
|
2741
|
-
m(
|
|
2742
|
-
i.m(
|
|
2760
|
+
m(r, s) {
|
|
2761
|
+
i.m(r, s), I(r, n, s), o = !0;
|
|
2743
2762
|
},
|
|
2744
|
-
p(
|
|
2745
|
-
|
|
2763
|
+
p(r, s) {
|
|
2764
|
+
s[0] & /*$store*/
|
|
2746
2765
|
8192 && J(t, t = /*annotation*/
|
|
2747
|
-
|
|
2766
|
+
r[32].id) ? (ne(), N(i, 1, 1, F), oe(), i = It(r), i.c(), C(i, 1), i.m(n.parentNode, n)) : i.p(r, s);
|
|
2748
2767
|
},
|
|
2749
|
-
i(
|
|
2768
|
+
i(r) {
|
|
2750
2769
|
o || (C(i), o = !0);
|
|
2751
2770
|
},
|
|
2752
|
-
o(
|
|
2771
|
+
o(r) {
|
|
2753
2772
|
N(i), o = !1;
|
|
2754
2773
|
},
|
|
2755
|
-
d(
|
|
2756
|
-
|
|
2774
|
+
d(r) {
|
|
2775
|
+
r && k(n), i.d(r);
|
|
2757
2776
|
}
|
|
2758
2777
|
};
|
|
2759
2778
|
}
|
|
2760
|
-
function
|
|
2779
|
+
function Zo(e) {
|
|
2761
2780
|
let t, n;
|
|
2762
|
-
return t = new
|
|
2781
|
+
return t = new Fo({
|
|
2763
2782
|
props: {
|
|
2764
2783
|
annotation: (
|
|
2765
2784
|
/*annotation*/
|
|
@@ -2782,14 +2801,14 @@ function Jo(e) {
|
|
|
2782
2801
|
le(t, o, i), n = !0;
|
|
2783
2802
|
},
|
|
2784
2803
|
p(o, i) {
|
|
2785
|
-
const
|
|
2804
|
+
const r = {};
|
|
2786
2805
|
i[0] & /*$store*/
|
|
2787
|
-
8192 && (
|
|
2806
|
+
8192 && (r.annotation = /*annotation*/
|
|
2788
2807
|
o[32]), i[0] & /*$store*/
|
|
2789
|
-
8192 && (
|
|
2808
|
+
8192 && (r.geom = /*selector*/
|
|
2790
2809
|
o[35].geometry), i[0] & /*style*/
|
|
2791
|
-
2 && (
|
|
2792
|
-
o[1]), t.$set(
|
|
2810
|
+
2 && (r.style = /*style*/
|
|
2811
|
+
o[1]), t.$set(r);
|
|
2793
2812
|
},
|
|
2794
2813
|
i(o) {
|
|
2795
2814
|
n || (C(t.$$.fragment, o), n = !0);
|
|
@@ -2802,9 +2821,9 @@ function Jo(e) {
|
|
|
2802
2821
|
}
|
|
2803
2822
|
};
|
|
2804
2823
|
}
|
|
2805
|
-
function
|
|
2824
|
+
function Qo(e) {
|
|
2806
2825
|
let t, n;
|
|
2807
|
-
return t = new
|
|
2826
|
+
return t = new jo({
|
|
2808
2827
|
props: {
|
|
2809
2828
|
annotation: (
|
|
2810
2829
|
/*annotation*/
|
|
@@ -2827,14 +2846,14 @@ function Zo(e) {
|
|
|
2827
2846
|
le(t, o, i), n = !0;
|
|
2828
2847
|
},
|
|
2829
2848
|
p(o, i) {
|
|
2830
|
-
const
|
|
2849
|
+
const r = {};
|
|
2831
2850
|
i[0] & /*$store*/
|
|
2832
|
-
8192 && (
|
|
2851
|
+
8192 && (r.annotation = /*annotation*/
|
|
2833
2852
|
o[32]), i[0] & /*$store*/
|
|
2834
|
-
8192 && (
|
|
2853
|
+
8192 && (r.geom = /*selector*/
|
|
2835
2854
|
o[35].geometry), i[0] & /*style*/
|
|
2836
|
-
2 && (
|
|
2837
|
-
o[1]), t.$set(
|
|
2855
|
+
2 && (r.style = /*style*/
|
|
2856
|
+
o[1]), t.$set(r);
|
|
2838
2857
|
},
|
|
2839
2858
|
i(o) {
|
|
2840
2859
|
n || (C(t.$$.fragment, o), n = !0);
|
|
@@ -2847,9 +2866,9 @@ function Zo(e) {
|
|
|
2847
2866
|
}
|
|
2848
2867
|
};
|
|
2849
2868
|
}
|
|
2850
|
-
function
|
|
2869
|
+
function xo(e) {
|
|
2851
2870
|
let t, n;
|
|
2852
|
-
return t = new
|
|
2871
|
+
return t = new Co({
|
|
2853
2872
|
props: {
|
|
2854
2873
|
annotation: (
|
|
2855
2874
|
/*annotation*/
|
|
@@ -2872,14 +2891,14 @@ function Qo(e) {
|
|
|
2872
2891
|
le(t, o, i), n = !0;
|
|
2873
2892
|
},
|
|
2874
2893
|
p(o, i) {
|
|
2875
|
-
const
|
|
2894
|
+
const r = {};
|
|
2876
2895
|
i[0] & /*$store*/
|
|
2877
|
-
8192 && (
|
|
2896
|
+
8192 && (r.annotation = /*annotation*/
|
|
2878
2897
|
o[32]), i[0] & /*$store*/
|
|
2879
|
-
8192 && (
|
|
2898
|
+
8192 && (r.geom = /*selector*/
|
|
2880
2899
|
o[35].geometry), i[0] & /*style*/
|
|
2881
|
-
2 && (
|
|
2882
|
-
o[1]), t.$set(
|
|
2900
|
+
2 && (r.style = /*style*/
|
|
2901
|
+
o[1]), t.$set(r);
|
|
2883
2902
|
},
|
|
2884
2903
|
i(o) {
|
|
2885
2904
|
n || (C(t.$$.fragment, o), n = !0);
|
|
@@ -2894,8 +2913,8 @@ function Qo(e) {
|
|
|
2894
2913
|
}
|
|
2895
2914
|
function It(e) {
|
|
2896
2915
|
let t, n, o, i;
|
|
2897
|
-
const
|
|
2898
|
-
function a(l,
|
|
2916
|
+
const r = [xo, Qo, Zo], s = [];
|
|
2917
|
+
function a(l, u) {
|
|
2899
2918
|
return (
|
|
2900
2919
|
/*selector*/
|
|
2901
2920
|
l[35].type === z.ELLIPSE ? 0 : (
|
|
@@ -2907,18 +2926,18 @@ function It(e) {
|
|
|
2907
2926
|
)
|
|
2908
2927
|
);
|
|
2909
2928
|
}
|
|
2910
|
-
return ~(t = a(e)) && (n =
|
|
2929
|
+
return ~(t = a(e)) && (n = s[t] = r[t](e)), {
|
|
2911
2930
|
c() {
|
|
2912
|
-
n && n.c(), o =
|
|
2931
|
+
n && n.c(), o = re();
|
|
2913
2932
|
},
|
|
2914
|
-
m(l,
|
|
2915
|
-
~t &&
|
|
2933
|
+
m(l, u) {
|
|
2934
|
+
~t && s[t].m(l, u), I(l, o, u), i = !0;
|
|
2916
2935
|
},
|
|
2917
|
-
p(l,
|
|
2936
|
+
p(l, u) {
|
|
2918
2937
|
let h = t;
|
|
2919
|
-
t = a(l), t === h ? ~t &&
|
|
2920
|
-
|
|
2921
|
-
}), oe()), ~t ? (n =
|
|
2938
|
+
t = a(l), t === h ? ~t && s[t].p(l, u) : (n && (ne(), N(s[h], 1, 1, () => {
|
|
2939
|
+
s[h] = null;
|
|
2940
|
+
}), oe()), ~t ? (n = s[t], n ? n.p(l, u) : (n = s[t] = r[t](l), n.c()), C(n, 1), n.m(o.parentNode, o)) : n = null);
|
|
2922
2941
|
},
|
|
2923
2942
|
i(l) {
|
|
2924
2943
|
i || (C(n), i = !0);
|
|
@@ -2927,7 +2946,7 @@ function It(e) {
|
|
|
2927
2946
|
N(n), i = !1;
|
|
2928
2947
|
},
|
|
2929
2948
|
d(l) {
|
|
2930
|
-
~t &&
|
|
2949
|
+
~t && s[t].d(l), l && k(o);
|
|
2931
2950
|
}
|
|
2932
2951
|
};
|
|
2933
2952
|
}
|
|
@@ -2939,37 +2958,37 @@ function Bt(e) {
|
|
|
2939
2958
|
), n, o, i = t && kt(xe(e));
|
|
2940
2959
|
return {
|
|
2941
2960
|
c() {
|
|
2942
|
-
i && i.c(), n =
|
|
2961
|
+
i && i.c(), n = re();
|
|
2943
2962
|
},
|
|
2944
|
-
m(
|
|
2945
|
-
i && i.m(
|
|
2963
|
+
m(r, s) {
|
|
2964
|
+
i && i.m(r, s), I(r, n, s), o = !0;
|
|
2946
2965
|
},
|
|
2947
|
-
p(
|
|
2948
|
-
|
|
2966
|
+
p(r, s) {
|
|
2967
|
+
s[0] & /*isEditable, $store*/
|
|
2949
2968
|
8320 && (t = !/*isEditable*/
|
|
2950
|
-
|
|
2969
|
+
r[7](
|
|
2951
2970
|
/*annotation*/
|
|
2952
|
-
|
|
2953
|
-
)), t ? i ? (i.p(xe(
|
|
2954
|
-
8320 && C(i, 1)) : (i = kt(xe(
|
|
2971
|
+
r[32]
|
|
2972
|
+
)), t ? i ? (i.p(xe(r), s), s[0] & /*isEditable, $store*/
|
|
2973
|
+
8320 && C(i, 1)) : (i = kt(xe(r)), i.c(), C(i, 1), i.m(n.parentNode, n)) : i && (ne(), N(i, 1, 1, () => {
|
|
2955
2974
|
i = null;
|
|
2956
2975
|
}), oe());
|
|
2957
2976
|
},
|
|
2958
|
-
i(
|
|
2977
|
+
i(r) {
|
|
2959
2978
|
o || (C(i), o = !0);
|
|
2960
2979
|
},
|
|
2961
|
-
o(
|
|
2980
|
+
o(r) {
|
|
2962
2981
|
N(i), o = !1;
|
|
2963
2982
|
},
|
|
2964
|
-
d(
|
|
2965
|
-
i && i.d(
|
|
2983
|
+
d(r) {
|
|
2984
|
+
i && i.d(r), r && k(n);
|
|
2966
2985
|
}
|
|
2967
2986
|
};
|
|
2968
2987
|
}
|
|
2969
2988
|
function Pt(e) {
|
|
2970
2989
|
let t, n, o, i;
|
|
2971
|
-
const
|
|
2972
|
-
function a(l,
|
|
2990
|
+
const r = [ei, $o], s = [];
|
|
2991
|
+
function a(l, u) {
|
|
2973
2992
|
return (
|
|
2974
2993
|
/*editableAnnotations*/
|
|
2975
2994
|
l[6] ? 0 : (
|
|
@@ -2979,18 +2998,18 @@ function Pt(e) {
|
|
|
2979
2998
|
)
|
|
2980
2999
|
);
|
|
2981
3000
|
}
|
|
2982
|
-
return ~(t = a(e)) && (n =
|
|
3001
|
+
return ~(t = a(e)) && (n = s[t] = r[t](e)), {
|
|
2983
3002
|
c() {
|
|
2984
|
-
n && n.c(), o =
|
|
3003
|
+
n && n.c(), o = re();
|
|
2985
3004
|
},
|
|
2986
|
-
m(l,
|
|
2987
|
-
~t &&
|
|
3005
|
+
m(l, u) {
|
|
3006
|
+
~t && s[t].m(l, u), I(l, o, u), i = !0;
|
|
2988
3007
|
},
|
|
2989
|
-
p(l,
|
|
3008
|
+
p(l, u) {
|
|
2990
3009
|
let h = t;
|
|
2991
|
-
t = a(l), t === h ? ~t &&
|
|
2992
|
-
|
|
2993
|
-
}), oe()), ~t ? (n =
|
|
3010
|
+
t = a(l), t === h ? ~t && s[t].p(l, u) : (n && (ne(), N(s[h], 1, 1, () => {
|
|
3011
|
+
s[h] = null;
|
|
3012
|
+
}), oe()), ~t ? (n = s[t], n ? n.p(l, u) : (n = s[t] = r[t](l), n.c()), C(n, 1), n.m(o.parentNode, o)) : n = null);
|
|
2994
3013
|
},
|
|
2995
3014
|
i(l) {
|
|
2996
3015
|
i || (C(n), i = !0);
|
|
@@ -2999,95 +3018,95 @@ function Pt(e) {
|
|
|
2999
3018
|
N(n), i = !1;
|
|
3000
3019
|
},
|
|
3001
3020
|
d(l) {
|
|
3002
|
-
~t &&
|
|
3021
|
+
~t && s[t].d(l), l && k(o);
|
|
3003
3022
|
}
|
|
3004
3023
|
};
|
|
3005
3024
|
}
|
|
3006
|
-
function
|
|
3025
|
+
function $o(e) {
|
|
3007
3026
|
let t = (
|
|
3008
3027
|
/*toolName*/
|
|
3009
3028
|
e[2]
|
|
3010
3029
|
), n, o, i = Yt(e);
|
|
3011
3030
|
return {
|
|
3012
3031
|
c() {
|
|
3013
|
-
i.c(), n =
|
|
3032
|
+
i.c(), n = re();
|
|
3014
3033
|
},
|
|
3015
|
-
m(
|
|
3016
|
-
i.m(
|
|
3034
|
+
m(r, s) {
|
|
3035
|
+
i.m(r, s), I(r, n, s), o = !0;
|
|
3017
3036
|
},
|
|
3018
|
-
p(
|
|
3019
|
-
|
|
3037
|
+
p(r, s) {
|
|
3038
|
+
s[0] & /*toolName*/
|
|
3020
3039
|
4 && J(t, t = /*toolName*/
|
|
3021
|
-
|
|
3040
|
+
r[2]) ? (ne(), N(i, 1, 1, F), oe(), i = Yt(r), i.c(), C(i, 1), i.m(n.parentNode, n)) : i.p(r, s);
|
|
3022
3041
|
},
|
|
3023
|
-
i(
|
|
3042
|
+
i(r) {
|
|
3024
3043
|
o || (C(i), o = !0);
|
|
3025
3044
|
},
|
|
3026
|
-
o(
|
|
3045
|
+
o(r) {
|
|
3027
3046
|
N(i), o = !1;
|
|
3028
3047
|
},
|
|
3029
|
-
d(
|
|
3030
|
-
|
|
3048
|
+
d(r) {
|
|
3049
|
+
r && k(n), i.d(r);
|
|
3031
3050
|
}
|
|
3032
3051
|
};
|
|
3033
3052
|
}
|
|
3034
|
-
function
|
|
3053
|
+
function ei(e) {
|
|
3035
3054
|
let t, n, o = (
|
|
3036
3055
|
/*editableAnnotations*/
|
|
3037
3056
|
e[6]
|
|
3038
3057
|
), i = [];
|
|
3039
|
-
for (let
|
|
3040
|
-
i[
|
|
3041
|
-
const
|
|
3042
|
-
i[
|
|
3058
|
+
for (let s = 0; s < o.length; s += 1)
|
|
3059
|
+
i[s] = Xt(Ot(e, o, s));
|
|
3060
|
+
const r = (s) => N(i[s], 1, 1, () => {
|
|
3061
|
+
i[s] = null;
|
|
3043
3062
|
});
|
|
3044
3063
|
return {
|
|
3045
3064
|
c() {
|
|
3046
|
-
for (let
|
|
3047
|
-
i[
|
|
3048
|
-
t =
|
|
3065
|
+
for (let s = 0; s < i.length; s += 1)
|
|
3066
|
+
i[s].c();
|
|
3067
|
+
t = re();
|
|
3049
3068
|
},
|
|
3050
|
-
m(
|
|
3069
|
+
m(s, a) {
|
|
3051
3070
|
for (let l = 0; l < i.length; l += 1)
|
|
3052
|
-
i[l] && i[l].m(
|
|
3053
|
-
I(
|
|
3071
|
+
i[l] && i[l].m(s, a);
|
|
3072
|
+
I(s, t, a), n = !0;
|
|
3054
3073
|
},
|
|
3055
|
-
p(
|
|
3074
|
+
p(s, a) {
|
|
3056
3075
|
if (a[0] & /*editableAnnotations, drawingEl, style, transform, $scale, onChangeSelected*/
|
|
3057
3076
|
279634) {
|
|
3058
3077
|
o = /*editableAnnotations*/
|
|
3059
|
-
|
|
3078
|
+
s[6];
|
|
3060
3079
|
let l;
|
|
3061
3080
|
for (l = 0; l < o.length; l += 1) {
|
|
3062
|
-
const
|
|
3063
|
-
i[l] ? (i[l].p(
|
|
3081
|
+
const u = Ot(s, o, l);
|
|
3082
|
+
i[l] ? (i[l].p(u, a), C(i[l], 1)) : (i[l] = Xt(u), i[l].c(), C(i[l], 1), i[l].m(t.parentNode, t));
|
|
3064
3083
|
}
|
|
3065
3084
|
for (ne(), l = o.length; l < i.length; l += 1)
|
|
3066
|
-
|
|
3085
|
+
r(l);
|
|
3067
3086
|
oe();
|
|
3068
3087
|
}
|
|
3069
3088
|
},
|
|
3070
|
-
i(
|
|
3089
|
+
i(s) {
|
|
3071
3090
|
if (!n) {
|
|
3072
3091
|
for (let a = 0; a < o.length; a += 1)
|
|
3073
3092
|
C(i[a]);
|
|
3074
3093
|
n = !0;
|
|
3075
3094
|
}
|
|
3076
3095
|
},
|
|
3077
|
-
o(
|
|
3096
|
+
o(s) {
|
|
3078
3097
|
i = i.filter(Boolean);
|
|
3079
3098
|
for (let a = 0; a < i.length; a += 1)
|
|
3080
3099
|
N(i[a]);
|
|
3081
3100
|
n = !1;
|
|
3082
3101
|
},
|
|
3083
|
-
d(
|
|
3084
|
-
|
|
3102
|
+
d(s) {
|
|
3103
|
+
rt(i, s), s && k(t);
|
|
3085
3104
|
}
|
|
3086
3105
|
};
|
|
3087
3106
|
}
|
|
3088
3107
|
function Yt(e) {
|
|
3089
3108
|
let t, n;
|
|
3090
|
-
return t = new
|
|
3109
|
+
return t = new To({
|
|
3091
3110
|
props: {
|
|
3092
3111
|
target: (
|
|
3093
3112
|
/*drawingEl*/
|
|
@@ -3122,18 +3141,18 @@ function Yt(e) {
|
|
|
3122
3141
|
le(t, o, i), n = !0;
|
|
3123
3142
|
},
|
|
3124
3143
|
p(o, i) {
|
|
3125
|
-
const
|
|
3144
|
+
const r = {};
|
|
3126
3145
|
i[0] & /*drawingEl*/
|
|
3127
|
-
16 && (
|
|
3146
|
+
16 && (r.target = /*drawingEl*/
|
|
3128
3147
|
o[4]), i[0] & /*tool*/
|
|
3129
|
-
4096 && (
|
|
3148
|
+
4096 && (r.tool = /*tool*/
|
|
3130
3149
|
o[12]), i[0] & /*drawingMode*/
|
|
3131
|
-
2048 && (
|
|
3150
|
+
2048 && (r.drawingMode = /*drawingMode*/
|
|
3132
3151
|
o[11]), i[0] & /*transform*/
|
|
3133
|
-
1024 && (
|
|
3152
|
+
1024 && (r.transform = /*transform*/
|
|
3134
3153
|
o[10]), i[0] & /*$scale*/
|
|
3135
|
-
16384 && (
|
|
3136
|
-
o[14]), t.$set(
|
|
3154
|
+
16384 && (r.viewportScale = /*$scale*/
|
|
3155
|
+
o[14]), t.$set(r);
|
|
3137
3156
|
},
|
|
3138
3157
|
i(o) {
|
|
3139
3158
|
n || (C(t.$$.fragment, o), n = !0);
|
|
@@ -3146,9 +3165,9 @@ function Yt(e) {
|
|
|
3146
3165
|
}
|
|
3147
3166
|
};
|
|
3148
3167
|
}
|
|
3149
|
-
function
|
|
3168
|
+
function Dt(e) {
|
|
3150
3169
|
let t, n;
|
|
3151
|
-
return t = new
|
|
3170
|
+
return t = new Eo({
|
|
3152
3171
|
props: {
|
|
3153
3172
|
target: (
|
|
3154
3173
|
/*drawingEl*/
|
|
@@ -3195,22 +3214,22 @@ function Xt(e) {
|
|
|
3195
3214
|
},
|
|
3196
3215
|
p(o, i) {
|
|
3197
3216
|
e = o;
|
|
3198
|
-
const
|
|
3217
|
+
const r = {};
|
|
3199
3218
|
i[0] & /*drawingEl*/
|
|
3200
|
-
16 && (
|
|
3219
|
+
16 && (r.target = /*drawingEl*/
|
|
3201
3220
|
e[4]), i[0] & /*editableAnnotations*/
|
|
3202
|
-
64 && (
|
|
3221
|
+
64 && (r.editor = At(
|
|
3203
3222
|
/*editable*/
|
|
3204
3223
|
e[29].target.selector
|
|
3205
3224
|
)), i[0] & /*editableAnnotations*/
|
|
3206
|
-
64 && (
|
|
3225
|
+
64 && (r.annotation = /*editable*/
|
|
3207
3226
|
e[29]), i[0] & /*style*/
|
|
3208
|
-
2 && (
|
|
3227
|
+
2 && (r.style = /*style*/
|
|
3209
3228
|
e[1]), i[0] & /*transform*/
|
|
3210
|
-
1024 && (
|
|
3229
|
+
1024 && (r.transform = /*transform*/
|
|
3211
3230
|
e[10]), i[0] & /*$scale*/
|
|
3212
|
-
16384 && (
|
|
3213
|
-
e[14]), t.$set(
|
|
3231
|
+
16384 && (r.viewportScale = /*$scale*/
|
|
3232
|
+
e[14]), t.$set(r);
|
|
3214
3233
|
},
|
|
3215
3234
|
i(o) {
|
|
3216
3235
|
n || (C(t.$$.fragment, o), n = !0);
|
|
@@ -3223,43 +3242,43 @@ function Xt(e) {
|
|
|
3223
3242
|
}
|
|
3224
3243
|
};
|
|
3225
3244
|
}
|
|
3226
|
-
function
|
|
3245
|
+
function Xt(e) {
|
|
3227
3246
|
let t = (
|
|
3228
3247
|
/*editable*/
|
|
3229
3248
|
e[29].id
|
|
3230
|
-
), n, o, i =
|
|
3249
|
+
), n, o, i = Dt(e);
|
|
3231
3250
|
return {
|
|
3232
3251
|
c() {
|
|
3233
|
-
i.c(), n =
|
|
3252
|
+
i.c(), n = re();
|
|
3234
3253
|
},
|
|
3235
|
-
m(
|
|
3236
|
-
i.m(
|
|
3254
|
+
m(r, s) {
|
|
3255
|
+
i.m(r, s), I(r, n, s), o = !0;
|
|
3237
3256
|
},
|
|
3238
|
-
p(
|
|
3239
|
-
|
|
3257
|
+
p(r, s) {
|
|
3258
|
+
s[0] & /*editableAnnotations*/
|
|
3240
3259
|
64 && J(t, t = /*editable*/
|
|
3241
|
-
|
|
3260
|
+
r[29].id) ? (ne(), N(i, 1, 1, F), oe(), i = Dt(r), i.c(), C(i, 1), i.m(n.parentNode, n)) : i.p(r, s);
|
|
3242
3261
|
},
|
|
3243
|
-
i(
|
|
3262
|
+
i(r) {
|
|
3244
3263
|
o || (C(i), o = !0);
|
|
3245
3264
|
},
|
|
3246
|
-
o(
|
|
3265
|
+
o(r) {
|
|
3247
3266
|
N(i), o = !1;
|
|
3248
3267
|
},
|
|
3249
|
-
d(
|
|
3250
|
-
|
|
3268
|
+
d(r) {
|
|
3269
|
+
r && k(n), i.d(r);
|
|
3251
3270
|
}
|
|
3252
3271
|
};
|
|
3253
3272
|
}
|
|
3254
|
-
function
|
|
3255
|
-
let t, n, o, i,
|
|
3273
|
+
function ti(e) {
|
|
3274
|
+
let t, n, o, i, r, s, a = (
|
|
3256
3275
|
/*$store*/
|
|
3257
3276
|
e[13]
|
|
3258
3277
|
), l = [];
|
|
3259
|
-
for (let
|
|
3260
|
-
l[
|
|
3261
|
-
const
|
|
3262
|
-
l[
|
|
3278
|
+
for (let c = 0; c < a.length; c += 1)
|
|
3279
|
+
l[c] = Bt(vt(e, a, c));
|
|
3280
|
+
const u = (c) => N(l[c], 1, 1, () => {
|
|
3281
|
+
l[c] = null;
|
|
3263
3282
|
});
|
|
3264
3283
|
let h = (
|
|
3265
3284
|
/*drawingEl*/
|
|
@@ -3268,8 +3287,8 @@ function ei(e) {
|
|
|
3268
3287
|
return {
|
|
3269
3288
|
c() {
|
|
3270
3289
|
t = R("svg"), n = R("g");
|
|
3271
|
-
for (let
|
|
3272
|
-
l[
|
|
3290
|
+
for (let c = 0; c < l.length; c += 1)
|
|
3291
|
+
l[c].c();
|
|
3273
3292
|
o = R("g"), h && h.c(), f(o, "class", "drawing"), f(t, "class", "a9s-annotationlayer"), ht(
|
|
3274
3293
|
t,
|
|
3275
3294
|
"drawing",
|
|
@@ -3277,11 +3296,11 @@ function ei(e) {
|
|
|
3277
3296
|
e[12]
|
|
3278
3297
|
);
|
|
3279
3298
|
},
|
|
3280
|
-
m(
|
|
3281
|
-
I(
|
|
3299
|
+
m(c, m) {
|
|
3300
|
+
I(c, t, m), se(t, n);
|
|
3282
3301
|
for (let d = 0; d < l.length; d += 1)
|
|
3283
3302
|
l[d] && l[d].m(n, null);
|
|
3284
|
-
|
|
3303
|
+
se(t, o), h && h.m(o, null), e[25](o), e[26](t), i = !0, r || (s = [
|
|
3285
3304
|
K(t, "pointerup", function() {
|
|
3286
3305
|
j(
|
|
3287
3306
|
/*onPointerUp*/
|
|
@@ -3294,20 +3313,20 @@ function ei(e) {
|
|
|
3294
3313
|
e[9]
|
|
3295
3314
|
) && e[9].apply(this, arguments);
|
|
3296
3315
|
})
|
|
3297
|
-
],
|
|
3316
|
+
], r = !0);
|
|
3298
3317
|
},
|
|
3299
|
-
p(
|
|
3300
|
-
if (e =
|
|
3318
|
+
p(c, m) {
|
|
3319
|
+
if (e = c, m[0] & /*$store, style, isEditable*/
|
|
3301
3320
|
8322) {
|
|
3302
3321
|
a = /*$store*/
|
|
3303
3322
|
e[13];
|
|
3304
3323
|
let d;
|
|
3305
3324
|
for (d = 0; d < a.length; d += 1) {
|
|
3306
|
-
const g =
|
|
3325
|
+
const g = vt(e, a, d);
|
|
3307
3326
|
l[d] ? (l[d].p(g, m), C(l[d], 1)) : (l[d] = Bt(g), l[d].c(), C(l[d], 1), l[d].m(n, null));
|
|
3308
3327
|
}
|
|
3309
3328
|
for (ne(), d = a.length; d < l.length; d += 1)
|
|
3310
|
-
|
|
3329
|
+
u(d);
|
|
3311
3330
|
oe();
|
|
3312
3331
|
}
|
|
3313
3332
|
/*drawingEl*/
|
|
@@ -3322,54 +3341,54 @@ function ei(e) {
|
|
|
3322
3341
|
e[12]
|
|
3323
3342
|
);
|
|
3324
3343
|
},
|
|
3325
|
-
i(
|
|
3344
|
+
i(c) {
|
|
3326
3345
|
if (!i) {
|
|
3327
3346
|
for (let m = 0; m < a.length; m += 1)
|
|
3328
3347
|
C(l[m]);
|
|
3329
3348
|
C(h), i = !0;
|
|
3330
3349
|
}
|
|
3331
3350
|
},
|
|
3332
|
-
o(
|
|
3351
|
+
o(c) {
|
|
3333
3352
|
l = l.filter(Boolean);
|
|
3334
3353
|
for (let m = 0; m < l.length; m += 1)
|
|
3335
3354
|
N(l[m]);
|
|
3336
3355
|
N(h), i = !1;
|
|
3337
3356
|
},
|
|
3338
|
-
d(
|
|
3339
|
-
|
|
3357
|
+
d(c) {
|
|
3358
|
+
c && k(t), rt(l, c), h && h.d(), e[25](null), e[26](null), r = !1, ie(s);
|
|
3340
3359
|
}
|
|
3341
3360
|
};
|
|
3342
3361
|
}
|
|
3343
|
-
function
|
|
3344
|
-
let o, i,
|
|
3362
|
+
function ni(e, t, n) {
|
|
3363
|
+
let o, i, r, s, a, l, u, h, c, m, d = F, g = () => (d(), d = Vt(p, (v) => n(14, m = v)), p);
|
|
3345
3364
|
e.$$.on_destroy.push(() => d());
|
|
3346
|
-
let { drawingEnabled: _ } = t, { image: A } = t, { preferredDrawingMode: w } = t, { state: y } = t, { style: T = void 0 } = t, { toolName: S = it().length > 0 ? it()[0] : void 0 } = t, { user: P } = t,
|
|
3347
|
-
Be(() => g(n(5, p =
|
|
3365
|
+
let { drawingEnabled: _ } = t, { image: A } = t, { preferredDrawingMode: w } = t, { state: y } = t, { style: T = void 0 } = t, { toolName: S = it().length > 0 ? it()[0] : void 0 } = t, { user: P } = t, D, U, p;
|
|
3366
|
+
Be(() => g(n(5, p = ko(A, U))));
|
|
3348
3367
|
const { selection: E, store: b } = y;
|
|
3349
|
-
dt(e, E, (
|
|
3350
|
-
let
|
|
3351
|
-
const
|
|
3352
|
-
b.unobserve(
|
|
3353
|
-
const W =
|
|
3354
|
-
W.length > 0 ? (n(6, B = W.map((G) => b.getAnnotation(G))),
|
|
3368
|
+
dt(e, E, (v) => n(24, h = v)), dt(e, b, (v) => n(13, c = v));
|
|
3369
|
+
let L = null, B = null;
|
|
3370
|
+
const X = (v) => {
|
|
3371
|
+
b.unobserve(L);
|
|
3372
|
+
const W = v.filter(({ editable: G }) => G).map(({ id: G }) => G);
|
|
3373
|
+
W.length > 0 ? (n(6, B = W.map((G) => b.getAnnotation(G))), L = (G) => {
|
|
3355
3374
|
const { updated: ce } = G.changes;
|
|
3356
3375
|
n(6, B = ce.map((H) => H.newValue));
|
|
3357
|
-
}, b.observe(
|
|
3358
|
-
}, Z = (
|
|
3376
|
+
}, b.observe(L, { annotations: W })) : n(6, B = null);
|
|
3377
|
+
}, Z = (v) => {
|
|
3359
3378
|
const W = qt(), G = {
|
|
3360
3379
|
id: W,
|
|
3361
3380
|
bodies: [],
|
|
3362
3381
|
target: {
|
|
3363
3382
|
annotation: W,
|
|
3364
|
-
selector:
|
|
3383
|
+
selector: v.detail,
|
|
3365
3384
|
creator: P,
|
|
3366
3385
|
created: /* @__PURE__ */ new Date()
|
|
3367
3386
|
}
|
|
3368
3387
|
};
|
|
3369
3388
|
b.addAnnotation(G), E.setSelected(G.id);
|
|
3370
|
-
}, me = (
|
|
3389
|
+
}, me = (v) => (W) => {
|
|
3371
3390
|
var ue;
|
|
3372
|
-
const { target: G } =
|
|
3391
|
+
const { target: G } = v, ce = 10 * 60 * 1e3, H = ((ue = G.creator) == null ? void 0 : ue.id) !== P.id || !G.created || (/* @__PURE__ */ new Date()).getTime() - G.created.getTime() > ce;
|
|
3373
3392
|
b.updateTarget({
|
|
3374
3393
|
...G,
|
|
3375
3394
|
selector: W.detail,
|
|
@@ -3378,41 +3397,41 @@ function ti(e, t, n) {
|
|
|
3378
3397
|
updatedBy: H ? P : null
|
|
3379
3398
|
});
|
|
3380
3399
|
};
|
|
3381
|
-
function ge(
|
|
3382
|
-
Ge[
|
|
3383
|
-
|
|
3400
|
+
function ge(v) {
|
|
3401
|
+
Ge[v ? "unshift" : "push"](() => {
|
|
3402
|
+
D = v, n(4, D);
|
|
3384
3403
|
});
|
|
3385
3404
|
}
|
|
3386
|
-
function Me(
|
|
3387
|
-
Ge[
|
|
3388
|
-
U =
|
|
3405
|
+
function Me(v) {
|
|
3406
|
+
Ge[v ? "unshift" : "push"](() => {
|
|
3407
|
+
U = v, n(3, U);
|
|
3389
3408
|
});
|
|
3390
3409
|
}
|
|
3391
|
-
return e.$$set = (
|
|
3392
|
-
"drawingEnabled" in
|
|
3410
|
+
return e.$$set = (v) => {
|
|
3411
|
+
"drawingEnabled" in v && n(0, _ = v.drawingEnabled), "image" in v && n(19, A = v.image), "preferredDrawingMode" in v && n(20, w = v.preferredDrawingMode), "state" in v && n(21, y = v.state), "style" in v && n(1, T = v.style), "toolName" in v && n(2, S = v.toolName), "user" in v && n(22, P = v.user);
|
|
3393
3412
|
}, e.$$.update = () => {
|
|
3394
3413
|
e.$$.dirty[0] & /*toolName*/
|
|
3395
|
-
4 && n(12, { tool: o, opts: i } =
|
|
3396
|
-
9437184 && n(11,
|
|
3397
|
-
8 && n(10,
|
|
3398
|
-
8 && n(9, { onPointerDown: a, onPointerUp: l } =
|
|
3399
|
-
16777216 && n(7,
|
|
3400
|
-
16777216 &&
|
|
3414
|
+
4 && n(12, { tool: o, opts: i } = xt(S), o, (n(23, i), n(2, S))), e.$$.dirty[0] & /*opts, preferredDrawingMode*/
|
|
3415
|
+
9437184 && n(11, r = (i == null ? void 0 : i.drawingMode) || w), e.$$.dirty[0] & /*svgEl*/
|
|
3416
|
+
8 && n(10, s = qo(U)), e.$$.dirty[0] & /*svgEl*/
|
|
3417
|
+
8 && n(9, { onPointerDown: a, onPointerUp: l } = Wo(U, b), a, (n(8, l), n(3, U))), e.$$.dirty[0] & /*$selection*/
|
|
3418
|
+
16777216 && n(7, u = (v) => h.selected.find((W) => W.id === v.id && W.editable)), e.$$.dirty[0] & /*$selection*/
|
|
3419
|
+
16777216 && X(h.selected);
|
|
3401
3420
|
}, [
|
|
3402
3421
|
_,
|
|
3403
3422
|
T,
|
|
3404
3423
|
S,
|
|
3405
3424
|
U,
|
|
3406
|
-
|
|
3425
|
+
D,
|
|
3407
3426
|
p,
|
|
3408
3427
|
B,
|
|
3409
|
-
|
|
3428
|
+
u,
|
|
3410
3429
|
l,
|
|
3411
3430
|
a,
|
|
3412
|
-
r,
|
|
3413
3431
|
s,
|
|
3432
|
+
r,
|
|
3414
3433
|
o,
|
|
3415
|
-
|
|
3434
|
+
c,
|
|
3416
3435
|
m,
|
|
3417
3436
|
E,
|
|
3418
3437
|
b,
|
|
@@ -3428,13 +3447,13 @@ function ti(e, t, n) {
|
|
|
3428
3447
|
Me
|
|
3429
3448
|
];
|
|
3430
3449
|
}
|
|
3431
|
-
class
|
|
3450
|
+
class oi extends te {
|
|
3432
3451
|
constructor(t) {
|
|
3433
3452
|
super(), ee(
|
|
3434
3453
|
this,
|
|
3435
3454
|
t,
|
|
3455
|
+
ni,
|
|
3436
3456
|
ti,
|
|
3437
|
-
ei,
|
|
3438
3457
|
J,
|
|
3439
3458
|
{
|
|
3440
3459
|
drawingEnabled: 0,
|
|
@@ -3450,30 +3469,30 @@ class ni extends te {
|
|
|
3450
3469
|
);
|
|
3451
3470
|
}
|
|
3452
3471
|
}
|
|
3453
|
-
function
|
|
3454
|
-
|
|
3472
|
+
function ii(e, t, n, o, i) {
|
|
3473
|
+
$t(e, t, n || 0, o || e.length - 1, i || ri);
|
|
3455
3474
|
}
|
|
3456
|
-
function
|
|
3475
|
+
function $t(e, t, n, o, i) {
|
|
3457
3476
|
for (; o > n; ) {
|
|
3458
3477
|
if (o - n > 600) {
|
|
3459
|
-
var
|
|
3460
|
-
|
|
3478
|
+
var r = o - n + 1, s = t - n + 1, a = Math.log(r), l = 0.5 * Math.exp(2 * a / 3), u = 0.5 * Math.sqrt(a * l * (r - l) / r) * (s - r / 2 < 0 ? -1 : 1), h = Math.max(n, Math.floor(t - s * l / r + u)), c = Math.min(o, Math.floor(t + (r - s) * l / r + u));
|
|
3479
|
+
$t(e, t, h, c, i);
|
|
3461
3480
|
}
|
|
3462
3481
|
var m = e[t], d = n, g = o;
|
|
3463
|
-
for (
|
|
3464
|
-
for (
|
|
3482
|
+
for (Le(e, n, t), i(e[o], m) > 0 && Le(e, n, o); d < g; ) {
|
|
3483
|
+
for (Le(e, d, g), d++, g--; i(e[d], m) < 0; )
|
|
3465
3484
|
d++;
|
|
3466
3485
|
for (; i(e[g], m) > 0; )
|
|
3467
3486
|
g--;
|
|
3468
3487
|
}
|
|
3469
|
-
i(e[n], m) === 0 ?
|
|
3488
|
+
i(e[n], m) === 0 ? Le(e, n, g) : (g++, Le(e, g, o)), g <= t && (n = g + 1), t <= g && (o = g - 1);
|
|
3470
3489
|
}
|
|
3471
3490
|
}
|
|
3472
|
-
function
|
|
3491
|
+
function Le(e, t, n) {
|
|
3473
3492
|
var o = e[t];
|
|
3474
3493
|
e[t] = e[n], e[n] = o;
|
|
3475
3494
|
}
|
|
3476
|
-
function
|
|
3495
|
+
function ri(e, t) {
|
|
3477
3496
|
return e < t ? -1 : e > t ? 1 : 0;
|
|
3478
3497
|
}
|
|
3479
3498
|
class si {
|
|
@@ -3488,13 +3507,13 @@ class si {
|
|
|
3488
3507
|
const o = [];
|
|
3489
3508
|
if (!Ne(t, n))
|
|
3490
3509
|
return o;
|
|
3491
|
-
const i = this.toBBox,
|
|
3510
|
+
const i = this.toBBox, r = [];
|
|
3492
3511
|
for (; n; ) {
|
|
3493
|
-
for (let
|
|
3494
|
-
const a = n.children[
|
|
3495
|
-
Ne(t, l) && (n.leaf ? o.push(a) : et(t, l) ? this._all(a, o) :
|
|
3512
|
+
for (let s = 0; s < n.children.length; s++) {
|
|
3513
|
+
const a = n.children[s], l = n.leaf ? i(a) : a;
|
|
3514
|
+
Ne(t, l) && (n.leaf ? o.push(a) : et(t, l) ? this._all(a, o) : r.push(a));
|
|
3496
3515
|
}
|
|
3497
|
-
n =
|
|
3516
|
+
n = r.pop();
|
|
3498
3517
|
}
|
|
3499
3518
|
return o;
|
|
3500
3519
|
}
|
|
@@ -3505,11 +3524,11 @@ class si {
|
|
|
3505
3524
|
const o = [];
|
|
3506
3525
|
for (; n; ) {
|
|
3507
3526
|
for (let i = 0; i < n.children.length; i++) {
|
|
3508
|
-
const
|
|
3509
|
-
if (Ne(t,
|
|
3510
|
-
if (n.leaf || et(t,
|
|
3527
|
+
const r = n.children[i], s = n.leaf ? this.toBBox(r) : r;
|
|
3528
|
+
if (Ne(t, s)) {
|
|
3529
|
+
if (n.leaf || et(t, s))
|
|
3511
3530
|
return !0;
|
|
3512
|
-
o.push(
|
|
3531
|
+
o.push(r);
|
|
3513
3532
|
}
|
|
3514
3533
|
}
|
|
3515
3534
|
n = o.pop();
|
|
@@ -3548,15 +3567,15 @@ class si {
|
|
|
3548
3567
|
if (!t)
|
|
3549
3568
|
return this;
|
|
3550
3569
|
let o = this.data;
|
|
3551
|
-
const i = this.toBBox(t),
|
|
3552
|
-
let a, l,
|
|
3553
|
-
for (; o ||
|
|
3554
|
-
if (o || (o =
|
|
3555
|
-
const h =
|
|
3570
|
+
const i = this.toBBox(t), r = [], s = [];
|
|
3571
|
+
let a, l, u;
|
|
3572
|
+
for (; o || r.length; ) {
|
|
3573
|
+
if (o || (o = r.pop(), l = r[r.length - 1], a = s.pop(), u = !0), o.leaf) {
|
|
3574
|
+
const h = li(t, o.children, n);
|
|
3556
3575
|
if (h !== -1)
|
|
3557
|
-
return o.children.splice(h, 1),
|
|
3576
|
+
return o.children.splice(h, 1), r.push(o), this._condense(r), this;
|
|
3558
3577
|
}
|
|
3559
|
-
!
|
|
3578
|
+
!u && !o.leaf && et(o, i) ? (r.push(o), s.push(a), a = 0, l = o, o = o.children[0]) : l ? (a++, o = l.children[a], u = !1) : o = null;
|
|
3560
3579
|
}
|
|
3561
3580
|
return this;
|
|
3562
3581
|
}
|
|
@@ -3582,18 +3601,18 @@ class si {
|
|
|
3582
3601
|
return n;
|
|
3583
3602
|
}
|
|
3584
3603
|
_build(t, n, o, i) {
|
|
3585
|
-
const
|
|
3586
|
-
let
|
|
3587
|
-
if (
|
|
3604
|
+
const r = o - n + 1;
|
|
3605
|
+
let s = this._maxEntries, a;
|
|
3606
|
+
if (r <= s)
|
|
3588
3607
|
return a = Ee(t.slice(n, o + 1)), we(a, this.toBBox), a;
|
|
3589
|
-
i || (i = Math.ceil(Math.log(
|
|
3590
|
-
const l = Math.ceil(
|
|
3591
|
-
Rt(t, n, o,
|
|
3592
|
-
for (let h = n; h <= o; h +=
|
|
3593
|
-
const
|
|
3594
|
-
Rt(t, h,
|
|
3595
|
-
for (let m = h; m <=
|
|
3596
|
-
const d = Math.min(m + l - 1,
|
|
3608
|
+
i || (i = Math.ceil(Math.log(r) / Math.log(s)), s = Math.ceil(r / Math.pow(s, i - 1))), a = Ee([]), a.leaf = !1, a.height = i;
|
|
3609
|
+
const l = Math.ceil(r / s), u = l * Math.ceil(Math.sqrt(s));
|
|
3610
|
+
Rt(t, n, o, u, this.compareMinX);
|
|
3611
|
+
for (let h = n; h <= o; h += u) {
|
|
3612
|
+
const c = Math.min(h + u - 1, o);
|
|
3613
|
+
Rt(t, h, c, l, this.compareMinY);
|
|
3614
|
+
for (let m = h; m <= c; m += l) {
|
|
3615
|
+
const d = Math.min(m + l - 1, c);
|
|
3597
3616
|
a.children.push(this._build(t, m, d, i - 1));
|
|
3598
3617
|
}
|
|
3599
3618
|
}
|
|
@@ -3601,69 +3620,69 @@ class si {
|
|
|
3601
3620
|
}
|
|
3602
3621
|
_chooseSubtree(t, n, o, i) {
|
|
3603
3622
|
for (; i.push(n), !(n.leaf || i.length - 1 === o); ) {
|
|
3604
|
-
let
|
|
3623
|
+
let r = 1 / 0, s = 1 / 0, a;
|
|
3605
3624
|
for (let l = 0; l < n.children.length; l++) {
|
|
3606
|
-
const
|
|
3607
|
-
|
|
3625
|
+
const u = n.children[l], h = $e(u), c = ui(t, u) - h;
|
|
3626
|
+
c < s ? (s = c, r = h < r ? h : r, a = u) : c === s && h < r && (r = h, a = u);
|
|
3608
3627
|
}
|
|
3609
3628
|
n = a || n.children[0];
|
|
3610
3629
|
}
|
|
3611
3630
|
return n;
|
|
3612
3631
|
}
|
|
3613
3632
|
_insert(t, n, o) {
|
|
3614
|
-
const i = o ? t : this.toBBox(t),
|
|
3615
|
-
for (
|
|
3616
|
-
this._split(
|
|
3617
|
-
this._adjustParentBBoxes(i,
|
|
3633
|
+
const i = o ? t : this.toBBox(t), r = [], s = this._chooseSubtree(i, this.data, n, r);
|
|
3634
|
+
for (s.children.push(t), ve(s, i); n >= 0 && r[n].children.length > this._maxEntries; )
|
|
3635
|
+
this._split(r, n), n--;
|
|
3636
|
+
this._adjustParentBBoxes(i, r, n);
|
|
3618
3637
|
}
|
|
3619
3638
|
// split overflowed node into two
|
|
3620
3639
|
_split(t, n) {
|
|
3621
|
-
const o = t[n], i = o.children.length,
|
|
3622
|
-
this._chooseSplitAxis(o,
|
|
3623
|
-
const
|
|
3640
|
+
const o = t[n], i = o.children.length, r = this._minEntries;
|
|
3641
|
+
this._chooseSplitAxis(o, r, i);
|
|
3642
|
+
const s = this._chooseSplitIndex(o, r, i), a = Ee(o.children.splice(s, o.children.length - s));
|
|
3624
3643
|
a.height = o.height, a.leaf = o.leaf, we(o, this.toBBox), we(a, this.toBBox), n ? t[n - 1].children.push(a) : this._splitRoot(o, a);
|
|
3625
3644
|
}
|
|
3626
3645
|
_splitRoot(t, n) {
|
|
3627
3646
|
this.data = Ee([t, n]), this.data.height = t.height + 1, this.data.leaf = !1, we(this.data, this.toBBox);
|
|
3628
3647
|
}
|
|
3629
3648
|
_chooseSplitIndex(t, n, o) {
|
|
3630
|
-
let i,
|
|
3649
|
+
let i, r = 1 / 0, s = 1 / 0;
|
|
3631
3650
|
for (let a = n; a <= o - n; a++) {
|
|
3632
|
-
const l =
|
|
3633
|
-
h <
|
|
3651
|
+
const l = Oe(t, 0, a, this.toBBox), u = Oe(t, a, o, this.toBBox), h = fi(l, u), c = $e(l) + $e(u);
|
|
3652
|
+
h < r ? (r = h, i = a, s = c < s ? c : s) : h === r && c < s && (s = c, i = a);
|
|
3634
3653
|
}
|
|
3635
3654
|
return i || o - n;
|
|
3636
3655
|
}
|
|
3637
3656
|
// sorts node children by the best axis for split
|
|
3638
3657
|
_chooseSplitAxis(t, n, o) {
|
|
3639
|
-
const i = t.leaf ? this.compareMinX :
|
|
3640
|
-
|
|
3658
|
+
const i = t.leaf ? this.compareMinX : ai, r = t.leaf ? this.compareMinY : ci, s = this._allDistMargin(t, n, o, i), a = this._allDistMargin(t, n, o, r);
|
|
3659
|
+
s < a && t.children.sort(i);
|
|
3641
3660
|
}
|
|
3642
3661
|
// total margin of all possible split distributions where each node is at least m full
|
|
3643
3662
|
_allDistMargin(t, n, o, i) {
|
|
3644
3663
|
t.children.sort(i);
|
|
3645
|
-
const
|
|
3646
|
-
let l = Ue(
|
|
3647
|
-
for (let
|
|
3648
|
-
const h = t.children[
|
|
3649
|
-
|
|
3664
|
+
const r = this.toBBox, s = Oe(t, 0, n, r), a = Oe(t, o - n, o, r);
|
|
3665
|
+
let l = Ue(s) + Ue(a);
|
|
3666
|
+
for (let u = n; u < o - n; u++) {
|
|
3667
|
+
const h = t.children[u];
|
|
3668
|
+
ve(s, t.leaf ? r(h) : h), l += Ue(s);
|
|
3650
3669
|
}
|
|
3651
|
-
for (let
|
|
3652
|
-
const h = t.children[
|
|
3653
|
-
|
|
3670
|
+
for (let u = o - n - 1; u >= n; u--) {
|
|
3671
|
+
const h = t.children[u];
|
|
3672
|
+
ve(a, t.leaf ? r(h) : h), l += Ue(a);
|
|
3654
3673
|
}
|
|
3655
3674
|
return l;
|
|
3656
3675
|
}
|
|
3657
3676
|
_adjustParentBBoxes(t, n, o) {
|
|
3658
3677
|
for (let i = o; i >= 0; i--)
|
|
3659
|
-
|
|
3678
|
+
ve(n[i], t);
|
|
3660
3679
|
}
|
|
3661
3680
|
_condense(t) {
|
|
3662
3681
|
for (let n = t.length - 1, o; n >= 0; n--)
|
|
3663
3682
|
t[n].children.length === 0 ? n > 0 ? (o = t[n - 1].children, o.splice(o.indexOf(t[n]), 1)) : this.clear() : we(t[n], this.toBBox);
|
|
3664
3683
|
}
|
|
3665
3684
|
}
|
|
3666
|
-
function
|
|
3685
|
+
function li(e, t, n) {
|
|
3667
3686
|
if (!n)
|
|
3668
3687
|
return t.indexOf(e);
|
|
3669
3688
|
for (let o = 0; o < t.length; o++)
|
|
@@ -3672,23 +3691,23 @@ function ri(e, t, n) {
|
|
|
3672
3691
|
return -1;
|
|
3673
3692
|
}
|
|
3674
3693
|
function we(e, t) {
|
|
3675
|
-
|
|
3694
|
+
Oe(e, 0, e.children.length, t, e);
|
|
3676
3695
|
}
|
|
3677
|
-
function
|
|
3696
|
+
function Oe(e, t, n, o, i) {
|
|
3678
3697
|
i || (i = Ee(null)), i.minX = 1 / 0, i.minY = 1 / 0, i.maxX = -1 / 0, i.maxY = -1 / 0;
|
|
3679
|
-
for (let
|
|
3680
|
-
const
|
|
3681
|
-
|
|
3698
|
+
for (let r = t; r < n; r++) {
|
|
3699
|
+
const s = e.children[r];
|
|
3700
|
+
ve(i, e.leaf ? o(s) : s);
|
|
3682
3701
|
}
|
|
3683
3702
|
return i;
|
|
3684
3703
|
}
|
|
3685
|
-
function
|
|
3704
|
+
function ve(e, t) {
|
|
3686
3705
|
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;
|
|
3687
3706
|
}
|
|
3688
|
-
function
|
|
3707
|
+
function ai(e, t) {
|
|
3689
3708
|
return e.minX - t.minX;
|
|
3690
3709
|
}
|
|
3691
|
-
function
|
|
3710
|
+
function ci(e, t) {
|
|
3692
3711
|
return e.minY - t.minY;
|
|
3693
3712
|
}
|
|
3694
3713
|
function $e(e) {
|
|
@@ -3697,12 +3716,12 @@ function $e(e) {
|
|
|
3697
3716
|
function Ue(e) {
|
|
3698
3717
|
return e.maxX - e.minX + (e.maxY - e.minY);
|
|
3699
3718
|
}
|
|
3700
|
-
function
|
|
3719
|
+
function ui(e, t) {
|
|
3701
3720
|
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));
|
|
3702
3721
|
}
|
|
3703
|
-
function
|
|
3704
|
-
const n = Math.max(e.minX, t.minX), o = Math.max(e.minY, t.minY), i = Math.min(e.maxX, t.maxX),
|
|
3705
|
-
return Math.max(0, i - n) * Math.max(0,
|
|
3722
|
+
function fi(e, t) {
|
|
3723
|
+
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);
|
|
3724
|
+
return Math.max(0, i - n) * Math.max(0, r - o);
|
|
3706
3725
|
}
|
|
3707
3726
|
function et(e, t) {
|
|
3708
3727
|
return e.minX <= t.minX && e.minY <= t.minY && t.maxX <= e.maxX && t.maxY <= e.maxY;
|
|
@@ -3722,82 +3741,82 @@ function Ee(e) {
|
|
|
3722
3741
|
};
|
|
3723
3742
|
}
|
|
3724
3743
|
function Rt(e, t, n, o, i) {
|
|
3725
|
-
const
|
|
3726
|
-
for (;
|
|
3727
|
-
if (n =
|
|
3744
|
+
const r = [t, n];
|
|
3745
|
+
for (; r.length; ) {
|
|
3746
|
+
if (n = r.pop(), t = r.pop(), n - t <= o)
|
|
3728
3747
|
continue;
|
|
3729
|
-
const
|
|
3730
|
-
|
|
3748
|
+
const s = t + Math.ceil((n - t) / o / 2) * o;
|
|
3749
|
+
ii(e, s, t, n, i), r.push(t, s, s, n);
|
|
3731
3750
|
}
|
|
3732
3751
|
}
|
|
3733
|
-
const
|
|
3752
|
+
const di = () => {
|
|
3734
3753
|
const e = new si(), t = /* @__PURE__ */ new Map(), n = () => [...t.values()], o = () => {
|
|
3735
3754
|
e.clear(), t.clear();
|
|
3736
|
-
}, i = (
|
|
3737
|
-
const { minX: m, minY: d, maxX: g, maxY: _ } =
|
|
3738
|
-
e.insert(A), t.set(
|
|
3739
|
-
},
|
|
3740
|
-
const m = t.get(
|
|
3741
|
-
e.remove(m), t.delete(
|
|
3755
|
+
}, i = (c) => {
|
|
3756
|
+
const { minX: m, minY: d, maxX: g, maxY: _ } = c.selector.geometry.bounds, A = { minX: m, minY: d, maxX: g, maxY: _, target: c };
|
|
3757
|
+
e.insert(A), t.set(c.annotation, A);
|
|
3758
|
+
}, r = (c) => {
|
|
3759
|
+
const m = t.get(c.annotation);
|
|
3760
|
+
e.remove(m), t.delete(c.annotation);
|
|
3742
3761
|
};
|
|
3743
3762
|
return {
|
|
3744
3763
|
all: n,
|
|
3745
3764
|
clear: o,
|
|
3746
|
-
getAt: (
|
|
3765
|
+
getAt: (c, m) => {
|
|
3747
3766
|
const g = e.search({
|
|
3748
|
-
minX:
|
|
3767
|
+
minX: c,
|
|
3749
3768
|
minY: m,
|
|
3750
|
-
maxX:
|
|
3769
|
+
maxX: c,
|
|
3751
3770
|
maxY: m
|
|
3752
|
-
}).map((_) => _.target).filter((_) => _.selector.type === z.RECTANGLE ||
|
|
3771
|
+
}).map((_) => _.target).filter((_) => _.selector.type === z.RECTANGLE || mn(_.selector, c, m));
|
|
3753
3772
|
if (g.length > 0)
|
|
3754
3773
|
return g.sort((_, A) => ot(_.selector) - ot(A.selector)), g[0];
|
|
3755
3774
|
},
|
|
3756
|
-
getIntersecting: (
|
|
3757
|
-
minX:
|
|
3775
|
+
getIntersecting: (c, m, d, g) => e.search({
|
|
3776
|
+
minX: c,
|
|
3758
3777
|
minY: m,
|
|
3759
|
-
maxX:
|
|
3778
|
+
maxX: c + d,
|
|
3760
3779
|
maxY: m + g
|
|
3761
3780
|
}).map((_) => _.target),
|
|
3762
3781
|
insert: i,
|
|
3763
|
-
remove:
|
|
3764
|
-
set: (
|
|
3782
|
+
remove: r,
|
|
3783
|
+
set: (c, m = !0) => {
|
|
3765
3784
|
m && o();
|
|
3766
|
-
const d =
|
|
3785
|
+
const d = c.map((g) => {
|
|
3767
3786
|
const { minX: _, minY: A, maxX: w, maxY: y } = g.selector.geometry.bounds;
|
|
3768
3787
|
return { minX: _, minY: A, maxX: w, maxY: y, target: g };
|
|
3769
3788
|
});
|
|
3770
3789
|
d.forEach((g) => t.set(g.target.annotation, g)), e.load(d);
|
|
3771
3790
|
},
|
|
3772
3791
|
size: () => e.all().length,
|
|
3773
|
-
update: (
|
|
3774
|
-
|
|
3792
|
+
update: (c, m) => {
|
|
3793
|
+
r(c), i(m);
|
|
3775
3794
|
}
|
|
3776
3795
|
};
|
|
3777
|
-
},
|
|
3778
|
-
const t =
|
|
3796
|
+
}, hi = (e) => {
|
|
3797
|
+
const t = Fn(), n = di(), o = Pn(t, e.pointerSelectAction), i = Bn(t), r = Kn();
|
|
3779
3798
|
return t.observe(({ changes: l }) => {
|
|
3780
|
-
n.set(l.created.map((
|
|
3799
|
+
n.set(l.created.map((u) => u.target), !1), l.deleted.forEach((u) => n.remove(u.target)), l.updated.forEach(({ oldValue: u, newValue: h }) => n.update(u.target, h.target));
|
|
3781
3800
|
}), {
|
|
3782
3801
|
store: {
|
|
3783
3802
|
...t,
|
|
3784
|
-
getAt: (l,
|
|
3785
|
-
const h = n.getAt(l,
|
|
3803
|
+
getAt: (l, u) => {
|
|
3804
|
+
const h = n.getAt(l, u);
|
|
3786
3805
|
return h ? t.getAnnotation(h.annotation) : void 0;
|
|
3787
3806
|
},
|
|
3788
|
-
getIntersecting: (l,
|
|
3807
|
+
getIntersecting: (l, u, h, c) => n.getIntersecting(l, u, h, c).map((m) => t.getAnnotation(m.annotation))
|
|
3789
3808
|
},
|
|
3790
3809
|
selection: o,
|
|
3791
3810
|
hover: i,
|
|
3792
|
-
viewport:
|
|
3811
|
+
viewport: r
|
|
3793
3812
|
};
|
|
3794
|
-
},
|
|
3795
|
-
const t =
|
|
3813
|
+
}, mi = (e) => {
|
|
3814
|
+
const t = hi(e);
|
|
3796
3815
|
return {
|
|
3797
3816
|
...t,
|
|
3798
|
-
store:
|
|
3817
|
+
store: Hn(t.store)
|
|
3799
3818
|
};
|
|
3800
|
-
},
|
|
3819
|
+
}, gi = (e) => {
|
|
3801
3820
|
let t, n;
|
|
3802
3821
|
if (e.nodeName === "CANVAS")
|
|
3803
3822
|
t = e, n = t.getContext("2d", { willReadFrequently: !0 });
|
|
@@ -3807,70 +3826,75 @@ const fi = () => {
|
|
|
3807
3826
|
}
|
|
3808
3827
|
let o = 0;
|
|
3809
3828
|
for (let i = 1; i < 10; i++)
|
|
3810
|
-
for (let
|
|
3811
|
-
const
|
|
3812
|
-
o +=
|
|
3829
|
+
for (let r = 1; r < 10; r++) {
|
|
3830
|
+
const s = Math.round(r * t.width / 10), a = Math.round(i * t.height / 10), l = n.getImageData(s, a, 1, 1).data, u = (0.299 * l[0] + 0.587 * l[1] + 0.114 * l[2]) / 255;
|
|
3831
|
+
o += u;
|
|
3813
3832
|
}
|
|
3814
3833
|
return o / 81;
|
|
3815
|
-
},
|
|
3816
|
-
const t =
|
|
3834
|
+
}, pi = (e) => {
|
|
3835
|
+
const t = gi(e), n = t > 0.6 ? "dark" : "light";
|
|
3817
3836
|
return console.log(`[Annotorious] Image brightness: ${t.toFixed(1)}. Setting ${n} theme.`), n;
|
|
3818
|
-
}, Ct = (e, t, n) => t.setAttribute("data-theme", n === "auto" ?
|
|
3837
|
+
}, Ct = (e, t, n) => t.setAttribute("data-theme", n === "auto" ? pi(e) : n), yi = (e, t) => ({
|
|
3819
3838
|
...e,
|
|
3820
|
-
drawingEnabled: e.drawingEnabled === void 0 ?
|
|
3821
|
-
drawingMode: e.drawingMode ||
|
|
3822
|
-
pointerSelectAction: e.pointerSelectAction ||
|
|
3823
|
-
theme: e.theme ||
|
|
3824
|
-
}), Ut = navigator.userAgent.indexOf("Mac OS X") !== -1,
|
|
3825
|
-
const n = t || document, o = (
|
|
3826
|
-
|
|
3827
|
-
}, i = (
|
|
3828
|
-
|
|
3829
|
-
},
|
|
3839
|
+
drawingEnabled: e.drawingEnabled === void 0 ? t.drawingEnabled : e.drawingEnabled,
|
|
3840
|
+
drawingMode: e.drawingMode || t.drawingMode,
|
|
3841
|
+
pointerSelectAction: e.pointerSelectAction || t.pointerSelectAction,
|
|
3842
|
+
theme: e.theme || t.theme
|
|
3843
|
+
}), Ut = navigator.userAgent.indexOf("Mac OS X") !== -1, _i = (e, t) => {
|
|
3844
|
+
const n = t || document, o = (s) => {
|
|
3845
|
+
s.key === "Z" && s.ctrlKey ? e.undo() : s.key === "Y" && s.ctrlKey && e.redo();
|
|
3846
|
+
}, i = (s) => {
|
|
3847
|
+
s.key === "z" && s.metaKey && (s.shiftKey ? e.redo() : e.undo());
|
|
3848
|
+
}, r = () => {
|
|
3830
3849
|
Ut ? n.removeEventListener("keydown", i) : n.removeEventListener("keydown", o);
|
|
3831
3850
|
};
|
|
3832
3851
|
return Ut ? n.addEventListener("keydown", i) : n.addEventListener("keydown", o), {
|
|
3833
|
-
destroy:
|
|
3852
|
+
destroy: r
|
|
3834
3853
|
};
|
|
3835
3854
|
};
|
|
3836
|
-
const
|
|
3855
|
+
const Ai = (e, t = {}) => {
|
|
3837
3856
|
if (!e)
|
|
3838
3857
|
throw "Missing argument: image";
|
|
3839
|
-
const n = typeof e == "string" ? document.getElementById(e) : e, o =
|
|
3858
|
+
const n = typeof e == "string" ? document.getElementById(e) : e, o = yi(t, {
|
|
3859
|
+
drawingEnabled: !0,
|
|
3860
|
+
drawingMode: "drag",
|
|
3861
|
+
pointerSelectAction: Kt.EDIT,
|
|
3862
|
+
theme: "light"
|
|
3863
|
+
}), i = mi(o), { selection: r, store: s } = i, a = qn(s), l = Wn(
|
|
3840
3864
|
i,
|
|
3841
3865
|
a,
|
|
3842
3866
|
o.adapter,
|
|
3843
3867
|
o.autoSave
|
|
3844
|
-
),
|
|
3845
|
-
|
|
3846
|
-
const h =
|
|
3847
|
-
let
|
|
3848
|
-
Ct(n,
|
|
3849
|
-
const m = new
|
|
3850
|
-
target:
|
|
3868
|
+
), u = document.createElement("DIV");
|
|
3869
|
+
u.style.position = "relative", u.style.display = "inline-block", n.style.display = "block", n.parentNode.insertBefore(u, n), u.appendChild(n);
|
|
3870
|
+
const h = _i(a);
|
|
3871
|
+
let c = to();
|
|
3872
|
+
Ct(n, u, o.theme);
|
|
3873
|
+
const m = new oi({
|
|
3874
|
+
target: u,
|
|
3851
3875
|
props: {
|
|
3852
3876
|
drawingEnabled: o.drawingEnabled,
|
|
3853
3877
|
image: n,
|
|
3854
3878
|
preferredDrawingMode: o.drawingMode,
|
|
3855
3879
|
state: i,
|
|
3856
3880
|
style: o.style,
|
|
3857
|
-
user:
|
|
3881
|
+
user: c
|
|
3858
3882
|
}
|
|
3859
3883
|
});
|
|
3860
3884
|
m.$on("click", (p) => {
|
|
3861
3885
|
const { originalEvent: E, annotation: b } = p.detail;
|
|
3862
|
-
b ?
|
|
3886
|
+
b ? r.clickSelect(b.id, E) : r.isEmpty() || r.clear();
|
|
3863
3887
|
});
|
|
3864
|
-
const d =
|
|
3865
|
-
m.$destroy(),
|
|
3866
|
-
}, _ = () =>
|
|
3867
|
-
if (!
|
|
3888
|
+
const d = Zn(i, a, o.adapter), g = () => {
|
|
3889
|
+
m.$destroy(), u.parentNode.insertBefore(n, u), u.parentNode.removeChild(u), h.destroy(), a.destroy();
|
|
3890
|
+
}, _ = () => c, A = (p, E, b) => Do(p, E, b), w = (p, E) => po(p, E), y = (p) => {
|
|
3891
|
+
if (!xt(p))
|
|
3868
3892
|
throw `No drawing tool named ${p}`;
|
|
3869
3893
|
m.$set({ toolName: p });
|
|
3870
3894
|
}, T = (p) => m.$set({ drawingEnabled: p }), S = (p) => {
|
|
3871
3895
|
console.warn("Filter not implemented yet");
|
|
3872
|
-
}, P = (p) => m.$set({ style: p }),
|
|
3873
|
-
|
|
3896
|
+
}, P = (p) => m.$set({ style: p }), D = (p) => Ct(n, u, p), U = (p) => {
|
|
3897
|
+
c = p, m.$set({ user: p });
|
|
3874
3898
|
};
|
|
3875
3899
|
return {
|
|
3876
3900
|
...d,
|
|
@@ -3885,50 +3909,50 @@ const Ei = (e, t = {}) => {
|
|
|
3885
3909
|
setDrawingTool: y,
|
|
3886
3910
|
setFilter: S,
|
|
3887
3911
|
setStyle: P,
|
|
3888
|
-
setTheme:
|
|
3912
|
+
setTheme: D,
|
|
3889
3913
|
setUser: U,
|
|
3890
3914
|
state: i
|
|
3891
3915
|
};
|
|
3892
3916
|
};
|
|
3893
3917
|
export {
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3918
|
+
Qt as Editor,
|
|
3919
|
+
Eo as EditorMount,
|
|
3920
|
+
O as Handle,
|
|
3921
|
+
Ei as IdentityTransform,
|
|
3922
|
+
uo as PolygonEditor,
|
|
3923
|
+
go as RectangleEditor,
|
|
3924
|
+
yn as RectangleUtil,
|
|
3925
|
+
Lo as RubberbandRectangle,
|
|
3926
|
+
oi as SVGAnnotationLayer,
|
|
3903
3927
|
z as ShapeType,
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3928
|
+
To as ToolMount,
|
|
3929
|
+
wi as W3CImageFormat,
|
|
3930
|
+
Wo as addEventListeners,
|
|
3907
3931
|
Fe as boundsFromPoints,
|
|
3908
3932
|
ot as computeArea,
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3933
|
+
Ai as createImageAnnotator,
|
|
3934
|
+
hi as createImageAnnotatorState,
|
|
3935
|
+
qo as createSVGTransform,
|
|
3936
|
+
mi as createSvelteImageAnnotatorState,
|
|
3937
|
+
pi as detectTheme,
|
|
3914
3938
|
Ze as distance,
|
|
3915
|
-
|
|
3916
|
-
|
|
3939
|
+
ko as enableResponsive,
|
|
3940
|
+
yi as fillDefaults,
|
|
3917
3941
|
At as getEditor,
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3942
|
+
xt as getTool,
|
|
3943
|
+
_i as initKeyboardCommands,
|
|
3944
|
+
mn as intersects,
|
|
3945
|
+
bi as isTouch,
|
|
3922
3946
|
it as listDrawingTools,
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3947
|
+
_n as parseFragmentSelector,
|
|
3948
|
+
Sn as parseSVGSelector,
|
|
3949
|
+
ro as parseW3CImageAnnotation,
|
|
3950
|
+
po as registerEditor,
|
|
3927
3951
|
lt as registerShapeUtil,
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3952
|
+
Do as registerTool,
|
|
3953
|
+
gi as sampleBrightness,
|
|
3954
|
+
wn as serializeFragmentSelector,
|
|
3955
|
+
Mn as serializeSVGSelector,
|
|
3932
3956
|
so as serializeW3CImageAnnotation,
|
|
3933
3957
|
Ct as setTheme
|
|
3934
3958
|
};
|