@annotorious/svelte 3.0.0-rc.21 → 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-svelte.es.js +14 -17
- package/dist/annotorious-svelte.es.js.map +1 -1
- package/dist/annotorious-svelte.es10.js +119 -23
- package/dist/annotorious-svelte.es10.js.map +1 -1
- package/dist/annotorious-svelte.es11.js +2 -111
- package/dist/annotorious-svelte.es11.js.map +1 -1
- package/dist/annotorious-svelte.es12.js +19 -2
- package/dist/annotorious-svelte.es12.js.map +1 -1
- package/dist/annotorious-svelte.es13.js +4 -2
- package/dist/annotorious-svelte.es13.js.map +1 -1
- package/dist/annotorious-svelte.es14.js +6 -27434
- package/dist/annotorious-svelte.es14.js.map +1 -1
- package/dist/annotorious-svelte.es15.js +6 -119
- package/dist/annotorious-svelte.es15.js.map +1 -1
- package/dist/annotorious-svelte.es2.js +25 -30
- package/dist/annotorious-svelte.es2.js.map +1 -1
- package/dist/annotorious-svelte.es3.js +2 -95
- package/dist/annotorious-svelte.es3.js.map +1 -1
- package/dist/annotorious-svelte.es4.js +8 -4238
- package/dist/annotorious-svelte.es4.js.map +1 -1
- package/dist/annotorious-svelte.es5.js +1263 -86
- package/dist/annotorious-svelte.es5.js.map +1 -1
- package/dist/annotorious-svelte.es6.js +86 -104
- package/dist/annotorious-svelte.es6.js.map +1 -1
- package/dist/annotorious-svelte.es7.js +118 -92
- package/dist/annotorious-svelte.es7.js.map +1 -1
- package/dist/annotorious-svelte.es8.js +303 -31
- package/dist/annotorious-svelte.es8.js.map +1 -1
- package/dist/annotorious-svelte.es9.js +20115 -21
- package/dist/annotorious-svelte.es9.js.map +1 -1
- package/dist/index.d.ts +8 -11
- package/dist/index.d.ts.map +1 -1
- package/package.json +11 -22
- package/src/index.ts +21 -40
- package/vite.config.js +0 -1
- package/dist/annotorious-svelte.es16.js +0 -2
- package/dist/annotorious-svelte.es16.js.map +0 -1
- package/dist/annotorious-svelte.es17.js +0 -59
- package/dist/annotorious-svelte.es17.js.map +0 -1
- /package/dist/{annotorious-svelte.css → style.css} +0 -0
|
@@ -1,117 +1,1294 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
function xt() {
|
|
2
|
+
}
|
|
3
|
+
function qt(t, n) {
|
|
4
|
+
for (const r in n)
|
|
5
|
+
t[r] = n[r];
|
|
6
|
+
return t;
|
|
7
|
+
}
|
|
8
|
+
function Yt(t) {
|
|
9
|
+
return t();
|
|
10
|
+
}
|
|
11
|
+
function Mt() {
|
|
12
|
+
return /* @__PURE__ */ Object.create(null);
|
|
13
|
+
}
|
|
14
|
+
function z(t) {
|
|
15
|
+
t.forEach(Yt);
|
|
16
|
+
}
|
|
17
|
+
function _(t) {
|
|
18
|
+
return typeof t == "function";
|
|
19
|
+
}
|
|
20
|
+
function Et(t, n) {
|
|
21
|
+
return t != t ? n == n : t !== n || t && typeof t == "object" || typeof t == "function";
|
|
22
|
+
}
|
|
23
|
+
function Jt(t) {
|
|
24
|
+
return Object.keys(t).length === 0;
|
|
25
|
+
}
|
|
26
|
+
function Qt(t, n, r, o) {
|
|
27
|
+
if (t) {
|
|
28
|
+
const s = jt(t, n, r, o);
|
|
29
|
+
return t[0](s);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function jt(t, n, r, o) {
|
|
33
|
+
return t[1] && o ? qt(r.ctx.slice(), t[1](o(n))) : r.ctx;
|
|
34
|
+
}
|
|
35
|
+
function Zt(t, n, r, o) {
|
|
36
|
+
if (t[2] && o) {
|
|
37
|
+
const s = t[2](o(r));
|
|
38
|
+
if (n.dirty === void 0)
|
|
39
|
+
return s;
|
|
40
|
+
if (typeof s == "object") {
|
|
41
|
+
const a = [], c = Math.max(n.dirty.length, s.length);
|
|
42
|
+
for (let l = 0; l < c; l += 1)
|
|
43
|
+
a[l] = n.dirty[l] | s[l];
|
|
44
|
+
return a;
|
|
45
|
+
}
|
|
46
|
+
return n.dirty | s;
|
|
47
|
+
}
|
|
48
|
+
return n.dirty;
|
|
49
|
+
}
|
|
50
|
+
function Kt(t, n, r, o, s, a) {
|
|
51
|
+
if (s) {
|
|
52
|
+
const c = jt(n, r, o, a);
|
|
53
|
+
t.p(c, s);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function Rt(t) {
|
|
57
|
+
if (t.ctx.length > 32) {
|
|
58
|
+
const n = [], r = t.ctx.length / 32;
|
|
59
|
+
for (let o = 0; o < r; o++)
|
|
60
|
+
n[o] = -1;
|
|
61
|
+
return n;
|
|
62
|
+
}
|
|
63
|
+
return -1;
|
|
64
|
+
}
|
|
65
|
+
function T(t, n, r) {
|
|
66
|
+
t.insertBefore(n, r || null);
|
|
67
|
+
}
|
|
68
|
+
function x(t) {
|
|
69
|
+
t.parentNode && t.parentNode.removeChild(t);
|
|
70
|
+
}
|
|
71
|
+
function tn(t, n) {
|
|
72
|
+
for (let r = 0; r < t.length; r += 1)
|
|
73
|
+
t[r] && t[r].d(n);
|
|
74
|
+
}
|
|
75
|
+
function L(t) {
|
|
76
|
+
return document.createElementNS("http://www.w3.org/2000/svg", t);
|
|
77
|
+
}
|
|
78
|
+
function Ot(t) {
|
|
79
|
+
return document.createTextNode(t);
|
|
80
|
+
}
|
|
81
|
+
function U() {
|
|
82
|
+
return Ot(" ");
|
|
83
|
+
}
|
|
84
|
+
function nn() {
|
|
85
|
+
return Ot("");
|
|
86
|
+
}
|
|
87
|
+
function A(t, n, r, o) {
|
|
88
|
+
return t.addEventListener(n, r, o), () => t.removeEventListener(n, r, o);
|
|
89
|
+
}
|
|
90
|
+
function e(t, n, r) {
|
|
91
|
+
r == null ? t.removeAttribute(n) : t.getAttribute(n) !== r && t.setAttribute(n, r);
|
|
92
|
+
}
|
|
93
|
+
function rn(t) {
|
|
94
|
+
return Array.from(t.childNodes);
|
|
95
|
+
}
|
|
96
|
+
function on(t, n, { bubbles: r = !1, cancelable: o = !1 } = {}) {
|
|
97
|
+
const s = document.createEvent("CustomEvent");
|
|
98
|
+
return s.initCustomEvent(t, r, o, n), s;
|
|
99
|
+
}
|
|
100
|
+
let Q;
|
|
101
|
+
function J(t) {
|
|
102
|
+
Q = t;
|
|
103
|
+
}
|
|
104
|
+
function en() {
|
|
105
|
+
if (!Q)
|
|
106
|
+
throw new Error("Function called outside component initialization");
|
|
107
|
+
return Q;
|
|
108
|
+
}
|
|
109
|
+
function sn() {
|
|
110
|
+
const t = en();
|
|
111
|
+
return (n, r, { cancelable: o = !1 } = {}) => {
|
|
112
|
+
const s = t.$$.callbacks[n];
|
|
113
|
+
if (s) {
|
|
114
|
+
const a = on(n, r, { cancelable: o });
|
|
115
|
+
return s.slice().forEach((c) => {
|
|
116
|
+
c.call(t, a);
|
|
117
|
+
}), !a.defaultPrevented;
|
|
118
|
+
}
|
|
119
|
+
return !0;
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function V(t, n) {
|
|
123
|
+
const r = t.$$.callbacks[n.type];
|
|
124
|
+
r && r.slice().forEach((o) => o.call(this, n));
|
|
125
|
+
}
|
|
126
|
+
const W = [], It = [];
|
|
127
|
+
let q = [];
|
|
128
|
+
const Ft = [], an = /* @__PURE__ */ Promise.resolve();
|
|
129
|
+
let wt = !1;
|
|
130
|
+
function cn() {
|
|
131
|
+
wt || (wt = !0, an.then(Xt));
|
|
132
|
+
}
|
|
133
|
+
function Tt(t) {
|
|
134
|
+
q.push(t);
|
|
135
|
+
}
|
|
136
|
+
const $t = /* @__PURE__ */ new Set();
|
|
137
|
+
let D = 0;
|
|
138
|
+
function Xt() {
|
|
139
|
+
if (D !== 0)
|
|
140
|
+
return;
|
|
141
|
+
const t = Q;
|
|
142
|
+
do {
|
|
143
|
+
try {
|
|
144
|
+
for (; D < W.length; ) {
|
|
145
|
+
const n = W[D];
|
|
146
|
+
D++, J(n), ln(n.$$);
|
|
147
|
+
}
|
|
148
|
+
} catch (n) {
|
|
149
|
+
throw W.length = 0, D = 0, n;
|
|
150
|
+
}
|
|
151
|
+
for (J(null), W.length = 0, D = 0; It.length; )
|
|
152
|
+
It.pop()();
|
|
153
|
+
for (let n = 0; n < q.length; n += 1) {
|
|
154
|
+
const r = q[n];
|
|
155
|
+
$t.has(r) || ($t.add(r), r());
|
|
156
|
+
}
|
|
157
|
+
q.length = 0;
|
|
158
|
+
} while (W.length);
|
|
159
|
+
for (; Ft.length; )
|
|
160
|
+
Ft.pop()();
|
|
161
|
+
wt = !1, $t.clear(), J(t);
|
|
162
|
+
}
|
|
163
|
+
function ln(t) {
|
|
164
|
+
if (t.fragment !== null) {
|
|
165
|
+
t.update(), z(t.before_update);
|
|
166
|
+
const n = t.dirty;
|
|
167
|
+
t.dirty = [-1], t.fragment && t.fragment.p(t.ctx, n), t.after_update.forEach(Tt);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
function pn(t) {
|
|
171
|
+
const n = [], r = [];
|
|
172
|
+
q.forEach((o) => t.indexOf(o) === -1 ? n.push(o) : r.push(o)), r.forEach((o) => o()), q = n;
|
|
173
|
+
}
|
|
174
|
+
const pt = /* @__PURE__ */ new Set();
|
|
175
|
+
let un;
|
|
176
|
+
function ut(t, n) {
|
|
177
|
+
t && t.i && (pt.delete(t), t.i(n));
|
|
178
|
+
}
|
|
179
|
+
function bt(t, n, r, o) {
|
|
180
|
+
if (t && t.o) {
|
|
181
|
+
if (pt.has(t))
|
|
182
|
+
return;
|
|
183
|
+
pt.add(t), un.c.push(() => {
|
|
184
|
+
pt.delete(t), o && (r && t.d(1), o());
|
|
185
|
+
}), t.o(n);
|
|
186
|
+
} else
|
|
187
|
+
o && o();
|
|
188
|
+
}
|
|
189
|
+
function zt(t) {
|
|
190
|
+
t && t.c();
|
|
191
|
+
}
|
|
192
|
+
function St(t, n, r, o) {
|
|
193
|
+
const { fragment: s, after_update: a } = t.$$;
|
|
194
|
+
s && s.m(n, r), o || Tt(() => {
|
|
195
|
+
const c = t.$$.on_mount.map(Yt).filter(_);
|
|
196
|
+
t.$$.on_destroy ? t.$$.on_destroy.push(...c) : z(c), t.$$.on_mount = [];
|
|
197
|
+
}), a.forEach(Tt);
|
|
198
|
+
}
|
|
199
|
+
function vt(t, n) {
|
|
200
|
+
const r = t.$$;
|
|
201
|
+
r.fragment !== null && (pn(r.after_update), z(r.on_destroy), r.fragment && r.fragment.d(n), r.on_destroy = r.fragment = null, r.ctx = []);
|
|
202
|
+
}
|
|
203
|
+
function hn(t, n) {
|
|
204
|
+
t.$$.dirty[0] === -1 && (W.push(t), cn(), t.$$.dirty.fill(0)), t.$$.dirty[n / 31 | 0] |= 1 << n % 31;
|
|
205
|
+
}
|
|
206
|
+
function Pt(t, n, r, o, s, a, c, l = [-1]) {
|
|
207
|
+
const p = Q;
|
|
208
|
+
J(t);
|
|
209
|
+
const f = t.$$ = {
|
|
210
|
+
fragment: null,
|
|
211
|
+
ctx: [],
|
|
212
|
+
// state
|
|
213
|
+
props: a,
|
|
214
|
+
update: xt,
|
|
215
|
+
not_equal: s,
|
|
216
|
+
bound: Mt(),
|
|
217
|
+
// lifecycle
|
|
218
|
+
on_mount: [],
|
|
219
|
+
on_destroy: [],
|
|
220
|
+
on_disconnect: [],
|
|
221
|
+
before_update: [],
|
|
222
|
+
after_update: [],
|
|
223
|
+
context: new Map(n.context || (p ? p.$$.context : [])),
|
|
224
|
+
// everything else
|
|
225
|
+
callbacks: Mt(),
|
|
226
|
+
dirty: l,
|
|
227
|
+
skip_bound: !1,
|
|
228
|
+
root: n.target || p.$$.root
|
|
229
|
+
};
|
|
230
|
+
c && c(f.root);
|
|
231
|
+
let w = !1;
|
|
232
|
+
if (f.ctx = r ? r(t, n.props || {}, ($, m, ...i) => {
|
|
233
|
+
const y = i.length ? i[0] : m;
|
|
234
|
+
return f.ctx && s(f.ctx[$], f.ctx[$] = y) && (!f.skip_bound && f.bound[$] && f.bound[$](y), w && hn(t, $)), m;
|
|
235
|
+
}) : [], f.update(), w = !0, z(f.before_update), f.fragment = o ? o(f.ctx) : !1, n.target) {
|
|
236
|
+
if (n.hydrate) {
|
|
237
|
+
const $ = rn(n.target);
|
|
238
|
+
f.fragment && f.fragment.l($), $.forEach(x);
|
|
239
|
+
} else
|
|
240
|
+
f.fragment && f.fragment.c();
|
|
241
|
+
n.intro && ut(t.$$.fragment), St(t, n.target, n.anchor, n.customElement), Xt();
|
|
242
|
+
}
|
|
243
|
+
J(p);
|
|
244
|
+
}
|
|
245
|
+
class _t {
|
|
246
|
+
$destroy() {
|
|
247
|
+
vt(this, 1), this.$destroy = xt;
|
|
248
|
+
}
|
|
249
|
+
$on(n, r) {
|
|
250
|
+
if (!_(r))
|
|
251
|
+
return xt;
|
|
252
|
+
const o = this.$$.callbacks[n] || (this.$$.callbacks[n] = []);
|
|
253
|
+
return o.push(r), () => {
|
|
254
|
+
const s = o.indexOf(r);
|
|
255
|
+
s !== -1 && o.splice(s, 1);
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
$set(n) {
|
|
259
|
+
this.$$set && !Jt(n) && (this.$$.skip_bound = !0, this.$$set(n), this.$$.skip_bound = !1);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
var B = /* @__PURE__ */ ((t) => (t.ELLIPSE = "ELLIPSE", t.POLYGON = "POLYGON", t.RECTANGLE = "RECTANGLE", t))(B || {});
|
|
263
|
+
const At = (t, n) => n, Dt = (t) => {
|
|
264
|
+
let n = 1 / 0, r = 1 / 0, o = -1 / 0, s = -1 / 0;
|
|
265
|
+
return t.forEach(([a, c]) => {
|
|
266
|
+
n = Math.min(n, a), r = Math.min(r, c), o = Math.max(o, a), s = Math.max(s, c);
|
|
267
|
+
}), { minX: n, minY: r, maxX: o, maxY: s };
|
|
268
|
+
}, dn = {
|
|
269
|
+
area: (t) => Math.PI * t.geometry.rx * t.geometry.ry,
|
|
270
|
+
intersects: (t, n, r) => {
|
|
271
|
+
const { cx: o, cy: s, rx: a, ry: c } = t.geometry, l = 0, p = Math.cos(l), f = Math.sin(l), w = n - o, $ = r - s, m = p * w + f * $, i = f * w - p * $;
|
|
272
|
+
return m * m / (a * a) + i * i / (c * c) <= 1;
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
At(B.ELLIPSE, dn);
|
|
276
|
+
const fn = {
|
|
277
|
+
area: (t) => {
|
|
278
|
+
const { points: n } = t.geometry;
|
|
279
|
+
let r = 0, o = n.length - 1;
|
|
280
|
+
for (let s = 0; s < n.length; s++)
|
|
281
|
+
r += (n[o][0] + n[s][0]) * (n[o][1] - n[s][1]), o = s;
|
|
282
|
+
return Math.abs(0.5 * r);
|
|
283
|
+
},
|
|
284
|
+
intersects: (t, n, r) => {
|
|
285
|
+
const { points: o } = t.geometry;
|
|
286
|
+
let s = !1;
|
|
287
|
+
for (let a = 0, c = o.length - 1; a < o.length; c = a++) {
|
|
288
|
+
const l = o[a][0], p = o[a][1], f = o[c][0], w = o[c][1];
|
|
289
|
+
p > r != w > r && n < (f - l) * (r - p) / (w - p) + l && (s = !s);
|
|
290
|
+
}
|
|
291
|
+
return s;
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
At(B.POLYGON, fn);
|
|
295
|
+
const yn = {
|
|
296
|
+
area: (t) => t.geometry.w * t.geometry.h,
|
|
297
|
+
intersects: (t, n, r) => n >= t.geometry.x && n <= t.geometry.x + t.geometry.w && r >= t.geometry.y && r <= t.geometry.y + t.geometry.h
|
|
298
|
+
};
|
|
299
|
+
At(B.RECTANGLE, yn);
|
|
300
|
+
const gn = (t, n = !1) => {
|
|
301
|
+
const r = typeof t == "string" ? t : t.value, o = /^(xywh)=(pixel|percent)?:?(.+?),(.+?),(.+?),(.+)*/g, s = [...r.matchAll(o)][0], [a, c, l, p, f, w, $] = s;
|
|
302
|
+
if (c !== "xywh")
|
|
303
|
+
throw new Error("Unsupported MediaFragment: " + r);
|
|
304
|
+
if (l && l !== "pixel")
|
|
305
|
+
throw new Error(`Unsupported MediaFragment unit: ${l}`);
|
|
306
|
+
const [m, i, y, h] = [p, f, w, $].map(parseFloat);
|
|
307
|
+
return {
|
|
308
|
+
type: B.RECTANGLE,
|
|
309
|
+
geometry: {
|
|
310
|
+
x: m,
|
|
311
|
+
y: i,
|
|
312
|
+
w: y,
|
|
313
|
+
h,
|
|
314
|
+
bounds: {
|
|
315
|
+
minX: m,
|
|
316
|
+
minY: n ? i - h : i,
|
|
317
|
+
maxX: m + y,
|
|
318
|
+
maxY: n ? i : i + h
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
}, mn = (t) => {
|
|
323
|
+
const { x: n, y: r, w: o, h: s } = t;
|
|
324
|
+
return {
|
|
325
|
+
type: "FragmentSelector",
|
|
326
|
+
conformsTo: "http://www.w3.org/TR/media-frags/",
|
|
327
|
+
value: `xywh=pixel:${n},${r},${o},${s}`
|
|
328
|
+
};
|
|
329
|
+
}, Wt = "http://www.w3.org/2000/svg", Ht = (t) => {
|
|
330
|
+
const n = (o) => {
|
|
331
|
+
Array.from(o.attributes).forEach((s) => {
|
|
332
|
+
s.name.startsWith("on") && o.removeAttribute(s.name);
|
|
333
|
+
});
|
|
334
|
+
}, r = t.getElementsByTagName("script");
|
|
335
|
+
return Array.from(r).reverse().forEach((o) => o.parentNode.removeChild(o)), Array.from(t.querySelectorAll("*")).forEach(n), t;
|
|
336
|
+
}, $n = (t) => {
|
|
337
|
+
const n = new XMLSerializer().serializeToString(t.documentElement).replace("<svg>", `<svg xmlns="${Wt}">`);
|
|
338
|
+
return new DOMParser().parseFromString(n, "image/svg+xml").documentElement;
|
|
339
|
+
}, xn = (t) => {
|
|
340
|
+
const n = new DOMParser().parseFromString(t, "image/svg+xml"), r = n.lookupPrefix(Wt), o = n.lookupNamespaceURI(null);
|
|
341
|
+
return r || o ? Ht(n).firstChild : Ht($n(n)).firstChild;
|
|
342
|
+
}, wn = (t) => {
|
|
343
|
+
const [n, r, o] = t.match(/(<polygon points=["|'])([^("|')]*)/) || [];
|
|
344
|
+
if (!o)
|
|
345
|
+
return;
|
|
346
|
+
const s = o.split(" ").map((a) => a.split(",").map(parseFloat));
|
|
347
|
+
return {
|
|
348
|
+
type: B.POLYGON,
|
|
349
|
+
geometry: {
|
|
350
|
+
points: s,
|
|
351
|
+
bounds: Dt(s)
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
}, Tn = (t) => {
|
|
355
|
+
const n = xn(t), r = parseFloat(n.getAttribute("cx")), o = parseFloat(n.getAttribute("cy")), s = parseFloat(n.getAttribute("rx")), a = parseFloat(n.getAttribute("ry")), c = {
|
|
356
|
+
minX: r - s,
|
|
357
|
+
minY: o - a,
|
|
358
|
+
maxX: r + s,
|
|
359
|
+
maxY: o + a
|
|
360
|
+
};
|
|
361
|
+
return {
|
|
362
|
+
type: B.ELLIPSE,
|
|
363
|
+
geometry: {
|
|
364
|
+
cx: r,
|
|
365
|
+
cy: o,
|
|
366
|
+
rx: s,
|
|
367
|
+
ry: a,
|
|
368
|
+
bounds: c
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
}, En = (t) => {
|
|
372
|
+
const n = typeof t == "string" ? t : t.value;
|
|
373
|
+
if (n.includes("<polygon points="))
|
|
374
|
+
return wn(n);
|
|
375
|
+
if (n.includes("<ellipse "))
|
|
376
|
+
return Tn(n);
|
|
377
|
+
}, bn = (t) => {
|
|
378
|
+
let n;
|
|
379
|
+
if (t.type === B.POLYGON) {
|
|
380
|
+
const r = t.geometry, { points: o } = r;
|
|
381
|
+
n = `<svg><polygon points="${o.map((s) => s.join(",")).join(" ")}" /></svg>`;
|
|
382
|
+
} else if (t.type === B.ELLIPSE) {
|
|
383
|
+
const r = t.geometry;
|
|
384
|
+
n = `<svg><ellipse cx="${r.cx}" cy="${r.cy}" rx="${r.rx}" ry="${r.ry}" /></svg>`;
|
|
385
|
+
}
|
|
386
|
+
if (n)
|
|
387
|
+
return { type: "SvgSelector", value: n };
|
|
388
|
+
throw `Unsupported shape type: ${t.type}`;
|
|
389
|
+
};
|
|
390
|
+
let lt;
|
|
391
|
+
const Sn = new Uint8Array(16);
|
|
392
|
+
function vn() {
|
|
393
|
+
if (!lt && (lt = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !lt))
|
|
394
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
395
|
+
return lt(Sn);
|
|
396
|
+
}
|
|
397
|
+
const S = [];
|
|
398
|
+
for (let t = 0; t < 256; ++t)
|
|
399
|
+
S.push((t + 256).toString(16).slice(1));
|
|
400
|
+
function Pn(t, n = 0) {
|
|
401
|
+
return S[t[n + 0]] + S[t[n + 1]] + S[t[n + 2]] + S[t[n + 3]] + "-" + S[t[n + 4]] + S[t[n + 5]] + "-" + S[t[n + 6]] + S[t[n + 7]] + "-" + S[t[n + 8]] + S[t[n + 9]] + "-" + S[t[n + 10]] + S[t[n + 11]] + S[t[n + 12]] + S[t[n + 13]] + S[t[n + 14]] + S[t[n + 15]];
|
|
402
|
+
}
|
|
403
|
+
const _n = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Gt = {
|
|
404
|
+
randomUUID: _n
|
|
405
|
+
};
|
|
406
|
+
function An(t, n, r) {
|
|
407
|
+
if (Gt.randomUUID && !n && !t)
|
|
408
|
+
return Gt.randomUUID();
|
|
409
|
+
t = t || {};
|
|
410
|
+
const o = t.random || (t.rng || vn)();
|
|
411
|
+
if (o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, n) {
|
|
412
|
+
r = r || 0;
|
|
413
|
+
for (let s = 0; s < 16; ++s)
|
|
414
|
+
n[r + s] = o[s];
|
|
415
|
+
return n;
|
|
416
|
+
}
|
|
417
|
+
return Pn(o);
|
|
418
|
+
}
|
|
419
|
+
let Ln = (t = 21) => crypto.getRandomValues(new Uint8Array(t)).reduce((n, r) => (r &= 63, r < 36 ? n += r.toString(36) : r < 62 ? n += (r - 26).toString(36).toUpperCase() : r > 62 ? n += "-" : n += "_", n), "");
|
|
420
|
+
const Mn = (t) => {
|
|
421
|
+
const n = JSON.stringify(t);
|
|
422
|
+
let r = 0;
|
|
423
|
+
for (let o = 0, s = n.length; o < s; o++) {
|
|
424
|
+
let a = n.charCodeAt(o);
|
|
425
|
+
r = (r << 5) - r + a, r |= 0;
|
|
426
|
+
}
|
|
427
|
+
return `${r}`;
|
|
428
|
+
}, In = (t, n) => (Array.isArray(t) ? t : [t]).map((r) => {
|
|
429
|
+
const { id: o, type: s, purpose: a, value: c, created: l, creator: p, ...f } = r;
|
|
430
|
+
return {
|
|
431
|
+
id: o || `temp-${Mn(r)}`,
|
|
432
|
+
annotation: n,
|
|
433
|
+
type: s,
|
|
434
|
+
purpose: a,
|
|
435
|
+
value: c,
|
|
436
|
+
created: l,
|
|
437
|
+
creator: p ? typeof p == "object" ? { ...p } : p : void 0,
|
|
438
|
+
...f
|
|
439
|
+
};
|
|
440
|
+
}), Fn = (t) => t.map((n) => {
|
|
441
|
+
var r;
|
|
442
|
+
const o = { ...n };
|
|
443
|
+
return delete o.annotation, (r = o.id) != null && r.startsWith("temp-") && delete o.id, o;
|
|
444
|
+
});
|
|
445
|
+
Ln();
|
|
446
|
+
const Wn = (t, n = !1) => ({ parse: (r) => Hn(r, n), serialize: (r) => Gn(r, t) }), Hn = (t, n = !1) => {
|
|
447
|
+
const r = t.id || An(), { body: o, ...s } = t, a = In(o, r), c = Array.isArray(t.target) ? t.target[0] : t.target, l = Array.isArray(c.selector) ? c.selector[0] : c.selector, p = l.type === "FragmentSelector" ? gn(l, n) : l.type === "SvgSelector" ? En(l) : void 0;
|
|
448
|
+
return p ? {
|
|
449
|
+
parsed: {
|
|
450
|
+
...s,
|
|
451
|
+
id: r,
|
|
452
|
+
bodies: a,
|
|
453
|
+
target: {
|
|
454
|
+
annotation: r,
|
|
455
|
+
selector: p
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
} : {
|
|
459
|
+
error: Error(`Unknown selector type: ${l.type}`)
|
|
460
|
+
};
|
|
461
|
+
}, Gn = (t, n) => {
|
|
462
|
+
const r = t.target.selector, o = r.type == B.RECTANGLE ? mn(r.geometry) : bn(r);
|
|
463
|
+
return {
|
|
464
|
+
...t,
|
|
465
|
+
"@context": "http://www.w3.org/ns/anno.jsonld",
|
|
466
|
+
id: t.id,
|
|
467
|
+
type: "Annotation",
|
|
468
|
+
body: Fn(t.bodies),
|
|
469
|
+
target: {
|
|
470
|
+
source: n,
|
|
471
|
+
selector: o
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
};
|
|
475
|
+
function Nt(t, n, r) {
|
|
476
|
+
const o = t.slice();
|
|
477
|
+
return o[11] = n[r], o[13] = r, o;
|
|
478
|
+
}
|
|
479
|
+
function Bt(t) {
|
|
480
|
+
let n, r, o, s, a;
|
|
21
481
|
return {
|
|
22
482
|
c() {
|
|
23
|
-
|
|
483
|
+
n = L("rect"), e(n, "class", "a9s-corner-handle"), e(n, "x", r = /*point*/
|
|
484
|
+
t[11][0] - /*handleSize*/
|
|
485
|
+
t[3] / 2), e(n, "y", o = /*point*/
|
|
486
|
+
t[11][1] - /*handleSize*/
|
|
487
|
+
t[3] / 2), e(
|
|
488
|
+
n,
|
|
489
|
+
"height",
|
|
490
|
+
/*handleSize*/
|
|
491
|
+
t[3]
|
|
492
|
+
), e(
|
|
493
|
+
n,
|
|
494
|
+
"width",
|
|
495
|
+
/*handleSize*/
|
|
496
|
+
t[3]
|
|
497
|
+
);
|
|
24
498
|
},
|
|
25
|
-
m(
|
|
26
|
-
|
|
499
|
+
m(c, l) {
|
|
500
|
+
T(c, n, l), s || (a = A(n, "pointerdown", function() {
|
|
501
|
+
_(
|
|
502
|
+
/*grab*/
|
|
503
|
+
t[10](d(
|
|
504
|
+
/*idx*/
|
|
505
|
+
t[13]
|
|
506
|
+
))
|
|
507
|
+
) && t[10](d(
|
|
508
|
+
/*idx*/
|
|
509
|
+
t[13]
|
|
510
|
+
)).apply(this, arguments);
|
|
511
|
+
}), s = !0);
|
|
27
512
|
},
|
|
28
|
-
p(
|
|
29
|
-
t
|
|
30
|
-
|
|
31
|
-
|
|
513
|
+
p(c, l) {
|
|
514
|
+
t = c, l & /*geom, handleSize*/
|
|
515
|
+
24 && r !== (r = /*point*/
|
|
516
|
+
t[11][0] - /*handleSize*/
|
|
517
|
+
t[3] / 2) && e(n, "x", r), l & /*geom, handleSize*/
|
|
518
|
+
24 && o !== (o = /*point*/
|
|
519
|
+
t[11][1] - /*handleSize*/
|
|
520
|
+
t[3] / 2) && e(n, "y", o), l & /*handleSize*/
|
|
521
|
+
8 && e(
|
|
32
522
|
n,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
) : k(
|
|
43
|
-
/*$$scope*/
|
|
44
|
-
e[3]
|
|
45
|
-
),
|
|
46
|
-
null
|
|
523
|
+
"height",
|
|
524
|
+
/*handleSize*/
|
|
525
|
+
t[3]
|
|
526
|
+
), l & /*handleSize*/
|
|
527
|
+
8 && e(
|
|
528
|
+
n,
|
|
529
|
+
"width",
|
|
530
|
+
/*handleSize*/
|
|
531
|
+
t[3]
|
|
47
532
|
);
|
|
48
533
|
},
|
|
49
|
-
|
|
50
|
-
|
|
534
|
+
d(c) {
|
|
535
|
+
c && x(n), s = !1, a();
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
function Nn(t) {
|
|
540
|
+
let n, r, o, s, a, c, l, p, f, w, $ = (
|
|
541
|
+
/*geom*/
|
|
542
|
+
t[4].points
|
|
543
|
+
), m = [];
|
|
544
|
+
for (let i = 0; i < $.length; i += 1)
|
|
545
|
+
m[i] = Bt(Nt(t, $, i));
|
|
546
|
+
return {
|
|
547
|
+
c() {
|
|
548
|
+
n = L("polygon"), s = U(), a = L("polygon"), l = U();
|
|
549
|
+
for (let i = 0; i < m.length; i += 1)
|
|
550
|
+
m[i].c();
|
|
551
|
+
p = nn(), e(n, "class", "a9s-outer"), e(n, "style", r = /*computedStyle*/
|
|
552
|
+
t[1] ? "display:none;" : void 0), e(n, "points", o = /*geom*/
|
|
553
|
+
t[4].points.map(Ct).join(" ")), e(a, "class", "a9s-inner a9s-shape-handle"), e(
|
|
554
|
+
a,
|
|
555
|
+
"style",
|
|
556
|
+
/*computedStyle*/
|
|
557
|
+
t[1]
|
|
558
|
+
), e(a, "points", c = /*geom*/
|
|
559
|
+
t[4].points.map(Ut).join(" "));
|
|
560
|
+
},
|
|
561
|
+
m(i, y) {
|
|
562
|
+
T(i, n, y), T(i, s, y), T(i, a, y), T(i, l, y);
|
|
563
|
+
for (let h = 0; h < m.length; h += 1)
|
|
564
|
+
m[h] && m[h].m(i, y);
|
|
565
|
+
T(i, p, y), f || (w = [
|
|
566
|
+
A(n, "pointerdown", function() {
|
|
567
|
+
_(
|
|
568
|
+
/*grab*/
|
|
569
|
+
t[10](d.SHAPE)
|
|
570
|
+
) && t[10](d.SHAPE).apply(this, arguments);
|
|
571
|
+
}),
|
|
572
|
+
A(a, "pointerdown", function() {
|
|
573
|
+
_(
|
|
574
|
+
/*grab*/
|
|
575
|
+
t[10](d.SHAPE)
|
|
576
|
+
) && t[10](d.SHAPE).apply(this, arguments);
|
|
577
|
+
})
|
|
578
|
+
], f = !0);
|
|
51
579
|
},
|
|
52
|
-
|
|
53
|
-
|
|
580
|
+
p(i, y) {
|
|
581
|
+
if (t = i, y & /*computedStyle*/
|
|
582
|
+
2 && r !== (r = /*computedStyle*/
|
|
583
|
+
t[1] ? "display:none;" : void 0) && e(n, "style", r), y & /*geom*/
|
|
584
|
+
16 && o !== (o = /*geom*/
|
|
585
|
+
t[4].points.map(Ct).join(" ")) && e(n, "points", o), y & /*computedStyle*/
|
|
586
|
+
2 && e(
|
|
587
|
+
a,
|
|
588
|
+
"style",
|
|
589
|
+
/*computedStyle*/
|
|
590
|
+
t[1]
|
|
591
|
+
), y & /*geom*/
|
|
592
|
+
16 && c !== (c = /*geom*/
|
|
593
|
+
t[4].points.map(Ut).join(" ")) && e(a, "points", c), y & /*geom, handleSize, grab, Handle*/
|
|
594
|
+
1048) {
|
|
595
|
+
$ = /*geom*/
|
|
596
|
+
t[4].points;
|
|
597
|
+
let h;
|
|
598
|
+
for (h = 0; h < $.length; h += 1) {
|
|
599
|
+
const E = Nt(t, $, h);
|
|
600
|
+
m[h] ? m[h].p(E, y) : (m[h] = Bt(E), m[h].c(), m[h].m(p.parentNode, p));
|
|
601
|
+
}
|
|
602
|
+
for (; h < m.length; h += 1)
|
|
603
|
+
m[h].d(1);
|
|
604
|
+
m.length = $.length;
|
|
605
|
+
}
|
|
54
606
|
},
|
|
55
|
-
d(
|
|
56
|
-
|
|
607
|
+
d(i) {
|
|
608
|
+
i && x(n), i && x(s), i && x(a), i && x(l), tn(m, i), i && x(p), f = !1, z(w);
|
|
57
609
|
}
|
|
58
610
|
};
|
|
59
611
|
}
|
|
60
|
-
function
|
|
61
|
-
let
|
|
62
|
-
|
|
63
|
-
|
|
612
|
+
function Bn(t) {
|
|
613
|
+
let n, r;
|
|
614
|
+
return n = new Vt({
|
|
615
|
+
props: {
|
|
616
|
+
shape: (
|
|
617
|
+
/*shape*/
|
|
618
|
+
t[0]
|
|
619
|
+
),
|
|
620
|
+
transform: (
|
|
621
|
+
/*transform*/
|
|
622
|
+
t[2]
|
|
623
|
+
),
|
|
624
|
+
editor: (
|
|
625
|
+
/*editor*/
|
|
626
|
+
t[5]
|
|
627
|
+
),
|
|
628
|
+
$$slots: {
|
|
629
|
+
default: [
|
|
630
|
+
Nn,
|
|
631
|
+
({ grab: o }) => ({ 10: o }),
|
|
632
|
+
({ grab: o }) => o ? 1024 : 0
|
|
633
|
+
]
|
|
634
|
+
},
|
|
635
|
+
$$scope: { ctx: t }
|
|
636
|
+
}
|
|
637
|
+
}), n.$on(
|
|
638
|
+
"change",
|
|
639
|
+
/*change_handler*/
|
|
640
|
+
t[7]
|
|
641
|
+
), n.$on(
|
|
642
|
+
"grab",
|
|
643
|
+
/*grab_handler*/
|
|
644
|
+
t[8]
|
|
645
|
+
), n.$on(
|
|
646
|
+
"release",
|
|
647
|
+
/*release_handler*/
|
|
648
|
+
t[9]
|
|
649
|
+
), {
|
|
650
|
+
c() {
|
|
651
|
+
zt(n.$$.fragment);
|
|
652
|
+
},
|
|
653
|
+
m(o, s) {
|
|
654
|
+
St(n, o, s), r = !0;
|
|
655
|
+
},
|
|
656
|
+
p(o, [s]) {
|
|
657
|
+
const a = {};
|
|
658
|
+
s & /*shape*/
|
|
659
|
+
1 && (a.shape = /*shape*/
|
|
660
|
+
o[0]), s & /*transform*/
|
|
661
|
+
4 && (a.transform = /*transform*/
|
|
662
|
+
o[2]), s & /*$$scope, geom, handleSize, grab, computedStyle*/
|
|
663
|
+
17434 && (a.$$scope = { dirty: s, ctx: o }), n.$set(a);
|
|
664
|
+
},
|
|
665
|
+
i(o) {
|
|
666
|
+
r || (ut(n.$$.fragment, o), r = !0);
|
|
667
|
+
},
|
|
668
|
+
o(o) {
|
|
669
|
+
bt(n.$$.fragment, o), r = !1;
|
|
670
|
+
},
|
|
671
|
+
d(o) {
|
|
672
|
+
vt(n, o);
|
|
673
|
+
}
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
const Ct = (t) => t.join(","), Ut = (t) => t.join(",");
|
|
677
|
+
function Cn(t, n, r) {
|
|
678
|
+
let o, s, { shape: a } = n, { computedStyle: c = void 0 } = n, { transform: l } = n, { viewportScale: p = 1 } = n;
|
|
679
|
+
const f = (i, y, h) => {
|
|
680
|
+
let E;
|
|
681
|
+
y === d.SHAPE ? E = i.geometry.points.map(([P, b]) => [P + h[0], b + h[1]]) : E = i.geometry.points.map(([P, b], C) => y === d(C) ? [P + h[0], b + h[1]] : [P, b]);
|
|
682
|
+
const M = Dt(E);
|
|
683
|
+
return { ...i, geometry: { points: E, bounds: M } };
|
|
684
|
+
};
|
|
685
|
+
function w(i) {
|
|
686
|
+
V.call(this, t, i);
|
|
687
|
+
}
|
|
688
|
+
function $(i) {
|
|
689
|
+
V.call(this, t, i);
|
|
690
|
+
}
|
|
691
|
+
function m(i) {
|
|
692
|
+
V.call(this, t, i);
|
|
693
|
+
}
|
|
694
|
+
return t.$$set = (i) => {
|
|
695
|
+
"shape" in i && r(0, a = i.shape), "computedStyle" in i && r(1, c = i.computedStyle), "transform" in i && r(2, l = i.transform), "viewportScale" in i && r(6, p = i.viewportScale);
|
|
696
|
+
}, t.$$.update = () => {
|
|
697
|
+
t.$$.dirty & /*shape*/
|
|
698
|
+
1 && r(4, o = a.geometry), t.$$.dirty & /*viewportScale*/
|
|
699
|
+
64 && r(3, s = 10 / p);
|
|
700
|
+
}, [
|
|
701
|
+
a,
|
|
702
|
+
c,
|
|
703
|
+
l,
|
|
704
|
+
s,
|
|
705
|
+
o,
|
|
706
|
+
f,
|
|
707
|
+
p,
|
|
708
|
+
w,
|
|
709
|
+
$,
|
|
710
|
+
m
|
|
711
|
+
];
|
|
712
|
+
}
|
|
713
|
+
class Un extends _t {
|
|
714
|
+
constructor(n) {
|
|
715
|
+
super(), Pt(this, n, Cn, Bn, Et, {
|
|
716
|
+
shape: 0,
|
|
717
|
+
computedStyle: 1,
|
|
718
|
+
transform: 2,
|
|
719
|
+
viewportScale: 6
|
|
720
|
+
});
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
function kn(t) {
|
|
724
|
+
let n, r, o, s, a, c, l, p, f, w, $, m, i, y, h, E, M, P, b, C, k, Y, j, v, O, X, Z, ht, N, K, R, tt, dt, I, nt, rt, ft, F, ot, et, yt, H, st, at, gt, G, it, ct, mt, Lt;
|
|
725
|
+
return {
|
|
726
|
+
c() {
|
|
727
|
+
n = L("rect"), l = U(), p = L("rect"), i = U(), y = L("rect"), P = U(), b = L("rect"), j = U(), v = L("rect"), ht = U(), N = L("rect"), dt = U(), I = L("rect"), ft = U(), F = L("rect"), yt = U(), H = L("rect"), gt = U(), G = L("rect"), e(n, "class", "a9s-outer"), e(n, "style", r = /*computedStyle*/
|
|
728
|
+
t[1] ? "display:none;" : void 0), e(n, "x", o = /*geom*/
|
|
729
|
+
t[4].x), e(n, "y", s = /*geom*/
|
|
730
|
+
t[4].y), e(n, "width", a = /*geom*/
|
|
731
|
+
t[4].w), e(n, "height", c = /*geom*/
|
|
732
|
+
t[4].h), e(p, "class", "a9s-inner a9s-shape-handle"), e(
|
|
733
|
+
p,
|
|
734
|
+
"style",
|
|
735
|
+
/*computedStyle*/
|
|
736
|
+
t[1]
|
|
737
|
+
), e(p, "x", f = /*geom*/
|
|
738
|
+
t[4].x), e(p, "y", w = /*geom*/
|
|
739
|
+
t[4].y), e(p, "width", $ = /*geom*/
|
|
740
|
+
t[4].w), e(p, "height", m = /*geom*/
|
|
741
|
+
t[4].h), e(y, "class", "a9s-edge-handle a9s-edge-handle-top"), e(y, "x", h = /*geom*/
|
|
742
|
+
t[4].x), e(y, "y", E = /*geom*/
|
|
743
|
+
t[4].y), e(y, "height", 1), e(y, "width", M = /*geom*/
|
|
744
|
+
t[4].w), e(b, "class", "a9s-edge-handle a9s-edge-handle-right"), e(b, "x", C = /*geom*/
|
|
745
|
+
t[4].x + /*geom*/
|
|
746
|
+
t[4].w), e(b, "y", k = /*geom*/
|
|
747
|
+
t[4].y), e(b, "height", Y = /*geom*/
|
|
748
|
+
t[4].h), e(b, "width", 1), e(v, "class", "a9s-edge-handle a9s-edge-handle-bottom"), e(v, "x", O = /*geom*/
|
|
749
|
+
t[4].x), e(v, "y", X = /*geom*/
|
|
750
|
+
t[4].y + /*geom*/
|
|
751
|
+
t[4].h), e(v, "height", 1), e(v, "width", Z = /*geom*/
|
|
752
|
+
t[4].w), e(N, "class", "a9s-edge-handle a9s-edge-handle-left"), e(N, "x", K = /*geom*/
|
|
753
|
+
t[4].x), e(N, "y", R = /*geom*/
|
|
754
|
+
t[4].y), e(N, "height", tt = /*geom*/
|
|
755
|
+
t[4].h), e(N, "width", 1), e(I, "class", "a9s-corner-handle a9s-corner-handle-topleft"), e(I, "x", nt = /*geom*/
|
|
756
|
+
t[4].x - /*handleSize*/
|
|
757
|
+
t[3] / 2), e(I, "y", rt = /*geom*/
|
|
758
|
+
t[4].y - /*handleSize*/
|
|
759
|
+
t[3] / 2), e(
|
|
760
|
+
I,
|
|
761
|
+
"height",
|
|
762
|
+
/*handleSize*/
|
|
763
|
+
t[3]
|
|
764
|
+
), e(
|
|
765
|
+
I,
|
|
766
|
+
"width",
|
|
767
|
+
/*handleSize*/
|
|
768
|
+
t[3]
|
|
769
|
+
), e(F, "class", "a9s-corner-handle a9s-corner-handle-topright"), e(F, "x", ot = /*geom*/
|
|
770
|
+
t[4].x + /*geom*/
|
|
771
|
+
t[4].w - /*handleSize*/
|
|
772
|
+
t[3] / 2), e(F, "y", et = /*geom*/
|
|
773
|
+
t[4].y - /*handleSize*/
|
|
774
|
+
t[3] / 2), e(
|
|
775
|
+
F,
|
|
776
|
+
"height",
|
|
777
|
+
/*handleSize*/
|
|
778
|
+
t[3]
|
|
779
|
+
), e(
|
|
780
|
+
F,
|
|
781
|
+
"width",
|
|
782
|
+
/*handleSize*/
|
|
783
|
+
t[3]
|
|
784
|
+
), e(H, "class", "a9s-corner-handle a9s-corner-handle-bottomright"), e(H, "x", st = /*geom*/
|
|
785
|
+
t[4].x + /*geom*/
|
|
786
|
+
t[4].w - /*handleSize*/
|
|
787
|
+
t[3] / 2), e(H, "y", at = /*geom*/
|
|
788
|
+
t[4].y + /*geom*/
|
|
789
|
+
t[4].h - /*handleSize*/
|
|
790
|
+
t[3] / 2), e(
|
|
791
|
+
H,
|
|
792
|
+
"height",
|
|
793
|
+
/*handleSize*/
|
|
794
|
+
t[3]
|
|
795
|
+
), e(
|
|
796
|
+
H,
|
|
797
|
+
"width",
|
|
798
|
+
/*handleSize*/
|
|
799
|
+
t[3]
|
|
800
|
+
), e(G, "class", "a9s-corner-handle a9s-corner-handle-bottomleft"), e(G, "x", it = /*geom*/
|
|
801
|
+
t[4].x - /*handleSize*/
|
|
802
|
+
t[3] / 2), e(G, "y", ct = /*geom*/
|
|
803
|
+
t[4].y + /*geom*/
|
|
804
|
+
t[4].h - /*handleSize*/
|
|
805
|
+
t[3] / 2), e(
|
|
806
|
+
G,
|
|
807
|
+
"height",
|
|
808
|
+
/*handleSize*/
|
|
809
|
+
t[3]
|
|
810
|
+
), e(
|
|
811
|
+
G,
|
|
812
|
+
"width",
|
|
813
|
+
/*handleSize*/
|
|
814
|
+
t[3]
|
|
815
|
+
);
|
|
816
|
+
},
|
|
817
|
+
m(g, u) {
|
|
818
|
+
T(g, n, u), T(g, l, u), T(g, p, u), T(g, i, u), T(g, y, u), T(g, P, u), T(g, b, u), T(g, j, u), T(g, v, u), T(g, ht, u), T(g, N, u), T(g, dt, u), T(g, I, u), T(g, ft, u), T(g, F, u), T(g, yt, u), T(g, H, u), T(g, gt, u), T(g, G, u), mt || (Lt = [
|
|
819
|
+
A(n, "pointerdown", function() {
|
|
820
|
+
_(
|
|
821
|
+
/*grab*/
|
|
822
|
+
t[10](d.SHAPE)
|
|
823
|
+
) && t[10](d.SHAPE).apply(this, arguments);
|
|
824
|
+
}),
|
|
825
|
+
A(p, "pointerdown", function() {
|
|
826
|
+
_(
|
|
827
|
+
/*grab*/
|
|
828
|
+
t[10](d.SHAPE)
|
|
829
|
+
) && t[10](d.SHAPE).apply(this, arguments);
|
|
830
|
+
}),
|
|
831
|
+
A(y, "pointerdown", function() {
|
|
832
|
+
_(
|
|
833
|
+
/*grab*/
|
|
834
|
+
t[10](d.TOP)
|
|
835
|
+
) && t[10](d.TOP).apply(this, arguments);
|
|
836
|
+
}),
|
|
837
|
+
A(b, "pointerdown", function() {
|
|
838
|
+
_(
|
|
839
|
+
/*grab*/
|
|
840
|
+
t[10](d.RIGHT)
|
|
841
|
+
) && t[10](d.RIGHT).apply(this, arguments);
|
|
842
|
+
}),
|
|
843
|
+
A(v, "pointerdown", function() {
|
|
844
|
+
_(
|
|
845
|
+
/*grab*/
|
|
846
|
+
t[10](d.BOTTOM)
|
|
847
|
+
) && t[10](d.BOTTOM).apply(this, arguments);
|
|
848
|
+
}),
|
|
849
|
+
A(N, "pointerdown", function() {
|
|
850
|
+
_(
|
|
851
|
+
/*grab*/
|
|
852
|
+
t[10](d.LEFT)
|
|
853
|
+
) && t[10](d.LEFT).apply(this, arguments);
|
|
854
|
+
}),
|
|
855
|
+
A(I, "pointerdown", function() {
|
|
856
|
+
_(
|
|
857
|
+
/*grab*/
|
|
858
|
+
t[10](d.TOP_LEFT)
|
|
859
|
+
) && t[10](d.TOP_LEFT).apply(this, arguments);
|
|
860
|
+
}),
|
|
861
|
+
A(F, "pointerdown", function() {
|
|
862
|
+
_(
|
|
863
|
+
/*grab*/
|
|
864
|
+
t[10](d.TOP_RIGHT)
|
|
865
|
+
) && t[10](d.TOP_RIGHT).apply(this, arguments);
|
|
866
|
+
}),
|
|
867
|
+
A(H, "pointerdown", function() {
|
|
868
|
+
_(
|
|
869
|
+
/*grab*/
|
|
870
|
+
t[10](d.BOTTOM_RIGHT)
|
|
871
|
+
) && t[10](d.BOTTOM_RIGHT).apply(this, arguments);
|
|
872
|
+
}),
|
|
873
|
+
A(G, "pointerdown", function() {
|
|
874
|
+
_(
|
|
875
|
+
/*grab*/
|
|
876
|
+
t[10](d.BOTTOM_LEFT)
|
|
877
|
+
) && t[10](d.BOTTOM_LEFT).apply(this, arguments);
|
|
878
|
+
})
|
|
879
|
+
], mt = !0);
|
|
880
|
+
},
|
|
881
|
+
p(g, u) {
|
|
882
|
+
t = g, u & /*computedStyle*/
|
|
883
|
+
2 && r !== (r = /*computedStyle*/
|
|
884
|
+
t[1] ? "display:none;" : void 0) && e(n, "style", r), u & /*geom*/
|
|
885
|
+
16 && o !== (o = /*geom*/
|
|
886
|
+
t[4].x) && e(n, "x", o), u & /*geom*/
|
|
887
|
+
16 && s !== (s = /*geom*/
|
|
888
|
+
t[4].y) && e(n, "y", s), u & /*geom*/
|
|
889
|
+
16 && a !== (a = /*geom*/
|
|
890
|
+
t[4].w) && e(n, "width", a), u & /*geom*/
|
|
891
|
+
16 && c !== (c = /*geom*/
|
|
892
|
+
t[4].h) && e(n, "height", c), u & /*computedStyle*/
|
|
893
|
+
2 && e(
|
|
894
|
+
p,
|
|
895
|
+
"style",
|
|
896
|
+
/*computedStyle*/
|
|
897
|
+
t[1]
|
|
898
|
+
), u & /*geom*/
|
|
899
|
+
16 && f !== (f = /*geom*/
|
|
900
|
+
t[4].x) && e(p, "x", f), u & /*geom*/
|
|
901
|
+
16 && w !== (w = /*geom*/
|
|
902
|
+
t[4].y) && e(p, "y", w), u & /*geom*/
|
|
903
|
+
16 && $ !== ($ = /*geom*/
|
|
904
|
+
t[4].w) && e(p, "width", $), u & /*geom*/
|
|
905
|
+
16 && m !== (m = /*geom*/
|
|
906
|
+
t[4].h) && e(p, "height", m), u & /*geom*/
|
|
907
|
+
16 && h !== (h = /*geom*/
|
|
908
|
+
t[4].x) && e(y, "x", h), u & /*geom*/
|
|
909
|
+
16 && E !== (E = /*geom*/
|
|
910
|
+
t[4].y) && e(y, "y", E), u & /*geom*/
|
|
911
|
+
16 && M !== (M = /*geom*/
|
|
912
|
+
t[4].w) && e(y, "width", M), u & /*geom*/
|
|
913
|
+
16 && C !== (C = /*geom*/
|
|
914
|
+
t[4].x + /*geom*/
|
|
915
|
+
t[4].w) && e(b, "x", C), u & /*geom*/
|
|
916
|
+
16 && k !== (k = /*geom*/
|
|
917
|
+
t[4].y) && e(b, "y", k), u & /*geom*/
|
|
918
|
+
16 && Y !== (Y = /*geom*/
|
|
919
|
+
t[4].h) && e(b, "height", Y), u & /*geom*/
|
|
920
|
+
16 && O !== (O = /*geom*/
|
|
921
|
+
t[4].x) && e(v, "x", O), u & /*geom*/
|
|
922
|
+
16 && X !== (X = /*geom*/
|
|
923
|
+
t[4].y + /*geom*/
|
|
924
|
+
t[4].h) && e(v, "y", X), u & /*geom*/
|
|
925
|
+
16 && Z !== (Z = /*geom*/
|
|
926
|
+
t[4].w) && e(v, "width", Z), u & /*geom*/
|
|
927
|
+
16 && K !== (K = /*geom*/
|
|
928
|
+
t[4].x) && e(N, "x", K), u & /*geom*/
|
|
929
|
+
16 && R !== (R = /*geom*/
|
|
930
|
+
t[4].y) && e(N, "y", R), u & /*geom*/
|
|
931
|
+
16 && tt !== (tt = /*geom*/
|
|
932
|
+
t[4].h) && e(N, "height", tt), u & /*geom, handleSize*/
|
|
933
|
+
24 && nt !== (nt = /*geom*/
|
|
934
|
+
t[4].x - /*handleSize*/
|
|
935
|
+
t[3] / 2) && e(I, "x", nt), u & /*geom, handleSize*/
|
|
936
|
+
24 && rt !== (rt = /*geom*/
|
|
937
|
+
t[4].y - /*handleSize*/
|
|
938
|
+
t[3] / 2) && e(I, "y", rt), u & /*handleSize*/
|
|
939
|
+
8 && e(
|
|
940
|
+
I,
|
|
941
|
+
"height",
|
|
942
|
+
/*handleSize*/
|
|
943
|
+
t[3]
|
|
944
|
+
), u & /*handleSize*/
|
|
945
|
+
8 && e(
|
|
946
|
+
I,
|
|
947
|
+
"width",
|
|
948
|
+
/*handleSize*/
|
|
949
|
+
t[3]
|
|
950
|
+
), u & /*geom, handleSize*/
|
|
951
|
+
24 && ot !== (ot = /*geom*/
|
|
952
|
+
t[4].x + /*geom*/
|
|
953
|
+
t[4].w - /*handleSize*/
|
|
954
|
+
t[3] / 2) && e(F, "x", ot), u & /*geom, handleSize*/
|
|
955
|
+
24 && et !== (et = /*geom*/
|
|
956
|
+
t[4].y - /*handleSize*/
|
|
957
|
+
t[3] / 2) && e(F, "y", et), u & /*handleSize*/
|
|
958
|
+
8 && e(
|
|
959
|
+
F,
|
|
960
|
+
"height",
|
|
961
|
+
/*handleSize*/
|
|
962
|
+
t[3]
|
|
963
|
+
), u & /*handleSize*/
|
|
964
|
+
8 && e(
|
|
965
|
+
F,
|
|
966
|
+
"width",
|
|
967
|
+
/*handleSize*/
|
|
968
|
+
t[3]
|
|
969
|
+
), u & /*geom, handleSize*/
|
|
970
|
+
24 && st !== (st = /*geom*/
|
|
971
|
+
t[4].x + /*geom*/
|
|
972
|
+
t[4].w - /*handleSize*/
|
|
973
|
+
t[3] / 2) && e(H, "x", st), u & /*geom, handleSize*/
|
|
974
|
+
24 && at !== (at = /*geom*/
|
|
975
|
+
t[4].y + /*geom*/
|
|
976
|
+
t[4].h - /*handleSize*/
|
|
977
|
+
t[3] / 2) && e(H, "y", at), u & /*handleSize*/
|
|
978
|
+
8 && e(
|
|
979
|
+
H,
|
|
980
|
+
"height",
|
|
981
|
+
/*handleSize*/
|
|
982
|
+
t[3]
|
|
983
|
+
), u & /*handleSize*/
|
|
984
|
+
8 && e(
|
|
985
|
+
H,
|
|
986
|
+
"width",
|
|
987
|
+
/*handleSize*/
|
|
988
|
+
t[3]
|
|
989
|
+
), u & /*geom, handleSize*/
|
|
990
|
+
24 && it !== (it = /*geom*/
|
|
991
|
+
t[4].x - /*handleSize*/
|
|
992
|
+
t[3] / 2) && e(G, "x", it), u & /*geom, handleSize*/
|
|
993
|
+
24 && ct !== (ct = /*geom*/
|
|
994
|
+
t[4].y + /*geom*/
|
|
995
|
+
t[4].h - /*handleSize*/
|
|
996
|
+
t[3] / 2) && e(G, "y", ct), u & /*handleSize*/
|
|
997
|
+
8 && e(
|
|
998
|
+
G,
|
|
999
|
+
"height",
|
|
1000
|
+
/*handleSize*/
|
|
1001
|
+
t[3]
|
|
1002
|
+
), u & /*handleSize*/
|
|
1003
|
+
8 && e(
|
|
1004
|
+
G,
|
|
1005
|
+
"width",
|
|
1006
|
+
/*handleSize*/
|
|
1007
|
+
t[3]
|
|
1008
|
+
);
|
|
1009
|
+
},
|
|
1010
|
+
d(g) {
|
|
1011
|
+
g && x(n), g && x(l), g && x(p), g && x(i), g && x(y), g && x(P), g && x(b), g && x(j), g && x(v), g && x(ht), g && x(N), g && x(dt), g && x(I), g && x(ft), g && x(F), g && x(yt), g && x(H), g && x(gt), g && x(G), mt = !1, z(Lt);
|
|
1012
|
+
}
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
function Yn(t) {
|
|
1016
|
+
let n, r;
|
|
1017
|
+
return n = new Vt({
|
|
1018
|
+
props: {
|
|
1019
|
+
shape: (
|
|
1020
|
+
/*shape*/
|
|
1021
|
+
t[0]
|
|
1022
|
+
),
|
|
1023
|
+
transform: (
|
|
1024
|
+
/*transform*/
|
|
1025
|
+
t[2]
|
|
1026
|
+
),
|
|
1027
|
+
editor: (
|
|
1028
|
+
/*editor*/
|
|
1029
|
+
t[5]
|
|
1030
|
+
),
|
|
1031
|
+
$$slots: {
|
|
1032
|
+
default: [
|
|
1033
|
+
kn,
|
|
1034
|
+
({ grab: o }) => ({ 10: o }),
|
|
1035
|
+
({ grab: o }) => o ? 1024 : 0
|
|
1036
|
+
]
|
|
1037
|
+
},
|
|
1038
|
+
$$scope: { ctx: t }
|
|
1039
|
+
}
|
|
1040
|
+
}), n.$on(
|
|
1041
|
+
"grab",
|
|
1042
|
+
/*grab_handler*/
|
|
1043
|
+
t[7]
|
|
1044
|
+
), n.$on(
|
|
1045
|
+
"change",
|
|
1046
|
+
/*change_handler*/
|
|
1047
|
+
t[8]
|
|
1048
|
+
), n.$on(
|
|
1049
|
+
"release",
|
|
1050
|
+
/*release_handler*/
|
|
1051
|
+
t[9]
|
|
1052
|
+
), {
|
|
1053
|
+
c() {
|
|
1054
|
+
zt(n.$$.fragment);
|
|
1055
|
+
},
|
|
1056
|
+
m(o, s) {
|
|
1057
|
+
St(n, o, s), r = !0;
|
|
1058
|
+
},
|
|
1059
|
+
p(o, [s]) {
|
|
1060
|
+
const a = {};
|
|
1061
|
+
s & /*shape*/
|
|
1062
|
+
1 && (a.shape = /*shape*/
|
|
1063
|
+
o[0]), s & /*transform*/
|
|
1064
|
+
4 && (a.transform = /*transform*/
|
|
1065
|
+
o[2]), s & /*$$scope, geom, handleSize, grab, computedStyle*/
|
|
1066
|
+
3098 && (a.$$scope = { dirty: s, ctx: o }), n.$set(a);
|
|
1067
|
+
},
|
|
1068
|
+
i(o) {
|
|
1069
|
+
r || (ut(n.$$.fragment, o), r = !0);
|
|
1070
|
+
},
|
|
1071
|
+
o(o) {
|
|
1072
|
+
bt(n.$$.fragment, o), r = !1;
|
|
1073
|
+
},
|
|
1074
|
+
d(o) {
|
|
1075
|
+
vt(n, o);
|
|
1076
|
+
}
|
|
1077
|
+
};
|
|
1078
|
+
}
|
|
1079
|
+
function jn(t, n, r) {
|
|
1080
|
+
let o, s, { shape: a } = n, { computedStyle: c = void 0 } = n, { transform: l } = n, { viewportScale: p = 1 } = n;
|
|
1081
|
+
const f = (i, y, h) => {
|
|
1082
|
+
const E = i.geometry.bounds;
|
|
1083
|
+
let [M, P] = [E.minX, E.minY], [b, C] = [E.maxX, E.maxY];
|
|
1084
|
+
const [k, Y] = h;
|
|
1085
|
+
if (y === d.SHAPE)
|
|
1086
|
+
M += k, b += k, P += Y, C += Y;
|
|
1087
|
+
else {
|
|
1088
|
+
switch (y) {
|
|
1089
|
+
case d.TOP:
|
|
1090
|
+
case d.TOP_LEFT:
|
|
1091
|
+
case d.TOP_RIGHT: {
|
|
1092
|
+
P += Y;
|
|
1093
|
+
break;
|
|
1094
|
+
}
|
|
1095
|
+
case d.BOTTOM:
|
|
1096
|
+
case d.BOTTOM_LEFT:
|
|
1097
|
+
case d.BOTTOM_RIGHT: {
|
|
1098
|
+
C += Y;
|
|
1099
|
+
break;
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
switch (y) {
|
|
1103
|
+
case d.LEFT:
|
|
1104
|
+
case d.TOP_LEFT:
|
|
1105
|
+
case d.BOTTOM_LEFT: {
|
|
1106
|
+
M += k;
|
|
1107
|
+
break;
|
|
1108
|
+
}
|
|
1109
|
+
case d.RIGHT:
|
|
1110
|
+
case d.TOP_RIGHT:
|
|
1111
|
+
case d.BOTTOM_RIGHT: {
|
|
1112
|
+
b += k;
|
|
1113
|
+
break;
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
const j = Math.min(M, b), v = Math.min(P, C), O = Math.abs(b - M), X = Math.abs(C - P);
|
|
1118
|
+
return {
|
|
1119
|
+
...i,
|
|
1120
|
+
geometry: {
|
|
1121
|
+
x: j,
|
|
1122
|
+
y: v,
|
|
1123
|
+
w: O,
|
|
1124
|
+
h: X,
|
|
1125
|
+
bounds: {
|
|
1126
|
+
minX: j,
|
|
1127
|
+
minY: v,
|
|
1128
|
+
maxX: j + O,
|
|
1129
|
+
maxY: v + X
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
};
|
|
1133
|
+
};
|
|
1134
|
+
function w(i) {
|
|
1135
|
+
V.call(this, t, i);
|
|
1136
|
+
}
|
|
1137
|
+
function $(i) {
|
|
1138
|
+
V.call(this, t, i);
|
|
1139
|
+
}
|
|
1140
|
+
function m(i) {
|
|
1141
|
+
V.call(this, t, i);
|
|
1142
|
+
}
|
|
1143
|
+
return t.$$set = (i) => {
|
|
1144
|
+
"shape" in i && r(0, a = i.shape), "computedStyle" in i && r(1, c = i.computedStyle), "transform" in i && r(2, l = i.transform), "viewportScale" in i && r(6, p = i.viewportScale);
|
|
1145
|
+
}, t.$$.update = () => {
|
|
1146
|
+
t.$$.dirty & /*shape*/
|
|
1147
|
+
1 && r(4, o = a.geometry), t.$$.dirty & /*viewportScale*/
|
|
1148
|
+
64 && r(3, s = 10 / p);
|
|
1149
|
+
}, [
|
|
1150
|
+
a,
|
|
1151
|
+
c,
|
|
1152
|
+
l,
|
|
1153
|
+
s,
|
|
1154
|
+
o,
|
|
1155
|
+
f,
|
|
1156
|
+
p,
|
|
1157
|
+
w,
|
|
1158
|
+
$,
|
|
1159
|
+
m
|
|
1160
|
+
];
|
|
1161
|
+
}
|
|
1162
|
+
class On extends _t {
|
|
1163
|
+
constructor(n) {
|
|
1164
|
+
super(), Pt(this, n, jn, Yn, Et, {
|
|
1165
|
+
shape: 0,
|
|
1166
|
+
computedStyle: 1,
|
|
1167
|
+
transform: 2,
|
|
1168
|
+
viewportScale: 6
|
|
1169
|
+
});
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
B.RECTANGLE, B.POLYGON;
|
|
1173
|
+
const d = (t) => `HANDLE-${t}`;
|
|
1174
|
+
d.SHAPE = "SHAPE";
|
|
1175
|
+
d.TOP = "TOP";
|
|
1176
|
+
d.RIGHT = "RIGHT";
|
|
1177
|
+
d.BOTTOM = "BOTTOM";
|
|
1178
|
+
d.LEFT = "LEFT";
|
|
1179
|
+
d.TOP_LEFT = "TOP_LEFT";
|
|
1180
|
+
d.TOP_RIGHT = "TOP_RIGHT";
|
|
1181
|
+
d.BOTTOM_RIGHT = "BOTTOM_RIGHT";
|
|
1182
|
+
d.BOTTOM_LEFT = "BOTTOM_LEFT";
|
|
1183
|
+
const Xn = (t) => ({}), kt = (t) => ({ grab: (
|
|
1184
|
+
/*onGrab*/
|
|
1185
|
+
t[0]
|
|
1186
|
+
) });
|
|
1187
|
+
function zn(t) {
|
|
1188
|
+
let n, r, o, s;
|
|
1189
|
+
const a = (
|
|
1190
|
+
/*#slots*/
|
|
1191
|
+
t[7].default
|
|
1192
|
+
), c = Qt(
|
|
1193
|
+
a,
|
|
1194
|
+
t,
|
|
1195
|
+
/*$$scope*/
|
|
1196
|
+
t[6],
|
|
1197
|
+
kt
|
|
64
1198
|
);
|
|
65
1199
|
return {
|
|
66
1200
|
c() {
|
|
67
|
-
|
|
1201
|
+
n = L("g"), c && c.c(), e(n, "class", "a9s-annotation selected");
|
|
68
1202
|
},
|
|
69
|
-
m(
|
|
70
|
-
|
|
1203
|
+
m(l, p) {
|
|
1204
|
+
T(l, n, p), c && c.m(n, null), r = !0, o || (s = [
|
|
1205
|
+
A(
|
|
1206
|
+
n,
|
|
1207
|
+
"pointerup",
|
|
1208
|
+
/*onRelease*/
|
|
1209
|
+
t[2]
|
|
1210
|
+
),
|
|
1211
|
+
A(
|
|
1212
|
+
n,
|
|
1213
|
+
"pointermove",
|
|
1214
|
+
/*onPointerMove*/
|
|
1215
|
+
t[1]
|
|
1216
|
+
)
|
|
1217
|
+
], o = !0);
|
|
71
1218
|
},
|
|
72
|
-
p(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
1219
|
+
p(l, [p]) {
|
|
1220
|
+
c && c.p && (!r || p & /*$$scope*/
|
|
1221
|
+
64) && Kt(
|
|
1222
|
+
c,
|
|
1223
|
+
a,
|
|
1224
|
+
l,
|
|
1225
|
+
/*$$scope*/
|
|
1226
|
+
l[6],
|
|
1227
|
+
r ? Zt(
|
|
1228
|
+
a,
|
|
1229
|
+
/*$$scope*/
|
|
1230
|
+
l[6],
|
|
1231
|
+
p,
|
|
1232
|
+
Xn
|
|
1233
|
+
) : Rt(
|
|
1234
|
+
/*$$scope*/
|
|
1235
|
+
l[6]
|
|
1236
|
+
),
|
|
1237
|
+
kt
|
|
1238
|
+
);
|
|
78
1239
|
},
|
|
79
|
-
i(
|
|
80
|
-
|
|
1240
|
+
i(l) {
|
|
1241
|
+
r || (ut(c, l), r = !0);
|
|
81
1242
|
},
|
|
82
|
-
o(
|
|
83
|
-
c
|
|
1243
|
+
o(l) {
|
|
1244
|
+
bt(c, l), r = !1;
|
|
84
1245
|
},
|
|
85
|
-
d(
|
|
86
|
-
|
|
1246
|
+
d(l) {
|
|
1247
|
+
l && x(n), c && c.d(l), o = !1, z(s);
|
|
87
1248
|
}
|
|
88
1249
|
};
|
|
89
1250
|
}
|
|
90
|
-
function
|
|
91
|
-
let { $$slots:
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
1251
|
+
function Dn(t, n, r) {
|
|
1252
|
+
let { $$slots: o = {}, $$scope: s } = n;
|
|
1253
|
+
const a = sn();
|
|
1254
|
+
let { shape: c } = n, { editor: l } = n, { transform: p } = n, f = null, w, $ = null;
|
|
1255
|
+
const m = (h) => (E) => {
|
|
1256
|
+
f = h, w = p.elementToImage(E.offsetX, E.offsetY), $ = c, E.target.setPointerCapture(E.pointerId), a("grab");
|
|
1257
|
+
}, i = (h) => {
|
|
1258
|
+
if (f) {
|
|
1259
|
+
const [E, M] = p.elementToImage(h.offsetX, h.offsetY), P = [E - w[0], M - w[1]];
|
|
1260
|
+
r(3, c = l($, f, P)), a("change", c);
|
|
99
1261
|
}
|
|
1262
|
+
}, y = (h) => {
|
|
1263
|
+
h.target.releasePointerCapture(h.pointerId), f = null, $ = c, a("release");
|
|
100
1264
|
};
|
|
101
|
-
return
|
|
102
|
-
"
|
|
103
|
-
},
|
|
104
|
-
s.$$.dirty & /*viewer*/
|
|
105
|
-
1 && p(r);
|
|
106
|
-
}, [r, a, l, e, t];
|
|
1265
|
+
return t.$$set = (h) => {
|
|
1266
|
+
"shape" in h && r(3, c = h.shape), "editor" in h && r(4, l = h.editor), "transform" in h && r(5, p = h.transform), "$$scope" in h && r(6, s = h.$$scope);
|
|
1267
|
+
}, [m, i, y, c, l, p, s, o];
|
|
107
1268
|
}
|
|
108
|
-
class
|
|
109
|
-
constructor(
|
|
110
|
-
super(),
|
|
1269
|
+
class Vt extends _t {
|
|
1270
|
+
constructor(n) {
|
|
1271
|
+
super(), Pt(this, n, Dn, zn, Et, { shape: 3, editor: 4, transform: 5 });
|
|
111
1272
|
}
|
|
112
1273
|
}
|
|
113
|
-
|
|
1274
|
+
navigator.userAgent.indexOf("Mac OS X");
|
|
114
1275
|
export {
|
|
115
|
-
|
|
1276
|
+
Vt as Editor,
|
|
1277
|
+
d as Handle,
|
|
1278
|
+
Un as PolygonEditor,
|
|
1279
|
+
On as RectangleEditor,
|
|
1280
|
+
yn as RectangleUtil,
|
|
1281
|
+
B as ShapeType,
|
|
1282
|
+
Wn as W3CImageFormat,
|
|
1283
|
+
Dt as boundsFromPoints,
|
|
1284
|
+
gn as parseFragmentSelector,
|
|
1285
|
+
En as parseSVGSelector,
|
|
1286
|
+
In as parseW3CBodies,
|
|
1287
|
+
Hn as parseW3CImageAnnotation,
|
|
1288
|
+
At as registerShapeUtil,
|
|
1289
|
+
mn as serializeFragmentSelector,
|
|
1290
|
+
bn as serializeSVGSelector,
|
|
1291
|
+
Fn as serializeW3CBodies,
|
|
1292
|
+
Gn as serializeW3CImageAnnotation
|
|
116
1293
|
};
|
|
117
1294
|
//# sourceMappingURL=annotorious-svelte.es5.js.map
|