@univerjs/sheets-drawing-ui 0.5.0-nightly.202411261607 → 0.5.0-nightly.202411271606

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/es/index.js CHANGED
@@ -1,41 +1,41 @@
1
- var mn = Object.defineProperty;
2
- var fn = (i, e, n) => e in i ? mn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
3
- var V = (i, e, n) => fn(i, typeof e != "symbol" ? e + "" : e, n);
4
- import { CommandType as H, ICommandService as B, IUndoRedoService as ue, sequenceExecute as It, LocaleService as Be, IUniverInstanceService as fe, useDependency as ae, Inject as W, Injector as Rt, IContextService as Dt, RxDisposable as pn, UniverInstanceType as Y, connectInjector as wn, toDisposable as _n, FOCUSING_COMMON_DRAWINGS as me, Disposable as ie, Direction as te, FOCUSING_FX_BAR_EDITOR as vn, EDITOR_ACTIVATED as Sn, FOCUSING_PANEL_EDITOR as Cn, Tools as ge, UserManagerService as In, IPermissionService as Rn, Rectangle as Dn, LifecycleService as Mn, LifecycleStages as bn, DisposableCollection as yn, fromEventSubject as On, generateRandomId as Pn, DependentOn as Tn, Plugin as En, registerDependencies as Un, touchDependencies as Xe, IConfigService as An } from "@univerjs/core";
5
- import { IDrawingManagerService as K, IImageIoService as Mt, DrawingTypeEnum as k, ArrangeTypeEnum as ve, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Nn, DRAWING_IMAGE_COUNT_LIMIT as mt, ImageUploadStatusType as He, DRAWING_IMAGE_ALLOW_SIZE as jn, getImageSize as Wn, DRAWING_IMAGE_WIDTH_LIMIT as ft, DRAWING_IMAGE_HEIGHT_LIMIT as pt, getDrawingShapeKeyByDrawingSearch as ze, UniverDrawingPlugin as xn } from "@univerjs/drawing";
6
- import { ImageCropperObject as $n, COMPONENT_IMAGE_POPUP_MENU as Ln, OpenImageCropOperation as Bn, ImageResetSizeOperation as Gn, DrawingCommonPanel as Vn, DrawingRenderService as kn, UniverDrawingUIPlugin as Yn } from "@univerjs/drawing-ui";
7
- import { IRenderManagerService as J, precisionTo as ne, getGroupState as Fn, transformObjectOutOfGroup as Xn, RENDER_CLASS_TYPE as de, Rect as wt, ObjectType as Hn, DRAWING_OBJECT_LAYER_INDEX as zn, SHEET_VIEWPORT_KEY as Kn } from "@univerjs/engine-render";
8
- import { ISheetDrawingService as F, SetDrawingApplyMutation as P, DrawingApplyType as T, SheetDrawingAnchorType as y, UniverSheetsDrawingPlugin as Jn } from "@univerjs/sheets-drawing";
9
- import { SheetCanvasPopManagerService as Zn, attachRangeWithCoord as Te, ISheetSelectionRenderService as pe, SheetSkeletonManagerService as q, getCurrentRangeDisable$ as qn, COPY_TYPE as _t, PREDEFINED_HOOK_NAME as Se, virtualizeDiscreteRanges as Qn, ISheetClipboardService as er, SheetPrintInterceptorService as tr, VIEWPORT_KEY as nr, SetZoomRatioOperation as rr } from "@univerjs/sheets-ui";
10
- import { ISidebarService as ir, IUIPartsService as sr, BuiltInUIPart as or, ILocalFileService as ar, IMessageService as cr, MenuItemType as bt, getMenuHiddenObservable as yt, RibbonStartGroup as dr, KeyCode as le, ComponentManager as lr, IMenuManagerService as ur, IShortcutService as hr, CanvasFloatDomService as gr } from "@univerjs/ui";
11
- import { takeUntil as vt, combineLatest as Ce, map as Ee, filter as re, distinctUntilChanged as Ie, Subject as Ke, take as mr, BehaviorSubject as fr, switchMap as St } from "rxjs";
12
- import { SheetInterceptorService as at, getSheetCommandTarget as ce, SheetsSelectionsService as pr, WorkbookEditablePermission as tt, WorksheetEditPermission as Pe, RangeProtectionPermissionEditPoint as wr, WorkbookViewPermission as Ct, WorksheetViewPermission as Je, InsertRowCommand as Ot, InsertColCommand as Pt, RemoveRowCommand as Tt, RemoveColCommand as Et, DeleteRangeMoveLeftCommand as Ut, DeleteRangeMoveUpCommand as At, InsertRangeMoveDownCommand as Nt, InsertRangeMoveRightCommand as jt, DeltaRowHeightCommand as nt, SetRowHeightCommand as rt, DeltaColumnWidthCommand as Wt, SetColWidthCommand as xt, SetRowHiddenCommand as $t, SetSpecificRowsVisibleCommand as Lt, SetSpecificColsVisibleCommand as Bt, SetColHiddenCommand as Gt, MoveColsCommand as Vt, MoveRowsCommand as kt, MoveRangeCommand as Yt, SetRowVisibleMutation as _r, SetRowHiddenMutation as vr, SetColVisibleMutation as Sr, SetColHiddenMutation as Cr, SetWorksheetRowHeightMutation as Ir, SetWorksheetColWidthMutation as Rr, SetWorksheetActiveOperation as Dr, SetFrozenMutation as Mr } from "@univerjs/sheets";
13
- import Ft, { useEffect as ct, forwardRef as Xt, useRef as br, createElement as Ht, useState as it } from "react";
14
- import { MessageType as Re, RadioGroup as yr, Radio as Ze } from "@univerjs/design";
15
- const Or = "sheets-drawing-ui.config", Pr = {}, j = {
1
+ var fn = Object.defineProperty;
2
+ var pn = (i, e, t) => e in i ? fn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
+ var V = (i, e, t) => pn(i, typeof e != "symbol" ? e + "" : e, t);
4
+ import { CommandType as H, ICommandService as B, IUndoRedoService as ue, sequenceExecute as Mt, LocaleService as Ge, IUniverInstanceService as pe, useDependency as ae, Inject as x, Injector as bt, IContextService as yt, RxDisposable as wn, UniverInstanceType as Y, connectInjector as _n, toDisposable as vn, FOCUSING_COMMON_DRAWINGS as fe, Disposable as ie, Direction as te, FOCUSING_FX_BAR_EDITOR as Sn, EDITOR_ACTIVATED as Cn, FOCUSING_PANEL_EDITOR as In, Tools as me, UserManagerService as Rn, IPermissionService as Dn, Rectangle as Mn, LifecycleService as bn, LifecycleStages as yn, DisposableCollection as On, fromEventSubject as Pn, generateRandomId as Tn, DependentOn as En, Plugin as Un, registerDependencies as An, touchDependencies as Xe, IConfigService as Nn } from "@univerjs/core";
5
+ import { IDrawingManagerService as K, IImageIoService as Ot, DrawingTypeEnum as k, ArrangeTypeEnum as Se, DRAWING_IMAGE_ALLOW_IMAGE_LIST as jn, DRAWING_IMAGE_COUNT_LIMIT as ft, ImageUploadStatusType as He, DRAWING_IMAGE_ALLOW_SIZE as xn, getImageSize as Wn, DRAWING_IMAGE_WIDTH_LIMIT as pt, DRAWING_IMAGE_HEIGHT_LIMIT as wt, getDrawingShapeKeyByDrawingSearch as ze, UniverDrawingPlugin as $n } from "@univerjs/drawing";
6
+ import { ImageCropperObject as Ln, COMPONENT_IMAGE_POPUP_MENU as Bn, OpenImageCropOperation as Gn, ImageResetSizeOperation as Vn, DrawingCommonPanel as kn, DrawingRenderService as Yn, UniverDrawingUIPlugin as Fn } from "@univerjs/drawing-ui";
7
+ import { IRenderManagerService as J, precisionTo as ne, getGroupState as Xn, transformObjectOutOfGroup as Hn, RENDER_CLASS_TYPE as de, Rect as _t, ObjectType as zn, DRAWING_OBJECT_LAYER_INDEX as Kn, SHEET_VIEWPORT_KEY as Jn } from "@univerjs/engine-render";
8
+ import { ISheetDrawingService as F, SetDrawingApplyMutation as P, DrawingApplyType as T, SheetDrawingAnchorType as y, UniverSheetsDrawingPlugin as qn } from "@univerjs/sheets-drawing";
9
+ import { SheetCanvasPopManagerService as Zn, attachRangeWithCoord as Ee, ISheetSelectionRenderService as we, SheetSkeletonManagerService as Z, getCurrentRangeDisable$ as Qn, COPY_TYPE as vt, PREDEFINED_HOOK_NAME as Ce, virtualizeDiscreteRanges as er, ISheetClipboardService as tr, SheetPrintInterceptorService as nr, VIEWPORT_KEY as rr, SetZoomRatioOperation as ir } from "@univerjs/sheets-ui";
10
+ import { ISidebarService as sr, IUIPartsService as or, BuiltInUIPart as ar, ILocalFileService as cr, IMessageService as dr, MenuItemType as Pt, getMenuHiddenObservable as Tt, RibbonStartGroup as lr, KeyCode as le, ComponentManager as ur, IMenuManagerService as hr, IShortcutService as gr, CanvasFloatDomService as mr } from "@univerjs/ui";
11
+ import { takeUntil as St, combineLatest as Ie, map as Ue, filter as re, distinctUntilChanged as Re, Subject as Ke, take as fr, BehaviorSubject as pr, switchMap as Ct } from "rxjs";
12
+ import { SheetInterceptorService as ct, getSheetCommandTarget as ce, SheetsSelectionsService as wr, WorkbookEditablePermission as nt, WorksheetEditPermission as Te, RangeProtectionPermissionEditPoint as _r, WorkbookViewPermission as It, WorksheetViewPermission as Je, InsertRowCommand as Et, InsertColCommand as Ut, RemoveRowCommand as At, RemoveColCommand as Nt, DeleteRangeMoveLeftCommand as jt, DeleteRangeMoveUpCommand as xt, InsertRangeMoveDownCommand as Wt, InsertRangeMoveRightCommand as $t, DeltaRowHeightCommand as rt, SetRowHeightCommand as it, DeltaColumnWidthCommand as Lt, SetColWidthCommand as Bt, SetRowHiddenCommand as Gt, SetSpecificRowsVisibleCommand as Vt, SetSpecificColsVisibleCommand as kt, SetColHiddenCommand as Yt, MoveColsCommand as Ft, MoveRowsCommand as Xt, MoveRangeCommand as Ht, SetRowVisibleMutation as vr, SetRowHiddenMutation as Sr, SetColVisibleMutation as Cr, SetColHiddenMutation as Ir, SetWorksheetRowHeightMutation as Rr, SetWorksheetColWidthMutation as Dr, SetWorksheetActiveOperation as Mr, SetFrozenMutation as br } from "@univerjs/sheets";
13
+ import zt, { useEffect as dt, forwardRef as Kt, useRef as yr, createElement as Jt, useState as st } from "react";
14
+ import { MessageType as De, RadioGroup as Or, Radio as qe } from "@univerjs/design";
15
+ const Pr = "sheets-drawing-ui.config", Tr = {}, j = {
16
16
  id: "sheet.operation.clear-drawing-transformer",
17
17
  type: H.MUTATION,
18
18
  handler: (i, e) => {
19
- const n = i.get(J);
20
- return e.forEach((t) => {
19
+ const t = i.get(J);
20
+ return e.forEach((n) => {
21
21
  var r, s;
22
- (s = (r = n.getRenderById(t)) == null ? void 0 : r.scene.getTransformer()) == null || s.debounceRefreshControls();
22
+ (s = (r = t.getRenderById(n)) == null ? void 0 : r.scene.getTransformer()) == null || s.debounceRefreshControls();
23
23
  }), !0;
24
24
  }
25
- }, Ge = {
25
+ }, Ve = {
26
26
  id: "sheet.command.remove-sheet-image",
27
27
  type: H.COMMAND,
28
28
  handler: (i, e) => {
29
29
  var S, v, R;
30
- const n = i.get(B), t = i.get(ue), r = i.get(at), s = i.get(F);
30
+ const t = i.get(B), n = i.get(ue), r = i.get(ct), s = i.get(F);
31
31
  if (!e) return !1;
32
32
  const { drawings: o } = e, d = [];
33
33
  o.forEach((_) => {
34
34
  const { unitId: I } = _;
35
35
  d.push(I);
36
36
  });
37
- const l = s.getBatchRemoveOp(o), { unitId: g, subUnitId: c, undo: a, redo: h, objects: u } = l, m = r.onCommandExecute({ id: Ge.id, params: e }), f = { id: P.id, params: { unitId: g, subUnitId: c, op: h, objects: u, type: T.REMOVE } }, p = { id: P.id, params: { unitId: g, subUnitId: c, op: a, objects: u, type: T.INSERT } };
38
- return It([...(S = m.preRedos) != null ? S : [], f, ...m.redos], n) ? (t.pushUndoRedo({
37
+ const l = s.getBatchRemoveOp(o), { unitId: g, subUnitId: a, undo: c, redo: u, objects: h } = l, m = r.onCommandExecute({ id: Ve.id, params: e }), f = { id: P.id, params: { unitId: g, subUnitId: a, op: u, objects: h, type: T.REMOVE } }, p = { id: P.id, params: { unitId: g, subUnitId: a, op: c, objects: h, type: T.INSERT } };
38
+ return Mt([...(S = m.preRedos) != null ? S : [], f, ...m.redos], t) ? (n.pushUndoRedo({
39
39
  unitID: g,
40
40
  undoMutations: [
41
41
  ...(v = m.preUndos) != null ? v : [],
@@ -51,17 +51,17 @@ const Or = "sheets-drawing-ui.config", Pr = {}, j = {
51
51
  ]
52
52
  }), !0) : !1;
53
53
  }
54
- }, zt = "COMPONENT_SHEET_DRAWING_PANEL", Kt = {
54
+ }, qt = "COMPONENT_SHEET_DRAWING_PANEL", Zt = {
55
55
  id: "sidebar.operation.sheet-image",
56
56
  type: H.COMMAND,
57
57
  handler: async (i, e) => {
58
- const n = i.get(ir), t = i.get(Be), r = i.get(fe), s = i.get(K);
58
+ const t = i.get(sr), n = i.get(Ge), r = i.get(pe), s = i.get(K);
59
59
  if (!ce(r)) return !1;
60
60
  switch (e.value) {
61
61
  case "open":
62
- n.open({
63
- header: { title: t.t("sheetImage.panel.title") },
64
- children: { label: zt },
62
+ t.open({
63
+ header: { title: n.t("sheetImage.panel.title") },
64
+ children: { label: qt },
65
65
  onClose: () => {
66
66
  s.focusDrawing(null);
67
67
  },
@@ -70,20 +70,20 @@ const Or = "sheets-drawing-ui.config", Pr = {}, j = {
70
70
  break;
71
71
  case "close":
72
72
  default:
73
- n.close();
73
+ t.close();
74
74
  break;
75
75
  }
76
76
  return !0;
77
77
  }
78
- }, Jt = {
78
+ }, Qt = {
79
79
  id: "sheet.operation.edit-sheet-image",
80
80
  type: H.OPERATION,
81
81
  handler: (i, e) => {
82
- const n = i.get(K), t = i.get(B);
83
- return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(Kt.id, { value: "open" }), !0);
82
+ const t = i.get(K), n = i.get(B);
83
+ return e == null ? !1 : (t.focusDrawing([e]), n.executeCommand(Zt.id, { value: "open" }), !0);
84
84
  }
85
85
  };
86
- var Zt = { exports: {} }, Ve = {};
86
+ var Ze = { exports: {} }, he = {};
87
87
  /**
88
88
  * @license React
89
89
  * react-jsx-runtime.production.min.js
@@ -93,85 +93,91 @@ var Zt = { exports: {} }, Ve = {};
93
93
  * This source code is licensed under the MIT license found in the
94
94
  * LICENSE file in the root directory of this source tree.
95
95
  */
96
- var Tr = Ft, Er = Symbol.for("react.element"), Ur = Symbol.for("react.fragment"), Ar = Object.prototype.hasOwnProperty, Nr = Tr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, jr = { key: !0, ref: !0, __self: !0, __source: !0 };
97
- function qt(i, e, n) {
98
- var t, r = {}, s = null, o = null;
99
- n !== void 0 && (s = "" + n), e.key !== void 0 && (s = "" + e.key), e.ref !== void 0 && (o = e.ref);
100
- for (t in e) Ar.call(e, t) && !jr.hasOwnProperty(t) && (r[t] = e[t]);
101
- if (i && i.defaultProps) for (t in e = i.defaultProps, e) r[t] === void 0 && (r[t] = e[t]);
102
- return { $$typeof: Er, type: i, key: s, ref: o, props: r, _owner: Nr.current };
96
+ var Rt;
97
+ function Er() {
98
+ if (Rt) return he;
99
+ Rt = 1;
100
+ var i = zt, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, r = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
101
+ function o(d, l, g) {
102
+ var a, c = {}, u = null, h = null;
103
+ g !== void 0 && (u = "" + g), l.key !== void 0 && (u = "" + l.key), l.ref !== void 0 && (h = l.ref);
104
+ for (a in l) n.call(l, a) && !s.hasOwnProperty(a) && (c[a] = l[a]);
105
+ if (d && d.defaultProps) for (a in l = d.defaultProps, l) c[a] === void 0 && (c[a] = l[a]);
106
+ return { $$typeof: e, type: d, key: u, ref: h, props: c, _owner: r.current };
107
+ }
108
+ return he.Fragment = t, he.jsx = o, he.jsxs = o, he;
103
109
  }
104
- Ve.Fragment = Ur;
105
- Ve.jsx = qt;
106
- Ve.jsxs = qt;
107
- Zt.exports = Ve;
108
- var $ = Zt.exports;
109
- const Wr = "univer-upload-loading", xr = "univer-upload-loading-body", $r = "univer-upload-loading-body-animation", Lr = "univer-UniverCircleAnimation", Br = "univer-upload-loading-body-text", De = {
110
- uploadLoading: Wr,
111
- uploadLoadingBody: xr,
112
- uploadLoadingBodyAnimation: $r,
113
- univerCircleAnimation: Lr,
114
- uploadLoadingBodyText: Br
115
- }, Gr = () => {
116
- const i = ae(Mt), e = ae(Be), [n, t] = Ft.useState(0);
117
- return ct(() => {
110
+ var Dt;
111
+ function Ur() {
112
+ return Dt || (Dt = 1, Ze.exports = Er()), Ze.exports;
113
+ }
114
+ var $ = Ur();
115
+ const Ar = "univer-upload-loading", Nr = "univer-upload-loading-body", jr = "univer-upload-loading-body-animation", xr = "univer-UniverCircleAnimation", Wr = "univer-upload-loading-body-text", Me = {
116
+ uploadLoading: Ar,
117
+ uploadLoadingBody: Nr,
118
+ uploadLoadingBodyAnimation: jr,
119
+ univerCircleAnimation: xr,
120
+ uploadLoadingBodyText: Wr
121
+ }, $r = () => {
122
+ const i = ae(Ot), e = ae(Ge), [t, n] = zt.useState(0);
123
+ return dt(() => {
118
124
  const r = i.change$.subscribe((s) => {
119
- t(s);
125
+ n(s);
120
126
  });
121
127
  return () => {
122
128
  r.unsubscribe();
123
129
  };
124
- }, [i]), /* @__PURE__ */ $.jsx("div", { style: { display: n > 0 ? "block" : "none" }, className: De.uploadLoading, children: /* @__PURE__ */ $.jsxs("div", { className: De.uploadLoadingBody, children: [
125
- /* @__PURE__ */ $.jsx("div", { className: De.uploadLoadingBodyAnimation }),
126
- /* @__PURE__ */ $.jsx("div", { className: De.uploadLoadingBodyText, children: `${e.t("uploadLoading.loading")}: ${n}` })
130
+ }, [i]), /* @__PURE__ */ $.jsx("div", { style: { display: t > 0 ? "block" : "none" }, className: Me.uploadLoading, children: /* @__PURE__ */ $.jsxs("div", { className: Me.uploadLoadingBody, children: [
131
+ /* @__PURE__ */ $.jsx("div", { className: Me.uploadLoadingBodyAnimation }),
132
+ /* @__PURE__ */ $.jsx("div", { className: Me.uploadLoadingBodyText, children: `${e.t("uploadLoading.loading")}: ${t}` })
127
133
  ] }) });
128
134
  };
129
- var Vr = Object.defineProperty, kr = Object.getOwnPropertyDescriptor, Yr = (i, e, n, t) => {
130
- for (var r = t > 1 ? void 0 : t ? kr(e, n) : e, s = i.length - 1, o; s >= 0; s--)
131
- (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
132
- return t && r && Vr(e, n, r), r;
133
- }, se = (i, e) => (n, t) => e(n, t, i);
134
- let Ue = class extends pn {
135
- constructor(e, n, t, r, s, o, d) {
135
+ var Lr = Object.defineProperty, Br = Object.getOwnPropertyDescriptor, Gr = (i, e, t, n) => {
136
+ for (var r = n > 1 ? void 0 : n ? Br(e, t) : e, s = i.length - 1, o; s >= 0; s--)
137
+ (o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
138
+ return n && r && Lr(e, t, r), r;
139
+ }, se = (i, e) => (t, n) => e(t, n, i);
140
+ let Ae = class extends wn {
141
+ constructor(e, t, n, r, s, o, d) {
136
142
  super();
137
143
  V(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
138
- this._injector = e, this._drawingManagerService = n, this._canvasPopManagerService = t, this._renderManagerService = r, this._univerInstanceService = s, this._contextService = o, this._uiPartsService = d, this._init();
144
+ this._injector = e, this._drawingManagerService = t, this._canvasPopManagerService = n, this._renderManagerService = r, this._univerInstanceService = s, this._contextService = o, this._uiPartsService = d, this._init();
139
145
  }
140
146
  _init() {
141
- this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET).pipe(vt(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(Y.UNIVER_SHEET).pipe(vt(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(Y.UNIVER_SHEET).forEach((e) => this._create(e)), this._uiPartsService.registerComponent(or.CONTENT, () => wn(Gr, this._injector));
147
+ this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET).pipe(St(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(Y.UNIVER_SHEET).pipe(St(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(Y.UNIVER_SHEET).forEach((e) => this._create(e)), this._uiPartsService.registerComponent(ar.CONTENT, () => _n($r, this._injector));
142
148
  }
143
149
  _dispose(e) {
144
- const n = e.getUnitId();
145
- this._renderManagerService.removeRender(n);
150
+ const t = e.getUnitId();
151
+ this._renderManagerService.removeRender(t);
146
152
  }
147
153
  _create(e) {
148
154
  if (!e)
149
155
  return;
150
- const n = e.getUnitId();
151
- this._renderManagerService.has(n) && !this._initImagePopupMenu.has(n) && (this._popupMenuListener(n), this._initImagePopupMenu.add(n));
156
+ const t = e.getUnitId();
157
+ this._renderManagerService.has(t) && !this._initImagePopupMenu.has(t) && (this._popupMenuListener(t), this._initImagePopupMenu.add(t));
152
158
  }
153
159
  _hasCropObject(e) {
154
- const n = e.getAllObjectsByOrder();
155
- for (const t of n)
156
- if (t instanceof $n)
160
+ const t = e.getAllObjectsByOrder();
161
+ for (const n of t)
162
+ if (n instanceof Ln)
157
163
  return !0;
158
164
  return !1;
159
165
  }
160
166
  _popupMenuListener(e) {
161
167
  var s;
162
- const n = (s = this._renderManagerService.getRenderById(e)) == null ? void 0 : s.scene;
163
- if (!n)
164
- return;
165
- const t = n.getTransformerByCreate();
168
+ const t = (s = this._renderManagerService.getRenderById(e)) == null ? void 0 : s.scene;
166
169
  if (!t)
167
170
  return;
171
+ const n = t.getTransformerByCreate();
172
+ if (!n)
173
+ return;
168
174
  let r;
169
175
  this.disposeWithMe(
170
- _n(
171
- t.createControl$.subscribe(() => {
172
- if (this._contextService.setContextValue(me, !0), this._hasCropObject(n))
176
+ vn(
177
+ n.createControl$.subscribe(() => {
178
+ if (this._contextService.setContextValue(fe, !0), this._hasCropObject(t))
173
179
  return;
174
- const o = t.getSelectedObjectMap();
180
+ const o = n.getSelectedObjectMap();
175
181
  if (o.size > 1) {
176
182
  r == null || r.dispose();
177
183
  return;
@@ -182,87 +188,87 @@ let Ue = class extends pn {
182
188
  const l = d.oKey, g = this._drawingManagerService.getDrawingOKey(l);
183
189
  if (!g)
184
190
  return;
185
- const { unitId: c, subUnitId: a, drawingId: h, drawingType: u } = g, m = g.data;
191
+ const { unitId: a, subUnitId: c, drawingId: u, drawingType: h } = g, m = g.data;
186
192
  if (m && m.disablePopup)
187
193
  return;
188
194
  r == null || r.dispose();
189
- const f = this._canvasPopManagerService.getFeatureMenu(c, a, h, u);
195
+ const f = this._canvasPopManagerService.getFeatureMenu(a, c, u, h);
190
196
  r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(d, {
191
- componentKey: Ln,
197
+ componentKey: Bn,
192
198
  direction: "horizontal",
193
199
  offset: [2, 0],
194
200
  extraProps: {
195
- menuItems: f || this._getImageMenuItems(c, a, h, u)
201
+ menuItems: f || this._getImageMenuItems(a, c, u, h)
196
202
  }
197
203
  })), this._drawingManagerService.focusDrawing([{
198
- unitId: c,
199
- subUnitId: a,
200
- drawingId: h
204
+ unitId: a,
205
+ subUnitId: c,
206
+ drawingId: u
201
207
  }]);
202
208
  })
203
209
  )
204
210
  ), this.disposeWithMe(
205
- t.clearControl$.subscribe(() => {
206
- r == null || r.dispose(), this._contextService.setContextValue(me, !1), this._drawingManagerService.focusDrawing(null);
211
+ n.clearControl$.subscribe(() => {
212
+ r == null || r.dispose(), this._contextService.setContextValue(fe, !1), this._drawingManagerService.focusDrawing(null);
207
213
  })
208
214
  ), this.disposeWithMe(
209
- t.changing$.subscribe(() => {
215
+ n.changing$.subscribe(() => {
210
216
  r == null || r.dispose();
211
217
  })
212
218
  );
213
219
  }
214
- _getImageMenuItems(e, n, t, r) {
220
+ _getImageMenuItems(e, t, n, r) {
215
221
  return [
216
222
  {
217
223
  label: "image-popup.edit",
218
224
  index: 0,
219
- commandId: Jt.id,
220
- commandParams: { unitId: e, subUnitId: n, drawingId: t },
225
+ commandId: Qt.id,
226
+ commandParams: { unitId: e, subUnitId: t, drawingId: n },
221
227
  disable: r === k.DRAWING_DOM
222
228
  },
223
229
  {
224
230
  label: "image-popup.delete",
225
231
  index: 1,
226
- commandId: Ge.id,
227
- commandParams: { unitId: e, drawings: [{ unitId: e, subUnitId: n, drawingId: t }] },
232
+ commandId: Ve.id,
233
+ commandParams: { unitId: e, drawings: [{ unitId: e, subUnitId: t, drawingId: n }] },
228
234
  disable: !1
229
235
  },
230
236
  {
231
237
  label: "image-popup.crop",
232
238
  index: 2,
233
- commandId: Bn.id,
234
- commandParams: { unitId: e, subUnitId: n, drawingId: t },
239
+ commandId: Gn.id,
240
+ commandParams: { unitId: e, subUnitId: t, drawingId: n },
235
241
  disable: r === k.DRAWING_DOM
236
242
  },
237
243
  {
238
244
  label: "image-popup.reset",
239
245
  index: 3,
240
- commandId: Gn.id,
241
- commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
246
+ commandId: Vn.id,
247
+ commandParams: [{ unitId: e, subUnitId: t, drawingId: n }],
242
248
  disable: r === k.DRAWING_DOM
243
249
  }
244
250
  ];
245
251
  }
246
252
  };
247
- Ue = Yr([
248
- se(0, W(Rt)),
253
+ Ae = Gr([
254
+ se(0, x(bt)),
249
255
  se(1, K),
250
- se(2, W(Zn)),
256
+ se(2, x(Zn)),
251
257
  se(3, J),
252
- se(4, fe),
253
- se(5, Dt),
254
- se(6, W(sr))
255
- ], Ue);
256
- function L(i, e, n) {
257
- const { from: t, to: r, flipY: s = !1, flipX: o = !1, angle: d = 0, skewX: l = 0, skewY: g = 0 } = i, { column: c, columnOffset: a, row: h, rowOffset: u } = t, { column: m, columnOffset: f, row: p, rowOffset: C } = r, S = n.getCurrentSkeleton(), v = Te(S, {
258
- startColumn: c,
259
- endColumn: c,
260
- startRow: h,
261
- endRow: h
258
+ se(4, pe),
259
+ se(5, yt),
260
+ se(6, x(or))
261
+ ], Ae);
262
+ function L(i, e, t) {
263
+ const { from: n, to: r, flipY: s = !1, flipX: o = !1, angle: d = 0, skewX: l = 0, skewY: g = 0 } = i, { column: a, columnOffset: c, row: u, rowOffset: h } = n, { column: m, columnOffset: f, row: p, rowOffset: C } = r, S = t.getCurrentSkeleton(), v = Ee(S, {
264
+ startColumn: a,
265
+ endColumn: a,
266
+ startRow: u,
267
+ endRow: u
262
268
  });
263
269
  if (v == null)
264
270
  return;
265
- const R = Te(S, {
271
+ const R = Ee(S, {
266
272
  startColumn: m,
267
273
  endColumn: m,
268
274
  startRow: p,
@@ -271,7 +277,7 @@ function L(i, e, n) {
271
277
  if (R == null)
272
278
  return;
273
279
  const { startX: _, startY: I } = v, { startX: w, startY: O } = R;
274
- let b = ne(_ + a, 1), A = ne(I + u, 1), E = ne(w + f - b, 1), M = ne(O + C - A, 1);
280
+ let b = ne(_ + c, 1), A = ne(I + h, 1), E = ne(w + f - b, 1), M = ne(O + C - A, 1);
275
281
  v.startX === R.endX && (E = 0), v.startY === R.endY && (M = 0);
276
282
  const D = S.rowHeaderWidth + S.columnTotalWidth, U = S.columnHeaderHeight + S.rowTotalHeight;
277
283
  return b + E > D && (b = D - E), A + M > U && (A = U - M), {
@@ -287,41 +293,41 @@ function L(i, e, n) {
287
293
  };
288
294
  }
289
295
  function N(i, e) {
290
- const { left: n = 0, top: t = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: d = !1, angle: l = 0, skewX: g = 0, skewY: c = 0 } = i, a = e.getCellWithCoordByOffset(n, t);
291
- if (a == null)
296
+ const { left: t = 0, top: n = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: d = !1, angle: l = 0, skewX: g = 0, skewY: a = 0 } = i, c = e.getCellWithCoordByOffset(t, n);
297
+ if (c == null)
292
298
  return;
293
- const h = {
294
- column: a.actualColumn,
295
- columnOffset: ne(n - a.startX, 1),
296
- row: a.actualRow,
297
- rowOffset: ne(t - a.startY, 1)
298
- }, u = e.getCellWithCoordByOffset(n + r, t + s);
299
- if (u == null)
299
+ const u = {
300
+ column: c.actualColumn,
301
+ columnOffset: ne(t - c.startX, 1),
302
+ row: c.actualRow,
303
+ rowOffset: ne(n - c.startY, 1)
304
+ }, h = e.getCellWithCoordByOffset(t + r, n + s);
305
+ if (h == null)
300
306
  return;
301
307
  const m = {
302
- column: u.actualColumn,
303
- columnOffset: ne(n + r - u.startX, 1),
304
- row: u.actualRow,
305
- rowOffset: ne(t + s - u.startY, 1)
308
+ column: h.actualColumn,
309
+ columnOffset: ne(t + r - h.startX, 1),
310
+ row: h.actualRow,
311
+ rowOffset: ne(n + s - h.startY, 1)
306
312
  };
307
313
  return {
308
314
  flipY: o,
309
315
  flipX: d,
310
316
  angle: l,
311
317
  skewX: g,
312
- skewY: c,
313
- from: h,
318
+ skewY: a,
319
+ from: u,
314
320
  to: m
315
321
  };
316
322
  }
317
- var Fr = Object.defineProperty, Xr = Object.getOwnPropertyDescriptor, Hr = (i, e, n, t) => {
318
- for (var r = t > 1 ? void 0 : t ? Xr(e, n) : e, s = i.length - 1, o; s >= 0; s--)
319
- (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
320
- return t && r && Fr(e, n, r), r;
321
- }, Me = (i, e) => (n, t) => e(n, t, i);
322
- let st = class extends ie {
323
- constructor(i, e, n, t, r) {
324
- super(), this._context = i, this._sheetDrawingService = e, this._drawingManagerService = n, this._sheetSelectionRenderService = t, this._sheetSkeletonManagerService = r, this._init();
323
+ var Vr = Object.defineProperty, kr = Object.getOwnPropertyDescriptor, Yr = (i, e, t, n) => {
324
+ for (var r = n > 1 ? void 0 : n ? kr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
325
+ (o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
326
+ return n && r && Vr(e, t, r), r;
327
+ }, be = (i, e) => (t, n) => e(t, n, i);
328
+ let ot = class extends ie {
329
+ constructor(i, e, t, n, r) {
330
+ super(), this._context = i, this._sheetDrawingService = e, this._drawingManagerService = t, this._sheetSelectionRenderService = n, this._sheetSkeletonManagerService = r, this._init();
325
331
  }
326
332
  _init() {
327
333
  this._drawingInitializeListener();
@@ -330,111 +336,111 @@ let st = class extends ie {
330
336
  this._sheetDrawingService.initializeNotification(this._context.unitId);
331
337
  const i = this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId);
332
338
  for (const e in i) {
333
- const n = i[e];
334
- for (const t in n.data) {
335
- const r = n.data[t];
339
+ const t = i[e];
340
+ for (const n in t.data) {
341
+ const r = t.data[n];
336
342
  r.transform = L(r.sheetTransform, this._sheetSelectionRenderService, this._sheetSkeletonManagerService);
337
343
  }
338
344
  }
339
345
  this._drawingManagerService.registerDrawingData(this._context.unitId, this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId)), this._drawingManagerService.initializeNotification(this._context.unitId);
340
346
  }
341
347
  };
342
- st = Hr([
343
- Me(1, F),
344
- Me(2, K),
345
- Me(3, W(pe)),
346
- Me(4, W(q))
347
- ], st);
348
+ ot = Yr([
349
+ be(1, F),
350
+ be(2, K),
351
+ be(3, x(we)),
352
+ be(4, x(Z))
353
+ ], ot);
348
354
  var X = function() {
349
355
  return X = Object.assign || function(i) {
350
- for (var e, n = 1, t = arguments.length; n < t; n++) {
351
- e = arguments[n];
356
+ for (var e, t = 1, n = arguments.length; t < n; t++) {
357
+ e = arguments[t];
352
358
  for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (i[r] = e[r]);
353
359
  }
354
360
  return i;
355
361
  }, X.apply(this, arguments);
356
- }, zr = function(i, e) {
357
- var n = {};
358
- for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && e.indexOf(t) < 0 && (n[t] = i[t]);
362
+ }, Fr = function(i, e) {
363
+ var t = {};
364
+ for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && e.indexOf(n) < 0 && (t[n] = i[n]);
359
365
  if (i != null && typeof Object.getOwnPropertySymbols == "function")
360
- for (var r = 0, t = Object.getOwnPropertySymbols(i); r < t.length; r++)
361
- e.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, t[r]) && (n[t[r]] = i[t[r]]);
362
- return n;
363
- }, Qt = Xt(function(i, e) {
364
- var n = i.icon, t = i.id, r = i.className, s = i.extend, o = zr(i, ["icon", "id", "className", "extend"]), d = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), l = br("_".concat(Zr()));
365
- return en(n, "".concat(t), { defIds: n.defIds, idSuffix: l.current }, X({ ref: e, className: d }, o), s);
366
+ for (var r = 0, n = Object.getOwnPropertySymbols(i); r < n.length; r++)
367
+ e.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, n[r]) && (t[n[r]] = i[n[r]]);
368
+ return t;
369
+ }, en = Kt(function(i, e) {
370
+ var t = i.icon, n = i.id, r = i.className, s = i.extend, o = Fr(i, ["icon", "id", "className", "extend"]), d = "univerjs-icon univerjs-icon-".concat(n, " ").concat(r || "").trim(), l = yr("_".concat(zr()));
371
+ return tn(t, "".concat(n), { defIds: t.defIds, idSuffix: l.current }, X({ ref: e, className: d }, o), s);
366
372
  });
367
- function en(i, e, n, t, r) {
368
- return Ht(i.tag, X(X({ key: e }, Kr(i, n, r)), t), (Jr(i, n).children || []).map(function(s, o) {
369
- return en(s, "".concat(e, "-").concat(i.tag, "-").concat(o), n, void 0, r);
373
+ function tn(i, e, t, n, r) {
374
+ return Jt(i.tag, X(X({ key: e }, Xr(i, t, r)), n), (Hr(i, t).children || []).map(function(s, o) {
375
+ return tn(s, "".concat(e, "-").concat(i.tag, "-").concat(o), t, void 0, r);
370
376
  }));
371
377
  }
372
- function Kr(i, e, n) {
373
- var t = X({}, i.attrs);
374
- n != null && n.colorChannel1 && t.fill === "colorChannel1" && (t.fill = n.colorChannel1);
378
+ function Xr(i, e, t) {
379
+ var n = X({}, i.attrs);
380
+ t != null && t.colorChannel1 && n.fill === "colorChannel1" && (n.fill = t.colorChannel1);
375
381
  var r = e.defIds;
376
- return !r || r.length === 0 || (i.tag === "use" && t["xlink:href"] && (t["xlink:href"] = t["xlink:href"] + e.idSuffix), Object.entries(t).forEach(function(s) {
382
+ return !r || r.length === 0 || (i.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + e.idSuffix), Object.entries(n).forEach(function(s) {
377
383
  var o = s[0], d = s[1];
378
- typeof d == "string" && (t[o] = d.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
379
- })), t;
384
+ typeof d == "string" && (n[o] = d.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
385
+ })), n;
380
386
  }
381
- function Jr(i, e) {
382
- var n, t = e.defIds;
383
- return !t || t.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ? X(X({}, i), { children: i.children.map(function(r) {
384
- return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ? X(X({}, r), { attrs: X(X({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
387
+ function Hr(i, e) {
388
+ var t, n = e.defIds;
389
+ return !n || n.length === 0 ? i : i.tag === "defs" && (!((t = i.children) === null || t === void 0) && t.length) ? X(X({}, i), { children: i.children.map(function(r) {
390
+ return typeof r.attrs.id == "string" && n && n.indexOf(r.attrs.id) > -1 ? X(X({}, r), { attrs: X(X({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
385
391
  }) }) : i;
386
392
  }
387
- function Zr() {
393
+ function zr() {
388
394
  return Math.random().toString(36).substring(2, 8);
389
395
  }
390
- Qt.displayName = "UniverIcon";
391
- var qr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.2498 3.65005C2.2498 2.87685 2.87661 2.25005 3.64981 2.25005H7.9998C8.33118 2.25005 8.5998 1.98142 8.5998 1.65005C8.5998 1.31868 8.33118 1.05005 7.9998 1.05005H3.64981C2.21387 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V8.00005C14.9498 7.66868 14.6812 7.40005 14.3498 7.40005C14.0184 7.40005 13.7498 7.66868 13.7498 8.00005V9.23974L12.2385 8.1063C11.7252 7.72129 11.0068 7.7723 10.5531 8.22605L9.00869 9.77041L6.73916 7.8251C6.24387 7.40055 5.5095 7.41278 5.02864 7.85359L2.2498 10.4009V3.65005ZM2.2498 12.0287V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.7397L11.5186 9.06631C11.4829 9.03956 11.433 9.04314 11.4016 9.07458L9.92249 10.5537L11.1015 11.5642C11.3531 11.7799 11.3822 12.1587 11.1666 12.4103C10.9509 12.6619 10.5721 12.691 10.3205 12.4753L5.9582 8.7362C5.92384 8.70674 5.87288 8.70758 5.83952 8.73816L2.2498 12.0287Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M11.8097 1.14783C12.1411 1.14783 12.4097 1.41646 12.4097 1.74783V3.297H14.1541C14.4855 3.297 14.7541 3.56563 14.7541 3.897C14.7541 4.22837 14.4855 4.497 14.1541 4.497H12.4097V6.24167C12.4097 6.57304 12.1411 6.84167 11.8097 6.84167C11.4783 6.84167 11.2097 6.57304 11.2097 6.24167V4.497H9.6603C9.32893 4.497 9.0603 4.22837 9.0603 3.897C9.0603 3.56563 9.32893 3.297 9.6603 3.297H11.2097V1.74783C11.2097 1.41646 11.4783 1.14783 11.8097 1.14783Z" } }] }, tn = Xt(function(i, e) {
392
- return Ht(Qt, Object.assign({}, i, {
396
+ en.displayName = "UniverIcon";
397
+ var Kr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.2498 3.65005C2.2498 2.87685 2.87661 2.25005 3.64981 2.25005H7.9998C8.33118 2.25005 8.5998 1.98142 8.5998 1.65005C8.5998 1.31868 8.33118 1.05005 7.9998 1.05005H3.64981C2.21387 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V8.00005C14.9498 7.66868 14.6812 7.40005 14.3498 7.40005C14.0184 7.40005 13.7498 7.66868 13.7498 8.00005V9.23974L12.2385 8.1063C11.7252 7.72129 11.0068 7.7723 10.5531 8.22605L9.00869 9.77041L6.73916 7.8251C6.24387 7.40055 5.5095 7.41278 5.02864 7.85359L2.2498 10.4009V3.65005ZM2.2498 12.0287V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.7397L11.5186 9.06631C11.4829 9.03956 11.433 9.04314 11.4016 9.07458L9.92249 10.5537L11.1015 11.5642C11.3531 11.7799 11.3822 12.1587 11.1666 12.4103C10.9509 12.6619 10.5721 12.691 10.3205 12.4753L5.9582 8.7362C5.92384 8.70674 5.87288 8.70758 5.83952 8.73816L2.2498 12.0287Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M11.8097 1.14783C12.1411 1.14783 12.4097 1.41646 12.4097 1.74783V3.297H14.1541C14.4855 3.297 14.7541 3.56563 14.7541 3.897C14.7541 4.22837 14.4855 4.497 14.1541 4.497H12.4097V6.24167C12.4097 6.57304 12.1411 6.84167 11.8097 6.84167C11.4783 6.84167 11.2097 6.57304 11.2097 6.24167V4.497H9.6603C9.32893 4.497 9.0603 4.22837 9.0603 3.897C9.0603 3.56563 9.32893 3.297 9.6603 3.297H11.2097V1.74783C11.2097 1.41646 11.4783 1.14783 11.8097 1.14783Z" } }] }, nn = Kt(function(i, e) {
398
+ return Jt(en, Object.assign({}, i, {
393
399
  id: "add-image-single",
394
400
  ref: e,
395
- icon: qr
401
+ icon: Kr
396
402
  }));
397
403
  });
398
- tn.displayName = "AddImageSingle";
399
- const nn = {
404
+ nn.displayName = "AddImageSingle";
405
+ const rn = {
400
406
  id: "sheet.command.delete-drawing",
401
407
  type: H.COMMAND,
402
408
  handler: (i) => {
403
- const e = i.get(B), t = i.get(F).getFocusDrawings();
404
- if (t.length === 0)
409
+ const e = i.get(B), n = i.get(F).getFocusDrawings();
410
+ if (n.length === 0)
405
411
  return !1;
406
- const r = t[0].unitId, s = t.map((o) => {
407
- const { unitId: d, subUnitId: l, drawingId: g, drawingType: c } = o;
412
+ const r = n[0].unitId, s = n.map((o) => {
413
+ const { unitId: d, subUnitId: l, drawingId: g, drawingType: a } = o;
408
414
  return {
409
415
  unitId: d,
410
416
  subUnitId: l,
411
417
  drawingId: g,
412
- drawingType: c
418
+ drawingType: a
413
419
  };
414
420
  });
415
- return e.executeCommand(Ge.id, {
421
+ return e.executeCommand(Ve.id, {
416
422
  unitId: r,
417
423
  drawings: s
418
424
  });
419
425
  }
420
426
  };
421
- function Qr(i) {
427
+ function Jr(i) {
422
428
  const e = [];
423
- return i.forEach((n) => {
424
- const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: d } = t, l = Fn(0, 0, r.map((a) => a.transform || {})), g = r.map((a) => {
425
- const h = a.transform || { left: 0, top: 0 }, { unitId: u, subUnitId: m, drawingId: f } = a;
429
+ return i.forEach((t) => {
430
+ const { parent: n, children: r } = t, { unitId: s, subUnitId: o, drawingId: d } = n, l = Xn(0, 0, r.map((c) => c.transform || {})), g = r.map((c) => {
431
+ const u = c.transform || { left: 0, top: 0 }, { unitId: h, subUnitId: m, drawingId: f } = c;
426
432
  return {
427
- unitId: u,
433
+ unitId: h,
428
434
  subUnitId: m,
429
435
  drawingId: f,
430
436
  transform: {
431
- ...h,
432
- left: h.left - l.left,
433
- top: h.top - l.top
437
+ ...u,
438
+ left: u.left - l.left,
439
+ top: u.top - l.top
434
440
  },
435
441
  groupId: d
436
442
  };
437
- }), c = {
443
+ }), a = {
438
444
  unitId: s,
439
445
  subUnitId: o,
440
446
  drawingId: d,
@@ -442,27 +448,27 @@ function Qr(i) {
442
448
  transform: l
443
449
  };
444
450
  e.push({
445
- parent: c,
451
+ parent: a,
446
452
  children: g
447
453
  });
448
454
  }), e;
449
455
  }
450
- function ei(i) {
456
+ function qr(i) {
451
457
  const e = [];
452
- return i.forEach((n) => {
453
- const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: d, transform: l = { width: 0, height: 0 } } = t;
458
+ return i.forEach((t) => {
459
+ const { parent: n, children: r } = t, { unitId: s, subUnitId: o, drawingId: d, transform: l = { width: 0, height: 0 } } = n;
454
460
  if (l == null)
455
461
  return;
456
- const g = r.map((a) => {
457
- const { transform: h } = a, { unitId: u, subUnitId: m, drawingId: f } = a, p = Xn(h || {}, l, l.width || 0, l.height || 0);
462
+ const g = r.map((c) => {
463
+ const { transform: u } = c, { unitId: h, subUnitId: m, drawingId: f } = c, p = Hn(u || {}, l, l.width || 0, l.height || 0);
458
464
  return {
459
- unitId: u,
465
+ unitId: h,
460
466
  subUnitId: m,
461
467
  drawingId: f,
462
468
  transform: p,
463
469
  groupId: void 0
464
470
  };
465
- }), c = {
471
+ }), a = {
466
472
  unitId: s,
467
473
  subUnitId: o,
468
474
  drawingId: d,
@@ -473,32 +479,32 @@ function ei(i) {
473
479
  }
474
480
  };
475
481
  e.push({
476
- parent: c,
482
+ parent: a,
477
483
  children: g
478
484
  });
479
485
  }), e;
480
486
  }
481
- const rn = {
487
+ const sn = {
482
488
  id: "sheet.command.group-sheet-image",
483
489
  type: H.COMMAND,
484
490
  handler: (i, e) => {
485
- const n = i.get(B), t = i.get(ue), r = i.get(F);
491
+ const t = i.get(B), n = i.get(ue), r = i.get(F);
486
492
  if (!e) return !1;
487
493
  const s = [];
488
- e.forEach(({ parent: u, children: m }) => {
489
- s.push(u.unitId), m.forEach((f) => {
494
+ e.forEach(({ parent: h, children: m }) => {
495
+ s.push(h.unitId), m.forEach((f) => {
490
496
  s.push(f.unitId);
491
497
  });
492
498
  });
493
- const o = r.getGroupDrawingOp(e), { unitId: d, subUnitId: l, undo: g, redo: c, objects: a } = o;
494
- return n.syncExecuteCommand(P.id, { op: c, unitId: d, subUnitId: l, objects: a, type: T.GROUP }) ? (t.pushUndoRedo({
499
+ const o = r.getGroupDrawingOp(e), { unitId: d, subUnitId: l, undo: g, redo: a, objects: c } = o;
500
+ return t.syncExecuteCommand(P.id, { op: a, unitId: d, subUnitId: l, objects: c, type: T.GROUP }) ? (n.pushUndoRedo({
495
501
  unitID: d,
496
502
  undoMutations: [
497
- { id: P.id, params: { op: g, unitId: d, subUnitId: l, objects: ei(a), type: T.UNGROUP } },
503
+ { id: P.id, params: { op: g, unitId: d, subUnitId: l, objects: qr(c), type: T.UNGROUP } },
498
504
  { id: j.id, params: s }
499
505
  ],
500
506
  redoMutations: [
501
- { id: P.id, params: { op: c, unitId: d, subUnitId: l, objects: a, type: T.GROUP } },
507
+ { id: P.id, params: { op: a, unitId: d, subUnitId: l, objects: c, type: T.GROUP } },
502
508
  { id: j.id, params: s }
503
509
  ]
504
510
  }), !0) : !1;
@@ -508,10 +514,10 @@ const rn = {
508
514
  type: H.COMMAND,
509
515
  handler: (i, e) => {
510
516
  var S, v, R;
511
- const n = i.get(B), t = i.get(ue), r = i.get(F), s = i.get(at);
517
+ const t = i.get(B), n = i.get(ue), r = i.get(F), s = i.get(ct);
512
518
  if (!e) return !1;
513
- const o = e.drawings, d = o.map((_) => _.unitId), l = r.getBatchAddOp(o), { unitId: g, subUnitId: c, undo: a, redo: h, objects: u } = l, m = s.onCommandExecute({ id: ke.id, params: e }), f = { id: P.id, params: { op: h, unitId: g, subUnitId: c, objects: u, type: T.INSERT } }, p = { id: P.id, params: { op: a, unitId: g, subUnitId: c, objects: u, type: T.REMOVE } };
514
- return It([...(S = m.preRedos) != null ? S : [], f, ...m.redos], n) ? (t.pushUndoRedo({
519
+ const o = e.drawings, d = o.map((_) => _.unitId), l = r.getBatchAddOp(o), { unitId: g, subUnitId: a, undo: c, redo: u, objects: h } = l, m = s.onCommandExecute({ id: ke.id, params: e }), f = { id: P.id, params: { op: u, unitId: g, subUnitId: a, objects: h, type: T.INSERT } }, p = { id: P.id, params: { op: c, unitId: g, subUnitId: a, objects: h, type: T.REMOVE } };
520
+ return Mt([...(S = m.preRedos) != null ? S : [], f, ...m.redos], t) ? (n.pushUndoRedo({
515
521
  unitID: g,
516
522
  undoMutations: [
517
523
  ...(v = m.preUndos) != null ? v : [],
@@ -527,24 +533,24 @@ const rn = {
527
533
  ]
528
534
  }), !0) : !1;
529
535
  }
530
- }, sn = {
536
+ }, on = {
531
537
  id: "sheet.command.set-drawing-arrange",
532
538
  type: H.COMMAND,
533
539
  handler: (i, e) => {
534
- const n = i.get(B), t = i.get(ue);
540
+ const t = i.get(B), n = i.get(ue);
535
541
  if (!e) return !1;
536
542
  const r = i.get(F), { unitId: s, subUnitId: o, drawingIds: d, arrangeType: l } = e, g = { unitId: s, subUnitId: o, drawingIds: d };
537
- let c;
538
- if (l === ve.forward ? c = r.getForwardDrawingsOp(g) : l === ve.backward ? c = r.getBackwardDrawingOp(g) : l === ve.front ? c = r.getFrontDrawingsOp(g) : l === ve.back && (c = r.getBackDrawingsOp(g)), c == null)
543
+ let a;
544
+ if (l === Se.forward ? a = r.getForwardDrawingsOp(g) : l === Se.backward ? a = r.getBackwardDrawingOp(g) : l === Se.front ? a = r.getFrontDrawingsOp(g) : l === Se.back && (a = r.getBackDrawingsOp(g)), a == null)
539
545
  return !1;
540
- const { objects: a, redo: h, undo: u } = c;
541
- return n.syncExecuteCommand(P.id, { op: h, unitId: s, subUnitId: o, objects: a, type: T.ARRANGE }) ? (t.pushUndoRedo({
546
+ const { objects: c, redo: u, undo: h } = a;
547
+ return t.syncExecuteCommand(P.id, { op: u, unitId: s, subUnitId: o, objects: c, type: T.ARRANGE }) ? (n.pushUndoRedo({
542
548
  unitID: s,
543
549
  undoMutations: [
544
- { id: P.id, params: { op: u, unitId: s, subUnitId: o, objects: a, type: T.ARRANGE } }
550
+ { id: P.id, params: { op: h, unitId: s, subUnitId: o, objects: c, type: T.ARRANGE } }
545
551
  ],
546
552
  redoMutations: [
547
- { id: P.id, params: { op: h, unitId: s, subUnitId: o, objects: a, type: T.ARRANGE } }
553
+ { id: P.id, params: { op: u, unitId: s, subUnitId: o, objects: c, type: T.ARRANGE } }
548
554
  ]
549
555
  }), !0) : !1;
550
556
  }
@@ -552,95 +558,95 @@ const rn = {
552
558
  id: "sheet.command.set-sheet-image",
553
559
  type: H.COMMAND,
554
560
  handler: (i, e) => {
555
- const n = i.get(B), t = i.get(ue), r = i.get(F);
561
+ const t = i.get(B), n = i.get(ue), r = i.get(F);
556
562
  if (!e) return !1;
557
- const { drawings: s } = e, o = r.getBatchUpdateOp(s), { unitId: d, subUnitId: l, undo: g, redo: c, objects: a } = o;
558
- return n.syncExecuteCommand(P.id, { unitId: d, subUnitId: l, op: c, objects: a, type: T.UPDATE }) ? (t.pushUndoRedo({
563
+ const { drawings: s } = e, o = r.getBatchUpdateOp(s), { unitId: d, subUnitId: l, undo: g, redo: a, objects: c } = o;
564
+ return t.syncExecuteCommand(P.id, { unitId: d, subUnitId: l, op: a, objects: c, type: T.UPDATE }) ? (n.pushUndoRedo({
559
565
  unitID: d,
560
566
  undoMutations: [
561
- { id: P.id, params: { unitId: d, subUnitId: l, op: g, objects: a, type: T.UPDATE } },
567
+ { id: P.id, params: { unitId: d, subUnitId: l, op: g, objects: c, type: T.UPDATE } },
562
568
  { id: j.id, params: [d] }
563
569
  ],
564
570
  redoMutations: [
565
- { id: P.id, params: { unitId: d, subUnitId: l, op: c, objects: a, type: T.UPDATE } },
571
+ { id: P.id, params: { unitId: d, subUnitId: l, op: a, objects: c, type: T.UPDATE } },
566
572
  { id: j.id, params: [d] }
567
573
  ]
568
574
  }), !0) : !1;
569
575
  }
570
- }, on = {
576
+ }, an = {
571
577
  id: "sheet.command.ungroup-sheet-image",
572
578
  type: H.COMMAND,
573
579
  handler: (i, e) => {
574
- const n = i.get(B), t = i.get(ue), r = i.get(F);
580
+ const t = i.get(B), n = i.get(ue), r = i.get(F);
575
581
  if (!e) return !1;
576
582
  const s = [];
577
- e.forEach(({ parent: u, children: m }) => {
578
- s.push(u.unitId), m.forEach((f) => {
583
+ e.forEach(({ parent: h, children: m }) => {
584
+ s.push(h.unitId), m.forEach((f) => {
579
585
  s.push(f.unitId);
580
586
  });
581
587
  });
582
- const o = r.getUngroupDrawingOp(e), { unitId: d, subUnitId: l, undo: g, redo: c, objects: a } = o;
583
- return n.syncExecuteCommand(P.id, { op: c, unitId: d, subUnitId: l, objects: a, type: T.UNGROUP }) ? (t.pushUndoRedo({
588
+ const o = r.getUngroupDrawingOp(e), { unitId: d, subUnitId: l, undo: g, redo: a, objects: c } = o;
589
+ return t.syncExecuteCommand(P.id, { op: a, unitId: d, subUnitId: l, objects: c, type: T.UNGROUP }) ? (n.pushUndoRedo({
584
590
  unitID: d,
585
591
  undoMutations: [
586
- { id: P.id, params: { op: g, unitId: d, subUnitId: l, objects: Qr(a), type: T.GROUP } },
592
+ { id: P.id, params: { op: g, unitId: d, subUnitId: l, objects: Jr(c), type: T.GROUP } },
587
593
  { id: j.id, params: s }
588
594
  ],
589
595
  redoMutations: [
590
- { id: P.id, params: { op: c, unitId: d, subUnitId: l, objects: a, type: T.UNGROUP } },
596
+ { id: P.id, params: { op: a, unitId: d, subUnitId: l, objects: c, type: T.UNGROUP } },
591
597
  { id: j.id, params: s }
592
598
  ]
593
599
  }), !0) : !1;
594
600
  }
595
601
  };
596
- var ti = Object.defineProperty, ni = Object.getOwnPropertyDescriptor, ri = (i, e, n, t) => {
597
- for (var r = t > 1 ? void 0 : t ? ni(e, n) : e, s = i.length - 1, o; s >= 0; s--)
598
- (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
599
- return t && r && ti(e, n, r), r;
600
- }, z = (i, e) => (n, t) => e(n, t, i);
601
- let Ae = class extends ie {
602
- constructor(e, n, t, r, s, o, d, l, g, c, a, h) {
602
+ var Zr = Object.defineProperty, Qr = Object.getOwnPropertyDescriptor, ei = (i, e, t, n) => {
603
+ for (var r = n > 1 ? void 0 : n ? Qr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
604
+ (o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
605
+ return n && r && Zr(e, t, r), r;
606
+ }, z = (i, e) => (t, n) => e(t, n, i);
607
+ let Ne = class extends ie {
608
+ constructor(e, t, n, r, s, o, d, l, g, a, c, u) {
603
609
  super();
604
610
  V(this, "_workbookSelections");
605
- this._context = e, this._skeletonManagerService = n, this._commandService = t, this._selectionRenderService = r, this._imageIoService = s, this._fileOpenerService = o, this._sheetDrawingService = d, this._drawingManagerService = l, this._contextService = g, this._messageService = c, this._localeService = a, this._workbookSelections = h.getWorkbookSelections(this._context.unitId), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
611
+ this._context = e, this._skeletonManagerService = t, this._commandService = n, this._selectionRenderService = r, this._imageIoService = s, this._fileOpenerService = o, this._sheetDrawingService = d, this._drawingManagerService = l, this._contextService = g, this._messageService = a, this._localeService = c, this._workbookSelections = u.getWorkbookSelections(this._context.unitId), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
606
612
  }
607
613
  async insertFloatImage() {
608
614
  const e = await this._fileOpenerService.openFile({
609
615
  multiple: !0,
610
- accept: Nn.map((t) => `.${t.replace("image/", "")}`).join(",")
611
- }), n = e.length;
612
- return n > mt ? (this._messageService.show({
613
- type: Re.Error,
614
- content: this._localeService.t("update-status.exceedMaxCount", String(mt))
615
- }), !1) : n === 0 ? !1 : (e.forEach(async (t) => await this._insertFloatImage(t)), !0);
616
+ accept: jn.map((n) => `.${n.replace("image/", "")}`).join(",")
617
+ }), t = e.length;
618
+ return t > ft ? (this._messageService.show({
619
+ type: De.Error,
620
+ content: this._localeService.t("update-status.exceedMaxCount", String(ft))
621
+ }), !1) : t === 0 ? !1 : (e.forEach(async (n) => await this._insertFloatImage(n)), !0);
616
622
  }
617
623
  async _insertFloatImage(e) {
618
- let n;
624
+ let t;
619
625
  try {
620
- n = await this._imageIoService.saveImage(e);
626
+ t = await this._imageIoService.saveImage(e);
621
627
  } catch (S) {
622
628
  const v = S.message;
623
629
  v === He.ERROR_EXCEED_SIZE ? this._messageService.show({
624
- type: Re.Error,
625
- content: this._localeService.t("update-status.exceedMaxSize", String(jn / (1024 * 1024)))
630
+ type: De.Error,
631
+ content: this._localeService.t("update-status.exceedMaxSize", String(xn / (1024 * 1024)))
626
632
  }) : v === He.ERROR_IMAGE_TYPE ? this._messageService.show({
627
- type: Re.Error,
633
+ type: De.Error,
628
634
  content: this._localeService.t("update-status.invalidImageType")
629
635
  }) : v === He.ERROR_IMAGE && this._messageService.show({
630
- type: Re.Error,
636
+ type: De.Error,
631
637
  content: this._localeService.t("update-status.invalidImage")
632
638
  });
633
639
  }
634
- if (n == null)
640
+ if (t == null)
635
641
  return;
636
- const t = this._getUnitInfo(), { unitId: r, subUnitId: s } = t, { imageId: o, imageSourceType: d, source: l, base64Cache: g } = n, { width: c, height: a, image: h } = await Wn(g || ""), { width: u, height: m } = this._context.scene;
637
- this._imageIoService.addImageSourceCache(l, d, h);
642
+ const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: d, source: l, base64Cache: g } = t, { width: a, height: c, image: u } = await Wn(g || ""), { width: h, height: m } = this._context.scene;
643
+ this._imageIoService.addImageSourceCache(l, d, u);
638
644
  let f = 1;
639
- if (c > ft || a > pt) {
640
- const S = ft / c, v = pt / a;
645
+ if (a > pt || c > wt) {
646
+ const S = pt / a, v = wt / c;
641
647
  f = Math.max(S, v);
642
648
  }
643
- const p = this._getImagePosition(c * f, a * f, u, m);
649
+ const p = this._getImagePosition(a * f, c * f, h, m);
644
650
  if (p == null)
645
651
  return;
646
652
  const C = {
@@ -659,13 +665,13 @@ let Ae = class extends ie {
659
665
  });
660
666
  }
661
667
  _getUnitInfo() {
662
- const e = this._context.unit, n = e.getActiveSheet(), t = e.getUnitId(), r = n.getSheetId();
668
+ const e = this._context.unit, t = e.getActiveSheet(), n = e.getUnitId(), r = t.getSheetId();
663
669
  return {
664
- unitId: t,
670
+ unitId: n,
665
671
  subUnitId: r
666
672
  };
667
673
  }
668
- _getImagePosition(e, n, t, r) {
674
+ _getImagePosition(e, t, n, r) {
669
675
  const s = this._workbookSelections.getCurrentSelections();
670
676
  let o = {
671
677
  startRow: 0,
@@ -674,41 +680,41 @@ let Ae = class extends ie {
674
680
  endColumn: 0
675
681
  };
676
682
  s && s.length > 0 && (o = s[s.length - 1].range);
677
- const d = Te(this._skeletonManagerService.getCurrent().skeleton, o);
683
+ const d = Ee(this._skeletonManagerService.getCurrent().skeleton, o);
678
684
  if (d == null)
679
685
  return;
680
- let { startColumn: l, startRow: g, startX: c, startY: a } = d, h = !1;
681
- if (c + e > t && (c = t - e, c < 0 && (c = 0, e = t), h = !0), a + n > r && (a = r - n, a < 0 && (a = 0, n = r), h = !0), h) {
682
- const p = this._selectionRenderService.getCellWithCoordByOffset(c, a);
686
+ let { startColumn: l, startRow: g, startX: a, startY: c } = d, u = !1;
687
+ if (a + e > n && (a = n - e, a < 0 && (a = 0, e = n), u = !0), c + t > r && (c = r - t, c < 0 && (c = 0, t = r), u = !0), u) {
688
+ const p = this._selectionRenderService.getCellWithCoordByOffset(a, c);
683
689
  if (p == null)
684
690
  return;
685
- c = p.startX, a = p.startY, l = p.actualColumn, g = p.actualRow;
691
+ a = p.startX, c = p.startY, l = p.actualColumn, g = p.actualRow;
686
692
  }
687
- const u = {
693
+ const h = {
688
694
  column: l,
689
695
  columnOffset: 0,
690
696
  row: g,
691
697
  rowOffset: 0
692
- }, m = this._selectionRenderService.getCellWithCoordByOffset(c + e, a + n);
698
+ }, m = this._selectionRenderService.getCellWithCoordByOffset(a + e, c + t);
693
699
  if (m == null)
694
700
  return;
695
701
  const f = {
696
702
  column: m.actualColumn,
697
- columnOffset: c + e - m.startX,
703
+ columnOffset: a + e - m.startX,
698
704
  row: m.actualRow,
699
- rowOffset: a + n - m.startY
705
+ rowOffset: c + t - m.startY
700
706
  };
701
707
  return {
702
- from: u,
708
+ from: h,
703
709
  to: f
704
710
  };
705
711
  }
706
712
  _updateOrderListener() {
707
713
  this.disposeWithMe(this._drawingManagerService.featurePluginOrderUpdate$.subscribe((e) => {
708
- const { unitId: n, subUnitId: t, drawingIds: r, arrangeType: s } = e;
709
- this._commandService.executeCommand(sn.id, {
710
- unitId: n,
711
- subUnitId: t,
714
+ const { unitId: t, subUnitId: n, drawingIds: r, arrangeType: s } = e;
715
+ this._commandService.executeCommand(on.id, {
716
+ unitId: t,
717
+ subUnitId: n,
712
718
  drawingIds: r,
713
719
  arrangeType: s
714
720
  });
@@ -716,174 +722,174 @@ let Ae = class extends ie {
716
722
  }
717
723
  _updateImageListener() {
718
724
  this.disposeWithMe(this._drawingManagerService.featurePluginUpdate$.subscribe((e) => {
719
- const n = [];
720
- e.length !== 0 && (e.forEach((t) => {
721
- const { unitId: r, subUnitId: s, drawingId: o, drawingType: d, transform: l } = t;
725
+ const t = [];
726
+ e.length !== 0 && (e.forEach((n) => {
727
+ const { unitId: r, subUnitId: s, drawingId: o, drawingType: d, transform: l } = n;
722
728
  if (l == null)
723
729
  return;
724
730
  const g = this._sheetDrawingService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: o });
725
731
  if (g == null || g.unitId !== this._context.unitId)
726
732
  return;
727
- const c = N({ ...g.transform, ...l }, this._selectionRenderService);
728
- if (c == null)
733
+ const a = N({ ...g.transform, ...l }, this._selectionRenderService);
734
+ if (a == null)
729
735
  return;
730
- const a = {
731
- ...t,
732
- transform: { ...g.transform, ...l, ...L(c, this._selectionRenderService, this._skeletonManagerService) },
733
- sheetTransform: { ...c }
736
+ const c = {
737
+ ...n,
738
+ transform: { ...g.transform, ...l, ...L(a, this._selectionRenderService, this._skeletonManagerService) },
739
+ sheetTransform: { ...a }
734
740
  };
735
- n.push(a);
736
- }), n.length > 0 && this._commandService.executeCommand(Ye.id, {
741
+ t.push(c);
742
+ }), t.length > 0 && this._commandService.executeCommand(Ye.id, {
737
743
  unitId: e[0].unitId,
738
- drawings: n
744
+ drawings: t
739
745
  }));
740
746
  }));
741
747
  }
742
748
  _groupDrawingListener() {
743
749
  this.disposeWithMe(this._drawingManagerService.featurePluginGroupUpdate$.subscribe((e) => {
744
- this._commandService.executeCommand(rn.id, e);
745
- const { unitId: n, subUnitId: t, drawingId: r } = e[0].parent;
746
- this._drawingManagerService.focusDrawing([{ unitId: n, subUnitId: t, drawingId: r }]);
750
+ this._commandService.executeCommand(sn.id, e);
751
+ const { unitId: t, subUnitId: n, drawingId: r } = e[0].parent;
752
+ this._drawingManagerService.focusDrawing([{ unitId: t, subUnitId: n, drawingId: r }]);
747
753
  })), this.disposeWithMe(this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((e) => {
748
- this._commandService.executeCommand(on.id, e);
754
+ this._commandService.executeCommand(an.id, e);
749
755
  }));
750
756
  }
751
757
  _focusDrawingListener() {
752
758
  this.disposeWithMe(
753
759
  this._drawingManagerService.focus$.subscribe((e) => {
754
- e == null || e.length === 0 ? (this._contextService.setContextValue(me, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(me, !0), this._sheetDrawingService.focusDrawing(e));
760
+ e == null || e.length === 0 ? (this._contextService.setContextValue(fe, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(fe, !0), this._sheetDrawingService.focusDrawing(e));
755
761
  })
756
762
  );
757
763
  }
758
764
  };
759
- Ae = ri([
760
- z(1, W(q)),
765
+ Ne = ei([
766
+ z(1, x(Z)),
761
767
  z(2, B),
762
- z(3, pe),
763
- z(4, Mt),
764
- z(5, ar),
768
+ z(3, we),
769
+ z(4, Ot),
770
+ z(5, cr),
765
771
  z(6, F),
766
772
  z(7, K),
767
- z(8, Dt),
768
- z(9, cr),
769
- z(10, W(Be)),
770
- z(11, W(pr))
771
- ], Ae);
772
- const dt = {
773
+ z(8, yt),
774
+ z(9, dr),
775
+ z(10, x(Ge)),
776
+ z(11, x(wr))
777
+ ], Ne);
778
+ const lt = {
773
779
  id: "sheet.command.insert-float-image",
774
780
  type: H.COMMAND,
775
781
  handler: (i) => {
776
- var n, t;
777
- return (t = (n = i.get(J).getCurrentTypeOfRenderer(Y.UNIVER_SHEET)) == null ? void 0 : n.with(Ae).insertFloatImage()) != null ? t : !1;
782
+ var t, n;
783
+ return (n = (t = i.get(J).getCurrentTypeOfRenderer(Y.UNIVER_SHEET)) == null ? void 0 : t.with(Ne).insertFloatImage()) != null ? n : !1;
778
784
  }
779
- }, we = {
785
+ }, _e = {
780
786
  id: "sheet.command.move-drawing",
781
787
  type: H.COMMAND,
782
788
  handler: (i, e) => {
783
- const n = i.get(B), t = i.get(F), r = i.get(pe), { direction: s } = e, o = t.getFocusDrawings();
789
+ const t = i.get(B), n = i.get(F), r = i.get(we), { direction: s } = e, o = n.getFocusDrawings();
784
790
  if (o.length === 0)
785
791
  return !1;
786
- const d = o[0].unitId, l = o.map((c) => {
787
- const { transform: a } = c;
788
- if (a == null)
792
+ const d = o[0].unitId, l = o.map((a) => {
793
+ const { transform: c } = a;
794
+ if (c == null)
789
795
  return null;
790
- const h = { ...a }, { left: u = 0, top: m = 0 } = a;
791
- return s === te.UP ? h.top = m - 1 : s === te.DOWN ? h.top = m + 1 : s === te.LEFT ? h.left = u - 1 : s === te.RIGHT && (h.left = u + 1), {
792
- ...c,
793
- transform: h,
794
- sheetTransform: N(h, r)
796
+ const u = { ...c }, { left: h = 0, top: m = 0 } = c;
797
+ return s === te.UP ? u.top = m - 1 : s === te.DOWN ? u.top = m + 1 : s === te.LEFT ? u.left = h - 1 : s === te.RIGHT && (u.left = h + 1), {
798
+ ...a,
799
+ transform: u,
800
+ sheetTransform: N(u, r)
795
801
  };
796
- }).filter((c) => c != null);
797
- return n.syncExecuteCommand(Ye.id, {
802
+ }).filter((a) => a != null);
803
+ return t.syncExecuteCommand(Ye.id, {
798
804
  unitId: d,
799
805
  drawings: l
800
- }) ? (n.syncExecuteCommand(j.id, [d]), !0) : !1;
806
+ }) ? (t.syncExecuteCommand(j.id, [d]), !0) : !1;
801
807
  }
802
- }, an = "addition-and-subtraction-single", cn = "sheet.menu.image";
803
- function ii(i) {
808
+ }, cn = "addition-and-subtraction-single", dn = "sheet.menu.image";
809
+ function ti(i) {
804
810
  return {
805
- id: cn,
806
- type: bt.SUBITEMS,
807
- icon: an,
811
+ id: dn,
812
+ type: Pt.SUBITEMS,
813
+ icon: cn,
808
814
  tooltip: "sheetImage.title",
809
- hidden$: yt(i, Y.UNIVER_SHEET),
810
- disabled$: qn(i, { workbookTypes: [tt], worksheetTypes: [Pe], rangeTypes: [wr] })
815
+ hidden$: Tt(i, Y.UNIVER_SHEET),
816
+ disabled$: Qn(i, { workbookTypes: [nt], worksheetTypes: [Te], rangeTypes: [_r] })
811
817
  };
812
818
  }
813
- function si(i) {
819
+ function ni(i) {
814
820
  return {
815
- id: dt.id,
821
+ id: lt.id,
816
822
  title: "sheetImage.upload.float",
817
- type: bt.BUTTON,
818
- hidden$: yt(i, Y.UNIVER_SHEET)
823
+ type: Pt.BUTTON,
824
+ hidden$: Tt(i, Y.UNIVER_SHEET)
819
825
  };
820
826
  }
821
- const oi = "univer-image-common-panel", ai = "univer-image-common-panel-grid", ci = "univer-image-common-panel-border", di = "univer-image-common-panel-title", li = "univer-image-common-panel-subtitle", ui = "univer-image-common-panel-row", hi = "univer-image-common-panel-row-vertical", gi = "univer-image-common-panel-column", mi = "univer-image-common-panel-column-center", fi = "univer-image-common-panel-inline", pi = "univer-image-common-panel-span2", wi = "univer-image-common-panel-span3", _i = "univer-image-common-panel-input", vi = "univer-sheet-image-menu", Si = "univer-sheet-image-menu-input", ee = {
822
- imageCommonPanel: oi,
823
- imageCommonPanelGrid: ai,
824
- imageCommonPanelBorder: ci,
825
- imageCommonPanelTitle: di,
826
- imageCommonPanelSubtitle: li,
827
- imageCommonPanelRow: ui,
828
- imageCommonPanelRowVertical: hi,
829
- imageCommonPanelColumn: gi,
830
- imageCommonPanelColumnCenter: mi,
831
- imageCommonPanelInline: fi,
832
- imageCommonPanelSpan2: pi,
833
- imageCommonPanelSpan3: wi,
834
- imageCommonPanelInput: _i,
835
- sheetImageMenu: vi,
836
- sheetImageMenuInput: Si
827
+ const ri = "univer-image-common-panel", ii = "univer-image-common-panel-grid", si = "univer-image-common-panel-border", oi = "univer-image-common-panel-title", ai = "univer-image-common-panel-subtitle", ci = "univer-image-common-panel-row", di = "univer-image-common-panel-row-vertical", li = "univer-image-common-panel-column", ui = "univer-image-common-panel-column-center", hi = "univer-image-common-panel-inline", gi = "univer-image-common-panel-span2", mi = "univer-image-common-panel-span3", fi = "univer-image-common-panel-input", pi = "univer-sheet-image-menu", wi = "univer-sheet-image-menu-input", ee = {
828
+ imageCommonPanel: ri,
829
+ imageCommonPanelGrid: ii,
830
+ imageCommonPanelBorder: si,
831
+ imageCommonPanelTitle: oi,
832
+ imageCommonPanelSubtitle: ai,
833
+ imageCommonPanelRow: ci,
834
+ imageCommonPanelRowVertical: di,
835
+ imageCommonPanelColumn: li,
836
+ imageCommonPanelColumnCenter: ui,
837
+ imageCommonPanelInline: hi,
838
+ imageCommonPanelSpan2: gi,
839
+ imageCommonPanelSpan3: mi,
840
+ imageCommonPanelInput: fi,
841
+ sheetImageMenu: pi,
842
+ sheetImageMenuInput: wi
837
843
  };
838
- function dn(i) {
839
- var e, n, t = "";
840
- if (typeof i == "string" || typeof i == "number") t += i;
844
+ function ln(i) {
845
+ var e, t, n = "";
846
+ if (typeof i == "string" || typeof i == "number") n += i;
841
847
  else if (typeof i == "object") if (Array.isArray(i)) {
842
848
  var r = i.length;
843
- for (e = 0; e < r; e++) i[e] && (n = dn(i[e])) && (t && (t += " "), t += n);
844
- } else for (n in i) i[n] && (t && (t += " "), t += n);
845
- return t;
849
+ for (e = 0; e < r; e++) i[e] && (t = ln(i[e])) && (n && (n += " "), n += t);
850
+ } else for (t in i) i[t] && (n && (n += " "), n += t);
851
+ return n;
846
852
  }
847
- function be() {
848
- for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e = dn(i)) && (t && (t += " "), t += e);
849
- return t;
853
+ function ye() {
854
+ for (var i, e, t = 0, n = "", r = arguments.length; t < r; t++) (i = arguments[t]) && (e = ln(i)) && (n && (n += " "), n += e);
855
+ return n;
850
856
  }
851
- const Ci = (i) => {
857
+ const _i = (i) => {
852
858
  var v;
853
- const e = ae(B), n = ae(Be), t = ae(K), r = ae(J), { drawings: s } = i, o = s[0];
859
+ const e = ae(B), t = ae(Ge), n = ae(K), r = ae(J), { drawings: s } = i, o = s[0];
854
860
  if (o == null)
855
861
  return;
856
862
  const { unitId: d } = o, l = r.getRenderById(d), g = l == null ? void 0 : l.scene;
857
863
  if (g == null)
858
864
  return;
859
- const c = g.getTransformerByCreate(), [a, h] = it(!0), u = (v = o.anchorType) != null ? v : y.Position, [m, f] = it(u);
865
+ const a = g.getTransformerByCreate(), [c, u] = st(!0), h = (v = o.anchorType) != null ? v : y.Position, [m, f] = st(h);
860
866
  function p(R, _) {
861
867
  const I = [];
862
868
  return R.forEach((w) => {
863
869
  const { oKey: O } = w, b = _.getDrawingOKey(O);
864
870
  if (b == null)
865
871
  return I.push(null), !0;
866
- const { unitId: A, subUnitId: E, drawingId: M, drawingType: D, anchorType: U, sheetTransform: x } = b;
872
+ const { unitId: A, subUnitId: E, drawingId: M, drawingType: D, anchorType: U, sheetTransform: W } = b;
867
873
  I.push({
868
874
  unitId: A,
869
875
  subUnitId: E,
870
876
  drawingId: M,
871
877
  anchorType: U,
872
- sheetTransform: x,
878
+ sheetTransform: W,
873
879
  drawingType: D
874
880
  });
875
881
  }), I;
876
882
  }
877
- ct(() => {
878
- const R = c.clearControl$.subscribe((I) => {
879
- I === !0 && h(!1);
880
- }), _ = c.changeStart$.subscribe((I) => {
883
+ dt(() => {
884
+ const R = a.clearControl$.subscribe((I) => {
885
+ I === !0 && u(!1);
886
+ }), _ = a.changeStart$.subscribe((I) => {
881
887
  var b;
882
- const { objects: w } = I, O = p(w, t);
888
+ const { objects: w } = I, O = p(w, n);
883
889
  if (O.length === 0)
884
- h(!1);
890
+ u(!1);
885
891
  else if (O.length >= 1) {
886
- h(!0);
892
+ u(!0);
887
893
  const A = ((b = O[0]) == null ? void 0 : b.anchorType) || y.Position;
888
894
  f(A);
889
895
  }
@@ -894,7 +900,7 @@ const Ci = (i) => {
894
900
  }, []);
895
901
  function C(R) {
896
902
  f(R);
897
- const _ = t.getFocusDrawings();
903
+ const _ = n.getFocusDrawings();
898
904
  if (_.length === 0)
899
905
  return;
900
906
  const I = _.map((w) => ({
@@ -909,131 +915,131 @@ const Ci = (i) => {
909
915
  });
910
916
  }
911
917
  const S = (R) => R ? "block" : "none";
912
- return /* @__PURE__ */ $.jsxs("div", { className: be(ee.imageCommonPanelGrid, ee.imageCommonPanelBorder), style: { display: S(a) }, children: [
913
- /* @__PURE__ */ $.jsx("div", { className: ee.imageCommonPanelRow, children: /* @__PURE__ */ $.jsx("div", { className: be(ee.imageCommonPanelColumn, ee.imageCommonPanelTitle), children: /* @__PURE__ */ $.jsx("div", { children: n.t("drawing-anchor.title") }) }) }),
914
- /* @__PURE__ */ $.jsx("div", { className: be(ee.imageCommonPanelRow), children: /* @__PURE__ */ $.jsx("div", { className: be(ee.imageCommonPanelColumn), children: /* @__PURE__ */ $.jsxs(yr, { value: m, onChange: C, direction: "vertical", children: [
915
- /* @__PURE__ */ $.jsx(Ze, { value: y.Both, children: n.t("drawing-anchor.both") }),
916
- /* @__PURE__ */ $.jsx(Ze, { value: y.Position, children: n.t("drawing-anchor.position") }),
917
- /* @__PURE__ */ $.jsx(Ze, { value: y.None, children: n.t("drawing-anchor.none") })
918
+ return /* @__PURE__ */ $.jsxs("div", { className: ye(ee.imageCommonPanelGrid, ee.imageCommonPanelBorder), style: { display: S(c) }, children: [
919
+ /* @__PURE__ */ $.jsx("div", { className: ee.imageCommonPanelRow, children: /* @__PURE__ */ $.jsx("div", { className: ye(ee.imageCommonPanelColumn, ee.imageCommonPanelTitle), children: /* @__PURE__ */ $.jsx("div", { children: t.t("drawing-anchor.title") }) }) }),
920
+ /* @__PURE__ */ $.jsx("div", { className: ye(ee.imageCommonPanelRow), children: /* @__PURE__ */ $.jsx("div", { className: ye(ee.imageCommonPanelColumn), children: /* @__PURE__ */ $.jsxs(Or, { value: m, onChange: C, direction: "vertical", children: [
921
+ /* @__PURE__ */ $.jsx(qe, { value: y.Both, children: t.t("drawing-anchor.both") }),
922
+ /* @__PURE__ */ $.jsx(qe, { value: y.Position, children: t.t("drawing-anchor.position") }),
923
+ /* @__PURE__ */ $.jsx(qe, { value: y.None, children: t.t("drawing-anchor.none") })
918
924
  ] }) }) })
919
925
  ] });
920
- }, Ii = () => {
921
- const i = ae(K), e = i.getFocusDrawings(), [n, t] = it(e);
922
- return ct(() => {
926
+ }, vi = () => {
927
+ const i = ae(K), e = i.getFocusDrawings(), [t, n] = st(e);
928
+ return dt(() => {
923
929
  const r = i.focus$.subscribe((s) => {
924
- t(s);
930
+ n(s);
925
931
  });
926
932
  return () => {
927
933
  r.unsubscribe();
928
934
  };
929
- }, []), !!(n != null && n.length) && /* @__PURE__ */ $.jsxs("div", { className: ee.imageCommonPanel, children: [
930
- /* @__PURE__ */ $.jsx(Vn, { drawings: n }),
931
- /* @__PURE__ */ $.jsx(Ci, { drawings: n })
935
+ }, []), !!(t != null && t.length) && /* @__PURE__ */ $.jsxs("div", { className: ee.imageCommonPanel, children: [
936
+ /* @__PURE__ */ $.jsx(kn, { drawings: t }),
937
+ /* @__PURE__ */ $.jsx(_i, { drawings: t })
932
938
  ] });
933
- }, Ri = {
934
- [dr.FORMULAS_INSERT]: {
935
- [cn]: {
939
+ }, Si = {
940
+ [lr.FORMULAS_INSERT]: {
941
+ [dn]: {
936
942
  order: 3,
937
- menuItemFactory: ii,
938
- [dt.id]: {
943
+ menuItemFactory: ti,
944
+ [lt.id]: {
939
945
  order: 0,
940
- menuItemFactory: si
946
+ menuItemFactory: ni
941
947
  }
942
948
  }
943
949
  }
944
950
  };
945
- function _e(i) {
946
- return !i.getContextValue(vn) && !i.getContextValue(Sn) && !i.getContextValue(Cn) && i.getContextValue(me);
951
+ function ve(i) {
952
+ return !i.getContextValue(Sn) && !i.getContextValue(Cn) && !i.getContextValue(In) && i.getContextValue(fe);
947
953
  }
948
- const Di = {
949
- id: we.id,
954
+ const Ci = {
955
+ id: _e.id,
950
956
  description: "shortcut.sheet.drawing-move-down",
951
957
  group: "4_sheet-drawing-view",
952
958
  binding: le.ARROW_DOWN,
953
959
  priority: 100,
954
- preconditions: _e,
960
+ preconditions: ve,
955
961
  staticParameters: {
956
962
  direction: te.DOWN
957
963
  }
958
- }, Mi = {
959
- id: we.id,
964
+ }, Ii = {
965
+ id: _e.id,
960
966
  description: "shortcut.sheet.drawing-move-up",
961
967
  group: "4_sheet-drawing-view",
962
968
  binding: le.ARROW_UP,
963
969
  priority: 100,
964
- preconditions: _e,
970
+ preconditions: ve,
965
971
  staticParameters: {
966
972
  direction: te.UP
967
973
  }
968
- }, bi = {
969
- id: we.id,
974
+ }, Ri = {
975
+ id: _e.id,
970
976
  description: "shortcut.sheet.drawing-move-left",
971
977
  group: "4_sheet-drawing-view",
972
978
  binding: le.ARROW_LEFT,
973
979
  priority: 100,
974
- preconditions: _e,
980
+ preconditions: ve,
975
981
  staticParameters: {
976
982
  direction: te.LEFT
977
983
  }
978
- }, yi = {
979
- id: we.id,
984
+ }, Di = {
985
+ id: _e.id,
980
986
  description: "shortcut.sheet.drawing-move-right",
981
987
  group: "4_sheet-drawing-view",
982
988
  binding: le.ARROW_RIGHT,
983
989
  priority: 100,
984
- preconditions: _e,
990
+ preconditions: ve,
985
991
  staticParameters: {
986
992
  direction: te.RIGHT
987
993
  }
988
- }, Oi = {
989
- id: nn.id,
994
+ }, Mi = {
995
+ id: rn.id,
990
996
  description: "shortcut.sheet.drawing-delete",
991
997
  group: "4_sheet-drawing-view",
992
998
  // when focusing on any other input tag do not trigger this shortcut
993
- preconditions: _e,
999
+ preconditions: ve,
994
1000
  binding: le.DELETE,
995
1001
  mac: le.BACKSPACE
996
1002
  };
997
- var Pi = Object.defineProperty, Ti = Object.getOwnPropertyDescriptor, Ei = (i, e, n, t) => {
998
- for (var r = t > 1 ? void 0 : t ? Ti(e, n) : e, s = i.length - 1, o; s >= 0; s--)
999
- (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
1000
- return t && r && Pi(e, n, r), r;
1001
- }, ye = (i, e) => (n, t) => e(n, t, i);
1002
- let Ne = class extends ie {
1003
- constructor(i, e, n, t) {
1004
- super(), this._componentManager = i, this._menuManagerService = e, this._commandService = n, this._shortcutService = t, this._init();
1003
+ var bi = Object.defineProperty, yi = Object.getOwnPropertyDescriptor, Oi = (i, e, t, n) => {
1004
+ for (var r = n > 1 ? void 0 : n ? yi(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1005
+ (o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
1006
+ return n && r && bi(e, t, r), r;
1007
+ }, Oe = (i, e) => (t, n) => e(t, n, i);
1008
+ let je = class extends ie {
1009
+ constructor(i, e, t, n) {
1010
+ super(), this._componentManager = i, this._menuManagerService = e, this._commandService = t, this._shortcutService = n, this._init();
1005
1011
  }
1006
1012
  _initCustomComponents() {
1007
1013
  const i = this._componentManager;
1008
- this.disposeWithMe(i.register(an, tn)), this.disposeWithMe(i.register(zt, Ii));
1014
+ this.disposeWithMe(i.register(cn, nn)), this.disposeWithMe(i.register(qt, vi));
1009
1015
  }
1010
1016
  _initMenus() {
1011
- this._menuManagerService.mergeMenu(Ri);
1017
+ this._menuManagerService.mergeMenu(Si);
1012
1018
  }
1013
1019
  _initCommands() {
1014
1020
  [
1015
- dt,
1021
+ lt,
1016
1022
  ke,
1017
- Ge,
1023
+ Ve,
1018
1024
  Ye,
1019
- Kt,
1025
+ Zt,
1020
1026
  j,
1021
- Jt,
1027
+ Qt,
1028
+ sn,
1029
+ an,
1030
+ _e,
1022
1031
  rn,
1023
- on,
1024
- we,
1025
- nn,
1026
- sn
1032
+ on
1027
1033
  ].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
1028
1034
  }
1029
1035
  _initShortcuts() {
1030
1036
  [
1031
1037
  // sheet drawing shortcuts
1038
+ Ci,
1039
+ Ii,
1040
+ Ri,
1032
1041
  Di,
1033
- Mi,
1034
- bi,
1035
- yi,
1036
- Oi
1042
+ Mi
1037
1043
  ].forEach((i) => {
1038
1044
  this.disposeWithMe(this._shortcutService.registerShortcut(i));
1039
1045
  });
@@ -1042,44 +1048,44 @@ let Ne = class extends ie {
1042
1048
  this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
1043
1049
  }
1044
1050
  };
1045
- Ne = Ei([
1046
- ye(0, W(lr)),
1047
- ye(1, ur),
1048
- ye(2, B),
1049
- ye(3, hr)
1050
- ], Ne);
1051
- var Ui = Object.defineProperty, Ai = Object.getOwnPropertyDescriptor, Ni = (i, e, n, t) => {
1052
- for (var r = t > 1 ? void 0 : t ? Ai(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1053
- (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
1054
- return t && r && Ui(e, n, r), r;
1055
- }, qe = (i, e) => (n, t) => e(n, t, i);
1056
- let je = class extends ie {
1057
- constructor(e, n, t) {
1051
+ je = Oi([
1052
+ Oe(0, x(ur)),
1053
+ Oe(1, hr),
1054
+ Oe(2, B),
1055
+ Oe(3, gr)
1056
+ ], je);
1057
+ var Pi = Object.defineProperty, Ti = Object.getOwnPropertyDescriptor, Ei = (i, e, t, n) => {
1058
+ for (var r = n > 1 ? void 0 : n ? Ti(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1059
+ (o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
1060
+ return n && r && Pi(e, t, r), r;
1061
+ }, Qe = (i, e) => (t, n) => e(t, n, i);
1062
+ let xe = class extends ie {
1063
+ constructor(e, t, n) {
1058
1064
  super();
1059
1065
  V(this, "_copyInfo");
1060
- this._sheetClipboardService = e, this._renderManagerService = n, this._sheetDrawingService = t, this._initCopyPaste();
1066
+ this._sheetClipboardService = e, this._renderManagerService = t, this._sheetDrawingService = n, this._initCopyPaste();
1061
1067
  }
1062
1068
  _initCopyPaste() {
1063
1069
  this._sheetClipboardService.addClipboardHook({
1064
1070
  id: "SHEET_IMAGE_UI_PLUGIN",
1065
- onBeforeCopy: (e, n, t) => this._collect(e, n, t),
1066
- onPasteCells: (e, n, t, r) => {
1067
- const { copyType: s = _t.COPY, pasteType: o } = r, { range: d } = e || {}, { range: l, unitId: g, subUnitId: c } = n;
1068
- return this._generateMutations(l, { copyType: s, pasteType: o, copyRange: d, unitId: g, subUnitId: c });
1071
+ onBeforeCopy: (e, t, n) => this._collect(e, t, n),
1072
+ onPasteCells: (e, t, n, r) => {
1073
+ const { copyType: s = vt.COPY, pasteType: o } = r, { range: d } = e || {}, { range: l, unitId: g, subUnitId: a } = t;
1074
+ return this._generateMutations(l, { copyType: s, pasteType: o, copyRange: d, unitId: g, subUnitId: a });
1069
1075
  },
1070
- onPastePlainText: (e, n) => ({ undos: [], redos: [] })
1076
+ onPastePlainText: (e, t) => ({ undos: [], redos: [] })
1071
1077
  });
1072
1078
  }
1073
- _collect(e, n, t) {
1074
- var h;
1075
- const r = (h = this._renderManagerService.getRenderById(e)) == null ? void 0 : h.with(q);
1079
+ _collect(e, t, n) {
1080
+ var u;
1081
+ const r = (u = this._renderManagerService.getRenderById(e)) == null ? void 0 : u.with(Z);
1076
1082
  if (!r) return;
1077
- const s = r.attachRangeWithCoord(t);
1083
+ const s = r.attachRangeWithCoord(n);
1078
1084
  if (!s)
1079
1085
  return;
1080
- const { startX: o, endX: d, startY: l, endY: g } = s, c = this._sheetDrawingService.getDrawingData(e, n), a = [];
1081
- Object.keys(c).forEach((u) => {
1082
- const m = c[u], { transform: f } = m;
1086
+ const { startX: o, endX: d, startY: l, endY: g } = s, a = this._sheetDrawingService.getDrawingData(e, t), c = [];
1087
+ Object.keys(a).forEach((h) => {
1088
+ const m = a[h], { transform: f } = m;
1083
1089
  if (m.anchorType !== y.Both || !f)
1084
1090
  return;
1085
1091
  const { left: p = 0, top: C = 0, width: S = 0, height: v = 0 } = f, { drawingStartX: R, drawingEndX: _, drawingStartY: I, drawingEndY: w } = {
@@ -1088,47 +1094,47 @@ let je = class extends ie {
1088
1094
  drawingStartY: C,
1089
1095
  drawingEndY: C + v
1090
1096
  };
1091
- o <= R && _ <= d && l <= I && w <= g && a.push(m);
1092
- }), a.length && (this._copyInfo = {
1093
- drawings: a,
1097
+ o <= R && _ <= d && l <= I && w <= g && c.push(m);
1098
+ }), c.length && (this._copyInfo = {
1099
+ drawings: c,
1094
1100
  unitId: e,
1095
- subUnitId: n
1101
+ subUnitId: t
1096
1102
  });
1097
1103
  }
1098
1104
  // eslint-disable-next-line max-lines-per-function
1099
- _generateMutations(e, n) {
1105
+ _generateMutations(e, t) {
1100
1106
  var b;
1101
1107
  if (!this._copyInfo)
1102
1108
  return { redos: [], undos: [] };
1103
1109
  if ([
1104
- Se.SPECIAL_PASTE_COL_WIDTH,
1105
- Se.SPECIAL_PASTE_VALUE,
1106
- Se.SPECIAL_PASTE_FORMAT,
1107
- Se.SPECIAL_PASTE_FORMULA
1110
+ Ce.SPECIAL_PASTE_COL_WIDTH,
1111
+ Ce.SPECIAL_PASTE_VALUE,
1112
+ Ce.SPECIAL_PASTE_FORMAT,
1113
+ Ce.SPECIAL_PASTE_FORMULA
1108
1114
  ].includes(
1109
- n.pasteType
1115
+ t.pasteType
1110
1116
  ))
1111
1117
  return { redos: [], undos: [] };
1112
- const { copyRange: t } = n;
1113
- if (!t)
1118
+ const { copyRange: n } = t;
1119
+ if (!n)
1114
1120
  return { redos: [], undos: [] };
1115
- const { drawings: r, unitId: s, subUnitId: o } = this._copyInfo, { ranges: [d, l], mapFunc: g } = Qn([t, e]), { row: c, col: a } = g(d.startRow, d.startColumn), { row: h, col: u } = g(l.startRow, l.startColumn), m = (b = this._renderManagerService.getRenderById(s)) == null ? void 0 : b.with(q);
1121
+ const { drawings: r, unitId: s, subUnitId: o } = this._copyInfo, { ranges: [d, l], mapFunc: g } = er([n, e]), { row: a, col: c } = g(d.startRow, d.startColumn), { row: u, col: h } = g(l.startRow, l.startColumn), m = (b = this._renderManagerService.getRenderById(s)) == null ? void 0 : b.with(Z);
1116
1122
  if (!m)
1117
1123
  return { redos: [], undos: [] };
1118
1124
  const f = m.attachRangeWithCoord({
1119
- startRow: c,
1120
- endRow: c,
1121
- startColumn: a,
1122
- endColumn: a
1125
+ startRow: a,
1126
+ endRow: a,
1127
+ startColumn: c,
1128
+ endColumn: c
1123
1129
  }), p = m.attachRangeWithCoord({
1124
- startRow: h,
1125
- endRow: h,
1126
- startColumn: u,
1127
- endColumn: u
1130
+ startRow: u,
1131
+ endRow: u,
1132
+ startColumn: h,
1133
+ endColumn: h
1128
1134
  });
1129
1135
  if (!f || !p)
1130
1136
  return { redos: [], undos: [] };
1131
- const C = [], S = [], v = p.startX - f.startX, R = p.startY - f.startY, _ = h - c, I = u - a, w = n.copyType === _t.CUT, { _sheetDrawingService: O } = this;
1137
+ const C = [], S = [], v = p.startX - f.startX, R = p.startY - f.startY, _ = u - a, I = h - c, w = t.copyType === vt.CUT, { _sheetDrawingService: O } = this;
1132
1138
  return r.forEach((A) => {
1133
1139
  const { transform: E, sheetTransform: M } = A;
1134
1140
  if (!E)
@@ -1137,7 +1143,7 @@ let je = class extends ie {
1137
1143
  ...A,
1138
1144
  unitId: s,
1139
1145
  subUnitId: o,
1140
- drawingId: w ? A.drawingId : ge.generateRandomId(),
1146
+ drawingId: w ? A.drawingId : me.generateRandomId(),
1141
1147
  transform: {
1142
1148
  ...E,
1143
1149
  left: E.left + v,
@@ -1149,15 +1155,15 @@ let je = class extends ie {
1149
1155
  }
1150
1156
  };
1151
1157
  if (w) {
1152
- const { undo: U, redo: x, objects: Z } = O.getBatchUpdateOp([D]);
1158
+ const { undo: U, redo: W, objects: q } = O.getBatchUpdateOp([D]);
1153
1159
  C.push({
1154
1160
  id: P.id,
1155
1161
  params: {
1156
1162
  unitId: s,
1157
1163
  subUnitId: o,
1158
1164
  type: T.UPDATE,
1159
- op: x,
1160
- objects: Z
1165
+ op: W,
1166
+ objects: q
1161
1167
  }
1162
1168
  }), S.push({
1163
1169
  id: P.id,
@@ -1166,12 +1172,12 @@ let je = class extends ie {
1166
1172
  subUnitId: o,
1167
1173
  type: T.UPDATE,
1168
1174
  op: U,
1169
- objects: Z
1175
+ objects: q
1170
1176
  }
1171
1177
  });
1172
1178
  } else {
1173
- const { undo: U, redo: x, objects: Z } = O.getBatchAddOp([D]);
1174
- C.push({ id: P.id, params: { op: x, unitId: s, subUnitId: o, objects: Z, type: T.INSERT } }), S.push({ id: P.id, params: { op: U, unitId: s, subUnitId: o, objects: Z, type: T.REMOVE } });
1179
+ const { undo: U, redo: W, objects: q } = O.getBatchAddOp([D]);
1180
+ C.push({ id: P.id, params: { op: W, unitId: s, subUnitId: o, objects: q, type: T.INSERT } }), S.push({ id: P.id, params: { op: U, unitId: s, subUnitId: o, objects: q, type: T.REMOVE } });
1175
1181
  }
1176
1182
  }), {
1177
1183
  redos: C,
@@ -1179,43 +1185,43 @@ let je = class extends ie {
1179
1185
  };
1180
1186
  }
1181
1187
  };
1182
- je = Ni([
1183
- qe(0, er),
1184
- qe(1, J),
1185
- qe(2, F)
1186
- ], je);
1187
- var ji = Object.defineProperty, Wi = Object.getOwnPropertyDescriptor, xi = (i, e, n, t) => {
1188
- for (var r = t > 1 ? void 0 : t ? Wi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1189
- (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
1190
- return t && r && ji(e, n, r), r;
1191
- }, he = (i, e) => (n, t) => e(n, t, i);
1188
+ xe = Ei([
1189
+ Qe(0, tr),
1190
+ Qe(1, J),
1191
+ Qe(2, F)
1192
+ ], xe);
1193
+ var Ui = Object.defineProperty, Ai = Object.getOwnPropertyDescriptor, Ni = (i, e, t, n) => {
1194
+ for (var r = n > 1 ? void 0 : n ? Ai(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1195
+ (o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
1196
+ return n && r && Ui(e, t, r), r;
1197
+ }, ge = (i, e) => (t, n) => e(t, n, i);
1192
1198
  let We = class extends ie {
1193
- constructor(i, e, n, t, r) {
1194
- super(), this._drawingManagerService = i, this._renderManagerService = e, this._permissionService = n, this._univerInstanceService = t, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
1199
+ constructor(i, e, t, n, r) {
1200
+ super(), this._drawingManagerService = i, this._renderManagerService = e, this._permissionService = t, this._univerInstanceService = n, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
1195
1201
  }
1196
1202
  _initDrawingVisible() {
1197
1203
  const i = this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET);
1198
1204
  this.disposeWithMe(
1199
- Ce([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1205
+ Ie([i, this._userManagerService.currentUser$]).subscribe(([e, t]) => {
1200
1206
  if (!e) {
1201
1207
  this._drawingManagerService.setDrawingVisible(!1);
1202
1208
  return;
1203
1209
  }
1204
- e.activeSheet$.subscribe((t) => {
1205
- if (!t) {
1210
+ e.activeSheet$.subscribe((n) => {
1211
+ if (!n) {
1206
1212
  this._drawingManagerService.setDrawingVisible(!1);
1207
1213
  return;
1208
1214
  }
1209
- const r = e.getUnitId(), s = t.getSheetId();
1210
- if (this._permissionService.composePermission([new Ct(r).id, new Je(r, s).id]).every((d) => d.value))
1215
+ const r = e.getUnitId(), s = n.getSheetId();
1216
+ if (this._permissionService.composePermission([new It(r).id, new Je(r, s).id]).every((d) => d.value))
1211
1217
  this._drawingManagerService.setDrawingVisible(!0);
1212
1218
  else {
1213
1219
  this._drawingManagerService.setDrawingVisible(!1);
1214
- const d = e.getUnitId(), l = t.getSheetId(), g = this._drawingManagerService.getDrawingData(d, l), c = Object.values(g), a = this._renderManagerService.getRenderById(d), h = a == null ? void 0 : a.scene;
1215
- if (h == null)
1220
+ const d = e.getUnitId(), l = n.getSheetId(), g = this._drawingManagerService.getDrawingData(d, l), a = Object.values(g), c = this._renderManagerService.getRenderById(d), u = c == null ? void 0 : c.scene;
1221
+ if (u == null)
1216
1222
  return;
1217
- h.getAllObjectsByOrder().forEach((m) => {
1218
- m.classType === de.IMAGE && c.some((f) => m.oKey.includes(f.drawingId)) && h.removeObject(m);
1223
+ u.getAllObjectsByOrder().forEach((m) => {
1224
+ m.classType === de.IMAGE && a.some((f) => m.oKey.includes(f.drawingId)) && u.removeObject(m);
1219
1225
  });
1220
1226
  }
1221
1227
  });
@@ -1225,26 +1231,26 @@ let We = class extends ie {
1225
1231
  _initDrawingEditable() {
1226
1232
  const i = this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET);
1227
1233
  this.disposeWithMe(
1228
- Ce([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1234
+ Ie([i, this._userManagerService.currentUser$]).subscribe(([e, t]) => {
1229
1235
  if (!e) {
1230
1236
  this._drawingManagerService.setDrawingEditable(!1);
1231
1237
  return;
1232
1238
  }
1233
- e.activeSheet$.subscribe((t) => {
1234
- if (!t) {
1239
+ e.activeSheet$.subscribe((n) => {
1240
+ if (!n) {
1235
1241
  this._drawingManagerService.setDrawingEditable(!1);
1236
1242
  return;
1237
1243
  }
1238
- const r = e.getUnitId(), s = t.getSheetId();
1239
- if (this._permissionService.composePermission([new tt(r).id, new Pe(r, s).id]).every((d) => d.value))
1244
+ const r = e.getUnitId(), s = n.getSheetId();
1245
+ if (this._permissionService.composePermission([new nt(r).id, new Te(r, s).id]).every((d) => d.value))
1240
1246
  this._drawingManagerService.setDrawingEditable(!0);
1241
1247
  else {
1242
1248
  this._drawingManagerService.setDrawingEditable(!1);
1243
- const d = e.getUnitId(), l = t.getSheetId(), g = this._drawingManagerService.getDrawingData(d, l), c = Object.values(g), a = this._renderManagerService.getRenderById(d), h = a == null ? void 0 : a.scene;
1244
- if (h == null)
1249
+ const d = e.getUnitId(), l = n.getSheetId(), g = this._drawingManagerService.getDrawingData(d, l), a = Object.values(g), c = this._renderManagerService.getRenderById(d), u = c == null ? void 0 : c.scene;
1250
+ if (u == null)
1245
1251
  return;
1246
- h.getAllObjectsByOrder().forEach((m) => {
1247
- m.classType === de.IMAGE && c.some((f) => m.oKey.includes(f.drawingId)) && h.detachTransformerFrom(m);
1252
+ u.getAllObjectsByOrder().forEach((m) => {
1253
+ m.classType === de.IMAGE && a.some((f) => m.oKey.includes(f.drawingId)) && u.detachTransformerFrom(m);
1248
1254
  });
1249
1255
  }
1250
1256
  });
@@ -1254,36 +1260,36 @@ let We = class extends ie {
1254
1260
  _initViewPermissionChange() {
1255
1261
  const i = this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET);
1256
1262
  this.disposeWithMe(
1257
- Ce([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1258
- e && e.activeSheet$.subscribe((t) => {
1259
- var a;
1260
- if (!t)
1263
+ Ie([i, this._userManagerService.currentUser$]).subscribe(([e, t]) => {
1264
+ e && e.activeSheet$.subscribe((n) => {
1265
+ var c;
1266
+ if (!n)
1261
1267
  return;
1262
- const r = e.getUnitId(), s = t.getSheetId();
1268
+ const r = e.getUnitId(), s = n.getSheetId();
1263
1269
  let o = !0;
1264
1270
  const d = this._renderManagerService.getRenderById(r), l = d == null ? void 0 : d.scene;
1265
1271
  if (l == null)
1266
1272
  return;
1267
- const g = l.getTransformerByCreate(), c = this._permissionService.composePermission$([new Ct(r).id, new Je(r, s).id]).pipe(Ee((h) => h.every((u) => u.value)));
1268
- c == null || c.pipe(
1269
- re((h) => h !== o),
1270
- Ie()
1273
+ const g = l.getTransformerByCreate(), a = this._permissionService.composePermission$([new It(r).id, new Je(r, s).id]).pipe(Ue((u) => u.every((h) => h.value)));
1274
+ a == null || a.pipe(
1275
+ re((u) => u !== o),
1276
+ Re()
1271
1277
  ).subscribe({
1272
- next: (h) => {
1273
- o = h, this._drawingManagerService.setDrawingVisible(h);
1274
- const u = l.getAllObjectsByOrder(), m = this._drawingManagerService.getDrawingData(r, s), f = Object.values(m);
1275
- h ? this._drawingManagerService.addNotification(f) : (u.forEach((p) => {
1278
+ next: (u) => {
1279
+ o = u, this._drawingManagerService.setDrawingVisible(u);
1280
+ const h = l.getAllObjectsByOrder(), m = this._drawingManagerService.getDrawingData(r, s), f = Object.values(m);
1281
+ u ? this._drawingManagerService.addNotification(f) : (h.forEach((p) => {
1276
1282
  p.classType === de.IMAGE && f.some((C) => p.oKey.includes(C.drawingId)) && l.removeObject(p);
1277
1283
  }), g.clearSelectedObjects());
1278
1284
  }
1279
- }), (a = this._permissionService.getPermissionPoint$(new Je(r, s).id)) == null || a.pipe(
1280
- re((h) => h.value !== o),
1281
- Ie()
1285
+ }), (c = this._permissionService.getPermissionPoint$(new Je(r, s).id)) == null || c.pipe(
1286
+ re((u) => u.value !== o),
1287
+ Re()
1282
1288
  ).subscribe({
1283
1289
  complete: () => {
1284
1290
  o = !0, this._drawingManagerService.setDrawingVisible(!0);
1285
- const h = this._drawingManagerService.getDrawingData(r, s), u = Object.values(h);
1286
- this._drawingManagerService.addNotification(u);
1291
+ const u = this._drawingManagerService.getDrawingData(r, s), h = Object.values(u);
1292
+ this._drawingManagerService.addNotification(h);
1287
1293
  }
1288
1294
  });
1289
1295
  });
@@ -1293,37 +1299,37 @@ let We = class extends ie {
1293
1299
  _initEditPermissionChange() {
1294
1300
  const i = this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET);
1295
1301
  this.disposeWithMe(
1296
- Ce([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1297
- e && e.activeSheet$.subscribe((t) => {
1298
- var a;
1299
- if (!t)
1302
+ Ie([i, this._userManagerService.currentUser$]).subscribe(([e, t]) => {
1303
+ e && e.activeSheet$.subscribe((n) => {
1304
+ var c;
1305
+ if (!n)
1300
1306
  return;
1301
- const r = e.getUnitId(), s = t.getSheetId();
1307
+ const r = e.getUnitId(), s = n.getSheetId();
1302
1308
  let o = !0;
1303
1309
  const d = this._renderManagerService.getRenderById(r), l = d == null ? void 0 : d.scene;
1304
1310
  if (l == null)
1305
1311
  return;
1306
- const g = l.getTransformerByCreate(), c = this._permissionService.composePermission$([new tt(r).id, new Pe(r, s).id]).pipe(Ee((h) => h.every((u) => u.value)));
1307
- c == null || c.pipe(
1308
- re((h) => h !== o),
1309
- Ie()
1312
+ const g = l.getTransformerByCreate(), a = this._permissionService.composePermission$([new nt(r).id, new Te(r, s).id]).pipe(Ue((u) => u.every((h) => h.value)));
1313
+ a == null || a.pipe(
1314
+ re((u) => u !== o),
1315
+ Re()
1310
1316
  ).subscribe({
1311
- next: (h) => {
1312
- o = h, this._drawingManagerService.setDrawingEditable(h);
1313
- const u = l.getAllObjectsByOrder(), m = this._drawingManagerService.getDrawingData(r, s), f = Object.values(m);
1314
- h ? (u.forEach((p) => {
1317
+ next: (u) => {
1318
+ o = u, this._drawingManagerService.setDrawingEditable(u);
1319
+ const h = l.getAllObjectsByOrder(), m = this._drawingManagerService.getDrawingData(r, s), f = Object.values(m);
1320
+ u ? (h.forEach((p) => {
1315
1321
  p.classType === de.IMAGE && f.some((C) => p.oKey.includes(C.drawingId)) && l.attachTransformerTo(p);
1316
- }), this._drawingManagerService.addNotification(f)) : (u.forEach((p) => {
1322
+ }), this._drawingManagerService.addNotification(f)) : (h.forEach((p) => {
1317
1323
  p.classType === de.IMAGE && f.some((C) => p.oKey.includes(C.drawingId)) && l.detachTransformerFrom(p);
1318
1324
  }), g.clearSelectedObjects());
1319
1325
  }
1320
- }), (a = this._permissionService.getPermissionPoint$(new Pe(r, s).id)) == null || a.pipe(
1321
- re((h) => h.value !== o),
1322
- Ie()
1326
+ }), (c = this._permissionService.getPermissionPoint$(new Te(r, s).id)) == null || c.pipe(
1327
+ re((u) => u.value !== o),
1328
+ Re()
1323
1329
  ).subscribe({
1324
1330
  complete: () => {
1325
1331
  o = !0;
1326
- const h = e.getUnitId(), u = t.getSheetId(), m = this._drawingManagerService.getDrawingData(h, u), f = Object.values(m), p = this._renderManagerService.getRenderById(h), C = p == null ? void 0 : p.scene;
1332
+ const u = e.getUnitId(), h = n.getSheetId(), m = this._drawingManagerService.getDrawingData(u, h), f = Object.values(m), p = this._renderManagerService.getRenderById(u), C = p == null ? void 0 : p.scene;
1327
1333
  if (C == null)
1328
1334
  return;
1329
1335
  this._drawingManagerService.setDrawingEditable(!0), C.getAllObjectsByOrder().forEach((v) => {
@@ -1336,32 +1342,32 @@ let We = class extends ie {
1336
1342
  );
1337
1343
  }
1338
1344
  };
1339
- We = xi([
1340
- he(0, K),
1341
- he(1, J),
1342
- he(2, Rn),
1343
- he(3, fe),
1344
- he(4, W(In))
1345
+ We = Ni([
1346
+ ge(0, K),
1347
+ ge(1, J),
1348
+ ge(2, Dn),
1349
+ ge(3, pe),
1350
+ ge(4, x(Rn))
1345
1351
  ], We);
1346
- var $i = Object.defineProperty, Li = Object.getOwnPropertyDescriptor, Bi = (i, e, n, t) => {
1347
- for (var r = t > 1 ? void 0 : t ? Li(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1348
- (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
1349
- return t && r && $i(e, n, r), r;
1350
- }, Oe = (i, e) => (n, t) => e(n, t, i);
1351
- let xe = class extends ie {
1352
- constructor(i, e, n, t) {
1353
- super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = e, this._drawingManagerService = n, this._renderManagerService = t, this._initPrinting();
1352
+ var ji = Object.defineProperty, xi = Object.getOwnPropertyDescriptor, Wi = (i, e, t, n) => {
1353
+ for (var r = n > 1 ? void 0 : n ? xi(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1354
+ (o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
1355
+ return n && r && ji(e, t, r), r;
1356
+ }, Pe = (i, e) => (t, n) => e(t, n, i);
1357
+ let $e = class extends ie {
1358
+ constructor(i, e, t, n) {
1359
+ super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = e, this._drawingManagerService = t, this._renderManagerService = n, this._initPrinting();
1354
1360
  }
1355
1361
  _initPrinting() {
1356
1362
  this.disposeWithMe(
1357
1363
  this._sheetPrintInterceptorService.interceptor.intercept(
1358
1364
  this._sheetPrintInterceptorService.interceptor.getInterceptPoints().PRINTING_COMPONENT_COLLECT,
1359
1365
  {
1360
- handler: (i, e, n) => {
1361
- const { unitId: t, scene: r, subUnitId: s } = e, o = this._drawingManagerService.getDrawingDataForUnit(t), d = o == null ? void 0 : o[s];
1366
+ handler: (i, e, t) => {
1367
+ const { unitId: n, scene: r, subUnitId: s } = e, o = this._drawingManagerService.getDrawingDataForUnit(n), d = o == null ? void 0 : o[s];
1362
1368
  return d && d.order.forEach((l) => {
1363
1369
  this._drawingRenderService.renderDrawing(d.data[l], r);
1364
- }), n();
1370
+ }), t();
1365
1371
  }
1366
1372
  }
1367
1373
  )
@@ -1369,128 +1375,128 @@ let xe = class extends ie {
1369
1375
  this._sheetPrintInterceptorService.interceptor.intercept(
1370
1376
  this._sheetPrintInterceptorService.interceptor.getInterceptPoints().PRINTING_RANGE,
1371
1377
  {
1372
- handler: (i, e, n) => {
1373
- const { unitId: t, subUnitId: r } = e, s = this._renderManagerService.getRenderById(t);
1378
+ handler: (i, e, t) => {
1379
+ const { unitId: n, subUnitId: r } = e, s = this._renderManagerService.getRenderById(n);
1374
1380
  if (!s)
1375
- return n(i);
1376
- const o = s.with(q).getWorksheetSkeleton(r);
1381
+ return t(i);
1382
+ const o = s.with(Z).getWorksheetSkeleton(r);
1377
1383
  if (!o)
1378
- return n(i);
1379
- const d = this._drawingManagerService.getDrawingDataForUnit(t), l = d == null ? void 0 : d[e.subUnitId];
1384
+ return t(i);
1385
+ const d = this._drawingManagerService.getDrawingDataForUnit(n), l = d == null ? void 0 : d[e.subUnitId];
1380
1386
  if (!l)
1381
- return n(i);
1382
- const { scaleX: g, scaleY: c } = s.scene, a = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, h = l.order.map((u) => l.data[u]).filter((u) => u.drawingType !== k.DRAWING_DOM);
1383
- return h.length ? (h.forEach((u) => {
1384
- if (!u.groupId && u.transform && ge.isDefine(u.transform.left) && ge.isDefine(u.transform.top) && ge.isDefine(u.transform.width) && ge.isDefine(u.transform.height)) {
1385
- const m = o.skeleton.getCellIndexByOffset(u.transform.left, u.transform.top, g, c, { x: 0, y: 0 }), f = o.skeleton.getCellIndexByOffset(u.transform.left + u.transform.width, u.transform.top + u.transform.height, g, c, { x: 0, y: 0 });
1386
- m.column < a.startColumn && (a.startColumn = m.column), m.row < a.startRow && (a.startRow = m.row), a.endRow < f.row && (a.endRow = f.row), a.endColumn < f.column && (a.endColumn = f.column);
1387
+ return t(i);
1388
+ const { scaleX: g, scaleY: a } = s.scene, c = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, u = l.order.map((h) => l.data[h]).filter((h) => h.drawingType !== k.DRAWING_DOM);
1389
+ return u.length ? (u.forEach((h) => {
1390
+ if (!h.groupId && h.transform && me.isDefine(h.transform.left) && me.isDefine(h.transform.top) && me.isDefine(h.transform.width) && me.isDefine(h.transform.height)) {
1391
+ const m = o.skeleton.getCellIndexByOffset(h.transform.left, h.transform.top, g, a, { x: 0, y: 0 }), f = o.skeleton.getCellIndexByOffset(h.transform.left + h.transform.width, h.transform.top + h.transform.height, g, a, { x: 0, y: 0 });
1392
+ m.column < c.startColumn && (c.startColumn = m.column), m.row < c.startRow && (c.startRow = m.row), c.endRow < f.row && (c.endRow = f.row), c.endColumn < f.column && (c.endColumn = f.column);
1387
1393
  }
1388
- }), n(a)) : n(i);
1394
+ }), t(c)) : t(i);
1389
1395
  }
1390
1396
  }
1391
1397
  )
1392
1398
  );
1393
1399
  }
1394
1400
  };
1395
- xe = Bi([
1396
- Oe(0, W(tr)),
1397
- Oe(1, W(kn)),
1398
- Oe(2, K),
1399
- Oe(3, J)
1400
- ], xe);
1401
- var Gi = Object.defineProperty, Vi = Object.getOwnPropertyDescriptor, ki = (i, e, n, t) => {
1402
- for (var r = t > 1 ? void 0 : t ? Vi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1403
- (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
1404
- return t && r && Gi(e, n, r), r;
1405
- }, Q = (i, e) => (n, t) => e(n, t, i);
1406
- const Yi = [
1407
- Ot.id,
1408
- Pt.id,
1409
- Tt.id,
1401
+ $e = Wi([
1402
+ Pe(0, x(nr)),
1403
+ Pe(1, x(Yn)),
1404
+ Pe(2, K),
1405
+ Pe(3, J)
1406
+ ], $e);
1407
+ var $i = Object.defineProperty, Li = Object.getOwnPropertyDescriptor, Bi = (i, e, t, n) => {
1408
+ for (var r = n > 1 ? void 0 : n ? Li(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1409
+ (o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
1410
+ return n && r && $i(e, t, r), r;
1411
+ }, Q = (i, e) => (t, n) => e(t, n, i);
1412
+ const Gi = [
1410
1413
  Et.id,
1411
1414
  Ut.id,
1412
1415
  At.id,
1413
1416
  Nt.id,
1414
1417
  jt.id,
1415
- nt.id,
1416
- rt.id,
1417
- Wt.id,
1418
1418
  xt.id,
1419
+ Wt.id,
1419
1420
  $t.id,
1421
+ rt.id,
1422
+ it.id,
1420
1423
  Lt.id,
1421
1424
  Bt.id,
1422
1425
  Gt.id,
1423
1426
  Vt.id,
1424
1427
  kt.id,
1425
- Yt.id
1426
- ], Fi = [
1427
- _r.id,
1428
+ Yt.id,
1429
+ Ft.id,
1430
+ Xt.id,
1431
+ Ht.id
1432
+ ], Vi = [
1428
1433
  vr.id,
1429
1434
  Sr.id,
1430
1435
  Cr.id,
1431
1436
  Ir.id,
1432
- Rr.id
1437
+ Rr.id,
1438
+ Dr.id
1433
1439
  ];
1434
- let ot = class extends ie {
1435
- constructor(i, e, n, t, r, s, o, d, l) {
1436
- super(), this._context = i, this._renderManagerService = e, this._commandService = n, this._selectionRenderService = t, this._skeletonManagerService = r, this._sheetInterceptorService = s, this._sheetDrawingService = o, this._drawingManagerService = d, this._univerInstanceService = l, this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
1440
+ let at = class extends ie {
1441
+ constructor(i, e, t, n, r, s, o, d, l) {
1442
+ super(), this._context = i, this._renderManagerService = e, this._commandService = t, this._selectionRenderService = n, this._skeletonManagerService = r, this._sheetInterceptorService = s, this._sheetDrawingService = o, this._drawingManagerService = d, this._univerInstanceService = l, this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
1437
1443
  }
1438
1444
  _sheetInterceptorListener() {
1439
1445
  this.disposeWithMe(
1440
1446
  this._sheetInterceptorService.interceptCommand({
1441
1447
  getMutations: (i) => {
1442
- if (!Yi.includes(i.id))
1448
+ if (!Gi.includes(i.id))
1443
1449
  return { redos: [], undos: [] };
1444
1450
  if (i.params == null)
1445
1451
  return { redos: [], undos: [] };
1446
1452
  const e = i.id;
1447
- if (e === Ot.id)
1453
+ if (e === Et.id)
1448
1454
  return this._moveRowInterceptor(i.params, "insert");
1449
- if ([Vt.id, kt.id, Yt.id].includes(e))
1455
+ if ([Ft.id, Xt.id, Ht.id].includes(e))
1450
1456
  return this._moveRangeInterceptor(i.params);
1451
- if (e === Pt.id)
1457
+ if (e === Ut.id)
1452
1458
  return this._moveColInterceptor(i.params, "insert");
1453
- if (e === Tt.id)
1459
+ if (e === At.id)
1454
1460
  return this._moveRowInterceptor(i.params, "remove");
1455
- if (e === Et.id)
1461
+ if (e === Nt.id)
1456
1462
  return this._moveColInterceptor(i.params, "remove");
1457
- if (e === Ut.id) {
1458
- const { range: n } = i.params;
1463
+ if (e === jt.id) {
1464
+ const { range: t } = i.params;
1459
1465
  return this._getRangeMoveUndo(
1460
- n,
1466
+ t,
1461
1467
  0
1462
1468
  /* deleteLeft */
1463
1469
  );
1464
- } else if (e === At.id) {
1465
- const { range: n } = i.params;
1470
+ } else if (e === xt.id) {
1471
+ const { range: t } = i.params;
1466
1472
  return this._getRangeMoveUndo(
1467
- n,
1473
+ t,
1468
1474
  1
1469
1475
  /* deleteUp */
1470
1476
  );
1471
- } else if (e === Nt.id) {
1472
- const { range: n } = i.params;
1477
+ } else if (e === Wt.id) {
1478
+ const { range: t } = i.params;
1473
1479
  return this._getRangeMoveUndo(
1474
- n,
1480
+ t,
1475
1481
  2
1476
1482
  /* insertDown */
1477
1483
  );
1478
- } else if (e === jt.id) {
1479
- const { range: n } = i.params;
1484
+ } else if (e === $t.id) {
1485
+ const { range: t } = i.params;
1480
1486
  return this._getRangeMoveUndo(
1481
- n,
1487
+ t,
1482
1488
  3
1483
1489
  /* insertRight */
1484
1490
  );
1485
- } else if (e === $t.id || e === Lt.id) {
1486
- const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
1487
- return this._getDrawingUndoForRowVisible(t, r, s);
1488
- } else if (e === Bt.id || e === Gt.id) {
1489
- const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
1490
- return this._getDrawingUndoForColVisible(t, r, s);
1491
- } else if (e === nt.id || e === rt.id || e === Wt.id || e === xt.id) {
1492
- const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n, o = e === nt.id || e === rt.id;
1493
- return this._getDrawingUndoForRowAndColSize(t, r, s, o);
1491
+ } else if (e === Gt.id || e === Vt.id) {
1492
+ const t = i.params, { unitId: n, subUnitId: r, ranges: s } = t;
1493
+ return this._getDrawingUndoForRowVisible(n, r, s);
1494
+ } else if (e === kt.id || e === Yt.id) {
1495
+ const t = i.params, { unitId: n, subUnitId: r, ranges: s } = t;
1496
+ return this._getDrawingUndoForColVisible(n, r, s);
1497
+ } else if (e === rt.id || e === it.id || e === Lt.id || e === Bt.id) {
1498
+ const t = i.params, { unitId: n, subUnitId: r, ranges: s } = t, o = e === rt.id || e === it.id;
1499
+ return this._getDrawingUndoForRowAndColSize(n, r, s, o);
1494
1500
  }
1495
1501
  return { redos: [], undos: [] };
1496
1502
  }
@@ -1498,47 +1504,47 @@ let ot = class extends ie {
1498
1504
  );
1499
1505
  }
1500
1506
  _getRangeMoveUndo(i, e) {
1501
- const n = ce(this._univerInstanceService);
1502
- if (n == null)
1507
+ const t = ce(this._univerInstanceService);
1508
+ if (t == null)
1503
1509
  return { redos: [], undos: [] };
1504
- const t = n.unitId, r = n.subUnitId, s = [], o = [], d = this._sheetDrawingService.getDrawingData(t, r), l = [], g = [];
1505
- if (Object.keys(d).forEach((c) => {
1506
- const a = d[c], { updateDrawings: h, deleteDrawings: u } = this._getUpdateOrDeleteDrawings(i, e, a);
1507
- l.push(...h), g.push(...u);
1510
+ const n = t.unitId, r = t.subUnitId, s = [], o = [], d = this._sheetDrawingService.getDrawingData(n, r), l = [], g = [];
1511
+ if (Object.keys(d).forEach((a) => {
1512
+ const c = d[a], { updateDrawings: u, deleteDrawings: h } = this._getUpdateOrDeleteDrawings(i, e, c);
1513
+ l.push(...u), g.push(...h);
1508
1514
  }), l.length === 0 && g.length === 0)
1509
1515
  return { redos: [], undos: [] };
1510
1516
  if (l.length > 0) {
1511
- const c = this._sheetDrawingService.getBatchUpdateOp(l), { undo: a, redo: h, objects: u } = c;
1512
- s.push({ id: P.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type: T.UPDATE } }), o.push({ id: P.id, params: { unitId: t, subUnitId: r, op: a, objects: u, type: T.UPDATE } });
1517
+ const a = this._sheetDrawingService.getBatchUpdateOp(l), { undo: c, redo: u, objects: h } = a;
1518
+ s.push({ id: P.id, params: { unitId: n, subUnitId: r, op: u, objects: h, type: T.UPDATE } }), o.push({ id: P.id, params: { unitId: n, subUnitId: r, op: c, objects: h, type: T.UPDATE } });
1513
1519
  }
1514
1520
  if (g.length > 0) {
1515
- const c = this._sheetDrawingService.getBatchRemoveOp(g), a = c.undo, h = c.redo, u = c.objects;
1516
- s.push({ id: P.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type: T.REMOVE } }), o.push({ id: P.id, params: { unitId: t, subUnitId: r, op: a, objects: u, type: T.INSERT } });
1521
+ const a = this._sheetDrawingService.getBatchRemoveOp(g), c = a.undo, u = a.redo, h = a.objects;
1522
+ s.push({ id: P.id, params: { unitId: n, subUnitId: r, op: u, objects: h, type: T.REMOVE } }), o.push({ id: P.id, params: { unitId: n, subUnitId: r, op: c, objects: h, type: T.INSERT } });
1517
1523
  }
1518
- return s.push({ id: j.id, params: [t] }), o.push({ id: j.id, params: [t] }), {
1524
+ return s.push({ id: j.id, params: [n] }), o.push({ id: j.id, params: [n] }), {
1519
1525
  redos: s,
1520
1526
  undos: o
1521
1527
  };
1522
1528
  }
1523
- _getUpdateOrDeleteDrawings(i, e, n) {
1524
- const t = [], r = [], { sheetTransform: s, anchorType: o = y.Position, transform: d, unitId: l, subUnitId: g, drawingId: c } = n, { from: a, to: h } = s, { row: u, column: m } = a, { row: f, column: p } = h;
1529
+ _getUpdateOrDeleteDrawings(i, e, t) {
1530
+ const n = [], r = [], { sheetTransform: s, anchorType: o = y.Position, transform: d, unitId: l, subUnitId: g, drawingId: a } = t, { from: c, to: u } = s, { row: h, column: m } = c, { row: f, column: p } = u;
1525
1531
  if (s == null || d == null)
1526
1532
  return {
1527
- updateDrawings: t,
1533
+ updateDrawings: n,
1528
1534
  deleteDrawings: r
1529
1535
  };
1530
1536
  const { startRow: C, endRow: S, startColumn: v, endColumn: R } = i;
1531
1537
  let _ = null, I = null;
1532
- if (e === 0 && u >= C && f <= S)
1538
+ if (e === 0 && h >= C && f <= S)
1533
1539
  if (m >= v && p <= R)
1534
- r.push({ unitId: l, subUnitId: g, drawingId: c });
1540
+ r.push({ unitId: l, subUnitId: g, drawingId: a });
1535
1541
  else {
1536
1542
  const w = this._shrinkCol(s, d, v, R, o);
1537
1543
  _ = w == null ? void 0 : w.newSheetTransform, I = w == null ? void 0 : w.newTransform;
1538
1544
  }
1539
1545
  else if (e === 1 && m >= v && p <= R)
1540
- if (u >= C && f <= S)
1541
- r.push({ unitId: l, subUnitId: g, drawingId: c });
1546
+ if (h >= C && f <= S)
1547
+ r.push({ unitId: l, subUnitId: g, drawingId: a });
1542
1548
  else {
1543
1549
  const w = this._shrinkRow(s, d, C, S, o);
1544
1550
  _ = w == null ? void 0 : w.newSheetTransform, I = w == null ? void 0 : w.newTransform;
@@ -1552,43 +1558,43 @@ let ot = class extends ie {
1552
1558
  }
1553
1559
  if (_ != null && I != null) {
1554
1560
  const w = L(_, this._selectionRenderService, this._skeletonManagerService);
1555
- t.push({ ...n, sheetTransform: _, transform: w });
1561
+ n.push({ ...t, sheetTransform: _, transform: w });
1556
1562
  }
1557
- return { updateDrawings: t, deleteDrawings: r };
1563
+ return { updateDrawings: n, deleteDrawings: r };
1558
1564
  }
1559
- _remainDrawingSize(i, e, n) {
1560
- const t = N({ ...i }, this._selectionRenderService);
1561
- t != null && e.push({
1562
- ...n,
1563
- sheetTransform: t
1565
+ _remainDrawingSize(i, e, t) {
1566
+ const n = N({ ...i }, this._selectionRenderService);
1567
+ n != null && e.push({
1568
+ ...t,
1569
+ sheetTransform: n
1564
1570
  });
1565
1571
  }
1566
1572
  // eslint-disable-next-line max-lines-per-function
1567
- _getDrawingUndoForColVisible(i, e, n) {
1568
- const t = this._drawingManagerService.getDrawingData(i, e), r = [], s = [];
1569
- if (Object.keys(t).forEach((c) => {
1570
- const a = t[c], { sheetTransform: h, transform: u, anchorType: m = y.Position } = a;
1573
+ _getDrawingUndoForColVisible(i, e, t) {
1574
+ const n = this._drawingManagerService.getDrawingData(i, e), r = [], s = [];
1575
+ if (Object.keys(n).forEach((a) => {
1576
+ const c = n[a], { sheetTransform: u, transform: h, anchorType: m = y.Position } = c;
1571
1577
  if (m === y.None)
1572
- this._remainDrawingSize(u, r, a);
1578
+ this._remainDrawingSize(h, r, c);
1573
1579
  else {
1574
- const { from: f, to: p } = h, { row: C, column: S } = f, { row: v, column: R } = p;
1575
- for (let _ = 0; _ < n.length; _++) {
1576
- const I = n[_], { startRow: w, endRow: O, startColumn: b, endColumn: A } = I;
1580
+ const { from: f, to: p } = u, { row: C, column: S } = f, { row: v, column: R } = p;
1581
+ for (let _ = 0; _ < t.length; _++) {
1582
+ const I = t[_], { startRow: w, endRow: O, startColumn: b, endColumn: A } = I;
1577
1583
  if (R < b)
1578
1584
  continue;
1579
1585
  if (m === y.Position) {
1580
1586
  let D = null, U = null;
1581
1587
  if (S >= b && S <= A) {
1582
- const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: A, startRow: f.row, endRow: p.row });
1583
- if (x == null)
1588
+ const W = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: A, startRow: f.row, endRow: p.row });
1589
+ if (W == null)
1584
1590
  return;
1585
- U = { ...u, left: x.startX };
1591
+ U = { ...h, left: W.startX };
1586
1592
  }
1587
1593
  if (U != null && (D = N(U, this._selectionRenderService), D != null && U != null)) {
1588
- r.push({ ...a, sheetTransform: D, transform: U });
1594
+ r.push({ ...c, sheetTransform: D, transform: U });
1589
1595
  break;
1590
1596
  }
1591
- this._remainDrawingSize(u, r, a);
1597
+ this._remainDrawingSize(h, r, c);
1592
1598
  continue;
1593
1599
  }
1594
1600
  if (S >= b && R <= A)
@@ -1599,43 +1605,43 @@ let ot = class extends ie {
1599
1605
  if (D == null)
1600
1606
  return;
1601
1607
  M = {
1602
- ...u,
1608
+ ...h,
1603
1609
  left: (D == null ? void 0 : D.startX) || 0,
1604
- width: ((u == null ? void 0 : u.width) || 0) - D.endX + D.startX
1610
+ width: ((h == null ? void 0 : h.width) || 0) - D.endX + D.startX
1605
1611
  };
1606
1612
  } else if (R >= b && R <= A) {
1607
1613
  const D = this._skeletonManagerService.attachRangeWithCoord({ startColumn: b, endColumn: R, startRow: f.row, endRow: p.row });
1608
1614
  if (D == null)
1609
1615
  return;
1610
1616
  M = {
1611
- ...u,
1612
- left: D.startX - ((u == null ? void 0 : u.width) || 0)
1617
+ ...h,
1618
+ left: D.startX - ((h == null ? void 0 : h.width) || 0)
1613
1619
  };
1614
1620
  } else {
1615
1621
  const D = this._skeletonManagerService.attachRangeWithCoord({ startColumn: b, endColumn: A, startRow: f.row, endRow: p.row });
1616
1622
  if (D == null)
1617
1623
  return;
1618
1624
  if (M = {
1619
- ...u,
1620
- width: ((u == null ? void 0 : u.width) || 0) - D.endX + D.startX
1625
+ ...h,
1626
+ width: ((h == null ? void 0 : h.width) || 0) - D.endX + D.startX
1621
1627
  }, E = N(M, this._selectionRenderService), E != null && M != null) {
1622
- s.push({ ...a, sheetTransform: E, transform: M });
1628
+ s.push({ ...c, sheetTransform: E, transform: M });
1623
1629
  break;
1624
1630
  }
1625
1631
  }
1626
1632
  if (M != null && (E = N(M, this._selectionRenderService)), M != null && E != null) {
1627
- r.push({ ...a, sheetTransform: E, transform: M });
1633
+ r.push({ ...c, sheetTransform: E, transform: M });
1628
1634
  break;
1629
1635
  } else
1630
- this._remainDrawingSize(u, r, a);
1636
+ this._remainDrawingSize(h, r, c);
1631
1637
  }
1632
1638
  }
1633
1639
  }), r.length === 0 && s.length === 0)
1634
1640
  return { redos: [], undos: [] };
1635
1641
  const { redos: o, undos: d } = this._createUndoAndRedoMutation(i, e, r), l = [], g = [];
1636
1642
  if (s.length > 0) {
1637
- const { redos: c, undos: a } = this._createUndoAndRedoMutation(i, e, s);
1638
- l.push(...c), g.push(...a);
1643
+ const { redos: a, undos: c } = this._createUndoAndRedoMutation(i, e, s);
1644
+ l.push(...a), g.push(...c);
1639
1645
  }
1640
1646
  return {
1641
1647
  redos: o,
@@ -1644,8 +1650,8 @@ let ot = class extends ie {
1644
1650
  preUndos: g
1645
1651
  };
1646
1652
  }
1647
- _createUndoAndRedoMutation(i, e, n) {
1648
- const t = this._sheetDrawingService.getBatchUpdateOp(n), { undo: r, redo: s, objects: o } = t, d = [
1653
+ _createUndoAndRedoMutation(i, e, t) {
1654
+ const n = this._sheetDrawingService.getBatchUpdateOp(t), { undo: r, redo: s, objects: o } = n, d = [
1649
1655
  { id: P.id, params: { unitId: i, subUnitId: e, op: s, objects: o, type: T.UPDATE } },
1650
1656
  { id: j.id, params: [i] }
1651
1657
  ], l = [
@@ -1658,31 +1664,31 @@ let ot = class extends ie {
1658
1664
  };
1659
1665
  }
1660
1666
  // eslint-disable-next-line max-lines-per-function
1661
- _getDrawingUndoForRowVisible(i, e, n) {
1662
- const t = this._drawingManagerService.getDrawingData(i, e), r = [], s = [];
1663
- if (Object.keys(t).forEach((c) => {
1664
- const a = t[c], { sheetTransform: h, transform: u, anchorType: m = y.Position } = a;
1667
+ _getDrawingUndoForRowVisible(i, e, t) {
1668
+ const n = this._drawingManagerService.getDrawingData(i, e), r = [], s = [];
1669
+ if (Object.keys(n).forEach((a) => {
1670
+ const c = n[a], { sheetTransform: u, transform: h, anchorType: m = y.Position } = c;
1665
1671
  if (m === y.None)
1666
- this._remainDrawingSize(u, r, a);
1672
+ this._remainDrawingSize(h, r, c);
1667
1673
  else {
1668
- const { from: f, to: p } = h, { row: C, column: S } = f, { row: v, column: R } = p;
1669
- for (let _ = 0; _ < n.length; _++) {
1670
- const I = n[_], { startRow: w, endRow: O, startColumn: b, endColumn: A } = I;
1674
+ const { from: f, to: p } = u, { row: C, column: S } = f, { row: v, column: R } = p;
1675
+ for (let _ = 0; _ < t.length; _++) {
1676
+ const I = t[_], { startRow: w, endRow: O, startColumn: b, endColumn: A } = I;
1671
1677
  if (v < w)
1672
1678
  continue;
1673
1679
  if (m === y.Position) {
1674
1680
  let D = null, U = null;
1675
1681
  if (C >= w && C <= O) {
1676
- const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: C, endRow: O });
1677
- if (x == null)
1682
+ const W = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: C, endRow: O });
1683
+ if (W == null)
1678
1684
  return;
1679
- U = { ...u, top: x.startY };
1685
+ U = { ...h, top: W.startY };
1680
1686
  }
1681
1687
  if (U != null && (D = N(U, this._selectionRenderService), D != null && U != null)) {
1682
- r.push({ ...a, sheetTransform: D, transform: U });
1688
+ r.push({ ...c, sheetTransform: D, transform: U });
1683
1689
  break;
1684
1690
  }
1685
- this._remainDrawingSize(u, r, a);
1691
+ this._remainDrawingSize(h, r, c);
1686
1692
  continue;
1687
1693
  }
1688
1694
  if (C >= w && v <= O)
@@ -1693,43 +1699,43 @@ let ot = class extends ie {
1693
1699
  if (D == null)
1694
1700
  return;
1695
1701
  M = {
1696
- ...u,
1702
+ ...h,
1697
1703
  top: (D == null ? void 0 : D.startY) || 0,
1698
- height: ((u == null ? void 0 : u.height) || 0) - D.endY + D.startY
1704
+ height: ((h == null ? void 0 : h.height) || 0) - D.endY + D.startY
1699
1705
  };
1700
1706
  } else if (v >= w && v <= O) {
1701
1707
  const D = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: w, endRow: v });
1702
1708
  if (D == null)
1703
1709
  return;
1704
1710
  M = {
1705
- ...u,
1706
- top: D.startY - ((u == null ? void 0 : u.height) || 0)
1711
+ ...h,
1712
+ top: D.startY - ((h == null ? void 0 : h.height) || 0)
1707
1713
  };
1708
1714
  } else {
1709
1715
  const D = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: w, endRow: O });
1710
1716
  if (D == null)
1711
1717
  return;
1712
1718
  if (M = {
1713
- ...u,
1714
- height: ((u == null ? void 0 : u.height) || 0) - D.endY + D.startY
1719
+ ...h,
1720
+ height: ((h == null ? void 0 : h.height) || 0) - D.endY + D.startY
1715
1721
  }, E = N(M, this._selectionRenderService), E != null && M != null) {
1716
- s.push({ ...a, sheetTransform: E, transform: M });
1722
+ s.push({ ...c, sheetTransform: E, transform: M });
1717
1723
  break;
1718
1724
  }
1719
1725
  }
1720
1726
  if (M != null && (E = N(M, this._selectionRenderService)), M != null && E != null) {
1721
- r.push({ ...a, sheetTransform: E, transform: M });
1727
+ r.push({ ...c, sheetTransform: E, transform: M });
1722
1728
  break;
1723
1729
  } else
1724
- this._remainDrawingSize(u, r, a);
1730
+ this._remainDrawingSize(h, r, c);
1725
1731
  }
1726
1732
  }
1727
1733
  }), r.length === 0 && s.length === 0)
1728
1734
  return { redos: [], undos: [] };
1729
1735
  const { redos: o, undos: d } = this._createUndoAndRedoMutation(i, e, r), l = [], g = [];
1730
1736
  if (s.length > 0) {
1731
- const { redos: c, undos: a } = this._createUndoAndRedoMutation(i, e, s);
1732
- l.push(...c), g.push(...a);
1737
+ const { redos: a, undos: c } = this._createUndoAndRedoMutation(i, e, s);
1738
+ l.push(...a), g.push(...c);
1733
1739
  }
1734
1740
  return {
1735
1741
  redos: o,
@@ -1738,19 +1744,19 @@ let ot = class extends ie {
1738
1744
  preUndos: g
1739
1745
  };
1740
1746
  }
1741
- _getDrawingUndoForRowAndColSize(i, e, n, t) {
1747
+ _getDrawingUndoForRowAndColSize(i, e, t, n) {
1742
1748
  const r = this._drawingManagerService.getDrawingData(i, e), s = [];
1743
1749
  return Object.keys(r).forEach((o) => {
1744
- const d = r[o], { sheetTransform: l, transform: g, anchorType: c = y.Position } = d;
1745
- if (c === y.None)
1750
+ const d = r[o], { sheetTransform: l, transform: g, anchorType: a = y.Position } = d;
1751
+ if (a === y.None)
1746
1752
  this._remainDrawingSize(g, s, d);
1747
1753
  else {
1748
- const { from: a, to: h } = l, { row: u, column: m } = a, { row: f, column: p } = h;
1749
- for (let C = 0; C < n.length; C++) {
1750
- const S = n[C], { startRow: v, endRow: R, startColumn: _, endColumn: I } = S;
1754
+ const { from: c, to: u } = l, { row: h, column: m } = c, { row: f, column: p } = u;
1755
+ for (let C = 0; C < t.length; C++) {
1756
+ const S = t[C], { startRow: v, endRow: R, startColumn: _, endColumn: I } = S;
1751
1757
  if (f < v || p < _)
1752
1758
  continue;
1753
- if (c === y.Position && (u <= v && f >= R || m <= _ && p >= I)) {
1759
+ if (a === y.Position && (h <= v && f >= R || m <= _ && p >= I)) {
1754
1760
  this._remainDrawingSize(g, s, d);
1755
1761
  continue;
1756
1762
  }
@@ -1771,45 +1777,45 @@ let ot = class extends ie {
1771
1777
  }), s.length === 0 ? { redos: [], undos: [] } : this._createUndoAndRedoMutation(i, e, s);
1772
1778
  }
1773
1779
  _getUnitIdAndSubUnitId(i, e) {
1774
- let n, t;
1780
+ let t, n;
1775
1781
  if (e === "insert")
1776
- n = i.unitId, t = i.subUnitId;
1782
+ t = i.unitId, n = i.subUnitId;
1777
1783
  else {
1778
1784
  const r = ce(this._univerInstanceService);
1779
1785
  if (r == null)
1780
1786
  return;
1781
- n = r.unitId, t = r.subUnitId;
1787
+ t = r.unitId, n = r.subUnitId;
1782
1788
  }
1783
- return { unitId: n, subUnitId: t };
1789
+ return { unitId: t, subUnitId: n };
1784
1790
  }
1785
1791
  _moveRangeInterceptor(i) {
1786
1792
  var v, R;
1787
- const { toRange: e, fromRange: n } = i, t = ce(this._univerInstanceService);
1788
- if (!t)
1793
+ const { toRange: e, fromRange: t } = i, n = ce(this._univerInstanceService);
1794
+ if (!n)
1789
1795
  return { redos: [], undos: [] };
1790
- const { unitId: r, subUnitId: s } = t, o = (R = (v = this._renderManagerService.getRenderById(r)) == null ? void 0 : v.with(q)) == null ? void 0 : R.getCurrentSkeleton();
1796
+ const { unitId: r, subUnitId: s } = n, o = (R = (v = this._renderManagerService.getRenderById(r)) == null ? void 0 : v.with(Z)) == null ? void 0 : R.getCurrentSkeleton();
1791
1797
  if (!o)
1792
1798
  return { redos: [], undos: [] };
1793
- const d = Te(o, n);
1799
+ const d = Ee(o, t);
1794
1800
  if (!d)
1795
1801
  return { redos: [], undos: [] };
1796
- const { startX: l, endX: g, startY: c, endY: a } = d, h = this._sheetDrawingService.getDrawingData(r, s), u = [];
1797
- Object.keys(h).forEach((_) => {
1798
- const I = h[_];
1802
+ const { startX: l, endX: g, startY: a, endY: c } = d, u = this._sheetDrawingService.getDrawingData(r, s), h = [];
1803
+ Object.keys(u).forEach((_) => {
1804
+ const I = u[_];
1799
1805
  if (I.anchorType !== y.Both)
1800
1806
  return;
1801
1807
  const { transform: w } = I;
1802
1808
  if (!w)
1803
1809
  return;
1804
- const { left: O = 0, top: b = 0, width: A = 0, height: E = 0 } = w, { drawingStartX: M, drawingEndX: D, drawingStartY: U, drawingEndY: x } = {
1810
+ const { left: O = 0, top: b = 0, width: A = 0, height: E = 0 } = w, { drawingStartX: M, drawingEndX: D, drawingStartY: U, drawingEndY: W } = {
1805
1811
  drawingStartX: O,
1806
1812
  drawingEndX: O + A,
1807
1813
  drawingStartY: b,
1808
1814
  drawingEndY: b + E
1809
1815
  };
1810
- l <= M && D <= g && c <= U && x <= a && u.push(I);
1816
+ l <= M && D <= g && a <= U && W <= c && h.push(I);
1811
1817
  });
1812
- const m = [], f = [], p = e.startRow - n.startRow, C = e.startColumn - n.startColumn, S = u.map((_) => {
1818
+ const m = [], f = [], p = e.startRow - t.startRow, C = e.startColumn - t.startColumn, S = h.map((_) => {
1813
1819
  const I = _.sheetTransform, w = {
1814
1820
  to: { ...I.to, row: I.to.row + p, column: I.to.column + C },
1815
1821
  from: { ...I.from, row: I.from.row + p, column: I.from.column + C }
@@ -1829,12 +1835,12 @@ let ot = class extends ie {
1829
1835
  return { redos: m, undos: f };
1830
1836
  }
1831
1837
  _moveRowInterceptor(i, e) {
1832
- const n = this._getUnitIdAndSubUnitId(i, e);
1833
- if (n == null)
1838
+ const t = this._getUnitIdAndSubUnitId(i, e);
1839
+ if (t == null)
1834
1840
  return { redos: [], undos: [] };
1835
- const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startRow, d = s.endRow, l = [], g = [], c = this._sheetDrawingService.getDrawingData(t, r), a = [], h = [];
1836
- if (Object.keys(c).forEach((u) => {
1837
- const m = c[u], { sheetTransform: f, transform: p, anchorType: C = y.Position } = m;
1841
+ const { unitId: n, subUnitId: r } = t, { range: s } = i, o = s.startRow, d = s.endRow, l = [], g = [], a = this._sheetDrawingService.getDrawingData(n, r), c = [], u = [];
1842
+ if (Object.keys(a).forEach((h) => {
1843
+ const m = a[h], { sheetTransform: f, transform: p, anchorType: C = y.Position } = m;
1838
1844
  if (f == null || p == null)
1839
1845
  return;
1840
1846
  let S, v;
@@ -1844,7 +1850,7 @@ let ot = class extends ie {
1844
1850
  } else {
1845
1851
  const { from: _, to: I } = f, { row: w } = _, { row: O } = I;
1846
1852
  if (C === y.Both && w >= o && O <= d)
1847
- h.push({ unitId: t, subUnitId: r, drawingId: u });
1853
+ u.push({ unitId: n, subUnitId: r, drawingId: h });
1848
1854
  else {
1849
1855
  const b = this._shrinkRow(f, p, o, d, C);
1850
1856
  S = b == null ? void 0 : b.newSheetTransform, v = b == null ? void 0 : b.newTransform;
@@ -1852,30 +1858,30 @@ let ot = class extends ie {
1852
1858
  }
1853
1859
  if (!S || !v)
1854
1860
  return;
1855
- const R = { unitId: t, subUnitId: r, drawingId: u, transform: v, sheetTransform: S };
1856
- a.push(R);
1857
- }), a.length === 0 && h.length === 0)
1861
+ const R = { unitId: n, subUnitId: r, drawingId: h, transform: v, sheetTransform: S };
1862
+ c.push(R);
1863
+ }), c.length === 0 && u.length === 0)
1858
1864
  return { redos: [], undos: [] };
1859
- if (a.length > 0) {
1860
- const u = this._sheetDrawingService.getBatchUpdateOp(a), { undo: m, redo: f, objects: p } = u;
1861
- l.push({ id: P.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: T.UPDATE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: T.UPDATE } });
1865
+ if (c.length > 0) {
1866
+ const h = this._sheetDrawingService.getBatchUpdateOp(c), { undo: m, redo: f, objects: p } = h;
1867
+ l.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: p, type: T.UPDATE } }), g.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: p, type: T.UPDATE } });
1862
1868
  }
1863
- if (h.length > 0) {
1864
- const u = this._sheetDrawingService.getBatchRemoveOp(h), m = u.undo, f = u.redo, p = u.objects;
1865
- l.push({ id: P.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: T.REMOVE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: T.INSERT } });
1869
+ if (u.length > 0) {
1870
+ const h = this._sheetDrawingService.getBatchRemoveOp(u), m = h.undo, f = h.redo, p = h.objects;
1871
+ l.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: p, type: T.REMOVE } }), g.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: p, type: T.INSERT } });
1866
1872
  }
1867
- return l.push({ id: j.id, params: [t] }), g.push({ id: j.id, params: [t] }), {
1873
+ return l.push({ id: j.id, params: [n] }), g.push({ id: j.id, params: [n] }), {
1868
1874
  redos: l,
1869
1875
  undos: g
1870
1876
  };
1871
1877
  }
1872
1878
  _moveColInterceptor(i, e) {
1873
- const n = this._getUnitIdAndSubUnitId(i, e);
1874
- if (n == null)
1879
+ const t = this._getUnitIdAndSubUnitId(i, e);
1880
+ if (t == null)
1875
1881
  return { redos: [], undos: [] };
1876
- const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startColumn, d = s.endColumn, l = [], g = [], c = this._sheetDrawingService.getDrawingData(t, r), a = [], h = [];
1877
- if (Object.keys(c).forEach((u) => {
1878
- const m = c[u], { sheetTransform: f, transform: p, anchorType: C = y.Position } = m;
1882
+ const { unitId: n, subUnitId: r } = t, { range: s } = i, o = s.startColumn, d = s.endColumn, l = [], g = [], a = this._sheetDrawingService.getDrawingData(n, r), c = [], u = [];
1883
+ if (Object.keys(a).forEach((h) => {
1884
+ const m = a[h], { sheetTransform: f, transform: p, anchorType: C = y.Position } = m;
1879
1885
  if (f == null || p == null)
1880
1886
  return;
1881
1887
  let S, v;
@@ -1885,7 +1891,7 @@ let ot = class extends ie {
1885
1891
  } else {
1886
1892
  const { from: _, to: I } = f, { column: w } = _, { column: O } = I;
1887
1893
  if (C === y.Both && w >= o && O <= d)
1888
- h.push({ unitId: t, subUnitId: r, drawingId: u });
1894
+ u.push({ unitId: n, subUnitId: r, drawingId: h });
1889
1895
  else {
1890
1896
  const b = this._shrinkCol(f, p, o, d, C);
1891
1897
  S = b == null ? void 0 : b.newSheetTransform, v = b == null ? void 0 : b.newTransform;
@@ -1893,205 +1899,205 @@ let ot = class extends ie {
1893
1899
  }
1894
1900
  if (!S || !v)
1895
1901
  return;
1896
- const R = { unitId: t, subUnitId: r, drawingId: u, transform: v, sheetTransform: S };
1897
- a.push(R);
1898
- }), a.length === 0 && h.length === 0)
1902
+ const R = { unitId: n, subUnitId: r, drawingId: h, transform: v, sheetTransform: S };
1903
+ c.push(R);
1904
+ }), c.length === 0 && u.length === 0)
1899
1905
  return { redos: [], undos: [] };
1900
- if (a.length > 0) {
1901
- const u = this._sheetDrawingService.getBatchUpdateOp(a), { undo: m, redo: f, objects: p } = u;
1902
- l.push({ id: P.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: T.UPDATE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: T.UPDATE } });
1906
+ if (c.length > 0) {
1907
+ const h = this._sheetDrawingService.getBatchUpdateOp(c), { undo: m, redo: f, objects: p } = h;
1908
+ l.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: p, type: T.UPDATE } }), g.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: p, type: T.UPDATE } });
1903
1909
  }
1904
- if (h.length > 0) {
1905
- const u = this._sheetDrawingService.getBatchRemoveOp(h), m = u.undo, f = u.redo, p = u.objects;
1906
- l.push({ id: P.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: T.REMOVE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: T.INSERT } });
1910
+ if (u.length > 0) {
1911
+ const h = this._sheetDrawingService.getBatchRemoveOp(u), m = h.undo, f = h.redo, p = h.objects;
1912
+ l.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: p, type: T.REMOVE } }), g.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: p, type: T.INSERT } });
1907
1913
  }
1908
- return l.push({ id: j.id, params: [t] }), g.push({ id: j.id, params: [t] }), { redos: l, undos: g };
1914
+ return l.push({ id: j.id, params: [n] }), g.push({ id: j.id, params: [n] }), { redos: l, undos: g };
1909
1915
  }
1910
- _expandCol(i, e, n, t, r = y.Position) {
1911
- const s = t - n + 1, { from: o, to: d } = i, { column: l } = o, { column: g } = d;
1916
+ _expandCol(i, e, t, n, r = y.Position) {
1917
+ const s = n - t + 1, { from: o, to: d } = i, { column: l } = o, { column: g } = d;
1912
1918
  if (r === y.None)
1913
1919
  return {
1914
1920
  newSheetTransform: N({ ...e }, this._selectionRenderService),
1915
1921
  newTransform: e
1916
1922
  };
1917
- let c = null, a = null;
1918
- if (l >= n) {
1919
- const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: t, startRow: o.row, endRow: d.row });
1920
- if (h == null)
1923
+ let a = null, c = null;
1924
+ if (l >= t) {
1925
+ const u = this._skeletonManagerService.attachRangeWithCoord({ startColumn: t, endColumn: n, startRow: o.row, endRow: d.row });
1926
+ if (u == null)
1921
1927
  return;
1922
- a = { ...e, left: (e.left || 0) + h.endX - h.startX }, c = N(a, this._selectionRenderService);
1923
- } else if (g >= t)
1928
+ c = { ...e, left: (e.left || 0) + u.endX - u.startX }, a = N(c, this._selectionRenderService);
1929
+ } else if (g >= n)
1924
1930
  if (r === y.Both)
1925
- c = {
1931
+ a = {
1926
1932
  from: { ...o },
1927
1933
  to: { ...d, column: g + s }
1928
- }, a = L(c, this._selectionRenderService, this._skeletonManagerService);
1934
+ }, c = L(a, this._selectionRenderService, this._skeletonManagerService);
1929
1935
  else
1930
1936
  return {
1931
1937
  newSheetTransform: N({ ...e }, this._selectionRenderService),
1932
1938
  newTransform: e
1933
1939
  };
1934
- return c != null && a != null ? {
1935
- newSheetTransform: c,
1936
- newTransform: a
1940
+ return a != null && c != null ? {
1941
+ newSheetTransform: a,
1942
+ newTransform: c
1937
1943
  } : null;
1938
1944
  }
1939
- _shrinkCol(i, e, n, t, r = y.Position) {
1940
- const s = t - n + 1, { from: o, to: d } = i, { column: l } = o, { column: g } = d;
1945
+ _shrinkCol(i, e, t, n, r = y.Position) {
1946
+ const s = n - t + 1, { from: o, to: d } = i, { column: l } = o, { column: g } = d;
1941
1947
  if (r === y.None)
1942
1948
  return {
1943
1949
  newSheetTransform: N({ ...e }, this._selectionRenderService),
1944
1950
  newTransform: e
1945
1951
  };
1946
- let c = null, a = null;
1947
- if (l > t)
1948
- c = {
1952
+ let a = null, c = null;
1953
+ if (l > n)
1954
+ a = {
1949
1955
  from: { ...o, column: l - s },
1950
1956
  to: { ...d, column: g - s }
1951
- }, a = L(c, this._selectionRenderService, this._skeletonManagerService);
1957
+ }, c = L(a, this._selectionRenderService, this._skeletonManagerService);
1952
1958
  else {
1953
- if (l >= n && g <= t)
1959
+ if (l >= t && g <= n)
1954
1960
  return null;
1955
- if (l < n && g > t)
1961
+ if (l < t && g > n)
1956
1962
  if (r === y.Both)
1957
- c = {
1963
+ a = {
1958
1964
  from: { ...o },
1959
1965
  to: { ...d, column: g - s }
1960
- }, a = L(c, this._selectionRenderService, this._skeletonManagerService);
1966
+ }, c = L(a, this._selectionRenderService, this._skeletonManagerService);
1961
1967
  else
1962
1968
  return {
1963
1969
  newSheetTransform: N({ ...e }, this._selectionRenderService),
1964
1970
  newTransform: e
1965
1971
  };
1966
- else if (l >= n && l <= t) {
1967
- if (l === n)
1968
- a = { ...e, left: (e.left || 0) - i.from.columnOffset };
1972
+ else if (l >= t && l <= n) {
1973
+ if (l === t)
1974
+ c = { ...e, left: (e.left || 0) - i.from.columnOffset };
1969
1975
  else {
1970
- const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: l - 1, startRow: o.row, endRow: d.row });
1971
- if (h == null)
1976
+ const u = this._skeletonManagerService.attachRangeWithCoord({ startColumn: t, endColumn: l - 1, startRow: o.row, endRow: d.row });
1977
+ if (u == null)
1972
1978
  return;
1973
- a = { ...e, left: (e.left || 0) - h.endX + h.startX - i.from.columnOffset };
1979
+ c = { ...e, left: (e.left || 0) - u.endX + u.startX - i.from.columnOffset };
1974
1980
  }
1975
- c = N(a, this._selectionRenderService);
1976
- } else if (g >= n && g <= t && r === y.Both) {
1977
- const h = this._skeletonManagerService.attachRangeWithCoord({
1978
- startColumn: n - 1,
1979
- endColumn: n - 1,
1981
+ a = N(c, this._selectionRenderService);
1982
+ } else if (g >= t && g <= n && r === y.Both) {
1983
+ const u = this._skeletonManagerService.attachRangeWithCoord({
1984
+ startColumn: t - 1,
1985
+ endColumn: t - 1,
1980
1986
  startRow: o.row,
1981
1987
  endRow: d.row
1982
1988
  });
1983
- if (h == null)
1989
+ if (u == null)
1984
1990
  return;
1985
- c = {
1991
+ a = {
1986
1992
  from: { ...o },
1987
- to: { ...d, column: n - 1, columnOffset: h.endX - h.startX }
1988
- }, a = L(c, this._selectionRenderService, this._skeletonManagerService);
1993
+ to: { ...d, column: t - 1, columnOffset: u.endX - u.startX }
1994
+ }, c = L(a, this._selectionRenderService, this._skeletonManagerService);
1989
1995
  }
1990
1996
  }
1991
- return c != null && a != null ? {
1992
- newSheetTransform: c,
1993
- newTransform: a
1997
+ return a != null && c != null ? {
1998
+ newSheetTransform: a,
1999
+ newTransform: c
1994
2000
  } : null;
1995
2001
  }
1996
- _expandRow(i, e, n, t, r = y.Position) {
1997
- const s = t - n + 1, { from: o, to: d } = i, { row: l } = o, { row: g } = d;
2002
+ _expandRow(i, e, t, n, r = y.Position) {
2003
+ const s = n - t + 1, { from: o, to: d } = i, { row: l } = o, { row: g } = d;
1998
2004
  if (r === y.None)
1999
2005
  return {
2000
2006
  newSheetTransform: N({ ...e }, this._selectionRenderService),
2001
2007
  newTransform: e
2002
2008
  };
2003
- let c = null, a = null;
2004
- if (l >= n) {
2005
- const h = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: t, startColumn: o.column, endColumn: d.column });
2006
- if (h == null)
2009
+ let a = null, c = null;
2010
+ if (l >= t) {
2011
+ const u = this._skeletonManagerService.attachRangeWithCoord({ startRow: t, endRow: n, startColumn: o.column, endColumn: d.column });
2012
+ if (u == null)
2007
2013
  return;
2008
- a = { ...e, top: (e.top || 0) + h.endY - h.startY }, c = N(a, this._selectionRenderService);
2009
- } else if (g >= t)
2014
+ c = { ...e, top: (e.top || 0) + u.endY - u.startY }, a = N(c, this._selectionRenderService);
2015
+ } else if (g >= n)
2010
2016
  if (r === y.Both)
2011
- c = {
2017
+ a = {
2012
2018
  from: { ...o },
2013
2019
  to: {
2014
2020
  ...d,
2015
2021
  row: g + s
2016
2022
  }
2017
- }, a = L(c, this._selectionRenderService, this._skeletonManagerService);
2023
+ }, c = L(a, this._selectionRenderService, this._skeletonManagerService);
2018
2024
  else
2019
2025
  return {
2020
2026
  newSheetTransform: N({ ...e }, this._selectionRenderService),
2021
2027
  newTransform: e
2022
2028
  };
2023
- return c != null && a != null ? {
2024
- newSheetTransform: c,
2025
- newTransform: a
2029
+ return a != null && c != null ? {
2030
+ newSheetTransform: a,
2031
+ newTransform: c
2026
2032
  } : null;
2027
2033
  }
2028
- _shrinkRow(i, e, n, t, r = y.Position) {
2029
- const s = t - n + 1, { from: o, to: d } = i, { row: l } = o, { row: g } = d;
2034
+ _shrinkRow(i, e, t, n, r = y.Position) {
2035
+ const s = n - t + 1, { from: o, to: d } = i, { row: l } = o, { row: g } = d;
2030
2036
  if (r === y.None)
2031
2037
  return {
2032
2038
  newSheetTransform: N({ ...e }, this._selectionRenderService),
2033
2039
  newTransform: e
2034
2040
  };
2035
- let c = null, a = null;
2036
- if (l > t)
2037
- c = {
2041
+ let a = null, c = null;
2042
+ if (l > n)
2043
+ a = {
2038
2044
  from: { ...o, row: l - s },
2039
2045
  to: { ...d, row: g - s }
2040
- }, a = L(c, this._selectionRenderService, this._skeletonManagerService);
2046
+ }, c = L(a, this._selectionRenderService, this._skeletonManagerService);
2041
2047
  else {
2042
- if (l >= n && g <= t)
2048
+ if (l >= t && g <= n)
2043
2049
  return null;
2044
- if (l < n && g > t)
2050
+ if (l < t && g > n)
2045
2051
  if (r === y.Both)
2046
- c = {
2052
+ a = {
2047
2053
  from: { ...o },
2048
2054
  to: { ...d, row: g - s }
2049
- }, a = L(c, this._selectionRenderService, this._skeletonManagerService);
2055
+ }, c = L(a, this._selectionRenderService, this._skeletonManagerService);
2050
2056
  else
2051
2057
  return {
2052
2058
  newSheetTransform: N({ ...e }, this._selectionRenderService),
2053
2059
  newTransform: e
2054
2060
  };
2055
- else if (l >= n && l <= t) {
2056
- if (l === n)
2057
- a = { ...e, top: (e.top || 0) - i.from.rowOffset };
2061
+ else if (l >= t && l <= n) {
2062
+ if (l === t)
2063
+ c = { ...e, top: (e.top || 0) - i.from.rowOffset };
2058
2064
  else {
2059
- const h = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: l - 1, startColumn: o.column, endColumn: d.column });
2060
- if (h == null)
2065
+ const u = this._skeletonManagerService.attachRangeWithCoord({ startRow: t, endRow: l - 1, startColumn: o.column, endColumn: d.column });
2066
+ if (u == null)
2061
2067
  return;
2062
- a = { ...e, top: (e.top || 0) - h.endY + h.startY - i.from.rowOffset };
2068
+ c = { ...e, top: (e.top || 0) - u.endY + u.startY - i.from.rowOffset };
2063
2069
  }
2064
- c = N(a, this._selectionRenderService);
2065
- } else if (g >= n && g <= t && r === y.Both) {
2066
- const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow: n - 1, endRow: n - 1 });
2067
- if (h == null)
2070
+ a = N(c, this._selectionRenderService);
2071
+ } else if (g >= t && g <= n && r === y.Both) {
2072
+ const u = this._skeletonManagerService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow: t - 1, endRow: t - 1 });
2073
+ if (u == null)
2068
2074
  return;
2069
- c = {
2075
+ a = {
2070
2076
  from: { ...o },
2071
- to: { ...d, row: n - 1, rowOffset: h.endY - h.startY }
2072
- }, a = L(c, this._selectionRenderService, this._skeletonManagerService);
2077
+ to: { ...d, row: t - 1, rowOffset: u.endY - u.startY }
2078
+ }, c = L(a, this._selectionRenderService, this._skeletonManagerService);
2073
2079
  }
2074
2080
  }
2075
- return c != null && a != null ? {
2076
- newSheetTransform: c,
2077
- newTransform: a
2081
+ return a != null && c != null ? {
2082
+ newSheetTransform: a,
2083
+ newTransform: c
2078
2084
  } : null;
2079
2085
  }
2080
2086
  _commandListener() {
2081
2087
  this.disposeWithMe(
2082
2088
  this._commandService.onCommandExecuted((i) => {
2083
- i.id === Dr.id && setTimeout(() => {
2084
- const e = i.params, { unitId: n, subUnitId: t } = e, r = this._drawingManagerService.drawingManagerData, s = [], o = [];
2089
+ i.id === Mr.id && setTimeout(() => {
2090
+ const e = i.params, { unitId: t, subUnitId: n } = e, r = this._drawingManagerService.drawingManagerData, s = [], o = [];
2085
2091
  Object.keys(r).forEach((d) => {
2086
2092
  const l = r[d];
2087
2093
  l != null && Object.keys(l).forEach((g) => {
2088
- const c = l[g].data;
2089
- c != null && Object.keys(c).forEach((a) => {
2090
- if (d === n && g === t) {
2091
- const h = c[a];
2092
- h.transform = L(h.sheetTransform, this._selectionRenderService, this._skeletonManagerService), s.push(c[a]);
2094
+ const a = l[g].data;
2095
+ a != null && Object.keys(a).forEach((c) => {
2096
+ if (d === t && g === n) {
2097
+ const u = a[c];
2098
+ u.transform = L(u.sheetTransform, this._selectionRenderService, this._skeletonManagerService), s.push(a[c]);
2093
2099
  } else
2094
- o.push(c[a]);
2100
+ o.push(a[c]);
2095
2101
  });
2096
2102
  });
2097
2103
  }), this._drawingManagerService.removeNotification(o), this._drawingManagerService.addNotification(s);
@@ -2102,23 +2108,23 @@ let ot = class extends ie {
2102
2108
  _sheetRefreshListener() {
2103
2109
  this.disposeWithMe(
2104
2110
  this._commandService.onCommandExecuted((i) => {
2105
- Fi.includes(i.id) && requestIdleCallback(() => {
2106
- const e = i.params, { unitId: n, subUnitId: t, ranges: r } = e;
2107
- this._refreshDrawingTransform(n, t, r);
2111
+ Vi.includes(i.id) && requestIdleCallback(() => {
2112
+ const e = i.params, { unitId: t, subUnitId: n, ranges: r } = e;
2113
+ this._refreshDrawingTransform(t, n, r);
2108
2114
  });
2109
2115
  })
2110
2116
  );
2111
2117
  }
2112
- _refreshDrawingTransform(i, e, n) {
2113
- const t = this._drawingManagerService.getDrawingData(i, e), r = [];
2114
- Object.keys(t).forEach((s) => {
2115
- const o = t[s], { sheetTransform: d, transform: l, anchorType: g = y.Position } = o;
2118
+ _refreshDrawingTransform(i, e, t) {
2119
+ const n = this._drawingManagerService.getDrawingData(i, e), r = [];
2120
+ Object.keys(n).forEach((s) => {
2121
+ const o = n[s], { sheetTransform: d, transform: l, anchorType: g = y.Position } = o;
2116
2122
  if (g === y.None)
2117
2123
  return !0;
2118
- const { from: c, to: a } = d, { row: h, column: u } = c, { row: m, column: f } = a;
2119
- for (let p = 0; p < n.length; p++) {
2120
- const C = n[p], { startRow: S, endRow: v, startColumn: R, endColumn: _ } = C;
2121
- if (Dn.intersects(
2124
+ const { from: a, to: c } = d, { row: u, column: h } = a, { row: m, column: f } = c;
2125
+ for (let p = 0; p < t.length; p++) {
2126
+ const C = t[p], { startRow: S, endRow: v, startColumn: R, endColumn: _ } = C;
2127
+ if (Mn.intersects(
2122
2128
  {
2123
2129
  startRow: S,
2124
2130
  endRow: v,
@@ -2126,12 +2132,12 @@ let ot = class extends ie {
2126
2132
  endColumn: _
2127
2133
  },
2128
2134
  {
2129
- startRow: h,
2135
+ startRow: u,
2130
2136
  endRow: m,
2131
- startColumn: u,
2137
+ startColumn: h,
2132
2138
  endColumn: f
2133
2139
  }
2134
- ) || h > v || u > _) {
2140
+ ) || u > v || h > _) {
2135
2141
  const I = g === y.Position, w = L(d, this._selectionRenderService, this._skeletonManagerService);
2136
2142
  r.push({
2137
2143
  ...o,
@@ -2147,23 +2153,23 @@ let ot = class extends ie {
2147
2153
  }), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(j.id, [i]));
2148
2154
  }
2149
2155
  };
2150
- ot = ki([
2156
+ at = Bi([
2151
2157
  Q(1, J),
2152
2158
  Q(2, B),
2153
- Q(3, pe),
2154
- Q(4, W(q)),
2155
- Q(5, W(at)),
2159
+ Q(3, we),
2160
+ Q(4, x(Z)),
2161
+ Q(5, x(ct)),
2156
2162
  Q(6, F),
2157
2163
  Q(7, K),
2158
- Q(8, fe)
2159
- ], ot);
2160
- var Xi = Object.defineProperty, Hi = Object.getOwnPropertyDescriptor, zi = (i, e, n, t) => {
2161
- for (var r = t > 1 ? void 0 : t ? Hi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2162
- (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
2163
- return t && r && Xi(e, n, r), r;
2164
- }, oe = (i, e) => (n, t) => e(n, t, i);
2165
- function Ki(i, e, n, t) {
2166
- const { scaleX: r, scaleY: s } = e.getAncestorScale(), o = e.getViewport(Kn.VIEW_MAIN), d = {
2164
+ Q(8, pe)
2165
+ ], at);
2166
+ var ki = Object.defineProperty, Yi = Object.getOwnPropertyDescriptor, Fi = (i, e, t, n) => {
2167
+ for (var r = n > 1 ? void 0 : n ? Yi(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2168
+ (o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
2169
+ return n && r && ki(e, t, r), r;
2170
+ }, oe = (i, e) => (t, n) => e(t, n, i);
2171
+ function Xi(i, e, t, n) {
2172
+ const { scaleX: r, scaleY: s } = e.getAncestorScale(), o = e.getViewport(Jn.VIEW_MAIN), d = {
2167
2173
  left: !0,
2168
2174
  top: !0
2169
2175
  };
@@ -2172,7 +2178,7 @@ function Ki(i, e, n, t) {
2172
2178
  ...i,
2173
2179
  absolute: d
2174
2180
  };
2175
- const { left: l, right: g, top: c, bottom: a } = i, h = t.getFreeze(), { startColumn: u, startRow: m, xSplit: f, ySplit: p } = h, C = n.getNoMergeCellPositionByIndexWithNoHeader(m - p, u - f), S = n.getNoMergeCellPositionByIndexWithNoHeader(m, u), { rowHeaderWidth: v, columnHeaderHeight: R } = n, _ = S.startX - C.startX, I = S.startY - C.startY, { top: w, left: O, viewportScrollX: b, viewportScrollY: A } = o;
2181
+ const { left: l, right: g, top: a, bottom: c } = i, u = n.getFreeze(), { startColumn: h, startRow: m, xSplit: f, ySplit: p } = u, C = t.getNoMergeCellPositionByIndexWithNoHeader(m - p, h - f), S = t.getNoMergeCellPositionByIndexWithNoHeader(m, h), { rowHeaderWidth: v, columnHeaderHeight: R } = t, _ = S.startX - C.startX, I = S.startY - C.startY, { top: w, left: O, viewportScrollX: b, viewportScrollY: A } = o;
2176
2182
  let E, M;
2177
2183
  l < O ? (d.left = !0, E = (_ + v + (l - O)) * r, M = Math.max(
2178
2184
  Math.min(
@@ -2182,13 +2188,13 @@ function Ki(i, e, n, t) {
2182
2188
  (g - b) * r
2183
2189
  )) : (d.left = !1, E = Math.max((l - b) * r, (_ + v) * r), M = Math.max((g - b) * r, (_ + v) * r));
2184
2190
  let D, U;
2185
- return c < w ? (d.top = !0, D = (I + R + (c - w)) * s, U = Math.max(
2191
+ return a < w ? (d.top = !0, D = (I + R + (a - w)) * s, U = Math.max(
2186
2192
  Math.min(
2187
2193
  (I + R + (g - w)) * s,
2188
2194
  (I + R) * s
2189
2195
  ),
2190
- (a - A) * s
2191
- )) : (d.top = !1, D = Math.max((c - A) * s, (I + R) * s), U = Math.max((a - A) * s, (I + R) * s)), {
2196
+ (c - A) * s
2197
+ )) : (d.top = !1, D = Math.max((a - A) * s, (I + R) * s), U = Math.max((c - A) * s, (I + R) * s)), {
2192
2198
  left: E,
2193
2199
  right: M,
2194
2200
  top: D,
@@ -2196,26 +2202,26 @@ function Ki(i, e, n, t) {
2196
2202
  absolute: d
2197
2203
  };
2198
2204
  }
2199
- const Qe = (i, e, n, t) => {
2200
- const { scene: r } = e, { left: s, top: o, width: d, height: l, angle: g } = i, c = {
2205
+ const et = (i, e, t, n) => {
2206
+ const { scene: r } = e, { left: s, top: o, width: d, height: l, angle: g } = i, a = {
2201
2207
  left: s,
2202
2208
  right: s + d,
2203
2209
  top: o,
2204
2210
  bottom: o + l
2205
- }, a = Ki(c, r, n, t), { scaleX: h, scaleY: u } = r.getAncestorScale();
2211
+ }, c = Xi(a, r, t, n), { scaleX: u, scaleY: h } = r.getAncestorScale();
2206
2212
  return {
2207
- startX: a.left,
2208
- endX: a.right,
2209
- startY: a.top,
2210
- endY: a.bottom,
2213
+ startX: c.left,
2214
+ endX: c.right,
2215
+ startY: c.top,
2216
+ endY: c.bottom,
2211
2217
  rotate: g,
2212
- width: d * h,
2213
- height: l * u,
2214
- absolute: a.absolute
2218
+ width: d * u,
2219
+ height: l * h,
2220
+ absolute: c.absolute
2215
2221
  };
2216
2222
  };
2217
- let $e = class extends ie {
2218
- constructor(e, n, t, r, s, o, d) {
2223
+ let Le = class extends ie {
2224
+ constructor(e, t, n, r, s, o, d) {
2219
2225
  super();
2220
2226
  V(this, "_domLayerMap", /* @__PURE__ */ new Map());
2221
2227
  V(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
@@ -2226,18 +2232,18 @@ let $e = class extends ie {
2226
2232
  V(this, "_remove$", new Ke());
2227
2233
  V(this, "remove$", this._remove$.asObservable());
2228
2234
  V(this, "_hooks", []);
2229
- this._renderManagerService = e, this._univerInstanceService = n, this._commandService = t, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = d, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
2235
+ this._renderManagerService = e, this._univerInstanceService = t, this._commandService = n, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = d, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
2230
2236
  }
2231
2237
  _bindScrollEvent() {
2232
- this._lifecycleService.lifecycle$.pipe(re((e) => e === bn.Rendered), mr(1)).subscribe(() => {
2238
+ this._lifecycleService.lifecycle$.pipe(re((e) => e === yn.Rendered), fr(1)).subscribe(() => {
2233
2239
  this._scrollUpdateListener();
2234
2240
  });
2235
2241
  }
2236
- _ensureMap(e, n) {
2237
- let t = this._domLayerMap.get(e);
2238
- t || (t = /* @__PURE__ */ new Map(), this._domLayerMap.set(e, t));
2239
- let r = t.get(n);
2240
- return r || (r = /* @__PURE__ */ new Map(), t.set(n, r)), r;
2242
+ _ensureMap(e, t) {
2243
+ let n = this._domLayerMap.get(e);
2244
+ n || (n = /* @__PURE__ */ new Map(), this._domLayerMap.set(e, n));
2245
+ let r = n.get(t);
2246
+ return r || (r = /* @__PURE__ */ new Map(), n.set(t, r)), r;
2241
2247
  }
2242
2248
  getFloatDomInfo(e) {
2243
2249
  return this._domLayerInfoMap.get(e);
@@ -2245,46 +2251,46 @@ let $e = class extends ie {
2245
2251
  _getSceneAndTransformerByDrawingSearch(e) {
2246
2252
  if (e == null)
2247
2253
  return;
2248
- const n = this._renderManagerService.getRenderById(e), t = n == null ? void 0 : n.scene;
2249
- if (n == null || t == null)
2254
+ const t = this._renderManagerService.getRenderById(e), n = t == null ? void 0 : t.scene;
2255
+ if (t == null || n == null)
2250
2256
  return null;
2251
- const r = t.getTransformerByCreate(), s = n.engine.getCanvasElement();
2252
- return { scene: t, transformer: r, renderObject: n, canvas: s };
2257
+ const r = n.getTransformerByCreate(), s = t.engine.getCanvasElement();
2258
+ return { scene: n, transformer: r, renderObject: t, canvas: s };
2253
2259
  }
2254
2260
  _getFloatDomProps(e) {
2255
- let n;
2256
- return this._hooks.forEach((t) => {
2257
- n = t.onGetFloatDomProps(e);
2258
- }), n;
2261
+ let t;
2262
+ return this._hooks.forEach((n) => {
2263
+ t = n.onGetFloatDomProps(e);
2264
+ }), t;
2259
2265
  }
2260
2266
  // eslint-disable-next-line max-lines-per-function
2261
2267
  _drawingAddListener() {
2262
2268
  this.disposeWithMe(
2263
2269
  // eslint-disable-next-line max-lines-per-function
2264
2270
  this._drawingManagerService.add$.subscribe((e) => {
2265
- e.forEach((n) => {
2266
- var ut, ht, gt;
2267
- const { unitId: t, subUnitId: r, drawingId: s } = n, o = ce(this._univerInstanceService, { unitId: t, subUnitId: r }), d = this._drawingManagerService.getDrawingByParam(n), l = this._univerInstanceService.getUnit(t);
2271
+ e.forEach((t) => {
2272
+ var ht, gt, mt;
2273
+ const { unitId: n, subUnitId: r, drawingId: s } = t, o = ce(this._univerInstanceService, { unitId: n, subUnitId: r }), d = this._drawingManagerService.getDrawingByParam(t), l = this._univerInstanceService.getUnit(n);
2268
2274
  if (!l)
2269
2275
  return;
2270
2276
  const g = l.getActiveSheet().getSheetId();
2271
2277
  if (!d || !o)
2272
2278
  return;
2273
- const c = (ut = this._renderManagerService.getRenderById(t)) == null ? void 0 : ut.with(q).getWorksheetSkeleton(r);
2274
- if (!c)
2279
+ const a = (ht = this._renderManagerService.getRenderById(n)) == null ? void 0 : ht.with(Z).getWorksheetSkeleton(r);
2280
+ if (!a)
2275
2281
  return;
2276
- const { transform: a, drawingType: h, data: u } = d;
2277
- if (h !== k.DRAWING_DOM && h !== k.DRAWING_CHART)
2282
+ const { transform: c, drawingType: u, data: h } = d;
2283
+ if (u !== k.DRAWING_DOM && u !== k.DRAWING_CHART)
2278
2284
  return;
2279
- const m = this._getSceneAndTransformerByDrawingSearch(t);
2285
+ const m = this._getSceneAndTransformerByDrawingSearch(n);
2280
2286
  if (m == null)
2281
2287
  return;
2282
2288
  const { scene: f, canvas: p } = m;
2283
- if (a == null)
2289
+ if (c == null)
2284
2290
  return !0;
2285
2291
  if (g !== r)
2286
2292
  return;
2287
- const { left: C, top: S, width: v, height: R, angle: _, flipX: I, flipY: w, skewX: O, skewY: b } = a, A = ze({ unitId: t, subUnitId: r, drawingId: s }), E = f.getObject(A);
2293
+ const { left: C, top: S, width: v, height: R, angle: _, flipX: I, flipY: w, skewX: O, skewY: b } = c, A = ze({ unitId: n, subUnitId: r, drawingId: s }), E = f.getObject(A);
2288
2294
  if (E != null) {
2289
2295
  E.transformByState({ left: C, top: S, width: v, height: R, angle: _, flipX: I, flipY: w, skewX: O, skewY: b });
2290
2296
  return;
@@ -2294,16 +2300,16 @@ let $e = class extends ie {
2294
2300
  top: S,
2295
2301
  width: v,
2296
2302
  height: R,
2297
- zIndex: this._drawingManagerService.getDrawingOrder(t, r).length - 1
2298
- }, D = h === k.DRAWING_CHART;
2299
- D && (M.fill = "white", M.rotateEnabled = !1, u && u.border && (M.stroke = u.border), M.paintFirst = "stroke", M.strokeWidth = 1, M.borderEnabled = !1, M.radius = 8);
2300
- const U = new wt(A, M);
2301
- D && U.setObjectType(Hn.CHART), f.addObject(U, zn), d.allowTransform !== !1 && f.attachTransformerTo(U);
2302
- const x = this._ensureMap(t, r), Z = new yn(), hn = Qe(U, m.renderObject, c.skeleton, o.worksheet), Fe = new fr(hn), gn = {
2303
- dispose: Z,
2303
+ zIndex: this._drawingManagerService.getDrawingOrder(n, r).length - 1
2304
+ }, D = u === k.DRAWING_CHART;
2305
+ D && (M.fill = "white", M.rotateEnabled = !1, h && h.border && (M.stroke = h.border), M.paintFirst = "stroke", M.strokeWidth = 1, M.borderEnabled = !1, M.radius = 8);
2306
+ const U = new _t(A, M);
2307
+ D && U.setObjectType(zn.CHART), f.addObject(U, Kn), d.allowTransform !== !1 && f.attachTransformerTo(U);
2308
+ const W = this._ensureMap(n, r), q = new On(), gn = et(U, m.renderObject, a.skeleton, o.worksheet), Fe = new pr(gn), mn = {
2309
+ dispose: q,
2304
2310
  rect: U,
2305
2311
  position$: Fe,
2306
- unitId: t,
2312
+ unitId: n,
2307
2313
  subUnitId: r
2308
2314
  };
2309
2315
  this._canvasFloatDomService.addFloatDom({
@@ -2322,114 +2328,114 @@ let $e = class extends ie {
2322
2328
  onWheel: (G) => {
2323
2329
  p.dispatchEvent(new WheelEvent(G.type, G));
2324
2330
  },
2325
- props: (gt = (ht = x.get(s)) == null ? void 0 : ht.props) != null ? gt : this._getFloatDomProps(s),
2326
- data: u,
2327
- unitId: t
2331
+ props: (mt = (gt = W.get(s)) == null ? void 0 : gt.props) != null ? mt : this._getFloatDomProps(s),
2332
+ data: h,
2333
+ unitId: n
2328
2334
  });
2329
- const lt = U.onTransformChange$.subscribeEvent(() => {
2330
- const G = Qe(U, m.renderObject, c.skeleton, o.worksheet);
2335
+ const ut = U.onTransformChange$.subscribeEvent(() => {
2336
+ const G = et(U, m.renderObject, a.skeleton, o.worksheet);
2331
2337
  Fe.next(
2332
2338
  G
2333
2339
  );
2334
2340
  });
2335
- Z.add(() => {
2341
+ q.add(() => {
2336
2342
  this._canvasFloatDomService.removeFloatDom(s);
2337
- }), lt && Z.add(lt), this._domLayerInfoMap.set(s, gn), x.set(s, {
2338
- ...x.get(s)
2343
+ }), ut && q.add(ut), this._domLayerInfoMap.set(s, mn), W.set(s, {
2344
+ ...W.get(s)
2339
2345
  });
2340
2346
  });
2341
2347
  })
2342
2348
  ), this.disposeWithMe(
2343
2349
  this._drawingManagerService.remove$.subscribe((e) => {
2344
- e.forEach((n) => {
2345
- const { unitId: t, subUnitId: r, drawingId: s } = n, o = ze({ unitId: t, subUnitId: r, drawingId: s }), d = this._getSceneAndTransformerByDrawingSearch(t);
2350
+ e.forEach((t) => {
2351
+ const { unitId: n, subUnitId: r, drawingId: s } = t, o = ze({ unitId: n, subUnitId: r, drawingId: s }), d = this._getSceneAndTransformerByDrawingSearch(n);
2346
2352
  if (d == null)
2347
2353
  return;
2348
- const { transformer: l, scene: g } = d, c = g.getObject(o);
2349
- c != null && c.oKey && l.clearControlByIds([c == null ? void 0 : c.oKey]);
2354
+ const { transformer: l, scene: g } = d, a = g.getObject(o);
2355
+ a != null && a.oKey && l.clearControlByIds([a == null ? void 0 : a.oKey]);
2350
2356
  });
2351
2357
  })
2352
2358
  );
2353
2359
  }
2354
2360
  _scrollUpdateListener() {
2355
- const e = (n, t) => {
2361
+ const e = (t, n) => {
2356
2362
  var g;
2357
- const r = this._getSceneAndTransformerByDrawingSearch(n), s = this._ensureMap(n, t), o = Array.from(s.keys()), d = ce(this._univerInstanceService, { unitId: n, subUnitId: t }), l = (g = this._renderManagerService.getRenderById(n)) == null ? void 0 : g.with(q).getWorksheetSkeleton(t);
2358
- !r || !d || !l || o.forEach((c) => {
2359
- const a = this._domLayerInfoMap.get(c);
2360
- if (a) {
2361
- const h = Qe(a.rect, r.renderObject, l.skeleton, d.worksheet);
2362
- a.position$.next(h);
2363
+ const r = this._getSceneAndTransformerByDrawingSearch(t), s = this._ensureMap(t, n), o = Array.from(s.keys()), d = ce(this._univerInstanceService, { unitId: t, subUnitId: n }), l = (g = this._renderManagerService.getRenderById(t)) == null ? void 0 : g.with(Z).getWorksheetSkeleton(n);
2364
+ !r || !d || !l || o.forEach((a) => {
2365
+ const c = this._domLayerInfoMap.get(a);
2366
+ if (c) {
2367
+ const u = et(c.rect, r.renderObject, l.skeleton, d.worksheet);
2368
+ c.position$.next(u);
2363
2369
  }
2364
2370
  });
2365
2371
  };
2366
2372
  this.disposeWithMe(
2367
2373
  this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET).pipe(
2368
- re((n) => !!n),
2369
- St((n) => n.activeSheet$),
2370
- re((n) => !!n),
2371
- Ee((n) => {
2372
- const t = this._renderManagerService.getRenderById(n.getUnitId());
2373
- return t ? { render: t, unitId: n.getUnitId(), subUnitId: n.getSheetId() } : null;
2374
+ re((t) => !!t),
2375
+ Ct((t) => t.activeSheet$),
2376
+ re((t) => !!t),
2377
+ Ue((t) => {
2378
+ const n = this._renderManagerService.getRenderById(t.getUnitId());
2379
+ return n ? { render: n, unitId: t.getUnitId(), subUnitId: t.getSheetId() } : null;
2374
2380
  }),
2375
- re((n) => !!n),
2376
- St(
2377
- (n) => On(n.render.scene.getViewport(nr.VIEW_MAIN).onScrollAfter$).pipe(Ee(() => ({ unitId: n.unitId, subUnitId: n.subUnitId })))
2381
+ re((t) => !!t),
2382
+ Ct(
2383
+ (t) => Pn(t.render.scene.getViewport(rr.VIEW_MAIN).onScrollAfter$).pipe(Ue(() => ({ unitId: t.unitId, subUnitId: t.subUnitId })))
2378
2384
  )
2379
- ).subscribe(({ unitId: n, subUnitId: t }) => {
2380
- e(n, t);
2385
+ ).subscribe(({ unitId: t, subUnitId: n }) => {
2386
+ e(t, n);
2381
2387
  })
2382
- ), this.disposeWithMe(this._commandService.onCommandExecuted((n) => {
2383
- var t, r;
2384
- if (n.id === rr.id) {
2385
- const s = n.params, { unitId: o } = s;
2386
- Array.from((r = (t = this._domLayerMap.get(o)) == null ? void 0 : t.keys()) != null ? r : []).forEach((l) => {
2388
+ ), this.disposeWithMe(this._commandService.onCommandExecuted((t) => {
2389
+ var n, r;
2390
+ if (t.id === ir.id) {
2391
+ const s = t.params, { unitId: o } = s;
2392
+ Array.from((r = (n = this._domLayerMap.get(o)) == null ? void 0 : n.keys()) != null ? r : []).forEach((l) => {
2387
2393
  e(o, l);
2388
2394
  });
2389
- } else if (n.id === Mr.id) {
2390
- const { unitId: s, subUnitId: o } = n.params;
2395
+ } else if (t.id === br.id) {
2396
+ const { unitId: s, subUnitId: o } = t.params;
2391
2397
  e(s, o);
2392
2398
  }
2393
2399
  }));
2394
2400
  }
2395
- _getPosition(e, n) {
2396
- var h;
2397
- const { startX: t, endX: r, startY: s, endY: o } = e, d = (h = this._renderManagerService.getRenderById(n)) == null ? void 0 : h.with(pe);
2401
+ _getPosition(e, t) {
2402
+ var u;
2403
+ const { startX: n, endX: r, startY: s, endY: o } = e, d = (u = this._renderManagerService.getRenderById(t)) == null ? void 0 : u.with(we);
2398
2404
  if (d == null)
2399
2405
  return;
2400
- const l = d.getCellWithCoordByOffset(t, s);
2406
+ const l = d.getCellWithCoordByOffset(n, s);
2401
2407
  if (l == null)
2402
2408
  return;
2403
2409
  const g = {
2404
2410
  column: l.actualColumn,
2405
- columnOffset: t - l.startX,
2411
+ columnOffset: n - l.startX,
2406
2412
  row: l.actualRow,
2407
2413
  rowOffset: s - l.startY
2408
- }, c = d.getCellWithCoordByOffset(r, o);
2409
- if (c == null)
2414
+ }, a = d.getCellWithCoordByOffset(r, o);
2415
+ if (a == null)
2410
2416
  return;
2411
- const a = {
2412
- column: c.actualColumn,
2413
- columnOffset: r - c.startX,
2414
- row: c.actualRow,
2415
- rowOffset: o - c.startY
2417
+ const c = {
2418
+ column: a.actualColumn,
2419
+ columnOffset: r - a.startX,
2420
+ row: a.actualRow,
2421
+ rowOffset: o - a.startY
2416
2422
  };
2417
2423
  return {
2418
2424
  from: g,
2419
- to: a
2425
+ to: c
2420
2426
  };
2421
2427
  }
2422
2428
  _featureUpdateListener() {
2423
2429
  this.disposeWithMe(
2424
2430
  this._drawingManagerService.update$.subscribe((e) => {
2425
- e.forEach((n) => {
2426
- const t = this._drawingManagerService.getDrawingByParam(n);
2427
- if (!t || t.drawingType !== k.DRAWING_DOM && t.drawingType !== k.DRAWING_CHART)
2431
+ e.forEach((t) => {
2432
+ const n = this._drawingManagerService.getDrawingByParam(t);
2433
+ if (!n || n.drawingType !== k.DRAWING_DOM && n.drawingType !== k.DRAWING_CHART)
2428
2434
  return;
2429
2435
  const r = {
2430
- ...t.transform
2436
+ ...n.transform
2431
2437
  };
2432
- this._transformChange$.next({ id: n.drawingId, value: r });
2438
+ this._transformChange$.next({ id: t.drawingId, value: r });
2433
2439
  });
2434
2440
  })
2435
2441
  );
@@ -2437,37 +2443,37 @@ let $e = class extends ie {
2437
2443
  _deleteListener() {
2438
2444
  this.disposeWithMe(
2439
2445
  this._drawingManagerService.remove$.subscribe((e) => {
2440
- e.forEach((n) => {
2441
- this._removeDom(n.drawingId);
2446
+ e.forEach((t) => {
2447
+ this._removeDom(t.drawingId);
2442
2448
  });
2443
2449
  })
2444
2450
  );
2445
2451
  }
2446
- updateFloatDomProps(e, n, t, r) {
2447
- const s = this._domLayerInfoMap.get(t), o = this._getSceneAndTransformerByDrawingSearch(e);
2452
+ updateFloatDomProps(e, t, n, r) {
2453
+ const s = this._domLayerInfoMap.get(n), o = this._getSceneAndTransformerByDrawingSearch(e);
2448
2454
  if (s && o) {
2449
- const { scene: d } = o, l = ze({ unitId: e, subUnitId: n, drawingId: t }), g = d.getObject(l);
2450
- g && g instanceof wt && g.setProps(r);
2455
+ const { scene: d } = o, l = ze({ unitId: e, subUnitId: t, drawingId: n }), g = d.getObject(l);
2456
+ g && g instanceof _t && g.setProps(r);
2451
2457
  }
2452
2458
  }
2453
- addFloatDomToPosition(e, n) {
2454
- const t = ce(this._univerInstanceService, {
2459
+ addFloatDomToPosition(e, t) {
2460
+ const n = ce(this._univerInstanceService, {
2455
2461
  unitId: e.unitId,
2456
2462
  subUnitId: e.subUnitId
2457
2463
  });
2458
- if (!t)
2464
+ if (!n)
2459
2465
  throw new Error("cannot find current target!");
2460
- const { unitId: r, subUnitId: s } = t, { initPosition: o, componentKey: d, data: l, allowTransform: g = !0 } = e, c = n != null ? n : Pn(), a = this._getPosition(o, r);
2461
- if (a == null)
2466
+ const { unitId: r, subUnitId: s } = n, { initPosition: o, componentKey: d, data: l, allowTransform: g = !0 } = e, a = t != null ? t : Tn(), c = this._getPosition(o, r);
2467
+ if (c == null)
2462
2468
  return;
2463
- this._ensureMap(r, s).set(c, e);
2464
- const u = {
2469
+ this._ensureMap(r, s).set(a, e);
2470
+ const h = {
2465
2471
  unitId: r,
2466
2472
  subUnitId: s,
2467
- drawingId: c,
2473
+ drawingId: a,
2468
2474
  drawingType: e.type || k.DRAWING_DOM,
2469
2475
  componentKey: d,
2470
- sheetTransform: a,
2476
+ sheetTransform: c,
2471
2477
  transform: {
2472
2478
  left: o.startX,
2473
2479
  top: o.startY,
@@ -2479,119 +2485,119 @@ let $e = class extends ie {
2479
2485
  };
2480
2486
  return this._commandService.executeCommand(ke.id, {
2481
2487
  unitId: r,
2482
- drawings: [u]
2483
- }), this._add$.next({ unitId: r, subUnitId: s, id: c }), {
2484
- id: c,
2488
+ drawings: [h]
2489
+ }), this._add$.next({ unitId: r, subUnitId: s, id: a }), {
2490
+ id: a,
2485
2491
  dispose: () => {
2486
- this._removeDom(c, !0);
2492
+ this._removeDom(a, !0);
2487
2493
  }
2488
2494
  };
2489
2495
  }
2490
- _removeDom(e, n = !1) {
2491
- const t = this._domLayerInfoMap.get(e);
2492
- if (!t)
2496
+ _removeDom(e, t = !1) {
2497
+ const n = this._domLayerInfoMap.get(e);
2498
+ if (!n)
2493
2499
  return;
2494
- const { unitId: r, subUnitId: s } = t;
2495
- this._domLayerInfoMap.delete(e), t.dispose.dispose();
2500
+ const { unitId: r, subUnitId: s } = n;
2501
+ this._domLayerInfoMap.delete(e), n.dispose.dispose();
2496
2502
  const o = this._getSceneAndTransformerByDrawingSearch(r);
2497
- if (o && o.scene.removeObject(t.rect), n) {
2503
+ if (o && o.scene.removeObject(n.rect), t) {
2498
2504
  this._ensureMap(r, s).delete(e);
2499
2505
  const l = this._drawingManagerService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: e });
2500
2506
  if (!l)
2501
2507
  return;
2502
- const g = this._sheetDrawingService.getBatchRemoveOp([l]), { redo: c, objects: a } = g;
2503
- this._commandService.syncExecuteCommand(P.id, { unitId: r, subUnitId: s, op: c, objects: a, type: T.REMOVE });
2508
+ const g = this._sheetDrawingService.getBatchRemoveOp([l]), { redo: a, objects: c } = g;
2509
+ this._commandService.syncExecuteCommand(P.id, { unitId: r, subUnitId: s, op: a, objects: c, type: T.REMOVE });
2504
2510
  }
2505
2511
  }
2506
2512
  addHook(e) {
2507
2513
  return this._hooks.push(e), {
2508
2514
  dispose: () => {
2509
- const n = this._hooks.findIndex((t) => t === e);
2510
- this._hooks.splice(n, 1);
2515
+ const t = this._hooks.findIndex((n) => n === e);
2516
+ this._hooks.splice(t, 1);
2511
2517
  }
2512
2518
  };
2513
2519
  }
2514
2520
  };
2515
- $e = zi([
2516
- oe(0, W(J)),
2517
- oe(1, fe),
2518
- oe(2, W(B)),
2521
+ Le = Fi([
2522
+ oe(0, x(J)),
2523
+ oe(1, pe),
2524
+ oe(2, x(B)),
2519
2525
  oe(3, K),
2520
- oe(4, W(gr)),
2526
+ oe(4, x(mr)),
2521
2527
  oe(5, F),
2522
- oe(6, W(Mn))
2523
- ], $e);
2524
- var ln = Object.defineProperty, Ji = Object.getOwnPropertyDescriptor, Zi = (i, e, n) => e in i ? ln(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, qi = (i, e, n, t) => {
2525
- for (var r = t > 1 ? void 0 : t ? Ji(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2526
- (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
2527
- return t && r && ln(e, n, r), r;
2528
- }, et = (i, e) => (n, t) => e(n, t, i), un = (i, e, n) => Zi(i, typeof e != "symbol" ? e + "" : e, n);
2529
- const Qi = "SHEET_IMAGE_UI_PLUGIN";
2530
- let Le = class extends En {
2531
- constructor(i = Pr, e, n, t) {
2532
- super(), this._config = i, this._injector = e, this._renderManagerService = n, this._configService = t;
2528
+ oe(6, x(bn))
2529
+ ], Le);
2530
+ var un = Object.defineProperty, Hi = Object.getOwnPropertyDescriptor, zi = (i, e, t) => e in i ? un(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, Ki = (i, e, t, n) => {
2531
+ for (var r = n > 1 ? void 0 : n ? Hi(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2532
+ (o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
2533
+ return n && r && un(e, t, r), r;
2534
+ }, tt = (i, e) => (t, n) => e(t, n, i), hn = (i, e, t) => zi(i, typeof e != "symbol" ? e + "" : e, t);
2535
+ const Ji = "SHEET_IMAGE_UI_PLUGIN";
2536
+ let Be = class extends Un {
2537
+ constructor(i = Tr, e, t, n) {
2538
+ super(), this._config = i, this._injector = e, this._renderManagerService = t, this._configService = n;
2533
2539
  const { menu: r, ...s } = this._config;
2534
- r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(Or, s);
2540
+ r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(Pr, s);
2535
2541
  }
2536
2542
  onStarting() {
2537
- Un(this._injector, [
2543
+ An(this._injector, [
2544
+ [Le],
2545
+ [je],
2546
+ [Ae],
2538
2547
  [$e],
2539
- [Ne],
2540
- [Ue],
2541
- [xe],
2542
2548
  [We],
2543
- [je]
2549
+ [xe]
2544
2550
  ]), Xe(this._injector, [
2545
- [$e]
2551
+ [Le]
2546
2552
  ]);
2547
2553
  }
2548
2554
  onReady() {
2549
2555
  Xe(this._injector, [
2550
- [je]
2556
+ [xe]
2551
2557
  ]);
2552
2558
  }
2553
2559
  onRendered() {
2554
2560
  this._registerRenderModules(), Xe(this._injector, [
2555
2561
  [We],
2556
- [xe],
2557
- [Ne]
2562
+ [$e],
2563
+ [je]
2558
2564
  ]);
2559
2565
  }
2560
2566
  onSteady() {
2561
- this._injector.get(Ue);
2567
+ this._injector.get(Ae);
2562
2568
  }
2563
2569
  _registerRenderModules() {
2564
2570
  [
2565
- [Ae],
2566
- [ot],
2567
- [st]
2571
+ [Ne],
2572
+ [at],
2573
+ [ot]
2568
2574
  ].forEach((i) => {
2569
2575
  this.disposeWithMe(this._renderManagerService.registerRenderModule(Y.UNIVER_SHEET, i));
2570
2576
  });
2571
2577
  }
2572
2578
  };
2573
- un(Le, "type", Y.UNIVER_SHEET);
2574
- un(Le, "pluginName", Qi);
2575
- Le = qi([
2576
- Tn(xn, Yn, Jn),
2577
- et(1, W(Rt)),
2578
- et(2, J),
2579
- et(3, An)
2580
- ], Le);
2579
+ hn(Be, "type", Y.UNIVER_SHEET);
2580
+ hn(Be, "pluginName", Ji);
2581
+ Be = Ki([
2582
+ En($n, Fn, qn),
2583
+ tt(1, x(bt)),
2584
+ tt(2, J),
2585
+ tt(3, Nn)
2586
+ ], Be);
2581
2587
  export {
2582
2588
  j as ClearSheetDrawingTransformerOperation,
2583
- nn as DeleteDrawingsCommand,
2584
- Jt as EditSheetDrawingOperation,
2585
- rn as GroupSheetDrawingCommand,
2586
- cn as IMAGE_MENU_ID,
2587
- dt as InsertFloatImageCommand,
2589
+ rn as DeleteDrawingsCommand,
2590
+ Qt as EditSheetDrawingOperation,
2591
+ sn as GroupSheetDrawingCommand,
2592
+ dn as IMAGE_MENU_ID,
2593
+ lt as InsertFloatImageCommand,
2588
2594
  ke as InsertSheetDrawingCommand,
2589
- we as MoveDrawingsCommand,
2590
- Ge as RemoveSheetDrawingCommand,
2591
- sn as SetDrawingArrangeCommand,
2595
+ _e as MoveDrawingsCommand,
2596
+ Ve as RemoveSheetDrawingCommand,
2597
+ on as SetDrawingArrangeCommand,
2592
2598
  Ye as SetSheetDrawingCommand,
2593
- $e as SheetCanvasFloatDomManagerService,
2594
- Kt as SidebarSheetDrawingOperation,
2595
- on as UngroupSheetDrawingCommand,
2596
- Le as UniverSheetsDrawingUIPlugin
2599
+ Le as SheetCanvasFloatDomManagerService,
2600
+ Zt as SidebarSheetDrawingOperation,
2601
+ an as UngroupSheetDrawingCommand,
2602
+ Be as UniverSheetsDrawingUIPlugin
2597
2603
  };