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