@univerjs/sheets-hyper-link-ui 0.5.0 → 0.5.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/es/index.js CHANGED
@@ -1,32 +1,32 @@
1
- var er = Object.defineProperty;
2
- var tr = (t, e, n) => e in t ? er(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var B = (t, e, n) => tr(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { Tools as Ce, Inject as R, LocaleService as ot, UniverInstanceType as k, isValidRange as Sn, IUniverInstanceService as K, ICommandService as ie, IConfigService as Cn, RANGE_TYPE as nn, Rectangle as ye, Injector as at, Disposable as z, Range as In, ObjectMatrix as nr, useDependency as E, IContextService as yn, ThemeService as rr, DataStreamTreeTokenType as rn, CustomRangeType as We, BuildTextUtils as Se, ColorKit as ir, DOCS_ZEN_EDITOR_UNIT_ID_KEY as x, DisposableCollection as sr, FOCUSING_SHEET as St, generateRandomId as or, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ie, DataValidationType as Ct, CommandType as ct, FOCUSING_FX_BAR_EDITOR as ar, IPermissionService as cr, InterceptorEffectEnum as lr, DependentOn as ur, Plugin as dr } from "@univerjs/core";
5
- import { SheetHyperLinkType as S, ERROR_RANGE as pr, HyperLinkModel as lt, RemoveHyperLinkMutation as Ne, AddHyperLinkMutation as Me, SheetsHyperLinkParserService as wt, UpdateRichHyperLinkCommand as hr, UpdateHyperLinkCommand as gr, AddRichHyperLinkCommand as mr, AddHyperLinkCommand as fr, CancelRichHyperLinkCommand as vr, CancelHyperLinkCommand as _r, UniverSheetsHyperLinkPlugin as Sr } from "@univerjs/sheets-hyper-link";
6
- import { ScrollToRangeOperation as En, COPY_TYPE as Cr, virtualizeDiscreteRanges as Et, rangeToDiscreteRange as Ir, PREDEFINED_HOOK_NAME as $e, getRepeatRange as yr, ISheetClipboardService as Er, IEditorBridgeService as re, IMarkSelectionService as Rr, SheetCanvasPopManagerService as Pr, getEditingCustomRangePosition as Lr, getCustomRangePosition as br, whenSheetEditorFocused as wr, getCurrentRangeDisable$ as kr, IAutoFillService as Or, APPLY_TYPE as ke, getAutoFillRepeatRange as Tr, SheetPermissionInterceptorBaseController as Rn, HoverManagerService as xr, HoverRenderController as Nr, SheetSkeletonManagerService as sn } from "@univerjs/sheets-ui";
7
- import { MessageType as Te, FormLayout as ve, Input as on, Select as It, Button as an, Tooltip as je } from "@univerjs/design";
8
- import { deserializeRangeWithSheet as Ve, IDefinedNamesService as Pn, serializeRangeWithSheet as Mr, serializeRangeToRefString as Ur, serializeRange as Hr } from "@univerjs/engine-formula";
9
- import { SetSelectionsOperation as Ln, SetWorksheetActiveOperation as bn, SheetsSelectionsService as kt, getSheetCommandTarget as wn, WorkbookEditablePermission as Ot, WorksheetEditPermission as Tt, WorksheetSetCellValuePermission as kn, WorksheetInsertHyperlinkPermission as xt, RangeProtectionPermissionEditPoint as Nt, WorkbookViewPermission as Dr, WorksheetViewPermission as $r, RangeProtectionPermissionViewPoint as jr, WorkbookCopyPermission as Br, WorksheetCopyPermission as Vr, ClearSelectionContentCommand as Ar, ClearSelectionAllCommand as Fr, ClearSelectionFormatCommand as Wr, SheetInterceptorService as Zr, INTERCEPTOR_POINT as Gr } from "@univerjs/sheets";
10
- import { IMessageService as On, useObservable as Kr, IZenZoneService as ut, useEvent as zr, KeyCode as Rt, MenuItemType as Tn, MetaKeys as Yr, getMenuHiddenObservable as dt, RibbonStartGroup as Xr, ContextMenuPosition as qr, ContextMenuGroup as Jr, ComponentManager as Qr, IShortcutService as ei, IMenuManagerService as ti } from "@univerjs/ui";
11
- import { DocSelectionRenderService as xn, DocBackScrollRenderController as ni, DocCanvasPopManagerService as ri, calcDocRangePositions as ii, DocEventManagerService as cn, UniverDocsUIPlugin as si } from "@univerjs/docs-ui";
12
- import { IRenderManagerService as He } from "@univerjs/engine-render";
13
- import { Subject as oi, BehaviorSubject as ai, of as xe, map as le, filter as ln, switchMap as ue, combineLatest as ci, distinctUntilChanged as li, debounceTime as Ae, Observable as ui } from "rxjs";
14
- import { DocSelectionManagerService as Ue } from "@univerjs/docs";
15
- import di, { useState as q, useMemo as un, useRef as Pt, useCallback as pi, useEffect as ne, forwardRef as he, createElement as ge } from "react";
16
- import { RangeSelector as hi } from "@univerjs/sheets-formula-ui";
17
- import { SheetDataValidationModel as dn } from "@univerjs/sheets-data-validation";
18
- function Ze(t) {
19
- return Ce.isLegalUrl(t);
1
+ var nr = Object.defineProperty;
2
+ var rr = (t, e, n) => e in t ? nr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var B = (t, e, n) => rr(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { Tools as Ie, Inject as R, LocaleService as ct, UniverInstanceType as O, isValidRange as En, IUniverInstanceService as K, ICommandService as ie, IConfigService as Rn, RANGE_TYPE as on, Rectangle as ye, Injector as lt, Disposable as Y, Range as Ln, ObjectMatrix as ir, useDependency as E, IContextService as Pn, ThemeService as or, DataStreamTreeTokenType as sn, CustomRangeType as Ge, BuildTextUtils as Se, ColorKit as sr, DOCS_ZEN_EDITOR_UNIT_ID_KEY as x, DisposableCollection as ar, FOCUSING_SHEET as It, generateRandomId as cr, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ce, DataValidationType as Ct, CommandType as ut, FOCUSING_FX_BAR_EDITOR as lr, IPermissionService as ur, InterceptorEffectEnum as dr, DependentOn as pr, Plugin as hr } from "@univerjs/core";
5
+ import { SheetHyperLinkType as S, ERROR_RANGE as gr, HyperLinkModel as dt, RemoveHyperLinkMutation as Ue, AddHyperLinkMutation as He, SheetsHyperLinkParserService as kt, UpdateRichHyperLinkCommand as mr, UpdateHyperLinkCommand as fr, AddRichHyperLinkCommand as vr, AddHyperLinkCommand as _r, CancelRichHyperLinkCommand as Sr, CancelHyperLinkCommand as Ir, UniverSheetsHyperLinkPlugin as Cr } from "@univerjs/sheets-hyper-link";
6
+ import { ScrollToRangeOperation as bn, COPY_TYPE as yr, virtualizeDiscreteRanges as Lt, rangeToDiscreteRange as Er, PREDEFINED_HOOK_NAME as Be, getRepeatRange as Rr, ISheetClipboardService as Lr, IEditorBridgeService as re, IMarkSelectionService as Pr, SheetCanvasPopManagerService as br, getEditingCustomRangePosition as wr, getCustomRangePosition as Or, whenSheetEditorFocused as kr, getCurrentRangeDisable$ as Tr, IAutoFillService as xr, APPLY_TYPE as Oe, getAutoFillRepeatRange as Nr, SheetPermissionInterceptorBaseController as wn, HoverManagerService as Mr, HoverRenderController as Ur, SheetSkeletonManagerService as an } from "@univerjs/sheets-ui";
7
+ import { MessageType as xe, FormLayout as ve, Input as cn, Select as yt, Button as ln, Tooltip as Ae } from "@univerjs/design";
8
+ import { deserializeRangeWithSheet as Fe, IDefinedNamesService as On, serializeRangeWithSheet as Hr, serializeRangeToRefString as Dr, serializeRange as $r } from "@univerjs/engine-formula";
9
+ import { SetSelectionsOperation as kn, SetWorksheetActiveOperation as Tn, SheetsSelectionsService as Tt, getSheetCommandTarget as xn, WorkbookEditablePermission as xt, WorksheetEditPermission as Nt, WorksheetSetCellValuePermission as Nn, WorksheetInsertHyperlinkPermission as Mt, RangeProtectionPermissionEditPoint as Ut, WorkbookViewPermission as jr, WorksheetViewPermission as Br, RangeProtectionPermissionViewPoint as Ar, WorkbookCopyPermission as Vr, WorksheetCopyPermission as Fr, ClearSelectionContentCommand as Wr, ClearSelectionAllCommand as Zr, ClearSelectionFormatCommand as Gr, SheetInterceptorService as Kr, INTERCEPTOR_POINT as Yr } from "@univerjs/sheets";
10
+ import { IMessageService as Mn, useObservable as zr, IZenZoneService as pt, useEvent as qr, KeyCode as Pt, MenuItemType as Un, MetaKeys as Jr, getMenuHiddenObservable as ht, RibbonStartGroup as Xr, ContextMenuPosition as Qr, ContextMenuGroup as ei, ComponentManager as ti, IShortcutService as ni, IMenuManagerService as ri } from "@univerjs/ui";
11
+ import { DocSelectionRenderService as Hn, DocBackScrollRenderController as ii, DocCanvasPopManagerService as oi, calcDocRangePositions as si, DocEventManagerService as un, UniverDocsUIPlugin as ai } from "@univerjs/docs-ui";
12
+ import { IRenderManagerService as $e } from "@univerjs/engine-render";
13
+ import { Subject as ci, BehaviorSubject as li, of as Ne, map as le, filter as dn, switchMap as ue, combineLatest as ui, distinctUntilChanged as di, debounceTime as We, Observable as pi } from "rxjs";
14
+ import { DocSelectionManagerService as De } from "@univerjs/docs";
15
+ import hi, { useState as J, useMemo as pn, useRef as bt, useCallback as gi, useEffect as ne, forwardRef as he, createElement as ge } from "react";
16
+ import { RangeSelector as mi } from "@univerjs/sheets-formula-ui";
17
+ import { SheetDataValidationModel as hn } from "@univerjs/sheets-data-validation";
18
+ function Ke(t) {
19
+ return Ie.isLegalUrl(t);
20
20
  }
21
- function gi(t) {
21
+ function fi(t) {
22
22
  return /^[a-zA-Z]+:\/\//.test(t);
23
23
  }
24
- function mi(t) {
24
+ function vi(t) {
25
25
  return /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(t);
26
26
  }
27
- function fi(t) {
28
- if (Ze(t)) {
29
- const e = gi(t) ? t : mi(t) ? `mailto://${t}` : `http://${t}`;
27
+ function _i(t) {
28
+ if (Ke(t)) {
29
+ const e = fi(t) ? t : vi(t) ? `mailto://${t}` : `http://${t}`;
30
30
  let n;
31
31
  try {
32
32
  n = new URL(e);
@@ -37,24 +37,24 @@ function fi(t) {
37
37
  }
38
38
  return t;
39
39
  }
40
- const Nn = "sheets-hyper-link-ui.config", vi = {};
41
- var _i = Object.defineProperty, Si = Object.getOwnPropertyDescriptor, Ci = (t, e, n, i) => {
42
- for (var r = i > 1 ? void 0 : i ? Si(e, n) : e, o = t.length - 1, s; o >= 0; o--)
43
- (s = t[o]) && (r = (i ? s(e, n, r) : s(r)) || r);
44
- return i && r && _i(e, n, r), r;
40
+ const Dn = "sheets-hyper-link-ui.config", Si = {};
41
+ var Ii = Object.defineProperty, Ci = Object.getOwnPropertyDescriptor, yi = (t, e, n, i) => {
42
+ for (var r = i > 1 ? void 0 : i ? Ci(e, n) : e, s = t.length - 1, o; s >= 0; s--)
43
+ (o = t[s]) && (r = (i ? o(e, n, r) : o(r)) || r);
44
+ return i && r && Ii(e, n, r), r;
45
45
  }, _e = (t, e) => (n, i) => e(n, i, t);
46
- function Ii(t, e) {
46
+ function Ei(t, e) {
47
47
  const n = e.getMergeData(), i = e.getMaxColumns() - 1, r = e.getMaxRows() - 1;
48
- if (i < t.endColumn && (t.endColumn = i), r < t.endRow && (t.endRow = r), t.rangeType === nn.COLUMN || nn.ROW)
48
+ if (i < t.endColumn && (t.endColumn = i), r < t.endRow && (t.endRow = r), t.rangeType === on.COLUMN || on.ROW)
49
49
  return t;
50
- const o = [];
51
- return n.forEach((s) => {
52
- ye.intersects(t, s) && o.push(s);
53
- }), ye.realUnion(t, ...o);
50
+ const s = [];
51
+ return n.forEach((o) => {
52
+ ye.intersects(t, o) && s.push(o);
53
+ }), ye.realUnion(t, ...s);
54
54
  }
55
55
  let pe = class {
56
- constructor(t, e, n, i, r, o) {
57
- this._univerInstanceService = t, this._commandService = e, this._definedNamesService = n, this._messageService = i, this._localeService = r, this._configService = o;
56
+ constructor(t, e, n, i, r, s) {
57
+ this._univerInstanceService = t, this._commandService = e, this._definedNamesService = n, this._messageService = i, this._localeService = r, this._configService = s;
58
58
  }
59
59
  navigate(t) {
60
60
  switch (t.type) {
@@ -66,61 +66,61 @@ let pe = class {
66
66
  }
67
67
  }
68
68
  _navigateToUniver(t) {
69
- const { gid: e, range: n, rangeid: i } = t, r = this._univerInstanceService.getCurrentUnitForType(k.UNIVER_SHEET);
69
+ const { gid: e, range: n, rangeid: i } = t, r = this._univerInstanceService.getCurrentUnitForType(O.UNIVER_SHEET);
70
70
  if (!r)
71
71
  return;
72
- const o = r.getUnitId();
72
+ const s = r.getUnitId();
73
73
  if (i) {
74
- const s = this._definedNamesService.getValueById(o, i);
75
- if (!s)
74
+ const o = this._definedNamesService.getValueById(s, i);
75
+ if (!o)
76
76
  return;
77
- const { formulaOrRefString: c } = s, u = this._definedNamesService.getWorksheetByRef(o, c);
78
- if (!u) {
77
+ const { formulaOrRefString: c } = o, l = this._definedNamesService.getWorksheetByRef(s, c);
78
+ if (!l) {
79
79
  this._messageService.show({
80
80
  content: this._localeService.t("hyperLink.message.refError"),
81
- type: Te.Error
81
+ type: xe.Error
82
82
  });
83
83
  return;
84
84
  }
85
- if (u.isSheetHidden()) {
85
+ if (l.isSheetHidden()) {
86
86
  this._messageService.show({
87
87
  content: this._localeService.t("hyperLink.message.hiddenSheet"),
88
- type: Te.Error
88
+ type: xe.Error
89
89
  });
90
90
  return;
91
91
  }
92
- this.navigateToDefineName(o, i);
92
+ this.navigateToDefineName(s, i);
93
93
  }
94
94
  if (e) {
95
95
  if (n) {
96
- const s = Ve(n);
97
- Sn(s.range) && n !== pr && this.navigateToRange(o, e, s.range);
96
+ const o = Fe(n);
97
+ En(o.range) && n !== gr && this.navigateToRange(s, e, o.range);
98
98
  return;
99
99
  }
100
- this.navigateToSheetById(o, e);
100
+ this.navigateToSheetById(s, e);
101
101
  }
102
102
  }
103
103
  async navigateToRange(t, e, n, i) {
104
104
  const r = await this.navigateToSheetById(t, e);
105
105
  if (r) {
106
- const o = Ii(n, r);
106
+ const s = Ei(n, r);
107
107
  await this._commandService.executeCommand(
108
- Ln.id,
108
+ kn.id,
109
109
  {
110
110
  unitId: t,
111
111
  subUnitId: e,
112
112
  selections: [{
113
- range: o
113
+ range: s
114
114
  }]
115
115
  }
116
- ), await this._commandService.executeCommand(En.id, {
117
- range: o,
116
+ ), await this._commandService.executeCommand(bn.id, {
117
+ range: s,
118
118
  forceTop: i
119
119
  });
120
120
  }
121
121
  }
122
122
  async navigateToSheetById(t, e) {
123
- const n = this._univerInstanceService.getUnit(t, k.UNIVER_SHEET);
123
+ const n = this._univerInstanceService.getUnit(t, O.UNIVER_SHEET);
124
124
  if (!n)
125
125
  return !1;
126
126
  const i = n.getActiveSheet();
@@ -131,10 +131,10 @@ let pe = class {
131
131
  const r = n.getSheetBySheetId(e);
132
132
  return r ? n.getHiddenWorksheets().indexOf(e) > -1 ? (this._messageService.show({
133
133
  content: this._localeService.t("hyperLink.message.hiddenSheet"),
134
- type: Te.Error
135
- }), !1) : await this._commandService.executeCommand(bn.id, { unitId: t, subUnitId: e }) ? r : !1 : (this._messageService.show({
134
+ type: xe.Error
135
+ }), !1) : await this._commandService.executeCommand(Tn.id, { unitId: t, subUnitId: e }) ? r : !1 : (this._messageService.show({
136
136
  content: this._localeService.t("hyperLink.message.noSheet"),
137
- type: Te.Error
137
+ type: xe.Error
138
138
  }), !1);
139
139
  }
140
140
  async navigateToDefineName(t, e) {
@@ -142,27 +142,27 @@ let pe = class {
142
142
  }
143
143
  async navigateToOtherWebsite(t) {
144
144
  var n;
145
- const e = this._configService.getConfig(Nn);
145
+ const e = this._configService.getConfig(Dn);
146
146
  if ((n = e == null ? void 0 : e.urlHandler) != null && n.navigateToOtherWebsite)
147
147
  return e.urlHandler.navigateToOtherWebsite(t);
148
148
  window.open(t, "_blank", "noopener noreferrer");
149
149
  }
150
150
  };
151
- pe = Ci([
151
+ pe = yi([
152
152
  _e(0, K),
153
153
  _e(1, ie),
154
- _e(2, Pn),
155
- _e(3, On),
156
- _e(4, R(ot)),
157
- _e(5, Cn)
154
+ _e(2, On),
155
+ _e(3, Mn),
156
+ _e(4, R(ct)),
157
+ _e(5, Rn)
158
158
  ], pe);
159
- const Mt = "SHEET_HYPER_LINK_UI_PLUGIN";
160
- var yi = Object.defineProperty, Ei = Object.getOwnPropertyDescriptor, Ri = (t, e, n, i) => {
161
- for (var r = i > 1 ? void 0 : i ? Ei(e, n) : e, o = t.length - 1, s; o >= 0; o--)
162
- (s = t[o]) && (r = (i ? s(e, n, r) : s(r)) || r);
163
- return i && r && yi(e, n, r), r;
164
- }, Be = (t, e) => (n, i) => e(n, i, t);
165
- let Ge = class extends z {
159
+ const Ht = "SHEET_HYPER_LINK_UI_PLUGIN";
160
+ var Ri = Object.defineProperty, Li = Object.getOwnPropertyDescriptor, Pi = (t, e, n, i) => {
161
+ for (var r = i > 1 ? void 0 : i ? Li(e, n) : e, s = t.length - 1, o; s >= 0; s--)
162
+ (o = t[s]) && (r = (i ? o(e, n, r) : o(r)) || r);
163
+ return i && r && Ri(e, n, r), r;
164
+ }, Ve = (t, e) => (n, i) => e(n, i, t);
165
+ let Ye = class extends Y {
166
166
  constructor(e, n, i, r) {
167
167
  super();
168
168
  B(this, "_plainTextFilter", /* @__PURE__ */ new Set());
@@ -183,34 +183,34 @@ let Ge = class extends z {
183
183
  }
184
184
  _initCopyPaste() {
185
185
  this._sheetClipboardService.addClipboardHook({
186
- id: Mt,
186
+ id: Ht,
187
187
  onBeforeCopy: (e, n, i) => this._collect(e, n, i),
188
188
  onPasteCells: (e, n, i, r) => {
189
- const { copyType: o = Cr.COPY, pasteType: s } = r, { range: c } = e || {}, { range: u, unitId: p, subUnitId: l } = n;
190
- return this._generateMutations(u, { copyType: o, pasteType: s, copyRange: c, unitId: p, subUnitId: l });
189
+ const { copyType: s = yr.COPY, pasteType: o } = r, { range: c } = e || {}, { range: l, unitId: p, subUnitId: u } = n;
190
+ return this._generateMutations(l, { copyType: s, pasteType: o, copyRange: c, unitId: p, subUnitId: u });
191
191
  },
192
192
  onPastePlainText: (e, n) => {
193
193
  const i = this._filterPlainText(n);
194
- if (Ze(n) && i) {
195
- const { range: r, unitId: o, subUnitId: s } = e, { ranges: [c], mapFunc: u } = Et([r]), p = [], l = [];
196
- return In.foreach(c, (g, d) => {
197
- const { row: _, col: C } = u(g, d), v = this._hyperLinkModel.getHyperLinkByLocation(o, s, _, C);
198
- v && p.push({
199
- id: Ne.id,
194
+ if (Ke(n) && i) {
195
+ const { range: r, unitId: s, subUnitId: o } = e, { ranges: [c], mapFunc: l } = Lt([r]), p = [], u = [];
196
+ return Ln.foreach(c, (g, d) => {
197
+ const { row: v, col: I } = l(g, d), _ = this._hyperLinkModel.getHyperLinkByLocation(s, o, v, I);
198
+ _ && p.push({
199
+ id: Ue.id,
200
200
  params: {
201
- unitId: o,
202
- subUnitId: s,
203
- id: v.id
201
+ unitId: s,
202
+ subUnitId: o,
203
+ id: _.id
204
204
  }
205
- }), v && l.push({
206
- id: Me.id,
205
+ }), _ && u.push({
206
+ id: He.id,
207
207
  params: {
208
- unitId: o,
209
- subUnitId: s,
210
- link: v
208
+ unitId: s,
209
+ subUnitId: o,
210
+ link: _
211
211
  }
212
212
  });
213
- }), { redos: p, undos: l };
213
+ }), { redos: p, undos: u };
214
214
  }
215
215
  return { undos: [], redos: [] };
216
216
  },
@@ -218,21 +218,21 @@ let Ge = class extends z {
218
218
  });
219
219
  }
220
220
  _collect(e, n, i) {
221
- const r = new nr();
221
+ const r = new ir();
222
222
  this._copyInfo = {
223
223
  unitId: e,
224
224
  subUnitId: n,
225
225
  matrix: r
226
226
  };
227
- const o = this._injector.invoke((u) => Ir(i, u, e, n));
228
- if (!o)
227
+ const s = this._injector.invoke((l) => Er(i, l, e, n));
228
+ if (!s)
229
229
  return;
230
- const { rows: s, cols: c } = o;
231
- s.forEach((u, p) => {
232
- c.forEach((l, g) => {
233
- var _;
234
- const d = this._hyperLinkModel.getHyperLinkByLocation(e, n, u, l);
235
- r.setValue(p, g, (_ = d == null ? void 0 : d.id) != null ? _ : "");
230
+ const { rows: o, cols: c } = s;
231
+ o.forEach((l, p) => {
232
+ c.forEach((u, g) => {
233
+ var v;
234
+ const d = this._hyperLinkModel.getHyperLinkByLocation(e, n, l, u);
235
+ r.setValue(p, g, (v = d == null ? void 0 : d.id) != null ? v : "");
236
236
  });
237
237
  });
238
238
  }
@@ -243,72 +243,72 @@ let Ge = class extends z {
243
243
  if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !n.copyRange)
244
244
  return { redos: [], undos: [] };
245
245
  if ([
246
- $e.SPECIAL_PASTE_COL_WIDTH,
247
- $e.SPECIAL_PASTE_VALUE,
248
- $e.SPECIAL_PASTE_FORMAT,
249
- $e.SPECIAL_PASTE_FORMULA
246
+ Be.SPECIAL_PASTE_COL_WIDTH,
247
+ Be.SPECIAL_PASTE_VALUE,
248
+ Be.SPECIAL_PASTE_FORMAT,
249
+ Be.SPECIAL_PASTE_FORMULA
250
250
  ].includes(
251
251
  n.pasteType
252
252
  ))
253
253
  return { redos: [], undos: [] };
254
- const { unitId: i, subUnitId: r } = this._copyInfo, o = [], s = [], { ranges: [c, u], mapFunc: p } = Et([n.copyRange, e]);
255
- return yr(c, u, !0).forEach(({ startRange: g }) => {
254
+ const { unitId: i, subUnitId: r } = this._copyInfo, s = [], o = [], { ranges: [c, l], mapFunc: p } = Lt([n.copyRange, e]);
255
+ return Rr(c, l, !0).forEach(({ startRange: g }) => {
256
256
  var d;
257
- (d = this._copyInfo) == null || d.matrix.forValue((_, C, v) => {
257
+ (d = this._copyInfo) == null || d.matrix.forValue((v, I, _) => {
258
258
  const b = ye.getPositionRange(
259
259
  {
260
- startRow: _,
261
- endRow: _,
262
- startColumn: C,
263
- endColumn: C
260
+ startRow: v,
261
+ endRow: v,
262
+ startColumn: I,
263
+ endColumn: I
264
264
  },
265
265
  g
266
- ), a = this._hyperLinkModel.getHyperLink(i, r, v), { row: w, col: M } = p(b.startRow, b.startColumn), P = this._hyperLinkModel.getHyperLinkByLocation(n.unitId, n.subUnitId, w, M), O = Ce.generateRandomId();
267
- P && o.push({
268
- id: Ne.id,
266
+ ), a = this._hyperLinkModel.getHyperLink(i, r, _), { row: w, col: M } = p(b.startRow, b.startColumn), L = this._hyperLinkModel.getHyperLinkByLocation(n.unitId, n.subUnitId, w, M), k = Ie.generateRandomId();
267
+ L && s.push({
268
+ id: Ue.id,
269
269
  params: {
270
270
  unitId: n.unitId,
271
271
  subUnitId: n.subUnitId,
272
- id: P.id
272
+ id: L.id
273
273
  }
274
- }), a && (o.push({
275
- id: Me.id,
274
+ }), a && (s.push({
275
+ id: He.id,
276
276
  params: {
277
277
  unitId: n.unitId,
278
278
  subUnitId: n.subUnitId,
279
279
  link: {
280
280
  ...a,
281
- id: O,
281
+ id: k,
282
282
  row: w,
283
283
  column: M
284
284
  }
285
285
  }
286
- }), s.push({
287
- id: Ne.id,
286
+ }), o.push({
287
+ id: Ue.id,
288
288
  params: {
289
289
  unitId: n.unitId,
290
290
  subUnitId: n.subUnitId,
291
- id: O
291
+ id: k
292
292
  }
293
- })), P && s.push({
294
- id: Me.id,
293
+ })), L && o.push({
294
+ id: He.id,
295
295
  params: {
296
296
  unitId: n.unitId,
297
297
  subUnitId: n.subUnitId,
298
- link: P
298
+ link: L
299
299
  }
300
300
  });
301
301
  });
302
- }), { redos: o, undos: s };
302
+ }), { redos: s, undos: o };
303
303
  }
304
304
  };
305
- Ge = Ri([
306
- Be(0, Er),
307
- Be(1, R(lt)),
308
- Be(2, R(at)),
309
- Be(3, R(pe))
310
- ], Ge);
311
- var f = /* @__PURE__ */ ((t) => (t.EDITING = "editing", t.VIEWING = "viewing", t.ZEN_EDITOR = "zen_mode", t))(f || {}), Mn = { exports: {} }, pt = {};
305
+ Ye = Pi([
306
+ Ve(0, Lr),
307
+ Ve(1, R(dt)),
308
+ Ve(2, R(lt)),
309
+ Ve(3, R(pe))
310
+ ], Ye);
311
+ var f = /* @__PURE__ */ ((t) => (t.EDITING = "editing", t.VIEWING = "viewing", t.ZEN_EDITOR = "zen_mode", t))(f || {}), Et = { exports: {} }, ke = {};
312
312
  /**
313
313
  * @license React
314
314
  * react-jsx-runtime.production.min.js
@@ -318,20 +318,26 @@ var f = /* @__PURE__ */ ((t) => (t.EDITING = "editing", t.VIEWING = "viewing", t
318
318
  * This source code is licensed under the MIT license found in the
319
319
  * LICENSE file in the root directory of this source tree.
320
320
  */
321
- var Pi = di, Li = Symbol.for("react.element"), bi = Symbol.for("react.fragment"), wi = Object.prototype.hasOwnProperty, ki = Pi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Oi = { key: !0, ref: !0, __self: !0, __source: !0 };
322
- function Un(t, e, n) {
323
- var i, r = {}, o = null, s = null;
324
- n !== void 0 && (o = "" + n), e.key !== void 0 && (o = "" + e.key), e.ref !== void 0 && (s = e.ref);
325
- for (i in e) wi.call(e, i) && !Oi.hasOwnProperty(i) && (r[i] = e[i]);
326
- if (t && t.defaultProps) for (i in e = t.defaultProps, e) r[i] === void 0 && (r[i] = e[i]);
327
- return { $$typeof: Li, type: t, key: o, ref: s, props: r, _owner: ki.current };
321
+ var gn;
322
+ function bi() {
323
+ if (gn) return ke;
324
+ gn = 1;
325
+ var t = hi, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, r = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
326
+ function o(c, l, p) {
327
+ var u, g = {}, d = null, v = null;
328
+ p !== void 0 && (d = "" + p), l.key !== void 0 && (d = "" + l.key), l.ref !== void 0 && (v = l.ref);
329
+ for (u in l) i.call(l, u) && !s.hasOwnProperty(u) && (g[u] = l[u]);
330
+ if (c && c.defaultProps) for (u in l = c.defaultProps, l) g[u] === void 0 && (g[u] = l[u]);
331
+ return { $$typeof: e, type: c, key: d, ref: v, props: g, _owner: r.current };
332
+ }
333
+ return ke.Fragment = n, ke.jsx = o, ke.jsxs = o, ke;
328
334
  }
329
- pt.Fragment = bi;
330
- pt.jsx = Un;
331
- pt.jsxs = Un;
332
- Mn.exports = pt;
333
- var m = Mn.exports;
334
- class Hn extends z {
335
+ var mn;
336
+ function wi() {
337
+ return mn || (mn = 1, Et.exports = bi()), Et.exports;
338
+ }
339
+ var m = wi();
340
+ class $n extends Y {
335
341
  constructor() {
336
342
  super(...arguments);
337
343
  B(this, "_customHyperLinks", /* @__PURE__ */ new Map());
@@ -359,58 +365,58 @@ class Hn extends z {
359
365
  super.dispose(), this._customHyperLinks.clear();
360
366
  }
361
367
  }
362
- const Ti = "univer-cell-link-edit", xi = "univer-cell-link-edit-buttons", pn = {
363
- cellLinkEdit: Ti,
364
- cellLinkEditButtons: xi
365
- }, Ke = () => {
366
- var Vt;
367
- const [t, e] = q(""), [n, i] = q(!1), [r, o] = q(""), [s, c] = q(!0), [u, p] = q(S.URL), [l, g] = q(""), d = E(ot), _ = E(Pn), C = E(re), v = E(K), b = E(G), a = Kr(b.currentEditing$), w = E(wt), M = E(pe), P = E(ie), O = E(Hn), J = un(() => O.getOptions(), [O]), D = E(ut), Y = E(He), Ee = E(Rr), De = E(Ue), se = E(yn), Re = E(rr), Pe = E(Ue), Le = Pt({}), oe = un(() => {
368
- if (!O.isBuiltInLinkType(u))
369
- return O.getCustomHyperLink(u);
370
- }, [O, u]), [j, zn] = q(!1), [be, ht] = q(!1), H = Pt(!1), V = v.getCurrentUnitForType(k.UNIVER_SHEET), Yn = (V == null ? void 0 : V.getActiveSheet().getSheetId()) || "", Q = pi((h) => {
371
- o(h.replaceAll(rn.CUSTOM_RANGE_START, "").replaceAll(rn.CUSTOM_RANGE_END, ""));
372
- }, [o]);
368
+ const Oi = "univer-cell-link-edit", ki = "univer-cell-link-edit-buttons", fn = {
369
+ cellLinkEdit: Oi,
370
+ cellLinkEditButtons: ki
371
+ }, ze = () => {
372
+ var Ft;
373
+ const [t, e] = J(""), [n, i] = J(!1), [r, s] = J(""), [o, c] = J(!0), [l, p] = J(S.URL), [u, g] = J(""), d = E(ct), v = E(On), I = E(re), _ = E(K), b = E(G), a = zr(b.currentEditing$), w = E(kt), M = E(pe), L = E(ie), k = E($n), X = pn(() => k.getOptions(), [k]), D = E(pt), z = E($e), Ee = E(Pr), je = E(De), oe = E(Pn), Re = E(or), Le = E(De), Pe = bt({}), se = pn(() => {
374
+ if (!k.isBuiltInLinkType(l))
375
+ return k.getCustomHyperLink(l);
376
+ }, [k, l]), [j, qn] = J(!1), [be, gt] = J(!1), H = bt(!1), A = _.getCurrentUnitForType(O.UNIVER_SHEET), Jn = (A == null ? void 0 : A.getActiveSheet().getSheetId()) || "", Q = gi((h) => {
377
+ s(h.replaceAll(sn.CUSTOM_RANGE_START, "").replaceAll(sn.CUSTOM_RANGE_END, ""));
378
+ }, [s]);
373
379
  ne(() => {
374
- var h, y, I, L, N, A, At, Ft, Wt, Zt, Gt, Kt, zt, Yt, Xt, qt, Jt;
380
+ var h, y, C, P, N, V, Wt, Zt, Gt, Kt, Yt, zt, qt, Jt, Xt, Qt, en;
375
381
  if ((a == null ? void 0 : a.row) !== void 0 && a.col !== void 0) {
376
- const { customRange: ae, row: vt, col: _t } = a;
377
- let { label: X } = a;
378
- typeof X == "number" && (X = `${X}`);
382
+ const { customRange: ae, row: _t, col: St } = a;
383
+ let { label: q } = a;
384
+ typeof q == "number" && (q = `${q}`);
379
385
  let F;
380
386
  if (ae)
381
387
  F = {
382
388
  id: (h = ae == null ? void 0 : ae.rangeId) != null ? h : "",
383
- display: X != null ? X : "",
384
- payload: (I = (y = ae == null ? void 0 : ae.properties) == null ? void 0 : y.url) != null ? I : "",
385
- row: vt,
386
- column: _t
389
+ display: q != null ? q : "",
390
+ payload: (C = (y = ae == null ? void 0 : ae.properties) == null ? void 0 : y.url) != null ? C : "",
391
+ row: _t,
392
+ column: St
387
393
  };
388
394
  else if (a.type === f.VIEWING) {
389
- const T = v.getUnit(a.unitId), te = T == null ? void 0 : T.getSheetBySheetId(a.subUnitId), U = te == null ? void 0 : te.getCellRaw(a.row, a.col), fe = (A = (N = (L = U == null ? void 0 : U.p) == null ? void 0 : L.body) == null ? void 0 : N.customRanges) == null ? void 0 : A.find((en) => {
390
- var tn;
391
- return en.rangeType === We.HYPERLINK && ((tn = en.properties) == null ? void 0 : tn.url);
395
+ const T = _.getUnit(a.unitId), te = T == null ? void 0 : T.getSheetBySheetId(a.subUnitId), U = te == null ? void 0 : te.getCellRaw(a.row, a.col), fe = (V = (N = (P = U == null ? void 0 : U.p) == null ? void 0 : P.body) == null ? void 0 : N.customRanges) == null ? void 0 : V.find((nn) => {
396
+ var rn;
397
+ return nn.rangeType === Ge.HYPERLINK && ((rn = nn.properties) == null ? void 0 : rn.url);
392
398
  }), we = U == null ? void 0 : U.v;
393
- U && (!Se.transform.isEmptyDocument((Ft = (At = U.p) == null ? void 0 : At.body) == null ? void 0 : Ft.dataStream) || Ce.isDefine(we)) && c(!1), F = {
399
+ U && (!Se.transform.isEmptyDocument((Zt = (Wt = U.p) == null ? void 0 : Wt.body) == null ? void 0 : Zt.dataStream) || Ie.isDefine(we)) && c(!1), F = {
394
400
  id: "",
395
401
  display: "",
396
- payload: (Zt = (Wt = fe == null ? void 0 : fe.properties) == null ? void 0 : Wt.url) != null ? Zt : "",
397
- row: vt,
398
- column: _t
402
+ payload: (Kt = (Gt = fe == null ? void 0 : fe.properties) == null ? void 0 : Gt.url) != null ? Kt : "",
403
+ row: _t,
404
+ column: St
399
405
  };
400
406
  } else {
401
- const T = v.getCurrentUnitForType(k.UNIVER_DOC), te = De.getActiveTextRange(), U = T == null ? void 0 : T.getBody(), fe = te && U ? te : null, we = fe && ((Kt = Se.customRange.getCustomRangesInterestsWithSelection(fe, (Gt = U == null ? void 0 : U.customRanges) != null ? Gt : [])) == null ? void 0 : Kt[0]);
407
+ const T = _.getCurrentUnitForType(O.UNIVER_DOC), te = je.getActiveTextRange(), U = T == null ? void 0 : T.getBody(), fe = te && U ? te : null, we = fe && ((zt = Se.customRange.getCustomRangesInterestsWithSelection(fe, (Yt = U == null ? void 0 : U.customRanges) != null ? Yt : [])) == null ? void 0 : zt[0]);
402
408
  c(!1), F = {
403
409
  id: "",
404
- display: X != null ? X : "",
405
- payload: (Yt = (zt = we == null ? void 0 : we.properties) == null ? void 0 : zt.url) != null ? Yt : "",
406
- row: vt,
407
- column: _t
410
+ display: q != null ? q : "",
411
+ payload: (Jt = (qt = we == null ? void 0 : we.properties) == null ? void 0 : qt.url) != null ? Jt : "",
412
+ row: _t,
413
+ column: St
408
414
  };
409
415
  }
410
416
  e(F.id);
411
- const Qt = O.findCustomHyperLink(F);
412
- if (Qt) {
413
- const T = Qt.convert(F);
417
+ const tn = k.findCustomHyperLink(F);
418
+ if (tn) {
419
+ const T = tn.convert(F);
414
420
  p(T.type), g(T.payload), Q(T.display);
415
421
  return;
416
422
  }
@@ -422,7 +428,7 @@ const Ti = "univer-cell-link-edit", xi = "univer-cell-link-edit-buttons", pn = {
422
428
  break;
423
429
  }
424
430
  case S.RANGE: {
425
- const T = ee.searchObj, te = T.gid && (Jt = (qt = (Xt = v.getUnit(a.unitId)) == null ? void 0 : Xt.getSheetBySheetId(T.gid)) == null ? void 0 : qt.getName()) != null ? Jt : "", U = Mr(te, Ve(T.range).range);
431
+ const T = ee.searchObj, te = T.gid && (en = (Qt = (Xt = _.getUnit(a.unitId)) == null ? void 0 : Xt.getSheetBySheetId(T.gid)) == null ? void 0 : Qt.getName()) != null ? en : "", U = Hr(te, Fe(T.range).range);
426
432
  g(U), U === F.display && (H.current = !0);
427
433
  break;
428
434
  }
@@ -441,13 +447,13 @@ const Ti = "univer-cell-link-edit", xi = "univer-cell-link-edit-buttons", pn = {
441
447
  break;
442
448
  }
443
449
  }
444
- }, [a, M, O, De, v]), ne(() => {
450
+ }, [a, M, k, je, _]), ne(() => {
445
451
  let h = null;
446
- if (a && !a.customRangeId && a.type === f.VIEWING && Ce.isDefine(a.row) && Ce.isDefine(a.col)) {
447
- const y = v.getUnit(a.unitId, k.UNIVER_SHEET), I = y == null ? void 0 : y.getSheetBySheetId(a.subUnitId), L = I == null ? void 0 : I.getMergedCell(a.row, a.col), N = new ir(Re.getCurrentTheme().hyacinth500).toRgb();
452
+ if (a && !a.customRangeId && a.type === f.VIEWING && Ie.isDefine(a.row) && Ie.isDefine(a.col)) {
453
+ const y = _.getUnit(a.unitId, O.UNIVER_SHEET), C = y == null ? void 0 : y.getSheetBySheetId(a.subUnitId), P = C == null ? void 0 : C.getMergedCell(a.row, a.col), N = new sr(Re.getCurrentTheme().hyacinth500).toRgb();
448
454
  h = Ee.addShape(
449
455
  {
450
- range: L != null ? L : {
456
+ range: P != null ? P : {
451
457
  startColumn: a.col,
452
458
  endColumn: a.col,
453
459
  startRow: a.row,
@@ -469,29 +475,29 @@ const Ti = "univer-cell-link-edit", xi = "univer-cell-link-edit-buttons", pn = {
469
475
  return () => {
470
476
  h && Ee.removeShape(h);
471
477
  };
472
- }, [a, Ee, Re, v]), ne(() => {
473
- ht(u === S.RANGE);
474
- }, [u]), ne(() => {
475
- const h = (a == null ? void 0 : a.type) === f.ZEN_EDITOR ? Y.getRenderById(x) : Y.getRenderById(C.getCurrentEditorId()), y = new sr();
478
+ }, [a, Ee, Re, _]), ne(() => {
479
+ gt(l === S.RANGE);
480
+ }, [l]), ne(() => {
481
+ const h = (a == null ? void 0 : a.type) === f.ZEN_EDITOR ? z.getRenderById(x) : z.getRenderById(I.getCurrentEditorId()), y = new ar();
476
482
  if (h) {
477
- const I = h.with(xn);
478
- I.setReserveRangesStatus(!0), y.add(() => {
479
- I.setReserveRangesStatus(!1);
483
+ const C = h.with(Hn);
484
+ C.setReserveRangesStatus(!0), y.add(() => {
485
+ C.setReserveRangesStatus(!1);
480
486
  });
481
487
  }
482
488
  return () => {
483
- C.disableForceKeepVisible(), y.dispose();
489
+ I.disableForceKeepVisible(), y.dispose();
484
490
  };
485
- }, [a == null ? void 0 : a.type, C, Y]), ne(() => (b.setIsKeepVisible(be), () => {
491
+ }, [a == null ? void 0 : a.type, I, z]), ne(() => (b.setIsKeepVisible(be), () => {
486
492
  b.setIsKeepVisible(!1);
487
493
  }), [be, b]), ne(() => () => {
488
- D.temporaryHidden && (D.show(), se.setContextValue(St, !1));
489
- }, [se, D]), ne(() => {
494
+ D.temporaryHidden && (D.show(), oe.setContextValue(It, !1));
495
+ }, [oe, D]), ne(() => {
490
496
  if (be)
491
- return C.enableForceKeepVisible(), () => {
492
- C.disableForceKeepVisible();
497
+ return I.enableForceKeepVisible(), () => {
498
+ I.disableForceKeepVisible();
493
499
  };
494
- }, [be, C]);
500
+ }, [be, I]);
495
501
  const Xn = [
496
502
  {
497
503
  label: d.t("hyperLink.form.link"),
@@ -509,72 +515,72 @@ const Ti = "univer-cell-link-edit", xi = "univer-cell-link-edit-buttons", pn = {
509
515
  label: d.t("hyperLink.form.definedName"),
510
516
  value: S.DEFINE_NAME
511
517
  },
512
- ...J
518
+ ...X
513
519
  ];
514
- if (!V)
520
+ if (!A)
515
521
  return;
516
- const qn = V.getHiddenWorksheets(), gt = V.getSheets().map((h) => ({ label: h.getName(), value: h.getSheetId() })).filter((h) => qn.indexOf(h.value) === -1), mt = Object.values((Vt = _.getDefinedNameMap(V.getUnitId())) != null ? Vt : {}).map((h) => ({
522
+ const Qn = A.getHiddenWorksheets(), mt = A.getSheets().map((h) => ({ label: h.getName(), value: h.getSheetId() })).filter((h) => Qn.indexOf(h.value) === -1), ft = Object.values((Ft = v.getDefinedNameMap(A.getUnitId())) != null ? Ft : {}).map((h) => ({
517
523
  label: h.name,
518
524
  value: h.id
519
- })), Bt = (h, y) => {
525
+ })), Vt = (h, y) => {
520
526
  if (h === S.URL)
521
- return fi(y);
527
+ return _i(y);
522
528
  if (h === S.RANGE) {
523
- const I = Ve(y), L = V.getSheetBySheetName(I.sheetName);
524
- if (L)
525
- return `#gid=${L.getSheetId()}&range=${Hr(I.range)}`;
529
+ const C = Fe(y), P = A.getSheetBySheetName(C.sheetName);
530
+ if (P)
531
+ return `#gid=${P.getSheetId()}&range=${$r(C.range)}`;
526
532
  }
527
533
  return `#${h}=${y}`;
528
- }, Jn = zr((h) => {
534
+ }, er = qr((h) => {
529
535
  var N;
530
- const I = h.split(",").map(Ve)[0];
531
- if (!I || !Sn(I.range))
536
+ const C = h.split(",").map(Fe)[0];
537
+ if (!C || !En(C.range))
532
538
  return;
533
- I.sheetName || (I.sheetName = ((N = V.getActiveSheet()) == null ? void 0 : N.getName()) || "");
534
- const L = Ur(I);
535
- g(L), L && (H.current || !r) && (Q(L), H.current = !0);
536
- }), ft = async () => {
537
- if (s && !r || !l || u === S.URL && !Ze(l)) {
538
- zn(!0);
539
+ C.sheetName || (C.sheetName = ((N = A.getActiveSheet()) == null ? void 0 : N.getName()) || "");
540
+ const P = Dr(C);
541
+ g(P), P && (H.current || !r) && (Q(P), H.current = !0);
542
+ }), vt = async () => {
543
+ if (o && !r || !u || l === S.URL && !Ke(u)) {
544
+ qn(!0);
539
545
  return;
540
546
  }
541
547
  if (a)
542
548
  if (t) {
543
- const h = a.type === f.ZEN_EDITOR || a.type === f.EDITING ? hr.id : gr.id;
544
- await P.executeCommand(h, {
549
+ const h = a.type === f.ZEN_EDITOR || a.type === f.EDITING ? mr.id : fr.id;
550
+ await L.executeCommand(h, {
545
551
  id: t,
546
552
  unitId: a.unitId,
547
553
  subUnitId: a.subUnitId,
548
554
  payload: {
549
- display: s ? r : "",
550
- payload: Bt(u, l)
555
+ display: o ? r : "",
556
+ payload: Vt(l, u)
551
557
  },
552
558
  row: a.row,
553
559
  column: a.col,
554
- documentId: a.type === f.ZEN_EDITOR ? x : C.getCurrentEditorId()
560
+ documentId: a.type === f.ZEN_EDITOR ? x : I.getCurrentEditorId()
555
561
  });
556
562
  } else {
557
- const h = a.type === f.ZEN_EDITOR || a.type === f.EDITING ? mr.id : fr.id;
558
- await P.executeCommand(h, {
563
+ const h = a.type === f.ZEN_EDITOR || a.type === f.EDITING ? vr.id : _r.id;
564
+ await L.executeCommand(h, {
559
565
  unitId: a.unitId,
560
566
  subUnitId: a.subUnitId,
561
567
  link: {
562
- id: or(),
568
+ id: cr(),
563
569
  row: a.row,
564
570
  column: a.col,
565
- payload: Bt(u, l),
566
- display: s ? r : ""
571
+ payload: Vt(l, u),
572
+ display: o ? r : ""
567
573
  },
568
- documentId: a.type === f.ZEN_EDITOR ? x : C.getCurrentEditorId()
574
+ documentId: a.type === f.ZEN_EDITOR ? x : I.getCurrentEditorId()
569
575
  });
570
576
  }
571
577
  if ((a == null ? void 0 : a.type) === f.VIEWING) {
572
- await P.executeCommand(bn.id, {
578
+ await L.executeCommand(Tn.id, {
573
579
  unitId: a.unitId,
574
580
  subUnitId: a.subUnitId
575
581
  });
576
582
  const h = 1;
577
- await P.executeCommand(En.id, {
583
+ await L.executeCommand(bn.id, {
578
584
  range: {
579
585
  startRow: Math.max(a.row - h, 0),
580
586
  endRow: a.row + h,
@@ -583,22 +589,22 @@ const Ti = "univer-cell-link-edit", xi = "univer-cell-link-edit-buttons", pn = {
583
589
  }
584
590
  });
585
591
  }
586
- P.executeCommand(Ye.id);
587
- }, Qn = (h) => {
588
- var I;
589
- if (u !== S.RANGE)
592
+ L.executeCommand(Je.id);
593
+ }, tr = (h) => {
594
+ var C;
595
+ if (l !== S.RANGE)
590
596
  return;
591
- const y = (I = Le.current) == null ? void 0 : I.handleOutClick;
592
- y && y(h, () => ht(!1));
597
+ const y = (C = Pe.current) == null ? void 0 : C.handleOutClick;
598
+ y && y(h, () => gt(!1));
593
599
  };
594
- return a ? /* @__PURE__ */ m.jsxs("div", { className: pn.cellLinkEdit, style: { display: n ? "none" : "block" }, onClick: Qn, children: [
595
- s ? /* @__PURE__ */ m.jsx(
600
+ return a ? /* @__PURE__ */ m.jsxs("div", { className: fn.cellLinkEdit, style: { display: n ? "none" : "block" }, onClick: tr, children: [
601
+ o ? /* @__PURE__ */ m.jsx(
596
602
  ve,
597
603
  {
598
604
  label: d.t("hyperLink.form.label"),
599
605
  error: j && !r ? d.t("hyperLink.form.inputError") : "",
600
606
  children: /* @__PURE__ */ m.jsx(
601
- on,
607
+ cn,
602
608
  {
603
609
  value: r,
604
610
  onChange: (h) => {
@@ -607,104 +613,104 @@ const Ti = "univer-cell-link-edit", xi = "univer-cell-link-edit-buttons", pn = {
607
613
  placeholder: d.t("hyperLink.form.labelPlaceholder"),
608
614
  autoFocus: !0,
609
615
  onKeyDown: (h) => {
610
- h.keyCode === Rt.ENTER && ft();
616
+ h.keyCode === Pt.ENTER && vt();
611
617
  }
612
618
  }
613
619
  )
614
620
  }
615
621
  ) : null,
616
622
  /* @__PURE__ */ m.jsx(ve, { label: d.t("hyperLink.form.type"), children: /* @__PURE__ */ m.jsx(
617
- It,
623
+ yt,
618
624
  {
619
625
  options: Xn,
620
- value: u,
626
+ value: l,
621
627
  onChange: (h) => {
622
628
  p(h), g("");
623
629
  }
624
630
  }
625
631
  ) }),
626
- u === S.URL && /* @__PURE__ */ m.jsx(
632
+ l === S.URL && /* @__PURE__ */ m.jsx(
627
633
  ve,
628
634
  {
629
- error: j ? l ? Ze(l) ? "" : d.t("hyperLink.form.linkError") : d.t("hyperLink.form.inputError") : "",
635
+ error: j ? u ? Ke(u) ? "" : d.t("hyperLink.form.linkError") : d.t("hyperLink.form.inputError") : "",
630
636
  children: /* @__PURE__ */ m.jsx(
631
- on,
637
+ cn,
632
638
  {
633
- value: l,
639
+ value: u,
634
640
  onChange: (h) => {
635
- g(h), h && (H.current || !r || r === l) && (Q(h), H.current = !0);
641
+ g(h), h && (H.current || !r || r === u) && (Q(h), H.current = !0);
636
642
  },
637
643
  placeholder: d.t("hyperLink.form.linkPlaceholder"),
638
644
  autoFocus: !0,
639
645
  onKeyDown: (h) => {
640
- h.keyCode === Rt.ENTER && ft();
646
+ h.keyCode === Pt.ENTER && vt();
641
647
  }
642
648
  }
643
649
  )
644
650
  }
645
651
  ),
646
- u === S.RANGE && /* @__PURE__ */ m.jsx(ve, { error: j && !l ? d.t("hyperLink.form.inputError") : "", children: /* @__PURE__ */ m.jsx(
647
- hi,
652
+ l === S.RANGE && /* @__PURE__ */ m.jsx(ve, { error: j && !u ? d.t("hyperLink.form.inputError") : "", children: /* @__PURE__ */ m.jsx(
653
+ mi,
648
654
  {
649
- unitId: V.getUnitId(),
650
- subUnitId: Yn,
655
+ unitId: A.getUnitId(),
656
+ subUnitId: Jn,
651
657
  isOnlyOneRange: !0,
652
658
  isSupportAcrossSheet: !0,
653
- initValue: l,
654
- onChange: Jn,
659
+ initValue: u,
660
+ onChange: er,
655
661
  isFocus: be,
656
- onFocus: () => ht(!0),
657
- actions: Le.current,
662
+ onFocus: () => gt(!0),
663
+ actions: Pe.current,
658
664
  onRangeSelectorDialogVisibleChange: async (h) => {
659
- var y, I;
665
+ var y, C;
660
666
  if (h)
661
- a.type === f.ZEN_EDITOR && (D.hide(), se.setContextValue(St, !0)), a.type !== f.VIEWING && C.enableForceKeepVisible(), i(!0);
667
+ a.type === f.ZEN_EDITOR && (D.hide(), oe.setContextValue(It, !0)), a.type !== f.VIEWING && I.enableForceKeepVisible(), i(!0);
662
668
  else {
663
669
  if (await M.navigateToRange(a.unitId, a.subUnitId, { startRow: a.row, endRow: a.row, startColumn: a.col, endColumn: a.col }, !0), a.type === f.ZEN_EDITOR) {
664
- await P.executeCommand(Ln.id, {
670
+ await L.executeCommand(kn.id, {
665
671
  unitId: a.unitId,
666
672
  subUnitId: a.subUnitId,
667
673
  selections: [{ range: { startRow: a.row, endRow: a.row, startColumn: a.col, endColumn: a.col } }]
668
- }), D.show(), se.setContextValue(St, !1);
669
- const L = (y = Y.getRenderById(x)) == null ? void 0 : y.with(ni), N = (I = Pe.getTextRanges({ unitId: x, subUnitId: x })) == null ? void 0 : I[0];
670
- L && N && (L.scrollToRange(N), Pe.refreshSelection({ unitId: x, subUnitId: x }));
674
+ }), D.show(), oe.setContextValue(It, !1);
675
+ const P = (y = z.getRenderById(x)) == null ? void 0 : y.with(ii), N = (C = Le.getTextRanges({ unitId: x, subUnitId: x })) == null ? void 0 : C[0];
676
+ P && N && (P.scrollToRange(N), Le.refreshSelection({ unitId: x, subUnitId: x }));
671
677
  }
672
- C.disableForceKeepVisible(), i(!1);
678
+ I.disableForceKeepVisible(), i(!1);
673
679
  }
674
680
  }
675
681
  }
676
682
  ) }),
677
- u === S.SHEET && /* @__PURE__ */ m.jsx(ve, { error: j && !l ? d.t("hyperLink.form.selectError") : "", children: /* @__PURE__ */ m.jsx(
678
- It,
683
+ l === S.SHEET && /* @__PURE__ */ m.jsx(ve, { error: j && !u ? d.t("hyperLink.form.selectError") : "", children: /* @__PURE__ */ m.jsx(
684
+ yt,
679
685
  {
680
- options: gt,
681
- value: l,
686
+ options: mt,
687
+ value: u,
682
688
  onChange: (h) => {
683
- var L, N;
689
+ var P, N;
684
690
  g(h);
685
- const y = (L = gt.find((A) => A.value === h)) == null ? void 0 : L.label, I = (N = gt.find((A) => A.value === l)) == null ? void 0 : N.label;
686
- y && (H.current || !r || r === I) && (Q(y), H.current = !0);
691
+ const y = (P = mt.find((V) => V.value === h)) == null ? void 0 : P.label, C = (N = mt.find((V) => V.value === u)) == null ? void 0 : N.label;
692
+ y && (H.current || !r || r === C) && (Q(y), H.current = !0);
687
693
  }
688
694
  }
689
695
  ) }),
690
- u === S.DEFINE_NAME && /* @__PURE__ */ m.jsx(ve, { error: j && !l ? d.t("hyperLink.form.selectError") : "", children: /* @__PURE__ */ m.jsx(
691
- It,
696
+ l === S.DEFINE_NAME && /* @__PURE__ */ m.jsx(ve, { error: j && !u ? d.t("hyperLink.form.selectError") : "", children: /* @__PURE__ */ m.jsx(
697
+ yt,
692
698
  {
693
- options: mt,
694
- value: l,
699
+ options: ft,
700
+ value: u,
695
701
  onChange: (h) => {
696
- var L, N;
702
+ var P, N;
697
703
  g(h);
698
- const y = (L = mt.find((A) => A.value === h)) == null ? void 0 : L.label, I = (N = mt.find((A) => A.value === l)) == null ? void 0 : N.label;
699
- y && (H.current || !r || r === I) && (Q(y), H.current = !0);
704
+ const y = (P = ft.find((V) => V.value === h)) == null ? void 0 : P.label, C = (N = ft.find((V) => V.value === u)) == null ? void 0 : N.label;
705
+ y && (H.current || !r || r === C) && (Q(y), H.current = !0);
700
706
  }
701
707
  }
702
708
  ) }),
703
- (oe == null ? void 0 : oe.Form) && /* @__PURE__ */ m.jsx(
704
- oe.Form,
709
+ (se == null ? void 0 : se.Form) && /* @__PURE__ */ m.jsx(
710
+ se.Form,
705
711
  {
706
712
  linkId: t,
707
- payload: l,
713
+ payload: u,
708
714
  display: r,
709
715
  showError: j,
710
716
  setByPayload: H,
@@ -714,23 +720,23 @@ const Ti = "univer-cell-link-edit", xi = "univer-cell-link-edit-buttons", pn = {
714
720
  setPayload: g
715
721
  }
716
722
  ),
717
- /* @__PURE__ */ m.jsxs("div", { className: pn.cellLinkEditButtons, children: [
723
+ /* @__PURE__ */ m.jsxs("div", { className: fn.cellLinkEditButtons, children: [
718
724
  /* @__PURE__ */ m.jsx(
719
- an,
725
+ ln,
720
726
  {
721
727
  onClick: () => {
722
- a && M.navigateToRange(a.unitId, a.subUnitId, { startRow: a.row, endRow: a.row, startColumn: a.col, endColumn: a.col }, !0), P.executeCommand(Ye.id);
728
+ a && M.navigateToRange(a.unitId, a.subUnitId, { startRow: a.row, endRow: a.row, startColumn: a.col, endColumn: a.col }, !0), L.executeCommand(Je.id);
723
729
  },
724
730
  children: d.t("hyperLink.form.cancel")
725
731
  }
726
732
  ),
727
733
  /* @__PURE__ */ m.jsx(
728
- an,
734
+ ln,
729
735
  {
730
736
  type: "primary",
731
737
  style: { marginLeft: 8 },
732
738
  onClick: async () => {
733
- ft();
739
+ vt();
734
740
  },
735
741
  children: d.t("hyperLink.form.ok")
736
742
  }
@@ -738,7 +744,7 @@ const Ti = "univer-cell-link-edit", xi = "univer-cell-link-edit-buttons", pn = {
738
744
  ] })
739
745
  ] }) : null;
740
746
  };
741
- Ke.componentKey = "univer.sheet.cell-link-edit";
747
+ ze.componentKey = "univer.sheet.cell-link-edit";
742
748
  var $ = function() {
743
749
  return $ = Object.assign || function(t) {
744
750
  for (var e, n = 1, i = arguments.length; n < i; n++) {
@@ -747,7 +753,7 @@ var $ = function() {
747
753
  }
748
754
  return t;
749
755
  }, $.apply(this, arguments);
750
- }, Ni = function(t, e) {
756
+ }, Ti = function(t, e) {
751
757
  var n = {};
752
758
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
753
759
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
@@ -755,166 +761,166 @@ var $ = function() {
755
761
  e.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[r]) && (n[i[r]] = t[i[r]]);
756
762
  return n;
757
763
  }, me = he(function(t, e) {
758
- var n = t.icon, i = t.id, r = t.className, o = t.extend, s = Ni(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(i, " ").concat(r || "").trim(), u = Pt("_".concat(Hi()));
759
- return Dn(n, "".concat(i), { defIds: n.defIds, idSuffix: u.current }, $({ ref: e, className: c }, s), o);
764
+ var n = t.icon, i = t.id, r = t.className, s = t.extend, o = Ti(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(i, " ").concat(r || "").trim(), l = bt("_".concat(Mi()));
765
+ return jn(n, "".concat(i), { defIds: n.defIds, idSuffix: l.current }, $({ ref: e, className: c }, o), s);
760
766
  });
761
- function Dn(t, e, n, i, r) {
762
- return ge(t.tag, $($({ key: e }, Mi(t, n, r)), i), (Ui(t, n).children || []).map(function(o, s) {
763
- return Dn(o, "".concat(e, "-").concat(t.tag, "-").concat(s), n, void 0, r);
767
+ function jn(t, e, n, i, r) {
768
+ return ge(t.tag, $($({ key: e }, xi(t, n, r)), i), (Ni(t, n).children || []).map(function(s, o) {
769
+ return jn(s, "".concat(e, "-").concat(t.tag, "-").concat(o), n, void 0, r);
764
770
  }));
765
771
  }
766
- function Mi(t, e, n) {
772
+ function xi(t, e, n) {
767
773
  var i = $({}, t.attrs);
768
774
  n != null && n.colorChannel1 && i.fill === "colorChannel1" && (i.fill = n.colorChannel1);
769
775
  var r = e.defIds;
770
- return !r || r.length === 0 || (t.tag === "use" && i["xlink:href"] && (i["xlink:href"] = i["xlink:href"] + e.idSuffix), Object.entries(i).forEach(function(o) {
771
- var s = o[0], c = o[1];
772
- typeof c == "string" && (i[s] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
776
+ return !r || r.length === 0 || (t.tag === "use" && i["xlink:href"] && (i["xlink:href"] = i["xlink:href"] + e.idSuffix), Object.entries(i).forEach(function(s) {
777
+ var o = s[0], c = s[1];
778
+ typeof c == "string" && (i[o] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
773
779
  })), i;
774
780
  }
775
- function Ui(t, e) {
781
+ function Ni(t, e) {
776
782
  var n, i = e.defIds;
777
783
  return !i || i.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? $($({}, t), { children: t.children.map(function(r) {
778
784
  return typeof r.attrs.id == "string" && i && i.indexOf(r.attrs.id) > -1 ? $($({}, r), { attrs: $($({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
779
785
  }) }) : t;
780
786
  }
781
- function Hi() {
787
+ function Mi() {
782
788
  return Math.random().toString(36).substring(2, 8);
783
789
  }
784
790
  me.displayName = "UniverIcon";
785
- var Di = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.9999 1.12915C8.03875 1.12915 8.07673 1.13284 8.11352 1.13989H12.2599C13.6958 1.13989 14.8599 2.30395 14.8599 3.73989V7.88619C14.867 7.92301 14.8707 7.96102 14.8707 7.9999C14.8707 8.03878 14.867 8.0768 14.8599 8.11362V12.2599C14.8599 13.6958 13.6958 14.8599 12.2599 14.8599H8.11362C8.0768 14.867 8.03878 14.8707 7.9999 14.8707C7.96102 14.8707 7.92301 14.867 7.88619 14.8599H3.73989C2.30396 14.8599 1.13989 13.6958 1.13989 12.2599V8.11352C1.13284 8.07673 1.12915 8.03875 1.12915 7.9999C1.12915 7.96106 1.13284 7.92308 1.13989 7.88629V3.73989C1.13989 2.30396 2.30395 1.13989 3.73989 1.13989H7.88629C7.92308 1.13284 7.96106 1.12915 7.9999 1.12915ZM2.33989 8.5999V12.2599C2.33989 13.0331 2.9667 13.6599 3.73989 13.6599H7.3999V8.5999H2.33989ZM7.3999 7.3999H2.33989V3.73989C2.33989 2.9667 2.96669 2.33989 3.73989 2.33989H7.3999V7.3999ZM8.5999 8.5999V13.6599H12.2599C13.0331 13.6599 13.6599 13.0331 13.6599 12.2599V8.5999H8.5999ZM13.6599 7.3999H8.5999V2.33989H12.2599C13.0331 2.33989 13.6599 2.96669 13.6599 3.73989V7.3999Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Fe = he(function(t, e) {
791
+ var Ui = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.9999 1.12915C8.03875 1.12915 8.07673 1.13284 8.11352 1.13989H12.2599C13.6958 1.13989 14.8599 2.30395 14.8599 3.73989V7.88619C14.867 7.92301 14.8707 7.96102 14.8707 7.9999C14.8707 8.03878 14.867 8.0768 14.8599 8.11362V12.2599C14.8599 13.6958 13.6958 14.8599 12.2599 14.8599H8.11362C8.0768 14.867 8.03878 14.8707 7.9999 14.8707C7.96102 14.8707 7.92301 14.867 7.88619 14.8599H3.73989C2.30396 14.8599 1.13989 13.6958 1.13989 12.2599V8.11352C1.13284 8.07673 1.12915 8.03875 1.12915 7.9999C1.12915 7.96106 1.13284 7.92308 1.13989 7.88629V3.73989C1.13989 2.30396 2.30395 1.13989 3.73989 1.13989H7.88629C7.92308 1.13284 7.96106 1.12915 7.9999 1.12915ZM2.33989 8.5999V12.2599C2.33989 13.0331 2.9667 13.6599 3.73989 13.6599H7.3999V8.5999H2.33989ZM7.3999 7.3999H2.33989V3.73989C2.33989 2.9667 2.96669 2.33989 3.73989 2.33989H7.3999V7.3999ZM8.5999 8.5999V13.6599H12.2599C13.0331 13.6599 13.6599 13.0331 13.6599 12.2599V8.5999H8.5999ZM13.6599 7.3999H8.5999V2.33989H12.2599C13.0331 2.33989 13.6599 2.96669 13.6599 3.73989V7.3999Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Ze = he(function(t, e) {
786
792
  return ge(me, Object.assign({}, t, {
787
793
  id: "all-border-single",
788
794
  ref: e,
789
- icon: Di
795
+ icon: Ui
790
796
  }));
791
797
  });
792
- Fe.displayName = "AllBorderSingle";
793
- var $i = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M4.1302 12.4251C4.25802 13.7417 5.36779 14.7708 6.71792 14.7708H11.7179C13.1539 14.7708 14.3179 13.6067 14.3179 12.1708V6.1708C14.3179 4.78586 13.2351 3.65383 11.8698 3.57517C11.742 2.25858 10.6323 1.22949 9.28213 1.22949H4.28213C2.84619 1.22949 1.68213 2.39355 1.68213 3.82949V9.82949C1.68213 11.2144 2.76497 12.3465 4.1302 12.4251ZM10.6583 3.5708H6.71792C5.28198 3.5708 4.11792 4.73486 4.11792 6.1708V11.22C3.4221 11.1387 2.88213 10.5471 2.88213 9.82949V3.82949C2.88213 3.05629 3.50893 2.42949 4.28213 2.42949H9.28213C9.96695 2.42949 10.5369 2.92119 10.6583 3.5708ZM13.1179 6.1708C13.1179 5.3976 12.4911 4.7708 11.7179 4.7708H6.71792C5.94472 4.7708 5.31792 5.3976 5.31792 6.1708V12.1708C5.31792 12.944 5.94472 13.5708 6.71792 13.5708H11.7179C12.4911 13.5708 13.1179 12.944 13.1179 12.1708V6.1708Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, $n = he(function(t, e) {
798
+ Ze.displayName = "AllBorderSingle";
799
+ var Hi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M4.1302 12.4251C4.25802 13.7417 5.36779 14.7708 6.71792 14.7708H11.7179C13.1539 14.7708 14.3179 13.6067 14.3179 12.1708V6.1708C14.3179 4.78586 13.2351 3.65383 11.8698 3.57517C11.742 2.25858 10.6323 1.22949 9.28213 1.22949H4.28213C2.84619 1.22949 1.68213 2.39355 1.68213 3.82949V9.82949C1.68213 11.2144 2.76497 12.3465 4.1302 12.4251ZM10.6583 3.5708H6.71792C5.28198 3.5708 4.11792 4.73486 4.11792 6.1708V11.22C3.4221 11.1387 2.88213 10.5471 2.88213 9.82949V3.82949C2.88213 3.05629 3.50893 2.42949 4.28213 2.42949H9.28213C9.96695 2.42949 10.5369 2.92119 10.6583 3.5708ZM13.1179 6.1708C13.1179 5.3976 12.4911 4.7708 11.7179 4.7708H6.71792C5.94472 4.7708 5.31792 5.3976 5.31792 6.1708V12.1708C5.31792 12.944 5.94472 13.5708 6.71792 13.5708H11.7179C12.4911 13.5708 13.1179 12.944 13.1179 12.1708V6.1708Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Bn = he(function(t, e) {
794
800
  return ge(me, Object.assign({}, t, {
795
801
  id: "copy-single",
796
802
  ref: e,
797
- icon: $i
803
+ icon: Hi
798
804
  }));
799
805
  });
800
- $n.displayName = "CopySingle";
801
- var ji = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M9.8816 1.97978C11.0177 0.843607 12.862 0.884962 14.0004 2.02342C15.1389 3.16188 15.1803 5.00612 14.0441 6.14228L11.399 8.78737C11.1608 9.02559 10.7746 9.02559 10.5363 8.78737C10.2981 8.54915 10.2981 8.16292 10.5363 7.9247L13.1814 5.2796C13.8195 4.64155 13.8217 3.57006 13.1378 2.8861C12.4538 2.20211 11.3823 2.20438 10.7443 2.84245L7.6976 5.88911L7.69317 5.89349C7.05959 6.53211 7.05894 7.60014 7.74132 8.28252C7.97954 8.52074 7.97954 8.90697 7.74132 9.14519C7.5031 9.38341 7.11687 9.38341 6.87865 9.14519C5.74016 8.00671 5.69884 6.16251 6.83497 5.02633L6.84021 5.02116L9.8816 1.97978Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.61426 7.2364C4.85248 6.99818 5.23871 6.99818 5.47693 7.2364C5.71515 7.47462 5.71515 7.86085 5.47693 8.09907L2.83183 10.7442C2.19375 11.3823 2.1915 12.4537 2.87547 13.1377C3.55945 13.8217 4.6309 13.8194 5.26899 13.1813L8.31566 10.1347C8.32262 10.1277 8.32971 10.121 8.33691 10.1144C8.34408 10.1064 8.3515 10.0986 8.35916 10.091C8.99721 9.45291 8.99949 8.38145 8.3155 7.69746C8.07728 7.45924 8.07728 7.07301 8.3155 6.83479C8.55372 6.59657 8.93995 6.59657 9.17817 6.83479C10.3166 7.97327 10.358 9.81748 9.22183 10.9536C9.21487 10.9606 9.20779 10.9673 9.20058 10.9739C9.19341 10.9819 9.18599 10.9897 9.17833 10.9973L6.13166 14.044C4.99548 15.1802 3.15127 15.1389 2.01279 14.0004C0.874362 12.8619 0.83297 11.0177 1.96916 9.8815L4.61426 7.2364Z" } }] }, Ut = he(function(t, e) {
806
+ Bn.displayName = "CopySingle";
807
+ var Di = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M9.8816 1.97978C11.0177 0.843607 12.862 0.884962 14.0004 2.02342C15.1389 3.16188 15.1803 5.00612 14.0441 6.14228L11.399 8.78737C11.1608 9.02559 10.7746 9.02559 10.5363 8.78737C10.2981 8.54915 10.2981 8.16292 10.5363 7.9247L13.1814 5.2796C13.8195 4.64155 13.8217 3.57006 13.1378 2.8861C12.4538 2.20211 11.3823 2.20438 10.7443 2.84245L7.6976 5.88911L7.69317 5.89349C7.05959 6.53211 7.05894 7.60014 7.74132 8.28252C7.97954 8.52074 7.97954 8.90697 7.74132 9.14519C7.5031 9.38341 7.11687 9.38341 6.87865 9.14519C5.74016 8.00671 5.69884 6.16251 6.83497 5.02633L6.84021 5.02116L9.8816 1.97978Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.61426 7.2364C4.85248 6.99818 5.23871 6.99818 5.47693 7.2364C5.71515 7.47462 5.71515 7.86085 5.47693 8.09907L2.83183 10.7442C2.19375 11.3823 2.1915 12.4537 2.87547 13.1377C3.55945 13.8217 4.6309 13.8194 5.26899 13.1813L8.31566 10.1347C8.32262 10.1277 8.32971 10.121 8.33691 10.1144C8.34408 10.1064 8.3515 10.0986 8.35916 10.091C8.99721 9.45291 8.99949 8.38145 8.3155 7.69746C8.07728 7.45924 8.07728 7.07301 8.3155 6.83479C8.55372 6.59657 8.93995 6.59657 9.17817 6.83479C10.3166 7.97327 10.358 9.81748 9.22183 10.9536C9.21487 10.9606 9.20779 10.9673 9.20058 10.9739C9.19341 10.9819 9.18599 10.9897 9.17833 10.9973L6.13166 14.044C4.99548 15.1802 3.15127 15.1389 2.01279 14.0004C0.874362 12.8619 0.83297 11.0177 1.96916 9.8815L4.61426 7.2364Z" } }] }, Dt = he(function(t, e) {
802
808
  return ge(me, Object.assign({}, t, {
803
809
  id: "link-single",
804
810
  ref: e,
805
- icon: ji
811
+ icon: Di
806
812
  }));
807
813
  });
808
- Ut.displayName = "LinkSingle";
809
- var Bi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 17", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.5935 3.47302C11.6354 2.51492 10.082 2.51492 9.12388 3.47302L7.83534 4.76157C7.60102 4.99588 7.22112 4.99588 6.98681 4.76157 6.75249 4.52725 6.75249 4.14735 6.98681 3.91304L8.27535 2.62449C9.70209 1.19776 12.0153 1.19776 13.442 2.62449 14.8688 4.05123 14.8688 6.36442 13.442 7.79116L12.1535 9.0797C11.9192 9.31402 11.5393 9.31402 11.3049 9.0797 11.0706 8.84539 11.0706 8.46549 11.3049 8.23117L12.5935 6.94263C13.5516 5.98452 13.5516 4.43113 12.5935 3.47302zM3.40637 12.6606C2.44827 11.7025 2.44827 10.1491 3.40637 9.19102L4.69492 7.90248C4.92923 7.66816 4.92923 7.28826 4.69492 7.05395 4.4606 6.81963 4.0807 6.81963 3.84639 7.05395L2.55784 8.34249C1.13111 9.76923 1.13111 12.0824 2.55784 13.5092 3.98458 14.9359 6.29777 14.9359 7.72451 13.5092L9.01305 12.2206C9.24737 11.9863 9.24737 11.6064 9.01305 11.3721 8.77874 11.1378 8.39884 11.1378 8.16452 11.3721L6.87598 12.6606C5.91787 13.6187 4.36448 13.6187 3.40637 12.6606zM3.5852 2.80332C3.35088 2.569 2.97098 2.569 2.73667 2.80332 2.50235 3.03763 2.50235 3.41753 2.73667 3.65185L12.4151 13.3302C12.6494 13.5646 13.0293 13.5646 13.2636 13.3302 13.4979 13.0959 13.4979 12.716 13.2636 12.4817L3.5852 2.80332z" } }] }, jn = he(function(t, e) {
814
+ Dt.displayName = "LinkSingle";
815
+ var $i = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 17", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.5935 3.47302C11.6354 2.51492 10.082 2.51492 9.12388 3.47302L7.83534 4.76157C7.60102 4.99588 7.22112 4.99588 6.98681 4.76157 6.75249 4.52725 6.75249 4.14735 6.98681 3.91304L8.27535 2.62449C9.70209 1.19776 12.0153 1.19776 13.442 2.62449 14.8688 4.05123 14.8688 6.36442 13.442 7.79116L12.1535 9.0797C11.9192 9.31402 11.5393 9.31402 11.3049 9.0797 11.0706 8.84539 11.0706 8.46549 11.3049 8.23117L12.5935 6.94263C13.5516 5.98452 13.5516 4.43113 12.5935 3.47302zM3.40637 12.6606C2.44827 11.7025 2.44827 10.1491 3.40637 9.19102L4.69492 7.90248C4.92923 7.66816 4.92923 7.28826 4.69492 7.05395 4.4606 6.81963 4.0807 6.81963 3.84639 7.05395L2.55784 8.34249C1.13111 9.76923 1.13111 12.0824 2.55784 13.5092 3.98458 14.9359 6.29777 14.9359 7.72451 13.5092L9.01305 12.2206C9.24737 11.9863 9.24737 11.6064 9.01305 11.3721 8.77874 11.1378 8.39884 11.1378 8.16452 11.3721L6.87598 12.6606C5.91787 13.6187 4.36448 13.6187 3.40637 12.6606zM3.5852 2.80332C3.35088 2.569 2.97098 2.569 2.73667 2.80332 2.50235 3.03763 2.50235 3.41753 2.73667 3.65185L12.4151 13.3302C12.6494 13.5646 13.0293 13.5646 13.2636 13.3302 13.4979 13.0959 13.4979 12.716 13.2636 12.4817L3.5852 2.80332z" } }] }, An = he(function(t, e) {
810
816
  return ge(me, Object.assign({}, t, {
811
817
  id: "unlink-single",
812
818
  ref: e,
813
- icon: Bi
819
+ icon: $i
814
820
  }));
815
821
  });
816
- jn.displayName = "UnlinkSingle";
817
- var Vi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.6551 1.98906C11.7476 1.08113 10.2757 1.08149 9.3686 1.98987L4.82542 6.53955C4.75087 6.61421 4.69336 6.70411 4.65682 6.80309L3.2461 10.625C3.16506 10.8446 3.21909 11.0912 3.3845 11.2568C3.54991 11.4224 3.79651 11.4767 4.01616 11.3959L7.85031 9.98517C7.94979 9.94856 8.04014 9.89077 8.11508 9.81579L12.6552 5.27327C13.5618 4.36621 13.5618 2.89607 12.6551 1.98906ZM10.2177 2.83779C10.6562 2.39869 11.3677 2.39851 11.8064 2.8374C12.2447 3.27584 12.2447 3.9865 11.8065 4.42497L7.3392 8.89457L4.82213 9.82068L5.74706 7.31487L10.2177 2.83779Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.79238 13.2999C1.46101 13.2999 1.19238 13.5685 1.19238 13.8999C1.19238 14.2313 1.46101 14.4999 1.79238 14.4999H14.4924C14.8238 14.4999 15.0924 14.2313 15.0924 13.8999C15.0924 13.5685 14.8238 13.2999 14.4924 13.2999H1.79238Z" } }] }, Bn = he(function(t, e) {
822
+ An.displayName = "UnlinkSingle";
823
+ var ji = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.6551 1.98906C11.7476 1.08113 10.2757 1.08149 9.3686 1.98987L4.82542 6.53955C4.75087 6.61421 4.69336 6.70411 4.65682 6.80309L3.2461 10.625C3.16506 10.8446 3.21909 11.0912 3.3845 11.2568C3.54991 11.4224 3.79651 11.4767 4.01616 11.3959L7.85031 9.98517C7.94979 9.94856 8.04014 9.89077 8.11508 9.81579L12.6552 5.27327C13.5618 4.36621 13.5618 2.89607 12.6551 1.98906ZM10.2177 2.83779C10.6562 2.39869 11.3677 2.39851 11.8064 2.8374C12.2447 3.27584 12.2447 3.9865 11.8065 4.42497L7.3392 8.89457L4.82213 9.82068L5.74706 7.31487L10.2177 2.83779Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.79238 13.2999C1.46101 13.2999 1.19238 13.5685 1.19238 13.8999C1.19238 14.2313 1.46101 14.4999 1.79238 14.4999H14.4924C14.8238 14.4999 15.0924 14.2313 15.0924 13.8999C15.0924 13.5685 14.8238 13.2999 14.4924 13.2999H1.79238Z" } }] }, Vn = he(function(t, e) {
818
824
  return ge(me, Object.assign({}, t, {
819
825
  id: "write-single",
820
826
  ref: e,
821
- icon: Vi
827
+ icon: ji
822
828
  }));
823
829
  });
824
- Bn.displayName = "WriteSingle";
825
- var Ai = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "#35BD4B", d: "M3.4535 1.12549C2.7002 1.12549 2.08954 1.73615 2.08954 2.48945V13.5104C2.08954 14.2637 2.7002 14.8744 3.4535 14.8744H12.5465C13.2998 14.8744 13.9105 14.2637 13.9105 13.5104V5.0992L10.0091 1.12549H3.4535Z" } }, { tag: "path", attrs: { fill: "#32A846", d: "M10.0075 1.12549L13.9104 5.09842H10.6742C10.306 5.09842 10.0075 4.79994 10.0075 4.43175V1.12549Z" } }, { tag: "path", attrs: { fill: "#fff", d: "M7.8088 10.2949L6.3764 12.403C6.26259 12.5705 6.03455 12.614 5.86705 12.5002C5.69955 12.3864 5.65603 12.1584 5.76984 11.9909L7.3655 9.64252L5.94042 7.54519C5.82661 7.37769 5.87013 7.14964 6.03763 7.03583C6.20512 6.92202 6.43317 6.96555 6.54698 7.13304L7.8088 8.9901L9.07062 7.13304C9.18443 6.96555 9.41248 6.92202 9.57997 7.03583C9.74747 7.14964 9.79099 7.37769 9.67718 7.54519L8.2521 9.64252L9.84776 11.9909C9.96157 12.1584 9.91805 12.3864 9.75055 12.5002C9.58305 12.614 9.35501 12.5705 9.2412 12.403L7.8088 10.2949Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Vn = he(function(t, e) {
830
+ Vn.displayName = "WriteSingle";
831
+ var Bi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "#35BD4B", d: "M3.4535 1.12549C2.7002 1.12549 2.08954 1.73615 2.08954 2.48945V13.5104C2.08954 14.2637 2.7002 14.8744 3.4535 14.8744H12.5465C13.2998 14.8744 13.9105 14.2637 13.9105 13.5104V5.0992L10.0091 1.12549H3.4535Z" } }, { tag: "path", attrs: { fill: "#32A846", d: "M10.0075 1.12549L13.9104 5.09842H10.6742C10.306 5.09842 10.0075 4.79994 10.0075 4.43175V1.12549Z" } }, { tag: "path", attrs: { fill: "#fff", d: "M7.8088 10.2949L6.3764 12.403C6.26259 12.5705 6.03455 12.614 5.86705 12.5002C5.69955 12.3864 5.65603 12.1584 5.76984 11.9909L7.3655 9.64252L5.94042 7.54519C5.82661 7.37769 5.87013 7.14964 6.03763 7.03583C6.20512 6.92202 6.43317 6.96555 6.54698 7.13304L7.8088 8.9901L9.07062 7.13304C9.18443 6.96555 9.41248 6.92202 9.57997 7.03583C9.74747 7.14964 9.79099 7.37769 9.67718 7.54519L8.2521 9.64252L9.84776 11.9909C9.96157 12.1584 9.91805 12.3864 9.75055 12.5002C9.58305 12.614 9.35501 12.5705 9.2412 12.403L7.8088 10.2949Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Fn = he(function(t, e) {
826
832
  return ge(me, Object.assign({}, t, {
827
833
  id: "xlsx",
828
834
  ref: e,
829
- icon: Ai
835
+ icon: Bi
830
836
  }));
831
837
  });
832
- Vn.displayName = "Xlsx";
833
- function An(t) {
838
+ Fn.displayName = "Xlsx";
839
+ function Wn(t) {
834
840
  var e, n, i = "";
835
841
  if (typeof t == "string" || typeof t == "number") i += t;
836
842
  else if (typeof t == "object") if (Array.isArray(t)) {
837
843
  var r = t.length;
838
- for (e = 0; e < r; e++) t[e] && (n = An(t[e])) && (i && (i += " "), i += n);
844
+ for (e = 0; e < r; e++) t[e] && (n = Wn(t[e])) && (i && (i += " "), i += n);
839
845
  } else for (n in t) t[n] && (i && (i += " "), i += n);
840
846
  return i;
841
847
  }
842
- function hn() {
843
- for (var t, e, n = 0, i = "", r = arguments.length; n < r; n++) (t = arguments[n]) && (e = An(t)) && (i && (i += " "), i += e);
848
+ function vn() {
849
+ for (var t, e, n = 0, i = "", r = arguments.length; n < r; n++) (t = arguments[n]) && (e = Wn(t)) && (i && (i += " "), i += e);
844
850
  return i;
845
851
  }
846
- const Fi = "univer-cell-link", Wi = "univer-cell-link-type", Zi = "univer-cell-link-content", Gi = "univer-cell-link-content-error", Ki = "univer-cell-link-url", zi = "univer-cell-link-operations", Yi = "univer-cell-link-operation", Xi = "univer-cell-link-operation-error", W = {
847
- cellLink: Fi,
848
- cellLinkType: Wi,
849
- cellLinkContent: Zi,
850
- cellLinkContentError: Gi,
851
- cellLinkUrl: Ki,
852
- cellLinkOperations: zi,
853
- cellLinkOperation: Yi,
854
- cellLinkOperationError: Xi
855
- }, qi = {
856
- [S.URL]: /* @__PURE__ */ m.jsx(Ut, {}),
857
- [S.SHEET]: /* @__PURE__ */ m.jsx(Vn, {}),
858
- [S.RANGE]: /* @__PURE__ */ m.jsx(Fe, {}),
859
- [S.DEFINE_NAME]: /* @__PURE__ */ m.jsx(Fe, {}),
860
- [S.INVALID]: /* @__PURE__ */ m.jsx(Fe, {})
861
- }, gn = (t) => {
862
- var M, P;
863
- const e = E(G), n = E(ie), i = E(On), r = E(ot), o = E(pe), s = E(re), c = E(wt), u = E(ut), { customRange: p, row: l, col: g, unitId: d, subUnitId: _, editPermission: C, copyPermission: v, type: b } = t;
852
+ const Ai = "univer-cell-link", Vi = "univer-cell-link-type", Fi = "univer-cell-link-content", Wi = "univer-cell-link-content-error", Zi = "univer-cell-link-url", Gi = "univer-cell-link-operations", Ki = "univer-cell-link-operation", Yi = "univer-cell-link-operation-error", W = {
853
+ cellLink: Ai,
854
+ cellLinkType: Vi,
855
+ cellLinkContent: Fi,
856
+ cellLinkContentError: Wi,
857
+ cellLinkUrl: Zi,
858
+ cellLinkOperations: Gi,
859
+ cellLinkOperation: Ki,
860
+ cellLinkOperationError: Yi
861
+ }, zi = {
862
+ [S.URL]: /* @__PURE__ */ m.jsx(Dt, {}),
863
+ [S.SHEET]: /* @__PURE__ */ m.jsx(Fn, {}),
864
+ [S.RANGE]: /* @__PURE__ */ m.jsx(Ze, {}),
865
+ [S.DEFINE_NAME]: /* @__PURE__ */ m.jsx(Ze, {}),
866
+ [S.INVALID]: /* @__PURE__ */ m.jsx(Ze, {})
867
+ }, _n = (t) => {
868
+ var M, L;
869
+ const e = E(G), n = E(ie), i = E(Mn), r = E(ct), s = E(pe), o = E(re), c = E(kt), l = E(pt), { customRange: p, row: u, col: g, unitId: d, subUnitId: v, editPermission: I, copyPermission: _, type: b } = t;
864
870
  if (!((M = p == null ? void 0 : p.properties) != null && M.url))
865
871
  return null;
866
- const a = c.parseHyperLink((P = p.properties.url) != null ? P : ""), w = a.type === S.INVALID;
872
+ const a = c.parseHyperLink((L = p.properties.url) != null ? L : ""), w = a.type === S.INVALID;
867
873
  return /* @__PURE__ */ m.jsxs("div", { className: W.cellLink, onClick: () => e.hideCurrentPopup(), children: [
868
874
  /* @__PURE__ */ m.jsxs(
869
875
  "div",
870
876
  {
871
- className: hn(W.cellLinkContent, { [W.cellLinkContentError]: w }),
877
+ className: vn(W.cellLinkContent, { [W.cellLinkContentError]: w }),
872
878
  onClick: () => {
873
- u.visible || w || o.navigate(a);
879
+ l.visible || w || s.navigate(a);
874
880
  },
875
881
  children: [
876
- /* @__PURE__ */ m.jsx("div", { className: W.cellLinkType, children: qi[a.type] }),
877
- /* @__PURE__ */ m.jsx(je, { showIfEllipsis: !0, title: a.name, children: /* @__PURE__ */ m.jsx("span", { className: W.cellLinkUrl, children: a.name }) })
882
+ /* @__PURE__ */ m.jsx("div", { className: W.cellLinkType, children: zi[a.type] }),
883
+ /* @__PURE__ */ m.jsx(Ae, { showIfEllipsis: !0, title: a.name, children: /* @__PURE__ */ m.jsx("span", { className: W.cellLinkUrl, children: a.name }) })
878
884
  ]
879
885
  }
880
886
  ),
881
887
  /* @__PURE__ */ m.jsxs("div", { className: W.cellLinkOperations, children: [
882
- v && /* @__PURE__ */ m.jsx(
888
+ _ && /* @__PURE__ */ m.jsx(
883
889
  "div",
884
890
  {
885
- className: hn(W.cellLinkOperation, { [W.cellLinkOperationError]: w }),
891
+ className: vn(W.cellLinkOperation, { [W.cellLinkOperationError]: w }),
886
892
  onClick: () => {
887
893
  if (!w) {
888
894
  if (a.type !== S.URL) {
889
- const O = new URL(window.location.href);
890
- O.hash = a.url.slice(1), navigator.clipboard.writeText(O.href);
895
+ const k = new URL(window.location.href);
896
+ k.hash = a.url.slice(1), navigator.clipboard.writeText(k.href);
891
897
  } else
892
898
  navigator.clipboard.writeText(a.url);
893
899
  i.show({
894
900
  content: r.t("hyperLink.message.coped"),
895
- type: Te.Info
901
+ type: xe.Info
896
902
  });
897
903
  }
898
904
  },
899
- children: /* @__PURE__ */ m.jsx(je, { placement: "bottom", title: r.t("hyperLink.popup.copy"), children: /* @__PURE__ */ m.jsx($n, {}) })
905
+ children: /* @__PURE__ */ m.jsx(Ae, { placement: "bottom", title: r.t("hyperLink.popup.copy"), children: /* @__PURE__ */ m.jsx(Bn, {}) })
900
906
  }
901
907
  ),
902
- C && /* @__PURE__ */ m.jsxs(m.Fragment, { children: [
908
+ I && /* @__PURE__ */ m.jsxs(m.Fragment, { children: [
903
909
  /* @__PURE__ */ m.jsx(
904
910
  "div",
905
911
  {
906
912
  className: W.cellLinkOperation,
907
913
  onClick: () => {
908
- n.executeCommand(Dt.id, {
914
+ n.executeCommand(jt.id, {
909
915
  unitId: d,
910
- subUnitId: _,
911
- row: l,
916
+ subUnitId: v,
917
+ row: u,
912
918
  col: g,
913
919
  customRangeId: p.rangeId,
914
920
  type: b
915
921
  });
916
922
  },
917
- children: /* @__PURE__ */ m.jsx(je, { placement: "bottom", title: r.t("hyperLink.popup.edit"), children: /* @__PURE__ */ m.jsx(Bn, {}) })
923
+ children: /* @__PURE__ */ m.jsx(Ae, { placement: "bottom", title: r.t("hyperLink.popup.edit"), children: /* @__PURE__ */ m.jsx(Vn, {}) })
918
924
  }
919
925
  ),
920
926
  /* @__PURE__ */ m.jsx(
@@ -922,62 +928,62 @@ const Fi = "univer-cell-link", Wi = "univer-cell-link-type", Zi = "univer-cell-l
922
928
  {
923
929
  className: W.cellLinkOperation,
924
930
  onClick: () => {
925
- const O = b === f.EDITING || b === f.ZEN_EDITOR ? vr.id : _r.id;
926
- n.syncExecuteCommand(O, {
931
+ const k = b === f.EDITING || b === f.ZEN_EDITOR ? Sr.id : Ir.id;
932
+ n.syncExecuteCommand(k, {
927
933
  unitId: d,
928
- subUnitId: _,
934
+ subUnitId: v,
929
935
  id: p.rangeId,
930
- row: l,
936
+ row: u,
931
937
  column: g,
932
- documentId: b === f.ZEN_EDITOR ? x : s.getCurrentEditorId()
938
+ documentId: b === f.ZEN_EDITOR ? x : o.getCurrentEditorId()
933
939
  }) && e.hideCurrentPopup(void 0, !0);
934
940
  },
935
- children: /* @__PURE__ */ m.jsx(je, { placement: "bottom", title: r.t("hyperLink.popup.cancel"), children: /* @__PURE__ */ m.jsx(jn, {}) })
941
+ children: /* @__PURE__ */ m.jsx(Ae, { placement: "bottom", title: r.t("hyperLink.popup.cancel"), children: /* @__PURE__ */ m.jsx(An, {}) })
936
942
  }
937
943
  )
938
944
  ] })
939
945
  ] })
940
946
  ] });
941
- }, ze = () => {
942
- var r, o;
943
- const t = E(G), [e, n] = q(null), i = E(K);
947
+ }, qe = () => {
948
+ var r, s;
949
+ const t = E(G), [e, n] = J(null), i = E(K);
944
950
  if (ne(() => {
945
951
  n(t.currentPopup);
946
- const s = t.currentPopup$.subscribe((c) => {
952
+ const o = t.currentPopup$.subscribe((c) => {
947
953
  n(c);
948
954
  });
949
955
  return () => {
950
- s.unsubscribe();
956
+ o.unsubscribe();
951
957
  };
952
958
  }, [t.currentPopup, t.currentPopup$]), !e)
953
959
  return null;
954
960
  if (e.showAll) {
955
- const s = i.getUnit(e.unitId, k.UNIVER_SHEET), c = s == null ? void 0 : s.getSheetBySheetId(e.subUnitId), u = c == null ? void 0 : c.getCell(e.row, e.col), p = (o = (r = u == null ? void 0 : u.p) == null ? void 0 : r.body) == null ? void 0 : o.customRanges;
956
- return p != null && p.length ? /* @__PURE__ */ m.jsx("div", { children: p.map((l) => /* @__PURE__ */ m.jsx(gn, { ...e, customRange: l }, l.rangeId)) }) : null;
961
+ const o = i.getUnit(e.unitId, O.UNIVER_SHEET), c = o == null ? void 0 : o.getSheetBySheetId(e.subUnitId), l = c == null ? void 0 : c.getCell(e.row, e.col), p = (s = (r = l == null ? void 0 : l.p) == null ? void 0 : r.body) == null ? void 0 : s.customRanges;
962
+ return p != null && p.length ? /* @__PURE__ */ m.jsx("div", { children: p.map((u) => /* @__PURE__ */ m.jsx(_n, { ...e, customRange: u }, u.rangeId)) }) : null;
957
963
  }
958
- return /* @__PURE__ */ m.jsx(gn, { ...e });
964
+ return /* @__PURE__ */ m.jsx(_n, { ...e });
959
965
  };
960
- ze.componentKey = "univer.sheet.cell-link-popup";
961
- var Ji = Object.defineProperty, Qi = Object.getOwnPropertyDescriptor, es = (t, e, n, i) => {
962
- for (var r = i > 1 ? void 0 : i ? Qi(e, n) : e, o = t.length - 1, s; o >= 0; o--)
963
- (s = t[o]) && (r = (i ? s(e, n, r) : s(r)) || r);
964
- return i && r && Ji(e, n, r), r;
966
+ qe.componentKey = "univer.sheet.cell-link-popup";
967
+ var qi = Object.defineProperty, Ji = Object.getOwnPropertyDescriptor, Xi = (t, e, n, i) => {
968
+ for (var r = i > 1 ? void 0 : i ? Ji(e, n) : e, s = t.length - 1, o; s >= 0; s--)
969
+ (o = t[s]) && (r = (i ? o(e, n, r) : o(r)) || r);
970
+ return i && r && qi(e, n, r), r;
965
971
  }, ce = (t, e) => (n, i) => e(n, i, t);
966
- const mn = (t, e) => {
972
+ const Sn = (t, e) => {
967
973
  var n, i;
968
974
  return t.unitId === e.unitId && t.subUnitId === e.subUnitId && t.row === e.row && t.col === e.col && ((n = t.customRange) == null ? void 0 : n.rangeId) === ((i = e.customRange) == null ? void 0 : i.rangeId) && t.type === e.type;
969
975
  };
970
- let G = class extends z {
971
- constructor(e, n, i, r, o, s, c) {
976
+ let G = class extends Y {
977
+ constructor(e, n, i, r, s, o, c) {
972
978
  super();
973
979
  B(this, "_currentPopup", null);
974
- B(this, "_currentPopup$", new oi());
980
+ B(this, "_currentPopup$", new ci());
975
981
  B(this, "currentPopup$", this._currentPopup$.asObservable());
976
982
  B(this, "_currentEditingPopup", null);
977
- B(this, "_currentEditing$", new ai(null));
983
+ B(this, "_currentEditing$", new li(null));
978
984
  B(this, "currentEditing$", this._currentEditing$.asObservable());
979
985
  B(this, "_isKeepVisible", !1);
980
- this._sheetCanvasPopManagerService = e, this._injector = n, this._univerInstanceService = i, this._editorBridgeService = r, this._textSelectionManagerService = o, this._docCanvasPopManagerService = s, this._zenZoneService = c, this.disposeWithMe(() => {
986
+ this._sheetCanvasPopManagerService = e, this._injector = n, this._univerInstanceService = i, this._editorBridgeService = r, this._textSelectionManagerService = s, this._docCanvasPopManagerService = o, this._zenZoneService = c, this.disposeWithMe(() => {
981
987
  this.hideCurrentPopup(), this.endEditing(), this._currentEditing$.complete(), this._currentPopup$.complete();
982
988
  });
983
989
  }
@@ -994,15 +1000,15 @@ let G = class extends z {
994
1000
  return this._isKeepVisible;
995
1001
  }
996
1002
  showPopup(e) {
997
- if (this._currentPopup && mn(e, this._currentPopup) || (this.hideCurrentPopup(void 0, !0), e.type !== f.ZEN_EDITOR && this._zenZoneService.visible))
1003
+ if (this._currentPopup && Sn(e, this._currentPopup) || (this.hideCurrentPopup(void 0, !0), e.type !== f.ZEN_EDITOR && this._zenZoneService.visible))
998
1004
  return;
999
1005
  const n = this._currentEditing$.getValue();
1000
- if (n && mn(e, n))
1006
+ if (n && Sn(e, n))
1001
1007
  return;
1002
- const { unitId: i, subUnitId: r, row: o, col: s, customRangeRect: c, customRange: u } = e;
1008
+ const { unitId: i, subUnitId: r, row: s, col: o, customRangeRect: c, customRange: l } = e;
1003
1009
  let p;
1004
- const l = {
1005
- componentKey: ze.componentKey,
1010
+ const u = {
1011
+ componentKey: qe.componentKey,
1006
1012
  direction: "bottom",
1007
1013
  onClickOutside: () => {
1008
1014
  this.hideCurrentPopup();
@@ -1012,32 +1018,32 @@ let G = class extends z {
1012
1018
  }
1013
1019
  };
1014
1020
  if (e.type === f.EDITING) {
1015
- if (!u)
1021
+ if (!l)
1016
1022
  return;
1017
1023
  p = c && this._sheetCanvasPopManagerService.attachPopupToAbsolutePosition(
1018
1024
  c,
1019
- l
1025
+ u
1020
1026
  );
1021
1027
  } else if (e.type === f.ZEN_EDITOR) {
1022
- if (!u)
1028
+ if (!l)
1023
1029
  return;
1024
1030
  p = this._docCanvasPopManagerService.attachPopupToRange(
1025
1031
  {
1026
- startOffset: u.startIndex,
1027
- endOffset: u.endIndex + 1,
1032
+ startOffset: l.startIndex,
1033
+ endOffset: l.endIndex + 1,
1028
1034
  collapsed: !1
1029
1035
  },
1030
- l,
1036
+ u,
1031
1037
  x
1032
1038
  );
1033
1039
  } else if (e.showAll)
1034
- p = this._sheetCanvasPopManagerService.attachPopupToCell(e.row, e.col, l, i, r);
1040
+ p = this._sheetCanvasPopManagerService.attachPopupToCell(e.row, e.col, u, i, r);
1035
1041
  else {
1036
- if (!u)
1042
+ if (!l)
1037
1043
  return;
1038
1044
  p = c && this._sheetCanvasPopManagerService.attachPopupByPosition(
1039
1045
  c,
1040
- l,
1046
+ u,
1041
1047
  e
1042
1048
  );
1043
1049
  }
@@ -1045,11 +1051,11 @@ let G = class extends z {
1045
1051
  unitId: i,
1046
1052
  subUnitId: r,
1047
1053
  disposable: p,
1048
- row: o,
1049
- col: s,
1054
+ row: s,
1055
+ col: o,
1050
1056
  editPermission: !!e.editPermission,
1051
1057
  copyPermission: !!e.copyPermission,
1052
- customRange: u,
1058
+ customRange: l,
1053
1059
  type: e.type,
1054
1060
  showAll: e.showAll
1055
1061
  }, this._currentPopup$.next(this._currentPopup));
@@ -1059,35 +1065,35 @@ let G = class extends z {
1059
1065
  this._currentPopup && ((!e || e === this._currentPopup.type) && this._currentPopup.disposable.canDispose() || n) && ((r = (i = this._currentPopup) == null ? void 0 : i.disposable) == null || r.dispose(), this._currentPopup = null, this._currentPopup$.next(null));
1060
1066
  }
1061
1067
  _getEditingRange() {
1062
- var i, r, o;
1068
+ var i, r, s;
1063
1069
  const e = this._editorBridgeService.isVisible().visible, n = this._editorBridgeService.getEditCellState();
1064
1070
  if (e && n) {
1065
- const s = this._textSelectionManagerService.getActiveTextRange(), c = (i = n.documentLayoutObject.documentModel) == null ? void 0 : i.getBody();
1071
+ const o = this._textSelectionManagerService.getActiveTextRange(), c = (i = n.documentLayoutObject.documentModel) == null ? void 0 : i.getBody();
1066
1072
  if (!c)
1067
1073
  return null;
1068
- if (!s || s.collapsed)
1074
+ if (!o || o.collapsed)
1069
1075
  return {
1070
1076
  startOffset: 0,
1071
1077
  endOffset: c.dataStream.length - 2,
1072
1078
  collapsed: c.dataStream.length - 2 === 0,
1073
1079
  label: Se.transform.getPlainText(c.dataStream)
1074
1080
  };
1075
- const u = Se.customRange.getCustomRangesInterestsWithSelection(s, (o = (r = c.customRanges) == null ? void 0 : r.filter((g) => g.rangeType === We.HYPERLINK)) != null ? o : []);
1076
- let p = s.startOffset, l = s.endOffset;
1077
- return u.forEach((g) => {
1078
- p = Math.min(p, g.startIndex), l = Math.max(l, g.endIndex + 1);
1081
+ const l = Se.customRange.getCustomRangesInterestsWithSelection(o, (s = (r = c.customRanges) == null ? void 0 : r.filter((g) => g.rangeType === Ge.HYPERLINK)) != null ? s : []);
1082
+ let p = o.startOffset, u = o.endOffset;
1083
+ return l.forEach((g) => {
1084
+ p = Math.min(p, g.startIndex), u = Math.max(u, g.endIndex + 1);
1079
1085
  }), {
1080
1086
  startOffset: p,
1081
- endOffset: l,
1082
- collapsed: p === l,
1083
- label: Se.transform.getPlainText(c.dataStream.slice(p, l))
1087
+ endOffset: u,
1088
+ collapsed: p === u,
1089
+ label: Se.transform.getPlainText(c.dataStream.slice(p, u))
1084
1090
  };
1085
1091
  }
1086
1092
  return null;
1087
1093
  }
1088
1094
  get _editPopup() {
1089
1095
  return {
1090
- componentKey: Ke.componentKey,
1096
+ componentKey: ze.componentKey,
1091
1097
  direction: "bottom",
1092
1098
  onClickOutside: () => {
1093
1099
  this.getIsKeepVisible() || this.endEditing();
@@ -1099,11 +1105,11 @@ let G = class extends z {
1099
1105
  };
1100
1106
  }
1101
1107
  startAddEditing(e) {
1102
- var o, s, c, u, p;
1108
+ var s, o, c, l, p;
1103
1109
  const { unitId: n, subUnitId: i, type: r } = e;
1104
1110
  if (r === f.ZEN_EDITOR) {
1105
- const l = this._univerInstanceService.getUnit(x, k.UNIVER_DOC);
1106
- if (!l)
1111
+ const u = this._univerInstanceService.getUnit(x, O.UNIVER_DOC);
1112
+ if (!u)
1107
1113
  return;
1108
1114
  const g = this._textSelectionManagerService.getActiveTextRange();
1109
1115
  if (!g)
@@ -1113,20 +1119,20 @@ let G = class extends z {
1113
1119
  this._editPopup,
1114
1120
  x
1115
1121
  );
1116
- const d = (o = l.getBody()) == null ? void 0 : o.dataStream.slice(g.startOffset, g.endOffset);
1122
+ const d = (s = u.getBody()) == null ? void 0 : s.dataStream.slice(g.startOffset, g.endOffset);
1117
1123
  this._currentEditing$.next({
1118
1124
  ...e,
1119
1125
  label: d
1120
1126
  });
1121
1127
  } else if (r === f.EDITING) {
1122
- const l = this._getEditingRange();
1123
- if (!l)
1128
+ const u = this._getEditingRange();
1129
+ if (!u)
1124
1130
  return;
1125
- this._textSelectionManagerService.replaceDocRanges([{ ...l }], { unitId: Ie, subUnitId: Ie });
1126
- const g = this._injector.get(He).getRenderById(Ie);
1131
+ this._textSelectionManagerService.replaceDocRanges([{ ...u }], { unitId: Ce, subUnitId: Ce });
1132
+ const g = this._injector.get($e).getRenderById(Ce);
1127
1133
  if (!g)
1128
1134
  return;
1129
- const d = ii(l, g);
1135
+ const d = si(u, g);
1130
1136
  if (!(d != null && d.length))
1131
1137
  return;
1132
1138
  this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupToAbsolutePosition(
@@ -1136,7 +1142,7 @@ let G = class extends z {
1136
1142
  i
1137
1143
  ), this._currentEditing$.next({
1138
1144
  ...e,
1139
- label: (s = l == null ? void 0 : l.label) != null ? s : ""
1145
+ label: (o = u == null ? void 0 : u.label) != null ? o : ""
1140
1146
  });
1141
1147
  } else {
1142
1148
  this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupToCell(
@@ -1146,22 +1152,22 @@ let G = class extends z {
1146
1152
  n,
1147
1153
  i
1148
1154
  );
1149
- const l = this._univerInstanceService.getUnit(n, k.UNIVER_SHEET), g = l == null ? void 0 : l.getSheetBySheetId(i), d = g == null ? void 0 : g.getCellRaw(e.row, e.col);
1155
+ const u = this._univerInstanceService.getUnit(n, O.UNIVER_SHEET), g = u == null ? void 0 : u.getSheetBySheetId(i), d = g == null ? void 0 : g.getCellRaw(e.row, e.col);
1150
1156
  this._currentEditing$.next({
1151
1157
  ...e,
1152
- label: d != null && d.p ? Se.transform.getPlainText((u = (c = d.p.body) == null ? void 0 : c.dataStream) != null ? u : "") : ((p = d == null ? void 0 : d.v) != null ? p : "").toString()
1158
+ label: d != null && d.p ? Se.transform.getPlainText((l = (c = d.p.body) == null ? void 0 : c.dataStream) != null ? l : "") : ((p = d == null ? void 0 : d.v) != null ? p : "").toString()
1153
1159
  });
1154
1160
  }
1155
1161
  }
1156
1162
  // eslint-disable-next-line complexity, max-lines-per-function
1157
1163
  startEditing(e) {
1158
- var s, c, u, p, l, g;
1159
- (s = this._currentEditingPopup) == null || s.dispose(), this.hideCurrentPopup(void 0, !0);
1164
+ var o, c, l, p, u, g;
1165
+ (o = this._currentEditingPopup) == null || o.dispose(), this.hideCurrentPopup(void 0, !0);
1160
1166
  const { unitId: n, subUnitId: i } = e;
1161
- let r, o;
1167
+ let r, s;
1162
1168
  if (e.type === f.ZEN_EDITOR) {
1163
- const d = this._univerInstanceService.getUnit(x, k.UNIVER_DOC);
1164
- if (r = (u = (c = d == null ? void 0 : d.getBody()) == null ? void 0 : c.customRanges) == null ? void 0 : u.find((_) => _.rangeId === e.customRangeId), o = r ? (p = d == null ? void 0 : d.getBody()) == null ? void 0 : p.dataStream.slice(r.startIndex, r.endIndex + 1) : "", !r || !o)
1169
+ const d = this._univerInstanceService.getUnit(x, O.UNIVER_DOC);
1170
+ if (r = (l = (c = d == null ? void 0 : d.getBody()) == null ? void 0 : c.customRanges) == null ? void 0 : l.find((v) => v.rangeId === e.customRangeId), s = r ? (p = d == null ? void 0 : d.getBody()) == null ? void 0 : p.dataStream.slice(r.startIndex, r.endIndex + 1) : "", !r || !s)
1165
1171
  return;
1166
1172
  this._textSelectionManagerService.replaceTextRanges([
1167
1173
  {
@@ -1178,10 +1184,10 @@ let G = class extends z {
1178
1184
  x
1179
1185
  );
1180
1186
  } else if (e.type === f.EDITING) {
1181
- const d = Lr(this._injector, e.unitId, e.subUnitId, e.row, e.col, e.customRangeId);
1182
- if (!d || !((l = d.rects) != null && l.length))
1187
+ const d = wr(this._injector, e.unitId, e.subUnitId, e.row, e.col, e.customRangeId);
1188
+ if (!d || !((u = d.rects) != null && u.length))
1183
1189
  return;
1184
- r = d.customRange, o = d.label, this._textSelectionManagerService.replaceTextRanges([
1190
+ r = d.customRange, s = d.label, this._textSelectionManagerService.replaceTextRanges([
1185
1191
  {
1186
1192
  startOffset: r.startIndex,
1187
1193
  endOffset: r.endIndex + 1
@@ -1193,10 +1199,10 @@ let G = class extends z {
1193
1199
  i
1194
1200
  );
1195
1201
  } else {
1196
- const d = this._univerInstanceService.getUnit(n, k.UNIVER_SHEET), _ = d == null ? void 0 : d.getSheetBySheetId(i), C = _ == null ? void 0 : _.getCellRaw(e.row, e.col), v = d == null ? void 0 : d.getStyles().getStyleByCell(C), b = v == null ? void 0 : v.tr, a = br(this._injector, e.unitId, e.subUnitId, e.row, e.col, e.customRangeId);
1202
+ const d = this._univerInstanceService.getUnit(n, O.UNIVER_SHEET), v = d == null ? void 0 : d.getSheetBySheetId(i), I = v == null ? void 0 : v.getCellRaw(e.row, e.col), _ = d == null ? void 0 : d.getStyles().getStyleByCell(I), b = _ == null ? void 0 : _.tr, a = Or(this._injector, e.unitId, e.subUnitId, e.row, e.col, e.customRangeId);
1197
1203
  if (!a || !((g = a.rects) != null && g.length))
1198
1204
  return;
1199
- r = a.customRange, o = a.label, b ? this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupToCell(
1205
+ r = a.customRange, s = a.label, b ? this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupToCell(
1200
1206
  e.row,
1201
1207
  e.col,
1202
1208
  this._editPopup,
@@ -1216,7 +1222,7 @@ let G = class extends z {
1216
1222
  this._currentEditing$.next({
1217
1223
  ...e,
1218
1224
  customRange: r,
1219
- label: o
1225
+ label: s
1220
1226
  });
1221
1227
  }
1222
1228
  endEditing(e) {
@@ -1225,42 +1231,44 @@ let G = class extends z {
1225
1231
  n && (!e || e === n.type) && ((i = this._currentEditingPopup) == null || i.dispose(), this._currentEditing$.next(null));
1226
1232
  }
1227
1233
  };
1228
- G = es([
1229
- ce(0, R(Pr)),
1230
- ce(1, R(at)),
1234
+ G = Xi([
1235
+ ce(0, R(br)),
1236
+ ce(1, R(lt)),
1231
1237
  ce(2, K),
1232
1238
  ce(3, re),
1233
- ce(4, R(Ue)),
1234
- ce(5, R(ri)),
1235
- ce(6, ut)
1239
+ ce(4, R(De)),
1240
+ ce(5, R(oi)),
1241
+ ce(6, pt)
1236
1242
  ], G);
1237
- const Ht = (t, e, n, i) => {
1243
+ var Me = /* @__PURE__ */ ((t) => (t[t.ALLOWED = 0] = "ALLOWED", t[t.DISABLED_BY_CELL = 1] = "DISABLED_BY_CELL", t[t.ALLOW_ON_EDITING = 2] = "ALLOW_ON_EDITING", t))(Me || {});
1244
+ const Qi = /* @__PURE__ */ new Set([
1245
+ Ct.CHECKBOX,
1246
+ Ct.LIST,
1247
+ Ct.LIST_MULTIPLE
1248
+ ]), $t = (t, e, n, i) => {
1249
+ var c, l;
1238
1250
  const r = e.getCell(n, i);
1239
1251
  if (r != null && r.f || r != null && r.si)
1240
- return !0;
1241
- const o = [
1242
- Ct.CHECKBOX,
1243
- Ct.LIST,
1244
- Ct.LIST_MULTIPLE
1245
- ], s = t.has(dn) ? t.get(dn) : null, c = s == null ? void 0 : s.getRuleByLocation(e.getUnitId(), e.getSheetId(), n, i);
1246
- return !!(c && o.includes(c.type));
1247
- }, ts = (t) => {
1248
- const e = t.get(K).getCurrentUnitForType(k.UNIVER_SHEET);
1252
+ return 1;
1253
+ const s = t.has(hn) ? t.get(hn) : null, o = s == null ? void 0 : s.getRuleByLocation(e.getUnitId(), e.getSheetId(), n, i);
1254
+ return o && Qi.has(o.type) ? !0 : (l = (c = r == null ? void 0 : r.p) == null ? void 0 : c.drawingsOrder) != null && l.length ? 2 : 0;
1255
+ }, eo = (t) => {
1256
+ const e = t.get(K).getCurrentUnitForType(O.UNIVER_SHEET);
1249
1257
  if (!e)
1250
1258
  return !0;
1251
- const n = e.getActiveSheet(), i = t.get(kt).getCurrentSelections();
1259
+ const n = e.getActiveSheet(), i = t.get(Tt).getCurrentSelections();
1252
1260
  if (!i.length)
1253
1261
  return !0;
1254
- const r = i[0].range.startRow, o = i[0].range.startColumn;
1255
- return Ht(t, n, r, o);
1256
- }, ns = (t) => {
1257
- const e = t.get(Ue), n = t.get(K), i = e.getTextRanges();
1262
+ const r = i[0].range.startRow, s = i[0].range.startColumn;
1263
+ return $t(t, n, r, s) === 1;
1264
+ }, to = (t) => {
1265
+ const e = t.get(De), n = t.get(K), i = e.getTextRanges();
1258
1266
  if (!(i != null && i.length))
1259
1267
  return !0;
1260
- const r = n.getCurrentUnitForType(k.UNIVER_DOC);
1261
- return !!(!r || i.every((s) => s.collapsed) || !r.getSelfOrHeaderFooterModel(i[0].segmentId).getBody());
1262
- }, Dt = {
1263
- type: ct.OPERATION,
1268
+ const r = n.getCurrentUnitForType(O.UNIVER_DOC);
1269
+ return !!(!r || i.every((o) => o.collapsed) || !r.getSelfOrHeaderFooterModel(i[0].segmentId).getBody());
1270
+ }, jt = {
1271
+ type: ut.OPERATION,
1264
1272
  id: "sheet.operation.open-hyper-link-edit-panel",
1265
1273
  handler(t, e) {
1266
1274
  if (!e)
@@ -1268,311 +1276,310 @@ const Ht = (t, e, n, i) => {
1268
1276
  const n = t.get(G);
1269
1277
  return e.customRangeId ? n.startEditing(e) : n.startAddEditing(e), !0;
1270
1278
  }
1271
- }, Ye = {
1272
- type: ct.OPERATION,
1279
+ }, Je = {
1280
+ type: ut.OPERATION,
1273
1281
  id: "sheet.operation.close-hyper-link-popup",
1274
1282
  handler(t) {
1275
1283
  return t.get(G).endEditing(), !0;
1276
1284
  }
1277
- }, $t = {
1278
- type: ct.OPERATION,
1285
+ }, Bt = {
1286
+ type: ut.OPERATION,
1279
1287
  id: "sheet.operation.insert-hyper-link",
1280
1288
  handler(t) {
1281
1289
  var g;
1282
- const e = t.get(K), n = wn(e), i = t.get(re);
1290
+ const e = t.get(K), n = xn(e), i = t.get(re);
1283
1291
  if (!n)
1284
1292
  return !1;
1285
- const r = t.get(ie), s = t.get(kt).getCurrentLastSelection();
1286
- if (!s)
1293
+ const r = t.get(ie), o = t.get(Tt).getCurrentLastSelection();
1294
+ if (!o)
1287
1295
  return !1;
1288
- const c = s.range.startRow, u = s.range.startColumn, p = i.isVisible(), l = ((g = e.getFocusedUnit()) == null ? void 0 : g.getUnitId()) === x;
1289
- return r.executeCommand(Dt.id, {
1296
+ const c = o.range.startRow, l = o.range.startColumn, p = i.isVisible(), u = ((g = e.getFocusedUnit()) == null ? void 0 : g.getUnitId()) === x;
1297
+ return r.executeCommand(jt.id, {
1290
1298
  unitId: n.unitId,
1291
1299
  subUnitId: n.subUnitId,
1292
1300
  row: c,
1293
- col: u,
1294
- type: l ? f.ZEN_EDITOR : p.visible ? f.EDITING : f.VIEWING
1301
+ col: l,
1302
+ type: u ? f.ZEN_EDITOR : p.visible ? f.EDITING : f.VIEWING
1295
1303
  });
1296
1304
  }
1297
1305
  }, de = {
1298
- type: ct.OPERATION,
1306
+ type: ut.OPERATION,
1299
1307
  id: "sheet.operation.insert-hyper-link-toolbar",
1300
1308
  handler(t) {
1301
- if (ts(t))
1309
+ if (eo(t))
1302
1310
  return !1;
1303
1311
  const e = t.get(ie);
1304
- return t.get(G).currentEditing ? e.executeCommand(Ye.id) : e.executeCommand($t.id);
1312
+ return t.get(G).currentEditing ? e.executeCommand(Je.id) : e.executeCommand(Bt.id);
1305
1313
  }
1306
- }, jt = (t, e = x) => {
1314
+ }, At = (t, e = x) => {
1307
1315
  var r;
1308
- const n = t.get(K), i = (r = t.get(He).getRenderById(e)) == null ? void 0 : r.with(xn);
1316
+ const n = t.get(K), i = (r = t.get($e).getRenderById(e)) == null ? void 0 : r.with(Hn);
1309
1317
  return i ? i.textSelectionInner$.pipe(le(() => {
1310
- const s = t.get(re).getEditCellState();
1311
- if (!s)
1318
+ const o = t.get(re).getEditCellState();
1319
+ if (!o)
1312
1320
  return !0;
1313
- const c = wn(n, { unitId: s.unitId, subUnitId: s.sheetId });
1314
- return !(c != null && c.worksheet) || Ht(t, c.worksheet, s.row, s.column) ? !0 : ns(t);
1315
- })) : xe(!0);
1316
- }, Fn = (t) => {
1317
- const e = kr(t, { workbookTypes: [Ot], worksheetTypes: [Tt, kn, xt], rangeTypes: [Nt] }, !0), n = t.get(K), i = t.get(kt), r = t.has(re) ? t.get(re) : null, o = n.focused$.pipe(
1318
- ln((s) => !!s),
1319
- le((s) => n.getUnit(s, k.UNIVER_SHEET)),
1320
- ln((s) => !!s),
1321
- ue((s) => s.activeSheet$),
1322
- ue((s) => i.selectionMoveEnd$.pipe(le((c) => s && { selections: c, sheet: s }))),
1323
- le((s) => {
1324
- if (!s)
1325
- return !0;
1326
- const { selections: c, sheet: u } = s;
1321
+ const c = xn(n, { unitId: o.unitId, subUnitId: o.sheetId });
1322
+ return !(c != null && c.worksheet) || $t(t, c.worksheet, o.row, o.column) === 1 ? !0 : to(t);
1323
+ })) : Ne(!0);
1324
+ }, Zn = (t) => {
1325
+ const e = Tr(t, { workbookTypes: [xt], worksheetTypes: [Nt, Nn, Mt], rangeTypes: [Ut] }, !0), n = t.get(K), i = t.get(Tt), r = t.has(re) ? t.get(re) : null, s = n.focused$.pipe(
1326
+ dn((o) => !!o),
1327
+ le((o) => n.getUnit(o, O.UNIVER_SHEET)),
1328
+ dn((o) => !!o),
1329
+ ue((o) => o.activeSheet$),
1330
+ ue((o) => i.selectionMoveEnd$.pipe(le((c) => o && { selections: c, sheet: o }))),
1331
+ le((o) => {
1332
+ if (!o)
1333
+ return Me.DISABLED_BY_CELL;
1334
+ const { selections: c, sheet: l } = o;
1327
1335
  if (!c.length)
1328
- return !0;
1329
- const p = c[0].range.startRow, l = c[0].range.startColumn;
1330
- if (Ht(t, u, p, l))
1331
- return !0;
1336
+ return Me.DISABLED_BY_CELL;
1337
+ const p = c[0].range.startRow, u = c[0].range.startColumn;
1338
+ return $t(t, l, p, u);
1332
1339
  }),
1333
- ue((s) => {
1334
- if (s)
1335
- return xe(!0);
1336
- const c = (r ? r.visible$ : xe(null)).pipe(le((p) => p != null && p.visible ? Ie : void 0)), u = t.get(yn).subscribeContextValue$(ar);
1337
- return ci([c, u]).pipe(
1340
+ ue((o) => {
1341
+ if (o === Me.DISABLED_BY_CELL)
1342
+ return Ne(!0);
1343
+ const c = (r ? r.visible$ : Ne(null)).pipe(le((p) => p != null && p.visible ? Ce : void 0)), l = t.get(Pn).subscribeContextValue$(lr);
1344
+ return ui([c, l]).pipe(
1338
1345
  ue(
1339
- ([p, l]) => p ? l ? xe(!0) : jt(t, p) : xe(!1)
1346
+ ([p, u]) => p ? u ? Ne(!0) : At(t, p) : Ne(o === Me.ALLOW_ON_EDITING)
1340
1347
  )
1341
1348
  );
1342
1349
  })
1343
1350
  );
1344
1351
  return e.pipe(
1345
- li(),
1346
- ue((s) => o.pipe(le((c) => s || c)))
1352
+ di(),
1353
+ ue((o) => s.pipe(le((c) => o || c)))
1347
1354
  );
1348
1355
  }, Xe = {
1349
- commandId: $t.id,
1350
- type: Tn.BUTTON,
1356
+ commandId: Bt.id,
1357
+ type: Un.BUTTON,
1351
1358
  title: "hyperLink.menu.add",
1352
1359
  icon: "LinkSingle"
1353
- }, qe = (t) => `${t}-zen-editor`, rs = (t) => ({
1360
+ }, Qe = (t) => `${t}-zen-editor`, no = (t) => ({
1354
1361
  ...Xe,
1355
1362
  id: Xe.commandId,
1356
- hidden$: dt(t, k.UNIVER_SHEET),
1357
- disabled$: Fn(t)
1363
+ hidden$: ht(t, O.UNIVER_SHEET),
1364
+ disabled$: Zn(t)
1358
1365
  // disabled$: getObservableWithExclusiveRange$(accessor, getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission, WorksheetSetCellValuePermission, WorksheetInsertHyperlinkPermission], rangeTypes: [RangeProtectionPermissionEditPoint] })),
1359
- }), is = (t) => ({
1366
+ }), ro = (t) => ({
1360
1367
  ...Xe,
1361
- id: qe(Xe.commandId),
1362
- hidden$: dt(t, k.UNIVER_DOC, x),
1363
- disabled$: jt(t)
1364
- }), Je = {
1368
+ id: Qe(Xe.commandId),
1369
+ hidden$: ht(t, O.UNIVER_DOC, x),
1370
+ disabled$: At(t)
1371
+ }), et = {
1365
1372
  tooltip: "hyperLink.form.addTitle",
1366
1373
  commandId: de.id,
1367
- type: Tn.BUTTON,
1374
+ type: Un.BUTTON,
1368
1375
  icon: "LinkSingle"
1369
- }, ss = (t) => ({
1370
- ...Je,
1371
- id: Je.commandId,
1372
- hidden$: dt(t, k.UNIVER_SHEET),
1373
- disabled$: Fn(t)
1374
- }), os = (t) => ({
1375
- ...Je,
1376
- id: qe(Je.commandId),
1377
- hidden$: dt(t, k.UNIVER_DOC, x),
1378
- disabled$: jt(t)
1379
- }), Wn = {
1376
+ }, io = (t) => ({
1377
+ ...et,
1378
+ id: et.commandId,
1379
+ hidden$: ht(t, O.UNIVER_SHEET),
1380
+ disabled$: Zn(t)
1381
+ }), oo = (t) => ({
1382
+ ...et,
1383
+ id: Qe(et.commandId),
1384
+ hidden$: ht(t, O.UNIVER_DOC, x),
1385
+ disabled$: At(t)
1386
+ }), Gn = {
1380
1387
  id: de.id,
1381
- binding: Rt.K | Yr.CTRL_COMMAND,
1382
- preconditions: wr
1388
+ binding: Pt.K | Jr.CTRL_COMMAND,
1389
+ preconditions: kr
1383
1390
  };
1384
- var as = Object.defineProperty, cs = Object.getOwnPropertyDescriptor, ls = (t, e, n, i) => {
1385
- for (var r = i > 1 ? void 0 : i ? cs(e, n) : e, o = t.length - 1, s; o >= 0; o--)
1386
- (s = t[o]) && (r = (i ? s(e, n, r) : s(r)) || r);
1387
- return i && r && as(e, n, r), r;
1388
- }, fn = (t, e) => (n, i) => e(n, i, t);
1389
- let Qe = class extends z {
1391
+ var so = Object.defineProperty, ao = Object.getOwnPropertyDescriptor, co = (t, e, n, i) => {
1392
+ for (var r = i > 1 ? void 0 : i ? ao(e, n) : e, s = t.length - 1, o; s >= 0; s--)
1393
+ (o = t[s]) && (r = (i ? o(e, n, r) : o(r)) || r);
1394
+ return i && r && so(e, n, r), r;
1395
+ }, In = (t, e) => (n, i) => e(n, i, t);
1396
+ let tt = class extends Y {
1390
1397
  constructor(t, e) {
1391
1398
  super(), this._autoFillService = t, this._hyperLinkModel = e, this._initAutoFill();
1392
1399
  }
1393
1400
  // eslint-disable-next-line max-lines-per-function
1394
1401
  _initAutoFill() {
1395
1402
  const t = () => ({ redos: [], undos: [] }), e = (i, r) => {
1396
- const { source: o, target: s, unitId: c, subUnitId: u } = i, p = Et([o, s]), [l, g] = p.ranges, { mapFunc: d } = p, _ = {
1397
- row: l.startRow,
1398
- col: l.startColumn
1399
- }, C = Tr(l, g), v = [], b = [];
1400
- return C.forEach((a) => {
1401
- const w = a.repeatStartCell, M = a.relativeRange, P = {
1402
- startRow: _.row,
1403
- startColumn: _.col,
1404
- endColumn: _.col,
1405
- endRow: _.row
1406
- }, O = {
1403
+ const { source: s, target: o, unitId: c, subUnitId: l } = i, p = Lt([s, o]), [u, g] = p.ranges, { mapFunc: d } = p, v = {
1404
+ row: u.startRow,
1405
+ col: u.startColumn
1406
+ }, I = Nr(u, g), _ = [], b = [];
1407
+ return I.forEach((a) => {
1408
+ const w = a.repeatStartCell, M = a.relativeRange, L = {
1409
+ startRow: v.row,
1410
+ startColumn: v.col,
1411
+ endColumn: v.col,
1412
+ endRow: v.row
1413
+ }, k = {
1407
1414
  startRow: w.row,
1408
1415
  startColumn: w.col,
1409
1416
  endColumn: w.col,
1410
1417
  endRow: w.row
1411
1418
  };
1412
- In.foreach(M, (J, D) => {
1413
- const Y = ye.getPositionRange(
1419
+ Ln.foreach(M, (X, D) => {
1420
+ const z = ye.getPositionRange(
1414
1421
  {
1415
- startRow: J,
1422
+ startRow: X,
1416
1423
  startColumn: D,
1417
1424
  endColumn: D,
1418
- endRow: J
1425
+ endRow: X
1419
1426
  },
1420
- P
1421
- ), { row: Ee, col: De } = d(Y.startRow, Y.startColumn), se = this._hyperLinkModel.getHyperLinkByLocation(c, u, Ee, De), Re = ye.getPositionRange(
1427
+ L
1428
+ ), { row: Ee, col: je } = d(z.startRow, z.startColumn), oe = this._hyperLinkModel.getHyperLinkByLocation(c, l, Ee, je), Re = ye.getPositionRange(
1422
1429
  {
1423
- startRow: J,
1430
+ startRow: X,
1424
1431
  startColumn: D,
1425
1432
  endColumn: D,
1426
- endRow: J
1433
+ endRow: X
1427
1434
  },
1428
- O
1429
- ), { row: Pe, col: Le } = d(Re.startRow, Re.startColumn), oe = Ce.generateRandomId(), j = this._hyperLinkModel.getHyperLinkByLocation(c, u, Pe, Le);
1430
- j && v.push({
1431
- id: Ne.id,
1435
+ k
1436
+ ), { row: Le, col: Pe } = d(Re.startRow, Re.startColumn), se = Ie.generateRandomId(), j = this._hyperLinkModel.getHyperLinkByLocation(c, l, Le, Pe);
1437
+ j && _.push({
1438
+ id: Ue.id,
1432
1439
  params: {
1433
1440
  unitId: c,
1434
- subUnitId: u,
1441
+ subUnitId: l,
1435
1442
  id: j.id
1436
1443
  }
1437
- }), (ke.COPY === r || ke.SERIES === r) && se && (v.push({
1438
- id: Me.id,
1444
+ }), (Oe.COPY === r || Oe.SERIES === r) && oe && (_.push({
1445
+ id: He.id,
1439
1446
  params: {
1440
1447
  unitId: c,
1441
- subUnitId: u,
1448
+ subUnitId: l,
1442
1449
  link: {
1443
- ...se,
1444
- id: oe,
1445
- row: Pe,
1446
- column: Le
1450
+ ...oe,
1451
+ id: se,
1452
+ row: Le,
1453
+ column: Pe
1447
1454
  }
1448
1455
  }
1449
1456
  }), b.push({
1450
- id: Ne.id,
1457
+ id: Ue.id,
1451
1458
  params: {
1452
1459
  unitId: c,
1453
- subUnitId: u,
1454
- id: oe
1460
+ subUnitId: l,
1461
+ id: se
1455
1462
  }
1456
1463
  })), j && b.push({
1457
- id: Me.id,
1464
+ id: He.id,
1458
1465
  params: {
1459
1466
  unitId: c,
1460
- subUnitId: u,
1467
+ subUnitId: l,
1461
1468
  link: j
1462
1469
  }
1463
1470
  });
1464
1471
  });
1465
1472
  }), {
1466
1473
  undos: b,
1467
- redos: v
1474
+ redos: _
1468
1475
  };
1469
1476
  }, n = {
1470
- id: Mt,
1471
- onFillData: (i, r, o) => o === ke.COPY || o === ke.ONLY_FORMAT || o === ke.SERIES ? e(i, o) : t()
1477
+ id: Ht,
1478
+ onFillData: (i, r, s) => s === Oe.COPY || s === Oe.ONLY_FORMAT || s === Oe.SERIES ? e(i, s) : t()
1472
1479
  };
1473
1480
  this.disposeWithMe(this._autoFillService.addHook(n));
1474
1481
  }
1475
1482
  };
1476
- Qe = ls([
1477
- fn(0, Or),
1478
- fn(1, R(lt))
1479
- ], Qe);
1480
- var us = Object.defineProperty, ds = Object.getOwnPropertyDescriptor, ps = (t, e, n, i) => {
1481
- for (var r = i > 1 ? void 0 : i ? ds(e, n) : e, o = t.length - 1, s; o >= 0; o--)
1482
- (s = t[o]) && (r = (i ? s(e, n, r) : s(r)) || r);
1483
- return i && r && us(e, n, r), r;
1484
- }, yt = (t, e) => (n, i) => e(n, i, t);
1485
- let et = class extends z {
1483
+ tt = co([
1484
+ In(0, xr),
1485
+ In(1, R(dt))
1486
+ ], tt);
1487
+ var lo = Object.defineProperty, uo = Object.getOwnPropertyDescriptor, po = (t, e, n, i) => {
1488
+ for (var r = i > 1 ? void 0 : i ? uo(e, n) : e, s = t.length - 1, o; s >= 0; s--)
1489
+ (o = t[s]) && (r = (i ? o(e, n, r) : o(r)) || r);
1490
+ return i && r && lo(e, n, r), r;
1491
+ }, Rt = (t, e) => (n, i) => e(n, i, t);
1492
+ let nt = class extends Y {
1486
1493
  constructor(t, e, n) {
1487
1494
  super(), this._localeService = t, this._commandService = e, this._sheetPermissionInterceptorBaseController = n, this._commandExecutedListener();
1488
1495
  }
1489
1496
  _commandExecutedListener() {
1490
1497
  this.disposeWithMe(
1491
1498
  this._commandService.beforeCommandExecuted((t) => {
1492
- t.id === Wn.id && (this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
1493
- workbookTypes: [Ot],
1494
- rangeTypes: [Nt],
1495
- worksheetTypes: [Tt, kn, xt]
1499
+ t.id === Gn.id && (this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
1500
+ workbookTypes: [xt],
1501
+ rangeTypes: [Ut],
1502
+ worksheetTypes: [Nt, Nn, Mt]
1496
1503
  }) || this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.hyperLinkErr")));
1497
1504
  })
1498
1505
  );
1499
1506
  }
1500
1507
  };
1501
- et = ps([
1502
- yt(0, R(ot)),
1503
- yt(1, ie),
1504
- yt(2, R(Rn))
1505
- ], et);
1506
- var hs = Object.defineProperty, gs = Object.getOwnPropertyDescriptor, ms = (t, e, n, i) => {
1507
- for (var r = i > 1 ? void 0 : i ? gs(e, n) : e, o = t.length - 1, s; o >= 0; o--)
1508
- (s = t[o]) && (r = (i ? s(e, n, r) : s(r)) || r);
1509
- return i && r && hs(e, n, r), r;
1508
+ nt = po([
1509
+ Rt(0, R(ct)),
1510
+ Rt(1, ie),
1511
+ Rt(2, R(wn))
1512
+ ], nt);
1513
+ var ho = Object.defineProperty, go = Object.getOwnPropertyDescriptor, mo = (t, e, n, i) => {
1514
+ for (var r = i > 1 ? void 0 : i ? go(e, n) : e, s = t.length - 1, o; s >= 0; s--)
1515
+ (o = t[s]) && (r = (i ? o(e, n, r) : o(r)) || r);
1516
+ return i && r && ho(e, n, r), r;
1510
1517
  }, Z = (t, e) => (n, i) => e(n, i, t);
1511
- let tt = class extends z {
1512
- constructor(t, e, n, i, r, o, s, c, u, p) {
1513
- super(), this._hoverManagerService = t, this._sheetsHyperLinkPopupService = e, this._renderManagerService = n, this._permissionService = i, this._sheetPermissionInterceptorBaseController = r, this._commandService = o, this._editorBridgeService = s, this._textSelectionManagerService = c, this._univerInstanceService = u, this._zenZoneService = p, this._initHoverListener(), this._initCommandListener(), this._initHoverEditingListener(), this._initTextSelectionListener(), this._initZenEditor();
1518
+ let rt = class extends Y {
1519
+ constructor(t, e, n, i, r, s, o, c, l, p) {
1520
+ super(), this._hoverManagerService = t, this._sheetsHyperLinkPopupService = e, this._renderManagerService = n, this._permissionService = i, this._sheetPermissionInterceptorBaseController = r, this._commandService = s, this._editorBridgeService = o, this._textSelectionManagerService = c, this._univerInstanceService = l, this._zenZoneService = p, this._initHoverListener(), this._initCommandListener(), this._initHoverEditingListener(), this._initTextSelectionListener(), this._initZenEditor();
1514
1521
  }
1515
1522
  _getLinkPermission(t) {
1516
- const { unitId: e, subUnitId: n, row: i, col: r } = t, o = this._univerInstanceService.getUnit(e, k.UNIVER_SHEET);
1517
- if (!(o == null ? void 0 : o.getSheetBySheetId(n)))
1523
+ const { unitId: e, subUnitId: n, row: i, col: r } = t, s = this._univerInstanceService.getUnit(e, O.UNIVER_SHEET);
1524
+ if (!(s == null ? void 0 : s.getSheetBySheetId(n)))
1518
1525
  return {
1519
1526
  viewPermission: !1,
1520
1527
  editPermission: !1,
1521
1528
  copyPermission: !1
1522
1529
  };
1523
1530
  const c = this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
1524
- workbookTypes: [Dr],
1525
- worksheetTypes: [$r],
1526
- rangeTypes: [jr]
1527
- }, [{ startRow: i, startColumn: r, endRow: i, endColumn: r }]), u = this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
1528
- workbookTypes: [Ot],
1529
- worksheetTypes: [Tt, xt],
1530
- rangeTypes: [Nt]
1531
- }, [{ startRow: i, startColumn: r, endRow: i, endColumn: r }]), p = this._permissionService.composePermission([new Br(e).id, new Vr(e, n).id]).every((l) => l.value);
1531
+ workbookTypes: [jr],
1532
+ worksheetTypes: [Br],
1533
+ rangeTypes: [Ar]
1534
+ }, [{ startRow: i, startColumn: r, endRow: i, endColumn: r }]), l = this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
1535
+ workbookTypes: [xt],
1536
+ worksheetTypes: [Nt, Mt],
1537
+ rangeTypes: [Ut]
1538
+ }, [{ startRow: i, startColumn: r, endRow: i, endColumn: r }]), p = this._permissionService.composePermission([new Vr(e).id, new Fr(e, n).id]).every((u) => u.value);
1532
1539
  return {
1533
1540
  viewPermission: c,
1534
- editPermission: u,
1541
+ editPermission: l,
1535
1542
  copyPermission: p
1536
1543
  };
1537
1544
  }
1538
1545
  _initHoverListener() {
1539
1546
  this.disposeWithMe(
1540
1547
  // hover over not editing cell
1541
- this._hoverManagerService.currentRichText$.pipe(Ae(200)).subscribe((t) => {
1542
- var P, O;
1548
+ this._hoverManagerService.currentRichText$.pipe(We(200)).subscribe((t) => {
1549
+ var L, k;
1543
1550
  if (!t) {
1544
1551
  this._sheetsHyperLinkPopupService.hideCurrentPopup();
1545
1552
  return;
1546
1553
  }
1547
- const { unitId: e, subUnitId: n, row: i, col: r } = t, o = this._renderManagerService.getRenderById(e);
1548
- if (!o)
1554
+ const { unitId: e, subUnitId: n, row: i, col: r } = t, s = this._renderManagerService.getRenderById(e);
1555
+ if (!s)
1549
1556
  return;
1550
- const s = this._univerInstanceService.getUnit(e, k.UNIVER_SHEET), c = s == null ? void 0 : s.getSheetBySheetId(n);
1557
+ const o = this._univerInstanceService.getUnit(e, O.UNIVER_SHEET), c = o == null ? void 0 : o.getSheetBySheetId(n);
1551
1558
  if (!c)
1552
1559
  return;
1553
- if (!o.with(Nr).active) {
1560
+ if (!s.with(Ur).active) {
1554
1561
  this._sheetsHyperLinkPopupService.hideCurrentPopup(f.VIEWING);
1555
1562
  return;
1556
1563
  }
1557
- const p = (P = o == null ? void 0 : o.with(sn).getWorksheetSkeleton(n)) == null ? void 0 : P.skeleton, l = r, g = i;
1558
- let d = g, _ = l;
1559
- p && p.overflowCache.forValue((J, D, Y) => {
1560
- ye.contains(Y, { startColumn: l, endColumn: l, startRow: g, endRow: g }) && (d = J, _ = D);
1564
+ const p = (L = s == null ? void 0 : s.with(an).getWorksheetSkeleton(n)) == null ? void 0 : L.skeleton, u = r, g = i;
1565
+ let d = g, v = u;
1566
+ p && p.overflowCache.forValue((X, D, z) => {
1567
+ ye.contains(z, { startColumn: u, endColumn: u, startRow: g, endRow: g }) && (d = X, v = D);
1561
1568
  });
1562
- const { viewPermission: C, editPermission: v, copyPermission: b } = this._getLinkPermission(t);
1563
- if (!C) {
1569
+ const { viewPermission: I, editPermission: _, copyPermission: b } = this._getLinkPermission(t);
1570
+ if (!I) {
1564
1571
  this._sheetsHyperLinkPopupService.hideCurrentPopup();
1565
1572
  return;
1566
1573
  }
1567
- const a = c.getCellStyleOnly(d, _), w = s.getStyles().getStyleByCell(a), M = (O = w == null ? void 0 : w.tr) == null ? void 0 : O.a;
1574
+ const a = c.getCellStyleOnly(d, v), w = o.getStyles().getStyleByCell(a), M = (k = w == null ? void 0 : w.tr) == null ? void 0 : k.a;
1568
1575
  if (!M && !t.customRange) {
1569
1576
  this._sheetsHyperLinkPopupService.hideCurrentPopup();
1570
1577
  return;
1571
1578
  }
1572
1579
  this._sheetsHyperLinkPopupService.showPopup({
1573
1580
  row: d,
1574
- col: _,
1575
- editPermission: v,
1581
+ col: v,
1582
+ editPermission: _,
1576
1583
  copyPermission: b,
1577
1584
  customRange: t.customRange,
1578
1585
  customRangeRect: t.rect,
@@ -1588,38 +1595,38 @@ let tt = class extends z {
1588
1595
  let t = null;
1589
1596
  this.disposeWithMe(
1590
1597
  this._editorBridgeService.currentEditCellState$.pipe(ue((e) => this._editorBridgeService.visible$.pipe(le((n) => ({ visible: n, state: e }))))).subscribe(({ visible: e, state: n }) => {
1591
- if (!n || n.editorUnitId !== Ie)
1598
+ if (!n || n.editorUnitId !== Ce)
1592
1599
  return;
1593
1600
  if (!e.visible) {
1594
1601
  t == null || t.unsubscribe(), this._sheetsHyperLinkPopupService.hideCurrentPopup(f.EDITING), this._sheetsHyperLinkPopupService.endEditing(f.EDITING);
1595
1602
  return;
1596
1603
  }
1597
- const { editorUnitId: i, unitId: r, sheetId: o, row: s, column: c } = n, u = this._renderManagerService.getRenderById(i);
1598
- if (!u)
1604
+ const { editorUnitId: i, unitId: r, sheetId: s, row: o, column: c } = n, l = this._renderManagerService.getRenderById(i);
1605
+ if (!l)
1599
1606
  return;
1600
- const { editPermission: p, viewPermission: l, copyPermission: g } = this._getLinkPermission({ unitId: r, subUnitId: o, row: s, col: c }), d = u.with(cn);
1601
- l && (t == null || t.unsubscribe(), t = d.hoverCustomRanges$.pipe(Ae(200)).subscribe((_) => {
1607
+ const { editPermission: p, viewPermission: u, copyPermission: g } = this._getLinkPermission({ unitId: r, subUnitId: s, row: o, col: c }), d = l.with(un);
1608
+ u && (t == null || t.unsubscribe(), t = d.hoverCustomRanges$.pipe(We(200)).subscribe((v) => {
1602
1609
  var w, M;
1603
- const C = _.find((P) => P.range.rangeType === We.HYPERLINK);
1604
- if (!C) {
1610
+ const I = v.find((L) => L.range.rangeType === Ge.HYPERLINK);
1611
+ if (!I) {
1605
1612
  this._sheetsHyperLinkPopupService.hideCurrentPopup();
1606
1613
  return;
1607
1614
  }
1608
- const v = C.rects[C.rects.length - 1];
1609
- if (!((M = (w = this._renderManagerService.getRenderById(r)) == null ? void 0 : w.with(sn).getWorksheetSkeleton(o)) == null ? void 0 : M.skeleton) || !v)
1615
+ const _ = I.rects[I.rects.length - 1];
1616
+ if (!((M = (w = this._renderManagerService.getRenderById(r)) == null ? void 0 : w.with(an).getWorksheetSkeleton(s)) == null ? void 0 : M.skeleton) || !_)
1610
1617
  return;
1611
- const a = u.engine.getCanvasElement().getBoundingClientRect();
1618
+ const a = l.engine.getCanvasElement().getBoundingClientRect();
1612
1619
  this._sheetsHyperLinkPopupService.showPopup({
1613
1620
  unitId: r,
1614
- subUnitId: o,
1615
- row: s,
1621
+ subUnitId: s,
1622
+ row: o,
1616
1623
  col: c,
1617
- customRange: C.range,
1624
+ customRange: I.range,
1618
1625
  customRangeRect: {
1619
- left: v.left + a.left,
1620
- top: v.top + a.top,
1621
- bottom: v.bottom + a.top,
1622
- right: v.right + a.left
1626
+ left: _.left + a.left,
1627
+ top: _.top + a.top,
1628
+ bottom: _.bottom + a.top,
1629
+ right: _.right + a.left
1623
1630
  },
1624
1631
  editPermission: p,
1625
1632
  copyPermission: g,
@@ -1640,20 +1647,20 @@ let tt = class extends z {
1640
1647
  this._univerInstanceService.focused$.pipe(
1641
1648
  ue((t) => {
1642
1649
  const e = t === x ? this._renderManagerService.getRenderById(t) : null;
1643
- return e ? e.with(cn).hoverCustomRanges$.pipe(Ae(200)) : new ui((n) => {
1650
+ return e ? e.with(un).hoverCustomRanges$.pipe(We(200)) : new pi((n) => {
1644
1651
  n.next(null);
1645
1652
  });
1646
1653
  })
1647
1654
  ).subscribe((t) => {
1648
- const e = t == null ? void 0 : t.find((i) => i.range.rangeType === We.HYPERLINK), n = this._editorBridgeService.getEditCellState();
1655
+ const e = t == null ? void 0 : t.find((i) => i.range.rangeType === Ge.HYPERLINK), n = this._editorBridgeService.getEditCellState();
1649
1656
  if (e && n) {
1650
- const { unitId: i, sheetId: r, row: o, column: s } = n, { editPermission: c, viewPermission: u, copyPermission: p } = this._getLinkPermission({ unitId: i, subUnitId: r, row: o, col: s });
1651
- u && this._sheetsHyperLinkPopupService.showPopup({
1657
+ const { unitId: i, sheetId: r, row: s, column: o } = n, { editPermission: c, viewPermission: l, copyPermission: p } = this._getLinkPermission({ unitId: i, subUnitId: r, row: s, col: o });
1658
+ l && this._sheetsHyperLinkPopupService.showPopup({
1652
1659
  type: f.ZEN_EDITOR,
1653
1660
  unitId: i,
1654
1661
  subUnitId: r,
1655
- row: o,
1656
- col: s,
1662
+ row: s,
1663
+ col: o,
1657
1664
  customRange: e.range,
1658
1665
  editPermission: c,
1659
1666
  copyPermission: p
@@ -1666,35 +1673,35 @@ let tt = class extends z {
1666
1673
  _initTextSelectionListener() {
1667
1674
  this.disposeWithMe(
1668
1675
  this._textSelectionManagerService.textSelection$.subscribe((t) => {
1669
- t && t.unitId === Ie && this._sheetsHyperLinkPopupService.endEditing(f.EDITING);
1676
+ t && t.unitId === Ce && this._sheetsHyperLinkPopupService.endEditing(f.EDITING);
1670
1677
  })
1671
1678
  );
1672
1679
  }
1673
1680
  _initCommandListener() {
1674
- const t = [Ar.id, Fr.id, Wr.id];
1681
+ const t = [Wr.id, Zr.id, Gr.id];
1675
1682
  this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
1676
1683
  t.includes(e.id) && this._sheetsHyperLinkPopupService.hideCurrentPopup();
1677
1684
  }));
1678
1685
  }
1679
1686
  };
1680
- tt = ms([
1681
- Z(0, R(xr)),
1687
+ rt = mo([
1688
+ Z(0, R(Mr)),
1682
1689
  Z(1, R(G)),
1683
- Z(2, R(He)),
1684
- Z(3, R(cr)),
1685
- Z(4, R(Rn)),
1690
+ Z(2, R($e)),
1691
+ Z(3, R(ur)),
1692
+ Z(4, R(wn)),
1686
1693
  Z(5, ie),
1687
1694
  Z(6, re),
1688
- Z(7, R(Ue)),
1695
+ Z(7, R(De)),
1689
1696
  Z(8, K),
1690
- Z(9, ut)
1691
- ], tt);
1692
- var fs = Object.defineProperty, vs = Object.getOwnPropertyDescriptor, Zn = (t, e, n, i) => {
1693
- for (var r = i > 1 ? void 0 : i ? vs(e, n) : e, o = t.length - 1, s; o >= 0; o--)
1694
- (s = t[o]) && (r = (i ? s(e, n, r) : s(r)) || r);
1695
- return i && r && fs(e, n, r), r;
1696
- }, Lt = (t, e) => (n, i) => e(n, i, t);
1697
- let bt = class extends z {
1697
+ Z(9, pt)
1698
+ ], rt);
1699
+ var fo = Object.defineProperty, vo = Object.getOwnPropertyDescriptor, Kn = (t, e, n, i) => {
1700
+ for (var r = i > 1 ? void 0 : i ? vo(e, n) : e, s = t.length - 1, o; s >= 0; s--)
1701
+ (o = t[s]) && (r = (i ? o(e, n, r) : o(r)) || r);
1702
+ return i && r && fo(e, n, r), r;
1703
+ }, wt = (t, e) => (n, i) => e(n, i, t);
1704
+ let Ot = class extends Y {
1698
1705
  constructor(t, e) {
1699
1706
  super(), this._context = t, this._hyperLinkModel = e, this._initSkeletonChange();
1700
1707
  }
@@ -1703,27 +1710,27 @@ let bt = class extends z {
1703
1710
  var e;
1704
1711
  (e = this._context.mainComponent) == null || e.makeForceDirty();
1705
1712
  };
1706
- this.disposeWithMe(this._hyperLinkModel.linkUpdate$.pipe(Ae(16)).subscribe(() => {
1713
+ this.disposeWithMe(this._hyperLinkModel.linkUpdate$.pipe(We(16)).subscribe(() => {
1707
1714
  t();
1708
1715
  }));
1709
1716
  }
1710
1717
  };
1711
- bt = Zn([
1712
- Lt(1, R(lt))
1713
- ], bt);
1714
- let nt = class extends z {
1718
+ Ot = Kn([
1719
+ wt(1, R(dt))
1720
+ ], Ot);
1721
+ let it = class extends Y {
1715
1722
  constructor(t, e) {
1716
1723
  super(), this._sheetInterceptorService = t, this._hyperLinkModel = e, this._initViewModelIntercept();
1717
1724
  }
1718
1725
  _initViewModelIntercept() {
1719
1726
  this.disposeWithMe(
1720
1727
  this._sheetInterceptorService.intercept(
1721
- Gr.CELL_CONTENT,
1728
+ Yr.CELL_CONTENT,
1722
1729
  {
1723
- effect: lr.Value,
1730
+ effect: dr.Value,
1724
1731
  priority: 100,
1725
1732
  handler: (t, e, n) => {
1726
- const { row: i, col: r, unitId: o, subUnitId: s } = e, c = this._hyperLinkModel.getHyperLinkByLocation(o, s, i, r);
1733
+ const { row: i, col: r, unitId: s, subUnitId: o } = e, c = this._hyperLinkModel.getHyperLinkByLocation(s, o, i, r);
1727
1734
  return n(c ? {
1728
1735
  ...t,
1729
1736
  linkUrl: c.payload,
@@ -1735,83 +1742,83 @@ let nt = class extends z {
1735
1742
  );
1736
1743
  }
1737
1744
  };
1738
- nt = Zn([
1739
- Lt(0, R(Zr)),
1740
- Lt(1, R(lt))
1741
- ], nt);
1742
- const _s = {
1745
+ it = Kn([
1746
+ wt(0, R(Kr)),
1747
+ wt(1, R(dt))
1748
+ ], it);
1749
+ const _o = {
1743
1750
  [Xr.OTHERS]: {
1744
1751
  [de.id]: {
1745
1752
  order: 2,
1746
- menuItemFactory: ss
1753
+ menuItemFactory: io
1747
1754
  },
1748
- [qe(de.id)]: {
1755
+ [Qe(de.id)]: {
1749
1756
  order: 2,
1750
- menuItemFactory: os
1757
+ menuItemFactory: oo
1751
1758
  }
1752
1759
  },
1753
- [qr.MAIN_AREA]: {
1754
- [Jr.OTHERS]: {
1760
+ [Qr.MAIN_AREA]: {
1761
+ [ei.OTHERS]: {
1755
1762
  order: 1,
1756
1763
  [de.id]: {
1757
1764
  order: 0,
1758
- menuItemFactory: rs
1765
+ menuItemFactory: no
1759
1766
  },
1760
- [qe(de.id)]: {
1767
+ [Qe(de.id)]: {
1761
1768
  order: 0,
1762
- menuItemFactory: is
1769
+ menuItemFactory: ro
1763
1770
  }
1764
1771
  }
1765
1772
  }
1766
1773
  };
1767
- var Ss = Object.defineProperty, Cs = Object.getOwnPropertyDescriptor, Is = (t, e, n, i) => {
1768
- for (var r = i > 1 ? void 0 : i ? Cs(e, n) : e, o = t.length - 1, s; o >= 0; o--)
1769
- (s = t[o]) && (r = (i ? s(e, n, r) : s(r)) || r);
1770
- return i && r && Ss(e, n, r), r;
1771
- }, Oe = (t, e) => (n, i) => e(n, i, t);
1772
- let rt = class extends z {
1774
+ var So = Object.defineProperty, Io = Object.getOwnPropertyDescriptor, Co = (t, e, n, i) => {
1775
+ for (var r = i > 1 ? void 0 : i ? Io(e, n) : e, s = t.length - 1, o; s >= 0; s--)
1776
+ (o = t[s]) && (r = (i ? o(e, n, r) : o(r)) || r);
1777
+ return i && r && So(e, n, r), r;
1778
+ }, Te = (t, e) => (n, i) => e(n, i, t);
1779
+ let ot = class extends Y {
1773
1780
  constructor(t, e, n, i, r) {
1774
1781
  super(), this._componentManager = t, this._commandService = e, this._menuManagerService = n, this._injector = i, this._shortcutService = r, this._initComponents(), this._initCommands(), this._initMenus(), this._initShortCut();
1775
1782
  }
1776
1783
  _initComponents() {
1777
1784
  [
1785
+ [qe, qe.componentKey],
1778
1786
  [ze, ze.componentKey],
1779
- [Ke, Ke.componentKey],
1780
- [Ut, "LinkSingle"]
1787
+ [Dt, "LinkSingle"]
1781
1788
  ].forEach(([t, e]) => {
1782
1789
  this._componentManager.register(e, t);
1783
1790
  });
1784
1791
  }
1785
1792
  _initCommands() {
1786
1793
  [
1787
- Dt,
1788
- Ye,
1789
- $t,
1794
+ jt,
1795
+ Je,
1796
+ Bt,
1790
1797
  de
1791
1798
  ].forEach((t) => {
1792
1799
  this._commandService.registerCommand(t);
1793
1800
  });
1794
1801
  }
1795
1802
  _initMenus() {
1796
- this._menuManagerService.mergeMenu(_s);
1803
+ this._menuManagerService.mergeMenu(_o);
1797
1804
  }
1798
1805
  _initShortCut() {
1799
- this._shortcutService.registerShortcut(Wn);
1806
+ this._shortcutService.registerShortcut(Gn);
1800
1807
  }
1801
1808
  };
1802
- rt = Is([
1803
- Oe(0, R(Qr)),
1804
- Oe(1, ie),
1805
- Oe(2, ti),
1806
- Oe(3, R(at)),
1807
- Oe(4, R(ei))
1808
- ], rt);
1809
- var ys = Object.defineProperty, Es = Object.getOwnPropertyDescriptor, Rs = (t, e, n, i) => {
1810
- for (var r = i > 1 ? void 0 : i ? Es(e, n) : e, o = t.length - 1, s; o >= 0; o--)
1811
- (s = t[o]) && (r = (i ? s(e, n, r) : s(r)) || r);
1812
- return i && r && ys(e, n, r), r;
1813
- }, vn = (t, e) => (n, i) => e(n, i, t);
1814
- let it = class extends z {
1809
+ ot = Co([
1810
+ Te(0, R(ti)),
1811
+ Te(1, ie),
1812
+ Te(2, ri),
1813
+ Te(3, R(lt)),
1814
+ Te(4, R(ni))
1815
+ ], ot);
1816
+ var yo = Object.defineProperty, Eo = Object.getOwnPropertyDescriptor, Ro = (t, e, n, i) => {
1817
+ for (var r = i > 1 ? void 0 : i ? Eo(e, n) : e, s = t.length - 1, o; s >= 0; s--)
1818
+ (o = t[s]) && (r = (i ? o(e, n, r) : o(r)) || r);
1819
+ return i && r && yo(e, n, r), r;
1820
+ }, Cn = (t, e) => (n, i) => e(n, i, t);
1821
+ let st = class extends Y {
1815
1822
  constructor(t, e) {
1816
1823
  super(), this._parserService = t, this._resolverService = e, this._handleInitUrl();
1817
1824
  }
@@ -1823,57 +1830,57 @@ let it = class extends z {
1823
1830
  }
1824
1831
  }
1825
1832
  };
1826
- it = Rs([
1827
- vn(0, R(wt)),
1828
- vn(1, R(pe))
1829
- ], it);
1830
- var Gn = Object.defineProperty, Ps = Object.getOwnPropertyDescriptor, Ls = (t, e, n) => e in t ? Gn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, bs = (t, e, n, i) => {
1831
- for (var r = i > 1 ? void 0 : i ? Ps(e, n) : e, o = t.length - 1, s; o >= 0; o--)
1832
- (s = t[o]) && (r = (i ? s(e, n, r) : s(r)) || r);
1833
- return i && r && Gn(e, n, r), r;
1834
- }, _n = (t, e) => (n, i) => e(n, i, t), Kn = (t, e, n) => Ls(t, typeof e != "symbol" ? e + "" : e, n);
1835
- let st = class extends dr {
1836
- constructor(t = vi, e, n) {
1833
+ st = Ro([
1834
+ Cn(0, R(kt)),
1835
+ Cn(1, R(pe))
1836
+ ], st);
1837
+ var Yn = Object.defineProperty, Lo = Object.getOwnPropertyDescriptor, Po = (t, e, n) => e in t ? Yn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, bo = (t, e, n, i) => {
1838
+ for (var r = i > 1 ? void 0 : i ? Lo(e, n) : e, s = t.length - 1, o; s >= 0; s--)
1839
+ (o = t[s]) && (r = (i ? o(e, n, r) : o(r)) || r);
1840
+ return i && r && Yn(e, n, r), r;
1841
+ }, yn = (t, e) => (n, i) => e(n, i, t), zn = (t, e, n) => Po(t, typeof e != "symbol" ? e + "" : e, n);
1842
+ let at = class extends hr {
1843
+ constructor(t = Si, e, n) {
1837
1844
  super(), this._config = t, this._injector = e, this._configService = n;
1838
1845
  const { menu: i, ...r } = this._config;
1839
- i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(Nn, r);
1846
+ i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(Dn, r);
1840
1847
  }
1841
1848
  onStarting() {
1842
1849
  [
1843
1850
  [pe],
1844
1851
  [G],
1845
- [Hn],
1846
- [nt],
1847
- [tt],
1852
+ [$n],
1853
+ [it],
1848
1854
  [rt],
1849
- [Qe],
1850
- [Ge],
1851
- [et],
1852
- [it]
1853
- ].forEach((e) => this._injector.add(e)), this._injector.get(nt);
1855
+ [ot],
1856
+ [tt],
1857
+ [Ye],
1858
+ [nt],
1859
+ [st]
1860
+ ].forEach((e) => this._injector.add(e)), this._injector.get(it);
1854
1861
  }
1855
1862
  onReady() {
1856
- this._injector.get(He).registerRenderModule(k.UNIVER_SHEET, [bt]), this._injector.get(Qe), this._injector.get(Ge), this._injector.get(rt);
1863
+ this._injector.get($e).registerRenderModule(O.UNIVER_SHEET, [Ot]), this._injector.get(tt), this._injector.get(Ye), this._injector.get(ot);
1857
1864
  }
1858
1865
  onRendered() {
1859
- this._injector.get(et), this._injector.get(it), this._injector.get(tt);
1866
+ this._injector.get(nt), this._injector.get(st), this._injector.get(rt);
1860
1867
  }
1861
1868
  };
1862
- Kn(st, "pluginName", Mt);
1863
- Kn(st, "type", k.UNIVER_SHEET);
1864
- st = bs([
1865
- ur(Sr, si),
1866
- _n(1, R(at)),
1867
- _n(2, Cn)
1868
- ], st);
1869
+ zn(at, "pluginName", Ht);
1870
+ zn(at, "type", O.UNIVER_SHEET);
1871
+ at = bo([
1872
+ pr(Cr, ai),
1873
+ yn(1, R(lt)),
1874
+ yn(2, Rn)
1875
+ ], at);
1869
1876
  export {
1870
- Ye as CloseHyperLinkPopupOperation,
1871
- $t as InsertHyperLinkOperation,
1872
- Wn as InsertLinkShortcut,
1873
- Dt as OpenHyperLinkEditPanelOperation,
1874
- Ge as SheetsHyperLinkCopyPasteController,
1877
+ Je as CloseHyperLinkPopupOperation,
1878
+ Bt as InsertHyperLinkOperation,
1879
+ Gn as InsertLinkShortcut,
1880
+ jt as OpenHyperLinkEditPanelOperation,
1881
+ Ye as SheetsHyperLinkCopyPasteController,
1875
1882
  G as SheetsHyperLinkPopupService,
1876
1883
  pe as SheetsHyperLinkResolverService,
1877
- Hn as SheetsHyperLinkSidePanelService,
1878
- st as UniverSheetsHyperLinkUIPlugin
1884
+ $n as SheetsHyperLinkSidePanelService,
1885
+ at as UniverSheetsHyperLinkUIPlugin
1879
1886
  };