luo-image-annotator 0.0.16 → 0.0.18

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.
@@ -1,19 +1,19 @@
1
1
  var ae = Object.defineProperty;
2
- var le = (w, t, n) => t in w ? ae(w, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : w[t] = n;
3
- var T = (w, t, n) => le(w, typeof t != "symbol" ? t + "" : t, n);
4
- import { defineComponent as ct, ref as M, watchEffect as ce, openBlock as v, createElementBlock as m, normalizeClass as X, computed as V, onMounted as yt, nextTick as at, watch as K, createElementVNode as h, toDisplayString as z, Fragment as N, renderList as J, normalizeStyle as U, createCommentVNode as B, createVNode as R, withModifiers as It, createBlock as vt, withDirectives as ft, vModelText as mt, createTextVNode as lt } from "vue";
5
- const pt = (w, t) => Math.sqrt(Math.pow(w.x - t.x, 2) + Math.pow(w.y - t.y, 2)), re = (w, t) => {
2
+ var le = (y, t, n) => t in y ? ae(y, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : y[t] = n;
3
+ var T = (y, t, n) => le(y, typeof t != "symbol" ? t + "" : t, n);
4
+ import { defineComponent as ct, ref as M, watchEffect as ce, openBlock as v, createElementBlock as m, normalizeClass as q, computed as O, onMounted as yt, nextTick as at, watch as K, createElementVNode as h, toDisplayString as L, Fragment as W, renderList as J, normalizeStyle as U, createCommentVNode as R, createVNode as B, withModifiers as It, createBlock as vt, withDirectives as ft, vModelText as mt, createTextVNode as lt } from "vue";
5
+ const pt = (y, t) => Math.sqrt(Math.pow(y.x - t.x, 2) + Math.pow(y.y - t.y, 2)), re = (y, t) => {
6
6
  let n = !1;
7
- for (let e = 0, a = t.length - 1; e < t.length; a = e++) {
8
- const o = t[e].x, c = t[e].y, g = t[a].x, u = t[a].y;
9
- c > w.y != u > w.y && w.x < (g - o) * (w.y - c) / (u - c) + o && (n = !n);
7
+ for (let e = 0, l = t.length - 1; e < t.length; l = e++) {
8
+ const o = t[e].x, a = t[e].y, g = t[l].x, u = t[l].y;
9
+ a > y.y != u > y.y && y.x < (g - o) * (y.y - a) / (u - a) + o && (n = !n);
10
10
  }
11
11
  return n;
12
- }, At = (w, t, n) => {
13
- const e = n * (Math.PI / 180), a = Math.cos(e), o = Math.sin(e), c = w.x - t.x, g = w.y - t.y;
12
+ }, At = (y, t, n) => {
13
+ const e = n * (Math.PI / 180), l = Math.cos(e), o = Math.sin(e), a = y.x - t.x, g = y.y - t.y;
14
14
  return {
15
- x: t.x + (c * a - g * o),
16
- y: t.y + (c * o + g * a)
15
+ x: t.x + (a * l - g * o),
16
+ y: t.y + (a * o + g * l)
17
17
  };
18
18
  };
19
19
  class he {
@@ -52,6 +52,8 @@ class he {
52
52
  // 视口
53
53
  T(this, "scale", 1);
54
54
  T(this, "offset", { x: 0, y: 0 });
55
+ T(this, "showLabels", !1);
56
+ // 是否在画布上显示标注的标签
55
57
  T(this, "listeners", {});
56
58
  T(this, "imageUrl", "");
57
59
  this.canvas = t;
@@ -86,11 +88,14 @@ class he {
86
88
  setVisibleLabels(t) {
87
89
  this.visibleLabels = new Set(t), this.render();
88
90
  }
91
+ setShowLabels(t) {
92
+ this.showLabels = t, this.render();
93
+ }
89
94
  zoom(t) {
90
95
  const e = t > 0 ? this.scale * 1.1 : this.scale / 1.1;
91
96
  if (e < 0.1 || e > 10) return;
92
- const a = this.canvas.width / 2, o = this.canvas.height / 2, c = this.toImageCoords(a, o);
93
- this.scale = e, this.offset.x = a - c.x * this.scale, this.offset.y = o - c.y * this.scale, this.clampViewportOffset(), this.render();
97
+ const l = this.canvas.width / 2, o = this.canvas.height / 2, a = this.toImageCoords(l, o);
98
+ this.scale = e, this.offset.x = l - a.x * this.scale, this.offset.y = o - a.y * this.scale, this.clampViewportOffset(), this.render();
94
99
  }
95
100
  resize() {
96
101
  this.fitImageToCanvas(), this.render();
@@ -120,18 +125,18 @@ class he {
120
125
  if (this.img.width === 0 || this.img.height === 0) return;
121
126
  const t = this.img.width * this.scale, n = this.img.height * this.scale, e = 100;
122
127
  if (t <= this.canvas.width) {
123
- const a = -t + e, o = this.canvas.width - e;
124
- this.offset.x = Math.min(o, Math.max(a, this.offset.x));
128
+ const l = -t + e, o = this.canvas.width - e;
129
+ this.offset.x = Math.min(o, Math.max(l, this.offset.x));
125
130
  } else {
126
- const a = this.canvas.width - t - e, o = e;
127
- this.offset.x = Math.min(o, Math.max(a, this.offset.x));
131
+ const l = this.canvas.width - t - e, o = e;
132
+ this.offset.x = Math.min(o, Math.max(l, this.offset.x));
128
133
  }
129
134
  if (n <= this.canvas.height) {
130
- const a = -n + e, o = this.canvas.height - e;
131
- this.offset.y = Math.min(o, Math.max(a, this.offset.y));
135
+ const l = -n + e, o = this.canvas.height - e;
136
+ this.offset.y = Math.min(o, Math.max(l, this.offset.y));
132
137
  } else {
133
- const a = this.canvas.height - n - e, o = e;
134
- this.offset.y = Math.min(o, Math.max(a, this.offset.y));
138
+ const l = this.canvas.height - n - e, o = e;
139
+ this.offset.y = Math.min(o, Math.max(l, this.offset.y));
135
140
  }
136
141
  }
137
142
  // --- 事件处理 ---
@@ -153,21 +158,21 @@ class he {
153
158
  }
154
159
  }
155
160
  handleMouseDown(t) {
156
- const n = this.canvas.getBoundingClientRect(), e = t.clientX - n.left, a = t.clientY - n.top, o = this.toImageCoords(e, a);
161
+ const n = this.canvas.getBoundingClientRect(), e = t.clientX - n.left, l = t.clientY - n.top, o = this.toImageCoords(e, l);
157
162
  if (this.interactionMode === "pan") {
158
- this.isPanning = !0, this.panStartPoint = { x: e, y: a }, this.canvas.style.cursor = "grabbing";
163
+ this.isPanning = !0, this.panStartPoint = { x: e, y: l }, this.canvas.style.cursor = "grabbing";
159
164
  return;
160
165
  }
161
166
  if (this.interactionMode === "select" && this.activeAnnotation) {
162
- const u = this.getHitHandle(e, a, this.activeAnnotation);
167
+ const u = this.getHitHandle(e, l, this.activeAnnotation);
163
168
  if (u !== -100) {
164
169
  this.isDragging = !0, this.dragStartPoint = o, this.selectedHandleIndex = u, this.dragStartAnnotation = JSON.parse(JSON.stringify(this.activeAnnotation));
165
170
  return;
166
171
  }
167
172
  }
168
- const c = this.interactionMode === "select" ? this.getHitCategory(e, a) : null;
169
- if (c) {
170
- this.activeAnnotation = c, this.isDragging = !1, this.selectedHandleIndex = -1, this.emit("annotationChange", { action: "select", changedItem: c, imageUrl: this.imageUrl }), this.render();
173
+ const a = this.interactionMode === "select" ? this.getHitCategory(e, l) : null;
174
+ if (a) {
175
+ this.activeAnnotation = a, this.isDragging = !1, this.selectedHandleIndex = -1, this.emit("annotationChange", { action: "select", changedItem: a, imageUrl: this.imageUrl }), this.render();
171
176
  return;
172
177
  }
173
178
  const g = this.getHitAnnotation(o);
@@ -203,23 +208,23 @@ class he {
203
208
  this.activeAnnotation = null, this.render();
204
209
  }
205
210
  handleMouseMove(t) {
206
- const n = this.canvas.getBoundingClientRect(), e = t.clientX - n.left, a = t.clientY - n.top, o = this.toImageCoords(e, a);
211
+ const n = this.canvas.getBoundingClientRect(), e = t.clientX - n.left, l = t.clientY - n.top, o = this.toImageCoords(e, l);
207
212
  if (this.isPanning && this.panStartPoint) {
208
- const c = e - this.panStartPoint.x, g = a - this.panStartPoint.y;
209
- this.offset.x += c, this.offset.y += g, this.clampViewportOffset(), this.panStartPoint = { x: e, y: a }, this.render();
213
+ const a = e - this.panStartPoint.x, g = l - this.panStartPoint.y;
214
+ this.offset.x += a, this.offset.y += g, this.clampViewportOffset(), this.panStartPoint = { x: e, y: l }, this.render();
210
215
  return;
211
216
  }
212
217
  if (this.lastMouseMovePoint = o, this.isDrawing) {
213
218
  if (this.currentTool === "polygon" && this.activeAnnotation) {
214
- const c = this.activeAnnotation.coordinates;
215
- if (c.points.length > 2) {
216
- const g = c.points[0], u = pt(o, g);
219
+ const a = this.activeAnnotation.coordinates;
220
+ if (a.points.length > 2) {
221
+ const g = a.points[0], u = pt(o, g);
217
222
  this.isHoveringStartPoint = u < 20 / this.scale;
218
223
  } else
219
224
  this.isHoveringStartPoint = !1;
220
225
  }
221
226
  this.updateDrawing(o);
222
- } else this.isDragging && this.activeAnnotation && this.dragStartPoint ? this.updateDragging(o) : this.checkHover(e, a, o);
227
+ } else this.isDragging && this.activeAnnotation && this.dragStartPoint ? this.updateDragging(o) : this.checkHover(e, l, o);
223
228
  this.render();
224
229
  }
225
230
  handleMouseUp(t) {
@@ -244,8 +249,8 @@ class he {
244
249
  // 辅助函数:将 hex 转换为 rgba
245
250
  hexToRgba(t, n) {
246
251
  if (!t.startsWith("#")) return t;
247
- const e = parseInt(t.slice(1, 3), 16), a = parseInt(t.slice(3, 5), 16), o = parseInt(t.slice(5, 7), 16);
248
- return `rgba(${e}, ${a}, ${o}, ${n})`;
252
+ const e = parseInt(t.slice(1, 3), 16), l = parseInt(t.slice(3, 5), 16), o = parseInt(t.slice(5, 7), 16);
253
+ return `rgba(${e}, ${l}, ${o}, ${n})`;
249
254
  }
250
255
  startDrawing(t) {
251
256
  if (!this.currentTool) return;
@@ -300,8 +305,8 @@ class he {
300
305
  const n = this.activeAnnotation.coordinates;
301
306
  n.x2 = t.x, n.y2 = t.y;
302
307
  } else if (this.activeAnnotation.type === "rotatedRect" && this.dragStartPoint) {
303
- const n = this.activeAnnotation.coordinates, e = Math.abs(t.x - this.dragStartPoint.x), a = Math.abs(t.y - this.dragStartPoint.y);
304
- n.width = e * 2, n.height = a * 2;
308
+ const n = this.activeAnnotation.coordinates, e = Math.abs(t.x - this.dragStartPoint.x), l = Math.abs(t.y - this.dragStartPoint.y);
309
+ n.width = e * 2, n.height = l * 2;
305
310
  } else this.activeAnnotation.type;
306
311
  }
307
312
  finishDrawing() {
@@ -312,8 +317,8 @@ class he {
312
317
  this.activeAnnotation = null, this.isDrawing = !1;
313
318
  return;
314
319
  }
315
- const n = Math.min(t.x1, t.x2), e = Math.max(t.x1, t.x2), a = Math.min(t.y1, t.y2), o = Math.max(t.y1, t.y2);
316
- t.x1 = n, t.x2 = e, t.y1 = a, t.y2 = o, this.annotations.push(this.activeAnnotation), this.emit("annotationChange", { action: "add", changedItem: this.activeAnnotation, imageUrl: this.imageUrl });
320
+ const n = Math.min(t.x1, t.x2), e = Math.max(t.x1, t.x2), l = Math.min(t.y1, t.y2), o = Math.max(t.y1, t.y2);
321
+ t.x1 = n, t.x2 = e, t.y1 = l, t.y2 = o, this.annotations.push(this.activeAnnotation), this.emit("annotationChange", { action: "add", changedItem: this.activeAnnotation, imageUrl: this.imageUrl });
317
322
  } else if (this.activeAnnotation.type === "polygon") {
318
323
  if (this.activeAnnotation.coordinates.points.length < 3) {
319
324
  this.activeAnnotation = null, this.isDrawing = !1;
@@ -337,43 +342,43 @@ class he {
337
342
  const n = t.x - this.dragStartPoint.x, e = t.y - this.dragStartPoint.y;
338
343
  this.selectedHandleIndex === -1 ? this.moveAnnotation(this.activeAnnotation, this.dragStartAnnotation, n, e) : this.resizeAnnotation(this.activeAnnotation, this.dragStartAnnotation, this.selectedHandleIndex, t);
339
344
  }
340
- moveAnnotation(t, n, e, a) {
345
+ moveAnnotation(t, n, e, l) {
341
346
  if (t.type === "rectangle") {
342
- const o = n.coordinates, c = t.coordinates;
343
- c.x1 = o.x1 + e, c.x2 = o.x2 + e, c.y1 = o.y1 + a, c.y2 = o.y2 + a;
347
+ const o = n.coordinates, a = t.coordinates;
348
+ a.x1 = o.x1 + e, a.x2 = o.x2 + e, a.y1 = o.y1 + l, a.y2 = o.y2 + l;
344
349
  } else if (t.type === "point") {
345
- const o = n.coordinates, c = t.coordinates;
346
- c.points = o.points.map((g) => ({ x: g.x + e, y: g.y + a }));
350
+ const o = n.coordinates, a = t.coordinates;
351
+ a.points = o.points.map((g) => ({ x: g.x + e, y: g.y + l }));
347
352
  } else if (t.type === "rotatedRect") {
348
- const o = n.coordinates, c = t.coordinates;
349
- c.x = o.x + e, c.y = o.y + a;
353
+ const o = n.coordinates, a = t.coordinates;
354
+ a.x = o.x + e, a.y = o.y + l;
350
355
  } else if (t.type === "polygon") {
351
- const o = n.coordinates, c = t.coordinates;
352
- c.points = o.points.map((g) => ({ x: g.x + e, y: g.y + a }));
356
+ const o = n.coordinates, a = t.coordinates;
357
+ a.points = o.points.map((g) => ({ x: g.x + e, y: g.y + l }));
353
358
  } else if (t.type === "category") {
354
- const o = n.coordinates, c = t.coordinates;
355
- o && c && (c.x = o.x + e, c.y = o.y + a);
359
+ const o = n.coordinates, a = t.coordinates;
360
+ o && a && (a.x = o.x + e, a.y = o.y + l);
356
361
  }
357
362
  }
358
- resizeAnnotation(t, n, e, a) {
363
+ resizeAnnotation(t, n, e, l) {
359
364
  if (t.type === "rectangle") {
360
365
  const o = t.coordinates;
361
- e === 0 && (o.x1 = a.x, o.y1 = a.y), e === 1 && (o.x2 = a.x, o.y1 = a.y), e === 2 && (o.x2 = a.x, o.y2 = a.y), e === 3 && (o.x1 = a.x, o.y2 = a.y);
366
+ e === 0 && (o.x1 = l.x, o.y1 = l.y), e === 1 && (o.x2 = l.x, o.y1 = l.y), e === 2 && (o.x2 = l.x, o.y2 = l.y), e === 3 && (o.x1 = l.x, o.y2 = l.y);
362
367
  } else if (t.type === "polygon") {
363
368
  const o = t.coordinates;
364
- e >= 0 && e < o.points.length && (o.points[e] = a);
369
+ e >= 0 && e < o.points.length && (o.points[e] = l);
365
370
  } else if (t.type === "point") {
366
371
  const o = t.coordinates;
367
- e >= 0 && e < o.points.length && (o.points[e] = a);
372
+ e >= 0 && e < o.points.length && (o.points[e] = l);
368
373
  } else if (t.type === "rotatedRect") {
369
374
  const o = t.coordinates;
370
375
  if (e === -2) {
371
- const c = o.x, g = o.y, u = a.x - c, r = a.y - g;
372
- let k = Math.atan2(r, u) * 180 / Math.PI;
373
- k += 90, o.angle = k;
376
+ const a = o.x, g = o.y, u = l.x - a, r = l.y - g;
377
+ let A = Math.atan2(r, u) * 180 / Math.PI;
378
+ A += 90, o.angle = A;
374
379
  } else {
375
- const c = o.angle * Math.PI / 180, g = Math.cos(-c), u = Math.sin(-c), r = a.x - o.x, k = a.y - o.y, x = r * g - k * u, D = r * u + k * g;
376
- (e === 0 || e === 3) && (o.width / 2, o.width = Math.abs(x) * 2), (e === 1 || e === 2) && (o.width = Math.abs(x) * 2), (e === 0 || e === 1) && (o.height = Math.abs(D) * 2), (e === 2 || e === 3) && (o.height = Math.abs(D) * 2);
380
+ const a = o.angle * Math.PI / 180, g = Math.cos(-a), u = Math.sin(-a), r = l.x - o.x, A = l.y - o.y, w = r * g - A * u, D = r * u + A * g;
381
+ (e === 0 || e === 3) && (o.width / 2, o.width = Math.abs(w) * 2), (e === 1 || e === 2) && (o.width = Math.abs(w) * 2), (e === 0 || e === 1) && (o.height = Math.abs(D) * 2), (e === 2 || e === 3) && (o.height = Math.abs(D) * 2);
377
382
  }
378
383
  }
379
384
  }
@@ -394,18 +399,18 @@ class he {
394
399
  const e = n.coordinates;
395
400
  return re(t, e.points);
396
401
  } else if (n.type === "rotatedRect") {
397
- const e = n.coordinates, a = At(t, { x: e.x, y: e.y }, -e.angle), o = e.width / 2, c = e.height / 2;
398
- return a.x >= e.x - o && a.x <= e.x + o && a.y >= e.y - c && a.y <= e.y + c;
402
+ const e = n.coordinates, l = At(t, { x: e.x, y: e.y }, -e.angle), o = e.width / 2, a = e.height / 2;
403
+ return l.x >= e.x - o && l.x <= e.x + o && l.y >= e.y - a && l.y <= e.y + a;
399
404
  } else if (n.type === "point")
400
- return n.coordinates.points.some((a) => pt(t, a) < 10 / this.scale);
405
+ return n.coordinates.points.some((l) => pt(t, l) < 10 / this.scale);
401
406
  return !1;
402
407
  }
403
408
  getHitHandle(t, n, e) {
404
- const a = this.getAnnotationHandles(e), o = 6;
405
- for (let c = 0; c < a.length; c++) {
406
- const g = a[c], u = this.toScreenCoords(g.x, g.y);
409
+ const l = this.getAnnotationHandles(e), o = 6;
410
+ for (let a = 0; a < l.length; a++) {
411
+ const g = l[a], u = this.toScreenCoords(g.x, g.y);
407
412
  if (Math.abs(t - u.x) < o && Math.abs(n - u.y) < o)
408
- return e.type === "rotatedRect" && c === 4 ? -2 : c;
413
+ return e.type === "rotatedRect" && a === 4 ? -2 : a;
409
414
  }
410
415
  return -100;
411
416
  }
@@ -428,16 +433,16 @@ class he {
428
433
  if (t.type === "point")
429
434
  return t.coordinates.points;
430
435
  if (t.type === "rotatedRect") {
431
- const n = t.coordinates, e = { x: n.x, y: n.y }, a = n.width / 2, o = n.height / 2, c = { x: n.x - a, y: n.y - o }, g = { x: n.x + a, y: n.y - o }, u = { x: n.x + a, y: n.y + o }, r = { x: n.x - a, y: n.y + o }, k = { x: n.x, y: n.y - o - 20 / this.scale };
432
- return [c, g, u, r, k].map((x) => At(x, e, n.angle));
436
+ const n = t.coordinates, e = { x: n.x, y: n.y }, l = n.width / 2, o = n.height / 2, a = { x: n.x - l, y: n.y - o }, g = { x: n.x + l, y: n.y - o }, u = { x: n.x + l, y: n.y + o }, r = { x: n.x - l, y: n.y + o }, A = { x: n.x, y: n.y - o - 20 / this.scale };
437
+ return [a, g, u, r, A].map((w) => At(w, e, n.angle));
433
438
  }
434
439
  }
435
440
  return [];
436
441
  }
437
442
  checkHover(t, n, e) {
438
- const a = this.getHitCategory(t, n);
439
- if (a) {
440
- this.canvas.style.cursor = "pointer", this.hoverAnnotation = a;
443
+ const l = this.getHitCategory(t, n);
444
+ if (l) {
445
+ this.canvas.style.cursor = "pointer", this.hoverAnnotation = l;
441
446
  return;
442
447
  }
443
448
  if (this.activeAnnotation && this.getHitHandle(t, n, this.activeAnnotation) !== -100) {
@@ -448,7 +453,11 @@ class he {
448
453
  o ? (this.canvas.style.cursor = "move", this.hoverAnnotation = o) : (this.canvas.style.cursor = "default", this.hoverAnnotation = null);
449
454
  }
450
455
  render() {
451
- this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height), this.img.complete && this.img.width > 0 && this.ctx.drawImage(this.img, this.offset.x, this.offset.y, this.img.width * this.scale, this.img.height * this.scale), this.annotations.forEach((t) => {
456
+ if (this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height), !this.img.complete || this.img.width === 0) {
457
+ this.ctx.save(), this.ctx.fillStyle = "#999", this.ctx.font = "14px sans-serif", this.ctx.textAlign = "center", this.ctx.textBaseline = "middle", this.ctx.fillText("Loading image...", this.canvas.width / 2, this.canvas.height / 2), this.ctx.restore();
458
+ return;
459
+ }
460
+ this.ctx.drawImage(this.img, this.offset.x, this.offset.y, this.img.width * this.scale, this.img.height * this.scale), this.annotations.forEach((t) => {
452
461
  t !== this.activeAnnotation && this.drawItem(t, !1);
453
462
  }), this.activeAnnotation && this.drawItem(this.activeAnnotation, !0), this.renderCategories();
454
463
  }
@@ -459,76 +468,103 @@ class he {
459
468
  const n = 12;
460
469
  t.forEach((e) => {
461
470
  var _;
462
- const a = e.label || "未命名分类", o = this.ctx.measureText(a).width + n * 2, c = 28, g = this.activeAnnotation === e, u = this.hoverAnnotation === e;
471
+ const l = e.label || "未命名分类", o = this.ctx.measureText(l).width + n * 2, a = 28, g = this.activeAnnotation === e, u = this.hoverAnnotation === e;
463
472
  let r = { x: 20, y: 20 };
464
473
  e.coordinates && typeof e.coordinates.x == "number" && typeof e.coordinates.y == "number" && (r = this.toScreenCoords(e.coordinates.x, e.coordinates.y));
465
- const k = r.x - o / 2, x = r.y - c / 2, D = ((_ = e.style) == null ? void 0 : _.strokeColor) || "#2196F3";
466
- this.ctx.fillStyle = g ? D : this.hexToRgba(D, 0.85), u && !g && (this.ctx.fillStyle = D), g ? (this.ctx.strokeStyle = "#ffffff", this.ctx.lineWidth = 2) : (this.ctx.strokeStyle = "transparent", this.ctx.lineWidth = 0), this.ctx.beginPath(), this.ctx.roundRect(k, x, o, c, 6), this.ctx.fill(), g && (this.ctx.stroke(), this.ctx.save(), this.ctx.strokeStyle = D, this.ctx.lineWidth = 2, this.ctx.strokeRect(k - 3, x - 3, o + 6, c + 6), this.ctx.restore()), this.ctx.fillStyle = "#ffffff", this.ctx.fillText(a, r.x, r.y);
474
+ const A = r.x - o / 2, w = r.y - a / 2, D = ((_ = e.style) == null ? void 0 : _.strokeColor) || "#2196F3";
475
+ this.ctx.fillStyle = g ? D : this.hexToRgba(D, 0.85), u && !g && (this.ctx.fillStyle = D), g ? (this.ctx.strokeStyle = "#ffffff", this.ctx.lineWidth = 2) : (this.ctx.strokeStyle = "transparent", this.ctx.lineWidth = 0), this.ctx.beginPath(), this.ctx.roundRect(A, w, o, a, 6), this.ctx.fill(), g && (this.ctx.stroke(), this.ctx.save(), this.ctx.strokeStyle = D, this.ctx.lineWidth = 2, this.ctx.strokeRect(A - 3, w - 3, o + 6, a + 6), this.ctx.restore()), this.ctx.fillStyle = "#ffffff", this.ctx.fillText(l, r.x, r.y);
467
476
  }), this.ctx.restore();
468
477
  }
469
478
  getHitCategory(t, n) {
470
479
  const e = this.annotations.filter((g) => g.type === "category");
471
480
  if (e.length === 0) return null;
472
481
  this.ctx.save(), this.ctx.font = "14px sans-serif";
473
- const a = 12, o = 28;
474
- let c = null;
482
+ const l = 12, o = 28;
483
+ let a = null;
475
484
  for (let g = e.length - 1; g >= 0; g--) {
476
- const u = e[g], r = u.label || "未命名分类", k = this.ctx.measureText(r).width + a * 2;
477
- let x = { x: 20, y: 20 };
478
- u.coordinates && typeof u.coordinates.x == "number" && typeof u.coordinates.y == "number" && (x = this.toScreenCoords(u.coordinates.x, u.coordinates.y));
479
- const D = x.x - k / 2, _ = x.y - o / 2;
480
- if (t >= D && t <= D + k && n >= _ && n <= _ + o) {
481
- c = u;
485
+ const u = e[g], r = u.label || "未命名分类", A = this.ctx.measureText(r).width + l * 2;
486
+ let w = { x: 20, y: 20 };
487
+ u.coordinates && typeof u.coordinates.x == "number" && typeof u.coordinates.y == "number" && (w = this.toScreenCoords(u.coordinates.x, u.coordinates.y));
488
+ const D = w.x - A / 2, _ = w.y - o / 2;
489
+ if (t >= D && t <= D + A && n >= _ && n <= _ + o) {
490
+ a = u;
482
491
  break;
483
492
  }
484
493
  }
485
- return this.ctx.restore(), c;
494
+ return this.ctx.restore(), a;
486
495
  }
487
496
  drawItem(t, n) {
488
497
  var o;
489
498
  if (this.visibleLabels.size > 0 && !this.visibleLabels.has(t.label) && !n)
490
499
  return;
491
500
  this.ctx.save();
492
- const e = ((o = t.style) == null ? void 0 : o.strokeColor) || "#FF4081", a = n ? "#00E5FF" : e;
493
- if (this.ctx.strokeStyle = a, this.ctx.lineWidth = 2, t.type === "rectangle") {
494
- const c = t.coordinates, g = this.toScreenCoords(c.x1, c.y1), u = this.toScreenCoords(c.x2, c.y2), r = Math.min(g.x, u.x), k = Math.min(g.y, u.y), x = Math.abs(g.x - u.x), D = Math.abs(g.y - u.y);
495
- this.ctx.strokeRect(r, k, x, D), n && this.drawHandles(this.getAnnotationHandles(t));
501
+ const e = ((o = t.style) == null ? void 0 : o.strokeColor) || "#FF4081", l = n ? "#00E5FF" : e;
502
+ if (this.ctx.strokeStyle = l, this.ctx.lineWidth = 2, t.type === "rectangle") {
503
+ const a = t.coordinates, g = this.toScreenCoords(a.x1, a.y1), u = this.toScreenCoords(a.x2, a.y2), r = Math.min(g.x, u.x), A = Math.min(g.y, u.y), w = Math.abs(g.x - u.x), D = Math.abs(g.y - u.y);
504
+ this.ctx.strokeRect(r, A, w, D), n && this.drawHandles(this.getAnnotationHandles(t));
496
505
  } else if (t.type === "polygon") {
497
- const c = t.coordinates;
498
- if (c.points.length === 0) {
506
+ const a = t.coordinates;
507
+ if (a.points.length === 0) {
499
508
  this.ctx.restore();
500
509
  return;
501
510
  }
502
511
  this.ctx.beginPath();
503
- const g = this.toScreenCoords(c.points[0].x, c.points[0].y);
512
+ const g = this.toScreenCoords(a.points[0].x, a.points[0].y);
504
513
  this.ctx.moveTo(g.x, g.y);
505
- for (let u = 1; u < c.points.length; u++) {
506
- const r = this.toScreenCoords(c.points[u].x, c.points[u].y);
514
+ for (let u = 1; u < a.points.length; u++) {
515
+ const r = this.toScreenCoords(a.points[u].x, a.points[u].y);
507
516
  this.ctx.lineTo(r.x, r.y);
508
517
  }
509
518
  if (!this.isDrawing || t !== this.activeAnnotation)
510
519
  this.ctx.closePath();
511
520
  else if (this.lastMouseMovePoint) {
512
521
  let u = this.lastMouseMovePoint;
513
- if (this.isHoveringStartPoint && c.points.length > 0) {
514
- u = c.points[0];
515
- const k = this.toScreenCoords(c.points[0].x, c.points[0].y);
516
- this.ctx.save(), this.ctx.beginPath(), this.ctx.arc(k.x, k.y, 10, 0, Math.PI * 2), this.ctx.fillStyle = "rgba(255, 215, 0, 0.6)", this.ctx.strokeStyle = "#FFFFFF", this.ctx.lineWidth = 2, this.ctx.fill(), this.ctx.stroke(), this.ctx.restore();
522
+ if (this.isHoveringStartPoint && a.points.length > 0) {
523
+ u = a.points[0];
524
+ const A = this.toScreenCoords(a.points[0].x, a.points[0].y);
525
+ this.ctx.save(), this.ctx.beginPath(), this.ctx.arc(A.x, A.y, 10, 0, Math.PI * 2), this.ctx.fillStyle = "rgba(255, 215, 0, 0.6)", this.ctx.strokeStyle = "#FFFFFF", this.ctx.lineWidth = 2, this.ctx.fill(), this.ctx.stroke(), this.ctx.restore();
517
526
  }
518
527
  const r = this.toScreenCoords(u.x, u.y);
519
528
  this.ctx.lineTo(r.x, r.y);
520
529
  }
521
530
  this.ctx.stroke(), n && this.drawHandles(this.getAnnotationHandles(t));
522
531
  } else if (t.type === "rotatedRect") {
523
- const c = t.coordinates;
524
- this.ctx.translate(this.toScreenCoords(c.x, c.y).x, this.toScreenCoords(c.x, c.y).y), this.ctx.rotate(c.angle * Math.PI / 180);
525
- const g = c.width * this.scale, u = c.height * this.scale;
526
- this.ctx.strokeRect(-g / 2, -u / 2, g, u), this.ctx.rotate(-c.angle * Math.PI / 180), this.ctx.translate(-this.toScreenCoords(c.x, c.y).x, -this.toScreenCoords(c.x, c.y).y), n && this.drawHandles(this.getAnnotationHandles(t));
532
+ const a = t.coordinates;
533
+ this.ctx.translate(this.toScreenCoords(a.x, a.y).x, this.toScreenCoords(a.x, a.y).y), this.ctx.rotate(a.angle * Math.PI / 180);
534
+ const g = a.width * this.scale, u = a.height * this.scale;
535
+ this.ctx.strokeRect(-g / 2, -u / 2, g, u), this.ctx.rotate(-a.angle * Math.PI / 180), this.ctx.translate(-this.toScreenCoords(a.x, a.y).x, -this.toScreenCoords(a.x, a.y).y), n && this.drawHandles(this.getAnnotationHandles(t));
527
536
  } else t.type === "point" && t.coordinates.points.forEach((g) => {
528
537
  const u = this.toScreenCoords(g.x, g.y);
529
538
  this.ctx.beginPath(), this.ctx.arc(u.x, u.y, 5, 0, Math.PI * 2), this.ctx.fillStyle = n ? "#00E5FF" : e, this.ctx.fill(), this.ctx.stroke();
530
539
  });
531
- this.ctx.restore();
540
+ this.showLabels && t.label && t.type !== "category" && this.drawAnnotationLabel(t, e), this.ctx.restore();
541
+ }
542
+ drawAnnotationLabel(t, n) {
543
+ let e = 0, l = 0;
544
+ if (t.type === "rectangle") {
545
+ const o = t.coordinates, a = this.toScreenCoords(Math.min(o.x1, o.x2), Math.min(o.y1, o.y2));
546
+ e = a.x, l = a.y - 8;
547
+ } else if (t.type === "polygon") {
548
+ const o = t.coordinates;
549
+ if (o.points.length > 0) {
550
+ const a = this.toScreenCoords(o.points[0].x, o.points[0].y);
551
+ e = a.x, l = a.y - 8;
552
+ }
553
+ } else if (t.type === "rotatedRect") {
554
+ const o = t.coordinates, a = this.toScreenCoords(o.x, o.y - o.height / 2);
555
+ e = a.x, l = a.y - 8;
556
+ } else if (t.type === "point") {
557
+ const o = t.coordinates;
558
+ if (o.points.length > 0) {
559
+ const a = this.toScreenCoords(o.points[0].x, o.points[0].y);
560
+ e = a.x, l = a.y - 8;
561
+ }
562
+ }
563
+ if (e !== 0 || l !== 0) {
564
+ this.ctx.save(), this.ctx.font = "12px sans-serif", this.ctx.textBaseline = "bottom";
565
+ const o = t.label, a = this.ctx.measureText(o).width, g = 8, u = 4;
566
+ this.ctx.fillStyle = this.hexToRgba(n, 0.8), this.ctx.beginPath(), this.ctx.roundRect(e, l - 14 - u, a + g * 2, 14 + u * 2, 4), this.ctx.fill(), this.ctx.fillStyle = "#FFFFFF", this.ctx.fillText(o, e + g, l), this.ctx.restore();
567
+ }
532
568
  }
533
569
  drawHandles(t) {
534
570
  this.ctx.fillStyle = "#FFFFFF", this.ctx.strokeStyle = "#000000", this.ctx.lineWidth = 1, t.forEach((n) => {
@@ -537,31 +573,31 @@ class he {
537
573
  });
538
574
  }
539
575
  }
540
- const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032114659" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="21132" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 391.68c-66.56 0-120.32 54.187-120.32 120.32 0 66.56 53.76 120.32 120.32 120.32 66.133 0 120.32-53.76 120.32-120.32A120.747 120.747 0 0 0 512 391.68z" p-id="21133" fill="#515151"></path><path d="M512 113.493c-219.733 0-398.507 178.774-398.507 398.507S292.267 910.507 512 910.507 910.507 731.733 910.507 512 731.733 113.493 512 113.493z m0 720.214c-177.493 0-321.707-144.214-321.707-321.707S334.507 190.293 512 190.293 833.707 334.507 833.707 512 689.493 833.707 512 833.707z" p-id="21134" fill="#515151"></path></svg>', ge = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M15.7 4.3c.4.4.4 1 0 1.4L9.4 12l6.3 6.3c.4.4.4 1 0 1.4-.4.4-1 .4-1.4 0l-7-7c-.4-.4-.4-1 0-1.4l7-7c.4-.4 1-.4 1.4 0z"/></svg>', ue = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032015085" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16560" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M911.872 972.629333l-2.645333-1.621333-209.92-208.554667-91.306667 193.194667-147.029333-494.933333 486.4 179.968-177.834667 68.266666 201.472 200.362667a9.898667 9.898667 0 0 1 2.133333 4.608 10.069333 10.069333 0 0 1-1.024 4.778667l-2.389333 3.157333-47.786667 47.530667a9.813333 9.813333 0 0 1-4.522666 2.901333 12.544 12.544 0 0 1-2.56 0z m-657.066667-12.970666L0.256 501.248l97.109333-175.445333 64.256-115.456L254.805333 42.581333h510.208l259.328 466.858667h-100.608L714.325333 132.778667H305.322667l-204.8 368.384 204.8 368.725333H418.133333v90.026667z" fill="#515151" p-id="16561"></path></svg>', ve = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032973956" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6763" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M613.6 960H97.2c-17.7 0-32-14.3-32-32V98.5c0-17.7 14.3-32 32-32h829.5c17.7 0 32 14.3 32 32v518.2c0 17.7-14.3 32-32 32s-32-14.3-32-32V130.5H129.2V896h484.4c17.7 0 32 14.3 32 32s-14.3 32-32 32z" fill="#515151" p-id="6764"></path><path d="M711.3 694.9l120.3 46.9-100.7 80.7z" fill="#515151" p-id="6765"></path><path d="M707.6 882.1L671.3 645l223.6 87.1-187.3 150z m43.7-137.3l2.8 18 14.2-11.4-17-6.6z" fill="#515151" p-id="6766"></path><path d="M927 957.9c-8.2 0-16.4-3.1-22.6-9.4L723.2 767.2c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l181.2 181.2c12.5 12.5 12.5 32.8 0 45.3-6.3 6.3-14.5 9.5-22.7 9.5z" fill="#515151" p-id="6767"></path></svg>', fe = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M19 6h-4V5c0-1.1-.9-2-2-2h-2c-1.1 0-2 .9-2 2v1H5c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1zM10 5h4v1h-4V5z"/><path fill="currentColor" d="M6 9v10c0 1.7 1.3 3 3 3h6c1.7 0 3-1.3 3-3V9H6zm4 9c0 .6-.4 1-1 1s-1-.4-1-1v-5c0-.6.4-1 1-1s1 .4 1 1v5zm4 0c0 .6-.4 1-1 1s-1-.4-1-1v-5c0-.6.4-1 1-1s1 .4 1 1v5z"/></svg>', me = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M19 15v4c0 1.1-.9 2-2 2H7c-1.1 0-2-.9-2-2v-4c0-.6.4-1 1-1s1 .4 1 1v4h10v-4c0-.6.4-1 1-1s1 .4 1 1zm-7.7 1.3c.2.2.4.3.7.3s.5-.1.7-.3l4.6-4.6c.4-.4.4-1 0-1.4-.4-.4-1-.4-1.4 0l-2.9 2.9V3c0-.6-.4-1-1-1s-1 .4-1 1v8.3l-2.9-2.9c-.4-.4-1-.4-1.4 0-.4.4-.4 1 0 1.4l4.6 4.6z"/></svg>', pe = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M3 17.2v4.3c0 .3.2.5.5.5h4.3c.1 0 .3-.1.4-.2l11.1-11.1-5.1-5.1L3.1 16.8c-.1.1-.1.3-.1.4zm18.8-10.9c.4-.4.4-1 0-1.4l-3.7-3.7c-.4-.4-1-.4-1.4 0l-2.3 2.3 5.1 5.1 2.3-2.3z"/></svg>', ye = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M18.7 4.3c.4.4.4 1 0 1.4L12.4 12l6.3 6.3c.4.4.4 1 0 1.4-.4.4-1 .4-1.4 0l-7-7c-.4-.4-.4-1 0-1.4l7-7c.4-.4 1-.4 1.4 0z"/><path fill="currentColor" d="M10.7 4.3c.4.4.4 1 0 1.4L4.4 12l6.3 6.3c.4.4.4 1 0 1.4-.4.4-1 .4-1.4 0l-7-7c-.4-.4-.4-1 0-1.4l7-7c.4-.4 1-.4 1.4 0z"/></svg>', we = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032412624" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3527" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M870.2976 144.0256l51.2 51.2-122.88 122.88a514.304 514.304 0 0 1 170.7264 193.8688C885.0432 679.04 711.8848 793.6 512 793.6c-56.832 0-111.488-9.2672-162.56-26.3424L197.4016 919.296l-51.2-51.2L870.2976 144.0256z m-127.1552 229.5296l-76.6208 76.6208a166.4 166.4 0 0 1-216.32 216.3712l-38.6048 38.5792c29.5168 6.9632 60.032 10.9312 91.1872 11.5712L512 716.8c150.6816 0 287.488-77.2096 366.464-200.3456l2.816-4.48-2.816-4.48a435.8144 435.8144 0 0 0-135.3216-133.9392zM512 230.4c49.664 0 97.664 7.0656 143.0528 20.2496l-63.8208 63.7696a436.4032 436.4032 0 0 0-70.016-7.1168L512 307.2a434.8928 434.8928 0 0 0-366.464 200.3456l-2.816 4.48 2.816 4.48a435.84 435.84 0 0 0 119.8848 123.776l-55.0912 55.04a514.2528 514.2528 0 0 1-155.648-183.296C138.9312 344.96 312.0896 230.4 512 230.4z m89.5488 284.8l-86.3744 86.2976 1.7408-0.0256a89.6 89.6 0 0 0 84.6336-86.272zM512 345.6a166.656 166.656 0 0 1 42.5728 5.504l-79.0272 79.0272a89.9328 89.9328 0 0 0-45.4144 45.4144l-79.0272 79.0272A166.4 166.4 0 0 1 512 345.6z" p-id="3528" fill="#515151"></path></svg>', xe = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M5.3 19.7c-.4-.4-.4-1 0-1.4l6.3-6.3-6.3-6.3c-.4-.4-.4-1 0-1.4.4-.4 1-.4 1.4 0l7 7c.4.4.4 1 0 1.4l-7 7c-.4.4-1 .4-1.4 0z"/><path fill="currentColor" d="M13.3 19.7c-.4-.4-.4-1 0-1.4l6.3-6.3-6.3-6.3c-.4-.4-.4-1 0-1.4.4-.4 1-.4 1.4 0l7 7c.4.4.4 1 0 1.4l-7 7c-.4.4-1 .4-1.4 0z"/></svg>', be = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775031871732" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12257" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M174.63 78.98c0.03-12.61 16.41-19.91 25.81-11.5l328.72 293.98 318.27 284.63c10.51 9.4 0.4 26.75-14.25 24.46L435.7 608.43c-6.23-0.97-12.72 1.92-16.16 7.2L199.96 952.72c-8.09 12.42-27.76 8.34-27.72-5.76l1.17-426.97 1.22-441.01z" fill="#515151" p-id="12258"></path></svg>', Ce = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032210611" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="23146" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M543.487882 0.00128a161.919393 161.919393 0 0 0-114.55957 47.359822L47.553742 428.991671a162.111392 162.111392 0 0 0 0 229.119141l318.270806 318.398806a161.983393 161.983393 0 0 0 229.119141 0l381.630569-381.694569A162.111392 162.111392 0 0 0 1023.99808 480.255479V161.920673A161.919393 161.919393 0 0 0 861.886688 0.00128H543.487882z m0 90.55966l318.462806 0.064a71.295733 71.295733 0 0 1 71.487732 71.295733v318.270806c0 18.943929-7.615971 37.119861-21.055921 50.559811l-381.56657 381.758568a71.423732 71.423732 0 0 1-101.055621 0L111.489502 594.111052a71.487732 71.487732 0 0 1 0-101.119621l381.566569-381.566569c13.37595-13.37595 31.551882-20.863922 50.431811-20.863922z m112.447578 124.159535a153.023426 153.023426 0 1 0 0 306.046852 153.023426 153.023426 0 0 0 0-306.046852z m57.727784 129.151515a62.463766 62.463766 0 1 1-115.455567 47.807821 62.463766 62.463766 0 0 1 115.455567-47.807821z" p-id="23147" fill="#515151"></path></svg>', _e = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775096284335" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4580" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M308.377435 102.251961C318.982967 47.176334 372.449479 0 448.66303 0c39.496466 0 68.314257 20.040799 85.063685 46.07921 11.995223 18.577967 17.919693 39.935315 20.040799 60.341823 13.384913-4.388496 27.35496-6.582744 41.398147-6.655886 38.911333 0 68.021691 19.455666 85.72196 44.616378 16.822569 23.990446 23.551596 53.100804 23.551596 79.724347v29.988058c0.146283 98.960589 0.292566 197.921178 0.658274 296.954909-0.073142 13.165489 1.097124 26.47726 3.510797 39.569608 8.484426-7.533585 16.237436-15.213453 24.795004-23.69788l13.165488-13.019205c13.970046-13.604338 30.353765-28.598367 49.809432-41.178723 42.056422-27.208676 93.694394-39.642749 162.813209-22.600755 27.574384 6.802169 44.982086 25.380136 54.344211 44.543236 8.776992 18.285401 11.117524 38.545625 10.386108 56.392176-1.38969 33.864562-14.920887 75.26271-43.738679 101.447404l-1.755398 1.755398c-37.375359 36.424518-75.335851 72.263904-113.881477 107.518157-31.450889 28.964075-63.486912 57.050451-96.327491 84.478552-29.037217 24.063587-58.293858 46.51806-80.967755 58.952132A491.511574 491.511574 0 0 1 421.527495 1023.982446a45.567219 45.567219 0 0 1-46.810626-44.25067c0-24.795004 20.699074-44.835803 46.225493-44.762661a395.403507 395.403507 0 0 0 215.036314-64.072045 49.955715 49.955715 0 0 1 4.022788-2.340531c13.458055-7.167877 37.009651-24.502437 67.363417-49.590007 31.597173-26.47726 62.609212-53.612795 92.889836-81.552888a5027.973235 5027.973235 0 0 0 111.687228-105.470192l1.755399-1.755398 0.585133-0.511991 1.682257-1.535974a42.056422 42.056422 0 0 0 9.362125-15.140312c3.291372-8.118718 5.119912-16.749427 5.631903-25.453278a46.07921 46.07921 0 0 0-1.023982-12.580356c-39.715891-8.557568-62.536071-0.658274-81.479746 11.556374a234.126272 234.126272 0 0 0-35.473678 29.841774l-10.386108 10.239824c-9.800975 9.654692-20.845357 20.699074-31.96288 30.500049l-0.146283 0.146283c-19.016817 16.603144-42.787838 31.597173-70.435364 32.182306a74.897002 74.897002 0 0 1-65.096027-35.54682 141.602144 141.602144 0 0 1-18.870534-51.930538 302.074822 302.074822 0 0 1-4.169071-50.613989c-0.365708-99.033731-0.511991-198.213745-0.511992-297.247476v-29.988058c0-13.311772-3.65708-24.136729-7.826151-30.13434a13.896905 13.896905 0 0 0-4.388496-4.388496 7.679868 7.679868 0 0 0-4.022789-0.804558 46.956909 46.956909 0 0 0-28.232658 10.532391 30.719473 30.719473 0 0 0-12.214648 24.721862v232.736582a45.567219 45.567219 0 0 1-46.591201 44.543236 45.567219 45.567219 0 0 1-46.51806-44.616378V124.340726c0-14.628321-3.364514-25.745844-7.094736-31.45089a10.093541 10.093541 0 0 0-2.925664-3.364514 1.901682 1.901682 0 0 0-0.511991-0.292566 9.435267 9.435267 0 0 0-2.340531-0.146283c-38.618767 0-49.443724 23.697879-49.078016 33.791421v1.682256l-0.292567 77.822666v3.876505l-1.023982 253.508797a45.567219 45.567219 0 0 1-46.810626 44.323812 45.567219 45.567219 0 0 1-46.298635-44.68952l1.023983-250.656274a32.036022 32.036022 0 0 0-7.75301-15.140312c-1.82854-1.682257-5.851328-4.827346-17.188277-4.827346a41.178723 41.178723 0 0 0-26.477261 9.069559c-5.558762 4.754204-10.678674 12.580356-10.678674 26.257835v296.589202a45.567219 45.567219 0 0 1-46.518059 44.543236 45.567219 45.567219 0 0 1-46.51806-44.616378v-169.688519a31.158323 31.158323 0 0 0-4.607921-5.705045 11.84894 11.84894 0 0 0-5.193054-3.218231c-1.023982-0.292566-4.681063-1.023982-12.653497 1.462832-17.700268 5.705045-26.111552 14.994029-30.792615 27.208676-5.48562 14.189471-6.582744 35.10797-1.097124 61.438947 42.202705 201.139409 64.949744 301.123981 83.162003 350.34828 16.091153 43.372971 47.615184 81.918596 90.915013 109.566122a43.372971 43.372971 0 0 1 12.872922 61.804654 47.834609 47.834609 0 0 1-64.510894 12.28779c-59.171557-37.741067-103.934218-91.500146-127.046965-153.963075C71.179216 755.406479 46.896203 647.449472 5.571197 449.601435-1.889246 414.127758-3.059512 375.216425 10.471685 340.108455 24.734297 302.806238 54.210364 273.330171 99.265591 258.921276c16.603144-5.558762 34.376554-7.460444 51.784255-5.631904v-29.256641c0-81.18718 67.655983-124.340726 130.265196-124.340726 9.435267 0 18.431684 0.877699 27.062393 2.486815z" p-id="4581" fill="#515151"></path></svg>', ke = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775033156525" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3463" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M694.4 960H195.2C131.7 960 80 908.4 80 845.1V462c0-63.4 51.7-114.9 115.2-114.9h499.2c63.5 0 115.2 51.6 115.2 114.9v383.1c0 63.3-51.7 114.9-115.2 114.9zM195.2 423.7c-21.2 0-38.4 17.2-38.4 38.3v383.1c0 21.1 17.2 38.3 38.4 38.3h499.2c21.2 0 38.4-17.2 38.4-38.3V462c0-21.1-17.2-38.3-38.4-38.3H195.2z" fill="#515151" p-id="3464"></path><path d="M905.6 450.3c-14.8 0-28.9-8.6-35.2-23C788.6 240.8 592.7 213 483.2 213c-21.2 0-38.4-17.2-38.4-38.3s17.2-38.3 38.4-38.3c218.2 0 385 94.9 457.6 260.3 8.5 19.4-0.4 42-19.8 50.5-5 2.1-10.3 3.1-15.4 3.1z" fill="#515151" p-id="3465"></path><path d="M473.6 285.4c-9.8 0-19.7-3.7-27.2-11.2l-72.5-72.4c-15-15-15-39.2 0-54.2l72.5-72.4c15-15 39.3-15 54.3 0s15 39.2 0 54.2l-45.4 45.3 45.4 45.3c15 15 15 39.2 0 54.2-7.4 7.4-17.3 11.2-27.1 11.2z" fill="#515151" p-id="3466"></path></svg>', Ie = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M8.3 19.7c-.4-.4-.4-1 0-1.4l6.3-6.3-6.3-6.3c-.4-.4-.4-1 0-1.4.4-.4 1-.4 1.4 0l7 7c.4.4.4 1 0 1.4l-7 7c-.4.4-1 .4-1.4 0z"/></svg>', Ae = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032400373" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3314" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 230.4c199.8848 0 373.0176 114.5344 457.344 281.5744C885.0432 679.04 711.8848 793.6 512 793.6c-199.8848 0-373.0176-114.5344-457.344-281.5744C138.9568 344.96 312.1152 230.4 512 230.4z m0 76.8a434.8928 434.8928 0 0 0-366.464 200.3456l-2.816 4.48 2.816 4.48a434.944 434.944 0 0 0 357.248 200.192L512 716.8c150.6816 0 287.488-77.2096 366.464-200.3456l2.816-4.48-2.816-4.48a434.944 434.944 0 0 0-357.248-200.192L512 307.2z m0 38.4a166.4 166.4 0 1 1 0 332.8 166.4 166.4 0 0 1 0-332.8z m0 76.8a89.6 89.6 0 1 0 0 179.2 89.6 89.6 0 0 0 0-179.2z" p-id="3315" fill="#515151"></path></svg>', Se = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032548251" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4695" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M849.7664 778.1376c1.9968 1.4848 3.84 3.072 5.632 4.864l72.3968 72.3968a51.2 51.2 0 1 1-72.3968 72.3968l-72.3968-72.3968a51.6096 51.6096 0 0 1-4.864-5.632 448 448 0 1 1 71.68-71.68zM460.8 460.8V358.4a51.2 51.2 0 1 1 102.4 0v102.4h102.4a51.2 51.2 0 0 1 0 102.4h-102.4v102.4a51.2 51.2 0 0 1-102.4 0v-102.4H358.4a51.2 51.2 0 0 1 0-102.4h102.4z m38.4 384a345.6 345.6 0 1 0 0-691.2 345.6 345.6 0 0 0 0 691.2z" fill="#515151" p-id="4696"></path></svg>', Me = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032629657" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1933" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M849.7664 778.1376c1.9968 1.4848 3.84 3.072 5.632 4.864l72.3968 72.3968a51.2 51.2 0 1 1-72.3968 72.3968l-72.3968-72.3968a51.6096 51.6096 0 0 1-4.864-5.632 448 448 0 1 1 71.68-71.68zM499.2 844.8a345.6 345.6 0 1 0 0-691.2 345.6 345.6 0 0 0 0 691.2zM358.4 563.2a51.2 51.2 0 0 1 0-102.4h307.2a51.2 51.2 0 0 1 0 102.4H358.4z" fill="#666666" p-id="1934"></path></svg>', Te = ["innerHTML"], De = /* @__PURE__ */ ct({
576
+ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032114659" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="21132" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 391.68c-66.56 0-120.32 54.187-120.32 120.32 0 66.56 53.76 120.32 120.32 120.32 66.133 0 120.32-53.76 120.32-120.32A120.747 120.747 0 0 0 512 391.68z" p-id="21133" fill="#515151"></path><path d="M512 113.493c-219.733 0-398.507 178.774-398.507 398.507S292.267 910.507 512 910.507 910.507 731.733 910.507 512 731.733 113.493 512 113.493z m0 720.214c-177.493 0-321.707-144.214-321.707-321.707S334.507 190.293 512 190.293 833.707 334.507 833.707 512 689.493 833.707 512 833.707z" p-id="21134" fill="#515151"></path></svg>', ge = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M15.7 4.3c.4.4.4 1 0 1.4L9.4 12l6.3 6.3c.4.4.4 1 0 1.4-.4.4-1 .4-1.4 0l-7-7c-.4-.4-.4-1 0-1.4l7-7c.4-.4 1-.4 1.4 0z"/></svg>', ue = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032015085" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16560" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M911.872 972.629333l-2.645333-1.621333-209.92-208.554667-91.306667 193.194667-147.029333-494.933333 486.4 179.968-177.834667 68.266666 201.472 200.362667a9.898667 9.898667 0 0 1 2.133333 4.608 10.069333 10.069333 0 0 1-1.024 4.778667l-2.389333 3.157333-47.786667 47.530667a9.813333 9.813333 0 0 1-4.522666 2.901333 12.544 12.544 0 0 1-2.56 0z m-657.066667-12.970666L0.256 501.248l97.109333-175.445333 64.256-115.456L254.805333 42.581333h510.208l259.328 466.858667h-100.608L714.325333 132.778667H305.322667l-204.8 368.384 204.8 368.725333H418.133333v90.026667z" fill="#515151" p-id="16561"></path></svg>', ve = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032973956" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6763" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M613.6 960H97.2c-17.7 0-32-14.3-32-32V98.5c0-17.7 14.3-32 32-32h829.5c17.7 0 32 14.3 32 32v518.2c0 17.7-14.3 32-32 32s-32-14.3-32-32V130.5H129.2V896h484.4c17.7 0 32 14.3 32 32s-14.3 32-32 32z" fill="#515151" p-id="6764"></path><path d="M711.3 694.9l120.3 46.9-100.7 80.7z" fill="#515151" p-id="6765"></path><path d="M707.6 882.1L671.3 645l223.6 87.1-187.3 150z m43.7-137.3l2.8 18 14.2-11.4-17-6.6z" fill="#515151" p-id="6766"></path><path d="M927 957.9c-8.2 0-16.4-3.1-22.6-9.4L723.2 767.2c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l181.2 181.2c12.5 12.5 12.5 32.8 0 45.3-6.3 6.3-14.5 9.5-22.7 9.5z" fill="#515151" p-id="6767"></path></svg>', fe = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M19 6h-4V5c0-1.1-.9-2-2-2h-2c-1.1 0-2 .9-2 2v1H5c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1zM10 5h4v1h-4V5z"/><path fill="currentColor" d="M6 9v10c0 1.7 1.3 3 3 3h6c1.7 0 3-1.3 3-3V9H6zm4 9c0 .6-.4 1-1 1s-1-.4-1-1v-5c0-.6.4-1 1-1s1 .4 1 1v5zm4 0c0 .6-.4 1-1 1s-1-.4-1-1v-5c0-.6.4-1 1-1s1 .4 1 1v5z"/></svg>', me = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M19 15v4c0 1.1-.9 2-2 2H7c-1.1 0-2-.9-2-2v-4c0-.6.4-1 1-1s1 .4 1 1v4h10v-4c0-.6.4-1 1-1s1 .4 1 1zm-7.7 1.3c.2.2.4.3.7.3s.5-.1.7-.3l4.6-4.6c.4-.4.4-1 0-1.4-.4-.4-1-.4-1.4 0l-2.9 2.9V3c0-.6-.4-1-1-1s-1 .4-1 1v8.3l-2.9-2.9c-.4-.4-1-.4-1.4 0-.4.4-.4 1 0 1.4l4.6 4.6z"/></svg>', pe = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M3 17.2v4.3c0 .3.2.5.5.5h4.3c.1 0 .3-.1.4-.2l11.1-11.1-5.1-5.1L3.1 16.8c-.1.1-.1.3-.1.4zm18.8-10.9c.4-.4.4-1 0-1.4l-3.7-3.7c-.4-.4-1-.4-1.4 0l-2.3 2.3 5.1 5.1 2.3-2.3z"/></svg>', ye = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M18.7 4.3c.4.4.4 1 0 1.4L12.4 12l6.3 6.3c.4.4.4 1 0 1.4-.4.4-1 .4-1.4 0l-7-7c-.4-.4-.4-1 0-1.4l7-7c.4-.4 1-.4 1.4 0z"/><path fill="currentColor" d="M10.7 4.3c.4.4.4 1 0 1.4L4.4 12l6.3 6.3c.4.4.4 1 0 1.4-.4.4-1 .4-1.4 0l-7-7c-.4-.4-.4-1 0-1.4l7-7c.4-.4 1-.4 1.4 0z"/></svg>', xe = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032412624" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3527" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M870.2976 144.0256l51.2 51.2-122.88 122.88a514.304 514.304 0 0 1 170.7264 193.8688C885.0432 679.04 711.8848 793.6 512 793.6c-56.832 0-111.488-9.2672-162.56-26.3424L197.4016 919.296l-51.2-51.2L870.2976 144.0256z m-127.1552 229.5296l-76.6208 76.6208a166.4 166.4 0 0 1-216.32 216.3712l-38.6048 38.5792c29.5168 6.9632 60.032 10.9312 91.1872 11.5712L512 716.8c150.6816 0 287.488-77.2096 366.464-200.3456l2.816-4.48-2.816-4.48a435.8144 435.8144 0 0 0-135.3216-133.9392zM512 230.4c49.664 0 97.664 7.0656 143.0528 20.2496l-63.8208 63.7696a436.4032 436.4032 0 0 0-70.016-7.1168L512 307.2a434.8928 434.8928 0 0 0-366.464 200.3456l-2.816 4.48 2.816 4.48a435.84 435.84 0 0 0 119.8848 123.776l-55.0912 55.04a514.2528 514.2528 0 0 1-155.648-183.296C138.9312 344.96 312.0896 230.4 512 230.4z m89.5488 284.8l-86.3744 86.2976 1.7408-0.0256a89.6 89.6 0 0 0 84.6336-86.272zM512 345.6a166.656 166.656 0 0 1 42.5728 5.504l-79.0272 79.0272a89.9328 89.9328 0 0 0-45.4144 45.4144l-79.0272 79.0272A166.4 166.4 0 0 1 512 345.6z" p-id="3528" fill="#515151"></path></svg>', we = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M5.3 19.7c-.4-.4-.4-1 0-1.4l6.3-6.3-6.3-6.3c-.4-.4-.4-1 0-1.4.4-.4 1-.4 1.4 0l7 7c.4.4.4 1 0 1.4l-7 7c-.4.4-1 .4-1.4 0z"/><path fill="currentColor" d="M13.3 19.7c-.4-.4-.4-1 0-1.4l6.3-6.3-6.3-6.3c-.4-.4-.4-1 0-1.4.4-.4 1-.4 1.4 0l7 7c.4.4.4 1 0 1.4l-7 7c-.4.4-1 .4-1.4 0z"/></svg>', be = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775031871732" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12257" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M174.63 78.98c0.03-12.61 16.41-19.91 25.81-11.5l328.72 293.98 318.27 284.63c10.51 9.4 0.4 26.75-14.25 24.46L435.7 608.43c-6.23-0.97-12.72 1.92-16.16 7.2L199.96 952.72c-8.09 12.42-27.76 8.34-27.72-5.76l1.17-426.97 1.22-441.01z" fill="#515151" p-id="12258"></path></svg>', Ce = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032210611" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="23146" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M543.487882 0.00128a161.919393 161.919393 0 0 0-114.55957 47.359822L47.553742 428.991671a162.111392 162.111392 0 0 0 0 229.119141l318.270806 318.398806a161.983393 161.983393 0 0 0 229.119141 0l381.630569-381.694569A162.111392 162.111392 0 0 0 1023.99808 480.255479V161.920673A161.919393 161.919393 0 0 0 861.886688 0.00128H543.487882z m0 90.55966l318.462806 0.064a71.295733 71.295733 0 0 1 71.487732 71.295733v318.270806c0 18.943929-7.615971 37.119861-21.055921 50.559811l-381.56657 381.758568a71.423732 71.423732 0 0 1-101.055621 0L111.489502 594.111052a71.487732 71.487732 0 0 1 0-101.119621l381.566569-381.566569c13.37595-13.37595 31.551882-20.863922 50.431811-20.863922z m112.447578 124.159535a153.023426 153.023426 0 1 0 0 306.046852 153.023426 153.023426 0 0 0 0-306.046852z m57.727784 129.151515a62.463766 62.463766 0 1 1-115.455567 47.807821 62.463766 62.463766 0 0 1 115.455567-47.807821z" p-id="23147" fill="#515151"></path></svg>', _e = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775096284335" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4580" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M308.377435 102.251961C318.982967 47.176334 372.449479 0 448.66303 0c39.496466 0 68.314257 20.040799 85.063685 46.07921 11.995223 18.577967 17.919693 39.935315 20.040799 60.341823 13.384913-4.388496 27.35496-6.582744 41.398147-6.655886 38.911333 0 68.021691 19.455666 85.72196 44.616378 16.822569 23.990446 23.551596 53.100804 23.551596 79.724347v29.988058c0.146283 98.960589 0.292566 197.921178 0.658274 296.954909-0.073142 13.165489 1.097124 26.47726 3.510797 39.569608 8.484426-7.533585 16.237436-15.213453 24.795004-23.69788l13.165488-13.019205c13.970046-13.604338 30.353765-28.598367 49.809432-41.178723 42.056422-27.208676 93.694394-39.642749 162.813209-22.600755 27.574384 6.802169 44.982086 25.380136 54.344211 44.543236 8.776992 18.285401 11.117524 38.545625 10.386108 56.392176-1.38969 33.864562-14.920887 75.26271-43.738679 101.447404l-1.755398 1.755398c-37.375359 36.424518-75.335851 72.263904-113.881477 107.518157-31.450889 28.964075-63.486912 57.050451-96.327491 84.478552-29.037217 24.063587-58.293858 46.51806-80.967755 58.952132A491.511574 491.511574 0 0 1 421.527495 1023.982446a45.567219 45.567219 0 0 1-46.810626-44.25067c0-24.795004 20.699074-44.835803 46.225493-44.762661a395.403507 395.403507 0 0 0 215.036314-64.072045 49.955715 49.955715 0 0 1 4.022788-2.340531c13.458055-7.167877 37.009651-24.502437 67.363417-49.590007 31.597173-26.47726 62.609212-53.612795 92.889836-81.552888a5027.973235 5027.973235 0 0 0 111.687228-105.470192l1.755399-1.755398 0.585133-0.511991 1.682257-1.535974a42.056422 42.056422 0 0 0 9.362125-15.140312c3.291372-8.118718 5.119912-16.749427 5.631903-25.453278a46.07921 46.07921 0 0 0-1.023982-12.580356c-39.715891-8.557568-62.536071-0.658274-81.479746 11.556374a234.126272 234.126272 0 0 0-35.473678 29.841774l-10.386108 10.239824c-9.800975 9.654692-20.845357 20.699074-31.96288 30.500049l-0.146283 0.146283c-19.016817 16.603144-42.787838 31.597173-70.435364 32.182306a74.897002 74.897002 0 0 1-65.096027-35.54682 141.602144 141.602144 0 0 1-18.870534-51.930538 302.074822 302.074822 0 0 1-4.169071-50.613989c-0.365708-99.033731-0.511991-198.213745-0.511992-297.247476v-29.988058c0-13.311772-3.65708-24.136729-7.826151-30.13434a13.896905 13.896905 0 0 0-4.388496-4.388496 7.679868 7.679868 0 0 0-4.022789-0.804558 46.956909 46.956909 0 0 0-28.232658 10.532391 30.719473 30.719473 0 0 0-12.214648 24.721862v232.736582a45.567219 45.567219 0 0 1-46.591201 44.543236 45.567219 45.567219 0 0 1-46.51806-44.616378V124.340726c0-14.628321-3.364514-25.745844-7.094736-31.45089a10.093541 10.093541 0 0 0-2.925664-3.364514 1.901682 1.901682 0 0 0-0.511991-0.292566 9.435267 9.435267 0 0 0-2.340531-0.146283c-38.618767 0-49.443724 23.697879-49.078016 33.791421v1.682256l-0.292567 77.822666v3.876505l-1.023982 253.508797a45.567219 45.567219 0 0 1-46.810626 44.323812 45.567219 45.567219 0 0 1-46.298635-44.68952l1.023983-250.656274a32.036022 32.036022 0 0 0-7.75301-15.140312c-1.82854-1.682257-5.851328-4.827346-17.188277-4.827346a41.178723 41.178723 0 0 0-26.477261 9.069559c-5.558762 4.754204-10.678674 12.580356-10.678674 26.257835v296.589202a45.567219 45.567219 0 0 1-46.518059 44.543236 45.567219 45.567219 0 0 1-46.51806-44.616378v-169.688519a31.158323 31.158323 0 0 0-4.607921-5.705045 11.84894 11.84894 0 0 0-5.193054-3.218231c-1.023982-0.292566-4.681063-1.023982-12.653497 1.462832-17.700268 5.705045-26.111552 14.994029-30.792615 27.208676-5.48562 14.189471-6.582744 35.10797-1.097124 61.438947 42.202705 201.139409 64.949744 301.123981 83.162003 350.34828 16.091153 43.372971 47.615184 81.918596 90.915013 109.566122a43.372971 43.372971 0 0 1 12.872922 61.804654 47.834609 47.834609 0 0 1-64.510894 12.28779c-59.171557-37.741067-103.934218-91.500146-127.046965-153.963075C71.179216 755.406479 46.896203 647.449472 5.571197 449.601435-1.889246 414.127758-3.059512 375.216425 10.471685 340.108455 24.734297 302.806238 54.210364 273.330171 99.265591 258.921276c16.603144-5.558762 34.376554-7.460444 51.784255-5.631904v-29.256641c0-81.18718 67.655983-124.340726 130.265196-124.340726 9.435267 0 18.431684 0.877699 27.062393 2.486815z" p-id="4581" fill="#515151"></path></svg>', ke = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775033156525" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3463" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M694.4 960H195.2C131.7 960 80 908.4 80 845.1V462c0-63.4 51.7-114.9 115.2-114.9h499.2c63.5 0 115.2 51.6 115.2 114.9v383.1c0 63.3-51.7 114.9-115.2 114.9zM195.2 423.7c-21.2 0-38.4 17.2-38.4 38.3v383.1c0 21.1 17.2 38.3 38.4 38.3h499.2c21.2 0 38.4-17.2 38.4-38.3V462c0-21.1-17.2-38.3-38.4-38.3H195.2z" fill="#515151" p-id="3464"></path><path d="M905.6 450.3c-14.8 0-28.9-8.6-35.2-23C788.6 240.8 592.7 213 483.2 213c-21.2 0-38.4-17.2-38.4-38.3s17.2-38.3 38.4-38.3c218.2 0 385 94.9 457.6 260.3 8.5 19.4-0.4 42-19.8 50.5-5 2.1-10.3 3.1-15.4 3.1z" fill="#515151" p-id="3465"></path><path d="M473.6 285.4c-9.8 0-19.7-3.7-27.2-11.2l-72.5-72.4c-15-15-15-39.2 0-54.2l72.5-72.4c15-15 39.3-15 54.3 0s15 39.2 0 54.2l-45.4 45.3 45.4 45.3c15 15 15 39.2 0 54.2-7.4 7.4-17.3 11.2-27.1 11.2z" fill="#515151" p-id="3466"></path></svg>', Ie = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M8.3 19.7c-.4-.4-.4-1 0-1.4l6.3-6.3-6.3-6.3c-.4-.4-.4-1 0-1.4.4-.4 1-.4 1.4 0l7 7c.4.4.4 1 0 1.4l-7 7c-.4.4-1 .4-1.4 0z"/></svg>', Ae = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032400373" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3314" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 230.4c199.8848 0 373.0176 114.5344 457.344 281.5744C885.0432 679.04 711.8848 793.6 512 793.6c-199.8848 0-373.0176-114.5344-457.344-281.5744C138.9568 344.96 312.1152 230.4 512 230.4z m0 76.8a434.8928 434.8928 0 0 0-366.464 200.3456l-2.816 4.48 2.816 4.48a434.944 434.944 0 0 0 357.248 200.192L512 716.8c150.6816 0 287.488-77.2096 366.464-200.3456l2.816-4.48-2.816-4.48a434.944 434.944 0 0 0-357.248-200.192L512 307.2z m0 38.4a166.4 166.4 0 1 1 0 332.8 166.4 166.4 0 0 1 0-332.8z m0 76.8a89.6 89.6 0 1 0 0 179.2 89.6 89.6 0 0 0 0-179.2z" p-id="3315" fill="#515151"></path></svg>', Se = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032548251" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4695" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M849.7664 778.1376c1.9968 1.4848 3.84 3.072 5.632 4.864l72.3968 72.3968a51.2 51.2 0 1 1-72.3968 72.3968l-72.3968-72.3968a51.6096 51.6096 0 0 1-4.864-5.632 448 448 0 1 1 71.68-71.68zM460.8 460.8V358.4a51.2 51.2 0 1 1 102.4 0v102.4h102.4a51.2 51.2 0 0 1 0 102.4h-102.4v102.4a51.2 51.2 0 0 1-102.4 0v-102.4H358.4a51.2 51.2 0 0 1 0-102.4h102.4z m38.4 384a345.6 345.6 0 1 0 0-691.2 345.6 345.6 0 0 0 0 691.2z" fill="#515151" p-id="4696"></path></svg>', Me = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032629657" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1933" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M849.7664 778.1376c1.9968 1.4848 3.84 3.072 5.632 4.864l72.3968 72.3968a51.2 51.2 0 1 1-72.3968 72.3968l-72.3968-72.3968a51.6096 51.6096 0 0 1-4.864-5.632 448 448 0 1 1 71.68-71.68zM499.2 844.8a345.6 345.6 0 1 0 0-691.2 345.6 345.6 0 0 0 0 691.2zM358.4 563.2a51.2 51.2 0 0 1 0-102.4h307.2a51.2 51.2 0 0 1 0 102.4H358.4z" fill="#666666" p-id="1934"></path></svg>', Te = ["innerHTML"], De = /* @__PURE__ */ ct({
541
577
  __name: "SvgIcon",
542
578
  props: {
543
579
  name: {},
544
580
  size: {}
545
581
  },
546
- setup(w) {
547
- const t = w, n = M(""), e = /* @__PURE__ */ Object.assign({ "../assets/svg/aim.svg": de, "../assets/svg/back.svg": ge, "../assets/svg/connection.svg": ue, "../assets/svg/crop.svg": ve, "../assets/svg/delete.svg": fe, "../assets/svg/download.svg": me, "../assets/svg/edit.svg": pe, "../assets/svg/first.svg": ye, "../assets/svg/hide.svg": we, "../assets/svg/last.svg": xe, "../assets/svg/pointer.svg": be, "../assets/svg/price-tag.svg": Ce, "../assets/svg/rank.svg": _e, "../assets/svg/refresh-right.svg": ke, "../assets/svg/right.svg": Ie, "../assets/svg/view.svg": Ae, "../assets/svg/zoom-in.svg": Se, "../assets/svg/zoom-out.svg": Me });
582
+ setup(y) {
583
+ const t = y, n = M(""), e = /* @__PURE__ */ Object.assign({ "../assets/svg/aim.svg": de, "../assets/svg/back.svg": ge, "../assets/svg/connection.svg": ue, "../assets/svg/crop.svg": ve, "../assets/svg/delete.svg": fe, "../assets/svg/download.svg": me, "../assets/svg/edit.svg": pe, "../assets/svg/first.svg": ye, "../assets/svg/hide.svg": xe, "../assets/svg/last.svg": we, "../assets/svg/pointer.svg": be, "../assets/svg/price-tag.svg": Ce, "../assets/svg/rank.svg": _e, "../assets/svg/refresh-right.svg": ke, "../assets/svg/right.svg": Ie, "../assets/svg/view.svg": Ae, "../assets/svg/zoom-in.svg": Se, "../assets/svg/zoom-out.svg": Me });
548
584
  return ce(() => {
549
- const a = `../assets/svg/${t.name}.svg`, o = e[a];
550
- o ? n.value = o : (console.warn(`Icon ${t.name} not found at path ${a}`), n.value = "");
551
- }), (a, o) => (v(), m("i", {
552
- class: X(["svg-icon", [w.size ? `size-${w.size}` : ""]]),
585
+ const l = `../assets/svg/${t.name}.svg`, o = e[l];
586
+ o ? n.value = o : (console.warn(`Icon ${t.name} not found at path ${l}`), n.value = "");
587
+ }), (l, o) => (v(), m("i", {
588
+ class: q(["svg-icon", [y.size ? `size-${y.size}` : ""]]),
553
589
  innerHTML: n.value
554
590
  }, null, 10, Te));
555
591
  }
556
- }), rt = (w, t) => {
557
- const n = w.__vccOpts || w;
558
- for (const [e, a] of t)
559
- n[e] = a;
592
+ }), rt = (y, t) => {
593
+ const n = y.__vccOpts || y;
594
+ for (const [e, l] of t)
595
+ n[e] = l;
560
596
  return n;
561
- }, L = /* @__PURE__ */ rt(De, [["__scopeId", "data-v-3928607b"]]), Pe = {
597
+ }, $ = /* @__PURE__ */ rt(De, [["__scopeId", "data-v-3928607b"]]), Pe = {
562
598
  key: 0,
563
599
  class: "image-list-sidebar"
564
- }, ze = { class: "image-list-header" }, $e = ["onClick"], Le = { class: "image-list-stage" }, Be = ["src", "alt"], Re = {
600
+ }, Le = { class: "image-list-header" }, ze = ["onClick"], $e = { class: "image-list-stage" }, Re = ["src", "alt"], Be = {
565
601
  key: 0,
566
602
  class: "thumb-overlay-layer"
567
603
  }, He = {
@@ -569,13 +605,13 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
569
605
  class: "thumb-overlay-svg",
570
606
  viewBox: "0 0 100 100",
571
607
  preserveAspectRatio: "none"
572
- }, Ee = ["points"], Ue = { class: "image-list-text" }, Ve = { class: "center-sidebar" }, Oe = {
608
+ }, Ee = ["points"], Ue = { class: "image-list-text" }, Oe = { class: "center-sidebar" }, Ve = {
573
609
  key: 0,
574
610
  class: "left-sidebar"
575
- }, Fe = ["onClick", "title"], Ne = {
611
+ }, Fe = ["onClick", "title"], We = {
576
612
  key: 0,
577
613
  class: "divider"
578
- }, We = { class: "center-area" }, Ge = {
614
+ }, Ne = { class: "center-area" }, Ge = {
579
615
  key: 0,
580
616
  class: "floating-label-selector"
581
617
  }, Ye = {
@@ -596,7 +632,7 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
596
632
  }, ts = ["disabled"], es = ["disabled"], ss = ["disabled"], is = ["disabled"], ns = {
597
633
  key: 1,
598
634
  class: "right-sidebar"
599
- }, os = { class: "label-list" }, as = { class: "label-row" }, ls = ["onUpdate:modelValue", "onChange"], cs = ["title"], rs = ["onClick"], hs = { class: "action-icon more-actions" }, ds = ["onClick"], gs = { class: "modal-content" }, us = { class: "modal-body" }, vs = { class: "form-group" }, fs = { class: "form-group" }, ms = { class: "color-input-wrapper" }, ps = { class: "color-value" }, ys = { class: "modal-actions" }, ws = ["disabled"], xs = /* @__PURE__ */ ct({
635
+ }, os = { class: "label-list" }, as = { class: "label-row" }, ls = ["onUpdate:modelValue", "onChange"], cs = ["title"], rs = ["onClick"], hs = { class: "action-icon more-actions" }, ds = ["onClick"], gs = { class: "modal-content" }, us = { class: "modal-body" }, vs = { class: "form-group" }, fs = { class: "form-group" }, ms = { class: "color-input-wrapper" }, ps = { class: "color-value" }, ys = { class: "modal-actions" }, xs = ["disabled"], ws = /* @__PURE__ */ ct({
600
636
  __name: "ImageAnnotator",
601
637
  props: {
602
638
  annotationTypes: { default: () => ["rectangle", "polygon", "point", "rotatedRect", "category"] },
@@ -613,10 +649,10 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
613
649
  maxZoom: {}
614
650
  },
615
651
  emits: ["annotationChange", "batchChange", "labelChange", "ready", "error", "tool:change", "viewport:change", "annotation:add", "annotation:update", "annotation:delete", "annotation:select", "prediction:loaded", "prediction:apply", "prediction:reject"],
616
- setup(w, { expose: t, emit: n }) {
617
- const e = w, a = n, o = M(null), c = M(null), g = M(null), u = M([]), r = M(null), k = M(null), x = M(0), D = M(""), _ = M([]), $ = M(""), q = M(!1), C = M({ name: "", color: "#FF0000" }), S = M("none"), p = M([]), H = M({}), O = V(() => k.value === "select" && !!D.value), G = M(!1), Z = V(() => _.value.find((s) => s.id === $.value)), wt = (s) => {
652
+ setup(y, { expose: t, emit: n }) {
653
+ const e = y, l = n, o = M(null), a = M(null), g = M(null), u = M([]), r = M(null), A = M(null), w = M(0), D = M(""), _ = M([]), z = M(""), X = M(!1), C = M({ name: "", color: "#FF0000" }), S = M("none"), x = M([]), H = M({}), V = O(() => A.value === "select" && !!D.value), G = M(!1), Z = O(() => _.value.find((s) => s.id === z.value)), xt = (s) => {
618
654
  s.stopPropagation(), G.value = !G.value;
619
- }, xt = (s) => {
655
+ }, wt = (s) => {
620
656
  tt(s), G.value = !1;
621
657
  };
622
658
  yt(() => {
@@ -628,10 +664,10 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
628
664
  if (!s || H.value[s]) return;
629
665
  const i = new Image();
630
666
  i.onload = () => {
631
- const l = i.naturalWidth || 1, d = i.naturalHeight || 1;
667
+ const c = i.naturalWidth || 1, d = i.naturalHeight || 1;
632
668
  H.value = {
633
669
  ...H.value,
634
- [s]: { width: l, height: d }
670
+ [s]: { width: c, height: d }
635
671
  };
636
672
  }, i.src = s;
637
673
  }, nt = () => {
@@ -640,13 +676,13 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
640
676
  });
641
677
  }, ht = (s, i) => {
642
678
  u.value[i] = s;
643
- }, Q = (s = x.value) => {
644
- const i = g.value, l = u.value[s];
645
- if (!i || !l) return;
646
- const d = i.scrollTop, f = d + i.clientHeight, A = l.offsetTop, P = A + l.offsetHeight;
647
- if (A < d) {
679
+ }, Q = (s = w.value) => {
680
+ const i = g.value, c = u.value[s];
681
+ if (!i || !c) return;
682
+ const d = i.scrollTop, f = d + i.clientHeight, I = c.offsetTop, P = I + c.offsetHeight;
683
+ if (I < d) {
648
684
  i.scrollTo({
649
- top: Math.max(A - 8, 0),
685
+ top: Math.max(I - 8, 0),
650
686
  behavior: "smooth"
651
687
  });
652
688
  return;
@@ -656,28 +692,28 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
656
692
  behavior: "smooth"
657
693
  });
658
694
  }, j = () => {
659
- var l, d, f, A;
660
- const s = e.batchImages[x.value], i = (s == null ? void 0 : s.imageUrl) || ((l = e.image) == null ? void 0 : l.url);
695
+ var c, d, f, I;
696
+ const s = e.batchImages[w.value], i = (s == null ? void 0 : s.imageUrl) || ((c = e.image) == null ? void 0 : c.url);
661
697
  return {
662
698
  eventId: `${Date.now()}-${Math.random().toString(36).slice(2, 10)}`,
663
699
  timestamp: Date.now(),
664
700
  requestId: e.requestId,
665
701
  taskId: (d = e.session) == null ? void 0 : d.taskId,
666
702
  imageId: ((f = e.image) == null ? void 0 : f.id) || i,
667
- operator: (A = e.session) == null ? void 0 : A.userId
703
+ operator: (I = e.session) == null ? void 0 : I.userId
668
704
  };
669
- }, y = (s) => {
705
+ }, p = (s) => {
670
706
  var d;
671
707
  const i = s == null ? void 0 : s.action;
672
708
  if (!i) return;
673
- const l = {
709
+ const c = {
674
710
  meta: j(),
675
711
  action: i,
676
712
  current: s == null ? void 0 : s.changedItem,
677
713
  source: (d = s == null ? void 0 : s.changedItem) != null && d.predictionId ? "prediction" : "manual"
678
714
  };
679
- i === "add" && a("annotation:add", l), i === "update" && a("annotation:update", l), i === "delete" && a("annotation:delete", l), i === "select" && a("annotation:select", l);
680
- }, b = V(() => e.annotationTypes), I = (s) => ({
715
+ i === "add" && l("annotation:add", c), i === "update" && l("annotation:update", c), i === "delete" && l("annotation:delete", c), i === "select" && l("annotation:select", c);
716
+ }, b = O(() => e.annotationTypes), k = (s) => ({
681
717
  rectangle: "crop",
682
718
  polygon: "connection",
683
719
  point: "aim",
@@ -692,49 +728,49 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
692
728
  })[s] || s;
693
729
  yt(() => {
694
730
  if (nt(), o.value) {
695
- r.value = new he(o.value), r.value.on("annotationChange", (i) => {
696
- var l, d;
731
+ r.value = new he(o.value), r.value.setShowLabels(e.readOnly), r.value.on("annotationChange", (i) => {
732
+ var c, d;
697
733
  if (i.action === "add" && i.changedItem) {
698
- const f = _.value.find((A) => A.id === $.value);
734
+ const f = _.value.find((I) => I.id === z.value);
699
735
  f && (i.changedItem.label = f.name, i.changedItem.labelId = f.id);
700
736
  }
701
- i.action === "select" ? D.value = ((l = i.changedItem) == null ? void 0 : l.id) || "" : i.action === "delete" && ((d = i.changedItem) == null ? void 0 : d.id) === D.value && (D.value = ""), a("annotationChange", i), y(i);
702
- }), W(), E();
737
+ i.action === "select" ? D.value = ((c = i.changedItem) == null ? void 0 : c.id) || "" : i.action === "delete" && ((d = i.changedItem) == null ? void 0 : d.id) === D.value && (D.value = ""), l("annotationChange", i), p(i);
738
+ }), N(), E();
703
739
  const s = new ResizeObserver(() => {
704
740
  var i;
705
741
  (i = r.value) == null || i.resize();
706
742
  });
707
- c.value && s.observe(c.value), e.defaultActiveType && Y(e.defaultActiveType), at(() => Q()), a("ready", { meta: j() });
743
+ a.value && s.observe(a.value), e.defaultActiveType && Y(e.defaultActiveType), at(() => Q()), l("ready", { meta: j() });
708
744
  }
709
745
  });
710
746
  const E = () => {
711
747
  if (!r.value) return;
712
- const s = _.value.find((l) => l.id === $.value);
748
+ const s = _.value.find((c) => c.id === z.value);
713
749
  s && r.value.setLabelStyle(s.color);
714
- const i = _.value.filter((l) => l.visible).map((l) => l.name);
750
+ const i = _.value.filter((c) => c.visible).map((c) => c.name);
715
751
  r.value.setVisibleLabels(i);
716
- }, W = () => {
752
+ }, N = () => {
717
753
  var s;
718
754
  if (r.value)
719
755
  if (D.value = "", requestAnimationFrame(() => {
720
756
  var i;
721
757
  (i = r.value) == null || i.resize();
722
758
  }), e.batchImages.length > 0) {
723
- const i = e.batchImages[x.value];
759
+ const i = e.batchImages[w.value];
724
760
  r.value.loadImage(i.imageUrl), i.annotations ? r.value.setAnnotations(i.annotations) : r.value.setAnnotations([]);
725
761
  } else (s = e.image) != null && s.url && r.value.loadImage(e.image.url);
726
762
  }, Y = (s) => {
727
- var i, l;
728
- if (k.value = s, D.value = "", s !== "pan" && s !== "select" && _.value.length === 0) {
763
+ var i, c;
764
+ if (A.value = s, D.value = "", s !== "pan" && s !== "select" && _.value.length === 0) {
729
765
  alert("请先创建标签!");
730
766
  return;
731
767
  }
732
- s === "pan" || s === "select" ? (i = r.value) == null || i.setTool(s) : (l = r.value) == null || l.setTool(s), a("tool:change", { meta: j(), tool: s });
768
+ s === "pan" || s === "select" ? (i = r.value) == null || i.setTool(s) : (c = r.value) == null || c.setTool(s), l("tool:change", { meta: j(), tool: s });
733
769
  }, St = () => {
734
770
  var s;
735
771
  (s = r.value) != null && s.activeAnnotation && r.value.deleteAnnotation(r.value.activeAnnotation.id);
736
772
  }, bt = () => {
737
- r.value && a("viewport:change", {
773
+ r.value && l("viewport:change", {
738
774
  meta: j(),
739
775
  scale: r.value.scale,
740
776
  offset: { ...r.value.offset }
@@ -746,9 +782,9 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
746
782
  var s;
747
783
  (s = r.value) == null || s.zoom(-1), bt();
748
784
  }, Dt = () => {
749
- C.value = { name: "", color: "#2196F3" }, q.value = !0;
785
+ C.value = { name: "", color: "#2196F3" }, X.value = !0;
750
786
  }, dt = () => {
751
- q.value = !1;
787
+ X.value = !1;
752
788
  }, Pt = () => {
753
789
  if (!C.value.name.trim()) {
754
790
  alert("请输入标签名称");
@@ -760,60 +796,60 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
760
796
  color: C.value.color,
761
797
  visible: !0
762
798
  };
763
- _.value.push(i), a("labelChange", _.value), E(), _.value.length === 1 && tt(i), dt();
799
+ _.value.push(i), l("labelChange", _.value), E(), _.value.length === 1 && tt(i), dt();
764
800
  }, tt = (s) => {
765
801
  var i;
766
- $.value = s.id, (i = r.value) == null || i.setLabelStyle(s.color);
767
- }, zt = (s, i) => {
802
+ z.value = s.id, (i = r.value) == null || i.setLabelStyle(s.color);
803
+ }, Lt = (s, i) => {
768
804
  if (!s.startsWith("#")) return s;
769
- let l = 0, d = 0, f = 0;
770
- return s.length === 4 ? (l = parseInt(s[1] + s[1], 16), d = parseInt(s[2] + s[2], 16), f = parseInt(s[3] + s[3], 16)) : s.length === 7 && (l = parseInt(s.slice(1, 3), 16), d = parseInt(s.slice(3, 5), 16), f = parseInt(s.slice(5, 7), 16)), `rgba(${l}, ${d}, ${f}, ${i})`;
771
- }, $t = (s) => {
805
+ let c = 0, d = 0, f = 0;
806
+ return s.length === 4 ? (c = parseInt(s[1] + s[1], 16), d = parseInt(s[2] + s[2], 16), f = parseInt(s[3] + s[3], 16)) : s.length === 7 && (c = parseInt(s.slice(1, 3), 16), d = parseInt(s.slice(3, 5), 16), f = parseInt(s.slice(5, 7), 16)), `rgba(${c}, ${d}, ${f}, ${i})`;
807
+ }, zt = (s) => {
772
808
  var i;
773
- if (s.id === $.value && ((i = r.value) == null || i.setLabelStyle(s.color)), r.value) {
774
- const l = r.value.getAnnotations();
809
+ if (s.id === z.value && ((i = r.value) == null || i.setLabelStyle(s.color)), r.value) {
810
+ const c = r.value.getAnnotations();
775
811
  let d = !1;
776
- l.forEach((f) => {
777
- f.label === s.name && (f.style || (f.style = {}), f.style.strokeColor = s.color, f.style.fillColor = zt(s.color, 0.2), d = !0);
812
+ c.forEach((f) => {
813
+ f.label === s.name && (f.style || (f.style = {}), f.style.strokeColor = s.color, f.style.fillColor = Lt(s.color, 0.2), d = !0);
778
814
  }), d && r.value.render();
779
815
  }
780
- a("labelChange", _.value), E();
781
- }, Lt = (s) => {
816
+ l("labelChange", _.value), E();
817
+ }, $t = (s) => {
782
818
  s.visible = !s.visible, E();
783
- }, Bt = (s) => {
784
- const i = _.value.findIndex((l) => l.id === s);
785
- i > -1 && (_.value.splice(i, 1), a("labelChange", _.value), $.value === s && ($.value = _.value.length > 0 ? _.value[0].id : "", $.value && tt(_.value[0])), E());
819
+ }, Rt = (s) => {
820
+ const i = _.value.findIndex((c) => c.id === s);
821
+ i > -1 && (_.value.splice(i, 1), l("labelChange", _.value), z.value === s && (z.value = _.value.length > 0 ? _.value[0].id : "", z.value && tt(_.value[0])), E());
786
822
  };
787
823
  K(() => e.labels, (s) => {
788
824
  const i = JSON.parse(JSON.stringify(s || []));
789
825
  if (_.value = i, _.value.length > 0)
790
- if (!$.value || !_.value.find((l) => l.id === $.value))
826
+ if (!z.value || !_.value.find((c) => c.id === z.value))
791
827
  tt(_.value[0]);
792
828
  else {
793
- const l = _.value.find((d) => d.id === $.value);
794
- l && tt(l);
829
+ const c = _.value.find((d) => d.id === z.value);
830
+ c && tt(c);
795
831
  }
796
832
  else
797
- $.value = "";
833
+ z.value = "";
798
834
  E();
799
835
  }, { immediate: !0, deep: !0 });
800
- const Rt = () => {
801
- x.value > 0 && (gt(), x.value--, W(), ut());
836
+ const Bt = () => {
837
+ w.value > 0 && (gt(), w.value--, N(), ut());
802
838
  }, Ht = () => {
803
- x.value < e.batchImages.length - 1 && (gt(), x.value++, W(), ut());
839
+ w.value < e.batchImages.length - 1 && (gt(), w.value++, N(), ut());
804
840
  }, Et = () => {
805
- x.value > 0 && ot(0);
841
+ w.value > 0 && ot(0);
806
842
  }, Ut = () => {
807
- x.value < e.batchImages.length - 1 && ot(e.batchImages.length - 1);
843
+ w.value < e.batchImages.length - 1 && ot(e.batchImages.length - 1);
808
844
  }, gt = () => {
809
845
  if (r.value) {
810
846
  const s = r.value.getAnnotations();
811
- e.batchImages[x.value].annotations = s;
847
+ e.batchImages[w.value].annotations = s;
812
848
  }
813
849
  }, ut = () => {
814
- const s = e.batchImages[x.value];
815
- a("batchChange", {
816
- currentIndex: x.value,
850
+ const s = e.batchImages[w.value];
851
+ l("batchChange", {
852
+ currentIndex: w.value,
817
853
  total: e.batchImages.length,
818
854
  currentImageUrl: s.imageUrl,
819
855
  currentAnnotations: s.annotations || []
@@ -821,68 +857,68 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
821
857
  }, Ct = (s = []) => {
822
858
  var f;
823
859
  if (!r.value) return;
824
- if (p.value = JSON.parse(JSON.stringify(s)), p.value.length === 0) {
860
+ if (x.value = JSON.parse(JSON.stringify(s)), x.value.length === 0) {
825
861
  S.value = "none";
826
862
  return;
827
863
  }
828
864
  S.value = "loaded";
829
- const l = (r.value.getAnnotations() || []).filter((A) => !A.predictionId), d = p.value.map((A) => {
830
- const P = JSON.parse(JSON.stringify(A.annotation));
831
- return P.id = P.id || `pred-${A.id}`, P.predictionId = A.id, P.modelRunId = A.modelRunId || P.modelRunId, P.confidence = A.confidence ?? P.confidence, P.reviewStatus = P.reviewStatus || "draft", P;
865
+ const c = (r.value.getAnnotations() || []).filter((I) => !I.predictionId), d = x.value.map((I) => {
866
+ const P = JSON.parse(JSON.stringify(I.annotation));
867
+ return P.id = P.id || `pred-${I.id}`, P.predictionId = I.id, P.modelRunId = I.modelRunId || P.modelRunId, P.confidence = I.confidence ?? P.confidence, P.reviewStatus = P.reviewStatus || "draft", P;
832
868
  });
833
- r.value.setAnnotations([...l, ...d]), a("prediction:loaded", {
869
+ r.value.setAnnotations([...c, ...d]), l("prediction:loaded", {
834
870
  meta: j(),
835
- modelRunId: (f = p.value[0]) == null ? void 0 : f.modelRunId,
836
- candidates: p.value
871
+ modelRunId: (f = x.value[0]) == null ? void 0 : f.modelRunId,
872
+ candidates: x.value
837
873
  });
838
- }, Vt = (s, i) => {
874
+ }, Ot = (s, i) => {
839
875
  var f;
840
876
  if (!r.value) return [];
841
877
  S.value = "applying";
842
- const d = (r.value.getAnnotations() || []).filter((A) => A.predictionId && s.includes(A.predictionId));
843
- return d.forEach((A) => {
844
- A.reviewStatus = "accepted";
845
- }), S.value = "applied", a("prediction:apply", {
878
+ const d = (r.value.getAnnotations() || []).filter((I) => I.predictionId && s.includes(I.predictionId));
879
+ return d.forEach((I) => {
880
+ I.reviewStatus = "accepted";
881
+ }), S.value = "applied", l("prediction:apply", {
846
882
  meta: j(),
847
883
  modelRunId: (f = d[0]) == null ? void 0 : f.modelRunId,
848
884
  candidateIds: s,
849
885
  threshold: i,
850
886
  acceptedAnnotations: d
851
887
  }), r.value.render(), d;
852
- }, Ot = (s, i) => {
888
+ }, Vt = (s, i) => {
853
889
  var f;
854
890
  if (!r.value) return;
855
- const l = r.value.getAnnotations() || [], d = l.filter((A) => !(A.predictionId && s.includes(A.predictionId)));
856
- r.value.setAnnotations(d), a("prediction:reject", {
891
+ const c = r.value.getAnnotations() || [], d = c.filter((I) => !(I.predictionId && s.includes(I.predictionId)));
892
+ r.value.setAnnotations(d), l("prediction:reject", {
857
893
  meta: j(),
858
- modelRunId: (f = l.find((A) => A.predictionId && s.includes(A.predictionId))) == null ? void 0 : f.modelRunId,
894
+ modelRunId: (f = c.find((I) => I.predictionId && s.includes(I.predictionId))) == null ? void 0 : f.modelRunId,
859
895
  candidateIds: s,
860
896
  reason: i
861
897
  });
862
898
  }, Ft = (s, i = []) => {
863
899
  r.value && (r.value.loadImage(s.url), r.value.setAnnotations(i));
864
- }, Nt = (s) => {
900
+ }, Wt = (s) => {
865
901
  var i;
866
902
  (i = r.value) == null || i.setAnnotations(s);
867
903
  }, _t = () => {
868
904
  var s;
869
905
  return ((s = r.value) == null ? void 0 : s.getAnnotations()) || [];
870
- }, Wt = (s = "json") => {
871
- var l, d;
906
+ }, Nt = (s = "json") => {
907
+ var c, d;
872
908
  const i = _t();
873
909
  return {
874
910
  format: s,
875
- image: ((l = e.batchImages[x.value]) == null ? void 0 : l.imageUrl) || ((d = e.image) == null ? void 0 : d.url) || "",
911
+ image: ((c = e.batchImages[w.value]) == null ? void 0 : c.imageUrl) || ((d = e.image) == null ? void 0 : d.url) || "",
876
912
  annotations: i
877
913
  };
878
914
  }, ot = (s) => {
879
- s >= 0 && s < e.batchImages.length && (gt(), x.value = s, W(), ut());
915
+ s >= 0 && s < e.batchImages.length && (gt(), w.value = s, N(), ut());
880
916
  }, Gt = (s) => {
881
917
  var i;
882
- return s === x.value && r.value ? r.value.getAnnotations() || [] : ((i = e.batchImages[s]) == null ? void 0 : i.annotations) || [];
918
+ return s === w.value && r.value ? r.value.getAnnotations() || [] : ((i = e.batchImages[s]) == null ? void 0 : i.annotations) || [];
883
919
  }, Yt = (s) => s.type === "rectangle", Jt = (s) => s.type === "polygon", jt = (s) => s.type === "point", Xt = (s) => s.type === "rotatedRect", qt = (s) => s.type === "category", et = (s) => {
884
- var l, d;
885
- const i = (l = _.value.find((f) => f.name === s.label)) == null ? void 0 : l.color;
920
+ var c, d;
921
+ const i = (c = _.value.find((f) => f.name === s.label)) == null ? void 0 : c.color;
886
922
  return ((d = s.style) == null ? void 0 : d.strokeColor) || i || "#409eff";
887
923
  }, kt = (s) => {
888
924
  const i = s.coordinates;
@@ -891,24 +927,24 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
891
927
  const i = e.batchImages[s];
892
928
  if (i != null && i.width && (i != null && i.height))
893
929
  return { width: i.width, height: i.height };
894
- const l = i != null && i.imageUrl ? H.value[i.imageUrl] : void 0;
895
- return l || (i != null && i.imageUrl && it(i.imageUrl), { width: 1, height: 1 });
930
+ const c = i != null && i.imageUrl ? H.value[i.imageUrl] : void 0;
931
+ return c || (i != null && i.imageUrl && it(i.imageUrl), { width: 1, height: 1 });
896
932
  }, Kt = (s) => {
897
933
  const i = e.batchImages[s];
898
934
  return i != null && i.width && (i != null && i.height) ? !0 : i != null && i.imageUrl ? !!H.value[i.imageUrl] : !1;
899
935
  }, Zt = (s, i) => {
900
- const l = i.coordinates, d = st(s), f = et(i), A = Math.min(l.x1, l.x2), P = Math.min(l.y1, l.y2), ne = Math.max(l.x1, l.x2), oe = Math.max(l.y1, l.y2);
936
+ const c = i.coordinates, d = st(s), f = et(i), I = Math.min(c.x1, c.x2), P = Math.min(c.y1, c.y2), ne = Math.max(c.x1, c.x2), oe = Math.max(c.y1, c.y2);
901
937
  return {
902
- left: `${A / d.width * 100}%`,
938
+ left: `${I / d.width * 100}%`,
903
939
  top: `${P / d.height * 100}%`,
904
- width: `${(ne - A) / d.width * 100}%`,
940
+ width: `${(ne - I) / d.width * 100}%`,
905
941
  height: `${(oe - P) / d.height * 100}%`,
906
942
  borderColor: f,
907
943
  backgroundColor: `${f}22`
908
944
  };
909
945
  }, Qt = (s, i) => {
910
- const l = st(s);
911
- return kt(i).map((d) => `${d.x / l.width * 100},${d.y / l.height * 100}`).join(" ");
946
+ const c = st(s);
947
+ return kt(i).map((d) => `${d.x / c.width * 100},${d.y / c.height * 100}`).join(" ");
912
948
  }, te = (s) => {
913
949
  const i = et(s);
914
950
  return {
@@ -916,29 +952,29 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
916
952
  stroke: i,
917
953
  strokeWidth: "1.4"
918
954
  };
919
- }, ee = (s, i, l) => {
920
- const d = st(s), f = et(l);
955
+ }, ee = (s, i, c) => {
956
+ const d = st(s), f = et(c);
921
957
  return {
922
958
  left: `${i.x / d.width * 100}%`,
923
959
  top: `${i.y / d.height * 100}%`,
924
960
  backgroundColor: f
925
961
  };
926
962
  }, se = (s, i) => {
927
- const l = i.coordinates, d = st(s), f = et(i), A = Math.abs(l.width), P = Math.abs(l.height);
963
+ const c = i.coordinates, d = st(s), f = et(i), I = Math.abs(c.width), P = Math.abs(c.height);
928
964
  return {
929
- left: `${(l.x - A / 2) / d.width * 100}%`,
930
- top: `${(l.y - P / 2) / d.height * 100}%`,
931
- width: `${A / d.width * 100}%`,
965
+ left: `${(c.x - I / 2) / d.width * 100}%`,
966
+ top: `${(c.y - P / 2) / d.height * 100}%`,
967
+ width: `${I / d.width * 100}%`,
932
968
  height: `${P / d.height * 100}%`,
933
- transform: `rotate(${l.angle || 0}deg)`,
969
+ transform: `rotate(${c.angle || 0}deg)`,
934
970
  borderColor: f,
935
971
  backgroundColor: `${f}22`
936
972
  };
937
973
  }, ie = (s, i) => {
938
- const l = i.coordinates, d = st(s), f = et(i);
974
+ const c = i.coordinates, d = st(s), f = et(i);
939
975
  return {
940
- left: `${l.x / d.width * 100}%`,
941
- top: `${l.y / d.height * 100}%`,
976
+ left: `${c.x / d.width * 100}%`,
977
+ top: `${c.y / d.height * 100}%`,
942
978
  backgroundColor: `${f}d9`
943
979
  // ~85% opacity
944
980
  };
@@ -946,13 +982,13 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
946
982
  return t({
947
983
  jumpTo: ot,
948
984
  setImage: Ft,
949
- setAnnotations: Nt,
985
+ setAnnotations: Wt,
950
986
  getAnnotations: _t,
951
987
  selectTool: Y,
952
988
  loadPredictionCandidates: Ct,
953
- applyPredictions: Vt,
954
- rejectPredictions: Ot,
955
- exportAnnotations: Wt,
989
+ applyPredictions: Ot,
990
+ rejectPredictions: Vt,
991
+ exportAnnotations: Nt,
956
992
  getAllAnnotations: () => {
957
993
  var s, i;
958
994
  return e.batchImages.length > 0 ? e.batchImages : [{
@@ -961,10 +997,10 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
961
997
  }];
962
998
  },
963
999
  getCurrentAnnotation: () => {
964
- var s, i, l;
1000
+ var s, i, c;
965
1001
  return {
966
- imageUrl: ((s = e.batchImages[x.value]) == null ? void 0 : s.imageUrl) || ((i = e.image) == null ? void 0 : i.url) || "",
967
- annotations: ((l = r.value) == null ? void 0 : l.getAnnotations()) || []
1002
+ imageUrl: ((s = e.batchImages[w.value]) == null ? void 0 : s.imageUrl) || ((i = e.image) == null ? void 0 : i.url) || "",
1003
+ annotations: ((c = r.value) == null ? void 0 : c.getAnnotations()) || []
968
1004
  };
969
1005
  }
970
1006
  }), K(() => {
@@ -972,7 +1008,7 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
972
1008
  return (s = e.image) == null ? void 0 : s.url;
973
1009
  }, () => {
974
1010
  var s;
975
- e.batchImages.length === 0 && ((s = e.image) != null && s.url) && W();
1011
+ e.batchImages.length === 0 && ((s = e.image) != null && s.url) && N();
976
1012
  }), K(() => e.predictionCandidates, (s) => {
977
1013
  s && Ct(s);
978
1014
  }, { immediate: !0, deep: !0 }), K(
@@ -982,35 +1018,40 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
982
1018
  },
983
1019
  { immediate: !0 }
984
1020
  ), K(
985
- () => x.value,
1021
+ () => w.value,
986
1022
  () => {
987
1023
  at(() => Q());
988
1024
  }
1025
+ ), K(
1026
+ () => e.readOnly,
1027
+ (s) => {
1028
+ r.value && r.value.setShowLabels(s);
1029
+ }
989
1030
  ), (s, i) => (v(), m("div", {
990
- class: X(["annotation-container", w.theme])
1031
+ class: q(["annotation-container", y.theme])
991
1032
  }, [
992
- w.batchImages && w.batchImages.length > 0 ? (v(), m("div", Pe, [
993
- h("div", ze, "共 " + z(w.batchImages.length) + " 张", 1),
1033
+ y.batchImages && y.batchImages.length > 0 ? (v(), m("div", Pe, [
1034
+ h("div", Le, "共 " + L(y.batchImages.length) + " 张", 1),
994
1035
  h("div", {
995
1036
  ref_key: "imageListScrollRef",
996
1037
  ref: g,
997
1038
  class: "image-list-scroll"
998
1039
  }, [
999
- (v(!0), m(N, null, J(w.batchImages, (l, d) => (v(), m("button", {
1000
- key: `${l.imageUrl}-${d}`,
1040
+ (v(!0), m(W, null, J(y.batchImages, (c, d) => (v(), m("button", {
1041
+ key: `${c.imageUrl}-${d}`,
1001
1042
  ref_for: !0,
1002
1043
  ref: (f) => ht(f, d),
1003
- class: X(["image-list-item", { active: d === x.value }]),
1044
+ class: q(["image-list-item", { active: d === w.value }]),
1004
1045
  onClick: (f) => ot(d)
1005
1046
  }, [
1006
- h("div", Le, [
1047
+ h("div", $e, [
1007
1048
  h("img", {
1008
- src: l.imageUrl,
1049
+ src: c.imageUrl,
1009
1050
  alt: `第${d + 1}张`,
1010
1051
  class: "image-list-thumb"
1011
- }, null, 8, Be),
1012
- Kt(d) ? (v(), m("div", Re, [
1013
- (v(!0), m(N, null, J(Gt(d), (f) => (v(), m(N, {
1052
+ }, null, 8, Re),
1053
+ Kt(d) ? (v(), m("div", Be, [
1054
+ (v(!0), m(W, null, J(Gt(d), (f) => (v(), m(W, {
1014
1055
  key: f.id
1015
1056
  }, [
1016
1057
  Yt(f) ? (v(), m("div", {
@@ -1022,10 +1063,10 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
1022
1063
  points: Qt(d, f),
1023
1064
  style: U(te(f))
1024
1065
  }, null, 12, Ee)
1025
- ])) : jt(f) ? (v(!0), m(N, { key: 2 }, J(kt(f), (A, P) => (v(), m("div", {
1066
+ ])) : jt(f) ? (v(!0), m(W, { key: 2 }, J(kt(f), (I, P) => (v(), m("div", {
1026
1067
  key: `${f.id}-${P}`,
1027
1068
  class: "thumb-overlay-point",
1028
- style: U(ee(d, A, f))
1069
+ style: U(ee(d, I, f))
1029
1070
  }, null, 4))), 128)) : Xt(f) ? (v(), m("div", {
1030
1071
  key: 3,
1031
1072
  class: "thumb-overlay-rotated",
@@ -1034,39 +1075,39 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
1034
1075
  key: 4,
1035
1076
  class: "thumb-overlay-category",
1036
1077
  style: U(ie(d, f))
1037
- }, z(f.label), 5)) : B("", !0)
1078
+ }, L(f.label), 5)) : R("", !0)
1038
1079
  ], 64))), 128))
1039
- ])) : B("", !0)
1080
+ ])) : R("", !0)
1040
1081
  ]),
1041
- h("span", Ue, "第 " + z(d + 1) + " 张", 1)
1042
- ], 10, $e))), 128))
1082
+ h("span", Ue, "第 " + L(d + 1) + " 张", 1)
1083
+ ], 10, ze))), 128))
1043
1084
  ], 512)
1044
- ])) : B("", !0),
1045
- h("div", Ve, [
1046
- w.readOnly ? B("", !0) : (v(), m("div", Oe, [
1085
+ ])) : R("", !0),
1086
+ h("div", Oe, [
1087
+ y.readOnly ? R("", !0) : (v(), m("div", Ve, [
1047
1088
  h("div", {
1048
- class: X(["tool-btn", { active: k.value === "pan" }]),
1049
- onClick: i[0] || (i[0] = (l) => Y("pan")),
1089
+ class: q(["tool-btn", { active: A.value === "pan" }]),
1090
+ onClick: i[0] || (i[0] = (c) => Y("pan")),
1050
1091
  title: "拖动"
1051
1092
  }, [
1052
- R(L, { name: "rank" })
1093
+ B($, { name: "rank" })
1053
1094
  ], 2),
1054
1095
  h("div", {
1055
- class: X(["tool-btn", { active: k.value === "select" }]),
1056
- onClick: i[1] || (i[1] = (l) => Y("select")),
1096
+ class: q(["tool-btn", { active: A.value === "select" }]),
1097
+ onClick: i[1] || (i[1] = (c) => Y("select")),
1057
1098
  title: "选择"
1058
1099
  }, [
1059
- R(L, { name: "pointer" })
1100
+ B($, { name: "pointer" })
1060
1101
  ], 2),
1061
1102
  i[5] || (i[5] = h("div", { class: "divider" }, null, -1)),
1062
- (v(!0), m(N, null, J(b.value, (l) => (v(), m("div", {
1063
- key: l,
1064
- class: X(["tool-btn", { active: k.value === l }]),
1065
- onClick: (d) => Y(l),
1066
- title: F(l)
1103
+ (v(!0), m(W, null, J(b.value, (c) => (v(), m("div", {
1104
+ key: c,
1105
+ class: q(["tool-btn", { active: A.value === c }]),
1106
+ onClick: (d) => Y(c),
1107
+ title: F(c)
1067
1108
  }, [
1068
- R(L, {
1069
- name: I(l)
1109
+ B($, {
1110
+ name: k(c)
1070
1111
  }, null, 8, ["name"])
1071
1112
  ], 10, Fe))), 128)),
1072
1113
  i[6] || (i[6] = h("div", { class: "divider" }, null, -1)),
@@ -1075,31 +1116,31 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
1075
1116
  onClick: Mt,
1076
1117
  title: "放大"
1077
1118
  }, [
1078
- R(L, { name: "zoom-in" })
1119
+ B($, { name: "zoom-in" })
1079
1120
  ]),
1080
1121
  h("div", {
1081
1122
  class: "tool-btn",
1082
1123
  onClick: Tt,
1083
1124
  title: "缩小"
1084
1125
  }, [
1085
- R(L, { name: "zoom-out" })
1126
+ B($, { name: "zoom-out" })
1086
1127
  ]),
1087
- O.value ? (v(), m("div", Ne)) : B("", !0),
1088
- O.value ? (v(), m("div", {
1128
+ V.value ? (v(), m("div", We)) : R("", !0),
1129
+ V.value ? (v(), m("div", {
1089
1130
  key: 1,
1090
1131
  class: "tool-btn",
1091
1132
  onClick: St,
1092
1133
  title: "删除选中"
1093
1134
  }, [
1094
- R(L, { name: "delete" })
1095
- ])) : B("", !0)
1135
+ B($, { name: "delete" })
1136
+ ])) : R("", !0)
1096
1137
  ]))
1097
1138
  ]),
1098
- h("div", We, [
1139
+ h("div", Ne, [
1099
1140
  h("div", {
1100
1141
  class: "canvas-wrapper",
1101
1142
  ref_key: "canvasWrapper",
1102
- ref: c,
1143
+ ref: a,
1103
1144
  onWheel: i[2] || (i[2] = It(() => {
1104
1145
  }, ["prevent"]))
1105
1146
  }, [
@@ -1107,82 +1148,82 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
1107
1148
  ref_key: "canvasRef",
1108
1149
  ref: o
1109
1150
  }, null, 512),
1110
- w.readOnly ? B("", !0) : (v(), m("div", Ge, [
1151
+ y.readOnly ? R("", !0) : (v(), m("div", Ge, [
1111
1152
  h("div", {
1112
1153
  class: "selector-trigger",
1113
- onClick: wt
1154
+ onClick: xt
1114
1155
  }, [
1115
1156
  Z.value ? (v(), m("div", Ye, [
1116
1157
  h("span", {
1117
1158
  class: "color-dot",
1118
1159
  style: U({ backgroundColor: Z.value.color })
1119
1160
  }, null, 4),
1120
- h("span", Je, z(Z.value.name), 1)
1161
+ h("span", Je, L(Z.value.name), 1)
1121
1162
  ])) : (v(), m("div", je, [...i[7] || (i[7] = [
1122
1163
  h("span", { class: "label-name" }, "请选择标签", -1)
1123
1164
  ])])),
1124
- R(L, {
1165
+ B($, {
1125
1166
  name: "right",
1126
- class: X(["arrow-icon", { "is-open": G.value }])
1167
+ class: q(["arrow-icon", { "is-open": G.value }])
1127
1168
  }, null, 8, ["class"])
1128
1169
  ]),
1129
1170
  G.value ? (v(), m("div", Xe, [
1130
- _.value.length === 0 ? (v(), m("div", qe, "请在右侧创建标签")) : (v(!0), m(N, { key: 1 }, J(_.value, (l) => (v(), m("div", {
1131
- key: l.id,
1132
- class: X(["dropdown-item", { active: $.value === l.id }]),
1133
- onClick: (d) => xt(l)
1171
+ _.value.length === 0 ? (v(), m("div", qe, "请在右侧创建标签")) : (v(!0), m(W, { key: 1 }, J(_.value, (c) => (v(), m("div", {
1172
+ key: c.id,
1173
+ class: q(["dropdown-item", { active: z.value === c.id }]),
1174
+ onClick: (d) => wt(c)
1134
1175
  }, [
1135
1176
  h("span", {
1136
1177
  class: "color-dot",
1137
- style: U({ backgroundColor: l.color })
1178
+ style: U({ backgroundColor: c.color })
1138
1179
  }, null, 4),
1139
- h("span", Ze, z(l.name), 1),
1140
- $.value === l.id ? (v(), vt(L, {
1180
+ h("span", Ze, L(c.name), 1),
1181
+ z.value === c.id ? (v(), vt($, {
1141
1182
  key: 0,
1142
1183
  name: "aim",
1143
1184
  class: "check-icon"
1144
- })) : B("", !0)
1185
+ })) : R("", !0)
1145
1186
  ], 10, Ke))), 128))
1146
- ])) : B("", !0)
1187
+ ])) : R("", !0)
1147
1188
  ]))
1148
1189
  ], 544),
1149
- w.batchImages && w.batchImages.length > 0 ? (v(), m("div", Qe, [
1190
+ y.batchImages && y.batchImages.length > 0 ? (v(), m("div", Qe, [
1150
1191
  h("button", {
1151
1192
  class: "icon-btn",
1152
1193
  onClick: Et,
1153
- disabled: x.value <= 0,
1194
+ disabled: w.value <= 0,
1154
1195
  title: "第一张"
1155
1196
  }, [
1156
- R(L, { name: "first" })
1197
+ B($, { name: "first" })
1157
1198
  ], 8, ts),
1158
1199
  h("button", {
1159
1200
  class: "icon-btn",
1160
- onClick: Rt,
1161
- disabled: x.value <= 0,
1201
+ onClick: Bt,
1202
+ disabled: w.value <= 0,
1162
1203
  title: "上一张"
1163
1204
  }, [
1164
- R(L, { name: "back" })
1205
+ B($, { name: "back" })
1165
1206
  ], 8, es),
1166
- h("span", null, z(x.value + 1) + " / " + z(w.batchImages.length), 1),
1207
+ h("span", null, L(w.value + 1) + " / " + L(y.batchImages.length), 1),
1167
1208
  h("button", {
1168
1209
  class: "icon-btn",
1169
1210
  onClick: Ht,
1170
- disabled: x.value >= w.batchImages.length - 1,
1211
+ disabled: w.value >= y.batchImages.length - 1,
1171
1212
  title: "下一张"
1172
1213
  }, [
1173
- R(L, { name: "right" })
1214
+ B($, { name: "right" })
1174
1215
  ], 8, ss),
1175
1216
  h("button", {
1176
1217
  class: "icon-btn",
1177
1218
  onClick: Ut,
1178
- disabled: x.value >= w.batchImages.length - 1,
1219
+ disabled: w.value >= y.batchImages.length - 1,
1179
1220
  title: "最后一张"
1180
1221
  }, [
1181
- R(L, { name: "last" })
1222
+ B($, { name: "last" })
1182
1223
  ], 8, is)
1183
- ])) : B("", !0)
1224
+ ])) : R("", !0)
1184
1225
  ]),
1185
- w.readOnly ? B("", !0) : (v(), m("div", ns, [
1226
+ y.readOnly ? R("", !0) : (v(), m("div", ns, [
1186
1227
  h("div", { class: "sidebar-header" }, [
1187
1228
  i[8] || (i[8] = h("h3", null, "标签", -1)),
1188
1229
  h("button", {
@@ -1191,37 +1232,37 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
1191
1232
  }, "添加标签")
1192
1233
  ]),
1193
1234
  h("div", os, [
1194
- (v(!0), m(N, null, J(_.value, (l) => (v(), m("div", {
1195
- key: l.id,
1235
+ (v(!0), m(W, null, J(_.value, (c) => (v(), m("div", {
1236
+ key: c.id,
1196
1237
  class: "label-item",
1197
- style: U({ backgroundColor: l.color + "1A", color: l.color })
1238
+ style: U({ backgroundColor: c.color + "1A", color: c.color })
1198
1239
  }, [
1199
1240
  h("div", as, [
1200
1241
  h("label", {
1201
1242
  class: "color-wrapper",
1202
- style: U({ backgroundColor: l.color })
1243
+ style: U({ backgroundColor: c.color })
1203
1244
  }, [
1204
1245
  ft(h("input", {
1205
1246
  type: "color",
1206
- "onUpdate:modelValue": (d) => l.color = d,
1207
- onChange: (d) => $t(l),
1247
+ "onUpdate:modelValue": (d) => c.color = d,
1248
+ onChange: (d) => zt(c),
1208
1249
  style: { visibility: "hidden", width: "0", height: "0" }
1209
1250
  }, null, 40, ls), [
1210
- [mt, l.color]
1251
+ [mt, c.color]
1211
1252
  ])
1212
1253
  ], 4),
1213
1254
  h("span", {
1214
1255
  class: "label-name",
1215
- title: l.name
1216
- }, z(l.name), 9, cs),
1256
+ title: c.name
1257
+ }, L(c.name), 9, cs),
1217
1258
  h("span", {
1218
1259
  class: "action-icon eye",
1219
- onClick: (d) => Lt(l)
1260
+ onClick: (d) => $t(c)
1220
1261
  }, [
1221
- l.visible ? (v(), vt(L, {
1262
+ c.visible ? (v(), vt($, {
1222
1263
  key: 0,
1223
1264
  name: "view"
1224
- })) : (v(), vt(L, {
1265
+ })) : (v(), vt($, {
1225
1266
  key: 1,
1226
1267
  name: "hide"
1227
1268
  }))
@@ -1230,17 +1271,17 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
1230
1271
  i[9] || (i[9] = h("span", { class: "dots" }, "•••", -1)),
1231
1272
  h("span", {
1232
1273
  class: "delete-btn",
1233
- onClick: (d) => Bt(l.id),
1274
+ onClick: (d) => Rt(c.id),
1234
1275
  title: "删除"
1235
1276
  }, [
1236
- R(L, { name: "delete" })
1277
+ B($, { name: "delete" })
1237
1278
  ], 8, ds)
1238
1279
  ])
1239
1280
  ])
1240
1281
  ], 4))), 128))
1241
1282
  ])
1242
1283
  ])),
1243
- q.value ? (v(), m("div", {
1284
+ X.value ? (v(), m("div", {
1244
1285
  key: 2,
1245
1286
  class: "modal-overlay",
1246
1287
  onClick: It(dt, ["self"])
@@ -1256,7 +1297,7 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
1256
1297
  h("span", { class: "required" }, "*")
1257
1298
  ], -1)),
1258
1299
  ft(h("input", {
1259
- "onUpdate:modelValue": i[3] || (i[3] = (l) => C.value.name = l),
1300
+ "onUpdate:modelValue": i[3] || (i[3] = (c) => C.value.name = c),
1260
1301
  placeholder: "请输入标签名称",
1261
1302
  class: "modal-input",
1262
1303
  autofocus: ""
@@ -1273,13 +1314,13 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
1273
1314
  }, [
1274
1315
  ft(h("input", {
1275
1316
  type: "color",
1276
- "onUpdate:modelValue": i[4] || (i[4] = (l) => C.value.color = l),
1317
+ "onUpdate:modelValue": i[4] || (i[4] = (c) => C.value.color = c),
1277
1318
  class: "modal-color-picker"
1278
1319
  }, null, 512), [
1279
1320
  [mt, C.value.color]
1280
1321
  ])
1281
1322
  ], 4),
1282
- h("span", ps, z(C.value.color), 1)
1323
+ h("span", ps, L(C.value.color), 1)
1283
1324
  ])
1284
1325
  ])
1285
1326
  ]),
@@ -1292,19 +1333,19 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
1292
1333
  onClick: Pt,
1293
1334
  class: "confirm-btn",
1294
1335
  disabled: !C.value.name.trim()
1295
- }, "确认", 8, ws)
1336
+ }, "确认", 8, xs)
1296
1337
  ])
1297
1338
  ])
1298
- ])) : B("", !0)
1339
+ ])) : R("", !0)
1299
1340
  ], 2));
1300
1341
  }
1301
- }), bs = /* @__PURE__ */ rt(xs, [["__scopeId", "data-v-914fe07d"]]), Cs = {
1342
+ }), bs = /* @__PURE__ */ rt(ws, [["__scopeId", "data-v-08cbbaca"]]), Cs = {
1302
1343
  class: "thumbnail-wrapper",
1303
1344
  ref: "wrapper"
1304
- }, _s = ["src", "alt"], ks = ["viewBox", "preserveAspectRatio"], Is = ["x", "y", "width", "height", "stroke", "stroke-width"], As = ["points", "stroke", "stroke-width"], Ss = ["transform"], Ms = ["x", "y", "width", "height", "stroke", "stroke-width"], Ts = { key: 3 }, Ds = ["cx", "cy", "r", "fill", "stroke-width"], Ps = ["x", "y", "width", "height", "fill"], zs = ["x", "y", "fill", "font-size", "font-weight", "text-anchor", "dominant-baseline"], $s = {
1345
+ }, _s = ["src", "alt"], ks = ["viewBox", "preserveAspectRatio"], Is = ["x", "y", "width", "height", "stroke", "stroke-width"], As = ["points", "stroke", "stroke-width"], Ss = ["transform"], Ms = ["x", "y", "width", "height", "stroke", "stroke-width"], Ts = { key: 3 }, Ds = ["cx", "cy", "r", "fill", "stroke-width"], Ps = { key: 4 }, Ls = ["x", "y", "height"], zs = {
1305
1346
  key: 1,
1306
1347
  class: "loading-placeholder"
1307
- }, Ls = /* @__PURE__ */ ct({
1348
+ }, $s = /* @__PURE__ */ ct({
1308
1349
  __name: "AnnotationThumbnail",
1309
1350
  props: {
1310
1351
  src: {},
@@ -1315,23 +1356,23 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
1315
1356
  strokeWidth: {},
1316
1357
  fontSize: {}
1317
1358
  },
1318
- setup(w) {
1319
- const t = w, n = M(null), e = M(!1), a = M(0), o = M(0), c = () => {
1320
- n.value && (a.value = n.value.naturalWidth, o.value = n.value.naturalHeight, e.value = !0);
1321
- }, g = V(() => t.fit === "contain" ? "xMidYMid meet" : "xMidYMid slice"), u = V(() => t.strokeWidth ?? 10), r = V(() => t.fontSize ?? 30), k = (C) => {
1359
+ setup(y) {
1360
+ const t = y, n = M(null), e = M(!1), l = M(0), o = M(0), a = () => {
1361
+ n.value && (l.value = n.value.naturalWidth, o.value = n.value.naturalHeight, e.value = !0);
1362
+ }, g = O(() => t.fit === "contain" ? "xMidYMid meet" : "xMidYMid slice"), u = O(() => t.strokeWidth ?? 10), r = O(() => t.fontSize ?? 30), A = (C) => {
1322
1363
  var S;
1323
1364
  if ((S = C.style) != null && S.strokeColor) return C.style.strokeColor;
1324
1365
  if (t.labels) {
1325
- const p = t.labels.find((H) => H.name === C.label);
1326
- if (p) return p.color;
1366
+ const x = t.labels.find((H) => H.name === C.label);
1367
+ if (x) return x.color;
1327
1368
  }
1328
1369
  return "#FF0000";
1329
- }, x = (C) => {
1330
- const S = C.coordinates, p = Math.min(S.x1, S.x2), H = Math.min(S.y1, S.y2), O = Math.abs(S.x1 - S.x2), G = Math.abs(S.y1 - S.y2);
1331
- return { x: p, y: H, width: O, height: G };
1332
- }, D = (C) => C.coordinates.points.map((p) => `${p.x},${p.y}`).join(" "), _ = (C) => {
1370
+ }, w = (C) => {
1371
+ const S = C.coordinates, x = Math.min(S.x1, S.x2), H = Math.min(S.y1, S.y2), V = Math.abs(S.x1 - S.x2), G = Math.abs(S.y1 - S.y2);
1372
+ return { x, y: H, width: V, height: G };
1373
+ }, D = (C) => C.coordinates.points.map((x) => `${x.x},${x.y}`).join(" "), _ = (C) => {
1333
1374
  if (C.type === "rectangle") {
1334
- const S = x(C);
1375
+ const S = w(C);
1335
1376
  return { x: S.x, y: S.y - 5 };
1336
1377
  } else if (C.type === "polygon") {
1337
1378
  const S = C.coordinates.points;
@@ -1346,97 +1387,101 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
1346
1387
  return { x: C.coordinates.x, y: C.coordinates.y };
1347
1388
  }
1348
1389
  return { x: 0, y: 0 };
1349
- }, $ = (C) => {
1350
- const { x: S, y: p, angle: H } = C.coordinates, O = H * 180 / Math.PI;
1351
- return `translate(${S}, ${p}) rotate(${O})`;
1352
- }, q = (C) => ({ x: C.coordinates.x, y: C.coordinates.y });
1390
+ }, z = (C) => {
1391
+ const { x: S, y: x, angle: H } = C.coordinates, V = H * 180 / Math.PI;
1392
+ return `translate(${S}, ${x}) rotate(${V})`;
1393
+ }, X = (C) => ({ x: C.coordinates.x, y: C.coordinates.y });
1353
1394
  return (C, S) => (v(), m("div", Cs, [
1354
1395
  h("img", {
1355
1396
  ref_key: "img",
1356
1397
  ref: n,
1357
- src: w.src,
1398
+ src: y.src,
1358
1399
  class: "thumbnail-image",
1359
- style: U({ objectFit: w.fit }),
1360
- onLoad: c,
1361
- alt: w.alt
1400
+ style: U({ objectFit: y.fit }),
1401
+ onLoad: a,
1402
+ alt: y.alt
1362
1403
  }, null, 44, _s),
1363
1404
  e.value ? (v(), m("svg", {
1364
1405
  key: 0,
1365
1406
  class: "annotation-overlay",
1366
- viewBox: `0 0 ${a.value} ${o.value}`,
1407
+ viewBox: `0 0 ${l.value} ${o.value}`,
1367
1408
  preserveAspectRatio: g.value
1368
1409
  }, [
1369
- (v(!0), m(N, null, J(w.annotations, (p) => (v(), m(N, {
1370
- key: p.id
1410
+ (v(!0), m(W, null, J(y.annotations, (x) => (v(), m(W, {
1411
+ key: x.id
1371
1412
  }, [
1372
- p.type === "rectangle" ? (v(), m("rect", {
1413
+ x.type === "rectangle" ? (v(), m("rect", {
1373
1414
  key: 0,
1374
- x: x(p).x,
1375
- y: x(p).y,
1376
- width: x(p).width,
1377
- height: x(p).height,
1378
- stroke: k(p),
1415
+ x: w(x).x,
1416
+ y: w(x).y,
1417
+ width: w(x).width,
1418
+ height: w(x).height,
1419
+ stroke: A(x),
1379
1420
  "stroke-width": u.value,
1380
1421
  fill: "transparent"
1381
- }, null, 8, Is)) : p.type === "polygon" ? (v(), m("polygon", {
1422
+ }, null, 8, Is)) : x.type === "polygon" ? (v(), m("polygon", {
1382
1423
  key: 1,
1383
- points: D(p),
1384
- stroke: k(p),
1424
+ points: D(x),
1425
+ stroke: A(x),
1385
1426
  "stroke-width": u.value,
1386
1427
  fill: "transparent"
1387
- }, null, 8, As)) : p.type === "rotatedRect" ? (v(), m("g", {
1428
+ }, null, 8, As)) : x.type === "rotatedRect" ? (v(), m("g", {
1388
1429
  key: 2,
1389
- transform: $(p)
1430
+ transform: z(x)
1390
1431
  }, [
1391
1432
  h("rect", {
1392
- x: -p.coordinates.width / 2,
1393
- y: -p.coordinates.height / 2,
1394
- width: p.coordinates.width,
1395
- height: p.coordinates.height,
1396
- stroke: k(p),
1433
+ x: -x.coordinates.width / 2,
1434
+ y: -x.coordinates.height / 2,
1435
+ width: x.coordinates.width,
1436
+ height: x.coordinates.height,
1437
+ stroke: A(x),
1397
1438
  "stroke-width": u.value,
1398
1439
  fill: "transparent"
1399
1440
  }, null, 8, Ms)
1400
- ], 8, Ss)) : p.type === "point" ? (v(), m("g", Ts, [
1401
- (v(!0), m(N, null, J(p.coordinates.points, (H, O) => (v(), m("circle", {
1402
- key: O,
1441
+ ], 8, Ss)) : x.type === "point" ? (v(), m("g", Ts, [
1442
+ (v(!0), m(W, null, J(x.coordinates.points, (H, V) => (v(), m("circle", {
1443
+ key: V,
1403
1444
  cx: H.x,
1404
1445
  cy: H.y,
1405
1446
  r: u.value * 1.5,
1406
- fill: k(p),
1447
+ fill: A(x),
1407
1448
  stroke: "white",
1408
1449
  "stroke-width": u.value * 0.5
1409
1450
  }, null, 8, Ds))), 128))
1410
- ])) : p.type === "category" ? (v(), m("rect", {
1411
- key: 4,
1412
- x: q(p).x - (p.label || "").length * r.value * 0.6 / 2 - 8,
1413
- y: q(p).y - r.value / 2 - 4,
1414
- width: (p.label || "").length * r.value * 0.6 + 16,
1415
- height: r.value + 8,
1416
- rx: "6",
1417
- ry: "6",
1418
- fill: k(p),
1419
- "fill-opacity": "0.85"
1420
- }, null, 8, Ps)) : B("", !0),
1421
- p.label ? (v(), m("text", {
1422
- key: 5,
1423
- x: _(p).x,
1424
- y: _(p).y,
1425
- fill: p.type === "category" ? "#ffffff" : k(p),
1426
- "font-size": r.value,
1427
- "font-weight": p.type === "category" ? "normal" : "bold",
1428
- "text-anchor": p.type === "category" ? "middle" : "start",
1429
- "dominant-baseline": p.type === "category" ? "middle" : "auto",
1430
- class: X({ "anno-label": p.type !== "category" })
1431
- }, z(p.label), 11, zs)) : B("", !0)
1451
+ ])) : R("", !0),
1452
+ x.label ? (v(), m("g", Ps, [
1453
+ (v(), m("foreignObject", {
1454
+ x: x.type === "category" ? X(x).x - 100 : _(x).x,
1455
+ y: x.type === "category" ? X(x).y - r.value - 8 : _(x).y - r.value - 8,
1456
+ width: "200",
1457
+ height: r.value + 16,
1458
+ style: { overflow: "visible" }
1459
+ }, [
1460
+ h("div", {
1461
+ style: U({
1462
+ display: "inline-flex",
1463
+ alignItems: "center",
1464
+ justifyContent: x.type === "category" ? "center" : "flex-start",
1465
+ backgroundColor: `${A(x)}cc`,
1466
+ color: "#ffffff",
1467
+ fontSize: `${r.value}px`,
1468
+ padding: "4px 8px",
1469
+ borderRadius: "4px",
1470
+ whiteSpace: "nowrap",
1471
+ lineHeight: 1,
1472
+ transform: x.type === "category" ? "translateX(calc(100px - 50%))" : "none"
1473
+ })
1474
+ }, L(x.label), 5)
1475
+ ], 8, Ls))
1476
+ ])) : R("", !0)
1432
1477
  ], 64))), 128))
1433
- ], 8, ks)) : (v(), m("div", $s, "Loading..."))
1478
+ ], 8, ks)) : (v(), m("div", zs, "Loading..."))
1434
1479
  ], 512));
1435
1480
  }
1436
- }), Bs = /* @__PURE__ */ rt(Ls, [["__scopeId", "data-v-159a7956"]]), Rs = {
1481
+ }), Rs = /* @__PURE__ */ rt($s, [["__scopeId", "data-v-46e27181"]]), Bs = {
1437
1482
  key: 0,
1438
1483
  class: "gallery-view"
1439
- }, Hs = { class: "gallery-layout" }, Es = { class: "gallery-sidebar" }, Us = { class: "label-stats-table" }, Vs = { class: "label-cover-wrapper" }, Os = ["src"], Fs = { class: "gallery-content" }, Ns = ["onClick"], Ws = { class: "thumbnail-wrapper" }, Gs = { class: "img-meta" }, Ys = { class: "img-index" }, Js = { class: "anno-count" }, js = {
1484
+ }, Hs = { class: "gallery-layout" }, Es = { class: "gallery-sidebar" }, Us = { class: "label-stats-table" }, Os = { class: "label-cover-wrapper" }, Vs = ["src"], Fs = { class: "gallery-content" }, Ws = ["onClick"], Ns = { class: "thumbnail-wrapper" }, Gs = { class: "img-meta" }, Ys = { class: "img-index" }, Js = { class: "anno-count" }, js = {
1440
1485
  key: 0,
1441
1486
  class: "bottom-bar"
1442
1487
  }, Xs = {
@@ -1450,113 +1495,114 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
1450
1495
  actionBar: {},
1451
1496
  clickToEnterEditor: { type: Boolean },
1452
1497
  thumbStrokeWidth: {},
1453
- thumbFontSize: {}
1498
+ thumbFontSize: {},
1499
+ readOnly: { type: Boolean }
1454
1500
  },
1455
1501
  emits: ["export", "update:images", "imageClick", "update:labels", "pageChange"],
1456
- setup(w, { expose: t, emit: n }) {
1457
- const e = w, a = n, o = M("gallery"), c = M([]), g = M([]), u = M(0), r = M(null), k = M(null), x = M(null), D = V(() => {
1458
- var y, b;
1459
- return ((b = (y = e.actionBar) == null ? void 0 : y.annotateButton) == null ? void 0 : b.show) === !0;
1460
- }), _ = V(() => {
1461
- var y, b;
1462
- return ((b = (y = e.actionBar) == null ? void 0 : y.exportButton) == null ? void 0 : b.show) === !0;
1463
- }), $ = V(() => D.value || _.value), q = V(() => {
1464
- var y, b;
1465
- return ((b = (y = e.actionBar) == null ? void 0 : y.annotateButton) == null ? void 0 : b.text) || "手动标注";
1466
- }), C = V(() => {
1467
- var y, b;
1468
- return ((b = (y = e.actionBar) == null ? void 0 : y.exportButton) == null ? void 0 : b.text) || "导出";
1469
- }), S = V(() => e.clickToEnterEditor !== !1), p = V(() => {
1470
- const y = {};
1471
- g.value.forEach((I) => {
1472
- y[I.name] = { count: 0, cover: "" };
1502
+ setup(y, { expose: t, emit: n }) {
1503
+ const e = y, l = n, o = M("gallery"), a = M([]), g = M([]), u = M(0), r = M(null), A = M(null), w = M(null), D = O(() => {
1504
+ var p, b;
1505
+ return ((b = (p = e.actionBar) == null ? void 0 : p.annotateButton) == null ? void 0 : b.show) === !0;
1506
+ }), _ = O(() => {
1507
+ var p, b;
1508
+ return ((b = (p = e.actionBar) == null ? void 0 : p.exportButton) == null ? void 0 : b.show) === !0;
1509
+ }), z = O(() => D.value || _.value), X = O(() => {
1510
+ var p, b;
1511
+ return ((b = (p = e.actionBar) == null ? void 0 : p.annotateButton) == null ? void 0 : b.text) || "手动标注";
1512
+ }), C = O(() => {
1513
+ var p, b;
1514
+ return ((b = (p = e.actionBar) == null ? void 0 : p.exportButton) == null ? void 0 : b.text) || "导出";
1515
+ }), S = O(() => e.clickToEnterEditor !== !1), x = O(() => {
1516
+ const p = {};
1517
+ g.value.forEach((k) => {
1518
+ p[k.name] = { count: 0, cover: "" };
1473
1519
  });
1474
1520
  let b = 0;
1475
- return c.value.forEach((I) => {
1476
- I.annotations && I.annotations.forEach((F) => {
1477
- var W;
1478
- const E = F.label || (F.labelId ? (W = g.value.find((Y) => Y.id === F.labelId)) == null ? void 0 : W.name : null);
1479
- E && y[E] && (y[E].count++, b++, y[E].cover || (y[E].cover = I.imageUrl));
1521
+ return a.value.forEach((k) => {
1522
+ k.annotations && k.annotations.forEach((F) => {
1523
+ var N;
1524
+ const E = F.label || (F.labelId ? (N = g.value.find((Y) => Y.id === F.labelId)) == null ? void 0 : N.name : null);
1525
+ E && p[E] && (p[E].count++, b++, p[E].cover || (p[E].cover = k.imageUrl));
1480
1526
  });
1481
- }), g.value.map((I) => {
1482
- var W, Y;
1483
- const F = ((W = y[I.name]) == null ? void 0 : W.count) || 0, E = b === 0 ? "0.00%" : (F / b * 100).toFixed(2) + "%";
1527
+ }), g.value.map((k) => {
1528
+ var N, Y;
1529
+ const F = ((N = p[k.name]) == null ? void 0 : N.count) || 0, E = b === 0 ? "0.00%" : (F / b * 100).toFixed(2) + "%";
1484
1530
  return {
1485
- id: I.id,
1486
- name: I.name,
1487
- color: I.color,
1531
+ id: k.id,
1532
+ name: k.name,
1533
+ color: k.color,
1488
1534
  count: F,
1489
1535
  percentage: E,
1490
- cover: ((Y = y[I.name]) == null ? void 0 : Y.cover) || ""
1536
+ cover: ((Y = p[k.name]) == null ? void 0 : Y.cover) || ""
1491
1537
  };
1492
1538
  });
1493
- }), H = (y) => ({
1494
- color: y.color,
1495
- backgroundColor: y.color + "1A"
1539
+ }), H = (p) => ({
1540
+ color: p.color,
1541
+ backgroundColor: p.color + "1A"
1496
1542
  // 1A represents ~10% opacity in hex
1497
1543
  });
1498
1544
  yt(() => {
1499
- a("pageChange", { nowPage: "listPage" });
1500
- }), K(() => e.images, (y) => {
1501
- c.value = JSON.parse(JSON.stringify(y));
1502
- }, { immediate: !0, deep: !0 }), K(() => e.labels, (y) => {
1503
- g.value = JSON.parse(JSON.stringify(y || []));
1545
+ l("pageChange", { nowPage: "listPage" });
1546
+ }), K(() => e.images, (p) => {
1547
+ a.value = JSON.parse(JSON.stringify(p));
1548
+ }, { immediate: !0, deep: !0 }), K(() => e.labels, (p) => {
1549
+ g.value = JSON.parse(JSON.stringify(p || []));
1504
1550
  }, { immediate: !0, deep: !0 });
1505
- const O = (y) => {
1506
- u.value = y, o.value = "editor", a("pageChange", { nowPage: "editPage" }), x.value && (x.value.scrollTop = 0), at(() => {
1507
- k.value && (k.value.scrollTop = 0), window.scrollTo(0, 0), requestAnimationFrame(() => {
1508
- var b, I;
1509
- (I = (b = r.value) == null ? void 0 : b.jumpTo) == null || I.call(b, y);
1551
+ const V = (p) => {
1552
+ u.value = p, o.value = "editor", l("pageChange", { nowPage: "editPage" }), w.value && (w.value.scrollTop = 0), at(() => {
1553
+ A.value && (A.value.scrollTop = 0), window.scrollTo(0, 0), requestAnimationFrame(() => {
1554
+ var b, k;
1555
+ (k = (b = r.value) == null ? void 0 : b.jumpTo) == null || k.call(b, p);
1510
1556
  });
1511
1557
  });
1512
- }, G = (y, b) => {
1558
+ }, G = (p, b) => {
1513
1559
  if (S.value) {
1514
- O(y);
1560
+ V(p);
1515
1561
  return;
1516
1562
  }
1517
- a("imageClick", { index: y, imageId: b.id, image: b });
1518
- }, Z = (y) => c.value.findIndex((b) => b.id === y);
1563
+ l("imageClick", { index: p, imageId: b.id, image: b });
1564
+ }, Z = (p) => a.value.findIndex((b) => b.id === p);
1519
1565
  t({
1520
- openImageById: (y) => {
1521
- const b = Z(y);
1522
- return b < 0 ? !1 : (O(b), !0);
1566
+ openImageById: (p) => {
1567
+ const b = Z(p);
1568
+ return b < 0 ? !1 : (V(b), !0);
1523
1569
  },
1524
- triggerImageClickById: (y) => {
1525
- const b = Z(y);
1570
+ triggerImageClickById: (p) => {
1571
+ const b = Z(p);
1526
1572
  if (b < 0)
1527
1573
  return !1;
1528
- const I = c.value[b];
1529
- return I ? (a("imageClick", { index: b, imageId: I.id, image: I }), !0) : !1;
1574
+ const k = a.value[b];
1575
+ return k ? (l("imageClick", { index: b, imageId: k.id, image: k }), !0) : !1;
1530
1576
  },
1531
1577
  getFinalData: () => ({
1532
- images: JSON.parse(JSON.stringify(c.value)),
1578
+ images: JSON.parse(JSON.stringify(a.value)),
1533
1579
  labels: JSON.parse(JSON.stringify(g.value))
1534
1580
  })
1535
1581
  });
1536
1582
  const it = () => {
1537
1583
  if (r.value && r.value.getCurrentAnnotation) {
1538
- const y = r.value.getCurrentAnnotation();
1539
- c.value[u.value] && (c.value[u.value].annotations = y.annotations);
1584
+ const p = r.value.getCurrentAnnotation();
1585
+ a.value[u.value] && (a.value[u.value].annotations = p.annotations);
1540
1586
  }
1541
- o.value = "gallery", a("pageChange", { nowPage: "listPage" });
1587
+ o.value = "gallery", l("pageChange", { nowPage: "listPage" });
1542
1588
  }, nt = () => {
1543
- a("export", c.value);
1544
- }, ht = (y) => {
1545
- u.value = y.currentIndex, c.value[y.currentIndex] && (c.value[y.currentIndex].annotations = y.currentAnnotations);
1546
- }, Q = (y) => {
1589
+ l("export", a.value);
1590
+ }, ht = (p) => {
1591
+ u.value = p.currentIndex, a.value[p.currentIndex] && (a.value[p.currentIndex].annotations = p.currentAnnotations);
1592
+ }, Q = (p) => {
1547
1593
  if (r.value && r.value.getCurrentAnnotation) {
1548
1594
  const b = r.value.getCurrentAnnotation();
1549
- c.value[u.value] && (c.value[u.value].annotations = b.annotations, a("update:images", c.value));
1595
+ a.value[u.value] && (a.value[u.value].annotations = b.annotations, l("update:images", a.value));
1550
1596
  }
1551
- }, j = (y) => {
1552
- g.value = JSON.parse(JSON.stringify(y || [])), a("update:labels", g.value);
1597
+ }, j = (p) => {
1598
+ g.value = JSON.parse(JSON.stringify(p || [])), l("update:labels", g.value);
1553
1599
  };
1554
- return (y, b) => (v(), m("div", {
1600
+ return (p, b) => (v(), m("div", {
1555
1601
  ref_key: "batchRootRef",
1556
- ref: k,
1602
+ ref: A,
1557
1603
  class: "batch-annotator"
1558
1604
  }, [
1559
- o.value === "gallery" ? (v(), m("div", Rs, [
1605
+ o.value === "gallery" ? (v(), m("div", Bs, [
1560
1606
  h("div", Hs, [
1561
1607
  h("div", Es, [
1562
1608
  h("table", Us, [
@@ -1569,26 +1615,26 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
1569
1615
  ])
1570
1616
  ], -1)),
1571
1617
  h("tbody", null, [
1572
- (v(!0), m(N, null, J(p.value, (I) => (v(), m("tr", {
1573
- key: I.id,
1574
- style: U(H(I))
1618
+ (v(!0), m(W, null, J(x.value, (k) => (v(), m("tr", {
1619
+ key: k.id,
1620
+ style: U(H(k))
1575
1621
  }, [
1576
1622
  h("td", null, [
1577
- h("div", Vs, [
1578
- I.cover ? (v(), m("img", {
1623
+ h("div", Os, [
1624
+ k.cover ? (v(), m("img", {
1579
1625
  key: 0,
1580
- src: I.cover,
1626
+ src: k.cover,
1581
1627
  class: "label-cover"
1582
- }, null, 8, Os)) : (v(), m("div", {
1628
+ }, null, 8, Vs)) : (v(), m("div", {
1583
1629
  key: 1,
1584
1630
  class: "label-cover-empty",
1585
- style: U({ backgroundColor: I.color })
1631
+ style: U({ backgroundColor: k.color })
1586
1632
  }, null, 4))
1587
1633
  ])
1588
1634
  ]),
1589
- h("td", null, z(I.name), 1),
1590
- h("td", null, z(I.count), 1),
1591
- h("td", null, z(I.percentage), 1)
1635
+ h("td", null, L(k.name), 1),
1636
+ h("td", null, L(k.count), 1),
1637
+ h("td", null, L(k.percentage), 1)
1592
1638
  ], 4))), 128))
1593
1639
  ])
1594
1640
  ])
@@ -1596,18 +1642,18 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
1596
1642
  h("div", Fs, [
1597
1643
  h("div", {
1598
1644
  ref_key: "galleryGridRef",
1599
- ref: x,
1645
+ ref: w,
1600
1646
  class: "gallery-grid"
1601
1647
  }, [
1602
- (v(!0), m(N, null, J(c.value, (I, F) => (v(), m("div", {
1648
+ (v(!0), m(W, null, J(a.value, (k, F) => (v(), m("div", {
1603
1649
  key: F,
1604
1650
  class: "gallery-item",
1605
- onClick: (E) => G(F, I)
1651
+ onClick: (E) => G(F, k)
1606
1652
  }, [
1607
- h("div", Ws, [
1608
- R(Bs, {
1609
- src: I.imageUrl,
1610
- annotations: I.annotations || [],
1653
+ h("div", Ns, [
1654
+ B(Rs, {
1655
+ src: k.imageUrl,
1656
+ annotations: k.annotations || [],
1611
1657
  labels: g.value,
1612
1658
  fit: "cover",
1613
1659
  strokeWidth: e.thumbStrokeWidth,
@@ -1615,31 +1661,31 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
1615
1661
  }, null, 8, ["src", "annotations", "labels", "strokeWidth", "fontSize"])
1616
1662
  ]),
1617
1663
  h("div", Gs, [
1618
- h("span", Ys, "#" + z(F + 1), 1),
1619
- h("span", Js, z((I.annotations || []).length) + " 标注", 1)
1664
+ h("span", Ys, "#" + L(F + 1), 1),
1665
+ h("span", Js, L((k.annotations || []).length) + " 标注", 1)
1620
1666
  ])
1621
- ], 8, Ns))), 128))
1667
+ ], 8, Ws))), 128))
1622
1668
  ], 512)
1623
1669
  ])
1624
1670
  ]),
1625
- $.value ? (v(), m("div", js, [
1671
+ z.value ? (v(), m("div", js, [
1626
1672
  D.value ? (v(), m("button", {
1627
1673
  key: 0,
1628
1674
  class: "action-btn primary",
1629
- onClick: b[0] || (b[0] = (I) => O(0))
1675
+ onClick: b[0] || (b[0] = (k) => V(0))
1630
1676
  }, [
1631
- R(L, { name: "edit" }),
1632
- lt(" " + z(q.value), 1)
1633
- ])) : B("", !0),
1677
+ B($, { name: "edit" }),
1678
+ lt(" " + L(X.value), 1)
1679
+ ])) : R("", !0),
1634
1680
  _.value ? (v(), m("button", {
1635
1681
  key: 1,
1636
1682
  class: "action-btn success",
1637
1683
  onClick: nt
1638
1684
  }, [
1639
- R(L, { name: "download" }),
1640
- lt(" " + z(C.value), 1)
1641
- ])) : B("", !0)
1642
- ])) : B("", !0)
1685
+ B($, { name: "download" }),
1686
+ lt(" " + L(C.value), 1)
1687
+ ])) : R("", !0)
1688
+ ])) : R("", !0)
1643
1689
  ])) : (v(), m("div", Xs, [
1644
1690
  h("div", qs, [
1645
1691
  h("div", Ks, [
@@ -1647,32 +1693,33 @@ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//D
1647
1693
  class: "back-btn",
1648
1694
  onClick: it
1649
1695
  }, [
1650
- R(L, {
1696
+ B($, {
1651
1697
  name: "back",
1652
1698
  class: "back-icon"
1653
1699
  }),
1654
1700
  b[2] || (b[2] = lt()),
1655
1701
  b[3] || (b[3] = h("span", { class: "back-text" }, "返回", -1))
1656
1702
  ]),
1657
- h("span", Zs, "正在标注: " + z(u.value + 1) + " / " + z(c.value.length), 1)
1703
+ h("span", Zs, L(y.readOnly ? "正在查看" : "正在标注") + ": " + L(u.value + 1) + " / " + L(a.value.length), 1)
1658
1704
  ])
1659
1705
  ]),
1660
1706
  h("div", Qs, [
1661
- R(bs, {
1707
+ B(bs, {
1662
1708
  ref_key: "annotatorRef",
1663
1709
  ref: r,
1664
- batchImages: c.value,
1710
+ batchImages: a.value,
1665
1711
  labels: g.value,
1712
+ readOnly: y.readOnly,
1666
1713
  annotationTypes: ["rectangle", "polygon", "point", "rotatedRect", "category"],
1667
1714
  onBatchChange: ht,
1668
1715
  onAnnotationChange: Q,
1669
1716
  onLabelChange: j
1670
- }, null, 8, ["batchImages", "labels"])
1717
+ }, null, 8, ["batchImages", "labels", "readOnly"])
1671
1718
  ])
1672
1719
  ]))
1673
1720
  ], 512));
1674
1721
  }
1675
- }), ii = /* @__PURE__ */ rt(ti, [["__scopeId", "data-v-5bb1d03b"]]);
1722
+ }), ii = /* @__PURE__ */ rt(ti, [["__scopeId", "data-v-448a060c"]]);
1676
1723
  export {
1677
1724
  ii as BatchAnnotator,
1678
1725
  bs as ImageAnnotator,