@servantcdh/ez-planet-labeling 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import tt, { createContext as xn, useState as re, useEffect as ce, useMemo as ve, useContext as Ln, useCallback as $, useRef as Ce, createElement as Je } from "react";
2
- import { jsx as d, jsxs as S, Fragment as Mt } from "react/jsx-runtime";
3
- const za = ["Record", "Image", "Text", "Number", "File"], Fa = "Brush", Fe = "Bounded Box", It = "Filled Box", wn = "Filled Polygon", Ct = "Magic Brush", _e = "Superpixel", it = "BrushCursor", pt = "SuperpixelBoundary", Xa = "Combined Label", bt = "Segment Anything Box", $a = "Eraser", Sn = 1, Mn = 0, In = [
4
- it,
5
- pt,
6
- bt
7
- ], Nt = [
1
+ import et, { createContext as xn, useState as re, useEffect as ce, useMemo as ve, useContext as Ln, useCallback as $, useRef as Ce, createElement as Ke } from "react";
2
+ import { jsx as u, jsxs as S, Fragment as It } from "react/jsx-runtime";
3
+ const za = ["Record", "Image", "Text", "Number", "File"], Fa = "Brush", Fe = "Bounded Box", Nt = "Filled Box", wn = "Filled Polygon", vt = "Magic Brush", _e = "Superpixel", at = "BrushCursor", Ct = "SuperpixelBoundary", Xa = "Combined Label", pt = "Segment Anything Box", $a = "Eraser", Sn = 1, Mn = 0, In = [
4
+ at,
5
+ Ct,
6
+ pt
7
+ ], kt = [
8
8
  "id",
9
9
  "unique",
10
10
  "hex",
@@ -32,11 +32,11 @@ const On = async () => (ze || (ze = await import("fabric")), ze), oe = () => {
32
32
  "Fabric has not been loaded. Call loadFabric() first (async)."
33
33
  );
34
34
  return ze;
35
- }, ke = () => oe().Point, Pn = () => oe().Line, Gt = () => oe().Rect, qt = () => oe().Polygon, Tn = () => oe().PencilBrush, Bn = () => oe().Circle, Kt = () => oe().FabricImage, En = () => oe().Control, Rn = () => oe().StaticCanvas;
36
- let Xe = null, Dn = { x: 0, y: 0 }, An = { x: 0, y: 0 };
37
- const Q = () => Xe, Rt = (e) => {
35
+ }, Oe = () => oe().Point, Pn = () => oe().Line, qt = () => oe().Rect, Kt = () => oe().Polygon, Tn = () => oe().PencilBrush, Bn = () => oe().Circle, Jt = () => oe().FabricImage, En = () => oe().Control, Rn = () => oe().StaticCanvas;
36
+ let Xe = null, An = { x: 0, y: 0 }, Dn = { x: 0, y: 0 };
37
+ const Q = () => Xe, At = (e) => {
38
38
  Xe = e;
39
- }, Hn = () => Dn, _n = () => An, pe = () => {
39
+ }, Hn = () => An, _n = () => Dn, pe = () => {
40
40
  if (!Xe)
41
41
  throw new Error("Canvas has not been initialized.");
42
42
  return Xe;
@@ -68,8 +68,8 @@ const Q = () => Xe, Rt = (e) => {
68
68
  return () => {
69
69
  };
70
70
  const n = Vn.map((s) => {
71
- const o = `label:${s}`, a = (i) => {
72
- e(s, i.data);
71
+ const o = `label:${s}`, a = (r) => {
72
+ e(s, r.data);
73
73
  };
74
74
  return t.on(o, a), { eventName: o, handler: a };
75
75
  });
@@ -81,27 +81,27 @@ const Q = () => Xe, Rt = (e) => {
81
81
  }, Un = (e, t) => {
82
82
  const n = Q();
83
83
  n && n.fire(`label:${e}`, { data: t });
84
- }, Jt = (e) => e, we = (e = pe()) => Jt(e.getObjects()), Ga = (e = pe()) => e.getActiveObjects(), Wn = (e) => ({
84
+ }, jt = (e) => e, Se = (e = pe()) => jt(e.getObjects()), Ga = (e = pe()) => e.getActiveObjects(), Wn = (e) => ({
85
85
  ...e,
86
- objects: Jt(e.objects)
87
- }), Ue = (e = pe()) => Wn(e.toJSON(Nt)), He = (e) => (t) => e(t), I = (e) => e, Dt = (e, t) => t === 0 ? 0 : e / t, st = ({ x: e, y: t }) => {
86
+ objects: jt(e.objects)
87
+ }), Ue = (e = pe()) => Wn(e.toJSON(kt)), De = (e) => (t) => e(t), I = (e) => e, Dt = (e, t) => t === 0 ? 0 : e / t, ot = ({ x: e, y: t }) => {
88
88
  const s = pe().getZoom();
89
89
  return { x: Dt(e, s), y: Dt(t, s) };
90
- }, jt = (e) => st({
90
+ }, Qt = (e) => ot({
91
91
  x: e.offsetX,
92
92
  y: e.offsetY
93
- }), Ne = (e) => {
93
+ }), ke = (e) => {
94
94
  const t = e ?? Xe;
95
95
  t && t.contextContainer && t.renderAll();
96
- }, kt = (e, t) => {
97
- const n = pe(), s = Bn(), o = Gt(), a = Hn();
96
+ }, Ot = (e, t) => {
97
+ const n = pe(), s = Bn(), o = qt(), a = Hn();
98
98
  n.remove(
99
- ...we(n).filter(
100
- ({ info: r }) => r === it
99
+ ...Se(n).filter(
100
+ ({ info: c }) => c === at
101
101
  )
102
102
  );
103
- const i = {
104
- info: it,
103
+ const r = {
104
+ info: at,
105
105
  left: -100,
106
106
  top: -100,
107
107
  width: e.lineWidth,
@@ -116,38 +116,38 @@ const Q = () => Xe, Rt = (e) => {
116
116
  originX: "center",
117
117
  originY: "center",
118
118
  selectable: !1
119
- }, c = e.lineCap === "round" ? new s(i) : new o(i), l = (r) => {
120
- if (!r && !a.x)
119
+ }, i = e.lineCap === "round" ? new s(r) : new o(r), l = (c) => {
120
+ if (!c && !a.x)
121
121
  return;
122
- const m = r == null ? void 0 : r.e, { x: v, y: g } = m ? n.getScenePoint(m) : a;
123
- a.x = v, a.y = g, c.set({ top: g, left: v }), c.setCoords(), n.renderAll();
124
- }, h = (r) => {
125
- l(r);
126
- }, u = () => {
122
+ const m = c == null ? void 0 : c.e, { x: v, y: f } = m ? n.getScenePoint(m) : a;
123
+ a.x = v, a.y = f, i.set({ top: f, left: v }), i.setCoords(), n.renderAll();
124
+ }, g = (c) => {
125
+ l(c);
126
+ }, d = () => {
127
127
  Un("init");
128
128
  };
129
- return l(), { brushCursor: c, handleOnMouseMove: h, handleOnMouseUp: u };
130
- }, Ot = ({ colorCode: e, callback: t }, n, s = !1) => {
131
- const o = pe(), a = Gt();
132
- s && (n = s, o.getObjects().forEach((r) => r.set({ visible: !1 })), o.renderAll());
133
- let i = 0, c = 0;
134
- const l = function(r) {
135
- const m = r.scenePoint ?? r.pointer;
129
+ return l(), { brushCursor: i, handleOnMouseMove: g, handleOnMouseUp: d };
130
+ }, Pt = ({ colorCode: e, callback: t }, n, s = !1) => {
131
+ const o = pe(), a = qt();
132
+ s && (n = s, o.getObjects().forEach((c) => c.set({ visible: !1 })), o.renderAll());
133
+ let r = 0, i = 0;
134
+ const l = function(c) {
135
+ const m = c.scenePoint ?? c.pointer;
136
136
  if (!m)
137
137
  return;
138
- const { x: v, y: g } = st(m);
139
- i = v, c = g;
140
- }, h = function(r) {
141
- const m = r.scenePoint ?? r.pointer;
138
+ const { x: v, y: f } = ot(m);
139
+ r = v, i = f;
140
+ }, g = function(c) {
141
+ const m = c.scenePoint ?? c.pointer;
142
142
  if (!m)
143
143
  return;
144
- const { x: v, y: g } = st(m), b = v - i, f = g - c;
145
- let p = Math.abs(b), N = Math.abs(f), Z = b > 0 ? i : v, V = f > 0 ? c : g;
146
- const D = Z < 0, k = V < 0;
147
- p = D ? p + Z : p, N = k ? N + V : N, Z = D ? 0 : Z, V = k ? 0 : V;
144
+ const { x: v, y: f } = ot(m), b = v - r, h = f - i;
145
+ let p = Math.abs(b), N = Math.abs(h), Z = b > 0 ? r : v, V = h > 0 ? i : f;
146
+ const A = Z < 0, k = V < 0;
147
+ p = A ? p + Z : p, N = k ? N + V : N, Z = A ? 0 : Z, V = k ? 0 : V;
148
148
  const H = o.getZoom(), w = Number(o.width ?? 0) / H, C = Number(o.height ?? 0) / H, E = Z + p > w, _ = V + N > C;
149
149
  p = E ? p - (Z + p - w) : p, N = _ ? N - (V + N - C) : N;
150
- const A = p && N ? new a({
150
+ const D = p && N ? new a({
151
151
  left: Z,
152
152
  top: V,
153
153
  width: p,
@@ -157,7 +157,7 @@ const Q = () => Xe, Rt = (e) => {
157
157
  stroke: e,
158
158
  strokeWidth: s ? kn : Nn,
159
159
  erasable: !1,
160
- info: s ? bt : Fe,
160
+ info: s ? pt : Fe,
161
161
  ...s ? {
162
162
  strokeDashArray: [7, 5],
163
163
  lockMovementX: !0,
@@ -165,106 +165,106 @@ const Q = () => Xe, Rt = (e) => {
165
165
  } : {}
166
166
  } : {
167
167
  fill: e,
168
- info: It
168
+ info: Nt
169
169
  },
170
170
  objectCaching: !1,
171
171
  selectable: !1
172
172
  }) : null;
173
- if (s && !A && t && t({
174
- point: { x: v, y: g, maskInput: Sn }
175
- }), s && A && t) {
173
+ if (s && !D && t && t({
174
+ point: { x: v, y: f, maskInput: Sn }
175
+ }), s && D && t) {
176
176
  const O = Number(Z ?? 0), y = Number(V ?? 0), B = O + p, R = y + N;
177
177
  t({ box: { x1: O, y1: y, x2: B, y2: R } });
178
178
  }
179
- A && o.add(A);
180
- }, u = function(r) {
181
- r.preventDefault();
182
- const { x: m, y: v } = st({ x: r.offsetX, y: r.offsetY });
183
- r.target && r.target.localName === "canvas" && t && t({
179
+ D && o.add(D);
180
+ }, d = function(c) {
181
+ c.preventDefault();
182
+ const { x: m, y: v } = ot({ x: c.offsetX, y: c.offsetY });
183
+ c.target && c.target.localName === "canvas" && t && t({
184
184
  point: { x: m, y: v, maskInput: Mn }
185
185
  });
186
186
  };
187
- return o.defaultCursor = "crosshair", o.hoverCursor = s ? "crosshair" : "default", o.selection = !0, o.on("mouse:down", I(l)), o.on("mouse:up", I(h)), s && document.addEventListener("contextmenu", u), () => {
188
- o.defaultCursor = "default", o.selection = !1, o.off("mouse:down", I(l)), o.off("mouse:up", I(h)), s && (document.removeEventListener("contextmenu", u), o.remove(
189
- ...we(o).filter(
190
- ({ info: r }) => r === bt
187
+ return o.defaultCursor = "crosshair", o.hoverCursor = s ? "crosshair" : "default", o.selection = !0, o.on("mouse:down", I(l)), o.on("mouse:up", I(g)), s && document.addEventListener("contextmenu", d), () => {
188
+ o.defaultCursor = "default", o.selection = !1, o.off("mouse:down", I(l)), o.off("mouse:up", I(g)), s && (document.removeEventListener("contextmenu", d), o.remove(
189
+ ...Se(o).filter(
190
+ ({ info: c }) => c === pt
191
191
  )
192
- ), we(o).forEach(
193
- (r) => r.set({ visible: !0 })
194
- )), Ne(o);
192
+ ), Se(o).forEach(
193
+ (c) => c.set({ visible: !0 })
194
+ )), ke(o);
195
195
  };
196
- }, Qt = () => ({ id: "brush", init: ({ brush: t, colorCode: n }) => {
196
+ }, en = () => ({ id: "brush", init: ({ brush: t, colorCode: n }) => {
197
197
  const s = pe(), o = Tn();
198
198
  s.isDrawingMode = !0, s.freeDrawingBrush = new o(s), s.freeDrawingBrush.color = n, s.freeDrawingBrush.strokeLineCap = t.lineCap, s.freeDrawingBrush.width = t.lineWidth;
199
- const { brushCursor: a, handleOnMouseMove: i, handleOnMouseUp: c } = kt(t, n), l = function() {
199
+ const { brushCursor: a, handleOnMouseMove: r, handleOnMouseUp: i } = Ot(t, n), l = function() {
200
200
  s.add(a);
201
- }, h = function() {
201
+ }, g = function() {
202
202
  s.remove(a);
203
203
  };
204
- return s.add(a), s.on("mouse:over", I(l)), s.on("mouse:out", I(h)), s.on("mouse:move", I(i)), s.on("mouse:up", I(c)), () => {
205
- s.remove(a), s.off("mouse:over", I(l)), s.off("mouse:out", I(h)), s.off("mouse:move", I(i)), s.off("mouse:up", I(c)), s.isDrawingMode = !1;
204
+ return s.add(a), s.on("mouse:over", I(l)), s.on("mouse:out", I(g)), s.on("mouse:move", I(r)), s.on("mouse:up", I(i)), () => {
205
+ s.remove(a), s.off("mouse:over", I(l)), s.off("mouse:out", I(g)), s.off("mouse:move", I(r)), s.off("mouse:up", I(i)), s.isDrawingMode = !1;
206
206
  };
207
- } }), en = () => ({ id: "eraser", init: async ({ brush: t }) => {
207
+ } }), tn = () => ({ id: "eraser", init: async ({ brush: t }) => {
208
208
  const n = pe(), { EraserBrush: s } = await import("./index-DDn_Fjhx.js");
209
209
  n.freeDrawingBrush = new s(n), n.isDrawingMode = !0, n.freeDrawingBrush.strokeLineCap = t.lineCap, n.freeDrawingBrush.width = t.lineWidth;
210
- const { brushCursor: o, handleOnMouseMove: a, handleOnMouseUp: i } = kt(t), c = function() {
210
+ const { brushCursor: o, handleOnMouseMove: a, handleOnMouseUp: r } = Ot(t), i = function() {
211
211
  n.add(o);
212
212
  }, l = function() {
213
213
  n.remove(o);
214
214
  };
215
- return n.add(o), n.on("mouse:over", I(c)), n.on("mouse:out", I(l)), n.on("mouse:move", I(a)), n.on("mouse:up", I(i)), () => {
216
- n.remove(o), n.off("mouse:over", I(c)), n.off("mouse:out", I(l)), n.off("mouse:move", I(a)), n.off("mouse:up", I(i)), n.isDrawingMode = !1;
215
+ return n.add(o), n.on("mouse:over", I(i)), n.on("mouse:out", I(l)), n.on("mouse:move", I(a)), n.on("mouse:up", I(r)), () => {
216
+ n.remove(o), n.off("mouse:over", I(i)), n.off("mouse:out", I(l)), n.off("mouse:move", I(a)), n.off("mouse:up", I(r)), n.isDrawingMode = !1;
217
217
  };
218
- } }), At = (e, t, n = 0) => {
218
+ } }), Ht = (e, t, n = 0) => {
219
219
  const s = 10 ** n;
220
220
  return Math.round(e * t * s) / s;
221
- }, tn = (e, t) => {
221
+ }, nn = (e, t) => {
222
222
  e = e.includes("#") ? e.substring(1) : e;
223
223
  const n = parseInt(e, 16), s = n >> 16 & 255, o = n >> 8 & 255, a = n & 255;
224
224
  return `rgba(${s},${o},${a},${t})`;
225
- }, Pt = (e) => {
225
+ }, Tt = (e) => {
226
226
  const t = e.substring(5);
227
227
  return t.substring(0, t.length - 1).split(",").map((s) => +s);
228
- }, Be = (e) => Math.round(e).toString(16).padStart(2, "0"), Yn = (e) => {
228
+ }, Ee = (e) => Math.round(e).toString(16).padStart(2, "0"), Yn = (e) => {
229
229
  let t = e.startsWith("#") ? e.substring(1) : e;
230
230
  (t.length === 3 || t.length === 4) && (t = t.split("").map((l) => l + l).join(""));
231
231
  const n = t.length === 8;
232
232
  if (t.length !== 6 && !n)
233
233
  return null;
234
- const s = parseInt(t.substring(0, 6), 16), o = s >> 16 & 255, a = s >> 8 & 255, i = s & 255, c = n ? parseInt(t.substring(6), 16) / 255 : 1;
235
- return { r: o, g: a, b: i, a: c };
236
- }, ct = (e) => {
234
+ const s = parseInt(t.substring(0, 6), 16), o = s >> 16 & 255, a = s >> 8 & 255, r = s & 255, i = n ? parseInt(t.substring(6), 16) / 255 : 1;
235
+ return { r: o, g: a, b: r, a: i };
236
+ }, it = (e) => {
237
237
  const t = { hex: "000000", alpha: "100%" };
238
238
  if (!e)
239
239
  return t;
240
240
  const n = e.trim();
241
241
  if (n.startsWith("rgba(")) {
242
- const [o, a, i, c] = Pt(n);
242
+ const [o, a, r, i] = Tt(n);
243
243
  return {
244
- hex: `${Be(o)}${Be(a)}${Be(i)}`,
245
- alpha: `${At(c, 100, 0)}%`
244
+ hex: `${Ee(o)}${Ee(a)}${Ee(r)}`,
245
+ alpha: `${Ht(i, 100, 0)}%`
246
246
  };
247
247
  }
248
248
  if (n.startsWith("rgb(")) {
249
- const o = n.substring(4, n.length - 1).split(",").map((l) => +l), [a = 0, i = 0, c = 0] = o;
249
+ const o = n.substring(4, n.length - 1).split(",").map((l) => +l), [a = 0, r = 0, i = 0] = o;
250
250
  return {
251
- hex: `${Be(a)}${Be(i)}${Be(c)}`,
251
+ hex: `${Ee(a)}${Ee(r)}${Ee(i)}`,
252
252
  alpha: "100%"
253
253
  };
254
254
  }
255
255
  const s = Yn(n);
256
256
  if (s) {
257
- const { r: o, g: a, b: i, a: c } = s;
257
+ const { r: o, g: a, b: r, a: i } = s;
258
258
  return {
259
- hex: `${Be(o)}${Be(a)}${Be(i)}`,
260
- alpha: `${At(c, 100, 0)}%`
259
+ hex: `${Ee(o)}${Ee(a)}${Ee(r)}`,
260
+ alpha: `${Ht(i, 100, 0)}%`
261
261
  };
262
262
  }
263
263
  return t;
264
264
  }, qa = (e) => {
265
- const [t, n, s, o] = Pt(e), a = Math.round(t).toString(16).padStart(2, "0"), i = Math.round(n).toString(16).padStart(2, "0"), c = Math.round(s).toString(16).padStart(2, "0"), l = Math.round(o * 255).toString(16).padStart(2, "0");
266
- return `#${a}${i}${c}${l}`;
267
- }, nn = (e) => new Promise((t) => {
265
+ const [t, n, s, o] = Tt(e), a = Math.round(t).toString(16).padStart(2, "0"), r = Math.round(n).toString(16).padStart(2, "0"), i = Math.round(s).toString(16).padStart(2, "0"), l = Math.round(o * 255).toString(16).padStart(2, "0");
266
+ return `#${a}${r}${i}${l}`;
267
+ }, on = (e) => new Promise((t) => {
268
268
  const n = new Image();
269
269
  n.src = e, n.setAttribute("crossOrigin", ""), n.onload = () => t(n);
270
270
  }), Ka = (e, t) => {
@@ -273,31 +273,31 @@ const Q = () => Xe, Rt = (e) => {
273
273
  s === 0 && o === 0 && a === 0 ? e.data[n + 3] = 0 : t && (e.data[n + 3] = Math.round(255 * t * 100) / 100);
274
274
  }
275
275
  return e;
276
- }, on = (e) => {
277
- const t = (r) => {
278
- const m = r.data;
279
- let v = r.width, g = r.height, b = 0, f = 0;
280
- for (let p = 0; p < r.height; p += 1)
281
- for (let N = 0; N < r.width; N += 1) {
282
- const Z = (p * r.width + N) * 4;
283
- m[Z + 3] > 0 && (v = Math.min(v, N), g = Math.min(g, p), b = Math.max(b, N), f = Math.max(f, p));
276
+ }, sn = (e) => {
277
+ const t = (c) => {
278
+ const m = c.data;
279
+ let v = c.width, f = c.height, b = 0, h = 0;
280
+ for (let p = 0; p < c.height; p += 1)
281
+ for (let N = 0; N < c.width; N += 1) {
282
+ const Z = (p * c.width + N) * 4;
283
+ m[Z + 3] > 0 && (v = Math.min(v, N), f = Math.min(f, p), b = Math.max(b, N), h = Math.max(h, p));
284
284
  }
285
- return { minX: v, minY: g, maxX: b, maxY: f };
285
+ return { minX: v, minY: f, maxX: b, maxY: h };
286
286
  }, n = document.createElement("canvas"), s = n.getContext("2d");
287
287
  if (!s)
288
288
  return { canvas: n, minX: 0, minY: 0 };
289
- const { minX: o, minY: a, maxX: i, maxY: c } = t(e), l = i - o + 1, h = c - a + 1, u = s.createImageData(l, h);
290
- for (let r = 0; r < h; r += 1)
289
+ const { minX: o, minY: a, maxX: r, maxY: i } = t(e), l = r - o + 1, g = i - a + 1, d = s.createImageData(l, g);
290
+ for (let c = 0; c < g; c += 1)
291
291
  for (let m = 0; m < l; m += 1) {
292
- const v = ((a + r) * e.width + o + m) * 4, g = (r * l + m) * 4;
293
- u.data[g] = e.data[v], u.data[g + 1] = e.data[v + 1], u.data[g + 2] = e.data[v + 2], u.data[g + 3] = e.data[v + 3];
292
+ const v = ((a + c) * e.width + o + m) * 4, f = (c * l + m) * 4;
293
+ d.data[f] = e.data[v], d.data[f + 1] = e.data[v + 1], d.data[f + 2] = e.data[v + 2], d.data[f + 3] = e.data[v + 3];
294
294
  }
295
- return n.width = l, n.height = h, s.putImageData(u, 0, 0), { canvas: n, minX: o, minY: a };
295
+ return n.width = l, n.height = g, s.putImageData(d, 0, 0), { canvas: n, minX: o, minY: a };
296
296
  };
297
297
  let Ve = null;
298
298
  const Ja = (e) => {
299
299
  Ve = e;
300
- }, yt = () => ({ id: "magic-wand", init: async ({
300
+ }, bt = () => ({ id: "magic-wand", init: async ({
301
301
  src: t,
302
302
  colorCode: n,
303
303
  brush: s,
@@ -309,19 +309,19 @@ const Ja = (e) => {
309
309
  );
310
310
  return;
311
311
  }
312
- const a = pe(), i = Kt(), c = ke(), l = oe(), h = () => {
312
+ const a = pe(), r = Jt(), i = Oe(), l = oe(), g = () => {
313
313
  a.contextContainer && a.renderAll();
314
314
  };
315
315
  a.defaultCursor = "crosshair", a.hoverCursor = "crosshair";
316
- const { threshold: u, radius: r } = o;
316
+ const { threshold: d, radius: c } = o;
317
317
  let m = null, v = null;
318
- const g = await nn(t), { width: b, height: f } = g, p = document.createElement("canvas").getContext("2d");
318
+ const f = await on(t), { width: b, height: h } = f, p = document.createElement("canvas").getContext("2d");
319
319
  if (!p)
320
320
  return;
321
- p.canvas.width = b, p.canvas.height = f, p.drawImage(g, 0, 0), m = p.getImageData(0, 0, b, f);
321
+ p.canvas.width = b, p.canvas.height = h, p.drawImage(f, 0, 0), m = p.getImageData(0, 0, b, h);
322
322
  const N = ({ x: y, y: B }) => ({
323
323
  x: Math.min(Math.max(Math.round(y), 0), b - 1),
324
- y: Math.min(Math.max(Math.round(B), 0), f - 1)
324
+ y: Math.min(Math.max(Math.round(B), 0), h - 1)
325
325
  }), Z = async (y) => {
326
326
  const B = y.getElement(), R = document.createElement("canvas").getContext("2d");
327
327
  if (!B || !R)
@@ -343,32 +343,32 @@ const Ja = (e) => {
343
343
  ({ points: F }) => F.length
344
344
  );
345
345
  if (!se.length) return null;
346
- const de = y.scaleX ?? 1, Me = y.scaleY ?? 1, Oe = y.left ?? 0, ue = y.top ?? 0;
346
+ const de = y.scaleX ?? 1, Ie = y.scaleY ?? 1, Pe = y.left ?? 0, ue = y.top ?? 0;
347
347
  let te = 1 / 0, W = 1 / 0;
348
348
  const be = se.map((F) => {
349
349
  const ne = F.points.map(({ x: ye, y: X }) => {
350
- const K = ye * de, Te = X * Me;
351
- return te = Math.min(te, K), W = Math.min(W, Te), new c(K, Te);
350
+ const K = ye * de, Be = X * Ie;
351
+ return te = Math.min(te, K), W = Math.min(W, Be), new i(K, Be);
352
352
  });
353
353
  return { inner: F.inner, points: ne };
354
354
  });
355
355
  if (!Number.isFinite(te) || !Number.isFinite(W)) return null;
356
- const me = { x: te, y: W }, Ie = be.map((F) => ({
356
+ const me = { x: te, y: W }, Ne = be.map((F) => ({
357
357
  inner: F.inner,
358
358
  points: F.points.map(
359
- ({ x: ne, y: ye }) => new c(ne - me.x, ye - me.y)
359
+ ({ x: ne, y: ye }) => new i(ne - me.x, ye - me.y)
360
360
  )
361
- })).sort((F, ne) => Number(F.inner) - Number(ne.inner)), je = Ie.findIndex(
361
+ })).sort((F, ne) => Number(F.inner) - Number(ne.inner)), Je = Ne.findIndex(
362
362
  ({ inner: F }) => !F
363
- ), Re = je >= 0 ? je : 0, Pe = Ie[Re] ?? Ie[0], Qe = (Pe == null ? void 0 : Pe.points.map(({ x: F, y: ne }) => new c(F, ne))) ?? [], De = [];
364
- return Ie.forEach(({ points: F }) => {
363
+ ), Re = Je >= 0 ? Je : 0, Te = Ne[Re] ?? Ne[0], je = (Te == null ? void 0 : Te.points.map(({ x: F, y: ne }) => new i(F, ne))) ?? [], Ae = [];
364
+ return Ne.forEach(({ points: F }) => {
365
365
  if (!F.length) return;
366
366
  const [ne, ...ye] = F;
367
- De.push(`M ${ne.x} ${ne.y}`), ye.forEach(({ x: X, y: K }) => {
368
- De.push(`L ${X} ${K}`);
369
- }), De.push("Z");
370
- }), new l.Path(De.join(" "), {
371
- left: Oe + me.x,
367
+ Ae.push(`M ${ne.x} ${ne.y}`), ye.forEach(({ x: X, y: K }) => {
368
+ Ae.push(`L ${X} ${K}`);
369
+ }), Ae.push("Z");
370
+ }), new l.Path(Ae.join(" "), {
371
+ left: Pe + me.x,
372
372
  top: ue + me.y,
373
373
  originX: "left",
374
374
  originY: "top",
@@ -376,12 +376,12 @@ const Ja = (e) => {
376
376
  selectable: !1,
377
377
  evented: !0,
378
378
  fillRule: "evenodd",
379
- pathOffset: new c(0, 0),
380
- points: Qe,
381
- pathContours: Ie,
379
+ pathOffset: new i(0, 0),
380
+ points: je,
381
+ pathContours: Ne,
382
382
  pathBaseOffset: me,
383
383
  pathEditableContourIndex: Re,
384
- info: y.info ?? Ct,
384
+ info: y.info ?? vt,
385
385
  fill: y.fill,
386
386
  hex: y.hex,
387
387
  alpha: y.alpha,
@@ -403,9 +403,9 @@ const Ja = (e) => {
403
403
  height: m.height,
404
404
  bytes: 4
405
405
  }, { x: B, y: R } = v;
406
- let x = Ve.floodFill(y, B, R, u);
407
- x = Ve.gaussBlurOnlyBorder(x, r), D(x, n);
408
- }, D = (y, B) => {
406
+ let x = Ve.floodFill(y, B, R, d);
407
+ x = Ve.gaussBlurOnlyBorder(x, c), A(x, n);
408
+ }, A = (y, B) => {
409
409
  if (!m) return;
410
410
  const x = ((ue) => {
411
411
  const te = ue.substring(5), be = te.substring(0, te.length - 1).split(",").map((me) => +me);
@@ -421,22 +421,22 @@ const Ja = (e) => {
421
421
  se[W] = x[0], se[W + 1] = x[1], se[W + 2] = x[2], se[W + 3] = x[3];
422
422
  }
423
423
  P.remove();
424
- const { canvas: de, minX: Me, minY: Oe } = on(q);
425
- k(de, Me, Oe);
424
+ const { canvas: de, minX: Ie, minY: Pe } = sn(q);
425
+ k(de, Ie, Pe);
426
426
  }, k = async (y, B, R) => {
427
427
  if (!v) return;
428
428
  const x = B, P = R, T = y.toDataURL();
429
429
  y.remove();
430
- const L = await i.fromURL(T, {}, {
430
+ const L = await r.fromURL(T, {}, {
431
431
  left: x,
432
432
  top: P,
433
433
  objectCaching: !1,
434
434
  selectable: !1,
435
- info: Ct,
435
+ info: vt,
436
436
  fill: n,
437
437
  lockMovementX: !0,
438
438
  lockMovementY: !0
439
- }), { hex: M, alpha: Y } = ct(n);
439
+ }), { hex: M, alpha: Y } = it(n);
440
440
  L.set({
441
441
  hex: M,
442
442
  alpha: Y,
@@ -454,44 +454,44 @@ const Ja = (e) => {
454
454
  }
455
455
  }, H = function(y) {
456
456
  const B = y.e;
457
- (B == null ? void 0 : B.button) === 0 && (v = N(jt(B)), V());
457
+ (B == null ? void 0 : B.button) === 0 && (v = N(Qt(B)), V());
458
458
  }, {
459
459
  brushCursor: w,
460
460
  handleOnMouseMove: C,
461
461
  handleOnMouseUp: E
462
- } = kt({ ...s, lineCap: "square" }), _ = () => {
462
+ } = Ot({ ...s, lineCap: "square" }), _ = () => {
463
463
  E();
464
- }, A = function() {
464
+ }, D = function() {
465
465
  a.add(w);
466
466
  }, O = function() {
467
467
  a.remove(w);
468
468
  };
469
- return a.add(w), a.on("mouse:over", I(A)), a.on("mouse:out", I(O)), a.on("mouse:down", I(H)), a.on("mouse:move", I(C)), a.on("mouse:up", I(_)), () => {
470
- a.remove(w), h(), a.off("mouse:over", I(A)), a.off("mouse:out", I(O)), a.off("mouse:down", I(H)), a.off("mouse:move", I(C)), a.off("mouse:up", I(_));
469
+ return a.add(w), a.on("mouse:over", I(D)), a.on("mouse:out", I(O)), a.on("mouse:down", I(H)), a.on("mouse:move", I(C)), a.on("mouse:up", I(_)), () => {
470
+ a.remove(w), g(), a.off("mouse:over", I(D)), a.off("mouse:out", I(O)), a.off("mouse:down", I(H)), a.off("mouse:move", I(C)), a.off("mouse:up", I(_));
471
471
  };
472
- } }), sn = () => ({ id: "pen", init: ({ colorCode: t }) => {
473
- const n = pe(), s = ke(), o = qt(), a = Pn();
474
- let i = [], c = [], l = !1;
475
- const h = function(g, b) {
476
- if (!c.length)
472
+ } }), an = () => ({ id: "pen", init: ({ colorCode: t }) => {
473
+ const n = pe(), s = Oe(), o = Kt(), a = Pn();
474
+ let r = [], i = [], l = !1;
475
+ const g = function(f, b) {
476
+ if (!i.length)
477
477
  return !1;
478
- const f = c[0];
479
- if (f.x1 === void 0 || f.y1 === void 0)
478
+ const h = i[0];
479
+ if (h.x1 === void 0 || h.y1 === void 0)
480
480
  return !1;
481
- const p = n.getScenePoint(g), N = f.x1 ?? 0, Z = f.y1 ?? 0, { x: V, y: D } = p;
482
- return Math.abs(N - V) <= b && Math.abs(Z - D) <= b;
483
- }, u = function(g) {
484
- g.preventDefault(), n.remove(...c), c = [];
485
- }, r = function(g) {
486
- const b = g.e;
487
- if (b && h(b, 10)) {
481
+ const p = n.getScenePoint(f), N = h.x1 ?? 0, Z = h.y1 ?? 0, { x: V, y: A } = p;
482
+ return Math.abs(N - V) <= b && Math.abs(Z - A) <= b;
483
+ }, d = function(f) {
484
+ f.preventDefault(), n.remove(...i), i = [];
485
+ }, c = function(f) {
486
+ const b = f.e;
487
+ if (b && g(b, 10)) {
488
488
  l = !0;
489
489
  return;
490
490
  }
491
- const f = n.getScenePoint(b), p = c.length ? c[c.length - 1] : null;
491
+ const h = n.getScenePoint(b), p = i.length ? i[i.length - 1] : null;
492
492
  if (!p || p.x2) {
493
493
  const N = new a(
494
- [f.x, f.y, f.x, f.y],
494
+ [h.x, h.y, h.x, h.y],
495
495
  {
496
496
  stroke: "red",
497
497
  strokeWidth: 2,
@@ -500,42 +500,42 @@ const Ja = (e) => {
500
500
  evented: !1
501
501
  }
502
502
  );
503
- N.replaced = !0, n.add(N), c.push(N);
503
+ N.replaced = !0, n.add(N), i.push(N);
504
504
  } else
505
- p.set({ x2: f.x, y2: f.y });
506
- i.push(new s(f.x, f.y));
507
- }, m = function(g) {
505
+ p.set({ x2: h.x, y2: h.y });
506
+ r.push(new s(h.x, h.y));
507
+ }, m = function(f) {
508
508
  if (l)
509
509
  return;
510
- const b = c.length ? c[c.length - 1] : null;
510
+ const b = i.length ? i[i.length - 1] : null;
511
511
  if (b) {
512
- const f = g.e;
513
- if (!f)
512
+ const h = f.e;
513
+ if (!h)
514
514
  return;
515
- const p = n.getScenePoint(f);
515
+ const p = n.getScenePoint(h);
516
516
  b.set({ x2: p.x, y2: p.y }), n.renderAll();
517
517
  }
518
518
  }, v = function() {
519
519
  if (l) {
520
- n.remove(...c);
521
- const g = new o(i, {
520
+ n.remove(...i);
521
+ const f = new o(r, {
522
522
  fill: t,
523
523
  objectCaching: !1,
524
524
  selectable: !1,
525
525
  evented: !0,
526
526
  info: wn
527
527
  });
528
- n.add(g), n.renderAll(), i = [], c = [], l = !1;
528
+ n.add(f), n.renderAll(), r = [], i = [], l = !1;
529
529
  }
530
530
  };
531
- return n.defaultCursor = "crosshair", document.addEventListener("contextmenu", u), n.on("mouse:down", I(r)), n.on("mouse:move", I(m)), n.on("mouse:up", I(v)), () => {
532
- document.removeEventListener("contextmenu", u), n.defaultCursor = "default", n.off("mouse:down", I(r)), n.off("mouse:move", I(m)), n.off("mouse:up", I(v)), n.remove(...c), c = [];
531
+ return n.defaultCursor = "crosshair", document.addEventListener("contextmenu", d), n.on("mouse:down", I(c)), n.on("mouse:move", I(m)), n.on("mouse:up", I(v)), () => {
532
+ document.removeEventListener("contextmenu", d), n.defaultCursor = "default", n.off("mouse:down", I(c)), n.off("mouse:move", I(m)), n.off("mouse:up", I(v)), n.remove(...i), i = [];
533
533
  };
534
534
  } }), zn = (e) => {
535
535
  if (!e)
536
536
  return !1;
537
- const t = qt(), n = oe();
538
- return !!(e instanceof t || e instanceof n.Path && [_e, Ct].includes(
537
+ const t = Kt(), n = oe();
538
+ return !!(e instanceof t || e instanceof n.Path && [_e, vt].includes(
539
539
  e.info ?? ""
540
540
  ) && Array.isArray(e.points) && Array.isArray(e.pathContours));
541
541
  }, Fn = (e) => {
@@ -545,23 +545,23 @@ const Ja = (e) => {
545
545
  const n = e, s = n.pathContours, o = n.pathEditableContourIndex ?? 0;
546
546
  if (!s[o])
547
547
  return;
548
- const a = ke();
548
+ const a = Oe();
549
549
  s[o].points = n.points.map(
550
- ({ x: l, y: h }) => new a(l, h)
550
+ ({ x: l, y: g }) => new a(l, g)
551
551
  );
552
- const i = [];
552
+ const r = [];
553
553
  s.forEach(({ points: l }) => {
554
554
  if (!l.length)
555
555
  return;
556
- const [h, ...u] = l;
557
- i.push(`M ${h.x} ${h.y}`), u.forEach(({ x: r, y: m }) => {
558
- i.push(`L ${r} ${m}`);
559
- }), i.push("Z");
556
+ const [g, ...d] = l;
557
+ r.push(`M ${g.x} ${g.y}`), d.forEach(({ x: c, y: m }) => {
558
+ r.push(`L ${c} ${m}`);
559
+ }), r.push("Z");
560
560
  });
561
- const c = new t.Path(i.join(" "));
562
- n.set({ path: c.path }), n.pathContours = s, n.dirty = !0, n.setCoords();
563
- }, an = (e) => {
564
- const t = ke(), n = e.strokeWidth ?? 0, s = (e.strokeUniform ? 1 / (e.scaleX ?? 1) : 1) * n, o = (e.strokeUniform ? 1 / (e.scaleY ?? 1) : 1) * n;
561
+ const i = new t.Path(r.join(" "));
562
+ n.set({ path: i.path }), n.pathContours = s, n.dirty = !0, n.setCoords();
563
+ }, cn = (e) => {
564
+ const t = Oe(), n = e.strokeWidth ?? 0, s = (e.strokeUniform ? 1 / (e.scaleX ?? 1) : 1) * n, o = (e.strokeUniform ? 1 / (e.scaleY ?? 1) : 1) * n;
565
565
  return new t(
566
566
  Math.max((e.width ?? 0) + s, 1),
567
567
  Math.max((e.height ?? 0) + o, 1)
@@ -572,8 +572,8 @@ const Ja = (e) => {
572
572
  }, $n = (e, t) => {
573
573
  let n = !1;
574
574
  for (let s = 0, o = t.length - 1; s < t.length; o = s++) {
575
- const a = t[s].x, i = t[s].y, c = t[o].x, l = t[o].y;
576
- i > e.y != l > e.y && e.x < (c - a) * (e.y - i) / (l - i + Number.EPSILON) + a && (n = !n);
575
+ const a = t[s].x, r = t[s].y, i = t[o].x, l = t[o].y;
576
+ r > e.y != l > e.y && e.x < (i - a) * (e.y - r) / (l - r + Number.EPSILON) + a && (n = !n);
577
577
  }
578
578
  return n;
579
579
  }, Gn = (e) => {
@@ -581,71 +581,71 @@ const Ja = (e) => {
581
581
  return 0;
582
582
  let t = 0;
583
583
  for (let n = 0; n < e.length; n += 1) {
584
- const { x: s, y: o } = e[n], { x: a, y: i } = e[(n + 1) % e.length];
585
- t += s * i - a * o;
584
+ const { x: s, y: o } = e[n], { x: a, y: r } = e[(n + 1) % e.length];
585
+ t += s * r - a * o;
586
586
  }
587
587
  return Math.abs(t / 2);
588
588
  }, qn = function(e, t, n) {
589
589
  var l;
590
- const s = ke(), o = oe().util, a = n.points[this.pointIndex ?? 0], i = a.x - n.pathOffset.x, c = a.y - n.pathOffset.y;
590
+ const s = Oe(), o = oe().util, a = n.points[this.pointIndex ?? 0], r = a.x - n.pathOffset.x, i = a.y - n.pathOffset.y;
591
591
  return o.transformPoint(
592
- new s(i, c),
592
+ new s(r, i),
593
593
  o.multiplyTransformMatrices(
594
594
  ((l = n.canvas) == null ? void 0 : l.viewportTransform) ?? [1, 0, 0, 1, 0, 0],
595
595
  n.calcTransformMatrix()
596
596
  )
597
597
  );
598
- }, cn = (e) => {
598
+ }, rn = (e) => {
599
599
  var a;
600
- const t = ke(), n = oe().util;
600
+ const t = Oe(), n = oe().util;
601
601
  if (!e.points || !e.pathOffset)
602
602
  return [];
603
603
  const s = e.calcTransformMatrix(), o = (a = e.canvas) != null && a.viewportTransform ? n.multiplyTransformMatrices(e.canvas.viewportTransform, s) : s;
604
604
  return e.points.map(
605
- (i) => n.transformPoint(
606
- new t(i.x - e.pathOffset.x, i.y - e.pathOffset.y),
605
+ (r) => n.transformPoint(
606
+ new t(r.x - e.pathOffset.x, r.y - e.pathOffset.y),
607
607
  o
608
608
  )
609
609
  );
610
610
  }, Kn = function(e, t, n, s) {
611
611
  var v;
612
- const o = ke(), a = oe(), i = t.target;
613
- if (!i || !i.points || !i.pathOffset)
612
+ const o = Oe(), a = oe(), r = t.target;
613
+ if (!r || !r.points || !r.pathOffset)
614
614
  return !1;
615
- const c = (v = i.controls) == null ? void 0 : v[i.__corner ?? ""];
616
- if (!c)
615
+ const i = (v = r.controls) == null ? void 0 : v[r.__corner ?? ""];
616
+ if (!i)
617
617
  return !1;
618
- const l = c.pointIndex ?? 0, h = i.toLocalPoint(
618
+ const l = i.pointIndex ?? 0, g = r.toLocalPoint(
619
619
  new o(n, s),
620
620
  "center",
621
621
  "center"
622
- ), u = an(i), r = i._getTransformedDimensions(0, 0), m = {
623
- x: h.x * u.x / r.x + i.pathOffset.x,
624
- y: h.y * u.y / r.y + i.pathOffset.y
622
+ ), d = cn(r), c = r._getTransformedDimensions(0, 0), m = {
623
+ x: g.x * d.x / c.x + r.pathOffset.x,
624
+ y: g.y * d.y / c.y + r.pathOffset.y
625
625
  };
626
- return i.points[l] = m, i instanceof a.Path && Fn(i), !0;
626
+ return r.points[l] = m, r instanceof a.Path && Fn(r), !0;
627
627
  }, Jn = function(e, t) {
628
628
  return function(n, s, o, a) {
629
629
  var Z;
630
- const i = ke(), c = s.target;
631
- if (!c.points || !c.pathOffset)
630
+ const r = Oe(), i = s.target;
631
+ if (!i.points || !i.pathOffset)
632
632
  return !1;
633
- const l = c.controls, h = typeof c.__corner == "string" ? c.__corner : "", u = l == null ? void 0 : l[h], r = (u == null ? void 0 : u.pointIndex) ?? e, v = oe().util.transformPoint(
634
- new i(
635
- c.points[e].x - c.pathOffset.x,
636
- c.points[e].y - c.pathOffset.y
633
+ const l = i.controls, g = typeof i.__corner == "string" ? i.__corner : "", d = l == null ? void 0 : l[g], c = (d == null ? void 0 : d.pointIndex) ?? e, v = oe().util.transformPoint(
634
+ new r(
635
+ i.points[e].x - i.pathOffset.x,
636
+ i.points[e].y - i.pathOffset.y
637
637
  ),
638
- c.calcTransformMatrix()
639
- ), g = t(n, s, o, a), b = an(c), f = (c.points[e].x - c.pathOffset.x) / b.x, p = (c.points[e].y - c.pathOffset.y) / b.y;
640
- Xn(c), c.setPositionByOrigin(
638
+ i.calcTransformMatrix()
639
+ ), f = t(n, s, o, a), b = cn(i), h = (i.points[e].x - i.pathOffset.x) / b.x, p = (i.points[e].y - i.pathOffset.y) / b.y;
640
+ Xn(i), i.setPositionByOrigin(
641
641
  v,
642
- f + 0.5,
642
+ h + 0.5,
643
643
  p + 0.5
644
644
  );
645
- const N = c.editSnapshot;
645
+ const N = i.editSnapshot;
646
646
  if ((Z = N == null ? void 0 : N.absolutePoints) != null && Z.length) {
647
- const D = cn(c).map((k, H) => {
648
- if (H === r)
647
+ const A = rn(i).map((k, H) => {
648
+ if (H === c)
649
649
  return null;
650
650
  const w = N.absolutePoints[H];
651
651
  return w ? {
@@ -655,19 +655,19 @@ const Ja = (e) => {
655
655
  }).filter(
656
656
  (k) => k !== null
657
657
  );
658
- if (D.length) {
659
- const k = D.reduce((w, { dx: C }) => w + C, 0) / D.length, H = D.reduce((w, { dy: C }) => w + C, 0) / D.length;
660
- (k !== 0 || H !== 0) && (c.set({
661
- left: (c.left ?? 0) + k,
662
- top: (c.top ?? 0) + H
663
- }), c.setCoords());
658
+ if (A.length) {
659
+ const k = A.reduce((w, { dx: C }) => w + C, 0) / A.length, H = A.reduce((w, { dy: C }) => w + C, 0) / A.length;
660
+ (k !== 0 || H !== 0) && (i.set({
661
+ left: (i.left ?? 0) + k,
662
+ top: (i.top ?? 0) + H
663
+ }), i.setCoords());
664
664
  }
665
665
  }
666
- return g;
666
+ return f;
667
667
  };
668
668
  }, jn = (e, t) => {
669
- var h, u;
670
- const n = oe(), s = ke();
669
+ var g, d;
670
+ const n = oe(), s = Oe();
671
671
  if (!(e instanceof n.Path) || !Array.isArray(e.pathContours) || !t)
672
672
  return;
673
673
  const o = e.toLocalPoint(
@@ -675,93 +675,93 @@ const Ja = (e) => {
675
675
  "left",
676
676
  "top"
677
677
  ), a = e.pathContours.map(
678
- ({ points: r }, m) => ({
678
+ ({ points: c }, m) => ({
679
679
  index: m,
680
- inside: $n(o, r),
680
+ inside: $n(o, c),
681
681
  distance: Math.min(
682
- ...r.map(
682
+ ...c.map(
683
683
  (v) => Math.hypot(v.x - o.x, v.y - o.y)
684
684
  )
685
685
  ),
686
- area: Gn(r)
686
+ area: Gn(c)
687
687
  })
688
- ), c = ((h = a.filter(({ inside: r }) => r).sort((r, m) => r.area - m.area)[0]) == null ? void 0 : h.index) ?? ((u = a.sort((r, m) => r.distance - m.distance)[0]) == null ? void 0 : u.index) ?? 0;
689
- e.pathEditableContourIndex = c;
690
- const l = e.pathContours[c];
688
+ ), i = ((g = a.filter(({ inside: c }) => c).sort((c, m) => c.area - m.area)[0]) == null ? void 0 : g.index) ?? ((d = a.sort((c, m) => c.distance - m.distance)[0]) == null ? void 0 : d.index) ?? 0;
689
+ e.pathEditableContourIndex = i;
690
+ const l = e.pathContours[i];
691
691
  l && (e.points = l.points.map(
692
- ({ x: r, y: m }) => new s(r, m)
692
+ ({ x: c, y: m }) => new s(c, m)
693
693
  ));
694
694
  }, Qn = (e) => {
695
695
  var s;
696
696
  const t = En(), n = (((s = e.points) == null ? void 0 : s.length) ?? 1) - 1;
697
697
  e.controls = (e.points ?? []).reduce(
698
- function(o, a, i) {
699
- const c = () => (e.editSnapshot = {
700
- dragIndex: i,
701
- absolutePoints: cn(e)
698
+ function(o, a, r) {
699
+ const i = () => (e.editSnapshot = {
700
+ dragIndex: r,
701
+ absolutePoints: rn(e)
702
702
  }, !1), l = () => (delete e.editSnapshot, !1);
703
- return o["p" + i] = new t({
703
+ return o["p" + r] = new t({
704
704
  positionHandler: qn,
705
705
  actionHandler: Jn(
706
- i > 0 ? i - 1 : n,
706
+ r > 0 ? r - 1 : n,
707
707
  Kn
708
708
  ),
709
709
  actionName: "editPolygon",
710
- pointIndex: i,
711
- mouseDownHandler: c,
710
+ pointIndex: r,
711
+ mouseDownHandler: i,
712
712
  mouseUpHandler: l
713
713
  }), o;
714
714
  },
715
715
  {}
716
716
  );
717
- }, rn = (e, t) => {
717
+ }, ln = (e, t) => {
718
718
  const n = t.passStack;
719
719
  t.passStack = !0, e.fire("object:modified", { target: t }), t.passStack = n;
720
720
  }, eo = (e, t, n) => {
721
721
  if (!t || !zn(t))
722
- return xt(e), null;
722
+ return yt(e), null;
723
723
  const s = t;
724
- return s.edit || (jn(s, n), s.edit = !0, s.cornerStyle = "circle", Qn(s), s.transparentCorners = !1, s.hasBorders = !1), xt(e, s), e.requestRenderAll(), rn(e, s), s;
725
- }, xt = (e, t) => {
724
+ return s.edit || (jn(s, n), s.edit = !0, s.cornerStyle = "circle", Qn(s), s.transparentCorners = !1, s.hasBorders = !1), yt(e, s), e.requestRenderAll(), ln(e, s), s;
725
+ }, yt = (e, t) => {
726
726
  const n = oe().FabricObject;
727
- we(e).forEach((s) => {
727
+ Se(e).forEach((s) => {
728
728
  if (!t || s !== t && t.edit) {
729
729
  const o = s, a = o.edit;
730
- o.edit = !1, o.cornerStyle = "rect", o.controls = n.prototype.controls, o.hasBorders = !0, o.transparentCorners = !0, delete o.editSnapshot, a && rn(e, o);
730
+ o.edit = !1, o.cornerStyle = "rect", o.controls = n.prototype.controls, o.hasBorders = !0, o.transparentCorners = !0, delete o.editSnapshot, a && ln(e, o);
731
731
  }
732
732
  }), e.requestRenderAll();
733
- }, ln = () => ({ id: "bounded-box", init: (t) => Ot(t, !0) }), to = () => ({ id: "filled-box", init: (t) => Ot(t, !1) }), no = () => ({ id: "seg-anything", init: ({ callback: t }) => Ot({ colorCode: "#13C0A4", callback: t }, !0, !0) }), Tt = () => ({ id: "selection", init: () => {
733
+ }, dn = () => ({ id: "bounded-box", init: (t) => Pt(t, !0) }), to = () => ({ id: "filled-box", init: (t) => Pt(t, !1) }), no = () => ({ id: "seg-anything", init: ({ callback: t }) => Pt({ colorCode: "#13C0A4", callback: t }, !0, !0) }), Bt = () => ({ id: "selection", init: () => {
734
734
  let t = !1, n = !1;
735
735
  const s = _n(), o = pe();
736
736
  o.defaultCursor = "default", o.hoverCursor = "default", o.moveCursor = "default", o.selection = !0;
737
- const a = we();
737
+ const a = Se();
738
738
  a.forEach((w) => {
739
739
  w.selectable = !0, w.evented = !0;
740
740
  });
741
- let i = null;
742
- const c = (w = !1) => {
743
- i && (xt(o), i = null, w && o.discardActiveObject(), Ne(o));
741
+ let r = null;
742
+ const i = (w = !1) => {
743
+ r && (yt(o), r = null, w && o.discardActiveObject(), ke(o));
744
744
  }, l = function(w) {
745
745
  const C = w.scenePoint ?? w.absolutePointer, E = w.target;
746
- i && E !== i && c(!E), C && (t = !0, s.x = C.x, s.y = C.y);
747
- }, h = function(w) {
746
+ r && E !== r && i(!E), C && (t = !0, s.x = C.x, s.y = C.y);
747
+ }, g = function(w) {
748
748
  t && a.forEach((C) => {
749
749
  C.info === Fe && (C.selectable = !1);
750
750
  });
751
- }, u = function(w) {
751
+ }, d = function(w) {
752
752
  const C = w.scenePoint ?? w.absolutePointer;
753
753
  C && (s.x = C.x - s.x, s.y = C.y - s.y), t = !1, a.forEach((E) => {
754
754
  E.info === Fe && (E.selectable = !n);
755
755
  });
756
- }, r = function({ target: w }) {
756
+ }, c = function({ target: w }) {
757
757
  }, m = function() {
758
758
  }, v = function(w) {
759
759
  if (w.key === "Escape" || w.code === "Escape") {
760
- c(!0);
760
+ i(!0);
761
761
  return;
762
762
  }
763
763
  n = w.shiftKey;
764
- }, g = function() {
764
+ }, f = function() {
765
765
  n = !1;
766
766
  }, b = function(w) {
767
767
  const C = w.scenePoint ?? w.absolutePointer, E = eo(
@@ -769,65 +769,65 @@ const Ja = (e) => {
769
769
  w.target ?? null,
770
770
  C
771
771
  );
772
- E && (i = E, o.setActiveObject(E));
773
- }, f = He(l), p = He(h), N = He(u), Z = He(r), V = He(m), D = He(b), k = () => {
774
- c();
772
+ E && (r = E, o.setActiveObject(E));
773
+ }, h = De(l), p = De(g), N = De(d), Z = De(c), V = De(m), A = De(b), k = () => {
774
+ i();
775
775
  };
776
- o.on("mouse:down", I(f)), o.on("mouse:move", I(p)), o.on("mouse:up", I(N)), o.on("mouse:over", I(Z)), o.on("mouse:out", I(V)), o.on("mouse:dblclick", I(D)), o.on("selection:cleared", k), document.addEventListener("keydown", v), document.addEventListener("keyup", g);
777
- const H = we(o).find(
778
- ({ info: w }) => w === it
776
+ o.on("mouse:down", I(h)), o.on("mouse:move", I(p)), o.on("mouse:up", I(N)), o.on("mouse:over", I(Z)), o.on("mouse:out", I(V)), o.on("mouse:dblclick", I(A)), o.on("selection:cleared", k), document.addEventListener("keydown", v), document.addEventListener("keyup", f);
777
+ const H = Se(o).find(
778
+ ({ info: w }) => w === at
779
779
  );
780
- return H && (o.remove(H), Ne(o)), () => {
781
- c(), o.defaultCursor = "default", o.hoverCursor = "default", o.moveCursor = "default", o.selection = !1, o.discardActiveObject(), Ne(o), o.off("mouse:down", I(f)), o.off("mouse:move", I(p)), o.off("mouse:up", I(N)), o.off("mouse:over", I(Z)), o.off("mouse:out", I(V)), o.off("mouse:dblclick", I(D)), o.off("selection:cleared", k), document.removeEventListener("keydown", v), document.removeEventListener("keyup", g), a.forEach((w) => {
780
+ return H && (o.remove(H), ke(o)), () => {
781
+ i(), o.defaultCursor = "default", o.hoverCursor = "default", o.moveCursor = "default", o.selection = !1, o.discardActiveObject(), ke(o), o.off("mouse:down", I(h)), o.off("mouse:move", I(p)), o.off("mouse:up", I(N)), o.off("mouse:over", I(Z)), o.off("mouse:out", I(V)), o.off("mouse:dblclick", I(A)), o.off("selection:cleared", k), document.removeEventListener("keydown", v), document.removeEventListener("keyup", f), a.forEach((w) => {
782
782
  w.selectable = !1, w.evented = !1;
783
783
  });
784
784
  };
785
785
  } });
786
- let Lt = null, at = null;
786
+ let xt = null, st = null;
787
787
  const ja = (e) => {
788
- Lt = e.SLIC, at = e.MagicBrush;
789
- }, dn = () => ({ id: "superpixel", init: async ({
788
+ xt = e.SLIC, st = e.MagicBrush;
789
+ }, un = () => ({ id: "superpixel", init: async ({
790
790
  src: t,
791
791
  colorCode: n,
792
792
  superpixelConfig: s,
793
793
  previousTool: o
794
794
  }) => {
795
- if (!Lt || !at) {
795
+ if (!xt || !st) {
796
796
  console.warn(
797
797
  "[@ez-planet/labeling-canvas] SLIC/MagicBrush modules not provided. Call setSuperpixelModules() first."
798
798
  );
799
799
  return;
800
800
  }
801
- const a = pe(), i = Kt(), c = ke(), l = oe();
801
+ const a = pe(), r = Jt(), i = Oe(), l = oe();
802
802
  a.defaultCursor = "crosshair", a.hoverCursor = "crosshair";
803
- const h = !o || o.id !== "superpixel", u = await nn(t), { width: r, height: m } = u, v = we(a).filter(({ info: x }) => x === _e).pop(), g = (v == null ? void 0 : v.index) ?? 0, b = h ? g + 1 : g, f = document.createElement("canvas").getContext("2d");
804
- if (!f) return;
805
- f.canvas.width = r, f.canvas.height = m;
803
+ const g = !o || o.id !== "superpixel", d = await on(t), { width: c, height: m } = d, v = Se(a).filter(({ info: x }) => x === _e).pop(), f = (v == null ? void 0 : v.index) ?? 0, b = g ? f + 1 : f, h = document.createElement("canvas").getContext("2d");
804
+ if (!h) return;
805
+ h.canvas.width = c, h.canvas.height = m;
806
806
  const p = document.createElement("canvas").getContext("2d");
807
807
  if (!p) return;
808
- p.canvas.width = r, p.canvas.height = m;
808
+ p.canvas.width = c, p.canvas.height = m;
809
809
  const N = document.createElement("canvas").getContext("2d");
810
810
  if (!N) return;
811
- N.canvas.width = r, N.canvas.height = m, f.drawImage(u, 0, 0);
812
- const Z = f.getImageData(0, 0, r, m), V = new Lt(Z, s), D = V.result;
813
- V.createPixelIndex(D), p.putImageData(D, 0, 0);
814
- const k = p.getImageData(0, 0, r, m);
815
- V.computeEdgemap(k), f.clearRect(0, 0, r, m), f.putImageData(k, 0, 0);
816
- const H = f.canvas.toDataURL();
817
- f.canvas.remove();
811
+ N.canvas.width = c, N.canvas.height = m, h.drawImage(d, 0, 0);
812
+ const Z = h.getImageData(0, 0, c, m), V = new xt(Z, s), A = V.result;
813
+ V.createPixelIndex(A), p.putImageData(A, 0, 0);
814
+ const k = p.getImageData(0, 0, c, m);
815
+ V.computeEdgemap(k), h.clearRect(0, 0, c, m), h.putImageData(k, 0, 0);
816
+ const H = h.canvas.toDataURL();
817
+ h.canvas.remove();
818
818
  let w = setTimeout(async () => {
819
819
  w && clearTimeout(w), w = null;
820
- const x = await i.fromURL(H, {}, {
820
+ const x = await r.fromURL(H, {}, {
821
821
  left: 0,
822
822
  top: 0,
823
823
  objectCaching: !1,
824
824
  selectable: !1,
825
- info: pt
825
+ info: Ct
826
826
  });
827
827
  a.add(x);
828
828
  }, 1), C = !1, E = null, _ = null;
829
- const A = ({ x, y: P }) => ({
830
- x: Math.min(Math.max(Math.round(x), 0), r - 1),
829
+ const D = ({ x, y: P }) => ({
830
+ x: Math.min(Math.max(Math.round(x), 0), c - 1),
831
831
  y: Math.min(Math.max(Math.round(P), 0), m - 1)
832
832
  }), O = (x) => {
833
833
  const P = x.getElement(), T = document.createElement("canvas").getContext("2d");
@@ -840,34 +840,34 @@ const ja = (e) => {
840
840
  for (let K = 0; K < L; K += 1)
841
841
  Y[(X * L + K) * 4 + 3] && (G[X * L + K] = 1, z = Math.min(z, K), q = Math.min(q, X), se = Math.max(se, K), de = Math.max(de, X));
842
842
  if (T.canvas.remove(), se < z || de < q) return null;
843
- const Me = at.traceContours({
843
+ const Ie = st.traceContours({
844
844
  data: G,
845
845
  width: L,
846
846
  height: M,
847
847
  bounds: { minX: z, minY: q, maxX: se, maxY: de }
848
- }), Oe = x.scaleX ?? 1, ue = x.scaleY ?? 1, te = x.left ?? 0, W = x.top ?? 0, be = at.simplifyContours(Me, 1, 6).filter(
848
+ }), Pe = x.scaleX ?? 1, ue = x.scaleY ?? 1, te = x.left ?? 0, W = x.top ?? 0, be = st.simplifyContours(Ie, 1, 6).filter(
849
849
  ({ points: X }) => X.length
850
850
  );
851
851
  if (!be.length) return null;
852
- let me = 1 / 0, Ie = 1 / 0;
853
- const je = be.map((X) => {
854
- const K = X.points.map(({ x: Te, y: ut }) => {
855
- const et = Te * Oe, Et = ut * ue;
856
- return me = Math.min(me, et), Ie = Math.min(Ie, Et), { x: et, y: Et };
852
+ let me = 1 / 0, Ne = 1 / 0;
853
+ const Je = be.map((X) => {
854
+ const K = X.points.map(({ x: Be, y: dt }) => {
855
+ const Qe = Be * Pe, Rt = dt * ue;
856
+ return me = Math.min(me, Qe), Ne = Math.min(Ne, Rt), { x: Qe, y: Rt };
857
857
  });
858
858
  return { inner: X.inner, points: K };
859
859
  });
860
- if (!Number.isFinite(me) || !Number.isFinite(Ie)) return null;
861
- const Re = { x: me, y: Ie }, Pe = je.map((X) => ({
860
+ if (!Number.isFinite(me) || !Number.isFinite(Ne)) return null;
861
+ const Re = { x: me, y: Ne }, Te = Je.map((X) => ({
862
862
  inner: X.inner,
863
863
  points: X.points.map(
864
- ({ x: K, y: Te }) => new c(K - Re.x, Te - Re.y)
864
+ ({ x: K, y: Be }) => new i(K - Re.x, Be - Re.y)
865
865
  )
866
- })).sort((X, K) => Number(X.inner) - Number(K.inner)), Qe = Pe.findIndex(({ inner: X }) => !X), De = Qe >= 0 ? Qe : 0, F = Pe[De] ?? Pe[0], ne = (F == null ? void 0 : F.points.map(({ x: X, y: K }) => new c(X, K))) ?? [], ye = [];
867
- return Pe.forEach(({ points: X }) => {
866
+ })).sort((X, K) => Number(X.inner) - Number(K.inner)), je = Te.findIndex(({ inner: X }) => !X), Ae = je >= 0 ? je : 0, F = Te[Ae] ?? Te[0], ne = (F == null ? void 0 : F.points.map(({ x: X, y: K }) => new i(X, K))) ?? [], ye = [];
867
+ return Te.forEach(({ points: X }) => {
868
868
  if (!X.length) return;
869
- const [K, ...Te] = X;
870
- ye.push(`M ${K.x} ${K.y}`), Te.forEach(({ x: ut, y: et }) => ye.push(`L ${ut} ${et}`)), ye.push("Z");
869
+ const [K, ...Be] = X;
870
+ ye.push(`M ${K.x} ${K.y}`), Be.forEach(({ x: dt, y: Qe }) => ye.push(`L ${dt} ${Qe}`)), ye.push("Z");
871
871
  }), new l.Path(ye.join(" "), {
872
872
  left: te + Re.x,
873
873
  top: W + Re.y,
@@ -877,11 +877,11 @@ const ja = (e) => {
877
877
  selectable: !1,
878
878
  evented: !0,
879
879
  fillRule: "evenodd",
880
- pathOffset: new c(0, 0),
880
+ pathOffset: new i(0, 0),
881
881
  points: ne,
882
- pathContours: Pe,
882
+ pathContours: Te,
883
883
  pathBaseOffset: Re,
884
- pathEditableContourIndex: De,
884
+ pathEditableContourIndex: Ae,
885
885
  info: x.info ?? _e,
886
886
  fill: x.fill,
887
887
  hex: x.hex,
@@ -898,20 +898,20 @@ const ja = (e) => {
898
898
  }, y = (x) => {
899
899
  const P = x.e;
900
900
  if (C && (P == null ? void 0 : P.button) === 0) {
901
- const T = A(jt(P));
901
+ const T = D(Qt(P));
902
902
  if (!T.x && !T.y) return;
903
- const L = V.getClickOffset(T, r), M = D.data, Y = N.getImageData(0, 0, r, m), G = V.getEncodedLabel(M, L);
903
+ const L = V.getClickOffset(T, c), M = A.data, Y = N.getImageData(0, 0, c, m), G = V.getEncodedLabel(M, L);
904
904
  if (E === G) return;
905
905
  E = G;
906
- const z = V.getPixelIndex()[G], q = Pt(n), se = Math.max(0, Math.min(1, q[3] ?? 1)), de = [
906
+ const z = V.getPixelIndex()[G], q = Tt(n), se = Math.max(0, Math.min(1, q[3] ?? 1)), de = [
907
907
  q[0],
908
908
  q[1],
909
909
  q[2],
910
910
  Math.round(se * 255)
911
911
  ];
912
- V.highlightPixels(z, de, Y, k), V.fillPixels(z, de, Y), N.clearRect(0, 0, r, m), N.putImageData(Y, 0, 0);
913
- const { canvas: Me, minX: Oe, minY: ue } = on(Y), { hex: te, alpha: W } = ct(n), be = new l.FabricImage(Me, {
914
- left: Oe,
912
+ V.highlightPixels(z, de, Y, k), V.fillPixels(z, de, Y), N.clearRect(0, 0, c, m), N.putImageData(Y, 0, 0);
913
+ const { canvas: Ie, minX: Pe, minY: ue } = sn(Y), { hex: te, alpha: W } = it(n), be = new l.FabricImage(Ie, {
914
+ left: Pe,
915
915
  top: ue,
916
916
  objectCaching: !1,
917
917
  selectable: !1,
@@ -932,7 +932,7 @@ const ja = (e) => {
932
932
  C = !0, y(x);
933
933
  }, R = () => {
934
934
  C = !1, E = null;
935
- const x = we(a).filter(
935
+ const x = Se(a).filter(
936
936
  (T) => T.info === _e && T.index === b && T.type === "image"
937
937
  ), P = x[x.length - 1];
938
938
  P && (P.combinded = !0, P.evented = !0, a.remove(...x), a.add(P), _ = P);
@@ -940,8 +940,8 @@ const ja = (e) => {
940
940
  return a.on("mouse:down", I(B)), a.on("mouse:move", I(y)), a.on("mouse:up", I(R)), () => {
941
941
  w && (clearTimeout(w), w = null);
942
942
  try {
943
- const x = we(a), P = x.find(
944
- ({ info: L }) => L === pt
943
+ const x = Se(a), P = x.find(
944
+ ({ info: L }) => L === Ct
945
945
  );
946
946
  P && a.remove(P);
947
947
  const T = _ || (x.filter(
@@ -955,71 +955,71 @@ const ja = (e) => {
955
955
  a.off("mouse:down", I(B)), a.off("mouse:move", I(y)), a.off("mouse:up", I(R)), _ = null;
956
956
  }
957
957
  };
958
- } }), oo = /* @__PURE__ */ new Set([Fe, It]), $e = (e) => typeof e == "number" && Number.isFinite(e), rt = (e) => $e(e) && e !== 0 ? Math.abs(e) : 1, nt = (e, t = 0) => $e(e) ? e : t, ht = (e) => {
958
+ } }), oo = /* @__PURE__ */ new Set([Fe, Nt]), $e = (e) => typeof e == "number" && Number.isFinite(e), ct = (e) => $e(e) && e !== 0 ? Math.abs(e) : 1, tt = (e, t = 0) => $e(e) ? e : t, ut = (e) => {
959
959
  if (!e) return;
960
960
  const t = e.trim();
961
961
  if (!t) return;
962
962
  if (t.startsWith("#")) {
963
963
  if (t.length === 7 || t.length === 9)
964
964
  return t;
965
- const { hex: s } = ct(t);
965
+ const { hex: s } = it(t);
966
966
  return `#${s}`;
967
967
  }
968
- const { hex: n } = ct(t);
968
+ const { hex: n } = it(t);
969
969
  return `#${n}`;
970
- }, ft = (e, t) => {
970
+ }, ht = (e, t) => {
971
971
  if (t === "fill" && typeof e.fill == "string")
972
- return ht(e.fill);
972
+ return ut(e.fill);
973
973
  if (t === "stroke" && typeof e.stroke == "string")
974
- return ht(e.stroke);
974
+ return ut(e.stroke);
975
975
  if (t === "hex" && typeof e.hex == "string" && e.hex.length)
976
- return ht(`#${e.hex}`);
976
+ return ut(`#${e.hex}`);
977
977
  }, so = (e) => {
978
978
  const t = e.info ?? "";
979
979
  return oo.has(t) ? "box" : "segmentation";
980
980
  }, ao = (e, t, n) => {
981
- const s = nt(e.left), o = nt(e.top), a = nt(e.width), i = nt(e.height), c = rt(e.scaleX), l = rt(e.scaleY), h = a * c, u = i * l;
981
+ const s = tt(e.left), o = tt(e.top), a = tt(e.width), r = tt(e.height), i = ct(e.scaleX), l = ct(e.scaleY), g = a * i, d = r * l;
982
982
  return {
983
983
  type: "box",
984
984
  x: t > 0 ? s / t : s,
985
985
  y: n > 0 ? o / n : o,
986
- width: t > 0 ? Math.max(h, 0) / t : h,
987
- height: n > 0 ? Math.max(u, 0) / n : u
986
+ width: t > 0 ? Math.max(g, 0) / t : g,
987
+ height: n > 0 ? Math.max(d, 0) / n : d
988
988
  };
989
- }, io = (e) => e.clone(Nt).then((t) => t ?? e), co = async (e) => {
989
+ }, io = (e) => e.clone(kt).then((t) => t ?? e), co = async (e) => {
990
990
  if (typeof document > "u") return null;
991
991
  const t = e.getBoundingRect(), n = Math.max(
992
992
  1,
993
- Math.round((t == null ? void 0 : t.width) ?? (e.width ?? 0) * rt(e.scaleX))
993
+ Math.round((t == null ? void 0 : t.width) ?? (e.width ?? 0) * ct(e.scaleX))
994
994
  ), s = Math.max(
995
995
  1,
996
- Math.round((t == null ? void 0 : t.height) ?? (e.height ?? 0) * rt(e.scaleY))
996
+ Math.round((t == null ? void 0 : t.height) ?? (e.height ?? 0) * ct(e.scaleY))
997
997
  ), o = Rn(), a = document.createElement("canvas");
998
998
  a.width = n, a.height = s;
999
- const i = new o(a, {
999
+ const r = new o(a, {
1000
1000
  width: n,
1001
1001
  height: s,
1002
1002
  renderOnAddRemove: !1
1003
- }), c = await io(e), l = (t == null ? void 0 : t.left) ?? 0, h = (t == null ? void 0 : t.top) ?? 0;
1004
- c.set({
1005
- left: (c.left ?? 0) - l,
1006
- top: (c.top ?? 0) - h
1007
- }), i.add(c), i.renderAll();
1008
- const u = i.toDataURL({ format: "png", multiplier: 1 });
1009
- return i.dispose(), a.remove(), u;
1003
+ }), i = await io(e), l = (t == null ? void 0 : t.left) ?? 0, g = (t == null ? void 0 : t.top) ?? 0;
1004
+ i.set({
1005
+ left: (i.left ?? 0) - l,
1006
+ top: (i.top ?? 0) - g
1007
+ }), r.add(i), r.renderAll();
1008
+ const d = r.toDataURL({ format: "png", multiplier: 1 });
1009
+ return r.dispose(), a.remove(), d;
1010
1010
  }, ro = async (e) => {
1011
1011
  const t = await co(e);
1012
1012
  if (!t) return null;
1013
1013
  const [, n] = t.split(",");
1014
1014
  if (!n) return null;
1015
- const s = JSON.stringify(e.toObject(Nt));
1015
+ const s = JSON.stringify(e.toObject(kt));
1016
1016
  return {
1017
1017
  type: "segmentation",
1018
1018
  mask: n,
1019
1019
  vector: s
1020
1020
  };
1021
1021
  }, lo = (e) => {
1022
- const t = ft(e, "fill") ?? ft(e, "hex") ?? "#000000", n = $e(e.opacity) ? e.opacity : 1, s = ft(e, "stroke"), o = $e(e.seq) ? e.seq : void 0;
1022
+ const t = ht(e, "fill") ?? ht(e, "hex") ?? "#000000", n = $e(e.opacity) ? e.opacity : 1, s = ht(e, "stroke"), o = $e(e.seq) ? e.seq : void 0;
1023
1023
  return { color: t, opacity: n, lineColor: s, zIndex: o };
1024
1024
  }, uo = async (e, t, n) => {
1025
1025
  const s = e.unique ?? "";
@@ -1027,51 +1027,51 @@ const ja = (e) => {
1027
1027
  const o = so(e);
1028
1028
  let a = null;
1029
1029
  o === "box" ? a = ao(e, t, n) : a = await ro(e);
1030
- const i = lo(e), c = {
1030
+ const r = lo(e), i = {
1031
1031
  name: e.class ?? "",
1032
1032
  index: $e(e.seq) ? e.seq : 0
1033
1033
  };
1034
- return { id: s, type: o, label: c, style: i, geometry: a };
1035
- }, un = async (e, t, n) => {
1034
+ return { id: s, type: o, label: i, style: r, geometry: a };
1035
+ }, hn = async (e, t, n) => {
1036
1036
  const s = [];
1037
1037
  for (const o of e) {
1038
1038
  const a = await uo(o, t, n);
1039
1039
  a && s.push(a);
1040
1040
  }
1041
1041
  return s;
1042
- }, hn = (e, t, n) => {
1043
- const { id: s, type: o, label: a, style: i, geometry: c } = e, l = {
1042
+ }, fn = (e, t, n) => {
1043
+ const { id: s, type: o, label: a, style: r, geometry: i } = e, l = {
1044
1044
  unique: s,
1045
1045
  class: a.name,
1046
1046
  seq: a.index,
1047
- hex: i.color.replace("#", ""),
1048
- alpha: `${Math.round(i.opacity * 100)}%`,
1049
- opacity: i.opacity,
1047
+ hex: r.color.replace("#", ""),
1048
+ alpha: `${Math.round(r.opacity * 100)}%`,
1049
+ opacity: r.opacity,
1050
1050
  objectCaching: !1,
1051
1051
  selectable: !1,
1052
1052
  evented: !0
1053
1053
  };
1054
- if (i.lineColor && (l.stroke = i.lineColor), o === "box" && (c == null ? void 0 : c.type) === "box") {
1055
- const h = c;
1054
+ if (r.lineColor && (l.stroke = r.lineColor), o === "box" && (i == null ? void 0 : i.type) === "box") {
1055
+ const g = i;
1056
1056
  return {
1057
1057
  ...l,
1058
1058
  type: "rect",
1059
- left: h.x * t,
1060
- top: h.y * n,
1061
- width: h.width * t,
1062
- height: h.height * n,
1063
- fill: i.lineColor ? "" : tn(i.color.replace("#", ""), i.opacity),
1064
- stroke: i.lineColor ?? void 0,
1065
- info: i.lineColor ? Fe : It
1059
+ left: g.x * t,
1060
+ top: g.y * n,
1061
+ width: g.width * t,
1062
+ height: g.height * n,
1063
+ fill: r.lineColor ? "" : nn(r.color.replace("#", ""), r.opacity),
1064
+ stroke: r.lineColor ?? void 0,
1065
+ info: r.lineColor ? Fe : Nt
1066
1066
  };
1067
1067
  }
1068
- if (o === "segmentation" && (c == null ? void 0 : c.type) === "segmentation") {
1069
- const h = c;
1070
- if (h.vector)
1068
+ if (o === "segmentation" && (i == null ? void 0 : i.type) === "segmentation") {
1069
+ const g = i;
1070
+ if (g.vector)
1071
1071
  try {
1072
1072
  return {
1073
1073
  ...l,
1074
- ...JSON.parse(h.vector),
1074
+ ...JSON.parse(g.vector),
1075
1075
  unique: s
1076
1076
  };
1077
1077
  } catch {
@@ -1079,33 +1079,33 @@ const ja = (e) => {
1079
1079
  return {
1080
1080
  ...l,
1081
1081
  type: "image",
1082
- src: `data:image/png;base64,${h.mask}`
1082
+ src: `data:image/png;base64,${g.mask}`
1083
1083
  };
1084
1084
  }
1085
1085
  return l;
1086
- }, Ht = (e) => {
1086
+ }, _t = (e) => {
1087
1087
  let t;
1088
- const n = /* @__PURE__ */ new Set(), s = (h, u) => {
1089
- const r = typeof h == "function" ? h(t) : h;
1090
- if (!Object.is(r, t)) {
1088
+ const n = /* @__PURE__ */ new Set(), s = (g, d) => {
1089
+ const c = typeof g == "function" ? g(t) : g;
1090
+ if (!Object.is(c, t)) {
1091
1091
  const m = t;
1092
- t = u ?? (typeof r != "object" || r === null) ? r : Object.assign({}, t, r), n.forEach((v) => v(t, m));
1092
+ t = d ?? (typeof c != "object" || c === null) ? c : Object.assign({}, t, c), n.forEach((v) => v(t, m));
1093
1093
  }
1094
- }, o = () => t, c = { setState: s, getState: o, getInitialState: () => l, subscribe: (h) => (n.add(h), () => n.delete(h)) }, l = t = e(s, o, c);
1095
- return c;
1096
- }, fn = (e) => e ? Ht(e) : Ht, ho = (e) => e;
1094
+ }, o = () => t, i = { setState: s, getState: o, getInitialState: () => l, subscribe: (g) => (n.add(g), () => n.delete(g)) }, l = t = e(s, o, i);
1095
+ return i;
1096
+ }, mn = (e) => e ? _t(e) : _t, ho = (e) => e;
1097
1097
  function fo(e, t = ho) {
1098
- const n = tt.useSyncExternalStore(
1098
+ const n = et.useSyncExternalStore(
1099
1099
  e.subscribe,
1100
- tt.useCallback(() => t(e.getState()), [e, t]),
1101
- tt.useCallback(() => t(e.getInitialState()), [e, t])
1100
+ et.useCallback(() => t(e.getState()), [e, t]),
1101
+ et.useCallback(() => t(e.getInitialState()), [e, t])
1102
1102
  );
1103
- return tt.useDebugValue(n), n;
1103
+ return et.useDebugValue(n), n;
1104
1104
  }
1105
- const _t = (e) => {
1106
- const t = fn(e), n = (s) => fo(t, s);
1105
+ const Vt = (e) => {
1106
+ const t = mn(e), n = (s) => fo(t, s);
1107
1107
  return Object.assign(n, t), n;
1108
- }, j = (e) => e ? _t(e) : _t, Ee = j((e) => ({
1108
+ }, j = (e) => e ? Vt(e) : Vt, we = j((e) => ({
1109
1109
  tool: null,
1110
1110
  setTool(t) {
1111
1111
  e({ tool: t });
@@ -1126,7 +1126,7 @@ const _t = (e) => {
1126
1126
  return e({ redoStack: [] });
1127
1127
  e({ redoStack: t });
1128
1128
  }
1129
- })), Qa = () => Ee.getState(), Vt = [
1129
+ })), Qa = () => we.getState(), Zt = [
1130
1130
  "#C21460",
1131
1131
  "#8601AF",
1132
1132
  "#4424D6",
@@ -1140,11 +1140,11 @@ const _t = (e) => {
1140
1140
  "#FC600A",
1141
1141
  "#FE2712"
1142
1142
  ], We = j((e) => ({
1143
- colorCode: tn(Vt[Vt.length - 1], 1),
1143
+ colorCode: nn(Zt[Zt.length - 1], 1),
1144
1144
  setColorCode(t) {
1145
1145
  e({ colorCode: t });
1146
1146
  }
1147
- })), lt = j((e) => ({
1147
+ })), rt = j((e) => ({
1148
1148
  opacity: 1,
1149
1149
  setOpacity(t) {
1150
1150
  e({ opacity: t });
@@ -1156,36 +1156,36 @@ const _t = (e) => {
1156
1156
  { id: 2, lineCap: "round", lineWidth: 5 },
1157
1157
  { id: 4, lineCap: "round", lineWidth: 10 },
1158
1158
  { id: 6, lineCap: "round", lineWidth: 20 }
1159
- ], wt = j((e) => ({
1159
+ ], Lt = j((e) => ({
1160
1160
  brush: mo[0],
1161
1161
  setBrush(t) {
1162
1162
  e({ brush: t });
1163
1163
  }
1164
1164
  }));
1165
- var Zt = (e, t, n) => (o, a) => ({
1165
+ var Ut = (e, t, n) => (o, a) => ({
1166
1166
  pastStates: (n == null ? void 0 : n.pastStates) || [],
1167
1167
  futureStates: (n == null ? void 0 : n.futureStates) || [],
1168
- undo: (i = 1) => {
1169
- var c, l;
1168
+ undo: (r = 1) => {
1169
+ var i, l;
1170
1170
  if (a().pastStates.length) {
1171
- const h = ((c = n == null ? void 0 : n.partialize) == null ? void 0 : c.call(n, t())) || t(), u = a().pastStates.splice(-i, i), r = u.shift();
1172
- e(r), o({
1171
+ const g = ((i = n == null ? void 0 : n.partialize) == null ? void 0 : i.call(n, t())) || t(), d = a().pastStates.splice(-r, r), c = d.shift();
1172
+ e(c), o({
1173
1173
  pastStates: a().pastStates,
1174
1174
  futureStates: a().futureStates.concat(
1175
- ((l = n == null ? void 0 : n.diff) == null ? void 0 : l.call(n, h, r)) || h,
1176
- u.reverse()
1175
+ ((l = n == null ? void 0 : n.diff) == null ? void 0 : l.call(n, g, c)) || g,
1176
+ d.reverse()
1177
1177
  )
1178
1178
  });
1179
1179
  }
1180
1180
  },
1181
- redo: (i = 1) => {
1182
- var c, l;
1181
+ redo: (r = 1) => {
1182
+ var i, l;
1183
1183
  if (a().futureStates.length) {
1184
- const h = ((c = n == null ? void 0 : n.partialize) == null ? void 0 : c.call(n, t())) || t(), u = a().futureStates.splice(-i, i), r = u.shift();
1185
- e(r), o({
1184
+ const g = ((i = n == null ? void 0 : n.partialize) == null ? void 0 : i.call(n, t())) || t(), d = a().futureStates.splice(-r, r), c = d.shift();
1185
+ e(c), o({
1186
1186
  pastStates: a().pastStates.concat(
1187
- ((l = n == null ? void 0 : n.diff) == null ? void 0 : l.call(n, h, r)) || h,
1188
- u.reverse()
1187
+ ((l = n == null ? void 0 : n.diff) == null ? void 0 : l.call(n, g, c)) || g,
1188
+ d.reverse()
1189
1189
  ),
1190
1190
  futureStates: a().futureStates
1191
1191
  });
@@ -1195,47 +1195,47 @@ var Zt = (e, t, n) => (o, a) => ({
1195
1195
  isTracking: !0,
1196
1196
  pause: () => o({ isTracking: !1 }),
1197
1197
  resume: () => o({ isTracking: !0 }),
1198
- setOnSave: (i) => o({ _onSave: i }),
1198
+ setOnSave: (r) => o({ _onSave: r }),
1199
1199
  // Internal properties
1200
1200
  _onSave: n == null ? void 0 : n.onSave,
1201
- _handleSet: (i, c, l, h) => {
1202
- var u, r;
1203
- n != null && n.limit && a().pastStates.length >= (n == null ? void 0 : n.limit) && a().pastStates.shift(), (r = (u = a())._onSave) == null || r.call(u, i, l), o({
1204
- pastStates: a().pastStates.concat(h || i),
1201
+ _handleSet: (r, i, l, g) => {
1202
+ var d, c;
1203
+ n != null && n.limit && a().pastStates.length >= (n == null ? void 0 : n.limit) && a().pastStates.shift(), (c = (d = a())._onSave) == null || c.call(d, r, l), o({
1204
+ pastStates: a().pastStates.concat(g || r),
1205
1205
  futureStates: []
1206
1206
  });
1207
1207
  }
1208
1208
  }), go = (e, t) => (s, o, a) => {
1209
- var h, u;
1210
- a.temporal = fn(
1211
- ((h = t == null ? void 0 : t.wrapTemporal) == null ? void 0 : h.call(t, Zt(s, o, t))) || Zt(s, o, t)
1209
+ var g, d;
1210
+ a.temporal = mn(
1211
+ ((g = t == null ? void 0 : t.wrapTemporal) == null ? void 0 : g.call(t, Ut(s, o, t))) || Ut(s, o, t)
1212
1212
  );
1213
- const i = ((u = t == null ? void 0 : t.handleSet) == null ? void 0 : u.call(
1213
+ const r = ((d = t == null ? void 0 : t.handleSet) == null ? void 0 : d.call(
1214
1214
  t,
1215
1215
  a.temporal.getState()._handleSet
1216
- )) || a.temporal.getState()._handleSet, c = (r) => {
1217
- var g, b, f;
1216
+ )) || a.temporal.getState()._handleSet, i = (c) => {
1217
+ var f, b, h;
1218
1218
  if (!a.temporal.getState().isTracking) return;
1219
- const m = ((g = t == null ? void 0 : t.partialize) == null ? void 0 : g.call(t, o())) || o(), v = (b = t == null ? void 0 : t.diff) == null ? void 0 : b.call(t, r, m);
1219
+ const m = ((f = t == null ? void 0 : t.partialize) == null ? void 0 : f.call(t, o())) || o(), v = (b = t == null ? void 0 : t.diff) == null ? void 0 : b.call(t, c, m);
1220
1220
  // If the user has provided a diff function but nothing has been changed, deltaState will be null
1221
1221
  v === null || // If the user has provided an equality function, use it
1222
- (f = t == null ? void 0 : t.equality) != null && f.call(t, r, m) || i(
1223
- r,
1222
+ (h = t == null ? void 0 : t.equality) != null && h.call(t, c, m) || r(
1223
+ c,
1224
1224
  void 0,
1225
1225
  m,
1226
1226
  v
1227
1227
  );
1228
1228
  }, l = a.setState;
1229
- return a.setState = (...r) => {
1229
+ return a.setState = (...c) => {
1230
1230
  var v;
1231
1231
  const m = ((v = t == null ? void 0 : t.partialize) == null ? void 0 : v.call(t, o())) || o();
1232
- l(...r), c(m);
1232
+ l(...c), i(m);
1233
1233
  }, e(
1234
1234
  // Modify the set function to call the userlandSet function
1235
- (...r) => {
1235
+ (...c) => {
1236
1236
  var v;
1237
1237
  const m = ((v = t == null ? void 0 : t.partialize) == null ? void 0 : v.call(t, o())) || o();
1238
- s(...r), c(m);
1238
+ s(...c), i(m);
1239
1239
  },
1240
1240
  o,
1241
1241
  a
@@ -1253,24 +1253,24 @@ const ei = () => j()(
1253
1253
  partialize: (e) => ({ snapshot: e.snapshot })
1254
1254
  }
1255
1255
  )
1256
- ), Ut = 0, Wt = 1, le = {
1257
- NORMAL: [Ut, Wt],
1258
- ONLY_ORIGIN: [Ut],
1259
- ONLY_OVERLAY: [Wt]
1260
- }, mt = [
1256
+ ), Wt = 0, Yt = 1, le = {
1257
+ NORMAL: [Wt, Yt],
1258
+ ONLY_ORIGIN: [Wt],
1259
+ ONLY_OVERLAY: [Yt]
1260
+ }, ft = [
1261
1261
  le.NORMAL,
1262
1262
  le.ONLY_ORIGIN,
1263
1263
  le.ONLY_OVERLAY
1264
- ], Se = j((e, t) => ({
1264
+ ], Me = j((e, t) => ({
1265
1265
  mode: le.NORMAL,
1266
1266
  setMode: (n) => e({ mode: n }),
1267
1267
  cycleMode: () => {
1268
- const n = t().mode, s = mt.findIndex(
1269
- (a) => a.length === n.length && a.every((i, c) => i === n[c])
1270
- ), o = s >= 0 ? mt[(s + 1) % mt.length] : le.NORMAL;
1268
+ const n = t().mode, s = ft.findIndex(
1269
+ (a) => a.length === n.length && a.every((r, i) => r === n[i])
1270
+ ), o = s >= 0 ? ft[(s + 1) % ft.length] : le.NORMAL;
1271
1271
  e({ mode: o });
1272
1272
  }
1273
- })), dt = j((e) => ({
1273
+ })), lt = j((e) => ({
1274
1274
  objects: [],
1275
1275
  setObjects: (t) => e({ objects: t })
1276
1276
  })), Ge = j((e) => ({
@@ -1284,7 +1284,7 @@ const ei = () => j()(
1284
1284
  setMode(t) {
1285
1285
  e({ mode: t });
1286
1286
  }
1287
- })), ti = () => qe.getState(), Ke = j((e, t) => ({
1287
+ })), ti = () => qe.getState(), wt = j((e, t) => ({
1288
1288
  tool: null,
1289
1289
  setTool(n) {
1290
1290
  const s = t().tool, o = s ? [s.id, ...t().toolHistory.slice(0, 4)] : t().toolHistory;
@@ -1307,12 +1307,12 @@ const ei = () => j()(
1307
1307
  e({ redoStack: n });
1308
1308
  },
1309
1309
  toolHistory: []
1310
- })), ni = () => Ke.getState(), Yt = j((e) => ({
1310
+ })), ni = () => wt.getState(), zt = j((e) => ({
1311
1311
  tool: null,
1312
1312
  setTool(t) {
1313
1313
  e({ tool: t });
1314
1314
  }
1315
- })), zt = j((e) => ({
1315
+ })), Ft = j((e) => ({
1316
1316
  tool: null,
1317
1317
  setTool(t) {
1318
1318
  e({ tool: t });
@@ -1333,7 +1333,7 @@ const ei = () => j()(
1333
1333
  reset() {
1334
1334
  e({ english: !1, number: !1, special: !1 });
1335
1335
  }
1336
- })), Bt = j((e, t) => ({
1336
+ })), Et = j((e, t) => ({
1337
1337
  isValidationMode: !1,
1338
1338
  setValidationMode(n) {
1339
1339
  e({ isValidationMode: n });
@@ -1408,17 +1408,17 @@ const ei = () => j()(
1408
1408
  reset() {
1409
1409
  e({ hiddenClassificationIds: {} });
1410
1410
  }
1411
- })), mn = j((e) => ({
1411
+ })), gn = j((e) => ({
1412
1412
  objects: [],
1413
1413
  setObjects(t) {
1414
1414
  e({ objects: t });
1415
1415
  }
1416
- })), gn = j((e) => ({
1416
+ })), vn = j((e) => ({
1417
1417
  selectedSegment: null,
1418
1418
  setSelectedSegment(t) {
1419
1419
  e({ selectedSegment: t });
1420
1420
  }
1421
- })), vn = j((e) => ({
1421
+ })), Cn = j((e) => ({
1422
1422
  selectedSegment: null,
1423
1423
  setSelectedSegment(t) {
1424
1424
  e({ selectedSegment: t });
@@ -1446,9 +1446,9 @@ const ei = () => j()(
1446
1446
  toggleActive() {
1447
1447
  e({ active: !t().active });
1448
1448
  }
1449
- })), Cn = xn(null);
1449
+ })), pn = xn(null);
1450
1450
  function po() {
1451
- const e = Ln(Cn);
1451
+ const e = Ln(pn);
1452
1452
  if (!e)
1453
1453
  throw new Error("useLabelingContext must be used within a LabelingProvider");
1454
1454
  return e;
@@ -1460,29 +1460,29 @@ function bo({
1460
1460
  viewMode: s,
1461
1461
  onViewModeChange: o,
1462
1462
  availableViewModes: a = ["Image"],
1463
- textContent: i,
1464
- numberContent: c,
1463
+ textContent: r,
1464
+ numberContent: i,
1465
1465
  fileContent: l,
1466
- records: h,
1467
- activeRecordId: u,
1468
- onRecordSelect: r,
1466
+ records: g,
1467
+ activeRecordId: d,
1468
+ onRecordSelect: c,
1469
1469
  classes: m,
1470
1470
  policies: v = [],
1471
- onClassSelect: g,
1471
+ onClassSelect: f,
1472
1472
  onSave: b,
1473
- onSaveToRecord: f,
1473
+ onSaveToRecord: h,
1474
1474
  onFileUpload: p,
1475
1475
  isSaving: N = !1,
1476
1476
  onNavigateLeft: Z,
1477
1477
  onNavigateRight: V,
1478
- canNavigateLeft: D = !1,
1478
+ canNavigateLeft: A = !1,
1479
1479
  canNavigateRight: k = !1,
1480
1480
  mode: H = "labeling",
1481
1481
  onModeChange: w,
1482
1482
  validationResults: C = [],
1483
1483
  indicator: E,
1484
1484
  extensions: _ = [],
1485
- tools: A = ["selection", "blankRect", "polygon", "brush", "eraser"],
1485
+ tools: D = ["selection", "blankRect", "polygon", "brush", "eraser"],
1486
1486
  theme: O,
1487
1487
  layout: y = {},
1488
1488
  children: B
@@ -1494,11 +1494,11 @@ function bo({
1494
1494
  ce(() => {
1495
1495
  s && z(s);
1496
1496
  }, [s, z]);
1497
- const Me = Bt((W) => W.setValidationMode);
1497
+ const Ie = Et((W) => W.setValidationMode);
1498
1498
  ce(() => {
1499
- Me(H === "validation");
1500
- }, [H, Me]);
1501
- const Oe = ve(
1499
+ Ie(H === "validation");
1500
+ }, [H, Ie]);
1501
+ const Pe = ve(
1502
1502
  () => ({
1503
1503
  image: e,
1504
1504
  annotations: t,
@@ -1506,33 +1506,33 @@ function bo({
1506
1506
  viewMode: se,
1507
1507
  onViewModeChange: de,
1508
1508
  availableViewModes: a,
1509
- textContent: i,
1510
- numberContent: c,
1509
+ textContent: r,
1510
+ numberContent: i,
1511
1511
  fileContent: l,
1512
- records: h,
1513
- activeRecordId: u,
1514
- onRecordSelect: r,
1512
+ records: g,
1513
+ activeRecordId: d,
1514
+ onRecordSelect: c,
1515
1515
  classes: m,
1516
1516
  policies: v,
1517
- onClassSelect: g,
1517
+ onClassSelect: f,
1518
1518
  selectedClassId: R,
1519
1519
  setSelectedClassId: x,
1520
1520
  selectedAnnotationId: P,
1521
1521
  setSelectedAnnotationId: T,
1522
1522
  onSave: b,
1523
- onSaveToRecord: f,
1523
+ onSaveToRecord: h,
1524
1524
  onFileUpload: p,
1525
1525
  isSaving: N,
1526
1526
  onNavigateLeft: Z,
1527
1527
  onNavigateRight: V,
1528
- canNavigateLeft: D,
1528
+ canNavigateLeft: A,
1529
1529
  canNavigateRight: k,
1530
1530
  mode: H,
1531
1531
  onModeChange: w,
1532
1532
  validationResults: C,
1533
1533
  indicator: E,
1534
1534
  extensions: _,
1535
- tools: A,
1535
+ tools: D,
1536
1536
  theme: O,
1537
1537
  layout: y,
1538
1538
  navDirection: L,
@@ -1547,31 +1547,31 @@ function bo({
1547
1547
  se,
1548
1548
  de,
1549
1549
  a,
1550
+ r,
1550
1551
  i,
1551
- c,
1552
1552
  l,
1553
- h,
1554
- u,
1555
- r,
1553
+ g,
1554
+ d,
1555
+ c,
1556
1556
  m,
1557
1557
  v,
1558
- g,
1558
+ f,
1559
1559
  R,
1560
1560
  P,
1561
1561
  b,
1562
- f,
1562
+ h,
1563
1563
  p,
1564
1564
  N,
1565
1565
  Z,
1566
1566
  V,
1567
- D,
1567
+ A,
1568
1568
  k,
1569
1569
  H,
1570
1570
  w,
1571
1571
  C,
1572
1572
  E,
1573
1573
  _,
1574
- A,
1574
+ D,
1575
1575
  O,
1576
1576
  y,
1577
1577
  L,
@@ -1582,7 +1582,7 @@ function bo({
1582
1582
  const W = {};
1583
1583
  return O.primary && (W["--lc-primary"] = O.primary), O.background && (W["--lc-background"] = O.background), O.surface && (W["--lc-surface"] = O.surface), O.border && (W["--lc-border"] = O.border), O.text && (W["--lc-text"] = O.text), O.textSecondary && (W["--lc-text-secondary"] = O.textSecondary), O.hover && (W["--lc-hover"] = O.hover), O.fontFamily && (W["--lc-font-family"] = O.fontFamily), Object.keys(W).length > 0 ? W : void 0;
1584
1584
  }, [O]);
1585
- return /* @__PURE__ */ d(Cn.Provider, { value: Oe, children: /* @__PURE__ */ d("div", { style: ue, children: B }) });
1585
+ return /* @__PURE__ */ u(pn.Provider, { value: Pe, children: /* @__PURE__ */ u("div", { style: { width: "100%", height: "100%", overflow: "hidden", ...ue }, children: B }) });
1586
1586
  }
1587
1587
  const yo = [
1588
1588
  // ─── Labeling Tools ───
@@ -1786,7 +1786,7 @@ function fe({
1786
1786
  const o = xo(e);
1787
1787
  if (!o) return null;
1788
1788
  const a = Lo[t];
1789
- return /* @__PURE__ */ d(
1789
+ return /* @__PURE__ */ u(
1790
1790
  "svg",
1791
1791
  {
1792
1792
  xmlns: "http://www.w3.org/2000/svg",
@@ -1798,11 +1798,11 @@ function fe({
1798
1798
  clipRule: "evenodd",
1799
1799
  className: n,
1800
1800
  style: s,
1801
- children: o.d.map((i, c) => /* @__PURE__ */ d("path", { d: i }, c))
1801
+ children: o.d.map((r, i) => /* @__PURE__ */ u("path", { d: r }, i))
1802
1802
  }
1803
1803
  );
1804
1804
  }
1805
- const wo = "lc-controlBar-UEkkK", So = "lc-controlLeft-DLKH7", Mo = "lc-controlRight-1O3y-", Io = "lc-viewModeTabs-NTBV-", No = "lc-viewModeTab-SeV73", ko = "lc-metaInfo-a6MkE", Oo = "lc-metaItem-7MLAS", Po = "lc-metaDivider-3k0-r", To = "lc-colorPreview-UXizA", Bo = "lc-zoomControls-nRIFJ", Eo = "lc-zoomBtn-RQj5N", Ro = "lc-zoomInput-CGM7z", Do = "lc-controlBtn-5D7WV", Ao = "lc-controlBtnPrimary-BhTmF lc-controlBtn-5D7WV", Ho = "lc-controlBtnGroup-Q3Yxp", _o = "lc-saveDropdownWrapper-zrTMb", Vo = "lc-saveDropdown-d9tVH", Zo = "lc-saveDropdownItem-Uo97r", Uo = "lc-toggleBtn-OwP-- lc-controlBtn-5D7WV", U = {
1805
+ const wo = "lc-controlBar-UEkkK", So = "lc-controlLeft-DLKH7", Mo = "lc-controlRight-1O3y-", Io = "lc-viewModeTabs-NTBV-", No = "lc-viewModeTab-SeV73", ko = "lc-metaInfo-a6MkE", Oo = "lc-metaItem-7MLAS", Po = "lc-metaDivider-3k0-r", To = "lc-colorPreview-UXizA", Bo = "lc-zoomControls-nRIFJ", Eo = "lc-zoomBtn-RQj5N", Ro = "lc-zoomInput-CGM7z", Ao = "lc-controlBtn-5D7WV", Do = "lc-controlBtnPrimary-BhTmF lc-controlBtn-5D7WV", Ho = "lc-controlBtnGroup-Q3Yxp", _o = "lc-saveDropdownWrapper-zrTMb", Vo = "lc-saveDropdown-d9tVH", Zo = "lc-saveDropdownItem-Uo97r", Uo = "lc-toggleBtn-OwP-- lc-controlBtn-5D7WV", U = {
1806
1806
  controlBar: wo,
1807
1807
  controlLeft: So,
1808
1808
  controlRight: Mo,
@@ -1815,8 +1815,8 @@ const wo = "lc-controlBar-UEkkK", So = "lc-controlLeft-DLKH7", Mo = "lc-controlR
1815
1815
  zoomControls: Bo,
1816
1816
  zoomBtn: Eo,
1817
1817
  zoomInput: Ro,
1818
- controlBtn: Do,
1819
- controlBtnPrimary: Ao,
1818
+ controlBtn: Ao,
1819
+ controlBtnPrimary: Do,
1820
1820
  controlBtnGroup: Ho,
1821
1821
  saveDropdownWrapper: _o,
1822
1822
  saveDropdown: Vo,
@@ -1841,16 +1841,16 @@ function Yo({
1841
1841
  mode: s = "labeling",
1842
1842
  onModeChange: o,
1843
1843
  onSave: a,
1844
- onSaveToRecord: i,
1845
- isSaving: c = !1,
1844
+ onSaveToRecord: r,
1845
+ isSaving: i = !1,
1846
1846
  onNavigateLeft: l,
1847
- onNavigateRight: h,
1848
- canNavigateLeft: u = !1,
1849
- canNavigateRight: r = !1
1847
+ onNavigateRight: g,
1848
+ canNavigateLeft: d = !1,
1849
+ canNavigateRight: c = !1
1850
1850
  }) {
1851
1851
  return /* @__PURE__ */ S("div", { className: U.controlBar, children: [
1852
1852
  /* @__PURE__ */ S("div", { className: U.controlLeft, children: [
1853
- n.length > 1 && /* @__PURE__ */ d(
1853
+ n.length > 1 && /* @__PURE__ */ u(
1854
1854
  zo,
1855
1855
  {
1856
1856
  viewMode: e,
@@ -1858,41 +1858,41 @@ function Yo({
1858
1858
  onViewModeChange: t
1859
1859
  }
1860
1860
  ),
1861
- /* @__PURE__ */ d(Fo, { viewMode: e })
1861
+ /* @__PURE__ */ u(Fo, { viewMode: e })
1862
1862
  ] }),
1863
1863
  /* @__PURE__ */ S("div", { className: U.controlRight, children: [
1864
- /* @__PURE__ */ d($o, {}),
1865
- (l || h) && /* @__PURE__ */ S("div", { className: U.controlBtnGroup, children: [
1866
- /* @__PURE__ */ d(
1864
+ /* @__PURE__ */ u($o, {}),
1865
+ (l || g) && /* @__PURE__ */ S("div", { className: U.controlBtnGroup, children: [
1866
+ /* @__PURE__ */ u(
1867
1867
  "button",
1868
1868
  {
1869
1869
  className: U.controlBtn,
1870
- disabled: !u,
1870
+ disabled: !d,
1871
1871
  onClick: l,
1872
1872
  title: "Previous",
1873
- children: /* @__PURE__ */ d(fe, { iconType: "icon-left", size: "xs" })
1873
+ children: /* @__PURE__ */ u(fe, { iconType: "icon-left", size: "xs" })
1874
1874
  }
1875
1875
  ),
1876
- /* @__PURE__ */ d(
1876
+ /* @__PURE__ */ u(
1877
1877
  "button",
1878
1878
  {
1879
1879
  className: U.controlBtn,
1880
- disabled: !r,
1881
- onClick: h,
1880
+ disabled: !c,
1881
+ onClick: g,
1882
1882
  title: "Next",
1883
- children: /* @__PURE__ */ d(fe, { iconType: "icon-right", size: "xs" })
1883
+ children: /* @__PURE__ */ u(fe, { iconType: "icon-right", size: "xs" })
1884
1884
  }
1885
1885
  )
1886
1886
  ] }),
1887
- a && /* @__PURE__ */ d(
1887
+ a && /* @__PURE__ */ u(
1888
1888
  Go,
1889
1889
  {
1890
1890
  onSave: a,
1891
- onSaveToRecord: i,
1892
- isSaving: c
1891
+ onSaveToRecord: r,
1892
+ isSaving: i
1893
1893
  }
1894
1894
  ),
1895
- o && /* @__PURE__ */ d(
1895
+ o && /* @__PURE__ */ u(
1896
1896
  "button",
1897
1897
  {
1898
1898
  className: U.toggleBtn,
@@ -1901,7 +1901,7 @@ function Yo({
1901
1901
  children: "Valid"
1902
1902
  }
1903
1903
  ),
1904
- /* @__PURE__ */ d(qo, {})
1904
+ /* @__PURE__ */ u(qo, {})
1905
1905
  ] })
1906
1906
  ] });
1907
1907
  }
@@ -1910,7 +1910,7 @@ function zo({
1910
1910
  availableViewModes: t,
1911
1911
  onViewModeChange: n
1912
1912
  }) {
1913
- return /* @__PURE__ */ d("div", { className: U.viewModeTabs, children: t.map((s) => /* @__PURE__ */ d(
1913
+ return /* @__PURE__ */ u("div", { className: U.viewModeTabs, children: t.map((s) => /* @__PURE__ */ u(
1914
1914
  "button",
1915
1915
  {
1916
1916
  className: U.viewModeTab,
@@ -1922,18 +1922,18 @@ function zo({
1922
1922
  )) });
1923
1923
  }
1924
1924
  function Fo({ viewMode: e }) {
1925
- const t = Ee((l) => l.tool), n = mn((l) => l.objects), s = gn((l) => l.selectedSegment), o = vn((l) => l.selectedSegment), a = We((l) => l.colorCode), i = lt((l) => l.opacity), c = t ? Wo[t.id] ?? t.id : "—";
1925
+ const t = we((l) => l.tool), n = gn((l) => l.objects), s = vn((l) => l.selectedSegment), o = Cn((l) => l.selectedSegment), a = We((l) => l.colorCode), r = rt((l) => l.opacity), i = t ? Wo[t.id] ?? t.id : "—";
1926
1926
  return e === "Record" || e === "File" ? null : /* @__PURE__ */ S("div", { className: U.metaInfo, children: [
1927
- /* @__PURE__ */ d("div", { className: U.metaItem, children: /* @__PURE__ */ d("em", { children: c }) }),
1928
- /* @__PURE__ */ d("div", { className: U.metaDivider }),
1929
- e === "Image" && /* @__PURE__ */ d(Xo, { objects: n }),
1927
+ /* @__PURE__ */ u("div", { className: U.metaItem, children: /* @__PURE__ */ u("em", { children: i }) }),
1928
+ /* @__PURE__ */ u("div", { className: U.metaDivider }),
1929
+ e === "Image" && /* @__PURE__ */ u(Xo, { objects: n }),
1930
1930
  e === "Text" && s && /* @__PURE__ */ S("div", { className: U.metaItem, children: [
1931
1931
  "Characters: ",
1932
- /* @__PURE__ */ d("em", { children: s.end - s.start })
1932
+ /* @__PURE__ */ u("em", { children: s.end - s.start })
1933
1933
  ] }),
1934
1934
  e === "Number" && o && /* @__PURE__ */ S("div", { className: U.metaItem, children: [
1935
1935
  "Points: ",
1936
- /* @__PURE__ */ d("em", { children: o.end - o.start + 1 }),
1936
+ /* @__PURE__ */ u("em", { children: o.end - o.start + 1 }),
1937
1937
  " ",
1938
1938
  "Index: ",
1939
1939
  /* @__PURE__ */ S("em", { children: [
@@ -1942,18 +1942,18 @@ function Fo({ viewMode: e }) {
1942
1942
  o.end + 1
1943
1943
  ] })
1944
1944
  ] }),
1945
- /* @__PURE__ */ d("div", { className: U.metaDivider }),
1945
+ /* @__PURE__ */ u("div", { className: U.metaDivider }),
1946
1946
  /* @__PURE__ */ S("div", { className: U.metaItem, children: [
1947
- /* @__PURE__ */ d(
1947
+ /* @__PURE__ */ u(
1948
1948
  "span",
1949
1949
  {
1950
1950
  className: U.colorPreview,
1951
1951
  style: { background: a }
1952
1952
  }
1953
1953
  ),
1954
- /* @__PURE__ */ d("em", { children: a }),
1954
+ /* @__PURE__ */ u("em", { children: a }),
1955
1955
  /* @__PURE__ */ S("span", { children: [
1956
- Math.round(i * 100),
1956
+ Math.round(r * 100),
1957
1957
  "%"
1958
1958
  ] })
1959
1959
  ] })
@@ -1963,24 +1963,24 @@ function Xo({ objects: e }) {
1963
1963
  if (!e.length)
1964
1964
  return /* @__PURE__ */ S("div", { className: U.metaItem, children: [
1965
1965
  "X: ",
1966
- /* @__PURE__ */ d("em", { children: "—" }),
1966
+ /* @__PURE__ */ u("em", { children: "—" }),
1967
1967
  " Y: ",
1968
- /* @__PURE__ */ d("em", { children: "—" }),
1968
+ /* @__PURE__ */ u("em", { children: "—" }),
1969
1969
  " W: ",
1970
- /* @__PURE__ */ d("em", { children: "—" }),
1970
+ /* @__PURE__ */ u("em", { children: "—" }),
1971
1971
  " H: ",
1972
- /* @__PURE__ */ d("em", { children: "—" })
1972
+ /* @__PURE__ */ u("em", { children: "—" })
1973
1973
  ] });
1974
1974
  const t = e[0], n = Math.round(t.left ?? 0), s = Math.round(t.top ?? 0), o = Math.round((t.width ?? 0) * (t.scaleX ?? 1)), a = Math.round((t.height ?? 0) * (t.scaleY ?? 1));
1975
1975
  return /* @__PURE__ */ S("div", { className: U.metaItem, children: [
1976
1976
  "X: ",
1977
- /* @__PURE__ */ d("em", { children: n }),
1977
+ /* @__PURE__ */ u("em", { children: n }),
1978
1978
  " Y: ",
1979
- /* @__PURE__ */ d("em", { children: s }),
1979
+ /* @__PURE__ */ u("em", { children: s }),
1980
1980
  " W: ",
1981
- /* @__PURE__ */ d("em", { children: o }),
1981
+ /* @__PURE__ */ u("em", { children: o }),
1982
1982
  " H: ",
1983
- /* @__PURE__ */ d("em", { children: a })
1983
+ /* @__PURE__ */ u("em", { children: a })
1984
1984
  ] });
1985
1985
  }
1986
1986
  function $o() {
@@ -1989,48 +1989,48 @@ function $o() {
1989
1989
  n(`${s}%`);
1990
1990
  }, [s]);
1991
1991
  const o = $(
1992
- (i) => {
1993
- const c = Math.max(0.1, Math.min(5, i));
1992
+ (r) => {
1993
+ const i = Math.max(0.1, Math.min(5, r));
1994
1994
  e.setZoom({
1995
- level: c,
1995
+ level: i,
1996
1996
  width: e.width,
1997
1997
  height: e.height
1998
1998
  });
1999
1999
  },
2000
2000
  [e]
2001
- ), a = (i) => {
2002
- if (i.key === "Enter") {
2003
- const c = parseInt(t, 10);
2004
- isNaN(c) || o(c / 100), i.target.blur();
2001
+ ), a = (r) => {
2002
+ if (r.key === "Enter") {
2003
+ const i = parseInt(t, 10);
2004
+ isNaN(i) || o(i / 100), r.target.blur();
2005
2005
  }
2006
2006
  };
2007
2007
  return /* @__PURE__ */ S("div", { className: U.zoomControls, children: [
2008
- /* @__PURE__ */ d(
2008
+ /* @__PURE__ */ u(
2009
2009
  "button",
2010
2010
  {
2011
2011
  className: U.zoomBtn,
2012
2012
  onClick: () => o(e.level / 1.1),
2013
2013
  title: "Zoom Out",
2014
- children: /* @__PURE__ */ d(fe, { iconType: "icon-minus", size: "xs" })
2014
+ children: /* @__PURE__ */ u(fe, { iconType: "icon-minus", size: "xs" })
2015
2015
  }
2016
2016
  ),
2017
- /* @__PURE__ */ d(
2017
+ /* @__PURE__ */ u(
2018
2018
  "input",
2019
2019
  {
2020
2020
  className: U.zoomInput,
2021
2021
  value: t,
2022
- onChange: (i) => n(i.target.value),
2022
+ onChange: (r) => n(r.target.value),
2023
2023
  onKeyDown: a,
2024
2024
  onBlur: () => n(`${s}%`)
2025
2025
  }
2026
2026
  ),
2027
- /* @__PURE__ */ d(
2027
+ /* @__PURE__ */ u(
2028
2028
  "button",
2029
2029
  {
2030
2030
  className: U.zoomBtn,
2031
2031
  onClick: () => o(e.level * 1.1),
2032
2032
  title: "Zoom In",
2033
- children: /* @__PURE__ */ d(fe, { iconType: "icon-plus", size: "xs" })
2033
+ children: /* @__PURE__ */ u(fe, { iconType: "icon-plus", size: "xs" })
2034
2034
  }
2035
2035
  )
2036
2036
  ] });
@@ -2043,10 +2043,10 @@ function Go({
2043
2043
  const [s, o] = re(!1), a = Ce(null);
2044
2044
  return ce(() => {
2045
2045
  if (!s) return;
2046
- const i = (c) => {
2047
- a.current && !a.current.contains(c.target) && o(!1);
2046
+ const r = (i) => {
2047
+ a.current && !a.current.contains(i.target) && o(!1);
2048
2048
  };
2049
- return window.addEventListener("mousedown", i), () => window.removeEventListener("mousedown", i);
2049
+ return window.addEventListener("mousedown", r), () => window.removeEventListener("mousedown", r);
2050
2050
  }, [s]), t ? /* @__PURE__ */ S("div", { className: U.saveDropdownWrapper, ref: a, children: [
2051
2051
  /* @__PURE__ */ S("div", { className: U.controlBtnGroup, children: [
2052
2052
  /* @__PURE__ */ S(
@@ -2056,23 +2056,23 @@ function Go({
2056
2056
  disabled: n,
2057
2057
  onClick: e,
2058
2058
  children: [
2059
- /* @__PURE__ */ d(fe, { iconType: "icon-save", size: "xs" }),
2059
+ /* @__PURE__ */ u(fe, { iconType: "icon-save", size: "xs" }),
2060
2060
  n ? "Saving…" : "Save"
2061
2061
  ]
2062
2062
  }
2063
2063
  ),
2064
- /* @__PURE__ */ d(
2064
+ /* @__PURE__ */ u(
2065
2065
  "button",
2066
2066
  {
2067
2067
  className: U.controlBtnPrimary,
2068
- onClick: () => o((i) => !i),
2068
+ onClick: () => o((r) => !r),
2069
2069
  disabled: n,
2070
- children: /* @__PURE__ */ d(fe, { iconType: "icon-down", size: "xxs" })
2070
+ children: /* @__PURE__ */ u(fe, { iconType: "icon-down", size: "xxs" })
2071
2071
  }
2072
2072
  )
2073
2073
  ] }),
2074
2074
  s && /* @__PURE__ */ S("div", { className: U.saveDropdown, children: [
2075
- /* @__PURE__ */ d(
2075
+ /* @__PURE__ */ u(
2076
2076
  "button",
2077
2077
  {
2078
2078
  className: U.saveDropdownItem,
@@ -2082,7 +2082,7 @@ function Go({
2082
2082
  children: "Save"
2083
2083
  }
2084
2084
  ),
2085
- /* @__PURE__ */ d(
2085
+ /* @__PURE__ */ u(
2086
2086
  "button",
2087
2087
  {
2088
2088
  className: U.saveDropdownItem,
@@ -2100,7 +2100,7 @@ function Go({
2100
2100
  disabled: n,
2101
2101
  onClick: e,
2102
2102
  children: [
2103
- /* @__PURE__ */ d(fe, { iconType: "icon-save", size: "xs" }),
2103
+ /* @__PURE__ */ u(fe, { iconType: "icon-save", size: "xs" }),
2104
2104
  n ? "Saving…" : "Save"
2105
2105
  ]
2106
2106
  }
@@ -2108,57 +2108,57 @@ function Go({
2108
2108
  }
2109
2109
  function qo() {
2110
2110
  const e = St((n) => n.isOpen), t = St((n) => n.toggle);
2111
- return /* @__PURE__ */ d(
2111
+ return /* @__PURE__ */ u(
2112
2112
  "button",
2113
2113
  {
2114
2114
  className: U.toggleBtn,
2115
2115
  "data-active": e || void 0,
2116
2116
  onClick: t,
2117
2117
  title: "Issues",
2118
- children: /* @__PURE__ */ d(fe, { iconType: "icon-issue", size: "sm" })
2118
+ children: /* @__PURE__ */ u(fe, { iconType: "icon-issue", size: "sm" })
2119
2119
  }
2120
2120
  );
2121
2121
  }
2122
- function Ko(e, t) {
2123
- const n = Ce(null), s = Ce(null), o = Ce(t);
2124
- return o.current = t, ce(() => {
2122
+ function Ko(e, t, n = !1) {
2123
+ const s = Ce(null), o = Ce(null), a = Ce(t);
2124
+ return a.current = t, ce(() => {
2125
2125
  if (!Q()) return;
2126
- if (n.current && (n.current(), n.current = null), !e) {
2127
- s.current = null;
2126
+ if (s.current && (s.current(), s.current = null), !e) {
2127
+ o.current = null;
2128
2128
  return;
2129
2129
  }
2130
- const i = o.current;
2131
- let c = !1;
2132
- const l = async () => {
2133
- let h;
2130
+ const i = a.current;
2131
+ let l = !1;
2132
+ const g = async () => {
2133
+ let d;
2134
2134
  switch (e.id) {
2135
2135
  case "selection":
2136
- h = await e.init();
2136
+ d = await e.init();
2137
2137
  break;
2138
2138
  case "brush":
2139
- h = await e.init({
2139
+ d = await e.init({
2140
2140
  brush: i.brush,
2141
2141
  colorCode: i.colorCode
2142
2142
  });
2143
2143
  break;
2144
2144
  case "bounded-box":
2145
2145
  case "filled-box":
2146
- h = await e.init({
2146
+ d = await e.init({
2147
2147
  colorCode: i.colorCode
2148
2148
  });
2149
2149
  break;
2150
2150
  case "pen":
2151
- h = await e.init({
2151
+ d = await e.init({
2152
2152
  colorCode: i.colorCode
2153
2153
  });
2154
2154
  break;
2155
2155
  case "eraser":
2156
- h = await e.init({
2156
+ d = await e.init({
2157
2157
  brush: i.brush
2158
2158
  });
2159
2159
  break;
2160
2160
  case "magic-brush":
2161
- h = await e.init({
2161
+ d = await e.init({
2162
2162
  src: i.imageUrl ?? "",
2163
2163
  colorCode: i.colorCode,
2164
2164
  brush: i.brush,
@@ -2169,7 +2169,7 @@ function Ko(e, t) {
2169
2169
  });
2170
2170
  break;
2171
2171
  case "superpixel":
2172
- h = await e.init({
2172
+ d = await e.init({
2173
2173
  src: i.imageUrl ?? "",
2174
2174
  colorCode: i.colorCode,
2175
2175
  superpixelConfig: i.superpixelConfig ?? {},
@@ -2177,20 +2177,20 @@ function Ko(e, t) {
2177
2177
  });
2178
2178
  break;
2179
2179
  case "seg-anything":
2180
- h = await e.init({
2180
+ d = await e.init({
2181
2181
  callback: i.segAnythingCallback
2182
2182
  });
2183
2183
  break;
2184
2184
  default:
2185
- h = await e.init(i);
2185
+ d = await e.init(i);
2186
2186
  break;
2187
2187
  }
2188
- !c && typeof h == "function" && (n.current = h);
2188
+ !l && typeof d == "function" && (s.current = d);
2189
2189
  };
2190
- return s.current = e.id, l(), () => {
2191
- c = !0, n.current && (n.current(), n.current = null);
2190
+ return o.current = e.id, g(), () => {
2191
+ l = !0, s.current && (s.current(), s.current = null);
2192
2192
  };
2193
- }, [e]), { activeToolId: s.current };
2193
+ }, [e, n]), { activeToolId: o.current };
2194
2194
  }
2195
2195
  const J = {
2196
2196
  common: {
@@ -2240,39 +2240,39 @@ function Qo({
2240
2240
  onRedo: o,
2241
2241
  disabled: a = !1
2242
2242
  }) {
2243
- const i = Se((h) => h.cycleMode), c = Co((h) => h.toggleActive), l = Ge();
2243
+ const r = Me((g) => g.cycleMode), i = Co((g) => g.toggleActive), l = Ge();
2244
2244
  ce(() => {
2245
2245
  if (a) return;
2246
- const h = (u) => {
2247
- if (jo(u)) return;
2248
- const r = Jo(u);
2249
- if (u.ctrlKey || u.metaKey) {
2250
- if (r === "z" && !u.shiftKey) {
2251
- u.preventDefault(), s == null || s();
2246
+ const g = (d) => {
2247
+ if (jo(d)) return;
2248
+ const c = Jo(d);
2249
+ if (d.ctrlKey || d.metaKey) {
2250
+ if (c === "z" && !d.shiftKey) {
2251
+ d.preventDefault(), s == null || s();
2252
2252
  return;
2253
2253
  }
2254
- if (r === "z" && u.shiftKey || r === "y") {
2255
- u.preventDefault(), o == null || o();
2254
+ if (c === "z" && d.shiftKey || c === "y") {
2255
+ d.preventDefault(), o == null || o();
2256
2256
  return;
2257
2257
  }
2258
- if (r === "=" || r === "+") {
2259
- u.preventDefault(), l.setZoom({
2258
+ if (c === "=" || c === "+") {
2259
+ d.preventDefault(), l.setZoom({
2260
2260
  level: Math.min(l.level * 1.1, 5),
2261
2261
  width: l.width,
2262
2262
  height: l.height
2263
2263
  });
2264
2264
  return;
2265
2265
  }
2266
- if (r === "-") {
2267
- u.preventDefault(), l.setZoom({
2266
+ if (c === "-") {
2267
+ d.preventDefault(), l.setZoom({
2268
2268
  level: Math.max(l.level / 1.1, 0.1),
2269
2269
  width: l.width,
2270
2270
  height: l.height
2271
2271
  });
2272
2272
  return;
2273
2273
  }
2274
- if (r === "0") {
2275
- u.preventDefault(), l.setZoom({
2274
+ if (c === "0") {
2275
+ d.preventDefault(), l.setZoom({
2276
2276
  level: 1,
2277
2277
  width: l.width,
2278
2278
  height: l.height
@@ -2282,21 +2282,21 @@ function Qo({
2282
2282
  return;
2283
2283
  }
2284
2284
  const { common: m } = J;
2285
- if (r === m.selection) {
2285
+ if (c === m.selection) {
2286
2286
  n("selection");
2287
2287
  return;
2288
2288
  }
2289
- if (r === m.layerToggle) {
2290
- i();
2289
+ if (c === m.layerToggle) {
2290
+ r();
2291
2291
  return;
2292
2292
  }
2293
- if (r === m.navigationToggle) {
2294
- c();
2293
+ if (c === m.navigationToggle) {
2294
+ i();
2295
2295
  return;
2296
2296
  }
2297
2297
  if (!t && e === "Image") {
2298
2298
  const { image: v } = J;
2299
- switch (r) {
2299
+ switch (c) {
2300
2300
  case v.boundingBox:
2301
2301
  n("blankRect");
2302
2302
  return;
@@ -2318,8 +2318,8 @@ function Qo({
2318
2318
  }
2319
2319
  }
2320
2320
  };
2321
- return document.addEventListener("keydown", h), () => {
2322
- document.removeEventListener("keydown", h);
2321
+ return document.addEventListener("keydown", g), () => {
2322
+ document.removeEventListener("keydown", g);
2323
2323
  };
2324
2324
  }, [
2325
2325
  e,
@@ -2328,46 +2328,46 @@ function Qo({
2328
2328
  s,
2329
2329
  o,
2330
2330
  a,
2331
+ r,
2331
2332
  i,
2332
- c,
2333
2333
  l
2334
2334
  ]);
2335
2335
  }
2336
2336
  const es = {
2337
- selection: Tt,
2338
- brush: Qt,
2339
- blankRect: ln,
2337
+ selection: Bt,
2338
+ brush: en,
2339
+ blankRect: dn,
2340
2340
  filledRect: to,
2341
- polygon: sn,
2342
- eraser: en,
2343
- magicbrush: yt,
2344
- superpixel: dn,
2341
+ polygon: an,
2342
+ eraser: tn,
2343
+ magicbrush: bt,
2344
+ superpixel: un,
2345
2345
  segAnything: no
2346
2346
  };
2347
2347
  function ts() {
2348
- const e = Ee((r) => r.tool), t = Ee((r) => r.setTool), n = We((r) => r.colorCode), s = We((r) => r.setColorCode), o = lt((r) => r.opacity), a = lt((r) => r.setOpacity), i = wt((r) => r.brush), c = wt((r) => r.setBrush), l = $(
2349
- (r) => {
2350
- const m = es[r];
2348
+ const e = we((c) => c.tool), t = we((c) => c.setTool), n = We((c) => c.colorCode), s = We((c) => c.setColorCode), o = rt((c) => c.opacity), a = rt((c) => c.setOpacity), r = Lt((c) => c.brush), i = Lt((c) => c.setBrush), l = $(
2349
+ (c) => {
2350
+ const m = es[c];
2351
2351
  m && t(m());
2352
2352
  },
2353
2353
  [t]
2354
- ), h = $(() => {
2354
+ ), g = $(() => {
2355
2355
  t(null);
2356
- }, [t]), u = (e == null ? void 0 : e.id) ?? null;
2356
+ }, [t]), d = (e == null ? void 0 : e.id) ?? null;
2357
2357
  return ve(
2358
2358
  () => ({
2359
- activeToolId: u,
2359
+ activeToolId: d,
2360
2360
  currentTool: e,
2361
2361
  setTool: l,
2362
- clearTool: h,
2362
+ clearTool: g,
2363
2363
  colorCode: n,
2364
2364
  setColorCode: s,
2365
2365
  opacity: o,
2366
2366
  setOpacity: a,
2367
- brush: i,
2368
- setBrush: c
2367
+ brush: r,
2368
+ setBrush: i
2369
2369
  }),
2370
- [u, e, l, h, n, s, o, a, i, c]
2370
+ [d, e, l, g, n, s, o, a, r, i]
2371
2371
  );
2372
2372
  }
2373
2373
  const ns = "lc-workspace-8csim", os = "lc-mainSection-uZv5Q", ss = "lc-canvasArea-zoUW1", as = "lc-canvasSection-aUKNP", is = "lc-imagePanel-ghGQ6", cs = "lc-sidePanel-3s3Nv", Ze = {
@@ -2378,7 +2378,7 @@ const ns = "lc-workspace-8csim", os = "lc-mainSection-uZv5Q", ss = "lc-canvasAre
2378
2378
  imagePanel: is,
2379
2379
  sidePanel: cs
2380
2380
  };
2381
- function Ft({
2381
+ function Xt({
2382
2382
  image: e,
2383
2383
  annotations: t,
2384
2384
  onChange: n,
@@ -2386,23 +2386,23 @@ function Ft({
2386
2386
  width: o,
2387
2387
  height: a
2388
2388
  }) {
2389
- const i = Ce(null), c = Ce(null), [l, h] = re(!1), [u, r] = re({ width: 0, height: 0 }), m = Ce(t);
2389
+ const r = Ce(null), i = Ce(null), [l, g] = re(!1), [d, c] = re({ width: 0, height: 0 }), m = Ce(t);
2390
2390
  m.current = t;
2391
2391
  const v = Ce(n);
2392
2392
  v.current = n;
2393
- const g = Ge(), b = g.setZoom, f = dt((C) => C.setObjects), p = Ee((C) => C.tool), N = We((C) => C.colorCode), Z = wt((C) => C.brush), V = qe((C) => C.mode), D = Bt((C) => C.isValidationMode), k = mn((C) => C.setObjects), { setTool: H } = ts(), w = typeof e == "string" ? e : e.url;
2393
+ const f = Ge(), b = f.setZoom, h = lt((C) => C.setObjects), p = we((C) => C.tool), N = We((C) => C.colorCode), Z = Lt((C) => C.brush), V = qe((C) => C.mode), A = Et((C) => C.isValidationMode), k = gn((C) => C.setObjects), { setTool: H } = ts(), w = typeof e == "string" ? e : e.url;
2394
2394
  return Ko(p, {
2395
2395
  colorCode: N,
2396
2396
  brush: Z,
2397
2397
  imageUrl: w
2398
- }), Qo({
2398
+ }, l), Qo({
2399
2399
  viewMode: V,
2400
- isValidationMode: D,
2400
+ isValidationMode: A,
2401
2401
  setTool: H,
2402
2402
  disabled: s
2403
2403
  }), ce(() => {
2404
2404
  if (s) return;
2405
- let C = !1, E = !1, _ = 0, A = 0;
2405
+ let C = !1, E = !1, _ = 0, D = 0;
2406
2406
  const O = (L) => {
2407
2407
  if (L.code === "Space" && !L.repeat) {
2408
2408
  const M = L.target;
@@ -2419,7 +2419,7 @@ function Ft({
2419
2419
  }
2420
2420
  }, B = (L) => {
2421
2421
  if (!E) return;
2422
- C = !0, _ = L.clientX, A = L.clientY;
2422
+ C = !0, _ = L.clientX, D = L.clientY;
2423
2423
  const M = Q();
2424
2424
  M && (M.defaultCursor = "grabbing", M.hoverCursor = "grabbing");
2425
2425
  }, R = (L) => {
@@ -2428,8 +2428,8 @@ function Ft({
2428
2428
  if (!M) return;
2429
2429
  const Y = M.viewportTransform;
2430
2430
  if (!Y) return;
2431
- const G = L.clientX - _, z = L.clientY - A;
2432
- Y[4] += G, Y[5] += z, M.setViewportTransform(Y), M.requestRenderAll(), _ = L.clientX, A = L.clientY;
2431
+ const G = L.clientX - _, z = L.clientY - D;
2432
+ Y[4] += G, Y[5] += z, M.setViewportTransform(Y), M.requestRenderAll(), _ = L.clientX, D = L.clientY;
2433
2433
  }, x = () => {
2434
2434
  if (!C) return;
2435
2435
  C = !1;
@@ -2443,35 +2443,35 @@ function Ft({
2443
2443
  const Y = L.deltaY, G = M.getZoom(), z = Y > 0 ? Math.max(G / 1.05, 0.1) : Math.min(G * 1.05, 5), q = M.getScenePoint(L);
2444
2444
  M.zoomToPoint(q, z), M.requestRenderAll(), b({
2445
2445
  level: z,
2446
- width: g.width,
2447
- height: g.height
2446
+ width: f.width,
2447
+ height: f.height
2448
2448
  });
2449
2449
  };
2450
2450
  document.addEventListener("keydown", O), document.addEventListener("keyup", y), document.addEventListener("mousedown", B), document.addEventListener("mousemove", R), document.addEventListener("mouseup", x);
2451
- const T = c.current;
2451
+ const T = i.current;
2452
2452
  return T == null || T.addEventListener("wheel", P, { passive: !1 }), () => {
2453
2453
  document.removeEventListener("keydown", O), document.removeEventListener("keyup", y), document.removeEventListener("mousedown", B), document.removeEventListener("mousemove", R), document.removeEventListener("mouseup", x), T == null || T.removeEventListener("wheel", P);
2454
2454
  };
2455
- }, [s, b, g.width, g.height]), ce(() => {
2455
+ }, [s, b, f.width, f.height]), ce(() => {
2456
2456
  if (typeof document > "u") return;
2457
2457
  let C = !1;
2458
2458
  return (async () => {
2459
- if (await On(), C || !i.current) return;
2460
- const _ = await import("fabric"), A = new _.Canvas(i.current, {
2459
+ if (await On(), C || !r.current) return;
2460
+ const _ = await import("fabric"), D = new _.Canvas(r.current, {
2461
2461
  selection: !s,
2462
2462
  preserveObjectStacking: !0
2463
2463
  });
2464
- Rt(A), h(!0);
2464
+ At(D), g(!0);
2465
2465
  const O = await _.FabricImage.fromURL(w, { crossOrigin: "anonymous" });
2466
2466
  if (C) return;
2467
2467
  const y = typeof e == "object" ? e.width : O.width ?? 0, B = typeof e == "object" ? e.height : O.height ?? 0;
2468
- r({ width: y, height: B });
2469
- const R = c.current, x = o ?? (R == null ? void 0 : R.clientWidth) ?? y, P = a ?? (R == null ? void 0 : R.clientHeight) ?? B, T = Math.min(x / (y || 1), P / (B || 1), 1), L = Math.round(y * T), M = Math.round(B * T);
2470
- A.setDimensions({ width: L, height: M }), A.setZoom(T), O.set({ selectable: !1, evented: !1 }), A.backgroundImage = O, A.renderAll(), b({ level: T, width: L, height: M });
2468
+ c({ width: y, height: B });
2469
+ const R = i.current, x = o ?? (R == null ? void 0 : R.clientWidth) ?? y, P = a ?? (R == null ? void 0 : R.clientHeight) ?? B, T = Math.min(x / (y || 1), P / (B || 1), 1), L = Math.round(y * T), M = Math.round(B * T);
2470
+ D.setDimensions({ width: L, height: M }), D.setZoom(T), O.set({ selectable: !1, evented: !1 }), D.backgroundImage = O, D.renderAll(), b({ level: T, width: L, height: M });
2471
2471
  })(), () => {
2472
2472
  C = !0;
2473
2473
  const _ = Q();
2474
- _ && (_.dispose(), Rt(null));
2474
+ _ && (_.dispose(), At(null));
2475
2475
  };
2476
2476
  }, [w]), ce(() => {
2477
2477
  if (!l) return;
@@ -2481,26 +2481,26 @@ function Ft({
2481
2481
  const _ = C.getObjects();
2482
2482
  for (const O of _)
2483
2483
  C.remove(O);
2484
- const A = await import("fabric");
2484
+ const D = await import("fabric");
2485
2485
  for (const O of t) {
2486
- const y = hn(O, u.width, u.height), B = y.type;
2486
+ const y = fn(O, d.width, d.height), B = y.type;
2487
2487
  let R = null;
2488
- B === "rect" ? R = new A.Rect(y) : B === "image" && typeof y.src == "string" ? (R = await A.FabricImage.fromURL(y.src, { crossOrigin: "anonymous" }), R.set(y)) : B === "path" && y.path ? R = new A.Path(y.path, y) : B === "polygon" && y.points && (R = new A.Polygon(y.points, y)), R && (s && R.set({ selectable: !1, evented: !1 }), C.add(R));
2488
+ B === "rect" ? R = new D.Rect(y) : B === "image" && typeof y.src == "string" ? (R = await D.FabricImage.fromURL(y.src, { crossOrigin: "anonymous" }), R.set(y)) : B === "path" && y.path ? R = new D.Path(y.path, y) : B === "polygon" && y.points && (R = new D.Polygon(y.points, y)), R && (s && R.set({ selectable: !1, evented: !1 }), C.add(R));
2489
2489
  }
2490
- C.renderAll(), f(C.getObjects());
2490
+ C.renderAll(), h(C.getObjects());
2491
2491
  })();
2492
- }, [t, l, u.width, u.height, s, f]), ce(() => {
2492
+ }, [t, l, d.width, d.height, s, h]), ce(() => {
2493
2493
  if (!l) return;
2494
2494
  const C = Q();
2495
2495
  if (!C) return;
2496
2496
  const E = async () => {
2497
2497
  var y;
2498
- const A = we(), O = await un(
2499
- A,
2500
- u.width,
2501
- u.height
2498
+ const D = Se(), O = await hn(
2499
+ D,
2500
+ d.width,
2501
+ d.height
2502
2502
  );
2503
- f(A), (y = v.current) == null || y.call(v, {
2503
+ h(D), (y = v.current) == null || y.call(v, {
2504
2504
  annotations: O,
2505
2505
  action: {
2506
2506
  type: "batch",
@@ -2510,19 +2510,19 @@ function Ft({
2510
2510
  }
2511
2511
  });
2512
2512
  }, _ = ["object:added", "object:removed", "object:modified"];
2513
- for (const A of _)
2514
- C.on(A, E);
2513
+ for (const D of _)
2514
+ C.on(D, E);
2515
2515
  return () => {
2516
- for (const A of _)
2517
- C.off(A, E);
2516
+ for (const D of _)
2517
+ C.off(D, E);
2518
2518
  };
2519
- }, [l, u.width, u.height, f]), ce(() => {
2519
+ }, [l, d.width, d.height, h]), ce(() => {
2520
2520
  if (!l) return;
2521
2521
  const C = Q();
2522
2522
  if (!C) return;
2523
2523
  const E = () => {
2524
- const A = C.getActiveObjects();
2525
- k(A);
2524
+ const D = C.getActiveObjects();
2525
+ k(D);
2526
2526
  }, _ = () => {
2527
2527
  k([]);
2528
2528
  };
@@ -2533,7 +2533,7 @@ function Ft({
2533
2533
  if (l)
2534
2534
  return Zn(() => {
2535
2535
  });
2536
- }, [l]), /* @__PURE__ */ d("div", { ref: c, className: Ze.canvasSection, children: /* @__PURE__ */ d("div", { className: Ze.imagePanel, children: /* @__PURE__ */ d("canvas", { ref: i }) }) });
2536
+ }, [l]), /* @__PURE__ */ u("div", { ref: i, className: Ze.canvasSection, children: /* @__PURE__ */ u("div", { className: Ze.imagePanel, children: /* @__PURE__ */ u("canvas", { ref: r }) }) });
2537
2537
  }
2538
2538
  const rs = "lc-textSection-pEESB", ls = "lc-textContent-JGJR8", ds = "lc-segment-RaLhM", us = "lc-emptyState-G-skG", Ye = {
2539
2539
  textSection: rs,
@@ -2546,46 +2546,46 @@ function hs({
2546
2546
  readOnly: t = !1,
2547
2547
  segments: n = []
2548
2548
  }) {
2549
- const s = Ce(null), o = gn((h) => h.setSelectedSegment), a = We((h) => h.colorCode), i = lt((h) => h.opacity), c = $(() => {
2549
+ const s = Ce(null), o = vn((c) => c.setSelectedSegment), a = We((c) => c.colorCode), r = rt((c) => c.opacity), i = $(() => {
2550
2550
  if (t) return;
2551
- const h = window.getSelection();
2552
- if (!h || h.isCollapsed || !s.current) return;
2553
- const u = h.getRangeAt(0), r = s.current;
2554
- if (!r.contains(u.startContainer) || !r.contains(u.endContainer)) return;
2555
- const m = document.createRange();
2556
- m.selectNodeContents(r), m.setEnd(u.startContainer, u.startOffset);
2557
- const v = m.toString().length, g = u.toString(), b = v + g.length;
2558
- b > v && o({
2551
+ const c = window.getSelection();
2552
+ if (!c || c.isCollapsed || !s.current) return;
2553
+ const m = c.getRangeAt(0), v = s.current;
2554
+ if (!v.contains(m.startContainer) || !v.contains(m.endContainer)) return;
2555
+ const f = document.createRange();
2556
+ f.selectNodeContents(v), f.setEnd(m.startContainer, m.startOffset);
2557
+ const b = f.toString().length, h = m.toString(), p = b + h.length;
2558
+ p > b && o({
2559
2559
  key: `${Date.now()}`,
2560
2560
  labelId: null,
2561
2561
  tempId: `temp-${Date.now()}`,
2562
- start: v,
2563
- end: b,
2564
- text: g,
2562
+ start: b,
2563
+ end: p,
2564
+ text: h,
2565
2565
  color: a,
2566
- opacity: i
2567
- }), h.removeAllRanges();
2568
- }, [t, o, a, i]);
2566
+ opacity: r
2567
+ }), c.removeAllRanges();
2568
+ }, [t, o, a, r]);
2569
2569
  if (!e)
2570
- return /* @__PURE__ */ d("div", { className: Ye.textSection, children: /* @__PURE__ */ d("div", { className: Ye.emptyState, children: "No text content" }) });
2571
- const l = fs(e.value, n);
2572
- return /* @__PURE__ */ d("div", { className: Ye.textSection, children: /* @__PURE__ */ d(
2570
+ return /* @__PURE__ */ u("div", { className: Ye.textSection, children: /* @__PURE__ */ u("div", { className: Ye.emptyState, children: "No text content" }) });
2571
+ const l = e.text ?? e.value ?? "", g = n.length > 0 ? n : e.segments ?? [], d = fs(l, g);
2572
+ return /* @__PURE__ */ u("div", { className: Ye.textSection, children: /* @__PURE__ */ u(
2573
2573
  "div",
2574
2574
  {
2575
2575
  ref: s,
2576
2576
  className: Ye.textContent,
2577
- onMouseUp: c,
2578
- children: l
2577
+ onMouseUp: i,
2578
+ children: d
2579
2579
  }
2580
2580
  ) });
2581
2581
  }
2582
2582
  function fs(e, t) {
2583
2583
  if (!t.length) return e;
2584
- const n = [...t].sort((a, i) => a.start - i.start), s = [];
2584
+ const n = [...t].sort((a, r) => a.start - r.start), s = [];
2585
2585
  let o = 0;
2586
2586
  for (const a of n)
2587
2587
  a.start > o && s.push(e.slice(o, a.start)), s.push(
2588
- /* @__PURE__ */ d(
2588
+ /* @__PURE__ */ u(
2589
2589
  "span",
2590
2590
  {
2591
2591
  className: Ye.segment,
@@ -2598,9 +2598,9 @@ function fs(e, t) {
2598
2598
  a.id
2599
2599
  )
2600
2600
  ), o = a.end;
2601
- return o < e.length && s.push(e.slice(o)), /* @__PURE__ */ d(Mt, { children: s });
2601
+ return o < e.length && s.push(e.slice(o)), /* @__PURE__ */ u(It, { children: s });
2602
2602
  }
2603
- const ms = "lc-numberSection-7xT86", gs = "lc-chartArea-hZF-l", vs = "lc-chartPlaceholder-t8mNs", Cs = "lc-dataTable-RjNsV", ps = "lc-emptyState-lK5lO", Ae = {
2603
+ const ms = "lc-numberSection-7xT86", gs = "lc-chartArea-hZF-l", vs = "lc-chartPlaceholder-t8mNs", Cs = "lc-dataTable-RjNsV", ps = "lc-emptyState-lK5lO", He = {
2604
2604
  numberSection: ms,
2605
2605
  chartArea: gs,
2606
2606
  chartPlaceholder: vs,
@@ -2612,49 +2612,53 @@ function bs({
2612
2612
  readOnly: t = !1,
2613
2613
  segments: n = []
2614
2614
  }) {
2615
- const s = vn((h) => h.setSelectedSegment), o = We((h) => h.colorCode), a = $(
2616
- (h) => {
2615
+ const s = Cn((d) => d.setSelectedSegment), o = We((d) => d.colorCode), a = $(
2616
+ (d) => {
2617
2617
  t || s({
2618
2618
  key: `${Date.now()}`,
2619
2619
  labelId: null,
2620
2620
  tempId: `temp-${Date.now()}`,
2621
- start: h,
2622
- end: h,
2621
+ start: d,
2622
+ end: d,
2623
2623
  color: o
2624
2624
  });
2625
2625
  },
2626
2626
  [t, s, o]
2627
2627
  );
2628
2628
  if (!e)
2629
- return /* @__PURE__ */ d("div", { className: Ae.numberSection, children: /* @__PURE__ */ d("div", { className: Ae.emptyState, children: "No number content" }) });
2630
- const { source: i } = e, c = i.columns, l = i.rows;
2631
- return /* @__PURE__ */ S("div", { className: Ae.numberSection, children: [
2632
- /* @__PURE__ */ d("div", { className: Ae.chartArea, children: e.canRender ? /* @__PURE__ */ S("div", { className: Ae.chartPlaceholder, children: [
2629
+ return /* @__PURE__ */ u("div", { className: He.numberSection, children: /* @__PURE__ */ u("div", { className: He.emptyState, children: "No number content" }) });
2630
+ const { source: r } = e, i = n.length > 0 ? n : e.segments ?? [], l = r.columns.map(
2631
+ (d, c) => typeof d == "string" ? { key: String(c), label: d } : d
2632
+ ), g = Array.isArray(r.rows[0]);
2633
+ return /* @__PURE__ */ S("div", { className: He.numberSection, children: [
2634
+ e.canRender && /* @__PURE__ */ u("div", { className: He.chartArea, children: /* @__PURE__ */ S("div", { className: He.chartPlaceholder, children: [
2633
2635
  "Chart (",
2634
- e.mode,
2636
+ e.mode ?? "line",
2635
2637
  ") — rendered by host app"
2636
- ] }) : /* @__PURE__ */ d("div", { className: Ae.chartPlaceholder, children: "Cannot render chart for this data" }) }),
2637
- l.length > 0 && /* @__PURE__ */ d("div", { className: Ae.dataTable, children: /* @__PURE__ */ S("table", { children: [
2638
- /* @__PURE__ */ d("thead", { children: /* @__PURE__ */ S("tr", { children: [
2639
- /* @__PURE__ */ d("th", { children: "#" }),
2640
- c.map((h) => /* @__PURE__ */ d("th", { children: h.label }, h.key))
2638
+ ] }) }),
2639
+ r.rows.length > 0 && /* @__PURE__ */ u("div", { className: He.dataTable, children: /* @__PURE__ */ S("table", { children: [
2640
+ /* @__PURE__ */ u("thead", { children: /* @__PURE__ */ S("tr", { children: [
2641
+ /* @__PURE__ */ u("th", { children: "#" }),
2642
+ l.map((d) => /* @__PURE__ */ u("th", { children: d.label }, d.key))
2641
2643
  ] }) }),
2642
- /* @__PURE__ */ d("tbody", { children: l.map((h, u) => {
2643
- const r = n.some(
2644
- (m) => u >= m.start && u <= m.end
2644
+ /* @__PURE__ */ u("tbody", { children: r.rows.map((d, c) => {
2645
+ const m = i.some(
2646
+ (v) => c >= v.start && c <= v.end
2645
2647
  );
2646
2648
  return /* @__PURE__ */ S(
2647
2649
  "tr",
2648
2650
  {
2649
- "data-selected": r || void 0,
2650
- onClick: () => a(u),
2651
+ "data-selected": m || void 0,
2652
+ onClick: () => a(c),
2651
2653
  style: { cursor: t ? "default" : "pointer" },
2652
2654
  children: [
2653
- /* @__PURE__ */ d("td", { children: u + 1 }),
2654
- c.map((m) => /* @__PURE__ */ d("td", { children: String(h[m.key] ?? "") }, m.key))
2655
+ /* @__PURE__ */ u("td", { children: c + 1 }),
2656
+ l.map((v, f) => /* @__PURE__ */ u("td", { children: String(
2657
+ g ? d[f] ?? "" : d[v.key] ?? ""
2658
+ ) }, v.key))
2655
2659
  ]
2656
2660
  },
2657
- u
2661
+ c
2658
2662
  );
2659
2663
  }) })
2660
2664
  ] }) })
@@ -2676,30 +2680,30 @@ function ks({
2676
2680
  onFileUpload: n
2677
2681
  }) {
2678
2682
  const s = Ce(null), o = $(() => {
2679
- var i;
2680
- (i = s.current) == null || i.click();
2683
+ var r;
2684
+ (r = s.current) == null || r.click();
2681
2685
  }, []), a = $(
2682
- (i) => {
2686
+ (r) => {
2683
2687
  var l;
2684
- const c = (l = i.target.files) == null ? void 0 : l[0];
2685
- c && (n == null || n(c)), i.target.value = "";
2688
+ const i = (l = r.target.files) == null ? void 0 : l[0];
2689
+ i && (n == null || n(i)), r.target.value = "";
2686
2690
  },
2687
2691
  [n]
2688
2692
  );
2689
2693
  return e != null && e.fileName ? /* @__PURE__ */ S("div", { className: xe.fileSection, children: [
2690
- /* @__PURE__ */ d("div", { className: xe.fileIcon, children: /* @__PURE__ */ S("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: [
2691
- /* @__PURE__ */ d("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z" }),
2692
- /* @__PURE__ */ d("polyline", { points: "14 2 14 8 20 8", fill: "none", stroke: "currentColor", strokeWidth: "1.5" })
2694
+ /* @__PURE__ */ u("div", { className: xe.fileIcon, children: /* @__PURE__ */ S("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: [
2695
+ /* @__PURE__ */ u("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z" }),
2696
+ /* @__PURE__ */ u("polyline", { points: "14 2 14 8 20 8", fill: "none", stroke: "currentColor", strokeWidth: "1.5" })
2693
2697
  ] }) }),
2694
- /* @__PURE__ */ d("div", { className: xe.fileName, children: e.fileName }),
2695
- e.fileType && /* @__PURE__ */ d("div", { className: xe.fileType, children: e.fileType })
2696
- ] }) : t ? /* @__PURE__ */ d("div", { className: xe.fileSection, children: /* @__PURE__ */ d("div", { className: xe.emptyState, children: "No file content" }) }) : /* @__PURE__ */ S("div", { className: xe.fileSection, children: [
2698
+ /* @__PURE__ */ u("div", { className: xe.fileName, children: e.fileName }),
2699
+ e.fileType && /* @__PURE__ */ u("div", { className: xe.fileType, children: e.fileType })
2700
+ ] }) : t ? /* @__PURE__ */ u("div", { className: xe.fileSection, children: /* @__PURE__ */ u("div", { className: xe.emptyState, children: "No file content" }) }) : /* @__PURE__ */ S("div", { className: xe.fileSection, children: [
2697
2701
  /* @__PURE__ */ S("div", { className: xe.uploadArea, onClick: o, children: [
2698
- /* @__PURE__ */ d("div", { className: xe.fileIcon, children: /* @__PURE__ */ d("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ d("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) }),
2699
- /* @__PURE__ */ d("div", { className: xe.uploadText, children: "Click to upload file" }),
2700
- /* @__PURE__ */ d("div", { className: xe.uploadHint, children: "or drag and drop" })
2702
+ /* @__PURE__ */ u("div", { className: xe.fileIcon, children: /* @__PURE__ */ u("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ u("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) }),
2703
+ /* @__PURE__ */ u("div", { className: xe.uploadText, children: "Click to upload file" }),
2704
+ /* @__PURE__ */ u("div", { className: xe.uploadHint, children: "or drag and drop" })
2701
2705
  ] }),
2702
- /* @__PURE__ */ d(
2706
+ /* @__PURE__ */ u(
2703
2707
  "input",
2704
2708
  {
2705
2709
  ref: s,
@@ -2717,15 +2721,15 @@ function Os({
2717
2721
  onChange: s,
2718
2722
  readOnly: o = !1,
2719
2723
  textContent: a,
2720
- numberContent: i,
2721
- fileContent: c,
2724
+ numberContent: r,
2725
+ fileContent: i,
2722
2726
  onFileUpload: l,
2723
- children: h
2727
+ children: g
2724
2728
  }) {
2725
2729
  switch (e) {
2726
2730
  case "Image":
2727
- return /* @__PURE__ */ d(
2728
- Ft,
2731
+ return /* @__PURE__ */ u(
2732
+ Xt,
2729
2733
  {
2730
2734
  image: t,
2731
2735
  annotations: n,
@@ -2734,7 +2738,7 @@ function Os({
2734
2738
  }
2735
2739
  );
2736
2740
  case "Text":
2737
- return /* @__PURE__ */ d(
2741
+ return /* @__PURE__ */ u(
2738
2742
  hs,
2739
2743
  {
2740
2744
  content: a,
@@ -2742,27 +2746,27 @@ function Os({
2742
2746
  }
2743
2747
  );
2744
2748
  case "Number":
2745
- return /* @__PURE__ */ d(
2749
+ return /* @__PURE__ */ u(
2746
2750
  bs,
2747
2751
  {
2748
- content: i,
2752
+ content: r,
2749
2753
  readOnly: o
2750
2754
  }
2751
2755
  );
2752
2756
  case "File":
2753
- return /* @__PURE__ */ d(
2757
+ return /* @__PURE__ */ u(
2754
2758
  ks,
2755
2759
  {
2756
- content: c,
2760
+ content: i,
2757
2761
  readOnly: o,
2758
2762
  onFileUpload: l
2759
2763
  }
2760
2764
  );
2761
2765
  case "Record":
2762
- return /* @__PURE__ */ d(Mt, { children: h });
2766
+ return /* @__PURE__ */ u(It, { children: g });
2763
2767
  default:
2764
- return /* @__PURE__ */ d(
2765
- Ft,
2768
+ return /* @__PURE__ */ u(
2769
+ Xt,
2766
2770
  {
2767
2771
  image: t,
2768
2772
  annotations: n,
@@ -2772,14 +2776,14 @@ function Os({
2772
2776
  );
2773
2777
  }
2774
2778
  }
2775
- const Ps = "lc-navigationWrapper-3oNp8", Ts = "lc-title-ozM0E", Bs = "lc-titleUtil-V4RV4", Es = "lc-directionButton-GOUn-", Rs = "lc-content-fBa8N", Ds = "lc-recordList-kWbe2", As = "lc-recordItem-qutOX", Hs = "lc-recordThumbnail-s2bPH", _s = "lc-recordTitle-BtPW7", Vs = "lc-recordStatus--HJxg", Zs = "lc-childrenList-i9Ow3", Us = "lc-searchInput-RI4GW", Ws = "lc-empty-olthD", he = {
2779
+ const Ps = "lc-navigationWrapper-3oNp8", Ts = "lc-title-ozM0E", Bs = "lc-titleUtil-V4RV4", Es = "lc-directionButton-GOUn-", Rs = "lc-content-fBa8N", As = "lc-recordList-kWbe2", Ds = "lc-recordItem-qutOX", Hs = "lc-recordThumbnail-s2bPH", _s = "lc-recordTitle-BtPW7", Vs = "lc-recordStatus--HJxg", Zs = "lc-childrenList-i9Ow3", Us = "lc-searchInput-RI4GW", Ws = "lc-empty-olthD", he = {
2776
2780
  navigationWrapper: Ps,
2777
2781
  title: Ts,
2778
2782
  titleUtil: Bs,
2779
2783
  directionButton: Es,
2780
2784
  content: Rs,
2781
- recordList: Ds,
2782
- recordItem: As,
2785
+ recordList: As,
2786
+ recordItem: Ds,
2783
2787
  recordThumbnail: Hs,
2784
2788
  recordTitle: _s,
2785
2789
  recordStatus: Vs,
@@ -2787,7 +2791,7 @@ const Ps = "lc-navigationWrapper-3oNp8", Ts = "lc-title-ozM0E", Bs = "lc-titleUt
2787
2791
  searchInput: Us,
2788
2792
  empty: Ws
2789
2793
  };
2790
- function Xt({
2794
+ function $t({
2791
2795
  records: e,
2792
2796
  activeRecordId: t,
2793
2797
  onRecordSelect: n,
@@ -2795,92 +2799,92 @@ function Xt({
2795
2799
  onDirectionChange: o,
2796
2800
  hidden: a = !1
2797
2801
  }) {
2798
- const [i, c] = re(""), l = ve(() => {
2799
- if (!i.trim()) return e;
2800
- const r = i.trim().toLowerCase();
2802
+ const [r, i] = re(""), l = ve(() => {
2803
+ if (!r.trim()) return e;
2804
+ const c = r.trim().toLowerCase();
2801
2805
  return e.filter(
2802
2806
  (m) => {
2803
2807
  var v;
2804
- return m.title.toLowerCase().includes(r) || ((v = m.children) == null ? void 0 : v.some((g) => g.title.toLowerCase().includes(r)));
2808
+ return m.title.toLowerCase().includes(c) || ((v = m.children) == null ? void 0 : v.some((f) => f.title.toLowerCase().includes(c)));
2805
2809
  }
2806
2810
  );
2807
- }, [e, i]), h = $((r) => {
2808
- c(r.target.value);
2809
- }, []), u = s === "vertical" ? "bottom" : "left";
2811
+ }, [e, r]), g = $((c) => {
2812
+ i(c.target.value);
2813
+ }, []), d = s === "vertical" ? "bottom" : "left";
2810
2814
  return /* @__PURE__ */ S(
2811
2815
  "div",
2812
2816
  {
2813
2817
  className: he.navigationWrapper,
2814
- "data-position": u,
2818
+ "data-position": d,
2815
2819
  "data-hidden": a || void 0,
2816
2820
  children: [
2817
2821
  /* @__PURE__ */ S("div", { className: he.title, children: [
2818
- /* @__PURE__ */ d("p", { children: "Navigation" }),
2822
+ /* @__PURE__ */ u("p", { children: "Navigation" }),
2819
2823
  o && /* @__PURE__ */ S("div", { className: he.titleUtil, children: [
2820
- /* @__PURE__ */ d(
2824
+ /* @__PURE__ */ u(
2821
2825
  "button",
2822
2826
  {
2823
2827
  className: he.directionButton,
2824
2828
  "data-active": s === "horizontal" || void 0,
2825
2829
  onClick: () => o("horizontal"),
2826
2830
  title: "Side panel",
2827
- children: /* @__PURE__ */ d(Ys, {})
2831
+ children: /* @__PURE__ */ u(Ys, {})
2828
2832
  }
2829
2833
  ),
2830
- /* @__PURE__ */ d(
2834
+ /* @__PURE__ */ u(
2831
2835
  "button",
2832
2836
  {
2833
2837
  className: he.directionButton,
2834
2838
  "data-active": s === "vertical" || void 0,
2835
2839
  onClick: () => o("vertical"),
2836
2840
  title: "Bottom panel",
2837
- children: /* @__PURE__ */ d(zs, {})
2841
+ children: /* @__PURE__ */ u(zs, {})
2838
2842
  }
2839
2843
  )
2840
2844
  ] })
2841
2845
  ] }),
2842
2846
  /* @__PURE__ */ S("div", { className: he.content, children: [
2843
- /* @__PURE__ */ d(
2847
+ /* @__PURE__ */ u(
2844
2848
  "input",
2845
2849
  {
2846
2850
  className: he.searchInput,
2847
2851
  type: "text",
2848
2852
  placeholder: "Search records...",
2849
- value: i,
2850
- onChange: h
2853
+ value: r,
2854
+ onChange: g
2851
2855
  }
2852
2856
  ),
2853
- l.length === 0 ? /* @__PURE__ */ d("div", { className: he.empty, children: "No records found" }) : /* @__PURE__ */ d("div", { className: he.recordList, children: l.map((r) => /* @__PURE__ */ d(
2854
- pn,
2857
+ l.length === 0 ? /* @__PURE__ */ u("div", { className: he.empty, children: "No records found" }) : /* @__PURE__ */ u("div", { className: he.recordList, children: l.map((c) => /* @__PURE__ */ u(
2858
+ bn,
2855
2859
  {
2856
- record: r,
2860
+ record: c,
2857
2861
  activeRecordId: t,
2858
2862
  onRecordSelect: n
2859
2863
  },
2860
- r.id
2864
+ c.id
2861
2865
  )) })
2862
2866
  ] })
2863
2867
  ]
2864
2868
  }
2865
2869
  );
2866
2870
  }
2867
- function pn({
2871
+ function bn({
2868
2872
  record: e,
2869
2873
  activeRecordId: t,
2870
2874
  onRecordSelect: n
2871
2875
  }) {
2872
- const s = e.id === t, o = e.children && e.children.length > 0, [a, i] = re(s || !1), c = $(() => {
2873
- o && i((l) => !l), n(e);
2876
+ const s = e.id === t, o = e.children && e.children.length > 0, [a, r] = re(s || !1), i = $(() => {
2877
+ o && r((l) => !l), n(e);
2874
2878
  }, [o, n, e]);
2875
- return /* @__PURE__ */ S(Mt, { children: [
2879
+ return /* @__PURE__ */ S(It, { children: [
2876
2880
  /* @__PURE__ */ S(
2877
2881
  "div",
2878
2882
  {
2879
2883
  className: he.recordItem,
2880
2884
  "data-active": s || void 0,
2881
- onClick: c,
2885
+ onClick: i,
2882
2886
  children: [
2883
- e.thumbnail && /* @__PURE__ */ d(
2887
+ e.thumbnail && /* @__PURE__ */ u(
2884
2888
  "img",
2885
2889
  {
2886
2890
  className: he.recordThumbnail,
@@ -2888,13 +2892,13 @@ function pn({
2888
2892
  alt: e.title
2889
2893
  }
2890
2894
  ),
2891
- /* @__PURE__ */ d("span", { className: he.recordTitle, children: e.title }),
2892
- e.status && /* @__PURE__ */ d("span", { className: he.recordStatus, "data-status": e.status })
2895
+ /* @__PURE__ */ u("span", { className: he.recordTitle, children: e.title }),
2896
+ e.status && /* @__PURE__ */ u("span", { className: he.recordStatus, "data-status": e.status })
2893
2897
  ]
2894
2898
  }
2895
2899
  ),
2896
- o && a && /* @__PURE__ */ d("div", { className: he.childrenList, children: e.children.map((l) => /* @__PURE__ */ d(
2897
- pn,
2900
+ o && a && /* @__PURE__ */ u("div", { className: he.childrenList, children: e.children.map((l) => /* @__PURE__ */ u(
2901
+ bn,
2898
2902
  {
2899
2903
  record: l,
2900
2904
  activeRecordId: t,
@@ -2906,14 +2910,14 @@ function pn({
2906
2910
  }
2907
2911
  function Ys() {
2908
2912
  return /* @__PURE__ */ S("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: [
2909
- /* @__PURE__ */ d("rect", { x: "1", y: "1", width: "12", height: "12", rx: "1.5", stroke: "currentColor", strokeWidth: "1.2" }),
2910
- /* @__PURE__ */ d("line", { x1: "5", y1: "1", x2: "5", y2: "13", stroke: "currentColor", strokeWidth: "1.2" })
2913
+ /* @__PURE__ */ u("rect", { x: "1", y: "1", width: "12", height: "12", rx: "1.5", stroke: "currentColor", strokeWidth: "1.2" }),
2914
+ /* @__PURE__ */ u("line", { x1: "5", y1: "1", x2: "5", y2: "13", stroke: "currentColor", strokeWidth: "1.2" })
2911
2915
  ] });
2912
2916
  }
2913
2917
  function zs() {
2914
2918
  return /* @__PURE__ */ S("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: [
2915
- /* @__PURE__ */ d("rect", { x: "1", y: "1", width: "12", height: "12", rx: "1.5", stroke: "currentColor", strokeWidth: "1.2" }),
2916
- /* @__PURE__ */ d("line", { x1: "1", y1: "9", x2: "13", y2: "9", stroke: "currentColor", strokeWidth: "1.2" })
2919
+ /* @__PURE__ */ u("rect", { x: "1", y: "1", width: "12", height: "12", rx: "1.5", stroke: "currentColor", strokeWidth: "1.2" }),
2920
+ /* @__PURE__ */ u("line", { x1: "1", y1: "9", x2: "13", y2: "9", stroke: "currentColor", strokeWidth: "1.2" })
2917
2921
  ] });
2918
2922
  }
2919
2923
  const Fs = "lc-infoPanel-mqfKy", Xs = "lc-section-sMcXk", $s = "lc-sectionTitle-XfGbz", Gs = "lc-sectionContent-xsoVh", qs = "lc-tabs-huI9o", Ks = "lc-tab-jbpRb", Js = "lc-classList-mtPXc", js = "lc-classButton-Cdd6v", Qs = "lc-classColorDot-Ravod", ea = "lc-className-yQWn-", ta = "lc-classHotkey-deQqu", na = "lc-labelList-iJvDs", oa = "lc-labelItem-ws-sn", sa = "lc-indicator-6JWmk", aa = "lc-indicatorProgress-5iZVD", ae = {
@@ -2940,97 +2944,97 @@ function ia({
2940
2944
  onClassSelect: s,
2941
2945
  onAnnotationSelect: o,
2942
2946
  onAnnotationDelete: a,
2943
- disabled: i = !1
2947
+ disabled: r = !1
2944
2948
  }) {
2945
2949
  var v;
2946
- const [c, l] = re("class"), [h, u] = re(((v = e[0]) == null ? void 0 : v.id) ?? "");
2950
+ const [i, l] = re("class"), [g, d] = re(((v = e[0]) == null ? void 0 : v.id) ?? "");
2947
2951
  ce(() => {
2948
- e.length > 0 && !e.find((g) => g.id === h) && u(e[0].id);
2949
- }, [e, h]);
2950
- const r = ve(() => {
2951
- const g = /* @__PURE__ */ new Map();
2952
+ e.length > 0 && !e.find((f) => f.id === g) && d(e[0].id);
2953
+ }, [e, g]);
2954
+ const c = ve(() => {
2955
+ const f = /* @__PURE__ */ new Map();
2952
2956
  for (const b of e) {
2953
- const f = b.group ?? "", p = g.get(f) ?? [];
2954
- p.push(b), g.set(f, p);
2957
+ const h = b.group ?? "", p = f.get(h) ?? [];
2958
+ p.push(b), f.set(h, p);
2955
2959
  }
2956
- return g;
2960
+ return f;
2957
2961
  }, [e]), m = $(
2958
- (g) => {
2959
- i || (u(g.id), s == null || s(g));
2962
+ (f) => {
2963
+ r || (d(f.id), s == null || s(f));
2960
2964
  },
2961
- [i, s]
2965
+ [r, s]
2962
2966
  );
2963
2967
  return ce(() => {
2964
- const g = (b) => {
2965
- if (i) return;
2966
- const f = b.target;
2967
- if (f instanceof HTMLElement && (f.tagName === "INPUT" || f.tagName === "TEXTAREA" || f.tagName === "SELECT" || f.isContentEditable))
2968
+ const f = (b) => {
2969
+ if (r) return;
2970
+ const h = b.target;
2971
+ if (h instanceof HTMLElement && (h.tagName === "INPUT" || h.tagName === "TEXTAREA" || h.tagName === "SELECT" || h.isContentEditable))
2968
2972
  return;
2969
2973
  const p = b.key, N = e.find((Z) => Z.hotkey === p);
2970
2974
  N && (b.preventDefault(), m(N));
2971
2975
  };
2972
- return window.addEventListener("keydown", g), () => window.removeEventListener("keydown", g);
2973
- }, [e, i, m]), /* @__PURE__ */ d("div", { className: ae.infoPanel, children: /* @__PURE__ */ S("div", { className: ae.section, children: [
2974
- /* @__PURE__ */ d("div", { className: ae.sectionTitle, children: /* @__PURE__ */ S("div", { className: ae.tabs, children: [
2975
- /* @__PURE__ */ d(
2976
+ return window.addEventListener("keydown", f), () => window.removeEventListener("keydown", f);
2977
+ }, [e, r, m]), /* @__PURE__ */ u("div", { className: ae.infoPanel, children: /* @__PURE__ */ S("div", { className: ae.section, children: [
2978
+ /* @__PURE__ */ u("div", { className: ae.sectionTitle, children: /* @__PURE__ */ S("div", { className: ae.tabs, children: [
2979
+ /* @__PURE__ */ u(
2976
2980
  "button",
2977
2981
  {
2978
2982
  className: ae.tab,
2979
- "data-active": c === "class" || void 0,
2983
+ "data-active": i === "class" || void 0,
2980
2984
  onClick: () => l("class"),
2981
2985
  children: "Class"
2982
2986
  }
2983
2987
  ),
2984
- /* @__PURE__ */ d(
2988
+ /* @__PURE__ */ u(
2985
2989
  "button",
2986
2990
  {
2987
2991
  className: ae.tab,
2988
- "data-active": c === "label" || void 0,
2992
+ "data-active": i === "label" || void 0,
2989
2993
  onClick: () => l("label"),
2990
2994
  children: "Label"
2991
2995
  }
2992
2996
  )
2993
2997
  ] }) }),
2994
- c === "class" && /* @__PURE__ */ d("div", { className: ae.sectionContent, children: /* @__PURE__ */ d("div", { className: ae.classList, children: Array.from(r.entries()).map(([g, b]) => /* @__PURE__ */ S("div", { children: [
2995
- g && /* @__PURE__ */ d("div", { style: { fontSize: "0.75rem", fontWeight: 600, color: "#64748b", padding: "0.25rem 0", marginTop: "0.25rem" }, children: g }),
2996
- b.map((f) => /* @__PURE__ */ S(
2998
+ i === "class" && /* @__PURE__ */ u("div", { className: ae.sectionContent, children: /* @__PURE__ */ u("div", { className: ae.classList, children: Array.from(c.entries()).map(([f, b]) => /* @__PURE__ */ S("div", { children: [
2999
+ f && /* @__PURE__ */ u("div", { style: { fontSize: "0.75rem", fontWeight: 600, color: "#64748b", padding: "0.25rem 0", marginTop: "0.25rem" }, children: f }),
3000
+ b.map((h) => /* @__PURE__ */ S(
2997
3001
  "button",
2998
3002
  {
2999
3003
  className: ae.classButton,
3000
- "data-active": h === f.id || void 0,
3001
- disabled: i,
3002
- onClick: () => m(f),
3004
+ "data-active": g === h.id || void 0,
3005
+ disabled: r,
3006
+ onClick: () => m(h),
3003
3007
  children: [
3004
- /* @__PURE__ */ d(
3008
+ /* @__PURE__ */ u(
3005
3009
  "div",
3006
3010
  {
3007
3011
  className: ae.classColorDot,
3008
- style: { backgroundColor: f.color }
3012
+ style: { backgroundColor: h.color }
3009
3013
  }
3010
3014
  ),
3011
- /* @__PURE__ */ d("span", { className: ae.className, children: f.name }),
3012
- f.hotkey && /* @__PURE__ */ d("span", { className: ae.classHotkey, children: f.hotkey })
3015
+ /* @__PURE__ */ u("span", { className: ae.className, children: h.name }),
3016
+ h.hotkey && /* @__PURE__ */ u("span", { className: ae.classHotkey, children: h.hotkey })
3013
3017
  ]
3014
3018
  },
3015
- f.id
3019
+ h.id
3016
3020
  ))
3017
- ] }, g || "__default")) }) }),
3018
- c === "label" && /* @__PURE__ */ d("div", { className: ae.sectionContent, children: t.length === 0 ? /* @__PURE__ */ d("div", { style: { fontSize: "0.8125rem", color: "#64748b", padding: "1rem 0", textAlign: "center" }, children: "No labels yet" }) : /* @__PURE__ */ d("div", { className: ae.labelList, children: t.map((g) => /* @__PURE__ */ S(
3021
+ ] }, f || "__default")) }) }),
3022
+ i === "label" && /* @__PURE__ */ u("div", { className: ae.sectionContent, children: t.length === 0 ? /* @__PURE__ */ u("div", { style: { fontSize: "0.8125rem", color: "#64748b", padding: "1rem 0", textAlign: "center" }, children: "No labels yet" }) : /* @__PURE__ */ u("div", { className: ae.labelList, children: t.map((f) => /* @__PURE__ */ S(
3019
3023
  "div",
3020
3024
  {
3021
3025
  className: ae.labelItem,
3022
- "data-selected": n === g.id || void 0,
3023
- onClick: () => o == null ? void 0 : o(g),
3026
+ "data-selected": n === f.id || void 0,
3027
+ onClick: () => o == null ? void 0 : o(f),
3024
3028
  children: [
3025
- /* @__PURE__ */ d(
3029
+ /* @__PURE__ */ u(
3026
3030
  "div",
3027
3031
  {
3028
3032
  className: ae.classColorDot,
3029
- style: { backgroundColor: g.style.color, opacity: g.style.opacity }
3033
+ style: { backgroundColor: f.style.color, opacity: f.style.opacity }
3030
3034
  }
3031
3035
  ),
3032
- /* @__PURE__ */ d("p", { children: g.label.name || g.type }),
3033
- a && /* @__PURE__ */ d(
3036
+ /* @__PURE__ */ u("p", { children: f.label.name || f.type }),
3037
+ a && /* @__PURE__ */ u(
3034
3038
  "button",
3035
3039
  {
3036
3040
  style: {
@@ -3043,23 +3047,23 @@ function ia({
3043
3047
  color: "#94a3b8"
3044
3048
  },
3045
3049
  onClick: (b) => {
3046
- b.stopPropagation(), a(g.id);
3050
+ b.stopPropagation(), a(f.id);
3047
3051
  },
3048
3052
  children: "×"
3049
3053
  }
3050
3054
  )
3051
3055
  ]
3052
3056
  },
3053
- g.id
3057
+ f.id
3054
3058
  )) }) })
3055
3059
  ] }) });
3056
3060
  }
3057
3061
  const ca = "sub-tool-panel";
3058
3062
  function Le(e, t = "sm") {
3059
- return Je(fe, { iconType: e, size: t });
3063
+ return Ke(fe, { iconType: e, size: t });
3060
3064
  }
3061
3065
  function ra() {
3062
- const e = Ke((u) => u.tool), t = Ke((u) => u.setTool), n = Se((u) => u.mode), s = Se((u) => u.cycleMode), o = (e == null ? void 0 : e.id) ?? "selection", i = ["magic-brush", "superpixel", "seg-anything"].includes(o), c = o === "superpixel" ? "icon-superpixel" : o === "seg-anything" ? "icon-seg-anything" : "icon-magic-wand", l = n === le.ONLY_ORIGIN ? "icon-bottom-layer" : n === le.ONLY_OVERLAY ? "icon-top-layer" : "icon-all-layer";
3066
+ const e = we((d) => d.tool), t = we((d) => d.setTool), n = Me((d) => d.mode), s = Me((d) => d.cycleMode), o = (e == null ? void 0 : e.id) ?? "selection", r = ["magic-brush", "superpixel", "seg-anything"].includes(o), i = o === "superpixel" ? "icon-superpixel" : o === "seg-anything" ? "icon-seg-anything" : "icon-magic-wand", l = n === le.ONLY_ORIGIN ? "icon-bottom-layer" : n === le.ONLY_OVERLAY ? "icon-top-layer" : "icon-all-layer";
3063
3067
  return { toolbar: [
3064
3068
  // Selection
3065
3069
  {
@@ -3069,7 +3073,7 @@ function ra() {
3069
3073
  icon: Le("icon-selection"),
3070
3074
  title: ee("Selection", J.common.selection),
3071
3075
  checked: o === "selection",
3072
- onClick: () => t(Tt())
3076
+ onClick: () => t(Bt())
3073
3077
  },
3074
3078
  { variant: "divider" },
3075
3079
  // Bounding Box
@@ -3080,7 +3084,7 @@ function ra() {
3080
3084
  icon: Le("icon-borderd-rect"),
3081
3085
  title: ee("Bounding Box", J.image.boundingBox),
3082
3086
  checked: o === "bounded-box",
3083
- onClick: () => t(ln())
3087
+ onClick: () => t(dn())
3084
3088
  },
3085
3089
  // Pen
3086
3090
  {
@@ -3090,7 +3094,7 @@ function ra() {
3090
3094
  icon: Le("icon-pen"),
3091
3095
  title: ee("Pen", J.image.pen),
3092
3096
  checked: o === "polygon",
3093
- onClick: () => t(sn())
3097
+ onClick: () => t(an())
3094
3098
  },
3095
3099
  // Brush
3096
3100
  {
@@ -3100,16 +3104,16 @@ function ra() {
3100
3104
  icon: Le("icon-brush"),
3101
3105
  title: ee("Brush", J.image.brush),
3102
3106
  checked: o === "brush",
3103
- onClick: () => t(Qt())
3107
+ onClick: () => t(en())
3104
3108
  },
3105
3109
  // Intelligent Tools (sub-panel)
3106
3110
  {
3107
3111
  variant: "radio",
3108
3112
  id: ca,
3109
3113
  name: "tool",
3110
- icon: Le(c),
3114
+ icon: Le(i),
3111
3115
  title: "Intelligent Tools",
3112
- checked: i,
3116
+ checked: r,
3113
3117
  subButtonItems: [
3114
3118
  {
3115
3119
  variant: "radio",
@@ -3118,7 +3122,7 @@ function ra() {
3118
3122
  icon: Le("icon-magic-wand"),
3119
3123
  title: ee("Magic Brush", J.image.magicBrush),
3120
3124
  checked: o === "magic-brush",
3121
- onClick: () => t(yt())
3125
+ onClick: () => t(bt())
3122
3126
  },
3123
3127
  {
3124
3128
  variant: "radio",
@@ -3127,7 +3131,7 @@ function ra() {
3127
3131
  icon: Le("icon-superpixel"),
3128
3132
  title: ee("Superpixel", J.image.superpixel),
3129
3133
  checked: o === "superpixel",
3130
- onClick: () => t(dn())
3134
+ onClick: () => t(un())
3131
3135
  },
3132
3136
  {
3133
3137
  variant: "radio",
@@ -3142,7 +3146,7 @@ function ra() {
3142
3146
  }
3143
3147
  ],
3144
3148
  onClick: () => {
3145
- i || t(yt());
3149
+ r || t(bt());
3146
3150
  }
3147
3151
  },
3148
3152
  // Dropdown toggle (slim)
@@ -3163,7 +3167,7 @@ function ra() {
3163
3167
  icon: Le("icon-eraser"),
3164
3168
  title: ee("Eraser", J.image.eraser),
3165
3169
  checked: o === "eraser",
3166
- onClick: () => t(en())
3170
+ onClick: () => t(tn())
3167
3171
  },
3168
3172
  { variant: "divider" },
3169
3173
  // Layer Mode
@@ -3176,17 +3180,17 @@ function ra() {
3176
3180
  }
3177
3181
  ] };
3178
3182
  }
3179
- function ot(e) {
3180
- return Je(fe, { iconType: e, size: "sm" });
3183
+ function nt(e) {
3184
+ return Ke(fe, { iconType: e, size: "sm" });
3181
3185
  }
3182
3186
  function la() {
3183
- const e = Yt((l) => l.tool), t = Yt((l) => l.setTool), n = Se((l) => l.mode), s = Se((l) => l.cycleMode), o = vo(), a = (e == null ? void 0 : e.id) ?? "selection", i = n === le.ONLY_ORIGIN ? "icon-bottom-layer" : n === le.ONLY_OVERLAY ? "icon-top-layer" : "icon-all-layer";
3187
+ const e = zt((l) => l.tool), t = zt((l) => l.setTool), n = Me((l) => l.mode), s = Me((l) => l.cycleMode), o = vo(), a = (e == null ? void 0 : e.id) ?? "selection", r = n === le.ONLY_ORIGIN ? "icon-bottom-layer" : n === le.ONLY_OVERLAY ? "icon-top-layer" : "icon-all-layer";
3184
3188
  return { toolbar: [
3185
3189
  {
3186
3190
  variant: "radio",
3187
3191
  id: "selection",
3188
3192
  name: "tool",
3189
- icon: ot("icon-selection"),
3193
+ icon: nt("icon-selection"),
3190
3194
  title: ee("Selection", J.common.selection),
3191
3195
  checked: a === "selection",
3192
3196
  onClick: () => t({ id: "selection", label: "Selection" })
@@ -3196,7 +3200,7 @@ function la() {
3196
3200
  variant: "radio",
3197
3201
  id: "drag-segment",
3198
3202
  name: "tool",
3199
- icon: ot("icon-highlight"),
3203
+ icon: nt("icon-highlight"),
3200
3204
  title: ee("Highlighting", J.text.highlighting),
3201
3205
  checked: a === "drag-segment",
3202
3206
  onClick: () => t({ id: "drag-segment", label: "Highlighting" })
@@ -3206,7 +3210,7 @@ function la() {
3206
3210
  {
3207
3211
  variant: "button",
3208
3212
  id: "auto-highlight",
3209
- icon: ot("icon-highlight"),
3213
+ icon: nt("icon-highlight"),
3210
3214
  title: ee("Auto Highlight", J.text.autoHighlight),
3211
3215
  subItems: [
3212
3216
  {
@@ -3238,23 +3242,23 @@ function la() {
3238
3242
  {
3239
3243
  variant: "button",
3240
3244
  id: "layer-mode",
3241
- icon: ot(i),
3245
+ icon: nt(r),
3242
3246
  title: ee("Layer", J.common.layerToggle),
3243
3247
  onClick: s
3244
3248
  }
3245
3249
  ] };
3246
3250
  }
3247
- function gt(e) {
3248
- return Je(fe, { iconType: e, size: "sm" });
3251
+ function mt(e) {
3252
+ return Ke(fe, { iconType: e, size: "sm" });
3249
3253
  }
3250
3254
  function da() {
3251
- const e = zt((c) => c.tool), t = zt((c) => c.setTool), n = Se((c) => c.mode), s = Se((c) => c.cycleMode), o = (e == null ? void 0 : e.id) ?? "selection", a = n === le.ONLY_ORIGIN ? "icon-bottom-layer" : n === le.ONLY_OVERLAY ? "icon-top-layer" : "icon-all-layer";
3255
+ const e = Ft((i) => i.tool), t = Ft((i) => i.setTool), n = Me((i) => i.mode), s = Me((i) => i.cycleMode), o = (e == null ? void 0 : e.id) ?? "selection", a = n === le.ONLY_ORIGIN ? "icon-bottom-layer" : n === le.ONLY_OVERLAY ? "icon-top-layer" : "icon-all-layer";
3252
3256
  return { toolbar: [
3253
3257
  {
3254
3258
  variant: "radio",
3255
3259
  id: "selection",
3256
3260
  name: "tool",
3257
- icon: gt("icon-selection"),
3261
+ icon: mt("icon-selection"),
3258
3262
  title: ee("Selection", J.common.selection),
3259
3263
  checked: o === "selection",
3260
3264
  onClick: () => t({ id: "selection", label: "Selection" })
@@ -3264,7 +3268,7 @@ function da() {
3264
3268
  variant: "radio",
3265
3269
  id: "drag-segment",
3266
3270
  name: "tool",
3267
- icon: gt("icon-highlight"),
3271
+ icon: mt("icon-highlight"),
3268
3272
  title: ee("Highlighting", J.number.highlighting),
3269
3273
  checked: o === "drag-segment",
3270
3274
  onClick: () => t({ id: "drag-segment", label: "Highlighting" })
@@ -3273,23 +3277,23 @@ function da() {
3273
3277
  {
3274
3278
  variant: "button",
3275
3279
  id: "layer-mode",
3276
- icon: gt(a),
3280
+ icon: mt(a),
3277
3281
  title: ee("Layer", J.common.layerToggle),
3278
3282
  onClick: s
3279
3283
  }
3280
3284
  ] };
3281
3285
  }
3282
- function $t(e) {
3283
- return Je(fe, { iconType: e, size: "sm" });
3286
+ function Gt(e) {
3287
+ return Ke(fe, { iconType: e, size: "sm" });
3284
3288
  }
3285
3289
  function ua() {
3286
- const e = Se((o) => o.mode), t = Se((o) => o.cycleMode), n = e === le.ONLY_ORIGIN ? "icon-bottom-layer" : e === le.ONLY_OVERLAY ? "icon-top-layer" : "icon-all-layer";
3290
+ const e = Me((o) => o.mode), t = Me((o) => o.cycleMode), n = e === le.ONLY_ORIGIN ? "icon-bottom-layer" : e === le.ONLY_OVERLAY ? "icon-top-layer" : "icon-all-layer";
3287
3291
  return { toolbar: [
3288
3292
  {
3289
3293
  variant: "radio",
3290
3294
  id: "selection",
3291
3295
  name: "tool",
3292
- icon: $t("icon-selection"),
3296
+ icon: Gt("icon-selection"),
3293
3297
  title: ee("Selection", J.common.selection),
3294
3298
  checked: !0,
3295
3299
  onClick: () => {
@@ -3299,7 +3303,7 @@ function ua() {
3299
3303
  {
3300
3304
  variant: "button",
3301
3305
  id: "layer-mode",
3302
- icon: $t(n),
3306
+ icon: Gt(n),
3303
3307
  title: ee("Layer", J.common.layerToggle),
3304
3308
  onClick: t
3305
3309
  }
@@ -3308,26 +3312,26 @@ function ua() {
3308
3312
  function ha() {
3309
3313
  return { toolbar: [] };
3310
3314
  }
3311
- function vt(e) {
3312
- return Je(fe, { iconType: e, size: "sm" });
3315
+ function gt(e) {
3316
+ return Ke(fe, { iconType: e, size: "sm" });
3313
3317
  }
3314
3318
  function fa() {
3315
- const e = Ke((l) => l.tool), t = Ke((l) => l.setTool), n = Se((l) => l.mode), s = Se((l) => l.cycleMode), o = St((l) => l.toggle), a = (e == null ? void 0 : e.id) ?? "selection", i = n === le.ONLY_ORIGIN ? "icon-bottom-layer" : n === le.ONLY_OVERLAY ? "icon-top-layer" : "icon-all-layer";
3319
+ const e = wt((l) => l.tool), t = wt((l) => l.setTool), n = Me((l) => l.mode), s = Me((l) => l.cycleMode), o = St((l) => l.toggle), a = (e == null ? void 0 : e.id) ?? "selection", r = n === le.ONLY_ORIGIN ? "icon-bottom-layer" : n === le.ONLY_OVERLAY ? "icon-top-layer" : "icon-all-layer";
3316
3320
  return { toolbar: [
3317
3321
  {
3318
3322
  variant: "radio",
3319
3323
  id: "selection",
3320
3324
  name: "tool",
3321
- icon: vt("icon-selection"),
3325
+ icon: gt("icon-selection"),
3322
3326
  title: ee("Selection", J.common.selection),
3323
3327
  checked: a === "selection",
3324
- onClick: () => t(Tt())
3328
+ onClick: () => t(Bt())
3325
3329
  },
3326
3330
  { variant: "divider" },
3327
3331
  {
3328
3332
  variant: "button",
3329
3333
  id: "issue",
3330
- icon: vt("icon-issue"),
3334
+ icon: gt("icon-issue"),
3331
3335
  title: ee("Issue", J.validation.issue),
3332
3336
  onClick: o
3333
3337
  },
@@ -3335,16 +3339,16 @@ function fa() {
3335
3339
  {
3336
3340
  variant: "button",
3337
3341
  id: "layer-mode",
3338
- icon: vt(i),
3342
+ icon: gt(r),
3339
3343
  title: ee("Layer", J.common.layerToggle),
3340
3344
  onClick: s
3341
3345
  }
3342
3346
  ] };
3343
3347
  }
3344
3348
  function ma(e, t) {
3345
- const n = ra(), s = la(), o = da(), a = ua(), i = ha(), c = fa();
3349
+ const n = ra(), s = la(), o = da(), a = ua(), r = ha(), i = fa();
3346
3350
  if (t)
3347
- return c;
3351
+ return i;
3348
3352
  switch (e) {
3349
3353
  case "Image":
3350
3354
  return n;
@@ -3355,7 +3359,7 @@ function ma(e, t) {
3355
3359
  case "Record":
3356
3360
  return a;
3357
3361
  case "File":
3358
- return i;
3362
+ return r;
3359
3363
  default:
3360
3364
  return n;
3361
3365
  }
@@ -3377,21 +3381,21 @@ function Sa({
3377
3381
  verticalNav: n = !1,
3378
3382
  children: s
3379
3383
  }) {
3380
- return t ? /* @__PURE__ */ d(
3384
+ return t ? /* @__PURE__ */ u(
3381
3385
  "div",
3382
3386
  {
3383
3387
  className: ge.stickyWrapper,
3384
3388
  "data-vertical-nav": n || void 0,
3385
3389
  children: /* @__PURE__ */ S("div", { className: ge.toolbarWrapper, children: [
3386
- e.map((o, a) => /* @__PURE__ */ d(bn, { item: o }, a)),
3390
+ e.map((o, a) => /* @__PURE__ */ u(yn, { item: o }, a)),
3387
3391
  s
3388
3392
  ] })
3389
3393
  }
3390
3394
  ) : null;
3391
3395
  }
3392
- function bn({ item: e }) {
3396
+ function yn({ item: e }) {
3393
3397
  var t;
3394
- return e.variant === "divider" ? /* @__PURE__ */ d("div", { className: ge.divider }) : e.variant === "radio" ? /* @__PURE__ */ d(
3398
+ return e.variant === "divider" ? /* @__PURE__ */ u("div", { className: ge.divider }) : e.variant === "radio" ? /* @__PURE__ */ u(
3395
3399
  "button",
3396
3400
  {
3397
3401
  className: ge.toolButton,
@@ -3402,7 +3406,7 @@ function bn({ item: e }) {
3402
3406
  children: e.icon
3403
3407
  }
3404
3408
  ) : e.variant === "checkbox" ? /* @__PURE__ */ S("label", { className: ge.checkboxItem, title: e.title, children: [
3405
- /* @__PURE__ */ d(
3409
+ /* @__PURE__ */ u(
3406
3410
  "input",
3407
3411
  {
3408
3412
  type: "checkbox",
@@ -3414,8 +3418,8 @@ function bn({ item: e }) {
3414
3418
  }
3415
3419
  }
3416
3420
  ),
3417
- /* @__PURE__ */ d("span", { className: ge.checkboxLabel, children: e.title })
3418
- ] }) : (t = e.subItems) != null && t.length ? /* @__PURE__ */ d(Ma, { item: e }) : /* @__PURE__ */ d(
3421
+ /* @__PURE__ */ u("span", { className: ge.checkboxLabel, children: e.title })
3422
+ ] }) : (t = e.subItems) != null && t.length ? /* @__PURE__ */ u(Ma, { item: e }) : /* @__PURE__ */ u(
3419
3423
  "button",
3420
3424
  {
3421
3425
  className: `${ge.toolButton} ${e.slim ? ge.toolButtonSlim : ""}`,
@@ -3435,7 +3439,7 @@ function Ma({ item: e }) {
3435
3439
  if (t)
3436
3440
  return window.addEventListener("mousedown", o), () => window.removeEventListener("mousedown", o);
3437
3441
  }, [t, o]), /* @__PURE__ */ S("div", { className: ge.buttonWithSub, ref: s, children: [
3438
- /* @__PURE__ */ d(
3442
+ /* @__PURE__ */ u(
3439
3443
  "button",
3440
3444
  {
3441
3445
  className: `${ge.toolButton} ${e.slim ? ge.toolButtonSlim : ""}`,
@@ -3444,21 +3448,30 @@ function Ma({ item: e }) {
3444
3448
  disabled: e.disabled,
3445
3449
  onClick: () => {
3446
3450
  var a;
3447
- (a = e.onClick) == null || a.call(e), n((i) => !i);
3451
+ (a = e.onClick) == null || a.call(e), n((r) => !r);
3448
3452
  },
3449
3453
  children: e.icon
3450
3454
  }
3451
3455
  ),
3452
- t && e.subItems && /* @__PURE__ */ d("div", { className: ge.subToolbar, children: e.subItems.map((a, i) => /* @__PURE__ */ d(bn, { item: a }, i)) })
3456
+ t && e.subItems && /* @__PURE__ */ u("div", { className: ge.subToolbar, children: e.subItems.map((a, r) => /* @__PURE__ */ u(yn, { item: a }, r)) })
3453
3457
  ] });
3454
3458
  }
3455
3459
  function Ia({ children: e }) {
3456
- const t = qe((a) => a.mode), n = Bt((a) => a.isValidationMode), { toolbar: s } = ma(t, n), o = s.map(yn);
3457
- return /* @__PURE__ */ d(Sa, { items: o, children: e });
3460
+ const t = qe((a) => a.mode), n = Et((a) => a.isValidationMode), { toolbar: s } = ma(t, n), o = s.map(Mt);
3461
+ return /* @__PURE__ */ u(Sa, { items: o, children: e });
3458
3462
  }
3459
- function yn(e) {
3460
- var t;
3461
- return e.variant === "divider" ? { variant: "divider" } : e.variant === "radio" ? {
3463
+ function Mt(e) {
3464
+ var t, n;
3465
+ return e.variant === "divider" ? { variant: "divider" } : e.variant === "radio" ? (t = e.subButtonItems) != null && t.length ? {
3466
+ variant: "button",
3467
+ id: e.id,
3468
+ icon: e.icon,
3469
+ title: e.title,
3470
+ active: e.checked,
3471
+ disabled: e.disabled,
3472
+ onClick: e.onClick,
3473
+ subItems: e.subButtonItems.map(Mt)
3474
+ } : {
3462
3475
  variant: "radio",
3463
3476
  id: e.id,
3464
3477
  name: e.name,
@@ -3485,12 +3498,12 @@ function yn(e) {
3485
3498
  active: e.active,
3486
3499
  slim: e.slim,
3487
3500
  onClick: e.onClick,
3488
- subItems: (t = e.subItems) == null ? void 0 : t.map(yn)
3501
+ subItems: (n = e.subItems) == null ? void 0 : n.map(Mt)
3489
3502
  };
3490
3503
  }
3491
3504
  function Na({ indicator: e }) {
3492
3505
  return e ? /* @__PURE__ */ S("div", { className: ae.indicator, children: [
3493
- /* @__PURE__ */ d("span", { children: e.title }),
3506
+ /* @__PURE__ */ u("span", { children: e.title }),
3494
3507
  e.subtitle && /* @__PURE__ */ S("span", { children: [
3495
3508
  ": ",
3496
3509
  e.subtitle
@@ -3509,7 +3522,7 @@ function Na({ indicator: e }) {
3509
3522
  ] }) : null;
3510
3523
  }
3511
3524
  function ii(e) {
3512
- return /* @__PURE__ */ d(
3525
+ return /* @__PURE__ */ u(
3513
3526
  bo,
3514
3527
  {
3515
3528
  image: e.image,
@@ -3549,15 +3562,15 @@ function ii(e) {
3549
3562
  tools: e.tools,
3550
3563
  theme: e.theme,
3551
3564
  layout: e.layout,
3552
- children: /* @__PURE__ */ d(ka, {})
3565
+ children: /* @__PURE__ */ u(ka, {})
3553
3566
  }
3554
3567
  );
3555
3568
  }
3556
3569
  function ka() {
3557
3570
  const e = po(), t = e.mode === "readonly", n = e.navVisible && e.layout.navigation !== "hidden", s = e.navDirection, o = n && s === "horizontal" ? "with-nav-left" : n && s === "vertical" ? "with-nav-bottom" : void 0;
3558
3571
  return /* @__PURE__ */ S("div", { className: Ze.workspace, "data-layout": o, children: [
3559
- n && s === "horizontal" && /* @__PURE__ */ d(
3560
- Xt,
3572
+ n && s === "horizontal" && /* @__PURE__ */ u(
3573
+ $t,
3561
3574
  {
3562
3575
  records: e.records,
3563
3576
  activeRecordId: e.activeRecordId,
@@ -3567,7 +3580,7 @@ function ka() {
3567
3580
  }
3568
3581
  ),
3569
3582
  /* @__PURE__ */ S("div", { className: Ze.mainSection, children: [
3570
- /* @__PURE__ */ d(
3583
+ /* @__PURE__ */ u(
3571
3584
  Yo,
3572
3585
  {
3573
3586
  viewMode: e.viewMode,
@@ -3590,7 +3603,7 @@ function ka() {
3590
3603
  }
3591
3604
  ),
3592
3605
  /* @__PURE__ */ S("div", { className: Ze.canvasArea, children: [
3593
- /* @__PURE__ */ d(
3606
+ /* @__PURE__ */ u(
3594
3607
  Os,
3595
3608
  {
3596
3609
  viewMode: e.viewMode,
@@ -3604,10 +3617,10 @@ function ka() {
3604
3617
  onFileUpload: e.onFileUpload
3605
3618
  }
3606
3619
  ),
3607
- !t && e.viewMode !== "Record" && e.viewMode !== "File" && /* @__PURE__ */ d(Ia, {}),
3608
- e.indicator && /* @__PURE__ */ d(Na, { indicator: e.indicator })
3620
+ !t && e.viewMode !== "Record" && e.viewMode !== "File" && /* @__PURE__ */ u(Ia, {}),
3621
+ e.indicator && /* @__PURE__ */ u(Na, { indicator: e.indicator })
3609
3622
  ] }),
3610
- /* @__PURE__ */ d("div", { className: Ze.sidePanel, children: /* @__PURE__ */ d(
3623
+ /* @__PURE__ */ u("div", { className: Ze.sidePanel, children: /* @__PURE__ */ u(
3611
3624
  ia,
3612
3625
  {
3613
3626
  classes: e.classes,
@@ -3619,8 +3632,8 @@ function ka() {
3619
3632
  }
3620
3633
  ) })
3621
3634
  ] }),
3622
- n && s === "vertical" && /* @__PURE__ */ d(
3623
- Xt,
3635
+ n && s === "vertical" && /* @__PURE__ */ u(
3636
+ $t,
3624
3637
  {
3625
3638
  records: e.records,
3626
3639
  activeRecordId: e.activeRecordId,
@@ -3631,15 +3644,15 @@ function ka() {
3631
3644
  )
3632
3645
  ] });
3633
3646
  }
3634
- const Oa = "lc-issuePanel-Ji1Oq", Pa = "lc-issuePanelTitle-MnKUa", Ta = "lc-issueCount-xtlWy", Ba = "lc-issueItem-CL2Qq", Ea = "lc-issueHeader-YSNcb", Ra = "lc-issueLabel-K-Klr", Da = "lc-issueBadge-oMlCN", Aa = "lc-issueReason-Pof-O", Ha = "lc-issueDate-PZH2G", _a = "lc-validationActions-qtvXO", Va = "lc-validateButton-mhzNq", Za = "lc-reasonInput-WGZ6m", Ua = "lc-emptyState-4wJWu", ie = {
3647
+ const Oa = "lc-issuePanel-Ji1Oq", Pa = "lc-issuePanelTitle-MnKUa", Ta = "lc-issueCount-xtlWy", Ba = "lc-issueItem-CL2Qq", Ea = "lc-issueHeader-YSNcb", Ra = "lc-issueLabel-K-Klr", Aa = "lc-issueBadge-oMlCN", Da = "lc-issueReason-Pof-O", Ha = "lc-issueDate-PZH2G", _a = "lc-validationActions-qtvXO", Va = "lc-validateButton-mhzNq", Za = "lc-reasonInput-WGZ6m", Ua = "lc-emptyState-4wJWu", ie = {
3635
3648
  issuePanel: Oa,
3636
3649
  issuePanelTitle: Pa,
3637
3650
  issueCount: Ta,
3638
3651
  issueItem: Ba,
3639
3652
  issueHeader: Ea,
3640
3653
  issueLabel: Ra,
3641
- issueBadge: Da,
3642
- issueReason: Aa,
3654
+ issueBadge: Aa,
3655
+ issueReason: Da,
3643
3656
  issueDate: Ha,
3644
3657
  validationActions: _a,
3645
3658
  validateButton: Va,
@@ -3653,9 +3666,9 @@ function ci({
3653
3666
  onAnnotationSelect: s,
3654
3667
  onValidate: o,
3655
3668
  onValidationUpdate: a,
3656
- onValidationDelete: i
3669
+ onValidationDelete: r
3657
3670
  }) {
3658
- const [c, l] = re(""), [h, u] = re(null), r = t.filter((f) => !f.result).length, m = $(async () => {
3671
+ const [i, l] = re(""), [g, d] = re(null), c = t.filter((h) => !h.result).length, m = $(async () => {
3659
3672
  n && await (o == null ? void 0 : o({
3660
3673
  annotationIds: [n],
3661
3674
  result: !0
@@ -3664,78 +3677,78 @@ function ci({
3664
3677
  n && (await (o == null ? void 0 : o({
3665
3678
  annotationIds: [n],
3666
3679
  result: !1,
3667
- reason: c || void 0
3680
+ reason: i || void 0
3668
3681
  })), l(""));
3669
- }, [n, c, o]), g = $(
3670
- async (f) => {
3671
- await (i == null ? void 0 : i({ ids: [f] }));
3682
+ }, [n, i, o]), f = $(
3683
+ async (h) => {
3684
+ await (r == null ? void 0 : r({ ids: [h] }));
3672
3685
  },
3673
- [i]
3686
+ [r]
3674
3687
  ), b = $(
3675
- (f) => f.annotationId ? e.find((p) => p.id === f.annotationId) ?? null : null,
3688
+ (h) => h.annotationId ? e.find((p) => p.id === h.annotationId) ?? null : null,
3676
3689
  [e]
3677
3690
  );
3678
3691
  return /* @__PURE__ */ S("div", { className: ie.issuePanel, children: [
3679
3692
  /* @__PURE__ */ S("div", { className: ie.issuePanelTitle, children: [
3680
- /* @__PURE__ */ d("span", { children: "Validation" }),
3681
- r > 0 && /* @__PURE__ */ S("span", { className: ie.issueCount, children: [
3682
- r,
3693
+ /* @__PURE__ */ u("span", { children: "Validation" }),
3694
+ c > 0 && /* @__PURE__ */ S("span", { className: ie.issueCount, children: [
3695
+ c,
3683
3696
  " issues"
3684
3697
  ] })
3685
3698
  ] }),
3686
- t.length === 0 ? /* @__PURE__ */ d("div", { className: ie.emptyState, children: /* @__PURE__ */ d("p", { children: "No validation results yet" }) }) : t.map((f) => {
3687
- const p = b(f);
3699
+ t.length === 0 ? /* @__PURE__ */ u("div", { className: ie.emptyState, children: /* @__PURE__ */ u("p", { children: "No validation results yet" }) }) : t.map((h) => {
3700
+ const p = b(h);
3688
3701
  return /* @__PURE__ */ S(
3689
3702
  "div",
3690
3703
  {
3691
3704
  className: ie.issueItem,
3692
- "data-selected": h === f.id || void 0,
3693
- "data-result": f.result ? "pass" : "fail",
3705
+ "data-selected": g === h.id || void 0,
3706
+ "data-result": h.result ? "pass" : "fail",
3694
3707
  onClick: () => {
3695
- u(f.id), p && (s == null || s(p));
3708
+ d(h.id), p && (s == null || s(p));
3696
3709
  },
3697
3710
  children: [
3698
3711
  /* @__PURE__ */ S("div", { className: ie.issueHeader, children: [
3699
- /* @__PURE__ */ d("span", { className: ie.issueLabel, children: (p == null ? void 0 : p.label.name) ?? `Annotation ${f.annotationId ?? f.id}` }),
3700
- /* @__PURE__ */ d(
3712
+ /* @__PURE__ */ u("span", { className: ie.issueLabel, children: (p == null ? void 0 : p.label.name) ?? `Annotation ${h.annotationId ?? h.id}` }),
3713
+ /* @__PURE__ */ u(
3701
3714
  "span",
3702
3715
  {
3703
3716
  className: ie.issueBadge,
3704
- "data-result": f.result ? "pass" : "fail",
3705
- children: f.result ? "Pass" : "Fail"
3717
+ "data-result": h.result ? "pass" : "fail",
3718
+ children: h.result ? "Pass" : "Fail"
3706
3719
  }
3707
3720
  )
3708
3721
  ] }),
3709
- f.reason && /* @__PURE__ */ d("p", { className: ie.issueReason, children: f.reason }),
3710
- f.validatedAt && /* @__PURE__ */ d("span", { className: ie.issueDate, children: f.validatedAt }),
3711
- i && /* @__PURE__ */ d(
3722
+ h.reason && /* @__PURE__ */ u("p", { className: ie.issueReason, children: h.reason }),
3723
+ h.validatedAt && /* @__PURE__ */ u("span", { className: ie.issueDate, children: h.validatedAt }),
3724
+ r && /* @__PURE__ */ u(
3712
3725
  "button",
3713
3726
  {
3714
3727
  className: ie.validateButton,
3715
3728
  "data-variant": "secondary",
3716
3729
  style: { marginTop: "0.25rem", padding: "0.25rem 0.5rem", fontSize: "0.75rem" },
3717
3730
  onClick: (N) => {
3718
- N.stopPropagation(), g(f.id);
3731
+ N.stopPropagation(), f(h.id);
3719
3732
  },
3720
3733
  children: "Delete"
3721
3734
  }
3722
3735
  )
3723
3736
  ]
3724
3737
  },
3725
- f.id
3738
+ h.id
3726
3739
  );
3727
3740
  }),
3728
- o && /* @__PURE__ */ d("div", { className: ie.validationActions, children: /* @__PURE__ */ d(
3741
+ o && /* @__PURE__ */ u("div", { className: ie.validationActions, children: /* @__PURE__ */ u(
3729
3742
  "textarea",
3730
3743
  {
3731
3744
  className: ie.reasonInput,
3732
3745
  placeholder: "Reason (optional)...",
3733
- value: c,
3734
- onChange: (f) => l(f.target.value)
3746
+ value: i,
3747
+ onChange: (h) => l(h.target.value)
3735
3748
  }
3736
3749
  ) }),
3737
3750
  o && /* @__PURE__ */ S("div", { className: ie.validationActions, children: [
3738
- /* @__PURE__ */ d(
3751
+ /* @__PURE__ */ u(
3739
3752
  "button",
3740
3753
  {
3741
3754
  className: ie.validateButton,
@@ -3745,7 +3758,7 @@ function ci({
3745
3758
  children: "Approve"
3746
3759
  }
3747
3760
  ),
3748
- /* @__PURE__ */ d(
3761
+ /* @__PURE__ */ u(
3749
3762
  "button",
3750
3763
  {
3751
3764
  className: ie.validateButton,
@@ -3759,51 +3772,51 @@ function ci({
3759
3772
  ] });
3760
3773
  }
3761
3774
  function ri() {
3762
- const e = dt((u) => u.objects), t = dt((u) => u.setObjects), n = Ge((u) => u.level), s = Ge((u) => u.setZoom), o = $(
3763
- async (u, r) => {
3764
- const m = we();
3765
- return un(m, u, r);
3775
+ const e = lt((d) => d.objects), t = lt((d) => d.setObjects), n = Ge((d) => d.level), s = Ge((d) => d.setZoom), o = $(
3776
+ async (d, c) => {
3777
+ const m = Se();
3778
+ return hn(m, d, c);
3766
3779
  },
3767
3780
  []
3768
3781
  ), a = $(
3769
- async (u, r, m) => {
3782
+ async (d, c, m) => {
3770
3783
  const v = Q();
3771
3784
  if (!v) return;
3772
- const g = hn(u, r, m), b = await import("fabric");
3773
- let f = null;
3774
- const p = g.type;
3775
- p === "rect" ? f = new b.Rect(g) : p === "polygon" && g.points ? f = new b.Polygon(g.points, g) : p === "path" && g.path ? f = new b.Path(g.path, g) : p === "image" && typeof g.src == "string" && (f = await b.FabricImage.fromURL(g.src, { crossOrigin: "anonymous" }), f.set(g)), f && (v.add(f), Ne(v), t(v.getObjects()));
3785
+ const f = fn(d, c, m), b = await import("fabric");
3786
+ let h = null;
3787
+ const p = f.type;
3788
+ p === "rect" ? h = new b.Rect(f) : p === "polygon" && f.points ? h = new b.Polygon(f.points, f) : p === "path" && f.path ? h = new b.Path(f.path, f) : p === "image" && typeof f.src == "string" && (h = await b.FabricImage.fromURL(f.src, { crossOrigin: "anonymous" }), h.set(f)), h && (v.add(h), ke(v), t(v.getObjects()));
3776
3789
  },
3777
3790
  [t]
3778
- ), i = $(
3779
- (u) => {
3780
- const r = Q();
3781
- if (!r) return;
3782
- const v = r.getObjects().find((g) => g.unique === u);
3783
- v && (r.remove(v), Ne(r), t(r.getObjects()));
3791
+ ), r = $(
3792
+ (d) => {
3793
+ const c = Q();
3794
+ if (!c) return;
3795
+ const v = c.getObjects().find((f) => f.unique === d);
3796
+ v && (c.remove(v), ke(c), t(c.getObjects()));
3784
3797
  },
3785
3798
  [t]
3786
- ), c = $(() => {
3787
- const u = Q();
3788
- if (!u) return;
3789
- const r = u.getObjects();
3790
- for (const m of r)
3791
- u.remove(m);
3792
- Ne(u), t([]);
3799
+ ), i = $(() => {
3800
+ const d = Q();
3801
+ if (!d) return;
3802
+ const c = d.getObjects();
3803
+ for (const m of c)
3804
+ d.remove(m);
3805
+ ke(d), t([]);
3793
3806
  }, [t]), l = $(
3794
- async (u, r) => {
3795
- const m = await o(u, r), v = Ue();
3807
+ async (d, c) => {
3808
+ const m = await o(d, c), v = Ue();
3796
3809
  return {
3797
3810
  annotations: m,
3798
3811
  canvasJSON: v,
3799
- image: { width: u, height: r }
3812
+ image: { width: d, height: c }
3800
3813
  };
3801
3814
  },
3802
3815
  [o]
3803
- ), h = $(
3804
- (u) => {
3805
- const r = Q();
3806
- r && (r.setZoom(u), Ne(r), s({ level: u, width: r.getWidth(), height: r.getHeight() }));
3816
+ ), g = $(
3817
+ (d) => {
3818
+ const c = Q();
3819
+ c && (c.setZoom(d), ke(c), s({ level: d, width: c.getWidth(), height: c.getHeight() }));
3807
3820
  },
3808
3821
  [s]
3809
3822
  );
@@ -3813,47 +3826,47 @@ function ri() {
3813
3826
  zoom: n,
3814
3827
  getAnnotations: o,
3815
3828
  addAnnotation: a,
3816
- removeAnnotation: i,
3817
- clearCanvas: c,
3829
+ removeAnnotation: r,
3830
+ clearCanvas: i,
3818
3831
  exportState: l,
3819
- setZoomLevel: h
3832
+ setZoomLevel: g
3820
3833
  }),
3821
- [e, n, o, a, i, c, l, h]
3834
+ [e, n, o, a, r, i, l, g]
3822
3835
  );
3823
3836
  }
3824
3837
  function li() {
3825
- const e = Ee((r) => r.undoStack), t = Ee((r) => r.redoStack), n = Ee((r) => r.setUndoStack), s = Ee((r) => r.setRedoStack), o = dt((r) => r.setObjects), a = e.length > 0, i = t.length > 0, c = $(() => {
3826
- const r = Ue(), m = JSON.stringify(r);
3838
+ const e = we((c) => c.undoStack), t = we((c) => c.redoStack), n = we((c) => c.setUndoStack), s = we((c) => c.setRedoStack), o = lt((c) => c.setObjects), a = e.length > 0, r = t.length > 0, i = $(() => {
3839
+ const c = Ue(), m = JSON.stringify(c);
3827
3840
  n([...e, m]), s([]);
3828
3841
  }, [e, n, s]), l = $(async () => {
3829
3842
  if (!a) return;
3830
- const r = Q();
3831
- if (!r) return;
3843
+ const c = Q();
3844
+ if (!c) return;
3832
3845
  const m = JSON.stringify(Ue());
3833
3846
  s([...t, m]);
3834
- const v = [...e], g = v.pop();
3835
- n(v), await r.loadFromJSON(g), Ne(r), o(r.getObjects());
3836
- }, [a, e, t, n, s, o]), h = $(async () => {
3837
- if (!i) return;
3838
- const r = Q();
3847
+ const v = [...e], f = v.pop();
3848
+ n(v), await c.loadFromJSON(f), ke(c), o(c.getObjects());
3849
+ }, [a, e, t, n, s, o]), g = $(async () => {
3839
3850
  if (!r) return;
3851
+ const c = Q();
3852
+ if (!c) return;
3840
3853
  const m = JSON.stringify(Ue());
3841
3854
  n([...e, m]);
3842
- const v = [...t], g = v.pop();
3843
- s(v), await r.loadFromJSON(g), Ne(r), o(r.getObjects());
3844
- }, [i, e, t, n, s, o]), u = $(() => {
3855
+ const v = [...t], f = v.pop();
3856
+ s(v), await c.loadFromJSON(f), ke(c), o(c.getObjects());
3857
+ }, [r, e, t, n, s, o]), d = $(() => {
3845
3858
  n([]), s([]);
3846
3859
  }, [n, s]);
3847
3860
  return ve(
3848
3861
  () => ({
3849
3862
  canUndo: a,
3850
- canRedo: i,
3863
+ canRedo: r,
3851
3864
  undo: l,
3852
- redo: h,
3853
- pushSnapshot: c,
3854
- clear: u
3865
+ redo: g,
3866
+ pushSnapshot: i,
3867
+ clear: d
3855
3868
  }),
3856
- [a, i, l, h, c, u]
3869
+ [a, r, l, g, i, d]
3857
3870
  );
3858
3871
  }
3859
3872
  function di(e) {
@@ -3863,18 +3876,18 @@ function di(e) {
3863
3876
  annotations: s,
3864
3877
  selectedIds: o,
3865
3878
  activeTool: a,
3866
- addAnnotations: i,
3867
- updateAnnotation: c,
3879
+ addAnnotations: r,
3880
+ updateAnnotation: i,
3868
3881
  removeAnnotations: l,
3869
- setTool: h
3870
- } = e, u = ve(
3871
- () => t.filter((f) => f.slot === "tool"),
3882
+ setTool: g
3883
+ } = e, d = ve(
3884
+ () => t.filter((h) => h.slot === "tool"),
3872
3885
  [t]
3873
- ), r = ve(
3874
- () => t.filter((f) => f.slot === "sidePanel"),
3886
+ ), c = ve(
3887
+ () => t.filter((h) => h.slot === "sidePanel"),
3875
3888
  [t]
3876
3889
  ), m = ve(
3877
- () => t.filter((f) => f.slot === "toolbar"),
3890
+ () => t.filter((h) => h.slot === "toolbar"),
3878
3891
  [t]
3879
3892
  ), v = ve(
3880
3893
  () => ({
@@ -3882,70 +3895,70 @@ function di(e) {
3882
3895
  annotations: s,
3883
3896
  selectedIds: o,
3884
3897
  activeTool: a,
3885
- addAnnotations: i,
3886
- updateAnnotation: c,
3898
+ addAnnotations: r,
3899
+ updateAnnotation: i,
3887
3900
  removeAnnotations: l,
3888
- setTool: h,
3901
+ setTool: g,
3889
3902
  canvas: {
3890
3903
  toJSON: () => Ue(),
3891
3904
  getImageDataURL: () => {
3892
- const f = Q();
3893
- return f ? f.toDataURL({ format: "png", multiplier: 1 }) : "";
3905
+ const h = Q();
3906
+ return h ? h.toDataURL({ format: "png", multiplier: 1 }) : "";
3894
3907
  }
3895
3908
  }
3896
3909
  }),
3897
- [n, s, o, a, i, c, l, h]
3898
- ), g = ve(
3899
- () => u.find((f) => f.id === a),
3900
- [u, a]
3901
- ), b = Ce(g == null ? void 0 : g.canvasHandlers);
3902
- return b.current = g == null ? void 0 : g.canvasHandlers, ce(() => {
3903
- const f = Q();
3904
- if (!f || !b.current) return;
3905
- const p = (D) => {
3910
+ [n, s, o, a, r, i, l, g]
3911
+ ), f = ve(
3912
+ () => d.find((h) => h.id === a),
3913
+ [d, a]
3914
+ ), b = Ce(f == null ? void 0 : f.canvasHandlers);
3915
+ return b.current = f == null ? void 0 : f.canvasHandlers, ce(() => {
3916
+ const h = Q();
3917
+ if (!h || !b.current) return;
3918
+ const p = (A) => {
3906
3919
  var H, w, C, E, _;
3907
- const k = ((H = f.getScenePoint) == null ? void 0 : H.call(f, D)) ?? ((w = f.getPointer) == null ? void 0 : w.call(f, D)) ?? { x: 0, y: 0 };
3920
+ const k = ((H = h.getScenePoint) == null ? void 0 : H.call(h, A)) ?? ((w = h.getPointer) == null ? void 0 : w.call(h, A)) ?? { x: 0, y: 0 };
3908
3921
  return {
3909
3922
  x: k.x,
3910
3923
  y: k.y,
3911
- shiftKey: ((C = D.e) == null ? void 0 : C.shiftKey) ?? !1,
3912
- ctrlKey: ((E = D.e) == null ? void 0 : E.ctrlKey) ?? !1,
3913
- altKey: ((_ = D.e) == null ? void 0 : _.altKey) ?? !1
3924
+ shiftKey: ((C = A.e) == null ? void 0 : C.shiftKey) ?? !1,
3925
+ ctrlKey: ((E = A.e) == null ? void 0 : E.ctrlKey) ?? !1,
3926
+ altKey: ((_ = A.e) == null ? void 0 : _.altKey) ?? !1
3914
3927
  };
3915
- }, N = (D) => {
3928
+ }, N = (A) => {
3916
3929
  var k, H;
3917
- return (H = (k = b.current) == null ? void 0 : k.onMouseDown) == null ? void 0 : H.call(k, p(D));
3918
- }, Z = (D) => {
3930
+ return (H = (k = b.current) == null ? void 0 : k.onMouseDown) == null ? void 0 : H.call(k, p(A));
3931
+ }, Z = (A) => {
3919
3932
  var k, H;
3920
- return (H = (k = b.current) == null ? void 0 : k.onMouseMove) == null ? void 0 : H.call(k, p(D));
3921
- }, V = (D) => {
3933
+ return (H = (k = b.current) == null ? void 0 : k.onMouseMove) == null ? void 0 : H.call(k, p(A));
3934
+ }, V = (A) => {
3922
3935
  var k, H;
3923
- return (H = (k = b.current) == null ? void 0 : k.onMouseUp) == null ? void 0 : H.call(k, p(D));
3936
+ return (H = (k = b.current) == null ? void 0 : k.onMouseUp) == null ? void 0 : H.call(k, p(A));
3924
3937
  };
3925
- return f.on("mouse:down", N), f.on("mouse:move", Z), f.on("mouse:up", V), () => {
3926
- f.off("mouse:down", N), f.off("mouse:move", Z), f.off("mouse:up", V);
3938
+ return h.on("mouse:down", N), h.on("mouse:move", Z), h.on("mouse:up", V), () => {
3939
+ h.off("mouse:down", N), h.off("mouse:move", Z), h.off("mouse:up", V);
3927
3940
  };
3928
- }, [g == null ? void 0 : g.id]), {
3941
+ }, [f == null ? void 0 : f.id]), {
3929
3942
  context: v,
3930
- toolExtensions: u,
3931
- sidePanelExtensions: r,
3943
+ toolExtensions: d,
3944
+ sidePanelExtensions: c,
3932
3945
  toolbarExtensions: m,
3933
- activeToolExtension: g
3946
+ activeToolExtension: f
3934
3947
  };
3935
3948
  }
3936
3949
  export {
3937
3950
  In as EXCEPTION_TOOLS,
3938
- Nt as EXPORT_PROPS,
3951
+ kt as EXPORT_PROPS,
3939
3952
  J as LABELING_SHORTCUTS,
3940
3953
  le as LAYER_MODE,
3941
- Ft as LabelingCanvas,
3954
+ Xt as LabelingCanvas,
3942
3955
  ks as LabelingFileSection,
3943
3956
  Sa as LabelingFloatingToolbar,
3944
3957
  fe as LabelingIcon,
3945
3958
  Na as LabelingIndicator,
3946
3959
  ia as LabelingInfoPanel,
3947
3960
  ci as LabelingIssuePanel,
3948
- Xt as LabelingNavigation,
3961
+ $t as LabelingNavigation,
3949
3962
  bs as LabelingNumberSection,
3950
3963
  bo as LabelingProvider,
3951
3964
  hs as LabelingTextSection,
@@ -3957,23 +3970,23 @@ export {
3957
3970
  Fa as TOOL_INFO_BRUSH,
3958
3971
  Xa as TOOL_INFO_COMBINED_LABELS,
3959
3972
  $a as TOOL_INFO_ERASER,
3960
- It as TOOL_INFO_FILLED_BOX,
3973
+ Nt as TOOL_INFO_FILLED_BOX,
3961
3974
  wn as TOOL_INFO_FILLED_POLYGON,
3962
- Ct as TOOL_INFO_MAGIC_BRUSH,
3975
+ vt as TOOL_INFO_MAGIC_BRUSH,
3963
3976
  _e as TOOL_INFO_SUPERPIXEL,
3964
3977
  za as WORKSPACE_VIEW_MODES,
3965
- hn as annotationToFabricProps,
3978
+ fn as annotationToFabricProps,
3966
3979
  mo as basicBrushes,
3967
- Vt as basicColors,
3968
- ln as blankRectTool,
3969
- Qt as brushTool,
3970
- un as canvasToAnnotations,
3971
- nn as createImage,
3980
+ Zt as basicColors,
3981
+ dn as blankRectTool,
3982
+ en as brushTool,
3983
+ hn as canvasToAnnotations,
3984
+ on as createImage,
3972
3985
  ei as createTemporalHistoryStore,
3973
- on as cropAlphaArea,
3986
+ sn as cropAlphaArea,
3974
3987
  Un as emitLabelEvent,
3975
3988
  pe as ensureCanvas,
3976
- en as eraserTool,
3989
+ tn as eraserTool,
3977
3990
  uo as fabricObjectToAnnotation,
3978
3991
  to as filledRectTool,
3979
3992
  ee as formatShortcutTitle,
@@ -3981,30 +3994,30 @@ export {
3981
3994
  Q as getCanvasInstance,
3982
3995
  Ue as getCanvasJSON,
3983
3996
  ni as getImageToolStore,
3984
- we as getLabeledObjects,
3997
+ Se as getLabeledObjects,
3985
3998
  Jo as getLabelingShortcutKey,
3986
3999
  Qa as getToolSelectionStore,
3987
4000
  ti as getViewModeStore,
3988
4001
  On as loadFabric,
3989
- yt as magicbrushTool,
3990
- sn as polygonTool,
3991
- Ne as renderAllSafe,
4002
+ bt as magicbrushTool,
4003
+ an as polygonTool,
4004
+ ke as renderAllSafe,
3992
4005
  no as segmentAnythingTool,
3993
- Tt as selectionTool,
3994
- Rt as setCanvasInstance,
4006
+ Bt as selectionTool,
4007
+ At as setCanvasInstance,
3995
4008
  Ja as setMagicBrushModule,
3996
4009
  ja as setSuperpixelModules,
3997
4010
  Zn as subscribeLabelEvents,
3998
- dn as superpixelTool,
3999
- ct as toHex,
4011
+ un as superpixelTool,
4012
+ it as toHex,
4000
4013
  qa as toRGBAHex,
4001
- tn as toRgba,
4002
- Pt as toRgbaArray,
4014
+ nn as toRgba,
4015
+ Tt as toRgbaArray,
4003
4016
  Ka as transparentBlackPixel,
4004
- wt as useBrushStore,
4005
- dt as useCanvasObjectsStore,
4017
+ Lt as useBrushStore,
4018
+ lt as useCanvasObjectsStore,
4006
4019
  di as useExtensions,
4007
- Ke as useImageToolStore,
4020
+ wt as useImageToolStore,
4008
4021
  St as useIssuePanelStore,
4009
4022
  Qo as useKeyboardShortcuts,
4010
4023
  oi as useLabelBatchStore,
@@ -4015,18 +4028,18 @@ export {
4015
4028
  li as useLabelingHistory,
4016
4029
  ts as useLabelingTools,
4017
4030
  ma as useLabelingUIMeta,
4018
- Se as useLayerModeStore,
4019
- vn as useNumberSegmentSelectionStore,
4020
- zt as useNumberToolStore,
4021
- lt as useOpacityStore,
4031
+ Me as useLayerModeStore,
4032
+ Cn as useNumberSegmentSelectionStore,
4033
+ Ft as useNumberToolStore,
4034
+ rt as useOpacityStore,
4022
4035
  We as usePaletteStore,
4023
- mn as useSelectedObjectsStore,
4036
+ gn as useSelectedObjectsStore,
4024
4037
  vo as useTextAutoHighlightStore,
4025
- gn as useTextSegmentSelectionStore,
4026
- Yt as useTextToolStore,
4038
+ vn as useTextSegmentSelectionStore,
4039
+ zt as useTextToolStore,
4027
4040
  Ko as useToolInit,
4028
- Ee as useToolSelectionStore,
4029
- Bt as useValidationModeStore,
4041
+ we as useToolSelectionStore,
4042
+ Et as useValidationModeStore,
4030
4043
  qe as useViewModeStore,
4031
4044
  Co as useWorkspaceLayoutStore,
4032
4045
  Ge as useZoomStore