@netless/appliance-plugin 1.1.31 → 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.
@@ -1142,7 +1142,7 @@ function dg(r) {
1142
1142
  return lg(r, ug | hg);
1143
1143
  }
1144
1144
  var gg = dg;
1145
- const un = /* @__PURE__ */ Pn(gg), vr = "1.1.31", fg = "@netless/appliance-plugin", ji = typeof OffscreenCanvas == "function" ? "worker" : "mainThread";
1145
+ const un = /* @__PURE__ */ Pn(gg), vr = "1.1.32", fg = "@netless/appliance-plugin", ji = typeof OffscreenCanvas == "function" ? "worker" : "mainThread";
1146
1146
  if (typeof window < "u") {
1147
1147
  let r = window.__netlessUA || "";
1148
1148
  r += ` ${fg}@${vr}`, window.__netlessUA = r;
@@ -1454,8 +1454,8 @@ class tf {
1454
1454
  workId: n,
1455
1455
  msgType: R.UpdateNode
1456
1456
  }).forEach((v) => {
1457
- var z;
1458
- (z = this.control.worker) == null || z.taskBatchData.delete(v);
1457
+ var A;
1458
+ (A = this.control.worker) == null || A.taskBatchData.delete(v);
1459
1459
  }), (S = this.control.worker) == null || S.taskBatchData.add({
1460
1460
  workId: n,
1461
1461
  msgType: R.UpdateNode,
@@ -2584,8 +2584,8 @@ const Re = class Re extends YM {
2584
2584
  const k = this.isLocalId(i.toString()) ? this.transformKey(i) : i, v = this.storage[y] && this.storage[y][d] && this.storage[y][d][k] || void 0;
2585
2585
  if (v != null && v.ops || (v == null ? void 0 : v.type) === R.FullWork)
2586
2586
  return;
2587
- const z = s ? ((v == null ? void 0 : v.op) || []).slice(0, s).concat(u) : u || (v == null ? void 0 : v.op), P = c || (v == null ? void 0 : v.toolsType), E = a || (v == null ? void 0 : v.opt), O = h || (v == null ? void 0 : v.updateNodeOpt);
2588
- i && P && E && z && (this.control.renderControl.isUsePageAuth(y) && this.control.renderControl.addRenderPageElementId({
2587
+ const A = s ? ((v == null ? void 0 : v.op) || []).slice(0, s).concat(u) : u || (v == null ? void 0 : v.op), P = c || (v == null ? void 0 : v.toolsType), E = a || (v == null ? void 0 : v.opt), O = h || (v == null ? void 0 : v.updateNodeOpt);
2588
+ i && P && E && A && (this.control.renderControl.isUsePageAuth(y) && this.control.renderControl.addRenderPageElementId({
2589
2589
  viewId: y,
2590
2590
  scenePath: d,
2591
2591
  elementId: k.toString()
@@ -2598,7 +2598,7 @@ const Re = class Re extends YM {
2598
2598
  updateNodeOpt: O,
2599
2599
  toolsType: P,
2600
2600
  opt: E,
2601
- op: z,
2601
+ op: A,
2602
2602
  index: s
2603
2603
  },
2604
2604
  { isSync: M, viewId: y, scenePath: d }
@@ -2607,7 +2607,7 @@ const Re = class Re extends YM {
2607
2607
  break;
2608
2608
  case R.FullWork:
2609
2609
  if (d && i) {
2610
- const k = this.isLocalId(i.toString()) ? this.transformKey(i) : i, v = this.storage[y] && this.storage[y][d] && this.storage[y][d][k] || void 0, z = h || (v == null ? void 0 : v.updateNodeOpt), P = c || (v == null ? void 0 : v.toolsType), E = a || (v == null ? void 0 : v.opt), O = o || (v == null ? void 0 : v.ops);
2610
+ const k = this.isLocalId(i.toString()) ? this.transformKey(i) : i, v = this.storage[y] && this.storage[y][d] && this.storage[y][d][k] || void 0, A = h || (v == null ? void 0 : v.updateNodeOpt), P = c || (v == null ? void 0 : v.toolsType), E = a || (v == null ? void 0 : v.opt), O = o || (v == null ? void 0 : v.ops);
2611
2611
  P && E && (this.control.renderControl.isUsePageAuth(y) && this.control.renderControl.addRenderPageElementId({
2612
2612
  viewId: y,
2613
2613
  scenePath: d,
@@ -2616,7 +2616,7 @@ const Re = class Re extends YM {
2616
2616
  k.toString(),
2617
2617
  {
2618
2618
  type: R.FullWork,
2619
- updateNodeOpt: z,
2619
+ updateNodeOpt: A,
2620
2620
  workId: k,
2621
2621
  toolsType: P,
2622
2622
  opt: E,
@@ -2625,8 +2625,8 @@ const Re = class Re extends YM {
2625
2625
  { isSync: M, viewId: y, scenePath: d }
2626
2626
  ), ot(
2627
2627
  () => {
2628
- var b, L;
2629
- (b = this.control.pluginManager) == null || b.dispatchPluginEvent(
2628
+ var z, L;
2629
+ (z = this.control.pluginManager) == null || z.dispatchPluginEvent(
2630
2630
  "syncStorage",
2631
2631
  y,
2632
2632
  d
@@ -2669,8 +2669,8 @@ const Re = class Re extends YM {
2669
2669
  scenePath: d
2670
2670
  }), this.control.isUseSimple || ot(
2671
2671
  () => {
2672
- var z;
2673
- (z = this.control.miniMapManager) == null || z.updateMiniMapCamera(y);
2672
+ var A;
2673
+ (A = this.control.miniMapManager) == null || A.updateMiniMapCamera(y);
2674
2674
  },
2675
2675
  this.syncInterval,
2676
2676
  this.control.hasPolyfillMethod("requestIdleCallback")
@@ -2927,7 +2927,7 @@ const Re = class Re extends YM {
2927
2927
  return s;
2928
2928
  }
2929
2929
  dispatchPageAuth(e, t = !0) {
2930
- var l, h, u, g, M, d, y, w, p, f, N, S, C, k, v, z, P, E, O, b, L, j, F, X, Y, Q, _, ce, ie, K, H, fe, Je, Xe, ht, tt, Ke, mt;
2930
+ var l, h, u, g, M, d, y, w, p, f, N, S, C, k, v, A, P, E, O, z, L, j, F, X, Y, Q, _, ce, ie, K, H, fe, Je, Xe, ht, tt, Ke, mt;
2931
2931
  const { operation: i, viewId: o, scenePath: s, pageId: a, pageData: c } = e;
2932
2932
  switch (i) {
2933
2933
  case be.addPage: {
@@ -2977,7 +2977,7 @@ const Re = class Re extends YM {
2977
2977
  case be.clearPage: {
2978
2978
  if (!o || !s || !a)
2979
2979
  return;
2980
- (P = (z = (v = (k = (C = this.authStorage) == null ? void 0 : C.pageAuth) == null ? void 0 : k[o]) == null ? void 0 : v[s]) == null ? void 0 : z.pages) != null && P[a] && (delete this.authStorage.pageAuth[o][s].pages[a], t && ((E = this.plugin) == null || E.updateAttributes(
2980
+ (P = (A = (v = (k = (C = this.authStorage) == null ? void 0 : C.pageAuth) == null ? void 0 : k[o]) == null ? void 0 : v[s]) == null ? void 0 : A.pages) != null && P[a] && (delete this.authStorage.pageAuth[o][s].pages[a], t && ((E = this.plugin) == null || E.updateAttributes(
2981
2981
  [this.authSpace, "pageAuth", o, s, "pages", a],
2982
2982
  {}
2983
2983
  )));
@@ -2986,7 +2986,7 @@ const Re = class Re extends YM {
2986
2986
  case be.addElement: {
2987
2987
  if (!o || !s || !a || !(c != null && c.elementId))
2988
2988
  return;
2989
- (F = (j = (L = (b = (O = this.authStorage) == null ? void 0 : O.pageAuth) == null ? void 0 : b[o]) == null ? void 0 : L[s]) == null ? void 0 : j.pages) != null && F[a] && (this.authStorage.pageAuth[o][s].pages[a][c.elementId] = !0, t && ((X = this.plugin) == null || X.updateAttributes(
2989
+ (F = (j = (L = (z = (O = this.authStorage) == null ? void 0 : O.pageAuth) == null ? void 0 : z[o]) == null ? void 0 : L[s]) == null ? void 0 : j.pages) != null && F[a] && (this.authStorage.pageAuth[o][s].pages[a][c.elementId] = !0, t && ((X = this.plugin) == null || X.updateAttributes(
2990
2990
  [
2991
2991
  this.authSpace,
2992
2992
  "pageAuth",
@@ -3038,7 +3038,7 @@ const Re = class Re extends YM {
3038
3038
  }
3039
3039
  }
3040
3040
  dispatchRenderAuth(e, t = !0) {
3041
- var l, h, u, g, M, d, y, w, p, f, N, S, C, k, v, z, P, E, O, b;
3041
+ var l, h, u, g, M, d, y, w, p, f, N, S, C, k, v, A, P, E, O, z;
3042
3042
  const { operation: i, viewId: o, uid: s, renderData: a, isClear: c } = e;
3043
3043
  if (o)
3044
3044
  switch (i) {
@@ -3118,7 +3118,7 @@ const Re = class Re extends YM {
3118
3118
  ) : L.length === 2 ? (k = this.plugin) == null || k.updateAttributes(L, se(j)) : L.length === 3 ? (v = this.plugin) == null || v.updateAttributes(
3119
3119
  L,
3120
3120
  se(j[o])
3121
- ) : (z = this.plugin) == null || z.updateAttributes(L, !0));
3121
+ ) : (A = this.plugin) == null || A.updateAttributes(L, !0));
3122
3122
  return;
3123
3123
  }
3124
3124
  case et.setClear: {
@@ -3133,7 +3133,7 @@ const Re = class Re extends YM {
3133
3133
  ) : L.length === 2 ? (E = this.plugin) == null || E.updateAttributes(L, se(j)) : L.length === 3 ? (O = this.plugin) == null || O.updateAttributes(
3134
3134
  L,
3135
3135
  se(j[o])
3136
- ) : (b = this.plugin) == null || b.updateAttributes(L, c ? !0 : void 0));
3136
+ ) : (z = this.plugin) == null || z.updateAttributes(L, c ? !0 : void 0));
3137
3137
  return;
3138
3138
  }
3139
3139
  }
@@ -3735,12 +3735,12 @@ class WM extends Ze {
3735
3735
  x: M.x - d.x,
3736
3736
  y: M.y - d.y
3737
3737
  });
3738
- for (const z of s) {
3738
+ for (const A of s) {
3739
3739
  const P = (v = (k = this.serviceColloctor) == null ? void 0 : k.getStorageData(
3740
3740
  o.id,
3741
3741
  o.focusScenePath
3742
- )) == null ? void 0 : v[z];
3743
- P && a.set(z, P);
3742
+ )) == null ? void 0 : v[A];
3743
+ P && a.set(A, P);
3744
3744
  }
3745
3745
  return {
3746
3746
  copyStores: a,
@@ -3757,7 +3757,7 @@ class WM extends Ze {
3757
3757
  l.y + g
3758
3758
  ] || [g / u, g / u], d = [], y = [];
3759
3759
  for (const [S, C] of t.entries()) {
3760
- const v = (this.serviceColloctor.isLocalId(S) ? S : this.serviceColloctor.getLocalId(S.toString())) + "-" + a, z = { useAnimation: !1 };
3760
+ const v = (this.serviceColloctor.isLocalId(S) ? S : this.serviceColloctor.getLocalId(S.toString())) + "-" + a, A = { useAnimation: !1 };
3761
3761
  if (C.toolsType === T.Text && C.opt) {
3762
3762
  const P = C.opt;
3763
3763
  if (P && P.boxPoint && P.text) {
@@ -3795,8 +3795,8 @@ class WM extends Ze {
3795
3795
  }
3796
3796
  if ((C.toolsType === T.Image || C.toolsType === T.BackgroundSVG) && (C.opt.uuid = v, C.opt.centerX = C.opt.centerX + M[0], C.opt.centerY = C.opt.centerY + M[1]), C.ops) {
3797
3797
  const P = $n(C.ops).map(
3798
- (O, b) => {
3799
- const L = b % 3;
3798
+ (O, z) => {
3799
+ const L = z % 3;
3800
3800
  return L === 0 ? O + M[0] : L === 1 ? O + M[1] : O;
3801
3801
  }
3802
3802
  ), E = _t(P);
@@ -3806,13 +3806,13 @@ class WM extends Ze {
3806
3806
  for (const P of (N = C == null ? void 0 : C.opt) == null ? void 0 : N.eraserlines) {
3807
3807
  const { op: E } = P;
3808
3808
  for (let O = 0; O < E.length; O++) {
3809
- const b = E[O].map((L, j) => j % 2 ? L + M[1] : L + M[0]);
3810
- P.op[O] = b;
3809
+ const z = E[O].map((L, j) => j % 2 ? L + M[1] : L + M[0]);
3810
+ P.op[O] = z;
3811
3811
  }
3812
3812
  }
3813
3813
  y.push({
3814
3814
  ...C,
3815
- updateNodeOpt: z,
3815
+ updateNodeOpt: A,
3816
3816
  type: R.FullWork,
3817
3817
  workId: v,
3818
3818
  viewId: o,
@@ -3820,7 +3820,7 @@ class WM extends Ze {
3820
3820
  }), d.push([
3821
3821
  {
3822
3822
  ...C,
3823
- updateNodeOpt: z,
3823
+ updateNodeOpt: A,
3824
3824
  workId: v,
3825
3825
  msgType: R.FullWork,
3826
3826
  dataType: q.Local,
@@ -3885,27 +3885,27 @@ class FM extends Ze {
3885
3885
  if (!S)
3886
3886
  continue;
3887
3887
  const C = S.toString(), k = this.serviceColloctor.isLocalId(C), v = k ? this.serviceColloctor.transformKey(S) : C;
3888
- let z = C;
3889
- !k && this.serviceColloctor.isOwn(z) && (z = this.serviceColloctor.getLocalId(z));
3888
+ let A = C;
3889
+ !k && this.serviceColloctor.isOwn(A) && (A = this.serviceColloctor.getLocalId(A));
3890
3890
  const P = (N = (f = y == null ? void 0 : y[c]) == null ? void 0 : f[M]) == null ? void 0 : N[v];
3891
3891
  if (P) {
3892
3892
  const E = P.updateNodeOpt || {};
3893
3893
  if (s || a) {
3894
3894
  if (s) {
3895
3895
  E.fontColor = s;
3896
- const [b, L, j, F] = Wt(s);
3897
- p.textColor = [b, L, j], p.textOpacity = F;
3896
+ const [z, L, j, F] = Wt(s);
3897
+ p.textColor = [z, L, j], p.textOpacity = F;
3898
3898
  }
3899
3899
  if (a)
3900
3900
  if (E.fontBgColor = Ft(a) ? "transparent" : a, Ft(a))
3901
3901
  p.textBgColor = void 0, p.textBgOpacity = void 0;
3902
3902
  else {
3903
- const [b, L, j, F] = Wt(a);
3904
- p.textBgColor = [b, L, j], p.textBgOpacity = F;
3903
+ const [z, L, j, F] = Wt(a);
3904
+ p.textBgColor = [z, L, j], p.textBgOpacity = F;
3905
3905
  }
3906
3906
  if (P.toolsType === T.Text && P.opt && l !== x.Start) {
3907
3907
  this.setTextColor(
3908
- z,
3908
+ A,
3909
3909
  un(P),
3910
3910
  E,
3911
3911
  c
@@ -3915,19 +3915,19 @@ class FM extends Ze {
3915
3915
  }
3916
3916
  if (i) {
3917
3917
  E.strokeColor = i;
3918
- const [b, L, j, F] = Wt(i);
3919
- p.strokeColor = [b, L, j], p.strokeOpacity = F;
3918
+ const [z, L, j, F] = Wt(i);
3919
+ p.strokeColor = [z, L, j], p.strokeOpacity = F;
3920
3920
  }
3921
3921
  if (o)
3922
3922
  if (E.fillColor = Ft(o) ? "transparent" : o, Ft(o))
3923
3923
  p.fillColor = void 0, p.fillOpacity = void 0;
3924
3924
  else {
3925
- const [b, L, j, F] = Wt(o);
3926
- p.fillColor = [b, L, j], p.fillOpacity = F;
3925
+ const [z, L, j, F] = Wt(o);
3926
+ p.fillColor = [z, L, j], p.fillOpacity = F;
3927
3927
  }
3928
3928
  h && (E.thickness = h, p.strokeWidth = h), u && (E.strokeType = u, p.strokeType = u);
3929
3929
  const O = {
3930
- workId: z,
3930
+ workId: A,
3931
3931
  msgType: R.UpdateNode,
3932
3932
  dataType: q.Local,
3933
3933
  updateNodeOpt: E,
@@ -3942,7 +3942,7 @@ class FM extends Ze {
3942
3942
  w.push([
3943
3943
  O,
3944
3944
  {
3945
- workId: z,
3945
+ workId: A,
3946
3946
  msgType: R.UpdateNode,
3947
3947
  emitEventType: this.emitEventType
3948
3948
  }
@@ -4054,8 +4054,8 @@ class VM extends Ze {
4054
4054
  if (C && S === $) {
4055
4055
  if (C.selectIds) {
4056
4056
  for (const E of C.selectIds) {
4057
- const O = M(E, this.serviceColloctor), b = (y = (d = l == null ? void 0 : l[o]) == null ? void 0 : d[a]) == null ? void 0 : y[O];
4058
- b && b.toolsType === T.BackgroundSVG ? (g.push(E), g.sort((L, j) => {
4057
+ const O = M(E, this.serviceColloctor), z = (y = (d = l == null ? void 0 : l[o]) == null ? void 0 : d[a]) == null ? void 0 : y[O];
4058
+ z && z.toolsType === T.BackgroundSVG ? (g.push(E), g.sort((L, j) => {
4059
4059
  var Y, Q, _, ce;
4060
4060
  const F = ((Q = (Y = l[M(L, this.serviceColloctor)]) == null ? void 0 : Y.opt) == null ? void 0 : Q.zIndex) || 0, X = ((ce = (_ = l[M(L, this.serviceColloctor)]) == null ? void 0 : _.opt) == null ? void 0 : ce.zIndex) || 0;
4061
4061
  return F > X ? 1 : L < j ? -1 : 0;
@@ -4065,13 +4065,13 @@ class VM extends Ze {
4065
4065
  return F > X ? 1 : L < j ? -1 : 0;
4066
4066
  }));
4067
4067
  }
4068
- const z = C.updateNodeOpt || {};
4069
- z.zIndexLayer = i;
4068
+ const A = C.updateNodeOpt || {};
4069
+ A.zIndexLayer = i;
4070
4070
  const P = {
4071
4071
  workId: w,
4072
4072
  msgType: R.UpdateNode,
4073
4073
  dataType: q.Local,
4074
- updateNodeOpt: z,
4074
+ updateNodeOpt: A,
4075
4075
  emitEventType: this.emitEventType,
4076
4076
  willRefreshSelector: !0,
4077
4077
  willSyncService: !0,
@@ -4080,15 +4080,15 @@ class VM extends Ze {
4080
4080
  u.length && (i === Lt.Top ? (this.addMaxLayer(o), k = this.getMaxZIndex(o)) : (this.addMinLayer(o), k = this.getMinZIndex(o)), u.forEach((E) => {
4081
4081
  var j, F, X, Y, Q;
4082
4082
  const O = (j = this.serviceColloctor) == null ? void 0 : j.isLocalId(E);
4083
- let b = O && ((F = this.serviceColloctor) == null ? void 0 : F.transformKey(E)) || E;
4084
- const L = (Y = (X = l == null ? void 0 : l[o]) == null ? void 0 : X[a]) == null ? void 0 : Y[b];
4085
- L && (!O && ((Q = this.serviceColloctor) != null && Q.isOwn(b)) && (b = this.serviceColloctor.getLocalId(b)), z.zIndex = k, L != null && L.opt && (L.opt.zIndex = k));
4083
+ let z = O && ((F = this.serviceColloctor) == null ? void 0 : F.transformKey(E)) || E;
4084
+ const L = (Y = (X = l == null ? void 0 : l[o]) == null ? void 0 : X[a]) == null ? void 0 : Y[z];
4085
+ L && (!O && ((Q = this.serviceColloctor) != null && Q.isOwn(z)) && (z = this.serviceColloctor.getLocalId(z)), A.zIndex = k, L != null && L.opt && (L.opt.zIndex = k));
4086
4086
  })), g.length && (i === Lt.Top ? (this.addMaxLayerForBackgroundSVG(o), v = this.getMaxZIndexForBackgroundSVG(o)) : (this.addMinLayerForBackgroundSVG(o), v = this.getMinZIndexForBackgroundSVG(o)), g.forEach((E) => {
4087
4087
  var j, F, X, Y, Q;
4088
4088
  const O = (j = this.serviceColloctor) == null ? void 0 : j.isLocalId(E);
4089
- let b = O && ((F = this.serviceColloctor) == null ? void 0 : F.transformKey(E)) || E;
4090
- const L = (Y = (X = l == null ? void 0 : l[o]) == null ? void 0 : X[a]) == null ? void 0 : Y[b];
4091
- L && (!O && ((Q = this.serviceColloctor) != null && Q.isOwn(b)) && (b = this.serviceColloctor.getLocalId(b)), z.zIndexForBackgroundSVG = v, L != null && L.opt && (L.opt.zIndex = v));
4089
+ let z = O && ((F = this.serviceColloctor) == null ? void 0 : F.transformKey(E)) || E;
4090
+ const L = (Y = (X = l == null ? void 0 : l[o]) == null ? void 0 : X[a]) == null ? void 0 : Y[z];
4091
+ L && (!O && ((Q = this.serviceColloctor) != null && Q.isOwn(z)) && (z = this.serviceColloctor.getLocalId(z)), A.zIndexForBackgroundSVG = v, L != null && L.opt && (L.opt.zIndex = v));
4092
4092
  })), P.willSerializeData = !0, h.push([
4093
4093
  P,
4094
4094
  {
@@ -4142,16 +4142,16 @@ class QM extends Ze {
4142
4142
  a
4143
4143
  );
4144
4144
  if (s === x.Start && (this.cachePosition = v), this.cachePosition) {
4145
- const z = k.updateNodeOpt || {};
4146
- z.translate = [
4145
+ const A = k.updateNodeOpt || {};
4146
+ A.translate = [
4147
4147
  v[0] - this.cachePosition[0],
4148
4148
  v[1] - this.cachePosition[1]
4149
- ], z.workState = s, this.control.cursor.isEnableCursor ? z.useAnimation = !1 : (z.uid = this.serviceColloctor.uid, s === x.Start ? z.useAnimation = !1 : s === x.Done && (z.useAnimation = !0));
4149
+ ], A.workState = s, this.control.cursor.isEnableCursor ? A.useAnimation = !1 : (A.uid = this.serviceColloctor.uid, s === x.Start ? A.useAnimation = !1 : s === x.Done && (A.useAnimation = !0));
4150
4150
  const P = {
4151
4151
  workId: p,
4152
4152
  msgType: R.UpdateNode,
4153
4153
  dataType: q.Local,
4154
- updateNodeOpt: z,
4154
+ updateNodeOpt: A,
4155
4155
  emitEventType: this.emitEventType,
4156
4156
  willSyncService: !0,
4157
4157
  textUpdateForWoker: !0,
@@ -4242,7 +4242,7 @@ class ZM extends Ze {
4242
4242
  return { key: e, textInfo: o };
4243
4243
  }
4244
4244
  async collect(e, t) {
4245
- var f, N, S, C, k, v, z;
4245
+ var f, N, S, C, k, v, A;
4246
4246
  if (!this.serviceColloctor || !this.mainEngine)
4247
4247
  return;
4248
4248
  const {
@@ -4268,10 +4268,10 @@ class ZM extends Ze {
4268
4268
  const P = d.pop();
4269
4269
  if (!P)
4270
4270
  continue;
4271
- const E = P.toString(), O = this.serviceColloctor.isLocalId(E), b = O && this.serviceColloctor.transformKey(P) || E;
4271
+ const E = P.toString(), O = this.serviceColloctor.isLocalId(E), z = O && this.serviceColloctor.transformKey(P) || E;
4272
4272
  let L = E;
4273
4273
  !O && this.serviceColloctor.isOwn(L) && (L = this.serviceColloctor.getLocalId(L));
4274
- const j = (S = (N = y == null ? void 0 : y[s]) == null ? void 0 : N[M]) == null ? void 0 : S[b];
4274
+ const j = (S = (N = y == null ? void 0 : y[s]) == null ? void 0 : N[M]) == null ? void 0 : S[z];
4275
4275
  if (j && L === $ && j.selectIds) {
4276
4276
  const F = j.updateNodeOpt || {};
4277
4277
  if (F.dir = l, F.originPoint = a, F.scenePoint = c, F.workState = o, F.scale = h, F.translate = u, o === x.Start) {
@@ -4287,7 +4287,7 @@ class ZM extends Ze {
4287
4287
  if (this.targetText.size && o !== x.Start && h) {
4288
4288
  const Y = [];
4289
4289
  for (const [_, ce] of this.targetText.entries()) {
4290
- const { opt: ie } = ce, K = Math.floor(ie.fontSize * h[0]), H = this.cacheTextInfo.get(_), fe = !H && ie.fontSize !== K || H && H.fontSize !== K || !1, Je = (z = this.control.textEditorManager.get(_)) == null ? void 0 : z.opt;
4290
+ const { opt: ie } = ce, K = Math.floor(ie.fontSize * h[0]), H = this.cacheTextInfo.get(_), fe = !H && ie.fontSize !== K || H && H.fontSize !== K || !1, Je = (A = this.control.textEditorManager.get(_)) == null ? void 0 : A.opt;
4291
4291
  if (fe && Je && ie.boxSize && ie.boxPoint) {
4292
4292
  const Xe = this.setTextStyle(
4293
4293
  _,
@@ -4361,10 +4361,10 @@ class $M extends Ze {
4361
4361
  const C = h.pop();
4362
4362
  if (!C)
4363
4363
  continue;
4364
- const k = C.toString(), v = this.serviceColloctor.isLocalId(k), z = v && this.serviceColloctor.transformKey(C) || k;
4364
+ const k = C.toString(), v = this.serviceColloctor.isLocalId(k), A = v && this.serviceColloctor.transformKey(C) || k;
4365
4365
  let P = k;
4366
4366
  !v && this.serviceColloctor.isOwn(P) && (P = this.serviceColloctor.getLocalId(P));
4367
- const E = (w = (y = u == null ? void 0 : u[a]) == null ? void 0 : y[l]) == null ? void 0 : w[z];
4367
+ const E = (w = (y = u == null ? void 0 : u[a]) == null ? void 0 : y[l]) == null ? void 0 : w[A];
4368
4368
  if (E && P === $) {
4369
4369
  if (((p = E.selectIds) == null ? void 0 : p.length) === 1) {
4370
4370
  const O = E.selectIds[0];
@@ -4372,13 +4372,13 @@ class $M extends Ze {
4372
4372
  const F = ((f = this.serviceColloctor) == null ? void 0 : f.isLocalId(O)) && ((N = this.serviceColloctor) == null ? void 0 : N.transformKey(O)) || O, X = u[a][l][F];
4373
4373
  this.cacheOriginRotate = ((S = X == null ? void 0 : X.opt) == null ? void 0 : S.rotate) || 0;
4374
4374
  }
4375
- const b = E.updateNodeOpt || {};
4376
- b.angle = (o + this.cacheOriginRotate) % 360, b.workState = s, this.control.cursor.isEnableCursor ? b.useAnimation = !1 : (b.uid = this.serviceColloctor.uid, s === x.Start ? b.useAnimation = !1 : s === x.Done && (b.useAnimation = !0));
4375
+ const z = E.updateNodeOpt || {};
4376
+ z.angle = (o + this.cacheOriginRotate) % 360, z.workState = s, this.control.cursor.isEnableCursor ? z.useAnimation = !1 : (z.uid = this.serviceColloctor.uid, s === x.Start ? z.useAnimation = !1 : s === x.Done && (z.useAnimation = !0));
4377
4377
  const L = {
4378
4378
  workId: C,
4379
4379
  msgType: R.UpdateNode,
4380
4380
  dataType: q.Local,
4381
- updateNodeOpt: b,
4381
+ updateNodeOpt: z,
4382
4382
  emitEventType: this.emitEventType,
4383
4383
  willRefreshSelector: !1,
4384
4384
  willSyncService: !0,
@@ -4454,18 +4454,18 @@ class JM extends Ze {
4454
4454
  ), this.control.textEditorManager.UndoTickerId = y;
4455
4455
  const w = [];
4456
4456
  for (; g.length; ) {
4457
- const z = g.pop();
4458
- if (!z)
4457
+ const A = g.pop();
4458
+ if (!A)
4459
4459
  continue;
4460
- const P = z.toString(), E = this.serviceColloctor.isLocalId(P), O = E ? this.serviceColloctor.transformKey(z) : P;
4461
- let b = P;
4462
- !E && this.serviceColloctor.isOwn(b) && (b = this.serviceColloctor.getLocalId(b));
4460
+ const P = A.toString(), E = this.serviceColloctor.isLocalId(P), O = E ? this.serviceColloctor.transformKey(A) : P;
4461
+ let z = P;
4462
+ !E && this.serviceColloctor.isOwn(z) && (z = this.serviceColloctor.getLocalId(z));
4463
4463
  const L = (N = (f = M == null ? void 0 : M[c]) == null ? void 0 : f[u]) == null ? void 0 : N[O];
4464
4464
  if (L) {
4465
4465
  const j = L.updateNodeOpt || {};
4466
4466
  if (i && (j.bold = i, d.bold = i === "bold"), o && (j.italic = o, d.italic = o === "italic"), We(s) && (j.lineThrough = s, d.lineThrough = s), We(a) && (j.underline = a, d.underline = a), l && (j.fontSize = l, d.textSize = l), L.toolsType === T.Text && L.opt) {
4467
4467
  const F = this.setTextStyle(
4468
- b,
4468
+ z,
4469
4469
  se(L),
4470
4470
  j,
4471
4471
  c
@@ -4473,7 +4473,7 @@ class JM extends Ze {
4473
4473
  w.push(F);
4474
4474
  continue;
4475
4475
  }
4476
- if (L && b === $ && ((S = L.selectIds) != null && S.length))
4476
+ if (L && z === $ && ((S = L.selectIds) != null && S.length))
4477
4477
  for (const F of L.selectIds) {
4478
4478
  const X = (C = this.serviceColloctor) == null ? void 0 : C.isLocalId(F);
4479
4479
  let Y = X && ((k = this.serviceColloctor) == null ? void 0 : k.transformKey(F)) || F;
@@ -4492,14 +4492,14 @@ class JM extends Ze {
4492
4492
  }
4493
4493
  }
4494
4494
  const p = await Promise.all(w);
4495
- for (const z of p)
4496
- if (z) {
4497
- const { key: P, textInfo: E } = z;
4495
+ for (const A of p)
4496
+ if (A) {
4497
+ const { key: P, textInfo: E } = A;
4498
4498
  E && (E.canSync = !0, E.canWorker = !0, this.control.textEditorManager.updateForViewEdited(P, E));
4499
4499
  }
4500
4500
  Object.keys(d).length && (this.timerId && (clearTimeout(this.timerId), this.timerId = void 0), this.timerId = setTimeout(() => {
4501
- var z;
4502
- this.timerId = void 0, (z = this.control.room) == null || z.setMemberState(d);
4501
+ var A;
4502
+ this.timerId = void 0, (A = this.control.room) == null || A.setMemberState(d);
4503
4503
  }, 0));
4504
4504
  }
4505
4505
  }
@@ -5033,7 +5033,7 @@ class tp extends ep {
5033
5033
  }
5034
5034
  async useBackgroundThread() {
5035
5035
  console.info("use background thread");
5036
- const { BackgroundThreadManagerImpl: e } = await import("./index-CpRTvTdJ.mjs");
5036
+ const { BackgroundThreadManagerImpl: e } = await import("./index-DFQ4hkMe.mjs");
5037
5037
  this.backgroundThreadManager = new e(this);
5038
5038
  }
5039
5039
  async useMainThread() {
@@ -5042,7 +5042,7 @@ class tp extends ep {
5042
5042
  "set font faces in main thread success"
5043
5043
  );
5044
5044
  });
5045
- const { MainThreadManagerImpl: e } = await import("./index-MwM-TUUF.mjs");
5045
+ const { MainThreadManagerImpl: e } = await import("./index-B9IvzEGP.mjs");
5046
5046
  this.mainThread = new e(this);
5047
5047
  }
5048
5048
  async on() {
@@ -5268,11 +5268,11 @@ class tp extends ep {
5268
5268
  op: C,
5269
5269
  canTextEdit: k,
5270
5270
  points: v,
5271
- selectorColor: z,
5271
+ selectorColor: A,
5272
5272
  canRotate: P,
5273
5273
  scaleType: E,
5274
5274
  textOpt: O,
5275
- toolsType: b,
5275
+ toolsType: z,
5276
5276
  workId: L,
5277
5277
  viewId: j,
5278
5278
  dataType: F,
@@ -5307,7 +5307,7 @@ class tp extends ep {
5307
5307
  switch (l) {
5308
5308
  case R.Select: {
5309
5309
  const B = h != null && h.length ? { ...g, selectIds: h, canvasHeight: f, canvasWidth: N, points: v } : void 0;
5310
- B && (u != null && u.strokeColor) && (B.selectorColor = u.strokeColor), B && z && (B.selectorColor = z), B && M && (B.strokeColor = M), B && (u != null && u.fillColor) && (B.fillColor = u.fillColor), B && d && (B.fillColor = d), B && We(P) && (B.canRotate = P), B && E && (B.scaleType = E), B && k && (B.canTextEdit = k), B && O && (B.textOpt = O), B && We(X) && (B.canLock = X), B && We(Y) && (B.isLocked = Y), B && Q && (B.shapeOpt = Q), B && _ && (B.toolsTypes = _), B && ce && (B.thickness = ce), B && ie && (B.strokeType = ie), B && We(K) && (B.useStroke = K), j && this.viewContainerManager.showFloatBar(j, !!B, B), y && ((i = this.collector) == null || i.dispatch({
5310
+ B && (u != null && u.strokeColor) && (B.selectorColor = u.strokeColor), B && A && (B.selectorColor = A), B && M && (B.strokeColor = M), B && (u != null && u.fillColor) && (B.fillColor = u.fillColor), B && d && (B.fillColor = d), B && We(P) && (B.canRotate = P), B && E && (B.scaleType = E), B && k && (B.canTextEdit = k), B && O && (B.textOpt = O), B && We(X) && (B.canLock = X), B && We(Y) && (B.isLocked = Y), B && Q && (B.shapeOpt = Q), B && _ && (B.toolsTypes = _), B && ce && (B.thickness = ce), B && ie && (B.strokeType = ie), B && We(K) && (B.useStroke = K), j && this.viewContainerManager.showFloatBar(j, !!B, B), y && ((i = this.collector) == null || i.dispatch({
5311
5311
  type: l,
5312
5312
  selectIds: h,
5313
5313
  opt: u,
@@ -5362,7 +5362,7 @@ class tp extends ep {
5362
5362
  });
5363
5363
  break;
5364
5364
  case R.TextUpdate:
5365
- if (b === T.Text && L && j) {
5365
+ if (z === T.Text && L && j) {
5366
5366
  const B = this.viewContainerManager.transformToOriginPoint(
5367
5367
  (u == null ? void 0 : u.boxPoint) || [0, 0],
5368
5368
  j
@@ -5388,7 +5388,7 @@ class tp extends ep {
5388
5388
  }
5389
5389
  break;
5390
5390
  case R.GetTextActive:
5391
- b === T.Text && L && j && this.control.textEditorManager.updateTextForWorker(
5391
+ z === T.Text && L && j && this.control.textEditorManager.updateTextForWorker(
5392
5392
  {
5393
5393
  workId: L,
5394
5394
  isActive: !0,
@@ -5467,8 +5467,7 @@ class tp extends ep {
5467
5467
  viewId: f,
5468
5468
  isLockSentEventCursor: N,
5469
5469
  nextTasks: S,
5470
- needUndoTicker: C,
5471
- willSyncService: k
5470
+ needUndoTicker: C
5472
5471
  } = a;
5473
5472
  if (!f) {
5474
5473
  console.error(
@@ -5477,7 +5476,7 @@ class tp extends ep {
5477
5476
  );
5478
5477
  return;
5479
5478
  }
5480
- const v = a.scenePath || this.viewContainerManager.getCurScenePath(f);
5479
+ const k = a.scenePath || this.viewContainerManager.getCurScenePath(f);
5481
5480
  switch (c) {
5482
5481
  case R.None: {
5483
5482
  N && ot(
@@ -5505,7 +5504,7 @@ class tp extends ep {
5505
5504
  index: u,
5506
5505
  isSync: p,
5507
5506
  viewId: f,
5508
- scenePath: v,
5507
+ scenePath: k,
5509
5508
  updateNodeOpt: y
5510
5509
  });
5511
5510
  break;
@@ -5520,12 +5519,12 @@ class tp extends ep {
5520
5519
  toolsType: w,
5521
5520
  isSync: p,
5522
5521
  viewId: f,
5523
- scenePath: v
5524
- }), console.log("markmapIdResolveMap====>FullWork===>000", h, w, k), w === T.BackgroundSVG && h && (console.log("markmapIdResolveMap====>FullWork", h), this.markmapIdResolveMap.has(h.toString()))) {
5525
- const z = this.markmapIdResolveMap.get(
5522
+ scenePath: k
5523
+ }), w === T.BackgroundSVG && h && this.markmapIdResolveMap.has(h.toString())) {
5524
+ const v = this.markmapIdResolveMap.get(
5526
5525
  h.toString()
5527
5526
  );
5528
- z != null && z.timer && (clearTimeout(z.timer), z.timer = void 0, console.log("markmapIdResolveMap====>clearTimeout", h.toString())), z != null && z.resolve && (z.resolve(h.toString()), console.log("markmapIdResolveMap====>resolve", h.toString())), console.log("markmapIdResolveMap====>delete", h.toString()), this.markmapIdResolveMap.delete(h.toString());
5527
+ v != null && v.timer && (clearTimeout(v.timer), v.timer = void 0), v != null && v.resolve && v.resolve(h.toString()), this.markmapIdResolveMap.delete(h.toString());
5529
5528
  }
5530
5529
  this.willSelectorWorkId && h && h.toString() === this.willSelectorWorkId && this.control.runEffectWork(() => {
5531
5530
  this.setShapeSelectorByWorkId(
@@ -5545,7 +5544,7 @@ class tp extends ep {
5545
5544
  op: l,
5546
5545
  isSync: p,
5547
5546
  viewId: f,
5548
- scenePath: v
5547
+ scenePath: k
5549
5548
  });
5550
5549
  break;
5551
5550
  }
@@ -5555,7 +5554,7 @@ class tp extends ep {
5555
5554
  removeIds: g,
5556
5555
  isSync: p,
5557
5556
  viewId: f,
5558
- scenePath: v
5557
+ scenePath: k
5559
5558
  }), this.willSelectorWorkId && (g != null && g.includes(this.willSelectorWorkId)) && (this.willSelectorWorkId = void 0);
5560
5559
  break;
5561
5560
  }
@@ -5890,9 +5889,9 @@ class tp extends ep {
5890
5889
  return;
5891
5890
  v.isRunBackgroundThread = !0;
5892
5891
  }
5893
- if (v.dataType = q.Service, v.viewId = s, v.scenePath = a, v.useAnimation = this.smoothSync && ((S = v.updateNodeOpt) == null ? void 0 : S.useAnimation) || !1, v.selectIds && (v.selectIds = v.selectIds.map((z) => {
5892
+ if (v.dataType = q.Service, v.viewId = s, v.scenePath = a, v.useAnimation = this.smoothSync && ((S = v.updateNodeOpt) == null ? void 0 : S.useAnimation) || !1, v.selectIds && (v.selectIds = v.selectIds.map((A) => {
5894
5893
  var P, E;
5895
- return (P = this.collector) != null && P.isOwn(z) ? (E = this.collector) == null ? void 0 : E.getLocalId(z) : z;
5894
+ return (P = this.collector) != null && P.isOwn(A) ? (E = this.collector) == null ? void 0 : E.getLocalId(A) : A;
5896
5895
  })), v && v.toolsType === T.Text || (o == null ? void 0 : o.toolsType) === T.Text) {
5897
5896
  this.control.textEditorManager.onServiceDerive(v);
5898
5897
  return;
@@ -6570,14 +6569,14 @@ class tp extends ep {
6570
6569
  resolve: h,
6571
6570
  timer: setTimeout(() => {
6572
6571
  const g = this.markmapIdResolveMap.get(a);
6573
- g != null && g.timer && (g.timer = void 0), console.log("markmapIdResolveMap====>timeout", a), u(a);
6572
+ g != null && g.timer && (g.timer = void 0), u(a);
6574
6573
  }, this.control.pluginOptions.extras.markmap.timeout)
6575
- }), console.log("markmapIdResolveMap====>set", a);
6574
+ });
6576
6575
  }).then((h) => {
6577
- if (console.log("markmapIdResolveMap====>then", h), h)
6576
+ if (h)
6578
6577
  return this.markmapIdResolveMap.delete(h), h;
6579
6578
  }).catch((h) => {
6580
- throw console.log("markmapIdResolveMap====>error", h), this.markmapIdResolveMap.delete(h), new Error(
6579
+ throw this.markmapIdResolveMap.delete(h), new Error(
6581
6580
  `instertBackgroundMarkMap svgInfo.uuid ${h} insert timeout`
6582
6581
  );
6583
6582
  });
@@ -8696,19 +8695,19 @@ const rt = class rt {
8696
8695
  return !!e.includes(t);
8697
8696
  }
8698
8697
  refreshPlugin(n, e = !1) {
8699
- var a, c, l, h, u, g, M, d, y, w, p, f, N, S, C, k, v, z, P, E, O;
8698
+ var a, c, l, h, u, g, M, d, y, w, p, f, N, S, C, k, v, A, P, E, O;
8700
8699
  let t;
8701
8700
  const { scenePath: i } = n, o = n.data;
8702
8701
  if (!o || !this.collector)
8703
8702
  return;
8704
8703
  const s = se(this.collector.storage);
8705
- for (const b of o.values()) {
8706
- const { dataType: L, data: j, key: F } = b, X = this.collector.getStorageData(this.viewId, i), Y = X && Object.keys(X) || [];
8704
+ for (const z of o.values()) {
8705
+ const { dataType: L, data: j, key: F } = z, X = this.collector.getStorageData(this.viewId, i), Y = X && Object.keys(X) || [];
8707
8706
  switch (L) {
8708
8707
  case Ve.Draw:
8709
- if (t = e ? this.isDrawEffectiveScene(b, Y) : this.isDeleteEffectiveScene(b, Y), t)
8708
+ if (t = e ? this.isDrawEffectiveScene(z, Y) : this.isDeleteEffectiveScene(z, Y), t)
8710
8709
  if (e && !Array.isArray(j)) {
8711
- if ((a = j.updateNodeOpt) != null && a.useAnimation && (j.updateNodeOpt.useAnimation = !1), ((c = this.collector) == null ? void 0 : c.getLocalId(F)) === $ && ((l = this.collector) != null && l.isOwn(b.key))) {
8710
+ if ((a = j.updateNodeOpt) != null && a.useAnimation && (j.updateNodeOpt.useAnimation = !1), ((c = this.collector) == null ? void 0 : c.getLocalId(F)) === $ && ((l = this.collector) != null && l.isOwn(z.key))) {
8712
8711
  const Q = j.selectIds;
8713
8712
  if (Q) {
8714
8713
  const _ = Y.filter(
@@ -8729,13 +8728,13 @@ const rt = class rt {
8729
8728
  ce && (j.selectIds = Q.filter((ie) => !!ie));
8730
8729
  }
8731
8730
  }
8732
- (u = this.collector) == null || u.updateValue(b.key, j, {
8731
+ (u = this.collector) == null || u.updateValue(z.key, j, {
8733
8732
  viewId: this.viewId,
8734
8733
  scenePath: i,
8735
8734
  isSync: !0,
8736
8735
  storage: s
8737
8736
  });
8738
- } else !e && !Array.isArray(b.data) && ((g = this.collector) == null || g.updateValue(b.key, void 0, {
8737
+ } else !e && !Array.isArray(z.data) && ((g = this.collector) == null || g.updateValue(z.key, void 0, {
8739
8738
  viewId: this.viewId,
8740
8739
  scenePath: i,
8741
8740
  isSync: !0,
@@ -8743,7 +8742,7 @@ const rt = class rt {
8743
8742
  }));
8744
8743
  break;
8745
8744
  case Ve.Delete:
8746
- if (t = e ? this.isDeleteEffectiveScene(b, Y) : this.isDrawEffectiveScene(b, Y), t) {
8745
+ if (t = e ? this.isDeleteEffectiveScene(z, Y) : this.isDrawEffectiveScene(z, Y), t) {
8747
8746
  if (e && !Array.isArray(j))
8748
8747
  (M = this.collector) == null || M.updateValue(F, void 0, {
8749
8748
  viewId: this.viewId,
@@ -8752,7 +8751,7 @@ const rt = class rt {
8752
8751
  storage: s
8753
8752
  });
8754
8753
  else if (!e && !Array.isArray(j)) {
8755
- if ((d = j.updateNodeOpt) != null && d.useAnimation && (j.updateNodeOpt.useAnimation = !1), ((y = this.collector) == null ? void 0 : y.getLocalId(b.key)) === $ && ((w = this.collector) != null && w.isOwn(b.key))) {
8754
+ if ((d = j.updateNodeOpt) != null && d.useAnimation && (j.updateNodeOpt.useAnimation = !1), ((y = this.collector) == null ? void 0 : y.getLocalId(z.key)) === $ && ((w = this.collector) != null && w.isOwn(z.key))) {
8756
8755
  const Q = j.selectIds;
8757
8756
  if (Q) {
8758
8757
  const _ = Y.filter(
@@ -8773,7 +8772,7 @@ const rt = class rt {
8773
8772
  ce && (j.selectIds = Q.filter((ie) => !!ie));
8774
8773
  }
8775
8774
  }
8776
- (f = this.collector) == null || f.updateValue(b.key, b.data, {
8775
+ (f = this.collector) == null || f.updateValue(z.key, z.data, {
8777
8776
  viewId: this.viewId,
8778
8777
  scenePath: i,
8779
8778
  isSync: !0,
@@ -8783,10 +8782,10 @@ const rt = class rt {
8783
8782
  }
8784
8783
  break;
8785
8784
  case Ve.Update:
8786
- if (t = e ? this.isNewEffectiveScene(b, Y) : this.isOldEffectiveScene(b, Y), t) {
8785
+ if (t = e ? this.isNewEffectiveScene(z, Y) : this.isOldEffectiveScene(z, Y), t) {
8787
8786
  if (e && Array.isArray(j) && j.length === 2) {
8788
8787
  const Q = j[1];
8789
- if ((N = Q.updateNodeOpt) != null && N.useAnimation && (Q.updateNodeOpt.useAnimation = !1), ((S = this.collector) == null ? void 0 : S.getLocalId(b.key)) === $ && ((C = this.collector) != null && C.isOwn(b.key))) {
8788
+ if ((N = Q.updateNodeOpt) != null && N.useAnimation && (Q.updateNodeOpt.useAnimation = !1), ((S = this.collector) == null ? void 0 : S.getLocalId(z.key)) === $ && ((C = this.collector) != null && C.isOwn(z.key))) {
8790
8789
  const _ = Q.selectIds;
8791
8790
  if (_) {
8792
8791
  const ce = Y.filter(
@@ -8815,7 +8814,7 @@ const rt = class rt {
8815
8814
  });
8816
8815
  } else if (!e && Array.isArray(j) && j.length === 2) {
8817
8816
  const Q = j[0];
8818
- if ((z = Q.updateNodeOpt) != null && z.useAnimation && (Q.updateNodeOpt.useAnimation = !1), ((P = this.collector) == null ? void 0 : P.getLocalId(b.key)) === $ && ((E = this.collector) != null && E.isOwn(b.key))) {
8817
+ if ((A = Q.updateNodeOpt) != null && A.useAnimation && (Q.updateNodeOpt.useAnimation = !1), ((P = this.collector) == null ? void 0 : P.getLocalId(z.key)) === $ && ((E = this.collector) != null && E.isOwn(z.key))) {
8819
8818
  const _ = Q.selectIds;
8820
8819
  if (_) {
8821
8820
  const ce = Y.filter(
@@ -8836,7 +8835,7 @@ const rt = class rt {
8836
8835
  ie && (Q.selectIds = _.filter((K) => !!K));
8837
8836
  }
8838
8837
  }
8839
- (O = this.collector) == null || O.updateValue(b.key, Q, {
8838
+ (O = this.collector) == null || O.updateValue(z.key, Q, {
8840
8839
  viewId: this.viewId,
8841
8840
  scenePath: i,
8842
8841
  isSync: !0,
@@ -9018,18 +9017,18 @@ class Et {
9018
9017
  imageBitmap: C,
9019
9018
  isClear: k,
9020
9019
  isUnClose: v,
9021
- drawCanvas: z,
9020
+ drawCanvas: A,
9022
9021
  clearCanvas: P,
9023
9022
  viewId: E
9024
9023
  } = N, O = (e = this.getView(E)) == null ? void 0 : e.displayer;
9025
9024
  if (O && S) {
9026
9025
  const {
9027
- dpr: b,
9026
+ dpr: z,
9028
9027
  canvasBgRef: L,
9029
9028
  canvasFloatRef: j,
9030
9029
  canvasServiceFloatRef: F,
9031
9030
  canvasTopRef: X
9032
- } = O, Y = Math.floor(S.w * b), Q = Math.floor(S.h * b), _ = S.x * b, ce = S.y * b;
9031
+ } = O, Y = Math.floor(S.w * z), Q = Math.floor(S.h * z), _ = S.x * z, ce = S.y * z;
9033
9032
  if (k) {
9034
9033
  switch (P) {
9035
9034
  case nt.TopFloat:
@@ -9047,8 +9046,8 @@ class Et {
9047
9046
  }
9048
9047
  continue;
9049
9048
  }
9050
- if (z && C)
9051
- switch (z) {
9049
+ if (A && C)
9050
+ switch (A) {
9052
9051
  case nt.TopFloat:
9053
9052
  (g = (u = X == null ? void 0 : X.current) == null ? void 0 : u.getContext("2d")) == null || g.drawImage(C, 0, 0, Y, Q, _, ce, Y, Q);
9054
9053
  break;
@@ -11118,13 +11117,13 @@ const kp = (r) => {
11118
11117
  /* none */
11119
11118
  ), [u, g] = m.useState(), M = xe(null);
11120
11119
  ge(() => {
11121
- var E, O, b, L;
11122
- const v = {}, z = (a == null ? void 0 : a.w) || ((E = n == null ? void 0 : n.boxSize) == null ? void 0 : E[0]) || 0, P = (a == null ? void 0 : a.h) || ((O = n == null ? void 0 : n.boxSize) == null ? void 0 : O[1]) || 0;
11123
- if (i && z && P && (c != null && c.width) && (c != null && c.height)) {
11120
+ var E, O, z, L;
11121
+ const v = {}, A = (a == null ? void 0 : a.w) || ((E = n == null ? void 0 : n.boxSize) == null ? void 0 : E[0]) || 0, P = (a == null ? void 0 : a.h) || ((O = n == null ? void 0 : n.boxSize) == null ? void 0 : O[1]) || 0;
11122
+ if (i && A && P && (c != null && c.width) && (c != null && c.height)) {
11124
11123
  if (i.y < 60 ? i.y + P < c.height - 60 ? v.bottom = -120 : i.y + P < c.height ? v.bottom = -58 : i.y > 0 ? v.top = 62 : v.top = -i.y + 62 : v.top = 0, i.x < 0)
11125
11124
  v.left = -i.x + 3;
11126
- else if (i.x + (((b = M.current) == null ? void 0 : b.offsetWidth) || z) > c.width) {
11127
- const j = c.width - (((L = M.current) == null ? void 0 : L.offsetWidth) || z) - i.x;
11125
+ else if (i.x + (((z = M.current) == null ? void 0 : z.offsetWidth) || A) > c.width) {
11126
+ const j = c.width - (((L = M.current) == null ? void 0 : L.offsetWidth) || A) - i.x;
11128
11127
  v.left = j;
11129
11128
  }
11130
11129
  g(v);
@@ -11269,7 +11268,7 @@ const kp = (r) => {
11269
11268
  textAlign: C,
11270
11269
  strokeColor: k,
11271
11270
  lineHeight: v,
11272
- bold: z,
11271
+ bold: A,
11273
11272
  italic: P
11274
11273
  } = s, E = v || w * 1.2, O = {
11275
11274
  fontSize: `${w}px`,
@@ -11281,7 +11280,7 @@ const kp = (r) => {
11281
11280
  pointerEvents: "none",
11282
11281
  paddingRight: `${P === "italic" ? Math.round(w * 0.3) : 5}px`
11283
11282
  };
11284
- return p && (O.fontFamily = `${p}`), (S || f) && (O.textDecoration = `${S && "line-through" || ""}${f && " underline" || ""}`), C && (O.textAlign = `${C}`), z && (O.fontWeight = `${z}`), P && (O.fontStyle = `${P}`), O;
11283
+ return p && (O.fontFamily = `${p}`), (S || f) && (O.textDecoration = `${S && "line-through" || ""}${f && " underline" || ""}`), C && (O.textAlign = `${C}`), A && (O.fontWeight = `${A}`), P && (O.fontStyle = `${P}`), O;
11285
11284
  }, [s]), d = J(() => {
11286
11285
  const w = [];
11287
11286
  if (s.text) {
@@ -11407,7 +11406,7 @@ const kp = (r) => {
11407
11406
  lineThrough: C,
11408
11407
  textAlign: k,
11409
11408
  lineHeight: v,
11410
- bold: z,
11409
+ bold: A,
11411
11410
  italic: P
11412
11411
  } = g, E = xe(null), O = J(() => {
11413
11412
  const V = p, B = v || V * 1.2, Z = {
@@ -11419,9 +11418,9 @@ const kp = (r) => {
11419
11418
  paddingRight: `${P === "italic" ? Math.round(V * 0.3) : 5}px`,
11420
11419
  borderWidth: 0
11421
11420
  };
11422
- return f && (Z.fontFamily = `${f}`), (C || N) && (Z.textDecoration = `${C && "line-through" || ""} ${N && " underline" || ""}`), k && (Z.textAlign = `${k}`), z && (Z.fontWeight = `${z}`), P && (Z.fontStyle = `${P}`), Z;
11421
+ return f && (Z.fontFamily = `${f}`), (C || N) && (Z.textDecoration = `${C && "line-through" || ""} ${N && " underline" || ""}`), k && (Z.textAlign = `${k}`), A && (Z.fontWeight = `${A}`), P && (Z.fontStyle = `${P}`), Z;
11423
11422
  }, [
11424
- z,
11423
+ A,
11425
11424
  S,
11426
11425
  f,
11427
11426
  p,
@@ -11431,7 +11430,7 @@ const kp = (r) => {
11431
11430
  M,
11432
11431
  k,
11433
11432
  N
11434
- ]), b = xe(!1), L = xe(6), j = xe({
11433
+ ]), z = xe(!1), L = xe(6), j = xe({
11435
11434
  fontSize: O.fontSize,
11436
11435
  lineHeight: O.lineHeight,
11437
11436
  fontStyle: O.fontStyle,
@@ -11719,7 +11718,7 @@ const kp = (r) => {
11719
11718
  const V = E.current;
11720
11719
  s(() => {
11721
11720
  if (V) {
11722
- if (Je(V), !b.current && ce((M || 1) * L.current)) {
11721
+ if (Je(V), !z.current && ce((M || 1) * L.current)) {
11723
11722
  const B = window.getSelection();
11724
11723
  if (!(B != null && B.rangeCount)) return !1;
11725
11724
  const Z = document.createRange(), oe = E.current.lastChild;
@@ -11730,10 +11729,10 @@ const kp = (r) => {
11730
11729
  });
11731
11730
  }, [s, i, ce, M]);
11732
11731
  function ht() {
11733
- b.current = !0, s();
11732
+ z.current = !0, s();
11734
11733
  }
11735
11734
  function tt() {
11736
- b.current = !1, Xe();
11735
+ z.current = !1, Xe();
11737
11736
  }
11738
11737
  function Ke() {
11739
11738
  Xe(), s();
@@ -12116,19 +12115,19 @@ const kp = (r) => {
12116
12115
  f(!1);
12117
12116
  }, k = (E, O) => {
12118
12117
  N.current && (clearTimeout(N.current), N.current = 0), c(x.Done), g(!1);
12119
- const b = Math.round(
12118
+ const z = Math.round(
12120
12119
  ve.GetAngleByPoints(
12121
12120
  M,
12122
12121
  y,
12123
12122
  new ve(O.x, O.y)
12124
12123
  )
12125
12124
  ) || 0;
12126
- i(b), o(W.None), re.emitMethod(
12125
+ i(z), o(W.None), re.emitMethod(
12127
12126
  te.MainEngine,
12128
12127
  W.RotateNode,
12129
12128
  {
12130
12129
  workIds: [$],
12131
- angle: b,
12130
+ angle: z,
12132
12131
  workState: x.Done,
12133
12132
  viewId: s == null ? void 0 : s.viewId
12134
12133
  }
@@ -12154,14 +12153,14 @@ const kp = (r) => {
12154
12153
  return;
12155
12154
  }
12156
12155
  N.current && (clearTimeout(N.current), N.current = 0), c(x.Start), g(!0);
12157
- const b = Math.round(
12156
+ const z = Math.round(
12158
12157
  ve.GetAngleByPoints(
12159
12158
  M,
12160
12159
  y,
12161
12160
  new ve(O.x, O.y)
12162
12161
  )
12163
12162
  ) || 0;
12164
- i(b), o(W.RotateNode), re.emitMethod(
12163
+ i(z), o(W.RotateNode), re.emitMethod(
12165
12164
  te.MainEngine,
12166
12165
  W.RotateNode,
12167
12166
  {
@@ -12171,7 +12170,7 @@ const kp = (r) => {
12171
12170
  viewId: s == null ? void 0 : s.viewId
12172
12171
  }
12173
12172
  );
12174
- }, z = (E, O) => {
12173
+ }, A = (E, O) => {
12175
12174
  if (s != null && s.control.worker.isBusy) {
12176
12175
  f(!0), k(E, O);
12177
12176
  return;
@@ -12184,19 +12183,19 @@ const kp = (r) => {
12184
12183
  }
12185
12184
  N.current || (h({ x: O.x, y: O.y }), g(!0), N.current = setTimeout(() => {
12186
12185
  N.current = 0;
12187
- const b = Math.round(
12186
+ const z = Math.round(
12188
12187
  ve.GetAngleByPoints(
12189
12188
  M,
12190
12189
  y,
12191
12190
  new ve(O.x, O.y)
12192
12191
  )
12193
12192
  ) || 0;
12194
- i(b), o(W.RotateNode), c(x.Doing), re.emitMethod(
12193
+ i(z), o(W.RotateNode), c(x.Doing), re.emitMethod(
12195
12194
  te.MainEngine,
12196
12195
  W.RotateNode,
12197
12196
  {
12198
12197
  workIds: [$],
12199
- angle: b,
12198
+ angle: z,
12200
12199
  workState: x.Doing,
12201
12200
  viewId: s == null ? void 0 : s.viewId
12202
12201
  }
@@ -12210,7 +12209,7 @@ const kp = (r) => {
12210
12209
  position: l,
12211
12210
  onStart: v,
12212
12211
  onDrag: P,
12213
- onStop: z
12212
+ onStop: A
12214
12213
  },
12215
12214
  /* @__PURE__ */ m.createElement(
12216
12215
  "div",
@@ -12258,9 +12257,9 @@ const kp = (r) => {
12258
12257
  return;
12259
12258
  }
12260
12259
  h(!1);
12261
- }, p = (v, z) => {
12260
+ }, p = (v, A) => {
12262
12261
  u.current && (clearTimeout(u.current), u.current = 0);
12263
- const P = { x: z.x, y: z.y };
12262
+ const P = { x: A.x, y: A.y };
12264
12263
  i(W.None), M.current = x.Done, c(P), re.emitMethod(
12265
12264
  te.MainEngine,
12266
12265
  W.TranslateNode,
@@ -12298,25 +12297,25 @@ const kp = (r) => {
12298
12297
  viewId: o == null ? void 0 : o.viewId
12299
12298
  }
12300
12299
  ));
12301
- }, N = (v, z) => {
12300
+ }, N = (v, A) => {
12302
12301
  var O;
12303
12302
  o != null && o.control.worker.isBusy && h(!0);
12304
12303
  const P = M.current, E = g.current;
12305
- if (p(v, z), g.current && (g.current = void 0), P === x.Start && (n != null && n.size) && E) {
12306
- const b = (O = o == null ? void 0 : o.control.viewContainerManager.getView(
12304
+ if (p(v, A), g.current && (g.current = void 0), P === x.Start && (n != null && n.size) && E) {
12305
+ const z = (O = o == null ? void 0 : o.control.viewContainerManager.getView(
12307
12306
  o.viewId
12308
12307
  )) == null ? void 0 : O.focusScenePath;
12309
- b && (o == null || o.control.worker.blurSelector(o.viewId, b));
12308
+ z && (o == null || o.control.worker.blurSelector(o.viewId, z));
12310
12309
  }
12311
12310
  o == null || o.focusElement();
12312
- }, S = (v, z) => {
12311
+ }, S = (v, A) => {
12313
12312
  if (o != null && o.control.worker.isBusy) {
12314
- h(!0), p(v, z);
12313
+ h(!0), p(v, A);
12315
12314
  return;
12316
12315
  }
12317
12316
  if (u.current)
12318
12317
  return;
12319
- const P = { x: z.x, y: z.y };
12318
+ const P = { x: A.x, y: A.y };
12320
12319
  c(P), u.current = setTimeout(() => {
12321
12320
  u.current = 0, (P.x !== (a == null ? void 0 : a.x) || P.y !== (a == null ? void 0 : a.y)) && (g.current && (g.current = void 0), M.current = x.Doing, re.emitMethod(
12322
12321
  te.MainEngine,
@@ -12398,7 +12397,7 @@ const kp = (r) => {
12398
12397
  }, [u == null ? void 0 : u.control.worker.isBusy]);
12399
12398
  const N = () => {
12400
12399
  if (f.current && (clearTimeout(f.current), f.current = 0), d) {
12401
- const { scale: O, translate: b } = d;
12400
+ const { scale: O, translate: z } = d;
12402
12401
  M(W.None), re.emitMethod(
12403
12402
  te.MainEngine,
12404
12403
  W.ScaleNode,
@@ -12406,7 +12405,7 @@ const kp = (r) => {
12406
12405
  workIds: [$],
12407
12406
  scale: O,
12408
12407
  dir: c,
12409
- translate: b,
12408
+ translate: z,
12410
12409
  originPoint: i,
12411
12410
  scenePoint: s,
12412
12411
  workState: x.Done,
@@ -12426,8 +12425,8 @@ const kp = (r) => {
12426
12425
  [O.x + O.w, O.y],
12427
12426
  [O.x + O.w, O.y + O.h],
12428
12427
  [O.x, O.y + O.h]
12429
- ], k = (O, b) => {
12430
- switch (b) {
12428
+ ], k = (O, z) => {
12429
+ switch (z) {
12431
12430
  case "top":
12432
12431
  case "topLeft":
12433
12432
  case "left":
@@ -12441,7 +12440,7 @@ const kp = (r) => {
12441
12440
  case "bottomLeft":
12442
12441
  return O[1];
12443
12442
  }
12444
- }, v = (O, b, L, j) => {
12443
+ }, v = (O, z, L, j) => {
12445
12444
  let F = !1, X = !1;
12446
12445
  const Y = {
12447
12446
  x: e.x,
@@ -12451,51 +12450,51 @@ const kp = (r) => {
12451
12450
  }, Q = [1, 1], _ = [0, 0];
12452
12451
  switch (O) {
12453
12452
  case "top": {
12454
- const H = b.height + e.h;
12455
- H < 0 ? (X = !0, Y.y = e.y + e.h, Y.h = Math.abs(H)) : (Y.y = e.y - b.height, Y.h = e.h + b.height);
12453
+ const H = z.height + e.h;
12454
+ H < 0 ? (X = !0, Y.y = e.y + e.h, Y.h = Math.abs(H)) : (Y.y = e.y - z.height, Y.h = e.h + z.height);
12456
12455
  break;
12457
12456
  }
12458
12457
  case "topLeft": {
12459
- const H = b.width + e.w;
12460
- H < 0 ? (F = !0, Y.x = e.x + e.w, Y.w = Math.abs(H)) : (Y.x = e.x - b.width, Y.w = e.w + b.width);
12461
- const fe = b.height + e.h;
12462
- fe < 0 ? (X = !0, Y.y = e.y + e.h, Y.h = Math.abs(fe)) : (Y.y = e.y - b.height, Y.h = e.h + b.height);
12458
+ const H = z.width + e.w;
12459
+ H < 0 ? (F = !0, Y.x = e.x + e.w, Y.w = Math.abs(H)) : (Y.x = e.x - z.width, Y.w = e.w + z.width);
12460
+ const fe = z.height + e.h;
12461
+ fe < 0 ? (X = !0, Y.y = e.y + e.h, Y.h = Math.abs(fe)) : (Y.y = e.y - z.height, Y.h = e.h + z.height);
12463
12462
  break;
12464
12463
  }
12465
12464
  case "topRight": {
12466
- const H = b.width + e.w;
12467
- H < 0 ? (F = !0, Y.x = e.x + H, Y.w = Math.abs(H)) : Y.w = e.w + b.width;
12468
- const fe = b.height + e.h;
12469
- fe < 0 ? (X = !0, Y.y = e.y + e.h, Y.h = Math.abs(fe)) : (Y.y = e.y - b.height, Y.h = e.h + b.height);
12465
+ const H = z.width + e.w;
12466
+ H < 0 ? (F = !0, Y.x = e.x + H, Y.w = Math.abs(H)) : Y.w = e.w + z.width;
12467
+ const fe = z.height + e.h;
12468
+ fe < 0 ? (X = !0, Y.y = e.y + e.h, Y.h = Math.abs(fe)) : (Y.y = e.y - z.height, Y.h = e.h + z.height);
12470
12469
  break;
12471
12470
  }
12472
12471
  case "bottom": {
12473
- const H = b.height + e.h;
12474
- H < 0 ? (X = !0, Y.y = e.y + H, Y.h = Math.abs(H)) : Y.h = e.h + b.height;
12472
+ const H = z.height + e.h;
12473
+ H < 0 ? (X = !0, Y.y = e.y + H, Y.h = Math.abs(H)) : Y.h = e.h + z.height;
12475
12474
  break;
12476
12475
  }
12477
12476
  case "bottomLeft": {
12478
- const H = b.width + e.w;
12479
- H < 0 ? (F = !0, Y.x = e.x + e.w, Y.w = Math.abs(H)) : (Y.x = e.x - b.width, Y.w = e.w + b.width);
12480
- const fe = b.height + e.h;
12481
- fe < 0 ? (X = !0, Y.y = e.y + fe, Y.h = Math.abs(fe)) : Y.h = e.h + b.height;
12477
+ const H = z.width + e.w;
12478
+ H < 0 ? (F = !0, Y.x = e.x + e.w, Y.w = Math.abs(H)) : (Y.x = e.x - z.width, Y.w = e.w + z.width);
12479
+ const fe = z.height + e.h;
12480
+ fe < 0 ? (X = !0, Y.y = e.y + fe, Y.h = Math.abs(fe)) : Y.h = e.h + z.height;
12482
12481
  break;
12483
12482
  }
12484
12483
  case "left": {
12485
- const H = b.width + e.w;
12486
- H < 0 ? (F = !0, Y.x = e.x + e.w, Y.w = Math.abs(H)) : (Y.x = e.x - b.width, Y.w = e.w + b.width);
12484
+ const H = z.width + e.w;
12485
+ H < 0 ? (F = !0, Y.x = e.x + e.w, Y.w = Math.abs(H)) : (Y.x = e.x - z.width, Y.w = e.w + z.width);
12487
12486
  break;
12488
12487
  }
12489
12488
  case "bottomRight": {
12490
- const H = b.width + e.w;
12491
- H < 0 ? (F = !0, Y.x = e.x + H, Y.w = Math.abs(H)) : Y.w = e.w + b.width;
12492
- const fe = b.height + e.h;
12493
- fe < 0 ? (X = !0, Y.y = e.y + fe, Y.h = Math.abs(fe)) : Y.h = e.h + b.height;
12489
+ const H = z.width + e.w;
12490
+ H < 0 ? (F = !0, Y.x = e.x + H, Y.w = Math.abs(H)) : Y.w = e.w + z.width;
12491
+ const fe = z.height + e.h;
12492
+ fe < 0 ? (X = !0, Y.y = e.y + fe, Y.h = Math.abs(fe)) : Y.h = e.h + z.height;
12494
12493
  break;
12495
12494
  }
12496
12495
  case "right": {
12497
- const H = b.width + e.w;
12498
- H < 0 ? (F = !0, Y.x = e.x + H, Y.w = Math.abs(H)) : Y.w = e.w + b.width;
12496
+ const H = z.width + e.w;
12497
+ H < 0 ? (F = !0, Y.x = e.x + H, Y.w = Math.abs(H)) : Y.w = e.w + z.width;
12499
12498
  break;
12500
12499
  }
12501
12500
  }
@@ -12507,7 +12506,7 @@ const kp = (r) => {
12507
12506
  )
12508
12507
  ), K = k(ie, O);
12509
12508
  return X && (_[1] = K[1] - j[1]), F && (_[0] = K[0] - j[0]), { scale: Q, translate: _ };
12510
- }, z = (O, b) => {
12509
+ }, A = (O, z) => {
12511
12510
  if (f.current && (clearTimeout(f.current), f.current = 0), u != null && u.control.worker.isBusy) {
12512
12511
  p(!0);
12513
12512
  return;
@@ -12523,8 +12522,8 @@ const kp = (r) => {
12523
12522
  Q,
12524
12523
  u.viewId
12525
12524
  )
12526
- ), X = k(j, b), Y = k(F, b);
12527
- t(L), o(X), a(Y), l(b), M(W.ScaleNode), re.emitMethod(
12525
+ ), X = k(j, z), Y = k(F, z);
12526
+ t(L), o(X), a(Y), l(z), M(W.ScaleNode), re.emitMethod(
12528
12527
  te.MainEngine,
12529
12528
  W.ScaleNode,
12530
12529
  {
@@ -12536,7 +12535,7 @@ const kp = (r) => {
12536
12535
  }
12537
12536
  );
12538
12537
  }
12539
- }, P = (O, b, L, j) => {
12538
+ }, P = (O, z, L, j) => {
12540
12539
  if (!(!u || !i || !s)) {
12541
12540
  if (u != null && u.control.worker.isBusy) {
12542
12541
  p(!0), N();
@@ -12544,14 +12543,14 @@ const kp = (r) => {
12544
12543
  }
12545
12544
  f.current || (f.current = setTimeout(() => {
12546
12545
  f.current = 0;
12547
- const { scale: F, translate: X } = v(b, j, u, s);
12546
+ const { scale: F, translate: X } = v(z, j, u, s);
12548
12547
  (!le(F, d == null ? void 0 : d.scale) || !le(X, d == null ? void 0 : d.translate)) && (y({ scale: F, translate: X }), M(W.ScaleNode), re.emitMethod(
12549
12548
  te.MainEngine,
12550
12549
  W.ScaleNode,
12551
12550
  {
12552
12551
  workIds: [$],
12553
12552
  scale: F,
12554
- dir: b,
12553
+ dir: z,
12555
12554
  translate: X,
12556
12555
  originPoint: i,
12557
12556
  scenePoint: s,
@@ -12592,7 +12591,7 @@ const kp = (r) => {
12592
12591
  topLeft: !0
12593
12592
  },
12594
12593
  lockAspectRatio: (h == null ? void 0 : h.scaleType) === Fe.proportional,
12595
- onResizeStart: z,
12594
+ onResizeStart: A,
12596
12595
  onResize: P,
12597
12596
  onResizeStop: E
12598
12597
  }
@@ -12628,11 +12627,11 @@ const kp = (r) => {
12628
12627
  d.current && (clearTimeout(d.current), d.current = 0), o(W.None), u(x.Done);
12629
12628
  const v = { x: k.x, y: k.y };
12630
12629
  if (l(v), s != null && s.control.viewContainerManager) {
12631
- const z = s.control.viewContainerManager.transformToScenePoint(
12630
+ const A = s.control.viewContainerManager.transformToScenePoint(
12632
12631
  [v.x, v.y],
12633
12632
  s.viewId
12634
12633
  ), P = t.get(n);
12635
- P && i === "start" ? P[0] = z : P && i === "end" && (P[1] = z), re.emitMethod(
12634
+ P && i === "start" ? P[0] = A : P && i === "end" && (P[1] = A), re.emitMethod(
12636
12635
  te.MainEngine,
12637
12636
  W.SetPoint,
12638
12637
  {
@@ -12669,11 +12668,11 @@ const kp = (r) => {
12669
12668
  const v = { x: k.x, y: k.y };
12670
12669
  l(v), d.current = setTimeout(() => {
12671
12670
  if (d.current = 0, (v.x !== (k == null ? void 0 : k.x) || v.y !== (k == null ? void 0 : k.y)) && (s != null && s.control.viewContainerManager)) {
12672
- const z = s.control.viewContainerManager.transformToScenePoint(
12671
+ const A = s.control.viewContainerManager.transformToScenePoint(
12673
12672
  [v.x, v.y],
12674
12673
  s.viewId
12675
12674
  ), P = t.get(n);
12676
- P && i === "start" ? P[0] = z : P && i === "end" && (P[1] = z), u(x.Doing), re.emitMethod(
12675
+ P && i === "start" ? P[0] = A : P && i === "end" && (P[1] = A), u(x.Doing), re.emitMethod(
12677
12676
  te.MainEngine,
12678
12677
  W.SetPoint,
12679
12678
  {
@@ -14043,43 +14042,43 @@ class ct extends ke {
14043
14042
  }), this.viewContainerManager.listenerWindowManager(this.windowManager);
14044
14043
  }
14045
14044
  }
14046
- const A = class A extends Zi {
14045
+ const b = class b extends Zi {
14047
14046
  constructor() {
14048
14047
  super(...arguments);
14049
14048
  I(this, "onPhaseChanged", (e) => {
14050
14049
  var t;
14051
- e === $i.Reconnecting && ((t = A.currentManager) == null || t.setSnapshootData());
14050
+ e === $i.Reconnecting && ((t = b.currentManager) == null || t.setSnapshootData());
14052
14051
  });
14053
14052
  I(this, "updateRoomWritable", () => {
14054
14053
  var e;
14055
- (e = A.currentManager) == null || e.onWritableChange(
14054
+ (e = b.currentManager) == null || e.onWritableChange(
14056
14055
  this.displayer.isWritable
14057
14056
  );
14058
14057
  });
14059
14058
  I(this, "roomStateChangeListener", async (e) => {
14060
14059
  var t, i;
14061
- e != null && e.roomMembers && ((t = A.currentManager) == null || t.onRoomMembersChange(
14060
+ e != null && e.roomMembers && ((t = b.currentManager) == null || t.onRoomMembersChange(
14062
14061
  e.roomMembers
14063
- )), !(G(this.displayer) && !this.displayer.isWritable) && e.memberState && ((i = A.currentManager) == null || i.onMemberChange(
14062
+ )), !(G(this.displayer) && !this.displayer.isWritable) && e.memberState && ((i = b.currentManager) == null || i.onMemberChange(
14064
14063
  e.memberState
14065
14064
  ));
14066
14065
  });
14067
14066
  }
14068
14067
  static async getInstance(e, t) {
14069
14068
  var w;
14070
- t.options && (((w = t.options.extras) == null ? void 0 : w.useWorker) === "mainThread" && (t.options.cdn.fullWorkerUrl = "", t.options.cdn.subWorkerUrl = ""), (t.options.extras && t.options.extras.useWorker !== "mainThread" || !t.options.extras) && !t.options.cdn.fullWorkerUrl && !t.options.cdn.subWorkerUrl && A.logger.error(
14069
+ t.options && (((w = t.options.extras) == null ? void 0 : w.useWorker) === "mainThread" && (t.options.cdn.fullWorkerUrl = "", t.options.cdn.subWorkerUrl = ""), (t.options.extras && t.options.extras.useWorker !== "mainThread" || !t.options.extras) && !t.options.cdn.fullWorkerUrl && !t.options.cdn.subWorkerUrl && b.logger.error(
14071
14070
  "[ApplianceMultiPlugin] you must adaptor options cdn fullWorkerUrl and subWorkerUrl"
14072
14071
  ));
14073
14072
  const i = e.displayer, o = i.callbacks.on, s = i.callbacks.off, a = i.callbacks.once, c = e.cleanCurrentScene, l = e.mainView.setMemberState;
14074
14073
  let h;
14075
- G(i) && (h = i.setWritable), t != null && t.logger && (A.logger = t.logger);
14074
+ G(i) && (h = i.setWritable), t != null && t.logger && (b.logger = t.logger);
14076
14075
  let u = i.getInvisiblePlugin(
14077
- A.kind
14076
+ b.kind
14078
14077
  );
14079
- u || (u = await A.createApplianceMultiPlugin(
14078
+ u || (u = await b.createApplianceMultiPlugin(
14080
14079
  i,
14081
- A.kind
14082
- )), i && u && A.createCurrentManager(
14080
+ b.kind
14081
+ )), i && u && b.createCurrentManager(
14083
14082
  e,
14084
14083
  {
14085
14084
  cdn: t.options.cdn,
@@ -14093,54 +14092,54 @@ const A = class A extends Zi {
14093
14092
  const g = {
14094
14093
  displayer: i,
14095
14094
  windowManager: e,
14096
- currentManager: A.currentManager,
14095
+ currentManager: b.currentManager,
14097
14096
  maxScreenshotWidth: 10 * 1024,
14098
14097
  maxScreenshotHeight: 10 * 1024,
14099
14098
  getBoundingRectAsync: async function(p) {
14100
14099
  var S;
14101
- A.logger.info(
14100
+ b.logger.info(
14102
14101
  "[ApplianceMultiPlugin] getBoundingRectAsync"
14103
14102
  );
14104
- const f = (e.mainView || i).getBoundingRect(p), N = await ((S = A.currentManager) == null ? void 0 : S.getBoundingRect(p));
14103
+ const f = (e.mainView || i).getBoundingRect(p), N = await ((S = b.currentManager) == null ? void 0 : S.getBoundingRect(p));
14105
14104
  return !f.width || !f.height ? N : Kn(f, N);
14106
14105
  },
14107
14106
  screenshotToCanvasAsync: async function(p, f, N, S, C, k) {
14108
- var b;
14109
- A.logger.info(
14107
+ var z;
14108
+ b.logger.info(
14110
14109
  "[ApplianceMultiPlugin] screenshotToCanvasAsync"
14111
14110
  );
14112
- let v = N, z = S, P = C.scale;
14113
- v > this.maxScreenshotWidth && (P = this.maxScreenshotWidth / v * P, v = this.maxScreenshotWidth), z > this.maxScreenshotHeight && (P = Math.min(this.maxScreenshotHeight / z * P, P), z = this.maxScreenshotHeight), C.scale = P;
14111
+ let v = N, A = S, P = C.scale;
14112
+ v > this.maxScreenshotWidth && (P = this.maxScreenshotWidth / v * P, v = this.maxScreenshotWidth), A > this.maxScreenshotHeight && (P = Math.min(this.maxScreenshotHeight / A * P, P), A = this.maxScreenshotHeight), C.scale = P;
14114
14113
  const E = document.createElement("canvas"), O = E.getContext("2d");
14115
- E.width = v * (k || 1), E.height = z * (k || 1), O && ((e.mainView || i).screenshotToCanvas(
14114
+ E.width = v * (k || 1), E.height = A * (k || 1), O && ((e.mainView || i).screenshotToCanvas(
14116
14115
  O,
14117
14116
  f,
14118
14117
  v,
14119
- z,
14118
+ A,
14120
14119
  C,
14121
14120
  k
14122
14121
  ), p.drawImage(
14123
14122
  E,
14124
14123
  Math.floor((N - v) / 2),
14125
- Math.floor((S - z) / 2),
14124
+ Math.floor((S - A) / 2),
14126
14125
  v * (k || 1),
14127
- z * (k || 1),
14126
+ A * (k || 1),
14128
14127
  0,
14129
14128
  0,
14130
14129
  v,
14131
- z
14132
- ), E.remove()), A.currentManager && await ((b = A.currentManager) == null ? void 0 : b.screenshotToCanvas(
14130
+ A
14131
+ ), E.remove()), b.currentManager && await ((z = b.currentManager) == null ? void 0 : z.screenshotToCanvas(
14133
14132
  p,
14134
14133
  f,
14135
14134
  v,
14136
- z,
14135
+ A,
14137
14136
  C,
14138
14137
  Math.floor((N - v) / 2),
14139
- Math.floor((S - z) / 2)
14138
+ Math.floor((S - A) / 2)
14140
14139
  ));
14141
14140
  },
14142
14141
  scenePreviewAsync: async function(p, f, N, S, C) {
14143
- A.logger.info(
14142
+ b.logger.info(
14144
14143
  "[ApplianceMultiPlugin] scenePreviewAsync"
14145
14144
  ), (e.mainView || i).scenePreview(
14146
14145
  p,
@@ -14150,13 +14149,13 @@ const A = class A extends Zi {
14150
14149
  C
14151
14150
  );
14152
14151
  const k = document.createElement("img");
14153
- k.className = "appliance-plugin-fill-scene-snapshot-img", f.append(k), getComputedStyle(f).position || (f.style.position = "relative"), A.currentManager && await A.currentManager.scenePreview(
14152
+ k.className = "appliance-plugin-fill-scene-snapshot-img", f.append(k), getComputedStyle(f).position || (f.style.position = "relative"), b.currentManager && await b.currentManager.scenePreview(
14154
14153
  p,
14155
14154
  k
14156
14155
  );
14157
14156
  },
14158
14157
  fillSceneSnapshotAsync: async function(p, f, N, S, C) {
14159
- A.logger.info(
14158
+ b.logger.info(
14160
14159
  "[ApplianceMultiPlugin] fillSceneSnapshotAsync"
14161
14160
  ), f.innerHTML = "", (e.mainView || i).fillSceneSnapshot(
14162
14161
  p,
@@ -14166,20 +14165,20 @@ const A = class A extends Zi {
14166
14165
  C
14167
14166
  );
14168
14167
  const k = N || e.mainView.size.width, v = S || e.mainView.size.height;
14169
- let z = await this.getBoundingRectAsync(p);
14170
- z || (z = {
14168
+ let A = await this.getBoundingRectAsync(p);
14169
+ A || (A = {
14171
14170
  originX: 0,
14172
14171
  originY: 0,
14173
14172
  width: k,
14174
14173
  height: v
14175
14174
  });
14176
- let P = Math.max(z == null ? void 0 : z.width, k), E = Math.max(z == null ? void 0 : z.height, v), O = 1;
14177
- const b = P > k && Math.min(k / P, O) || O, L = E > v && Math.min(v / E, O) || O;
14178
- b <= L ? (P = b < 1 && k || P, E = Math.floor(E * b) + 1, O = b) : b > L && (E = L < 1 && v || E, P = Math.floor(P * L) + 1, O = L);
14175
+ let P = Math.max(A == null ? void 0 : A.width, k), E = Math.max(A == null ? void 0 : A.height, v), O = 1;
14176
+ const z = P > k && Math.min(k / P, O) || O, L = E > v && Math.min(v / E, O) || O;
14177
+ z <= L ? (P = z < 1 && k || P, E = Math.floor(E * z) + 1, O = z) : z > L && (E = L < 1 && v || E, P = Math.floor(P * L) + 1, O = L);
14179
14178
  const j = {
14180
14179
  scale: O,
14181
- centerX: z.originX + z.width / 2,
14182
- centerY: z.originY + z.height / 2
14180
+ centerX: A.originX + A.width / 2,
14181
+ centerY: A.originY + A.height / 2
14183
14182
  }, F = document.createElement("canvas"), X = F.getContext("2d");
14184
14183
  F.width = P, F.height = E, X && await this.screenshotToCanvasAsync(
14185
14184
  X,
@@ -14197,23 +14196,23 @@ const A = class A extends Zi {
14197
14196
  }, f.append(Y), getComputedStyle(f).position || (f.style.position = "relative");
14198
14197
  },
14199
14198
  _callbacksOn: function(p, f) {
14200
- A.logger.info(
14199
+ b.logger.info(
14201
14200
  `[ApplianceMultiPlugin] callbacks ${p}`
14202
14201
  ), (p === "onCanUndoStepsUpdate" || p === "onCanRedoStepsUpdate") && G(i) && i.isWritable ? ct.InternalMsgEmitter.on(p, f) : o.call(i.callbacks, p, f);
14203
14202
  },
14204
14203
  _callbacksOnce: function(p, f) {
14205
- A.logger.info(
14204
+ b.logger.info(
14206
14205
  `[ApplianceMultiPlugin] callbacks ${p}`
14207
14206
  ), (p === "onCanUndoStepsUpdate" || p === "onCanRedoStepsUpdate") && G(i) && i.isWritable ? ct.InternalMsgEmitter.on(p, f) : a.call(i.callbacks, p, f);
14208
14207
  },
14209
14208
  _callbacksOff: function(p, f) {
14210
- A.logger.info(
14209
+ b.logger.info(
14211
14210
  `[ApplianceMultiPlugin] callbacks ${p}`
14212
14211
  ), (p === "onCanUndoStepsUpdate" || p === "onCanRedoStepsUpdate") && G(i) && i.isWritable ? ct.InternalMsgEmitter.off(p, f) : s.call(i.callbacks, p, f);
14213
14212
  },
14214
14213
  canRedoSteps() {
14215
- if (A.logger.info("[ApplianceMultiPlugin] canRedoSteps"), A.currentManager && G(i) && !i.disableSerialization) {
14216
- const p = A.currentManager.viewContainerManager.focuedView, f = p == null ? void 0 : p.focusScenePath;
14214
+ if (b.logger.info("[ApplianceMultiPlugin] canRedoSteps"), b.currentManager && G(i) && !i.disableSerialization) {
14215
+ const p = b.currentManager.viewContainerManager.focuedView, f = p == null ? void 0 : p.focusScenePath;
14217
14216
  if (p && f)
14218
14217
  return p.displayer.commiter.redoStack.filter(
14219
14218
  (N) => N.scenePath === f
@@ -14222,8 +14221,8 @@ const A = class A extends Zi {
14222
14221
  return 0;
14223
14222
  },
14224
14223
  canUndoSteps() {
14225
- if (A.logger.info("[ApplianceMultiPlugin] canUndoSteps"), A.currentManager && G(i) && !i.disableSerialization) {
14226
- const p = A.currentManager.viewContainerManager.focuedView, f = p == null ? void 0 : p.focusScenePath;
14224
+ if (b.logger.info("[ApplianceMultiPlugin] canUndoSteps"), b.currentManager && G(i) && !i.disableSerialization) {
14225
+ const p = b.currentManager.viewContainerManager.focuedView, f = p == null ? void 0 : p.focusScenePath;
14227
14226
  if (p && f)
14228
14227
  return p.displayer.commiter.undoStack.filter(
14229
14228
  (C) => C.scenePath === f
@@ -14232,29 +14231,29 @@ const A = class A extends Zi {
14232
14231
  return 0;
14233
14232
  },
14234
14233
  undo: function() {
14235
- return A.logger.info("[ApplianceMultiPlugin] undo"), A.currentManager && G(i) && !i.disableSerialization && i.isWritable ? A.currentManager.viewContainerManager.undo() : 0;
14234
+ return b.logger.info("[ApplianceMultiPlugin] undo"), b.currentManager && G(i) && !i.disableSerialization && i.isWritable ? b.currentManager.viewContainerManager.undo() : 0;
14236
14235
  },
14237
14236
  redo: function() {
14238
- return A.logger.info("[ApplianceMultiPlugin] redo"), A.currentManager && G(i) && !i.disableSerialization && i.isWritable ? A.currentManager.viewContainerManager.redo() : 0;
14237
+ return b.logger.info("[ApplianceMultiPlugin] redo"), b.currentManager && G(i) && !i.disableSerialization && i.isWritable ? b.currentManager.viewContainerManager.redo() : 0;
14239
14238
  },
14240
14239
  cleanCurrentScene: function() {
14241
- A.logger.info(
14240
+ b.logger.info(
14242
14241
  "[ApplianceMultiPlugin] cleanCurrentScene"
14243
- ), A.currentManager && G(i) && i.isWritable && (A.currentManager.cleanCurrentScene(), c.call(e));
14242
+ ), b.currentManager && G(i) && i.isWritable && (b.currentManager.cleanCurrentScene(), c.call(e));
14244
14243
  },
14245
14244
  insertImage: function(p) {
14246
- if (A.logger.info("[ApplianceMultiPlugin] insertImage"), A.currentManager && G(i) && i.isWritable) {
14247
- const f = A.currentManager.viewContainerManager.focuedViewId || pe;
14248
- A.currentManager.worker.insertImage(
14245
+ if (b.logger.info("[ApplianceMultiPlugin] insertImage"), b.currentManager && G(i) && i.isWritable) {
14246
+ const f = b.currentManager.viewContainerManager.focuedViewId || pe;
14247
+ b.currentManager.worker.insertImage(
14249
14248
  f,
14250
14249
  p
14251
14250
  );
14252
14251
  }
14253
14252
  },
14254
14253
  lockImage: function(p, f) {
14255
- if (A.logger.info("[ApplianceMultiPlugin] lockImage"), A.currentManager && G(i) && i.isWritable) {
14256
- const N = A.currentManager.viewContainerManager.focuedViewId || pe;
14257
- A.currentManager.worker.lockImage(
14254
+ if (b.logger.info("[ApplianceMultiPlugin] lockImage"), b.currentManager && G(i) && i.isWritable) {
14255
+ const N = b.currentManager.viewContainerManager.focuedViewId || pe;
14256
+ b.currentManager.worker.lockImage(
14258
14257
  N,
14259
14258
  p,
14260
14259
  f
@@ -14262,11 +14261,11 @@ const A = class A extends Zi {
14262
14261
  }
14263
14262
  },
14264
14263
  completeImageUpload: function(p, f) {
14265
- if (A.logger.info(
14264
+ if (b.logger.info(
14266
14265
  "[ApplianceMultiPlugin] completeImageUpload"
14267
- ), A.currentManager && G(i) && i.isWritable) {
14268
- const N = A.currentManager.viewContainerManager.focuedViewId || pe;
14269
- A.currentManager.worker.completeImageUpload(
14266
+ ), b.currentManager && G(i) && i.isWritable) {
14267
+ const N = b.currentManager.viewContainerManager.focuedViewId || pe;
14268
+ b.currentManager.worker.completeImageUpload(
14270
14269
  N,
14271
14270
  p,
14272
14271
  f
@@ -14274,16 +14273,16 @@ const A = class A extends Zi {
14274
14273
  }
14275
14274
  },
14276
14275
  getImagesInformation: function(p) {
14277
- return A.logger.info(
14276
+ return b.logger.info(
14278
14277
  "[ApplianceMultiPlugin] completeImageUpload"
14279
- ), A.currentManager && G(i) && i.isWritable ? A.currentManager.worker.getImagesInformation(
14278
+ ), b.currentManager && G(i) && i.isWritable ? b.currentManager.worker.getImagesInformation(
14280
14279
  p
14281
14280
  ) : [];
14282
14281
  },
14283
14282
  insertText: function(p, f, N) {
14284
- if (A.logger.info("[ApplianceMultiPlugin] insertText"), A.currentManager && G(i) && i.isWritable) {
14285
- const S = A.currentManager.viewContainerManager.focuedViewId || pe;
14286
- return A.currentManager.textEditorManager.insertText(
14283
+ if (b.logger.info("[ApplianceMultiPlugin] insertText"), b.currentManager && G(i) && i.isWritable) {
14284
+ const S = b.currentManager.viewContainerManager.focuedViewId || pe;
14285
+ return b.currentManager.textEditorManager.insertText(
14287
14286
  S,
14288
14287
  p,
14289
14288
  f,
@@ -14292,12 +14291,12 @@ const A = class A extends Zi {
14292
14291
  }
14293
14292
  },
14294
14293
  updateText: function(p, f) {
14295
- A.logger.info("[ApplianceMultiPlugin] updateText"), A.currentManager && G(i) && i.isWritable && A.currentManager.textEditorManager.updateText(
14294
+ b.logger.info("[ApplianceMultiPlugin] updateText"), b.currentManager && G(i) && i.isWritable && b.currentManager.textEditorManager.updateText(
14296
14295
  p,
14297
14296
  f
14298
14297
  );
14299
14298
  },
14300
- callbacks: () => (A.logger.info(
14299
+ callbacks: () => (b.logger.info(
14301
14300
  "[ApplianceMultiPlugin] callbacks bind"
14302
14301
  ), {
14303
14302
  ...i.callbacks,
@@ -14306,18 +14305,18 @@ const A = class A extends Zi {
14306
14305
  off: g._callbacksOff.bind(g)
14307
14306
  }),
14308
14307
  destroy() {
14309
- A.currentManager && (A.logger.info("[ApplianceMultiPlugin] destroy"), A.currentManager.destroy(), A.currentManager = void 0);
14308
+ b.currentManager && (b.logger.info("[ApplianceMultiPlugin] destroy"), b.currentManager.destroy(), b.currentManager = void 0);
14310
14309
  },
14311
14310
  setMemberState(p) {
14312
14311
  var N;
14313
- A.logger.info(
14312
+ b.logger.info(
14314
14313
  `[ApplianceMultiPlugin] setMemberState ${JSON.stringify(p)}`
14315
14314
  );
14316
14315
  const f = Object.keys(p);
14317
14316
  if (G(i) && i.isWritable) {
14318
14317
  if (f.includes("currentApplianceName"))
14319
14318
  if (p.currentApplianceName && p.currentApplianceName === ne.laserPen) {
14320
- if ((N = A.currentManager) != null && N.isUseSimple)
14319
+ if ((N = b.currentManager) != null && N.isUseSimple)
14321
14320
  throw new Error(
14322
14321
  "[ApplianceMultiPlugin] laserPen must be not support in simple mode"
14323
14322
  );
@@ -14334,92 +14333,92 @@ const A = class A extends Zi {
14334
14333
  );
14335
14334
  },
14336
14335
  createMiniMap: async function(p, f) {
14337
- if (A.logger.info(
14336
+ if (b.logger.info(
14338
14337
  "[ApplianceMultiPlugin] createMiniMap"
14339
- ), A.currentManager && G(i) && i.isWritable)
14340
- return A.currentManager.createMiniMap(p, f);
14338
+ ), b.currentManager && G(i) && i.isWritable)
14339
+ return b.currentManager.createMiniMap(p, f);
14341
14340
  },
14342
14341
  destroyMiniMap: async function(p) {
14343
- if (A.logger.info(
14342
+ if (b.logger.info(
14344
14343
  "[ApplianceMultiPlugin] destroyeMiniMap"
14345
- ), A.currentManager && G(i) && i.isWritable)
14346
- return A.currentManager.destroyMiniMap(p);
14344
+ ), b.currentManager && G(i) && i.isWritable)
14345
+ return b.currentManager.destroyMiniMap(p);
14347
14346
  },
14348
14347
  filterRenderByUid(p, f, N) {
14349
- if (A.logger.info(
14348
+ if (b.logger.info(
14350
14349
  "[ApplianceMultiPlugin] filterRenderByUid"
14351
- ), A.currentManager && G(i) && i.isWritable)
14352
- return A.currentManager.filterRenderByUid(
14350
+ ), b.currentManager && G(i) && i.isWritable)
14351
+ return b.currentManager.filterRenderByUid(
14353
14352
  p,
14354
14353
  f,
14355
14354
  N
14356
14355
  );
14357
14356
  },
14358
14357
  cancelFilterRender(p, f) {
14359
- if (A.logger.info(
14358
+ if (b.logger.info(
14360
14359
  "[ApplianceMultiPlugin] filterRenderByUid"
14361
- ), A.currentManager && G(i) && i.isWritable)
14362
- return A.currentManager.cancelFilterRender(
14360
+ ), b.currentManager && G(i) && i.isWritable)
14361
+ return b.currentManager.cancelFilterRender(
14363
14362
  p,
14364
14363
  f
14365
14364
  );
14366
14365
  },
14367
14366
  addListener: (p, f) => {
14368
- A.logger.info(
14367
+ b.logger.info(
14369
14368
  `[ApplianceMultiPlugin] addListener ${p}`
14370
14369
  ), ct.PublicMsgEmitter.on(p, f);
14371
14370
  },
14372
14371
  removeListener: (p, f) => {
14373
- A.logger.info(
14372
+ b.logger.info(
14374
14373
  `[ApplianceMultiPlugin] removeListener ${p}`
14375
14374
  ), ct.PublicMsgEmitter.off(p, f);
14376
14375
  },
14377
14376
  usePlugin: (p) => {
14378
14377
  var f;
14379
- A.logger.info(
14378
+ b.logger.info(
14380
14379
  "[ApplianceMultiPlugin] usePlugin",
14381
14380
  p.kind
14382
- ), (f = A.currentManager) == null || f.usePlugin(p);
14381
+ ), (f = b.currentManager) == null || f.usePlugin(p);
14383
14382
  },
14384
14383
  getDisableDeviceInputs() {
14385
- if (A.currentManager && G(i))
14386
- return A.currentManager.disableDeviceInputs;
14384
+ if (b.currentManager && G(i))
14385
+ return b.currentManager.disableDeviceInputs;
14387
14386
  },
14388
14387
  setDisableDeviceInputs(p) {
14389
- A.logger.info(
14388
+ b.logger.info(
14390
14389
  `[ApplianceMultiPlugin] setDisableDeviceInputs ${p}`
14391
- ), A.currentManager && G(i) && (A.currentManager.disableDeviceInputs = p);
14390
+ ), b.currentManager && G(i) && (b.currentManager.disableDeviceInputs = p);
14392
14391
  },
14393
14392
  getDisableCameraTransform() {
14394
- if (A.currentManager && G(i))
14395
- return A.currentManager.disableCameraTransform;
14393
+ if (b.currentManager && G(i))
14394
+ return b.currentManager.disableCameraTransform;
14396
14395
  },
14397
14396
  setDisableCameraTransform(p) {
14398
- A.logger.info(
14397
+ b.logger.info(
14399
14398
  `[ApplianceMultiPlugin] setDisableCameraTransform ${p}`
14400
- ), A.currentManager && G(i) && (A.currentManager.disableCameraTransform = p);
14399
+ ), b.currentManager && G(i) && (b.currentManager.disableCameraTransform = p);
14401
14400
  },
14402
14401
  getDisableEraseImage() {
14403
- if (A.currentManager && G(i))
14404
- return A.currentManager.disableEraseImage;
14402
+ if (b.currentManager && G(i))
14403
+ return b.currentManager.disableEraseImage;
14405
14404
  },
14406
14405
  setDisableEraseImage(p) {
14407
- A.logger.info(
14406
+ b.logger.info(
14408
14407
  `[ApplianceMultiPlugin] setDisableEraseImage ${p}`
14409
- ), A.currentManager && G(i) && (A.currentManager.disableEraseImage = p);
14408
+ ), b.currentManager && G(i) && (b.currentManager.disableEraseImage = p);
14410
14409
  },
14411
14410
  setWritable: async function(p) {
14412
14411
  var f;
14413
- A.logger.info(
14412
+ b.logger.info(
14414
14413
  `[ApplianceMultiPlugin] setWritable ${p}`
14415
- ), G(i) && h && (await ((f = A.currentManager) == null ? void 0 : f.setWritable(p)), await h.call(i, p));
14414
+ ), G(i) && h && (await ((f = b.currentManager) == null ? void 0 : f.setWritable(p)), await h.call(i, p));
14416
14415
  },
14417
14416
  requestIdleCallback: (p, f) => {
14418
14417
  const N = (f == null ? void 0 : f.timeout) || 0, S = performance.now();
14419
14418
  let C;
14420
14419
  const k = new MessageChannel();
14421
14420
  let v;
14422
- const z = (P) => {
14421
+ const A = (P) => {
14423
14422
  try {
14424
14423
  p({
14425
14424
  didTimeout: P,
@@ -14429,7 +14428,7 @@ const A = class A extends Zi {
14429
14428
  }
14430
14429
  });
14431
14430
  } catch (E) {
14432
- A.logger.error(
14431
+ b.logger.error(
14433
14432
  "[ApplianceMultiPlugin] requestIdleCallback error:",
14434
14433
  E
14435
14434
  );
@@ -14439,27 +14438,27 @@ const A = class A extends Zi {
14439
14438
  };
14440
14439
  return k.port1.onmessage = () => {
14441
14440
  C = requestAnimationFrame(() => {
14442
- N > 0 && performance.now() - S >= N ? z(!0) : z(!1);
14441
+ N > 0 && performance.now() - S >= N ? A(!0) : A(!1);
14443
14442
  });
14444
14443
  }, k.port2.postMessage(null), N > 0 && (v = setTimeout(() => {
14445
- z(!0);
14444
+ A(!0);
14446
14445
  }, N)), v || C || 0;
14447
14446
  },
14448
14447
  cancelIdleCallback: (p) => {
14449
14448
  try {
14450
14449
  clearTimeout(p), cancelAnimationFrame(p);
14451
14450
  } catch (f) {
14452
- A.logger.error(
14451
+ b.logger.error(
14453
14452
  "[ApplianceMultiPlugin] cancelIdleCallback error:",
14454
14453
  f
14455
14454
  );
14456
14455
  }
14457
14456
  },
14458
14457
  injectMethodToObject: (p, f) => {
14459
- if (A.logger.info(
14458
+ if (b.logger.info(
14460
14459
  `[ApplianceMultiPlugin] injectMethodToObject ${f}`
14461
14460
  ), typeof p[f] == "function" || typeof p[f] > "u") {
14462
- (f === "requestIdleCallback" || f === "cancelIdleCallback") && A.currentManager && A.currentManager.registerPolyfillMethod(
14461
+ (f === "requestIdleCallback" || f === "cancelIdleCallback") && b.currentManager && b.currentManager.registerPolyfillMethod(
14463
14462
  f
14464
14463
  ), p[f] = g[f];
14465
14464
  return;
@@ -14467,20 +14466,20 @@ const A = class A extends Zi {
14467
14466
  f === "callbacks" && (p.callbacks.on = g._callbacksOn.bind(g), p.callbacks.off = g._callbacksOff.bind(g), p.callbacks.once = g._callbacksOnce.bind(g));
14468
14467
  },
14469
14468
  blurText: () => {
14470
- A.logger.info("[ApplianceMultiPlugin] blurText"), A.currentManager && G(i) && i.isWritable && A.currentManager.textEditorManager.checkEmptyTextBlur();
14469
+ b.logger.info("[ApplianceMultiPlugin] blurText"), b.currentManager && G(i) && i.isWritable && b.currentManager.textEditorManager.checkEmptyTextBlur();
14471
14470
  },
14472
14471
  hasElements: (p, f) => {
14473
14472
  var N;
14474
- if (A.logger.info(
14473
+ if (b.logger.info(
14475
14474
  `[ApplianceMultiPlugin] hasElements ${p}`
14476
- ), A.currentManager && G(i) && i.isWritable) {
14475
+ ), b.currentManager && G(i) && i.isWritable) {
14477
14476
  let S = p;
14478
14477
  if (!S) {
14479
- const C = A.currentManager.viewContainerManager.focuedView;
14478
+ const C = b.currentManager.viewContainerManager.focuedView;
14480
14479
  S = C == null ? void 0 : C.focusScenePath;
14481
14480
  }
14482
14481
  if (S) {
14483
- const C = (N = A.currentManager.collector) == null ? void 0 : N.getScenePathData(
14482
+ const C = (N = b.currentManager.collector) == null ? void 0 : N.getScenePathData(
14484
14483
  S
14485
14484
  );
14486
14485
  if (C) {
@@ -14496,16 +14495,16 @@ const A = class A extends Zi {
14496
14495
  },
14497
14496
  getElements: (p, f) => {
14498
14497
  var N;
14499
- if (A.logger.info(
14498
+ if (b.logger.info(
14500
14499
  `[ApplianceMultiPlugin] getElements ${p}`
14501
- ), A.currentManager && G(i) && i.isWritable) {
14500
+ ), b.currentManager && G(i) && i.isWritable) {
14502
14501
  let S = p;
14503
14502
  if (!S) {
14504
- const C = A.currentManager.viewContainerManager.focuedView;
14503
+ const C = b.currentManager.viewContainerManager.focuedView;
14505
14504
  S = C == null ? void 0 : C.focusScenePath;
14506
14505
  }
14507
14506
  if (S) {
14508
- const C = (N = A.currentManager.collector) == null ? void 0 : N.getScenePathData(
14507
+ const C = (N = b.currentManager.collector) == null ? void 0 : N.getScenePathData(
14509
14508
  S
14510
14509
  ), k = C && Object.values(C) || [];
14511
14510
  return C && k.length > 0 && f ? k.filter(
@@ -14516,43 +14515,43 @@ const A = class A extends Zi {
14516
14515
  }
14517
14516
  },
14518
14517
  stopDraw: (p) => {
14519
- if (A.logger.info(
14518
+ if (b.logger.info(
14520
14519
  `[ApplianceMultiPlugin] stopDraw ${p}`
14521
- ), A.currentManager && G(i))
14522
- return A.currentManager.stopDraw(p);
14520
+ ), b.currentManager && G(i))
14521
+ return b.currentManager.stopDraw(p);
14523
14522
  },
14524
14523
  setViewLocalScenePathChange: async (p, f) => {
14525
- A.logger.info(
14524
+ b.logger.info(
14526
14525
  `[ApplianceMultiPlugin] setViewLocalScenePathChange ${p} ${f}`
14527
- ), A.currentManager && await A.currentManager.setViewLocalScenePathChange(
14526
+ ), b.currentManager && await b.currentManager.setViewLocalScenePathChange(
14528
14527
  f,
14529
14528
  p
14530
14529
  );
14531
14530
  },
14532
14531
  insertMarkmap: async (p, f) => {
14533
- if (A.logger.info(
14532
+ if (b.logger.info(
14534
14533
  `[ApplianceMultiPlugin] insertMarkmap: ${p}, info: ${JSON.stringify(f)}`
14535
- ), A.currentManager && A.currentManager.isUseBackgroundThread)
14536
- return A.currentManager.worker.insertBackgroundMarkMap(
14534
+ ), b.currentManager && b.currentManager.isUseBackgroundThread)
14535
+ return b.currentManager.worker.insertBackgroundMarkMap(
14537
14536
  p,
14538
14537
  f
14539
14538
  );
14540
14539
  },
14541
14540
  updateMarkmap: async (p, f, N) => {
14542
- if (A.logger.info(
14541
+ if (b.logger.info(
14543
14542
  `[ApplianceMultiPlugin] updateMarkmap: ${p}, markmapId: ${f}, info: ${JSON.stringify(N)}`
14544
- ), A.currentManager && A.currentManager.isUseBackgroundThread)
14545
- return A.currentManager.worker.updateBackgroundMarkMap(
14543
+ ), b.currentManager && b.currentManager.isUseBackgroundThread)
14544
+ return b.currentManager.worker.updateBackgroundMarkMap(
14546
14545
  p,
14547
14546
  f,
14548
14547
  N
14549
14548
  );
14550
14549
  },
14551
14550
  insertBackgroundImage: async (p, f) => {
14552
- if (A.logger.info(
14551
+ if (b.logger.info(
14553
14552
  `[ApplianceMultiPlugin] insertBackgroundImage: ${p}, info: ${JSON.stringify(f)}`
14554
- ), A.currentManager && A.currentManager.isUseBackgroundThread)
14555
- return A.currentManager.worker.insertBackgroundSVG(
14553
+ ), b.currentManager && b.currentManager.isUseBackgroundThread)
14554
+ return b.currentManager.worker.insertBackgroundSVG(
14556
14555
  p,
14557
14556
  f
14558
14557
  );
@@ -14616,16 +14615,16 @@ const A = class A extends Zi {
14616
14615
  get() {
14617
14616
  return g.getDisableEraseImage();
14618
14617
  }
14619
- }), u && A.currentManager && (A.currentManager.bindPlugin(u), u.init(i)), e._appliancePlugin = y, e._appliancePlugin;
14618
+ }), u && b.currentManager && (b.currentManager.bindPlugin(u), u.init(i)), e._appliancePlugin = y, e._appliancePlugin;
14620
14619
  }
14621
14620
  static onCreate(e) {
14622
- e && A.currentManager && (A.currentManager.bindPlugin(
14621
+ e && b.currentManager && (b.currentManager.bindPlugin(
14623
14622
  e
14624
14623
  ), e.init(e.displayer));
14625
14624
  }
14626
14625
  static async createApplianceMultiPlugin(e, t) {
14627
14626
  try {
14628
- await e.createInvisiblePlugin(A, {});
14627
+ await e.createInvisiblePlugin(b, {});
14629
14628
  } catch (o) {
14630
14629
  if (!e.isWritable) {
14631
14630
  await e.setWritable(!0);
@@ -14635,7 +14634,7 @@ const A = class A extends Zi {
14635
14634
  throw o;
14636
14635
  }
14637
14636
  let i = e.getInvisiblePlugin(t);
14638
- return i || (i = await A.createApplianceMultiPlugin(e, t)), i;
14637
+ return i || (i = await b.createApplianceMultiPlugin(e, t)), i;
14639
14638
  }
14640
14639
  // static onDestroy(plugin: ApplianceMultiPlugin) {}
14641
14640
  get isReplay() {
@@ -14647,9 +14646,9 @@ const A = class A extends Zi {
14647
14646
  init(e) {
14648
14647
  var i, o;
14649
14648
  const t = e.state;
14650
- (i = A.currentManager) == null || i.onRoomMembersChange(
14649
+ (i = b.currentManager) == null || i.onRoomMembersChange(
14651
14650
  t.roomMembers
14652
- ), G(e) && ((o = A.currentManager) == null || o.onMemberChange(
14651
+ ), G(e) && ((o = b.currentManager) == null || o.onMemberChange(
14653
14652
  t.memberState
14654
14653
  )), this.displayer.callbacks.on(
14655
14654
  this.callbackName,
@@ -14661,31 +14660,31 @@ const A = class A extends Zi {
14661
14660
  }
14662
14661
  destroy() {
14663
14662
  var e;
14664
- A.logger.info("[ApplianceMultiPlugin] passive destroy"), (e = A.currentManager) == null || e.destroy(), A.currentManager = void 0;
14663
+ b.logger.info("[ApplianceMultiPlugin] passive destroy"), (e = b.currentManager) == null || e.destroy(), b.currentManager = void 0;
14665
14664
  }
14666
14665
  };
14667
14666
  // 组件类型,该组件的唯一识别符。应该取一个独特的名字,以和其他组件区分。
14668
- I(A, "kind", "appliance-multi-plugin"), I(A, "currentManager"), I(A, "logger", {
14667
+ I(b, "kind", "appliance-multi-plugin"), I(b, "currentManager"), I(b, "logger", {
14669
14668
  info: console.log,
14670
14669
  warn: console.warn,
14671
14670
  error: console.error
14672
- }), I(A, "createCurrentManager", (e, t, i) => {
14673
- A.currentManager && A.currentManager.destroy();
14671
+ }), I(b, "createCurrentManager", (e, t, i) => {
14672
+ b.currentManager && b.currentManager.destroy();
14674
14673
  const o = {
14675
14674
  plugin: i,
14676
14675
  displayer: e.displayer,
14677
14676
  options: t
14678
14677
  }, s = new ct(o);
14679
- if (A.logger.info(
14678
+ if (b.logger.info(
14680
14679
  "[ApplianceMultiPlugin] refresh ApplianceMultiManager object"
14681
- ), s.setWindowManager(e), A.currentManager = s, e.room) {
14680
+ ), s.setWindowManager(e), b.currentManager = s, e.room) {
14682
14681
  const a = s.hasOffscreenCanvas;
14683
14682
  e.room.logger.info(
14684
14683
  `[ApplianceMultiPlugin] use ${a ? "worker" : "mainThread"}`
14685
14684
  );
14686
14685
  }
14687
14686
  });
14688
- let Bi = A;
14687
+ let Bi = b;
14689
14688
  var Sy = He, ky = function() {
14690
14689
  return Sy.Date.now();
14691
14690
  }, xy = ky, jy = /\s/;
@@ -14725,19 +14724,19 @@ function qy(r, n, e) {
14725
14724
  throw new TypeError(Jy);
14726
14725
  n = Vi(n) || 0, Hy(e) && (h = !!e.leading, u = "maxWait" in e, o = u ? Xy(Vi(e.maxWait) || 0, n) : o, g = "trailing" in e ? !!e.trailing : g);
14727
14726
  function M(k) {
14728
- var v = t, z = i;
14729
- return t = i = void 0, l = k, s = r.apply(z, v), s;
14727
+ var v = t, A = i;
14728
+ return t = i = void 0, l = k, s = r.apply(A, v), s;
14730
14729
  }
14731
14730
  function d(k) {
14732
14731
  return l = k, a = setTimeout(p, n), h ? M(k) : s;
14733
14732
  }
14734
14733
  function y(k) {
14735
- var v = k - c, z = k - l, P = n - v;
14736
- return u ? Ky(P, o - z) : P;
14734
+ var v = k - c, A = k - l, P = n - v;
14735
+ return u ? Ky(P, o - A) : P;
14737
14736
  }
14738
14737
  function w(k) {
14739
- var v = k - c, z = k - l;
14740
- return c === void 0 || v >= n || v < 0 || u && z >= o;
14738
+ var v = k - c, A = k - l;
14739
+ return c === void 0 || v >= n || v < 0 || u && A >= o;
14741
14740
  }
14742
14741
  function p() {
14743
14742
  var k = mn();
@@ -15143,9 +15142,9 @@ const D = class D extends Zi {
15143
15142
  );
15144
15143
  let S = w, C = p, k = f.scale;
15145
15144
  S > this.maxScreenshotWidth && (k = this.maxScreenshotWidth / S * k, S = this.maxScreenshotWidth), C > this.maxScreenshotHeight && (k = Math.min(this.maxScreenshotHeight / C * k, k), C = this.maxScreenshotHeight), f.scale = k;
15146
- const v = document.createElement("canvas"), z = v.getContext("2d");
15147
- v.width = S * (N || 1), v.height = C * (N || 1), z && (e.screenshotToCanvas(
15148
- z,
15145
+ const v = document.createElement("canvas"), A = v.getContext("2d");
15146
+ v.width = S * (N || 1), v.height = C * (N || 1), A && (e.screenshotToCanvas(
15147
+ A,
15149
15148
  y,
15150
15149
  S,
15151
15150
  C,
@@ -15194,15 +15193,15 @@ const D = class D extends Zi {
15194
15193
  width: N,
15195
15194
  height: S
15196
15195
  });
15197
- let k = Math.max(C == null ? void 0 : C.width, N), v = Math.max(C == null ? void 0 : C.height, S), z = 1;
15198
- const P = k > N && Math.min(N / k, z) || z, E = v > S && Math.min(S / v, z) || z;
15199
- P <= E ? (k = P < 1 && N || k, v = Math.floor(v * P) + 1, z = P) : P > E && (v = E < 1 && S || v, k = Math.floor(k * E) + 1, z = E);
15196
+ let k = Math.max(C == null ? void 0 : C.width, N), v = Math.max(C == null ? void 0 : C.height, S), A = 1;
15197
+ const P = k > N && Math.min(N / k, A) || A, E = v > S && Math.min(S / v, A) || A;
15198
+ P <= E ? (k = P < 1 && N || k, v = Math.floor(v * P) + 1, A = P) : P > E && (v = E < 1 && S || v, k = Math.floor(k * E) + 1, A = E);
15200
15199
  const O = {
15201
- scale: z,
15200
+ scale: A,
15202
15201
  centerX: C.originX + C.width / 2,
15203
15202
  centerY: C.originY + C.height / 2
15204
- }, b = document.createElement("canvas"), L = b.getContext("2d");
15205
- b.width = k, b.height = v, L && await this.screenshotToCanvasAsync(
15203
+ }, z = document.createElement("canvas"), L = z.getContext("2d");
15204
+ z.width = k, z.height = v, L && await this.screenshotToCanvasAsync(
15206
15205
  L,
15207
15206
  d,
15208
15207
  k,
@@ -15211,10 +15210,10 @@ const D = class D extends Zi {
15211
15210
  devicePixelRatio
15212
15211
  );
15213
15212
  const j = document.createElement("img");
15214
- j.className = "appliance-plugin-fill-scene-snapshot-img", j.src = b.toDataURL(), j.onload = () => {
15215
- b.remove();
15213
+ j.className = "appliance-plugin-fill-scene-snapshot-img", j.src = z.toDataURL(), j.onload = () => {
15214
+ z.remove();
15216
15215
  }, j.onerror = () => {
15217
- b.remove(), j.remove();
15216
+ z.remove(), j.remove();
15218
15217
  }, y.append(j), getComputedStyle(y).position || (y.style.position = "relative");
15219
15218
  },
15220
15219
  _callbacksOn: function(d, y) {
@@ -15436,8 +15435,8 @@ const D = class D extends Zi {
15436
15435
  d({
15437
15436
  didTimeout: k,
15438
15437
  timeRemaining: () => {
15439
- const z = performance.now() - p;
15440
- return Math.max(0, w - z);
15438
+ const A = performance.now() - p;
15439
+ return Math.max(0, w - A);
15441
15440
  }
15442
15441
  });
15443
15442
  } catch (v) {