@netless/appliance-plugin 1.1.43-beta.0 → 1.1.43-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/READMA.zh-CN.md +1 -1
  2. package/README.md +5 -1
  3. package/dist/appliance-plugin.js +1 -1
  4. package/dist/appliance-plugin.mjs +1 -1
  5. package/dist/{bridge-DcVN05tP.mjs → bridge-DzcPAEgn.mjs} +1 -1
  6. package/dist/{bridge-D68E09T9.js → bridge-iTPNL78o.js} +1 -1
  7. package/dist/bridge.js +1 -1
  8. package/dist/bridge.mjs +1 -1
  9. package/dist/core/enum.d.ts +3 -1
  10. package/dist/core/mainEngine.d.ts +8 -2
  11. package/dist/core/mainThread/subLocalThread.d.ts +6 -1
  12. package/dist/core/tools/pencilEraserBitMap.d.ts +6 -2
  13. package/dist/core/types.d.ts +2 -0
  14. package/dist/core/worker/fullWorkerLocal.d.ts +4 -1
  15. package/dist/fullWorker.js +89 -89
  16. package/dist/{index-BNHPCii1.mjs → index-14J65ewZ.mjs} +271 -241
  17. package/dist/index-B6nsfvHS.js +570 -0
  18. package/dist/index-B9E9m3wQ.js +1 -0
  19. package/dist/{index-B_vZ9d3x.mjs → index-BARnlEAY.mjs} +7772 -7621
  20. package/dist/{index-CWDWQZBs.mjs → index-BGKGGHj6.mjs} +271 -241
  21. package/dist/index-Bgw8Yl5s.js +570 -0
  22. package/dist/{index-DiLPVPwQ.js → index-Bp0tojzJ.js} +1 -1
  23. package/dist/{index-GZUDLXJC.js → index-C-LIZHUj.js} +1 -1
  24. package/dist/{index-K_0NX6pD.mjs → index-D2r_A0b8.mjs} +1 -1
  25. package/dist/index-DVTWLAHF.js +1 -0
  26. package/dist/{index-CV8YaU3F.mjs → index-DWS4kyH2.mjs} +1 -1
  27. package/dist/{index-NG5kKK1W.mjs → index-DkMJ7xR-.mjs} +9004 -8853
  28. package/dist/plugin/bitmapEraserOptions.d.ts +0 -2
  29. package/dist/plugin/types.d.ts +0 -4
  30. package/dist/subWorker.js +85 -85
  31. package/package.json +1 -1
  32. package/dist/index-C2AHqjj8.js +0 -570
  33. package/dist/index-DChI1--R.js +0 -1
  34. package/dist/index-DFo0Gmfx.js +0 -570
  35. package/dist/index-GBYM7kT5.js +0 -1
@@ -1,7 +1,7 @@
1
1
  var ye = Object.defineProperty;
2
2
  var we = (M, e, t) => e in M ? ye(M, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : M[e] = t;
3
3
  var u = (M, e, t) => we(M, typeof e != "symbol" ? e + "" : e, t);
4
- import { D as K, e as b, c as m, r as $, b as R, f as Z, t as V, a as h, h as de, M as ve, i as D, j, k as ke, C as H, l as z, m as Se, n as te, o as Ie, p as se, q as ge, s as Te, u as re, v as ie, w as Y, x as _, E as N, y as ee, z as Q, A as We, B as Re, F as Ee, G as be, H as Le, I as pe, J as ue, T as oe, K as ae, L as Ce, N as Ne, P as fe, Q as me, R as ne, U as Oe, S as ce, W as q, X as Be, V as he, Y as De } from "./index-B_vZ9d3x.mjs";
4
+ import { D as K, e as b, c as m, r as $, b as R, f as Z, t as V, a as h, h as de, M as ve, i as D, j, k as ke, C as H, l as z, m as Se, n as te, o as Ie, p as se, q as ge, s as Te, u as re, v as ie, w as Y, x as _, E as N, y as ee, z as Q, A as We, B as Re, F as Ee, G as be, H as Le, I as pe, J as ue, T as oe, K as ae, L as Ce, N as Ne, P as fe, Q as me, R as ne, U as Be, S as ce, W as q, X as Oe, V as he, Y as De } from "./index-BARnlEAY.mjs";
5
5
  import { cloneDeep as J, xor as Me, isNumber as G, isEqual as le } from "lodash";
6
6
  import "clipper-lib";
7
7
  import "lineclip";
@@ -296,9 +296,9 @@ class Ae {
296
296
  })), c = /* @__PURE__ */ new Map();
297
297
  let d;
