@univerjs/drawing-ui 0.6.10 → 0.7.0-beta.1

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/index.js CHANGED
@@ -1,29 +1,29 @@
1
- var En = Object.defineProperty;
2
- var Bn = (i, t, n) => t in i ? En(i, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[t] = n;
3
- var ee = (i, t, n) => Bn(i, typeof t != "symbol" ? t + "" : t, n);
4
- import { UniverInstanceType as Oe, DrawingTypeEnum as ne, CommandType as ve, ICommandService as me, LocaleService as te, ArrangeTypeEnum as be, Tools as jn, debounce as Ie, Inject as Le, Disposable as xe, checkIfMove as sn, toDisposable as Ce, IUniverInstanceService as Ke, ImageSourceType as Xe, Injector as Un, IConfigService as An, Plugin as Hn, merge as Ln } from "@univerjs/core";
5
- import { getDrawingShapeKeyByDrawingSearch as G, ImageSourceType as xn, IDrawingManagerService as re, IImageIoService as cn, SetDrawingSelectedOperation as Ne } from "@univerjs/drawing";
6
- import { Group as we, DRAWING_OBJECT_LAYER_INDEX as De, Image as ze, Rect as ln, IRenderManagerService as ue, getGroupState as Vn, transformObjectOutOfGroup as kn, RENDER_CLASS_TYPE as Je, Shape as Gn, Canvas as Wn, precisionTo as ye, CURSOR_TYPE as Te, Vector2 as Ge, degToRad as qe } from "@univerjs/engine-render";
7
- import { IDialogService as gn, useDependency as V, ComponentManager as $n, IMessageService as zn } from "@univerjs/ui";
8
- import { jsxs as j, jsx as u, Fragment as Fn } from "react/jsx-runtime";
9
- import { useState as x, forwardRef as Z, useRef as mn, createElement as X, useEffect as _e } from "react";
10
- import { clsx as B, Select as dn, Button as le, InputNumber as pe, Checkbox as Kn, DropdownMenu as Yn, MessageType as Qe } from "@univerjs/design";
11
- import { switchMap as Zn, of as Xn } from "rxjs";
12
- function en(i, t, n, e) {
13
- const r = e.getDrawingByParam(i);
14
- if (r == null)
1
+ var Dt = Object.defineProperty;
2
+ var Tt = (i, r, t) => r in i ? Dt(i, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[r] = t;
3
+ var te = (i, r, t) => Tt(i, typeof r != "symbol" ? r + "" : r, t);
4
+ import { UniverInstanceType as Te, DrawingTypeEnum as re, CommandType as Se, ICommandService as he, LocaleService as ie, ArrangeTypeEnum as Ie, Tools as Et, debounce as Me, Inject as ke, Disposable as Ve, checkIfMove as ot, toDisposable as _e, IUniverInstanceService as Ze, ImageSourceType as qe, Injector as Pt, IConfigService as jt, Plugin as Bt, merge as Ut } from "@univerjs/core";
5
+ import { getDrawingShapeKeyByDrawingSearch as W, ImageSourceType as xt, IDrawingManagerService as ae, IImageIoService as ct, SetDrawingSelectedOperation as Ee } from "@univerjs/drawing";
6
+ import { Group as Ce, DRAWING_OBJECT_LAYER_INDEX as Pe, Image as Ke, Rect as lt, IRenderManagerService as me, getGroupState as Ht, transformObjectOutOfGroup as At, RENDER_CLASS_TYPE as Qe, Shape as Lt, Canvas as kt, precisionTo as Re, CURSOR_TYPE as je, Vector2 as $e, degToRad as et } from "@univerjs/engine-render";
7
+ import { IGalleryService as Vt, useDependency as k, ComponentManager as Wt, IMessageService as Gt, IDialogService as $t } from "@univerjs/ui";
8
+ import { jsxs as P, jsx as g, Fragment as zt } from "react/jsx-runtime";
9
+ import { useState as L, forwardRef as X, useRef as dt, createElement as J, useEffect as be } from "react";
10
+ import { Select as ut, Button as ue, clsx as Y, InputNumber as we, Checkbox as Ft, DropdownMenu as Kt, MessageType as tt } from "@univerjs/design";
11
+ import { switchMap as Yt, of as Zt } from "rxjs";
12
+ function rt(i, r, t, e) {
13
+ const n = e.getDrawingByParam(i);
14
+ if (n == null)
15
15
  return;
16
- const o = G(i), a = n.getObject(o);
17
- if (a && !(a instanceof we))
16
+ const s = W(i), a = t.getObject(s);
17
+ if (a && !(a instanceof Ce))
18
18
  return;
19
19
  if (a != null) {
20
- a.addObject(t);
20
+ a.addObject(r);
21
21
  return;
22
22
  }
23
- const s = new we(o);
24
- n.addObject(s, De).attachTransformerTo(s), s.addObject(t);
25
- const { transform: c } = r;
26
- c && s.transformByState(
23
+ const o = new Ce(s);
24
+ t.addObject(o, Pe).attachTransformerTo(o), o.addObject(r);
25
+ const { transform: c } = n;
26
+ c && o.transformByState(
27
27
  {
28
28
  left: c.left,
29
29
  top: c.top,
@@ -31,209 +31,183 @@ function en(i, t, n, e) {
31
31
  }
32
32
  );
33
33
  }
34
- function un(i, t) {
35
- var o;
36
- const n = t ? i.getUnit(t) : i.getFocusedUnit();
37
- if (n == null)
34
+ function gt(i, r) {
35
+ var s;
36
+ const t = r ? i.getUnit(r) : i.getFocusedUnit();
37
+ if (t == null)
38
38
  return;
39
- const e = n.getUnitId();
40
- let r;
41
- return n.type === Oe.UNIVER_SHEET ? r = (o = n.getActiveSheet()) == null ? void 0 : o.getSheetId() : (n.type === Oe.UNIVER_DOC || n.type === Oe.UNIVER_SLIDE) && (r = e), { unitId: e, subUnitId: r, current: n };
39
+ const e = t.getUnitId();
40
+ let n;
41
+ return t.type === Te.UNIVER_SHEET ? n = (s = t.getActiveSheet()) == null ? void 0 : s.getSheetId() : (t.type === Te.UNIVER_DOC || t.type === Te.UNIVER_SLIDE) && (n = e), { unitId: e, subUnitId: n, current: t };
42
42
  }
43
- const hn = "COMPONENT_IMAGE_VIEWER";
44
- var Jn = Object.getOwnPropertyDescriptor, qn = (i, t, n, e) => {
45
- for (var r = e > 1 ? void 0 : e ? Jn(t, n) : t, o = i.length - 1, a; o >= 0; o--)
46
- (a = i[o]) && (r = a(r) || r);
47
- return r;
48
- }, We = (i, t) => (n, e) => t(n, e, i);
49
- const nn = 50;
50
- let Ee = class {
51
- constructor(i, t, n) {
52
- this._drawingManagerService = i, this._imageIoService = t, this._dialogService = n;
43
+ var Xt = Object.getOwnPropertyDescriptor, Jt = (i, r, t, e) => {
44
+ for (var n = e > 1 ? void 0 : e ? Xt(r, t) : r, s = i.length - 1, a; s >= 0; s--)
45
+ (a = i[s]) && (n = a(n) || n);
46
+ return n;
47
+ }, ze = (i, r) => (t, e) => r(t, e, i);
48
+ let Be = class {
49
+ constructor(i, r, t) {
50
+ this._drawingManagerService = i, this._imageIoService = r, this._galleryService = t;
53
51
  }
54
52
  // eslint-disable-next-line max-lines-per-function
55
- async renderImages(i, t) {
53
+ async renderImages(i, r) {
56
54
  const {
57
- transform: n,
55
+ transform: t,
58
56
  drawingType: e,
59
- source: r,
60
- imageSourceType: o,
57
+ source: n,
58
+ imageSourceType: s,
61
59
  srcRect: a,
62
- prstGeom: s,
60
+ prstGeom: o,
63
61
  groupId: c,
64
62
  unitId: l,
65
- subUnitId: m,
66
- drawingId: d,
63
+ subUnitId: d,
64
+ drawingId: u,
67
65
  isMultiTransform: h,
68
66
  transforms: f
69
67
  } = i;
70
- if (e !== ne.DRAWING_IMAGE || !this._drawingManagerService.getDrawingVisible() || n == null)
68
+ if (e !== re.DRAWING_IMAGE || !this._drawingManagerService.getDrawingVisible() || t == null)
71
69
  return;
72
- const v = h && f ? f : [n], w = [];
73
- for (const p of v) {
74
- const { left: S, top: _, width: M, height: I, angle: N, flipX: P, flipY: b, skewX: y, skewY: R } = p, O = v.indexOf(p), U = G({ unitId: l, subUnitId: m, drawingId: d }, h ? O : void 0), T = t.getObject(U);
70
+ const w = h && f ? f : [t], v = [];
71
+ for (const m of w) {
72
+ const { left: C, top: _, width: R, height: b, angle: N, flipX: I, flipY: S, skewX: y, skewY: M } = m, O = w.indexOf(m), j = W({ unitId: l, subUnitId: d, drawingId: u }, h ? O : void 0), T = r.getObject(j);
75
73
  if (T != null) {
76
- T.transformByState({ left: S, top: _, width: M, height: I, angle: N, flipX: P, flipY: b, skewX: y, skewY: R });
74
+ T.transformByState({ left: C, top: _, width: R, height: b, angle: N, flipX: I, flipY: S, skewX: y, skewY: M });
77
75
  continue;
78
76
  }
79
- const ie = this._drawingManagerService.getDrawingOrder(l, m), W = ie.indexOf(d), q = { ...p, zIndex: W === -1 ? ie.length - 1 : W }, Se = this._imageIoService.getImageSourceCache(r, o);
80
- let ae = !1;
81
- if (Se != null)
82
- q.image = Se;
77
+ const se = this._drawingManagerService.getDrawingOrder(l, d), G = se.indexOf(u), Q = { ...m, zIndex: G === -1 ? se.length - 1 : G }, ye = this._imageIoService.getImageSourceCache(n, s);
78
+ let oe = !1;
79
+ if (ye != null)
80
+ Q.image = ye;
83
81
  else {
84
- if (o === xn.UUID)
82
+ if (s === xt.UUID)
85
83
  try {
86
- q.url = await this._imageIoService.getImage(r);
87
- } catch (ke) {
88
- console.error(ke);
84
+ Q.url = await this._imageIoService.getImage(n);
85
+ } catch (Ge) {
86
+ console.error(Ge);
89
87
  continue;
90
88
  }
91
89
  else
92
- q.url = r;
93
- ae = !0;
90
+ Q.url = n;
91
+ oe = !0;
94
92
  }
95
- if (t.getObject(U))
93
+ if (r.getObject(j))
96
94
  continue;
97
- q.printable = !0;
98
- const z = new ze(U, q);
99
- ae && this._imageIoService.addImageSourceCache(r, o, z.getNative()), this._drawingManagerService.getDrawingVisible() && (t.addObject(z, De), this._drawingManagerService.getDrawingEditable() && t.attachTransformerTo(z), c && en({ drawingId: c, unitId: l, subUnitId: m }, z, t, this._drawingManagerService), s != null && z.setPrstGeom(s), a != null && z.setSrcRect(a), w.push(z));
95
+ Q.printable = !0;
96
+ const z = new Ke(j, Q);
97
+ oe && this._imageIoService.addImageSourceCache(n, s, z.getNative()), this._drawingManagerService.getDrawingVisible() && (r.addObject(z, Pe), this._drawingManagerService.getDrawingEditable() && r.attachTransformerTo(z), c && rt({ drawingId: c, unitId: l, subUnitId: d }, z, r, this._drawingManagerService), o != null && z.setPrstGeom(o), a != null && z.setSrcRect(a), v.push(z));
100
98
  }
101
- return w;
99
+ return v;
102
100
  }
103
- renderFloatDom(i, t) {
101
+ renderFloatDom(i, r) {
104
102
  const {
105
- transform: n,
103
+ transform: t,
106
104
  drawingType: e,
107
- groupId: r,
108
- unitId: o,
105
+ groupId: n,
106
+ unitId: s,
109
107
  subUnitId: a,
110
- drawingId: s,
108
+ drawingId: o,
111
109
  isMultiTransform: c,
112
110
  transforms: l
113
111
  } = i;
114
- if (e !== ne.DRAWING_DOM || !this._drawingManagerService.getDrawingVisible() || n == null)
112
+ if (e !== re.DRAWING_DOM || !this._drawingManagerService.getDrawingVisible() || t == null)
115
113
  return;
116
- const m = c && l ? l : [n], d = [];
117
- for (const h of m) {
118
- const { left: f, top: v, width: w, height: p, angle: S, flipX: _, flipY: M, skewX: I, skewY: N } = h, P = m.indexOf(h), b = G({ unitId: o, subUnitId: a, drawingId: s }, c ? P : void 0), y = t.getObject(b);
114
+ const d = c && l ? l : [t], u = [];
115
+ for (const h of d) {
116
+ const { left: f, top: w, width: v, height: m, angle: C, flipX: _, flipY: R, skewX: b, skewY: N } = h, I = d.indexOf(h), S = W({ unitId: s, subUnitId: a, drawingId: o }, c ? I : void 0), y = r.getObject(S);
119
117
  if (y != null) {
120
- y.transformByState({ left: f, top: v, width: w, height: p, angle: S, flipX: _, flipY: M, skewX: I, skewY: N });
118
+ y.transformByState({ left: f, top: w, width: v, height: m, angle: C, flipX: _, flipY: R, skewX: b, skewY: N });
121
119
  continue;
122
120
  }
123
- const R = this._drawingManagerService.getDrawingOrder(o, a), O = R.indexOf(s), U = { ...h, zIndex: O === -1 ? R.length - 1 : O };
124
- if (t.getObject(b))
121
+ const M = this._drawingManagerService.getDrawingOrder(s, a), O = M.indexOf(o), j = { ...h, zIndex: O === -1 ? M.length - 1 : O };
122
+ if (r.getObject(S))
125
123
  continue;
126
- U.printable = !1;
127
- const T = new ln(b, U);
128
- this._drawingManagerService.getDrawingVisible() && (t.addObject(T, De), this._drawingManagerService.getDrawingEditable() && i.allowTransform !== !1 && t.attachTransformerTo(T), r && en({ drawingId: r, unitId: o, subUnitId: a }, T, t, this._drawingManagerService), d.push(T));
124
+ j.printable = !1;
125
+ const T = new lt(S, j);
126
+ this._drawingManagerService.getDrawingVisible() && (r.addObject(T, Pe), this._drawingManagerService.getDrawingEditable() && i.allowTransform !== !1 && r.attachTransformerTo(T), n && rt({ drawingId: n, unitId: s, subUnitId: a }, T, r, this._drawingManagerService), u.push(T));
129
127
  }
130
- return d;
131
- }
132
- renderDrawing(i, t) {
133
- const n = this._drawingManagerService.getDrawingByParam(i);
134
- if (n != null)
135
- switch (n.drawingType) {
136
- case ne.DRAWING_IMAGE:
137
- return this.renderImages(n, t);
128
+ return u;
129
+ }
130
+ renderDrawing(i, r) {
131
+ const t = this._drawingManagerService.getDrawingByParam(i);
132
+ if (t != null)
133
+ switch (t.drawingType) {
134
+ case re.DRAWING_IMAGE:
135
+ return this.renderImages(t, r);
138
136
  }
139
137
  }
140
- previewImage(i, t, n, e) {
141
- const r = `${i}-viewer-dialog`, o = window.innerWidth - nn, a = window.innerHeight - nn, s = this._adjustImageSize(n, e, o, a), c = this._dialogService.open({
142
- width: Math.max(s.width, 200),
143
- id: r,
144
- style: { margin: "0", top: "50%", left: "50%", transform: "translate(-50%, -50%)" },
145
- children: {
146
- label: {
147
- name: hn,
148
- props: {
149
- src: t,
150
- width: s.width,
151
- height: s.height
152
- }
153
- }
154
- },
155
- destroyOnClose: !0,
156
- draggable: !1,
157
- onClose: () => {
158
- this._dialogService.close(r), c.dispose();
138
+ previewImage(i, r, t, e) {
139
+ this._galleryService.open({
140
+ images: [r],
141
+ // width: adjustSize.width,
142
+ // height: adjustSize.height,
143
+ onOpenChange: (n) => {
144
+ n || this._galleryService.close();
159
145
  }
160
146
  });
161
147
  }
162
- _adjustImageSize(i, t, n, e) {
163
- if (i <= n && t <= e)
148
+ _adjustImageSize(i, r, t, e) {
149
+ if (i <= t && r <= e)
164
150
  return {
165
151
  width: i,
166
- height: t
152
+ height: r
167
153
  };
168
- const r = n / i, o = e / t, a = Math.min(r, o);
154
+ const n = t / i, s = e / r, a = Math.min(n, s);
169
155
  return {
170
156
  width: Math.floor(i * a),
171
- height: Math.floor(t * a)
157
+ height: Math.floor(r * a)
172
158
  };
173
159
  }
174
160
  };
175
- Ee = qn([
176
- We(0, re),
177
- We(1, cn),
178
- We(2, gn)
179
- ], Ee);
180
- function Ve(i, t) {
181
- const n = [];
161
+ Be = Jt([
162
+ ze(0, ae),
163
+ ze(1, ct),
164
+ ze(2, Vt)
165
+ ], Be);
166
+ function We(i, r) {
167
+ const t = [];
182
168
  return i.forEach((e) => {
183
- const { oKey: r, left: o, top: a, height: s, width: c, angle: l } = e, m = t.getDrawingOKey(r);
184
- if (m == null)
185
- return n.push(null), !0;
186
- const { unitId: d, subUnitId: h, drawingId: f, drawingType: v } = m, w = {
187
- unitId: d,
169
+ const { oKey: n, left: s, top: a, height: o, width: c, angle: l } = e, d = r.getDrawingOKey(n);
170
+ if (d == null)
171
+ return t.push(null), !0;
172
+ const { unitId: u, subUnitId: h, drawingId: f, drawingType: w } = d, v = {
173
+ unitId: u,
188
174
  subUnitId: h,
189
175
  drawingId: f,
190
- drawingType: v,
176
+ drawingType: w,
191
177
  transform: {
192
- left: o,
178
+ left: s,
193
179
  top: a,
194
- height: s,
180
+ height: o,
195
181
  width: c,
196
182
  angle: l
197
183
  }
198
184
  };
199
- v === ne.DRAWING_IMAGE && (w.srcRect = e.srcRect), n.push(w);
200
- }), n;
185
+ w === re.DRAWING_IMAGE && (v.srcRect = e.srcRect), t.push(v);
186
+ }), t;
201
187
  }
202
188
  var D = /* @__PURE__ */ ((i) => (i.default = "0", i.left = "1", i.center = "2", i.right = "3", i.top = "4", i.middle = "5", i.bottom = "6", i.horizon = "7", i.vertical = "8", i))(D || {});
203
- const Ye = {
189
+ const Xe = {
204
190
  id: "sheet.operation.set-image-align",
205
- type: ve.OPERATION,
206
- handler: (i, t) => !0
207
- }, Qn = "univer-image-common-panel-grid", et = "univer-image-common-panel-border", nt = "univer-image-common-panel-title", tt = "univer-image-common-panel-row", rt = "univer-image-common-panel-row-vertical", it = "univer-image-common-panel-column", at = "univer-image-common-panel-column-center", ot = "univer-image-common-panel-inline", st = "univer-image-common-panel-span2", ct = "univer-image-common-panel-span3", lt = "univer-image-common-panel-input", g = {
208
- imageCommonPanelGrid: Qn,
209
- imageCommonPanelBorder: et,
210
- imageCommonPanelTitle: nt,
211
- imageCommonPanelRow: tt,
212
- imageCommonPanelRowVertical: rt,
213
- imageCommonPanelColumn: it,
214
- imageCommonPanelColumnCenter: at,
215
- imageCommonPanelInline: ot,
216
- imageCommonPanelSpan2: st,
217
- imageCommonPanelSpan3: ct,
218
- imageCommonPanelInput: lt
219
- }, gt = (i) => {
220
- const t = V(me), n = V(te), { alignShow: e } = i, [r, o] = x(D.default), a = [
191
+ type: Se.OPERATION,
192
+ handler: (i, r) => !0
193
+ }, qt = (i) => {
194
+ const r = k(he), t = k(ie), { alignShow: e } = i, [n, s] = L(D.default), a = [
221
195
  {
222
- label: n.t("image-panel.align.default"),
196
+ label: t.t("image-panel.align.default"),
223
197
  value: D.default
224
198
  },
225
199
  {
226
200
  options: [
227
201
  {
228
- label: n.t("image-panel.align.left"),
202
+ label: t.t("image-panel.align.left"),
229
203
  value: D.left
230
204
  },
231
205
  {
232
- label: n.t("image-panel.align.center"),
206
+ label: t.t("image-panel.align.center"),
233
207
  value: D.center
234
208
  },
235
209
  {
236
- label: n.t("image-panel.align.right"),
210
+ label: t.t("image-panel.align.right"),
237
211
  value: D.right
238
212
  }
239
213
  ]
@@ -241,15 +215,15 @@ const Ye = {
241
215
  {
242
216
  options: [
243
217
  {
244
- label: n.t("image-panel.align.top"),
218
+ label: t.t("image-panel.align.top"),
245
219
  value: D.top
246
220
  },
247
221
  {
248
- label: n.t("image-panel.align.middle"),
222
+ label: t.t("image-panel.align.middle"),
249
223
  value: D.middle
250
224
  },
251
225
  {
252
- label: n.t("image-panel.align.bottom"),
226
+ label: t.t("image-panel.align.bottom"),
253
227
  value: D.bottom
254
228
  }
255
229
  ]
@@ -257,231 +231,263 @@ const Ye = {
257
231
  {
258
232
  options: [
259
233
  {
260
- label: n.t("image-panel.align.horizon"),
234
+ label: t.t("image-panel.align.horizon"),
261
235
  value: D.horizon
262
236
  },
263
237
  {
264
- label: n.t("image-panel.align.vertical"),
238
+ label: t.t("image-panel.align.vertical"),
265
239
  value: D.vertical
266
240
  }
267
241
  ]
268
242
  }
269
243
  ];
270
- function s(l) {
271
- o(l), t.executeCommand(Ye.id, {
244
+ function o(l) {
245
+ s(l), r.executeCommand(Xe.id, {
272
246
  alignType: l
273
247
  });
274
248
  }
275
- const c = (l) => l ? "block" : "none";
276
- return /* @__PURE__ */ j("div", { className: B(g.imageCommonPanelGrid, g.imageCommonPanelBorder), style: { display: c(e) }, children: [
277
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelTitle), children: /* @__PURE__ */ u("div", { children: n.t("image-panel.align.title") }) }) }),
278
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn), children: /* @__PURE__ */ u(dn, { value: r, options: a, onChange: s }) }) })
279
- ] });
249
+ return /* @__PURE__ */ P(
250
+ "div",
251
+ {
252
+ className: `
253
+ univer-relative univer-w-full univer-border-l-0 univer-border-r-0 univer-border-t univer-border-solid
254
+ univer-border-gray-200
255
+ `,
256
+ style: { display: ((l) => l ? "block" : "none")(e) },
257
+ children: [
258
+ /* @__PURE__ */ g(
259
+ "div",
260
+ {
261
+ className: `
262
+ univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
263
+ `,
264
+ children: /* @__PURE__ */ g("div", { className: "univer-w-full univer-text-gray-900", children: /* @__PURE__ */ g("div", { children: t.t("image-panel.align.title") }) })
265
+ }
266
+ ),
267
+ /* @__PURE__ */ g(
268
+ "div",
269
+ {
270
+ className: `
271
+ univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
272
+ `,
273
+ children: /* @__PURE__ */ g("div", { className: "univer-w-full univer-text-gray-900", children: /* @__PURE__ */ g(ut, { value: n, options: a, onChange: o }) })
274
+ }
275
+ )
276
+ ]
277
+ }
278
+ );
280
279
  };
281
280
  var $ = function() {
282
281
  return $ = Object.assign || function(i) {
283
- for (var t, n = 1, e = arguments.length; n < e; n++) {
284
- t = arguments[n];
285
- for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && (i[r] = t[r]);
282
+ for (var r, t = 1, e = arguments.length; t < e; t++) {
283
+ r = arguments[t];
284
+ for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && (i[n] = r[n]);
286
285
  }
287
286
  return i;
288
287
  }, $.apply(this, arguments);
289
- }, mt = function(i, t) {
290
- var n = {};
291
- for (var e in i) Object.prototype.hasOwnProperty.call(i, e) && t.indexOf(e) < 0 && (n[e] = i[e]);
288
+ }, Qt = function(i, r) {
289
+ var t = {};
290
+ for (var e in i) Object.prototype.hasOwnProperty.call(i, e) && r.indexOf(e) < 0 && (t[e] = i[e]);
292
291
  if (i != null && typeof Object.getOwnPropertySymbols == "function")
293
- for (var r = 0, e = Object.getOwnPropertySymbols(i); r < e.length; r++)
294
- t.indexOf(e[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, e[r]) && (n[e[r]] = i[e[r]]);
295
- return n;
296
- }, J = Z(function(i, t) {
297
- var n = i.icon, e = i.id, r = i.className, o = i.extend, a = mt(i, ["icon", "id", "className", "extend"]), s = "univerjs-icon univerjs-icon-".concat(e, " ").concat(r || "").trim(), c = mn("_".concat(ht()));
298
- return fn(n, "".concat(e), { defIds: n.defIds, idSuffix: c.current }, $({ ref: t, className: s }, a), o);
292
+ for (var n = 0, e = Object.getOwnPropertySymbols(i); n < e.length; n++)
293
+ r.indexOf(e[n]) < 0 && Object.prototype.propertyIsEnumerable.call(i, e[n]) && (t[e[n]] = i[e[n]]);
294
+ return t;
295
+ }, q = X(function(i, r) {
296
+ var t = i.icon, e = i.id, n = i.className, s = i.extend, a = Qt(i, ["icon", "id", "className", "extend"]), o = "univerjs-icon univerjs-icon-".concat(e, " ").concat(n || "").trim(), c = dt("_".concat(rr()));
297
+ return ht(t, "".concat(e), { defIds: t.defIds, idSuffix: c.current }, $({ ref: r, className: o }, a), s);
299
298
  });
300
- function fn(i, t, n, e, r) {
301
- return X(i.tag, $($({ key: t }, dt(i, n, r)), e), (ut(i, n).children || []).map(function(o, a) {
302
- return fn(o, "".concat(t, "-").concat(i.tag, "-").concat(a), n, void 0, r);
299
+ function ht(i, r, t, e, n) {
300
+ return J(i.tag, $($({ key: r }, er(i, t, n)), e), (tr(i, t).children || []).map(function(s, a) {
301
+ return ht(s, "".concat(r, "-").concat(i.tag, "-").concat(a), t, void 0, n);
303
302
  }));
304
303
  }
305
- function dt(i, t, n) {
304
+ function er(i, r, t) {
306
305
  var e = $({}, i.attrs);
307
- n != null && n.colorChannel1 && e.fill === "colorChannel1" && (e.fill = n.colorChannel1), i.tag === "mask" && e.id && (e.id = e.id + t.idSuffix), Object.entries(e).forEach(function(o) {
308
- var a = o[0], s = o[1];
309
- a === "mask" && typeof s == "string" && (e[a] = s.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
306
+ t != null && t.colorChannel1 && e.fill === "colorChannel1" && (e.fill = t.colorChannel1), i.tag === "mask" && e.id && (e.id = e.id + r.idSuffix), Object.entries(e).forEach(function(s) {
307
+ var a = s[0], o = s[1];
308
+ a === "mask" && typeof o == "string" && (e[a] = o.replace(/url\(#(.*)\)/, "url(#$1".concat(r.idSuffix, ")")));
310
309
  });
311
- var r = t.defIds;
312
- return !r || r.length === 0 || (i.tag === "use" && e["xlink:href"] && (e["xlink:href"] = e["xlink:href"] + t.idSuffix), Object.entries(e).forEach(function(o) {
313
- var a = o[0], s = o[1];
314
- typeof s == "string" && (e[a] = s.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
310
+ var n = r.defIds;
311
+ return !n || n.length === 0 || (i.tag === "use" && e["xlink:href"] && (e["xlink:href"] = e["xlink:href"] + r.idSuffix), Object.entries(e).forEach(function(s) {
312
+ var a = s[0], o = s[1];
313
+ typeof o == "string" && (e[a] = o.replace(/url\(#(.*)\)/, "url(#$1".concat(r.idSuffix, ")")));
315
314
  })), e;
316
315
  }
317
- function ut(i, t) {
318
- var n, e = t.defIds;
319
- return !e || e.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ? $($({}, i), { children: i.children.map(function(r) {
320
- return typeof r.attrs.id == "string" && e && e.indexOf(r.attrs.id) > -1 ? $($({}, r), { attrs: $($({}, r.attrs), { id: r.attrs.id + t.idSuffix }) }) : r;
316
+ function tr(i, r) {
317
+ var t, e = r.defIds;
318
+ return !e || e.length === 0 ? i : i.tag === "defs" && (!((t = i.children) === null || t === void 0) && t.length) ? $($({}, i), { children: i.children.map(function(n) {
319
+ return typeof n.attrs.id == "string" && e && e.indexOf(n.attrs.id) > -1 ? $($({}, n), { attrs: $($({}, n.attrs), { id: n.attrs.id + r.idSuffix }) }) : n;
321
320
  }) }) : i;
322
321
  }
323
- function ht() {
322
+ function rr() {
324
323
  return Math.random().toString(36).substring(2, 8);
325
324
  }
326
- J.displayName = "UniverIcon";
327
- var ft = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "colorChannel1", d: "M11.0363 12.2367V14.0367C11.0363 14.3681 11.3049 14.6367 11.6363 14.6367C11.9676 14.6367 12.2363 14.3681 12.2363 14.0367V12.2367H14.0364C14.3677 12.2367 14.6364 11.9681 14.6364 11.6367C14.6364 11.3054 14.3677 11.0367 14.0364 11.0367H12.2363V9.23672C12.2363 8.90535 11.9676 8.63672 11.6363 8.63672C11.3049 8.63672 11.0363 8.90535 11.0363 9.23672V11.0367H9.23635C8.90498 11.0367 8.63635 11.3054 8.63635 11.6367C8.63635 11.9681 8.90498 12.2367 9.23635 12.2367H11.0363Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M2.56365 1.36377C1.90091 1.36377 1.36365 1.90103 1.36365 2.56377V6.16377C1.36365 6.82651 1.90091 7.36377 2.56365 7.36377H6.16365C6.82639 7.36377 7.36365 6.82651 7.36365 6.16377V2.56377C7.36365 1.90103 6.82639 1.36377 6.16365 1.36377H2.56365zM6.16365 2.56377H2.56365L2.56365 6.16377H6.16365V2.56377zM2.56365 8.63647C1.90091 8.63647 1.36365 9.17373 1.36365 9.83647V13.4365C1.36365 14.0992 1.90091 14.6365 2.56365 14.6365H6.16365C6.82639 14.6365 7.36365 14.0992 7.36365 13.4365V9.83647C7.36365 9.17373 6.82639 8.63647 6.16365 8.63647H2.56365zM6.16365 9.83647H2.56365L2.56365 13.4365H6.16365V9.83647zM9.83635 7.36377C9.17361 7.36377 8.63635 6.82651 8.63635 6.16377V2.56377C8.63635 1.90103 9.17361 1.36377 9.83635 1.36377H13.4364C14.0991 1.36377 14.6364 1.90103 14.6364 2.56377V6.16377C14.6364 6.82651 14.0991 7.36377 13.4364 7.36377H9.83635zM9.83635 6.16377V2.56377L13.4364 2.56377V6.16377H9.83635z", fillRule: "evenodd", clipRule: "evenodd" } }] }, pn = Z(function(i, t) {
328
- return X(J, Object.assign({}, i, {
325
+ q.displayName = "UniverIcon";
326
+ var nr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "colorChannel1", d: "M11.0363 12.2367V14.0367C11.0363 14.3681 11.3049 14.6367 11.6363 14.6367C11.9676 14.6367 12.2363 14.3681 12.2363 14.0367V12.2367H14.0364C14.3677 12.2367 14.6364 11.9681 14.6364 11.6367C14.6364 11.3054 14.3677 11.0367 14.0364 11.0367H12.2363V9.23672C12.2363 8.90535 11.9676 8.63672 11.6363 8.63672C11.3049 8.63672 11.0363 8.90535 11.0363 9.23672V11.0367H9.23635C8.90498 11.0367 8.63635 11.3054 8.63635 11.6367C8.63635 11.9681 8.90498 12.2367 9.23635 12.2367H11.0363Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M2.56365 1.36377C1.90091 1.36377 1.36365 1.90103 1.36365 2.56377V6.16377C1.36365 6.82651 1.90091 7.36377 2.56365 7.36377H6.16365C6.82639 7.36377 7.36365 6.82651 7.36365 6.16377V2.56377C7.36365 1.90103 6.82639 1.36377 6.16365 1.36377H2.56365zM6.16365 2.56377H2.56365L2.56365 6.16377H6.16365V2.56377zM2.56365 8.63647C1.90091 8.63647 1.36365 9.17373 1.36365 9.83647V13.4365C1.36365 14.0992 1.90091 14.6365 2.56365 14.6365H6.16365C6.82639 14.6365 7.36365 14.0992 7.36365 13.4365V9.83647C7.36365 9.17373 6.82639 8.63647 6.16365 8.63647H2.56365zM6.16365 9.83647H2.56365L2.56365 13.4365H6.16365V9.83647zM9.83635 7.36377C9.17361 7.36377 8.63635 6.82651 8.63635 6.16377V2.56377C8.63635 1.90103 9.17361 1.36377 9.83635 1.36377H13.4364C14.0991 1.36377 14.6364 1.90103 14.6364 2.56377V6.16377C14.6364 6.82651 14.0991 7.36377 13.4364 7.36377H9.83635zM9.83635 6.16377V2.56377L13.4364 2.56377V6.16377H9.83635z", fillRule: "evenodd", clipRule: "evenodd" } }] }, ft = X(function(i, r) {
327
+ return J(q, Object.assign({}, i, {
329
328
  id: "autofill",
330
- ref: t,
331
- icon: ft
329
+ ref: r,
330
+ icon: nr
332
331
  }));
333
332
  });
334
- pn.displayName = "Autofill";
335
- var pt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.0045 4.4334C14.8881 4.4334 15.6045 3.71705 15.6045 2.8334 15.6045 1.94974 14.8881 1.2334 14.0045 1.2334H3.70449C2.82084 1.2334 2.10449 1.94974 2.10449 2.8334 2.10449 3.71705 2.82084 4.4334 3.70449 4.4334H14.0045zM14.4045 2.8334C14.4045 3.05431 14.2254 3.2334 14.0045 3.2334H3.70449C3.48358 3.2334 3.30449 3.05431 3.30449 2.8334 3.30449 2.61248 3.48358 2.4334 3.70449 2.4334H14.0045C14.2254 2.4334 14.4045 2.61249 14.4045 2.8334zM14.1544 8.5999C15.038 8.5999 15.7544 7.88356 15.7544 6.9999 15.7544 6.11625 15.038 5.3999 14.1544 5.3999H3.85439C2.97074 5.3999 2.25439 6.11625 2.25439 6.9999 2.25439 7.88356 2.97074 8.5999 3.85439 8.5999H14.1544zM14.5544 6.9999C14.5544 7.22082 14.3753 7.3999 14.1544 7.3999H3.85439C3.63348 7.3999 3.45439 7.22082 3.45439 6.9999 3.45439 6.77899 3.63348 6.5999 3.85439 6.5999H14.1544C14.3753 6.5999 14.5544 6.77899 14.5544 6.9999z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M8.57975 14.5902L6.58023 12.5907C6.34591 12.3564 6.34591 11.9765 6.58023 11.7421 6.81454 11.5078 7.19444 11.5078 7.42876 11.7421L8.40449 12.7179V10.1664C8.40449 9.83504 8.67312 9.56641 9.00449 9.56641 9.33586 9.56641 9.60449 9.83504 9.60449 10.1664V12.7179L10.5802 11.7421C10.8145 11.5078 11.1944 11.5078 11.4288 11.7421 11.6631 11.9765 11.6631 12.3564 11.4288 12.5907L9.42923 14.5902M8.57975 14.5902C8.58121 14.5917 8.58268 14.5931 8.58416 14.5946 8.64077 14.6502 8.70566 14.6923 8.77482 14.7209 8.84557 14.7502 8.92314 14.7664 9.00449 14.7664 9.08585 14.7664 9.16342 14.7502 9.23416 14.7209 9.30332 14.6923 9.36821 14.6502 9.42482 14.5946" } }] }, Cn = Z(function(i, t) {
336
- return X(J, Object.assign({}, i, {
333
+ ft.displayName = "Autofill";
334
+ var ir = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.0045 4.4334C14.8881 4.4334 15.6045 3.71705 15.6045 2.8334 15.6045 1.94974 14.8881 1.2334 14.0045 1.2334H3.70449C2.82084 1.2334 2.10449 1.94974 2.10449 2.8334 2.10449 3.71705 2.82084 4.4334 3.70449 4.4334H14.0045zM14.4045 2.8334C14.4045 3.05431 14.2254 3.2334 14.0045 3.2334H3.70449C3.48358 3.2334 3.30449 3.05431 3.30449 2.8334 3.30449 2.61248 3.48358 2.4334 3.70449 2.4334H14.0045C14.2254 2.4334 14.4045 2.61249 14.4045 2.8334zM14.1544 8.5999C15.038 8.5999 15.7544 7.88356 15.7544 6.9999 15.7544 6.11625 15.038 5.3999 14.1544 5.3999H3.85439C2.97074 5.3999 2.25439 6.11625 2.25439 6.9999 2.25439 7.88356 2.97074 8.5999 3.85439 8.5999H14.1544zM14.5544 6.9999C14.5544 7.22082 14.3753 7.3999 14.1544 7.3999H3.85439C3.63348 7.3999 3.45439 7.22082 3.45439 6.9999 3.45439 6.77899 3.63348 6.5999 3.85439 6.5999H14.1544C14.3753 6.5999 14.5544 6.77899 14.5544 6.9999z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M8.57975 14.5902L6.58023 12.5907C6.34591 12.3564 6.34591 11.9765 6.58023 11.7421 6.81454 11.5078 7.19444 11.5078 7.42876 11.7421L8.40449 12.7179V10.1664C8.40449 9.83504 8.67312 9.56641 9.00449 9.56641 9.33586 9.56641 9.60449 9.83504 9.60449 10.1664V12.7179L10.5802 11.7421C10.8145 11.5078 11.1944 11.5078 11.4288 11.7421 11.6631 11.9765 11.6631 12.3564 11.4288 12.5907L9.42923 14.5902M8.57975 14.5902C8.58121 14.5917 8.58268 14.5931 8.58416 14.5946 8.64077 14.6502 8.70566 14.6923 8.77482 14.7209 8.84557 14.7502 8.92314 14.7664 9.00449 14.7664 9.08585 14.7664 9.16342 14.7502 9.23416 14.7209 9.30332 14.6923 9.36821 14.6502 9.42482 14.5946" } }] }, mt = X(function(i, r) {
335
+ return J(q, Object.assign({}, i, {
337
336
  id: "bottom-single",
338
- ref: t,
339
- icon: pt
337
+ ref: r,
338
+ icon: ir
340
339
  }));
341
340
  });
342
- Cn.displayName = "BottomSingle";
343
- var Ct = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.97705 7.51296C5.97705 7.18159 6.24568 6.91296 6.57705 6.91296H8.48632C8.81769 6.91296 9.08632 7.18159 9.08632 7.51296 9.08632 7.84433 8.81769 8.11296 8.48632 8.11296H6.57705C6.24568 8.11296 5.97705 7.84433 5.97705 7.51296zM6.57705 9.41028C6.24568 9.41028 5.97705 9.67891 5.97705 10.0103 5.97705 10.3416 6.24568 10.6103 6.57705 10.6103H10.8199C11.1512 10.6103 11.4199 10.3416 11.4199 10.0103 11.4199 9.67891 11.1512 9.41028 10.8199 9.41028H6.57705z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M3.51074 2.37063C3.51074 1.48697 4.22709 0.77063 5.11074 0.77063H9.80318L9.81294 0.770708C9.97168 0.768161 10.1311 0.82824 10.2511 0.95055L14.4317 5.21408C14.5165 5.30049 14.5697 5.406 14.5917 5.51645C14.6041 5.5644 14.6106 5.61467 14.6106 5.66648V11.6406C14.6106 12.5243 13.8943 13.2406 13.0106 13.2406H5.11074C4.22709 13.2406 3.51074 12.5243 3.51074 11.6406V2.37063ZM10.4032 4.66648V2.81964L12.6063 5.06648H10.8032C10.5823 5.06648 10.4032 4.88739 10.4032 4.66648ZM5.11074 1.97063C4.88983 1.97063 4.71074 2.14972 4.71074 2.37063V11.6406C4.71074 11.8615 4.88983 12.0406 5.11074 12.0406H13.0106C13.2316 12.0406 13.4106 11.8615 13.4106 11.6406V6.26648H10.8032C9.91953 6.26648 9.20318 5.55013 9.20318 4.66648V1.97063H5.11074Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M2.58916 6.6741C2.58916 6.34273 2.32053 6.0741 1.98916 6.0741C1.65779 6.0741 1.38916 6.34273 1.38916 6.6741V12.6294C1.38916 14.0653 2.55322 15.2294 3.98916 15.2294H9.41408C9.74545 15.2294 10.0141 14.9607 10.0141 14.6294C10.0141 14.298 9.74545 14.0294 9.41408 14.0294H3.98916C3.21596 14.0294 2.58916 13.4026 2.58916 12.6294V6.6741Z" } }] }, wn = Z(function(i, t) {
344
- return X(J, Object.assign({}, i, {
341
+ mt.displayName = "BottomSingle";
342
+ var ar = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.97705 7.51296C5.97705 7.18159 6.24568 6.91296 6.57705 6.91296H8.48632C8.81769 6.91296 9.08632 7.18159 9.08632 7.51296 9.08632 7.84433 8.81769 8.11296 8.48632 8.11296H6.57705C6.24568 8.11296 5.97705 7.84433 5.97705 7.51296zM6.57705 9.41028C6.24568 9.41028 5.97705 9.67891 5.97705 10.0103 5.97705 10.3416 6.24568 10.6103 6.57705 10.6103H10.8199C11.1512 10.6103 11.4199 10.3416 11.4199 10.0103 11.4199 9.67891 11.1512 9.41028 10.8199 9.41028H6.57705z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M3.51074 2.37063C3.51074 1.48697 4.22709 0.77063 5.11074 0.77063H9.80318L9.81294 0.770708C9.97168 0.768161 10.1311 0.82824 10.2511 0.95055L14.4317 5.21408C14.5165 5.30049 14.5697 5.406 14.5917 5.51645C14.6041 5.5644 14.6106 5.61467 14.6106 5.66648V11.6406C14.6106 12.5243 13.8943 13.2406 13.0106 13.2406H5.11074C4.22709 13.2406 3.51074 12.5243 3.51074 11.6406V2.37063ZM10.4032 4.66648V2.81964L12.6063 5.06648H10.8032C10.5823 5.06648 10.4032 4.88739 10.4032 4.66648ZM5.11074 1.97063C4.88983 1.97063 4.71074 2.14972 4.71074 2.37063V11.6406C4.71074 11.8615 4.88983 12.0406 5.11074 12.0406H13.0106C13.2316 12.0406 13.4106 11.8615 13.4106 11.6406V6.26648H10.8032C9.91953 6.26648 9.20318 5.55013 9.20318 4.66648V1.97063H5.11074Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M2.58916 6.6741C2.58916 6.34273 2.32053 6.0741 1.98916 6.0741C1.65779 6.0741 1.38916 6.34273 1.38916 6.6741V12.6294C1.38916 14.0653 2.55322 15.2294 3.98916 15.2294H9.41408C9.74545 15.2294 10.0141 14.9607 10.0141 14.6294C10.0141 14.298 9.74545 14.0294 9.41408 14.0294H3.98916C3.21596 14.0294 2.58916 13.4026 2.58916 12.6294V6.6741Z" } }] }, pt = X(function(i, r) {
343
+ return J(q, Object.assign({}, i, {
345
344
  id: "create-copy-single",
346
- ref: t,
347
- icon: Ct
345
+ ref: r,
346
+ icon: ar
348
347
  }));
349
348
  });
350
- wn.displayName = "CreateCopySingle";
351
- var wt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.38125 1.16211C6.49759 1.16211 5.78125 1.87845 5.78125 2.76211V5.6377H2.87783C1.99418 5.6377 1.27783 6.35404 1.27783 7.2377V13.2377C1.27783 14.1214 1.99418 14.8377 2.87783 14.8377H8.87783C9.76149 14.8377 10.4778 14.1214 10.4778 13.2377V10.3621H13.3813C14.2649 10.3621 14.9813 9.64577 14.9813 8.76211V2.76211C14.9813 1.87845 14.2649 1.16211 13.3813 1.16211H7.38125ZM10.4778 9.16211H13.3813C13.6022 9.16211 13.7812 8.98302 13.7812 8.76211V2.76211C13.7812 2.5412 13.6022 2.36211 13.3813 2.36211H7.38125C7.16034 2.36211 6.98125 2.5412 6.98125 2.76211V5.6377H8.87783C9.76149 5.6377 10.4778 6.35404 10.4778 7.2377V9.16211ZM6.98125 6.8377H8.87783C9.09875 6.8377 9.27783 7.01678 9.27783 7.2377V9.16211H7.38125C7.16034 9.16211 6.98125 8.98302 6.98125 8.76211V6.8377ZM5.78125 6.8377V8.76211C5.78125 9.64577 6.49759 10.3621 7.38125 10.3621H9.27783V13.2377C9.27783 13.4586 9.09875 13.6377 8.87783 13.6377H2.87783C2.65692 13.6377 2.47783 13.4586 2.47783 13.2377V7.2377C2.47783 7.01678 2.65692 6.8377 2.87783 6.8377H5.78125Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, vn = Z(function(i, t) {
352
- return X(J, Object.assign({}, i, {
349
+ pt.displayName = "CreateCopySingle";
350
+ var sr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.38125 1.16211C6.49759 1.16211 5.78125 1.87845 5.78125 2.76211V5.6377H2.87783C1.99418 5.6377 1.27783 6.35404 1.27783 7.2377V13.2377C1.27783 14.1214 1.99418 14.8377 2.87783 14.8377H8.87783C9.76149 14.8377 10.4778 14.1214 10.4778 13.2377V10.3621H13.3813C14.2649 10.3621 14.9813 9.64577 14.9813 8.76211V2.76211C14.9813 1.87845 14.2649 1.16211 13.3813 1.16211H7.38125ZM10.4778 9.16211H13.3813C13.6022 9.16211 13.7812 8.98302 13.7812 8.76211V2.76211C13.7812 2.5412 13.6022 2.36211 13.3813 2.36211H7.38125C7.16034 2.36211 6.98125 2.5412 6.98125 2.76211V5.6377H8.87783C9.76149 5.6377 10.4778 6.35404 10.4778 7.2377V9.16211ZM6.98125 6.8377H8.87783C9.09875 6.8377 9.27783 7.01678 9.27783 7.2377V9.16211H7.38125C7.16034 9.16211 6.98125 8.98302 6.98125 8.76211V6.8377ZM5.78125 6.8377V8.76211C5.78125 9.64577 6.49759 10.3621 7.38125 10.3621H9.27783V13.2377C9.27783 13.4586 9.09875 13.6377 8.87783 13.6377H2.87783C2.65692 13.6377 2.47783 13.4586 2.47783 13.2377V7.2377C2.47783 7.01678 2.65692 6.8377 2.87783 6.8377H5.78125Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, vt = X(function(i, r) {
351
+ return J(q, Object.assign({}, i, {
353
352
  id: "group-single",
354
- ref: t,
355
- icon: wt
353
+ ref: r,
354
+ icon: sr
356
355
  }));
357
356
  });
358
- vn.displayName = "GroupSingle";
359
- var vt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, _n = Z(function(i, t) {
360
- return X(J, Object.assign({}, i, {
357
+ vt.displayName = "GroupSingle";
358
+ var or = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, wt = X(function(i, r) {
359
+ return J(q, Object.assign({}, i, {
361
360
  id: "more-down-single",
362
- ref: t,
363
- icon: vt
361
+ ref: r,
362
+ icon: or
364
363
  }));
365
364
  });
366
- _n.displayName = "MoreDownSingle";
367
- var _t = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.25 2.96401C1.25 3.84767 1.96634 4.56401 2.85 4.56401H13.15C14.0337 4.56401 14.75 3.84767 14.75 2.96401C14.75 2.08036 14.0337 1.36401 13.15 1.36401H2.85C1.96635 1.36401 1.25 2.08036 1.25 2.96401ZM2.85 3.36401C2.62909 3.36401 2.45 3.18493 2.45 2.96401C2.45 2.7431 2.62909 2.56401 2.85 2.56401H13.15C13.3709 2.56401 13.55 2.7431 13.55 2.96401C13.55 3.18493 13.3709 3.36401 13.15 3.36401H2.85Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M5.57564 11.6118C5.80995 11.3774 6.18985 11.3774 6.42417 11.6118L7.3999 12.5875V6.36951C7.3999 6.03814 7.66853 5.76951 7.9999 5.76951C8.33127 5.76951 8.5999 6.03814 8.5999 6.36951V12.5875L9.57564 11.6118C9.80995 11.3774 10.1899 11.3774 10.4242 11.6118C10.6585 11.8461 10.6585 12.226 10.4242 12.4603L8.4324 14.452C8.32324 14.5655 8.16982 14.6362 7.9999 14.6362C7.82998 14.6362 7.67655 14.5655 7.56739 14.452L5.57564 12.4603C5.34132 12.226 5.34132 11.8461 5.57564 11.6118Z" } }] }, Sn = Z(function(i, t) {
368
- return X(J, Object.assign({}, i, {
365
+ wt.displayName = "MoreDownSingle";
366
+ var cr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.25 2.96401C1.25 3.84767 1.96634 4.56401 2.85 4.56401H13.15C14.0337 4.56401 14.75 3.84767 14.75 2.96401C14.75 2.08036 14.0337 1.36401 13.15 1.36401H2.85C1.96635 1.36401 1.25 2.08036 1.25 2.96401ZM2.85 3.36401C2.62909 3.36401 2.45 3.18493 2.45 2.96401C2.45 2.7431 2.62909 2.56401 2.85 2.56401H13.15C13.3709 2.56401 13.55 2.7431 13.55 2.96401C13.55 3.18493 13.3709 3.36401 13.15 3.36401H2.85Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M5.57564 11.6118C5.80995 11.3774 6.18985 11.3774 6.42417 11.6118L7.3999 12.5875V6.36951C7.3999 6.03814 7.66853 5.76951 7.9999 5.76951C8.33127 5.76951 8.5999 6.03814 8.5999 6.36951V12.5875L9.57564 11.6118C9.80995 11.3774 10.1899 11.3774 10.4242 11.6118C10.6585 11.8461 10.6585 12.226 10.4242 12.4603L8.4324 14.452C8.32324 14.5655 8.16982 14.6362 7.9999 14.6362C7.82998 14.6362 7.67655 14.5655 7.56739 14.452L5.57564 12.4603C5.34132 12.226 5.34132 11.8461 5.57564 11.6118Z" } }] }, _t = X(function(i, r) {
367
+ return J(q, Object.assign({}, i, {
369
368
  id: "move-down-single",
370
- ref: t,
371
- icon: _t
369
+ ref: r,
370
+ icon: cr
372
371
  }));
373
372
  });
374
- Sn.displayName = "MoveDownSingle";
375
- var St = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.25 13.036C1.25 12.1523 1.96634 11.436 2.85 11.436H13.15C14.0337 11.436 14.75 12.1523 14.75 13.036C14.75 13.9196 14.0337 14.636 13.15 14.636H2.85C1.96635 14.636 1.25 13.9196 1.25 13.036ZM2.85 12.636C2.62909 12.636 2.45 12.8151 2.45 13.036C2.45 13.2569 2.62909 13.436 2.85 13.436H13.15C13.3709 13.436 13.55 13.2569 13.55 13.036C13.55 12.8151 13.3709 12.636 13.15 12.636H2.85Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M5.57564 4.38825C5.80995 4.62256 6.18985 4.62256 6.42417 4.38825L7.3999 3.41251V9.63049C7.3999 9.96186 7.66853 10.2305 7.9999 10.2305C8.33127 10.2305 8.5999 9.96186 8.5999 9.63049V3.41251L9.57564 4.38825C9.80995 4.62256 10.1899 4.62256 10.4242 4.38825C10.6585 4.15393 10.6585 3.77403 10.4242 3.53972L8.4324 1.54796C8.32324 1.43445 8.16982 1.36382 7.9999 1.36382C7.82998 1.36382 7.67655 1.43446 7.56739 1.54797L5.57564 3.53972C5.34132 3.77403 5.34132 4.15393 5.57564 4.38825Z" } }] }, bn = Z(function(i, t) {
376
- return X(J, Object.assign({}, i, {
373
+ _t.displayName = "MoveDownSingle";
374
+ var lr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.25 13.036C1.25 12.1523 1.96634 11.436 2.85 11.436H13.15C14.0337 11.436 14.75 12.1523 14.75 13.036C14.75 13.9196 14.0337 14.636 13.15 14.636H2.85C1.96635 14.636 1.25 13.9196 1.25 13.036ZM2.85 12.636C2.62909 12.636 2.45 12.8151 2.45 13.036C2.45 13.2569 2.62909 13.436 2.85 13.436H13.15C13.3709 13.436 13.55 13.2569 13.55 13.036C13.55 12.8151 13.3709 12.636 13.15 12.636H2.85Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M5.57564 4.38825C5.80995 4.62256 6.18985 4.62256 6.42417 4.38825L7.3999 3.41251V9.63049C7.3999 9.96186 7.66853 10.2305 7.9999 10.2305C8.33127 10.2305 8.5999 9.96186 8.5999 9.63049V3.41251L9.57564 4.38825C9.80995 4.62256 10.1899 4.62256 10.4242 4.38825C10.6585 4.15393 10.6585 3.77403 10.4242 3.53972L8.4324 1.54796C8.32324 1.43445 8.16982 1.36382 7.9999 1.36382C7.82998 1.36382 7.67655 1.43446 7.56739 1.54797L5.57564 3.53972C5.34132 3.77403 5.34132 4.15393 5.57564 4.38825Z" } }] }, Ct = X(function(i, r) {
375
+ return J(q, Object.assign({}, i, {
377
376
  id: "move-up-single",
378
- ref: t,
379
- icon: St
377
+ ref: r,
378
+ icon: lr
380
379
  }));
381
380
  });
382
- bn.displayName = "MoveUpSingle";
383
- var bt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.82994 1.40913C7.88746 1.35161 7.95376 1.30821 8.02453 1.27893C8.09527 1.24959 8.17285 1.2334 8.2542 1.2334C8.33555 1.2334 8.41313 1.24959 8.48387 1.27893C8.55464 1.30821 8.62094 1.35161 8.67846 1.40913L10.6785 3.40913C10.9128 3.64345 10.9128 4.02335 10.6785 4.25766C10.4441 4.49198 10.0642 4.49198 9.82994 4.25766L8.8542 3.28193V5.8334C8.8542 6.16477 8.58557 6.4334 8.2542 6.4334C7.92283 6.4334 7.6542 6.16477 7.6542 5.8334V3.28193L6.67846 4.25766C6.44415 4.49198 6.06425 4.49198 5.82994 4.25766C5.59562 4.02335 5.59562 3.64345 5.82994 3.40913L7.82994 1.40913Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.50439 9C1.50439 8.11634 2.22074 7.4 3.10439 7.4H13.4044C14.288 7.4 15.0044 8.11634 15.0044 9 15.0044 9.88366 14.2881 10.6 13.4044 10.6H3.1044C2.22074 10.6 1.50439 9.88366 1.50439 9zM3.10439 8.6C2.88348 8.6 2.70439 8.77909 2.70439 9 2.70439 9.22091 2.88348 9.4 3.1044 9.4H13.4044C13.6253 9.4 13.8044 9.22091 13.8044 9 13.8044 8.77909 13.6253 8.6 13.4044 8.6H3.10439zM1.6543 13.1665C1.6543 12.2828 2.37064 11.5665 3.2543 11.5665H13.5543C14.438 11.5665 15.1543 12.2828 15.1543 13.1665 15.1543 14.0502 14.438 14.7665 13.5543 14.7665H3.2543C2.37064 14.7665 1.6543 14.0502 1.6543 13.1665zM3.2543 12.7665C3.03338 12.7665 2.8543 12.9456 2.8543 13.1665 2.8543 13.3874 3.03338 13.5665 3.2543 13.5665H13.5543C13.7752 13.5665 13.9543 13.3874 13.9543 13.1665 13.9543 12.9456 13.7752 12.7665 13.5543 12.7665H3.2543z", fillRule: "evenodd", clipRule: "evenodd" } }] }, In = Z(function(i, t) {
384
- return X(J, Object.assign({}, i, {
381
+ Ct.displayName = "MoveUpSingle";
382
+ var dr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.82994 1.40913C7.88746 1.35161 7.95376 1.30821 8.02453 1.27893C8.09527 1.24959 8.17285 1.2334 8.2542 1.2334C8.33555 1.2334 8.41313 1.24959 8.48387 1.27893C8.55464 1.30821 8.62094 1.35161 8.67846 1.40913L10.6785 3.40913C10.9128 3.64345 10.9128 4.02335 10.6785 4.25766C10.4441 4.49198 10.0642 4.49198 9.82994 4.25766L8.8542 3.28193V5.8334C8.8542 6.16477 8.58557 6.4334 8.2542 6.4334C7.92283 6.4334 7.6542 6.16477 7.6542 5.8334V3.28193L6.67846 4.25766C6.44415 4.49198 6.06425 4.49198 5.82994 4.25766C5.59562 4.02335 5.59562 3.64345 5.82994 3.40913L7.82994 1.40913Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.50439 9C1.50439 8.11634 2.22074 7.4 3.10439 7.4H13.4044C14.288 7.4 15.0044 8.11634 15.0044 9 15.0044 9.88366 14.2881 10.6 13.4044 10.6H3.1044C2.22074 10.6 1.50439 9.88366 1.50439 9zM3.10439 8.6C2.88348 8.6 2.70439 8.77909 2.70439 9 2.70439 9.22091 2.88348 9.4 3.1044 9.4H13.4044C13.6253 9.4 13.8044 9.22091 13.8044 9 13.8044 8.77909 13.6253 8.6 13.4044 8.6H3.10439zM1.6543 13.1665C1.6543 12.2828 2.37064 11.5665 3.2543 11.5665H13.5543C14.438 11.5665 15.1543 12.2828 15.1543 13.1665 15.1543 14.0502 14.438 14.7665 13.5543 14.7665H3.2543C2.37064 14.7665 1.6543 14.0502 1.6543 13.1665zM3.2543 12.7665C3.03338 12.7665 2.8543 12.9456 2.8543 13.1665 2.8543 13.3874 3.03338 13.5665 3.2543 13.5665H13.5543C13.7752 13.5665 13.9543 13.3874 13.9543 13.1665 13.9543 12.9456 13.7752 12.7665 13.5543 12.7665H3.2543z", fillRule: "evenodd", clipRule: "evenodd" } }] }, St = X(function(i, r) {
383
+ return J(q, Object.assign({}, i, {
385
384
  id: "topmost-single",
386
- ref: t,
387
- icon: bt
385
+ ref: r,
386
+ icon: dr
388
387
  }));
389
388
  });
390
- In.displayName = "TopmostSingle";
391
- var It = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.46855 2.83731C7.46855 2.61639 7.64764 2.4373 7.86855 2.4373H13.8603C14.0812 2.4373 14.2603 2.61639 14.2603 2.8373V9.5049C14.2603 9.72581 14.0812 9.90489 13.8603 9.90489H12.866C12.5346 9.90489 12.266 10.1735 12.266 10.5049C12.266 10.8363 12.5346 11.1049 12.866 11.1049H13.8603C14.7439 11.1049 15.4603 10.3886 15.4603 9.5049V2.8373C15.4603 1.95365 14.7439 1.2373 13.8603 1.2373H7.86855C6.9849 1.2373 6.26855 1.95365 6.26855 2.83731V3.48688C6.26855 3.81825 6.53718 4.08688 6.86855 4.08688C7.19993 4.08688 7.46855 3.81825 7.46855 3.48688V2.83731Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M3.19888 5.56299C2.31522 5.56299 1.59888 6.27933 1.59888 7.16299V13.163C1.59888 14.0466 2.31522 14.763 3.19888 14.763H9.19888C10.0825 14.763 10.7989 14.0466 10.7989 13.163V7.16299C10.7989 6.27933 10.0825 5.56299 9.19888 5.56299H3.19888ZM2.79888 7.16299C2.79888 6.94207 2.97796 6.76299 3.19888 6.76299H9.19888C9.41979 6.76299 9.59888 6.94207 9.59888 7.16299V13.163C9.59888 13.3839 9.41979 13.563 9.19888 13.563H3.19888C2.97796 13.563 2.79888 13.3839 2.79888 13.163V7.16299Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, yn = Z(function(i, t) {
392
- return X(J, Object.assign({}, i, {
389
+ St.displayName = "TopmostSingle";
390
+ var ur = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.46855 2.83731C7.46855 2.61639 7.64764 2.4373 7.86855 2.4373H13.8603C14.0812 2.4373 14.2603 2.61639 14.2603 2.8373V9.5049C14.2603 9.72581 14.0812 9.90489 13.8603 9.90489H12.866C12.5346 9.90489 12.266 10.1735 12.266 10.5049C12.266 10.8363 12.5346 11.1049 12.866 11.1049H13.8603C14.7439 11.1049 15.4603 10.3886 15.4603 9.5049V2.8373C15.4603 1.95365 14.7439 1.2373 13.8603 1.2373H7.86855C6.9849 1.2373 6.26855 1.95365 6.26855 2.83731V3.48688C6.26855 3.81825 6.53718 4.08688 6.86855 4.08688C7.19993 4.08688 7.46855 3.81825 7.46855 3.48688V2.83731Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M3.19888 5.56299C2.31522 5.56299 1.59888 6.27933 1.59888 7.16299V13.163C1.59888 14.0466 2.31522 14.763 3.19888 14.763H9.19888C10.0825 14.763 10.7989 14.0466 10.7989 13.163V7.16299C10.7989 6.27933 10.0825 5.56299 9.19888 5.56299H3.19888ZM2.79888 7.16299C2.79888 6.94207 2.97796 6.76299 3.19888 6.76299H9.19888C9.41979 6.76299 9.59888 6.94207 9.59888 7.16299V13.163C9.59888 13.3839 9.41979 13.563 9.19888 13.563H3.19888C2.97796 13.563 2.79888 13.3839 2.79888 13.163V7.16299Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, bt = X(function(i, r) {
391
+ return J(q, Object.assign({}, i, {
393
392
  id: "ungroup-single",
394
- ref: t,
395
- icon: It
393
+ ref: r,
394
+ icon: ur
396
395
  }));
397
396
  });
398
- yn.displayName = "UngroupSingle";
399
- const yt = (i) => {
400
- const { arrangeShow: t, drawings: n } = i, e = V(te), r = V(re), o = (l) => l ? "block" : "none", [a, s] = x(n);
401
- _e(() => {
402
- const l = r.focus$.subscribe((m) => {
403
- s(m);
397
+ bt.displayName = "UngroupSingle";
398
+ const U = "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-between univer-gap-2 univer-flex-no-wrap", B = "univer-w-full univer-text-left univer-text-gray-400", ne = "univer-flex univer-items-center univer-gap-1", gr = (i) => {
399
+ const { arrangeShow: r, drawings: t } = i, e = k(ie), n = k(ae), s = (l) => l ? "block" : "none", [a, o] = L(t);
400
+ be(() => {
401
+ const l = n.focus$.subscribe((d) => {
402
+ o(d);
404
403
  });
405
404
  return () => {
406
405
  l.unsubscribe();
407
406
  };
408
407
  }, []);
409
408
  const c = (l) => {
410
- const m = a[0].unitId, d = a[0].subUnitId, h = a.map((f) => f.drawingId);
411
- r.featurePluginOrderUpdateNotification({ unitId: m, subUnitId: d, drawingIds: h, arrangeType: l });
409
+ const d = a[0].unitId, u = a[0].subUnitId, h = a.map((f) => f.drawingId);
410
+ n.featurePluginOrderUpdateNotification({ unitId: d, subUnitId: u, drawingIds: h, arrangeType: l });
412
411
  };
413
- return /* @__PURE__ */ j("div", { className: g.imageCommonPanelGrid, style: { display: o(t) }, children: [
414
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelTitle), children: /* @__PURE__ */ u("div", { children: e.t("image-panel.arrange.title") }) }) }),
415
- /* @__PURE__ */ j("div", { className: g.imageCommonPanelRow, children: [
416
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan2), children: /* @__PURE__ */ u(le, { onClick: () => {
417
- c(be.forward);
418
- }, children: /* @__PURE__ */ j("span", { className: g.imageCommonPanelInline, children: [
419
- /* @__PURE__ */ u(bn, {}),
420
- e.t("image-panel.arrange.forward")
421
- ] }) }) }),
422
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan2), children: /* @__PURE__ */ u(le, { onClick: () => {
423
- c(be.backward);
424
- }, children: /* @__PURE__ */ j("span", { className: g.imageCommonPanelInline, children: [
425
- /* @__PURE__ */ u(Sn, {}),
426
- e.t("image-panel.arrange.backward")
427
- ] }) }) })
428
- ] }),
429
- /* @__PURE__ */ j("div", { className: g.imageCommonPanelRow, children: [
430
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan2), children: /* @__PURE__ */ u(le, { onClick: () => {
431
- c(be.front);
432
- }, children: /* @__PURE__ */ j("span", { className: g.imageCommonPanelInline, children: [
433
- /* @__PURE__ */ u(In, {}),
434
- e.t("image-panel.arrange.front")
435
- ] }) }) }),
436
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan2), children: /* @__PURE__ */ u(le, { onClick: () => {
437
- c(be.back);
438
- }, children: /* @__PURE__ */ j("span", { className: g.imageCommonPanelInline, children: [
439
- /* @__PURE__ */ u(Cn, {}),
440
- e.t("image-panel.arrange.back")
441
- ] }) }) })
442
- ] })
443
- ] });
444
- }, Pt = (i) => {
445
- const t = V(te), n = V(ue), e = V(re), { hasGroup: r, drawings: o } = i, [a, s] = x(!1), [c, l] = x(!0), [m, d] = x(!0), h = (p) => p ? "block" : "none", f = () => {
446
- const p = e.getFocusDrawings(), { unitId: S, subUnitId: _ } = p[0], M = jn.generateRandomId(10), I = Vn(0, 0, p.map((b) => b.transform || {})), N = {
447
- unitId: S,
412
+ return /* @__PURE__ */ P(
413
+ "div",
414
+ {
415
+ className: "univer-relative univer-mt-5 univer-w-full",
416
+ style: { display: s(r) },
417
+ children: [
418
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g("div", { children: e.t("image-panel.arrange.title") }) }) }),
419
+ /* @__PURE__ */ P("div", { className: U, children: [
420
+ /* @__PURE__ */ g("div", { className: "univer-w-1/2", children: /* @__PURE__ */ g(ue, { onClick: () => {
421
+ c(Ie.forward);
422
+ }, children: /* @__PURE__ */ P("span", { className: ne, children: [
423
+ /* @__PURE__ */ g(Ct, {}),
424
+ e.t("image-panel.arrange.forward")
425
+ ] }) }) }),
426
+ /* @__PURE__ */ g("div", { className: "univer-w-1/2", children: /* @__PURE__ */ g(ue, { onClick: () => {
427
+ c(Ie.backward);
428
+ }, children: /* @__PURE__ */ P("span", { className: ne, children: [
429
+ /* @__PURE__ */ g(_t, {}),
430
+ e.t("image-panel.arrange.backward")
431
+ ] }) }) })
432
+ ] }),
433
+ /* @__PURE__ */ P("div", { className: U, children: [
434
+ /* @__PURE__ */ g("div", { className: "univer-w-1/2", children: /* @__PURE__ */ g(ue, { onClick: () => {
435
+ c(Ie.front);
436
+ }, children: /* @__PURE__ */ P("span", { className: ne, children: [
437
+ /* @__PURE__ */ g(St, {}),
438
+ e.t("image-panel.arrange.front")
439
+ ] }) }) }),
440
+ /* @__PURE__ */ g("div", { className: "univer-w-1/2", children: /* @__PURE__ */ g(ue, { onClick: () => {
441
+ c(Ie.back);
442
+ }, children: /* @__PURE__ */ P("span", { className: ne, children: [
443
+ /* @__PURE__ */ g(mt, {}),
444
+ e.t("image-panel.arrange.back")
445
+ ] }) }) })
446
+ ] })
447
+ ]
448
+ }
449
+ );
450
+ }, hr = (i) => {
451
+ const r = k(ie), t = k(me), e = k(ae), { hasGroup: n, drawings: s } = i, [a, o] = L(!1), [c, l] = L(!0), [d, u] = L(!0), h = (m) => m ? "block" : "none", f = () => {
452
+ const m = e.getFocusDrawings(), { unitId: C, subUnitId: _ } = m[0], R = Et.generateRandomId(10), b = Ht(0, 0, m.map((S) => S.transform || {})), N = {
453
+ unitId: C,
448
454
  subUnitId: _,
449
- drawingId: M,
450
- drawingType: ne.DRAWING_GROUP,
451
- transform: I
452
- }, P = p.map((b) => {
453
- const y = b.transform || { left: 0, top: 0 }, { unitId: R, subUnitId: O, drawingId: U } = b;
455
+ drawingId: R,
456
+ drawingType: re.DRAWING_GROUP,
457
+ transform: b
458
+ }, I = m.map((S) => {
459
+ const y = S.transform || { left: 0, top: 0 }, { unitId: M, subUnitId: O, drawingId: j } = S;
454
460
  return {
455
- unitId: R,
461
+ unitId: M,
456
462
  subUnitId: O,
457
- drawingId: U,
463
+ drawingId: j,
458
464
  transform: {
459
465
  ...y,
460
- left: y.left - I.left,
461
- top: y.top - I.top
466
+ left: y.left - b.left,
467
+ top: y.top - b.top
462
468
  },
463
- groupId: M
469
+ groupId: R
464
470
  };
465
471
  });
466
472
  e.featurePluginGroupUpdateNotification([{
467
473
  parent: N,
468
- children: P
474
+ children: I
469
475
  }]);
470
- }, v = (p) => {
471
- if (p.drawingType !== ne.DRAWING_GROUP)
476
+ }, w = (m) => {
477
+ if (m.drawingType !== re.DRAWING_GROUP)
472
478
  return;
473
- const { unitId: S, subUnitId: _, drawingId: M, transform: I = { width: 0, height: 0 } } = p;
474
- if (I == null)
479
+ const { unitId: C, subUnitId: _, drawingId: R, transform: b = { width: 0, height: 0 } } = m;
480
+ if (b == null)
475
481
  return;
476
- const N = e.getDrawingsByGroup({ unitId: S, subUnitId: _, drawingId: M });
482
+ const N = e.getDrawingsByGroup({ unitId: C, subUnitId: _, drawingId: R });
477
483
  if (N.length === 0)
478
484
  return;
479
- const P = N.map((b) => {
480
- const { transform: y } = b, { unitId: R, subUnitId: O, drawingId: U } = b, T = kn(y || {}, I, I.width || 0, I.height || 0);
485
+ const I = N.map((S) => {
486
+ const { transform: y } = S, { unitId: M, subUnitId: O, drawingId: j } = S, T = At(y || {}, b, b.width || 0, b.height || 0);
481
487
  return {
482
- unitId: R,
488
+ unitId: M,
483
489
  subUnitId: O,
484
- drawingId: U,
490
+ drawingId: j,
485
491
  transform: {
486
492
  ...y,
487
493
  ...T
@@ -490,388 +496,402 @@ const yt = (i) => {
490
496
  };
491
497
  });
492
498
  return {
493
- parent: p,
494
- children: P
499
+ parent: m,
500
+ children: I
495
501
  };
496
- }, w = () => {
497
- const S = e.getFocusDrawings().map(
498
- (_) => v(_)
502
+ }, v = () => {
503
+ const C = e.getFocusDrawings().map(
504
+ (_) => w(_)
499
505
  ).filter((_) => _ != null);
500
- S.length !== 0 && e.featurePluginUngroupUpdateNotification(S);
506
+ C.length !== 0 && e.featurePluginUngroupUpdateNotification(C);
501
507
  };
502
- return _e(() => {
503
- const p = o[0];
504
- if (p == null)
508
+ return be(() => {
509
+ const m = s[0];
510
+ if (m == null)
505
511
  return;
506
- const { unitId: S } = p, _ = n.getRenderById(S), M = _ == null ? void 0 : _.scene;
507
- if (M == null)
512
+ const { unitId: C } = m, _ = t.getRenderById(C), R = _ == null ? void 0 : _.scene;
513
+ if (R == null)
508
514
  return;
509
- const I = M.getTransformerByCreate(), N = I.clearControl$.subscribe((b) => {
510
- b === !0 && s(!1);
511
- }), P = I.changeStart$.subscribe((b) => {
512
- const { objects: y } = b, R = Ve(y, e), O = R.filter((W) => (W == null ? void 0 : W.drawingType) === ne.DRAWING_GROUP);
513
- let U = !1, T = !1;
514
- R.length > 1 && (U = !0), O.length > 0 && (T = !0), s(U || T), l(U), d(T);
515
+ const b = R.getTransformerByCreate(), N = b.clearControl$.subscribe((S) => {
516
+ S === !0 && o(!1);
517
+ }), I = b.changeStart$.subscribe((S) => {
518
+ const { objects: y } = S, M = We(y, e), O = M.filter((G) => (G == null ? void 0 : G.drawingType) === re.DRAWING_GROUP);
519
+ let j = !1, T = !1;
520
+ M.length > 1 && (j = !0), O.length > 0 && (T = !0), o(j || T), l(j), u(T);
515
521
  });
516
522
  return () => {
517
- P.unsubscribe(), N.unsubscribe();
523
+ I.unsubscribe(), N.unsubscribe();
518
524
  };
519
- }, []), /* @__PURE__ */ j("div", { className: B(g.imageCommonPanelGrid, g.imageCommonPanelBorder), style: { display: h(r === !0 ? a : !1) }, children: [
520
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelTitle), children: /* @__PURE__ */ u("div", { children: t.t("image-panel.group.title") }) }) }),
521
- /* @__PURE__ */ j("div", { className: g.imageCommonPanelRow, children: [
522
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan2, g.imageCommonPanelColumnCenter), children: /* @__PURE__ */ u(le, { style: { display: h(c) }, onClick: f, children: /* @__PURE__ */ j("span", { className: g.imageCommonPanelInline, children: [
523
- /* @__PURE__ */ u(vn, {}),
524
- t.t("image-panel.group.group")
525
+ }, []), /* @__PURE__ */ P("div", { className: "univer-relative univer-mt-5 univer-w-full", style: { display: h(n === !0 ? a : !1) }, children: [
526
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g("div", { children: r.t("image-panel.group.title") }) }) }),
527
+ /* @__PURE__ */ P("div", { className: U, children: [
528
+ /* @__PURE__ */ g("div", { className: Y(ne, "univer-justify-center"), children: /* @__PURE__ */ g(ue, { style: { display: h(c) }, onClick: f, children: /* @__PURE__ */ P("span", { className: "univer-flex univer-items-center univer-gap-1", children: [
529
+ /* @__PURE__ */ g(vt, {}),
530
+ r.t("image-panel.group.group")
525
531
  ] }) }) }),
526
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan2, g.imageCommonPanelColumnCenter), children: /* @__PURE__ */ u(le, { style: { display: h(m) }, onClick: w, children: /* @__PURE__ */ j("span", { className: g.imageCommonPanelInline, children: [
527
- /* @__PURE__ */ u(yn, {}),
528
- t.t("image-panel.group.unGroup")
532
+ /* @__PURE__ */ g("div", { className: Y(ne, "univer-justify-center"), children: /* @__PURE__ */ g(ue, { style: { display: h(d) }, onClick: v, children: /* @__PURE__ */ P("span", { className: "univer-flex univer-items-center univer-gap-1", children: [
533
+ /* @__PURE__ */ g(bt, {}),
534
+ r.t("image-panel.group.unGroup")
529
535
  ] }) }) })
530
536
  ] })
531
537
  ] });
532
- }, se = 20, Rt = 20, Mt = [-3600, 3600], Pe = 300, Ot = (i) => {
533
- var Ze;
534
- const t = V(te), n = V(re), e = V(ue), { drawings: r, transformShow: o } = i, a = r[0];
538
+ }, le = 20, fr = 20, mr = [-3600, 3600], Oe = 300, pr = (i) => {
539
+ var Je;
540
+ const r = k(ie), t = k(ae), e = k(me), { drawings: n, transformShow: s } = i, a = n[0];
535
541
  if (a == null)
536
542
  return;
537
- const s = a.transform;
538
- if (s == null)
543
+ const o = a.transform;
544
+ if (o == null)
539
545
  return;
540
- const { unitId: c, subUnitId: l, drawingId: m, drawingType: d } = a, h = e.getRenderById(c), f = h == null ? void 0 : h.scene;
546
+ const { unitId: c, subUnitId: l, drawingId: d, drawingType: u } = a, h = e.getRenderById(c), f = h == null ? void 0 : h.scene;
541
547
  if (f == null)
542
548
  return;
543
- const v = (Ze = f.getEngine()) == null ? void 0 : Ze.activeScene;
544
- if (v == null)
549
+ const w = (Je = f.getEngine()) == null ? void 0 : Je.activeScene;
550
+ if (w == null)
545
551
  return;
546
- const w = f.getTransformerByCreate(), {
547
- width: p = 0,
548
- height: S = 0,
552
+ const v = f.getTransformerByCreate(), {
553
+ width: m = 0,
554
+ height: C = 0,
549
555
  left: _ = 0,
550
- top: M = 0,
551
- angle: I = 0
552
- } = s, [N, P] = x(p), [b, y] = x(S), [R, O] = x(_), [U, T] = x(M), [ie, W] = x(I), [q, Se] = x(w.keepRatio), ae = (C, E, L, k) => {
553
- const { width: H, height: Q } = v, { ancestorLeft: F, ancestorTop: K } = f;
554
- let Y = C, oe = E, he = L, fe = k;
555
- return C + F < 0 && (Y = -F), E + K < 0 && (oe = -K), he = H - Y - F, he < se && (he = se), fe = Q - oe - K, fe < se && (fe = se), C + he + F > H && (Y = H - L - F), E + fe + K > Q && (oe = Q - k - K), {
556
- limitLeft: Y,
557
- limitTop: oe,
558
- limitWidth: he,
559
- limitHeight: fe
556
+ top: R = 0,
557
+ angle: b = 0
558
+ } = o, [N, I] = L(m), [S, y] = L(C), [M, O] = L(_), [j, T] = L(R), [se, G] = L(b), [Q, ye] = L(v.keepRatio), oe = (p, E, A, V) => {
559
+ const { width: H, height: ee } = w, { ancestorLeft: F, ancestorTop: K } = f;
560
+ let Z = p, ce = E, pe = A, ve = V;
561
+ return p + F < 0 && (Z = -F), E + K < 0 && (ce = -K), pe = H - Z - F, pe < le && (pe = le), ve = ee - ce - K, ve < le && (ve = le), p + pe + F > H && (Z = H - A - F), E + ve + K > ee && (ce = ee - V - K), {
562
+ limitLeft: Z,
563
+ limitTop: ce,
564
+ limitWidth: pe,
565
+ limitHeight: ve
560
566
  };
561
- }, z = (C) => {
562
- const { objects: E } = C, L = Ve(E, n);
563
- if (L.length !== 1)
567
+ }, z = (p) => {
568
+ const { objects: E } = p, A = We(E, t);
569
+ if (A.length !== 1)
564
570
  return;
565
- const k = L[0];
566
- if (k == null)
571
+ const V = A[0];
572
+ if (V == null)
567
573
  return;
568
- const { transform: H } = k;
574
+ const { transform: H } = V;
569
575
  if (H == null)
570
576
  return;
571
577
  const {
572
- width: Q,
578
+ width: ee,
573
579
  height: F,
574
580
  left: K,
575
- top: Y,
576
- angle: oe
581
+ top: Z,
582
+ angle: ce
577
583
  } = H;
578
- Q != null && P(Q), F != null && y(F), K != null && O(K), Y != null && T(Y), oe != null && W(oe);
584
+ ee != null && I(ee), F != null && y(F), K != null && O(K), Z != null && T(Z), ce != null && G(ce);
579
585
  };
580
- _e(() => {
581
- const C = [
582
- w.changeStart$.subscribe((E) => {
586
+ be(() => {
587
+ const p = [
588
+ v.changeStart$.subscribe((E) => {
583
589
  z(E);
584
590
  }),
585
- w.changing$.subscribe((E) => {
591
+ v.changing$.subscribe((E) => {
586
592
  z(E);
587
593
  }),
588
- w.changeEnd$.subscribe((E) => {
594
+ v.changeEnd$.subscribe((E) => {
589
595
  z(E);
590
596
  }),
591
- n.focus$.subscribe((E) => {
597
+ t.focus$.subscribe((E) => {
592
598
  if (E.length !== 1)
593
599
  return;
594
- const L = n.getDrawingByParam(E[0]);
595
- if (L == null)
600
+ const A = t.getDrawingByParam(E[0]);
601
+ if (A == null)
596
602
  return;
597
- const k = L.transform;
598
- if (k == null)
603
+ const V = A.transform;
604
+ if (V == null)
599
605
  return;
600
606
  const {
601
607
  width: H,
602
- height: Q,
608
+ height: ee,
603
609
  left: F,
604
610
  top: K,
605
- angle: Y
606
- } = k;
607
- H != null && P(H), Q != null && y(Q), F != null && O(F), K != null && T(K), Y != null && W(Y);
611
+ angle: Z
612
+ } = V;
613
+ H != null && I(H), ee != null && y(ee), F != null && O(F), K != null && T(K), Z != null && G(Z);
608
614
  })
609
615
  ];
610
616
  return () => {
611
- C.forEach((E) => E.unsubscribe());
617
+ p.forEach((E) => E.unsubscribe());
612
618
  };
613
619
  }, []);
614
- const ke = Ie((C) => {
615
- if (C == null)
620
+ const Ge = Me((p) => {
621
+ if (p == null)
616
622
  return;
617
- C = Math.max(C, se);
618
- const { limitWidth: E, limitHeight: L } = ae(R, U, C, b);
619
- C = Math.min(C, E);
620
- const k = { unitId: c, subUnitId: l, drawingId: m, drawingType: d, transform: { width: C } };
621
- if (q) {
622
- let H = C / N * b;
623
- if (H = Math.max(H, Rt), H > L)
623
+ p = Math.max(p, le);
624
+ const { limitWidth: E, limitHeight: A } = oe(M, j, p, S);
625
+ p = Math.min(p, E);
626
+ const V = { unitId: c, subUnitId: l, drawingId: d, drawingType: u, transform: { width: p } };
627
+ if (Q) {
628
+ let H = p / N * S;
629
+ if (H = Math.max(H, fr), H > A)
624
630
  return;
625
- y(H), k.transform.height = H;
631
+ y(H), V.transform.height = H;
626
632
  }
627
- P(C), n.featurePluginUpdateNotification([k]), w.refreshControls().changeNotification();
628
- }, Pe), Rn = Ie((C) => {
629
- if (C == null)
633
+ I(p), t.featurePluginUpdateNotification([V]), v.refreshControls().changeNotification();
634
+ }, Oe), It = Me((p) => {
635
+ if (p == null)
630
636
  return;
631
- C = Math.max(C, se);
632
- const { limitHeight: E, limitWidth: L } = ae(R, U, N, C);
633
- C = Math.min(C, E);
634
- const k = { unitId: c, subUnitId: l, drawingId: m, drawingType: d, transform: { height: C } };
635
- if (q) {
636
- let H = C / b * N;
637
- if (H = Math.max(H, se), H > L)
637
+ p = Math.max(p, le);
638
+ const { limitHeight: E, limitWidth: A } = oe(M, j, N, p);
639
+ p = Math.min(p, E);
640
+ const V = { unitId: c, subUnitId: l, drawingId: d, drawingType: u, transform: { height: p } };
641
+ if (Q) {
642
+ let H = p / S * N;
643
+ if (H = Math.max(H, le), H > A)
638
644
  return;
639
- P(H), k.transform.width = H;
645
+ I(H), V.transform.width = H;
640
646
  }
641
- y(C), n.featurePluginUpdateNotification([k]), w.refreshControls().changeNotification();
642
- }, Pe), Mn = Ie((C) => {
643
- if (C == null)
647
+ y(p), t.featurePluginUpdateNotification([V]), v.refreshControls().changeNotification();
648
+ }, Oe), Mt = Me((p) => {
649
+ if (p == null)
644
650
  return;
645
- const { limitLeft: E } = ae(C, U, N, b);
646
- C = E;
647
- const L = { unitId: c, subUnitId: l, drawingId: m, drawingType: d, transform: { left: C } };
648
- O(C), n.featurePluginUpdateNotification([L]), w.refreshControls().changeNotification();
649
- }, Pe), On = Ie((C) => {
650
- if (C == null)
651
+ const { limitLeft: E } = oe(p, j, N, S);
652
+ p = E;
653
+ const A = { unitId: c, subUnitId: l, drawingId: d, drawingType: u, transform: { left: p } };
654
+ O(p), t.featurePluginUpdateNotification([A]), v.refreshControls().changeNotification();
655
+ }, Oe), Rt = Me((p) => {
656
+ if (p == null)
651
657
  return;
652
- const { limitTop: E } = ae(R, C, N, b);
653
- C = E;
654
- const L = { unitId: c, subUnitId: l, drawingId: m, drawingType: d, transform: { top: C } };
655
- T(C), n.featurePluginUpdateNotification([L]), w.refreshControls().changeNotification();
656
- }, Pe), Nn = (C) => {
657
- if (C == null)
658
+ const { limitTop: E } = oe(M, p, N, S);
659
+ p = E;
660
+ const A = { unitId: c, subUnitId: l, drawingId: d, drawingType: u, transform: { top: p } };
661
+ T(p), t.featurePluginUpdateNotification([A]), v.refreshControls().changeNotification();
662
+ }, Oe), Ot = (p) => {
663
+ if (p == null)
658
664
  return;
659
- const [E, L] = Mt;
660
- C < E && (C = E), C > L && (C = L);
661
- const k = { unitId: c, subUnitId: l, drawingId: m, drawingType: d, transform: { angle: C } };
662
- W(C), n.featurePluginUpdateNotification([k]), w.refreshControls().changeNotification();
663
- }, Dn = (C) => {
664
- Se(C), w.keepRatio = C;
665
- }, Tn = (C) => C ? "block" : "none";
666
- return /* @__PURE__ */ j("div", { className: B(g.imageCommonPanelGrid, g.imageCommonPanelBorder), style: { display: Tn(o) }, children: [
667
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelTitle), children: /* @__PURE__ */ u("div", { children: t.t("image-panel.transform.title") }) }) }),
668
- /* @__PURE__ */ j("div", { className: g.imageCommonPanelRow, children: [
669
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan3), children: /* @__PURE__ */ j("label", { children: [
670
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: t.t("image-panel.transform.width") }) }),
671
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: /* @__PURE__ */ u(pe, { precision: 1, value: N, onChange: (C) => {
672
- ke(C);
673
- }, className: g.imageCommonPanelInput }) }) })
674
- ] }) }),
675
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan3), children: /* @__PURE__ */ j("label", { children: [
676
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: t.t("image-panel.transform.height") }) }),
677
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: /* @__PURE__ */ u(pe, { precision: 1, value: b, onChange: (C) => {
678
- Rn(C);
679
- }, className: g.imageCommonPanelInput }) }) })
680
- ] }) }),
681
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan3), children: /* @__PURE__ */ j("label", { children: [
682
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: t.t("image-panel.transform.lock") }) }),
683
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelRow, g.imageCommonPanelRowVertical), children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: /* @__PURE__ */ u(Kn, { checked: q, onChange: Dn }) }) })
684
- ] }) })
685
- ] }),
686
- /* @__PURE__ */ j("div", { className: g.imageCommonPanelRow, children: [
687
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan3), children: /* @__PURE__ */ j("label", { children: [
688
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: t.t("image-panel.transform.x") }) }),
689
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: /* @__PURE__ */ u(pe, { precision: 1, value: R, onChange: (C) => {
690
- Mn(C);
691
- }, className: g.imageCommonPanelInput }) }) })
692
- ] }) }),
693
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan3), children: /* @__PURE__ */ j("label", { children: [
694
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: t.t("image-panel.transform.y") }) }),
695
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: /* @__PURE__ */ u(pe, { precision: 1, value: U, onChange: (C) => {
696
- On(C);
697
- }, className: g.imageCommonPanelInput }) }) })
698
- ] }) }),
699
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan3), children: /* @__PURE__ */ j("label", { children: [
700
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: t.t("image-panel.transform.rotate") }) }),
701
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: /* @__PURE__ */ u(pe, { precision: 1, value: ie, onChange: Nn, className: g.imageCommonPanelInput }) }) })
702
- ] }) })
703
- ] })
704
- ] });
705
- }, Fe = {
665
+ const [E, A] = mr;
666
+ p < E && (p = E), p > A && (p = A);
667
+ const V = { unitId: c, subUnitId: l, drawingId: d, drawingType: u, transform: { angle: p } };
668
+ G(p), t.featurePluginUpdateNotification([V]), v.refreshControls().changeNotification();
669
+ }, Nt = (p) => {
670
+ ye(p), v.keepRatio = p;
671
+ };
672
+ return /* @__PURE__ */ P(
673
+ "div",
674
+ {
675
+ className: `
676
+ univer-relative univer-mt-5 univer-w-full univer-border-b-0 univer-border-l-0 univer-border-r-0
677
+ univer-border-t univer-border-solid univer-border-t-gray-200
678
+ `,
679
+ style: { display: ((p) => p ? "block" : "none")(s) },
680
+ children: [
681
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: Y(B), children: /* @__PURE__ */ g("div", { children: r.t("image-panel.transform.title") }) }) }),
682
+ /* @__PURE__ */ P("div", { className: U, children: [
683
+ /* @__PURE__ */ g("div", { className: Y(B), children: /* @__PURE__ */ P("label", { children: [
684
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: r.t("image-panel.transform.width") }) }),
685
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g(we, { precision: 1, value: N, onChange: (p) => {
686
+ Ge(p);
687
+ } }) }) })
688
+ ] }) }),
689
+ /* @__PURE__ */ g("div", { className: Y(B), children: /* @__PURE__ */ P("label", { children: [
690
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: r.t("image-panel.transform.height") }) }),
691
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g(we, { precision: 1, value: S, onChange: (p) => {
692
+ It(p);
693
+ } }) }) })
694
+ ] }) }),
695
+ /* @__PURE__ */ g("div", { className: Y(B), children: /* @__PURE__ */ P("label", { children: [
696
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: r.t("image-panel.transform.lock") }) }),
697
+ /* @__PURE__ */ g("div", { className: Y(U, "univer-h-9 univer-items-center univer-justify-center"), children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g(Ft, { checked: Q, onChange: Nt }) }) })
698
+ ] }) })
699
+ ] }),
700
+ /* @__PURE__ */ P("div", { className: U, children: [
701
+ /* @__PURE__ */ g("div", { className: Y(B), children: /* @__PURE__ */ P("label", { children: [
702
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: r.t("image-panel.transform.x") }) }),
703
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g(we, { precision: 1, value: M, onChange: (p) => {
704
+ Mt(p);
705
+ } }) }) })
706
+ ] }) }),
707
+ /* @__PURE__ */ g("div", { className: Y(B), children: /* @__PURE__ */ P("label", { children: [
708
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: r.t("image-panel.transform.y") }) }),
709
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g(we, { precision: 1, value: j, onChange: (p) => {
710
+ Rt(p);
711
+ } }) }) })
712
+ ] }) }),
713
+ /* @__PURE__ */ g("div", { className: Y(B), children: /* @__PURE__ */ P("label", { children: [
714
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: r.t("image-panel.transform.rotate") }) }),
715
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g(we, { precision: 1, value: se, onChange: Ot }) }) })
716
+ ] }) })
717
+ ] })
718
+ ]
719
+ }
720
+ );
721
+ }, Ye = {
706
722
  id: "sheet.operation.open-image-crop",
707
- type: ve.OPERATION,
708
- handler: (i, t) => !0
723
+ type: Se.OPERATION,
724
+ handler: (i, r) => !0
709
725
  }, ge = {
710
726
  id: "sheet.operation.close-image-crop",
711
- type: ve.OPERATION,
712
- handler: (i, t) => !0
727
+ type: Se.OPERATION,
728
+ handler: (i, r) => !0
713
729
  };
