@univerjs/sheets-formula-ui 0.15.0-insiders.20251227-453e4ff → 0.15.0-insiders.20260106-79b11f9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/es/index.js CHANGED
@@ -1,30 +1,30 @@
1
- var Jr = Object.defineProperty;
2
- var eo = (e, t, n) => t in e ? Jr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var j = (e, t, n) => eo(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { CommandType as be, ICommandService as pe, createIdentifier as to, IContextService as dn, IUniverInstanceService as te, Rectangle as hn, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as fn, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as ir, DEFAULT_EMPTY_DOCUMENT_VALUE as cr, isRealNum as no, CellValueType as Dn, getCellValueType as ro, Inject as q, Disposable as Ze, ObjectMatrix as Fe, Range as oo, Tools as gn, LocaleService as dt, isICellData as so, isFormulaString as Ce, isFormulaId as De, generateRandomId as Yt, Direction as de, Injector as It, getEmptyCell as mt, UniverInstanceType as U, ThemeService as Et, ILogService as io, toDisposable as lr, ColorKit as mn, RxDisposable as co, InterceptorEffectEnum as lo, FOCUSING_DOC as ao, FOCUSING_UNIVER_EDITOR as uo, DisposableCollection as Ye, RANGE_TYPE as Ie, getBodySlice as Ln, EDITOR_ACTIVATED as $n, createInternalEditorID as ho, BuildTextUtils as fo, IConfigService as ar, RichTextBuilder as go, DependentOn as mo, Plugin as po, merge as So, registerDependencies as vo, touchDependencies as Co } from "@univerjs/core";
5
- import { ISheetClipboardService as ur, PREDEFINED_HOOK_NAME_COPY as dr, SheetPasteCommand as _o, PREDEFINED_HOOK_NAME_PASTE as lt, IEditorBridgeService as pn, SetCellEditVisibleOperation as hr, HoverManagerService as Ro, CellAlertManagerService as Io, CellAlertType as Eo, IAutoFillService as bo, APPLY_TYPE as yo, DATA_TYPE as Pn, COPY_TYPE as fr, SheetSkeletonManagerService as bt, attachSelectionWithCoord as sn, SelectionControl as gr, SELECTION_SHAPE_DEPTH as To, useActiveWorkbook as Oo, getCurrentRangeDisable$ as $e, PASTE_SPECIAL_MENU_ID as No, COPY_SPECIAL_MENU_ID as Mo, whenFormulaEditorActivated as yt, whenSheetEditorFocused as xo, SheetsUIPart as wo, BaseSelectionRenderService as ko, getCoordByOffset as Un, checkInHeaderRanges as Vn, getAllSelection as Ao, genNormalSelectionStyle as mr, getSheetObject as Fo, MoveSelectionCommand as Wn, JumpOver as Hn, ExpandSelectionCommand as Bn, EMBEDDING_FORMULA_EDITOR as Do, IMarkSelectionService as Lo, RANGE_SELECTOR_COMPONENT_KEY as $o, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as Po } from "@univerjs/sheets-ui";
6
- import { sequenceNodeType as Q, serializeRange as Ee, FormulaDataModel as Tt, LexerTreeBuilder as ye, ErrorType as ue, extractFormulaError as pr, SetFormulaCalculationResultMutation as Uo, SetArrayFormulaDataMutation as Vo, SetFormulaCalculationStopMutation as Wo, FunctionType as Sr, matchToken as Ge, deserializeRangeWithSheetWithCache as Ho, matchRefDrawToken as Bo, isFormulaLexerToken as qo, deserializeRangeWithSheet as ht, serializeRangeToRefString as jo, serializeRangeWithSheet as _t, serializeRangeWithSpreadsheet as Ko, generateStringWithSequence as Yo, operatorToken as vr } from "@univerjs/engine-formula";
7
- import { Subject as pt, debounceTime as Sn, combineLatestWith as Go, map as Cr, switchMap as Zo, of as qn, Observable as zo, BehaviorSubject as _r, throttleTime as Xo, filter as Rr, distinctUntilChanged as Qo, merge as Jo } from "rxjs";
8
- import { IEditorService as ze, DocSelectionRenderService as Ir, ReplaceTextRunsCommand as jn, MoveSelectionOperation as es, MoveCursorOperation as ts, useKeyboardEvent as ns, useResize as rs, DocBackScrollRenderController as os, RichTextEditor as ss } from "@univerjs/docs-ui";
9
- import { DeviceInputEventType as xe, IRenderManagerService as Te, ScrollTimerType as en, SHEET_VIEWPORT_KEY as Kn, Vector2 as Yn } from "@univerjs/engine-render";
10
- import { SheetsSelectionsService as vn, getSheetCommandTarget as Er, getCellAtRowCol as is, SetSelectionsOperation as Cn, SheetInterceptorService as _n, ReorderRangeCommand as cs, SetRangeValuesMutation as Lt, SetRangeValuesUndoMutationFactory as ls, BEFORE_CELL_EDIT as as, SetWorksheetRowAutoHeightMutation as us, INTERCEPTOR_POINT as ds, WorksheetSetCellValuePermission as Xe, WorksheetEditPermission as Qe, RangeProtectionPermissionEditPoint as Je, WorkbookEditablePermission as et, RangeProtectionPermissionViewPoint as hs, WorksheetCopyPermission as fs, WorkbookCopyPermission as gs, IRefSelectionsService as Gt, SelectionMoveType as tn, convertSelectionDataToRange as ms, setEndForRange as ps, REF_SELECTIONS_ENABLED as Gn, SetWorksheetActiveOperation as Zn } from "@univerjs/sheets";
11
- import { InsertFunctionCommand as Ss, TriggerCalculationController as vs, IDescriptionService as Zt, QuickSumCommand as Cs, ImageFormulaCellInterceptorController as _s, UniverSheetsFormulaPlugin as Rs } from "@univerjs/sheets-formula";
12
- import { ISidebarService as Rn, IZenZoneService as Is, useDependency as O, useObservable as _e, ProgressBar as Es, getMenuHiddenObservable as Pe, MenuItemType as Ue, IClipboardInterfaceService as zn, RibbonFormulasGroup as Xn, KeyCode as $, MetaKeys as V, IMenuManagerService as bs, IShortcutService as zt, IUIPartsService as br, ComponentManager as yr, connectInjector as Tr, useEvent as ee, RectPopup as cn, IContextMenuService as ys, useUpdateEffect as Ts, BuiltInUIPart as Os } from "@univerjs/ui";
13
- import { jsx as x, jsxs as B, Fragment as Ns } from "react/jsx-runtime";
14
- import { useCallback as $t, useState as H, useRef as z, createElement as tt, forwardRef as Ve, useEffect as P, useMemo as le, useLayoutEffect as Pt, useImperativeHandle as Ms } from "react";
15
- import { clsx as se, scrollbarClassName as ut, borderLeftClassName as xs, Select as ws, Input as Or, borderClassName as In, Button as at, borderTopClassName as ks, Tooltip as As, Dialog as Fs } from "@univerjs/design";
16
- import { DocSelectionManagerService as Nr } from "@univerjs/docs";
17
- import { debounceTime as Ds } from "rxjs/operators";
1
+ var Xr = Object.defineProperty;
2
+ var Qr = (e, t, n) => t in e ? Xr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var j = (e, t, n) => Qr(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { CommandType as be, ICommandService as pe, createIdentifier as Jr, IContextService as dn, IUniverInstanceService as ne, Rectangle as hn, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as fn, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as or, DEFAULT_EMPTY_DOCUMENT_VALUE as sr, isRealNum as eo, CellValueType as Dn, getCellValueType as to, Inject as q, Disposable as Ze, ObjectMatrix as Fe, Range as no, Tools as gn, LocaleService as dt, isICellData as ro, isFormulaString as Ce, isFormulaId as De, generateRandomId as Yt, Direction as de, Injector as It, getEmptyCell as mt, UniverInstanceType as V, ThemeService as Et, ILogService as oo, toDisposable as ir, ColorKit as mn, RxDisposable as so, InterceptorEffectEnum as io, FOCUSING_DOC as co, FOCUSING_UNIVER_EDITOR as lo, DisposableCollection as Ye, RANGE_TYPE as Ie, getBodySlice as Ln, EDITOR_ACTIVATED as $n, createInternalEditorID as ao, BuildTextUtils as uo, IConfigService as cr, RichTextBuilder as ho, DependentOn as fo, Plugin as go, merge as mo, registerDependencies as po, touchDependencies as So } from "@univerjs/core";
5
+ import { ISheetClipboardService as lr, PREDEFINED_HOOK_NAME_COPY as ar, SheetPasteCommand as vo, PREDEFINED_HOOK_NAME_PASTE as lt, IEditorBridgeService as pn, SetCellEditVisibleOperation as ur, HoverManagerService as Co, CellAlertManagerService as _o, CellAlertType as Ro, IAutoFillService as Io, APPLY_TYPE as Eo, DATA_TYPE as Pn, COPY_TYPE as dr, SheetSkeletonManagerService as bt, attachSelectionWithCoord as sn, SelectionControl as hr, SELECTION_SHAPE_DEPTH as bo, useActiveWorkbook as yo, menuClipboardDisabledObservable as To, getCurrentRangeDisable$ as $e, PASTE_SPECIAL_MENU_ID as Oo, COPY_SPECIAL_MENU_ID as No, whenFormulaEditorActivated as yt, whenSheetEditorFocused as Mo, SheetsUIPart as xo, BaseSelectionRenderService as wo, getCoordByOffset as Un, checkInHeaderRanges as Vn, getAllSelection as ko, genNormalSelectionStyle as fr, getSheetObject as Ao, MoveSelectionCommand as Wn, JumpOver as Hn, ExpandSelectionCommand as Bn, EMBEDDING_FORMULA_EDITOR as Fo, IMarkSelectionService as Do, RANGE_SELECTOR_COMPONENT_KEY as Lo, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as $o } from "@univerjs/sheets-ui";
6
+ import { sequenceNodeType as Q, serializeRange as Ee, FormulaDataModel as Tt, LexerTreeBuilder as ye, ErrorType as ue, extractFormulaError as gr, SetFormulaCalculationResultMutation as Po, SetArrayFormulaDataMutation as Uo, SetFormulaCalculationStopMutation as Vo, FunctionType as mr, matchToken as Ge, deserializeRangeWithSheetWithCache as Wo, matchRefDrawToken as Ho, isFormulaLexerToken as Bo, deserializeRangeWithSheet as ht, serializeRangeToRefString as qo, serializeRangeWithSheet as _t, serializeRangeWithSpreadsheet as jo, generateStringWithSequence as Ko, operatorToken as pr } from "@univerjs/engine-formula";
7
+ import { Subject as pt, debounceTime as Sn, combineLatestWith as Yo, map as Sr, BehaviorSubject as vr, throttleTime as Go, filter as Cr, distinctUntilChanged as Zo, merge as zo } from "rxjs";
8
+ import { IEditorService as ze, DocSelectionRenderService as _r, ReplaceTextRunsCommand as qn, 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 Te, ScrollTimerType as en, SHEET_VIEWPORT_KEY as jn, Vector2 as Kn } from "@univerjs/engine-render";
10
+ import { SheetsSelectionsService as vn, getSheetCommandTarget as Rr, getCellAtRowCol as rs, SetSelectionsOperation as Cn, SheetInterceptorService as _n, ReorderRangeCommand as os, SetRangeValuesMutation as Lt, SetRangeValuesUndoMutationFactory as ss, BEFORE_CELL_EDIT as is, SetWorksheetRowAutoHeightMutation as cs, INTERCEPTOR_POINT as ls, WorksheetSetCellValuePermission as Xe, WorksheetEditPermission as Qe, RangeProtectionPermissionEditPoint as Je, WorkbookEditablePermission as et, RangeProtectionPermissionViewPoint as as, WorksheetCopyPermission as us, WorkbookCopyPermission as ds, IRefSelectionsService as Gt, SelectionMoveType as tn, convertSelectionDataToRange as hs, setEndForRange as fs, REF_SELECTIONS_ENABLED as Yn, SetWorksheetActiveOperation as Gn } from "@univerjs/sheets";
11
+ import { InsertFunctionCommand as gs, TriggerCalculationController as ms, IDescriptionService as Zt, QuickSumCommand as ps, ImageFormulaCellInterceptorController as Ss, UniverSheetsFormulaPlugin as vs } from "@univerjs/sheets-formula";
12
+ import { ISidebarService as Rn, IZenZoneService as Cs, useDependency as O, useObservable as _e, ProgressBar as _s, getMenuHiddenObservable as Pe, MenuItemType as Ue, RibbonFormulasGroup as Zn, KeyCode as $, MetaKeys as U, IMenuManagerService as Rs, IShortcutService as zt, IUIPartsService as Ir, ComponentManager as Er, connectInjector as br, useEvent as ee, RectPopup as cn, IContextMenuService as Is, useUpdateEffect as Es, BuiltInUIPart as bs } from "@univerjs/ui";
13
+ import { jsx as w, jsxs as B, Fragment as ys } from "react/jsx-runtime";
14
+ import { useCallback as $t, useState as H, useRef as z, createElement as tt, forwardRef as Ve, useEffect as P, useMemo as le, useLayoutEffect as Pt, useImperativeHandle as Ts } from "react";
15
+ import { clsx as se, scrollbarClassName as ut, borderLeftClassName as Os, Select as Ns, Input as yr, borderClassName as In, Button as at, borderTopClassName as Ms, Tooltip as xs, Dialog as ws } from "@univerjs/design";
16
+ import { DocSelectionManagerService as Tr } from "@univerjs/docs";
17
+ import { debounceTime as ks } from "rxjs/operators";
18
18
  const En = {
19
19
  id: "sheet.command.copy-formula-only",
20
20
  type: be.COMMAND,
21
- handler: async (e) => e.get(ur).copy({
22
- copyHookType: dr.SPECIAL_COPY_FORMULA_ONLY
21
+ handler: async (e) => e.get(lr).copy({
22
+ copyHookType: ar.SPECIAL_COPY_FORMULA_ONLY
23
23
  })
24
24
  }, bn = {
25
25
  id: "sheet.command.paste-formula",
26
26
  type: be.COMMAND,
27
- handler: async (e) => e.get(pe).executeCommand(_o.id, {
27
+ handler: async (e) => e.get(pe).executeCommand(vo.id, {
28
28
  value: lt.SPECIAL_PASTE_FORMULA
29
29
  })
30
30
  }, ft = {
@@ -32,12 +32,12 @@ const En = {
32
32
  type: be.OPERATION,
33
33
  handler: (e, t) => !0
34
34
  };
35
- var Ls = Object.getOwnPropertyDescriptor, $s = (e, t, n, o) => {
36
- for (var r = o > 1 ? void 0 : o ? Ls(t, n) : t, s = e.length - 1, i; s >= 0; s--)
35
+ var As = Object.getOwnPropertyDescriptor, Fs = (e, t, n, o) => {
36
+ for (var r = o > 1 ? void 0 : o ? As(t, n) : t, s = e.length - 1, i; s >= 0; s--)
37
37
  (i = e[s]) && (r = i(r) || r);
38
38
  return r;
39
- }, Ps = (e, t) => (n, o) => t(n, o, e);
40
- const Us = "FORMULA_PROMPT_ACTIVATED", Xt = to("formula-ui.prompt-service");
39
+ }, Ds = (e, t) => (n, o) => t(n, o, e);
40
+ const Ls = "FORMULA_PROMPT_ACTIVATED", Xt = Jr("formula-ui.prompt-service");
41
41
  let ln = class {
42
42
  constructor(e) {
43
43
  j(this, "_search$", new pt());
@@ -61,7 +61,7 @@ let ln = class {
61
61
  this._search$.complete(), this._help$.complete(), this._navigate$.complete(), this._accept$.complete(), this._acceptFormulaName$.complete(), this._sequenceNodes = [];
62
62
  }
63
63
  search(e) {
64
- this._contextService.setContextValue(Us, e.visible), this._searching = e.visible, this._search$.next(e);
64
+ this._contextService.setContextValue(Ls, e.visible), this._searching = e.visible, this._search$.next(e);
65
65
  }
66
66
  isSearching() {
67
67
  return this._searching;
@@ -193,10 +193,10 @@ let ln = class {
193
193
  return this._isLockedOnSelectionInsertRefString;
194
194
  }
195
195
  };
196
- ln = $s([
197
- Ps(0, dn)
196
+ ln = Fs([
197
+ Ds(0, dn)
198
198
  ], ln);
199
- const Vs = {
199
+ const $s = {
200
200
  id: "formula-ui.operation.help-function",
201
201
  type: be.OPERATION,
202
202
  handler: async (e, t) => (e.get(Xt).help(t), !0)
@@ -209,23 +209,23 @@ const Vs = {
209
209
  const n = e.get(vn), o = e.get(ze), r = n.getCurrentSelections();
210
210
  if (!r || !r.length)
211
211
  return !1;
212
- const s = Er(e.get(te));
212
+ const s = Rr(e.get(ne));
213
213
  if (!s) return !1;
214
214
  const { worksheet: i, unitId: c, subUnitId: a } = s, h = i.getCellMatrix(), { value: f } = t, m = e.get(pe);
215
215
  e.get(pn);
216
216
  const d = [], u = [];
217
217
  let l = null, v = 0, S = 0, g = "";
218
- if (r.length === 1 && (Bs(r[0].range) || qs(r[0].range) && Jn(h, r[0].range))) {
218
+ if (r.length === 1 && (Vs(r[0].range) || Ws(r[0].range) && Xn(h, r[0].range))) {
219
219
  const { range: E, primary: p } = r[0], b = (C = p == null ? void 0 : p.actualRow) != null ? C : E.startRow, y = (_ = p == null ? void 0 : p.actualColumn) != null ? _ : E.startColumn;
220
220
  l = E, v = b, S = y;
221
- const A = Qn(h, b, y);
221
+ const A = zn(h, b, y);
222
222
  A && (g = Ee(A));
223
223
  } else
224
224
  r.some((E) => {
225
225
  var y, A;
226
226
  const { range: p, primary: b } = E;
227
- if (Jn(h, p)) {
228
- const F = (y = b == null ? void 0 : b.actualRow) != null ? y : p.startRow, N = (A = b == null ? void 0 : b.actualColumn) != null ? A : p.startColumn, M = Qn(h, F, N);
227
+ if (Xn(h, p)) {
228
+ const F = (y = b == null ? void 0 : b.actualRow) != null ? y : p.startRow, N = (A = b == null ? void 0 : b.actualColumn) != null ? A : p.startColumn, M = zn(h, F, N);
229
229
  if (!M)
230
230
  return l = p, v = F, S = N, !0;
231
231
  const k = Ee(M), I = `=${f}(${k})`;
@@ -240,11 +240,11 @@ const Vs = {
240
240
  } else {
241
241
  const { startRow: F, startColumn: N, endRow: M, endColumn: k } = p;
242
242
  if (F === M) {
243
- const I = js(h, F, k, i.getColumnCount() - 1), w = I === k ? k - 1 : k, R = Ee({
243
+ const I = Hs(h, F, k, i.getColumnCount() - 1), x = I === k ? k - 1 : k, R = Ee({
244
244
  startRow: F,
245
245
  endRow: M,
246
246
  startColumn: N,
247
- endColumn: w
247
+ endColumn: x
248
248
  }), T = `=${f}(${R})`;
249
249
  u.push({
250
250
  range: p,
@@ -257,14 +257,14 @@ const Vs = {
257
257
  } else {
258
258
  let I = -1;
259
259
  for (let R = N; R <= k; R++) {
260
- const T = Ks(h, R, M, i.getRowCount() - 1);
260
+ const T = Bs(h, R, M, i.getRowCount() - 1);
261
261
  I = Math.max(I, T);
262
262
  }
263
- const w = I === M ? M - 1 : M;
263
+ const x = I === M ? M - 1 : M;
264
264
  for (let R = N; R <= k; R++) {
265
265
  const T = Ee({
266
266
  startRow: F,
267
- endRow: w,
267
+ endRow: x,
268
268
  startColumn: R,
269
269
  endColumn: R
270
270
  }), D = `=${f}(${T})`;
@@ -282,7 +282,7 @@ const Vs = {
282
282
  return !1;
283
283
  });
284
284
  if (l) {
285
- const E = is(v, S, i), p = {
285
+ const E = rs(v, S, i), p = {
286
286
  range: hn.clone(l),
287
287
  primary: {
288
288
  startRow: E.startRow,
@@ -300,8 +300,8 @@ const Vs = {
300
300
  selections: [p]
301
301
  };
302
302
  await m.executeCommand(Cn.id, b);
303
- const y = o.getEditor(fn), A = o.getEditor(ir);
304
- m.syncExecuteCommand(hr.id, {
303
+ const y = o.getEditor(fn), A = o.getEditor(or);
304
+ m.syncExecuteCommand(ur.id, {
305
305
  visible: !0,
306
306
  unitId: c,
307
307
  eventType: xe.Dblclick
@@ -309,14 +309,14 @@ const Vs = {
309
309
  const F = `=${f}(${g}`;
310
310
  y == null || y.replaceText(F), A == null || A.replaceText(F, !1);
311
311
  }
312
- return d.length === 0 && u.length === 0 ? !1 : m.executeCommand(Ss.id, {
312
+ return d.length === 0 && u.length === 0 ? !1 : m.executeCommand(gs.id, {
313
313
  list: d,
314
314
  listOfRangeHasNumber: u
315
315
  });
316
316
  }
317
317
  };
318
- function Qn(e, t, n) {
319
- const o = Ws(e, t, n);
318
+ function zn(e, t, n) {
319
+ const o = Ps(e, t, n);
320
320
  if (o !== t)
321
321
  return {
322
322
  startRow: o,
@@ -324,7 +324,7 @@ function Qn(e, t, n) {
324
324
  startColumn: n,
325
325
  endColumn: n
326
326
  };
327
- const r = Hs(e, t, n);
327
+ const r = Us(e, t, n);
328
328
  return r !== n ? {
329
329
  startRow: t,
330
330
  endRow: t,
@@ -332,7 +332,7 @@ function Qn(e, t, n) {
332
332
  endColumn: n - 1
333
333
  } : null;
334
334
  }
335
- function Ws(e, t, n) {
335
+ function Ps(e, t, n) {
336
336
  let o = !1;
337
337
  if (t === 0) return t;
338
338
  for (let r = t - 1; r >= 0; r--) {
@@ -349,7 +349,7 @@ function Ws(e, t, n) {
349
349
  }
350
350
  return t;
351
351
  }
352
- function Hs(e, t, n) {
352
+ function Us(e, t, n) {
353
353
  let o = !1;
354
354
  if (n === 0) return n;
355
355
  for (let r = n - 1; r >= 0; r--) {
@@ -371,54 +371,54 @@ function Rt(e) {
371
371
  const t = e == null ? void 0 : e.p.body;
372
372
  if (t == null)
373
373
  return !1;
374
- const n = t.dataStream, r = n.substring(n.length - 2, n.length) === cr ? n.substring(0, n.length - 2) : n;
375
- return no(r);
374
+ const n = t.dataStream, r = n.substring(n.length - 2, n.length) === sr ? n.substring(0, n.length - 2) : n;
375
+ return eo(r);
376
376
  }
377
- return e && (e.t === Dn.NUMBER || ro(e) === Dn.NUMBER);
377
+ return e && (e.t === Dn.NUMBER || to(e) === Dn.NUMBER);
378
378
  }
379
- function Bs(e) {
379
+ function Vs(e) {
380
380
  return e.startRow === e.endRow && e.startColumn === e.endColumn;
381
381
  }
382
- function qs(e) {
382
+ function Ws(e) {
383
383
  return e.startRow !== e.endRow && e.startColumn !== e.endColumn;
384
384
  }
385
- function Jn(e, t) {
385
+ function Xn(e, t) {
386
386
  for (let n = t.startRow; n <= t.endRow; n++)
387
387
  for (let o = t.startColumn; o <= t.endColumn; o++)
388
388
  if (Rt(e.getValue(n, o)))
389
389
  return !1;
390
390
  return !0;
391
391
  }
392
- function js(e, t, n, o) {
392
+ function Hs(e, t, n, o) {
393
393
  for (let r = n; r <= o; r++)
394
394
  if (!e.getValue(t, r))
395
395
  return r;
396
396
  return o;
397
397
  }
398
- function Ks(e, t, n, o) {
398
+ function Bs(e, t, n, o) {
399
399
  for (let r = n; r <= o; r++)
400
400
  if (!e.getValue(r, t))
401
401
  return r;
402
402
  return o;
403
403
  }
404
- const Mr = "SHEET_FORMULA_UI_PLUGIN", xr = `${Mr}_MORE_FUNCTIONS_COMPONENT`, yn = {
404
+ const Or = "SHEET_FORMULA_UI_PLUGIN", Nr = `${Or}_MORE_FUNCTIONS_COMPONENT`, yn = {
405
405
  id: "formula-ui.operation.more-functions",
406
406
  type: be.OPERATION,
407
407
  handler: async (e) => (e.get(Rn).open({
408
408
  header: { title: "formula.insert.tooltip" },
409
- children: { label: xr }
409
+ children: { label: Nr }
410
410
  }), !0)
411
- }, wr = {
411
+ }, Mr = {
412
412
  id: "formula-ui.operation.change-ref-to-absolute",
413
413
  type: be.OPERATION,
414
414
  handler: async (e) => !0
415
- }, Ys = {
415
+ }, qs = {
416
416
  id: "formula-ui.operation.search-function",
417
417
  type: be.OPERATION,
418
418
  handler: async (e, t) => (e.get(Xt).search(t), !0)
419
419
  };
420
- var Gs = Object.getOwnPropertyDescriptor, Zs = (e, t, n, o) => {
421
- for (var r = o > 1 ? void 0 : o ? Gs(t, n) : t, s = e.length - 1, i; s >= 0; s--)
420
+ var js = Object.getOwnPropertyDescriptor, Ks = (e, t, n, o) => {
421
+ for (var r = o > 1 ? void 0 : o ? js(t, n) : t, s = e.length - 1, i; s >= 0; s--)
422
422
  (i = e[s]) && (r = i(r) || r);
423
423
  return r;
424
424
  }, At = (e, t) => (n, o) => t(n, o, e);
@@ -428,7 +428,7 @@ let Ut = class extends Ze {
428
428
  }
429
429
  _initialize() {
430
430
  this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
431
- getMutations: (e) => e.id === cs.id ? this._reorderFormula(e.params) : {
431
+ getMutations: (e) => e.id === os.id ? this._reorderFormula(e.params) : {
432
432
  redos: [],
433
433
  undos: []
434
434
  }
@@ -443,7 +443,7 @@ let Ut = class extends Ze {
443
443
  };
444
444
  const h = a.getCellMatrix(), f = new Fe(), m = new Fe();
445
445
  let d = !1;
446
- return oo.foreach(s, (u, l) => {
446
+ return no.foreach(s, (u, l) => {
447
447
  let v = u;
448
448
  i.hasOwnProperty(u) && (v = i[u]);
449
449
  const S = h.getValue(v, l);
@@ -481,19 +481,19 @@ let Ut = class extends Ze {
481
481
  };
482
482
  }
483
483
  };
484
- Ut = Zs([
484
+ Ut = Ks([
485
485
  At(0, q(_n)),
486
- At(1, q(te)),
486
+ At(1, q(ne)),
487
487
  At(2, q(Tt)),
488
488
  At(3, q(ye))
489
489
  ], Ut);
490
- const kr = "sheets-formula-ui.base.config", er = {};
491
- var zs = Object.getOwnPropertyDescriptor, Xs = (e, t, n, o) => {
492
- for (var r = o > 1 ? void 0 : o ? zs(t, n) : t, s = e.length - 1, i; s >= 0; s--)
490
+ const xr = "sheets-formula-ui.base.config", Qn = {};
491
+ var Ys = Object.getOwnPropertyDescriptor, Gs = (e, t, n, o) => {
492
+ for (var r = o > 1 ? void 0 : o ? Ys(t, n) : t, s = e.length - 1, i; s >= 0; s--)
493
493
  (i = e[s]) && (r = i(r) || r);
494
494
  return r;
495
495
  }, St = (e, t) => (n, o) => t(n, o, e);
496
- const nn = "SHEET_FORMULA_ALERT", Qs = {
496
+ const nn = "SHEET_FORMULA_ALERT", Zs = {
497
497
  [ue.DIV_BY_ZERO]: "divByZero",
498
498
  [ue.NAME]: "name",
499
499
  [ue.VALUE]: "value",
@@ -521,8 +521,8 @@ let an = class extends Ze {
521
521
  const c = this._context.unit.getActiveSheet();
522
522
  if (!c) return this._hideAlert();
523
523
  const a = c.getCell(e.location.row, e.location.col), h = (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];
524
- if (so(a)) {
525
- const f = pr(a, !!h);
524
+ if (ro(a)) {
525
+ const f = gr(a, !!h);
526
526
  if (!f) {
527
527
  this._hideAlert();
528
528
  return;
@@ -533,9 +533,9 @@ let an = class extends Ze {
533
533
  return;
534
534
  }
535
535
  this._cellAlertManagerService.showAlert({
536
- type: Eo.ERROR,
536
+ type: Ro.ERROR,
537
537
  title: this._localeService.t("formula.error.title"),
538
- message: this._localeService.t(`formula.error.${Qs[f]}`),
538
+ message: this._localeService.t(`formula.error.${Zs[f]}`),
539
539
  location: e.location,
540
540
  width: 200,
541
541
  height: 74,
@@ -556,18 +556,18 @@ let an = class extends Ze {
556
556
  this._cellAlertManagerService.removeAlert(nn);
557
557
  }
558
558
  };
559
- an = Xs([
560
- St(1, q(Ro)),
561
- St(2, q(Io)),
559
+ an = Gs([
560
+ St(1, q(Co)),
561
+ St(2, q(_o)),
562
562
  St(3, q(dt)),
563
563
  St(4, q(Tt)),
564
- St(5, Is)
564
+ St(5, Cs)
565
565
  ], an);
566
- var Js = Object.getOwnPropertyDescriptor, ei = (e, t, n, o) => {
567
- for (var r = o > 1 ? void 0 : o ? Js(t, n) : t, s = e.length - 1, i; s >= 0; s--)
566
+ var zs = Object.getOwnPropertyDescriptor, Xs = (e, t, n, o) => {
567
+ for (var r = o > 1 ? void 0 : o ? zs(t, n) : t, s = e.length - 1, i; s >= 0; s--)
568
568
  (i = e[s]) && (r = i(r) || r);
569
569
  return r;
570
- }, tr = (e, t) => (n, o) => t(n, o, e);
570
+ }, Jn = (e, t) => (n, o) => t(n, o, e);
571
571
  let Vt = class extends Ze {
572
572
  constructor(e, t) {
573
573
  super(), this._autoFillService = e, this._lexerTreeBuilder = t, this._registerAutoFill();
@@ -579,7 +579,7 @@ let Vt = class extends Ze {
579
579
  match: (t) => Ce(t == null ? void 0 : t.f) || De(t == null ? void 0 : t.si),
580
580
  isContinue: (t, n) => t.type === Pn.FORMULA,
581
581
  applyFunctions: {
582
- [yo.COPY]: (t, n, o, r, s) => {
582
+ [Eo.COPY]: (t, n, o, r, s) => {
583
583
  const { data: i, index: c } = t;
584
584
  return this._fillCopyFormula(i, n, o, c, r, s);
585
585
  }
@@ -589,7 +589,7 @@ let Vt = class extends Ze {
589
589
  }
590
590
  _fillCopyFormula(e, t, n, o, r, s) {
591
591
  var h, f;
592
- const i = ni(r), c = [], a = /* @__PURE__ */ new Map();
592
+ const i = Js(r), c = [], a = /* @__PURE__ */ new Map();
593
593
  for (let m = 1; m <= t; m++) {
594
594
  const d = (m - 1) % e.length, u = o[d], l = gn.deepClone(e[d]);
595
595
  if (l) {
@@ -602,7 +602,7 @@ let Vt = class extends Ze {
602
602
  l.si = _, l.f = null, l.v = null, l.p = null, l.t = null;
603
603
  else {
604
604
  _ = Yt(6), a.set(d, _);
605
- const { offsetX: E, offsetY: p } = ti(i, t, n, s, u), b = this._lexerTreeBuilder.moveFormulaRefOffset(
605
+ const { offsetX: E, offsetY: p } = Qs(i, t, n, s, u), b = this._lexerTreeBuilder.moveFormulaRefOffset(
606
606
  v,
607
607
  E,
608
608
  p
@@ -616,11 +616,11 @@ let Vt = class extends Ze {
616
616
  return c;
617
617
  }
618
618
  };
619
- Vt = ei([
620
- tr(0, bo),
621
- tr(1, q(ye))
619
+ Vt = Xs([
620
+ Jn(0, Io),
621
+ Jn(1, q(ye))
622
622
  ], Vt);
623
- function ti(e, t, n, o, r) {
623
+ function Qs(e, t, n, o, r) {
624
624
  const { source: s, target: i } = o, { rows: c } = i, { rows: a } = s;
625
625
  let h = 0, f = 0;
626
626
  switch (n) {
@@ -639,7 +639,7 @@ function ti(e, t, n, o, r) {
639
639
  }
640
640
  return { offsetX: h, offsetY: f };
641
641
  }
642
- function ni(e) {
642
+ function Js(e) {
643
643
  let t = 0;
644
644
  for (const n in e)
645
645
  e[n].forEach((o) => {
@@ -647,12 +647,12 @@ function ni(e) {
647
647
  });
648
648
  return t;
649
649
  }
650
- var ri = Object.getOwnPropertyDescriptor, oi = (e, t, n, o) => {
651
- for (var r = o > 1 ? void 0 : o ? ri(t, n) : t, s = e.length - 1, i; s >= 0; s--)
650
+ var ei = Object.getOwnPropertyDescriptor, ti = (e, t, n, o) => {
651
+ for (var r = o > 1 ? void 0 : o ? ei(t, n) : t, s = e.length - 1, i; s >= 0; s--)
652
652
  (i = e[s]) && (r = i(r) || r);
653
653
  return r;
654
654
  }, vt = (e, t) => (n, o) => t(n, o, e);
655
- const si = "default-paste-formula";
655
+ const ni = "default-paste-formula";
656
656
  let Wt = class extends Ze {
657
657
  constructor(e, t, n, o, r) {
658
658
  super(), this._univerInstanceService = e, this._lexerTreeBuilder = t, this._sheetClipboardService = n, this._injector = o, this._formulaDataModel = r, this._initialize();
@@ -667,7 +667,7 @@ let Wt = class extends Ze {
667
667
  const e = this;
668
668
  let t = null;
669
669
  return {
670
- id: dr.SPECIAL_COPY_FORMULA_ONLY,
670
+ id: ar.SPECIAL_COPY_FORMULA_ONLY,
671
671
  priority: 10,
672
672
  onBeforeCopy(n, o) {
673
673
  t = e._getWorksheet(n, o);
@@ -715,13 +715,13 @@ let Wt = class extends Ze {
715
715
  }
716
716
  _pasteWithFormulaHook() {
717
717
  return {
718
- id: si,
718
+ id: ni,
719
719
  priority: 10,
720
720
  onPasteCells: (e, t, n, o) => this._onPasteCells(e, t, n, o, !1)
721
721
  };
722
722
  }
723
723
  _getWorkbook(e) {
724
- return e ? this._univerInstanceService.getUnit(e, U.UNIVER_SHEET) : this._univerInstanceService.getCurrentUnitOfType(U.UNIVER_SHEET);
724
+ return e ? this._univerInstanceService.getUnit(e, V.UNIVER_SHEET) : this._univerInstanceService.getCurrentUnitOfType(V.UNIVER_SHEET);
725
725
  }
726
726
  _getWorksheet(e, t) {
727
727
  const n = this._getWorkbook(e);
@@ -744,11 +744,11 @@ let Wt = class extends Ze {
744
744
  redos: []
745
745
  };
746
746
  const h = t.range, f = n, m = {
747
- copyType: o.copyType || fr.COPY,
747
+ copyType: o.copyType || dr.COPY,
748
748
  copyRange: e == null ? void 0 : e.range,
749
749
  pasteType: o.pasteType
750
750
  };
751
- return this._injector.invoke((u) => ii(
751
+ return this._injector.invoke((u) => ri(
752
752
  c,
753
753
  a,
754
754
  h,
@@ -762,15 +762,15 @@ let Wt = class extends Ze {
762
762
  ));
763
763
  }
764
764
  };
765
- Wt = oi([
766
- vt(0, te),
765
+ Wt = ti([
766
+ vt(0, ne),
767
767
  vt(1, q(ye)),
768
- vt(2, ur),
768
+ vt(2, lr),
769
769
  vt(3, q(It)),
770
770
  vt(4, q(Tt))
771
771
  ], Wt);
772
- function ii(e, t, n, o, r, s, i, c, a = !1, h) {
773
- const f = [], m = [], d = ci(e, t, n, o, s, i, c, h);
772
+ function ri(e, t, n, o, r, s, i, c, a = !1, h) {
773
+ const f = [], m = [], d = oi(e, t, n, o, s, i, c, h);
774
774
  if (!d.hasValue())
775
775
  return {
776
776
  undos: [],
@@ -785,7 +785,7 @@ function ii(e, t, n, o, r, s, i, c, a = !1, h) {
785
785
  id: Lt.id,
786
786
  params: u
787
787
  });
788
- const l = ls(
788
+ const l = ss(
789
789
  r,
790
790
  u
791
791
  );
@@ -797,10 +797,10 @@ function ii(e, t, n, o, r, s, i, c, a = !1, h) {
797
797
  redos: f
798
798
  };
799
799
  }
800
- function ci(e, t, n, o, r, s, i, c) {
801
- return c ? r.pasteType === lt.SPECIAL_PASTE_VALUE ? ai(e, t, n, o, i, c) : r.pasteType === lt.SPECIAL_PASTE_FORMULA ? ui(e, t, n, o, s, i, c) : di(e, t, n, o, r.copyType, s, i, c) : li(e, t, n, o, i);
800
+ function oi(e, t, n, o, r, s, i, c) {
801
+ return c ? r.pasteType === lt.SPECIAL_PASTE_VALUE ? ii(e, t, n, o, i, c) : r.pasteType === lt.SPECIAL_PASTE_FORMULA ? ci(e, t, n, o, s, i, c) : li(e, t, n, o, r.copyType, s, i, c) : si(e, t, n, o, i);
802
802
  }
803
- function li(e, t, n, o, r) {
803
+ function si(e, t, n, o, r) {
804
804
  const s = new Fe(), i = r.getSheetFormulaData(e, t);
805
805
  return o.forValue((c, a, h) => {
806
806
  var u;
@@ -808,7 +808,7 @@ function li(e, t, n, o, r) {
808
808
  Ce(h.v) ? (d.v = null, d.f = `${h.v}`, d.si = null, d.p = null, s.setValue(f, m, d)) : (u = i == null ? void 0 : i[f]) != null && u[m] && (d.v = h.v, d.f = null, d.si = null, d.p = null, s.setValue(f, m, d));
809
809
  }), s;
810
810
  }
811
- function ai(e, t, n, o, r, s) {
811
+ function ii(e, t, n, o, r, s) {
812
812
  var h, f;
813
813
  const i = new Fe(), c = (f = (h = r.getArrayFormulaCellData()) == null ? void 0 : h[s.unitId]) == null ? void 0 : f[s.subUnitId], a = r.getSheetFormulaData(e, t);
814
814
  return o.forValue((m, d, u) => {
@@ -821,14 +821,14 @@ function ai(e, t, n, o, r, s) {
821
821
  C.v = p.v, C.f = null, C.si = null, C.p = null, i.setValue(S, g, C);
822
822
  } else if ((E = a == null ? void 0 : a[S]) != null && E[g]) {
823
823
  if (C.v = u.v, C.f = null, C.si = null, C.p = null, u.p) {
824
- const p = Ar(u);
824
+ const p = wr(u);
825
825
  p && (C.v = p);
826
826
  }
827
827
  i.setValue(S, g, C);
828
828
  }
829
829
  }), i;
830
830
  }
831
- function ui(e, t, n, o, r, s, i) {
831
+ function ci(e, t, n, o, r, s, i) {
832
832
  const c = new Fe(), a = /* @__PURE__ */ new Map();
833
833
  return o.forValue((h, f, m) => {
834
834
  const d = n.rows[h], u = n.cols[f], l = {};
@@ -857,16 +857,16 @@ function ui(e, t, n, o, r, s, i) {
857
857
  l.v = null, l.p = null, c.setValue(d, u, l);
858
858
  } else {
859
859
  if (l.v = m.v, l.f = null, l.si = null, l.p = null, m.p) {
860
- const v = Ar(m);
860
+ const v = wr(m);
861
861
  v && (l.v = v);
862
862
  }
863
863
  c.setValue(d, u, l);
864
864
  }
865
865
  }), c;
866
866
  }
867
- function di(e, t, n, o, r, s, i, c) {
867
+ function li(e, t, n, o, r, s, i, c) {
868
868
  const a = new Fe(), h = /* @__PURE__ */ new Map(), f = i.getSheetFormulaData(e, t), m = [];
869
- return r === fr.CUT ? o.forValue((d, u, l) => {
869
+ return r === dr.CUT ? o.forValue((d, u, l) => {
870
870
  const v = n.rows[d], S = n.cols[u], g = {};
871
871
  if (De(l.si)) {
872
872
  if (Ce(l.f))
@@ -928,17 +928,17 @@ function di(e, t, n, o, r, s, i, c) {
928
928
  }
929
929
  }), a;
930
930
  }
931
- function Ar(e) {
931
+ function wr(e) {
932
932
  if (e != null && e.p) {
933
933
  const t = e == null ? void 0 : e.p.body;
934
934
  if (t == null)
935
935
  return;
936
936
  const n = t.dataStream;
937
- return n.substring(n.length - 2, n.length) === cr ? n.substring(0, n.length - 2) : n;
937
+ return n.substring(n.length - 2, n.length) === sr ? n.substring(0, n.length - 2) : n;
938
938
  }
939
939
  }
940
- var hi = Object.getOwnPropertyDescriptor, fi = (e, t, n, o) => {
941
- for (var r = o > 1 ? void 0 : o ? hi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
940
+ var ai = Object.getOwnPropertyDescriptor, ui = (e, t, n, o) => {
941
+ for (var r = o > 1 ? void 0 : o ? ai(t, n) : t, s = e.length - 1, i; s >= 0; s--)
942
942
  (i = e[s]) && (r = i(r) || r);
943
943
  return r;
944
944
  }, je = (e, t) => (n, o) => t(n, o, e);
@@ -972,8 +972,8 @@ let Ht = class extends Ze {
972
972
  }
973
973
  _initInterceptorEditorStart() {
974
974
  this.disposeWithMe(
975
- lr(
976
- this._sheetInterceptorService.writeCellInterceptor.intercept(as, {
975
+ ir(
976
+ this._sheetInterceptorService.writeCellInterceptor.intercept(is, {
977
977
  handler: (t, n, o) => {
978
978
  var l, v, S, g;
979
979
  const { row: r, col: s, unitId: i, subUnitId: c, worksheet: a } = n, h = this._formulaDataModel.getArrayFormulaRange(), f = this._formulaDataModel.getArrayFormulaCellData();
@@ -992,10 +992,10 @@ let Ht = class extends Ze {
992
992
  }
993
993
  _commandExecutedListener() {
994
994
  this.disposeWithMe(this._commandService.onCommandExecuted((t, n) => {
995
- (t.id === Uo.id || t.id === Vo.id && n && n.remove) && this._removeArrayFormulaRangeShape();
995
+ (t.id === Po.id || t.id === Uo.id && n && n.remove) && this._removeArrayFormulaRangeShape();
996
996
  })), this.disposeWithMe(
997
997
  this._commandService.beforeCommandExecuted((t) => {
998
- us.id === t.id && requestIdleCallback(() => {
998
+ cs.id === t.id && requestIdleCallback(() => {
999
999
  const n = t.params, { unitId: o, subUnitId: r, rowsAutoHeightInfo: s } = n;
1000
1000
  this._refreshArrayFormulaRangeShapeByRow(o, r, s);
1001
1001
  });
@@ -1032,7 +1032,7 @@ let Ht = class extends Ze {
1032
1032
  fill: new mn(this._themeService.getColorFromTheme("white")).setAlpha(0).toString(),
1033
1033
  widgets: {}
1034
1034
  }
1035
- }, c = sn(i, r), { rowHeaderWidth: a, columnHeaderHeight: h } = r, f = new gr(s, To.FORMULA_EDITOR_SHOW, this._themeService, {
1035
+ }, c = sn(i, r), { rowHeaderWidth: a, columnHeaderHeight: h } = r, f = new hr(s, bo.FORMULA_EDITOR_SHOW, this._themeService, {
1036
1036
  highlightHeader: !1,
1037
1037
  rowHeaderWidth: a,
1038
1038
  columnHeaderHeight: h
@@ -1075,38 +1075,38 @@ let Ht = class extends Ze {
1075
1075
  }
1076
1076
  }
1077
1077
  };
1078
- Ht = fi([
1078
+ Ht = ui([
1079
1079
  je(1, q(_n)),
1080
1080
  je(2, q(Tt)),
1081
1081
  je(3, q(Et)),
1082
1082
  je(4, Te),
1083
1083
  je(5, q(bt)),
1084
1084
  je(6, pe),
1085
- je(7, io)
1085
+ je(7, oo)
1086
1086
  ], Ht);
1087
- var gi = Object.getOwnPropertyDescriptor, mi = (e, t, n, o) => {
1088
- for (var r = o > 1 ? void 0 : o ? gi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
1087
+ var di = Object.getOwnPropertyDescriptor, hi = (e, t, n, o) => {
1088
+ for (var r = o > 1 ? void 0 : o ? di(t, n) : t, s = e.length - 1, i; s >= 0; s--)
1089
1089
  (i = e[s]) && (r = i(r) || r);
1090
1090
  return r;
1091
- }, nr = (e, t) => (n, o) => t(n, o, e);
1092
- const pi = {
1091
+ }, er = (e, t) => (n, o) => t(n, o, e);
1092
+ const fi = {
1093
1093
  tl: {
1094
1094
  size: 6,
1095
1095
  color: "#409f11"
1096
1096
  }
1097
1097
  };
1098
- let Bt = class extends co {
1098
+ let Bt = class extends so {
1099
1099
  constructor(e, t) {
1100
1100
  super(), this._sheetInterceptorService = e, this._formulaDataModel = t, this.disposeWithMe(this._sheetInterceptorService.intercept(
1101
- ds.CELL_CONTENT,
1101
+ ls.CELL_CONTENT,
1102
1102
  {
1103
- effect: lo.Style,
1103
+ effect: io.Style,
1104
1104
  handler: (n, o, r) => {
1105
1105
  var c, a, h, f;
1106
1106
  const s = (f = (h = (a = (c = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : c[o.unitId]) == null ? void 0 : a[o.subUnitId]) == null ? void 0 : h[o.row]) == null ? void 0 : f[o.col];
1107
- return !pr(n, !!s) || !n || (n === o.rawData && (n = { ...o.rawData }), n.markers = {
1107
+ return !gr(n, !!s) || !n || (n === o.rawData && (n = { ...o.rawData }), n.markers = {
1108
1108
  ...n == null ? void 0 : n.markers,
1109
- ...pi
1109
+ ...fi
1110
1110
  }), r(n);
1111
1111
  },
1112
1112
  priority: 10
@@ -1114,25 +1114,25 @@ let Bt = class extends co {
1114
1114
  ));
1115
1115
  }
1116
1116
  };
1117
- Bt = mi([
1118
- nr(0, q(_n)),
1119
- nr(1, q(Tt))
1117
+ Bt = hi([
1118
+ er(0, q(_n)),
1119
+ er(1, q(Tt))
1120
1120
  ], Bt);
1121
- function Si() {
1122
- const e = O(vs), t = O(pe), n = _e(e.progress$), o = $t(() => {
1123
- t.executeCommand(Wo.id);
1121
+ function gi() {
1122
+ const e = O(ms), t = O(pe), n = _e(e.progress$), o = $t(() => {
1123
+ t.executeCommand(Vo.id);
1124
1124
  }, [t]), r = $t(() => {
1125
1125
  e.clearProgress();
1126
1126
  }, [e]);
1127
- return /* @__PURE__ */ x(Es, { progress: n, onTerminate: o, onClearProgress: r });
1127
+ return /* @__PURE__ */ w(_s, { progress: n, onTerminate: o, onClearProgress: r });
1128
1128
  }
1129
- function vi(e, t) {
1129
+ function mi(e, t) {
1130
1130
  return Object.keys(e).filter((n) => isNaN(Number(n)) && n !== "DefinedName" && n !== "Table").map((n) => ({
1131
1131
  label: t.t(`formula.functionType.${n.toLocaleLowerCase()}`),
1132
1132
  value: `${e[n]}`
1133
1133
  }));
1134
1134
  }
1135
- function Fr(e) {
1135
+ function kr(e) {
1136
1136
  if (!e.require && !e.repeat)
1137
1137
  return `[${e.name}]`;
1138
1138
  if (e.require && !e.repeat)
@@ -1142,7 +1142,7 @@ function Fr(e) {
1142
1142
  if (e.require && e.repeat)
1143
1143
  return `${e.name},...`;
1144
1144
  }
1145
- function Dr(e) {
1145
+ function Ar(e) {
1146
1146
  const { prefix: t, value: n } = e;
1147
1147
  return /* @__PURE__ */ B("div", { children: [
1148
1148
  /* @__PURE__ */ B("span", { children: [
@@ -1150,7 +1150,7 @@ function Dr(e) {
1150
1150
  "("
1151
1151
  ] }),
1152
1152
  n && n.map((o, r) => /* @__PURE__ */ B("span", { children: [
1153
- /* @__PURE__ */ x("span", { children: Fr(o) }),
1153
+ /* @__PURE__ */ w("span", { children: kr(o) }),
1154
1154
  r === n.length - 1 ? "" : ","
1155
1155
  ] }, r)),
1156
1156
  ")"
@@ -1159,14 +1159,14 @@ function Dr(e) {
1159
1159
  function Ct(e) {
1160
1160
  const { className: t, value: n, title: o } = e;
1161
1161
  return /* @__PURE__ */ B("div", { className: "univer-mb-2 univer-text-xs", children: [
1162
- /* @__PURE__ */ x(
1162
+ /* @__PURE__ */ w(
1163
1163
  "div",
1164
1164
  {
1165
1165
  className: se("univer-mb-2 univer-font-medium univer-text-gray-500 dark:!univer-text-gray-300", t),
1166
1166
  children: o
1167
1167
  }
1168
1168
  ),
1169
- /* @__PURE__ */ x(
1169
+ /* @__PURE__ */ w(
1170
1170
  "div",
1171
1171
  {
1172
1172
  className: "univer-break-all univer-text-gray-900 dark:!univer-text-white",
@@ -1175,27 +1175,27 @@ function Ct(e) {
1175
1175
  )
1176
1176
  ] });
1177
1177
  }
1178
- function Ci(e) {
1178
+ function pi(e) {
1179
1179
  const { functionInfo: t, onChange: n } = e;
1180
1180
  if (!t) return null;
1181
1181
  const [o, r] = H([]), [s, i] = H(t.functionParameter), [c, a] = H(-1);
1182
1182
  return /* @__PURE__ */ B("div", { children: [
1183
- /* @__PURE__ */ x("div", { className: se("univer-h-[364px] univer-overflow-y-auto", ut), children: s.map((h, f) => /* @__PURE__ */ B("div", { children: [
1184
- /* @__PURE__ */ x("div", { className: "univer-text-sm", children: h.name }),
1185
- /* @__PURE__ */ x("div", { className: "univer-mb-2 univer-mt-1" })
1183
+ /* @__PURE__ */ w("div", { className: se("univer-h-[364px] univer-overflow-y-auto", ut), children: s.map((h, f) => /* @__PURE__ */ B("div", { children: [
1184
+ /* @__PURE__ */ w("div", { className: "univer-text-sm", children: h.name }),
1185
+ /* @__PURE__ */ w("div", { className: "univer-mb-2 univer-mt-1" })
1186
1186
  ] }, f)) }),
1187
- /* @__PURE__ */ x("div", { className: se("univer-flex-1 univer-p-3", xs), children: /* @__PURE__ */ x(
1187
+ /* @__PURE__ */ w("div", { className: se("univer-flex-1 univer-p-3", Os), children: /* @__PURE__ */ w(
1188
1188
  Ct,
1189
1189
  {
1190
- title: c === -1 ? /* @__PURE__ */ x(Dr, { prefix: t.functionName, value: s }) : s[c].name,
1190
+ title: c === -1 ? /* @__PURE__ */ w(Ar, { prefix: t.functionName, value: s }) : s[c].name,
1191
1191
  value: c === -1 ? t.description : s[c].detail
1192
1192
  }
1193
1193
  ) })
1194
1194
  ] });
1195
1195
  }
1196
1196
  function nt({ ref: e, ...t }) {
1197
- const { icon: n, id: o, className: r, extend: s, ...i } = t, c = `univerjs-icon univerjs-icon-${o} ${r || ""}`.trim(), a = z(`_${Ii()}`);
1198
- return Lr(n, `${o}`, {
1197
+ const { icon: n, id: o, className: r, extend: s, ...i } = t, c = `univerjs-icon univerjs-icon-${o} ${r || ""}`.trim(), a = z(`_${Ci()}`);
1198
+ return Fr(n, `${o}`, {
1199
1199
  defIds: n.defIds,
1200
1200
  idSuffix: a.current
1201
1201
  }, {
@@ -1204,14 +1204,14 @@ function nt({ ref: e, ...t }) {
1204
1204
  ...i
1205
1205
  }, s);
1206
1206
  }
1207
- function Lr(e, t, n, o, r) {
1207
+ function Fr(e, t, n, o, r) {
1208
1208
  return tt(e.tag, {
1209
1209
  key: t,
1210
- ..._i(e, n, r),
1210
+ ...Si(e, n, r),
1211
1211
  ...o
1212
- }, (Ri(e, n).children || []).map((s, i) => Lr(s, `${t}-${e.tag}-${i}`, n, void 0, r)));
1212
+ }, (vi(e, n).children || []).map((s, i) => Fr(s, `${t}-${e.tag}-${i}`, n, void 0, r)));
1213
1213
  }
1214
- function _i(e, t, n) {
1214
+ function Si(e, t, n) {
1215
1215
  const o = { ...e.attrs };
1216
1216
  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]) => {
1217
1217
  s === "mask" && typeof i == "string" && (o[s] = i.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
@@ -1221,7 +1221,7 @@ function _i(e, t, n) {
1221
1221
  typeof i == "string" && (o[s] = i.replace(/url\(#(.*)\)/, `url(#$1${t.idSuffix})`));
1222
1222
  })), o;
1223
1223
  }
1224
- function Ri(e, t) {
1224
+ function vi(e, t) {
1225
1225
  var o;
1226
1226
  const { defIds: n } = t;
1227
1227
  return !n || n.length === 0 ? e : e.tag === "defs" && ((o = e.children) != null && o.length) ? {
@@ -1235,11 +1235,11 @@ function Ri(e, t) {
1235
1235
  } : r)
1236
1236
  } : e;
1237
1237
  }
1238
- function Ii() {
1238
+ function Ci() {
1239
1239
  return Math.random().toString(36).substring(2, 8);
1240
1240
  }
1241
1241
  nt.displayName = "UniverIcon";
1242
- const Ei = {
1242
+ const _i = {
1243
1243
  tag: "svg",
1244
1244
  attrs: {
1245
1245
  xmlns: "http://www.w3.org/2000/svg",
@@ -1257,15 +1257,15 @@ const Ei = {
1257
1257
  clipRule: "evenodd"
1258
1258
  }
1259
1259
  }]
1260
- }, $r = Ve(function(t, n) {
1260
+ }, Dr = Ve(function(t, n) {
1261
1261
  return tt(nt, Object.assign({}, t, {
1262
1262
  id: "check-mark-icon",
1263
1263
  ref: n,
1264
- icon: Ei
1264
+ icon: _i
1265
1265
  }));
1266
1266
  });
1267
- $r.displayName = "CheckMarkIcon";
1268
- const bi = {
1267
+ Dr.displayName = "CheckMarkIcon";
1268
+ const Ri = {
1269
1269
  tag: "svg",
1270
1270
  attrs: {
1271
1271
  xmlns: "http://www.w3.org/2000/svg",
@@ -1281,15 +1281,15 @@ const bi = {
1281
1281
  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"
1282
1282
  }
1283
1283
  }]
1284
- }, Pr = Ve(function(t, n) {
1284
+ }, Lr = Ve(function(t, n) {
1285
1285
  return tt(nt, Object.assign({}, t, {
1286
1286
  id: "close-icon",
1287
1287
  ref: n,
1288
- icon: bi
1288
+ icon: Ri
1289
1289
  }));
1290
1290
  });
1291
- Pr.displayName = "CloseIcon";
1292
- const yi = {
1291
+ Lr.displayName = "CloseIcon";
1292
+ const Ii = {
1293
1293
  tag: "svg",
1294
1294
  attrs: {
1295
1295
  xmlns: "http://www.w3.org/2000/svg",
@@ -1330,15 +1330,15 @@ const yi = {
1330
1330
  }
1331
1331
  }
1332
1332
  ]
1333
- }, Ur = Ve(function(t, n) {
1333
+ }, $r = Ve(function(t, n) {
1334
1334
  return tt(nt, Object.assign({}, t, {
1335
1335
  id: "delete-icon",
1336
1336
  ref: n,
1337
- icon: yi
1337
+ icon: Ii
1338
1338
  }));
1339
1339
  });
1340
- Ur.displayName = "DeleteIcon";
1341
- const Ti = {
1340
+ $r.displayName = "DeleteIcon";
1341
+ const Ei = {
1342
1342
  tag: "svg",
1343
1343
  attrs: {
1344
1344
  xmlns: "http://www.w3.org/2000/svg",
@@ -1354,15 +1354,15 @@ const Ti = {
1354
1354
  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"
1355
1355
  }
1356
1356
  }]
1357
- }, Vr = Ve(function(t, n) {
1357
+ }, Pr = Ve(function(t, n) {
1358
1358
  return tt(nt, Object.assign({}, t, {
1359
1359
  id: "increase-icon",
1360
1360
  ref: n,
1361
- icon: Ti
1361
+ icon: Ei
1362
1362
  }));
1363
1363
  });
1364
- Vr.displayName = "IncreaseIcon";
1365
- const Oi = {
1364
+ Pr.displayName = "IncreaseIcon";
1365
+ const bi = {
1366
1366
  tag: "svg",
1367
1367
  attrs: {
1368
1368
  xmlns: "http://www.w3.org/2000/svg",
@@ -1380,15 +1380,15 @@ const Oi = {
1380
1380
  clipRule: "evenodd"
1381
1381
  }
1382
1382
  }]
1383
- }, Wr = Ve(function(t, n) {
1383
+ }, Ur = Ve(function(t, n) {
1384
1384
  return tt(nt, Object.assign({}, t, {
1385
1385
  id: "more-icon",
1386
1386
  ref: n,
1387
- icon: Oi
1387
+ icon: bi
1388
1388
  }));
1389
1389
  });
1390
- Wr.displayName = "MoreIcon";
1391
- const Ni = {
1390
+ Ur.displayName = "MoreIcon";
1391
+ const yi = {
1392
1392
  tag: "svg",
1393
1393
  attrs: {
1394
1394
  xmlns: "http://www.w3.org/2000/svg",
@@ -1412,16 +1412,16 @@ const Ni = {
1412
1412
  clipRule: "evenodd"
1413
1413
  }
1414
1414
  }]
1415
- }, Hr = Ve(function(t, n) {
1415
+ }, Vr = Ve(function(t, n) {
1416
1416
  return tt(nt, Object.assign({}, t, {
1417
1417
  id: "select-range-icon",
1418
1418
  ref: n,
1419
- icon: Ni
1419
+ icon: yi
1420
1420
  }));
1421
1421
  });
1422
- Hr.displayName = "SelectRangeIcon";
1423
- function Mi(e) {
1424
- const { onChange: t } = e, n = "-1", [o, r] = H(""), [s, i] = H([]), [c, a] = H(0), [h, f] = H(n), [m, d] = H(0), [u, l] = H(null), v = O(Zt), S = O(dt), g = O(Rn), C = _e(g.sidebarOptions$), _ = vi(Sr, S);
1422
+ Vr.displayName = "SelectRangeIcon";
1423
+ function Ti(e) {
1424
+ const { onChange: t } = e, n = "-1", [o, r] = H(""), [s, i] = H([]), [c, a] = H(0), [h, f] = H(n), [m, d] = H(0), [u, l] = H(null), v = O(Zt), S = O(dt), g = O(Rn), C = _e(g.sidebarOptions$), _ = mi(mr, S);
1425
1425
  _.unshift({
1426
1426
  label: S.t("formula.moreFunctions.allFunctions"),
1427
1427
  value: n
@@ -1436,38 +1436,38 @@ function Mi(e) {
1436
1436
  }, [C]);
1437
1437
  const b = (I) => {
1438
1438
  if (o.trim() === "") return I;
1439
- const w = new RegExp(`(${o.toLocaleUpperCase()})`);
1440
- return I.split(w).filter(Boolean).map((T, D) => T.match(w) ? /* @__PURE__ */ x("span", { className: "univer-text-red-500", children: T }, D) : T);
1439
+ const x = new RegExp(`(${o.toLocaleUpperCase()})`);
1440
+ return I.split(x).filter(Boolean).map((T, D) => T.match(x) ? /* @__PURE__ */ w("span", { className: "univer-text-red-500", children: T }, D) : T);
1441
1441
  }, y = (I) => {
1442
1442
  if (s.length === 0) {
1443
1443
  l(null);
1444
1444
  return;
1445
1445
  }
1446
1446
  d(I);
1447
- const w = v.getFunctionInfo(s[I].name);
1448
- if (!w) {
1447
+ const x = v.getFunctionInfo(s[I].name);
1448
+ if (!x) {
1449
1449
  l(null);
1450
1450
  return;
1451
1451
  }
1452
- l(w), t(w);
1452
+ l(x), t(x);
1453
1453
  };
1454
1454
  function A(I) {
1455
1455
  f(I);
1456
- const w = v.getSearchListByType(+I);
1457
- i(w);
1456
+ const x = v.getSearchListByType(+I);
1457
+ i(x);
1458
1458
  }
1459
1459
  function F(I) {
1460
1460
  r(I);
1461
- const w = v.getSearchListByName(I);
1462
- i(w);
1461
+ const x = v.getSearchListByName(I);
1462
+ i(x);
1463
1463
  }
1464
1464
  function N(I) {
1465
1465
  if (I.stopPropagation(), I.key === "ArrowDown") {
1466
- const w = c + 1;
1467
- a(w === s.length ? 0 : w);
1466
+ const x = c + 1;
1467
+ a(x === s.length ? 0 : x);
1468
1468
  } else if (I.key === "ArrowUp") {
1469
- const w = c - 1;
1470
- a(w === -1 ? s.length - 1 : w);
1469
+ const x = c - 1;
1470
+ a(x === -1 ? s.length - 1 : x);
1471
1471
  } else I.key === "Enter" && y(c);
1472
1472
  }
1473
1473
  const M = (I) => {
@@ -1477,9 +1477,9 @@ function Mi(e) {
1477
1477
  };
1478
1478
  return /* @__PURE__ */ B("div", { children: [
1479
1479
  /* @__PURE__ */ B("div", { className: "univer-flex univer-items-center univer-justify-between univer-gap-2", children: [
1480
- /* @__PURE__ */ x(ws, { value: h, options: _, onChange: A }),
1481
- /* @__PURE__ */ x(
1482
- Or,
1480
+ /* @__PURE__ */ w(Ns, { value: h, options: _, onChange: A }),
1481
+ /* @__PURE__ */ w(
1482
+ yr,
1483
1483
  {
1484
1484
  placeholder: S.t("formula.moreFunctions.searchFunctionPlaceholder"),
1485
1485
  onKeyDown: N,
@@ -1490,52 +1490,52 @@ function Mi(e) {
1490
1490
  }
1491
1491
  )
1492
1492
  ] }),
1493
- s.length > 0 && /* @__PURE__ */ x(
1493
+ s.length > 0 && /* @__PURE__ */ w(
1494
1494
  "ul",
1495
1495
  {
1496
1496
  className: se("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", In, ut),
1497
1497
  onKeyDown: N,
1498
1498
  tabIndex: -1,
1499
- children: s.map(({ name: I }, w) => /* @__PURE__ */ B(
1499
+ children: s.map(({ name: I }, x) => /* @__PURE__ */ B(
1500
1500
  "li",
1501
1501
  {
1502
1502
  className: se("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", {
1503
- "univer-bg-gray-200 dark:!univer-bg-gray-600": c === w
1503
+ "univer-bg-gray-200 dark:!univer-bg-gray-600": c === x
1504
1504
  }),
1505
- onMouseEnter: () => M(w),
1505
+ onMouseEnter: () => M(x),
1506
1506
  onMouseLeave: k,
1507
- onClick: () => y(w),
1507
+ onClick: () => y(x),
1508
1508
  children: [
1509
- m === w && /* @__PURE__ */ x(
1510
- $r,
1509
+ m === x && /* @__PURE__ */ w(
1510
+ Dr,
1511
1511
  {
1512
1512
  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"
1513
1513
  }
1514
1514
  ),
1515
- /* @__PURE__ */ x("span", { className: "univer-block", children: b(I) })
1515
+ /* @__PURE__ */ w("span", { className: "univer-block", children: b(I) })
1516
1516
  ]
1517
1517
  },
1518
- w
1518
+ x
1519
1519
  ))
1520
1520
  }
1521
1521
  ),
1522
1522
  u && /* @__PURE__ */ B("div", { className: se("univer-mx-0 univer-my-2 univer-overflow-y-auto", ut), children: [
1523
- /* @__PURE__ */ x(Ct, { title: u.functionName, value: u.description }),
1524
- /* @__PURE__ */ x(
1523
+ /* @__PURE__ */ w(Ct, { title: u.functionName, value: u.description }),
1524
+ /* @__PURE__ */ w(
1525
1525
  Ct,
1526
1526
  {
1527
1527
  title: S.t("formula.moreFunctions.syntax"),
1528
- value: /* @__PURE__ */ x(Dr, { prefix: u.functionName, value: u.functionParameter })
1528
+ value: /* @__PURE__ */ w(Ar, { prefix: u.functionName, value: u.functionParameter })
1529
1529
  }
1530
1530
  ),
1531
- /* @__PURE__ */ x(
1531
+ /* @__PURE__ */ w(
1532
1532
  Ct,
1533
1533
  {
1534
1534
  title: S.t("formula.prompt.helpExample"),
1535
1535
  value: `${u.functionName}(${u.functionParameter.map((I) => I.example).join(",")})`
1536
1536
  }
1537
1537
  ),
1538
- u.functionParameter && u.functionParameter.map((I) => /* @__PURE__ */ x(
1538
+ u.functionParameter && u.functionParameter.map((I) => /* @__PURE__ */ w(
1539
1539
  Ct,
1540
1540
  {
1541
1541
  title: I.name,
@@ -1546,22 +1546,22 @@ function Mi(e) {
1546
1546
  ] })
1547
1547
  ] });
1548
1548
  }
1549
- function xi() {
1550
- const e = Oo(), [t, n] = H(!0), [o, r] = H(!1), [s, i] = H(null);
1549
+ function Oi() {
1550
+ const e = yo(), [t, n] = H(!0), [o, r] = H(!1), [s, i] = H(null);
1551
1551
  O(pn);
1552
- const c = O(dt), a = O(ze), h = O(te), f = O(pe);
1552
+ const c = O(dt), a = O(ze), h = O(ne), f = O(pe);
1553
1553
  function m() {
1554
1554
  n(!t), r(!o);
1555
1555
  }
1556
1556
  function d() {
1557
- const u = Er(h);
1557
+ const u = Rr(h);
1558
1558
  if (!u) return;
1559
- f.executeCommand(hr.id, {
1559
+ f.executeCommand(ur.id, {
1560
1560
  visible: !0,
1561
1561
  unitId: u.unitId,
1562
1562
  eventType: xe.Dblclick
1563
1563
  });
1564
- const l = a.getEditor(fn), v = a.getEditor(ir), S = `=${s == null ? void 0 : s.functionName}(`;
1564
+ const l = a.getEditor(fn), v = a.getEditor(or), S = `=${s == null ? void 0 : s.functionName}(`;
1565
1565
  l == null || l.replaceText(S), v == null || v.replaceText(S, !1);
1566
1566
  }
1567
1567
  return /* @__PURE__ */ B(
@@ -1570,11 +1570,11 @@ function xi() {
1570
1570
  "data-u-comp": "sheets-formula-functions-panel",
1571
1571
  className: "univer-box-border univer-flex univer-h-full univer-flex-col univer-justify-between univer-py-2",
1572
1572
  children: [
1573
- t && /* @__PURE__ */ x(Mi, { onChange: i }),
1574
- o && /* @__PURE__ */ x(Ci, { functionInfo: s, onChange: () => {
1573
+ t && /* @__PURE__ */ w(Ti, { onChange: i }),
1574
+ o && /* @__PURE__ */ w(pi, { functionInfo: s, onChange: () => {
1575
1575
  } }),
1576
1576
  /* @__PURE__ */ B("div", { className: "univer-flex univer-justify-end", children: [
1577
- o && /* @__PURE__ */ x(
1577
+ o && /* @__PURE__ */ w(
1578
1578
  at,
1579
1579
  {
1580
1580
  variant: "primary",
@@ -1583,8 +1583,8 @@ function xi() {
1583
1583
  children: c.t("formula.moreFunctions.next")
1584
1584
  }
1585
1585
  ),
1586
- o && /* @__PURE__ */ x(at, { onClick: m, className: "univer-mb-5 univer-ml-4 univer-mr-0 univer-mt-0", children: c.t("formula.moreFunctions.prev") }),
1587
- t && !!e && /* @__PURE__ */ x(
1586
+ o && /* @__PURE__ */ w(at, { onClick: m, className: "univer-mb-5 univer-ml-4 univer-mr-0 univer-mt-0", children: c.t("formula.moreFunctions.prev") }),
1587
+ t && !!e && /* @__PURE__ */ w(
1588
1588
  at,
1589
1589
  {
1590
1590
  variant: "primary",
@@ -1598,7 +1598,7 @@ function xi() {
1598
1598
  }
1599
1599
  );
1600
1600
  }
1601
- function wi(e) {
1601
+ function Ni(e) {
1602
1602
  return {
1603
1603
  id: ve.id,
1604
1604
  title: "SUM",
@@ -1607,7 +1607,7 @@ function wi(e) {
1607
1607
  params: {
1608
1608
  value: "SUM"
1609
1609
  },
1610
- hidden$: Pe(e, U.UNIVER_SHEET),
1610
+ hidden$: Pe(e, V.UNIVER_SHEET),
1611
1611
  disabled$: $e(e, {
1612
1612
  workbookTypes: [et],
1613
1613
  worksheetTypes: [Qe, Xe],
@@ -1615,7 +1615,7 @@ function wi(e) {
1615
1615
  })
1616
1616
  };
1617
1617
  }
1618
- function ki(e) {
1618
+ function Mi(e) {
1619
1619
  return {
1620
1620
  id: ve.id,
1621
1621
  title: "COUNT",
@@ -1624,7 +1624,7 @@ function ki(e) {
1624
1624
  params: {
1625
1625
  value: "COUNT"
1626
1626
  },
1627
- hidden$: Pe(e, U.UNIVER_SHEET),
1627
+ hidden$: Pe(e, V.UNIVER_SHEET),
1628
1628
  disabled$: $e(e, {
1629
1629
  workbookTypes: [et],
1630
1630
  worksheetTypes: [Qe, Xe],
@@ -1632,7 +1632,7 @@ function ki(e) {
1632
1632
  })
1633
1633
  };
1634
1634
  }
1635
- function Ai(e) {
1635
+ function xi(e) {
1636
1636
  return {
1637
1637
  id: ve.id,
1638
1638
  title: "AVERAGE",
@@ -1641,7 +1641,7 @@ function Ai(e) {
1641
1641
  params: {
1642
1642
  value: "AVERAGE"
1643
1643
  },
1644
- hidden$: Pe(e, U.UNIVER_SHEET),
1644
+ hidden$: Pe(e, V.UNIVER_SHEET),
1645
1645
  disabled$: $e(e, {
1646
1646
  workbookTypes: [et],
1647
1647
  worksheetTypes: [Qe, Xe],
@@ -1649,7 +1649,7 @@ function Ai(e) {
1649
1649
  })
1650
1650
  };
1651
1651
  }
1652
- function Fi(e) {
1652
+ function wi(e) {
1653
1653
  return {
1654
1654
  id: ve.id,
1655
1655
  title: "MAX",
@@ -1658,7 +1658,7 @@ function Fi(e) {
1658
1658
  params: {
1659
1659
  value: "MAX"
1660
1660
  },
1661
- hidden$: Pe(e, U.UNIVER_SHEET),
1661
+ hidden$: Pe(e, V.UNIVER_SHEET),
1662
1662
  disabled$: $e(e, {
1663
1663
  workbookTypes: [et],
1664
1664
  worksheetTypes: [Qe, Xe],
@@ -1666,7 +1666,7 @@ function Fi(e) {
1666
1666
  })
1667
1667
  };
1668
1668
  }
1669
- function Di(e) {
1669
+ function ki(e) {
1670
1670
  return {
1671
1671
  id: ve.id,
1672
1672
  title: "MIN",
@@ -1675,7 +1675,7 @@ function Di(e) {
1675
1675
  params: {
1676
1676
  value: "MIN"
1677
1677
  },
1678
- hidden$: Pe(e, U.UNIVER_SHEET),
1678
+ hidden$: Pe(e, V.UNIVER_SHEET),
1679
1679
  disabled$: $e(e, {
1680
1680
  workbookTypes: [et],
1681
1681
  worksheetTypes: [Qe, Xe],
@@ -1683,13 +1683,13 @@ function Di(e) {
1683
1683
  })
1684
1684
  };
1685
1685
  }
1686
- function Li(e) {
1686
+ function Ai(e) {
1687
1687
  return {
1688
1688
  id: yn.id,
1689
1689
  title: "formula.insert.more",
1690
1690
  tooltip: "formula.insert.tooltip",
1691
1691
  type: Ue.BUTTON,
1692
- hidden$: Pe(e, U.UNIVER_SHEET),
1692
+ hidden$: Pe(e, V.UNIVER_SHEET),
1693
1693
  disabled$: $e(e, {
1694
1694
  workbookTypes: [et],
1695
1695
  worksheetTypes: [Qe, Xe],
@@ -1697,94 +1697,89 @@ function Li(e) {
1697
1697
  })
1698
1698
  };
1699
1699
  }
1700
- function $i(e) {
1701
- return e.get(te).getCurrentTypeOfUnit$(U.UNIVER_SHEET).pipe(
1702
- Zo((o) => o ? e.get(zn) ? new zo((s) => s.next(!e.get(zn).supportClipboard)) : qn(!0) : qn(!0))
1703
- );
1704
- }
1705
- function Pi(e) {
1700
+ function Fi(e) {
1706
1701
  return {
1707
1702
  id: En.id,
1708
1703
  type: Ue.BUTTON,
1709
1704
  title: "formula.operation.copyFormulaOnly",
1710
1705
  disabled$: $e(e, {
1711
- workbookTypes: [gs],
1712
- worksheetTypes: [fs],
1713
- rangeTypes: [hs]
1706
+ workbookTypes: [ds],
1707
+ worksheetTypes: [us],
1708
+ rangeTypes: [as]
1714
1709
  }),
1715
- hidden$: Pe(e, U.UNIVER_SHEET)
1710
+ hidden$: Pe(e, V.UNIVER_SHEET)
1716
1711
  };
1717
1712
  }
1718
- function Ui(e) {
1713
+ function Di(e) {
1719
1714
  return {
1720
1715
  id: bn.id,
1721
1716
  type: Ue.BUTTON,
1722
1717
  title: "formula.operation.pasteFormula",
1723
- disabled$: $i(e).pipe(
1724
- Go($e(e, {
1718
+ disabled$: To(e).pipe(
1719
+ Yo($e(e, {
1725
1720
  workbookTypes: [et],
1726
1721
  rangeTypes: [Je],
1727
1722
  worksheetTypes: [Xe, Qe]
1728
1723
  })),
1729
- Cr(([t, n]) => t || n)
1724
+ Sr(([t, n]) => t || n)
1730
1725
  ),
1731
- hidden$: Pe(e, U.UNIVER_SHEET)
1726
+ hidden$: Pe(e, V.UNIVER_SHEET)
1732
1727
  };
1733
1728
  }
1734
- const Vi = {
1735
- [Xn.BASIC]: {
1729
+ const Li = {
1730
+ [Zn.BASIC]: {
1736
1731
  [`${ve.id}.sum`]: {
1737
1732
  order: 0,
1738
- menuItemFactory: wi
1733
+ menuItemFactory: Ni
1739
1734
  },
1740
1735
  [`${ve.id}.count`]: {
1741
1736
  order: 1,
1742
- menuItemFactory: ki
1737
+ menuItemFactory: Mi
1743
1738
  },
1744
1739
  [`${ve.id}.average`]: {
1745
1740
  order: 2,
1746
- menuItemFactory: Ai
1741
+ menuItemFactory: xi
1747
1742
  },
1748
1743
  [`${ve.id}.max`]: {
1749
1744
  order: 3,
1750
- menuItemFactory: Fi
1745
+ menuItemFactory: wi
1751
1746
  },
1752
1747
  [`${ve.id}.min`]: {
1753
1748
  order: 4,
1754
- menuItemFactory: Di
1749
+ menuItemFactory: ki
1755
1750
  }
1756
1751
  },
1757
- [Xn.OTHERS]: {
1752
+ [Zn.OTHERS]: {
1758
1753
  [yn.id]: {
1759
1754
  order: 0,
1760
- menuItemFactory: Li
1755
+ menuItemFactory: Ai
1761
1756
  }
1762
1757
  },
1763
- [Mo]: {
1758
+ [No]: {
1764
1759
  [En.id]: {
1765
1760
  order: 0,
1766
- menuItemFactory: Pi
1761
+ menuItemFactory: Fi
1767
1762
  }
1768
1763
  },
1769
- [No]: {
1764
+ [Oo]: {
1770
1765
  [bn.id]: {
1771
1766
  order: 4,
1772
- menuItemFactory: Ui
1767
+ menuItemFactory: Di
1773
1768
  }
1774
1769
  }
1775
- }, Wi = "meta_key_ctrl_And_Shift";
1776
- function Hi(e) {
1777
- return e.getContextValue(ao) && e.getContextValue(uo);
1770
+ }, $i = "meta_key_ctrl_And_Shift";
1771
+ function Pi(e) {
1772
+ return e.getContextValue(co) && e.getContextValue(lo);
1778
1773
  }
1779
1774
  const Qt = [
1780
1775
  $.ARROW_DOWN,
1781
1776
  $.ARROW_UP,
1782
1777
  $.ARROW_LEFT,
1783
1778
  $.ARROW_RIGHT
1784
- ], Bi = [...Qt, $.ENTER, $.TAB, $.ESC];
1785
- function qi() {
1779
+ ], Ui = [...Qt, $.ENTER, $.TAB, $.ESC];
1780
+ function Vi() {
1786
1781
  const e = [];
1787
- for (const t of Bi)
1782
+ for (const t of Ui)
1788
1783
  e.push({
1789
1784
  id: ft.id,
1790
1785
  binding: t,
@@ -1796,63 +1791,63 @@ function qi() {
1796
1791
  });
1797
1792
  return e;
1798
1793
  }
1799
- function ji() {
1794
+ function Wi() {
1800
1795
  const e = [];
1801
1796
  for (const t of Qt)
1802
1797
  e.push({
1803
1798
  id: ft.id,
1804
- binding: t | V.SHIFT,
1799
+ binding: t | U.SHIFT,
1805
1800
  preconditions: (n) => yt(n),
1806
1801
  staticParameters: {
1807
1802
  eventType: xe.Keyboard,
1808
1803
  keycode: t,
1809
- metaKey: V.SHIFT
1804
+ metaKey: U.SHIFT
1810
1805
  }
1811
1806
  });
1812
1807
  return e;
1813
1808
  }
1814
- function Ki() {
1809
+ function Hi() {
1815
1810
  const e = [];
1816
1811
  for (const t of Qt)
1817
1812
  e.push({
1818
1813
  id: ft.id,
1819
- binding: t | V.CTRL_COMMAND,
1814
+ binding: t | U.CTRL_COMMAND,
1820
1815
  preconditions: (n) => yt(n),
1821
1816
  staticParameters: {
1822
1817
  eventType: xe.Keyboard,
1823
1818
  keycode: t,
1824
- metaKey: V.CTRL_COMMAND
1819
+ metaKey: U.CTRL_COMMAND
1825
1820
  }
1826
1821
  });
1827
1822
  return e;
1828
1823
  }
1829
- function Yi() {
1824
+ function Bi() {
1830
1825
  const e = [];
1831
1826
  for (const t of Qt)
1832
1827
  e.push({
1833
1828
  id: ft.id,
1834
- binding: t | V.SHIFT | V.CTRL_COMMAND,
1829
+ binding: t | U.SHIFT | U.CTRL_COMMAND,
1835
1830
  preconditions: (n) => yt(n),
1836
1831
  staticParameters: {
1837
1832
  eventType: xe.Keyboard,
1838
1833
  keycode: t,
1839
- metaKey: Wi
1834
+ metaKey: $i
1840
1835
  }
1841
1836
  });
1842
1837
  return e;
1843
1838
  }
1844
- const Gi = {
1845
- id: wr.id,
1839
+ const qi = {
1840
+ id: Mr.id,
1846
1841
  binding: $.F4,
1847
1842
  preconditions: (e) => yt(e)
1848
1843
  };
1849
- function Zi() {
1844
+ function ji() {
1850
1845
  const e = [];
1851
1846
  for (const t of [$.ENTER, $.TAB, $.ARROW_DOWN, $.ARROW_UP])
1852
1847
  e.push({
1853
1848
  id: ft.id,
1854
1849
  binding: t,
1855
- preconditions: (n) => Hi(n),
1850
+ preconditions: (n) => Pi(n),
1856
1851
  staticParameters: {
1857
1852
  eventType: xe.Keyboard,
1858
1853
  keycode: t,
@@ -1861,16 +1856,16 @@ function Zi() {
1861
1856
  });
1862
1857
  return e;
1863
1858
  }
1864
- const zi = {
1865
- id: Cs.id,
1866
- binding: V.ALT | $.EQUAL,
1867
- preconditions: xo,
1868
- mac: V.CTRL_COMMAND | V.ALT | $.EQUAL,
1859
+ const Ki = {
1860
+ id: ps.id,
1861
+ binding: U.ALT | $.EQUAL,
1862
+ preconditions: Mo,
1863
+ mac: U.CTRL_COMMAND | U.ALT | $.EQUAL,
1869
1864
  description: "shortcut.sheets-formula-ui.quick-sum",
1870
1865
  group: "4_sheet-edit"
1871
1866
  };
1872
- var Xi = Object.getOwnPropertyDescriptor, Qi = (e, t, n, o) => {
1873
- for (var r = o > 1 ? void 0 : o ? Xi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
1867
+ var Yi = Object.getOwnPropertyDescriptor, Gi = (e, t, n, o) => {
1868
+ for (var r = o > 1 ? void 0 : o ? Yi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
1874
1869
  (i = e[s]) && (r = i(r) || r);
1875
1870
  return r;
1876
1871
  }, Ke = (e, t) => (n, o) => t(n, o, e);
@@ -1882,7 +1877,7 @@ let qt = class extends Ze {
1882
1877
  this._registerCommands(), this._registerMenus(), this._registerShortcuts(), this._registerComponents(), this._registerRenderModules();
1883
1878
  }
1884
1879
  _registerMenus() {
1885
- this._menuManagerService.mergeMenu(Vi);
1880
+ this._menuManagerService.mergeMenu(Li);
1886
1881
  }
1887
1882
  _registerCommands() {
1888
1883
  [
@@ -1890,50 +1885,50 @@ let qt = class extends Ze {
1890
1885
  bn,
1891
1886
  ve,
1892
1887
  yn,
1893
- Ys,
1894
- Vs,
1888
+ qs,
1889
+ $s,
1895
1890
  ft,
1896
- wr
1891
+ Mr
1897
1892
  ].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e)));
1898
1893
  }
1899
1894
  _registerShortcuts() {
1900
1895
  [
1901
- ...qi(),
1896
+ ...Vi(),
1897
+ ...Wi(),
1898
+ ...Hi(),
1899
+ ...Bi(),
1902
1900
  ...ji(),
1903
- ...Ki(),
1904
- ...Yi(),
1905
- ...Zi(),
1906
- zi,
1907
- Gi
1901
+ Ki,
1902
+ qi
1908
1903
  ].forEach((e) => {
1909
1904
  this.disposeWithMe(this._shortcutService.registerShortcut(e));
1910
1905
  });
1911
1906
  }
1912
1907
  _registerComponents() {
1913
- this.disposeWithMe(this._uiPartsService.registerComponent(wo.FORMULA_AUX, () => Tr(Si, this._injector))), this._componentManager.register(xr, xi);
1908
+ this.disposeWithMe(this._uiPartsService.registerComponent(xo.FORMULA_AUX, () => br(gi, this._injector))), this._componentManager.register(Nr, Oi);
1914
1909
  }
1915
1910
  _registerRenderModules() {
1916
- this.disposeWithMe(this._renderManagerService.registerRenderModule(U.UNIVER_SHEET, [Ht]));
1911
+ this.disposeWithMe(this._renderManagerService.registerRenderModule(V.UNIVER_SHEET, [Ht]));
1917
1912
  }
1918
1913
  };
1919
- qt = Qi([
1914
+ qt = Gi([
1920
1915
  Ke(0, q(It)),
1921
- Ke(1, bs),
1916
+ Ke(1, Rs),
1922
1917
  Ke(2, pe),
1923
1918
  Ke(3, zt),
1924
- Ke(4, br),
1919
+ Ke(4, Ir),
1925
1920
  Ke(5, Te),
1926
- Ke(6, q(yr))
1921
+ Ke(6, q(Er))
1927
1922
  ], qt);
1928
- var Ji = Object.getOwnPropertyDescriptor, ec = (e, t, n, o) => {
1929
- for (var r = o > 1 ? void 0 : o ? Ji(t, n) : t, s = e.length - 1, i; s >= 0; s--)
1923
+ var Zi = Object.getOwnPropertyDescriptor, zi = (e, t, n, o) => {
1924
+ for (var r = o > 1 ? void 0 : o ? Zi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
1930
1925
  (i = e[s]) && (r = i(r) || r);
1931
1926
  return r;
1932
1927
  }, rn = (e, t) => (n, o) => t(n, o, e);
1933
1928
  let jt = class extends Ze {
1934
1929
  constructor(e, t, n) {
1935
1930
  super(), this._imageFormulaCellInterceptorController = e, this._renderManagerService = t, this._univerInstanceService = n, this._imageFormulaCellInterceptorController.registerRefreshRenderFunction(() => {
1936
- const o = this._univerInstanceService.getCurrentUnitOfType(U.UNIVER_SHEET);
1931
+ const o = this._univerInstanceService.getCurrentUnitOfType(V.UNIVER_SHEET);
1937
1932
  if (!o) return;
1938
1933
  const r = this._renderManagerService.getRenderById(o.getUnitId());
1939
1934
  if (!r) return;
@@ -1943,14 +1938,14 @@ let jt = class extends Ze {
1943
1938
  });
1944
1939
  }
1945
1940
  };
1946
- jt = ec([
1947
- rn(0, q(_s)),
1941
+ jt = zi([
1942
+ rn(0, q(Ss)),
1948
1943
  rn(1, Te),
1949
- rn(2, te)
1944
+ rn(2, ne)
1950
1945
  ], jt);
1951
- class Br {
1946
+ class Wr {
1952
1947
  constructor() {
1953
- j(this, "_currentSelector$", new _r(null));
1948
+ j(this, "_currentSelector$", new vr(null));
1954
1949
  j(this, "currentSelector$", this._currentSelector$.asObservable());
1955
1950
  }
1956
1951
  showRangeSelectorDialog(t) {
@@ -1962,12 +1957,12 @@ class Br {
1962
1957
  return this._currentSelector$.next(t), o;
1963
1958
  }
1964
1959
  }
1965
- var tc = Object.getOwnPropertyDescriptor, nc = (e, t, n, o) => {
1966
- for (var r = o > 1 ? void 0 : o ? tc(t, n) : t, s = e.length - 1, i; s >= 0; s--)
1960
+ var Xi = Object.getOwnPropertyDescriptor, Qi = (e, t, n, o) => {
1961
+ for (var r = o > 1 ? void 0 : o ? Xi(t, n) : t, s = e.length - 1, i; s >= 0; s--)
1967
1962
  (i = e[s]) && (r = i(r) || r);
1968
1963
  return r;
1969
1964
  }, ct = (e, t) => (n, o) => t(n, o, e);
1970
- let Le = class extends ko {
1965
+ let Le = class extends wo {
1971
1966
  constructor(t, n, o, r, s, i, c) {
1972
1967
  super(
1973
1968
  n,
@@ -1978,7 +1973,7 @@ let Le = class extends ko {
1978
1973
  );
1979
1974
  j(this, "_workbookSelections");
1980
1975
  j(this, "_eventDisposables");
1981
- 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(rc(this._themeService)), this._remainLastEnabled = !0, this._highlightHeader = !1;
1976
+ 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;
1982
1977
  }
1983
1978
  getLocation() {
1984
1979
  return this._skeleton.getLocation();
@@ -2002,7 +1997,7 @@ let Le = class extends ko {
2002
1997
  * Call this method and user will be able to select on the canvas to update selections.
2003
1998
  */
2004
1999
  enableSelectionChanging() {
2005
- return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(), lr(() => this._disableSelectionChanging());
2000
+ return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(), ir(() => this._disableSelectionChanging());
2006
2001
  }
2007
2002
  _disableSelectionChanging() {
2008
2003
  var t;
@@ -2027,7 +2022,7 @@ let Le = class extends ko {
2027
2022
  Vn(this._workbookSelections.getCurrentSelections(), m, Ie.COLUMN) || (this._onPointerDown(a, (r.zIndex || 1) + 1, Ie.COLUMN, this._getActiveViewport(a), en.X), a.button !== 2 && h.stopPropagation());
2028
2023
  })), c.add(s == null ? void 0 : s.onPointerDown$.subscribeEvent((a, h) => {
2029
2024
  if (this._reset(), !this.inRefSelectionMode()) return;
2030
- const f = this._sheetSkeletonManagerService.getCurrent().skeleton, m = Ao(f);
2025
+ const f = this._sheetSkeletonManagerService.getCurrent().skeleton, m = ko(f);
2031
2026
  this._addSelectionControlByModelData(m), this._selectionMoveStart$.next(this.getSelectionDataWithStyle());
2032
2027
  const d = i.onPointerUp$.subscribeEvent(() => {
2033
2028
  d.unsubscribe(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle());
@@ -2042,7 +2037,7 @@ let Le = class extends ko {
2042
2037
  */
2043
2038
  _addSelectionControlByModelData(t) {
2044
2039
  var i;
2045
- const n = this._skeleton, o = (i = t.style) != null ? i : mr(this._themeService), r = this._scene;
2040
+ const n = this._skeleton, o = (i = t.style) != null ? i : fr(this._themeService), r = this._scene;
2046
2041
  return t.style = o, this.newSelectionControl(r, n, t);
2047
2042
  }
2048
2043
  _initSelectionChangeListener() {
@@ -2066,7 +2061,7 @@ let Le = class extends ko {
2066
2061
  const r = this._context.unit.getActiveSheet().getSheetId();
2067
2062
  t.length !== 0 && this._workbookSelections.setSelections(
2068
2063
  r,
2069
- t.map((s) => ms(s)),
2064
+ t.map((s) => hs(s)),
2070
2065
  n
2071
2066
  );
2072
2067
  }
@@ -2075,7 +2070,7 @@ let Le = class extends ko {
2075
2070
  var i;
2076
2071
  if (!t)
2077
2072
  return;
2078
- const { skeleton: n } = t, { scene: o } = this._context, r = o.getViewport(Kn.VIEW_MAIN);
2073
+ const { skeleton: n } = t, { scene: o } = this._context, r = o.getViewport(jn.VIEW_MAIN);
2079
2074
  this._skeleton && ((i = this._skeleton.worksheet) == null ? void 0 : i.getSheetId()) !== n.worksheet.getSheetId() && this._reset(), this._changeRuntime(n, o, r);
2080
2075
  const s = this._workbookSelections.getCurrentSelections();
2081
2076
  this.resetSelectionsByModelData(s);
@@ -2083,10 +2078,10 @@ let Le = class extends ko {
2083
2078
  }
2084
2079
  _getActiveViewport(t) {
2085
2080
  const n = this._getSheetObject();
2086
- return n == null ? void 0 : n.scene.getActiveViewportByCoord(Yn.FromArray([t.offsetX, t.offsetY]));
2081
+ return n == null ? void 0 : n.scene.getActiveViewportByCoord(Kn.FromArray([t.offsetX, t.offsetY]));
2087
2082
  }
2088
2083
  _getSheetObject() {
2089
- return Fo(this._context.unit, this._context);
2084
+ return Ao(this._context.unit, this._context);
2090
2085
  }
2091
2086
  /**
2092
2087
  * Handle pointer down event, bind pointermove & pointerup handler.
@@ -2106,9 +2101,9 @@ let Le = class extends ko {
2106
2101
  if (!c || !i)
2107
2102
  return;
2108
2103
  r && (this._activeViewport = r);
2109
- const { offsetX: a, offsetY: h } = t, f = c.getViewport(Kn.VIEW_MAIN);
2104
+ const { offsetX: a, offsetY: h } = t, f = c.getViewport(jn.VIEW_MAIN);
2110
2105
  if (!f) return;
2111
- const m = c.getCoordRelativeToViewport(Yn.FromArray([a, h])), { x: d, y: u } = m;
2106
+ const m = c.getCoordRelativeToViewport(Kn.FromArray([a, h])), { x: d, y: u } = m;
2112
2107
  this._startViewportPosX = d, this._startViewportPosY = u;
2113
2108
  const l = c.getScrollXYInfoByViewport(m), { scaleX: v, scaleY: S } = c.getAncestorScale(), g = this._skeleton.getCellByOffset(d, u, v, S, l);
2114
2109
  if (!g) return;
@@ -2184,7 +2179,7 @@ let Le = class extends ko {
2184
2179
  * @returns {SelectionControl} selectionControl just created
2185
2180
  */
2186
2181
  newSelectionControl(t, n, o) {
2187
- const r = this.getSelectionControls().length, { rowHeaderWidth: s, columnHeaderHeight: i } = n, c = new gr(t, r, this._themeService, {
2182
+ const r = this.getSelectionControls().length, { rowHeaderWidth: s, columnHeaderHeight: i } = n, c = new hr(t, r, this._themeService, {
2188
2183
  highlightHeader: this._highlightHeader,
2189
2184
  enableAutoFill: !1,
2190
2185
  rowHeaderWidth: s,
@@ -2203,7 +2198,7 @@ let Le = class extends ko {
2203
2198
  }), c;
2204
2199
  }
2205
2200
  };
2206
- Le = nc([
2201
+ Le = Qi([
2207
2202
  ct(1, q(It)),
2208
2203
  ct(2, q(Et)),
2209
2204
  ct(3, zt),
@@ -2211,8 +2206,8 @@ Le = nc([
2211
2206
  ct(5, dn),
2212
2207
  ct(6, Gt)
2213
2208
  ], Le);
2214
- function rc(e) {
2215
- const t = mr(e);
2209
+ function Ji(e) {
2210
+ const t = fr(e);
2216
2211
  return t.widgets = { tl: !0, tc: !0, tr: !0, ml: !0, mr: !0, bl: !0, bc: !0, br: !0 }, t;
2217
2212
  }
2218
2213
  const Tn = (e, t, n = !0) => {
@@ -2229,7 +2224,7 @@ const Tn = (e, t, n = !0) => {
2229
2224
  }
2230
2225
  return (n ? r.currentIndex === t : t > c && t <= r.currentIndex) && (o = i, r.isFinish = !0), r;
2231
2226
  }, { currentIndex: 0, isFinish: !1 }), o;
2232
- }, qr = (e, t) => {
2227
+ }, Hr = (e, t) => {
2233
2228
  const n = e[t];
2234
2229
  let o = -1;
2235
2230
  if (!n || typeof n == "string" || n.nodeType !== Q.REFERENCE) return -1;
@@ -2238,7 +2233,7 @@ const Tn = (e, t, n = !0) => {
2238
2233
  typeof s != "string" && s.nodeType === Q.REFERENCE && o++;
2239
2234
  }
2240
2235
  return o;
2241
- }, oc = (e, t = 100) => {
2236
+ }, ec = (e, t = 100) => {
2242
2237
  P(() => {
2243
2238
  let n = null;
2244
2239
  const o = () => {
@@ -2251,8 +2246,8 @@ const Tn = (e, t, n = !0) => {
2251
2246
  };
2252
2247
  }, [e, t]);
2253
2248
  };
2254
- function jr(e, t, n) {
2255
- const o = O(ze), r = le(() => new _r({ left: -999, top: -999, right: -999, bottom: -999 }), []), s = O(Rn), i = O(te), c = ee(() => {
2249
+ function Br(e, t, n) {
2250
+ const o = O(ze), r = le(() => new vr({ left: -999, top: -999, right: -999, bottom: -999 }), []), s = O(Rn), i = O(ne), c = ee(() => {
2256
2251
  var _;
2257
2252
  const a = o.getEditor(e);
2258
2253
  if (!a)
@@ -2268,8 +2263,8 @@ function jr(e, t, n) {
2268
2263
  });
2269
2264
  return P(() => {
2270
2265
  t && c();
2271
- }, [e, o, i.unitAdded$, c, t, ...n != null ? n : []]), oc(c), P(() => {
2272
- const a = s.scrollEvent$.pipe(Xo(100)).subscribe(c);
2266
+ }, [e, o, i.unitAdded$, c, t, ...n != null ? n : []]), ec(c), P(() => {
2267
+ const a = s.scrollEvent$.pipe(Go(100)).subscribe(c);
2273
2268
  return () => {
2274
2269
  a.unsubscribe();
2275
2270
  };
@@ -2278,7 +2273,7 @@ function jr(e, t, n) {
2278
2273
  const rt = (e) => {
2279
2274
  const t = z(e);
2280
2275
  return t.current = e, t;
2281
- }, sc = (e, t, n) => {
2276
+ }, tc = (e, t, n) => {
2282
2277
  const o = O(Xt), r = O(Zt), s = O(ye), [i, c] = H(), [a, h] = H(-1), [f, m] = H(!0), d = rt(f), u = z(t);
2283
2278
  u.current = t;
2284
2279
  const l = () => {
@@ -2311,9 +2306,9 @@ const rt = (e) => {
2311
2306
  }
2312
2307
  c(void 0), h(-1);
2313
2308
  }), S = n.selectionChange$.pipe(
2314
- Rr((g) => g.textRanges.length === 1),
2315
- Cr((g) => g.textRanges[0].startOffset),
2316
- Qo()
2309
+ Cr((g) => g.textRanges.length === 1),
2310
+ Sr((g) => g.textRanges[0].startOffset),
2311
+ Zo()
2317
2312
  ).subscribe(() => {
2318
2313
  m(!0);
2319
2314
  });
@@ -2328,7 +2323,7 @@ const rt = (e) => {
2328
2323
  paramIndex: a,
2329
2324
  reset: l
2330
2325
  };
2331
- }, ic = ({ onClick: e }) => /* @__PURE__ */ x(
2326
+ }, nc = ({ onClick: e }) => /* @__PURE__ */ w(
2332
2327
  "div",
2333
2328
  {
2334
2329
  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",
@@ -2336,21 +2331,21 @@ const rt = (e) => {
2336
2331
  children: "?"
2337
2332
  }
2338
2333
  ), on = ({ className: e, title: t, value: n }) => /* @__PURE__ */ B("div", { className: "univer-my-2", children: [
2339
- /* @__PURE__ */ x(
2334
+ /* @__PURE__ */ w(
2340
2335
  "div",
2341
2336
  {
2342
2337
  className: se("univer-mb-2 univer-text-sm univer-font-medium univer-text-gray-900 dark:!univer-text-white", e),
2343
2338
  children: t
2344
2339
  }
2345
2340
  ),
2346
- /* @__PURE__ */ x(
2341
+ /* @__PURE__ */ w(
2347
2342
  "div",
2348
2343
  {
2349
2344
  className: "univer-whitespace-pre-wrap univer-break-words univer-text-xs univer-text-gray-500",
2350
2345
  children: n
2351
2346
  }
2352
2347
  )
2353
- ] }), cc = (e) => {
2348
+ ] }), rc = (e) => {
2354
2349
  const { prefix: t, value: n, active: o, onClick: r } = e;
2355
2350
  return /* @__PURE__ */ B("div", { children: [
2356
2351
  /* @__PURE__ */ B("span", { children: [
@@ -2358,22 +2353,22 @@ const rt = (e) => {
2358
2353
  "("
2359
2354
  ] }),
2360
2355
  n && n.map((s, i) => /* @__PURE__ */ B("span", { children: [
2361
- /* @__PURE__ */ x(
2356
+ /* @__PURE__ */ w(
2362
2357
  "span",
2363
2358
  {
2364
2359
  className: o === i ? "univer-text-primary-500" : "",
2365
2360
  onClick: () => r(i),
2366
- children: Fr(s)
2361
+ children: kr(s)
2367
2362
  }
2368
2363
  ),
2369
2364
  i === n.length - 1 ? "" : ","
2370
2365
  ] }, s.name)),
2371
2366
  ")"
2372
2367
  ] });
2373
- }, rr = () => {
2368
+ }, tr = () => {
2374
2369
  };
2375
- function lc(e) {
2376
- const { onParamsSwitch: t = rr, onClose: n = rr, isFocus: o, editor: r, formulaText: s } = e, { functionInfo: i, paramIndex: c, reset: a } = sc(o, s, r), h = O(pn), f = !_e(h.helpFunctionVisible$), [m, d] = H(!0), u = O(dt), l = u.t("formula.prompt.required"), v = u.t("formula.prompt.optional"), S = r.getEditorId(), [g] = jr(S, !!i, [i, c]);
2370
+ function oc(e) {
2371
+ const { onParamsSwitch: t = tr, onClose: n = tr, isFocus: o, editor: r, formulaText: s } = e, { functionInfo: i, paramIndex: c, reset: a } = tc(o, s, r), h = O(pn), f = !_e(h.helpFunctionVisible$), [m, d] = H(!0), u = O(dt), l = u.t("formula.prompt.required"), v = u.t("formula.prompt.optional"), S = r.getEditorId(), [g] = Br(S, !!i, [i, c]);
2377
2372
  function C(p) {
2378
2373
  t && t(p);
2379
2374
  }
@@ -2382,7 +2377,7 @@ function lc(e) {
2382
2377
  }), E = () => {
2383
2378
  _(!0), n();
2384
2379
  };
2385
- return i ? f ? /* @__PURE__ */ x(cn, { portal: !0, anchorRect$: g, direction: "left-center", children: /* @__PURE__ */ x(ic, { onClick: () => _(!1) }) }, "hidden") : /* @__PURE__ */ x(cn, { portal: !0, onClickOutside: () => a(), anchorRect$: g, direction: "vertical", children: /* @__PURE__ */ B(
2380
+ return i ? f ? /* @__PURE__ */ w(cn, { portal: !0, anchorRect$: g, direction: "left-center", children: /* @__PURE__ */ w(nc, { onClick: () => _(!1) }) }, "hidden") : /* @__PURE__ */ w(cn, { portal: !0, onClickOutside: () => a(), anchorRect$: g, direction: "vertical", children: /* @__PURE__ */ B(
2386
2381
  "div",
2387
2382
  {
2388
2383
  className: se("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", In),
@@ -2390,10 +2385,10 @@ function lc(e) {
2390
2385
  /* @__PURE__ */ B(
2391
2386
  "div",
2392
2387
  {
2393
- className: se("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", ks),
2388
+ className: se("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", Ms),
2394
2389
  children: [
2395
- /* @__PURE__ */ x(
2396
- cc,
2390
+ /* @__PURE__ */ w(
2391
+ rc,
2397
2392
  {
2398
2393
  prefix: i.functionName,
2399
2394
  value: i.functionParameter,
@@ -2402,28 +2397,28 @@ function lc(e) {
2402
2397
  }
2403
2398
  ),
2404
2399
  /* @__PURE__ */ B("div", { className: "univer-flex", children: [
2405
- /* @__PURE__ */ x(
2400
+ /* @__PURE__ */ w(
2406
2401
  "div",
2407
2402
  {
2408
2403
  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",
2409
2404
  style: { transform: m ? "rotateZ(-90deg)" : "rotateZ(90deg)" },
2410
2405
  onClick: () => d(!m),
2411
- children: /* @__PURE__ */ x(Wr, {})
2406
+ children: /* @__PURE__ */ w(Ur, {})
2412
2407
  }
2413
2408
  ),
2414
- /* @__PURE__ */ x(
2409
+ /* @__PURE__ */ w(
2415
2410
  "div",
2416
2411
  {
2417
2412
  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",
2418
2413
  onClick: E,
2419
- children: /* @__PURE__ */ x(Pr, {})
2414
+ children: /* @__PURE__ */ w(Lr, {})
2420
2415
  }
2421
2416
  )
2422
2417
  ] })
2423
2418
  ]
2424
2419
  }
2425
2420
  ),
2426
- /* @__PURE__ */ x(
2421
+ /* @__PURE__ */ w(
2427
2422
  "div",
2428
2423
  {
2429
2424
  className: se("univer-box-border univer-max-h-[350px] univer-overflow-y-auto univer-px-4 univer-pb-3 univer-pt-0", ut),
@@ -2432,21 +2427,21 @@ function lc(e) {
2432
2427
  padding: m ? "revert-layer" : 0
2433
2428
  },
2434
2429
  children: /* @__PURE__ */ B("div", { className: "univer-mt-3", children: [
2435
- /* @__PURE__ */ x(
2430
+ /* @__PURE__ */ w(
2436
2431
  on,
2437
2432
  {
2438
2433
  title: u.t("formula.prompt.helpExample"),
2439
2434
  value: `${i.functionName}(${i.functionParameter.map((p) => p.example).join(",")})`
2440
2435
  }
2441
2436
  ),
2442
- /* @__PURE__ */ x(
2437
+ /* @__PURE__ */ w(
2443
2438
  on,
2444
2439
  {
2445
2440
  title: u.t("formula.prompt.helpAbstract"),
2446
2441
  value: i.description
2447
2442
  }
2448
2443
  ),
2449
- i && i.functionParameter && i.functionParameter.map((p, b) => /* @__PURE__ */ x(
2444
+ i && i.functionParameter && i.functionParameter.map((p, b) => /* @__PURE__ */ w(
2450
2445
  on,
2451
2446
  {
2452
2447
  className: c === b ? "univer-text-primary-500" : "",
@@ -2462,7 +2457,7 @@ function lc(e) {
2462
2457
  }
2463
2458
  ) }, "show") : null;
2464
2459
  }
2465
- const ac = (e) => {
2460
+ const sc = (e) => {
2466
2461
  const t = O(ze);
2467
2462
  return ee((o) => {
2468
2463
  var r, s;
@@ -2480,40 +2475,40 @@ const ac = (e) => {
2480
2475
  }
2481
2476
  });
2482
2477
  };
2483
- function uc(e) {
2478
+ function ic(e) {
2484
2479
  var r, s;
2485
- const n = e.get(te).getCurrentUniverDocInstance();
2480
+ const n = e.get(ne).getCurrentUniverDocInstance();
2486
2481
  return n != null && n.getBody() ? { dataStream: (s = (r = n.getBody()) == null ? void 0 : r.dataStream) != null ? s : "", offset: 0 } : void 0;
2487
2482
  }
2488
2483
  var Me = /* @__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))(Me || {});
2489
- function dc(e) {
2484
+ function cc(e) {
2490
2485
  var y;
2491
- const { editorId: t, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = e, i = O(Te), c = O(te), a = i.getRenderById(r), h = i.getRenderById(t), f = h == null ? void 0 : h.with(Ir), m = O(Nr), d = O(It), [u, l] = H(
2486
+ const { editorId: t, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = e, i = O(Te), c = O(ne), a = i.getRenderById(r), h = i.getRenderById(t), f = h == null ? void 0 : h.with(_r), m = O(Tr), d = O(It), [u, l] = H(
2492
2487
  0
2493
2488
  /* NOT_SELECT */
2494
- ), v = O(ye), S = z(!0), g = a == null ? void 0 : a.with(Le), C = rt(u), _ = c.getUnit(r, U.UNIVER_SHEET), E = _ == null ? void 0 : _.getSheetBySheetId(s), p = ee((A) => {
2489
+ ), v = O(ye), S = z(!0), g = a == null ? void 0 : a.with(Le), C = rt(u), _ = c.getUnit(r, V.UNIVER_SHEET), E = _ == null ? void 0 : _.getSheetBySheetId(s), p = ee((A) => {
2495
2490
  g && g.setSkipLastEnabled(
2496
2491
  A === 1 || A === 3 || A === 4
2497
2492
  /* EDIT_OTHER_WORKBOOK_REFERENCE */
2498
2493
  ), C.current = A, l(A);
2499
2494
  }), b = ee(() => {
2500
2495
  var X, re, he;
2501
- const A = c.getCurrentUnitOfType(U.UNIVER_SHEET);
2496
+ const A = c.getCurrentUnitOfType(V.UNIVER_SHEET);
2502
2497
  if (!A) return;
2503
- const F = A.getActiveSheet(), N = f == null ? void 0 : f.getActiveTextRange(), M = N != null && N.collapsed ? N.startOffset : -1, k = uc(d);
2498
+ const F = A.getActiveSheet(), N = f == null ? void 0 : f.getActiveTextRange(), M = N != null && N.collapsed ? N.startOffset : -1, k = ic(d);
2504
2499
  if (!k) return;
2505
- const I = (X = k == null ? void 0 : k.dataStream) == null ? void 0 : X.slice(0, -2), w = ((re = v.sequenceNodesBuilder(I)) != null ? re : []).map((Y) => typeof Y == "object" ? Y.nodeType === Q.REFERENCE ? {
2500
+ const I = (X = k == null ? void 0 : k.dataStream) == null ? void 0 : X.slice(0, -2), x = ((re = v.sequenceNodesBuilder(I)) != null ? re : []).map((Y) => typeof Y == "object" ? Y.nodeType === Q.REFERENCE ? {
2506
2501
  ...Y,
2507
- range: Ho(Y.token)
2502
+ range: Wo(Y.token)
2508
2503
  } : {
2509
2504
  ...Y,
2510
2505
  range: void 0
2511
- } : Y), R = I[M - 1], T = I[M], D = w.find((Y) => typeof Y == "object" && Y.nodeType === Q.REFERENCE && M === Y.endIndex + 2), L = R && Bo(R) && (!T || qo(T) && T !== Ge.OPEN_BRACKET), W = !!D;
2506
+ } : Y), R = I[M - 1], T = I[M], D = x.find((Y) => typeof Y == "object" && Y.nodeType === Q.REFERENCE && M === Y.endIndex + 2), L = R && Ho(R) && (!T || Bo(T) && T !== Ge.OPEN_BRACKET), W = !!D;
2512
2507
  if ((I == null ? void 0 : I.substring(0, 1)) === "=" && (L || W))
2513
2508
  if (W) {
2514
2509
  if (S.current)
2515
2510
  return;
2516
- const { sheetName: Y, unitId: J } = D.range, ot = (he = c.getCurrentUnitOfType(U.UNIVER_SHEET)) == null ? void 0 : he.getUnitId();
2511
+ const { sheetName: Y, unitId: J } = D.range, ot = (he = c.getCurrentUnitOfType(V.UNIVER_SHEET)) == null ? void 0 : he.getUnitId();
2517
2512
  J && J !== ot ? p(
2518
2513
  4
2519
2514
  /* EDIT_OTHER_WORKBOOK_REFERENCE */
@@ -2536,7 +2531,7 @@ function dc(e) {
2536
2531
  );
2537
2532
  });
2538
2533
  return P(() => {
2539
- const A = m.textSelection$.pipe(Rr((F) => F.unitId === t)).subscribe(() => {
2534
+ const A = m.textSelection$.pipe(Cr((F) => F.unitId === t)).subscribe(() => {
2540
2535
  b();
2541
2536
  });
2542
2537
  return () => A.unsubscribe();
@@ -2559,7 +2554,7 @@ function dc(e) {
2559
2554
  if (!n) return;
2560
2555
  const A = _ == null ? void 0 : _.activeSheet$.subscribe(() => {
2561
2556
  b();
2562
- }), F = c.getCurrentTypeOfUnit$(U.UNIVER_SHEET).subscribe(() => {
2557
+ }), F = c.getCurrentTypeOfUnit$(V.UNIVER_SHEET).subscribe(() => {
2563
2558
  b();
2564
2559
  });
2565
2560
  return () => {
@@ -2567,11 +2562,11 @@ function dc(e) {
2567
2562
  };
2568
2563
  }, [b, n, _ == null ? void 0 : _.activeSheet$, c.getCurrentTypeOfUnit$]), { isSelecting: u, isSelectingRef: C };
2569
2564
  }
2570
- const hc = () => {
2565
+ const lc = () => {
2571
2566
  const e = O(ye);
2572
2567
  return $t((n) => e.sequenceNodesBuilder(n) || [], [e]);
2573
2568
  };
2574
- function fc(e, t, n) {
2569
+ function ac(e, t, n) {
2575
2570
  const o = new mn(t).setAlpha(0.05).toRgbString();
2576
2571
  return {
2577
2572
  id: n,
@@ -2584,7 +2579,7 @@ function fc(e, t, n) {
2584
2579
  widgetStroke: e.getColorFromTheme("white")
2585
2580
  };
2586
2581
  }
2587
- function Kr(e) {
2582
+ function qr(e) {
2588
2583
  var _, E, p;
2589
2584
  const {
2590
2585
  unitId: t,
@@ -2597,7 +2592,7 @@ function Kr(e) {
2597
2592
  sheetSkeletonManagerService: a,
2598
2593
  themeService: h,
2599
2594
  univerInstanceService: f
2600
- } = e, m = o.getUnitId(), d = f.getUnit(t, U.UNIVER_SHEET), u = d == null ? void 0 : d.getActiveSheet(), l = [];
2595
+ } = e, m = o.getUnitId(), d = f.getUnit(t, V.UNIVER_SHEET), u = d == null ? void 0 : d.getActiveSheet(), l = [];
2601
2596
  if (!d || !u) {
2602
2597
  i.setSelections(l);
2603
2598
  return;
@@ -2609,14 +2604,14 @@ function Kr(e) {
2609
2604
  if (!((_ = a == null ? void 0 : a.getWorksheetSkeleton(v)) == null ? void 0 : _.skeleton)) return;
2610
2605
  const C = [];
2611
2606
  for (let b = 0, y = r.length; b < y; b++) {
2612
- const A = r[b], { themeColor: F, token: N, refIndex: M, endIndex: k } = A, I = ht(N), { unitId: w, sheetName: R, range: T } = I, D = S(R);
2613
- if (!D && R || m !== t && w !== m || w && w !== m || D && D !== v || !D && v !== n)
2607
+ const A = r[b], { themeColor: F, token: N, refIndex: M, endIndex: k } = A, I = ht(N), { unitId: x, sheetName: R, range: T } = I, D = S(R);
2608
+ if (!D && R || m !== t && x !== m || x && x !== m || D && D !== v || !D && v !== n)
2614
2609
  continue;
2615
- const L = ps(T, u.getRowCount(), u.getColumnCount());
2610
+ const L = fs(T, u.getRowCount(), u.getColumnCount());
2616
2611
  L.unitId = t, L.sheetId = v, l.push({
2617
2612
  range: L,
2618
2613
  primary: null,
2619
- style: fc(h, F, M.toString())
2614
+ style: ac(h, F, M.toString())
2620
2615
  }), C.push(k);
2621
2616
  }
2622
2617
  if (s) {
@@ -2625,11 +2620,11 @@ function Kr(e) {
2625
2620
  }
2626
2621
  return l;
2627
2622
  }
2628
- function gc(e, t) {
2629
- const n = O(te), o = O(Et), r = O(Gt), s = O(Te), i = _e(le(() => n.getCurrentTypeOfUnit$(U.UNIVER_SHEET), [n])), c = i ? s.getRenderById(i.getUnitId()) : null, a = c == null ? void 0 : c.with(Le), h = c == null ? void 0 : c.with(bt), f = ee((m, d) => {
2630
- const u = n.getCurrentUnitOfType(U.UNIVER_SHEET);
2623
+ function uc(e, t) {
2624
+ const n = O(ne), o = O(Et), r = O(Gt), s = O(Te), i = _e(le(() => n.getCurrentTypeOfUnit$(V.UNIVER_SHEET), [n])), c = i ? s.getRenderById(i.getUnitId()) : null, a = c == null ? void 0 : c.with(Le), h = c == null ? void 0 : c.with(bt), f = ee((m, d) => {
2625
+ const u = n.getCurrentUnitOfType(V.UNIVER_SHEET);
2631
2626
  if (!u || a != null && a.selectionMoving) return;
2632
- const l = Kr({
2627
+ const l = qr({
2633
2628
  unitId: e,
2634
2629
  subUnitId: t,
2635
2630
  currentWorkbook: u,
@@ -2648,8 +2643,8 @@ function gc(e, t) {
2648
2643
  a == null || a.resetActiveSelectionIndex();
2649
2644
  }, [a]), f;
2650
2645
  }
2651
- function Yr(e = "") {
2652
- const t = O(Zt), n = mc(), o = O(pe), r = le(() => e.length, [e]);
2646
+ function jr(e = "") {
2647
+ const t = O(Zt), n = dc(), o = O(pe), r = le(() => e.length, [e]);
2653
2648
  return ee((i, c, a = !0, h) => {
2654
2649
  const f = i.getDocumentData(), m = i.getEditorId();
2655
2650
  if (!f)
@@ -2660,12 +2655,12 @@ function Yr(e = "") {
2660
2655
  const u = d.dataStream.slice(0, d.dataStream.length - 2), l = { dataStream: "", ...f.body };
2661
2656
  if (!u.startsWith(e)) return [];
2662
2657
  if (c == null || c.length === 0)
2663
- return l.textRuns = [], o.syncExecuteCommand(jn.id, {
2658
+ return l.textRuns = [], o.syncExecuteCommand(qn.id, {
2664
2659
  unitId: m,
2665
2660
  body: Ln(l, 0, l.dataStream.length - 2)
2666
2661
  }), [];
2667
2662
  {
2668
- const { textRuns: v, refSelections: S } = pc(t, n, c);
2663
+ const { textRuns: v, refSelections: S } = hc(t, n, c);
2669
2664
  r && v.forEach((_) => {
2670
2665
  _.ed = _.ed + r, _.st = _.st + r;
2671
2666
  }), l.textRuns = [{ st: 0, ed: 1, ts: { fs: 11 } }, ...v];
@@ -2680,7 +2675,7 @@ function Yr(e = "") {
2680
2675
  E.startOffset = Math.max(0, Math.min(E.startOffset, _)), E.endOffset = Math.max(0, Math.min(E.endOffset, _));
2681
2676
  });
2682
2677
  }
2683
- return o.syncExecuteCommand(jn.id, {
2678
+ return o.syncExecuteCommand(qn.id, {
2684
2679
  unitId: m,
2685
2680
  body: Ln(l, 0, l.dataStream.length - 2),
2686
2681
  textRanges: h != null ? h : C
@@ -2688,7 +2683,7 @@ function Yr(e = "") {
2688
2683
  }
2689
2684
  });
2690
2685
  }
2691
- function mc() {
2686
+ function dc() {
2692
2687
  const e = O(Et), t = e.getCurrentTheme();
2693
2688
  return le(() => {
2694
2689
  const o = [
@@ -2708,7 +2703,7 @@ function mc() {
2708
2703
  return { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: i };
2709
2704
  }, [t]);
2710
2705
  }
2711
- function pc(e, t, n) {
2706
+ function hc(e, t, n) {
2712
2707
  const { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: i } = t, c = [], a = [], h = /* @__PURE__ */ new Map();
2713
2708
  let f = 0;
2714
2709
  for (let m = 0, d = n.length; m < d; m++) {
@@ -2780,7 +2775,7 @@ function pc(e, t, n) {
2780
2775
  }
2781
2776
  return { textRuns: c, refSelections: a };
2782
2777
  }
2783
- const Sc = (e, t, n, o) => {
2778
+ const fc = (e, t, n, o) => {
2784
2779
  const r = O(pe), s = O(zt), i = z(t);
2785
2780
  i.current = t;
2786
2781
  const c = z(o);
@@ -2793,22 +2788,22 @@ const Sc = (e, t, n, o) => {
2793
2788
  return;
2794
2789
  }
2795
2790
  let S = de.LEFT;
2796
- l === $.ARROW_DOWN ? S = de.DOWN : l === $.ARROW_UP ? S = de.UP : l === $.ARROW_RIGHT && (S = de.RIGHT), v === V.SHIFT ? r.executeCommand(es.id, {
2791
+ l === $.ARROW_DOWN ? S = de.DOWN : l === $.ARROW_UP ? S = de.UP : l === $.ARROW_RIGHT && (S = de.RIGHT), v === U.SHIFT ? r.executeCommand(Xo.id, {
2797
2792
  direction: S
2798
- }) : r.executeCommand(ts.id, {
2793
+ }) : r.executeCommand(Qo.id, {
2799
2794
  direction: S
2800
2795
  });
2801
2796
  }, d = (l, v) => {
2802
2797
  let S = de.DOWN;
2803
- l === $.ARROW_DOWN ? S = de.DOWN : l === $.ARROW_UP ? S = de.UP : l === $.ARROW_LEFT ? S = de.LEFT : l === $.ARROW_RIGHT && (S = de.RIGHT), i.current ? v === V.CTRL_COMMAND ? r.executeCommand(Wn.id, {
2798
+ l === $.ARROW_DOWN ? S = de.DOWN : l === $.ARROW_UP ? S = de.UP : l === $.ARROW_LEFT ? S = de.LEFT : l === $.ARROW_RIGHT && (S = de.RIGHT), i.current ? v === U.CTRL_COMMAND ? r.executeCommand(Wn.id, {
2804
2799
  direction: S,
2805
2800
  jumpOver: Hn.moveGap,
2806
2801
  extra: "formula-editor",
2807
2802
  fromCurrentSelection: i.current === Me.NEED_ADD || i.current === Me.EDIT_OTHER_SHEET_REFERENCE
2808
- }) : v === V.SHIFT ? r.executeCommand(Bn.id, {
2803
+ }) : v === U.SHIFT ? r.executeCommand(Bn.id, {
2809
2804
  direction: S,
2810
2805
  extra: "formula-editor"
2811
- }) : v === (V.CTRL_COMMAND | V.SHIFT) ? r.executeCommand(Bn.id, {
2806
+ }) : v === (U.CTRL_COMMAND | U.SHIFT) ? r.executeCommand(Bn.id, {
2812
2807
  direction: S,
2813
2808
  jumpOver: Hn.moveGap,
2814
2809
  extra: "formula-editor"
@@ -2830,18 +2825,18 @@ const Sc = (e, t, n, o) => {
2830
2825
  { keyCode: $.ARROW_LEFT },
2831
2826
  { keyCode: $.ARROW_RIGHT },
2832
2827
  { keyCode: $.ARROW_UP },
2833
- { keyCode: $.ARROW_DOWN, metaKey: V.SHIFT },
2834
- { keyCode: $.ARROW_LEFT, metaKey: V.SHIFT },
2835
- { keyCode: $.ARROW_RIGHT, metaKey: V.SHIFT },
2836
- { keyCode: $.ARROW_UP, metaKey: V.SHIFT },
2837
- { keyCode: $.ARROW_DOWN, metaKey: V.CTRL_COMMAND },
2838
- { keyCode: $.ARROW_LEFT, metaKey: V.CTRL_COMMAND },
2839
- { keyCode: $.ARROW_RIGHT, metaKey: V.CTRL_COMMAND },
2840
- { keyCode: $.ARROW_UP, metaKey: V.CTRL_COMMAND },
2841
- { keyCode: $.ARROW_DOWN, metaKey: V.CTRL_COMMAND | V.SHIFT },
2842
- { keyCode: $.ARROW_LEFT, metaKey: V.CTRL_COMMAND | V.SHIFT },
2843
- { keyCode: $.ARROW_RIGHT, metaKey: V.CTRL_COMMAND | V.SHIFT },
2844
- { keyCode: $.ARROW_UP, metaKey: V.CTRL_COMMAND | V.SHIFT }
2828
+ { keyCode: $.ARROW_DOWN, metaKey: U.SHIFT },
2829
+ { keyCode: $.ARROW_LEFT, metaKey: U.SHIFT },
2830
+ { keyCode: $.ARROW_RIGHT, metaKey: U.SHIFT },
2831
+ { keyCode: $.ARROW_UP, metaKey: U.SHIFT },
2832
+ { keyCode: $.ARROW_DOWN, metaKey: U.CTRL_COMMAND },
2833
+ { keyCode: $.ARROW_LEFT, metaKey: U.CTRL_COMMAND },
2834
+ { keyCode: $.ARROW_RIGHT, metaKey: U.CTRL_COMMAND },
2835
+ { keyCode: $.ARROW_UP, metaKey: U.CTRL_COMMAND },
2836
+ { keyCode: $.ARROW_DOWN, metaKey: U.CTRL_COMMAND | U.SHIFT },
2837
+ { keyCode: $.ARROW_LEFT, metaKey: U.CTRL_COMMAND | U.SHIFT },
2838
+ { keyCode: $.ARROW_RIGHT, metaKey: U.CTRL_COMMAND | U.SHIFT },
2839
+ { keyCode: $.ARROW_UP, metaKey: U.CTRL_COMMAND | U.SHIFT }
2845
2840
  ].map(({ keyCode: l, metaKey: v }) => ({
2846
2841
  id: h,
2847
2842
  binding: v ? l | v : l,
@@ -2858,75 +2853,75 @@ const Sc = (e, t, n, o) => {
2858
2853
  f.dispose();
2859
2854
  };
2860
2855
  }, [r, n, e, s]);
2861
- }, vc = (e, t, n, o, r = !0) => {
2856
+ }, gc = (e, t, n, o, r = !0) => {
2862
2857
  var u;
2863
- const s = O(Te), i = O(dn), c = O(ys), a = O(Gt), h = O(te), f = _e(le(() => h.getCurrentTypeOfUnit$(U.UNIVER_SHEET), [h])), m = s.getRenderById((u = f == null ? void 0 : f.getUnitId()) != null ? u : ""), d = m == null ? void 0 : m.with(Le);
2858
+ const s = O(Te), i = O(dn), c = O(Is), a = O(Gt), h = O(ne), f = _e(le(() => h.getCurrentTypeOfUnit$(V.UNIVER_SHEET), [h])), m = s.getRenderById((u = f == null ? void 0 : f.getUnitId()) != null ? u : ""), d = m == null ? void 0 : m.with(Le);
2864
2859
  Pt(() => {
2865
2860
  if (e)
2866
2861
  return i.setContextValue($n, !0), r && c.disable(), () => {
2867
- const l = h.getCurrentUnitOfType(U.UNIVER_DOC);
2862
+ const l = h.getCurrentUnitOfType(V.UNIVER_DOC);
2868
2863
  (l == null ? void 0 : l.getUnitId()) === o && i.setContextValue($n, !1), r && c.enable(), a.clear();
2869
2864
  };
2870
2865
  }, [i, e, a, r, o]), Pt(() => {
2871
2866
  if (e && t) {
2872
2867
  const l = d == null ? void 0 : d.enableSelectionChanging();
2873
- return i.setContextValue(Gn, !0), () => {
2874
- i.setContextValue(Gn, !1), l == null || l.dispose();
2868
+ return i.setContextValue(Yn, !0), () => {
2869
+ i.setContextValue(Yn, !1), l == null || l.dispose();
2875
2870
  };
2876
2871
  }
2877
2872
  }, [i, e, d, t]), P(() => {
2878
2873
  e && (d == null || d.setSkipLastEnabled(!1));
2879
2874
  }, [e, d]);
2880
- }, Cc = (e, t, n) => {
2881
- const o = O(te), r = O(vn);
2875
+ }, mc = (e, t, n) => {
2876
+ const o = O(ne), r = O(vn);
2882
2877
  return $t(() => {
2883
2878
  if (e) {
2884
- const i = [...r.getWorkbookSelections(t).getSelectionsOfWorksheet(n)], c = o.getCurrentUnitForType(U.UNIVER_SHEET), a = c == null ? void 0 : c.getActiveSheet();
2879
+ const i = [...r.getWorkbookSelections(t).getSelectionsOfWorksheet(n)], c = o.getCurrentUnitForType(V.UNIVER_SHEET), a = c == null ? void 0 : c.getActiveSheet();
2885
2880
  (c == null ? void 0 : c.getUnitId()) !== t && o.setCurrentUnitForType(t), a && a.getSheetId() === n && r.setSelections(i);
2886
2881
  }
2887
2882
  }, [e, r, n, t, o]);
2888
- }, _c = (e) => e.reduce((t, n) => typeof n == "string" ? t + n.length : t + n.token.length, 0), un = (e) => e.map((t) => typeof t == "string" ? t : t.token).join(""), Ft = (e, t = !1, n = "", o = !1) => !t && !o ? e.map((r) => Ee(r.range)) : e.map((r) => o ? jo(r) : r.sheetName !== "" && r.sheetName !== n ? _t(r.sheetName, r.range) : Ee(r.range)), Rc = (e) => {
2883
+ }, pc = (e) => e.reduce((t, n) => typeof n == "string" ? t + n.length : t + n.token.length, 0), un = (e) => e.map((t) => typeof t == "string" ? t : t.token).join(""), Ft = (e, t = !1, n = "", o = !1) => !t && !o ? e.map((r) => Ee(r.range)) : e.map((r) => o ? qo(r) : r.sheetName !== "" && r.sheetName !== n ? _t(r.sheetName, r.range) : Ee(r.range)), Sc = (e) => {
2889
2884
  var f, m, d;
2890
2885
  const { editor: t, lexerTreeBuilder: n } = e, o = t == null ? void 0 : t.getSelectionRanges();
2891
2886
  if ((o == null ? void 0 : o.length) !== 1)
2892
2887
  return;
2893
2888
  const s = o[0].startOffset - 1, i = ((m = (f = t == null ? void 0 : t.getDocumentData().body) == null ? void 0 : f.dataStream) != null ? m : `\r
2894
- `).slice(0, -2), c = (d = n.sequenceNodesBuilder(i.slice(1))) != null ? d : [], a = Tn(c, s, !1), h = qr(c, a);
2889
+ `).slice(0, -2), c = (d = n.sequenceNodesBuilder(i.slice(1))) != null ? d : [], a = Tn(c, s, !1), h = Hr(c, a);
2895
2890
  return {
2896
2891
  nodeIndex: a,
2897
2892
  updatingRefIndex: h,
2898
2893
  sequenceNodes: c,
2899
2894
  offset: s
2900
2895
  };
2901
- }, Ic = (() => {
2902
- }), Ec = (e, t, n, o, r, s, i, c, a, h = Ic) => {
2896
+ }, vc = (() => {
2897
+ }), Cc = (e, t, n, o, r, s, i, c, a, h = vc) => {
2903
2898
  var M;
2904
- const f = O(Te), m = O(te), d = O(pe), u = O(Nr), l = O(Et), v = O(ye), S = m.getUnit(o), g = ee((k, I) => {
2905
- var w, R, T;
2906
- return (T = (R = (w = m.getUnit(k)) == null ? void 0 : w.getSheetBySheetId(I)) == null ? void 0 : R.getName()) != null ? T : "";
2907
- }), C = le(() => g(o, r), [g, r, o]), _ = _e(S == null ? void 0 : S.activeSheet$), E = rt({ activeSheet: _, sheetName: C }), p = _e(le(() => m.getCurrentTypeOfUnit$(U.UNIVER_SHEET), [m])), b = f.getRenderById((M = p == null ? void 0 : p.getUnitId()) != null ? M : ""), y = b == null ? void 0 : b.with(Le), A = b == null ? void 0 : b.with(bt), F = O(Gt), N = ee((k, I, w) => {
2899
+ const f = O(Te), m = O(ne), d = O(pe), u = O(Tr), l = O(Et), v = O(ye), S = m.getUnit(o), g = ee((k, I) => {
2900
+ var x, R, T;
2901
+ return (T = (R = (x = m.getUnit(k)) == null ? void 0 : x.getSheetBySheetId(I)) == null ? void 0 : R.getName()) != null ? T : "";
2902
+ }), C = le(() => g(o, r), [g, r, o]), _ = _e(S == null ? void 0 : S.activeSheet$), E = rt({ activeSheet: _, sheetName: C }), p = _e(le(() => m.getCurrentTypeOfUnit$(V.UNIVER_SHEET), [m])), b = f.getRenderById((M = p == null ? void 0 : p.getUnitId()) != null ? M : ""), y = b == null ? void 0 : b.with(Le), A = b == null ? void 0 : b.with(bt), F = O(Gt), N = ee((k, I, x) => {
2908
2903
  var X, re, he, Y, J, ot, st, Ot, Oe, Nt;
2909
- const R = Rc({ editor: a, lexerTreeBuilder: v });
2904
+ const R = Sc({ editor: a, lexerTreeBuilder: v });
2910
2905
  if (!R) return;
2911
2906
  const { nodeIndex: T, updatingRefIndex: D, sequenceNodes: L, offset: W } = R;
2912
2907
  if (n.current === Me.NEED_ADD)
2913
2908
  if (W !== 0) {
2914
2909
  if (T === -1 && L.length)
2915
2910
  return;
2916
- const K = k[k.length - 1], ne = L.splice(T + 1), fe = (X = K.sheetId) != null ? X : r, oe = {
2911
+ const K = k[k.length - 1], te = L.splice(T + 1), fe = (X = K.sheetId) != null ? X : r, oe = {
2917
2912
  range: K,
2918
2913
  unitId: (re = K.unitId) != null ? re : p.getUnitId(),
2919
2914
  sheetName: g((he = K.unitId) != null ? he : p.getUnitId(), fe)
2920
2915
  }, ae = fe !== r, ge = (p == null ? void 0 : p.getUnitId()) !== o, Se = Ft([oe], i && (ae || ge), C, ge);
2921
2916
  L.push({ token: Se[0], nodeType: Q.REFERENCE });
2922
- const We = [...L, ...ne], He = un(We);
2923
- h(He, _c(L), I);
2917
+ const We = [...L, ...te], He = un(We);
2918
+ h(He, pc(L), I);
2924
2919
  } else {
2925
- const K = k[k.length - 1], ne = (Y = K.sheetId) != null ? Y : r, fe = {
2920
+ const K = k[k.length - 1], te = (Y = K.sheetId) != null ? Y : r, fe = {
2926
2921
  range: K,
2927
2922
  unitId: (J = K.unitId) != null ? J : p.getUnitId(),
2928
- sheetName: g((ot = K.unitId) != null ? ot : p.getUnitId(), ne)
2929
- }, oe = ne !== r, ae = (p == null ? void 0 : p.getUnitId()) !== o, ge = Ft([fe], i && (oe || ae), C, ae);
2923
+ sheetName: g((ot = K.unitId) != null ? ot : p.getUnitId(), te)
2924
+ }, oe = te !== r, ae = (p == null ? void 0 : p.getUnitId()) !== o, ge = Ft([fe], i && (oe || ae), C, ae);
2930
2925
  L.unshift({ token: ge[0], nodeType: Q.REFERENCE });
2931
2926
  const Se = un(L);
2932
2927
  h(Se, ge[0].length, I);
@@ -2934,20 +2929,20 @@ const Sc = (e, t, n, o) => {
2934
2929
  else if (n.current === Me.EDIT_OTHER_SHEET_REFERENCE || n.current === Me.EDIT_OTHER_WORKBOOK_REFERENCE) {
2935
2930
  const K = k.pop();
2936
2931
  if (!K) return;
2937
- const ne = L[T];
2938
- if (typeof ne == "object" && ne.nodeType === Q.REFERENCE) {
2939
- const fe = ne.token;
2940
- (p == null ? void 0 : p.getUnitId()) !== o ? ne.token = Ko((st = p == null ? void 0 : p.getUnitId()) != null ? st : "", C, K) : ne.token = C === (_ == null ? void 0 : _.getName()) ? Ee(K) : _t(_.getName(), K);
2941
- const ae = W + (ne.token.length - fe.length);
2942
- h(Yo(L), ae, I);
2932
+ const te = L[T];
2933
+ if (typeof te == "object" && te.nodeType === Q.REFERENCE) {
2934
+ const fe = te.token;
2935
+ (p == null ? void 0 : p.getUnitId()) !== o ? te.token = jo((st = p == null ? void 0 : p.getUnitId()) != null ? st : "", C, K) : te.token = C === (_ == null ? void 0 : _.getName()) ? Ee(K) : _t(_.getName(), K);
2936
+ const ae = W + (te.token.length - fe.length);
2937
+ h(Ko(L), ae, I);
2943
2938
  }
2944
2939
  } else {
2945
2940
  const K = [...k];
2946
- if (!w && D !== -1) {
2941
+ if (!x && D !== -1) {
2947
2942
  const G = K.pop();
2948
2943
  G && K.splice(D, 0, G);
2949
2944
  }
2950
- let ne = 0;
2945
+ let te = 0;
2951
2946
  const fe = L.map((G) => {
2952
2947
  var Re, we, it, Be;
2953
2948
  if (typeof G == "string")
@@ -2956,8 +2951,8 @@ const Sc = (e, t, n, o) => {
2956
2951
  const me = ht(G.token);
2957
2952
  if (me.sheetName || (me.sheetName = C), (me.unitId || o) !== (p == null ? void 0 : p.getUnitId()) || i && ((Re = E.current.activeSheet) == null ? void 0 : Re.getName()) !== me.sheetName)
2958
2953
  return G.token;
2959
- const ie = K[ne];
2960
- if (ne++, !ie)
2954
+ const ie = K[te];
2955
+ if (te++, !ie)
2961
2956
  return "";
2962
2957
  const gt = (we = ie.sheetId) != null ? we : r, Jt = {
2963
2958
  range: ie,
@@ -2973,7 +2968,7 @@ const Sc = (e, t, n, o) => {
2973
2968
  oe += G, Re === T && (ae = oe.length);
2974
2969
  });
2975
2970
  const ge = [];
2976
- for (let G = ne; G <= k.length - 1; G++) {
2971
+ for (let G = te; G <= k.length - 1; G++) {
2977
2972
  const Re = k[G], we = (Ot = Re.sheetId) != null ? Ot : r, it = {
2978
2973
  range: Re,
2979
2974
  unitId: (Oe = Re.unitId) != null ? Oe : p.getUnitId(),
@@ -2988,7 +2983,7 @@ const Sc = (e, t, n, o) => {
2988
2983
  P(() => {
2989
2984
  if (y && e) {
2990
2985
  let k = !0, I = 0;
2991
- const w = (T, D) => {
2986
+ const x = (T, D) => {
2992
2987
  if (k) {
2993
2988
  k = !1, I = T.length;
2994
2989
  return;
@@ -2997,9 +2992,9 @@ const Sc = (e, t, n, o) => {
2997
2992
  D && (I = T.length), N(T.map((W) => W.rangeWithCoord), D, L);
2998
2993
  }, R = new Ye();
2999
2994
  return R.add(y.selectionMoving$.subscribe((T) => {
3000
- w(T, !1);
2995
+ x(T, !1);
3001
2996
  })), R.add(y.selectionMoveEnd$.subscribe((T) => {
3002
- w(T, !0);
2997
+ x(T, !0);
3003
2998
  })), () => {
3004
2999
  R.dispose();
3005
3000
  };
@@ -3020,17 +3015,17 @@ const Sc = (e, t, n, o) => {
3020
3015
  })
3021
3016
  );
3022
3017
  });
3023
- }, w = Jo(
3018
+ }, x = zo(
3024
3019
  a.input$,
3025
3020
  F.selectionSet$,
3026
3021
  y.selectionMoveEnd$
3027
3022
  ).pipe(
3028
- Ds(50)
3023
+ ks(50)
3029
3024
  ).subscribe(() => {
3030
3025
  I();
3031
3026
  });
3032
3027
  return () => {
3033
- w.unsubscribe(), k.dispose();
3028
+ x.unsubscribe(), k.dispose();
3034
3029
  };
3035
3030
  }
3036
3031
  }, [a, t, N, y, F.selectionSet$]), y == null || y.getSelectionDataWithStyle(), P(() => {
@@ -3039,12 +3034,12 @@ const Sc = (e, t, n, o) => {
3039
3034
  var R;
3040
3035
  if (I.id !== Cn.id)
3041
3036
  return;
3042
- const w = I.params;
3043
- if (w.extra === "formula-editor" && w.selections.length) {
3044
- const T = w.selections[w.selections.length - 1];
3037
+ const x = I.params;
3038
+ if (x.extra === "formula-editor" && x.selections.length) {
3039
+ const T = x.selections[x.selections.length - 1];
3045
3040
  if (T) {
3046
3041
  const { range: D, primary: L } = T;
3047
- (L != null && L.isMergedMainCell || L != null && L.isMerged) && hn.contains(L, D) && (D.startRow = L.startRow, D.endRow = L.startRow, D.startColumn = L.startColumn, D.endColumn = L.startColumn);
3042
+ (L != null && L.isMergedMainCell || L != null && L.isMerged) && hn.contains(L, D) && (D.startRow = L.startRow, D.endRow = L.startRow, D.startColumn = L.startColumn, D.endColumn = L.startColumn), D.unitId = x.unitId, D.sheetId = x.subUnitId;
3048
3043
  const W = n.current === Me.NEED_ADD, X = ((R = y == null ? void 0 : y.getSelectionDataWithStyle()) != null ? R : []).map((re) => re.rangeWithCoord);
3049
3044
  W ? X.push(D) : X[X.length - 1] = D, N(X, !0);
3050
3045
  }
@@ -3058,7 +3053,7 @@ const Sc = (e, t, n, o) => {
3058
3053
  if (!a)
3059
3054
  return;
3060
3055
  const k = u.textSelection$.subscribe((I) => {
3061
- I.unitId === a.getEditorId() && Kr({
3056
+ I.unitId === a.getEditorId() && qr({
3062
3057
  unitId: o,
3063
3058
  subUnitId: r,
3064
3059
  refSelections: s.current,
@@ -3073,8 +3068,8 @@ const Sc = (e, t, n, o) => {
3073
3068
  });
3074
3069
  return () => k.unsubscribe();
3075
3070
  }, [u.textSelection$, a, s, y, F, A, r, l, o, m]);
3076
- }, bc = (e, t, n, o, r, s) => {
3077
- const i = O(pe), c = O(ze), h = O(Te).getRenderById(t), f = O(te), m = h == null ? void 0 : h.with(Le);
3071
+ }, _c = (e, t, n, o, r, s) => {
3072
+ const i = O(pe), c = O(ze), h = O(Te).getRenderById(t), f = O(ne), m = h == null ? void 0 : h.with(Le);
3078
3073
  P(() => {
3079
3074
  if (e && m)
3080
3075
  if (n) {
@@ -3086,8 +3081,8 @@ const Sc = (e, t, n, o) => {
3086
3081
  s();
3087
3082
  }, 30);
3088
3083
  }, u = i.onCommandExecuted((v) => {
3089
- v.id === Zn.id && d();
3090
- }), l = f.getCurrentTypeOfUnit$(U.UNIVER_SHEET).subscribe((v) => {
3084
+ v.id === Gn.id && d();
3085
+ }), l = f.getCurrentTypeOfUnit$(V.UNIVER_SHEET).subscribe((v) => {
3091
3086
  d();
3092
3087
  });
3093
3088
  return () => {
@@ -3095,7 +3090,7 @@ const Sc = (e, t, n, o) => {
3095
3090
  };
3096
3091
  } else {
3097
3092
  const d = i.beforeCommandExecuted((u) => {
3098
- if (u.id === Zn.id) {
3093
+ if (u.id === Gn.id) {
3099
3094
  o(!1), r(), s();
3100
3095
  const l = c.getEditor(fn);
3101
3096
  l == null || l.focus();
@@ -3106,7 +3101,7 @@ const Sc = (e, t, n, o) => {
3106
3101
  };
3107
3102
  }
3108
3103
  }, [e, m]);
3109
- }, yc = (e, t, n) => {
3104
+ }, Rc = (e, t, n) => {
3110
3105
  const o = O(ye), r = z(!0);
3111
3106
  P(() => {
3112
3107
  if (e) {
@@ -3120,10 +3115,10 @@ const Sc = (e, t, n, o) => {
3120
3115
  }, [e]), P(() => {
3121
3116
  if (!r.current && t) {
3122
3117
  const s = o.checkIfAddBracket(n);
3123
- t(s === 0 && n.startsWith(vr.EQUALS), `${n}`);
3118
+ t(s === 0 && n.startsWith(pr.EQUALS), `${n}`);
3124
3119
  }
3125
3120
  }, [n, t]);
3126
- }, Tc = (e, t = [], n) => {
3121
+ }, Ic = (e, t = [], n) => {
3127
3122
  const o = O(Zt), [r, s] = H([]), [i, c] = H(""), a = z(-1), h = rt({ nodes: t }), f = () => {
3128
3123
  s([]), c(""), a.current = -1;
3129
3124
  };
@@ -3161,15 +3156,15 @@ const Sc = (e, t, n, o) => {
3161
3156
  if (a.current !== -1) {
3162
3157
  const v = l.splice(a.current + 1), S = l.pop() || "";
3163
3158
  let g = (typeof S == "string" ? S.length : S.token.length) - d.length;
3164
- return l.push(d), v[0] !== Ge.OPEN_BRACKET && u !== Sr.DefinedName && (l.push(Ge.OPEN_BRACKET), g--), { text: un([...l, ...v]), offset: g };
3159
+ return l.push(d), v[0] !== Ge.OPEN_BRACKET && u !== mr.DefinedName && (l.push(Ge.OPEN_BRACKET), g--), { text: un([...l, ...v]), offset: g };
3165
3160
  }
3166
3161
  },
3167
3162
  reset: f
3168
3163
  };
3169
- }, Oc = () => {
3170
- }, Nc = Ve(Mc);
3171
- function Mc(e, t) {
3172
- const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: i = Oc } = e, c = s.getEditorId(), a = O(zt), h = O(pe), { searchList: f, searchText: m, handlerFormulaReplace: d, reset: u } = Tc(n, o, s), l = le(() => !!f.length, [f]), v = z(void 0), [S, g] = H(0), C = z(!1), [_] = jr(c, l, [m, f]), E = rt({ searchList: f, active: S }), p = (N, M) => {
3164
+ }, Ec = () => {
3165
+ }, bc = Ve(yc);
3166
+ function yc(e, t) {
3167
+ const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: i = Ec } = e, c = s.getEditorId(), a = O(zt), h = O(pe), { searchList: f, searchText: m, handlerFormulaReplace: d, reset: u } = Ic(n, o, s), l = le(() => !!f.length, [f]), v = z(void 0), [S, g] = H(0), C = z(!1), [_] = Br(c, l, [m, f]), E = rt({ searchList: f, active: S }), p = (N, M) => {
3173
3168
  const k = d(N, M);
3174
3169
  k && (u(), r(k));
3175
3170
  };
@@ -3183,7 +3178,7 @@ function Mc(e, t) {
3183
3178
  if (!f.length)
3184
3179
  return;
3185
3180
  const N = `sheet.formula-embedding-editor.search_function.${c}`, M = new Ye(), k = (I) => {
3186
- const { searchList: w, active: R } = E.current;
3181
+ const { searchList: x, active: R } = E.current;
3187
3182
  switch (I) {
3188
3183
  case $.ARROW_UP: {
3189
3184
  g((T) => {
@@ -3194,14 +3189,14 @@ function Mc(e, t) {
3194
3189
  }
3195
3190
  case $.ARROW_DOWN: {
3196
3191
  g((T) => {
3197
- const D = Math.min(w.length - 1, T + 1);
3192
+ const D = Math.min(x.length - 1, T + 1);
3198
3193
  return A(D), D;
3199
3194
  });
3200
3195
  break;
3201
3196
  }
3202
3197
  case $.TAB:
3203
3198
  case $.ENTER: {
3204
- const T = w[R];
3199
+ const T = x[R];
3205
3200
  p(T.name, T.functionType);
3206
3201
  break;
3207
3202
  }
@@ -3214,8 +3209,8 @@ function Mc(e, t) {
3214
3209
  return M.add(h.registerCommand({
3215
3210
  id: N,
3216
3211
  type: be.OPERATION,
3217
- handler(I, w) {
3218
- const { keyCode: R } = w;
3212
+ handler(I, x) {
3213
+ const { keyCode: R } = x;
3219
3214
  k(R);
3220
3215
  }
3221
3216
  })), [$.ARROW_UP, $.ARROW_DOWN, $.ENTER, $.ESC, $.TAB].map((I) => ({
@@ -3238,8 +3233,8 @@ function Mc(e, t) {
3238
3233
  if (!M) return;
3239
3234
  const k = M.children[N];
3240
3235
  if (!k) return;
3241
- const w = M.getBoundingClientRect().top, R = M.offsetHeight, T = k.getBoundingClientRect(), D = T.top, L = T.height;
3242
- if (D >= 0 && D > w && D - w + L <= R)
3236
+ const x = M.getBoundingClientRect().top, R = M.offsetHeight, T = k.getBoundingClientRect(), D = T.top, L = T.height;
3237
+ if (D >= 0 && D > x && D - x + L <= R)
3243
3238
  return;
3244
3239
  const W = k.offsetTop - (R - L) / 2;
3245
3240
  M.scrollTo({
@@ -3255,7 +3250,7 @@ function Mc(e, t) {
3255
3250
  }, 300);
3256
3251
  };
3257
3252
  }, []);
3258
- return f.length > 0 && l && /* @__PURE__ */ x(cn, { portal: !0, anchorRect$: _, direction: "vertical", children: /* @__PURE__ */ x(
3253
+ return f.length > 0 && l && /* @__PURE__ */ w(cn, { portal: !0, anchorRect$: _, direction: "vertical", children: /* @__PURE__ */ w(
3259
3254
  "ul",
3260
3255
  {
3261
3256
  ref: (N) => {
@@ -3277,10 +3272,10 @@ function Mc(e, t) {
3277
3272
  },
3278
3273
  children: [
3279
3274
  /* @__PURE__ */ B("span", { className: "univer-block univer-truncate univer-text-xs", children: [
3280
- /* @__PURE__ */ x("span", { className: "univer-text-red-500", children: N.name.substring(0, m.length) }),
3281
- /* @__PURE__ */ x("span", { children: N.name.slice(m.length) })
3275
+ /* @__PURE__ */ w("span", { className: "univer-text-red-500", children: N.name.substring(0, m.length) }),
3276
+ /* @__PURE__ */ w("span", { children: N.name.slice(m.length) })
3282
3277
  ] }),
3283
- /* @__PURE__ */ x(
3278
+ /* @__PURE__ */ w(
3284
3279
  "span",
3285
3280
  {
3286
3281
  className: "univer-block univer-text-xs univer-text-gray-400",
@@ -3294,8 +3289,8 @@ function Mc(e, t) {
3294
3289
  }
3295
3290
  ) });
3296
3291
  }
3297
- const xc = (e) => e.startsWith(vr.EQUALS) ? e.slice(1) : "", or = () => {
3298
- }, wc = Ve((e, t) => {
3292
+ const Tc = (e) => e.startsWith(pr.EQUALS) ? e.slice(1) : "", nr = () => {
3293
+ }, Oc = Ve((e, t) => {
3299
3294
  var Mn, xn, wn, kn;
3300
3295
  const {
3301
3296
  errorText: n,
@@ -3304,8 +3299,8 @@ const xc = (e) => e.startsWith(vr.EQUALS) ? e.slice(1) : "", or = () => {
3304
3299
  subUnitId: s,
3305
3300
  isFocus: i = !0,
3306
3301
  isSupportAcrossSheet: c = !1,
3307
- onFocus: a = or,
3308
- onBlur: h = or,
3302
+ onFocus: a = nr,
3303
+ onBlur: h = nr,
3309
3304
  onChange: f,
3310
3305
  onVerify: m,
3311
3306
  className: d,
@@ -3322,21 +3317,21 @@ const xc = (e) => e.startsWith(vr.EQUALS) ? e.slice(1) : "", or = () => {
3322
3317
  disableContextMenu: y,
3323
3318
  style: A
3324
3319
  } = e, F = O(ze), N = z(null), M = ee(f);
3325
- Ms(t, () => ({
3320
+ Ts(t, () => ({
3326
3321
  isClickOutSide: (Z) => N.current ? !N.current.contains(Z.target) : !1
3327
3322
  }));
3328
- const k = ee(v), I = z(null), w = z(void 0), R = w.current, [T, D] = H(i), L = z(null), W = le(() => u != null ? u : ho(`${Do}-${Yt(4)}`), []), X = le(() => n !== void 0, [n]), re = O(te), he = re.getUnit(W);
3323
+ const k = ee(v), I = z(null), x = z(void 0), R = x.current, [T, D] = H(i), L = z(null), W = le(() => u != null ? u : ao(`${Fo}-${Yt(4)}`), []), X = le(() => n !== void 0, [n]), re = O(ne), he = re.getUnit(W);
3329
3324
  _e(he == null ? void 0 : he.change$);
3330
- const Y = hc(), J = fo.transform.getPlainText((xn = (Mn = he == null ? void 0 : he.getBody()) == null ? void 0 : Mn.dataStream) != null ? xn : ""), ot = rt(J), st = le(() => xc(J), [J]), Ot = le(() => Y(st), [st, Y]), { isSelecting: Oe, isSelectingRef: Nt } = dc({ unitId: r, subUnitId: s, editorId: W, isFocus: T, disableOnClick: p }), K = z(""), fe = O(Te).getRenderById(W), oe = fe == null ? void 0 : fe.with(Ir), ae = oe == null ? void 0 : oe.isFocusing, ge = le(() => re.getCurrentTypeOfUnit$(U.UNIVER_DOC), [re]), Se = _e(ge), We = (Se == null ? void 0 : Se.getUnitId()) === W, He = z([]), G = Oe, we = (kn = (wn = O(ar).getConfig(kr)) == null ? void 0 : wn.functionScreenTips) != null ? kn : !0;
3331
- Ts(() => {
3325
+ const Y = lc(), J = uo.transform.getPlainText((xn = (Mn = he == null ? void 0 : he.getBody()) == null ? void 0 : Mn.dataStream) != null ? xn : ""), ot = rt(J), st = le(() => Tc(J), [J]), Ot = le(() => Y(st), [st, Y]), { isSelecting: Oe, isSelectingRef: Nt } = cc({ unitId: r, subUnitId: s, editorId: W, isFocus: T, disableOnClick: p }), K = z(""), fe = O(Te).getRenderById(W), oe = fe == null ? void 0 : fe.with(_r), ae = oe == null ? void 0 : oe.isFocusing, ge = le(() => re.getCurrentTypeOfUnit$(V.UNIVER_DOC), [re]), Se = _e(ge), We = (Se == null ? void 0 : Se.getUnitId()) === W, He = z([]), G = Oe, we = (kn = (wn = O(cr).getConfig(xr)) == null ? void 0 : wn.functionScreenTips) != null ? kn : !0;
3326
+ Es(() => {
3332
3327
  M(J);
3333
3328
  }, [J, M]);
3334
- const it = Yr("="), Be = gc(r, s), me = ee((Z, ce = !0, ke, Ne) => {
3335
- if (!w.current) return;
3329
+ const it = jr("="), Be = uc(r, s), me = ee((Z, ce = !0, ke, Ne) => {
3330
+ if (!x.current) return;
3336
3331
  K.current = Z;
3337
- const xt = Z[0] === "=" ? Z.slice(1) : "", Ae = Y(xt), zr = Ae.reduce((qe, kt) => typeof kt == "object" ? `${qe}${kt.token}` : `${qe}${kt}`, ""), wt = it(
3338
- w.current,
3339
- zr === xt ? Ae : [],
3332
+ const xt = Z[0] === "=" ? Z.slice(1) : "", Ae = Y(xt), Gr = Ae.reduce((qe, kt) => typeof kt == "object" ? `${qe}${kt.token}` : `${qe}${kt}`, ""), wt = it(
3333
+ x.current,
3334
+ Gr === xt ? Ae : [],
3340
3335
  ce,
3341
3336
  Ne
3342
3337
  );
@@ -3344,12 +3339,12 @@ const xc = (e) => e.startsWith(vr.EQUALS) ? e.slice(1) : "", or = () => {
3344
3339
  const qe = Ne != null ? Ne : R == null ? void 0 : R.getSelectionRanges();
3345
3340
  if ((qe == null ? void 0 : qe.length) !== 1)
3346
3341
  return;
3347
- const Xr = qe[0].startOffset - 1, Qr = Tn(Ae, Xr, !1), An = qr(Ae, Qr);
3342
+ const Zr = qe[0].startOffset - 1, zr = Tn(Ae, Zr, !1), An = Hr(Ae, zr);
3348
3343
  if (An >= 0) {
3349
3344
  const Fn = wt.splice(An, 1)[0];
3350
3345
  Fn && wt.push(Fn);
3351
3346
  }
3352
- Be(T ? wt : [], w.current);
3347
+ Be(T ? wt : [], x.current);
3353
3348
  }
3354
3349
  });
3355
3350
  P(() => {
@@ -3359,12 +3354,12 @@ const xc = (e) => e.startsWith(vr.EQUALS) ? e.slice(1) : "", or = () => {
3359
3354
  if (K.current === J) return;
3360
3355
  me(J, !1, !0);
3361
3356
  }
3362
- }, [J]), yc(T, m, J);
3363
- const ie = ac(R), gt = Cc(T, r, s);
3357
+ }, [J]), Rc(T, m, J);
3358
+ const ie = sc(R), gt = mc(T, r, s);
3364
3359
  P(() => {
3365
3360
  var Z;
3366
3361
  k(Oe, (Z = oe == null ? void 0 : oe.isFocusing) != null ? Z : !0);
3367
- }, [k, Oe]), ns(T, S, R), Pt(() => {
3362
+ }, [k, Oe]), Jo(T, S, R), Pt(() => {
3368
3363
  let Z;
3369
3364
  if (L.current) {
3370
3365
  Z = F.register({
@@ -3384,7 +3379,7 @@ const xc = (e) => e.startsWith(vr.EQUALS) ? e.slice(1) : "", or = () => {
3384
3379
  }
3385
3380
  }, L.current);
3386
3381
  const ce = F.getEditor(W);
3387
- w.current = ce, me(o, !1, !0);
3382
+ x.current = ce, me(o, !1, !0);
3388
3383
  }
3389
3384
  return () => {
3390
3385
  Z == null || Z.dispose();
@@ -3392,18 +3387,18 @@ const xc = (e) => e.startsWith(vr.EQUALS) ? e.slice(1) : "", or = () => {
3392
3387
  }, []), Pt(() => {
3393
3388
  i ? (D(i), ie()) : (C && (R == null || R.blur(), gt()), D(i));
3394
3389
  }, [i, R, ie, gt, C]);
3395
- const { checkScrollBar: Jt } = rs(R, E, _);
3396
- vc(T, !!(Oe && We), r, W, y), Sc(!!(T && ae && l), G, R, g);
3390
+ const { checkScrollBar: Jt } = es(R, E, _);
3391
+ gc(T, !!(Oe && We), r, W, y), fc(!!(T && ae && l), G, R, g);
3397
3392
  const Mt = ee((Z, ce, ke) => {
3398
3393
  if (!ae)
3399
3394
  return;
3400
3395
  const Ne = ce !== -1 ? [{ startOffset: ce + 1, endOffset: ce + 1, collapsed: !0 }] : void 0;
3401
3396
  me(`=${Z}`, !0, ke, Ne), ke && (ie(), ce !== -1 && setTimeout(() => {
3402
- const xt = { startOffset: ce + 1, endOffset: ce + 1 }, Ae = R == null ? void 0 : R.render.with(os);
3397
+ const xt = { startOffset: ce + 1, endOffset: ce + 1 }, Ae = R == null ? void 0 : R.render.with(ts);
3403
3398
  Ae == null || Ae.scrollToRange({ ...xt, collapsed: !0 });
3404
3399
  }, 50), Jt());
3405
3400
  });
3406
- Ec(
3401
+ Cc(
3407
3402
  T && !!(Oe && We),
3408
3403
  T,
3409
3404
  Nt,
@@ -3414,7 +3409,7 @@ const xc = (e) => e.startsWith(vr.EQUALS) ? e.slice(1) : "", or = () => {
3414
3409
  !!G,
3415
3410
  R,
3416
3411
  Mt
3417
- ), bc(T && !!(Oe && We), r, c, D, h, () => {
3412
+ ), _c(T && !!(Oe && We), r, c, D, h, () => {
3418
3413
  me(ot.current, !1, !0);
3419
3414
  });
3420
3415
  const On = (Z) => {
@@ -3435,7 +3430,7 @@ const xc = (e) => e.startsWith(vr.EQUALS) ? e.slice(1) : "", or = () => {
3435
3430
  D(!0), a(), ie();
3436
3431
  };
3437
3432
  return /* @__PURE__ */ B("div", { className: d, children: [
3438
- /* @__PURE__ */ x(
3433
+ /* @__PURE__ */ w(
3439
3434
  "div",
3440
3435
  {
3441
3436
  ref: N,
@@ -3443,7 +3438,7 @@ const xc = (e) => e.startsWith(vr.EQUALS) ? e.slice(1) : "", or = () => {
3443
3438
  "univer-ring-primary-500": T,
3444
3439
  "univer-ring-red-500": X
3445
3440
  }),
3446
- children: /* @__PURE__ */ x(
3441
+ children: /* @__PURE__ */ w(
3447
3442
  "div",
3448
3443
  {
3449
3444
  ref: L,
@@ -3453,9 +3448,9 @@ const xc = (e) => e.startsWith(vr.EQUALS) ? e.slice(1) : "", or = () => {
3453
3448
  )
3454
3449
  }
3455
3450
  ),
3456
- n !== void 0 && /* @__PURE__ */ x("div", { className: "univer-my-1 univer-text-xs univer-text-red-500", children: n }),
3457
- we && R && st !== "" && /* @__PURE__ */ x(
3458
- lc,
3451
+ n !== void 0 && /* @__PURE__ */ w("div", { className: "univer-my-1 univer-text-xs univer-text-red-500", children: n }),
3452
+ we && R && st !== "" && /* @__PURE__ */ w(
3453
+ oc,
3459
3454
  {
3460
3455
  editor: R,
3461
3456
  isFocus: T,
@@ -3463,8 +3458,8 @@ const xc = (e) => e.startsWith(vr.EQUALS) ? e.slice(1) : "", or = () => {
3463
3458
  onClose: () => ie()
3464
3459
  }
3465
3460
  ),
3466
- we && !!R && /* @__PURE__ */ x(
3467
- Nc,
3461
+ we && !!R && /* @__PURE__ */ w(
3462
+ bc,
3468
3463
  {
3469
3464
  isFocus: T,
3470
3465
  sequenceNodes: Ot,
@@ -3475,8 +3470,8 @@ const xc = (e) => e.startsWith(vr.EQUALS) ? e.slice(1) : "", or = () => {
3475
3470
  )
3476
3471
  ] });
3477
3472
  });
3478
- function kc(e, t, n, o) {
3479
- const r = O(ye), s = Yr(""), i = _e(e == null ? void 0 : e.getDocumentDataModel().change$), [c, a] = H([]), h = O(Lo), f = z(""), m = O(te);
3473
+ function Nc(e, t, n, o) {
3474
+ const r = O(ye), s = jr(""), i = _e(e == null ? void 0 : e.getDocumentDataModel().change$), [c, a] = H([]), h = O(Do), f = z(""), m = O(ne);
3480
3475
  return P(() => {
3481
3476
  if (!e) return;
3482
3477
  const d = e.getDocumentDataModel().getPlainText();
@@ -3502,7 +3497,7 @@ function kc(e, t, n, o) {
3502
3497
  }
3503
3498
  const d = s(e, c, !1), u = new Ye();
3504
3499
  return d.forEach((S) => {
3505
- const g = ht(S.token), C = m.getCurrentUnitForType(U.UNIVER_SHEET), _ = C == null ? void 0 : C.getActiveSheet();
3500
+ const g = ht(S.token), C = m.getCurrentUnitForType(V.UNIVER_SHEET), _ = C == null ? void 0 : C.getActiveSheet();
3506
3501
  if (!g.sheetName && o !== (_ == null ? void 0 : _.getSheetId()) || g.sheetName && (_ == null ? void 0 : _.getName()) !== g.sheetName)
3507
3502
  return;
3508
3503
  const E = new mn(S.themeColor).toRgb(), p = h.addShape({
@@ -3520,8 +3515,8 @@ function kc(e, t, n, o) {
3520
3515
  };
3521
3516
  }, [e, t, s, h, c]), { sequenceNodes: c };
3522
3517
  }
3523
- function Ac(e) {
3524
- const t = O(vn), { supportAcrossSheet: n = !1, keepSheetReference: o = !1, unitId: r, subUnitId: s, onChange: i } = e, a = O(te).getUnit(r, U.UNIVER_SHEET), h = ee(i), f = ee((m, d) => {
3518
+ function Mc(e) {
3519
+ const t = O(vn), { supportAcrossSheet: n = !1, keepSheetReference: o = !1, unitId: r, subUnitId: s, onChange: i } = e, a = O(ne).getUnit(r, V.UNIVER_SHEET), h = ee(i), f = ee((m, d) => {
3525
3520
  const u = a == null ? void 0 : a.getActiveSheet();
3526
3521
  if (!u || !n && u.getSheetId() !== s || !(m != null && m.length)) return;
3527
3522
  const l = o ? u.getName() : u.getSheetId() === s ? "" : u.getName(), v = m.map((S) => ({
@@ -3544,14 +3539,14 @@ function Ac(e) {
3544
3539
  };
3545
3540
  }, [f, t.selectionMoveEnd$, t.selectionMoveStart$, t.selectionMoving$]);
3546
3541
  }
3547
- const sr = (e) => !e.some((n) => {
3542
+ const rr = (e) => !e.some((n) => {
3548
3543
  if (typeof n == "string") {
3549
3544
  if (n !== Ge.COMMA)
3550
3545
  return !0;
3551
3546
  } else if (n.nodeType !== Q.REFERENCE)
3552
3547
  return !0;
3553
3548
  return !1;
3554
- }), Fc = (e) => {
3549
+ }), xc = (e) => {
3555
3550
  if (e.endColumn < e.startColumn) {
3556
3551
  const t = e.endColumn;
3557
3552
  e.endColumn = e.startColumn, e.startColumn = t;
@@ -3562,7 +3557,7 @@ const sr = (e) => !e.some((n) => {
3562
3557
  }
3563
3558
  return e;
3564
3559
  };
3565
- function Dc(e) {
3560
+ function wc(e) {
3566
3561
  const {
3567
3562
  visible: t,
3568
3563
  initialValue: n,
@@ -3590,7 +3585,7 @@ function Dc(e) {
3590
3585
  }, E = (p) => {
3591
3586
  u.splice(p, 1), l([...u]);
3592
3587
  };
3593
- return Ac({
3588
+ return Mc({
3594
3589
  unitId: o,
3595
3590
  subUnitId: r,
3596
3591
  supportAcrossSheet: i,
@@ -3614,8 +3609,8 @@ function Dc(e) {
3614
3609
  l(M), S(v + F.length - 1);
3615
3610
  }
3616
3611
  }
3617
- }), /* @__PURE__ */ x(
3618
- Fs,
3612
+ }), /* @__PURE__ */ w(
3613
+ ws,
3619
3614
  {
3620
3615
  width: "328px",
3621
3616
  open: t,
@@ -3624,8 +3619,8 @@ function Dc(e) {
3624
3619
  mask: !1,
3625
3620
  maskClosable: !1,
3626
3621
  footer: /* @__PURE__ */ B("footer", { className: "univer-flex univer-gap-2", children: [
3627
- /* @__PURE__ */ x(at, { onClick: h, children: m.t("rangeSelector.cancel") }),
3628
- /* @__PURE__ */ x(
3622
+ /* @__PURE__ */ w(at, { onClick: h, children: m.t("rangeSelector.cancel") }),
3623
+ /* @__PURE__ */ w(
3629
3624
  at,
3630
3625
  {
3631
3626
  variant: "primary",
@@ -3634,7 +3629,7 @@ function Dc(e) {
3634
3629
  u.filter((p) => {
3635
3630
  const b = d.sequenceNodesBuilder(p);
3636
3631
  return b && b.length === 1 && typeof b[0] != "string" && b[0].nodeType === Q.REFERENCE;
3637
- }).map((p) => ht(p)).map((p) => ({ ...p, range: Fc(p.range) }))
3632
+ }).map((p) => ht(p)).map((p) => ({ ...p, range: xc(p.range) }))
3638
3633
  );
3639
3634
  },
3640
3635
  children: m.t("rangeSelector.confirm")
@@ -3653,8 +3648,8 @@ function Dc(e) {
3653
3648
  {
3654
3649
  className: "univer-mb-2 univer-flex univer-items-center univer-gap-4",
3655
3650
  children: [
3656
- /* @__PURE__ */ x(
3657
- Or,
3651
+ /* @__PURE__ */ w(
3652
+ yr,
3658
3653
  {
3659
3654
  className: se("univer-w-full", {
3660
3655
  "univer-border-primary-600": v === b
@@ -3665,8 +3660,8 @@ function Dc(e) {
3665
3660
  onChange: (y) => C(b, y)
3666
3661
  }
3667
3662
  ),
3668
- u.length > 1 && /* @__PURE__ */ x(
3669
- Ur,
3663
+ u.length > 1 && /* @__PURE__ */ w(
3664
+ $r,
3670
3665
  {
3671
3666
  className: "univer-cursor-pointer",
3672
3667
  onClick: () => E(b)
@@ -3676,9 +3671,9 @@ function Dc(e) {
3676
3671
  },
3677
3672
  b
3678
3673
  )),
3679
- u.length < s && /* @__PURE__ */ x("div", { children: /* @__PURE__ */ B(at, { variant: "link", onClick: _, children: [
3680
- /* @__PURE__ */ x(Vr, {}),
3681
- /* @__PURE__ */ x("span", { children: m.t("rangeSelector.addAnotherRange") })
3674
+ u.length < s && /* @__PURE__ */ w("div", { children: /* @__PURE__ */ B(at, { variant: "link", onClick: _, children: [
3675
+ /* @__PURE__ */ w(Pr, {}),
3676
+ /* @__PURE__ */ w("span", { children: m.t("rangeSelector.addAnotherRange") })
3682
3677
  ] }) })
3683
3678
  ]
3684
3679
  }
@@ -3686,13 +3681,13 @@ function Dc(e) {
3686
3681
  }
3687
3682
  );
3688
3683
  }
3689
- function Lc(e) {
3684
+ function kc(e) {
3690
3685
  return e.split(Ge.COMMA).filter((t) => !!t).map((t) => ht(t));
3691
3686
  }
3692
- function $c(e) {
3687
+ function Ac(e) {
3693
3688
  return e.map((t) => t.sheetName ? _t(t.sheetName, t.range) : Ee(t.range)).join(Ge.COMMA);
3694
3689
  }
3695
- function Gr(e) {
3690
+ function Kr(e) {
3696
3691
  const [t, n] = H(null), {
3697
3692
  onVerify: o,
3698
3693
  selectorRef: r,
@@ -3709,11 +3704,11 @@ function Gr(e) {
3709
3704
  forceShowDialogWhenSelectionChanged: v,
3710
3705
  hideEditor: S,
3711
3706
  resetRange: g
3712
- } = e, [C, _] = H(f != null ? f : !1), [E, p] = H(!1), [b, y] = H([]), A = O(dt), F = O(ze), { sequenceNodes: N } = kc(t, C, s, i), M = rt(N), k = O(pe), I = ee(() => {
3707
+ } = e, [C, _] = H(f != null ? f : !1), [E, p] = H(!1), [b, y] = H([]), A = O(dt), F = O(ze), { sequenceNodes: N } = Nc(t, C, s, i), M = rt(N), k = O(pe), I = ee(() => {
3713
3708
  t == null || t.setSelectionRanges([]), t == null || t.blur(), F.blur();
3714
- }), w = ee(() => {
3709
+ }), x = ee(() => {
3715
3710
  var R;
3716
- I(), y(Lc((R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "")), p(!0);
3711
+ I(), y(kc((R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "")), p(!0);
3717
3712
  });
3718
3713
  return P(() => {
3719
3714
  r && (r.current = {
@@ -3724,7 +3719,7 @@ function Gr(e) {
3724
3719
  F.focus(t.getEditorId());
3725
3720
  },
3726
3721
  blur: I,
3727
- verify: () => sr(M.current),
3722
+ verify: () => rr(M.current),
3728
3723
  showDialog: (R) => {
3729
3724
  I(), y(R), p(!0);
3730
3725
  },
@@ -3738,7 +3733,7 @@ function Gr(e) {
3738
3733
  });
3739
3734
  }, [I, t, F, r, M]), P(() => {
3740
3735
  var R;
3741
- o == null || o(sr(N), (R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "");
3736
+ o == null || o(rr(N), (R = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? R : "");
3742
3737
  }, [N]), P(() => {
3743
3738
  d == null || d(E);
3744
3739
  }, [E]), P(() => {
@@ -3751,9 +3746,9 @@ function Gr(e) {
3751
3746
  };
3752
3747
  k.executeCommand(Cn.id, R);
3753
3748
  };
3754
- }, [E]), /* @__PURE__ */ B(Ns, { children: [
3755
- S ? null : /* @__PURE__ */ x(
3756
- ss,
3749
+ }, [E]), /* @__PURE__ */ B(ys, { children: [
3750
+ S ? null : /* @__PURE__ */ w(
3751
+ ns,
3757
3752
  {
3758
3753
  isSingle: !0,
3759
3754
  ...e,
@@ -3764,17 +3759,17 @@ function Gr(e) {
3764
3759
  onClickOutside: () => {
3765
3760
  _(!1), I(), u == null || u();
3766
3761
  },
3767
- icon: /* @__PURE__ */ x(As, { title: A.t("rangeSelector.buttonTooltip"), placement: "bottom", children: /* @__PURE__ */ x(
3768
- Hr,
3762
+ icon: /* @__PURE__ */ w(xs, { title: A.t("rangeSelector.buttonTooltip"), placement: "bottom", children: /* @__PURE__ */ w(
3763
+ Vr,
3769
3764
  {
3770
3765
  className: "univer-cursor-pointer dark:!univer-text-gray-300",
3771
- onClick: w
3766
+ onClick: x
3772
3767
  }
3773
3768
  ) })
3774
3769
  }
3775
3770
  ),
3776
- /* @__PURE__ */ x(
3777
- Dc,
3771
+ /* @__PURE__ */ w(
3772
+ wc,
3778
3773
  {
3779
3774
  initialValue: b,
3780
3775
  unitId: s,
@@ -3782,7 +3777,7 @@ function Gr(e) {
3782
3777
  visible: E,
3783
3778
  maxRangeCount: c,
3784
3779
  onConfirm: (R) => {
3785
- const T = $c(R), D = go.newEmptyData();
3780
+ const T = Ac(R), D = ho.newEmptyData();
3786
3781
  D.body.dataStream = T, t == null || t.replaceText(T, !1), m == null || m(D, T), p(!1), y([]), requestAnimationFrame(() => {
3787
3782
  I();
3788
3783
  });
@@ -3797,9 +3792,9 @@ function Gr(e) {
3797
3792
  )
3798
3793
  ] });
3799
3794
  }
3800
- const Pc = () => {
3795
+ const Fc = () => {
3801
3796
  var o, r;
3802
- const e = O(Br), t = _e(e.currentSelector$), n = z(null);
3797
+ const e = O(Wr), t = _e(e.currentSelector$), n = z(null);
3803
3798
  return P(() => {
3804
3799
  var s, i;
3805
3800
  if (t)
@@ -3807,8 +3802,8 @@ const Pc = () => {
3807
3802
  var c;
3808
3803
  (c = n.current) == null || c.hideDialog();
3809
3804
  };
3810
- }, [t]), /* @__PURE__ */ x(
3811
- Gr,
3805
+ }, [t]), /* @__PURE__ */ w(
3806
+ Kr,
3812
3807
  {
3813
3808
  unitId: (o = t == null ? void 0 : t.unitId) != null ? o : "",
3814
3809
  subUnitId: (r = t == null ? void 0 : t.subUnitId) != null ? r : "",
@@ -3821,24 +3816,24 @@ const Pc = () => {
3821
3816
  }
3822
3817
  );
3823
3818
  };
3824
- var Uc = Object.defineProperty, Vc = Object.getOwnPropertyDescriptor, Wc = (e, t, n) => t in e ? Uc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Hc = (e, t, n, o) => {
3825
- for (var r = o > 1 ? void 0 : o ? Vc(t, n) : t, s = e.length - 1, i; s >= 0; s--)
3819
+ var Dc = Object.defineProperty, Lc = Object.getOwnPropertyDescriptor, $c = (e, t, n) => t in e ? Dc(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Pc = (e, t, n, o) => {
3820
+ for (var r = o > 1 ? void 0 : o ? Lc(t, n) : t, s = e.length - 1, i; s >= 0; s--)
3826
3821
  (i = e[s]) && (r = i(r) || r);
3827
3822
  return r;
3828
- }, Dt = (e, t) => (n, o) => t(n, o, e), Zr = (e, t, n) => Wc(e, typeof t != "symbol" ? t + "" : t, n);
3829
- let Kt = class extends po {
3830
- constructor(e = er, t, n, o, r) {
3823
+ }, Dt = (e, t) => (n, o) => t(n, o, e), Yr = (e, t, n) => $c(e, typeof t != "symbol" ? t + "" : t, n);
3824
+ let Kt = class extends go {
3825
+ constructor(e = Qn, t, n, o, r) {
3831
3826
  super(), this._config = e, this._injector = t, this._renderManagerService = n, this._configService = o, this._uiPartsService = r;
3832
- const { menu: s, ...i } = So(
3833
- er,
3827
+ const { menu: s, ...i } = mo(
3828
+ Qn,
3834
3829
  this._config
3835
3830
  );
3836
- s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(kr, i, { merge: !0 });
3831
+ s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(xr, i, { merge: !0 });
3837
3832
  }
3838
3833
  onStarting() {
3839
- vo(this._injector, [
3834
+ po(this._injector, [
3840
3835
  [Xt, { useClass: ln }],
3841
- [Br],
3836
+ [Wr],
3842
3837
  [qt],
3843
3838
  [Vt],
3844
3839
  [Wt],
@@ -3852,15 +3847,15 @@ let Kt = class extends po {
3852
3847
  [
3853
3848
  [Le]
3854
3849
  ].forEach((e) => {
3855
- this.disposeWithMe(this._renderManagerService.registerRenderModule(U.UNIVER_SHEET, e));
3850
+ this.disposeWithMe(this._renderManagerService.registerRenderModule(V.UNIVER_SHEET, e));
3856
3851
  });
3857
3852
  }
3858
3853
  onRendered() {
3859
3854
  [
3860
3855
  [an]
3861
3856
  ].forEach((e) => {
3862
- this.disposeWithMe(this._renderManagerService.registerRenderModule(U.UNIVER_SHEET, e));
3863
- }), Co(this._injector, [
3857
+ this.disposeWithMe(this._renderManagerService.registerRenderModule(V.UNIVER_SHEET, e));
3858
+ }), So(this._injector, [
3864
3859
  [qt],
3865
3860
  // FormulaProgressBar relies on TriggerCalculationController, but it is necessary to ensure that the formula calculation is done after rendered.
3866
3861
  [Wt],
@@ -3872,31 +3867,31 @@ let Kt = class extends po {
3872
3867
  this._injector.get(Vt), this._injector.get(Ut);
3873
3868
  }
3874
3869
  _initUIPart() {
3875
- const e = this._injector.get(yr);
3876
- this.disposeWithMe(e.register($o, Gr)), this.disposeWithMe(e.register(Po, wc)), this.disposeWithMe(this._uiPartsService.registerComponent(Os.GLOBAL, () => Tr(Pc, this._injector)));
3870
+ const e = this._injector.get(Er);
3871
+ this.disposeWithMe(e.register(Lo, Kr)), this.disposeWithMe(e.register($o, Oc)), this.disposeWithMe(this._uiPartsService.registerComponent(bs.GLOBAL, () => br(Fc, this._injector)));
3877
3872
  }
3878
3873
  };
3879
- Zr(Kt, "pluginName", Mr);
3880
- Zr(Kt, "type", U.UNIVER_SHEET);
3881
- Kt = Hc([
3882
- mo(Rs),
3874
+ Yr(Kt, "pluginName", Or);
3875
+ Yr(Kt, "type", V.UNIVER_SHEET);
3876
+ Kt = Pc([
3877
+ fo(vs),
3883
3878
  Dt(1, q(It)),
3884
3879
  Dt(2, Te),
3885
- Dt(3, ar),
3886
- Dt(4, br)
3880
+ Dt(3, cr),
3881
+ Dt(4, Ir)
3887
3882
  ], Kt);
3888
3883
  export {
3889
- Us as FORMULA_PROMPT_ACTIVATED,
3890
- wc as FormulaEditor,
3884
+ Ls as FORMULA_PROMPT_ACTIVATED,
3885
+ Oc as FormulaEditor,
3891
3886
  Ut as FormulaReorderController,
3892
- Br as GlobalRangeSelectorService,
3893
- Vs as HelpFunctionOperation,
3887
+ Wr as GlobalRangeSelectorService,
3888
+ $s as HelpFunctionOperation,
3894
3889
  ve as InsertFunctionOperation,
3895
3890
  yn as MoreFunctionsOperation,
3896
- Gr as RangeSelector,
3891
+ Kr as RangeSelector,
3897
3892
  Le as RefSelectionsRenderService,
3898
- wr as ReferenceAbsoluteOperation,
3899
- Ys as SearchFunctionOperation,
3893
+ Mr as ReferenceAbsoluteOperation,
3894
+ qs as SearchFunctionOperation,
3900
3895
  ft as SelectEditorFormulaOperation,
3901
3896
  En as SheetCopyFormulaOnlyCommand,
3902
3897
  bn as SheetOnlyPasteFormulaCommand,