298
298
  n != null && n.selectIds && (d = Me(t.selectIds, n.selectIds), n.selectIds.forEach((w) => {
299
- const k = this.vNodes.get(w);
300
- if (k) {
301
- const { toolsType: I, op: W, opt: g } = k;
299
+ const S = this.vNodes.get(w);
300
+ if (S) {
301
+ const { toolsType: I, op: W, opt: g } = S;
302
302
  c.set(w, {
303
303
  opt: g,
304
304
  toolsType: I,
@@ -694,57 +694,82 @@ class Ae {
694
694
  var t;
695
695
  (t = this.getWorkShape(e)) == null || t.clearTmpPoints(), this.workShapes.delete(e);
696
696
  }
697
+ /** Stop queued Bitmap Eraser work and restore Doing-time hidden nodes. */
698
+ abortBitmapEraser(e) {
699
+ const t = this.workShapes.get(e);
700
+ (t == null ? void 0 : t.toolsType) === m.BitMapEraser && (t.clearTmpPoints(), this.workShapes.delete(e), this.combineDrawActiveId === e && (this.combineDrawActiveId = void 0), this.drawWorkActiveId === e && (this.drawWorkActiveId = void 0), this.bitmapEraserRenderQueue = Promise.resolve());
701
+ }
702
+ publishBitmapEraserBeforeImages(e, t) {
703
+ t.size && this.thread.post({
704
+ sp: [
705
+ {
706
+ type: h.None,
707
+ viewId: this.thread.viewId,
708
+ eraseTxnId: e,
709
+ eraseTxnBeforeImages: new Map(t)
710
+ }
711
+ ]
712
+ });
713
+ }
697
714
  async drawBitMapEraserFull(e, t, s, r) {
698
- const { willUpdateNodes: i, willDeleteNodes: o, eraseTxnRecoveryRequired: a } = t, n = e.getWorkId(), c = [
699
- ...i ? Array.from(i.keys()).map((l) => String(l)) : [],
715
+ const {
716
+ willUpdateNodes: i,
717
+ willDeleteNodes: o,
718
+ eraseTxnRecoveryRequired: a,
719
+ eraseTxnBeforeImages: n
720
+ } = t, c = e.getWorkId(), d = [
721
+ ...i ? Array.from(i.keys()).map((p) => String(p)) : [],
700
722
  ...o ? Array.from(o) : []
701
- ], d = [];
702
- if (r && d.push({
723
+ ], l = [];
724
+ if (r && l.push({
703
725
  type: h.None,
704
726
  needUndoTicker: r,
705
- undoScopeIds: c,
727
+ undoScopeIds: d,
706
728
  undoScopePhase: "finalize",
707
- eraseTxnId: n,
708
- eraseTxnRecoveryRequired: a
709
- }), d.push({
729
+ eraseTxnId: c,
730
+ eraseTxnRecoveryRequired: a,
731
+ eraseTxnBeforeImages: n
732
+ }), l.push({
710
733
  type: h.RemoveNode,
711
- removeIds: [n],
712
- eraseTxnId: n,
734
+ removeIds: [c],
735
+ eraseTxnId: c,
713
736
  viewId: this.thread.viewId,
714
737
  needUndoTicker: r,
715
- eraseTxnRecoveryRequired: a
716
- }), s && d.push({
738
+ eraseTxnRecoveryRequired: a,
739
+ eraseTxnBeforeImages: n
740
+ }), s && l.push({
717
741
  type: h.None,
718
742
  isLockSentEventCursor: s
719
743
  }), i != null && i.size || o != null && o.size) {
720
744
  if (i != null && i.size)
721
- for (const [l, p] of i)
722
- d.push({
745
+ for (const [p, f] of i)
746
+ l.push({
723
747
  type: h.UpdateNode,
724
748
  dataType: R.Local,
725
- opt: p.opt,
726
- workId: l,
749
+ opt: f.opt,
750
+ workId: p,
727
751
  updateNodeOpt: {
728
752
  useAnimation: !1
729
753
  },
730
- eraseTxnId: n,
754
+ eraseTxnId: c,
731
755
  needUndoTicker: r
732
756
  });
733
- o != null && o.size && d.push({
757
+ o != null && o.size && l.push({
734
758
  type: h.RemoveNode,
735
759
  removeIds: [...o],
736
- eraseTxnId: n,
760
+ eraseTxnId: c,
737
761
  viewId: this.thread.viewId,
738
762
  needUndoTicker: r
739
763
  });
740
764
  }
741
- d.push({
765
+ l.push({
742
766
  type: h.None,
743
767
  viewId: this.thread.viewId,
744
- eraseTxnId: n,
768
+ eraseTxnId: c,
745
769
  eraseTxnPhase: t.eraseTxnCommitStatus === "failed" || a ? "failed" : "applied",
746
- eraseTxnRecoveryRequired: a
747
- }), d.length && this.thread.post({ sp: d });
770
+ eraseTxnRecoveryRequired: a,
771
+ eraseTxnBeforeImages: n
772
+ }), l.length && this.thread.post({ sp: l });
748
773
  }
749
774
  drawPencilEraserFull(e, t, s, r) {
750
775
  const { willNewNodes: i, willDeleteNodes: o } = t, a = e.getWorkId(), n = [
@@ -950,14 +975,14 @@ class Ae {
950
975
  if (i || r) {
951
976
  const p = i == null ? void 0 : i.willDeleteNodes, f = i == null ? void 0 : i.willNewNodes, w = [
952
977
  ...p ? Array.from(p) : []
953
- ], k = {
978
+ ], S = {
954
979
  render: [],
955
980
  sp: [],
956
981
  ...r
957
982
  };
958
983
  if (i != null && i.rect) {
959
984
  const I = Te(i.rect);
960
- (a = k.render) == null || a.push(
985
+ (a = S.render) == null || a.push(
961
986
  {
962
987
  rect: I,
963
988
  isClear: !0,
@@ -973,12 +998,12 @@ class Ae {
973
998
  }
974
999
  );
975
1000
  }
976
- if (s && w.length && ((n = this.getWorkShape(e)) == null ? void 0 : n.toolsType) === m.BitMapEraser && ((c = k.sp) == null || c.push({
1001
+ if (s && w.length && ((n = this.getWorkShape(e)) == null ? void 0 : n.toolsType) === m.BitMapEraser && ((c = S.sp) == null || c.push({
977
1002
  type: h.None,
978
1003
  collectUndoTicker: s,
979
1004
  undoScopeIds: w,
980
1005
  undoScopePhase: "collect"
981
- })), p != null && p.size && ((d = k.sp) == null || d.push({
1006
+ })), p != null && p.size && ((d = S.sp) == null || d.push({
982
1007
  type: h.RemoveNode,
983
1008
  removeIds: [...p],
984
1009
  viewId: this.thread.viewId,
@@ -986,7 +1011,7 @@ class Ae {
986
1011
  collectUndoTicker: s
987
1012
  })), f != null && f.size)
988
1013
  for (const [I, W] of f)
989
- (l = k.sp) == null || l.push({
1014
+ (l = S.sp) == null || l.push({
990
1015
  type: h.FullWork,
991
1016
  dataType: R.Local,
992
1017
  toolsType: W.toolsType,
@@ -999,7 +1024,7 @@ class Ae {
999
1024
  needUndoTicker: t,
1000
1025
  collectUndoTicker: s
1001
1026
  });
1002
- i != null && i.rect && await this.thread.fullLayer.parent.prepareRender, this.thread.post(k);
1027
+ i != null && i.rect && await this.thread.fullLayer.parent.prepareRender, this.thread.post(S);
1003
1028
  }
1004
1029
  }
1005
1030
  async consumeDrawAll(e, t) {
@@ -1017,23 +1042,23 @@ class Ae {
1017
1042
  if (p === m.LaserPen)
1018
1043
  return;
1019
1044
  p === m.BitMapEraser && await this.bitmapEraserRenderQueue;
1020
- const f = this.workShapes.get(H), w = (a = f == null ? void 0 : f.selectIds) == null ? void 0 : a[0], k = await l.consumeAll({ data: e, workerEngine: this });
1045
+ const f = this.workShapes.get(H), w = (a = f == null ? void 0 : f.selectIds) == null ? void 0 : a[0], S = await l.consumeAll({ data: e, workerEngine: this });
1021
1046
  switch (p) {
1022
1047
  case m.Selector:
1023
1048
  {
1024
- k.selectIds && w && ((n = k.selectIds) != null && n.includes(w)) && f.cursorBlur();
1049
+ S.selectIds && w && ((n = S.selectIds) != null && n.includes(w)) && f.cursorBlur();
1025
1050
  const I = [];
1026
1051
  i && I.push({
1027
1052
  type: h.None,
1028
1053
  isLockSentEventCursor: i,
1029
1054
  scenePath: r
1030
- }), k.type === h.Select && (k.selectIds && t.runReverseSelectWork(k.selectIds), I.push({ ...k, scenePath: r })), I.length && this.thread.post({ sp: I }), (c = l.selectIds) != null && c.length ? l.clearTmpPoints() : this.clearWorkShapeNodeCache(d);
1055
+ }), S.type === h.Select && (S.selectIds && t.runReverseSelectWork(S.selectIds), I.push({ ...S, scenePath: r })), I.length && this.thread.post({ sp: I }), (c = l.selectIds) != null && c.length ? l.clearTmpPoints() : this.clearWorkShapeNodeCache(d);
1031
1056
  }
1032
1057
  break;
1033
1058
  case m.PencilEraser:
1034
1059
  await this.drawPencilEraserFull(
1035
1060
  l,
1036
- k,
1061
+ S,
1037
1062
  i,
1038
1063
  o
1039
1064
  ), this.fullWorkerDrawCount = 0, this.clearWorkShapeNodeCache(d);
@@ -1041,14 +1066,14 @@ class Ae {
1041
1066
  case m.BitMapEraser:
1042
1067
  await this.drawBitMapEraserFull(
1043
1068
  l,
1044
- k,
1069
+ S,
1045
1070
  i,
1046
1071
  o
1047
1072
  ), this.fullWorkerDrawCount = 0, this.clearWorkShapeNodeCache(d);
1048
1073
  break;
1049
1074
  case m.Eraser:
1050
1075
  await this.drawEraser(
1051
- { ...k, scenePath: r },
1076
+ { ...S, scenePath: r },
1052
1077
  i,
1053
1078
  o,
1054
1079
  e.collectUndoTicker
@@ -1067,17 +1092,17 @@ class Ae {
1067
1092
  type: h.None,
1068
1093
  isLockSentEventCursor: i,
1069
1094
  scenePath: r
1070
- }), k) {
1071
- const g = p === m.Pencil && k.type === h.RemoveNode;
1095
+ }), S) {
1096
+ const g = p === m.Pencil && S.type === h.RemoveNode;
1072
1097
  g ? $(
1073
1098
  this.thread.localLayer,
1074
1099
  this.thread.localLayer.parent
1075
1100
  ) : I.push({
1076
- ...k,
1101
+ ...S,
1077
1102
  scenePath: r,
1078
1103
  needUndoTicker: e.needUndoTicker,
1079
- undoScopeIds: k.undoScopeIds || (k.workId !== void 0 ? [k.workId.toString()] : void 0),
1080
- undoScopePhase: k.undoScopePhase || "finalize"
1104
+ undoScopeIds: S.undoScopeIds || (S.workId !== void 0 ? [S.workId.toString()] : void 0),
1105
+ undoScopePhase: S.undoScopePhase || "finalize"
1081
1106
  }), this.fullWorkerDrawCount = 0, e.needUndoTicker && I.push({
1082
1107
  type: h.None,
1083
1108
  needUndoTicker: e.needUndoTicker,
@@ -1249,45 +1274,45 @@ class Fe {
1249
1274
  );
1250
1275
  }
1251
1276
  async animationDraw() {
1252
- var r, i, o, a, n, c, d, l, p, f, w, k, I, W, g, y, S, T, C, L, A;
1277
+ var r, i, o, a, n, c, d, l, p, f, w, S, I, W, g, y, v, T, C, L, A;
1253
1278
  let e = !1;
1254
1279
  const t = /* @__PURE__ */ new Map(), s = [];
1255
- for (const [E, v] of this.workShapes.entries())
1256
- switch (v.toolsType) {
1280
+ for (const [E, k] of this.workShapes.entries())
1281
+ switch (k.toolsType) {
1257
1282
  case m.BackgroundSVG: {
1258
- (r = v.node) == null || r.consumeService({
1283
+ (r = k.node) == null || r.consumeService({
1259
1284
  isFullWork: !0,
1260
1285
  replaceId: E
1261
- }), this.selectorWorkShapes.forEach((O, B) => {
1286
+ }), this.selectorWorkShapes.forEach((B, O) => {
1262
1287
  var P;
1263
- (P = O.selectIds) != null && P.includes(E) && (this.willRunEffectSelectorIds.add(B), this.runEffect());
1288
+ (P = B.selectIds) != null && P.includes(E) && (this.willRunEffectSelectorIds.add(O), this.runEffect());
1264
1289
  }), this.workShapes.delete(E);
1265
1290
  break;
1266
1291
  }
1267
1292
  case m.Image: {
1268
- await ((i = v.node) == null ? void 0 : i.consumeServiceAsync({
1293
+ await ((i = k.node) == null ? void 0 : i.consumeServiceAsync({
1269
1294
  isFullWork: !0,
1270
1295
  worker: this
1271
- })), this.selectorWorkShapes.forEach((O, B) => {
1296
+ })), this.selectorWorkShapes.forEach((B, O) => {
1272
1297
  var P;
1273
- (P = O.selectIds) != null && P.includes(E) && (this.willRunEffectSelectorIds.add(B), this.runEffect());
1298
+ (P = B.selectIds) != null && P.includes(E) && (this.willRunEffectSelectorIds.add(O), this.runEffect());
1274
1299
  }), this.workShapes.delete(E);
1275
1300
  break;
1276
1301
  }
1277
1302
  case m.Text: {
1278
- v.node && (await ((o = v.node) == null ? void 0 : o.consumeServiceAsync({
1303
+ k.node && (await ((o = k.node) == null ? void 0 : o.consumeServiceAsync({
1279
1304
  isFullWork: !0,
1280
1305
  replaceId: E,
1281
1306
  boxRect: this.thread.getSceneRect()
1282
- })), this.selectorWorkShapes.forEach((O, B) => {
1307
+ })), this.selectorWorkShapes.forEach((B, O) => {
1283
1308
  var P;
1284
- (P = O.selectIds) != null && P.includes(E) && (this.willRunEffectSelectorIds.add(B), this.runEffect());
1285
- }), v.refreshTextRender && v.requestId && s.push({
1309
+ (P = B.selectIds) != null && P.includes(E) && (this.willRunEffectSelectorIds.add(O), this.runEffect());
1310
+ }), k.refreshTextRender && k.requestId && s.push({
1286
1311
  type: h.RefreshTextRender,
1287
- requestId: v.requestId,
1312
+ requestId: k.requestId,
1288
1313
  workId: E,
1289
1314
  viewId: this.thread.viewId
1290
- }), (a = v.node) == null || a.clearTmpPoints(), this.workShapes.delete(E));
1315
+ }), (a = k.node) == null || a.clearTmpPoints(), this.workShapes.delete(E));
1291
1316
  break;
1292
1317
  }
1293
1318
  case m.Arrow:
@@ -1297,60 +1322,60 @@ class Fe {
1297
1322
  case m.Star:
1298
1323
  case m.Polygon:
1299
1324
  case m.SpeechBalloon: {
1300
- const O = !!v.ops;
1301
- if ((n = v.animationWorkData) != null && n.length) {
1302
- const B = v.oldRect;
1303
- (c = v.node) == null || c.consumeService({
1304
- op: v.animationWorkData,
1305
- isFullWork: O
1306
- }), O && (this.selectorWorkShapes.forEach((P, F) => {
1325
+ const B = !!k.ops;
1326
+ if ((n = k.animationWorkData) != null && n.length) {
1327
+ const O = k.oldRect;
1328
+ (c = k.node) == null || c.consumeService({
1329
+ op: k.animationWorkData,
1330
+ isFullWork: B
1331
+ }), B && (this.selectorWorkShapes.forEach((P, F) => {
1307
1332
  var U;
1308
1333
  (U = P.selectIds) != null && U.includes(E) && (this.willRunEffectSelectorIds.add(F), this.runEffect());
1309
- }), (d = v.node) == null || d.clearTmpPoints(), this.workShapes.delete(E)), v.isEnableCursor ? t.set(E, {
1310
- cursorTool: _(v.toolsType),
1311
- workState: B ? v.ops ? b.Done : b.Doing : b.Start,
1312
- op: v.animationWorkData.slice(-3, -1)
1313
- }) : O && !v.useAnimation && ((l = v.updateNodeOpt) != null && l.useAnimation) && t.set(E, {
1314
- cursorTool: _(v.toolsType),
1334
+ }), (d = k.node) == null || d.clearTmpPoints(), this.workShapes.delete(E)), k.isEnableCursor ? t.set(E, {
1335
+ cursorTool: _(k.toolsType),
1336
+ workState: O ? k.ops ? b.Done : b.Doing : b.Start,
1337
+ op: k.animationWorkData.slice(-3, -1)
1338
+ }) : B && !k.useAnimation && ((l = k.updateNodeOpt) != null && l.useAnimation) && t.set(E, {
1339
+ cursorTool: _(k.toolsType),
1315
1340
  workState: b.Done,
1316
- op: v.animationWorkData.slice(-3, -1),
1317
- uid: (p = v.updateNodeOpt) == null ? void 0 : p.uid
1318
- }), v.animationWorkData.length = 0;
1341
+ op: k.animationWorkData.slice(-3, -1),
1342
+ uid: (p = k.updateNodeOpt) == null ? void 0 : p.uid
1343
+ }), k.animationWorkData.length = 0;
1319
1344
  }
1320
1345
  break;
1321
1346
  }
1322
1347
  case m.Pencil: {
1323
- if (v.useAnimation) {
1324
- if (v.useAnimation) {
1325
- if (v.isDel) {
1326
- (y = v.node) == null || y.clearTmpPoints(), this.workShapes.delete(E);
1348
+ if (k.useAnimation) {
1349
+ if (k.useAnimation) {
1350
+ if (k.isDel) {
1351
+ (y = k.node) == null || y.clearTmpPoints(), this.workShapes.delete(E);
1327
1352
  break;
1328
1353
  }
1329
- const O = 3, B = this.computNextAnimationIndex(
1330
- v,
1331
- O
1332
- ), P = v.isDiff ? 0 : Math.max(0, (v.animationIndex || 0) - O), F = (v.animationWorkData || []).slice(
1333
- P,
1354
+ const B = 3, O = this.computNextAnimationIndex(
1355
+ k,
1334
1356
  B
1335
- ), U = (T = (S = v.node) == null ? void 0 : S.getWorkId()) == null ? void 0 : T.toString();
1336
- if ((v.animationIndex || 0) < B || v.isDiff) {
1337
- if ((C = v.node) == null || C.consumeService({
1357
+ ), P = k.isDiff ? 0 : Math.max(0, (k.animationIndex || 0) - B), F = (k.animationWorkData || []).slice(
1358
+ P,
1359
+ O
1360
+ ), U = (T = (v = k.node) == null ? void 0 : v.getWorkId()) == null ? void 0 : T.toString();
1361
+ if ((k.animationIndex || 0) < O || k.isDiff) {
1362
+ if ((C = k.node) == null || C.consumeService({
1338
1363
  op: F,
1339
1364
  isFullWork: !1
1340
- }), v.animationIndex = B, v.isDiff && (v.isDiff = !1), F.length && v.isEnableCursor) {
1365
+ }), k.animationIndex = O, k.isDiff && (k.isDiff = !1), F.length && k.isEnableCursor) {
1341
1366
  const X = F.slice(-3, -1);
1342
1367
  t.set(E, {
1343
- cursorTool: _(v.toolsType),
1344
- workState: P === 0 ? b.Start : B === ((L = v.animationWorkData) == null ? void 0 : L.length) ? b.Done : b.Doing,
1368
+ cursorTool: _(k.toolsType),
1369
+ workState: P === 0 ? b.Start : O === ((L = k.animationWorkData) == null ? void 0 : L.length) ? b.Done : b.Doing,
1345
1370
  op: X
1346
1371
  });
1347
1372
  }
1348
- } else v.ops && ((A = v.node) == null || A.consumeService({
1349
- op: v.animationWorkData || [],
1373
+ } else k.ops && ((A = k.node) == null || A.consumeService({
1374
+ op: k.animationWorkData || [],
1350
1375
  isFullWork: !0,
1351
1376
  replaceId: U
1352
- }), v.isDel = !0, v.isEnableCursor && t.set(E, {
1353
- cursorTool: _(v.toolsType),
1377
+ }), k.isDel = !0, k.isEnableCursor && t.set(E, {
1378
+ cursorTool: _(k.toolsType),
1354
1379
  workState: b.Done,
1355
1380
  op: F.slice(-3, -1)
1356
1381
  }));
@@ -1358,34 +1383,34 @@ class Fe {
1358
1383
  break;
1359
1384
  }
1360
1385
  } else {
1361
- const O = !!v.ops;
1362
- if ((f = v.node) == null || f.consumeService({
1363
- op: v.animationWorkData || [],
1364
- isFullWork: O,
1386
+ const B = !!k.ops;
1387
+ if ((f = k.node) == null || f.consumeService({
1388
+ op: k.animationWorkData || [],
1389
+ isFullWork: B,
1365
1390
  replaceId: E
1366
- }), (w = v.node) == null || w.updataOptService(v.updateNodeOpt), O) {
1367
- if (!v.isEnableCursor && ((k = v.updateNodeOpt) != null && k.useAnimation) && ((I = v.animationWorkData) != null && I.length)) {
1368
- const B = v.animationWorkData.slice(-3, -1);
1391
+ }), (w = k.node) == null || w.updataOptService(k.updateNodeOpt), B) {
1392
+ if (!k.isEnableCursor && ((S = k.updateNodeOpt) != null && S.useAnimation) && ((I = k.animationWorkData) != null && I.length)) {
1393
+ const O = k.animationWorkData.slice(-3, -1);
1369
1394
  t.set(E, {
1370
- cursorTool: _(v.toolsType),
1395
+ cursorTool: _(k.toolsType),
1371
1396
  workState: b.Done,
1372
- op: B,
1373
- uid: (W = v.updateNodeOpt) == null ? void 0 : W.uid
1397
+ op: O,
1398
+ uid: (W = k.updateNodeOpt) == null ? void 0 : W.uid
1374
1399
  });
1375
1400
  }
1376
- this.selectorWorkShapes.forEach((B, P) => {
1401
+ this.selectorWorkShapes.forEach((O, P) => {
1377
1402
  var F;
1378
- (F = B.selectIds) != null && F.includes(E) && (this.willRunEffectSelectorIds.add(P), this.runEffect());
1379
- }), (g = v.node) == null || g.clearTmpPoints(), this.workShapes.delete(E);
1403
+ (F = O.selectIds) != null && F.includes(E) && (this.willRunEffectSelectorIds.add(P), this.runEffect());
1404
+ }), (g = k.node) == null || g.clearTmpPoints(), this.workShapes.delete(E);
1380
1405
  }
1381
1406
  }
1382
1407
  break;
1383
1408
  }
1384
1409
  }
1385
- e && this.runAnimation(), t.size && t.forEach((E, v) => {
1410
+ e && this.runAnimation(), t.size && t.forEach((E, k) => {
1386
1411
  s.push({
1387
1412
  type: h.Cursor,
1388
- uid: E.uid || v.split(de)[0],
1413
+ uid: E.uid || k.split(de)[0],
1389
1414
  op: E.op,
1390
1415
  workState: E.workState,
1391
1416
  cursorTool: E.cursorTool,
@@ -1420,7 +1445,7 @@ class Fe {
1420
1445
  return !1;
1421
1446
  }
1422
1447
  activeWorkShape(e) {
1423
- var W, g, y, S;
1448
+ var W, g, y, v;
1424
1449
  const {
1425
1450
  workId: t,
1426
1451
  opt: s,
@@ -1437,7 +1462,7 @@ class Fe {
1437
1462
  } = e;
1438
1463
  if (!t)
1439
1464
  return;
1440
- const w = t.toString(), k = (W = this.vNodes.get(w)) == null ? void 0 : W.rect;
1465
+ const w = t.toString(), S = (W = this.vNodes.get(w)) == null ? void 0 : W.rect;
1441
1466
  if (!((g = this.workShapes) != null && g.has(w))) {
1442
1467
  let T = {
1443
1468
  toolsType: r,
@@ -1447,19 +1472,19 @@ class Fe {
1447
1472
  updateNodeOpt: o,
1448
1473
  ops: a,
1449
1474
  useAnimation: typeof c < "u" ? c : typeof (o == null ? void 0 : o.useAnimation) < "u" ? o == null ? void 0 : o.useAnimation : !0,
1450
- oldRect: k,
1475
+ oldRect: S,
1451
1476
  isDiff: !1,
1452
1477
  imageBitmap: d,
1453
1478
  isEnableCursor: l
1454
1479
  };
1455
1480
  r && s && (T = this.setNodeKey(w, T, r, s)), (y = this.workShapes) == null || y.set(w, T);
1456
1481
  }
1457
- const I = (S = this.workShapes) == null ? void 0 : S.get(w);
1482
+ const I = (v = this.workShapes) == null ? void 0 : v.get(w);
1458
1483
  I.isEnableCursor = l, I.requestId = p, I.refreshTextRender = !!f, i && (I.type = i), a && (I.animationWorkData = V(a), I.ops = a), o && (I.updateNodeOpt = o), n && (I.isDiff = this.hasDiffData(
1459
1484
  I.animationWorkData || [],
1460
1485
  n,
1461
1486
  I.toolsType
1462
- ), I.toolsType, m.Pencil, I.animationWorkData = n), I.node && I.node.getWorkId() !== w && I.node.setWorkId(w), k && (I.oldRect = k), r && s && (s.syncUnitTime && (this.syncUnitTime = s.syncUnitTime), I.toolsType !== r && r && s && this.setNodeKey(w, I, r, s), I.node && I.node.setWorkOptions(s)), d && (I.imageBitmap = d);
1487
+ ), I.toolsType, m.Pencil, I.animationWorkData = n), I.node && I.node.getWorkId() !== w && I.node.setWorkId(w), S && (I.oldRect = S), r && s && (s.syncUnitTime && (this.syncUnitTime = s.syncUnitTime), I.toolsType !== r && r && s && this.setNodeKey(w, I, r, s), I.node && I.node.setWorkOptions(s)), d && (I.imageBitmap = d);
1463
1488
  }
1464
1489
  removeNode(e, t) {
1465
1490
  e.indexOf(D) > -1 && this.removeSelectWork(t), this.thread.fullLayer.getElementsByName(e).forEach((r) => {
@@ -1701,7 +1726,7 @@ class qe extends x {
1701
1726
  updateSelectorOpt: l,
1702
1727
  textUpdateForWoker: p,
1703
1728
  needUndoTicker: f
1704
- } = s, w = l.workState, k = r.sp || [];
1729
+ } = s, w = l.workState, S = r.sp || [];
1705
1730
  if (w === b.Start)
1706
1731
  return {
1707
1732
  sp: [
@@ -1716,7 +1741,7 @@ class qe extends x {
1716
1741
  const I = a == null ? void 0 : a.selectRect;
1717
1742
  if (c) {
1718
1743
  const g = w === b.Done ? f : void 0;
1719
- k.push({
1744
+ S.push({
1720
1745
  type: h.Select,
1721
1746
  selectIds: o.selectIds,
1722
1747
  selectRect: I,
@@ -1732,34 +1757,34 @@ class qe extends x {
1732
1757
  useAnimation: l.useAnimation || !1
1733
1758
  };
1734
1759
  l.uid && (y.uid = l.uid);
1735
- for (const [S, T] of i.entries())
1736
- T.toolsType === m.BackgroundSVG && k.push({
1760
+ for (const [v, T] of i.entries())
1761
+ T.toolsType === m.BackgroundSVG && S.push({
1737
1762
  ...T,
1738
- workId: S,
1763
+ workId: v,
1739
1764
  type: h.BackgroundSVGUpdate,
1740
1765
  dataType: R.Local,
1741
1766
  willSyncService: w === b.Done ? !0 : n,
1742
1767
  updateNodeOpt: y,
1743
1768
  needUndoTicker: g,
1744
1769
  emitEventType: this.emitEventType
1745
- }), p && T.toolsType === m.Text ? k.push({
1770
+ }), p && T.toolsType === m.Text ? S.push({
1746
1771
  ...T,
1747
- workId: S,
1772
+ workId: v,
1748
1773
  type: h.TextUpdate,
1749
1774
  dataType: R.Local,
1750
1775
  willSyncService: w === b.Done ? !0 : n,
1751
1776
  updateNodeOpt: y,
1752
1777
  needUndoTicker: g,
1753
1778
  emitEventType: this.emitEventType
1754
- }) : (n || w === b.Done) && k.push({
1779
+ }) : (n || w === b.Done) && S.push({
1755
1780
  ...T,
1756
- workId: S,
1781
+ workId: v,
1757
1782
  type: h.UpdateNode,
1758
1783
  updateNodeOpt: {
1759
1784
  ...y,
1760
1785
  eraserGeometryDelta: ee(
1761
1786
  (W = this.localWork) == null ? void 0 : W.vNodes,
1762
- S
1787
+ v
1763
1788
  )
1764
1789
  },
1765
1790
  isSync: d,
@@ -1767,15 +1792,15 @@ class qe extends x {
1767
1792
  emitEventType: this.emitEventType
1768
1793
  });
1769
1794
  }
1770
- return f && k.push({
1795
+ return f && S.push({
1771
1796
  type: h.None,
1772
1797
  needUndoTicker: f
1773
- }), k.push({
1798
+ }), S.push({
1774
1799
  type: h.SelectorTransform,
1775
1800
  emitEventType: this.emitEventType,
1776
1801
  workState: w
1777
1802
  }), {
1778
- sp: k
1803
+ sp: S
1779
1804
  };
1780
1805
  });
1781
1806
  }
@@ -1817,7 +1842,7 @@ class ze extends x {
1817
1842
  u(this, "emitEventType", N.ScaleNode);
1818
1843
  u(this, "updateSelectorCallback", (t) => {
1819
1844
  var I;
1820
- const { param: s, postData: r, workShapeNode: i, res: o, newServiceStore: a, smoothSync: n } = t, { updateSelectorOpt: c, willSyncService: d, needUndoTicker: l } = s, p = c.workState, f = r.sp || [], w = o == null ? void 0 : o.selectRect, k = p === b.Done ? l : void 0;
1845
+ const { param: s, postData: r, workShapeNode: i, res: o, newServiceStore: a, smoothSync: n } = t, { updateSelectorOpt: c, willSyncService: d, needUndoTicker: l } = s, p = c.workState, f = r.sp || [], w = o == null ? void 0 : o.selectRect, S = p === b.Done ? l : void 0;
1821
1846
  if (p === b.Start)
1822
1847
  return {
1823
1848
  sp: [
@@ -1851,7 +1876,7 @@ class ze extends x {
1851
1876
  dataType: R.Local,
1852
1877
  willSyncService: p === b.Done ? !0 : n,
1853
1878
  updateNodeOpt: W,
1854
- needUndoTicker: k,
1879
+ needUndoTicker: S,
1855
1880
  emitEventType: this.emitEventType
1856
1881
  }), y.toolsType === m.Text ? f.push({
1857
1882
  ...y,
@@ -1860,7 +1885,7 @@ class ze extends x {
1860
1885
  dataType: R.Local,
1861
1886
  willSyncService: p === b.Done ? !0 : n,
1862
1887
  updateNodeOpt: W,
1863
- needUndoTicker: k,
1888
+ needUndoTicker: S,
1864
1889
  emitEventType: this.emitEventType
1865
1890
  }) : (n || p === b.Done) && f.push({
1866
1891
  ...y,
@@ -1874,7 +1899,7 @@ class ze extends x {
1874
1899
  )
1875
1900
  },
1876
1901
  isSync: !0,
1877
- needUndoTicker: k,
1902
+ needUndoTicker: S,
1878
1903
  emitEventType: this.emitEventType
1879
1904
  });
1880
1905
  }
@@ -1928,9 +1953,9 @@ class Ve extends x {
1928
1953
  willSerializeData: l,
1929
1954
  isSync: p,
1930
1955
  needUndoTicker: f
1931
- } = s, w = c.workState, k = r.sp || [], I = o == null ? void 0 : o.selectRect, W = w === b.Done ? f : void 0;
1956
+ } = s, w = c.workState, S = r.sp || [], I = o == null ? void 0 : o.selectRect, W = w === b.Done ? f : void 0;
1932
1957
  if (d) {
1933
- l && w === b.Done && k.push({
1958
+ l && w === b.Done && S.push({
1934
1959
  type: h.Select,
1935
1960
  selectIds: i.selectIds,
1936
1961
  selectRect: I,
@@ -1942,16 +1967,16 @@ class Ve extends x {
1942
1967
  useAnimation: c.useAnimation || !1
1943
1968
  };
1944
1969
  if (c.uid && (y.uid = c.uid), n || w === b.Done)
1945
- for (const [S, T] of a.entries())
1946
- k.push({
1970
+ for (const [v, T] of a.entries())
1971
+ S.push({
1947
1972
  ...T,
1948
- workId: S,
1973
+ workId: v,
1949
1974
  type: h.UpdateNode,
1950
1975
  updateNodeOpt: {
1951
1976
  ...y,
1952
1977
  eraserGeometryDelta: ee(
1953
1978
  (g = this.localWork) == null ? void 0 : g.vNodes,
1954
- S
1979
+ v
1955
1980
  )
1956
1981
  },
1957
1982
  isSync: p,
@@ -1959,15 +1984,15 @@ class Ve extends x {
1959
1984
  emitEventType: this.emitEventType
1960
1985
  });
1961
1986
  }
1962
- return f && k.push({
1987
+ return f && S.push({
1963
1988
  type: h.None,
1964
1989
  needUndoTicker: f
1965
- }), k.push({
1990
+ }), S.push({
1966
1991
  type: h.SelectorTransform,
1967
1992
  emitEventType: this.emitEventType,
1968
1993
  workState: w
1969
1994
  }), {
1970
- sp: k
1995
+ sp: S
1971
1996
  };
1972
1997
  });
1973
1998
  }
@@ -2041,12 +2066,12 @@ class $e extends x {
2041
2066
  textUpdateForWoker: l,
2042
2067
  requestId: p,
2043
2068
  emitEventType: f
2044
- } = s, w = r.sp || [], k = a == null ? void 0 : a.selectRect;
2069
+ } = s, w = r.sp || [], S = a == null ? void 0 : a.selectRect;
2045
2070
  if (n && w) {
2046
2071
  d.fontSize && w.push({
2047
2072
  type: h.Select,
2048
2073
  selectIds: o.selectIds,
2049
- selectRect: k,
2074
+ selectRect: S,
2050
2075
  willSyncService: n,
2051
2076
  isSync: c,
2052
2077
  points: o.getChildrenPoints()
@@ -2186,7 +2211,7 @@ class He extends x {
2186
2211
  needUndoTicker: l,
2187
2212
  requestId: p,
2188
2213
  emitEventType: f
2189
- } = s, w = r.sp || [], k = a == null ? void 0 : a.selectRect;
2214
+ } = s, w = r.sp || [], S = a == null ? void 0 : a.selectRect;
2190
2215
  if (n && w) {
2191
2216
  for (const [I, W] of i.entries())
2192
2217
  w.push({
@@ -2207,7 +2232,7 @@ class He extends x {
2207
2232
  canRotate: o.canRotate,
2208
2233
  type: h.Select,
2209
2234
  selectIds: o.selectIds,
2210
- selectRect: k,
2235
+ selectRect: S,
2211
2236
  willSyncService: n,
2212
2237
  isSync: c
2213
2238
  });
@@ -2549,7 +2574,7 @@ class je {
2549
2574
  workState: p,
2550
2575
  imageSrc: f,
2551
2576
  imageBitmap: w,
2552
- imageElement: k,
2577
+ imageElement: S,
2553
2578
  workIds: I,
2554
2579
  isLockSentEventCursor: W,
2555
2580
  requestId: g
@@ -2559,19 +2584,24 @@ class je {
2559
2584
  G(e.dpr) && this.updateDpr(e.dpr);
2560
2585
  break;
2561
2586
  case h.AuthClear: {
2562
- const { clearUids: S, localUid: T } = e;
2563
- this.vNodes.setCanClearUids(S), this.vNodes.setLocalUid(T);
2587
+ const { clearUids: v, localUid: T } = e;
2588
+ this.vNodes.setCanClearUids(v), this.vNodes.setLocalUid(T);
2564
2589
  break;
2565
2590
  }
2566
2591
  case h.Destroy:
2567
2592
  this.destroy();
2568
2593
  break;
2594
+ case h.CancelBitmapEraser: {
2595
+ const v = y;
2596
+ v && this.localWork.abortBitmapEraser(v);
2597
+ break;
2598
+ }
2569
2599
  case h.Clear:
2570
2600
  this.clearAll();
2571
2601
  break;
2572
2602
  case h.ServiceSyncCommit: {
2573
2603
  if (this.destroyed) break;
2574
- const S = [
2604
+ const v = [
2575
2605
  (s = this.fullLayer) == null ? void 0 : s.parent,
2576
2606
  (r = this.topLayer) == null ? void 0 : r.parent,
2577
2607
  (i = this.localLayer) == null ? void 0 : i.parent,
@@ -2582,7 +2612,7 @@ class je {
2582
2612
  (async () => {
2583
2613
  await Le(
2584
2614
  this.serviceWork,
2585
- S
2615
+ v
2586
2616
  );
2587
2617
  })(),
2588
2618
  {
@@ -2616,26 +2646,26 @@ class je {
2616
2646
  try {
2617
2647
  await Ee(
2618
2648
  e.cameraTaskId,
2619
- async (S) => {
2620
- this.activeCameraTaskContext = S;
2649
+ async (v) => {
2650
+ this.activeCameraTaskContext = v;
2621
2651
  try {
2622
- await this.updateCamera(e, S);
2652
+ await this.updateCamera(e, v);
2623
2653
  } finally {
2624
- this.activeCameraTaskContext === S && (this.activeCameraTaskContext = void 0);
2654
+ this.activeCameraTaskContext === v && (this.activeCameraTaskContext = void 0);
2625
2655
  }
2626
2656
  }
2627
2657
  );
2628
- } catch (S) {
2629
- throw this.cameraOpt = void 0, this.cancelCameraSettledRender(), S;
2658
+ } catch (v) {
2659
+ throw this.cameraOpt = void 0, this.cancelCameraSettledRender(), v;
2630
2660
  }
2631
2661
  break;
2632
2662
  case h.UpdateTools:
2633
2663
  if (n && c) {
2634
- const S = {
2664
+ const v = {
2635
2665
  toolsType: n,
2636
2666
  toolsOpt: c
2637
2667
  };
2638
- this.topWork.canUseTopLayer(n) ? this.topWork.setToolsOpt(S) : this.localWork.setToolsOpt(S);
2668
+ this.topWork.canUseTopLayer(n) ? this.topWork.setToolsOpt(v) : this.localWork.setToolsOpt(v);
2639
2669
  }
2640
2670
  break;
2641
2671
  case h.CreateWork:
@@ -2687,31 +2717,31 @@ class je {
2687
2717
  d === R.Local && this.localWork.checkTextActive(e);
2688
2718
  break;
2689
2719
  case h.GetImageBitMap:
2690
- if (f && (w || k) && l) {
2691
- const S = this.imageResolveMap.get(f);
2692
- if (!S || S.requestId !== g) {
2693
- this.closeImageSource(w || k);
2720
+ if (f && (w || S) && l) {
2721
+ const v = this.imageResolveMap.get(f);
2722
+ if (!v || v.requestId !== g) {
2723
+ this.closeImageSource(w || S);
2694
2724
  break;
2695
2725
  }
2696
2726
  const T = l.toString();
2697
2727
  this.deleteCachedImagesByWorkId(T), this.cacheImages.set(f, {
2698
- imageSource: w || k,
2728
+ imageSource: w || S,
2699
2729
  workId: T
2700
2730
  });
2701
- const { resolve: C, timer: L } = S;
2731
+ const { resolve: C, timer: L } = v;
2702
2732
  L && clearTimeout(L), C && C(f);
2703
2733
  }
2704
2734
  break;
2705
2735
  case h.GetVNodeInfo:
2706
2736
  if (l && I) {
2707
- const S = I.map((T) => this.vNodes.get(T));
2737
+ const v = I.map((T) => this.vNodes.get(T));
2708
2738
  this.post({
2709
2739
  sp: [
2710
2740
  {
2711
2741
  type: h.GetVNodeInfo,
2712
2742
  dataType: R.Local,
2713
2743
  workId: l,
2714
- vInfo: S
2744
+ vInfo: v
2715
2745
  }
2716
2746
  ]
2717
2747
  });
@@ -2732,8 +2762,8 @@ class je {
2732
2762
  return;
2733
2763
  let p = a;
2734
2764
  if (n === pe.Iconify) {
2735
- const [y, S] = this.getIconSize(c, d, this.opt.displayer.dpr);
2736
- p = ue(a, y, S, l);
2765
+ const [y, v] = this.getIconSize(c, d, this.opt.displayer.dpr);
2766
+ p = ue(a, y, v, l);
2737
2767
  }
2738
2768
  if (this.cacheImages.has(p)) {
2739
2769
  const y = this.getCachedImages(p);
@@ -2743,18 +2773,18 @@ class je {
2743
2773
  const w = this.imageResolveMap.get(p);
2744
2774
  if (w)
2745
2775
  return await w.promise, this.getCachedImages(p);
2746
- let k, I;
2747
- const W = new Promise((y, S) => {
2748
- k = y, I = S;
2776
+ let S, I;
2777
+ const W = new Promise((y, v) => {
2778
+ S = y, I = v;
2749
2779
  }), g = {
2750
- resolve: k,
2780
+ resolve: S,
2751
2781
  reject: I,
2752
2782
  timer: void 0,
2753
2783
  requestId: i,
2754
2784
  promise: W
2755
2785
  };
2756
2786
  return g.timer = setTimeout(() => {
2757
- this.imageResolveMap.get(p) === g && k(p);
2787
+ this.imageResolveMap.get(p) === g && S(p);
2758
2788
  }, 5e3), this.imageResolveMap.set(p, g), this.opt.post({
2759
2789
  sp: [
2760
2790
  {
@@ -2929,29 +2959,29 @@ class je {
2929
2959
  }
2930
2960
  if (t != null && t.aborted) return;
2931
2961
  const f = /* @__PURE__ */ new Map();
2932
- for (const [y, S] of this.vNodes.getNodesByType(m.Text).entries()) {
2933
- const T = S.rect;
2962
+ for (const [y, v] of this.vNodes.getNodesByType(m.Text).entries()) {
2963
+ const T = v.rect;
2934
2964
  f.set(y, J(T));
2935
2965
  }
2936
- for (const [y, S] of this.vNodes.gethasEraserNodes().entries())
2937
- f.set(y, J(S.rect));
2966
+ for (const [y, v] of this.vNodes.gethasEraserNodes().entries())
2967
+ f.set(y, J(v.rect));
2938
2968
  const w = new Set(f.keys());
2939
- let k = !1;
2969
+ let S = !1;
2940
2970
  if (this.localWork.hasSelector()) {
2941
2971
  const y = (l = this.localWork.getSelector()) == null ? void 0 : l.selectIds;
2942
2972
  if (y) {
2943
- k = !0;
2944
- for (const S of y)
2945
- w.add(S);
2973
+ S = !0;
2974
+ for (const v of y)
2975
+ w.add(v);
2946
2976
  }
2947
2977
  }
2948
2978
  let I = !1;
2949
2979
  if (this.serviceWork.selectorWorkShapes.size)
2950
2980
  for (const y of this.serviceWork.selectorWorkShapes.values()) {
2951
- const S = y.selectIds;
2952
- if (S) {
2981
+ const v = y.selectIds;
2982
+ if (v) {
2953
2983
  I = !0;
2954
- for (const T of S)
2984
+ for (const T of v)
2955
2985
  w.add(T);
2956
2986
  }
2957
2987
  }
@@ -2960,14 +2990,14 @@ class je {
2960
2990
  for (const [T, C] of f.entries()) {
2961
2991
  const L = this.vNodes.get(T);
2962
2992
  if (L) {
2963
- const A = C, E = L.rect, v = this.getSceneRect(), O = ae(A, v), B = ae(E, v);
2993
+ const A = C, E = L.rect, k = this.getSceneRect(), B = ae(A, k), O = ae(E, k);
2964
2994
  let P = c;
2965
- (O !== B || A.w !== E.w || A.h !== E.h || B === Ce.intersect) && (P = !0);
2995
+ (B !== O || A.w !== E.w || A.h !== E.h || O === Ce.intersect) && (P = !0);
2966
2996
  const { toolsType: F, opt: U } = L, X = U.eraserlines && U.eraserlines.length > 0 || !!U.eraserFaces;
2967
2997
  (P || p && X) && (F === m.Text || X) && this.debounceUpdateCache.add(T);
2968
2998
  }
2969
2999
  }
2970
- if (k && this.localWork.reRenderSelector(), I)
3000
+ if (S && this.localWork.reRenderSelector(), I)
2971
3001
  for (const [
2972
3002
  T,
2973
3003
  C
@@ -2982,36 +3012,36 @@ class je {
2982
3012
  o = !0;
2983
3013
  const y = { cancelled: !1, cameraTaskId: i, context: t };
2984
3014
  this.activeCameraSettledRender = y;
2985
- const S = () => !this.destroyed && !y.cancelled && this.activeCameraSettledRender === y && !(t != null && t.aborted);
3015
+ const v = () => !this.destroyed && !y.cancelled && this.activeCameraSettledRender === y && !(t != null && t.aborted);
2986
3016
  this.debounceUpdateCameraId = setTimeout(async () => {
2987
3017
  var T;
2988
3018
  this.debounceUpdateCameraId = void 0;
2989
3019
  try {
2990
- if (!S()) return;
3020
+ if (!v()) return;
2991
3021
  const C = [];
2992
3022
  for (const E of this.debounceUpdateCache.values()) {
2993
- const v = (T = this.fullLayer) == null ? void 0 : T.getElementsByName(E)[0], O = this.vNodes.get(E);
2994
- if (O) {
2995
- const { toolsType: B, opt: P } = O;
2996
- if (v || B !== m.Text) {
3023
+ const k = (T = this.fullLayer) == null ? void 0 : T.getElementsByName(E)[0], B = this.vNodes.get(E);
3024
+ if (B) {
3025
+ const { toolsType: O, opt: P } = B;
3026
+ if (k || O !== m.Text) {
2997
3027
  const F = this.localWork.setFullWork({
2998
- toolsType: B,
3028
+ toolsType: O,
2999
3029
  opt: P,
3000
3030
  workId: E
3001
3031
  });
3002
3032
  if (F) {
3003
- if (B === m.Text)
3033
+ if (O === m.Text)
3004
3034
  C.push(
3005
3035
  F.consumeServiceAsync({
3006
3036
  isFullWork: !0,
3007
3037
  replaceId: E,
3008
3038
  boxRect: this.getSceneRect(),
3009
- isActive: S
3039
+ isActive: v
3010
3040
  })
3011
3041
  );
3012
3042
  else if (P.eraserlines && P.eraserlines.length > 0 || P.eraserFaces) {
3013
3043
  const U = F.consumeService({
3014
- op: O.op,
3044
+ op: B.op,
3015
3045
  isFullWork: !0,
3016
3046
  replaceId: E,
3017
3047
  workState: b.Done
@@ -3023,7 +3053,7 @@ class je {
3023
3053
  }
3024
3054
  this.debounceUpdateCache.delete(E);
3025
3055
  }
3026
- if (await Promise.all(C), !S()) return;
3056
+ if (await Promise.all(C), !v()) return;
3027
3057
  this.vNodes.updateLowLevelNodesRect(), this.vNodes.clearHighLevelIds();
3028
3058
  const L = [
3029
3059
  this.fullLayer.parent.prepareRender,
@@ -3036,7 +3066,7 @@ class je {
3036
3066
  this.topLayer.parent,
3037
3067
  this.localLayer.parent,
3038
3068
  this.serviceLayer.parent
3039
- ], await Promise.all(L), y.renderLayers = void 0, !S()) return;
3069
+ ], await Promise.all(L), y.renderLayers = void 0, !v()) return;
3040
3070
  const A = y.cameraTaskId;
3041
3071
  G(A) && this.opt.post({
3042
3072
  viewId: this.viewId,
@@ -3044,7 +3074,7 @@ class je {
3044
3074
  cameraSettledTaskId: A
3045
3075
  });
3046
3076
  } catch (C) {
3047
- if (!S()) return;
3077
+ if (!v()) return;
3048
3078
  const L = {
3049
3079
  code: "RENDERER_BUSINESS_ERROR",
3050
3080
  business: "updateCamera",
@@ -3086,8 +3116,8 @@ class je {
3086
3116
  "prepare-render"
3087
3117
  )) {
3088
3118
  W.filter(
3089
- (S) => S.cancelPendingRender()
3090
- ).forEach((S) => S.render()), g.catch(() => {
3119
+ (v) => v.cancelPendingRender()
3120
+ ).forEach((v) => v.render()), g.catch(() => {
3091
3121
  });
3092
3122
  return;
3093
3123
  }
@@ -3381,17 +3411,17 @@ class Je {
3381
3411
  const w = this.imageResolveMap.get(p);
3382
3412
  if (w)
3383
3413
  return await w.promise, this.getCachedImages(p);
3384
- let k;
3414
+ let S;
3385
3415
  const I = new Promise((g) => {
3386
- k = g;
3416
+ S = g;
3387
3417
  }), W = {
3388
- resolve: k,
3418
+ resolve: S,
3389
3419
  timer: void 0,
3390
3420
  requestId: i,
3391
3421
  promise: I
3392
3422
  };
3393
3423
  return W.timer = setTimeout(() => {
3394
- this.imageResolveMap.get(p) === W && k(p);
3424
+ this.imageResolveMap.get(p) === W && S(p);
3395
3425
  }, 5e3), this.imageResolveMap.set(p, W), this.opt.post({
3396
3426
  viewId: this.viewId,
3397
3427
  viewGeneration: this.viewGeneration,
@@ -3585,7 +3615,7 @@ class Je {
3585
3615
  for (const r of s.sp) {
3586
3616
  let i = !1;
3587
3617
  for (const o of e)
3588
- if (Oe(r, o)) {
3618
+ if (Be(r, o)) {
3589
3619
  i = !0;
3590
3620
  break;
3591
3621
  }
@@ -3738,7 +3768,7 @@ class ht {
3738
3768
  consumeWorkId: p
3739
3769
  } = e;
3740
3770
  if (c && q(i)) {
3741
- const f = Be(
3771
+ const f = Oe(
3742
3772
  o,
3743
3773
  a,
3744
3774
  "mainThread"
@@ -3893,17 +3923,17 @@ class ht {
3893
3923
  if (o === h.Init) {
3894
3924
  const g = i.viewGeneration ?? (this.viewGenerationById.get(a) || 0) + 1;
3895
3925
  await this.enqueueViewTask(a, async () => {
3896
- var E, v, O;
3926
+ var E, k, B;
3897
3927
  const y = this.viewGenerationById.get(a);
3898
3928
  if (y !== void 0 && g < y)
3899
3929
  return;
3900
3930
  this.viewGenerationById.set(a, g);
3901
- const S = i.viewOwner || `${a}:${g}:${++this.ownerSequence}`, T = (E = this.master.control.viewContainerManager.getView(a)) == null ? void 0 : E.displayer, C = T == null ? void 0 : T.canvasContainerRef.current;
3931
+ const v = i.viewOwner || `${a}:${g}:${++this.ownerSequence}`, T = (E = this.master.control.viewContainerManager.getView(a)) == null ? void 0 : E.displayer, C = T == null ? void 0 : T.canvasContainerRef.current;
3902
3932
  if (!T || !C || !l || !p) {
3903
3933
  this.viewOwnerById.delete(a);
3904
3934
  return;
3905
3935
  }
3906
- this.viewOwnerById.set(a, S);
3936
+ this.viewOwnerById.set(a, v);
3907
3937
  const L = this.mainThreadMap.get(a);
3908
3938
  L == null || L.destroy();
3909
3939
  const A = this.createMainThread(a, {
@@ -3912,14 +3942,14 @@ class ht {
3912
3942
  layerOpt: l,
3913
3943
  master: this.master,
3914
3944
  canvasOpt: p,
3915
- viewOwner: S,
3945
+ viewOwner: v,
3916
3946
  viewGeneration: g,
3917
- mainThreadRenderMode: ((O = (v = this.master.control) == null ? void 0 : v.renderingCompatibilityDecision) == null ? void 0 : O.mainThreadRenderMode) ?? "normal",
3918
- post: (B) => this.post({
3919
- ...B,
3920
- viewId: B.viewId || a,
3921
- viewGeneration: B.viewGeneration ?? g,
3922
- viewOwner: S
3947
+ mainThreadRenderMode: ((B = (k = this.master.control) == null ? void 0 : k.renderingCompatibilityDecision) == null ? void 0 : B.mainThreadRenderMode) ?? "normal",
3948
+ post: (O) => this.post({
3949
+ ...O,
3950
+ viewId: O.viewId || a,
3951
+ viewGeneration: O.viewGeneration ?? g,
3952
+ viewOwner: v
3923
3953
  })
3924
3954
  });
3925
3955
  this.mainThreadMap.set(a, A), A && f && A.setCameraOpt(f), this.post({
@@ -3935,12 +3965,12 @@ class ht {
3935
3965
  continue;
3936
3966
  }
3937
3967
  if (o === h.Snapshot || o === h.BoundingBox) {
3938
- const g = (t = this.master.control.viewContainerManager.getView(a)) == null ? void 0 : t.displayer, y = (s = this.master.control.viewContainerManager.mainView) == null ? void 0 : s.displayer, S = (r = y == null ? void 0 : y.snapshotContainerRef) == null ? void 0 : r.current;
3939
- if (g && S && f) {
3968
+ const g = (t = this.master.control.viewContainerManager.getView(a)) == null ? void 0 : t.displayer, y = (s = this.master.control.viewContainerManager.mainView) == null ? void 0 : s.displayer, v = (r = y == null ? void 0 : y.snapshotContainerRef) == null ? void 0 : r.current;
3969
+ if (g && v && f) {
3940
3970
  const T = this.getSnapshotRequestKey(i), C = this.snapshotThreadsByRequest.get(T);
3941
3971
  C && this.disposeSnapshotThread(T, C.thread, "replaced");
3942
3972
  const L = document.createElement("div");
3943
- L.style.width = `${f.width}px`, L.style.height = `${f.height}px`, S.append(L);
3973
+ L.style.width = `${f.width}px`, L.style.height = `${f.height}px`, v.append(L);
3944
3974
  const A = {
3945
3975
  ...he.defaultLayerOpt,
3946
3976
  offscreen: !1,
@@ -3950,7 +3980,7 @@ class ht {
3950
3980
  ...he.defaultScreenCanvasOpt,
3951
3981
  width: f.width,
3952
3982
  height: f.height
3953
- }, v = this.createSnapshotThread(a, {
3983
+ }, k = this.createSnapshotThread(a, {
3954
3984
  displayer: g,
3955
3985
  container: L,
3956
3986
  layerOpt: A,
@@ -3961,14 +3991,14 @@ class ht {
3961
3991
  viewGeneration: this.viewGenerationById.get(a)
3962
3992
  });
3963
3993
  this.snapshotThreadsByRequest.set(T, {
3964
- thread: v,
3994
+ thread: k,
3965
3995
  surface: L
3966
- }), v.on(i).then(() => {
3967
- this.disposeSnapshotThread(T, v);
3968
- }).catch((O) => {
3996
+ }), k.on(i).then(() => {
3997
+ this.disposeSnapshotThread(T, k);
3998
+ }).catch((B) => {
3969
3999
  this.master.Logger.error(
3970
- `[Appliance]: snapshot render failed; viewId=${a}; error=${O instanceof Error ? O.message : String(O)}`
3971
- ), this.disposeSnapshotThread(T, v);
4000
+ `[Appliance]: snapshot render failed; viewId=${a}; error=${B instanceof Error ? B.message : String(B)}`
4001
+ ), this.disposeSnapshotThread(T, k);
3972
4002
  });
3973
4003
  continue;
3974
4004
  }
@@ -3999,8 +4029,8 @@ class ht {
3999
4029
  continue;
4000
4030
  }
4001
4031
  if (o === h.GetImageBitMap) {
4002
- const g = this.mainThreadMap.get(a), y = this.viewGenerationById.get(a), S = this.viewOwnerById.get(a);
4003
- if (!g || i.viewGeneration !== void 0 && i.viewGeneration !== y || i.viewOwner !== void 0 && i.viewOwner !== S || this.mainThreadMap.get(a) !== g) {
4032
+ const g = this.mainThreadMap.get(a), y = this.viewGenerationById.get(a), v = this.viewOwnerById.get(a);
4033
+ if (!g || i.viewGeneration !== void 0 && i.viewGeneration !== y || i.viewOwner !== void 0 && i.viewOwner !== v || this.mainThreadMap.get(a) !== g) {
4004
4034
  this.releaseMessageBitmap(i);
4005
4035
  continue;
4006
4036
  }
@@ -4008,12 +4038,12 @@ class ht {
4008
4038
  continue;
4009
4039
  }
4010
4040
  if (o === h.TasksQueue && (n != null && n.size)) {
4011
- const g = n.get(a), y = this.mainThreadMap.get(a), S = this.viewGenerationById.get(a), T = this.viewOwnerById.get(a);
4041
+ const g = n.get(a), y = this.mainThreadMap.get(a), v = this.viewGenerationById.get(a), T = this.viewOwnerById.get(a);
4012
4042
  let C;
4013
4043
  if (g && y)
4014
4044
  try {
4015
4045
  await this.enqueueViewTask(a, async () => {
4016
- this.viewGenerationById.get(a) !== S || this.viewOwnerById.get(a) !== T || this.mainThreadMap.get(a) !== y || await y.on(g);
4046
+ this.viewGenerationById.get(a) !== v || this.viewOwnerById.get(a) !== T || this.mainThreadMap.get(a) !== y || await y.on(g);
4017
4047
  });
4018
4048
  } catch (L) {
4019
4049
  if (g.msgType !== h.UpdateCamera) throw L;
@@ -4031,7 +4061,7 @@ class ht {
4031
4061
  if (C && q(d)) {
4032
4062
  this.post({
4033
4063
  viewId: a,
4034
- viewGeneration: S,
4064
+ viewGeneration: v,
4035
4065
  viewOwner: T,
4036
4066
  cameraTaskId: d,
4037
4067
  cameraTaskStatus: C.code === "RENDERER_BUSINESS_TIMEOUT" ? "timeout" : "failed",
@@ -4043,26 +4073,26 @@ class ht {
4043
4073
  workerTasksqueueCount: c,
4044
4074
  cameraTaskId: d,
4045
4075
  viewId: a,
4046
- viewGeneration: S,
4076
+ viewGeneration: v,
4047
4077
  viewOwner: T
4048
4078
  });
4049
4079
  continue;
4050
4080
  }
4051
4081
  if (a === ce) {
4052
4082
  const g = [...this.mainThreadMap.entries()];
4053
- for (const [y, S] of g) {
4083
+ for (const [y, v] of g) {
4054
4084
  const T = this.enqueueViewTask(y, async () => {
4055
- this.mainThreadMap.get(y) === S && (o === h.Destroy ? (S.destroy(), this.mainThreadMap.delete(y), this.viewOwnerById.delete(y), this.viewGenerationById.set(
4085
+ this.mainThreadMap.get(y) === v && (o === h.Destroy ? (v.destroy(), this.mainThreadMap.delete(y), this.viewOwnerById.delete(y), this.viewGenerationById.set(
4056
4086
  y,
4057
4087
  (this.viewGenerationById.get(y) || 0) + 1
4058
- )) : await S.on(i));
4088
+ )) : await v.on(i));
4059
4089
  });
4060
4090
  await T, this.cameraRenderQueueByView.get(y) === T && this.cameraRenderQueueByView.delete(y);
4061
4091
  }
4062
4092
  continue;
4063
4093
  }
4064
- const k = this.mainThreadMap.get(a);
4065
- if (o === h.Destroy && !k) {
4094
+ const S = this.mainThreadMap.get(a);
4095
+ if (o === h.Destroy && !S) {
4066
4096
  await this.enqueueViewTask(a, async () => {
4067
4097
  this.viewGenerationById.set(
4068
4098
  a,
@@ -4071,12 +4101,12 @@ class ht {
4071
4101
  });
4072
4102
  continue;
4073
4103
  }
4074
- if (!k)
4104
+ if (!S)
4075
4105
  continue;
4076
4106
  const I = this.viewGenerationById.get(a), W = this.enqueueViewTask(a, async () => {
4077
- this.viewGenerationById.get(a) !== I || this.mainThreadMap.get(a) !== k || await k.on(i);
4107
+ this.viewGenerationById.get(a) !== I || this.mainThreadMap.get(a) !== S || await S.on(i);
4078
4108
  });
4079
- o === h.Destroy && (await W, this.mainThreadMap.get(a) === k && this.mainThreadMap.delete(a), this.viewOwnerById.delete(a), this.cameraRenderQueueByView.get(a) === W && this.cameraRenderQueueByView.delete(a), this.viewGenerationById.set(
4109
+ o === h.Destroy && (await W, this.mainThreadMap.get(a) === S && this.mainThreadMap.delete(a), this.viewOwnerById.delete(a), this.cameraRenderQueueByView.get(a) === W && this.cameraRenderQueueByView.delete(a), this.viewGenerationById.set(
4080
4110
  a,
4081
4111
  i.viewGeneration ?? (I || 0) + 1
4082
4112
  ));