714
- var A = /* @__PURE__ */ ((i) => (i.FREE = "0", i.R1_1 = "1", i.R16_9 = "2", i.R9_16 = "3", i.R5_4 = "4", i.R4_5 = "5", i.R4_3 = "6", i.R3_4 = "7", i.R3_2 = "8", i.R2_3 = "9", i))(A || {});
715
- const Be = {
730
+ var x = /* @__PURE__ */ ((i) => (i.FREE = "0", i.R1_1 = "1", i.R16_9 = "2", i.R9_16 = "3", i.R5_4 = "4", i.R4_5 = "5", i.R4_3 = "6", i.R3_4 = "7", i.R3_2 = "8", i.R2_3 = "9", i))(x || {});
731
+ const Ue = {
716
732
  id: "sheet.operation.Auto-image-crop",
717
- type: ve.OPERATION,
718
- handler: (i, t) => !0
719
- }, Nt = (i) => {
720
- const t = V(me), n = V(te), { drawings: e, cropperShow: r } = i;
733
+ type: Se.OPERATION,
734
+ handler: (i, r) => !0
735
+ }, vr = (i) => {
736
+ const r = k(he), t = k(ie), { drawings: e, cropperShow: n } = i;
721
737
  if (e[0] == null)
722
738
  return;
723
- const [a, s] = x(A.FREE), c = mn(!1), l = [
739
+ const [a, o] = L(x.FREE), c = dt(!1), l = [
724
740
  {
725
- label: n.t("image-panel.crop.mode"),
726
- value: A.FREE
741
+ label: t.t("image-panel.crop.mode"),
742
+ value: x.FREE
727
743
  },
728
744
  {
729
745
  label: "1:1",
730
- value: A.R1_1
746
+ value: x.R1_1
731
747
  },
732
748
  {
733
749
  label: "16:9",
734
- value: A.R16_9
750
+ value: x.R16_9
735
751
  },
736
752
  {
737
753
  label: "9:16",
738
- value: A.R9_16
754
+ value: x.R9_16
739
755
  },
740
756
  {
741
757
  label: "5:4",
742
- value: A.R5_4
758
+ value: x.R5_4
743
759
  },
744
760
  {
745
761
  label: "4:5",
746
- value: A.R4_5
762
+ value: x.R4_5
747
763
  },
748
764
  {
749
765
  label: "4:3",
750
- value: A.R4_3
766
+ value: x.R4_3
751
767
  },
752
768
  {
753
769
  label: "3:4",
754
- value: A.R3_4
770
+ value: x.R3_4
755
771
  },
756
772
  {
757
773
  label: "3:2",
758
- value: A.R3_2
774
+ value: x.R3_2
759
775
  },
760
776
  {
761
777
  label: "2:3",
762
- value: A.R2_3
778
+ value: x.R2_3
763
779
  }
764
780
  ];
765
- _e(() => {
766
- const f = t.onCommandExecuted((v) => {
767
- if (v.id === ge.id) {
768
- const w = v.params;
769
- w != null && w.isAuto || (c.current = !1);
781
+ be(() => {
782
+ const f = r.onCommandExecuted((w) => {
783
+ if (w.id === ge.id) {
784
+ const v = w.params;
785
+ v != null && v.isAuto || (c.current = !1);
770
786
  }
771
787
  });
772
788
  return () => {
773
789
  f == null || f.dispose();
774
790
  };
775
791
  }, []);
776
- function m(f) {
777
- s(f), c.current && t.executeCommand(Be.id, {
792
+ function d(f) {
793
+ o(f), c.current && r.executeCommand(Ue.id, {
778
794
  cropType: f
779
795
  });
780
796
  }
781
- const d = (f) => f ? "block" : "none", h = (f) => {
782
- t.executeCommand(Be.id, {
797
+ const u = (f) => f ? "block" : "none", h = (f) => {
798
+ r.executeCommand(Ue.id, {
783
799
  cropType: f
784
800
  }), c.current = !0;
785
801
  };
786
- return /* @__PURE__ */ j("div", { className: B(g.imageCommonPanelGrid, g.imageCommonPanelBorder), style: { display: d(r) }, children: [
787
- /* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelTitle), children: /* @__PURE__ */ u("div", { children: n.t("image-panel.crop.title") }) }) }),
788
- /* @__PURE__ */ j("div", { className: B(g.imageCommonPanelRow, g.imageCommonPanelRowVertical), children: [
789
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan2), children: /* @__PURE__ */ u(le, { onClick: () => {
790
- h(a);
791
- }, children: /* @__PURE__ */ j("span", { className: g.imageCommonPanelInline, children: [
792
- /* @__PURE__ */ u(wn, {}),
793
- n.t("image-panel.crop.start")
794
- ] }) }) }),
795
- /* @__PURE__ */ u("div", { className: B(g.imageCommonPanelColumn, g.imageCommonPanelSpan2), children: /* @__PURE__ */ u(dn, { value: a, options: l, onChange: m }) })
796
- ] })
797
- ] });
798
- }, er = (i) => {
799
- const t = V(re), n = V(ue), e = V(te), { drawings: r, hasArrange: o = !0, hasTransform: a = !0, hasAlign: s = !0, hasCropper: c = !0, hasGroup: l = !0 } = i, m = r[0];
800
- if (m == null)
802
+ return /* @__PURE__ */ P(
803
+ "div",
804
+ {
805
+ className: `
806
+ univer-relative univer-mt-5 univer-w-full univer-border-b-0 univer-border-l-0 univer-border-r-0
807
+ univer-border-t univer-border-solid univer-border-t-gray-200
808
+ `,
809
+ style: { display: u(n) },
810
+ children: [
811
+ /* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g("div", { children: t.t("image-panel.crop.title") }) }) }),
812
+ /* @__PURE__ */ P("div", { className: U, children: [
813
+ /* @__PURE__ */ g("div", { className: ne, children: /* @__PURE__ */ g(ue, { onClick: () => {
814
+ h(a);
815
+ }, children: /* @__PURE__ */ P("span", { className: "univer-flex univer-items-center univer-gap-1", children: [
816
+ /* @__PURE__ */ g(pt, {}),
817
+ t.t("image-panel.crop.start")
818
+ ] }) }) }),
819
+ /* @__PURE__ */ g("div", { className: ne, children: /* @__PURE__ */ g(ut, { value: a, options: l, onChange: d }) })
820
+ ] })
821
+ ]
822
+ }
823
+ );
824
+ }, Wr = (i) => {
825
+ const r = k(ae), t = k(me), e = k(ie), { drawings: n, hasArrange: s = !0, hasTransform: a = !0, hasAlign: o = !0, hasCropper: c = !0, hasGroup: l = !0 } = i, d = n[0];
826
+ if (d == null)
801
827
  return;
802
- const { unitId: d } = m, h = n.getRenderById(d), f = h == null ? void 0 : h.scene;
828
+ const { unitId: u } = d, h = t.getRenderById(u), f = h == null ? void 0 : h.scene;
803
829
  if (f == null)
804
830
  return;
805
- const v = f.getTransformerByCreate(), [w, p] = x(!0), [S, _] = x(!0), [M, I] = x(!1), [N, P] = x(!0), [b, y] = x(!1);
806
- return _e(() => {
807
- const R = v.clearControl$.subscribe((T) => {
808
- T === !0 && (p(!1), _(!1), I(!1), P(!1), y(!0));
809
- }), O = v.changeStart$.subscribe((T) => {
810
- const { objects: ie } = T, W = Ve(ie, t);
811
- W.length === 0 ? (p(!1), _(!1), I(!1), P(!1), y(!0)) : W.length === 1 ? (p(!0), _(!0), I(!1), P(!0), y(!1)) : (p(!0), _(!1), I(!0), P(!1), y(!1));
812
- }), U = t.focus$.subscribe((T) => {
813
- T.length === 0 ? (p(!1), _(!1), I(!1), P(!1), y(!0)) : T.length === 1 ? (p(!0), _(!0), I(!1), P(!0), y(!1)) : (p(!0), _(!1), I(!0), P(!1), y(!1));
831
+ const w = f.getTransformerByCreate(), [v, m] = L(!0), [C, _] = L(!0), [R, b] = L(!1), [N, I] = L(!0), [S, y] = L(!1);
832
+ return be(() => {
833
+ const M = w.clearControl$.subscribe((T) => {
834
+ T === !0 && (m(!1), _(!1), b(!1), I(!1), y(!0));
835
+ }), O = w.changeStart$.subscribe((T) => {
836
+ const { objects: se } = T, G = We(se, r);
837
+ G.length === 0 ? (m(!1), _(!1), b(!1), I(!1), y(!0)) : G.length === 1 ? (m(!0), _(!0), b(!1), I(!0), y(!1)) : (m(!0), _(!1), b(!0), I(!1), y(!1));
838
+ }), j = r.focus$.subscribe((T) => {
839
+ T.length === 0 ? (m(!1), _(!1), b(!1), I(!1), y(!0)) : T.length === 1 ? (m(!0), _(!0), b(!1), I(!0), y(!1)) : (m(!0), _(!1), b(!0), I(!1), y(!1));
814
840
  });
815
841
  return () => {
816
- O.unsubscribe(), R.unsubscribe(), U.unsubscribe();
842
+ O.unsubscribe(), M.unsubscribe(), j.unsubscribe();
817
843
  };
818
- }, []), /* @__PURE__ */ j(Fn, { children: [
819
- /* @__PURE__ */ u("div", { style: { display: b === !0 ? "block" : "none", height: "100%" }, children: /* @__PURE__ */ u("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%", top: "50%", marginTop: "-100px" }, children: /* @__PURE__ */ u("span", { children: e.t("image-panel.null") }) }) }),
820
- /* @__PURE__ */ u(yt, { arrangeShow: o === !0 ? w : !1, drawings: r }),
821
- /* @__PURE__ */ u(Ot, { transformShow: a === !0 ? S : !1, drawings: r }),
822
- /* @__PURE__ */ u(gt, { alignShow: s === !0 ? M : !1, drawings: r }),
823
- /* @__PURE__ */ u(Nt, { cropperShow: c === !0 ? N : !1, drawings: r }),
824
- /* @__PURE__ */ u(Pt, { hasGroup: l, drawings: r })
844
+ }, []), /* @__PURE__ */ P(zt, { children: [
845
+ /* @__PURE__ */ g("div", { style: { display: S === !0 ? "block" : "none", height: "100%" }, children: /* @__PURE__ */ g("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%", top: "50%", marginTop: "-100px" }, children: /* @__PURE__ */ g("span", { children: e.t("image-panel.null") }) }) }),
846
+ /* @__PURE__ */ g(gr, { arrangeShow: s === !0 ? v : !1, drawings: n }),
847
+ /* @__PURE__ */ g(pr, { transformShow: a === !0 ? C : !1, drawings: n }),
848
+ /* @__PURE__ */ g(qt, { alignShow: o === !0 ? R : !1, drawings: n }),
849
+ /* @__PURE__ */ g(vr, { cropperShow: c === !0 ? N : !1, drawings: n }),
850
+ /* @__PURE__ */ g(hr, { hasGroup: l, drawings: n })
825
851
  ] });
826
- }, Dt = (i) => {
827
- var w;
828
- const { popup: t } = i, n = (w = t == null ? void 0 : t.extraProps) == null ? void 0 : w.menuItems;
829
- if (!n) return null;
830
- const e = V(me), r = V(te), [o, a] = x(!1), [s, c] = x(!1), l = () => {
852
+ }, wr = (i) => {
853
+ var v;
854
+ const { popup: r } = i, t = (v = r == null ? void 0 : r.extraProps) == null ? void 0 : v.menuItems;
855
+ if (!t) return null;
856
+ const e = k(he), n = k(ie), [s, a] = L(!1), [o, c] = L(!1), l = () => {
831
857
  c(!0);
832
- }, m = () => {
858
+ }, d = () => {
833
859
  c(!1);
834
- }, d = (p) => {
835
- a(p);
836
- }, h = (p) => {
837
- e.executeCommand(p.commandId, p.commandParams), a(!1);
838
- }, f = o || s, v = n.filter((p) => !p.disable);
839
- return /* @__PURE__ */ u(
860
+ }, u = (m) => {
861
+ a(m);
862
+ }, h = (m) => {
863
+ e.executeCommand(m.commandId, m.commandParams), a(!1);
864
+ }, f = s || o, w = t.filter((m) => !m.disable);
865
+ return /* @__PURE__ */ g(
840
866
  "div",
841
867
  {
842
868
  onMouseEnter: l,
843
- onMouseLeave: m,
844
- children: /* @__PURE__ */ u(
845
- Yn,
869
+ onMouseLeave: d,
870
+ children: /* @__PURE__ */ g(
871
+ Kt,
846
872
  {
847
873
  align: "start",
848
- items: v.map((p) => ({
874
+ items: w.map((m) => ({
849
875
  type: "item",
850
- children: r.t(p.label),
851
- onSelect: () => h(p)
876
+ children: n.t(m.label),
877
+ onSelect: () => h(m)
852
878
  })),
853
- open: o,
854
- onOpenChange: d,
855
- children: /* @__PURE__ */ j(
879
+ open: s,
880
+ onOpenChange: u,
881
+ children: /* @__PURE__ */ P(
856
882
  "div",
857
883
  {
858
- className: B(`
884
+ className: Y(`
859
885
  univer-flex univer-items-center univer-gap-2 univer-rounded univer-border univer-border-solid
860
886
  univer-border-gray-200 univer-p-1
861
887
  hover:univer-bg-gray-100
862
888
  `, {
863
- "univer-bg-gray-100": o,
864
- "univer-bg-white": !o
889
+ "univer-bg-gray-100": s,
890
+ "univer-bg-white": !s
865
891
  }),
866
892
  children: [
867
- /* @__PURE__ */ u(
868
- pn,
869
- {
870
- style: { color: "#35322B" },
871
- extend: { colorChannel1: "rgb(var(--green-700, #409f11))" }
872
- }
873
- ),
874
- f && /* @__PURE__ */ u(_n, { className: "univer-text-[10px] univer-text-gray-400" })
893
+ /* @__PURE__ */ g(ft, { className: "univer-fill-primary-600 univer-text-gray-900" }),
894
+ f && /* @__PURE__ */ g(wt, {})
875
895
  ]
876
896
  }
877
897
  )
@@ -879,54 +899,51 @@ const Be = {
879
899
  )
880
900
  }
881
901
  );
882
- }, Tt = "COMPONENT_IMAGE_POPUP_MENU", Et = "drawing-ui.config", tn = {}, Pn = {
902
+ }, _r = "COMPONENT_IMAGE_POPUP_MENU", Cr = "drawing-ui.config", nt = {}, yt = {
883
903
  id: "sheet.operation.image-reset-size",
884
- type: ve.OPERATION,
885
- handler: (i, t) => !0
886
- }, Bt = (i) => {
887
- const { src: t } = i;
888
- return t ? /* @__PURE__ */ u("div", { children: /* @__PURE__ */ u("img", { src: t, alt: "Univer Image Viewer", style: { width: "100%", height: "100%", position: "relative" } }) }) : null;
904
+ type: Se.OPERATION,
905
+ handler: (i, r) => !0
889
906
  };
890
- var jt = Object.getOwnPropertyDescriptor, Ut = (i, t, n, e) => {
891
- for (var r = e > 1 ? void 0 : e ? jt(t, n) : t, o = i.length - 1, a; o >= 0; o--)
892
- (a = i[o]) && (r = a(r) || r);
893
- return r;
894
- }, rn = (i, t) => (n, e) => t(n, e, i);
895
- let je = class extends xe {
896
- constructor(i, t) {
897
- super(), this._componentManager = i, this._commandService = t, this._init();
907
+ var Sr = Object.getOwnPropertyDescriptor, br = (i, r, t, e) => {
908
+ for (var n = e > 1 ? void 0 : e ? Sr(r, t) : r, s = i.length - 1, a; s >= 0; s--)
909
+ (a = i[s]) && (n = a(n) || n);
910
+ return n;
911
+ }, it = (i, r) => (t, e) => r(t, e, i);
912
+ let xe = class extends Ve {
913
+ constructor(i, r) {
914
+ super(), this._componentManager = i, this._commandService = r, this._init();
898
915
  }
899
916
  _initCustomComponents() {
900
917
  const i = this._componentManager;
901
- this.disposeWithMe(i.register(Tt, Dt)), this.disposeWithMe(i.register(hn, Bt));
918
+ this.disposeWithMe(i.register(_r, wr));
902
919
  }
903
920
  _initCommands() {
904
921
  [
905
- Fe,
906
- ge,
907
- Pn,
908
922
  Ye,
909
- Be
923
+ ge,
924
+ yt,
925
+ Xe,
926
+ Ue
910
927
  ].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
911
928
  }
912
929
  _init() {
913
930
  this._initCommands(), this._initCustomComponents();
914
931
  }
915
932
  };
916
- je = Ut([
917
- rn(0, Le($n)),
918
- rn(1, me)
919
- ], je);
920
- var At = Object.getOwnPropertyDescriptor, Ht = (i, t, n, e) => {
921
- for (var r = e > 1 ? void 0 : e ? At(t, n) : t, o = i.length - 1, a; o >= 0; o--)
922
- (a = i[o]) && (r = a(r) || r);
923
- return r;
924
- }, Re = (i, t) => (n, e) => t(n, e, i);
925
- let Ue = class extends xe {
926
- constructor(t, n, e, r) {
933
+ xe = br([
934
+ it(0, ke(Wt)),
935
+ it(1, he)
936
+ ], xe);
937
+ var yr = Object.getOwnPropertyDescriptor, Ir = (i, r, t, e) => {
938
+ for (var n = e > 1 ? void 0 : e ? yr(r, t) : r, s = i.length - 1, a; s >= 0; s--)
939
+ (a = i[s]) && (n = a(n) || n);
940
+ return n;
941
+ }, Ne = (i, r) => (t, e) => r(t, e, i);
942
+ let He = class extends Ve {
943
+ constructor(r, t, e, n) {
927
944
  super();
928
- ee(this, "_sceneListenerOnDrawingMap", /* @__PURE__ */ new WeakSet());
929
- this._currentUniverService = t, this._commandService = n, this._renderManagerService = e, this._drawingManagerService = r, this._initialize();
945
+ te(this, "_sceneListenerOnDrawingMap", /* @__PURE__ */ new WeakSet());
946
+ this._currentUniverService = r, this._commandService = t, this._renderManagerService = e, this._drawingManagerService = n, this._initialize();
930
947
  }
931
948
  dispose() {
932
949
  super.dispose();
@@ -935,39 +952,39 @@ let Ue = class extends xe {
935
952
  this._recoveryImages(), this._drawingAddListener(), this._drawingRemoveListener(), this._drawingUpdateListener(), this._commandExecutedListener(), this._drawingArrangeListener(), this._drawingGroupListener(), this._drawingRefreshListener(), this._drawingVisibleListener();
936
953
  }
937
954
  _recoveryImages() {
938
- const t = this._drawingManagerService.drawingManagerData, n = un(this._currentUniverService);
939
- if (n == null)
955
+ const r = this._drawingManagerService.drawingManagerData, t = gt(this._currentUniverService);
956
+ if (t == null)
940
957
  return;
941
- const { unitId: e, subUnitId: r } = n;
942
- Object.keys(t).forEach((o) => {
943
- Object.keys(t[o]).forEach((a) => {
944
- const s = t[o][a].data;
945
- s == null || o !== e || a !== r || Object.keys(s).forEach((c) => {
946
- s[c] && this._insertDrawing([{ unitId: o, subUnitId: a, drawingId: c }]);
958
+ const { unitId: e, subUnitId: n } = t;
959
+ Object.keys(r).forEach((s) => {
960
+ Object.keys(r[s]).forEach((a) => {
961
+ const o = r[s][a].data;
962
+ o == null || s !== e || a !== n || Object.keys(o).forEach((c) => {
963
+ o[c] && this._insertDrawing([{ unitId: s, subUnitId: a, drawingId: c }]);
947
964
  });
948
965
  });
949
966
  });
950
967
  }
951
968
  _commandExecutedListener() {
952
969
  this.disposeWithMe(
953
- this._commandService.onCommandExecuted((t) => {
954
- if (t.id === Ye.id) {
955
- const n = t.params;
956
- if (n == null)
970
+ this._commandService.onCommandExecuted((r) => {
971
+ if (r.id === Xe.id) {
972
+ const t = r.params;
973
+ if (t == null)
957
974
  return;
958
- this._drawingAlign(n);
975
+ this._drawingAlign(t);
959
976
  }
960
977
  })
961
978
  );
962
979
  }
963
980
  _drawingGroupListener() {
964
981
  this.disposeWithMe(
965
- this._drawingManagerService.group$.subscribe((t) => {
966
- this._groupDrawings(t);
982
+ this._drawingManagerService.group$.subscribe((r) => {
983
+ this._groupDrawings(r);
967
984
  })
968
985
  ), this.disposeWithMe(
969
- this._drawingManagerService.ungroup$.subscribe((t) => {
970
- this._ungroupDrawings(t);
986
+ this._drawingManagerService.ungroup$.subscribe((r) => {
987
+ this._ungroupDrawings(r);
971
988
  })
972
989
  );
973
990
  }
@@ -991,38 +1008,38 @@ let Ue = class extends xe {
991
1008
  // break;
992
1009
  // }
993
1010
  // }
994
- _getSceneAndTransformerByDrawingSearch(t) {
995
- if (t == null)
1011
+ _getSceneAndTransformerByDrawingSearch(r) {
1012
+ if (r == null)
996
1013
  return;
997
- const n = this._renderManagerService.getRenderById(t), e = n == null ? void 0 : n.scene;
1014
+ const t = this._renderManagerService.getRenderById(r), e = t == null ? void 0 : t.scene;
998
1015
  if (e == null)
999
1016
  return null;
1000
- const r = e.getTransformerByCreate();
1001
- return { scene: e, transformer: r };
1017
+ const n = e.getTransformerByCreate();
1018
+ return { scene: e, transformer: n };
1002
1019
  }
1003
- _groupDrawings(t) {
1004
- t.forEach((n) => {
1005
- this._groupDrawing(n);
1020
+ _groupDrawings(r) {
1021
+ r.forEach((t) => {
1022
+ this._groupDrawing(t);
1006
1023
  });
1007
1024
  }
1008
- _groupDrawing(t) {
1009
- const { parent: n, children: e } = t, { unitId: r, subUnitId: o, drawingId: a } = n, s = this._getSceneAndTransformerByDrawingSearch(n.unitId);
1010
- if (s == null)
1025
+ _groupDrawing(r) {
1026
+ const { parent: t, children: e } = r, { unitId: n, subUnitId: s, drawingId: a } = t, o = this._getSceneAndTransformerByDrawingSearch(t.unitId);
1027
+ if (o == null)
1011
1028
  return;
1012
- const { scene: c, transformer: l } = s;
1029
+ const { scene: c, transformer: l } = o;
1013
1030
  this._commandService.syncExecuteCommand(ge.id);
1014
- const m = [];
1031
+ const d = [];
1015
1032
  if (e.forEach((f) => {
1016
- const v = G(f), w = c.getObjectIncludeInGroup(v);
1017
- if (w == null || m.includes(w))
1033
+ const w = W(f), v = c.getObjectIncludeInGroup(w);
1034
+ if (v == null || d.includes(v))
1018
1035
  return;
1019
- m.push(w);
1020
- const { transform: p } = f;
1021
- p != null && (w.classType === Je.GROUP ? w.transformByState({ left: p.left, top: p.top }) : w.transformByState(p));
1022
- }), m.length === 0)
1036
+ d.push(v);
1037
+ const { transform: m } = f;
1038
+ m != null && (v.classType === Qe.GROUP ? v.transformByState({ left: m.left, top: m.top }) : v.transformByState(m));
1039
+ }), d.length === 0)
1023
1040
  return;
1024
- const d = G({ unitId: r, subUnitId: o, drawingId: a }), h = new we(d);
1025
- c.addObject(h, De).attachTransformerTo(h), h.addObjects(...m), n.transform && h.transformByState({ left: n.transform.left, top: n.transform.top }), l.clearSelectedObjects(), l.setSelectedControl(h);
1041
+ const u = W({ unitId: n, subUnitId: s, drawingId: a }), h = new Ce(u);
1042
+ c.addObject(h, Pe).attachTransformerTo(h), h.addObjects(...d), t.transform && h.transformByState({ left: t.transform.left, top: t.transform.top }), l.clearSelectedObjects(), l.setSelectedControl(h);
1026
1043
  }
1027
1044
  // private _regroupDrawings(drawings: IDrawingSearch[]) {
1028
1045
  // const renderObject = this._getSceneAndTransformerByDrawingSearch(drawings[0].unitId);
@@ -1058,127 +1075,127 @@ let Ue = class extends xe {
1058
1075
  // transformer.clearSelectedObjects();
1059
1076
  // transformer.setSelectedControl(firstGroup);
1060
1077
  // }
1061
- _ungroupDrawings(t) {
1062
- t.forEach((n) => {
1063
- this._ungroupDrawing(n);
1078
+ _ungroupDrawings(r) {
1079
+ r.forEach((t) => {
1080
+ this._ungroupDrawing(t);
1064
1081
  });
1065
1082
  }
1066
- _ungroupDrawing(t) {
1067
- const { parent: n, children: e } = t, r = this._getSceneAndTransformerByDrawingSearch(n.unitId);
1068
- if (r == null)
1083
+ _ungroupDrawing(r) {
1084
+ const { parent: t, children: e } = r, n = this._getSceneAndTransformerByDrawingSearch(t.unitId);
1085
+ if (n == null)
1069
1086
  return;
1070
- const { scene: o, transformer: a } = r;
1071
- e.forEach((d) => {
1072
- const h = G(d), f = o.getObjectIncludeInGroup(h);
1087
+ const { scene: s, transformer: a } = n;
1088
+ e.forEach((u) => {
1089
+ const h = W(u), f = s.getObjectIncludeInGroup(h);
1073
1090
  if (f == null)
1074
1091
  return !0;
1075
1092
  if (f == null)
1076
1093
  return;
1077
- const { transform: v } = d;
1078
- v != null && (f.classType === Je.GROUP ? f.transformByState({ left: v.left, top: v.top }) : f.transformByState(v));
1094
+ const { transform: w } = u;
1095
+ w != null && (f.classType === Qe.GROUP ? f.transformByState({ left: w.left, top: w.top }) : f.transformByState(w));
1079
1096
  });
1080
- const s = G(n), c = o.getObject(s), { width: l, height: m } = c;
1081
- c.getObjects().forEach((d) => {
1082
- c.removeSelfObjectAndTransform(d.oKey, l, m);
1097
+ const o = W(t), c = s.getObject(o), { width: l, height: d } = c;
1098
+ c.getObjects().forEach((u) => {
1099
+ c.removeSelfObjectAndTransform(u.oKey, l, d);
1083
1100
  }), c.dispose(), a.clearSelectedObjects();
1084
1101
  }
1085
- _drawingAlign(t) {
1086
- const { alignType: n } = t, e = this._drawingManagerService.getFocusDrawings();
1087
- if (n === D.default)
1102
+ _drawingAlign(r) {
1103
+ const { alignType: t } = r, e = this._drawingManagerService.getFocusDrawings();
1104
+ if (t === D.default)
1088
1105
  return;
1089
- const r = [];
1090
- let o = Number.POSITIVE_INFINITY, a = Number.POSITIVE_INFINITY, s = Number.NEGATIVE_INFINITY, c = Number.NEGATIVE_INFINITY, l = 0;
1091
- e.forEach((m) => {
1092
- const { unitId: d, subUnitId: h, drawingId: f, drawingType: v } = m, w = this._drawingManagerService.getDrawingByParam({ unitId: d, subUnitId: h, drawingId: f });
1093
- if (w == null || w.transform == null)
1106
+ const n = [];
1107
+ let s = Number.POSITIVE_INFINITY, a = Number.POSITIVE_INFINITY, o = Number.NEGATIVE_INFINITY, c = Number.NEGATIVE_INFINITY, l = 0;
1108
+ e.forEach((d) => {
1109
+ const { unitId: u, subUnitId: h, drawingId: f, drawingType: w } = d, v = this._drawingManagerService.getDrawingByParam({ unitId: u, subUnitId: h, drawingId: f });
1110
+ if (v == null || v.transform == null)
1094
1111
  return;
1095
- r.push({
1096
- unitId: d,
1112
+ n.push({
1113
+ unitId: u,
1097
1114
  subUnitId: h,
1098
1115
  drawingId: f,
1099
- drawingType: v,
1100
- transform: w.transform
1116
+ drawingType: w,
1117
+ transform: v.transform
1101
1118
  });
1102
- const { left: p = 0, top: S = 0, width: _ = 0, height: M = 0 } = w.transform;
1103
- o = Math.min(o, p), a = Math.min(a, S), s = Math.max(s, p + _), c = Math.max(c, S + M), l++;
1104
- }), l !== 0 && (this._sortDrawingTransform(r, n), this._applyAlignType(r, n, o, a, s, c, l));
1119
+ const { left: m = 0, top: C = 0, width: _ = 0, height: R = 0 } = v.transform;
1120
+ s = Math.min(s, m), a = Math.min(a, C), o = Math.max(o, m + _), c = Math.max(c, C + R), l++;
1121
+ }), l !== 0 && (this._sortDrawingTransform(n, t), this._applyAlignType(n, t, s, a, o, c, l));
1105
1122
  }
1106
- _applyAlignType(t, n, e, r, o, a, s) {
1107
- const c = Math.round((o - e) / s * 10) / 10, l = Math.round((a - r) / s * 10) / 10, m = [], d = this._getSceneAndTransformerByDrawingSearch(t[0].unitId);
1108
- if (d == null)
1123
+ _applyAlignType(r, t, e, n, s, a, o) {
1124
+ const c = Math.round((s - e) / o * 10) / 10, l = Math.round((a - n) / o * 10) / 10, d = [], u = this._getSceneAndTransformerByDrawingSearch(r[0].unitId);
1125
+ if (u == null)
1109
1126
  return;
1110
- const { scene: h, transformer: f } = d;
1111
- t.forEach((v, w) => {
1112
- const { unitId: p, subUnitId: S, drawingId: _, transform: M, drawingType: I } = v, { left: N = 0, top: P = 0, width: b = 0, height: y = 0 } = M;
1113
- let R = N, O = P;
1114
- switch (n) {
1127
+ const { scene: h, transformer: f } = u;
1128
+ r.forEach((w, v) => {
1129
+ const { unitId: m, subUnitId: C, drawingId: _, transform: R, drawingType: b } = w, { left: N = 0, top: I = 0, width: S = 0, height: y = 0 } = R;
1130
+ let M = N, O = I;
1131
+ switch (t) {
1115
1132
  case D.left:
1116
- R = e;
1133
+ M = e;
1117
1134
  break;
1118
1135
  case D.center:
1119
- R = e + (o - e) / 2 - b / 2;
1136
+ M = e + (s - e) / 2 - S / 2;
1120
1137
  break;
1121
1138
  case D.right:
1122
- R = o - b;
1139
+ M = s - S;
1123
1140
  break;
1124
1141
  case D.top:
1125
- O = r;
1142
+ O = n;
1126
1143
  break;
1127
1144
  case D.middle:
1128
- O = r + (a - r) / 2 - y / 2;
1145
+ O = n + (a - n) / 2 - y / 2;
1129
1146
  break;
1130
1147
  case D.bottom:
1131
1148
  O = a - y;
1132
1149
  break;
1133
1150
  case D.horizon:
1134
- R = e + c * w;
1151
+ M = e + c * v;
1135
1152
  break;
1136
1153
  case D.vertical:
1137
- O = r + l * w;
1154
+ O = n + l * v;
1138
1155
  break;
1139
1156
  }
1140
- (R !== N || O !== P) && m.push({
1141
- unitId: p,
1142
- subUnitId: S,
1157
+ (M !== N || O !== I) && d.push({
1158
+ unitId: m,
1159
+ subUnitId: C,
1143
1160
  drawingId: _,
1144
- drawingType: I,
1161
+ drawingType: b,
1145
1162
  transform: {
1146
- left: R,
1163
+ left: M,
1147
1164
  top: O
1148
1165
  }
1149
1166
  });
1150
- }), this._drawingManagerService.featurePluginUpdateNotification(m), f.refreshControls().changeNotification();
1167
+ }), this._drawingManagerService.featurePluginUpdateNotification(d), f.refreshControls().changeNotification();
1151
1168
  }
1152
- _sortDrawingTransform(t, n) {
1153
- t.sort((e, r) => {
1154
- const o = e.transform, a = r.transform, {
1155
- left: s = 0,
1169
+ _sortDrawingTransform(r, t) {
1170
+ r.sort((e, n) => {
1171
+ const s = e.transform, a = n.transform, {
1172
+ left: o = 0,
1156
1173
  top: c = 0,
1157
1174
  width: l = 0,
1158
- height: m = 0
1159
- } = o, {
1160
- left: d = 0,
1175
+ height: d = 0
1176
+ } = s, {
1177
+ left: u = 0,
1161
1178
  top: h = 0,
1162
1179
  width: f = 0,
1163
- height: v = 0
1180
+ height: w = 0
1164
1181
  } = a;
1165
- switch (n) {
1182
+ switch (t) {
1166
1183
  case D.left:
1167
- return s - d;
1184
+ return o - u;
1168
1185
  case D.center:
1169
- return s + l / 2 - (d + f / 2);
1186
+ return o + l / 2 - (u + f / 2);
1170
1187
  case D.right:
1171
- return s + l - (d + f);
1188
+ return o + l - (u + f);
1172
1189
  case D.top:
1173
1190
  return c - h;
1174
1191
  case D.middle:
1175
- return c + m / 2 - (h + v / 2);
1192
+ return c + d / 2 - (h + w / 2);
1176
1193
  case D.bottom:
1177
- return c + m - (h + v);
1194
+ return c + d - (h + w);
1178
1195
  case D.horizon:
1179
- return s + l / 2 - (d + f / 2);
1196
+ return o + l / 2 - (u + f / 2);
1180
1197
  case D.vertical:
1181
- return c + m / 2 - (h + v / 2);
1198
+ return c + d / 2 - (h + w / 2);
1182
1199
  default:
1183
1200
  return 0;
1184
1201
  }
@@ -1186,60 +1203,60 @@ let Ue = class extends xe {
1186
1203
  }
1187
1204
  _drawingArrangeListener() {
1188
1205
  this.disposeWithMe(
1189
- this._drawingManagerService.order$.subscribe((t) => {
1190
- this._drawingArrange(t);
1206
+ this._drawingManagerService.order$.subscribe((r) => {
1207
+ this._drawingArrange(r);
1191
1208
  })
1192
1209
  );
1193
1210
  }
1194
- _drawingArrange(t) {
1195
- const { unitId: n, subUnitId: e, drawingIds: r } = t, o = this._getSceneAndTransformerByDrawingSearch(n);
1196
- if (o == null)
1211
+ _drawingArrange(r) {
1212
+ const { unitId: t, subUnitId: e, drawingIds: n } = r, s = this._getSceneAndTransformerByDrawingSearch(t);
1213
+ if (s == null)
1197
1214
  return;
1198
- const { scene: a } = o;
1199
- r.forEach((s) => {
1200
- const c = G({ unitId: n, subUnitId: e, drawingId: s }), l = a.fuzzyMathObjects(c, !0);
1215
+ const { scene: a } = s;
1216
+ n.forEach((o) => {
1217
+ const c = W({ unitId: t, subUnitId: e, drawingId: o }), l = a.fuzzyMathObjects(c, !0);
1201
1218
  if (l == null || l.length === 0)
1202
1219
  return;
1203
- const m = this._drawingManagerService.getDrawingOrder(n, e).indexOf(s);
1204
- for (const d of l)
1205
- d.setProps({ zIndex: m }), d.makeDirty();
1220
+ const d = this._drawingManagerService.getDrawingOrder(t, e).indexOf(o);
1221
+ for (const u of l)
1222
+ u.setProps({ zIndex: d }), u.makeDirty();
1206
1223
  });
1207
1224
  }
1208
1225
  _drawingAddListener() {
1209
1226
  this.disposeWithMe(
1210
- this._drawingManagerService.add$.subscribe((t) => {
1211
- this._insertDrawing(t);
1227
+ this._drawingManagerService.add$.subscribe((r) => {
1228
+ this._insertDrawing(r);
1212
1229
  })
1213
1230
  );
1214
1231
  }
1215
- _insertDrawing(t) {
1216
- const n = [];
1217
- t.forEach((e) => {
1218
- const { unitId: r } = e;
1232
+ _insertDrawing(r) {
1233
+ const t = [];
1234
+ r.forEach((e) => {
1235
+ const { unitId: n } = e;
1219
1236
  if (this._drawingManagerService.getDrawingByParam(e) == null)
1220
1237
  return;
1221
- const a = this._getSceneAndTransformerByDrawingSearch(r);
1238
+ const a = this._getSceneAndTransformerByDrawingSearch(n);
1222
1239
  if (a == null)
1223
1240
  return;
1224
- const { scene: s } = a;
1225
- n.includes(s) || n.push(s);
1226
- }), n.forEach((e) => {
1241
+ const { scene: o } = a;
1242
+ t.includes(o) || t.push(o);
1243
+ }), t.forEach((e) => {
1227
1244
  this._sceneListenerOnDrawingMap.has(e) || (this._addListenerOnDrawing(e), this._sceneListenerOnDrawingMap.add(e));
1228
1245
  });
1229
1246
  }
1230
1247
  _drawingRemoveListener() {
1231
1248
  this.disposeWithMe(
1232
- this._drawingManagerService.remove$.subscribe((t) => {
1233
- t.forEach((n) => {
1234
- var m;
1235
- const { unitId: e, subUnitId: r, drawingId: o } = n, a = this._getSceneAndTransformerByDrawingSearch(e);
1249
+ this._drawingManagerService.remove$.subscribe((r) => {
1250
+ r.forEach((t) => {
1251
+ var d;
1252
+ const { unitId: e, subUnitId: n, drawingId: s } = t, a = this._getSceneAndTransformerByDrawingSearch(e);
1236
1253
  if (a == null)
1237
1254
  return;
1238
- const { scene: s } = a, c = G({ unitId: e, subUnitId: r, drawingId: o }), l = s.fuzzyMathObjects(c, !0);
1255
+ const { scene: o } = a, c = W({ unitId: e, subUnitId: n, drawingId: s }), l = o.fuzzyMathObjects(c, !0);
1239
1256
  if (l.length > 0) {
1240
- for (const d of l)
1241
- d.dispose();
1242
- (m = s.getTransformer()) == null || m.clearSelectedObjects();
1257
+ for (const u of l)
1258
+ u.dispose();
1259
+ (d = o.getTransformer()) == null || d.clearSelectedObjects();
1243
1260
  }
1244
1261
  });
1245
1262
  })
@@ -1247,76 +1264,76 @@ let Ue = class extends xe {
1247
1264
  }
1248
1265
  _drawingUpdateListener() {
1249
1266
  this.disposeWithMe(
1250
- this._drawingManagerService.update$.subscribe((t) => {
1251
- t.forEach((n) => {
1252
- var b;
1253
- const { unitId: e, subUnitId: r, drawingId: o } = n, a = this._drawingManagerService.getDrawingByParam(n);
1267
+ this._drawingManagerService.update$.subscribe((r) => {
1268
+ r.forEach((t) => {
1269
+ var S;
1270
+ const { unitId: e, subUnitId: n, drawingId: s } = t, a = this._drawingManagerService.getDrawingByParam(t);
1254
1271
  if (a == null)
1255
1272
  return;
1256
- const { transform: s, drawingType: c } = a, l = this._getSceneAndTransformerByDrawingSearch(e);
1273
+ const { transform: o, drawingType: c } = a, l = this._getSceneAndTransformerByDrawingSearch(e);
1257
1274
  if (l == null)
1258
1275
  return;
1259
- const { scene: m, transformer: d } = l;
1260
- if (s == null)
1276
+ const { scene: d, transformer: u } = l;
1277
+ if (o == null)
1261
1278
  return !0;
1262
- const { left: h = 0, top: f = 0, width: v = 0, height: w = 0, angle: p = 0, flipX: S = !1, flipY: _ = !1, skewX: M = 0, skewY: I = 0 } = s, N = G({ unitId: e, subUnitId: r, drawingId: o }), P = m.getObject(N);
1263
- if (P == null)
1279
+ const { left: h = 0, top: f = 0, width: w = 0, height: v = 0, angle: m = 0, flipX: C = !1, flipY: _ = !1, skewX: R = 0, skewY: b = 0 } = o, N = W({ unitId: e, subUnitId: n, drawingId: s }), I = d.getObject(N);
1280
+ if (I == null)
1264
1281
  return !0;
1265
- P.transformByState({ left: h, top: f, width: v, height: w, angle: p, flipX: S, flipY: _, skewX: M, skewY: I }), (b = m.getTransformer()) == null || b.debounceRefreshControls();
1282
+ I.transformByState({ left: h, top: f, width: w, height: v, angle: m, flipX: C, flipY: _, skewX: R, skewY: b }), (S = d.getTransformer()) == null || S.debounceRefreshControls();
1266
1283
  });
1267
1284
  })
1268
1285
  );
1269
1286
  }
1270
1287
  _drawingRefreshListener() {
1271
1288
  this.disposeWithMe(
1272
- this._drawingManagerService.refreshTransform$.subscribe((t) => {
1273
- t.forEach((n) => {
1274
- const { unitId: e, subUnitId: r, drawingId: o } = n, a = this._getSceneAndTransformerByDrawingSearch(e);
1289
+ this._drawingManagerService.refreshTransform$.subscribe((r) => {
1290
+ r.forEach((t) => {
1291
+ const { unitId: e, subUnitId: n, drawingId: s } = t, a = this._getSceneAndTransformerByDrawingSearch(e);
1275
1292
  if (a == null)
1276
1293
  return;
1277
- const s = this._drawingManagerService.getDrawingByParam(n);
1278
- if (s == null)
1294
+ const o = this._drawingManagerService.getDrawingByParam(t);
1295
+ if (o == null)
1279
1296
  return;
1280
- const { transform: c } = s, { scene: l } = a, m = G({ unitId: e, subUnitId: r, drawingId: o }), d = l.getObject(m);
1281
- if (d == null || c == null)
1297
+ const { transform: c } = o, { scene: l } = a, d = W({ unitId: e, subUnitId: n, drawingId: s }), u = l.getObject(d);
1298
+ if (u == null || c == null)
1282
1299
  return !0;
1283
1300
  const {
1284
1301
  left: h = 0,
1285
1302
  top: f = 0,
1286
- width: v = 0,
1287
- height: w = 0,
1288
- angle: p = 0,
1289
- flipX: S = !1,
1303
+ width: w = 0,
1304
+ height: v = 0,
1305
+ angle: m = 0,
1306
+ flipX: C = !1,
1290
1307
  flipY: _ = !1,
1291
- skewX: M = 0,
1292
- skewY: I = 0
1308
+ skewX: R = 0,
1309
+ skewY: b = 0
1293
1310
  } = c;
1294
- d.transformByState({ left: h, top: f, width: v, height: w, angle: p, flipX: S, flipY: _, skewX: M, skewY: I });
1311
+ u.transformByState({ left: h, top: f, width: w, height: v, angle: m, flipX: C, flipY: _, skewX: R, skewY: b });
1295
1312
  });
1296
1313
  })
1297
1314
  );
1298
1315
  }
1299
1316
  _drawingVisibleListener() {
1300
1317
  this.disposeWithMe(
1301
- this._drawingManagerService.visible$.subscribe((t) => {
1302
- t.forEach((n) => {
1303
- const { unitId: e, subUnitId: r, drawingId: o, visible: a } = n, s = this._getSceneAndTransformerByDrawingSearch(e);
1304
- if (s == null)
1318
+ this._drawingManagerService.visible$.subscribe((r) => {
1319
+ r.forEach((t) => {
1320
+ const { unitId: e, subUnitId: n, drawingId: s, visible: a } = t, o = this._getSceneAndTransformerByDrawingSearch(e);
1321
+ if (o == null)
1305
1322
  return;
1306
- const { scene: c } = s, l = G({ unitId: e, subUnitId: r, drawingId: o }), m = c.getObject(l);
1307
- if (m == null)
1323
+ const { scene: c } = o, l = W({ unitId: e, subUnitId: n, drawingId: s }), d = c.getObject(l);
1324
+ if (d == null)
1308
1325
  return !0;
1309
- a ? m.show() : m.hide();
1326
+ a ? d.show() : d.hide();
1310
1327
  });
1311
1328
  })
1312
1329
  );
1313
1330
  }
1314
- _filterUpdateParams(t, n) {
1315
- return t.filter((e, r) => {
1331
+ _filterUpdateParams(r, t) {
1332
+ return r.filter((e, n) => {
1316
1333
  if (e == null)
1317
1334
  return !1;
1318
- const { transform: o } = e;
1319
- return sn(o, n == null ? void 0 : n[r]);
1335
+ const { transform: s } = e;
1336
+ return ot(s, t == null ? void 0 : t[n]);
1320
1337
  });
1321
1338
  }
1322
1339
  // group?.getObjects().forEach((o) => {
@@ -1326,52 +1343,52 @@ let Ue = class extends xe {
1326
1343
  // drawings.push({ unitId, subUnitId, drawingId });
1327
1344
  // }
1328
1345
  // });
1329
- _addListenerOnDrawing(t) {
1330
- const n = t.getTransformerByCreate();
1346
+ _addListenerOnDrawing(r) {
1347
+ const t = r.getTransformerByCreate();
1331
1348
  let e = null;
1332
1349
  this.disposeWithMe(
1333
- Ce(
1334
- n.changeStart$.subscribe((r) => {
1335
- const { objects: o } = r, a = Array.from(o.values()), s = [];
1350
+ _e(
1351
+ t.changeStart$.subscribe((n) => {
1352
+ const { objects: s } = n, a = Array.from(s.values()), o = [];
1336
1353
  e = a.map((c) => {
1337
- const { left: l, top: m, height: d, width: h, angle: f, oKey: v, isInGroup: w } = c, p = this._drawingManagerService.getDrawingOKey(v);
1338
- if (w || c instanceof we) {
1339
- let S = c.ancestorGroup;
1340
- if (S == null && c instanceof we && (S = c), S == null)
1354
+ const { left: l, top: d, height: u, width: h, angle: f, oKey: w, isInGroup: v } = c, m = this._drawingManagerService.getDrawingOKey(w);
1355
+ if (v || c instanceof Ce) {
1356
+ let C = c.ancestorGroup;
1357
+ if (C == null && c instanceof Ce && (C = c), C == null)
1341
1358
  return null;
1342
- const _ = this._drawingManagerService.getDrawingOKey(S.oKey);
1359
+ const _ = this._drawingManagerService.getDrawingOKey(C.oKey);
1343
1360
  if (_) {
1344
- const { unitId: M, subUnitId: I, drawingId: N } = _;
1345
- s.push({ unitId: M, subUnitId: I, drawingId: N });
1346
- const { left: P, top: b, height: y, width: R, angle: O } = S;
1347
- return { left: P, top: b, height: y, width: R, angle: O };
1361
+ const { unitId: R, subUnitId: b, drawingId: N } = _;
1362
+ o.push({ unitId: R, subUnitId: b, drawingId: N });
1363
+ const { left: I, top: S, height: y, width: M, angle: O } = C;
1364
+ return { left: I, top: S, height: y, width: M, angle: O };
1348
1365
  }
1349
- } else if (p != null) {
1350
- const { unitId: S, subUnitId: _, drawingId: M } = p;
1351
- return s.push({ unitId: S, subUnitId: _, drawingId: M }), { left: l, top: m, height: d, width: h, angle: f };
1366
+ } else if (m != null) {
1367
+ const { unitId: C, subUnitId: _, drawingId: R } = m;
1368
+ return o.push({ unitId: C, subUnitId: _, drawingId: R }), { left: l, top: d, height: u, width: h, angle: f };
1352
1369
  }
1353
1370
  return null;
1354
- }).filter((c) => c != null), s.length > 0 ? this._commandService.syncExecuteCommand(Ne.id, s) : this._commandService.syncExecuteCommand(Ne.id, []);
1371
+ }).filter((c) => c != null), o.length > 0 ? this._commandService.syncExecuteCommand(Ee.id, o) : this._commandService.syncExecuteCommand(Ee.id, []);
1355
1372
  })
1356
1373
  )
1357
1374
  ), this.disposeWithMe(
1358
- Ce(
1359
- n.changeEnd$.subscribe((r) => {
1360
- const { objects: o } = r, a = this._filterUpdateParams(Ve(o, this._drawingManagerService), e);
1375
+ _e(
1376
+ t.changeEnd$.subscribe((n) => {
1377
+ const { objects: s } = n, a = this._filterUpdateParams(We(s, this._drawingManagerService), e);
1361
1378
  a.length > 0 && this._drawingManagerService.featurePluginUpdateNotification(a);
1362
1379
  })
1363
1380
  )
1364
1381
  );
1365
1382
  }
1366
1383
  };
1367
- Ue = Ht([
1368
- Re(0, Ke),
1369
- Re(1, me),
1370
- Re(2, ue),
1371
- Re(3, re)
1372
- ], Ue);
1373
- class Me extends Gn {
1374
- constructor(n, e) {
1384
+ He = Ir([
1385
+ Ne(0, Ze),
1386
+ Ne(1, he),
1387
+ Ne(2, me),
1388
+ Ne(3, ae)
1389
+ ], He);
1390
+ class De extends Lt {
1391
+ constructor(t, e) {
1375
1392
  e == null && (e = {}), e.transformerConfig = {
1376
1393
  keepRatio: !1,
1377
1394
  isCropper: !0,
@@ -1379,362 +1396,362 @@ class Me extends Gn {
1379
1396
  anchorStroke: "rgb(255, 255, 255)",
1380
1397
  anchorSize: 24
1381
1398
  };
1382
- super(n, e);
1383
- ee(this, "_srcRect");
1384
- ee(this, "_prstGeom");
1385
- ee(this, "_applyTransform");
1386
- ee(this, "_dragPadding", 8);
1387
- ee(this, "_cacheCanvas");
1399
+ super(t, e);
1400
+ te(this, "_srcRect");
1401
+ te(this, "_prstGeom");
1402
+ te(this, "_applyTransform");
1403
+ te(this, "_dragPadding", 8);
1404
+ te(this, "_cacheCanvas");
1388
1405
  e != null && e.srcRect && (this._srcRect = e.srcRect), e != null && e.prstGeom && (this._prstGeom = e.prstGeom), e != null && e.applyTransform && (this._applyTransform = e.applyTransform), e != null && e.dragPadding && (this._dragPadding = e.dragPadding), this._applyProps();
1389
1406
  }
1390
- refreshSrcRect(n, e) {
1391
- this._srcRect = n, this._applyTransform = e, this._applyProps();
1407
+ refreshSrcRect(t, e) {
1408
+ this._srcRect = t, this._applyTransform = e, this._applyProps();
1392
1409
  }
1393
1410
  get srcRect() {
1394
1411
  return this._srcRect;
1395
1412
  }
1396
1413
  dispose() {
1397
- var n;
1398
- super.dispose(), (n = this._cacheCanvas) == null || n.dispose(), this._srcRect = null;
1414
+ var t;
1415
+ super.dispose(), (t = this._cacheCanvas) == null || t.dispose(), this._srcRect = null;
1399
1416
  }
1400
- isHit(n) {
1401
- const e = this.getInverseCoord(n);
1417
+ isHit(t) {
1418
+ const e = this.getInverseCoord(t);
1402
1419
  return e.x >= -this.strokeWidth / 2 && e.x <= this.width + this.strokeWidth / 2 && e.y >= -this.strokeWidth / 2 && e.y <= this.height + this.strokeWidth / 2 && !this._inSurround(e);
1403
1420
  }
1404
- _inSurround(n) {
1421
+ _inSurround(t) {
1405
1422
  const e = this._dragPadding;
1406
- return n.x >= e - this.strokeWidth / 2 && n.x <= this.width + this.strokeWidth / 2 - e && n.y >= e - this.strokeWidth / 2 && n.y <= this.height + this.strokeWidth / 2 - e;
1423
+ return t.x >= e - this.strokeWidth / 2 && t.x <= this.width + this.strokeWidth / 2 - e && t.y >= e - this.strokeWidth / 2 && t.y <= this.height + this.strokeWidth / 2 - e;
1407
1424
  }
1408
- render(n, e) {
1409
- return this.visible ? (n.save(), this._draw(n), n.restore(), this.makeDirty(!1), this) : (this.makeDirty(!1), this);
1425
+ render(t, e) {
1426
+ return this.visible ? (t.save(), this._draw(t), t.restore(), this.makeDirty(!1), this) : (this.makeDirty(!1), this);
1410
1427
  }
1411
- _draw(n) {
1428
+ _draw(t) {
1412
1429
  var c, l;
1413
- const r = this.getScene().getEngine(), { width: o, height: a } = r;
1430
+ const n = this.getScene().getEngine(), { width: s, height: a } = n;
1414
1431
  this._initialCacheCanvas(), (c = this._cacheCanvas) == null || c.clear();
1415
- const s = (l = this._cacheCanvas) == null ? void 0 : l.getContext();
1416
- s != null && (s.save(), ln.drawWith(s, {
1432
+ const o = (l = this._cacheCanvas) == null ? void 0 : l.getContext();
1433
+ o != null && (o.save(), lt.drawWith(o, {
1417
1434
  left: 0,
1418
1435
  top: 0,
1419
- width: o,
1436
+ width: s,
1420
1437
  height: a,
1421
1438
  fill: "rgba(0, 0, 0, 0.5)"
1422
- }), s.setTransform(n.getTransform()), this._clipForApplyObject(s), this._applyCache(n), s.restore());
1439
+ }), o.setTransform(t.getTransform()), this._clipForApplyObject(o), this._applyCache(t), o.restore());
1423
1440
  }
1424
- _clipForApplyObject(n) {
1441
+ _clipForApplyObject(t) {
1425
1442
  let e = 0;
1426
- if (this._prstGeom != null && (e = 1), n.globalCompositeOperation = "destination-out", n.beginPath(), e === 0) {
1427
- const r = this.transform.getMatrix();
1428
- n.transform(r[0], r[1], r[2], r[3], r[4], r[5]), n.rect(0, 0, this.width, this.height), n.fill();
1443
+ if (this._prstGeom != null && (e = 1), t.globalCompositeOperation = "destination-out", t.beginPath(), e === 0) {
1444
+ const n = this.transform.getMatrix();
1445
+ t.transform(n[0], n[1], n[2], n[3], n[4], n[5]), t.rect(0, 0, this.width, this.height), t.fill();
1429
1446
  }
1430
1447
  }
1431
1448
  _applyProps() {
1432
1449
  if (this._applyTransform == null)
1433
1450
  return;
1434
- let n = 0, e = 0, r = 0, o = 0;
1435
- const { left: a = 0, top: s = 0, width: c = 0, height: l = 0, angle: m } = this._applyTransform;
1451
+ let t = 0, e = 0, n = 0, s = 0;
1452
+ const { left: a = 0, top: o = 0, width: c = 0, height: l = 0, angle: d } = this._applyTransform;
1436
1453
  if (this._srcRect != null) {
1437
- const { left: f = 0, top: v = 0, right: w = 0, bottom: p = 0 } = this._srcRect;
1438
- n = f, e = v, r = w, o = p;
1454
+ const { left: f = 0, top: w = 0, right: v = 0, bottom: m = 0 } = this._srcRect;
1455
+ t = f, e = w, n = v, s = m;
1439
1456
  }
1440
- const d = a + n, h = s + e;
1457
+ const u = a + t, h = o + e;
1441
1458
  this.transformByState({
1442
- left: d,
1459
+ left: u,
1443
1460
  top: h,
1444
- width: a + c - r - d,
1445
- height: s + l - o - h,
1446
- angle: m
1461
+ width: a + c - n - u,
1462
+ height: o + l - s - h,
1463
+ angle: d
1447
1464
  });
1448
1465
  }
1449
- _applyCache(n) {
1450
- if (!n || this._cacheCanvas == null)
1466
+ _applyCache(t) {
1467
+ if (!t || this._cacheCanvas == null)
1451
1468
  return;
1452
1469
  const e = this._cacheCanvas.getContext();
1453
- e.save(), n.save(), n.setTransform(1, 0, 0, 1, 0, 0), e.setTransform(1, 0, 0, 1, 0, 0), n.drawImage(this._cacheCanvas.getCanvasEle(), 0, 0), n.restore(), e.restore();
1470
+ e.save(), t.save(), t.setTransform(1, 0, 0, 1, 0, 0), e.setTransform(1, 0, 0, 1, 0, 0), t.drawImage(this._cacheCanvas.getCanvasEle(), 0, 0), t.restore(), e.restore();
1454
1471
  }
1455
1472
  _initialCacheCanvas() {
1456
1473
  if (this._cacheCanvas != null)
1457
1474
  return;
1458
- const n = this.getScene();
1459
- if (n == null) return;
1460
- this._cacheCanvas = new Wn();
1461
- const e = n.getEngine();
1475
+ const t = this.getScene();
1476
+ if (t == null) return;
1477
+ this._cacheCanvas = new kt();
1478
+ const e = t.getEngine();
1462
1479
  this._cacheCanvas.setSize(e.width, e.height), e.onTransformChange$.subscribeEvent(() => {
1463
- var r;
1464
- (r = this._cacheCanvas) == null || r.setSize(e.width, e.height), this.makeDirty(!0);
1480
+ var n;
1481
+ (n = this._cacheCanvas) == null || n.setSize(e.width, e.height), this.makeDirty(!0);
1465
1482
  });
1466
1483
  }
1467
1484
  }
1468
- var Lt = Object.getOwnPropertyDescriptor, xt = (i, t, n, e) => {
1469
- for (var r = e > 1 ? void 0 : e ? Lt(t, n) : t, o = i.length - 1, a; o >= 0; o--)
1470
- (a = i[o]) && (r = a(r) || r);
1471
- return r;
1472
- }, de = (i, t) => (n, e) => t(n, e, i);
1473
- let Ae = class extends xe {
1474
- constructor(t, n, e, r, o, a) {
1485
+ var Mr = Object.getOwnPropertyDescriptor, Rr = (i, r, t, e) => {
1486
+ for (var n = e > 1 ? void 0 : e ? Mr(r, t) : r, s = i.length - 1, a; s >= 0; s--)
1487
+ (a = i[s]) && (n = a(n) || n);
1488
+ return n;
1489
+ }, fe = (i, r) => (t, e) => r(t, e, i);
1490
+ let Ae = class extends Ve {
1491
+ constructor(r, t, e, n, s, a) {
1475
1492
  super();
1476
- ee(this, "_sceneListenerOnImageMap", /* @__PURE__ */ new WeakSet());
1477
- this._commandService = t, this._drawingManagerService = n, this._renderManagerService = e, this._univerInstanceService = r, this._messageService = o, this._localeService = a, this._init();
1493
+ te(this, "_sceneListenerOnImageMap", /* @__PURE__ */ new WeakSet());
1494
+ this._commandService = r, this._drawingManagerService = t, this._renderManagerService = e, this._univerInstanceService = n, this._messageService = s, this._localeService = a, this._init();
1478
1495
  }
1479
1496
  _init() {
1480
1497
  this._initOpenCrop(), this._initCloseCrop(), this._initAutoCrop();
1481
1498
  }
1482
1499
  _initAutoCrop() {
1483
1500
  this.disposeWithMe(
1484
- this._commandService.onCommandExecuted((t) => {
1485
- if (t.id !== Be.id)
1501
+ this._commandService.onCommandExecuted((r) => {
1502
+ if (r.id !== Ue.id)
1486
1503
  return;
1487
- const n = t.params;
1488
- if (n == null)
1504
+ const t = r.params;
1505
+ if (t == null)
1489
1506
  return;
1490
- const { cropType: e } = n, r = this._drawingManagerService.getFocusDrawings();
1491
- if (r.length !== 1)
1507
+ const { cropType: e } = t, n = this._drawingManagerService.getFocusDrawings();
1508
+ if (n.length !== 1)
1492
1509
  return;
1493
- const o = r[0], { unitId: a, subUnitId: s, drawingId: c } = o, l = this._renderManagerService.getRenderById(a), m = l == null ? void 0 : l.scene;
1494
- if (m == null)
1510
+ const s = n[0], { unitId: a, subUnitId: o, drawingId: c } = s, l = this._renderManagerService.getRenderById(a), d = l == null ? void 0 : l.scene;
1511
+ if (d == null)
1495
1512
  return !0;
1496
- this._searchCropObject(m) != null && this._commandService.syncExecuteCommand(ge.id, { isAuto: !0 });
1497
- const h = G({ unitId: a, subUnitId: s, drawingId: c }), f = m.getObject(h);
1498
- if (!(f instanceof ze)) {
1513
+ this._searchCropObject(d) != null && this._commandService.syncExecuteCommand(ge.id, { isAuto: !0 });
1514
+ const h = W({ unitId: a, subUnitId: o, drawingId: c }), f = d.getObject(h);
1515
+ if (!(f instanceof Ke)) {
1499
1516
  this._messageService.show({
1500
- type: Qe.Error,
1517
+ type: tt.Error,
1501
1518
  content: this._localeService.t("image-cropper.error")
1502
1519
  });
1503
1520
  return;
1504
1521
  }
1505
- f != null && (this._updateCropperObject(e, f), this._commandService.executeCommand(Fe.id, { unitId: a, subUnitId: s, drawingId: c }));
1522
+ f != null && (this._updateCropperObject(e, f), this._commandService.executeCommand(Ye.id, { unitId: a, subUnitId: o, drawingId: c }));
1506
1523
  })
1507
1524
  );
1508
1525
  }
1509
- _calculateSrcRectByRatio(t, n, e, r, o, a) {
1510
- const s = e / r, c = o / a;
1511
- let l = e, m = r;
1512
- s > c ? l = r * c : m = e / c;
1513
- const d = (e - l) / 2, h = (r - m) / 2;
1526
+ _calculateSrcRectByRatio(r, t, e, n, s, a) {
1527
+ const o = e / n, c = s / a;
1528
+ let l = e, d = n;
1529
+ o > c ? l = n * c : d = e / c;
1530
+ const u = (e - l) / 2, h = (n - d) / 2;
1514
1531
  return {
1515
- left: ye(d, 1),
1516
- top: ye(h, 1),
1517
- right: ye(e - (d + l), 1),
1518
- bottom: ye(r - (h + m), 1)
1532
+ left: Re(u, 1),
1533
+ top: Re(h, 1),
1534
+ right: Re(e - (u + l), 1),
1535
+ bottom: Re(n - (h + d), 1)
1519
1536
  };
1520
1537
  }
1521
- _updateCropperObject(t, n) {
1522
- const { left: e, top: r, width: o, height: a } = n.calculateTransformWithSrcRect();
1523
- let s;
1524
- switch (t) {
1525
- case A.R1_1:
1526
- s = this._calculateSrcRectByRatio(e, r, o, a, 1, 1);
1538
+ _updateCropperObject(r, t) {
1539
+ const { left: e, top: n, width: s, height: a } = t.calculateTransformWithSrcRect();
1540
+ let o;
1541
+ switch (r) {
1542
+ case x.R1_1:
1543
+ o = this._calculateSrcRectByRatio(e, n, s, a, 1, 1);
1527
1544
  break;
1528
- case A.R16_9:
1529
- s = this._calculateSrcRectByRatio(e, r, o, a, 16, 9);
1545
+ case x.R16_9:
1546
+ o = this._calculateSrcRectByRatio(e, n, s, a, 16, 9);
1530
1547
  break;
1531
- case A.R9_16:
1532
- s = this._calculateSrcRectByRatio(e, r, o, a, 9, 16);
1548
+ case x.R9_16:
1549
+ o = this._calculateSrcRectByRatio(e, n, s, a, 9, 16);
1533
1550
  break;
1534
- case A.R5_4:
1535
- s = this._calculateSrcRectByRatio(e, r, o, a, 5, 4);
1551
+ case x.R5_4:
1552
+ o = this._calculateSrcRectByRatio(e, n, s, a, 5, 4);
1536
1553
  break;
1537
- case A.R4_5:
1538
- s = this._calculateSrcRectByRatio(e, r, o, a, 4, 5);
1554
+ case x.R4_5:
1555
+ o = this._calculateSrcRectByRatio(e, n, s, a, 4, 5);
1539
1556
  break;
1540
- case A.R4_3:
1541
- s = this._calculateSrcRectByRatio(e, r, o, a, 4, 3);
1557
+ case x.R4_3:
1558
+ o = this._calculateSrcRectByRatio(e, n, s, a, 4, 3);
1542
1559
  break;
1543
- case A.R3_4:
1544
- s = this._calculateSrcRectByRatio(e, r, o, a, 3, 4);
1560
+ case x.R3_4:
1561
+ o = this._calculateSrcRectByRatio(e, n, s, a, 3, 4);
1545
1562
  break;
1546
- case A.R3_2:
1547
- s = this._calculateSrcRectByRatio(e, r, o, a, 3, 2);
1563
+ case x.R3_2:
1564
+ o = this._calculateSrcRectByRatio(e, n, s, a, 3, 2);
1548
1565
  break;
1549
- case A.R2_3:
1550
- s = this._calculateSrcRectByRatio(e, r, o, a, 2, 3);
1566
+ case x.R2_3:
1567
+ o = this._calculateSrcRectByRatio(e, n, s, a, 2, 3);
1551
1568
  break;
1552
- case A.FREE:
1569
+ case x.FREE:
1553
1570
  }
1554
- if (s == null)
1571
+ if (o == null)
1555
1572
  return;
1556
- n.setSrcRect(s);
1557
- const { left: c = 0, top: l = 0, bottom: m = 0, right: d = 0 } = s;
1558
- n.transformByStateCloseCropper({
1573
+ t.setSrcRect(o);
1574
+ const { left: c = 0, top: l = 0, bottom: d = 0, right: u = 0 } = o;
1575
+ t.transformByStateCloseCropper({
1559
1576
  left: e + c,
1560
- top: r + l,
1561
- width: o - d - c,
1562
- height: a - m - l
1577
+ top: n + l,
1578
+ width: s - u - c,
1579
+ height: a - d - l
1563
1580
  });
1564
1581
  }
1565
1582
  _initOpenCrop() {
1566
1583
  this.disposeWithMe(
1567
- this._commandService.onCommandExecuted((t) => {
1568
- if (t.id !== Fe.id)
1584
+ this._commandService.onCommandExecuted((r) => {
1585
+ if (r.id !== Ye.id)
1569
1586
  return;
1570
- const n = t.params;
1571
- if (n == null)
1587
+ const t = r.params;
1588
+ if (t == null)
1572
1589
  return;
1573
- const { unitId: e, subUnitId: r, drawingId: o } = n, a = this._renderManagerService.getRenderById(e), s = a == null ? void 0 : a.scene;
1574
- if (s == null)
1590
+ const { unitId: e, subUnitId: n, drawingId: s } = t, a = this._renderManagerService.getRenderById(e), o = a == null ? void 0 : a.scene;
1591
+ if (o == null)
1575
1592
  return !0;
1576
- if (this._sceneListenerOnImageMap.has(s) || (this._addListenerOnImage(s), this._sceneListenerOnImageMap.add(s)), this._drawingManagerService.getDrawingByParam({ unitId: e, subUnitId: r, drawingId: o }) == null)
1593
+ if (this._sceneListenerOnImageMap.has(o) || (this._addListenerOnImage(o), this._sceneListenerOnImageMap.add(o)), this._drawingManagerService.getDrawingByParam({ unitId: e, subUnitId: n, drawingId: s }) == null)
1577
1594
  return;
1578
- const l = G({ unitId: e, subUnitId: r, drawingId: o }), m = s.getObject(l);
1579
- if (m == null)
1595
+ const l = W({ unitId: e, subUnitId: n, drawingId: s }), d = o.getObject(l);
1596
+ if (d == null)
1580
1597
  return;
1581
- if (!(m instanceof ze)) {
1598
+ if (!(d instanceof Ke)) {
1582
1599
  this._messageService.show({
1583
- type: Qe.Error,
1600
+ type: tt.Error,
1584
1601
  content: this._localeService.t("image-cropper.error")
1585
1602
  });
1586
1603
  return;
1587
1604
  }
1588
- const d = s.getTransformer();
1589
- d == null || d.clearControls();
1590
- const h = new Me(`${l}-crop`, {
1591
- srcRect: m.srcRect,
1592
- prstGeom: m.prstGeom,
1593
- applyTransform: m.calculateTransformWithSrcRect()
1605
+ const u = o.getTransformer();
1606
+ u == null || u.clearControls();
1607
+ const h = new De(`${l}-crop`, {
1608
+ srcRect: d.srcRect,
1609
+ prstGeom: d.prstGeom,
1610
+ applyTransform: d.calculateTransformWithSrcRect()
1594
1611
  });
1595
- s.addObject(h, m.getLayerIndex() + 1).attachTransformerTo(h), d == null || d.createControlForCopper(h), this._addHoverForImageCopper(h), m.openRenderByCropper(), d == null || d.refreshControls(), h.makeDirty(!0), this._commandService.syncExecuteCommand(Ne.id, [{ unitId: e, subUnitId: r, drawingId: o }]);
1612
+ o.addObject(h, d.getLayerIndex() + 1).attachTransformerTo(h), u == null || u.createControlForCopper(h), this._addHoverForImageCopper(h), d.openRenderByCropper(), u == null || u.refreshControls(), h.makeDirty(!0), this._commandService.syncExecuteCommand(Ee.id, [{ unitId: e, subUnitId: n, drawingId: s }]);
1596
1613
  })
1597
1614
  );
1598
1615
  }
1599
- _searchCropObject(t) {
1600
- const n = t.getAllObjectsByOrder();
1601
- for (const e of n)
1602
- if (e instanceof Me)
1616
+ _searchCropObject(r) {
1617
+ const t = r.getAllObjectsByOrder();
1618
+ for (const e of t)
1619
+ if (e instanceof De)
1603
1620
  return e;
1604
1621
  }
1605
1622
  _initCloseCrop() {
1606
1623
  this.disposeWithMe(
1607
- this._commandService.onCommandExecuted((n) => {
1608
- if (n.id !== ge.id)
1624
+ this._commandService.onCommandExecuted((t) => {
1625
+ if (t.id !== ge.id)
1609
1626
  return;
1610
1627
  const e = this._univerInstanceService.getFocusedUnit();
1611
1628
  if (e == null)
1612
1629
  return;
1613
- const r = e.getUnitId(), o = this._renderManagerService.getRenderById(r), a = o == null ? void 0 : o.scene;
1630
+ const n = e.getUnitId(), s = this._renderManagerService.getRenderById(n), a = s == null ? void 0 : s.scene;
1614
1631
  if (a == null)
1615
1632
  return !0;
1616
- const s = this._searchCropObject(a);
1617
- if (s == null)
1633
+ const o = this._searchCropObject(a);
1634
+ if (o == null)
1618
1635
  return;
1619
- const c = this._getApplyObjectByCropObject(s);
1636
+ const c = this._getApplyObjectByCropObject(o);
1620
1637
  if (c == null)
1621
1638
  return;
1622
1639
  const l = a.getTransformerByCreate();
1623
- l.detachFrom(s), l.clearCopperControl();
1624
- const m = this._getSrcRectByTransformState(c, s), d = this._drawingManagerService.getDrawingOKey(c.oKey);
1625
- if (d != null) {
1626
- const { left: h, top: f, height: v, width: w } = s;
1640
+ l.detachFrom(o), l.clearCopperControl();
1641
+ const d = this._getSrcRectByTransformState(c, o), u = this._drawingManagerService.getDrawingOKey(c.oKey);
1642
+ if (u != null) {
1643
+ const { left: h, top: f, height: w, width: v } = o;
1627
1644
  this._drawingManagerService.featurePluginUpdateNotification([{
1628
- ...d,
1645
+ ...u,
1629
1646
  transform: {
1630
- ...d.transform,
1647
+ ...u.transform,
1631
1648
  left: h,
1632
1649
  top: f,
1633
- height: v,
1634
- width: w
1650
+ height: w,
1651
+ width: v
1635
1652
  },
1636
- srcRect: m.srcRectAngle
1653
+ srcRect: d.srcRectAngle
1637
1654
  }]);
1638
1655
  }
1639
- c.setSrcRect({ ...m.srcRectAngle }), c.closeRenderByCropper(), c.makeDirty(!0), s == null || s.dispose();
1656
+ c.setSrcRect({ ...d.srcRectAngle }), c.closeRenderByCropper(), c.makeDirty(!0), o == null || o.dispose();
1640
1657
  })
1641
1658
  );
1642
- const t = this._univerInstanceService.getCurrentTypeOfUnit$(Oe.UNIVER_SHEET).pipe(
1643
- Zn((n) => n ? n.activeSheet$ : Xn(null))
1659
+ const r = this._univerInstanceService.getCurrentTypeOfUnit$(Te.UNIVER_SHEET).pipe(
1660
+ Yt((t) => t ? t.activeSheet$ : Zt(null))
1644
1661
  );
1645
- this.disposeWithMe(t.subscribe(() => {
1662
+ this.disposeWithMe(r.subscribe(() => {
1646
1663
  this._commandService.syncExecuteCommand(ge.id);
1647
1664
  }));
1648
1665
  }
1649
- _getApplyObjectByCropObject(t) {
1650
- const n = t.oKey, e = n.slice(0, n.length - 5), r = t.getScene();
1651
- if (!r) return null;
1652
- const o = r.getObject(e);
1653
- return o == null ? null : o;
1666
+ _getApplyObjectByCropObject(r) {
1667
+ const t = r.oKey, e = t.slice(0, t.length - 5), n = r.getScene();
1668
+ if (!n) return null;
1669
+ const s = n.getObject(e);
1670
+ return s == null ? null : s;
1654
1671
  }
1655
- _addListenerOnImage(t) {
1656
- const n = t.getTransformerByCreate();
1672
+ _addListenerOnImage(r) {
1673
+ const t = r.getTransformerByCreate();
1657
1674
  let e = null;
1658
1675
  this.disposeWithMe(
1659
- n.changeStart$.subscribe((r) => {
1660
- const { objects: o } = r, a = o.values().next().value;
1661
- if (a == null || !(a instanceof Me))
1676
+ t.changeStart$.subscribe((n) => {
1677
+ const { objects: s } = n, a = s.values().next().value;
1678
+ if (a == null || !(a instanceof De))
1662
1679
  return;
1663
- const { left: s, top: c, height: l, width: m, angle: d } = a;
1664
- e = { left: s, top: c, height: l, width: m, angle: d }, n.clearCopperControl();
1680
+ const { left: o, top: c, height: l, width: d, angle: u } = a;
1681
+ e = { left: o, top: c, height: l, width: d, angle: u }, t.clearCopperControl();
1665
1682
  })
1666
1683
  ), this.disposeWithMe(
1667
- n.changeEnd$.subscribe((r) => {
1668
- const { objects: o } = r, a = o.values().next().value;
1669
- if (a == null || !(a instanceof Me))
1684
+ t.changeEnd$.subscribe((n) => {
1685
+ const { objects: s } = n, a = s.values().next().value;
1686
+ if (a == null || !(a instanceof De))
1670
1687
  return;
1671
- const { left: s, top: c, height: l, width: m, angle: d } = a;
1672
- if (!sn({ left: s, top: c, height: l, width: m, angle: d }, e))
1688
+ const { left: o, top: c, height: l, width: d, angle: u } = a;
1689
+ if (!ot({ left: o, top: c, height: l, width: d, angle: u }, e))
1673
1690
  return;
1674
1691
  const h = this._getApplyObjectByCropObject(a);
1675
1692
  if (h == null)
1676
1693
  return;
1677
1694
  const f = this._getSrcRectByTransformState(h, a);
1678
- a.refreshSrcRect(f.srcRect, h.getState()), n.createControlForCopper(a);
1695
+ a.refreshSrcRect(f.srcRect, h.getState()), t.createControlForCopper(a);
1679
1696
  })
1680
- ), this._endCropListener(t);
1697
+ ), this._endCropListener(r);
1681
1698
  }
1682
- _addHoverForImageCopper(t) {
1699
+ _addHoverForImageCopper(r) {
1683
1700
  this.disposeWithMe(
1684
- t.onPointerEnter$.subscribeEvent(() => {
1685
- t.cursor = Te.MOVE;
1701
+ r.onPointerEnter$.subscribeEvent(() => {
1702
+ r.cursor = je.MOVE;
1686
1703
  })
1687
1704
  ), this.disposeWithMe(
1688
- t.onPointerLeave$.subscribeEvent(() => {
1689
- t.cursor = Te.DEFAULT;
1705
+ r.onPointerLeave$.subscribeEvent(() => {
1706
+ r.cursor = je.DEFAULT;
1690
1707
  })
1691
1708
  );
1692
1709
  }
1693
- _endCropListener(t) {
1694
- const n = t.getTransformerByCreate();
1710
+ _endCropListener(r) {
1711
+ const t = r.getTransformerByCreate();
1695
1712
  this.disposeWithMe(
1696
- n.clearControl$.subscribe((e) => {
1713
+ t.clearControl$.subscribe((e) => {
1697
1714
  e === !0 && this._commandService.syncExecuteCommand(ge.id);
1698
1715
  })
1699
1716
  );
1700
1717
  }
1701
- _getSrcRectByTransformState(t, n) {
1702
- const { left: e, top: r, height: o, width: a, strokeWidth: s, angle: c } = n, { left: l, top: m, width: d, height: h, angle: f, strokeWidth: v } = t, w = e - l, p = r - m, S = {
1703
- left: w,
1704
- top: p,
1705
- right: d - w - a,
1706
- bottom: h - p - o
1707
- }, _ = { ...S };
1718
+ _getSrcRectByTransformState(r, t) {
1719
+ const { left: e, top: n, height: s, width: a, strokeWidth: o, angle: c } = t, { left: l, top: d, width: u, height: h, angle: f, strokeWidth: w } = r, v = e - l, m = n - d, C = {
1720
+ left: v,
1721
+ top: m,
1722
+ right: u - v - a,
1723
+ bottom: h - m - s
1724
+ }, _ = { ...C };
1708
1725
  if (f !== 0) {
1709
- const M = e + a / 2, I = r + o / 2, N = new Ge(M, I), P = d / 2 + l, b = h / 2 + m, y = new Ge(P, b), R = new Ge(l, m);
1710
- R.rotateByPoint(qe(f), y);
1711
- const O = R.clone();
1712
- O.rotateByPoint(qe(-f), N);
1713
- const U = e - O.x, T = r - O.y;
1714
- _.left = U, _.top = T, _.right = d - U - a, _.bottom = h - T - o;
1726
+ const R = e + a / 2, b = n + s / 2, N = new $e(R, b), I = u / 2 + l, S = h / 2 + d, y = new $e(I, S), M = new $e(l, d);
1727
+ M.rotateByPoint(et(f), y);
1728
+ const O = M.clone();
1729
+ O.rotateByPoint(et(-f), N);
1730
+ const j = e - O.x, T = n - O.y;
1731
+ _.left = j, _.top = T, _.right = u - j - a, _.bottom = h - T - s;
1715
1732
  }
1716
1733
  return {
1717
- srcRect: S,
1734
+ srcRect: C,
1718
1735
  srcRectAngle: _
1719
1736
  };
1720
1737
  }
1721
1738
  };
1722
- Ae = xt([
1723
- de(0, me),
1724
- de(1, re),
1725
- de(2, ue),
1726
- de(3, Ke),
1727
- de(4, zn),
1728
- de(5, Le(te))
1739
+ Ae = Rr([
1740
+ fe(0, he),
1741
+ fe(1, ae),
1742
+ fe(2, me),
1743
+ fe(3, Ze),
1744
+ fe(4, Gt),
1745
+ fe(5, ke(ie))
1729
1746
  ], Ae);
1730
- var Vt = Object.getOwnPropertyDescriptor, kt = (i, t, n, e) => {
1731
- for (var r = e > 1 ? void 0 : e ? Vt(t, n) : t, o = i.length - 1, a; o >= 0; o--)
1732
- (a = i[o]) && (r = a(r) || r);
1733
- return r;
1734
- }, ce = (i, t) => (n, e) => t(n, e, i);
1735
- let He = class extends xe {
1736
- constructor(i, t, n, e, r, o, a) {
1737
- super(), this._commandService = i, this._renderManagerService = t, this._drawingManagerService = n, this._dialogService = e, this._imageIoService = r, this._currentUniverService = o, this._drawingRenderService = a, this._initialize();
1747
+ var Or = Object.getOwnPropertyDescriptor, Nr = (i, r, t, e) => {
1748
+ for (var n = e > 1 ? void 0 : e ? Or(r, t) : r, s = i.length - 1, a; s >= 0; s--)
1749
+ (a = i[s]) && (n = a(n) || n);
1750
+ return n;
1751
+ }, de = (i, r) => (t, e) => r(t, e, i);
1752
+ let Le = class extends Ve {
1753
+ constructor(i, r, t, e, n, s, a) {
1754
+ super(), this._commandService = i, this._renderManagerService = r, this._drawingManagerService = t, this._dialogService = e, this._imageIoService = n, this._currentUniverService = s, this._drawingRenderService = a, this._initialize();
1738
1755
  }
1739
1756
  dispose() {
1740
1757
  super.dispose();
@@ -1745,11 +1762,11 @@ let He = class extends xe {
1745
1762
  _commandExecutedListener() {
1746
1763
  this.disposeWithMe(
1747
1764
  this._commandService.onCommandExecuted((i) => {
1748
- if (i.id === Pn.id) {
1749
- const t = i.params;
1750
- if (t == null)
1765
+ if (i.id === yt.id) {
1766
+ const r = i.params;
1767
+ if (r == null)
1751
1768
  return;
1752
- this._resetImageSize(t);
1769
+ this._resetImageSize(r);
1753
1770
  }
1754
1771
  })
1755
1772
  );
@@ -1757,32 +1774,32 @@ let He = class extends xe {
1757
1774
  _getSceneAndTransformerByDrawingSearch(i) {
1758
1775
  if (i == null)
1759
1776
  return;
1760
- const t = this._renderManagerService.getRenderById(i), n = t == null ? void 0 : t.scene;
1761
- if (n == null)
1777
+ const r = this._renderManagerService.getRenderById(i), t = r == null ? void 0 : r.scene;
1778
+ if (t == null)
1762
1779
  return null;
1763
- const e = n.getTransformerByCreate();
1764
- return { scene: n, transformer: e };
1780
+ const e = t.getTransformerByCreate();
1781
+ return { scene: t, transformer: e };
1765
1782
  }
1766
1783
  _resetImageSize(i) {
1767
- const t = [], n = [];
1784
+ const r = [], t = [];
1768
1785
  i.forEach((e) => {
1769
- const { unitId: r, subUnitId: o, drawingId: a } = e, s = this._getSceneAndTransformerByDrawingSearch(r);
1770
- if (s == null)
1786
+ const { unitId: n, subUnitId: s, drawingId: a } = e, o = this._getSceneAndTransformerByDrawingSearch(n);
1787
+ if (o == null)
1771
1788
  return;
1772
- const { scene: c } = s, l = G({ unitId: r, subUnitId: o, drawingId: a }), m = c.getObject(l);
1773
- if (m == null)
1774
- return !0;
1775
- const d = this._drawingManagerService.getDrawingByParam(e);
1789
+ const { scene: c } = o, l = W({ unitId: n, subUnitId: s, drawingId: a }), d = c.getObject(l);
1776
1790
  if (d == null)
1777
1791
  return !0;
1778
- if (d.drawingType !== ne.DRAWING_IMAGE)
1792
+ const u = this._drawingManagerService.getDrawingByParam(e);
1793
+ if (u == null)
1794
+ return !0;
1795
+ if (u.drawingType !== re.DRAWING_IMAGE)
1779
1796
  return;
1780
- m.resetSize();
1781
- const { width: h, height: f } = m.getNativeSize();
1782
- n.includes(c) === !1 && n.push(c), t.push({
1783
- ...d,
1797
+ d.resetSize();
1798
+ const { width: h, height: f } = d.getNativeSize();
1799
+ t.includes(c) === !1 && t.push(c), r.push({
1800
+ ...u,
1784
1801
  transform: {
1785
- ...d.transform,
1802
+ ...u.transform,
1786
1803
  height: f,
1787
1804
  width: h,
1788
1805
  angle: 0
@@ -1790,9 +1807,9 @@ let He = class extends xe {
1790
1807
  srcRect: null,
1791
1808
  prstGeom: null
1792
1809
  });
1793
- }), this._drawingManagerService.featurePluginUpdateNotification(t), n.forEach((e) => {
1810
+ }), this._drawingManagerService.featurePluginUpdateNotification(r), t.forEach((e) => {
1794
1811
  e.getTransformerByCreate().refreshControls().changeNotification();
1795
- }), this._commandService.syncExecuteCommand(Ne.id, i);
1812
+ }), this._commandService.syncExecuteCommand(Ee.id, i);
1796
1813
  }
1797
1814
  _drawingAddListener() {
1798
1815
  this.disposeWithMe(
@@ -1802,127 +1819,127 @@ let He = class extends xe {
1802
1819
  );
1803
1820
  }
1804
1821
  _insertImages(i) {
1805
- i.forEach(async (t) => {
1822
+ i.forEach(async (r) => {
1806
1823
  var c;
1807
- const { unitId: n, subUnitId: e } = t, r = this._getSceneAndTransformerByDrawingSearch(n), o = (c = un(this._currentUniverService, n)) == null ? void 0 : c.subUnitId;
1808
- if (r == null || o !== e)
1824
+ const { unitId: t, subUnitId: e } = r, n = this._getSceneAndTransformerByDrawingSearch(t), s = (c = gt(this._currentUniverService, t)) == null ? void 0 : c.subUnitId;
1825
+ if (n == null || s !== e)
1809
1826
  return;
1810
- const a = this._drawingManagerService.getDrawingByParam(t);
1827
+ const a = this._drawingManagerService.getDrawingByParam(r);
1811
1828
  if (a == null)
1812
1829
  return;
1813
- const s = await this._drawingRenderService.renderImages(a, r.scene);
1814
- if (this._drawingManagerService.refreshTransform([a]), !(s == null || s.length === 0))
1815
- for (const l of s)
1830
+ const o = await this._drawingRenderService.renderImages(a, n.scene);
1831
+ if (this._drawingManagerService.refreshTransform([a]), !(o == null || o.length === 0))
1832
+ for (const l of o)
1816
1833
  this._addHoverForImage(l), this._addDialogForImage(l);
1817
1834
  });
1818
1835
  }
1819
1836
  _imageUpdateListener() {
1820
1837
  this.disposeWithMe(
1821
1838
  this._drawingManagerService.update$.subscribe((i) => {
1822
- i.forEach((t) => {
1823
- const { unitId: n, subUnitId: e, drawingId: r } = t, o = this._drawingManagerService.getDrawingByParam(t);
1824
- if (o == null)
1839
+ i.forEach((r) => {
1840
+ const { unitId: t, subUnitId: e, drawingId: n } = r, s = this._drawingManagerService.getDrawingByParam(r);
1841
+ if (s == null)
1825
1842
  return;
1826
- const { transform: a, drawingType: s, srcRect: c, prstGeom: l, source: m, imageSourceType: d } = o;
1827
- if (s !== ne.DRAWING_IMAGE)
1843
+ const { transform: a, drawingType: o, srcRect: c, prstGeom: l, source: d, imageSourceType: u } = s;
1844
+ if (o !== re.DRAWING_IMAGE)
1828
1845
  return;
1829
- const h = this._getSceneAndTransformerByDrawingSearch(n);
1846
+ const h = this._getSceneAndTransformerByDrawingSearch(t);
1830
1847
  if (h == null)
1831
1848
  return;
1832
- const { scene: f, transformer: v } = h;
1849
+ const { scene: f, transformer: w } = h;
1833
1850
  if (a == null)
1834
1851
  return !0;
1835
- const w = G({ unitId: n, subUnitId: e, drawingId: r }), p = f.getObject(w);
1836
- if (p == null)
1852
+ const v = W({ unitId: t, subUnitId: e, drawingId: n }), m = f.getObject(v);
1853
+ if (m == null)
1837
1854
  return !0;
1838
- p.setSrcRect(c), p.setPrstGeom(l), m != null && m.length > 0 && (d === Xe.BASE64 || d === Xe.URL) && p.changeSource(m);
1855
+ m.setSrcRect(c), m.setPrstGeom(l), d != null && d.length > 0 && (u === qe.BASE64 || u === qe.URL) && m.changeSource(d);
1839
1856
  });
1840
1857
  })
1841
1858
  );
1842
1859
  }
1843
1860
  _addHoverForImage(i) {
1844
1861
  this.disposeWithMe(
1845
- Ce(
1862
+ _e(
1846
1863
  i.onPointerEnter$.subscribeEvent(() => {
1847
- i.cursor = Te.GRAB;
1864
+ i.cursor = je.GRAB;
1848
1865
  })
1849
1866
  )
1850
1867
  ), this.disposeWithMe(
1851
- Ce(
1868
+ _e(
1852
1869
  i.onPointerLeave$.subscribeEvent(() => {
1853
- i.cursor = Te.DEFAULT;
1870
+ i.cursor = je.DEFAULT;
1854
1871
  })
1855
1872
  )
1856
1873
  );
1857
1874
  }
1858
1875
  _addDialogForImage(i) {
1859
1876
  this.disposeWithMe(
1860
- Ce(
1877
+ _e(
1861
1878
  i.onDblclick$.subscribeEvent(() => {
1862
- const t = `${i.oKey}-viewer-dialog`;
1863
- this._drawingRenderService.previewImage(t, i.getNative().src, i.getNativeSize().width, i.getNativeSize().height);
1879
+ const r = `${i.oKey}-viewer-dialog`;
1880
+ this._drawingRenderService.previewImage(r, i.getNative().src, i.getNativeSize().width, i.getNativeSize().height);
1864
1881
  })
1865
1882
  )
1866
1883
  );
1867
1884
  }
1868
1885
  };
1869
- He = kt([
1870
- ce(0, me),
1871
- ce(1, ue),
1872
- ce(2, re),
1873
- ce(3, gn),
1874
- ce(4, cn),
1875
- ce(5, Ke),
1876
- ce(6, Le(Ee))
1877
- ], He);
1878
- var Gt = Object.getOwnPropertyDescriptor, Wt = (i, t, n, e) => {
1879
- for (var r = e > 1 ? void 0 : e ? Gt(t, n) : t, o = i.length - 1, a; o >= 0; o--)
1880
- (a = i[o]) && (r = a(r) || r);
1881
- return r;
1882
- }, an = (i, t) => (n, e) => t(n, e, i);
1883
- const $t = "UNIVER_DRAWING_UI_PLUGIN";
1884
- var $e;
1885
- let on = ($e = class extends Hn {
1886
- constructor(i = tn, t, n) {
1887
- super(), this._config = i, this._injector = t, this._configService = n;
1888
- const { menu: e, ...r } = Ln(
1886
+ Le = Nr([
1887
+ de(0, he),
1888
+ de(1, me),
1889
+ de(2, ae),
1890
+ de(3, $t),
1891
+ de(4, ct),
1892
+ de(5, Ze),
1893
+ de(6, ke(Be))
1894
+ ], Le);
1895
+ var Dr = Object.getOwnPropertyDescriptor, Tr = (i, r, t, e) => {
1896
+ for (var n = e > 1 ? void 0 : e ? Dr(r, t) : r, s = i.length - 1, a; s >= 0; s--)
1897
+ (a = i[s]) && (n = a(n) || n);
1898
+ return n;
1899
+ }, at = (i, r) => (t, e) => r(t, e, i);
1900
+ const Er = "UNIVER_DRAWING_UI_PLUGIN";
1901
+ var Fe;
1902
+ let st = (Fe = class extends Bt {
1903
+ constructor(i = nt, r, t) {
1904
+ super(), this._config = i, this._injector = r, this._configService = t;
1905
+ const { menu: e, ...n } = Ut(
1889
1906
  {},
1890
- tn,
1907
+ nt,
1891
1908
  this._config
1892
1909
  );
1893
- e && this._configService.setConfig("menu", e, { merge: !0 }), this._configService.setConfig(Et, r);
1910
+ e && this._configService.setConfig("menu", e, { merge: !0 }), this._configService.setConfig(Cr, n);
1894
1911
  }
1895
1912
  onStarting() {
1896
1913
  this._initDependencies();
1897
1914
  }
1898
1915
  onRendered() {
1899
- this._injector.get(Ue), this._injector.get(je), this._injector.get(Ae), this._injector.get(He);
1916
+ this._injector.get(He), this._injector.get(xe), this._injector.get(Ae), this._injector.get(Le);
1900
1917
  }
1901
1918
  _initDependencies() {
1902
1919
  [
1903
- [Ee],
1904
- [Ue],
1905
- [je],
1920
+ [Be],
1921
+ [He],
1922
+ [xe],
1906
1923
  [Ae],
1907
- [He]
1908
- ].forEach((t) => this._injector.add(t));
1909
- }
1910
- }, ee($e, "pluginName", $t), $e);
1911
- on = Wt([
1912
- an(1, Le(Un)),
1913
- an(2, An)
1914
- ], on);
1924
+ [Le]
1925
+ ].forEach((r) => this._injector.add(r));
1926
+ }
1927
+ }, te(Fe, "pluginName", Er), Fe);
1928
+ st = Tr([
1929
+ at(1, ke(Pt)),
1930
+ at(2, jt)
1931
+ ], st);
1915
1932
  export {
1916
- Be as AutoImageCropOperation,
1917
- Tt as COMPONENT_IMAGE_POPUP_MENU,
1933
+ Ue as AutoImageCropOperation,
1934
+ _r as COMPONENT_IMAGE_POPUP_MENU,
1918
1935
  ge as CloseImageCropOperation,
1919
- er as DrawingCommonPanel,
1920
- Ee as DrawingRenderService,
1921
- Me as ImageCropperObject,
1922
- Dt as ImagePopupMenu,
1923
- Pn as ImageResetSizeOperation,
1924
- Fe as OpenImageCropOperation,
1925
- Ye as SetDrawingAlignOperation,
1926
- on as UniverDrawingUIPlugin,
1927
- Ve as getUpdateParams
1936
+ Wr as DrawingCommonPanel,
1937
+ Be as DrawingRenderService,
1938
+ De as ImageCropperObject,
1939
+ wr as ImagePopupMenu,
1940
+ yt as ImageResetSizeOperation,
1941
+ Ye as OpenImageCropOperation,
1942
+ Xe as SetDrawingAlignOperation,
1943
+ st as UniverDrawingUIPlugin,
1944
+ We as getUpdateParams
1928
1945
  };