@univerjs/docs-drawing-ui 0.7.0-nightly.202505081607 → 0.7.0-nightly.202505091607

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/es/index.js CHANGED
@@ -1,19 +1,19 @@
1
1
  var kn = Object.defineProperty;
2
- var Fn = (i, e, t) => e in i ? kn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
- var _e = (i, e, t) => Fn(i, typeof e != "symbol" ? e + "" : e, t);
4
- import { CommandType as q, ICommandService as G, IUniverInstanceService as z, TextX as Dt, JSONX as $, MemoryCursor as jn, TextXActionType as Y, IUndoRedoService as Zt, BuildTextUtils as Wn, ArrangeTypeEnum as Je, Tools as Ce, Inject as Z, IContextService as Qt, LocaleService as ft, Disposable as Ue, WrapTextType as qe, PositionedObjectLayoutType as F, BooleanNumber as se, DrawingTypeEnum as Le, ObjectRelativeFromV as j, ObjectRelativeFromH as J, FOCUSING_COMMON_DRAWINGS as rt, UniverInstanceType as Ie, Direction as he, DocumentFlavor as pt, DOCS_ZEN_EDITOR_UNIT_ID_KEY as yt, FOCUSING_UNIVER_EDITOR as Hn, UndoCommand as Gn, RedoCommand as Vn, DisposableCollection as $n, toDisposable as ye, fromEventSubject as Jt, generateRandomId as zn, Injector as en, DOC_DRAWING_PRINTING_COMPONENT_KEY as Xn, throttle as Et, COLORS as qn, RxDisposable as Kn, LifecycleService as Yn, LifecycleStages as Rt, DependentOn as Zn, IConfigService as Qn, Plugin as Jn, merge as ei } from "@univerjs/core";
5
- import { IDocDrawingService as Be, UniverDocsDrawingPlugin as ti } from "@univerjs/docs-drawing";
6
- import { IImageIoService as ni, IDrawingManagerService as ve, DRAWING_IMAGE_ALLOW_IMAGE_LIST as ii, DRAWING_IMAGE_COUNT_LIMIT as At, ImageUploadStatusType as wt, DRAWING_IMAGE_ALLOW_SIZE as ri, getImageSize as si, getDrawingShapeKeyByDrawingSearch as oi, DRAWING_IMAGE_WIDTH_LIMIT as Pt, DRAWING_IMAGE_HEIGHT_LIMIT as Lt, UniverDrawingPlugin as ai } from "@univerjs/drawing";
7
- import { DrawingCommonPanel as ci, DrawingRenderService as tn, ImageCropperObject as di, COMPONENT_IMAGE_POPUP_MENU as li, OpenImageCropOperation as ui, ImageResetSizeOperation as gi, UniverDrawingUIPlugin as fi } from "@univerjs/drawing-ui";
8
- import { IRenderManagerService as Q, DocumentEditArea as We, getCurrentTypeOfRenderer as hi, CURSOR_TYPE as Ut, Liquid as nn, PageLayoutType as Bt, DocumentSkeletonPageType as kt, Vector2 as mi, Rect as vi, getColor as pi, TRANSFORM_CHANGE_OBSERVABLE_TYPE as wi } from "@univerjs/engine-render";
9
- import { IMessageService as Ii, ILocalFileService as _i, ISidebarService as Si, useDependency as we, getMenuHiddenObservable as rn, MenuItemType as sn, RibbonStartGroup as Di, KeyCode as He, ComponentManager as on, IMenuManagerService as yi, IShortcutService as Oi, CanvasFloatDomService as Ti, PrintFloatDomSingle as Mi, connectInjector as bi, UniverUIPlugin as Ci } from "@univerjs/ui";
10
- import { RichTextEditingMutation as ee, DocSelectionManagerService as Ot, DocSkeletonManagerService as te } from "@univerjs/docs";
11
- import { DocSelectionRenderService as xe, getRichTextEditPath as Ke, getCustomBlockIdsInSelections as xi, docDrawingPositionToTransform as an, VIEWPORT_KEY as cn, SetDocZoomRatioOperation as dn, DocPrintInterceptorService as Ni, NodePositionConvertToCursor as Ft, getOneTextSelectionRange as jt, getAnchorBounding as Ei, TEXT_RANGE_LAYER_INDEX as Ri, getDocObject as Ai, DocCanvasPopManagerService as Pi, IEditorService as Li } from "@univerjs/docs-ui";
12
- import { MessageType as Wt, InputNumber as je, Select as Ht, Checkbox as Ui, clsx as ue, RadioGroup as Gt, Radio as be, render as Bi, unmount as ki } from "@univerjs/design";
13
- import { BehaviorSubject as Tt, debounceTime as ln, Observable as Fi, map as Vt, switchMap as ji, of as Wi, takeUntil as $t, filter as zt } from "rxjs";
2
+ var jn = (i, e, t) => e in i ? kn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
+ var _e = (i, e, t) => jn(i, typeof e != "symbol" ? e + "" : e, t);
4
+ import { CommandType as q, ICommandService as G, IUniverInstanceService as z, TextX as Dt, JSONX as $, MemoryCursor as Wn, TextXActionType as Y, IUndoRedoService as Zt, BuildTextUtils as Hn, ArrangeTypeEnum as Je, Tools as Ce, Inject as Z, IContextService as Qt, LocaleService as ft, Disposable as Ue, WrapTextType as qe, PositionedObjectLayoutType as k, BooleanNumber as oe, DrawingTypeEnum as Le, ObjectRelativeFromV as j, ObjectRelativeFromH as J, FOCUSING_COMMON_DRAWINGS as rt, UniverInstanceType as Ie, Direction as he, DocumentFlavor as pt, DOCS_ZEN_EDITOR_UNIT_ID_KEY as yt, FOCUSING_UNIVER_EDITOR as Gn, UndoCommand as Vn, RedoCommand as $n, DisposableCollection as zn, toDisposable as ye, fromEventSubject as Jt, generateRandomId as Xn, Injector as en, DOC_DRAWING_PRINTING_COMPONENT_KEY as qn, throttle as Et, COLORS as Kn, RxDisposable as Yn, LifecycleService as Zn, LifecycleStages as Rt, DependentOn as Qn, IConfigService as Jn, Plugin as ei, merge as ti } from "@univerjs/core";
5
+ import { IDocDrawingService as Be, UniverDocsDrawingPlugin as ni } from "@univerjs/docs-drawing";
6
+ import { IImageIoService as ii, IDrawingManagerService as ve, DRAWING_IMAGE_ALLOW_IMAGE_LIST as ri, DRAWING_IMAGE_COUNT_LIMIT as At, ImageUploadStatusType as wt, DRAWING_IMAGE_ALLOW_SIZE as si, getImageSize as oi, getDrawingShapeKeyByDrawingSearch as ai, DRAWING_IMAGE_WIDTH_LIMIT as Pt, DRAWING_IMAGE_HEIGHT_LIMIT as Lt, UniverDrawingPlugin as ci } from "@univerjs/drawing";
7
+ import { DrawingCommonPanel as di, DrawingRenderService as tn, ImageCropperObject as li, COMPONENT_IMAGE_POPUP_MENU as ui, OpenImageCropOperation as gi, ImageResetSizeOperation as fi, UniverDrawingUIPlugin as hi } from "@univerjs/drawing-ui";
8
+ import { IRenderManagerService as Q, DocumentEditArea as We, getCurrentTypeOfRenderer as mi, CURSOR_TYPE as Ut, Liquid as nn, PageLayoutType as Bt, DocumentSkeletonPageType as Ft, Vector2 as vi, Rect as pi, getColor as wi, TRANSFORM_CHANGE_OBSERVABLE_TYPE as Ii } from "@univerjs/engine-render";
9
+ import { IMessageService as _i, ILocalFileService as Si, ISidebarService as Di, useDependency as we, getMenuHiddenObservable as rn, MenuItemType as sn, RibbonStartGroup as yi, KeyCode as He, ComponentManager as on, IMenuManagerService as Oi, IShortcutService as Ti, CanvasFloatDomService as Mi, PrintFloatDomSingle as bi, connectInjector as Ci, UniverUIPlugin as xi } from "@univerjs/ui";
10
+ import { RichTextEditingMutation as ee, DocSelectionManagerService as Ot, DocSkeletonManagerService as ne } from "@univerjs/docs";
11
+ import { DocSelectionRenderService as xe, getRichTextEditPath as Ke, getCustomBlockIdsInSelections as Ni, docDrawingPositionToTransform as an, VIEWPORT_KEY as cn, SetDocZoomRatioOperation as dn, DocPrintInterceptorService as Ei, NodePositionConvertToCursor as kt, getOneTextSelectionRange as jt, getAnchorBounding as Ri, TEXT_RANGE_LAYER_INDEX as Ai, getDocObject as Pi, DocCanvasPopManagerService as Li, IEditorService as Ui } from "@univerjs/docs-ui";
12
+ import { MessageType as Wt, clsx as te, InputNumber as je, Select as Ht, Checkbox as Bi, borderTopClassName as ln, RadioGroup as Gt, Radio as be, render as Fi, unmount as ki } from "@univerjs/design";
13
+ import { BehaviorSubject as Tt, debounceTime as un, Observable as ji, map as Vt, switchMap as Wi, of as Hi, takeUntil as $t, filter as zt } from "rxjs";
14
14
  import { jsxs as X, jsx as m } from "react/jsx-runtime";
