@netless/appliance-plugin 1.1.34-beta.2 → 1.1.34

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.
Files changed (47) hide show
  1. package/READMA.zh-CN.md +33 -1
  2. package/README.md +32 -0
  3. package/cdn/cdn.js +1 -1
  4. package/cdn/{subWorker-DhqUsi.js → fullWorker-oI42U9.js} +109 -109
  5. package/cdn/{fullWorker-CuVwdG.js → subWorker-Bk6qRb.js} +109 -109
  6. package/dist/appliance-plugin.js +1 -1
  7. package/dist/appliance-plugin.mjs +1 -1
  8. package/dist/collector/collector.d.ts +0 -1
  9. package/dist/core/autoShape/index.d.ts +12 -0
  10. package/dist/core/autoShape/mapper.d.ts +3 -0
  11. package/dist/core/autoShape/recognizer.d.ts +8 -0
  12. package/dist/core/autoShape/registry.d.ts +2 -0
  13. package/dist/core/autoShape/templates.d.ts +2 -0
  14. package/dist/core/autoShape/types.d.ts +78 -0
  15. package/dist/core/mainEngine.d.ts +9 -1
  16. package/dist/core/tools/pencil.d.ts +3 -0
  17. package/dist/core/types.d.ts +7 -0
  18. package/dist/fullWorker.js +109 -109
  19. package/dist/{index-DD4uosmt.mjs → index-BPFYMff6.mjs} +1040 -1012
  20. package/dist/{index-Djm-u9a7.mjs → index-BTxxBSIk.mjs} +214 -207
  21. package/dist/index-BzcHKXGG.js +1 -0
  22. package/dist/index-CFIySwek.js +1 -0
  23. package/dist/{index-CslUUlge.mjs → index-CIPJM93i.mjs} +2829 -2011
  24. package/dist/{index-CnVA96FG.js → index-DVZBBduh.js} +3 -3
  25. package/dist/plugin/baseApplianceManager.d.ts +1 -2
  26. package/dist/plugin/multi/containerManager.d.ts +7 -0
  27. package/dist/plugin/types.d.ts +24 -0
  28. package/dist/plugin/utils.d.ts +0 -8
  29. package/dist/subWorker.js +109 -109
  30. package/package.json +8 -18
  31. package/dist/assets/fullWorker-CItZoPtX.js +0 -593
  32. package/dist/assets/subWorker-DTQZDdFT.js +0 -593
  33. package/dist/bridge-C4n1zHQZ.mjs +0 -67
  34. package/dist/bridge-DCJjH18X.js +0 -1
  35. package/dist/bridge-runtime.d.ts +0 -11
  36. package/dist/bridge.d.ts +0 -5
  37. package/dist/bridge.js +0 -1
  38. package/dist/bridge.mjs +0 -7
  39. package/dist/index-BZopbcnP.js +0 -1
  40. package/dist/index-Bc6Cv0DB.mjs +0 -15802
  41. package/dist/index-CH_SAlCz.mjs +0 -1255
  42. package/dist/index-CR9Nc39_.js +0 -1
  43. package/dist/index-D8qxABte.mjs +0 -9855
  44. package/dist/index-DjNO25oE.js +0 -1
  45. package/dist/index-Dk4BLxV5.js +0 -3
  46. package/dist/index-DnccF_rY.js +0 -1
  47. package/dist/plugin/external.bridge.d.ts +0 -1
@@ -1,7 +1,7 @@
1
1
  var _e = Object.defineProperty;
