@univerjs/sheets-formula-ui 0.10.12 → 0.10.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -1,61 +1,61 @@
1
- var Gr = Object.defineProperty;
2
- var Zr = (e, t, n) => t in e ? Gr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var q = (e, t, n) => Zr(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { CommandType as Ne, ICommandService as pe, createIdentifier as zr, IContextService as an, IUniverInstanceService as ne, Rectangle as tr, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as ln, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as nr, DEFAULT_EMPTY_DOCUMENT_VALUE as rr, isRealNum as Xr, CellValueType as Mn, getCellValueType as Qr, Inject as j, Disposable as dt, ObjectMatrix as Le, Range as Jr, Tools as un, LocaleService as ht, isICellData as eo, isFormulaString as De, isFormulaId as lt, generateRandomId as qt, Direction as de, Injector as Et, UniverInstanceType as H, ThemeService as It, ILogService as to, toDisposable as or, ColorKit as dn, RxDisposable as no, InterceptorEffectEnum as ro, FOCUSING_DOC as oo, FOCUSING_UNIVER_EDITOR as so, DisposableCollection as qe, RANGE_TYPE as Ce, getBodySlice as wn, EDITOR_ACTIVATED as kn, createInternalEditorID as io, BuildTextUtils as co, IConfigService as sr, RichTextBuilder as ao, DependentOn as lo, Plugin as uo, merge as ho, registerDependencies as fo, touchDependencies as go } from "@univerjs/core";
5
- import { SheetPasteCommand as mo, PREDEFINED_HOOK_NAME as ct, IEditorBridgeService as hn, SetCellEditVisibleOperation as ir, HoverManagerService as po, CellAlertManagerService as vo, CellAlertType as So, IAutoFillService as Co, APPLY_TYPE as _o, DATA_TYPE as An, ISheetClipboardService as Ro, COPY_TYPE as cr, SheetSkeletonManagerService as Kt, attachSelectionWithCoord as nn, SelectionControl as ar, SELECTION_SHAPE_DEPTH as Eo, useActiveWorkbook as Io, getCurrentRangeDisable$ as Ye, PASTE_SPECIAL_MENU_ID as bo, whenFormulaEditorActivated as bt, whenSheetEditorFocused as yo, SheetsUIPart as To, BaseSelectionRenderService as Oo, getCoordByOffset as Fn, checkInHeaderRanges as Dn, getAllSelection as No, genNormalSelectionStyle as lr, getSheetObject as xo, MoveSelectionCommand as Ln, JumpOver as $n, ExpandSelectionCommand as Pn, EMBEDDING_FORMULA_EDITOR as Mo, IMarkSelectionService as wo, RANGE_SELECTOR_COMPONENT_KEY as ko, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as Ao } from "@univerjs/sheets-ui";
6
- import { sequenceNodeType as Q, serializeRange as _e, FormulaDataModel as yt, LexerTreeBuilder as Re, ErrorType as ue, extractFormulaError as ur, SetFormulaCalculationResultMutation as Fo, SetArrayFormulaDataMutation as Do, SetFormulaCalculationStopMutation as Lo, FunctionType as dr, matchToken as Ke, deserializeRangeWithSheetWithCache as $o, matchRefDrawToken as Po, isFormulaLexerToken as Uo, deserializeRangeWithSheet as ft, serializeRangeToRefString as Vo, serializeRangeWithSheet as _t, serializeRangeWithSpreadsheet as Wo, generateStringWithSequence as Ho, operatorToken as hr, UniverFormulaEnginePlugin as Bo } from "@univerjs/engine-formula";
7
- import { Subject as pt, debounceTime as fn, combineLatestWith as jo, map as fr, switchMap as qo, of as Un, Observable as Ko, BehaviorSubject as gr, throttleTime as Yo, filter as mr, distinctUntilChanged as Go, merge as Zo } from "rxjs";
8
- import { IEditorService as Ge, DocSelectionRenderService as pr, ReplaceTextRunsCommand as Vn, MoveSelectionOperation as zo, MoveCursorOperation as Xo, useKeyboardEvent as Qo, useResize as Jo, DocBackScrollRenderController as es, RichTextEditor as ts } from "@univerjs/docs-ui";
9
- import { DeviceInputEventType as xe, IRenderManagerService as Me, ScrollTimerType as Qt, SHEET_VIEWPORT_KEY as Wn, Vector2 as Hn } from "@univerjs/engine-render";
10
- import { SheetsSelectionsService as gn, getSheetCommandTarget as vr, getCellAtRowCol as ns, SetSelectionsOperation as mn, SheetInterceptorService as pn, ReorderRangeCommand as rs, SetRangeValuesMutation as Dt, SetRangeValuesUndoMutationFactory as os, BEFORE_CELL_EDIT as ss, SetWorksheetRowAutoHeightMutation as is, INTERCEPTOR_POINT as cs, WorksheetSetCellValuePermission as Ze, WorksheetEditPermission as ze, RangeProtectionPermissionEditPoint as Xe, WorkbookEditablePermission as Qe, IRefSelectionsService as Yt, SelectionMoveType as Jt, convertSelectionDataToRange as as, setEndForRange as ls, REF_SELECTIONS_ENABLED as Bn, SetWorksheetActiveOperation as jn } from "@univerjs/sheets";
11
- import { InsertFunctionCommand as us, TriggerCalculationController as ds, IDescriptionService as Gt, QuickSumCommand as hs, UniverSheetsFormulaPlugin as fs } from "@univerjs/sheets-formula";
12
- import { ISidebarService as vn, IZenZoneService as gs, useDependency as T, useObservable as Se, ProgressBar as ms, MenuItemType as Je, getMenuHiddenObservable as gt, IClipboardInterfaceService as qn, RibbonFormulasGroup as Kn, KeyCode as L, MetaKeys as P, IMenuManagerService as ps, IShortcutService as Zt, IUIPartsService as Sr, ComponentManager as Cr, connectInjector as _r, useEvent as te, RectPopup as rn, IContextMenuService as vs, useUpdateEffect as Ss, BuiltInUIPart as Cs } from "@univerjs/ui";
13
- import { jsx as M, jsxs as W, Fragment as _s } from "react/jsx-runtime";
14
- import { useCallback as Lt, useState as V, forwardRef as we, useRef as z, createElement as et, useEffect as $, useMemo as ie, useLayoutEffect as $t, useImperativeHandle as Rs } from "react";
15
- import { clsx as re, scrollbarClassName as ut, borderLeftClassName as Es, Select as Is, Input as Rr, borderClassName as Sn, Button as at, borderTopClassName as bs, Tooltip as ys, Dialog as Ts } from "@univerjs/design";
16
- import { DocSelectionManagerService as Er } from "@univerjs/docs";
17
- import { debounceTime as Os } from "rxjs/operators";
18
- const Cn = {
1
+ var Yr = Object.defineProperty;
2
+ var Gr = (e, t, n) => t in e ? Yr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var j = (e, t, n) => Gr(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { CommandType as Ne, ICommandService as me, createIdentifier as Zr, IContextService as cn, IUniverInstanceService as ne, Rectangle as er, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as an, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as tr, DEFAULT_EMPTY_DOCUMENT_VALUE as nr, isRealNum as zr, CellValueType as xn, getCellValueType as Xr, Inject as q, Disposable as ut, ObjectMatrix as Fe, Range as Qr, Tools as ln, LocaleService as dt, isICellData as Jr, isFormulaString as Ae, isFormulaId as at, generateRandomId as qt, Direction as de, Injector as Rt, UniverInstanceType as H, ThemeService as It, ILogService as eo, toDisposable as rr, ColorKit as un, RxDisposable as to, InterceptorEffectEnum as no, FOCUSING_DOC as ro, FOCUSING_UNIVER_EDITOR as oo, DisposableCollection as qe, RANGE_TYPE as ve, getBodySlice as Mn, EDITOR_ACTIVATED as wn, createInternalEditorID as so, BuildTextUtils as io, IConfigService as or, RichTextBuilder as co, DependentOn as ao, Plugin as lo, merge as uo, registerDependencies as ho, touchDependencies as fo } from "@univerjs/core";
5
+ import { SheetPasteCommand as go, PREDEFINED_HOOK_NAME as it, IEditorBridgeService as dn, SetCellEditVisibleOperation as sr, HoverManagerService as mo, CellAlertManagerService as po, CellAlertType as So, IAutoFillService as vo, APPLY_TYPE as Co, DATA_TYPE as kn, ISheetClipboardService as _o, COPY_TYPE as ir, SheetSkeletonManagerService as jt, attachSelectionWithCoord as tn, SelectionControl as cr, SELECTION_SHAPE_DEPTH as Ro, useActiveWorkbook as Io, getCurrentRangeDisable$ as Ke, PASTE_SPECIAL_MENU_ID as Eo, whenFormulaEditorActivated as Et, whenSheetEditorFocused as bo, SheetsUIPart as yo, BaseSelectionRenderService as To, getCoordByOffset as An, checkInHeaderRanges as Fn, getAllSelection as No, genNormalSelectionStyle as ar, getSheetObject as Oo, MoveSelectionCommand as Dn, JumpOver as Ln, ExpandSelectionCommand as $n, EMBEDDING_FORMULA_EDITOR as xo, IMarkSelectionService as Mo, RANGE_SELECTOR_COMPONENT_KEY as wo, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as ko } from "@univerjs/sheets-ui";
6
+ import { sequenceNodeType as Q, serializeRange as Ce, FormulaDataModel as bt, LexerTreeBuilder as _e, ErrorType as ue, extractFormulaError as lr, SetFormulaCalculationResultMutation as Ao, SetArrayFormulaDataMutation as Fo, SetFormulaCalculationStopMutation as Do, FunctionType as ur, matchToken as je, deserializeRangeWithSheetWithCache as Lo, matchRefDrawToken as $o, isFormulaLexerToken as Po, deserializeRangeWithSheet as ht, serializeRangeToRefString as Uo, serializeRangeWithSheet as Ct, serializeRangeWithSpreadsheet as Vo, generateStringWithSequence as Wo, operatorToken as dr, UniverFormulaEnginePlugin as Ho } from "@univerjs/engine-formula";
7
+ import { Subject as mt, debounceTime as hn, combineLatestWith as Bo, map as hr, switchMap as qo, of as Pn, Observable as jo, BehaviorSubject as fr, throttleTime as Ko, filter as gr, distinctUntilChanged as Yo, merge as Go } from "rxjs";
8
+ import { IEditorService as Ye, DocSelectionRenderService as mr, ReplaceTextRunsCommand as Un, MoveSelectionOperation as Zo, MoveCursorOperation as zo, useKeyboardEvent as Xo, useResize as Qo, DocBackScrollRenderController as Jo, RichTextEditor as es } from "@univerjs/docs-ui";
9
+ import { DeviceInputEventType as Oe, IRenderManagerService as xe, ScrollTimerType as Xt, SHEET_VIEWPORT_KEY as Vn, Vector2 as Wn } from "@univerjs/engine-render";
10
+ import { SheetsSelectionsService as fn, getSheetCommandTarget as pr, getCellAtRowCol as ts, SetSelectionsOperation as gn, SheetInterceptorService as mn, ReorderRangeCommand as ns, SetRangeValuesMutation as Ft, SetRangeValuesUndoMutationFactory as rs, BEFORE_CELL_EDIT as os, SetWorksheetRowAutoHeightMutation as ss, INTERCEPTOR_POINT as is, WorksheetSetCellValuePermission as Ge, WorksheetEditPermission as Ze, RangeProtectionPermissionEditPoint as ze, WorkbookEditablePermission as Xe, IRefSelectionsService as Kt, SelectionMoveType as Qt, convertSelectionDataToRange as cs, setEndForRange as as, REF_SELECTIONS_ENABLED as Hn, SetWorksheetActiveOperation as Bn } from "@univerjs/sheets";
11
+ import { InsertFunctionCommand as ls, TriggerCalculationController as us, IDescriptionService as Yt, QuickSumCommand as ds, UniverSheetsFormulaPlugin as hs } from "@univerjs/sheets-formula";
12
+ import { ISidebarService as pn, IZenZoneService as fs, useDependency as T, useObservable as Se, ProgressBar as gs, MenuItemType as Qe, getMenuHiddenObservable as ft, IClipboardInterfaceService as qn, RibbonFormulasGroup as jn, KeyCode as L, MetaKeys as P, IMenuManagerService as ms, IShortcutService as Gt, IUIPartsService as Sr, ComponentManager as vr, connectInjector as Cr, useEvent as te, RectPopup as nn, IContextMenuService as ps, useUpdateEffect as Ss, BuiltInUIPart as vs } from "@univerjs/ui";
13
+ import { jsx as M, jsxs as W, Fragment as Cs } from "react/jsx-runtime";
14
+ import { useCallback as Dt, useState as V, useRef as z, createElement as Je, forwardRef as Le, useEffect as $, useMemo as ie, useLayoutEffect as Lt, useImperativeHandle as _s } from "react";
15
+ import { clsx as re, scrollbarClassName as lt, borderLeftClassName as Rs, Select as Is, Input as _r, borderClassName as Sn, Button as ct, borderTopClassName as Es, Tooltip as bs, Dialog as ys } from "@univerjs/design";
16
+ import { DocSelectionManagerService as Rr } from "@univerjs/docs";
17
+ import { debounceTime as Ts } from "rxjs/operators";
18
+ const vn = {
19
19
  id: "sheet.command.paste-formula",
20
20
  type: Ne.COMMAND,
21
- handler: async (e) => e.get(pe).executeCommand(mo.id, {
22
- value: ct.SPECIAL_PASTE_FORMULA
21
+ handler: async (e) => e.get(me).executeCommand(go.id, {
22
+ value: it.SPECIAL_PASTE_FORMULA
23
23
  })
24
- }, mt = {
24
+ }, gt = {
25
25
  id: "formula-ui.operation.select-editor-formula",
26
26
  type: Ne.OPERATION,
27
27
  handler: (e, t) => !0
28
28
  };
29
- var Ns = Object.getOwnPropertyDescriptor, xs = (e, t, n, o) => {
29
+ var Ns = Object.getOwnPropertyDescriptor, Os = (e, t, n, o) => {
30
30
  for (var r = o > 1 ? void 0 : o ? Ns(t, n) : t, s = e.length - 1, i; s >= 0; s--)
31
31
  (i = e[s]) && (r = i(r) || r);
32
32
  return r;
33
- }, Ms = (e, t) => (n, o) => t(n, o, e);
34
- const ws = "FORMULA_PROMPT_ACTIVATED", zt = zr("formula-ui.prompt-service");
35
- let on = class {
33
+ }, xs = (e, t) => (n, o) => t(n, o, e);
34
+ const Ms = "FORMULA_PROMPT_ACTIVATED", Zt = Zr("formula-ui.prompt-service");
35
+ let rn = class {
36
36
  constructor(e) {
37
- q(this, "_search$", new pt());
38
- q(this, "_help$", new pt());
39
- q(this, "_navigate$", new pt());
40
- q(this, "_accept$", new pt());
41
- q(this, "_acceptFormulaName$", new pt());
42
- q(this, "search$", this._search$.asObservable());
43
- q(this, "help$", this._help$.asObservable());
44
- q(this, "navigate$", this._navigate$.asObservable());
45
- q(this, "accept$", this._accept$.asObservable());
46
- q(this, "acceptFormulaName$", this._acceptFormulaName$.asObservable());
47
- q(this, "_searching", !1);
48
- q(this, "_helping", !1);
49
- q(this, "_sequenceNodes", []);
50
- q(this, "_isLockedOnSelectionChangeRefString", !1);
51
- q(this, "_isLockedOnSelectionInsertRefString", !1);
37
+ j(this, "_search$", new mt());
38
+ j(this, "_help$", new mt());
39
+ j(this, "_navigate$", new mt());
40
+ j(this, "_accept$", new mt());
41
+ j(this, "_acceptFormulaName$", new mt());
42
+ j(this, "search$", this._search$.asObservable());
43
+ j(this, "help$", this._help$.asObservable());
44
+ j(this, "navigate$", this._navigate$.asObservable());
45
+ j(this, "accept$", this._accept$.asObservable());
46
+ j(this, "acceptFormulaName$", this._acceptFormulaName$.asObservable());
47
+ j(this, "_searching", !1);
48
+ j(this, "_helping", !1);
49
+ j(this, "_sequenceNodes", []);
50
+ j(this, "_isLockedOnSelectionChangeRefString", !1);
51
+ j(this, "_isLockedOnSelectionInsertRefString", !1);
52
52
  this._contextService = e;
53
53
  }
54
54
  dispose() {
55
55
  this._search$.complete(), this._help$.complete(), this._navigate$.complete(), this._accept$.complete(), this._acceptFormulaName$.complete(), this._sequenceNodes = [];
56
56
  }
57
57
  search(e) {
58
- this._contextService.setContextValue(ws, e.visible), this._searching = e.visible, this._search$.next(e);
58
+ this._contextService.setContextValue(Ms, e.visible), this._searching = e.visible, this._search$.next(e);
59
59
  }
60
60
  isSearching() {
61
61
  return this._searching;
@@ -187,76 +187,76 @@ let on = class {
187
187
  return this._isLockedOnSelectionInsertRefString;
188
188
  }
189
189
  };
190
- on = xs([
191
- Ms(0, an)
192
- ], on);
193
- const ks = {
190
+ rn = Os([
191
+ xs(0, cn)
192
+ ], rn);
193
+ const ws = {
194
194
  id: "formula-ui.operation.help-function",
195
195
  type: Ne.OPERATION,
196
- handler: async (e, t) => (e.get(zt).help(t), !0)
197
- }, ve = {
196
+ handler: async (e, t) => (e.get(Zt).help(t), !0)
197
+ }, pe = {
198
198
  id: "formula-ui.operation.insert-function",
199
199
  type: Ne.OPERATION,
200
200
  // eslint-disable-next-line
201
201
  handler: async (e, t) => {
202
202
  var C, _;
203
- const n = e.get(gn), o = e.get(Ge), r = n.getCurrentSelections();
203
+ const n = e.get(fn), o = e.get(Ye), r = n.getCurrentSelections();
204
204
  if (!r || !r.length)
205
205
  return !1;
206
- const s = vr(e.get(ne));
206
+ const s = pr(e.get(ne));
207
207
  if (!s) return !1;
208
- const { worksheet: i, unitId: c, subUnitId: l } = s, g = i.getCellMatrix(), { value: m } = t, h = e.get(pe);
209
- e.get(hn);
208
+ const { worksheet: i, unitId: c, subUnitId: l } = s, g = i.getCellMatrix(), { value: m } = t, h = e.get(me);
209
+ e.get(dn);
210
210
  const d = [], u = [];
211
- let a = null, S = 0, p = 0, v = "";
212
- if (r.length === 1 && (Ds(r[0].range) || Ls(r[0].range) && Gn(g, r[0].range))) {
213
- const { range: I, primary: f } = r[0], b = (C = f == null ? void 0 : f.actualRow) != null ? C : I.startRow, y = (_ = f == null ? void 0 : f.actualColumn) != null ? _ : I.startColumn;
214
- a = I, S = b, p = y;
215
- const A = Yn(g, b, y);
216
- A && (v = _e(A));
211
+ let a = null, v = 0, p = 0, S = "";
212
+ if (r.length === 1 && (Fs(r[0].range) || Ds(r[0].range) && Yn(g, r[0].range))) {
213
+ const { range: E, primary: f } = r[0], b = (C = f == null ? void 0 : f.actualRow) != null ? C : E.startRow, y = (_ = f == null ? void 0 : f.actualColumn) != null ? _ : E.startColumn;
214
+ a = E, v = b, p = y;
215
+ const A = Kn(g, b, y);
216
+ A && (S = Ce(A));
217
217
  } else
218
- r.some((I) => {
218
+ r.some((E) => {
219
219
  var y, A;
220
- const { range: f, primary: b } = I;
221
- if (Gn(g, f)) {
222
- const F = (y = b == null ? void 0 : b.actualRow) != null ? y : f.startRow, O = (A = b == null ? void 0 : b.actualColumn) != null ? A : f.startColumn, N = Yn(g, F, O);
223
- if (!N)
224
- return a = f, S = F, p = O, !0;
225
- const k = _e(N), E = `=${m}(${k})`;
220
+ const { range: f, primary: b } = E;
221
+ if (Yn(g, f)) {
222
+ const F = (y = b == null ? void 0 : b.actualRow) != null ? y : f.startRow, N = (A = b == null ? void 0 : b.actualColumn) != null ? A : f.startColumn, O = Kn(g, F, N);
223
+ if (!O)
224
+ return a = f, v = F, p = N, !0;
225
+ const k = Ce(O), I = `=${m}(${k})`;
226
226
  d.push({
227
227
  range: f,
228
228
  primary: {
229
229
  row: F,
230
- column: O
230
+ column: N
231
231
  },
232
- formula: E
232
+ formula: I
233
233
  });
234
234
  } else {
235
- const { startRow: F, startColumn: O, endRow: N, endColumn: k } = f;
236
- if (F === N) {
237
- const E = $s(g, F, k, i.getColumnCount() - 1), x = E === k ? k - 1 : k, R = _e({
235
+ const { startRow: F, startColumn: N, endRow: O, endColumn: k } = f;
236
+ if (F === O) {
237
+ const I = Ls(g, F, k, i.getColumnCount() - 1), x = I === k ? k - 1 : k, R = Ce({
238
238
  startRow: F,
239
- endRow: N,
240
- startColumn: O,
239
+ endRow: O,
240
+ startColumn: N,
241
241
  endColumn: x
242
242
  }), w = `=${m}(${R})`;
243
243
  u.push({
244
244
  range: f,
245
245
  primary: {
246
246
  row: F,
247
- column: E
247
+ column: I
248
248
  },
249
249
  formula: w
250
250
  });
251
251
  } else {
252
- let E = -1;
253
- for (let R = O; R <= k; R++) {
254
- const w = Ps(g, R, N, i.getRowCount() - 1);
255
- E = Math.max(E, w);
252
+ let I = -1;
253
+ for (let R = N; R <= k; R++) {
254
+ const w = $s(g, R, O, i.getRowCount() - 1);
255
+ I = Math.max(I, w);
256
256
  }
257
- const x = E === N ? N - 1 : N;
258
- for (let R = O; R <= k; R++) {
259
- const w = _e({
257
+ const x = I === O ? O - 1 : O;
258
+ for (let R = N; R <= k; R++) {
259
+ const w = Ce({
260
260
  startRow: F,
261
261
  endRow: x,
262
262
  startColumn: R,
@@ -265,7 +265,7 @@ const ks = {
265
265
  u.push({
266
266
  range: f,
267
267
  primary: {
268
- row: E,
268
+ row: I,
269
269
  column: R
270
270
  },
271
271
  formula: D
@@ -276,41 +276,41 @@ const ks = {
276
276
  return !1;
277
277
  });
278
278
  if (a) {
279
- const I = ns(S, p, i), f = {
280
- range: tr.clone(a),
279
+ const E = ts(v, p, i), f = {
280
+ range: er.clone(a),
281
281
  primary: {
282
- startRow: I.startRow,
283
- startColumn: I.startColumn,
284
- endRow: I.endRow,
285
- endColumn: I.endColumn,
286
- actualRow: S,
282
+ startRow: E.startRow,
283
+ startColumn: E.startColumn,
284
+ endRow: E.endRow,
285
+ endColumn: E.endColumn,
286
+ actualRow: v,
287
287
  actualColumn: p,
288
- isMerged: I.isMerged,
289
- isMergedMainCell: I.startRow === S && I.startColumn === p
288
+ isMerged: E.isMerged,
289
+ isMergedMainCell: E.startRow === v && E.startColumn === p
290
290
  }
291
291
  }, b = {
292
292
  unitId: c,
293
293
  subUnitId: l,
294
294
  selections: [f]
295
295
  };
296
- await h.executeCommand(mn.id, b);
297
- const y = o.getEditor(ln), A = o.getEditor(nr);
298
- h.syncExecuteCommand(ir.id, {
296
+ await h.executeCommand(gn.id, b);
297
+ const y = o.getEditor(an), A = o.getEditor(tr);
298
+ h.syncExecuteCommand(sr.id, {
299
299
  visible: !0,
300
300
  unitId: c,
301
- eventType: xe.Dblclick
301
+ eventType: Oe.Dblclick
302
302
  });
303
- const F = `=${m}(${v}`;
303
+ const F = `=${m}(${S}`;
304
304
  y == null || y.replaceText(F), A == null || A.replaceText(F, !1);
305
305
  }
306
- return d.length === 0 && u.length === 0 ? !1 : h.executeCommand(us.id, {
306
+ return d.length === 0 && u.length === 0 ? !1 : h.executeCommand(ls.id, {
307
307
  list: d,
308
308
  listOfRangeHasNumber: u
309
309
  });
310
310
  }
311
311
  };
312
- function Yn(e, t, n) {
313
- const o = As(e, t, n);
312
+ function Kn(e, t, n) {
313
+ const o = ks(e, t, n);
314
314
  if (o !== t)
315
315
  return {
316
316
  startRow: o,
@@ -318,7 +318,7 @@ function Yn(e, t, n) {
318
318
  startColumn: n,
319
319
  endColumn: n
320
320
  };
321
- const r = Fs(e, t, n);
321
+ const r = As(e, t, n);
322
322
  return r !== n ? {
323
323
  startRow: t,
324
324
  endRow: t,
@@ -326,16 +326,16 @@ function Yn(e, t, n) {
326
326
  endColumn: n - 1
327
327
  } : null;
328
328
  }
329
- function As(e, t, n) {
329
+ function ks(e, t, n) {
330
330
  let o = !1;
331
331
  if (t === 0) return t;
332
332
  for (let r = t - 1; r >= 0; r--) {
333
333
  const s = e.getValue(r, n);
334
- if (Rt(s) && !o) {
334
+ if (_t(s) && !o) {
335
335
  if (r === 0) return 0;
336
336
  o = !0;
337
337
  } else {
338
- if (o && !Rt(s))
338
+ if (o && !_t(s))
339
339
  return r + 1;
340
340
  if (o && r === 0)
341
341
  return 0;
@@ -343,16 +343,16 @@ function As(e, t, n) {
343
343
  }
344
344
  return t;
345
345
  }
346
- function Fs(e, t, n) {
346
+ function As(e, t, n) {
347
347
  let o = !1;
348
348
  if (n === 0) return n;
349
349
  for (let r = n - 1; r >= 0; r--) {
350
350
  const s = e.getValue(t, r);
351
- if (Rt(s) && !o) {
351
+ if (_t(s) && !o) {
352
352
  if (r === 0) return 0;
353
353
  o = !0;
354
354
  } else {
355
- if (o && !Rt(s))
355
+ if (o && !_t(s))
356
356
  return r + 1;
357
357
  if (o && r === 0)
358
358
  return 0;
@@ -360,69 +360,69 @@ function Fs(e, t, n) {
360
360
  }
361
361
  return n;
362
362
  }
363
- function Rt(e) {
363
+ function _t(e) {
364
364
  if (e != null && e.p) {
365
365
  const t = e == null ? void 0 : e.p.body;
366
366
  if (t == null)
367
367
  return !1;
368
- const n = t.dataStream, r = n.substring(n.length - 2, n.length) === rr ? n.substring(0, n.length - 2) : n;
369
- return Xr(r);
368
+ const n = t.dataStream, r = n.substring(n.length - 2, n.length) === nr ? n.substring(0, n.length - 2) : n;
369
+ return zr(r);
370
370
  }
371
- return e && (e.t === Mn.NUMBER || Qr(e) === Mn.NUMBER);
371
+ return e && (e.t === xn.NUMBER || Xr(e) === xn.NUMBER);
372
372
  }
373
- function Ds(e) {
373
+ function Fs(e) {
374
374
  return e.startRow === e.endRow && e.startColumn === e.endColumn;
375
375
  }
376
- function Ls(e) {
376
+ function Ds(e) {
377
377
  return e.startRow !== e.endRow && e.startColumn !== e.endColumn;
378
378
  }
379
- function Gn(e, t) {
379
+ function Yn(e, t) {
380
380
  for (let n = t.startRow; n <= t.endRow; n++)
381
381
  for (let o = t.startColumn; o <= t.endColumn; o++)
382
- if (Rt(e.getValue(n, o)))
382
+ if (_t(e.getValue(n, o)))
383
383
  return !1;
384
384
  return !0;
385
385
  }
386
- function $s(e, t, n, o) {
386
+ function Ls(e, t, n, o) {
387
387
  for (let r = n; r <= o; r++)
388
388
  if (!e.getValue(t, r))
389
389
  return r;
390
390
  return o;
391
391
  }
392
- function Ps(e, t, n, o) {
392
+ function $s(e, t, n, o) {
393
393
  for (let r = n; r <= o; r++)
394
394
  if (!e.getValue(r, t))
395
395
  return r;
396
396
  return o;
397
397
  }
398
- const Ir = "SHEET_FORMULA_UI_PLUGIN", br = `${Ir}_MORE_FUNCTIONS_COMPONENT`, _n = {
398
+ const Ir = "SHEET_FORMULA_UI_PLUGIN", Er = `${Ir}_MORE_FUNCTIONS_COMPONENT`, Cn = {
399
399
  id: "formula-ui.operation.more-functions",
400
400
  type: Ne.OPERATION,
401
- handler: async (e) => (e.get(vn).open({
401
+ handler: async (e) => (e.get(pn).open({
402
402
  header: { title: "formula.insert.tooltip" },
403
- children: { label: br }
403
+ children: { label: Er }
404
404
  }), !0)
405
- }, yr = {
405
+ }, br = {
406
406
  id: "formula-ui.operation.change-ref-to-absolute",
407
407
  type: Ne.OPERATION,
408
408
  handler: async (e) => !0
409
- }, Us = {
409
+ }, Ps = {
410
410
  id: "formula-ui.operation.search-function",
411
411
  type: Ne.OPERATION,
412
- handler: async (e, t) => (e.get(zt).search(t), !0)
412
+ handler: async (e, t) => (e.get(Zt).search(t), !0)
413
413
  };
414
- var Vs = Object.getOwnPropertyDescriptor, Ws = (e, t, n, o) => {
415
- for (var r = o > 1 ? void 0 : o ? Vs(t, n) : t, s = e.length - 1, i; s >= 0; s--)
414
+ var Us = Object.getOwnPropertyDescriptor, Vs = (e, t, n, o) => {
415
+ for (var r = o > 1 ? void 0 : o ? Us(t, n) : t, s = e.length - 1, i; s >= 0; s--)
416
416
  (i = e[s]) && (r = i(r) || r);
417
417
  return r;
418
- }, kt = (e, t) => (n, o) => t(n, o, e);
419
- let Pt = class extends dt {
418
+ }, wt = (e, t) => (n, o) => t(n, o, e);
419
+ let $t = class extends ut {
420
420
  constructor(e, t, n, o) {
421
421
  super(), this._sheetInterceptorService = e, this._univerInstanceService = t, this._formulaDataModel = n, this._lexerTreeBuilder = o, this._initialize();
422
422
  }
423
423
  _initialize() {
424
424
  this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
425
- getMutations: (e) => e.id === rs.id ? this._reorderFormula(e.params) : {
425
+ getMutations: (e) => e.id === ns.id ? this._reorderFormula(e.params) : {
426
426
  redos: [],
427
427
  undos: []
428
428
  }
@@ -435,32 +435,32 @@ let Pt = class extends dt {
435
435
  redos: t,
436
436
  undos: n
437
437
  };
438
- const g = l.getCellMatrix(), m = new Le(), h = new Le();
438
+ const g = l.getCellMatrix(), m = new Fe(), h = new Fe();
439
439
  let d = !1;
440
- return Jr.foreach(s, (u, a) => {
441
- let S = u;
442
- i.hasOwnProperty(u) && (S = i[u]);
443
- const p = g.getValue(S, a);
440
+ return Qr.foreach(s, (u, a) => {
441
+ let v = u;
442
+ i.hasOwnProperty(u) && (v = i[u]);
443
+ const p = g.getValue(v, a);
444
444
  if (p != null && p.f || p != null && p.si) {
445
445
  d = !0;
446
- const v = this._formulaDataModel.getFormulaStringByCell(S, a, r, o), C = this._lexerTreeBuilder.moveFormulaRefOffset(
447
- v,
446
+ const S = this._formulaDataModel.getFormulaStringByCell(v, a, r, o), C = this._lexerTreeBuilder.moveFormulaRefOffset(
447
+ S,
448
448
  0,
449
- u - S
450
- ), _ = un.deepClone(p);
449
+ u - v
450
+ ), _ = ln.deepClone(p);
451
451
  _.f = C, _.si = null, m.setValue(u, a, _);
452
452
  } else
453
453
  m.setValue(u, a, p);
454
454
  h.setValue(u, a, g.getValue(u, a));
455
455
  }), d ? (t.push({
456
- id: Dt.id,
456
+ id: Ft.id,
457
457
  params: {
458
458
  unitId: o,
459
459
  subUnitId: r,
460
460
  cellValue: m.getMatrix()
461
461
  }
462
462
  }), n.push({
463
- id: Dt.id,
463
+ id: Ft.id,
464
464
  params: {
465
465
  unitId: o,
466
466
  subUnitId: r,
@@ -475,19 +475,19 @@ let Pt = class extends dt {
475
475
  };
476
476
  }
477
477
  };
478
- Pt = Ws([
479
- kt(0, j(pn)),
480
- kt(1, j(ne)),
481
- kt(2, j(yt)),
482
- kt(3, j(Re))
483
- ], Pt);
484
- const Tr = "sheets-formula-ui.base.config", Zn = {};
485
- var Hs = Object.getOwnPropertyDescriptor, Bs = (e, t, n, o) => {
486
- for (var r = o > 1 ? void 0 : o ? Hs(t, n) : t, s = e.length - 1, i; s >= 0; s--)
478
+ $t = Vs([
479
+ wt(0, q(mn)),
480
+ wt(1, q(ne)),
481
+ wt(2, q(bt)),
482
+ wt(3, q(_e))
483
+ ], $t);
484
+ const yr = "sheets-formula-ui.base.config", Gn = {};
485
+ var Ws = Object.getOwnPropertyDescriptor, Hs = (e, t, n, o) => {
486
+ for (var r = o > 1 ? void 0 : o ? Ws(t, n) : t, s = e.length - 1, i; s >= 0; s--)
487
487
  (i = e[s]) && (r = i(r) || r);
488
488
  return r;
489
- }, vt = (e, t) => (n, o) => t(n, o, e);
490
- const en = "SHEET_FORMULA_ALERT", js = {
489
+ }, pt = (e, t) => (n, o) => t(n, o, e);
490
+ const Jt = "SHEET_FORMULA_ALERT", Bs = {
491
491
  [ue.DIV_BY_ZERO]: "divByZero",
492
492
  [ue.NAME]: "name",
493
493
  [ue.VALUE]: "value",
@@ -501,7 +501,7 @@ const en = "SHEET_FORMULA_ALERT", js = {
501
501
  [ue.CONNECT]: "connect",
502
502
  [ue.NULL]: "null"
503
503
  };
504
- let sn = class extends dt {
504
+ let on = class extends ut {
505
505
  constructor(e, t, n, o, r, s) {
506
506
  super(), this._context = e, this._hoverManagerService = t, this._cellAlertManagerService = n, this._localeService = o, this._formulaDataModel = r, this._zenZoneService = s, this._init();
507
507
  }
@@ -509,29 +509,29 @@ let sn = class extends dt {
509
509
  this._initCellAlertPopup(), this._initZenService();
510
510
  }
511
511
  _initCellAlertPopup() {
512
- this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(fn(100)).subscribe((e) => {
512
+ this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(hn(100)).subscribe((e) => {
513
513
  var t, n, o, r, s;
514
514
  if (e) {
515
515
  const c = this._context.unit.getActiveSheet();
516
516
  if (!c) return;
517
517
  const l = c.getCell(e.location.row, e.location.col), g = (r = (o = (n = (t = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : t[e.location.unitId]) == null ? void 0 : n[e.location.subUnitId]) == null ? void 0 : o[e.location.row]) == null ? void 0 : r[e.location.col];
518
- if (eo(l)) {
519
- const m = ur(l, !!g);
518
+ if (Jr(l)) {
519
+ const m = lr(l, !!g);
520
520
  if (!m) {
521
521
  this._hideAlert();
522
522
  return;
523
523
  }
524
- const h = this._cellAlertManagerService.currentAlert.get(en), d = (s = h == null ? void 0 : h.alert) == null ? void 0 : s.location;
524
+ const h = this._cellAlertManagerService.currentAlert.get(Jt), d = (s = h == null ? void 0 : h.alert) == null ? void 0 : s.location;
525
525
  if (d && d.row === e.location.row && d.col === e.location.col && d.subUnitId === e.location.subUnitId && d.unitId === e.location.unitId)
526
526
  return;
527
527
  this._cellAlertManagerService.showAlert({
528
528
  type: So.ERROR,
529
529
  title: this._localeService.t("formula.error.title"),
530
- message: this._localeService.t(`formula.error.${js[m]}`),
530
+ message: this._localeService.t(`formula.error.${Bs[m]}`),
531
531
  location: e.location,
532
532
  width: 200,
533
533
  height: 74,
534
- key: en
534
+ key: Jt
535
535
  });
536
536
  return;
537
537
  }
@@ -545,33 +545,33 @@ let sn = class extends dt {
545
545
  }));
546
546
  }
547
547
  _hideAlert() {
548
- this._cellAlertManagerService.removeAlert(en);
548
+ this._cellAlertManagerService.removeAlert(Jt);
549
549
  }
550
550
  };
551
- sn = Bs([
552
- vt(1, j(po)),
553
- vt(2, j(vo)),
554
- vt(3, j(ht)),
555
- vt(4, j(yt)),
556
- vt(5, gs)
557
- ], sn);
558
- var qs = Object.getOwnPropertyDescriptor, Ks = (e, t, n, o) => {
551
+ on = Hs([
552
+ pt(1, q(mo)),
553
+ pt(2, q(po)),
554
+ pt(3, q(dt)),
555
+ pt(4, q(bt)),
556
+ pt(5, fs)
557
+ ], on);
558
+ var qs = Object.getOwnPropertyDescriptor, js = (e, t, n, o) => {
559
559
  for (var r = o > 1 ? void 0 : o ? qs(t, n) : t, s = e.length - 1, i; s >= 0; s--)
560
560
  (i = e[s]) && (r = i(r) || r);
561
561
  return r;
562
- }, zn = (e, t) => (n, o) => t(n, o, e);
563
- let Ut = class extends dt {
562
+ }, Zn = (e, t) => (n, o) => t(n, o, e);
563
+ let Pt = class extends ut {
564
564
  constructor(e, t) {
565
565
  super(), this._autoFillService = e, this._lexerTreeBuilder = t, this._registerAutoFill();
566
566
  }
567
567
  _registerAutoFill() {
568
568
  const e = {
569
- type: An.FORMULA,
569
+ type: kn.FORMULA,
570
570
  priority: 1001,
571
- match: (t) => De(t == null ? void 0 : t.f) || lt(t == null ? void 0 : t.si),
572
- isContinue: (t, n) => t.type === An.FORMULA,
571
+ match: (t) => Ae(t == null ? void 0 : t.f) || at(t == null ? void 0 : t.si),
572
+ isContinue: (t, n) => t.type === kn.FORMULA,
573
573
  applyFunctions: {
574
- [_o.COPY]: (t, n, o, r, s) => {
574
+ [Co.COPY]: (t, n, o, r, s) => {
575
575
  const { data: i, index: c } = t;
576
576
  return this._fillCopyFormula(i, n, o, c, r, s);
577
577
  }
@@ -581,22 +581,22 @@ let Ut = class extends dt {
581
581
  }
582
582
  _fillCopyFormula(e, t, n, o, r, s) {
583
583
  var g, m;
584
- const i = Gs(r), c = [], l = /* @__PURE__ */ new Map();
584
+ const i = Ys(r), c = [], l = /* @__PURE__ */ new Map();
585
585
  for (let h = 1; h <= t; h++) {
586
- const d = (h - 1) % e.length, u = o[d], a = un.deepClone(e[d]);
586
+ const d = (h - 1) % e.length, u = o[d], a = ln.deepClone(e[d]);
587
587
  if (a) {
588
- const S = ((g = e[d]) == null ? void 0 : g.f) || "", p = ((m = e[d]) == null ? void 0 : m.si) || "", v = De(S);
589
- if (lt(p))
588
+ const v = ((g = e[d]) == null ? void 0 : g.f) || "", p = ((m = e[d]) == null ? void 0 : m.si) || "", S = Ae(v);
589
+ if (at(p))
590
590
  a.si = p, a.f = null, a.v = null, a.p = null, a.t = null, c.push(a);
591
- else if (v) {
591
+ else if (S) {
592
592
  let _ = l.get(d);
593
593
  if (_)
594
594
  a.si = _, a.f = null, a.v = null, a.p = null, a.t = null;
595
595
  else {
596
596
  _ = qt(6), l.set(d, _);
597
- const { offsetX: I, offsetY: f } = Ys(i, t, n, s, u), b = this._lexerTreeBuilder.moveFormulaRefOffset(
598
- S,
599
- I,
597
+ const { offsetX: E, offsetY: f } = Ks(i, t, n, s, u), b = this._lexerTreeBuilder.moveFormulaRefOffset(
598
+ v,
599
+ E,
600
600
  f
601
601
  );
602
602
  a.si = _, a.f = b, a.v = null, a.p = null, a.t = null;
@@ -608,11 +608,11 @@ let Ut = class extends dt {
608
608
  return c;
609
609
  }
610
610
  };
611
- Ut = Ks([
612
- zn(0, Co),
613
- zn(1, j(Re))
614
- ], Ut);
615
- function Ys(e, t, n, o, r) {
611
+ Pt = js([
612
+ Zn(0, vo),
613
+ Zn(1, q(_e))
614
+ ], Pt);
615
+ function Ks(e, t, n, o, r) {
616
616
  const { source: s, target: i } = o, { rows: c } = i, { rows: l } = s;
617
617
  let g = 0, m = 0;
618
618
  switch (n) {
@@ -631,7 +631,7 @@ function Ys(e, t, n, o, r) {
631
631
  }
632
632
  return { offsetX: g, offsetY: m };
633
633
  }
634
- function Gs(e) {
634
+ function Ys(e) {
635
635
  let t = 0;
636
636
  for (const n in e)
637
637
  e[n].forEach((o) => {
@@ -639,13 +639,13 @@ function Gs(e) {
639
639
  });
640
640
  return t;
641
641
  }
642
- var Zs = Object.getOwnPropertyDescriptor, zs = (e, t, n, o) => {
643
- for (var r = o > 1 ? void 0 : o ? Zs(t, n) : t, s = e.length - 1, i; s >= 0; s--)
642
+ var Gs = Object.getOwnPropertyDescriptor, Zs = (e, t, n, o) => {
643
+ for (var r = o > 1 ? void 0 : o ? Gs(t, n) : t, s = e.length - 1, i; s >= 0; s--)
644
644
  (i = e[s]) && (r = i(r) || r);
645
645
  return r;
646
646
  }, St = (e, t) => (n, o) => t(n, o, e);
647
- const Xs = "default-paste-formula";
648
- let Vt = class extends dt {
647
+ const zs = "default-paste-formula";
648
+ let Ut = class extends ut {
649
649
  constructor(e, t, n, o, r) {
650
650
  super(), this._currentUniverSheet = e, this._lexerTreeBuilder = t, this._sheetClipboardService = n, this._injector = o, this._formulaDataModel = r, this._initialize();
651
651
  }
@@ -657,7 +657,7 @@ let Vt = class extends dt {
657
657
  }
658
658
  _pasteFormulaHook() {
659
659
  return {
660
- id: ct.SPECIAL_PASTE_FORMULA,
660
+ id: it.SPECIAL_PASTE_FORMULA,
661
661
  priority: 10,
662
662
  specialPasteInfo: { label: "specialPaste.formula" },
663
663
  onPasteCells: (e, t, n, o) => this._onPasteCells(e, t, n, o, !0)
@@ -665,7 +665,7 @@ let Vt = class extends dt {
665
665
  }
666
666
  _pasteWithFormulaHook() {
667
667
  return {
668
- id: Xs,
668
+ id: zs,
669
669
  priority: 10,
670
670
  onPasteCells: (e, t, n, o) => this._onPasteCells(e, t, n, o, !1)
671
671
  };
@@ -673,8 +673,8 @@ let Vt = class extends dt {
673
673
  _onPasteCells(e, t, n, o, r) {
674
674
  var d;
675
675
  if ([
676
- ct.SPECIAL_PASTE_FORMAT,
677
- ct.SPECIAL_PASTE_COL_WIDTH
676
+ it.SPECIAL_PASTE_FORMAT,
677
+ it.SPECIAL_PASTE_COL_WIDTH
678
678
  ].includes(o.pasteType))
679
679
  return {
680
680
  undos: [],
@@ -687,11 +687,11 @@ let Vt = class extends dt {
687
687
  redos: []
688
688
  };
689
689
  const g = t.range, m = n, h = {
690
- copyType: o.copyType || cr.COPY,
690
+ copyType: o.copyType || ir.COPY,
691
691
  copyRange: e == null ? void 0 : e.range,
692
692
  pasteType: o.pasteType
693
693
  };
694
- return this._injector.invoke((u) => Qs(
694
+ return this._injector.invoke((u) => Xs(
695
695
  c,
696
696
  l,
697
697
  g,
@@ -705,15 +705,15 @@ let Vt = class extends dt {
705
705
  ));
706
706
  }
707
707
  };
708
- Vt = zs([
708
+ Ut = Zs([
709
709
  St(0, ne),
710
- St(1, j(Re)),
711
- St(2, Ro),
712
- St(3, j(Et)),
713
- St(4, j(yt))
714
- ], Vt);
715
- function Qs(e, t, n, o, r, s, i, c, l = !1, g) {
716
- const m = [], h = [], d = Js(e, t, n, o, s, i, c, g);
710
+ St(1, q(_e)),
711
+ St(2, _o),
712
+ St(3, q(Rt)),
713
+ St(4, q(bt))
714
+ ], Ut);
715
+ function Xs(e, t, n, o, r, s, i, c, l = !1, g) {
716
+ const m = [], h = [], d = Qs(e, t, n, o, s, i, c, g);
717
717
  if (!d.hasValue())
718
718
  return {
719
719
  undos: [],
@@ -725,97 +725,97 @@ function Qs(e, t, n, o, r, s, i, c, l = !1, g) {
725
725
  cellValue: d.getData()
726
726
  };
727
727
  m.push({
728
- id: Dt.id,
728
+ id: Ft.id,
729
729
  params: u
730
730
  });
731
- const a = os(
731
+ const a = rs(
732
732
  r,
733
733
  u
734
734
  );
735
735
  return h.push({
736
- id: Dt.id,
736
+ id: Ft.id,
737
737
  params: a
738
738
  }), {
739
739
  undos: h,
740
740
  redos: m
741
741
  };
742
742
  }
743
- function Js(e, t, n, o, r, s, i, c) {
744
- return c ? r.pasteType === ct.SPECIAL_PASTE_VALUE ? ti(e, t, n, o, i, c) : r.pasteType === ct.SPECIAL_PASTE_FORMULA ? ni(e, t, n, o, s, i, c) : ri(e, t, n, o, r.copyType, s, i, c) : ei(e, t, n, o, i);
743
+ function Qs(e, t, n, o, r, s, i, c) {
744
+ return c ? r.pasteType === it.SPECIAL_PASTE_VALUE ? ei(e, t, n, o, i, c) : r.pasteType === it.SPECIAL_PASTE_FORMULA ? ti(e, t, n, o, s, i, c) : ni(e, t, n, o, r.copyType, s, i, c) : Js(e, t, n, o, i);
745
745
  }
746
- function ei(e, t, n, o, r) {
747
- const s = new Le(), i = r.getSheetFormulaData(e, t);
746
+ function Js(e, t, n, o, r) {
747
+ const s = new Fe(), i = r.getSheetFormulaData(e, t);
748
748
  return o.forValue((c, l, g) => {
749
749
  var u;
750
750
  const m = n.rows[c], h = n.cols[l], d = {};
751
- De(g.v) ? (d.v = null, d.f = `${g.v}`, d.si = null, d.p = null, s.setValue(m, h, d)) : (u = i == null ? void 0 : i[m]) != null && u[h] && (d.v = g.v, d.f = null, d.si = null, d.p = null, s.setValue(m, h, d));
751
+ Ae(g.v) ? (d.v = null, d.f = `${g.v}`, d.si = null, d.p = null, s.setValue(m, h, d)) : (u = i == null ? void 0 : i[m]) != null && u[h] && (d.v = g.v, d.f = null, d.si = null, d.p = null, s.setValue(m, h, d));
752
752
  }), s;
753
753
  }
754
- function ti(e, t, n, o, r, s) {
754
+ function ei(e, t, n, o, r, s) {
755
755
  var g, m;
756
- const i = new Le(), c = (m = (g = r.getArrayFormulaCellData()) == null ? void 0 : g[s.unitId]) == null ? void 0 : m[s.subUnitId], l = r.getSheetFormulaData(e, t);
756
+ const i = new Fe(), c = (m = (g = r.getArrayFormulaCellData()) == null ? void 0 : g[s.unitId]) == null ? void 0 : m[s.subUnitId], l = r.getSheetFormulaData(e, t);
757
757
  return o.forValue((h, d, u) => {
758
- var _, I;
759
- const a = s.range.rows[h % s.range.rows.length], S = s.range.cols[d % s.range.cols.length], p = n.rows[h], v = n.cols[d], C = {};
760
- if (De(u.f) || lt(u.si))
761
- C.v = u.v, C.f = null, C.si = null, C.p = null, i.setValue(p, v, C);
762
- else if ((_ = c == null ? void 0 : c[a]) != null && _[S]) {
763
- const f = c[a][S];
764
- C.v = f.v, C.f = null, C.si = null, C.p = null, i.setValue(p, v, C);
765
- } else if ((I = l == null ? void 0 : l[p]) != null && I[v]) {
758
+ var _, E;
759
+ const a = s.range.rows[h % s.range.rows.length], v = s.range.cols[d % s.range.cols.length], p = n.rows[h], S = n.cols[d], C = {};
760
+ if (Ae(u.f) || at(u.si))
761
+ C.v = u.v, C.f = null, C.si = null, C.p = null, i.setValue(p, S, C);
762
+ else if ((_ = c == null ? void 0 : c[a]) != null && _[v]) {
763
+ const f = c[a][v];
764
+ C.v = f.v, C.f = null, C.si = null, C.p = null, i.setValue(p, S, C);
765
+ } else if ((E = l == null ? void 0 : l[p]) != null && E[S]) {
766
766
  if (C.v = u.v, C.f = null, C.si = null, C.p = null, u.p) {
767
- const f = Or(u);
767
+ const f = Tr(u);
768
768
  f && (C.v = f);
769
769
  }
770
- i.setValue(p, v, C);
770
+ i.setValue(p, S, C);
771
771
  }
772
772
  }), i;
773
773
  }
774
- function ni(e, t, n, o, r, s, i) {
775
- const c = new Le(), l = /* @__PURE__ */ new Map();
774
+ function ti(e, t, n, o, r, s, i) {
775
+ const c = new Fe(), l = /* @__PURE__ */ new Map();
776
776
  return o.forValue((g, m, h) => {
777
777
  const d = n.rows[g], u = n.cols[m], a = {};
778
- if (lt(h.si)) {
778
+ if (at(h.si)) {
779
779
  if (i.unitId !== e || i.subUnitId !== t) {
780
- const S = s.getFormulaStringByCell(
780
+ const v = s.getFormulaStringByCell(
781
781
  i.range.rows[g % i.range.rows.length],
782
782
  i.range.cols[m % i.range.cols.length],
783
783
  i.subUnitId,
784
784
  i.unitId
785
- ), p = n.cols[m] - i.range.cols[m % i.range.cols.length], v = n.rows[g] - i.range.rows[g % i.range.rows.length], C = r.moveFormulaRefOffset(S || "", p, v);
785
+ ), p = n.cols[m] - i.range.cols[m % i.range.cols.length], S = n.rows[g] - i.range.rows[g % i.range.rows.length], C = r.moveFormulaRefOffset(v || "", p, S);
786
786
  a.si = null, a.f = C;
787
787
  } else
788
788
  a.si = h.si, a.f = null;
789
789
  a.v = null, a.p = null, c.setValue(d, u, a);
790
- } else if (De(h.f)) {
791
- const S = `${g % i.range.rows.length}_${m % i.range.cols.length}`;
792
- let p = l.get(S);
790
+ } else if (Ae(h.f)) {
791
+ const v = `${g % i.range.rows.length}_${m % i.range.cols.length}`;
792
+ let p = l.get(v);
793
793
  if (p)
794
794
  a.si = p, a.f = null;
795
795
  else {
796
- p = qt(6), l.set(S, p);
797
- const v = n.cols[m] - i.range.cols[m % i.range.cols.length], C = n.rows[g] - i.range.rows[g % i.range.rows.length], _ = r.moveFormulaRefOffset(h.f || "", v, C);
796
+ p = qt(6), l.set(v, p);
797
+ const S = n.cols[m] - i.range.cols[m % i.range.cols.length], C = n.rows[g] - i.range.rows[g % i.range.rows.length], _ = r.moveFormulaRefOffset(h.f || "", S, C);
798
798
  a.si = p, a.f = _;
799
799
  }
800
800
  a.v = null, a.p = null, c.setValue(d, u, a);
801
801
  } else {
802
802
  if (a.v = h.v, a.f = null, a.si = null, a.p = null, h.p) {
803
- const S = Or(h);
804
- S && (a.v = S);
803
+ const v = Tr(h);
804
+ v && (a.v = v);
805
805
  }
806
806
  c.setValue(d, u, a);
807
807
  }
808
808
  }), c;
809
809
  }
810
- function ri(e, t, n, o, r, s, i, c) {
811
- const l = new Le(), g = /* @__PURE__ */ new Map(), m = i.getSheetFormulaData(e, t), h = [];
812
- return r === cr.CUT ? o.forValue((d, u, a) => {
813
- const S = n.rows[d], p = n.cols[u], v = {};
814
- if (lt(a.si)) {
815
- if (De(a.f))
816
- h.push(a.si), v.f = a.f, v.si = a.si;
810
+ function ni(e, t, n, o, r, s, i, c) {
811
+ const l = new Fe(), g = /* @__PURE__ */ new Map(), m = i.getSheetFormulaData(e, t), h = [];
812
+ return r === ir.CUT ? o.forValue((d, u, a) => {
813
+ const v = n.rows[d], p = n.cols[u], S = {};
814
+ if (at(a.si)) {
815
+ if (Ae(a.f))
816
+ h.push(a.si), S.f = a.f, S.si = a.si;
817
817
  else if (h.includes(a.si))
818
- v.f = null, v.si = a.si;
818
+ S.f = null, S.si = a.si;
819
819
  else {
820
820
  const C = i.getFormulaStringByCell(
821
821
  c.range.rows[d % c.range.rows.length],
@@ -823,47 +823,47 @@ function ri(e, t, n, o, r, s, i, c) {
823
823
  c.subUnitId,
824
824
  c.unitId
825
825
  );
826
- v.f = C, v.si = null;
826
+ S.f = C, S.si = null;
827
827
  }
828
- v.v = null, v.p = null, l.setValue(S, p, v);
829
- } else De(a.f) && (v.f = a.f, v.si = null, v.v = null, v.p = null, l.setValue(S, p, v));
828
+ S.v = null, S.p = null, l.setValue(v, p, S);
829
+ } else Ae(a.f) && (S.f = a.f, S.si = null, S.v = null, S.p = null, l.setValue(v, p, S));
830
830
  }) : o.forValue((d, u, a) => {
831
831
  var C;
832
- const S = n.rows[d], p = n.cols[u], v = {};
833
- if (lt(a.si)) {
832
+ const v = n.rows[d], p = n.cols[u], S = {};
833
+ if (at(a.si)) {
834
834
  if (c.unitId !== e || c.subUnitId !== t) {
835
835
  const _ = i.getFormulaStringByCell(
836
836
  c.range.rows[d % c.range.rows.length],
837
837
  c.range.cols[u % c.range.cols.length],
838
838
  c.subUnitId,
839
839
  c.unitId
840
- ), I = n.cols[u] - c.range.cols[u % c.range.cols.length], f = n.rows[d] - c.range.rows[d % c.range.rows.length], b = s.moveFormulaRefOffset(_ || "", I, f);
841
- v.si = null, v.f = b;
840
+ ), E = n.cols[u] - c.range.cols[u % c.range.cols.length], f = n.rows[d] - c.range.rows[d % c.range.rows.length], b = s.moveFormulaRefOffset(_ || "", E, f);
841
+ S.si = null, S.f = b;
842
842
  } else
843
- v.si = a.si, v.f = null;
844
- v.v = null, v.p = null, l.setValue(S, p, v);
845
- } else if (De(a.f)) {
843
+ S.si = a.si, S.f = null;
844
+ S.v = null, S.p = null, l.setValue(v, p, S);
845
+ } else if (Ae(a.f)) {
846
846
  const _ = `${d % c.range.rows.length}_${u % c.range.cols.length}`;
847
- let I = g.get(_);
848
- if (I)
849
- v.si = I, v.f = null;
847
+ let E = g.get(_);
848
+ if (E)
849
+ S.si = E, S.f = null;
850
850
  else {
851
- I = qt(6), g.set(_, I);
851
+ E = qt(6), g.set(_, E);
852
852
  const f = n.cols[u] - c.range.cols[u % c.range.cols.length], b = n.rows[d] - c.range.rows[d % c.range.rows.length], y = s.moveFormulaRefOffset(a.f || "", f, b);
853
- v.si = I, v.f = y;
853
+ S.si = E, S.f = y;
854
854
  }
855
- v.v = null, v.p = null, l.setValue(S, p, v);
856
- } else (C = m == null ? void 0 : m[S]) != null && C[p] && (v.v = a.v, v.f = null, v.si = null, v.p = a.p, l.setValue(S, p, v));
857
- }), h.length > 0 && new Le(m).forValue((d, u, a) => {
855
+ S.v = null, S.p = null, l.setValue(v, p, S);
856
+ } else (C = m == null ? void 0 : m[v]) != null && C[p] && (S.v = a.v, S.f = null, S.si = null, S.p = a.p, l.setValue(v, p, S));
857
+ }), h.length > 0 && new Fe(m).forValue((d, u, a) => {
858
858
  if (!(c.range.rows.includes(d) && c.range.cols.includes(u)) && !(n.rows.includes(d) && n.cols.includes(u)) && h.includes(a == null ? void 0 : a.si)) {
859
- const S = i.getFormulaStringByCell(
859
+ const v = i.getFormulaStringByCell(
860
860
  d,
861
861
  u,
862
862
  c.subUnitId,
863
863
  c.unitId
864
864
  );
865
865
  l.setValue(d, u, {
866
- f: S,
866
+ f: v,
867
867
  si: null,
868
868
  v: null,
869
869
  p: null
@@ -871,25 +871,25 @@ function ri(e, t, n, o, r, s, i, c) {
871
871
  }
872
872
  }), l;
873
873
  }
874
- function Or(e) {
874
+ function Tr(e) {
875
875
  if (e != null && e.p) {
876
876
  const t = e == null ? void 0 : e.p.body;
877
877
  if (t == null)
878
878
  return;
879
879
  const n = t.dataStream;
880
- return n.substring(n.length - 2, n.length) === rr ? n.substring(0, n.length - 2) : n;
880
+ return n.substring(n.length - 2, n.length) === nr ? n.substring(0, n.length - 2) : n;
881
881
  }
882
882
  }
883
- var oi = Object.getOwnPropertyDescriptor, si = (e, t, n, o) => {
884
- for (var r = o > 1 ? void 0 : o ? oi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
883
+ var ri = Object.getOwnPropertyDescriptor, oi = (e, t, n, o) => {
884
+ for (var r = o > 1 ? void 0 : o ? ri(t, n) : t, s = e.length - 1, i; s >= 0; s--)
885
885
  (i = e[s]) && (r = i(r) || r);
886
886
  return r;
887
- }, Be = (e, t) => (n, o) => t(n, o, e);
888
- let Wt = class extends dt {
887
+ }, He = (e, t) => (n, o) => t(n, o, e);
888
+ let Vt = class extends ut {
889
889
  constructor(t, n, o, r, s, i, c, l) {
890
890
  super();
891
- q(this, "_previousShape");
892
- q(this, "_skeleton");
891
+ j(this, "_previousShape");
892
+ j(this, "_skeleton");
893
893
  this._context = t, this._sheetInterceptorService = n, this._formulaDataModel = o, this._themeService = r, this._renderManagerService = s, this._sheetSkeletonManagerService = i, this._commandService = c, this._logService = l, this._initSkeletonChangeListener(), this._initInterceptorEditorStart(), this._commandExecutedListener();
894
894
  }
895
895
  _initSkeletonChangeListener() {
@@ -915,18 +915,18 @@ let Wt = class extends dt {
915
915
  }
916
916
  _initInterceptorEditorStart() {
917
917
  this.disposeWithMe(
918
- or(
919
- this._sheetInterceptorService.writeCellInterceptor.intercept(ss, {
918
+ rr(
919
+ this._sheetInterceptorService.writeCellInterceptor.intercept(os, {
920
920
  handler: (t, n, o) => {
921
- var a, S, p, v;
921
+ var a, v, p, S;
922
922
  const { row: r, col: s, unitId: i, subUnitId: c, worksheet: l } = n, g = this._formulaDataModel.getArrayFormulaRange(), m = this._formulaDataModel.getArrayFormulaCellData();
923
923
  if (this._removeArrayFormulaRangeShape(), t == null)
924
924
  return o(t);
925
925
  let h = null;
926
926
  const d = this._formulaDataModel.getFormulaStringByCell(r, s, c, i);
927
- if (d !== null && (h = { f: d }), t.v != null && t.v !== "" && ((p = (S = (a = m[i]) == null ? void 0 : a[c]) == null ? void 0 : S[r]) == null ? void 0 : p[s]) == null)
927
+ if (d !== null && (h = { f: d }), t.v != null && t.v !== "" && ((p = (v = (a = m[i]) == null ? void 0 : a[c]) == null ? void 0 : v[r]) == null ? void 0 : p[s]) == null)
928
928
  return h ? { ...t, ...h } : o(t);
929
- const u = (v = g == null ? void 0 : g[i]) == null ? void 0 : v[c];
929
+ const u = (S = g == null ? void 0 : g[i]) == null ? void 0 : S[c];
930
930
  return u != null && (h = this._displayArrayFormulaRangeShape(u, r, s, i, c, l, h)), h ? { ...t, ...h } : o(t);
931
931
  }
932
932
  })
@@ -935,10 +935,10 @@ let Wt = class extends dt {
935
935
  }
936
936
  _commandExecutedListener() {
937
937
  this.disposeWithMe(this._commandService.onCommandExecuted((t, n) => {
938
- (t.id === Fo.id || t.id === Do.id && n && n.remove) && this._removeArrayFormulaRangeShape();
938
+ (t.id === Ao.id || t.id === Fo.id && n && n.remove) && this._removeArrayFormulaRangeShape();
939
939
  })), this.disposeWithMe(
940
940
  this._commandService.beforeCommandExecuted((t) => {
941
- is.id === t.id && requestIdleCallback(() => {
941
+ ss.id === t.id && requestIdleCallback(() => {
942
942
  const n = t.params, { unitId: o, subUnitId: r, rowsAutoHeightInfo: s } = n;
943
943
  this._refreshArrayFormulaRangeShapeByRow(o, r, s);
944
944
  });
@@ -947,16 +947,16 @@ let Wt = class extends dt {
947
947
  }
948
948
  _displayArrayFormulaRangeShape(t, n, o, r, s, i, c) {
949
949
  const l = this._formulaDataModel.getSheetFormulaData(r, s);
950
- return new Le(t).forValue((g, m, h) => {
950
+ return new Fe(t).forValue((g, m, h) => {
951
951
  var p;
952
952
  if (h == null)
953
953
  return !0;
954
- const { startRow: d, startColumn: u, endRow: a, endColumn: S } = h;
954
+ const { startRow: d, startColumn: u, endRow: a, endColumn: v } = h;
955
955
  if (g === n && m === o)
956
956
  return this._createArrayFormulaRangeShape(h, r), !1;
957
- if (n >= d && n <= a && o >= u && o <= S) {
958
- const v = i.getCell(d, u);
959
- if ((v == null ? void 0 : v.v) === ue.SPILL)
957
+ if (n >= d && n <= a && o >= u && o <= v) {
958
+ const S = i.getCell(d, u);
959
+ if ((S == null ? void 0 : S.v) === ue.SPILL)
960
960
  return;
961
961
  const C = (p = l == null ? void 0 : l[g]) == null ? void 0 : p[m];
962
962
  return C == null || C.f == null ? !0 : (c == null && (c = {
@@ -977,10 +977,10 @@ let Wt = class extends dt {
977
977
  style: {
978
978
  strokeWidth: 1,
979
979
  stroke: this._themeService.getColorFromTheme("primary.600"),
980
- fill: new dn(this._themeService.getColorFromTheme("white")).setAlpha(0).toString(),
980
+ fill: new un(this._themeService.getColorFromTheme("white")).setAlpha(0).toString(),
981
981
  widgets: {}
982
982
  }
983
- }, c = nn(i, r), { rowHeaderWidth: l, columnHeaderHeight: g } = r, m = new ar(s, Eo.FORMULA_EDITOR_SHOW, this._themeService, {
983
+ }, c = tn(i, r), { rowHeaderWidth: l, columnHeaderHeight: g } = r, m = new cr(s, Ro.FORMULA_EDITOR_SHOW, this._themeService, {
984
984
  highlightHeader: !1,
985
985
  rowHeaderWidth: l,
986
986
  columnHeaderHeight: g
@@ -1023,38 +1023,38 @@ let Wt = class extends dt {
1023
1023
  }
1024
1024
  }
1025
1025
  };
1026
- Wt = si([
1027
- Be(1, j(pn)),
1028
- Be(2, j(yt)),
1029
- Be(3, j(It)),
1030
- Be(4, Me),
1031
- Be(5, j(Kt)),
1032
- Be(6, pe),
1033
- Be(7, to)
1034
- ], Wt);
1035
- var ii = Object.getOwnPropertyDescriptor, ci = (e, t, n, o) => {
1036
- for (var r = o > 1 ? void 0 : o ? ii(t, n) : t, s = e.length - 1, i; s >= 0; s--)
1026
+ Vt = oi([
1027
+ He(1, q(mn)),
1028
+ He(2, q(bt)),
1029
+ He(3, q(It)),
1030
+ He(4, xe),
1031
+ He(5, q(jt)),
1032
+ He(6, me),
1033
+ He(7, eo)
1034
+ ], Vt);
1035
+ var si = Object.getOwnPropertyDescriptor, ii = (e, t, n, o) => {
1036
+ for (var r = o > 1 ? void 0 : o ? si(t, n) : t, s = e.length - 1, i; s >= 0; s--)
1037
1037
  (i = e[s]) && (r = i(r) || r);
1038
1038
  return r;
1039
- }, Xn = (e, t) => (n, o) => t(n, o, e);
1040
- const ai = {
1039
+ }, zn = (e, t) => (n, o) => t(n, o, e);
1040
+ const ci = {
1041
1041
  tl: {
1042
1042
  size: 6,
1043
1043
  color: "#409f11"
1044
1044
  }
1045
1045
  };
1046
- let Ht = class extends no {
1046
+ let Wt = class extends to {
1047
1047
  constructor(e, t) {
1048
1048
  super(), this._sheetInterceptorService = e, this._formulaDataModel = t, this.disposeWithMe(this._sheetInterceptorService.intercept(
1049
- cs.CELL_CONTENT,
1049
+ is.CELL_CONTENT,
1050
1050
  {
1051
- effect: ro.Style,
1051
+ effect: no.Style,
1052
1052
  handler: (n, o, r) => {
1053
1053
  var c, l, g, m;
1054
1054
  const s = (m = (g = (l = (c = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : c[o.unitId]) == null ? void 0 : l[o.subUnitId]) == null ? void 0 : g[o.row]) == null ? void 0 : m[o.col];
1055
- return !ur(n, !!s) || !n || (n === o.rawData && (n = { ...o.rawData }), n.markers = {
1055
+ return !lr(n, !!s) || !n || (n === o.rawData && (n = { ...o.rawData }), n.markers = {
1056
1056
  ...n == null ? void 0 : n.markers,
1057
- ...ai
1057
+ ...ci
1058
1058
  }), r(n);
1059
1059
  },
1060
1060
  priority: 10
@@ -1062,19 +1062,19 @@ let Ht = class extends no {
1062
1062
  ));
1063
1063
  }
1064
1064
  };
1065
- Ht = ci([
1066
- Xn(0, j(pn)),
1067
- Xn(1, j(yt))
1068
- ], Ht);
1069
- function li() {
1070
- const e = T(ds), t = T(pe), n = Se(e.progress$), o = Lt(() => {
1071
- t.executeCommand(Lo.id);
1072
- }, [t]), r = Lt(() => {
1065
+ Wt = ii([
1066
+ zn(0, q(mn)),
1067
+ zn(1, q(bt))
1068
+ ], Wt);
1069
+ function ai() {
1070
+ const e = T(us), t = T(me), n = Se(e.progress$), o = Dt(() => {
1071
+ t.executeCommand(Do.id);
1072
+ }, [t]), r = Dt(() => {
1073
1073
  e.clearProgress();
1074
1074
  }, [e]);
1075
- return /* @__PURE__ */ M(ms, { progress: n, onTerminate: o, onClearProgress: r });
1075
+ return /* @__PURE__ */ M(gs, { progress: n, onTerminate: o, onClearProgress: r });
1076
1076
  }
1077
- function ui(e, t) {
1077
+ function li(e, t) {
1078
1078
  return Object.keys(e).filter((n) => isNaN(Number(n)) && n !== "DefinedName").map((n) => ({
1079
1079
  label: t.t(`formula.functionType.${n.toLocaleLowerCase()}`),
1080
1080
  value: `${e[n]}`
@@ -1090,7 +1090,7 @@ function Nr(e) {
1090
1090
  if (e.require && e.repeat)
1091
1091
  return `${e.name},...`;
1092
1092
  }
1093
- function xr(e) {
1093
+ function Or(e) {
1094
1094
  const { prefix: t, value: n } = e;
1095
1095
  return /* @__PURE__ */ W("div", { children: [
1096
1096
  /* @__PURE__ */ W("span", { children: [
@@ -1104,7 +1104,7 @@ function xr(e) {
1104
1104
  ")"
1105
1105
  ] });
1106
1106
  }
1107
- function Ct(e) {
1107
+ function vt(e) {
1108
1108
  const { className: t, value: n, title: o } = e;
1109
1109
  return /* @__PURE__ */ W("div", { className: "univer-mb-2 univer-text-xs", children: [
1110
1110
  /* @__PURE__ */ M(
@@ -1123,125 +1123,258 @@ function Ct(e) {
1123
1123
  )
1124
1124
  ] });
1125
1125
  }
1126
- function di(e) {
1126
+ function ui(e) {
1127
1127
  const { functionInfo: t, onChange: n } = e;
1128
1128
  if (!t) return null;
1129
1129
  const [o, r] = V([]), [s, i] = V(t.functionParameter), [c, l] = V(-1);
1130
1130
  return /* @__PURE__ */ W("div", { children: [
1131
- /* @__PURE__ */ M("div", { className: re("univer-h-[364px] univer-overflow-y-auto", ut), children: s.map((g, m) => /* @__PURE__ */ W("div", { children: [
1131
+ /* @__PURE__ */ M("div", { className: re("univer-h-[364px] univer-overflow-y-auto", lt), children: s.map((g, m) => /* @__PURE__ */ W("div", { children: [
1132
1132
  /* @__PURE__ */ M("div", { className: "univer-text-sm", children: g.name }),
1133
1133
  /* @__PURE__ */ M("div", { className: "univer-mb-2 univer-mt-1" })
1134
1134
  ] }, m)) }),
1135
- /* @__PURE__ */ M("div", { className: re("univer-flex-1 univer-p-3", Es), children: /* @__PURE__ */ M(
1136
- Ct,
1135
+ /* @__PURE__ */ M("div", { className: re("univer-flex-1 univer-p-3", Rs), children: /* @__PURE__ */ M(
1136
+ vt,
1137
1137
  {
1138
- title: c === -1 ? /* @__PURE__ */ M(xr, { prefix: t.functionName, value: s }) : s[c].name,
1138
+ title: c === -1 ? /* @__PURE__ */ M(Or, { prefix: t.functionName, value: s }) : s[c].name,
1139
1139
  value: c === -1 ? t.description : s[c].detail
1140
1140
  }
1141
1141
  ) })
1142
1142
  ] });
1143
1143
  }
1144
- var me = function() {
1145
- return me = Object.assign || function(e) {
1146
- for (var t, n = 1, o = arguments.length; n < o; n++) {
1147
- t = arguments[n];
1148
- for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
1149
- }
1150
- return e;
1151
- }, me.apply(this, arguments);
1152
- }, hi = function(e, t) {
1153
- var n = {};
1154
- for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && t.indexOf(o) < 0 && (n[o] = e[o]);
1155
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
1156
- for (var r = 0, o = Object.getOwnPropertySymbols(e); r < o.length; r++)
1157
- t.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[r]) && (n[o[r]] = e[o[r]]);
1158
- return n;
1159
- }, tt = we(function(e, t) {
1160
- var n = e.icon, o = e.id, r = e.className, s = e.extend, i = hi(e, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(o, " ").concat(r || "").trim(), l = z("_".concat(mi()));
1161
- return Mr(n, "".concat(o), { defIds: n.defIds, idSuffix: l.current }, me({ ref: t, className: c }, i), s);
1162
- });
1163
- function Mr(e, t, n, o, r) {
1164
- return et(e.tag, me(me({ key: t }, fi(e, n, r)), o), (gi(e, n).children || []).map(function(s, i) {
1165
- return Mr(s, "".concat(t, "-").concat(e.tag, "-").concat(i), n, void 0, r);
1166
- }));
1144
+ function et({ ref: e, ...t }) {
1145
+ const { icon: n, id: o, className: r, extend: s, ...i } = t, c = `univerjs-icon univerjs-icon-${o} ${r || ""}`.trim(), l = z(`_${fi()}`);
1146
+ return xr(n, `${o}`, {
1147
+ defIds: n.defIds,
1148
+ idSuffix: l.current
1149
+ }, {
1150
+ ref: e,
1151
+ className: c,
1152
+ ...i
1153
+ }, s);
1154
+ }
1155
+ function xr(e, t, n, o, r) {
1156
+ return Je(e.tag, {
1157
+ key: t,
1158
+ ...di(e, n, r),
1159
+ ...o
1160
+ }, (hi(e, n).children || []).map((s, i) => xr(s, `${t}-${e.tag}-${i}`, n, void 0, r)));
1167
1161
  }
1168
- function fi(e, t, n) {
1169
- var o = me({}, e.attrs);
1170
- n != null && n.colorChannel1 && o.fill === "colorChannel1" && (o.fill = n.colorChannel1), e.tag === "mask" && o.id && (o.id = o.id + t.idSuffix), Object.entries(o).forEach(function(s) {
1171
- var i = s[0], c = s[1];
1172
- i === "mask" && typeof c == "string" && (o[i] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
1162
+ function di(e, t, n) {
1163
+ const o = { ...e.attrs };
1164
+ n != null && n.colorChannel1 && o.fill === "colorChannel1" && (o.fill = n.colorChannel1), e.tag === "mask" && o.id && (o.id = o.id + t.idSuffix), Object.entries(o).forEach(([s, i]) => {
1165
+ s === "mask" && typeof i == "string" && (o[s] = i.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
1173
1166
  });
1174
- var r = t.defIds;
1175
- return !r || r.length === 0 || (e.tag === "use" && o["xlink:href"] && (o["xlink:href"] = o["xlink:href"] + t.idSuffix), Object.entries(o).forEach(function(s) {
1176
- var i = s[0], c = s[1];
1177
- typeof c == "string" && (o[i] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
1167
+ const { defIds: r } = t;
1168
+ return !r || r.length === 0 || (e.tag === "use" && o["xlink:href"] && (o["xlink:href"] = o["xlink:href"] + t.idSuffix), Object.entries(o).forEach(([s, i]) => {
1169
+ typeof i == "string" && (o[s] = i.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
1178
1170
  })), o;
1179
1171
  }
1180
- function gi(e, t) {
1181
- var n, o = t.defIds;
1182
- return !o || o.length === 0 ? e : e.tag === "defs" && (!((n = e.children) === null || n === void 0) && n.length) ? me(me({}, e), { children: e.children.map(function(r) {
1183
- return typeof r.attrs.id == "string" && o && o.includes(r.attrs.id) ? me(me({}, r), { attrs: me(me({}, r.attrs), { id: r.attrs.id + t.idSuffix }) }) : r;
1184
- }) }) : e;
1172
+ function hi(e, t) {
1173
+ var o;
1174
+ const { defIds: n } = t;
1175
+ return !n || n.length === 0 ? e : e.tag === "defs" && ((o = e.children) != null && o.length) ? {
1176
+ ...e,
1177
+ children: e.children.map((r) => typeof r.attrs.id == "string" && n && n.includes(r.attrs.id) ? {
1178
+ ...r,
1179
+ attrs: {
1180
+ ...r.attrs,
1181
+ id: r.attrs.id + t.idSuffix
1182
+ }
1183
+ } : r)
1184
+ } : e;
1185
1185
  }
1186
- function mi() {
1186
+ function fi() {
1187
1187
  return Math.random().toString(36).substring(2, 8);
1188
1188
  }
1189
- tt.displayName = "UniverIcon";
1190
- var pi = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, wr = we(function(e, t) {
1191
- return et(tt, Object.assign({}, e, {
1189
+ et.displayName = "UniverIcon";
1190
+ const gi = {
1191
+ tag: "svg",
1192
+ attrs: {
1193
+ xmlns: "http://www.w3.org/2000/svg",
1194
+ fill: "none",
1195
+ viewBox: "0 0 16 16",
1196
+ width: "1em",
1197
+ height: "1em"
1198
+ },
1199
+ children: [{
1200
+ tag: "path",
1201
+ attrs: {
1202
+ fill: "currentColor",
1203
+ d: "M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z",
1204
+ fillRule: "evenodd",
1205
+ clipRule: "evenodd"
1206
+ }
1207
+ }]
1208
+ }, Mr = Le(function(t, n) {
1209
+ return Je(et, Object.assign({}, t, {
1192
1210
  id: "check-mark-icon",
1193
- ref: t,
1194
- icon: pi
1211
+ ref: n,
1212
+ icon: gi
1195
1213
  }));
1196
1214
  });
1197
- wr.displayName = "CheckMarkIcon";
1198
- var vi = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.71274 2.86421C3.47843 2.6299 3.09853 2.6299 2.86421 2.86421C2.6299 3.09853 2.6299 3.47843 2.86421 3.71274L7.15154 8.00007L2.86421 12.2874C2.6299 12.5217 2.6299 12.9016 2.86421 13.1359C3.09853 13.3702 3.47843 13.3702 3.71274 13.1359L8.00007 8.84859L12.2874 13.1359C12.5217 13.3702 12.9016 13.3702 13.1359 13.1359C13.3702 12.9016 13.3702 12.5217 13.1359 12.2874L8.84859 8.00007L13.1359 3.71274C13.3702 3.47843 13.3702 3.09853 13.1359 2.86421C12.9016 2.6299 12.5217 2.6299 12.2874 2.86421L8.00007 7.15154L3.71274 2.86421Z" } }] }, kr = we(function(e, t) {
1199
- return et(tt, Object.assign({}, e, {
1215
+ Mr.displayName = "CheckMarkIcon";
1216
+ const mi = {
1217
+ tag: "svg",
1218
+ attrs: {
1219
+ xmlns: "http://www.w3.org/2000/svg",
1220
+ fill: "none",
1221
+ viewBox: "0 0 16 16",
1222
+ width: "1em",
1223
+ height: "1em"
1224
+ },
1225
+ children: [{
1226
+ tag: "path",
1227
+ attrs: {
1228
+ fill: "currentColor",
1229
+ d: "M3.71274 2.86421C3.47843 2.6299 3.09853 2.6299 2.86421 2.86421C2.6299 3.09853 2.6299 3.47843 2.86421 3.71274L7.15154 8.00007L2.86421 12.2874C2.6299 12.5217 2.6299 12.9016 2.86421 13.1359C3.09853 13.3702 3.47843 13.3702 3.71274 13.1359L8.00007 8.84859L12.2874 13.1359C12.5217 13.3702 12.9016 13.3702 13.1359 13.1359C13.3702 12.9016 13.3702 12.5217 13.1359 12.2874L8.84859 8.00007L13.1359 3.71274C13.3702 3.47843 13.3702 3.09853 13.1359 2.86421C12.9016 2.6299 12.5217 2.6299 12.2874 2.86421L8.00007 7.15154L3.71274 2.86421Z"
1230
+ }
1231
+ }]
1232
+ }, wr = Le(function(t, n) {
1233
+ return Je(et, Object.assign({}, t, {
1200
1234
  id: "close-icon",
1201
- ref: t,
1202
- icon: vi
1235
+ ref: n,
1236
+ icon: mi
1203
1237
  }));
1204
1238
  });
1205
- kr.displayName = "CloseIcon";
1206
- var Si = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993 0.866699 5.9313 0.866699H10.069C10.4004 0.866699 10.669 1.13533 10.669 1.4667C10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443C14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928L9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171C10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778L9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539C9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263L6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539C5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778L6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Ar = we(function(e, t) {
1207
- return et(tt, Object.assign({}, e, {
1239
+ wr.displayName = "CloseIcon";
1240
+ const pi = {
1241
+ tag: "svg",
1242
+ attrs: {
1243
+ xmlns: "http://www.w3.org/2000/svg",
1244
+ fill: "none",
1245
+ viewBox: "0 0 16 16",
1246
+ width: "1em",
1247
+ height: "1em"
1248
+ },
1249
+ children: [
1250
+ {
1251
+ tag: "path",
1252
+ attrs: {
1253
+ fill: "currentColor",
1254
+ d: "M5.3313 1.4667C5.3313 1.13533 5.59993 0.866699 5.9313 0.866699H10.069C10.4004 0.866699 10.669 1.13533 10.669 1.4667C10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667Z"
1255
+ }
1256
+ },
1257
+ {
1258
+ tag: "path",
1259
+ attrs: {
1260
+ fill: "currentColor",
1261
+ d: "M1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443C14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443Z"
1262
+ }
1263
+ },
1264
+ {
1265
+ tag: "path",
1266
+ attrs: {
1267
+ fill: "currentColor",
1268
+ d: "M6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928L9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171C10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778L9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539C9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263L6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539C5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778L6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171Z"
1269
+ }
1270
+ },
1271
+ {
1272
+ tag: "path",
1273
+ attrs: {
1274
+ fill: "currentColor",
1275
+ d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",
1276
+ fillRule: "evenodd",
1277
+ clipRule: "evenodd"
1278
+ }
1279
+ }
1280
+ ]
1281
+ }, kr = Le(function(t, n) {
1282
+ return Je(et, Object.assign({}, t, {
1208
1283
  id: "delete-icon",
1209
- ref: t,
1210
- icon: Si
1284
+ ref: n,
1285
+ icon: pi
1211
1286
  }));
1212
1287
  });
1213
- Ar.displayName = "DeleteIcon";
1214
- var Ci = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z" } }] }, Fr = we(function(e, t) {
1215
- return et(tt, Object.assign({}, e, {
1288
+ kr.displayName = "DeleteIcon";
1289
+ const Si = {
1290
+ tag: "svg",
1291
+ attrs: {
1292
+ xmlns: "http://www.w3.org/2000/svg",
1293
+ fill: "none",
1294
+ viewBox: "0 0 16 16",
1295
+ width: "1em",
1296
+ height: "1em"
1297
+ },
1298
+ children: [{
1299
+ tag: "path",
1300
+ attrs: {
1301
+ fill: "currentColor",
1302
+ d: "M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"
1303
+ }
1304
+ }]
1305
+ }, Ar = Le(function(t, n) {
1306
+ return Je(et, Object.assign({}, t, {
1216
1307
  id: "increase-icon",
1217
- ref: t,
1218
- icon: Ci
1308
+ ref: n,
1309
+ icon: Si
1219
1310
  }));
1220
1311
  });
1221
- Fr.displayName = "IncreaseIcon";
1222
- var _i = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.90913 3.57564C6.14345 3.34132 6.52335 3.34132 6.75766 3.57564L10.7577 7.57564C10.992 7.80995 10.992 8.18985 10.7577 8.42417L6.75766 12.4242C6.52335 12.6585 6.14345 12.6585 5.90913 12.4242C5.67482 12.1899 5.67482 11.81 5.90913 11.5756L9.48487 7.9999L5.90913 4.42417C5.67482 4.18985 5.67482 3.80995 5.90913 3.57564Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Dr = we(function(e, t) {
1223
- return et(tt, Object.assign({}, e, {
1312
+ Ar.displayName = "IncreaseIcon";
1313
+ const vi = {
1314
+ tag: "svg",
1315
+ attrs: {
1316
+ xmlns: "http://www.w3.org/2000/svg",
1317
+ fill: "none",
1318
+ viewBox: "0 0 16 16",
1319
+ width: "1em",
1320
+ height: "1em"
1321
+ },
1322
+ children: [{
1323
+ tag: "path",
1324
+ attrs: {
1325
+ fill: "currentColor",
1326
+ d: "M5.90913 3.57564C6.14345 3.34132 6.52335 3.34132 6.75766 3.57564L10.7577 7.57564C10.992 7.80995 10.992 8.18985 10.7577 8.42417L6.75766 12.4242C6.52335 12.6585 6.14345 12.6585 5.90913 12.4242C5.67482 12.1899 5.67482 11.81 5.90913 11.5756L9.48487 7.9999L5.90913 4.42417C5.67482 4.18985 5.67482 3.80995 5.90913 3.57564Z",
1327
+ fillRule: "evenodd",
1328
+ clipRule: "evenodd"
1329
+ }
1330
+ }]
1331
+ }, Fr = Le(function(t, n) {
1332
+ return Je(et, Object.assign({}, t, {
1224
1333
  id: "more-icon",
1225
- ref: t,
1226
- icon: _i
1334
+ ref: n,
1335
+ icon: vi
1227
1336
  }));
1228
1337
  });
1229
- Dr.displayName = "MoreIcon";
1230
- var Ri = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.6185 12.4423C12.5907 12.2749 12.7773 12.15 12.9343 12.2308L15.4242 13.5126C15.6102 13.6084 15.5544 13.8745 15.3439 13.8955L14.2456 14.184L13.4521 15.1286C13.3495 15.2939 13.085 15.2463 13.0534 15.0568L12.6185 12.4423Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1 3.6C1 2.16406 2.16406 1 3.6 1H12.3C13.7359 1 14.9 2.16406 14.9 3.6V5.81156C14.9003 5.81881 14.9004 5.82609 14.9004 5.8334C14.9004 5.84071 14.9003 5.84799 14.9 5.85524V10.045C14.9003 10.0522 14.9004 10.0595 14.9004 10.0668C14.9004 10.3982 14.6318 10.6668 14.3004 10.6668H11.1668C10.8907 10.6668 10.6668 10.8907 10.6668 11.1668V14.3C10.6668 14.6314 10.3982 14.9 10.0668 14.9L10.05 14.8998L3.6 14.9C2.16406 14.9 1 13.7359 1 12.3V3.6ZM13.2 5.2334C13.4761 5.2334 13.7 5.00954 13.7 4.7334V3.6C13.7 2.8268 13.0732 2.2 12.3 2.2H11.1668C10.8907 2.2 10.6668 2.42386 10.6668 2.7V4.7334C10.6668 5.00954 10.8907 5.2334 11.1668 5.2334H13.2ZM10.6668 6.9334C10.6668 6.65726 10.8907 6.4334 11.1668 6.4334H13.2C13.4761 6.4334 13.7 6.65726 13.7 6.9334V8.9668C13.7 9.24294 13.4761 9.4668 13.2 9.4668H11.1668C10.8907 9.4668 10.6668 9.24294 10.6668 8.9668V6.9334ZM8.9668 5.2334C9.24294 5.2334 9.4668 5.00954 9.4668 4.7334V2.7C9.4668 2.42386 9.24294 2.2 8.9668 2.2H6.9334C6.65726 2.2 6.4334 2.42386 6.4334 2.7V4.7334C6.4334 5.00954 6.65726 5.2334 6.9334 5.2334L8.9668 5.2334ZM6.4334 6.9334C6.4334 6.65726 6.65726 6.4334 6.9334 6.4334L8.9668 6.4334C9.24294 6.4334 9.4668 6.65726 9.4668 6.9334V8.9668C9.4668 9.24294 9.24294 9.4668 8.9668 9.4668L6.9334 9.4668C6.65726 9.4668 6.4334 9.24294 6.4334 8.9668V6.9334ZM4.7334 5.2334C5.00954 5.2334 5.2334 5.00954 5.2334 4.7334V2.7C5.2334 2.42386 5.00954 2.2 4.7334 2.2H3.6C2.8268 2.2 2.2 2.8268 2.2 3.6V4.7334C2.2 5.00954 2.42386 5.2334 2.7 5.2334H4.7334ZM2.2 6.9334C2.2 6.65726 2.42386 6.4334 2.7 6.4334H4.7334C5.00954 6.4334 5.2334 6.65725 5.2334 6.9334V8.9668C5.2334 9.24294 5.00954 9.4668 4.7334 9.4668H2.7C2.42386 9.4668 2.2 9.24294 2.2 8.9668V6.9334ZM5.2334 11.1668C5.2334 10.8907 5.00954 10.6668 4.7334 10.6668H2.7C2.42386 10.6668 2.2 10.8907 2.2 11.1668V12.3C2.2 13.0732 2.8268 13.7 3.6 13.7H4.7334C5.00954 13.7 5.2334 13.4761 5.2334 13.2V11.1668ZM9.4668 11.1668C9.4668 10.8907 9.24294 10.6668 8.9668 10.6668H6.9334C6.65726 10.6668 6.4334 10.8907 6.4334 11.1668V13.2C6.4334 13.4761 6.65726 13.7 6.9334 13.7H8.9668C9.24294 13.7 9.4668 13.4761 9.4668 13.2V11.1668Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Lr = we(function(e, t) {
1231
- return et(tt, Object.assign({}, e, {
1338
+ Fr.displayName = "MoreIcon";
1339
+ const Ci = {
1340
+ tag: "svg",
1341
+ attrs: {
1342
+ xmlns: "http://www.w3.org/2000/svg",
1343
+ fill: "none",
1344
+ viewBox: "0 0 16 16",
1345
+ width: "1em",
1346
+ height: "1em"
1347
+ },
1348
+ children: [{
1349
+ tag: "path",
1350
+ attrs: {
1351
+ fill: "currentColor",
1352
+ d: "M12.6185 12.4423C12.5907 12.2749 12.7773 12.15 12.9343 12.2308L15.4242 13.5126C15.6102 13.6084 15.5544 13.8745 15.3439 13.8955L14.2456 14.184L13.4521 15.1286C13.3495 15.2939 13.085 15.2463 13.0534 15.0568L12.6185 12.4423Z"
1353
+ }
1354
+ }, {
1355
+ tag: "path",
1356
+ attrs: {
1357
+ fill: "currentColor",
1358
+ d: "M1 3.6C1 2.16406 2.16406 1 3.6 1H12.3C13.7359 1 14.9 2.16406 14.9 3.6V5.81156C14.9003 5.81881 14.9004 5.82609 14.9004 5.8334C14.9004 5.84071 14.9003 5.84799 14.9 5.85524V10.045C14.9003 10.0522 14.9004 10.0595 14.9004 10.0668C14.9004 10.3982 14.6318 10.6668 14.3004 10.6668H11.1668C10.8907 10.6668 10.6668 10.8907 10.6668 11.1668V14.3C10.6668 14.6314 10.3982 14.9 10.0668 14.9L10.05 14.8998L3.6 14.9C2.16406 14.9 1 13.7359 1 12.3V3.6ZM13.2 5.2334C13.4761 5.2334 13.7 5.00954 13.7 4.7334V3.6C13.7 2.8268 13.0732 2.2 12.3 2.2H11.1668C10.8907 2.2 10.6668 2.42386 10.6668 2.7V4.7334C10.6668 5.00954 10.8907 5.2334 11.1668 5.2334H13.2ZM10.6668 6.9334C10.6668 6.65726 10.8907 6.4334 11.1668 6.4334H13.2C13.4761 6.4334 13.7 6.65726 13.7 6.9334V8.9668C13.7 9.24294 13.4761 9.4668 13.2 9.4668H11.1668C10.8907 9.4668 10.6668 9.24294 10.6668 8.9668V6.9334ZM8.9668 5.2334C9.24294 5.2334 9.4668 5.00954 9.4668 4.7334V2.7C9.4668 2.42386 9.24294 2.2 8.9668 2.2H6.9334C6.65726 2.2 6.4334 2.42386 6.4334 2.7V4.7334C6.4334 5.00954 6.65726 5.2334 6.9334 5.2334L8.9668 5.2334ZM6.4334 6.9334C6.4334 6.65726 6.65726 6.4334 6.9334 6.4334L8.9668 6.4334C9.24294 6.4334 9.4668 6.65726 9.4668 6.9334V8.9668C9.4668 9.24294 9.24294 9.4668 8.9668 9.4668L6.9334 9.4668C6.65726 9.4668 6.4334 9.24294 6.4334 8.9668V6.9334ZM4.7334 5.2334C5.00954 5.2334 5.2334 5.00954 5.2334 4.7334V2.7C5.2334 2.42386 5.00954 2.2 4.7334 2.2H3.6C2.8268 2.2 2.2 2.8268 2.2 3.6V4.7334C2.2 5.00954 2.42386 5.2334 2.7 5.2334H4.7334ZM2.2 6.9334C2.2 6.65726 2.42386 6.4334 2.7 6.4334H4.7334C5.00954 6.4334 5.2334 6.65725 5.2334 6.9334V8.9668C5.2334 9.24294 5.00954 9.4668 4.7334 9.4668H2.7C2.42386 9.4668 2.2 9.24294 2.2 8.9668V6.9334ZM5.2334 11.1668C5.2334 10.8907 5.00954 10.6668 4.7334 10.6668H2.7C2.42386 10.6668 2.2 10.8907 2.2 11.1668V12.3C2.2 13.0732 2.8268 13.7 3.6 13.7H4.7334C5.00954 13.7 5.2334 13.4761 5.2334 13.2V11.1668ZM9.4668 11.1668C9.4668 10.8907 9.24294 10.6668 8.9668 10.6668H6.9334C6.65726 10.6668 6.4334 10.8907 6.4334 11.1668V13.2C6.4334 13.4761 6.65726 13.7 6.9334 13.7H8.9668C9.24294 13.7 9.4668 13.4761 9.4668 13.2V11.1668Z",
1359
+ fillRule: "evenodd",
1360
+ clipRule: "evenodd"
1361
+ }
1362
+ }]
1363
+ }, Dr = Le(function(t, n) {
1364
+ return Je(et, Object.assign({}, t, {
1232
1365
  id: "select-range-icon",
1233
- ref: t,
1234
- icon: Ri
1366
+ ref: n,
1367
+ icon: Ci
1235
1368
  }));
1236
1369
  });
1237
- Lr.displayName = "SelectRangeIcon";
1238
- function Ei(e) {
1239
- const { onChange: t } = e, n = "-1", [o, r] = V(""), [s, i] = V([]), [c, l] = V(0), [g, m] = V(n), [h, d] = V(0), [u, a] = V(null), S = T(Gt), p = T(ht), v = T(vn), C = Se(v.sidebarOptions$), _ = ui(dr, p);
1370
+ Dr.displayName = "SelectRangeIcon";
1371
+ function _i(e) {
1372
+ const { onChange: t } = e, n = "-1", [o, r] = V(""), [s, i] = V([]), [c, l] = V(0), [g, m] = V(n), [h, d] = V(0), [u, a] = V(null), v = T(Yt), p = T(dt), S = T(pn), C = Se(S.sidebarOptions$), _ = li(ur, p);
1240
1373
  _.unshift({
1241
1374
  label: p.t("formula.moreFunctions.allFunctions"),
1242
1375
  value: n
1243
1376
  });
1244
- const I = p.t("formula.prompt.required"), f = p.t("formula.prompt.optional");
1377
+ const E = p.t("formula.prompt.required"), f = p.t("formula.prompt.optional");
1245
1378
  $(() => {
1246
1379
  A(n);
1247
1380
  }, []), $(() => {
@@ -1249,44 +1382,44 @@ function Ei(e) {
1249
1382
  }, [s]), $(() => {
1250
1383
  C != null && C.visible && (r(""), i([]), l(0), m(n), d(0), a(null), A(n));
1251
1384
  }, [C]);
1252
- const b = (E) => {
1253
- if (o.trim() === "") return E;
1385
+ const b = (I) => {
1386
+ if (o.trim() === "") return I;
1254
1387
  const x = new RegExp(`(${o.toLocaleUpperCase()})`);
1255
- return E.split(x).filter(Boolean).map((w, D) => w.match(x) ? /* @__PURE__ */ M("span", { className: "univer-text-red-500", children: w }, D) : w);
1256
- }, y = (E) => {
1388
+ return I.split(x).filter(Boolean).map((w, D) => w.match(x) ? /* @__PURE__ */ M("span", { className: "univer-text-red-500", children: w }, D) : w);
1389
+ }, y = (I) => {
1257
1390
  if (s.length === 0) {
1258
1391
  a(null);
1259
1392
  return;
1260
1393
  }
1261
- d(E);
1262
- const x = S.getFunctionInfo(s[E].name);
1394
+ d(I);
1395
+ const x = v.getFunctionInfo(s[I].name);
1263
1396
  if (!x) {
1264
1397
  a(null);
1265
1398
  return;
1266
1399
  }
1267
1400
  a(x), t(x);
1268
1401
  };
1269
- function A(E) {
1270
- m(E);
1271
- const x = S.getSearchListByType(+E);
1402
+ function A(I) {
1403
+ m(I);
1404
+ const x = v.getSearchListByType(+I);
1272
1405
  i(x);
1273
1406
  }
1274
- function F(E) {
1275
- r(E);
1276
- const x = S.getSearchListByName(E);
1407
+ function F(I) {
1408
+ r(I);
1409
+ const x = v.getSearchListByName(I);
1277
1410
  i(x);
1278
1411
  }
1279
- function O(E) {
1280
- if (E.stopPropagation(), E.key === "ArrowDown") {
1412
+ function N(I) {
1413
+ if (I.stopPropagation(), I.key === "ArrowDown") {
1281
1414
  const x = c + 1;
1282
1415
  l(x === s.length ? 0 : x);
1283
- } else if (E.key === "ArrowUp") {
1416
+ } else if (I.key === "ArrowUp") {
1284
1417
  const x = c - 1;
1285
1418
  l(x === -1 ? s.length - 1 : x);
1286
- } else E.key === "Enter" && y(c);
1419
+ } else I.key === "Enter" && y(c);
1287
1420
  }
1288
- const N = (E) => {
1289
- l(E);
1421
+ const O = (I) => {
1422
+ l(I);
1290
1423
  }, k = () => {
1291
1424
  l(-1);
1292
1425
  };
@@ -1294,10 +1427,10 @@ function Ei(e) {
1294
1427
  /* @__PURE__ */ W("div", { className: "univer-flex univer-items-center univer-justify-between univer-gap-2", children: [
1295
1428
  /* @__PURE__ */ M(Is, { value: g, options: _, onChange: A }),
1296
1429
  /* @__PURE__ */ M(
1297
- Rr,
1430
+ _r,
1298
1431
  {
1299
1432
  placeholder: p.t("formula.moreFunctions.searchFunctionPlaceholder"),
1300
- onKeyDown: O,
1433
+ onKeyDown: N,
1301
1434
  value: o,
1302
1435
  onChange: F,
1303
1436
  size: "small",
@@ -1308,76 +1441,76 @@ function Ei(e) {
1308
1441
  s.length > 0 && /* @__PURE__ */ M(
1309
1442
  "ul",
1310
1443
  {
1311
- className: re("univer-mb-0 univer-mt-2 univer-box-border univer-max-h-72 univer-w-full univer-select-none univer-list-none univer-overflow-y-auto univer-rounded univer-p-3 univer-outline-none", Sn, ut),
1312
- onKeyDown: O,
1444
+ className: re("univer-mb-0 univer-mt-2 univer-box-border univer-max-h-72 univer-w-full univer-select-none univer-list-none univer-overflow-y-auto univer-rounded univer-p-3 univer-outline-none", Sn, lt),
1445
+ onKeyDown: N,
1313
1446
  tabIndex: -1,
1314
- children: s.map(({ name: E }, x) => /* @__PURE__ */ W(
1447
+ children: s.map(({ name: I }, x) => /* @__PURE__ */ W(
1315
1448
  "li",
1316
1449
  {
1317
1450
  className: re("univer-relative univer-box-border univer-cursor-pointer univer-rounded univer-px-7 univer-py-1 univer-text-sm univer-text-gray-900 univer-transition-colors dark:!univer-text-white", {
1318
1451
  "univer-bg-gray-200 dark:!univer-bg-gray-600": c === x
1319
1452
  }),
1320
- onMouseEnter: () => N(x),
1453
+ onMouseEnter: () => O(x),
1321
1454
  onMouseLeave: k,
1322
1455
  onClick: () => y(x),
1323
1456
  children: [
1324
1457
  h === x && /* @__PURE__ */ M(
1325
- wr,
1458
+ Mr,
1326
1459
  {
1327
1460
  className: "univer-absolute univer-left-1.5 univer-top-1/2 univer-inline-flex -univer-translate-y-1/2 univer-text-base univer-text-primary-600"
1328
1461
  }
1329
1462
  ),
1330
- /* @__PURE__ */ M("span", { className: "univer-block", children: b(E) })
1463
+ /* @__PURE__ */ M("span", { className: "univer-block", children: b(I) })
1331
1464
  ]
1332
1465
  },
1333
1466
  x
1334
1467
  ))
1335
1468
  }
1336
1469
  ),
1337
- u && /* @__PURE__ */ W("div", { className: re("univer-mx-0 univer-my-2 univer-overflow-y-auto", ut), children: [
1338
- /* @__PURE__ */ M(Ct, { title: u.functionName, value: u.description }),
1470
+ u && /* @__PURE__ */ W("div", { className: re("univer-mx-0 univer-my-2 univer-overflow-y-auto", lt), children: [
1471
+ /* @__PURE__ */ M(vt, { title: u.functionName, value: u.description }),
1339
1472
  /* @__PURE__ */ M(
1340
- Ct,
1473
+ vt,
1341
1474
  {
1342
1475
  title: p.t("formula.moreFunctions.syntax"),
1343
- value: /* @__PURE__ */ M(xr, { prefix: u.functionName, value: u.functionParameter })
1476
+ value: /* @__PURE__ */ M(Or, { prefix: u.functionName, value: u.functionParameter })
1344
1477
  }
1345
1478
  ),
1346
1479
  /* @__PURE__ */ M(
1347
- Ct,
1480
+ vt,
1348
1481
  {
1349
1482
  title: p.t("formula.prompt.helpExample"),
1350
- value: `${u.functionName}(${u.functionParameter.map((E) => E.example).join(",")})`
1483
+ value: `${u.functionName}(${u.functionParameter.map((I) => I.example).join(",")})`
1351
1484
  }
1352
1485
  ),
1353
- u.functionParameter && u.functionParameter.map((E) => /* @__PURE__ */ M(
1354
- Ct,
1486
+ u.functionParameter && u.functionParameter.map((I) => /* @__PURE__ */ M(
1487
+ vt,
1355
1488
  {
1356
- title: E.name,
1357
- value: `${E.require ? I : f} ${E.detail}`
1489
+ title: I.name,
1490
+ value: `${I.require ? E : f} ${I.detail}`
1358
1491
  },
1359
- E.name
1492
+ I.name
1360
1493
  ))
1361
1494
  ] })
1362
1495
  ] });
1363
1496
  }
1364
- function Ii() {
1497
+ function Ri() {
1365
1498
  const e = Io(), [t, n] = V(!0), [o, r] = V(!1), [s, i] = V(null);
1366
- T(hn);
1367
- const c = T(ht), l = T(Ge), g = T(ne), m = T(pe);
1499
+ T(dn);
1500
+ const c = T(dt), l = T(Ye), g = T(ne), m = T(me);
1368
1501
  function h() {
1369
1502
  n(!t), r(!o);
1370
1503
  }
1371
1504
  function d() {
1372
- const u = vr(g);
1505
+ const u = pr(g);
1373
1506
  if (!u) return;
1374
- m.executeCommand(ir.id, {
1507
+ m.executeCommand(sr.id, {
1375
1508
  visible: !0,
1376
1509
  unitId: u.unitId,
1377
- eventType: xe.Dblclick
1510
+ eventType: Oe.Dblclick
1378
1511
  });
1379
- const a = l.getEditor(ln), S = l.getEditor(nr), p = `=${s == null ? void 0 : s.functionName}(`;
1380
- a == null || a.replaceText(p), S == null || S.replaceText(p, !1);
1512
+ const a = l.getEditor(an), v = l.getEditor(tr), p = `=${s == null ? void 0 : s.functionName}(`;
1513
+ a == null || a.replaceText(p), v == null || v.replaceText(p, !1);
1381
1514
  }
1382
1515
  return /* @__PURE__ */ W(
1383
1516
  "div",
@@ -1385,12 +1518,12 @@ function Ii() {
1385
1518
  "data-u-comp": "sheets-formula-functions-panel",
1386
1519
  className: "univer-box-border univer-flex univer-h-full univer-flex-col univer-justify-between univer-py-2",
1387
1520
  children: [
1388
- t && /* @__PURE__ */ M(Ei, { onChange: i }),
1389
- o && /* @__PURE__ */ M(di, { functionInfo: s, onChange: () => {
1521
+ t && /* @__PURE__ */ M(_i, { onChange: i }),
1522
+ o && /* @__PURE__ */ M(ui, { functionInfo: s, onChange: () => {
1390
1523
  } }),
1391
1524
  /* @__PURE__ */ W("div", { className: "univer-flex univer-justify-end", children: [
1392
1525
  o && /* @__PURE__ */ M(
1393
- at,
1526
+ ct,
1394
1527
  {
1395
1528
  variant: "primary",
1396
1529
  onClick: h,
@@ -1398,9 +1531,9 @@ function Ii() {
1398
1531
  children: c.t("formula.moreFunctions.next")
1399
1532
  }
1400
1533
  ),
1401
- o && /* @__PURE__ */ M(at, { onClick: h, className: "univer-mb-5 univer-ml-4 univer-mr-0 univer-mt-0", children: c.t("formula.moreFunctions.prev") }),
1534
+ o && /* @__PURE__ */ M(ct, { onClick: h, className: "univer-mb-5 univer-ml-4 univer-mr-0 univer-mt-0", children: c.t("formula.moreFunctions.prev") }),
1402
1535
  t && !!e && /* @__PURE__ */ M(
1403
- at,
1536
+ ct,
1404
1537
  {
1405
1538
  variant: "primary",
1406
1539
  onClick: d,
@@ -1413,263 +1546,263 @@ function Ii() {
1413
1546
  }
1414
1547
  );
1415
1548
  }
1416
- function bi(e) {
1549
+ function Ii(e) {
1417
1550
  return {
1418
- id: ve.id,
1551
+ id: pe.id,
1419
1552
  title: "SUM",
1420
1553
  icon: "SumIcon",
1421
- type: Je.BUTTON,
1554
+ type: Qe.BUTTON,
1422
1555
  params: {
1423
1556
  value: "SUM"
1424
1557
  },
1425
- hidden$: gt(e, H.UNIVER_SHEET),
1426
- disabled$: Ye(e, {
1427
- workbookTypes: [Qe],
1428
- worksheetTypes: [ze, Ze],
1429
- rangeTypes: [Xe]
1558
+ hidden$: ft(e, H.UNIVER_SHEET),
1559
+ disabled$: Ke(e, {
1560
+ workbookTypes: [Xe],
1561
+ worksheetTypes: [Ze, Ge],
1562
+ rangeTypes: [ze]
1430
1563
  })
1431
1564
  };
1432
1565
  }
1433
- function yi(e) {
1566
+ function Ei(e) {
1434
1567
  return {
1435
- id: ve.id,
1568
+ id: pe.id,
1436
1569
  title: "COUNT",
1437
1570
  icon: "CntIcon",
1438
- type: Je.BUTTON,
1571
+ type: Qe.BUTTON,
1439
1572
  params: {
1440
1573
  value: "COUNT"
1441
1574
  },
1442
- hidden$: gt(e, H.UNIVER_SHEET),
1443
- disabled$: Ye(e, {
1444
- workbookTypes: [Qe],
1445
- worksheetTypes: [ze, Ze],
1446
- rangeTypes: [Xe]
1575
+ hidden$: ft(e, H.UNIVER_SHEET),
1576
+ disabled$: Ke(e, {
1577
+ workbookTypes: [Xe],
1578
+ worksheetTypes: [Ze, Ge],
1579
+ rangeTypes: [ze]
1447
1580
  })
1448
1581
  };
1449
1582
  }
1450
- function Ti(e) {
1583
+ function bi(e) {
1451
1584
  return {
1452
- id: ve.id,
1585
+ id: pe.id,
1453
1586
  title: "AVERAGE",
1454
1587
  icon: "AvgIcon",
1455
- type: Je.BUTTON,
1588
+ type: Qe.BUTTON,
1456
1589
  params: {
1457
1590
  value: "AVERAGE"
1458
1591
  },
1459
- hidden$: gt(e, H.UNIVER_SHEET),
1460
- disabled$: Ye(e, {
1461
- workbookTypes: [Qe],
1462
- worksheetTypes: [ze, Ze],
1463
- rangeTypes: [Xe]
1592
+ hidden$: ft(e, H.UNIVER_SHEET),
1593
+ disabled$: Ke(e, {
1594
+ workbookTypes: [Xe],
1595
+ worksheetTypes: [Ze, Ge],
1596
+ rangeTypes: [ze]
1464
1597
  })
1465
1598
  };
1466
1599
  }
1467
- function Oi(e) {
1600
+ function yi(e) {
1468
1601
  return {
1469
- id: ve.id,
1602
+ id: pe.id,
1470
1603
  title: "MAX",
1471
1604
  icon: "MaxIcon",
1472
- type: Je.BUTTON,
1605
+ type: Qe.BUTTON,
1473
1606
  params: {
1474
1607
  value: "MAX"
1475
1608
  },
1476
- hidden$: gt(e, H.UNIVER_SHEET),
1477
- disabled$: Ye(e, {
1478
- workbookTypes: [Qe],
1479
- worksheetTypes: [ze, Ze],
1480
- rangeTypes: [Xe]
1609
+ hidden$: ft(e, H.UNIVER_SHEET),
1610
+ disabled$: Ke(e, {
1611
+ workbookTypes: [Xe],
1612
+ worksheetTypes: [Ze, Ge],
1613
+ rangeTypes: [ze]
1481
1614
  })
1482
1615
  };
1483
1616
  }
1484
- function Ni(e) {
1617
+ function Ti(e) {
1485
1618
  return {
1486
- id: ve.id,
1619
+ id: pe.id,
1487
1620
  title: "MIN",
1488
1621
  icon: "MinIcon",
1489
- type: Je.BUTTON,
1622
+ type: Qe.BUTTON,
1490
1623
  params: {
1491
1624
  value: "MIN"
1492
1625
  },
1493
- hidden$: gt(e, H.UNIVER_SHEET),
1494
- disabled$: Ye(e, {
1495
- workbookTypes: [Qe],
1496
- worksheetTypes: [ze, Ze],
1497
- rangeTypes: [Xe]
1626
+ hidden$: ft(e, H.UNIVER_SHEET),
1627
+ disabled$: Ke(e, {
1628
+ workbookTypes: [Xe],
1629
+ worksheetTypes: [Ze, Ge],
1630
+ rangeTypes: [ze]
1498
1631
  })
1499
1632
  };
1500
1633
  }
1501
- function xi(e) {
1634
+ function Ni(e) {
1502
1635
  return {
1503
- id: _n.id,
1636
+ id: Cn.id,
1504
1637
  title: "formula.insert.more",
1505
1638
  tooltip: "formula.insert.tooltip",
1506
- type: Je.BUTTON,
1507
- hidden$: gt(e, H.UNIVER_SHEET),
1508
- disabled$: Ye(e, {
1509
- workbookTypes: [Qe],
1510
- worksheetTypes: [ze, Ze],
1511
- rangeTypes: [Xe]
1639
+ type: Qe.BUTTON,
1640
+ hidden$: ft(e, H.UNIVER_SHEET),
1641
+ disabled$: Ke(e, {
1642
+ workbookTypes: [Xe],
1643
+ worksheetTypes: [Ze, Ge],
1644
+ rangeTypes: [ze]
1512
1645
  })
1513
1646
  };
1514
1647
  }
1515
- function Mi(e) {
1648
+ function Oi(e) {
1516
1649
  return e.get(ne).getCurrentTypeOfUnit$(H.UNIVER_SHEET).pipe(
1517
- qo((o) => o ? e.get(qn) ? new Ko((s) => s.next(!e.get(qn).supportClipboard)) : Un(!0) : Un(!0))
1650
+ qo((o) => o ? e.get(qn) ? new jo((s) => s.next(!e.get(qn).supportClipboard)) : Pn(!0) : Pn(!0))
1518
1651
  );
1519
1652
  }
1520
- function wi(e) {
1653
+ function xi(e) {
1521
1654
  return {
1522
- id: Cn.id,
1523
- type: Je.BUTTON,
1655
+ id: vn.id,
1656
+ type: Qe.BUTTON,
1524
1657
  title: "formula.operation.pasteFormula",
1525
- disabled$: Mi(e).pipe(
1526
- jo(Ye(e, {
1527
- workbookTypes: [Qe],
1528
- rangeTypes: [Xe],
1529
- worksheetTypes: [Ze, ze]
1658
+ disabled$: Oi(e).pipe(
1659
+ Bo(Ke(e, {
1660
+ workbookTypes: [Xe],
1661
+ rangeTypes: [ze],
1662
+ worksheetTypes: [Ge, Ze]
1530
1663
  })),
1531
- fr(([t, n]) => t || n)
1664
+ hr(([t, n]) => t || n)
1532
1665
  )
1533
1666
  };
1534
1667
  }
1535
- const ki = {
1536
- [Kn.BASIC]: {
1537
- [`${ve.id}.sum`]: {
1668
+ const Mi = {
1669
+ [jn.BASIC]: {
1670
+ [`${pe.id}.sum`]: {
1538
1671
  order: 0,
1539
- menuItemFactory: bi
1672
+ menuItemFactory: Ii
1540
1673
  },
1541
- [`${ve.id}.count`]: {
1674
+ [`${pe.id}.count`]: {
1542
1675
  order: 1,
1543
- menuItemFactory: yi
1676
+ menuItemFactory: Ei
1544
1677
  },
1545
- [`${ve.id}.average`]: {
1678
+ [`${pe.id}.average`]: {
1546
1679
  order: 2,
1547
- menuItemFactory: Ti
1680
+ menuItemFactory: bi
1548
1681
  },
1549
- [`${ve.id}.max`]: {
1682
+ [`${pe.id}.max`]: {
1550
1683
  order: 3,
1551
- menuItemFactory: Oi
1684
+ menuItemFactory: yi
1552
1685
  },
1553
- [`${ve.id}.min`]: {
1686
+ [`${pe.id}.min`]: {
1554
1687
  order: 4,
1555
- menuItemFactory: Ni
1688
+ menuItemFactory: Ti
1556
1689
  }
1557
1690
  },
1558
- [Kn.OTHERS]: {
1559
- [_n.id]: {
1691
+ [jn.OTHERS]: {
1692
+ [Cn.id]: {
1560
1693
  order: 0,
1561
- menuItemFactory: xi
1694
+ menuItemFactory: Ni
1562
1695
  }
1563
1696
  },
1564
- [bo]: {
1565
- [Cn.id]: {
1697
+ [Eo]: {
1698
+ [vn.id]: {
1566
1699
  order: 4,
1567
- menuItemFactory: wi
1700
+ menuItemFactory: xi
1568
1701
  }
1569
1702
  }
1570
- }, Ai = "meta_key_ctrl_And_Shift";
1571
- function Fi(e) {
1572
- return e.getContextValue(oo) && e.getContextValue(so);
1703
+ }, wi = "meta_key_ctrl_And_Shift";
1704
+ function ki(e) {
1705
+ return e.getContextValue(ro) && e.getContextValue(oo);
1573
1706
  }
1574
- const Xt = [
1707
+ const zt = [
1575
1708
  L.ARROW_DOWN,
1576
1709
  L.ARROW_UP,
1577
1710
  L.ARROW_LEFT,
1578
1711
  L.ARROW_RIGHT
1579
- ], Di = [...Xt, L.ENTER, L.TAB, L.ESC];
1580
- function Li() {
1712
+ ], Ai = [...zt, L.ENTER, L.TAB, L.ESC];
1713
+ function Fi() {
1581
1714
  const e = [];
1582
- for (const t of Di)
1715
+ for (const t of Ai)
1583
1716
  e.push({
1584
- id: mt.id,
1717
+ id: gt.id,
1585
1718
  binding: t,
1586
- preconditions: (n) => bt(n),
1719
+ preconditions: (n) => Et(n),
1587
1720
  staticParameters: {
1588
- eventType: xe.Keyboard,
1721
+ eventType: Oe.Keyboard,
1589
1722
  keycode: t
1590
1723
  }
1591
1724
  });
1592
1725
  return e;
1593
1726
  }
1594
- function $i() {
1727
+ function Di() {
1595
1728
  const e = [];
1596
- for (const t of Xt)
1729
+ for (const t of zt)
1597
1730
  e.push({
1598
- id: mt.id,
1731
+ id: gt.id,
1599
1732
  binding: t | P.SHIFT,
1600
- preconditions: (n) => bt(n),
1733
+ preconditions: (n) => Et(n),
1601
1734
  staticParameters: {
1602
- eventType: xe.Keyboard,
1735
+ eventType: Oe.Keyboard,
1603
1736
  keycode: t,
1604
1737
  metaKey: P.SHIFT
1605
1738
  }
1606
1739
  });
1607
1740
  return e;
1608
1741
  }
1609
- function Pi() {
1742
+ function Li() {
1610
1743
  const e = [];
1611
- for (const t of Xt)
1744
+ for (const t of zt)
1612
1745
  e.push({
1613
- id: mt.id,
1746
+ id: gt.id,
1614
1747
  binding: t | P.CTRL_COMMAND,
1615
- preconditions: (n) => bt(n),
1748
+ preconditions: (n) => Et(n),
1616
1749
  staticParameters: {
1617
- eventType: xe.Keyboard,
1750
+ eventType: Oe.Keyboard,
1618
1751
  keycode: t,
1619
1752
  metaKey: P.CTRL_COMMAND
1620
1753
  }
1621
1754
  });
1622
1755
  return e;
1623
1756
  }
1624
- function Ui() {
1757
+ function $i() {
1625
1758
  const e = [];
1626
- for (const t of Xt)
1759
+ for (const t of zt)
1627
1760
  e.push({
1628
- id: mt.id,
1761
+ id: gt.id,
1629
1762
  binding: t | P.SHIFT | P.CTRL_COMMAND,
1630
- preconditions: (n) => bt(n),
1763
+ preconditions: (n) => Et(n),
1631
1764
  staticParameters: {
1632
- eventType: xe.Keyboard,
1765
+ eventType: Oe.Keyboard,
1633
1766
  keycode: t,
1634
- metaKey: Ai
1767
+ metaKey: wi
1635
1768
  }
1636
1769
  });
1637
1770
  return e;
1638
1771
  }
1639
- const Vi = {
1640
- id: yr.id,
1772
+ const Pi = {
1773
+ id: br.id,
1641
1774
  binding: L.F4,
1642
- preconditions: (e) => bt(e)
1775
+ preconditions: (e) => Et(e)
1643
1776
  };
1644
- function Wi() {
1777
+ function Ui() {
1645
1778
  const e = [];
1646
1779
  for (const t of [L.ENTER, L.TAB, L.ARROW_DOWN, L.ARROW_UP])
1647
1780
  e.push({
1648
- id: mt.id,
1781
+ id: gt.id,
1649
1782
  binding: t,
1650
- preconditions: (n) => Fi(n),
1783
+ preconditions: (n) => ki(n),
1651
1784
  staticParameters: {
1652
- eventType: xe.Keyboard,
1785
+ eventType: Oe.Keyboard,
1653
1786
  keycode: t,
1654
1787
  isSingleEditor: !0
1655
1788
  }
1656
1789
  });
1657
1790
  return e;
1658
1791
  }
1659
- const Hi = {
1660
- id: hs.id,
1792
+ const Vi = {
1793
+ id: ds.id,
1661
1794
  binding: P.ALT | L.EQUAL,
1662
- preconditions: yo,
1795
+ preconditions: bo,
1663
1796
  mac: P.CTRL_COMMAND | P.ALT | L.EQUAL,
1664
1797
  description: "shortcut.sheets-formula-ui.quick-sum",
1665
1798
  group: "4_sheet-edit"
1666
1799
  };
1667
- var Bi = Object.getOwnPropertyDescriptor, ji = (e, t, n, o) => {
1668
- for (var r = o > 1 ? void 0 : o ? Bi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
1800
+ var Wi = Object.getOwnPropertyDescriptor, Hi = (e, t, n, o) => {
1801
+ for (var r = o > 1 ? void 0 : o ? Wi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
1669
1802
  (i = e[s]) && (r = i(r) || r);
1670
1803
  return r;
1671
- }, je = (e, t) => (n, o) => t(n, o, e);
1672
- let Bt = class extends dt {
1804
+ }, Be = (e, t) => (n, o) => t(n, o, e);
1805
+ let Ht = class extends ut {
1673
1806
  constructor(e, t, n, o, r, s, i) {
1674
1807
  super(), this._injector = e, this._menuManagerService = t, this._commandService = n, this._shortcutService = o, this._uiPartsService = r, this._renderManagerService = s, this._componentManager = i, this._initialize();
1675
1808
  }
@@ -1677,52 +1810,52 @@ let Bt = class extends dt {
1677
1810
  this._registerCommands(), this._registerMenus(), this._registerShortcuts(), this._registerComponents(), this._registerRenderModules();
1678
1811
  }
1679
1812
  _registerMenus() {
1680
- this._menuManagerService.mergeMenu(ki);
1813
+ this._menuManagerService.mergeMenu(Mi);
1681
1814
  }
1682
1815
  _registerCommands() {
1683
1816
  [
1817
+ vn,
1818
+ pe,
1684
1819
  Cn,
1685
- ve,
1686
- _n,
1687
- Us,
1688
- ks,
1689
- mt,
1690
- yr
1820
+ Ps,
1821
+ ws,
1822
+ gt,
1823
+ br
1691
1824
  ].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e)));
1692
1825
  }
1693
1826
  _registerShortcuts() {
1694
1827
  [
1828
+ ...Fi(),
1829
+ ...Di(),
1695
1830
  ...Li(),
1696
1831
  ...$i(),
1697
- ...Pi(),
1698
1832
  ...Ui(),
1699
- ...Wi(),
1700
- Hi,
1701
- Vi
1833
+ Vi,
1834
+ Pi
1702
1835
  ].forEach((e) => {
1703
1836
  this.disposeWithMe(this._shortcutService.registerShortcut(e));
1704
1837
  });
1705
1838
  }
1706
1839
  _registerComponents() {
1707
- this.disposeWithMe(this._uiPartsService.registerComponent(To.FORMULA_AUX, () => _r(li, this._injector))), this._componentManager.register(br, Ii);
1840
+ this.disposeWithMe(this._uiPartsService.registerComponent(yo.FORMULA_AUX, () => Cr(ai, this._injector))), this._componentManager.register(Er, Ri);
1708
1841
  }
1709
1842
  _registerRenderModules() {
1710
- this.disposeWithMe(this._renderManagerService.registerRenderModule(H.UNIVER_SHEET, [Wt]));
1843
+ this.disposeWithMe(this._renderManagerService.registerRenderModule(H.UNIVER_SHEET, [Vt]));
1711
1844
  }
1712
1845
  };
1713
- Bt = ji([
1714
- je(0, j(Et)),
1715
- je(1, ps),
1716
- je(2, pe),
1717
- je(3, Zt),
1718
- je(4, Sr),
1719
- je(5, Me),
1720
- je(6, j(Cr))
1721
- ], Bt);
1722
- class $r {
1846
+ Ht = Hi([
1847
+ Be(0, q(Rt)),
1848
+ Be(1, ms),
1849
+ Be(2, me),
1850
+ Be(3, Gt),
1851
+ Be(4, Sr),
1852
+ Be(5, xe),
1853
+ Be(6, q(vr))
1854
+ ], Ht);
1855
+ class Lr {
1723
1856
  constructor() {
1724
- q(this, "_currentSelector$", new gr(null));
1725
- q(this, "currentSelector$", this._currentSelector$.asObservable());
1857
+ j(this, "_currentSelector$", new fr(null));
1858
+ j(this, "currentSelector$", this._currentSelector$.asObservable());
1726
1859
  }
1727
1860
  showRangeSelectorDialog(t) {
1728
1861
  const n = t.callback, o = new Promise((r) => {
@@ -1733,12 +1866,12 @@ class $r {
1733
1866
  return this._currentSelector$.next(t), o;
1734
1867
  }
1735
1868
  }
1736
- var qi = Object.getOwnPropertyDescriptor, Ki = (e, t, n, o) => {
1737
- for (var r = o > 1 ? void 0 : o ? qi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
1869
+ var Bi = Object.getOwnPropertyDescriptor, qi = (e, t, n, o) => {
1870
+ for (var r = o > 1 ? void 0 : o ? Bi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
1738
1871
  (i = e[s]) && (r = i(r) || r);
1739
1872
  return r;
1740
- }, it = (e, t) => (n, o) => t(n, o, e);
1741
- let $e = class extends Oo {
1873
+ }, st = (e, t) => (n, o) => t(n, o, e);
1874
+ let De = class extends To {
1742
1875
  constructor(t, n, o, r, s, i, c) {
1743
1876
  super(
1744
1877
  n,
@@ -1747,9 +1880,9 @@ let $e = class extends Oo {
1747
1880
  s,
1748
1881
  i
1749
1882
  );
1750
- q(this, "_workbookSelections");
1751
- q(this, "_eventDisposables");
1752
- this._context = t, this._contextService = i, this._refSelectionsService = c, this._workbookSelections = this._refSelectionsService.getWorkbookSelections(this._context.unitId), this._initSelectionChangeListener(), this._initSkeletonChangeListener(), this._initUserActionSyncListener(), this._setSelectionStyle(Yi(this._themeService)), this._remainLastEnabled = !0, this._highlightHeader = !1;
1883
+ j(this, "_workbookSelections");
1884
+ j(this, "_eventDisposables");
1885
+ this._context = t, this._contextService = i, this._refSelectionsService = c, this._workbookSelections = this._refSelectionsService.getWorkbookSelections(this._context.unitId), this._initSelectionChangeListener(), this._initSkeletonChangeListener(), this._initUserActionSyncListener(), this._setSelectionStyle(ji(this._themeService)), this._remainLastEnabled = !0, this._highlightHeader = !1;
1753
1886
  }
1754
1887
  getLocation() {
1755
1888
  return this._skeleton.getLocation();
@@ -1773,7 +1906,7 @@ let $e = class extends Oo {
1773
1906
  * Call this method and user will be able to select on the canvas to update selections.
1774
1907
  */
1775
1908
  enableSelectionChanging() {
1776
- return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(), or(() => this._disableSelectionChanging());
1909
+ return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(), rr(() => this._disableSelectionChanging());
1777
1910
  }
1778
1911
  _disableSelectionChanging() {
1779
1912
  var t;
@@ -1785,17 +1918,17 @@ let $e = class extends Oo {
1785
1918
  _initCanvasEventListeners() {
1786
1919
  const t = this._getSheetObject(), { spreadsheetRowHeader: n, spreadsheetColumnHeader: o, spreadsheet: r, spreadsheetLeftTopPlaceholder: s } = t, { scene: i } = this._context, c = new qe();
1787
1920
  return c.add(r == null ? void 0 : r.onPointerDown$.subscribeEvent((l, g) => {
1788
- this.inRefSelectionMode() && (this._onPointerDown(l, r.zIndex + 1, Ce.NORMAL, this._getActiveViewport(l)), l.button !== 2 && g.stopPropagation());
1921
+ this.inRefSelectionMode() && (this._onPointerDown(l, r.zIndex + 1, ve.NORMAL, this._getActiveViewport(l)), l.button !== 2 && g.stopPropagation());
1789
1922
  })), c.add(
1790
1923
  n == null ? void 0 : n.onPointerDown$.subscribeEvent((l, g) => {
1791
1924
  if (!this.inRefSelectionMode()) return;
1792
- const m = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: h } = Fn(l.offsetX, l.offsetY, i, m);
1793
- Dn(this._workbookSelections.getCurrentSelections(), h, Ce.ROW) || (this._onPointerDown(l, (r.zIndex || 1) + 1, Ce.ROW, this._getActiveViewport(l), Qt.Y), l.button !== 2 && g.stopPropagation());
1925
+ const m = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: h } = An(l.offsetX, l.offsetY, i, m);
1926
+ Fn(this._workbookSelections.getCurrentSelections(), h, ve.ROW) || (this._onPointerDown(l, (r.zIndex || 1) + 1, ve.ROW, this._getActiveViewport(l), Xt.Y), l.button !== 2 && g.stopPropagation());
1794
1927
  })
1795
1928
  ), c.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((l, g) => {
1796
1929
  if (!this.inRefSelectionMode()) return;
1797
- const m = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: h } = Fn(l.offsetX, l.offsetY, i, m);
1798
- Dn(this._workbookSelections.getCurrentSelections(), h, Ce.COLUMN) || (this._onPointerDown(l, (r.zIndex || 1) + 1, Ce.COLUMN, this._getActiveViewport(l), Qt.X), l.button !== 2 && g.stopPropagation());
1930
+ const m = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: h } = An(l.offsetX, l.offsetY, i, m);
1931
+ Fn(this._workbookSelections.getCurrentSelections(), h, ve.COLUMN) || (this._onPointerDown(l, (r.zIndex || 1) + 1, ve.COLUMN, this._getActiveViewport(l), Xt.X), l.button !== 2 && g.stopPropagation());
1799
1932
  })), c.add(s == null ? void 0 : s.onPointerDown$.subscribeEvent((l, g) => {
1800
1933
  if (this._reset(), !this.inRefSelectionMode()) return;
1801
1934
  const m = this._sheetSkeletonManagerService.getCurrent().skeleton, h = No(m);
@@ -1813,7 +1946,7 @@ let $e = class extends Oo {
1813
1946
  */
1814
1947
  _addSelectionControlByModelData(t) {
1815
1948
  var i;
1816
- const n = this._skeleton, o = (i = t.style) != null ? i : lr(this._themeService), r = this._scene;
1949
+ const n = this._skeleton, o = (i = t.style) != null ? i : ar(this._themeService), r = this._scene;
1817
1950
  return t.style = o, this.newSelectionControl(r, n, t);
1818
1951
  }
1819
1952
  _initSelectionChangeListener() {
@@ -1826,18 +1959,18 @@ let $e = class extends Oo {
1826
1959
  */
1827
1960
  _initUserActionSyncListener() {
1828
1961
  this.disposeWithMe(this.selectionMoveStart$.subscribe((t) => {
1829
- this._updateSelections(t, Jt.MOVE_START);
1962
+ this._updateSelections(t, Qt.MOVE_START);
1830
1963
  })), this.disposeWithMe(this.selectionMoving$.subscribe((t) => {
1831
- this._updateSelections(t, Jt.MOVING);
1964
+ this._updateSelections(t, Qt.MOVING);
1832
1965
  })), this.disposeWithMe(this.selectionMoveEnd$.subscribe((t) => {
1833
- this._updateSelections(t, Jt.MOVE_END);
1966
+ this._updateSelections(t, Qt.MOVE_END);
1834
1967
  }));
1835
1968
  }
1836
1969
  _updateSelections(t, n) {
1837
1970
  const r = this._context.unit.getActiveSheet().getSheetId();
1838
1971
  t.length !== 0 && this._workbookSelections.setSelections(
1839
1972
  r,
1840
- t.map((s) => as(s)),
1973
+ t.map((s) => cs(s)),
1841
1974
  n
1842
1975
  );
1843
1976
  }
@@ -1846,7 +1979,7 @@ let $e = class extends Oo {
1846
1979
  var i;
1847
1980
  if (!t)
1848
1981
  return;
1849
- const { skeleton: n } = t, { scene: o } = this._context, r = o.getViewport(Wn.VIEW_MAIN);
1982
+ const { skeleton: n } = t, { scene: o } = this._context, r = o.getViewport(Vn.VIEW_MAIN);
1850
1983
  this._skeleton && ((i = this._skeleton.worksheet) == null ? void 0 : i.getSheetId()) !== n.worksheet.getSheetId() && this._reset(), this._changeRuntime(n, o, r);
1851
1984
  const s = this._workbookSelections.getCurrentSelections();
1852
1985
  this.resetSelectionsByModelData(s);
@@ -1854,10 +1987,10 @@ let $e = class extends Oo {
1854
1987
  }
1855
1988
  _getActiveViewport(t) {
1856
1989
  const n = this._getSheetObject();
1857
- return n == null ? void 0 : n.scene.getActiveViewportByCoord(Hn.FromArray([t.offsetX, t.offsetY]));
1990
+ return n == null ? void 0 : n.scene.getActiveViewportByCoord(Wn.FromArray([t.offsetX, t.offsetY]));
1858
1991
  }
1859
1992
  _getSheetObject() {
1860
- return xo(this._context.unit, this._context);
1993
+ return Oo(this._context.unit, this._context);
1861
1994
  }
1862
1995
  /**
1863
1996
  * Handle pointer down event, bind pointermove & pointerup handler.
@@ -1870,45 +2003,45 @@ let $e = class extends Oo {
1870
2003
  * @param scrollTimerType
1871
2004
  */
1872
2005
  // eslint-disable-next-line complexity, max-lines-per-function
1873
- _onPointerDown(t, n = 0, o = Ce.NORMAL, r, s = Qt.ALL) {
1874
- var O;
2006
+ _onPointerDown(t, n = 0, o = ve.NORMAL, r, s = Xt.ALL) {
2007
+ var N;
1875
2008
  this._rangeType = o;
1876
2009
  const i = this._skeleton, c = this._scene;
1877
2010
  if (!c || !i)
1878
2011
  return;
1879
2012
  r && (this._activeViewport = r);
1880
- const { offsetX: l, offsetY: g } = t, m = c.getViewport(Wn.VIEW_MAIN);
2013
+ const { offsetX: l, offsetY: g } = t, m = c.getViewport(Vn.VIEW_MAIN);
1881
2014
  if (!m) return;
1882
- const h = c.getCoordRelativeToViewport(Hn.FromArray([l, g])), { x: d, y: u } = h;
2015
+ const h = c.getCoordRelativeToViewport(Wn.FromArray([l, g])), { x: d, y: u } = h;
1883
2016
  this._startViewportPosX = d, this._startViewportPosY = u;
1884
- const a = c.getScrollXYInfoByViewport(h), { scaleX: S, scaleY: p } = c.getAncestorScale(), v = this._skeleton.getCellByOffset(d, u, S, p, a);
1885
- if (!v) return;
2017
+ const a = c.getScrollXYInfoByViewport(h), { scaleX: v, scaleY: p } = c.getAncestorScale(), S = this._skeleton.getCellByOffset(d, u, v, p, a);
2018
+ if (!S) return;
1886
2019
  switch (o) {
1887
- case Ce.NORMAL:
2020
+ case ve.NORMAL:
1888
2021
  break;
1889
- case Ce.ROW:
1890
- v.startColumn = 0, v.endColumn = this._skeleton.getColumnCount() - 1;
2022
+ case ve.ROW:
2023
+ S.startColumn = 0, S.endColumn = this._skeleton.getColumnCount() - 1;
1891
2024
  break;
1892
- case Ce.COLUMN:
1893
- v.startRow = 0, v.endRow = this._skeleton.getRowCount() - 1;
2025
+ case ve.COLUMN:
2026
+ S.startRow = 0, S.endRow = this._skeleton.getRowCount() - 1;
1894
2027
  break;
1895
- case Ce.ALL:
1896
- v.startRow = 0, v.startColumn = 0, v.endRow = this._skeleton.getRowCount() - 1, v.endColumn = this._skeleton.getColumnCount() - 1;
2028
+ case ve.ALL:
2029
+ S.startRow = 0, S.startColumn = 0, S.endRow = this._skeleton.getRowCount() - 1, S.endColumn = this._skeleton.getColumnCount() - 1;
1897
2030
  }
1898
- const C = { range: v, primary: v, style: null };
2031
+ const C = { range: S, primary: S, style: null };
1899
2032
  C.range.rangeType = o;
1900
- const _ = nn(C, this._skeleton);
2033
+ const _ = tn(C, this._skeleton);
1901
2034
  this._startRangeWhenPointerDown = { ..._.rangeWithCoord };
1902
- const I = { ..._.rangeWithCoord, rangeType: o };
2035
+ const E = { ..._.rangeWithCoord, rangeType: o };
1903
2036
  let f = this.getActiveSelectionControl();
1904
2037
  const b = this.getSelectionControls();
1905
- for (const N of b) {
1906
- if (t.button === 2 && tr.contains(N.model, I)) {
1907
- f = N;
2038
+ for (const O of b) {
2039
+ if (t.button === 2 && er.contains(O.model, E)) {
2040
+ f = O;
1908
2041
  return;
1909
2042
  }
1910
- if (N.model.isEqual(I)) {
1911
- f = N;
2043
+ if (O.model.isEqual(E)) {
2044
+ f = O;
1912
2045
  break;
1913
2046
  }
1914
2047
  }
@@ -1916,17 +2049,17 @@ let $e = class extends Oo {
1916
2049
  const y = f == null ? void 0 : f.model.currentCell, A = t.shiftKey && y, F = this._remainLastEnabled && !t.ctrlKey && !t.shiftKey && !this._skipLastEnabled && !this._singleSelectionEnabled;
1917
2050
  A && y ? this._makeSelectionByTwoCells(
1918
2051
  y,
1919
- I,
2052
+ E,
1920
2053
  i,
1921
2054
  o,
1922
2055
  f
1923
2056
  // Get updated in this method
1924
2057
  ) : F && f ? f.updateRangeBySelectionWithCoord(_) : f = this.newSelectionControl(c, i, C);
1925
- for (let N = 0; N < this.getSelectionControls().length - 1; N++)
1926
- this.getSelectionControls()[N].clearHighlight();
1927
- this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), c.disableObjectsEvent(), this._clearUpdatingListeners(), this._addEndingListeners(), (O = c.getTransformer()) == null || O.clearSelectedObjects(), this._setupPointerMoveListener(m, f, o, s, d, u), this._escapeShortcutDisposable = this._shortcutService.forceEscape(), this._scenePointerUpSub = c.onPointerUp$.subscribeEvent(() => {
1928
- var N;
1929
- this._clearUpdatingListeners(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()), (N = this._escapeShortcutDisposable) == null || N.dispose(), this._escapeShortcutDisposable = null;
2058
+ for (let O = 0; O < this.getSelectionControls().length - 1; O++)
2059
+ this.getSelectionControls()[O].clearHighlight();
2060
+ this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), c.disableObjectsEvent(), this._clearUpdatingListeners(), this._addEndingListeners(), (N = c.getTransformer()) == null || N.clearSelectedObjects(), this._setupPointerMoveListener(m, f, o, s, d, u), this._escapeShortcutDisposable = this._shortcutService.forceEscape(), this._scenePointerUpSub = c.onPointerUp$.subscribeEvent(() => {
2061
+ var O;
2062
+ this._clearUpdatingListeners(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()), (O = this._escapeShortcutDisposable) == null || O.dispose(), this._escapeShortcutDisposable = null;
1930
2063
  });
1931
2064
  }
1932
2065
  /**
@@ -1937,12 +2070,12 @@ let $e = class extends Oo {
1937
2070
  * @returns {SelectionControl} selectionControl just created
1938
2071
  */
1939
2072
  newSelectionControl(t, n, o) {
1940
- const r = this.getSelectionControls().length, { rowHeaderWidth: s, columnHeaderHeight: i } = n, c = new ar(t, r, this._themeService, {
2073
+ const r = this.getSelectionControls().length, { rowHeaderWidth: s, columnHeaderHeight: i } = n, c = new cr(t, r, this._themeService, {
1941
2074
  highlightHeader: this._highlightHeader,
1942
2075
  enableAutoFill: !1,
1943
2076
  rowHeaderWidth: s,
1944
2077
  columnHeaderHeight: i
1945
- }), l = nn(o, n);
2078
+ }), l = tn(o, n);
1946
2079
  return c.updateRangeBySelectionWithCoord(l), this._selectionControls.push(c), c.setControlExtension({
1947
2080
  skeleton: n,
1948
2081
  scene: t,
@@ -1956,19 +2089,19 @@ let $e = class extends Oo {
1956
2089
  }), c;
1957
2090
  }
1958
2091
  };
1959
- $e = Ki([
1960
- it(1, j(Et)),
1961
- it(2, j(It)),
1962
- it(3, Zt),
1963
- it(4, j(Kt)),
1964
- it(5, an),
1965
- it(6, Yt)
1966
- ], $e);
1967
- function Yi(e) {
1968
- const t = lr(e);
2092
+ De = qi([
2093
+ st(1, q(Rt)),
2094
+ st(2, q(It)),
2095
+ st(3, Gt),
2096
+ st(4, q(jt)),
2097
+ st(5, cn),
2098
+ st(6, Kt)
2099
+ ], De);
2100
+ function ji(e) {
2101
+ const t = ar(e);
1969
2102
  return t.widgets = { tl: !0, tc: !0, tr: !0, ml: !0, mr: !0, bl: !0, bc: !0, br: !0 }, t;
1970
2103
  }
1971
- const Rn = (e, t, n = !0) => {
2104
+ const _n = (e, t, n = !0) => {
1972
2105
  let o = -1;
1973
2106
  return e.reduce((r, s, i) => {
1974
2107
  if (r.isFinish)
@@ -1982,7 +2115,7 @@ const Rn = (e, t, n = !0) => {
1982
2115
  }
1983
2116
  return (n ? r.currentIndex === t : t > c && t <= r.currentIndex) && (o = i, r.isFinish = !0), r;
1984
2117
  }, { currentIndex: 0, isFinish: !1 }), o;
1985
- }, Pr = (e, t) => {
2118
+ }, $r = (e, t) => {
1986
2119
  const n = e[t];
1987
2120
  let o = -1;
1988
2121
  if (!n || typeof n == "string" || n.nodeType !== Q.REFERENCE) return -1;
@@ -1991,7 +2124,7 @@ const Rn = (e, t, n = !0) => {
1991
2124
  typeof s != "string" && s.nodeType === Q.REFERENCE && o++;
1992
2125
  }
1993
2126
  return o;
1994
- }, Gi = (e, t = 100) => {
2127
+ }, Ki = (e, t = 100) => {
1995
2128
  $(() => {
1996
2129
  let n = null;
1997
2130
  const o = () => {
@@ -2004,8 +2137,8 @@ const Rn = (e, t, n = !0) => {
2004
2137
  };
2005
2138
  }, [e, t]);
2006
2139
  };
2007
- function Ur(e, t, n) {
2008
- const o = T(Ge), r = ie(() => new gr({ left: -999, top: -999, right: -999, bottom: -999 }), []), s = T(vn), i = T(ne), c = te(() => {
2140
+ function Pr(e, t, n) {
2141
+ const o = T(Ye), r = ie(() => new fr({ left: -999, top: -999, right: -999, bottom: -999 }), []), s = T(pn), i = T(ne), c = te(() => {
2009
2142
  var _;
2010
2143
  const l = o.getEditor(e);
2011
2144
  if (!l)
@@ -2013,50 +2146,50 @@ function Ur(e, t, n) {
2013
2146
  const g = l.getBoundingClientRect(), { marginTop: m = 0, marginBottom: h = 0 } = l.getDocumentData().documentStyle, d = l.getSkeleton();
2014
2147
  if (!d) return;
2015
2148
  const u = (_ = d.getSkeletonData()) == null ? void 0 : _.pages[0].height;
2016
- let { left: a, top: S, right: p, bottom: v } = g;
2017
- S = S + m, v = u ? S + u : v - h;
2149
+ let { left: a, top: v, right: p, bottom: S } = g;
2150
+ v = v + m, S = u ? v + u : S - h;
2018
2151
  const C = r.getValue();
2019
- if (!(C.left === a && C.top === S && C.right === p && C.bottom === v))
2020
- return r.next({ left: a - 1, right: p + 1, top: S - 1, bottom: v + 1 }), g;
2152
+ if (!(C.left === a && C.top === v && C.right === p && C.bottom === S))
2153
+ return r.next({ left: a - 1, right: p + 1, top: v - 1, bottom: S + 1 }), g;
2021
2154
  });
2022
2155
  return $(() => {
2023
2156
  t && c();
2024
- }, [e, o, i.unitAdded$, c, t, ...n != null ? n : []]), Gi(c), $(() => {
2025
- const l = s.scrollEvent$.pipe(Yo(100)).subscribe(c);
2157
+ }, [e, o, i.unitAdded$, c, t, ...n != null ? n : []]), Ki(c), $(() => {
2158
+ const l = s.scrollEvent$.pipe(Ko(100)).subscribe(c);
2026
2159
  return () => {
2027
2160
  l.unsubscribe();
2028
2161
  };
2029
2162
  }, []), [r, c];
2030
2163
  }
2031
- const nt = (e) => {
2164
+ const tt = (e) => {
2032
2165
  const t = z(e);
2033
2166
  return t.current = e, t;
2034
- }, Zi = (e, t, n) => {
2035
- const o = T(zt), r = T(Gt), s = T(Re), [i, c] = V(), [l, g] = V(-1), [m, h] = V(!0), d = nt(m), u = z(t);
2167
+ }, Yi = (e, t, n) => {
2168
+ const o = T(Zt), r = T(Yt), s = T(_e), [i, c] = V(), [l, g] = V(-1), [m, h] = V(!0), d = tt(m), u = z(t);
2036
2169
  u.current = t;
2037
2170
  const a = () => {
2038
2171
  c(void 0), g(-1), h(!1);
2039
2172
  };
2040
2173
  return $(() => {
2041
- const S = s.sequenceNodesBuilder(t.slice(1));
2042
- o.setSequenceNodes(S != null ? S : []);
2174
+ const v = s.sequenceNodesBuilder(t.slice(1));
2175
+ o.setSequenceNodes(v != null ? v : []);
2043
2176
  }, [t]), $(() => {
2044
2177
  if (n && e) {
2045
- const S = n.selectionChange$.pipe(fn(50)).subscribe((v) => {
2046
- if (v.textRanges.length === 1) {
2047
- const [C] = v.textRanges;
2178
+ const v = n.selectionChange$.pipe(hn(50)).subscribe((S) => {
2179
+ if (S.textRanges.length === 1) {
2180
+ const [C] = S.textRanges;
2048
2181
  if (C.collapsed && d.current) {
2049
- const { startOffset: _ } = C, I = o.getCurrentSequenceNodeIndex(_ - 2), f = o.getCurrentSequenceNodeByIndex(I), b = o.getCurrentSequenceNodeByIndex(I + 1);
2182
+ const { startOffset: _ } = C, E = o.getCurrentSequenceNodeIndex(_ - 2), f = o.getCurrentSequenceNodeByIndex(E), b = o.getCurrentSequenceNodeByIndex(E + 1);
2050
2183
  if (f)
2051
- if (typeof f != "string" && f.nodeType === 3 && !r.hasDefinedNameDescription(f.token.trim()) && b === Ke.OPEN_BRACKET) {
2184
+ if (typeof f != "string" && f.nodeType === 3 && !r.hasDefinedNameDescription(f.token.trim()) && b === je.OPEN_BRACKET) {
2052
2185
  const y = r.getFunctionInfo(f.token);
2053
2186
  c(y), g(-1);
2054
2187
  return;
2055
2188
  } else {
2056
2189
  const y = s.getFunctionAndParameter(`${u.current}A`, _ - 1);
2057
2190
  if (y) {
2058
- const { functionName: A, paramIndex: F } = y, O = r.getFunctionInfo(A);
2059
- c(O), g(F);
2191
+ const { functionName: A, paramIndex: F } = y, N = r.getFunctionInfo(A);
2192
+ c(N), g(F);
2060
2193
  return;
2061
2194
  }
2062
2195
  }
@@ -2064,14 +2197,14 @@ const nt = (e) => {
2064
2197
  }
2065
2198
  c(void 0), g(-1);
2066
2199
  }), p = n.selectionChange$.pipe(
2067
- mr((v) => v.textRanges.length === 1),
2068
- fr((v) => v.textRanges[0].startOffset),
2069
- Go()
2200
+ gr((S) => S.textRanges.length === 1),
2201
+ hr((S) => S.textRanges[0].startOffset),
2202
+ Yo()
2070
2203
  ).subscribe(() => {
2071
2204
  h(!0);
2072
2205
  });
2073
2206
  return () => {
2074
- S.unsubscribe(), p.unsubscribe();
2207
+ v.unsubscribe(), p.unsubscribe();
2075
2208
  };
2076
2209
  }
2077
2210
  }, [n, e]), $(() => {
@@ -2081,14 +2214,14 @@ const nt = (e) => {
2081
2214
  paramIndex: l,
2082
2215
  reset: a
2083
2216
  };
2084
- }, zi = ({ onClick: e }) => /* @__PURE__ */ M(
2217
+ }, Gi = ({ onClick: e }) => /* @__PURE__ */ M(
2085
2218
  "div",
2086
2219
  {
2087
2220
  className: "univer-z-[15] univer-box-border univer-h-[18px] univer-cursor-pointer univer-overflow-visible univer-whitespace-nowrap univer-rounded-l univer-border univer-border-r-0 univer-border-gray-600 univer-bg-primary-600 univer-p-0.5 univer-text-xs univer-font-bold univer-leading-[13px] univer-text-white",
2088
2221
  onClick: e,
2089
2222
  children: "?"
2090
2223
  }
2091
- ), tn = ({ className: e, title: t, value: n }) => /* @__PURE__ */ W("div", { className: "univer-my-2", children: [
2224
+ ), en = ({ className: e, title: t, value: n }) => /* @__PURE__ */ W("div", { className: "univer-my-2", children: [
2092
2225
  /* @__PURE__ */ M(
2093
2226
  "div",
2094
2227
  {
@@ -2103,7 +2236,7 @@ const nt = (e) => {
2103
2236
  children: n
2104
2237
  }
2105
2238
  )
2106
- ] }), Xi = (e) => {
2239
+ ] }), Zi = (e) => {
2107
2240
  const { prefix: t, value: n, active: o, onClick: r } = e;
2108
2241
  return /* @__PURE__ */ W("div", { children: [
2109
2242
  /* @__PURE__ */ W("span", { children: [
@@ -2123,19 +2256,19 @@ const nt = (e) => {
2123
2256
  ] }, s.name)),
2124
2257
  ")"
2125
2258
  ] });
2126
- }, Qn = () => {
2259
+ }, Xn = () => {
2127
2260
  };
2128
- function Qi(e) {
2129
- const { onParamsSwitch: t = Qn, onClose: n = Qn, isFocus: o, editor: r, formulaText: s } = e, { functionInfo: i, paramIndex: c, reset: l } = Zi(o, s, r), g = T(hn), m = !Se(g.helpFunctionVisible$), [h, d] = V(!0), u = T(ht), a = u.t("formula.prompt.required"), S = u.t("formula.prompt.optional"), p = r.getEditorId(), [v] = Ur(p, !!i, [i, c]);
2261
+ function zi(e) {
2262
+ const { onParamsSwitch: t = Xn, onClose: n = Xn, isFocus: o, editor: r, formulaText: s } = e, { functionInfo: i, paramIndex: c, reset: l } = Yi(o, s, r), g = T(dn), m = !Se(g.helpFunctionVisible$), [h, d] = V(!0), u = T(dt), a = u.t("formula.prompt.required"), v = u.t("formula.prompt.optional"), p = r.getEditorId(), [S] = Pr(p, !!i, [i, c]);
2130
2263
  function C(f) {
2131
2264
  t && t(f);
2132
2265
  }
2133
2266
  const _ = te((f) => {
2134
2267
  g.helpFunctionVisible$.next(!f);
2135
- }), I = () => {
2268
+ }), E = () => {
2136
2269
  _(!0), n();
2137
2270
  };
2138
- return i ? m ? /* @__PURE__ */ M(rn, { portal: !0, anchorRect$: v, direction: "left-center", children: /* @__PURE__ */ M(zi, { onClick: () => _(!1) }) }, "hidden") : /* @__PURE__ */ M(rn, { portal: !0, onClickOutside: () => l(), anchorRect$: v, direction: "vertical", children: /* @__PURE__ */ W(
2271
+ return i ? m ? /* @__PURE__ */ M(nn, { portal: !0, anchorRect$: S, direction: "left-center", children: /* @__PURE__ */ M(Gi, { onClick: () => _(!1) }) }, "hidden") : /* @__PURE__ */ M(nn, { portal: !0, onClickOutside: () => l(), anchorRect$: S, direction: "vertical", children: /* @__PURE__ */ W(
2139
2272
  "div",
2140
2273
  {
2141
2274
  className: re("univer-m-0 univer-box-border univer-w-[250px] univer-select-none univer-list-none univer-rounded-lg univer-bg-white univer-leading-5 univer-shadow-md univer-outline-none dark:!univer-bg-gray-900", Sn),
@@ -2143,10 +2276,10 @@ function Qi(e) {
2143
2276
  /* @__PURE__ */ W(
2144
2277
  "div",
2145
2278
  {
2146
- className: re("univer-wrap-anywhere univer-box-border univer-flex univer-items-center univer-justify-between univer-px-4 univer-py-3 univer-text-xs univer-font-medium univer-text-gray-900 dark:!univer-text-white", bs),
2279
+ className: re("univer-wrap-anywhere univer-box-border univer-flex univer-items-center univer-justify-between univer-px-4 univer-py-3 univer-text-xs univer-font-medium univer-text-gray-900 dark:!univer-text-white", Es),
2147
2280
  children: [
2148
2281
  /* @__PURE__ */ M(
2149
- Xi,
2282
+ Zi,
2150
2283
  {
2151
2284
  prefix: i.functionName,
2152
2285
  value: i.functionParameter,
@@ -2161,15 +2294,15 @@ function Qi(e) {
2161
2294
  className: "univer-ml-2 univer-flex univer-h-6 univer-w-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-bg-transparent univer-p-0 univer-text-xs univer-text-gray-500 univer-outline-none univer-transition-colors hover:univer-bg-gray-200 dark:hover:!univer-bg-gray-600",
2162
2295
  style: { transform: h ? "rotateZ(-90deg)" : "rotateZ(90deg)" },
2163
2296
  onClick: () => d(!h),
2164
- children: /* @__PURE__ */ M(Dr, {})
2297
+ children: /* @__PURE__ */ M(Fr, {})
2165
2298
  }
2166
2299
  ),
2167
2300
  /* @__PURE__ */ M(
2168
2301
  "div",
2169
2302
  {
2170
2303
  className: "univer-ml-2 univer-flex univer-h-6 univer-w-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-bg-transparent univer-p-0 univer-text-xs univer-text-gray-600 univer-outline-none univer-transition-colors hover:univer-bg-gray-300 dark:!univer-text-gray-200 dark:hover:!univer-bg-gray-600",
2171
- onClick: I,
2172
- children: /* @__PURE__ */ M(kr, {})
2304
+ onClick: E,
2305
+ children: /* @__PURE__ */ M(wr, {})
2173
2306
  }
2174
2307
  )
2175
2308
  ] })
@@ -2179,32 +2312,32 @@ function Qi(e) {
2179
2312
  /* @__PURE__ */ M(
2180
2313
  "div",
2181
2314
  {
2182
- className: re("univer-box-border univer-max-h-[350px] univer-overflow-y-auto univer-px-4 univer-pb-3 univer-pt-0", ut),
2315
+ className: re("univer-box-border univer-max-h-[350px] univer-overflow-y-auto univer-px-4 univer-pb-3 univer-pt-0", lt),
2183
2316
  style: {
2184
2317
  height: h ? "unset" : 0,
2185
2318
  padding: h ? "revert-layer" : 0
2186
2319
  },
2187
2320
  children: /* @__PURE__ */ W("div", { className: "univer-mt-3", children: [
2188
2321
  /* @__PURE__ */ M(
2189
- tn,
2322
+ en,
2190
2323
  {
2191
2324
  title: u.t("formula.prompt.helpExample"),
2192
2325
  value: `${i.functionName}(${i.functionParameter.map((f) => f.example).join(",")})`
2193
2326
  }
2194
2327
  ),
2195
2328
  /* @__PURE__ */ M(
2196
- tn,
2329
+ en,
2197
2330
  {
2198
2331
  title: u.t("formula.prompt.helpAbstract"),
2199
2332
  value: i.description
2200
2333
  }
2201
2334
  ),
2202
2335
  i && i.functionParameter && i.functionParameter.map((f, b) => /* @__PURE__ */ M(
2203
- tn,
2336
+ en,
2204
2337
  {
2205
2338
  className: c === b ? "univer-text-primary-500" : "",
2206
2339
  title: f.name,
2207
- value: `${f.require ? a : S} ${f.detail}`
2340
+ value: `${f.require ? a : v} ${f.detail}`
2208
2341
  },
2209
2342
  b
2210
2343
  ))
@@ -2215,14 +2348,14 @@ function Qi(e) {
2215
2348
  }
2216
2349
  ) }, "show") : null;
2217
2350
  }
2218
- const Ji = (e) => {
2219
- const t = T(Ge);
2351
+ const Xi = (e) => {
2352
+ const t = T(Ye);
2220
2353
  return te((o) => {
2221
2354
  var r, s;
2222
2355
  if (e) {
2223
2356
  t.focus(e.getEditorId());
2224
2357
  const i = [...e.getSelectionRanges()];
2225
- if (un.isDefine(o))
2358
+ if (ln.isDefine(o))
2226
2359
  e.setSelectionRanges([{ startOffset: o, endOffset: o }]);
2227
2360
  else if (!i.length && !e.docSelectionRenderService.isOnPointerEvent) {
2228
2361
  const c = (s = (r = e.getDocumentData().body) == null ? void 0 : r.dataStream) != null ? s : `\r
@@ -2233,19 +2366,19 @@ const Ji = (e) => {
2233
2366
  }
2234
2367
  });
2235
2368
  };
2236
- function ec(e) {
2369
+ function Qi(e) {
2237
2370
  var r, s;
2238
2371
  const n = e.get(ne).getCurrentUniverDocInstance();
2239
2372
  return n != null && n.getBody() ? { dataStream: (s = (r = n.getBody()) == null ? void 0 : r.dataStream) != null ? s : "", offset: 0 } : void 0;
2240
2373
  }
2241
- var Oe = /* @__PURE__ */ ((e) => (e[e.NOT_SELECT = 0] = "NOT_SELECT", e[e.NEED_ADD = 1] = "NEED_ADD", e[e.CAN_EDIT = 2] = "CAN_EDIT", e[e.EDIT_OTHER_SHEET_REFERENCE = 3] = "EDIT_OTHER_SHEET_REFERENCE", e[e.EDIT_OTHER_WORKBOOK_REFERENCE = 4] = "EDIT_OTHER_WORKBOOK_REFERENCE", e))(Oe || {});
2242
- function tc(e) {
2374
+ var Te = /* @__PURE__ */ ((e) => (e[e.NOT_SELECT = 0] = "NOT_SELECT", e[e.NEED_ADD = 1] = "NEED_ADD", e[e.CAN_EDIT = 2] = "CAN_EDIT", e[e.EDIT_OTHER_SHEET_REFERENCE = 3] = "EDIT_OTHER_SHEET_REFERENCE", e[e.EDIT_OTHER_WORKBOOK_REFERENCE = 4] = "EDIT_OTHER_WORKBOOK_REFERENCE", e))(Te || {});
2375
+ function Ji(e) {
2243
2376
  var y;
2244
- const { editorId: t, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = e, i = T(Me), c = T(ne), l = i.getRenderById(r), g = i.getRenderById(t), m = g == null ? void 0 : g.with(pr), h = T(Er), d = T(Et), [u, a] = V(
2377
+ const { editorId: t, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = e, i = T(xe), c = T(ne), l = i.getRenderById(r), g = i.getRenderById(t), m = g == null ? void 0 : g.with(mr), h = T(Rr), d = T(Rt), [u, a] = V(
2245
2378
  0
2246
2379
  /* NOT_SELECT */
2247
- ), S = T(Re), p = z(!0), v = l == null ? void 0 : l.with($e), C = nt(u), _ = c.getUnit(r, H.UNIVER_SHEET), I = _ == null ? void 0 : _.getSheetBySheetId(s), f = te((A) => {
2248
- v && v.setSkipLastEnabled(
2380
+ ), v = T(_e), p = z(!0), S = l == null ? void 0 : l.with(De), C = tt(u), _ = c.getUnit(r, H.UNIVER_SHEET), E = _ == null ? void 0 : _.getSheetBySheetId(s), f = te((A) => {
2381
+ S && S.setSkipLastEnabled(
2249
2382
  A === 1 || A === 3 || A === 4
2250
2383
  /* EDIT_OTHER_WORKBOOK_REFERENCE */
2251
2384
  ), C.current = A, a(A);
@@ -2253,24 +2386,24 @@ function tc(e) {
2253
2386
  var ce, ae, he;
2254
2387
  const A = c.getCurrentUnitOfType(H.UNIVER_SHEET);
2255
2388
  if (!A) return;
2256
- const F = A.getActiveSheet(), O = m == null ? void 0 : m.getActiveTextRange(), N = O != null && O.collapsed ? O.startOffset : -1, k = ec(d);
2389
+ const F = A.getActiveSheet(), N = m == null ? void 0 : m.getActiveTextRange(), O = N != null && N.collapsed ? N.startOffset : -1, k = Qi(d);
2257
2390
  if (!k) return;
2258
- const E = (ce = k == null ? void 0 : k.dataStream) == null ? void 0 : ce.slice(0, -2), x = ((ae = S.sequenceNodesBuilder(E)) != null ? ae : []).map((K) => typeof K == "object" ? K.nodeType === Q.REFERENCE ? {
2391
+ const I = (ce = k == null ? void 0 : k.dataStream) == null ? void 0 : ce.slice(0, -2), x = ((ae = v.sequenceNodesBuilder(I)) != null ? ae : []).map((K) => typeof K == "object" ? K.nodeType === Q.REFERENCE ? {
2259
2392
  ...K,
2260
- range: $o(K.token)
2393
+ range: Lo(K.token)
2261
2394
  } : {
2262
2395
  ...K,
2263
2396
  range: void 0
2264
- } : K), R = E[N - 1], w = E[N], D = x.find((K) => typeof K == "object" && K.nodeType === Q.REFERENCE && N === K.endIndex + 2), U = R && Po(R) && (!w || Uo(w) && w !== Ke.OPEN_BRACKET), B = !!D;
2265
- if ((E == null ? void 0 : E.substring(0, 1)) === "=" && (U || B))
2397
+ } : K), R = I[O - 1], w = I[O], D = x.find((K) => typeof K == "object" && K.nodeType === Q.REFERENCE && O === K.endIndex + 2), U = R && $o(R) && (!w || Po(w) && w !== je.OPEN_BRACKET), B = !!D;
2398
+ if ((I == null ? void 0 : I.substring(0, 1)) === "=" && (U || B))
2266
2399
  if (B) {
2267
2400
  if (p.current)
2268
2401
  return;
2269
- const { sheetName: K, unitId: J } = D.range, rt = (he = c.getCurrentUnitOfType(H.UNIVER_SHEET)) == null ? void 0 : he.getUnitId();
2270
- J && J !== rt ? f(
2402
+ const { sheetName: K, unitId: J } = D.range, nt = (he = c.getCurrentUnitOfType(H.UNIVER_SHEET)) == null ? void 0 : he.getUnitId();
2403
+ J && J !== nt ? f(
2271
2404
  4
2272
2405
  /* EDIT_OTHER_WORKBOOK_REFERENCE */
2273
- ) : !K && F.getSheetId() === (I == null ? void 0 : I.getSheetId()) || K === F.getName() ? f(
2406
+ ) : !K && F.getSheetId() === (E == null ? void 0 : E.getSheetId()) || K === F.getName() ? f(
2274
2407
  2
2275
2408
  /* CAN_EDIT */
2276
2409
  ) : f(
@@ -2289,7 +2422,7 @@ function tc(e) {
2289
2422
  );
2290
2423
  });
2291
2424
  return $(() => {
2292
- const A = h.textSelection$.pipe(mr((F) => F.unitId === t)).subscribe(() => {
2425
+ const A = h.textSelection$.pipe(gr((F) => F.unitId === t)).subscribe(() => {
2293
2426
  b();
2294
2427
  });
2295
2428
  return () => A.unsubscribe();
@@ -2320,12 +2453,12 @@ function tc(e) {
2320
2453
  };
2321
2454
  }, [b, n, _ == null ? void 0 : _.activeSheet$, c.getCurrentTypeOfUnit$]), { isSelecting: u, isSelectingRef: C };
2322
2455
  }
2323
- const nc = () => {
2324
- const e = T(Re);
2325
- return Lt((n) => e.sequenceNodesBuilder(n) || [], [e]);
2456
+ const ec = () => {
2457
+ const e = T(_e);
2458
+ return Dt((n) => e.sequenceNodesBuilder(n) || [], [e]);
2326
2459
  };
2327
- function rc(e, t, n) {
2328
- const o = new dn(t).setAlpha(0.05).toRgbString();
2460
+ function tc(e, t, n) {
2461
+ const o = new un(t).setAlpha(0.05).toRgbString();
2329
2462
  return {
2330
2463
  id: n,
2331
2464
  strokeWidth: 1,
@@ -2337,8 +2470,8 @@ function rc(e, t, n) {
2337
2470
  widgetStroke: e.getColorFromTheme("white")
2338
2471
  };
2339
2472
  }
2340
- function Vr(e) {
2341
- var _, I, f;
2473
+ function Ur(e) {
2474
+ var _, E, f;
2342
2475
  const {
2343
2476
  unitId: t,
2344
2477
  subUnitId: n,
@@ -2355,34 +2488,34 @@ function Vr(e) {
2355
2488
  i.setSelections(a);
2356
2489
  return;
2357
2490
  }
2358
- const S = u.getSheetId(), p = (b) => {
2491
+ const v = u.getSheetId(), p = (b) => {
2359
2492
  var y;
2360
2493
  return (y = d == null ? void 0 : d.getSheetBySheetName(b)) == null ? void 0 : y.getSheetId();
2361
2494
  };
2362
- if (!((_ = l == null ? void 0 : l.getWorksheetSkeleton(S)) == null ? void 0 : _.skeleton)) return;
2495
+ if (!((_ = l == null ? void 0 : l.getWorksheetSkeleton(v)) == null ? void 0 : _.skeleton)) return;
2363
2496
  const C = [];
2364
2497
  for (let b = 0, y = r.length; b < y; b++) {
2365
- const A = r[b], { themeColor: F, token: O, refIndex: N, endIndex: k } = A, E = ft(O), { unitId: x, sheetName: R, range: w } = E, D = p(R);
2366
- if (!D && R || h !== t && x !== h || x && x !== h || D && D !== S || !D && S !== n)
2498
+ const A = r[b], { themeColor: F, token: N, refIndex: O, endIndex: k } = A, I = ht(N), { unitId: x, sheetName: R, range: w } = I, D = p(R);
2499
+ if (!D && R || h !== t && x !== h || x && x !== h || D && D !== v || !D && v !== n)
2367
2500
  continue;
2368
- const U = ls(w, u.getRowCount(), u.getColumnCount());
2369
- U.unitId = t, U.sheetId = S, a.push({
2501
+ const U = as(w, u.getRowCount(), u.getColumnCount());
2502
+ U.unitId = t, U.sheetId = v, a.push({
2370
2503
  range: U,
2371
2504
  primary: null,
2372
- style: rc(g, F, N.toString())
2505
+ style: tc(g, F, O.toString())
2373
2506
  }), C.push(k);
2374
2507
  }
2375
2508
  if (s) {
2376
- const b = (f = (I = s.getSelectionRanges()) == null ? void 0 : I[0]) == null ? void 0 : f.startOffset, y = C.findIndex((A) => A + 2 === b);
2509
+ const b = (f = (E = s.getSelectionRanges()) == null ? void 0 : E[0]) == null ? void 0 : f.startOffset, y = C.findIndex((A) => A + 2 === b);
2377
2510
  y !== -1 ? c == null || c.setActiveSelectionIndex(y) : c == null || c.resetActiveSelectionIndex();
2378
2511
  }
2379
2512
  return a;
2380
2513
  }
2381
- function oc(e, t) {
2382
- const n = T(ne), o = T(It), r = T(Yt), s = T(Me), i = Se(ie(() => n.getCurrentTypeOfUnit$(H.UNIVER_SHEET), [n])), c = i ? s.getRenderById(i.getUnitId()) : null, l = c == null ? void 0 : c.with($e), g = c == null ? void 0 : c.with(Kt), m = te((h, d) => {
2514
+ function nc(e, t) {
2515
+ const n = T(ne), o = T(It), r = T(Kt), s = T(xe), i = Se(ie(() => n.getCurrentTypeOfUnit$(H.UNIVER_SHEET), [n])), c = i ? s.getRenderById(i.getUnitId()) : null, l = c == null ? void 0 : c.with(De), g = c == null ? void 0 : c.with(jt), m = te((h, d) => {
2383
2516
  const u = n.getCurrentUnitOfType(H.UNIVER_SHEET);
2384
2517
  if (!u || l != null && l.selectionMoving) return;
2385
- const a = Vr({
2518
+ const a = Ur({
2386
2519
  unitId: e,
2387
2520
  subUnitId: t,
2388
2521
  currentWorkbook: u,
@@ -2401,8 +2534,8 @@ function oc(e, t) {
2401
2534
  l == null || l.resetActiveSelectionIndex();
2402
2535
  }, [l]), m;
2403
2536
  }
2404
- function Wr(e = "") {
2405
- const t = T(Gt), n = sc(), o = T(pe), r = ie(() => e.length, [e]);
2537
+ function Vr(e = "") {
2538
+ const t = T(Yt), n = rc(), o = T(me), r = ie(() => e.length, [e]);
2406
2539
  return te((i, c, l = !0, g) => {
2407
2540
  const m = i.getDocumentData(), h = i.getEditorId();
2408
2541
  if (!m)
@@ -2413,35 +2546,35 @@ function Wr(e = "") {
2413
2546
  const u = d.dataStream.slice(0, d.dataStream.length - 2), a = { dataStream: "", ...m.body };
2414
2547
  if (!u.startsWith(e)) return [];
2415
2548
  if (c == null || c.length === 0)
2416
- return a.textRuns = [], o.syncExecuteCommand(Vn.id, {
2549
+ return a.textRuns = [], o.syncExecuteCommand(Un.id, {
2417
2550
  unitId: h,
2418
- body: wn(a, 0, a.dataStream.length - 2)
2551
+ body: Mn(a, 0, a.dataStream.length - 2)
2419
2552
  }), [];
2420
2553
  {
2421
- const { textRuns: S, refSelections: p } = ic(t, n, c);
2422
- r && S.forEach((_) => {
2554
+ const { textRuns: v, refSelections: p } = oc(t, n, c);
2555
+ r && v.forEach((_) => {
2423
2556
  _.ed = _.ed + r, _.st = _.st + r;
2424
- }), a.textRuns = [{ st: 0, ed: 1, ts: { fs: 11 } }, ...S];
2425
- const v = c.reduce((_, I) => typeof I == "string" ? `${_}${I}` : `${_}${I.token}`, "");
2426
- a.dataStream = `${e}${v}\r
2557
+ }), a.textRuns = [{ st: 0, ed: 1, ts: { fs: 11 } }, ...v];
2558
+ const S = c.reduce((_, E) => typeof E == "string" ? `${_}${E}` : `${_}${E.token}`, "");
2559
+ a.dataStream = `${e}${S}\r
2427
2560
  `;
2428
2561
  let C;
2429
2562
  if (l) {
2430
2563
  C = i.getSelectionRanges();
2431
2564
  const _ = a.dataStream.length - 2 + r;
2432
- C.forEach((I) => {
2433
- I.startOffset = Math.max(0, Math.min(I.startOffset, _)), I.endOffset = Math.max(0, Math.min(I.endOffset, _));
2565
+ C.forEach((E) => {
2566
+ E.startOffset = Math.max(0, Math.min(E.startOffset, _)), E.endOffset = Math.max(0, Math.min(E.endOffset, _));
2434
2567
  });
2435
2568
  }
2436
- return o.syncExecuteCommand(Vn.id, {
2569
+ return o.syncExecuteCommand(Un.id, {
2437
2570
  unitId: h,
2438
- body: wn(a, 0, a.dataStream.length - 2),
2571
+ body: Mn(a, 0, a.dataStream.length - 2),
2439
2572
  textRanges: g != null ? g : C
2440
2573
  }), p;
2441
2574
  }
2442
2575
  });
2443
2576
  }
2444
- function sc() {
2577
+ function rc() {
2445
2578
  const e = T(It), t = e.getCurrentTheme();
2446
2579
  return ie(() => {
2447
2580
  const o = [
@@ -2461,15 +2594,15 @@ function sc() {
2461
2594
  return { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: i };
2462
2595
  }, [t]);
2463
2596
  }
2464
- function ic(e, t, n) {
2597
+ function oc(e, t, n) {
2465
2598
  const { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: i } = t, c = [], l = [], g = /* @__PURE__ */ new Map();
2466
2599
  let m = 0;
2467
2600
  for (let h = 0, d = n.length; h < d; h++) {
2468
2601
  const u = n[h];
2469
2602
  if (typeof u == "string") {
2470
- const _ = c[c.length - 1], I = _ ? _.ed : 0, f = I + u.length;
2603
+ const _ = c[c.length - 1], E = _ ? _.ed : 0, f = E + u.length;
2471
2604
  c.push({
2472
- st: I,
2605
+ st: E,
2473
2606
  ed: f,
2474
2607
  ts: {
2475
2608
  cl: {
@@ -2493,19 +2626,19 @@ function ic(e, t, n) {
2493
2626
  });
2494
2627
  continue;
2495
2628
  }
2496
- const { startIndex: a, endIndex: S, nodeType: p, token: v } = u;
2629
+ const { startIndex: a, endIndex: v, nodeType: p, token: S } = u;
2497
2630
  let C = "";
2498
2631
  if (p === Q.REFERENCE) {
2499
- if (g.has(v))
2500
- C = g.get(v);
2632
+ if (g.has(S))
2633
+ C = g.get(S);
2501
2634
  else {
2502
2635
  const _ = m % o.length;
2503
- C = o[_], g.set(v, C), m++;
2636
+ C = o[_], g.set(S, C), m++;
2504
2637
  }
2505
2638
  l.push({
2506
2639
  refIndex: h,
2507
2640
  themeColor: C,
2508
- token: v,
2641
+ token: S,
2509
2642
  startIndex: u.startIndex,
2510
2643
  endIndex: u.endIndex,
2511
2644
  index: l.length
@@ -2513,7 +2646,7 @@ function ic(e, t, n) {
2513
2646
  } else p === Q.NUMBER ? C = r : (p === Q.STRING || p === Q.ARRAY) && (C = s);
2514
2647
  C && C.length > 0 ? c.push({
2515
2648
  st: a,
2516
- ed: S + 1,
2649
+ ed: v + 1,
2517
2650
  ts: {
2518
2651
  cl: {
2519
2652
  rgb: C
@@ -2522,7 +2655,7 @@ function ic(e, t, n) {
2522
2655
  }
2523
2656
  }) : c.push({
2524
2657
  st: a,
2525
- ed: S + 1,
2658
+ ed: v + 1,
2526
2659
  ts: {
2527
2660
  cl: {
2528
2661
  rgb: i
@@ -2533,50 +2666,50 @@ function ic(e, t, n) {
2533
2666
  }
2534
2667
  return { textRuns: c, refSelections: l };
2535
2668
  }
2536
- const cc = (e, t, n, o) => {
2537
- const r = T(pe), s = T(Zt), i = z(t);
2669
+ const sc = (e, t, n, o) => {
2670
+ const r = T(me), s = T(Gt), i = z(t);
2538
2671
  i.current = t;
2539
2672
  const c = z(o);
2540
2673
  c.current = o, $(() => {
2541
2674
  if (!n || !e)
2542
2675
  return;
2543
- const g = `sheet.formula-embedding-editor.${n.getEditorId()}`, m = new qe(), h = (a, S) => {
2676
+ const g = `sheet.formula-embedding-editor.${n.getEditorId()}`, m = new qe(), h = (a, v) => {
2544
2677
  if (c.current) {
2545
- c.current(a, S);
2678
+ c.current(a, v);
2546
2679
  return;
2547
2680
  }
2548
2681
  let p = de.LEFT;
2549
- a === L.ARROW_DOWN ? p = de.DOWN : a === L.ARROW_UP ? p = de.UP : a === L.ARROW_RIGHT && (p = de.RIGHT), S === P.SHIFT ? r.executeCommand(zo.id, {
2682
+ a === L.ARROW_DOWN ? p = de.DOWN : a === L.ARROW_UP ? p = de.UP : a === L.ARROW_RIGHT && (p = de.RIGHT), v === P.SHIFT ? r.executeCommand(Zo.id, {
2550
2683
  direction: p
2551
- }) : r.executeCommand(Xo.id, {
2684
+ }) : r.executeCommand(zo.id, {
2552
2685
  direction: p
2553
2686
  });
2554
- }, d = (a, S) => {
2687
+ }, d = (a, v) => {
2555
2688
  let p = de.DOWN;
2556
- a === L.ARROW_DOWN ? p = de.DOWN : a === L.ARROW_UP ? p = de.UP : a === L.ARROW_LEFT ? p = de.LEFT : a === L.ARROW_RIGHT && (p = de.RIGHT), i.current ? S === P.CTRL_COMMAND ? r.executeCommand(Ln.id, {
2689
+ a === L.ARROW_DOWN ? p = de.DOWN : a === L.ARROW_UP ? p = de.UP : a === L.ARROW_LEFT ? p = de.LEFT : a === L.ARROW_RIGHT && (p = de.RIGHT), i.current ? v === P.CTRL_COMMAND ? r.executeCommand(Dn.id, {
2557
2690
  direction: p,
2558
- jumpOver: $n.moveGap,
2691
+ jumpOver: Ln.moveGap,
2559
2692
  extra: "formula-editor",
2560
- fromCurrentSelection: i.current === Oe.NEED_ADD || i.current === Oe.EDIT_OTHER_SHEET_REFERENCE
2561
- }) : S === P.SHIFT ? r.executeCommand(Pn.id, {
2693
+ fromCurrentSelection: i.current === Te.NEED_ADD || i.current === Te.EDIT_OTHER_SHEET_REFERENCE
2694
+ }) : v === P.SHIFT ? r.executeCommand($n.id, {
2562
2695
  direction: p,
2563
2696
  extra: "formula-editor"
2564
- }) : S === (P.CTRL_COMMAND | P.SHIFT) ? r.executeCommand(Pn.id, {
2697
+ }) : v === (P.CTRL_COMMAND | P.SHIFT) ? r.executeCommand($n.id, {
2565
2698
  direction: p,
2566
- jumpOver: $n.moveGap,
2699
+ jumpOver: Ln.moveGap,
2567
2700
  extra: "formula-editor"
2568
- }) : r.executeCommand(Ln.id, {
2701
+ }) : r.executeCommand(Dn.id, {
2569
2702
  direction: p,
2570
2703
  extra: "formula-editor",
2571
- fromCurrentSelection: i.current === Oe.NEED_ADD || i.current === Oe.EDIT_OTHER_SHEET_REFERENCE
2572
- }) : h(a, S);
2704
+ fromCurrentSelection: i.current === Te.NEED_ADD || i.current === Te.EDIT_OTHER_SHEET_REFERENCE
2705
+ }) : h(a, v);
2573
2706
  };
2574
2707
  return m.add(r.registerCommand({
2575
2708
  id: g,
2576
2709
  type: Ne.OPERATION,
2577
- handler(a, S) {
2578
- const { keyCode: p, metaKey: v } = S;
2579
- d(p, v);
2710
+ handler(a, v) {
2711
+ const { keyCode: p, metaKey: S } = v;
2712
+ d(p, S);
2580
2713
  }
2581
2714
  })), [
2582
2715
  { keyCode: L.ARROW_DOWN },
@@ -2595,15 +2728,15 @@ const cc = (e, t, n, o) => {
2595
2728
  { keyCode: L.ARROW_LEFT, metaKey: P.CTRL_COMMAND | P.SHIFT },
2596
2729
  { keyCode: L.ARROW_RIGHT, metaKey: P.CTRL_COMMAND | P.SHIFT },
2597
2730
  { keyCode: L.ARROW_UP, metaKey: P.CTRL_COMMAND | P.SHIFT }
2598
- ].map(({ keyCode: a, metaKey: S }) => ({
2731
+ ].map(({ keyCode: a, metaKey: v }) => ({
2599
2732
  id: g,
2600
- binding: S ? a | S : a,
2733
+ binding: v ? a | v : a,
2601
2734
  preconditions: () => !0,
2602
2735
  priority: 900,
2603
2736
  staticParameters: {
2604
- eventType: xe.Keyboard,
2737
+ eventType: Oe.Keyboard,
2605
2738
  keyCode: a,
2606
- metaKey: S
2739
+ metaKey: v
2607
2740
  }
2608
2741
  })).forEach((a) => {
2609
2742
  m.add(s.registerShortcut(a));
@@ -2611,88 +2744,88 @@ const cc = (e, t, n, o) => {
2611
2744
  m.dispose();
2612
2745
  };
2613
2746
  }, [r, n, e, s]);
2614
- }, ac = (e, t, n, o, r = !0) => {
2747
+ }, ic = (e, t, n, o, r = !0) => {
2615
2748
  var u;
2616
- const s = T(Me), i = T(an), c = T(vs), l = T(Yt), g = T(ne), m = Se(ie(() => g.getCurrentTypeOfUnit$(H.UNIVER_SHEET), [g])), h = s.getRenderById((u = m == null ? void 0 : m.getUnitId()) != null ? u : ""), d = h == null ? void 0 : h.with($e);
2617
- $t(() => {
2749
+ const s = T(xe), i = T(cn), c = T(ps), l = T(Kt), g = T(ne), m = Se(ie(() => g.getCurrentTypeOfUnit$(H.UNIVER_SHEET), [g])), h = s.getRenderById((u = m == null ? void 0 : m.getUnitId()) != null ? u : ""), d = h == null ? void 0 : h.with(De);
2750
+ Lt(() => {
2618
2751
  if (e)
2619
- return i.setContextValue(kn, !0), r && c.disable(), () => {
2752
+ return i.setContextValue(wn, !0), r && c.disable(), () => {
2620
2753
  const a = g.getCurrentUnitOfType(H.UNIVER_DOC);
2621
- (a == null ? void 0 : a.getUnitId()) === o && i.setContextValue(kn, !1), r && c.enable(), l.clear();
2754
+ (a == null ? void 0 : a.getUnitId()) === o && i.setContextValue(wn, !1), r && c.enable(), l.clear();
2622
2755
  };
2623
- }, [i, e, l, r, o]), $t(() => {
2756
+ }, [i, e, l, r, o]), Lt(() => {
2624
2757
  if (e && t) {
2625
2758
  const a = d == null ? void 0 : d.enableSelectionChanging();
2626
- return i.setContextValue(Bn, !0), () => {
2627
- i.setContextValue(Bn, !1), a == null || a.dispose();
2759
+ return i.setContextValue(Hn, !0), () => {
2760
+ i.setContextValue(Hn, !1), a == null || a.dispose();
2628
2761
  };
2629
2762
  }
2630
2763
  }, [i, e, d, t]), $(() => {
2631
2764
  e && (d == null || d.setSkipLastEnabled(!1));
2632
2765
  }, [e, d]);
2633
- }, lc = (e, t, n) => {
2634
- const o = T(ne), r = T(gn);
2635
- return Lt(() => {
2766
+ }, cc = (e, t, n) => {
2767
+ const o = T(ne), r = T(fn);
2768
+ return Dt(() => {
2636
2769
  if (e) {
2637
2770
  const i = [...r.getWorkbookSelections(t).getSelectionsOfWorksheet(n)], c = o.getCurrentUnitForType(H.UNIVER_SHEET), l = c == null ? void 0 : c.getActiveSheet();
2638
2771
  (c == null ? void 0 : c.getUnitId()) !== t && o.setCurrentUnitForType(t), l && l.getSheetId() === n && r.setSelections(i);
2639
2772
  }
2640
2773
  }, [e, r, n, t, o]);
2641
- }, uc = (e) => e.reduce((t, n) => typeof n == "string" ? t + n.length : t + n.token.length, 0), cn = (e) => e.map((t) => typeof t == "string" ? t : t.token).join(""), At = (e, t = !1, n = "", o = !1) => !t && !o ? e.map((r) => _e(r.range)) : e.map((r) => o ? Vo(r) : r.sheetName !== "" && r.sheetName !== n ? _t(r.sheetName, r.range) : _e(r.range)), dc = (e) => {
2774
+ }, ac = (e) => e.reduce((t, n) => typeof n == "string" ? t + n.length : t + n.token.length, 0), sn = (e) => e.map((t) => typeof t == "string" ? t : t.token).join(""), kt = (e, t = !1, n = "", o = !1) => !t && !o ? e.map((r) => Ce(r.range)) : e.map((r) => o ? Uo(r) : r.sheetName !== "" && r.sheetName !== n ? Ct(r.sheetName, r.range) : Ce(r.range)), lc = (e) => {
2642
2775
  var m, h, d;
2643
2776
  const { editor: t, lexerTreeBuilder: n } = e, o = t == null ? void 0 : t.getSelectionRanges();
2644
2777
  if ((o == null ? void 0 : o.length) !== 1)
2645
2778
  return;
2646
2779
  const s = o[0].startOffset - 1, i = ((h = (m = t == null ? void 0 : t.getDocumentData().body) == null ? void 0 : m.dataStream) != null ? h : `\r
2647
- `).slice(0, -2), c = (d = n.sequenceNodesBuilder(i.slice(1))) != null ? d : [], l = Rn(c, s, !1), g = Pr(c, l);
2780
+ `).slice(0, -2), c = (d = n.sequenceNodesBuilder(i.slice(1))) != null ? d : [], l = _n(c, s, !1), g = $r(c, l);
2648
2781
  return {
2649
2782
  nodeIndex: l,
2650
2783
  updatingRefIndex: g,
2651
2784
  sequenceNodes: c,
2652
2785
  offset: s
2653
2786
  };
2654
- }, hc = (() => {
2655
- }), fc = (e, t, n, o, r, s, i, c, l, g = hc) => {
2656
- var N;
2657
- const m = T(Me), h = T(ne), d = T(pe), u = T(Er), a = T(It), S = T(Re), p = h.getUnit(o), v = te((k, E) => {
2787
+ }, uc = (() => {
2788
+ }), dc = (e, t, n, o, r, s, i, c, l, g = uc) => {
2789
+ var O;
2790
+ const m = T(xe), h = T(ne), d = T(me), u = T(Rr), a = T(It), v = T(_e), p = h.getUnit(o), S = te((k, I) => {
2658
2791
  var x, R, w;
2659
- return (w = (R = (x = h.getUnit(k)) == null ? void 0 : x.getSheetBySheetId(E)) == null ? void 0 : R.getName()) != null ? w : "";
2660
- }), C = ie(() => v(o, r), [v, r, o]), _ = Se(p == null ? void 0 : p.activeSheet$), I = nt({ activeSheet: _, sheetName: C }), f = Se(ie(() => h.getCurrentTypeOfUnit$(H.UNIVER_SHEET), [h])), b = m.getRenderById((N = f == null ? void 0 : f.getUnitId()) != null ? N : ""), y = b == null ? void 0 : b.with($e), A = b == null ? void 0 : b.with(Kt), F = T(Yt), O = te((k, E) => {
2661
- var B, ce, ae, he, K, J, rt, ot, Tt, Ee;
2662
- const x = dc({ editor: l, lexerTreeBuilder: S });
2792
+ return (w = (R = (x = h.getUnit(k)) == null ? void 0 : x.getSheetBySheetId(I)) == null ? void 0 : R.getName()) != null ? w : "";
2793
+ }), C = ie(() => S(o, r), [S, r, o]), _ = Se(p == null ? void 0 : p.activeSheet$), E = tt({ activeSheet: _, sheetName: C }), f = Se(ie(() => h.getCurrentTypeOfUnit$(H.UNIVER_SHEET), [h])), b = m.getRenderById((O = f == null ? void 0 : f.getUnitId()) != null ? O : ""), y = b == null ? void 0 : b.with(De), A = b == null ? void 0 : b.with(jt), F = T(Kt), N = te((k, I) => {
2794
+ var B, ce, ae, he, K, J, nt, rt, yt, Re;
2795
+ const x = lc({ editor: l, lexerTreeBuilder: v });
2663
2796
  if (!x) return;
2664
2797
  const { nodeIndex: R, updatingRefIndex: w, sequenceNodes: D, offset: U } = x;
2665
- if (n.current === Oe.NEED_ADD)
2798
+ if (n.current === Te.NEED_ADD)
2666
2799
  if (U !== 0) {
2667
2800
  if (R === -1 && D.length)
2668
2801
  return;
2669
2802
  const Y = k[k.length - 1], X = D.splice(R + 1), Ie = (B = Y.sheetId) != null ? B : r, fe = {
2670
2803
  range: Y,
2671
2804
  unitId: (ce = Y.unitId) != null ? ce : f.getUnitId(),
2672
- sheetName: v((ae = Y.unitId) != null ? ae : f.getUnitId(), Ie)
2673
- }, ee = Ie !== r, le = (f == null ? void 0 : f.getUnitId()) !== o, be = At([fe], i && (ee || le), C, le);
2674
- D.push({ token: be[0], nodeType: Q.REFERENCE });
2675
- const Pe = [...D, ...X], ke = cn(Pe);
2676
- g(ke, uc(D), E);
2805
+ sheetName: S((ae = Y.unitId) != null ? ae : f.getUnitId(), Ie)
2806
+ }, ee = Ie !== r, le = (f == null ? void 0 : f.getUnitId()) !== o, Ee = kt([fe], i && (ee || le), C, le);
2807
+ D.push({ token: Ee[0], nodeType: Q.REFERENCE });
2808
+ const $e = [...D, ...X], Me = sn($e);
2809
+ g(Me, ac(D), I);
2677
2810
  } else {
2678
2811
  const Y = k[k.length - 1], X = (he = Y.sheetId) != null ? he : r, Ie = {
2679
2812
  range: Y,
2680
2813
  unitId: (K = Y.unitId) != null ? K : f.getUnitId(),
2681
- sheetName: v((J = Y.unitId) != null ? J : f.getUnitId(), X)
2682
- }, fe = X !== r, ee = (f == null ? void 0 : f.getUnitId()) !== o, le = At([Ie], i && (fe || ee), C, ee);
2814
+ sheetName: S((J = Y.unitId) != null ? J : f.getUnitId(), X)
2815
+ }, fe = X !== r, ee = (f == null ? void 0 : f.getUnitId()) !== o, le = kt([Ie], i && (fe || ee), C, ee);
2683
2816
  D.unshift({ token: le[0], nodeType: Q.REFERENCE });
2684
- const be = cn(D);
2685
- g(be, le[0].length, E);
2817
+ const Ee = sn(D);
2818
+ g(Ee, le[0].length, I);
2686
2819
  }
2687
- else if (n.current === Oe.EDIT_OTHER_SHEET_REFERENCE || n.current === Oe.EDIT_OTHER_WORKBOOK_REFERENCE) {
2820
+ else if (n.current === Te.EDIT_OTHER_SHEET_REFERENCE || n.current === Te.EDIT_OTHER_WORKBOOK_REFERENCE) {
2688
2821
  const Y = k.pop();
2689
2822
  if (!Y) return;
2690
2823
  const X = D[R];
2691
2824
  if (typeof X == "object" && X.nodeType === Q.REFERENCE) {
2692
2825
  const Ie = X.token;
2693
- (f == null ? void 0 : f.getUnitId()) !== o ? X.token = Wo((rt = f == null ? void 0 : f.getUnitId()) != null ? rt : "", C, Y) : X.token = C === (_ == null ? void 0 : _.getName()) ? _e(Y) : _t(_.getName(), Y);
2826
+ (f == null ? void 0 : f.getUnitId()) !== o ? X.token = Vo((nt = f == null ? void 0 : f.getUnitId()) != null ? nt : "", C, Y) : X.token = C === (_ == null ? void 0 : _.getName()) ? Ce(Y) : Ct(_.getName(), Y);
2694
2827
  const ee = U + (X.token.length - Ie.length);
2695
- g(Ho(D), ee, E);
2828
+ g(Wo(D), ee, I);
2696
2829
  }
2697
2830
  } else {
2698
2831
  const Y = [...k];
@@ -2702,22 +2835,22 @@ const cc = (e, t, n, o) => {
2702
2835
  }
2703
2836
  let X = 0;
2704
2837
  const Ie = D.map((G) => {
2705
- var ge, st, Ue, Ve;
2838
+ var ge, ot, Pe, Ue;
2706
2839
  if (typeof G == "string")
2707
2840
  return G;
2708
2841
  if (G.nodeType === Q.REFERENCE) {
2709
- const We = ft(G.token);
2710
- if (We.sheetName || (We.sheetName = C), (We.unitId || o) !== (f == null ? void 0 : f.getUnitId()) || i && ((ge = I.current.activeSheet) == null ? void 0 : ge.getName()) !== We.sheetName)
2842
+ const Ve = ht(G.token);
2843
+ if (Ve.sheetName || (Ve.sheetName = C), (Ve.unitId || o) !== (f == null ? void 0 : f.getUnitId()) || i && ((ge = E.current.activeSheet) == null ? void 0 : ge.getName()) !== Ve.sheetName)
2711
2844
  return G.token;
2712
2845
  const oe = Y[X];
2713
2846
  if (X++, !oe)
2714
2847
  return "";
2715
- const ye = (st = oe.sheetId) != null ? st : r, Ot = {
2848
+ const be = (ot = oe.sheetId) != null ? ot : r, Tt = {
2716
2849
  range: oe,
2717
- unitId: (Ue = oe.unitId) != null ? Ue : f.getUnitId(),
2718
- sheetName: v((Ve = oe.unitId) != null ? Ve : f.getUnitId(), ye)
2850
+ unitId: (Pe = oe.unitId) != null ? Pe : f.getUnitId(),
2851
+ sheetName: S((Ue = oe.unitId) != null ? Ue : f.getUnitId(), be)
2719
2852
  }, Nt = (f == null ? void 0 : f.getUnitId()) !== o;
2720
- return At([Ot], i && (ye !== r || Nt), C, Nt)[0];
2853
+ return kt([Tt], i && (be !== r || Nt), C, Nt)[0];
2721
2854
  }
2722
2855
  return G.token;
2723
2856
  });
@@ -2727,76 +2860,76 @@ const cc = (e, t, n, o) => {
2727
2860
  });
2728
2861
  const le = [];
2729
2862
  for (let G = X; G <= k.length - 1; G++) {
2730
- const ge = k[G], st = (ot = ge.sheetId) != null ? ot : r, Ue = {
2863
+ const ge = k[G], ot = (rt = ge.sheetId) != null ? rt : r, Pe = {
2731
2864
  range: ge,
2732
- unitId: (Tt = ge.unitId) != null ? Tt : f.getUnitId(),
2733
- sheetName: v((Ee = ge.unitId) != null ? Ee : f.getUnitId(), st)
2734
- }, Ve = (f == null ? void 0 : f.getUnitId()) !== o, oe = At([Ue], i && (st !== r || Ve), C, Ve);
2865
+ unitId: (yt = ge.unitId) != null ? yt : f.getUnitId(),
2866
+ sheetName: S((Re = ge.unitId) != null ? Re : f.getUnitId(), ot)
2867
+ }, Ue = (f == null ? void 0 : f.getUnitId()) !== o, oe = kt([Pe], i && (ot !== r || Ue), C, Ue);
2735
2868
  le.push(oe[0]);
2736
2869
  }
2737
- const be = D[D.length - 1], Pe = be && (typeof be == "string" ? !1 : be.nodeType === Q.REFERENCE), ke = `${fe}${le.length && Pe ? "," : ""}${le.join(",")}`;
2738
- g(ke, !le.length && ee ? ee : ke.length, E);
2870
+ const Ee = D[D.length - 1], $e = Ee && (typeof Ee == "string" ? !1 : Ee.nodeType === Q.REFERENCE), Me = `${fe}${le.length && $e ? "," : ""}${le.join(",")}`;
2871
+ g(Me, !le.length && ee ? ee : Me.length, I);
2739
2872
  }
2740
2873
  });
2741
2874
  $(() => {
2742
2875
  if (y && e) {
2743
2876
  let k = !0;
2744
- const E = (R, w) => {
2877
+ const I = (R, w) => {
2745
2878
  if (k) {
2746
2879
  k = !1;
2747
2880
  return;
2748
2881
  }
2749
- O(R.map((D) => D.rangeWithCoord), w);
2882
+ N(R.map((D) => D.rangeWithCoord), w);
2750
2883
  }, x = new qe();
2751
2884
  return x.add(y.selectionMoving$.subscribe((R) => {
2752
- E(R, !1);
2885
+ I(R, !1);
2753
2886
  })), x.add(y.selectionMoveEnd$.subscribe((R) => {
2754
- E(R, !0);
2887
+ I(R, !0);
2755
2888
  })), () => {
2756
2889
  x.dispose();
2757
2890
  };
2758
2891
  }
2759
- }, [e, O, y]), $(() => {
2892
+ }, [e, N, y]), $(() => {
2760
2893
  if (t && y && l) {
2761
- const k = new qe(), E = () => {
2894
+ const k = new qe(), I = () => {
2762
2895
  k.dispose(), y.getSelectionControls().forEach((w, D) => {
2763
2896
  k.add(
2764
2897
  w.selectionScaling$.subscribe((U) => {
2765
2898
  const B = y.getSelectionDataWithStyle().map((ae) => ae.rangeWithCoord), ce = B[D];
2766
- U.sheetId = ce.sheetId, U.unitId = ce.unitId, B[D] = U, O(B, !1);
2899
+ U.sheetId = ce.sheetId, U.unitId = ce.unitId, B[D] = U, N(B, !1);
2767
2900
  })
2768
2901
  ), k.add(
2769
2902
  w.selectionMoving$.subscribe((U) => {
2770
2903
  const B = y.getSelectionDataWithStyle().map((ae) => ae.rangeWithCoord), ce = B[D];
2771
- U.sheetId = ce.sheetId, U.unitId = ce.unitId, B[D] = U, O(B, !0);
2904
+ U.sheetId = ce.sheetId, U.unitId = ce.unitId, B[D] = U, N(B, !0);
2772
2905
  })
2773
2906
  );
2774
2907
  });
2775
- }, x = Zo(
2908
+ }, x = Go(
2776
2909
  l.input$,
2777
2910
  F.selectionSet$,
2778
2911
  y.selectionMoveEnd$
2779
2912
  ).pipe(
2780
- Os(50)
2913
+ Ts(50)
2781
2914
  ).subscribe(() => {
2782
- E();
2915
+ I();
2783
2916
  });
2784
2917
  return () => {
2785
2918
  x.unsubscribe(), k.dispose();
2786
2919
  };
2787
2920
  }
2788
- }, [l, t, O, y, F.selectionSet$]), y == null || y.getSelectionDataWithStyle(), $(() => {
2921
+ }, [l, t, N, y, F.selectionSet$]), y == null || y.getSelectionDataWithStyle(), $(() => {
2789
2922
  if (c) {
2790
- const k = d.onCommandExecuted((E) => {
2923
+ const k = d.onCommandExecuted((I) => {
2791
2924
  var R;
2792
- if (E.id !== mn.id)
2925
+ if (I.id !== gn.id)
2793
2926
  return;
2794
- const x = E.params;
2927
+ const x = I.params;
2795
2928
  if (x.extra === "formula-editor" && x.selections.length) {
2796
2929
  const w = x.selections[x.selections.length - 1];
2797
2930
  if (w) {
2798
- const D = n.current === Oe.NEED_ADD, U = ((R = y == null ? void 0 : y.getSelectionDataWithStyle()) != null ? R : []).map((B) => B.rangeWithCoord);
2799
- D ? U.push(w.range) : U[U.length - 1] = w.range, O(U, !0);
2931
+ const D = n.current === Te.NEED_ADD, U = ((R = y == null ? void 0 : y.getSelectionDataWithStyle()) != null ? R : []).map((B) => B.rangeWithCoord);
2932
+ D ? U.push(w.range) : U[U.length - 1] = w.range, N(U, !0);
2800
2933
  }
2801
2934
  }
2802
2935
  });
@@ -2804,11 +2937,11 @@ const cc = (e, t, n, o) => {
2804
2937
  k.dispose();
2805
2938
  };
2806
2939
  }
2807
- }, [d, l, n, S, c, O, y]), $(() => {
2940
+ }, [d, l, n, v, c, N, y]), $(() => {
2808
2941
  if (!l)
2809
2942
  return;
2810
- const k = u.textSelection$.subscribe((E) => {
2811
- E.unitId === l.getEditorId() && Vr({
2943
+ const k = u.textSelection$.subscribe((I) => {
2944
+ I.unitId === l.getEditorId() && Ur({
2812
2945
  unitId: o,
2813
2946
  subUnitId: r,
2814
2947
  refSelections: s.current,
@@ -2823,21 +2956,21 @@ const cc = (e, t, n, o) => {
2823
2956
  });
2824
2957
  return () => k.unsubscribe();
2825
2958
  }, [u.textSelection$, l, s, y, F, A, r, a, o, h]);
2826
- }, gc = (e, t, n, o, r, s) => {
2827
- const i = T(pe), c = T(Ge), g = T(Me).getRenderById(t), m = T(ne), h = g == null ? void 0 : g.with($e);
2959
+ }, hc = (e, t, n, o, r, s) => {
2960
+ const i = T(me), c = T(Ye), g = T(xe).getRenderById(t), m = T(ne), h = g == null ? void 0 : g.with(De);
2828
2961
  $(() => {
2829
2962
  if (e && h)
2830
2963
  if (n) {
2831
2964
  const d = () => {
2832
- const S = h.getSelectionControls().length;
2833
- for (let p = 1; p <= S; p++)
2965
+ const v = h.getSelectionControls().length;
2966
+ for (let p = 1; p <= v; p++)
2834
2967
  h.clearLastSelection();
2835
2968
  return setTimeout(() => {
2836
2969
  s();
2837
2970
  }, 30);
2838
- }, u = i.onCommandExecuted((S) => {
2839
- S.id === jn.id && d();
2840
- }), a = m.getCurrentTypeOfUnit$(H.UNIVER_SHEET).subscribe((S) => {
2971
+ }, u = i.onCommandExecuted((v) => {
2972
+ v.id === Bn.id && d();
2973
+ }), a = m.getCurrentTypeOfUnit$(H.UNIVER_SHEET).subscribe((v) => {
2841
2974
  d();
2842
2975
  });
2843
2976
  return () => {
@@ -2845,9 +2978,9 @@ const cc = (e, t, n, o) => {
2845
2978
  };
2846
2979
  } else {
2847
2980
  const d = i.beforeCommandExecuted((u) => {
2848
- if (u.id === jn.id) {
2981
+ if (u.id === Bn.id) {
2849
2982
  o(!1), r(), s();
2850
- const a = c.getEditor(ln);
2983
+ const a = c.getEditor(an);
2851
2984
  a == null || a.focus();
2852
2985
  }
2853
2986
  });
@@ -2856,8 +2989,8 @@ const cc = (e, t, n, o) => {
2856
2989
  };
2857
2990
  }
2858
2991
  }, [e, h]);
2859
- }, mc = (e, t, n) => {
2860
- const o = T(Re), r = z(!0);
2992
+ }, fc = (e, t, n) => {
2993
+ const o = T(_e), r = z(!0);
2861
2994
  $(() => {
2862
2995
  if (e) {
2863
2996
  const s = setTimeout(() => {
@@ -2870,26 +3003,26 @@ const cc = (e, t, n, o) => {
2870
3003
  }, [e]), $(() => {
2871
3004
  if (!r.current && t) {
2872
3005
  const s = o.checkIfAddBracket(n);
2873
- t(s === 0 && n.startsWith(hr.EQUALS), `${n}`);
3006
+ t(s === 0 && n.startsWith(dr.EQUALS), `${n}`);
2874
3007
  }
2875
3008
  }, [n, t]);
2876
- }, pc = (e, t = [], n) => {
2877
- const o = T(Gt), [r, s] = V([]), [i, c] = V(""), l = z(-1), g = nt({ nodes: t }), m = () => {
3009
+ }, gc = (e, t = [], n) => {
3010
+ const o = T(Yt), [r, s] = V([]), [i, c] = V(""), l = z(-1), g = tt({ nodes: t }), m = () => {
2878
3011
  s([]), c(""), l.current = -1;
2879
3012
  };
2880
3013
  return $(() => {
2881
3014
  if (n && e) {
2882
- const d = n.input$.pipe(fn(300)).subscribe(() => {
3015
+ const d = n.input$.pipe(hn(300)).subscribe(() => {
2883
3016
  const u = n.getSelectionRanges();
2884
3017
  if (u.length === 1) {
2885
- const a = g.current.nodes, S = u[0];
2886
- if (S.collapsed) {
2887
- const p = Rn(a, S.startOffset - 1, !1);
3018
+ const a = g.current.nodes, v = u[0];
3019
+ if (v.collapsed) {
3020
+ const p = _n(a, v.startOffset - 1, !1);
2888
3021
  l.current = p;
2889
- const v = a[p];
2890
- if (v && typeof v != "string" && v.nodeType === Q.FUNCTION) {
3022
+ const S = a[p];
3023
+ if (S && typeof S != "string" && S.nodeType === Q.FUNCTION) {
2891
3024
  l.current = p;
2892
- const C = v.token, _ = o.getSearchListByNameFirstLetter(C);
3025
+ const C = S.token, _ = o.getSearchListByNameFirstLetter(C);
2893
3026
  s(_), c(C);
2894
3027
  return;
2895
3028
  }
@@ -2909,41 +3042,41 @@ const cc = (e, t, n, o) => {
2909
3042
  handlerFormulaReplace: (d, u) => {
2910
3043
  const a = [...g.current.nodes];
2911
3044
  if (l.current !== -1) {
2912
- const S = a.splice(l.current + 1), p = a.pop() || "";
2913
- let v = (typeof p == "string" ? p.length : p.token.length) - d.length;
2914
- return a.push(d), S[0] !== Ke.OPEN_BRACKET && u !== dr.DefinedName && (a.push(Ke.OPEN_BRACKET), v--), { text: cn([...a, ...S]), offset: v };
3045
+ const v = a.splice(l.current + 1), p = a.pop() || "";
3046
+ let S = (typeof p == "string" ? p.length : p.token.length) - d.length;
3047
+ return a.push(d), v[0] !== je.OPEN_BRACKET && u !== ur.DefinedName && (a.push(je.OPEN_BRACKET), S--), { text: sn([...a, ...v]), offset: S };
2915
3048
  }
2916
3049
  },
2917
3050
  reset: m
2918
3051
  };
2919
- }, vc = () => {
2920
- }, Sc = we(Cc);
2921
- function Cc(e, t) {
2922
- const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: i = vc } = e, c = s.getEditorId(), l = T(Zt), g = T(pe), { searchList: m, searchText: h, handlerFormulaReplace: d, reset: u } = pc(n, o, s), a = ie(() => !!m.length, [m]), S = z(void 0), [p, v] = V(0), C = z(!1), [_] = Ur(c, a, [h, m]), I = nt({ searchList: m, active: p }), f = (O, N) => {
2923
- const k = d(O, N);
3052
+ }, mc = () => {
3053
+ }, pc = Le(Sc);
3054
+ function Sc(e, t) {
3055
+ const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: i = mc } = e, c = s.getEditorId(), l = T(Gt), g = T(me), { searchList: m, searchText: h, handlerFormulaReplace: d, reset: u } = gc(n, o, s), a = ie(() => !!m.length, [m]), v = z(void 0), [p, S] = V(0), C = z(!1), [_] = Pr(c, a, [h, m]), E = tt({ searchList: m, active: p }), f = (N, O) => {
3056
+ const k = d(N, O);
2924
3057
  k && (u(), r(k));
2925
3058
  };
2926
- function b(O) {
2927
- C.current && v(O);
3059
+ function b(N) {
3060
+ C.current && S(N);
2928
3061
  }
2929
3062
  function y() {
2930
- C.current && v(-1);
3063
+ C.current && S(-1);
2931
3064
  }
2932
3065
  $(() => {
2933
3066
  if (!m.length)
2934
3067
  return;
2935
- const O = `sheet.formula-embedding-editor.search_function.${c}`, N = new qe(), k = (E) => {
2936
- const { searchList: x, active: R } = I.current;
2937
- switch (E) {
3068
+ const N = `sheet.formula-embedding-editor.search_function.${c}`, O = new qe(), k = (I) => {
3069
+ const { searchList: x, active: R } = E.current;
3070
+ switch (I) {
2938
3071
  case L.ARROW_UP: {
2939
- v((w) => {
3072
+ S((w) => {
2940
3073
  const D = Math.max(0, w - 1);
2941
3074
  return A(D), D;
2942
3075
  });
2943
3076
  break;
2944
3077
  }
2945
3078
  case L.ARROW_DOWN: {
2946
- v((w) => {
3079
+ S((w) => {
2947
3080
  const D = Math.min(x.length - 1, w + 1);
2948
3081
  return A(D), D;
2949
3082
  });
@@ -2961,92 +3094,92 @@ function Cc(e, t) {
2961
3094
  }
2962
3095
  }
2963
3096
  };
2964
- return N.add(g.registerCommand({
2965
- id: O,
3097
+ return O.add(g.registerCommand({
3098
+ id: N,
2966
3099
  type: Ne.OPERATION,
2967
- handler(E, x) {
3100
+ handler(I, x) {
2968
3101
  const { keyCode: R } = x;
2969
3102
  k(R);
2970
3103
  }
2971
- })), [L.ARROW_UP, L.ARROW_DOWN, L.ENTER, L.ESC, L.TAB].map((E) => ({
2972
- id: O,
2973
- binding: E,
3104
+ })), [L.ARROW_UP, L.ARROW_DOWN, L.ENTER, L.ESC, L.TAB].map((I) => ({
3105
+ id: N,
3106
+ binding: I,
2974
3107
  preconditions: () => !0,
2975
3108
  priority: 1e3,
2976
3109
  staticParameters: {
2977
- eventType: xe.Keyboard,
2978
- keyCode: E
3110
+ eventType: Oe.Keyboard,
3111
+ keyCode: I
2979
3112
  }
2980
- })).forEach((E) => {
2981
- N.add(l.registerShortcut(E));
3113
+ })).forEach((I) => {
3114
+ O.add(l.registerShortcut(I));
2982
3115
  }), () => {
2983
- N.dispose();
3116
+ O.dispose();
2984
3117
  };
2985
3118
  }, [m]);
2986
- function A(O) {
2987
- const N = S.current;
2988
- if (!N) return;
2989
- const k = N.children[O];
3119
+ function A(N) {
3120
+ const O = v.current;
3121
+ if (!O) return;
3122
+ const k = O.children[N];
2990
3123
  if (!k) return;
2991
- const x = N.getBoundingClientRect().top, R = N.offsetHeight, w = k.getBoundingClientRect(), D = w.top, U = w.height;
3124
+ const x = O.getBoundingClientRect().top, R = O.offsetHeight, w = k.getBoundingClientRect(), D = w.top, U = w.height;
2992
3125
  if (D >= 0 && D > x && D - x + U <= R)
2993
3126
  return;
2994
3127
  const B = k.offsetTop - (R - U) / 2;
2995
- N.scrollTo({
3128
+ O.scrollTo({
2996
3129
  top: B,
2997
3130
  behavior: "smooth"
2998
3131
  });
2999
3132
  }
3000
3133
  const F = ie(() => {
3001
- let O = "";
3134
+ let N = "";
3002
3135
  return () => {
3003
- clearTimeout(O), C.current = !0, O = setTimeout(() => {
3136
+ clearTimeout(N), C.current = !0, N = setTimeout(() => {
3004
3137
  C.current = !1;
3005
3138
  }, 300);
3006
3139
  };
3007
3140
  }, []);
3008
- return m.length > 0 && a && /* @__PURE__ */ M(rn, { portal: !0, anchorRect$: _, direction: "vertical", children: /* @__PURE__ */ M(
3141
+ return m.length > 0 && a && /* @__PURE__ */ M(nn, { portal: !0, anchorRect$: _, direction: "vertical", children: /* @__PURE__ */ M(
3009
3142
  "ul",
3010
3143
  {
3011
- ref: (O) => {
3012
- S.current = O, t && (t.current = O);
3144
+ ref: (N) => {
3145
+ v.current = N, t && (t.current = N);
3013
3146
  },
3014
3147
  "data-u-comp": "sheets-formula-editor",
3015
- className: re("univer-m-0 univer-box-border univer-max-h-[400px] univer-w-[250px] univer-list-none univer-overflow-y-auto univer-rounded-lg univer-bg-white univer-p-2 univer-leading-5 univer-shadow-md univer-outline-none dark:!univer-bg-gray-900", Sn, ut),
3016
- children: m.map((O, N) => /* @__PURE__ */ W(
3148
+ className: re("univer-m-0 univer-box-border univer-max-h-[400px] univer-w-[250px] univer-list-none univer-overflow-y-auto univer-rounded-lg univer-bg-white univer-p-2 univer-leading-5 univer-shadow-md univer-outline-none dark:!univer-bg-gray-900", Sn, lt),
3149
+ children: m.map((N, O) => /* @__PURE__ */ W(
3017
3150
  "li",
3018
3151
  {
3019
3152
  className: re("univer-box-border univer-cursor-pointer univer-rounded univer-px-2 univer-py-1 univer-text-gray-900 univer-transition-colors dark:!univer-text-white", {
3020
- "univer-bg-gray-200 dark:!univer-bg-gray-600": p === N
3153
+ "univer-bg-gray-200 dark:!univer-bg-gray-600": p === O
3021
3154
  }),
3022
- onMouseEnter: () => b(N),
3155
+ onMouseEnter: () => b(O),
3023
3156
  onMouseLeave: y,
3024
3157
  onMouseMove: F,
3025
3158
  onClick: () => {
3026
- f(O.name, O.functionType), s && s.focus();
3159
+ f(N.name, N.functionType), s && s.focus();
3027
3160
  },
3028
3161
  children: [
3029
- /* @__PURE__ */ W("span", { className: "univer-text-xs", children: [
3030
- /* @__PURE__ */ M("span", { className: "univer-text-red-500", children: O.name.substring(0, h.length) }),
3031
- /* @__PURE__ */ M("span", { children: O.name.slice(h.length) })
3162
+ /* @__PURE__ */ W("span", { className: "univer-block univer-overflow-x-hidden univer-text-ellipsis univer-text-xs", children: [
3163
+ /* @__PURE__ */ M("span", { className: "univer-text-red-500", children: N.name.substring(0, h.length) }),
3164
+ /* @__PURE__ */ M("span", { children: N.name.slice(h.length) })
3032
3165
  ] }),
3033
3166
  /* @__PURE__ */ M(
3034
3167
  "span",
3035
3168
  {
3036
3169
  className: "univer-block univer-text-xs univer-text-gray-400",
3037
- children: O.desc
3170
+ children: N.desc
3038
3171
  }
3039
3172
  )
3040
3173
  ]
3041
3174
  },
3042
- O.name
3175
+ N.name
3043
3176
  ))
3044
3177
  }
3045
3178
  ) });
3046
3179
  }
3047
- const _c = (e) => e.startsWith(hr.EQUALS) ? e.slice(1) : "", Jn = () => {
3048
- }, Rc = we((e, t) => {
3049
- var bn, yn, Tn, On;
3180
+ const vc = (e) => e.startsWith(dr.EQUALS) ? e.slice(1) : "", Qn = () => {
3181
+ }, Cc = Le((e, t) => {
3182
+ var En, bn, yn, Tn;
3050
3183
  const {
3051
3184
  errorText: n,
3052
3185
  initValue: o,
@@ -3054,52 +3187,52 @@ const _c = (e) => e.startsWith(hr.EQUALS) ? e.slice(1) : "", Jn = () => {
3054
3187
  subUnitId: s,
3055
3188
  isFocus: i = !0,
3056
3189
  isSupportAcrossSheet: c = !1,
3057
- onFocus: l = Jn,
3058
- onBlur: g = Jn,
3190
+ onFocus: l = Qn,
3191
+ onBlur: g = Qn,
3059
3192
  onChange: m,
3060
3193
  onVerify: h,
3061
3194
  className: d,
3062
3195
  editorId: u,
3063
3196
  moveCursor: a = !0,
3064
- onFormulaSelectingChange: S,
3197
+ onFormulaSelectingChange: v,
3065
3198
  keyboardEventConfig: p,
3066
- onMoveInEditor: v,
3199
+ onMoveInEditor: S,
3067
3200
  resetSelectionOnBlur: C = !0,
3068
3201
  autoScrollbar: _ = !0,
3069
- isSingle: I = !0,
3202
+ isSingle: E = !0,
3070
3203
  disableSelectionOnClick: f = !1,
3071
3204
  autofocus: b = !0,
3072
3205
  disableContextMenu: y,
3073
3206
  style: A
3074
- } = e, F = T(Ge), O = z(null), N = te(m);
3075
- Rs(t, () => ({
3076
- isClickOutSide: (Z) => O.current ? !O.current.contains(Z.target) : !1
3207
+ } = e, F = T(Ye), N = z(null), O = te(m);
3208
+ _s(t, () => ({
3209
+ isClickOutSide: (Z) => N.current ? !N.current.contains(Z.target) : !1
3077
3210
  }));
3078
- const k = te(S), E = z(null), x = z(void 0), R = x.current, [w, D] = V(i), U = z(null), B = ie(() => u != null ? u : io(`${Mo}-${qt(4)}`), []), ce = ie(() => n !== void 0, [n]), ae = T(ne), he = ae.getUnit(B);
3211
+ const k = te(v), I = z(null), x = z(void 0), R = x.current, [w, D] = V(i), U = z(null), B = ie(() => u != null ? u : so(`${xo}-${qt(4)}`), []), ce = ie(() => n !== void 0, [n]), ae = T(ne), he = ae.getUnit(B);
3079
3212
  Se(he == null ? void 0 : he.change$);
3080
- const K = nc(), J = co.transform.getPlainText((yn = (bn = he == null ? void 0 : he.getBody()) == null ? void 0 : bn.dataStream) != null ? yn : ""), rt = nt(J), ot = ie(() => _c(J), [J]), Tt = ie(() => K(ot), [ot, K]), { isSelecting: Ee, isSelectingRef: Y } = tc({ unitId: r, subUnitId: s, editorId: B, isFocus: w, disableOnClick: f }), X = z(""), fe = T(Me).getRenderById(B), ee = fe == null ? void 0 : fe.with(pr), le = ee == null ? void 0 : ee.isFocusing, be = ie(() => ae.getCurrentTypeOfUnit$(H.UNIVER_DOC), [ae]), Pe = Se(be), ke = (Pe == null ? void 0 : Pe.getUnitId()) === B, G = z([]), ge = Ee, Ue = (On = (Tn = T(sr).getConfig(Tr)) == null ? void 0 : Tn.functionScreenTips) != null ? On : !0;
3213
+ const K = ec(), J = io.transform.getPlainText((bn = (En = he == null ? void 0 : he.getBody()) == null ? void 0 : En.dataStream) != null ? bn : ""), nt = tt(J), rt = ie(() => vc(J), [J]), yt = ie(() => K(rt), [rt, K]), { isSelecting: Re, isSelectingRef: Y } = Ji({ unitId: r, subUnitId: s, editorId: B, isFocus: w, disableOnClick: f }), X = z(""), fe = T(xe).getRenderById(B), ee = fe == null ? void 0 : fe.with(mr), le = ee == null ? void 0 : ee.isFocusing, Ee = ie(() => ae.getCurrentTypeOfUnit$(H.UNIVER_DOC), [ae]), $e = Se(Ee), Me = ($e == null ? void 0 : $e.getUnitId()) === B, G = z([]), ge = Re, Pe = (Tn = (yn = T(or).getConfig(yr)) == null ? void 0 : yn.functionScreenTips) != null ? Tn : !0;
3081
3214
  Ss(() => {
3082
- N(J);
3083
- }, [J, N]);
3084
- const Ve = Wr("="), We = oc(r, s), oe = te((Z, se = !0, Ae, Te) => {
3215
+ O(J);
3216
+ }, [J, O]);
3217
+ const Ue = Vr("="), Ve = nc(r, s), oe = te((Z, se = !0, we, ye) => {
3085
3218
  if (!x.current) return;
3086
3219
  X.current = Z;
3087
- const xt = Z[0] === "=" ? Z.slice(1) : "", Fe = K(xt), qr = Fe.reduce((He, wt) => typeof wt == "object" ? `${He}${wt.token}` : `${He}${wt}`, ""), Mt = Ve(
3220
+ const Ot = Z[0] === "=" ? Z.slice(1) : "", ke = K(Ot), qr = ke.reduce((We, Mt) => typeof Mt == "object" ? `${We}${Mt.token}` : `${We}${Mt}`, ""), xt = Ue(
3088
3221
  x.current,
3089
- qr === xt ? Fe : [],
3222
+ qr === Ot ? ke : [],
3090
3223
  se,
3091
- Te
3224
+ ye
3092
3225
  );
3093
- if (G.current = Mt, Ae) {
3094
- const He = Te != null ? Te : R == null ? void 0 : R.getSelectionRanges();
3095
- if ((He == null ? void 0 : He.length) !== 1)
3226
+ if (G.current = xt, we) {
3227
+ const We = ye != null ? ye : R == null ? void 0 : R.getSelectionRanges();
3228
+ if ((We == null ? void 0 : We.length) !== 1)
3096
3229
  return;
3097
- const Kr = He[0].startOffset - 1, Yr = Rn(Fe, Kr, !1), Nn = Pr(Fe, Yr);
3230
+ const jr = We[0].startOffset - 1, Kr = _n(ke, jr, !1), Nn = $r(ke, Kr);
3098
3231
  if (Nn >= 0) {
3099
- const xn = Mt.splice(Nn, 1)[0];
3100
- xn && Mt.push(xn);
3232
+ const On = xt.splice(Nn, 1)[0];
3233
+ On && xt.push(On);
3101
3234
  }
3102
- We(w ? Mt : [], x.current);
3235
+ Ve(w ? xt : [], x.current);
3103
3236
  }
3104
3237
  });
3105
3238
  $(() => {
@@ -3109,12 +3242,12 @@ const _c = (e) => e.startsWith(hr.EQUALS) ? e.slice(1) : "", Jn = () => {
3109
3242
  if (X.current === J) return;
3110
3243
  oe(J, !1, !0);
3111
3244
  }
3112
- }, [J]), mc(w, h, J);
3113
- const ye = Ji(R), Ot = lc(w, r, s);
3245
+ }, [J]), fc(w, h, J);
3246
+ const be = Xi(R), Tt = cc(w, r, s);
3114
3247
  $(() => {
3115
3248
  var Z;
3116
- k(Ee, (Z = ee == null ? void 0 : ee.isFocusing) != null ? Z : !0);
3117
- }, [k, Ee]), Qo(w, p, R), $t(() => {
3249
+ k(Re, (Z = ee == null ? void 0 : ee.isFocusing) != null ? Z : !0);
3250
+ }, [k, Re]), Xo(w, p, R), Lt(() => {
3118
3251
  let Z;
3119
3252
  if (U.current) {
3120
3253
  Z = F.register({
@@ -3139,22 +3272,22 @@ const _c = (e) => e.startsWith(hr.EQUALS) ? e.slice(1) : "", Jn = () => {
3139
3272
  return () => {
3140
3273
  Z == null || Z.dispose();
3141
3274
  };
3142
- }, []), $t(() => {
3143
- i ? (D(i), ye()) : (C && (R == null || R.blur(), Ot()), D(i));
3144
- }, [i, R, ye, Ot, C]);
3145
- const { checkScrollBar: Nt } = Jo(R, I, _);
3146
- ac(w, !!(Ee && ke), r, B, y), cc(!!(w && le && a), ge, R, v);
3147
- const En = te((Z, se, Ae) => {
3275
+ }, []), Lt(() => {
3276
+ i ? (D(i), be()) : (C && (R == null || R.blur(), Tt()), D(i));
3277
+ }, [i, R, be, Tt, C]);
3278
+ const { checkScrollBar: Nt } = Qo(R, E, _);
3279
+ ic(w, !!(Re && Me), r, B, y), sc(!!(w && le && a), ge, R, S);
3280
+ const Rn = te((Z, se, we) => {
3148
3281
  if (!le)
3149
3282
  return;
3150
- const Te = se !== -1 ? [{ startOffset: se + 1, endOffset: se + 1, collapsed: !0 }] : void 0;
3151
- oe(`=${Z}`, !0, Ae, Te), Ae && (ye(), se !== -1 && setTimeout(() => {
3152
- const xt = { startOffset: se + 1, endOffset: se + 1 }, Fe = R == null ? void 0 : R.render.with(es);
3153
- Fe == null || Fe.scrollToRange({ ...xt, collapsed: !0 });
3283
+ const ye = se !== -1 ? [{ startOffset: se + 1, endOffset: se + 1, collapsed: !0 }] : void 0;
3284
+ oe(`=${Z}`, !0, we, ye), we && (be(), se !== -1 && setTimeout(() => {
3285
+ const Ot = { startOffset: se + 1, endOffset: se + 1 }, ke = R == null ? void 0 : R.render.with(Jo);
3286
+ ke == null || ke.scrollToRange({ ...Ot, collapsed: !0 });
3154
3287
  }, 50), Nt());
3155
3288
  });
3156
- fc(
3157
- w && !!(Ee && ke),
3289
+ dc(
3290
+ w && !!(Re && Me),
3158
3291
  w,
3159
3292
  Y,
3160
3293
  r,
@@ -3163,32 +3296,32 @@ const _c = (e) => e.startsWith(hr.EQUALS) ? e.slice(1) : "", Jn = () => {
3163
3296
  c,
3164
3297
  !!ge,
3165
3298
  R,
3166
- En
3167
- ), gc(w && !!(Ee && ke), r, c, D, g, () => {
3168
- oe(rt.current, !1, !0);
3299
+ Rn
3300
+ ), hc(w && !!(Re && Me), r, c, D, g, () => {
3301
+ oe(nt.current, !1, !0);
3169
3302
  });
3170
3303
  const In = (Z) => {
3171
3304
  if (Z) {
3172
3305
  const se = R == null ? void 0 : R.getSelectionRanges();
3173
3306
  if (se && se.length === 1) {
3174
- const Ae = se[0];
3175
- if (Ae.collapsed) {
3176
- const Te = Z.offset;
3307
+ const we = se[0];
3308
+ if (we.collapsed) {
3309
+ const ye = Z.offset;
3177
3310
  setTimeout(() => {
3178
- R == null || R.setSelectionRanges([{ startOffset: Ae.startOffset - Te, endOffset: Ae.endOffset - Te }]);
3311
+ R == null || R.setSelectionRanges([{ startOffset: we.startOffset - ye, endOffset: we.endOffset - ye }]);
3179
3312
  }, 30);
3180
3313
  }
3181
3314
  }
3182
- ye(), oe(`=${Z.text}`);
3315
+ be(), oe(`=${Z.text}`);
3183
3316
  }
3184
- }, jr = () => {
3185
- D(!0), l(), ye();
3317
+ }, Br = () => {
3318
+ D(!0), l(), be();
3186
3319
  };
3187
3320
  return /* @__PURE__ */ W("div", { className: d, children: [
3188
3321
  /* @__PURE__ */ M(
3189
3322
  "div",
3190
3323
  {
3191
- ref: O,
3324
+ ref: N,
3192
3325
  className: re("univer-relative univer-box-border univer-flex univer-h-full univer-w-full univer-items-center univer-justify-around univer-gap-2 univer-rounded-none univer-p-0 univer-ring-1", {
3193
3326
  "univer-ring-primary-500": w,
3194
3327
  "univer-ring-red-500": ce
@@ -3198,35 +3331,35 @@ const _c = (e) => e.startsWith(hr.EQUALS) ? e.slice(1) : "", Jn = () => {
3198
3331
  {
3199
3332
  ref: U,
3200
3333
  className: "univer-relative univer-h-full univer-w-full",
3201
- onMouseUp: jr
3334
+ onMouseUp: Br
3202
3335
  }
3203
3336
  )
3204
3337
  }
3205
3338
  ),
3206
3339
  n !== void 0 && /* @__PURE__ */ M("div", { className: "univer-my-1 univer-text-xs univer-text-red-500", children: n }),
3207
- Ue && R && ot !== "" && /* @__PURE__ */ M(
3208
- Qi,
3340
+ Pe && R && rt !== "" && /* @__PURE__ */ M(
3341
+ zi,
3209
3342
  {
3210
3343
  editor: R,
3211
3344
  isFocus: w,
3212
3345
  formulaText: J,
3213
- onClose: () => ye()
3346
+ onClose: () => be()
3214
3347
  }
3215
3348
  ),
3216
- Ue && !!R && /* @__PURE__ */ M(
3217
- Sc,
3349
+ Pe && !!R && /* @__PURE__ */ M(
3350
+ pc,
3218
3351
  {
3219
3352
  isFocus: w,
3220
- sequenceNodes: Tt,
3353
+ sequenceNodes: yt,
3221
3354
  onSelect: In,
3222
- ref: E,
3355
+ ref: I,
3223
3356
  editor: R
3224
3357
  }
3225
3358
  )
3226
3359
  ] });
3227
3360
  });
3228
- function Ec(e, t, n, o) {
3229
- const r = T(Re), s = Wr(""), i = Se(e == null ? void 0 : e.getDocumentDataModel().change$), [c, l] = V([]), g = T(wo), m = z(""), h = T(ne);
3361
+ function _c(e, t, n, o) {
3362
+ const r = T(_e), s = Vr(""), i = Se(e == null ? void 0 : e.getDocumentDataModel().change$), [c, l] = V([]), g = T(Mo), m = z(""), h = T(ne);
3230
3363
  return $(() => {
3231
3364
  if (!e) return;
3232
3365
  const d = e.getDocumentDataModel().getPlainText();
@@ -3236,7 +3369,7 @@ function Ec(e, t, n, o) {
3236
3369
  const u = r.sequenceNodesBuilder(d);
3237
3370
  l(u != null ? u : []);
3238
3371
  }, [i, e, r]), $(() => {
3239
- var a, S;
3372
+ var a, v;
3240
3373
  if (!e) return;
3241
3374
  if (!t) {
3242
3375
  const p = e.getDocumentData();
@@ -3244,7 +3377,7 @@ function Ec(e, t, n, o) {
3244
3377
  ...p,
3245
3378
  body: {
3246
3379
  ...p.body,
3247
- dataStream: (S = (a = p.body) == null ? void 0 : a.dataStream) != null ? S : "",
3380
+ dataStream: (v = (a = p.body) == null ? void 0 : a.dataStream) != null ? v : "",
3248
3381
  textRuns: []
3249
3382
  }
3250
3383
  });
@@ -3252,14 +3385,14 @@ function Ec(e, t, n, o) {
3252
3385
  }
3253
3386
  const d = s(e, c, !1), u = new qe();
3254
3387
  return d.forEach((p) => {
3255
- const v = ft(p.token), C = h.getCurrentUnitForType(H.UNIVER_SHEET), _ = C == null ? void 0 : C.getActiveSheet();
3256
- if (!v.sheetName && o !== (_ == null ? void 0 : _.getSheetId()) || v.sheetName && (_ == null ? void 0 : _.getName()) !== v.sheetName)
3388
+ const S = ht(p.token), C = h.getCurrentUnitForType(H.UNIVER_SHEET), _ = C == null ? void 0 : C.getActiveSheet();
3389
+ if (!S.sheetName && o !== (_ == null ? void 0 : _.getSheetId()) || S.sheetName && (_ == null ? void 0 : _.getName()) !== S.sheetName)
3257
3390
  return;
3258
- const I = new dn(p.themeColor).toRgb(), f = g.addShape({
3259
- range: v.range,
3391
+ const E = new un(p.themeColor).toRgb(), f = g.addShape({
3392
+ range: S.range,
3260
3393
  style: {
3261
3394
  stroke: p.themeColor,
3262
- fill: `rgba(${I.r}, ${I.g}, ${I.b}, 0.1)`,
3395
+ fill: `rgba(${E.r}, ${E.g}, ${E.b}, 0.1)`,
3263
3396
  strokeDash: 12
3264
3397
  },
3265
3398
  primary: null
@@ -3270,16 +3403,16 @@ function Ec(e, t, n, o) {
3270
3403
  };
3271
3404
  }, [e, t, s, g, c]), { sequenceNodes: c };
3272
3405
  }
3273
- function Ic(e) {
3274
- const t = T(gn), { supportAcrossSheet: n = !1, keepSheetReference: o = !1, unitId: r, subUnitId: s, onChange: i } = e, l = T(ne).getUnit(r, H.UNIVER_SHEET), g = te(i), m = te((h, d) => {
3406
+ function Rc(e) {
3407
+ const t = T(fn), { supportAcrossSheet: n = !1, keepSheetReference: o = !1, unitId: r, subUnitId: s, onChange: i } = e, l = T(ne).getUnit(r, H.UNIVER_SHEET), g = te(i), m = te((h, d) => {
3275
3408
  const u = l == null ? void 0 : l.getActiveSheet();
3276
3409
  if (!u || !n && u.getSheetId() !== s || !(h != null && h.length)) return;
3277
- const a = o ? u.getName() : u.getSheetId() === s ? "" : u.getName(), S = h.map((p) => ({
3410
+ const a = o ? u.getName() : u.getSheetId() === s ? "" : u.getName(), v = h.map((p) => ({
3278
3411
  range: p.range,
3279
3412
  unitId: r,
3280
3413
  sheetName: a
3281
3414
  }));
3282
- g(S, d);
3415
+ g(v, d);
3283
3416
  });
3284
3417
  $(() => {
3285
3418
  const h = new qe();
@@ -3294,14 +3427,14 @@ function Ic(e) {
3294
3427
  };
3295
3428
  }, [m, t.selectionMoveEnd$, t.selectionMoveStart$, t.selectionMoving$]);
3296
3429
  }
3297
- const er = (e) => !e.some((n) => {
3430
+ const Jn = (e) => !e.some((n) => {
3298
3431
  if (typeof n == "string") {
3299
- if (n !== Ke.COMMA)
3432
+ if (n !== je.COMMA)
3300
3433
  return !0;
3301
3434
  } else if (n.nodeType !== Q.REFERENCE)
3302
3435
  return !0;
3303
3436
  return !1;
3304
- }), bc = (e) => {
3437
+ }), Ic = (e) => {
3305
3438
  if (e.endColumn < e.startColumn) {
3306
3439
  const t = e.endColumn;
3307
3440
  e.endColumn = e.startColumn, e.startColumn = t;
@@ -3312,7 +3445,7 @@ const er = (e) => !e.some((n) => {
3312
3445
  }
3313
3446
  return e;
3314
3447
  };
3315
- function yc(e) {
3448
+ function Ec(e) {
3316
3449
  const {
3317
3450
  visible: t,
3318
3451
  initialValue: n,
@@ -3324,10 +3457,10 @@ function yc(e) {
3324
3457
  onConfirm: l,
3325
3458
  onClose: g,
3326
3459
  onShowBySelection: m
3327
- } = e, h = T(ht), d = T(Re), [u, a] = V([]), [S, p] = V(0), v = z(null);
3460
+ } = e, h = T(dt), d = T(_e), [u, a] = V([]), [v, p] = V(0), S = z(null);
3328
3461
  $(() => {
3329
3462
  if (t && n.length) {
3330
- const f = n.map((b) => b.sheetName ? _t(b.sheetName, b.range) : _e(b.range));
3463
+ const f = n.map((b) => b.sheetName ? Ct(b.sheetName, b.range) : Ce(b.range));
3331
3464
  a(f), p(f.length - 1);
3332
3465
  } else
3333
3466
  a([""]), p(0);
@@ -3337,10 +3470,10 @@ function yc(e) {
3337
3470
  y[f] = b, a(y);
3338
3471
  }, _ = () => {
3339
3472
  a([...u, ""]), p(u.length);
3340
- }, I = (f) => {
3473
+ }, E = (f) => {
3341
3474
  u.splice(f, 1), a([...u]);
3342
3475
  };
3343
- return Ic({
3476
+ return Rc({
3344
3477
  unitId: o,
3345
3478
  subUnitId: r,
3346
3479
  supportAcrossSheet: i,
@@ -3348,24 +3481,24 @@ function yc(e) {
3348
3481
  onChange: (f, b) => {
3349
3482
  if (!t && m != null && m(f))
3350
3483
  return;
3351
- const y = new Set(u), A = f.map((N) => N.sheetName ? _t(N.sheetName, N.range) : _e(N.range)), F = A.filter((N) => !y.has(N));
3484
+ const y = new Set(u), A = f.map((O) => O.sheetName ? Ct(O.sheetName, O.range) : Ce(O.range)), F = A.filter((O) => !y.has(O));
3352
3485
  if (!F.length) return;
3353
- const O = [...u];
3486
+ const N = [...u];
3354
3487
  if (A.length > 1) {
3355
- b || O.splice(S, 1), O.push(...F);
3356
- const N = O.slice(0, s);
3357
- a(N), p(N.length - 1), requestAnimationFrame(() => {
3488
+ b || N.splice(v, 1), N.push(...F);
3489
+ const O = N.slice(0, s);
3490
+ a(O), p(O.length - 1), requestAnimationFrame(() => {
3358
3491
  var k;
3359
- (k = v.current) == null || k.scrollTo({ top: v.current.scrollHeight });
3492
+ (k = S.current) == null || k.scrollTo({ top: S.current.scrollHeight });
3360
3493
  });
3361
3494
  } else {
3362
- O.splice(S, 1, ...F);
3363
- const N = O.slice(0, s);
3364
- a(N), p(S + F.length - 1);
3495
+ N.splice(v, 1, ...F);
3496
+ const O = N.slice(0, s);
3497
+ a(O), p(v + F.length - 1);
3365
3498
  }
3366
3499
  }
3367
3500
  }), /* @__PURE__ */ M(
3368
- Ts,
3501
+ ys,
3369
3502
  {
3370
3503
  width: "328px",
3371
3504
  open: t,
@@ -3374,9 +3507,9 @@ function yc(e) {
3374
3507
  mask: !1,
3375
3508
  maskClosable: !1,
3376
3509
  footer: /* @__PURE__ */ W("footer", { className: "univer-flex univer-gap-2", children: [
3377
- /* @__PURE__ */ M(at, { onClick: g, children: h.t("rangeSelector.cancel") }),
3510
+ /* @__PURE__ */ M(ct, { onClick: g, children: h.t("rangeSelector.cancel") }),
3378
3511
  /* @__PURE__ */ M(
3379
- at,
3512
+ ct,
3380
3513
  {
3381
3514
  variant: "primary",
3382
3515
  onClick: () => {
@@ -3384,7 +3517,7 @@ function yc(e) {
3384
3517
  u.filter((f) => {
3385
3518
  const b = d.sequenceNodesBuilder(f);
3386
3519
  return b && b.length === 1 && typeof b[0] != "string" && b[0].nodeType === Q.REFERENCE;
3387
- }).map((f) => ft(f)).map((f) => ({ ...f, range: bc(f.range) }))
3520
+ }).map((f) => ht(f)).map((f) => ({ ...f, range: Ic(f.range) }))
3388
3521
  );
3389
3522
  },
3390
3523
  children: h.t("rangeSelector.confirm")
@@ -3395,8 +3528,8 @@ function yc(e) {
3395
3528
  children: /* @__PURE__ */ W(
3396
3529
  "div",
3397
3530
  {
3398
- ref: v,
3399
- className: re("-univer-mx-6 univer-max-h-60 univer-overflow-y-auto univer-px-6", ut),
3531
+ ref: S,
3532
+ className: re("-univer-mx-6 univer-max-h-60 univer-overflow-y-auto univer-px-6", lt),
3400
3533
  children: [
3401
3534
  u.map((f, b) => /* @__PURE__ */ W(
3402
3535
  "div",
@@ -3404,10 +3537,10 @@ function yc(e) {
3404
3537
  className: "univer-mb-2 univer-flex univer-items-center univer-gap-4",
3405
3538
  children: [
3406
3539
  /* @__PURE__ */ M(
3407
- Rr,
3540
+ _r,
3408
3541
  {
3409
3542
  className: re("univer-w-full", {
3410
- "univer-border-primary-600": S === b
3543
+ "univer-border-primary-600": v === b
3411
3544
  }),
3412
3545
  placeholder: h.t("rangeSelector.placeHolder"),
3413
3546
  onFocus: () => p(b),
@@ -3416,18 +3549,18 @@ function yc(e) {
3416
3549
  }
3417
3550
  ),
3418
3551
  u.length > 1 && /* @__PURE__ */ M(
3419
- Ar,
3552
+ kr,
3420
3553
  {
3421
3554
  className: "univer-cursor-pointer",
3422
- onClick: () => I(b)
3555
+ onClick: () => E(b)
3423
3556
  }
3424
3557
  )
3425
3558
  ]
3426
3559
  },
3427
3560
  b
3428
3561
  )),
3429
- u.length < s && /* @__PURE__ */ M("div", { children: /* @__PURE__ */ W(at, { variant: "link", onClick: _, children: [
3430
- /* @__PURE__ */ M(Fr, {}),
3562
+ u.length < s && /* @__PURE__ */ M("div", { children: /* @__PURE__ */ W(ct, { variant: "link", onClick: _, children: [
3563
+ /* @__PURE__ */ M(Ar, {}),
3431
3564
  /* @__PURE__ */ M("span", { children: h.t("rangeSelector.addAnotherRange") })
3432
3565
  ] }) })
3433
3566
  ]
@@ -3436,13 +3569,13 @@ function yc(e) {
3436
3569
  }
3437
3570
  );
3438
3571
  }
3439
- function Tc(e) {
3440
- return e.split(Ke.COMMA).filter((t) => !!t).map((t) => ft(t));
3572
+ function bc(e) {
3573
+ return e.split(je.COMMA).filter((t) => !!t).map((t) => ht(t));
3441
3574
  }
3442
- function Oc(e) {
3443
- return e.map((t) => t.sheetName ? _t(t.sheetName, t.range) : _e(t.range)).join(Ke.COMMA);
3575
+ function yc(e) {
3576
+ return e.map((t) => t.sheetName ? Ct(t.sheetName, t.range) : Ce(t.range)).join(je.COMMA);
3444
3577
  }
3445
- function Hr(e) {
3578
+ function Wr(e) {
3446
3579
  const [t, n] = V(null), {
3447
3580
  onVerify: o,
3448
3581
  selectorRef: r,
@@ -3456,14 +3589,14 @@ function Hr(e) {
3456
3589
  onRangeSelectorDialogVisibleChange: d,
3457
3590
  onClickOutside: u,
3458
3591
  onFocusChange: a,
3459
- forceShowDialogWhenSelectionChanged: S,
3592
+ forceShowDialogWhenSelectionChanged: v,
3460
3593
  hideEditor: p,
3461
- resetRange: v
3462
- } = e, [C, _] = V(m != null ? m : !1), [I, f] = V(!1), [b, y] = V([]), A = T(ht), F = T(Ge), { sequenceNodes: O } = Ec(t, C, s, i), N = nt(O), k = T(pe), E = te(() => {
3594
+ resetRange: S
3595
+ } = e, [C, _] = V(m != null ? m : !1), [E, f] = V(!1), [b, y] = V([]), A = T(dt), F = T(Ye), { sequenceNodes: N } = _c(t, C, s, i), O = tt(N), k = T(me), I = te(() => {
3463
3596
  t == null || t.setSelectionRanges([]), t == null || t.blur(), F.blur();
3464
3597
  }), x = te(() => {
3465
3598
  var R;
3466
- E(), y(Tc((R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "")), f(!0);
3599
+ I(), y(bc((R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "")), f(!0);
3467
3600
  });
3468
3601
  return $(() => {
3469
3602
  r && (r.current = {
@@ -3473,10 +3606,10 @@ function Hr(e) {
3473
3606
  focus() {
3474
3607
  F.focus(t.getEditorId());
3475
3608
  },
3476
- blur: E,
3477
- verify: () => er(N.current),
3609
+ blur: I,
3610
+ verify: () => Jn(O.current),
3478
3611
  showDialog: (R) => {
3479
- E(), y(R), f(!0);
3612
+ I(), y(R), f(!0);
3480
3613
  },
3481
3614
  hideDialog: () => {
3482
3615
  y([]), f(!1);
@@ -3486,24 +3619,24 @@ function Hr(e) {
3486
3619
  return (R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "";
3487
3620
  }
3488
3621
  });
3489
- }, [E, t, F, r, N]), $(() => {
3622
+ }, [I, t, F, r, O]), $(() => {
3490
3623
  var R;
3491
- o == null || o(er(O), (R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "");
3492
- }, [O]), $(() => {
3493
- d == null || d(I);
3494
- }, [I]), $(() => {
3495
- if (I && v)
3624
+ o == null || o(Jn(N), (R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "");
3625
+ }, [N]), $(() => {
3626
+ d == null || d(E);
3627
+ }, [E]), $(() => {
3628
+ if (E && S)
3496
3629
  return () => {
3497
3630
  const R = {
3498
3631
  unitId: s,
3499
3632
  subUnitId: i,
3500
- selections: v
3633
+ selections: S
3501
3634
  };
3502
- k.executeCommand(mn.id, R);
3635
+ k.executeCommand(gn.id, R);
3503
3636
  };
3504
- }, [I]), /* @__PURE__ */ W(_s, { children: [
3637
+ }, [E]), /* @__PURE__ */ W(Cs, { children: [
3505
3638
  p ? null : /* @__PURE__ */ M(
3506
- ts,
3639
+ es,
3507
3640
  {
3508
3641
  isSingle: !0,
3509
3642
  ...e,
@@ -3512,10 +3645,10 @@ function Hr(e) {
3512
3645
  },
3513
3646
  editorRef: n,
3514
3647
  onClickOutside: () => {
3515
- _(!1), E(), u == null || u();
3648
+ _(!1), I(), u == null || u();
3516
3649
  },
3517
- icon: /* @__PURE__ */ M(ys, { title: A.t("rangeSelector.buttonTooltip"), placement: "bottom", children: /* @__PURE__ */ M(
3518
- Lr,
3650
+ icon: /* @__PURE__ */ M(bs, { title: A.t("rangeSelector.buttonTooltip"), placement: "bottom", children: /* @__PURE__ */ M(
3651
+ Dr,
3519
3652
  {
3520
3653
  className: "univer-cursor-pointer dark:!univer-text-gray-300",
3521
3654
  onClick: x
@@ -3524,17 +3657,17 @@ function Hr(e) {
3524
3657
  }
3525
3658
  ),
3526
3659
  /* @__PURE__ */ M(
3527
- yc,
3660
+ Ec,
3528
3661
  {
3529
3662
  initialValue: b,
3530
3663
  unitId: s,
3531
3664
  subUnitId: i,
3532
- visible: I,
3665
+ visible: E,
3533
3666
  maxRangeCount: c,
3534
3667
  onConfirm: (R) => {
3535
- const w = Oc(R), D = ao.newEmptyData();
3668
+ const w = yc(R), D = co.newEmptyData();
3536
3669
  D.body.dataStream = w, t == null || t.replaceText(w, !1), h == null || h(D, w), f(!1), y([]), requestAnimationFrame(() => {
3537
- E();
3670
+ I();
3538
3671
  });
3539
3672
  },
3540
3673
  onClose: () => {
@@ -3542,14 +3675,14 @@ function Hr(e) {
3542
3675
  },
3543
3676
  supportAcrossSheet: l,
3544
3677
  keepSheetReference: g,
3545
- onShowBySelection: (R) => C || S ? (y(R), f(!0), !1) : !0
3678
+ onShowBySelection: (R) => C || v ? (y(R), f(!0), !1) : !0
3546
3679
  }
3547
3680
  )
3548
3681
  ] });
3549
3682
  }
3550
- const Nc = () => {
3683
+ const Tc = () => {
3551
3684
  var o, r;
3552
- const e = T($r), t = Se(e.currentSelector$), n = z(null);
3685
+ const e = T(Lr), t = Se(e.currentSelector$), n = z(null);
3553
3686
  return $(() => {
3554
3687
  var s, i;
3555
3688
  if (t)
@@ -3558,7 +3691,7 @@ const Nc = () => {
3558
3691
  (c = n.current) == null || c.hideDialog();
3559
3692
  };
3560
3693
  }, [t]), /* @__PURE__ */ M(
3561
- Hr,
3694
+ Wr,
3562
3695
  {
3563
3696
  unitId: (o = t == null ? void 0 : t.unitId) != null ? o : "",
3564
3697
  subUnitId: (r = t == null ? void 0 : t.subUnitId) != null ? r : "",
@@ -3566,86 +3699,86 @@ const Nc = () => {
3566
3699
  selectorRef: n,
3567
3700
  onChange: (s, i) => {
3568
3701
  var c;
3569
- t == null || t.callback((c = i == null ? void 0 : i.split(",").map((l) => ft(l))) != null ? c : []);
3702
+ t == null || t.callback((c = i == null ? void 0 : i.split(",").map((l) => ht(l))) != null ? c : []);
3570
3703
  }
3571
3704
  }
3572
3705
  );
3573
3706
  };
3574
- var xc = Object.defineProperty, Mc = Object.getOwnPropertyDescriptor, wc = (e, t, n) => t in e ? xc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, kc = (e, t, n, o) => {
3575
- for (var r = o > 1 ? void 0 : o ? Mc(t, n) : t, s = e.length - 1, i; s >= 0; s--)
3707
+ var Nc = Object.defineProperty, Oc = Object.getOwnPropertyDescriptor, xc = (e, t, n) => t in e ? Nc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Mc = (e, t, n, o) => {
3708
+ for (var r = o > 1 ? void 0 : o ? Oc(t, n) : t, s = e.length - 1, i; s >= 0; s--)
3576
3709
  (i = e[s]) && (r = i(r) || r);
3577
3710
  return r;
3578
- }, Ft = (e, t) => (n, o) => t(n, o, e), Br = (e, t, n) => wc(e, typeof t != "symbol" ? t + "" : t, n);
3579
- let jt = class extends uo {
3580
- constructor(e = Zn, t, n, o, r) {
3711
+ }, At = (e, t) => (n, o) => t(n, o, e), Hr = (e, t, n) => xc(e, typeof t != "symbol" ? t + "" : t, n);
3712
+ let Bt = class extends lo {
3713
+ constructor(e = Gn, t, n, o, r) {
3581
3714
  super(), this._config = e, this._injector = t, this._renderManagerService = n, this._configService = o, this._uiPartsService = r;
3582
- const { menu: s, ...i } = ho(
3583
- Zn,
3715
+ const { menu: s, ...i } = uo(
3716
+ Gn,
3584
3717
  this._config
3585
3718
  );
3586
- s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(Tr, i, { merge: !0 });
3719
+ s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(yr, i, { merge: !0 });
3587
3720
  }
3588
3721
  onStarting() {
3589
- fo(this._injector, [
3590
- [zt, { useClass: on }],
3591
- [$r],
3592
- [Bt],
3722
+ ho(this._injector, [
3723
+ [Zt, { useClass: rn }],
3724
+ [Lr],
3725
+ [Ht],
3726
+ [Pt],
3593
3727
  [Ut],
3594
3728
  [Vt],
3595
3729
  [Wt],
3596
- [Ht],
3597
- [Pt]
3730
+ [$t]
3598
3731
  ]), this._initUIPart();
3599
3732
  }
3600
3733
  onReady() {
3601
3734
  [
3602
- [$e]
3735
+ [De]
3603
3736
  ].forEach((e) => {
3604
3737
  this.disposeWithMe(this._renderManagerService.registerRenderModule(H.UNIVER_SHEET, e));
3605
3738
  });
3606
3739
  }
3607
3740
  onRendered() {
3608
3741
  [
3609
- [sn]
3742
+ [on]
3610
3743
  ].forEach((e) => {
3611
3744
  this.disposeWithMe(this._renderManagerService.registerRenderModule(H.UNIVER_SHEET, e));
3612
- }), go(this._injector, [
3613
- [Bt],
3745
+ }), fo(this._injector, [
3746
+ [Ht],
3614
3747
  // FormulaProgressBar relies on TriggerCalculationController, but it is necessary to ensure that the formula calculation is done after rendered.
3615
- [Vt],
3616
- [Ht]
3748
+ [Ut],
3749
+ [Wt]
3617
3750
  ]);
3618
3751
  }
3619
3752
  onSteady() {
3620
- this._injector.get(Ut), this._injector.get(Pt);
3753
+ this._injector.get(Pt), this._injector.get($t);
3621
3754
  }
3622
3755
  _initUIPart() {
3623
- const e = this._injector.get(Cr);
3624
- this.disposeWithMe(e.register(ko, Hr)), this.disposeWithMe(e.register(Ao, Rc)), this.disposeWithMe(this._uiPartsService.registerComponent(Cs.GLOBAL, () => _r(Nc, this._injector)));
3756
+ const e = this._injector.get(vr);
3757
+ this.disposeWithMe(e.register(wo, Wr)), this.disposeWithMe(e.register(ko, Cc)), this.disposeWithMe(this._uiPartsService.registerComponent(vs.GLOBAL, () => Cr(Tc, this._injector)));
3625
3758
  }
3626
3759
  };
3627
- Br(jt, "pluginName", Ir);
3628
- Br(jt, "type", H.UNIVER_SHEET);
3629
- jt = kc([
3630
- lo(Bo, fs),
3631
- Ft(1, j(Et)),
3632
- Ft(2, Me),
3633
- Ft(3, sr),
3634
- Ft(4, Sr)
3635
- ], jt);
3760
+ Hr(Bt, "pluginName", Ir);
3761
+ Hr(Bt, "type", H.UNIVER_SHEET);
3762
+ Bt = Mc([
3763
+ ao(Ho, hs),
3764
+ At(1, q(Rt)),
3765
+ At(2, xe),
3766
+ At(3, or),
3767
+ At(4, Sr)
3768
+ ], Bt);
3636
3769
  export {
3637
- ws as FORMULA_PROMPT_ACTIVATED,
3638
- Rc as FormulaEditor,
3639
- Pt as FormulaReorderController,
3640
- $r as GlobalRangeSelectorService,
3641
- ks as HelpFunctionOperation,
3642
- ve as InsertFunctionOperation,
3643
- _n as MoreFunctionsOperation,
3644
- Hr as RangeSelector,
3645
- $e as RefSelectionsRenderService,
3646
- yr as ReferenceAbsoluteOperation,
3647
- Us as SearchFunctionOperation,
3648
- mt as SelectEditorFormulaOperation,
3649
- Cn as SheetOnlyPasteFormulaCommand,
3650
- jt as UniverSheetsFormulaUIPlugin
3770
+ Ms as FORMULA_PROMPT_ACTIVATED,
3771
+ Cc as FormulaEditor,
3772
+ $t as FormulaReorderController,
3773
+ Lr as GlobalRangeSelectorService,
3774
+ ws as HelpFunctionOperation,
3775
+ pe as InsertFunctionOperation,
3776
+ Cn as MoreFunctionsOperation,
3777
+ Wr as RangeSelector,
3778
+ De as RefSelectionsRenderService,
3779
+ br as ReferenceAbsoluteOperation,
3780
+ Ps as SearchFunctionOperation,
3781
+ gt as SelectEditorFormulaOperation,
3782
+ vn as SheetOnlyPasteFormulaCommand,
3783
+ Bt as UniverSheetsFormulaUIPlugin
3651
3784
  };