@univerjs/sheets-formula-ui 0.12.0 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/lib/cjs/index.js +5 -5
  2. package/lib/cjs/locale/ca-ES.js +2 -2
  3. package/lib/cjs/locale/en-US.js +2 -2
  4. package/lib/cjs/locale/es-ES.js +2 -2
  5. package/lib/cjs/locale/fa-IR.js +2 -2
  6. package/lib/cjs/locale/fr-FR.js +2 -2
  7. package/lib/cjs/locale/ja-JP.js +2 -2
  8. package/lib/cjs/locale/ko-KR.js +2 -2
  9. package/lib/cjs/locale/ru-RU.js +2 -2
  10. package/lib/cjs/locale/vi-VN.js +2 -2
  11. package/lib/cjs/locale/zh-CN.js +2 -2
  12. package/lib/cjs/locale/zh-TW.js +2 -2
  13. package/lib/es/index.js +829 -804
  14. package/lib/es/locale/ca-ES.js +9 -4
  15. package/lib/es/locale/en-US.js +9 -4
  16. package/lib/es/locale/es-ES.js +9 -4
  17. package/lib/es/locale/fa-IR.js +9 -4
  18. package/lib/es/locale/fr-FR.js +9 -4
  19. package/lib/es/locale/ja-JP.js +9 -4
  20. package/lib/es/locale/ko-KR.js +9 -4
  21. package/lib/es/locale/ru-RU.js +9 -4
  22. package/lib/es/locale/vi-VN.js +17 -12
  23. package/lib/es/locale/zh-CN.js +9 -4
  24. package/lib/es/locale/zh-TW.js +9 -4
  25. package/lib/index.js +829 -804
  26. package/lib/locale/ca-ES.js +9 -4
  27. package/lib/locale/en-US.js +9 -4
  28. package/lib/locale/es-ES.js +9 -4
  29. package/lib/locale/fa-IR.js +9 -4
  30. package/lib/locale/fr-FR.js +9 -4
  31. package/lib/locale/ja-JP.js +9 -4
  32. package/lib/locale/ko-KR.js +9 -4
  33. package/lib/locale/ru-RU.js +9 -4
  34. package/lib/locale/vi-VN.js +17 -12
  35. package/lib/locale/zh-CN.js +9 -4
  36. package/lib/locale/zh-TW.js +9 -4
  37. package/lib/types/controllers/image-formula-render.controller.d.ts +9 -0
  38. package/lib/types/locale/en-US.d.ts +24 -4
  39. package/lib/types/locale/function-list/lookup/en-US.d.ts +14 -2
  40. package/lib/types/locale/function-list/math/en-US.d.ts +10 -2
  41. package/lib/umd/index.js +5 -5
  42. package/lib/umd/locale/ca-ES.js +2 -2
  43. package/lib/umd/locale/en-US.js +2 -2
  44. package/lib/umd/locale/es-ES.js +2 -2
  45. package/lib/umd/locale/fa-IR.js +2 -2
  46. package/lib/umd/locale/fr-FR.js +2 -2
  47. package/lib/umd/locale/ja-JP.js +2 -2
  48. package/lib/umd/locale/ko-KR.js +2 -2
  49. package/lib/umd/locale/ru-RU.js +1 -1
  50. package/lib/umd/locale/vi-VN.js +2 -2
  51. package/lib/umd/locale/zh-CN.js +2 -2
  52. package/lib/umd/locale/zh-TW.js +2 -2
  53. package/package.json +12 -12