2
2
  var Ve = (T, i, t) => i in T ? _e(T, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : T[i] = t;
3
3
  var y = (T, i, t) => Ve(T, typeof i != "symbol" ? i + "" : i, t);
4
- import { g as Jt, _ as Pe, i as te, p as St, e as Tt, D as J, f as E, h as Rt, j as Vt, k as st, P as O, l as W, s as Ht, m as ee, n as Nt, o as se, r as He, q as qe, c as k, t as Mt, u as z, a as w, b as x, v as A, w as G, x as tt, y as $, z as Zt, A as je, B as Ze, C as Ke, F as Qe, G as Je, H as ts, I as es, J as ss, K as X, L as os, M as he, N as Wt, O as We, T as Bt, Q as yt, R as is, U as Le, W as rs, X as ns, Y as ct, Z as _, $ as ut, a0 as as, a1 as cs, a2 as ls, a3 as hs, a4 as bt, a5 as ps, E as Y, a6 as pe, V as de, S as ds } from "./index-Bc6Cv0DB.mjs";
4
+ import { g as Jt, _ as Pe, i as te, p as St, e as Tt, D as J, f as E, h as Rt, j as Vt, k as st, P as O, l as W, s as Ht, m as ee, n as Nt, o as se, r as He, q as qe, c as S, t as Mt, u as z, a as w, b as x, v as A, w as G, x as tt, y as $, z as Zt, A as je, B as Ze, C as Ke, F as Qe, G as Je, H as ts, I as es, J as ss, K as X, L as os, M as he, N as Wt, O as We, T as Bt, Q as yt, R as is, U as Le, W as rs, X as ns, Y as ct, Z as _, $ as ut, a0 as as, a1 as cs, a2 as ls, a3 as hs, a4 as bt, a5 as ps, E as Y, a6 as pe, V as de, S as ds } from "./index-CIPJM93i.mjs";
5
5
  import { Group as j, Path as wt, Sprite as Ce, Rect as Kt, Polyline as ht, Ellipse as us, Label as fs, Scene as oe, Layer as ms } from "spritejs";
6
6
  import it from "clipper-lib";
7
7
  import ie from "lineclip";
@@ -17,7 +17,7 @@ function Ss(T) {
17
17
  return typeof T == "number" || gs(T) && ws(T) == ks;
18
18
  }
19
19
  var Ts = Ss;
20
- const H = /* @__PURE__ */ Jt(Ts);
20
+ const q = /* @__PURE__ */ Jt(Ts);
21
21
  function mt(T, i = !0) {
22
22
  const t = T.length;
23
23
  if (t < 2)
@@ -86,14 +86,14 @@ const et = class et {
86
86
  const r = this.fullLayer.getElementsByName(e) || this.drawLayer && this.drawLayer.getElementsByName(e) || [];
87
87
  if (r.length !== 1)
88
88
  return;
89
- const n = r[0], { pos: a, zIndex: c, scale: l, angle: h, translate: p } = i, d = {};
90
- H(c) && (d.zIndex = c), a && (d.pos = [a[0], a[1]]), l && (d.scale = l), h && (d.rotate = h), p && (d.translate = p), n.attr(d);
91
- const u = n == null ? void 0 : n.getBoundingClientRect();
92
- return u && (t = E(t, {
93
- x: Math.floor(u.x - et.SafeBorderPadding),
94
- y: Math.floor(u.y - et.SafeBorderPadding),
95
- w: Math.floor(u.width + et.SafeBorderPadding * 2),
96
- h: Math.floor(u.height + et.SafeBorderPadding * 2)
89
+ const n = r[0], { pos: a, zIndex: c, scale: l, angle: h, translate: p } = i, u = {};
90
+ q(c) && (u.zIndex = c), a && (u.pos = [a[0], a[1]]), l && (u.scale = l), h && (u.rotate = h), p && (u.translate = p), n.attr(u);
91
+ const d = n == null ? void 0 : n.getBoundingClientRect();
92
+ return d && (t = E(t, {
93
+ x: Math.floor(d.x - et.SafeBorderPadding),
94
+ y: Math.floor(d.y - et.SafeBorderPadding),
95
+ w: Math.floor(d.width + et.SafeBorderPadding * 2),
96
+ h: Math.floor(d.height + et.SafeBorderPadding * 2)
97
97
  })), (o = this.vNodes) == null || o.setInfo(e, {
98
98
  rect: t,
99
99
  centerPos: a
@@ -105,13 +105,13 @@ const et = class et {
105
105
  if (t)
106
106
  try {
107
107
  const c = (r.renderer.glRenderer || r.renderer.canvasRenderer).options.displayRatio, l = e.getBoundingClientRect(), h = l.width * c * r.worldScaling[0], p = l.height * c * r.worldScaling[1];
108
- let d = 1;
109
- (h > this.maxImageWidth || p > this.maxImageHeight) && (d = Math.min(
108
+ let u = 1;
109
+ (h > this.maxImageWidth || p > this.maxImageHeight) && (u = Math.min(
110
110
  this.maxImageWidth / h,
111
111
  this.maxImageHeight / p
112
112
  ));
113
- let u = r.getAttribute("scale");
114
- u = [u[0] * d, u[1] * d];
113
+ let d = r.getAttribute("scale");
114
+ d = [d[0] * u, d[1] * u];
115
115
  const f = r.parent.parent, m = r.getAttribute("translate"), g = this.createVmRenderNode(
116
116
  `${this.workId}_bitMapLayer`,
117
117
  f,
@@ -123,18 +123,18 @@ const et = class et {
123
123
  autoRender: !1,
124
124
  bufferSize: 500
125
125
  },
126
- u,
126
+ d,
127
127
  m
128
- ), I = e.cloneNode(!0);
128
+ ), v = e.cloneNode(!0);
129
129
  if (!s || !s.length)
130
130
  return;
131
- this.addEraserlines(I, s, o, !1), g.appendChild(I);
132
- const S = g.parent;
133
- S.render();
134
- const v = g.renderer.canvasRenderer, L = v.context;
131
+ this.addEraserlines(v, s, o, !1), g.appendChild(v);
132
+ const k = g.parent;
133
+ k.render();
134
+ const I = g.renderer.canvasRenderer, L = I.context;
135
135
  if (!L)
136
136
  return;
137
- const C = v.options.displayRatio, N = I.getBoundingClientRect(), R = {
137
+ const C = I.options.displayRatio, N = v.getBoundingClientRect(), R = {
138
138
  x: N.x,
139
139
  y: N.y,
140
140
  w: N.width,
@@ -146,15 +146,15 @@ const et = class et {
146
146
  h: f.height
147
147
  };
148
148
  if (Rt(R, P) === Vt.outside) {
149
- Q(I, S), f.removeChild(S), this.isDelete = !0;
149
+ Q(v, k), f.removeChild(k), this.isDelete = !0;
150
150
  return;
151
151
  }
152
152
  const D = st(R);
153
153
  D.x = Math.floor(Math.max(R.x, 0)), D.y = Math.floor(Math.max(R.y, 0)), D.w = Math.min(R.x + R.w, f.width) - D.x, D.h = Math.min(R.y + R.h, f.height) - D.y;
154
- const B = this.getGroupRect(D, C), F = B.x, U = B.y, V = B.w, Z = B.h;
155
- let K = L.getImageData(F, U, V, Z);
154
+ const B = this.getGroupRect(D, C), F = B.x, U = B.y, H = B.w, Z = B.h;
155
+ let K = L.getImageData(F, U, H, Z);
156
156
  if (this.isTransparentRectByCanvas(K)) {
157
- Q(I, S), f.removeChild(S), this.isDelete = !0, K = null;
157
+ Q(v, k), f.removeChild(k), this.isDelete = !0, K = null;
158
158
  return;
159
159
  }
160
160
  Q(e, n);
@@ -164,7 +164,7 @@ const et = class et {
164
164
  originRect: R,
165
165
  worldScaling: g.worldScaling
166
166
  });
167
- gt && e.append(gt), Q(I, S), f.removeChild(S), n.deleteTexture(K), K = null;
167
+ gt && e.append(gt), Q(v, k), f.removeChild(k), n.deleteTexture(K), K = null;
168
168
  } catch (a) {
169
169
  console.error("[BaseShapeTool] drawEraserlines error:", a);
170
170
  return;
@@ -193,23 +193,23 @@ const et = class et {
193
193
  for (const o of t) {
194
194
  const { thickness: r, op: n } = o;
195
195
  for (const a of n) {
196
- const c = a.map((u, f) => f % 2 ? u - e[1] : u - e[0]), l = this.computEraserPoints(c, r), h = mt(l, !0), p = {
196
+ const c = a.map((d, f) => f % 2 ? d - e[1] : d - e[0]), l = this.computEraserPoints(c, r), h = mt(l, !0), p = {
197
197
  pos: [0, 0],
198
198
  d: h,
199
199
  fillColor: "rgba(0,0,0,1)"
200
- }, d = new wt(p);
201
- d.addEventListener("beforerender", ({ detail: u }) => {
202
- const f = u.context;
200
+ }, u = new wt(p);
201
+ u.addEventListener("beforerender", ({ detail: d }) => {
202
+ const f = d.context;
203
203
  s ? f.blendFuncSeparate(f.ZERO, f.ZERO, f.ZERO, f.ZERO) : f.globalCompositeOperation = "destination-out";
204
- }), d.addEventListener("afterrender", ({ detail: u }) => {
205
- const f = u.context;
204
+ }), u.addEventListener("afterrender", ({ detail: d }) => {
205
+ const f = d.context;
206
206
  s ? f.blendFuncSeparate(
207
207
  f.SRC_ALPHA,
208
208
  f.ONE_MINUS_SRC_ALPHA,
209
209
  f.ONE,
210
210
  f.ONE_MINUS_SRC_ALPHA
211
211
  ) : f.globalCompositeOperation = "source-over";
212
- }), i.append(d);
212
+ }), i.append(u);
213
213
  }
214
214
  }
215
215
  }
@@ -306,13 +306,13 @@ const et = class et {
306
306
  const s = i.getElementsByName(t);
307
307
  if (s.length)
308
308
  for (const r of s)
309
- e ? oo(e, r, i) : (r.remove(), q(r, i.parent));
309
+ e ? oo(e, r, i) : (r.remove(), V(r, i.parent));
310
310
  else e && i.append(e);
311
311
  this.fullLayer !== this.drawLayer && (this.fullLayer === i ? (o = this.drawLayer) == null || o.getElementsByName(t).forEach((n) => {
312
312
  var a;
313
- n.remove(), q(n, (a = this.drawLayer) == null ? void 0 : a.parent);
313
+ n.remove(), V(n, (a = this.drawLayer) == null ? void 0 : a.parent);
314
314
  }) : this.fullLayer.getElementsByName(t).forEach((n) => {
315
- n.remove(), q(n, this.fullLayer.parent);
315
+ n.remove(), V(n, this.fullLayer.parent);
316
316
  }));
317
317
  }
318
318
  removeDrawCountNodes(i, t) {
@@ -321,10 +321,10 @@ const et = class et {
321
321
  s.id && t && Number(s.id) < t && e.push(s);
322
322
  });
323
323
  for (const s of e)
324
- s.remove(), q(s, i.parent);
324
+ s.remove(), V(s, i.parent);
325
325
  }
326
326
  static updateNodeOpt(i) {
327
- var I;
327
+ var v;
328
328
  const { node: t, opt: e, vNodes: s, willSerializeData: o, targetNode: r } = i, {
329
329
  zIndex: n,
330
330
  translate: a,
@@ -332,21 +332,21 @@ const et = class et {
332
332
  originPoint: l,
333
333
  scenePoint: h,
334
334
  scale: p,
335
- pointMap: d,
336
- thickness: u
335
+ pointMap: u,
336
+ thickness: d
337
337
  } = e;
338
338
  let f;
339
339
  const m = r && st(r) || s.get(t.name);
340
340
  if (!m) return;
341
- H(n) && (t.setAttribute("zIndex", n), m.opt.zIndex = n);
341
+ q(n) && (t.setAttribute("zIndex", n), m.opt.zIndex = n);
342
342
  const g = t.parent;
343
343
  if (g) {
344
344
  if (l && p && r) {
345
- const S = [m.op[0], m.op[1]];
345
+ const k = [m.op[0], m.op[1]];
346
346
  Ht(m.op, h, p, a);
347
- const v = [m.op[0], m.op[1]], L = [
348
- v[0] - S[0],
349
- v[1] - S[1]
347
+ const I = [m.op[0], m.op[1]], L = [
348
+ I[0] - k[0],
349
+ I[1] - k[1]
350
350
  ];
351
351
  if (m.centerPos = [
352
352
  m.centerPos[0] + L[0],
@@ -362,50 +362,50 @@ const et = class et {
362
362
  }
363
363
  } else if (a)
364
364
  if (t.setAttribute("translate", a), m.opt.translate = a, r) {
365
- const S = [
365
+ const k = [
366
366
  a[0] * g.worldScaling[0],
367
367
  a[1] * g.worldScaling[1]
368
368
  ];
369
- f = Nt(m.rect, S), m.rect = f;
369
+ f = Nt(m.rect, k), m.rect = f;
370
370
  } else {
371
- const S = et.getRectFromLayer(g, t.name);
372
- m.rect = S || m.rect;
371
+ const k = et.getRectFromLayer(g, t.name);
372
+ m.rect = k || m.rect;
373
373
  }
374
- else if (H(c))
374
+ else if (q(c))
375
375
  if (t.setAttribute("rotate", c), m.opt.rotate = c, r)
376
376
  f = se(m.rect, c), m.rect = f;
377
377
  else {
378
- const S = et.getRectFromLayer(g, t.name);
379
- m.rect = S || m.rect;
378
+ const k = et.getRectFromLayer(g, t.name);
379
+ m.rect = k || m.rect;
380
380
  }
381
- if (d) {
382
- const S = d.get(t.name);
383
- if (S)
384
- for (let v = 0, L = 0; v < m.op.length; v += 3, L++)
385
- m.op[v] = S[L][0], m.op[v + 1] = S[L][1];
381
+ if (u) {
382
+ const k = u.get(t.name);
383
+ if (k)
384
+ for (let I = 0, L = 0; I < m.op.length; I += 3, L++)
385
+ m.op[I] = k[L][0], m.op[I + 1] = k[L][1];
386
386
  }
387
- if (u && ((I = m == null ? void 0 : m.opt) != null && I.thickness) && (m.opt.thickness = u), o && !(l && p && r)) {
387
+ if (d && ((v = m == null ? void 0 : m.opt) != null && v.thickness) && (m.opt.thickness = d), o && !(l && p && r)) {
388
388
  if (a) {
389
- const S = m.op.map((v, L) => {
389
+ const k = m.op.map((I, L) => {
390
390
  const C = L % 3;
391
- return C === 0 ? v + a[0] : C === 1 ? v + a[1] : v;
391
+ return C === 0 ? I + a[0] : C === 1 ? I + a[1] : I;
392
392
  });
393
- if (m.op = S, m.centerPos = [
393
+ if (m.op = k, m.centerPos = [
394
394
  m.centerPos[0] + a[0],
395
395
  m.centerPos[1] + a[1]
396
396
  ], m != null && m.opt && (m.opt.translate = void 0), m.opt.eraserlines)
397
- for (let v = 0; v < m.opt.eraserlines.length; v++) {
398
- const { op: L } = m.opt.eraserlines[v];
397
+ for (let I = 0; I < m.opt.eraserlines.length; I++) {
398
+ const { op: L } = m.opt.eraserlines[I];
399
399
  for (let C = 0; C < L.length; C++) {
400
400
  const N = L[C].map((R, P) => P % 2 ? R + a[1] : R + a[0]);
401
- m.opt.eraserlines[v].op[C] = N;
401
+ m.opt.eraserlines[I].op[C] = N;
402
402
  }
403
403
  }
404
- } else if (H(c)) {
405
- const S = m.op;
406
- if (He(S, m.centerPos, c), m.op = S, m != null && m.opt && (m.opt.rotate = void 0), m.opt.eraserlines)
407
- for (let v = 0; v < m.opt.eraserlines.length; v++) {
408
- const { op: L } = m.opt.eraserlines[v];
404
+ } else if (q(c)) {
405
+ const k = m.op;
406
+ if (He(k, m.centerPos, c), m.op = k, m != null && m.opt && (m.opt.rotate = void 0), m.opt.eraserlines)
407
+ for (let I = 0; I < m.opt.eraserlines.length; I++) {
408
+ const { op: L } = m.opt.eraserlines[I];
409
409
  for (let C = 0; C < L.length; C++)
410
410
  qe(L[C], m.centerPos, c);
411
411
  }
@@ -435,7 +435,7 @@ const et = class et {
435
435
  }
436
436
  static isWillRefresh(i) {
437
437
  const { toolsType: t, opt: e, node: s, updateOpt: o, willSerializeData: r } = i;
438
- return !!(r && (o.angle || o.translate) || o.thickness && e.thickness && e.thickness !== o.thickness || o.strokeType && e.strokeType && e.strokeType !== o.strokeType || o.originPoint && o.scenePoint && o.scale || o.pointMap && o.pointMap.has(s.name) || t === k.Text && (o.fontSize || o.translate || o.textInfos && o.textInfos.get(s.name)) || t === k.BackgroundSVG && (o.translate || o.scale) || t === k.Image && (o.angle || o.translate || o.scale || o.strokeColor && e.type === Mt.Iconify) || t === o.toolsType && o.willRefresh || e.eraserlines && e.eraserlines.length && (o.strokeColor || o.fillColor));
438
+ return !!(r && (o.angle || o.translate) || o.thickness && e.thickness && e.thickness !== o.thickness || o.strokeType && e.strokeType && e.strokeType !== o.strokeType || o.originPoint && o.scenePoint && o.scale || o.pointMap && o.pointMap.has(s.name) || t === S.Text && (o.fontSize || o.translate || o.textInfos && o.textInfos.get(s.name)) || t === S.BackgroundSVG && (o.translate || o.scale) || t === S.Image && (o.angle || o.translate || o.scale || o.strokeColor && e.type === Mt.Iconify) || t === o.toolsType && o.willRefresh || e.eraserlines && e.eraserlines.length && (o.strokeColor || o.fillColor));
439
439
  }
440
440
  };
441
441
  y(et, "SafeBorderPadding", 10);
@@ -487,10 +487,10 @@ function Ls(T, i) {
487
487
  const r = s.map((n) => {
488
488
  let a = -1, c = 1 / 0, l = 0;
489
489
  for (let h = 0; h < i.length; h++) {
490
- const p = i[h], d = Math.sqrt(
490
+ const p = i[h], u = Math.sqrt(
491
491
  Math.pow(p.x - n[0], 2) + Math.pow(p.y - n[1], 2)
492
492
  );
493
- d < c && (c = d, a = h, l = p.z);
493
+ u < c && (c = u, a = h, l = p.z);
494
494
  }
495
495
  return { point: n, index: a, bestZ: l };
496
496
  }).sort((n, a) => n.index - a.index).map((n) => [...n.point, n.bestZ]);
@@ -501,9 +501,9 @@ function Ls(T, i) {
501
501
  });
502
502
  }
503
503
  function Cs(T, i, t = 0.01) {
504
- const s = T.map((h) => [h.x, h.y]), o = (h, p) => h.map(([d, u]) => ({
505
- X: Math.round(d * p),
506
- Y: Math.round(u * p)
504
+ const s = T.map((h) => [h.x, h.y]), o = (h, p) => h.map(([u, d]) => ({
505
+ X: Math.round(u * p),
506
+ Y: Math.round(d * p)
507
507
  })), r = new it.ClipperOffset();
508
508
  r.AddPath(
509
509
  o(s, 1e3),
@@ -548,7 +548,7 @@ class Ne extends b {
548
548
  super(t);
549
549
  y(this, "canRotate", !0);
550
550
  y(this, "scaleType", z.all);
551
- y(this, "toolsType", k.Pencil);
551
+ y(this, "toolsType", S.Pencil);
552
552
  y(this, "syncTimestamp");
553
553
  y(this, "syncIndex", 0);
554
554
  y(this, "tmpPoints", []);
@@ -592,32 +592,34 @@ class Ne extends b {
592
592
  isSimpleWorker: c
593
593
  } = t, { workId: l, syncUnitTime: h } = e;
594
594
  h && (this.syncUnitTime = h);
595
- const { tasks: p, effects: d, consumeIndex: u } = this.transformData(e, !1);
595
+ const { tasks: p, effects: u, consumeIndex: d } = this.transformData(e, !1);
596
596
  this.syncIndex = Math.min(
597
597
  this.syncIndex,
598
- u,
598
+ d,
599
599
  Math.max(0, this.tmpPoints.length - 2)
600
600
  );
601
601
  const f = {
602
602
  name: l,
603
- id: H(n) && n.toString() || void 0
603
+ id: q(n) && n.toString() || void 0
604
604
  };
605
605
  let m, g = !1;
606
- const I = this.syncIndex;
606
+ const v = this.syncIndex;
607
607
  if (this.syncTimestamp === 0 && (this.syncTimestamp = Date.now()), p.length && (p[0].taskId - this.syncTimestamp > this.syncUnitTime && (g = !0, this.syncTimestamp = p[0].taskId, this.syncIndex = this.tmpPoints.length), o || r || c)) {
608
- const v = s ? this.fullLayer : this.drawLayer || this.fullLayer;
609
- m = this.draw({ attrs: f, tasks: p, effects: d, layer: v, removeDrawCount: a });
608
+ const L = s ? this.fullLayer : this.drawLayer || this.fullLayer;
609
+ m = this.draw({ attrs: f, tasks: p, effects: u, layer: L, removeDrawCount: a });
610
610
  }
611
611
  if (c) {
612
- const v = [];
613
- return this.tmpPoints.slice(I).forEach((L) => {
614
- v.push(L.x, L.y, this.computRadius(L.z, this.workOptions.thickness));
615
- }), {
612
+ const L = [];
613
+ this.tmpPoints.slice(v).forEach((N) => {
614
+ L.push(N.x, N.y, this.computRadius(N.z, this.workOptions.thickness));
615
+ });
616
+ const C = !this.workOptions.previewLocalOnly && g;
617
+ return {
616
618
  ...this.baseConsumeResult,
617
619
  type: w.DrawWork,
618
620
  dataType: x.Local,
619
- op: g ? v : void 0,
620
- index: g ? I * 3 : void 0,
621
+ op: C ? L : void 0,
622
+ index: C ? v * 3 : void 0,
621
623
  rect: m,
622
624
  updateNodeOpt: {
623
625
  useAnimation: !0
@@ -625,21 +627,23 @@ class Ne extends b {
625
627
  };
626
628
  }
627
629
  if (o)
628
- return u > 10 && this.tmpPoints.splice(0, u - 10), {
630
+ return d > 10 && this.tmpPoints.splice(0, d - 10), {
629
631
  rect: m,
630
632
  type: w.DrawWork,
631
633
  dataType: x.Local
632
634
  };
633
- const S = [];
634
- return this.tmpPoints.slice(I).forEach((v) => {
635
- S.push(v.x, v.y, this.computRadius(v.z, this.workOptions.thickness));
636
- }), {
635
+ const k = [];
636
+ this.tmpPoints.slice(v).forEach((L) => {
637
+ k.push(L.x, L.y, this.computRadius(L.z, this.workOptions.thickness));
638
+ });
639
+ const I = !this.workOptions.previewLocalOnly && g;
640
+ return {
637
641
  ...this.baseConsumeResult,
638
642
  type: w.DrawWork,
639
643
  dataType: x.Local,
640
644
  rect: m,
641
- op: g ? S : void 0,
642
- index: g ? I * 3 : void 0,
645
+ op: I ? k : void 0,
646
+ index: I ? v * 3 : void 0,
643
647
  updateNodeOpt: {
644
648
  useAnimation: !0
645
649
  }
@@ -700,13 +704,13 @@ class Ne extends b {
700
704
  workState: r = A.Done
701
705
  } = t;
702
706
  this.tmpPoints.length = 0;
703
- for (let d = 0; d < e.length; d += 3) {
704
- const u = new O(e[d], e[d + 1], e[d + 2]);
707
+ for (let u = 0; u < e.length; u += 3) {
708
+ const d = new O(e[u], e[u + 1], e[u + 2]);
705
709
  if (this.tmpPoints.length > 0) {
706
- const f = this.tmpPoints[this.tmpPoints.length - 1], m = W.Sub(u, f).uni();
707
- u.setv(m);
710
+ const f = this.tmpPoints[this.tmpPoints.length - 1], m = W.Sub(d, f).uni();
711
+ d.setv(m);
708
712
  }
709
- this.tmpPoints.push(u);
713
+ this.tmpPoints.push(d);
710
714
  }
711
715
  if (this.tmpPoints.length < 2)
712
716
  return;
@@ -715,12 +719,12 @@ class Ne extends b {
715
719
  };
716
720
  let l;
717
721
  if (a && n.length) {
718
- const d = s ? this.fullLayer : this.drawLayer || this.fullLayer;
722
+ const u = s ? this.fullLayer : this.drawLayer || this.fullLayer;
719
723
  l = this.draw({
720
724
  attrs: c,
721
725
  tasks: n,
722
726
  replaceId: o,
723
- layer: d,
727
+ layer: u,
724
728
  isDrawEraserlines: r === A.Done
725
729
  }), (p = this.vNodes) == null || p.setInfo(a, {
726
730
  rect: l,
@@ -729,7 +733,7 @@ class Ne extends b {
729
733
  toolsType: this.toolsType,
730
734
  scaleType: this.scaleType,
731
735
  canRotate: this.canRotate,
732
- centerPos: l && b.getCenterPos(l, d)
736
+ centerPos: l && b.getCenterPos(l, u)
733
737
  });
734
738
  }
735
739
  return l;
@@ -750,17 +754,17 @@ class Ne extends b {
750
754
  const n = this.transformDataAll(!0);
751
755
  if (n.length)
752
756
  for (let a = 0; a < n.length; a++) {
753
- const { pos: c, points: l } = n[a], h = l.map((u) => u.point.addXY(c[0], c[1])), p = [];
754
- for (const u of o) {
757
+ const { pos: c, points: l } = n[a], h = l.map((d) => d.point.addXY(c[0], c[1])), p = [];
758
+ for (const d of o) {
755
759
  const f = [];
756
- for (let g = 0; g < u.length; g += 2) {
757
- const I = new O(u[g], u[g + 1]);
760
+ for (let g = 0; g < d.length; g += 2) {
761
+ const v = new O(d[g], d[g + 1]);
758
762
  if (f.length > 0) {
759
- const S = f[f.length - 1].point, v = W.Sub(I, S).uni();
760
- I.setv(v);
763
+ const k = f[f.length - 1].point, I = W.Sub(v, k).uni();
764
+ v.setv(I);
761
765
  }
762
766
  f.push({
763
- point: I,
767
+ point: v,
764
768
  radius: r
765
769
  });
766
770
  }
@@ -771,8 +775,8 @@ class Ne extends b {
771
775
  h,
772
776
  p,
773
777
  0.01
774
- ).forEach((u) => {
775
- e.push(u.map((f) => [f[0], f[1], f[2]]).flat(1));
778
+ ).forEach((d) => {
779
+ e.push(d.map((f) => [f[0], f[1], f[2]]).flat(1));
776
780
  });
777
781
  }
778
782
  return e;
@@ -796,41 +800,41 @@ class Ne extends b {
796
800
  strokeColor: l,
797
801
  strokeType: h,
798
802
  thickness: p,
799
- zIndex: d,
800
- scale: u,
803
+ zIndex: u,
804
+ scale: d,
801
805
  rotate: f,
802
806
  translate: m,
803
807
  eraserlines: g,
804
- lineCap: I,
805
- lineDash: S
808
+ lineCap: v,
809
+ lineDash: k
806
810
  } = this.workOptions;
807
811
  r != null && r.size && (r.forEach((P) => {
808
812
  var M;
809
813
  (M = n.getElementById(P + "")) == null || M.remove();
810
814
  }), r.clear()), a && this.removeDrawCountNodes(n, a);
811
- let v;
815
+ let I;
812
816
  const L = [], C = n.worldPosition, N = n.worldScaling;
813
817
  for (let P = 0; P < s.length; P++) {
814
818
  const { pos: M, points: D } = s[P], { ps: B, rect: F } = this.computDrawPoints(D);
815
819
  let U;
816
- const V = D.length === 1;
817
- h === G.Stroke || V ? U = mt(B, !0) : U = mt(B, !1);
820
+ const H = D.length === 1;
821
+ h === G.Stroke || H ? U = mt(B, !0) : U = mt(B, !1);
818
822
  const Z = {
819
823
  pos: M,
820
824
  d: U,
821
- fillColor: h === G.Stroke || V ? l : void 0,
822
- lineDash: V ? void 0 : h === G.Dotted ? [
823
- S && S[0] || 1,
824
- (S && S[1] || 2) * p
825
+ fillColor: h === G.Stroke || H ? l : void 0,
826
+ lineDash: H ? void 0 : h === G.Dotted ? [
827
+ k && k[0] || 1,
828
+ (k && k[1] || 2) * p
825
829
  ] : h === G.LongDotted ? [
826
- (S && S[0] || 1) * p,
827
- (S && S[1] || 2) * p
830
+ (k && k[0] || 1) * p,
831
+ (k && k[1] || 2) * p
828
832
  ] : void 0,
829
833
  strokeColor: l,
830
- lineCap: V ? void 0 : I,
831
- lineWidth: h === G.Stroke || V ? 0 : p
834
+ lineCap: H ? void 0 : v,
835
+ lineWidth: h === G.Stroke || H ? 0 : p
832
836
  };
833
- v = E(v, {
837
+ I = E(I, {
834
838
  x: Math.floor(
835
839
  (F.x + M[0]) * N[0] + C[0] - b.SafeBorderPadding
836
840
  ),
@@ -845,10 +849,10 @@ class Ne extends b {
845
849
  )
846
850
  }), L.push(Z);
847
851
  }
848
- u && (e.scale = u), f && (e.rotate = f), m && (e.translate = m);
852
+ d && (e.scale = d), f && (e.rotate = f), m && (e.translate = m);
849
853
  const R = new j();
850
- if (v) {
851
- this.centerPos = b.getCenterPos(v, n);
854
+ if (I) {
855
+ this.centerPos = b.getCenterPos(I, n);
852
856
  const P = h === G.Stroke && !g;
853
857
  R.attr({
854
858
  ...e,
@@ -857,10 +861,10 @@ class Ne extends b {
857
861
  bgcolor: P ? l : void 0,
858
862
  pos: this.centerPos,
859
863
  size: [
860
- (v.w - 2 * b.SafeBorderPadding) / N[0],
861
- (v.h - 2 * b.SafeBorderPadding) / N[1]
864
+ (I.w - 2 * b.SafeBorderPadding) / N[0],
865
+ (I.h - 2 * b.SafeBorderPadding) / N[1]
862
866
  ],
863
- zIndex: d
867
+ zIndex: u
864
868
  });
865
869
  const M = L.map((D) => (D.pos = [
866
870
  D.pos[0] - this.centerPos[0],
@@ -876,16 +880,16 @@ class Ne extends b {
876
880
  c
877
881
  )), this.replace(n, o, R);
878
882
  }
879
- if (u || f || m) {
883
+ if (d || f || m) {
880
884
  const P = R == null ? void 0 : R.getBoundingClientRect();
881
- P && (v = {
885
+ P && (I = {
882
886
  x: Math.floor(P.x - b.SafeBorderPadding),
883
887
  y: Math.floor(P.y - b.SafeBorderPadding),
884
888
  w: Math.floor(P.width + b.SafeBorderPadding * 2),
885
889
  h: Math.floor(P.height + b.SafeBorderPadding * 2)
886
890
  });
887
891
  }
888
- return this.isDelete && R.setAttribute("opacity", 0), v;
892
+ return this.isDelete && R.setAttribute("opacity", 0), I;
889
893
  }
890
894
  computDrawPoints(t) {
891
895
  return this.workOptions.strokeType === G.Stroke || t.length === 1 ? this.computStroke(t) : this.computNomal(t);
@@ -959,9 +963,9 @@ class Ne extends b {
959
963
  return [];
960
964
  let o = 0, r = t[0].x, n = t[0].y, a = [r, n], c = [], l = t[0].t;
961
965
  for (; o < t.length; ) {
962
- const p = t[o], d = p.x - r, u = p.y - n, f = p.z, m = e ? this.computRadius(f, e) : f;
966
+ const p = t[o], u = p.x - r, d = p.y - n, f = p.z, m = e ? this.computRadius(f, e) : f;
963
967
  if (c.push({
964
- point: new O(d, u, f, t[o].v),
968
+ point: new O(u, d, f, t[o].v),
965
969
  radius: m
966
970
  }), o > 0 && o < t.length - 1) {
967
971
  const g = t[o].getAngleByPoints(
@@ -969,22 +973,22 @@ class Ne extends b {
969
973
  t[o + 1]
970
974
  );
971
975
  if (g < 60 || g > 300) {
972
- const I = (h = c.pop()) == null ? void 0 : h.point.clone();
973
- I && s.push({
976
+ const v = (h = c.pop()) == null ? void 0 : h.point.clone();
977
+ v && s.push({
974
978
  taskId: l,
975
979
  pos: a,
976
980
  points: [
977
981
  ...c,
978
982
  {
979
- point: I,
983
+ point: v,
980
984
  radius: m
981
985
  }
982
986
  ]
983
987
  }), r = t[o].x, n = t[o].y, a = [r, n];
984
- const S = p.x - r, v = p.y - n;
988
+ const k = p.x - r, I = p.y - n;
985
989
  c = [
986
990
  {
987
- point: new O(S, v, f),
991
+ point: new O(k, I, f),
988
992
  radius: m
989
993
  }
990
994
  ], l = Date.now();
@@ -1011,30 +1015,30 @@ class Ne extends b {
1011
1015
  this.tmpPoints.push(h);
1012
1016
  continue;
1013
1017
  }
1014
- const p = l - 1, d = this.tmpPoints[p], u = W.Sub(h, d).uni();
1015
- if (h.isNear(d, e)) {
1016
- if (d.z < this.MAX_REPEAR) {
1017
- if (d.setz(Math.min(d.z + 1, this.MAX_REPEAR)), n = Math.min(n, p), l > 1) {
1018
+ const p = l - 1, u = this.tmpPoints[p], d = W.Sub(h, u).uni();
1019
+ if (h.isNear(u, e)) {
1020
+ if (u.z < this.MAX_REPEAR) {
1021
+ if (u.setz(Math.min(u.z + 1, this.MAX_REPEAR)), n = Math.min(n, p), l > 1) {
1018
1022
  let g = l - 1;
1019
1023
  for (; g > 0; ) {
1020
- const I = this.tmpPoints[g].distance(
1024
+ const v = this.tmpPoints[g].distance(
1021
1025
  this.tmpPoints[g - 1]
1022
- ), S = Math.max(
1023
- this.tmpPoints[g].z - this.uniThickness * I,
1026
+ ), k = Math.max(
1027
+ this.tmpPoints[g].z - this.uniThickness * v,
1024
1028
  0
1025
1029
  );
1026
- if (this.tmpPoints[g - 1].z >= S)
1030
+ if (this.tmpPoints[g - 1].z >= k)
1027
1031
  break;
1028
- this.tmpPoints[g - 1].setz(S), n = Math.min(n, g - 1), g--;
1032
+ this.tmpPoints[g - 1].setz(k), n = Math.min(n, g - 1), g--;
1029
1033
  }
1030
1034
  }
1031
1035
  } else
1032
1036
  n = 1 / 0;
1033
1037
  continue;
1034
1038
  }
1035
- h.setv(u);
1036
- const f = h.distance(d), m = Math.max(d.z - this.uniThickness * f, 0);
1037
- l > 1 && W.Equals(u, d.v, 0.02) && (m > 0 || d.z <= 0) && (s && d.t && s.add(d.t), this.tmpPoints.pop(), n = Math.min(p, n)), h.setz(m), this.tmpPoints.push(h);
1039
+ h.setv(d);
1040
+ const f = h.distance(u), m = Math.max(u.z - this.uniThickness * f, 0);
1041
+ l > 1 && W.Equals(d, u.v, 0.02) && (m > 0 || u.z <= 0) && (s && u.t && s.add(u.t), this.tmpPoints.pop(), n = Math.min(p, n)), h.setz(m), this.tmpPoints.push(h);
1038
1042
  }
1039
1043
  if (n === 1 / 0)
1040
1044
  return this.tmpPoints.length;
@@ -1069,12 +1073,12 @@ class Ne extends b {
1069
1073
  this.tmpPoints.push(p);
1070
1074
  continue;
1071
1075
  }
1072
- const d = h - 1, u = this.tmpPoints[d], f = W.Sub(p, u).uni();
1073
- if (p.isNear(u, e / 2)) {
1074
- n = Math.min(d, n);
1076
+ const u = h - 1, d = this.tmpPoints[u], f = W.Sub(p, d).uni();
1077
+ if (p.isNear(d, e / 2)) {
1078
+ n = Math.min(u, n);
1075
1079
  continue;
1076
1080
  }
1077
- W.Equals(f, u.v, 0.02) && (s && u.t && s.add(u.t), this.tmpPoints.pop(), n = Math.min(d, n)), p.setv(f), this.tmpPoints.push(p);
1081
+ W.Equals(f, d.v, 0.02) && (s && d.t && s.add(d.t), this.tmpPoints.pop(), n = Math.min(u, n)), p.setv(f), this.tmpPoints.push(p);
1078
1082
  }
1079
1083
  let a = r;
1080
1084
  if (n === r) {
@@ -1110,38 +1114,38 @@ class Ne extends b {
1110
1114
  break;
1111
1115
  if (a.isNear(l, e / 2)) {
1112
1116
  if (s < 3 && l.z < this.MAX_REPEAR && (l.setz(Math.min(l.z + 1, this.MAX_REPEAR)), n > 1)) {
1113
- let u = n - 1;
1114
- for (; u > 0; ) {
1115
- const f = this.tmpPoints[u].distance(
1116
- this.tmpPoints[u - 1]
1117
+ let d = n - 1;
1118
+ for (; d > 0; ) {
1119
+ const f = this.tmpPoints[d].distance(
1120
+ this.tmpPoints[d - 1]
1117
1121
  ), m = Math.max(
1118
- this.tmpPoints[u].z - this.uniThickness * f,
1122
+ this.tmpPoints[d].z - this.uniThickness * f,
1119
1123
  -e / 4
1120
1124
  );
1121
- if (this.tmpPoints[u - 1].z >= m)
1125
+ if (this.tmpPoints[d - 1].z >= m)
1122
1126
  break;
1123
- this.tmpPoints[u - 1].setz(m), u--;
1127
+ this.tmpPoints[d - 1].setz(m), d--;
1124
1128
  }
1125
1129
  }
1126
1130
  continue;
1127
1131
  }
1128
1132
  a.setv(h);
1129
- const d = Math.max(l.z - this.uniThickness * p, o);
1130
- n > 1 && W.Equals(h, l.v, 0.02) && l.z <= 0 && this.tmpPoints.pop(), a.setz(d), this.tmpPoints.push(a);
1133
+ const u = Math.max(l.z - this.uniThickness * p, o);
1134
+ n > 1 && W.Equals(h, l.v, 0.02) && l.z <= 0 && this.tmpPoints.pop(), a.setz(u), this.tmpPoints.push(a);
1131
1135
  }
1132
1136
  }
1133
1137
  static updateNodeOpt(t) {
1134
1138
  var h, p;
1135
1139
  const { node: e, opt: s, vNodes: o } = t, { strokeColor: r, strokeType: n, lineCap: a, lineDash: c } = s, l = o.get(e.name);
1136
- return r && (e.tagName === "GROUP" ? so(e) ? e.setAttribute("bgcolor", r) : e.children.forEach((d) => {
1137
- d.setAttribute("strokeColor", r), d.getAttribute("fillColor") && d.setAttribute("fillColor", r);
1140
+ return r && (e.tagName === "GROUP" ? so(e) ? e.setAttribute("bgcolor", r) : e.children.forEach((u) => {
1141
+ u.setAttribute("strokeColor", r), u.getAttribute("fillColor") && u.setAttribute("fillColor", r);
1138
1142
  }) : (e.setAttribute("strokeColor", r), e.setAttribute("fillColor", r)), (h = l == null ? void 0 : l.opt) != null && h.strokeColor && (l.opt.strokeColor = r)), n && (l != null && l.opt) && ((p = l.opt) != null && p.strokeType) && (l.opt.strokeType = n), a && (l != null && l.opt) && (l.opt.lineCap = a), c && (l != null && l.opt) && (l.opt.lineDash = c), l && o.setInfo(e.name, l), b.updateNodeOpt(t);
1139
1143
  }
1140
1144
  }
1141
1145
  class xe extends b {
1142
1146
  constructor(t) {
1143
1147
  super(t);
1144
- y(this, "toolsType", k.LaserPen);
1148
+ y(this, "toolsType", S.LaserPen);
1145
1149
  y(this, "canRotate", !1);
1146
1150
  y(this, "scaleType", z.none);
1147
1151
  y(this, "syncTimestamp");
@@ -1162,8 +1166,8 @@ class xe extends b {
1162
1166
  return { type: w.None };
1163
1167
  if (n && (this.syncUnitTime = n), this.updateTempPoints(r || []), this.consumeIndex > this.tmpPoints.length - 4)
1164
1168
  return { type: w.None };
1165
- const { strokeColor: a, thickness: c, strokeType: l, lineDash: h, lineCap: p } = this.workOptions, d = $(this.tmpPoints, c);
1166
- let u = !1;
1169
+ const { strokeColor: a, thickness: c, strokeType: l, lineDash: h, lineCap: p } = this.workOptions, u = $(this.tmpPoints, c);
1170
+ let d = !1;
1167
1171
  const f = this.syncIndex, m = this.tmpPoints.slice(this.consumeIndex);
1168
1172
  this.consumeIndex = this.tmpPoints.length - 1, this.syncTimestamp === 0 && (this.syncTimestamp = Date.now());
1169
1173
  const g = {
@@ -1180,30 +1184,30 @@ class xe extends b {
1180
1184
  lineCap: p,
1181
1185
  lineWidth: c,
1182
1186
  anchor: [0.5, 0.5]
1183
- }, I = this.getTaskPoints(m);
1184
- if (I.length) {
1185
- const v = Date.now();
1186
- v - this.syncTimestamp > this.syncUnitTime && (u = !0, this.syncTimestamp = v, this.syncIndex = this.tmpPoints.length), s && this.draw({
1187
+ }, v = this.getTaskPoints(m);
1188
+ if (v.length) {
1189
+ const I = Date.now();
1190
+ I - this.syncTimestamp > this.syncUnitTime && (d = !0, this.syncTimestamp = I, this.syncIndex = this.tmpPoints.length), s && this.draw({
1187
1191
  attrs: g,
1188
- tasks: I,
1192
+ tasks: v,
1189
1193
  isDot: !1,
1190
1194
  layer: this.drawLayer || this.fullLayer
1191
1195
  });
1192
1196
  }
1193
- const S = [];
1194
- return this.tmpPoints.slice(f).forEach((v) => {
1195
- S.push(v.x, v.y);
1197
+ const k = [];
1198
+ return this.tmpPoints.slice(f).forEach((I) => {
1199
+ k.push(I.x, I.y);
1196
1200
  }), {
1197
1201
  rect: {
1198
- x: d.x * this.fullLayer.worldScaling[0] + this.fullLayer.worldPosition[0],
1199
- y: d.y * this.fullLayer.worldScaling[1] + this.fullLayer.worldPosition[1],
1200
- w: d.w * this.fullLayer.worldScaling[0],
1201
- h: d.h * this.fullLayer.worldScaling[1]
1202
+ x: u.x * this.fullLayer.worldScaling[0] + this.fullLayer.worldPosition[0],
1203
+ y: u.y * this.fullLayer.worldScaling[1] + this.fullLayer.worldPosition[1],
1204
+ w: u.w * this.fullLayer.worldScaling[0],
1205
+ h: u.h * this.fullLayer.worldScaling[1]
1202
1206
  },
1203
1207
  type: w.DrawWork,
1204
1208
  dataType: x.Local,
1205
- op: u ? S : void 0,
1206
- index: u ? f * 2 : void 0,
1209
+ op: d ? k : void 0,
1210
+ index: d ? f * 2 : void 0,
1207
1211
  ...this.baseConsumeResult
1208
1212
  };
1209
1213
  }
@@ -1215,11 +1219,11 @@ class xe extends b {
1215
1219
  let n = this.tmpPoints.slice(this.consumeIndex);
1216
1220
  const a = n.length === 1, { strokeColor: c, thickness: l, strokeType: h } = this.workOptions;
1217
1221
  if (a) {
1218
- const u = this.computDotStroke({
1222
+ const d = this.computDotStroke({
1219
1223
  point: n[0],
1220
1224
  radius: l / 2
1221
1225
  });
1222
- n = u.ps, e = u.rect;
1226
+ n = d.ps, e = d.rect;
1223
1227
  } else
1224
1228
  e = $(this.tmpPoints, l);
1225
1229
  const p = {
@@ -1231,10 +1235,10 @@ class xe extends b {
1231
1235
  lineCap: a ? void 0 : "round",
1232
1236
  lineWidth: a ? 0 : l,
1233
1237
  anchor: [0.5, 0.5]
1234
- }, d = this.getTaskPoints(n);
1235
- d.length && this.draw({
1238
+ }, u = this.getTaskPoints(n);
1239
+ u.length && this.draw({
1236
1240
  attrs: p,
1237
- tasks: d,
1241
+ tasks: u,
1238
1242
  isDot: a,
1239
1243
  layer: this.drawLayer || this.fullLayer
1240
1244
  });
@@ -1285,7 +1289,7 @@ class xe extends b {
1285
1289
  h = m.ps, l = m.rect;
1286
1290
  } else
1287
1291
  l = $(this.tmpPoints, n);
1288
- const d = {
1292
+ const u = {
1289
1293
  name: (f = this.workId) == null ? void 0 : f.toString(),
1290
1294
  fillColor: p ? r : void 0,
1291
1295
  opacity: 1,
@@ -1294,10 +1298,10 @@ class xe extends b {
1294
1298
  lineCap: p ? void 0 : "round",
1295
1299
  lineWidth: p ? 0 : n,
1296
1300
  anchor: [0.5, 0.5]
1297
- }, u = this.getTaskPoints(h);
1298
- if (u.length) {
1301
+ }, d = this.getTaskPoints(h);
1302
+ if (d.length) {
1299
1303
  const m = o ? this.fullLayer : this.drawLayer || this.fullLayer;
1300
- this.draw({ attrs: d, tasks: u, isDot: p, replaceId: s, layer: m });
1304
+ this.draw({ attrs: u, tasks: d, isDot: p, replaceId: s, layer: m });
1301
1305
  }
1302
1306
  return {
1303
1307
  x: l.x * this.fullLayer.worldScaling[0] + this.fullLayer.worldPosition[0],
@@ -1353,15 +1357,15 @@ class xe extends b {
1353
1357
  for (; s < t.length; ) {
1354
1358
  const l = t[s], h = l.x - o, p = l.y - r;
1355
1359
  if (a.push(new O(h, p)), s > 0 && s < t.length - 1) {
1356
- const d = t[s].getAngleByPoints(
1360
+ const u = t[s].getAngleByPoints(
1357
1361
  t[s - 1],
1358
1362
  t[s + 1]
1359
1363
  );
1360
- if (d < 60 || d > 300) {
1361
- const u = (c = a.pop()) == null ? void 0 : c.clone();
1362
- u && e.push({
1364
+ if (u < 60 || u > 300) {
1365
+ const d = (c = a.pop()) == null ? void 0 : c.clone();
1366
+ d && e.push({
1363
1367
  pos: n,
1364
- points: [...a, u]
1368
+ points: [...a, d]
1365
1369
  }), o = t[s].x, r = t[s].y, n = [o, r];
1366
1370
  const f = l.x - o, m = l.y - r;
1367
1371
  a = [new O(f, m)];
@@ -1397,7 +1401,7 @@ const vt = class vt extends b {
1397
1401
  super(t);
1398
1402
  y(this, "canRotate", !1);
1399
1403
  y(this, "scaleType", z.none);
1400
- y(this, "toolsType", k.Eraser);
1404
+ y(this, "toolsType", S.Eraser);
1401
1405
  y(this, "serviceWork");
1402
1406
  y(this, "tmpPoints", []);
1403
1407
  y(this, "workOptions");
@@ -1435,8 +1439,8 @@ const vt = class vt extends b {
1435
1439
  if (l > 1) {
1436
1440
  const h = [];
1437
1441
  for (let p = 0; p < l; p++) {
1438
- const d = W.Mul(o, p * c);
1439
- h.push(this.tmpPoints[0] + d.x, this.tmpPoints[1] + d.y);
1442
+ const u = W.Mul(o, p * c);
1443
+ h.push(this.tmpPoints[0] + u.x, this.tmpPoints[1] + u.y);
1440
1444
  }
1441
1445
  return h.concat(t);
1442
1446
  }
@@ -1470,7 +1474,7 @@ const vt = class vt extends b {
1470
1474
  return s.forEach((r) => {
1471
1475
  var a;
1472
1476
  const n = this.fullLayer.getElementsByName(r);
1473
- n[0] && (n[0].remove(), q(n[0], this.fullLayer.parent), (a = this.vNodes) == null || a.delete(r));
1477
+ n[0] && (n[0].remove(), V(n[0], this.fullLayer.parent), (a = this.vNodes) == null || a.delete(r));
1474
1478
  }), o && (o.x -= b.SafeBorderPadding, o.y -= b.SafeBorderPadding, o.w += b.SafeBorderPadding * 2, o.h += b.SafeBorderPadding * 2), o;
1475
1479
  }
1476
1480
  consume(t) {
@@ -1554,25 +1558,25 @@ function xs(T, i, t, e, s, o) {
1554
1558
  if (!(r ? p in i : Ns.call(i, p)))
1555
1559
  return !1;
1556
1560
  }
1557
- var d = o.get(T), u = o.get(i);
1558
- if (d && u)
1559
- return d == i && u == T;
1561
+ var u = o.get(T), d = o.get(i);
1562
+ if (u && d)
1563
+ return u == i && d == T;
1560
1564
  var f = !0;
1561
1565
  o.set(T, i), o.set(i, T);
1562
1566
  for (var m = r; ++h < a; ) {
1563
1567
  p = n[h];
1564
- var g = T[p], I = i[p];
1568
+ var g = T[p], v = i[p];
1565
1569
  if (e)
1566
- var S = r ? e(I, g, p, i, T, o) : e(g, I, p, T, i, o);
1567
- if (!(S === void 0 ? g === I || s(g, I, t, e, o) : S)) {
1570
+ var k = r ? e(v, g, p, i, T, o) : e(g, v, p, T, i, o);
1571
+ if (!(k === void 0 ? g === v || s(g, v, t, e, o) : k)) {
1568
1572
  f = !1;
1569
1573
  break;
1570
1574
  }
1571
1575
  m || (m = p == "constructor");
1572
1576
  }
1573
1577
  if (f && !m) {
1574
- var v = T.constructor, L = i.constructor;
1575
- v != L && "constructor" in T && "constructor" in i && !(typeof v == "function" && v instanceof v && typeof L == "function" && L instanceof L) && (f = !1);
1578
+ var I = T.constructor, L = i.constructor;
1579
+ I != L && "constructor" in T && "constructor" in i && !(typeof I == "function" && I instanceof I && typeof L == "function" && L instanceof L) && (f = !1);
1576
1580
  }
1577
1581
  return o.delete(T), o.delete(i), f;
1578
1582
  }
@@ -1589,9 +1593,9 @@ function zs(T, i, t, e, s, o) {
1589
1593
  if (p && !l)
1590
1594
  return o || (o = new jt()), r || Es(T) ? Ms(T, i, t, e, s, o) : Os(T, i, a, t, e, s, o);
1591
1595
  if (!(t & Bs)) {
1592
- var d = l && ve.call(T, "__wrapped__"), u = h && ve.call(i, "__wrapped__");
1593
- if (d || u) {
1594
- var f = d ? T.value() : T, m = u ? i.value() : i;
1596
+ var u = l && ve.call(T, "__wrapped__"), d = h && ve.call(i, "__wrapped__");
1597
+ if (u || d) {
1598
+ var f = u ? T.value() : T, m = d ? i.value() : i;
1595
1599
  return o || (o = new jt()), s(f, m, t, e, o);
1596
1600
  }
1597
1601
  }
@@ -1609,7 +1613,7 @@ var _s = $s;
1609
1613
  const lt = /* @__PURE__ */ Jt(_s), _t = class _t extends b {
1610
1614
  constructor(t) {
1611
1615
  super(t);
1612
- y(this, "toolsType", k.Selector);
1616
+ y(this, "toolsType", S.Selector);
1613
1617
  y(this, "tmpPoints", []);
1614
1618
  y(this, "subTmpPoints", []);
1615
1619
  y(this, "workOptions");
@@ -1686,7 +1690,7 @@ const lt = /* @__PURE__ */ Jt(_s), _t = class _t extends b {
1686
1690
  const p = [
1687
1691
  l.rect.x + l.rect.w / 2 - e.x,
1688
1692
  l.rect.y + l.rect.h / 2 - e.y
1689
- ], d = new Kt({
1693
+ ], u = new Kt({
1690
1694
  normalize: !0,
1691
1695
  pos: p,
1692
1696
  lineWidth: 1,
@@ -1696,7 +1700,7 @@ const lt = /* @__PURE__ */ Jt(_s), _t = class _t extends b {
1696
1700
  id: `selector-${h}`,
1697
1701
  name: `selector-${h}`
1698
1702
  });
1699
- c.push(d);
1703
+ c.push(u);
1700
1704
  }), c && a.append(...c), (r == null ? void 0 : r.parent).appendChild(a);
1701
1705
  }
1702
1706
  draw(t, e, s, o = !1) {
@@ -1716,7 +1720,7 @@ const lt = /* @__PURE__ */ Jt(_s), _t = class _t extends b {
1716
1720
  let s, o = !0;
1717
1721
  for (const r of t.values()) {
1718
1722
  const { opt: n, canRotate: a, scaleType: c, toolsType: l } = r;
1719
- this.selectorColor = this.workOptions.strokeColor, n.strokeColor && (this.strokeColor = n.strokeColor), n.fillColor && (this.fillColor = n.fillColor), n.textOpt && (this.textOpt = n.textOpt), n.thickness && (this.thickness = n.thickness), l !== k.Pencil && (o = !1), n.strokeType && (this.strokeType = n.strokeType), l === k.SpeechBalloon && (e.add(l), this.shapeOpt || (this.shapeOpt = {}), this.shapeOpt.placement = n.placement), l === k.Polygon && (e.add(l), this.shapeOpt || (this.shapeOpt = {}), this.shapeOpt.vertices = n.vertices), l === k.Star && (e.add(l), this.shapeOpt || (this.shapeOpt = {}), this.shapeOpt.vertices = n.vertices, this.shapeOpt.innerRatio = n.innerRatio, this.shapeOpt.innerVerticeStep = n.innerVerticeStep), l === k.Text && (this.textOpt = n), t.size === 1 && (this.textOpt && (this.canTextEdit = !0), this.canRotate = a, this.scaleType = c), (l === k.Image || l === k.BackgroundSVG) && (s = r), (c === z.proportional && this.scaleType !== z.none || c === z.none) && (this.scaleType = c);
1723
+ this.selectorColor = this.workOptions.strokeColor, n.strokeColor && (this.strokeColor = n.strokeColor), n.fillColor && (this.fillColor = n.fillColor), n.textOpt && (this.textOpt = n.textOpt), n.thickness && (this.thickness = n.thickness), l !== S.Pencil && (o = !1), n.strokeType && (this.strokeType = n.strokeType), l === S.SpeechBalloon && (e.add(l), this.shapeOpt || (this.shapeOpt = {}), this.shapeOpt.placement = n.placement), l === S.Polygon && (e.add(l), this.shapeOpt || (this.shapeOpt = {}), this.shapeOpt.vertices = n.vertices), l === S.Star && (e.add(l), this.shapeOpt || (this.shapeOpt = {}), this.shapeOpt.vertices = n.vertices, this.shapeOpt.innerRatio = n.innerRatio, this.shapeOpt.innerVerticeStep = n.innerVerticeStep), l === S.Text && (this.textOpt = n), t.size === 1 && (this.textOpt && (this.canTextEdit = !0), this.canRotate = a, this.scaleType = c), (l === S.Image || l === S.BackgroundSVG) && (s = r), (c === z.proportional && this.scaleType !== z.none || c === z.none) && (this.scaleType = c);
1720
1724
  }
1721
1725
  o && (this.useStroke = !0), e.size && (this.toolsTypes = [...e]), s && (t.size === 1 ? (this.canLock = !0, s.opt.locked && (this.isLocked = !0, this.scaleType = z.none, this.canRotate = !1, this.textOpt = void 0, this.fillColor = void 0, this.selectorColor = "rgb(177,177,177)", this.strokeColor = void 0, this.canTextEdit = !1, this.thickness = void 0, this.strokeType = void 0, this.useStroke = void 0)) : t.size > 1 && !s.opt.locked && (this.canLock = !1, this.canRotate = !1));
1722
1726
  }
@@ -1840,7 +1844,7 @@ const lt = /* @__PURE__ */ Jt(_s), _t = class _t extends b {
1840
1844
  };
1841
1845
  }
1842
1846
  drawForSubWorker(t) {
1843
- const { workId: e, layer: s, ps: o } = t, { strokeColor: r, scale: n, rotate: a, translate: c } = this.workOptions, l = s.worldPosition, h = s.worldScaling, { points: p, rect: d, pos: u } = this.computDrawPoints(o), f = 1 / s.worldScaling[0], m = r && os(r) || [0, 0, 0, 0], g = {
1847
+ const { workId: e, layer: s, ps: o } = t, { strokeColor: r, scale: n, rotate: a, translate: c } = this.workOptions, l = s.worldPosition, h = s.worldScaling, { points: p, rect: u, pos: d } = this.computDrawPoints(o), f = 1 / s.worldScaling[0], m = r && os(r) || [0, 0, 0, 0], g = {
1844
1848
  close: !0,
1845
1849
  normalize: !0,
1846
1850
  points: p,
@@ -1850,43 +1854,43 @@ const lt = /* @__PURE__ */ Jt(_s), _t = class _t extends b {
1850
1854
  lineJoin: "round",
1851
1855
  lineCap: "round"
1852
1856
  };
1853
- let I = {
1857
+ let v = {
1854
1858
  x: Math.floor(
1855
- d.x * h[0] + l[0] - b.SafeBorderPadding
1859
+ u.x * h[0] + l[0] - b.SafeBorderPadding
1856
1860
  ),
1857
1861
  y: Math.floor(
1858
- d.y * h[1] + l[1] - b.SafeBorderPadding
1862
+ u.y * h[1] + l[1] - b.SafeBorderPadding
1859
1863
  ),
1860
1864
  w: Math.floor(
1861
- d.w * h[0] + 2 * b.SafeBorderPadding
1865
+ u.w * h[0] + 2 * b.SafeBorderPadding
1862
1866
  ),
1863
1867
  h: Math.floor(
1864
- d.h * h[0] + 2 * b.SafeBorderPadding
1868
+ u.h * h[0] + 2 * b.SafeBorderPadding
1865
1869
  )
1866
1870
  };
1867
- const S = new j({
1871
+ const k = new j({
1868
1872
  name: e,
1869
1873
  id: e,
1870
- pos: u,
1874
+ pos: d,
1871
1875
  anchor: [0.5, 0.5],
1872
- size: [d.w, d.h],
1876
+ size: [u.w, u.h],
1873
1877
  scale: n,
1874
1878
  rotate: a,
1875
1879
  translate: c
1876
- }), v = new ht({
1880
+ }), I = new ht({
1877
1881
  ...g,
1878
1882
  pos: [0, 0]
1879
1883
  });
1880
- if (S.appendChild(v), this.replace(s, e, S), n || a || c) {
1881
- const L = S.getBoundingClientRect();
1882
- I = {
1884
+ if (k.appendChild(I), this.replace(s, e, k), n || a || c) {
1885
+ const L = k.getBoundingClientRect();
1886
+ v = {
1883
1887
  x: Math.floor(L.x - b.SafeBorderPadding),
1884
1888
  y: Math.floor(L.y - b.SafeBorderPadding),
1885
1889
  w: Math.floor(L.width + 2 * b.SafeBorderPadding),
1886
1890
  h: Math.floor(L.height + 2 * b.SafeBorderPadding)
1887
1891
  };
1888
1892
  }
1889
- return I;
1893
+ return v;
1890
1894
  }
1891
1895
  transformData(t) {
1892
1896
  const e = $(t);
@@ -1953,7 +1957,7 @@ const lt = /* @__PURE__ */ Jt(_s), _t = class _t extends b {
1953
1957
  const h = this.fullLayer.getElementsByName(
1954
1958
  l.name
1955
1959
  );
1956
- if (Ge(h).find((d) => d.isPointCollision(o, r))) {
1960
+ if (Ge(h).find((u) => u.isPointCollision(o, r))) {
1957
1961
  n = l;
1958
1962
  break;
1959
1963
  }
@@ -2013,7 +2017,7 @@ const lt = /* @__PURE__ */ Jt(_s), _t = class _t extends b {
2013
2017
  })), s;
2014
2018
  }
2015
2019
  isCanFillColor(t) {
2016
- return t === k.Ellipse || t === k.Triangle || t === k.Rectangle || t === k.Polygon || t === k.Star || t === k.SpeechBalloon;
2020
+ return t === S.Ellipse || t === S.Triangle || t === S.Rectangle || t === S.Polygon || t === S.Star || t === S.SpeechBalloon;
2017
2021
  }
2018
2022
  async updateSelector(t) {
2019
2023
  const {
@@ -2027,21 +2031,21 @@ const lt = /* @__PURE__ */ Jt(_s), _t = class _t extends b {
2027
2031
  if (!c)
2028
2032
  return;
2029
2033
  let l;
2030
- const h = /* @__PURE__ */ new Map(), { originPoint: p, workState: d, angle: u, translate: f, dir: m, scale: g } = e;
2034
+ const h = /* @__PURE__ */ new Map(), { originPoint: p, workState: u, angle: d, translate: f, dir: m, scale: g } = e;
2031
2035
  a && (f ? e.translate = [
2032
2036
  f[0] + a[0],
2033
2037
  f[1] + a[1]
2034
2038
  ] : e.translate = a);
2035
- let I;
2036
- if (p || f || H(u)) {
2037
- if (d === A.Start && s)
2039
+ let v;
2040
+ if (p || f || q(d)) {
2041
+ if (u === A.Start && s)
2038
2042
  return o.setTargetAssignKeys(s), {
2039
2043
  type: w.Select,
2040
2044
  dataType: x.Local,
2041
2045
  selectRect: this.oldSelectRect,
2042
2046
  rect: this.oldSelectRect
2043
2047
  };
2044
- if (I = o.getLastTarget(), !I)
2048
+ if (v = o.getLastTarget(), !v)
2045
2049
  return;
2046
2050
  }
2047
2051
  if (s)
@@ -2061,7 +2065,7 @@ const lt = /* @__PURE__ */ Jt(_s), _t = class _t extends b {
2061
2065
  willSerializeData: r
2062
2066
  });
2063
2067
  if (N) {
2064
- D = I == null ? void 0 : I.get(L);
2068
+ D = v == null ? void 0 : v.get(L);
2065
2069
  const F = Ue(N);
2066
2070
  if (F == null || F.updateNodeOpt({
2067
2071
  node: P,
@@ -2076,51 +2080,51 @@ const lt = /* @__PURE__ */ Jt(_s), _t = class _t extends b {
2076
2080
  toolsOpt: C.opt
2077
2081
  });
2078
2082
  U == null || U.setWorkId(L);
2079
- let V;
2080
- if (N === k.BackgroundSVG)
2081
- V = U.consumeService({
2083
+ let H;
2084
+ if (N === S.BackgroundSVG)
2085
+ H = U.consumeService({
2082
2086
  isFullWork: !0,
2083
2087
  replaceId: L
2084
2088
  });
2085
- else if (N === k.Image)
2086
- V = await U.consumeServiceAsync({
2089
+ else if (N === S.Image)
2090
+ H = await U.consumeServiceAsync({
2087
2091
  isFullWork: !0,
2088
2092
  replaceId: L,
2089
2093
  worker: n
2090
2094
  });
2091
- else if (N === k.Text)
2092
- V = await U.consumeServiceAsync({
2095
+ else if (N === S.Text)
2096
+ H = await U.consumeServiceAsync({
2093
2097
  isFullWork: !0,
2094
2098
  replaceId: L,
2095
2099
  isDrawLabel: !0
2096
2100
  });
2097
2101
  else
2098
2102
  try {
2099
- V = U == null ? void 0 : U.consumeService({
2103
+ H = U == null ? void 0 : U.consumeService({
2100
2104
  op: C.op,
2101
2105
  isFullWork: !0,
2102
2106
  replaceId: L,
2103
- workState: d
2107
+ workState: u
2104
2108
  });
2105
2109
  } catch (Z) {
2106
2110
  console.error("consumeService error", Z);
2107
2111
  continue;
2108
2112
  }
2109
- V && (C.rect = V);
2113
+ H && (C.rect = H);
2110
2114
  }
2111
2115
  C && (h.set(L, C), l = E(l, C.rect));
2112
2116
  }
2113
2117
  }
2114
2118
  }
2115
2119
  }
2116
- I && d === A.Done && (o.deleteLastTarget(), I = void 0);
2117
- const S = l;
2118
- if (p && f && g && m && S && !a) {
2120
+ v && u === A.Done && (o.deleteLastTarget(), v = void 0);
2121
+ const k = l;
2122
+ if (p && f && g && m && k && !a) {
2119
2123
  const L = [
2120
- [S.x, S.y],
2121
- [S.x + S.w, S.y],
2122
- [S.x + S.w, S.y + S.h],
2123
- [S.x, S.y + S.h]
2124
+ [k.x, k.y],
2125
+ [k.x + k.w, k.y],
2126
+ [k.x + k.w, k.y + k.h],
2127
+ [k.x, k.y + k.h]
2124
2128
  ];
2125
2129
  let C;
2126
2130
  switch (m) {
@@ -2148,22 +2152,22 @@ const lt = /* @__PURE__ */ Jt(_s), _t = class _t extends b {
2148
2152
  if (!lt(N, [0, 0]))
2149
2153
  return await this.updateSelector({
2150
2154
  ...t,
2151
- updateSelectorOpt: { workState: d },
2155
+ updateSelectorOpt: { workState: u },
2152
2156
  offset: N
2153
2157
  });
2154
2158
  }
2155
2159
  this.getSelecteorInfo(h), this.draw(X, c, {
2156
2160
  selectIds: s || [],
2157
2161
  subNodeMap: h,
2158
- intersectRect: S
2162
+ intersectRect: k
2159
2163
  });
2160
- const v = E(this.oldSelectRect, S);
2161
- return this.oldSelectRect = S, {
2164
+ const I = E(this.oldSelectRect, k);
2165
+ return this.oldSelectRect = k, {
2162
2166
  type: w.Select,
2163
2167
  dataType: x.Local,
2164
- selectRect: S,
2168
+ selectRect: k,
2165
2169
  renderRect: l,
2166
- rect: E(v, S),
2170
+ rect: E(I, k),
2167
2171
  selectIds: s
2168
2172
  };
2169
2173
  }
@@ -2272,7 +2276,7 @@ class Me extends b {
2272
2276
  super(t);
2273
2277
  y(this, "canRotate", !1);
2274
2278
  y(this, "scaleType", z.both);
2275
- y(this, "toolsType", k.Arrow);
2279
+ y(this, "toolsType", S.Arrow);
2276
2280
  y(this, "tmpPoints", []);
2277
2281
  y(this, "workOptions");
2278
2282
  y(this, "oldRect");
@@ -2293,17 +2297,17 @@ class Me extends b {
2293
2297
  const p = l == null ? void 0 : l.length;
2294
2298
  if (!p || p < 2)
2295
2299
  return { type: w.None };
2296
- let d;
2297
- if (this.tmpPoints.length === 0 ? (this.tmpPoints = [new O(l[0], l[1])], d = !1) : d = this.updateTempPoints(l), !d)
2298
- return { type: w.None };
2299
2300
  let u;
2301
+ if (this.tmpPoints.length === 0 ? (this.tmpPoints = [new O(l[0], l[1])], u = !1) : u = this.updateTempPoints(l), !u)
2302
+ return { type: w.None };
2303
+ let d;
2300
2304
  if (o || r || a) {
2301
2305
  const m = s ? this.fullLayer : this.drawLayer || this.fullLayer;
2302
- u = this.draw({ workId: c, layer: m });
2306
+ d = this.draw({ workId: c, layer: m });
2303
2307
  }
2304
2308
  if (a) {
2305
- const m = E(u, this.oldRect);
2306
- this.oldRect = u;
2309
+ const m = E(d, this.oldRect);
2310
+ this.oldRect = d;
2307
2311
  const g = {
2308
2312
  rect: m,
2309
2313
  type: w.DrawWork,
@@ -2311,8 +2315,8 @@ class Me extends b {
2311
2315
  ...this.baseConsumeResult
2312
2316
  };
2313
2317
  if (n) {
2314
- const I = Date.now();
2315
- I - this.syncTimestamp > this.syncUnitTime && (this.syncTimestamp = I, g.op = this.tmpPoints.map((S) => [...S.XY, 0]).flat(1), g.index = 0, g.isSync = !0);
2318
+ const v = Date.now();
2319
+ v - this.syncTimestamp > this.syncUnitTime && (this.syncTimestamp = v, g.op = this.tmpPoints.map((k) => [...k.XY, 0]).flat(1), g.index = 0, g.isSync = !0);
2316
2320
  }
2317
2321
  return g;
2318
2322
  }
@@ -2327,8 +2331,8 @@ class Me extends b {
2327
2331
  index: 0
2328
2332
  }) : { type: w.None };
2329
2333
  }
2330
- const f = E(u, this.oldRect);
2331
- return this.oldRect = u, {
2334
+ const f = E(d, this.oldRect);
2335
+ return this.oldRect = d, {
2332
2336
  rect: f,
2333
2337
  ...this.baseConsumeResult,
2334
2338
  type: w.DrawWork,
@@ -2375,19 +2379,19 @@ class Me extends b {
2375
2379
  rotate: l,
2376
2380
  translate: h,
2377
2381
  strokeType: p,
2378
- eraserlines: d,
2379
- lineDash: u,
2382
+ eraserlines: u,
2383
+ lineDash: d,
2380
2384
  lineCap: f
2381
- } = this.workOptions, m = s.worldPosition, g = s.worldScaling, { points: I, pos: S, rect: v, isTriangle: L, trianglePoints: C, trianglePos: N } = this.computDrawPoints(n), R = [
2382
- v.x + v.w / 2,
2383
- v.y + v.h / 2
2385
+ } = this.workOptions, m = s.worldPosition, g = s.worldScaling, { points: v, pos: k, rect: I, isTriangle: L, trianglePoints: C, trianglePos: N } = this.computDrawPoints(n), R = [
2386
+ I.x + I.w / 2,
2387
+ I.y + I.h / 2
2384
2388
  ], P = {
2385
2389
  pos: R,
2386
2390
  name: e,
2387
2391
  id: e,
2388
2392
  zIndex: a,
2389
2393
  anchor: [0.5, 0.5],
2390
- size: [v.w, v.h]
2394
+ size: [I.w, I.h]
2391
2395
  };
2392
2396
  c && (P.scale = c), l && (P.rotate = l), h && (P.translate = h);
2393
2397
  const M = new j(P), D = {
@@ -2398,29 +2402,29 @@ class Me extends b {
2398
2402
  lineWidth: 0,
2399
2403
  normalize: !1
2400
2404
  }, B = new ht(D);
2401
- if (M.append(B), !L && I && S) {
2405
+ if (M.append(B), !L && v && k) {
2402
2406
  const U = {
2403
- points: I,
2404
- pos: [S[0] - R[0], S[1] - R[1]],
2407
+ points: v,
2408
+ pos: [k[0] - R[0], k[1] - R[1]],
2405
2409
  fillColor: r,
2406
2410
  strokeColor: r,
2407
2411
  lineDash: p === G.Dotted ? [
2408
- u && u[0] || 1,
2409
- (u && u[1] || 2) * n
2412
+ d && d[0] || 1,
2413
+ (d && d[1] || 2) * n
2410
2414
  ] : p === G.LongDotted ? [
2411
- (u && u[0] || 1) * n,
2412
- (u && u[1] || 2) * n
2415
+ (d && d[0] || 1) * n,
2416
+ (d && d[1] || 2) * n
2413
2417
  ] : void 0,
2414
2418
  lineCap: p === G.Normal ? void 0 : f,
2415
2419
  lineWidth: n,
2416
2420
  normalize: !1
2417
- }, V = new ht(U);
2418
- M.append(V);
2421
+ }, H = new ht(U);
2422
+ M.append(H);
2419
2423
  }
2420
- d && (this.scaleType = z.proportional, this.drawEraserlines(
2424
+ u && (this.scaleType = z.proportional, this.drawEraserlines(
2421
2425
  {
2422
2426
  group: M,
2423
- eraserlines: d,
2427
+ eraserlines: u,
2424
2428
  pos: R,
2425
2429
  layer: s
2426
2430
  },
@@ -2428,16 +2432,16 @@ class Me extends b {
2428
2432
  )), this.replace(s, e, M);
2429
2433
  let F = {
2430
2434
  x: Math.floor(
2431
- v.x * g[0] + m[0] - b.SafeBorderPadding
2435
+ I.x * g[0] + m[0] - b.SafeBorderPadding
2432
2436
  ),
2433
2437
  y: Math.floor(
2434
- v.y * g[1] + m[1] - b.SafeBorderPadding
2438
+ I.y * g[1] + m[1] - b.SafeBorderPadding
2435
2439
  ),
2436
2440
  w: Math.floor(
2437
- v.w * g[0] + 2 * b.SafeBorderPadding
2441
+ I.w * g[0] + 2 * b.SafeBorderPadding
2438
2442
  ),
2439
2443
  h: Math.floor(
2440
- v.h * g[1] + 2 * b.SafeBorderPadding
2444
+ I.h * g[1] + 2 * b.SafeBorderPadding
2441
2445
  )
2442
2446
  };
2443
2447
  if (c || l || h) {
@@ -2461,7 +2465,7 @@ class Me extends b {
2461
2465
  ), r = O.Add(
2462
2466
  this.tmpPoints[0],
2463
2467
  s
2464
- ), n = W.Mul(e, this.arrowTipWidth), a = W.Sub(this.tmpPoints[1], n), c = O.Sub(a, s), l = O.Add(a, s), h = W.Per(e).mul(t * 1.5), p = O.Sub(a, h), d = O.Add(a, h), u = [this.tmpPoints[0], a], f = [p, this.tmpPoints[1], d], m = [
2468
+ ), n = W.Mul(e, this.arrowTipWidth), a = W.Sub(this.tmpPoints[1], n), c = O.Sub(a, s), l = O.Add(a, s), h = W.Per(e).mul(t * 1.5), p = O.Sub(a, h), u = O.Add(a, h), d = [this.tmpPoints[0], a], f = [p, this.tmpPoints[1], u], m = [
2465
2469
  o,
2466
2470
  r,
2467
2471
  ...f,
@@ -2471,7 +2475,7 @@ class Me extends b {
2471
2475
  return {
2472
2476
  trianglePoints: f.map((g) => O.Sub(g, this.tmpPoints[1]).XY).flat(1),
2473
2477
  trianglePos: this.tmpPoints[1].XY,
2474
- points: u.map((g) => O.Sub(g, this.tmpPoints[0]).XY).flat(1),
2478
+ points: d.map((g) => O.Sub(g, this.tmpPoints[0]).XY).flat(1),
2475
2479
  rect: $(m),
2476
2480
  isTriangle: !1,
2477
2481
  pos: this.tmpPoints[0].XY
@@ -2542,7 +2546,7 @@ class Oe extends b {
2542
2546
  super(t);
2543
2547
  y(this, "canRotate", !1);
2544
2548
  y(this, "scaleType", z.all);
2545
- y(this, "toolsType", k.Ellipse);
2549
+ y(this, "toolsType", S.Ellipse);
2546
2550
  y(this, "tmpPoints", []);
2547
2551
  y(this, "workOptions");
2548
2552
  y(this, "oldRect");
@@ -2562,31 +2566,31 @@ class Oe extends b {
2562
2566
  const p = l == null ? void 0 : l.length;
2563
2567
  if (!p || p < 2)
2564
2568
  return { type: w.None };
2565
- let d;
2566
- if (this.tmpPoints.length === 0 ? (this.tmpPoints = [new O(l[0], l[1])], d = !1) : d = this.updateTempPoints(l), !d)
2567
- return { type: w.None };
2568
2569
  let u;
2570
+ if (this.tmpPoints.length === 0 ? (this.tmpPoints = [new O(l[0], l[1])], u = !1) : u = this.updateTempPoints(l), !u)
2571
+ return { type: w.None };
2572
+ let d;
2569
2573
  if (o || r || a) {
2570
2574
  const f = s ? this.fullLayer : this.drawLayer || this.fullLayer;
2571
- u = this.draw({ workId: c, layer: f, isDrawing: !0 });
2575
+ d = this.draw({ workId: c, layer: f, isDrawing: !0 });
2572
2576
  const m = f.parent.parent, g = {
2573
2577
  x: 0,
2574
2578
  y: 0,
2575
2579
  w: Math.floor(m.width),
2576
2580
  h: Math.floor(m.height)
2577
- }, I = {
2581
+ }, v = {
2578
2582
  type: w.DrawWork,
2579
2583
  dataType: x.Local,
2580
2584
  ...this.baseConsumeResult
2581
2585
  };
2582
- if (Rt(u, g) !== Vt.outside) {
2583
- const v = E(u, this.oldRect);
2584
- if (this.oldRect = u, I.rect = v, !a)
2585
- return I;
2586
+ if (Rt(d, g) !== Vt.outside) {
2587
+ const I = E(d, this.oldRect);
2588
+ if (this.oldRect = d, v.rect = I, !a)
2589
+ return v;
2586
2590
  }
2587
2591
  if (a) {
2588
- const v = Date.now();
2589
- return v - this.syncTimestamp > this.syncUnitTime && (this.syncTimestamp = v, I.op = this.tmpPoints.map((L) => [...L.XY, 0]).flat(1), I.index = 0, I.isSync = !0), I;
2592
+ const I = Date.now();
2593
+ return I - this.syncTimestamp > this.syncUnitTime && (this.syncTimestamp = I, v.op = this.tmpPoints.map((L) => [...L.XY, 0]).flat(1), v.index = 0, v.isSync = !0), v;
2590
2594
  }
2591
2595
  return { type: w.None };
2592
2596
  }
@@ -2646,23 +2650,23 @@ class Oe extends b {
2646
2650
  zIndex: l,
2647
2651
  scale: h,
2648
2652
  rotate: p,
2649
- translate: d,
2650
- strokeType: u,
2653
+ translate: u,
2654
+ strokeType: d,
2651
2655
  eraserlines: f,
2652
2656
  lineDash: m,
2653
2657
  lineCap: g
2654
- } = this.workOptions, I = s.worldScaling, { radius: S, rect: v, pos: L } = this.computDrawPoints(c), C = {
2658
+ } = this.workOptions, v = s.worldScaling, { radius: k, rect: I, pos: L } = this.computDrawPoints(c), C = {
2655
2659
  closeType: "normal",
2656
- radius: S,
2660
+ radius: k,
2657
2661
  lineWidth: c,
2658
2662
  fillColor: a !== "transparent" && a || void 0,
2659
2663
  strokeColor: n,
2660
2664
  normalize: !0,
2661
2665
  lineCap: g,
2662
- lineDash: u === G.Dotted ? [
2666
+ lineDash: d === G.Dotted ? [
2663
2667
  m && m[0] || 1,
2664
2668
  (m && m[1] || 2) * c
2665
- ] : u === G.LongDotted ? [
2669
+ ] : d === G.LongDotted ? [
2666
2670
  (m && m[0] || 1) * c,
2667
2671
  (m && m[1] || 2) * c
2668
2672
  ] : void 0
@@ -2672,9 +2676,9 @@ class Oe extends b {
2672
2676
  zIndex: l,
2673
2677
  pos: L,
2674
2678
  anchor: [0.5, 0.5],
2675
- size: [v.w, v.h]
2679
+ size: [I.w, I.h]
2676
2680
  };
2677
- h && (N.scale = h), p && (N.rotate = p), d && (N.translate = d);
2681
+ h && (N.scale = h), p && (N.rotate = p), u && (N.translate = u);
2678
2682
  const R = new j(N);
2679
2683
  if (o) {
2680
2684
  const D = new wt({
@@ -2683,7 +2687,7 @@ class Oe extends b {
2683
2687
  pos: [0, 0],
2684
2688
  strokeColor: n,
2685
2689
  lineWidth: 1,
2686
- scale: [1 / I[0], 1 / I[1]]
2690
+ scale: [1 / v[0], 1 / v[1]]
2687
2691
  });
2688
2692
  R.append(D);
2689
2693
  }
@@ -2759,10 +2763,10 @@ class Oe extends b {
2759
2763
  this.tmpPoints.length = 0;
2760
2764
  }
2761
2765
  static updateNodeOpt(t) {
2762
- var h, p, d;
2766
+ var h, p, u;
2763
2767
  const { node: e, opt: s, vNodes: o } = t, { strokeColor: r, fillColor: n, strokeType: a } = s, c = o.get(e.name);
2764
2768
  let l = e;
2765
- return e.tagName === "GROUP" && (l = e.children[0]), r && (l.setAttribute("strokeColor", r), (h = c == null ? void 0 : c.opt) != null && h.strokeColor && (c.opt.strokeColor = r)), n && (n === "transparent" ? l.setAttribute("fillColor", "rgba(0,0,0,0)") : l.setAttribute("fillColor", n), (p = c == null ? void 0 : c.opt) != null && p.fillColor && (c.opt.fillColor = n)), a && (c != null && c.opt) && ((d = c.opt) != null && d.strokeType) && (c.opt.strokeType = a), c && o.setInfo(e.name, c), b.updateNodeOpt(t);
2769
+ return e.tagName === "GROUP" && (l = e.children[0]), r && (l.setAttribute("strokeColor", r), (h = c == null ? void 0 : c.opt) != null && h.strokeColor && (c.opt.strokeColor = r)), n && (n === "transparent" ? l.setAttribute("fillColor", "rgba(0,0,0,0)") : l.setAttribute("fillColor", n), (p = c == null ? void 0 : c.opt) != null && p.fillColor && (c.opt.fillColor = n)), a && (c != null && c.opt) && ((u = c.opt) != null && u.strokeType) && (c.opt.strokeType = a), c && o.setInfo(e.name, c), b.updateNodeOpt(t);
2766
2770
  }
2767
2771
  }
2768
2772
  class Ae extends b {
@@ -2770,7 +2774,7 @@ class Ae extends b {
2770
2774
  super(t);
2771
2775
  y(this, "canRotate", !0);
2772
2776
  y(this, "scaleType", z.all);
2773
- y(this, "toolsType", k.Rectangle);
2777
+ y(this, "toolsType", S.Rectangle);
2774
2778
  y(this, "tmpPoints", []);
2775
2779
  y(this, "workOptions");
2776
2780
  y(this, "oldRect");
@@ -2814,15 +2818,15 @@ class Ae extends b {
2814
2818
  let p;
2815
2819
  if (this.tmpPoints.length === 0 ? (this.tmpPoints = [new O(l[0], l[1])], p = !1) : p = this.updateTempPoints(l), !p)
2816
2820
  return { type: w.None };
2817
- const d = this.transformData();
2818
- let u;
2821
+ const u = this.transformData();
2822
+ let d;
2819
2823
  if (o || r || a) {
2820
2824
  const m = s ? this.fullLayer : this.drawLayer || this.fullLayer;
2821
- u = this.draw({ ps: d, workId: c, layer: m, isDrawing: !0 });
2825
+ d = this.draw({ ps: u, workId: c, layer: m, isDrawing: !0 });
2822
2826
  }
2823
2827
  if (a) {
2824
- const m = E(u, this.oldRect);
2825
- this.oldRect = u;
2828
+ const m = E(d, this.oldRect);
2829
+ this.oldRect = d;
2826
2830
  const g = {
2827
2831
  rect: m,
2828
2832
  type: w.DrawWork,
@@ -2830,8 +2834,8 @@ class Ae extends b {
2830
2834
  ...this.baseConsumeResult
2831
2835
  };
2832
2836
  if (n) {
2833
- const I = Date.now();
2834
- I - this.syncTimestamp > this.syncUnitTime && (this.syncTimestamp = I, g.op = d.flat(1), g.index = 0, g.isSync = !0);
2837
+ const v = Date.now();
2838
+ v - this.syncTimestamp > this.syncUnitTime && (this.syncTimestamp = v, g.op = u.flat(1), g.index = 0, g.isSync = !0);
2835
2839
  }
2836
2840
  return g;
2837
2841
  }
@@ -2840,14 +2844,14 @@ class Ae extends b {
2840
2844
  return m - this.syncTimestamp > this.syncUnitTime ? (this.syncTimestamp = m, {
2841
2845
  type: w.DrawWork,
2842
2846
  dataType: x.Local,
2843
- op: d.flat(1),
2847
+ op: u.flat(1),
2844
2848
  isSync: !0,
2845
2849
  index: 0,
2846
2850
  ...this.baseConsumeResult
2847
2851
  }) : { type: w.None };
2848
2852
  }
2849
- const f = E(u, this.oldRect);
2850
- return this.oldRect = u, {
2853
+ const f = E(d, this.oldRect);
2854
+ return this.oldRect = d, {
2851
2855
  rect: f,
2852
2856
  type: w.DrawWork,
2853
2857
  dataType: x.Local,
@@ -2903,35 +2907,35 @@ class Ae extends b {
2903
2907
  fillColor: l,
2904
2908
  thickness: h,
2905
2909
  zIndex: p,
2906
- scale: d,
2907
- rotate: u,
2910
+ scale: u,
2911
+ rotate: d,
2908
2912
  translate: f,
2909
2913
  strokeType: m,
2910
2914
  eraserlines: g,
2911
- lineCap: I,
2912
- lineDash: S
2913
- } = this.workOptions, v = s.worldPosition, L = s.worldScaling, { points: C, rect: N, pos: R } = this.computDrawPoints(r), P = {
2915
+ lineCap: v,
2916
+ lineDash: k
2917
+ } = this.workOptions, I = s.worldPosition, L = s.worldScaling, { points: C, rect: N, pos: R } = this.computDrawPoints(r), P = {
2914
2918
  close: !0,
2915
2919
  normalize: !0,
2916
2920
  points: C,
2917
2921
  lineWidth: h,
2918
2922
  fillColor: l !== "transparent" && l || void 0,
2919
2923
  strokeColor: c,
2920
- lineCap: I,
2924
+ lineCap: v,
2921
2925
  lineDash: m === G.Dotted ? [
2922
- S && S[0] || 1,
2923
- (S && S[1] || 2) * h
2926
+ k && k[0] || 1,
2927
+ (k && k[1] || 2) * h
2924
2928
  ] : m === G.LongDotted ? [
2925
- (S && S[0] || 1) * h,
2926
- (S && S[1] || 2) * h
2929
+ (k && k[0] || 1) * h,
2930
+ (k && k[1] || 2) * h
2927
2931
  ] : void 0
2928
2932
  };
2929
2933
  let M = {
2930
2934
  x: Math.floor(
2931
- N.x * L[0] + v[0] - b.SafeBorderPadding
2935
+ N.x * L[0] + I[0] - b.SafeBorderPadding
2932
2936
  ),
2933
2937
  y: Math.floor(
2934
- N.y * L[1] + v[1] - b.SafeBorderPadding
2938
+ N.y * L[1] + I[1] - b.SafeBorderPadding
2935
2939
  ),
2936
2940
  w: Math.floor(
2937
2941
  N.w * L[0] + 2 * b.SafeBorderPadding
@@ -2947,8 +2951,8 @@ class Ae extends b {
2947
2951
  pos: R,
2948
2952
  anchor: [0.5, 0.5],
2949
2953
  size: [N.w, N.h],
2950
- scale: d,
2951
- rotate: u,
2954
+ scale: u,
2955
+ rotate: d,
2952
2956
  translate: f
2953
2957
  }), B = new ht({
2954
2958
  ...P,
@@ -2973,7 +2977,7 @@ class Ae extends b {
2973
2977
  layer: s
2974
2978
  },
2975
2979
  a
2976
- )), this.replace(s, n || e, D), d || u || f) {
2980
+ )), this.replace(s, n || e, D), u || d || f) {
2977
2981
  const F = D.getBoundingClientRect();
2978
2982
  M = {
2979
2983
  x: Math.floor(F.x - b.SafeBorderPadding),
@@ -3007,8 +3011,8 @@ class Ae extends b {
3007
3011
  if (!n)
3008
3012
  return;
3009
3013
  const a = [];
3010
- for (let d = 0; d < e.length; d += 3)
3011
- a.push([e[d], e[d + 1], e[d + 2]]);
3014
+ for (let u = 0; u < e.length; u += 3)
3015
+ a.push([e[u], e[u + 1], e[u + 2]]);
3012
3016
  const c = s ? this.fullLayer : this.drawLayer || this.fullLayer, l = this.draw({
3013
3017
  ps: a,
3014
3018
  workId: n,
@@ -3031,10 +3035,10 @@ class Ae extends b {
3031
3035
  this.tmpPoints.length = 0;
3032
3036
  }
3033
3037
  static updateNodeOpt(t) {
3034
- var h, p, d;
3038
+ var h, p, u;
3035
3039
  const { node: e, opt: s, vNodes: o } = t, { strokeColor: r, fillColor: n, strokeType: a } = s, c = o.get(e.name);
3036
3040
  let l = e;
3037
- return e.tagName === "GROUP" && (l = e.children[0]), r && (l.setAttribute("strokeColor", r), (h = c == null ? void 0 : c.opt) != null && h.strokeColor && (c.opt.strokeColor = r)), n && (n === "transparent" ? l.setAttribute("fillColor", "rgba(0,0,0,0)") : l.setAttribute("fillColor", n), (p = c == null ? void 0 : c.opt) != null && p.fillColor && (c.opt.fillColor = n)), a && (c != null && c.opt) && ((d = c.opt) != null && d.strokeType) && (c.opt.strokeType = a), c && o.setInfo(e.name, c), b.updateNodeOpt(t);
3041
+ return e.tagName === "GROUP" && (l = e.children[0]), r && (l.setAttribute("strokeColor", r), (h = c == null ? void 0 : c.opt) != null && h.strokeColor && (c.opt.strokeColor = r)), n && (n === "transparent" ? l.setAttribute("fillColor", "rgba(0,0,0,0)") : l.setAttribute("fillColor", n), (p = c == null ? void 0 : c.opt) != null && p.fillColor && (c.opt.fillColor = n)), a && (c != null && c.opt) && ((u = c.opt) != null && u.strokeType) && (c.opt.strokeType = a), c && o.setInfo(e.name, c), b.updateNodeOpt(t);
3038
3042
  }
3039
3043
  }
3040
3044
  class Ee extends b {
@@ -3042,7 +3046,7 @@ class Ee extends b {
3042
3046
  super(t);
3043
3047
  y(this, "canRotate", !1);
3044
3048
  y(this, "scaleType", z.all);
3045
- y(this, "toolsType", k.Star);
3049
+ y(this, "toolsType", S.Star);
3046
3050
  y(this, "tmpPoints", []);
3047
3051
  y(this, "workOptions");
3048
3052
  y(this, "oldRect");
@@ -3061,17 +3065,17 @@ class Ee extends b {
3061
3065
  if (!p || p < 2)
3062
3066
  return { type: w.None };
3063
3067
  h && (this.syncUnitTime = h);
3064
- let d;
3065
- if (this.tmpPoints.length === 0 ? (this.tmpPoints = [new O(l[0], l[1])], d = !1) : d = this.updateTempPoints(l), !d)
3066
- return { type: w.None };
3067
3068
  let u;
3069
+ if (this.tmpPoints.length === 0 ? (this.tmpPoints = [new O(l[0], l[1])], u = !1) : u = this.updateTempPoints(l), !u)
3070
+ return { type: w.None };
3071
+ let d;
3068
3072
  if (o || r || a) {
3069
3073
  const m = s ? this.fullLayer : this.drawLayer || this.fullLayer;
3070
- u = this.draw({ workId: c, layer: m, isDrawing: !0 });
3074
+ d = this.draw({ workId: c, layer: m, isDrawing: !0 });
3071
3075
  }
3072
3076
  if (a) {
3073
- const m = E(u, this.oldRect);
3074
- this.oldRect = u;
3077
+ const m = E(d, this.oldRect);
3078
+ this.oldRect = d;
3075
3079
  const g = {
3076
3080
  rect: m,
3077
3081
  type: w.DrawWork,
@@ -3079,8 +3083,8 @@ class Ee extends b {
3079
3083
  ...this.baseConsumeResult
3080
3084
  };
3081
3085
  if (n) {
3082
- const I = Date.now();
3083
- I - this.syncTimestamp > this.syncUnitTime && (this.syncTimestamp = I, g.op = this.tmpPoints.map((S) => [...S.XY, 0]).flat(1), g.index = 0, g.isSync = !0);
3086
+ const v = Date.now();
3087
+ v - this.syncTimestamp > this.syncUnitTime && (this.syncTimestamp = v, g.op = this.tmpPoints.map((k) => [...k.XY, 0]).flat(1), g.index = 0, g.isSync = !0);
3084
3088
  }
3085
3089
  return g;
3086
3090
  }
@@ -3095,8 +3099,8 @@ class Ee extends b {
3095
3099
  ...this.baseConsumeResult
3096
3100
  }) : { type: w.None };
3097
3101
  }
3098
- const f = E(u, this.oldRect);
3099
- return this.oldRect = u, {
3102
+ const f = E(d, this.oldRect);
3103
+ return this.oldRect = d, {
3100
3104
  rect: f,
3101
3105
  type: w.DrawWork,
3102
3106
  dataType: x.Local,
@@ -3146,19 +3150,19 @@ class Ee extends b {
3146
3150
  zIndex: l,
3147
3151
  vertices: h,
3148
3152
  innerVerticeStep: p,
3149
- innerRatio: d,
3150
- scale: u,
3153
+ innerRatio: u,
3154
+ scale: d,
3151
3155
  rotate: f,
3152
3156
  translate: m,
3153
3157
  strokeType: g,
3154
- eraserlines: I,
3155
- lineDash: S,
3156
- lineCap: v
3158
+ eraserlines: v,
3159
+ lineDash: k,
3160
+ lineCap: I
3157
3161
  } = this.workOptions, L = s.worldScaling, { rect: C, pos: N, points: R } = this.computDrawPoints(
3158
3162
  c,
3159
3163
  h,
3160
3164
  p,
3161
- d
3165
+ u
3162
3166
  ), P = {
3163
3167
  close: !0,
3164
3168
  points: R,
@@ -3166,13 +3170,13 @@ class Ee extends b {
3166
3170
  fillColor: a !== "transparent" && a || void 0,
3167
3171
  strokeColor: n,
3168
3172
  normalize: !0,
3169
- lineCap: v,
3173
+ lineCap: I,
3170
3174
  lineDash: g === G.Dotted ? [
3171
- S && S[0] || 1,
3172
- (S && S[1] || 2) * c
3175
+ k && k[0] || 1,
3176
+ (k && k[1] || 2) * c
3173
3177
  ] : g === G.LongDotted ? [
3174
- (S && S[0] || 1) * c,
3175
- (S && S[1] || 2) * c
3178
+ (k && k[0] || 1) * c,
3179
+ (k && k[1] || 2) * c
3176
3180
  ] : void 0
3177
3181
  }, M = {
3178
3182
  name: e,
@@ -3182,7 +3186,7 @@ class Ee extends b {
3182
3186
  anchor: [0.5, 0.5],
3183
3187
  size: [C.w, C.h]
3184
3188
  };
3185
- u && (M.scale = u), f && (M.rotate = f), m && (M.translate = m);
3189
+ d && (M.scale = d), f && (M.rotate = f), m && (M.translate = m);
3186
3190
  const D = new j(M);
3187
3191
  if (o) {
3188
3192
  const U = new wt({
@@ -3199,10 +3203,10 @@ class Ee extends b {
3199
3203
  ...P,
3200
3204
  pos: [0, 0]
3201
3205
  });
3202
- D.append(B), I && (this.scaleType = z.proportional, this.drawEraserlines(
3206
+ D.append(B), v && (this.scaleType = z.proportional, this.drawEraserlines(
3203
3207
  {
3204
3208
  group: D,
3205
- eraserlines: I,
3209
+ eraserlines: v,
3206
3210
  pos: N,
3207
3211
  layer: s
3208
3212
  },
@@ -3221,10 +3225,10 @@ class Ee extends b {
3221
3225
  Math.floor(r.x + r.w / 2),
3222
3226
  Math.floor(r.y + r.h / 2)
3223
3227
  ], a = We(r.w, r.h), c = Math.floor(Math.min(r.w, r.h) / 2), l = o * c, h = [], p = 2 * Math.PI / e;
3224
- for (let u = 0; u < e; u++) {
3225
- const f = u * p - 0.5 * Math.PI;
3228
+ for (let d = 0; d < e; d++) {
3229
+ const f = d * p - 0.5 * Math.PI;
3226
3230
  let m, g;
3227
- u % s === 1 ? (m = l * a[0] * Math.cos(f), g = l * a[1] * Math.sin(f)) : (m = c * a[0] * Math.cos(f), g = c * a[1] * Math.sin(f), h.push(m, g)), h.push(m, g);
3231
+ d % s === 1 ? (m = l * a[0] * Math.cos(f), g = l * a[1] * Math.sin(f)) : (m = c * a[0] * Math.cos(f), g = c * a[1] * Math.sin(f), h.push(m, g)), h.push(m, g);
3228
3232
  }
3229
3233
  return {
3230
3234
  rect: $(this.tmpPoints, t),
@@ -3281,9 +3285,9 @@ class Ee extends b {
3281
3285
  innerVerticeStep: l,
3282
3286
  innerRatio: h,
3283
3287
  strokeType: p
3284
- } = s, d = o.get(e.name), u = d == null ? void 0 : d.opt;
3288
+ } = s, u = o.get(e.name), d = u == null ? void 0 : u.opt;
3285
3289
  let f = e;
3286
- return e.tagName === "GROUP" && (f = e.children[0]), r && (f.setAttribute("strokeColor", r), u != null && u.strokeColor && (u.strokeColor = r)), n && (n === "transparent" ? f.setAttribute("fillColor", "rgba(0,0,0,0)") : f.setAttribute("fillColor", n), u != null && u.fillColor && (u.fillColor = n)), a === k.Star && (c && (u.vertices = c), l && (u.innerVerticeStep = l), h && (u.innerRatio = h)), p && (d != null && d.opt) && ((m = d.opt) != null && m.strokeType) && (d.opt.strokeType = p), d && o.setInfo(e.name, { ...d, opt: u }), b.updateNodeOpt(t);
3290
+ return e.tagName === "GROUP" && (f = e.children[0]), r && (f.setAttribute("strokeColor", r), d != null && d.strokeColor && (d.strokeColor = r)), n && (n === "transparent" ? f.setAttribute("fillColor", "rgba(0,0,0,0)") : f.setAttribute("fillColor", n), d != null && d.fillColor && (d.fillColor = n)), a === S.Star && (c && (d.vertices = c), l && (d.innerVerticeStep = l), h && (d.innerRatio = h)), p && (u != null && u.opt) && ((m = u.opt) != null && m.strokeType) && (u.opt.strokeType = p), u && o.setInfo(e.name, { ...u, opt: d }), b.updateNodeOpt(t);
3287
3291
  }
3288
3292
  }
3289
3293
  class Be extends b {
@@ -3291,7 +3295,7 @@ class Be extends b {
3291
3295
  super(t);
3292
3296
  y(this, "canRotate", !1);
3293
3297
  y(this, "scaleType", z.all);
3294
- y(this, "toolsType", k.Polygon);
3298
+ y(this, "toolsType", S.Polygon);
3295
3299
  y(this, "tmpPoints", []);
3296
3300
  y(this, "workOptions");
3297
3301
  y(this, "oldRect");
@@ -3311,17 +3315,17 @@ class Be extends b {
3311
3315
  const h = this.workId, p = c == null ? void 0 : c.length;
3312
3316
  if (!p || p < 2)
3313
3317
  return { type: w.None };
3314
- let d;
3315
- if (this.tmpPoints.length === 0 ? (this.tmpPoints = [new O(c[0], c[1])], d = !1) : d = this.updateTempPoints(c), !d)
3316
- return { type: w.None };
3317
3318
  let u;
3319
+ if (this.tmpPoints.length === 0 ? (this.tmpPoints = [new O(c[0], c[1])], u = !1) : u = this.updateTempPoints(c), !u)
3320
+ return { type: w.None };
3321
+ let d;
3318
3322
  if (o || r || a) {
3319
3323
  const m = s ? this.fullLayer : this.drawLayer || this.fullLayer;
3320
- u = this.draw({ workId: h, layer: m, isDrawing: !0 });
3324
+ d = this.draw({ workId: h, layer: m, isDrawing: !0 });
3321
3325
  }
3322
3326
  if (a) {
3323
- const m = E(u, this.oldRect);
3324
- this.oldRect = u;
3327
+ const m = E(d, this.oldRect);
3328
+ this.oldRect = d;
3325
3329
  const g = {
3326
3330
  type: w.DrawWork,
3327
3331
  rect: m,
@@ -3329,8 +3333,8 @@ class Be extends b {
3329
3333
  ...this.baseConsumeResult
3330
3334
  };
3331
3335
  if (n) {
3332
- const I = Date.now();
3333
- I - this.syncTimestamp > this.syncUnitTime && (this.syncTimestamp = I, g.op = this.tmpPoints.map((S) => [...S.XY, 0]).flat(1), g.index = 0, g.isSync = !0);
3336
+ const v = Date.now();
3337
+ v - this.syncTimestamp > this.syncUnitTime && (this.syncTimestamp = v, g.op = this.tmpPoints.map((k) => [...k.XY, 0]).flat(1), g.index = 0, g.isSync = !0);
3334
3338
  }
3335
3339
  return g;
3336
3340
  }
@@ -3345,8 +3349,8 @@ class Be extends b {
3345
3349
  ...this.baseConsumeResult
3346
3350
  }) : { type: w.None };
3347
3351
  }
3348
- const f = E(u, this.oldRect);
3349
- return this.oldRect = u, {
3352
+ const f = E(d, this.oldRect);
3353
+ return this.oldRect = d, {
3350
3354
  rect: f,
3351
3355
  type: w.DrawWork,
3352
3356
  dataType: x.Local,
@@ -3396,13 +3400,13 @@ class Be extends b {
3396
3400
  zIndex: l,
3397
3401
  vertices: h,
3398
3402
  scale: p,
3399
- rotate: d,
3400
- translate: u,
3403
+ rotate: u,
3404
+ translate: d,
3401
3405
  strokeType: f,
3402
3406
  eraserlines: m,
3403
3407
  lineCap: g,
3404
- lineDash: I
3405
- } = this.workOptions, S = s.worldScaling, { rect: v, pos: L, points: C } = this.computDrawPoints(c, h), N = {
3408
+ lineDash: v
3409
+ } = this.workOptions, k = s.worldScaling, { rect: I, pos: L, points: C } = this.computDrawPoints(c, h), N = {
3406
3410
  close: !0,
3407
3411
  points: C,
3408
3412
  lineWidth: c,
@@ -3411,11 +3415,11 @@ class Be extends b {
3411
3415
  normalize: !0,
3412
3416
  lineCap: g,
3413
3417
  lineDash: f === G.Dotted ? [
3414
- I && I[0] || 1,
3415
- (I && I[1] || 2) * c
3418
+ v && v[0] || 1,
3419
+ (v && v[1] || 2) * c
3416
3420
  ] : f === G.LongDotted ? [
3417
- (I && I[0] || 1) * c,
3418
- (I && I[1] || 2) * c
3421
+ (v && v[0] || 1) * c,
3422
+ (v && v[1] || 2) * c
3419
3423
  ] : void 0
3420
3424
  }, R = {
3421
3425
  name: e,
@@ -3423,9 +3427,9 @@ class Be extends b {
3423
3427
  zIndex: l,
3424
3428
  pos: L,
3425
3429
  anchor: [0.5, 0.5],
3426
- size: [v.w, v.h]
3430
+ size: [I.w, I.h]
3427
3431
  };
3428
- p && (R.scale = p), d && (R.rotate = d), u && (R.translate = u);
3432
+ p && (R.scale = p), u && (R.rotate = u), d && (R.translate = d);
3429
3433
  const P = new j(R);
3430
3434
  if (o) {
3431
3435
  const B = new wt({
@@ -3434,7 +3438,7 @@ class Be extends b {
3434
3438
  pos: [0, 0],
3435
3439
  strokeColor: n,
3436
3440
  lineWidth: 1,
3437
- scale: [1 / S[0], 1 / S[1]]
3441
+ scale: [1 / k[0], 1 / k[1]]
3438
3442
  });
3439
3443
  P.append(B);
3440
3444
  }
@@ -3465,8 +3469,8 @@ class Be extends b {
3465
3469
  Math.floor(s.y + s.h / 2)
3466
3470
  ], r = We(s.w, s.h), n = Math.floor(Math.min(s.w, s.h) / 2), a = [], c = 2 * Math.PI / e;
3467
3471
  for (let h = 0; h < e; h++) {
3468
- const p = h * c - 0.5 * Math.PI, d = n * r[0] * Math.cos(p), u = n * r[1] * Math.sin(p);
3469
- a.push(d, u);
3472
+ const p = h * c - 0.5 * Math.PI, u = n * r[0] * Math.cos(p), d = n * r[1] * Math.sin(p);
3473
+ a.push(u, d);
3470
3474
  }
3471
3475
  return {
3472
3476
  rect: $(this.tmpPoints, t),
@@ -3514,10 +3518,10 @@ class Be extends b {
3514
3518
  this.tmpPoints.length = 0;
3515
3519
  }
3516
3520
  static updateNodeOpt(t) {
3517
- var u;
3521
+ var d;
3518
3522
  const { node: e, opt: s, vNodes: o } = t, { strokeColor: r, fillColor: n, toolsType: a, vertices: c, strokeType: l } = s, h = o.get(e.name), p = h == null ? void 0 : h.opt;
3519
- let d = e;
3520
- return e.tagName === "GROUP" && (d = e.children[0]), r && (d.setAttribute("strokeColor", r), p != null && p.strokeColor && (p.strokeColor = r)), n && (n === "transparent" ? d.setAttribute("fillColor", "rgba(0,0,0,0)") : d.setAttribute("fillColor", n), p != null && p.fillColor && (p.fillColor = n)), a === k.Polygon && c && (p.vertices = c), l && (h != null && h.opt) && ((u = h.opt) != null && u.strokeType) && (h.opt.strokeType = l), h && o.setInfo(e.name, { ...h, opt: p }), b.updateNodeOpt(t);
3523
+ let u = e;
3524
+ return e.tagName === "GROUP" && (u = e.children[0]), r && (u.setAttribute("strokeColor", r), p != null && p.strokeColor && (p.strokeColor = r)), n && (n === "transparent" ? u.setAttribute("fillColor", "rgba(0,0,0,0)") : u.setAttribute("fillColor", n), p != null && p.fillColor && (p.fillColor = n)), a === S.Polygon && c && (p.vertices = c), l && (h != null && h.opt) && ((d = h.opt) != null && d.strokeType) && (h.opt.strokeType = l), h && o.setInfo(e.name, { ...h, opt: p }), b.updateNodeOpt(t);
3521
3525
  }
3522
3526
  }
3523
3527
  class ot {
@@ -3587,7 +3591,7 @@ class Fe extends b {
3587
3591
  super(t);
3588
3592
  y(this, "canRotate", !1);
3589
3593
  y(this, "scaleType", z.all);
3590
- y(this, "toolsType", k.SpeechBalloon);
3594
+ y(this, "toolsType", S.SpeechBalloon);
3591
3595
  y(this, "ratio", 0.8);
3592
3596
  y(this, "tmpPoints", []);
3593
3597
  y(this, "workOptions");
@@ -3613,14 +3617,14 @@ class Fe extends b {
3613
3617
  let p;
3614
3618
  if (this.tmpPoints.length === 0 ? (this.tmpPoints = [new O(l[0], l[1])], p = !1) : p = this.updateTempPoints(l), !p)
3615
3619
  return { type: w.None };
3616
- let d;
3620
+ let u;
3617
3621
  if (o || r || a) {
3618
3622
  const m = s ? this.fullLayer : this.drawLayer || this.fullLayer;
3619
- d = this.draw({ workId: c, layer: m, isDrawing: !0 });
3623
+ u = this.draw({ workId: c, layer: m, isDrawing: !0 });
3620
3624
  }
3621
3625
  if (a) {
3622
- const m = E(d, this.oldRect);
3623
- this.oldRect = d;
3626
+ const m = E(u, this.oldRect);
3627
+ this.oldRect = u;
3624
3628
  const g = {
3625
3629
  rect: m,
3626
3630
  type: w.DrawWork,
@@ -3628,8 +3632,8 @@ class Fe extends b {
3628
3632
  ...this.baseConsumeResult
3629
3633
  };
3630
3634
  if (n) {
3631
- const I = Date.now();
3632
- I - this.syncTimestamp > this.syncUnitTime && (this.syncTimestamp = I, g.op = this.tmpPoints.map((S) => [...S.XY, 0]).flat(1), g.index = 0, g.isSync = !0);
3635
+ const v = Date.now();
3636
+ v - this.syncTimestamp > this.syncUnitTime && (this.syncTimestamp = v, g.op = this.tmpPoints.map((k) => [...k.XY, 0]).flat(1), g.index = 0, g.isSync = !0);
3633
3637
  }
3634
3638
  return g;
3635
3639
  }
@@ -3644,9 +3648,9 @@ class Fe extends b {
3644
3648
  ...this.baseConsumeResult
3645
3649
  }) : { type: w.None };
3646
3650
  }
3647
- const u = E(d, this.oldRect);
3648
- return this.oldRect = d, {
3649
- rect: u,
3651
+ const d = E(u, this.oldRect);
3652
+ return this.oldRect = u, {
3653
+ rect: d,
3650
3654
  type: w.DrawWork,
3651
3655
  dataType: x.Local,
3652
3656
  ...this.baseConsumeResult
@@ -3696,24 +3700,24 @@ class Fe extends b {
3696
3700
  placement: l,
3697
3701
  scale: h,
3698
3702
  rotate: p,
3699
- translate: d,
3700
- strokeType: u,
3703
+ translate: u,
3704
+ strokeType: d,
3701
3705
  eraserlines: f,
3702
3706
  lineDash: m,
3703
3707
  lineCap: g
3704
- } = this.workOptions, { rect: I, pos: S, points: v } = this.computDrawPoints(a, l), L = {
3705
- points: v.map((M) => M.XY),
3708
+ } = this.workOptions, { rect: v, pos: k, points: I } = this.computDrawPoints(a, l), L = {
3709
+ points: I.map((M) => M.XY),
3706
3710
  lineWidth: a,
3707
3711
  fillColor: n !== "transparent" && n || void 0,
3708
3712
  strokeColor: r,
3709
3713
  normalize: !0,
3710
- className: `${S[0]},${S[1]}`,
3714
+ className: `${k[0]},${k[1]}`,
3711
3715
  close: !0,
3712
3716
  lineCap: g,
3713
- lineDash: u === G.Dotted ? [
3717
+ lineDash: d === G.Dotted ? [
3714
3718
  m && m[0] || 1,
3715
3719
  (m && m[1] || 2) * a
3716
- ] : u === G.LongDotted ? [
3720
+ ] : d === G.LongDotted ? [
3717
3721
  (m && m[0] || 1) * a,
3718
3722
  (m && m[1] || 2) * a
3719
3723
  ] : void 0
@@ -3721,11 +3725,11 @@ class Fe extends b {
3721
3725
  name: e,
3722
3726
  id: e,
3723
3727
  zIndex: c,
3724
- pos: S,
3728
+ pos: k,
3725
3729
  anchor: [0.5, 0.5],
3726
- size: [I.w, I.h]
3730
+ size: [v.w, v.h]
3727
3731
  };
3728
- h && (C.scale = h), p && (C.rotate = p), d && (C.translate = d);
3732
+ h && (C.scale = h), p && (C.rotate = p), u && (C.translate = u);
3729
3733
  const N = new j(C), R = new ht({
3730
3734
  ...L,
3731
3735
  pos: [0, 0]
@@ -3734,7 +3738,7 @@ class Fe extends b {
3734
3738
  {
3735
3739
  group: N,
3736
3740
  eraserlines: f,
3737
- pos: S,
3741
+ pos: k,
3738
3742
  layer: s
3739
3743
  },
3740
3744
  o
@@ -3802,14 +3806,14 @@ class Fe extends b {
3802
3806
  c,
3803
3807
  o[0],
3804
3808
  l
3805
- ), p = W.Sub(o[1], new W(r, 0, 0)), d = W.Add(
3809
+ ), p = W.Sub(o[1], new W(r, 0, 0)), u = W.Add(
3806
3810
  o[1],
3807
3811
  new W(0, n, 0)
3808
- ), u = ot.getBezierPoints(
3812
+ ), d = ot.getBezierPoints(
3809
3813
  10,
3810
3814
  p,
3811
3815
  o[1],
3812
- d
3816
+ u
3813
3817
  ), f = W.Sub(o[2], new W(0, n, 0)), m = W.Sub(
3814
3818
  o[2],
3815
3819
  new W(r, 0, 0)
@@ -3818,17 +3822,17 @@ class Fe extends b {
3818
3822
  f,
3819
3823
  o[2],
3820
3824
  m
3821
- ), I = W.Add(
3825
+ ), v = W.Add(
3822
3826
  o[3],
3823
3827
  new W(r, 0, 0)
3824
- ), S = W.Sub(
3828
+ ), k = W.Sub(
3825
3829
  o[3],
3826
3830
  new W(0, n, 0)
3827
- ), v = ot.getBezierPoints(
3831
+ ), I = ot.getBezierPoints(
3828
3832
  10,
3829
- I,
3833
+ v,
3830
3834
  o[3],
3831
- S
3835
+ k
3832
3836
  ), L = r * (1 - this.ratio) * 10, C = n * (1 - this.ratio) * 10;
3833
3837
  switch (e) {
3834
3838
  case "bottom": {
@@ -3845,9 +3849,9 @@ class Fe extends b {
3845
3849
  a.push(
3846
3850
  M,
3847
3851
  D,
3848
- ...v,
3852
+ ...I,
3849
3853
  ...h,
3850
- ...u,
3854
+ ...d,
3851
3855
  ...g,
3852
3856
  P
3853
3857
  );
@@ -3867,9 +3871,9 @@ class Fe extends b {
3867
3871
  a.push(
3868
3872
  M,
3869
3873
  D,
3870
- ...v,
3874
+ ...I,
3871
3875
  ...h,
3872
- ...u,
3876
+ ...d,
3873
3877
  ...g,
3874
3878
  P
3875
3879
  );
@@ -3889,9 +3893,9 @@ class Fe extends b {
3889
3893
  a.push(
3890
3894
  M,
3891
3895
  D,
3892
- ...v,
3896
+ ...I,
3893
3897
  ...h,
3894
- ...u,
3898
+ ...d,
3895
3899
  ...g,
3896
3900
  P
3897
3901
  );
@@ -3911,9 +3915,9 @@ class Fe extends b {
3911
3915
  a.push(
3912
3916
  M,
3913
3917
  P,
3914
- ...u,
3918
+ ...d,
3915
3919
  ...g,
3916
- ...v,
3920
+ ...I,
3917
3921
  ...h,
3918
3922
  D
3919
3923
  );
@@ -3933,9 +3937,9 @@ class Fe extends b {
3933
3937
  a.push(
3934
3938
  M,
3935
3939
  P,
3936
- ...u,
3940
+ ...d,
3937
3941
  ...g,
3938
- ...v,
3942
+ ...I,
3939
3943
  ...h,
3940
3944
  D
3941
3945
  );
@@ -3955,9 +3959,9 @@ class Fe extends b {
3955
3959
  a.push(
3956
3960
  M,
3957
3961
  P,
3958
- ...u,
3962
+ ...d,
3959
3963
  ...g,
3960
- ...v,
3964
+ ...I,
3961
3965
  ...h,
3962
3966
  D
3963
3967
  );
@@ -3978,9 +3982,9 @@ class Fe extends b {
3978
3982
  M,
3979
3983
  P,
3980
3984
  ...h,
3981
- ...u,
3985
+ ...d,
3982
3986
  ...g,
3983
- ...v,
3987
+ ...I,
3984
3988
  D
3985
3989
  );
3986
3990
  break;
@@ -4000,9 +4004,9 @@ class Fe extends b {
4000
4004
  M,
4001
4005
  P,
4002
4006
  ...h,
4003
- ...u,
4007
+ ...d,
4004
4008
  ...g,
4005
- ...v,
4009
+ ...I,
4006
4010
  D
4007
4011
  );
4008
4012
  break;
@@ -4022,9 +4026,9 @@ class Fe extends b {
4022
4026
  M,
4023
4027
  P,
4024
4028
  ...h,
4025
- ...u,
4029
+ ...d,
4026
4030
  ...g,
4027
- ...v,
4031
+ ...I,
4028
4032
  D
4029
4033
  );
4030
4034
  break;
@@ -4044,9 +4048,9 @@ class Fe extends b {
4044
4048
  M,
4045
4049
  D,
4046
4050
  ...g,
4047
- ...v,
4051
+ ...I,
4048
4052
  ...h,
4049
- ...u,
4053
+ ...d,
4050
4054
  P
4051
4055
  );
4052
4056
  break;
@@ -4066,9 +4070,9 @@ class Fe extends b {
4066
4070
  M,
4067
4071
  D,
4068
4072
  ...g,
4069
- ...v,
4073
+ ...I,
4070
4074
  ...h,
4071
- ...u,
4075
+ ...d,
4072
4076
  P
4073
4077
  );
4074
4078
  break;
@@ -4088,9 +4092,9 @@ class Fe extends b {
4088
4092
  M,
4089
4093
  D,
4090
4094
  ...g,
4091
- ...v,
4095
+ ...I,
4092
4096
  ...h,
4093
- ...u,
4097
+ ...d,
4094
4098
  P
4095
4099
  );
4096
4100
  break;
@@ -4146,10 +4150,10 @@ class Fe extends b {
4146
4150
  this.tmpPoints.length = 0;
4147
4151
  }
4148
4152
  static updateNodeOpt(t) {
4149
- var u;
4153
+ var d;
4150
4154
  const { node: e, opt: s, vNodes: o } = t, { strokeColor: r, fillColor: n, toolsType: a, placement: c, strokeType: l } = s, h = o.get(e.name), p = h == null ? void 0 : h.opt;
4151
- let d = e;
4152
- return e.tagName === "GROUP" && (d = e.children[0]), r && (d.setAttribute("strokeColor", r), p != null && p.strokeColor && (p.strokeColor = r)), n && (n === "transparent" ? d.setAttribute("fillColor", "rgba(0,0,0,0)") : d.setAttribute("fillColor", n), p != null && p.fillColor && (p.fillColor = n)), a === k.SpeechBalloon && c && (p.placement = c), l && (h != null && h.opt) && ((u = h.opt) != null && u.strokeType) && (h.opt.strokeType = l), h && o.setInfo(e.name, { ...h, opt: p }), b.updateNodeOpt(t);
4155
+ let u = e;
4156
+ return e.tagName === "GROUP" && (u = e.children[0]), r && (u.setAttribute("strokeColor", r), p != null && p.strokeColor && (p.strokeColor = r)), n && (n === "transparent" ? u.setAttribute("fillColor", "rgba(0,0,0,0)") : u.setAttribute("fillColor", n), p != null && p.fillColor && (p.fillColor = n)), a === S.SpeechBalloon && c && (p.placement = c), l && (h != null && h.opt) && ((d = h.opt) != null && d.strokeType) && (h.opt.strokeType = l), h && o.setInfo(e.name, { ...h, opt: p }), b.updateNodeOpt(t);
4153
4157
  }
4154
4158
  }
4155
4159
  var Vs = Pe, Hs = te, qs = "[object Boolean]";
@@ -4163,7 +4167,7 @@ class ze extends b {
4163
4167
  super(t);
4164
4168
  y(this, "canRotate", !1);
4165
4169
  y(this, "scaleType", z.both);
4166
- y(this, "toolsType", k.Straight);
4170
+ y(this, "toolsType", S.Straight);
4167
4171
  y(this, "tmpPoints", []);
4168
4172
  y(this, "workOptions");
4169
4173
  y(this, "oldRect");
@@ -4183,17 +4187,17 @@ class ze extends b {
4183
4187
  if (!p || p < 2)
4184
4188
  return { type: w.None };
4185
4189
  h && (this.syncUnitTime = h);
4186
- let d;
4187
- if (this.tmpPoints.length === 0 ? (this.tmpPoints = [new O(l[0], l[1])], d = !1) : d = this.updateTempPoints(l), !d)
4188
- return { type: w.None };
4189
4190
  let u;
4191
+ if (this.tmpPoints.length === 0 ? (this.tmpPoints = [new O(l[0], l[1])], u = !1) : u = this.updateTempPoints(l), !u)
4192
+ return { type: w.None };
4193
+ let d;
4190
4194
  if (o || r || a) {
4191
4195
  const m = s ? this.fullLayer : this.drawLayer || this.fullLayer;
4192
- u = this.draw({ workId: c, layer: m });
4196
+ d = this.draw({ workId: c, layer: m });
4193
4197
  }
4194
4198
  if (a) {
4195
- const m = E(u, this.oldRect);
4196
- this.oldRect = u;
4199
+ const m = E(d, this.oldRect);
4200
+ this.oldRect = d;
4197
4201
  const g = {
4198
4202
  rect: m,
4199
4203
  type: w.DrawWork,
@@ -4201,8 +4205,8 @@ class ze extends b {
4201
4205
  ...this.baseConsumeResult
4202
4206
  };
4203
4207
  if (n) {
4204
- const I = Date.now();
4205
- I - this.syncTimestamp > this.syncUnitTime && (this.syncTimestamp = I, g.op = this.tmpPoints.map((S) => [...S.XY, 0]).flat(1), g.index = 0, g.isSync = !0);
4208
+ const v = Date.now();
4209
+ v - this.syncTimestamp > this.syncUnitTime && (this.syncTimestamp = v, g.op = this.tmpPoints.map((k) => [...k.XY, 0]).flat(1), g.index = 0, g.isSync = !0);
4206
4210
  }
4207
4211
  return g;
4208
4212
  }
@@ -4217,8 +4221,8 @@ class ze extends b {
4217
4221
  ...this.baseConsumeResult
4218
4222
  }) : { type: w.None };
4219
4223
  }
4220
- const f = E(u, this.oldRect);
4221
- return this.oldRect = u, {
4224
+ const f = E(d, this.oldRect);
4225
+ return this.oldRect = d, {
4222
4226
  rect: f,
4223
4227
  type: w.DrawWork,
4224
4228
  dataType: x.Local,
@@ -4265,16 +4269,16 @@ class ze extends b {
4265
4269
  rotate: l,
4266
4270
  translate: h,
4267
4271
  strokeType: p,
4268
- eraserlines: d,
4269
- lineCap: u,
4272
+ eraserlines: u,
4273
+ lineCap: d,
4270
4274
  lineDash: f
4271
- } = this.workOptions, m = s.worldPosition, g = s.worldScaling, { d: I, rect: S, isDot: v } = this.computDrawPoints(n, p), L = [
4272
- S.x + S.w / 2,
4273
- S.y + S.h / 2
4275
+ } = this.workOptions, m = s.worldPosition, g = s.worldScaling, { d: v, rect: k, isDot: I } = this.computDrawPoints(n, p), L = [
4276
+ k.x + k.w / 2,
4277
+ k.y + k.h / 2
4274
4278
  ], C = new j({
4275
4279
  pos: L,
4276
4280
  anchor: [0.5, 0.5],
4277
- size: [S.w, S.h],
4281
+ size: [k.w, k.h],
4278
4282
  name: e,
4279
4283
  id: e,
4280
4284
  normalize: !0,
@@ -4282,25 +4286,25 @@ class ze extends b {
4282
4286
  }), N = {
4283
4287
  pos: [0, 0],
4284
4288
  normalize: !0,
4285
- d: I,
4289
+ d: v,
4286
4290
  fillColor: r,
4287
4291
  strokeColor: r,
4288
- lineDash: v ? void 0 : p === G.Dotted ? [
4292
+ lineDash: I ? void 0 : p === G.Dotted ? [
4289
4293
  f && f[0] || 1,
4290
4294
  (f && f[1] || 2) * n
4291
4295
  ] : p === G.LongDotted ? [
4292
4296
  (f && f[0] || 1) * n,
4293
4297
  (f && f[1] || 2) * n
4294
4298
  ] : void 0,
4295
- lineCap: v ? void 0 : u,
4296
- lineWidth: p === G.Normal || v ? 0 : n
4299
+ lineCap: I ? void 0 : d,
4300
+ lineWidth: p === G.Normal || I ? 0 : n
4297
4301
  };
4298
4302
  c && (N.scale = c), l && (N.rotate = l), h && (N.translate = h);
4299
4303
  const R = new wt(N);
4300
- C.append(R), d && (this.scaleType = z.proportional, this.drawEraserlines(
4304
+ C.append(R), u && (this.scaleType = z.proportional, this.drawEraserlines(
4301
4305
  {
4302
4306
  group: C,
4303
- eraserlines: d,
4307
+ eraserlines: u,
4304
4308
  pos: L,
4305
4309
  layer: s
4306
4310
  },
@@ -4308,16 +4312,16 @@ class ze extends b {
4308
4312
  )), this.replace(s, e, C);
4309
4313
  let P = {
4310
4314
  x: Math.floor(
4311
- S.x * g[0] + m[0] - b.SafeBorderPadding
4315
+ k.x * g[0] + m[0] - b.SafeBorderPadding
4312
4316
  ),
4313
4317
  y: Math.floor(
4314
- S.y * g[1] + m[1] - b.SafeBorderPadding
4318
+ k.y * g[1] + m[1] - b.SafeBorderPadding
4315
4319
  ),
4316
4320
  w: Math.floor(
4317
- S.w * g[0] + 2 * b.SafeBorderPadding
4321
+ k.w * g[0] + 2 * b.SafeBorderPadding
4318
4322
  ),
4319
4323
  h: Math.floor(
4320
- S.h * g[1] + 2 * b.SafeBorderPadding
4324
+ k.h * g[1] + 2 * b.SafeBorderPadding
4321
4325
  )
4322
4326
  };
4323
4327
  if (l || c || h) {
@@ -4365,9 +4369,9 @@ class ze extends b {
4365
4369
  n,
4366
4370
  ...h
4367
4371
  ];
4368
- let d;
4369
- return e !== G.Normal ? d = mt(this.tmpPoints, !1) : d = mt(p, !0), {
4370
- d,
4372
+ let u;
4373
+ return e !== G.Normal ? u = mt(this.tmpPoints, !1) : u = mt(p, !0), {
4374
+ d: u,
4371
4375
  rect: $(p),
4372
4376
  isDot: !1,
4373
4377
  pos: this.tmpPoints[0].XY
@@ -4437,7 +4441,7 @@ const ft = class ft extends b {
4437
4441
  super(t);
4438
4442
  y(this, "canRotate", !1);
4439
4443
  y(this, "scaleType", z.proportional);
4440
- y(this, "toolsType", k.Text);
4444
+ y(this, "toolsType", S.Text);
4441
4445
  y(this, "tmpPoints", []);
4442
4446
  y(this, "workOptions");
4443
4447
  y(this, "oldRect");
@@ -4466,27 +4470,27 @@ const ft = class ft extends b {
4466
4470
  anchor: [0, 0],
4467
4471
  size: n,
4468
4472
  zIndex: c
4469
- }, d = new j(p), u = {
4473
+ }, u = new j(p), d = {
4470
4474
  x: a[0] - Bt,
4471
4475
  y: a[1] - Bt,
4472
4476
  w: n[0],
4473
4477
  h: n[1]
4474
4478
  }, f = {
4475
- x: Math.floor(u.x * h[0] + l[0]),
4476
- y: Math.floor(u.y * h[1] + l[1]),
4477
- w: Math.floor(u.w * h[0]) + 2,
4478
- h: Math.floor(u.h * h[1]) + 2
4479
+ x: Math.floor(d.x * h[0] + l[0]),
4480
+ y: Math.floor(d.y * h[1] + l[1]),
4481
+ w: Math.floor(d.w * h[0]) + 2,
4482
+ h: Math.floor(d.h * h[1]) + 2
4479
4483
  };
4480
- this.replace(s, e, d);
4484
+ this.replace(s, e, u);
4481
4485
  let m;
4482
4486
  if (r && (m = Rt(f, r)), (o || r && m !== Vt.outside) && s && this.workOptions.text) {
4483
- const g = await ft.createLabels(this.workOptions, s, f), { labels: I, maxWidth: S } = g;
4484
- d.append(...I), f.w = Math.ceil(Math.max(S * s.worldScaling[0], f.w));
4487
+ const g = await ft.createLabels(this.workOptions, s, f), { labels: v, maxWidth: k } = g;
4488
+ u.append(...v), f.w = Math.ceil(Math.max(k * s.worldScaling[0], f.w));
4485
4489
  }
4486
4490
  return f;
4487
4491
  }
4488
4492
  async consumeServiceAsync(t) {
4489
- var l, h, p, d;
4493
+ var l, h, p, u;
4490
4494
  const e = (l = this.workId) == null ? void 0 : l.toString();
4491
4495
  if (!e)
4492
4496
  return;
@@ -4498,7 +4502,7 @@ const ft = class ft extends b {
4498
4502
  isDrawLabel: typeof r > "u" && this.workOptions.workState === A.Done || r,
4499
4503
  boxRect: n
4500
4504
  });
4501
- return (d = this.vNodes) == null || d.setInfo(e, {
4505
+ return (u = this.vNodes) == null || u.setInfo(e, {
4502
4506
  rect: c,
4503
4507
  op: [],
4504
4508
  opt: this.workOptions,
@@ -4522,25 +4526,25 @@ const ft = class ft extends b {
4522
4526
  lineThrough: l,
4523
4527
  underline: h,
4524
4528
  zIndex: p
4525
- } = t, d = (f = this.vNodes) == null ? void 0 : f.get(o);
4526
- if (!d)
4529
+ } = t, u = (f = this.vNodes) == null ? void 0 : f.get(o);
4530
+ if (!u)
4527
4531
  return;
4528
- r && (d.opt.fontColor = r), n && (d.opt.fontBgColor = n), a && (d.opt.bold = a), c && (d.opt.italic = c), kt(l) && (d.opt.lineThrough = l), kt(h) && (d.opt.underline = h), H(p) && (d.opt.zIndex = p), this.oldRect = d.rect;
4529
- const u = await this.draw({
4532
+ r && (u.opt.fontColor = r), n && (u.opt.fontBgColor = n), a && (u.opt.bold = a), c && (u.opt.italic = c), kt(l) && (u.opt.lineThrough = l), kt(h) && (u.opt.underline = h), q(p) && (u.opt.zIndex = p), this.oldRect = u.rect;
4533
+ const d = await this.draw({
4530
4534
  workId: o,
4531
4535
  layer: this.fullLayer,
4532
4536
  isDrawLabel: typeof e > "u" && this.workOptions.workState === A.Done || e,
4533
4537
  boxRect: s
4534
4538
  });
4535
4539
  return (m = this.vNodes) == null || m.setInfo(o, {
4536
- rect: u,
4540
+ rect: d,
4537
4541
  op: [],
4538
4542
  opt: this.workOptions,
4539
4543
  toolsType: this.toolsType,
4540
4544
  scaleType: this.scaleType,
4541
4545
  canRotate: this.canRotate,
4542
- centerPos: u && b.getCenterPos(u, this.fullLayer)
4543
- }), u;
4546
+ centerPos: d && b.getCenterPos(d, this.fullLayer)
4547
+ }), d;
4544
4548
  }
4545
4549
  clearTmpPoints() {
4546
4550
  this.tmpPoints.length = 0;
@@ -4557,23 +4561,23 @@ const ft = class ft extends b {
4557
4561
  var D;
4558
4562
  const o = [], { x: r, y: n } = s, { width: a, height: c } = (D = e.parent) == null ? void 0 : D.parent, l = yt(t.text), h = l.length, {
4559
4563
  fontSize: p,
4560
- lineHeight: d,
4561
- bold: u,
4564
+ lineHeight: u,
4565
+ bold: d,
4562
4566
  textAlign: f,
4563
4567
  italic: m,
4564
4568
  fontFamily: g,
4565
- verticalAlign: I,
4566
- fontColor: S,
4567
- fontBgColor: v,
4569
+ verticalAlign: v,
4570
+ fontColor: k,
4571
+ fontBgColor: I,
4568
4572
  underline: L,
4569
4573
  lineThrough: C
4570
4574
  } = t, N = ft.getSafetySnippetRatio(e) || 1, R = Math.floor(p * N), P = ft.getSafetySnippetFontLength(R);
4571
4575
  let M = 0;
4572
4576
  for (let B = 0; B < h; B++) {
4573
- const F = l[B], U = d || R * 1.5;
4577
+ const F = l[B], U = u || R * 1.5;
4574
4578
  if (F) {
4575
- const V = is(F), Z = [0, 0], K = [0, p * 1.2];
4576
- I === "middle" && (Z[1] = Math.floor(
4579
+ const H = is(F), Z = [0, 0], K = [0, p * 1.2];
4580
+ v === "middle" && (Z[1] = Math.floor(
4577
4581
  B * p * 1.2 + 6 + p * (1.1 - 1)
4578
4582
  ));
4579
4583
  const nt = [0, Math.floor(-p * 0.15)];
@@ -4582,7 +4586,7 @@ const ft = class ft extends b {
4582
4586
  let pt = 0;
4583
4587
  const Ot = [];
4584
4588
  let Ct = 0;
4585
- for (; Ct < V; ) {
4589
+ for (; Ct < H; ) {
4586
4590
  f === "left" && (nt[0] = pt), Ct === 0 && m === "italic" && (nt[0] = nt[0] - gt / 2 * p);
4587
4591
  const qt = F.slice(Ct, Ct + P), At = {
4588
4592
  anchor: [0, 0],
@@ -4591,9 +4595,9 @@ const ft = class ft extends b {
4591
4595
  fontFamily: g,
4592
4596
  fontSize: R,
4593
4597
  lineHeight: U,
4594
- strokeColor: S,
4595
- fontWeight: u,
4596
- fillColor: S,
4598
+ strokeColor: k,
4599
+ fontWeight: d,
4600
+ fillColor: k,
4597
4601
  textAlign: f,
4598
4602
  fontStyle: m,
4599
4603
  scale: [1 / N, 1 / N]
@@ -4603,7 +4607,7 @@ const ft = class ft extends b {
4603
4607
  const ae = at.rect && at.rect[2], ce = at.rect && at.rect[3];
4604
4608
  if (ae && ce) {
4605
4609
  const le = ae / N, $e = ce / N;
4606
- pt = le + pt, m === "italic" && (u === "bold" ? pt = pt - gt * p * 1.2 : pt = pt - gt * p), ((nt[0] + Z[0] + le) * e.worldScaling[0] + r <= 0 || (nt[0] + Z[0]) * e.worldScaling[0] + r >= a || (nt[1] + Z[1] + $e) * e.worldScaling[1] + n <= 0 || (nt[1] + Z[1]) * e.worldScaling[1] + n >= c) && (dt.disconnect(), Et = !1), Et && Ot.push(dt);
4610
+ pt = le + pt, m === "italic" && (d === "bold" ? pt = pt - gt * p * 1.2 : pt = pt - gt * p), ((nt[0] + Z[0] + le) * e.worldScaling[0] + r <= 0 || (nt[0] + Z[0]) * e.worldScaling[0] + r >= a || (nt[1] + Z[1] + $e) * e.worldScaling[1] + n <= 0 || (nt[1] + Z[1]) * e.worldScaling[1] + n >= c) && (dt.disconnect(), Et = !1), Et && Ot.push(dt);
4607
4611
  }
4608
4612
  }
4609
4613
  Ct += P;
@@ -4617,7 +4621,7 @@ const ft = class ft extends b {
4617
4621
  pos: [0, p * 1.1 + dt / 2],
4618
4622
  lineWidth: dt,
4619
4623
  points: [0, 0, Math.ceil(K[0]), 0],
4620
- strokeColor: S,
4624
+ strokeColor: k,
4621
4625
  className: "underline"
4622
4626
  }, Et = new ht(at);
4623
4627
  Ot.push(Et);
@@ -4628,7 +4632,7 @@ const ft = class ft extends b {
4628
4632
  pos: [0, p * 1.2 / 2],
4629
4633
  lineWidth: Math.floor(p / 10),
4630
4634
  points: [0, 0, Math.ceil(K[0]), 0],
4631
- strokeColor: S,
4635
+ strokeColor: k,
4632
4636
  className: "lineThrough"
4633
4637
  }, at = new ht(dt);
4634
4638
  Ot.push(at);
@@ -4637,7 +4641,7 @@ const ft = class ft extends b {
4637
4641
  pos: Z,
4638
4642
  anchor: [0, 0],
4639
4643
  size: K,
4640
- bgcolor: v
4644
+ bgcolor: I
4641
4645
  }, At = new j(qt);
4642
4646
  At.append(...Ot), o.push(At);
4643
4647
  }
@@ -4653,36 +4657,36 @@ const ft = class ft extends b {
4653
4657
  originPoint: l,
4654
4658
  scenePoint: h,
4655
4659
  scale: p,
4656
- bold: d,
4657
- italic: u,
4660
+ bold: u,
4661
+ italic: d,
4658
4662
  lineThrough: f,
4659
4663
  underline: m,
4660
4664
  fontSize: g,
4661
- textInfos: I,
4662
- zIndex: S
4663
- } = s, v = r && st(r) || o.get(e.name);
4664
- if (!v || !e.parent) return;
4665
- const C = v.opt;
4666
- if (H(S) && (e.setAttribute("zIndex", S), v.opt.zIndex = S), a && C.fontColor && (C.fontColor = a, e.children.forEach((N) => {
4665
+ textInfos: v,
4666
+ zIndex: k
4667
+ } = s, I = r && st(r) || o.get(e.name);
4668
+ if (!I || !e.parent) return;
4669
+ const C = I.opt;
4670
+ if (q(k) && (e.setAttribute("zIndex", k), I.opt.zIndex = k), a && C.fontColor && (C.fontColor = a, e.children.forEach((N) => {
4667
4671
  N.tagName === "GROUP" && N.children.forEach((R) => {
4668
4672
  R.tagName === "LABEL" ? (R.setAttribute("fillColor", a), R.setAttribute("strokeColor", a)) : R.tagName === "POLYLINE" && R.setAttribute("strokeColor", a);
4669
4673
  });
4670
4674
  })), n && C.fontBgColor && (C.fontBgColor = n, e.children.forEach((N) => {
4671
4675
  N.tagName === "GROUP" && N.setAttribute("bgcolor", n);
4672
- })), d && (C.bold = d), u && (C.italic = u), kt(f) && (C.lineThrough = f), kt(m) && (C.underline = m), g && (C.fontSize = g), l && h && p && r && C.boxPoint) {
4673
- const N = I == null ? void 0 : I.get(e.name);
4676
+ })), u && (C.bold = u), d && (C.italic = d), kt(f) && (C.lineThrough = f), kt(m) && (C.underline = m), g && (C.fontSize = g), l && h && p && r && C.boxPoint) {
4677
+ const N = v == null ? void 0 : v.get(e.name);
4674
4678
  if (N) {
4675
4679
  const { fontSize: D, boxSize: B } = N;
4676
4680
  C.boxSize = B || C.boxSize, C.fontSize = D || C.fontSize;
4677
4681
  }
4678
4682
  const R = [C.boxPoint[0], C.boxPoint[1]];
4679
4683
  Ht(C.boxPoint, h, p, c);
4680
- const P = [v.op[0], v.op[1]], M = [P[0] - R[0], P[1] - R[1]];
4681
- if (v.centerPos = [
4682
- v.centerPos[0] + M[0],
4683
- v.centerPos[1] + M[1]
4684
- ], v.opt.eraserlines)
4685
- for (const D of v.opt.eraserlines) {
4684
+ const P = [I.op[0], I.op[1]], M = [P[0] - R[0], P[1] - R[1]];
4685
+ if (I.centerPos = [
4686
+ I.centerPos[0] + M[0],
4687
+ I.centerPos[1] + M[1]
4688
+ ], I.opt.eraserlines)
4689
+ for (const D of I.opt.eraserlines) {
4686
4690
  const { op: B, thickness: F } = D;
4687
4691
  D.thickness = Math.round(F * Math.max(p[0], p[1]));
4688
4692
  for (let U = 0; U < B.length; U++)
@@ -4691,18 +4695,18 @@ const ft = class ft extends b {
4691
4695
  } else if (c && C.boxPoint && (C.boxPoint = [
4692
4696
  Math.round(C.boxPoint[0] + c[0]),
4693
4697
  Math.round(C.boxPoint[1] + c[1])
4694
- ], v.centerPos = [
4695
- v.centerPos[0] + c[0],
4696
- v.centerPos[1] + c[1]
4697
- ], v.opt.eraserlines))
4698
- for (const N of v.opt.eraserlines) {
4698
+ ], I.centerPos = [
4699
+ I.centerPos[0] + c[0],
4700
+ I.centerPos[1] + c[1]
4701
+ ], I.opt.eraserlines))
4702
+ for (const N of I.opt.eraserlines) {
4699
4703
  const { op: R } = N;
4700
4704
  for (let P = 0; P < R.length; P++) {
4701
4705
  const M = R[P].map((D, B) => B % 2 ? D + c[1] : D + c[0]);
4702
4706
  N.op[P] = M;
4703
4707
  }
4704
4708
  }
4705
- return v && o.setInfo(e.name, v), v == null ? void 0 : v.rect;
4709
+ return I && o.setInfo(e.name, I), I == null ? void 0 : I.rect;
4706
4710
  }
4707
4711
  static getRectFromLayer(t, e) {
4708
4712
  const s = t.getElementsByName(e)[0];
@@ -4736,7 +4740,7 @@ const It = class It extends b {
4736
4740
  super(t);
4737
4741
  y(this, "canRotate", !1);
4738
4742
  y(this, "scaleType", z.none);
4739
- y(this, "toolsType", k.PencilEraser);
4743
+ y(this, "toolsType", S.PencilEraser);
4740
4744
  y(this, "tmpPoints", []);
4741
4745
  y(this, "workOptions");
4742
4746
  y(this, "worldPosition");
@@ -4796,59 +4800,59 @@ const It = class It extends b {
4796
4800
  return { willDeleteNodes: o, willNewNodes: s, rect: r };
4797
4801
  const l = this.computEraserPointLines(this.tmpPoints, 90);
4798
4802
  for (const [h, p] of c.entries()) {
4799
- if (p.toolsType !== k.Pencil)
4803
+ if (p.toolsType !== S.Pencil)
4800
4804
  continue;
4801
- let d = Nt(p.rect, [-n[0], -n[1]]);
4802
- d = {
4803
- x: d.x / this.worldScaling[0],
4804
- y: d.y / this.worldScaling[1],
4805
- w: d.w / this.worldScaling[0],
4806
- h: d.h / this.worldScaling[1]
4805
+ let u = Nt(p.rect, [-n[0], -n[1]]);
4806
+ u = {
4807
+ x: u.x / this.worldScaling[0],
4808
+ y: u.y / this.worldScaling[1],
4809
+ w: u.w / this.worldScaling[0],
4810
+ h: u.h / this.worldScaling[1]
4807
4811
  };
4808
- const u = [
4809
- d.x,
4810
- d.y,
4811
- d.x + d.w,
4812
- d.y + d.h
4812
+ const d = [
4813
+ u.x,
4814
+ u.y,
4815
+ u.x + u.w,
4816
+ u.y + u.h
4813
4817
  ], f = [], m = [];
4814
4818
  for (const g of l)
4815
- ie.polyline(g, u, f);
4819
+ ie.polyline(g, d, f);
4816
4820
  if (f.length && p.opt)
4817
4821
  for (const g of f) {
4818
- const I = [];
4819
- for (let S = 0; S < g.length; S++)
4820
- S !== 0 && lt(g[S], g[S - 1]) || I.push(...g[S]);
4821
- m.push(I);
4822
+ const v = [];
4823
+ for (let k = 0; k < g.length; k++)
4824
+ k !== 0 && lt(g[k], g[k - 1]) || v.push(...g[k]);
4825
+ m.push(v);
4822
4826
  }
4823
4827
  if (m.length && e) {
4824
4828
  const g = e.createWorkShapeNode({
4825
4829
  workId: h,
4826
- toolsType: k.Pencil,
4830
+ toolsType: S.Pencil,
4827
4831
  toolsOpt: p.opt
4828
4832
  });
4829
4833
  g.setWorkId(h);
4830
- const I = g == null ? void 0 : g.computPencilPoints({
4834
+ const v = g == null ? void 0 : g.computPencilPoints({
4831
4835
  op: p.op,
4832
4836
  eraserPolylines: m,
4833
4837
  eraserThickness: t
4834
4838
  });
4835
- if (r = E(r, p.rect), o.add(h), e.removeNode(h), I.length)
4836
- for (let S = 0; S < I.length; S++) {
4837
- const v = `${h}_${Date.now()}_${S}`, L = v, N = e.setFullWork({
4839
+ if (r = E(r, p.rect), o.add(h), e.removeNode(h), v.length)
4840
+ for (let k = 0; k < v.length; k++) {
4841
+ const I = `${h}_${Date.now()}_${k}`, L = I, N = e.setFullWork({
4838
4842
  workId: L,
4839
4843
  opt: p.opt,
4840
- toolsType: k.Pencil
4844
+ toolsType: S.Pencil
4841
4845
  }).consumeService({
4842
- op: I[S],
4846
+ op: v[k],
4843
4847
  isFullWork: !0,
4844
4848
  replaceId: L
4845
4849
  });
4846
- e.clearWorkShapeNodeCache(L), r = E(r, N), s.set(v, {
4850
+ e.clearWorkShapeNodeCache(L), r = E(r, N), s.set(I, {
4847
4851
  ...p,
4848
- toolsType: k.Pencil,
4852
+ toolsType: S.Pencil,
4849
4853
  rect: N ?? p.rect,
4850
- name: v,
4851
- op: I[S]
4854
+ name: I,
4855
+ op: v[k]
4852
4856
  });
4853
4857
  }
4854
4858
  }
@@ -4899,8 +4903,8 @@ const It = class It extends b {
4899
4903
  rect: l
4900
4904
  };
4901
4905
  const h = [];
4902
- this.tmpPoints.map((d) => {
4903
- h.push(d.x, d.y, n / 2);
4906
+ this.tmpPoints.map((u) => {
4907
+ h.push(u.x, u.y, n / 2);
4904
4908
  });
4905
4909
  const p = tt(h);
4906
4910
  return {
@@ -4925,7 +4929,7 @@ const Pt = class Pt extends b {
4925
4929
  super(t);
4926
4930
  y(this, "canRotate", !1);
4927
4931
  y(this, "scaleType", z.none);
4928
- y(this, "toolsType", k.BitMapEraser);
4932
+ y(this, "toolsType", S.BitMapEraser);
4929
4933
  y(this, "tmpPoints", []);
4930
4934
  y(this, "workOptions");
4931
4935
  y(this, "worldPosition");
@@ -4982,53 +4986,53 @@ const Pt = class Pt extends b {
4982
4986
  return { willDeleteNodes: o, willUpdateNodes: s, rect: r };
4983
4987
  const l = this.computEraserPointLines(this.tmpPoints, 120);
4984
4988
  for (const [h, p] of c.entries()) {
4985
- if (p.toolsType === k.Text || p.toolsType === k.Image)
4989
+ if (p.toolsType === S.Text || p.toolsType === S.Image)
4986
4990
  continue;
4987
- let d = Nt(p.rect, [-n[0], -n[1]]);
4988
- d = {
4989
- x: d.x / this.worldScaling[0],
4990
- y: d.y / this.worldScaling[1],
4991
- w: d.w / this.worldScaling[0],
4992
- h: d.h / this.worldScaling[1]
4991
+ let u = Nt(p.rect, [-n[0], -n[1]]);
4992
+ u = {
4993
+ x: u.x / this.worldScaling[0],
4994
+ y: u.y / this.worldScaling[1],
4995
+ w: u.w / this.worldScaling[0],
4996
+ h: u.h / this.worldScaling[1]
4993
4997
  };
4994
- const u = [
4995
- d.x,
4996
- d.y,
4997
- d.x + d.w,
4998
- d.y + d.h
4998
+ const d = [
4999
+ u.x,
5000
+ u.y,
5001
+ u.x + u.w,
5002
+ u.y + u.h
4999
5003
  ], f = [], m = [];
5000
- for (const S of l)
5001
- ie.polyline(S, u, f);
5004
+ for (const k of l)
5005
+ ie.polyline(k, d, f);
5002
5006
  if (f.length && p.opt)
5003
- for (const S of f) {
5004
- const v = [];
5005
- for (let L = 0; L < S.length && !(isNaN(S[L][0]) || isNaN(S[L][1])); L++) {
5006
- const C = S[L].map((N) => Math.round(N * 100) / 100);
5007
+ for (const k of f) {
5008
+ const I = [];
5009
+ for (let L = 0; L < k.length && !(isNaN(k[L][0]) || isNaN(k[L][1])); L++) {
5010
+ const C = k[L].map((N) => Math.round(N * 100) / 100);
5007
5011
  if (L !== 0) {
5008
- const N = S[L - 1].map((R) => Math.round(R * 100) / 100);
5012
+ const N = k[L - 1].map((R) => Math.round(R * 100) / 100);
5009
5013
  if (lt(C, N))
5010
5014
  continue;
5011
5015
  }
5012
- v.push(...C);
5016
+ I.push(...C);
5013
5017
  }
5014
- v.length !== 0 && m.push(v);
5018
+ I.length !== 0 && m.push(I);
5015
5019
  }
5016
5020
  if (!m.length)
5017
5021
  continue;
5018
- const g = p.opt.eraserlines ? p.opt.eraserlines : [], I = g.find((S) => S.workId === this.workId);
5019
- if (I ? I.op = m : g.push({ workId: this.workId, op: m, thickness: t }), p.opt.eraserlines = g, e) {
5020
- const { toolsType: S } = p, v = e.createWorkShapeNode({
5022
+ const g = p.opt.eraserlines ? p.opt.eraserlines : [], v = g.find((k) => k.workId === this.workId);
5023
+ if (v ? v.op = m : g.push({ workId: this.workId, op: m, thickness: t }), p.opt.eraserlines = g, e) {
5024
+ const { toolsType: k } = p, I = e.createWorkShapeNode({
5021
5025
  workId: h,
5022
- toolsType: S,
5026
+ toolsType: k,
5023
5027
  toolsOpt: p.opt
5024
5028
  });
5025
- v == null || v.setWorkId(h);
5026
- const L = v == null ? void 0 : v.consumeService({
5029
+ I == null || I.setWorkId(h);
5030
+ const L = I == null ? void 0 : I.consumeService({
5027
5031
  op: p.op,
5028
5032
  isFullWork: !0,
5029
5033
  replaceId: h
5030
5034
  });
5031
- if (r = E(r, L), v != null && v.isDelete) {
5035
+ if (r = E(r, L), I != null && I.isDelete) {
5032
5036
  e.removeNode(h), o.add(h);
5033
5037
  continue;
5034
5038
  }
@@ -5081,8 +5085,8 @@ const Pt = class Pt extends b {
5081
5085
  rect: l
5082
5086
  };
5083
5087
  const h = [];
5084
- this.tmpPoints.map((d) => {
5085
- h.push(d.x, d.y, n / 2);
5088
+ this.tmpPoints.map((u) => {
5089
+ h.push(u.x, u.y, n / 2);
5086
5090
  });
5087
5091
  const p = tt(h);
5088
5092
  return {
@@ -5107,7 +5111,7 @@ class xt extends b {
5107
5111
  super(t);
5108
5112
  y(this, "canRotate", !1);
5109
5113
  y(this, "scaleType", z.all);
5110
- y(this, "toolsType", k.BackgroundSVG);
5114
+ y(this, "toolsType", S.BackgroundSVG);
5111
5115
  y(this, "tmpPoints", []);
5112
5116
  y(this, "workOptions");
5113
5117
  y(this, "oldRect");
@@ -5120,21 +5124,21 @@ class xt extends b {
5120
5124
  return { type: w.None };
5121
5125
  }
5122
5126
  draw(t) {
5123
- const { layer: e, workId: s, replaceId: o } = t, { centerX: r, centerY: n, width: a, height: c, rotate: l, zIndex: h } = this.workOptions, p = (h || 0) - 100, d = new j({
5127
+ const { layer: e, workId: s, replaceId: o } = t, { centerX: r, centerY: n, width: a, height: c, rotate: l, zIndex: h } = this.workOptions, p = (h || 0) - 100, u = new j({
5124
5128
  anchor: [0.5, 0.5],
5125
5129
  pos: [r, n],
5126
5130
  name: s,
5127
5131
  size: [a, c],
5128
5132
  zIndex: p,
5129
5133
  rotate: l
5130
- }), u = new Kt({
5134
+ }), d = new Kt({
5131
5135
  normalize: !0,
5132
5136
  pos: [0, 0],
5133
5137
  width: a,
5134
5138
  height: c
5135
5139
  });
5136
- d.appendChild(u), this.replace(e, o || s, d);
5137
- const f = d.getBoundingClientRect();
5140
+ u.appendChild(d), this.replace(e, o || s, u);
5141
+ const f = u.getBoundingClientRect();
5138
5142
  if (f)
5139
5143
  return {
5140
5144
  x: Math.floor(f.x - b.SafeBorderPadding),
@@ -5171,123 +5175,123 @@ class xt extends b {
5171
5175
  scale: l,
5172
5176
  angle: h,
5173
5177
  isLocked: p,
5174
- zIndexForBackgroundSVG: d
5175
- } = s, u = r && st(r) || o.get(e.name);
5176
- if (!u) return;
5178
+ zIndexForBackgroundSVG: u
5179
+ } = s, d = r && st(r) || o.get(e.name);
5180
+ if (!d) return;
5177
5181
  const f = e.parent;
5178
5182
  if (f) {
5179
- if (H(d)) {
5180
- const m = (d || 0) - 100;
5181
- e.setAttribute("zIndex", m), u.opt.zIndex = d;
5183
+ if (q(u)) {
5184
+ const m = (u || 0) - 100;
5185
+ e.setAttribute("zIndex", m), d.opt.zIndex = u;
5182
5186
  }
5183
- if (kt(p) && (u.opt.locked = p), a && c && l && n) {
5184
- const { centerX: m, centerY: g, width: I, height: S, uniformScale: v } = u.opt, L = v !== !1 ? [l[0], l[0]] : l, C = [m, g], N = [m, g];
5187
+ if (kt(p) && (d.opt.locked = p), a && c && l && n) {
5188
+ const { centerX: m, centerY: g, width: v, height: k, uniformScale: I } = d.opt, L = I !== !1 ? [l[0], l[0]] : l, C = [m, g], N = [m, g];
5185
5189
  Ht(N, c, L, n);
5186
5190
  const R = [
5187
5191
  N[0] - C[0],
5188
5192
  N[1] - C[1]
5189
5193
  ];
5190
- u.centerPos = [
5191
- u.centerPos[0] + R[0],
5192
- u.centerPos[1] + R[1]
5193
- ], u.opt.width = Math.round(I * L[0]), u.opt.height = Math.round(S * L[1]), u.opt.centerX = N[0], u.opt.centerY = N[1];
5194
+ d.centerPos = [
5195
+ d.centerPos[0] + R[0],
5196
+ d.centerPos[1] + R[1]
5197
+ ], d.opt.width = Math.round(v * L[0]), d.opt.height = Math.round(k * L[1]), d.opt.centerX = N[0], d.opt.centerY = N[1];
5194
5198
  } else if (n)
5195
- u.opt.centerX = u.opt.centerX + n[0], u.opt.centerY = u.opt.centerY + n[1], u.centerPos = [
5196
- u.centerPos[0] + n[0],
5197
- u.centerPos[1] + n[1]
5199
+ d.opt.centerX = d.opt.centerX + n[0], d.opt.centerY = d.opt.centerY + n[1], d.centerPos = [
5200
+ d.centerPos[0] + n[0],
5201
+ d.centerPos[1] + n[1]
5198
5202
  ];
5199
- else if (H(h))
5200
- if (u.opt.rotate = h, u.scaleType = xt.getScaleType(
5201
- u.opt
5203
+ else if (q(h))
5204
+ if (d.opt.rotate = h, d.scaleType = xt.getScaleType(
5205
+ d.opt
5202
5206
  ), r) {
5203
- const m = se(u.rect, h);
5204
- u.rect = m;
5207
+ const m = se(d.rect, h);
5208
+ d.rect = m;
5205
5209
  } else {
5206
5210
  const m = b.getRectFromLayer(f, e.name);
5207
- u.rect = m || u.rect;
5211
+ d.rect = m || d.rect;
5208
5212
  }
5209
- return u && o.setInfo(e.name, u), u == null ? void 0 : u.rect;
5213
+ return d && o.setInfo(e.name, d), d == null ? void 0 : d.rect;
5210
5214
  }
5211
5215
  }
5212
5216
  }
5213
5217
  function Ue(T) {
5214
5218
  switch (T) {
5215
- case k.Arrow:
5219
+ case S.Arrow:
5216
5220
  return Me;
5217
- case k.Pencil:
5221
+ case S.Pencil:
5218
5222
  return Ne;
5219
- case k.Straight:
5223
+ case S.Straight:
5220
5224
  return ze;
5221
- case k.Ellipse:
5225
+ case S.Ellipse:
5222
5226
  return Oe;
5223
- case k.Polygon:
5224
- case k.Triangle:
5227
+ case S.Polygon:
5228
+ case S.Triangle:
5225
5229
  return Be;
5226
- case k.Star:
5227
- case k.Rhombus:
5230
+ case S.Star:
5231
+ case S.Rhombus:
5228
5232
  return Ee;
5229
- case k.Rectangle:
5233
+ case S.Rectangle:
5230
5234
  return Ae;
5231
- case k.SpeechBalloon:
5235
+ case S.SpeechBalloon:
5232
5236
  return Fe;
5233
- case k.Text:
5237
+ case S.Text:
5234
5238
  return Xt;
5235
- case k.LaserPen:
5239
+ case S.LaserPen:
5236
5240
  return xe;
5237
- case k.Eraser:
5241
+ case S.Eraser:
5238
5242
  return Ut;
5239
- case k.PencilEraser:
5243
+ case S.PencilEraser:
5240
5244
  return Yt;
5241
- case k.BitMapEraser:
5245
+ case S.BitMapEraser:
5242
5246
  return $t;
5243
- case k.Selector:
5247
+ case S.Selector:
5244
5248
  return Gt;
5245
- case k.Image:
5249
+ case S.Image:
5246
5250
  return Dt;
5247
- case k.BackgroundSVG:
5251
+ case S.BackgroundSVG:
5248
5252
  return xt;
5249
5253
  }
5250
5254
  }
5251
5255
  function Lt(T, i) {
5252
5256
  const { toolsType: t, ...e } = T;
5253
5257
  switch (t) {
5254
- case k.Arrow:
5258
+ case S.Arrow:
5255
5259
  return new Me(e);
5256
- case k.Pencil:
5260
+ case S.Pencil:
5257
5261
  return new Ne(e);
5258
- case k.Straight:
5262
+ case S.Straight:
5259
5263
  return new ze(e);
5260
- case k.Ellipse:
5264
+ case S.Ellipse:
5261
5265
  return new Oe(e);
5262
- case k.Polygon:
5263
- case k.Triangle:
5266
+ case S.Polygon:
5267
+ case S.Triangle:
5264
5268
  return new Be(e);
5265
- case k.Star:
5266
- case k.Rhombus:
5269
+ case S.Star:
5270
+ case S.Rhombus:
5267
5271
  return new Ee(e);
5268
- case k.Rectangle:
5272
+ case S.Rectangle:
5269
5273
  return new Ae(e);
5270
- case k.SpeechBalloon:
5274
+ case S.SpeechBalloon:
5271
5275
  return new Fe(e);
5272
- case k.Text:
5276
+ case S.Text:
5273
5277
  return new Xt(e);
5274
- case k.LaserPen:
5278
+ case S.LaserPen:
5275
5279
  return new xe(e);
5276
- case k.Eraser:
5280
+ case S.Eraser:
5277
5281
  return new Ut(e, i);
5278
- case k.BitMapEraser:
5282
+ case S.BitMapEraser:
5279
5283
  return new $t(e);
5280
- case k.PencilEraser:
5284
+ case S.PencilEraser:
5281
5285
  return new Yt(e);
5282
- case k.Selector:
5286
+ case S.Selector:
5283
5287
  return e.vNodes ? new Gt({
5284
5288
  ...e,
5285
5289
  vNodes: e.vNodes,
5286
5290
  drawLayer: e.fullLayer
5287
5291
  }) : void 0;
5288
- case k.Image:
5292
+ case S.Image:
5289
5293
  return new Dt(e);
5290
- case k.BackgroundSVG:
5294
+ case S.BackgroundSVG:
5291
5295
  return new xt({
5292
5296
  ...e,
5293
5297
  toolsOpt: e.toolsOpt
@@ -5348,7 +5352,7 @@ class Xe {
5348
5352
  getCanEraserNodes(i, t) {
5349
5353
  const e = /* @__PURE__ */ new Map();
5350
5354
  for (const [s, o] of i.entries())
5351
- o.toolsType !== k.BackgroundSVG && (o.toolsType === k.Image && o.opt.type === Mt.Image && (o.opt.locked || t && t.disableEraseImage) || o.toolsType === k.Text && (o.opt.workState === A.Doing || o.opt.workState === A.Start || t && t.disableEraseText) || this.isCanClearWorkId(s) && e.set(s, o));
5355
+ o.toolsType !== S.BackgroundSVG && (o.toolsType === S.Image && o.opt.type === Mt.Image && (o.opt.locked || t && t.disableEraseImage) || o.toolsType === S.Text && (o.opt.workState === A.Doing || o.opt.workState === A.Start || t && t.disableEraseText) || this.isCanClearWorkId(s) && e.set(s, o));
5352
5356
  return e;
5353
5357
  }
5354
5358
  getNodesByType(i) {
@@ -5394,7 +5398,7 @@ class Xe {
5394
5398
  const o = /* @__PURE__ */ new Map();
5395
5399
  for (const [r, n] of this.curNodeMap.entries())
5396
5400
  if (Zt(i, n.rect)) {
5397
- if (t && n.toolsType === k.Image && n.opt.locked || e && n.toolsType === k.Text && (n.opt.workState === A.Doing || n.opt.workState === A.Start))
5401
+ if (t && n.toolsType === S.Image && n.opt.locked || e && n.toolsType === S.Text && (n.opt.workState === A.Doing || n.opt.workState === A.Start))
5398
5402
  continue;
5399
5403
  s = E(s, n.rect), o.set(r, n);
5400
5404
  }
@@ -5551,7 +5555,7 @@ class Ks {
5551
5555
  const { msgType: t, toolsType: e, opt: s, imageSrc: o, imageBitmap: r, workId: n, dpr: a } = i;
5552
5556
  switch (t) {
5553
5557
  case w.UpdateDpr: {
5554
- H(a) && await this.updateDpr(a);
5558
+ q(a) && await this.updateDpr(a);
5555
5559
  break;
5556
5560
  }
5557
5561
  case w.UpdateCamera: {
@@ -5602,7 +5606,7 @@ class Ks {
5602
5606
  }
5603
5607
  async loadImageBitMap(i) {
5604
5608
  const { toolsType: t, opt: e, workId: s, isSubWorker: o } = i;
5605
- if (t === k.Image && e && s) {
5609
+ if (t === S.Image && e && s) {
5606
5610
  const r = s.toString(), { src: n, type: a, width: c, height: l, strokeColor: h } = e;
5607
5611
  if (!n || !a || !c || !l)
5608
5612
  return;
@@ -5627,8 +5631,8 @@ class Ks {
5627
5631
  timer: void 0
5628
5632
  };
5629
5633
  g.timer && clearTimeout(g.timer), g.resolve = m, g.timer = setTimeout(() => {
5630
- const I = this.imageResolveMap.get(p);
5631
- I != null && I.resolve && I.resolve(p);
5634
+ const v = this.imageResolveMap.get(p);
5635
+ v != null && v.resolve && v.resolve(p);
5632
5636
  }, 5e3), this.imageResolveMap.set(p, g), this._post({
5633
5637
  sp: [
5634
5638
  {
@@ -5718,7 +5722,7 @@ class Ks {
5718
5722
  }
5719
5723
  destroy() {
5720
5724
  var i;
5721
- this.vNodes.clear(), this.fullLayer.remove(), q(this.fullLayer, this.fullLayer.parent), this.clearCacheImages(), this.clearImageResolveMap(), this.scene.remove(), this.localWork.destroy(), (i = this.serviceWork) == null || i.destroy();
5725
+ this.vNodes.clear(), this.fullLayer.remove(), V(this.fullLayer, this.fullLayer.parent), this.clearCacheImages(), this.clearImageResolveMap(), this.scene.remove(), this.localWork.destroy(), (i = this.serviceWork) == null || i.destroy();
5722
5726
  }
5723
5727
  async post(i) {
5724
5728
  this.combinePostMsg.add(i), await this.runBatchPostData();
@@ -5745,8 +5749,8 @@ class Ks {
5745
5749
  if (!p || !(p.parent instanceof ms))
5746
5750
  continue;
5747
5751
  if (p.parent.render(), l.isDrawAll) {
5748
- const d = this.getSceneRect();
5749
- l.rect = d, delete l.isDrawAll;
5752
+ const u = this.getSceneRect();
5753
+ l.rect = u, delete l.isDrawAll;
5750
5754
  }
5751
5755
  }
5752
5756
  for (const p of i)
@@ -5772,7 +5776,7 @@ class Ks {
5772
5776
  }
5773
5777
  h || t.push(l);
5774
5778
  }
5775
- H(c.fullWorkerDrawCount) && (e = c.fullWorkerDrawCount), H(c.subWorkerDrawCount) && (s = c.subWorkerDrawCount), H(c.consumeCount) && (o = c.consumeCount);
5779
+ q(c.fullWorkerDrawCount) && (e = c.fullWorkerDrawCount), q(c.subWorkerDrawCount) && (s = c.subWorkerDrawCount), q(c.consumeCount) && (o = c.consumeCount);
5776
5780
  }
5777
5781
  return this.combinePostMsg.clear(), {
5778
5782
  render: i,
@@ -5873,11 +5877,15 @@ class Ye {
5873
5877
  if (t && e && s) {
5874
5878
  const o = t.toString();
5875
5879
  let r;
5876
- return t && this.workShapes.has(o) ? (r = this.workShapes.get(o), r == null || r.setWorkOptions(e)) : r = this.createWorkShapeNode({
5880
+ return t && this.workShapes.has(o) ? (r = this.workShapes.get(o), (r == null ? void 0 : r.toolsType) !== s ? (r == null || r.clearTmpPoints(), this.workShapes.delete(o), r = void 0) : r == null || r.setWorkOptions(e)) : r = this.createWorkShapeNode({
5877
5881
  toolsOpt: e,
5878
5882
  toolsType: s,
5879
5883
  workId: o
5880
- }), r ? (this.workShapes.set(o, r), r) : void 0;
5884
+ }), r || (r = this.createWorkShapeNode({
5885
+ toolsOpt: e,
5886
+ toolsType: s,
5887
+ workId: o
5888
+ })), r ? (this.workShapes.set(o, r), r) : void 0;
5881
5889
  }
5882
5890
  }
5883
5891
  }
@@ -5911,7 +5919,7 @@ class Qs extends Ye {
5911
5919
  dataType: x.Local
5912
5920
  }), this.drawWorkActiveId = void 0), !this.drawWorkActiveId && r !== X && (this.drawWorkActiveId = r);
5913
5921
  const a = n.toolsType;
5914
- H(o) && (this.consumeCount = o);
5922
+ q(o) && (this.consumeCount = o);
5915
5923
  const c = n.consume({
5916
5924
  data: t,
5917
5925
  drawCount: this.drawCount,
@@ -5920,25 +5928,25 @@ class Qs extends Ye {
5920
5928
  removeDrawCount: s
5921
5929
  });
5922
5930
  switch (a) {
5923
- case k.Selector:
5931
+ case S.Selector:
5924
5932
  c && (this.drawCount++, await this.drawSelector(c));
5925
5933
  break;
5926
- case k.Ellipse:
5927
- case k.Arrow:
5928
- case k.Straight:
5929
- case k.Rectangle:
5930
- case k.Star:
5931
- case k.Polygon:
5932
- case k.SpeechBalloon: {
5934
+ case S.Ellipse:
5935
+ case S.Arrow:
5936
+ case S.Straight:
5937
+ case S.Rectangle:
5938
+ case S.Star:
5939
+ case S.Polygon:
5940
+ case S.SpeechBalloon: {
5933
5941
  c && (this.drawCount++, await this.drawShape(c));
5934
5942
  break;
5935
5943
  }
5936
- case k.Pencil: {
5944
+ case S.Pencil: {
5937
5945
  c && (this.drawCount++, await this.drawPencil(c, e == null ? void 0 : e.toString()));
5938
5946
  break;
5939
5947
  }
5940
- case k.BitMapEraser:
5941
- case k.PencilEraser: {
5948
+ case S.BitMapEraser:
5949
+ case S.PencilEraser: {
5942
5950
  c && (this.drawCount++, await this._post({
5943
5951
  subWorkerDrawCount: this.drawCount,
5944
5952
  consumeCount: this.consumeCount
@@ -5956,7 +5964,7 @@ class Qs extends Ye {
5956
5964
  if (!o)
5957
5965
  return;
5958
5966
  switch (o.toolsType) {
5959
- case k.Selector:
5967
+ case S.Selector:
5960
5968
  this.drawCount = 0, Q(this.fullLayer, this.fullLayer.parent), this.clearWorkShapeNodeCache(s), this._post({
5961
5969
  render: [
5962
5970
  {
@@ -5967,16 +5975,16 @@ class Qs extends Ye {
5967
5975
  ]
5968
5976
  });
5969
5977
  break;
5970
- case k.Arrow:
5971
- case k.Straight:
5972
- case k.Ellipse:
5973
- case k.Pencil:
5974
- case k.Rectangle:
5975
- case k.Star:
5976
- case k.Polygon:
5977
- case k.SpeechBalloon:
5978
- case k.BitMapEraser:
5979
- case k.PencilEraser:
5978
+ case S.Arrow:
5979
+ case S.Straight:
5980
+ case S.Ellipse:
5981
+ case S.Pencil:
5982
+ case S.Rectangle:
5983
+ case S.Star:
5984
+ case S.Polygon:
5985
+ case S.SpeechBalloon:
5986
+ case S.BitMapEraser:
5987
+ case S.PencilEraser:
5980
5988
  this.drawCount = 0, Q(this.fullLayer, this.fullLayer.parent), this.clearWorkShapeNodeCache(s);
5981
5989
  break;
5982
5990
  }
@@ -6016,7 +6024,7 @@ class Qs extends Ye {
6016
6024
  y: r.y - b.SafeBorderPadding,
6017
6025
  w: r.width + b.SafeBorderPadding * 2,
6018
6026
  h: r.height + b.SafeBorderPadding * 2
6019
- }), o.remove(), q(o, this.fullLayer.parent);
6027
+ }), o.remove(), V(o, this.fullLayer.parent);
6020
6028
  }), s && this.clearWorkShapeNodeCache(t)), s;
6021
6029
  }
6022
6030
  async drawPencil(t, e) {
@@ -6088,7 +6096,7 @@ class Js {
6088
6096
  this.viewId = i.viewId, this.vNodes = i.vNodes, this.topLayer = i.topLayer, this.thread = i.thread, this.post = i.thread.post.bind(i.thread);
6089
6097
  }
6090
6098
  canUseTopLayer(i) {
6091
- return i === k.LaserPen;
6099
+ return i === S.LaserPen;
6092
6100
  }
6093
6101
  getWorkShape(i) {
6094
6102
  return this.localWorkShapes.get(i);
@@ -6113,7 +6121,7 @@ class Js {
6113
6121
  }
6114
6122
  createWorkShapeNode(i) {
6115
6123
  const { toolsType: t } = i;
6116
- if (t === k.LaserPen)
6124
+ if (t === S.LaserPen)
6117
6125
  return Lt({
6118
6126
  ...i,
6119
6127
  vNodes: this.vNodes,
@@ -6181,13 +6189,13 @@ class Js {
6181
6189
  }), t;
6182
6190
  }
6183
6191
  activeServiceWorkShape(i) {
6184
- var p, d;
6192
+ var p, u;
6185
6193
  const { workId: t, opt: e, toolsType: s, type: o, updateNodeOpt: r, ops: n, op: a } = i;
6186
6194
  if (!t)
6187
6195
  return;
6188
6196
  const c = t.toString(), l = (p = this.vNodes.get(c)) == null ? void 0 : p.rect;
6189
- if (!((d = this.serviceWorkShapes) != null && d.has(c))) {
6190
- let u = {
6197
+ if (!((u = this.serviceWorkShapes) != null && u.has(c))) {
6198
+ let d = {
6191
6199
  toolsType: s,
6192
6200
  animationWorkData: a || [],
6193
6201
  animationIndex: 0,
@@ -6196,7 +6204,7 @@ class Js {
6196
6204
  ops: n,
6197
6205
  oldRect: l
6198
6206
  };
6199
- s && e && (u = this.setNodeKey(c, u, s, e)), this.serviceWorkShapes.set(c, u);
6207
+ s && e && (d = this.setNodeKey(c, d, s, e)), this.serviceWorkShapes.set(c, d);
6200
6208
  }
6201
6209
  const h = this.serviceWorkShapes.get(c);
6202
6210
  o && (h.type = o), n && (h.animationWorkData = yt(n), h.ops = n), r && (h.updateNodeOpt = r), a && (h.animationWorkData = a), h.node && h.node.getWorkId() !== c && h.node.setWorkId(c), l && (h.oldRect = l), s && e && (h.toolsType !== s && s && e && this.setNodeKey(c, h, s, e), h.node && h.node.setWorkOptions(e));
@@ -6217,21 +6225,21 @@ class Js {
6217
6225
  const t = /* @__PURE__ */ new Map(), e = [], s = [], o = [];
6218
6226
  for (const [l, h] of this.serviceWorkShapes.entries())
6219
6227
  switch (h.toolsType) {
6220
- case k.LaserPen: {
6221
- const d = this.computNextAnimationIndex(
6228
+ case S.LaserPen: {
6229
+ const u = this.computNextAnimationIndex(
6222
6230
  h,
6223
6231
  8
6224
- ), u = Math.max(0, h.animationIndex || 0), f = (h.animationWorkData || []).slice(
6225
- u,
6226
- d
6232
+ ), d = Math.max(0, h.animationIndex || 0), f = (h.animationWorkData || []).slice(
6233
+ d,
6234
+ u
6227
6235
  );
6228
- if ((h.animationIndex || 0) < d) {
6236
+ if ((h.animationIndex || 0) < u) {
6229
6237
  const m = (r = h.node) == null ? void 0 : r.consumeService({
6230
6238
  op: f,
6231
6239
  isFullWork: !1
6232
6240
  });
6233
- h.totalRect = E(h.totalRect, m), h.animationIndex = d, f.length && t.set(l, {
6234
- workState: u === 0 ? A.Start : d === ((n = h.animationWorkData) == null ? void 0 : n.length) ? A.Done : A.Doing,
6241
+ h.totalRect = E(h.totalRect, m), h.animationIndex = u, f.length && t.set(l, {
6242
+ workState: d === 0 ? A.Start : u === ((n = h.animationWorkData) == null ? void 0 : n.length) ? A.Done : A.Doing,
6235
6243
  op: f.slice(-2)
6236
6244
  });
6237
6245
  }
@@ -6253,16 +6261,16 @@ class Js {
6253
6261
  }
6254
6262
  }
6255
6263
  for (const [l, h] of this.localWorkShapes.entries()) {
6256
- const { result: p, toolsType: d, totalRect: u, isDel: f, workState: m } = h;
6257
- switch (d) {
6258
- case k.LaserPen: {
6259
- if (u && (s.push({
6264
+ const { result: p, toolsType: u, totalRect: d, isDel: f, workState: m } = h;
6265
+ switch (u) {
6266
+ case S.LaserPen: {
6267
+ if (d && (s.push({
6260
6268
  isClear: !0,
6261
- rect: u,
6269
+ rect: d,
6262
6270
  clearCanvas: _.TopFloat,
6263
6271
  viewId: this.viewId
6264
6272
  }), e.push({
6265
- rect: u,
6273
+ rect: d,
6266
6274
  drawCanvas: _.TopFloat,
6267
6275
  viewId: this.viewId
6268
6276
  })), f) {
@@ -6390,13 +6398,13 @@ class to extends Ye {
6390
6398
  if (e) {
6391
6399
  let r, n;
6392
6400
  const a = (o = e.getWorkId()) == null ? void 0 : o.toString();
6393
- return e.toolsType === k.BackgroundSVG ? r = e.consumeService({
6401
+ return e.toolsType === S.BackgroundSVG ? r = e.consumeService({
6394
6402
  isFullWork: !0,
6395
6403
  replaceId: a
6396
- }) : e.toolsType === k.Image ? r = await e.consumeServiceAsync({
6404
+ }) : e.toolsType === S.Image ? r = await e.consumeServiceAsync({
6397
6405
  isFullWork: !0,
6398
6406
  worker: this.thread
6399
- }) : e.toolsType === k.Text ? r = await e.consumeServiceAsync({
6407
+ }) : e.toolsType === S.Text ? r = await e.consumeServiceAsync({
6400
6408
  isFullWork: !0,
6401
6409
  replaceId: a,
6402
6410
  isDrawLabel: !0
@@ -6568,7 +6576,7 @@ class eo extends Ks {
6568
6576
  return;
6569
6577
  }
6570
6578
  case w.DrawWork: {
6571
- n === A.Done && r === x.Local ? (await this.consumeDrawAll(r, t), s === k.LaserPen && a && this.post({
6579
+ n === A.Done && r === x.Local ? (await this.consumeDrawAll(r, t), s === S.LaserPen && a && this.post({
6572
6580
  sp: [
6573
6581
  {
6574
6582
  type: w.None,
@@ -6583,7 +6591,11 @@ class eo extends Ks {
6583
6591
  return;
6584
6592
  }
6585
6593
  case w.FullWork: {
6586
- s && ((l = this.topLayerWork) != null && l.canUseTopLayer(s)) && await this.consumeDrawAll(r, t);
6594
+ s && ((l = this.topLayerWork) != null && l.canUseTopLayer(s)) ? await this.consumeDrawAll(r, t) : r === x.Local && t.clearPreviewLocalWork && t.workId && await this.localWork.consumeDrawAll({
6595
+ ...t,
6596
+ msgType: w.DrawWork,
6597
+ workState: A.Done
6598
+ });
6587
6599
  return;
6588
6600
  }
6589
6601
  case w.Snapshot: {
@@ -6728,13 +6740,13 @@ class eo extends Ks {
6728
6740
  if (c.totalRect) {
6729
6741
  let l;
6730
6742
  (o = this.topLayer) == null || o.getElementsByName(a.toString()).forEach((h) => {
6731
- const p = h.getBoundingClientRect(), d = ut({
6743
+ const p = h.getBoundingClientRect(), u = ut({
6732
6744
  x: p.x,
6733
6745
  y: p.y,
6734
6746
  w: p.width,
6735
6747
  h: p.height
6736
6748
  });
6737
- l = E(l, d);
6749
+ l = E(l, u);
6738
6750
  }), c.totalRect = l, this.topLayerWork.localWorkShapes.set(a, c);
6739
6751
  }
6740
6752
  }
@@ -6753,7 +6765,7 @@ class Dt extends b {
6753
6765
  super(t);
6754
6766
  y(this, "canRotate", !0);
6755
6767
  y(this, "scaleType", z.all);
6756
- y(this, "toolsType", k.Image);
6768
+ y(this, "toolsType", S.Image);
6757
6769
  y(this, "tmpPoints", []);
6758
6770
  y(this, "workOptions");
6759
6771
  y(this, "oldRect");
@@ -6766,7 +6778,7 @@ class Dt extends b {
6766
6778
  return { type: w.None };
6767
6779
  }
6768
6780
  draw(t) {
6769
- const { layer: e, workId: s, replaceId: o, imageBitmap: r } = t, { centerX: n, centerY: a, width: c, height: l, rotate: h, zIndex: p, eraserlines: d } = this.workOptions, u = new j({
6781
+ const { layer: e, workId: s, replaceId: o, imageBitmap: r } = t, { centerX: n, centerY: a, width: c, height: l, rotate: h, zIndex: p, eraserlines: u } = this.workOptions, d = new j({
6770
6782
  anchor: [0.5, 0.5],
6771
6783
  pos: [n, a],
6772
6784
  name: s,
@@ -6781,13 +6793,13 @@ class Dt extends b {
6781
6793
  };
6782
6794
  r || (f.bgcolor = "rgba(0,0,0,0.3)");
6783
6795
  const m = new Ce(f);
6784
- u.append(m), d && this.drawEraserlines({
6785
- group: u,
6786
- eraserlines: d,
6796
+ d.append(m), u && this.drawEraserlines({
6797
+ group: d,
6798
+ eraserlines: u,
6787
6799
  pos: [n, a],
6788
6800
  layer: e
6789
- }), this.replace(e, o || s, u);
6790
- const g = u.getBoundingClientRect();
6801
+ }), this.replace(e, o || s, d);
6802
+ const g = d.getBoundingClientRect();
6791
6803
  if (g)
6792
6804
  return {
6793
6805
  x: Math.floor(g.x - b.SafeBorderPadding),
@@ -6799,18 +6811,18 @@ class Dt extends b {
6799
6811
  consumeService() {
6800
6812
  }
6801
6813
  async consumeServiceAsync(t) {
6802
- var l, h, p, d;
6814
+ var l, h, p, u;
6803
6815
  const { isFullWork: e, replaceId: s, worker: o } = t, { src: r, uuid: n } = this.workOptions, a = ((l = this.workId) == null ? void 0 : l.toString()) || n, c = e ? this.fullLayer : this.drawLayer || this.fullLayer;
6804
6816
  if (r) {
6805
- const u = await o.loadImageBitMap({
6817
+ const d = await o.loadImageBitMap({
6806
6818
  toolsType: this.toolsType,
6807
6819
  opt: this.workOptions,
6808
6820
  workId: a,
6809
6821
  isSubWorker: o instanceof eo
6810
6822
  });
6811
- if (u) {
6812
- const f = this.draw({ workId: a, layer: c, replaceId: s, imageBitmap: u });
6813
- return this.oldRect = a && ((p = (h = this.vNodes) == null ? void 0 : h.get(a)) == null ? void 0 : p.rect) || void 0, (d = this.vNodes) == null || d.setInfo(a, {
6823
+ if (d) {
6824
+ const f = this.draw({ workId: a, layer: c, replaceId: s, imageBitmap: d });
6825
+ return this.oldRect = a && ((p = (h = this.vNodes) == null ? void 0 : h.get(a)) == null ? void 0 : p.rect) || void 0, (u = this.vNodes) == null || u.setInfo(a, {
6814
6826
  rect: f,
6815
6827
  op: [],
6816
6828
  opt: this.workOptions,
@@ -6837,14 +6849,14 @@ class Dt extends b {
6837
6849
  scale: l,
6838
6850
  angle: h,
6839
6851
  isLocked: p,
6840
- zIndex: d,
6841
- strokeColor: u
6852
+ zIndex: u,
6853
+ strokeColor: d
6842
6854
  } = s, f = r && st(r) || o.get(e.name);
6843
6855
  if (!f) return;
6844
6856
  const m = e.parent;
6845
6857
  if (m) {
6846
- if (u && (f.opt.strokeColor = u), H(d) && (e.setAttribute("zIndex", d), f.opt.zIndex = d), kt(p) && (f.opt.locked = p), a && c && l && n) {
6847
- const { centerX: g, centerY: I, width: S, height: v, uniformScale: L } = f.opt, C = L !== !1 ? [l[0], l[0]] : l, N = [g, I], R = [g, I];
6858
+ if (d && (f.opt.strokeColor = d), q(u) && (e.setAttribute("zIndex", u), f.opt.zIndex = u), kt(p) && (f.opt.locked = p), a && c && l && n) {
6859
+ const { centerX: g, centerY: v, width: k, height: I, uniformScale: L } = f.opt, C = L !== !1 ? [l[0], l[0]] : l, N = [g, v], R = [g, v];
6848
6860
  Ht(R, c, C, n);
6849
6861
  const P = [
6850
6862
  R[0] - N[0],
@@ -6853,7 +6865,7 @@ class Dt extends b {
6853
6865
  if (f.centerPos = [
6854
6866
  f.centerPos[0] + P[0],
6855
6867
  f.centerPos[1] + P[1]
6856
- ], f.opt.width = Math.round(S * C[0]), f.opt.height = Math.round(v * C[1]), f.opt.centerX = R[0], f.opt.centerY = R[1], f.opt.eraserlines)
6868
+ ], f.opt.width = Math.round(k * C[0]), f.opt.height = Math.round(I * C[1]), f.opt.centerX = R[0], f.opt.centerY = R[1], f.opt.eraserlines)
6857
6869
  for (const M of f.opt.eraserlines) {
6858
6870
  const { op: D, thickness: B } = M;
6859
6871
  M.thickness = Math.round(B * Math.max(l[0], l[1]));
@@ -6866,13 +6878,13 @@ class Dt extends b {
6866
6878
  f.centerPos[1] + n[1]
6867
6879
  ], f.opt.eraserlines)
6868
6880
  for (const g of f.opt.eraserlines) {
6869
- const { op: I } = g;
6870
- for (let S = 0; S < I.length; S++) {
6871
- const v = I[S].map((L, C) => C % 2 ? L + n[1] : L + n[0]);
6872
- g.op[S] = v;
6881
+ const { op: v } = g;
6882
+ for (let k = 0; k < v.length; k++) {
6883
+ const I = v[k].map((L, C) => C % 2 ? L + n[1] : L + n[0]);
6884
+ g.op[k] = I;
6873
6885
  }
6874
6886
  }
6875
- } else if (H(h))
6887
+ } else if (q(h))
6876
6888
  if (f.opt.rotate = h, f.scaleType = Dt.getScaleType(f.opt), r) {
6877
6889
  const g = se(f.rect, h);
6878
6890
  f.rect = g;
@@ -6893,24 +6905,24 @@ const so = (T) => {
6893
6905
  return !0;
6894
6906
  }
6895
6907
  return !1;
6896
- }, q = (T, i) => {
6908
+ }, V = (T, i) => {
6897
6909
  if (T.mesh && T.mesh.texture && T.name === "eraserTexture") {
6898
6910
  const t = T.mesh.texture.image;
6899
6911
  i.deleteTexture(t);
6900
6912
  } else if (T.tagName === "GROUP" && T && T.children)
6901
6913
  for (const t of T.children)
6902
- q(t, i);
6914
+ V(t, i);
6903
6915
  }, Q = (T, i) => {
6904
- q(T, i), T.removeAllChildren();
6916
+ V(T, i), T.removeAllChildren();
6905
6917
  }, oo = (T, i, t) => {
6906
6918
  const e = t.parent;
6907
6919
  if (i) {
6908
6920
  const s = i.children;
6909
6921
  if (s) {
6910
6922
  for (const o of s)
6911
- if (q(o, e), o.tagName === "GROUP")
6923
+ if (V(o, e), o.tagName === "GROUP")
6912
6924
  for (const r of o.children)
6913
- q(r, e);
6925
+ V(r, e);
6914
6926
  }
6915
6927
  }
6916
6928
  i.parent.replaceChild(T, i);
@@ -6969,7 +6981,7 @@ class ro {
6969
6981
  }
6970
6982
  }
6971
6983
  canUseTopLayer(i) {
6972
- return i === k.LaserPen;
6984
+ return i === S.LaserPen;
6973
6985
  }
6974
6986
  destroy() {
6975
6987
  this.clearAll();
@@ -7008,7 +7020,7 @@ class ro {
7008
7020
  }
7009
7021
  createWorkShapeNode(i) {
7010
7022
  const { toolsType: t } = i;
7011
- if (t === k.LaserPen)
7023
+ if (t === S.LaserPen)
7012
7024
  return Lt({
7013
7025
  ...i,
7014
7026
  vNodes: this.vNodes,
@@ -7024,13 +7036,13 @@ class ro {
7024
7036
  }), t;
7025
7037
  }
7026
7038
  activeServiceWorkShape(i) {
7027
- var p, d;
7039
+ var p, u;
7028
7040
  const { workId: t, opt: e, toolsType: s, type: o, updateNodeOpt: r, ops: n, op: a } = i;
7029
7041
  if (!t)
7030
7042
  return;
7031
7043
  const c = t.toString(), l = (p = this.vNodes.get(c)) == null ? void 0 : p.rect;
7032
- if (!((d = this.serviceWorkShapes) != null && d.has(c))) {
7033
- let u = {
7044
+ if (!((u = this.serviceWorkShapes) != null && u.has(c))) {
7045
+ let d = {
7034
7046
  toolsType: s,
7035
7047
  animationWorkData: a || [],
7036
7048
  animationIndex: 0,
@@ -7039,7 +7051,7 @@ class ro {
7039
7051
  ops: n,
7040
7052
  oldRect: l
7041
7053
  };
7042
- s && e && (u = this.setNodeKey(c, u, s, e)), this.serviceWorkShapes.set(c, u);
7054
+ s && e && (d = this.setNodeKey(c, d, s, e)), this.serviceWorkShapes.set(c, d);
7043
7055
  }
7044
7056
  const h = this.serviceWorkShapes.get(c);
7045
7057
  o && (h.type = o), n && (h.animationWorkData = yt(n), h.ops = n), r && (h.updateNodeOpt = r), a && (h.animationWorkData = a), h.node && h.node.getWorkId() !== c && h.node.setWorkId(c), l && (h.oldRect = l), s && e && (h.toolsType !== s && s && e && this.setNodeKey(c, h, s, e), h.node && h.node.setWorkOptions(e));
@@ -7061,20 +7073,20 @@ class ro {
7061
7073
  const t = /* @__PURE__ */ new Map(), e = [];
7062
7074
  for (const [a, c] of this.serviceWorkShapes.entries())
7063
7075
  switch (c.toolsType) {
7064
- case k.LaserPen: {
7076
+ case S.LaserPen: {
7065
7077
  const h = this.computNextAnimationIndex(
7066
7078
  c,
7067
7079
  8
7068
- ), p = Math.max(0, c.animationIndex || 0), d = (c.animationWorkData || []).slice(
7080
+ ), p = Math.max(0, c.animationIndex || 0), u = (c.animationWorkData || []).slice(
7069
7081
  p,
7070
7082
  h
7071
7083
  );
7072
7084
  if ((c.animationIndex || 0) < h && ((s = c.node) == null || s.consumeService({
7073
- op: d,
7085
+ op: u,
7074
7086
  isFullWork: !1
7075
- }), c.animationIndex = h, d.length && t.set(a, {
7087
+ }), c.animationIndex = h, u.length && t.set(a, {
7076
7088
  workState: p === 0 ? A.Start : h === ((o = c.animationWorkData) == null ? void 0 : o.length) ? A.Done : A.Doing,
7077
- op: d.slice(-2)
7089
+ op: u.slice(-2)
7078
7090
  })), c.isDel) {
7079
7091
  (r = c.node) == null || r.clearTmpPoints(), this.serviceWorkShapes.delete(a);
7080
7092
  break;
@@ -7086,9 +7098,9 @@ class ro {
7086
7098
  }
7087
7099
  }
7088
7100
  for (const [a, c] of this.localWorkShapes.entries()) {
7089
- const { result: l, toolsType: h, isDel: p, workState: d } = c;
7101
+ const { result: l, toolsType: h, isDel: p, workState: u } = c;
7090
7102
  switch (h) {
7091
- case k.LaserPen: {
7103
+ case S.LaserPen: {
7092
7104
  if (p) {
7093
7105
  c.node.clearTmpPoints(), this.localWorkShapes.delete(a), e.push({
7094
7106
  removeIds: [a.toString()],
@@ -7098,7 +7110,7 @@ class ro {
7098
7110
  }
7099
7111
  l && ((l.op || l.ops) && e.push(l), c.result = void 0), !this.thread.topLayer.getElementsByName(
7100
7112
  a.toString()
7101
- )[0] && d === A.Done && (c.isDel = !0, this.localWorkShapes.set(a, c)), i = !0;
7113
+ )[0] && u === A.Done && (c.isDel = !0, this.localWorkShapes.set(a, c)), i = !0;
7102
7114
  break;
7103
7115
  }
7104
7116
  }
@@ -7186,11 +7198,11 @@ class no {
7186
7198
  // }
7187
7199
  // }
7188
7200
  async updateSelector(i) {
7189
- var d;
7201
+ var u;
7190
7202
  const t = this.workShapes.get(
7191
7203
  X
7192
7204
  );
7193
- if (!((d = t == null ? void 0 : t.selectIds) != null && d.length)) return;
7205
+ if (!((u = t == null ? void 0 : t.selectIds) != null && u.length)) return;
7194
7206
  const { callback: e, ...s } = i, { updateSelectorOpt: o, willSerializeData: r, smoothSync: n } = s, a = await (t == null ? void 0 : t.updateSelector({
7195
7207
  updateSelectorOpt: o,
7196
7208
  selectIds: be(t.selectIds),
@@ -7199,12 +7211,12 @@ class no {
7199
7211
  worker: this
7200
7212
  })), c = /* @__PURE__ */ new Map();
7201
7213
  let l;
7202
- a != null && a.selectIds && (l = ys(t.selectIds, a.selectIds), a.selectIds.forEach((u) => {
7203
- const f = this.vNodes.get(u);
7214
+ a != null && a.selectIds && (l = ys(t.selectIds, a.selectIds), a.selectIds.forEach((d) => {
7215
+ const f = this.vNodes.get(d);
7204
7216
  if (f) {
7205
- const { toolsType: m, op: g, opt: I } = f;
7206
- c.set(u, {
7207
- opt: I,
7217
+ const { toolsType: m, op: g, opt: v } = f;
7218
+ c.set(d, {
7219
+ opt: v,
7208
7220
  toolsType: m,
7209
7221
  ops: (g == null ? void 0 : g.length) && tt(g) || void 0
7210
7222
  });
@@ -7252,7 +7264,7 @@ class no {
7252
7264
  let o;
7253
7265
  for (const r of this.vNodes.curNodeMap.values()) {
7254
7266
  const { rect: n, name: a, toolsType: c, opt: l } = r, h = t[0] * this.thread.fullLayer.worldScaling[0] + this.thread.fullLayer.worldPosition[0], p = t[1] * this.thread.fullLayer.worldScaling[1] + this.thread.fullLayer.worldPosition[1];
7255
- if (c === k.Text && hs([h, p], n) && l.workState === A.Done) {
7267
+ if (c === S.Text && hs([h, p], n) && l.workState === A.Done) {
7256
7268
  o = a;
7257
7269
  break;
7258
7270
  }
@@ -7266,7 +7278,7 @@ class no {
7266
7278
  sp: [
7267
7279
  {
7268
7280
  type: w.GetTextActive,
7269
- toolsType: k.Text,
7281
+ toolsType: S.Text,
7270
7282
  workId: o
7271
7283
  }
7272
7284
  ]
@@ -7299,7 +7311,7 @@ class no {
7299
7311
  }
7300
7312
  if (!t) {
7301
7313
  const c = this.setFullWork(i);
7302
- !c && i.workId && this.tmpOpt && ((s = this.tmpOpt) == null ? void 0 : s.toolsType) === k.Selector && this.setWorkOptions(
7314
+ !c && i.workId && this.tmpOpt && ((s = this.tmpOpt) == null ? void 0 : s.toolsType) === S.Selector && this.setWorkOptions(
7303
7315
  i.workId.toString(),
7304
7316
  i.opt || this.tmpOpt.toolsOpt
7305
7317
  ), c && this.updateFullSelectWork(i);
@@ -7344,19 +7356,19 @@ class no {
7344
7356
  const c = this.vNodes.get(a);
7345
7357
  if (c)
7346
7358
  switch (c.toolsType) {
7347
- case k.Text: {
7359
+ case S.Text: {
7348
7360
  s.push({
7349
7361
  type: w.TextUpdate,
7350
- toolsType: k.Text,
7362
+ toolsType: S.Text,
7351
7363
  workId: a,
7352
7364
  dataType: x.Local
7353
7365
  });
7354
7366
  break;
7355
7367
  }
7356
- case k.BackgroundSVG:
7368
+ case S.BackgroundSVG:
7357
7369
  s.push({
7358
7370
  type: w.BackgroundSVGDelete,
7359
- toolsType: k.BackgroundSVG,
7371
+ toolsType: S.BackgroundSVG,
7360
7372
  workId: a,
7361
7373
  dataType: x.Local,
7362
7374
  viewId: this.thread.viewId
@@ -7384,20 +7396,20 @@ class no {
7384
7396
  removeNode(i) {
7385
7397
  var s;
7386
7398
  const t = this.vNodes.get(i);
7387
- t && (t.toolsType === k.BackgroundSVG && this.thread.post({
7399
+ t && (t.toolsType === S.BackgroundSVG && this.thread.post({
7388
7400
  sp: [
7389
7401
  {
7390
7402
  type: w.BackgroundSVGDelete,
7391
- toolsType: k.BackgroundSVG,
7403
+ toolsType: S.BackgroundSVG,
7392
7404
  workId: i,
7393
7405
  dataType: x.Local,
7394
7406
  viewId: this.thread.viewId
7395
7407
  }
7396
7408
  ]
7397
7409
  }), (s = this.thread.fullLayer) == null || s.getElementsByName(i).forEach((o) => {
7398
- o.remove(), q(o, this.thread.fullLayer.parent);
7410
+ o.remove(), V(o, this.thread.fullLayer.parent);
7399
7411
  }), this.vNodes.delete(i)), this.workShapes.has(i) && (this.thread.localLayer.getElementsByName(i).forEach((o) => {
7400
- o.remove(), q(o, this.thread.localLayer.parent);
7412
+ o.remove(), V(o, this.thread.localLayer.parent);
7401
7413
  }), this.clearWorkShapeNodeCache(i));
7402
7414
  }
7403
7415
  setFullWork(i) {
@@ -7405,11 +7417,15 @@ class no {
7405
7417
  if (t && e && s) {
7406
7418
  const o = t.toString();
7407
7419
  let r;
7408
- return t && this.workShapes.has(o) ? (r = this.workShapes.get(o), r == null || r.setWorkOptions(e)) : r = this.createWorkShapeNode({
7420
+ return t && this.workShapes.has(o) ? (r = this.workShapes.get(o), (r == null ? void 0 : r.toolsType) !== s ? (r == null || r.clearTmpPoints(), this.workShapes.delete(o), r = void 0) : r == null || r.setWorkOptions(e)) : r = this.createWorkShapeNode({
7409
7421
  toolsOpt: e,
7410
7422
  toolsType: s,
7411
7423
  workId: o
7412
- }), r ? (this.workShapes.set(o, r), r) : void 0;
7424
+ }), r || (r = this.createWorkShapeNode({
7425
+ toolsOpt: e,
7426
+ toolsType: s,
7427
+ workId: o
7428
+ })), r ? (this.workShapes.set(o, r), r) : void 0;
7413
7429
  }
7414
7430
  }
7415
7431
  async consumeFull(i) {
@@ -7417,14 +7433,16 @@ class no {
7417
7433
  const t = this.setFullWork(i), e = i.ops && yt(i.ops);
7418
7434
  if (t) {
7419
7435
  const o = (s = i.workId) == null ? void 0 : s.toString();
7420
- t.toolsType === k.BackgroundSVG ? t.consumeService({
7436
+ o && i.clearPreviewLocalWork && this.thread.localLayer.getElementsByName(o).forEach((n) => {
7437
+ n.remove(), V(n, this.thread.localLayer.parent);
7438
+ }), t.toolsType === S.BackgroundSVG ? t.consumeService({
7421
7439
  isFullWork: !0,
7422
7440
  replaceId: o
7423
- }) : t.toolsType === k.Image ? await t.consumeServiceAsync({
7441
+ }) : t.toolsType === S.Image ? await t.consumeServiceAsync({
7424
7442
  isFullWork: !0,
7425
7443
  replaceId: o,
7426
7444
  worker: this
7427
- }) : t.toolsType === k.Text ? await t.consumeServiceAsync({
7445
+ }) : t.toolsType === S.Text ? await t.consumeServiceAsync({
7428
7446
  isFullWork: !0,
7429
7447
  replaceId: o,
7430
7448
  boxRect: this.thread.getSceneRect()
@@ -7442,6 +7460,9 @@ class no {
7442
7460
  ops: i.ops,
7443
7461
  updateNodeOpt: i.updateNodeOpt,
7444
7462
  viewId: this.thread.viewId
7463
+ }), i.isLockSentEventCursor && r.push({
7464
+ type: w.None,
7465
+ isLockSentEventCursor: !0
7445
7466
  }), i.needUndoTicker && r.push({
7446
7467
  type: w.None,
7447
7468
  needUndoTicker: i.needUndoTicker
@@ -7473,18 +7494,18 @@ class no {
7473
7494
  const s = this.setFullWork(e);
7474
7495
  if (s) {
7475
7496
  const o = (t = e.workId) == null ? void 0 : t.toString();
7476
- if (s.toolsType === k.BackgroundSVG)
7497
+ if (s.toolsType === S.BackgroundSVG)
7477
7498
  s.consumeService({
7478
7499
  isFullWork: !0,
7479
7500
  replaceId: o
7480
7501
  });
7481
- else if (s.toolsType === k.Image)
7502
+ else if (s.toolsType === S.Image)
7482
7503
  await s.consumeServiceAsync({
7483
7504
  isFullWork: !0,
7484
7505
  replaceId: o,
7485
7506
  worker: this
7486
7507
  });
7487
- else if (s.toolsType === k.Text)
7508
+ else if (s.toolsType === S.Text)
7488
7509
  await s.consumeServiceAsync({
7489
7510
  isFullWork: !0,
7490
7511
  replaceId: o,
@@ -7658,7 +7679,7 @@ class no {
7658
7679
  if (!c)
7659
7680
  return;
7660
7681
  const l = c.toolsType;
7661
- if (l === k.LaserPen)
7682
+ if (l === S.LaserPen)
7662
7683
  return;
7663
7684
  switch (this.combineDrawActiveId && this.combineDrawActiveId !== a && (this.combineTimerId && (clearTimeout(this.combineTimerId), this.combineTimerId = void 0, this.combineDrawResolve && this.combineDrawResolve(!1), this.combineDrawActiveId = void 0), this.consumeDrawAll(
7664
7685
  {
@@ -7679,7 +7700,7 @@ class no {
7679
7700
  },
7680
7701
  t
7681
7702
  ), this.drawWorkActiveId = void 0), !this.drawWorkActiveId && a !== X && (this.drawWorkActiveId = a), zt(r) && (this.consumeCount = r), l) {
7682
- case k.Selector: {
7703
+ case S.Selector: {
7683
7704
  const h = c.consume({
7684
7705
  data: i,
7685
7706
  isFullWork: !0,
@@ -7694,8 +7715,8 @@ class no {
7694
7715
  });
7695
7716
  break;
7696
7717
  }
7697
- case k.PencilEraser:
7698
- case k.BitMapEraser: {
7718
+ case S.PencilEraser:
7719
+ case S.BitMapEraser: {
7699
7720
  c.consume({
7700
7721
  data: i,
7701
7722
  isFullWork: !1,
@@ -7719,7 +7740,7 @@ class no {
7719
7740
  });
7720
7741
  break;
7721
7742
  }
7722
- case k.Eraser:
7743
+ case S.Eraser:
7723
7744
  {
7724
7745
  const h = c.consume({
7725
7746
  data: i,
@@ -7728,14 +7749,14 @@ class no {
7728
7749
  this.drawEraser(h);
7729
7750
  }
7730
7751
  break;
7731
- case k.Arrow:
7732
- case k.Straight:
7733
- case k.Ellipse:
7734
- case k.Rectangle:
7735
- case k.Star:
7736
- case k.Polygon:
7737
- case k.SpeechBalloon:
7738
- case k.Pencil:
7752
+ case S.Arrow:
7753
+ case S.Straight:
7754
+ case S.Ellipse:
7755
+ case S.Rectangle:
7756
+ case S.Star:
7757
+ case S.Polygon:
7758
+ case S.SpeechBalloon:
7759
+ case S.Pencil:
7739
7760
  {
7740
7761
  const h = c.consume({
7741
7762
  data: i,
@@ -7808,56 +7829,56 @@ class no {
7808
7829
  if (!l)
7809
7830
  return;
7810
7831
  const h = l.toolsType;
7811
- if (h === k.LaserPen)
7832
+ if (h === S.LaserPen)
7812
7833
  return;
7813
- const p = this.workShapes.get(bt), d = (r = p == null ? void 0 : p.selectIds) == null ? void 0 : r[0], u = l.consumeAll({ data: i, workerEngine: this });
7834
+ const p = this.workShapes.get(bt), u = (r = p == null ? void 0 : p.selectIds) == null ? void 0 : r[0], d = l.consumeAll({ data: i, workerEngine: this });
7814
7835
  switch (h) {
7815
- case k.Selector:
7836
+ case S.Selector:
7816
7837
  {
7817
- u.selectIds && d && ((n = u.selectIds) != null && n.includes(d)) && p.cursorBlur();
7838
+ d.selectIds && u && ((n = d.selectIds) != null && n.includes(u)) && p.cursorBlur();
7818
7839
  const f = [];
7819
7840
  o && f.push({
7820
7841
  type: w.None,
7821
7842
  isLockSentEventCursor: o
7822
- }), u.type === w.Select && (u.selectIds && t.runReverseSelectWork(u.selectIds), f.push({ ...u, scenePath: s })), f.length && this.thread.post({ sp: f }), (a = l.selectIds) != null && a.length ? l.clearTmpPoints() : this.clearWorkShapeNodeCache(c);
7843
+ }), d.type === w.Select && (d.selectIds && t.runReverseSelectWork(d.selectIds), f.push({ ...d, scenePath: s })), f.length && this.thread.post({ sp: f }), (a = l.selectIds) != null && a.length ? l.clearTmpPoints() : this.clearWorkShapeNodeCache(c);
7823
7844
  }
7824
7845
  break;
7825
- case k.PencilEraser:
7846
+ case S.PencilEraser:
7826
7847
  this.drawPencilEraserFull(
7827
7848
  l,
7828
- u,
7849
+ d,
7829
7850
  o,
7830
7851
  i.needUndoTicker
7831
7852
  ), this.fullWorkerDrawCount = 0, this.clearWorkShapeNodeCache(c);
7832
7853
  break;
7833
- case k.BitMapEraser:
7854
+ case S.BitMapEraser:
7834
7855
  this.drawBitMapEraserFull(
7835
7856
  l,
7836
- u,
7857
+ d,
7837
7858
  o,
7838
7859
  i.needUndoTicker
7839
7860
  ), this.fullWorkerDrawCount = 0, this.clearWorkShapeNodeCache(c);
7840
7861
  break;
7841
- case k.Eraser:
7862
+ case S.Eraser:
7842
7863
  this.drawEraser(
7843
- { ...u, scenePath: s },
7864
+ { ...d, scenePath: s },
7844
7865
  o,
7845
7866
  i.needUndoTicker
7846
7867
  ), l.clearTmpPoints();
7847
7868
  break;
7848
- case k.Arrow:
7849
- case k.Straight:
7850
- case k.Ellipse:
7851
- case k.Rectangle:
7852
- case k.Star:
7853
- case k.Polygon:
7854
- case k.SpeechBalloon:
7855
- case k.Pencil: {
7869
+ case S.Arrow:
7870
+ case S.Straight:
7871
+ case S.Ellipse:
7872
+ case S.Rectangle:
7873
+ case S.Star:
7874
+ case S.Polygon:
7875
+ case S.SpeechBalloon:
7876
+ case S.Pencil: {
7856
7877
  const f = [];
7857
7878
  o && f.push({
7858
7879
  type: w.None,
7859
7880
  isLockSentEventCursor: o
7860
- }), u && (f.push(u), this.fullWorkerDrawCount = 0, i.needUndoTicker && f.push({
7881
+ }), d && (f.push(d), this.fullWorkerDrawCount = 0, i.needUndoTicker && f.push({
7861
7882
  type: w.None,
7862
7883
  needUndoTicker: i.needUndoTicker
7863
7884
  }), this.thread.post({
@@ -7981,13 +8002,13 @@ class ao {
7981
8002
  );
7982
8003
  }
7983
8004
  async animationDraw() {
7984
- var e, s, o, r, n, a, c, l, h, p, d, u, f, m, g, I, S, v, L, C, N;
8005
+ var e, s, o, r, n, a, c, l, h, p, u, d, f, m, g, v, k, I, L, C, N;
7985
8006
  this.animationId = void 0;
7986
8007
  let i = !1;
7987
8008
  const t = /* @__PURE__ */ new Map();
7988
8009
  for (const [R, P] of this.workShapes.entries())
7989
8010
  switch (P.toolsType) {
7990
- case k.BackgroundSVG: {
8011
+ case S.BackgroundSVG: {
7991
8012
  (e = P.node) == null || e.consumeService({
7992
8013
  isFullWork: !0,
7993
8014
  replaceId: R
@@ -7997,7 +8018,7 @@ class ao {
7997
8018
  }), this.workShapes.delete(R);
7998
8019
  break;
7999
8020
  }
8000
- case k.Image: {
8021
+ case S.Image: {
8001
8022
  await ((s = P.node) == null ? void 0 : s.consumeServiceAsync({
8002
8023
  isFullWork: !0,
8003
8024
  worker: this
@@ -8007,7 +8028,7 @@ class ao {
8007
8028
  }), this.workShapes.delete(R);
8008
8029
  break;
8009
8030
  }
8010
- case k.Text: {
8031
+ case S.Text: {
8011
8032
  P.node && (await ((o = P.node) == null ? void 0 : o.consumeServiceAsync({
8012
8033
  isFullWork: !0,
8013
8034
  replaceId: R,
@@ -8018,13 +8039,13 @@ class ao {
8018
8039
  }), (r = P.node) == null || r.clearTmpPoints(), this.workShapes.delete(R));
8019
8040
  break;
8020
8041
  }
8021
- case k.Arrow:
8022
- case k.Straight:
8023
- case k.Rectangle:
8024
- case k.Ellipse:
8025
- case k.Star:
8026
- case k.Polygon:
8027
- case k.SpeechBalloon: {
8042
+ case S.Arrow:
8043
+ case S.Straight:
8044
+ case S.Rectangle:
8045
+ case S.Ellipse:
8046
+ case S.Star:
8047
+ case S.Polygon:
8048
+ case S.SpeechBalloon: {
8028
8049
  const M = !!P.ops;
8029
8050
  if ((n = P.animationWorkData) != null && n.length) {
8030
8051
  const D = P.oldRect;
@@ -8045,11 +8066,11 @@ class ao {
8045
8066
  }
8046
8067
  break;
8047
8068
  }
8048
- case k.Pencil: {
8069
+ case S.Pencil: {
8049
8070
  if (P.useAnimation) {
8050
8071
  if (P.useAnimation) {
8051
8072
  if (P.isDel) {
8052
- (I = P.node) == null || I.clearTmpPoints(), this.workShapes.delete(R);
8073
+ (v = P.node) == null || v.clearTmpPoints(), this.workShapes.delete(R);
8053
8074
  break;
8054
8075
  }
8055
8076
  const M = 3, D = this.computNextAnimationIndex(
@@ -8058,16 +8079,16 @@ class ao {
8058
8079
  ), B = P.isDiff ? 0 : Math.max(0, (P.animationIndex || 0) - M), F = (P.animationWorkData || []).slice(
8059
8080
  B,
8060
8081
  D
8061
- ), U = (v = (S = P.node) == null ? void 0 : S.getWorkId()) == null ? void 0 : v.toString();
8082
+ ), U = (I = (k = P.node) == null ? void 0 : k.getWorkId()) == null ? void 0 : I.toString();
8062
8083
  if ((P.animationIndex || 0) < D || P.isDiff) {
8063
8084
  if ((L = P.node) == null || L.consumeService({
8064
8085
  op: F,
8065
8086
  isFullWork: !1
8066
8087
  }), P.animationIndex = D, P.isDiff && (P.isDiff = !1), F.length && P.isEnableCursor) {
8067
- const V = F.slice(-3, -1);
8088
+ const H = F.slice(-3, -1);
8068
8089
  t.set(R, {
8069
8090
  workState: B === 0 ? A.Start : D === ((C = P.animationWorkData) == null ? void 0 : C.length) ? A.Done : A.Doing,
8070
- op: V
8091
+ op: H
8071
8092
  });
8072
8093
  }
8073
8094
  } else P.ops && ((N = P.node) == null || N.consumeService({
@@ -8087,8 +8108,8 @@ class ao {
8087
8108
  op: P.animationWorkData || [],
8088
8109
  isFullWork: M,
8089
8110
  replaceId: R
8090
- }), (d = P.node) == null || d.updataOptService(P.updateNodeOpt), M) {
8091
- if (!P.isEnableCursor && ((u = P.updateNodeOpt) != null && u.useAnimation) && ((f = P.animationWorkData) != null && f.length)) {
8111
+ }), (u = P.node) == null || u.updataOptService(P.updateNodeOpt), M) {
8112
+ if (!P.isEnableCursor && ((d = P.updateNodeOpt) != null && d.useAnimation) && ((f = P.animationWorkData) != null && f.length)) {
8092
8113
  const D = P.animationWorkData.slice(-3, -1);
8093
8114
  t.set(R, {
8094
8115
  workState: A.Done,
@@ -8126,13 +8147,13 @@ class ao {
8126
8147
  if (t.length < s)
8127
8148
  return !0;
8128
8149
  switch (e) {
8129
- case k.Pencil: {
8150
+ case S.Pencil: {
8130
8151
  for (let o = 0; o < s; o += 3)
8131
8152
  if (t[o] !== i[o] || t[o + 1] !== i[o + 1])
8132
8153
  return !0;
8133
8154
  break;
8134
8155
  }
8135
- case k.LaserPen: {
8156
+ case S.LaserPen: {
8136
8157
  for (let o = 0; o < s; o += 2)
8137
8158
  if (t[o] !== i[o] || t[o + 1] !== i[o + 1])
8138
8159
  return !0;
@@ -8142,7 +8163,7 @@ class ao {
8142
8163
  return !1;
8143
8164
  }
8144
8165
  activeWorkShape(i) {
8145
- var f, m, g, I;
8166
+ var f, m, g, v;
8146
8167
  const {
8147
8168
  workId: t,
8148
8169
  opt: e,
@@ -8157,9 +8178,9 @@ class ao {
8157
8178
  } = i;
8158
8179
  if (!t)
8159
8180
  return;
8160
- const p = t.toString(), d = (f = this.vNodes.get(p)) == null ? void 0 : f.rect;
8181
+ const p = t.toString(), u = (f = this.vNodes.get(p)) == null ? void 0 : f.rect;
8161
8182
  if (!((m = this.workShapes) != null && m.has(p))) {
8162
- let S = {
8183
+ let k = {
8163
8184
  toolsType: s,
8164
8185
  animationWorkData: a || [],
8165
8186
  animationIndex: 0,
@@ -8167,32 +8188,32 @@ class ao {
8167
8188
  updateNodeOpt: r,
8168
8189
  ops: n,
8169
8190
  useAnimation: typeof c < "u" ? c : typeof (r == null ? void 0 : r.useAnimation) < "u" ? r == null ? void 0 : r.useAnimation : !0,
8170
- oldRect: d,
8191
+ oldRect: u,
8171
8192
  isDiff: !1,
8172
8193
  imageBitmap: l,
8173
8194
  isEnableCursor: h
8174
8195
  };
8175
- s && e && (S = this.setNodeKey(p, S, s, e)), (g = this.workShapes) == null || g.set(p, S);
8196
+ s && e && (k = this.setNodeKey(p, k, s, e)), (g = this.workShapes) == null || g.set(p, k);
8176
8197
  }
8177
- const u = (I = this.workShapes) == null ? void 0 : I.get(p);
8178
- u.isEnableCursor = h, o && (u.type = o), n && (u.animationWorkData = yt(n), u.ops = n), r && (u.updateNodeOpt = r), a && (u.isDiff = this.hasDiffData(
8179
- u.animationWorkData || [],
8198
+ const d = (v = this.workShapes) == null ? void 0 : v.get(p);
8199
+ d.isEnableCursor = h, o && (d.type = o), n && (d.animationWorkData = yt(n), d.ops = n), r && (d.updateNodeOpt = r), a && (d.isDiff = this.hasDiffData(
8200
+ d.animationWorkData || [],
8180
8201
  a,
8181
- u.toolsType
8182
- ), u.animationWorkData = a), u.node && u.node.getWorkId() !== p && u.node.setWorkId(p), d && (u.oldRect = d), s && e && (e.syncUnitTime && (this.syncUnitTime = e.syncUnitTime), u.toolsType !== s && s && e && this.setNodeKey(p, u, s, e), u.node && u.node.setWorkOptions(e)), l && (u.imageBitmap = l);
8202
+ d.toolsType
8203
+ ), d.animationWorkData = a), d.node && d.node.getWorkId() !== p && d.node.setWorkId(p), u && (d.oldRect = u), s && e && (e.syncUnitTime && (this.syncUnitTime = e.syncUnitTime), d.toolsType !== s && s && e && this.setNodeKey(p, d, s, e), d.node && d.node.setWorkOptions(e)), l && (d.imageBitmap = l);
8183
8204
  }
8184
8205
  removeNode(i, t) {
8185
8206
  i.indexOf(X) > -1 && this.removeSelectWork(t), this.thread.fullLayer.getElementsByName(i).forEach((s) => {
8186
- s.remove(), q(s, this.thread.fullLayer.parent);
8207
+ s.remove(), V(s, this.thread.fullLayer.parent);
8187
8208
  }), this.thread.serviceLayer.getElementsByName(i).forEach((s) => {
8188
- s.remove(), q(s, this.thread.serviceLayer.parent);
8209
+ s.remove(), V(s, this.thread.serviceLayer.parent);
8189
8210
  });
8190
8211
  const e = this.vNodes.get(i);
8191
- e && e.toolsType === k.BackgroundSVG && this.thread.post({
8212
+ e && e.toolsType === S.BackgroundSVG && this.thread.post({
8192
8213
  sp: [
8193
8214
  {
8194
8215
  type: w.BackgroundSVGDelete,
8195
- toolsType: k.BackgroundSVG,
8216
+ toolsType: S.BackgroundSVG,
8196
8217
  workId: i,
8197
8218
  dataType: x.Service,
8198
8219
  viewId: this.thread.viewId
@@ -8297,7 +8318,7 @@ class lo extends rt {
8297
8318
  const { param: e, postData: s, newServiceStore: o } = t, { willSyncService: r, isSync: n, textUpdateForWoker: a, needUndoTicker: c } = e, l = s.sp || [];
8298
8319
  if (r)
8299
8320
  for (const [h, p] of o.entries())
8300
- a && p.toolsType === k.Text ? l.push({
8321
+ a && p.toolsType === S.Text ? l.push({
8301
8322
  ...p,
8302
8323
  workId: h,
8303
8324
  type: w.TextUpdate,
@@ -8351,7 +8372,7 @@ class ho extends rt {
8351
8372
  const { param: e, postData: s, newServiceStore: o } = t, { willSyncService: r, isSync: n } = e, a = s.sp || [];
8352
8373
  if (r && a)
8353
8374
  for (const [c, l] of o.entries())
8354
- l.toolsType === k.BackgroundSVG && a.push({
8375
+ l.toolsType === S.BackgroundSVG && a.push({
8355
8376
  ...l,
8356
8377
  workId: c,
8357
8378
  type: w.BackgroundSVGUpdate,
@@ -8384,7 +8405,7 @@ class po extends rt {
8384
8405
  return await this.consumeForLocalWorker(t), !0;
8385
8406
  }
8386
8407
  async consumeForLocalWorker(t) {
8387
- var p, d;
8408
+ var p, u;
8388
8409
  const {
8389
8410
  workId: e,
8390
8411
  updateNodeOpt: s,
@@ -8407,7 +8428,7 @@ class po extends rt {
8407
8428
  callback: this.updateSelectorCallback,
8408
8429
  smoothSync: l,
8409
8430
  needUndoTicker: h
8410
- })) : s.workState === A.Done && ((d = this.localWork) == null || d.vNodes.deleteLastTarget()));
8431
+ })) : s.workState === A.Done && ((u = this.localWork) == null || u.vNodes.deleteLastTarget()));
8411
8432
  }
8412
8433
  updateSelectorCallback(t) {
8413
8434
  const { param: e, postData: s, newServiceStore: o, workShapeNode: r, res: n, smoothSync: a } = t, {
@@ -8415,9 +8436,9 @@ class po extends rt {
8415
8436
  isSync: l,
8416
8437
  updateSelectorOpt: h,
8417
8438
  textUpdateForWoker: p,
8418
- needUndoTicker: d
8419
- } = e, u = h.workState, f = s.sp || [];
8420
- if (u === A.Start)
8439
+ needUndoTicker: u
8440
+ } = e, d = h.workState, f = s.sp || [];
8441
+ if (d === A.Start)
8421
8442
  return {
8422
8443
  sp: [],
8423
8444
  render: []
@@ -8428,41 +8449,41 @@ class po extends rt {
8428
8449
  type: w.Select,
8429
8450
  selectIds: r.selectIds,
8430
8451
  selectRect: m,
8431
- willSyncService: u === A.Done ? !0 : a,
8452
+ willSyncService: d === A.Done ? !0 : a,
8432
8453
  isSync: !0,
8433
- points: u === A.Done && r.getChildrenPoints() || void 0,
8454
+ points: d === A.Done && r.getChildrenPoints() || void 0,
8434
8455
  textOpt: r.textOpt
8435
8456
  });
8436
8457
  const g = {
8437
8458
  useAnimation: h.useAnimation || !1
8438
8459
  };
8439
8460
  h.uid && (g.uid = h.uid);
8440
- for (const [I, S] of o.entries())
8441
- S.toolsType === k.BackgroundSVG && f.push({
8442
- ...S,
8443
- workId: I,
8461
+ for (const [v, k] of o.entries())
8462
+ k.toolsType === S.BackgroundSVG && f.push({
8463
+ ...k,
8464
+ workId: v,
8444
8465
  type: w.BackgroundSVGUpdate,
8445
8466
  dataType: x.Local,
8446
- willSyncService: u === A.Done ? !0 : a,
8467
+ willSyncService: d === A.Done ? !0 : a,
8447
8468
  updateNodeOpt: g
8448
- }), p && S.toolsType === k.Text ? f.push({
8449
- ...S,
8450
- workId: I,
8469
+ }), p && k.toolsType === S.Text ? f.push({
8470
+ ...k,
8471
+ workId: v,
8451
8472
  type: w.TextUpdate,
8452
8473
  dataType: x.Local,
8453
- willSyncService: u === A.Done ? !0 : a,
8474
+ willSyncService: d === A.Done ? !0 : a,
8454
8475
  updateNodeOpt: g
8455
- }) : (a || u === A.Done) && f.push({
8456
- ...S,
8457
- workId: I,
8476
+ }) : (a || d === A.Done) && f.push({
8477
+ ...k,
8478
+ workId: v,
8458
8479
  type: w.UpdateNode,
8459
8480
  updateNodeOpt: g,
8460
8481
  isSync: l
8461
8482
  });
8462
8483
  }
8463
- return d && f.push({
8484
+ return u && f.push({
8464
8485
  type: w.None,
8465
- needUndoTicker: d
8486
+ needUndoTicker: u
8466
8487
  }), {
8467
8488
  sp: f
8468
8489
  };
@@ -8499,17 +8520,17 @@ class uo extends rt {
8499
8520
  }));
8500
8521
  }
8501
8522
  updateSelectorCallback(t) {
8502
- const { param: e, postData: s, workShapeNode: o, res: r, newServiceStore: n, smoothSync: a } = t, { updateSelectorOpt: c, willSyncService: l, needUndoTicker: h } = e, p = c.workState, d = s.sp || [], u = r == null ? void 0 : r.selectRect;
8523
+ const { param: e, postData: s, workShapeNode: o, res: r, newServiceStore: n, smoothSync: a } = t, { updateSelectorOpt: c, willSyncService: l, needUndoTicker: h } = e, p = c.workState, u = s.sp || [], d = r == null ? void 0 : r.selectRect;
8503
8524
  if (p === A.Start)
8504
8525
  return {
8505
8526
  sp: [],
8506
8527
  render: []
8507
8528
  };
8508
8529
  if (l) {
8509
- d.push({
8530
+ u.push({
8510
8531
  type: w.Select,
8511
8532
  selectIds: o.selectIds,
8512
- selectRect: u,
8533
+ selectRect: d,
8513
8534
  willSyncService: p === A.Done ? !0 : a,
8514
8535
  isSync: !0,
8515
8536
  points: p === A.Done && o.getChildrenPoints() || void 0,
@@ -8520,21 +8541,21 @@ class uo extends rt {
8520
8541
  };
8521
8542
  c.uid && (f.uid = c.uid);
8522
8543
  for (const [m, g] of n.entries())
8523
- g.toolsType === k.BackgroundSVG && d.push({
8544
+ g.toolsType === S.BackgroundSVG && u.push({
8524
8545
  ...g,
8525
8546
  workId: m,
8526
8547
  type: w.BackgroundSVGUpdate,
8527
8548
  dataType: x.Local,
8528
8549
  willSyncService: p === A.Done ? !0 : a,
8529
8550
  updateNodeOpt: f
8530
- }), g.toolsType === k.Text ? d.push({
8551
+ }), g.toolsType === S.Text ? u.push({
8531
8552
  ...g,
8532
8553
  workId: m,
8533
8554
  type: w.TextUpdate,
8534
8555
  dataType: x.Local,
8535
8556
  willSyncService: p === A.Done ? !0 : a,
8536
8557
  updateNodeOpt: f
8537
- }) : (a || p === A.Done) && d.push({
8558
+ }) : (a || p === A.Done) && u.push({
8538
8559
  ...g,
8539
8560
  workId: m,
8540
8561
  type: w.UpdateNode,
@@ -8542,11 +8563,11 @@ class uo extends rt {
8542
8563
  isSync: !0
8543
8564
  });
8544
8565
  }
8545
- return h && d.push({
8566
+ return h && u.push({
8546
8567
  type: w.None,
8547
8568
  needUndoTicker: h
8548
8569
  }), {
8549
- sp: d
8570
+ sp: u
8550
8571
  };
8551
8572
  }
8552
8573
  }
@@ -8590,33 +8611,33 @@ class fo extends rt {
8590
8611
  willSyncService: l,
8591
8612
  willSerializeData: h,
8592
8613
  isSync: p,
8593
- needUndoTicker: d
8594
- } = e, u = c.workState, f = s.sp || [], m = r == null ? void 0 : r.selectRect;
8614
+ needUndoTicker: u
8615
+ } = e, d = c.workState, f = s.sp || [], m = r == null ? void 0 : r.selectRect;
8595
8616
  if (l) {
8596
- h && u === A.Done && f.push({
8617
+ h && d === A.Done && f.push({
8597
8618
  type: w.Select,
8598
8619
  selectIds: o.selectIds,
8599
8620
  selectRect: m,
8600
- willSyncService: u === A.Done ? !0 : a,
8621
+ willSyncService: d === A.Done ? !0 : a,
8601
8622
  isSync: p,
8602
8623
  points: o.getChildrenPoints()
8603
8624
  });
8604
8625
  const g = {
8605
8626
  useAnimation: c.useAnimation || !1
8606
8627
  };
8607
- if (c.uid && (g.uid = c.uid), a || u === A.Done)
8608
- for (const [I, S] of n.entries())
8628
+ if (c.uid && (g.uid = c.uid), a || d === A.Done)
8629
+ for (const [v, k] of n.entries())
8609
8630
  f.push({
8610
- ...S,
8611
- workId: I,
8631
+ ...k,
8632
+ workId: v,
8612
8633
  type: w.UpdateNode,
8613
8634
  updateNodeOpt: g,
8614
8635
  isSync: p
8615
8636
  });
8616
8637
  }
8617
- return d && f.push({
8638
+ return u && f.push({
8618
8639
  type: w.None,
8619
- needUndoTicker: d
8640
+ needUndoTicker: u
8620
8641
  }), {
8621
8642
  sp: f
8622
8643
  };
@@ -8652,26 +8673,26 @@ class mo extends rt {
8652
8673
  }));
8653
8674
  }
8654
8675
  updateSelectorCallback(t) {
8655
- const { param: e, postData: s, newServiceStore: o, workShapeNode: r, res: n } = t, { willSyncService: a, isSync: c, updateSelectorOpt: l, textUpdateForWoker: h } = e, p = s.sp || [], d = n == null ? void 0 : n.selectRect;
8676
+ const { param: e, postData: s, newServiceStore: o, workShapeNode: r, res: n } = t, { willSyncService: a, isSync: c, updateSelectorOpt: l, textUpdateForWoker: h } = e, p = s.sp || [], u = n == null ? void 0 : n.selectRect;
8656
8677
  if (a && p) {
8657
8678
  l.fontSize && p.push({
8658
8679
  type: w.Select,
8659
8680
  selectIds: r.selectIds,
8660
- selectRect: d,
8681
+ selectRect: u,
8661
8682
  willSyncService: a,
8662
8683
  isSync: c,
8663
8684
  points: r.getChildrenPoints()
8664
8685
  });
8665
- for (const [u, f] of o.entries())
8666
- h && f.toolsType === k.Text ? p.push({
8686
+ for (const [d, f] of o.entries())
8687
+ h && f.toolsType === S.Text ? p.push({
8667
8688
  ...f,
8668
- workId: u,
8689
+ workId: d,
8669
8690
  type: w.TextUpdate,
8670
8691
  dataType: x.Local,
8671
8692
  willSyncService: !0
8672
8693
  }) : p.push({
8673
8694
  ...f,
8674
- workId: u,
8695
+ workId: d,
8675
8696
  type: w.UpdateNode,
8676
8697
  updateNodeOpt: {
8677
8698
  useAnimation: !1
@@ -8720,10 +8741,10 @@ class yo extends rt {
8720
8741
  updateSelectorCallback(t) {
8721
8742
  const { param: e, postData: s, newServiceStore: o, workShapeNode: r, res: n } = t, { willSyncService: a, isSync: c, needUndoTicker: l } = e, h = s.sp || [], p = n == null ? void 0 : n.selectRect;
8722
8743
  if (a && h) {
8723
- for (const [d, u] of o.entries())
8744
+ for (const [u, d] of o.entries())
8724
8745
  h.push({
8725
- ...u,
8726
- workId: d,
8746
+ ...d,
8747
+ workId: u,
8727
8748
  type: w.UpdateNode,
8728
8749
  updateNodeOpt: {
8729
8750
  useAnimation: !1
@@ -8777,12 +8798,12 @@ class wo extends rt {
8777
8798
  }));
8778
8799
  }
8779
8800
  updateSelectorCallback(t) {
8780
- const { param: e, postData: s, newServiceStore: o, workShapeNode: r, res: n } = t, { willSyncService: a, isSync: c, updateSelectorOpt: l, needUndoTicker: h } = e, p = s.sp || [], d = n == null ? void 0 : n.selectRect;
8801
+ const { param: e, postData: s, newServiceStore: o, workShapeNode: r, res: n } = t, { willSyncService: a, isSync: c, updateSelectorOpt: l, needUndoTicker: h } = e, p = s.sp || [], u = n == null ? void 0 : n.selectRect;
8781
8802
  if (a && p) {
8782
- for (const [u, f] of o.entries())
8803
+ for (const [d, f] of o.entries())
8783
8804
  p.push({
8784
8805
  ...f,
8785
- workId: u,
8806
+ workId: d,
8786
8807
  type: w.UpdateNode,
8787
8808
  updateNodeOpt: {
8788
8809
  useAnimation: !1
@@ -8796,7 +8817,7 @@ class wo extends rt {
8796
8817
  canRotate: r.canRotate,
8797
8818
  type: w.Select,
8798
8819
  selectIds: r.selectIds,
8799
- selectRect: d,
8820
+ selectRect: u,
8800
8821
  willSyncService: a,
8801
8822
  isSync: c
8802
8823
  });
@@ -9009,8 +9030,8 @@ class So {
9009
9030
  zt(i.dpr) && this.updateDpr(i.dpr);
9010
9031
  break;
9011
9032
  case w.AuthClear: {
9012
- const { clearUids: d, localUid: u } = i;
9013
- this.vNodes.setCanClearUids(d), this.vNodes.setLocalUid(u);
9033
+ const { clearUids: u, localUid: d } = i;
9034
+ this.vNodes.setCanClearUids(u), this.vNodes.setLocalUid(d);
9014
9035
  break;
9015
9036
  }
9016
9037
  case w.Destroy:
@@ -9024,11 +9045,11 @@ class So {
9024
9045
  break;
9025
9046
  case w.UpdateTools:
9026
9047
  if (e && s) {
9027
- const d = {
9048
+ const u = {
9028
9049
  toolsType: e,
9029
9050
  toolsOpt: s
9030
9051
  };
9031
- this.topWork.canUseTopLayer(e) ? this.topWork.setToolsOpt(d) : this.localWork.setToolsOpt(d);
9052
+ this.topWork.canUseTopLayer(e) ? this.topWork.setToolsOpt(u) : this.localWork.setToolsOpt(u);
9032
9053
  }
9033
9054
  break;
9034
9055
  case w.CreateWork:
@@ -9047,7 +9068,7 @@ class So {
9047
9068
  }
9048
9069
  break;
9049
9070
  case w.DrawWork:
9050
- n === A.Done && o === x.Local ? (this.consumeDrawAll(o, i), e === k.LaserPen && h && this.post({
9071
+ n === A.Done && o === x.Local ? (this.consumeDrawAll(o, i), e === S.LaserPen && h && this.post({
9051
9072
  sp: [
9052
9073
  {
9053
9074
  type: w.None,
@@ -9081,28 +9102,28 @@ class So {
9081
9102
  break;
9082
9103
  case w.GetImageBitMap:
9083
9104
  if (a && c && r) {
9084
- const d = r.toString();
9085
- this.deleteCachedImagesByWorkId(d), this.cacheImages.set(a, {
9105
+ const u = r.toString();
9106
+ this.deleteCachedImagesByWorkId(u), this.cacheImages.set(a, {
9086
9107
  imageBitmap: c,
9087
- workId: d
9108
+ workId: u
9088
9109
  });
9089
- const u = this.imageResolveMap.get(a);
9090
- if (u) {
9091
- const { resolve: f, timer: m } = u;
9110
+ const d = this.imageResolveMap.get(a);
9111
+ if (d) {
9112
+ const { resolve: f, timer: m } = d;
9092
9113
  m && clearTimeout(m), f && f(a);
9093
9114
  }
9094
9115
  }
9095
9116
  break;
9096
9117
  case w.GetVNodeInfo:
9097
9118
  if (r && l) {
9098
- const d = l.map((u) => this.vNodes.get(u));
9119
+ const u = l.map((d) => this.vNodes.get(d));
9099
9120
  this.post({
9100
9121
  sp: [
9101
9122
  {
9102
9123
  type: w.GetVNodeInfo,
9103
9124
  dataType: x.Local,
9104
9125
  workId: r,
9105
- vInfo: d
9126
+ vInfo: u
9106
9127
  }
9107
9128
  ]
9108
9129
  });
@@ -9117,7 +9138,7 @@ class So {
9117
9138
  }
9118
9139
  async loadImageBitMap(i) {
9119
9140
  const { toolsType: t, opt: e, workId: s } = i;
9120
- if (t === k.Image && e && s) {
9141
+ if (t === S.Image && e && s) {
9121
9142
  const o = s.toString(), { src: r, type: n, width: a, height: c, strokeColor: l } = e;
9122
9143
  if (!r || !n || !a || !c)
9123
9144
  return;
@@ -9136,7 +9157,7 @@ class So {
9136
9157
  if (f)
9137
9158
  return f;
9138
9159
  }
9139
- const u = await new Promise((f) => {
9160
+ const d = await new Promise((f) => {
9140
9161
  const m = this.imageResolveMap.get(h) || {
9141
9162
  resolve: void 0,
9142
9163
  timer: void 0
@@ -9157,7 +9178,7 @@ class So {
9157
9178
  ]
9158
9179
  });
9159
9180
  });
9160
- return this.imageResolveMap.delete(u), this.getCachedImages(h);
9181
+ return this.imageResolveMap.delete(d), this.getCachedImages(h);
9161
9182
  }
9162
9183
  }
9163
9184
  async removeNode(i) {
@@ -9260,12 +9281,12 @@ class So {
9260
9281
  let c = !1;
9261
9282
  for (const [l, h] of this.localWork.getWorkShapes().entries())
9262
9283
  switch (h.toolsType) {
9263
- case k.Text:
9264
- case k.BitMapEraser:
9265
- case k.PencilEraser:
9266
- case k.Eraser:
9267
- case k.Selector:
9268
- case k.LaserPen:
9284
+ case S.Text:
9285
+ case S.BitMapEraser:
9286
+ case S.PencilEraser:
9287
+ case S.Eraser:
9288
+ case S.Selector:
9289
+ case S.LaserPen:
9269
9290
  break;
9270
9291
  default:
9271
9292
  l !== bt && l !== X && (c = !0);
@@ -9279,7 +9300,7 @@ class So {
9279
9300
  }
9280
9301
  }
9281
9302
  const o = /* @__PURE__ */ new Map();
9282
- for (const [c, l] of this.vNodes.getNodesByType(k.Text).entries()) {
9303
+ for (const [c, l] of this.vNodes.getNodesByType(S.Text).entries()) {
9283
9304
  const h = l.rect;
9284
9305
  o.set(c, be(h));
9285
9306
  }
@@ -9308,11 +9329,11 @@ class So {
9308
9329
  for (const [c, l] of o.entries()) {
9309
9330
  const h = this.vNodes.get(c);
9310
9331
  if (h) {
9311
- const p = l, d = h.rect, u = this.getSceneRect(), f = Rt(p, u), m = Rt(d, u);
9332
+ const p = l, u = h.rect, d = this.getSceneRect(), f = Rt(p, d), m = Rt(u, d);
9312
9333
  let g = !1;
9313
- if ((f !== m || p.w !== d.w || p.h !== d.h || m === Vt.intersect) && (g = !0), g) {
9314
- const { toolsType: I } = h;
9315
- I === k.Text && this.debounceUpdateCache.add(c);
9334
+ if ((f !== m || p.w !== u.w || p.h !== u.h || m === Vt.intersect) && (g = !0), g) {
9335
+ const { toolsType: v } = h;
9336
+ v === S.Text && this.debounceUpdateCache.add(c);
9316
9337
  }
9317
9338
  }
9318
9339
  }
@@ -9334,10 +9355,10 @@ class So {
9334
9355
  const c = [];
9335
9356
  for (const h of this.debounceUpdateCache.values()) {
9336
9357
  if ((l = this.fullLayer) == null ? void 0 : l.getElementsByName(h)[0]) {
9337
- const d = this.vNodes.get(h);
9338
- if (d) {
9339
- const { toolsType: u, opt: f } = d, m = this.localWork.setFullWork({
9340
- toolsType: u,
9358
+ const u = this.vNodes.get(h);
9359
+ if (u) {
9360
+ const { toolsType: d, opt: f } = u, m = this.localWork.setFullWork({
9361
+ toolsType: d,
9341
9362
  opt: f,
9342
9363
  workId: h
9343
9364
  });
@@ -9400,7 +9421,7 @@ class So {
9400
9421
  this.fullLayer.parent.setAttribute("width", t), this.fullLayer.parent.setAttribute("height", e), this.fullLayer.setAttribute("size", [t, e]), this.fullLayer.setAttribute("pos", [t * 0.5, e * 0.5]), this.topLayer.parent.setAttribute("width", t), this.topLayer.parent.setAttribute("height", e), this.topLayer.setAttribute("size", [t, e]), this.topLayer.setAttribute("pos", [t * 0.5, e * 0.5]), this.localLayer.parent.setAttribute("width", t), this.localLayer.parent.setAttribute("height", e), this.localLayer.setAttribute("size", [t, e]), this.localLayer.setAttribute("pos", [t * 0.5, e * 0.5]), this.serviceLayer.parent.setAttribute("width", t), this.serviceLayer.parent.setAttribute("height", e), this.serviceLayer.setAttribute("size", [t, e]), this.serviceLayer.setAttribute("pos", [t * 0.5, e * 0.5]);
9401
9422
  }
9402
9423
  destroy() {
9403
- this.clearCacheImages(), this.clearImageResolveMap(), this.vNodes.clear(), this.fullLayer.remove(), q(this.fullLayer, this.fullLayer.parent), this.topLayer.remove(), q(this.topLayer, this.topLayer.parent), this.localLayer.remove(), q(this.localLayer, this.localLayer.parent), this.serviceLayer.remove(), q(this.serviceLayer, this.serviceLayer.parent), this.scene.remove(), this.localWork.destroy(), this.serviceWork.destroy(), this.topWork.destroy();
9424
+ this.clearCacheImages(), this.clearImageResolveMap(), this.vNodes.clear(), this.fullLayer.remove(), V(this.fullLayer, this.fullLayer.parent), this.topLayer.remove(), V(this.topLayer, this.topLayer.parent), this.localLayer.remove(), V(this.localLayer, this.localLayer.parent), this.serviceLayer.remove(), V(this.serviceLayer, this.serviceLayer.parent), this.scene.remove(), this.localWork.destroy(), this.serviceWork.destroy(), this.topWork.destroy();
9404
9425
  }
9405
9426
  }
9406
9427
  class To {
@@ -9482,7 +9503,7 @@ class To {
9482
9503
  }
9483
9504
  async loadImageBitMap(i) {
9484
9505
  const { toolsType: t, opt: e, workId: s } = i;
9485
- if (t === k.Image && e && s) {
9506
+ if (t === S.Image && e && s) {
9486
9507
  const o = s.toString(), { src: r, type: n, width: a, height: c, strokeColor: l } = e;
9487
9508
  if (!r || !n || !a || !c)
9488
9509
  return;
@@ -9501,7 +9522,7 @@ class To {
9501
9522
  if (f)
9502
9523
  return f;
9503
9524
  }
9504
- const u = await new Promise((f) => {
9525
+ const d = await new Promise((f) => {
9505
9526
  const m = this.imageResolveMap.get(h) || {
9506
9527
  resolve: void 0,
9507
9528
  timer: void 0
@@ -9522,7 +9543,7 @@ class To {
9522
9543
  ]
9523
9544
  });
9524
9545
  });
9525
- return this.imageResolveMap.delete(u), this.getCachedImages(h);
9546
+ return this.imageResolveMap.delete(d), this.getCachedImages(h);
9526
9547
  }
9527
9548
  }
9528
9549
  createWorkShapeNode(i) {
@@ -9550,13 +9571,13 @@ class To {
9550
9571
  if (t) {
9551
9572
  let o, r;
9552
9573
  const n = (s = t.getWorkId()) == null ? void 0 : s.toString();
9553
- return t.toolsType === k.BackgroundSVG ? o = t.consumeService({
9574
+ return t.toolsType === S.BackgroundSVG ? o = t.consumeService({
9554
9575
  isFullWork: !0,
9555
9576
  replaceId: n
9556
- }) : t.toolsType === k.Image ? o = await t.consumeServiceAsync({
9577
+ }) : t.toolsType === S.Image ? o = await t.consumeServiceAsync({
9557
9578
  isFullWork: !0,
9558
9579
  worker: this
9559
- }) : t.toolsType === k.Text ? o = await t.consumeServiceAsync({
9580
+ }) : t.toolsType === S.Text ? o = await t.consumeServiceAsync({
9560
9581
  isFullWork: !0,
9561
9582
  replaceId: n,
9562
9583
  isDrawLabel: !0
@@ -9748,7 +9769,7 @@ class To {
9748
9769
  this.fullLayer.parent.setAttribute("width", t), this.fullLayer.parent.setAttribute("height", e), this.fullLayer.setAttribute("size", [t, e]), this.fullLayer.setAttribute("pos", [t * 0.5, e * 0.5]);
9749
9770
  }
9750
9771
  destroy() {
9751
- this.clearCacheImages(), this.clearImageResolveMap(), this.fullLayer.remove(), q(this.fullLayer, this.fullLayer.parent), this.scene.remove();
9772
+ this.clearCacheImages(), this.clearImageResolveMap(), this.fullLayer.remove(), V(this.fullLayer, this.fullLayer.parent), this.scene.remove();
9752
9773
  }
9753
9774
  }
9754
9775
  class Oo {
@@ -9758,11 +9779,15 @@ class Oo {
9758
9779
  y(this, "master");
9759
9780
  y(this, "post", (i) => {
9760
9781
  const { fullWorkerDrawCount: t, sp: e, workerTasksqueueCount: s, consumeCount: o } = i;
9761
- this.master.isBusy && H(s) && this.master.setWorkerTasksqueueCount(s), H(t) && this.master.setMaxDrawCount(t), H(o) && this.master.setConsumeCount(o), e && this.master.collectorSyncData(e);
9782
+ this.master.isBusy && q(s) && this.master.setWorkerTasksqueueCount(s), q(t) && this.master.setMaxDrawCount(t), q(o) && this.master.setConsumeCount(o), e && this.master.collectorSyncData(e);
9762
9783
  });
9763
9784
  this.master = i;
9764
9785
  }
9765
9786
  destroy() {
9787
+ var i;
9788
+ (i = this.snapshotThread) == null || i.destroy(), this.snapshotThread = void 0;
9789
+ for (const t of this.mainThreadMap.values())
9790
+ t.destroy();
9766
9791
  this.mainThreadMap.clear();
9767
9792
  }
9768
9793
  createMainThread(i, t) {
@@ -9772,82 +9797,85 @@ class Oo {
9772
9797
  return new To(i, t);
9773
9798
  }
9774
9799
  async consume(i) {
9775
- var t, e, s, o;
9776
- for (const r of i.values()) {
9800
+ var t, e, s, o, r;
9801
+ for (const n of i.values()) {
9777
9802
  const {
9778
- msgType: n,
9779
- viewId: a,
9780
- tasksqueue: c,
9781
- mainTasksqueueCount: l,
9782
- layerOpt: h,
9783
- offscreenCanvasOpt: p,
9803
+ msgType: a,
9804
+ viewId: c,
9805
+ tasksqueue: l,
9806
+ mainTasksqueueCount: h,
9807
+ layerOpt: p,
9808
+ offscreenCanvasOpt: u,
9784
9809
  cameraOpt: d,
9785
- isSubWorker: u
9786
- } = r;
9787
- if (n === w.Console) {
9810
+ isSubWorker: f
9811
+ } = n;
9812
+ if (a === w.Console) {
9788
9813
  console.log(this);
9789
9814
  continue;
9790
9815
  }
9791
- if (n === w.Init) {
9792
- const m = (t = this.master.control.viewContainerManager.getView(a)) == null ? void 0 : t.displayer, g = m == null ? void 0 : m.canvasContainerRef.current;
9793
- if (m && g && h && p) {
9794
- const I = this.createMainThread(a, {
9795
- displayer: m,
9796
- container: g,
9797
- layerOpt: h,
9816
+ if (a === w.Init) {
9817
+ const g = (t = this.master.control.viewContainerManager.getView(c)) == null ? void 0 : t.displayer, v = g == null ? void 0 : g.canvasContainerRef.current;
9818
+ if (g && v && p && u) {
9819
+ const k = this.mainThreadMap.get(c);
9820
+ k == null || k.destroy();
9821
+ const I = this.createMainThread(c, {
9822
+ displayer: g,
9823
+ container: v,
9824
+ layerOpt: p,
9798
9825
  master: this.master,
9799
- canvasOpt: p,
9826
+ canvasOpt: u,
9800
9827
  post: this.post
9801
9828
  });
9802
- this.mainThreadMap.set(a, I), I && d && I.setCameraOpt(d);
9829
+ this.mainThreadMap.set(c, I), I && d && I.setCameraOpt(d);
9803
9830
  }
9804
9831
  continue;
9805
9832
  }
9806
- if ((n === w.Snapshot || n === w.BoundingBox) && a === ((e = this.master.control.viewContainerManager.mainView) == null ? void 0 : e.id)) {
9807
- const m = (s = this.master.control.viewContainerManager.getView(a)) == null ? void 0 : s.displayer, g = (o = m.snapshotContainerRef) == null ? void 0 : o.current;
9808
- if (m && g && d) {
9809
- g.style.width = `${d.width}px`, g.style.height = `${d.height}px`;
9810
- const I = {
9833
+ if ((a === w.Snapshot || a === w.BoundingBox) && c === ((e = this.master.control.viewContainerManager.mainView) == null ? void 0 : e.id)) {
9834
+ const g = (s = this.master.control.viewContainerManager.getView(c)) == null ? void 0 : s.displayer, v = (o = g.snapshotContainerRef) == null ? void 0 : o.current;
9835
+ if (g && v && d) {
9836
+ (r = this.snapshotThread) == null || r.destroy(), v.style.width = `${d.width}px`, v.style.height = `${d.height}px`;
9837
+ const k = {
9811
9838
  ...de.defaultLayerOpt,
9812
9839
  offscreen: !1,
9813
9840
  width: d.width,
9814
9841
  height: d.height
9815
- }, S = {
9842
+ }, I = {
9816
9843
  ...de.defaultScreenCanvasOpt,
9817
9844
  width: d.width,
9818
9845
  height: d.height
9819
9846
  };
9820
- this.snapshotThread = this.createSnapshotThread(a, {
9821
- displayer: m,
9822
- container: g,
9823
- layerOpt: I,
9847
+ this.snapshotThread = this.createSnapshotThread(c, {
9848
+ displayer: g,
9849
+ container: v,
9850
+ layerOpt: k,
9824
9851
  master: this.master,
9825
- canvasOpt: S,
9852
+ canvasOpt: I,
9826
9853
  post: this.post
9827
- }), this.snapshotThread.on(r).then(() => {
9828
- this.snapshotThread = void 0, g.innerHTML = "", g.style.width = "", g.style.height = "";
9854
+ }), this.snapshotThread.on(n).then(() => {
9855
+ this.snapshotThread = void 0, v.innerHTML = "", v.style.width = "", v.style.height = "";
9829
9856
  });
9830
9857
  continue;
9831
9858
  }
9832
9859
  }
9833
- if (n === w.GetImageBitMap && u && this.snapshotThread) {
9834
- this.snapshotThread.on(r);
9860
+ if (a === w.GetImageBitMap && f && this.snapshotThread) {
9861
+ this.snapshotThread.on(n);
9835
9862
  continue;
9836
9863
  }
9837
- if (n === w.TasksQueue && (c != null && c.size)) {
9838
- for (const [m, g] of this.mainThreadMap.entries()) {
9839
- const I = c.get(m);
9840
- I && (await g.on(I), l && this.post({ workerTasksqueueCount: l }));
9864
+ if (a === w.TasksQueue && (l != null && l.size)) {
9865
+ for (const [g, v] of this.mainThreadMap.entries()) {
9866
+ const k = l.get(g);
9867
+ k && (await v.on(k), h && this.post({ workerTasksqueueCount: h }));
9841
9868
  }
9842
9869
  continue;
9843
9870
  }
9844
- if (a === ds) {
9845
- for (const m of this.mainThreadMap.values())
9846
- m.on(r), n === w.Destroy && this.mainThreadMap.delete(a);
9871
+ if (c === ds) {
9872
+ for (const g of this.mainThreadMap.values())
9873
+ await g.on(n);
9874
+ a === w.Destroy && this.mainThreadMap.clear();
9847
9875
  continue;
9848
9876
  }
9849
- const f = this.mainThreadMap.get(a);
9850
- f && (f.on(r), n === w.Destroy && this.mainThreadMap.delete(a));
9877
+ const m = this.mainThreadMap.get(c);
9878
+ m && (await m.on(n), a === w.Destroy && this.mainThreadMap.delete(c));
9851
9879
  }
9852
9880
  }
9853
9881
  }