@univerjs/sheets-drawing-ui 0.12.3-experimental.20251205-71d07c3 → 0.12.3-nightly.202512060617

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/lib/cjs/facade.js +1 -1
  2. package/lib/cjs/index.js +2 -2
  3. package/lib/cjs/locale/ca-ES.js +1 -1
  4. package/lib/cjs/locale/en-US.js +1 -1
  5. package/lib/cjs/locale/es-ES.js +1 -1
  6. package/lib/cjs/locale/fa-IR.js +1 -1
  7. package/lib/cjs/locale/fr-FR.js +1 -1
  8. package/lib/cjs/locale/ja-JP.js +1 -1
  9. package/lib/cjs/locale/ko-KR.js +1 -1
  10. package/lib/cjs/locale/ru-RU.js +1 -1
  11. package/lib/cjs/locale/vi-VN.js +1 -1
  12. package/lib/cjs/locale/zh-CN.js +1 -1
  13. package/lib/cjs/locale/zh-TW.js +1 -1
  14. package/lib/es/facade.js +439 -395
  15. package/lib/es/index.js +1760 -1215
  16. package/lib/es/locale/ca-ES.js +15 -2
  17. package/lib/es/locale/en-US.js +13 -0
  18. package/lib/es/locale/es-ES.js +13 -0
  19. package/lib/es/locale/fa-IR.js +13 -0
  20. package/lib/es/locale/fr-FR.js +13 -0
  21. package/lib/es/locale/ja-JP.js +13 -0
  22. package/lib/es/locale/ko-KR.js +13 -0
  23. package/lib/es/locale/ru-RU.js +13 -0
  24. package/lib/es/locale/vi-VN.js +13 -0
  25. package/lib/es/locale/zh-CN.js +13 -0
  26. package/lib/es/locale/zh-TW.js +13 -0
  27. package/lib/facade.js +439 -395
  28. package/lib/index.css +1 -1
  29. package/lib/index.js +1760 -1215
  30. package/lib/locale/ca-ES.js +15 -2
  31. package/lib/locale/en-US.js +13 -0
  32. package/lib/locale/es-ES.js +13 -0
  33. package/lib/locale/fa-IR.js +13 -0
  34. package/lib/locale/fr-FR.js +13 -0
  35. package/lib/locale/ja-JP.js +13 -0
  36. package/lib/locale/ko-KR.js +13 -0
  37. package/lib/locale/ru-RU.js +13 -0
  38. package/lib/locale/vi-VN.js +13 -0
  39. package/lib/locale/zh-CN.js +13 -0
  40. package/lib/locale/zh-TW.js +13 -0
  41. package/lib/types/commands/commands/save-cell-images.command.d.ts +2 -0
  42. package/lib/types/facade/f-range.d.ts +40 -0
  43. package/lib/types/facade/f-worksheet.d.ts +29 -0
  44. package/lib/types/index.d.ts +2 -0
  45. package/lib/types/locale/en-US.d.ts +13 -0
  46. package/lib/types/services/batch-save-images.service.d.ts +148 -0
  47. package/lib/types/views/batch-save-images/BatchSaveImagesDialog.d.ts +16 -0
  48. package/lib/types/views/batch-save-images/component-name.d.ts +16 -0
  49. package/lib/types/views/batch-save-images/index.d.ts +17 -0
  50. package/lib/types/views/menu/save-images.menu.d.ts +4 -0
  51. package/lib/umd/facade.js +1 -1
  52. package/lib/umd/index.js +2 -2
  53. package/lib/umd/locale/ca-ES.js +1 -1
  54. package/lib/umd/locale/en-US.js +1 -1
  55. package/lib/umd/locale/es-ES.js +1 -1
  56. package/lib/umd/locale/fa-IR.js +1 -1
  57. package/lib/umd/locale/fr-FR.js +1 -1
  58. package/lib/umd/locale/ja-JP.js +1 -1
  59. package/lib/umd/locale/ko-KR.js +1 -1
  60. package/lib/umd/locale/ru-RU.js +1 -1
  61. package/lib/umd/locale/vi-VN.js +1 -1
  62. package/lib/umd/locale/zh-CN.js +1 -1
  63. package/lib/umd/locale/zh-TW.js +1 -1
  64. package/package.json +13 -12
