@univerjs/sheets-drawing-ui 0.6.6-experimental.20250317-28d180b → 0.6.6-experimental.20250321-5cc1a0d

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