package/lib/es/index.js CHANGED
@@ -1,38 +1,38 @@
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 = {
1
+ var Zr = Object.defineProperty;
2
+ var zr = (e, t, n) => t in e ? Zr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var j = (e, t, n) => zr(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { CommandType as Oe, ICommandService as me, createIdentifier as Xr, IContextService as ln, IUniverInstanceService as ne, Rectangle as nr, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as un, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as rr, DEFAULT_EMPTY_DOCUMENT_VALUE as or, isRealNum as Qr, CellValueType as wn, getCellValueType as Jr, Inject as q, Disposable as Ke, ObjectMatrix as Fe, Range as eo, Tools as dn, LocaleService as dt, isICellData as to, isFormulaString as Ae, isFormulaId as lt, generateRandomId as Kt, Direction as de, Injector as Rt, UniverInstanceType as W, ThemeService as It, ILogService as no, toDisposable as sr, ColorKit as hn, RxDisposable as ro, InterceptorEffectEnum as oo, FOCUSING_DOC as so, FOCUSING_UNIVER_EDITOR as io, DisposableCollection as qe, RANGE_TYPE as ve, getBodySlice as kn, EDITOR_ACTIVATED as An, createInternalEditorID as co, BuildTextUtils as ao, IConfigService as ir, RichTextBuilder as lo, DependentOn as uo, Plugin as ho, merge as fo, registerDependencies as go, touchDependencies as mo } from "@univerjs/core";
5
+ import { SheetPasteCommand as po, PREDEFINED_HOOK_NAME as ct, IEditorBridgeService as fn, SetCellEditVisibleOperation as cr, HoverManagerService as So, CellAlertManagerService as vo, CellAlertType as Co, IAutoFillService as _o, APPLY_TYPE as Ro, DATA_TYPE as Fn, ISheetClipboardService as Io, COPY_TYPE as ar, SheetSkeletonManagerService as Et, attachSelectionWithCoord as rn, SelectionControl as lr, SELECTION_SHAPE_DEPTH as Eo, useActiveWorkbook as bo, getCurrentRangeDisable$ as Ye, PASTE_SPECIAL_MENU_ID as yo, whenFormulaEditorActivated as bt, whenSheetEditorFocused as To, SheetsUIPart as No, BaseSelectionRenderService as Oo, getCoordByOffset as Dn, checkInHeaderRanges as $n, getAllSelection as xo, genNormalSelectionStyle as ur, getSheetObject as Mo, MoveSelectionCommand as Ln, JumpOver as Pn, ExpandSelectionCommand as Un, EMBEDDING_FORMULA_EDITOR as wo, IMarkSelectionService as ko, RANGE_SELECTOR_COMPONENT_KEY as Ao, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as Fo } from "@univerjs/sheets-ui";
6
+ import { sequenceNodeType as Q, serializeRange as Ce, FormulaDataModel as yt, LexerTreeBuilder as _e, ErrorType as ue, extractFormulaError as dr, SetFormulaCalculationResultMutation as Do, SetArrayFormulaDataMutation as $o, SetFormulaCalculationStopMutation as Lo, FunctionType as hr, matchToken as je, deserializeRangeWithSheetWithCache as Po, matchRefDrawToken as Uo, isFormulaLexerToken as Vo, deserializeRangeWithSheet as ht, serializeRangeToRefString as Wo, serializeRangeWithSheet as Ct, serializeRangeWithSpreadsheet as Ho, generateStringWithSequence as Bo, operatorToken as fr, UniverFormulaEnginePlugin as qo } from "@univerjs/engine-formula";
7
+ import { Subject as mt, debounceTime as gn, combineLatestWith as jo, map as gr, switchMap as Ko, of as Vn, Observable as Yo, BehaviorSubject as mr, throttleTime as Go, filter as pr, distinctUntilChanged as Zo, merge as zo } from "rxjs";
8
+ import { IEditorService as Ge, DocSelectionRenderService as Sr, ReplaceTextRunsCommand as Wn, MoveSelectionOperation as Xo, MoveCursorOperation as Qo, useKeyboardEvent as Jo, useResize as es, DocBackScrollRenderController as ts, RichTextEditor as ns } from "@univerjs/docs-ui";
9
+ import { DeviceInputEventType as xe, IRenderManagerService as Re, ScrollTimerType as Qt, SHEET_VIEWPORT_KEY as Hn, Vector2 as Bn } from "@univerjs/engine-render";
10
+ import { SheetsSelectionsService as mn, getSheetCommandTarget as vr, getCellAtRowCol as rs, SetSelectionsOperation as pn, SheetInterceptorService as Sn, ReorderRangeCommand as os, SetRangeValuesMutation as Dt, SetRangeValuesUndoMutationFactory as ss, BEFORE_CELL_EDIT as is, SetWorksheetRowAutoHeightMutation as cs, INTERCEPTOR_POINT as as, WorksheetSetCellValuePermission as Ze, WorksheetEditPermission as ze, RangeProtectionPermissionEditPoint as Xe, WorkbookEditablePermission as Qe, IRefSelectionsService as Yt, SelectionMoveType as Jt, convertSelectionDataToRange as ls, setEndForRange as us, REF_SELECTIONS_ENABLED as qn, SetWorksheetActiveOperation as jn } from "@univerjs/sheets";
11
+ import { InsertFunctionCommand as ds, TriggerCalculationController as hs, IDescriptionService as Gt, QuickSumCommand as fs, ImageFormulaCellInterceptorController as gs, UniverSheetsFormulaPlugin as ms } from "@univerjs/sheets-formula";
12
+ import { ISidebarService as vn, IZenZoneService as ps, useDependency as T, useObservable as Se, ProgressBar as Ss, MenuItemType as Je, getMenuHiddenObservable as ft, IClipboardInterfaceService as Kn, RibbonFormulasGroup as Yn, KeyCode as $, MetaKeys as P, IMenuManagerService as vs, IShortcutService as Zt, IUIPartsService as Cr, ComponentManager as _r, connectInjector as Rr, useEvent as te, RectPopup as on, IContextMenuService as Cs, useUpdateEffect as _s, BuiltInUIPart as Rs } from "@univerjs/ui";
13
+ import { jsx as M, jsxs as H, Fragment as Is } from "react/jsx-runtime";
14
+ import { useCallback as $t, useState as V, useRef as z, createElement as et, forwardRef as $e, useEffect as L, useMemo as ie, useLayoutEffect as Lt, useImperativeHandle as Es } from "react";
15
+ import { clsx as re, scrollbarClassName as ut, borderLeftClassName as bs, Select as ys, Input as Ir, borderClassName as Cn, Button as at, borderTopClassName as Ts, Tooltip as Ns, Dialog as Os } from "@univerjs/design";
16
+ import { DocSelectionManagerService as Er } from "@univerjs/docs";
17
+ import { debounceTime as xs } from "rxjs/operators";
18
+ const _n = {
19
19
  id: "sheet.command.paste-formula",
20
- type: Ne.COMMAND,
21
- handler: async (e) => e.get(me).executeCommand(go.id, {
22
- value: it.SPECIAL_PASTE_FORMULA
20
+ type: Oe.COMMAND,
21
+ handler: async (e) => e.get(me).executeCommand(po.id, {
22
+ value: ct.SPECIAL_PASTE_FORMULA
23
23
  })
24
24
  }, gt = {
25
25
  id: "formula-ui.operation.select-editor-formula",
26
- type: Ne.OPERATION,
26
+ type: Oe.OPERATION,
27
27
  handler: (e, t) => !0
28
28
  };
29
- var Ns = Object.getOwnPropertyDescriptor, Os = (e, t, n, o) => {
30
- for (var r = o > 1 ? void 0 : o ? Ns(t, n) : t, s = e.length - 1, i; s >= 0; s--)
29
+ var Ms = Object.getOwnPropertyDescriptor, ws = (e, t, n, o) => {
30
+ for (var r = o > 1 ? void 0 : o ? Ms(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
- }, 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 {
33
+ }, ks = (e, t) => (n, o) => t(n, o, e);
34
+ const As = "FORMULA_PROMPT_ACTIVATED", zt = Xr("formula-ui.prompt-service");
35
+ let sn = class {
36
36
  constructor(e) {
37
37
  j(this, "_search$", new mt());
38
38
  j(this, "_help$", new mt());
@@ -55,7 +55,7 @@ let rn = class {
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(Ms, e.visible), this._searching = e.visible, this._search$.next(e);
58
+ this._contextService.setContextValue(As, e.visible), this._searching = e.visible, this._search$.next(e);
59
59
  }
60
60
  isSearching() {
61
61
  return this._searching;
@@ -187,39 +187,39 @@ let rn = class {
187
187
  return this._isLockedOnSelectionInsertRefString;
188
188
  }
189
189
  };
190
- rn = Os([
191
- xs(0, cn)
192
- ], rn);
193
- const ws = {
190
+ sn = ws([
191
+ ks(0, ln)
192
+ ], sn);
193
+ const Fs = {
194
194
  id: "formula-ui.operation.help-function",
195
- type: Ne.OPERATION,
196
- handler: async (e, t) => (e.get(Zt).help(t), !0)
195
+ type: Oe.OPERATION,
196
+ handler: async (e, t) => (e.get(zt).help(t), !0)
197
197
  }, pe = {
198
198
  id: "formula-ui.operation.insert-function",
199
- type: Ne.OPERATION,
199
+ type: Oe.OPERATION,
200
200
  // eslint-disable-next-line
201
201
  handler: async (e, t) => {
202
202
  var C, _;
203
- const n = e.get(fn), o = e.get(Ye), r = n.getCurrentSelections();
203
+ const n = e.get(mn), o = e.get(Ge), r = n.getCurrentSelections();
204
204
  if (!r || !r.length)
205
205
  return !1;
206
- const s = pr(e.get(ne));
206
+ const s = vr(e.get(ne));
207
207
  if (!s) return !1;
208
208
  const { worksheet: i, unitId: c, subUnitId: l } = s, g = i.getCellMatrix(), { value: m } = t, h = e.get(me);
209
- e.get(dn);
209
+ e.get(fn);
210
210
  const d = [], u = [];
211
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))) {
212
+ if (r.length === 1 && (Ls(r[0].range) || Ps(r[0].range) && Zn(g, r[0].range))) {
213
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
214
  a = E, v = b, p = y;
215
- const A = Kn(g, b, y);
215
+ const A = Gn(g, b, y);
216
216
  A && (S = Ce(A));
217
217
  } else
218
218
  r.some((E) => {
219
219
  var y, A;
220
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);
221
+ if (Zn(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 = Gn(g, F, N);
223
223
  if (!O)
224
224
  return a = f, v = F, p = N, !0;
225
225
  const k = Ce(O), I = `=${m}(${k})`;
@@ -234,7 +234,7 @@ const ws = {
234
234
  } else {
235
235
  const { startRow: F, startColumn: N, endRow: O, endColumn: k } = f;
236
236
  if (F === O) {
237
- const I = Ls(g, F, k, i.getColumnCount() - 1), x = I === k ? k - 1 : k, R = Ce({
237
+ const I = Us(g, F, k, i.getColumnCount() - 1), x = I === k ? k - 1 : k, R = Ce({
238
238
  startRow: F,
239
239
  endRow: O,
240
240
  startColumn: N,
@@ -251,7 +251,7 @@ const ws = {
251
251
  } else {
252
252
  let I = -1;
253
253
  for (let R = N; R <= k; R++) {
254
- const w = $s(g, R, O, i.getRowCount() - 1);
254
+ const w = Vs(g, R, O, i.getRowCount() - 1);
255
255
  I = Math.max(I, w);
256
256
  }
257
257
  const x = I === O ? O - 1 : O;
@@ -276,8 +276,8 @@ const ws = {
276
276
  return !1;
277
277
  });
278
278
  if (a) {
279
- const E = ts(v, p, i), f = {
280
- range: er.clone(a),
279
+ const E = rs(v, p, i), f = {
280
+ range: nr.clone(a),
281
281
  primary: {
282
282
  startRow: E.startRow,
283
283
  startColumn: E.startColumn,
@@ -293,24 +293,24 @@ const ws = {
293
293
  subUnitId: l,
294
294
  selections: [f]
295
295
  };
296
- await h.executeCommand(gn.id, b);
297
- const y = o.getEditor(an), A = o.getEditor(tr);
298
- h.syncExecuteCommand(sr.id, {
296
+ await h.executeCommand(pn.id, b);
297
+ const y = o.getEditor(un), A = o.getEditor(rr);
298
+ h.syncExecuteCommand(cr.id, {
299
299
  visible: !0,
300
300
  unitId: c,
301
- eventType: Oe.Dblclick
301
+ eventType: xe.Dblclick
302
302
  });
303
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(ls.id, {
306
+ return d.length === 0 && u.length === 0 ? !1 : h.executeCommand(ds.id, {
307
307
  list: d,
308
308
  listOfRangeHasNumber: u
309
309
  });
310
310
  }
311
311
  };
312
- function Kn(e, t, n) {
313
- const o = ks(e, t, n);
312
+ function Gn(e, t, n) {
313
+ const o = Ds(e, t, n);
314
314
  if (o !== t)
315
315
  return {
316
316
  startRow: o,
@@ -318,7 +318,7 @@ function Kn(e, t, n) {
318
318
  startColumn: n,
319
319
  endColumn: n
320
320
  };
321
- const r = As(e, t, n);
321
+ const r = $s(e, t, n);
322
322
  return r !== n ? {
323
323
  startRow: t,
324
324
  endRow: t,
@@ -326,7 +326,7 @@ function Kn(e, t, n) {
326
326
  endColumn: n - 1
327
327
  } : null;
328
328
  }
329
- function ks(e, t, n) {
329
+ function Ds(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--) {
@@ -343,7 +343,7 @@ function ks(e, t, n) {
343
343
  }
344
344
  return t;
345
345
  }
346
- function As(e, t, n) {
346
+ function $s(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--) {
@@ -365,64 +365,64 @@ function _t(e) {
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) === nr ? n.substring(0, n.length - 2) : n;
369
- return zr(r);
368
+ const n = t.dataStream, r = n.substring(n.length - 2, n.length) === or ? n.substring(0, n.length - 2) : n;
369
+ return Qr(r);
370
370
  }
371
- return e && (e.t === xn.NUMBER || Xr(e) === xn.NUMBER);
371
+ return e && (e.t === wn.NUMBER || Jr(e) === wn.NUMBER);
372
372
  }
373
- function Fs(e) {
373
+ function Ls(e) {
374
374
  return e.startRow === e.endRow && e.startColumn === e.endColumn;
375
375
  }
376
- function Ds(e) {
376
+ function Ps(e) {
377
377
  return e.startRow !== e.endRow && e.startColumn !== e.endColumn;
378
378
  }
379
- function Yn(e, t) {
379
+ function Zn(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
382
  if (_t(e.getValue(n, o)))
383
383
  return !1;
384
384
  return !0;
385
385
  }
386
- function Ls(e, t, n, o) {
386
+ function Us(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 $s(e, t, n, o) {
392
+ function Vs(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", Er = `${Ir}_MORE_FUNCTIONS_COMPONENT`, Cn = {
398
+ const br = "SHEET_FORMULA_UI_PLUGIN", yr = `${br}_MORE_FUNCTIONS_COMPONENT`, Rn = {
399
399
  id: "formula-ui.operation.more-functions",
400
- type: Ne.OPERATION,
401
- handler: async (e) => (e.get(pn).open({
400
+ type: Oe.OPERATION,
401
+ handler: async (e) => (e.get(vn).open({
402
402
  header: { title: "formula.insert.tooltip" },
403
- children: { label: Er }
403
+ children: { label: yr }
404
404
  }), !0)
405
- }, br = {
405
+ }, Tr = {
406
406
  id: "formula-ui.operation.change-ref-to-absolute",
407
- type: Ne.OPERATION,
407
+ type: Oe.OPERATION,
408
408
  handler: async (e) => !0
409
- }, Ps = {
409
+ }, Ws = {
410
410
  id: "formula-ui.operation.search-function",
411
- type: Ne.OPERATION,
412
- handler: async (e, t) => (e.get(Zt).search(t), !0)
411
+ type: Oe.OPERATION,
412
+ handler: async (e, t) => (e.get(zt).search(t), !0)
413
413
  };
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--)
414
+ var Hs = Object.getOwnPropertyDescriptor, Bs = (e, t, n, o) => {
415
+ for (var r = o > 1 ? void 0 : o ? Hs(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
- }, wt = (e, t) => (n, o) => t(n, o, e);
419
- let $t = class extends ut {
418
+ }, kt = (e, t) => (n, o) => t(n, o, e);
419
+ let Pt = class extends Ke {
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 === ns.id ? this._reorderFormula(e.params) : {
425
+ getMutations: (e) => e.id === os.id ? this._reorderFormula(e.params) : {
426
426
  redos: [],
427
427
  undos: []
428
428
  }
@@ -437,7 +437,7 @@ let $t = class extends ut {
437
437
  };
438
438
  const g = l.getCellMatrix(), m = new Fe(), h = new Fe();
439
439
  let d = !1;
440
- return Qr.foreach(s, (u, a) => {
440
+ return eo.foreach(s, (u, a) => {
441
441
  let v = u;
442
442
  i.hasOwnProperty(u) && (v = i[u]);
443
443
  const p = g.getValue(v, a);
@@ -447,20 +447,20 @@ let $t = class extends ut {
447
447
  S,
448
448
  0,
449
449
  u - v
450
- ), _ = ln.deepClone(p);
450
+ ), _ = dn.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: Ft.id,
456
+ id: Dt.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: Ft.id,
463
+ id: Dt.id,
464
464
  params: {
465
465
  unitId: o,
466
466
  subUnitId: r,
@@ -475,19 +475,19 @@ let $t = class extends ut {
475
475
  };
476
476
  }
477
477
  };
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--)
478
+ Pt = Bs([
479
+ kt(0, q(Sn)),
480
+ kt(1, q(ne)),
481
+ kt(2, q(yt)),
482
+ kt(3, q(_e))
483
+ ], Pt);
484
+ const Nr = "sheets-formula-ui.base.config", zn = {};
485
+ var qs = Object.getOwnPropertyDescriptor, js = (e, t, n, o) => {
486
+ for (var r = o > 1 ? void 0 : o ? qs(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
489
  }, pt = (e, t) => (n, o) => t(n, o, e);
490
- const Jt = "SHEET_FORMULA_ALERT", Bs = {
490
+ const en = "SHEET_FORMULA_ALERT", Ks = {
491
491
  [ue.DIV_BY_ZERO]: "divByZero",
492
492
  [ue.NAME]: "name",
493
493
  [ue.VALUE]: "value",
@@ -501,7 +501,7 @@ const Jt = "SHEET_FORMULA_ALERT", Bs = {
501
501
  [ue.CONNECT]: "connect",
502
502
  [ue.NULL]: "null"
503
503
  };
504
- let on = class extends ut {
504
+ let cn = class extends Ke {
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,31 +509,31 @@ let on = class extends ut {
509
509
  this._initCellAlertPopup(), this._initZenService();
510
510
  }
511
511
  _initCellAlertPopup() {
512
- this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(hn(100)).subscribe((e) => {
512
+ this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(gn(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 this._hideAlert();
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 (Jr(l)) {
519
- const m = lr(l, !!g);
518
+ if (to(l)) {
519
+ const m = dr(l, !!g);
520
520
  if (!m) {
521
521
  this._hideAlert();
522
522
  return;
523
523
  }
524
- const h = this._cellAlertManagerService.currentAlert.get(Jt), d = (s = h == null ? void 0 : h.alert) == null ? void 0 : s.location;
524
+ const h = this._cellAlertManagerService.currentAlert.get(en), 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
  this._hideAlert();
527
527
  return;
528
528
  }
529
529
  this._cellAlertManagerService.showAlert({
530
- type: So.ERROR,
530
+ type: Co.ERROR,
531
531
  title: this._localeService.t("formula.error.title"),
532
- message: this._localeService.t(`formula.error.${Bs[m]}`),
532
+ message: this._localeService.t(`formula.error.${Ks[m]}`),
533
533
  location: e.location,
534
534
  width: 200,
535
535
  height: 74,
536
- key: Jt
536
+ key: en
537
537
  });
538
538
  return;
539
539
  }
@@ -547,33 +547,33 @@ let on = class extends ut {
547
547
  }));
548
548
  }
549
549
  _hideAlert() {
550
- this._cellAlertManagerService.removeAlert(Jt);
550
+ this._cellAlertManagerService.removeAlert(en);
551
551
  }
552
552
  };
553
- on = Hs([
554
- pt(1, q(mo)),
555
- pt(2, q(po)),
553
+ cn = js([
554
+ pt(1, q(So)),
555
+ pt(2, q(vo)),
556
556
  pt(3, q(dt)),
557
- pt(4, q(bt)),
558
- pt(5, fs)
559
- ], on);
560
- var qs = Object.getOwnPropertyDescriptor, js = (e, t, n, o) => {
561
- for (var r = o > 1 ? void 0 : o ? qs(t, n) : t, s = e.length - 1, i; s >= 0; s--)
557
+ pt(4, q(yt)),
558
+ pt(5, ps)
559
+ ], cn);
560
+ var Ys = Object.getOwnPropertyDescriptor, Gs = (e, t, n, o) => {
561
+ for (var r = o > 1 ? void 0 : o ? Ys(t, n) : t, s = e.length - 1, i; s >= 0; s--)
562
562
  (i = e[s]) && (r = i(r) || r);
563
563
  return r;
564
- }, Zn = (e, t) => (n, o) => t(n, o, e);
565
- let Pt = class extends ut {
564
+ }, Xn = (e, t) => (n, o) => t(n, o, e);
565
+ let Ut = class extends Ke {
566
566
  constructor(e, t) {
567
567
  super(), this._autoFillService = e, this._lexerTreeBuilder = t, this._registerAutoFill();
568
568
  }
569
569
  _registerAutoFill() {
570
570
  const e = {
571
- type: kn.FORMULA,
571
+ type: Fn.FORMULA,
572
572
  priority: 1001,
573
- match: (t) => Ae(t == null ? void 0 : t.f) || at(t == null ? void 0 : t.si),
574
- isContinue: (t, n) => t.type === kn.FORMULA,
573
+ match: (t) => Ae(t == null ? void 0 : t.f) || lt(t == null ? void 0 : t.si),
574
+ isContinue: (t, n) => t.type === Fn.FORMULA,
575
575
  applyFunctions: {
576
- [Co.COPY]: (t, n, o, r, s) => {
576
+ [Ro.COPY]: (t, n, o, r, s) => {
577
577
  const { data: i, index: c } = t;
578
578
  return this._fillCopyFormula(i, n, o, c, r, s);
579
579
  }
@@ -583,20 +583,20 @@ let Pt = class extends ut {
583
583
  }
584
584
  _fillCopyFormula(e, t, n, o, r, s) {
585
585
  var g, m;
586
- const i = Ys(r), c = [], l = /* @__PURE__ */ new Map();
586
+ const i = zs(r), c = [], l = /* @__PURE__ */ new Map();
587
587
  for (let h = 1; h <= t; h++) {
588
- const d = (h - 1) % e.length, u = o[d], a = ln.deepClone(e[d]);
588
+ const d = (h - 1) % e.length, u = o[d], a = dn.deepClone(e[d]);
589
589
  if (a) {
590
590
  const v = ((g = e[d]) == null ? void 0 : g.f) || "", p = ((m = e[d]) == null ? void 0 : m.si) || "", S = Ae(v);
591
- if (at(p))
591
+ if (lt(p))
592
592
  a.si = p, a.f = null, a.v = null, a.p = null, a.t = null, c.push(a);
593
593
  else if (S) {
594
594
  let _ = l.get(d);
595
595
  if (_)
596
596
  a.si = _, a.f = null, a.v = null, a.p = null, a.t = null;
597
597
  else {
598
- _ = qt(6), l.set(d, _);
599
- const { offsetX: E, offsetY: f } = Ks(i, t, n, s, u), b = this._lexerTreeBuilder.moveFormulaRefOffset(
598
+ _ = Kt(6), l.set(d, _);
599
+ const { offsetX: E, offsetY: f } = Zs(i, t, n, s, u), b = this._lexerTreeBuilder.moveFormulaRefOffset(
600
600
  v,
601
601
  E,
602
602
  f
@@ -610,11 +610,11 @@ let Pt = class extends ut {
610
610
  return c;
611
611
  }
612
612
  };
613
- Pt = js([
614
- Zn(0, vo),
615
- Zn(1, q(_e))
616
- ], Pt);
617
- function Ks(e, t, n, o, r) {
613
+ Ut = Gs([
614
+ Xn(0, _o),
615
+ Xn(1, q(_e))
616
+ ], Ut);
617
+ function Zs(e, t, n, o, r) {
618
618
  const { source: s, target: i } = o, { rows: c } = i, { rows: l } = s;
619
619
  let g = 0, m = 0;
620
620
  switch (n) {
@@ -633,7 +633,7 @@ function Ks(e, t, n, o, r) {
633
633
  }
634
634
  return { offsetX: g, offsetY: m };
635
635
  }
636
- function Ys(e) {
636
+ function zs(e) {
637
637
  let t = 0;
638
638
  for (const n in e)
639
639
  e[n].forEach((o) => {
@@ -641,13 +641,13 @@ function Ys(e) {
641
641
  });
642
642
  return t;
643
643
  }
644
- var Gs = Object.getOwnPropertyDescriptor, Zs = (e, t, n, o) => {
645
- for (var r = o > 1 ? void 0 : o ? Gs(t, n) : t, s = e.length - 1, i; s >= 0; s--)
644
+ var Xs = Object.getOwnPropertyDescriptor, Qs = (e, t, n, o) => {
645
+ for (var r = o > 1 ? void 0 : o ? Xs(t, n) : t, s = e.length - 1, i; s >= 0; s--)
646
646
  (i = e[s]) && (r = i(r) || r);
647
647
  return r;
648
648
  }, St = (e, t) => (n, o) => t(n, o, e);
649
- const zs = "default-paste-formula";
650
- let Ut = class extends ut {
649
+ const Js = "default-paste-formula";
650
+ let Vt = class extends Ke {
651
651
  constructor(e, t, n, o, r) {
652
652
  super(), this._currentUniverSheet = e, this._lexerTreeBuilder = t, this._sheetClipboardService = n, this._injector = o, this._formulaDataModel = r, this._initialize();
653
653
  }
@@ -659,7 +659,7 @@ let Ut = class extends ut {
659
659
  }
660
660
  _pasteFormulaHook() {
661
661
  return {
662
- id: it.SPECIAL_PASTE_FORMULA,
662
+ id: ct.SPECIAL_PASTE_FORMULA,
663
663
  priority: 10,
664
664
  specialPasteInfo: { label: "specialPaste.formula" },
665
665
  onPasteCells: (e, t, n, o) => this._onPasteCells(e, t, n, o, !0)
@@ -667,7 +667,7 @@ let Ut = class extends ut {
667
667
  }
668
668
  _pasteWithFormulaHook() {
669
669
  return {
670
- id: zs,
670
+ id: Js,
671
671
  priority: 10,
672
672
  onPasteCells: (e, t, n, o) => this._onPasteCells(e, t, n, o, !1)
673
673
  };
@@ -675,25 +675,25 @@ let Ut = class extends ut {
675
675
  _onPasteCells(e, t, n, o, r) {
676
676
  var d;
677
677
  if ([
678
- it.SPECIAL_PASTE_FORMAT,
679
- it.SPECIAL_PASTE_COL_WIDTH
678
+ ct.SPECIAL_PASTE_FORMAT,
679
+ ct.SPECIAL_PASTE_COL_WIDTH
680
680
  ].includes(o.pasteType))
681
681
  return {
682
682
  undos: [],
683
683
  redos: []
684
684
  };
685
- const i = this._currentUniverSheet.getCurrentUnitForType(H.UNIVER_SHEET), c = t.unitId || i.getUnitId(), l = t.subUnitId || ((d = i.getActiveSheet()) == null ? void 0 : d.getSheetId());
685
+ const i = this._currentUniverSheet.getCurrentUnitForType(W.UNIVER_SHEET), c = t.unitId || i.getUnitId(), l = t.subUnitId || ((d = i.getActiveSheet()) == null ? void 0 : d.getSheetId());
686
686
  if (!c || !l)
687
687
  return {
688
688
  undos: [],
689
689
  redos: []
690
690
  };
691
691
  const g = t.range, m = n, h = {
692
- copyType: o.copyType || ir.COPY,
692
+ copyType: o.copyType || ar.COPY,
693
693
  copyRange: e == null ? void 0 : e.range,
694
694
  pasteType: o.pasteType
695
695
  };
696
- return this._injector.invoke((u) => Xs(
696
+ return this._injector.invoke((u) => ei(
697
697
  c,
698
698
  l,
699
699
  g,
@@ -707,15 +707,15 @@ let Ut = class extends ut {
707
707
  ));
708
708
  }
709
709
  };
710
- Ut = Zs([
710
+ Vt = Qs([
711
711
  St(0, ne),
712
712
  St(1, q(_e)),
713
- St(2, _o),
713
+ St(2, Io),
714
714
  St(3, q(Rt)),
715
- St(4, q(bt))
716
- ], Ut);
717
- function Xs(e, t, n, o, r, s, i, c, l = !1, g) {
718
- const m = [], h = [], d = Qs(e, t, n, o, s, i, c, g);
715
+ St(4, q(yt))
716
+ ], Vt);
717
+ function ei(e, t, n, o, r, s, i, c, l = !1, g) {
718
+ const m = [], h = [], d = ti(e, t, n, o, s, i, c, g);
719
719
  if (!d.hasValue())
720
720
  return {
721
721
  undos: [],
@@ -727,25 +727,25 @@ function Xs(e, t, n, o, r, s, i, c, l = !1, g) {
727
727
  cellValue: d.getData()
728
728
  };
729
729
  m.push({
730
- id: Ft.id,
730
+ id: Dt.id,
731
731
  params: u
732
732
  });
733
- const a = rs(
733
+ const a = ss(
734
734
  r,
735
735
  u
736
736
  );
737
737
  return h.push({
738
- id: Ft.id,
738
+ id: Dt.id,
739
739
  params: a
740
740
  }), {
741
741
  undos: h,
742
742
  redos: m
743
743
  };
744
744
  }
745
- function Qs(e, t, n, o, r, s, i, c) {
746
- 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
+ function ti(e, t, n, o, r, s, i, c) {
746
+ return c ? r.pasteType === ct.SPECIAL_PASTE_VALUE ? ri(e, t, n, o, i, c) : r.pasteType === ct.SPECIAL_PASTE_FORMULA ? oi(e, t, n, o, s, i, c) : si(e, t, n, o, r.copyType, s, i, c) : ni(e, t, n, o, i);
747
747
  }
748
- function Js(e, t, n, o, r) {
748
+ function ni(e, t, n, o, r) {
749
749
  const s = new Fe(), i = r.getSheetFormulaData(e, t);
750
750
  return o.forValue((c, l, g) => {
751
751
  var u;
@@ -753,31 +753,31 @@ function Js(e, t, n, o, r) {
753
753
  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));
754
754
  }), s;
755
755
  }
756
- function ei(e, t, n, o, r, s) {
756
+ function ri(e, t, n, o, r, s) {
757
757
  var g, m;
758
758
  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);
759
759
  return o.forValue((h, d, u) => {
760
760
  var _, E;
761
761
  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 = {};
762
- if (Ae(u.f) || at(u.si))
762
+ if (Ae(u.f) || lt(u.si))
763
763
  C.v = u.v, C.f = null, C.si = null, C.p = null, i.setValue(p, S, C);
764
764
  else if ((_ = c == null ? void 0 : c[a]) != null && _[v]) {
765
765
  const f = c[a][v];
766
766
  C.v = f.v, C.f = null, C.si = null, C.p = null, i.setValue(p, S, C);
767
767
  } else if ((E = l == null ? void 0 : l[p]) != null && E[S]) {
768
768
  if (C.v = u.v, C.f = null, C.si = null, C.p = null, u.p) {
769
- const f = Tr(u);
769
+ const f = Or(u);
770
770
  f && (C.v = f);
771
771
  }
772
772
  i.setValue(p, S, C);
773
773
  }
774
774
  }), i;
775
775
  }
776
- function ti(e, t, n, o, r, s, i) {
776
+ function oi(e, t, n, o, r, s, i) {
777
777
  const c = new Fe(), l = /* @__PURE__ */ new Map();
778
778
  return o.forValue((g, m, h) => {
779
779
  const d = n.rows[g], u = n.cols[m], a = {};
780
- if (at(h.si)) {
780
+ if (lt(h.si)) {
781
781
  if (i.unitId !== e || i.subUnitId !== t) {
782
782
  const v = s.getFormulaStringByCell(
783
783
  i.range.rows[g % i.range.rows.length],
@@ -795,25 +795,25 @@ function ti(e, t, n, o, r, s, i) {
795
795
  if (p)
796
796
  a.si = p, a.f = null;
797
797
  else {
798
- p = qt(6), l.set(v, p);
798
+ p = Kt(6), l.set(v, p);
799
799
  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);
800
800
  a.si = p, a.f = _;
801
801
  }
802
802
  a.v = null, a.p = null, c.setValue(d, u, a);
803
803
  } else {
804
804
  if (a.v = h.v, a.f = null, a.si = null, a.p = null, h.p) {
805
- const v = Tr(h);
805
+ const v = Or(h);
806
806
  v && (a.v = v);
807
807
  }
808
808
  c.setValue(d, u, a);
809
809
  }
810
810
  }), c;
811
811
  }
812
- function ni(e, t, n, o, r, s, i, c) {
812
+ function si(e, t, n, o, r, s, i, c) {
813
813
  const l = new Fe(), g = /* @__PURE__ */ new Map(), m = i.getSheetFormulaData(e, t), h = [];
814
- return r === ir.CUT ? o.forValue((d, u, a) => {
814
+ return r === ar.CUT ? o.forValue((d, u, a) => {
815
815
  const v = n.rows[d], p = n.cols[u], S = {};
816
- if (at(a.si)) {
816
+ if (lt(a.si)) {
817
817
  if (Ae(a.f))
818
818
  h.push(a.si), S.f = a.f, S.si = a.si;
819
819
  else if (h.includes(a.si))
@@ -832,7 +832,7 @@ function ni(e, t, n, o, r, s, i, c) {
832
832
  }) : o.forValue((d, u, a) => {
833
833
  var C;
834
834
  const v = n.rows[d], p = n.cols[u], S = {};
835
- if (at(a.si)) {
835
+ if (lt(a.si)) {
836
836
  if (c.unitId !== e || c.subUnitId !== t) {
837
837
  const _ = i.getFormulaStringByCell(
838
838
  c.range.rows[d % c.range.rows.length],
@@ -850,7 +850,7 @@ function ni(e, t, n, o, r, s, i, c) {
850
850
  if (E)
851
851
  S.si = E, S.f = null;
852
852
  else {
853
- E = qt(6), g.set(_, E);
853
+ E = Kt(6), g.set(_, E);
854
854
  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);
855
855
  S.si = E, S.f = y;
856
856
  }
@@ -873,21 +873,21 @@ function ni(e, t, n, o, r, s, i, c) {
873
873
  }
874
874
  }), l;
875
875
  }
876
- function Tr(e) {
876
+ function Or(e) {
877
877
  if (e != null && e.p) {
878
878
  const t = e == null ? void 0 : e.p.body;
879
879
  if (t == null)
880
880
  return;
881
881
  const n = t.dataStream;
882
- return n.substring(n.length - 2, n.length) === nr ? n.substring(0, n.length - 2) : n;
882
+ return n.substring(n.length - 2, n.length) === or ? n.substring(0, n.length - 2) : n;
883
883
  }
884
884
  }
885
- var ri = Object.getOwnPropertyDescriptor, oi = (e, t, n, o) => {
886
- for (var r = o > 1 ? void 0 : o ? ri(t, n) : t, s = e.length - 1, i; s >= 0; s--)
885
+ var ii = Object.getOwnPropertyDescriptor, ci = (e, t, n, o) => {
886
+ for (var r = o > 1 ? void 0 : o ? ii(t, n) : t, s = e.length - 1, i; s >= 0; s--)
887
887
  (i = e[s]) && (r = i(r) || r);
888
888
  return r;
889
889
  }, He = (e, t) => (n, o) => t(n, o, e);
890
- let Vt = class extends ut {
890
+ let Wt = class extends Ke {
891
891
  constructor(t, n, o, r, s, i, c, l) {
892
892
  super();
893
893
  j(this, "_previousShape");
@@ -917,8 +917,8 @@ let Vt = class extends ut {
917
917
  }
918
918
  _initInterceptorEditorStart() {
919
919
  this.disposeWithMe(
920
- rr(
921
- this._sheetInterceptorService.writeCellInterceptor.intercept(os, {
920
+ sr(
921
+ this._sheetInterceptorService.writeCellInterceptor.intercept(is, {
922
922
  handler: (t, n, o) => {
923
923
  var a, v, p, S;
924
924
  const { row: r, col: s, unitId: i, subUnitId: c, worksheet: l } = n, g = this._formulaDataModel.getArrayFormulaRange(), m = this._formulaDataModel.getArrayFormulaCellData();
@@ -937,10 +937,10 @@ let Vt = class extends ut {
937
937
  }
938
938
  _commandExecutedListener() {
939
939
  this.disposeWithMe(this._commandService.onCommandExecuted((t, n) => {
940
- (t.id === Ao.id || t.id === Fo.id && n && n.remove) && this._removeArrayFormulaRangeShape();
940
+ (t.id === Do.id || t.id === $o.id && n && n.remove) && this._removeArrayFormulaRangeShape();
941
941
  })), this.disposeWithMe(
942
942
  this._commandService.beforeCommandExecuted((t) => {
943
- ss.id === t.id && requestIdleCallback(() => {
943
+ cs.id === t.id && requestIdleCallback(() => {
944
944
  const n = t.params, { unitId: o, subUnitId: r, rowsAutoHeightInfo: s } = n;
945
945
  this._refreshArrayFormulaRangeShapeByRow(o, r, s);
946
946
  });
@@ -979,10 +979,10 @@ let Vt = class extends ut {
979
979
  style: {
980
980
  strokeWidth: 1,
981
981
  stroke: this._themeService.getColorFromTheme("primary.600"),
982
- fill: new un(this._themeService.getColorFromTheme("white")).setAlpha(0).toString(),
982
+ fill: new hn(this._themeService.getColorFromTheme("white")).setAlpha(0).toString(),
983
983
  widgets: {}
984
984
  }
985
- }, c = tn(i, r), { rowHeaderWidth: l, columnHeaderHeight: g } = r, m = new cr(s, Ro.FORMULA_EDITOR_SHOW, this._themeService, {
985
+ }, c = rn(i, r), { rowHeaderWidth: l, columnHeaderHeight: g } = r, m = new lr(s, Eo.FORMULA_EDITOR_SHOW, this._themeService, {
986
986
  highlightHeader: !1,
987
987
  rowHeaderWidth: l,
988
988
  columnHeaderHeight: g
@@ -1025,38 +1025,38 @@ let Vt = class extends ut {
1025
1025
  }
1026
1026
  }
1027
1027
  };
1028
- Vt = oi([
1029
- He(1, q(mn)),
1030
- He(2, q(bt)),
1028
+ Wt = ci([
1029
+ He(1, q(Sn)),
1030
+ He(2, q(yt)),
1031
1031
  He(3, q(It)),
1032
- He(4, xe),
1033
- He(5, q(jt)),
1032
+ He(4, Re),
1033
+ He(5, q(Et)),
1034
1034
  He(6, me),
1035
- He(7, eo)
1036
- ], Vt);
1037
- var si = Object.getOwnPropertyDescriptor, ii = (e, t, n, o) => {
1038
- for (var r = o > 1 ? void 0 : o ? si(t, n) : t, s = e.length - 1, i; s >= 0; s--)
1035
+ He(7, no)
1036
+ ], Wt);
1037
+ var ai = Object.getOwnPropertyDescriptor, li = (e, t, n, o) => {
1038
+ for (var r = o > 1 ? void 0 : o ? ai(t, n) : t, s = e.length - 1, i; s >= 0; s--)
1039
1039
  (i = e[s]) && (r = i(r) || r);
1040
1040
  return r;
1041
- }, zn = (e, t) => (n, o) => t(n, o, e);
1042
- const ci = {
1041
+ }, Qn = (e, t) => (n, o) => t(n, o, e);
1042
+ const ui = {
1043
1043
  tl: {
1044
1044
  size: 6,
1045
1045
  color: "#409f11"
1046
1046
  }
1047
1047
  };
1048
- let Wt = class extends to {
1048
+ let Ht = class extends ro {
1049
1049
  constructor(e, t) {
1050
1050
  super(), this._sheetInterceptorService = e, this._formulaDataModel = t, this.disposeWithMe(this._sheetInterceptorService.intercept(
1051
- is.CELL_CONTENT,
1051
+ as.CELL_CONTENT,
1052
1052
  {
1053
- effect: no.Style,
1053
+ effect: oo.Style,
1054
1054
  handler: (n, o, r) => {
1055
1055
  var c, l, g, m;
1056
1056
  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];
1057
- return !lr(n, !!s) || !n || (n === o.rawData && (n = { ...o.rawData }), n.markers = {
1057
+ return !dr(n, !!s) || !n || (n === o.rawData && (n = { ...o.rawData }), n.markers = {
1058
1058
  ...n == null ? void 0 : n.markers,
1059
- ...ci
1059
+ ...ui
1060
1060
  }), r(n);
1061
1061
  },
1062
1062
  priority: 10
@@ -1064,25 +1064,25 @@ let Wt = class extends to {
1064
1064
  ));
1065
1065
  }
1066
1066
  };
1067
- Wt = ii([
1068
- zn(0, q(mn)),
1069
- zn(1, q(bt))
1070
- ], Wt);
1071
- function ai() {
1072
- const e = T(us), t = T(me), n = Se(e.progress$), o = Dt(() => {
1073
- t.executeCommand(Do.id);
1074
- }, [t]), r = Dt(() => {
1067
+ Ht = li([
1068
+ Qn(0, q(Sn)),
1069
+ Qn(1, q(yt))
1070
+ ], Ht);
1071
+ function di() {
1072
+ const e = T(hs), t = T(me), n = Se(e.progress$), o = $t(() => {
1073
+ t.executeCommand(Lo.id);
1074
+ }, [t]), r = $t(() => {
1075
1075
  e.clearProgress();
1076
1076
  }, [e]);
1077
- return /* @__PURE__ */ M(gs, { progress: n, onTerminate: o, onClearProgress: r });
1077
+ return /* @__PURE__ */ M(Ss, { progress: n, onTerminate: o, onClearProgress: r });
1078
1078
  }
1079
- function li(e, t) {
1079
+ function hi(e, t) {
1080
1080
  return Object.keys(e).filter((n) => isNaN(Number(n)) && n !== "DefinedName").map((n) => ({
1081
1081
  label: t.t(`formula.functionType.${n.toLocaleLowerCase()}`),
1082
1082
  value: `${e[n]}`
1083
1083
  }));
1084
1084
  }
1085
- function Nr(e) {
1085
+ function xr(e) {
1086
1086
  if (!e.require && !e.repeat)
1087
1087
  return `[${e.name}]`;
1088
1088
  if (e.require && !e.repeat)
@@ -1092,15 +1092,15 @@ function Nr(e) {
1092
1092
  if (e.require && e.repeat)
1093
1093
  return `${e.name},...`;
1094
1094
  }
1095
- function Or(e) {
1095
+ function Mr(e) {
1096
1096
  const { prefix: t, value: n } = e;
1097
- return /* @__PURE__ */ W("div", { children: [
1098
- /* @__PURE__ */ W("span", { children: [
1097
+ return /* @__PURE__ */ H("div", { children: [
1098
+ /* @__PURE__ */ H("span", { children: [
1099
1099
  t,
1100
1100
  "("
1101
1101
  ] }),
1102
- n && n.map((o, r) => /* @__PURE__ */ W("span", { children: [
1103
- /* @__PURE__ */ M("span", { children: Nr(o) }),
1102
+ n && n.map((o, r) => /* @__PURE__ */ H("span", { children: [
1103
+ /* @__PURE__ */ M("span", { children: xr(o) }),
1104
1104
  r === n.length - 1 ? "" : ","
1105
1105
  ] }, r)),
1106
1106
  ")"
@@ -1108,7 +1108,7 @@ function Or(e) {
1108
1108
  }
1109
1109
  function vt(e) {
1110
1110
  const { className: t, value: n, title: o } = e;
1111
- return /* @__PURE__ */ W("div", { className: "univer-mb-2 univer-text-xs", children: [
1111
+ return /* @__PURE__ */ H("div", { className: "univer-mb-2 univer-text-xs", children: [
1112
1112
  /* @__PURE__ */ M(
1113
1113
  "div",
1114
1114
  {
@@ -1125,27 +1125,27 @@ function vt(e) {
1125
1125
  )
1126
1126
  ] });
1127
1127
  }
1128
- function ui(e) {
1128
+ function fi(e) {
1129
1129
  const { functionInfo: t, onChange: n } = e;
1130
1130
  if (!t) return null;
1131
1131
  const [o, r] = V([]), [s, i] = V(t.functionParameter), [c, l] = V(-1);
1132
- return /* @__PURE__ */ W("div", { children: [
1133
- /* @__PURE__ */ M("div", { className: re("univer-h-[364px] univer-overflow-y-auto", lt), children: s.map((g, m) => /* @__PURE__ */ W("div", { children: [
1132
+ return /* @__PURE__ */ H("div", { children: [
1133
+ /* @__PURE__ */ M("div", { className: re("univer-h-[364px] univer-overflow-y-auto", ut), children: s.map((g, m) => /* @__PURE__ */ H("div", { children: [
1134
1134
  /* @__PURE__ */ M("div", { className: "univer-text-sm", children: g.name }),
1135
1135
  /* @__PURE__ */ M("div", { className: "univer-mb-2 univer-mt-1" })
1136
1136
  ] }, m)) }),
1137
- /* @__PURE__ */ M("div", { className: re("univer-flex-1 univer-p-3", Rs), children: /* @__PURE__ */ M(
1137
+ /* @__PURE__ */ M("div", { className: re("univer-flex-1 univer-p-3", bs), children: /* @__PURE__ */ M(
1138
1138
  vt,
1139
1139
  {
1140
- title: c === -1 ? /* @__PURE__ */ M(Or, { prefix: t.functionName, value: s }) : s[c].name,
1140
+ title: c === -1 ? /* @__PURE__ */ M(Mr, { prefix: t.functionName, value: s }) : s[c].name,
1141
1141
  value: c === -1 ? t.description : s[c].detail
1142
1142
  }
1143
1143
  ) })
1144
1144
  ] });
1145
1145
  }
1146
- function et({ ref: e, ...t }) {
1147
- const { icon: n, id: o, className: r, extend: s, ...i } = t, c = `univerjs-icon univerjs-icon-${o} ${r || ""}`.trim(), l = z(`_${fi()}`);
1148
- return xr(n, `${o}`, {
1146
+ function tt({ ref: e, ...t }) {
1147
+ const { icon: n, id: o, className: r, extend: s, ...i } = t, c = `univerjs-icon univerjs-icon-${o} ${r || ""}`.trim(), l = z(`_${pi()}`);
1148
+ return wr(n, `${o}`, {
1149
1149
  defIds: n.defIds,
1150
1150
  idSuffix: l.current
1151
1151
  }, {
@@ -1154,14 +1154,14 @@ function et({ ref: e, ...t }) {
1154
1154
  ...i
1155
1155
  }, s);
1156
1156
  }
1157
- function xr(e, t, n, o, r) {
1158
- return Je(e.tag, {
1157
+ function wr(e, t, n, o, r) {
1158
+ return et(e.tag, {
1159
1159
  key: t,
1160
- ...di(e, n, r),
1160
+ ...gi(e, n, r),
1161
1161
  ...o
1162
- }, (hi(e, n).children || []).map((s, i) => xr(s, `${t}-${e.tag}-${i}`, n, void 0, r)));
1162
+ }, (mi(e, n).children || []).map((s, i) => wr(s, `${t}-${e.tag}-${i}`, n, void 0, r)));
1163
1163
  }
1164
- function di(e, t, n) {
1164
+ function gi(e, t, n) {
1165
1165
  const o = { ...e.attrs };
1166
1166
  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]) => {
1167
1167
  s === "mask" && typeof i == "string" && (o[s] = i.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
@@ -1171,7 +1171,7 @@ function di(e, t, n) {
1171
1171
  typeof i == "string" && (o[s] = i.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
1172
1172
  })), o;
1173
1173
  }
1174
- function hi(e, t) {
1174
+ function mi(e, t) {
1175
1175
  var o;
1176
1176
  const { defIds: n } = t;
1177
1177
  return !n || n.length === 0 ? e : e.tag === "defs" && ((o = e.children) != null && o.length) ? {
@@ -1185,11 +1185,11 @@ function hi(e, t) {
1185
1185
  } : r)
1186
1186
  } : e;
1187
1187
  }
1188
- function fi() {
1188
+ function pi() {
1189
1189
  return Math.random().toString(36).substring(2, 8);
1190
1190
  }
1191
- et.displayName = "UniverIcon";
1192
- const gi = {
1191
+ tt.displayName = "UniverIcon";
1192
+ const Si = {
1193
1193
  tag: "svg",
1194
1194
  attrs: {
1195
1195
  xmlns: "http://www.w3.org/2000/svg",
@@ -1207,15 +1207,15 @@ const gi = {
1207
1207
  clipRule: "evenodd"
1208
1208
  }
1209
1209
  }]
1210
- }, Mr = Le(function(t, n) {
1211
- return Je(et, Object.assign({}, t, {
1210
+ }, kr = $e(function(t, n) {
1211
+ return et(tt, Object.assign({}, t, {
1212
1212
  id: "check-mark-icon",
1213
1213
  ref: n,
1214
- icon: gi
1214
+ icon: Si
1215
1215
  }));
1216
1216
  });
1217
- Mr.displayName = "CheckMarkIcon";
1218
- const mi = {
1217
+ kr.displayName = "CheckMarkIcon";
1218
+ const vi = {
1219
1219
  tag: "svg",
1220
1220
  attrs: {
1221
1221
  xmlns: "http://www.w3.org/2000/svg",
@@ -1231,15 +1231,15 @@ const mi = {
1231
1231
  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"
1232
1232
  }
1233
1233
  }]
1234
- }, wr = Le(function(t, n) {
1235
- return Je(et, Object.assign({}, t, {
1234
+ }, Ar = $e(function(t, n) {
1235
+ return et(tt, Object.assign({}, t, {
1236
1236
  id: "close-icon",
1237
1237
  ref: n,
1238
- icon: mi
1238
+ icon: vi
1239
1239
  }));
1240
1240
  });
1241
- wr.displayName = "CloseIcon";
1242
- const pi = {
1241
+ Ar.displayName = "CloseIcon";
1242
+ const Ci = {
1243
1243
  tag: "svg",
1244
1244
  attrs: {
1245
1245
  xmlns: "http://www.w3.org/2000/svg",
@@ -1280,15 +1280,15 @@ const pi = {
1280
1280
  }
1281
1281
  }
1282
1282
  ]
1283
- }, kr = Le(function(t, n) {
1284
- return Je(et, Object.assign({}, t, {
1283
+ }, Fr = $e(function(t, n) {
1284
+ return et(tt, Object.assign({}, t, {
1285
1285
  id: "delete-icon",
1286
1286
  ref: n,
1287
- icon: pi
1287
+ icon: Ci
1288
1288
  }));
1289
1289
  });
1290
- kr.displayName = "DeleteIcon";
1291
- const Si = {
1290
+ Fr.displayName = "DeleteIcon";
1291
+ const _i = {
1292
1292
  tag: "svg",
1293
1293
  attrs: {
1294
1294
  xmlns: "http://www.w3.org/2000/svg",
@@ -1304,15 +1304,15 @@ const Si = {
1304
1304
  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"
1305
1305
  }
1306
1306
  }]
1307
- }, Ar = Le(function(t, n) {
1308
- return Je(et, Object.assign({}, t, {
1307
+ }, Dr = $e(function(t, n) {
1308
+ return et(tt, Object.assign({}, t, {
1309
1309
  id: "increase-icon",
1310
1310
  ref: n,
1311
- icon: Si
1311
+ icon: _i
1312
1312
  }));
1313
1313
  });
1314
- Ar.displayName = "IncreaseIcon";
1315
- const vi = {
1314
+ Dr.displayName = "IncreaseIcon";
1315
+ const Ri = {
1316
1316
  tag: "svg",
1317
1317
  attrs: {
1318
1318
  xmlns: "http://www.w3.org/2000/svg",
@@ -1330,15 +1330,15 @@ const vi = {
1330
1330
  clipRule: "evenodd"
1331
1331
  }
1332
1332
  }]
1333
- }, Fr = Le(function(t, n) {
1334
- return Je(et, Object.assign({}, t, {
1333
+ }, $r = $e(function(t, n) {
1334
+ return et(tt, Object.assign({}, t, {
1335
1335
  id: "more-icon",
1336
1336
  ref: n,
1337
- icon: vi
1337
+ icon: Ri
1338
1338
  }));
1339
1339
  });
1340
- Fr.displayName = "MoreIcon";
1341
- const Ci = {
1340
+ $r.displayName = "MoreIcon";
1341
+ const Ii = {
1342
1342
  tag: "svg",
1343
1343
  attrs: {
1344
1344
  xmlns: "http://www.w3.org/2000/svg",
@@ -1362,26 +1362,26 @@ const Ci = {
1362
1362
  clipRule: "evenodd"
1363
1363
  }
1364
1364
  }]
1365
- }, Dr = Le(function(t, n) {
1366
- return Je(et, Object.assign({}, t, {
1365
+ }, Lr = $e(function(t, n) {
1366
+ return et(tt, Object.assign({}, t, {
1367
1367
  id: "select-range-icon",
1368
1368
  ref: n,
1369
- icon: Ci
1369
+ icon: Ii
1370
1370
  }));
1371
1371
  });
1372
- Dr.displayName = "SelectRangeIcon";
1373
- function _i(e) {
1374
- 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);
1372
+ Lr.displayName = "SelectRangeIcon";
1373
+ function Ei(e) {
1374
+ 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(Gt), p = T(dt), S = T(vn), C = Se(S.sidebarOptions$), _ = hi(hr, p);
1375
1375
  _.unshift({
1376
1376
  label: p.t("formula.moreFunctions.allFunctions"),
1377
1377
  value: n
1378
1378
  });
1379
1379
  const E = p.t("formula.prompt.required"), f = p.t("formula.prompt.optional");
1380
- $(() => {
1380
+ L(() => {
1381
1381
  A(n);
1382
- }, []), $(() => {
1382
+ }, []), L(() => {
1383
1383
  y(0);
1384
- }, [s]), $(() => {
1384
+ }, [s]), L(() => {
1385
1385
  C != null && C.visible && (r(""), i([]), l(0), m(n), d(0), a(null), A(n));
1386
1386
  }, [C]);
1387
1387
  const b = (I) => {
@@ -1425,11 +1425,11 @@ function _i(e) {
1425
1425
  }, k = () => {
1426
1426
  l(-1);
1427
1427
  };
1428
- return /* @__PURE__ */ W("div", { children: [
1429
- /* @__PURE__ */ W("div", { className: "univer-flex univer-items-center univer-justify-between univer-gap-2", children: [
1430
- /* @__PURE__ */ M(Is, { value: g, options: _, onChange: A }),
1428
+ return /* @__PURE__ */ H("div", { children: [
1429
+ /* @__PURE__ */ H("div", { className: "univer-flex univer-items-center univer-justify-between univer-gap-2", children: [
1430
+ /* @__PURE__ */ M(ys, { value: g, options: _, onChange: A }),
1431
1431
  /* @__PURE__ */ M(
1432
- _r,
1432
+ Ir,
1433
1433
  {
1434
1434
  placeholder: p.t("formula.moreFunctions.searchFunctionPlaceholder"),
1435
1435
  onKeyDown: N,
@@ -1443,10 +1443,10 @@ function _i(e) {
1443
1443
  s.length > 0 && /* @__PURE__ */ M(
1444
1444
  "ul",
1445
1445
  {
1446
- 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),
1446
+ 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", Cn, ut),
1447
1447
  onKeyDown: N,
1448
1448
  tabIndex: -1,
1449
- children: s.map(({ name: I }, x) => /* @__PURE__ */ W(
1449
+ children: s.map(({ name: I }, x) => /* @__PURE__ */ H(
1450
1450
  "li",
1451
1451
  {
1452
1452
  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", {
@@ -1457,7 +1457,7 @@ function _i(e) {
1457
1457
  onClick: () => y(x),
1458
1458
  children: [
1459
1459
  h === x && /* @__PURE__ */ M(
1460
- Mr,
1460
+ kr,
1461
1461
  {
1462
1462
  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"
1463
1463
  }
@@ -1469,13 +1469,13 @@ function _i(e) {
1469
1469
  ))
1470
1470
  }
1471
1471
  ),
1472
- u && /* @__PURE__ */ W("div", { className: re("univer-mx-0 univer-my-2 univer-overflow-y-auto", lt), children: [
1472
+ u && /* @__PURE__ */ H("div", { className: re("univer-mx-0 univer-my-2 univer-overflow-y-auto", ut), children: [
1473
1473
  /* @__PURE__ */ M(vt, { title: u.functionName, value: u.description }),
1474
1474
  /* @__PURE__ */ M(
1475
1475
  vt,
1476
1476
  {
1477
1477
  title: p.t("formula.moreFunctions.syntax"),
1478
- value: /* @__PURE__ */ M(Or, { prefix: u.functionName, value: u.functionParameter })
1478
+ value: /* @__PURE__ */ M(Mr, { prefix: u.functionName, value: u.functionParameter })
1479
1479
  }
1480
1480
  ),
1481
1481
  /* @__PURE__ */ M(
@@ -1496,36 +1496,36 @@ function _i(e) {
1496
1496
  ] })
1497
1497
  ] });
1498
1498
  }
1499
- function Ri() {
1500
- const e = Io(), [t, n] = V(!0), [o, r] = V(!1), [s, i] = V(null);
1501
- T(dn);
1502
- const c = T(dt), l = T(Ye), g = T(ne), m = T(me);
1499
+ function bi() {
1500
+ const e = bo(), [t, n] = V(!0), [o, r] = V(!1), [s, i] = V(null);
1501
+ T(fn);
1502
+ const c = T(dt), l = T(Ge), g = T(ne), m = T(me);
1503
1503
  function h() {
1504
1504
  n(!t), r(!o);
1505
1505
  }
1506
1506
  function d() {
1507
- const u = pr(g);
1507
+ const u = vr(g);
1508
1508
  if (!u) return;
1509
- m.executeCommand(sr.id, {
1509
+ m.executeCommand(cr.id, {
1510
1510
  visible: !0,
1511
1511
  unitId: u.unitId,
1512
- eventType: Oe.Dblclick
1512
+ eventType: xe.Dblclick
1513
1513
  });
1514
- const a = l.getEditor(an), v = l.getEditor(tr), p = `=${s == null ? void 0 : s.functionName}(`;
1514
+ const a = l.getEditor(un), v = l.getEditor(rr), p = `=${s == null ? void 0 : s.functionName}(`;
1515
1515
  a == null || a.replaceText(p), v == null || v.replaceText(p, !1);
1516
1516
  }
1517
- return /* @__PURE__ */ W(
1517
+ return /* @__PURE__ */ H(
1518
1518
  "div",
1519
1519
  {
1520
1520
  "data-u-comp": "sheets-formula-functions-panel",
1521
1521
  className: "univer-box-border univer-flex univer-h-full univer-flex-col univer-justify-between univer-py-2",
1522
1522
  children: [
1523
- t && /* @__PURE__ */ M(_i, { onChange: i }),
1524
- o && /* @__PURE__ */ M(ui, { functionInfo: s, onChange: () => {
1523
+ t && /* @__PURE__ */ M(Ei, { onChange: i }),
1524
+ o && /* @__PURE__ */ M(fi, { functionInfo: s, onChange: () => {
1525
1525
  } }),
1526
- /* @__PURE__ */ W("div", { className: "univer-flex univer-justify-end", children: [
1526
+ /* @__PURE__ */ H("div", { className: "univer-flex univer-justify-end", children: [
1527
1527
  o && /* @__PURE__ */ M(
1528
- ct,
1528
+ at,
1529
1529
  {
1530
1530
  variant: "primary",
1531
1531
  onClick: h,
@@ -1533,9 +1533,9 @@ function Ri() {
1533
1533
  children: c.t("formula.moreFunctions.next")
1534
1534
  }
1535
1535
  ),
1536
- 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") }),
1536
+ 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") }),
1537
1537
  t && !!e && /* @__PURE__ */ M(
1538
- ct,
1538
+ at,
1539
1539
  {
1540
1540
  variant: "primary",
1541
1541
  onClick: d,
@@ -1548,263 +1548,263 @@ function Ri() {
1548
1548
  }
1549
1549
  );
1550
1550
  }
1551
- function Ii(e) {
1551
+ function yi(e) {
1552
1552
  return {
1553
1553
  id: pe.id,
1554
1554
  title: "SUM",
1555
1555
  icon: "SumIcon",
1556
- type: Qe.BUTTON,
1556
+ type: Je.BUTTON,
1557
1557
  params: {
1558
1558
  value: "SUM"
1559
1559
  },
1560
- hidden$: ft(e, H.UNIVER_SHEET),
1561
- disabled$: Ke(e, {
1562
- workbookTypes: [Xe],
1563
- worksheetTypes: [Ze, Ge],
1564
- rangeTypes: [ze]
1560
+ hidden$: ft(e, W.UNIVER_SHEET),
1561
+ disabled$: Ye(e, {
1562
+ workbookTypes: [Qe],
1563
+ worksheetTypes: [ze, Ze],
1564
+ rangeTypes: [Xe]
1565
1565
  })
1566
1566
  };
1567
1567
  }
1568
- function Ei(e) {
1568
+ function Ti(e) {
1569
1569
  return {
1570
1570
  id: pe.id,
1571
1571
  title: "COUNT",
1572
1572
  icon: "CntIcon",
1573
- type: Qe.BUTTON,
1573
+ type: Je.BUTTON,
1574
1574
  params: {
1575
1575
  value: "COUNT"
1576
1576
  },
1577
- hidden$: ft(e, H.UNIVER_SHEET),
1578
- disabled$: Ke(e, {
1579
- workbookTypes: [Xe],
1580
- worksheetTypes: [Ze, Ge],
1581
- rangeTypes: [ze]
1577
+ hidden$: ft(e, W.UNIVER_SHEET),
1578
+ disabled$: Ye(e, {
1579
+ workbookTypes: [Qe],
1580
+ worksheetTypes: [ze, Ze],
1581
+ rangeTypes: [Xe]
1582
1582
  })
1583
1583
  };
1584
1584
  }
1585
- function bi(e) {
1585
+ function Ni(e) {
1586
1586
  return {
1587
1587
  id: pe.id,
1588
1588
  title: "AVERAGE",
1589
1589
  icon: "AvgIcon",
1590
- type: Qe.BUTTON,
1590
+ type: Je.BUTTON,
1591
1591
  params: {
1592
1592
  value: "AVERAGE"
1593
1593
  },
1594
- hidden$: ft(e, H.UNIVER_SHEET),
1595
- disabled$: Ke(e, {
1596
- workbookTypes: [Xe],
1597
- worksheetTypes: [Ze, Ge],
1598
- rangeTypes: [ze]
1594
+ hidden$: ft(e, W.UNIVER_SHEET),
1595
+ disabled$: Ye(e, {
1596
+ workbookTypes: [Qe],
1597
+ worksheetTypes: [ze, Ze],
1598
+ rangeTypes: [Xe]
1599
1599
  })
1600
1600
  };
1601
1601
  }
1602
- function yi(e) {
1602
+ function Oi(e) {
1603
1603
  return {
1604
1604
  id: pe.id,
1605
1605
  title: "MAX",
1606
1606
  icon: "MaxIcon",
1607
- type: Qe.BUTTON,
1607
+ type: Je.BUTTON,
1608
1608
  params: {
1609
1609
  value: "MAX"
1610
1610
  },
1611
- hidden$: ft(e, H.UNIVER_SHEET),
1612
- disabled$: Ke(e, {
1613
- workbookTypes: [Xe],
1614
- worksheetTypes: [Ze, Ge],
1615
- rangeTypes: [ze]
1611
+ hidden$: ft(e, W.UNIVER_SHEET),
1612
+ disabled$: Ye(e, {
1613
+ workbookTypes: [Qe],
1614
+ worksheetTypes: [ze, Ze],
1615
+ rangeTypes: [Xe]
1616
1616
  })
1617
1617
  };
1618
1618
  }
1619
- function Ti(e) {
1619
+ function xi(e) {
1620
1620
  return {
1621
1621
  id: pe.id,
1622
1622
  title: "MIN",
1623
1623
  icon: "MinIcon",
1624
- type: Qe.BUTTON,
1624
+ type: Je.BUTTON,
1625
1625
  params: {
1626
1626
  value: "MIN"
1627
1627
  },
1628
- hidden$: ft(e, H.UNIVER_SHEET),
1629
- disabled$: Ke(e, {
1630
- workbookTypes: [Xe],
1631
- worksheetTypes: [Ze, Ge],
1632
- rangeTypes: [ze]
1628
+ hidden$: ft(e, W.UNIVER_SHEET),
1629
+ disabled$: Ye(e, {
1630
+ workbookTypes: [Qe],
1631
+ worksheetTypes: [ze, Ze],
1632
+ rangeTypes: [Xe]
1633
1633
  })
1634
1634
  };
1635
1635
  }
1636
- function Ni(e) {
1636
+ function Mi(e) {
1637
1637
  return {
1638
- id: Cn.id,
1638
+ id: Rn.id,
1639
1639
  title: "formula.insert.more",
1640
1640
  tooltip: "formula.insert.tooltip",
1641
- type: Qe.BUTTON,
1642
- hidden$: ft(e, H.UNIVER_SHEET),
1643
- disabled$: Ke(e, {
1644
- workbookTypes: [Xe],
1645
- worksheetTypes: [Ze, Ge],
1646
- rangeTypes: [ze]
1641
+ type: Je.BUTTON,
1642
+ hidden$: ft(e, W.UNIVER_SHEET),
1643
+ disabled$: Ye(e, {
1644
+ workbookTypes: [Qe],
1645
+ worksheetTypes: [ze, Ze],
1646
+ rangeTypes: [Xe]
1647
1647
  })
1648
1648
  };
1649
1649
  }
1650
- function Oi(e) {
1651
- return e.get(ne).getCurrentTypeOfUnit$(H.UNIVER_SHEET).pipe(
1652
- qo((o) => o ? e.get(qn) ? new jo((s) => s.next(!e.get(qn).supportClipboard)) : Pn(!0) : Pn(!0))
1650
+ function wi(e) {
1651
+ return e.get(ne).getCurrentTypeOfUnit$(W.UNIVER_SHEET).pipe(
1652
+ Ko((o) => o ? e.get(Kn) ? new Yo((s) => s.next(!e.get(Kn).supportClipboard)) : Vn(!0) : Vn(!0))
1653
1653
  );
1654
1654
  }
1655
- function xi(e) {
1655
+ function ki(e) {
1656
1656
  return {
1657
- id: vn.id,
1658
- type: Qe.BUTTON,
1657
+ id: _n.id,
1658
+ type: Je.BUTTON,
1659
1659
  title: "formula.operation.pasteFormula",
1660
- disabled$: Oi(e).pipe(
1661
- Bo(Ke(e, {
1662
- workbookTypes: [Xe],
1663
- rangeTypes: [ze],
1664
- worksheetTypes: [Ge, Ze]
1660
+ disabled$: wi(e).pipe(
1661
+ jo(Ye(e, {
1662
+ workbookTypes: [Qe],
1663
+ rangeTypes: [Xe],
1664
+ worksheetTypes: [Ze, ze]
1665
1665
  })),
1666
- hr(([t, n]) => t || n)
1666
+ gr(([t, n]) => t || n)
1667
1667
  )
1668
1668
  };
1669
1669
  }
1670
- const Mi = {
1671
- [jn.BASIC]: {
1670
+ const Ai = {
1671
+ [Yn.BASIC]: {
1672
1672
  [`${pe.id}.sum`]: {
1673
1673
  order: 0,
1674
- menuItemFactory: Ii
1674
+ menuItemFactory: yi
1675
1675
  },
1676
1676
  [`${pe.id}.count`]: {
1677
1677
  order: 1,
1678
- menuItemFactory: Ei
1678
+ menuItemFactory: Ti
1679
1679
  },
1680
1680
  [`${pe.id}.average`]: {
1681
1681
  order: 2,
1682
- menuItemFactory: bi
1682
+ menuItemFactory: Ni
1683
1683
  },
1684
1684
  [`${pe.id}.max`]: {
1685
1685
  order: 3,
1686
- menuItemFactory: yi
1686
+ menuItemFactory: Oi
1687
1687
  },
1688
1688
  [`${pe.id}.min`]: {
1689
1689
  order: 4,
1690
- menuItemFactory: Ti
1690
+ menuItemFactory: xi
1691
1691
  }
1692
1692
  },
1693
- [jn.OTHERS]: {
1694
- [Cn.id]: {
1693
+ [Yn.OTHERS]: {
1694
+ [Rn.id]: {
1695
1695
  order: 0,
1696
- menuItemFactory: Ni
1696
+ menuItemFactory: Mi
1697
1697
  }
1698
1698
  },
1699
- [Eo]: {
1700
- [vn.id]: {
1699
+ [yo]: {
1700
+ [_n.id]: {
1701
1701
  order: 4,
1702
- menuItemFactory: xi
1702
+ menuItemFactory: ki
1703
1703
  }
1704
1704
  }
1705
- }, wi = "meta_key_ctrl_And_Shift";
1706
- function ki(e) {
1707
- return e.getContextValue(ro) && e.getContextValue(oo);
1708
- }
1709
- const zt = [
1710
- L.ARROW_DOWN,
1711
- L.ARROW_UP,
1712
- L.ARROW_LEFT,
1713
- L.ARROW_RIGHT
1714
- ], Ai = [...zt, L.ENTER, L.TAB, L.ESC];
1715
- function Fi() {
1705
+ }, Fi = "meta_key_ctrl_And_Shift";
1706
+ function Di(e) {
1707
+ return e.getContextValue(so) && e.getContextValue(io);
1708
+ }
1709
+ const Xt = [
1710
+ $.ARROW_DOWN,
1711
+ $.ARROW_UP,
1712
+ $.ARROW_LEFT,
1713
+ $.ARROW_RIGHT
1714
+ ], $i = [...Xt, $.ENTER, $.TAB, $.ESC];
1715
+ function Li() {
1716
1716
  const e = [];
1717
- for (const t of Ai)
1717
+ for (const t of $i)
1718
1718
  e.push({
1719
1719
  id: gt.id,
1720
1720
  binding: t,
1721
- preconditions: (n) => Et(n),
1721
+ preconditions: (n) => bt(n),
1722
1722
  staticParameters: {
1723
- eventType: Oe.Keyboard,
1723
+ eventType: xe.Keyboard,
1724
1724
  keycode: t
1725
1725
  }
1726
1726
  });
1727
1727
  return e;
1728
1728
  }
1729
- function Di() {
1729
+ function Pi() {
1730
1730
  const e = [];
1731
- for (const t of zt)
1731
+ for (const t of Xt)
1732
1732
  e.push({
1733
1733
  id: gt.id,
1734
1734
  binding: t | P.SHIFT,
1735
- preconditions: (n) => Et(n),
1735
+ preconditions: (n) => bt(n),
1736
1736
  staticParameters: {
1737
- eventType: Oe.Keyboard,
1737
+ eventType: xe.Keyboard,
1738
1738
  keycode: t,
1739
1739
  metaKey: P.SHIFT
1740
1740
  }
1741
1741
  });
1742
1742
  return e;
1743
1743
  }
1744
- function Li() {
1744
+ function Ui() {
1745
1745
  const e = [];
1746
- for (const t of zt)
1746
+ for (const t of Xt)
1747
1747
  e.push({
1748
1748
  id: gt.id,
1749
1749
  binding: t | P.CTRL_COMMAND,
1750
- preconditions: (n) => Et(n),
1750
+ preconditions: (n) => bt(n),
1751
1751
  staticParameters: {
1752
- eventType: Oe.Keyboard,
1752
+ eventType: xe.Keyboard,
1753
1753
  keycode: t,
1754
1754
  metaKey: P.CTRL_COMMAND
1755
1755
  }
1756
1756
  });
1757
1757
  return e;
1758
1758
  }
1759
- function $i() {
1759
+ function Vi() {
1760
1760
  const e = [];
1761
- for (const t of zt)
1761
+ for (const t of Xt)
1762
1762
  e.push({
1763
1763
  id: gt.id,
1764
1764
  binding: t | P.SHIFT | P.CTRL_COMMAND,
1765
- preconditions: (n) => Et(n),
1765
+ preconditions: (n) => bt(n),
1766
1766
  staticParameters: {
1767
- eventType: Oe.Keyboard,
1767
+ eventType: xe.Keyboard,
1768
1768
  keycode: t,
1769
- metaKey: wi
1769
+ metaKey: Fi
1770
1770
  }
1771
1771
  });
1772
1772
  return e;
1773
1773
  }
1774
- const Pi = {
1775
- id: br.id,
1776
- binding: L.F4,
1777
- preconditions: (e) => Et(e)
1774
+ const Wi = {
1775
+ id: Tr.id,
1776
+ binding: $.F4,
1777
+ preconditions: (e) => bt(e)
1778
1778
  };
1779
- function Ui() {
1779
+ function Hi() {
1780
1780
  const e = [];
1781
- for (const t of [L.ENTER, L.TAB, L.ARROW_DOWN, L.ARROW_UP])
1781
+ for (const t of [$.ENTER, $.TAB, $.ARROW_DOWN, $.ARROW_UP])
1782
1782
  e.push({
1783
1783
  id: gt.id,
1784
1784
  binding: t,
1785
- preconditions: (n) => ki(n),
1785
+ preconditions: (n) => Di(n),
1786
1786
  staticParameters: {
1787
- eventType: Oe.Keyboard,
1787
+ eventType: xe.Keyboard,
1788
1788
  keycode: t,
1789
1789
  isSingleEditor: !0
1790
1790
  }
1791
1791
  });
1792
1792
  return e;
1793
1793
  }
1794
- const Vi = {
1795
- id: ds.id,
1796
- binding: P.ALT | L.EQUAL,
1797
- preconditions: bo,
1798
- mac: P.CTRL_COMMAND | P.ALT | L.EQUAL,
1794
+ const Bi = {
1795
+ id: fs.id,
1796
+ binding: P.ALT | $.EQUAL,
1797
+ preconditions: To,
1798
+ mac: P.CTRL_COMMAND | P.ALT | $.EQUAL,
1799
1799
  description: "shortcut.sheets-formula-ui.quick-sum",
1800
1800
  group: "4_sheet-edit"
1801
1801
  };
1802
- var Wi = Object.getOwnPropertyDescriptor, Hi = (e, t, n, o) => {
1803
- for (var r = o > 1 ? void 0 : o ? Wi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
1802
+ var qi = Object.getOwnPropertyDescriptor, ji = (e, t, n, o) => {
1803
+ for (var r = o > 1 ? void 0 : o ? qi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
1804
1804
  (i = e[s]) && (r = i(r) || r);
1805
1805
  return r;
1806
1806
  }, Be = (e, t) => (n, o) => t(n, o, e);
1807
- let Ht = class extends ut {
1807
+ let Bt = class extends Ke {
1808
1808
  constructor(e, t, n, o, r, s, i) {
1809
1809
  super(), this._injector = e, this._menuManagerService = t, this._commandService = n, this._shortcutService = o, this._uiPartsService = r, this._renderManagerService = s, this._componentManager = i, this._initialize();
1810
1810
  }
@@ -1812,51 +1812,74 @@ let Ht = class extends ut {
1812
1812
  this._registerCommands(), this._registerMenus(), this._registerShortcuts(), this._registerComponents(), this._registerRenderModules();
1813
1813
  }
1814
1814
  _registerMenus() {
1815
- this._menuManagerService.mergeMenu(Mi);
1815
+ this._menuManagerService.mergeMenu(Ai);
1816
1816
  }
1817
1817
  _registerCommands() {
1818
1818
  [
1819
- vn,
1819
+ _n,
1820
1820
  pe,
1821
- Cn,
1822
- Ps,
1823
- ws,
1821
+ Rn,
1822
+ Ws,
1823
+ Fs,
1824
1824
  gt,
1825
- br
1825
+ Tr
1826
1826
  ].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e)));
1827
1827
  }
1828
1828
  _registerShortcuts() {
1829
1829
  [
1830
- ...Fi(),
1831
- ...Di(),
1832
1830
  ...Li(),
1833
- ...$i(),
1831
+ ...Pi(),
1834
1832
  ...Ui(),
1835
- Vi,
1836
- Pi
1833
+ ...Vi(),
1834
+ ...Hi(),
1835
+ Bi,
1836
+ Wi
1837
1837
  ].forEach((e) => {
1838
1838
  this.disposeWithMe(this._shortcutService.registerShortcut(e));
1839
1839
  });
1840
1840
  }
1841
1841
  _registerComponents() {
1842
- this.disposeWithMe(this._uiPartsService.registerComponent(yo.FORMULA_AUX, () => Cr(ai, this._injector))), this._componentManager.register(Er, Ri);
1842
+ this.disposeWithMe(this._uiPartsService.registerComponent(No.FORMULA_AUX, () => Rr(di, this._injector))), this._componentManager.register(yr, bi);
1843
1843
  }
1844
1844
  _registerRenderModules() {
1845
- this.disposeWithMe(this._renderManagerService.registerRenderModule(H.UNIVER_SHEET, [Vt]));
1845
+ this.disposeWithMe(this._renderManagerService.registerRenderModule(W.UNIVER_SHEET, [Wt]));
1846
1846
  }
1847
1847
  };
1848
- Ht = Hi([
1848
+ Bt = ji([
1849
1849
  Be(0, q(Rt)),
1850
- Be(1, ms),
1850
+ Be(1, vs),
1851
1851
  Be(2, me),
1852
- Be(3, Gt),
1853
- Be(4, Sr),
1854
- Be(5, xe),
1855
- Be(6, q(vr))
1856
- ], Ht);
1857
- class Lr {
1852
+ Be(3, Zt),
1853
+ Be(4, Cr),
1854
+ Be(5, Re),
1855
+ Be(6, q(_r))
1856
+ ], Bt);
1857
+ var Ki = Object.getOwnPropertyDescriptor, Yi = (e, t, n, o) => {
1858
+ for (var r = o > 1 ? void 0 : o ? Ki(t, n) : t, s = e.length - 1, i; s >= 0; s--)
1859
+ (i = e[s]) && (r = i(r) || r);
1860
+ return r;
1861
+ }, tn = (e, t) => (n, o) => t(n, o, e);
1862
+ let qt = class extends Ke {
1863
+ constructor(e, t, n) {
1864
+ super(), this._imageFormulaCellInterceptorController = e, this._renderManagerService = t, this._univerInstanceService = n, this._imageFormulaCellInterceptorController.registerRefreshRenderFunction(() => {
1865
+ const o = this._univerInstanceService.getCurrentUnitOfType(W.UNIVER_SHEET);
1866
+ if (!o) return;
1867
+ const r = this._renderManagerService.getRenderById(o.getUnitId());
1868
+ if (!r) return;
1869
+ r.with(Et).reCalculate();
1870
+ const s = r.mainComponent;
1871
+ s && s.makeDirty();
1872
+ });
1873
+ }
1874
+ };
1875
+ qt = Yi([
1876
+ tn(0, q(gs)),
1877
+ tn(1, Re),
1878
+ tn(2, ne)
1879
+ ], qt);
1880
+ class Pr {
1858
1881
  constructor() {
1859
- j(this, "_currentSelector$", new fr(null));
1882
+ j(this, "_currentSelector$", new mr(null));
1860
1883
  j(this, "currentSelector$", this._currentSelector$.asObservable());
1861
1884
  }
1862
1885
  showRangeSelectorDialog(t) {
@@ -1868,12 +1891,12 @@ class Lr {
1868
1891
  return this._currentSelector$.next(t), o;
1869
1892
  }
1870
1893
  }
1871
- var Bi = Object.getOwnPropertyDescriptor, qi = (e, t, n, o) => {
1872
- for (var r = o > 1 ? void 0 : o ? Bi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
1894
+ var Gi = Object.getOwnPropertyDescriptor, Zi = (e, t, n, o) => {
1895
+ for (var r = o > 1 ? void 0 : o ? Gi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
1873
1896
  (i = e[s]) && (r = i(r) || r);
1874
1897
  return r;
1875
- }, st = (e, t) => (n, o) => t(n, o, e);
1876
- let De = class extends To {
1898
+ }, it = (e, t) => (n, o) => t(n, o, e);
1899
+ let De = class extends Oo {
1877
1900
  constructor(t, n, o, r, s, i, c) {
1878
1901
  super(
1879
1902
  n,
@@ -1884,7 +1907,7 @@ let De = class extends To {
1884
1907
  );
1885
1908
  j(this, "_workbookSelections");
1886
1909
  j(this, "_eventDisposables");
1887
- 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;
1910
+ 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(zi(this._themeService)), this._remainLastEnabled = !0, this._highlightHeader = !1;
1888
1911
  }
1889
1912
  getLocation() {
1890
1913
  return this._skeleton.getLocation();
@@ -1908,7 +1931,7 @@ let De = class extends To {
1908
1931
  * Call this method and user will be able to select on the canvas to update selections.
1909
1932
  */
1910
1933
  enableSelectionChanging() {
1911
- return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(), rr(() => this._disableSelectionChanging());
1934
+ return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(), sr(() => this._disableSelectionChanging());
1912
1935
  }
1913
1936
  _disableSelectionChanging() {
1914
1937
  var t;
@@ -1924,16 +1947,16 @@ let De = class extends To {
1924
1947
  })), c.add(
1925
1948
  n == null ? void 0 : n.onPointerDown$.subscribeEvent((l, g) => {
1926
1949
  if (!this.inRefSelectionMode()) return;
1927
- const m = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: h } = An(l.offsetX, l.offsetY, i, m);
1928
- 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());
1950
+ const m = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: h } = Dn(l.offsetX, l.offsetY, i, m);
1951
+ $n(this._workbookSelections.getCurrentSelections(), h, ve.ROW) || (this._onPointerDown(l, (r.zIndex || 1) + 1, ve.ROW, this._getActiveViewport(l), Qt.Y), l.button !== 2 && g.stopPropagation());
1929
1952
  })
1930
1953
  ), c.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((l, g) => {
1931
1954
  if (!this.inRefSelectionMode()) return;
1932
- const m = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: h } = An(l.offsetX, l.offsetY, i, m);
1933
- 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());
1955
+ const m = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: h } = Dn(l.offsetX, l.offsetY, i, m);
1956
+ $n(this._workbookSelections.getCurrentSelections(), h, ve.COLUMN) || (this._onPointerDown(l, (r.zIndex || 1) + 1, ve.COLUMN, this._getActiveViewport(l), Qt.X), l.button !== 2 && g.stopPropagation());
1934
1957
  })), c.add(s == null ? void 0 : s.onPointerDown$.subscribeEvent((l, g) => {
1935
1958
  if (this._reset(), !this.inRefSelectionMode()) return;
1936
- const m = this._sheetSkeletonManagerService.getCurrent().skeleton, h = No(m);
1959
+ const m = this._sheetSkeletonManagerService.getCurrent().skeleton, h = xo(m);
1937
1960
  this._addSelectionControlByModelData(h), this._selectionMoveStart$.next(this.getSelectionDataWithStyle());
1938
1961
  const d = i.onPointerUp$.subscribeEvent(() => {
1939
1962
  d.unsubscribe(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle());
@@ -1948,7 +1971,7 @@ let De = class extends To {
1948
1971
  */
1949
1972
  _addSelectionControlByModelData(t) {
1950
1973
  var i;
1951
- const n = this._skeleton, o = (i = t.style) != null ? i : ar(this._themeService), r = this._scene;
1974
+ const n = this._skeleton, o = (i = t.style) != null ? i : ur(this._themeService), r = this._scene;
1952
1975
  return t.style = o, this.newSelectionControl(r, n, t);
1953
1976
  }
1954
1977
  _initSelectionChangeListener() {
@@ -1961,18 +1984,18 @@ let De = class extends To {
1961
1984
  */
1962
1985
  _initUserActionSyncListener() {
1963
1986
  this.disposeWithMe(this.selectionMoveStart$.subscribe((t) => {
1964
- this._updateSelections(t, Qt.MOVE_START);
1987
+ this._updateSelections(t, Jt.MOVE_START);
1965
1988
  })), this.disposeWithMe(this.selectionMoving$.subscribe((t) => {
1966
- this._updateSelections(t, Qt.MOVING);
1989
+ this._updateSelections(t, Jt.MOVING);
1967
1990
  })), this.disposeWithMe(this.selectionMoveEnd$.subscribe((t) => {
1968
- this._updateSelections(t, Qt.MOVE_END);
1991
+ this._updateSelections(t, Jt.MOVE_END);
1969
1992
  }));
1970
1993
  }
1971
1994
  _updateSelections(t, n) {
1972
1995
  const r = this._context.unit.getActiveSheet().getSheetId();
1973
1996
  t.length !== 0 && this._workbookSelections.setSelections(
1974
1997
  r,
1975
- t.map((s) => cs(s)),
1998
+ t.map((s) => ls(s)),
1976
1999
  n
1977
2000
  );
1978
2001
  }
@@ -1981,7 +2004,7 @@ let De = class extends To {
1981
2004
  var i;
1982
2005
  if (!t)
1983
2006
  return;
1984
- const { skeleton: n } = t, { scene: o } = this._context, r = o.getViewport(Vn.VIEW_MAIN);
2007
+ const { skeleton: n } = t, { scene: o } = this._context, r = o.getViewport(Hn.VIEW_MAIN);
1985
2008
  this._skeleton && ((i = this._skeleton.worksheet) == null ? void 0 : i.getSheetId()) !== n.worksheet.getSheetId() && this._reset(), this._changeRuntime(n, o, r);
1986
2009
  const s = this._workbookSelections.getCurrentSelections();
1987
2010
  this.resetSelectionsByModelData(s);
@@ -1989,10 +2012,10 @@ let De = class extends To {
1989
2012
  }
1990
2013
  _getActiveViewport(t) {
1991
2014
  const n = this._getSheetObject();
1992
- return n == null ? void 0 : n.scene.getActiveViewportByCoord(Wn.FromArray([t.offsetX, t.offsetY]));
2015
+ return n == null ? void 0 : n.scene.getActiveViewportByCoord(Bn.FromArray([t.offsetX, t.offsetY]));
1993
2016
  }
1994
2017
  _getSheetObject() {
1995
- return Oo(this._context.unit, this._context);
2018
+ return Mo(this._context.unit, this._context);
1996
2019
  }
1997
2020
  /**
1998
2021
  * Handle pointer down event, bind pointermove & pointerup handler.
@@ -2005,16 +2028,16 @@ let De = class extends To {
2005
2028
  * @param scrollTimerType
2006
2029
  */
2007
2030
  // eslint-disable-next-line complexity, max-lines-per-function
2008
- _onPointerDown(t, n = 0, o = ve.NORMAL, r, s = Xt.ALL) {
2031
+ _onPointerDown(t, n = 0, o = ve.NORMAL, r, s = Qt.ALL) {
2009
2032
  var N;
2010
2033
  this._rangeType = o;
2011
2034
  const i = this._skeleton, c = this._scene;
2012
2035
  if (!c || !i)
2013
2036
  return;
2014
2037
  r && (this._activeViewport = r);
2015
- const { offsetX: l, offsetY: g } = t, m = c.getViewport(Vn.VIEW_MAIN);
2038
+ const { offsetX: l, offsetY: g } = t, m = c.getViewport(Hn.VIEW_MAIN);
2016
2039
  if (!m) return;
2017
- const h = c.getCoordRelativeToViewport(Wn.FromArray([l, g])), { x: d, y: u } = h;
2040
+ const h = c.getCoordRelativeToViewport(Bn.FromArray([l, g])), { x: d, y: u } = h;
2018
2041
  this._startViewportPosX = d, this._startViewportPosY = u;
2019
2042
  const a = c.getScrollXYInfoByViewport(h), { scaleX: v, scaleY: p } = c.getAncestorScale(), S = this._skeleton.getCellByOffset(d, u, v, p, a);
2020
2043
  if (!S) return;
@@ -2032,13 +2055,13 @@ let De = class extends To {
2032
2055
  }
2033
2056
  const C = { range: S, primary: S, style: null };
2034
2057
  C.range.rangeType = o;
2035
- const _ = tn(C, this._skeleton);
2058
+ const _ = rn(C, this._skeleton);
2036
2059
  this._startRangeWhenPointerDown = { ..._.rangeWithCoord };
2037
2060
  const E = { ..._.rangeWithCoord, rangeType: o };
2038
2061
  let f = this.getActiveSelectionControl();
2039
2062
  const b = this.getSelectionControls();
2040
2063
  for (const O of b) {
2041
- if (t.button === 2 && er.contains(O.model, E)) {
2064
+ if (t.button === 2 && nr.contains(O.model, E)) {
2042
2065
  f = O;
2043
2066
  return;
2044
2067
  }
@@ -2072,12 +2095,12 @@ let De = class extends To {
2072
2095
  * @returns {SelectionControl} selectionControl just created
2073
2096
  */
2074
2097
  newSelectionControl(t, n, o) {
2075
- const r = this.getSelectionControls().length, { rowHeaderWidth: s, columnHeaderHeight: i } = n, c = new cr(t, r, this._themeService, {
2098
+ const r = this.getSelectionControls().length, { rowHeaderWidth: s, columnHeaderHeight: i } = n, c = new lr(t, r, this._themeService, {
2076
2099
  highlightHeader: this._highlightHeader,
2077
2100
  enableAutoFill: !1,
2078
2101
  rowHeaderWidth: s,
2079
2102
  columnHeaderHeight: i
2080
- }), l = tn(o, n);
2103
+ }), l = rn(o, n);
2081
2104
  return c.updateRangeBySelectionWithCoord(l), this._selectionControls.push(c), c.setControlExtension({
2082
2105
  skeleton: n,
2083
2106
  scene: t,
@@ -2091,19 +2114,19 @@ let De = class extends To {
2091
2114
  }), c;
2092
2115
  }
2093
2116
  };
2094
- De = qi([
2095
- st(1, q(Rt)),
2096
- st(2, q(It)),
2097
- st(3, Gt),
2098
- st(4, q(jt)),
2099
- st(5, cn),
2100
- st(6, Kt)
2117
+ De = Zi([
2118
+ it(1, q(Rt)),
2119
+ it(2, q(It)),
2120
+ it(3, Zt),
2121
+ it(4, q(Et)),
2122
+ it(5, ln),
2123
+ it(6, Yt)
2101
2124
  ], De);
2102
- function ji(e) {
2103
- const t = ar(e);
2125
+ function zi(e) {
2126
+ const t = ur(e);
2104
2127
  return t.widgets = { tl: !0, tc: !0, tr: !0, ml: !0, mr: !0, bl: !0, bc: !0, br: !0 }, t;
2105
2128
  }
2106
- const _n = (e, t, n = !0) => {
2129
+ const In = (e, t, n = !0) => {
2107
2130
  let o = -1;
2108
2131
  return e.reduce((r, s, i) => {
2109
2132
  if (r.isFinish)
@@ -2117,7 +2140,7 @@ const _n = (e, t, n = !0) => {
2117
2140
  }
2118
2141
  return (n ? r.currentIndex === t : t > c && t <= r.currentIndex) && (o = i, r.isFinish = !0), r;
2119
2142
  }, { currentIndex: 0, isFinish: !1 }), o;
2120
- }, $r = (e, t) => {
2143
+ }, Ur = (e, t) => {
2121
2144
  const n = e[t];
2122
2145
  let o = -1;
2123
2146
  if (!n || typeof n == "string" || n.nodeType !== Q.REFERENCE) return -1;
@@ -2126,8 +2149,8 @@ const _n = (e, t, n = !0) => {
2126
2149
  typeof s != "string" && s.nodeType === Q.REFERENCE && o++;
2127
2150
  }
2128
2151
  return o;
2129
- }, Ki = (e, t = 100) => {
2130
- $(() => {
2152
+ }, Xi = (e, t = 100) => {
2153
+ L(() => {
2131
2154
  let n = null;
2132
2155
  const o = () => {
2133
2156
  n === null && (n = window.setTimeout(() => {
@@ -2139,8 +2162,8 @@ const _n = (e, t, n = !0) => {
2139
2162
  };
2140
2163
  }, [e, t]);
2141
2164
  };
2142
- function Pr(e, t, n) {
2143
- const o = T(Ye), r = ie(() => new fr({ left: -999, top: -999, right: -999, bottom: -999 }), []), s = T(pn), i = T(ne), c = te(() => {
2165
+ function Vr(e, t, n) {
2166
+ const o = T(Ge), r = ie(() => new mr({ left: -999, top: -999, right: -999, bottom: -999 }), []), s = T(vn), i = T(ne), c = te(() => {
2144
2167
  var _;
2145
2168
  const l = o.getEditor(e);
2146
2169
  if (!l)
@@ -2154,30 +2177,30 @@ function Pr(e, t, n) {
2154
2177
  if (!(C.left === a && C.top === v && C.right === p && C.bottom === S))
2155
2178
  return r.next({ left: a - 1, right: p + 1, top: v - 1, bottom: S + 1 }), g;
2156
2179
  });
2157
- return $(() => {
2180
+ return L(() => {
2158
2181
  t && c();
2159
- }, [e, o, i.unitAdded$, c, t, ...n != null ? n : []]), Ki(c), $(() => {
2160
- const l = s.scrollEvent$.pipe(Ko(100)).subscribe(c);
2182
+ }, [e, o, i.unitAdded$, c, t, ...n != null ? n : []]), Xi(c), L(() => {
2183
+ const l = s.scrollEvent$.pipe(Go(100)).subscribe(c);
2161
2184
  return () => {
2162
2185
  l.unsubscribe();
2163
2186
  };
2164
2187
  }, []), [r, c];
2165
2188
  }
2166
- const tt = (e) => {
2189
+ const nt = (e) => {
2167
2190
  const t = z(e);
2168
2191
  return t.current = e, t;
2169
- }, Yi = (e, t, n) => {
2170
- 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);
2192
+ }, Qi = (e, t, n) => {
2193
+ const o = T(zt), r = T(Gt), s = T(_e), [i, c] = V(), [l, g] = V(-1), [m, h] = V(!0), d = nt(m), u = z(t);
2171
2194
  u.current = t;
2172
2195
  const a = () => {
2173
2196
  c(void 0), g(-1), h(!1);
2174
2197
  };
2175
- return $(() => {
2198
+ return L(() => {
2176
2199
  const v = s.sequenceNodesBuilder(t.slice(1));
2177
2200
  o.setSequenceNodes(v != null ? v : []);
2178
- }, [t]), $(() => {
2201
+ }, [t]), L(() => {
2179
2202
  if (n && e) {
2180
- const v = n.selectionChange$.pipe(hn(50)).subscribe((S) => {
2203
+ const v = n.selectionChange$.pipe(gn(50)).subscribe((S) => {
2181
2204
  if (S.textRanges.length === 1) {
2182
2205
  const [C] = S.textRanges;
2183
2206
  if (C.collapsed && d.current) {
@@ -2199,9 +2222,9 @@ const tt = (e) => {
2199
2222
  }
2200
2223
  c(void 0), g(-1);
2201
2224
  }), p = n.selectionChange$.pipe(
2202
- gr((S) => S.textRanges.length === 1),
2203
- hr((S) => S.textRanges[0].startOffset),
2204
- Yo()
2225
+ pr((S) => S.textRanges.length === 1),
2226
+ gr((S) => S.textRanges[0].startOffset),
2227
+ Zo()
2205
2228
  ).subscribe(() => {
2206
2229
  h(!0);
2207
2230
  });
@@ -2209,21 +2232,21 @@ const tt = (e) => {
2209
2232
  v.unsubscribe(), p.unsubscribe();
2210
2233
  };
2211
2234
  }
2212
- }, [n, e]), $(() => {
2235
+ }, [n, e]), L(() => {
2213
2236
  e || a();
2214
2237
  }, [e]), {
2215
2238
  functionInfo: i,
2216
2239
  paramIndex: l,
2217
2240
  reset: a
2218
2241
  };
2219
- }, Gi = ({ onClick: e }) => /* @__PURE__ */ M(
2242
+ }, Ji = ({ onClick: e }) => /* @__PURE__ */ M(
2220
2243
  "div",
2221
2244
  {
2222
2245
  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",
2223
2246
  onClick: e,
2224
2247
  children: "?"
2225
2248
  }
2226
- ), en = ({ className: e, title: t, value: n }) => /* @__PURE__ */ W("div", { className: "univer-my-2", children: [
2249
+ ), nn = ({ className: e, title: t, value: n }) => /* @__PURE__ */ H("div", { className: "univer-my-2", children: [
2227
2250
  /* @__PURE__ */ M(
2228
2251
  "div",
2229
2252
  {
@@ -2238,30 +2261,30 @@ const tt = (e) => {
2238
2261
  children: n
2239
2262
  }
2240
2263
  )
2241
- ] }), Zi = (e) => {
2264
+ ] }), ec = (e) => {
2242
2265
  const { prefix: t, value: n, active: o, onClick: r } = e;
2243
- return /* @__PURE__ */ W("div", { children: [
2244
- /* @__PURE__ */ W("span", { children: [
2266
+ return /* @__PURE__ */ H("div", { children: [
2267
+ /* @__PURE__ */ H("span", { children: [
2245
2268
  t,
2246
2269
  "("
2247
2270
  ] }),
2248
- n && n.map((s, i) => /* @__PURE__ */ W("span", { children: [
2271
+ n && n.map((s, i) => /* @__PURE__ */ H("span", { children: [
2249
2272
  /* @__PURE__ */ M(
2250
2273
  "span",
2251
2274
  {
2252
2275
  className: o === i ? "univer-text-primary-500" : "",
2253
2276
  onClick: () => r(i),
2254
- children: Nr(s)
2277
+ children: xr(s)
2255
2278
  }
2256
2279
  ),
2257
2280
  i === n.length - 1 ? "" : ","
2258
2281
  ] }, s.name)),
2259
2282
  ")"
2260
2283
  ] });
2261
- }, Xn = () => {
2284
+ }, Jn = () => {
2262
2285
  };
2263
- function zi(e) {
2264
- 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]);
2286
+ function tc(e) {
2287
+ const { onParamsSwitch: t = Jn, onClose: n = Jn, isFocus: o, editor: r, formulaText: s } = e, { functionInfo: i, paramIndex: c, reset: l } = Qi(o, s, r), g = T(fn), 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] = Vr(p, !!i, [i, c]);
2265
2288
  function C(f) {
2266
2289
  t && t(f);
2267
2290
  }
@@ -2270,18 +2293,18 @@ function zi(e) {
2270
2293
  }), E = () => {
2271
2294
  _(!0), n();
2272
2295
  };
2273
- 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(
2296
+ return i ? m ? /* @__PURE__ */ M(on, { portal: !0, anchorRect$: S, direction: "left-center", children: /* @__PURE__ */ M(Ji, { onClick: () => _(!1) }) }, "hidden") : /* @__PURE__ */ M(on, { portal: !0, onClickOutside: () => l(), anchorRect$: S, direction: "vertical", children: /* @__PURE__ */ H(
2274
2297
  "div",
2275
2298
  {
2276
- 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),
2299
+ 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", Cn),
2277
2300
  children: [
2278
- /* @__PURE__ */ W(
2301
+ /* @__PURE__ */ H(
2279
2302
  "div",
2280
2303
  {
2281
- 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),
2304
+ 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", Ts),
2282
2305
  children: [
2283
2306
  /* @__PURE__ */ M(
2284
- Zi,
2307
+ ec,
2285
2308
  {
2286
2309
  prefix: i.functionName,
2287
2310
  value: i.functionParameter,
@@ -2289,14 +2312,14 @@ function zi(e) {
2289
2312
  onClick: C
2290
2313
  }
2291
2314
  ),
2292
- /* @__PURE__ */ W("div", { className: "univer-flex", children: [
2315
+ /* @__PURE__ */ H("div", { className: "univer-flex", children: [
2293
2316
  /* @__PURE__ */ M(
2294
2317
  "div",
2295
2318
  {
2296
2319
  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",
2297
2320
  style: { transform: h ? "rotateZ(-90deg)" : "rotateZ(90deg)" },
2298
2321
  onClick: () => d(!h),
2299
- children: /* @__PURE__ */ M(Fr, {})
2322
+ children: /* @__PURE__ */ M($r, {})
2300
2323
  }
2301
2324
  ),
2302
2325
  /* @__PURE__ */ M(
@@ -2304,7 +2327,7 @@ function zi(e) {
2304
2327
  {
2305
2328
  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",
2306
2329
  onClick: E,
2307
- children: /* @__PURE__ */ M(wr, {})
2330
+ children: /* @__PURE__ */ M(Ar, {})
2308
2331
  }
2309
2332
  )
2310
2333
  ] })
@@ -2314,28 +2337,28 @@ function zi(e) {
2314
2337
  /* @__PURE__ */ M(
2315
2338
  "div",
2316
2339
  {
2317
- className: re("univer-box-border univer-max-h-[350px] univer-overflow-y-auto univer-px-4 univer-pb-3 univer-pt-0", lt),
2340
+ className: re("univer-box-border univer-max-h-[350px] univer-overflow-y-auto univer-px-4 univer-pb-3 univer-pt-0", ut),
2318
2341
  style: {
2319
2342
  height: h ? "unset" : 0,
2320
2343
  padding: h ? "revert-layer" : 0
2321
2344
  },
2322
- children: /* @__PURE__ */ W("div", { className: "univer-mt-3", children: [
2345
+ children: /* @__PURE__ */ H("div", { className: "univer-mt-3", children: [
2323
2346
  /* @__PURE__ */ M(
2324
- en,
2347
+ nn,
2325
2348
  {
2326
2349
  title: u.t("formula.prompt.helpExample"),
2327
2350
  value: `${i.functionName}(${i.functionParameter.map((f) => f.example).join(",")})`
2328
2351
  }
2329
2352
  ),
2330
2353
  /* @__PURE__ */ M(
2331
- en,
2354
+ nn,
2332
2355
  {
2333
2356
  title: u.t("formula.prompt.helpAbstract"),
2334
2357
  value: i.description
2335
2358
  }
2336
2359
  ),
2337
2360
  i && i.functionParameter && i.functionParameter.map((f, b) => /* @__PURE__ */ M(
2338
- en,
2361
+ nn,
2339
2362
  {
2340
2363
  className: c === b ? "univer-text-primary-500" : "",
2341
2364
  title: f.name,
@@ -2350,14 +2373,14 @@ function zi(e) {
2350
2373
  }
2351
2374
  ) }, "show") : null;
2352
2375
  }
2353
- const Xi = (e) => {
2354
- const t = T(Ye);
2376
+ const nc = (e) => {
2377
+ const t = T(Ge);
2355
2378
  return te((o) => {
2356
2379
  var r, s;
2357
2380
  if (e) {
2358
2381
  t.focus(e.getEditorId());
2359
2382
  const i = [...e.getSelectionRanges()];
2360
- if (ln.isDefine(o))
2383
+ if (dn.isDefine(o))
2361
2384
  e.setSelectionRanges([{ startOffset: o, endOffset: o }]);
2362
2385
  else if (!i.length && !e.docSelectionRenderService.isOnPointerEvent) {
2363
2386
  const c = (s = (r = e.getDocumentData().body) == null ? void 0 : r.dataStream) != null ? s : `\r
@@ -2368,41 +2391,41 @@ const Xi = (e) => {
2368
2391
  }
2369
2392
  });
2370
2393
  };
2371
- function Qi(e) {
2394
+ function rc(e) {
2372
2395
  var r, s;
2373
2396
  const n = e.get(ne).getCurrentUniverDocInstance();
2374
2397
  return n != null && n.getBody() ? { dataStream: (s = (r = n.getBody()) == null ? void 0 : r.dataStream) != null ? s : "", offset: 0 } : void 0;
2375
2398
  }
2376
- 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 || {});
2377
- function Ji(e) {
2399
+ var Ne = /* @__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))(Ne || {});
2400
+ function oc(e) {
2378
2401
  var y;
2379
- 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(
2402
+ const { editorId: t, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = e, i = T(Re), c = T(ne), l = i.getRenderById(r), g = i.getRenderById(t), m = g == null ? void 0 : g.with(Sr), h = T(Er), d = T(Rt), [u, a] = V(
2380
2403
  0
2381
2404
  /* NOT_SELECT */
2382
- ), 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) => {
2405
+ ), v = T(_e), p = z(!0), S = l == null ? void 0 : l.with(De), C = nt(u), _ = c.getUnit(r, W.UNIVER_SHEET), E = _ == null ? void 0 : _.getSheetBySheetId(s), f = te((A) => {
2383
2406
  S && S.setSkipLastEnabled(
2384
2407
  A === 1 || A === 3 || A === 4
2385
2408
  /* EDIT_OTHER_WORKBOOK_REFERENCE */
2386
2409
  ), C.current = A, a(A);
2387
2410
  }), b = te(() => {
2388
2411
  var ce, ae, he;
2389
- const A = c.getCurrentUnitOfType(H.UNIVER_SHEET);
2412
+ const A = c.getCurrentUnitOfType(W.UNIVER_SHEET);
2390
2413
  if (!A) return;
2391
- const F = A.getActiveSheet(), N = m == null ? void 0 : m.getActiveTextRange(), O = N != null && N.collapsed ? N.startOffset : -1, k = Qi(d);
2414
+ const F = A.getActiveSheet(), N = m == null ? void 0 : m.getActiveTextRange(), O = N != null && N.collapsed ? N.startOffset : -1, k = rc(d);
2392
2415
  if (!k) return;
2393
2416
  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 ? {
2394
2417
  ...K,
2395
- range: Lo(K.token)
2418
+ range: Po(K.token)
2396
2419
  } : {
2397
2420
  ...K,
2398
2421
  range: void 0
2399
- } : 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;
2422
+ } : 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 && Uo(R) && (!w || Vo(w) && w !== je.OPEN_BRACKET), B = !!D;
2400
2423
  if ((I == null ? void 0 : I.substring(0, 1)) === "=" && (U || B))
2401
2424
  if (B) {
2402
2425
  if (p.current)
2403
2426
  return;
2404
- const { sheetName: K, unitId: J } = D.range, nt = (he = c.getCurrentUnitOfType(H.UNIVER_SHEET)) == null ? void 0 : he.getUnitId();
2405
- J && J !== nt ? f(
2427
+ const { sheetName: K, unitId: J } = D.range, rt = (he = c.getCurrentUnitOfType(W.UNIVER_SHEET)) == null ? void 0 : he.getUnitId();
2428
+ J && J !== rt ? f(
2406
2429
  4
2407
2430
  /* EDIT_OTHER_WORKBOOK_REFERENCE */
2408
2431
  ) : !K && F.getSheetId() === (E == null ? void 0 : E.getSheetId()) || K === F.getName() ? f(
@@ -2423,17 +2446,17 @@ function Ji(e) {
2423
2446
  /* NOT_SELECT */
2424
2447
  );
2425
2448
  });
2426
- return $(() => {
2427
- const A = h.textSelection$.pipe(gr((F) => F.unitId === t)).subscribe(() => {
2449
+ return L(() => {
2450
+ const A = h.textSelection$.pipe(pr((F) => F.unitId === t)).subscribe(() => {
2428
2451
  b();
2429
2452
  });
2430
2453
  return () => A.unsubscribe();
2431
- }, [b, h.textSelection$, t]), $(() => {
2454
+ }, [b, h.textSelection$, t]), L(() => {
2432
2455
  n || (f(
2433
2456
  0
2434
2457
  /* NOT_SELECT */
2435
2458
  ), p.current = !0);
2436
- }, [n, f]), $(() => {
2459
+ }, [n, f]), L(() => {
2437
2460
  var F;
2438
2461
  if (!o) return;
2439
2462
  const A = (F = g == null ? void 0 : g.mainComponent) == null ? void 0 : F.onPointerDown$.subscribeEvent(() => {
@@ -2443,11 +2466,11 @@ function Ji(e) {
2443
2466
  ), p.current = !0;
2444
2467
  });
2445
2468
  return () => A == null ? void 0 : A.unsubscribe();
2446
- }, [o, (y = g == null ? void 0 : g.mainComponent) == null ? void 0 : y.onPointerDown$, f]), $(() => {
2469
+ }, [o, (y = g == null ? void 0 : g.mainComponent) == null ? void 0 : y.onPointerDown$, f]), L(() => {
2447
2470
  if (!n) return;
2448
2471
  const A = _ == null ? void 0 : _.activeSheet$.subscribe(() => {
2449
2472
  b();
2450
- }), F = c.getCurrentTypeOfUnit$(H.UNIVER_SHEET).subscribe(() => {
2473
+ }), F = c.getCurrentTypeOfUnit$(W.UNIVER_SHEET).subscribe(() => {
2451
2474
  b();
2452
2475
  });
2453
2476
  return () => {
@@ -2455,12 +2478,12 @@ function Ji(e) {
2455
2478
  };
2456
2479
  }, [b, n, _ == null ? void 0 : _.activeSheet$, c.getCurrentTypeOfUnit$]), { isSelecting: u, isSelectingRef: C };
2457
2480
  }
2458
- const ec = () => {
2481
+ const sc = () => {
2459
2482
  const e = T(_e);
2460
- return Dt((n) => e.sequenceNodesBuilder(n) || [], [e]);
2483
+ return $t((n) => e.sequenceNodesBuilder(n) || [], [e]);
2461
2484
  };
2462
- function tc(e, t, n) {
2463
- const o = new un(t).setAlpha(0.05).toRgbString();
2485
+ function ic(e, t, n) {
2486
+ const o = new hn(t).setAlpha(0.05).toRgbString();
2464
2487
  return {
2465
2488
  id: n,
2466
2489
  strokeWidth: 1,
@@ -2472,7 +2495,7 @@ function tc(e, t, n) {
2472
2495
  widgetStroke: e.getColorFromTheme("white")
2473
2496
  };
2474
2497
  }
2475
- function Ur(e) {
2498
+ function Wr(e) {
2476
2499
  var _, E, f;
2477
2500
  const {
2478
2501
  unitId: t,
@@ -2485,7 +2508,7 @@ function Ur(e) {
2485
2508
  sheetSkeletonManagerService: l,
2486
2509
  themeService: g,
2487
2510
  univerInstanceService: m
2488
- } = e, h = o.getUnitId(), d = m.getUnit(t, H.UNIVER_SHEET), u = d == null ? void 0 : d.getActiveSheet(), a = [];
2511
+ } = e, h = o.getUnitId(), d = m.getUnit(t, W.UNIVER_SHEET), u = d == null ? void 0 : d.getActiveSheet(), a = [];
2489
2512
  if (!d || !u) {
2490
2513
  i.setSelections(a);
2491
2514
  return;
@@ -2500,11 +2523,11 @@ function Ur(e) {
2500
2523
  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);
2501
2524
  if (!D && R || h !== t && x !== h || x && x !== h || D && D !== v || !D && v !== n)
2502
2525
  continue;
2503
- const U = as(w, u.getRowCount(), u.getColumnCount());
2526
+ const U = us(w, u.getRowCount(), u.getColumnCount());
2504
2527
  U.unitId = t, U.sheetId = v, a.push({
2505
2528
  range: U,
2506
2529
  primary: null,
2507
- style: tc(g, F, O.toString())
2530
+ style: ic(g, F, O.toString())
2508
2531
  }), C.push(k);
2509
2532
  }
2510
2533
  if (s) {
@@ -2513,11 +2536,11 @@ function Ur(e) {
2513
2536
  }
2514
2537
  return a;
2515
2538
  }
2516
- function nc(e, t) {
2517
- 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) => {
2518
- const u = n.getCurrentUnitOfType(H.UNIVER_SHEET);
2539
+ function cc(e, t) {
2540
+ const n = T(ne), o = T(It), r = T(Yt), s = T(Re), i = Se(ie(() => n.getCurrentTypeOfUnit$(W.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(Et), m = te((h, d) => {
2541
+ const u = n.getCurrentUnitOfType(W.UNIVER_SHEET);
2519
2542
  if (!u || l != null && l.selectionMoving) return;
2520
- const a = Ur({
2543
+ const a = Wr({
2521
2544
  unitId: e,
2522
2545
  subUnitId: t,
2523
2546
  currentWorkbook: u,
@@ -2532,12 +2555,12 @@ function nc(e, t) {
2532
2555
  if (!a) return;
2533
2556
  ((l == null ? void 0 : l.getSelectionControls()) || []).length === a.length ? l == null || l.resetSelectionsByModelData(a) : r.setSelections(a);
2534
2557
  });
2535
- return $(() => () => {
2558
+ return L(() => () => {
2536
2559
  l == null || l.resetActiveSelectionIndex();
2537
2560
  }, [l]), m;
2538
2561
  }
2539
- function Vr(e = "") {
2540
- const t = T(Yt), n = rc(), o = T(me), r = ie(() => e.length, [e]);
2562
+ function Hr(e = "") {
2563
+ const t = T(Gt), n = ac(), o = T(me), r = ie(() => e.length, [e]);
2541
2564
  return te((i, c, l = !0, g) => {
2542
2565
  const m = i.getDocumentData(), h = i.getEditorId();
2543
2566
  if (!m)
@@ -2548,12 +2571,12 @@ function Vr(e = "") {
2548
2571
  const u = d.dataStream.slice(0, d.dataStream.length - 2), a = { dataStream: "", ...m.body };
2549
2572
  if (!u.startsWith(e)) return [];
2550
2573
  if (c == null || c.length === 0)
2551
- return a.textRuns = [], o.syncExecuteCommand(Un.id, {
2574
+ return a.textRuns = [], o.syncExecuteCommand(Wn.id, {
2552
2575
  unitId: h,
2553
- body: Mn(a, 0, a.dataStream.length - 2)
2576
+ body: kn(a, 0, a.dataStream.length - 2)
2554
2577
  }), [];
2555
2578
  {
2556
- const { textRuns: v, refSelections: p } = oc(t, n, c);
2579
+ const { textRuns: v, refSelections: p } = lc(t, n, c);
2557
2580
  r && v.forEach((_) => {
2558
2581
  _.ed = _.ed + r, _.st = _.st + r;
2559
2582
  }), a.textRuns = [{ st: 0, ed: 1, ts: { fs: 11 } }, ...v];
@@ -2568,15 +2591,15 @@ function Vr(e = "") {
2568
2591
  E.startOffset = Math.max(0, Math.min(E.startOffset, _)), E.endOffset = Math.max(0, Math.min(E.endOffset, _));
2569
2592
  });
2570
2593
  }
2571
- return o.syncExecuteCommand(Un.id, {
2594
+ return o.syncExecuteCommand(Wn.id, {
2572
2595
  unitId: h,
2573
- body: Mn(a, 0, a.dataStream.length - 2),
2596
+ body: kn(a, 0, a.dataStream.length - 2),
2574
2597
  textRanges: g != null ? g : C
2575
2598
  }), p;
2576
2599
  }
2577
2600
  });
2578
2601
  }
2579
- function rc() {
2602
+ function ac() {
2580
2603
  const e = T(It), t = e.getCurrentTheme();
2581
2604
  return ie(() => {
2582
2605
  const o = [
@@ -2596,7 +2619,7 @@ function rc() {
2596
2619
  return { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: i };
2597
2620
  }, [t]);
2598
2621
  }
2599
- function oc(e, t, n) {
2622
+ function lc(e, t, n) {
2600
2623
  const { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: i } = t, c = [], l = [], g = /* @__PURE__ */ new Map();
2601
2624
  let m = 0;
2602
2625
  for (let h = 0, d = n.length; h < d; h++) {
@@ -2668,11 +2691,11 @@ function oc(e, t, n) {
2668
2691
  }
2669
2692
  return { textRuns: c, refSelections: l };
2670
2693
  }
2671
- const sc = (e, t, n, o) => {
2672
- const r = T(me), s = T(Gt), i = z(t);
2694
+ const uc = (e, t, n, o) => {
2695
+ const r = T(me), s = T(Zt), i = z(t);
2673
2696
  i.current = t;
2674
2697
  const c = z(o);
2675
- c.current = o, $(() => {
2698
+ c.current = o, L(() => {
2676
2699
  if (!n || !e)
2677
2700
  return;
2678
2701
  const g = `sheet.formula-embedding-editor.${n.getEditorId()}`, m = new qe(), h = (a, v) => {
@@ -2681,62 +2704,62 @@ const sc = (e, t, n, o) => {
2681
2704
  return;
2682
2705
  }
2683
2706
  let p = de.LEFT;
2684
- 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, {
2707
+ a === $.ARROW_DOWN ? p = de.DOWN : a === $.ARROW_UP ? p = de.UP : a === $.ARROW_RIGHT && (p = de.RIGHT), v === P.SHIFT ? r.executeCommand(Xo.id, {
2685
2708
  direction: p
2686
- }) : r.executeCommand(zo.id, {
2709
+ }) : r.executeCommand(Qo.id, {
2687
2710
  direction: p
2688
2711
  });
2689
2712
  }, d = (a, v) => {
2690
2713
  let p = de.DOWN;
2691
- 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, {
2714
+ a === $.ARROW_DOWN ? p = de.DOWN : a === $.ARROW_UP ? p = de.UP : a === $.ARROW_LEFT ? p = de.LEFT : a === $.ARROW_RIGHT && (p = de.RIGHT), i.current ? v === P.CTRL_COMMAND ? r.executeCommand(Ln.id, {
2692
2715
  direction: p,
2693
- jumpOver: Ln.moveGap,
2716
+ jumpOver: Pn.moveGap,
2694
2717
  extra: "formula-editor",
2695
- fromCurrentSelection: i.current === Te.NEED_ADD || i.current === Te.EDIT_OTHER_SHEET_REFERENCE
2696
- }) : v === P.SHIFT ? r.executeCommand($n.id, {
2718
+ fromCurrentSelection: i.current === Ne.NEED_ADD || i.current === Ne.EDIT_OTHER_SHEET_REFERENCE
2719
+ }) : v === P.SHIFT ? r.executeCommand(Un.id, {
2697
2720
  direction: p,
2698
2721
  extra: "formula-editor"
2699
- }) : v === (P.CTRL_COMMAND | P.SHIFT) ? r.executeCommand($n.id, {
2722
+ }) : v === (P.CTRL_COMMAND | P.SHIFT) ? r.executeCommand(Un.id, {
2700
2723
  direction: p,
2701
- jumpOver: Ln.moveGap,
2724
+ jumpOver: Pn.moveGap,
2702
2725
  extra: "formula-editor"
2703
- }) : r.executeCommand(Dn.id, {
2726
+ }) : r.executeCommand(Ln.id, {
2704
2727
  direction: p,
2705
2728
  extra: "formula-editor",
2706
- fromCurrentSelection: i.current === Te.NEED_ADD || i.current === Te.EDIT_OTHER_SHEET_REFERENCE
2729
+ fromCurrentSelection: i.current === Ne.NEED_ADD || i.current === Ne.EDIT_OTHER_SHEET_REFERENCE
2707
2730
  }) : h(a, v);
2708
2731
  };
2709
2732
  return m.add(r.registerCommand({
2710
2733
  id: g,
2711
- type: Ne.OPERATION,
2734
+ type: Oe.OPERATION,
2712
2735
  handler(a, v) {
2713
2736
  const { keyCode: p, metaKey: S } = v;
2714
2737
  d(p, S);
2715
2738
  }
2716
2739
  })), [
2717
- { keyCode: L.ARROW_DOWN },
2718
- { keyCode: L.ARROW_LEFT },
2719
- { keyCode: L.ARROW_RIGHT },
2720
- { keyCode: L.ARROW_UP },
2721
- { keyCode: L.ARROW_DOWN, metaKey: P.SHIFT },
2722
- { keyCode: L.ARROW_LEFT, metaKey: P.SHIFT },
2723
- { keyCode: L.ARROW_RIGHT, metaKey: P.SHIFT },
2724
- { keyCode: L.ARROW_UP, metaKey: P.SHIFT },
2725
- { keyCode: L.ARROW_DOWN, metaKey: P.CTRL_COMMAND },
2726
- { keyCode: L.ARROW_LEFT, metaKey: P.CTRL_COMMAND },
2727
- { keyCode: L.ARROW_RIGHT, metaKey: P.CTRL_COMMAND },
2728
- { keyCode: L.ARROW_UP, metaKey: P.CTRL_COMMAND },
2729
- { keyCode: L.ARROW_DOWN, metaKey: P.CTRL_COMMAND | P.SHIFT },
2730
- { keyCode: L.ARROW_LEFT, metaKey: P.CTRL_COMMAND | P.SHIFT },
2731
- { keyCode: L.ARROW_RIGHT, metaKey: P.CTRL_COMMAND | P.SHIFT },
2732
- { keyCode: L.ARROW_UP, metaKey: P.CTRL_COMMAND | P.SHIFT }
2740
+ { keyCode: $.ARROW_DOWN },
2741
+ { keyCode: $.ARROW_LEFT },
2742
+ { keyCode: $.ARROW_RIGHT },
2743
+ { keyCode: $.ARROW_UP },
2744
+ { keyCode: $.ARROW_DOWN, metaKey: P.SHIFT },
2745
+ { keyCode: $.ARROW_LEFT, metaKey: P.SHIFT },
2746
+ { keyCode: $.ARROW_RIGHT, metaKey: P.SHIFT },
2747
+ { keyCode: $.ARROW_UP, metaKey: P.SHIFT },
2748
+ { keyCode: $.ARROW_DOWN, metaKey: P.CTRL_COMMAND },
2749
+ { keyCode: $.ARROW_LEFT, metaKey: P.CTRL_COMMAND },
2750
+ { keyCode: $.ARROW_RIGHT, metaKey: P.CTRL_COMMAND },
2751
+ { keyCode: $.ARROW_UP, metaKey: P.CTRL_COMMAND },
2752
+ { keyCode: $.ARROW_DOWN, metaKey: P.CTRL_COMMAND | P.SHIFT },
2753
+ { keyCode: $.ARROW_LEFT, metaKey: P.CTRL_COMMAND | P.SHIFT },
2754
+ { keyCode: $.ARROW_RIGHT, metaKey: P.CTRL_COMMAND | P.SHIFT },
2755
+ { keyCode: $.ARROW_UP, metaKey: P.CTRL_COMMAND | P.SHIFT }
2733
2756
  ].map(({ keyCode: a, metaKey: v }) => ({
2734
2757
  id: g,
2735
2758
  binding: v ? a | v : a,
2736
2759
  preconditions: () => !0,
2737
2760
  priority: 900,
2738
2761
  staticParameters: {
2739
- eventType: Oe.Keyboard,
2762
+ eventType: xe.Keyboard,
2740
2763
  keyCode: a,
2741
2764
  metaKey: v
2742
2765
  }
@@ -2746,88 +2769,88 @@ const sc = (e, t, n, o) => {
2746
2769
  m.dispose();
2747
2770
  };
2748
2771
  }, [r, n, e, s]);
2749
- }, ic = (e, t, n, o, r = !0) => {
2772
+ }, dc = (e, t, n, o, r = !0) => {
2750
2773
  var u;
2751
- 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);
2774
+ const s = T(Re), i = T(ln), c = T(Cs), l = T(Yt), g = T(ne), m = Se(ie(() => g.getCurrentTypeOfUnit$(W.UNIVER_SHEET), [g])), h = s.getRenderById((u = m == null ? void 0 : m.getUnitId()) != null ? u : ""), d = h == null ? void 0 : h.with(De);
2752
2775
  Lt(() => {
2753
2776
  if (e)
2754
- return i.setContextValue(wn, !0), r && c.disable(), () => {
2755
- const a = g.getCurrentUnitOfType(H.UNIVER_DOC);
2756
- (a == null ? void 0 : a.getUnitId()) === o && i.setContextValue(wn, !1), r && c.enable(), l.clear();
2777
+ return i.setContextValue(An, !0), r && c.disable(), () => {
2778
+ const a = g.getCurrentUnitOfType(W.UNIVER_DOC);
2779
+ (a == null ? void 0 : a.getUnitId()) === o && i.setContextValue(An, !1), r && c.enable(), l.clear();
2757
2780
  };
2758
2781
  }, [i, e, l, r, o]), Lt(() => {
2759
2782
  if (e && t) {
2760
2783
  const a = d == null ? void 0 : d.enableSelectionChanging();
2761
- return i.setContextValue(Hn, !0), () => {
2762
- i.setContextValue(Hn, !1), a == null || a.dispose();
2784
+ return i.setContextValue(qn, !0), () => {
2785
+ i.setContextValue(qn, !1), a == null || a.dispose();
2763
2786
  };
2764
2787
  }
2765
- }, [i, e, d, t]), $(() => {
2788
+ }, [i, e, d, t]), L(() => {
2766
2789
  e && (d == null || d.setSkipLastEnabled(!1));
2767
2790
  }, [e, d]);
2768
- }, cc = (e, t, n) => {
2769
- const o = T(ne), r = T(fn);
2770
- return Dt(() => {
2791
+ }, hc = (e, t, n) => {
2792
+ const o = T(ne), r = T(mn);
2793
+ return $t(() => {
2771
2794
  if (e) {
2772
- const i = [...r.getWorkbookSelections(t).getSelectionsOfWorksheet(n)], c = o.getCurrentUnitForType(H.UNIVER_SHEET), l = c == null ? void 0 : c.getActiveSheet();
2795
+ const i = [...r.getWorkbookSelections(t).getSelectionsOfWorksheet(n)], c = o.getCurrentUnitForType(W.UNIVER_SHEET), l = c == null ? void 0 : c.getActiveSheet();
2773
2796
  (c == null ? void 0 : c.getUnitId()) !== t && o.setCurrentUnitForType(t), l && l.getSheetId() === n && r.setSelections(i);
2774
2797
  }
2775
2798
  }, [e, r, n, t, o]);
2776
- }, 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) => {
2799
+ }, fc = (e) => e.reduce((t, n) => typeof n == "string" ? t + n.length : t + n.token.length, 0), an = (e) => e.map((t) => typeof t == "string" ? t : t.token).join(""), At = (e, t = !1, n = "", o = !1) => !t && !o ? e.map((r) => Ce(r.range)) : e.map((r) => o ? Wo(r) : r.sheetName !== "" && r.sheetName !== n ? Ct(r.sheetName, r.range) : Ce(r.range)), gc = (e) => {
2777
2800
  var m, h, d;
2778
2801
  const { editor: t, lexerTreeBuilder: n } = e, o = t == null ? void 0 : t.getSelectionRanges();
2779
2802
  if ((o == null ? void 0 : o.length) !== 1)
2780
2803
  return;
2781
2804
  const s = o[0].startOffset - 1, i = ((h = (m = t == null ? void 0 : t.getDocumentData().body) == null ? void 0 : m.dataStream) != null ? h : `\r
2782
- `).slice(0, -2), c = (d = n.sequenceNodesBuilder(i.slice(1))) != null ? d : [], l = _n(c, s, !1), g = $r(c, l);
2805
+ `).slice(0, -2), c = (d = n.sequenceNodesBuilder(i.slice(1))) != null ? d : [], l = In(c, s, !1), g = Ur(c, l);
2783
2806
  return {
2784
2807
  nodeIndex: l,
2785
2808
  updatingRefIndex: g,
2786
2809
  sequenceNodes: c,
2787
2810
  offset: s
2788
2811
  };
2789
- }, uc = (() => {
2790
- }), dc = (e, t, n, o, r, s, i, c, l, g = uc) => {
2812
+ }, mc = (() => {
2813
+ }), pc = (e, t, n, o, r, s, i, c, l, g = mc) => {
2791
2814
  var O;
2792
- 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) => {
2815
+ const m = T(Re), h = T(ne), d = T(me), u = T(Er), a = T(It), v = T(_e), p = h.getUnit(o), S = te((k, I) => {
2793
2816
  var x, R, w;
2794
2817
  return (w = (R = (x = h.getUnit(k)) == null ? void 0 : x.getSheetBySheetId(I)) == null ? void 0 : R.getName()) != null ? w : "";
2795
- }), 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) => {
2796
- var B, ce, ae, he, K, J, nt, rt, yt, Re;
2797
- const x = lc({ editor: l, lexerTreeBuilder: v });
2818
+ }), C = ie(() => S(o, r), [S, r, o]), _ = Se(p == null ? void 0 : p.activeSheet$), E = nt({ activeSheet: _, sheetName: C }), f = Se(ie(() => h.getCurrentTypeOfUnit$(W.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(Et), F = T(Yt), N = te((k, I) => {
2819
+ var B, ce, ae, he, K, J, rt, ot, Tt, Ie;
2820
+ const x = gc({ editor: l, lexerTreeBuilder: v });
2798
2821
  if (!x) return;
2799
2822
  const { nodeIndex: R, updatingRefIndex: w, sequenceNodes: D, offset: U } = x;
2800
- if (n.current === Te.NEED_ADD)
2823
+ if (n.current === Ne.NEED_ADD)
2801
2824
  if (U !== 0) {
2802
2825
  if (R === -1 && D.length)
2803
2826
  return;
2804
- const Y = k[k.length - 1], X = D.splice(R + 1), Ie = (B = Y.sheetId) != null ? B : r, fe = {
2827
+ const Y = k[k.length - 1], X = D.splice(R + 1), Ee = (B = Y.sheetId) != null ? B : r, fe = {
2805
2828
  range: Y,
2806
2829
  unitId: (ce = Y.unitId) != null ? ce : f.getUnitId(),
2807
- sheetName: S((ae = Y.unitId) != null ? ae : f.getUnitId(), Ie)
2808
- }, ee = Ie !== r, le = (f == null ? void 0 : f.getUnitId()) !== o, Ee = kt([fe], i && (ee || le), C, le);
2809
- D.push({ token: Ee[0], nodeType: Q.REFERENCE });
2810
- const $e = [...D, ...X], Me = sn($e);
2811
- g(Me, ac(D), I);
2830
+ sheetName: S((ae = Y.unitId) != null ? ae : f.getUnitId(), Ee)
2831
+ }, ee = Ee !== r, le = (f == null ? void 0 : f.getUnitId()) !== o, be = At([fe], i && (ee || le), C, le);
2832
+ D.push({ token: be[0], nodeType: Q.REFERENCE });
2833
+ const Le = [...D, ...X], Me = an(Le);
2834
+ g(Me, fc(D), I);
2812
2835
  } else {
2813
- const Y = k[k.length - 1], X = (he = Y.sheetId) != null ? he : r, Ie = {
2836
+ const Y = k[k.length - 1], X = (he = Y.sheetId) != null ? he : r, Ee = {
2814
2837
  range: Y,
2815
2838
  unitId: (K = Y.unitId) != null ? K : f.getUnitId(),
2816
2839
  sheetName: S((J = Y.unitId) != null ? J : f.getUnitId(), X)
2817
- }, fe = X !== r, ee = (f == null ? void 0 : f.getUnitId()) !== o, le = kt([Ie], i && (fe || ee), C, ee);
2840
+ }, fe = X !== r, ee = (f == null ? void 0 : f.getUnitId()) !== o, le = At([Ee], i && (fe || ee), C, ee);
2818
2841
  D.unshift({ token: le[0], nodeType: Q.REFERENCE });
2819
- const Ee = sn(D);
2820
- g(Ee, le[0].length, I);
2842
+ const be = an(D);
2843
+ g(be, le[0].length, I);
2821
2844
  }
2822
- else if (n.current === Te.EDIT_OTHER_SHEET_REFERENCE || n.current === Te.EDIT_OTHER_WORKBOOK_REFERENCE) {
2845
+ else if (n.current === Ne.EDIT_OTHER_SHEET_REFERENCE || n.current === Ne.EDIT_OTHER_WORKBOOK_REFERENCE) {
2823
2846
  const Y = k.pop();
2824
2847
  if (!Y) return;
2825
2848
  const X = D[R];
2826
2849
  if (typeof X == "object" && X.nodeType === Q.REFERENCE) {
2827
- const Ie = X.token;
2828
- (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);
2829
- const ee = U + (X.token.length - Ie.length);
2830
- g(Wo(D), ee, I);
2850
+ const Ee = X.token;
2851
+ (f == null ? void 0 : f.getUnitId()) !== o ? X.token = Ho((rt = f == null ? void 0 : f.getUnitId()) != null ? rt : "", C, Y) : X.token = C === (_ == null ? void 0 : _.getName()) ? Ce(Y) : Ct(_.getName(), Y);
2852
+ const ee = U + (X.token.length - Ee.length);
2853
+ g(Bo(D), ee, I);
2831
2854
  }
2832
2855
  } else {
2833
2856
  const Y = [...k];
@@ -2836,8 +2859,8 @@ const sc = (e, t, n, o) => {
2836
2859
  G && Y.splice(w, 0, G);
2837
2860
  }
2838
2861
  let X = 0;
2839
- const Ie = D.map((G) => {
2840
- var ge, ot, Pe, Ue;
2862
+ const Ee = D.map((G) => {
2863
+ var ge, st, Pe, Ue;
2841
2864
  if (typeof G == "string")
2842
2865
  return G;
2843
2866
  if (G.nodeType === Q.REFERENCE) {
@@ -2847,33 +2870,33 @@ const sc = (e, t, n, o) => {
2847
2870
  const oe = Y[X];
2848
2871
  if (X++, !oe)
2849
2872
  return "";
2850
- const be = (ot = oe.sheetId) != null ? ot : r, Tt = {
2873
+ const ye = (st = oe.sheetId) != null ? st : r, Nt = {
2851
2874
  range: oe,
2852
2875
  unitId: (Pe = oe.unitId) != null ? Pe : f.getUnitId(),
2853
- sheetName: S((Ue = oe.unitId) != null ? Ue : f.getUnitId(), be)
2854
- }, Nt = (f == null ? void 0 : f.getUnitId()) !== o;
2855
- return kt([Tt], i && (be !== r || Nt), C, Nt)[0];
2876
+ sheetName: S((Ue = oe.unitId) != null ? Ue : f.getUnitId(), ye)
2877
+ }, Ot = (f == null ? void 0 : f.getUnitId()) !== o;
2878
+ return At([Nt], i && (ye !== r || Ot), C, Ot)[0];
2856
2879
  }
2857
2880
  return G.token;
2858
2881
  });
2859
2882
  let fe = "", ee;
2860
- Ie.forEach((G, ge) => {
2883
+ Ee.forEach((G, ge) => {
2861
2884
  fe += G, ge === R && (ee = fe.length);
2862
2885
  });
2863
2886
  const le = [];
2864
2887
  for (let G = X; G <= k.length - 1; G++) {
2865
- const ge = k[G], ot = (rt = ge.sheetId) != null ? rt : r, Pe = {
2888
+ const ge = k[G], st = (ot = ge.sheetId) != null ? ot : r, Pe = {
2866
2889
  range: ge,
2867
- unitId: (yt = ge.unitId) != null ? yt : f.getUnitId(),
2868
- sheetName: S((Re = ge.unitId) != null ? Re : f.getUnitId(), ot)
2869
- }, Ue = (f == null ? void 0 : f.getUnitId()) !== o, oe = kt([Pe], i && (ot !== r || Ue), C, Ue);
2890
+ unitId: (Tt = ge.unitId) != null ? Tt : f.getUnitId(),
2891
+ sheetName: S((Ie = ge.unitId) != null ? Ie : f.getUnitId(), st)
2892
+ }, Ue = (f == null ? void 0 : f.getUnitId()) !== o, oe = At([Pe], i && (st !== r || Ue), C, Ue);
2870
2893
  le.push(oe[0]);
2871
2894
  }
2872
- const Ee = D[D.length - 1], $e = Ee && (typeof Ee == "string" ? !1 : Ee.nodeType === Q.REFERENCE), Me = `${fe}${le.length && $e ? "," : ""}${le.join(",")}`;
2895
+ const be = D[D.length - 1], Le = be && (typeof be == "string" ? !1 : be.nodeType === Q.REFERENCE), Me = `${fe}${le.length && Le ? "," : ""}${le.join(",")}`;
2873
2896
  g(Me, !le.length && ee ? ee : Me.length, I);
2874
2897
  }
2875
2898
  });
2876
- $(() => {
2899
+ L(() => {
2877
2900
  if (y && e) {
2878
2901
  let k = !0;
2879
2902
  const I = (R, w) => {
@@ -2891,7 +2914,7 @@ const sc = (e, t, n, o) => {
2891
2914
  x.dispose();
2892
2915
  };
2893
2916
  }
2894
- }, [e, N, y]), $(() => {
2917
+ }, [e, N, y]), L(() => {
2895
2918
  if (t && y && l) {
2896
2919
  const k = new qe(), I = () => {
2897
2920
  k.dispose(), y.getSelectionControls().forEach((w, D) => {
@@ -2907,12 +2930,12 @@ const sc = (e, t, n, o) => {
2907
2930
  })
2908
2931
  );
2909
2932
  });
2910
- }, x = Go(
2933
+ }, x = zo(
2911
2934
  l.input$,
2912
2935
  F.selectionSet$,
2913
2936
  y.selectionMoveEnd$
2914
2937
  ).pipe(
2915
- Ts(50)
2938
+ xs(50)
2916
2939
  ).subscribe(() => {
2917
2940
  I();
2918
2941
  });
@@ -2920,17 +2943,17 @@ const sc = (e, t, n, o) => {
2920
2943
  x.unsubscribe(), k.dispose();
2921
2944
  };
2922
2945
  }
2923
- }, [l, t, N, y, F.selectionSet$]), y == null || y.getSelectionDataWithStyle(), $(() => {
2946
+ }, [l, t, N, y, F.selectionSet$]), y == null || y.getSelectionDataWithStyle(), L(() => {
2924
2947
  if (c) {
2925
2948
  const k = d.onCommandExecuted((I) => {
2926
2949
  var R;
2927
- if (I.id !== gn.id)
2950
+ if (I.id !== pn.id)
2928
2951
  return;
2929
2952
  const x = I.params;
2930
2953
  if (x.extra === "formula-editor" && x.selections.length) {
2931
2954
  const w = x.selections[x.selections.length - 1];
2932
2955
  if (w) {
2933
- const D = n.current === Te.NEED_ADD, U = ((R = y == null ? void 0 : y.getSelectionDataWithStyle()) != null ? R : []).map((B) => B.rangeWithCoord);
2956
+ const D = n.current === Ne.NEED_ADD, U = ((R = y == null ? void 0 : y.getSelectionDataWithStyle()) != null ? R : []).map((B) => B.rangeWithCoord);
2934
2957
  D ? U.push(w.range) : U[U.length - 1] = w.range, N(U, !0);
2935
2958
  }
2936
2959
  }
@@ -2939,11 +2962,11 @@ const sc = (e, t, n, o) => {
2939
2962
  k.dispose();
2940
2963
  };
2941
2964
  }
2942
- }, [d, l, n, v, c, N, y]), $(() => {
2965
+ }, [d, l, n, v, c, N, y]), L(() => {
2943
2966
  if (!l)
2944
2967
  return;
2945
2968
  const k = u.textSelection$.subscribe((I) => {
2946
- I.unitId === l.getEditorId() && Ur({
2969
+ I.unitId === l.getEditorId() && Wr({
2947
2970
  unitId: o,
2948
2971
  subUnitId: r,
2949
2972
  refSelections: s.current,
@@ -2958,9 +2981,9 @@ const sc = (e, t, n, o) => {
2958
2981
  });
2959
2982
  return () => k.unsubscribe();
2960
2983
  }, [u.textSelection$, l, s, y, F, A, r, a, o, h]);
2961
- }, hc = (e, t, n, o, r, s) => {
2962
- const i = T(me), c = T(Ye), g = T(xe).getRenderById(t), m = T(ne), h = g == null ? void 0 : g.with(De);
2963
- $(() => {
2984
+ }, Sc = (e, t, n, o, r, s) => {
2985
+ const i = T(me), c = T(Ge), g = T(Re).getRenderById(t), m = T(ne), h = g == null ? void 0 : g.with(De);
2986
+ L(() => {
2964
2987
  if (e && h)
2965
2988
  if (n) {
2966
2989
  const d = () => {
@@ -2971,8 +2994,8 @@ const sc = (e, t, n, o) => {
2971
2994
  s();
2972
2995
  }, 30);
2973
2996
  }, u = i.onCommandExecuted((v) => {
2974
- v.id === Bn.id && d();
2975
- }), a = m.getCurrentTypeOfUnit$(H.UNIVER_SHEET).subscribe((v) => {
2997
+ v.id === jn.id && d();
2998
+ }), a = m.getCurrentTypeOfUnit$(W.UNIVER_SHEET).subscribe((v) => {
2976
2999
  d();
2977
3000
  });
2978
3001
  return () => {
@@ -2980,9 +3003,9 @@ const sc = (e, t, n, o) => {
2980
3003
  };
2981
3004
  } else {
2982
3005
  const d = i.beforeCommandExecuted((u) => {
2983
- if (u.id === Bn.id) {
3006
+ if (u.id === jn.id) {
2984
3007
  o(!1), r(), s();
2985
- const a = c.getEditor(an);
3008
+ const a = c.getEditor(un);
2986
3009
  a == null || a.focus();
2987
3010
  }
2988
3011
  });
@@ -2991,9 +3014,9 @@ const sc = (e, t, n, o) => {
2991
3014
  };
2992
3015
  }
2993
3016
  }, [e, h]);
2994
- }, fc = (e, t, n) => {
3017
+ }, vc = (e, t, n) => {
2995
3018
  const o = T(_e), r = z(!0);
2996
- $(() => {
3019
+ L(() => {
2997
3020
  if (e) {
2998
3021
  const s = setTimeout(() => {
2999
3022
  r.current = !1;
@@ -3002,24 +3025,24 @@ const sc = (e, t, n, o) => {
3002
3025
  clearTimeout(s);
3003
3026
  };
3004
3027
  }
3005
- }, [e]), $(() => {
3028
+ }, [e]), L(() => {
3006
3029
  if (!r.current && t) {
3007
3030
  const s = o.checkIfAddBracket(n);
3008
- t(s === 0 && n.startsWith(dr.EQUALS), `${n}`);
3031
+ t(s === 0 && n.startsWith(fr.EQUALS), `${n}`);
3009
3032
  }
3010
3033
  }, [n, t]);
3011
- }, gc = (e, t = [], n) => {
3012
- const o = T(Yt), [r, s] = V([]), [i, c] = V(""), l = z(-1), g = tt({ nodes: t }), m = () => {
3034
+ }, Cc = (e, t = [], n) => {
3035
+ const o = T(Gt), [r, s] = V([]), [i, c] = V(""), l = z(-1), g = nt({ nodes: t }), m = () => {
3013
3036
  s([]), c(""), l.current = -1;
3014
3037
  };
3015
- return $(() => {
3038
+ return L(() => {
3016
3039
  if (n && e) {
3017
- const d = n.input$.pipe(hn(300)).subscribe(() => {
3040
+ const d = n.input$.pipe(gn(300)).subscribe(() => {
3018
3041
  const u = n.getSelectionRanges();
3019
3042
  if (u.length === 1) {
3020
3043
  const a = g.current.nodes, v = u[0];
3021
3044
  if (v.collapsed) {
3022
- const p = _n(a, v.startOffset - 1, !1);
3045
+ const p = In(a, v.startOffset - 1, !1);
3023
3046
  l.current = p;
3024
3047
  const S = a[p];
3025
3048
  if (S && typeof S != "string" && S.nodeType === Q.FUNCTION) {
@@ -3036,7 +3059,7 @@ const sc = (e, t, n, o) => {
3036
3059
  d.unsubscribe();
3037
3060
  };
3038
3061
  }
3039
- }, [n, e]), $(() => {
3062
+ }, [n, e]), L(() => {
3040
3063
  e || m();
3041
3064
  }, [e]), {
3042
3065
  searchList: r,
@@ -3046,15 +3069,15 @@ const sc = (e, t, n, o) => {
3046
3069
  if (l.current !== -1) {
3047
3070
  const v = a.splice(l.current + 1), p = a.pop() || "";
3048
3071
  let S = (typeof p == "string" ? p.length : p.token.length) - d.length;
3049
- return a.push(d), v[0] !== je.OPEN_BRACKET && u !== ur.DefinedName && (a.push(je.OPEN_BRACKET), S--), { text: sn([...a, ...v]), offset: S };
3072
+ return a.push(d), v[0] !== je.OPEN_BRACKET && u !== hr.DefinedName && (a.push(je.OPEN_BRACKET), S--), { text: an([...a, ...v]), offset: S };
3050
3073
  }
3051
3074
  },
3052
3075
  reset: m
3053
3076
  };
3054
- }, mc = () => {
3055
- }, pc = Le(Sc);
3056
- function Sc(e, t) {
3057
- 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) => {
3077
+ }, _c = () => {
3078
+ }, Rc = $e(Ic);
3079
+ function Ic(e, t) {
3080
+ const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: i = _c } = e, c = s.getEditorId(), l = T(Zt), g = T(me), { searchList: m, searchText: h, handlerFormulaReplace: d, reset: u } = Cc(n, o, s), a = ie(() => !!m.length, [m]), v = z(void 0), [p, S] = V(0), C = z(!1), [_] = Vr(c, a, [h, m]), E = nt({ searchList: m, active: p }), f = (N, O) => {
3058
3081
  const k = d(N, O);
3059
3082
  k && (u(), r(k));
3060
3083
  };
@@ -3064,33 +3087,33 @@ function Sc(e, t) {
3064
3087
  function y() {
3065
3088
  C.current && S(-1);
3066
3089
  }
3067
- $(() => {
3090
+ L(() => {
3068
3091
  if (!m.length)
3069
3092
  return;
3070
3093
  const N = `sheet.formula-embedding-editor.search_function.${c}`, O = new qe(), k = (I) => {
3071
3094
  const { searchList: x, active: R } = E.current;
3072
3095
  switch (I) {
3073
- case L.ARROW_UP: {
3096
+ case $.ARROW_UP: {
3074
3097
  S((w) => {
3075
3098
  const D = Math.max(0, w - 1);
3076
3099
  return A(D), D;
3077
3100
  });
3078
3101
  break;
3079
3102
  }
3080
- case L.ARROW_DOWN: {
3103
+ case $.ARROW_DOWN: {
3081
3104
  S((w) => {
3082
3105
  const D = Math.min(x.length - 1, w + 1);
3083
3106
  return A(D), D;
3084
3107
  });
3085
3108
  break;
3086
3109
  }
3087
- case L.TAB:
3088
- case L.ENTER: {
3110
+ case $.TAB:
3111
+ case $.ENTER: {
3089
3112
  const w = x[R];
3090
3113
  f(w.name, w.functionType);
3091
3114
  break;
3092
3115
  }
3093
- case L.ESC: {
3116
+ case $.ESC: {
3094
3117
  u(), i();
3095
3118
  break;
3096
3119
  }
@@ -3098,18 +3121,18 @@ function Sc(e, t) {
3098
3121
  };
3099
3122
  return O.add(g.registerCommand({
3100
3123
  id: N,
3101
- type: Ne.OPERATION,
3124
+ type: Oe.OPERATION,
3102
3125
  handler(I, x) {
3103
3126
  const { keyCode: R } = x;
3104
3127
  k(R);
3105
3128
  }
3106
- })), [L.ARROW_UP, L.ARROW_DOWN, L.ENTER, L.ESC, L.TAB].map((I) => ({
3129
+ })), [$.ARROW_UP, $.ARROW_DOWN, $.ENTER, $.ESC, $.TAB].map((I) => ({
3107
3130
  id: N,
3108
3131
  binding: I,
3109
3132
  preconditions: () => !0,
3110
3133
  priority: 1e3,
3111
3134
  staticParameters: {
3112
- eventType: Oe.Keyboard,
3135
+ eventType: xe.Keyboard,
3113
3136
  keyCode: I
3114
3137
  }
3115
3138
  })).forEach((I) => {
@@ -3140,15 +3163,15 @@ function Sc(e, t) {
3140
3163
  }, 300);
3141
3164
  };
3142
3165
  }, []);
3143
- return m.length > 0 && a && /* @__PURE__ */ M(nn, { portal: !0, anchorRect$: _, direction: "vertical", children: /* @__PURE__ */ M(
3166
+ return m.length > 0 && a && /* @__PURE__ */ M(on, { portal: !0, anchorRect$: _, direction: "vertical", children: /* @__PURE__ */ M(
3144
3167
  "ul",
3145
3168
  {
3146
3169
  ref: (N) => {
3147
3170
  v.current = N, t && (t.current = N);
3148
3171
  },
3149
3172
  "data-u-comp": "sheets-formula-editor",
3150
- 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),
3151
- children: m.map((N, O) => /* @__PURE__ */ W(
3173
+ 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", Cn, ut),
3174
+ children: m.map((N, O) => /* @__PURE__ */ H(
3152
3175
  "li",
3153
3176
  {
3154
3177
  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", {
@@ -3161,7 +3184,7 @@ function Sc(e, t) {
3161
3184
  f(N.name, N.functionType), s && s.focus();
3162
3185
  },
3163
3186
  children: [
3164
- /* @__PURE__ */ W("span", { className: "univer-block univer-truncate univer-text-xs", children: [
3187
+ /* @__PURE__ */ H("span", { className: "univer-block univer-truncate univer-text-xs", children: [
3165
3188
  /* @__PURE__ */ M("span", { className: "univer-text-red-500", children: N.name.substring(0, h.length) }),
3166
3189
  /* @__PURE__ */ M("span", { children: N.name.slice(h.length) })
3167
3190
  ] }),
@@ -3179,9 +3202,9 @@ function Sc(e, t) {
3179
3202
  }
3180
3203
  ) });
3181
3204
  }
3182
- const vc = (e) => e.startsWith(dr.EQUALS) ? e.slice(1) : "", Qn = () => {
3183
- }, Cc = Le((e, t) => {
3184
- var En, bn, yn, Tn;
3205
+ const Ec = (e) => e.startsWith(fr.EQUALS) ? e.slice(1) : "", er = () => {
3206
+ }, bc = $e((e, t) => {
3207
+ var yn, Tn, Nn, On;
3185
3208
  const {
3186
3209
  errorText: n,
3187
3210
  initValue: o,
@@ -3189,8 +3212,8 @@ const vc = (e) => e.startsWith(dr.EQUALS) ? e.slice(1) : "", Qn = () => {
3189
3212
  subUnitId: s,
3190
3213
  isFocus: i = !0,
3191
3214
  isSupportAcrossSheet: c = !1,
3192
- onFocus: l = Qn,
3193
- onBlur: g = Qn,
3215
+ onFocus: l = er,
3216
+ onBlur: g = er,
3194
3217
  onChange: m,
3195
3218
  onVerify: h,
3196
3219
  className: d,
@@ -3206,50 +3229,50 @@ const vc = (e) => e.startsWith(dr.EQUALS) ? e.slice(1) : "", Qn = () => {
3206
3229
  autofocus: b = !0,
3207
3230
  disableContextMenu: y,
3208
3231
  style: A
3209
- } = e, F = T(Ye), N = z(null), O = te(m);
3210
- _s(t, () => ({
3232
+ } = e, F = T(Ge), N = z(null), O = te(m);
3233
+ Es(t, () => ({
3211
3234
  isClickOutSide: (Z) => N.current ? !N.current.contains(Z.target) : !1
3212
3235
  }));
3213
- 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);
3236
+ 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 : co(`${wo}-${Kt(4)}`), []), ce = ie(() => n !== void 0, [n]), ae = T(ne), he = ae.getUnit(B);
3214
3237
  Se(he == null ? void 0 : he.change$);
3215
- 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;
3216
- Ss(() => {
3238
+ const K = sc(), J = ao.transform.getPlainText((Tn = (yn = he == null ? void 0 : he.getBody()) == null ? void 0 : yn.dataStream) != null ? Tn : ""), rt = nt(J), ot = ie(() => Ec(J), [J]), Tt = ie(() => K(ot), [ot, K]), { isSelecting: Ie, isSelectingRef: Y } = oc({ unitId: r, subUnitId: s, editorId: B, isFocus: w, disableOnClick: f }), X = z(""), fe = T(Re).getRenderById(B), ee = fe == null ? void 0 : fe.with(Sr), le = ee == null ? void 0 : ee.isFocusing, be = ie(() => ae.getCurrentTypeOfUnit$(W.UNIVER_DOC), [ae]), Le = Se(be), Me = (Le == null ? void 0 : Le.getUnitId()) === B, G = z([]), ge = Ie, Pe = (On = (Nn = T(ir).getConfig(Nr)) == null ? void 0 : Nn.functionScreenTips) != null ? On : !0;
3239
+ _s(() => {
3217
3240
  O(J);
3218
3241
  }, [J, O]);
3219
- const Ue = Vr("="), Ve = nc(r, s), oe = te((Z, se = !0, we, ye) => {
3242
+ const Ue = Hr("="), Ve = cc(r, s), oe = te((Z, se = !0, we, Te) => {
3220
3243
  if (!x.current) return;
3221
3244
  X.current = Z;
3222
- 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(
3245
+ const xt = Z[0] === "=" ? Z.slice(1) : "", ke = K(xt), Kr = ke.reduce((We, wt) => typeof wt == "object" ? `${We}${wt.token}` : `${We}${wt}`, ""), Mt = Ue(
3223
3246
  x.current,
3224
- qr === Ot ? ke : [],
3247
+ Kr === xt ? ke : [],
3225
3248
  se,
3226
- ye
3249
+ Te
3227
3250
  );
3228
- if (G.current = xt, we) {
3229
- const We = ye != null ? ye : R == null ? void 0 : R.getSelectionRanges();
3251
+ if (G.current = Mt, we) {
3252
+ const We = Te != null ? Te : R == null ? void 0 : R.getSelectionRanges();
3230
3253
  if ((We == null ? void 0 : We.length) !== 1)
3231
3254
  return;
3232
- const jr = We[0].startOffset - 1, Kr = _n(ke, jr, !1), Nn = $r(ke, Kr);
3233
- if (Nn >= 0) {
3234
- const On = xt.splice(Nn, 1)[0];
3235
- On && xt.push(On);
3255
+ const Yr = We[0].startOffset - 1, Gr = In(ke, Yr, !1), xn = Ur(ke, Gr);
3256
+ if (xn >= 0) {
3257
+ const Mn = Mt.splice(xn, 1)[0];
3258
+ Mn && Mt.push(Mn);
3236
3259
  }
3237
- Ve(w ? xt : [], x.current);
3260
+ Ve(w ? Mt : [], x.current);
3238
3261
  }
3239
3262
  });
3240
- $(() => {
3263
+ L(() => {
3241
3264
  w && oe(J, !1, !0);
3242
- }, [w]), $(() => {
3265
+ }, [w]), L(() => {
3243
3266
  if (w) {
3244
3267
  if (X.current === J) return;
3245
3268
  oe(J, !1, !0);
3246
3269
  }
3247
- }, [J]), fc(w, h, J);
3248
- const be = Xi(R), Tt = cc(w, r, s);
3249
- $(() => {
3270
+ }, [J]), vc(w, h, J);
3271
+ const ye = nc(R), Nt = hc(w, r, s);
3272
+ L(() => {
3250
3273
  var Z;
3251
- k(Re, (Z = ee == null ? void 0 : ee.isFocusing) != null ? Z : !0);
3252
- }, [k, Re]), Xo(w, p, R), Lt(() => {
3274
+ k(Ie, (Z = ee == null ? void 0 : ee.isFocusing) != null ? Z : !0);
3275
+ }, [k, Ie]), Jo(w, p, R), Lt(() => {
3253
3276
  let Z;
3254
3277
  if (U.current) {
3255
3278
  Z = F.register({
@@ -3275,21 +3298,21 @@ const vc = (e) => e.startsWith(dr.EQUALS) ? e.slice(1) : "", Qn = () => {
3275
3298
  Z == null || Z.dispose();
3276
3299
  };
3277
3300
  }, []), Lt(() => {
3278
- i ? (D(i), be()) : (C && (R == null || R.blur(), Tt()), D(i));
3279
- }, [i, R, be, Tt, C]);
3280
- const { checkScrollBar: Nt } = Qo(R, E, _);
3281
- ic(w, !!(Re && Me), r, B, y), sc(!!(w && le && a), ge, R, S);
3282
- const Rn = te((Z, se, we) => {
3301
+ i ? (D(i), ye()) : (C && (R == null || R.blur(), Nt()), D(i));
3302
+ }, [i, R, ye, Nt, C]);
3303
+ const { checkScrollBar: Ot } = es(R, E, _);
3304
+ dc(w, !!(Ie && Me), r, B, y), uc(!!(w && le && a), ge, R, S);
3305
+ const En = te((Z, se, we) => {
3283
3306
  if (!le)
3284
3307
  return;
3285
- const ye = se !== -1 ? [{ startOffset: se + 1, endOffset: se + 1, collapsed: !0 }] : void 0;
3286
- oe(`=${Z}`, !0, we, ye), we && (be(), se !== -1 && setTimeout(() => {
3287
- const Ot = { startOffset: se + 1, endOffset: se + 1 }, ke = R == null ? void 0 : R.render.with(Jo);
3288
- ke == null || ke.scrollToRange({ ...Ot, collapsed: !0 });
3289
- }, 50), Nt());
3308
+ const Te = se !== -1 ? [{ startOffset: se + 1, endOffset: se + 1, collapsed: !0 }] : void 0;
3309
+ oe(`=${Z}`, !0, we, Te), we && (ye(), se !== -1 && setTimeout(() => {
3310
+ const xt = { startOffset: se + 1, endOffset: se + 1 }, ke = R == null ? void 0 : R.render.with(ts);
3311
+ ke == null || ke.scrollToRange({ ...xt, collapsed: !0 });
3312
+ }, 50), Ot());
3290
3313
  });
3291
- dc(
3292
- w && !!(Re && Me),
3314
+ pc(
3315
+ w && !!(Ie && Me),
3293
3316
  w,
3294
3317
  Y,
3295
3318
  r,
@@ -3298,28 +3321,28 @@ const vc = (e) => e.startsWith(dr.EQUALS) ? e.slice(1) : "", Qn = () => {
3298
3321
  c,
3299
3322
  !!ge,
3300
3323
  R,
3301
- Rn
3302
- ), hc(w && !!(Re && Me), r, c, D, g, () => {
3303
- oe(nt.current, !1, !0);
3324
+ En
3325
+ ), Sc(w && !!(Ie && Me), r, c, D, g, () => {
3326
+ oe(rt.current, !1, !0);
3304
3327
  });
3305
- const In = (Z) => {
3328
+ const bn = (Z) => {
3306
3329
  if (Z) {
3307
3330
  const se = R == null ? void 0 : R.getSelectionRanges();
3308
3331
  if (se && se.length === 1) {
3309
3332
  const we = se[0];
3310
3333
  if (we.collapsed) {
3311
- const ye = Z.offset;
3334
+ const Te = Z.offset;
3312
3335
  setTimeout(() => {
3313
- R == null || R.setSelectionRanges([{ startOffset: we.startOffset - ye, endOffset: we.endOffset - ye }]);
3336
+ R == null || R.setSelectionRanges([{ startOffset: we.startOffset - Te, endOffset: we.endOffset - Te }]);
3314
3337
  }, 30);
3315
3338
  }
3316
3339
  }
3317
- be(), oe(`=${Z.text}`);
3340
+ ye(), oe(`=${Z.text}`);
3318
3341
  }
3319
- }, Br = () => {
3320
- D(!0), l(), be();
3342
+ }, jr = () => {
3343
+ D(!0), l(), ye();
3321
3344
  };
3322
- return /* @__PURE__ */ W("div", { className: d, children: [
3345
+ return /* @__PURE__ */ H("div", { className: d, children: [
3323
3346
  /* @__PURE__ */ M(
3324
3347
  "div",
3325
3348
  {
@@ -3333,36 +3356,36 @@ const vc = (e) => e.startsWith(dr.EQUALS) ? e.slice(1) : "", Qn = () => {
3333
3356
  {
3334
3357
  ref: U,
3335
3358
  className: "univer-relative univer-h-full univer-w-full",
3336
- onMouseUp: Br
3359
+ onMouseUp: jr
3337
3360
  }
3338
3361
  )
3339
3362
  }
3340
3363
  ),
3341
3364
  n !== void 0 && /* @__PURE__ */ M("div", { className: "univer-my-1 univer-text-xs univer-text-red-500", children: n }),
3342
- Pe && R && rt !== "" && /* @__PURE__ */ M(
3343
- zi,
3365
+ Pe && R && ot !== "" && /* @__PURE__ */ M(
3366
+ tc,
3344
3367
  {
3345
3368
  editor: R,
3346
3369
  isFocus: w,
3347
3370
  formulaText: J,
3348
- onClose: () => be()
3371
+ onClose: () => ye()
3349
3372
  }
3350
3373
  ),
3351
3374
  Pe && !!R && /* @__PURE__ */ M(
3352
- pc,
3375
+ Rc,
3353
3376
  {
3354
3377
  isFocus: w,
3355
- sequenceNodes: yt,
3356
- onSelect: In,
3378
+ sequenceNodes: Tt,
3379
+ onSelect: bn,
3357
3380
  ref: I,
3358
3381
  editor: R
3359
3382
  }
3360
3383
  )
3361
3384
  ] });
3362
3385
  });
3363
- function _c(e, t, n, o) {
3364
- 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);
3365
- return $(() => {
3386
+ function yc(e, t, n, o) {
3387
+ const r = T(_e), s = Hr(""), i = Se(e == null ? void 0 : e.getDocumentDataModel().change$), [c, l] = V([]), g = T(ko), m = z(""), h = T(ne);
3388
+ return L(() => {
3366
3389
  if (!e) return;
3367
3390
  const d = e.getDocumentDataModel().getPlainText();
3368
3391
  if (m.current === d)
@@ -3370,7 +3393,7 @@ function _c(e, t, n, o) {
3370
3393
  m.current = d;
3371
3394
  const u = r.sequenceNodesBuilder(d);
3372
3395
  l(u != null ? u : []);
3373
- }, [i, e, r]), $(() => {
3396
+ }, [i, e, r]), L(() => {
3374
3397
  var a, v;
3375
3398
  if (!e) return;
3376
3399
  if (!t) {
@@ -3387,10 +3410,10 @@ function _c(e, t, n, o) {
3387
3410
  }
3388
3411
  const d = s(e, c, !1), u = new qe();
3389
3412
  return d.forEach((p) => {
3390
- const S = ht(p.token), C = h.getCurrentUnitForType(H.UNIVER_SHEET), _ = C == null ? void 0 : C.getActiveSheet();
3413
+ const S = ht(p.token), C = h.getCurrentUnitForType(W.UNIVER_SHEET), _ = C == null ? void 0 : C.getActiveSheet();
3391
3414
  if (!S.sheetName && o !== (_ == null ? void 0 : _.getSheetId()) || S.sheetName && (_ == null ? void 0 : _.getName()) !== S.sheetName)
3392
3415
  return;
3393
- const E = new un(p.themeColor).toRgb(), f = g.addShape({
3416
+ const E = new hn(p.themeColor).toRgb(), f = g.addShape({
3394
3417
  range: S.range,
3395
3418
  style: {
3396
3419
  stroke: p.themeColor,
@@ -3405,8 +3428,8 @@ function _c(e, t, n, o) {
3405
3428
  };
3406
3429
  }, [e, t, s, g, c]), { sequenceNodes: c };
3407
3430
  }
3408
- function Rc(e) {
3409
- 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) => {
3431
+ function Tc(e) {
3432
+ const t = T(mn), { supportAcrossSheet: n = !1, keepSheetReference: o = !1, unitId: r, subUnitId: s, onChange: i } = e, l = T(ne).getUnit(r, W.UNIVER_SHEET), g = te(i), m = te((h, d) => {
3410
3433
  const u = l == null ? void 0 : l.getActiveSheet();
3411
3434
  if (!u || !n && u.getSheetId() !== s || !(h != null && h.length)) return;
3412
3435
  const a = o ? u.getName() : u.getSheetId() === s ? "" : u.getName(), v = h.map((p) => ({
@@ -3416,7 +3439,7 @@ function Rc(e) {
3416
3439
  }));
3417
3440
  g(v, d);
3418
3441
  });
3419
- $(() => {
3442
+ L(() => {
3420
3443
  const h = new qe();
3421
3444
  return h.add(t.selectionMoveStart$.subscribe((d) => {
3422
3445
  m(d, !0);
@@ -3429,14 +3452,14 @@ function Rc(e) {
3429
3452
  };
3430
3453
  }, [m, t.selectionMoveEnd$, t.selectionMoveStart$, t.selectionMoving$]);
3431
3454
  }
3432
- const Jn = (e) => !e.some((n) => {
3455
+ const tr = (e) => !e.some((n) => {
3433
3456
  if (typeof n == "string") {
3434
3457
  if (n !== je.COMMA)
3435
3458
  return !0;
3436
3459
  } else if (n.nodeType !== Q.REFERENCE)
3437
3460
  return !0;
3438
3461
  return !1;
3439
- }), Ic = (e) => {
3462
+ }), Nc = (e) => {
3440
3463
  if (e.endColumn < e.startColumn) {
3441
3464
  const t = e.endColumn;
3442
3465
  e.endColumn = e.startColumn, e.startColumn = t;
@@ -3447,7 +3470,7 @@ const Jn = (e) => !e.some((n) => {
3447
3470
  }
3448
3471
  return e;
3449
3472
  };
3450
- function Ec(e) {
3473
+ function Oc(e) {
3451
3474
  const {
3452
3475
  visible: t,
3453
3476
  initialValue: n,
@@ -3460,7 +3483,7 @@ function Ec(e) {
3460
3483
  onClose: g,
3461
3484
  onShowBySelection: m
3462
3485
  } = e, h = T(dt), d = T(_e), [u, a] = V([]), [v, p] = V(0), S = z(null);
3463
- $(() => {
3486
+ L(() => {
3464
3487
  if (t && n.length) {
3465
3488
  const f = n.map((b) => b.sheetName ? Ct(b.sheetName, b.range) : Ce(b.range));
3466
3489
  a(f), p(f.length - 1);
@@ -3475,7 +3498,7 @@ function Ec(e) {
3475
3498
  }, E = (f) => {
3476
3499
  u.splice(f, 1), a([...u]);
3477
3500
  };
3478
- return Rc({
3501
+ return Tc({
3479
3502
  unitId: o,
3480
3503
  subUnitId: r,
3481
3504
  supportAcrossSheet: i,
@@ -3500,7 +3523,7 @@ function Ec(e) {
3500
3523
  }
3501
3524
  }
3502
3525
  }), /* @__PURE__ */ M(
3503
- ys,
3526
+ Os,
3504
3527
  {
3505
3528
  width: "328px",
3506
3529
  open: t,
@@ -3508,10 +3531,10 @@ function Ec(e) {
3508
3531
  draggable: !0,
3509
3532
  mask: !1,
3510
3533
  maskClosable: !1,
3511
- footer: /* @__PURE__ */ W("footer", { className: "univer-flex univer-gap-2", children: [
3512
- /* @__PURE__ */ M(ct, { onClick: g, children: h.t("rangeSelector.cancel") }),
3534
+ footer: /* @__PURE__ */ H("footer", { className: "univer-flex univer-gap-2", children: [
3535
+ /* @__PURE__ */ M(at, { onClick: g, children: h.t("rangeSelector.cancel") }),
3513
3536
  /* @__PURE__ */ M(
3514
- ct,
3537
+ at,
3515
3538
  {
3516
3539
  variant: "primary",
3517
3540
  onClick: () => {
@@ -3519,7 +3542,7 @@ function Ec(e) {
3519
3542
  u.filter((f) => {
3520
3543
  const b = d.sequenceNodesBuilder(f);
3521
3544
  return b && b.length === 1 && typeof b[0] != "string" && b[0].nodeType === Q.REFERENCE;
3522
- }).map((f) => ht(f)).map((f) => ({ ...f, range: Ic(f.range) }))
3545
+ }).map((f) => ht(f)).map((f) => ({ ...f, range: Nc(f.range) }))
3523
3546
  );
3524
3547
  },
3525
3548
  children: h.t("rangeSelector.confirm")
@@ -3527,19 +3550,19 @@ function Ec(e) {
3527
3550
  )
3528
3551
  ] }),
3529
3552
  onClose: g,
3530
- children: /* @__PURE__ */ W(
3553
+ children: /* @__PURE__ */ H(
3531
3554
  "div",
3532
3555
  {
3533
3556
  ref: S,
3534
- className: re("-univer-mx-6 univer-max-h-60 univer-overflow-y-auto univer-px-6", lt),
3557
+ className: re("-univer-mx-6 univer-max-h-60 univer-overflow-y-auto univer-px-6", ut),
3535
3558
  children: [
3536
- u.map((f, b) => /* @__PURE__ */ W(
3559
+ u.map((f, b) => /* @__PURE__ */ H(
3537
3560
  "div",
3538
3561
  {
3539
3562
  className: "univer-mb-2 univer-flex univer-items-center univer-gap-4",
3540
3563
  children: [
3541
3564
  /* @__PURE__ */ M(
3542
- _r,
3565
+ Ir,
3543
3566
  {
3544
3567
  className: re("univer-w-full", {
3545
3568
  "univer-border-primary-600": v === b
@@ -3551,7 +3574,7 @@ function Ec(e) {
3551
3574
  }
3552
3575
  ),
3553
3576
  u.length > 1 && /* @__PURE__ */ M(
3554
- kr,
3577
+ Fr,
3555
3578
  {
3556
3579
  className: "univer-cursor-pointer",
3557
3580
  onClick: () => E(b)
@@ -3561,8 +3584,8 @@ function Ec(e) {
3561
3584
  },
3562
3585
  b
3563
3586
  )),
3564
- u.length < s && /* @__PURE__ */ M("div", { children: /* @__PURE__ */ W(ct, { variant: "link", onClick: _, children: [
3565
- /* @__PURE__ */ M(Ar, {}),
3587
+ u.length < s && /* @__PURE__ */ M("div", { children: /* @__PURE__ */ H(at, { variant: "link", onClick: _, children: [
3588
+ /* @__PURE__ */ M(Dr, {}),
3566
3589
  /* @__PURE__ */ M("span", { children: h.t("rangeSelector.addAnotherRange") })
3567
3590
  ] }) })
3568
3591
  ]
@@ -3571,13 +3594,13 @@ function Ec(e) {
3571
3594
  }
3572
3595
  );
3573
3596
  }
3574
- function bc(e) {
3597
+ function xc(e) {
3575
3598
  return e.split(je.COMMA).filter((t) => !!t).map((t) => ht(t));
3576
3599
  }
3577
- function yc(e) {
3600
+ function Mc(e) {
3578
3601
  return e.map((t) => t.sheetName ? Ct(t.sheetName, t.range) : Ce(t.range)).join(je.COMMA);
3579
3602
  }
3580
- function Wr(e) {
3603
+ function Br(e) {
3581
3604
  const [t, n] = V(null), {
3582
3605
  onVerify: o,
3583
3606
  selectorRef: r,
@@ -3594,13 +3617,13 @@ function Wr(e) {
3594
3617
  forceShowDialogWhenSelectionChanged: v,
3595
3618
  hideEditor: p,
3596
3619
  resetRange: S
3597
- } = 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(() => {
3620
+ } = e, [C, _] = V(m != null ? m : !1), [E, f] = V(!1), [b, y] = V([]), A = T(dt), F = T(Ge), { sequenceNodes: N } = yc(t, C, s, i), O = nt(N), k = T(me), I = te(() => {
3598
3621
  t == null || t.setSelectionRanges([]), t == null || t.blur(), F.blur();
3599
3622
  }), x = te(() => {
3600
3623
  var R;
3601
- I(), y(bc((R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "")), f(!0);
3624
+ I(), y(xc((R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "")), f(!0);
3602
3625
  });
3603
- return $(() => {
3626
+ return L(() => {
3604
3627
  r && (r.current = {
3605
3628
  get editor() {
3606
3629
  return t;
@@ -3609,7 +3632,7 @@ function Wr(e) {
3609
3632
  F.focus(t.getEditorId());
3610
3633
  },
3611
3634
  blur: I,
3612
- verify: () => Jn(O.current),
3635
+ verify: () => tr(O.current),
3613
3636
  showDialog: (R) => {
3614
3637
  I(), y(R), f(!0);
3615
3638
  },
@@ -3621,12 +3644,12 @@ function Wr(e) {
3621
3644
  return (R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "";
3622
3645
  }
3623
3646
  });
3624
- }, [I, t, F, r, O]), $(() => {
3647
+ }, [I, t, F, r, O]), L(() => {
3625
3648
  var R;
3626
- o == null || o(Jn(N), (R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "");
3627
- }, [N]), $(() => {
3649
+ o == null || o(tr(N), (R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "");
3650
+ }, [N]), L(() => {
3628
3651
  d == null || d(E);
3629
- }, [E]), $(() => {
3652
+ }, [E]), L(() => {
3630
3653
  if (E && S)
3631
3654
  return () => {
3632
3655
  const R = {
@@ -3634,11 +3657,11 @@ function Wr(e) {
3634
3657
  subUnitId: i,
3635
3658
  selections: S
3636
3659
  };
3637
- k.executeCommand(gn.id, R);
3660
+ k.executeCommand(pn.id, R);
3638
3661
  };
3639
- }, [E]), /* @__PURE__ */ W(Cs, { children: [
3662
+ }, [E]), /* @__PURE__ */ H(Is, { children: [
3640
3663
  p ? null : /* @__PURE__ */ M(
3641
- es,
3664
+ ns,
3642
3665
  {
3643
3666
  isSingle: !0,
3644
3667
  ...e,
@@ -3649,8 +3672,8 @@ function Wr(e) {
3649
3672
  onClickOutside: () => {
3650
3673
  _(!1), I(), u == null || u();
3651
3674
  },
3652
- icon: /* @__PURE__ */ M(bs, { title: A.t("rangeSelector.buttonTooltip"), placement: "bottom", children: /* @__PURE__ */ M(
3653
- Dr,
3675
+ icon: /* @__PURE__ */ M(Ns, { title: A.t("rangeSelector.buttonTooltip"), placement: "bottom", children: /* @__PURE__ */ M(
3676
+ Lr,
3654
3677
  {
3655
3678
  className: "univer-cursor-pointer dark:!univer-text-gray-300",
3656
3679
  onClick: x
@@ -3659,7 +3682,7 @@ function Wr(e) {
3659
3682
  }
3660
3683
  ),
3661
3684
  /* @__PURE__ */ M(
3662
- Ec,
3685
+ Oc,
3663
3686
  {
3664
3687
  initialValue: b,
3665
3688
  unitId: s,
@@ -3667,7 +3690,7 @@ function Wr(e) {
3667
3690
  visible: E,
3668
3691
  maxRangeCount: c,
3669
3692
  onConfirm: (R) => {
3670
- const w = yc(R), D = co.newEmptyData();
3693
+ const w = Mc(R), D = lo.newEmptyData();
3671
3694
  D.body.dataStream = w, t == null || t.replaceText(w, !1), h == null || h(D, w), f(!1), y([]), requestAnimationFrame(() => {
3672
3695
  I();
3673
3696
  });
@@ -3682,10 +3705,10 @@ function Wr(e) {
3682
3705
  )
3683
3706
  ] });
3684
3707
  }
3685
- const Tc = () => {
3708
+ const wc = () => {
3686
3709
  var o, r;
3687
- const e = T(Lr), t = Se(e.currentSelector$), n = z(null);
3688
- return $(() => {
3710
+ const e = T(Pr), t = Se(e.currentSelector$), n = z(null);
3711
+ return L(() => {
3689
3712
  var s, i;
3690
3713
  if (t)
3691
3714
  return (i = n.current) == null || i.showDialog((s = t.initialValue) != null ? s : []), () => {
@@ -3693,7 +3716,7 @@ const Tc = () => {
3693
3716
  (c = n.current) == null || c.hideDialog();
3694
3717
  };
3695
3718
  }, [t]), /* @__PURE__ */ M(
3696
- Wr,
3719
+ Br,
3697
3720
  {
3698
3721
  unitId: (o = t == null ? void 0 : t.unitId) != null ? o : "",
3699
3722
  subUnitId: (r = t == null ? void 0 : t.subUnitId) != null ? r : "",
@@ -3706,81 +3729,83 @@ const Tc = () => {
3706
3729
  }
3707
3730
  );
3708
3731
  };
3709
- 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) => {
3710
- for (var r = o > 1 ? void 0 : o ? Oc(t, n) : t, s = e.length - 1, i; s >= 0; s--)
3732
+ var kc = Object.defineProperty, Ac = Object.getOwnPropertyDescriptor, Fc = (e, t, n) => t in e ? kc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Dc = (e, t, n, o) => {
3733
+ for (var r = o > 1 ? void 0 : o ? Ac(t, n) : t, s = e.length - 1, i; s >= 0; s--)
3711
3734
  (i = e[s]) && (r = i(r) || r);
3712
3735
  return r;
3713
- }, At = (e, t) => (n, o) => t(n, o, e), Hr = (e, t, n) => xc(e, typeof t != "symbol" ? t + "" : t, n);
3714
- let Bt = class extends lo {
3715
- constructor(e = Gn, t, n, o, r) {
3736
+ }, Ft = (e, t) => (n, o) => t(n, o, e), qr = (e, t, n) => Fc(e, typeof t != "symbol" ? t + "" : t, n);
3737
+ let jt = class extends ho {
3738
+ constructor(e = zn, t, n, o, r) {
3716
3739
  super(), this._config = e, this._injector = t, this._renderManagerService = n, this._configService = o, this._uiPartsService = r;
3717
- const { menu: s, ...i } = uo(
3718
- Gn,
3740
+ const { menu: s, ...i } = fo(
3741
+ zn,
3719
3742
  this._config
3720
3743
  );
3721
- s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(yr, i, { merge: !0 });
3744
+ s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(Nr, i, { merge: !0 });
3722
3745
  }
3723
3746
  onStarting() {
3724
- ho(this._injector, [
3725
- [Zt, { useClass: rn }],
3726
- [Lr],
3727
- [Ht],
3728
- [Pt],
3747
+ go(this._injector, [
3748
+ [zt, { useClass: sn }],
3749
+ [Pr],
3750
+ [Bt],
3729
3751
  [Ut],
3730
3752
  [Vt],
3731
3753
  [Wt],
3732
- [$t]
3754
+ [Ht],
3755
+ [Pt],
3756
+ [qt]
3733
3757
  ]), this._initUIPart();
3734
3758
  }
3735
3759
  onReady() {
3736
3760
  [
3737
3761
  [De]
3738
3762
  ].forEach((e) => {
3739
- this.disposeWithMe(this._renderManagerService.registerRenderModule(H.UNIVER_SHEET, e));
3763
+ this.disposeWithMe(this._renderManagerService.registerRenderModule(W.UNIVER_SHEET, e));
3740
3764
  });
3741
3765
  }
3742
3766
  onRendered() {
3743
3767
  [
3744
- [on]
3768
+ [cn]
3745
3769
  ].forEach((e) => {
3746
- this.disposeWithMe(this._renderManagerService.registerRenderModule(H.UNIVER_SHEET, e));
3747
- }), fo(this._injector, [
3748
- [Ht],
3770
+ this.disposeWithMe(this._renderManagerService.registerRenderModule(W.UNIVER_SHEET, e));
3771
+ }), mo(this._injector, [
3772
+ [Bt],
3749
3773
  // FormulaProgressBar relies on TriggerCalculationController, but it is necessary to ensure that the formula calculation is done after rendered.
3750
- [Ut],
3751
- [Wt]
3774
+ [Vt],
3775
+ [Ht],
3776
+ [qt]
3752
3777
  ]);
3753
3778
  }
3754
3779
  onSteady() {
3755
- this._injector.get(Pt), this._injector.get($t);
3780
+ this._injector.get(Ut), this._injector.get(Pt);
3756
3781
  }
3757
3782
  _initUIPart() {
3758
- const e = this._injector.get(vr);
3759
- this.disposeWithMe(e.register(wo, Wr)), this.disposeWithMe(e.register(ko, Cc)), this.disposeWithMe(this._uiPartsService.registerComponent(vs.GLOBAL, () => Cr(Tc, this._injector)));
3783
+ const e = this._injector.get(_r);
3784
+ this.disposeWithMe(e.register(Ao, Br)), this.disposeWithMe(e.register(Fo, bc)), this.disposeWithMe(this._uiPartsService.registerComponent(Rs.GLOBAL, () => Rr(wc, this._injector)));
3760
3785
  }
3761
3786
  };
3762
- Hr(Bt, "pluginName", Ir);
3763
- Hr(Bt, "type", H.UNIVER_SHEET);
3764
- Bt = Mc([
3765
- ao(Ho, hs),
3766
- At(1, q(Rt)),
3767
- At(2, xe),
3768
- At(3, or),
3769
- At(4, Sr)
3770
- ], Bt);
3787
+ qr(jt, "pluginName", br);
3788
+ qr(jt, "type", W.UNIVER_SHEET);
3789
+ jt = Dc([
3790
+ uo(qo, ms),
3791
+ Ft(1, q(Rt)),
3792
+ Ft(2, Re),
3793
+ Ft(3, ir),
3794
+ Ft(4, Cr)
3795
+ ], jt);
3771
3796
  export {
3772
- Ms as FORMULA_PROMPT_ACTIVATED,
3773
- Cc as FormulaEditor,
3774
- $t as FormulaReorderController,
3775
- Lr as GlobalRangeSelectorService,
3776
- ws as HelpFunctionOperation,
3797
+ As as FORMULA_PROMPT_ACTIVATED,
3798
+ bc as FormulaEditor,
3799
+ Pt as FormulaReorderController,
3800
+ Pr as GlobalRangeSelectorService,
3801
+ Fs as HelpFunctionOperation,
3777
3802
  pe as InsertFunctionOperation,
3778
- Cn as MoreFunctionsOperation,
3779
- Wr as RangeSelector,
3803
+ Rn as MoreFunctionsOperation,
3804
+ Br as RangeSelector,
3780
3805
  De as RefSelectionsRenderService,
3781
- br as ReferenceAbsoluteOperation,
3782
- Ps as SearchFunctionOperation,
3806
+ Tr as ReferenceAbsoluteOperation,
3807
+ Ws as SearchFunctionOperation,
3783
3808
  gt as SelectEditorFormulaOperation,
3784
- vn as SheetOnlyPasteFormulaCommand,
3785
- Bt as UniverSheetsFormulaUIPlugin
3809
+ _n as SheetOnlyPasteFormulaCommand,
3810
+ jt as UniverSheetsFormulaUIPlugin
3786
3811
  };