@netless/appliance-plugin 1.1.30 → 1.1.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  var _e = Object.defineProperty;
2
- var He = (T, i, t) => i in T ? _e(T, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : T[i] = t;
3
- var y = (T, i, t) => He(T, typeof i != "symbol" ? i + "" : i, t);
4
- import { g as Jt, _ as Ie, i as te, p as St, e as Tt, D as J, f as E, h as Rt, j as Ht, k as st, P as O, l as I, s as Vt, m as ee, n as Nt, o as se, r as Ve, q as qe, c as k, t as Mt, u as U, 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-DNtpxjD9.mjs";
2
+ var Ve = (T, i, t) => i in T ? _e(T, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : T[i] = t;
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 U, 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-BA9yB27Q.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";
@@ -12,7 +12,7 @@ import { O as fe } from "./ObserverMap-BudneEfB.mjs";
12
12
  import "white-web-sdk";
13
13
  import "react-dom";
14
14
  import "react";
15
- var ws = Ie, gs = te, ks = "[object Number]";
15
+ var ws = Pe, gs = te, ks = "[object Number]";
16
16
  function Ss(T) {
17
17
  return typeof T == "number" || gs(T) && ws(T) == ks;
18
18
  }
@@ -125,46 +125,46 @@ const et = class et {
125
125
  },
126
126
  u,
127
127
  m
128
- ), P = e.cloneNode(!0);
128
+ ), I = e.cloneNode(!0);
129
129
  if (!s || !s.length)
130
130
  return;
131
- this.addEraserlines(P, s, o, !1), g.appendChild(P);
131
+ this.addEraserlines(I, s, o, !1), g.appendChild(I);
132
132
  const S = g.parent;
133
133
  S.render();
134
134
  const v = g.renderer.canvasRenderer, L = v.context;
135
135
  if (!L)
136
136
  return;
137
- const C = v.options.displayRatio, R = P.getBoundingClientRect(), W = {
138
- x: R.x,
139
- y: R.y,
140
- w: R.width,
141
- h: R.height
142
- }, N = {
137
+ const C = v.options.displayRatio, N = I.getBoundingClientRect(), R = {
138
+ x: N.x,
139
+ y: N.y,
140
+ w: N.width,
141
+ h: N.height
142
+ }, P = {
143
143
  x: 0,
144
144
  y: 0,
145
145
  w: f.width,
146
146
  h: f.height
147
147
  };
148
- if (Rt(W, N) === Ht.outside) {
149
- Q(P, S), f.removeChild(S), this.isDelete = !0;
148
+ if (Rt(R, P) === Vt.outside) {
149
+ Q(I, S), f.removeChild(S), this.isDelete = !0;
150
150
  return;
151
151
  }
152
- const D = st(W);
153
- D.x = Math.floor(Math.max(W.x, 0)), D.y = Math.floor(Math.max(W.y, 0)), D.w = Math.min(W.x + W.w, f.width) - D.x, D.h = Math.min(W.y + W.h, f.height) - D.y;
154
- const B = this.getGroupRect(D, C), F = B.x, z = B.y, q = B.w, Z = B.h;
155
- let K = L.getImageData(F, z, q, Z);
152
+ const D = st(R);
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, z = B.y, V = B.w, Z = B.h;
155
+ let K = L.getImageData(F, z, V, Z);
156
156
  if (this.isTransparentRectByCanvas(K)) {
157
- Q(P, S), f.removeChild(S), this.isDelete = !0, K = null;
157
+ Q(I, S), f.removeChild(S), this.isDelete = !0, K = null;
158
158
  return;
159
159
  }
160
160
  Q(e, n);
161
161
  const gt = this.createSpriteNode({
162
162
  imageData: K,
163
163
  safariRect: D,
164
- originRect: W,
164
+ originRect: R,
165
165
  worldScaling: g.worldScaling
166
166
  });
167
- gt && e.append(gt), Q(P, S), f.removeChild(S), n.deleteTexture(K), K = null;
167
+ gt && e.append(gt), Q(I, S), f.removeChild(S), n.deleteTexture(K), K = null;
168
168
  } catch (a) {
169
169
  console.error("[BaseShapeTool] drawEraserlines error:", a);
170
170
  return;
@@ -270,14 +270,14 @@ const et = class et {
270
270
  let c;
271
271
  if (n == i.length - 2) {
272
272
  const l = new O(i[n - 2], i[n - 1]);
273
- c = I.Sub(a, l).uni(), o = a;
273
+ c = W.Sub(a, l).uni(), o = a;
274
274
  } else {
275
275
  n === 0 && (r = a);
276
276
  const l = new O(i[n + 2], i[n + 3]);
277
- c = I.Sub(l, a).uni();
277
+ c = W.Sub(l, a).uni();
278
278
  }
279
279
  if (c) {
280
- const l = I.Per(c).mul(t);
280
+ const l = W.Per(c).mul(t);
281
281
  e.push(O.Sub(a, l)), s.push(O.Add(a, l));
282
282
  }
283
283
  }
@@ -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(), V(r, i.parent));
309
+ e ? oo(e, r, i) : (r.remove(), q(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(), V(n, (a = this.drawLayer) == null ? void 0 : a.parent);
313
+ n.remove(), q(n, (a = this.drawLayer) == null ? void 0 : a.parent);
314
314
  }) : this.fullLayer.getElementsByName(t).forEach((n) => {
315
- n.remove(), V(n, this.fullLayer.parent);
315
+ n.remove(), q(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(), V(s, i.parent);
324
+ s.remove(), q(s, i.parent);
325
325
  }
326
326
  static updateNodeOpt(i) {
327
- var P;
327
+ var I;
328
328
  const { node: t, opt: e, vNodes: s, willSerializeData: o, targetNode: r } = i, {
329
329
  zIndex: n,
330
330
  translate: a,
@@ -343,7 +343,7 @@ const et = class et {
343
343
  if (g) {
344
344
  if (l && p && r) {
345
345
  const S = [m.op[0], m.op[1]];
346
- Vt(m.op, h, p, a);
346
+ Ht(m.op, h, p, a);
347
347
  const v = [m.op[0], m.op[1]], L = [
348
348
  v[0] - S[0],
349
349
  v[1] - S[1]
@@ -353,12 +353,12 @@ const et = class et {
353
353
  m.centerPos[1] + L[1]
354
354
  ], m.opt.translate = void 0, m.opt.scale = void 0, m.opt.eraserlines)
355
355
  for (let C = 0; C < m.opt.eraserlines.length; C++) {
356
- const { op: R, thickness: W } = m.opt.eraserlines[C];
356
+ const { op: N, thickness: R } = m.opt.eraserlines[C];
357
357
  m.opt.eraserlines[C].thickness = Math.round(
358
- W * Math.max(p[0], p[1])
358
+ R * Math.max(p[0], p[1])
359
359
  );
360
- for (let N = 0; N < R.length; N++)
361
- ee(R[N], h, p, a);
360
+ for (let P = 0; P < N.length; P++)
361
+ ee(N[P], h, p, a);
362
362
  }
363
363
  } else if (a)
364
364
  if (t.setAttribute("translate", a), m.opt.translate = a, r) {
@@ -384,7 +384,7 @@ const et = class et {
384
384
  for (let v = 0, L = 0; v < m.op.length; v += 3, L++)
385
385
  m.op[v] = S[L][0], m.op[v + 1] = S[L][1];
386
386
  }
387
- if (u && ((P = m == null ? void 0 : m.opt) != null && P.thickness) && (m.opt.thickness = u), o && !(l && p && r)) {
387
+ if (u && ((I = m == null ? void 0 : m.opt) != null && I.thickness) && (m.opt.thickness = u), o && !(l && p && r)) {
388
388
  if (a) {
389
389
  const S = m.op.map((v, L) => {
390
390
  const C = L % 3;
@@ -397,13 +397,13 @@ const et = class et {
397
397
  for (let v = 0; v < m.opt.eraserlines.length; v++) {
398
398
  const { op: L } = m.opt.eraserlines[v];
399
399
  for (let C = 0; C < L.length; C++) {
400
- const R = L[C].map((W, N) => N % 2 ? W + a[1] : W + a[0]);
401
- m.opt.eraserlines[v].op[C] = R;
400
+ const N = L[C].map((R, P) => P % 2 ? R + a[1] : R + a[0]);
401
+ m.opt.eraserlines[v].op[C] = N;
402
402
  }
403
403
  }
404
404
  } else if (H(c)) {
405
405
  const S = m.op;
406
- if (Ve(S, m.centerPos, c), m.op = S, m != null && m.opt && (m.opt.rotate = void 0), m.opt.eraserlines)
406
+ if (He(S, m.centerPos, c), m.op = S, m != null && m.opt && (m.opt.rotate = void 0), m.opt.eraserlines)
407
407
  for (let v = 0; v < m.opt.eraserlines.length; v++) {
408
408
  const { op: L } = m.opt.eraserlines[v];
409
409
  for (let C = 0; C < L.length; C++)
@@ -456,12 +456,12 @@ function vs(T, i = 0.01) {
456
456
  Re([T[e][0], T[e][1]], t[t.length - 1], i) || t.push([T[e][0], T[e][1]]);
457
457
  return t;
458
458
  }
459
- function Ps(T, i = 0.01) {
459
+ function Is(T, i = 0.01) {
460
460
  if (T.length <= 2) return T;
461
461
  const t = T[0], e = T[T.length - 1];
462
462
  return Re(t, e, i) ? T.slice(0, -1) : T;
463
463
  }
464
- function Is(T) {
464
+ function Ps(T) {
465
465
  const i = T.reduce((e, s) => e + s[0], 0) / T.length, t = T.reduce((e, s) => e + s[1], 0) / T.length;
466
466
  return [i, t];
467
467
  }
@@ -475,7 +475,7 @@ function Ws(T, i = 0.01) {
475
475
  t.some(
476
476
  (r) => Math.abs(r[0] - s[0]) < i && Math.abs(r[1] - s[1]) < i
477
477
  ) || t.push([s[0], s[1]]);
478
- const e = Is(t);
478
+ const e = Ps(t);
479
479
  return t.sort((s, o) => {
480
480
  const r = me(e, s), n = me(e, o);
481
481
  return r - n;
@@ -528,7 +528,7 @@ function Cs(T, i, t = 0.01) {
528
528
  it.PolyFillType.pftNonZero
529
529
  );
530
530
  const l = c.map(
531
- (h) => Ps(
531
+ (h) => Is(
532
532
  Ws(
533
533
  vs(
534
534
  h.map(
@@ -603,21 +603,21 @@ class Ne extends b {
603
603
  id: H(n) && n.toString() || void 0
604
604
  };
605
605
  let m, g = !1;
606
- const P = this.syncIndex;
606
+ const I = 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
608
  const v = s ? this.fullLayer : this.drawLayer || this.fullLayer;
609
609
  m = this.draw({ attrs: f, tasks: p, effects: d, layer: v, removeDrawCount: a });
610
610
  }
611
611
  if (c) {
612
612
  const v = [];
613
- return this.tmpPoints.slice(P).forEach((L) => {
613
+ return this.tmpPoints.slice(I).forEach((L) => {
614
614
  v.push(L.x, L.y, this.computRadius(L.z, this.workOptions.thickness));
615
615
  }), {
616
616
  ...this.baseConsumeResult,
617
617
  type: w.DrawWork,
618
618
  dataType: x.Local,
619
619
  op: g ? v : void 0,
620
- index: g ? P * 3 : void 0,
620
+ index: g ? I * 3 : void 0,
621
621
  rect: m,
622
622
  updateNodeOpt: {
623
623
  useAnimation: !0
@@ -631,7 +631,7 @@ class Ne extends b {
631
631
  dataType: x.Local
632
632
  };
633
633
  const S = [];
634
- return this.tmpPoints.slice(P).forEach((v) => {
634
+ return this.tmpPoints.slice(I).forEach((v) => {
635
635
  S.push(v.x, v.y, this.computRadius(v.z, this.workOptions.thickness));
636
636
  }), {
637
637
  ...this.baseConsumeResult,
@@ -639,7 +639,7 @@ class Ne extends b {
639
639
  dataType: x.Local,
640
640
  rect: m,
641
641
  op: g ? S : void 0,
642
- index: g ? P * 3 : void 0,
642
+ index: g ? I * 3 : void 0,
643
643
  updateNodeOpt: {
644
644
  useAnimation: !0
645
645
  }
@@ -703,7 +703,7 @@ class Ne extends b {
703
703
  for (let d = 0; d < e.length; d += 3) {
704
704
  const u = new O(e[d], e[d + 1], e[d + 2]);
705
705
  if (this.tmpPoints.length > 0) {
706
- const f = this.tmpPoints[this.tmpPoints.length - 1], m = I.Sub(u, f).uni();
706
+ const f = this.tmpPoints[this.tmpPoints.length - 1], m = W.Sub(u, f).uni();
707
707
  u.setv(m);
708
708
  }
709
709
  this.tmpPoints.push(u);
@@ -740,7 +740,7 @@ class Ne extends b {
740
740
  for (let a = 0; a < s.length; a += 3) {
741
741
  const c = new O(s[a], s[a + 1], s[a + 2]);
742
742
  if (this.tmpPoints.length > 0) {
743
- const l = this.tmpPoints[this.tmpPoints.length - 1], h = I.Sub(c, l).uni();
743
+ const l = this.tmpPoints[this.tmpPoints.length - 1], h = W.Sub(c, l).uni();
744
744
  c.setv(h);
745
745
  }
746
746
  this.tmpPoints.push(c);
@@ -754,13 +754,13 @@ class Ne extends b {
754
754
  for (const u of o) {
755
755
  const f = [];
756
756
  for (let g = 0; g < u.length; g += 2) {
757
- const P = new O(u[g], u[g + 1]);
757
+ const I = new O(u[g], u[g + 1]);
758
758
  if (f.length > 0) {
759
- const S = f[f.length - 1].point, v = I.Sub(P, S).uni();
760
- P.setv(v);
759
+ const S = f[f.length - 1].point, v = W.Sub(I, S).uni();
760
+ I.setv(v);
761
761
  }
762
762
  f.push({
763
- point: P,
763
+ point: I,
764
764
  radius: r
765
765
  });
766
766
  }
@@ -801,25 +801,25 @@ class Ne extends b {
801
801
  rotate: f,
802
802
  translate: m,
803
803
  eraserlines: g,
804
- lineCap: P,
804
+ lineCap: I,
805
805
  lineDash: S
806
806
  } = this.workOptions;
807
- r != null && r.size && (r.forEach((N) => {
807
+ r != null && r.size && (r.forEach((P) => {
808
808
  var M;
809
- (M = n.getElementById(N + "")) == null || M.remove();
809
+ (M = n.getElementById(P + "")) == null || M.remove();
810
810
  }), r.clear()), a && this.removeDrawCountNodes(n, a);
811
811
  let v;
812
- const L = [], C = n.worldPosition, R = n.worldScaling;
813
- for (let N = 0; N < s.length; N++) {
814
- const { pos: M, points: D } = s[N], { ps: B, rect: F } = this.computDrawPoints(D);
812
+ const L = [], C = n.worldPosition, N = n.worldScaling;
813
+ for (let P = 0; P < s.length; P++) {
814
+ const { pos: M, points: D } = s[P], { ps: B, rect: F } = this.computDrawPoints(D);
815
815
  let z;
816
- const q = D.length === 1;
817
- h === G.Stroke || q ? z = mt(B, !0) : z = mt(B, !1);
816
+ const V = D.length === 1;
817
+ h === G.Stroke || V ? z = mt(B, !0) : z = mt(B, !1);
818
818
  const Z = {
819
819
  pos: M,
820
820
  d: z,
821
- fillColor: h === G.Stroke || q ? l : void 0,
822
- lineDash: q ? void 0 : h === G.Dotted ? [
821
+ fillColor: h === G.Stroke || V ? l : void 0,
822
+ lineDash: V ? void 0 : h === G.Dotted ? [
823
823
  S && S[0] || 1,
824
824
  (S && S[1] || 2) * p
825
825
  ] : h === G.LongDotted ? [
@@ -827,38 +827,38 @@ class Ne extends b {
827
827
  (S && S[1] || 2) * p
828
828
  ] : void 0,
829
829
  strokeColor: l,
830
- lineCap: q ? void 0 : P,
831
- lineWidth: h === G.Stroke || q ? 0 : p
830
+ lineCap: V ? void 0 : I,
831
+ lineWidth: h === G.Stroke || V ? 0 : p
832
832
  };
833
833
  v = E(v, {
834
834
  x: Math.floor(
835
- (F.x + M[0]) * R[0] + C[0] - b.SafeBorderPadding
835
+ (F.x + M[0]) * N[0] + C[0] - b.SafeBorderPadding
836
836
  ),
837
837
  y: Math.floor(
838
- (F.y + M[1]) * R[1] + C[1] - b.SafeBorderPadding
838
+ (F.y + M[1]) * N[1] + C[1] - b.SafeBorderPadding
839
839
  ),
840
840
  w: Math.floor(
841
- F.w * R[0] + 2 * b.SafeBorderPadding
841
+ F.w * N[0] + 2 * b.SafeBorderPadding
842
842
  ),
843
843
  h: Math.floor(
844
- F.h * R[1] + 2 * b.SafeBorderPadding
844
+ F.h * N[1] + 2 * b.SafeBorderPadding
845
845
  )
846
846
  }), L.push(Z);
847
847
  }
848
848
  u && (e.scale = u), f && (e.rotate = f), m && (e.translate = m);
849
- const W = new j();
849
+ const R = new j();
850
850
  if (v) {
851
851
  this.centerPos = b.getCenterPos(v, n);
852
- const N = h === G.Stroke && !g;
853
- W.attr({
852
+ const P = h === G.Stroke && !g;
853
+ R.attr({
854
854
  ...e,
855
855
  normalize: !0,
856
856
  anchor: [0.5, 0.5],
857
- bgcolor: N ? l : void 0,
857
+ bgcolor: P ? l : void 0,
858
858
  pos: this.centerPos,
859
859
  size: [
860
- (v.w - 2 * b.SafeBorderPadding) / R[0],
861
- (v.h - 2 * b.SafeBorderPadding) / R[1]
860
+ (v.w - 2 * b.SafeBorderPadding) / N[0],
861
+ (v.h - 2 * b.SafeBorderPadding) / N[1]
862
862
  ],
863
863
  zIndex: d
864
864
  });
@@ -866,26 +866,26 @@ class Ne extends b {
866
866
  D.pos[0] - this.centerPos[0],
867
867
  D.pos[1] - this.centerPos[1]
868
868
  ], new wt(D)));
869
- W.append(...M), N && W.seal(), g && (this.scaleType = U.proportional, this.drawEraserlines(
869
+ R.append(...M), P && R.seal(), g && (this.scaleType = U.proportional, this.drawEraserlines(
870
870
  {
871
- group: W,
871
+ group: R,
872
872
  eraserlines: g,
873
873
  pos: this.centerPos,
874
874
  layer: n
875
875
  },
876
876
  c
877
- )), this.replace(n, o, W);
877
+ )), this.replace(n, o, R);
878
878
  }
879
879
  if (u || f || m) {
880
- const N = W == null ? void 0 : W.getBoundingClientRect();
881
- N && (v = {
882
- x: Math.floor(N.x - b.SafeBorderPadding),
883
- y: Math.floor(N.y - b.SafeBorderPadding),
884
- w: Math.floor(N.width + b.SafeBorderPadding * 2),
885
- h: Math.floor(N.height + b.SafeBorderPadding * 2)
880
+ const P = R == null ? void 0 : R.getBoundingClientRect();
881
+ P && (v = {
882
+ x: Math.floor(P.x - b.SafeBorderPadding),
883
+ y: Math.floor(P.y - b.SafeBorderPadding),
884
+ w: Math.floor(P.width + b.SafeBorderPadding * 2),
885
+ h: Math.floor(P.height + b.SafeBorderPadding * 2)
886
886
  });
887
887
  }
888
- return this.isDelete && W.setAttribute("opacity", 0), v;
888
+ return this.isDelete && R.setAttribute("opacity", 0), v;
889
889
  }
890
890
  computDrawPoints(t) {
891
891
  return this.workOptions.strokeType === G.Stroke || t.length === 1 ? this.computStroke(t) : this.computNomal(t);
@@ -904,7 +904,7 @@ class Ne extends b {
904
904
  const { point: c, radius: l } = t[a];
905
905
  let h = c.v;
906
906
  a === 0 && t.length > 1 && (h = t[a + 1].point.v);
907
- const p = I.Per(h).mul(l);
907
+ const p = W.Per(h).mul(l);
908
908
  s.push(O.Sub(c, p)), o.push(O.Add(c, p));
909
909
  }
910
910
  const r = t[t.length - 1];
@@ -969,14 +969,14 @@ class Ne extends b {
969
969
  t[o + 1]
970
970
  );
971
971
  if (g < 60 || g > 300) {
972
- const P = (h = c.pop()) == null ? void 0 : h.point.clone();
973
- P && s.push({
972
+ const I = (h = c.pop()) == null ? void 0 : h.point.clone();
973
+ I && s.push({
974
974
  taskId: l,
975
975
  pos: a,
976
976
  points: [
977
977
  ...c,
978
978
  {
979
- point: P,
979
+ point: I,
980
980
  radius: m
981
981
  }
982
982
  ]
@@ -1011,16 +1011,16 @@ class Ne extends b {
1011
1011
  this.tmpPoints.push(h);
1012
1012
  continue;
1013
1013
  }
1014
- const p = l - 1, d = this.tmpPoints[p], u = I.Sub(h, d).uni();
1014
+ const p = l - 1, d = this.tmpPoints[p], u = W.Sub(h, d).uni();
1015
1015
  if (h.isNear(d, e)) {
1016
1016
  if (d.z < this.MAX_REPEAR) {
1017
1017
  if (d.setz(Math.min(d.z + 1, this.MAX_REPEAR)), n = Math.min(n, p), l > 1) {
1018
1018
  let g = l - 1;
1019
1019
  for (; g > 0; ) {
1020
- const P = this.tmpPoints[g].distance(
1020
+ const I = this.tmpPoints[g].distance(
1021
1021
  this.tmpPoints[g - 1]
1022
1022
  ), S = Math.max(
1023
- this.tmpPoints[g].z - this.uniThickness * P,
1023
+ this.tmpPoints[g].z - this.uniThickness * I,
1024
1024
  0
1025
1025
  );
1026
1026
  if (this.tmpPoints[g - 1].z >= S)
@@ -1034,7 +1034,7 @@ class Ne extends b {
1034
1034
  }
1035
1035
  h.setv(u);
1036
1036
  const f = h.distance(d), m = Math.max(d.z - this.uniThickness * f, 0);
1037
- l > 1 && I.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);
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);
1038
1038
  }
1039
1039
  if (n === 1 / 0)
1040
1040
  return this.tmpPoints.length;
@@ -1069,12 +1069,12 @@ class Ne extends b {
1069
1069
  this.tmpPoints.push(p);
1070
1070
  continue;
1071
1071
  }
1072
- const d = h - 1, u = this.tmpPoints[d], f = I.Sub(p, u).uni();
1072
+ const d = h - 1, u = this.tmpPoints[d], f = W.Sub(p, u).uni();
1073
1073
  if (p.isNear(u, e / 2)) {
1074
1074
  n = Math.min(d, n);
1075
1075
  continue;
1076
1076
  }
1077
- I.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);
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);
1078
1078
  }
1079
1079
  let a = r;
1080
1080
  if (n === r) {
@@ -1105,7 +1105,7 @@ class Ne extends b {
1105
1105
  this.tmpPoints.push(a);
1106
1106
  continue;
1107
1107
  }
1108
- const c = n - 1, l = this.tmpPoints[c], h = I.Sub(a, l).uni(), p = a.distance(l);
1108
+ const c = n - 1, l = this.tmpPoints[c], h = W.Sub(a, l).uni(), p = a.distance(l);
1109
1109
  if (n > 1 && l.z === o)
1110
1110
  break;
1111
1111
  if (a.isNear(l, e / 2)) {
@@ -1127,7 +1127,7 @@ class Ne extends b {
1127
1127
  }
1128
1128
  a.setv(h);
1129
1129
  const d = Math.max(l.z - this.uniThickness * p, o);
1130
- n > 1 && I.Equals(h, l.v, 0.02) && l.z <= 0 && this.tmpPoints.pop(), a.setz(d), this.tmpPoints.push(a);
1130
+ n > 1 && W.Equals(h, l.v, 0.02) && l.z <= 0 && this.tmpPoints.pop(), a.setz(d), this.tmpPoints.push(a);
1131
1131
  }
1132
1132
  }
1133
1133
  static updateNodeOpt(t) {
@@ -1180,12 +1180,12 @@ class xe extends b {
1180
1180
  lineCap: p,
1181
1181
  lineWidth: c,
1182
1182
  anchor: [0.5, 0.5]
1183
- }, P = this.getTaskPoints(m);
1184
- if (P.length) {
1183
+ }, I = this.getTaskPoints(m);
1184
+ if (I.length) {
1185
1185
  const v = Date.now();
1186
1186
  v - this.syncTimestamp > this.syncUnitTime && (u = !0, this.syncTimestamp = v, this.syncIndex = this.tmpPoints.length), s && this.draw({
1187
1187
  attrs: g,
1188
- tasks: P,
1188
+ tasks: I,
1189
1189
  isDot: !1,
1190
1190
  layer: this.drawLayer || this.fullLayer
1191
1191
  });
@@ -1440,11 +1440,11 @@ const vt = class vt extends b {
1440
1440
  computRectCenterPoints() {
1441
1441
  const t = this.tmpPoints.slice(-2);
1442
1442
  if (this.tmpPoints.length === 4) {
1443
- const e = new I(this.tmpPoints[0], this.tmpPoints[1]), s = new I(this.tmpPoints[2], this.tmpPoints[3]), o = I.Sub(s, e).uni(), r = I.Dist(e, s), { width: n, height: a } = vt.eraserSizes[this.workOptions.thickness], c = Math.min(n, a), l = Math.round(r / c);
1443
+ const e = new W(this.tmpPoints[0], this.tmpPoints[1]), s = new W(this.tmpPoints[2], this.tmpPoints[3]), o = W.Sub(s, e).uni(), r = W.Dist(e, s), { width: n, height: a } = vt.eraserSizes[this.workOptions.thickness], c = Math.min(n, a), l = Math.round(r / c);
1444
1444
  if (l > 1) {
1445
1445
  const h = [];
1446
1446
  for (let p = 0; p < l; p++) {
1447
- const d = I.Mul(o, p * c);
1447
+ const d = W.Mul(o, p * c);
1448
1448
  h.push(this.tmpPoints[0] + d.x, this.tmpPoints[1] + d.y);
1449
1449
  }
1450
1450
  return h.concat(t);
@@ -1453,8 +1453,8 @@ const vt = class vt extends b {
1453
1453
  return t;
1454
1454
  }
1455
1455
  isNear(t, e) {
1456
- const s = new I(t[0], t[1]), o = new I(e[0], e[1]), { width: r, height: n } = vt.eraserSizes[this.workOptions.thickness];
1457
- return I.Dist(s, o) < Math.hypot(r, n) * 0.5;
1456
+ const s = new W(t[0], t[1]), o = new W(e[0], e[1]), { width: r, height: n } = vt.eraserSizes[this.workOptions.thickness];
1457
+ return W.Dist(s, o) < Math.hypot(r, n) * 0.5;
1458
1458
  }
1459
1459
  remove(t) {
1460
1460
  const { curNodeMap: e, removeIds: s } = t;
@@ -1463,7 +1463,7 @@ const vt = class vt extends b {
1463
1463
  if (r.rect && this.eraserRect && this.eraserPolyline && Zt(this.eraserRect, r.rect)) {
1464
1464
  const { op: n } = r, a = [], c = [];
1465
1465
  for (let h = 0; h < n.length; h += 3) {
1466
- const p = new I(
1466
+ const p = new W(
1467
1467
  n[h] * this.worldScaling[0] + this.worldPosition[0],
1468
1468
  n[h + 1] * this.worldScaling[1] + this.worldPosition[1],
1469
1469
  n[h + 2]
@@ -1479,7 +1479,7 @@ const vt = class vt extends b {
1479
1479
  return s.forEach((r) => {
1480
1480
  var a;
1481
1481
  const n = this.fullLayer.getElementsByName(r);
1482
- n[0] && (n[0].remove(), V(n[0], this.fullLayer.parent), (a = this.vNodes) == null || a.delete(r));
1482
+ n[0] && (n[0].remove(), q(n[0], this.fullLayer.parent), (a = this.vNodes) == null || a.delete(r));
1483
1483
  }), o && (o.x -= b.SafeBorderPadding, o.y -= b.SafeBorderPadding, o.w += b.SafeBorderPadding * 2, o.h += b.SafeBorderPadding * 2), o;
1484
1484
  }
1485
1485
  consume(t) {
@@ -1570,10 +1570,10 @@ function xs(T, i, t, e, s, o) {
1570
1570
  o.set(T, i), o.set(i, T);
1571
1571
  for (var m = r; ++h < a; ) {
1572
1572
  p = n[h];
1573
- var g = T[p], P = i[p];
1573
+ var g = T[p], I = i[p];
1574
1574
  if (e)
1575
- var S = r ? e(P, g, p, i, T, o) : e(g, P, p, T, i, o);
1576
- if (!(S === void 0 ? g === P || s(g, P, t, e, o) : S)) {
1575
+ var S = r ? e(I, g, p, i, T, o) : e(g, I, p, T, i, o);
1576
+ if (!(S === void 0 ? g === I || s(g, I, t, e, o) : S)) {
1577
1577
  f = !1;
1578
1578
  break;
1579
1579
  }
@@ -1606,9 +1606,9 @@ function Us(T, i, t, e, s, o) {
1606
1606
  }
1607
1607
  return p ? (o || (o = new jt()), As(T, i, t, e, s, o)) : !1;
1608
1608
  }
1609
- var zs = Us, Gs = zs, Pe = te;
1609
+ var zs = Us, Gs = zs, Ie = te;
1610
1610
  function De(T, i, t, e, s) {
1611
- return T === i ? !0 : T == null || i == null || !Pe(T) && !Pe(i) ? T !== T && i !== i : Gs(T, i, t, e, De, s);
1611
+ return T === i ? !0 : T == null || i == null || !Ie(T) && !Ie(i) ? T !== T && i !== i : Gs(T, i, t, e, De, s);
1612
1612
  }
1613
1613
  var Xs = De, Ys = Xs;
1614
1614
  function $s(T, i) {
@@ -1837,7 +1837,7 @@ const lt = /* @__PURE__ */ Jt(_s), _t = class _t extends b {
1837
1837
  computDrawPoints(t) {
1838
1838
  const { thickness: e } = this.workOptions, s = [];
1839
1839
  for (const n of t)
1840
- s.push(new I(...n));
1840
+ s.push(new W(...n));
1841
1841
  const o = $(s, e), r = [
1842
1842
  o.x + o.w / 2,
1843
1843
  o.y + o.h / 2
@@ -1859,7 +1859,7 @@ const lt = /* @__PURE__ */ Jt(_s), _t = class _t extends b {
1859
1859
  lineJoin: "round",
1860
1860
  lineCap: "round"
1861
1861
  };
1862
- let P = {
1862
+ let I = {
1863
1863
  x: Math.floor(
1864
1864
  d.x * h[0] + l[0] - b.SafeBorderPadding
1865
1865
  ),
@@ -1888,14 +1888,14 @@ const lt = /* @__PURE__ */ Jt(_s), _t = class _t extends b {
1888
1888
  });
1889
1889
  if (S.appendChild(v), this.replace(s, e, S), n || a || c) {
1890
1890
  const L = S.getBoundingClientRect();
1891
- P = {
1891
+ I = {
1892
1892
  x: Math.floor(L.x - b.SafeBorderPadding),
1893
1893
  y: Math.floor(L.y - b.SafeBorderPadding),
1894
1894
  w: Math.floor(L.width + 2 * b.SafeBorderPadding),
1895
1895
  h: Math.floor(L.height + 2 * b.SafeBorderPadding)
1896
1896
  };
1897
1897
  }
1898
- return P;
1898
+ return I;
1899
1899
  }
1900
1900
  transformData(t) {
1901
1901
  const e = $(t);
@@ -2041,7 +2041,7 @@ const lt = /* @__PURE__ */ Jt(_s), _t = class _t extends b {
2041
2041
  f[0] + a[0],
2042
2042
  f[1] + a[1]
2043
2043
  ] : e.translate = a);
2044
- let P;
2044
+ let I;
2045
2045
  if (p || f || H(u)) {
2046
2046
  if (d === A.Start && s)
2047
2047
  return o.setTargetAssignKeys(s), {
@@ -2050,30 +2050,30 @@ const lt = /* @__PURE__ */ Jt(_s), _t = class _t extends b {
2050
2050
  selectRect: this.oldSelectRect,
2051
2051
  rect: this.oldSelectRect
2052
2052
  };
2053
- if (P = o.getLastTarget(), !P)
2053
+ if (I = o.getLastTarget(), !I)
2054
2054
  return;
2055
2055
  }
2056
2056
  if (s)
2057
2057
  for (const L of s) {
2058
2058
  const C = o.get(L);
2059
2059
  if (C) {
2060
- const { toolsType: R, opt: W } = C, N = (c == null ? void 0 : c.getElementsByName(L))[0];
2061
- if (N) {
2060
+ const { toolsType: N, opt: R } = C, P = (c == null ? void 0 : c.getElementsByName(L))[0];
2061
+ if (P) {
2062
2062
  const M = { ...e };
2063
2063
  let D;
2064
2064
  const B = b.isWillRefresh({
2065
- toolsType: R,
2066
- opt: W,
2065
+ toolsType: N,
2066
+ opt: R,
2067
2067
  updateOpt: M,
2068
2068
  vNodes: o,
2069
- node: N,
2069
+ node: P,
2070
2070
  willSerializeData: r
2071
2071
  });
2072
- if (R) {
2073
- D = P == null ? void 0 : P.get(L);
2074
- const F = ze(R);
2072
+ if (N) {
2073
+ D = I == null ? void 0 : I.get(L);
2074
+ const F = ze(N);
2075
2075
  if (F == null || F.updateNodeOpt({
2076
- node: N,
2076
+ node: P,
2077
2077
  opt: M,
2078
2078
  vNodes: o,
2079
2079
  willSerializeData: r,
@@ -2081,31 +2081,31 @@ const lt = /* @__PURE__ */ Jt(_s), _t = class _t extends b {
2081
2081
  }), C && n && B) {
2082
2082
  const z = n.createWorkShapeNode({
2083
2083
  workId: L,
2084
- toolsType: R,
2084
+ toolsType: N,
2085
2085
  toolsOpt: C.opt
2086
2086
  });
2087
2087
  z == null || z.setWorkId(L);
2088
- let q;
2089
- if (R === k.BackgroundSVG)
2090
- q = z.consumeService({
2088
+ let V;
2089
+ if (N === k.BackgroundSVG)
2090
+ V = z.consumeService({
2091
2091
  isFullWork: !0,
2092
2092
  replaceId: L
2093
2093
  });
2094
- else if (R === k.Image)
2095
- q = await z.consumeServiceAsync({
2094
+ else if (N === k.Image)
2095
+ V = await z.consumeServiceAsync({
2096
2096
  isFullWork: !0,
2097
2097
  replaceId: L,
2098
2098
  worker: n
2099
2099
  });
2100
- else if (R === k.Text)
2101
- q = await z.consumeServiceAsync({
2100
+ else if (N === k.Text)
2101
+ V = await z.consumeServiceAsync({
2102
2102
  isFullWork: !0,
2103
2103
  replaceId: L,
2104
2104
  isDrawLabel: !0
2105
2105
  });
2106
2106
  else
2107
2107
  try {
2108
- q = z == null ? void 0 : z.consumeService({
2108
+ V = z == null ? void 0 : z.consumeService({
2109
2109
  op: C.op,
2110
2110
  isFullWork: !0,
2111
2111
  replaceId: L,
@@ -2115,14 +2115,14 @@ const lt = /* @__PURE__ */ Jt(_s), _t = class _t extends b {
2115
2115
  console.error("consumeService error", Z);
2116
2116
  continue;
2117
2117
  }
2118
- q && (C.rect = q);
2118
+ V && (C.rect = V);
2119
2119
  }
2120
2120
  C && (h.set(L, C), l = E(l, C.rect));
2121
2121
  }
2122
2122
  }
2123
2123
  }
2124
2124
  }
2125
- P && d === A.Done && (o.deleteLastTarget(), P = void 0);
2125
+ I && d === A.Done && (o.deleteLastTarget(), I = void 0);
2126
2126
  const S = l;
2127
2127
  if (p && f && g && m && S && !a) {
2128
2128
  const L = [
@@ -2150,15 +2150,15 @@ const lt = /* @__PURE__ */ Jt(_s), _t = class _t extends b {
2150
2150
  f[0] > 0 && f[1] < 0 ? C = L[3] : f[0] > 0 ? C = L[0] : f[1] < 0 ? C = L[2] : C = L[1];
2151
2151
  break;
2152
2152
  }
2153
- const R = C && [
2153
+ const N = C && [
2154
2154
  p[0] - C[0],
2155
2155
  p[1] - C[1]
2156
2156
  ] || [0, 0];
2157
- if (!lt(R, [0, 0]))
2157
+ if (!lt(N, [0, 0]))
2158
2158
  return await this.updateSelector({
2159
2159
  ...t,
2160
2160
  updateSelectorOpt: { workState: d },
2161
- offset: R
2161
+ offset: N
2162
2162
  });
2163
2163
  }
2164
2164
  this.getSelecteorInfo(h), this.draw(X, c, {
@@ -2320,8 +2320,8 @@ class Me extends b {
2320
2320
  ...this.baseConsumeResult
2321
2321
  };
2322
2322
  if (n) {
2323
- const P = Date.now();
2324
- P - this.syncTimestamp > this.syncUnitTime && (this.syncTimestamp = P, g.op = this.tmpPoints.map((S) => [...S.XY, 0]).flat(1), g.index = 0, g.isSync = !0);
2323
+ const I = Date.now();
2324
+ 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);
2325
2325
  }
2326
2326
  return g;
2327
2327
  }
@@ -2387,30 +2387,30 @@ class Me extends b {
2387
2387
  eraserlines: d,
2388
2388
  lineDash: u,
2389
2389
  lineCap: f
2390
- } = this.workOptions, m = s.worldPosition, g = s.worldScaling, { points: P, pos: S, rect: v, isTriangle: L, trianglePoints: C, trianglePos: R } = this.computDrawPoints(n), W = [
2390
+ } = this.workOptions, m = s.worldPosition, g = s.worldScaling, { points: I, pos: S, rect: v, isTriangle: L, trianglePoints: C, trianglePos: N } = this.computDrawPoints(n), R = [
2391
2391
  v.x + v.w / 2,
2392
2392
  v.y + v.h / 2
2393
- ], N = {
2394
- pos: W,
2393
+ ], P = {
2394
+ pos: R,
2395
2395
  name: e,
2396
2396
  id: e,
2397
2397
  zIndex: a,
2398
2398
  anchor: [0.5, 0.5],
2399
2399
  size: [v.w, v.h]
2400
2400
  };
2401
- c && (N.scale = c), l && (N.rotate = l), h && (N.translate = h);
2402
- const M = new j(N), D = {
2401
+ c && (P.scale = c), l && (P.rotate = l), h && (P.translate = h);
2402
+ const M = new j(P), D = {
2403
2403
  points: C,
2404
- pos: [R[0] - W[0], R[1] - W[1]],
2404
+ pos: [N[0] - R[0], N[1] - R[1]],
2405
2405
  fillColor: r,
2406
2406
  strokeColor: r,
2407
2407
  lineWidth: 0,
2408
2408
  normalize: !1
2409
2409
  }, B = new ht(D);
2410
- if (M.append(B), !L && P && S) {
2410
+ if (M.append(B), !L && I && S) {
2411
2411
  const z = {
2412
- points: P,
2413
- pos: [S[0] - W[0], S[1] - W[1]],
2412
+ points: I,
2413
+ pos: [S[0] - R[0], S[1] - R[1]],
2414
2414
  fillColor: r,
2415
2415
  strokeColor: r,
2416
2416
  lineDash: p === G.Dotted ? [
@@ -2423,14 +2423,14 @@ class Me extends b {
2423
2423
  lineCap: p === G.Normal ? void 0 : f,
2424
2424
  lineWidth: n,
2425
2425
  normalize: !1
2426
- }, q = new ht(z);
2427
- M.append(q);
2426
+ }, V = new ht(z);
2427
+ M.append(V);
2428
2428
  }
2429
2429
  d && (this.scaleType = U.proportional, this.drawEraserlines(
2430
2430
  {
2431
2431
  group: M,
2432
2432
  eraserlines: d,
2433
- pos: W,
2433
+ pos: R,
2434
2434
  layer: s
2435
2435
  },
2436
2436
  o
@@ -2464,13 +2464,13 @@ class Me extends b {
2464
2464
  return this.tmpPoints[1].distance(this.tmpPoints[0]) > this.arrowTipWidth ? this.computFullArrowPoints(t) : this.computTrianglePoints();
2465
2465
  }
2466
2466
  computFullArrowPoints(t) {
2467
- const e = I.Sub(this.tmpPoints[1], this.tmpPoints[0]).uni(), s = I.Per(e).mul(t / 2), o = O.Sub(
2467
+ const e = W.Sub(this.tmpPoints[1], this.tmpPoints[0]).uni(), s = W.Per(e).mul(t / 2), o = O.Sub(
2468
2468
  this.tmpPoints[0],
2469
2469
  s
2470
2470
  ), r = O.Add(
2471
2471
  this.tmpPoints[0],
2472
2472
  s
2473
- ), n = I.Mul(e, this.arrowTipWidth), a = I.Sub(this.tmpPoints[1], n), c = O.Sub(a, s), l = O.Add(a, s), h = I.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 = [
2473
+ ), 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 = [
2474
2474
  o,
2475
2475
  r,
2476
2476
  ...f,
@@ -2487,7 +2487,7 @@ class Me extends b {
2487
2487
  };
2488
2488
  }
2489
2489
  computTrianglePoints() {
2490
- const t = I.Sub(this.tmpPoints[1], this.tmpPoints[0]).uni(), e = this.tmpPoints[1].distance(this.tmpPoints[0]), s = I.Per(t).mul(
2490
+ const t = W.Sub(this.tmpPoints[1], this.tmpPoints[0]).uni(), e = this.tmpPoints[1].distance(this.tmpPoints[0]), s = W.Per(t).mul(
2491
2491
  Math.floor(e * 3 / 8)
2492
2492
  ), o = O.Sub(this.tmpPoints[0], s), r = O.Add(
2493
2493
  this.tmpPoints[0],
@@ -2583,19 +2583,19 @@ class Oe extends b {
2583
2583
  y: 0,
2584
2584
  w: Math.floor(m.width),
2585
2585
  h: Math.floor(m.height)
2586
- }, P = {
2586
+ }, I = {
2587
2587
  type: w.DrawWork,
2588
2588
  dataType: x.Local,
2589
2589
  ...this.baseConsumeResult
2590
2590
  };
2591
- if (Rt(u, g) !== Ht.outside) {
2591
+ if (Rt(u, g) !== Vt.outside) {
2592
2592
  const v = E(u, this.oldRect);
2593
- if (this.oldRect = u, P.rect = v, !a)
2594
- return P;
2593
+ if (this.oldRect = u, I.rect = v, !a)
2594
+ return I;
2595
2595
  }
2596
2596
  if (a) {
2597
2597
  const v = Date.now();
2598
- return v - this.syncTimestamp > this.syncUnitTime && (this.syncTimestamp = v, P.op = this.tmpPoints.map((L) => [...L.XY, 0]).flat(1), P.index = 0, P.isSync = !0), P;
2598
+ 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;
2599
2599
  }
2600
2600
  return { type: w.None };
2601
2601
  }
@@ -2660,7 +2660,7 @@ class Oe extends b {
2660
2660
  eraserlines: f,
2661
2661
  lineDash: m,
2662
2662
  lineCap: g
2663
- } = this.workOptions, P = s.worldScaling, { radius: S, rect: v, pos: L } = this.computDrawPoints(c), C = {
2663
+ } = this.workOptions, I = s.worldScaling, { radius: S, rect: v, pos: L } = this.computDrawPoints(c), C = {
2664
2664
  closeType: "normal",
2665
2665
  radius: S,
2666
2666
  lineWidth: c,
@@ -2675,7 +2675,7 @@ class Oe extends b {
2675
2675
  (m && m[0] || 1) * c,
2676
2676
  (m && m[1] || 2) * c
2677
2677
  ] : void 0
2678
- }, R = {
2678
+ }, N = {
2679
2679
  name: e,
2680
2680
  id: e,
2681
2681
  zIndex: l,
@@ -2683,8 +2683,8 @@ class Oe extends b {
2683
2683
  anchor: [0.5, 0.5],
2684
2684
  size: [v.w, v.h]
2685
2685
  };
2686
- h && (R.scale = h), p && (R.rotate = p), d && (R.translate = d);
2687
- const W = new j(R);
2686
+ h && (N.scale = h), p && (N.rotate = p), d && (N.translate = d);
2687
+ const R = new j(N);
2688
2688
  if (o) {
2689
2689
  const D = new wt({
2690
2690
  d: "M-4,0H4M0,-4V4",
@@ -2692,25 +2692,25 @@ class Oe extends b {
2692
2692
  pos: [0, 0],
2693
2693
  strokeColor: n,
2694
2694
  lineWidth: 1,
2695
- scale: [1 / P[0], 1 / P[1]]
2695
+ scale: [1 / I[0], 1 / I[1]]
2696
2696
  });
2697
- W.append(D);
2697
+ R.append(D);
2698
2698
  }
2699
- const N = new us({
2699
+ const P = new us({
2700
2700
  ...C,
2701
2701
  pos: [0, 0]
2702
2702
  });
2703
- W.append(N), f && (this.scaleType = U.proportional, this.drawEraserlines(
2703
+ R.append(P), f && (this.scaleType = U.proportional, this.drawEraserlines(
2704
2704
  {
2705
- group: W,
2705
+ group: R,
2706
2706
  eraserlines: f,
2707
2707
  pos: L,
2708
2708
  layer: s
2709
2709
  },
2710
2710
  r
2711
- )), this.replace(s, e, W);
2712
- const M = W.getBoundingClientRect();
2713
- return this.isDelete && W.setAttribute("opacity", 0), {
2711
+ )), this.replace(s, e, R);
2712
+ const M = R.getBoundingClientRect();
2713
+ return this.isDelete && R.setAttribute("opacity", 0), {
2714
2714
  x: Math.floor(M.x - b.SafeBorderPadding),
2715
2715
  y: Math.floor(M.y - b.SafeBorderPadding),
2716
2716
  w: Math.floor(M.width + b.SafeBorderPadding * 2),
@@ -2798,7 +2798,7 @@ class Ae extends b {
2798
2798
  computDrawPoints(t) {
2799
2799
  const { thickness: e } = this.workOptions, s = [];
2800
2800
  for (const n of t)
2801
- s.push(new I(...n));
2801
+ s.push(new W(...n));
2802
2802
  const o = $(s, e), r = [
2803
2803
  o.x + o.w / 2,
2804
2804
  o.y + o.h / 2
@@ -2839,8 +2839,8 @@ class Ae extends b {
2839
2839
  ...this.baseConsumeResult
2840
2840
  };
2841
2841
  if (n) {
2842
- const P = Date.now();
2843
- P - this.syncTimestamp > this.syncUnitTime && (this.syncTimestamp = P, g.op = d.flat(1), g.index = 0, g.isSync = !0);
2842
+ const I = Date.now();
2843
+ I - this.syncTimestamp > this.syncUnitTime && (this.syncTimestamp = I, g.op = d.flat(1), g.index = 0, g.isSync = !0);
2844
2844
  }
2845
2845
  return g;
2846
2846
  }
@@ -2917,16 +2917,16 @@ class Ae extends b {
2917
2917
  translate: f,
2918
2918
  strokeType: m,
2919
2919
  eraserlines: g,
2920
- lineCap: P,
2920
+ lineCap: I,
2921
2921
  lineDash: S
2922
- } = this.workOptions, v = s.worldPosition, L = s.worldScaling, { points: C, rect: R, pos: W } = this.computDrawPoints(r), N = {
2922
+ } = this.workOptions, v = s.worldPosition, L = s.worldScaling, { points: C, rect: N, pos: R } = this.computDrawPoints(r), P = {
2923
2923
  close: !0,
2924
2924
  normalize: !0,
2925
2925
  points: C,
2926
2926
  lineWidth: h,
2927
2927
  fillColor: l !== "transparent" && l || void 0,
2928
2928
  strokeColor: c,
2929
- lineCap: P,
2929
+ lineCap: I,
2930
2930
  lineDash: m === G.Dotted ? [
2931
2931
  S && S[0] || 1,
2932
2932
  (S && S[1] || 2) * h
@@ -2937,30 +2937,30 @@ class Ae extends b {
2937
2937
  };
2938
2938
  let M = {
2939
2939
  x: Math.floor(
2940
- R.x * L[0] + v[0] - b.SafeBorderPadding
2940
+ N.x * L[0] + v[0] - b.SafeBorderPadding
2941
2941
  ),
2942
2942
  y: Math.floor(
2943
- R.y * L[1] + v[1] - b.SafeBorderPadding
2943
+ N.y * L[1] + v[1] - b.SafeBorderPadding
2944
2944
  ),
2945
2945
  w: Math.floor(
2946
- R.w * L[0] + 2 * b.SafeBorderPadding
2946
+ N.w * L[0] + 2 * b.SafeBorderPadding
2947
2947
  ),
2948
2948
  h: Math.floor(
2949
- R.h * L[0] + 2 * b.SafeBorderPadding
2949
+ N.h * L[0] + 2 * b.SafeBorderPadding
2950
2950
  )
2951
2951
  };
2952
2952
  const D = new j({
2953
2953
  name: e,
2954
2954
  id: e,
2955
2955
  zIndex: p,
2956
- pos: W,
2956
+ pos: R,
2957
2957
  anchor: [0.5, 0.5],
2958
- size: [R.w, R.h],
2958
+ size: [N.w, N.h],
2959
2959
  scale: d,
2960
2960
  rotate: u,
2961
2961
  translate: f
2962
2962
  }), B = new ht({
2963
- ...N,
2963
+ ...P,
2964
2964
  pos: [0, 0]
2965
2965
  });
2966
2966
  if (D.appendChild(B), o) {
@@ -2978,7 +2978,7 @@ class Ae extends b {
2978
2978
  {
2979
2979
  group: D,
2980
2980
  eraserlines: g,
2981
- pos: W,
2981
+ pos: R,
2982
2982
  layer: s
2983
2983
  },
2984
2984
  a
@@ -3088,8 +3088,8 @@ class Ee extends b {
3088
3088
  ...this.baseConsumeResult
3089
3089
  };
3090
3090
  if (n) {
3091
- const P = Date.now();
3092
- P - this.syncTimestamp > this.syncUnitTime && (this.syncTimestamp = P, g.op = this.tmpPoints.map((S) => [...S.XY, 0]).flat(1), g.index = 0, g.isSync = !0);
3091
+ const I = Date.now();
3092
+ 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);
3093
3093
  }
3094
3094
  return g;
3095
3095
  }
@@ -3160,17 +3160,17 @@ class Ee extends b {
3160
3160
  rotate: f,
3161
3161
  translate: m,
3162
3162
  strokeType: g,
3163
- eraserlines: P,
3163
+ eraserlines: I,
3164
3164
  lineDash: S,
3165
3165
  lineCap: v
3166
- } = this.workOptions, L = s.worldScaling, { rect: C, pos: R, points: W } = this.computDrawPoints(
3166
+ } = this.workOptions, L = s.worldScaling, { rect: C, pos: N, points: R } = this.computDrawPoints(
3167
3167
  c,
3168
3168
  h,
3169
3169
  p,
3170
3170
  d
3171
- ), N = {
3171
+ ), P = {
3172
3172
  close: !0,
3173
- points: W,
3173
+ points: R,
3174
3174
  lineWidth: c,
3175
3175
  fillColor: a !== "transparent" && a || void 0,
3176
3176
  strokeColor: n,
@@ -3187,7 +3187,7 @@ class Ee extends b {
3187
3187
  name: e,
3188
3188
  id: e,
3189
3189
  zIndex: l,
3190
- pos: R,
3190
+ pos: N,
3191
3191
  anchor: [0.5, 0.5],
3192
3192
  size: [C.w, C.h]
3193
3193
  };
@@ -3205,14 +3205,14 @@ class Ee extends b {
3205
3205
  D.append(z);
3206
3206
  }
3207
3207
  const B = new ht({
3208
- ...N,
3208
+ ...P,
3209
3209
  pos: [0, 0]
3210
3210
  });
3211
- D.append(B), P && (this.scaleType = U.proportional, this.drawEraserlines(
3211
+ D.append(B), I && (this.scaleType = U.proportional, this.drawEraserlines(
3212
3212
  {
3213
3213
  group: D,
3214
- eraserlines: P,
3215
- pos: R,
3214
+ eraserlines: I,
3215
+ pos: N,
3216
3216
  layer: s
3217
3217
  },
3218
3218
  r
@@ -3338,8 +3338,8 @@ class Be extends b {
3338
3338
  ...this.baseConsumeResult
3339
3339
  };
3340
3340
  if (n) {
3341
- const P = Date.now();
3342
- P - this.syncTimestamp > this.syncUnitTime && (this.syncTimestamp = P, g.op = this.tmpPoints.map((S) => [...S.XY, 0]).flat(1), g.index = 0, g.isSync = !0);
3341
+ const I = Date.now();
3342
+ 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);
3343
3343
  }
3344
3344
  return g;
3345
3345
  }
@@ -3410,8 +3410,8 @@ class Be extends b {
3410
3410
  strokeType: f,
3411
3411
  eraserlines: m,
3412
3412
  lineCap: g,
3413
- lineDash: P
3414
- } = this.workOptions, S = s.worldScaling, { rect: v, pos: L, points: C } = this.computDrawPoints(c, h), R = {
3413
+ lineDash: I
3414
+ } = this.workOptions, S = s.worldScaling, { rect: v, pos: L, points: C } = this.computDrawPoints(c, h), N = {
3415
3415
  close: !0,
3416
3416
  points: C,
3417
3417
  lineWidth: c,
@@ -3420,13 +3420,13 @@ class Be extends b {
3420
3420
  normalize: !0,
3421
3421
  lineCap: g,
3422
3422
  lineDash: f === G.Dotted ? [
3423
- P && P[0] || 1,
3424
- (P && P[1] || 2) * c
3423
+ I && I[0] || 1,
3424
+ (I && I[1] || 2) * c
3425
3425
  ] : f === G.LongDotted ? [
3426
- (P && P[0] || 1) * c,
3427
- (P && P[1] || 2) * c
3426
+ (I && I[0] || 1) * c,
3427
+ (I && I[1] || 2) * c
3428
3428
  ] : void 0
3429
- }, W = {
3429
+ }, R = {
3430
3430
  name: e,
3431
3431
  id: e,
3432
3432
  zIndex: l,
@@ -3434,8 +3434,8 @@ class Be extends b {
3434
3434
  anchor: [0.5, 0.5],
3435
3435
  size: [v.w, v.h]
3436
3436
  };
3437
- p && (W.scale = p), d && (W.rotate = d), u && (W.translate = u);
3438
- const N = new j(W);
3437
+ p && (R.scale = p), d && (R.rotate = d), u && (R.translate = u);
3438
+ const P = new j(R);
3439
3439
  if (o) {
3440
3440
  const B = new wt({
3441
3441
  d: "M-4,0H4M0,-4V4",
@@ -3445,23 +3445,23 @@ class Be extends b {
3445
3445
  lineWidth: 1,
3446
3446
  scale: [1 / S[0], 1 / S[1]]
3447
3447
  });
3448
- N.append(B);
3448
+ P.append(B);
3449
3449
  }
3450
3450
  const M = new ht({
3451
- ...R,
3451
+ ...N,
3452
3452
  pos: [0, 0]
3453
3453
  });
3454
- N.append(M), m && (this.scaleType = U.proportional, this.drawEraserlines(
3454
+ P.append(M), m && (this.scaleType = U.proportional, this.drawEraserlines(
3455
3455
  {
3456
- group: N,
3456
+ group: P,
3457
3457
  eraserlines: m,
3458
3458
  pos: L,
3459
3459
  layer: s
3460
3460
  },
3461
3461
  r
3462
- )), this.replace(s, e, N);
3463
- const D = N.getBoundingClientRect();
3464
- return this.isDelete && N.setAttribute("opacity", 0), {
3462
+ )), this.replace(s, e, P);
3463
+ const D = P.getBoundingClientRect();
3464
+ return this.isDelete && P.setAttribute("opacity", 0), {
3465
3465
  x: Math.floor(D.x - b.SafeBorderPadding),
3466
3466
  y: Math.floor(D.y - b.SafeBorderPadding),
3467
3467
  w: Math.floor(D.width + b.SafeBorderPadding * 2),
@@ -3565,7 +3565,7 @@ class ot {
3565
3565
  */
3566
3566
  static oneBezier(i, t, e) {
3567
3567
  const s = t.x + (e.x - t.x) * i, o = t.y + (e.y - t.y) * i;
3568
- return new I(s, o);
3568
+ return new W(s, o);
3569
3569
  }
3570
3570
  /**
3571
3571
  * @desc 二阶贝塞尔
@@ -3576,7 +3576,7 @@ class ot {
3576
3576
  */
3577
3577
  static twoBezier(i, t, e, s) {
3578
3578
  const o = (1 - i) * (1 - i) * t.x + 2 * i * (1 - i) * e.x + i * i * s.x, r = (1 - i) * (1 - i) * t.y + 2 * i * (1 - i) * e.y + i * i * s.y;
3579
- return new I(o, r);
3579
+ return new W(o, r);
3580
3580
  }
3581
3581
  /**
3582
3582
  * @desc 三阶贝塞尔
@@ -3588,7 +3588,7 @@ class ot {
3588
3588
  */
3589
3589
  static threeBezier(i, t, e, s, o) {
3590
3590
  const r = t.x * (1 - i) * (1 - i) * (1 - i) + 3 * e.x * i * (1 - i) * (1 - i) + 3 * s.x * i * i * (1 - i) + o.x * i * i * i, n = t.y * (1 - i) * (1 - i) * (1 - i) + 3 * e.y * i * (1 - i) * (1 - i) + 3 * s.y * i * i * (1 - i) + o.y * i * i * i;
3591
- return new I(r, n);
3591
+ return new W(r, n);
3592
3592
  }
3593
3593
  }
3594
3594
  class Fe extends b {
@@ -3637,8 +3637,8 @@ class Fe extends b {
3637
3637
  ...this.baseConsumeResult
3638
3638
  };
3639
3639
  if (n) {
3640
- const P = Date.now();
3641
- P - this.syncTimestamp > this.syncUnitTime && (this.syncTimestamp = P, g.op = this.tmpPoints.map((S) => [...S.XY, 0]).flat(1), g.index = 0, g.isSync = !0);
3640
+ const I = Date.now();
3641
+ 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);
3642
3642
  }
3643
3643
  return g;
3644
3644
  }
@@ -3710,7 +3710,7 @@ class Fe extends b {
3710
3710
  eraserlines: f,
3711
3711
  lineDash: m,
3712
3712
  lineCap: g
3713
- } = this.workOptions, { rect: P, pos: S, points: v } = this.computDrawPoints(a, l), L = {
3713
+ } = this.workOptions, { rect: I, pos: S, points: v } = this.computDrawPoints(a, l), L = {
3714
3714
  points: v.map((M) => M.XY),
3715
3715
  lineWidth: a,
3716
3716
  fillColor: n !== "transparent" && n || void 0,
@@ -3732,28 +3732,28 @@ class Fe extends b {
3732
3732
  zIndex: c,
3733
3733
  pos: S,
3734
3734
  anchor: [0.5, 0.5],
3735
- size: [P.w, P.h]
3735
+ size: [I.w, I.h]
3736
3736
  };
3737
3737
  h && (C.scale = h), p && (C.rotate = p), d && (C.translate = d);
3738
- const R = new j(C), W = new ht({
3738
+ const N = new j(C), R = new ht({
3739
3739
  ...L,
3740
3740
  pos: [0, 0]
3741
3741
  });
3742
- R.append(W), f && (this.scaleType = U.proportional, this.drawEraserlines(
3742
+ N.append(R), f && (this.scaleType = U.proportional, this.drawEraserlines(
3743
3743
  {
3744
- group: R,
3744
+ group: N,
3745
3745
  eraserlines: f,
3746
3746
  pos: S,
3747
3747
  layer: s
3748
3748
  },
3749
3749
  o
3750
- )), this.replace(s, e, R);
3751
- const N = R.getBoundingClientRect();
3752
- return this.isDelete && R.setAttribute("opacity", 0), {
3753
- x: Math.floor(N.x - b.SafeBorderPadding),
3754
- y: Math.floor(N.y - b.SafeBorderPadding),
3755
- w: Math.floor(N.width + b.SafeBorderPadding * 2),
3756
- h: Math.floor(N.height + b.SafeBorderPadding * 2)
3750
+ )), this.replace(s, e, N);
3751
+ const P = N.getBoundingClientRect();
3752
+ return this.isDelete && N.setAttribute("opacity", 0), {
3753
+ x: Math.floor(P.x - b.SafeBorderPadding),
3754
+ y: Math.floor(P.y - b.SafeBorderPadding),
3755
+ w: Math.floor(P.width + b.SafeBorderPadding * 2),
3756
+ h: Math.floor(P.height + b.SafeBorderPadding * 2)
3757
3757
  };
3758
3758
  }
3759
3759
  transformControlPoints(t) {
@@ -3764,10 +3764,10 @@ class Fe extends b {
3764
3764
  case "bottomRight": {
3765
3765
  const s = e.y + e.h * this.ratio;
3766
3766
  return [
3767
- new I(e.x, e.y, 0),
3768
- new I(e.x + e.w, e.y, 0),
3769
- new I(e.x + e.w, s, 0),
3770
- new I(e.x, s, 0)
3767
+ new W(e.x, e.y, 0),
3768
+ new W(e.x + e.w, e.y, 0),
3769
+ new W(e.x + e.w, s, 0),
3770
+ new W(e.x, s, 0)
3771
3771
  ];
3772
3772
  }
3773
3773
  case "top":
@@ -3775,10 +3775,10 @@ class Fe extends b {
3775
3775
  case "topRight": {
3776
3776
  const s = e.y + e.h * (1 - this.ratio);
3777
3777
  return [
3778
- new I(e.x, s, 0),
3779
- new I(e.x + e.w, s, 0),
3780
- new I(e.x + e.w, e.y + e.h, 0),
3781
- new I(e.x, e.y + e.h, 0)
3778
+ new W(e.x, s, 0),
3779
+ new W(e.x + e.w, s, 0),
3780
+ new W(e.x + e.w, e.y + e.h, 0),
3781
+ new W(e.x, e.y + e.h, 0)
3782
3782
  ];
3783
3783
  }
3784
3784
  case "left":
@@ -3786,10 +3786,10 @@ class Fe extends b {
3786
3786
  case "leftTop": {
3787
3787
  const s = e.x + e.w * (1 - this.ratio);
3788
3788
  return [
3789
- new I(s, e.y, 0),
3790
- new I(e.x + e.w, e.y, 0),
3791
- new I(e.x + e.w, e.y + e.h, 0),
3792
- new I(s, e.y + e.h, 0)
3789
+ new W(s, e.y, 0),
3790
+ new W(e.x + e.w, e.y, 0),
3791
+ new W(e.x + e.w, e.y + e.h, 0),
3792
+ new W(s, e.y + e.h, 0)
3793
3793
  ];
3794
3794
  }
3795
3795
  case "right":
@@ -3797,59 +3797,59 @@ class Fe extends b {
3797
3797
  case "rightTop": {
3798
3798
  const s = e.x + e.w * this.ratio;
3799
3799
  return [
3800
- new I(e.x, e.y, 0),
3801
- new I(s, e.y, 0),
3802
- new I(s, e.y + e.h, 0),
3803
- new I(e.x, e.y + e.h, 0)
3800
+ new W(e.x, e.y, 0),
3801
+ new W(s, e.y, 0),
3802
+ new W(s, e.y + e.h, 0),
3803
+ new W(e.x, e.y + e.h, 0)
3804
3804
  ];
3805
3805
  }
3806
3806
  }
3807
3807
  }
3808
3808
  computDrawPoints(t, e) {
3809
- const s = $(this.tmpPoints), o = this.transformControlPoints(e), r = Math.floor(s.w * 0.1), n = Math.floor(s.h * 0.1), a = [], c = I.Add(o[0], new I(0, n, 0)), l = I.Add(o[0], new I(r, 0, 0)), h = ot.getBezierPoints(
3809
+ const s = $(this.tmpPoints), o = this.transformControlPoints(e), r = Math.floor(s.w * 0.1), n = Math.floor(s.h * 0.1), a = [], c = W.Add(o[0], new W(0, n, 0)), l = W.Add(o[0], new W(r, 0, 0)), h = ot.getBezierPoints(
3810
3810
  10,
3811
3811
  c,
3812
3812
  o[0],
3813
3813
  l
3814
- ), p = I.Sub(o[1], new I(r, 0, 0)), d = I.Add(
3814
+ ), p = W.Sub(o[1], new W(r, 0, 0)), d = W.Add(
3815
3815
  o[1],
3816
- new I(0, n, 0)
3816
+ new W(0, n, 0)
3817
3817
  ), u = ot.getBezierPoints(
3818
3818
  10,
3819
3819
  p,
3820
3820
  o[1],
3821
3821
  d
3822
- ), f = I.Sub(o[2], new I(0, n, 0)), m = I.Sub(
3822
+ ), f = W.Sub(o[2], new W(0, n, 0)), m = W.Sub(
3823
3823
  o[2],
3824
- new I(r, 0, 0)
3824
+ new W(r, 0, 0)
3825
3825
  ), g = ot.getBezierPoints(
3826
3826
  10,
3827
3827
  f,
3828
3828
  o[2],
3829
3829
  m
3830
- ), P = I.Add(
3830
+ ), I = W.Add(
3831
3831
  o[3],
3832
- new I(r, 0, 0)
3833
- ), S = I.Sub(
3832
+ new W(r, 0, 0)
3833
+ ), S = W.Sub(
3834
3834
  o[3],
3835
- new I(0, n, 0)
3835
+ new W(0, n, 0)
3836
3836
  ), v = ot.getBezierPoints(
3837
3837
  10,
3838
- P,
3838
+ I,
3839
3839
  o[3],
3840
3840
  S
3841
3841
  ), L = r * (1 - this.ratio) * 10, C = n * (1 - this.ratio) * 10;
3842
3842
  switch (e) {
3843
3843
  case "bottom": {
3844
- const N = I.Sub(
3844
+ const P = W.Sub(
3845
3845
  o[2],
3846
- new I(r * 5 - L / 2, 0, 0)
3847
- ), M = I.Sub(
3846
+ new W(r * 5 - L / 2, 0, 0)
3847
+ ), M = W.Sub(
3848
3848
  o[2],
3849
- new I(r * 5, -C, 0)
3850
- ), D = I.Sub(
3849
+ new W(r * 5, -C, 0)
3850
+ ), D = W.Sub(
3851
3851
  o[2],
3852
- new I(r * 5 + L / 2, 0, 0)
3852
+ new W(r * 5 + L / 2, 0, 0)
3853
3853
  );
3854
3854
  a.push(
3855
3855
  M,
@@ -3858,20 +3858,20 @@ class Fe extends b {
3858
3858
  ...h,
3859
3859
  ...u,
3860
3860
  ...g,
3861
- N
3861
+ P
3862
3862
  );
3863
3863
  break;
3864
3864
  }
3865
3865
  case "bottomRight": {
3866
- const N = I.Sub(
3866
+ const P = W.Sub(
3867
3867
  o[2],
3868
- new I(r * 1.1, 0, 0)
3869
- ), M = I.Sub(
3868
+ new W(r * 1.1, 0, 0)
3869
+ ), M = W.Sub(
3870
3870
  o[2],
3871
- new I(r * 1.1 + L / 2, -C, 0)
3872
- ), D = I.Sub(
3871
+ new W(r * 1.1 + L / 2, -C, 0)
3872
+ ), D = W.Sub(
3873
3873
  o[2],
3874
- new I(r * 1.1 + L, 0, 0)
3874
+ new W(r * 1.1 + L, 0, 0)
3875
3875
  );
3876
3876
  a.push(
3877
3877
  M,
@@ -3880,20 +3880,20 @@ class Fe extends b {
3880
3880
  ...h,
3881
3881
  ...u,
3882
3882
  ...g,
3883
- N
3883
+ P
3884
3884
  );
3885
3885
  break;
3886
3886
  }
3887
3887
  case "bottomLeft": {
3888
- const N = I.Add(
3888
+ const P = W.Add(
3889
3889
  o[3],
3890
- new I(r * 1.1 + L, 0, 0)
3891
- ), M = I.Add(
3890
+ new W(r * 1.1 + L, 0, 0)
3891
+ ), M = W.Add(
3892
3892
  o[3],
3893
- new I(r * 1.1 + L / 2, C, 0)
3894
- ), D = I.Add(
3893
+ new W(r * 1.1 + L / 2, C, 0)
3894
+ ), D = W.Add(
3895
3895
  o[3],
3896
- new I(r * 1.1, 0, 0)
3896
+ new W(r * 1.1, 0, 0)
3897
3897
  );
3898
3898
  a.push(
3899
3899
  M,
@@ -3902,24 +3902,24 @@ class Fe extends b {
3902
3902
  ...h,
3903
3903
  ...u,
3904
3904
  ...g,
3905
- N
3905
+ P
3906
3906
  );
3907
3907
  break;
3908
3908
  }
3909
3909
  case "top": {
3910
- const N = I.Sub(
3910
+ const P = W.Sub(
3911
3911
  o[1],
3912
- new I(r * 5 - L / 2, 0, 0)
3913
- ), M = I.Sub(
3912
+ new W(r * 5 - L / 2, 0, 0)
3913
+ ), M = W.Sub(
3914
3914
  o[1],
3915
- new I(r * 5, C, 0)
3916
- ), D = I.Sub(
3915
+ new W(r * 5, C, 0)
3916
+ ), D = W.Sub(
3917
3917
  o[1],
3918
- new I(r * 5 + L / 2, 0, 0)
3918
+ new W(r * 5 + L / 2, 0, 0)
3919
3919
  );
3920
3920
  a.push(
3921
3921
  M,
3922
- N,
3922
+ P,
3923
3923
  ...u,
3924
3924
  ...g,
3925
3925
  ...v,
@@ -3929,19 +3929,19 @@ class Fe extends b {
3929
3929
  break;
3930
3930
  }
3931
3931
  case "topRight": {
3932
- const N = I.Sub(
3932
+ const P = W.Sub(
3933
3933
  o[1],
3934
- new I(r * 1.1, 0, 0)
3935
- ), M = I.Sub(
3934
+ new W(r * 1.1, 0, 0)
3935
+ ), M = W.Sub(
3936
3936
  o[1],
3937
- new I(r * 1.1 + L / 2, C, 0)
3938
- ), D = I.Sub(
3937
+ new W(r * 1.1 + L / 2, C, 0)
3938
+ ), D = W.Sub(
3939
3939
  o[1],
3940
- new I(r * 1.1 + L, 0, 0)
3940
+ new W(r * 1.1 + L, 0, 0)
3941
3941
  );
3942
3942
  a.push(
3943
3943
  M,
3944
- N,
3944
+ P,
3945
3945
  ...u,
3946
3946
  ...g,
3947
3947
  ...v,
@@ -3951,19 +3951,19 @@ class Fe extends b {
3951
3951
  break;
3952
3952
  }
3953
3953
  case "topLeft": {
3954
- const N = I.Add(
3954
+ const P = W.Add(
3955
3955
  o[0],
3956
- new I(r * 1.1 + L, 0, 0)
3957
- ), M = I.Add(
3956
+ new W(r * 1.1 + L, 0, 0)
3957
+ ), M = W.Add(
3958
3958
  o[0],
3959
- new I(r * 1.1 + L / 2, -C, 0)
3960
- ), D = I.Add(
3959
+ new W(r * 1.1 + L / 2, -C, 0)
3960
+ ), D = W.Add(
3961
3961
  o[0],
3962
- new I(r * 1.1, 0, 0)
3962
+ new W(r * 1.1, 0, 0)
3963
3963
  );
3964
3964
  a.push(
3965
3965
  M,
3966
- N,
3966
+ P,
3967
3967
  ...u,
3968
3968
  ...g,
3969
3969
  ...v,
@@ -3973,19 +3973,19 @@ class Fe extends b {
3973
3973
  break;
3974
3974
  }
3975
3975
  case "left": {
3976
- const N = I.Add(
3976
+ const P = W.Add(
3977
3977
  o[0],
3978
- new I(0, n * 5 - C / 2, 0)
3979
- ), M = I.Add(
3978
+ new W(0, n * 5 - C / 2, 0)
3979
+ ), M = W.Add(
3980
3980
  o[0],
3981
- new I(-L, n * 5, 0)
3982
- ), D = I.Add(
3981
+ new W(-L, n * 5, 0)
3982
+ ), D = W.Add(
3983
3983
  o[0],
3984
- new I(0, n * 5 + C / 2, 0)
3984
+ new W(0, n * 5 + C / 2, 0)
3985
3985
  );
3986
3986
  a.push(
3987
3987
  M,
3988
- N,
3988
+ P,
3989
3989
  ...h,
3990
3990
  ...u,
3991
3991
  ...g,
@@ -3995,19 +3995,19 @@ class Fe extends b {
3995
3995
  break;
3996
3996
  }
3997
3997
  case "leftTop": {
3998
- const N = I.Add(
3998
+ const P = W.Add(
3999
3999
  o[0],
4000
- new I(0, n * 1.1, 0)
4001
- ), M = I.Add(
4000
+ new W(0, n * 1.1, 0)
4001
+ ), M = W.Add(
4002
4002
  o[0],
4003
- new I(-L, n * 1.1 + C / 2, 0)
4004
- ), D = I.Add(
4003
+ new W(-L, n * 1.1 + C / 2, 0)
4004
+ ), D = W.Add(
4005
4005
  o[0],
4006
- new I(0, n * 1.1 + C, 0)
4006
+ new W(0, n * 1.1 + C, 0)
4007
4007
  );
4008
4008
  a.push(
4009
4009
  M,
4010
- N,
4010
+ P,
4011
4011
  ...h,
4012
4012
  ...u,
4013
4013
  ...g,
@@ -4017,19 +4017,19 @@ class Fe extends b {
4017
4017
  break;
4018
4018
  }
4019
4019
  case "leftBottom": {
4020
- const N = I.Sub(
4020
+ const P = W.Sub(
4021
4021
  o[3],
4022
- new I(0, n * 1.1 + C, 0)
4023
- ), M = I.Sub(
4022
+ new W(0, n * 1.1 + C, 0)
4023
+ ), M = W.Sub(
4024
4024
  o[3],
4025
- new I(L, n * 1.1 + C / 2, 0)
4026
- ), D = I.Sub(
4025
+ new W(L, n * 1.1 + C / 2, 0)
4026
+ ), D = W.Sub(
4027
4027
  o[3],
4028
- new I(0, n * 1.1, 0)
4028
+ new W(0, n * 1.1, 0)
4029
4029
  );
4030
4030
  a.push(
4031
4031
  M,
4032
- N,
4032
+ P,
4033
4033
  ...h,
4034
4034
  ...u,
4035
4035
  ...g,
@@ -4039,15 +4039,15 @@ class Fe extends b {
4039
4039
  break;
4040
4040
  }
4041
4041
  case "right": {
4042
- const N = I.Add(
4042
+ const P = W.Add(
4043
4043
  o[1],
4044
- new I(0, n * 5 - C / 2, 0)
4045
- ), M = I.Add(
4044
+ new W(0, n * 5 - C / 2, 0)
4045
+ ), M = W.Add(
4046
4046
  o[1],
4047
- new I(L, n * 5, 0)
4048
- ), D = I.Add(
4047
+ new W(L, n * 5, 0)
4048
+ ), D = W.Add(
4049
4049
  o[1],
4050
- new I(0, n * 5 + C / 2, 0)
4050
+ new W(0, n * 5 + C / 2, 0)
4051
4051
  );
4052
4052
  a.push(
4053
4053
  M,
@@ -4056,20 +4056,20 @@ class Fe extends b {
4056
4056
  ...v,
4057
4057
  ...h,
4058
4058
  ...u,
4059
- N
4059
+ P
4060
4060
  );
4061
4061
  break;
4062
4062
  }
4063
4063
  case "rightTop": {
4064
- const N = I.Add(
4064
+ const P = W.Add(
4065
4065
  o[1],
4066
- new I(0, n * 1.1, 0)
4067
- ), M = I.Add(
4066
+ new W(0, n * 1.1, 0)
4067
+ ), M = W.Add(
4068
4068
  o[1],
4069
- new I(L, n * 1.1 + C / 2, 0)
4070
- ), D = I.Add(
4069
+ new W(L, n * 1.1 + C / 2, 0)
4070
+ ), D = W.Add(
4071
4071
  o[1],
4072
- new I(0, n * 1.1 + C, 0)
4072
+ new W(0, n * 1.1 + C, 0)
4073
4073
  );
4074
4074
  a.push(
4075
4075
  M,
@@ -4078,20 +4078,20 @@ class Fe extends b {
4078
4078
  ...v,
4079
4079
  ...h,
4080
4080
  ...u,
4081
- N
4081
+ P
4082
4082
  );
4083
4083
  break;
4084
4084
  }
4085
4085
  case "rightBottom": {
4086
- const N = I.Sub(
4086
+ const P = W.Sub(
4087
4087
  o[2],
4088
- new I(0, n * 1.1 + C, 0)
4089
- ), M = I.Sub(
4088
+ new W(0, n * 1.1 + C, 0)
4089
+ ), M = W.Sub(
4090
4090
  o[2],
4091
- new I(-L, n * 1.1 + C / 2, 0)
4092
- ), D = I.Sub(
4091
+ new W(-L, n * 1.1 + C / 2, 0)
4092
+ ), D = W.Sub(
4093
4093
  o[2],
4094
- new I(0, n * 1.1, 0)
4094
+ new W(0, n * 1.1, 0)
4095
4095
  );
4096
4096
  a.push(
4097
4097
  M,
@@ -4100,18 +4100,18 @@ class Fe extends b {
4100
4100
  ...v,
4101
4101
  ...h,
4102
4102
  ...u,
4103
- N
4103
+ P
4104
4104
  );
4105
4105
  break;
4106
4106
  }
4107
4107
  }
4108
- const R = $(this.tmpPoints, t), W = [
4109
- Math.floor(R.x + R.w / 2),
4110
- Math.floor(R.y + R.h / 2)
4108
+ const N = $(this.tmpPoints, t), R = [
4109
+ Math.floor(N.x + N.w / 2),
4110
+ Math.floor(N.y + N.h / 2)
4111
4111
  ];
4112
4112
  return {
4113
- rect: R,
4114
- pos: W,
4113
+ rect: N,
4114
+ pos: R,
4115
4115
  points: a
4116
4116
  };
4117
4117
  }
@@ -4161,9 +4161,9 @@ class Fe extends b {
4161
4161
  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);
4162
4162
  }
4163
4163
  }
4164
- var Hs = Ie, Vs = te, qs = "[object Boolean]";
4164
+ var Vs = Pe, Hs = te, qs = "[object Boolean]";
4165
4165
  function js(T) {
4166
- return T === !0 || T === !1 || Vs(T) && Hs(T) == qs;
4166
+ return T === !0 || T === !1 || Hs(T) && Vs(T) == qs;
4167
4167
  }
4168
4168
  var Zs = js;
4169
4169
  const kt = /* @__PURE__ */ Jt(Zs);
@@ -4210,8 +4210,8 @@ class Ue extends b {
4210
4210
  ...this.baseConsumeResult
4211
4211
  };
4212
4212
  if (n) {
4213
- const P = Date.now();
4214
- P - this.syncTimestamp > this.syncUnitTime && (this.syncTimestamp = P, g.op = this.tmpPoints.map((S) => [...S.XY, 0]).flat(1), g.index = 0, g.isSync = !0);
4213
+ const I = Date.now();
4214
+ 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);
4215
4215
  }
4216
4216
  return g;
4217
4217
  }
@@ -4277,7 +4277,7 @@ class Ue extends b {
4277
4277
  eraserlines: d,
4278
4278
  lineCap: u,
4279
4279
  lineDash: f
4280
- } = this.workOptions, m = s.worldPosition, g = s.worldScaling, { d: P, rect: S, isDot: v } = this.computDrawPoints(n, p), L = [
4280
+ } = this.workOptions, m = s.worldPosition, g = s.worldScaling, { d: I, rect: S, isDot: v } = this.computDrawPoints(n, p), L = [
4281
4281
  S.x + S.w / 2,
4282
4282
  S.y + S.h / 2
4283
4283
  ], C = new j({
@@ -4288,10 +4288,10 @@ class Ue extends b {
4288
4288
  id: e,
4289
4289
  normalize: !0,
4290
4290
  zIndex: a
4291
- }), R = {
4291
+ }), N = {
4292
4292
  pos: [0, 0],
4293
4293
  normalize: !0,
4294
- d: P,
4294
+ d: I,
4295
4295
  fillColor: r,
4296
4296
  strokeColor: r,
4297
4297
  lineDash: v ? void 0 : p === G.Dotted ? [
@@ -4304,9 +4304,9 @@ class Ue extends b {
4304
4304
  lineCap: v ? void 0 : u,
4305
4305
  lineWidth: p === G.Normal || v ? 0 : n
4306
4306
  };
4307
- c && (R.scale = c), l && (R.rotate = l), h && (R.translate = h);
4308
- const W = new wt(R);
4309
- C.append(W), d && (this.scaleType = U.proportional, this.drawEraserlines(
4307
+ c && (N.scale = c), l && (N.rotate = l), h && (N.translate = h);
4308
+ const R = new wt(N);
4309
+ C.append(R), d && (this.scaleType = U.proportional, this.drawEraserlines(
4310
4310
  {
4311
4311
  group: C,
4312
4312
  eraserlines: d,
@@ -4315,7 +4315,7 @@ class Ue extends b {
4315
4315
  },
4316
4316
  o
4317
4317
  )), this.replace(s, e, C);
4318
- let N = {
4318
+ let P = {
4319
4319
  x: Math.floor(
4320
4320
  S.x * g[0] + m[0] - b.SafeBorderPadding
4321
4321
  ),
@@ -4330,21 +4330,21 @@ class Ue extends b {
4330
4330
  )
4331
4331
  };
4332
4332
  if (l || c || h) {
4333
- const M = W.getBoundingClientRect();
4334
- N = {
4333
+ const M = R.getBoundingClientRect();
4334
+ P = {
4335
4335
  x: Math.floor(M.x - b.SafeBorderPadding),
4336
4336
  y: Math.floor(M.y - b.SafeBorderPadding),
4337
4337
  w: Math.floor(M.width + b.SafeBorderPadding * 2),
4338
4338
  h: Math.floor(M.height + b.SafeBorderPadding * 2)
4339
4339
  };
4340
4340
  }
4341
- return this.isDelete && C.setAttribute("opacity", 0), N;
4341
+ return this.isDelete && C.setAttribute("opacity", 0), P;
4342
4342
  }
4343
4343
  computDrawPoints(t, e) {
4344
4344
  return this.tmpPoints[1].distance(this.tmpPoints[0]) > this.straightTipWidth ? this.computFullPoints(t, e) : this.computDotPoints(t);
4345
4345
  }
4346
4346
  computFullPoints(t, e) {
4347
- const s = I.Sub(this.tmpPoints[1], this.tmpPoints[0]).uni(), o = I.Per(s).mul(t / 2), r = O.Sub(
4347
+ const s = W.Sub(this.tmpPoints[1], this.tmpPoints[0]).uni(), o = W.Per(s).mul(t / 2), r = O.Sub(
4348
4348
  this.tmpPoints[0],
4349
4349
  o
4350
4350
  ), n = O.Add(
@@ -4488,9 +4488,9 @@ const ft = class ft extends b {
4488
4488
  };
4489
4489
  this.replace(s, e, d);
4490
4490
  let m;
4491
- if (r && (m = Rt(f, r)), (o || r && m !== Ht.outside) && s && this.workOptions.text) {
4492
- const g = await ft.createLabels(this.workOptions, s, f), { labels: P, maxWidth: S } = g;
4493
- d.append(...P), f.w = Math.ceil(Math.max(S * s.worldScaling[0], f.w));
4491
+ if (r && (m = Rt(f, r)), (o || r && m !== Vt.outside) && s && this.workOptions.text) {
4492
+ const g = await ft.createLabels(this.workOptions, s, f), { labels: I, maxWidth: S } = g;
4493
+ d.append(...I), f.w = Math.ceil(Math.max(S * s.worldScaling[0], f.w));
4494
4494
  }
4495
4495
  return f;
4496
4496
  }
@@ -4571,18 +4571,18 @@ const ft = class ft extends b {
4571
4571
  textAlign: f,
4572
4572
  italic: m,
4573
4573
  fontFamily: g,
4574
- verticalAlign: P,
4574
+ verticalAlign: I,
4575
4575
  fontColor: S,
4576
4576
  fontBgColor: v,
4577
4577
  underline: L,
4578
4578
  lineThrough: C
4579
- } = t, R = ft.getSafetySnippetRatio(e) || 1, W = Math.floor(p * R), N = ft.getSafetySnippetFontLength(W);
4579
+ } = t, N = ft.getSafetySnippetRatio(e) || 1, R = Math.floor(p * N), P = ft.getSafetySnippetFontLength(R);
4580
4580
  let M = 0;
4581
4581
  for (let B = 0; B < h; B++) {
4582
- const F = l[B], z = d || W * 1.5;
4582
+ const F = l[B], z = d || R * 1.5;
4583
4583
  if (F) {
4584
- const q = is(F), Z = [0, 0], K = [0, p * 1.2];
4585
- P === "middle" && (Z[1] = Math.floor(
4584
+ const V = is(F), Z = [0, 0], K = [0, p * 1.2];
4585
+ I === "middle" && (Z[1] = Math.floor(
4586
4586
  B * p * 1.2 + 6 + p * (1.1 - 1)
4587
4587
  ));
4588
4588
  const nt = [0, Math.floor(-p * 0.15)];
@@ -4591,31 +4591,31 @@ const ft = class ft extends b {
4591
4591
  let pt = 0;
4592
4592
  const Ot = [];
4593
4593
  let Ct = 0;
4594
- for (; Ct < q; ) {
4594
+ for (; Ct < V; ) {
4595
4595
  f === "left" && (nt[0] = pt), Ct === 0 && m === "italic" && (nt[0] = nt[0] - gt / 2 * p);
4596
- const qt = F.slice(Ct, Ct + N), At = {
4596
+ const qt = F.slice(Ct, Ct + P), At = {
4597
4597
  anchor: [0, 0],
4598
4598
  pos: nt,
4599
4599
  text: qt,
4600
4600
  fontFamily: g,
4601
- fontSize: W,
4601
+ fontSize: R,
4602
4602
  lineHeight: z,
4603
4603
  strokeColor: S,
4604
4604
  fontWeight: u,
4605
4605
  fillColor: S,
4606
4606
  textAlign: f,
4607
4607
  fontStyle: m,
4608
- scale: [1 / R, 1 / R]
4608
+ scale: [1 / N, 1 / N]
4609
4609
  }, dt = new fs(At), at = await dt.textImageReady;
4610
4610
  let Et = !0;
4611
4611
  if (at) {
4612
4612
  const ae = at.rect && at.rect[2], ce = at.rect && at.rect[3];
4613
4613
  if (ae && ce) {
4614
- const le = ae / R, $e = ce / R;
4614
+ const le = ae / N, $e = ce / N;
4615
4615
  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);
4616
4616
  }
4617
4617
  }
4618
- Ct += N;
4618
+ Ct += P;
4619
4619
  }
4620
4620
  K[0] = pt, m === "italic" && (K[0] = K[0] + gt * p), M = Math.max(M, K[0]);
4621
4621
  let ne = !0;
@@ -4667,26 +4667,26 @@ const ft = class ft extends b {
4667
4667
  lineThrough: f,
4668
4668
  underline: m,
4669
4669
  fontSize: g,
4670
- textInfos: P,
4670
+ textInfos: I,
4671
4671
  zIndex: S
4672
4672
  } = s, v = r && st(r) || o.get(e.name);
4673
4673
  if (!v || !e.parent) return;
4674
4674
  const C = v.opt;
4675
- if (H(S) && (e.setAttribute("zIndex", S), v.opt.zIndex = S), a && C.fontColor && (C.fontColor = a, e.children.forEach((R) => {
4676
- R.tagName === "GROUP" && R.children.forEach((W) => {
4677
- W.tagName === "LABEL" ? (W.setAttribute("fillColor", a), W.setAttribute("strokeColor", a)) : W.tagName === "POLYLINE" && W.setAttribute("strokeColor", a);
4675
+ if (H(S) && (e.setAttribute("zIndex", S), v.opt.zIndex = S), a && C.fontColor && (C.fontColor = a, e.children.forEach((N) => {
4676
+ N.tagName === "GROUP" && N.children.forEach((R) => {
4677
+ R.tagName === "LABEL" ? (R.setAttribute("fillColor", a), R.setAttribute("strokeColor", a)) : R.tagName === "POLYLINE" && R.setAttribute("strokeColor", a);
4678
4678
  });
4679
- })), n && C.fontBgColor && (C.fontBgColor = n, e.children.forEach((R) => {
4680
- R.tagName === "GROUP" && R.setAttribute("bgcolor", n);
4679
+ })), n && C.fontBgColor && (C.fontBgColor = n, e.children.forEach((N) => {
4680
+ N.tagName === "GROUP" && N.setAttribute("bgcolor", n);
4681
4681
  })), 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) {
4682
- const R = P == null ? void 0 : P.get(e.name);
4683
- if (R) {
4684
- const { fontSize: D, boxSize: B } = R;
4682
+ const N = I == null ? void 0 : I.get(e.name);
4683
+ if (N) {
4684
+ const { fontSize: D, boxSize: B } = N;
4685
4685
  C.boxSize = B || C.boxSize, C.fontSize = D || C.fontSize;
4686
4686
  }
4687
- const W = [C.boxPoint[0], C.boxPoint[1]];
4688
- Vt(C.boxPoint, h, p, c);
4689
- const N = [v.op[0], v.op[1]], M = [N[0] - W[0], N[1] - W[1]];
4687
+ const R = [C.boxPoint[0], C.boxPoint[1]];
4688
+ Ht(C.boxPoint, h, p, c);
4689
+ const P = [v.op[0], v.op[1]], M = [P[0] - R[0], P[1] - R[1]];
4690
4690
  if (v.centerPos = [
4691
4691
  v.centerPos[0] + M[0],
4692
4692
  v.centerPos[1] + M[1]
@@ -4704,11 +4704,11 @@ const ft = class ft extends b {
4704
4704
  v.centerPos[0] + c[0],
4705
4705
  v.centerPos[1] + c[1]
4706
4706
  ], v.opt.eraserlines))
4707
- for (const R of v.opt.eraserlines) {
4708
- const { op: W } = R;
4709
- for (let N = 0; N < W.length; N++) {
4710
- const M = W[N].map((D, B) => B % 2 ? D + c[1] : D + c[0]);
4711
- R.op[N] = M;
4707
+ for (const N of v.opt.eraserlines) {
4708
+ const { op: R } = N;
4709
+ for (let P = 0; P < R.length; P++) {
4710
+ const M = R[P].map((D, B) => B % 2 ? D + c[1] : D + c[0]);
4711
+ N.op[P] = M;
4712
4712
  }
4713
4713
  }
4714
4714
  return v && o.setInfo(e.name, v), v == null ? void 0 : v.rect;
@@ -4740,7 +4740,7 @@ const ft = class ft extends b {
4740
4740
  // 4k
4741
4741
  y(ft, "textImageSnippetSize", 1024 * 4), y(ft, "SafeBorderPadding", 30);
4742
4742
  let Xt = ft;
4743
- const Pt = class Pt extends b {
4743
+ const It = class It extends b {
4744
4744
  constructor(t) {
4745
4745
  super(t);
4746
4746
  y(this, "canRotate", !1);
@@ -4761,7 +4761,7 @@ const Pt = class Pt extends b {
4761
4761
  return {
4762
4762
  type: w.None
4763
4763
  };
4764
- const { thickness: s } = this.workOptions, { width: o, height: r } = Pt.eraserSizes[s], n = Math.round(Math.max(o, r) / this.worldScaling[0]), { rect: a, willNewNodes: c, willDeleteNodes: l } = this.getChangeNodes(
4764
+ const { thickness: s } = this.workOptions, { width: o, height: r } = It.eraserSizes[s], n = Math.round(Math.max(o, r) / this.worldScaling[0]), { rect: a, willNewNodes: c, willDeleteNodes: l } = this.getChangeNodes(
4765
4765
  n,
4766
4766
  e
4767
4767
  );
@@ -4787,8 +4787,8 @@ const Pt = class Pt extends b {
4787
4787
  this.tmpPoints.push(a);
4788
4788
  continue;
4789
4789
  }
4790
- const c = n - 1, l = this.tmpPoints[c], h = I.Sub(a, l).uni();
4791
- a.isNear(l, e / 2) || (I.Equals(h, l.v, 0.02) && (this.tmpPoints.pop(), s--), a.setv(h), a.setT(o), this.tmpPoints.push(a));
4790
+ const c = n - 1, l = this.tmpPoints[c], h = W.Sub(a, l).uni();
4791
+ a.isNear(l, e / 2) || (W.Equals(h, l.v, 0.02) && (this.tmpPoints.pop(), s--), a.setv(h), a.setT(o), this.tmpPoints.push(a));
4792
4792
  }
4793
4793
  return Math.max(s, 0);
4794
4794
  }
@@ -4824,10 +4824,10 @@ const Pt = class Pt extends b {
4824
4824
  ie.polyline(g, u, f);
4825
4825
  if (f.length && p.opt)
4826
4826
  for (const g of f) {
4827
- const P = [];
4827
+ const I = [];
4828
4828
  for (let S = 0; S < g.length; S++)
4829
- S !== 0 && lt(g[S], g[S - 1]) || P.push(...g[S]);
4830
- m.push(P);
4829
+ S !== 0 && lt(g[S], g[S - 1]) || I.push(...g[S]);
4830
+ m.push(I);
4831
4831
  }
4832
4832
  if (m.length && e) {
4833
4833
  const g = e.createWorkShapeNode({
@@ -4836,28 +4836,28 @@ const Pt = class Pt extends b {
4836
4836
  toolsOpt: p.opt
4837
4837
  });
4838
4838
  g.setWorkId(h);
4839
- const P = g == null ? void 0 : g.computPencilPoints({
4839
+ const I = g == null ? void 0 : g.computPencilPoints({
4840
4840
  op: p.op,
4841
4841
  eraserPolylines: m,
4842
4842
  eraserThickness: t
4843
4843
  });
4844
- if (r = E(r, p.rect), o.add(h), e.removeNode(h), P.length)
4845
- for (let S = 0; S < P.length; S++) {
4846
- const v = `${h}_${Date.now()}_${S}`, L = v, R = e.setFullWork({
4844
+ if (r = E(r, p.rect), o.add(h), e.removeNode(h), I.length)
4845
+ for (let S = 0; S < I.length; S++) {
4846
+ const v = `${h}_${Date.now()}_${S}`, L = v, N = e.setFullWork({
4847
4847
  workId: L,
4848
4848
  opt: p.opt,
4849
4849
  toolsType: k.Pencil
4850
4850
  }).consumeService({
4851
- op: P[S],
4851
+ op: I[S],
4852
4852
  isFullWork: !0,
4853
4853
  replaceId: L
4854
4854
  });
4855
- e.clearWorkShapeNodeCache(L), r = E(r, R), s.set(v, {
4855
+ e.clearWorkShapeNodeCache(L), r = E(r, N), s.set(v, {
4856
4856
  ...p,
4857
4857
  toolsType: k.Pencil,
4858
- rect: R ?? p.rect,
4858
+ rect: N ?? p.rect,
4859
4859
  name: v,
4860
- op: P[S]
4860
+ op: I[S]
4861
4861
  });
4862
4862
  }
4863
4863
  }
@@ -4871,7 +4871,7 @@ const Pt = class Pt extends b {
4871
4871
  type: w.None,
4872
4872
  ...this.baseConsumeResult
4873
4873
  };
4874
- const { thickness: o } = this.workOptions, { width: r, height: n } = Pt.eraserSizes[o], a = Math.max(r, n) / this.worldScaling[0];
4874
+ const { thickness: o } = this.workOptions, { width: r, height: n } = It.eraserSizes[o], a = Math.max(r, n) / this.worldScaling[0];
4875
4875
  return this.updateTempPoints(s, a), {
4876
4876
  type: w.None,
4877
4877
  ...this.baseConsumeResult
@@ -4897,7 +4897,7 @@ const Pt = class Pt extends b {
4897
4897
  type: w.None,
4898
4898
  ...this.baseConsumeResult
4899
4899
  };
4900
- const { thickness: s } = this.workOptions, { width: o, height: r } = Pt.eraserSizes[s], n = Math.max(o, r) / this.worldScaling[0], { willDeleteNodes: a, willNewNodes: c, rect: l } = this.getChangeNodes(
4900
+ const { thickness: s } = this.workOptions, { width: o, height: r } = It.eraserSizes[s], n = Math.max(o, r) / this.worldScaling[0], { willDeleteNodes: a, willNewNodes: c, rect: l } = this.getChangeNodes(
4901
4901
  n,
4902
4902
  e
4903
4903
  );
@@ -4927,9 +4927,9 @@ const Pt = class Pt extends b {
4927
4927
  }
4928
4928
  };
4929
4929
  // 来源于white-sdk
4930
- y(Pt, "eraserSizes", re);
4931
- let Yt = Pt;
4932
- const It = class It extends b {
4930
+ y(It, "eraserSizes", re);
4931
+ let Yt = It;
4932
+ const Pt = class Pt extends b {
4933
4933
  constructor(t) {
4934
4934
  super(t);
4935
4935
  y(this, "canRotate", !1);
@@ -4951,7 +4951,7 @@ const It = class It extends b {
4951
4951
  return {
4952
4952
  type: w.None
4953
4953
  };
4954
- const { thickness: s } = this.workOptions, { width: o, height: r } = It.eraserSizes[s], n = Math.round(Math.max(o, r) / this.worldScaling[0]), { willDeleteNodes: a, rect: c } = this.getChangeNodes(n, e);
4954
+ const { thickness: s } = this.workOptions, { width: o, height: r } = Pt.eraserSizes[s], n = Math.round(Math.max(o, r) / this.worldScaling[0]), { willDeleteNodes: a, rect: c } = this.getChangeNodes(n, e);
4955
4955
  return {
4956
4956
  ...this.baseConsumeResult,
4957
4957
  type: w.DrawWork,
@@ -4973,8 +4973,8 @@ const It = class It extends b {
4973
4973
  this.tmpPoints.push(a);
4974
4974
  continue;
4975
4975
  }
4976
- const c = n - 1, l = this.tmpPoints[c], h = I.Sub(a, l).uni();
4977
- a.isNear(l, e / 2) || (I.Equals(h, l.v, 0.02) && (this.tmpPoints.pop(), s--), a.setv(h), a.setT(o), this.tmpPoints.push(a));
4976
+ const c = n - 1, l = this.tmpPoints[c], h = W.Sub(a, l).uni();
4977
+ a.isNear(l, e / 2) || (W.Equals(h, l.v, 0.02) && (this.tmpPoints.pop(), s--), a.setv(h), a.setT(o), this.tmpPoints.push(a));
4978
4978
  }
4979
4979
  return Math.max(s, 0);
4980
4980
  }
@@ -5012,10 +5012,10 @@ const It = class It extends b {
5012
5012
  for (const S of f) {
5013
5013
  const v = [];
5014
5014
  for (let L = 0; L < S.length && !(isNaN(S[L][0]) || isNaN(S[L][1])); L++) {
5015
- const C = S[L].map((R) => Math.round(R * 100) / 100);
5015
+ const C = S[L].map((N) => Math.round(N * 100) / 100);
5016
5016
  if (L !== 0) {
5017
- const R = S[L - 1].map((W) => Math.round(W * 100) / 100);
5018
- if (lt(C, R))
5017
+ const N = S[L - 1].map((R) => Math.round(R * 100) / 100);
5018
+ if (lt(C, N))
5019
5019
  continue;
5020
5020
  }
5021
5021
  v.push(...C);
@@ -5024,8 +5024,8 @@ const It = class It extends b {
5024
5024
  }
5025
5025
  if (!m.length)
5026
5026
  continue;
5027
- const g = p.opt.eraserlines ? p.opt.eraserlines : [], P = g.find((S) => S.workId === this.workId);
5028
- if (P ? P.op = m : g.push({ workId: this.workId, op: m, thickness: t }), p.opt.eraserlines = g, e) {
5027
+ const g = p.opt.eraserlines ? p.opt.eraserlines : [], I = g.find((S) => S.workId === this.workId);
5028
+ if (I ? I.op = m : g.push({ workId: this.workId, op: m, thickness: t }), p.opt.eraserlines = g, e) {
5029
5029
  const { toolsType: S } = p, v = e.createWorkShapeNode({
5030
5030
  workId: h,
5031
5031
  toolsType: S,
@@ -5053,7 +5053,7 @@ const It = class It extends b {
5053
5053
  type: w.None,
5054
5054
  ...this.baseConsumeResult
5055
5055
  };
5056
- const { thickness: o } = this.workOptions, { width: r, height: n } = It.eraserSizes[o], a = Math.round(Math.max(r, n) / this.worldScaling[0]);
5056
+ const { thickness: o } = this.workOptions, { width: r, height: n } = Pt.eraserSizes[o], a = Math.round(Math.max(r, n) / this.worldScaling[0]);
5057
5057
  return this.updateTempPoints(s, a), {
5058
5058
  type: w.None,
5059
5059
  ...this.baseConsumeResult
@@ -5079,7 +5079,7 @@ const It = class It extends b {
5079
5079
  type: w.None,
5080
5080
  ...this.baseConsumeResult
5081
5081
  };
5082
- const { thickness: s } = this.workOptions, { width: o, height: r } = It.eraserSizes[s], n = Math.round(Math.max(o, r) / this.worldScaling[0]), { willDeleteNodes: a, willUpdateNodes: c, rect: l } = this.getChangeNodes(
5082
+ const { thickness: s } = this.workOptions, { width: o, height: r } = Pt.eraserSizes[s], n = Math.round(Math.max(o, r) / this.worldScaling[0]), { willDeleteNodes: a, willUpdateNodes: c, rect: l } = this.getChangeNodes(
5083
5083
  n,
5084
5084
  e
5085
5085
  );
@@ -5109,8 +5109,8 @@ const It = class It extends b {
5109
5109
  }
5110
5110
  };
5111
5111
  // 来源于white-sdk
5112
- y(It, "eraserSizes", re);
5113
- let $t = It;
5112
+ y(Pt, "eraserSizes", re);
5113
+ let $t = Pt;
5114
5114
  class xt extends b {
5115
5115
  constructor(t) {
5116
5116
  super(t);
@@ -5190,16 +5190,16 @@ class xt extends b {
5190
5190
  e.setAttribute("zIndex", m), u.opt.zIndex = d;
5191
5191
  }
5192
5192
  if (kt(p) && (u.opt.locked = p), a && c && l && n) {
5193
- const { centerX: m, centerY: g, width: P, height: S, uniformScale: v } = u.opt, L = v !== !1 ? [l[0], l[0]] : l, C = [m, g], R = [m, g];
5194
- Vt(R, c, L, n);
5195
- const W = [
5196
- R[0] - C[0],
5197
- R[1] - C[1]
5193
+ 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];
5194
+ Ht(N, c, L, n);
5195
+ const R = [
5196
+ N[0] - C[0],
5197
+ N[1] - C[1]
5198
5198
  ];
5199
5199
  u.centerPos = [
5200
- u.centerPos[0] + W[0],
5201
- u.centerPos[1] + W[1]
5202
- ], u.opt.width = Math.round(P * L[0]), u.opt.height = Math.round(S * L[1]), u.opt.centerX = R[0], u.opt.centerY = R[1];
5200
+ u.centerPos[0] + R[0],
5201
+ u.centerPos[1] + R[1]
5202
+ ], 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];
5203
5203
  } else if (n)
5204
5204
  u.opt.centerX = u.opt.centerX + n[0], u.opt.centerY = u.opt.centerY + n[1], u.centerPos = [
5205
5205
  u.centerPos[0] + n[0],
@@ -5636,8 +5636,8 @@ class Ks {
5636
5636
  timer: void 0
5637
5637
  };
5638
5638
  g.timer && clearTimeout(g.timer), g.resolve = m, g.timer = setTimeout(() => {
5639
- const P = this.imageResolveMap.get(p);
5640
- P != null && P.resolve && P.resolve(p);
5639
+ const I = this.imageResolveMap.get(p);
5640
+ I != null && I.resolve && I.resolve(p);
5641
5641
  }, 5e3), this.imageResolveMap.set(p, g), this._post({
5642
5642
  sp: [
5643
5643
  {
@@ -5727,7 +5727,7 @@ class Ks {
5727
5727
  }
5728
5728
  destroy() {
5729
5729
  var i;
5730
- 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();
5730
+ 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();
5731
5731
  }
5732
5732
  async post(i) {
5733
5733
  this.combinePostMsg.add(i), await this.runBatchPostData();
@@ -6025,7 +6025,7 @@ class Qs extends Ye {
6025
6025
  y: r.y - b.SafeBorderPadding,
6026
6026
  w: r.width + b.SafeBorderPadding * 2,
6027
6027
  h: r.height + b.SafeBorderPadding * 2
6028
- }), o.remove(), V(o, this.fullLayer.parent);
6028
+ }), o.remove(), q(o, this.fullLayer.parent);
6029
6029
  }), s && this.clearWorkShapeNodeCache(t)), s;
6030
6030
  }
6031
6031
  async drawPencil(t, e) {
@@ -6853,16 +6853,16 @@ class Dt extends b {
6853
6853
  const m = e.parent;
6854
6854
  if (m) {
6855
6855
  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) {
6856
- const { centerX: g, centerY: P, width: S, height: v, uniformScale: L } = f.opt, C = L !== !1 ? [l[0], l[0]] : l, R = [g, P], W = [g, P];
6857
- Vt(W, c, C, n);
6858
- const N = [
6859
- W[0] - R[0],
6860
- W[1] - R[1]
6856
+ 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];
6857
+ Ht(R, c, C, n);
6858
+ const P = [
6859
+ R[0] - N[0],
6860
+ R[1] - N[1]
6861
6861
  ];
6862
6862
  if (f.centerPos = [
6863
- f.centerPos[0] + N[0],
6864
- f.centerPos[1] + N[1]
6865
- ], f.opt.width = Math.round(S * C[0]), f.opt.height = Math.round(v * C[1]), f.opt.centerX = W[0], f.opt.centerY = W[1], f.opt.eraserlines)
6863
+ f.centerPos[0] + P[0],
6864
+ f.centerPos[1] + P[1]
6865
+ ], 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)
6866
6866
  for (const M of f.opt.eraserlines) {
6867
6867
  const { op: D, thickness: B } = M;
6868
6868
  M.thickness = Math.round(B * Math.max(l[0], l[1]));
@@ -6875,9 +6875,9 @@ class Dt extends b {
6875
6875
  f.centerPos[1] + n[1]
6876
6876
  ], f.opt.eraserlines)
6877
6877
  for (const g of f.opt.eraserlines) {
6878
- const { op: P } = g;
6879
- for (let S = 0; S < P.length; S++) {
6880
- const v = P[S].map((L, C) => C % 2 ? L + n[1] : L + n[0]);
6878
+ const { op: I } = g;
6879
+ for (let S = 0; S < I.length; S++) {
6880
+ const v = I[S].map((L, C) => C % 2 ? L + n[1] : L + n[0]);
6881
6881
  g.op[S] = v;
6882
6882
  }
6883
6883
  }
@@ -6902,24 +6902,24 @@ const so = (T) => {
6902
6902
  return !0;
6903
6903
  }
6904
6904
  return !1;
6905
- }, V = (T, i) => {
6905
+ }, q = (T, i) => {
6906
6906
  if (T.mesh && T.mesh.texture && T.name === "eraserTexture") {
6907
6907
  const t = T.mesh.texture.image;
6908
6908
  i.deleteTexture(t);
6909
6909
  } else if (T.tagName === "GROUP" && T && T.children)
6910
6910
  for (const t of T.children)
6911
- V(t, i);
6911
+ q(t, i);
6912
6912
  }, Q = (T, i) => {
6913
- V(T, i), T.removeAllChildren();
6913
+ q(T, i), T.removeAllChildren();
6914
6914
  }, oo = (T, i, t) => {
6915
6915
  const e = t.parent;
6916
6916
  if (i) {
6917
6917
  const s = i.children;
6918
6918
  if (s) {
6919
6919
  for (const o of s)
6920
- if (V(o, e), o.tagName === "GROUP")
6920
+ if (q(o, e), o.tagName === "GROUP")
6921
6921
  for (const r of o.children)
6922
- V(r, e);
6922
+ q(r, e);
6923
6923
  }
6924
6924
  }
6925
6925
  i.parent.replaceChild(T, i);
@@ -7211,9 +7211,9 @@ class no {
7211
7211
  a != null && a.selectIds && (l = ys(t.selectIds, a.selectIds), a.selectIds.forEach((u) => {
7212
7212
  const f = this.vNodes.get(u);
7213
7213
  if (f) {
7214
- const { toolsType: m, op: g, opt: P } = f;
7214
+ const { toolsType: m, op: g, opt: I } = f;
7215
7215
  c.set(u, {
7216
- opt: P,
7216
+ opt: I,
7217
7217
  toolsType: m,
7218
7218
  ops: (g == null ? void 0 : g.length) && tt(g) || void 0
7219
7219
  });
@@ -7404,9 +7404,9 @@ class no {
7404
7404
  }
7405
7405
  ]
7406
7406
  }), (s = this.thread.fullLayer) == null || s.getElementsByName(i).forEach((o) => {
7407
- o.remove(), V(o, this.thread.fullLayer.parent);
7407
+ o.remove(), q(o, this.thread.fullLayer.parent);
7408
7408
  }), this.vNodes.delete(i)), this.workShapes.has(i) && (this.thread.localLayer.getElementsByName(i).forEach((o) => {
7409
- o.remove(), V(o, this.thread.localLayer.parent);
7409
+ o.remove(), q(o, this.thread.localLayer.parent);
7410
7410
  }), this.clearWorkShapeNodeCache(i));
7411
7411
  }
7412
7412
  setFullWork(i) {
@@ -7426,7 +7426,10 @@ class no {
7426
7426
  const t = this.setFullWork(i), e = i.ops && yt(i.ops);
7427
7427
  if (t) {
7428
7428
  const o = (s = i.workId) == null ? void 0 : s.toString();
7429
- t.toolsType === k.Image ? await t.consumeServiceAsync({
7429
+ t.toolsType === k.BackgroundSVG ? t.consumeService({
7430
+ isFullWork: !0,
7431
+ replaceId: o
7432
+ }) : t.toolsType === k.Image ? await t.consumeServiceAsync({
7430
7433
  isFullWork: !0,
7431
7434
  replaceId: o,
7432
7435
  worker: this
@@ -7479,7 +7482,12 @@ class no {
7479
7482
  const s = this.setFullWork(e);
7480
7483
  if (s) {
7481
7484
  const o = (t = e.workId) == null ? void 0 : t.toString();
7482
- if (s.toolsType === k.Image)
7485
+ if (s.toolsType === k.BackgroundSVG)
7486
+ s.consumeService({
7487
+ isFullWork: !0,
7488
+ replaceId: o
7489
+ });
7490
+ else if (s.toolsType === k.Image)
7483
7491
  await s.consumeServiceAsync({
7484
7492
  isFullWork: !0,
7485
7493
  replaceId: o,
@@ -7982,31 +7990,41 @@ class ao {
7982
7990
  );
7983
7991
  }
7984
7992
  async animationDraw() {
7985
- var e, s, o, r, n, a, c, l, h, p, d, u, f, m, g, P, S, v, L, C;
7993
+ var e, s, o, r, n, a, c, l, h, p, d, u, f, m, g, I, S, v, L, C, N;
7986
7994
  this.animationId = void 0;
7987
7995
  let i = !1;
7988
7996
  const t = /* @__PURE__ */ new Map();
7989
- for (const [R, W] of this.workShapes.entries())
7990
- switch (W.toolsType) {
7997
+ for (const [R, P] of this.workShapes.entries())
7998
+ switch (P.toolsType) {
7999
+ case k.BackgroundSVG: {
8000
+ (e = P.node) == null || e.consumeService({
8001
+ isFullWork: !0,
8002
+ replaceId: R
8003
+ }), this.selectorWorkShapes.forEach((M, D) => {
8004
+ var B;
8005
+ (B = M.selectIds) != null && B.includes(R) && (this.willRunEffectSelectorIds.add(D), this.runEffect());
8006
+ }), this.workShapes.delete(R);
8007
+ break;
8008
+ }
7991
8009
  case k.Image: {
7992
- await ((e = W.node) == null ? void 0 : e.consumeServiceAsync({
8010
+ await ((s = P.node) == null ? void 0 : s.consumeServiceAsync({
7993
8011
  isFullWork: !0,
7994
8012
  worker: this
7995
- })), this.selectorWorkShapes.forEach((N, M) => {
7996
- var D;
7997
- (D = N.selectIds) != null && D.includes(R) && (this.willRunEffectSelectorIds.add(M), this.runEffect());
8013
+ })), this.selectorWorkShapes.forEach((M, D) => {
8014
+ var B;
8015
+ (B = M.selectIds) != null && B.includes(R) && (this.willRunEffectSelectorIds.add(D), this.runEffect());
7998
8016
  }), this.workShapes.delete(R);
7999
8017
  break;
8000
8018
  }
8001
8019
  case k.Text: {
8002
- W.node && (await ((s = W.node) == null ? void 0 : s.consumeServiceAsync({
8020
+ P.node && (await ((o = P.node) == null ? void 0 : o.consumeServiceAsync({
8003
8021
  isFullWork: !0,
8004
8022
  replaceId: R,
8005
8023
  boxRect: this.thread.getSceneRect()
8006
- })), this.selectorWorkShapes.forEach((N, M) => {
8007
- var D;
8008
- (D = N.selectIds) != null && D.includes(R) && (this.willRunEffectSelectorIds.add(M), this.runEffect());
8009
- }), (o = W.node) == null || o.clearTmpPoints(), this.workShapes.delete(R));
8024
+ })), this.selectorWorkShapes.forEach((M, D) => {
8025
+ var B;
8026
+ (B = M.selectIds) != null && B.includes(R) && (this.willRunEffectSelectorIds.add(D), this.runEffect());
8027
+ }), (r = P.node) == null || r.clearTmpPoints(), this.workShapes.delete(R));
8010
8028
  break;
8011
8029
  }
8012
8030
  case k.Arrow:
@@ -8016,81 +8034,81 @@ class ao {
8016
8034
  case k.Star:
8017
8035
  case k.Polygon:
8018
8036
  case k.SpeechBalloon: {
8019
- const N = !!W.ops;
8020
- if ((r = W.animationWorkData) != null && r.length) {
8021
- const M = W.oldRect;
8022
- (n = W.node) == null || n.consumeService({
8023
- op: W.animationWorkData,
8024
- isFullWork: N
8025
- }), N && (this.selectorWorkShapes.forEach((D, B) => {
8026
- var F;
8027
- (F = D.selectIds) != null && F.includes(R) && (this.willRunEffectSelectorIds.add(B), this.runEffect());
8028
- }), (a = W.node) == null || a.clearTmpPoints(), this.workShapes.delete(R)), W.isEnableCursor ? t.set(R, {
8029
- workState: M ? W.ops ? A.Done : A.Doing : A.Start,
8030
- op: W.animationWorkData.slice(-3, -1)
8031
- }) : N && !W.useAnimation && ((c = W.updateNodeOpt) != null && c.useAnimation) && t.set(R, {
8037
+ const M = !!P.ops;
8038
+ if ((n = P.animationWorkData) != null && n.length) {
8039
+ const D = P.oldRect;
8040
+ (a = P.node) == null || a.consumeService({
8041
+ op: P.animationWorkData,
8042
+ isFullWork: M
8043
+ }), M && (this.selectorWorkShapes.forEach((B, F) => {
8044
+ var z;
8045
+ (z = B.selectIds) != null && z.includes(R) && (this.willRunEffectSelectorIds.add(F), this.runEffect());
8046
+ }), (c = P.node) == null || c.clearTmpPoints(), this.workShapes.delete(R)), P.isEnableCursor ? t.set(R, {
8047
+ workState: D ? P.ops ? A.Done : A.Doing : A.Start,
8048
+ op: P.animationWorkData.slice(-3, -1)
8049
+ }) : M && !P.useAnimation && ((l = P.updateNodeOpt) != null && l.useAnimation) && t.set(R, {
8032
8050
  workState: A.Done,
8033
- op: W.animationWorkData.slice(-3, -1),
8034
- uid: (l = W.updateNodeOpt) == null ? void 0 : l.uid
8035
- }), W.animationWorkData.length = 0;
8051
+ op: P.animationWorkData.slice(-3, -1),
8052
+ uid: (h = P.updateNodeOpt) == null ? void 0 : h.uid
8053
+ }), P.animationWorkData.length = 0;
8036
8054
  }
8037
8055
  break;
8038
8056
  }
8039
8057
  case k.Pencil: {
8040
- if (W.useAnimation) {
8041
- if (W.useAnimation) {
8042
- if (W.isDel) {
8043
- (g = W.node) == null || g.clearTmpPoints(), this.workShapes.delete(R);
8058
+ if (P.useAnimation) {
8059
+ if (P.useAnimation) {
8060
+ if (P.isDel) {
8061
+ (I = P.node) == null || I.clearTmpPoints(), this.workShapes.delete(R);
8044
8062
  break;
8045
8063
  }
8046
- const N = 3, M = this.computNextAnimationIndex(
8047
- W,
8048
- N
8049
- ), D = W.isDiff ? 0 : Math.max(0, (W.animationIndex || 0) - N), B = (W.animationWorkData || []).slice(
8050
- D,
8064
+ const M = 3, D = this.computNextAnimationIndex(
8065
+ P,
8051
8066
  M
8052
- ), F = (S = (P = W.node) == null ? void 0 : P.getWorkId()) == null ? void 0 : S.toString();
8053
- if ((W.animationIndex || 0) < M || W.isDiff) {
8054
- if ((v = W.node) == null || v.consumeService({
8055
- op: B,
8067
+ ), B = P.isDiff ? 0 : Math.max(0, (P.animationIndex || 0) - M), F = (P.animationWorkData || []).slice(
8068
+ B,
8069
+ D
8070
+ ), z = (v = (S = P.node) == null ? void 0 : S.getWorkId()) == null ? void 0 : v.toString();
8071
+ if ((P.animationIndex || 0) < D || P.isDiff) {
8072
+ if ((L = P.node) == null || L.consumeService({
8073
+ op: F,
8056
8074
  isFullWork: !1
8057
- }), W.animationIndex = M, W.isDiff && (W.isDiff = !1), B.length && W.isEnableCursor) {
8058
- const z = B.slice(-3, -1);
8075
+ }), P.animationIndex = D, P.isDiff && (P.isDiff = !1), F.length && P.isEnableCursor) {
8076
+ const V = F.slice(-3, -1);
8059
8077
  t.set(R, {
8060
- workState: D === 0 ? A.Start : M === ((L = W.animationWorkData) == null ? void 0 : L.length) ? A.Done : A.Doing,
8061
- op: z
8078
+ workState: B === 0 ? A.Start : D === ((C = P.animationWorkData) == null ? void 0 : C.length) ? A.Done : A.Doing,
8079
+ op: V
8062
8080
  });
8063
8081
  }
8064
- } else W.ops && ((C = W.node) == null || C.consumeService({
8065
- op: W.animationWorkData || [],
8082
+ } else P.ops && ((N = P.node) == null || N.consumeService({
8083
+ op: P.animationWorkData || [],
8066
8084
  isFullWork: !0,
8067
- replaceId: F
8068
- }), W.isDel = !0, W.isEnableCursor && t.set(R, {
8085
+ replaceId: z
8086
+ }), P.isDel = !0, P.isEnableCursor && t.set(R, {
8069
8087
  workState: A.Done,
8070
- op: B.slice(-3, -1)
8088
+ op: F.slice(-3, -1)
8071
8089
  }));
8072
8090
  i = !0;
8073
8091
  break;
8074
8092
  }
8075
8093
  } else {
8076
- const N = !!W.ops;
8077
- if ((h = W.node) == null || h.consumeService({
8078
- op: W.animationWorkData || [],
8079
- isFullWork: N,
8094
+ const M = !!P.ops;
8095
+ if ((p = P.node) == null || p.consumeService({
8096
+ op: P.animationWorkData || [],
8097
+ isFullWork: M,
8080
8098
  replaceId: R
8081
- }), (p = W.node) == null || p.updataOptService(W.updateNodeOpt), N) {
8082
- if (!W.isEnableCursor && ((d = W.updateNodeOpt) != null && d.useAnimation) && ((u = W.animationWorkData) != null && u.length)) {
8083
- const M = W.animationWorkData.slice(-3, -1);
8099
+ }), (d = P.node) == null || d.updataOptService(P.updateNodeOpt), M) {
8100
+ if (!P.isEnableCursor && ((u = P.updateNodeOpt) != null && u.useAnimation) && ((f = P.animationWorkData) != null && f.length)) {
8101
+ const D = P.animationWorkData.slice(-3, -1);
8084
8102
  t.set(R, {
8085
8103
  workState: A.Done,
8086
- op: M,
8087
- uid: (f = W.updateNodeOpt) == null ? void 0 : f.uid
8104
+ op: D,
8105
+ uid: (m = P.updateNodeOpt) == null ? void 0 : m.uid
8088
8106
  });
8089
8107
  }
8090
- this.selectorWorkShapes.forEach((M, D) => {
8091
- var B;
8092
- (B = M.selectIds) != null && B.includes(R) && (this.willRunEffectSelectorIds.add(D), this.runEffect());
8093
- }), (m = W.node) == null || m.clearTmpPoints(), this.workShapes.delete(R);
8108
+ this.selectorWorkShapes.forEach((D, B) => {
8109
+ var F;
8110
+ (F = D.selectIds) != null && F.includes(R) && (this.willRunEffectSelectorIds.add(B), this.runEffect());
8111
+ }), (g = P.node) == null || g.clearTmpPoints(), this.workShapes.delete(R);
8094
8112
  }
8095
8113
  }
8096
8114
  break;
@@ -8098,12 +8116,12 @@ class ao {
8098
8116
  }
8099
8117
  if (i && this.runAnimation(), t.size) {
8100
8118
  const R = [];
8101
- t.forEach((W, N) => {
8119
+ t.forEach((P, M) => {
8102
8120
  R.push({
8103
8121
  type: w.Cursor,
8104
- uid: W.uid || N.split(Wt)[0],
8105
- op: W.op,
8106
- workState: W.workState,
8122
+ uid: P.uid || M.split(Wt)[0],
8123
+ op: P.op,
8124
+ workState: P.workState,
8107
8125
  viewId: this.thread.viewId
8108
8126
  });
8109
8127
  }), this.thread.post({ sp: R });
@@ -8133,7 +8151,7 @@ class ao {
8133
8151
  return !1;
8134
8152
  }
8135
8153
  activeWorkShape(i) {
8136
- var f, m, g, P;
8154
+ var f, m, g, I;
8137
8155
  const {
8138
8156
  workId: t,
8139
8157
  opt: e,
@@ -8165,7 +8183,7 @@ class ao {
8165
8183
  };
8166
8184
  s && e && (S = this.setNodeKey(p, S, s, e)), (g = this.workShapes) == null || g.set(p, S);
8167
8185
  }
8168
- const u = (P = this.workShapes) == null ? void 0 : P.get(p);
8186
+ const u = (I = this.workShapes) == null ? void 0 : I.get(p);
8169
8187
  u.isEnableCursor = h, o && (u.type = o), n && (u.animationWorkData = yt(n), u.ops = n), r && (u.updateNodeOpt = r), a && (u.isDiff = this.hasDiffData(
8170
8188
  u.animationWorkData || [],
8171
8189
  a,
@@ -8174,9 +8192,9 @@ class ao {
8174
8192
  }
8175
8193
  removeNode(i, t) {
8176
8194
  i.indexOf(X) > -1 && this.removeSelectWork(t), this.thread.fullLayer.getElementsByName(i).forEach((s) => {
8177
- s.remove(), V(s, this.thread.fullLayer.parent);
8195
+ s.remove(), q(s, this.thread.fullLayer.parent);
8178
8196
  }), this.thread.serviceLayer.getElementsByName(i).forEach((s) => {
8179
- s.remove(), V(s, this.thread.serviceLayer.parent);
8197
+ s.remove(), q(s, this.thread.serviceLayer.parent);
8180
8198
  });
8181
8199
  const e = this.vNodes.get(i);
8182
8200
  e && e.toolsType === k.BackgroundSVG && this.thread.post({
@@ -8428,24 +8446,24 @@ class po extends rt {
8428
8446
  useAnimation: h.useAnimation || !1
8429
8447
  };
8430
8448
  h.uid && (g.uid = h.uid);
8431
- for (const [P, S] of o.entries())
8449
+ for (const [I, S] of o.entries())
8432
8450
  S.toolsType === k.BackgroundSVG && f.push({
8433
8451
  ...S,
8434
- workId: P,
8452
+ workId: I,
8435
8453
  type: w.BackgroundSVGUpdate,
8436
8454
  dataType: x.Local,
8437
8455
  willSyncService: u === A.Done ? !0 : a,
8438
8456
  updateNodeOpt: g
8439
8457
  }), p && S.toolsType === k.Text ? f.push({
8440
8458
  ...S,
8441
- workId: P,
8459
+ workId: I,
8442
8460
  type: w.TextUpdate,
8443
8461
  dataType: x.Local,
8444
8462
  willSyncService: u === A.Done ? !0 : a,
8445
8463
  updateNodeOpt: g
8446
8464
  }) : (a || u === A.Done) && f.push({
8447
8465
  ...S,
8448
- workId: P,
8466
+ workId: I,
8449
8467
  type: w.UpdateNode,
8450
8468
  updateNodeOpt: g,
8451
8469
  isSync: l
@@ -8596,10 +8614,10 @@ class fo extends rt {
8596
8614
  useAnimation: c.useAnimation || !1
8597
8615
  };
8598
8616
  if (c.uid && (g.uid = c.uid), a || u === A.Done)
8599
- for (const [P, S] of n.entries())
8617
+ for (const [I, S] of n.entries())
8600
8618
  f.push({
8601
8619
  ...S,
8602
- workId: P,
8620
+ workId: I,
8603
8621
  type: w.UpdateNode,
8604
8622
  updateNodeOpt: g,
8605
8623
  isSync: p
@@ -9301,9 +9319,9 @@ class So {
9301
9319
  if (h) {
9302
9320
  const p = l, d = h.rect, u = this.getSceneRect(), f = Rt(p, u), m = Rt(d, u);
9303
9321
  let g = !1;
9304
- if ((f !== m || p.w !== d.w || p.h !== d.h || m === Ht.intersect) && (g = !0), g) {
9305
- const { toolsType: P } = h;
9306
- P === k.Text && this.debounceUpdateCache.add(c);
9322
+ if ((f !== m || p.w !== d.w || p.h !== d.h || m === Vt.intersect) && (g = !0), g) {
9323
+ const { toolsType: I } = h;
9324
+ I === k.Text && this.debounceUpdateCache.add(c);
9307
9325
  }
9308
9326
  }
9309
9327
  }
@@ -9391,7 +9409,7 @@ class So {
9391
9409
  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]);
9392
9410
  }
9393
9411
  destroy() {
9394
- 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();
9412
+ 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();
9395
9413
  }
9396
9414
  }
9397
9415
  class To {
@@ -9739,7 +9757,7 @@ class To {
9739
9757
  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]);
9740
9758
  }
9741
9759
  destroy() {
9742
- this.clearCacheImages(), this.clearImageResolveMap(), this.fullLayer.remove(), V(this.fullLayer, this.fullLayer.parent), this.scene.remove();
9760
+ this.clearCacheImages(), this.clearImageResolveMap(), this.fullLayer.remove(), q(this.fullLayer, this.fullLayer.parent), this.scene.remove();
9743
9761
  }
9744
9762
  }
9745
9763
  class Oo {
@@ -9782,7 +9800,7 @@ class Oo {
9782
9800
  if (n === w.Init) {
9783
9801
  const m = (t = this.master.control.viewContainerManager.getView(a)) == null ? void 0 : t.displayer, g = m == null ? void 0 : m.canvasContainerRef.current;
9784
9802
  if (m && g && h && p) {
9785
- const P = this.createMainThread(a, {
9803
+ const I = this.createMainThread(a, {
9786
9804
  displayer: m,
9787
9805
  container: g,
9788
9806
  layerOpt: h,
@@ -9790,7 +9808,7 @@ class Oo {
9790
9808
  canvasOpt: p,
9791
9809
  post: this.post
9792
9810
  });
9793
- this.mainThreadMap.set(a, P), P && d && P.setCameraOpt(d);
9811
+ this.mainThreadMap.set(a, I), I && d && I.setCameraOpt(d);
9794
9812
  }
9795
9813
  continue;
9796
9814
  }
@@ -9798,7 +9816,7 @@ class Oo {
9798
9816
  const m = (s = this.master.control.viewContainerManager.getView(a)) == null ? void 0 : s.displayer, g = (o = m.snapshotContainerRef) == null ? void 0 : o.current;
9799
9817
  if (m && g && d) {
9800
9818
  g.style.width = `${d.width}px`, g.style.height = `${d.height}px`;
9801
- const P = {
9819
+ const I = {
9802
9820
  ...de.defaultLayerOpt,
9803
9821
  offscreen: !1,
9804
9822
  width: d.width,
@@ -9811,7 +9829,7 @@ class Oo {
9811
9829
  this.snapshotThread = this.createSnapshotThread(a, {
9812
9830
  displayer: m,
9813
9831
  container: g,
9814
- layerOpt: P,
9832
+ layerOpt: I,
9815
9833
  master: this.master,
9816
9834
  canvasOpt: S,
9817
9835
  post: this.post
@@ -9827,8 +9845,8 @@ class Oo {
9827
9845
  }
9828
9846
  if (n === w.TasksQueue && (c != null && c.size)) {
9829
9847
  for (const [m, g] of this.mainThreadMap.entries()) {
9830
- const P = c.get(m);
9831
- P && (await g.on(P), l && this.post({ workerTasksqueueCount: l }));
9848
+ const I = c.get(m);
9849
+ I && (await g.on(I), l && this.post({ workerTasksqueueCount: l }));
9832
9850
  }
9833
9851
  continue;
9834
9852
  }