15
- import { forwardRef as un, useRef as Hi, createElement as gn, useState as re, useEffect as Mt, useMemo as Gi } from "react";
16
- const Vi = "docs-drawing-ui.config", Xt = {};
15
+ import { forwardRef as gn, useRef as Gi, createElement as fn, useState as se, useEffect as Mt, useMemo as Vi } from "react";
16
+ const $i = "docs-drawing-ui.config", Xt = {};
17
17
  var me = function() {
18
18
  return me = Object.assign || function(i) {
19
19
  for (var e, t = 1, n = arguments.length; t < n; t++) {
@@ -22,23 +22,23 @@ var me = function() {
22
22
  }
23
23
  return i;
24
24
  }, me.apply(this, arguments);
25
- }, $i = function(i, e) {
25
+ }, zi = function(i, e) {
26
26
  var t = {};
27
27
  for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && e.indexOf(n) < 0 && (t[n] = i[n]);
28
28
  if (i != null && typeof Object.getOwnPropertySymbols == "function")
29
29
  for (var r = 0, n = Object.getOwnPropertySymbols(i); r < n.length; r++)
30
30
  e.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, n[r]) && (t[n[r]] = i[n[r]]);
31
31
  return t;
32
- }, fn = un(function(i, e) {
33
- var t = i.icon, n = i.id, r = i.className, s = i.extend, o = $i(i, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(n, " ").concat(r || "").trim(), d = Hi("_".concat(qi()));
34
- return hn(t, "".concat(n), { defIds: t.defIds, idSuffix: d.current }, me({ ref: e, className: c }, o), s);
32
+ }, hn = gn(function(i, e) {
33
+ var t = i.icon, n = i.id, r = i.className, s = i.extend, o = zi(i, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(n, " ").concat(r || "").trim(), d = Gi("_".concat(Ki()));
34
+ return mn(t, "".concat(n), { defIds: t.defIds, idSuffix: d.current }, me({ ref: e, className: c }, o), s);
35
35
  });
36
- function hn(i, e, t, n, r) {
37
- return gn(i.tag, me(me({ key: e }, zi(i, t, r)), n), (Xi(i, t).children || []).map(function(s, o) {
38
- return hn(s, "".concat(e, "-").concat(i.tag, "-").concat(o), t, void 0, r);
36
+ function mn(i, e, t, n, r) {
37
+ return fn(i.tag, me(me({ key: e }, Xi(i, t, r)), n), (qi(i, t).children || []).map(function(s, o) {
38
+ return mn(s, "".concat(e, "-").concat(i.tag, "-").concat(o), t, void 0, r);
39
39
  }));
40
40
  }
41
- function zi(i, e, t) {
41
+ function Xi(i, e, t) {
42
42
  var n = me({}, i.attrs);
43
43
  t != null && t.colorChannel1 && n.fill === "colorChannel1" && (n.fill = t.colorChannel1), i.tag === "mask" && n.id && (n.id = n.id + e.idSuffix), Object.entries(n).forEach(function(s) {
44
44
  var o = s[0], c = s[1];
@@ -50,24 +50,24 @@ function zi(i, e, t) {
50
50
  typeof c == "string" && (n[o] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
51
51
  })), n;
52
52
  }
53
- function Xi(i, e) {
53
+ function qi(i, e) {
54
54
  var t, n = e.defIds;
55
55
  return !n || n.length === 0 ? i : i.tag === "defs" && (!((t = i.children) === null || t === void 0) && t.length) ? me(me({}, i), { children: i.children.map(function(r) {
56
56
  return typeof r.attrs.id == "string" && n && n.indexOf(r.attrs.id) > -1 ? me(me({}, r), { attrs: me(me({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
57
57
  }) }) : i;
58
58
  }
59
- function qi() {
59
+ function Ki() {
60
60
  return Math.random().toString(36).substring(2, 8);
61
61
  }
62
- fn.displayName = "UniverIcon";
63
- var Ki = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.2498 3.65005C2.2498 2.87685 2.87661 2.25005 3.64981 2.25005H7.9998C8.33118 2.25005 8.5998 1.98142 8.5998 1.65005C8.5998 1.31868 8.33118 1.05005 7.9998 1.05005H3.64981C2.21387 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V8.00005C14.9498 7.66868 14.6812 7.40005 14.3498 7.40005C14.0184 7.40005 13.7498 7.66868 13.7498 8.00005V9.23974L12.2385 8.1063C11.7252 7.72129 11.0068 7.7723 10.5531 8.22605L9.00869 9.77041L6.73916 7.8251C6.24387 7.40055 5.5095 7.41278 5.02864 7.85359L2.2498 10.4009V3.65005ZM2.2498 12.0287V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.7397L11.5186 9.06631C11.4829 9.03956 11.433 9.04314 11.4016 9.07458L9.92249 10.5537L11.1015 11.5642C11.3531 11.7799 11.3822 12.1587 11.1666 12.4103C10.9509 12.6619 10.5721 12.691 10.3205 12.4753L5.9582 8.7362C5.92384 8.70674 5.87288 8.70758 5.83952 8.73816L2.2498 12.0287Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M11.8097 1.14783C12.1411 1.14783 12.4097 1.41646 12.4097 1.74783V3.297H14.1541C14.4855 3.297 14.7541 3.56563 14.7541 3.897C14.7541 4.22837 14.4855 4.497 14.1541 4.497H12.4097V6.24167C12.4097 6.57304 12.1411 6.84167 11.8097 6.84167C11.4783 6.84167 11.2097 6.57304 11.2097 6.24167V4.497H9.6603C9.32893 4.497 9.0603 4.22837 9.0603 3.897C9.0603 3.56563 9.32893 3.297 9.6603 3.297H11.2097V1.74783C11.2097 1.41646 11.4783 1.14783 11.8097 1.14783Z" } }] }, mn = un(function(i, e) {
64
- return gn(fn, Object.assign({}, i, {
62
+ hn.displayName = "UniverIcon";
63
+ var Yi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.2498 3.65005C2.2498 2.87685 2.87661 2.25005 3.64981 2.25005H7.9998C8.33118 2.25005 8.5998 1.98142 8.5998 1.65005C8.5998 1.31868 8.33118 1.05005 7.9998 1.05005H3.64981C2.21387 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V8.00005C14.9498 7.66868 14.6812 7.40005 14.3498 7.40005C14.0184 7.40005 13.7498 7.66868 13.7498 8.00005V9.23974L12.2385 8.1063C11.7252 7.72129 11.0068 7.7723 10.5531 8.22605L9.00869 9.77041L6.73916 7.8251C6.24387 7.40055 5.5095 7.41278 5.02864 7.85359L2.2498 10.4009V3.65005ZM2.2498 12.0287V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.7397L11.5186 9.06631C11.4829 9.03956 11.433 9.04314 11.4016 9.07458L9.92249 10.5537L11.1015 11.5642C11.3531 11.7799 11.3822 12.1587 11.1666 12.4103C10.9509 12.6619 10.5721 12.691 10.3205 12.4753L5.9582 8.7362C5.92384 8.70674 5.87288 8.70758 5.83952 8.73816L2.2498 12.0287Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M11.8097 1.14783C12.1411 1.14783 12.4097 1.41646 12.4097 1.74783V3.297H14.1541C14.4855 3.297 14.7541 3.56563 14.7541 3.897C14.7541 4.22837 14.4855 4.497 14.1541 4.497H12.4097V6.24167C12.4097 6.57304 12.1411 6.84167 11.8097 6.84167C11.4783 6.84167 11.2097 6.57304 11.2097 6.24167V4.497H9.6603C9.32893 4.497 9.0603 4.22837 9.0603 3.897C9.0603 3.56563 9.32893 3.297 9.6603 3.297H11.2097V1.74783C11.2097 1.41646 11.4783 1.14783 11.8097 1.14783Z" } }] }, vn = gn(function(i, e) {
64
+ return fn(hn, Object.assign({}, i, {
65
65
  id: "add-image-single",
66
66
  ref: e,
67
- icon: Ki
67
+ icon: Yi
68
68
  }));
69
69
  });
70
- mn.displayName = "AddImageSingle";
70
+ vn.displayName = "AddImageSingle";
71
71
  const bt = {
72
72
  id: "doc.command.remove-doc-image",
73
73
  type: q.COMMAND,
@@ -77,7 +77,7 @@ const bt = {
77
77
  const t = i.get(G), n = i.get(z), r = i.get(Q), s = n.getCurrentUniverDocInstance();
78
78
  if (e == null || s == null)
79
79
  return !1;
80
- const o = r.getRenderById(e.unitId).with(xe), { drawings: c } = e, d = (C = o.getSegment()) != null ? C : "", a = new Dt(), l = $.getInstance(), g = (E = (M = s.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : M.customBlocks) != null ? E : [], u = c.map((N) => g.find((I) => I.blockId === N.drawingId)).filter((N) => !!N).sort((N, I) => N.startIndex > I.startIndex ? 1 : -1), h = c[0].unitId, f = new jn();
80
+ const o = r.getRenderById(e.unitId).with(xe), { drawings: c } = e, d = (C = o.getSegment()) != null ? C : "", a = new Dt(), l = $.getInstance(), g = (E = (M = s.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : M.customBlocks) != null ? E : [], u = c.map((N) => g.find((I) => I.blockId === N.drawingId)).filter((N) => !!N).sort((N, I) => N.startIndex > I.startIndex ? 1 : -1), h = c[0].unitId, f = new Wn();
81
81
  f.reset();
82
82
  const p = u[0].startIndex, v = [
83
83
  {
@@ -110,7 +110,7 @@ const bt = {
110
110
  }
111
111
  return w.params.actions = y.reduce((N, I) => $.compose(N, I), null), !!t.syncExecuteCommand(w.id, w.params);
112
112
  }
113
- }, vn = {
113
+ }, pn = {
114
114
  id: "doc.command.delete-drawing",
115
115
  type: q.COMMAND,
116
116
  handler: (i) => {
@@ -131,7 +131,7 @@ const bt = {
131
131
  drawings: s
132
132
  });
133
133
  }
134
- }, pn = {
134
+ }, wn = {
135
135
  id: "doc.command.group-doc-image",
136
136
  type: q.COMMAND,
137
137
  handler: (i, e) => {
@@ -169,9 +169,9 @@ const bt = {
169
169
  len: l
170
170
  });
171
171
  else {
172
- const I = Wn.selection.delete([s], u, 0, null, !1);
172
+ const I = Hn.selection.delete([s], u, 0, null, !1);
173
173
  h.push(...I);
174
- const P = xi(u, [s]), W = (U = o.getDrawings()) != null ? U : {}, A = (N = o.getDrawingsOrder()) != null ? N : [], H = P.sort((_, S) => A.indexOf(_) > A.indexOf(S) ? -1 : A.indexOf(_) < A.indexOf(S) ? 1 : 0);
174
+ const P = Ni(u, [s]), W = (U = o.getDrawings()) != null ? U : {}, A = (N = o.getDrawingsOrder()) != null ? N : [], H = P.sort((_, S) => A.indexOf(_) > A.indexOf(S) ? -1 : A.indexOf(_) < A.indexOf(S) ? 1 : 0);
175
175
  if (H.length > 0)
176
176
  for (const _ of H) {
177
177
  const S = W[_], x = A.indexOf(_);
@@ -208,7 +208,7 @@ const bt = {
208
208
  };
209
209
  return O.params.actions = p.reduce((I, P) => $.compose(I, P), null), !!t.syncExecuteCommand(O.id, O.params);
210
210
  }
211
- }, wn = {
211
+ }, In = {
212
212
  id: "doc.command.set-drawing-arrange",
213
213
  type: q.COMMAND,
214
214
  handler: (i, e) => {
@@ -235,7 +235,7 @@ const bt = {
235
235
  };
236
236
  return h.params.actions = g.reduce((p, v) => $.compose(p, v), null), !!t.syncExecuteCommand(h.id, h.params);
237
237
  }
238
- }, In = {
238
+ }, _n = {
239
239
  id: "doc.command.ungroup-doc-image",
240
240
  type: q.COMMAND,
241
241
  handler: (i, e) => {
@@ -261,8 +261,8 @@ class ht {
261
261
  this._refreshDrawings$.next(e);
262
262
  }
263
263
  }
264
- var Yi = Object.getOwnPropertyDescriptor, Zi = (i, e, t, n) => {
265
- for (var r = n > 1 ? void 0 : n ? Yi(e, t) : e, s = i.length - 1, o; s >= 0; s--)
264
+ var Zi = Object.getOwnPropertyDescriptor, Qi = (i, e, t, n) => {
265
+ for (var r = n > 1 ? void 0 : n ? Zi(e, t) : e, s = i.length - 1, o; s >= 0; s--)
266
266
  (o = i[s]) && (r = o(r) || r);
267
267
  return r;
268
268
  }, ge = (i, e) => (t, n) => e(t, n, i);
@@ -273,7 +273,7 @@ let st = class extends Ue {
273
273
  async insertDocImage() {
274
274
  const i = await this._fileOpenerService.openFile({
275
275
  multiple: !0,
276
- accept: ii.map((t) => `.${t.replace("image/", "")}`).join(",")
276
+ accept: ri.map((t) => `.${t.replace("image/", "")}`).join(",")
277
277
  }), e = i.length;
278
278
  return e > At ? (this._messageService.show({
279
279
  type: Wt.Error,
@@ -290,7 +290,7 @@ let st = class extends Ue {
290
290
  let o = "";
291
291
  switch (s) {
292
292
  case wt.ERROR_EXCEED_SIZE:
293
- o = this._localeService.t("update-status.exceedMaxSize", String(ri / (1024 * 1024)));
293
+ o = this._localeService.t("update-status.exceedMaxSize", String(si / (1024 * 1024)));
294
294
  break;
295
295
  case wt.ERROR_IMAGE_TYPE:
296
296
  o = this._localeService.t("update-status.invalidImageType");
@@ -310,7 +310,7 @@ let st = class extends Ue {
310
310
  for (const r of e) {
311
311
  if (r == null)
312
312
  continue;
313
- const { imageId: s, imageSourceType: o, source: c, base64Cache: d } = r, { width: a, height: l, image: g } = await si(d || "");
313
+ const { imageId: s, imageSourceType: o, source: c, base64Cache: d } = r, { width: a, height: l, image: g } = await oi(d || "");
314
314
  this._imageIoService.addImageSourceCache(s, o, g);
315
315
  let u = 1;
316
316
  if (a > Pt || l > Lt) {
@@ -329,10 +329,10 @@ let st = class extends Ue {
329
329
  source: c,
330
330
  transform: an(h),
331
331
  docTransform: h,
332
- behindDoc: se.FALSE,
332
+ behindDoc: oe.FALSE,
333
333
  title: "",
334
334
  description: "",
335
- layoutType: F.INLINE,
335
+ layoutType: k.INLINE,
336
336
  // Insert inline drawing by default.
337
337
  wrapText: qe.BOTH_SIDES,
338
338
  distB: 0,
@@ -340,7 +340,7 @@ let st = class extends Ue {
340
340
  distR: 0,
341
341
  distT: 0
342
342
  };
343
- this._isInsertInHeaderFooter() && (f.isMultiTransform = se.TRUE, f.transforms = f.transform ? [f.transform] : null), n.push(f);
343
+ this._isInsertInHeaderFooter() && (f.isMultiTransform = oe.TRUE, f.transforms = f.transform ? [f.transform] : null), n.push(f);
344
344
  }
345
345
  this._commandService.executeCommand(Ct.id, {
346
346
  unitId: t,
@@ -349,7 +349,7 @@ let st = class extends Ue {
349
349
  }
350
350
  _isInsertInHeaderFooter() {
351
351
  var n;
352
- const { unitId: i } = this._context, e = (n = this._renderManagerSrv.getRenderById(i)) == null ? void 0 : n.with(te).getViewModel(), t = e == null ? void 0 : e.getEditArea();
352
+ const { unitId: i } = this._context, e = (n = this._renderManagerSrv.getRenderById(i)) == null ? void 0 : n.with(ne).getViewModel(), t = e == null ? void 0 : e.getEditArea();
353
353
  return t === We.HEADER || t === We.FOOTER;
354
354
  }
355
355
  _getImagePosition(i, e) {
@@ -375,7 +375,7 @@ let st = class extends Ue {
375
375
  _updateOrderListener() {
376
376
  this._drawingManagerService.featurePluginOrderUpdate$.subscribe((i) => {
377
377
  const { unitId: e, subUnitId: t, drawingIds: n, arrangeType: r } = i;
378
- this._commandService.executeCommand(wn.id, {
378
+ this._commandService.executeCommand(In.id, {
379
379
  unitId: e,
380
380
  subUnitId: t,
381
381
  drawingIds: n,
@@ -385,9 +385,9 @@ let st = class extends Ue {
385
385
  }
386
386
  _groupDrawingListener() {
387
387
  this._drawingManagerService.featurePluginGroupUpdate$.subscribe((i) => {
388
- this._commandService.executeCommand(pn.id, i);
388
+ this._commandService.executeCommand(wn.id, i);
389
389
  }), this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((i) => {
390
- this._commandService.executeCommand(In.id, i);
390
+ this._commandService.executeCommand(_n.id, i);
391
391
  });
392
392
  }
393
393
  _getCurrentSceneAndTransformer() {
@@ -400,7 +400,7 @@ let st = class extends Ue {
400
400
  _transformDrawingListener() {
401
401
  const i = this._getCurrentSceneAndTransformer();
402
402
  if (i && i.transformer)
403
- this.disposeWithMe(i.transformer.changeEnd$.pipe(ln(30)).subscribe((e) => {
403
+ this.disposeWithMe(i.transformer.changeEnd$.pipe(un(30)).subscribe((e) => {
404
404
  this._docSelectionManagerService.refreshSelection();
405
405
  }));
406
406
  else
@@ -443,12 +443,12 @@ let st = class extends Ue {
443
443
  // Update drawings edit status and opacity. You can not edit header footer images when you are editing body. and vice verse.
444
444
  _updateDrawingsEditStatus() {
445
445
  var c;
446
- const { unit: i, scene: e, unitId: t } = this._context, n = (c = this._renderManagerSrv.getRenderById(t)) == null ? void 0 : c.with(te).getViewModel();
446
+ const { unit: i, scene: e, unitId: t } = this._context, n = (c = this._renderManagerSrv.getRenderById(t)) == null ? void 0 : c.with(ne).getViewModel();
447
447
  if (n == null || i == null)
448
448
  return;
449
449
  const r = i.getSnapshot(), { drawings: s = {} } = r, o = n.getEditArea() === We.BODY;
450
450
  for (const d of Object.keys(s)) {
451
- const a = s[d], l = oi({ unitId: t, drawingId: a.drawingId, subUnitId: t }), g = e.fuzzyMathObjects(l, !0);
451
+ const a = s[d], l = ai({ unitId: t, drawingId: a.drawingId, subUnitId: t }), g = e.fuzzyMathObjects(l, !0);
452
452
  if (g.length)
453
453
  for (const u of g) {
454
454
  e.detachTransformerFrom(u);
@@ -456,7 +456,7 @@ let st = class extends Ue {
456
456
  u.setOpacity(0.5);
457
457
  } catch {
458
458
  }
459
- if (o && a.isMultiTransform !== se.TRUE || !o && a.isMultiTransform === se.TRUE) {
459
+ if (o && a.isMultiTransform !== oe.TRUE || !o && a.isMultiTransform === oe.TRUE) {
460
460
  a.allowTransform !== !1 && e.attachTransformerTo(u);
461
461
  try {
462
462
  u.setOpacity(1);
@@ -468,7 +468,7 @@ let st = class extends Ue {
468
468
  }
469
469
  _editAreaChangeListener() {
470
470
  var t;
471
- const { unitId: i } = this._context, e = (t = this._renderManagerSrv.getRenderById(i)) == null ? void 0 : t.with(te).getViewModel();
471
+ const { unitId: i } = this._context, e = (t = this._renderManagerSrv.getRenderById(i)) == null ? void 0 : t.with(ne).getViewModel();
472
472
  e != null && (this._updateDrawingsEditStatus(), this.disposeWithMe(
473
473
  e.editAreaChange$.subscribe(() => {
474
474
  this._updateDrawingsEditStatus();
@@ -494,38 +494,38 @@ let st = class extends Ue {
494
494
  this._docSelectionManagerService.replaceDocRanges(n);
495
495
  }
496
496
  };
497
- st = Zi([
497
+ st = Qi([
498
498
  ge(1, G),
499
499
  ge(2, Z(Ot)),
500
500
  ge(3, Q),
501
- ge(4, ni),
501
+ ge(4, ii),
502
502
  ge(5, Be),
503
503
  ge(6, ve),
504
504
  ge(7, Qt),
505
- ge(8, Ii),
505
+ ge(8, _i),
506
506
  ge(9, Z(ft)),
507
507
  ge(10, Z(xe)),
508
508
  ge(11, Z(ht)),
509
- ge(12, _i)
509
+ ge(12, Si)
510
510
  ], st);
511
- const _n = {
511
+ const Sn = {
512
512
  id: "doc.command.insert-float-image",
513
513
  type: q.COMMAND,
514
514
  handler: (i) => {
515
515
  var n, r;
516
516
  const e = i.get(z), t = i.get(Q);
517
- return (r = (n = hi(Ie.UNIVER_DOC, e, t)) == null ? void 0 : n.with(st).insertDocImage()) != null ? r : !1;
517
+ return (r = (n = mi(Ie.UNIVER_DOC, e, t)) == null ? void 0 : n.with(st).insertDocImage()) != null ? r : !1;
518
518
  }
519
519
  };
520
520
  var fe = /* @__PURE__ */ ((i) => (i.INLINE = "inline", i.BEHIND_TEXT = "behindText", i.IN_FRONT_OF_TEXT = "inFrontOfText", i.WRAP_SQUARE = "wrapSquare", i.WRAP_TOP_AND_BOTTOM = "wrapTopAndBottom", i))(fe || {});
521
- const Qi = {
522
- inline: F.INLINE,
523
- wrapSquare: F.WRAP_SQUARE,
524
- wrapTopAndBottom: F.WRAP_TOP_AND_BOTTOM,
525
- inFrontOfText: F.WRAP_NONE,
526
- behindText: F.WRAP_NONE
521
+ const Ji = {
522
+ inline: k.INLINE,
523
+ wrapSquare: k.WRAP_SQUARE,
524
+ wrapTopAndBottom: k.WRAP_TOP_AND_BOTTOM,
525
+ inFrontOfText: k.WRAP_NONE,
526
+ behindText: k.WRAP_NONE
527
527
  };
528
- function Sn(i, e, t, n, r, s, o) {
528
+ function Dn(i, e, t, n, r, s, o) {
529
529
  var h, f;
530
530
  const c = new Dt(), d = $.getInstance(), a = [], l = s.getSelfOrHeaderFooterModel(e).getBody(), g = s.getSelfOrHeaderFooterModel(i).getBody();
531
531
  if (l == null || g == null)
@@ -602,7 +602,7 @@ function Sn(i, e, t, n, r, s, o) {
602
602
  return a;
603
603
  }
604
604
  }
605
- const Dn = {
605
+ const yn = {
606
606
  id: "doc.command.update-doc-drawing-wrapping-style",
607
607
  type: q.COMMAND,
608
608
  // eslint-disable-next-line max-lines-per-function, complexity
@@ -610,18 +610,18 @@ const Dn = {
610
610
  var E, U;
611
611
  if (e == null)
612
612
  return !1;
613
- const { drawings: t, wrappingStyle: n, unitId: r } = e, s = i.get(G), o = i.get(z), d = i.get(Q).getRenderById(r), a = d == null ? void 0 : d.with(te).getSkeleton().getSkeletonData(), l = d == null ? void 0 : d.with(te).getViewModel(), g = d == null ? void 0 : d.scene, u = o.getCurrentUniverDocInstance();
613
+ const { drawings: t, wrappingStyle: n, unitId: r } = e, s = i.get(G), o = i.get(z), d = i.get(Q).getRenderById(r), a = d == null ? void 0 : d.with(ne).getSkeleton().getSkeletonData(), l = d == null ? void 0 : d.with(ne).getViewModel(), g = d == null ? void 0 : d.scene, u = o.getCurrentUniverDocInstance();
614
614
  if (u == null || a == null || g == null || l == null)
615
615
  return !1;
616
616
  const h = l.getEditArea(), f = g.getTransformerByCreate(), { pages: p, skeHeaders: v, skeFooters: w } = a, y = $.getInstance(), D = [], { drawings: O = {} } = u.getSnapshot();
617
617
  for (const N of t) {
618
- const { drawingId: I } = N, P = O[I].layoutType, W = Qi[n];
618
+ const { drawingId: I } = N, P = O[I].layoutType, W = Ji[n];
619
619
  if (P !== W) {
620
620
  const S = y.replaceOp(["drawings", I, "layoutType"], P, W);
621
621
  D.push(S);
622
622
  }
623
623
  if (n === "behindText" || n === "inFrontOfText") {
624
- const S = O[I].behindDoc, x = n === "behindText" ? se.TRUE : se.FALSE;
624
+ const S = O[I].behindDoc, x = n === "behindText" ? oe.TRUE : oe.FALSE;
625
625
  if (S !== x) {
626
626
  const T = y.replaceOp(["drawings", I, "behindDoc"], S, x);
627
627
  D.push(T);
@@ -634,13 +634,13 @@ const Dn = {
634
634
  const { headerId: x, footerId: T, marginTop: L, marginLeft: B, marginBottom: b, pageWidth: R, pageHeight: V } = S;
635
635
  switch (h) {
636
636
  case We.HEADER: {
637
- const k = (E = v.get(x)) == null ? void 0 : E.get(R);
638
- k != null && k.skeDrawings.has(I) && (A = k.skeDrawings.get(I), H = k.marginTop, _ = B);
637
+ const F = (E = v.get(x)) == null ? void 0 : E.get(R);
638
+ F != null && F.skeDrawings.has(I) && (A = F.skeDrawings.get(I), H = F.marginTop, _ = B);
639
639
  break;
640
640
  }
641
641
  case We.FOOTER: {
642
- const k = (U = w.get(T)) == null ? void 0 : U.get(R);
643
- k != null && k.skeDrawings.has(I) && (A = k.skeDrawings.get(I), H = V - b + k.marginTop, _ = B);
642
+ const F = (U = w.get(T)) == null ? void 0 : U.get(R);
643
+ F != null && F.skeDrawings.has(I) && (A = F.skeDrawings.get(I), H = V - b + F.marginTop, _ = B);
644
644
  break;
645
645
  }
646
646
  case We.BODY: {
@@ -660,8 +660,8 @@ const Dn = {
660
660
  posOffset: L
661
661
  };
662
662
  if (T.posOffset !== B.posOffset) {
663
- const k = y.replaceOp(["drawings", I, "docTransform", "positionH"], T, B);
664
- D.push(k);
663
+ const F = y.replaceOp(["drawings", I, "docTransform", "positionH"], T, B);
664
+ D.push(F);
665
665
  }
666
666
  const b = O[I].docTransform.positionV;
667
667
  let R = S;
@@ -671,8 +671,8 @@ const Dn = {
671
671
  posOffset: R
672
672
  };
673
673
  if (b.posOffset !== V.posOffset) {
674
- const k = y.replaceOp(["drawings", I, "docTransform", "positionV"], b, V);
675
- D.push(k);
674
+ const F = y.replaceOp(["drawings", I, "docTransform", "positionV"], b, V);
675
+ D.push(F);
676
676
  }
677
677
  }
678
678
  }
@@ -688,7 +688,7 @@ const Dn = {
688
688
  const M = s.syncExecuteCommand(C.id, C.params);
689
689
  return f.refreshControls(), !!M;
690
690
  }
691
- }, yn = {
691
+ }, On = {
692
692
  id: "doc.command.update-doc-drawing-distance",
693
693
  type: q.COMMAND,
694
694
  handler: (i, e) => {
@@ -718,7 +718,7 @@ const Dn = {
718
718
  };
719
719
  return g.params.actions = a.reduce((h, f) => $.compose(h, f), null), !!t.syncExecuteCommand(g.id, g.params);
720
720
  }
721
- }, On = {
721
+ }, Tn = {
722
722
  id: "doc.command.update-doc-drawing-wrap-text",
723
723
  type: q.COMMAND,
724
724
  handler: (i, e) => {
@@ -778,14 +778,14 @@ const Dn = {
778
778
  const p = t.syncExecuteCommand(f.id, f.params);
779
779
  return c.refreshControls(), !!p;
780
780
  }
781
- }, Tn = {
781
+ }, Mn = {
782
782
  id: "doc.command.move-inline-drawing",
783
783
  type: q.COMMAND,
784
784
  handler: (i, e) => {
785
785
  var U, N;
786
786
  if (e == null)
787
787
  return !1;
788
- const t = i.get(Q), n = (U = t.getRenderById(e.unitId)) == null ? void 0 : U.with(xe), r = i.get(ht), s = t.getRenderById(e.unitId), o = s == null ? void 0 : s.scene, c = s == null ? void 0 : s.with(te).getSkeleton();
788
+ const t = i.get(Q), n = (U = t.getRenderById(e.unitId)) == null ? void 0 : U.with(xe), r = i.get(ht), s = t.getRenderById(e.unitId), o = s == null ? void 0 : s.scene, c = s == null ? void 0 : s.with(ne).getSkeleton();
789
789
  if (o == null || n == null)
790
790
  return !1;
791
791
  const d = o.getTransformerByCreate(), a = i.get(G), g = i.get(z).getCurrentUniverDocInstance();
@@ -794,7 +794,7 @@ const Dn = {
794
794
  const { drawing: u, unitId: h, offset: f, segmentId: p, segmentPage: v, needRefreshDrawings: w } = e;
795
795
  if (w)
796
796
  return r.refreshDrawings(c), d.refreshControls(), !0;
797
- const y = [], { drawingId: D } = u, O = (N = n.getSegment()) != null ? N : "", C = Sn(
797
+ const y = [], { drawingId: D } = u, O = (N = n.getSegment()) != null ? N : "", C = Dn(
798
798
  p,
799
799
  O,
800
800
  v,
@@ -818,7 +818,7 @@ const Dn = {
818
818
  const E = a.syncExecuteCommand(M.id, M.params);
819
819
  return d.refreshControls(), !!E;
820
820
  }
821
- }, Mn = {
821
+ }, bn = {
822
822
  id: "doc.command.transform-non-inline-drawing",
823
823
  type: q.COMMAND,
824
824
  // eslint-disable-next-line max-lines-per-function
@@ -832,7 +832,7 @@ const Dn = {
832
832
  const o = s.getTransformerByCreate(), c = i.get(G), a = i.get(z).getCurrentUniverDocInstance();
833
833
  if (a == null)
834
834
  return !1;
835
- const { drawing: l, unitId: g, offset: u, docTransform: h, segmentId: f, segmentPage: p } = e, v = [], { drawingId: w } = l, y = (H = n.getSegment()) != null ? H : "", D = Sn(
835
+ const { drawing: l, unitId: g, offset: u, docTransform: h, segmentId: f, segmentPage: p } = e, v = [], { drawingId: w } = l, y = (H = n.getSegment()) != null ? H : "", D = Dn(
836
836
  f,
837
837
  y,
838
838
  p,
@@ -887,7 +887,7 @@ const Dn = {
887
887
  const g = l.getTransformerByCreate(), u = r.getUniverDocInstance(d), h = c.map((p) => {
888
888
  var M, E, U, N, I;
889
889
  const { drawingId: v } = p, w = (M = u == null ? void 0 : u.getSnapshot().drawings) == null ? void 0 : M[v];
890
- if (w == null || w.layoutType === F.INLINE)
890
+ if (w == null || w.layoutType === k.INLINE)
891
891
  return null;
892
892
  const { positionH: y, positionV: D } = w.docTransform, O = { ...y }, C = { ...D };
893
893
  return o === he.UP ? C.posOffset = ((E = C.posOffset) != null ? E : 0) - 2 : o === he.DOWN ? C.posOffset = ((U = C.posOffset) != null ? U : 0) + 2 : o === he.LEFT ? O.posOffset = ((N = O.posOffset) != null ? N : 0) - 2 : o === he.RIGHT && (O.posOffset = ((I = O.posOffset) != null ? I : 0) + 2), {
@@ -905,7 +905,7 @@ const Dn = {
905
905
  });
906
906
  return g.refreshControls(), !!f;
907
907
  }
908
- }, Ji = {
908
+ }, er = {
909
909
  id: "doc.operation.clear-drawing-transformer",
910
910
  type: q.MUTATION,
911
911
  handler: (i, e) => {
@@ -915,16 +915,16 @@ const Dn = {
915
915
  (s = (r = t.getRenderById(n)) == null ? void 0 : r.scene.getTransformer()) == null || s.debounceRefreshControls();
916
916
  }), !0;
917
917
  }
918
- }, bn = "COMPONENT_DOC_DRAWING_PANEL", Cn = {
918
+ }, Cn = "COMPONENT_DOC_DRAWING_PANEL", xn = {
919
919
  id: "sidebar.operation.doc-image",
920
920
  type: q.COMMAND,
921
921
  handler: async (i, e) => {
922
- const t = i.get(Si), n = i.get(ft), r = i.get(ve);
922
+ const t = i.get(Di), n = i.get(ft), r = i.get(ve);
923
923
  switch (e.value) {
924
924
  case "open":
925
925
  t.open({
926
926
  header: { title: n.t("docImage.panel.title") },
927
- children: { label: bn },
927
+ children: { label: Cn },
928
928
  onClose: () => {
929
929
  r.focusDrawing(null);
930
930
  },
@@ -938,14 +938,14 @@ const Dn = {
938
938
  }
939
939
  return !0;
940
940
  }
941
- }, xn = {
941
+ }, Nn = {
942
942
  id: "doc.operation.edit-doc-image",
943
943
  type: q.OPERATION,
944
944
  handler: (i, e) => {
945
945
  const t = i.get(ve), n = i.get(G);
946
- return e == null ? !1 : (t.focusDrawing([e]), n.executeCommand(Cn.id, { value: "open" }), !0);
946
+ return e == null ? !1 : (t.focusDrawing([e]), n.executeCommand(xn.id, { value: "open" }), !0);
947
947
  }
948
- }, qt = -1e3, Kt = 1e3, er = (i) => {
948
+ }, qt = -1e3, Kt = 1e3, tr = (i) => {
949
949
  const e = we(G), t = we(ft), n = we(ve), r = we(Q), s = we(z), { drawings: o } = i, c = o[0];
950
950
  if (c == null)
951
951
  return;
@@ -976,13 +976,13 @@ const Dn = {
976
976
  }, {
977
977
  label: t.t("image-position.paragraph"),
978
978
  value: String(j.PARAGRAPH)
979
- }], [v, w] = re(!0), [y, D] = re({
979
+ }], [v, w] = se(!0), [y, D] = se({
980
980
  relativeFrom: J.PAGE,
981
981
  posOffset: 0
982
- }), [O, C] = re({
982
+ }), [O, C] = se({
983
983
  relativeFrom: j.PAGE,
984
984
  posOffset: 0
985
- }), [M, E] = re(!0), [U, N] = re(!0);
985
+ }), [M, E] = se(!0), [U, N] = se(!0);
986
986
  function I(S, x) {
987
987
  var b;
988
988
  S === "positionH" ? D(x) : C(x);
@@ -1007,7 +1007,7 @@ const Dn = {
1007
1007
  B && B.blur(), h.refreshControls();
1008
1008
  }
1009
1009
  function P(S) {
1010
- var ie, Se, De;
1010
+ var re, Se, De;
1011
1011
  const x = y.relativeFrom, T = y.posOffset, L = Number(S);
1012
1012
  if (x === L)
1013
1013
  return;
@@ -1015,57 +1015,57 @@ const Dn = {
1015
1015
  if (B.length === 0)
1016
1016
  return;
1017
1017
  const b = B[0].drawingId, R = B[0].unitId;
1018
- let V = null, k = 0;
1019
- const K = (ie = r.getRenderById(R)) == null ? void 0 : ie.with(te).getSkeleton(), oe = K == null ? void 0 : K.getSkeletonData();
1020
- if (oe == null)
1018
+ let V = null, F = 0;
1019
+ const K = (re = r.getRenderById(R)) == null ? void 0 : re.with(ne).getSkeleton(), ae = K == null ? void 0 : K.getSkeletonData();
1020
+ if (ae == null)
1021
1021
  return;
1022
- const { pages: ke, skeHeaders: Ne, skeFooters: Ge } = oe;
1023
- for (const ce of ke) {
1024
- const { marginLeft: Oe, skeDrawings: Te, headerId: Ee, footerId: Re, pageWidth: Me } = ce;
1022
+ const { pages: Fe, skeHeaders: Ne, skeFooters: Ge } = ae;
1023
+ for (const de of Fe) {
1024
+ const { marginLeft: Oe, skeDrawings: Te, headerId: Ee, footerId: Re, pageWidth: Me } = de;
1025
1025
  if (Te.has(b)) {
1026
- V = Te.get(b), k = Oe;
1026
+ V = Te.get(b), F = Oe;
1027
1027
  break;
1028
1028
  }
1029
- const de = (Se = Ne.get(Ee)) == null ? void 0 : Se.get(Me);
1030
- if (de != null && de.skeDrawings.has(b)) {
1031
- V = de == null ? void 0 : de.skeDrawings.get(b), k = Oe;
1029
+ const le = (Se = Ne.get(Ee)) == null ? void 0 : Se.get(Me);
1030
+ if (le != null && le.skeDrawings.has(b)) {
1031
+ V = le == null ? void 0 : le.skeDrawings.get(b), F = Oe;
1032
1032
  break;
1033
1033
  }
1034
- const le = (De = Ge.get(Re)) == null ? void 0 : De.get(Me);
1035
- if (le != null && le.skeDrawings.has(b)) {
1036
- V = le == null ? void 0 : le.skeDrawings.get(b), k = Oe;
1034
+ const ue = (De = Ge.get(Re)) == null ? void 0 : De.get(Me);
1035
+ if (ue != null && ue.skeDrawings.has(b)) {
1036
+ V = ue == null ? void 0 : ue.skeDrawings.get(b), F = Oe;
1037
1037
  break;
1038
1038
  }
1039
1039
  }
1040
1040
  if (V == null)
1041
1041
  return;
1042
- let ae = 0;
1043
- x === J.COLUMN ? ae -= V.columnLeft : x === J.MARGIN && (ae -= k), L === J.COLUMN ? ae += V.columnLeft : L === J.MARGIN ? ae += k : J.PAGE;
1044
- const ne = {
1042
+ let ce = 0;
1043
+ x === J.COLUMN ? ce -= V.columnLeft : x === J.MARGIN && (ce -= F), L === J.COLUMN ? ce += V.columnLeft : L === J.MARGIN ? ce += F : J.PAGE;
1044
+ const ie = {
1045
1045
  relativeFrom: L,
1046
- posOffset: (T != null ? T : 0) - ae
1046
+ posOffset: (T != null ? T : 0) - ce
1047
1047
  };
1048
- I("positionH", ne);
1048
+ I("positionH", ie);
1049
1049
  }
1050
1050
  function W(S) {
1051
- var Te, Ee, Re, Me, de, le;
1051
+ var Te, Ee, Re, Me, le, ue;
1052
1052
  const x = O.relativeFrom, T = O.posOffset, L = Number(S);
1053
1053
  if (x === L)
1054
1054
  return;
1055
1055
  const B = n.getFocusDrawings();
1056
1056
  if (B.length === 0)
1057
1057
  return;
1058
- const { drawingId: b, unitId: R } = B[0], V = s.getUniverDocInstance(R), k = (Te = r.getRenderById(R)) == null ? void 0 : Te.with(te).getSkeleton(), K = (Ee = r.getRenderById(R)) == null ? void 0 : Ee.with(xe), oe = K == null ? void 0 : K.getSegment(), ke = K == null ? void 0 : K.getSegmentPage(), Ne = (Me = (Re = V == null ? void 0 : V.getSelfOrHeaderFooterModel(oe).getBody()) == null ? void 0 : Re.customBlocks) == null ? void 0 : Me.find((Ae) => Ae.blockId === b);
1059
- if (Ne == null || k == null || K == null)
1058
+ const { drawingId: b, unitId: R } = B[0], V = s.getUniverDocInstance(R), F = (Te = r.getRenderById(R)) == null ? void 0 : Te.with(ne).getSkeleton(), K = (Ee = r.getRenderById(R)) == null ? void 0 : Ee.with(xe), ae = K == null ? void 0 : K.getSegment(), Fe = K == null ? void 0 : K.getSegmentPage(), Ne = (Me = (Re = V == null ? void 0 : V.getSelfOrHeaderFooterModel(ae).getBody()) == null ? void 0 : Re.customBlocks) == null ? void 0 : Me.find((Ae) => Ae.blockId === b);
1059
+ if (Ne == null || F == null || K == null)
1060
1060
  return;
1061
- const { startIndex: Ge } = Ne, ae = k.findNodeByCharIndex(Ge, oe, ke), ne = (de = ae == null ? void 0 : ae.parent) == null ? void 0 : de.parent, ie = ne == null ? void 0 : ne.parent, Se = ie == null ? void 0 : ie.lines.find((Ae) => Ae.paragraphIndex === (ne == null ? void 0 : ne.paragraphIndex) && Ae.paragraphStart), De = (le = ie == null ? void 0 : ie.parent) == null ? void 0 : le.parent;
1062
- if (ae == null || ne == null || Se == null || ie == null || De == null)
1061
+ const { startIndex: Ge } = Ne, ce = F.findNodeByCharIndex(Ge, ae, Fe), ie = (le = ce == null ? void 0 : ce.parent) == null ? void 0 : le.parent, re = ie == null ? void 0 : ie.parent, Se = re == null ? void 0 : re.lines.find((Ae) => Ae.paragraphIndex === (ie == null ? void 0 : ie.paragraphIndex) && Ae.paragraphStart), De = (ue = re == null ? void 0 : re.parent) == null ? void 0 : ue.parent;
1062
+ if (ce == null || ie == null || Se == null || re == null || De == null)
1063
1063
  return;
1064
- let ce = 0;
1065
- x === j.PARAGRAPH ? ce -= Se.top : x === j.LINE ? ce -= ne.top : x === j.PAGE && (ce += De.marginTop), L === j.PARAGRAPH ? ce += Se.top : L === j.LINE ? ce += ne.top : L === j.PAGE && (ce -= De.marginTop);
1064
+ let de = 0;
1065
+ x === j.PARAGRAPH ? de -= Se.top : x === j.LINE ? de -= ie.top : x === j.PAGE && (de += De.marginTop), L === j.PARAGRAPH ? de += Se.top : L === j.LINE ? de += ie.top : L === j.PAGE && (de -= De.marginTop);
1066
1066
  const Oe = {
1067
1067
  relativeFrom: L,
1068
- posOffset: (T != null ? T : 0) - ce
1068
+ posOffset: (T != null ? T : 0) - de
1069
1069
  };
1070
1070
  I("positionV", Oe);
1071
1071
  }
@@ -1078,7 +1078,7 @@ const Dn = {
1078
1078
  positionH: B,
1079
1079
  positionV: b
1080
1080
  } = T.docTransform;
1081
- D(B), C(b), w(L === F.INLINE), E(b.relativeFrom === j.PARAGRAPH || b.relativeFrom === j.LINE);
1081
+ D(B), C(b), w(L === k.INLINE), E(b.relativeFrom === j.PARAGRAPH || b.relativeFrom === j.LINE);
1082
1082
  }
1083
1083
  function H() {
1084
1084
  const S = n.getFocusDrawings();
@@ -1104,9 +1104,7 @@ const Dn = {
1104
1104
  }, []), /* @__PURE__ */ X(
1105
1105
  "div",
1106
1106
  {
1107
- className: `
1108
- univer-relative univer-mt-5 univer-w-full univer-border-t univer-border-solid univer-border-gray-200
1109
- `,
1107
+ className: te("univer-relative univer-mt-5 univer-w-full", ln),
1110
1108
  style: { display: U ? "block" : "none" },
1111
1109
  children: [
1112
1110
  /* @__PURE__ */ m(
@@ -1124,7 +1122,7 @@ const Dn = {
1124
1122
  className: `
1125
1123
  univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1126
1124
  `,
1127
- children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1 univer-text-black", children: /* @__PURE__ */ m("div", { children: t.t("image-position.horizontal") }) })
1125
+ children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1 univer-text-gray-900", children: /* @__PURE__ */ m("div", { children: t.t("image-position.horizontal") }) })
1128
1126
  }
1129
1127
  ),
1130
1128
  /* @__PURE__ */ X(
@@ -1210,7 +1208,7 @@ const Dn = {
1210
1208
  className: `
1211
1209
  univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1212
1210
  `,
1213
- children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1 univer-text-black", children: /* @__PURE__ */ m("div", { children: t.t("image-position.vertical") }) })
1211
+ children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1 univer-text-gray-900", children: /* @__PURE__ */ m("div", { children: t.t("image-position.vertical") }) })
1214
1212
  }
1215
1213
  ),
1216
1214
  /* @__PURE__ */ X(
@@ -1296,7 +1294,7 @@ const Dn = {
1296
1294
  className: `
1297
1295
  univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1298
1296
  `,
1299
- children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1 univer-text-black", children: /* @__PURE__ */ m("div", { children: t.t("image-position.options") }) })
1297
+ children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1 univer-text-gray-900", children: /* @__PURE__ */ m("div", { children: t.t("image-position.options") }) })
1300
1298
  }
1301
1299
  ),
1302
1300
  /* @__PURE__ */ m(
@@ -1306,25 +1304,25 @@ const Dn = {
1306
1304
  univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1307
1305
  `,
1308
1306
  style: { marginBottom: "50px" },
1309
- children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ m(Ui, { disabled: v, checked: M, onChange: _, children: t.t("image-position.moveObjectWithText") }) })
1307
+ children: /* @__PURE__ */ m("div", { className: "univer-flex univer-items-center univer-gap-1", children: /* @__PURE__ */ m(Bi, { disabled: v, checked: M, onChange: _, children: t.t("image-position.moveObjectWithText") }) })
1310
1308
  }
1311
1309
  )
1312
1310
  ]
1313
1311
  }
1314
1312
  );
1315
- }, et = 0, tt = 100, tr = (i) => {
1313
+ }, et = 0, tt = 100, nr = (i) => {
1316
1314
  const e = we(G), t = we(ft), n = we(ve), r = we(Q), s = we(z), { drawings: o } = i, c = o[0];
1317
1315
  if (c == null)
1318
1316
  return null;
1319
1317
  const { unitId: d } = c, a = s.getUniverDocInstance(d), l = r.getRenderById(d);
1320
1318
  if ((l == null ? void 0 : l.scene) == null)
1321
1319
  return null;
1322
- const [u, h] = re(!0), [f, p] = re(!0), [v, w] = re(!0), [y, D] = re(fe.INLINE), [O, C] = re(""), [M, E] = re({
1320
+ const [u, h] = se(!0), [f, p] = se(!0), [v, w] = se(!0), [y, D] = se(fe.INLINE), [O, C] = se(""), [M, E] = se({
1323
1321
  distT: 0,
1324
1322
  distL: 0,
1325
1323
  distB: 0,
1326
1324
  distR: 0
1327
- }), [U, N] = re(!0);
1325
+ }), [U, N] = se(!0);
1328
1326
  function I(_) {
1329
1327
  D(_);
1330
1328
  const S = n.getFocusDrawings();
@@ -1335,7 +1333,7 @@ const Dn = {
1335
1333
  subUnitId: b,
1336
1334
  drawingId: R
1337
1335
  }));
1338
- e.executeCommand(Dn.id, {
1336
+ e.executeCommand(yn.id, {
1339
1337
  unitId: x,
1340
1338
  subUnitId: T,
1341
1339
  drawings: L,
@@ -1352,7 +1350,7 @@ const Dn = {
1352
1350
  subUnitId: T.subUnitId,
1353
1351
  drawingId: T.drawingId
1354
1352
  }));
1355
- e.executeCommand(On.id, {
1353
+ e.executeCommand(Tn.id, {
1356
1354
  unitId: S[0].unitId,
1357
1355
  subUnitId: S[0].unitId,
1358
1356
  drawings: x,
@@ -1372,7 +1370,7 @@ const Dn = {
1372
1370
  subUnitId: B.subUnitId,
1373
1371
  drawingId: B.drawingId
1374
1372
  }));
1375
- e.executeCommand(yn.id, {
1373
+ e.executeCommand(On.id, {
1376
1374
  unitId: T[0].unitId,
1377
1375
  subUnitId: T[0].unitId,
1378
1376
  drawings: L,
@@ -1386,8 +1384,8 @@ const Dn = {
1386
1384
  _.length !== 0 && H(_[0]);
1387
1385
  }
1388
1386
  function H(_) {
1389
- var K, oe;
1390
- const S = (oe = (K = a == null ? void 0 : a.getSnapshot()) == null ? void 0 : K.drawings) == null ? void 0 : oe[_.drawingId];
1387
+ var K, ae;
1388
+ const S = (ae = (K = a == null ? void 0 : a.getSnapshot()) == null ? void 0 : K.drawings) == null ? void 0 : ae[_.drawingId];
1391
1389
  if (S == null)
1392
1390
  return;
1393
1391
  const {
@@ -1395,8 +1393,8 @@ const Dn = {
1395
1393
  distL: T = 0,
1396
1394
  distB: L = 0,
1397
1395
  distR: B = 0,
1398
- layoutType: b = F.INLINE,
1399
- behindDoc: R = se.FALSE,
1396
+ layoutType: b = k.INLINE,
1397
+ behindDoc: R = oe.FALSE,
1400
1398
  wrapText: V = qe.BOTH_SIDES
1401
1399
  } = S;
1402
1400
  if (E({
@@ -1404,17 +1402,17 @@ const Dn = {
1404
1402
  distL: T,
1405
1403
  distB: L,
1406
1404
  distR: B
1407
- }), C(V), h(b !== F.WRAP_SQUARE), b === F.WRAP_NONE || b === F.INLINE ? p(!0) : p(!1), b === F.WRAP_NONE || b === F.INLINE || b === F.WRAP_TOP_AND_BOTTOM ? w(!0) : w(!1), b === F.WRAP_NONE)
1408
- R === se.TRUE ? D(fe.BEHIND_TEXT) : D(fe.IN_FRONT_OF_TEXT);
1405
+ }), C(V), h(b !== k.WRAP_SQUARE), b === k.WRAP_NONE || b === k.INLINE ? p(!0) : p(!1), b === k.WRAP_NONE || b === k.INLINE || b === k.WRAP_TOP_AND_BOTTOM ? w(!0) : w(!1), b === k.WRAP_NONE)
1406
+ R === oe.TRUE ? D(fe.BEHIND_TEXT) : D(fe.IN_FRONT_OF_TEXT);
1409
1407
  else
1410
1408
  switch (b) {
1411
- case F.INLINE:
1409
+ case k.INLINE:
1412
1410
  D(fe.INLINE);
1413
1411
  break;
1414
- case F.WRAP_SQUARE:
1412
+ case k.WRAP_SQUARE:
1415
1413
  D(fe.WRAP_SQUARE);
1416
1414
  break;
1417
- case F.WRAP_TOP_AND_BOTTOM:
1415
+ case k.WRAP_TOP_AND_BOTTOM:
1418
1416
  D(fe.WRAP_TOP_AND_BOTTOM);
1419
1417
  break;
1420
1418
  default:
@@ -1438,10 +1436,9 @@ const Dn = {
1438
1436
  }, []), /* @__PURE__ */ X(
1439
1437
  "div",
1440
1438
  {
1441
- className: `
1442
- univer-relative univer-mt-5 univer-w-full univer-border-t univer-border-solid univer-border-gray-200
1443
- `,
1444
- style: { display: U ? "block" : "none" },
1439
+ className: te("univer-relative univer-mt-5 univer-w-full", ln, {
1440
+ "univer-hidden": !U
1441
+ }),
1445
1442
  children: [
1446
1443
  /* @__PURE__ */ m(
1447
1444
  "div",
@@ -1449,7 +1446,7 @@ const Dn = {
1449
1446
  className: `
1450
1447
  univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1451
1448
  `,
1452
- children: /* @__PURE__ */ m("div", { className: ue("univer-flex univer-items-center univer-gap-1 univer-text-gray-600"), children: /* @__PURE__ */ m("div", { children: t.t("image-text-wrap.title") }) })
1449
+ children: /* @__PURE__ */ m("div", { className: te("univer-flex univer-items-center univer-gap-1 univer-text-gray-600"), children: /* @__PURE__ */ m("div", { children: t.t("image-text-wrap.title") }) })
1453
1450
  }
1454
1451
  ),
1455
1452
  /* @__PURE__ */ m(
@@ -1458,16 +1455,16 @@ const Dn = {
1458
1455
  className: `
1459
1456
  univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1460
1457
  `,
1461
- children: /* @__PURE__ */ m("div", { className: ue("univer-flex univer-items-center univer-gap-1 univer-text-black"), children: /* @__PURE__ */ m("div", { children: t.t("image-text-wrap.wrappingStyle") }) })
1458
+ children: /* @__PURE__ */ m("div", { className: te("univer-flex univer-items-center univer-gap-1 univer-text-gray-900"), children: /* @__PURE__ */ m("div", { children: t.t("image-text-wrap.wrappingStyle") }) })
1462
1459
  }
1463
1460
  ),
1464
1461
  /* @__PURE__ */ m(
1465
1462
  "div",
1466
1463
  {
1467
- className: ue(`
1464
+ className: te(`
1468
1465
  univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1469
1466
  `),
1470
- children: /* @__PURE__ */ m("div", { className: ue("univer-flex univer-items-center univer-gap-1"), children: /* @__PURE__ */ X(Gt, { value: y, onChange: I, direction: "vertical", children: [
1467
+ children: /* @__PURE__ */ m("div", { className: te("univer-flex univer-items-center univer-gap-1"), children: /* @__PURE__ */ X(Gt, { value: y, onChange: I, direction: "vertical", children: [
1471
1468
  /* @__PURE__ */ m(be, { value: fe.INLINE, children: t.t("image-text-wrap.inline") }),
1472
1469
  /* @__PURE__ */ m(be, { value: fe.WRAP_SQUARE, children: t.t("image-text-wrap.square") }),
1473
1470
  /* @__PURE__ */ m(be, { value: fe.WRAP_TOP_AND_BOTTOM, children: t.t("image-text-wrap.topAndBottom") }),
@@ -1482,16 +1479,16 @@ const Dn = {
1482
1479
  className: `
1483
1480
  univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1484
1481
  `,
1485
- children: /* @__PURE__ */ m("div", { className: ue("univer-flex univer-items-center univer-gap-1 univer-text-black"), children: /* @__PURE__ */ m("div", { children: t.t("image-text-wrap.wrapText") }) })
1482
+ children: /* @__PURE__ */ m("div", { className: te("univer-flex univer-items-center univer-gap-1 univer-text-gray-900"), children: /* @__PURE__ */ m("div", { children: t.t("image-text-wrap.wrapText") }) })
1486
1483
  }
1487
1484
  ),
1488
1485
  /* @__PURE__ */ m(
1489
1486
  "div",
1490
1487
  {
1491
- className: ue(`
1488
+ className: te(`
1492
1489
  univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1493
1490
  `),
1494
- children: /* @__PURE__ */ m("div", { className: ue("univer-flex univer-items-center univer-gap-1"), children: /* @__PURE__ */ X(Gt, { disabled: u, value: O, onChange: P, direction: "horizontal", children: [
1491
+ children: /* @__PURE__ */ m("div", { className: te("univer-flex univer-items-center univer-gap-1"), children: /* @__PURE__ */ X(Gt, { disabled: u, value: O, onChange: P, direction: "horizontal", children: [
1495
1492
  /* @__PURE__ */ m(be, { value: qe.BOTH_SIDES, children: t.t("image-text-wrap.bothSide") }),
1496
1493
  /* @__PURE__ */ m(be, { value: qe.LEFT, children: t.t("image-text-wrap.leftOnly") }),
1497
1494
  /* @__PURE__ */ m(be, { value: qe.RIGHT, children: t.t("image-text-wrap.rightOnly") })
@@ -1504,7 +1501,7 @@ const Dn = {
1504
1501
  className: `
1505
1502
  univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1506
1503
  `,
1507
- children: /* @__PURE__ */ m("div", { className: ue("univer-flex univer-items-center univer-gap-1 univer-text-black"), children: /* @__PURE__ */ m("div", { children: t.t("image-text-wrap.distanceFromText") }) })
1504
+ children: /* @__PURE__ */ m("div", { className: te("univer-flex univer-items-center univer-gap-1 univer-text-gray-900"), children: /* @__PURE__ */ m("div", { children: t.t("image-text-wrap.distanceFromText") }) })
1508
1505
  }
1509
1506
  ),
1510
1507
  /* @__PURE__ */ X(
@@ -1514,7 +1511,7 @@ const Dn = {
1514
1511
  univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1515
1512
  `,
1516
1513
  children: [
1517
- /* @__PURE__ */ m("div", { className: ue("univer-flex univer-items-center univer-gap-1"), children: /* @__PURE__ */ X("label", { children: [
1514
+ /* @__PURE__ */ m("div", { className: te("univer-flex univer-items-center univer-gap-1"), children: /* @__PURE__ */ X("label", { children: [
1518
1515
  /* @__PURE__ */ m(
1519
1516
  "div",
1520
1517
  {
@@ -1548,7 +1545,7 @@ const Dn = {
1548
1545
  }
1549
1546
  )
1550
1547
  ] }) }),
1551
- /* @__PURE__ */ m("div", { className: ue("univer-flex univer-items-center univer-gap-1"), children: /* @__PURE__ */ X("label", { children: [
1548
+ /* @__PURE__ */ m("div", { className: te("univer-flex univer-items-center univer-gap-1"), children: /* @__PURE__ */ X("label", { children: [
1552
1549
  /* @__PURE__ */ m(
1553
1550
  "div",
1554
1551
  {
@@ -1592,7 +1589,7 @@ const Dn = {
1592
1589
  univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
1593
1590
  `,
1594
1591
  children: [
1595
- /* @__PURE__ */ m("div", { className: ue("univer-flex univer-items-center univer-gap-1"), children: /* @__PURE__ */ X("label", { children: [
1592
+ /* @__PURE__ */ m("div", { className: te("univer-flex univer-items-center univer-gap-1"), children: /* @__PURE__ */ X("label", { children: [
1596
1593
  /* @__PURE__ */ m(
1597
1594
  "div",
1598
1595
  {
@@ -1626,7 +1623,7 @@ const Dn = {
1626
1623
  }
1627
1624
  )
1628
1625
  ] }) }),
1629
- /* @__PURE__ */ m("div", { className: ue("univer-flex univer-items-center univer-gap-1"), children: /* @__PURE__ */ X("label", { children: [
1626
+ /* @__PURE__ */ m("div", { className: te("univer-flex univer-items-center univer-gap-1"), children: /* @__PURE__ */ X("label", { children: [
1630
1627
  /* @__PURE__ */ m(
1631
1628
  "div",
1632
1629
  {
@@ -1666,8 +1663,8 @@ const Dn = {
1666
1663
  ]
1667
1664
  }
1668
1665
  );
1669
- }, nr = () => {
1670
- const i = we(ve), e = i.getFocusDrawings(), [t, n] = re(e);
1666
+ }, ir = () => {
1667
+ const i = we(ve), e = i.getFocusDrawings(), [t, n] = se(e);
1671
1668
  return Mt(() => {
1672
1669
  const r = i.focus$.subscribe((s) => {
1673
1670
  n(s);
@@ -1676,13 +1673,13 @@ const Dn = {
1676
1673
  r.unsubscribe();
1677
1674
  };
1678
1675
  }, []), !!(t != null && t.length) && /* @__PURE__ */ X("div", { className: "univer-p-2 univer-text-center univer-text-sm", children: [
1679
- /* @__PURE__ */ m(ci, { drawings: t, hasAlign: !1, hasCropper: !1, hasGroup: !1, hasTransform: !1 }),
1680
- /* @__PURE__ */ m(tr, { drawings: t }),
1681
- /* @__PURE__ */ m(er, { drawings: t })
1676
+ /* @__PURE__ */ m(di, { drawings: t, hasAlign: !1, hasCropper: !1, hasGroup: !1, hasTransform: !1 }),
1677
+ /* @__PURE__ */ m(nr, { drawings: t }),
1678
+ /* @__PURE__ */ m(tr, { drawings: t })
1682
1679
  ] });
1683
- }, Nn = "addition-and-subtraction-single", En = "doc.menu.image", Rn = _n.id, ir = (i) => {
1680
+ }, En = "addition-and-subtraction-single", Rn = "doc.menu.image", An = Sn.id, rr = (i) => {
1684
1681
  const e = i.get(Ot), t = i.get(z);
1685
- return new Fi((n) => {
1682
+ return new ji((n) => {
1686
1683
  const r = e.textSelection$.subscribe(() => {
1687
1684
  var o;
1688
1685
  const s = e.getActiveTextRange();
@@ -1704,40 +1701,40 @@ const Dn = {
1704
1701
  return () => r.unsubscribe();
1705
1702
  });
1706
1703
  };
1707
- function rr(i) {
1704
+ function sr(i) {
1708
1705
  return {
1709
- id: En,
1706
+ id: Rn,
1710
1707
  type: sn.SUBITEMS,
1711
- icon: Nn,
1708
+ icon: En,
1712
1709
  tooltip: "docImage.title",
1713
- disabled$: ir(i),
1710
+ disabled$: rr(i),
1714
1711
  hidden$: rn(i, Ie.UNIVER_DOC, void 0, yt)
1715
1712
  };
1716
1713
  }
1717
- function sr(i) {
1714
+ function or(i) {
1718
1715
  return {
1719
- id: Rn,
1716
+ id: An,
1720
1717
  title: "docImage.upload.float",
1721
1718
  type: sn.BUTTON,
1722
1719
  hidden$: rn(i, Ie.UNIVER_DOC, void 0, yt)
1723
1720
  };
1724
1721
  }
1725
- const or = {
1726
- [Di.LAYOUT]: {
1727
- [En]: {
1722
+ const ar = {
1723
+ [yi.LAYOUT]: {
1724
+ [Rn]: {
1728
1725
  order: 0,
1729
- menuItemFactory: rr,
1730
- [Rn]: {
1726
+ menuItemFactory: sr,
1727
+ [An]: {
1731
1728
  order: 0,
1732
- menuItemFactory: sr
1729
+ menuItemFactory: or
1733
1730
  }
1734
1731
  }
1735
1732
  }
1736
1733
  };
1737
1734
  function Qe(i) {
1738
- return i.getContextValue(Hn) && i.getContextValue(rt);
1735
+ return i.getContextValue(Gn) && i.getContextValue(rt);
1739
1736
  }
1740
- const ar = {
1737
+ const cr = {
1741
1738
  id: Ze.id,
1742
1739
  description: "shortcut.drawing-move-down",
1743
1740
  group: "4_drawing-view",
@@ -1747,7 +1744,7 @@ const ar = {
1747
1744
  staticParameters: {
1748
1745
  direction: he.DOWN
1749
1746
  }
1750
- }, cr = {
1747
+ }, dr = {
1751
1748
  id: Ze.id,
1752
1749
  description: "shortcut.drawing-move-up",
1753
1750
  group: "4_drawing-view",
@@ -1757,7 +1754,7 @@ const ar = {
1757
1754
  staticParameters: {
1758
1755
  direction: he.UP
1759
1756
  }
1760
- }, dr = {
1757
+ }, lr = {
1761
1758
  id: Ze.id,
1762
1759
  description: "shortcut.drawing-move-left",
1763
1760
  group: "4_drawing-view",
@@ -1767,7 +1764,7 @@ const ar = {
1767
1764
  staticParameters: {
1768
1765
  direction: he.LEFT
1769
1766
  }
1770
- }, lr = {
1767
+ }, ur = {
1771
1768
  id: Ze.id,
1772
1769
  description: "shortcut.drawing-move-right",
1773
1770
  group: "4_drawing-view",
@@ -1777,8 +1774,8 @@ const ar = {
1777
1774
  staticParameters: {
1778
1775
  direction: he.RIGHT
1779
1776
  }
1780
- }, ur = {
1781
- id: vn.id,
1777
+ }, gr = {
1778
+ id: pn.id,
1782
1779
  description: "shortcut.drawing-delete",
1783
1780
  group: "4_drawing-view",
1784
1781
  // when focusing on any other input tag do not trigger this shortcut
@@ -1786,8 +1783,8 @@ const ar = {
1786
1783
  binding: He.DELETE,
1787
1784
  mac: He.BACKSPACE
1788
1785
  };
1789
- var gr = Object.getOwnPropertyDescriptor, fr = (i, e, t, n) => {
1790
- for (var r = n > 1 ? void 0 : n ? gr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1786
+ var fr = Object.getOwnPropertyDescriptor, hr = (i, e, t, n) => {
1787
+ for (var r = n > 1 ? void 0 : n ? fr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1791
1788
  (o = i[s]) && (r = o(r) || r);
1792
1789
  return r;
1793
1790
  }, nt = (i, e) => (t, n) => e(t, n, i);
@@ -1797,40 +1794,40 @@ let ot = class extends Ue {
1797
1794
  }
1798
1795
  _initCustomComponents() {
1799
1796
  const i = this._componentManager;
1800
- this.disposeWithMe(i.register(Nn, mn)), this.disposeWithMe(i.register(bn, nr));
1797
+ this.disposeWithMe(i.register(En, vn)), this.disposeWithMe(i.register(Cn, ir));
1801
1798
  }
1802
1799
  _initMenus() {
1803
- this._menuManagerService.mergeMenu(or);
1800
+ this._menuManagerService.mergeMenu(ar);
1804
1801
  }
1805
1802
  _initCommands() {
1806
1803
  [
1807
- _n,
1804
+ Sn,
1808
1805
  Ct,
1809
- Dn,
1810
1806
  yn,
1811
1807
  On,
1812
- Ye,
1813
1808
  Tn,
1809
+ Ye,
1814
1810
  Mn,
1811
+ bn,
1815
1812
  bt,
1816
- Cn,
1817
- Ji,
1818
1813
  xn,
1819
- pn,
1820
- In,
1814
+ er,
1815
+ Nn,
1816
+ wn,
1817
+ _n,
1821
1818
  Ze,
1822
- vn,
1823
- wn
1819
+ pn,
1820
+ In
1824
1821
  ].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
1825
1822
  }
1826
1823
  _initShortcuts() {
1827
1824
  [
1828
1825
  // sheet drawing shortcuts
1829
- ar,
1830
1826
  cr,
1831
1827
  dr,
1832
1828
  lr,
1833
- ur
1829
+ ur,
1830
+ gr
1834
1831
  ].forEach((i) => {
1835
1832
  this.disposeWithMe(this._shortcutService.registerShortcut(i));
1836
1833
  });
@@ -1839,18 +1836,18 @@ let ot = class extends Ue {
1839
1836
  this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
1840
1837
  }
1841
1838
  };
1842
- ot = fr([
1839
+ ot = hr([
1843
1840
  nt(0, Z(on)),
1844
- nt(1, yi),
1841
+ nt(1, Oi),
1845
1842
  nt(2, G),
1846
- nt(3, Oi)
1843
+ nt(3, Ti)
1847
1844
  ], ot);
1848
- var hr = Object.getOwnPropertyDescriptor, mr = (i, e, t, n) => {
1849
- for (var r = n > 1 ? void 0 : n ? hr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1845
+ var mr = Object.getOwnPropertyDescriptor, vr = (i, e, t, n) => {
1846
+ for (var r = n > 1 ? void 0 : n ? mr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1850
1847
  (o = i[s]) && (r = o(r) || r);
1851
1848
  return r;
1852
1849
  }, $e = (i, e) => (t, n) => e(t, n, i);
1853
- function vr(i) {
1850
+ function pr(i) {
1854
1851
  var n, r, s, o;
1855
1852
  if ($.isNoop(i) || !Array.isArray(i))
1856
1853
  return null;
@@ -1873,7 +1870,7 @@ function vr(i) {
1873
1870
  });
1874
1871
  return t;
1875
1872
  }
1876
- function pr(i) {
1873
+ function wr(i) {
1877
1874
  if (!Array.isArray(i) || i.length < 3 || i[0] !== "drawingsOrder")
1878
1875
  return [];
1879
1876
  const e = [];
@@ -1900,7 +1897,7 @@ let at = class extends Ue {
1900
1897
  this._commandService.beforeCommandExecuted((i) => {
1901
1898
  if (i.id !== ee.id)
1902
1899
  return;
1903
- const e = i.params, { unitId: t, actions: n } = e, r = vr(n);
1900
+ const e = i.params, { unitId: t, actions: n } = e, r = pr(n);
1904
1901
  if (r != null)
1905
1902
  for (const { type: s, drawingId: o, drawing: c } of r)
1906
1903
  s === "add" ? this._addDrawings(t, [c]) : this._removeDrawings(t, [o]);
@@ -1910,12 +1907,12 @@ let at = class extends Ue {
1910
1907
  if (i.id !== ee.id)
1911
1908
  return;
1912
1909
  const e = i.params, { unitId: t, actions: n } = e;
1913
- pr(n).length > 0 && this._updateDrawingsOrder(t);
1910
+ wr(n).length > 0 && this._updateDrawingsOrder(t);
1914
1911
  })
1915
1912
  ), this.disposeWithMe(
1916
1913
  this._commandService.onCommandExecuted((i) => {
1917
1914
  var o;
1918
- if (i.id !== Gn.id && i.id !== Vn.id)
1915
+ if (i.id !== Vn.id && i.id !== $n.id)
1919
1916
  return;
1920
1917
  const e = (o = this._univerInstanceService.getCurrentUniverDocInstance()) == null ? void 0 : o.getUnitId(), t = this._drawingManagerService.getFocusDrawings();
1921
1918
  if (e == null || t.length === 0)
@@ -1956,19 +1953,19 @@ let at = class extends Ue {
1956
1953
  n.orderNotification(s), r.orderNotification(s);
1957
1954
  }
1958
1955
  };
1959
- at = mr([
1956
+ at = vr([
1960
1957
  $e(0, z),
1961
1958
  $e(1, G),
1962
1959
  $e(2, ve),
1963
1960
  $e(3, Be),
1964
1961
  $e(4, Q)
1965
1962
  ], at);
1966
- var wr = Object.getOwnPropertyDescriptor, Ir = (i, e, t, n) => {
1967
- for (var r = n > 1 ? void 0 : n ? wr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1963
+ var Ir = Object.getOwnPropertyDescriptor, _r = (i, e, t, n) => {
1964
+ for (var r = n > 1 ? void 0 : n ? Ir(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1968
1965
  (o = i[s]) && (r = o(r) || r);
1969
1966
  return r;
1970
- }, Fe = (i, e) => (t, n) => e(t, n, i);
1971
- function An(i, e, t = 1, n = 0) {
1967
+ }, ke = (i, e) => (t, n) => e(t, n, i);
1968
+ function Pn(i, e, t = 1, n = 0) {
1972
1969
  const { top: r, left: s, bottom: o, right: c } = i, d = c - s, a = o - r, l = e.getViewport(cn.VIEW_MAIN), { viewportScrollX: g, viewportScrollY: u } = l, { scaleX: h, scaleY: f } = e.getAncestorScale();
1973
1970
  return {
1974
1971
  startX: (s - g) * h,
@@ -1987,7 +1984,7 @@ function An(i, e, t = 1, n = 0) {
1987
1984
  }
1988
1985
  function It(i, e) {
1989
1986
  const { top: t, left: n, width: r, height: s, angle: o, opacity: c } = i;
1990
- return An({ top: t, left: n, bottom: t + s, right: n + r }, e.scene, c, o);
1987
+ return Pn({ top: t, left: n, bottom: t + s, right: n + r }, e.scene, c, o);
1991
1988
  }
1992
1989
  let ct = class extends Ue {
1993
1990
  constructor(e, t, n, r, s, o) {
@@ -2038,7 +2035,7 @@ let ct = class extends Ue {
2038
2035
  if (!(c == null || c.length === 0))
2039
2036
  for (const d of c) {
2040
2037
  this._addHoverForRect(d);
2041
- const a = new $n(), l = It(d, s.renderUnit), g = new Tt(l), u = s.canvas, h = o.data, f = {
2038
+ const a = new zn(), l = It(d, s.renderUnit), g = new Tt(l), u = s.canvas, h = o.data, f = {
2042
2039
  dispose: a,
2043
2040
  rect: d,
2044
2041
  position$: g,
@@ -2115,8 +2112,8 @@ let ct = class extends Ue {
2115
2112
  const n = t.getUnitId(), r = this._renderManagerService.getRenderById(n);
2116
2113
  return r ? { render: r, unitId: n } : null;
2117
2114
  }),
2118
- ji(
2119
- (t) => t ? Jt(t.render.scene.getViewport(cn.VIEW_MAIN).onScrollAfter$).pipe(Vt(() => ({ unitId: t.unitId }))) : Wi(null)
2115
+ Wi(
2116
+ (t) => t ? Jt(t.render.scene.getViewport(cn.VIEW_MAIN).onScrollAfter$).pipe(Vt(() => ({ unitId: t.unitId }))) : Hi(null)
2120
2117
  )
2121
2118
  ).subscribe((t) => {
2122
2119
  if (!t) return;
@@ -2136,7 +2133,7 @@ let ct = class extends Ue {
2136
2133
  if (!n) return !1;
2137
2134
  const r = this._getSceneAndTransformerByDrawingSearch(n.getUnitId());
2138
2135
  if (!r) return !1;
2139
- const c = (p = r.renderUnit.with(te).getSkeleton().getSkeletonData()) == null ? void 0 : p.pages[0];
2136
+ const c = (p = r.renderUnit.with(ne).getSkeleton().getSkeletonData()) == null ? void 0 : p.pages[0];
2140
2137
  if (!c) return !1;
2141
2138
  const { pageWidth: d, marginLeft: a, marginRight: l } = c, g = d - a - l, u = {
2142
2139
  size: {
@@ -2152,7 +2149,7 @@ let ct = class extends Ue {
2152
2149
  posOffset: 0
2153
2150
  },
2154
2151
  angle: 0
2155
- }, h = (w = t.drawingId) != null ? w : zn(), f = {
2152
+ }, h = (w = t.drawingId) != null ? w : Xn(), f = {
2156
2153
  unitId: n.getUnitId(),
2157
2154
  drawings: [
2158
2155
  {
@@ -2164,7 +2161,7 @@ let ct = class extends Ue {
2164
2161
  title: "",
2165
2162
  description: "",
2166
2163
  docTransform: u,
2167
- layoutType: F.INLINE,
2164
+ layoutType: k.INLINE,
2168
2165
  transform: an(u)
2169
2166
  }
2170
2167
  ]
@@ -2172,17 +2169,17 @@ let ct = class extends Ue {
2172
2169
  return this._commandService.syncExecuteCommand(Ct.id, f), h;
2173
2170
  }
2174
2171
  };
2175
- ct = Ir([
2176
- Fe(0, Q),
2177
- Fe(1, ve),
2178
- Fe(2, Z(tn)),
2179
- Fe(3, Z(Ti)),
2180
- Fe(4, z),
2181
- Fe(5, G)
2172
+ ct = _r([
2173
+ ke(0, Q),
2174
+ ke(1, ve),
2175
+ ke(2, Z(tn)),
2176
+ ke(3, Z(Mi)),
2177
+ ke(4, z),
2178
+ ke(5, G)
2182
2179
  ], ct);
2183
- const _r = (i) => {
2184
- const { floatDomInfos: e, scene: t, offset: n, bound: r } = i, s = r.right - r.left, o = r.bottom - r.top, c = Gi(() => e.map((d) => {
2185
- const { width: a = 0, height: l = 0, left: g = 0, top: u = 0 } = d.transform, f = An(
2180
+ const Sr = (i) => {
2181
+ const { floatDomInfos: e, scene: t, offset: n, bound: r } = i, s = r.right - r.left, o = r.bottom - r.top, c = Vi(() => e.map((d) => {
2182
+ const { width: a = 0, height: l = 0, left: g = 0, top: u = 0 } = d.transform, f = Pn(
2186
2183
  {
2187
2184
  left: g,
2188
2185
  right: g + a,
@@ -2208,10 +2205,10 @@ const _r = (i) => {
2208
2205
  };
2209
2206
  return [d.drawingId, p];
2210
2207
  }).filter(([d, a]) => !(a.position.endX < 0 || a.position.endY < 0 || a.position.startX > s || a.position.startY > o)), [e, t, n, s, o]);
2211
- return /* @__PURE__ */ m("div", { style: { position: "absolute", top: 0, left: 0 }, children: c.map(([d, a]) => /* @__PURE__ */ m(Mi, { layer: a, id: d, position: a.position }, d)) });
2208
+ return /* @__PURE__ */ m("div", { style: { position: "absolute", top: 0, left: 0 }, children: c.map(([d, a]) => /* @__PURE__ */ m(bi, { layer: a, id: d, position: a.position }, d)) });
2212
2209
  };
2213
- var Sr = Object.getOwnPropertyDescriptor, Dr = (i, e, t, n) => {
2214
- for (var r = n > 1 ? void 0 : n ? Sr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2210
+ var Dr = Object.getOwnPropertyDescriptor, yr = (i, e, t, n) => {
2211
+ for (var r = n > 1 ? void 0 : n ? Dr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2215
2212
  (o = i[s]) && (r = o(r) || r);
2216
2213
  return r;
2217
2214
  }, ze = (i, e) => (t, n) => e(t, n, i);
@@ -2248,7 +2245,7 @@ let dt = class extends Ue {
2248
2245
  if (a.drawingType === Le.DRAWING_CHART)
2249
2246
  return {
2250
2247
  ...a,
2251
- componentKey: this._componetManager.get(Xn)
2248
+ componentKey: this._componetManager.get(qn)
2252
2249
  };
2253
2250
  if (a.drawingType === Le.DRAWING_DOM) {
2254
2251
  const l = this._docPrintInterceptorService.getPrintComponent(a.componentKey);
@@ -2258,8 +2255,8 @@ let dt = class extends Ue {
2258
2255
  };
2259
2256
  }
2260
2257
  return null;
2261
- }).filter(Boolean), c = bi(_r, this._injector);
2262
- return Bi(
2258
+ }).filter(Boolean), c = Ci(Sr, this._injector);
2259
+ return Fi(
2263
2260
  /* @__PURE__ */ m(
2264
2261
  c,
2265
2262
  {
@@ -2282,19 +2279,19 @@ let dt = class extends Ue {
2282
2279
  );
2283
2280
  }
2284
2281
  };
2285
- dt = Dr([
2286
- ze(0, Z(Ni)),
2282
+ dt = yr([
2283
+ ze(0, Z(Ei)),
2287
2284
  ze(1, Z(tn)),
2288
2285
  ze(2, ve),
2289
2286
  ze(3, Z(on)),
2290
2287
  ze(4, Z(en))
2291
2288
  ], dt);
2292
- var yr = Object.getOwnPropertyDescriptor, Or = (i, e, t, n) => {
2293
- for (var r = n > 1 ? void 0 : n ? yr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2289
+ var Or = Object.getOwnPropertyDescriptor, Tr = (i, e, t, n) => {
2290
+ for (var r = n > 1 ? void 0 : n ? Or(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2294
2291
  (o = i[s]) && (r = o(r) || r);
2295
2292
  return r;
2296
2293
  }, it = (i, e) => (t, n) => e(t, n, i);
2297
- const Tr = "__InlineDrawingAnchor__";
2294
+ const Mr = "__InlineDrawingAnchor__";
2298
2295
  function Yt(i) {
2299
2296
  const { path: e } = i;
2300
2297
  return e.some((t) => t === "cells");
@@ -2341,7 +2338,7 @@ let lt = class extends Ue {
2341
2338
  if (p == null)
2342
2339
  continue;
2343
2340
  const v = this._univerInstanceService.getUniverDocInstance(p.unitId), w = (c = v == null ? void 0 : v.getSnapshot().drawings) == null ? void 0 : c[p.drawingId];
2344
- if ((w == null ? void 0 : w.layoutType) === F.INLINE)
2341
+ if ((w == null ? void 0 : w.layoutType) === k.INLINE)
2345
2342
  try {
2346
2343
  d.setOpacity(0.2);
2347
2344
  } catch {
@@ -2369,7 +2366,7 @@ let lt = class extends Ue {
2369
2366
  const a = this._transformerCache.values().next().value, l = o.values().next().value, { width: g, height: u, top: h, left: f, angle: p } = l;
2370
2367
  if (a && g === a.width && u === a.height && h === a.top && f === a.left && p === a.angle)
2371
2368
  return;
2372
- a && (a.drawing.layoutType, F.INLINE), a && a.drawing.layoutType === F.INLINE && c != null && d != null && this._updateInlineDrawingAnchor(a.drawing, c, d);
2369
+ a && (a.drawing.layoutType, k.INLINE), a && a.drawing.layoutType === k.INLINE && c != null && d != null && this._updateInlineDrawingAnchor(a.drawing, c, d);
2373
2370
  }
2374
2371
  })
2375
2372
  )
@@ -2383,7 +2380,7 @@ let lt = class extends Ue {
2383
2380
  if (l == null)
2384
2381
  continue;
2385
2382
  const g = this._transformerCache.get(l == null ? void 0 : l.drawingId);
2386
- if ((g == null ? void 0 : g.drawing.layoutType) === F.INLINE)
2383
+ if ((g == null ? void 0 : g.drawing.layoutType) === k.INLINE)
2387
2384
  try {
2388
2385
  a.setOpacity(1);
2389
2386
  } catch {
@@ -2395,7 +2392,7 @@ let lt = class extends Ue {
2395
2392
  const a = this._transformerCache.values().next().value, l = o.values().next().value, { width: g, height: u, top: h, left: f, angle: p } = l;
2396
2393
  if (a && g === a.width && u === a.height && h === a.top && f === a.left && p === a.angle)
2397
2394
  return;
2398
- a && a.drawing.layoutType === F.INLINE ? g !== a.width || u !== a.height || p !== a.angle ? this._updateDrawingSize(a, l) : c != null && d != null && this._moveInlineDrawing(a.drawing, c, d) : a && this._nonInlineDrawingTransform(a.drawing, l);
2395
+ a && a.drawing.layoutType === k.INLINE ? g !== a.width || u !== a.height || p !== a.angle ? this._updateDrawingSize(a, l) : c != null && d != null && this._moveInlineDrawing(a.drawing, c, d) : a && this._nonInlineDrawingTransform(a.drawing, l);
2399
2396
  }
2400
2397
  this._transformerCache.clear();
2401
2398
  })
@@ -2471,7 +2468,7 @@ let lt = class extends Ue {
2471
2468
  }
2472
2469
  _getInlineDrawingAnchor(e, t, n) {
2473
2470
  var A, H;
2474
- const r = this._renderManagerService.getRenderById(e.unitId), s = r == null ? void 0 : r.with(te).getSkeleton();
2471
+ const r = this._renderManagerService.getRenderById(e.unitId), s = r == null ? void 0 : r.with(ne).getSkeleton();
2475
2472
  if (r == null)
2476
2473
  return;
2477
2474
  const { mainComponent: o, scene: c } = r, d = o, a = c.getViewports()[0], {
@@ -2503,14 +2500,14 @@ let lt = class extends Ue {
2503
2500
  const E = {
2504
2501
  ...C,
2505
2502
  isBack: f
2506
- }, U = M.document.getOffsetConfig(), N = new Ft(U, s), { cursorList: I, contentBoxPointGroup: P } = N.getRangePointData(E, E), { startOffset: W } = (H = jt(I)) != null ? H : {};
2503
+ }, U = M.document.getOffsetConfig(), N = new kt(U, s), { cursorList: I, contentBoxPointGroup: P } = N.getRangePointData(E, E), { startOffset: W } = (H = jt(I)) != null ? H : {};
2507
2504
  if (W != null)
2508
2505
  return { offset: W, contentBoxPointGroup: P, segmentId: v, segmentPage: p };
2509
2506
  }
2510
2507
  // eslint-disable-next-line max-lines-per-function, complexity
2511
2508
  _getDrawingAnchor(e, t) {
2512
- var Se, De, ce, Oe, Te, Ee, Re, Me, de, le, Ae;
2513
- const n = this._renderManagerService.getRenderById(e.unitId), r = n == null ? void 0 : n.with(te).getSkeleton(), s = r == null ? void 0 : r.getSkeletonData();
2509
+ var Se, De, de, Oe, Te, Ee, Re, Me, le, ue, Ae;
2510
+ const n = this._renderManagerService.getRenderById(e.unitId), r = n == null ? void 0 : n.with(ne).getSkeleton(), s = r == null ? void 0 : r.getSkeletonData();
2514
2511
  if (s == null || n == null)
2515
2512
  return;
2516
2513
  const { pages: o, skeHeaders: c, skeFooters: d } = s, { mainComponent: a, scene: l } = n, g = a, u = l.getViewports()[0], { pageLayoutType: h = Bt.VERTICAL, pageMarginLeft: f, pageMarginTop: p, docsLeft: v, docsTop: w } = g.getOffsetConfig(), { left: y, top: D, angle: O } = t;
@@ -2542,16 +2539,16 @@ let lt = class extends Ue {
2542
2539
  }
2543
2540
  if (P == null)
2544
2541
  return;
2545
- const b = (De = P.parent) == null ? void 0 : De.parent, R = b == null ? void 0 : b.parent, V = (ce = R == null ? void 0 : R.lines.find((pe) => pe.paragraphIndex === (b == null ? void 0 : b.paragraphIndex) && pe.paragraphStart)) != null ? ce : R == null ? void 0 : R.lines[0], k = (Oe = R == null ? void 0 : R.parent) == null ? void 0 : Oe.parent;
2546
- if (b == null || R == null || V == null || k == null)
2542
+ const b = (De = P.parent) == null ? void 0 : De.parent, R = b == null ? void 0 : b.parent, V = (de = R == null ? void 0 : R.lines.find((pe) => pe.paragraphIndex === (b == null ? void 0 : b.paragraphIndex) && pe.paragraphStart)) != null ? de : R == null ? void 0 : R.lines[0], F = (Oe = R == null ? void 0 : R.parent) == null ? void 0 : Oe.parent;
2543
+ if (b == null || R == null || V == null || F == null)
2547
2544
  return;
2548
2545
  this._liquid.reset();
2549
- const K = k.type;
2546
+ const K = F.type;
2550
2547
  for (const pe of o) {
2551
- const { headerId: mt, footerId: vt, pageHeight: Ln, pageWidth: xt, marginLeft: Nt, marginBottom: Un } = pe, Bn = o.indexOf(pe);
2552
- if (A > -1 && Bn === A) {
2548
+ const { headerId: mt, footerId: vt, pageHeight: Un, pageWidth: xt, marginLeft: Nt, marginBottom: Bn } = pe, Fn = o.indexOf(pe);
2549
+ if (A > -1 && Fn === A) {
2553
2550
  switch (K) {
2554
- case kt.HEADER: {
2551
+ case Ft.HEADER: {
2555
2552
  const Ve = (Te = c.get(mt)) == null ? void 0 : Te.get(xt);
2556
2553
  if (Ve)
2557
2554
  this._liquid.translatePagePadding({
@@ -2562,11 +2559,11 @@ let lt = class extends Ue {
2562
2559
  throw new Error("header skeleton not found");
2563
2560
  break;
2564
2561
  }
2565
- case kt.FOOTER: {
2562
+ case Ft.FOOTER: {
2566
2563
  const Ve = (Ee = d.get(vt)) == null ? void 0 : Ee.get(xt);
2567
2564
  if (Ve)
2568
2565
  this._liquid.translatePagePadding({
2569
- marginTop: Ln - Un + Ve.marginTop,
2566
+ marginTop: Un - Bn + Ve.marginTop,
2570
2567
  marginLeft: Nt
2571
2568
  });
2572
2569
  else
@@ -2576,16 +2573,16 @@ let lt = class extends Ue {
2576
2573
  }
2577
2574
  break;
2578
2575
  }
2579
- if (this._liquid.translatePagePadding(pe), pe === k)
2576
+ if (this._liquid.translatePagePadding(pe), pe === F)
2580
2577
  break;
2581
2578
  this._liquid.restorePagePadding(pe), this._liquid.translatePage(pe, h, f, p);
2582
2579
  }
2583
- switch (E.relativeFrom === j.LINE ? P = b.divides[0].glyphGroup[0] : P = (le = (de = (Me = (Re = V.divides) == null ? void 0 : Re[0]) == null ? void 0 : Me.glyphGroup) == null ? void 0 : de[0]) != null ? le : P, _.positionH = {
2580
+ switch (E.relativeFrom === j.LINE ? P = b.divides[0].glyphGroup[0] : P = (ue = (le = (Me = (Re = V.divides) == null ? void 0 : Re[0]) == null ? void 0 : Me.glyphGroup) == null ? void 0 : le[0]) != null ? ue : P, _.positionH = {
2584
2581
  relativeFrom: U.relativeFrom,
2585
2582
  posOffset: y - this._liquid.x - v
2586
2583
  }, U.relativeFrom) {
2587
2584
  case J.MARGIN: {
2588
- _.positionH.posOffset = y - this._liquid.x - v - k.marginLeft;
2585
+ _.positionH.posOffset = y - this._liquid.x - v - F.marginLeft;
2589
2586
  break;
2590
2587
  }
2591
2588
  case J.COLUMN: {
@@ -2598,7 +2595,7 @@ let lt = class extends Ue {
2598
2595
  posOffset: D - this._liquid.y - w
2599
2596
  }, E.relativeFrom) {
2600
2597
  case j.PAGE: {
2601
- _.positionV.posOffset = D - this._liquid.y - w - k.marginTop;
2598
+ _.positionV.posOffset = D - this._liquid.y - w - F.marginTop;
2602
2599
  break;
2603
2600
  }
2604
2601
  case j.LINE: {
@@ -2612,15 +2609,15 @@ let lt = class extends Ue {
2612
2609
  }
2613
2610
  if (P == null)
2614
2611
  return;
2615
- const oe = r == null ? void 0 : r.findPositionByGlyph(P, A), ke = this._getDocObject();
2616
- if (oe == null || r == null || ke == null || Yt(oe))
2612
+ const ae = r == null ? void 0 : r.findPositionByGlyph(P, A), Fe = this._getDocObject();
2613
+ if (ae == null || r == null || Fe == null || Yt(ae))
2617
2614
  return;
2618
2615
  const Ne = {
2619
- ...oe,
2616
+ ...ae,
2620
2617
  isBack: H
2621
- }, Ge = ke.document.getOffsetConfig(), ae = new Ft(Ge, r), { cursorList: ne } = ae.getRangePointData(Ne, Ne), { startOffset: ie } = (Ae = jt(ne)) != null ? Ae : {};
2622
- if (ie != null)
2623
- return { offset: ie, docTransform: _, segmentId: W, segmentPage: A };
2618
+ }, Ge = Fe.document.getOffsetConfig(), ce = new kt(Ge, r), { cursorList: ie } = ce.getRangePointData(Ne, Ne), { startOffset: re } = (Ae = jt(ie)) != null ? Ae : {};
2619
+ if (re != null)
2620
+ return { offset: re, docTransform: _, segmentId: W, segmentPage: A };
2624
2621
  }
2625
2622
  // Update drawing when use transformer to resize it.
2626
2623
  _updateDrawingSize(e, t) {
@@ -2647,7 +2644,7 @@ let lt = class extends Ue {
2647
2644
  // Update inline drawing when use transformer to move it.
2648
2645
  _moveInlineDrawing(e, t, n) {
2649
2646
  const r = this._getInlineDrawingAnchor(e, t, n), { offset: s, segmentId: o, segmentPage: c } = r != null ? r : {};
2650
- return this._commandService.executeCommand(Tn.id, {
2647
+ return this._commandService.executeCommand(Mn.id, {
2651
2648
  unitId: e.unitId,
2652
2649
  subUnitId: e.unitId,
2653
2650
  drawing: e,
@@ -2660,7 +2657,7 @@ let lt = class extends Ue {
2660
2657
  // Limit the drawing to the page area, mainly in the vertical direction,
2661
2658
  // and the upper and lower limits cannot exceed the page margin area.
2662
2659
  _limitDrawingInPage(e, t) {
2663
- const n = this._renderManagerService.getRenderById(e.unitId), { left: r, top: s, width: o, height: c, angle: d } = t, a = n == null ? void 0 : n.with(te).getSkeleton(), l = a == null ? void 0 : a.getSkeletonData(), { pages: g } = l != null ? l : {};
2660
+ const n = this._renderManagerService.getRenderById(e.unitId), { left: r, top: s, width: o, height: c, angle: d } = t, a = n == null ? void 0 : n.with(ne).getSkeleton(), l = a == null ? void 0 : a.getSkeletonData(), { pages: g } = l != null ? l : {};
2664
2661
  if (l == null || n == null || g == null)
2665
2662
  return {
2666
2663
  left: r,
@@ -2696,11 +2693,11 @@ let lt = class extends Ue {
2696
2693
  };
2697
2694
  }
2698
2695
  _nonInlineDrawingTransform(e, t, n = !1) {
2699
- const r = e.isMultiTransform === se.TRUE ? t : this._limitDrawingInPage(e, t);
2696
+ const r = e.isMultiTransform === oe.TRUE ? t : this._limitDrawingInPage(e, t);
2700
2697
  if (n && r.top !== t.top)
2701
2698
  return;
2702
2699
  const s = this._getDrawingAnchor(e, r), { offset: o, docTransform: c, segmentId: d, segmentPage: a } = s != null ? s : {};
2703
- return o == null || c == null ? this._updateMultipleDrawingDocTransform(/* @__PURE__ */ new Map([[e.drawingId, t]])) : this._commandService.executeCommand(Mn.id, {
2700
+ return o == null || c == null ? this._updateMultipleDrawingDocTransform(/* @__PURE__ */ new Map([[e.drawingId, t]])) : this._commandService.executeCommand(bn.id, {
2704
2701
  unitId: e.unitId,
2705
2702
  subUnitId: e.unitId,
2706
2703
  drawing: e,
@@ -2720,7 +2717,7 @@ let lt = class extends Ue {
2720
2717
  return { scene: n, transformer: r };
2721
2718
  }
2722
2719
  _getTransformCoordForDocumentOffset(e, t, n, r) {
2723
- const { documentTransform: s } = e.getOffsetConfig(), o = t.transformVector2SceneCoord(mi.FromArray([n, r]));
2720
+ const { documentTransform: s } = e.getOffsetConfig(), o = t.transformVector2SceneCoord(vi.FromArray([n, r]));
2724
2721
  if (o)
2725
2722
  return s.clone().invert().applyPoint(o);
2726
2723
  }
@@ -2731,26 +2728,26 @@ let lt = class extends Ue {
2731
2728
  const { mainComponent: r, scene: s } = n, o = r, {
2732
2729
  docsLeft: c,
2733
2730
  docsTop: d
2734
- } = o.getOffsetConfig(), a = Ei(t), { left: l, top: g, height: u } = a, h = l + c, f = g + d;
2731
+ } = o.getOffsetConfig(), a = Ri(t), { left: l, top: g, height: u } = a, h = l + c, f = g + d;
2735
2732
  if (this._anchorShape) {
2736
2733
  this._anchorShape.transformByState({ left: h, top: f, height: u }), this._anchorShape.show();
2737
2734
  return;
2738
2735
  }
2739
- const p = 6, v = new vi(Tr + Ce.generateRandomId(p), {
2736
+ const p = 6, v = new pi(Mr + Ce.generateRandomId(p), {
2740
2737
  left: h,
2741
2738
  top: f,
2742
2739
  height: u,
2743
2740
  strokeWidth: 2,
2744
- stroke: pi(qn.darkGray, 1),
2741
+ stroke: wi(Kn.darkGray, 1),
2745
2742
  evented: !1
2746
2743
  });
2747
- this._anchorShape = v, s.addObject(v, Ri);
2744
+ this._anchorShape = v, s.addObject(v, Ai);
2748
2745
  }
2749
2746
  _getDocObject() {
2750
- return Ai(this._univerInstanceService, this._renderManagerService);
2747
+ return Pi(this._univerInstanceService, this._renderManagerService);
2751
2748
  }
2752
2749
  _getPageContentSize(e) {
2753
- const t = this._renderManagerService.getRenderById(e.unitId), n = t == null ? void 0 : t.with(te).getSkeleton(), r = 500, s = 500, o = n == null ? void 0 : n.getSkeletonData();
2750
+ const t = this._renderManagerService.getRenderById(e.unitId), n = t == null ? void 0 : t.with(ne).getSkeleton(), r = 500, s = 500, o = n == null ? void 0 : n.getSkeletonData();
2754
2751
  if (o == null || t == null)
2755
2752
  return {
2756
2753
  width: r,
@@ -2778,18 +2775,18 @@ let lt = class extends Ue {
2778
2775
  };
2779
2776
  }
2780
2777
  };
2781
- lt = Or([
2778
+ lt = Tr([
2782
2779
  it(0, G),
2783
2780
  it(1, z),
2784
2781
  it(2, ve),
2785
2782
  it(3, Q)
2786
2783
  ], lt);
2787
- var Mr = Object.getOwnPropertyDescriptor, br = (i, e, t, n) => {
2788
- for (var r = n > 1 ? void 0 : n ? Mr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2784
+ var br = Object.getOwnPropertyDescriptor, Cr = (i, e, t, n) => {
2785
+ for (var r = n > 1 ? void 0 : n ? br(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2789
2786
  (o = i[s]) && (r = o(r) || r);
2790
2787
  return r;
2791
2788
  }, Xe = (i, e) => (t, n) => e(t, n, i);
2792
- let ut = class extends Kn {
2789
+ let ut = class extends Yn {
2793
2790
  constructor(e, t, n, r, s) {
2794
2791
  super();
2795
2792
  _e(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
@@ -2811,7 +2808,7 @@ let ut = class extends Kn {
2811
2808
  _hasCropObject(e) {
2812
2809
  const t = e.getAllObjects();
2813
2810
  for (const n of t)
2814
- if (n instanceof di)
2811
+ if (n instanceof li)
2815
2812
  return !0;
2816
2813
  return !1;
2817
2814
  }
@@ -2842,7 +2839,7 @@ let ut = class extends Kn {
2842
2839
  const { unitId: l, subUnitId: g, drawingId: u, drawingType: h } = a, f = this._canvasPopManagerService.attachPopupToObject(
2843
2840
  c,
2844
2841
  {
2845
- componentKey: li,
2842
+ componentKey: ui,
2846
2843
  direction: "horizontal",
2847
2844
  offset: [2, 0],
2848
2845
  extraProps: {
@@ -2883,7 +2880,7 @@ let ut = class extends Kn {
2883
2880
  {
2884
2881
  label: "image-popup.edit",
2885
2882
  index: 0,
2886
- commandId: xn.id,
2883
+ commandId: Nn.id,
2887
2884
  commandParams: { unitId: e, subUnitId: t, drawingId: n },
2888
2885
  // disable: !!SHEET_EDITOR_UNITS.includes(unitId) || drawingType === DrawingTypeEnum.DRAWING_DOM,
2889
2886
  disable: !0
@@ -2898,7 +2895,7 @@ let ut = class extends Kn {
2898
2895
  {
2899
2896
  label: "image-popup.crop",
2900
2897
  index: 2,
2901
- commandId: ui.id,
2898
+ commandId: gi.id,
2902
2899
  commandParams: { unitId: e, subUnitId: t, drawingId: n },
2903
2900
  disable: !0
2904
2901
  // TODO: @JOCS, feature is not ready.
@@ -2906,7 +2903,7 @@ let ut = class extends Kn {
2906
2903
  {
2907
2904
  label: "image-popup.reset",
2908
2905
  index: 3,
2909
- commandId: gi.id,
2906
+ commandId: fi.id,
2910
2907
  commandParams: [{ unitId: e, subUnitId: t, drawingId: n }],
2911
2908
  disable: !0
2912
2909
  // TODO: @JOCS, feature is not ready.
@@ -2914,15 +2911,15 @@ let ut = class extends Kn {
2914
2911
  ];
2915
2912
  }
2916
2913
  };
2917
- ut = br([
2914
+ ut = Cr([
2918
2915
  Xe(0, ve),
2919
- Xe(1, Z(Pi)),
2916
+ Xe(1, Z(Li)),
2920
2917
  Xe(2, Q),
2921
2918
  Xe(3, z),
2922
2919
  Xe(4, Qt)
2923
2920
  ], ut);
2924
- var Cr = Object.getOwnPropertyDescriptor, xr = (i, e, t, n) => {
2925
- for (var r = n > 1 ? void 0 : n ? Cr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2921
+ var xr = Object.getOwnPropertyDescriptor, Nr = (i, e, t, n) => {
2922
+ for (var r = n > 1 ? void 0 : n ? xr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2926
2923
  (o = i[s]) && (r = o(r) || r);
2927
2924
  return r;
2928
2925
  }, Pe = (i, e) => (t, n) => e(t, n, i);
@@ -2965,8 +2962,8 @@ let St = class extends Ue {
2965
2962
  _initResize() {
2966
2963
  this.disposeWithMe(
2967
2964
  Jt(this._context.engine.onTransformChange$).pipe(
2968
- zt((e) => e.type === wi.resize),
2969
- ln(16)
2965
+ zt((e) => e.type === Ii.resize),
2966
+ un(16)
2970
2967
  ).subscribe(() => {
2971
2968
  var n;
2972
2969
  const e = this._docSkeletonManagerService.getSkeleton(), { scene: t } = this._context;
@@ -3018,7 +3015,7 @@ let St = class extends Ue {
3018
3015
  const a = this._drawingManagerService.getDrawingByParam(d);
3019
3016
  a != null && (a.transform = d.transform, a.transforms = d.transforms, a.isMultiTransform = d.isMultiTransform);
3020
3017
  });
3021
- const o = [...r.getSelectedObjectMap().keys()], c = Object.values(this._drawingManagerService.getDrawingData(n, n)).filter((d) => d.isMultiTransform === se.TRUE);
3018
+ const o = [...r.getSelectedObjectMap().keys()], c = Object.values(this._drawingManagerService.getDrawingData(n, n)).filter((d) => d.isMultiTransform === oe.TRUE);
3022
3019
  this._drawingManagerService.removeNotification(c), e.length > 0 && this._drawingManagerService.addNotification(e);
3023
3020
  for (const d of o) {
3024
3021
  const a = t.getObject(d);
@@ -3031,7 +3028,7 @@ let St = class extends Ue {
3031
3028
  marginTop: o,
3032
3029
  marginLeft: c
3033
3030
  }), d.forEach((a) => {
3034
- const { aLeft: l, aTop: g, height: u, width: h, angle: f, drawingId: p, drawingOrigin: v } = a, w = v.layoutType === F.WRAP_NONE && v.behindDoc === se.TRUE, { isMultiTransform: y = se.FALSE } = v, D = {
3031
+ const { aLeft: l, aTop: g, height: u, width: h, angle: f, drawingId: p, drawingOrigin: v } = a, w = v.layoutType === k.WRAP_NONE && v.behindDoc === oe.TRUE, { isMultiTransform: y = oe.FALSE } = v, D = {
3035
3032
  left: l + n + this._liquid.x,
3036
3033
  top: g + r + this._liquid.y,
3037
3034
  width: h,
@@ -3046,7 +3043,7 @@ let St = class extends Ue {
3046
3043
  transform: D,
3047
3044
  transforms: [D],
3048
3045
  isMultiTransform: y
3049
- } : y === se.TRUE && s[p].transforms.push(D);
3046
+ } : y === oe.TRUE && s[p].transforms.push(D);
3050
3047
  }), this._liquid.restorePagePadding({
3051
3048
  marginTop: o,
3052
3049
  marginLeft: c
@@ -3060,30 +3057,30 @@ let St = class extends Ue {
3060
3057
  this._lifecycleService.stage >= Rt.Rendered ? this._docSkeletonManagerService.getSkeleton() ? e() : setTimeout(e, 500) : this._lifecycleService.lifecycle$.pipe(zt((t) => t === Rt.Rendered)).subscribe(e);
3061
3058
  }
3062
3059
  };
3063
- St = xr([
3064
- Pe(1, Z(te)),
3060
+ St = Nr([
3061
+ Pe(1, Z(ne)),
3065
3062
  Pe(2, G),
3066
- Pe(3, Li),
3063
+ Pe(3, Ui),
3067
3064
  Pe(4, ve),
3068
3065
  Pe(5, Z(ht)),
3069
3066
  Pe(6, z),
3070
- Pe(7, Z(Yn))
3067
+ Pe(7, Z(Zn))
3071
3068
  ], St);
3072
- var Nr = Object.defineProperty, Er = Object.getOwnPropertyDescriptor, Rr = (i, e, t) => e in i ? Nr(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, Ar = (i, e, t, n) => {
3073
- for (var r = n > 1 ? void 0 : n ? Er(e, t) : e, s = i.length - 1, o; s >= 0; s--)
3069
+ var Er = Object.defineProperty, Rr = Object.getOwnPropertyDescriptor, Ar = (i, e, t) => e in i ? Er(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, Pr = (i, e, t, n) => {
3070
+ for (var r = n > 1 ? void 0 : n ? Rr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
3074
3071
  (o = i[s]) && (r = o(r) || r);
3075
3072
  return r;
3076
- }, _t = (i, e) => (t, n) => e(t, n, i), Pn = (i, e, t) => Rr(i, typeof e != "symbol" ? e + "" : e, t);
3077
- const Pr = "DOC_DRAWING_UI_PLUGIN";
3078
- let gt = class extends Jn {
3073
+ }, _t = (i, e) => (t, n) => e(t, n, i), Ln = (i, e, t) => Ar(i, typeof e != "symbol" ? e + "" : e, t);
3074
+ const Lr = "DOC_DRAWING_UI_PLUGIN";
3075
+ let gt = class extends ei {
3079
3076
  constructor(i = Xt, e, t, n) {
3080
3077
  super(), this._config = i, this._injector = e, this._renderManagerSrv = t, this._configService = n;
3081
- const { ...r } = ei(
3078
+ const { ...r } = ti(
3082
3079
  {},
3083
3080
  Xt,
3084
3081
  this._config
3085
3082
  );
3086
- this._configService.setConfig(Vi, r);
3083
+ this._configService.setConfig($i, r);
3087
3084
  }
3088
3085
  onStarting() {
3089
3086
  [
@@ -3106,27 +3103,27 @@ let gt = class extends Jn {
3106
3103
  this._injector.get(ut), this._injector.get(ct);
3107
3104
  }
3108
3105
  };
3109
- Pn(gt, "type", Ie.UNIVER_DOC);
3110
- Pn(gt, "pluginName", Pr);
3111
- gt = Ar([
3112
- Zn(fi, ai, ti, Ci),
3106
+ Ln(gt, "type", Ie.UNIVER_DOC);
3107
+ Ln(gt, "pluginName", Lr);
3108
+ gt = Pr([
3109
+ Qn(hi, ci, ni, xi),
3113
3110
  _t(1, Z(en)),
3114
3111
  _t(2, Q),
3115
- _t(3, Qn)
3112
+ _t(3, Jn)
3116
3113
  ], gt);
3117
3114
  export {
3118
- Ji as ClearDocDrawingTransformerOperation,
3119
- En as DOCS_IMAGE_MENU_ID,
3120
- vn as DeleteDocDrawingsCommand,
3115
+ er as ClearDocDrawingTransformerOperation,
3116
+ Rn as DOCS_IMAGE_MENU_ID,
3117
+ pn as DeleteDocDrawingsCommand,
3121
3118
  ct as DocFloatDomController,
3122
- xn as EditDocDrawingOperation,
3123
- pn as GroupDocDrawingCommand,
3119
+ Nn as EditDocDrawingOperation,
3120
+ wn as GroupDocDrawingCommand,
3124
3121
  Ct as InsertDocDrawingCommand,
3125
- _n as InsertDocImageCommand,
3122
+ Sn as InsertDocImageCommand,
3126
3123
  Ze as MoveDocDrawingsCommand,
3127
3124
  bt as RemoveDocDrawingCommand,
3128
- wn as SetDocDrawingArrangeCommand,
3129
- Cn as SidebarDocDrawingOperation,
3130
- In as UngroupDocDrawingCommand,
3125
+ In as SetDocDrawingArrangeCommand,
3126
+ xn as SidebarDocDrawingOperation,
3127
+ _n as UngroupDocDrawingCommand,
3131
3128
  gt as UniverDocsDrawingUIPlugin
3132
3129
  };