package/lib/es/index.js CHANGED
@@ -1,33 +1,33 @@
1
- var yr = Object.defineProperty;
2
- var Tr = (i, t, e) => t in i ? yr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var te = (i, t, e) => Tr(i, typeof t != "symbol" ? t + "" : t, e);
4
- import { precisionTo as pt, IRenderManagerService as Z, transformObjectOutOfGroup as Er, getGroupState as Or, getCurrentTypeOfRenderer as sn, CURSOR_TYPE as Ur, RENDER_CLASS_TYPE as Oe, Rect as Ue, ObjectType as mn, DRAWING_OBJECT_LAYER_INDEX as Ft, SHEET_VIEWPORT_KEY as xn } from "@univerjs/engine-render";
5
- import { convertPositionSheetOverGridToAbsolute as Pr, SheetSkeletonManagerService as V, ISheetSelectionRenderService as Ye, attachRangeWithCoord as Yn, SheetCanvasPopManagerService as Ar, HoverManagerService as Nr, IEditorBridgeService as kr, IAutoFillService as Wr, EditingRenderController as Br, SetCellEditVisibleOperation as pn, PREDEFINED_HOOK_NAME as We, COPY_TYPE as ve, discreteRangeToRange as wn, virtualizeDiscreteRanges as jr, ISheetClipboardService as $r, SetZoomRatioOperation as _n, SetScrollOperation as Fr, SheetPrintInterceptorService as xr, getCurrentRangeDisable$ as Yr } from "@univerjs/sheets-ui";
6
- import { CommandType as q, ICommandService as X, IUndoRedoService as Ge, sequenceExecute as Gn, DrawingTypeEnum as W, ArrangeTypeEnum as wt, Inject as A, IContextService as Xn, LocaleService as nt, Injector as Xe, Disposable as re, createDocumentModelWithStyle as Vt, ObjectRelativeFromV as Sn, ObjectRelativeFromH as vn, WrapTextType as In, PositionedObjectLayoutType as Cn, BooleanNumber as Dn, BuildTextUtils as Ht, ImageSourceType as Rn, generateRandomId as Be, FOCUSING_COMMON_DRAWINGS as Fe, IUniverInstanceService as Se, UniverInstanceType as F, Direction as _e, IImageIoService as Gr, RxDisposable as Xr, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as qe, DOCS_ZEN_EDITOR_UNIT_ID_KEY as je, InterceptorEffectEnum as Lr, ObjectMatrix as Vr, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Hr, IPermissionService as zr, UserManagerService as Kr, LifecycleService as Jr, LifecycleStages as Zr, DisposableCollection as _t, fromEventSubject as qr, Tools as $e, PRINT_CHART_COMPONENT_KEY as Qr, Rectangle as ei, FOCUSING_FX_BAR_EDITOR as ti, EDITOR_ACTIVATED as ni, FOCUSING_PANEL_EDITOR as ri, DependentOn as ii, IConfigService as si, Plugin as oi, merge as ai, registerDependencies as ci, touchDependencies as xt } from "@univerjs/core";
7
- import { ISheetDrawingService as ie, DrawingApplyType as U, SetDrawingApplyMutation as P, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as di } from "@univerjs/sheets-drawing";
8
- import { SheetInterceptorService as At, SheetsSelectionsService as on, SetRangeValuesCommand as bn, getSheetCommandTarget as oe, INTERCEPTOR_POINT as li, InterceptCellContentPriority as ui, WorkbookViewPermission as Mn, WorksheetViewPermission as yn, WorkbookEditablePermission as zt, WorksheetEditPermission as Kt, SetFrozenMutation as hi, SetSelectionsOperation as gi, SetWorksheetRowAutoHeightMutation as fi, COMMAND_LISTENER_SKELETON_CHANGE as mi, InsertRowCommand as Ln, InsertColCommand as Vn, RemoveRowCommand as Hn, RemoveColCommand as zn, DeleteRangeMoveLeftCommand as Kn, DeleteRangeMoveUpCommand as Jn, InsertRangeMoveDownCommand as Zn, InsertRangeMoveRightCommand as qn, DeltaRowHeightCommand as Jt, SetRowHeightCommand as Zt, DeltaColumnWidthCommand as Qn, SetColWidthCommand as er, SetRowHiddenCommand as tr, SetSpecificRowsVisibleCommand as nr, SetSpecificColsVisibleCommand as rr, SetColHiddenCommand as ir, MoveColsCommand as sr, MoveRowsCommand as or, MoveRangeCommand as ar, SetRowVisibleMutation as pi, SetRowHiddenMutation as wi, SetColVisibleMutation as _i, SetColHiddenMutation as Si, SetWorksheetRowHeightMutation as vi, SetWorksheetColWidthMutation as Ii, SetWorksheetActiveOperation as Ci, RangeProtectionPermissionEditPoint as Di } from "@univerjs/sheets";
9
- import { MessageType as pe, render as Ri, unmount as bi, clsx as Mi, RadioGroup as yi, Radio as Yt } from "@univerjs/design";
10
- import { docDrawingPositionToTransform as Tn, ReplaceSnapshotCommand as Ti, InnerPasteCommand as Ei } from "@univerjs/docs-ui";
11
- import { IImageIoService as Oi, IDrawingManagerService as se, DRAWING_IMAGE_ALLOW_IMAGE_LIST as En, DRAWING_IMAGE_COUNT_LIMIT as On, ImageUploadStatusType as Pe, DRAWING_IMAGE_ALLOW_SIZE as Un, getImageSize as Gt, SetDrawingSelectedOperation as Nt, DRAWING_IMAGE_WIDTH_LIMIT as Pn, DRAWING_IMAGE_HEIGHT_LIMIT as An, ImageSourceType as Ui, getDrawingShapeKeyByDrawingSearch as Ie, UniverDrawingPlugin as Pi } from "@univerjs/drawing";
12
- import { ILocalFileService as Ai, IMessageService as cr, ISidebarService as Ni, IDialogService as ki, IClipboardInterfaceService as Wi, CanvasFloatDomService as Bi, PrintFloatDomSingle as ji, ComponentManager as dr, connectInjector as $i, useDependency as Qe, getMenuHiddenObservable as an, MenuItemType as cn, RibbonInsertGroup as Fi, KeyCode as xe, IMenuManagerService as xi, IShortcutService as Yi } from "@univerjs/ui";
13
- import { DocDrawingController as Gi, UniverDocsDrawingPlugin as Xi } from "@univerjs/docs-drawing";
14
- import { ImageCropperObject as Li, COMPONENT_IMAGE_POPUP_MENU as Vi, OpenImageCropOperation as Hi, ImageResetSizeOperation as zi, DrawingRenderService as lr, DrawingCommonPanel as Ki, UniverDrawingUIPlugin as Ji } from "@univerjs/drawing-ui";
15
- import { takeUntil as Nn, throttleTime as Zi, combineLatest as St, switchMap as we, EMPTY as fe, tap as kn, map as Re, distinctUntilChanged as Wn, Subject as Xt, filter as qi, take as Qi, BehaviorSubject as ke, of as Bn } from "rxjs";
16
- import { jsx as ae, jsxs as qt } from "react/jsx-runtime";
17
- import { useMemo as es, useState as Qt, useEffect as ur } from "react";
18
- function K(i, t, e) {
1
+ var Qr = Object.defineProperty;
2
+ var ei = (i, t, e) => t in i ? Qr(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
+ var re = (i, t, e) => ei(i, typeof t != "symbol" ? t + "" : t, e);
4
+ import { precisionTo as bt, IRenderManagerService as Q, transformObjectOutOfGroup as ti, getGroupState as ni, getCurrentTypeOfRenderer as Dn, CURSOR_TYPE as ri, RENDER_CLASS_TYPE as $e, Rect as ke, ObjectType as An, DRAWING_OBJECT_LAYER_INDEX as qt, SHEET_VIEWPORT_KEY as cr } from "@univerjs/engine-render";
5
+ import { convertPositionSheetOverGridToAbsolute as ii, SheetSkeletonManagerService as X, ISheetSelectionRenderService as Ze, attachRangeWithCoord as dr, SheetCanvasPopManagerService as si, HoverManagerService as oi, IEditorBridgeService as ai, IAutoFillService as ci, EditingRenderController as di, SetCellEditVisibleOperation as Nn, PREDEFINED_HOOK_NAME as Le, COPY_TYPE as Re, discreteRangeToRange as $n, virtualizeDiscreteRanges as li, ISheetClipboardService as ui, SetZoomRatioOperation as kn, SetScrollOperation as hi, SheetPrintInterceptorService as gi, useHighlightRange as fi, getCurrentRangeDisable$ as mi } from "@univerjs/sheets-ui";
6
+ import { CommandType as q, ICommandService as Y, IUndoRedoService as Je, sequenceExecute as lr, DrawingTypeEnum as x, ArrangeTypeEnum as Mt, Inject as A, IContextService as ur, LocaleService as Te, Injector as qe, Disposable as ee, createDocumentModelWithStyle as un, ObjectRelativeFromV as xn, ObjectRelativeFromH as Wn, WrapTextType as Bn, PositionedObjectLayoutType as jn, BooleanNumber as Fn, BuildTextUtils as hn, ImageSourceType as Ce, generateRandomId as Ve, FOCUSING_COMMON_DRAWINGS as Ge, IUniverInstanceService as de, UniverInstanceType as $, Direction as ve, createIdentifier as pi, IImageIoService as hr, RxDisposable as wi, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as ot, DOCS_ZEN_EDITOR_UNIT_ID_KEY as He, InterceptorEffectEnum as _i, ObjectMatrix as Si, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as vi, IPermissionService as Ii, UserManagerService as Ci, LifecycleService as Ri, LifecycleStages as Di, DisposableCollection as yt, fromEventSubject as bi, Tools as Ye, PRINT_CHART_COMPONENT_KEY as Mi, Rectangle as yi, FOCUSING_FX_BAR_EDITOR as Ei, EDITOR_ACTIVATED as Ti, FOCUSING_PANEL_EDITOR as Oi, DependentOn as Ui, IConfigService as Pi, Plugin as Ai, merge as Ni, registerDependencies as $i, touchDependencies as Qt } from "@univerjs/core";
7
+ import { ISheetDrawingService as se, DrawingApplyType as U, SetDrawingApplyMutation as P, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as ki } from "@univerjs/sheets-drawing";
8
+ import { SheetInterceptorService as Vt, SheetsSelectionsService as ut, SetRangeValuesCommand as Ln, getSheetCommandTarget as ae, INTERCEPTOR_POINT as xi, InterceptCellContentPriority as Wi, WorkbookViewPermission as Vn, WorksheetViewPermission as Hn, WorkbookEditablePermission as gn, WorksheetEditPermission as fn, SetFrozenMutation as Bi, SetSelectionsOperation as ji, SetWorksheetRowAutoHeightMutation as Fi, COMMAND_LISTENER_SKELETON_CHANGE as Li, InsertRowCommand as gr, InsertColCommand as fr, RemoveRowCommand as mr, RemoveColCommand as pr, DeleteRangeMoveLeftCommand as wr, DeleteRangeMoveUpCommand as _r, InsertRangeMoveDownCommand as Sr, InsertRangeMoveRightCommand as vr, DeltaRowHeightCommand as mn, SetRowHeightCommand as pn, DeltaColumnWidthCommand as Ir, SetColWidthCommand as Cr, SetRowHiddenCommand as Rr, SetSpecificRowsVisibleCommand as Dr, SetSpecificColsVisibleCommand as br, SetColHiddenCommand as Mr, MoveColsCommand as yr, MoveRowsCommand as Er, MoveRangeCommand as Tr, SetRowVisibleMutation as Vi, SetRowHiddenMutation as Hi, SetColVisibleMutation as Yi, SetColHiddenMutation as Gi, SetWorksheetRowHeightMutation as Xi, SetWorksheetColWidthMutation as zi, SetWorksheetActiveOperation as Ki, RangeProtectionPermissionEditPoint as Zi } from "@univerjs/sheets";
9
+ import { MessageType as Se, render as Ji, unmount as qi, FormLayout as en, CheckboxGroup as Qi, Checkbox as Yn, Select as es, Button as Gn, clsx as ts, RadioGroup as ns, Radio as tn } from "@univerjs/design";
10
+ import { docDrawingPositionToTransform as Xn, ReplaceSnapshotCommand as rs, InnerPasteCommand as is } from "@univerjs/docs-ui";
11
+ import { IImageIoService as ss, IDrawingManagerService as oe, DRAWING_IMAGE_ALLOW_IMAGE_LIST as zn, DRAWING_IMAGE_COUNT_LIMIT as Kn, ImageUploadStatusType as xe, DRAWING_IMAGE_ALLOW_SIZE as Zn, getImageSize as nn, SetDrawingSelectedOperation as Ht, DRAWING_IMAGE_WIDTH_LIMIT as Jn, DRAWING_IMAGE_HEIGHT_LIMIT as qn, ImageSourceType as os, getDrawingShapeKeyByDrawingSearch as De, UniverDrawingPlugin as as } from "@univerjs/drawing";
12
+ import { ILocalFileService as cs, IMessageService as Or, IDialogService as bn, ISidebarService as ds, IClipboardInterfaceService as ls, CanvasFloatDomService as us, PrintFloatDomSingle as hs, ComponentManager as Ur, connectInjector as gs, useDependency as Ie, getMenuHiddenObservable as Yt, MenuItemType as Gt, ContextMenuPosition as rn, ContextMenuGroup as sn, RibbonInsertGroup as fs, KeyCode as Ke, IMenuManagerService as ms, IShortcutService as ps } from "@univerjs/ui";
13
+ import { DocDrawingController as ws, UniverDocsDrawingPlugin as _s } from "@univerjs/docs-drawing";
14
+ import { ImageCropperObject as Ss, COMPONENT_IMAGE_POPUP_MENU as vs, OpenImageCropOperation as Is, ImageResetSizeOperation as Cs, DrawingRenderService as Pr, DrawingCommonPanel as Rs, UniverDrawingUIPlugin as Ds } from "@univerjs/drawing-ui";
15
+ import { takeUntil as Qn, throttleTime as bs, combineLatest as at, switchMap as me, EMPTY as we, tap as er, map as pe, distinctUntilChanged as tr, Subject as on, filter as Ms, take as ys, BehaviorSubject as je, of as wn } from "rxjs";
16
+ import { jsx as L, jsxs as Xe } from "react/jsx-runtime";
17
+ import { useMemo as Fe, useRef as Es, createElement as Ar, forwardRef as Ts, useState as Ee, useCallback as Et, useEffect as Nr } from "react";
18
+ function Z(i, t, e) {
19
19
  const { from: n, to: r, flipY: s = !1, flipX: o = !1, angle: a = 0, skewX: d = 0, skewY: u = 0 } = i, c = e.getCurrent();
20
20
  if (c == null)
21
21
  return;
22
- const l = Pr(
22
+ const l = ii(
23
23
  c.unitId,
24
24
  c.sheetId,
25
25
  { from: n, to: r },
26
26
  e
27
27
  );
28
- let { left: g, top: h, width: f, height: p } = l;
29
- const m = e.getCurrentSkeleton(), _ = m.rowHeaderWidth + m.columnTotalWidth, v = m.columnHeaderHeight + m.rowTotalHeight;
30
- return g + f > _ && (g = _ - f), h + p > v && (h = v - p), {
28
+ let { left: g, top: h, width: f, height: m } = l;
29
+ const p = e.getCurrentSkeleton(), w = p.rowHeaderWidth + p.columnTotalWidth, S = p.columnHeaderHeight + p.rowTotalHeight;
30
+ return g + f > w && (g = w - f), h + m > S && (h = S - m), {
31
31
  flipY: s,
32
32
  flipX: o,
33
33
  angle: a,
@@ -36,26 +36,26 @@ function K(i, t, e) {
36
36
  left: g,
37
37
  top: h,
38
38
  width: f,
39
- height: p
39
+ height: m
40
40
  };
41
41
  }
42
- function $(i, t) {
42
+ function j(i, t) {
43
43
  const { left: e = 0, top: n = 0, width: r = 0, height: s = 0, flipY: o = !1, flipX: a = !1, angle: d = 0, skewX: u = 0, skewY: c = 0 } = i, l = t.getCellWithCoordByOffset(e, n);
44
44
  if (l == null)
45
45
  return;
46
46
  const g = {
47
47
  column: l.actualColumn,
48
- columnOffset: pt(e - l.startX, 1),
48
+ columnOffset: bt(e - l.startX, 1),
49
49
  row: l.actualRow,
50
- rowOffset: pt(n - l.startY, 1)
50
+ rowOffset: bt(n - l.startY, 1)
51
51
  }, h = t.getCellWithCoordByOffset(e + r, n + s);
52
52
  if (h == null)
53
53
  return;
54
54
  const f = {
55
55
  column: h.actualColumn,
56
- columnOffset: pt(e + r - h.startX, 1),
56
+ columnOffset: bt(e + r - h.startX, 1),
57
57
  row: h.actualRow,
58
- rowOffset: pt(n + s - h.startY, 1)
58
+ rowOffset: bt(n + s - h.startY, 1)
59
59
  };
60
60
  return {
61
61
  flipY: o,
@@ -67,50 +67,50 @@ function $(i, t) {
67
67
  to: f
68
68
  };
69
69
  }
70
- const Y = {
70
+ const V = {
71
71
  id: "sheet.operation.clear-drawing-transformer",
72
72
  type: q.MUTATION,
73
73
  handler: (i, t) => {
74
- const e = i.get(Z);
74
+ const e = i.get(Q);
75
75
  return t.forEach((n) => {
76
76
  var r, s;
77
77
  (s = (r = e.getRenderById(n)) == null ? void 0 : r.scene.getTransformer()) == null || s.debounceRefreshControls();
78
78
  }), !0;
79
79
  }
80
- }, rt = {
80
+ }, ht = {
81
81
  id: "sheet.command.remove-sheet-image",
82
82
  type: q.COMMAND,
83
83
  handler: (i, t) => {
84
- var v, I, R;
85
- const e = i.get(X), n = i.get(Ge), r = i.get(At), s = i.get(ie);
84
+ var S, I, D;
85
+ const e = i.get(Y), n = i.get(Je), r = i.get(Vt), s = i.get(se);
86
86
  if (!t) return !1;
87
87
  const { drawings: o } = t, a = [];
88
- o.forEach((S) => {
89
- const { unitId: C } = S;
88
+ o.forEach((v) => {
89
+ const { unitId: C } = v;
90
90
  a.push(C);
91
91
  });
92
- const d = s.getBatchRemoveOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, f = r.onCommandExecute({ id: rt.id, params: t }), p = { id: P.id, params: { unitId: u, subUnitId: c, op: g, objects: h, type: U.REMOVE } }, m = { id: P.id, params: { unitId: u, subUnitId: c, op: l, objects: h, type: U.INSERT } };
93
- return Gn([...(v = f.preRedos) != null ? v : [], p, ...f.redos], e) ? (n.pushUndoRedo({
92
+ const d = s.getBatchRemoveOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, f = r.onCommandExecute({ id: ht.id, params: t }), m = { id: P.id, params: { unitId: u, subUnitId: c, op: g, objects: h, type: U.REMOVE } }, p = { id: P.id, params: { unitId: u, subUnitId: c, op: l, objects: h, type: U.INSERT } };
93
+ return lr([...(S = f.preRedos) != null ? S : [], m, ...f.redos], e) ? (n.pushUndoRedo({
94
94
  unitID: u,
95
95
  undoMutations: [
96
96
  ...(I = f.preUndos) != null ? I : [],
97
- m,
97
+ p,
98
98
  ...f.undos,
99
- { id: Y.id, params: a }
99
+ { id: V.id, params: a }
100
100
  ],
101
101
  redoMutations: [
102
- ...(R = f.preRedos) != null ? R : [],
103
- p,
102
+ ...(D = f.preRedos) != null ? D : [],
103
+ m,
104
104
  ...f.redos,
105
- { id: Y.id, params: a }
105
+ { id: V.id, params: a }
106
106
  ]
107
107
  }), !0) : !1;
108
108
  }
109
- }, hr = {
109
+ }, $r = {
110
110
  id: "sheet.command.delete-drawing",
111
111
  type: q.COMMAND,
112
112
  handler: (i) => {
113
- const t = i.get(X), n = i.get(ie).getFocusDrawings();
113
+ const t = i.get(Y), n = i.get(se).getFocusDrawings();
114
114
  if (n.length === 0)
115
115
  return !1;
116
116
  const r = n[0].unitId, s = n.map((o) => {
@@ -122,21 +122,21 @@ const Y = {
122
122
  drawingType: c
123
123
  };
124
124
  });
125
- return t.executeCommand(rt.id, {
125
+ return t.executeCommand(ht.id, {
126
126
  unitId: r,
127
127
  drawings: s
128
128
  });
129
129
  }
130
130
  };
131
- function ts(i) {
131
+ function Os(i) {
132
132
  const t = [];
133
133
  return i.forEach((e) => {
134
- const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n, d = Or(0, 0, r.map((l) => l.transform || {})), u = r.map((l) => {
135
- const g = l.transform || { left: 0, top: 0 }, { unitId: h, subUnitId: f, drawingId: p } = l;
134
+ const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a } = n, d = ni(0, 0, r.map((l) => l.transform || {})), u = r.map((l) => {
135
+ const g = l.transform || { left: 0, top: 0 }, { unitId: h, subUnitId: f, drawingId: m } = l;
136
136
  return {
137
137
  unitId: h,
138
138
  subUnitId: f,
139
- drawingId: p,
139
+ drawingId: m,
140
140
  transform: {
141
141
  ...g,
142
142
  left: g.left - d.left,
@@ -148,7 +148,7 @@ function ts(i) {
148
148
  unitId: s,
149
149
  subUnitId: o,
150
150
  drawingId: a,
151
- drawingType: W.DRAWING_GROUP,
151
+ drawingType: x.DRAWING_GROUP,
152
152
  transform: d
153
153
  };
154
154
  t.push({
@@ -157,26 +157,26 @@ function ts(i) {
157
157
  });
158
158
  }), t;
159
159
  }
160
- function ns(i) {
160
+ function Us(i) {
161
161
  const t = [];
162
162
  return i.forEach((e) => {
163
163
  const { parent: n, children: r } = e, { unitId: s, subUnitId: o, drawingId: a, transform: d = { width: 0, height: 0 } } = n;
164
164
  if (d == null)
165
165
  return;
166
166
  const u = r.map((l) => {
167
- const { transform: g } = l, { unitId: h, subUnitId: f, drawingId: p } = l, m = Er(g || {}, d, d.width || 0, d.height || 0);
167
+ const { transform: g } = l, { unitId: h, subUnitId: f, drawingId: m } = l, p = ti(g || {}, d, d.width || 0, d.height || 0);
168
168
  return {
169
169
  unitId: h,
170
170
  subUnitId: f,
171
- drawingId: p,
172
- transform: m,
171
+ drawingId: m,
172
+ transform: p,
173
173
  groupId: void 0
174
174
  };
175
175
  }), c = {
176
176
  unitId: s,
177
177
  subUnitId: o,
178
178
  drawingId: a,
179
- drawingType: W.DRAWING_GROUP,
179
+ drawingType: x.DRAWING_GROUP,
180
180
  transform: {
181
181
  left: 0,
182
182
  top: 0
@@ -188,64 +188,64 @@ function ns(i) {
188
188
  });
189
189
  }), t;
190
190
  }
191
- const gr = {
191
+ const kr = {
192
192
  id: "sheet.command.group-sheet-image",
193
193
  type: q.COMMAND,
194
194
  handler: (i, t) => {
195
- const e = i.get(X), n = i.get(Ge), r = i.get(ie);
195
+ const e = i.get(Y), n = i.get(Je), r = i.get(se);
196
196
  if (!t) return !1;
197
197
  const s = [];
198
198
  t.forEach(({ parent: h, children: f }) => {
199
- s.push(h.unitId), f.forEach((p) => {
200
- s.push(p.unitId);
199
+ s.push(h.unitId), f.forEach((m) => {
200
+ s.push(m.unitId);
201
201
  });
202
202
  });
203
203
  const o = r.getGroupDrawingOp(t), { unitId: a, subUnitId: d, undo: u, redo: c, objects: l } = o;
204
204
  return e.syncExecuteCommand(P.id, { op: c, unitId: a, subUnitId: d, objects: l, type: U.GROUP }) ? (n.pushUndoRedo({
205
205
  unitID: a,
206
206
  undoMutations: [
207
- { id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: ns(l), type: U.UNGROUP } },
208
- { id: Y.id, params: s }
207
+ { id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: Us(l), type: U.UNGROUP } },
208
+ { id: V.id, params: s }
209
209
  ],
210
210
  redoMutations: [
211
211
  { id: P.id, params: { op: c, unitId: a, subUnitId: d, objects: l, type: U.GROUP } },
212
- { id: Y.id, params: s }
212
+ { id: V.id, params: s }
213
213
  ]
214
214
  }), !0) : !1;
215
215
  }
216
- }, kt = {
216
+ }, Xt = {
217
217
  id: "sheet.command.insert-sheet-image",
218
218
  type: q.COMMAND,
219
219
  handler: (i, t) => {
220
- var v, I, R;
221
- const e = i.get(X), n = i.get(Ge), r = i.get(ie), s = i.get(At);
220
+ var S, I, D;
221
+ const e = i.get(Y), n = i.get(Je), r = i.get(se), s = i.get(Vt);
222
222
  if (!t) return !1;
223
- const o = t.drawings, a = o.map((S) => S.unitId), d = r.getBatchAddOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, f = s.onCommandExecute({ id: kt.id, params: t }), p = { id: P.id, params: { op: g, unitId: u, subUnitId: c, objects: h, type: U.INSERT } }, m = { id: P.id, params: { op: l, unitId: u, subUnitId: c, objects: h, type: U.REMOVE } };
224
- return Gn([...(v = f.preRedos) != null ? v : [], p, ...f.redos], e) ? (n.pushUndoRedo({
223
+ const o = t.drawings, a = o.map((v) => v.unitId), d = r.getBatchAddOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, f = s.onCommandExecute({ id: Xt.id, params: t }), m = { id: P.id, params: { op: g, unitId: u, subUnitId: c, objects: h, type: U.INSERT } }, p = { id: P.id, params: { op: l, unitId: u, subUnitId: c, objects: h, type: U.REMOVE } };
224
+ return lr([...(S = f.preRedos) != null ? S : [], m, ...f.redos], e) ? (n.pushUndoRedo({
225
225
  unitID: u,
226
226
  undoMutations: [
227
227
  ...(I = f.preUndos) != null ? I : [],
228
- m,
228
+ p,
229
229
  ...f.undos,
230
- { id: Y.id, params: a }
230
+ { id: V.id, params: a }
231
231
  ],
232
232
  redoMutations: [
233
- ...(R = f.preRedos) != null ? R : [],
234
- p,
233
+ ...(D = f.preRedos) != null ? D : [],
234
+ m,
235
235
  ...f.redos,
236
- { id: Y.id, params: a }
236
+ { id: V.id, params: a }
237
237
  ]
238
238
  }), !0) : !1;
239
239
  }
240
- }, fr = {
240
+ }, xr = {
241
241
  id: "sheet.command.set-drawing-arrange",
242
242
  type: q.COMMAND,
243
243
  handler: (i, t) => {
244
- const e = i.get(X), n = i.get(Ge);
244
+ const e = i.get(Y), n = i.get(Je);
245
245
  if (!t) return !1;
246
- const r = i.get(ie), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: d } = t, u = { unitId: s, subUnitId: o, drawingIds: a };
246
+ const r = i.get(se), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: d } = t, u = { unitId: s, subUnitId: o, drawingIds: a };
247
247
  let c;
248
- if (d === wt.forward ? c = r.getForwardDrawingsOp(u) : d === wt.backward ? c = r.getBackwardDrawingOp(u) : d === wt.front ? c = r.getFrontDrawingsOp(u) : d === wt.back && (c = r.getBackDrawingsOp(u)), c == null)
248
+ if (d === Mt.forward ? c = r.getForwardDrawingsOp(u) : d === Mt.backward ? c = r.getBackwardDrawingOp(u) : d === Mt.front ? c = r.getFrontDrawingsOp(u) : d === Mt.back && (c = r.getBackDrawingsOp(u)), c == null)
249
249
  return !1;
250
250
  const { objects: l, redo: g, undo: h } = c;
251
251
  return e.syncExecuteCommand(P.id, { op: g, unitId: s, subUnitId: o, objects: l, type: U.ARRANGE }) ? (n.pushUndoRedo({
@@ -258,94 +258,94 @@ const gr = {
258
258
  ]
259
259
  }), !0) : !1;
260
260
  }
261
- }, Wt = {
261
+ }, zt = {
262
262
  id: "sheet.command.set-sheet-image",
263
263
  type: q.COMMAND,
264
264
  handler: (i, t) => {
265
- const e = i.get(X), n = i.get(Ge), r = i.get(ie);
265
+ const e = i.get(Y), n = i.get(Je), r = i.get(se);
266
266
  if (!t) return !1;
267
267
  const { drawings: s } = t, o = r.getBatchUpdateOp(s), { unitId: a, subUnitId: d, undo: u, redo: c, objects: l } = o;
268
268
  return e.syncExecuteCommand(P.id, { unitId: a, subUnitId: d, op: c, objects: l, type: U.UPDATE }) ? (n.pushUndoRedo({
269
269
  unitID: a,
270
270
  undoMutations: [
271
271
  { id: P.id, params: { unitId: a, subUnitId: d, op: u, objects: l, type: U.UPDATE } },
272
- { id: Y.id, params: [a] }
272
+ { id: V.id, params: [a] }
273
273
  ],
274
274
  redoMutations: [
275
275
  { id: P.id, params: { unitId: a, subUnitId: d, op: c, objects: l, type: U.UPDATE } },
276
- { id: Y.id, params: [a] }
276
+ { id: V.id, params: [a] }
277
277
  ]
278
278
  }), !0) : !1;
279
279
  }
280
- }, mr = {
280
+ }, Wr = {
281
281
  id: "sheet.command.ungroup-sheet-image",
282
282
  type: q.COMMAND,
283
283
  handler: (i, t) => {
284
- const e = i.get(X), n = i.get(Ge), r = i.get(ie);
284
+ const e = i.get(Y), n = i.get(Je), r = i.get(se);
285
285
  if (!t) return !1;
286
286
  const s = [];
287
287
  t.forEach(({ parent: h, children: f }) => {
288
- s.push(h.unitId), f.forEach((p) => {
289
- s.push(p.unitId);
288
+ s.push(h.unitId), f.forEach((m) => {
289
+ s.push(m.unitId);
290
290
  });
291
291
  });
292
292
  const o = r.getUngroupDrawingOp(t), { unitId: a, subUnitId: d, undo: u, redo: c, objects: l } = o;
293
293
  return e.syncExecuteCommand(P.id, { op: c, unitId: a, subUnitId: d, objects: l, type: U.UNGROUP }) ? (n.pushUndoRedo({
294
294
  unitID: a,
295
295
  undoMutations: [
296
- { id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: ts(l), type: U.GROUP } },
297
- { id: Y.id, params: s }
296
+ { id: P.id, params: { op: u, unitId: a, subUnitId: d, objects: Os(l), type: U.GROUP } },
297
+ { id: V.id, params: s }
298
298
  ],
299
299
  redoMutations: [
300
300
  { id: P.id, params: { op: c, unitId: a, subUnitId: d, objects: l, type: U.UNGROUP } },
301
- { id: Y.id, params: s }
301
+ { id: V.id, params: s }
302
302
  ]
303
303
  }), !0) : !1;
304
304
  }
305
305
  };
306
- var rs = Object.getOwnPropertyDescriptor, is = (i, t, e, n) => {
307
- for (var r = n > 1 ? void 0 : n ? rs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
306
+ var Ps = Object.getOwnPropertyDescriptor, As = (i, t, e, n) => {
307
+ for (var r = n > 1 ? void 0 : n ? Ps(t, e) : t, s = i.length - 1, o; s >= 0; s--)
308
308
  (o = i[s]) && (r = o(r) || r);
309
309
  return r;
310
- }, ne = (i, t) => (e, n) => t(e, n, i);
311
- function ss(i, t, e) {
310
+ }, ie = (i, t) => (e, n) => t(e, n, i);
311
+ function Ns(i, t, e) {
312
312
  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));
313
313
  return { rotatedWidth: r, rotatedHeight: s };
314
314
  }
315
- function en(i, t, e, n, r) {
316
- var v;
317
- const { rotatedHeight: s, rotatedWidth: o } = ss(e, n, r), d = i.get(Z).getRenderById(t.unitId);
315
+ function _n(i, t, e, n, r) {
316
+ var S;
317
+ const { rotatedHeight: s, rotatedWidth: o } = Ns(e, n, r), d = i.get(Q).getRenderById(t.unitId);
318
318
  if (!d)
319
319
  return !1;
320
- const c = (v = d.with(V).getSkeletonParam(t.subUnitId)) == null ? void 0 : v.skeleton;
320
+ const c = (S = d.with(X).getSkeletonParam(t.subUnitId)) == null ? void 0 : S.skeleton;
321
321
  if (c == null)
322
322
  return !1;
323
- const l = c.getCellByIndex(t.row, t.col), g = l.mergeInfo.endX - l.mergeInfo.startX - 2, h = l.mergeInfo.endY - l.mergeInfo.startY - 2, f = o / s, m = Math.ceil(Math.min(g, h * f)) / o, _ = !m || Number.isNaN(m) ? 1e-3 : m;
323
+ const l = c.getCellByIndex(t.row, t.col), g = l.mergeInfo.endX - l.mergeInfo.startX - 2, h = l.mergeInfo.endY - l.mergeInfo.startY - 2, f = o / s, p = Math.ceil(Math.min(g, h * f)) / o, w = !p || Number.isNaN(p) ? 1e-3 : p;
324
324
  return {
325
- width: e * _,
326
- height: n * _
325
+ width: e * w,
326
+ height: n * w
327
327
  };
328
328
  }
329
- let et = class extends re {
329
+ let dt = class extends ee {
330
330
  constructor(t, e, n, r, s, o, a, d, u, c, l, g, h) {
331
331
  super();
332
- te(this, "_workbookSelections");
332
+ re(this, "_workbookSelections");
333
333
  this._context = t, this._skeletonManagerService = e, this._commandService = n, this._selectionRenderService = r, this._imageIoService = s, this._fileOpenerService = o, this._sheetDrawingService = a, this._drawingManagerService = d, this._contextService = u, this._messageService = c, this._localeService = l, this._injector = h, this._workbookSelections = g.getWorkbookSelections(this._context.unitId), this._updateImageListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
334
334
  }
335
335
  async insertFloatImage() {
336
336
  const t = await this._fileOpenerService.openFile({
337
337
  multiple: !0,
338
- accept: En.map((n) => `.${n.replace("image/", "")}`).join(",")
338
+ accept: zn.map((n) => `.${n.replace("image/", "")}`).join(",")
339
339
  }), e = t.length;
340
- return e > On ? (this._messageService.show({
341
- type: pe.Error,
342
- content: this._localeService.t("update-status.exceedMaxCount", String(On))
340
+ return e > Kn ? (this._messageService.show({
341
+ type: Se.Error,
342
+ content: this._localeService.t("update-status.exceedMaxCount", String(Kn))
343
343
  }), !1) : e === 0 ? !1 : (t.forEach(async (n) => await this.insertFloatImageByFile(n)), !0);
344
344
  }
345
345
  async insertCellImage() {
346
346
  const e = (await this._fileOpenerService.openFile({
347
347
  multiple: !1,
348
- accept: En.map((n) => `.${n.replace("image/", "")}`).join(",")
348
+ accept: zn.map((n) => `.${n.replace("image/", "")}`).join(",")
349
349
  }))[0];
350
350
  return e ? (await this._insertCellImage(e), !0) : !1;
351
351
  }
@@ -356,75 +356,75 @@ let et = class extends re {
356
356
  let e;
357
357
  try {
358
358
  e = await this._imageIoService.saveImage(t);
359
- } catch (v) {
360
- const I = v.message;
361
- I === Pe.ERROR_EXCEED_SIZE ? this._messageService.show({
362
- type: pe.Error,
363
- content: this._localeService.t("update-status.exceedMaxSize", String(Un / (1024 * 1024)))
364
- }) : I === Pe.ERROR_IMAGE_TYPE ? this._messageService.show({
365
- type: pe.Error,
359
+ } catch (S) {
360
+ const I = S.message;
361
+ I === xe.ERROR_EXCEED_SIZE ? this._messageService.show({
362
+ type: Se.Error,
363
+ content: this._localeService.t("update-status.exceedMaxSize", String(Zn / (1024 * 1024)))
364
+ }) : I === xe.ERROR_IMAGE_TYPE ? this._messageService.show({
365
+ type: Se.Error,
366
366
  content: this._localeService.t("update-status.invalidImageType")
367
- }) : I === Pe.ERROR_IMAGE && this._messageService.show({
368
- type: pe.Error,
367
+ }) : I === xe.ERROR_IMAGE && this._messageService.show({
368
+ type: Se.Error,
369
369
  content: this._localeService.t("update-status.invalidImage")
370
370
  });
371
371
  }
372
372
  if (e == null)
373
373
  return;
374
- const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source: d, base64Cache: u } = e, { width: c, height: l, image: g } = await Gt(u || ""), { width: h, height: f } = this._context.scene;
374
+ const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source: d, base64Cache: u } = e, { width: c, height: l, image: g } = await nn(u || ""), { width: h, height: f } = this._context.scene;
375
375
  this._imageIoService.addImageSourceCache(d, a, g);
376
- let p = 1;
377
- if (c > Pn || l > An) {
378
- const v = Pn / c, I = An / l;
379
- p = Math.max(v, I);
376
+ let m = 1;
377
+ if (c > Jn || l > qn) {
378
+ const S = Jn / c, I = qn / l;
379
+ m = Math.max(S, I);
380
380
  }
381
- const m = this._getImagePosition(c * p, l * p, h, f);
382
- if (m == null)
381
+ const p = this._getImagePosition(c * m, l * m, h, f);
382
+ if (p == null)
383
383
  return;
384
- const _ = {
384
+ const w = {
385
385
  unitId: r,
386
386
  subUnitId: s,
387
387
  drawingId: o,
388
- drawingType: W.DRAWING_IMAGE,
388
+ drawingType: x.DRAWING_IMAGE,
389
389
  imageSourceType: a,
390
390
  source: d,
391
- transform: K(m, this._selectionRenderService, this._skeletonManagerService),
392
- sheetTransform: m
391
+ transform: Z(p, this._selectionRenderService, this._skeletonManagerService),
392
+ sheetTransform: p
393
393
  };
394
- return this._commandService.executeCommand(kt.id, {
394
+ return this._commandService.executeCommand(Xt.id, {
395
395
  unitId: r,
396
- drawings: [_]
396
+ drawings: [w]
397
397
  });
398
398
  }
399
399
  // eslint-disable-next-line max-lines-per-function
400
400
  async _insertCellImage(t, e) {
401
- var I, R;
401
+ var I, D;
402
402
  let n;
403
403
  try {
404
404
  n = await this._imageIoService.saveImage(t);
405
- } catch (S) {
406
- const C = S.message;
407
- C === Pe.ERROR_EXCEED_SIZE ? this._messageService.show({
408
- type: pe.Error,
409
- content: this._localeService.t("update-status.exceedMaxSize", String(Un / (1024 * 1024)))
410
- }) : C === Pe.ERROR_IMAGE_TYPE ? this._messageService.show({
411
- type: pe.Error,
405
+ } catch (v) {
406
+ const C = v.message;
407
+ C === xe.ERROR_EXCEED_SIZE ? this._messageService.show({
408
+ type: Se.Error,
409
+ content: this._localeService.t("update-status.exceedMaxSize", String(Zn / (1024 * 1024)))
410
+ }) : C === xe.ERROR_IMAGE_TYPE ? this._messageService.show({
411
+ type: Se.Error,
412
412
  content: this._localeService.t("update-status.invalidImageType")
413
- }) : C === Pe.ERROR_IMAGE && this._messageService.show({
414
- type: pe.Error,
413
+ }) : C === xe.ERROR_IMAGE && this._messageService.show({
414
+ type: Se.Error,
415
415
  content: this._localeService.t("update-status.invalidImage")
416
416
  });
417
417
  }
418
418
  if (n == null)
419
419
  return !1;
420
- const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: d, height: u, image: c } = await Gt(a || "");
420
+ const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: d, height: u, image: c } = await nn(a || "");
421
421
  this._imageIoService.addImageSourceCache(o, s, c);
422
422
  const l = this._workbookSelections.getCurrentLastSelection();
423
423
  if (!l)
424
424
  return !1;
425
425
  let g = l.primary.actualRow, h = l.primary.actualColumn;
426
426
  l.primary.isMerged && (g = l.primary.startRow, h = l.primary.startColumn);
427
- const f = Vt("", {}), p = en(
427
+ const f = un("", {}), m = _n(
428
428
  this._injector,
429
429
  {
430
430
  unitId: this._context.unitId,
@@ -436,54 +436,54 @@ let et = class extends re {
436
436
  u,
437
437
  0
438
438
  );
439
- if (!p)
439
+ if (!m)
440
440
  return !1;
441
- const m = {
441
+ const p = {
442
442
  size: {
443
- width: p.width,
444
- height: p.height
443
+ width: m.width,
444
+ height: m.height
445
445
  },
446
446
  positionH: {
447
- relativeFrom: vn.PAGE,
447
+ relativeFrom: Wn.PAGE,
448
448
  posOffset: 0
449
449
  },
450
450
  positionV: {
451
- relativeFrom: Sn.PARAGRAPH,
451
+ relativeFrom: xn.PARAGRAPH,
452
452
  posOffset: 0
453
453
  },
454
454
  angle: 0
455
- }, _ = {
455
+ }, w = {
456
456
  unitId: f.getUnitId(),
457
457
  subUnitId: f.getUnitId(),
458
458
  drawingId: r,
459
- drawingType: W.DRAWING_IMAGE,
459
+ drawingType: x.DRAWING_IMAGE,
460
460
  imageSourceType: s,
461
461
  source: o,
462
- transform: Tn(m),
463
- docTransform: m,
464
- behindDoc: Dn.FALSE,
462
+ transform: Xn(p),
463
+ docTransform: p,
464
+ behindDoc: Fn.FALSE,
465
465
  title: "",
466
466
  description: "",
467
- layoutType: Cn.INLINE,
467
+ layoutType: jn.INLINE,
468
468
  // Insert inline drawing by default.
469
- wrapText: In.BOTH_SIDES,
469
+ wrapText: Bn.BOTH_SIDES,
470
470
  distB: 0,
471
471
  distL: 0,
472
472
  distR: 0,
473
473
  distT: 0
474
- }, v = Ht.drawing.add({
474
+ }, S = hn.drawing.add({
475
475
  documentDataModel: f,
476
- drawings: [_],
476
+ drawings: [w],
477
477
  selection: {
478
478
  collapsed: !0,
479
479
  startOffset: 0,
480
480
  endOffset: 0
481
481
  }
482
482
  });
483
- return v ? (f.apply(v), this._commandService.syncExecuteCommand(bn.id, {
483
+ return S ? (f.apply(S), this._commandService.syncExecuteCommand(Ln.id, {
484
484
  value: {
485
485
  [(I = e == null ? void 0 : e.row) != null ? I : g]: {
486
- [(R = e == null ? void 0 : e.col) != null ? R : h]: {
486
+ [(D = e == null ? void 0 : e.col) != null ? D : h]: {
487
487
  p: f.getSnapshot(),
488
488
  t: 1
489
489
  }
@@ -496,12 +496,12 @@ let et = class extends re {
496
496
  // eslint-disable-next-line max-lines-per-function
497
497
  async insertCellImageByUrl(t, e) {
498
498
  var g, h;
499
- const { width: n, height: r, image: s } = await Gt(t || "");
500
- this._imageIoService.addImageSourceCache(t, Rn.URL, s);
499
+ const { width: n, height: r, image: s } = await nn(t || "");
500
+ this._imageIoService.addImageSourceCache(t, Ce.URL, s);
501
501
  const o = this._workbookSelections.getCurrentLastSelection();
502
502
  if (!o)
503
503
  return !1;
504
- const a = Vt("", {}), d = en(
504
+ const a = un("", {}), d = _n(
505
505
  this._injector,
506
506
  {
507
507
  unitId: this._context.unitId,
@@ -521,34 +521,34 @@ let et = class extends re {
521
521
  height: d.height
522
522
  },
523
523
  positionH: {
524
- relativeFrom: vn.PAGE,
524
+ relativeFrom: Wn.PAGE,
525
525
  posOffset: 0
526
526
  },
527
527
  positionV: {
528
- relativeFrom: Sn.PARAGRAPH,
528
+ relativeFrom: xn.PARAGRAPH,
529
529
  posOffset: 0
530
530
  },
531
531
  angle: 0
532
532
  }, c = {
533
533
  unitId: a.getUnitId(),
534
534
  subUnitId: a.getUnitId(),
535
- drawingId: Be(),
536
- drawingType: W.DRAWING_IMAGE,
537
- imageSourceType: Rn.URL,
535
+ drawingId: Ve(),
536
+ drawingType: x.DRAWING_IMAGE,
537
+ imageSourceType: Ce.URL,
538
538
  source: t,
539
- transform: Tn(u),
539
+ transform: Xn(u),
540
540
  docTransform: u,
541
- behindDoc: Dn.FALSE,
541
+ behindDoc: Fn.FALSE,
542
542
  title: "",
543
543
  description: "",
544
- layoutType: Cn.INLINE,
544
+ layoutType: jn.INLINE,
545
545
  // Insert inline drawing by default.
546
- wrapText: In.BOTH_SIDES,
546
+ wrapText: Bn.BOTH_SIDES,
547
547
  distB: 0,
548
548
  distL: 0,
549
549
  distR: 0,
550
550
  distT: 0
551
- }, l = Ht.drawing.add({
551
+ }, l = hn.drawing.add({
552
552
  documentDataModel: a,
553
553
  drawings: [c],
554
554
  selection: {
@@ -557,7 +557,7 @@ let et = class extends re {
557
557
  endOffset: 0
558
558
  }
559
559
  });
560
- return l ? (a.apply(l), this._commandService.syncExecuteCommand(bn.id, {
560
+ return l ? (a.apply(l), this._commandService.syncExecuteCommand(Ln.id, {
561
561
  value: {
562
562
  [(g = e == null ? void 0 : e.row) != null ? g : o.primary.actualRow]: {
563
563
  [(h = e == null ? void 0 : e.col) != null ? h : o.primary.actualColumn]: {
@@ -586,15 +586,15 @@ let et = class extends re {
586
586
  endColumn: 0
587
587
  };
588
588
  s && s.length > 0 && (o = s[s.length - 1].range);
589
- const a = Yn(this._skeletonManagerService.getCurrent().skeleton, o);
589
+ const a = dr(this._skeletonManagerService.getCurrent().skeleton, o);
590
590
  if (a == null)
591
591
  return;
592
592
  let { startColumn: d, startRow: u, startX: c, startY: l } = a, g = !1;
593
593
  if (c + t > n && (c = n - t, c < 0 && (c = 0, t = n), g = !0), l + e > r && (l = r - e, l < 0 && (l = 0, e = r), g = !0), g) {
594
- const m = this._selectionRenderService.getCellWithCoordByOffset(c, l);
595
- if (m == null)
594
+ const p = this._selectionRenderService.getCellWithCoordByOffset(c, l);
595
+ if (p == null)
596
596
  return;
597
- c = m.startX, l = m.startY, d = m.actualColumn, u = m.actualRow;
597
+ c = p.startX, l = p.startY, d = p.actualColumn, u = p.actualRow;
598
598
  }
599
599
  const h = {
600
600
  column: d,
@@ -604,7 +604,7 @@ let et = class extends re {
604
604
  }, f = this._selectionRenderService.getCellWithCoordByOffset(c + t, l + e);
605
605
  if (f == null)
606
606
  return;
607
- const p = {
607
+ const m = {
608
608
  column: f.actualColumn,
609
609
  columnOffset: c + t - f.startX,
610
610
  row: f.actualRow,
@@ -612,13 +612,13 @@ let et = class extends re {
612
612
  };
613
613
  return {
614
614
  from: h,
615
- to: p
615
+ to: m
616
616
  };
617
617
  }
618
618
  _updateOrderListener() {
619
619
  this.disposeWithMe(this._drawingManagerService.featurePluginOrderUpdate$.subscribe((t) => {
620
620
  const { unitId: e, subUnitId: n, drawingIds: r, arrangeType: s } = t;
621
- this._commandService.executeCommand(fr.id, {
621
+ this._commandService.executeCommand(xr.id, {
622
622
  unitId: e,
623
623
  subUnitId: n,
624
624
  drawingIds: r,
@@ -636,16 +636,16 @@ let et = class extends re {
636
636
  const u = this._sheetDrawingService.getDrawingByParam({ unitId: r, subUnitId: s, drawingId: o });
637
637
  if (u == null || u.unitId !== this._context.unitId)
638
638
  return;
639
- const c = $({ ...u.transform, ...d }, this._selectionRenderService);
639
+ const c = j({ ...u.transform, ...d }, this._selectionRenderService);
640
640
  if (c == null)
641
641
  return;
642
642
  const l = {
643
643
  ...n,
644
- transform: { ...u.transform, ...d, ...K(c, this._selectionRenderService, this._skeletonManagerService) },
644
+ transform: { ...u.transform, ...d, ...Z(c, this._selectionRenderService, this._skeletonManagerService) },
645
645
  sheetTransform: { ...c }
646
646
  };
647
647
  e.push(l);
648
- }), e.length > 0 && this._commandService.executeCommand(Wt.id, {
648
+ }), e.length > 0 && this._commandService.executeCommand(zt.id, {
649
649
  unitId: t[0].unitId,
650
650
  drawings: e
651
651
  }));
@@ -653,45 +653,45 @@ let et = class extends re {
653
653
  }
654
654
  _groupDrawingListener() {
655
655
  this.disposeWithMe(this._drawingManagerService.featurePluginGroupUpdate$.subscribe((t) => {
656
- this._commandService.executeCommand(gr.id, t);
656
+ this._commandService.executeCommand(kr.id, t);
657
657
  const { unitId: e, subUnitId: n, drawingId: r } = t[0].parent;
658
- this._commandService.syncExecuteCommand(Nt.id, [{ unitId: e, subUnitId: n, drawingId: r }]);
658
+ this._commandService.syncExecuteCommand(Ht.id, [{ unitId: e, subUnitId: n, drawingId: r }]);
659
659
  })), this.disposeWithMe(this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((t) => {
660
- this._commandService.executeCommand(mr.id, t);
660
+ this._commandService.executeCommand(Wr.id, t);
661
661
  }));
662
662
  }
663
663
  _focusDrawingListener() {
664
664
  this.disposeWithMe(
665
665
  this._drawingManagerService.focus$.subscribe((t) => {
666
- t == null || t.length === 0 ? (this._contextService.setContextValue(Fe, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(Fe, !0), this._sheetDrawingService.focusDrawing(t));
666
+ t == null || t.length === 0 ? (this._contextService.setContextValue(Ge, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(Ge, !0), this._sheetDrawingService.focusDrawing(t));
667
667
  })
668
668
  );
669
669
  }
670
670
  };
671
- et = is([
672
- ne(1, A(V)),
673
- ne(2, X),
674
- ne(3, Ye),
675
- ne(4, Oi),
676
- ne(5, Ai),
677
- ne(6, ie),
678
- ne(7, se),
679
- ne(8, Xn),
680
- ne(9, cr),
681
- ne(10, A(nt)),
682
- ne(11, A(on)),
683
- ne(12, A(Xe))
684
- ], et);
685
- const Bt = {
671
+ dt = As([
672
+ ie(1, A(X)),
673
+ ie(2, Y),
674
+ ie(3, Ze),
675
+ ie(4, ss),
676
+ ie(5, cs),
677
+ ie(6, se),
678
+ ie(7, oe),
679
+ ie(8, ur),
680
+ ie(9, Or),
681
+ ie(10, A(Te)),
682
+ ie(11, A(ut)),
683
+ ie(12, A(qe))
684
+ ], dt);
685
+ const Kt = {
686
686
  id: "sheet.command.insert-float-image",
687
687
  type: q.COMMAND,
688
688
  handler: async (i, t) => {
689
689
  var o, a;
690
- const e = i.get(Se), n = i.get(Z), r = (o = sn(
691
- F.UNIVER_SHEET,
690
+ const e = i.get(de), n = i.get(Q), r = (o = Dn(
691
+ $.UNIVER_SHEET,
692
692
  e,
693
693
  n
694
- )) == null ? void 0 : o.with(et);
694
+ )) == null ? void 0 : o.with(dt);
695
695
  if (!r)
696
696
  return !1;
697
697
  const s = t == null ? void 0 : t.files;
@@ -701,23 +701,23 @@ const Bt = {
701
701
  } else
702
702
  return (a = r.insertFloatImage()) != null ? a : !1;
703
703
  }
704
- }, dn = {
704
+ }, Mn = {
705
705
  id: "sheet.command.insert-cell-image",
706
706
  type: q.COMMAND,
707
707
  handler: (i) => {
708
708
  var n, r;
709
- const t = i.get(Se), e = i.get(Z);
710
- return (r = (n = sn(
711
- F.UNIVER_SHEET,
709
+ const t = i.get(de), e = i.get(Q);
710
+ return (r = (n = Dn(
711
+ $.UNIVER_SHEET,
712
712
  t,
713
713
  e
714
- )) == null ? void 0 : n.with(et).insertCellImage()) != null ? r : !1;
714
+ )) == null ? void 0 : n.with(dt).insertCellImage()) != null ? r : !1;
715
715
  }
716
- }, it = {
716
+ }, gt = {
717
717
  id: "sheet.command.move-drawing",
718
718
  type: q.COMMAND,
719
719
  handler: (i, t) => {
720
- const e = i.get(X), n = i.get(ie), r = i.get(Ye), { direction: s } = t, o = n.getFocusDrawings();
720
+ const e = i.get(Y), n = i.get(se), r = i.get(Ze), { direction: s } = t, o = n.getFocusDrawings();
721
721
  if (o.length === 0)
722
722
  return !1;
723
723
  const a = o[0].unitId, d = o.map((c) => {
@@ -725,30 +725,345 @@ const Bt = {
725
725
  if (l == null)
726
726
  return null;
727
727
  const g = { ...l }, { left: h = 0, top: f = 0 } = l;
728
- return s === _e.UP ? g.top = f - 1 : s === _e.DOWN ? g.top = f + 1 : s === _e.LEFT ? g.left = h - 1 : s === _e.RIGHT && (g.left = h + 1), {
728
+ return s === ve.UP ? g.top = f - 1 : s === ve.DOWN ? g.top = f + 1 : s === ve.LEFT ? g.left = h - 1 : s === ve.RIGHT && (g.left = h + 1), {
729
729
  ...c,
730
730
  transform: g,
731
- sheetTransform: $(g, r)
731
+ sheetTransform: j(g, r)
732
732
  };
733
733
  }).filter((c) => c != null);
734
- return e.syncExecuteCommand(Wt.id, {
734
+ return e.syncExecuteCommand(zt.id, {
735
735
  unitId: a,
736
736
  drawings: d
737
- }) ? (e.syncExecuteCommand(Y.id, [a]), !0) : !1;
737
+ }) ? (e.syncExecuteCommand(V.id, [a]), !0) : !1;
738
+ }
739
+ };
740
+ var $s = Object.getOwnPropertyDescriptor, ks = (i, t, e, n) => {
741
+ for (var r = n > 1 ? void 0 : n ? $s(t, e) : t, s = i.length - 1, o; s >= 0; s--)
742
+ (o = i[s]) && (r = o(r) || r);
743
+ return r;
744
+ }, an = (i, t) => (e, n) => t(e, n, i), ye = /* @__PURE__ */ ((i) => (i.CELL_ADDRESS = "cellAddress", i.COLUMN_VALUE = "columnValue", i))(ye || {});
745
+ const yn = pi("sheets-drawing-ui.batch-save-images.service");
746
+ function Sn(i) {
747
+ let t = "", e = i;
748
+ for (; e >= 0; )
749
+ t = String.fromCharCode(e % 26 + 65) + t, e = Math.floor(e / 26) - 1;
750
+ return t;
751
+ }
752
+ function At(i, t) {
753
+ return `${Sn(t)}${i + 1}`;
754
+ }
755
+ function xs(i) {
756
+ const t = At(i.startRow, i.startColumn), e = At(i.endRow, i.endColumn);
757
+ return t === e ? t : `${t}:${e}`;
758
+ }
759
+ function nr(i) {
760
+ var t, e, n, r;
761
+ return !!((e = (t = i == null ? void 0 : i.p) == null ? void 0 : t.drawingsOrder) != null && e.length && ((r = (n = i == null ? void 0 : i.p) == null ? void 0 : n.drawingsOrder) == null ? void 0 : r.length) > 0);
762
+ }
763
+ function rr(i) {
764
+ var n, r, s;
765
+ if (!((r = (n = i.p) == null ? void 0 : n.drawingsOrder) != null && r.length) || !((s = i.p) != null && s.drawings))
766
+ return null;
767
+ const t = i.p.drawingsOrder[0], e = i.p.drawings[t];
768
+ return !e || !("source" in e) || !("imageSourceType" in e) ? null : e;
769
+ }
770
+ function cn(i, t) {
771
+ if (t === Ce.BASE64) {
772
+ const e = i.match(/^data:image\/(\w+);/);
773
+ if (e)
774
+ return e[1] === "jpeg" ? "jpg" : e[1];
738
775
  }
739
- }, pr = "COMPONENT_SHEET_DRAWING_PANEL", wr = {
776
+ if (t === Ce.URL) {
777
+ const e = i.match(/\.(\w+)(?:\?|$)/);
778
+ if (e)
779
+ return e[1].toLowerCase();
780
+ }
781
+ return "png";
782
+ }
783
+ async function ir(i, t) {
784
+ if (t === Ce.BASE64)
785
+ return (await fetch(i)).blob();
786
+ if (t === Ce.URL)
787
+ return (await fetch(i)).blob();
788
+ throw new Error("UUID image type requires additional handling");
789
+ }
790
+ let vn = class extends ee {
791
+ constructor(i, t, e) {
792
+ super(), this._univerInstanceService = i, this._selectionService = t, this._imageIoService = e;
793
+ }
794
+ getCellImagesInSelection() {
795
+ const i = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET);
796
+ if (!i) return [];
797
+ const t = i.getActiveSheet();
798
+ if (!t) return [];
799
+ const e = this._selectionService.getCurrentSelections();
800
+ if (!e || e.length === 0) return [];
801
+ const n = t.getCellMatrix(), r = [];
802
+ for (const s of e) {
803
+ const { startRow: o, endRow: a, startColumn: d, endColumn: u } = s.range;
804
+ for (let c = o; c <= a; c++)
805
+ for (let l = d; l <= u; l++) {
806
+ const g = n.getValue(c, l);
807
+ if (nr(g)) {
808
+ const h = rr(g);
809
+ h && r.push({
810
+ row: c,
811
+ col: l,
812
+ cellAddress: At(c, l),
813
+ source: h.source,
814
+ imageSourceType: h.imageSourceType,
815
+ imageId: h.drawingId
816
+ });
817
+ }
818
+ }
819
+ }
820
+ return r;
821
+ }
822
+ getCellImagesFromRanges(i, t, e) {
823
+ const n = this._univerInstanceService.getUnit(i, $.UNIVER_SHEET);
824
+ if (!n) return [];
825
+ const r = n.getSheetBySheetId(t);
826
+ if (!r) return [];
827
+ const s = r.getCellMatrix(), o = [];
828
+ for (const a of e) {
829
+ const { startRow: d, endRow: u, startColumn: c, endColumn: l } = a;
830
+ for (let g = d; g <= u; g++)
831
+ for (let h = c; h <= l; h++) {
832
+ const f = s.getValue(g, h);
833
+ if (nr(f)) {
834
+ const m = rr(f);
835
+ m && o.push({
836
+ row: g,
837
+ col: h,
838
+ cellAddress: At(g, h),
839
+ source: m.source,
840
+ imageSourceType: m.imageSourceType,
841
+ imageId: m.drawingId
842
+ });
843
+ }
844
+ }
845
+ }
846
+ return o;
847
+ }
848
+ getDataColumns() {
849
+ var l, g, h, f;
850
+ const i = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET);
851
+ if (!i) return [];
852
+ const t = i.getActiveSheet();
853
+ if (!t) return [];
854
+ const e = this._selectionService.getCurrentSelections();
855
+ if (!e || e.length === 0) return [];
856
+ const n = t.getCellMatrix(), r = n.getDataRange();
857
+ let s = 1 / 0, o = -1 / 0;
858
+ const a = /* @__PURE__ */ new Set();
859
+ for (const m of e) {
860
+ s = Math.min(s, m.range.startRow), o = Math.max(o, m.range.endRow);
861
+ for (let p = m.range.startColumn; p <= m.range.endColumn; p++)
862
+ a.add(p);
863
+ }
864
+ const d = /* @__PURE__ */ new Set();
865
+ for (let m = r.startColumn; m <= r.endColumn; m++)
866
+ if (!a.has(m))
867
+ for (let p = s; p <= o; p++) {
868
+ const w = n.getValue(p, m);
869
+ if (w && (((l = w.v) == null ? void 0 : l.toString()) || ((f = (h = (g = w.p) == null ? void 0 : g.body) == null ? void 0 : h.dataStream) == null ? void 0 : f.trim()) || "")) {
870
+ d.add(m);
871
+ break;
872
+ }
873
+ }
874
+ const u = [], c = Array.from(d).sort((m, p) => m - p);
875
+ for (const m of c)
876
+ u.push({
877
+ index: m,
878
+ label: Sn(m)
879
+ });
880
+ return u;
881
+ }
882
+ getDataColumnsForRanges(i, t, e) {
883
+ var h, f, m, p;
884
+ const n = this._univerInstanceService.getUnit(i, $.UNIVER_SHEET);
885
+ if (!n) return [];
886
+ const r = n.getSheetBySheetId(t);
887
+ if (!r) return [];
888
+ const s = r.getCellMatrix(), o = s.getDataRange();
889
+ let a = 1 / 0, d = -1 / 0;
890
+ const u = /* @__PURE__ */ new Set();
891
+ for (const w of e) {
892
+ a = Math.min(a, w.startRow), d = Math.max(d, w.endRow);
893
+ for (let S = w.startColumn; S <= w.endColumn; S++)
894
+ u.add(S);
895
+ }
896
+ const c = /* @__PURE__ */ new Set();
897
+ for (let w = o.startColumn; w <= o.endColumn; w++)
898
+ if (!u.has(w))
899
+ for (let S = a; S <= d; S++) {
900
+ const I = s.getValue(S, w);
901
+ if (I && (((h = I.v) == null ? void 0 : h.toString()) || ((p = (m = (f = I.p) == null ? void 0 : f.body) == null ? void 0 : m.dataStream) == null ? void 0 : p.trim()) || "")) {
902
+ c.add(w);
903
+ break;
904
+ }
905
+ }
906
+ const l = [], g = Array.from(c).sort((w, S) => w - S);
907
+ for (const w of g)
908
+ l.push({
909
+ index: w,
910
+ label: Sn(w)
911
+ });
912
+ return l;
913
+ }
914
+ getSelectionRangeNotation() {
915
+ const i = this._selectionService.getCurrentSelections();
916
+ return !i || i.length === 0 ? "" : i.map((t) => xs(t.range)).join(", ");
917
+ }
918
+ getSelectionRowRange() {
919
+ const i = this._selectionService.getCurrentSelections();
920
+ if (!i || i.length === 0) return null;
921
+ let t = 1 / 0, e = -1 / 0;
922
+ for (const n of i)
923
+ t = Math.min(t, n.range.startRow), e = Math.max(e, n.range.endRow);
924
+ return { startRow: t, endRow: e };
925
+ }
926
+ getSelectionColumnIndices() {
927
+ const i = this._selectionService.getCurrentSelections();
928
+ if (!i || i.length === 0) return /* @__PURE__ */ new Set();
929
+ const t = /* @__PURE__ */ new Set();
930
+ for (const e of i)
931
+ for (let n = e.range.startColumn; n <= e.range.endColumn; n++)
932
+ t.add(n);
933
+ return t;
934
+ }
935
+ generateFileName(i, t) {
936
+ var s, o, a, d;
937
+ const e = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET), n = cn(i.source, i.imageSourceType), r = [];
938
+ for (const u of t.fileNameParts)
939
+ if (u === "cellAddress")
940
+ r.push(i.cellAddress);
941
+ else if (u === "columnValue" && t.columnIndex !== void 0) {
942
+ const c = e == null ? void 0 : e.getActiveSheet();
943
+ if (c) {
944
+ const g = c.getCellMatrix().getValue(i.row, t.columnIndex);
945
+ if (g) {
946
+ const h = ((s = g.v) == null ? void 0 : s.toString()) || ((d = (a = (o = g.p) == null ? void 0 : o.body) == null ? void 0 : a.dataStream) == null ? void 0 : d.trim()) || "";
947
+ if (h) {
948
+ const f = h.replace(/[<>:"/\\|?*]/g, "_").trim();
949
+ f && r.push(f);
950
+ }
951
+ }
952
+ }
953
+ }
954
+ return r.length === 0 ? `${i.cellAddress}.${n}` : `${r.join("_")}.${n}`;
955
+ }
956
+ generateFileNameWithContext(i, t, e, n) {
957
+ var a, d, u, c;
958
+ const r = this._univerInstanceService.getUnit(e, $.UNIVER_SHEET), s = cn(i.source, i.imageSourceType), o = [];
959
+ for (const l of t.fileNameParts)
960
+ if (l === "cellAddress")
961
+ o.push(i.cellAddress);
962
+ else if (l === "columnValue" && t.columnIndex !== void 0) {
963
+ const g = r == null ? void 0 : r.getSheetBySheetId(n);
964
+ if (g) {
965
+ const f = g.getCellMatrix().getValue(i.row, t.columnIndex);
966
+ if (f) {
967
+ const m = ((a = f.v) == null ? void 0 : a.toString()) || ((c = (u = (d = f.p) == null ? void 0 : d.body) == null ? void 0 : u.dataStream) == null ? void 0 : c.trim()) || "";
968
+ if (m) {
969
+ const p = m.replace(/[<>:"/\\|?*]/g, "_").trim();
970
+ p && o.push(p);
971
+ }
972
+ }
973
+ }
974
+ }
975
+ return o.length === 0 ? `${i.cellAddress}.${s}` : `${o.join("_")}.${s}`;
976
+ }
977
+ async saveImages(i, t) {
978
+ var r;
979
+ const e = await window.showDirectoryPicker({ mode: "readwrite" }), n = /* @__PURE__ */ new Map();
980
+ for (const s of i) {
981
+ let o = this.generateFileName(s, t);
982
+ const a = o.replace(/\.\w+$/, ""), d = ((r = o.match(/\.\w+$/)) == null ? void 0 : r[0]) || ".png", u = n.get(a) || 0;
983
+ u > 0 && (o = `${a}_${u}${d}`), n.set(a, u + 1);
984
+ try {
985
+ const c = await this._getImageBlob(s), g = await (await e.getFileHandle(o, { create: !0 })).createWritable();
986
+ await g.write(c), await g.close();
987
+ } catch (c) {
988
+ throw console.error(`Failed to save image ${o}:`, c), c;
989
+ }
990
+ }
991
+ }
992
+ async saveImagesWithContext(i, t, e, n) {
993
+ var o;
994
+ const r = await window.showDirectoryPicker({ mode: "readwrite" }), s = /* @__PURE__ */ new Map();
995
+ for (const a of i) {
996
+ let d = this.generateFileNameWithContext(a, t, e, n);
997
+ const u = d.replace(/\.\w+$/, ""), c = ((o = d.match(/\.\w+$/)) == null ? void 0 : o[0]) || ".png", l = s.get(u) || 0;
998
+ l > 0 && (d = `${u}_${l}${c}`), s.set(u, l + 1);
999
+ try {
1000
+ const g = await this._getImageBlob(a), f = await (await r.getFileHandle(d, { create: !0 })).createWritable();
1001
+ await f.write(g), await f.close();
1002
+ } catch (g) {
1003
+ throw console.error(`Failed to save image ${d}:`, g), g;
1004
+ }
1005
+ }
1006
+ }
1007
+ async downloadSingleImage(i) {
1008
+ const t = cn(i.source, i.imageSourceType), e = `${i.cellAddress}.${t}`;
1009
+ try {
1010
+ const n = await this._getImageBlob(i), r = URL.createObjectURL(n), s = document.createElement("a");
1011
+ s.href = r, s.download = e, document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(r);
1012
+ } catch (n) {
1013
+ throw console.error(`Failed to download image ${e}:`, n), n;
1014
+ }
1015
+ }
1016
+ async _getImageBlob(i) {
1017
+ if (i.imageSourceType === Ce.UUID) {
1018
+ const t = await this._imageIoService.getImage(i.source);
1019
+ return ir(t, Ce.URL);
1020
+ }
1021
+ return ir(i.source, i.imageSourceType);
1022
+ }
1023
+ };
1024
+ vn = ks([
1025
+ an(0, de),
1026
+ an(1, A(ut)),
1027
+ an(2, hr)
1028
+ ], vn);
1029
+ const ze = "sheet.dialog.batch-save-images", ct = {
1030
+ id: "sheet.command.save-cell-images",
1031
+ type: q.COMMAND,
1032
+ handler: async (i) => {
1033
+ const t = i.get(bn), e = i.get(yn), n = e.getCellImagesInSelection();
1034
+ if (n.length === 1)
1035
+ try {
1036
+ return await e.downloadSingleImage(n[0]), !0;
1037
+ } catch (a) {
1038
+ return console.error("Failed to download image:", a), !1;
1039
+ }
1040
+ const r = i.get(Te), s = e.getSelectionRangeNotation(), o = `${r.t("sheetImage.save.title")} (${s})`;
1041
+ return t.open({
1042
+ id: ze,
1043
+ draggable: !0,
1044
+ width: 360,
1045
+ title: { title: o },
1046
+ children: {
1047
+ label: ze
1048
+ },
1049
+ destroyOnClose: !0,
1050
+ preservePositionOnDestroy: !0,
1051
+ onClose: () => t.close(ze)
1052
+ }), !0;
1053
+ }
1054
+ }, Br = "COMPONENT_SHEET_DRAWING_PANEL", jr = {
740
1055
  id: "sidebar.operation.sheet-image",
741
1056
  type: q.COMMAND,
742
1057
  handler: async (i, t) => {
743
- const e = i.get(Ni), n = i.get(nt), r = i.get(Se), s = i.get(X);
744
- if (!oe(r)) return !1;
1058
+ const e = i.get(ds), n = i.get(Te), r = i.get(de), s = i.get(Y);
1059
+ if (!ae(r)) return !1;
745
1060
  switch (t.value) {
746
1061
  case "open":
747
1062
  e.open({
748
1063
  header: { title: n.t("sheetImage.panel.title") },
749
- children: { label: pr },
1064
+ children: { label: Br },
750
1065
  onClose: () => {
751
- s.syncExecuteCommand(Nt.id, []);
1066
+ s.syncExecuteCommand(Ht.id, []);
752
1067
  },
753
1068
  width: 360
754
1069
  });
@@ -760,27 +1075,27 @@ const Bt = {
760
1075
  }
761
1076
  return !0;
762
1077
  }
763
- }, _r = {
1078
+ }, Fr = {
764
1079
  id: "sheet.operation.edit-sheet-image",
765
1080
  type: q.OPERATION,
766
1081
  handler: (i, t) => {
767
- const e = i.get(X);
768
- return t == null ? !1 : (e.syncExecuteCommand(Nt.id, [t]), e.executeCommand(wr.id, { value: "open" }), !0);
1082
+ const e = i.get(Y);
1083
+ return t == null ? !1 : (e.syncExecuteCommand(Ht.id, [t]), e.executeCommand(jr.id, { value: "open" }), !0);
769
1084
  }
770
- }, os = "sheets-drawing-ui.config", jn = {};
771
- var as = Object.getOwnPropertyDescriptor, cs = (i, t, e, n) => {
772
- for (var r = n > 1 ? void 0 : n ? as(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1085
+ }, Ws = "sheets-drawing-ui.config", sr = {};
1086
+ var Bs = Object.getOwnPropertyDescriptor, js = (i, t, e, n) => {
1087
+ for (var r = n > 1 ? void 0 : n ? Bs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
773
1088
  (o = i[s]) && (r = o(r) || r);
774
1089
  return r;
775
1090
  }, ce = (i, t) => (e, n) => t(e, n, i);
776
- let Rt = class extends Xr {
1091
+ let Nt = class extends wi {
777
1092
  constructor(t, e, n, r, s, o, a, d, u, c) {
778
1093
  super();
779
- te(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
1094
+ re(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
780
1095
  this._injector = t, this._localeService = e, this._drawingManagerService = n, this._canvasPopManagerService = r, this._renderManagerService = s, this._univerInstanceService = o, this._messageService = a, this._contextService = d, this._ioService = u, this._commandService = c, this._init();
781
1096
  }
782
1097
  _init() {
783
- this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(Nn(this.dispose$)).subscribe((t) => this._create(t)), this._univerInstanceService.getTypeOfUnitDisposed$(F.UNIVER_SHEET).pipe(Nn(this.dispose$)).subscribe((t) => this._dispose(t)), this._univerInstanceService.getAllUnitsForType(F.UNIVER_SHEET).forEach((t) => this._create(t)), this._setupLoadingStatus();
1098
+ this._univerInstanceService.getCurrentTypeOfUnit$($.UNIVER_SHEET).pipe(Qn(this.dispose$)).subscribe((t) => this._create(t)), this._univerInstanceService.getTypeOfUnitDisposed$($.UNIVER_SHEET).pipe(Qn(this.dispose$)).subscribe((t) => this._dispose(t)), this._univerInstanceService.getAllUnitsForType($.UNIVER_SHEET).forEach((t) => this._create(t)), this._setupLoadingStatus();
784
1099
  }
785
1100
  _setupLoadingStatus() {
786
1101
  const t = "image-upload-loading";
@@ -788,7 +1103,7 @@ let Rt = class extends Xr {
788
1103
  this.disposeWithMe(this._ioService.change$.subscribe((n) => {
789
1104
  n > 0 && !e ? e = this._messageService.show({
790
1105
  id: t,
791
- type: pe.Loading,
1106
+ type: Se.Loading,
792
1107
  content: `${this._localeService.t("uploadLoading.loading")}: ${n}`,
793
1108
  duration: 0
794
1109
  }) : n === 0 && (e == null || e.dispose(), e = void 0);
@@ -808,7 +1123,7 @@ let Rt = class extends Xr {
808
1123
  _hasCropObject(t) {
809
1124
  const e = t.getAllObjectsByOrder();
810
1125
  for (const n of e)
811
- if (n instanceof Li)
1126
+ if (n instanceof Ss)
812
1127
  return !0;
813
1128
  return !1;
814
1129
  }
@@ -823,7 +1138,7 @@ let Rt = class extends Xr {
823
1138
  let r;
824
1139
  this.disposeWithMe(
825
1140
  n.createControl$.subscribe(() => {
826
- if (this._contextService.setContextValue(Fe, !0), this._hasCropObject(e))
1141
+ if (this._contextService.setContextValue(Ge, !0), this._hasCropObject(e))
827
1142
  return;
828
1143
  const o = n.getSelectedObjectMap();
829
1144
  if (o.size > 1) {
@@ -840,23 +1155,23 @@ let Rt = class extends Xr {
840
1155
  if (f && f.disablePopup)
841
1156
  return;
842
1157
  r == null || r.dispose();
843
- const p = this._canvasPopManagerService.getFeatureMenu(c, l, g, h);
1158
+ const m = this._canvasPopManagerService.getFeatureMenu(c, l, g, h);
844
1159
  r = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(a, {
845
- componentKey: Vi,
1160
+ componentKey: vs,
846
1161
  direction: "horizontal",
847
1162
  offset: [2, 0],
848
1163
  extraProps: {
849
- menuItems: p || this._getImageMenuItems(c, l, g, h)
1164
+ menuItems: m || this._getImageMenuItems(c, l, g, h)
850
1165
  }
851
1166
  }));
852
1167
  })
853
1168
  ), this.disposeWithMe(
854
1169
  n.clearControl$.subscribe(() => {
855
- r == null || r.dispose(), this._contextService.setContextValue(Fe, !1), this._commandService.syncExecuteCommand(Nt.id, []);
1170
+ r == null || r.dispose(), this._contextService.setContextValue(Ge, !1), this._commandService.syncExecuteCommand(Ht.id, []);
856
1171
  })
857
1172
  ), this.disposeWithMe(
858
1173
  this._contextService.contextChanged$.subscribe((o) => {
859
- o[Fe] === !1 && (r == null || r.dispose());
1174
+ o[Ge] === !1 && (r == null || r.dispose());
860
1175
  })
861
1176
  ), this.disposeWithMe(
862
1177
  n.changing$.subscribe(() => {
@@ -869,62 +1184,62 @@ let Rt = class extends Xr {
869
1184
  {
870
1185
  label: "image-popup.edit",
871
1186
  index: 0,
872
- commandId: _r.id,
1187
+ commandId: Fr.id,
873
1188
  commandParams: { unitId: t, subUnitId: e, drawingId: n },
874
- disable: r === W.DRAWING_DOM
1189
+ disable: r === x.DRAWING_DOM
875
1190
  },
876
1191
  {
877
1192
  label: "image-popup.delete",
878
1193
  index: 1,
879
- commandId: rt.id,
1194
+ commandId: ht.id,
880
1195
  commandParams: { unitId: t, drawings: [{ unitId: t, subUnitId: e, drawingId: n }] },
881
1196
  disable: !1
882
1197
  },
883
1198
  {
884
1199
  label: "image-popup.crop",
885
1200
  index: 2,
886
- commandId: Hi.id,
1201
+ commandId: Is.id,
887
1202
  commandParams: { unitId: t, subUnitId: e, drawingId: n },
888
- disable: r === W.DRAWING_DOM
1203
+ disable: r === x.DRAWING_DOM
889
1204
  },
890
1205
  {
891
1206
  label: "image-popup.reset",
892
1207
  index: 3,
893
- commandId: zi.id,
1208
+ commandId: Cs.id,
894
1209
  commandParams: [{ unitId: t, subUnitId: e, drawingId: n }],
895
- disable: r === W.DRAWING_DOM
1210
+ disable: r === x.DRAWING_DOM
896
1211
  }
897
1212
  ];
898
1213
  }
899
1214
  };
900
- Rt = cs([
901
- ce(0, A(Xe)),
902
- ce(1, A(nt)),
903
- ce(2, se),
904
- ce(3, A(Ar)),
905
- ce(4, Z),
906
- ce(5, Se),
907
- ce(6, cr),
908
- ce(7, Xn),
909
- ce(8, Gr),
910
- ce(9, X)
911
- ], Rt);
912
- var ds = Object.getOwnPropertyDescriptor, ls = (i, t, e, n) => {
913
- for (var r = n > 1 ? void 0 : n ? ds(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1215
+ Nt = js([
1216
+ ce(0, A(qe)),
1217
+ ce(1, A(Te)),
1218
+ ce(2, oe),
1219
+ ce(3, A(si)),
1220
+ ce(4, Q),
1221
+ ce(5, de),
1222
+ ce(6, Or),
1223
+ ce(7, ur),
1224
+ ce(8, hr),
1225
+ ce(9, Y)
1226
+ ], Nt);
1227
+ var Fs = Object.getOwnPropertyDescriptor, Ls = (i, t, e, n) => {
1228
+ for (var r = n > 1 ? void 0 : n ? Fs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
914
1229
  (o = i[s]) && (r = o(r) || r);
915
1230
  return r;
916
- }, vt = (i, t) => (e, n) => t(e, n, i);
917
- let tn = class extends re {
1231
+ }, Tt = (i, t) => (e, n) => t(e, n, i);
1232
+ let In = class extends ee {
918
1233
  constructor(t, e, n, r, s) {
919
1234
  super();
920
- te(this, "_isSetCursor", !1);
1235
+ re(this, "_isSetCursor", !1);
921
1236
  this._context = t, this._hoverManagerService = e, this._selectionsService = n, this._drawingRenderService = r, this._sheetSkeletonManagerService = s, this._initHover(), this._initImageClick();
922
1237
  }
923
1238
  _initHover() {
924
- this.disposeWithMe(this._hoverManagerService.currentRichTextNoDistinct$.pipe(Zi(33)).subscribe((t) => {
1239
+ this.disposeWithMe(this._hoverManagerService.currentRichTextNoDistinct$.pipe(bs(33)).subscribe((t) => {
925
1240
  var n, r;
926
1241
  let e = [];
927
- t !== null && (e = this._selectionsService.getWorkbookSelections(this._context.unitId).getCurrentSelections()), e.length > 0 && (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(Ur.ZOOM_IN)) : this._isSetCursor && (this._isSetCursor = !1, this._context.scene.resetCursor());
1242
+ t !== null && (e = this._selectionsService.getWorkbookSelections(this._context.unitId).getCurrentSelections()), e.length > 0 && (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(ri.ZOOM_IN)) : this._isSetCursor && (this._isSetCursor = !1, this._context.scene.resetCursor());
928
1243
  }));
929
1244
  }
930
1245
  _initImageClick() {
@@ -938,18 +1253,18 @@ let tn = class extends re {
938
1253
  }));
939
1254
  }
940
1255
  };
941
- tn = ls([
942
- vt(1, A(Nr)),
943
- vt(2, A(on)),
944
- vt(3, A(lr)),
945
- vt(4, A(V))
946
- ], tn);
947
- var us = Object.getOwnPropertyDescriptor, hs = (i, t, e, n) => {
948
- for (var r = n > 1 ? void 0 : n ? us(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1256
+ In = Ls([
1257
+ Tt(1, A(oi)),
1258
+ Tt(2, A(ut)),
1259
+ Tt(3, A(Pr)),
1260
+ Tt(4, A(X))
1261
+ ], In);
1262
+ var Vs = Object.getOwnPropertyDescriptor, Hs = (i, t, e, n) => {
1263
+ for (var r = n > 1 ? void 0 : n ? Vs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
949
1264
  (o = i[s]) && (r = o(r) || r);
950
1265
  return r;
951
- }, It = (i, t) => (e, n) => t(e, n, i);
952
- let nn = class extends re {
1266
+ }, Ot = (i, t) => (e, n) => t(e, n, i);
1267
+ let Cn = class extends ee {
953
1268
  constructor(i, t, e, n, r) {
954
1269
  super(), this._context = i, this._sheetDrawingService = t, this._drawingManagerService = e, this._sheetSelectionRenderService = n, this._sheetSkeletonManagerService = r, this._init();
955
1270
  }
@@ -963,27 +1278,27 @@ let nn = class extends re {
963
1278
  const e = i[t];
964
1279
  for (const n in e.data) {
965
1280
  const r = e.data[n];
966
- r.sheetTransform && (r.transform = K(r.sheetTransform, this._sheetSelectionRenderService, this._sheetSkeletonManagerService));
1281
+ r.sheetTransform && (r.transform = Z(r.sheetTransform, this._sheetSelectionRenderService, this._sheetSkeletonManagerService));
967
1282
  }
968
1283
  }
969
1284
  this._drawingManagerService.registerDrawingData(this._context.unitId, this._sheetDrawingService.getDrawingDataForUnit(this._context.unitId)), this._drawingManagerService.initializeNotification(this._context.unitId);
970
1285
  }
971
1286
  };
972
- nn = hs([
973
- It(1, ie),
974
- It(2, se),
975
- It(3, A(Ye)),
976
- It(4, A(V))
977
- ], nn);
978
- var gs = Object.getOwnPropertyDescriptor, fs = (i, t, e, n) => {
979
- for (var r = n > 1 ? void 0 : n ? gs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1287
+ Cn = Hs([
1288
+ Ot(1, se),
1289
+ Ot(2, oe),
1290
+ Ot(3, A(Ze)),
1291
+ Ot(4, A(X))
1292
+ ], Cn);
1293
+ var Ys = Object.getOwnPropertyDescriptor, Gs = (i, t, e, n) => {
1294
+ for (var r = n > 1 ? void 0 : n ? Ys(t, e) : t, s = i.length - 1, o; s >= 0; s--)
980
1295
  (o = i[s]) && (r = o(r) || r);
981
1296
  return r;
982
- }, Ae = (i, t) => (e, n) => t(e, n, i);
983
- function Sr(i, t, e) {
1297
+ }, We = (i, t) => (e, n) => t(e, n, i);
1298
+ function Lr(i, t, e) {
984
1299
  var n, r, s, o;
985
1300
  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) {
986
- const a = e.p.drawings[e.p.drawingsOrder[0]], d = en(
1301
+ const a = e.p.drawings[e.p.drawingsOrder[0]], d = _n(
987
1302
  i,
988
1303
  {
989
1304
  unitId: t.unitId,
@@ -1000,47 +1315,47 @@ function Sr(i, t, e) {
1000
1315
  }
1001
1316
  return !1;
1002
1317
  }
1003
- let bt = class extends re {
1318
+ let $t = class extends ee {
1004
1319
  constructor(i, t, e, n, r, s) {
1005
1320
  super(), this._commandService = i, this._sheetInterceptorService = t, this._injector = e, this._drawingManagerService = n, this._docDrawingController = r, this._editorBridgeService = s, this._handleInitEditor(), this._initCellContentInterceptor();
1006
1321
  }
1007
1322
  _handleInitEditor() {
1008
1323
  this.disposeWithMe(this._editorBridgeService.visible$.subscribe((i) => {
1009
- i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(qe), this._docDrawingController.loadDrawingDataForUnit(qe), this._drawingManagerService.initializeNotification(qe)) : this._drawingManagerService.removeDrawingDataForUnit(qe);
1324
+ i.visible ? i.visible && (this._drawingManagerService.removeDrawingDataForUnit(ot), this._docDrawingController.loadDrawingDataForUnit(ot), this._drawingManagerService.initializeNotification(ot)) : this._drawingManagerService.removeDrawingDataForUnit(ot);
1010
1325
  })), this.disposeWithMe(this._commandService.onCommandExecuted((i) => {
1011
- i.id === Ti.id && i.params.unitId === je && (this._drawingManagerService.removeDrawingDataForUnit(je), this._docDrawingController.loadDrawingDataForUnit(je), this._drawingManagerService.initializeNotification(je));
1326
+ i.id === rs.id && i.params.unitId === He && (this._drawingManagerService.removeDrawingDataForUnit(He), this._docDrawingController.loadDrawingDataForUnit(He), this._drawingManagerService.initializeNotification(He));
1012
1327
  }));
1013
1328
  }
1014
1329
  _initCellContentInterceptor() {
1015
1330
  this.disposeWithMe(
1016
1331
  this._sheetInterceptorService.intercept(
1017
- li.CELL_CONTENT,
1332
+ xi.CELL_CONTENT,
1018
1333
  {
1019
- effect: Lr.Style,
1020
- priority: ui.CELL_IMAGE,
1334
+ effect: _i.Style,
1335
+ priority: Wi.CELL_IMAGE,
1021
1336
  handler: (i, t, e) => {
1022
1337
  var n;
1023
- return i != null && i.p && ((n = i.p.drawingsOrder) != null && n.length) && (i === t.rawData && (i = { ...t.rawData }), i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 }, Sr(this._injector, { unitId: t.unitId, subUnitId: t.subUnitId, row: t.row, col: t.col }, i)), e(i);
1338
+ return i != null && i.p && ((n = i.p.drawingsOrder) != null && n.length) && (i === t.rawData && (i = { ...t.rawData }), i.interceptorStyle || (i.interceptorStyle = {}), i.interceptorStyle.tr = { a: 0 }, Lr(this._injector, { unitId: t.unitId, subUnitId: t.subUnitId, row: t.row, col: t.col }, i)), e(i);
1024
1339
  }
1025
1340
  }
1026
1341
  )
1027
1342
  );
1028
1343
  }
1029
1344
  };
1030
- bt = fs([
1031
- Ae(0, X),
1032
- Ae(1, A(At)),
1033
- Ae(2, A(Xe)),
1034
- Ae(3, se),
1035
- Ae(4, A(Gi)),
1036
- Ae(5, A(kr))
1037
- ], bt);
1038
- var ms = Object.getOwnPropertyDescriptor, ps = (i, t, e, n) => {
1039
- for (var r = n > 1 ? void 0 : n ? ms(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1345
+ $t = Gs([
1346
+ We(0, Y),
1347
+ We(1, A(Vt)),
1348
+ We(2, A(qe)),
1349
+ We(3, oe),
1350
+ We(4, A(ws)),
1351
+ We(5, A(ai))
1352
+ ], $t);
1353
+ var Xs = Object.getOwnPropertyDescriptor, zs = (i, t, e, n) => {
1354
+ for (var r = n > 1 ? void 0 : n ? Xs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1040
1355
  (o = i[s]) && (r = o(r) || r);
1041
1356
  return r;
1042
- }, $n = (i, t) => (e, n) => t(e, n, i);
1043
- let Mt = class extends re {
1357
+ }, or = (i, t) => (e, n) => t(e, n, i);
1358
+ let kt = class extends ee {
1044
1359
  constructor(i, t) {
1045
1360
  super(), this._autoFillService = i, this._injector = t, this._initAutoFillHooks();
1046
1361
  }
@@ -1049,35 +1364,35 @@ let Mt = class extends re {
1049
1364
  this._autoFillService.addHook({
1050
1365
  id: "sheet-cell-image-autofill",
1051
1366
  onBeforeSubmit: (i, t, e, n) => {
1052
- new Vr(n).forValue((r, s, o) => {
1053
- Sr(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
1367
+ new Si(n).forValue((r, s, o) => {
1368
+ Lr(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
1054
1369
  });
1055
1370
  }
1056
1371
  })
1057
1372
  );
1058
1373
  }
1059
1374
  };
1060
- Mt = ps([
1061
- $n(0, A(Wr)),
1062
- $n(1, A(Xe))
1063
- ], Mt);
1064
- var ws = Object.getOwnPropertyDescriptor, _s = (i, t, e, n) => {
1065
- for (var r = n > 1 ? void 0 : n ? ws(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1375
+ kt = zs([
1376
+ or(0, A(ci)),
1377
+ or(1, A(qe))
1378
+ ], kt);
1379
+ var Ks = Object.getOwnPropertyDescriptor, Zs = (i, t, e, n) => {
1380
+ for (var r = n > 1 ? void 0 : n ? Ks(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1066
1381
  (o = i[s]) && (r = o(r) || r);
1067
1382
  return r;
1068
- }, ze = (i, t) => (e, n) => t(e, n, i);
1069
- const Ss = [
1070
- qe,
1071
- Hr,
1072
- je
1383
+ }, nt = (i, t) => (e, n) => t(e, n, i);
1384
+ const Js = [
1385
+ ot,
1386
+ vi,
1387
+ He
1073
1388
  ];
1074
- let yt = class extends re {
1389
+ let xt = class extends ee {
1075
1390
  constructor(i, t, e, n, r) {
1076
1391
  super(), this._commandService = i, this._univerInstanceService = t, this._dialogService = e, this._renderManagerService = n, this._localeService = r, this._initDocImageCopyPasteHooks();
1077
1392
  }
1078
1393
  _setCellImage(i) {
1079
1394
  var r;
1080
- const t = Vt("", {}), e = (r = sn(F.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.with(Br), n = Ht.drawing.add({
1395
+ const t = un("", {}), e = (r = Dn($.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService)) == null ? void 0 : r.with(di), n = hn.drawing.add({
1081
1396
  documentDataModel: t,
1082
1397
  drawings: [i],
1083
1398
  selection: {
@@ -1092,20 +1407,20 @@ let yt = class extends re {
1092
1407
  this.disposeWithMe(
1093
1408
  this._commandService.beforeCommandExecuted((i) => {
1094
1409
  var t, e;
1095
- if (i.id === Ei.id) {
1096
- const n = i.params, { doc: r } = n, s = this._univerInstanceService.getCurrentUnitOfType(F.UNIVER_DOC);
1410
+ if (i.id === is.id) {
1411
+ const n = i.params, { doc: r } = n, s = this._univerInstanceService.getCurrentUnitOfType($.UNIVER_DOC);
1097
1412
  if (s == null || !Object.keys((t = r.drawings) != null ? t : {}).length)
1098
1413
  return;
1099
1414
  const o = s.getUnitId();
1100
- if (Ss.includes(o)) {
1101
- if (o !== je) {
1415
+ if (Js.includes(o)) {
1416
+ if (o !== He) {
1102
1417
  const a = () => {
1103
- this._dialogService.close("sheet-cell-image-copy-paste"), this._commandService.syncExecuteCommand(pn.id, {
1418
+ this._dialogService.close("sheet-cell-image-copy-paste"), this._commandService.syncExecuteCommand(Nn.id, {
1104
1419
  visible: !1
1105
1420
  });
1106
1421
  };
1107
1422
  ((e = s.getBody()) == null ? void 0 : e.dataStream) === `\r
1108
- ` ? (this._commandService.syncExecuteCommand(pn.id, {
1423
+ ` ? (this._commandService.syncExecuteCommand(Nn.id, {
1109
1424
  visible: !1
1110
1425
  }), this._setCellImage(Object.values(r.drawings)[0])) : this._dialogService.open({
1111
1426
  id: "sheet-cell-image-copy-paste",
@@ -1133,32 +1448,32 @@ let yt = class extends re {
1133
1448
  );
1134
1449
  }
1135
1450
  };
1136
- yt = _s([
1137
- ze(0, X),
1138
- ze(1, Se),
1139
- ze(2, ki),
1140
- ze(3, Z),
1141
- ze(4, A(nt))
1142
- ], yt);
1143
- var vs = Object.getOwnPropertyDescriptor, Is = (i, t, e, n) => {
1144
- for (var r = n > 1 ? void 0 : n ? vs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1451
+ xt = Zs([
1452
+ nt(0, Y),
1453
+ nt(1, de),
1454
+ nt(2, bn),
1455
+ nt(3, Q),
1456
+ nt(4, A(Te))
1457
+ ], xt);
1458
+ var qs = Object.getOwnPropertyDescriptor, Qs = (i, t, e, n) => {
1459
+ for (var r = n > 1 ? void 0 : n ? qs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1145
1460
  (o = i[s]) && (r = o(r) || r);
1146
1461
  return r;
1147
- }, Ke = (i, t) => (e, n) => t(e, n, i);
1148
- const vr = "image/png";
1149
- function Cs(i) {
1462
+ }, rt = (i, t) => (e, n) => t(e, n, i);
1463
+ const Vr = "image/png";
1464
+ function eo(i) {
1150
1465
  const t = i.split(","), e = atob(t[1]), n = e.length, r = new Uint8Array(n);
1151
1466
  for (let s = 0; s < n; s++)
1152
1467
  r[s] = e.charCodeAt(s);
1153
- return new Blob([r], { type: vr });
1468
+ return new Blob([r], { type: Vr });
1154
1469
  }
1155
- function Ds(i) {
1156
- const t = new ClipboardItem({ [vr]: Cs(i) });
1470
+ function to(i) {
1471
+ const t = new ClipboardItem({ [Vr]: eo(i) });
1157
1472
  navigator.clipboard.write([t]).catch((e) => {
1158
1473
  console.error("Could not copy image using clipboard API: ", e);
1159
1474
  });
1160
1475
  }
1161
- function Rs() {
1476
+ function no() {
1162
1477
  function i() {
1163
1478
  const n = document.createElement("input");
1164
1479
  return n.style.position = "absolute", n.style.height = "1px", n.style.width = "1px", n.style.opacity = "0", n;
@@ -1168,16 +1483,16 @@ function Rs() {
1168
1483
  e.blur(), document.body.removeChild(e), t instanceof HTMLElement && t.focus();
1169
1484
  };
1170
1485
  }
1171
- const Fn = [
1172
- We.SPECIAL_PASTE_COL_WIDTH,
1173
- We.SPECIAL_PASTE_VALUE,
1174
- We.SPECIAL_PASTE_FORMAT,
1175
- We.SPECIAL_PASTE_FORMULA
1486
+ const ar = [
1487
+ Le.SPECIAL_PASTE_COL_WIDTH,
1488
+ Le.SPECIAL_PASTE_VALUE,
1489
+ Le.SPECIAL_PASTE_FORMAT,
1490
+ Le.SPECIAL_PASTE_FORMULA
1176
1491
  ];
1177
- let Tt = class extends re {
1492
+ let Wt = class extends ee {
1178
1493
  constructor(t, e, n, r, s) {
1179
1494
  super();
1180
- te(this, "_copyInfo");
1495
+ re(this, "_copyInfo");
1181
1496
  this._sheetClipboardService = t, this._renderManagerService = e, this._drawingService = n, this._clipboardInterfaceService = r, this._commandService = s, this._initCopyPaste();
1182
1497
  }
1183
1498
  get _focusedDrawings() {
@@ -1192,18 +1507,18 @@ let Tt = class extends re {
1192
1507
  const s = this._focusedDrawings;
1193
1508
  if (s.length > 0) {
1194
1509
  const [o] = s;
1195
- if (o.drawingType !== W.DRAWING_IMAGE)
1510
+ if (o.drawingType !== x.DRAWING_IMAGE)
1196
1511
  return;
1197
- if (r === ve.CUT) {
1512
+ if (r === Re.CUT) {
1198
1513
  const d = {
1199
1514
  unitId: t,
1200
1515
  drawings: [o]
1201
1516
  };
1202
- this._commandService.executeCommand(rt.id, d);
1517
+ this._commandService.executeCommand(ht.id, d);
1203
1518
  }
1204
1519
  setTimeout(() => {
1205
- const d = Rs();
1206
- o.drawingType === W.DRAWING_IMAGE && o.imageSourceType === Ui.BASE64 ? Ds(o.source) : this._clipboardInterfaceService.writeText(""), d();
1520
+ const d = no();
1521
+ o.drawingType === x.DRAWING_IMAGE && o.imageSourceType === os.BASE64 ? to(o.source) : this._clipboardInterfaceService.writeText(""), d();
1207
1522
  }, 200);
1208
1523
  const a = {
1209
1524
  unitId: o.unitId,
@@ -1219,14 +1534,14 @@ let Tt = class extends re {
1219
1534
  onPasteCells: (t, e, n, r) => {
1220
1535
  if (!this._copyInfo)
1221
1536
  return { redos: [], undos: [] };
1222
- const { copyType: s = ve.COPY, pasteType: o } = r, { range: a } = t || {}, { range: d, unitId: u, subUnitId: c } = e;
1223
- return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: u, subUnitId: c, pasteRange: d }, { copyRange: a, copyType: s }) : this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: o }, ve.COPY);
1537
+ const { copyType: s = Re.COPY, pasteType: o } = r, { range: a } = t || {}, { range: d, unitId: u, subUnitId: c } = e;
1538
+ return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: u, subUnitId: c, pasteRange: d }, { copyRange: a, copyType: s }) : this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: o }, Re.COPY);
1224
1539
  },
1225
1540
  onPastePlainText: (t, e) => ({ undos: [], redos: [] }),
1226
- onPasteUnrecognized: (t) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: We.DEFAULT_PASTE }, ve.COPY) : { undos: [], redos: [] },
1541
+ onPasteUnrecognized: (t) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: Le.DEFAULT_PASTE }, Re.COPY) : { undos: [], redos: [] },
1227
1542
  onPasteFiles: (t, e) => {
1228
1543
  if (this._copyInfo)
1229
- return this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: We.DEFAULT_PASTE }, ve.COPY);
1544
+ return this._generateSingleDrawingPasteMutations({ pasteTo: t, pasteType: Le.DEFAULT_PASTE }, Re.COPY);
1230
1545
  {
1231
1546
  const n = e.filter((r) => r.type.includes("image"));
1232
1547
  if (n.length)
@@ -1234,7 +1549,7 @@ let Tt = class extends re {
1234
1549
  undos: [],
1235
1550
  redos: [
1236
1551
  {
1237
- id: Bt.id,
1552
+ id: Kt.id,
1238
1553
  params: { files: n }
1239
1554
  }
1240
1555
  ]
@@ -1246,7 +1561,7 @@ let Tt = class extends re {
1246
1561
  }
1247
1562
  _createDrawingsCopyInfoByRange(t, e, n) {
1248
1563
  var g;
1249
- const r = (g = this._renderManagerService.getRenderById(t)) == null ? void 0 : g.with(V);
1564
+ const r = (g = this._renderManagerService.getRenderById(t)) == null ? void 0 : g.with(X);
1250
1565
  if (!r) return;
1251
1566
  const s = r.attachRangeWithCoord(n);
1252
1567
  if (!s)
@@ -1254,18 +1569,18 @@ let Tt = class extends re {
1254
1569
  const { startX: o, endX: a, startY: d, endY: u } = s, c = this._drawingService.getDrawingData(t, e), l = this._focusedDrawings.slice();
1255
1570
  if (Object.keys(c).forEach((h) => {
1256
1571
  const f = c[h];
1257
- if (f.drawingType !== W.DRAWING_IMAGE)
1572
+ if (f.drawingType !== x.DRAWING_IMAGE)
1258
1573
  return;
1259
- const { transform: p } = f;
1260
- if (f.anchorType !== O.Both || !p)
1574
+ const { transform: m } = f;
1575
+ if (f.anchorType !== O.Both || !m)
1261
1576
  return;
1262
- const { left: m = 0, top: _ = 0, width: v = 0, height: I = 0 } = p, { drawingStartX: R, drawingEndX: S, drawingStartY: C, drawingEndY: w } = {
1263
- drawingStartX: m,
1264
- drawingEndX: m + v,
1265
- drawingStartY: _,
1266
- drawingEndY: _ + I
1577
+ const { left: p = 0, top: w = 0, width: S = 0, height: I = 0 } = m, { drawingStartX: D, drawingEndX: v, drawingStartY: C, drawingEndY: _ } = {
1578
+ drawingStartX: p,
1579
+ drawingEndX: p + S,
1580
+ drawingStartY: w,
1581
+ drawingEndY: w + I
1267
1582
  };
1268
- o <= R && S <= a && d <= C && w <= u && l.push(f);
1583
+ o <= D && v <= a && d <= C && _ <= u && l.push(f);
1269
1584
  }), l.length)
1270
1585
  return {
1271
1586
  copyRange: n,
@@ -1276,31 +1591,31 @@ let Tt = class extends re {
1276
1591
  }
1277
1592
  _generateSingleDrawingPasteMutations(t, e) {
1278
1593
  const { pasteType: n, pasteTo: r } = t;
1279
- if (Fn.includes(n))
1594
+ if (ar.includes(n))
1280
1595
  return { redos: [], undos: [] };
1281
- const { unitId: s, subUnitId: o, range: a } = r, d = this._renderManagerService.getRenderById(s), u = d == null ? void 0 : d.with(V), c = d == null ? void 0 : d.with(Ye), l = this._copyInfo;
1596
+ const { unitId: s, subUnitId: o, range: a } = r, d = this._renderManagerService.getRenderById(s), u = d == null ? void 0 : d.with(X), c = d == null ? void 0 : d.with(Ze), l = this._copyInfo;
1282
1597
  if (!u || !c)
1283
1598
  return { redos: [], undos: [] };
1284
- const { drawings: g } = l, h = wn(a);
1599
+ const { drawings: g } = l, h = $n(a);
1285
1600
  return this._generateMutations(g, {
1286
1601
  unitId: s,
1287
1602
  subUnitId: o,
1288
- isCut: e === ve.CUT,
1289
- getTransform: (f, p) => {
1290
- var v;
1291
- const m = u.attachRangeWithCoord({
1603
+ isCut: e === Re.CUT,
1604
+ getTransform: (f, m) => {
1605
+ var S;
1606
+ const p = u.attachRangeWithCoord({
1292
1607
  startRow: h.startRow,
1293
1608
  endRow: h.endRow,
1294
1609
  startColumn: h.startColumn,
1295
1610
  endColumn: h.endColumn
1296
- }), _ = {
1611
+ }), w = {
1297
1612
  ...f,
1298
- left: m == null ? void 0 : m.startX,
1299
- top: m == null ? void 0 : m.startY
1613
+ left: p == null ? void 0 : p.startX,
1614
+ top: p == null ? void 0 : p.startY
1300
1615
  };
1301
1616
  return {
1302
- transform: _,
1303
- sheetTransform: (v = $(_, c)) != null ? v : p
1617
+ transform: w,
1618
+ sheetTransform: (S = j(w, c)) != null ? S : m
1304
1619
  };
1305
1620
  }
1306
1621
  });
@@ -1320,20 +1635,20 @@ let Tt = class extends re {
1320
1635
  ...c,
1321
1636
  unitId: n,
1322
1637
  subUnitId: r,
1323
- drawingId: o ? c.drawingId : Be(),
1638
+ drawingId: o ? c.drawingId : Ve(),
1324
1639
  transform: h.transform,
1325
1640
  sheetTransform: h.sheetTransform
1326
1641
  };
1327
1642
  if (o) {
1328
- const { undo: p, redo: m, objects: _ } = u.getBatchUpdateOp([f]);
1643
+ const { undo: m, redo: p, objects: w } = u.getBatchUpdateOp([f]);
1329
1644
  a.push({
1330
1645
  id: P.id,
1331
1646
  params: {
1332
1647
  unitId: n,
1333
1648
  subUnitId: r,
1334
1649
  type: U.UPDATE,
1335
- op: m,
1336
- objects: _
1650
+ op: p,
1651
+ objects: w
1337
1652
  }
1338
1653
  }), d.push({
1339
1654
  id: P.id,
@@ -1341,13 +1656,13 @@ let Tt = class extends re {
1341
1656
  unitId: n,
1342
1657
  subUnitId: r,
1343
1658
  type: U.UPDATE,
1344
- op: p,
1345
- objects: _
1659
+ op: m,
1660
+ objects: w
1346
1661
  }
1347
1662
  });
1348
1663
  } else {
1349
- const { undo: p, redo: m, objects: _ } = u.getBatchAddOp([f]);
1350
- a.push({ id: P.id, params: { op: m, unitId: n, subUnitId: r, objects: _, type: U.INSERT } }), d.push({ id: P.id, params: { op: p, unitId: n, subUnitId: r, objects: _, type: U.REMOVE } });
1664
+ const { undo: m, redo: p, objects: w } = u.getBatchAddOp([f]);
1665
+ a.push({ id: P.id, params: { op: p, unitId: n, subUnitId: r, objects: w, type: U.INSERT } }), d.push({ id: P.id, params: { op: m, unitId: n, subUnitId: r, objects: w, type: U.REMOVE } });
1351
1666
  }
1352
1667
  }), { redos: a, undos: d };
1353
1668
  }
@@ -1363,94 +1678,94 @@ let Tt = class extends re {
1363
1678
  copyRange: a,
1364
1679
  copyType: d
1365
1680
  } = e;
1366
- if (Fn.includes(s))
1681
+ if (ar.includes(s))
1367
1682
  return { redos: [], undos: [] };
1368
- const u = (y = this._renderManagerService.getRenderById(n)) == null ? void 0 : y.with(V);
1683
+ const u = (y = this._renderManagerService.getRenderById(n)) == null ? void 0 : y.with(X);
1369
1684
  if (!u || !this._copyInfo)
1370
1685
  return { redos: [], undos: [] };
1371
1686
  const { drawings: c } = this._copyInfo;
1372
1687
  if (!a)
1373
1688
  return this._generateSingleDrawingPasteMutations({
1374
- pasteTo: { unitId: n, subUnitId: r, range: wn(o) },
1689
+ pasteTo: { unitId: n, subUnitId: r, range: $n(o) },
1375
1690
  pasteType: s
1376
1691
  }, d);
1377
- const { ranges: [l, g], mapFunc: h } = jr([a, o]), { row: f, col: p } = h(l.startRow, l.startColumn), { row: m, col: _ } = h(g.startRow, g.startColumn), v = u.attachRangeWithCoord({
1692
+ const { ranges: [l, g], mapFunc: h } = li([a, o]), { row: f, col: m } = h(l.startRow, l.startColumn), { row: p, col: w } = h(g.startRow, g.startColumn), S = u.attachRangeWithCoord({
1378
1693
  startRow: f,
1379
1694
  endRow: f,
1380
- startColumn: p,
1381
- endColumn: p
1695
+ startColumn: m,
1696
+ endColumn: m
1382
1697
  }), I = u.attachRangeWithCoord({
1383
- startRow: m,
1384
- endRow: m,
1385
- startColumn: _,
1386
- endColumn: _
1698
+ startRow: p,
1699
+ endRow: p,
1700
+ startColumn: w,
1701
+ endColumn: w
1387
1702
  });
1388
- if (!v || !I || !this._copyInfo)
1703
+ if (!S || !I || !this._copyInfo)
1389
1704
  return { redos: [], undos: [] };
1390
- const R = I.startX - v.startX, S = I.startY - v.startY, C = m - f, w = _ - p;
1705
+ const D = I.startX - S.startX, v = I.startY - S.startY, C = p - f, _ = w - m;
1391
1706
  return this._generateMutations(c, {
1392
1707
  unitId: n,
1393
1708
  subUnitId: r,
1394
- getTransform: (D, T) => {
1395
- var E, M;
1709
+ getTransform: (R, E) => {
1710
+ var T, M;
1396
1711
  return {
1397
1712
  transform: {
1398
- ...D,
1399
- left: ((E = D == null ? void 0 : D.left) != null ? E : 0) + R,
1400
- top: ((M = D == null ? void 0 : D.top) != null ? M : 0) + S
1713
+ ...R,
1714
+ left: ((T = R == null ? void 0 : R.left) != null ? T : 0) + D,
1715
+ top: ((M = R == null ? void 0 : R.top) != null ? M : 0) + v
1401
1716
  },
1402
1717
  sheetTransform: {
1403
- ...T,
1718
+ ...E,
1404
1719
  to: {
1405
- ...T.to,
1406
- row: T.to.row + C,
1407
- column: T.to.column + w
1720
+ ...E.to,
1721
+ row: E.to.row + C,
1722
+ column: E.to.column + _
1408
1723
  },
1409
1724
  from: {
1410
- ...T.from,
1411
- row: T.from.row + C,
1412
- column: T.from.column + w
1725
+ ...E.from,
1726
+ row: E.from.row + C,
1727
+ column: E.from.column + _
1413
1728
  }
1414
1729
  }
1415
1730
  };
1416
1731
  },
1417
- isCut: d === ve.CUT
1732
+ isCut: d === Re.CUT
1418
1733
  });
1419
1734
  }
1420
1735
  };
1421
- Tt = Is([
1422
- Ke(0, $r),
1423
- Ke(1, Z),
1424
- Ke(2, se),
1425
- Ke(3, Wi),
1426
- Ke(4, X)
1427
- ], Tt);
1428
- var bs = Object.getOwnPropertyDescriptor, Ms = (i, t, e, n) => {
1429
- for (var r = n > 1 ? void 0 : n ? bs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1736
+ Wt = Qs([
1737
+ rt(0, ui),
1738
+ rt(1, Q),
1739
+ rt(2, oe),
1740
+ rt(3, ls),
1741
+ rt(4, Y)
1742
+ ], Wt);
1743
+ var ro = Object.getOwnPropertyDescriptor, io = (i, t, e, n) => {
1744
+ for (var r = n > 1 ? void 0 : n ? ro(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1430
1745
  (o = i[s]) && (r = o(r) || r);
1431
1746
  return r;
1432
- }, Je = (i, t) => (e, n) => t(e, n, i);
1433
- let Et = class extends re {
1747
+ }, it = (i, t) => (e, n) => t(e, n, i);
1748
+ let Bt = class extends ee {
1434
1749
  constructor(i, t, e, n, r) {
1435
1750
  super(), this._drawingManagerService = i, this._renderManagerService = t, this._permissionService = e, this._univerInstanceService = n, this._userManagerService = r, this._initDrawingVisible(), this._initDrawingEditable(), this._initViewPermissionChange(), this._initEditPermissionChange();
1436
1751
  }
1437
1752
  _initDrawingVisible() {
1438
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = St([i, t]);
1753
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$($.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = at([i, t]);
1439
1754
  this.disposeWithMe(
1440
1755
  e.pipe(
1441
- we(([n, r]) => n ? n.activeSheet$.pipe(
1442
- kn((s) => {
1756
+ me(([n, r]) => n ? n.activeSheet$.pipe(
1757
+ er((s) => {
1443
1758
  if (!s) {
1444
1759
  this._drawingManagerService.setDrawingVisible(!1);
1445
1760
  return;
1446
1761
  }
1447
1762
  const o = n.getUnitId(), a = s.getSheetId();
1448
1763
  this._permissionService.composePermission([
1449
- new Mn(o).id,
1450
- new yn(o, a).id
1764
+ new Vn(o).id,
1765
+ new Hn(o, a).id
1451
1766
  ]).every((u) => u.value) ? this._drawingManagerService.setDrawingVisible(!0) : this._handleDrawingVisibilityFalse(n, s);
1452
1767
  })
1453
- ) : (this._drawingManagerService.setDrawingVisible(!1), fe))
1768
+ ) : (this._drawingManagerService.setDrawingVisible(!1), we))
1454
1769
  ).subscribe()
1455
1770
  );
1456
1771
  }
@@ -1460,26 +1775,26 @@ let Et = class extends re {
1460
1775
  if (!a)
1461
1776
  return;
1462
1777
  a.getAllObjectsByOrder().forEach((u) => {
1463
- u.classType === Oe.IMAGE && s.some((c) => u.oKey.includes(c.drawingId)) && a.removeObject(u);
1778
+ u.classType === $e.IMAGE && s.some((c) => u.oKey.includes(c.drawingId)) && a.removeObject(u);
1464
1779
  });
1465
1780
  }
1466
1781
  _initDrawingEditable() {
1467
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = St([i, t]);
1782
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$($.UNIVER_SHEET), t = this._userManagerService.currentUser$, e = at([i, t]);
1468
1783
  this.disposeWithMe(
1469
1784
  e.pipe(
1470
- we(([n, r]) => n ? n.activeSheet$.pipe(
1471
- kn((s) => {
1785
+ me(([n, r]) => n ? n.activeSheet$.pipe(
1786
+ er((s) => {
1472
1787
  if (!s) {
1473
1788
  this._drawingManagerService.setDrawingEditable(!1);
1474
1789
  return;
1475
1790
  }
1476
1791
  const o = n.getUnitId(), a = s.getSheetId();
1477
1792
  this._permissionService.composePermission([
1478
- new zt(o).id,
1479
- new Kt(o, a).id
1793
+ new gn(o).id,
1794
+ new fn(o, a).id
1480
1795
  ]).every((u) => u.value) ? this._drawingManagerService.setDrawingEditable(!0) : this._handleDrawingEditableFalse(n, s);
1481
1796
  })
1482
- ) : (this._drawingManagerService.setDrawingEditable(!1), fe))
1797
+ ) : (this._drawingManagerService.setDrawingEditable(!1), we))
1483
1798
  ).subscribe()
1484
1799
  );
1485
1800
  }
@@ -1489,29 +1804,29 @@ let Et = class extends re {
1489
1804
  if (!a)
1490
1805
  return;
1491
1806
  a.getAllObjectsByOrder().forEach((u) => {
1492
- u.classType === Oe.IMAGE && s.some((c) => u.oKey.includes(c.drawingId)) && a.detachTransformerFrom(u);
1807
+ u.classType === $e.IMAGE && s.some((c) => u.oKey.includes(c.drawingId)) && a.detachTransformerFrom(u);
1493
1808
  });
1494
1809
  }
1495
1810
  _initViewPermissionChange() {
1496
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$;
1811
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$($.UNIVER_SHEET), t = this._userManagerService.currentUser$;
1497
1812
  this.disposeWithMe(
1498
- St([i, t]).pipe(
1499
- we(([e, n]) => e ? e.activeSheet$.pipe(
1500
- we((r) => {
1813
+ at([i, t]).pipe(
1814
+ me(([e, n]) => e ? e.activeSheet$.pipe(
1815
+ me((r) => {
1501
1816
  if (!r)
1502
- return fe;
1817
+ return we;
1503
1818
  const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s), d = a == null ? void 0 : a.scene;
1504
1819
  if (!d)
1505
- return fe;
1820
+ return we;
1506
1821
  const u = d.getTransformerByCreate();
1507
1822
  return this._permissionService.composePermission$([
1508
- new Mn(s).id,
1509
- new yn(s, o).id
1823
+ new Vn(s).id,
1824
+ new Hn(s, o).id
1510
1825
  ]).pipe(
1511
- Re((l) => l.every((g) => g.value)),
1512
- Wn()
1826
+ pe((l) => l.every((g) => g.value)),
1827
+ tr()
1513
1828
  ).pipe(
1514
- Re((l) => ({
1829
+ pe((l) => ({
1515
1830
  permission: l,
1516
1831
  scene: d,
1517
1832
  transformer: u,
@@ -1520,18 +1835,18 @@ let Et = class extends re {
1520
1835
  }))
1521
1836
  );
1522
1837
  })
1523
- ) : fe)
1838
+ ) : we)
1524
1839
  ).subscribe({
1525
1840
  next: ({ permission: e, scene: n, transformer: r, unitId: s, subUnitId: o }) => {
1526
1841
  this._drawingManagerService.setDrawingVisible(e);
1527
1842
  const a = n.getAllObjectsByOrder(), d = this._drawingManagerService.getDrawingData(s, o), u = Object.values(d);
1528
1843
  e ? this._drawingManagerService.addNotification(u) : (a.forEach((c) => {
1529
- c.classType === Oe.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.removeObject(c);
1844
+ c.classType === $e.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.removeObject(c);
1530
1845
  }), r.clearSelectedObjects());
1531
1846
  },
1532
1847
  complete: () => {
1533
1848
  this._drawingManagerService.setDrawingVisible(!0);
1534
- 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();
1849
+ const e = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET), n = e == null ? void 0 : e.getActiveSheet(), r = e == null ? void 0 : e.getUnitId(), s = n == null ? void 0 : n.getSheetId();
1535
1850
  if (!r || !s)
1536
1851
  return;
1537
1852
  const o = this._drawingManagerService.getDrawingData(r, s), a = Object.values(o);
@@ -1541,25 +1856,25 @@ let Et = class extends re {
1541
1856
  );
1542
1857
  }
1543
1858
  _initEditPermissionChange() {
1544
- const i = this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET), t = this._userManagerService.currentUser$;
1859
+ const i = this._univerInstanceService.getCurrentTypeOfUnit$($.UNIVER_SHEET), t = this._userManagerService.currentUser$;
1545
1860
  this.disposeWithMe(
1546
- St([i, t]).pipe(
1547
- we(([e, n]) => e ? e.activeSheet$.pipe(
1548
- we((r) => {
1861
+ at([i, t]).pipe(
1862
+ me(([e, n]) => e ? e.activeSheet$.pipe(
1863
+ me((r) => {
1549
1864
  if (!r)
1550
- return fe;
1865
+ return we;
1551
1866
  const s = e.getUnitId(), o = r.getSheetId(), a = this._renderManagerService.getRenderById(s), d = a == null ? void 0 : a.scene;
1552
1867
  if (!d)
1553
- return fe;
1868
+ return we;
1554
1869
  const u = d.getTransformerByCreate();
1555
1870
  return this._permissionService.composePermission$([
1556
- new zt(s).id,
1557
- new Kt(s, o).id
1871
+ new gn(s).id,
1872
+ new fn(s, o).id
1558
1873
  ]).pipe(
1559
- Re((l) => l.every((g) => g.value)),
1560
- Wn()
1874
+ pe((l) => l.every((g) => g.value)),
1875
+ tr()
1561
1876
  ).pipe(
1562
- Re((l) => ({
1877
+ pe((l) => ({
1563
1878
  permission: l,
1564
1879
  scene: d,
1565
1880
  transformer: u,
@@ -1568,19 +1883,19 @@ let Et = class extends re {
1568
1883
  }))
1569
1884
  );
1570
1885
  })
1571
- ) : fe)
1886
+ ) : we)
1572
1887
  ).subscribe({
1573
1888
  next: ({ permission: e, scene: n, transformer: r, unitId: s, subUnitId: o }) => {
1574
1889
  this._drawingManagerService.setDrawingEditable(e);
1575
1890
  const a = n.getAllObjectsByOrder(), d = this._drawingManagerService.getDrawingData(s, o), u = Object.values(d);
1576
1891
  e ? (a.forEach((c) => {
1577
- c.classType === Oe.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.attachTransformerTo(c);
1892
+ c.classType === $e.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.attachTransformerTo(c);
1578
1893
  }), this._drawingManagerService.addNotification(u)) : (a.forEach((c) => {
1579
- c.classType === Oe.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.detachTransformerFrom(c);
1894
+ c.classType === $e.IMAGE && u.some((l) => c.oKey.includes(l.drawingId)) && n.detachTransformerFrom(c);
1580
1895
  }), r.clearSelectedObjects());
1581
1896
  },
1582
1897
  complete: () => {
1583
- const e = this._univerInstanceService.getCurrentUnitForType(F.UNIVER_SHEET);
1898
+ const e = this._univerInstanceService.getCurrentUnitForType($.UNIVER_SHEET);
1584
1899
  if (!e)
1585
1900
  return;
1586
1901
  const n = e.getUnitId(), r = e.getActiveSheet();
@@ -1591,28 +1906,28 @@ let Et = class extends re {
1591
1906
  return;
1592
1907
  const d = this._drawingManagerService.getDrawingData(n, s), u = Object.values(d);
1593
1908
  this._drawingManagerService.setDrawingEditable(!0), a.getAllObjectsByOrder().forEach((l) => {
1594
- l.classType === Oe.IMAGE && u.some((g) => l.oKey.includes(g.drawingId)) && a.detachTransformerFrom(l);
1909
+ l.classType === $e.IMAGE && u.some((g) => l.oKey.includes(g.drawingId)) && a.detachTransformerFrom(l);
1595
1910
  });
1596
1911
  }
1597
1912
  })
1598
1913
  );
1599
1914
  }
1600
1915
  };
1601
- Et = Ms([
1602
- Je(0, se),
1603
- Je(1, Z),
1604
- Je(2, zr),
1605
- Je(3, Se),
1606
- Je(4, A(Kr))
1607
- ], Et);
1608
- var ys = Object.getOwnPropertyDescriptor, Ts = (i, t, e, n) => {
1609
- for (var r = n > 1 ? void 0 : n ? ys(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1916
+ Bt = io([
1917
+ it(0, oe),
1918
+ it(1, Q),
1919
+ it(2, Ii),
1920
+ it(3, de),
1921
+ it(4, A(Ci))
1922
+ ], Bt);
1923
+ var so = Object.getOwnPropertyDescriptor, oo = (i, t, e, n) => {
1924
+ for (var r = n > 1 ? void 0 : n ? so(t, e) : t, s = i.length - 1, o; s >= 0; s--)
1610
1925
  (o = i[s]) && (r = o(r) || r);
1611
1926
  return r;
1612
- }, Ce = (i, t) => (e, n) => t(e, n, i);
1613
- const Es = "univer-sheet-float-dom-";
1614
- function Ir(i, t, e, n, r, s = !1) {
1615
- const { scaleX: o, scaleY: a } = t.getAncestorScale(), d = t.getViewport(xn.VIEW_MAIN), u = n.getFreeze(), { startColumn: c, startRow: l, xSplit: g, ySplit: h } = u, f = {
1927
+ }, be = (i, t) => (e, n) => t(e, n, i);
1928
+ const ao = "univer-sheet-float-dom-";
1929
+ function Hr(i, t, e, n, r, s = !1) {
1930
+ const { scaleX: o, scaleY: a } = t.getAncestorScale(), d = t.getViewport(cr.VIEW_MAIN), u = n.getFreeze(), { startColumn: c, startRow: l, xSplit: g, ySplit: h } = u, f = {
1616
1931
  left: !0,
1617
1932
  // left means the left of pic is in a viewMainLeft
1618
1933
  top: !0
@@ -1622,43 +1937,43 @@ function Ir(i, t, e, n, r, s = !1) {
1622
1937
  ...i,
1623
1938
  absolute: f
1624
1939
  };
1625
- const { left: p, right: m, top: _, bottom: v } = i;
1626
- let { top: I, left: R, viewportScrollX: S, viewportScrollY: C } = d;
1627
- const { boundsOfViewArea: w, scrollDirectionResponse: y } = r || {}, { rowHeaderWidth: D, columnHeaderHeight: T } = e, E = {
1628
- top: s ? 0 : T,
1629
- left: s ? 0 : D
1940
+ const { left: m, right: p, top: w, bottom: S } = i;
1941
+ let { top: I, left: D, viewportScrollX: v, viewportScrollY: C } = d;
1942
+ const { boundsOfViewArea: _, scrollDirectionResponse: y } = r || {}, { rowHeaderWidth: R, columnHeaderHeight: E } = e, T = {
1943
+ top: s ? 0 : E,
1944
+ left: s ? 0 : R
1630
1945
  };
1631
- w && ($e.isDefine(E.top) && (E.top = w.top), $e.isDefine(E.left) && (E.left = w.left)), y === "HORIZONTAL" && (C = 0), y === "VERTICAL" && (S = 0);
1946
+ _ && (Ye.isDefine(T.top) && (T.top = _.top), Ye.isDefine(T.left) && (T.left = _.left)), y === "HORIZONTAL" && (C = 0), y === "VERTICAL" && (v = 0);
1632
1947
  let M = 0, b = 0;
1633
- const N = e.rowStartY(l - h) + T, x = e.colStartX(c - g) + D, Q = e.rowStartY(l) + T, H = e.colStartX(c) + D;
1948
+ const N = e.rowStartY(l - h) + E, F = e.colStartX(c - g) + R, te = e.rowStartY(l) + E, z = e.colStartX(c) + R;
1634
1949
  if (g === 0)
1635
- f.left = !1, M = (p - S) * o, b = (m - S) * o;
1950
+ f.left = !1, M = (m - v) * o, b = (p - v) * o;
1636
1951
  else {
1637
- const z = p - (x - D), B = m - (x - D);
1638
- m < H ? (M = z * o, b = B * o) : p <= H && m >= H ? (M = z * o, b = Math.max(R, (m - S) * o)) : p > H && (f.left = !1, M = Math.max((p - S) * o, R), b = Math.max((m - S) * o, R));
1952
+ const K = m - (F - R), W = p - (F - R);
1953
+ p < z ? (M = K * o, b = W * o) : m <= z && p >= z ? (M = K * o, b = Math.max(D, (p - v) * o)) : m > z && (f.left = !1, M = Math.max((m - v) * o, D), b = Math.max((p - v) * o, D));
1639
1954
  }
1640
- let G = 0, L = 0;
1955
+ let H = 0, G = 0;
1641
1956
  if (h === 0)
1642
- f.top = !1, G = (_ - C) * a, L = (v - C) * a;
1957
+ f.top = !1, H = (w - C) * a, G = (S - C) * a;
1643
1958
  else {
1644
- const z = _ - (N - T), B = v - (N - T);
1645
- v < Q ? (G = z * a, L = B * a) : _ <= Q && v >= Q ? (G = z * a, L = Math.max(I, (v - C) * a)) : _ > Q && (f.top = !1, G = Math.max((_ - C) * a, I), L = Math.max((v - C) * a, I));
1959
+ const K = w - (N - E), W = S - (N - E);
1960
+ S < te ? (H = K * a, G = W * a) : w <= te && S >= te ? (H = K * a, G = Math.max(I, (S - C) * a)) : w > te && (f.top = !1, H = Math.max((w - C) * a, I), G = Math.max((S - C) * a, I));
1646
1961
  }
1647
- return M = Math.max(M, E.left), G = Math.max(G, E.top), b = Math.max(b, E.left), L = Math.max(L, E.top), {
1962
+ return M = Math.max(M, T.left), H = Math.max(H, T.top), b = Math.max(b, T.left), G = Math.max(G, T.top), {
1648
1963
  left: M,
1649
1964
  right: b,
1650
- top: G,
1651
- bottom: L,
1965
+ top: H,
1966
+ bottom: G,
1652
1967
  absolute: f
1653
1968
  };
1654
1969
  }
1655
- const ge = (i, t, e, n, r) => {
1970
+ const fe = (i, t, e, n, r) => {
1656
1971
  const { left: s, top: o, width: a, height: d, angle: u } = i, c = {
1657
1972
  left: s,
1658
1973
  right: s + a,
1659
1974
  top: o,
1660
1975
  bottom: o + d
1661
- }, l = Ir(c, t, e, n, r), { scaleX: g, scaleY: h } = t.getAncestorScale();
1976
+ }, l = Hr(c, t, e, n, r), { scaleX: g, scaleY: h } = t.getAncestorScale();
1662
1977
  return {
1663
1978
  startX: l.left,
1664
1979
  endX: l.right,
@@ -1670,23 +1985,23 @@ const ge = (i, t, e, n, r) => {
1670
1985
  absolute: l.absolute
1671
1986
  };
1672
1987
  };
1673
- let tt = class extends re {
1988
+ let lt = class extends ee {
1674
1989
  constructor(t, e, n, r, s, o, a) {
1675
1990
  super();
1676
1991
  /**
1677
1992
  * for update dom container position when scrolling and zoom
1678
1993
  */
1679
- te(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
1680
- te(this, "_transformChange$", new Xt());
1681
- te(this, "transformChange$", this._transformChange$.asObservable());
1682
- te(this, "_add$", new Xt());
1683
- te(this, "add$", this._add$.asObservable());
1684
- te(this, "_remove$", new Xt());
1685
- te(this, "remove$", this._remove$.asObservable());
1994
+ re(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
1995
+ re(this, "_transformChange$", new on());
1996
+ re(this, "transformChange$", this._transformChange$.asObservable());
1997
+ re(this, "_add$", new on());
1998
+ re(this, "add$", this._add$.asObservable());
1999
+ re(this, "_remove$", new on());
2000
+ re(this, "remove$", this._remove$.asObservable());
1686
2001
  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();
1687
2002
  }
1688
2003
  _bindScrollEvent() {
1689
- this._lifecycleService.lifecycle$.pipe(qi((t) => t === Zr.Rendered), Qi(1)).subscribe(() => {
2004
+ this._lifecycleService.lifecycle$.pipe(Ms((t) => t === Di.Rendered), ys(1)).subscribe(() => {
1690
2005
  this._scrollUpdateListener();
1691
2006
  });
1692
2007
  }
@@ -1711,90 +2026,90 @@ let tt = class extends re {
1711
2026
  // eslint-disable-next-line max-lines-per-function
1712
2027
  this._drawingManagerService.add$.subscribe((t) => {
1713
2028
  t.forEach((e) => {
1714
- var z;
1715
- const { unitId: n, subUnitId: r, drawingId: s } = e, o = oe(this._univerInstanceService, { unitId: n, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(e), d = this._univerInstanceService.getUnit(n, F.UNIVER_SHEET);
2029
+ var K;
2030
+ const { unitId: n, subUnitId: r, drawingId: s } = e, o = ae(this._univerInstanceService, { unitId: n, subUnitId: r }), a = this._drawingManagerService.getDrawingByParam(e), d = this._univerInstanceService.getUnit(n, $.UNIVER_SHEET);
1716
2031
  if (!d)
1717
2032
  return;
1718
2033
  const u = d.getActiveSheet().getSheetId();
1719
2034
  if (!a || !o)
1720
2035
  return;
1721
- const c = (z = this._renderManagerService.getRenderById(n)) == null ? void 0 : z.with(V).getSkeletonParam(r);
2036
+ const c = (K = this._renderManagerService.getRenderById(n)) == null ? void 0 : K.with(X).getSkeletonParam(r);
1722
2037
  if (!c)
1723
2038
  return;
1724
2039
  const { transform: l, drawingType: g, data: h } = a;
1725
- if (g !== W.DRAWING_DOM && g !== W.DRAWING_CHART)
2040
+ if (g !== x.DRAWING_DOM && g !== x.DRAWING_CHART)
1726
2041
  return;
1727
2042
  const f = this._getSceneAndTransformerByDrawingSearch(n);
1728
2043
  if (f == null)
1729
2044
  return;
1730
- const { scene: p, canvas: m } = f;
2045
+ const { scene: m, canvas: p } = f;
1731
2046
  if (l == null)
1732
2047
  return !0;
1733
2048
  if (u !== r)
1734
2049
  return;
1735
- const { left: _, top: v, width: I, height: R, angle: S, flipX: C, flipY: w, skewX: y, skewY: D } = l, T = Ie({ unitId: n, subUnitId: r, drawingId: s }), E = p.getObject(T);
1736
- if (E != null) {
1737
- E.transformByState({ left: _, top: v, width: I, height: R, angle: S, flipX: C, flipY: w, skewX: y, skewY: D });
2050
+ const { left: w, top: S, width: I, height: D, angle: v, flipX: C, flipY: _, skewX: y, skewY: R } = l, E = De({ unitId: n, subUnitId: r, drawingId: s }), T = m.getObject(E);
2051
+ if (T != null) {
2052
+ T.transformByState({ left: w, top: S, width: I, height: D, angle: v, flipX: C, flipY: _, skewX: y, skewY: R });
1738
2053
  return;
1739
2054
  }
1740
2055
  const M = {
1741
- left: _,
1742
- top: v,
2056
+ left: w,
2057
+ top: S,
1743
2058
  width: I,
1744
- height: R,
2059
+ height: D,
1745
2060
  zIndex: this._drawingManagerService.getDrawingOrder(n, r).length - 1
1746
- }, b = g === W.DRAWING_CHART;
2061
+ }, b = g === x.DRAWING_CHART;
1747
2062
  if (M.rotateEnabled = !1, b) {
1748
- const B = h ? h.backgroundColor : "white";
1749
- M.fill = B, h && h.border && (M.stroke = h.border), M.paintFirst = "stroke", M.strokeWidth = 1, M.borderEnabled = !1, M.radius = 8;
2063
+ const W = h ? h.backgroundColor : "white";
2064
+ M.fill = W, h && h.border && (M.stroke = h.border), M.paintFirst = "stroke", M.strokeWidth = 1, M.borderEnabled = !1, M.radius = 8;
1750
2065
  }
1751
- const N = new Ue(T, M);
1752
- b && N.setObjectType(mn.CHART), p.addObject(N, Ft), a.allowTransform !== !1 && p.attachTransformerTo(N);
1753
- const x = new _t(), Q = ge(N, f.renderUnit.scene, c.skeleton, o.worksheet), H = new ke(Q), G = `${Es}${Be(6)}`, L = {
1754
- dispose: x,
2066
+ const N = new ke(E, M);
2067
+ b && N.setObjectType(An.CHART), m.addObject(N, qt), a.allowTransform !== !1 && m.attachTransformerTo(N);
2068
+ const F = new yt(), te = fe(N, f.renderUnit.scene, c.skeleton, o.worksheet), z = new je(te), H = `${ao}${Ve(6)}`, G = {
2069
+ dispose: F,
1755
2070
  rect: N,
1756
- position$: H,
2071
+ position$: z,
1757
2072
  unitId: n,
1758
2073
  subUnitId: r,
1759
2074
  id: s,
1760
- domId: G
2075
+ domId: H
1761
2076
  };
1762
2077
  this._canvasFloatDomService.addFloatDom({
1763
- position$: H,
2078
+ position$: z,
1764
2079
  id: s,
1765
- domId: G,
2080
+ domId: H,
1766
2081
  componentKey: a.componentKey,
1767
- onPointerDown: (B) => {
1768
- m.dispatchEvent(new PointerEvent(B.type, B));
2082
+ onPointerDown: (W) => {
2083
+ p.dispatchEvent(new PointerEvent(W.type, W));
1769
2084
  },
1770
- onPointerMove: (B) => {
1771
- m.dispatchEvent(new PointerEvent(B.type, B));
2085
+ onPointerMove: (W) => {
2086
+ p.dispatchEvent(new PointerEvent(W.type, W));
1772
2087
  },
1773
- onPointerUp: (B) => {
1774
- m.dispatchEvent(new PointerEvent(B.type, B));
2088
+ onPointerUp: (W) => {
2089
+ p.dispatchEvent(new PointerEvent(W.type, W));
1775
2090
  },
1776
- onWheel: (B) => {
1777
- m.dispatchEvent(new WheelEvent(B.type, B));
2091
+ onWheel: (W) => {
2092
+ p.dispatchEvent(new WheelEvent(W.type, W));
1778
2093
  },
1779
2094
  data: h,
1780
2095
  unitId: n
1781
2096
  });
1782
2097
  const J = N.onTransformChange$.subscribeEvent(() => {
1783
- const B = ge(N, f.renderUnit.scene, c.skeleton, o.worksheet);
1784
- H.next(
1785
- B
2098
+ const W = fe(N, f.renderUnit.scene, c.skeleton, o.worksheet);
2099
+ z.next(
2100
+ W
1786
2101
  );
1787
2102
  });
1788
- x.add(() => {
2103
+ F.add(() => {
1789
2104
  this._canvasFloatDomService.removeFloatDom(s);
1790
- }), J && x.add(J), this._domLayerInfoMap.set(s, L);
2105
+ }), J && F.add(J), this._domLayerInfoMap.set(s, G);
1791
2106
  });
1792
2107
  })
1793
2108
  ), this.disposeWithMe(
1794
2109
  this._drawingManagerService.remove$.subscribe((t) => {
1795
2110
  t.forEach((e) => {
1796
2111
  var l;
1797
- const { unitId: n, subUnitId: r, drawingId: s } = e, o = Ie({ unitId: n, subUnitId: r, drawingId: s }), a = this._getSceneAndTransformerByDrawingSearch(n);
2112
+ const { unitId: n, subUnitId: r, drawingId: s } = e, o = De({ unitId: n, subUnitId: r, drawingId: s }), a = this._getSceneAndTransformerByDrawingSearch(n);
1798
2113
  if (a == null)
1799
2114
  return;
1800
2115
  const { transformer: d, scene: u } = a, c = u.getObject(o);
@@ -1806,25 +2121,25 @@ let tt = class extends re {
1806
2121
  _scrollUpdateListener() {
1807
2122
  const t = (e, n) => {
1808
2123
  var d;
1809
- const r = this._getSceneAndTransformerByDrawingSearch(e), s = Array.from(this._domLayerInfoMap.keys()).map((u) => ({ id: u, ...this._domLayerInfoMap.get(u) })).filter((u) => u.subUnitId === n && u.unitId === e).map((u) => u.id), o = oe(this._univerInstanceService, { unitId: e, subUnitId: n }), a = (d = this._renderManagerService.getRenderById(e)) == null ? void 0 : d.with(V).getSkeletonParam(n);
2124
+ const r = this._getSceneAndTransformerByDrawingSearch(e), s = Array.from(this._domLayerInfoMap.keys()).map((u) => ({ id: u, ...this._domLayerInfoMap.get(u) })).filter((u) => u.subUnitId === n && u.unitId === e).map((u) => u.id), o = ae(this._univerInstanceService, { unitId: e, subUnitId: n }), a = (d = this._renderManagerService.getRenderById(e)) == null ? void 0 : d.with(X).getSkeletonParam(n);
1810
2125
  !r || !o || !a || s.forEach((u) => {
1811
2126
  const c = this._domLayerInfoMap.get(u);
1812
2127
  if (c) {
1813
- const l = ge(c.rect, r.renderUnit.scene, a.skeleton, o.worksheet, c);
2128
+ const l = fe(c.rect, r.renderUnit.scene, a.skeleton, o.worksheet, c);
1814
2129
  c.position$.next(l);
1815
2130
  }
1816
2131
  });
1817
2132
  };
1818
2133
  this.disposeWithMe(
1819
- this._univerInstanceService.getCurrentTypeOfUnit$(F.UNIVER_SHEET).pipe(
1820
- we((e) => e ? e.activeSheet$ : Bn(null)),
1821
- Re((e) => {
2134
+ this._univerInstanceService.getCurrentTypeOfUnit$($.UNIVER_SHEET).pipe(
2135
+ me((e) => e ? e.activeSheet$ : wn(null)),
2136
+ pe((e) => {
1822
2137
  if (!e) return null;
1823
2138
  const n = e.getUnitId(), r = this._renderManagerService.getRenderById(n);
1824
2139
  return r ? { render: r, unitId: n, subUnitId: e.getSheetId() } : null;
1825
2140
  }),
1826
- we(
1827
- (e) => e ? qr(e.render.scene.getViewport(xn.VIEW_MAIN).onScrollAfter$).pipe(Re(() => ({ unitId: e.unitId, subUnitId: e.subUnitId }))) : Bn(null)
2141
+ me(
2142
+ (e) => e ? bi(e.render.scene.getViewport(cr.VIEW_MAIN).onScrollAfter$).pipe(pe(() => ({ unitId: e.unitId, subUnitId: e.subUnitId }))) : wn(null)
1828
2143
  )
1829
2144
  ).subscribe((e) => {
1830
2145
  if (!e) return;
@@ -1832,15 +2147,15 @@ let tt = class extends re {
1832
2147
  t(n, r);
1833
2148
  })
1834
2149
  ), this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
1835
- if (e.id === _n.id) {
2150
+ if (e.id === kn.id) {
1836
2151
  const n = e.params, { unitId: r } = n;
1837
2152
  Array.from(this._domLayerInfoMap.values()).filter((o) => o.unitId === r).map((o) => o.subUnitId).forEach((o) => {
1838
2153
  t(r, o);
1839
2154
  });
1840
- } else if (e.id === hi.id) {
2155
+ } else if (e.id === Bi.id) {
1841
2156
  const { unitId: n, subUnitId: r } = e.params;
1842
2157
  t(n, r);
1843
- } else if (e.id === gi.id) {
2158
+ } else if (e.id === ji.id) {
1844
2159
  const { unitId: n, subUnitId: r } = e.params;
1845
2160
  t(n, r);
1846
2161
  }
@@ -1849,13 +2164,13 @@ let tt = class extends re {
1849
2164
  updateFloatDomProps(t, e, n, r) {
1850
2165
  const s = this._domLayerInfoMap.get(n), o = this._getSceneAndTransformerByDrawingSearch(t);
1851
2166
  if (s && o) {
1852
- const { scene: a } = o, d = Ie({ unitId: t, subUnitId: e, drawingId: n }), u = a.getObject(d);
1853
- u && u instanceof Ue && u.setProps(r);
2167
+ const { scene: a } = o, d = De({ unitId: t, subUnitId: e, drawingId: n }), u = a.getObject(d);
2168
+ u && u instanceof ke && u.setProps(r);
1854
2169
  }
1855
2170
  }
1856
2171
  _getPosition(t, e) {
1857
2172
  var g;
1858
- const { startX: n, endX: r, startY: s, endY: o } = t, a = (g = this._renderManagerService.getRenderById(e)) == null ? void 0 : g.with(Ye);
2173
+ const { startX: n, endX: r, startY: s, endY: o } = t, a = (g = this._renderManagerService.getRenderById(e)) == null ? void 0 : g.with(Ze);
1859
2174
  if (a == null)
1860
2175
  return;
1861
2176
  const d = a.getCellWithCoordByOffset(n, s);
@@ -1885,7 +2200,7 @@ let tt = class extends re {
1885
2200
  this._drawingManagerService.update$.subscribe((t) => {
1886
2201
  t.forEach((e) => {
1887
2202
  const n = this._drawingManagerService.getDrawingByParam(e);
1888
- if (!n || n.drawingType !== W.DRAWING_DOM && n.drawingType !== W.DRAWING_CHART)
2203
+ if (!n || n.drawingType !== x.DRAWING_DOM && n.drawingType !== x.DRAWING_CHART)
1889
2204
  return;
1890
2205
  const r = {
1891
2206
  ...n.transform
@@ -1894,7 +2209,7 @@ let tt = class extends re {
1894
2209
  ...n
1895
2210
  });
1896
2211
  const s = this._getSceneAndTransformerByDrawingSearch(e.unitId);
1897
- if (s && n.drawingType !== W.DRAWING_CHART) {
2212
+ if (s && n.drawingType !== x.DRAWING_CHART) {
1898
2213
  const { scene: o } = s, a = this._domLayerInfoMap.get(e.drawingId);
1899
2214
  a != null && a.rect && (n.allowTransform === !1 ? o.detachTransformerFrom(a.rect) : o.attachTransformerTo(a.rect));
1900
2215
  }
@@ -1913,20 +2228,20 @@ let tt = class extends re {
1913
2228
  }
1914
2229
  // CreateFloatDomCommand --> floatDomService.addFloatDomToPosition
1915
2230
  addFloatDomToPosition(t, e) {
1916
- const n = oe(this._univerInstanceService, {
2231
+ const n = ae(this._univerInstanceService, {
1917
2232
  unitId: t.unitId,
1918
2233
  subUnitId: t.subUnitId
1919
2234
  });
1920
2235
  if (!n)
1921
2236
  throw new Error("cannot find current target!");
1922
- const { unitId: r, subUnitId: s } = n, { initPosition: o, componentKey: a, data: d, allowTransform: u = !0 } = t, c = e != null ? e : Be(), l = this._getPosition(o, r);
2237
+ const { unitId: r, subUnitId: s } = n, { initPosition: o, componentKey: a, data: d, allowTransform: u = !0 } = t, c = e != null ? e : Ve(), l = this._getPosition(o, r);
1923
2238
  if (l == null)
1924
2239
  return;
1925
2240
  const g = {
1926
2241
  unitId: r,
1927
2242
  subUnitId: s,
1928
2243
  drawingId: c,
1929
- drawingType: t.type || W.DRAWING_DOM,
2244
+ drawingType: t.type || x.DRAWING_DOM,
1930
2245
  componentKey: a,
1931
2246
  sheetTransform: l,
1932
2247
  transform: {
@@ -1938,7 +2253,7 @@ let tt = class extends re {
1938
2253
  data: d,
1939
2254
  allowTransform: u
1940
2255
  };
1941
- return this._commandService.executeCommand(kt.id, {
2256
+ return this._commandService.executeCommand(Xt.id, {
1942
2257
  unitId: r,
1943
2258
  drawings: [g]
1944
2259
  }), this._add$.next({ unitId: r, subUnitId: s, id: c }), {
@@ -1965,8 +2280,8 @@ let tt = class extends re {
1965
2280
  }
1966
2281
  // eslint-disable-next-line max-lines-per-function, complexity
1967
2282
  addFloatDomToRange(t, e, n, r) {
1968
- var C, w, y;
1969
- const s = oe(this._univerInstanceService, {
2283
+ var C, _, y;
2284
+ const s = ae(this._univerInstanceService, {
1970
2285
  unitId: e.unitId,
1971
2286
  subUnitId: e.subUnitId
1972
2287
  });
@@ -1976,84 +2291,84 @@ let tt = class extends re {
1976
2291
  if (!d) return;
1977
2292
  const u = this._renderManagerService.getRenderById(o);
1978
2293
  if (!u) return;
1979
- const c = (C = this._renderManagerService.getRenderById(o)) == null ? void 0 : C.with(V).getWorksheetSkeleton(a);
2294
+ const c = (C = this._renderManagerService.getRenderById(o)) == null ? void 0 : C.with(X).getWorksheetSkeleton(a);
1980
2295
  if (!c) return;
1981
- const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Be(), { position: p, position$: m } = this._createRangePositionObserver(t, u, c.skeleton);
1982
- if (this._getPosition(p, o) == null)
2296
+ const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Ve(), { position: m, position$: p } = this._createRangePositionObserver(t, u, c.skeleton);
2297
+ if (this._getPosition(m, o) == null)
1983
2298
  return;
1984
- const v = d.scene, { scaleX: I } = v.getAncestorScale(), R = Ct(p, n, I), S = {
2299
+ const S = d.scene, { scaleX: I } = S.getAncestorScale(), D = Ut(m, n, I), v = {
1985
2300
  unitId: o,
1986
2301
  subUnitId: a,
1987
2302
  drawingId: f,
1988
- drawingType: e.type || W.DRAWING_DOM,
2303
+ drawingType: e.type || x.DRAWING_DOM,
1989
2304
  componentKey: l,
1990
2305
  transform: {
1991
- left: R.startX,
1992
- top: R.startY,
1993
- width: R.width,
1994
- height: R.height
2306
+ left: D.startX,
2307
+ top: D.startY,
2308
+ width: D.width,
2309
+ height: D.height
1995
2310
  },
1996
2311
  data: g,
1997
2312
  allowTransform: h
1998
2313
  };
1999
2314
  {
2000
- const { unitId: D, subUnitId: T, drawingId: E } = S, M = oe(this._univerInstanceService, { unitId: D, subUnitId: T }), b = S, N = this._univerInstanceService.getUnit(D, F.UNIVER_SHEET);
2315
+ const { unitId: R, subUnitId: E, drawingId: T } = v, M = ae(this._univerInstanceService, { unitId: R, subUnitId: E }), b = v, N = this._univerInstanceService.getUnit(R, $.UNIVER_SHEET);
2001
2316
  if (!N)
2002
2317
  return;
2003
- const x = N.getActiveSheet().getSheetId();
2318
+ const F = N.getActiveSheet().getSheetId();
2004
2319
  if (!b || !M)
2005
2320
  return;
2006
- const Q = (w = this._renderManagerService.getRenderById(D)) == null ? void 0 : w.with(V);
2007
- if (!Q)
2321
+ const te = (_ = this._renderManagerService.getRenderById(R)) == null ? void 0 : _.with(X);
2322
+ if (!te)
2008
2323
  return;
2009
- const H = Q.getWorksheetSkeleton(T);
2010
- if (!H)
2324
+ const z = te.getWorksheetSkeleton(E);
2325
+ if (!z)
2011
2326
  return;
2012
- const { transform: G, drawingType: L, data: J } = b;
2013
- if (L !== W.DRAWING_DOM && L !== W.DRAWING_CHART)
2327
+ const { transform: H, drawingType: G, data: J } = b;
2328
+ if (G !== x.DRAWING_DOM && G !== x.DRAWING_CHART)
2014
2329
  return;
2015
- const z = this._getSceneAndTransformerByDrawingSearch(D);
2016
- if (z == null)
2330
+ const K = this._getSceneAndTransformerByDrawingSearch(R);
2331
+ if (K == null)
2017
2332
  return;
2018
- const { scene: B, canvas: be } = z;
2019
- if (G == null || x !== T)
2333
+ const { scene: W, canvas: Oe } = K;
2334
+ if (H == null || F !== E)
2020
2335
  return;
2021
- const { left: ot, top: at, width: ct, height: dt, angle: jt, flipX: $t, flipY: lt, skewX: ut, skewY: Me } = G, ht = Ie({ unitId: D, subUnitId: T, drawingId: E }), de = B.getObject(ht);
2022
- if (de != null) {
2023
- de.transformByState({ left: ot, top: at, width: ct, height: dt, angle: jt, flipX: $t, flipY: lt, skewX: ut, skewY: Me });
2336
+ const { left: mt, top: pt, width: wt, height: _t, angle: Zt, flipX: Jt, flipY: St, skewX: vt, skewY: Ue } = H, It = De({ unitId: R, subUnitId: E, drawingId: T }), le = W.getObject(It);
2337
+ if (le != null) {
2338
+ le.transformByState({ left: mt, top: pt, width: wt, height: _t, angle: Zt, flipX: Jt, flipY: St, skewX: vt, skewY: Ue });
2024
2339
  return;
2025
2340
  }
2026
- const ee = {
2027
- left: ot,
2341
+ const ne = {
2342
+ left: mt,
2028
2343
  // from floatDomParam.transform
2029
- top: at,
2030
- width: ct,
2031
- height: dt,
2032
- zIndex: this._drawingManagerService.getDrawingOrder(D, T).length - 1
2033
- }, ye = L === W.DRAWING_CHART;
2034
- if (ye) {
2344
+ top: pt,
2345
+ width: wt,
2346
+ height: _t,
2347
+ zIndex: this._drawingManagerService.getDrawingOrder(R, E).length - 1
2348
+ }, Pe = G === x.DRAWING_CHART;
2349
+ if (Pe) {
2035
2350
  const k = J ? J.backgroundColor : "white";
2036
- ee.fill = k, ee.rotateEnabled = !1, J && J.border && (ee.stroke = J.border), ee.paintFirst = "stroke", ee.strokeWidth = 1, ee.borderEnabled = !1, ee.radius = 8;
2351
+ 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;
2037
2352
  }
2038
- const le = new Ue(ht, ee);
2039
- ye && le.setObjectType(mn.CHART), B.addObject(le, Ft), b.allowTransform !== !1 && B.attachTransformerTo(le);
2040
- const ue = new _t(), gt = B.getMainViewport(), { rowHeaderWidth: Te, columnHeaderHeight: Le } = H.skeleton, ft = {
2041
- top: Le,
2042
- left: Te,
2043
- bottom: gt.bottom,
2044
- right: gt.right
2045
- }, he = {
2046
- dispose: ue,
2047
- rect: le,
2048
- boundsOfViewArea: ft,
2353
+ const ue = new ke(It, ne);
2354
+ Pe && ue.setObjectType(An.CHART), W.addObject(ue, qt), b.allowTransform !== !1 && W.attachTransformerTo(ue);
2355
+ const he = new yt(), Ct = W.getMainViewport(), { rowHeaderWidth: Ae, columnHeaderHeight: Qe } = z.skeleton, Rt = {
2356
+ top: Qe,
2357
+ left: Ae,
2358
+ bottom: Ct.bottom,
2359
+ right: Ct.right
2360
+ }, ge = {
2361
+ dispose: he,
2362
+ rect: ue,
2363
+ boundsOfViewArea: Rt,
2049
2364
  domAnchor: n,
2050
- unitId: D,
2051
- subUnitId: T
2052
- }, j = ge(le, z.renderUnit.scene, H.skeleton, M.worksheet, he), Ee = new ke(j);
2053
- he.position$ = Ee;
2054
- let Ve = {
2055
- position$: Ee,
2056
- id: E,
2365
+ unitId: R,
2366
+ subUnitId: E
2367
+ }, B = fe(ue, K.renderUnit.scene, z.skeleton, M.worksheet, ge), Ne = new je(B);
2368
+ ge.position$ = Ne;
2369
+ let et = {
2370
+ position$: Ne,
2371
+ id: T,
2057
2372
  componentKey: b.componentKey,
2058
2373
  onPointerDown: () => {
2059
2374
  },
@@ -2062,57 +2377,57 @@ let tt = class extends re {
2062
2377
  onPointerUp: () => {
2063
2378
  },
2064
2379
  onWheel: (k) => {
2065
- be.dispatchEvent(new WheelEvent(k.type, k));
2380
+ Oe.dispatchEvent(new WheelEvent(k.type, k));
2066
2381
  },
2067
2382
  data: J,
2068
- unitId: D
2383
+ unitId: R
2069
2384
  };
2070
- e.eventPassThrough && (Ve = {
2071
- ...Ve,
2385
+ e.eventPassThrough && (et = {
2386
+ ...et,
2072
2387
  onPointerDown: (k) => {
2073
- be.dispatchEvent(new PointerEvent(k.type, k));
2388
+ Oe.dispatchEvent(new PointerEvent(k.type, k));
2074
2389
  },
2075
2390
  onPointerMove: (k) => {
2076
- be.dispatchEvent(new PointerEvent(k.type, k));
2391
+ Oe.dispatchEvent(new PointerEvent(k.type, k));
2077
2392
  },
2078
2393
  onPointerUp: (k) => {
2079
- be.dispatchEvent(new PointerEvent(k.type, k));
2394
+ Oe.dispatchEvent(new PointerEvent(k.type, k));
2080
2395
  }
2081
- }), this._canvasFloatDomService.addFloatDom(Ve), this.disposeWithMe(m.subscribe((k) => {
2082
- var un, hn, gn, fn;
2083
- const ln = Ct({
2396
+ }), this._canvasFloatDomService.addFloatDom(et), this.disposeWithMe(p.subscribe((k) => {
2397
+ var Tn, On, Un, Pn;
2398
+ const En = Ut({
2084
2399
  startX: k.startX,
2085
2400
  startY: k.startY,
2086
2401
  endX: k.endX,
2087
2402
  endY: k.endY,
2088
- width: (un = n.width) != null ? un : k.width,
2089
- height: (hn = n.height) != null ? hn : k.height,
2403
+ width: (Tn = n.width) != null ? Tn : k.width,
2404
+ height: (On = n.height) != null ? On : k.height,
2090
2405
  absolute: {
2091
- left: p.absolute.left,
2092
- top: p.absolute.top
2406
+ left: m.absolute.left,
2407
+ top: m.absolute.top
2093
2408
  }
2094
- }, n), Rr = Ie({ unitId: D, subUnitId: T, drawingId: E }), br = new Ue(Rr, {
2095
- left: ln.startX,
2096
- top: ln.startY,
2097
- width: (gn = n.width) != null ? gn : k.width,
2098
- height: (fn = n.height) != null ? fn : k.height,
2099
- zIndex: this._drawingManagerService.getDrawingOrder(D, T).length - 1
2100
- }), Mr = ge(br, z.renderUnit.scene, H.skeleton, M.worksheet, he);
2101
- Ee.next(Mr);
2409
+ }, n), Zr = De({ unitId: R, subUnitId: E, drawingId: T }), Jr = new ke(Zr, {
2410
+ left: En.startX,
2411
+ top: En.startY,
2412
+ width: (Un = n.width) != null ? Un : k.width,
2413
+ height: (Pn = n.height) != null ? Pn : k.height,
2414
+ zIndex: this._drawingManagerService.getDrawingOrder(R, E).length - 1
2415
+ }), qr = fe(Jr, K.renderUnit.scene, z.skeleton, M.worksheet, ge);
2416
+ Ne.next(qr);
2102
2417
  }));
2103
- const He = (y = this._renderManagerService.getRenderById(D)) == null ? void 0 : y.with(V);
2104
- He == null || He.currentSkeleton$.subscribe((k) => {
2105
- k && H.sheetId !== k.sheetId && this._removeDom(f, !0);
2418
+ const tt = (y = this._renderManagerService.getRenderById(R)) == null ? void 0 : y.with(X);
2419
+ tt == null || tt.currentSkeleton$.subscribe((k) => {
2420
+ k && z.sheetId !== k.sheetId && this._removeDom(f, !0);
2106
2421
  });
2107
- const mt = le.onTransformChange$.subscribeEvent(() => {
2108
- const k = ge(le, z.renderUnit.scene, H.skeleton, M.worksheet, he);
2109
- Ee.next(
2422
+ const Dt = ue.onTransformChange$.subscribeEvent(() => {
2423
+ const k = fe(ue, K.renderUnit.scene, z.skeleton, M.worksheet, ge);
2424
+ Ne.next(
2110
2425
  k
2111
2426
  );
2112
2427
  });
2113
- ue.add(() => {
2114
- this._canvasFloatDomService.removeFloatDom(E);
2115
- }), mt && ue.add(mt), this._domLayerInfoMap.set(E, he);
2428
+ he.add(() => {
2429
+ this._canvasFloatDomService.removeFloatDom(T);
2430
+ }), Dt && he.add(Dt), this._domLayerInfoMap.set(T, ge);
2116
2431
  }
2117
2432
  return {
2118
2433
  id: f,
@@ -2123,8 +2438,8 @@ let tt = class extends re {
2123
2438
  }
2124
2439
  // eslint-disable-next-line max-lines-per-function, complexity
2125
2440
  addFloatDomToColumnHeader(t, e, n, r) {
2126
- var R, S, C;
2127
- const s = oe(this._univerInstanceService, {
2441
+ var D, v, C;
2442
+ const s = ae(this._univerInstanceService, {
2128
2443
  unitId: e.unitId,
2129
2444
  subUnitId: e.subUnitId
2130
2445
  });
@@ -2134,153 +2449,153 @@ let tt = class extends re {
2134
2449
  if (!this._getSceneAndTransformerByDrawingSearch(o)) return;
2135
2450
  const u = this._renderManagerService.getRenderById(o);
2136
2451
  if (!u) return;
2137
- const c = (R = this._renderManagerService.getRenderById(o)) == null ? void 0 : R.with(V).getWorksheetSkeleton(a);
2452
+ const c = (D = this._renderManagerService.getRenderById(o)) == null ? void 0 : D.with(X).getWorksheetSkeleton(a);
2138
2453
  if (!c) return;
2139
- const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Be(), { position: p, position$: m } = this._createRangePositionObserver({
2454
+ const { componentKey: l, data: g, allowTransform: h = !0 } = e, f = r != null ? r : Ve(), { position: m, position$: p } = this._createRangePositionObserver({
2140
2455
  startRow: 0,
2141
2456
  endRow: 0,
2142
2457
  startColumn: t,
2143
2458
  endColumn: t
2144
- }, u, c.skeleton), _ = p;
2145
- if (_.startY = 0, this._getPosition(p, o) == null)
2459
+ }, u, c.skeleton), w = m;
2460
+ if (w.startY = 0, this._getPosition(m, o) == null)
2146
2461
  return;
2147
2462
  const I = {
2148
2463
  unitId: o,
2149
2464
  subUnitId: a,
2150
2465
  drawingId: f,
2151
- drawingType: e.type || W.DRAWING_DOM,
2466
+ drawingType: e.type || x.DRAWING_DOM,
2152
2467
  componentKey: l,
2153
2468
  transform: {
2154
- left: _.startX,
2155
- top: _.startY,
2156
- width: _.width,
2157
- height: _.height
2469
+ left: w.startX,
2470
+ top: w.startY,
2471
+ width: w.width,
2472
+ height: w.height
2158
2473
  },
2159
2474
  data: g,
2160
2475
  allowTransform: h
2161
2476
  };
2162
2477
  {
2163
- const { unitId: w, subUnitId: y, drawingId: D } = I, T = oe(this._univerInstanceService, { unitId: w, subUnitId: y }), E = I, M = this._univerInstanceService.getUnit(w, F.UNIVER_SHEET);
2478
+ const { unitId: _, subUnitId: y, drawingId: R } = I, E = ae(this._univerInstanceService, { unitId: _, subUnitId: y }), T = I, M = this._univerInstanceService.getUnit(_, $.UNIVER_SHEET);
2164
2479
  if (!M)
2165
2480
  return;
2166
2481
  const b = M.getActiveSheet().getSheetId();
2167
- if (!E || !T)
2482
+ if (!T || !E)
2168
2483
  return;
2169
- const N = (S = this._renderManagerService.getRenderById(w)) == null ? void 0 : S.with(V);
2484
+ const N = (v = this._renderManagerService.getRenderById(_)) == null ? void 0 : v.with(X);
2170
2485
  if (!N)
2171
2486
  return;
2172
- const x = N.getWorksheetSkeleton(y);
2173
- if (!x)
2487
+ const F = N.getWorksheetSkeleton(y);
2488
+ if (!F)
2174
2489
  return;
2175
- const { transform: Q, data: H } = E, G = this._getSceneAndTransformerByDrawingSearch(w);
2176
- if (G == null)
2490
+ const { transform: te, data: z } = T, H = this._getSceneAndTransformerByDrawingSearch(_);
2491
+ if (H == null)
2177
2492
  return;
2178
- const { scene: L, canvas: J } = G;
2179
- if (Q == null || b !== y)
2493
+ const { scene: G, canvas: J } = H;
2494
+ if (te == null || b !== y)
2180
2495
  return;
2181
- const { left: z, top: B, width: be, height: ot, angle: at, flipX: ct, flipY: dt, skewX: jt, skewY: $t } = Q, lt = Ie({ unitId: w, subUnitId: y, drawingId: D }), ut = L.getObject(lt);
2182
- if (ut != null) {
2183
- ut.transformByState({ left: z, top: B, width: be, height: ot, angle: at, flipX: ct, flipY: dt, skewX: jt, skewY: $t });
2496
+ const { left: K, top: W, width: Oe, height: mt, angle: pt, flipX: wt, flipY: _t, skewX: Zt, skewY: Jt } = te, St = De({ unitId: _, subUnitId: y, drawingId: R }), vt = G.getObject(St);
2497
+ if (vt != null) {
2498
+ vt.transformByState({ left: K, top: W, width: Oe, height: mt, angle: pt, flipX: wt, flipY: _t, skewX: Zt, skewY: Jt });
2184
2499
  return;
2185
2500
  }
2186
- const Me = Ct({
2187
- startX: _.startX,
2501
+ const Ue = Ut({
2502
+ startX: w.startX,
2188
2503
  startY: 0,
2189
- endX: p.endX,
2190
- endY: p.endY,
2504
+ endX: m.endX,
2505
+ endY: m.endY,
2191
2506
  width: n.width,
2192
2507
  height: n.height,
2193
2508
  absolute: {
2194
- left: p.absolute.left,
2195
- top: p.absolute.top
2509
+ left: m.absolute.left,
2510
+ top: m.absolute.top
2196
2511
  }
2197
- }, n), ht = {
2198
- left: Me.startX,
2199
- top: Me.startY,
2200
- width: Me.width,
2201
- height: Me.height,
2202
- zIndex: this._drawingManagerService.getDrawingOrder(w, y).length - 1
2203
- }, de = new Ue(lt, ht);
2204
- L.addObject(de, Ft), E.allowTransform !== !1 && L.attachTransformerTo(de);
2205
- const ee = new _t(), ye = L.getMainViewport(), le = {
2512
+ }, n), It = {
2513
+ left: Ue.startX,
2514
+ top: Ue.startY,
2515
+ width: Ue.width,
2516
+ height: Ue.height,
2517
+ zIndex: this._drawingManagerService.getDrawingOrder(_, y).length - 1
2518
+ }, le = new ke(St, It);
2519
+ G.addObject(le, qt), T.allowTransform !== !1 && G.attachTransformerTo(le);
2520
+ const ne = new yt(), Pe = G.getMainViewport(), ue = {
2206
2521
  top: 0,
2207
2522
  //viewMain.top,
2208
- left: ye.left,
2209
- bottom: ye.bottom,
2210
- right: ye.right
2211
- }, ue = {
2212
- dispose: ee,
2213
- rect: de,
2523
+ left: Pe.left,
2524
+ bottom: Pe.bottom,
2525
+ right: Pe.right
2526
+ }, he = {
2527
+ dispose: ne,
2528
+ rect: le,
2214
2529
  // position$,
2215
- unitId: w,
2530
+ unitId: _,
2216
2531
  subUnitId: y,
2217
- boundsOfViewArea: le,
2532
+ boundsOfViewArea: ue,
2218
2533
  domAnchor: n,
2219
2534
  scrollDirectionResponse: "HORIZONTAL"
2220
2535
  /* HORIZONTAL */
2221
- }, gt = ge(de, G.renderUnit.scene, x.skeleton, T.worksheet, ue), Te = new ke(gt);
2222
- ue.position$ = Te;
2223
- let Le = {
2224
- position$: Te,
2225
- id: D,
2226
- componentKey: E.componentKey,
2536
+ }, Ct = fe(le, H.renderUnit.scene, F.skeleton, E.worksheet, he), Ae = new je(Ct);
2537
+ he.position$ = Ae;
2538
+ let Qe = {
2539
+ position$: Ae,
2540
+ id: R,
2541
+ componentKey: T.componentKey,
2227
2542
  onPointerDown: () => {
2228
2543
  },
2229
2544
  onPointerMove: () => {
2230
2545
  },
2231
2546
  onPointerUp: () => {
2232
2547
  },
2233
- onWheel: (j) => {
2234
- J.dispatchEvent(new WheelEvent(j.type, j));
2548
+ onWheel: (B) => {
2549
+ J.dispatchEvent(new WheelEvent(B.type, B));
2235
2550
  },
2236
- data: H,
2237
- unitId: w
2551
+ data: z,
2552
+ unitId: _
2238
2553
  };
2239
- e.eventPassThrough && (Le = {
2240
- ...Le,
2241
- onPointerDown: (j) => {
2242
- J.dispatchEvent(new PointerEvent(j.type, j));
2554
+ e.eventPassThrough && (Qe = {
2555
+ ...Qe,
2556
+ onPointerDown: (B) => {
2557
+ J.dispatchEvent(new PointerEvent(B.type, B));
2243
2558
  },
2244
- onPointerMove: (j) => {
2245
- J.dispatchEvent(new PointerEvent(j.type, j));
2559
+ onPointerMove: (B) => {
2560
+ J.dispatchEvent(new PointerEvent(B.type, B));
2246
2561
  },
2247
- onPointerUp: (j) => {
2248
- J.dispatchEvent(new PointerEvent(j.type, j));
2562
+ onPointerUp: (B) => {
2563
+ J.dispatchEvent(new PointerEvent(B.type, B));
2249
2564
  }
2250
- }), this._canvasFloatDomService.addFloatDom(Le);
2251
- const ft = de.onTransformChange$.subscribeEvent(() => {
2252
- const j = ge(de, G.renderUnit.scene, x.skeleton, T.worksheet, ue);
2253
- Te.next(
2254
- j
2565
+ }), this._canvasFloatDomService.addFloatDom(Qe);
2566
+ const Rt = le.onTransformChange$.subscribeEvent(() => {
2567
+ const B = fe(le, H.renderUnit.scene, F.skeleton, E.worksheet, he);
2568
+ Ae.next(
2569
+ B
2255
2570
  );
2256
2571
  });
2257
- this.disposeWithMe(m.subscribe((j) => {
2258
- const Ee = Ct({
2259
- startX: j.startX,
2572
+ this.disposeWithMe(p.subscribe((B) => {
2573
+ const Ne = Ut({
2574
+ startX: B.startX,
2260
2575
  startY: 0,
2261
- endX: j.endX,
2262
- endY: j.endY,
2576
+ endX: B.endX,
2577
+ endY: B.endY,
2263
2578
  width: n.width,
2264
2579
  height: n.height,
2265
2580
  absolute: {
2266
- left: p.absolute.left,
2267
- top: p.absolute.top
2581
+ left: m.absolute.left,
2582
+ top: m.absolute.top
2268
2583
  }
2269
- }, n), Ve = Ie({ unitId: w, subUnitId: y, drawingId: D }), He = new Ue(Ve, {
2270
- left: Ee.startX,
2584
+ }, n), et = De({ unitId: _, subUnitId: y, drawingId: R }), tt = new ke(et, {
2585
+ left: Ne.startX,
2271
2586
  top: 0,
2272
2587
  width: n.width,
2273
2588
  height: n.height,
2274
- zIndex: this._drawingManagerService.getDrawingOrder(w, y).length - 1
2275
- }), mt = ge(He, G.renderUnit.scene, x.skeleton, T.worksheet, ue);
2276
- Te.next(mt);
2589
+ zIndex: this._drawingManagerService.getDrawingOrder(_, y).length - 1
2590
+ }), Dt = fe(tt, H.renderUnit.scene, F.skeleton, E.worksheet, he);
2591
+ Ae.next(Dt);
2277
2592
  }));
2278
- const he = (C = this._renderManagerService.getRenderById(w)) == null ? void 0 : C.with(V);
2279
- he == null || he.currentSkeleton$.subscribe((j) => {
2280
- j && c.sheetId !== j.sheetId && this._removeDom(f, !0);
2281
- }), ee.add(() => {
2282
- this._canvasFloatDomService.removeFloatDom(D);
2283
- }), ft && ee.add(ft), this._domLayerInfoMap.set(D, ue);
2593
+ const ge = (C = this._renderManagerService.getRenderById(_)) == null ? void 0 : C.with(X);
2594
+ ge == null || ge.currentSkeleton$.subscribe((B) => {
2595
+ B && c.sheetId !== B.sheetId && this._removeDom(f, !0);
2596
+ }), ne.add(() => {
2597
+ this._canvasFloatDomService.removeFloatDom(R);
2598
+ }), Rt && ne.add(Rt), this._domLayerInfoMap.set(R, he);
2284
2599
  }
2285
2600
  return {
2286
2601
  id: f,
@@ -2302,19 +2617,19 @@ let tt = class extends re {
2302
2617
  // eslint-disable-next-line max-lines-per-function
2303
2618
  _createRangePositionObserver(t, e, n) {
2304
2619
  let { startRow: r, startColumn: s } = t;
2305
- const o = Ze(r, s, n), a = new ke(o), d = Ze(t.endRow, t.endColumn, n), u = new ke(d), c = () => {
2306
- const m = Ze(r, s, n), _ = Ze(t.endRow, t.endColumn, n);
2307
- a.next(m), u.next(_);
2308
- }, l = new _t();
2309
- l.add(e.engine.clientRect$.subscribe(() => c())), l.add(this._commandService.onCommandExecuted((m) => {
2310
- if (m.id === fi.id && m.params.rowsAutoHeightInfo.findIndex((v) => v.row === r) > -1) {
2620
+ const o = st(r, s, n), a = new je(o), d = st(t.endRow, t.endColumn, n), u = new je(d), c = () => {
2621
+ const p = st(r, s, n), w = st(t.endRow, t.endColumn, n);
2622
+ a.next(p), u.next(w);
2623
+ }, l = new yt();
2624
+ l.add(e.engine.clientRect$.subscribe(() => c())), l.add(this._commandService.onCommandExecuted((p) => {
2625
+ if (p.id === Fi.id && p.params.rowsAutoHeightInfo.findIndex((S) => S.row === r) > -1) {
2311
2626
  c();
2312
2627
  return;
2313
2628
  }
2314
- (mi.indexOf(m.id) > -1 || m.id === Fr.id || m.id === _n.id) && c();
2629
+ (Li.indexOf(p.id) > -1 || p.id === hi.id || p.id === kn.id) && c();
2315
2630
  }));
2316
- const g = (m, _) => {
2317
- r = m, s = _, c();
2631
+ const g = (p, w) => {
2632
+ r = p, s = w, c();
2318
2633
  }, h = () => ({
2319
2634
  rotate: 0,
2320
2635
  width: d.right - o.left,
@@ -2328,26 +2643,26 @@ let tt = class extends re {
2328
2643
  endX: d.right,
2329
2644
  endY: d.bottom
2330
2645
  }), f = a.pipe(
2331
- Re((m) => {
2332
- const _ = Ze(t.endRow, t.endColumn, n);
2646
+ pe((p) => {
2647
+ const w = st(t.endRow, t.endColumn, n);
2333
2648
  return {
2334
2649
  rotate: 0,
2335
- width: _.right - m.left,
2336
- height: _.bottom - m.top,
2650
+ width: w.right - p.left,
2651
+ height: w.bottom - p.top,
2337
2652
  absolute: {
2338
2653
  left: !0,
2339
2654
  top: !0
2340
2655
  },
2341
- startX: m.left,
2342
- startY: m.top,
2343
- endX: _.right,
2344
- endY: _.bottom
2656
+ startX: p.left,
2657
+ startY: p.top,
2658
+ endX: w.right,
2659
+ endY: w.bottom
2345
2660
  };
2346
2661
  })
2347
- ), p = h();
2662
+ ), m = h();
2348
2663
  return {
2349
2664
  position$: f,
2350
- position: p,
2665
+ position: m,
2351
2666
  updateRowCol: g,
2352
2667
  topLeftPos$: a,
2353
2668
  rightBottomPos$: u,
@@ -2355,16 +2670,16 @@ let tt = class extends re {
2355
2670
  };
2356
2671
  }
2357
2672
  };
2358
- tt = Ts([
2359
- Ce(0, A(Z)),
2360
- Ce(1, Se),
2361
- Ce(2, A(X)),
2362
- Ce(3, se),
2363
- Ce(4, A(Bi)),
2364
- Ce(5, ie),
2365
- Ce(6, A(Jr))
2366
- ], tt);
2367
- function Ze(i, t, e) {
2673
+ lt = oo([
2674
+ be(0, A(Q)),
2675
+ be(1, de),
2676
+ be(2, A(Y)),
2677
+ be(3, oe),
2678
+ be(4, A(us)),
2679
+ be(5, se),
2680
+ be(6, A(Ri))
2681
+ ], lt);
2682
+ function st(i, t, e) {
2368
2683
  const n = e.getCellWithCoordByIndex(i, t), r = n.isMergedMainCell ? n.mergeInfo : n;
2369
2684
  return {
2370
2685
  left: r.startX,
@@ -2373,22 +2688,22 @@ function Ze(i, t, e) {
2373
2688
  bottom: r.endY
2374
2689
  };
2375
2690
  }
2376
- function Ct(i, t, e) {
2691
+ function Ut(i, t, e) {
2377
2692
  var u, c;
2378
2693
  e = e != null ? e : 1;
2379
2694
  const n = i.endX - i.startX, r = i.endY - i.startY, s = (u = t == null ? void 0 : t.width) != null ? u : n, o = (c = t == null ? void 0 : t.height) != null ? c : r;
2380
2695
  let a = 0, d = 0;
2381
2696
  if (t) {
2382
2697
  if (t.horizonOffsetAlign === "right") {
2383
- const l = Dt(t.marginX, n * e);
2698
+ const l = Pt(t.marginX, n * e);
2384
2699
  a = i.endX - l - s;
2385
2700
  } else
2386
- a = i.startX + Dt(t.marginX, n);
2701
+ a = i.startX + Pt(t.marginX, n);
2387
2702
  if (t.verticalOffsetAlign === "bottom") {
2388
- const l = Dt(t.marginY, r * e);
2703
+ const l = Pt(t.marginY, r * e);
2389
2704
  d = i.endY - l - o;
2390
2705
  } else
2391
- d = i.startY + Dt(t.marginY, r);
2706
+ d = i.startY + Pt(t.marginY, r);
2392
2707
  }
2393
2708
  return {
2394
2709
  rotate: 0,
@@ -2404,15 +2719,15 @@ function Ct(i, t, e) {
2404
2719
  }
2405
2720
  };
2406
2721
  }
2407
- function Dt(i, t) {
2722
+ function Pt(i, t) {
2408
2723
  if (i === void 0) return 0;
2409
2724
  if (typeof i == "number") return i;
2410
2725
  const e = Number.parseFloat(i);
2411
2726
  return t * e / 100;
2412
2727
  }
2413
- const Os = (i) => {
2414
- const { floatDomInfos: t, scene: e, skeleton: n, worksheet: r } = i, s = es(() => t.map((o) => {
2415
- const { width: a, height: d, angle: u, left: c, top: l } = o.transform, g = Ir(
2728
+ const co = (i) => {
2729
+ const { floatDomInfos: t, scene: e, skeleton: n, worksheet: r } = i, s = Fe(() => t.map((o) => {
2730
+ const { width: a, height: d, angle: u, left: c, top: l } = o.transform, g = Hr(
2416
2731
  {
2417
2732
  left: c != null ? c : 0,
2418
2733
  right: (c != null ? c : 0) + (a != null ? a : 0),
@@ -2424,7 +2739,7 @@ const Os = (i) => {
2424
2739
  r,
2425
2740
  void 0,
2426
2741
  !0
2427
- ), { scaleX: h, scaleY: f } = e.getAncestorScale(), p = {
2742
+ ), { scaleX: h, scaleY: f } = e.getAncestorScale(), m = {
2428
2743
  startX: g.left,
2429
2744
  endX: g.right,
2430
2745
  startY: g.top,
@@ -2433,9 +2748,9 @@ const Os = (i) => {
2433
2748
  width: a * h,
2434
2749
  height: d * f,
2435
2750
  absolute: g.absolute
2436
- }, m = {
2437
- position$: new ke(p),
2438
- position: p,
2751
+ }, p = {
2752
+ position$: new je(m),
2753
+ position: m,
2439
2754
  id: o.drawingId,
2440
2755
  componentKey: o.componentKey,
2441
2756
  onPointerMove: () => {
@@ -2449,16 +2764,16 @@ const Os = (i) => {
2449
2764
  unitId: o.unitId,
2450
2765
  data: o.data
2451
2766
  };
2452
- return [o.drawingId, m];
2767
+ return [o.drawingId, p];
2453
2768
  }), [t, e, n, r]);
2454
- return /* @__PURE__ */ ae("div", { style: { position: "absolute", top: 0, left: 0 }, children: s.map(([o, a]) => /* @__PURE__ */ ae(ji, { layer: a, id: o, position: a.position }, o)) });
2769
+ return /* @__PURE__ */ L("div", { style: { position: "absolute", top: 0, left: 0 }, children: s.map(([o, a]) => /* @__PURE__ */ L(hs, { layer: a, id: o, position: a.position }, o)) });
2455
2770
  };
2456
- var Us = Object.getOwnPropertyDescriptor, Ps = (i, t, e, n) => {
2457
- for (var r = n > 1 ? void 0 : n ? Us(t, e) : t, s = i.length - 1, o; s >= 0; s--)
2771
+ var lo = Object.getOwnPropertyDescriptor, uo = (i, t, e, n) => {
2772
+ for (var r = n > 1 ? void 0 : n ? lo(t, e) : t, s = i.length - 1, o; s >= 0; s--)
2458
2773
  (o = i[s]) && (r = o(r) || r);
2459
2774
  return r;
2460
- }, De = (i, t) => (e, n) => t(e, n, i);
2461
- let Ot = class extends re {
2775
+ }, Me = (i, t) => (e, n) => t(e, n, i);
2776
+ let jt = class extends ee {
2462
2777
  constructor(i, t, e, n, r, s, o) {
2463
2778
  super(), this._sheetPrintInterceptorService = i, this._drawingRenderService = t, this._drawingManagerService = e, this._renderManagerService = n, this._canvasFloatDomManagerService = r, this._componetManager = s, this._injector = o, this._initPrinting(), this._initPrintingDom();
2464
2779
  }
@@ -2471,7 +2786,7 @@ let Ot = class extends re {
2471
2786
  const { unitId: n, scene: r, subUnitId: s } = t, o = this._drawingManagerService.getDrawingDataForUnit(n), a = o == null ? void 0 : o[s];
2472
2787
  return a && a.order.forEach((d) => {
2473
2788
  const u = a.data[d];
2474
- u.drawingType !== W.DRAWING_CHART && u.drawingType !== W.DRAWING_DOM && this._drawingRenderService.renderDrawing(u, r);
2789
+ u.drawingType !== x.DRAWING_CHART && u.drawingType !== x.DRAWING_DOM && this._drawingRenderService.renderDrawing(u, r);
2475
2790
  }), e();
2476
2791
  }
2477
2792
  }
@@ -2484,7 +2799,7 @@ let Ot = class extends re {
2484
2799
  const { unitId: n, subUnitId: r } = t, s = this._renderManagerService.getRenderById(n);
2485
2800
  if (!s)
2486
2801
  return e(i);
2487
- const o = s.with(V).getSkeletonParam(r);
2802
+ const o = s.with(X).getSkeletonParam(r);
2488
2803
  if (!o)
2489
2804
  return e(i);
2490
2805
  const a = this._drawingManagerService.getDrawingDataForUnit(n), d = a == null ? void 0 : a[t.subUnitId];
@@ -2492,9 +2807,9 @@ let Ot = class extends re {
2492
2807
  return e(i);
2493
2808
  const { scaleX: u, scaleY: c } = s.scene, l = i ? { ...i } : { startColumn: 0, endColumn: 0, endRow: 0, startRow: 0 }, g = d.order.map((h) => d.data[h]);
2494
2809
  return g.length ? (g.forEach((h) => {
2495
- if (!h.groupId && h.transform && $e.isDefine(h.transform.left) && $e.isDefine(h.transform.top) && $e.isDefine(h.transform.width) && $e.isDefine(h.transform.height)) {
2496
- const f = o.skeleton.getCellIndexByOffset(h.transform.left, h.transform.top, u, c, { x: 0, y: 0 }), p = o.skeleton.getCellIndexByOffset(h.transform.left + h.transform.width, h.transform.top + h.transform.height, u, c, { x: 0, y: 0 });
2497
- f.column < l.startColumn && (l.startColumn = f.column), f.row < l.startRow && (l.startRow = f.row), l.endRow < p.row && (l.endRow = p.row), l.endColumn < p.column && (l.endColumn = p.column);
2810
+ 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)) {
2811
+ const f = o.skeleton.getCellIndexByOffset(h.transform.left, h.transform.top, u, c, { x: 0, y: 0 }), m = o.skeleton.getCellIndexByOffset(h.transform.left + h.transform.width, h.transform.top + h.transform.height, u, c, { x: 0, y: 0 });
2812
+ f.column < l.startColumn && (l.startColumn = f.column), f.row < l.startRow && (l.startRow = f.row), l.endRow < m.row && (l.endRow = m.row), l.endColumn < m.column && (l.endColumn = m.column);
2498
2813
  }
2499
2814
  }), e(l)) : e(i);
2500
2815
  }
@@ -2512,12 +2827,12 @@ let Ot = class extends re {
2512
2827
  if (o) {
2513
2828
  const a = o.order.map((u) => {
2514
2829
  const c = o.data[u];
2515
- if (c.drawingType === W.DRAWING_CHART)
2830
+ if (c.drawingType === x.DRAWING_CHART)
2516
2831
  return {
2517
2832
  ...c,
2518
- componentKey: this._componetManager.get(Qr)
2833
+ componentKey: this._componetManager.get(Mi)
2519
2834
  };
2520
- if (c.drawingType === W.DRAWING_DOM) {
2835
+ if (c.drawingType === x.DRAWING_DOM) {
2521
2836
  const l = this._sheetPrintInterceptorService.getPrintComponent(c.componentKey);
2522
2837
  return {
2523
2838
  ...c,
@@ -2525,12 +2840,12 @@ let Ot = class extends re {
2525
2840
  };
2526
2841
  }
2527
2842
  return null;
2528
- }).filter(Boolean), d = $i(Os, this._injector);
2529
- return Ri(
2530
- /* @__PURE__ */ ae(d, { floatDomInfos: a, scene: t.scene, skeleton: t.skeleton, worksheet: t.worksheet }),
2843
+ }).filter(Boolean), d = gs(co, this._injector);
2844
+ return Ji(
2845
+ /* @__PURE__ */ L(d, { floatDomInfos: a, scene: t.scene, skeleton: t.skeleton, worksheet: t.worksheet }),
2531
2846
  t.root
2532
2847
  ), i == null || i.add(() => {
2533
- bi(t.root);
2848
+ qi(t.root);
2534
2849
  }), e(i);
2535
2850
  }
2536
2851
  }
@@ -2539,49 +2854,49 @@ let Ot = class extends re {
2539
2854
  );
2540
2855
  }
2541
2856
  };
2542
- Ot = Ps([
2543
- De(0, A(xr)),
2544
- De(1, A(lr)),
2545
- De(2, se),
2546
- De(3, Z),
2547
- De(4, A(tt)),
2548
- De(5, A(dr)),
2549
- De(6, A(Xe))
2550
- ], Ot);
2551
- var As = Object.getOwnPropertyDescriptor, Ns = (i, t, e, n) => {
2552
- for (var r = n > 1 ? void 0 : n ? As(t, e) : t, s = i.length - 1, o; s >= 0; s--)
2857
+ jt = uo([
2858
+ Me(0, A(gi)),
2859
+ Me(1, A(Pr)),
2860
+ Me(2, oe),
2861
+ Me(3, Q),
2862
+ Me(4, A(lt)),
2863
+ Me(5, A(Ur)),
2864
+ Me(6, A(qe))
2865
+ ], jt);
2866
+ var ho = Object.getOwnPropertyDescriptor, go = (i, t, e, n) => {
2867
+ for (var r = n > 1 ? void 0 : n ? ho(t, e) : t, s = i.length - 1, o; s >= 0; s--)
2553
2868
  (o = i[s]) && (r = o(r) || r);
2554
2869
  return r;
2555
- }, me = (i, t) => (e, n) => t(e, n, i);
2556
- const ks = [
2557
- Ln.id,
2558
- Vn.id,
2559
- Hn.id,
2560
- zn.id,
2561
- Kn.id,
2562
- Jn.id,
2563
- Zn.id,
2564
- qn.id,
2565
- Jt.id,
2566
- Zt.id,
2567
- Qn.id,
2568
- er.id,
2569
- tr.id,
2570
- nr.id,
2571
- rr.id,
2572
- ir.id,
2573
- sr.id,
2574
- or.id,
2575
- ar.id
2576
- ], Ws = [
2577
- pi.id,
2578
- wi.id,
2579
- _i.id,
2580
- Si.id,
2581
- vi.id,
2582
- Ii.id
2870
+ }, _e = (i, t) => (e, n) => t(e, n, i);
2871
+ const fo = [
2872
+ gr.id,
2873
+ fr.id,
2874
+ mr.id,
2875
+ pr.id,
2876
+ wr.id,
2877
+ _r.id,
2878
+ Sr.id,
2879
+ vr.id,
2880
+ mn.id,
2881
+ pn.id,
2882
+ Ir.id,
2883
+ Cr.id,
2884
+ Rr.id,
2885
+ Dr.id,
2886
+ br.id,
2887
+ Mr.id,
2888
+ yr.id,
2889
+ Er.id,
2890
+ Tr.id
2891
+ ], mo = [
2892
+ Vi.id,
2893
+ Hi.id,
2894
+ Yi.id,
2895
+ Gi.id,
2896
+ Xi.id,
2897
+ zi.id
2583
2898
  ];
2584
- let rn = class extends re {
2899
+ let Rn = class extends ee {
2585
2900
  constructor(i, t, e, n, r, s, o, a, d) {
2586
2901
  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 = d, this._sheetInterceptorListener(), this._commandListener(), this._sheetRefreshListener();
2587
2902
  }
@@ -2590,57 +2905,57 @@ let rn = class extends re {
2590
2905
  this._sheetInterceptorService.interceptAfterCommand({
2591
2906
  /* eslint-disable-next-line complexity */
2592
2907
  getMutations: (i) => {
2593
- if (!ks.includes(i.id))
2908
+ if (!fo.includes(i.id))
2594
2909
  return { redos: [], undos: [] };
2595
2910
  if (i.params == null)
2596
2911
  return { redos: [], undos: [] };
2597
2912
  const t = i.id;
2598
- if (t === Ln.id)
2913
+ if (t === gr.id)
2599
2914
  return this._moveRowInterceptor(i.params, "insert");
2600
- if ([sr.id, or.id, ar.id].includes(t))
2915
+ if ([yr.id, Er.id, Tr.id].includes(t))
2601
2916
  return this._moveRangeInterceptor(i.params);
2602
- if (t === Vn.id)
2917
+ if (t === fr.id)
2603
2918
  return this._moveColInterceptor(i.params, "insert");
2604
- if (t === Hn.id)
2919
+ if (t === mr.id)
2605
2920
  return this._moveRowInterceptor(i.params, "remove");
2606
- if (t === zn.id)
2921
+ if (t === pr.id)
2607
2922
  return this._moveColInterceptor(i.params, "remove");
2608
- if (t === Kn.id) {
2923
+ if (t === wr.id) {
2609
2924
  const { range: e } = i.params;
2610
2925
  return this._getRangeMoveUndo(
2611
2926
  e,
2612
2927
  0
2613
2928
  /* deleteLeft */
2614
2929
  );
2615
- } else if (t === Jn.id) {
2930
+ } else if (t === _r.id) {
2616
2931
  const { range: e } = i.params;
2617
2932
  return this._getRangeMoveUndo(
2618
2933
  e,
2619
2934
  1
2620
2935
  /* deleteUp */
2621
2936
  );
2622
- } else if (t === Zn.id) {
2937
+ } else if (t === Sr.id) {
2623
2938
  const { range: e } = i.params;
2624
2939
  return this._getRangeMoveUndo(
2625
2940
  e,
2626
2941
  2
2627
2942
  /* insertDown */
2628
2943
  );
2629
- } else if (t === qn.id) {
2944
+ } else if (t === vr.id) {
2630
2945
  const { range: e } = i.params;
2631
2946
  return this._getRangeMoveUndo(
2632
2947
  e,
2633
2948
  3
2634
2949
  /* insertRight */
2635
2950
  );
2636
- } else if (t === tr.id || t === nr.id) {
2951
+ } else if (t === Rr.id || t === Dr.id) {
2637
2952
  const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e;
2638
2953
  return this._getDrawingUndoForRowVisible(n, r, s);
2639
- } else if (t === rr.id || t === ir.id) {
2954
+ } else if (t === br.id || t === Mr.id) {
2640
2955
  const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e;
2641
2956
  return this._getDrawingUndoForColVisible(n, r, s);
2642
- } else if (t === Jt.id || t === Zt.id || t === Qn.id || t === er.id) {
2643
- const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e, o = t === Jt.id || t === Zt.id;
2957
+ } else if (t === mn.id || t === pn.id || t === Ir.id || t === Cr.id) {
2958
+ const e = i.params, { unitId: n, subUnitId: r, ranges: s } = e, o = t === mn.id || t === pn.id;
2644
2959
  return this._getDrawingUndoForRowAndColSize(n, r, s, o);
2645
2960
  }
2646
2961
  return { redos: [], undos: [] };
@@ -2649,7 +2964,7 @@ let rn = class extends re {
2649
2964
  );
2650
2965
  }
2651
2966
  _getRangeMoveUndo(i, t) {
2652
- const e = oe(this._univerInstanceService);
2967
+ const e = ae(this._univerInstanceService);
2653
2968
  if (e == null)
2654
2969
  return { redos: [], undos: [] };
2655
2970
  const n = e.unitId, r = e.subUnitId, s = [], o = [], a = this._sheetDrawingService.getDrawingData(n, r), d = [], u = [];
@@ -2666,49 +2981,49 @@ let rn = class extends re {
2666
2981
  const c = this._sheetDrawingService.getBatchRemoveOp(u), l = c.undo, g = c.redo, h = c.objects;
2667
2982
  s.push({ id: P.id, params: { unitId: n, subUnitId: r, op: g, objects: h, type: U.REMOVE } }), o.push({ id: P.id, params: { unitId: n, subUnitId: r, op: l, objects: h, type: U.INSERT } });
2668
2983
  }
2669
- return s.push({ id: Y.id, params: [n] }), o.push({ id: Y.id, params: [n] }), {
2984
+ return s.push({ id: V.id, params: [n] }), o.push({ id: V.id, params: [n] }), {
2670
2985
  redos: s,
2671
2986
  undos: o
2672
2987
  };
2673
2988
  }
2674
2989
  _getUpdateOrDeleteDrawings(i, t, e) {
2675
- const n = [], r = [], { sheetTransform: s, anchorType: o = O.Position, transform: a, unitId: d, subUnitId: u, drawingId: c } = e, { from: l, to: g } = s, { row: h, column: f } = l, { row: p, column: m } = g;
2990
+ const n = [], r = [], { sheetTransform: s, anchorType: o = O.Position, transform: a, unitId: d, subUnitId: u, drawingId: c } = e, { from: l, to: g } = s, { row: h, column: f } = l, { row: m, column: p } = g;
2676
2991
  if (s == null || a == null)
2677
2992
  return {
2678
2993
  updateDrawings: n,
2679
2994
  deleteDrawings: r
2680
2995
  };
2681
- const { startRow: _, endRow: v, startColumn: I, endColumn: R } = i;
2682
- let S = null, C = null;
2683
- if (t === 0 && h >= _ && p <= v)
2684
- if (f >= I && m <= R)
2996
+ const { startRow: w, endRow: S, startColumn: I, endColumn: D } = i;
2997
+ let v = null, C = null;
2998
+ if (t === 0 && h >= w && m <= S)
2999
+ if (f >= I && p <= D)
2685
3000
  r.push({ unitId: d, subUnitId: u, drawingId: c });
2686
3001
  else {
2687
- const w = this._shrinkCol(s, a, I, R, o);
2688
- S = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
3002
+ const _ = this._shrinkCol(s, a, I, D, o);
3003
+ v = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
2689
3004
  }
2690
- else if (t === 1 && f >= I && m <= R)
2691
- if (h >= _ && p <= v)
3005
+ else if (t === 1 && f >= I && p <= D)
3006
+ if (h >= w && m <= S)
2692
3007
  r.push({ unitId: d, subUnitId: u, drawingId: c });
2693
3008
  else {
2694
- const w = this._shrinkRow(s, a, _, v, o);
2695
- S = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
3009
+ const _ = this._shrinkRow(s, a, w, S, o);
3010
+ v = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
2696
3011
  }
2697
3012
  else if (t === 2) {
2698
- const w = this._expandRow(s, a, _, v, o);
2699
- S = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
3013
+ const _ = this._expandRow(s, a, w, S, o);
3014
+ v = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
2700
3015
  } else if (t === 3) {
2701
- const w = this._expandCol(s, a, I, R, o);
2702
- S = w == null ? void 0 : w.newSheetTransform, C = w == null ? void 0 : w.newTransform;
3016
+ const _ = this._expandCol(s, a, I, D, o);
3017
+ v = _ == null ? void 0 : _.newSheetTransform, C = _ == null ? void 0 : _.newTransform;
2703
3018
  }
2704
- if (S != null && C != null) {
2705
- const w = K(S, this._selectionRenderService, this._skeletonManagerService);
2706
- n.push({ ...e, sheetTransform: S, transform: w });
3019
+ if (v != null && C != null) {
3020
+ const _ = Z(v, this._selectionRenderService, this._skeletonManagerService);
3021
+ n.push({ ...e, sheetTransform: v, transform: _ });
2707
3022
  }
2708
3023
  return { updateDrawings: n, deleteDrawings: r };
2709
3024
  }
2710
3025
  _remainDrawingSize(i, t, e) {
2711
- const n = $({ ...i }, this._selectionRenderService);
3026
+ const n = j({ ...i }, this._selectionRenderService);
2712
3027
  n != null && t.push({
2713
3028
  ...e,
2714
3029
  sheetTransform: n
@@ -2722,31 +3037,31 @@ let rn = class extends re {
2722
3037
  if (f === O.None)
2723
3038
  this._remainDrawingSize(h, r, l);
2724
3039
  else {
2725
- const { from: p, to: m } = g, { row: _, column: v } = p, { row: I, column: R } = m;
2726
- for (let S = 0; S < e.length; S++) {
2727
- const C = e[S], { startRow: w, endRow: y, startColumn: D, endColumn: T } = C;
2728
- if (R < D)
3040
+ const { from: m, to: p } = g, { row: w, column: S } = m, { row: I, column: D } = p;
3041
+ for (let v = 0; v < e.length; v++) {
3042
+ const C = e[v], { startRow: _, endRow: y, startColumn: R, endColumn: E } = C;
3043
+ if (D < R)
2729
3044
  continue;
2730
3045
  if (f === O.Position) {
2731
3046
  let b = null, N = null;
2732
- if (v >= D && v <= T) {
2733
- const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: v, endColumn: T, startRow: p.row, endRow: m.row });
2734
- if (x == null)
3047
+ if (S >= R && S <= E) {
3048
+ const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: E, startRow: m.row, endRow: p.row });
3049
+ if (F == null)
2735
3050
  return;
2736
- N = { ...h, left: x.startX };
3051
+ N = { ...h, left: F.startX };
2737
3052
  }
2738
- if (N != null && (b = $(N, this._selectionRenderService), b != null && N != null)) {
3053
+ if (N != null && (b = j(N, this._selectionRenderService), b != null && N != null)) {
2739
3054
  r.push({ ...l, sheetTransform: b, transform: N });
2740
3055
  break;
2741
3056
  }
2742
3057
  this._remainDrawingSize(h, r, l);
2743
3058
  continue;
2744
3059
  }
2745
- if (v >= D && R <= T)
3060
+ if (S >= R && D <= E)
2746
3061
  continue;
2747
- let E = null, M = null;
2748
- if (v >= D && v <= T) {
2749
- const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: v, endColumn: T, startRow: p.row, endRow: m.row });
3062
+ let T = null, M = null;
3063
+ if (S >= R && S <= E) {
3064
+ const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: E, startRow: m.row, endRow: p.row });
2750
3065
  if (b == null)
2751
3066
  return;
2752
3067
  M = {
@@ -2754,8 +3069,8 @@ let rn = class extends re {
2754
3069
  left: (b == null ? void 0 : b.startX) || 0,
2755
3070
  width: ((h == null ? void 0 : h.width) || 0) - b.endX + b.startX
2756
3071
  };
2757
- } else if (R >= D && R <= T) {
2758
- const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: R, startRow: p.row, endRow: m.row });
3072
+ } else if (D >= R && D <= E) {
3073
+ const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: R, endColumn: D, startRow: m.row, endRow: p.row });
2759
3074
  if (b == null)
2760
3075
  return;
2761
3076
  M = {
@@ -2763,19 +3078,19 @@ let rn = class extends re {
2763
3078
  left: b.startX - ((h == null ? void 0 : h.width) || 0)
2764
3079
  };
2765
3080
  } else {
2766
- const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: D, endColumn: T, startRow: p.row, endRow: m.row });
3081
+ const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: R, endColumn: E, startRow: m.row, endRow: p.row });
2767
3082
  if (b == null)
2768
3083
  return;
2769
3084
  if (M = {
2770
3085
  ...h,
2771
3086
  width: ((h == null ? void 0 : h.width) || 0) - b.endX + b.startX
2772
- }, E = $(M, this._selectionRenderService), E != null && M != null) {
2773
- s.push({ ...l, sheetTransform: E, transform: M });
3087
+ }, T = j(M, this._selectionRenderService), T != null && M != null) {
3088
+ s.push({ ...l, sheetTransform: T, transform: M });
2774
3089
  break;
2775
3090
  }
2776
3091
  }
2777
- if (M != null && (E = $(M, this._selectionRenderService)), M != null && E != null) {
2778
- r.push({ ...l, sheetTransform: E, transform: M });
3092
+ if (M != null && (T = j(M, this._selectionRenderService)), M != null && T != null) {
3093
+ r.push({ ...l, sheetTransform: T, transform: M });
2779
3094
  break;
2780
3095
  } else
2781
3096
  this._remainDrawingSize(h, r, l);
@@ -2798,10 +3113,10 @@ let rn = class extends re {
2798
3113
  _createUndoAndRedoMutation(i, t, e) {
2799
3114
  const n = this._sheetDrawingService.getBatchUpdateOp(e), { undo: r, redo: s, objects: o } = n, a = [
2800
3115
  { id: P.id, params: { unitId: i, subUnitId: t, op: s, objects: o, type: U.UPDATE } },
2801
- { id: Y.id, params: [i] }
3116
+ { id: V.id, params: [i] }
2802
3117
  ], d = [
2803
3118
  { id: P.id, params: { unitId: i, subUnitId: t, op: r, objects: o, type: U.UPDATE } },
2804
- { id: Y.id, params: [i] }
3119
+ { id: V.id, params: [i] }
2805
3120
  ];
2806
3121
  return {
2807
3122
  redos: a,
@@ -2816,31 +3131,31 @@ let rn = class extends re {
2816
3131
  if (f === O.None)
2817
3132
  this._remainDrawingSize(h, r, l);
2818
3133
  else {
2819
- const { from: p, to: m } = g, { row: _, column: v } = p, { row: I, column: R } = m;
2820
- for (let S = 0; S < e.length; S++) {
2821
- const C = e[S], { startRow: w, endRow: y, startColumn: D, endColumn: T } = C;
2822
- if (I < w)
3134
+ const { from: m, to: p } = g, { row: w, column: S } = m, { row: I, column: D } = p;
3135
+ for (let v = 0; v < e.length; v++) {
3136
+ const C = e[v], { startRow: _, endRow: y, startColumn: R, endColumn: E } = C;
3137
+ if (I < _)
2823
3138
  continue;
2824
3139
  if (f === O.Position) {
2825
3140
  let b = null, N = null;
2826
- if (_ >= w && _ <= y) {
2827
- const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: _, endRow: y });
2828
- if (x == null)
3141
+ if (w >= _ && w <= y) {
3142
+ const F = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: w, endRow: y });
3143
+ if (F == null)
2829
3144
  return;
2830
- N = { ...h, top: x.startY };
3145
+ N = { ...h, top: F.startY };
2831
3146
  }
2832
- if (N != null && (b = $(N, this._selectionRenderService), b != null && N != null)) {
3147
+ if (N != null && (b = j(N, this._selectionRenderService), b != null && N != null)) {
2833
3148
  r.push({ ...l, sheetTransform: b, transform: N });
2834
3149
  break;
2835
3150
  }
2836
3151
  this._remainDrawingSize(h, r, l);
2837
3152
  continue;
2838
3153
  }
2839
- if (_ >= w && I <= y)
3154
+ if (w >= _ && I <= y)
2840
3155
  continue;
2841
- let E = null, M = null;
2842
- if (_ >= w && _ <= y) {
2843
- const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: _, endRow: y });
3156
+ let T = null, M = null;
3157
+ if (w >= _ && w <= y) {
3158
+ const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: w, endRow: y });
2844
3159
  if (b == null)
2845
3160
  return;
2846
3161
  M = {
@@ -2848,8 +3163,8 @@ let rn = class extends re {
2848
3163
  top: (b == null ? void 0 : b.startY) || 0,
2849
3164
  height: ((h == null ? void 0 : h.height) || 0) - b.endY + b.startY
2850
3165
  };
2851
- } else if (I >= w && I <= y) {
2852
- const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: w, endRow: I });
3166
+ } else if (I >= _ && I <= y) {
3167
+ const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: _, endRow: I });
2853
3168
  if (b == null)
2854
3169
  return;
2855
3170
  M = {
@@ -2857,19 +3172,19 @@ let rn = class extends re {
2857
3172
  top: b.startY - ((h == null ? void 0 : h.height) || 0)
2858
3173
  };
2859
3174
  } else {
2860
- const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: m.column, startRow: w, endRow: y });
3175
+ const b = this._skeletonManagerService.attachRangeWithCoord({ startColumn: m.column, endColumn: p.column, startRow: _, endRow: y });
2861
3176
  if (b == null)
2862
3177
  return;
2863
3178
  if (M = {
2864
3179
  ...h,
2865
3180
  height: ((h == null ? void 0 : h.height) || 0) - b.endY + b.startY
2866
- }, E = $(M, this._selectionRenderService), E != null && M != null) {
2867
- s.push({ ...l, sheetTransform: E, transform: M });
3181
+ }, T = j(M, this._selectionRenderService), T != null && M != null) {
3182
+ s.push({ ...l, sheetTransform: T, transform: M });
2868
3183
  break;
2869
3184
  }
2870
3185
  }
2871
- if (M != null && (E = $(M, this._selectionRenderService)), M != null && E != null) {
2872
- r.push({ ...l, sheetTransform: E, transform: M });
3186
+ if (M != null && (T = j(M, this._selectionRenderService)), M != null && T != null) {
3187
+ r.push({ ...l, sheetTransform: T, transform: M });
2873
3188
  break;
2874
3189
  } else
2875
3190
  this._remainDrawingSize(h, r, l);
@@ -2896,20 +3211,20 @@ let rn = class extends re {
2896
3211
  if (c === O.None)
2897
3212
  this._remainDrawingSize(u, s, a);
2898
3213
  else {
2899
- const { from: l, to: g } = d, { row: h, column: f } = l, { row: p, column: m } = g;
2900
- for (let _ = 0; _ < e.length; _++) {
2901
- const v = e[_], { startRow: I, endRow: R, startColumn: S, endColumn: C } = v;
2902
- if (p < I || m < S)
3214
+ const { from: l, to: g } = d, { row: h, column: f } = l, { row: m, column: p } = g;
3215
+ for (let w = 0; w < e.length; w++) {
3216
+ const S = e[w], { startRow: I, endRow: D, startColumn: v, endColumn: C } = S;
3217
+ if (m < I || p < v)
2903
3218
  continue;
2904
- if (c === O.Position && (h <= I && p >= R || f <= S && m >= C)) {
3219
+ if (c === O.Position && (h <= I && m >= D || f <= v && p >= C)) {
2905
3220
  this._remainDrawingSize(u, s, a);
2906
3221
  continue;
2907
3222
  }
2908
- const w = K({ ...d }, this._selectionRenderService, this._skeletonManagerService);
2909
- if (w != null) {
3223
+ const _ = Z({ ...d }, this._selectionRenderService, this._skeletonManagerService);
3224
+ if (_ != null) {
2910
3225
  s.push({
2911
3226
  ...a,
2912
- transform: w
3227
+ transform: _
2913
3228
  });
2914
3229
  break;
2915
3230
  }
@@ -2922,7 +3237,7 @@ let rn = class extends re {
2922
3237
  if (t === "insert")
2923
3238
  e = i.unitId, n = i.subUnitId;
2924
3239
  else {
2925
- const r = oe(this._univerInstanceService);
3240
+ const r = ae(this._univerInstanceService);
2926
3241
  if (r == null)
2927
3242
  return;
2928
3243
  e = r.unitId, n = r.subUnitId;
@@ -2930,50 +3245,50 @@ let rn = class extends re {
2930
3245
  return { unitId: e, subUnitId: n };
2931
3246
  }
2932
3247
  _moveRangeInterceptor(i) {
2933
- var I, R;
2934
- const { toRange: t, fromRange: e } = i, n = oe(this._univerInstanceService);
3248
+ var I, D;
3249
+ const { toRange: t, fromRange: e } = i, n = ae(this._univerInstanceService);
2935
3250
  if (!n)
2936
3251
  return { redos: [], undos: [] };
2937
- const { unitId: r, subUnitId: s } = n, o = (R = (I = this._renderManagerService.getRenderById(r)) == null ? void 0 : I.with(V)) == null ? void 0 : R.getCurrentSkeleton();
3252
+ const { unitId: r, subUnitId: s } = n, o = (D = (I = this._renderManagerService.getRenderById(r)) == null ? void 0 : I.with(X)) == null ? void 0 : D.getCurrentSkeleton();
2938
3253
  if (!o)
2939
3254
  return { redos: [], undos: [] };
2940
- const a = Yn(o, e);
3255
+ const a = dr(o, e);
2941
3256
  if (!a)
2942
3257
  return { redos: [], undos: [] };
2943
3258
  const { startX: d, endX: u, startY: c, endY: l } = a, g = this._sheetDrawingService.getDrawingData(r, s), h = [];
2944
- Object.keys(g).forEach((S) => {
2945
- const C = g[S];
3259
+ Object.keys(g).forEach((v) => {
3260
+ const C = g[v];
2946
3261
  if (C.anchorType !== O.Both)
2947
3262
  return;
2948
- const { transform: w } = C;
2949
- if (!w)
3263
+ const { transform: _ } = C;
3264
+ if (!_)
2950
3265
  return;
2951
- const { left: y = 0, top: D = 0, width: T = 0, height: E = 0 } = w, { drawingStartX: M, drawingEndX: b, drawingStartY: N, drawingEndY: x } = {
3266
+ const { left: y = 0, top: R = 0, width: E = 0, height: T = 0 } = _, { drawingStartX: M, drawingEndX: b, drawingStartY: N, drawingEndY: F } = {
2952
3267
  drawingStartX: y,
2953
- drawingEndX: y + T,
2954
- drawingStartY: D,
2955
- drawingEndY: D + E
3268
+ drawingEndX: y + E,
3269
+ drawingStartY: R,
3270
+ drawingEndY: R + T
2956
3271
  };
2957
- d <= M && b <= u && c <= N && x <= l && h.push(C);
3272
+ d <= M && b <= u && c <= N && F <= l && h.push(C);
2958
3273
  });
2959
- const f = [], p = [], m = t.startRow - e.startRow, _ = t.startColumn - e.startColumn, v = h.map((S) => {
2960
- const C = S.sheetTransform, w = {
2961
- to: { ...C.to, row: C.to.row + m, column: C.to.column + _ },
2962
- from: { ...C.from, row: C.from.row + m, column: C.from.column + _ }
2963
- }, y = K(w, this._selectionRenderService, this._skeletonManagerService);
3274
+ const f = [], m = [], p = t.startRow - e.startRow, w = t.startColumn - e.startColumn, S = h.map((v) => {
3275
+ const C = v.sheetTransform, _ = {
3276
+ to: { ...C.to, row: C.to.row + p, column: C.to.column + w },
3277
+ from: { ...C.from, row: C.from.row + p, column: C.from.column + w }
3278
+ }, y = Z(_, this._selectionRenderService, this._skeletonManagerService);
2964
3279
  return {
2965
3280
  unitId: r,
2966
3281
  subUnitId: s,
2967
- drawingId: S.drawingId,
3282
+ drawingId: v.drawingId,
2968
3283
  transform: y,
2969
- sheetTransform: w
3284
+ sheetTransform: _
2970
3285
  };
2971
3286
  });
2972
- if (v.length) {
2973
- const S = this._sheetDrawingService.getBatchUpdateOp(v), { undo: C, redo: w, objects: y } = S;
2974
- f.push({ id: P.id, params: { unitId: r, subUnitId: s, op: w, objects: y, type: U.UPDATE } }), p.push({ id: P.id, params: { unitId: r, subUnitId: s, op: C, objects: y, type: U.UPDATE } });
3287
+ if (S.length) {
3288
+ const v = this._sheetDrawingService.getBatchUpdateOp(S), { undo: C, redo: _, objects: y } = v;
3289
+ f.push({ id: P.id, params: { unitId: r, subUnitId: s, op: _, objects: y, type: U.UPDATE } }), m.push({ id: P.id, params: { unitId: r, subUnitId: s, op: C, objects: y, type: U.UPDATE } });
2975
3290
  }
2976
- return { redos: f, undos: p };
3291
+ return { redos: f, undos: m };
2977
3292
  }
2978
3293
  _moveRowInterceptor(i, t) {
2979
3294
  const e = this._getUnitIdAndSubUnitId(i, t);
@@ -2981,37 +3296,37 @@ let rn = class extends re {
2981
3296
  return { redos: [], undos: [] };
2982
3297
  const { unitId: n, subUnitId: r } = e, { range: s } = i, o = s.startRow, a = s.endRow, d = [], u = [], c = this._sheetDrawingService.getDrawingData(n, r), l = [], g = [];
2983
3298
  if (Object.keys(c).forEach((h) => {
2984
- const f = c[h], { sheetTransform: p, transform: m, anchorType: _ = O.Position } = f;
2985
- if (p == null || m == null)
3299
+ const f = c[h], { sheetTransform: m, transform: p, anchorType: w = O.Position } = f;
3300
+ if (m == null || p == null)
2986
3301
  return;
2987
- let v, I;
3302
+ let S, I;
2988
3303
  if (t === "insert") {
2989
- const S = this._expandRow(p, m, o, a, _);
2990
- v = S == null ? void 0 : S.newSheetTransform, I = S == null ? void 0 : S.newTransform;
3304
+ const v = this._expandRow(m, p, o, a, w);
3305
+ S = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
2991
3306
  } else {
2992
- const { from: S, to: C } = p, { row: w } = S, { row: y } = C;
2993
- if (_ === O.Both && w >= o && y <= a)
3307
+ const { from: v, to: C } = m, { row: _ } = v, { row: y } = C;
3308
+ if (w === O.Both && _ >= o && y <= a)
2994
3309
  g.push({ unitId: n, subUnitId: r, drawingId: h });
2995
3310
  else {
2996
- const D = this._shrinkRow(p, m, o, a, _);
2997
- v = D == null ? void 0 : D.newSheetTransform, I = D == null ? void 0 : D.newTransform;
3311
+ const R = this._shrinkRow(m, p, o, a, w);
3312
+ S = R == null ? void 0 : R.newSheetTransform, I = R == null ? void 0 : R.newTransform;
2998
3313
  }
2999
3314
  }
3000
- if (!v || !I)
3315
+ if (!S || !I)
3001
3316
  return;
3002
- const R = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: v };
3003
- l.push(R);
3317
+ const D = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: S };
3318
+ l.push(D);
3004
3319
  }), l.length === 0 && g.length === 0)
3005
3320
  return { redos: [], undos: [] };
3006
3321
  if (l.length > 0) {
3007
- const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: f, redo: p, objects: m } = h;
3008
- d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.UPDATE } });
3322
+ const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: f, redo: m, objects: p } = h;
3323
+ d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: p, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: p, type: U.UPDATE } });
3009
3324
  }
3010
3325
  if (g.length > 0) {
3011
- const h = this._sheetDrawingService.getBatchRemoveOp(g), f = h.undo, p = h.redo, m = h.objects;
3012
- d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.INSERT } });
3326
+ const h = this._sheetDrawingService.getBatchRemoveOp(g), f = h.undo, m = h.redo, p = h.objects;
3327
+ d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: p, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: p, type: U.INSERT } });
3013
3328
  }
3014
- return d.push({ id: Y.id, params: [n] }), u.push({ id: Y.id, params: [n] }), {
3329
+ return d.push({ id: V.id, params: [n] }), u.push({ id: V.id, params: [n] }), {
3015
3330
  redos: d,
3016
3331
  undos: u
3017
3332
  };
@@ -3022,43 +3337,43 @@ let rn = class extends re {
3022
3337
  return { redos: [], undos: [] };
3023
3338
  const { unitId: n, subUnitId: r } = e, { range: s } = i, o = s.startColumn, a = s.endColumn, d = [], u = [], c = this._sheetDrawingService.getDrawingData(n, r), l = [], g = [];
3024
3339
  if (Object.keys(c).forEach((h) => {
3025
- const f = c[h], { sheetTransform: p, transform: m, anchorType: _ = O.Position } = f;
3026
- if (p == null || m == null)
3340
+ const f = c[h], { sheetTransform: m, transform: p, anchorType: w = O.Position } = f;
3341
+ if (m == null || p == null)
3027
3342
  return;
3028
- let v, I;
3343
+ let S, I;
3029
3344
  if (t === "insert") {
3030
- const S = this._expandCol(p, m, o, a, _);
3031
- v = S == null ? void 0 : S.newSheetTransform, I = S == null ? void 0 : S.newTransform;
3345
+ const v = this._expandCol(m, p, o, a, w);
3346
+ S = v == null ? void 0 : v.newSheetTransform, I = v == null ? void 0 : v.newTransform;
3032
3347
  } else {
3033
- const { from: S, to: C } = p, { column: w } = S, { column: y } = C;
3034
- if (_ === O.Both && w >= o && y <= a)
3348
+ const { from: v, to: C } = m, { column: _ } = v, { column: y } = C;
3349
+ if (w === O.Both && _ >= o && y <= a)
3035
3350
  g.push({ unitId: n, subUnitId: r, drawingId: h });
3036
3351
  else {
3037
- const D = this._shrinkCol(p, m, o, a, _);
3038
- v = D == null ? void 0 : D.newSheetTransform, I = D == null ? void 0 : D.newTransform;
3352
+ const R = this._shrinkCol(m, p, o, a, w);
3353
+ S = R == null ? void 0 : R.newSheetTransform, I = R == null ? void 0 : R.newTransform;
3039
3354
  }
3040
3355
  }
3041
- if (!v || !I)
3356
+ if (!S || !I)
3042
3357
  return;
3043
- const R = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: v };
3044
- l.push(R);
3358
+ const D = { unitId: n, subUnitId: r, drawingId: h, transform: I, sheetTransform: S };
3359
+ l.push(D);
3045
3360
  }), l.length === 0 && g.length === 0)
3046
3361
  return { redos: [], undos: [] };
3047
3362
  if (l.length > 0) {
3048
- const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: f, redo: p, objects: m } = h;
3049
- d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.UPDATE } });
3363
+ const h = this._sheetDrawingService.getBatchUpdateOp(l), { undo: f, redo: m, objects: p } = h;
3364
+ d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: p, type: U.UPDATE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: p, type: U.UPDATE } });
3050
3365
  }
3051
3366
  if (g.length > 0) {
3052
- const h = this._sheetDrawingService.getBatchRemoveOp(g), f = h.undo, p = h.redo, m = h.objects;
3053
- d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: p, objects: m, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: m, type: U.INSERT } });
3367
+ const h = this._sheetDrawingService.getBatchRemoveOp(g), f = h.undo, m = h.redo, p = h.objects;
3368
+ d.push({ id: P.id, params: { unitId: n, subUnitId: r, op: m, objects: p, type: U.REMOVE } }), u.push({ id: P.id, params: { unitId: n, subUnitId: r, op: f, objects: p, type: U.INSERT } });
3054
3369
  }
3055
- return d.push({ id: Y.id, params: [n] }), u.push({ id: Y.id, params: [n] }), { redos: d, undos: u };
3370
+ return d.push({ id: V.id, params: [n] }), u.push({ id: V.id, params: [n] }), { redos: d, undos: u };
3056
3371
  }
3057
3372
  _expandCol(i, t, e, n, r = O.Position) {
3058
3373
  const s = n - e + 1, { from: o, to: a } = i, { column: d } = o, { column: u } = a;
3059
3374
  if (r === O.None)
3060
3375
  return {
3061
- newSheetTransform: $({ ...t }, this._selectionRenderService),
3376
+ newSheetTransform: j({ ...t }, this._selectionRenderService),
3062
3377
  newTransform: t
3063
3378
  };
3064
3379
  let c = null, l = null;
@@ -3066,16 +3381,16 @@ let rn = class extends re {
3066
3381
  const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: e, endColumn: n, startRow: o.row, endRow: a.row });
3067
3382
  if (g == null)
3068
3383
  return;
3069
- l = { ...t, left: (t.left || 0) + g.endX - g.startX }, c = $(l, this._selectionRenderService);
3384
+ l = { ...t, left: (t.left || 0) + g.endX - g.startX }, c = j(l, this._selectionRenderService);
3070
3385
  } else if (u >= n)
3071
3386
  if (r === O.Both)
3072
3387
  c = {
3073
3388
  from: { ...o },
3074
3389
  to: { ...a, column: u + s }
3075
- }, l = K(c, this._selectionRenderService, this._skeletonManagerService);
3390
+ }, l = Z(c, this._selectionRenderService, this._skeletonManagerService);
3076
3391
  else
3077
3392
  return {
3078
- newSheetTransform: $({ ...t }, this._selectionRenderService),
3393
+ newSheetTransform: j({ ...t }, this._selectionRenderService),
3079
3394
  newTransform: t
3080
3395
  };
3081
3396
  return c != null && l != null ? {
@@ -3087,7 +3402,7 @@ let rn = class extends re {
3087
3402
  const s = n - e + 1, { from: o, to: a } = i, { column: d } = o, { column: u } = a;
3088
3403
  if (r === O.None)
3089
3404
  return {
3090
- newSheetTransform: $({ ...t }, this._selectionRenderService),
3405
+ newSheetTransform: j({ ...t }, this._selectionRenderService),
3091
3406
  newTransform: t
3092
3407
  };
3093
3408
  let c = null, l = null;
@@ -3095,7 +3410,7 @@ let rn = class extends re {
3095
3410
  c = {
3096
3411
  from: { ...o, column: d - s },
3097
3412
  to: { ...a, column: u - s }
3098
- }, l = K(c, this._selectionRenderService, this._skeletonManagerService);
3413
+ }, l = Z(c, this._selectionRenderService, this._skeletonManagerService);
3099
3414
  else {
3100
3415
  if (d >= e && u <= n)
3101
3416
  return null;
@@ -3104,10 +3419,10 @@ let rn = class extends re {
3104
3419
  c = {
3105
3420
  from: { ...o },
3106
3421
  to: { ...a, column: u - s }
3107
- }, l = K(c, this._selectionRenderService, this._skeletonManagerService);
3422
+ }, l = Z(c, this._selectionRenderService, this._skeletonManagerService);
3108
3423
  else
3109
3424
  return {
3110
- newSheetTransform: $({ ...t }, this._selectionRenderService),
3425
+ newSheetTransform: j({ ...t }, this._selectionRenderService),
3111
3426
  newTransform: t
3112
3427
  };
3113
3428
  else if (d >= e && d <= n) {
@@ -3119,7 +3434,7 @@ let rn = class extends re {
3119
3434
  return;
3120
3435
  l = { ...t, left: (t.left || 0) - g.endX + g.startX - i.from.columnOffset };
3121
3436
  }
3122
- c = $(l, this._selectionRenderService);
3437
+ c = j(l, this._selectionRenderService);
3123
3438
  } else if (u >= e && u <= n && r === O.Both) {
3124
3439
  const g = this._skeletonManagerService.attachRangeWithCoord({
3125
3440
  startColumn: e - 1,
@@ -3132,7 +3447,7 @@ let rn = class extends re {
3132
3447
  c = {
3133
3448
  from: { ...o },
3134
3449
  to: { ...a, column: e - 1, columnOffset: g.endX - g.startX }
3135
- }, l = K(c, this._selectionRenderService, this._skeletonManagerService);
3450
+ }, l = Z(c, this._selectionRenderService, this._skeletonManagerService);
3136
3451
  }
3137
3452
  }
3138
3453
  return c != null && l != null ? {
@@ -3144,7 +3459,7 @@ let rn = class extends re {
3144
3459
  const s = n - e + 1, { from: o, to: a } = i, { row: d } = o, { row: u } = a;
3145
3460
  if (r === O.None)
3146
3461
  return {
3147
- newSheetTransform: $({ ...t }, this._selectionRenderService),
3462
+ newSheetTransform: j({ ...t }, this._selectionRenderService),
3148
3463
  newTransform: t
3149
3464
  };
3150
3465
  let c = null, l = null;
@@ -3152,7 +3467,7 @@ let rn = class extends re {
3152
3467
  const g = this._skeletonManagerService.attachRangeWithCoord({ startRow: e, endRow: n, startColumn: o.column, endColumn: a.column });
3153
3468
  if (g == null)
3154
3469
  return;
3155
- l = { ...t, top: (t.top || 0) + g.endY - g.startY }, c = $(l, this._selectionRenderService);
3470
+ l = { ...t, top: (t.top || 0) + g.endY - g.startY }, c = j(l, this._selectionRenderService);
3156
3471
  } else if (u >= n)
3157
3472
  if (r === O.Both)
3158
3473
  c = {
@@ -3161,10 +3476,10 @@ let rn = class extends re {
3161
3476
  ...a,
3162
3477
  row: u + s
3163
3478
  }
3164
- }, l = K(c, this._selectionRenderService, this._skeletonManagerService);
3479
+ }, l = Z(c, this._selectionRenderService, this._skeletonManagerService);
3165
3480
  else
3166
3481
  return {
3167
- newSheetTransform: $({ ...t }, this._selectionRenderService),
3482
+ newSheetTransform: j({ ...t }, this._selectionRenderService),
3168
3483
  newTransform: t
3169
3484
  };
3170
3485
  return c != null && l != null ? {
@@ -3176,7 +3491,7 @@ let rn = class extends re {
3176
3491
  const s = n - e + 1, { from: o, to: a } = i, { row: d } = o, { row: u } = a;
3177
3492
  if (r === O.None)
3178
3493
  return {
3179
- newSheetTransform: $({ ...t }, this._selectionRenderService),
3494
+ newSheetTransform: j({ ...t }, this._selectionRenderService),
3180
3495
  newTransform: t
3181
3496
  };
3182
3497
  let c = null, l = null;
@@ -3184,7 +3499,7 @@ let rn = class extends re {
3184
3499
  c = {
3185
3500
  from: { ...o, row: d - s },
3186
3501
  to: { ...a, row: u - s }
3187
- }, l = K(c, this._selectionRenderService, this._skeletonManagerService);
3502
+ }, l = Z(c, this._selectionRenderService, this._skeletonManagerService);
3188
3503
  else {
3189
3504
  if (d >= e && u <= n)
3190
3505
  return null;
@@ -3193,10 +3508,10 @@ let rn = class extends re {
3193
3508
  c = {
3194
3509
  from: { ...o },
3195
3510
  to: { ...a, row: u - s }
3196
- }, l = K(c, this._selectionRenderService, this._skeletonManagerService);
3511
+ }, l = Z(c, this._selectionRenderService, this._skeletonManagerService);
3197
3512
  else
3198
3513
  return {
3199
- newSheetTransform: $({ ...t }, this._selectionRenderService),
3514
+ newSheetTransform: j({ ...t }, this._selectionRenderService),
3200
3515
  newTransform: t
3201
3516
  };
3202
3517
  else if (d >= e && d <= n) {
@@ -3208,7 +3523,7 @@ let rn = class extends re {
3208
3523
  return;
3209
3524
  l = { ...t, top: (t.top || 0) - g.endY + g.startY - i.from.rowOffset };
3210
3525
  }
3211
- c = $(l, this._selectionRenderService);
3526
+ c = j(l, this._selectionRenderService);
3212
3527
  } else if (u >= e && u <= n && r === O.Both) {
3213
3528
  const g = this._skeletonManagerService.attachRangeWithCoord({ startColumn: o.column, endColumn: o.column, startRow: e - 1, endRow: e - 1 });
3214
3529
  if (g == null)
@@ -3216,7 +3531,7 @@ let rn = class extends re {
3216
3531
  c = {
3217
3532
  from: { ...o },
3218
3533
  to: { ...a, row: e - 1, rowOffset: g.endY - g.startY }
3219
- }, l = K(c, this._selectionRenderService, this._skeletonManagerService);
3534
+ }, l = Z(c, this._selectionRenderService, this._skeletonManagerService);
3220
3535
  }
3221
3536
  }
3222
3537
  return c != null && l != null ? {
@@ -3230,7 +3545,7 @@ let rn = class extends re {
3230
3545
  // but the skeleton changes like other render modules. These two signals are not equivalent.
3231
3546
  // As a temp solution, I subscribed to activate$ here.
3232
3547
  this._commandService.onCommandExecuted((i) => {
3233
- if (i.id === Ci.id) {
3548
+ if (i.id === Ki.id) {
3234
3549
  const { unitId: t, subUnitId: e } = i.params;
3235
3550
  this._updateDrawings(t, e);
3236
3551
  }
@@ -3270,7 +3585,7 @@ let rn = class extends re {
3270
3585
  d != null && Object.keys(d).forEach((u) => {
3271
3586
  if (s === i && a === t) {
3272
3587
  const c = d[u];
3273
- c.transform = K(c.sheetTransform, this._selectionRenderService, this._skeletonManagerService), n.push(d[u]);
3588
+ c.transform = Z(c.sheetTransform, this._selectionRenderService, this._skeletonManagerService), n.push(d[u]);
3274
3589
  } else
3275
3590
  r.push(d[u]);
3276
3591
  });
@@ -3281,7 +3596,7 @@ let rn = class extends re {
3281
3596
  _sheetRefreshListener() {
3282
3597
  this.disposeWithMe(
3283
3598
  this._commandService.onCommandExecuted((i) => {
3284
- Ws.includes(i.id) && requestIdleCallback(() => {
3599
+ mo.includes(i.id) && requestIdleCallback(() => {
3285
3600
  const t = i.params, { unitId: e, subUnitId: n, ranges: r } = t;
3286
3601
  this._refreshDrawingTransform(e, n, r);
3287
3602
  });
@@ -3294,279 +3609,504 @@ let rn = class extends re {
3294
3609
  const o = n[s], { sheetTransform: a, transform: d, anchorType: u = O.Position } = o;
3295
3610
  if (u === O.None)
3296
3611
  return !0;
3297
- const { from: c, to: l } = a, { row: g, column: h } = c, { row: f, column: p } = l;
3298
- for (let m = 0; m < e.length; m++) {
3299
- const _ = e[m], { startRow: v, endRow: I, startColumn: R, endColumn: S } = _;
3300
- if (ei.intersects(
3612
+ const { from: c, to: l } = a, { row: g, column: h } = c, { row: f, column: m } = l;
3613
+ for (let p = 0; p < e.length; p++) {
3614
+ const w = e[p], { startRow: S, endRow: I, startColumn: D, endColumn: v } = w;
3615
+ if (yi.intersects(
3301
3616
  {
3302
- startRow: v,
3617
+ startRow: S,
3303
3618
  endRow: I,
3304
- startColumn: R,
3305
- endColumn: S
3619
+ startColumn: D,
3620
+ endColumn: v
3306
3621
  },
3307
3622
  {
3308
3623
  startRow: g,
3309
3624
  endRow: f,
3310
3625
  startColumn: h,
3311
- endColumn: p
3626
+ endColumn: m
3312
3627
  }
3313
- ) || g > I || h > S) {
3314
- const C = u === O.Position, w = K(a, this._selectionRenderService, this._skeletonManagerService);
3628
+ ) || g > I || h > v) {
3629
+ const C = u === O.Position, _ = Z(a, this._selectionRenderService, this._skeletonManagerService);
3315
3630
  r.push({
3316
3631
  ...o,
3317
3632
  transform: {
3318
- ...w,
3319
- width: C ? d == null ? void 0 : d.width : w == null ? void 0 : w.width,
3320
- height: C ? d == null ? void 0 : d.height : w == null ? void 0 : w.height
3633
+ ..._,
3634
+ width: C ? d == null ? void 0 : d.width : _ == null ? void 0 : _.width,
3635
+ height: C ? d == null ? void 0 : d.height : _ == null ? void 0 : _.height
3321
3636
  }
3322
3637
  });
3323
3638
  break;
3324
3639
  }
3325
3640
  }
3326
- }), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(Y.id, [i]));
3641
+ }), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(V.id, [i]));
3327
3642
  }
3328
3643
  };
3329
- rn = Ns([
3330
- me(1, Z),
3331
- me(2, X),
3332
- me(3, Ye),
3333
- me(4, A(V)),
3334
- me(5, A(At)),
3335
- me(6, ie),
3336
- me(7, se),
3337
- me(8, Se)
3338
- ], rn);
3339
- const Bs = (i) => {
3340
- var v;
3341
- const t = Qe(X), e = Qe(nt), n = Qe(se), r = Qe(Z), { drawings: s } = i, o = s[0];
3644
+ Rn = go([
3645
+ _e(1, Q),
3646
+ _e(2, Y),
3647
+ _e(3, Ze),
3648
+ _e(4, A(X)),
3649
+ _e(5, A(Vt)),
3650
+ _e(6, se),
3651
+ _e(7, oe),
3652
+ _e(8, de)
3653
+ ], Rn);
3654
+ function Yr({ ref: i, ...t }) {
3655
+ const { icon: e, id: n, className: r, extend: s, ...o } = t, a = `univerjs-icon univerjs-icon-${n} ${r || ""}`.trim(), d = Es(`_${_o()}`);
3656
+ return Gr(e, `${n}`, {
3657
+ defIds: e.defIds,
3658
+ idSuffix: d.current
3659
+ }, {
3660
+ ref: i,
3661
+ className: a,
3662
+ ...o
3663
+ }, s);
3664
+ }
3665
+ function Gr(i, t, e, n, r) {
3666
+ return Ar(i.tag, {
3667
+ key: t,
3668
+ ...po(i, e, r),
3669
+ ...n
3670
+ }, (wo(i, e).children || []).map((s, o) => Gr(s, `${t}-${i.tag}-${o}`, e, void 0, r)));
3671
+ }
3672
+ function po(i, t, e) {
3673
+ const n = { ...i.attrs };
3674
+ 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(([s, o]) => {
3675
+ s === "mask" && typeof o == "string" && (n[s] = o.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
3676
+ });
3677
+ const { defIds: r } = t;
3678
+ return !r || r.length === 0 || (i.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + t.idSuffix), Object.entries(n).forEach(([s, o]) => {
3679
+ typeof o == "string" && (n[s] = o.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
3680
+ })), n;
3681
+ }
3682
+ function wo(i, t) {
3683
+ var n;
3684
+ const { defIds: e } = t;
3685
+ return !e || e.length === 0 ? i : i.tag === "defs" && ((n = i.children) != null && n.length) ? {
3686
+ ...i,
3687
+ children: i.children.map((r) => typeof r.attrs.id == "string" && e && e.includes(r.attrs.id) ? {
3688
+ ...r,
3689
+ attrs: {
3690
+ ...r.attrs,
3691
+ id: r.attrs.id + t.idSuffix
3692
+ }
3693
+ } : r)
3694
+ } : i;
3695
+ }
3696
+ function _o() {
3697
+ return Math.random().toString(36).substring(2, 8);
3698
+ }
3699
+ Yr.displayName = "UniverIcon";
3700
+ const So = {
3701
+ tag: "svg",
3702
+ attrs: {
3703
+ xmlns: "http://www.w3.org/2000/svg",
3704
+ fill: "none",
3705
+ viewBox: "0 0 17 16",
3706
+ width: "1em",
3707
+ height: "1em"
3708
+ },
3709
+ children: [{
3710
+ tag: "path",
3711
+ attrs: {
3712
+ fill: "currentColor",
3713
+ d: "M2.35381 3.65517C2.35381 2.88198 2.98061 2.25518 3.75381 2.25518H8.10381C8.43518 2.25518 8.70381 1.98655 8.70381 1.65518C8.70381 1.3238 8.43518 1.05518 8.10381 1.05518H3.75381C2.31787 1.05518 1.15381 2.21923 1.15381 3.65517V12.3552C1.15381 13.7911 2.31787 14.9552 3.75381 14.9552H12.4538C13.8897 14.9552 15.0538 13.7911 15.0538 12.3552V8.00518C15.0538 7.6738 14.7852 7.40518 14.4538 7.40518C14.1224 7.40518 13.8538 7.6738 13.8538 8.00518V9.24469L12.3428 8.11143C11.8294 7.72642 11.1111 7.77744 10.6573 8.23119L9.11281 9.77567L6.84342 7.83047C6.34812 7.40592 5.61375 7.41815 5.13289 7.85896L2.35381 10.4064V3.65517ZM2.35381 12.0343V12.3552C2.35381 13.1284 2.98061 13.7552 3.75381 13.7552H12.4538C13.227 13.7552 13.8538 13.1284 13.8538 12.3552V10.7447L11.6228 9.07144C11.5871 9.04469 11.5373 9.04827 11.5058 9.07971L10.0266 10.5589L11.2057 11.5696C11.4573 11.7853 11.4865 12.164 11.2708 12.4156C11.0552 12.6672 10.6764 12.6964 10.4248 12.4807L6.06245 8.74157C6.02809 8.71212 5.97713 8.71296 5.94377 8.74353L2.35381 12.0343Z",
3714
+ fillRule: "evenodd",
3715
+ clipRule: "evenodd"
3716
+ }
3717
+ }, {
3718
+ tag: "path",
3719
+ attrs: {
3720
+ fill: "currentColor",
3721
+ d: "M10.3911 3.84419C10.6254 3.60988 11.0053 3.60988 11.2396 3.84419L11.8818 4.48643V1.93496C11.8818 1.60359 12.1505 1.33496 12.4818 1.33496C12.8132 1.33496 13.0818 1.60359 13.0818 1.93496V4.48676L13.7244 3.84419C13.9587 3.60988 14.3386 3.60988 14.5729 3.84419C14.8072 4.07851 14.8072 4.45841 14.5729 4.69272L12.9063 6.35939C12.6719 6.5937 12.292 6.5937 12.0577 6.35939L10.3911 4.69272C10.1568 4.45841 10.1568 4.07851 10.3911 3.84419Z"
3722
+ }
3723
+ }]
3724
+ }, Xr = Ts(function(t, e) {
3725
+ return Ar(Yr, Object.assign({}, t, {
3726
+ id: "download-image-icon",
3727
+ ref: e,
3728
+ icon: So
3729
+ }));
3730
+ });
3731
+ Xr.displayName = "DownloadImageIcon";
3732
+ function vo() {
3733
+ const i = Ie(Te), t = Ie(bn), e = Ie(yn), [n, r] = Ee([ye.CELL_ADDRESS]), [s, o] = Ee(!1), [a, d] = Ee(null), u = Fe(() => e.getCellImagesInSelection(), [e]), c = Fe(() => e.getDataColumns(), [e]), l = Fe(() => e.getSelectionRowRange(), [e]), g = c.length > 0, h = Fe(() => c.map((C) => ({
3734
+ label: C.label,
3735
+ value: String(C.index)
3736
+ })), [c]), [f, m] = Ee(
3737
+ () => h.length > 0 ? h[0].value : "0"
3738
+ ), p = Fe(() => {
3739
+ if (!n.includes(ye.COLUMN_VALUE) || !l)
3740
+ return [];
3741
+ const _ = Number(f);
3742
+ return [{
3743
+ startRow: l.startRow,
3744
+ endRow: l.endRow,
3745
+ startColumn: _,
3746
+ endColumn: _
3747
+ }];
3748
+ }, [n, f, l]);
3749
+ fi(p);
3750
+ const w = Et((C) => {
3751
+ C.length !== 0 && r(C);
3752
+ }, []), S = Et((C) => {
3753
+ m(String(C));
3754
+ }, []), I = Et(() => {
3755
+ t.close(ze);
3756
+ }, [t]), D = Et(async () => {
3757
+ if (u.length !== 0) {
3758
+ o(!0), d(null);
3759
+ try {
3760
+ await e.saveImages(u, {
3761
+ fileNameParts: n,
3762
+ columnIndex: n.includes(ye.COLUMN_VALUE) ? Number(f) : void 0
3763
+ }), t.close(ze);
3764
+ } catch (C) {
3765
+ console.error("Failed to save images:", C), d(i.t("sheetImage.save.error"));
3766
+ } finally {
3767
+ o(!1);
3768
+ }
3769
+ }
3770
+ }, [e, u, n, f, t, i]), v = n.includes(ye.COLUMN_VALUE);
3771
+ return /* @__PURE__ */ Xe("div", { className: "univer-flex univer-flex-col", children: [
3772
+ /* @__PURE__ */ L(en, { label: i.t("sheetImage.save.imageCount"), children: /* @__PURE__ */ L("div", { className: "univer-text-sm univer-text-gray-600", children: u.length }) }),
3773
+ /* @__PURE__ */ L(en, { label: i.t("sheetImage.save.fileNameConfig"), children: /* @__PURE__ */ Xe(Qi, { value: n, onChange: w, direction: "vertical", children: [
3774
+ /* @__PURE__ */ L(Yn, { value: ye.CELL_ADDRESS, disabled: !g, children: i.t("sheetImage.save.useRowCol") }),
3775
+ g && /* @__PURE__ */ L(Yn, { value: ye.COLUMN_VALUE, children: i.t("sheetImage.save.useColumnValue") })
3776
+ ] }) }),
3777
+ v && /* @__PURE__ */ L(en, { label: i.t("sheetImage.save.selectColumn"), children: /* @__PURE__ */ L(
3778
+ es,
3779
+ {
3780
+ value: f,
3781
+ options: h,
3782
+ onChange: S
3783
+ }
3784
+ ) }),
3785
+ a && /* @__PURE__ */ L("div", { className: "univer-text-xs univer-text-red-500", children: a }),
3786
+ /* @__PURE__ */ Xe(
3787
+ "div",
3788
+ {
3789
+ className: "univer-flex univer-justify-end univer-gap-2 univer-border-t univer-border-gray-200 univer-pt-3",
3790
+ children: [
3791
+ /* @__PURE__ */ L(Gn, { onClick: I, disabled: s, children: i.t("sheetImage.save.cancel") }),
3792
+ /* @__PURE__ */ L(
3793
+ Gn,
3794
+ {
3795
+ variant: "primary",
3796
+ onClick: D,
3797
+ disabled: s || u.length === 0,
3798
+ children: s ? i.t("sheetImage.save.saving") : i.t("sheetImage.save.confirm")
3799
+ }
3800
+ )
3801
+ ]
3802
+ }
3803
+ )
3804
+ ] });
3805
+ }
3806
+ const Io = (i) => {
3807
+ var S;
3808
+ const t = Ie(Y), e = Ie(Te), n = Ie(oe), r = Ie(Q), { drawings: s } = i, o = s[0];
3342
3809
  if (o == null)
3343
3810
  return;
3344
3811
  const { unitId: a } = o, d = r.getRenderById(a), u = d == null ? void 0 : d.scene;
3345
3812
  if (u == null)
3346
3813
  return;
3347
- const c = u.getTransformerByCreate(), [l, g] = Qt(!0), h = (v = o.anchorType) != null ? v : O.Position, [f, p] = Qt(h);
3348
- function m(I, R) {
3349
- const S = [];
3814
+ const c = u.getTransformerByCreate(), [l, g] = Ee(!0), h = (S = o.anchorType) != null ? S : O.Position, [f, m] = Ee(h);
3815
+ function p(I, D) {
3816
+ const v = [];
3350
3817
  return I.forEach((C) => {
3351
- const { oKey: w } = C, y = R.getDrawingOKey(w);
3818
+ const { oKey: _ } = C, y = D.getDrawingOKey(_);
3352
3819
  if (y == null)
3353
- return S.push(null), !0;
3354
- const { unitId: D, subUnitId: T, drawingId: E, drawingType: M, anchorType: b, sheetTransform: N } = y;
3355
- S.push({
3356
- unitId: D,
3357
- subUnitId: T,
3358
- drawingId: E,
3820
+ return v.push(null), !0;
3821
+ const { unitId: R, subUnitId: E, drawingId: T, drawingType: M, anchorType: b, sheetTransform: N } = y;
3822
+ v.push({
3823
+ unitId: R,
3824
+ subUnitId: E,
3825
+ drawingId: T,
3359
3826
  anchorType: b,
3360
3827
  sheetTransform: N,
3361
3828
  drawingType: M
3362
3829
  });
3363
- }), S;
3830
+ }), v;
3364
3831
  }
3365
- ur(() => {
3366
- const I = c.clearControl$.subscribe((S) => {
3367
- S === !0 && g(!1);
3368
- }), R = c.changeStart$.subscribe((S) => {
3832
+ Nr(() => {
3833
+ const I = c.clearControl$.subscribe((v) => {
3834
+ v === !0 && g(!1);
3835
+ }), D = c.changeStart$.subscribe((v) => {
3369
3836
  var y;
3370
- const { objects: C } = S, w = m(C, n);
3371
- if (w.length === 0)
3837
+ const { objects: C } = v, _ = p(C, n);
3838
+ if (_.length === 0)
3372
3839
  g(!1);
3373
- else if (w.length >= 1) {
3840
+ else if (_.length >= 1) {
3374
3841
  g(!0);
3375
- const D = ((y = w[0]) == null ? void 0 : y.anchorType) || O.Position;
3376
- p(D);
3842
+ const R = ((y = _[0]) == null ? void 0 : y.anchorType) || O.Position;
3843
+ m(R);
3377
3844
  }
3378
3845
  });
3379
3846
  return () => {
3380
- R.unsubscribe(), I.unsubscribe();
3847
+ D.unsubscribe(), I.unsubscribe();
3381
3848
  };
3382
3849
  }, []);
3383
- function _(I) {
3384
- p(I);
3385
- const R = n.getFocusDrawings();
3386
- if (R.length === 0)
3850
+ function w(I) {
3851
+ m(I);
3852
+ const D = n.getFocusDrawings();
3853
+ if (D.length === 0)
3387
3854
  return;
3388
- const S = R.map((C) => ({
3855
+ const v = D.map((C) => ({
3389
3856
  unitId: C.unitId,
3390
3857
  subUnitId: C.subUnitId,
3391
3858
  drawingId: C.drawingId,
3392
3859
  anchorType: I
3393
3860
  }));
3394
- t.executeCommand(Wt.id, {
3395
- unitId: R[0].unitId,
3396
- drawings: S
3861
+ t.executeCommand(zt.id, {
3862
+ unitId: D[0].unitId,
3863
+ drawings: v
3397
3864
  });
3398
3865
  }
3399
- return /* @__PURE__ */ qt(
3866
+ return /* @__PURE__ */ Xe(
3400
3867
  "div",
3401
3868
  {
3402
- className: Mi("univer-grid univer-gap-2 univer-py-2 univer-text-gray-400", {
3869
+ className: ts("univer-grid univer-gap-2 univer-py-2 univer-text-gray-400", {
3403
3870
  "univer-hidden": !l
3404
3871
  }),
3405
3872
  children: [
3406
- /* @__PURE__ */ ae(
3873
+ /* @__PURE__ */ L(
3407
3874
  "header",
3408
3875
  {
3409
3876
  className: "univer-text-gray-600 dark:!univer-text-gray-200",
3410
- children: /* @__PURE__ */ ae("div", { children: e.t("drawing-anchor.title") })
3877
+ children: /* @__PURE__ */ L("div", { children: e.t("drawing-anchor.title") })
3411
3878
  }
3412
3879
  ),
3413
- /* @__PURE__ */ ae("div", { children: /* @__PURE__ */ qt(yi, { value: f, onChange: _, direction: "vertical", children: [
3414
- /* @__PURE__ */ ae(Yt, { value: O.Both, children: e.t("drawing-anchor.both") }),
3415
- /* @__PURE__ */ ae(Yt, { value: O.Position, children: e.t("drawing-anchor.position") }),
3416
- /* @__PURE__ */ ae(Yt, { value: O.None, children: e.t("drawing-anchor.none") })
3880
+ /* @__PURE__ */ L("div", { children: /* @__PURE__ */ Xe(ns, { value: f, onChange: w, direction: "vertical", children: [
3881
+ /* @__PURE__ */ L(tn, { value: O.Both, children: e.t("drawing-anchor.both") }),
3882
+ /* @__PURE__ */ L(tn, { value: O.Position, children: e.t("drawing-anchor.position") }),
3883
+ /* @__PURE__ */ L(tn, { value: O.None, children: e.t("drawing-anchor.none") })
3417
3884
  ] }) })
3418
3885
  ]
3419
3886
  }
3420
3887
  );
3421
- }, js = () => {
3422
- const i = Qe(se), t = i.getFocusDrawings(), [e, n] = Qt(t);
3423
- return ur(() => {
3888
+ }, Co = () => {
3889
+ const i = Ie(oe), t = i.getFocusDrawings(), [e, n] = Ee(t);
3890
+ return Nr(() => {
3424
3891
  const r = i.focus$.subscribe((s) => {
3425
3892
  n(s);
3426
3893
  });
3427
3894
  return () => {
3428
3895
  r.unsubscribe();
3429
3896
  };
3430
- }, []), !!(e != null && e.length) && /* @__PURE__ */ qt("div", { className: "univer-text-sm", children: [
3431
- /* @__PURE__ */ ae(Ki, { drawings: e }),
3432
- /* @__PURE__ */ ae(Bs, { drawings: e })
3897
+ }, []), !!(e != null && e.length) && /* @__PURE__ */ Xe("div", { className: "univer-text-sm", children: [
3898
+ /* @__PURE__ */ L(Rs, { drawings: e }),
3899
+ /* @__PURE__ */ L(Io, { drawings: e })
3433
3900
  ] });
3434
- }, Cr = "sheet.menu.image";
3435
- function $s(i) {
3901
+ }, zr = "sheet.menu.image";
3902
+ function Ro(i) {
3436
3903
  return {
3437
- id: Cr,
3438
- type: cn.SUBITEMS,
3904
+ id: zr,
3905
+ type: Gt.SUBITEMS,
3439
3906
  icon: "AddImageIcon",
3440
3907
  tooltip: "sheetImage.title",
3441
- hidden$: an(i, F.UNIVER_SHEET),
3442
- disabled$: Yr(i, { workbookTypes: [zt], worksheetTypes: [Kt], rangeTypes: [Di] })
3908
+ hidden$: Yt(i, $.UNIVER_SHEET),
3909
+ disabled$: mi(i, { workbookTypes: [gn], worksheetTypes: [fn], rangeTypes: [Zi] })
3443
3910
  };
3444
3911
  }
3445
- function Fs(i) {
3912
+ function Do(i) {
3446
3913
  return {
3447
- id: Bt.id,
3914
+ id: Kt.id,
3448
3915
  title: "sheetImage.upload.float",
3449
- type: cn.BUTTON,
3450
- hidden$: an(i, F.UNIVER_SHEET)
3916
+ type: Gt.BUTTON,
3917
+ hidden$: Yt(i, $.UNIVER_SHEET)
3451
3918
  };
3452
3919
  }
3453
- function xs(i) {
3920
+ function bo(i) {
3454
3921
  return {
3455
- id: dn.id,
3922
+ id: Mn.id,
3456
3923
  title: "sheetImage.upload.cell",
3457
- type: cn.BUTTON,
3458
- hidden$: an(i, F.UNIVER_SHEET)
3924
+ type: Gt.BUTTON,
3925
+ hidden$: Yt(i, $.UNIVER_SHEET)
3459
3926
  };
3460
3927
  }
3461
- const Ys = {
3462
- [Fi.MEDIA]: {
3463
- [Cr]: {
3928
+ function Mo(i) {
3929
+ var t, e, n, r;
3930
+ return !!((e = (t = i == null ? void 0 : i.p) == null ? void 0 : t.drawingsOrder) != null && e.length && ((r = (n = i == null ? void 0 : i.p) == null ? void 0 : n.drawingsOrder) == null ? void 0 : r.length) > 0);
3931
+ }
3932
+ function yo(i, t) {
3933
+ const e = i.getActiveSheet();
3934
+ if (!e) return !1;
3935
+ const n = e.getCellMatrix(), { startRow: r, endRow: s, startColumn: o, endColumn: a } = t;
3936
+ for (let d = r; d <= s; d++)
3937
+ for (let u = o; u <= a; u++) {
3938
+ const c = n.getValue(d, u);
3939
+ if (Mo(c))
3940
+ return !0;
3941
+ }
3942
+ return !1;
3943
+ }
3944
+ function Eo() {
3945
+ return "showDirectoryPicker" in window;
3946
+ }
3947
+ function dn(i) {
3948
+ const t = i.get(de), e = i.get(ut), n = at([
3949
+ Yt(i, $.UNIVER_SHEET),
3950
+ t.getCurrentTypeOfUnit$($.UNIVER_SHEET).pipe(
3951
+ me((r) => r ? e.selectionMoveEnd$.pipe(
3952
+ pe(() => {
3953
+ if (!Eo())
3954
+ return !0;
3955
+ const s = e.getCurrentSelections();
3956
+ if (!s || s.length === 0)
3957
+ return !0;
3958
+ for (const o of s)
3959
+ if (yo(r, o.range))
3960
+ return !1;
3961
+ return !0;
3962
+ })
3963
+ ) : wn(!0))
3964
+ )
3965
+ ]).pipe(
3966
+ pe(([r, s]) => r || s)
3967
+ );
3968
+ return {
3969
+ id: ct.id,
3970
+ type: Gt.BUTTON,
3971
+ icon: "DownloadImageIcon",
3972
+ title: "sheetImage.save.menuLabel",
3973
+ hidden$: n
3974
+ };
3975
+ }
3976
+ const To = {
3977
+ [fs.MEDIA]: {
3978
+ [zr]: {
3464
3979
  order: 0,
3465
- menuItemFactory: $s,
3466
- [Bt.id]: {
3980
+ menuItemFactory: Ro,
3981
+ [Kt.id]: {
3467
3982
  order: 0,
3468
- menuItemFactory: Fs
3983
+ menuItemFactory: Do
3469
3984
  },
3470
- [dn.id]: {
3985
+ [Mn.id]: {
3471
3986
  order: 1,
3472
- menuItemFactory: xs
3987
+ menuItemFactory: bo
3988
+ }
3989
+ }
3990
+ },
3991
+ [rn.MAIN_AREA]: {
3992
+ [sn.OTHERS]: {
3993
+ [ct.id]: {
3994
+ order: 10,
3995
+ menuItemFactory: dn
3996
+ }
3997
+ }
3998
+ },
3999
+ [rn.COL_HEADER]: {
4000
+ [sn.OTHERS]: {
4001
+ [ct.id]: {
4002
+ order: 10,
4003
+ menuItemFactory: dn
4004
+ }
4005
+ }
4006
+ },
4007
+ [rn.ROW_HEADER]: {
4008
+ [sn.OTHERS]: {
4009
+ [ct.id]: {
4010
+ order: 10,
4011
+ menuItemFactory: dn
3473
4012
  }
3474
4013
  }
3475
4014
  }
3476
4015
  };
3477
- function st(i) {
3478
- return !i.getContextValue(ti) && !i.getContextValue(ni) && !i.getContextValue(ri) && i.getContextValue(Fe);
4016
+ function ft(i) {
4017
+ return !i.getContextValue(Ei) && !i.getContextValue(Ti) && !i.getContextValue(Oi) && i.getContextValue(Ge);
3479
4018
  }
3480
- const Gs = {
3481
- id: it.id,
4019
+ const Oo = {
4020
+ id: gt.id,
3482
4021
  description: "shortcut.drawing-move-down",
3483
4022
  group: "4_drawing-view",
3484
- binding: xe.ARROW_DOWN,
4023
+ binding: Ke.ARROW_DOWN,
3485
4024
  priority: 100,
3486
- preconditions: st,
4025
+ preconditions: ft,
3487
4026
  staticParameters: {
3488
- direction: _e.DOWN
4027
+ direction: ve.DOWN
3489
4028
  }
3490
- }, Xs = {
3491
- id: it.id,
4029
+ }, Uo = {
4030
+ id: gt.id,
3492
4031
  description: "shortcut.drawing-move-up",
3493
4032
  group: "4_drawing-view",
3494
- binding: xe.ARROW_UP,
4033
+ binding: Ke.ARROW_UP,
3495
4034
  priority: 100,
3496
- preconditions: st,
4035
+ preconditions: ft,
3497
4036
  staticParameters: {
3498
- direction: _e.UP
4037
+ direction: ve.UP
3499
4038
  }
3500
- }, Ls = {
3501
- id: it.id,
4039
+ }, Po = {
4040
+ id: gt.id,
3502
4041
  description: "shortcut.drawing-move-left",
3503
4042
  group: "4_drawing-view",
3504
- binding: xe.ARROW_LEFT,
4043
+ binding: Ke.ARROW_LEFT,
3505
4044
  priority: 100,
3506
- preconditions: st,
4045
+ preconditions: ft,
3507
4046
  staticParameters: {
3508
- direction: _e.LEFT
4047
+ direction: ve.LEFT
3509
4048
  }
3510
- }, Vs = {
3511
- id: it.id,
4049
+ }, Ao = {
4050
+ id: gt.id,
3512
4051
  description: "shortcut.drawing-move-right",
3513
4052
  group: "4_drawing-view",
3514
- binding: xe.ARROW_RIGHT,
4053
+ binding: Ke.ARROW_RIGHT,
3515
4054
  priority: 100,
3516
- preconditions: st,
4055
+ preconditions: ft,
3517
4056
  staticParameters: {
3518
- direction: _e.RIGHT
4057
+ direction: ve.RIGHT
3519
4058
  }
3520
- }, Hs = {
3521
- id: hr.id,
4059
+ }, No = {
4060
+ id: $r.id,
3522
4061
  description: "shortcut.drawing-delete",
3523
4062
  group: "4_drawing-view",
3524
4063
  // when focusing on any other input tag do not trigger this shortcut
3525
- preconditions: st,
3526
- binding: xe.DELETE,
3527
- mac: xe.BACKSPACE
4064
+ preconditions: ft,
4065
+ binding: Ke.DELETE,
4066
+ mac: Ke.BACKSPACE
3528
4067
  };
3529
- var zs = Object.getOwnPropertyDescriptor, Ks = (i, t, e, n) => {
3530
- for (var r = n > 1 ? void 0 : n ? zs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
4068
+ var $o = Object.getOwnPropertyDescriptor, ko = (i, t, e, n) => {
4069
+ for (var r = n > 1 ? void 0 : n ? $o(t, e) : t, s = i.length - 1, o; s >= 0; s--)
3531
4070
  (o = i[s]) && (r = o(r) || r);
3532
4071
  return r;
3533
- }, Ne = (i, t) => (e, n) => t(e, n, i);
3534
- let Ut = class extends re {
4072
+ }, Be = (i, t) => (e, n) => t(e, n, i);
4073
+ let Ft = class extends ee {
3535
4074
  constructor(i, t, e, n, r, s) {
3536
4075
  super(), this._componentManager = i, this._menuManagerService = t, this._commandService = e, this._shortcutService = n, this._drawingManagerService = r, this._sheetsSelectionsService = s, this._init();
3537
4076
  }
3538
4077
  _initCustomComponents() {
3539
4078
  const i = this._componentManager;
3540
- this.disposeWithMe(i.register(pr, js));
4079
+ this.disposeWithMe(i.register(Br, Co)), this.disposeWithMe(i.register(ze, vo)), this.disposeWithMe(i.register("DownloadImageIcon", Xr));
3541
4080
  }
3542
4081
  _initMenus() {
3543
- this._menuManagerService.mergeMenu(Ys);
4082
+ this._menuManagerService.mergeMenu(To);
3544
4083
  }
3545
4084
  _initCommands() {
3546
4085
  [
3547
- Bt,
3548
- dn,
3549
- kt,
3550
- rt,
3551
- Wt,
3552
- wr,
3553
- Y,
3554
- _r,
3555
- gr,
3556
- mr,
3557
- it,
3558
- hr,
3559
- fr
4086
+ Kt,
4087
+ Mn,
4088
+ Xt,
4089
+ ht,
4090
+ zt,
4091
+ jr,
4092
+ V,
4093
+ Fr,
4094
+ kr,
4095
+ Wr,
4096
+ gt,
4097
+ $r,
4098
+ xr,
4099
+ ct
3560
4100
  ].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
3561
4101
  }
3562
4102
  _initShortcuts() {
3563
4103
  [
3564
4104
  // sheet drawing shortcuts
3565
- Gs,
3566
- Xs,
3567
- Ls,
3568
- Vs,
3569
- Hs
4105
+ Oo,
4106
+ Uo,
4107
+ Po,
4108
+ Ao,
4109
+ No
3570
4110
  ].forEach((i) => {
3571
4111
  this.disposeWithMe(this._shortcutService.registerShortcut(i));
3572
4112
  });
@@ -3575,101 +4115,106 @@ let Ut = class extends re {
3575
4115
  this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
3576
4116
  }
3577
4117
  };
3578
- Ut = Ks([
3579
- Ne(0, A(dr)),
3580
- Ne(1, xi),
3581
- Ne(2, X),
3582
- Ne(3, Yi),
3583
- Ne(4, se),
3584
- Ne(5, A(on))
3585
- ], Ut);
3586
- var Js = Object.defineProperty, Zs = Object.getOwnPropertyDescriptor, qs = (i, t, e) => t in i ? Js(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, Qs = (i, t, e, n) => {
3587
- for (var r = n > 1 ? void 0 : n ? Zs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
4118
+ Ft = ko([
4119
+ Be(0, A(Ur)),
4120
+ Be(1, ms),
4121
+ Be(2, Y),
4122
+ Be(3, ps),
4123
+ Be(4, oe),
4124
+ Be(5, A(ut))
4125
+ ], Ft);
4126
+ var xo = Object.defineProperty, Wo = Object.getOwnPropertyDescriptor, Bo = (i, t, e) => t in i ? xo(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, jo = (i, t, e, n) => {
4127
+ for (var r = n > 1 ? void 0 : n ? Wo(t, e) : t, s = i.length - 1, o; s >= 0; s--)
3588
4128
  (o = i[s]) && (r = o(r) || r);
3589
4129
  return r;
3590
- }, Lt = (i, t) => (e, n) => t(e, n, i), Dr = (i, t, e) => qs(i, typeof t != "symbol" ? t + "" : t, e);
3591
- const eo = "SHEET_IMAGE_UI_PLUGIN";
3592
- let Pt = class extends oi {
3593
- constructor(i = jn, t, e, n) {
4130
+ }, ln = (i, t) => (e, n) => t(e, n, i), Kr = (i, t, e) => Bo(i, typeof t != "symbol" ? t + "" : t, e);
4131
+ const Fo = "SHEET_IMAGE_UI_PLUGIN";
4132
+ let Lt = class extends Ai {
4133
+ constructor(i = sr, t, e, n) {
3594
4134
  super(), this._config = i, this._injector = t, this._renderManagerService = e, this._configService = n;
3595
- const { menu: r, ...s } = ai(
4135
+ const { menu: r, ...s } = Ni(
3596
4136
  {},
3597
- jn,
4137
+ sr,
3598
4138
  this._config
3599
4139
  );
3600
- r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(os, s);
4140
+ r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(Ws, s);
3601
4141
  }
3602
4142
  onStarting() {
3603
- ci(this._injector, [
3604
- [tt],
3605
- [Ut],
3606
- [Rt],
3607
- [Ot],
3608
- [Et],
3609
- [Tt],
3610
- [bt],
3611
- [Mt],
3612
- [yt]
3613
- ]), xt(this._injector, [
3614
- [tt]
4143
+ $i(this._injector, [
4144
+ [lt],
4145
+ [Ft],
4146
+ [Nt],
4147
+ [jt],
4148
+ [Bt],
4149
+ [Wt],
4150
+ [$t],
4151
+ [kt],
4152
+ [xt],
4153
+ [yn, { useClass: vn }]
4154
+ ]), Qt(this._injector, [
4155
+ [lt]
3615
4156
  ]);
3616
4157
  }
3617
4158
  onReady() {
3618
- xt(this._injector, [
3619
- [Tt],
3620
- [yt]
4159
+ Qt(this._injector, [
4160
+ [Wt],
4161
+ [xt]
3621
4162
  ]);
3622
4163
  }
3623
4164
  onRendered() {
3624
- this._registerRenderModules(), xt(this._injector, [
3625
- [Et],
3626
- [Ot],
3627
- [Ut],
3628
- [bt],
3629
- [Mt]
4165
+ this._registerRenderModules(), Qt(this._injector, [
4166
+ [Bt],
4167
+ [jt],
4168
+ [Ft],
4169
+ [$t],
4170
+ [kt]
3630
4171
  ]);
3631
4172
  }
3632
4173
  onSteady() {
3633
- this._injector.get(Rt);
4174
+ this._injector.get(Nt);
3634
4175
  }
3635
4176
  _registerRenderModules() {
3636
4177
  [
3637
- [et],
3638
- [rn],
3639
- [nn],
3640
- [tn]
4178
+ [dt],
4179
+ [Rn],
4180
+ [Cn],
4181
+ [In]
3641
4182
  ].forEach((i) => {
3642
- this.disposeWithMe(this._renderManagerService.registerRenderModule(F.UNIVER_SHEET, i));
4183
+ this.disposeWithMe(this._renderManagerService.registerRenderModule($.UNIVER_SHEET, i));
3643
4184
  });
3644
4185
  }
3645
4186
  };
3646
- Dr(Pt, "type", F.UNIVER_SHEET);
3647
- Dr(Pt, "pluginName", eo);
3648
- Pt = Qs([
3649
- ii(Pi, Xi, Ji, di),
3650
- Lt(1, A(Xe)),
3651
- Lt(2, Z),
3652
- Lt(3, si)
3653
- ], Pt);
4187
+ Kr(Lt, "type", $.UNIVER_SHEET);
4188
+ Kr(Lt, "pluginName", Fo);
4189
+ Lt = jo([
4190
+ Ui(as, _s, Ds, ki),
4191
+ ln(1, A(qe)),
4192
+ ln(2, Q),
4193
+ ln(3, Pi)
4194
+ ], Lt);
3654
4195
  export {
3655
- Y as ClearSheetDrawingTransformerOperation,
3656
- hr as DeleteDrawingsCommand,
3657
- _r as EditSheetDrawingOperation,
3658
- gr as GroupSheetDrawingCommand,
3659
- Bt as InsertFloatImageCommand,
3660
- kt as InsertSheetDrawingCommand,
3661
- it as MoveDrawingsCommand,
3662
- rt as RemoveSheetDrawingCommand,
3663
- Cr as SHEETS_IMAGE_MENU_ID,
3664
- Es as SHEET_FLOAT_DOM_PREFIX,
3665
- fr as SetDrawingArrangeCommand,
3666
- Wt as SetSheetDrawingCommand,
3667
- tt as SheetCanvasFloatDomManagerService,
3668
- et as SheetDrawingUpdateController,
3669
- wr as SidebarSheetDrawingOperation,
3670
- mr as UngroupSheetDrawingCommand,
3671
- Pt as UniverSheetsDrawingUIPlugin,
3672
- ge as calcSheetFloatDomPosition,
3673
- K as drawingPositionToTransform,
3674
- $ as transformToDrawingPosition
4196
+ vn as BatchSaveImagesService,
4197
+ V as ClearSheetDrawingTransformerOperation,
4198
+ $r as DeleteDrawingsCommand,
4199
+ Fr as EditSheetDrawingOperation,
4200
+ ye as FileNamePart,
4201
+ kr as GroupSheetDrawingCommand,
4202
+ yn as IBatchSaveImagesService,
4203
+ Kt as InsertFloatImageCommand,
4204
+ Xt as InsertSheetDrawingCommand,
4205
+ gt as MoveDrawingsCommand,
4206
+ ht as RemoveSheetDrawingCommand,
4207
+ zr as SHEETS_IMAGE_MENU_ID,
4208
+ ao as SHEET_FLOAT_DOM_PREFIX,
4209
+ ct as SaveCellImagesCommand,
4210
+ xr as SetDrawingArrangeCommand,
4211
+ zt as SetSheetDrawingCommand,
4212
+ lt as SheetCanvasFloatDomManagerService,
4213
+ dt as SheetDrawingUpdateController,
4214
+ jr as SidebarSheetDrawingOperation,
4215
+ Wr as UngroupSheetDrawingCommand,
4216
+ Lt as UniverSheetsDrawingUIPlugin,
4217
+ fe as calcSheetFloatDomPosition,
4218
+ Z as drawingPositionToTransform,
4219
+ j as transformToDrawingPosition
3675
4220
  };