@univerjs/sheets-drawing-ui 0.5.4 → 0.5.5-nightly.202501201336

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,71 +1,71 @@
1
- var Wn = Object.defineProperty;
2
- var xn = (i, e, n) => e in i ? Wn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
3
- var V = (i, e, n) => xn(i, typeof e != "symbol" ? e + "" : e, n);
4
- import { CommandType as Y, ICommandService as B, IUndoRedoService as fe, sequenceExecute as Ft, LocaleService as Je, IUniverInstanceService as pe, useDependency as le, Inject as U, Injector as Ie, IContextService as Vt, RxDisposable as $n, UniverInstanceType as F, connectInjector as Bn, toDisposable as Ln, FOCUSING_COMMON_DRAWINGS as ge, DrawingTypeEnum as k, Disposable as q, ArrangeTypeEnum as be, createDocumentModelWithStyle as Gn, ObjectRelativeFromH as Fn, ObjectRelativeFromV as Vn, BooleanNumber as kn, PositionedObjectLayoutType as Hn, WrapTextType as Yn, BuildTextUtils as Xn, Range as zn, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as De, DOCS_ZEN_EDITOR_UNIT_ID_KEY as ye, InterceptorEffectEnum as Kn, ObjectMatrix as Jn, Tools as ve, UserManagerService as qn, IPermissionService as Zn, Rectangle as Qn, Direction as re, FOCUSING_FX_BAR_EDITOR as er, EDITOR_ACTIVATED as tr, FOCUSING_PANEL_EDITOR as nr, LifecycleService as rr, LifecycleStages as ir, DisposableCollection as sr, fromEventSubject as or, generateRandomId as ar, DependentOn as cr, Plugin as dr, merge as lr, registerDependencies as ur, touchDependencies as rt, IConfigService as hr } from "@univerjs/core";
5
- import { DocDrawingController as gr, UniverDocsDrawingPlugin as mr } from "@univerjs/docs-drawing";
6
- import { SetDrawingSelectedOperation as qe, IImageIoService as kt, IDrawingManagerService as Q, DRAWING_IMAGE_ALLOW_IMAGE_LIST as yt, DRAWING_IMAGE_COUNT_LIMIT as Ot, ImageUploadStatusType as ue, DRAWING_IMAGE_ALLOW_SIZE as Et, getImageSize as Tt, DRAWING_IMAGE_WIDTH_LIMIT as Pt, DRAWING_IMAGE_HEIGHT_LIMIT as Ut, getDrawingShapeKeyByDrawingSearch as it, UniverDrawingPlugin as fr } from "@univerjs/drawing";
7
- import { ImageCropperObject as pr, COMPONENT_IMAGE_POPUP_MENU as _r, OpenImageCropOperation as wr, ImageResetSizeOperation as vr, DrawingRenderService as Ht, DrawingCommonPanel as Sr, UniverDrawingUIPlugin as Ir } from "@univerjs/drawing-ui";
8
- import { IRenderManagerService as X, precisionTo as Oe, getGroupState as Cr, transformObjectOutOfGroup as Rr, RENDER_CLASS_TYPE as he, Rect as At, ObjectType as Mr, DRAWING_OBJECT_LAYER_INDEX as br, SHEET_VIEWPORT_KEY as Yt } from "@univerjs/engine-render";
9
- import { ISheetDrawingService as z, SetDrawingApplyMutation as O, DrawingApplyType as E, SheetDrawingAnchorType as y, UniverSheetsDrawingPlugin as Dr } from "@univerjs/sheets-drawing";
10
- import { SheetCanvasPopManagerService as yr, convertPositionSheetOverGridToAbsolute as Or, ISheetSelectionRenderService as Ce, SheetSkeletonManagerService as Z, attachRangeWithCoord as Xt, IEditorBridgeService as Er, IAutoFillService as Tr, HoverManagerService as Pr, COPY_TYPE as Nt, PREDEFINED_HOOK_NAME as Ee, virtualizeDiscreteRanges as Ur, ISheetClipboardService as Ar, SheetPrintInterceptorService as Nr, getCurrentRangeDisable$ as jr, SetZoomRatioOperation as Wr } from "@univerjs/sheets-ui";
11
- import { ISidebarService as xr, IUIPartsService as $r, BuiltInUIPart as Br, ILocalFileService as Lr, IMessageService as Gr, MenuItemType as vt, getMenuHiddenObservable as zt, RibbonStartGroup as Fr, KeyCode as me, ComponentManager as Vr, IMenuManagerService as kr, IShortcutService as Hr, CanvasFloatDomService as Yr } from "@univerjs/ui";
12
- import { takeUntil as jt, combineLatest as Te, map as Be, filter as ie, distinctUntilChanged as Pe, Subject as st, take as Xr, BehaviorSubject as zr, switchMap as Wt } from "rxjs";
13
- import { SheetInterceptorService as Ze, getSheetCommandTarget as H, SheetsSelectionsService as Kt, SetRangeValuesCommand as Kr, SetWorksheetRowHeightMutation as Jt, SetWorksheetColWidthMutation as qt, SetWorksheetRowIsAutoHeightMutation as Jr, SetWorksheetRowAutoHeightMutation as qr, AddWorksheetMergeMutation as Zr, RemoveWorksheetMergeMutation as Qr, AFTER_CELL_EDIT as ei, INTERCEPTOR_POINT as ti, InterceptCellContentPriority as ni, WorkbookViewPermission as xt, WorksheetViewPermission as ot, WorkbookEditablePermission as ht, WorksheetEditPermission as $e, InsertRowCommand as Zt, InsertColCommand as Qt, RemoveRowCommand as en, RemoveColCommand as tn, DeleteRangeMoveLeftCommand as nn, DeleteRangeMoveUpCommand as rn, InsertRangeMoveDownCommand as sn, InsertRangeMoveRightCommand as on, DeltaRowHeightCommand as gt, SetRowHeightCommand as mt, DeltaColumnWidthCommand as an, SetColWidthCommand as cn, SetRowHiddenCommand as dn, SetSpecificRowsVisibleCommand as ln, SetSpecificColsVisibleCommand as un, SetColHiddenCommand as hn, MoveColsCommand as gn, MoveRowsCommand as mn, MoveRangeCommand as fn, SetRowVisibleMutation as ri, SetRowHiddenMutation as ii, SetColVisibleMutation as si, SetColHiddenMutation as oi, SetWorksheetActiveOperation as ai, RangeProtectionPermissionEditPoint as ci, SetFrozenMutation as di } from "@univerjs/sheets";
14
- import pn, { useEffect as St, forwardRef as _n, useRef as li, createElement as wn, useState as ft } from "react";
15
- import { docDrawingPositionToTransform as ui, ReplaceSnapshotCommand as hi } from "@univerjs/docs-ui";
16
- import { MessageType as ae, RadioGroup as gi, Radio as at } from "@univerjs/design";
17
- const mi = "sheets-drawing-ui.config", $t = {}, W = {
1
+ var yr = Object.defineProperty;
2
+ var Or = (i, e, n) => e in i ? yr(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
3
+ var J = (i, e, n) => Or(i, typeof e != "symbol" ? e + "" : e, n);
4
+ import { CommandType as q, ICommandService as X, IUndoRedoService as $e, sequenceExecute as Pn, LocaleService as Wt, IUniverInstanceService as ke, useDependency as Me, Inject as N, Injector as Ke, IContextService as Un, RxDisposable as Er, UniverInstanceType as G, connectInjector as Tr, toDisposable as Pr, FOCUSING_COMMON_DRAWINGS as xe, DrawingTypeEnum as L, Disposable as ae, ArrangeTypeEnum as dt, createDocumentModelWithStyle as Ur, ObjectRelativeFromH as Ar, ObjectRelativeFromV as Nr, BooleanNumber as jr, PositionedObjectLayoutType as Wr, WrapTextType as xr, BuildTextUtils as Br, Range as $r, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as lt, DOCS_ZEN_EDITOR_UNIT_ID_KEY as ut, InterceptorEffectEnum as kr, ObjectMatrix as Lr, Tools as ye, UserManagerService as Fr, IPermissionService as Yr, Rectangle as Gr, Direction as ve, FOCUSING_FX_BAR_EDITOR as Xr, EDITOR_ACTIVATED as Vr, FOCUSING_PANEL_EDITOR as Hr, LifecycleService as zr, LifecycleStages as Kr, DisposableCollection as ht, fromEventSubject as Jr, generateRandomId as Gt, DependentOn as Zr, Plugin as qr, merge as Qr, registerDependencies as ei, touchDependencies as Xt, IConfigService as ti } from "@univerjs/core";
5
+ import { DocDrawingController as ni, UniverDocsDrawingPlugin as ri } from "@univerjs/docs-drawing";
6
+ import { SetDrawingSelectedOperation as xt, IImageIoService as An, IDrawingManagerService as de, DRAWING_IMAGE_ALLOW_IMAGE_LIST as fn, DRAWING_IMAGE_COUNT_LIMIT as pn, ImageUploadStatusType as Ne, DRAWING_IMAGE_ALLOW_SIZE as wn, getImageSize as _n, DRAWING_IMAGE_WIDTH_LIMIT as vn, DRAWING_IMAGE_HEIGHT_LIMIT as Sn, getDrawingShapeKeyByDrawingSearch as Ce, UniverDrawingPlugin as ii } from "@univerjs/drawing";
7
+ import { ImageCropperObject as si, COMPONENT_IMAGE_POPUP_MENU as oi, OpenImageCropOperation as ai, ImageResetSizeOperation as ci, DrawingRenderService as Nn, DrawingCommonPanel as di, UniverDrawingUIPlugin as li } from "@univerjs/drawing-ui";
8
+ import { IRenderManagerService as Q, precisionTo as gt, getGroupState as ui, transformObjectOutOfGroup as hi, RENDER_CLASS_TYPE as je, Rect as We, ObjectType as In, DRAWING_OBJECT_LAYER_INDEX as Vt, SHEET_VIEWPORT_KEY as jn } from "@univerjs/engine-render";
9
+ import { ISheetDrawingService as ee, SetDrawingApplyMutation as P, DrawingApplyType as U, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as gi } from "@univerjs/sheets-drawing";
10
+ import { SheetCanvasPopManagerService as mi, convertPositionSheetOverGridToAbsolute as fi, ISheetSelectionRenderService as Je, SheetSkeletonManagerService as H, attachRangeWithCoord as Wn, IEditorBridgeService as pi, IAutoFillService as wi, HoverManagerService as _i, COPY_TYPE as Cn, PREDEFINED_HOOK_NAME as mt, virtualizeDiscreteRanges as vi, ISheetClipboardService as Si, SheetPrintInterceptorService as Ii, getCurrentRangeDisable$ as Ci, SetZoomRatioOperation as bn, SetScrollOperation as bi } from "@univerjs/sheets-ui";
11
+ import { ISidebarService as Ri, IUIPartsService as Di, BuiltInUIPart as Mi, ILocalFileService as yi, IMessageService as Oi, MenuItemType as an, getMenuHiddenObservable as xn, RibbonStartGroup as Ei, KeyCode as Be, ComponentManager as Ti, IMenuManagerService as Pi, IShortcutService as Ui, CanvasFloatDomService as Ai } from "@univerjs/ui";
12
+ import { takeUntil as Rn, combineLatest as ft, map as He, filter as Se, distinctUntilChanged as pt, Subject as Ht, take as Ni, BehaviorSubject as Ye, switchMap as Dn } from "rxjs";
13
+ import { SheetInterceptorService as Bt, getSheetCommandTarget as Y, SheetsSelectionsService as Bn, SetRangeValuesCommand as ji, SetWorksheetRowHeightMutation as $n, SetWorksheetColWidthMutation as kn, SetWorksheetRowIsAutoHeightMutation as Wi, SetWorksheetRowAutoHeightMutation as Ln, AddWorksheetMergeMutation as xi, RemoveWorksheetMergeMutation as Bi, AFTER_CELL_EDIT as $i, INTERCEPTOR_POINT as ki, InterceptCellContentPriority as Li, WorkbookViewPermission as Mn, WorksheetViewPermission as zt, WorkbookEditablePermission as Qt, WorksheetEditPermission as Dt, InsertRowCommand as Fn, InsertColCommand as Yn, RemoveRowCommand as Gn, RemoveColCommand as Xn, DeleteRangeMoveLeftCommand as Vn, DeleteRangeMoveUpCommand as Hn, InsertRangeMoveDownCommand as zn, InsertRangeMoveRightCommand as Kn, DeltaRowHeightCommand as en, SetRowHeightCommand as tn, DeltaColumnWidthCommand as Jn, SetColWidthCommand as Zn, SetRowHiddenCommand as qn, SetSpecificRowsVisibleCommand as Qn, SetSpecificColsVisibleCommand as er, SetColHiddenCommand as tr, MoveColsCommand as nr, MoveRowsCommand as rr, MoveRangeCommand as ir, SetRowVisibleMutation as Fi, SetRowHiddenMutation as Yi, SetColVisibleMutation as Gi, SetColHiddenMutation as Xi, SetWorksheetActiveOperation as Vi, RangeProtectionPermissionEditPoint as Hi, SetFrozenMutation as zi, COMMAND_LISTENER_SKELETON_CHANGE as Ki } from "@univerjs/sheets";
14
+ import sr, { useEffect as cn, forwardRef as or, useRef as Ji, createElement as ar, useState as nn } from "react";
15
+ import { docDrawingPositionToTransform as Zi, ReplaceSnapshotCommand as qi } from "@univerjs/docs-ui";
16
+ import { MessageType as be, RadioGroup as Qi, Radio as Kt } from "@univerjs/design";
17
+ const es = "sheets-drawing-ui.config", yn = {}, k = {
18
18
  id: "sheet.operation.clear-drawing-transformer",
19
- type: Y.MUTATION,
19
+ type: q.MUTATION,
20
20
  handler: (i, e) => {
21
- const n = i.get(X);
21
+ const n = i.get(Q);
22
22
  return e.forEach((t) => {
23
23
  var r, s;
24
24
  (s = (r = n.getRenderById(t)) == null ? void 0 : r.scene.getTransformer()) == null || s.debounceRefreshControls();
25
25
  }), !0;
26
26
  }
27
- }, Qe = {
27
+ }, $t = {
28
28
  id: "sheet.command.remove-sheet-image",
29
- type: Y.COMMAND,
29
+ type: q.COMMAND,
30
30
  handler: (i, e) => {
31
- var I, S, M;
32
- const n = i.get(B), t = i.get(fe), r = i.get(Ze), s = i.get(z);
31
+ var S, I, D;
32
+ const n = i.get(X), t = i.get($e), r = i.get(Bt), s = i.get(ee);
33
33
  if (!e) return !1;
34
- const { drawings: o } = e, a = [];
35
- o.forEach((w) => {
36
- const { unitId: C } = w;
37
- a.push(C);
34
+ const { drawings: o } = e, c = [];
35
+ o.forEach((v) => {
36
+ const { unitId: R } = v;
37
+ c.push(R);
38
38
  });
39
- const l = s.getBatchRemoveOp(o), { unitId: g, subUnitId: d, undo: c, redo: h, objects: u } = l, m = r.onCommandExecute({ id: Qe.id, params: e }), f = { id: O.id, params: { unitId: g, subUnitId: d, op: h, objects: u, type: E.REMOVE } }, p = { id: O.id, params: { unitId: g, subUnitId: d, op: c, objects: u, type: E.INSERT } };
40
- return Ft([...(I = m.preRedos) != null ? I : [], f, ...m.redos], n) ? (t.pushUndoRedo({
39
+ const d = s.getBatchRemoveOp(o), { unitId: g, subUnitId: a, undo: l, redo: h, objects: u } = d, m = r.onCommandExecute({ id: $t.id, params: e }), p = { id: P.id, params: { unitId: g, subUnitId: a, op: h, objects: u, type: U.REMOVE } }, f = { id: P.id, params: { unitId: g, subUnitId: a, op: l, objects: u, type: U.INSERT } };
40
+ return Pn([...(S = m.preRedos) != null ? S : [], p, ...m.redos], n) ? (t.pushUndoRedo({
41
41
  unitID: g,
42
42
  undoMutations: [
43
- ...(S = m.preUndos) != null ? S : [],
44
- p,
43
+ ...(I = m.preUndos) != null ? I : [],
44
+ f,
45
45
  ...m.undos,
46
- { id: W.id, params: a }
46
+ { id: k.id, params: c }
47
47
  ],
48
48
  redoMutations: [
49
- ...(M = m.preRedos) != null ? M : [],
50
- f,
49
+ ...(D = m.preRedos) != null ? D : [],
50
+ p,
51
51
  ...m.redos,
52
- { id: W.id, params: a }
52
+ { id: k.id, params: c }
53
53
  ]
54
54
  }), !0) : !1;
55
55
  }
56
- }, vn = "COMPONENT_SHEET_DRAWING_PANEL", Sn = {
56
+ }, cr = "COMPONENT_SHEET_DRAWING_PANEL", dr = {
57
57
  id: "sidebar.operation.sheet-image",
58
- type: Y.COMMAND,
58
+ type: q.COMMAND,
59
59
  handler: async (i, e) => {
60
- const n = i.get(xr), t = i.get(Je), r = i.get(pe), s = i.get(B);
61
- if (!H(r)) return !1;
60
+ const n = i.get(Ri), t = i.get(Wt), r = i.get(ke), s = i.get(X);
61
+ if (!Y(r)) return !1;
62
62
  switch (e.value) {
63
63
  case "open":
64
64
  n.open({
65
65
  header: { title: t.t("sheetImage.panel.title") },
66
- children: { label: vn },
66
+ children: { label: cr },
67
67
  onClose: () => {
68
- s.syncExecuteCommand(qe.id, []);
68
+ s.syncExecuteCommand(xt.id, []);
69
69
  },
70
70
  width: 360
71
71
  });
@@ -77,15 +77,15 @@ const mi = "sheets-drawing-ui.config", $t = {}, W = {
77
77
  }
78
78
  return !0;
79
79
  }
80
- }, In = {
80
+ }, lr = {
81
81
  id: "sheet.operation.edit-sheet-image",
82
- type: Y.OPERATION,
82
+ type: q.OPERATION,
83
83
  handler: (i, e) => {
84
- const n = i.get(B);
85
- return e == null ? !1 : (n.syncExecuteCommand(qe.id, [e]), n.executeCommand(Sn.id, { value: "open" }), !0);
84
+ const n = i.get(X);
85
+ return e == null ? !1 : (n.syncExecuteCommand(xt.id, [e]), n.executeCommand(dr.id, { value: "open" }), !0);
86
86
  }
87
87
  };
88
- var ct = { exports: {} }, _e = {};
88
+ var Jt = { exports: {} }, Ge = {};
89
89
  /**
90
90
  * @license React
91
91
  * react-jsx-runtime.production.min.js
@@ -95,58 +95,58 @@ var ct = { exports: {} }, _e = {};
95
95
  * This source code is licensed under the MIT license found in the
96
96
  * LICENSE file in the root directory of this source tree.
97
97
  */
98
- var Bt;
99
- function fi() {
100
- if (Bt) return _e;
101
- Bt = 1;
102
- var i = pn, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), t = 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 };
103
- function o(a, l, g) {
104
- var d, c = {}, h = null, u = null;
105
- g !== void 0 && (h = "" + g), l.key !== void 0 && (h = "" + l.key), l.ref !== void 0 && (u = l.ref);
106
- for (d in l) t.call(l, d) && !s.hasOwnProperty(d) && (c[d] = l[d]);
107
- if (a && a.defaultProps) for (d in l = a.defaultProps, l) c[d] === void 0 && (c[d] = l[d]);
108
- return { $$typeof: e, type: a, key: h, ref: u, props: c, _owner: r.current };
109
- }
110
- return _e.Fragment = n, _e.jsx = o, _e.jsxs = o, _e;
98
+ var On;
99
+ function ts() {
100
+ if (On) return Ge;
101
+ On = 1;
102
+ var i = sr, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), t = 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 };
103
+ function o(c, d, g) {
104
+ var a, l = {}, h = null, u = null;
105
+ g !== void 0 && (h = "" + g), d.key !== void 0 && (h = "" + d.key), d.ref !== void 0 && (u = d.ref);
106
+ for (a in d) t.call(d, a) && !s.hasOwnProperty(a) && (l[a] = d[a]);
107
+ if (c && c.defaultProps) for (a in d = c.defaultProps, d) l[a] === void 0 && (l[a] = d[a]);
108
+ return { $$typeof: e, type: c, key: h, ref: u, props: l, _owner: r.current };
109
+ }
110
+ return Ge.Fragment = n, Ge.jsx = o, Ge.jsxs = o, Ge;
111
111
  }
112
- var Lt;
113
- function pi() {
114
- return Lt || (Lt = 1, ct.exports = fi()), ct.exports;
112
+ var En;
113
+ function ns() {
114
+ return En || (En = 1, Jt.exports = ts()), Jt.exports;
115
115
  }
116
- var $ = pi();
117
- const _i = "univer-upload-loading", wi = "univer-upload-loading-body", vi = "univer-upload-loading-body-animation", Si = "univer-UniverCircleAnimation", Ii = "univer-upload-loading-body-text", Ue = {
118
- uploadLoading: _i,
119
- uploadLoadingBody: wi,
120
- uploadLoadingBodyAnimation: vi,
121
- univerCircleAnimation: Si,
122
- uploadLoadingBodyText: Ii
123
- }, Ci = () => {
124
- const i = le(kt), e = le(Je), [n, t] = pn.useState(0);
125
- return St(() => {
116
+ var F = ns();
117
+ const rs = "univer-upload-loading", is = "univer-upload-loading-body", ss = "univer-upload-loading-body-animation", os = "univer-UniverCircleAnimation", as = "univer-upload-loading-body-text", wt = {
118
+ uploadLoading: rs,
119
+ uploadLoadingBody: is,
120
+ uploadLoadingBodyAnimation: ss,
121
+ univerCircleAnimation: os,
122
+ uploadLoadingBodyText: as
123
+ }, cs = () => {
124
+ const i = Me(An), e = Me(Wt), [n, t] = sr.useState(0);
125
+ return cn(() => {
126
126
  const r = i.change$.subscribe((s) => {
127
127
  t(s);
128
128
  });
129
129
  return () => {
130
130
  r.unsubscribe();
131
131
  };
132
- }, [i]), /* @__PURE__ */ $.jsx("div", { style: { display: n > 0 ? "block" : "none" }, className: Ue.uploadLoading, children: /* @__PURE__ */ $.jsxs("div", { className: Ue.uploadLoadingBody, children: [
133
- /* @__PURE__ */ $.jsx("div", { className: Ue.uploadLoadingBodyAnimation }),
134
- /* @__PURE__ */ $.jsx("div", { className: Ue.uploadLoadingBodyText, children: `${e.t("uploadLoading.loading")}: ${n}` })
132
+ }, [i]), /* @__PURE__ */ F.jsx("div", { style: { display: n > 0 ? "block" : "none" }, className: wt.uploadLoading, children: /* @__PURE__ */ F.jsxs("div", { className: wt.uploadLoadingBody, children: [
133
+ /* @__PURE__ */ F.jsx("div", { className: wt.uploadLoadingBodyAnimation }),
134
+ /* @__PURE__ */ F.jsx("div", { className: wt.uploadLoadingBodyText, children: `${e.t("uploadLoading.loading")}: ${n}` })
135
135
  ] }) });
136
136
  };
137
- var Ri = Object.defineProperty, Mi = Object.getOwnPropertyDescriptor, bi = (i, e, n, t) => {
138
- for (var r = t > 1 ? void 0 : t ? Mi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
137
+ var ds = Object.defineProperty, ls = Object.getOwnPropertyDescriptor, us = (i, e, n, t) => {
138
+ for (var r = t > 1 ? void 0 : t ? ls(e, n) : e, s = i.length - 1, o; s >= 0; s--)
139
139
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
140
- return t && r && Ri(e, n, r), r;
141
- }, ee = (i, e) => (n, t) => e(n, t, i);
142
- let Le = class extends $n {
143
- constructor(e, n, t, r, s, o, a, l) {
140
+ return t && r && ds(e, n, r), r;
141
+ }, pe = (i, e) => (n, t) => e(n, t, i);
142
+ let Mt = class extends Er {
143
+ constructor(e, n, t, r, s, o, c, d) {
144
144
  super();
145
- V(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
146
- this._injector = e, this._drawingManagerService = n, this._canvasPopManagerService = t, this._renderManagerService = r, this._univerInstanceService = s, this._contextService = o, this._uiPartsService = a, this._commandService = l, this._init();
145
+ J(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
146
+ this._injector = e, this._drawingManagerService = n, this._canvasPopManagerService = t, this._renderManagerService = r, this._univerInstanceService = s, this._contextService = o, this._uiPartsService = c, this._commandService = d, this._init();
147
147
  }
148
148
  _init() {
149
- this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(jt(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(F.UNIVER_SHEET).pipe(jt(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(F.UNIVER_SHEET).forEach((e) => this._create(e)), this._uiPartsService.registerComponent(Br.CONTENT, () => Bn(Ci, this._injector));
149
+ this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET).pipe(Rn(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(G.UNIVER_SHEET).pipe(Rn(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(G.UNIVER_SHEET).forEach((e) => this._create(e)), this._uiPartsService.registerComponent(Mi.CONTENT, () => Tr(cs, this._injector));
150
150
  }
151
151
  _dispose(e) {
152
152
  const n = e.getUnitId();
@@ -161,7 +161,7 @@ let Le = class extends $n {
161
161
  _hasCropObject(e) {
162
162
  const n = e.getAllObjectsByOrder();
163
163
  for (const t of n)
164
- if (t instanceof pr)
164
+ if (t instanceof si)
165
165
  return !0;
166
166
  return !1;
167
167
  }
@@ -175,43 +175,43 @@ let Le = class extends $n {
175
175
  return;
176
176
  let r;
177
177
  this.disposeWithMe(
178
- Ln(
178
+ Pr(
179
179
  t.createControl$.subscribe(() => {
180
- if (this._contextService.setContextValue(ge, !0), this._hasCropObject(n))
180
+ if (this._contextService.setContextValue(xe, !0), this._hasCropObject(n))
181
181
  return;
182
182
  const o = t.getSelectedObjectMap();
183
183
  if (o.size > 1) {
184
184
  r == null || r.dispose();
185
185
  return;
186
186
  }
187
- const a = o.values().next().value;
188
- if (!a)
187
+ const c = o.values().next().value;
188
+ if (!c)
189
189
  return;
190
- const l = a.oKey, g = this._drawingManagerService.getDrawingOKey(l);
190
+ const d = c.oKey, g = this._drawingManagerService.getDrawingOKey(d);
191
191
  if (!g)
192
192
  return;
193
- const { unitId: d, subUnitId: c, drawingId: h, drawingType: u } = g, m = g.data;
193
+ const { unitId: a, subUnitId: l, drawingId: h, drawingType: u } = g, m = g.data;
194
194
  if (m && m.disablePopup)
195
195
  return;
196
196
  r == null || r.dispose();
197
- const f = this._canvasPopManagerService.getFeatureMenu(d, c, h, u);
198
- r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(a, {
199
- componentKey: _r,
197
+ const p = this._canvasPopManagerService.getFeatureMenu(a, l, h, u);
198
+ r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(c, {
199
+ componentKey: oi,
200
200
  direction: "horizontal",
201
201
  offset: [2, 0],
202
202
  extraProps: {
203
- menuItems: f || this._getImageMenuItems(d, c, h, u)
203
+ menuItems: p || this._getImageMenuItems(a, l, h, u)
204
204
  }
205
205
  }));
206
206
  })
207
207
  )
208
208
  ), this.disposeWithMe(
209
209
  t.clearControl$.subscribe(() => {
210
- r == null || r.dispose(), this._contextService.setContextValue(ge, !1), this._commandService.syncExecuteCommand(qe.id, []);
210
+ r == null || r.dispose(), this._contextService.setContextValue(xe, !1), this._commandService.syncExecuteCommand(xt.id, []);
211
211
  })
212
212
  ), this.disposeWithMe(
213
213
  this._contextService.contextChanged$.subscribe((o) => {
214
- o[ge] === !1 && (r == null || r.dispose());
214
+ o[xe] === !1 && (r == null || r.dispose());
215
215
  })
216
216
  ), this.disposeWithMe(
217
217
  t.changing$.subscribe(() => {
@@ -224,102 +224,102 @@ let Le = class extends $n {
224
224
  {
225
225
  label: "image-popup.edit",
226
226
  index: 0,
227
- commandId: In.id,
227
+ commandId: lr.id,
228
228
  commandParams: { unitId: e, subUnitId: n, drawingId: t },
229
- disable: r === k.DRAWING_DOM
229
+ disable: r === L.DRAWING_DOM
230
230
  },
231
231
  {
232
232
  label: "image-popup.delete",
233
233
  index: 1,
234
- commandId: Qe.id,
234
+ commandId: $t.id,
235
235
  commandParams: { unitId: e, drawings: [{ unitId: e, subUnitId: n, drawingId: t }] },
236
236
  disable: !1
237
237
  },
238
238
  {
239
239
  label: "image-popup.crop",
240
240
  index: 2,
241
- commandId: wr.id,
241
+ commandId: ai.id,
242
242
  commandParams: { unitId: e, subUnitId: n, drawingId: t },
243
- disable: r === k.DRAWING_DOM
243
+ disable: r === L.DRAWING_DOM
244
244
  },
245
245
  {
246
246
  label: "image-popup.reset",
247
247
  index: 3,
248
- commandId: vr.id,
248
+ commandId: ci.id,
249
249
  commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
250
- disable: r === k.DRAWING_DOM
250
+ disable: r === L.DRAWING_DOM
251
251
  }
252
252
  ];
253
253
  }
254
254
  };
255
- Le = bi([
256
- ee(0, U(Ie)),
257
- ee(1, Q),
258
- ee(2, U(yr)),
259
- ee(3, X),
260
- ee(4, pe),
261
- ee(5, Vt),
262
- ee(6, U($r)),
263
- ee(7, B)
264
- ], Le);
265
- function L(i, e, n) {
266
- const { from: t, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX: l = 0, skewY: g = 0 } = i, d = n.getCurrent();
267
- if (d == null)
255
+ Mt = us([
256
+ pe(0, N(Ke)),
257
+ pe(1, de),
258
+ pe(2, N(mi)),
259
+ pe(3, Q),
260
+ pe(4, ke),
261
+ pe(5, Un),
262
+ pe(6, N(Di)),
263
+ pe(7, X)
264
+ ], Mt);
265
+ function V(i, e, n) {
266
+ const { from: t, to: r, flipY: s = !1, flipX: o = !1, angle: c = 0, skewX: d = 0, skewY: g = 0 } = i, a = n.getCurrent();
267
+ if (a == null)
268
268
  return;
269
- const c = Or(
270
- d.unitId,
271
- d.sheetId,
269
+ const l = fi(
270
+ a.unitId,
271
+ a.sheetId,
272
272
  { from: t, to: r },
273
273
  n
274
274
  );
275
- let { left: h, top: u, width: m, height: f } = c;
276
- const p = n.getCurrentSkeleton(), v = p.rowHeaderWidth + p.columnTotalWidth, I = p.columnHeaderHeight + p.rowTotalHeight;
277
- return h + m > v && (h = v - m), u + f > I && (u = I - f), {
275
+ let { left: h, top: u, width: m, height: p } = l;
276
+ const f = n.getCurrentSkeleton(), w = f.rowHeaderWidth + f.columnTotalWidth, S = f.columnHeaderHeight + f.rowTotalHeight;
277
+ return h + m > w && (h = w - m), u + p > S && (u = S - p), {
278
278
  flipY: s,
279
279
  flipX: o,
280
- angle: a,
281
- skewX: l,
280
+ angle: c,
281
+ skewX: d,
282
282
  skewY: g,
283
283
  left: h,
284
284
  top: u,
285
285
  width: m,
286
- height: f
286
+ height: p
287
287
  };
288
288
  }
289
- function j(i, e) {
290
- const { left: n = 0, top: t = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: a = !1, angle: l = 0, skewX: g = 0, skewY: d = 0 } = i, c = e.getCellWithCoordByOffset(n, t);
291
- if (c == null)
289
+ function $(i, e) {
290
+ const { left: n = 0, top: t = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: c = !1, angle: d = 0, skewX: g = 0, skewY: a = 0 } = i, l = e.getCellWithCoordByOffset(n, t);
291
+ if (l == null)
292
292
  return;
293
293
  const h = {
294
- column: c.actualColumn,
295
- columnOffset: Oe(n - c.startX, 1),
296
- row: c.actualRow,
297
- rowOffset: Oe(t - c.startY, 1)
294
+ column: l.actualColumn,
295
+ columnOffset: gt(n - l.startX, 1),
296
+ row: l.actualRow,
297
+ rowOffset: gt(t - l.startY, 1)
298
298
  }, u = e.getCellWithCoordByOffset(n + r, t + s);
299
299
  if (u == null)
300
300
  return;
301
301
  const m = {
302
302
  column: u.actualColumn,
303
- columnOffset: Oe(n + r - u.startX, 1),
303
+ columnOffset: gt(n + r - u.startX, 1),
304
304
  row: u.actualRow,
305
- rowOffset: Oe(t + s - u.startY, 1)
305
+ rowOffset: gt(t + s - u.startY, 1)
306
306
  };
307
307
  return {
308
308
  flipY: o,
309
- flipX: a,
310
- angle: l,
309
+ flipX: c,
310
+ angle: d,
311
311
  skewX: g,
312
- skewY: d,
312
+ skewY: a,
313
313
  from: h,
314
314
  to: m
315
315
  };
316
316
  }
317
- var Di = Object.defineProperty, yi = Object.getOwnPropertyDescriptor, Oi = (i, e, n, t) => {
318
- for (var r = t > 1 ? void 0 : t ? yi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
317
+ var hs = Object.defineProperty, gs = Object.getOwnPropertyDescriptor, ms = (i, e, n, t) => {
318
+ for (var r = t > 1 ? void 0 : t ? gs(e, n) : e, s = i.length - 1, o; s >= 0; s--)
319
319
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
320
- return t && r && Di(e, n, r), r;
321
- }, Ae = (i, e) => (n, t) => e(n, t, i);
322
- let pt = class extends q {
320
+ return t && r && hs(e, n, r), r;
321
+ }, _t = (i, e) => (n, t) => e(n, t, i);
322
+ let rn = class extends ae {
323
323
  constructor(i, e, n, t, r) {
324
324
  super(), this._context = i, this._sheetDrawingService = e, this._drawingManagerService = n, this._sheetSelectionRenderService = t, this._sheetSkeletonManagerService = r, this._init();
325
325
  }
@@ -333,236 +333,236 @@ let pt = class extends q {
333
333
  const n = i[e];
334
334
  for (const t in n.data) {
335
335
  const r = n.data[t];
336
- r.transform = L(r.sheetTransform, this._sheetSelectionRenderService, this._sheetSkeletonManagerService);
336
+ r.transform = V(r.sheetTransform, this._sheetSelectionRenderService, this._sheetSkeletonManagerService);
337
337
  }
338
338
  }
339
339
  this._drawingManagerService.registerDrawingData(this._context.unitId, this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId)), this._drawingManagerService.initializeNotification(this._context.unitId);
340
340
  }
341
341
  };
342
- pt = Oi([
343
- Ae(1, z),
344
- Ae(2, Q),
345
- Ae(3, U(Ce)),
346
- Ae(4, U(Z))
347
- ], pt);
348
- function Ei(i) {
342
+ rn = ms([
343
+ _t(1, ee),
344
+ _t(2, de),
345
+ _t(3, N(Je)),
346
+ _t(4, N(H))
347
+ ], rn);
348
+ function fs(i) {
349
349
  const e = [];
350
350
  return i.forEach((n) => {
351
- const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: a } = t, l = Cr(0, 0, r.map((c) => c.transform || {})), g = r.map((c) => {
352
- const h = c.transform || { left: 0, top: 0 }, { unitId: u, subUnitId: m, drawingId: f } = c;
351
+ const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: c } = t, d = ui(0, 0, r.map((l) => l.transform || {})), g = r.map((l) => {
352
+ const h = l.transform || { left: 0, top: 0 }, { unitId: u, subUnitId: m, drawingId: p } = l;
353
353
  return {
354
354
  unitId: u,
355
355
  subUnitId: m,
356
- drawingId: f,
356
+ drawingId: p,
357
357
  transform: {
358
358
  ...h,
359
- left: h.left - l.left,
360
- top: h.top - l.top
359
+ left: h.left - d.left,
360
+ top: h.top - d.top
361
361
  },
362
- groupId: a
362
+ groupId: c
363
363
  };
364
- }), d = {
364
+ }), a = {
365
365
  unitId: s,
366
366
  subUnitId: o,
367
- drawingId: a,
368
- drawingType: k.DRAWING_GROUP,
369
- transform: l
367
+ drawingId: c,
368
+ drawingType: L.DRAWING_GROUP,
369
+ transform: d
370
370
  };
371
371
  e.push({
372
- parent: d,
372
+ parent: a,
373
373
  children: g
374
374
  });
375
375
  }), e;
376
376
  }
377
- function Ti(i) {
377
+ function ps(i) {
378
378
  const e = [];
379
379
  return i.forEach((n) => {
380
- const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: a, transform: l = { width: 0, height: 0 } } = t;
381
- if (l == null)
380
+ const { parent: t, children: r } = n, { unitId: s, subUnitId: o, drawingId: c, transform: d = { width: 0, height: 0 } } = t;
381
+ if (d == null)
382
382
  return;
383
- const g = r.map((c) => {
384
- const { transform: h } = c, { unitId: u, subUnitId: m, drawingId: f } = c, p = Rr(h || {}, l, l.width || 0, l.height || 0);
383
+ const g = r.map((l) => {
384
+ const { transform: h } = l, { unitId: u, subUnitId: m, drawingId: p } = l, f = hi(h || {}, d, d.width || 0, d.height || 0);
385
385
  return {
386
386
  unitId: u,
387
387
  subUnitId: m,
388
- drawingId: f,
389
- transform: p,
388
+ drawingId: p,
389
+ transform: f,
390
390
  groupId: void 0
391
391
  };
392
- }), d = {
392
+ }), a = {
393
393
  unitId: s,
394
394
  subUnitId: o,
395
- drawingId: a,
396
- drawingType: k.DRAWING_GROUP,
395
+ drawingId: c,
396
+ drawingType: L.DRAWING_GROUP,
397
397
  transform: {
398
398
  left: 0,
399
399
  top: 0
400
400
  }
401
401
  };
402
402
  e.push({
403
- parent: d,
403
+ parent: a,
404
404
  children: g
405
405
  });
406
406
  }), e;
407
407
  }
408
- const Cn = {
408
+ const ur = {
409
409
  id: "sheet.command.group-sheet-image",
410
- type: Y.COMMAND,
410
+ type: q.COMMAND,
411
411
  handler: (i, e) => {
412
- const n = i.get(B), t = i.get(fe), r = i.get(z);
412
+ const n = i.get(X), t = i.get($e), r = i.get(ee);
413
413
  if (!e) return !1;
414
414
  const s = [];
415
415
  e.forEach(({ parent: u, children: m }) => {
416
- s.push(u.unitId), m.forEach((f) => {
417
- s.push(f.unitId);
416
+ s.push(u.unitId), m.forEach((p) => {
417
+ s.push(p.unitId);
418
418
  });
419
419
  });
420
- const o = r.getGroupDrawingOp(e), { unitId: a, subUnitId: l, undo: g, redo: d, objects: c } = o;
421
- return n.syncExecuteCommand(O.id, { op: d, unitId: a, subUnitId: l, objects: c, type: E.GROUP }) ? (t.pushUndoRedo({
422
- unitID: a,
420
+ const o = r.getGroupDrawingOp(e), { unitId: c, subUnitId: d, undo: g, redo: a, objects: l } = o;
421
+ return n.syncExecuteCommand(P.id, { op: a, unitId: c, subUnitId: d, objects: l, type: U.GROUP }) ? (t.pushUndoRedo({
422
+ unitID: c,
423
423
  undoMutations: [
424
- { id: O.id, params: { op: g, unitId: a, subUnitId: l, objects: Ti(c), type: E.UNGROUP } },
425
- { id: W.id, params: s }
424
+ { id: P.id, params: { op: g, unitId: c, subUnitId: d, objects: ps(l), type: U.UNGROUP } },
425
+ { id: k.id, params: s }
426
426
  ],
427
427
  redoMutations: [
428
- { id: O.id, params: { op: d, unitId: a, subUnitId: l, objects: c, type: E.GROUP } },
429
- { id: W.id, params: s }
428
+ { id: P.id, params: { op: a, unitId: c, subUnitId: d, objects: l, type: U.GROUP } },
429
+ { id: k.id, params: s }
430
430
  ]
431
431
  }), !0) : !1;
432
432
  }
433
- }, et = {
433
+ }, kt = {
434
434
  id: "sheet.command.insert-sheet-image",
435
- type: Y.COMMAND,
435
+ type: q.COMMAND,
436
436
  handler: (i, e) => {
437
- var I, S, M;
438
- const n = i.get(B), t = i.get(fe), r = i.get(z), s = i.get(Ze);
437
+ var S, I, D;
438
+ const n = i.get(X), t = i.get($e), r = i.get(ee), s = i.get(Bt);
439
439
  if (!e) return !1;
440
- const o = e.drawings, a = o.map((w) => w.unitId), l = r.getBatchAddOp(o), { unitId: g, subUnitId: d, undo: c, redo: h, objects: u } = l, m = s.onCommandExecute({ id: et.id, params: e }), f = { id: O.id, params: { op: h, unitId: g, subUnitId: d, objects: u, type: E.INSERT } }, p = { id: O.id, params: { op: c, unitId: g, subUnitId: d, objects: u, type: E.REMOVE } };
441
- return Ft([...(I = m.preRedos) != null ? I : [], f, ...m.redos], n) ? (t.pushUndoRedo({
440
+ const o = e.drawings, c = o.map((v) => v.unitId), d = r.getBatchAddOp(o), { unitId: g, subUnitId: a, undo: l, redo: h, objects: u } = d, m = s.onCommandExecute({ id: kt.id, params: e }), p = { id: P.id, params: { op: h, unitId: g, subUnitId: a, objects: u, type: U.INSERT } }, f = { id: P.id, params: { op: l, unitId: g, subUnitId: a, objects: u, type: U.REMOVE } };
441
+ return Pn([...(S = m.preRedos) != null ? S : [], p, ...m.redos], n) ? (t.pushUndoRedo({
442
442
  unitID: g,
443
443
  undoMutations: [
444
- ...(S = m.preUndos) != null ? S : [],
445
- p,
444
+ ...(I = m.preUndos) != null ? I : [],
445
+ f,
446
446
  ...m.undos,
447
- { id: W.id, params: a }
447
+ { id: k.id, params: c }
448
448
  ],
449
449
  redoMutations: [
450
- ...(M = m.preRedos) != null ? M : [],
451
- f,
450
+ ...(D = m.preRedos) != null ? D : [],
451
+ p,
452
452
  ...m.redos,
453
- { id: W.id, params: a }
453
+ { id: k.id, params: c }
454
454
  ]
455
455
  }), !0) : !1;
456
456
  }
457
- }, Rn = {
457
+ }, hr = {
458
458
  id: "sheet.command.set-drawing-arrange",
459
- type: Y.COMMAND,
459
+ type: q.COMMAND,
460
460
  handler: (i, e) => {
461
- const n = i.get(B), t = i.get(fe);
461
+ const n = i.get(X), t = i.get($e);
462
462
  if (!e) return !1;
463
- const r = i.get(z), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: l } = e, g = { unitId: s, subUnitId: o, drawingIds: a };
464
- let d;
465
- if (l === be.forward ? d = r.getForwardDrawingsOp(g) : l === be.backward ? d = r.getBackwardDrawingOp(g) : l === be.front ? d = r.getFrontDrawingsOp(g) : l === be.back && (d = r.getBackDrawingsOp(g)), d == null)
463
+ const r = i.get(ee), { unitId: s, subUnitId: o, drawingIds: c, arrangeType: d } = e, g = { unitId: s, subUnitId: o, drawingIds: c };
464
+ let a;
465
+ if (d === dt.forward ? a = r.getForwardDrawingsOp(g) : d === dt.backward ? a = r.getBackwardDrawingOp(g) : d === dt.front ? a = r.getFrontDrawingsOp(g) : d === dt.back && (a = r.getBackDrawingsOp(g)), a == null)
466
466
  return !1;
467
- const { objects: c, redo: h, undo: u } = d;
468
- return n.syncExecuteCommand(O.id, { op: h, unitId: s, subUnitId: o, objects: c, type: E.ARRANGE }) ? (t.pushUndoRedo({
467
+ const { objects: l, redo: h, undo: u } = a;
468
+ return n.syncExecuteCommand(P.id, { op: h, unitId: s, subUnitId: o, objects: l, type: U.ARRANGE }) ? (t.pushUndoRedo({
469
469
  unitID: s,
470
470
  undoMutations: [
471
- { id: O.id, params: { op: u, unitId: s, subUnitId: o, objects: c, type: E.ARRANGE } }
471
+ { id: P.id, params: { op: u, unitId: s, subUnitId: o, objects: l, type: U.ARRANGE } }
472
472
  ],
473
473
  redoMutations: [
474
- { id: O.id, params: { op: h, unitId: s, subUnitId: o, objects: c, type: E.ARRANGE } }
474
+ { id: P.id, params: { op: h, unitId: s, subUnitId: o, objects: l, type: U.ARRANGE } }
475
475
  ]
476
476
  }), !0) : !1;
477
477
  }
478
- }, tt = {
478
+ }, Lt = {
479
479
  id: "sheet.command.set-sheet-image",
480
- type: Y.COMMAND,
480
+ type: q.COMMAND,
481
481
  handler: (i, e) => {
482
- const n = i.get(B), t = i.get(fe), r = i.get(z);
482
+ const n = i.get(X), t = i.get($e), r = i.get(ee);
483
483
  if (!e) return !1;
484
- const { drawings: s } = e, o = r.getBatchUpdateOp(s), { unitId: a, subUnitId: l, undo: g, redo: d, objects: c } = o;
485
- return n.syncExecuteCommand(O.id, { unitId: a, subUnitId: l, op: d, objects: c, type: E.UPDATE }) ? (t.pushUndoRedo({
486
- unitID: a,
484
+ const { drawings: s } = e, o = r.getBatchUpdateOp(s), { unitId: c, subUnitId: d, undo: g, redo: a, objects: l } = o;
485
+ return n.syncExecuteCommand(P.id, { unitId: c, subUnitId: d, op: a, objects: l, type: U.UPDATE }) ? (t.pushUndoRedo({
486
+ unitID: c,
487
487
  undoMutations: [
488
- { id: O.id, params: { unitId: a, subUnitId: l, op: g, objects: c, type: E.UPDATE } },
489
- { id: W.id, params: [a] }
488
+ { id: P.id, params: { unitId: c, subUnitId: d, op: g, objects: l, type: U.UPDATE } },
489
+ { id: k.id, params: [c] }
490
490
  ],
491
491
  redoMutations: [
492
- { id: O.id, params: { unitId: a, subUnitId: l, op: d, objects: c, type: E.UPDATE } },
493
- { id: W.id, params: [a] }
492
+ { id: P.id, params: { unitId: c, subUnitId: d, op: a, objects: l, type: U.UPDATE } },
493
+ { id: k.id, params: [c] }
494
494
  ]
495
495
  }), !0) : !1;
496
496
  }
497
- }, Mn = {
497
+ }, gr = {
498
498
  id: "sheet.command.ungroup-sheet-image",
499
- type: Y.COMMAND,
499
+ type: q.COMMAND,
500
500
  handler: (i, e) => {
501
- const n = i.get(B), t = i.get(fe), r = i.get(z);
501
+ const n = i.get(X), t = i.get($e), r = i.get(ee);
502
502
  if (!e) return !1;
503
503
  const s = [];
504
504
  e.forEach(({ parent: u, children: m }) => {
505
- s.push(u.unitId), m.forEach((f) => {
506
- s.push(f.unitId);
505
+ s.push(u.unitId), m.forEach((p) => {
506
+ s.push(p.unitId);
507
507
  });
508
508
  });
509
- const o = r.getUngroupDrawingOp(e), { unitId: a, subUnitId: l, undo: g, redo: d, objects: c } = o;
510
- return n.syncExecuteCommand(O.id, { op: d, unitId: a, subUnitId: l, objects: c, type: E.UNGROUP }) ? (t.pushUndoRedo({
511
- unitID: a,
509
+ const o = r.getUngroupDrawingOp(e), { unitId: c, subUnitId: d, undo: g, redo: a, objects: l } = o;
510
+ return n.syncExecuteCommand(P.id, { op: a, unitId: c, subUnitId: d, objects: l, type: U.UNGROUP }) ? (t.pushUndoRedo({
511
+ unitID: c,
512
512
  undoMutations: [
513
- { id: O.id, params: { op: g, unitId: a, subUnitId: l, objects: Ei(c), type: E.GROUP } },
514
- { id: W.id, params: s }
513
+ { id: P.id, params: { op: g, unitId: c, subUnitId: d, objects: fs(l), type: U.GROUP } },
514
+ { id: k.id, params: s }
515
515
  ],
516
516
  redoMutations: [
517
- { id: O.id, params: { op: d, unitId: a, subUnitId: l, objects: c, type: E.UNGROUP } },
518
- { id: W.id, params: s }
517
+ { id: P.id, params: { op: a, unitId: c, subUnitId: d, objects: l, type: U.UNGROUP } },
518
+ { id: k.id, params: s }
519
519
  ]
520
520
  }), !0) : !1;
521
521
  }
522
522
  };
523
- var Pi = Object.defineProperty, Ui = Object.getOwnPropertyDescriptor, Ai = (i, e, n, t) => {
524
- for (var r = t > 1 ? void 0 : t ? Ui(e, n) : e, s = i.length - 1, o; s >= 0; s--)
523
+ var ws = Object.defineProperty, _s = Object.getOwnPropertyDescriptor, vs = (i, e, n, t) => {
524
+ for (var r = t > 1 ? void 0 : t ? _s(e, n) : e, s = i.length - 1, o; s >= 0; s--)
525
525
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
526
- return t && r && Pi(e, n, r), r;
527
- }, K = (i, e) => (n, t) => e(n, t, i);
528
- function Ni(i, e, n) {
526
+ return t && r && ws(e, n, r), r;
527
+ }, ne = (i, e) => (n, t) => e(n, t, i);
528
+ function Ss(i, e, n) {
529
529
  const t = n * Math.PI / 180, r = Math.abs(i * Math.cos(t)) + Math.abs(e * Math.sin(t)), s = Math.abs(i * Math.sin(t)) + Math.abs(e * Math.cos(t));
530
530
  return { rotatedWidth: r, rotatedHeight: s };
531
531
  }
532
- function bn(i, e, n, t, r) {
533
- var I;
534
- const { rotatedHeight: s, rotatedWidth: o } = Ni(n, t, r), l = i.get(X).getRenderById(e.unitId);
535
- if (!l)
532
+ function mr(i, e, n, t, r) {
533
+ var S;
534
+ const { rotatedHeight: s, rotatedWidth: o } = Ss(n, t, r), d = i.get(Q).getRenderById(e.unitId);
535
+ if (!d)
536
536
  return !1;
537
- const d = (I = l.with(Z).getWorksheetSkeleton(e.subUnitId)) == null ? void 0 : I.skeleton;
538
- if (d == null)
537
+ const a = (S = d.with(H).getWorksheetSkeleton(e.subUnitId)) == null ? void 0 : S.skeleton;
538
+ if (a == null)
539
539
  return !1;
540
- const c = d.getCellByIndex(e.row, e.col), h = c.mergeInfo.endX - c.mergeInfo.startX - 2, u = c.mergeInfo.endY - c.mergeInfo.startY - 2, m = o / s, p = Math.ceil(Math.min(h, u * m)) / o, v = !p || Number.isNaN(p) ? 1e-3 : p;
540
+ const l = a.getCellByIndex(e.row, e.col), h = l.mergeInfo.endX - l.mergeInfo.startX - 2, u = l.mergeInfo.endY - l.mergeInfo.startY - 2, m = o / s, f = Math.ceil(Math.min(h, u * m)) / o, w = !f || Number.isNaN(f) ? 1e-3 : f;
541
541
  return {
542
- width: n * v,
543
- height: t * v
542
+ width: n * w,
543
+ height: t * w
544
544
  };
545
545
  }
546
- let Se = class extends q {
547
- constructor(e, n, t, r, s, o, a, l, g, d, c, h, u) {
546
+ let ze = class extends ae {
547
+ constructor(e, n, t, r, s, o, c, d, g, a, l, h, u) {
548
548
  super();
549
- V(this, "_workbookSelections");
550
- this._context = e, this._skeletonManagerService = n, this._commandService = t, this._selectionRenderService = r, this._imageIoService = s, this._fileOpenerService = o, this._sheetDrawingService = a, this._drawingManagerService = l, this._contextService = g, this._messageService = d, this._localeService = c, this._injector = u, this._workbookSelections = h.getWorkbookSelections(this._context.unitId), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
549
+ J(this, "_workbookSelections");
550
+ this._context = e, this._skeletonManagerService = n, this._commandService = t, this._selectionRenderService = r, this._imageIoService = s, this._fileOpenerService = o, this._sheetDrawingService = c, this._drawingManagerService = d, this._contextService = g, this._messageService = a, this._localeService = l, this._injector = u, this._workbookSelections = h.getWorkbookSelections(this._context.unitId), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
551
551
  }
552
552
  async insertFloatImage() {
553
553
  const e = await this._fileOpenerService.openFile({
554
554
  multiple: !0,
555
- accept: yt.map((t) => `.${t.replace("image/", "")}`).join(",")
555
+ accept: fn.map((t) => `.${t.replace("image/", "")}`).join(",")
556
556
  }), n = e.length;
557
- return n > Ot ? (this._messageService.show({
558
- type: ae.Error,
559
- content: this._localeService.t("update-status.exceedMaxCount", String(Ot))
557
+ return n > pn ? (this._messageService.show({
558
+ type: be.Error,
559
+ content: this._localeService.t("update-status.exceedMaxCount", String(pn))
560
560
  }), !1) : n === 0 ? !1 : (e.forEach(async (t) => await this._insertFloatImage(t)), !0);
561
561
  }
562
562
  async insertCellImage() {
563
563
  const n = (await this._fileOpenerService.openFile({
564
564
  multiple: !1,
565
- accept: yt.map((t) => `.${t.replace("image/", "")}`).join(",")
565
+ accept: fn.map((t) => `.${t.replace("image/", "")}`).join(",")
566
566
  }))[0];
567
567
  return n ? (await this._insertCellImage(n), !0) : !1;
568
568
  }
@@ -570,44 +570,44 @@ let Se = class extends q {
570
570
  let n;
571
571
  try {
572
572
  n = await this._imageIoService.saveImage(e);
573
- } catch (I) {
574
- const S = I.message;
575
- S === ue.ERROR_EXCEED_SIZE ? this._messageService.show({
576
- type: ae.Error,
577
- content: this._localeService.t("update-status.exceedMaxSize", String(Et / (1024 * 1024)))
578
- }) : S === ue.ERROR_IMAGE_TYPE ? this._messageService.show({
579
- type: ae.Error,
573
+ } catch (S) {
574
+ const I = S.message;
575
+ I === Ne.ERROR_EXCEED_SIZE ? this._messageService.show({
576
+ type: be.Error,
577
+ content: this._localeService.t("update-status.exceedMaxSize", String(wn / (1024 * 1024)))
578
+ }) : I === Ne.ERROR_IMAGE_TYPE ? this._messageService.show({
579
+ type: be.Error,
580
580
  content: this._localeService.t("update-status.invalidImageType")
581
- }) : S === ue.ERROR_IMAGE && this._messageService.show({
582
- type: ae.Error,
581
+ }) : I === Ne.ERROR_IMAGE && this._messageService.show({
582
+ type: be.Error,
583
583
  content: this._localeService.t("update-status.invalidImage")
584
584
  });
585
585
  }
586
586
  if (n == null)
587
587
  return;
588
- const t = this._getUnitInfo(), { unitId: r, subUnitId: s } = t, { imageId: o, imageSourceType: a, source: l, base64Cache: g } = n, { width: d, height: c, image: h } = await Tt(g || ""), { width: u, height: m } = this._context.scene;
589
- this._imageIoService.addImageSourceCache(l, a, h);
590
- let f = 1;
591
- if (d > Pt || c > Ut) {
592
- const I = Pt / d, S = Ut / c;
593
- f = Math.max(I, S);
588
+ const t = this._getUnitInfo(), { unitId: r, subUnitId: s } = t, { imageId: o, imageSourceType: c, source: d, base64Cache: g } = n, { width: a, height: l, image: h } = await _n(g || ""), { width: u, height: m } = this._context.scene;
589
+ this._imageIoService.addImageSourceCache(d, c, h);
590
+ let p = 1;
591
+ if (a > vn || l > Sn) {
592
+ const S = vn / a, I = Sn / l;
593
+ p = Math.max(S, I);
594
594
  }
595
- const p = this._getImagePosition(d * f, c * f, u, m);
596
- if (p == null)
595
+ const f = this._getImagePosition(a * p, l * p, u, m);
596
+ if (f == null)
597
597
  return;
598
- const v = {
598
+ const w = {
599
599
  unitId: r,
600
600
  subUnitId: s,
601
601
  drawingId: o,
602
- drawingType: k.DRAWING_IMAGE,
603
- imageSourceType: a,
604
- source: l,
605
- transform: L(p, this._selectionRenderService, this._skeletonManagerService),
606
- sheetTransform: p
602
+ drawingType: L.DRAWING_IMAGE,
603
+ imageSourceType: c,
604
+ source: d,
605
+ transform: V(f, this._selectionRenderService, this._skeletonManagerService),
606
+ sheetTransform: f
607
607
  };
608
- this._commandService.executeCommand(et.id, {
608
+ this._commandService.executeCommand(kt.id, {
609
609
  unitId: r,
610
- drawings: [v]
610
+ drawings: [w]
611
611
  });
612
612
  }
613
613
  // eslint-disable-next-line max-lines-per-function
@@ -615,36 +615,36 @@ let Se = class extends q {
615
615
  let n;
616
616
  try {
617
617
  n = await this._imageIoService.saveImage(e);
618
- } catch (p) {
619
- const v = p.message;
620
- v === ue.ERROR_EXCEED_SIZE ? this._messageService.show({
621
- type: ae.Error,
622
- content: this._localeService.t("update-status.exceedMaxSize", String(Et / (1024 * 1024)))
623
- }) : v === ue.ERROR_IMAGE_TYPE ? this._messageService.show({
624
- type: ae.Error,
618
+ } catch (f) {
619
+ const w = f.message;
620
+ w === Ne.ERROR_EXCEED_SIZE ? this._messageService.show({
621
+ type: be.Error,
622
+ content: this._localeService.t("update-status.exceedMaxSize", String(wn / (1024 * 1024)))
623
+ }) : w === Ne.ERROR_IMAGE_TYPE ? this._messageService.show({
624
+ type: be.Error,
625
625
  content: this._localeService.t("update-status.invalidImageType")
626
- }) : v === ue.ERROR_IMAGE && this._messageService.show({
627
- type: ae.Error,
626
+ }) : w === Ne.ERROR_IMAGE && this._messageService.show({
627
+ type: be.Error,
628
628
  content: this._localeService.t("update-status.invalidImage")
629
629
  });
630
630
  }
631
631
  if (n == null)
632
632
  return;
633
- const { imageId: t, imageSourceType: r, source: s, base64Cache: o } = n, { width: a, height: l, image: g } = await Tt(o || "");
633
+ const { imageId: t, imageSourceType: r, source: s, base64Cache: o } = n, { width: c, height: d, image: g } = await _n(o || "");
634
634
  this._imageIoService.addImageSourceCache(s, r, g);
635
- const d = this._workbookSelections.getCurrentLastSelection();
636
- if (!d)
635
+ const a = this._workbookSelections.getCurrentLastSelection();
636
+ if (!a)
637
637
  return !1;
638
- const c = Gn("", {}), h = bn(
638
+ const l = Ur("", {}), h = mr(
639
639
  this._injector,
640
640
  {
641
641
  unitId: this._context.unitId,
642
642
  subUnitId: this._context.unit.getActiveSheet().getSheetId(),
643
- row: d.primary.actualRow,
644
- col: d.primary.actualColumn
643
+ row: a.primary.actualRow,
644
+ col: a.primary.actualColumn
645
645
  },
646
- a,
647
- l,
646
+ c,
647
+ d,
648
648
  0
649
649
  );
650
650
  if (!h)
@@ -655,35 +655,35 @@ let Se = class extends q {
655
655
  height: h.height
656
656
  },
657
657
  positionH: {
658
- relativeFrom: Fn.PAGE,
658
+ relativeFrom: Ar.PAGE,
659
659
  posOffset: 0
660
660
  },
661
661
  positionV: {
662
- relativeFrom: Vn.PARAGRAPH,
662
+ relativeFrom: Nr.PARAGRAPH,
663
663
  posOffset: 0
664
664
  },
665
665
  angle: 0
666
666
  }, m = {
667
- unitId: c.getUnitId(),
668
- subUnitId: c.getUnitId(),
667
+ unitId: l.getUnitId(),
668
+ subUnitId: l.getUnitId(),
669
669
  drawingId: t,
670
- drawingType: k.DRAWING_IMAGE,
670
+ drawingType: L.DRAWING_IMAGE,
671
671
  imageSourceType: r,
672
672
  source: s,
673
- transform: ui(u),
673
+ transform: Zi(u),
674
674
  docTransform: u,
675
- behindDoc: kn.FALSE,
675
+ behindDoc: jr.FALSE,
676
676
  title: "",
677
677
  description: "",
678
- layoutType: Hn.INLINE,
678
+ layoutType: Wr.INLINE,
679
679
  // Insert inline drawing by default.
680
- wrapText: Yn.BOTH_SIDES,
680
+ wrapText: xr.BOTH_SIDES,
681
681
  distB: 0,
682
682
  distL: 0,
683
683
  distR: 0,
684
684
  distT: 0
685
- }, f = Xn.drawing.add({
686
- documentDataModel: c,
685
+ }, p = Br.drawing.add({
686
+ documentDataModel: l,
687
687
  drawings: [m],
688
688
  selection: {
689
689
  collapsed: !0,
@@ -691,11 +691,11 @@ let Se = class extends q {
691
691
  endOffset: 0
692
692
  }
693
693
  });
694
- return f ? (c.apply(f), this._commandService.syncExecuteCommand(Kr.id, {
694
+ return p ? (l.apply(p), this._commandService.syncExecuteCommand(ji.id, {
695
695
  value: {
696
- [d.primary.actualRow]: {
697
- [d.primary.actualColumn]: {
698
- p: c.getSnapshot(),
696
+ [a.primary.actualRow]: {
697
+ [a.primary.actualColumn]: {
698
+ p: l.getSnapshot(),
699
699
  t: 1
700
700
  }
701
701
  }
@@ -718,39 +718,39 @@ let Se = class extends q {
718
718
  endColumn: 0
719
719
  };
720
720
  s && s.length > 0 && (o = s[s.length - 1].range);
721
- const a = Xt(this._skeletonManagerService.getCurrent().skeleton, o);
722
- if (a == null)
721
+ const c = Wn(this._skeletonManagerService.getCurrent().skeleton, o);
722
+ if (c == null)
723
723
  return;
724
- let { startColumn: l, startRow: g, startX: d, startY: c } = a, h = !1;
725
- if (d + e > t && (d = t - e, d < 0 && (d = 0, e = t), h = !0), c + n > r && (c = r - n, c < 0 && (c = 0, n = r), h = !0), h) {
726
- const p = this._selectionRenderService.getCellWithCoordByOffset(d, c);
727
- if (p == null)
724
+ let { startColumn: d, startRow: g, startX: a, startY: l } = c, h = !1;
725
+ if (a + e > t && (a = t - e, a < 0 && (a = 0, e = t), h = !0), l + n > r && (l = r - n, l < 0 && (l = 0, n = r), h = !0), h) {
726
+ const f = this._selectionRenderService.getCellWithCoordByOffset(a, l);
727
+ if (f == null)
728
728
  return;
729
- d = p.startX, c = p.startY, l = p.actualColumn, g = p.actualRow;
729
+ a = f.startX, l = f.startY, d = f.actualColumn, g = f.actualRow;
730
730
  }
731
731
  const u = {
732
- column: l,
732
+ column: d,
733
733
  columnOffset: 0,
734
734
  row: g,
735
735
  rowOffset: 0
736
- }, m = this._selectionRenderService.getCellWithCoordByOffset(d + e, c + n);
736
+ }, m = this._selectionRenderService.getCellWithCoordByOffset(a + e, l + n);
737
737
  if (m == null)
738
738
  return;
739
- const f = {
739
+ const p = {
740
740
  column: m.actualColumn,
741
- columnOffset: d + e - m.startX,
741
+ columnOffset: a + e - m.startX,
742
742
  row: m.actualRow,
743
- rowOffset: c + n - m.startY
743
+ rowOffset: l + n - m.startY
744
744
  };
745
745
  return {
746
746
  from: u,
747
- to: f
747
+ to: p
748
748
  };
749
749
  }
750
750
  _updateOrderListener() {
751
751
  this.disposeWithMe(this._drawingManagerService.featurePluginOrderUpdate$.subscribe((e) => {
752
752
  const { unitId: n, subUnitId: t, drawingIds: r, arrangeType: s } = e;
753
- this._commandService.executeCommand(Rn.id, {
753
+ this._commandService.executeCommand(hr.id, {
754
754
  unitId: n,
755
755
  subUnitId: t,
756
756
  drawingIds: r,
@@ -762,22 +762,22 @@ let Se = class extends q {
762
762
  this.disposeWithMe(this._drawingManagerService.featurePluginUpdate$.subscribe((e) => {
763
763
  const n = [];
764
764
  e.length !== 0 && (e.forEach((t) => {
765
- const { unitId: r, subUnitId: s, drawingId: o, drawingType: a, transform: l } = t;
766
- if (l == null)
765
+ const { unitId: r, subUnitId: s, drawingId: o, drawingType: c, transform: d } = t;
766
+ if (d == null)
767
767
  return;
768
768
  const g = this._sheetDrawingService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: o });
769
769
  if (g == null || g.unitId !== this._context.unitId)
770
770
  return;
771
- const d = j({ ...g.transform, ...l }, this._selectionRenderService);
772
- if (d == null)
771
+ const a = $({ ...g.transform, ...d }, this._selectionRenderService);
772
+ if (a == null)
773
773
  return;
774
- const c = {
774
+ const l = {
775
775
  ...t,
776
- transform: { ...g.transform, ...l, ...L(d, this._selectionRenderService, this._skeletonManagerService) },
777
- sheetTransform: { ...d }
776
+ transform: { ...g.transform, ...d, ...V(a, this._selectionRenderService, this._skeletonManagerService) },
777
+ sheetTransform: { ...a }
778
778
  };
779
- n.push(c);
780
- }), n.length > 0 && this._commandService.executeCommand(tt.id, {
779
+ n.push(l);
780
+ }), n.length > 0 && this._commandService.executeCommand(Lt.id, {
781
781
  unitId: e[0].unitId,
782
782
  drawings: n
783
783
  }));
@@ -785,44 +785,44 @@ let Se = class extends q {
785
785
  }
786
786
  _groupDrawingListener() {
787
787
  this.disposeWithMe(this._drawingManagerService.featurePluginGroupUpdate$.subscribe((e) => {
788
- this._commandService.executeCommand(Cn.id, e);
788
+ this._commandService.executeCommand(ur.id, e);
789
789
  const { unitId: n, subUnitId: t, drawingId: r } = e[0].parent;
790
- this._commandService.syncExecuteCommand(qe.id, [{ unitId: n, subUnitId: t, drawingId: r }]);
790
+ this._commandService.syncExecuteCommand(xt.id, [{ unitId: n, subUnitId: t, drawingId: r }]);
791
791
  })), this.disposeWithMe(this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((e) => {
792
- this._commandService.executeCommand(Mn.id, e);
792
+ this._commandService.executeCommand(gr.id, e);
793
793
  }));
794
794
  }
795
795
  _focusDrawingListener() {
796
796
  this.disposeWithMe(
797
797
  this._drawingManagerService.focus$.subscribe((e) => {
798
- e == null || e.length === 0 ? (this._contextService.setContextValue(ge, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(ge, !0), this._sheetDrawingService.focusDrawing(e));
798
+ e == null || e.length === 0 ? (this._contextService.setContextValue(xe, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(xe, !0), this._sheetDrawingService.focusDrawing(e));
799
799
  })
800
800
  );
801
801
  }
802
802
  };
803
- Se = Ai([
804
- K(1, U(Z)),
805
- K(2, B),
806
- K(3, Ce),
807
- K(4, kt),
808
- K(5, Lr),
809
- K(6, z),
810
- K(7, Q),
811
- K(8, Vt),
812
- K(9, Gr),
813
- K(10, U(Je)),
814
- K(11, U(Kt)),
815
- K(12, U(Ie))
816
- ], Se);
817
- var ji = Object.defineProperty, Wi = Object.getOwnPropertyDescriptor, xi = (i, e, n, t) => {
818
- for (var r = t > 1 ? void 0 : t ? Wi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
803
+ ze = vs([
804
+ ne(1, N(H)),
805
+ ne(2, X),
806
+ ne(3, Je),
807
+ ne(4, An),
808
+ ne(5, yi),
809
+ ne(6, ee),
810
+ ne(7, de),
811
+ ne(8, Un),
812
+ ne(9, Oi),
813
+ ne(10, N(Wt)),
814
+ ne(11, N(Bn)),
815
+ ne(12, N(Ke))
816
+ ], ze);
817
+ var Is = Object.defineProperty, Cs = Object.getOwnPropertyDescriptor, bs = (i, e, n, t) => {
818
+ for (var r = t > 1 ? void 0 : t ? Cs(e, n) : e, s = i.length - 1, o; s >= 0; s--)
819
819
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
820
- return t && r && ji(e, n, r), r;
821
- }, ce = (i, e) => (n, t) => e(n, t, i);
822
- function _t(i, e, n) {
820
+ return t && r && Is(e, n, r), r;
821
+ }, Re = (i, e) => (n, t) => e(n, t, i);
822
+ function sn(i, e, n) {
823
823
  var t, r, s, o;
824
824
  if (((r = (t = n == null ? void 0 : n.p) == null ? void 0 : t.body) == null ? void 0 : r.dataStream.length) === 3 && ((o = (s = n.p) == null ? void 0 : s.drawingsOrder) == null ? void 0 : o.length) === 1) {
825
- const a = n.p.drawings[n.p.drawingsOrder[0]], l = bn(
825
+ const c = n.p.drawings[n.p.drawingsOrder[0]], d = mr(
826
826
  i,
827
827
  {
828
828
  unitId: e.unitId,
@@ -830,74 +830,74 @@ function _t(i, e, n) {
830
830
  row: e.row,
831
831
  col: e.col
832
832
  },
833
- a.docTransform.size.width,
834
- a.docTransform.size.height,
835
- a.docTransform.angle
833
+ c.docTransform.size.width,
834
+ c.docTransform.size.height,
835
+ c.docTransform.angle
836
836
  );
837
- if (l)
838
- return a.transform.width = l.width, a.transform.height = l.height, a.docTransform.size.width = l.width, a.docTransform.size.height = l.height, a.transform.left = 0, a.transform.top = 0, a.docTransform.positionH.posOffset = 0, a.docTransform.positionV.posOffset = 0, n.p.documentStyle.pageSize.width = 1 / 0, n.p.documentStyle.pageSize.height = 1 / 0, !0;
837
+ if (d)
838
+ return c.transform.width = d.width, c.transform.height = d.height, c.docTransform.size.width = d.width, c.docTransform.size.height = d.height, c.transform.left = 0, c.transform.top = 0, c.docTransform.positionH.posOffset = 0, c.docTransform.positionV.posOffset = 0, n.p.documentStyle.pageSize.width = 1 / 0, n.p.documentStyle.pageSize.height = 1 / 0, !0;
839
839
  }
840
840
  return !1;
841
841
  }
842
- let Ge = class extends q {
842
+ let yt = class extends ae {
843
843
  constructor(i, e, n, t, r, s, o) {
844
844
  super(), this._commandService = i, this._sheetInterceptorService = e, this._univerInstanceService = n, this._injector = t, this._drawingManagerService = r, this._docDrawingController = s, this._editorBridgeService = o, this._initHandleResize(), this._handleInitEditor(), this._handleWriteCell(), this._initCellContentInterceptor();
845
845
  }
846
846
  _initHandleResize() {
847
847
  this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
848
848
  let e, n = [];
849
- if (i.id === Jt.id) {
849
+ if (i.id === $n.id) {
850
850
  const t = i.params;
851
- n = t.ranges, e = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
852
- } else if (i.id === qt.id) {
851
+ n = t.ranges, e = Y(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
852
+ } else if (i.id === kn.id) {
853
853
  const t = i.params;
854
- n = t.ranges, e = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
855
- } else if (i.id === Jr.id) {
854
+ n = t.ranges, e = Y(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
855
+ } else if (i.id === Wi.id) {
856
856
  const t = i.params;
857
- n = t.ranges, e = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
858
- } else if (i.id === qr.id) {
857
+ n = t.ranges, e = Y(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
858
+ } else if (i.id === Ln.id) {
859
859
  const t = i.params;
860
- e = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId }), n = t.rowsAutoHeightInfo.map((r) => ({
860
+ e = Y(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId }), n = t.rowsAutoHeightInfo.map((r) => ({
861
861
  startRow: r.row,
862
862
  endRow: r.row,
863
863
  startColumn: 0,
864
864
  endColumn: 9999
865
865
  }));
866
- } else if (i.id === Zr.id) {
866
+ } else if (i.id === xi.id) {
867
867
  const t = i.params;
868
- n = t.ranges, e = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
869
- } else if (i.id === Qr.id) {
868
+ n = t.ranges, e = Y(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
869
+ } else if (i.id === Bi.id) {
870
870
  const t = i.params;
871
- n = t.ranges, e = H(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
871
+ n = t.ranges, e = Y(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
872
872
  }
873
873
  e && n.length && n.forEach((t) => {
874
- const r = zn.transformRange(t, e.worksheet);
874
+ const r = $r.transformRange(t, e.worksheet);
875
875
  for (let s = r.startRow; s <= r.endRow; s++)
876
876
  for (let o = r.startColumn; o <= r.endColumn; o++)
877
- _t(this._injector, { unitId: e.unitId, subUnitId: e.subUnitId, row: s, col: o }, e.worksheet.getCellRaw(s, o));
877
+ sn(this._injector, { unitId: e.unitId, subUnitId: e.subUnitId, row: s, col: o }, e.worksheet.getCellRaw(s, o));
878
878
  });
879
879
  }));
880
880
  }
881
881
  _handleInitEditor() {
882
882
  this.disposeWithMe(this._editorBridgeService.visible$.subscribe((i) => {
883
- i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(De), this._docDrawingController.loadDrawingDataForUnit(De), this._drawingManagerService.initializeNotification(De)) : this._drawingManagerService.removeDrawingDataForUnit(De);
883
+ i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(lt), this._docDrawingController.loadDrawingDataForUnit(lt), this._drawingManagerService.initializeNotification(lt)) : this._drawingManagerService.removeDrawingDataForUnit(lt);
884
884
  })), this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
885
- i.id === hi.id && i.params.unitId === ye && (this._drawingManagerService.removeDrawingDataForUnit(ye), this._docDrawingController.loadDrawingDataForUnit(ye), this._drawingManagerService.initializeNotification(ye));
885
+ i.id === qi.id && i.params.unitId === ut && (this._drawingManagerService.removeDrawingDataForUnit(ut), this._docDrawingController.loadDrawingDataForUnit(ut), this._drawingManagerService.initializeNotification(ut));
886
886
  }));
887
887
  }
888
888
  _handleWriteCell() {
889
- this.disposeWithMe(this._sheetInterceptorService.writeCellInterceptor.intercept(ei, {
889
+ this.disposeWithMe(this._sheetInterceptorService.writeCellInterceptor.intercept($i, {
890
890
  priority: 9999,
891
- handler: (i, e, n) => (_t(this._injector, { unitId: e.unitId, subUnitId: e.subUnitId, row: e.row, col: e.col }, i), n(i))
891
+ handler: (i, e, n) => (sn(this._injector, { unitId: e.unitId, subUnitId: e.subUnitId, row: e.row, col: e.col }, i), n(i))
892
892
  }));
893
893
  }
894
894
  _initCellContentInterceptor() {
895
895
  this.disposeWithMe(
896
896
  this._sheetInterceptorService.intercept(
897
- ti.CELL_CONTENT,
897
+ ki.CELL_CONTENT,
898
898
  {
899
- effect: Kn.Style,
900
- priority: ni.CELL_IMAGE,
899
+ effect: kr.Style,
900
+ priority: Li.CELL_IMAGE,
901
901
  handler: (i, e, n) => {
902
902
  var t;
903
903
  return i != null && i.p && ((t = i.p.drawingsOrder) != null && t.length) && (i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 }), n(i);
@@ -907,21 +907,21 @@ let Ge = class extends q {
907
907
  );
908
908
  }
909
909
  };
910
- Ge = xi([
911
- ce(0, B),
912
- ce(1, U(Ze)),
913
- ce(2, pe),
914
- ce(3, U(Ie)),
915
- ce(4, Q),
916
- ce(5, U(gr)),
917
- ce(6, U(Er))
918
- ], Ge);
919
- var $i = Object.defineProperty, Bi = Object.getOwnPropertyDescriptor, Li = (i, e, n, t) => {
920
- for (var r = t > 1 ? void 0 : t ? Bi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
910
+ yt = bs([
911
+ Re(0, X),
912
+ Re(1, N(Bt)),
913
+ Re(2, ke),
914
+ Re(3, N(Ke)),
915
+ Re(4, de),
916
+ Re(5, N(ni)),
917
+ Re(6, N(pi))
918
+ ], yt);
919
+ var Rs = Object.defineProperty, Ds = Object.getOwnPropertyDescriptor, Ms = (i, e, n, t) => {
920
+ for (var r = t > 1 ? void 0 : t ? Ds(e, n) : e, s = i.length - 1, o; s >= 0; s--)
921
921
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
922
- return t && r && $i(e, n, r), r;
923
- }, Gt = (i, e) => (n, t) => e(n, t, i);
924
- let Fe = class extends q {
922
+ return t && r && Rs(e, n, r), r;
923
+ }, Tn = (i, e) => (n, t) => e(n, t, i);
924
+ let Ot = class extends ae {
925
925
  constructor(i, e) {
926
926
  super(), this._autoFillService = i, this._injector = e, this._initAutoFillHooks();
927
927
  }
@@ -930,27 +930,27 @@ let Fe = class extends q {
930
930
  this._autoFillService.addHook({
931
931
  id: "sheet-cell-image-autofill",
932
932
  onBeforeSubmit: (i, e, n, t) => {
933
- new Jn(t).forValue((r, s, o) => {
934
- _t(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
933
+ new Lr(t).forValue((r, s, o) => {
934
+ sn(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
935
935
  });
936
936
  }
937
937
  })
938
938
  );
939
939
  }
940
940
  };
941
- Fe = Li([
942
- Gt(0, U(Tr)),
943
- Gt(1, U(Ie))
944
- ], Fe);
945
- var Gi = Object.defineProperty, Fi = Object.getOwnPropertyDescriptor, Vi = (i, e, n, t) => {
946
- for (var r = t > 1 ? void 0 : t ? Fi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
941
+ Ot = Ms([
942
+ Tn(0, N(wi)),
943
+ Tn(1, N(Ke))
944
+ ], Ot);
945
+ var ys = Object.defineProperty, Os = Object.getOwnPropertyDescriptor, Es = (i, e, n, t) => {
946
+ for (var r = t > 1 ? void 0 : t ? Os(e, n) : e, s = i.length - 1, o; s >= 0; s--)
947
947
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
948
- return t && r && Gi(e, n, r), r;
949
- }, Ne = (i, e) => (n, t) => e(n, t, i);
950
- let Ve = class extends q {
948
+ return t && r && ys(e, n, r), r;
949
+ }, vt = (i, e) => (n, t) => e(n, t, i);
950
+ let Et = class extends ae {
951
951
  constructor(e, n, t, r) {
952
952
  super();
953
- V(this, "_isSetCursor", !1);
953
+ J(this, "_isSetCursor", !1);
954
954
  this._hoverManagerService = e, this._renderManagerService = n, this._selectionsService = t, this._drawingRenderService = r;
955
955
  }
956
956
  _initHover() {
@@ -958,21 +958,21 @@ let Ve = class extends q {
958
958
  _initImageClick() {
959
959
  }
960
960
  };
961
- Ve = Vi([
962
- Ne(0, U(Pr)),
963
- Ne(1, U(X)),
964
- Ne(2, U(Kt)),
965
- Ne(3, U(Ht))
966
- ], Ve);
967
- var ki = Object.defineProperty, Hi = Object.getOwnPropertyDescriptor, Yi = (i, e, n, t) => {
968
- for (var r = t > 1 ? void 0 : t ? Hi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
961
+ Et = Es([
962
+ vt(0, N(_i)),
963
+ vt(1, N(Q)),
964
+ vt(2, N(Bn)),
965
+ vt(3, N(Nn))
966
+ ], Et);
967
+ var Ts = Object.defineProperty, Ps = Object.getOwnPropertyDescriptor, Us = (i, e, n, t) => {
968
+ for (var r = t > 1 ? void 0 : t ? Ps(e, n) : e, s = i.length - 1, o; s >= 0; s--)
969
969
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
970
- return t && r && ki(e, n, r), r;
971
- }, dt = (i, e) => (n, t) => e(n, t, i);
972
- let ke = class extends q {
970
+ return t && r && Ts(e, n, r), r;
971
+ }, Zt = (i, e) => (n, t) => e(n, t, i);
972
+ let Tt = class extends ae {
973
973
  constructor(e, n, t) {
974
974
  super();
975
- V(this, "_copyInfo");
975
+ J(this, "_copyInfo");
976
976
  this._sheetClipboardService = e, this._renderManagerService = n, this._sheetDrawingService = t, this._initCopyPaste();
977
977
  }
978
978
  _initCopyPaste() {
@@ -980,137 +980,137 @@ let ke = class extends q {
980
980
  id: "SHEET_IMAGE_UI_PLUGIN",
981
981
  onBeforeCopy: (e, n, t) => this._collect(e, n, t),
982
982
  onPasteCells: (e, n, t, r) => {
983
- const { copyType: s = Nt.COPY, pasteType: o } = r, { range: a } = e || {}, { range: l, unitId: g, subUnitId: d } = n;
984
- return this._generateMutations(l, { copyType: s, pasteType: o, copyRange: a, unitId: g, subUnitId: d });
983
+ const { copyType: s = Cn.COPY, pasteType: o } = r, { range: c } = e || {}, { range: d, unitId: g, subUnitId: a } = n;
984
+ return this._generateMutations(d, { copyType: s, pasteType: o, copyRange: c, unitId: g, subUnitId: a });
985
985
  },
986
986
  onPastePlainText: (e, n) => ({ undos: [], redos: [] })
987
987
  });
988
988
  }
989
989
  _collect(e, n, t) {
990
990
  var h;
991
- const r = (h = this._renderManagerService.getRenderById(e)) == null ? void 0 : h.with(Z);
991
+ const r = (h = this._renderManagerService.getRenderById(e)) == null ? void 0 : h.with(H);
992
992
  if (!r) return;
993
993
  const s = r.attachRangeWithCoord(t);
994
994
  if (!s)
995
995
  return;
996
- const { startX: o, endX: a, startY: l, endY: g } = s, d = this._sheetDrawingService.getDrawingData(e, n), c = [];
997
- Object.keys(d).forEach((u) => {
998
- const m = d[u], { transform: f } = m;
999
- if (m.anchorType !== y.Both || !f)
996
+ const { startX: o, endX: c, startY: d, endY: g } = s, a = this._sheetDrawingService.getDrawingData(e, n), l = [];
997
+ Object.keys(a).forEach((u) => {
998
+ const m = a[u], { transform: p } = m;
999
+ if (m.anchorType !== O.Both || !p)
1000
1000
  return;
1001
- const { left: p = 0, top: v = 0, width: I = 0, height: S = 0 } = f, { drawingStartX: M, drawingEndX: w, drawingStartY: C, drawingEndY: _ } = {
1002
- drawingStartX: p,
1003
- drawingEndX: p + I,
1004
- drawingStartY: v,
1005
- drawingEndY: v + S
1001
+ const { left: f = 0, top: w = 0, width: S = 0, height: I = 0 } = p, { drawingStartX: D, drawingEndX: v, drawingStartY: R, drawingEndY: _ } = {
1002
+ drawingStartX: f,
1003
+ drawingEndX: f + S,
1004
+ drawingStartY: w,
1005
+ drawingEndY: w + I
1006
1006
  };
1007
- o <= M && w <= a && l <= C && _ <= g && c.push(m);
1008
- }), c.length && (this._copyInfo = {
1009
- drawings: c,
1007
+ o <= D && v <= c && d <= R && _ <= g && l.push(m);
1008
+ }), l.length && (this._copyInfo = {
1009
+ drawings: l,
1010
1010
  unitId: e,
1011
1011
  subUnitId: n
1012
1012
  });
1013
1013
  }
1014
1014
  // eslint-disable-next-line max-lines-per-function
1015
1015
  _generateMutations(e, n) {
1016
- var N;
1016
+ var A;
1017
1017
  if (!this._copyInfo)
1018
1018
  return { redos: [], undos: [] };
1019
1019
  if ([
1020
- Ee.SPECIAL_PASTE_COL_WIDTH,
1021
- Ee.SPECIAL_PASTE_VALUE,
1022
- Ee.SPECIAL_PASTE_FORMAT,
1023
- Ee.SPECIAL_PASTE_FORMULA
1020
+ mt.SPECIAL_PASTE_COL_WIDTH,
1021
+ mt.SPECIAL_PASTE_VALUE,
1022
+ mt.SPECIAL_PASTE_FORMAT,
1023
+ mt.SPECIAL_PASTE_FORMULA
1024
1024
  ].includes(n.pasteType))
1025
1025
  return { redos: [], undos: [] };
1026
1026
  const { copyRange: r } = n;
1027
1027
  if (!r)
1028
1028
  return { redos: [], undos: [] };
1029
- const { drawings: s, unitId: o, subUnitId: a } = this._copyInfo, { ranges: [l, g], mapFunc: d } = Ur([r, e]), { row: c, col: h } = d(l.startRow, l.startColumn), { row: u, col: m } = d(g.startRow, g.startColumn), f = (N = this._renderManagerService.getRenderById(o)) == null ? void 0 : N.with(Z);
1030
- if (!f)
1029
+ const { drawings: s, unitId: o, subUnitId: c } = this._copyInfo, { ranges: [d, g], mapFunc: a } = vi([r, e]), { row: l, col: h } = a(d.startRow, d.startColumn), { row: u, col: m } = a(g.startRow, g.startColumn), p = (A = this._renderManagerService.getRenderById(o)) == null ? void 0 : A.with(H);
1030
+ if (!p)
1031
1031
  return { redos: [], undos: [] };
1032
- const p = f.attachRangeWithCoord({
1033
- startRow: c,
1034
- endRow: c,
1032
+ const f = p.attachRangeWithCoord({
1033
+ startRow: l,
1034
+ endRow: l,
1035
1035
  startColumn: h,
1036
1036
  endColumn: h
1037
- }), v = f.attachRangeWithCoord({
1037
+ }), w = p.attachRangeWithCoord({
1038
1038
  startRow: u,
1039
1039
  endRow: u,
1040
1040
  startColumn: m,
1041
1041
  endColumn: m
1042
1042
  });
1043
- if (!p || !v)
1043
+ if (!f || !w)
1044
1044
  return { redos: [], undos: [] };
1045
- const I = [], S = [], M = v.startX - p.startX, w = v.startY - p.startY, C = u - c, _ = m - h, T = n.copyType === Nt.CUT, { _sheetDrawingService: D } = this;
1046
- return s.forEach((A) => {
1047
- const { transform: b, sheetTransform: R } = A;
1045
+ const S = [], I = [], D = w.startX - f.startX, v = w.startY - f.startY, R = u - l, _ = m - h, E = n.copyType === Cn.CUT, { _sheetDrawingService: M } = this;
1046
+ return s.forEach((T) => {
1047
+ const { transform: b, sheetTransform: C } = T;
1048
1048
  if (!b)
1049
1049
  return;
1050
- const P = {
1051
- ...A,
1050
+ const y = {
1051
+ ...T,
1052
1052
  unitId: o,
1053
- subUnitId: a,
1054
- drawingId: T ? A.drawingId : ve.generateRandomId(),
1053
+ subUnitId: c,
1054
+ drawingId: E ? T.drawingId : ye.generateRandomId(),
1055
1055
  transform: {
1056
1056
  ...b,
1057
- left: b.left + M,
1058
- top: b.top + w
1057
+ left: b.left + D,
1058
+ top: b.top + v
1059
1059
  },
1060
1060
  sheetTransform: {
1061
- to: { ...R.to, row: R.to.row + C, column: R.to.column + _ },
1062
- from: { ...R.from, row: R.from.row + C, column: R.from.column + _ }
1061
+ to: { ...C.to, row: C.to.row + R, column: C.to.column + _ },
1062
+ from: { ...C.from, row: C.from.row + R, column: C.from.column + _ }
1063
1063
  }
1064
1064
  };
1065
- if (T) {
1066
- const { undo: x, redo: se, objects: oe } = D.getBatchUpdateOp([P]);
1067
- I.push({
1068
- id: O.id,
1065
+ if (E) {
1066
+ const { undo: W, redo: z, objects: Z } = M.getBatchUpdateOp([y]);
1067
+ S.push({
1068
+ id: P.id,
1069
1069
  params: {
1070
1070
  unitId: o,
1071
- subUnitId: a,
1072
- type: E.UPDATE,
1073
- op: se,
1074
- objects: oe
1071
+ subUnitId: c,
1072
+ type: U.UPDATE,
1073
+ op: z,
1074
+ objects: Z
1075
1075
  }
1076
- }), S.push({
1077
- id: O.id,
1076
+ }), I.push({
1077
+ id: P.id,
1078
1078
  params: {
1079
1079
  unitId: o,
1080
- subUnitId: a,
1081
- type: E.UPDATE,
1082
- op: x,
1083
- objects: oe
1080
+ subUnitId: c,
1081
+ type: U.UPDATE,
1082
+ op: W,
1083
+ objects: Z
1084
1084
  }
1085
1085
  });
1086
1086
  } else {
1087
- const { undo: x, redo: se, objects: oe } = D.getBatchAddOp([P]);
1088
- I.push({ id: O.id, params: { op: se, unitId: o, subUnitId: a, objects: oe, type: E.INSERT } }), S.push({ id: O.id, params: { op: x, unitId: o, subUnitId: a, objects: oe, type: E.REMOVE } });
1087
+ const { undo: W, redo: z, objects: Z } = M.getBatchAddOp([y]);
1088
+ S.push({ id: P.id, params: { op: z, unitId: o, subUnitId: c, objects: Z, type: U.INSERT } }), I.push({ id: P.id, params: { op: W, unitId: o, subUnitId: c, objects: Z, type: U.REMOVE } });
1089
1089
  }
1090
1090
  }), {
1091
- redos: I,
1092
- undos: S
1091
+ redos: S,
1092
+ undos: I
1093
1093
  };
1094
1094
  }
1095
1095
  };
1096
- ke = Yi([
1097
- dt(0, Ar),
1098
- dt(1, X),
1099
- dt(2, z)
1100
- ], ke);
1101
- var Xi = Object.defineProperty, zi = Object.getOwnPropertyDescriptor, Ki = (i, e, n, t) => {
1102
- for (var r = t > 1 ? void 0 : t ? zi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1096
+ Tt = Us([
1097
+ Zt(0, Si),
1098
+ Zt(1, Q),
1099
+ Zt(2, ee)
1100
+ ], Tt);
1101
+ var As = Object.defineProperty, Ns = Object.getOwnPropertyDescriptor, js = (i, e, n, t) => {
1102
+ for (var r = t > 1 ? void 0 : t ? Ns(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1103
1103
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
1104
- return t && r && Xi(e, n, r), r;
1105
- }, we = (i, e) => (n, t) => e(n, t, i);
1106
- let He = class extends q {
1104
+ return t && r && As(e, n, r), r;
1105
+ }, Xe = (i, e) => (n, t) => e(n, t, i);
1106
+ let Pt = class extends ae {
1107
1107
  constructor(i, e, n, t, r) {
1108
1108
  super(), this._drawingManagerService = i, this._renderManagerService = e, this._permissionService = n, this._univerInstanceService = t, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
1109
1109
  }
1110
1110
  _initDrawingVisible() {
1111
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET);
1111
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET);
1112
1112
  this.disposeWithMe(
1113
- Te([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1113
+ ft([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1114
1114
  if (!e) {
1115
1115
  this._drawingManagerService.setDrawingVisible(!1);
1116
1116
  return;
@@ -1121,15 +1121,15 @@ let He = class extends q {
1121
1121
  return;
1122
1122
  }
1123
1123
  const r = e.getUnitId(), s = t.getSheetId();
1124
- if (this._permissionService.composePermission([new xt(r).id, new ot(r, s).id]).every((a) => a.value))
1124
+ if (this._permissionService.composePermission([new Mn(r).id, new zt(r, s).id]).every((c) => c.value))
1125
1125
  this._drawingManagerService.setDrawingVisible(!0);
1126
1126
  else {
1127
1127
  this._drawingManagerService.setDrawingVisible(!1);
1128
- const a = e.getUnitId(), l = t.getSheetId(), g = this._drawingManagerService.getDrawingData(a, l), d = Object.values(g), c = this._renderManagerService.getRenderById(a), h = c == null ? void 0 : c.scene;
1128
+ const c = e.getUnitId(), d = t.getSheetId(), g = this._drawingManagerService.getDrawingData(c, d), a = Object.values(g), l = this._renderManagerService.getRenderById(c), h = l == null ? void 0 : l.scene;
1129
1129
  if (h == null)
1130
1130
  return;
1131
1131
  h.getAllObjectsByOrder().forEach((m) => {
1132
- m.classType === he.IMAGE && d.some((f) => m.oKey.includes(f.drawingId)) && h.removeObject(m);
1132
+ m.classType === je.IMAGE && a.some((p) => m.oKey.includes(p.drawingId)) && h.removeObject(m);
1133
1133
  });
1134
1134
  }
1135
1135
  });
@@ -1137,9 +1137,9 @@ let He = class extends q {
1137
1137
  );
1138
1138
  }
1139
1139
  _initDrawingEditable() {
1140
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET);
1140
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET);
1141
1141
  this.disposeWithMe(
1142
- Te([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1142
+ ft([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1143
1143
  if (!e) {
1144
1144
  this._drawingManagerService.setDrawingEditable(!1);
1145
1145
  return;
@@ -1150,15 +1150,15 @@ let He = class extends q {
1150
1150
  return;
1151
1151
  }
1152
1152
  const r = e.getUnitId(), s = t.getSheetId();
1153
- if (this._permissionService.composePermission([new ht(r).id, new $e(r, s).id]).every((a) => a.value))
1153
+ if (this._permissionService.composePermission([new Qt(r).id, new Dt(r, s).id]).every((c) => c.value))
1154
1154
  this._drawingManagerService.setDrawingEditable(!0);
1155
1155
  else {
1156
1156
  this._drawingManagerService.setDrawingEditable(!1);
1157
- const a = e.getUnitId(), l = t.getSheetId(), g = this._drawingManagerService.getDrawingData(a, l), d = Object.values(g), c = this._renderManagerService.getRenderById(a), h = c == null ? void 0 : c.scene;
1157
+ const c = e.getUnitId(), d = t.getSheetId(), g = this._drawingManagerService.getDrawingData(c, d), a = Object.values(g), l = this._renderManagerService.getRenderById(c), h = l == null ? void 0 : l.scene;
1158
1158
  if (h == null)
1159
1159
  return;
1160
1160
  h.getAllObjectsByOrder().forEach((m) => {
1161
- m.classType === he.IMAGE && d.some((f) => m.oKey.includes(f.drawingId)) && h.detachTransformerFrom(m);
1161
+ m.classType === je.IMAGE && a.some((p) => m.oKey.includes(p.drawingId)) && h.detachTransformerFrom(m);
1162
1162
  });
1163
1163
  }
1164
1164
  });
@@ -1166,33 +1166,33 @@ let He = class extends q {
1166
1166
  );
1167
1167
  }
1168
1168
  _initViewPermissionChange() {
1169
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET);
1169
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET);
1170
1170
  this.disposeWithMe(
1171
- Te([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1171
+ ft([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1172
1172
  e && e.activeSheet$.subscribe((t) => {
1173
- var c;
1173
+ var l;
1174
1174
  if (!t)
1175
1175
  return;
1176
1176
  const r = e.getUnitId(), s = t.getSheetId();
1177
1177
  let o = !0;
1178
- const a = this._renderManagerService.getRenderById(r), l = a == null ? void 0 : a.scene;
1179
- if (l == null)
1178
+ const c = this._renderManagerService.getRenderById(r), d = c == null ? void 0 : c.scene;
1179
+ if (d == null)
1180
1180
  return;
1181
- const g = l.getTransformerByCreate(), d = this._permissionService.composePermission$([new xt(r).id, new ot(r, s).id]).pipe(Be((h) => h.every((u) => u.value)));
1182
- d == null || d.pipe(
1183
- ie((h) => h !== o),
1184
- Pe()
1181
+ const g = d.getTransformerByCreate(), a = this._permissionService.composePermission$([new Mn(r).id, new zt(r, s).id]).pipe(He((h) => h.every((u) => u.value)));
1182
+ a == null || a.pipe(
1183
+ Se((h) => h !== o),
1184
+ pt()
1185
1185
  ).subscribe({
1186
1186
  next: (h) => {
1187
1187
  o = h, this._drawingManagerService.setDrawingVisible(h);
1188
- const u = l.getAllObjectsByOrder(), m = this._drawingManagerService.getDrawingData(r, s), f = Object.values(m);
1189
- h ? this._drawingManagerService.addNotification(f) : (u.forEach((p) => {
1190
- p.classType === he.IMAGE && f.some((v) => p.oKey.includes(v.drawingId)) && l.removeObject(p);
1188
+ const u = d.getAllObjectsByOrder(), m = this._drawingManagerService.getDrawingData(r, s), p = Object.values(m);
1189
+ h ? this._drawingManagerService.addNotification(p) : (u.forEach((f) => {
1190
+ f.classType === je.IMAGE && p.some((w) => f.oKey.includes(w.drawingId)) && d.removeObject(f);
1191
1191
  }), g.clearSelectedObjects());
1192
1192
  }
1193
- }), (c = this._permissionService.getPermissionPoint$(new ot(r, s).id)) == null || c.pipe(
1194
- ie((h) => h.value !== o),
1195
- Pe()
1193
+ }), (l = this._permissionService.getPermissionPoint$(new zt(r, s).id)) == null || l.pipe(
1194
+ Se((h) => h.value !== o),
1195
+ pt()
1196
1196
  ).subscribe({
1197
1197
  complete: () => {
1198
1198
  o = !0, this._drawingManagerService.setDrawingVisible(!0);
@@ -1205,43 +1205,43 @@ let He = class extends q {
1205
1205
  );
1206
1206
  }
1207
1207
  _initEditPermissionChange() {
1208
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET);
1208
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET);
1209
1209
  this.disposeWithMe(
1210
- Te([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1210
+ ft([i, this._userManagerService.currentUser$]).subscribe(([e, n]) => {
1211
1211
  e && e.activeSheet$.subscribe((t) => {
1212
- var c;
1212
+ var l;
1213
1213
  if (!t)
1214
1214
  return;
1215
1215
  const r = e.getUnitId(), s = t.getSheetId();
1216
1216
  let o = !0;
1217
- const a = this._renderManagerService.getRenderById(r), l = a == null ? void 0 : a.scene;
1218
- if (l == null)
1217
+ const c = this._renderManagerService.getRenderById(r), d = c == null ? void 0 : c.scene;
1218
+ if (d == null)
1219
1219
  return;
1220
- const g = l.getTransformerByCreate(), d = this._permissionService.composePermission$([new ht(r).id, new $e(r, s).id]).pipe(Be((h) => h.every((u) => u.value)));
1221
- d == null || d.pipe(
1222
- ie((h) => h !== o),
1223
- Pe()
1220
+ const g = d.getTransformerByCreate(), a = this._permissionService.composePermission$([new Qt(r).id, new Dt(r, s).id]).pipe(He((h) => h.every((u) => u.value)));
1221
+ a == null || a.pipe(
1222
+ Se((h) => h !== o),
1223
+ pt()
1224
1224
  ).subscribe({
1225
1225
  next: (h) => {
1226
1226
  o = h, this._drawingManagerService.setDrawingEditable(h);
1227
- const u = l.getAllObjectsByOrder(), m = this._drawingManagerService.getDrawingData(r, s), f = Object.values(m);
1228
- h ? (u.forEach((p) => {
1229
- p.classType === he.IMAGE && f.some((v) => p.oKey.includes(v.drawingId)) && l.attachTransformerTo(p);
1230
- }), this._drawingManagerService.addNotification(f)) : (u.forEach((p) => {
1231
- p.classType === he.IMAGE && f.some((v) => p.oKey.includes(v.drawingId)) && l.detachTransformerFrom(p);
1227
+ const u = d.getAllObjectsByOrder(), m = this._drawingManagerService.getDrawingData(r, s), p = Object.values(m);
1228
+ h ? (u.forEach((f) => {
1229
+ f.classType === je.IMAGE && p.some((w) => f.oKey.includes(w.drawingId)) && d.attachTransformerTo(f);
1230
+ }), this._drawingManagerService.addNotification(p)) : (u.forEach((f) => {
1231
+ f.classType === je.IMAGE && p.some((w) => f.oKey.includes(w.drawingId)) && d.detachTransformerFrom(f);
1232
1232
  }), g.clearSelectedObjects());
1233
1233
  }
1234
- }), (c = this._permissionService.getPermissionPoint$(new $e(r, s).id)) == null || c.pipe(
1235
- ie((h) => h.value !== o),
1236
- Pe()
1234
+ }), (l = this._permissionService.getPermissionPoint$(new Dt(r, s).id)) == null || l.pipe(
1235
+ Se((h) => h.value !== o),
1236
+ pt()
1237
1237
  ).subscribe({
1238
1238
  complete: () => {
1239
1239
  o = !0;
1240
- const h = e.getUnitId(), u = t.getSheetId(), m = this._drawingManagerService.getDrawingData(h, u), f = Object.values(m), p = this._renderManagerService.getRenderById(h), v = p == null ? void 0 : p.scene;
1241
- if (v == null)
1240
+ const h = e.getUnitId(), u = t.getSheetId(), m = this._drawingManagerService.getDrawingData(h, u), p = Object.values(m), f = this._renderManagerService.getRenderById(h), w = f == null ? void 0 : f.scene;
1241
+ if (w == null)
1242
1242
  return;
1243
- this._drawingManagerService.setDrawingEditable(!0), v.getAllObjectsByOrder().forEach((S) => {
1244
- S.classType === he.IMAGE && f.some((M) => S.oKey.includes(M.drawingId)) && v.detachTransformerFrom(S);
1243
+ this._drawingManagerService.setDrawingEditable(!0), w.getAllObjectsByOrder().forEach((I) => {
1244
+ I.classType === je.IMAGE && p.some((D) => I.oKey.includes(D.drawingId)) && w.detachTransformerFrom(I);
1245
1245
  });
1246
1246
  }
1247
1247
  });
@@ -1250,19 +1250,19 @@ let He = class extends q {
1250
1250
  );
1251
1251
  }
1252
1252
  };
1253
- He = Ki([
1254
- we(0, Q),
1255
- we(1, X),
1256
- we(2, Zn),
1257
- we(3, pe),
1258
- we(4, U(qn))
1259
- ], He);
1260
- var Ji = Object.defineProperty, qi = Object.getOwnPropertyDescriptor, Zi = (i, e, n, t) => {
1261
- for (var r = t > 1 ? void 0 : t ? qi(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1253
+ Pt = js([
1254
+ Xe(0, de),
1255
+ Xe(1, Q),
1256
+ Xe(2, Yr),
1257
+ Xe(3, ke),
1258
+ Xe(4, N(Fr))
1259
+ ], Pt);
1260
+ var Ws = Object.defineProperty, xs = Object.getOwnPropertyDescriptor, Bs = (i, e, n, t) => {
1261
+ for (var r = t > 1 ? void 0 : t ? xs(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1262
1262
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
1263
- return t && r && Ji(e, n, r), r;
1264
- }, je = (i, e) => (n, t) => e(n, t, i);
1265
- let Ye = class extends q {
1263
+ return t && r && Ws(e, n, r), r;
1264
+ }, St = (i, e) => (n, t) => e(n, t, i);
1265
+ let Ut = class extends ae {
1266
1266
  constructor(i, e, n, t) {
1267
1267
  super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = e, this._drawingManagerService = n, this._renderManagerService = t, this._initPrinting();
1268
1268
  }
@@ -1272,9 +1272,9 @@ let Ye = class extends q {
1272
1272
  this._sheetPrintInterceptorService.interceptor.getInterceptPoints().PRINTING_COMPONENT_COLLECT,
1273
1273
  {
1274
1274
  handler: (i, e, n) => {
1275
- const { unitId: t, scene: r, subUnitId: s } = e, o = this._drawingManagerService.getDrawingDataForUnit(t), a = o == null ? void 0 : o[s];
1276
- return a && a.order.forEach((l) => {
1277
- this._drawingRenderService.renderDrawing(a.data[l], r);
1275
+ const { unitId: t, scene: r, subUnitId: s } = e, o = this._drawingManagerService.getDrawingDataForUnit(t), c = o == null ? void 0 : o[s];
1276
+ return c && c.order.forEach((d) => {
1277
+ this._drawingRenderService.renderDrawing(c.data[d], r);
1278
1278
  }), n();
1279
1279
  }
1280
1280
  }
@@ -1287,123 +1287,123 @@ let Ye = class extends q {
1287
1287
  const { unitId: t, subUnitId: r } = e, s = this._renderManagerService.getRenderById(t);
1288
1288
  if (!s)
1289
1289
  return n(i);
1290
- const o = s.with(Z).getWorksheetSkeleton(r);
1290
+ const o = s.with(H).getWorksheetSkeleton(r);
1291
1291
  if (!o)
1292
1292
  return n(i);
1293
- const a = this._drawingManagerService.getDrawingDataForUnit(t), l = a == null ? void 0 : a[e.subUnitId];
1294
- if (!l)
1293
+ const c = this._drawingManagerService.getDrawingDataForUnit(t), d = c == null ? void 0 : c[e.subUnitId];
1294
+ if (!d)
1295
1295
  return n(i);
1296
- const { scaleX: g, scaleY: d } = s.scene, c = 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);
1296
+ const { scaleX: g, scaleY: a } = s.scene, l = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, h = d.order.map((u) => d.data[u]).filter((u) => u.drawingType !== L.DRAWING_DOM);
1297
1297
  return h.length ? (h.forEach((u) => {
1298
- if (!u.groupId && u.transform && ve.isDefine(u.transform.left) && ve.isDefine(u.transform.top) && ve.isDefine(u.transform.width) && ve.isDefine(u.transform.height)) {
1299
- const m = o.skeleton.getCellIndexByOffset(u.transform.left, u.transform.top, g, d, { x: 0, y: 0 }), f = o.skeleton.getCellIndexByOffset(u.transform.left + u.transform.width, u.transform.top + u.transform.height, g, d, { x: 0, y: 0 });
1300
- 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);
1298
+ if (!u.groupId && u.transform && ye.isDefine(u.transform.left) && ye.isDefine(u.transform.top) && ye.isDefine(u.transform.width) && ye.isDefine(u.transform.height)) {
1299
+ const m = o.skeleton.getCellIndexByOffset(u.transform.left, u.transform.top, g, a, { x: 0, y: 0 }), p = o.skeleton.getCellIndexByOffset(u.transform.left + u.transform.width, u.transform.top + u.transform.height, g, a, { x: 0, y: 0 });
1300
+ m.column < l.startColumn && (l.startColumn = m.column), m.row < l.startRow && (l.startRow = m.row), l.endRow < p.row && (l.endRow = p.row), l.endColumn < p.column && (l.endColumn = p.column);
1301
1301
  }
1302
- }), n(c)) : n(i);
1302
+ }), n(l)) : n(i);
1303
1303
  }
1304
1304
  }
1305
1305
  )
1306
1306
  );
1307
1307
  }
1308
1308
  };
1309
- Ye = Zi([
1310
- je(0, U(Nr)),
1311
- je(1, U(Ht)),
1312
- je(2, Q),
1313
- je(3, X)
1314
- ], Ye);
1315
- var Qi = Object.defineProperty, es = Object.getOwnPropertyDescriptor, ts = (i, e, n, t) => {
1316
- for (var r = t > 1 ? void 0 : t ? es(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1309
+ Ut = Bs([
1310
+ St(0, N(Ii)),
1311
+ St(1, N(Nn)),
1312
+ St(2, de),
1313
+ St(3, Q)
1314
+ ], Ut);
1315
+ var $s = Object.defineProperty, ks = Object.getOwnPropertyDescriptor, Ls = (i, e, n, t) => {
1316
+ for (var r = t > 1 ? void 0 : t ? ks(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1317
1317
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
1318
- return t && r && Qi(e, n, r), r;
1319
- }, te = (i, e) => (n, t) => e(n, t, i);
1320
- const ns = [
1321
- Zt.id,
1322
- Qt.id,
1318
+ return t && r && $s(e, n, r), r;
1319
+ }, we = (i, e) => (n, t) => e(n, t, i);
1320
+ const Fs = [
1321
+ Fn.id,
1322
+ Yn.id,
1323
+ Gn.id,
1324
+ Xn.id,
1325
+ Vn.id,
1326
+ Hn.id,
1327
+ zn.id,
1328
+ Kn.id,
1323
1329
  en.id,
1324
1330
  tn.id,
1325
- nn.id,
1326
- rn.id,
1327
- sn.id,
1328
- on.id,
1329
- gt.id,
1330
- mt.id,
1331
- an.id,
1332
- cn.id,
1333
- dn.id,
1334
- ln.id,
1335
- un.id,
1336
- hn.id,
1337
- gn.id,
1338
- mn.id,
1339
- fn.id
1340
- ], rs = [
1341
- ri.id,
1342
- ii.id,
1343
- si.id,
1344
- oi.id,
1345
- Jt.id,
1346
- qt.id
1331
+ Jn.id,
1332
+ Zn.id,
1333
+ qn.id,
1334
+ Qn.id,
1335
+ er.id,
1336
+ tr.id,
1337
+ nr.id,
1338
+ rr.id,
1339
+ ir.id
1340
+ ], Ys = [
1341
+ Fi.id,
1342
+ Yi.id,
1343
+ Gi.id,
1344
+ Xi.id,
1345
+ $n.id,
1346
+ kn.id
1347
1347
  ];
1348
- let wt = class extends q {
1349
- constructor(i, e, n, t, r, s, o, a, l) {
1350
- super(), this._context = i, this._renderManagerService = e, this._commandService = n, this._selectionRenderService = t, this._skeletonManagerService = r, this._sheetInterceptorService = s, this._sheetDrawingService = o, this._drawingManagerService = a, this._univerInstanceService = l, this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
1348
+ let on = class extends ae {
1349
+ constructor(i, e, n, t, r, s, o, c, d) {
1350
+ super(), this._context = i, this._renderManagerService = e, this._commandService = n, this._selectionRenderService = t, this._skeletonManagerService = r, this._sheetInterceptorService = s, this._sheetDrawingService = o, this._drawingManagerService = c, this._univerInstanceService = d, this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
1351
1351
  }
1352
1352
  _sheetInterceptorListener() {
1353
1353
  this.disposeWithMe(
1354
1354
  this._sheetInterceptorService.interceptCommand({
1355
1355
  getMutations: (i) => {
1356
- if (!ns.includes(i.id))
1356
+ if (!Fs.includes(i.id))
1357
1357
  return { redos: [], undos: [] };
1358
1358
  if (i.params == null)
1359
1359
  return { redos: [], undos: [] };
1360
1360
  const e = i.id;
1361
- if (e === Zt.id)
1361
+ if (e === Fn.id)
1362
1362
  return this._moveRowInterceptor(i.params, "insert");
1363
- if ([gn.id, mn.id, fn.id].includes(e))
1363
+ if ([nr.id, rr.id, ir.id].includes(e))
1364
1364
  return this._moveRangeInterceptor(i.params);
1365
- if (e === Qt.id)
1365
+ if (e === Yn.id)
1366
1366
  return this._moveColInterceptor(i.params, "insert");
1367
- if (e === en.id)
1367
+ if (e === Gn.id)
1368
1368
  return this._moveRowInterceptor(i.params, "remove");
1369
- if (e === tn.id)
1369
+ if (e === Xn.id)
1370
1370
  return this._moveColInterceptor(i.params, "remove");
1371
- if (e === nn.id) {
1371
+ if (e === Vn.id) {
1372
1372
  const { range: n } = i.params;
1373
1373
  return this._getRangeMoveUndo(
1374
1374
  n,
1375
1375
  0
1376
1376
  /* deleteLeft */
1377
1377
  );
1378
- } else if (e === rn.id) {
1378
+ } else if (e === Hn.id) {
1379
1379
  const { range: n } = i.params;
1380
1380
  return this._getRangeMoveUndo(
1381
1381
  n,
1382
1382
  1
1383
1383
  /* deleteUp */
1384
1384
  );
1385
- } else if (e === sn.id) {
1385
+ } else if (e === zn.id) {
1386
1386
  const { range: n } = i.params;
1387
1387
  return this._getRangeMoveUndo(
1388
1388
  n,
1389
1389
  2
1390
1390
  /* insertDown */
1391
1391
  );
1392
- } else if (e === on.id) {
1392
+ } else if (e === Kn.id) {
1393
1393
  const { range: n } = i.params;
1394
1394
  return this._getRangeMoveUndo(
1395
1395
  n,
1396
1396
  3
1397
1397
  /* insertRight */
1398
1398
  );
1399
- } else if (e === dn.id || e === ln.id) {
1399
+ } else if (e === qn.id || e === Qn.id) {
1400
1400
  const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
1401
1401
  return this._getDrawingUndoForRowVisible(t, r, s);
1402
- } else if (e === un.id || e === hn.id) {
1402
+ } else if (e === er.id || e === tr.id) {
1403
1403
  const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n;
1404
1404
  return this._getDrawingUndoForColVisible(t, r, s);
1405
- } else if (e === gt.id || e === mt.id || e === an.id || e === cn.id) {
1406
- const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n, o = e === gt.id || e === mt.id;
1405
+ } else if (e === en.id || e === tn.id || e === Jn.id || e === Zn.id) {
1406
+ const n = i.params, { unitId: t, subUnitId: r, ranges: s } = n, o = e === en.id || e === tn.id;
1407
1407
  return this._getDrawingUndoForRowAndColSize(t, r, s, o);
1408
1408
  }
1409
1409
  return { redos: [], undos: [] };
@@ -1412,66 +1412,66 @@ let wt = class extends q {
1412
1412
  );
1413
1413
  }
1414
1414
  _getRangeMoveUndo(i, e) {
1415
- const n = H(this._univerInstanceService);
1415
+ const n = Y(this._univerInstanceService);
1416
1416
  if (n == null)
1417
1417
  return { redos: [], undos: [] };
1418
- const t = n.unitId, r = n.subUnitId, s = [], o = [], a = this._sheetDrawingService.getDrawingData(t, r), l = [], g = [];
1419
- if (Object.keys(a).forEach((d) => {
1420
- const c = a[d], { updateDrawings: h, deleteDrawings: u } = this._getUpdateOrDeleteDrawings(i, e, c);
1421
- l.push(...h), g.push(...u);
1422
- }), l.length === 0 && g.length === 0)
1418
+ const t = n.unitId, r = n.subUnitId, s = [], o = [], c = this._sheetDrawingService.getDrawingData(t, r), d = [], g = [];
1419
+ if (Object.keys(c).forEach((a) => {
1420
+ const l = c[a], { updateDrawings: h, deleteDrawings: u } = this._getUpdateOrDeleteDrawings(i, e, l);
1421
+ d.push(...h), g.push(...u);
1422
+ }), d.length === 0 && g.length === 0)
1423
1423
  return { redos: [], undos: [] };
1424
- if (l.length > 0) {
1425
- const d = this._sheetDrawingService.getBatchUpdateOp(l), { undo: c, redo: h, objects: u } = d;
1426
- s.push({ id: O.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type: E.UPDATE } }), o.push({ id: O.id, params: { unitId: t, subUnitId: r, op: c, objects: u, type: E.UPDATE } });
1424
+ if (d.length > 0) {
1425
+ const a = this._sheetDrawingService.getBatchUpdateOp(d), { undo: l, redo: h, objects: u } = a;
1426
+ s.push({ id: P.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type: U.UPDATE } }), o.push({ id: P.id, params: { unitId: t, subUnitId: r, op: l, objects: u, type: U.UPDATE } });
1427
1427
  }
1428
1428
  if (g.length > 0) {
1429
- const d = this._sheetDrawingService.getBatchRemoveOp(g), c = d.undo, h = d.redo, u = d.objects;
1430
- s.push({ id: O.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type: E.REMOVE } }), o.push({ id: O.id, params: { unitId: t, subUnitId: r, op: c, objects: u, type: E.INSERT } });
1429
+ const a = this._sheetDrawingService.getBatchRemoveOp(g), l = a.undo, h = a.redo, u = a.objects;
1430
+ s.push({ id: P.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type: U.REMOVE } }), o.push({ id: P.id, params: { unitId: t, subUnitId: r, op: l, objects: u, type: U.INSERT } });
1431
1431
  }
1432
- return s.push({ id: W.id, params: [t] }), o.push({ id: W.id, params: [t] }), {
1432
+ return s.push({ id: k.id, params: [t] }), o.push({ id: k.id, params: [t] }), {
1433
1433
  redos: s,
1434
1434
  undos: o
1435
1435
  };
1436
1436
  }
1437
1437
  _getUpdateOrDeleteDrawings(i, e, n) {
1438
- const t = [], r = [], { sheetTransform: s, anchorType: o = y.Position, transform: a, unitId: l, subUnitId: g, drawingId: d } = n, { from: c, to: h } = s, { row: u, column: m } = c, { row: f, column: p } = h;
1439
- if (s == null || a == null)
1438
+ const t = [], r = [], { sheetTransform: s, anchorType: o = O.Position, transform: c, unitId: d, subUnitId: g, drawingId: a } = n, { from: l, to: h } = s, { row: u, column: m } = l, { row: p, column: f } = h;
1439
+ if (s == null || c == null)
1440
1440
  return {
1441
1441
  updateDrawings: t,
1442
1442
  deleteDrawings: r
1443
1443
  };
1444
- const { startRow: v, endRow: I, startColumn: S, endColumn: M } = i;
1445
- let w = null, C = null;
1446
- if (e === 0 && u >= v && f <= I)
1447
- if (m >= S && p <= M)
1448
- r.push({ unitId: l, subUnitId: g, drawingId: d });
1444
+ const { startRow: w, endRow: S, startColumn: I, endColumn: D } = i;
1445
+ let v = null, R = null;
1446
+ if (e === 0 && u >= w && p <= S)
1447
+ if (m >= I && f <= D)
1448
+ r.push({ unitId: d, subUnitId: g, drawingId: a });
1449
1449
  else {
1450
- const _ = this._shrinkCol(s, a, S, M, o);
1451
- w = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
1450
+ const _ = this._shrinkCol(s, c, I, D, o);
1451
+ v = _ == null ? void 0 : _.newSheetTransform, R = _ == null ? void 0 : _.newTransform;
1452
1452
  }
1453
- else if (e === 1 && m >= S && p <= M)
1454
- if (u >= v && f <= I)
1455
- r.push({ unitId: l, subUnitId: g, drawingId: d });
1453
+ else if (e === 1 && m >= I && f <= D)
1454
+ if (u >= w && p <= S)
1455
+ r.push({ unitId: d, subUnitId: g, drawingId: a });
1456
1456
  else {
1457
- const _ = this._shrinkRow(s, a, v, I, o);
1458
- w = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
1457
+ const _ = this._shrinkRow(s, c, w, S, o);
1458
+ v = _ == null ? void 0 : _.newSheetTransform, R = _ == null ? void 0 : _.newTransform;
1459
1459
  }
1460
1460
  else if (e === 2) {
1461
- const _ = this._expandRow(s, a, v, I, o);
1462
- w = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
1461
+ const _ = this._expandRow(s, c, w, S, o);
1462
+ v = _ == null ? void 0 : _.newSheetTransform, R = _ == null ? void 0 : _.newTransform;
1463
1463
  } else if (e === 3) {
1464
- const _ = this._expandCol(s, a, S, M, o);
1465
- w = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
1464
+ const _ = this._expandCol(s, c, I, D, o);
1465
+ v = _ == null ? void 0 : _.newSheetTransform, R = _ == null ? void 0 : _.newTransform;
1466
1466
  }
1467
- if (w != null && C != null) {
1468
- const _ = L(w, this._selectionRenderService, this._skeletonManagerService);
1469
- t.push({ ...n, sheetTransform: w, transform: _ });
1467
+ if (v != null && R != null) {
1468
+ const _ = V(v, this._selectionRenderService, this._skeletonManagerService);
1469
+ t.push({ ...n, sheetTransform: v, transform: _ });
1470
1470
  }
1471
1471
  return { updateDrawings: t, deleteDrawings: r };
1472
1472
  }
1473
1473
  _remainDrawingSize(i, e, n) {
1474
- const t = j({ ...i }, this._selectionRenderService);
1474
+ const t = $({ ...i }, this._selectionRenderService);
1475
1475
  t != null && e.push({
1476
1476
  ...n,
1477
1477
  sheetTransform: t
@@ -1480,202 +1480,202 @@ let wt = class extends q {
1480
1480
  // eslint-disable-next-line max-lines-per-function
1481
1481
  _getDrawingUndoForColVisible(i, e, n) {
1482
1482
  const t = this._drawingManagerService.getDrawingData(i, e), r = [], s = [];
1483
- if (Object.keys(t).forEach((d) => {
1484
- const c = t[d], { sheetTransform: h, transform: u, anchorType: m = y.Position } = c;
1485
- if (m === y.None)
1486
- this._remainDrawingSize(u, r, c);
1483
+ if (Object.keys(t).forEach((a) => {
1484
+ const l = t[a], { sheetTransform: h, transform: u, anchorType: m = O.Position } = l;
1485
+ if (m === O.None)
1486
+ this._remainDrawingSize(u, r, l);
1487
1487
  else {
1488
- const { from: f, to: p } = h, { row: v, column: I } = f, { row: S, column: M } = p;
1489
- for (let w = 0; w < n.length; w++) {
1490
- const C = n[w], { startRow: _, endRow: T, startColumn: D, endColumn: N } = C;
1491
- if (M < D)
1488
+ const { from: p, to: f } = h, { row: w, column: S } = p, { row: I, column: D } = f;
1489
+ for (let v = 0; v < n.length; v++) {
1490
+ const R = n[v], { startRow: _, endRow: E, startColumn: M, endColumn: A } = R;
1491
+ if (D < M)
1492
1492
  continue;
1493
- if (m === y.Position) {
1494
- let R = null, P = null;
1495
- if (I >= D && I <= N) {
1496
- const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: I, endColumn: N, startRow: f.row, endRow: p.row });
1497
- if (x == null)
1493
+ if (m === O.Position) {
1494
+ let C = null, y = null;
1495
+ if (S >= M && S <= A) {
1496
+ const W = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: A, startRow: p.row, endRow: f.row });
1497
+ if (W == null)
1498
1498
  return;
1499
- P = { ...u, left: x.startX };
1499
+ y = { ...u, left: W.startX };
1500
1500
  }
1501
- if (P != null && (R = j(P, this._selectionRenderService), R != null && P != null)) {
1502
- r.push({ ...c, sheetTransform: R, transform: P });
1501
+ if (y != null && (C = $(y, this._selectionRenderService), C != null && y != null)) {
1502
+ r.push({ ...l, sheetTransform: C, transform: y });
1503
1503
  break;
1504
1504
  }
1505
- this._remainDrawingSize(u, r, c);
1505
+ this._remainDrawingSize(u, r, l);
1506
1506
  continue;
1507
1507
  }
1508
- if (I >= D && M <= N)
1508
+ if (S >= M && D <= A)
1509
1509
  continue;
1510
- let A = null, b = null;
1511
- if (I >= D && I <= N) {
1512
- const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: I, endColumn: N, startRow: f.row, endRow: p.row });
1513
- if (R == null)
1510
+ let T = null, b = null;
1511
+ if (S >= M && S <= A) {
1512
+ const C = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: A, startRow: p.row, endRow: f.row });
1513
+ if (C == null)
1514
1514
  return;
1515
1515
  b = {
1516
1516
  ...u,
1517
- left: (R == null ? void 0 : R.startX) || 0,
1518
- width: ((u == null ? void 0 : u.width) || 0) - R.endX + R.startX
1517
+ left: (C == null ? void 0 : C.startX) || 0,
1518
+ width: ((u == null ? void 0 : u.width) || 0) - C.endX + C.startX
1519
1519
  };
1520
- } else if (M >= D && M <= N) {
1521
- const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: M, startRow: f.row, endRow: p.row });
1522
- if (R == null)
1520
+ } else if (D >= M && D <= A) {
1521
+ const C = this._skeletonManagerService.attachRangeWithCoord({ startColumn: M, endColumn: D, startRow: p.row, endRow: f.row });
1522
+ if (C == null)
1523
1523
  return;
1524
1524
  b = {
1525
1525
  ...u,
1526
- left: R.startX - ((u == null ? void 0 : u.width) || 0)
1526
+ left: C.startX - ((u == null ? void 0 : u.width) || 0)
1527
1527
  };
1528
1528
  } else {
1529
- const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: N, startRow: f.row, endRow: p.row });
1530
- if (R == null)
1529
+ const C = this._skeletonManagerService.attachRangeWithCoord({ startColumn: M, endColumn: A, startRow: p.row, endRow: f.row });
1530
+ if (C == null)
1531
1531
  return;
1532
1532
  if (b = {
1533
1533
  ...u,
1534
- width: ((u == null ? void 0 : u.width) || 0) - R.endX + R.startX
1535
- }, A = j(b, this._selectionRenderService), A != null && b != null) {
1536
- s.push({ ...c, sheetTransform: A, transform: b });
1534
+ width: ((u == null ? void 0 : u.width) || 0) - C.endX + C.startX
1535
+ }, T = $(b, this._selectionRenderService), T != null && b != null) {
1536
+ s.push({ ...l, sheetTransform: T, transform: b });
1537
1537
  break;
1538
1538
  }
1539
1539
  }
1540
- if (b != null && (A = j(b, this._selectionRenderService)), b != null && A != null) {
1541
- r.push({ ...c, sheetTransform: A, transform: b });
1540
+ if (b != null && (T = $(b, this._selectionRenderService)), b != null && T != null) {
1541
+ r.push({ ...l, sheetTransform: T, transform: b });
1542
1542
  break;
1543
1543
  } else
1544
- this._remainDrawingSize(u, r, c);
1544
+ this._remainDrawingSize(u, r, l);
1545
1545
  }
1546
1546
  }
1547
1547
  }), r.length === 0 && s.length === 0)
1548
1548
  return { redos: [], undos: [] };
1549
- const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, e, r), l = [], g = [];
1549
+ const { redos: o, undos: c } = this._createUndoAndRedoMutation(i, e, r), d = [], g = [];
1550
1550
  if (s.length > 0) {
1551
- const { redos: d, undos: c } = this._createUndoAndRedoMutation(i, e, s);
1552
- l.push(...d), g.push(...c);
1551
+ const { redos: a, undos: l } = this._createUndoAndRedoMutation(i, e, s);
1552
+ d.push(...a), g.push(...l);
1553
1553
  }
1554
1554
  return {
1555
1555
  redos: o,
1556
- undos: a,
1557
- preRedos: l,
1556
+ undos: c,
1557
+ preRedos: d,
1558
1558
  preUndos: g
1559
1559
  };
1560
1560
  }
1561
1561
  _createUndoAndRedoMutation(i, e, n) {
1562
- const t = this._sheetDrawingService.getBatchUpdateOp(n), { undo: r, redo: s, objects: o } = t, a = [
1563
- { id: O.id, params: { unitId: i, subUnitId: e, op: s, objects: o, type: E.UPDATE } },
1564
- { id: W.id, params: [i] }
1565
- ], l = [
1566
- { id: O.id, params: { unitId: i, subUnitId: e, op: r, objects: o, type: E.UPDATE } },
1567
- { id: W.id, params: [i] }
1562
+ const t = this._sheetDrawingService.getBatchUpdateOp(n), { undo: r, redo: s, objects: o } = t, c = [
1563
+ { id: P.id, params: { unitId: i, subUnitId: e, op: s, objects: o, type: U.UPDATE } },
1564
+ { id: k.id, params: [i] }
1565
+ ], d = [
1566
+ { id: P.id, params: { unitId: i, subUnitId: e, op: r, objects: o, type: U.UPDATE } },
1567
+ { id: k.id, params: [i] }
1568
1568
  ];
1569
1569
  return {
1570
- redos: a,
1571
- undos: l
1570
+ redos: c,
1571
+ undos: d
1572
1572
  };
1573
1573
  }
1574
1574
  // eslint-disable-next-line max-lines-per-function
1575
1575
  _getDrawingUndoForRowVisible(i, e, n) {
1576
1576
  const t = this._drawingManagerService.getDrawingData(i, e), r = [], s = [];
1577
- if (Object.keys(t).forEach((d) => {
1578
- const c = t[d], { sheetTransform: h, transform: u, anchorType: m = y.Position } = c;
1579
- if (m === y.None)
1580
- this._remainDrawingSize(u, r, c);
1577
+ if (Object.keys(t).forEach((a) => {
1578
+ const l = t[a], { sheetTransform: h, transform: u, anchorType: m = O.Position } = l;
1579
+ if (m === O.None)
1580
+ this._remainDrawingSize(u, r, l);
1581
1581
  else {
1582
- const { from: f, to: p } = h, { row: v, column: I } = f, { row: S, column: M } = p;
1583
- for (let w = 0; w < n.length; w++) {
1584
- const C = n[w], { startRow: _, endRow: T, startColumn: D, endColumn: N } = C;
1585
- if (S < _)
1582
+ const { from: p, to: f } = h, { row: w, column: S } = p, { row: I, column: D } = f;
1583
+ for (let v = 0; v < n.length; v++) {
1584
+ const R = n[v], { startRow: _, endRow: E, startColumn: M, endColumn: A } = R;
1585
+ if (I < _)
1586
1586
  continue;
1587
- if (m === y.Position) {
1588
- let R = null, P = null;
1589
- if (v >= _ && v <= T) {
1590
- const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: v, endRow: T });
1591
- if (x == null)
1587
+ if (m === O.Position) {
1588
+ let C = null, y = null;
1589
+ if (w >= _ && w <= E) {
1590
+ const W = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: w, endRow: E });
1591
+ if (W == null)
1592
1592
  return;
1593
- P = { ...u, top: x.startY };
1593
+ y = { ...u, top: W.startY };
1594
1594
  }
1595
- if (P != null && (R = j(P, this._selectionRenderService), R != null && P != null)) {
1596
- r.push({ ...c, sheetTransform: R, transform: P });
1595
+ if (y != null && (C = $(y, this._selectionRenderService), C != null && y != null)) {
1596
+ r.push({ ...l, sheetTransform: C, transform: y });
1597
1597
  break;
1598
1598
  }
1599
- this._remainDrawingSize(u, r, c);
1599
+ this._remainDrawingSize(u, r, l);
1600
1600
  continue;
1601
1601
  }
1602
- if (v >= _ && S <= T)
1602
+ if (w >= _ && I <= E)
1603
1603
  continue;
1604
- let A = null, b = null;
1605
- if (v >= _ && v <= T) {
1606
- const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: v, endRow: T });
1607
- if (R == null)
1604
+ let T = null, b = null;
1605
+ if (w >= _ && w <= E) {
1606
+ const C = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: w, endRow: E });
1607
+ if (C == null)
1608
1608
  return;
1609
1609
  b = {
1610
1610
  ...u,
1611
- top: (R == null ? void 0 : R.startY) || 0,
1612
- height: ((u == null ? void 0 : u.height) || 0) - R.endY + R.startY
1611
+ top: (C == null ? void 0 : C.startY) || 0,
1612
+ height: ((u == null ? void 0 : u.height) || 0) - C.endY + C.startY
1613
1613
  };
1614
- } else if (S >= _ && S <= T) {
1615
- const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: _, endRow: S });
1616
- if (R == null)
1614
+ } else if (I >= _ && I <= E) {
1615
+ const C = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: _, endRow: I });
1616
+ if (C == null)
1617
1617
  return;
1618
1618
  b = {
1619
1619
  ...u,
1620
- top: R.startY - ((u == null ? void 0 : u.height) || 0)
1620
+ top: C.startY - ((u == null ? void 0 : u.height) || 0)
1621
1621
  };
1622
1622
  } else {
1623
- const R = this._skeletonManagerService.attachRangeWithCoord({ startColumn: f.column, endColumn: p.column, startRow: _, endRow: T });
1624
- if (R == null)
1623
+ const C = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: _, endRow: E });
1624
+ if (C == null)
1625
1625
  return;
1626
1626
  if (b = {
1627
1627
  ...u,
1628
- height: ((u == null ? void 0 : u.height) || 0) - R.endY + R.startY
1629
- }, A = j(b, this._selectionRenderService), A != null && b != null) {
1630
- s.push({ ...c, sheetTransform: A, transform: b });
1628
+ height: ((u == null ? void 0 : u.height) || 0) - C.endY + C.startY
1629
+ }, T = $(b, this._selectionRenderService), T != null && b != null) {
1630
+ s.push({ ...l, sheetTransform: T, transform: b });
1631
1631
  break;
1632
1632
  }
1633
1633
  }
1634
- if (b != null && (A = j(b, this._selectionRenderService)), b != null && A != null) {
1635
- r.push({ ...c, sheetTransform: A, transform: b });
1634
+ if (b != null && (T = $(b, this._selectionRenderService)), b != null && T != null) {
1635
+ r.push({ ...l, sheetTransform: T, transform: b });
1636
1636
  break;
1637
1637
  } else
1638
- this._remainDrawingSize(u, r, c);
1638
+ this._remainDrawingSize(u, r, l);
1639
1639
  }
1640
1640
  }
1641
1641
  }), r.length === 0 && s.length === 0)
1642
1642
  return { redos: [], undos: [] };
1643
- const { redos: o, undos: a } = this._createUndoAndRedoMutation(i, e, r), l = [], g = [];
1643
+ const { redos: o, undos: c } = this._createUndoAndRedoMutation(i, e, r), d = [], g = [];
1644
1644
  if (s.length > 0) {
1645
- const { redos: d, undos: c } = this._createUndoAndRedoMutation(i, e, s);
1646
- l.push(...d), g.push(...c);
1645
+ const { redos: a, undos: l } = this._createUndoAndRedoMutation(i, e, s);
1646
+ d.push(...a), g.push(...l);
1647
1647
  }
1648
1648
  return {
1649
1649
  redos: o,
1650
- undos: a,
1651
- preRedos: l,
1650
+ undos: c,
1651
+ preRedos: d,
1652
1652
  preUndos: g
1653
1653
  };
1654
1654
  }
1655
1655
  _getDrawingUndoForRowAndColSize(i, e, n, t) {
1656
1656
  const r = this._drawingManagerService.getDrawingData(i, e), s = [];
1657
1657
  return Object.keys(r).forEach((o) => {
1658
- const a = r[o], { sheetTransform: l, transform: g, anchorType: d = y.Position } = a;
1659
- if (d === y.None)
1660
- this._remainDrawingSize(g, s, a);
1658
+ const c = r[o], { sheetTransform: d, transform: g, anchorType: a = O.Position } = c;
1659
+ if (a === O.None)
1660
+ this._remainDrawingSize(g, s, c);
1661
1661
  else {
1662
- const { from: c, to: h } = l, { row: u, column: m } = c, { row: f, column: p } = h;
1663
- for (let v = 0; v < n.length; v++) {
1664
- const I = n[v], { startRow: S, endRow: M, startColumn: w, endColumn: C } = I;
1665
- if (f < S || p < w)
1662
+ const { from: l, to: h } = d, { row: u, column: m } = l, { row: p, column: f } = h;
1663
+ for (let w = 0; w < n.length; w++) {
1664
+ const S = n[w], { startRow: I, endRow: D, startColumn: v, endColumn: R } = S;
1665
+ if (p < I || f < v)
1666
1666
  continue;
1667
- if (d === y.Position && (u <= S && f >= M || m <= w && p >= C)) {
1668
- this._remainDrawingSize(g, s, a);
1667
+ if (a === O.Position && (u <= I && p >= D || m <= v && f >= R)) {
1668
+ this._remainDrawingSize(g, s, c);
1669
1669
  continue;
1670
1670
  }
1671
- const _ = L(
1672
- { ...l },
1671
+ const _ = V(
1672
+ { ...d },
1673
1673
  this._selectionRenderService,
1674
1674
  this._skeletonManagerService
1675
1675
  );
1676
1676
  if (_ != null) {
1677
1677
  s.push({
1678
- ...a,
1678
+ ...c,
1679
1679
  transform: _
1680
1680
  });
1681
1681
  break;
@@ -1689,7 +1689,7 @@ let wt = class extends q {
1689
1689
  if (e === "insert")
1690
1690
  n = i.unitId, t = i.subUnitId;
1691
1691
  else {
1692
- const r = H(this._univerInstanceService);
1692
+ const r = Y(this._univerInstanceService);
1693
1693
  if (r == null)
1694
1694
  return;
1695
1695
  n = r.unitId, t = r.subUnitId;
@@ -1697,89 +1697,89 @@ let wt = class extends q {
1697
1697
  return { unitId: n, subUnitId: t };
1698
1698
  }
1699
1699
  _moveRangeInterceptor(i) {
1700
- var S, M;
1701
- const { toRange: e, fromRange: n } = i, t = H(this._univerInstanceService);
1700
+ var I, D;
1701
+ const { toRange: e, fromRange: n } = i, t = Y(this._univerInstanceService);
1702
1702
  if (!t)
1703
1703
  return { redos: [], undos: [] };
1704
- const { unitId: r, subUnitId: s } = t, o = (M = (S = this._renderManagerService.getRenderById(r)) == null ? void 0 : S.with(Z)) == null ? void 0 : M.getCurrentSkeleton();
1704
+ const { unitId: r, subUnitId: s } = t, o = (D = (I = this._renderManagerService.getRenderById(r)) == null ? void 0 : I.with(H)) == null ? void 0 : D.getCurrentSkeleton();
1705
1705
  if (!o)
1706
1706
  return { redos: [], undos: [] };
1707
- const a = Xt(o, n);
1708
- if (!a)
1707
+ const c = Wn(o, n);
1708
+ if (!c)
1709
1709
  return { redos: [], undos: [] };
1710
- const { startX: l, endX: g, startY: d, endY: c } = a, h = this._sheetDrawingService.getDrawingData(r, s), u = [];
1711
- Object.keys(h).forEach((w) => {
1712
- const C = h[w];
1713
- if (C.anchorType !== y.Both)
1710
+ const { startX: d, endX: g, startY: a, endY: l } = c, h = this._sheetDrawingService.getDrawingData(r, s), u = [];
1711
+ Object.keys(h).forEach((v) => {
1712
+ const R = h[v];
1713
+ if (R.anchorType !== O.Both)
1714
1714
  return;
1715
- const { transform: _ } = C;
1715
+ const { transform: _ } = R;
1716
1716
  if (!_)
1717
1717
  return;
1718
- const { left: T = 0, top: D = 0, width: N = 0, height: A = 0 } = _, { drawingStartX: b, drawingEndX: R, drawingStartY: P, drawingEndY: x } = {
1719
- drawingStartX: T,
1720
- drawingEndX: T + N,
1721
- drawingStartY: D,
1722
- drawingEndY: D + A
1718
+ const { left: E = 0, top: M = 0, width: A = 0, height: T = 0 } = _, { drawingStartX: b, drawingEndX: C, drawingStartY: y, drawingEndY: W } = {
1719
+ drawingStartX: E,
1720
+ drawingEndX: E + A,
1721
+ drawingStartY: M,
1722
+ drawingEndY: M + T
1723
1723
  };
1724
- l <= b && R <= g && d <= P && x <= c && u.push(C);
1724
+ d <= b && C <= g && a <= y && W <= l && u.push(R);
1725
1725
  });
1726
- const m = [], f = [], p = e.startRow - n.startRow, v = e.startColumn - n.startColumn, I = u.map((w) => {
1727
- const C = w.sheetTransform, _ = {
1728
- to: { ...C.to, row: C.to.row + p, column: C.to.column + v },
1729
- from: { ...C.from, row: C.from.row + p, column: C.from.column + v }
1730
- }, T = L(_, this._selectionRenderService, this._skeletonManagerService);
1726
+ const m = [], p = [], f = e.startRow - n.startRow, w = e.startColumn - n.startColumn, S = u.map((v) => {
1727
+ const R = v.sheetTransform, _ = {
1728
+ to: { ...R.to, row: R.to.row + f, column: R.to.column + w },
1729
+ from: { ...R.from, row: R.from.row + f, column: R.from.column + w }
1730
+ }, E = V(_, this._selectionRenderService, this._skeletonManagerService);
1731
1731
  return {
1732
1732
  unitId: r,
1733
1733
  subUnitId: s,
1734
- drawingId: w.drawingId,
1735
- transform: T,
1734
+ drawingId: v.drawingId,
1735
+ transform: E,
1736
1736
  sheetTransform: _
1737
1737
  };
1738
1738
  });
1739
- if (I.length) {
1740
- const w = this._sheetDrawingService.getBatchUpdateOp(I), { undo: C, redo: _, objects: T } = w;
1741
- m.push({ id: O.id, params: { unitId: r, subUnitId: s, op: _, objects: T, type: E.UPDATE } }), f.push({ id: O.id, params: { unitId: r, subUnitId: s, op: C, objects: T, type: E.UPDATE } });
1739
+ if (S.length) {
1740
+ const v = this._sheetDrawingService.getBatchUpdateOp(S), { undo: R, redo: _, objects: E } = v;
1741
+ m.push({ id: P.id, params: { unitId: r, subUnitId: s, op: _, objects: E, type: U.UPDATE } }), p.push({ id: P.id, params: { unitId: r, subUnitId: s, op: R, objects: E, type: U.UPDATE } });
1742
1742
  }
1743
- return { redos: m, undos: f };
1743
+ return { redos: m, undos: p };
1744
1744
  }
1745
1745
  _moveRowInterceptor(i, e) {
1746
1746
  const n = this._getUnitIdAndSubUnitId(i, e);
1747
1747
  if (n == null)
1748
1748
  return { redos: [], undos: [] };
1749
- const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startRow, a = s.endRow, l = [], g = [], d = this._sheetDrawingService.getDrawingData(t, r), c = [], h = [];
1750
- if (Object.keys(d).forEach((u) => {
1751
- const m = d[u], { sheetTransform: f, transform: p, anchorType: v = y.Position } = m;
1752
- if (f == null || p == null)
1749
+ const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startRow, c = s.endRow, d = [], g = [], a = this._sheetDrawingService.getDrawingData(t, r), l = [], h = [];
1750
+ if (Object.keys(a).forEach((u) => {
1751
+ const m = a[u], { sheetTransform: p, transform: f, anchorType: w = O.Position } = m;
1752
+ if (p == null || f == null)
1753
1753
  return;
1754
- let I, S;
1754
+ let S, I;
1755
1755
  if (e === "insert") {
1756
- const w = this._expandRow(f, p, o, a, v);
1757
- I = w == null ? void 0 : w.newSheetTransform, S = w == null ? void 0 : w.newTransform;
1756
+ const v = this._expandRow(p, f, o, c, w);
1757
+ S = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
1758
1758
  } else {
1759
- const { from: w, to: C } = f, { row: _ } = w, { row: T } = C;
1760
- if (v === y.Both && _ >= o && T <= a)
1759
+ const { from: v, to: R } = p, { row: _ } = v, { row: E } = R;
1760
+ if (w === O.Both && _ >= o && E <= c)
1761
1761
  h.push({ unitId: t, subUnitId: r, drawingId: u });
1762
1762
  else {
1763
- const D = this._shrinkRow(f, p, o, a, v);
1764
- I = D == null ? void 0 : D.newSheetTransform, S = D == null ? void 0 : D.newTransform;
1763
+ const M = this._shrinkRow(p, f, o, c, w);
1764
+ S = M == null ? void 0 : M.newSheetTransform, I = M == null ? void 0 : M.newTransform;
1765
1765
  }
1766
1766
  }
1767
- if (!I || !S)
1767
+ if (!S || !I)
1768
1768
  return;
1769
- const M = { unitId: t, subUnitId: r, drawingId: u, transform: S, sheetTransform: I };
1770
- c.push(M);
1771
- }), c.length === 0 && h.length === 0)
1769
+ const D = { unitId: t, subUnitId: r, drawingId: u, transform: I, sheetTransform: S };
1770
+ l.push(D);
1771
+ }), l.length === 0 && h.length === 0)
1772
1772
  return { redos: [], undos: [] };
1773
- if (c.length > 0) {
1774
- const u = this._sheetDrawingService.getBatchUpdateOp(c), { undo: m, redo: f, objects: p } = u;
1775
- l.push({ id: O.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: E.UPDATE } }), g.push({ id: O.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: E.UPDATE } });
1773
+ if (l.length > 0) {
1774
+ const u = this._sheetDrawingService.getBatchUpdateOp(l), { undo: m, redo: p, objects: f } = u;
1775
+ d.push({ id: P.id, params: { unitId: t, subUnitId: r, op: p, objects: f, type: U.UPDATE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: m, objects: f, type: U.UPDATE } });
1776
1776
  }
1777
1777
  if (h.length > 0) {
1778
- const u = this._sheetDrawingService.getBatchRemoveOp(h), m = u.undo, f = u.redo, p = u.objects;
1779
- l.push({ id: O.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: E.REMOVE } }), g.push({ id: O.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: E.INSERT } });
1778
+ const u = this._sheetDrawingService.getBatchRemoveOp(h), m = u.undo, p = u.redo, f = u.objects;
1779
+ d.push({ id: P.id, params: { unitId: t, subUnitId: r, op: p, objects: f, type: U.REMOVE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: m, objects: f, type: U.INSERT } });
1780
1780
  }
1781
- return l.push({ id: W.id, params: [t] }), g.push({ id: W.id, params: [t] }), {
1782
- redos: l,
1781
+ return d.push({ id: k.id, params: [t] }), g.push({ id: k.id, params: [t] }), {
1782
+ redos: d,
1783
1783
  undos: g
1784
1784
  };
1785
1785
  }
@@ -1787,225 +1787,225 @@ let wt = class extends q {
1787
1787
  const n = this._getUnitIdAndSubUnitId(i, e);
1788
1788
  if (n == null)
1789
1789
  return { redos: [], undos: [] };
1790
- const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startColumn, a = s.endColumn, l = [], g = [], d = this._sheetDrawingService.getDrawingData(t, r), c = [], h = [];
1791
- if (Object.keys(d).forEach((u) => {
1792
- const m = d[u], { sheetTransform: f, transform: p, anchorType: v = y.Position } = m;
1793
- if (f == null || p == null)
1790
+ const { unitId: t, subUnitId: r } = n, { range: s } = i, o = s.startColumn, c = s.endColumn, d = [], g = [], a = this._sheetDrawingService.getDrawingData(t, r), l = [], h = [];
1791
+ if (Object.keys(a).forEach((u) => {
1792
+ const m = a[u], { sheetTransform: p, transform: f, anchorType: w = O.Position } = m;
1793
+ if (p == null || f == null)
1794
1794
  return;
1795
- let I, S;
1795
+ let S, I;
1796
1796
  if (e === "insert") {
1797
- const w = this._expandCol(f, p, o, a, v);
1798
- I = w == null ? void 0 : w.newSheetTransform, S = w == null ? void 0 : w.newTransform;
1797
+ const v = this._expandCol(p, f, o, c, w);
1798
+ S = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
1799
1799
  } else {
1800
- const { from: w, to: C } = f, { column: _ } = w, { column: T } = C;
1801
- if (v === y.Both && _ >= o && T <= a)
1800
+ const { from: v, to: R } = p, { column: _ } = v, { column: E } = R;
1801
+ if (w === O.Both && _ >= o && E <= c)
1802
1802
  h.push({ unitId: t, subUnitId: r, drawingId: u });
1803
1803
  else {
1804
- const D = this._shrinkCol(f, p, o, a, v);
1805
- I = D == null ? void 0 : D.newSheetTransform, S = D == null ? void 0 : D.newTransform;
1804
+ const M = this._shrinkCol(p, f, o, c, w);
1805
+ S = M == null ? void 0 : M.newSheetTransform, I = M == null ? void 0 : M.newTransform;
1806
1806
  }
1807
1807
  }
1808
- if (!I || !S)
1808
+ if (!S || !I)
1809
1809
  return;
1810
- const M = { unitId: t, subUnitId: r, drawingId: u, transform: S, sheetTransform: I };
1811
- c.push(M);
1812
- }), c.length === 0 && h.length === 0)
1810
+ const D = { unitId: t, subUnitId: r, drawingId: u, transform: I, sheetTransform: S };
1811
+ l.push(D);
1812
+ }), l.length === 0 && h.length === 0)
1813
1813
  return { redos: [], undos: [] };
1814
- if (c.length > 0) {
1815
- const u = this._sheetDrawingService.getBatchUpdateOp(c), { undo: m, redo: f, objects: p } = u;
1816
- l.push({ id: O.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: E.UPDATE } }), g.push({ id: O.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: E.UPDATE } });
1814
+ if (l.length > 0) {
1815
+ const u = this._sheetDrawingService.getBatchUpdateOp(l), { undo: m, redo: p, objects: f } = u;
1816
+ d.push({ id: P.id, params: { unitId: t, subUnitId: r, op: p, objects: f, type: U.UPDATE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: m, objects: f, type: U.UPDATE } });
1817
1817
  }
1818
1818
  if (h.length > 0) {
1819
- const u = this._sheetDrawingService.getBatchRemoveOp(h), m = u.undo, f = u.redo, p = u.objects;
1820
- l.push({ id: O.id, params: { unitId: t, subUnitId: r, op: f, objects: p, type: E.REMOVE } }), g.push({ id: O.id, params: { unitId: t, subUnitId: r, op: m, objects: p, type: E.INSERT } });
1819
+ const u = this._sheetDrawingService.getBatchRemoveOp(h), m = u.undo, p = u.redo, f = u.objects;
1820
+ d.push({ id: P.id, params: { unitId: t, subUnitId: r, op: p, objects: f, type: U.REMOVE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: m, objects: f, type: U.INSERT } });
1821
1821
  }
1822
- return l.push({ id: W.id, params: [t] }), g.push({ id: W.id, params: [t] }), { redos: l, undos: g };
1822
+ return d.push({ id: k.id, params: [t] }), g.push({ id: k.id, params: [t] }), { redos: d, undos: g };
1823
1823
  }
1824
- _expandCol(i, e, n, t, r = y.Position) {
1825
- const s = t - n + 1, { from: o, to: a } = i, { column: l } = o, { column: g } = a;
1826
- if (r === y.None)
1824
+ _expandCol(i, e, n, t, r = O.Position) {
1825
+ const s = t - n + 1, { from: o, to: c } = i, { column: d } = o, { column: g } = c;
1826
+ if (r === O.None)
1827
1827
  return {
1828
- newSheetTransform: j({ ...e }, this._selectionRenderService),
1828
+ newSheetTransform: $({ ...e }, this._selectionRenderService),
1829
1829
  newTransform: e
1830
1830
  };
1831
- let d = null, c = null;
1832
- if (l >= n) {
1833
- const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: t, startRow: o.row, endRow: a.row });
1831
+ let a = null, l = null;
1832
+ if (d >= n) {
1833
+ const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: t, startRow: o.row, endRow: c.row });
1834
1834
  if (h == null)
1835
1835
  return;
1836
- c = { ...e, left: (e.left || 0) + h.endX - h.startX }, d = j(c, this._selectionRenderService);
1836
+ l = { ...e, left: (e.left || 0) + h.endX - h.startX }, a = $(l, this._selectionRenderService);
1837
1837
  } else if (g >= t)
1838
- if (r === y.Both)
1839
- d = {
1838
+ if (r === O.Both)
1839
+ a = {
1840
1840
  from: { ...o },
1841
- to: { ...a, column: g + s }
1842
- }, c = L(d, this._selectionRenderService, this._skeletonManagerService);
1841
+ to: { ...c, column: g + s }
1842
+ }, l = V(a, this._selectionRenderService, this._skeletonManagerService);
1843
1843
  else
1844
1844
  return {
1845
- newSheetTransform: j({ ...e }, this._selectionRenderService),
1845
+ newSheetTransform: $({ ...e }, this._selectionRenderService),
1846
1846
  newTransform: e
1847
1847
  };
1848
- return d != null && c != null ? {
1849
- newSheetTransform: d,
1850
- newTransform: c
1848
+ return a != null && l != null ? {
1849
+ newSheetTransform: a,
1850
+ newTransform: l
1851
1851
  } : null;
1852
1852
  }
1853
- _shrinkCol(i, e, n, t, r = y.Position) {
1854
- const s = t - n + 1, { from: o, to: a } = i, { column: l } = o, { column: g } = a;
1855
- if (r === y.None)
1853
+ _shrinkCol(i, e, n, t, r = O.Position) {
1854
+ const s = t - n + 1, { from: o, to: c } = i, { column: d } = o, { column: g } = c;
1855
+ if (r === O.None)
1856
1856
  return {
1857
- newSheetTransform: j({ ...e }, this._selectionRenderService),
1857
+ newSheetTransform: $({ ...e }, this._selectionRenderService),
1858
1858
  newTransform: e
1859
1859
  };
1860
- let d = null, c = null;
1861
- if (l > t)
1862
- d = {
1863
- from: { ...o, column: l - s },
1864
- to: { ...a, column: g - s }
1865
- }, c = L(d, this._selectionRenderService, this._skeletonManagerService);
1860
+ let a = null, l = null;
1861
+ if (d > t)
1862
+ a = {
1863
+ from: { ...o, column: d - s },
1864
+ to: { ...c, column: g - s }
1865
+ }, l = V(a, this._selectionRenderService, this._skeletonManagerService);
1866
1866
  else {
1867
- if (l >= n && g <= t)
1867
+ if (d >= n && g <= t)
1868
1868
  return null;
1869
- if (l < n && g > t)
1870
- if (r === y.Both)
1871
- d = {
1869
+ if (d < n && g > t)
1870
+ if (r === O.Both)
1871
+ a = {
1872
1872
  from: { ...o },
1873
- to: { ...a, column: g - s }
1874
- }, c = L(d, this._selectionRenderService, this._skeletonManagerService);
1873
+ to: { ...c, column: g - s }
1874
+ }, l = V(a, this._selectionRenderService, this._skeletonManagerService);
1875
1875
  else
1876
1876
  return {
1877
- newSheetTransform: j({ ...e }, this._selectionRenderService),
1877
+ newSheetTransform: $({ ...e }, this._selectionRenderService),
1878
1878
  newTransform: e
1879
1879
  };
1880
- else if (l >= n && l <= t) {
1881
- if (l === n)
1882
- c = { ...e, left: (e.left || 0) - i.from.columnOffset };
1880
+ else if (d >= n && d <= t) {
1881
+ if (d === n)
1882
+ l = { ...e, left: (e.left || 0) - i.from.columnOffset };
1883
1883
  else {
1884
- const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: l - 1, startRow: o.row, endRow: a.row });
1884
+ const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: n, endColumn: d - 1, startRow: o.row, endRow: c.row });
1885
1885
  if (h == null)
1886
1886
  return;
1887
- c = { ...e, left: (e.left || 0) - h.endX + h.startX - i.from.columnOffset };
1887
+ l = { ...e, left: (e.left || 0) - h.endX + h.startX - i.from.columnOffset };
1888
1888
  }
1889
- d = j(c, this._selectionRenderService);
1890
- } else if (g >= n && g <= t && r === y.Both) {
1889
+ a = $(l, this._selectionRenderService);
1890
+ } else if (g >= n && g <= t && r === O.Both) {
1891
1891
  const h = this._skeletonManagerService.attachRangeWithCoord({
1892
1892
  startColumn: n - 1,
1893
1893
  endColumn: n - 1,
1894
1894
  startRow: o.row,
1895
- endRow: a.row
1895
+ endRow: c.row
1896
1896
  });
1897
1897
  if (h == null)
1898
1898
  return;
1899
- d = {
1899
+ a = {
1900
1900
  from: { ...o },
1901
- to: { ...a, column: n - 1, columnOffset: h.endX - h.startX }
1902
- }, c = L(d, this._selectionRenderService, this._skeletonManagerService);
1901
+ to: { ...c, column: n - 1, columnOffset: h.endX - h.startX }
1902
+ }, l = V(a, this._selectionRenderService, this._skeletonManagerService);
1903
1903
  }
1904
1904
  }
1905
- return d != null && c != null ? {
1906
- newSheetTransform: d,
1907
- newTransform: c
1905
+ return a != null && l != null ? {
1906
+ newSheetTransform: a,
1907
+ newTransform: l
1908
1908
  } : null;
1909
1909
  }
1910
- _expandRow(i, e, n, t, r = y.Position) {
1911
- const s = t - n + 1, { from: o, to: a } = i, { row: l } = o, { row: g } = a;
1912
- if (r === y.None)
1910
+ _expandRow(i, e, n, t, r = O.Position) {
1911
+ const s = t - n + 1, { from: o, to: c } = i, { row: d } = o, { row: g } = c;
1912
+ if (r === O.None)
1913
1913
  return {
1914
- newSheetTransform: j({ ...e }, this._selectionRenderService),
1914
+ newSheetTransform: $({ ...e }, this._selectionRenderService),
1915
1915
  newTransform: e
1916
1916
  };
1917
- let d = null, c = null;
1918
- if (l >= n) {
1919
- const h = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: t, startColumn: o.column, endColumn: a.column });
1917
+ let a = null, l = null;
1918
+ if (d >= n) {
1919
+ const h = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: t, startColumn: o.column, endColumn: c.column });
1920
1920
  if (h == null)
1921
1921
  return;
1922
- c = { ...e, top: (e.top || 0) + h.endY - h.startY }, d = j(c, this._selectionRenderService);
1922
+ l = { ...e, top: (e.top || 0) + h.endY - h.startY }, a = $(l, this._selectionRenderService);
1923
1923
  } else if (g >= t)
1924
- if (r === y.Both)
1925
- d = {
1924
+ if (r === O.Both)
1925
+ a = {
1926
1926
  from: { ...o },
1927
1927
  to: {
1928
- ...a,
1928
+ ...c,
1929
1929
  row: g + s
1930
1930
  }
1931
- }, c = L(d, this._selectionRenderService, this._skeletonManagerService);
1931
+ }, l = V(a, this._selectionRenderService, this._skeletonManagerService);
1932
1932
  else
1933
1933
  return {
1934
- newSheetTransform: j({ ...e }, this._selectionRenderService),
1934
+ newSheetTransform: $({ ...e }, this._selectionRenderService),
1935
1935
  newTransform: e
1936
1936
  };
1937
- return d != null && c != null ? {
1938
- newSheetTransform: d,
1939
- newTransform: c
1937
+ return a != null && l != null ? {
1938
+ newSheetTransform: a,
1939
+ newTransform: l
1940
1940
  } : null;
1941
1941
  }
1942
- _shrinkRow(i, e, n, t, r = y.Position) {
1943
- const s = t - n + 1, { from: o, to: a } = i, { row: l } = o, { row: g } = a;
1944
- if (r === y.None)
1942
+ _shrinkRow(i, e, n, t, r = O.Position) {
1943
+ const s = t - n + 1, { from: o, to: c } = i, { row: d } = o, { row: g } = c;
1944
+ if (r === O.None)
1945
1945
  return {
1946
- newSheetTransform: j({ ...e }, this._selectionRenderService),
1946
+ newSheetTransform: $({ ...e }, this._selectionRenderService),
1947
1947
  newTransform: e
1948
1948
  };
1949
- let d = null, c = null;
1950
- if (l > t)
1951
- d = {
1952
- from: { ...o, row: l - s },
1953
- to: { ...a, row: g - s }
1954
- }, c = L(d, this._selectionRenderService, this._skeletonManagerService);
1949
+ let a = null, l = null;
1950
+ if (d > t)
1951
+ a = {
1952
+ from: { ...o, row: d - s },
1953
+ to: { ...c, row: g - s }
1954
+ }, l = V(a, this._selectionRenderService, this._skeletonManagerService);
1955
1955
  else {
1956
- if (l >= n && g <= t)
1956
+ if (d >= n && g <= t)
1957
1957
  return null;
1958
- if (l < n && g > t)
1959
- if (r === y.Both)
1960
- d = {
1958
+ if (d < n && g > t)
1959
+ if (r === O.Both)
1960
+ a = {
1961
1961
  from: { ...o },
1962
- to: { ...a, row: g - s }
1963
- }, c = L(d, this._selectionRenderService, this._skeletonManagerService);
1962
+ to: { ...c, row: g - s }
1963
+ }, l = V(a, this._selectionRenderService, this._skeletonManagerService);
1964
1964
  else
1965
1965
  return {
1966
- newSheetTransform: j({ ...e }, this._selectionRenderService),
1966
+ newSheetTransform: $({ ...e }, this._selectionRenderService),
1967
1967
  newTransform: e
1968
1968
  };
1969
- else if (l >= n && l <= t) {
1970
- if (l === n)
1971
- c = { ...e, top: (e.top || 0) - i.from.rowOffset };
1969
+ else if (d >= n && d <= t) {
1970
+ if (d === n)
1971
+ l = { ...e, top: (e.top || 0) - i.from.rowOffset };
1972
1972
  else {
1973
- const h = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: l - 1, startColumn: o.column, endColumn: a.column });
1973
+ const h = this._skeletonManagerService.attachRangeWithCoord({ startRow: n, endRow: d - 1, startColumn: o.column, endColumn: c.column });
1974
1974
  if (h == null)
1975
1975
  return;
1976
- c = { ...e, top: (e.top || 0) - h.endY + h.startY - i.from.rowOffset };
1976
+ l = { ...e, top: (e.top || 0) - h.endY + h.startY - i.from.rowOffset };
1977
1977
  }
1978
- d = j(c, this._selectionRenderService);
1979
- } else if (g >= n && g <= t && r === y.Both) {
1978
+ a = $(l, this._selectionRenderService);
1979
+ } else if (g >= n && g <= t && r === O.Both) {
1980
1980
  const h = this._skeletonManagerService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow: n - 1, endRow: n - 1 });
1981
1981
  if (h == null)
1982
1982
  return;
1983
- d = {
1983
+ a = {
1984
1984
  from: { ...o },
1985
- to: { ...a, row: n - 1, rowOffset: h.endY - h.startY }
1986
- }, c = L(d, this._selectionRenderService, this._skeletonManagerService);
1985
+ to: { ...c, row: n - 1, rowOffset: h.endY - h.startY }
1986
+ }, l = V(a, this._selectionRenderService, this._skeletonManagerService);
1987
1987
  }
1988
1988
  }
1989
- return d != null && c != null ? {
1990
- newSheetTransform: d,
1991
- newTransform: c
1989
+ return a != null && l != null ? {
1990
+ newSheetTransform: a,
1991
+ newTransform: l
1992
1992
  } : null;
1993
1993
  }
1994
1994
  _commandListener() {
1995
1995
  this.disposeWithMe(
1996
1996
  this._commandService.onCommandExecuted((i) => {
1997
- i.id === ai.id && setTimeout(() => {
1997
+ i.id === Vi.id && setTimeout(() => {
1998
1998
  const e = i.params, { unitId: n, subUnitId: t } = e, r = this._drawingManagerService.drawingManagerData, s = [], o = [];
1999
- Object.keys(r).forEach((a) => {
2000
- const l = r[a];
2001
- l != null && Object.keys(l).forEach((g) => {
2002
- const d = l[g].data;
2003
- d != null && Object.keys(d).forEach((c) => {
2004
- if (a === n && g === t) {
2005
- const h = d[c];
2006
- h.transform = L(h.sheetTransform, this._selectionRenderService, this._skeletonManagerService), s.push(d[c]);
1999
+ Object.keys(r).forEach((c) => {
2000
+ const d = r[c];
2001
+ d != null && Object.keys(d).forEach((g) => {
2002
+ const a = d[g].data;
2003
+ a != null && Object.keys(a).forEach((l) => {
2004
+ if (c === n && g === t) {
2005
+ const h = a[l];
2006
+ h.transform = V(h.sheetTransform, this._selectionRenderService, this._skeletonManagerService), s.push(a[l]);
2007
2007
  } else
2008
- o.push(d[c]);
2008
+ o.push(a[l]);
2009
2009
  });
2010
2010
  });
2011
2011
  }), this._drawingManagerService.removeNotification(o), this._drawingManagerService.addNotification(s);
@@ -2016,7 +2016,7 @@ let wt = class extends q {
2016
2016
  _sheetRefreshListener() {
2017
2017
  this.disposeWithMe(
2018
2018
  this._commandService.onCommandExecuted((i) => {
2019
- rs.includes(i.id) && requestIdleCallback(() => {
2019
+ Ys.includes(i.id) && requestIdleCallback(() => {
2020
2020
  const e = i.params, { unitId: n, subUnitId: t, ranges: r } = e;
2021
2021
  this._refreshDrawingTransform(n, t, r);
2022
2022
  });
@@ -2026,407 +2026,407 @@ let wt = class extends q {
2026
2026
  _refreshDrawingTransform(i, e, n) {
2027
2027
  const t = this._drawingManagerService.getDrawingData(i, e), r = [];
2028
2028
  Object.keys(t).forEach((s) => {
2029
- const o = t[s], { sheetTransform: a, transform: l, anchorType: g = y.Position } = o;
2030
- if (g === y.None)
2029
+ const o = t[s], { sheetTransform: c, transform: d, anchorType: g = O.Position } = o;
2030
+ if (g === O.None)
2031
2031
  return !0;
2032
- const { from: d, to: c } = a, { row: h, column: u } = d, { row: m, column: f } = c;
2033
- for (let p = 0; p < n.length; p++) {
2034
- const v = n[p], { startRow: I, endRow: S, startColumn: M, endColumn: w } = v;
2035
- if (Qn.intersects(
2032
+ const { from: a, to: l } = c, { row: h, column: u } = a, { row: m, column: p } = l;
2033
+ for (let f = 0; f < n.length; f++) {
2034
+ const w = n[f], { startRow: S, endRow: I, startColumn: D, endColumn: v } = w;
2035
+ if (Gr.intersects(
2036
2036
  {
2037
- startRow: I,
2038
- endRow: S,
2039
- startColumn: M,
2040
- endColumn: w
2037
+ startRow: S,
2038
+ endRow: I,
2039
+ startColumn: D,
2040
+ endColumn: v
2041
2041
  },
2042
2042
  {
2043
2043
  startRow: h,
2044
2044
  endRow: m,
2045
2045
  startColumn: u,
2046
- endColumn: f
2046
+ endColumn: p
2047
2047
  }
2048
- ) || h > S || u > w) {
2049
- const C = g === y.Position, _ = L(a, this._selectionRenderService, this._skeletonManagerService);
2048
+ ) || h > I || u > v) {
2049
+ const R = g === O.Position, _ = V(c, this._selectionRenderService, this._skeletonManagerService);
2050
2050
  r.push({
2051
2051
  ...o,
2052
2052
  transform: {
2053
2053
  ..._,
2054
- width: C ? l == null ? void 0 : l.width : _ == null ? void 0 : _.width,
2055
- height: C ? l == null ? void 0 : l.height : _ == null ? void 0 : _.height
2054
+ width: R ? d == null ? void 0 : d.width : _ == null ? void 0 : _.width,
2055
+ height: R ? d == null ? void 0 : d.height : _ == null ? void 0 : _.height
2056
2056
  }
2057
2057
  });
2058
2058
  break;
2059
2059
  }
2060
2060
  }
2061
- }), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(W.id, [i]));
2061
+ }), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(k.id, [i]));
2062
2062
  }
2063
2063
  };
2064
- wt = ts([
2065
- te(1, X),
2066
- te(2, B),
2067
- te(3, Ce),
2068
- te(4, U(Z)),
2069
- te(5, U(Ze)),
2070
- te(6, z),
2071
- te(7, Q),
2072
- te(8, pe)
2073
- ], wt);
2074
- var J = function() {
2075
- return J = Object.assign || function(i) {
2064
+ on = Ls([
2065
+ we(1, Q),
2066
+ we(2, X),
2067
+ we(3, Je),
2068
+ we(4, N(H)),
2069
+ we(5, N(Bt)),
2070
+ we(6, ee),
2071
+ we(7, de),
2072
+ we(8, ke)
2073
+ ], on);
2074
+ var re = function() {
2075
+ return re = Object.assign || function(i) {
2076
2076
  for (var e, n = 1, t = arguments.length; n < t; n++) {
2077
2077
  e = arguments[n];
2078
2078
  for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (i[r] = e[r]);
2079
2079
  }
2080
2080
  return i;
2081
- }, J.apply(this, arguments);
2082
- }, is = function(i, e) {
2081
+ }, re.apply(this, arguments);
2082
+ }, Gs = function(i, e) {
2083
2083
  var n = {};
2084
2084
  for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && e.indexOf(t) < 0 && (n[t] = i[t]);
2085
2085
  if (i != null && typeof Object.getOwnPropertySymbols == "function")
2086
2086
  for (var r = 0, t = Object.getOwnPropertySymbols(i); r < t.length; r++)
2087
2087
  e.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, t[r]) && (n[t[r]] = i[t[r]]);
2088
2088
  return n;
2089
- }, Dn = _n(function(i, e) {
2090
- var n = i.icon, t = i.id, r = i.className, s = i.extend, o = is(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), l = li("_".concat(as()));
2091
- return yn(n, "".concat(t), { defIds: n.defIds, idSuffix: l.current }, J({ ref: e, className: a }, o), s);
2089
+ }, fr = or(function(i, e) {
2090
+ var n = i.icon, t = i.id, r = i.className, s = i.extend, o = Gs(i, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), d = Ji("_".concat(Hs()));
2091
+ return pr(n, "".concat(t), { defIds: n.defIds, idSuffix: d.current }, re({ ref: e, className: c }, o), s);
2092
2092
  });
2093
- function yn(i, e, n, t, r) {
2094
- return wn(i.tag, J(J({ key: e }, ss(i, n, r)), t), (os(i, n).children || []).map(function(s, o) {
2095
- return yn(s, "".concat(e, "-").concat(i.tag, "-").concat(o), n, void 0, r);
2093
+ function pr(i, e, n, t, r) {
2094
+ return ar(i.tag, re(re({ key: e }, Xs(i, n, r)), t), (Vs(i, n).children || []).map(function(s, o) {
2095
+ return pr(s, "".concat(e, "-").concat(i.tag, "-").concat(o), n, void 0, r);
2096
2096
  }));
2097
2097
  }
2098
- function ss(i, e, n) {
2099
- var t = J({}, i.attrs);
2098
+ function Xs(i, e, n) {
2099
+ var t = re({}, i.attrs);
2100
2100
  n != null && n.colorChannel1 && t.fill === "colorChannel1" && (t.fill = n.colorChannel1);
2101
2101
  var r = e.defIds;
2102
2102
  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) {
2103
- var o = s[0], a = s[1];
2104
- typeof a == "string" && (t[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
2103
+ var o = s[0], c = s[1];
2104
+ typeof c == "string" && (t[o] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
2105
2105
  })), t;
2106
2106
  }
2107
- function os(i, e) {
2107
+ function Vs(i, e) {
2108
2108
  var n, t = e.defIds;
2109
- return !t || t.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ? J(J({}, i), { children: i.children.map(function(r) {
2110
- return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ? J(J({}, r), { attrs: J(J({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
2109
+ return !t || t.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ? re(re({}, i), { children: i.children.map(function(r) {
2110
+ return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ? re(re({}, r), { attrs: re(re({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
2111
2111
  }) }) : i;
2112
2112
  }
2113
- function as() {
2113
+ function Hs() {
2114
2114
  return Math.random().toString(36).substring(2, 8);
2115
2115
  }
2116
- Dn.displayName = "UniverIcon";
2117
- var cs = { 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" } }] }, On = _n(function(i, e) {
2118
- return wn(Dn, Object.assign({}, i, {
2116
+ fr.displayName = "UniverIcon";
2117
+ var zs = { 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" } }] }, wr = or(function(i, e) {
2118
+ return ar(fr, Object.assign({}, i, {
2119
2119
  id: "add-image-single",
2120
2120
  ref: e,
2121
- icon: cs
2121
+ icon: zs
2122
2122
  }));
2123
2123
  });
2124
- On.displayName = "AddImageSingle";
2125
- const En = {
2124
+ wr.displayName = "AddImageSingle";
2125
+ const _r = {
2126
2126
  id: "sheet.command.delete-drawing",
2127
- type: Y.COMMAND,
2127
+ type: q.COMMAND,
2128
2128
  handler: (i) => {
2129
- const e = i.get(B), t = i.get(z).getFocusDrawings();
2129
+ const e = i.get(X), t = i.get(ee).getFocusDrawings();
2130
2130
  if (t.length === 0)
2131
2131
  return !1;
2132
2132
  const r = t[0].unitId, s = t.map((o) => {
2133
- const { unitId: a, subUnitId: l, drawingId: g, drawingType: d } = o;
2133
+ const { unitId: c, subUnitId: d, drawingId: g, drawingType: a } = o;
2134
2134
  return {
2135
- unitId: a,
2136
- subUnitId: l,
2135
+ unitId: c,
2136
+ subUnitId: d,
2137
2137
  drawingId: g,
2138
- drawingType: d
2138
+ drawingType: a
2139
2139
  };
2140
2140
  });
2141
- return e.executeCommand(Qe.id, {
2141
+ return e.executeCommand($t.id, {
2142
2142
  unitId: r,
2143
2143
  drawings: s
2144
2144
  });
2145
2145
  }
2146
- }, It = {
2146
+ }, dn = {
2147
2147
  id: "sheet.command.insert-float-image",
2148
- type: Y.COMMAND,
2148
+ type: q.COMMAND,
2149
2149
  handler: (i) => {
2150
2150
  var n, t;
2151
- return (t = (n = i.get(X).getCurrentTypeOfRenderer(F.UNIVER_SHEET)) == null ? void 0 : n.with(Se).insertFloatImage()) != null ? t : !1;
2151
+ return (t = (n = i.get(Q).getCurrentTypeOfRenderer(G.UNIVER_SHEET)) == null ? void 0 : n.with(ze).insertFloatImage()) != null ? t : !1;
2152
2152
  }
2153
- }, Ct = {
2153
+ }, ln = {
2154
2154
  id: "sheet.command.insert-cell-image",
2155
- type: Y.COMMAND,
2155
+ type: q.COMMAND,
2156
2156
  handler: (i) => {
2157
2157
  var n, t;
2158
- return (t = (n = i.get(X).getCurrentTypeOfRenderer(F.UNIVER_SHEET)) == null ? void 0 : n.with(Se).insertCellImage()) != null ? t : !1;
2158
+ return (t = (n = i.get(Q).getCurrentTypeOfRenderer(G.UNIVER_SHEET)) == null ? void 0 : n.with(ze).insertCellImage()) != null ? t : !1;
2159
2159
  }
2160
- }, Re = {
2160
+ }, Ze = {
2161
2161
  id: "sheet.command.move-drawing",
2162
- type: Y.COMMAND,
2162
+ type: q.COMMAND,
2163
2163
  handler: (i, e) => {
2164
- const n = i.get(B), t = i.get(z), r = i.get(Ce), { direction: s } = e, o = t.getFocusDrawings();
2164
+ const n = i.get(X), t = i.get(ee), r = i.get(Je), { direction: s } = e, o = t.getFocusDrawings();
2165
2165
  if (o.length === 0)
2166
2166
  return !1;
2167
- const a = o[0].unitId, l = o.map((d) => {
2168
- const { transform: c } = d;
2169
- if (c == null)
2167
+ const c = o[0].unitId, d = o.map((a) => {
2168
+ const { transform: l } = a;
2169
+ if (l == null)
2170
2170
  return null;
2171
- const h = { ...c }, { left: u = 0, top: m = 0 } = c;
2172
- return s === re.UP ? h.top = m - 1 : s === re.DOWN ? h.top = m + 1 : s === re.LEFT ? h.left = u - 1 : s === re.RIGHT && (h.left = u + 1), {
2173
- ...d,
2171
+ const h = { ...l }, { left: u = 0, top: m = 0 } = l;
2172
+ return s === ve.UP ? h.top = m - 1 : s === ve.DOWN ? h.top = m + 1 : s === ve.LEFT ? h.left = u - 1 : s === ve.RIGHT && (h.left = u + 1), {
2173
+ ...a,
2174
2174
  transform: h,
2175
- sheetTransform: j(h, r)
2175
+ sheetTransform: $(h, r)
2176
2176
  };
2177
- }).filter((d) => d != null);
2178
- return n.syncExecuteCommand(tt.id, {
2179
- unitId: a,
2180
- drawings: l
2181
- }) ? (n.syncExecuteCommand(W.id, [a]), !0) : !1;
2182
- }
2183
- }, Tn = "addition-and-subtraction-single", Pn = "sheet.menu.image";
2184
- function ds(i) {
2177
+ }).filter((a) => a != null);
2178
+ return n.syncExecuteCommand(Lt.id, {
2179
+ unitId: c,
2180
+ drawings: d
2181
+ }) ? (n.syncExecuteCommand(k.id, [c]), !0) : !1;
2182
+ }
2183
+ }, vr = "addition-and-subtraction-single", Sr = "sheet.menu.image";
2184
+ function Ks(i) {
2185
2185
  return {
2186
- id: Pn,
2187
- type: vt.SUBITEMS,
2188
- icon: Tn,
2186
+ id: Sr,
2187
+ type: an.SUBITEMS,
2188
+ icon: vr,
2189
2189
  tooltip: "sheetImage.title",
2190
- hidden$: zt(i, F.UNIVER_SHEET),
2191
- disabled$: jr(i, { workbookTypes: [ht], worksheetTypes: [$e], rangeTypes: [ci] })
2190
+ hidden$: xn(i, G.UNIVER_SHEET),
2191
+ disabled$: Ci(i, { workbookTypes: [Qt], worksheetTypes: [Dt], rangeTypes: [Hi] })
2192
2192
  };
2193
2193
  }
2194
- function ls(i) {
2194
+ function Js(i) {
2195
2195
  return {
2196
- id: It.id,
2196
+ id: dn.id,
2197
2197
  title: "sheetImage.upload.float",
2198
- type: vt.BUTTON,
2199
- hidden$: zt(i, F.UNIVER_SHEET)
2198
+ type: an.BUTTON,
2199
+ hidden$: xn(i, G.UNIVER_SHEET)
2200
2200
  };
2201
2201
  }
2202
- function us(i) {
2202
+ function Zs(i) {
2203
2203
  return {
2204
- id: Ct.id,
2204
+ id: ln.id,
2205
2205
  title: "sheetImage.upload.cell",
2206
- type: vt.BUTTON
2206
+ type: an.BUTTON
2207
2207
  };
2208
2208
  }
2209
- const hs = "univer-image-common-panel", gs = "univer-image-common-panel-grid", ms = "univer-image-common-panel-border", fs = "univer-image-common-panel-title", ps = "univer-image-common-panel-subtitle", _s = "univer-image-common-panel-row", ws = "univer-image-common-panel-row-vertical", vs = "univer-image-common-panel-column", Ss = "univer-image-common-panel-column-center", Is = "univer-image-common-panel-inline", Cs = "univer-image-common-panel-span2", Rs = "univer-image-common-panel-span3", Ms = "univer-image-common-panel-input", bs = "univer-sheet-image-menu", Ds = "univer-sheet-image-menu-input", ne = {
2210
- imageCommonPanel: hs,
2211
- imageCommonPanelGrid: gs,
2212
- imageCommonPanelBorder: ms,
2213
- imageCommonPanelTitle: fs,
2214
- imageCommonPanelSubtitle: ps,
2215
- imageCommonPanelRow: _s,
2216
- imageCommonPanelRowVertical: ws,
2217
- imageCommonPanelColumn: vs,
2218
- imageCommonPanelColumnCenter: Ss,
2219
- imageCommonPanelInline: Is,
2220
- imageCommonPanelSpan2: Cs,
2221
- imageCommonPanelSpan3: Rs,
2222
- imageCommonPanelInput: Ms,
2223
- sheetImageMenu: bs,
2224
- sheetImageMenuInput: Ds
2209
+ const qs = "univer-image-common-panel", Qs = "univer-image-common-panel-grid", eo = "univer-image-common-panel-border", to = "univer-image-common-panel-title", no = "univer-image-common-panel-subtitle", ro = "univer-image-common-panel-row", io = "univer-image-common-panel-row-vertical", so = "univer-image-common-panel-column", oo = "univer-image-common-panel-column-center", ao = "univer-image-common-panel-inline", co = "univer-image-common-panel-span2", lo = "univer-image-common-panel-span3", uo = "univer-image-common-panel-input", ho = "univer-sheet-image-menu", go = "univer-sheet-image-menu-input", _e = {
2210
+ imageCommonPanel: qs,
2211
+ imageCommonPanelGrid: Qs,
2212
+ imageCommonPanelBorder: eo,
2213
+ imageCommonPanelTitle: to,
2214
+ imageCommonPanelSubtitle: no,
2215
+ imageCommonPanelRow: ro,
2216
+ imageCommonPanelRowVertical: io,
2217
+ imageCommonPanelColumn: so,
2218
+ imageCommonPanelColumnCenter: oo,
2219
+ imageCommonPanelInline: ao,
2220
+ imageCommonPanelSpan2: co,
2221
+ imageCommonPanelSpan3: lo,
2222
+ imageCommonPanelInput: uo,
2223
+ sheetImageMenu: ho,
2224
+ sheetImageMenuInput: go
2225
2225
  };
2226
- function Un(i) {
2226
+ function Ir(i) {
2227
2227
  var e, n, t = "";
2228
2228
  if (typeof i == "string" || typeof i == "number") t += i;
2229
2229
  else if (typeof i == "object") if (Array.isArray(i)) {
2230
2230
  var r = i.length;
2231
- for (e = 0; e < r; e++) i[e] && (n = Un(i[e])) && (t && (t += " "), t += n);
2231
+ for (e = 0; e < r; e++) i[e] && (n = Ir(i[e])) && (t && (t += " "), t += n);
2232
2232
  } else for (n in i) i[n] && (t && (t += " "), t += n);
2233
2233
  return t;
2234
2234
  }
2235
- function We() {
2236
- for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e = Un(i)) && (t && (t += " "), t += e);
2235
+ function It() {
2236
+ for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e = Ir(i)) && (t && (t += " "), t += e);
2237
2237
  return t;
2238
2238
  }
2239
- const ys = (i) => {
2240
- var S;
2241
- const e = le(B), n = le(Je), t = le(Q), r = le(X), { drawings: s } = i, o = s[0];
2239
+ const mo = (i) => {
2240
+ var I;
2241
+ const e = Me(X), n = Me(Wt), t = Me(de), r = Me(Q), { drawings: s } = i, o = s[0];
2242
2242
  if (o == null)
2243
2243
  return;
2244
- const { unitId: a } = o, l = r.getRenderById(a), g = l == null ? void 0 : l.scene;
2244
+ const { unitId: c } = o, d = r.getRenderById(c), g = d == null ? void 0 : d.scene;
2245
2245
  if (g == null)
2246
2246
  return;
2247
- const d = g.getTransformerByCreate(), [c, h] = ft(!0), u = (S = o.anchorType) != null ? S : y.Position, [m, f] = ft(u);
2248
- function p(M, w) {
2249
- const C = [];
2250
- return M.forEach((_) => {
2251
- const { oKey: T } = _, D = w.getDrawingOKey(T);
2252
- if (D == null)
2253
- return C.push(null), !0;
2254
- const { unitId: N, subUnitId: A, drawingId: b, drawingType: R, anchorType: P, sheetTransform: x } = D;
2255
- C.push({
2256
- unitId: N,
2257
- subUnitId: A,
2247
+ const a = g.getTransformerByCreate(), [l, h] = nn(!0), u = (I = o.anchorType) != null ? I : O.Position, [m, p] = nn(u);
2248
+ function f(D, v) {
2249
+ const R = [];
2250
+ return D.forEach((_) => {
2251
+ const { oKey: E } = _, M = v.getDrawingOKey(E);
2252
+ if (M == null)
2253
+ return R.push(null), !0;
2254
+ const { unitId: A, subUnitId: T, drawingId: b, drawingType: C, anchorType: y, sheetTransform: W } = M;
2255
+ R.push({
2256
+ unitId: A,
2257
+ subUnitId: T,
2258
2258
  drawingId: b,
2259
- anchorType: P,
2260
- sheetTransform: x,
2261
- drawingType: R
2259
+ anchorType: y,
2260
+ sheetTransform: W,
2261
+ drawingType: C
2262
2262
  });
2263
- }), C;
2264
- }
2265
- St(() => {
2266
- const M = d.clearControl$.subscribe((C) => {
2267
- C === !0 && h(!1);
2268
- }), w = d.changeStart$.subscribe((C) => {
2269
- var D;
2270
- const { objects: _ } = C, T = p(_, t);
2271
- if (T.length === 0)
2263
+ }), R;
2264
+ }
2265
+ cn(() => {
2266
+ const D = a.clearControl$.subscribe((R) => {
2267
+ R === !0 && h(!1);
2268
+ }), v = a.changeStart$.subscribe((R) => {
2269
+ var M;
2270
+ const { objects: _ } = R, E = f(_, t);
2271
+ if (E.length === 0)
2272
2272
  h(!1);
2273
- else if (T.length >= 1) {
2273
+ else if (E.length >= 1) {
2274
2274
  h(!0);
2275
- const N = ((D = T[0]) == null ? void 0 : D.anchorType) || y.Position;
2276
- f(N);
2275
+ const A = ((M = E[0]) == null ? void 0 : M.anchorType) || O.Position;
2276
+ p(A);
2277
2277
  }
2278
2278
  });
2279
2279
  return () => {
2280
- w.unsubscribe(), M.unsubscribe();
2280
+ v.unsubscribe(), D.unsubscribe();
2281
2281
  };
2282
2282
  }, []);
2283
- function v(M) {
2284
- f(M);
2285
- const w = t.getFocusDrawings();
2286
- if (w.length === 0)
2283
+ function w(D) {
2284
+ p(D);
2285
+ const v = t.getFocusDrawings();
2286
+ if (v.length === 0)
2287
2287
  return;
2288
- const C = w.map((_) => ({
2288
+ const R = v.map((_) => ({
2289
2289
  unitId: _.unitId,
2290
2290
  subUnitId: _.subUnitId,
2291
2291
  drawingId: _.drawingId,
2292
- anchorType: M
2292
+ anchorType: D
2293
2293
  }));
2294
- e.executeCommand(tt.id, {
2295
- unitId: w[0].unitId,
2296
- drawings: C
2294
+ e.executeCommand(Lt.id, {
2295
+ unitId: v[0].unitId,
2296
+ drawings: R
2297
2297
  });
2298
2298
  }
2299
- const I = (M) => M ? "block" : "none";
2300
- return /* @__PURE__ */ $.jsxs("div", { className: We(ne.imageCommonPanelGrid, ne.imageCommonPanelBorder), style: { display: I(c) }, children: [
2301
- /* @__PURE__ */ $.jsx("div", { className: ne.imageCommonPanelRow, children: /* @__PURE__ */ $.jsx("div", { className: We(ne.imageCommonPanelColumn, ne.imageCommonPanelTitle), children: /* @__PURE__ */ $.jsx("div", { children: n.t("drawing-anchor.title") }) }) }),
2302
- /* @__PURE__ */ $.jsx("div", { className: We(ne.imageCommonPanelRow), children: /* @__PURE__ */ $.jsx("div", { className: We(ne.imageCommonPanelColumn), children: /* @__PURE__ */ $.jsxs(gi, { value: m, onChange: v, direction: "vertical", children: [
2303
- /* @__PURE__ */ $.jsx(at, { value: y.Both, children: n.t("drawing-anchor.both") }),
2304
- /* @__PURE__ */ $.jsx(at, { value: y.Position, children: n.t("drawing-anchor.position") }),
2305
- /* @__PURE__ */ $.jsx(at, { value: y.None, children: n.t("drawing-anchor.none") })
2299
+ const S = (D) => D ? "block" : "none";
2300
+ return /* @__PURE__ */ F.jsxs("div", { className: It(_e.imageCommonPanelGrid, _e.imageCommonPanelBorder), style: { display: S(l) }, children: [
2301
+ /* @__PURE__ */ F.jsx("div", { className: _e.imageCommonPanelRow, children: /* @__PURE__ */ F.jsx("div", { className: It(_e.imageCommonPanelColumn, _e.imageCommonPanelTitle), children: /* @__PURE__ */ F.jsx("div", { children: n.t("drawing-anchor.title") }) }) }),
2302
+ /* @__PURE__ */ F.jsx("div", { className: It(_e.imageCommonPanelRow), children: /* @__PURE__ */ F.jsx("div", { className: It(_e.imageCommonPanelColumn), children: /* @__PURE__ */ F.jsxs(Qi, { value: m, onChange: w, direction: "vertical", children: [
2303
+ /* @__PURE__ */ F.jsx(Kt, { value: O.Both, children: n.t("drawing-anchor.both") }),
2304
+ /* @__PURE__ */ F.jsx(Kt, { value: O.Position, children: n.t("drawing-anchor.position") }),
2305
+ /* @__PURE__ */ F.jsx(Kt, { value: O.None, children: n.t("drawing-anchor.none") })
2306
2306
  ] }) }) })
2307
2307
  ] });
2308
- }, Os = () => {
2309
- const i = le(Q), e = i.getFocusDrawings(), [n, t] = ft(e);
2310
- return St(() => {
2308
+ }, fo = () => {
2309
+ const i = Me(de), e = i.getFocusDrawings(), [n, t] = nn(e);
2310
+ return cn(() => {
2311
2311
  const r = i.focus$.subscribe((s) => {
2312
2312
  t(s);
2313
2313
  });
2314
2314
  return () => {
2315
2315
  r.unsubscribe();
2316
2316
  };
2317
- }, []), !!(n != null && n.length) && /* @__PURE__ */ $.jsxs("div", { className: ne.imageCommonPanel, children: [
2318
- /* @__PURE__ */ $.jsx(Sr, { drawings: n }),
2319
- /* @__PURE__ */ $.jsx(ys, { drawings: n })
2317
+ }, []), !!(n != null && n.length) && /* @__PURE__ */ F.jsxs("div", { className: _e.imageCommonPanel, children: [
2318
+ /* @__PURE__ */ F.jsx(di, { drawings: n }),
2319
+ /* @__PURE__ */ F.jsx(mo, { drawings: n })
2320
2320
  ] });
2321
- }, Es = {
2322
- [Fr.FORMULAS_INSERT]: {
2323
- [Pn]: {
2321
+ }, po = {
2322
+ [Ei.FORMULAS_INSERT]: {
2323
+ [Sr]: {
2324
2324
  order: 3,
2325
- menuItemFactory: ds,
2326
- [It.id]: {
2325
+ menuItemFactory: Ks,
2326
+ [dn.id]: {
2327
2327
  order: 0,
2328
- menuItemFactory: ls
2328
+ menuItemFactory: Js
2329
2329
  },
2330
- [Ct.id]: {
2330
+ [ln.id]: {
2331
2331
  order: 1,
2332
- menuItemFactory: us
2332
+ menuItemFactory: Zs
2333
2333
  }
2334
2334
  }
2335
2335
  }
2336
2336
  };
2337
- function Me(i) {
2338
- return !i.getContextValue(er) && !i.getContextValue(tr) && !i.getContextValue(nr) && i.getContextValue(ge);
2337
+ function qe(i) {
2338
+ return !i.getContextValue(Xr) && !i.getContextValue(Vr) && !i.getContextValue(Hr) && i.getContextValue(xe);
2339
2339
  }
2340
- const Ts = {
2341
- id: Re.id,
2340
+ const wo = {
2341
+ id: Ze.id,
2342
2342
  description: "shortcut.sheet.drawing-move-down",
2343
2343
  group: "4_sheet-drawing-view",
2344
- binding: me.ARROW_DOWN,
2344
+ binding: Be.ARROW_DOWN,
2345
2345
  priority: 100,
2346
- preconditions: Me,
2346
+ preconditions: qe,
2347
2347
  staticParameters: {
2348
- direction: re.DOWN
2348
+ direction: ve.DOWN
2349
2349
  }
2350
- }, Ps = {
2351
- id: Re.id,
2350
+ }, _o = {
2351
+ id: Ze.id,
2352
2352
  description: "shortcut.sheet.drawing-move-up",
2353
2353
  group: "4_sheet-drawing-view",
2354
- binding: me.ARROW_UP,
2354
+ binding: Be.ARROW_UP,
2355
2355
  priority: 100,
2356
- preconditions: Me,
2356
+ preconditions: qe,
2357
2357
  staticParameters: {
2358
- direction: re.UP
2358
+ direction: ve.UP
2359
2359
  }
2360
- }, Us = {
2361
- id: Re.id,
2360
+ }, vo = {
2361
+ id: Ze.id,
2362
2362
  description: "shortcut.sheet.drawing-move-left",
2363
2363
  group: "4_sheet-drawing-view",
2364
- binding: me.ARROW_LEFT,
2364
+ binding: Be.ARROW_LEFT,
2365
2365
  priority: 100,
2366
- preconditions: Me,
2366
+ preconditions: qe,
2367
2367
  staticParameters: {
2368
- direction: re.LEFT
2368
+ direction: ve.LEFT
2369
2369
  }
2370
- }, As = {
2371
- id: Re.id,
2370
+ }, So = {
2371
+ id: Ze.id,
2372
2372
  description: "shortcut.sheet.drawing-move-right",
2373
2373
  group: "4_sheet-drawing-view",
2374
- binding: me.ARROW_RIGHT,
2374
+ binding: Be.ARROW_RIGHT,
2375
2375
  priority: 100,
2376
- preconditions: Me,
2376
+ preconditions: qe,
2377
2377
  staticParameters: {
2378
- direction: re.RIGHT
2378
+ direction: ve.RIGHT
2379
2379
  }
2380
- }, Ns = {
2381
- id: En.id,
2380
+ }, Io = {
2381
+ id: _r.id,
2382
2382
  description: "shortcut.sheet.drawing-delete",
2383
2383
  group: "4_sheet-drawing-view",
2384
2384
  // when focusing on any other input tag do not trigger this shortcut
2385
- preconditions: Me,
2386
- binding: me.DELETE,
2387
- mac: me.BACKSPACE
2385
+ preconditions: qe,
2386
+ binding: Be.DELETE,
2387
+ mac: Be.BACKSPACE
2388
2388
  };
2389
- var js = Object.defineProperty, Ws = Object.getOwnPropertyDescriptor, xs = (i, e, n, t) => {
2390
- for (var r = t > 1 ? void 0 : t ? Ws(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2389
+ var Co = Object.defineProperty, bo = Object.getOwnPropertyDescriptor, Ro = (i, e, n, t) => {
2390
+ for (var r = t > 1 ? void 0 : t ? bo(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2391
2391
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
2392
- return t && r && js(e, n, r), r;
2393
- }, xe = (i, e) => (n, t) => e(n, t, i);
2394
- let Xe = class extends q {
2392
+ return t && r && Co(e, n, r), r;
2393
+ }, Ct = (i, e) => (n, t) => e(n, t, i);
2394
+ let At = class extends ae {
2395
2395
  constructor(i, e, n, t) {
2396
2396
  super(), this._componentManager = i, this._menuManagerService = e, this._commandService = n, this._shortcutService = t, this._init();
2397
2397
  }
2398
2398
  _initCustomComponents() {
2399
2399
  const i = this._componentManager;
2400
- this.disposeWithMe(i.register(Tn, On)), this.disposeWithMe(i.register(vn, Os));
2400
+ this.disposeWithMe(i.register(vr, wr)), this.disposeWithMe(i.register(cr, fo));
2401
2401
  }
2402
2402
  _initMenus() {
2403
- this._menuManagerService.mergeMenu(Es);
2403
+ this._menuManagerService.mergeMenu(po);
2404
2404
  }
2405
2405
  _initCommands() {
2406
2406
  [
2407
- It,
2408
- Ct,
2409
- et,
2410
- Qe,
2411
- tt,
2412
- Sn,
2413
- W,
2414
- In,
2415
- Cn,
2416
- Mn,
2417
- Re,
2418
- En,
2419
- Rn
2407
+ dn,
2408
+ ln,
2409
+ kt,
2410
+ $t,
2411
+ Lt,
2412
+ dr,
2413
+ k,
2414
+ lr,
2415
+ ur,
2416
+ gr,
2417
+ Ze,
2418
+ _r,
2419
+ hr
2420
2420
  ].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
2421
2421
  }
2422
2422
  _initShortcuts() {
2423
2423
  [
2424
2424
  // sheet drawing shortcuts
2425
- Ts,
2426
- Ps,
2427
- Us,
2428
- As,
2429
- Ns
2425
+ wo,
2426
+ _o,
2427
+ vo,
2428
+ So,
2429
+ Io
2430
2430
  ].forEach((i) => {
2431
2431
  this.disposeWithMe(this._shortcutService.registerShortcut(i));
2432
2432
  });
@@ -2435,88 +2435,102 @@ let Xe = class extends q {
2435
2435
  this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
2436
2436
  }
2437
2437
  };
2438
- Xe = xs([
2439
- xe(0, U(Vr)),
2440
- xe(1, kr),
2441
- xe(2, B),
2442
- xe(3, Hr)
2443
- ], Xe);
2444
- var $s = Object.defineProperty, Bs = Object.getOwnPropertyDescriptor, Ls = (i, e, n, t) => {
2445
- for (var r = t > 1 ? void 0 : t ? Bs(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2438
+ At = Ro([
2439
+ Ct(0, N(Ti)),
2440
+ Ct(1, Pi),
2441
+ Ct(2, X),
2442
+ Ct(3, Ui)
2443
+ ], At);
2444
+ var Do = Object.defineProperty, Mo = Object.getOwnPropertyDescriptor, yo = (i, e, n, t) => {
2445
+ for (var r = t > 1 ? void 0 : t ? Mo(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2446
2446
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
2447
- return t && r && $s(e, n, r), r;
2448
- }, de = (i, e) => (n, t) => e(n, t, i);
2449
- function Gs(i, e, n, t) {
2450
- const { scaleX: r, scaleY: s } = e.getAncestorScale(), o = e.getViewport(Yt.VIEW_MAIN), a = {
2447
+ return t && r && Do(e, n, r), r;
2448
+ }, De = (i, e) => (n, t) => e(n, t, i);
2449
+ function Oo(i, e, n, t, r) {
2450
+ const { scaleX: s, scaleY: o } = e.getAncestorScale(), c = e.getViewport(jn.VIEW_MAIN), d = {
2451
2451
  left: !0,
2452
2452
  top: !0
2453
2453
  };
2454
- if (!o)
2454
+ if (!c)
2455
2455
  return {
2456
2456
  ...i,
2457
- absolute: a
2457
+ absolute: d
2458
2458
  };
2459
- const { left: l, right: g, top: d, bottom: c } = i, h = t.getFreeze(), { startColumn: u, startRow: m, xSplit: f, ySplit: p } = h, v = n.getNoMergeCellPositionByIndexWithNoHeader(m - p, u - f), I = n.getNoMergeCellPositionByIndexWithNoHeader(m, u), { rowHeaderWidth: S, columnHeaderHeight: M } = n, w = I.startX - v.startX, C = I.startY - v.startY, { top: _, left: T, viewportScrollX: D, viewportScrollY: N } = o;
2460
- let A, b;
2461
- l < T ? (a.left = !0, A = (w + S + (l - T)) * r, b = Math.max(
2459
+ const { left: g, right: a, top: l, bottom: h } = i;
2460
+ let { top: u, left: m, viewportScrollX: p, viewportScrollY: f } = c;
2461
+ const { boundsOfViewArea: w, scrollDirectionResponse: S } = r || {};
2462
+ w && (ye.isDefine(w.top) && (u = w.top), ye.isDefine(w.left) && (m = w.left)), S === "HORIZONTAL" && (f = 0), S === "VERTICAL" && (p = 0);
2463
+ let I, D;
2464
+ g < m ? (d.left = !0, I = (m + (g - m)) * s, D = Math.max(
2462
2465
  Math.min(
2463
- (w + S + (g - T)) * r,
2464
- (w + S) * r
2466
+ (m + (a - m)) * s,
2467
+ m * s
2465
2468
  ),
2466
- (g - D) * r
2467
- )) : (a.left = !1, A = Math.max((l - D) * r, (w + S) * r), b = Math.max((g - D) * r, (w + S) * r));
2468
- let R, P;
2469
- return d < _ ? (a.top = !0, R = (C + M + (d - _)) * s, P = Math.max(
2469
+ (a - p) * s
2470
+ )) : (d.left = !1, I = Math.max((g - p) * s, m * s), D = Math.max((a - p) * s, m * s));
2471
+ let v, R;
2472
+ return l < u ? (d.top = !0, v = (u + (l - u)) * o, R = Math.max(
2470
2473
  Math.min(
2471
- (C + M + (g - _)) * s,
2472
- (C + M) * s
2474
+ (u + (a - u)) * o,
2475
+ u * o
2473
2476
  ),
2474
- (c - N) * s
2475
- )) : (a.top = !1, R = Math.max((d - N) * s, (C + M) * s), P = Math.max((c - N) * s, (C + M) * s)), {
2476
- left: A,
2477
- right: b,
2478
- top: R,
2479
- bottom: P,
2480
- absolute: a
2477
+ (h - f) * o
2478
+ )) : (d.top = !1, v = Math.max((l - f) * o, u * o), R = Math.max((h - f) * o, u * o)), {
2479
+ left: I,
2480
+ right: D,
2481
+ top: v,
2482
+ bottom: R,
2483
+ absolute: d
2481
2484
  };
2482
2485
  }
2483
- const lt = (i, e, n, t) => {
2484
- const { scene: r } = e, { left: s, top: o, width: a, height: l, angle: g } = i, d = {
2485
- left: s,
2486
- right: s + a,
2487
- top: o,
2488
- bottom: o + l
2489
- }, c = Gs(d, r, n, t), { scaleX: h, scaleY: u } = r.getAncestorScale();
2486
+ const me = (i, e, n, t, r) => {
2487
+ const { scene: s } = e, { left: o, top: c, width: d, height: g, angle: a } = i, l = {
2488
+ left: o,
2489
+ right: o + d,
2490
+ top: c,
2491
+ bottom: c + g
2492
+ }, h = Oo(l, s, n, t, r), { scaleX: u, scaleY: m } = s.getAncestorScale();
2490
2493
  return {
2491
- startX: c.left,
2492
- endX: c.right,
2493
- startY: c.top,
2494
- endY: c.bottom,
2495
- rotate: g,
2496
- width: a * h,
2497
- height: l * u,
2498
- absolute: c.absolute
2494
+ startX: h.left,
2495
+ endX: h.right,
2496
+ startY: h.top,
2497
+ endY: h.bottom,
2498
+ rotate: a,
2499
+ width: d * u,
2500
+ height: g * m,
2501
+ absolute: h.absolute
2499
2502
  };
2500
2503
  };
2501
- let ze = class extends q {
2502
- constructor(e, n, t, r, s, o, a) {
2504
+ let Nt = class extends ae {
2505
+ constructor(e, n, t, r, s, o, c) {
2503
2506
  super();
2504
- V(this, "_domLayerMap", /* @__PURE__ */ new Map());
2505
- V(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
2506
- V(this, "_transformChange$", new st());
2507
- V(this, "transformChange$", this._transformChange$.asObservable());
2508
- V(this, "_add$", new st());
2509
- V(this, "add$", this._add$.asObservable());
2510
- V(this, "_remove$", new st());
2511
- V(this, "remove$", this._remove$.asObservable());
2512
- V(this, "_hooks", []);
2513
- this._renderManagerService = e, this._univerInstanceService = n, this._commandService = t, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = a, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
2507
+ /**
2508
+ * for update dom container position when scrolling and zoom
2509
+ */
2510
+ J(this, "_domLayerMap", /* @__PURE__ */ new Map());
2511
+ /**
2512
+ * for update dom container position when scrolling and zoom
2513
+ */
2514
+ J(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
2515
+ J(this, "_transformChange$", new Ht());
2516
+ J(this, "transformChange$", this._transformChange$.asObservable());
2517
+ J(this, "_add$", new Ht());
2518
+ J(this, "add$", this._add$.asObservable());
2519
+ J(this, "_remove$", new Ht());
2520
+ J(this, "remove$", this._remove$.asObservable());
2521
+ J(this, "_hooks", []);
2522
+ this._renderManagerService = e, this._univerInstanceService = n, this._commandService = t, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = c, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
2514
2523
  }
2515
2524
  _bindScrollEvent() {
2516
- this._lifecycleService.lifecycle$.pipe(ie((e) => e === ir.Rendered), Xr(1)).subscribe(() => {
2525
+ this._lifecycleService.lifecycle$.pipe(Se((e) => e === Kr.Rendered), Ni(1)).subscribe(() => {
2517
2526
  this._scrollUpdateListener();
2518
2527
  });
2519
2528
  }
2529
+ /**
2530
+ * For scrolling and zoom
2531
+ * @param unitId
2532
+ * @param subUnitId
2533
+ */
2520
2534
  _ensureMap(e, n) {
2521
2535
  let t = this._domLayerMap.get(e);
2522
2536
  t || (t = /* @__PURE__ */ new Map(), this._domLayerMap.set(e, t));
@@ -2533,7 +2547,7 @@ let ze = class extends q {
2533
2547
  if (n == null || t == null)
2534
2548
  return null;
2535
2549
  const r = t.getTransformerByCreate(), s = n.engine.getCanvasElement();
2536
- return { scene: t, transformer: r, renderObject: n, canvas: s };
2550
+ return { scene: t, transformer: r, renderUnit: n, canvas: s };
2537
2551
  }
2538
2552
  _getFloatDomProps(e) {
2539
2553
  let n;
@@ -2541,99 +2555,97 @@ let ze = class extends q {
2541
2555
  n = t.onGetFloatDomProps(e);
2542
2556
  }), n;
2543
2557
  }
2544
- // eslint-disable-next-line max-lines-per-function
2545
2558
  _drawingAddListener() {
2546
2559
  this.disposeWithMe(
2547
- // eslint-disable-next-line max-lines-per-function
2548
2560
  this._drawingManagerService.add$.subscribe((e) => {
2549
2561
  e.forEach((n) => {
2550
- var Mt, bt, Dt;
2551
- const { unitId: t, subUnitId: r, drawingId: s } = n, o = H(this._univerInstanceService, { unitId: t, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(n), l = this._univerInstanceService.getUnit(t, F.UNIVER_SHEET);
2552
- if (!l)
2562
+ var ie, se, K;
2563
+ const { unitId: t, subUnitId: r, drawingId: s } = n, o = Y(this._univerInstanceService, { unitId: t, subUnitId: r }), c = this._drawingManagerService.getDrawingByParam(n), d = this._univerInstanceService.getUnit(t, G.UNIVER_SHEET);
2564
+ if (!d)
2553
2565
  return;
2554
- const g = l.getActiveSheet().getSheetId();
2555
- if (!a || !o)
2566
+ const g = d.getActiveSheet().getSheetId();
2567
+ if (!c || !o)
2556
2568
  return;
2557
- const d = (Mt = this._renderManagerService.getRenderById(t)) == null ? void 0 : Mt.with(Z).getWorksheetSkeleton(r);
2558
- if (!d)
2569
+ const a = (ie = this._renderManagerService.getRenderById(t)) == null ? void 0 : ie.with(H).getWorksheetSkeleton(r);
2570
+ if (!a)
2559
2571
  return;
2560
- const { transform: c, drawingType: h, data: u } = a;
2561
- if (h !== k.DRAWING_DOM && h !== k.DRAWING_CHART)
2572
+ const { transform: l, drawingType: h, data: u } = c;
2573
+ if (h !== L.DRAWING_DOM && h !== L.DRAWING_CHART)
2562
2574
  return;
2563
2575
  const m = this._getSceneAndTransformerByDrawingSearch(t);
2564
2576
  if (m == null)
2565
2577
  return;
2566
- const { scene: f, canvas: p } = m;
2567
- if (c == null)
2578
+ const { scene: p, canvas: f } = m;
2579
+ if (l == null)
2568
2580
  return !0;
2569
2581
  if (g !== r)
2570
2582
  return;
2571
- const { left: v, top: I, width: S, height: M, angle: w, flipX: C, flipY: _, skewX: T, skewY: D } = c, N = it({ unitId: t, subUnitId: r, drawingId: s }), A = f.getObject(N);
2572
- if (A != null) {
2573
- A.transformByState({ left: v, top: I, width: S, height: M, angle: w, flipX: C, flipY: _, skewX: T, skewY: D });
2583
+ const { left: w, top: S, width: I, height: D, angle: v, flipX: R, flipY: _, skewX: E, skewY: M } = l, A = Ce({ unitId: t, subUnitId: r, drawingId: s }), T = p.getObject(A);
2584
+ if (T != null) {
2585
+ T.transformByState({ left: w, top: S, width: I, height: D, angle: v, flipX: R, flipY: _, skewX: E, skewY: M });
2574
2586
  return;
2575
2587
  }
2576
2588
  const b = {
2577
- left: v,
2578
- top: I,
2579
- width: S,
2580
- height: M,
2589
+ left: w,
2590
+ top: S,
2591
+ width: I,
2592
+ height: D,
2581
2593
  zIndex: this._drawingManagerService.getDrawingOrder(t, r).length - 1
2582
- }, R = h === k.DRAWING_CHART;
2583
- if (R) {
2584
- const G = u ? u.backgroundColor : "white";
2585
- b.fill = G, b.rotateEnabled = !1, u && u.border && (b.stroke = u.border), b.paintFirst = "stroke", b.strokeWidth = 1, b.borderEnabled = !1, b.radius = 8;
2594
+ }, C = h === L.DRAWING_CHART;
2595
+ if (C) {
2596
+ const B = u ? u.backgroundColor : "white";
2597
+ b.fill = B, b.rotateEnabled = !1, u && u.border && (b.stroke = u.border), b.paintFirst = "stroke", b.strokeWidth = 1, b.borderEnabled = !1, b.radius = 8;
2586
2598
  }
2587
- const P = new At(N, b);
2588
- R && P.setObjectType(Mr.CHART), f.addObject(P, br), a.allowTransform !== !1 && f.attachTransformerTo(P);
2589
- const x = this._ensureMap(t, r), se = new sr(), oe = lt(P, m.renderObject, d.skeleton, o.worksheet), nt = new zr(oe), jn = {
2590
- dispose: se,
2591
- rect: P,
2592
- position$: nt,
2599
+ const y = new We(A, b);
2600
+ C && y.setObjectType(In.CHART), p.addObject(y, Vt), c.allowTransform !== !1 && p.attachTransformerTo(y);
2601
+ const W = this._ensureMap(t, r), z = new ht(), Z = me(y, m.renderUnit, a.skeleton, o.worksheet), ce = new Ye(Z), Ie = {
2602
+ dispose: z,
2603
+ rect: y,
2604
+ position$: ce,
2593
2605
  unitId: t,
2594
2606
  subUnitId: r
2595
2607
  };
2596
2608
  this._canvasFloatDomService.addFloatDom({
2597
- position$: nt,
2609
+ position$: ce,
2598
2610
  id: s,
2599
- componentKey: a.componentKey,
2600
- onPointerDown: (G) => {
2601
- p.dispatchEvent(new PointerEvent(G.type, G));
2611
+ componentKey: c.componentKey,
2612
+ onPointerDown: (B) => {
2613
+ f.dispatchEvent(new PointerEvent(B.type, B));
2602
2614
  },
2603
- onPointerMove: (G) => {
2604
- p.dispatchEvent(new PointerEvent(G.type, G));
2615
+ onPointerMove: (B) => {
2616
+ f.dispatchEvent(new PointerEvent(B.type, B));
2605
2617
  },
2606
- onPointerUp: (G) => {
2607
- p.dispatchEvent(new PointerEvent(G.type, G));
2618
+ onPointerUp: (B) => {
2619
+ f.dispatchEvent(new PointerEvent(B.type, B));
2608
2620
  },
2609
- onWheel: (G) => {
2610
- p.dispatchEvent(new WheelEvent(G.type, G));
2621
+ onWheel: (B) => {
2622
+ f.dispatchEvent(new WheelEvent(B.type, B));
2611
2623
  },
2612
- props: (Dt = (bt = x.get(s)) == null ? void 0 : bt.props) != null ? Dt : this._getFloatDomProps(s),
2624
+ props: (K = (se = W.get(s)) == null ? void 0 : se.props) != null ? K : this._getFloatDomProps(s),
2613
2625
  data: u,
2614
2626
  unitId: t
2615
2627
  });
2616
- const Rt = P.onTransformChange$.subscribeEvent(() => {
2617
- const G = lt(P, m.renderObject, d.skeleton, o.worksheet);
2618
- nt.next(
2619
- G
2628
+ const le = y.onTransformChange$.subscribeEvent(() => {
2629
+ const B = me(y, m.renderUnit, a.skeleton, o.worksheet);
2630
+ ce.next(
2631
+ B
2620
2632
  );
2621
2633
  });
2622
- se.add(() => {
2634
+ z.add(() => {
2623
2635
  this._canvasFloatDomService.removeFloatDom(s);
2624
- }), Rt && se.add(Rt), this._domLayerInfoMap.set(s, jn), x.set(s, {
2625
- ...x.get(s)
2636
+ }), le && z.add(le), this._domLayerInfoMap.set(s, Ie), W.set(s, {
2637
+ ...W.get(s)
2626
2638
  });
2627
2639
  });
2628
2640
  })
2629
2641
  ), this.disposeWithMe(
2630
2642
  this._drawingManagerService.remove$.subscribe((e) => {
2631
2643
  e.forEach((n) => {
2632
- const { unitId: t, subUnitId: r, drawingId: s } = n, o = it({ unitId: t, subUnitId: r, drawingId: s }), a = this._getSceneAndTransformerByDrawingSearch(t);
2633
- if (a == null)
2644
+ const { unitId: t, subUnitId: r, drawingId: s } = n, o = Ce({ unitId: t, subUnitId: r, drawingId: s }), c = this._getSceneAndTransformerByDrawingSearch(t);
2645
+ if (c == null)
2634
2646
  return;
2635
- const { transformer: l, scene: g } = a, d = g.getObject(o);
2636
- d != null && d.oKey && l.clearControlByIds([d == null ? void 0 : d.oKey]);
2647
+ const { transformer: d, scene: g } = c, a = g.getObject(o);
2648
+ a != null && a.oKey && d.clearControlByIds([a == null ? void 0 : a.oKey]);
2637
2649
  });
2638
2650
  })
2639
2651
  );
@@ -2641,39 +2653,39 @@ let ze = class extends q {
2641
2653
  _scrollUpdateListener() {
2642
2654
  const e = (n, t) => {
2643
2655
  var g;
2644
- const r = this._getSceneAndTransformerByDrawingSearch(n), s = this._ensureMap(n, t), o = Array.from(s.keys()), a = H(this._univerInstanceService, { unitId: n, subUnitId: t }), l = (g = this._renderManagerService.getRenderById(n)) == null ? void 0 : g.with(Z).getWorksheetSkeleton(t);
2645
- !r || !a || !l || o.forEach((d) => {
2646
- const c = this._domLayerInfoMap.get(d);
2647
- if (c) {
2648
- const h = lt(c.rect, r.renderObject, l.skeleton, a.worksheet);
2649
- c.position$.next(h);
2656
+ const r = this._getSceneAndTransformerByDrawingSearch(n), s = this._ensureMap(n, t), o = Array.from(s.keys()), c = Y(this._univerInstanceService, { unitId: n, subUnitId: t }), d = (g = this._renderManagerService.getRenderById(n)) == null ? void 0 : g.with(H).getWorksheetSkeleton(t);
2657
+ !r || !c || !d || o.forEach((a) => {
2658
+ const l = this._domLayerInfoMap.get(a);
2659
+ if (l) {
2660
+ const h = me(l.rect, r.renderUnit, d.skeleton, c.worksheet, l);
2661
+ l.position$.next(h);
2650
2662
  }
2651
2663
  });
2652
2664
  };
2653
2665
  this.disposeWithMe(
2654
- this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(
2655
- ie((n) => !!n),
2656
- Wt((n) => n.activeSheet$),
2657
- ie((n) => !!n),
2658
- Be((n) => {
2666
+ this._univerInstanceService.getCurrentTypeOfUnit$(G.UNIVER_SHEET).pipe(
2667
+ Se((n) => !!n),
2668
+ Dn((n) => n.activeSheet$),
2669
+ Se((n) => !!n),
2670
+ He((n) => {
2659
2671
  const t = this._renderManagerService.getRenderById(n.getUnitId());
2660
2672
  return t ? { render: t, unitId: n.getUnitId(), subUnitId: n.getSheetId() } : null;
2661
2673
  }),
2662
- ie((n) => !!n),
2663
- Wt(
2664
- (n) => or(n.render.scene.getViewport(Yt.VIEW_MAIN).onScrollAfter$).pipe(Be(() => ({ unitId: n.unitId, subUnitId: n.subUnitId })))
2674
+ Se((n) => !!n),
2675
+ Dn(
2676
+ (n) => Jr(n.render.scene.getViewport(jn.VIEW_MAIN).onScrollAfter$).pipe(He(() => ({ unitId: n.unitId, subUnitId: n.subUnitId })))
2665
2677
  )
2666
2678
  ).subscribe(({ unitId: n, subUnitId: t }) => {
2667
2679
  e(n, t);
2668
2680
  })
2669
2681
  ), this.disposeWithMe(this._commandService.onCommandExecuted((n) => {
2670
2682
  var t, r;
2671
- if (n.id === Wr.id) {
2683
+ if (n.id === bn.id) {
2672
2684
  const s = n.params, { unitId: o } = s;
2673
- Array.from((r = (t = this._domLayerMap.get(o)) == null ? void 0 : t.keys()) != null ? r : []).forEach((l) => {
2674
- e(o, l);
2685
+ Array.from((r = (t = this._domLayerMap.get(o)) == null ? void 0 : t.keys()) != null ? r : []).forEach((d) => {
2686
+ e(o, d);
2675
2687
  });
2676
- } else if (n.id === di.id) {
2688
+ } else if (n.id === zi.id) {
2677
2689
  const { unitId: s, subUnitId: o } = n.params;
2678
2690
  e(s, o);
2679
2691
  }
@@ -2681,29 +2693,29 @@ let ze = class extends q {
2681
2693
  }
2682
2694
  _getPosition(e, n) {
2683
2695
  var h;
2684
- const { startX: t, endX: r, startY: s, endY: o } = e, a = (h = this._renderManagerService.getRenderById(n)) == null ? void 0 : h.with(Ce);
2685
- if (a == null)
2686
- return;
2687
- const l = a.getCellWithCoordByOffset(t, s);
2688
- if (l == null)
2696
+ const { startX: t, endX: r, startY: s, endY: o } = e, c = (h = this._renderManagerService.getRenderById(n)) == null ? void 0 : h.with(Je);
2697
+ if (c == null)
2689
2698
  return;
2690
- const g = {
2691
- column: l.actualColumn,
2692
- columnOffset: t - l.startX,
2693
- row: l.actualRow,
2694
- rowOffset: s - l.startY
2695
- }, d = a.getCellWithCoordByOffset(r, o);
2699
+ const d = c.getCellWithCoordByOffset(t, s);
2696
2700
  if (d == null)
2697
2701
  return;
2698
- const c = {
2702
+ const g = {
2699
2703
  column: d.actualColumn,
2700
- columnOffset: r - d.startX,
2704
+ columnOffset: t - d.startX,
2701
2705
  row: d.actualRow,
2702
- rowOffset: o - d.startY
2706
+ rowOffset: s - d.startY
2707
+ }, a = c.getCellWithCoordByOffset(r, o);
2708
+ if (a == null)
2709
+ return;
2710
+ const l = {
2711
+ column: a.actualColumn,
2712
+ columnOffset: r - a.startX,
2713
+ row: a.actualRow,
2714
+ rowOffset: o - a.startY
2703
2715
  };
2704
2716
  return {
2705
2717
  from: g,
2706
- to: c
2718
+ to: l
2707
2719
  };
2708
2720
  }
2709
2721
  _featureUpdateListener() {
@@ -2711,7 +2723,7 @@ let ze = class extends q {
2711
2723
  this._drawingManagerService.update$.subscribe((e) => {
2712
2724
  e.forEach((n) => {
2713
2725
  const t = this._drawingManagerService.getDrawingByParam(n);
2714
- if (!t || t.drawingType !== k.DRAWING_DOM && t.drawingType !== k.DRAWING_CHART)
2726
+ if (!t || t.drawingType !== L.DRAWING_DOM && t.drawingType !== L.DRAWING_CHART)
2715
2727
  return;
2716
2728
  const r = {
2717
2729
  ...t.transform
@@ -2733,44 +2745,45 @@ let ze = class extends q {
2733
2745
  updateFloatDomProps(e, n, t, r) {
2734
2746
  const s = this._domLayerInfoMap.get(t), o = this._getSceneAndTransformerByDrawingSearch(e);
2735
2747
  if (s && o) {
2736
- const { scene: a } = o, l = it({ unitId: e, subUnitId: n, drawingId: t }), g = a.getObject(l);
2737
- g && g instanceof At && g.setProps(r);
2748
+ const { scene: c } = o, d = Ce({ unitId: e, subUnitId: n, drawingId: t }), g = c.getObject(d);
2749
+ g && g instanceof We && g.setProps(r);
2738
2750
  }
2739
2751
  }
2752
+ // CreateFloatDomCommand --> floatDomService.addFloatDomToPosition
2740
2753
  addFloatDomToPosition(e, n) {
2741
- const t = H(this._univerInstanceService, {
2754
+ const t = Y(this._univerInstanceService, {
2742
2755
  unitId: e.unitId,
2743
2756
  subUnitId: e.subUnitId
2744
2757
  });
2745
2758
  if (!t)
2746
2759
  throw new Error("cannot find current target!");
2747
- const { unitId: r, subUnitId: s } = t, { initPosition: o, componentKey: a, data: l, allowTransform: g = !0 } = e, d = n != null ? n : ar(), c = this._getPosition(o, r);
2748
- if (c == null)
2760
+ const { unitId: r, subUnitId: s } = t, { initPosition: o, componentKey: c, data: d, allowTransform: g = !0 } = e, a = n != null ? n : Gt(), l = this._getPosition(o, r);
2761
+ if (l == null)
2749
2762
  return;
2750
- this._ensureMap(r, s).set(d, e);
2763
+ this._ensureMap(r, s).set(a, e);
2751
2764
  const u = {
2752
2765
  unitId: r,
2753
2766
  subUnitId: s,
2754
- drawingId: d,
2755
- drawingType: e.type || k.DRAWING_DOM,
2756
- componentKey: a,
2757
- sheetTransform: c,
2767
+ drawingId: a,
2768
+ drawingType: e.type || L.DRAWING_DOM,
2769
+ componentKey: c,
2770
+ sheetTransform: l,
2758
2771
  transform: {
2759
2772
  left: o.startX,
2760
2773
  top: o.startY,
2761
2774
  width: o.endX - o.startX,
2762
2775
  height: o.endY - o.startY
2763
2776
  },
2764
- data: l,
2777
+ data: d,
2765
2778
  allowTransform: g
2766
2779
  };
2767
- return this._commandService.executeCommand(et.id, {
2780
+ return this._commandService.executeCommand(kt.id, {
2768
2781
  unitId: r,
2769
2782
  drawings: [u]
2770
- }), this._add$.next({ unitId: r, subUnitId: s, id: d }), {
2771
- id: d,
2783
+ }), this._add$.next({ unitId: r, subUnitId: s, id: a }), {
2784
+ id: a,
2772
2785
  dispose: () => {
2773
- this._removeDom(d, !0);
2786
+ this._removeDom(a, !0);
2774
2787
  }
2775
2788
  };
2776
2789
  }
@@ -2783,11 +2796,11 @@ let ze = class extends q {
2783
2796
  const o = this._getSceneAndTransformerByDrawingSearch(r);
2784
2797
  if (o && o.scene.removeObject(t.rect), n) {
2785
2798
  this._ensureMap(r, s).delete(e);
2786
- const l = this._drawingManagerService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: e });
2787
- if (!l)
2799
+ const d = this._drawingManagerService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: e });
2800
+ if (!d)
2788
2801
  return;
2789
- const g = this._sheetDrawingService.getBatchRemoveOp([l]), { redo: d, objects: c } = g;
2790
- this._commandService.syncExecuteCommand(O.id, { unitId: r, subUnitId: s, op: d, objects: c, type: E.REMOVE });
2802
+ const g = this._sheetDrawingService.getBatchRemoveOp([d]), { redo: a, objects: l } = g;
2803
+ this._commandService.syncExecuteCommand(P.id, { unitId: r, subUnitId: s, op: a, objects: l, type: U.REMOVE });
2791
2804
  }
2792
2805
  }
2793
2806
  addHook(e) {
@@ -2798,97 +2811,546 @@ let ze = class extends q {
2798
2811
  }
2799
2812
  };
2800
2813
  }
2814
+ addFloatDomToRange(e, n, t, r) {
2815
+ var _, E, M, A, T;
2816
+ const s = Y(this._univerInstanceService, {
2817
+ unitId: n.unitId,
2818
+ subUnitId: n.subUnitId
2819
+ });
2820
+ if (!s)
2821
+ throw new Error("cannot find current target!");
2822
+ const { unitId: o, subUnitId: c } = s, d = this._getSceneAndTransformerByDrawingSearch(o);
2823
+ if (!d) return;
2824
+ const g = this._renderManagerService.getRenderById(o);
2825
+ if (!g) return;
2826
+ const a = (_ = this._renderManagerService.getRenderById(o)) == null ? void 0 : _.with(H).getWorksheetSkeleton(c);
2827
+ if (!a) return;
2828
+ const { componentKey: l, data: h, allowTransform: u = !0 } = n, m = r != null ? r : Gt(), { position: p, position$: f } = this._createRangePositionObserver(e, g, a.skeleton), w = this._getPosition(p, o);
2829
+ if (w == null)
2830
+ return;
2831
+ this._ensureMap(o, c).set(m, n);
2832
+ const I = d.scene, { scaleX: D } = I.getAncestorScale(), v = bt(p, t, D), R = {
2833
+ unitId: o,
2834
+ subUnitId: c,
2835
+ drawingId: m,
2836
+ drawingType: n.type || L.DRAWING_DOM,
2837
+ componentKey: l,
2838
+ sheetTransform: w,
2839
+ transform: {
2840
+ left: v.startX,
2841
+ top: v.startY,
2842
+ width: v.width,
2843
+ height: v.height
2844
+ },
2845
+ data: h,
2846
+ allowTransform: u
2847
+ };
2848
+ {
2849
+ const { unitId: b, subUnitId: C, drawingId: y } = R, W = Y(this._univerInstanceService, { unitId: b, subUnitId: C }), z = R, Z = this._univerInstanceService.getUnit(b, G.UNIVER_SHEET);
2850
+ if (!Z)
2851
+ return;
2852
+ const ce = Z.getActiveSheet().getSheetId();
2853
+ if (!z || !W)
2854
+ return;
2855
+ const Ie = (E = this._renderManagerService.getRenderById(b)) == null ? void 0 : E.with(H);
2856
+ if (!Ie)
2857
+ return;
2858
+ const le = Ie.getWorksheetSkeleton(C);
2859
+ if (!le)
2860
+ return;
2861
+ const { transform: ie, drawingType: se, data: K } = z;
2862
+ if (se !== L.DRAWING_DOM && se !== L.DRAWING_CHART)
2863
+ return;
2864
+ const B = this._getSceneAndTransformerByDrawingSearch(b);
2865
+ if (B == null)
2866
+ return;
2867
+ const { scene: Oe, canvas: Ee } = B;
2868
+ if (ie == null || ce !== C)
2869
+ return;
2870
+ const { left: Qe, top: et, width: tt, height: nt, angle: Ft, flipX: Yt, flipY: rt, skewX: it, skewY: Te } = ie, st = Ce({ unitId: b, subUnitId: C, drawingId: y }), ue = Oe.getObject(st);
2871
+ if (ue != null) {
2872
+ ue.transformByState({ left: Qe, top: et, width: tt, height: nt, angle: Ft, flipX: Yt, flipY: rt, skewX: it, skewY: Te });
2873
+ return;
2874
+ }
2875
+ const te = {
2876
+ left: Qe,
2877
+ // from floatDomParam.transform
2878
+ top: et,
2879
+ width: tt,
2880
+ height: nt,
2881
+ zIndex: this._drawingManagerService.getDrawingOrder(b, C).length - 1
2882
+ }, Pe = se === L.DRAWING_CHART;
2883
+ if (Pe) {
2884
+ const j = K ? K.backgroundColor : "white";
2885
+ te.fill = j, te.rotateEnabled = !1, K && K.border && (te.stroke = K.border), te.paintFirst = "stroke", te.strokeWidth = 1, te.borderEnabled = !1, te.radius = 8;
2886
+ }
2887
+ const oe = new We(st, te);
2888
+ Pe && oe.setObjectType(In.CHART), Oe.addObject(oe, Vt), z.allowTransform !== !1 && Oe.attachTransformerTo(oe);
2889
+ const Le = this._ensureMap(b, C), he = new ht(), Ue = Oe.getMainViewport(), Ae = {
2890
+ top: Ue.top,
2891
+ left: Ue.left,
2892
+ bottom: Ue.bottom,
2893
+ right: Ue.right
2894
+ }, ge = {
2895
+ dispose: he,
2896
+ rect: oe,
2897
+ boundsOfViewArea: Ae,
2898
+ domAnchor: t,
2899
+ unitId: b,
2900
+ subUnitId: C
2901
+ }, ot = me(oe, B.renderUnit, le.skeleton, W.worksheet, ge), fe = new Ye(ot);
2902
+ ge.position$ = fe;
2903
+ let x = {
2904
+ position$: fe,
2905
+ id: y,
2906
+ componentKey: z.componentKey,
2907
+ onPointerDown: () => {
2908
+ },
2909
+ onPointerMove: () => {
2910
+ },
2911
+ onPointerUp: () => {
2912
+ },
2913
+ onWheel: (j) => {
2914
+ Ee.dispatchEvent(new WheelEvent(j.type, j));
2915
+ },
2916
+ props: (A = (M = Le.get(y)) == null ? void 0 : M.props) != null ? A : this._getFloatDomProps(y),
2917
+ data: K,
2918
+ unitId: b
2919
+ };
2920
+ n.eventPassThrough && (x = {
2921
+ ...x,
2922
+ onPointerDown: (j) => {
2923
+ Ee.dispatchEvent(new PointerEvent(j.type, j));
2924
+ },
2925
+ onPointerMove: (j) => {
2926
+ Ee.dispatchEvent(new PointerEvent(j.type, j));
2927
+ },
2928
+ onPointerUp: (j) => {
2929
+ Ee.dispatchEvent(new PointerEvent(j.type, j));
2930
+ }
2931
+ }), this._canvasFloatDomService.addFloatDom(x), this.disposeWithMe(f.subscribe((j) => {
2932
+ var un, hn, gn, mn;
2933
+ const ct = bt({
2934
+ rotate: 0,
2935
+ startX: j.startX,
2936
+ startY: j.startY,
2937
+ endX: j.endX,
2938
+ endY: j.endY,
2939
+ width: (un = t.width) != null ? un : j.width,
2940
+ height: (hn = t.height) != null ? hn : j.height,
2941
+ absolute: {
2942
+ left: p.absolute.left,
2943
+ top: p.absolute.top
2944
+ }
2945
+ }, t), Rr = Ce({ unitId: b, subUnitId: C, drawingId: y }), Dr = new We(Rr, {
2946
+ left: ct.startX,
2947
+ top: ct.startY,
2948
+ width: (gn = t.width) != null ? gn : j.width,
2949
+ height: (mn = t.height) != null ? mn : j.height,
2950
+ zIndex: this._drawingManagerService.getDrawingOrder(b, C).length - 1
2951
+ }), Mr = me(Dr, B.renderUnit, le.skeleton, W.worksheet, ge);
2952
+ fe.next(Mr);
2953
+ }));
2954
+ const Fe = (T = this._renderManagerService.getRenderById(b)) == null ? void 0 : T.with(H);
2955
+ Fe == null || Fe.currentSkeleton$.subscribe((j) => {
2956
+ j && a.sheetId !== j.sheetId && this._removeDom(m, !0);
2957
+ });
2958
+ const at = oe.onTransformChange$.subscribeEvent(() => {
2959
+ const j = me(oe, B.renderUnit, le.skeleton, W.worksheet, ge);
2960
+ fe.next(
2961
+ j
2962
+ );
2963
+ });
2964
+ he.add(() => {
2965
+ this._canvasFloatDomService.removeFloatDom(y);
2966
+ }), at && he.add(at), this._domLayerInfoMap.set(y, ge), Le.set(y, {
2967
+ ...Le.get(y)
2968
+ });
2969
+ }
2970
+ return {
2971
+ id: m,
2972
+ dispose: () => {
2973
+ this._removeDom(m, !0);
2974
+ }
2975
+ };
2976
+ }
2977
+ addFloatDomToColumnHeader(e, n, t, r) {
2978
+ var v, R, _, E, M;
2979
+ const s = Y(this._univerInstanceService, {
2980
+ unitId: n.unitId,
2981
+ subUnitId: n.subUnitId
2982
+ });
2983
+ if (!s)
2984
+ throw new Error("cannot find current target!");
2985
+ const { unitId: o, subUnitId: c } = s;
2986
+ if (!this._getSceneAndTransformerByDrawingSearch(o)) return;
2987
+ const g = this._renderManagerService.getRenderById(o);
2988
+ if (!g) return;
2989
+ const a = (v = this._renderManagerService.getRenderById(o)) == null ? void 0 : v.with(H).getWorksheetSkeleton(c);
2990
+ if (!a) return;
2991
+ const { componentKey: l, data: h, allowTransform: u = !0 } = n, m = r != null ? r : Gt(), { position: p, position$: f } = this._createRangePositionObserver({
2992
+ startRow: 0,
2993
+ endRow: 0,
2994
+ startColumn: e,
2995
+ endColumn: e
2996
+ }, g, a.skeleton), w = p;
2997
+ w.startY = 0;
2998
+ const S = this._getPosition(p, o);
2999
+ if (S == null)
3000
+ return;
3001
+ this._ensureMap(o, c).set(m, n);
3002
+ const D = {
3003
+ unitId: o,
3004
+ subUnitId: c,
3005
+ drawingId: m,
3006
+ drawingType: n.type || L.DRAWING_DOM,
3007
+ componentKey: l,
3008
+ sheetTransform: S,
3009
+ transform: {
3010
+ left: w.startX,
3011
+ top: w.startY,
3012
+ width: w.width,
3013
+ height: w.height
3014
+ },
3015
+ data: h,
3016
+ allowTransform: u
3017
+ };
3018
+ {
3019
+ const { unitId: A, subUnitId: T, drawingId: b } = D, C = Y(this._univerInstanceService, { unitId: A, subUnitId: T }), y = D, W = this._univerInstanceService.getUnit(A, G.UNIVER_SHEET);
3020
+ if (!W)
3021
+ return;
3022
+ const z = W.getActiveSheet().getSheetId();
3023
+ if (!y || !C)
3024
+ return;
3025
+ const Z = (R = this._renderManagerService.getRenderById(A)) == null ? void 0 : R.with(H);
3026
+ if (!Z)
3027
+ return;
3028
+ const ce = Z.getWorksheetSkeleton(T);
3029
+ if (!ce)
3030
+ return;
3031
+ const { transform: Ie, data: le } = y, ie = this._getSceneAndTransformerByDrawingSearch(A);
3032
+ if (ie == null)
3033
+ return;
3034
+ const { scene: se, canvas: K } = ie;
3035
+ if (Ie == null || z !== T)
3036
+ return;
3037
+ const { left: B, top: Oe, width: Ee, height: Qe, angle: et, flipX: tt, flipY: nt, skewX: Ft, skewY: Yt } = Ie, rt = Ce({ unitId: A, subUnitId: T, drawingId: b }), it = se.getObject(rt);
3038
+ if (it != null) {
3039
+ it.transformByState({ left: B, top: Oe, width: Ee, height: Qe, angle: et, flipX: tt, flipY: nt, skewX: Ft, skewY: Yt });
3040
+ return;
3041
+ }
3042
+ const Te = bt({
3043
+ rotate: 0,
3044
+ startX: w.startX,
3045
+ startY: 0,
3046
+ endX: p.endX,
3047
+ endY: p.endY,
3048
+ width: t.width,
3049
+ height: t.height,
3050
+ absolute: {
3051
+ left: p.absolute.left,
3052
+ top: p.absolute.top
3053
+ }
3054
+ }, t), st = {
3055
+ left: Te.startX,
3056
+ top: Te.startY,
3057
+ width: Te.width,
3058
+ height: Te.height,
3059
+ zIndex: this._drawingManagerService.getDrawingOrder(A, T).length - 1
3060
+ }, ue = new We(rt, st);
3061
+ se.addObject(ue, Vt), y.allowTransform !== !1 && se.attachTransformerTo(ue);
3062
+ const te = this._ensureMap(A, T), Pe = new ht(), oe = se.getMainViewport(), Le = {
3063
+ top: 0,
3064
+ //viewMain.top,
3065
+ left: oe.left,
3066
+ bottom: oe.bottom,
3067
+ right: oe.right
3068
+ }, he = {
3069
+ dispose: Pe,
3070
+ rect: ue,
3071
+ // position$,
3072
+ unitId: A,
3073
+ subUnitId: T,
3074
+ boundsOfViewArea: Le,
3075
+ domAnchor: t,
3076
+ scrollDirectionResponse: "HORIZONTAL"
3077
+ /* HORIZONTAL */
3078
+ }, Ue = me(ue, ie.renderUnit, ce.skeleton, C.worksheet, he), Ae = new Ye(Ue);
3079
+ he.position$ = Ae;
3080
+ let ge = {
3081
+ position$: Ae,
3082
+ id: b,
3083
+ componentKey: y.componentKey,
3084
+ onPointerDown: () => {
3085
+ },
3086
+ onPointerMove: () => {
3087
+ },
3088
+ onPointerUp: () => {
3089
+ },
3090
+ onWheel: (x) => {
3091
+ K.dispatchEvent(new WheelEvent(x.type, x));
3092
+ },
3093
+ props: (E = (_ = te.get(b)) == null ? void 0 : _.props) != null ? E : this._getFloatDomProps(b),
3094
+ data: le,
3095
+ unitId: A
3096
+ };
3097
+ n.eventPassThrough && (ge = {
3098
+ ...ge,
3099
+ onPointerDown: (x) => {
3100
+ K.dispatchEvent(new PointerEvent(x.type, x));
3101
+ },
3102
+ onPointerMove: (x) => {
3103
+ K.dispatchEvent(new PointerEvent(x.type, x));
3104
+ },
3105
+ onPointerUp: (x) => {
3106
+ K.dispatchEvent(new PointerEvent(x.type, x));
3107
+ }
3108
+ }), this._canvasFloatDomService.addFloatDom(ge);
3109
+ const ot = ue.onTransformChange$.subscribeEvent(() => {
3110
+ const x = me(ue, ie.renderUnit, ce.skeleton, C.worksheet, he);
3111
+ Ae.next(
3112
+ x
3113
+ );
3114
+ });
3115
+ this.disposeWithMe(f.subscribe((x) => {
3116
+ const Fe = bt({
3117
+ rotate: 0,
3118
+ startX: x.startX,
3119
+ startY: 0,
3120
+ endX: x.endX,
3121
+ endY: x.endY,
3122
+ width: t.width,
3123
+ height: t.height,
3124
+ absolute: {
3125
+ left: p.absolute.left,
3126
+ top: p.absolute.top
3127
+ }
3128
+ }, t), at = Ce({ unitId: A, subUnitId: T, drawingId: b }), j = new We(at, {
3129
+ left: Fe.startX,
3130
+ top: 0,
3131
+ width: t.width,
3132
+ height: t.height,
3133
+ zIndex: this._drawingManagerService.getDrawingOrder(A, T).length - 1
3134
+ }), ct = me(j, ie.renderUnit, ce.skeleton, C.worksheet, he);
3135
+ Ae.next(ct);
3136
+ }));
3137
+ const fe = (M = this._renderManagerService.getRenderById(A)) == null ? void 0 : M.with(H);
3138
+ fe == null || fe.currentSkeleton$.subscribe((x) => {
3139
+ x && a.sheetId !== x.sheetId && this._removeDom(m, !0);
3140
+ }), Pe.add(() => {
3141
+ this._canvasFloatDomService.removeFloatDom(b);
3142
+ }), ot && Pe.add(ot), this._domLayerInfoMap.set(b, he), te.set(b, {
3143
+ ...te.get(b)
3144
+ });
3145
+ }
3146
+ return {
3147
+ id: m,
3148
+ dispose: () => {
3149
+ this._removeDom(m, !0);
3150
+ }
3151
+ };
3152
+ }
3153
+ /**
3154
+ * Unlike _createCellPositionObserver, this accept a range not a single cell.
3155
+ *
3156
+ * @param initialRow
3157
+ * @param initialCol
3158
+ * @param currentRender
3159
+ * @param skeleton
3160
+ * @param activeViewport
3161
+ * @returns position of cell to canvas.
3162
+ */
3163
+ _createRangePositionObserver(e, n, t) {
3164
+ let { startRow: r, startColumn: s } = e;
3165
+ const o = Ve(r, s, t), c = new Ye(o), d = Ve(e.endRow, e.endColumn, t), g = new Ye(d), a = () => {
3166
+ const f = Ve(r, s, t), w = Ve(e.endRow, e.endColumn, t);
3167
+ c.next(f), g.next(w);
3168
+ }, l = new ht();
3169
+ l.add(n.engine.clientRect$.subscribe(() => a())), l.add(this._commandService.onCommandExecuted((f) => {
3170
+ if (f.id === Ln.id && f.params.rowsAutoHeightInfo.findIndex((S) => S.row === r) > -1) {
3171
+ a();
3172
+ return;
3173
+ }
3174
+ (Ki.indexOf(f.id) > -1 || f.id === bi.id || f.id === bn.id) && a();
3175
+ }));
3176
+ const h = (f, w) => {
3177
+ r = f, s = w, a();
3178
+ }, u = () => ({
3179
+ rotate: 0,
3180
+ width: d.right - o.left,
3181
+ height: d.bottom - o.top,
3182
+ absolute: {
3183
+ left: !0,
3184
+ top: !0
3185
+ },
3186
+ startX: o.left,
3187
+ startY: o.top,
3188
+ endX: d.right,
3189
+ endY: d.bottom
3190
+ }), m = c.pipe(
3191
+ He((f) => {
3192
+ const w = Ve(e.endRow, e.endColumn, t);
3193
+ return {
3194
+ rotate: 0,
3195
+ width: w.right - f.left,
3196
+ height: w.bottom - f.top,
3197
+ absolute: {
3198
+ left: !0,
3199
+ top: !0
3200
+ },
3201
+ startX: f.left,
3202
+ startY: f.top,
3203
+ endX: w.right,
3204
+ endY: w.bottom
3205
+ };
3206
+ })
3207
+ ), p = u();
3208
+ return {
3209
+ position$: m,
3210
+ position: p,
3211
+ updateRowCol: h,
3212
+ topLeftPos$: c,
3213
+ rightBottomPos$: g,
3214
+ disposable: l
3215
+ };
3216
+ }
2801
3217
  };
2802
- ze = Ls([
2803
- de(0, U(X)),
2804
- de(1, pe),
2805
- de(2, U(B)),
2806
- de(3, Q),
2807
- de(4, U(Yr)),
2808
- de(5, z),
2809
- de(6, U(rr))
2810
- ], ze);
2811
- var An = Object.defineProperty, Fs = Object.getOwnPropertyDescriptor, Vs = (i, e, n) => e in i ? An(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, ks = (i, e, n, t) => {
2812
- for (var r = t > 1 ? void 0 : t ? Fs(e, n) : e, s = i.length - 1, o; s >= 0; s--)
3218
+ Nt = yo([
3219
+ De(0, N(Q)),
3220
+ De(1, ke),
3221
+ De(2, N(X)),
3222
+ De(3, de),
3223
+ De(4, N(Ai)),
3224
+ De(5, ee),
3225
+ De(6, N(zr))
3226
+ ], Nt);
3227
+ function Ve(i, e, n) {
3228
+ const t = n.getCellWithCoordByIndex(i, e), r = t.isMergedMainCell ? t.mergeInfo : t;
3229
+ return {
3230
+ left: r.startX,
3231
+ right: r.endX,
3232
+ top: r.startY,
3233
+ bottom: r.endY
3234
+ };
3235
+ }
3236
+ function bt(i, e, n) {
3237
+ var g, a;
3238
+ n = n != null ? n : 1;
3239
+ const t = i.endX - i.startX, r = i.endY - i.startY, s = (g = e == null ? void 0 : e.width) != null ? g : t, o = (a = e == null ? void 0 : e.height) != null ? a : r;
3240
+ let c = 0, d = 0;
3241
+ if (e) {
3242
+ if (e.horizonOffsetAlign === "right") {
3243
+ const l = Rt(e.marginX, t * n);
3244
+ c = i.endX - l - s;
3245
+ } else
3246
+ c = i.startX + Rt(e.marginX, t);
3247
+ if (e.verticalOffsetAlign === "bottom") {
3248
+ const l = Rt(e.marginY, r * n);
3249
+ d = i.endY - l - o;
3250
+ } else
3251
+ d = i.startY + Rt(e.marginY, r);
3252
+ }
3253
+ return {
3254
+ rotate: 0,
3255
+ startX: c,
3256
+ startY: d,
3257
+ endX: i.endX,
3258
+ endY: i.endY,
3259
+ width: s,
3260
+ height: o,
3261
+ absolute: {
3262
+ left: i.absolute.left,
3263
+ top: i.absolute.top
3264
+ }
3265
+ };
3266
+ }
3267
+ function Rt(i, e) {
3268
+ if (i === void 0) return 0;
3269
+ if (typeof i == "number") return i;
3270
+ const n = Number.parseFloat(i);
3271
+ return e * n / 100;
3272
+ }
3273
+ var Cr = Object.defineProperty, Eo = Object.getOwnPropertyDescriptor, To = (i, e, n) => e in i ? Cr(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, Po = (i, e, n, t) => {
3274
+ for (var r = t > 1 ? void 0 : t ? Eo(e, n) : e, s = i.length - 1, o; s >= 0; s--)
2813
3275
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
2814
- return t && r && An(e, n, r), r;
2815
- }, ut = (i, e) => (n, t) => e(n, t, i), Nn = (i, e, n) => Vs(i, typeof e != "symbol" ? e + "" : e, n);
2816
- const Hs = "SHEET_IMAGE_UI_PLUGIN";
2817
- let Ke = class extends dr {
2818
- constructor(i = $t, e, n, t) {
3276
+ return t && r && Cr(e, n, r), r;
3277
+ }, qt = (i, e) => (n, t) => e(n, t, i), br = (i, e, n) => To(i, typeof e != "symbol" ? e + "" : e, n);
3278
+ const Uo = "SHEET_IMAGE_UI_PLUGIN";
3279
+ let jt = class extends qr {
3280
+ constructor(i = yn, e, n, t) {
2819
3281
  super(), this._config = i, this._injector = e, this._renderManagerService = n, this._configService = t;
2820
- const { menu: r, ...s } = lr(
3282
+ const { menu: r, ...s } = Qr(
2821
3283
  {},
2822
- $t,
3284
+ yn,
2823
3285
  this._config
2824
3286
  );
2825
- r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(mi, s);
3287
+ r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(es, s);
2826
3288
  }
2827
3289
  onStarting() {
2828
- ur(this._injector, [
2829
- [ze],
2830
- [Xe],
2831
- [Le],
2832
- [Ye],
2833
- [He],
2834
- [ke],
2835
- [Ge],
2836
- [Ve],
2837
- [Fe]
2838
- ]), rt(this._injector, [
2839
- [ze]
3290
+ ei(this._injector, [
3291
+ [Nt],
3292
+ [At],
3293
+ [Mt],
3294
+ [Ut],
3295
+ [Pt],
3296
+ [Tt],
3297
+ [yt],
3298
+ [Et],
3299
+ [Ot]
3300
+ ]), Xt(this._injector, [
3301
+ [Nt]
2840
3302
  ]);
2841
3303
  }
2842
3304
  onReady() {
2843
- rt(this._injector, [
2844
- [ke]
3305
+ Xt(this._injector, [
3306
+ [Tt]
2845
3307
  ]);
2846
3308
  }
2847
3309
  onRendered() {
2848
- this._registerRenderModules(), rt(this._injector, [
2849
- [He],
2850
- [Ye],
2851
- [Xe],
2852
- [Ge],
2853
- [Ve],
2854
- [Fe]
3310
+ this._registerRenderModules(), Xt(this._injector, [
3311
+ [Pt],
3312
+ [Ut],
3313
+ [At],
3314
+ [yt],
3315
+ [Et],
3316
+ [Ot]
2855
3317
  ]);
2856
3318
  }
2857
3319
  onSteady() {
2858
- this._injector.get(Le);
3320
+ this._injector.get(Mt);
2859
3321
  }
2860
3322
  _registerRenderModules() {
2861
3323
  [
2862
- [Se],
2863
- [wt],
2864
- [pt]
3324
+ [ze],
3325
+ [on],
3326
+ [rn]
2865
3327
  ].forEach((i) => {
2866
- this.disposeWithMe(this._renderManagerService.registerRenderModule(F.UNIVER_SHEET, i));
3328
+ this.disposeWithMe(this._renderManagerService.registerRenderModule(G.UNIVER_SHEET, i));
2867
3329
  });
2868
3330
  }
2869
3331
  };
2870
- Nn(Ke, "type", F.UNIVER_SHEET);
2871
- Nn(Ke, "pluginName", Hs);
2872
- Ke = ks([
2873
- cr(fr, mr, Ir, Dr),
2874
- ut(1, U(Ie)),
2875
- ut(2, X),
2876
- ut(3, hr)
2877
- ], Ke);
3332
+ br(jt, "type", G.UNIVER_SHEET);
3333
+ br(jt, "pluginName", Uo);
3334
+ jt = Po([
3335
+ Zr(ii, ri, li, gi),
3336
+ qt(1, N(Ke)),
3337
+ qt(2, Q),
3338
+ qt(3, ti)
3339
+ ], jt);
2878
3340
  export {
2879
- W as ClearSheetDrawingTransformerOperation,
2880
- En as DeleteDrawingsCommand,
2881
- In as EditSheetDrawingOperation,
2882
- Cn as GroupSheetDrawingCommand,
2883
- It as InsertFloatImageCommand,
2884
- et as InsertSheetDrawingCommand,
2885
- Re as MoveDrawingsCommand,
2886
- Qe as RemoveSheetDrawingCommand,
2887
- Pn as SHEETS_IMAGE_MENU_ID,
2888
- Rn as SetDrawingArrangeCommand,
2889
- tt as SetSheetDrawingCommand,
2890
- ze as SheetCanvasFloatDomManagerService,
2891
- Sn as SidebarSheetDrawingOperation,
2892
- Mn as UngroupSheetDrawingCommand,
2893
- Ke as UniverSheetsDrawingUIPlugin
3341
+ k as ClearSheetDrawingTransformerOperation,
3342
+ _r as DeleteDrawingsCommand,
3343
+ lr as EditSheetDrawingOperation,
3344
+ ur as GroupSheetDrawingCommand,
3345
+ dn as InsertFloatImageCommand,
3346
+ kt as InsertSheetDrawingCommand,
3347
+ Ze as MoveDrawingsCommand,
3348
+ $t as RemoveSheetDrawingCommand,
3349
+ Sr as SHEETS_IMAGE_MENU_ID,
3350
+ hr as SetDrawingArrangeCommand,
3351
+ Lt as SetSheetDrawingCommand,
3352
+ Nt as SheetCanvasFloatDomManagerService,
3353
+ dr as SidebarSheetDrawingOperation,
3354
+ gr as UngroupSheetDrawingCommand,
3355
+ jt as UniverSheetsDrawingUIPlugin
2894
3356
  };