@odoo/o-spreadsheet 17.0.98 → 17.0.99

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.
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
- * @version 17.0.98
6
- * @date 2026-05-12T12:15:04.723Z
7
- * @hash ce2a580
5
+ * @version 17.0.99
6
+ * @date 2026-05-27T05:56:40.513Z
7
+ * @hash 54d8c62
8
8
  */
9
9
 
10
10
  (function(exports, _odoo_owl) {
@@ -17,7 +17,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
17
17
  var __getOwnPropNames = Object.getOwnPropertyNames;
18
18
  var __getProtoOf = Object.getPrototypeOf;
19
19
  var __hasOwnProp = Object.prototype.hasOwnProperty;
20
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
20
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
21
21
  var __exportAll = (all, no_symbols) => {
22
22
  let target = {};
23
23
  for (var name in all) {
@@ -89,6 +89,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
89
89
  return sprintf(_translate(s), ...values);
90
90
  };
91
91
  var LazyTranslatedString = class extends String {
92
+ values;
92
93
  constructor(str, values) {
93
94
  super(str);
94
95
  this.values = values;
@@ -104,53 +105,46 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
104
105
 
105
106
  //#endregion
106
107
  //#region src/types/errors.ts
107
- let CellErrorType = /* @__PURE__ */ function(CellErrorType) {
108
- CellErrorType["NotAvailable"] = "#N/A";
109
- CellErrorType["InvalidReference"] = "#REF";
110
- CellErrorType["BadExpression"] = "#BAD_EXPR";
111
- CellErrorType["CircularDependency"] = "#CYCLE";
112
- CellErrorType["UnknownFunction"] = "#NAME?";
113
- CellErrorType["GenericError"] = "#ERROR";
114
- return CellErrorType;
115
- }({});
116
108
  let CellErrorLevel = /* @__PURE__ */ function(CellErrorLevel) {
117
109
  CellErrorLevel[CellErrorLevel["silent"] = 0] = "silent";
118
110
  CellErrorLevel[CellErrorLevel["error"] = 1] = "error";
119
111
  return CellErrorLevel;
120
112
  }({});
121
113
  var EvaluationError = class extends Error {
122
- constructor(errorType, message, logLevel = CellErrorLevel.error) {
114
+ errorType;
115
+ logLevel;
116
+ constructor(errorType, message, logLevel = 1) {
123
117
  super(message);
124
118
  this.errorType = errorType;
125
119
  this.logLevel = logLevel;
126
120
  }
127
121
  get isVerbose() {
128
- return this.logLevel > CellErrorLevel.silent;
122
+ return this.logLevel > 0;
129
123
  }
130
124
  };
131
125
  var BadExpressionError = class extends EvaluationError {
132
126
  constructor(errorMessage) {
133
- super(CellErrorType.BadExpression, errorMessage);
127
+ super("#BAD_EXPR", errorMessage);
134
128
  }
135
129
  };
136
130
  var CircularDependencyError = class extends EvaluationError {
137
131
  constructor() {
138
- super(CellErrorType.CircularDependency, _t("Circular reference"));
132
+ super("#CYCLE", _t("Circular reference"));
139
133
  }
140
134
  };
141
135
  var InvalidReferenceError = class extends EvaluationError {
142
136
  constructor() {
143
- super(CellErrorType.InvalidReference, _t("Invalid reference"));
137
+ super("#REF", _t("Invalid reference"));
144
138
  }
145
139
  };
146
140
  var NotAvailableError = class extends EvaluationError {
147
141
  constructor(errorMessage = void 0) {
148
- super(CellErrorType.NotAvailable, errorMessage || _t("Data not available"), errorMessage ? CellErrorLevel.error : CellErrorLevel.silent);
142
+ super("#N/A", errorMessage || _t("Data not available"), errorMessage ? 1 : 0);
149
143
  }
150
144
  };
151
145
  var UnknownFunctionError = class extends EvaluationError {
152
146
  constructor(fctName) {
153
- super(CellErrorType.UnknownFunction, _t("Unknown function: \"%s\"", fctName));
147
+ super("#NAME?", _t("Unknown function: \"%s\"", fctName));
154
148
  }
155
149
  };
156
150
 
@@ -297,7 +291,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
297
291
  style: "thin",
298
292
  color: FILTERS_COLOR
299
293
  };
300
- const INCORRECT_RANGE_STRING = CellErrorType.InvalidReference;
294
+ const INCORRECT_RANGE_STRING = "#REF";
301
295
  const DEFAULT_REVISION_ID = "START_REVISION";
302
296
  const DEFAULT_GAUGE_LOWER_COLOR = "#cc0000";
303
297
  const DEFAULT_GAUGE_MIDDLE_COLOR = "#f1c232";
@@ -317,22 +311,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
317
311
  ];
318
312
  const FORBIDDEN_IN_EXCEL_REGEX = /'|\*|\?|\/|\\|\[|\]/;
319
313
  const DEFAULT_ERROR_MESSAGE = _t("Invalid expression");
320
- let ComponentsImportance = /* @__PURE__ */ function(ComponentsImportance) {
321
- ComponentsImportance[ComponentsImportance["Grid"] = 0] = "Grid";
322
- ComponentsImportance[ComponentsImportance["Highlight"] = 5] = "Highlight";
323
- ComponentsImportance[ComponentsImportance["HeaderGroupingButton"] = 6] = "HeaderGroupingButton";
324
- ComponentsImportance[ComponentsImportance["Figure"] = 10] = "Figure";
325
- ComponentsImportance[ComponentsImportance["ScrollBar"] = 15] = "ScrollBar";
326
- ComponentsImportance[ComponentsImportance["GridPopover"] = 19] = "GridPopover";
327
- ComponentsImportance[ComponentsImportance["GridComposer"] = 20] = "GridComposer";
328
- ComponentsImportance[ComponentsImportance["Dropdown"] = 21] = "Dropdown";
329
- ComponentsImportance[ComponentsImportance["IconPicker"] = 25] = "IconPicker";
330
- ComponentsImportance[ComponentsImportance["TopBarComposer"] = 30] = "TopBarComposer";
331
- ComponentsImportance[ComponentsImportance["Popover"] = 35] = "Popover";
332
- ComponentsImportance[ComponentsImportance["FigureAnchor"] = 1e3] = "FigureAnchor";
333
- ComponentsImportance[ComponentsImportance["FigureSnapLine"] = 1001] = "FigureSnapLine";
334
- return ComponentsImportance;
335
- }({});
336
314
  let DEFAULT_SHEETVIEW_SIZE = 0;
337
315
  function getDefaultSheetViewSize() {
338
316
  return DEFAULT_SHEETVIEW_SIZE;
@@ -1665,25 +1643,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1665
1643
  return sortedValues[indexSup] * (percentIndex - indexLow) + sortedValues[indexLow] * (indexSup - percentIndex);
1666
1644
  }
1667
1645
 
1668
- //#endregion
1669
- //#region src/types/cells.ts
1670
- let CellValueType = /* @__PURE__ */ function(CellValueType) {
1671
- CellValueType["boolean"] = "boolean";
1672
- CellValueType["number"] = "number";
1673
- CellValueType["text"] = "text";
1674
- CellValueType["empty"] = "empty";
1675
- CellValueType["error"] = "error";
1676
- return CellValueType;
1677
- }({});
1678
-
1679
- //#endregion
1680
- //#region src/types/clipboard.ts
1681
- let ClipboardMIMEType = /* @__PURE__ */ function(ClipboardMIMEType) {
1682
- ClipboardMIMEType["PlainText"] = "text/plain";
1683
- ClipboardMIMEType["Html"] = "text/html";
1684
- return ClipboardMIMEType;
1685
- }({});
1686
-
1687
1646
  //#endregion
1688
1647
  //#region src/types/commands.ts
1689
1648
  function isSheetDependent(cmd) {
@@ -1812,7 +1771,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1812
1771
  constructor(results = []) {
1813
1772
  if (!Array.isArray(results)) results = [results];
1814
1773
  results = [...new Set(results)];
1815
- this.reasons = results.filter((result) => result !== CommandResult.Success);
1774
+ this.reasons = results.filter((result) => result !== "Success");
1816
1775
  }
1817
1776
  /**
1818
1777
  * Static helper which returns a successful DispatchResult
@@ -1983,27 +1942,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1983
1942
  function isMatrix(x) {
1984
1943
  return Array.isArray(x) && Array.isArray(x[0]);
1985
1944
  }
1986
- let DIRECTION = /* @__PURE__ */ function(DIRECTION) {
1987
- DIRECTION["UP"] = "up";
1988
- DIRECTION["DOWN"] = "down";
1989
- DIRECTION["LEFT"] = "left";
1990
- DIRECTION["RIGHT"] = "right";
1991
- return DIRECTION;
1992
- }({});
1993
-
1994
- //#endregion
1995
- //#region src/types/rendering.ts
1996
- let LAYERS = /* @__PURE__ */ function(LAYERS) {
1997
- LAYERS[LAYERS["Background"] = 0] = "Background";
1998
- LAYERS[LAYERS["Highlights"] = 1] = "Highlights";
1999
- LAYERS[LAYERS["Clipboard"] = 2] = "Clipboard";
2000
- LAYERS[LAYERS["Search"] = 3] = "Search";
2001
- LAYERS[LAYERS["Chart"] = 4] = "Chart";
2002
- LAYERS[LAYERS["Autofill"] = 5] = "Autofill";
2003
- LAYERS[LAYERS["Selection"] = 6] = "Selection";
2004
- LAYERS[LAYERS["Headers"] = 7] = "Headers";
2005
- return LAYERS;
2006
- }({});
2007
1945
 
2008
1946
  //#endregion
2009
1947
  //#region src/functions/helpers.ts
@@ -2014,7 +1952,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2014
1952
  "undefined"
2015
1953
  ];
2016
1954
  function assert(condition, message) {
2017
- if (!condition()) throw new EvaluationError(CellErrorType.GenericError, message);
1955
+ if (!condition()) throw new EvaluationError("#ERROR", message);
2018
1956
  }
2019
1957
  const expectNumberValueError = (value) => _t("The function [[FUNCTION_NAME]] expects a number value, but '%s' is a string, and cannot be coerced to a number.", value);
2020
1958
  const expectNumberRangeError = (lowerBound, upperBound, value) => _t("The function [[FUNCTION_NAME]] expects a number value between %s and %s inclusive, but receives %s.", lowerBound.toString(), upperBound.toString(), value.toString());
@@ -3561,6 +3499,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3561
3499
  //#endregion
3562
3500
  //#region src/helpers/range.ts
3563
3501
  var RangeImpl = class RangeImpl {
3502
+ getSheetSize;
3564
3503
  _zone;
3565
3504
  parts;
3566
3505
  invalidXc;
@@ -4007,12 +3946,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4007
3946
  }
4008
3947
  return textCell((value || "").toString(), localeFormat);
4009
3948
  } catch (error) {
4010
- return errorCell(new EvaluationError(CellErrorType.GenericError, error.message || DEFAULT_ERROR_MESSAGE));
3949
+ return errorCell(new EvaluationError("#ERROR", error.message || DEFAULT_ERROR_MESSAGE));
4011
3950
  }
4012
3951
  }
4013
3952
  function textCell(value, localeFormat) {
4014
3953
  return {
4015
- type: CellValueType.text,
3954
+ type: "text",
4016
3955
  value,
4017
3956
  format: localeFormat.format,
4018
3957
  isAutoSummable: true,
@@ -4022,7 +3961,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4022
3961
  }
4023
3962
  function numberCell(value, localeFormat) {
4024
3963
  return {
4025
- type: CellValueType.number,
3964
+ type: "number",
4026
3965
  value: value || 0,
4027
3966
  format: localeFormat.format,
4028
3967
  isAutoSummable: true,
@@ -4031,7 +3970,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4031
3970
  };
4032
3971
  }
4033
3972
  const EMPTY_EVALUATED_CELL = {
4034
- type: CellValueType.empty,
3973
+ type: "empty",
4035
3974
  value: "",
4036
3975
  format: void 0,
4037
3976
  isAutoSummable: true,
@@ -4041,7 +3980,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4041
3980
  function emptyCell(localeFormat) {
4042
3981
  if (localeFormat.format === void 0) return EMPTY_EVALUATED_CELL;
4043
3982
  return {
4044
- type: CellValueType.empty,
3983
+ type: "empty",
4045
3984
  value: "",
4046
3985
  format: localeFormat.format,
4047
3986
  isAutoSummable: true,
@@ -4052,7 +3991,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4052
3991
  function dateTimeCell(value, localeFormat) {
4053
3992
  const formattedValue = formatValue(value, localeFormat);
4054
3993
  return {
4055
- type: CellValueType.number,
3994
+ type: "number",
4056
3995
  value,
4057
3996
  format: localeFormat.format,
4058
3997
  isAutoSummable: false,
@@ -4063,7 +4002,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4063
4002
  function booleanCell(value, localeFormat) {
4064
4003
  const formattedValue = value ? "TRUE" : "FALSE";
4065
4004
  return {
4066
- type: CellValueType.boolean,
4005
+ type: "boolean",
4067
4006
  value,
4068
4007
  format: localeFormat.format,
4069
4008
  isAutoSummable: false,
@@ -4073,7 +4012,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4073
4012
  }
4074
4013
  function errorCell(error) {
4075
4014
  return {
4076
- type: CellValueType.error,
4015
+ type: "error",
4077
4016
  value: error.errorType,
4078
4017
  error,
4079
4018
  isAutoSummable: false,
@@ -4117,7 +4056,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4117
4056
  content = formatValue(parseLiteral(cell.content, locale), localeFormat);
4118
4057
  }
4119
4058
  } catch {
4120
- content = CellErrorType.GenericError;
4059
+ content = "#ERROR";
4121
4060
  }
4122
4061
  return getCellContentHeight(ctx, content, cell.style, colSize);
4123
4062
  }
@@ -4689,16 +4628,16 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4689
4628
  }
4690
4629
  function checkDataset(definition) {
4691
4630
  if (definition.dataSets) {
4692
- if (definition.dataSets.find((range) => !rangeReference.test(range)) !== void 0) return CommandResult.InvalidDataSet;
4693
- if (definition.dataSets.map(toUnboundedZone).some((zone) => zone.top !== zone.bottom && isFullRow(zone))) return CommandResult.InvalidDataSet;
4631
+ if (definition.dataSets.find((range) => !rangeReference.test(range)) !== void 0) return "InvalidDataSet";
4632
+ if (definition.dataSets.map(toUnboundedZone).some((zone) => zone.top !== zone.bottom && isFullRow(zone))) return "InvalidDataSet";
4694
4633
  }
4695
- return CommandResult.Success;
4634
+ return "Success";
4696
4635
  }
4697
4636
  function checkLabelRange(definition) {
4698
4637
  if (definition.labelRange) {
4699
- if (!rangeReference.test(definition.labelRange || "")) return CommandResult.InvalidLabelRange;
4638
+ if (!rangeReference.test(definition.labelRange || "")) return "InvalidLabelRange";
4700
4639
  }
4701
- return CommandResult.Success;
4640
+ return "Success";
4702
4641
  }
4703
4642
  function shouldRemoveFirstLabel(labelRange, dataset, dataSetsHaveTitle) {
4704
4643
  if (!dataSetsHaveTitle) return false;
@@ -4710,7 +4649,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4710
4649
  }
4711
4650
  function getBaselineText(baseline, keyValue, baselineMode, locale) {
4712
4651
  if (!baseline) return "";
4713
- else if (baselineMode === "text" || keyValue?.type !== CellValueType.number || baseline.type !== CellValueType.number) return baseline.formattedValue;
4652
+ else if (baselineMode === "text" || keyValue?.type !== "number" || baseline.type !== "number") return baseline.formattedValue;
4714
4653
  else {
4715
4654
  let diff = keyValue.value - baseline.value;
4716
4655
  if (baselineMode === "percentage" && diff !== 0) diff = diff / baseline.value * 100;
@@ -4723,13 +4662,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4723
4662
  }
4724
4663
  }
4725
4664
  function getBaselineColor(baseline, baselineMode, keyValue, colorUp, colorDown) {
4726
- if (baselineMode === "text" || baseline?.type !== CellValueType.number || keyValue?.type !== CellValueType.number) return;
4665
+ if (baselineMode === "text" || baseline?.type !== "number" || keyValue?.type !== "number") return;
4727
4666
  const diff = keyValue.value - baseline.value;
4728
4667
  if (diff > 0) return colorUp;
4729
4668
  else if (diff < 0) return colorDown;
4730
4669
  }
4731
4670
  function getBaselineArrowDirection(baseline, keyValue, baselineMode) {
4732
- if (baselineMode === "text" || baseline?.type !== CellValueType.number || keyValue?.type !== CellValueType.number) return "neutral";
4671
+ if (baselineMode === "text" || baseline?.type !== "number" || keyValue?.type !== "number") return "neutral";
4733
4672
  const diff = keyValue.value - baseline.value;
4734
4673
  if (diff > 0) return "up";
4735
4674
  else if (diff < 0) return "down";
@@ -4748,10 +4687,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4748
4687
  //#endregion
4749
4688
  //#region src/helpers/figures/charts/scorecard_chart.ts
4750
4689
  function checkKeyValue(definition) {
4751
- return definition.keyValue && !rangeReference.test(definition.keyValue) ? CommandResult.InvalidScorecardKeyValue : CommandResult.Success;
4690
+ return definition.keyValue && !rangeReference.test(definition.keyValue) ? "InvalidScorecardKeyValue" : "Success";
4752
4691
  }
4753
4692
  function checkBaseline(definition) {
4754
- return definition.baseline && !rangeReference.test(definition.baseline) ? CommandResult.InvalidScorecardBaseline : CommandResult.Success;
4693
+ return definition.baseline && !rangeReference.test(definition.baseline) ? "InvalidScorecardBaseline" : "Success";
4755
4694
  }
4756
4695
  const arrowDownPath = new window.Path2D("M8.6 4.8a.5.5 0 0 1 0 .75l-3.9 3.9a.5 .5 0 0 1 -.75 0l-3.8 -3.9a.5 .5 0 0 1 0 -.75l.4-.4a.5.5 0 0 1 .75 0l2.3 2.4v-5.7c0-.25.25-.5.5-.5h.6c.25 0 .5.25.5.5v5.8l2.3 -2.4a.5.5 0 0 1 .75 0z");
4757
4696
  const arrowUpPath = new window.Path2D("M8.7 5.5a.5.5 0 0 0 0-.75l-3.8-4a.5.5 0 0 0-.75 0l-3.8 4a.5.5 0 0 0 0 .75l.4.4a.5.5 0 0 0 .75 0l2.3-2.4v5.8c0 .25.25.5.5.5h.6c.25 0 .5-.25.5-.5v-5.8l2.2 2.4a.5.5 0 0 0 .75 0z");
@@ -4961,6 +4900,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4961
4900
  }, runtime).computeDesign();
4962
4901
  }
4963
4902
  var ScorecardChartConfigBuilder = class {
4903
+ runtime;
4964
4904
  context;
4965
4905
  width;
4966
4906
  height;
@@ -5106,6 +5046,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5106
5046
  }
5107
5047
  };
5108
5048
  var ScorecardScalableElement = class {
5049
+ style;
5109
5050
  constructor(style = {}) {
5110
5051
  this.style = style;
5111
5052
  }
@@ -5223,19 +5164,19 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5223
5164
  let x = 0;
5224
5165
  let y = 0;
5225
5166
  switch (direction) {
5226
- case DIRECTION.UP:
5167
+ case "up":
5227
5168
  x = 0;
5228
5169
  y = -rule.current;
5229
5170
  break;
5230
- case DIRECTION.DOWN:
5171
+ case "down":
5231
5172
  x = 0;
5232
5173
  y = rule.current;
5233
5174
  break;
5234
- case DIRECTION.LEFT:
5175
+ case "left":
5235
5176
  x = -rule.current;
5236
5177
  y = 0;
5237
5178
  break;
5238
- case DIRECTION.RIGHT:
5179
+ case "right":
5239
5180
  x = rule.current;
5240
5181
  y = 0;
5241
5182
  break;
@@ -5309,12 +5250,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5309
5250
  },
5310
5251
  sequence: 10
5311
5252
  }).add("increment_alphanumeric_value", {
5312
- condition: (cell) => !cell.isFormula && evaluateLiteral(cell.content, { locale: DEFAULT_LOCALE }).type === CellValueType.text && alphaNumericValueRegExp.test(cell.content),
5253
+ condition: (cell) => !cell.isFormula && evaluateLiteral(cell.content, { locale: DEFAULT_LOCALE }).type === "text" && alphaNumericValueRegExp.test(cell.content),
5313
5254
  generateRule: (cell, cells, direction) => {
5314
5255
  const numberPostfix = parseInt(cell.content.match(numberPostfixRegExp)[0]);
5315
5256
  const prefix = cell.content.match(stringPrefixRegExp)[0];
5316
5257
  const numberPostfixLength = cell.content.length - prefix.length;
5317
- const group = getGroup(cell, cells, (evaluatedCell) => evaluatedCell.type === CellValueType.text && alphaNumericValueRegExp.test(evaluatedCell.value)).filter((cell) => prefix === cell.value.toString().match(stringPrefixRegExp)[0]).map((cell) => parseInt(cell.value.toString().match(numberPostfixRegExp)[0]));
5258
+ const group = getGroup(cell, cells, (evaluatedCell) => evaluatedCell.type === "text" && alphaNumericValueRegExp.test(evaluatedCell.value)).filter((cell) => prefix === cell.value.toString().match(stringPrefixRegExp)[0]).map((cell) => parseInt(cell.value.toString().match(numberPostfixRegExp)[0]));
5318
5259
  let increment = calculateIncrementBasedOnGroup(group);
5319
5260
  if (["up", "left"].includes(direction) && group.length === 1) increment = -increment;
5320
5261
  return {
@@ -5327,7 +5268,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5327
5268
  },
5328
5269
  sequence: 15
5329
5270
  }).add("copy_text", {
5330
- condition: (cell) => !cell.isFormula && evaluateLiteral(cell.content, { locale: DEFAULT_LOCALE }).type === CellValueType.text,
5271
+ condition: (cell) => !cell.isFormula && evaluateLiteral(cell.content, { locale: DEFAULT_LOCALE }).type === "text",
5331
5272
  generateRule: () => {
5332
5273
  return { type: "COPY_MODIFIER" };
5333
5274
  },
@@ -5343,16 +5284,16 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5343
5284
  },
5344
5285
  sequence: 30
5345
5286
  }).add("increment_number", {
5346
- condition: (cell) => !cell.isFormula && evaluateLiteral(cell.content, { locale: DEFAULT_LOCALE }).type === CellValueType.number,
5287
+ condition: (cell) => !cell.isFormula && evaluateLiteral(cell.content, { locale: DEFAULT_LOCALE }).type === "number",
5347
5288
  generateRule: (cell, cells, direction) => {
5348
- const group = getGroup(cell, cells, (evaluatedCell) => evaluatedCell.type === CellValueType.number).map((cell) => Number(cell.value));
5289
+ const group = getGroup(cell, cells, (evaluatedCell) => evaluatedCell.type === "number").map((cell) => Number(cell.value));
5349
5290
  let increment = calculateIncrementBasedOnGroup(group);
5350
5291
  if (["up", "left"].includes(direction) && group.length === 1) increment = -increment;
5351
5292
  const evaluation = evaluateLiteral(cell.content, { locale: DEFAULT_LOCALE });
5352
5293
  return {
5353
5294
  type: "INCREMENT_MODIFIER",
5354
5295
  increment,
5355
- current: evaluation.type === CellValueType.number ? evaluation.value : 0
5296
+ current: evaluation.type === "number" ? evaluation.value : 0
5356
5297
  };
5357
5298
  },
5358
5299
  sequence: 40
@@ -5506,7 +5447,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5506
5447
  const ErrorToolTipPopoverBuilder = { onHover: (position, getters) => {
5507
5448
  const cell = getters.getEvaluatedCell(position);
5508
5449
  const errors = [];
5509
- if (cell.type === CellValueType.error && cell.error.isVerbose) errors.push({
5450
+ if (cell.type === "error" && cell.error.isVerbose) errors.push({
5510
5451
  title: _t("Error"),
5511
5452
  message: cell.error.message
5512
5453
  });
@@ -6030,7 +5971,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
6030
5971
  css`
6031
5972
  .o-popover {
6032
5973
  position: absolute;
6033
- z-index: ${ComponentsImportance.Popover};
5974
+ z-index: ${35};
6034
5975
  overflow: auto;
6035
5976
  box-shadow: 1px 2px 5px 2px rgb(51 51 51 / 15%);
6036
5977
  width: fit-content;
@@ -6045,7 +5986,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
6045
5986
  onMouseWheel: () => {},
6046
5987
  onPopoverMoved: () => {},
6047
5988
  onPopoverHidden: () => {},
6048
- zIndex: ComponentsImportance.Popover
5989
+ zIndex: 35
6049
5990
  };
6050
5991
  popoverRef = (0, _odoo_owl.useRef)("popover");
6051
5992
  currentPosition = void 0;
@@ -6131,6 +6072,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
6131
6072
  slots: Object
6132
6073
  };
6133
6074
  var PopoverPositionContext = class {
6075
+ anchorRect;
6076
+ containerRect;
6077
+ propsMaxSize;
6078
+ spreadsheetOffset;
6134
6079
  constructor(anchorRect, containerRect, propsMaxSize, spreadsheetOffset) {
6135
6080
  this.anchorRect = anchorRect;
6136
6081
  this.containerRect = containerRect;
@@ -6748,7 +6693,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
6748
6693
  }
6749
6694
  shift() {
6750
6695
  const current = this.current;
6751
- this.current = this.text[++this.currentIndex];
6696
+ const next = this.text[++this.currentIndex];
6697
+ this.current = next;
6752
6698
  return current;
6753
6699
  }
6754
6700
  advanceBy(length) {
@@ -7291,10 +7237,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
7291
7237
  };
7292
7238
  function handlePasteResult(env, result) {
7293
7239
  if (!result.isSuccessful) {
7294
- if (result.reasons.includes(CommandResult.WrongPasteSelection)) env.raiseError(PasteInteractiveContent.wrongPasteSelection);
7295
- else if (result.reasons.includes(CommandResult.WillRemoveExistingMerge)) env.raiseError(PasteInteractiveContent.willRemoveExistingMerge);
7296
- else if (result.reasons.includes(CommandResult.WrongFigurePasteOption)) env.raiseError(PasteInteractiveContent.wrongFigurePasteOption);
7297
- else if (result.reasons.includes(CommandResult.FrozenPaneOverlap)) env.raiseError(PasteInteractiveContent.frozenPaneOverlap);
7240
+ if (result.reasons.includes("WrongPasteSelection")) env.raiseError(PasteInteractiveContent.wrongPasteSelection);
7241
+ else if (result.reasons.includes("WillRemoveExistingMerge")) env.raiseError(PasteInteractiveContent.willRemoveExistingMerge);
7242
+ else if (result.reasons.includes("WrongFigurePasteOption")) env.raiseError(PasteInteractiveContent.wrongFigurePasteOption);
7243
+ else if (result.reasons.includes("FrozenPaneOverlap")) env.raiseError(PasteInteractiveContent.frozenPaneOverlap);
7298
7244
  }
7299
7245
  }
7300
7246
  function interactivePaste(env, target, pasteOption) {
@@ -7315,24 +7261,24 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
7315
7261
  //#region src/components/translations_terms.ts
7316
7262
  const CfTerms = {
7317
7263
  Errors: {
7318
- [CommandResult.InvalidRange]: _t("The range is invalid"),
7319
- [CommandResult.FirstArgMissing]: _t("The argument is missing. Please provide a value"),
7320
- [CommandResult.SecondArgMissing]: _t("The second argument is missing. Please provide a value"),
7321
- [CommandResult.MinNaN]: _t("The minpoint must be a number"),
7322
- [CommandResult.MidNaN]: _t("The midpoint must be a number"),
7323
- [CommandResult.MaxNaN]: _t("The maxpoint must be a number"),
7324
- [CommandResult.ValueUpperInflectionNaN]: _t("The first value must be a number"),
7325
- [CommandResult.ValueLowerInflectionNaN]: _t("The second value must be a number"),
7326
- [CommandResult.MinBiggerThanMax]: _t("Minimum must be smaller then Maximum"),
7327
- [CommandResult.MinBiggerThanMid]: _t("Minimum must be smaller then Midpoint"),
7328
- [CommandResult.MidBiggerThanMax]: _t("Midpoint must be smaller then Maximum"),
7329
- [CommandResult.LowerBiggerThanUpper]: _t("Lower inflection point must be smaller than upper inflection point"),
7330
- [CommandResult.MinInvalidFormula]: _t("Invalid Minpoint formula"),
7331
- [CommandResult.MaxInvalidFormula]: _t("Invalid Maxpoint formula"),
7332
- [CommandResult.MidInvalidFormula]: _t("Invalid Midpoint formula"),
7333
- [CommandResult.ValueUpperInvalidFormula]: _t("Invalid upper inflection point formula"),
7334
- [CommandResult.ValueLowerInvalidFormula]: _t("Invalid lower inflection point formula"),
7335
- [CommandResult.EmptyRange]: _t("A range needs to be defined"),
7264
+ ["InvalidRange"]: _t("The range is invalid"),
7265
+ ["FirstArgMissing"]: _t("The argument is missing. Please provide a value"),
7266
+ ["SecondArgMissing"]: _t("The second argument is missing. Please provide a value"),
7267
+ ["MinNaN"]: _t("The minpoint must be a number"),
7268
+ ["MidNaN"]: _t("The midpoint must be a number"),
7269
+ ["MaxNaN"]: _t("The maxpoint must be a number"),
7270
+ ["ValueUpperInflectionNaN"]: _t("The first value must be a number"),
7271
+ ["ValueLowerInflectionNaN"]: _t("The second value must be a number"),
7272
+ ["MinBiggerThanMax"]: _t("Minimum must be smaller then Maximum"),
7273
+ ["MinBiggerThanMid"]: _t("Minimum must be smaller then Midpoint"),
7274
+ ["MidBiggerThanMax"]: _t("Midpoint must be smaller then Maximum"),
7275
+ ["LowerBiggerThanUpper"]: _t("Lower inflection point must be smaller than upper inflection point"),
7276
+ ["MinInvalidFormula"]: _t("Invalid Minpoint formula"),
7277
+ ["MaxInvalidFormula"]: _t("Invalid Maxpoint formula"),
7278
+ ["MidInvalidFormula"]: _t("Invalid Midpoint formula"),
7279
+ ["ValueUpperInvalidFormula"]: _t("Invalid upper inflection point formula"),
7280
+ ["ValueLowerInvalidFormula"]: _t("Invalid lower inflection point formula"),
7281
+ ["EmptyRange"]: _t("A range needs to be defined"),
7336
7282
  Unexpected: _t("The rule is invalid for an unknown reason")
7337
7283
  },
7338
7284
  ColorScale: _t("Color scale"),
@@ -7358,34 +7304,34 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
7358
7304
  Series: _t("Series"),
7359
7305
  Errors: {
7360
7306
  Unexpected: _t("The chart definition is invalid for an unknown reason"),
7361
- [CommandResult.InvalidDataSet]: _t("The dataset is invalid"),
7362
- [CommandResult.InvalidLabelRange]: _t("Labels are invalid"),
7363
- [CommandResult.InvalidScorecardKeyValue]: _t("The key value is invalid"),
7364
- [CommandResult.InvalidScorecardBaseline]: _t("The baseline value is invalid"),
7365
- [CommandResult.InvalidGaugeDataRange]: _t("The data range is invalid"),
7366
- [CommandResult.EmptyGaugeRangeMin]: _t("A minimum range limit value is needed"),
7367
- [CommandResult.GaugeRangeMinNaN]: _t("The minimum range limit value must be a number"),
7368
- [CommandResult.EmptyGaugeRangeMax]: _t("A maximum range limit value is needed"),
7369
- [CommandResult.GaugeRangeMaxNaN]: _t("The maximum range limit value must be a number"),
7370
- [CommandResult.GaugeRangeMinBiggerThanRangeMax]: _t("Minimum range limit must be smaller than maximum range limit"),
7371
- [CommandResult.GaugeLowerInflectionPointNaN]: _t("The lower inflection point value must be a number"),
7372
- [CommandResult.GaugeUpperInflectionPointNaN]: _t("The upper inflection point value must be a number")
7307
+ ["InvalidDataSet"]: _t("The dataset is invalid"),
7308
+ ["InvalidLabelRange"]: _t("Labels are invalid"),
7309
+ ["InvalidScorecardKeyValue"]: _t("The key value is invalid"),
7310
+ ["InvalidScorecardBaseline"]: _t("The baseline value is invalid"),
7311
+ ["InvalidGaugeDataRange"]: _t("The data range is invalid"),
7312
+ ["EmptyGaugeRangeMin"]: _t("A minimum range limit value is needed"),
7313
+ ["GaugeRangeMinNaN"]: _t("The minimum range limit value must be a number"),
7314
+ ["EmptyGaugeRangeMax"]: _t("A maximum range limit value is needed"),
7315
+ ["GaugeRangeMaxNaN"]: _t("The maximum range limit value must be a number"),
7316
+ ["GaugeRangeMinBiggerThanRangeMax"]: _t("Minimum range limit must be smaller than maximum range limit"),
7317
+ ["GaugeLowerInflectionPointNaN"]: _t("The lower inflection point value must be a number"),
7318
+ ["GaugeUpperInflectionPointNaN"]: _t("The upper inflection point value must be a number")
7373
7319
  }
7374
7320
  };
7375
7321
  const CustomCurrencyTerms = { Custom: _t("Custom") };
7376
7322
  const MergeErrorMessage = _t("Merged cells are preventing this operation. Unmerge those cells and try again.");
7377
7323
  const SplitToColumnsTerms = { Errors: {
7378
7324
  Unexpected: _t("Cannot split the selection for an unknown reason"),
7379
- [CommandResult.NoSplitSeparatorInSelection]: _t("There is no match for the selected separator in the selection"),
7380
- [CommandResult.MoreThanOneColumnSelected]: _t("Only a selection from a single column can be split"),
7381
- [CommandResult.SplitWillOverwriteContent]: _t("Splitting will overwrite existing content")
7325
+ ["NoSplitSeparatorInSelection"]: _t("There is no match for the selected separator in the selection"),
7326
+ ["MoreThanOneColumnSelected"]: _t("Only a selection from a single column can be split"),
7327
+ ["SplitWillOverwriteContent"]: _t("Splitting will overwrite existing content")
7382
7328
  } };
7383
7329
  const RemoveDuplicateTerms = { Errors: {
7384
7330
  Unexpected: _t("Cannot remove duplicates for an unknown reason"),
7385
- [CommandResult.MoreThanOneRangeSelected]: _t("Please select only one range of cells"),
7386
- [CommandResult.EmptyTarget]: _t("Please select a range of cells containing values."),
7387
- [CommandResult.NoColumnsProvided]: _t("Please select at latest one column to analyze."),
7388
- [CommandResult.WillRemoveExistingMerge]: PasteInteractiveContent.willRemoveExistingMerge
7331
+ ["MoreThanOneRangeSelected"]: _t("Please select only one range of cells"),
7332
+ ["EmptyTarget"]: _t("Please select a range of cells containing values."),
7333
+ ["NoColumnsProvided"]: _t("Please select at latest one column to analyze."),
7334
+ ["WillRemoveExistingMerge"]: PasteInteractiveContent.willRemoveExistingMerge
7389
7335
  } };
7390
7336
  const DVTerms = {
7391
7337
  DateIs: {
@@ -7799,47 +7745,47 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
7799
7745
  //#endregion
7800
7746
  //#region src/helpers/figures/charts/gauge_chart.ts
7801
7747
  function isDataRangeValid(definition) {
7802
- return definition.dataRange && !rangeReference.test(definition.dataRange) ? CommandResult.InvalidGaugeDataRange : CommandResult.Success;
7748
+ return definition.dataRange && !rangeReference.test(definition.dataRange) ? "InvalidGaugeDataRange" : "Success";
7803
7749
  }
7804
7750
  function checkRangeLimits(check, batchValidations) {
7805
7751
  return batchValidations((definition) => {
7806
7752
  if (definition.sectionRule) return check(definition.sectionRule.rangeMin, "rangeMin");
7807
- return CommandResult.Success;
7753
+ return "Success";
7808
7754
  }, (definition) => {
7809
7755
  if (definition.sectionRule) return check(definition.sectionRule.rangeMax, "rangeMax");
7810
- return CommandResult.Success;
7756
+ return "Success";
7811
7757
  });
7812
7758
  }
7813
7759
  function checkInflectionPointsValue(check, batchValidations) {
7814
7760
  return batchValidations((definition) => {
7815
7761
  if (definition.sectionRule) return check(definition.sectionRule.lowerInflectionPoint.value, "lowerInflectionPointValue");
7816
- return CommandResult.Success;
7762
+ return "Success";
7817
7763
  }, (definition) => {
7818
7764
  if (definition.sectionRule) return check(definition.sectionRule.upperInflectionPoint.value, "upperInflectionPointValue");
7819
- return CommandResult.Success;
7765
+ return "Success";
7820
7766
  });
7821
7767
  }
7822
7768
  function checkRangeMinBiggerThanRangeMax(definition) {
7823
7769
  if (definition.sectionRule) {
7824
- if (Number(definition.sectionRule.rangeMin) >= Number(definition.sectionRule.rangeMax)) return CommandResult.GaugeRangeMinBiggerThanRangeMax;
7770
+ if (Number(definition.sectionRule.rangeMin) >= Number(definition.sectionRule.rangeMax)) return "GaugeRangeMinBiggerThanRangeMax";
7825
7771
  }
7826
- return CommandResult.Success;
7772
+ return "Success";
7827
7773
  }
7828
7774
  function checkEmpty(value, valueName) {
7829
7775
  if (value === "") switch (valueName) {
7830
- case "rangeMin": return CommandResult.EmptyGaugeRangeMin;
7831
- case "rangeMax": return CommandResult.EmptyGaugeRangeMax;
7776
+ case "rangeMin": return "EmptyGaugeRangeMin";
7777
+ case "rangeMax": return "EmptyGaugeRangeMax";
7832
7778
  }
7833
- return CommandResult.Success;
7779
+ return "Success";
7834
7780
  }
7835
7781
  function checkNaN(value, valueName) {
7836
7782
  if (isNaN(value)) switch (valueName) {
7837
- case "rangeMin": return CommandResult.GaugeRangeMinNaN;
7838
- case "rangeMax": return CommandResult.GaugeRangeMaxNaN;
7839
- case "lowerInflectionPointValue": return CommandResult.GaugeLowerInflectionPointNaN;
7840
- case "upperInflectionPointValue": return CommandResult.GaugeUpperInflectionPointNaN;
7783
+ case "rangeMin": return "GaugeRangeMinNaN";
7784
+ case "rangeMax": return "GaugeRangeMaxNaN";
7785
+ case "lowerInflectionPointValue": return "GaugeLowerInflectionPointNaN";
7786
+ case "upperInflectionPointValue": return "GaugeUpperInflectionPointNaN";
7841
7787
  }
7842
- return CommandResult.Success;
7788
+ return "Success";
7843
7789
  }
7844
7790
  var GaugeChart = class GaugeChart extends AbstractChart {
7845
7791
  dataRange;
@@ -7998,7 +7944,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
7998
7944
  col: dataRange.zone.left,
7999
7945
  row: dataRange.zone.top
8000
7946
  });
8001
- if (cell.type === CellValueType.number) {
7947
+ if (cell.type === "number") {
8002
7948
  needleValue = clip(cell.value, minNeedleValue - deltaBeyondRangeLimit, maxNeedleValue + deltaBeyondRangeLimit);
8003
7949
  cellFormatter = () => getters.getRangeFormattedValues(dataRange)[0];
8004
7950
  displayValue = true;
@@ -8906,7 +8852,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
8906
8852
  function interactiveCut(env) {
8907
8853
  const result = env.model.dispatch("CUT");
8908
8854
  if (!result.isSuccessful) {
8909
- if (result.isCancelledBecause(CommandResult.WrongCutSelection)) env.raiseError(_t("This operation is not allowed with multiple selections."));
8855
+ if (result.isCancelledBecause("WrongCutSelection")) env.raiseError(_t("This operation is not allowed with multiple selections."));
8910
8856
  }
8911
8857
  }
8912
8858
 
@@ -8921,8 +8867,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
8921
8867
  sheetId,
8922
8868
  target
8923
8869
  });
8924
- if (result.isCancelledBecause(CommandResult.MergeInFilter)) env.raiseError(AddMergeInteractiveContent.MergeInFilter);
8925
- else if (result.isCancelledBecause(CommandResult.MergeIsDestructive)) env.askConfirmation(AddMergeInteractiveContent.MergeIsDestructive, () => {
8870
+ if (result.isCancelledBecause("MergeInFilter")) env.raiseError(AddMergeInteractiveContent.MergeInFilter);
8871
+ else if (result.isCancelledBecause("MergeIsDestructive")) env.askConfirmation(AddMergeInteractiveContent.MergeIsDestructive, () => {
8926
8872
  env.model.dispatch("ADD_MERGE", {
8927
8873
  sheetId,
8928
8874
  target,
@@ -9024,9 +8970,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
9024
8970
  ...dataSetZone,
9025
8971
  bottom: dataSetZone.top
9026
8972
  });
9027
- const dataSetsHaveTitle = !!cellsInFirstRow.find((cell) => cell.type !== CellValueType.empty && cell.type !== CellValueType.number);
8973
+ const dataSetsHaveTitle = !!cellsInFirstRow.find((cell) => cell.type !== "empty" && cell.type !== "number");
9028
8974
  if (dataSetsHaveTitle) {
9029
- const texts = cellsInFirstRow.filter((cell) => cell.type !== CellValueType.error && cell.type !== CellValueType.empty).map((cell) => cell.formattedValue);
8975
+ const texts = cellsInFirstRow.filter((cell) => cell.type !== "error" && cell.type !== "empty").map((cell) => cell.formattedValue);
9030
8976
  const lastElement = texts.splice(-1)[0];
9031
8977
  title = texts.join(", ");
9032
8978
  if (lastElement) title += (title ? " " + _t("and") + " " : "") + lastElement;
@@ -9336,7 +9282,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
9336
9282
  const target = env.model.getters.getSelectedZones();
9337
9283
  if (osClipboard && osClipboard.content !== spreadsheetClipboard) interactivePasteFromOS(env, target, osClipboard.content, pasteOption);
9338
9284
  else interactivePaste(env, target, pasteOption);
9339
- if (env.model.getters.isCutOperation() && pasteOption !== "onlyValue") await env.clipboard.write({ [ClipboardMIMEType.PlainText]: "" });
9285
+ if (env.model.getters.isCutOperation() && pasteOption !== "onlyValue") await env.clipboard.write({ ["text/plain"]: "" });
9340
9286
  break;
9341
9287
  case "notImplemented":
9342
9288
  env.raiseError(_t("Pasting from the context menu is not supported in this browser. Use keyboard shortcuts ctrl+c / ctrl+v instead."));
@@ -12660,15 +12606,15 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
12660
12606
  const jsEndDate = numberToJsDate(_endDate);
12661
12607
  assert(() => _endDate >= _startDate, _t("start_date (%s) should be on or before end_date (%s).", jsStartDate.toLocaleDateString(), jsEndDate.toLocaleDateString()));
12662
12608
  switch (_unit) {
12663
- case TIME_UNIT.WHOLE_YEARS: return getTimeDifferenceInWholeYears(jsStartDate, jsEndDate);
12664
- case TIME_UNIT.WHOLE_MONTHS: return getTimeDifferenceInWholeMonths(jsStartDate, jsEndDate);
12665
- case TIME_UNIT.WHOLE_DAYS: return getTimeDifferenceInWholeDays(jsStartDate, jsEndDate);
12666
- case TIME_UNIT.MONTH_WITHOUT_WHOLE_YEARS: return getTimeDifferenceInWholeMonths(jsStartDate, jsEndDate) - getTimeDifferenceInWholeYears(jsStartDate, jsEndDate) * 12;
12667
- case TIME_UNIT.DAYS_WITHOUT_WHOLE_MONTHS:
12609
+ case "Y": return getTimeDifferenceInWholeYears(jsStartDate, jsEndDate);
12610
+ case "M": return getTimeDifferenceInWholeMonths(jsStartDate, jsEndDate);
12611
+ case "D": return getTimeDifferenceInWholeDays(jsStartDate, jsEndDate);
12612
+ case "YM": return getTimeDifferenceInWholeMonths(jsStartDate, jsEndDate) - getTimeDifferenceInWholeYears(jsStartDate, jsEndDate) * 12;
12613
+ case "MD":
12668
12614
  let days = jsEndDate.getDate() - jsStartDate.getDate();
12669
12615
  if (days < 0) days = getDaysInMonth(new DateTime(jsEndDate.getFullYear(), jsEndDate.getMonth() - 1, 1)) - Math.abs(days);
12670
12616
  return days;
12671
- case TIME_UNIT.DAYS_BETWEEN_NO_MORE_THAN_ONE_YEAR: {
12617
+ case "YD": {
12672
12618
  if (areTwoDatesWithinOneYear(_startDate, _endDate)) return getTimeDifferenceInWholeDays(jsStartDate, jsEndDate);
12673
12619
  const endDateWithinOneYear = new DateTime(jsStartDate.getFullYear(), jsEndDate.getMonth(), jsEndDate.getDate());
12674
12620
  let days = getTimeDifferenceInWholeDays(jsStartDate, endDateWithinOneYear);
@@ -13201,18 +13147,18 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13201
13147
  //#endregion
13202
13148
  //#region src/helpers/sort.ts
13203
13149
  const SORT_TYPES = [
13204
- CellValueType.number,
13205
- CellValueType.error,
13206
- CellValueType.text,
13207
- CellValueType.boolean
13150
+ "number",
13151
+ "error",
13152
+ "text",
13153
+ "boolean"
13208
13154
  ];
13209
13155
  function cellsSortingCriterion(sortingOrder) {
13210
13156
  const inverse = sortingOrder === "ascending" ? 1 : -1;
13211
13157
  return (left, right) => {
13212
- if (left.type === CellValueType.empty) return right.type === CellValueType.empty ? 0 : 1;
13213
- else if (right.type === CellValueType.empty) return -1;
13158
+ if (left.type === "empty") return right.type === "empty" ? 0 : 1;
13159
+ else if (right.type === "empty") return -1;
13214
13160
  let typeOrder = SORT_TYPES.indexOf(left.type) - SORT_TYPES.indexOf(right.type);
13215
- if (typeOrder === 0) if (left.type === CellValueType.text || left.type === CellValueType.error) typeOrder = left.value.localeCompare(right.value);
13161
+ if (typeOrder === 0) if (left.type === "text" || left.type === "error") typeOrder = left.value.localeCompare(right.value);
13216
13162
  else typeOrder = left.value - right.value;
13217
13163
  return inverse * typeOrder;
13218
13164
  };
@@ -13223,9 +13169,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13223
13169
  type: cell.type,
13224
13170
  value: cell.value
13225
13171
  }));
13226
- return (emptyCellAsZero ? cellsWithIndex.map((cell) => cell.type === CellValueType.empty ? {
13172
+ return (emptyCellAsZero ? cellsWithIndex.map((cell) => cell.type === "empty" ? {
13227
13173
  ...cell,
13228
- type: CellValueType.number,
13174
+ type: "number",
13229
13175
  value: 0
13230
13176
  } : cell) : cellsWithIndex).sort(cellsSortingCriterion(sortDirection));
13231
13177
  }
@@ -13287,7 +13233,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13287
13233
  });
13288
13234
  });
13289
13235
  }
13290
- if (result.isCancelledBecause(CommandResult.InvalidSortZone)) {
13236
+ if (result.isCancelledBecause("InvalidSortZone")) {
13291
13237
  const { col, row } = anchor;
13292
13238
  env.model.selection.selectZone({
13293
13239
  cell: {
@@ -13340,11 +13286,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13340
13286
  const right = sortColumn[b];
13341
13287
  const leftCell = {
13342
13288
  value: left,
13343
- type: left === null ? CellValueType.empty : typeof left === "string" ? CellValueType.text : typeof left
13289
+ type: left === null ? "empty" : typeof left === "string" ? "text" : typeof left
13344
13290
  };
13345
13291
  const rightCell = {
13346
13292
  value: right,
13347
- type: right === null ? CellValueType.empty : typeof right === "string" ? CellValueType.text : typeof right
13293
+ type: right === null ? "empty" : typeof right === "string" ? "text" : typeof right
13348
13294
  };
13349
13295
  const result = sortingCriteria[sortingOrders[i]](leftCell, rightCell);
13350
13296
  if (result !== 0) return result;
@@ -15257,7 +15203,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
15257
15203
  value();
15258
15204
  return false;
15259
15205
  } catch (e) {
15260
- return e?.errorType !== CellErrorType.NotAvailable;
15206
+ return e?.errorType !== "#N/A";
15261
15207
  }
15262
15208
  },
15263
15209
  isExported: true
@@ -15298,7 +15244,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
15298
15244
  value();
15299
15245
  return false;
15300
15246
  } catch (e) {
15301
- return e?.errorType === CellErrorType.NotAvailable;
15247
+ return e?.errorType === "#N/A";
15302
15248
  }
15303
15249
  },
15304
15250
  isExported: true
@@ -15447,7 +15393,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
15447
15393
  try {
15448
15394
  result = value();
15449
15395
  } catch (e) {
15450
- if (e.errorType === CellErrorType.NotAvailable) result = valueIfError();
15396
+ if (e.errorType === "#N/A") result = valueIfError();
15451
15397
  else result = value();
15452
15398
  }
15453
15399
  if (result === void 0) return { value: "" };
@@ -16398,7 +16344,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
16398
16344
  const argDefinition = descr.args[descr.getArgToFocus(i + 1) - 1];
16399
16345
  const arg = args[i];
16400
16346
  if (isMatrix(arg) && !argDefinition.acceptMatrix) {
16401
- if (arg.length !== 1 || arg[0].length !== 1) throw new EvaluationError(CellErrorType.GenericError, _t("Function [[FUNCTION_NAME]] expects the parameter '%s' to be a single value or a single cell reference, not a range.", argDefinition.name));
16347
+ if (arg.length !== 1 || arg[0].length !== 1) throw new EvaluationError("#ERROR", _t("Function [[FUNCTION_NAME]] expects the parameter '%s' to be a single value or a single cell reference, not a range.", argDefinition.name));
16402
16348
  args[i] = arg[0][0];
16403
16349
  }
16404
16350
  }
@@ -16774,9 +16720,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
16774
16720
  target,
16775
16721
  sheetId
16776
16722
  });
16777
- if (result.isCancelledBecause(CommandResult.FilterOverlap)) env.raiseError(AddFilterInteractiveContent.filterOverlap);
16778
- else if (result.isCancelledBecause(CommandResult.MergeInFilter)) env.raiseError(AddFilterInteractiveContent.mergeInFilter);
16779
- else if (result.isCancelledBecause(CommandResult.NonContinuousTargets)) env.raiseError(AddFilterInteractiveContent.nonContinuousTargets);
16723
+ if (result.isCancelledBecause("FilterOverlap")) env.raiseError(AddFilterInteractiveContent.filterOverlap);
16724
+ else if (result.isCancelledBecause("MergeInFilter")) env.raiseError(AddFilterInteractiveContent.mergeInFilter);
16725
+ else if (result.isCancelledBecause("NonContinuousTargets")) env.raiseError(AddFilterInteractiveContent.nonContinuousTargets);
16780
16726
  }
16781
16727
 
16782
16728
  //#endregion
@@ -16787,7 +16733,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
16787
16733
  if (env.model.dispatch(cmd, {
16788
16734
  sheetId,
16789
16735
  quantity: base
16790
- }).isCancelledBecause(CommandResult.MergeOverlap)) env.raiseError(MergeErrorMessage);
16736
+ }).isCancelledBecause("MergeOverlap")) env.raiseError(MergeErrorMessage);
16791
16737
  }
16792
16738
 
16793
16739
  //#endregion
@@ -18334,10 +18280,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
18334
18280
  return [...this.state.datasetDispatchResult?.reasons || [], ...this.state.labelsDispatchResult?.reasons || []].map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
18335
18281
  }
18336
18282
  get isDatasetInvalid() {
18337
- return !!this.state.datasetDispatchResult?.isCancelledBecause(CommandResult.InvalidDataSet);
18283
+ return !!this.state.datasetDispatchResult?.isCancelledBecause("InvalidDataSet");
18338
18284
  }
18339
18285
  get isLabelInvalid() {
18340
- return !!this.state.labelsDispatchResult?.isCancelledBecause(CommandResult.InvalidLabelRange);
18286
+ return !!this.state.labelsDispatchResult?.isCancelledBecause("InvalidLabelRange");
18341
18287
  }
18342
18288
  onUpdateDataSetsHaveTitle(ev) {
18343
18289
  this.props.updateChart(this.props.figureId, { dataSetsHaveTitle: ev.target.checked });
@@ -19025,7 +18971,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
19025
18971
  return [...this.state.dataRangeDispatchResult?.reasons || []].map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
19026
18972
  }
19027
18973
  get isDataRangeInvalid() {
19028
- return !!this.state.dataRangeDispatchResult?.isCancelledBecause(CommandResult.InvalidGaugeDataRange);
18974
+ return !!this.state.dataRangeDispatchResult?.isCancelledBecause("InvalidGaugeDataRange");
19029
18975
  }
19030
18976
  onDataRangeChanged(ranges) {
19031
18977
  this.dataRange = ranges[0];
@@ -19105,16 +19051,16 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
19105
19051
  this.props.updateChart(this.props.figureId, { title: this.state.title });
19106
19052
  }
19107
19053
  isRangeMinInvalid() {
19108
- return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(CommandResult.EmptyGaugeRangeMin) || this.state.sectionRuleDispatchResult?.isCancelledBecause(CommandResult.GaugeRangeMinNaN) || this.state.sectionRuleDispatchResult?.isCancelledBecause(CommandResult.GaugeRangeMinBiggerThanRangeMax));
19054
+ return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause("EmptyGaugeRangeMin") || this.state.sectionRuleDispatchResult?.isCancelledBecause("GaugeRangeMinNaN") || this.state.sectionRuleDispatchResult?.isCancelledBecause("GaugeRangeMinBiggerThanRangeMax"));
19109
19055
  }
19110
19056
  isRangeMaxInvalid() {
19111
- return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(CommandResult.EmptyGaugeRangeMax) || this.state.sectionRuleDispatchResult?.isCancelledBecause(CommandResult.GaugeRangeMaxNaN) || this.state.sectionRuleDispatchResult?.isCancelledBecause(CommandResult.GaugeRangeMinBiggerThanRangeMax));
19057
+ return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause("EmptyGaugeRangeMax") || this.state.sectionRuleDispatchResult?.isCancelledBecause("GaugeRangeMaxNaN") || this.state.sectionRuleDispatchResult?.isCancelledBecause("GaugeRangeMinBiggerThanRangeMax"));
19112
19058
  }
19113
19059
  get isLowerInflectionPointInvalid() {
19114
- return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(CommandResult.GaugeLowerInflectionPointNaN) || this.state.sectionRuleDispatchResult?.isCancelledBecause(CommandResult.GaugeLowerBiggerThanUpper));
19060
+ return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause("GaugeLowerInflectionPointNaN") || this.state.sectionRuleDispatchResult?.isCancelledBecause("GaugeLowerBiggerThanUpper"));
19115
19061
  }
19116
19062
  get isUpperInflectionPointInvalid() {
19117
- return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(CommandResult.GaugeUpperInflectionPointNaN) || this.state.sectionRuleDispatchResult?.isCancelledBecause(CommandResult.GaugeLowerBiggerThanUpper));
19063
+ return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause("GaugeUpperInflectionPointNaN") || this.state.sectionRuleDispatchResult?.isCancelledBecause("GaugeLowerBiggerThanUpper"));
19118
19064
  }
19119
19065
  updateSectionColor(target, color) {
19120
19066
  const sectionRule = deepCopy(this.state.sectionRule);
@@ -19191,10 +19137,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
19191
19137
  return [...this.state.keyValueDispatchResult?.reasons || [], ...this.state.baselineDispatchResult?.reasons || []].map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
19192
19138
  }
19193
19139
  get isKeyValueInvalid() {
19194
- return !!this.state.keyValueDispatchResult?.isCancelledBecause(CommandResult.InvalidScorecardKeyValue);
19140
+ return !!this.state.keyValueDispatchResult?.isCancelledBecause("InvalidScorecardKeyValue");
19195
19141
  }
19196
19142
  get isBaselineInvalid() {
19197
- return !!this.state.keyValueDispatchResult?.isCancelledBecause(CommandResult.InvalidScorecardBaseline);
19143
+ return !!this.state.keyValueDispatchResult?.isCancelledBecause("InvalidScorecardBaseline");
19198
19144
  }
19199
19145
  onKeyValueRangeChanged(ranges) {
19200
19146
  this.keyValue = ranges[0];
@@ -19493,7 +19439,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
19493
19439
  css`
19494
19440
  .o-icon-picker {
19495
19441
  position: absolute;
19496
- z-index: ${ComponentsImportance.IconPicker};
19442
+ z-index: ${25};
19497
19443
  box-shadow: 1px 2px 5px 2px rgba(51, 51, 51, 0.15);
19498
19444
  background-color: white;
19499
19445
  padding: 2px 1px;
@@ -19743,6 +19689,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
19743
19689
  }
19744
19690
  };
19745
19691
  var ContainerWrapper = class {
19692
+ el;
19746
19693
  constructor(el) {
19747
19694
  this.el = el;
19748
19695
  }
@@ -20100,11 +20047,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
20100
20047
  colorNumberString = colorNumberString;
20101
20048
  state;
20102
20049
  setup() {
20050
+ const cf = this.props.editedCf || {
20051
+ id: this.env.model.uuidGenerator.smallUuid(),
20052
+ ranges: this.env.model.getters.getSelectedZones().map((zone) => this.env.model.getters.zoneToXC(this.env.model.getters.getActiveSheetId(), zone))
20053
+ };
20103
20054
  this.state = (0, _odoo_owl.useState)({
20104
- currentCF: this.props.editedCf || {
20105
- id: this.env.model.uuidGenerator.smallUuid(),
20106
- ranges: this.env.model.getters.getSelectedZones().map((zone) => this.env.model.getters.zoneToXC(this.env.model.getters.getActiveSheetId(), zone))
20107
- },
20055
+ currentCF: cf,
20108
20056
  currentCFType: this.props.editedCf?.rule.type || "CellIsRule",
20109
20057
  errors: [],
20110
20058
  rules: this.getDefaultRules()
@@ -20123,7 +20071,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
20123
20071
  (0, _odoo_owl.useExternalListener)(window, "click", this.closeMenus);
20124
20072
  }
20125
20073
  get isRangeValid() {
20126
- return this.state.errors.includes(CommandResult.EmptyRange);
20074
+ return this.state.errors.includes("EmptyRange");
20127
20075
  }
20128
20076
  errorMessage(error) {
20129
20077
  return CfTerms.Errors[error] || CfTerms.Errors.Unexpected;
@@ -20131,7 +20079,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
20131
20079
  saveConditionalFormat() {
20132
20080
  if (this.state.currentCF) {
20133
20081
  if (this.state.currentCF.ranges.some((xc) => !xc.match(rangeReference))) {
20134
- this.state.errors = [CommandResult.InvalidRange];
20082
+ this.state.errors = ["InvalidRange"];
20135
20083
  return;
20136
20084
  }
20137
20085
  const sheetId = this.env.model.getters.getActiveSheetId();
@@ -20221,10 +20169,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
20221
20169
  * Cell Is Rule
20222
20170
  ****************************************************************************/
20223
20171
  get isValue1Invalid() {
20224
- return !!this.state.errors?.includes(CommandResult.FirstArgMissing);
20172
+ return !!this.state.errors?.includes("FirstArgMissing");
20225
20173
  }
20226
20174
  get isValue2Invalid() {
20227
- return !!this.state.errors?.includes(CommandResult.SecondArgMissing);
20175
+ return !!this.state.errors?.includes("SecondArgMissing");
20228
20176
  }
20229
20177
  toggleStyle(tool) {
20230
20178
  const style = this.state.rules.cellIs.style;
@@ -20253,9 +20201,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
20253
20201
  ****************************************************************************/
20254
20202
  isValueInvalid(threshold) {
20255
20203
  switch (threshold) {
20256
- case "minimum": return this.state.errors.includes(CommandResult.MinInvalidFormula) || this.state.errors.includes(CommandResult.MinBiggerThanMid) || this.state.errors.includes(CommandResult.MinBiggerThanMax) || this.state.errors.includes(CommandResult.MinNaN);
20257
- case "midpoint": return this.state.errors.includes(CommandResult.MidInvalidFormula) || this.state.errors.includes(CommandResult.MidNaN) || this.state.errors.includes(CommandResult.MidBiggerThanMax);
20258
- case "maximum": return this.state.errors.includes(CommandResult.MaxInvalidFormula) || this.state.errors.includes(CommandResult.MaxNaN);
20204
+ case "minimum": return this.state.errors.includes("MinInvalidFormula") || this.state.errors.includes("MinBiggerThanMid") || this.state.errors.includes("MinBiggerThanMax") || this.state.errors.includes("MinNaN");
20205
+ case "midpoint": return this.state.errors.includes("MidInvalidFormula") || this.state.errors.includes("MidNaN") || this.state.errors.includes("MidBiggerThanMax");
20206
+ case "maximum": return this.state.errors.includes("MaxInvalidFormula") || this.state.errors.includes("MaxNaN");
20259
20207
  default: return false;
20260
20208
  }
20261
20209
  }
@@ -20292,8 +20240,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
20292
20240
  ****************************************************************************/
20293
20241
  isInflectionPointInvalid(inflectionPoint) {
20294
20242
  switch (inflectionPoint) {
20295
- case "lowerInflectionPoint": return this.state.errors.includes(CommandResult.ValueLowerInflectionNaN) || this.state.errors.includes(CommandResult.ValueLowerInvalidFormula) || this.state.errors.includes(CommandResult.LowerBiggerThanUpper);
20296
- case "upperInflectionPoint": return this.state.errors.includes(CommandResult.ValueUpperInflectionNaN) || this.state.errors.includes(CommandResult.ValueUpperInvalidFormula) || this.state.errors.includes(CommandResult.LowerBiggerThanUpper);
20243
+ case "lowerInflectionPoint": return this.state.errors.includes("ValueLowerInflectionNaN") || this.state.errors.includes("ValueLowerInvalidFormula") || this.state.errors.includes("LowerBiggerThanUpper");
20244
+ case "upperInflectionPoint": return this.state.errors.includes("ValueUpperInflectionNaN") || this.state.errors.includes("ValueUpperInvalidFormula") || this.state.errors.includes("LowerBiggerThanUpper");
20297
20245
  default: return true;
20298
20246
  }
20299
20247
  }
@@ -20462,13 +20410,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
20462
20410
  if (currenciesRegistry.getAll().length === 0) (await this.env.loadCurrencies?.() || []).forEach((currency, index) => {
20463
20411
  currenciesRegistry.add(index.toString(), currency);
20464
20412
  });
20465
- this.availableCurrencies = [{
20413
+ const emptyCurrency = {
20466
20414
  name: _t(CustomCurrencyTerms.Custom),
20467
20415
  code: "",
20468
20416
  symbol: "",
20469
20417
  decimalPlaces: 2,
20470
20418
  position: "after"
20471
- }, ...currenciesRegistry.getAll()];
20419
+ };
20420
+ this.availableCurrencies = [emptyCurrency, ...currenciesRegistry.getAll()];
20472
20421
  }
20473
20422
  updateSelectCurrency(ev) {
20474
20423
  const target = ev.target;
@@ -20816,7 +20765,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
20816
20765
  separator,
20817
20766
  addNewColumns
20818
20767
  });
20819
- if (result.isCancelledBecause(CommandResult.SplitWillOverwriteContent)) env.askConfirmation(SplitToColumnsInteractiveContent.SplitIsDestructive, () => {
20768
+ if (result.isCancelledBecause("SplitWillOverwriteContent")) env.askConfirmation(SplitToColumnsInteractiveContent.SplitIsDestructive, () => {
20820
20769
  result = env.model.dispatch("SPLIT_TEXT_INTO_COLUMNS", {
20821
20770
  separator,
20822
20771
  addNewColumns,
@@ -21241,13 +21190,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
21241
21190
  getPreview: (criterion) => _t("Custom formula %s", criterion.values[0])
21242
21191
  });
21243
21192
  function getNumberCriterionlocalizedValues(criterion, locale) {
21244
- return criterion.values.map((value) => value !== void 0 ? localizeContent(value, locale) : CellErrorType.InvalidReference);
21193
+ return criterion.values.map((value) => value !== void 0 ? localizeContent(value, locale) : "#REF");
21245
21194
  }
21246
21195
  function getDateCriterionLocalizedValues(criterion, locale) {
21247
21196
  return getDateNumberCriterionValues(criterion, DEFAULT_LOCALE).map((value) => value !== void 0 ? formatValue(value, {
21248
21197
  locale,
21249
21198
  format: locale.dateFormat
21250
- }) : CellErrorType.InvalidReference);
21199
+ }) : "#REF");
21251
21200
  }
21252
21201
  function checkValueIsDate(value) {
21253
21202
  return valueToDateNumber(value, DEFAULT_LOCALE) !== void 0;
@@ -21271,7 +21220,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
21271
21220
  //#endregion
21272
21221
  //#region src/helpers/ui/stop_edition_interactive.ts
21273
21222
  function interactiveStopEdition(env) {
21274
- if (env.model.dispatch("STOP_EDITION").isCancelledBecause(CommandResult.BlockingValidationRule)) {
21223
+ if (env.model.dispatch("STOP_EDITION").isCancelledBecause("BlockingValidationRule")) {
21275
21224
  const editedCell = env.model.getters.getCurrentEditedCell();
21276
21225
  const cellXc = toXC(editedCell.col, editedCell.row);
21277
21226
  const rule = env.model.getters.getValidationRuleForCell(editedCell);
@@ -21348,8 +21297,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
21348
21297
  }).reasons;
21349
21298
  const errors = /* @__PURE__ */ new Set();
21350
21299
  for (const reason of cancelledReasons) switch (reason) {
21351
- case CommandResult.SplitWillOverwriteContent:
21352
- case CommandResult.EmptySplitSeparator: break;
21300
+ case "SplitWillOverwriteContent":
21301
+ case "EmptySplitSeparator": break;
21353
21302
  default: errors.add(SplitToColumnsTerms.Errors[reason] || SplitToColumnsTerms.Errors.Unexpected);
21354
21303
  }
21355
21304
  return Array.from(errors);
@@ -21360,7 +21309,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
21360
21309
  separator: this.separatorValue,
21361
21310
  addNewColumns: this.state.addNewColumns,
21362
21311
  force: false
21363
- }).reasons.includes(CommandResult.SplitWillOverwriteContent)) warnings.push(SplitToColumnsTerms.Errors[CommandResult.SplitWillOverwriteContent]);
21312
+ }).reasons.includes("SplitWillOverwriteContent")) warnings.push(SplitToColumnsTerms.Errors["SplitWillOverwriteContent"]);
21364
21313
  return warnings;
21365
21314
  }
21366
21315
  get separatorValue() {
@@ -22085,7 +22034,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
22085
22034
  box-sizing: content-box;
22086
22035
 
22087
22036
  .o-fig-anchor {
22088
- z-index: ${ComponentsImportance.FigureAnchor};
22037
+ z-index: ${1e3};
22089
22038
  position: absolute;
22090
22039
  width: ${ANCHOR_SIZE}px;
22091
22040
  height: ${ANCHOR_SIZE}px;
@@ -22173,7 +22122,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
22173
22122
  top: `${y}px`,
22174
22123
  width: `${width}px`,
22175
22124
  height: `${height}px`,
22176
- "z-index": String(ComponentsImportance.Figure + (this.isSelected ? 1 : 0))
22125
+ "z-index": String(10 + (this.isSelected ? 1 : 0))
22177
22126
  });
22178
22127
  }
22179
22128
  getResizerPosition(resizer) {
@@ -22320,7 +22269,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
22320
22269
  end: group.end
22321
22270
  });
22322
22271
  if (!result.isSuccessful) {
22323
- if (result.isCancelledBecause(CommandResult.NotEnoughElements)) {
22272
+ if (result.isCancelledBecause("NotEnoughElements")) {
22324
22273
  const errorMessage = dimension === "ROW" ? ToggleGroupInteractiveContent.CannotHideAllRows : ToggleGroupInteractiveContent.CannotHideAllColumns;
22325
22274
  env.raiseError(errorMessage);
22326
22275
  }
@@ -23482,7 +23431,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
23482
23431
  const GRID_CELL_REFERENCE_TOP_OFFSET = 28;
23483
23432
  css`
23484
23433
  div.o-grid-composer {
23485
- z-index: ${ComponentsImportance.GridComposer};
23434
+ z-index: ${20};
23486
23435
  box-sizing: border-box;
23487
23436
  position: absolute;
23488
23437
  border: ${COMPOSER_BORDER_WIDTH}px solid ${SELECTION_BORDER_COLOR};
@@ -23493,7 +23442,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
23493
23442
 
23494
23443
  div.o-cell-reference {
23495
23444
  position: absolute;
23496
- z-index: ${ComponentsImportance.GridComposer};
23445
+ z-index: ${20};
23497
23446
  background: ${SELECTION_BORDER_COLOR};
23498
23447
  color: white;
23499
23448
  font-size: 12px;
@@ -24149,7 +24098,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
24149
24098
  css`
24150
24099
  .o-figure-snap-line {
24151
24100
  position: relative;
24152
- z-index: ${ComponentsImportance.FigureSnapLine};
24101
+ z-index: ${1001};
24153
24102
  &.vertical {
24154
24103
  width: 0px;
24155
24104
  border-left: 1px dashed black;
@@ -24812,7 +24761,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
24812
24761
  var GridPopover = class extends _odoo_owl.Component {
24813
24762
  static template = "o-spreadsheet-GridPopover";
24814
24763
  static components = { Popover };
24815
- zIndex = ComponentsImportance.GridPopover;
24764
+ zIndex = 19;
24816
24765
  get cellPopover() {
24817
24766
  const popover = this.env.model.getters.getCellPopover(this.props.hoveredCell);
24818
24767
  if (!popover.isOpen) return { isOpen: false };
@@ -25060,7 +25009,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
25060
25009
  top: calc(${26}px / 2 - ${14}px / 2);
25061
25010
  }
25062
25011
  .o-unhide:hover {
25063
- z-index: ${ComponentsImportance.Grid + 1};
25012
+ z-index: ${0 + 1};
25064
25013
  background-color: lightgrey;
25065
25014
  }
25066
25015
  .o-unhide > svg {
@@ -25136,7 +25085,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
25136
25085
  elements,
25137
25086
  position: this.state.position
25138
25087
  });
25139
- if (!result.isSuccessful && result.reasons.includes(CommandResult.WillRemoveExistingMerge)) this.env.raiseError(MergeErrorMessage);
25088
+ if (!result.isSuccessful && result.reasons.includes("WillRemoveExistingMerge")) this.env.raiseError(MergeErrorMessage);
25140
25089
  }
25141
25090
  _selectElement(index, addDistinctHeader) {
25142
25091
  this.env.model.selection.selectColumn(index, addDistinctHeader ? "newAnchor" : "overrideSelection");
@@ -25230,7 +25179,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
25230
25179
  top: calc(${14}px / 2 - ${18}px / 2);
25231
25180
  }
25232
25181
  .o-unhide:hover {
25233
- z-index: ${ComponentsImportance.Grid + 1};
25182
+ z-index: ${0 + 1};
25234
25183
  background-color: lightgrey;
25235
25184
  }
25236
25185
  }
@@ -25302,7 +25251,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
25302
25251
  elements,
25303
25252
  position: this.state.position
25304
25253
  });
25305
- if (!result.isSuccessful && result.reasons.includes(CommandResult.WillRemoveExistingMerge)) this.env.raiseError(MergeErrorMessage);
25254
+ if (!result.isSuccessful && result.reasons.includes("WillRemoveExistingMerge")) this.env.raiseError(MergeErrorMessage);
25306
25255
  }
25307
25256
  _selectElement(index, addDistinctHeader) {
25308
25257
  this.env.model.selection.selectRow(index, addDistinctHeader ? "newAnchor" : "overrideSelection");
@@ -25526,7 +25475,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
25526
25475
  //#region src/components/highlight/highlight/highlight.ts
25527
25476
  css`
25528
25477
  .o-highlight {
25529
- z-index: ${ComponentsImportance.Highlight};
25478
+ z-index: ${5};
25530
25479
  }
25531
25480
  `;
25532
25481
  var Highlight = class extends _odoo_owl.Component {
@@ -25647,7 +25596,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
25647
25596
  .o-scrollbar {
25648
25597
  position: absolute;
25649
25598
  overflow: auto;
25650
- z-index: ${ComponentsImportance.ScrollBar};
25599
+ z-index: ${15};
25651
25600
  background-color: ${BACKGROUND_GRAY_COLOR};
25652
25601
 
25653
25602
  &.corner {
@@ -25888,12 +25837,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
25888
25837
  }
25889
25838
  keyDownMapping = {
25890
25839
  ENTER: () => {
25891
- this.env.model.getters.getActiveCell().type === CellValueType.empty ? this.props.onGridComposerCellFocused() : this.props.onComposerContentFocused();
25840
+ this.env.model.getters.getActiveCell().type === "empty" ? this.props.onGridComposerCellFocused() : this.props.onComposerContentFocused();
25892
25841
  },
25893
25842
  TAB: () => this.env.model.selection.moveAnchorCell("right", 1),
25894
25843
  "SHIFT+TAB": () => this.env.model.selection.moveAnchorCell("left", 1),
25895
25844
  F2: () => {
25896
- this.env.model.getters.getActiveCell().type === CellValueType.empty ? this.props.onGridComposerCellFocused() : this.props.onComposerContentFocused();
25845
+ this.env.model.getters.getActiveCell().type === "empty" ? this.props.onGridComposerCellFocused() : this.props.onComposerContentFocused();
25897
25846
  },
25898
25847
  DELETE: () => {
25899
25848
  this.env.model.dispatch("DELETE_CONTENT", {
@@ -26125,7 +26074,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
26125
26074
  sheetId,
26126
26075
  col,
26127
26076
  row
26128
- }).type === CellValueType.empty) this.props.onGridComposerCellFocused();
26077
+ }).type === "empty") this.props.onGridComposerCellFocused();
26129
26078
  else this.props.onComposerContentFocused();
26130
26079
  }
26131
26080
  closeOpenedPopover() {
@@ -26211,15 +26160,15 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
26211
26160
  this.displayWarningCopyPasteNotSupported();
26212
26161
  return;
26213
26162
  }
26214
- if (clipboardData.types.indexOf(ClipboardMIMEType.PlainText) > -1) {
26163
+ if (clipboardData.types.indexOf("text/plain") > -1) {
26215
26164
  ev.preventDefault();
26216
- const content = clipboardData.getData(ClipboardMIMEType.PlainText);
26165
+ const content = clipboardData.getData("text/plain");
26217
26166
  const target = this.env.model.getters.getSelectedZones();
26218
26167
  const clipboardString = this.env.model.getters.getClipboardTextContent();
26219
26168
  const isCutOperation = this.env.model.getters.isCutOperation();
26220
26169
  if (clipboardString === content) interactivePaste(this.env, target);
26221
26170
  else interactivePasteFromOS(this.env, target, content);
26222
- if (isCutOperation) await this.env.clipboard.write({ [ClipboardMIMEType.PlainText]: "" });
26171
+ if (isCutOperation) await this.env.clipboard.write({ ["text/plain"]: "" });
26223
26172
  }
26224
26173
  }
26225
26174
  displayWarningCopyPasteNotSupported() {
@@ -26369,6 +26318,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
26369
26318
  * Represent a raw XML string
26370
26319
  */
26371
26320
  var XMLString = class {
26321
+ xmlString;
26372
26322
  /**
26373
26323
  * @param xmlString should be a well formed, properly escaped XML string
26374
26324
  */
@@ -26481,6 +26431,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
26481
26431
  ROUNDDOWN: [{
26482
26432
  type: "NUMBER",
26483
26433
  value: 0
26434
+ }],
26435
+ IFERROR: [{
26436
+ type: "NUMBER",
26437
+ value: 0
26484
26438
  }]
26485
26439
  };
26486
26440
  /**
@@ -26646,6 +26600,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
26646
26600
  //#endregion
26647
26601
  //#region src/formulas/code_builder.ts
26648
26602
  var FunctionCodeBuilder = class {
26603
+ scope;
26649
26604
  code = "";
26650
26605
  constructor(scope = new Scope()) {
26651
26606
  this.scope = scope;
@@ -26661,6 +26616,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
26661
26616
  }
26662
26617
  };
26663
26618
  var FunctionCodeImpl = class {
26619
+ scope;
26620
+ returnExpression;
26664
26621
  code;
26665
26622
  constructor(scope, code, returnExpression) {
26666
26623
  this.scope = scope;
@@ -26721,46 +26678,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
26721
26678
 
26722
26679
  //#endregion
26723
26680
  //#region src/formulas/range_tokenizer.ts
26724
- var State = /* @__PURE__ */ function(State) {
26725
- /**
26726
- * Initial state.
26727
- * Expecting any reference for the left part of a range
26728
- * e.g. "A1", "1", "A", "Sheet1!A1", "Sheet1!A"
26729
- */
26730
- State[State["LeftRef"] = 0] = "LeftRef";
26731
- /**
26732
- * Expecting any reference for the right part of a range
26733
- * e.g. "A1", "1", "A", "Sheet1!A1", "Sheet1!A"
26734
- */
26735
- State[State["RightRef"] = 1] = "RightRef";
26736
- /**
26737
- * Expecting the separator without any constraint on the right part
26738
- */
26739
- State[State["Separator"] = 2] = "Separator";
26740
- /**
26741
- * Expecting the separator for a full column range
26742
- */
26743
- State[State["FullColumnSeparator"] = 3] = "FullColumnSeparator";
26744
- /**
26745
- * Expecting the separator for a full row range
26746
- */
26747
- State[State["FullRowSeparator"] = 4] = "FullRowSeparator";
26748
- /**
26749
- * Expecting the right part of a full column range
26750
- * e.g. "1", "A1"
26751
- */
26752
- State[State["RightColumnRef"] = 5] = "RightColumnRef";
26753
- /**
26754
- * Expecting the right part of a full row range
26755
- * e.g. "A", "A1"
26756
- */
26757
- State[State["RightRowRef"] = 6] = "RightRowRef";
26758
- /**
26759
- * Final state. A range has been matched
26760
- */
26761
- State[State["Found"] = 7] = "Found";
26762
- return State;
26763
- }(State || {});
26764
26681
  const goTo = (state, guard = () => true) => [{
26765
26682
  goTo: state,
26766
26683
  guard
@@ -26770,41 +26687,41 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
26770
26687
  guard
26771
26688
  });
26772
26689
  const machine = {
26773
- [State.LeftRef]: {
26774
- REFERENCE: goTo(State.Separator),
26775
- NUMBER: goTo(State.FullRowSeparator),
26776
- SYMBOL: [goToMulti(State.FullColumnSeparator, (token) => isColReference(token.value)), goToMulti(State.FullRowSeparator, (token) => isRowReference(token.value))]
26690
+ [0]: {
26691
+ REFERENCE: goTo(2),
26692
+ NUMBER: goTo(4),
26693
+ SYMBOL: [goToMulti(3, (token) => isColReference(token.value)), goToMulti(4, (token) => isRowReference(token.value))]
26777
26694
  },
26778
- [State.FullColumnSeparator]: {
26779
- SPACE: goTo(State.FullColumnSeparator),
26780
- OPERATOR: goTo(State.RightColumnRef, (token) => token.value === ":")
26695
+ [3]: {
26696
+ SPACE: goTo(3),
26697
+ OPERATOR: goTo(5, (token) => token.value === ":")
26781
26698
  },
26782
- [State.FullRowSeparator]: {
26783
- SPACE: goTo(State.FullRowSeparator),
26784
- OPERATOR: goTo(State.RightRowRef, (token) => token.value === ":")
26699
+ [4]: {
26700
+ SPACE: goTo(4),
26701
+ OPERATOR: goTo(6, (token) => token.value === ":")
26785
26702
  },
26786
- [State.Separator]: {
26787
- SPACE: goTo(State.Separator),
26788
- OPERATOR: goTo(State.RightRef, (token) => token.value === ":")
26703
+ [2]: {
26704
+ SPACE: goTo(2),
26705
+ OPERATOR: goTo(1, (token) => token.value === ":")
26789
26706
  },
26790
- [State.RightRef]: {
26791
- SPACE: goTo(State.RightRef),
26792
- NUMBER: goTo(State.Found),
26793
- REFERENCE: goTo(State.Found, (token) => isSingleCellReference(token.value)),
26794
- SYMBOL: goTo(State.Found, (token) => isColHeader(token.value) || isRowHeader(token.value))
26707
+ [1]: {
26708
+ SPACE: goTo(1),
26709
+ NUMBER: goTo(7),
26710
+ REFERENCE: goTo(7, (token) => isSingleCellReference(token.value)),
26711
+ SYMBOL: goTo(7, (token) => isColHeader(token.value) || isRowHeader(token.value))
26795
26712
  },
26796
- [State.RightColumnRef]: {
26797
- SPACE: goTo(State.RightColumnRef),
26798
- SYMBOL: goTo(State.Found, (token) => isColHeader(token.value)),
26799
- REFERENCE: goTo(State.Found, (token) => isSingleCellReference(token.value))
26713
+ [5]: {
26714
+ SPACE: goTo(5),
26715
+ SYMBOL: goTo(7, (token) => isColHeader(token.value)),
26716
+ REFERENCE: goTo(7, (token) => isSingleCellReference(token.value))
26800
26717
  },
26801
- [State.RightRowRef]: {
26802
- SPACE: goTo(State.RightRowRef),
26803
- NUMBER: goTo(State.Found),
26804
- REFERENCE: goTo(State.Found, (token) => isSingleCellReference(token.value)),
26805
- SYMBOL: goTo(State.Found, (token) => isRowHeader(token.value))
26718
+ [6]: {
26719
+ SPACE: goTo(6),
26720
+ NUMBER: goTo(7),
26721
+ REFERENCE: goTo(7, (token) => isSingleCellReference(token.value)),
26722
+ SYMBOL: goTo(7, (token) => isRowHeader(token.value))
26806
26723
  },
26807
- [State.Found]: {}
26724
+ [7]: {}
26808
26725
  };
26809
26726
  /**
26810
26727
  * Check if the list of tokens starts with a sequence of tokens representing
@@ -26814,7 +26731,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
26814
26731
  */
26815
26732
  function matchReference(tokens) {
26816
26733
  let head = 0;
26817
- let transitions = machine[State.LeftRef];
26734
+ let transitions = machine[0];
26818
26735
  let matchedTokens = "";
26819
26736
  while (transitions !== void 0) {
26820
26737
  const token = tokens[head++];
@@ -26823,7 +26740,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
26823
26740
  const nextState = transition ? transition.goTo : void 0;
26824
26741
  switch (nextState) {
26825
26742
  case void 0: return null;
26826
- case State.Found:
26743
+ case 7:
26827
26744
  matchedTokens += token.value;
26828
26745
  tokens.splice(0, head);
26829
26746
  return {
@@ -26901,7 +26818,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
26901
26818
  };
26902
26819
  case "INVALID_REFERENCE": return {
26903
26820
  type: "REFERENCE",
26904
- value: CellErrorType.InvalidReference
26821
+ value: "#REF"
26905
26822
  };
26906
26823
  case "REFERENCE":
26907
26824
  if (tokens[0]?.value === ":" && tokens[1]?.type === "REFERENCE") {
@@ -27416,26 +27333,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
27416
27333
 
27417
27334
  //#endregion
27418
27335
  //#region src/xlsx/helpers/xlsx_parser_error_manager.ts
27419
- /**
27420
- * Map of the different types of conversions warnings and their name in error messages
27421
- */
27422
- let WarningTypes = /* @__PURE__ */ function(WarningTypes) {
27423
- WarningTypes["DiagonalBorderNotSupported"] = "Diagonal Borders";
27424
- WarningTypes["BorderStyleNotSupported"] = "Border style";
27425
- WarningTypes["FillStyleNotSupported"] = "Fill Style";
27426
- WarningTypes["FontNotSupported"] = "Font";
27427
- WarningTypes["HorizontalAlignmentNotSupported"] = "Horizontal Alignment";
27428
- WarningTypes["VerticalAlignmentNotSupported"] = "Vertical Alignments";
27429
- WarningTypes["MultipleRulesCfNotSupported"] = "Multiple rules conditional formats";
27430
- WarningTypes["CfTypeNotSupported"] = "Conditional format type";
27431
- WarningTypes["CfFormatBorderNotSupported"] = "Borders in conditional formats";
27432
- WarningTypes["CfFormatAlignmentNotSupported"] = "Alignment in conditional formats";
27433
- WarningTypes["CfFormatNumFmtNotSupported"] = "Num formats in conditional formats";
27434
- WarningTypes["CfIconSetEmptyIconNotSupported"] = "IconSets with empty icons";
27435
- WarningTypes["BadlyFormattedHyperlink"] = "Badly formatted hyperlink";
27436
- WarningTypes["NumFmtIdNotSupported"] = "Number format";
27437
- return WarningTypes;
27438
- }({});
27439
27336
  var XLSXImportWarningManager = class {
27440
27337
  _parsingWarnings = /* @__PURE__ */ new Set();
27441
27338
  _conversionWarnings = /* @__PURE__ */ new Set();
@@ -27947,7 +27844,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
27947
27844
  if (isXlsxDateFormat(convertedFormat)) convertedFormat = convertDateFormat$1(convertedFormat);
27948
27845
  if (isFormatSupported(convertedFormat)) return convertedFormat;
27949
27846
  } catch (e) {}
27950
- warningManager.generateNotSupportedWarning(WarningTypes.NumFmtIdNotSupported, format || `nmFmtId ${numFmtId}`);
27847
+ warningManager.generateNotSupportedWarning("Number format", format || `nmFmtId ${numFmtId}`);
27951
27848
  }
27952
27849
  function isFormatSupported(format) {
27953
27850
  try {
@@ -28031,20 +27928,20 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
28031
27928
  return arrayToObject(formats, 1);
28032
27929
  }
28033
27930
  function addStyleWarnings(font, fill, warningManager) {
28034
- if (font && font.name && !SUPPORTED_FONTS.includes(font.name)) warningManager.generateNotSupportedWarning(WarningTypes.FontNotSupported, font.name, SUPPORTED_FONTS);
28035
- if (fill && fill.patternType && !SUPPORTED_FILL_PATTERNS.includes(fill.patternType)) warningManager.generateNotSupportedWarning(WarningTypes.FillStyleNotSupported, fill.patternType, SUPPORTED_FILL_PATTERNS);
27931
+ if (font && font.name && !SUPPORTED_FONTS.includes(font.name)) warningManager.generateNotSupportedWarning("Font", font.name, SUPPORTED_FONTS);
27932
+ if (fill && fill.patternType && !SUPPORTED_FILL_PATTERNS.includes(fill.patternType)) warningManager.generateNotSupportedWarning("Fill Style", fill.patternType, SUPPORTED_FILL_PATTERNS);
28036
27933
  }
28037
27934
  function addBorderDescrWarnings(borderDescr, warningManager) {
28038
- if (!SUPPORTED_BORDER_STYLES.includes(borderDescr.style)) warningManager.generateNotSupportedWarning(WarningTypes.BorderStyleNotSupported, borderDescr.style, SUPPORTED_BORDER_STYLES);
27935
+ if (!SUPPORTED_BORDER_STYLES.includes(borderDescr.style)) warningManager.generateNotSupportedWarning("Border style", borderDescr.style, SUPPORTED_BORDER_STYLES);
28039
27936
  }
28040
27937
  function addBorderWarnings(border, warningManager) {
28041
- if (border.diagonal) warningManager.generateNotSupportedWarning(WarningTypes.DiagonalBorderNotSupported);
27938
+ if (border.diagonal) warningManager.generateNotSupportedWarning("Diagonal Borders");
28042
27939
  }
28043
27940
  function addHorizontalAlignmentWarnings(alignment, warningManager) {
28044
- if (alignment && !SUPPORTED_HORIZONTAL_ALIGNMENTS.includes(alignment)) warningManager.generateNotSupportedWarning(WarningTypes.HorizontalAlignmentNotSupported, alignment, SUPPORTED_HORIZONTAL_ALIGNMENTS);
27941
+ if (alignment && !SUPPORTED_HORIZONTAL_ALIGNMENTS.includes(alignment)) warningManager.generateNotSupportedWarning("Horizontal Alignment", alignment, SUPPORTED_HORIZONTAL_ALIGNMENTS);
28045
27942
  }
28046
27943
  function addVerticalAlignmentWarnings(alignment, warningManager) {
28047
- if (alignment && !SUPPORTED_VERTICAL_ALIGNMENTS.includes(alignment)) warningManager.generateNotSupportedWarning(WarningTypes.VerticalAlignmentNotSupported, alignment, SUPPORTED_VERTICAL_ALIGNMENTS);
27944
+ if (alignment && !SUPPORTED_VERTICAL_ALIGNMENTS.includes(alignment)) warningManager.generateNotSupportedWarning("Vertical Alignments", alignment, SUPPORTED_VERTICAL_ALIGNMENTS);
28048
27945
  }
28049
27946
 
28050
27947
  //#endregion
@@ -28184,7 +28081,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
28184
28081
  lower: icons.upper
28185
28082
  };
28186
28083
  for (const key of Object.keys(icons)) if (!icons[key]) {
28187
- warningManager.generateNotSupportedWarning(WarningTypes.CfIconSetEmptyIconNotSupported);
28084
+ warningManager.generateNotSupportedWarning("IconSets with empty icons");
28188
28085
  switch (key) {
28189
28086
  case "upper":
28190
28087
  icons[key] = ICON_SETS.dots.good;
@@ -28225,13 +28122,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
28225
28122
  return tokens.length === 1 && tokens[0].type !== "REFERENCE" ? formula : "=" + formula;
28226
28123
  }
28227
28124
  function addCfConversionWarnings(cf, dxfs, warningManager) {
28228
- if (cf.cfRules.length > 1) warningManager.generateNotSupportedWarning(WarningTypes.MultipleRulesCfNotSupported);
28229
- if (!SUPPORTED_CF_TYPES.includes(cf.cfRules[0].type)) warningManager.generateNotSupportedWarning(WarningTypes.CfTypeNotSupported, cf.cfRules[0].type);
28125
+ if (cf.cfRules.length > 1) warningManager.generateNotSupportedWarning("Multiple rules conditional formats");
28126
+ if (!SUPPORTED_CF_TYPES.includes(cf.cfRules[0].type)) warningManager.generateNotSupportedWarning("Conditional format type", cf.cfRules[0].type);
28230
28127
  if (cf.cfRules[0].dxfId) {
28231
28128
  const dxf = dxfs[cf.cfRules[0].dxfId];
28232
- if (dxf.border) warningManager.generateNotSupportedWarning(WarningTypes.CfFormatBorderNotSupported);
28233
- if (dxf.alignment) warningManager.generateNotSupportedWarning(WarningTypes.CfFormatAlignmentNotSupported);
28234
- if (dxf.numFmt) warningManager.generateNotSupportedWarning(WarningTypes.CfFormatNumFmtNotSupported);
28129
+ if (dxf.border) warningManager.generateNotSupportedWarning("Borders in conditional formats");
28130
+ if (dxf.alignment) warningManager.generateNotSupportedWarning("Alignment in conditional formats");
28131
+ if (dxf.numFmt) warningManager.generateNotSupportedWarning("Num formats in conditional formats");
28235
28132
  }
28236
28133
  }
28237
28134
 
@@ -28729,7 +28626,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
28729
28626
  }
28730
28627
  function convertHyperlink(link, cellValue, warningManager) {
28731
28628
  const label = link.display || cellValue;
28732
- if (!link.relTarget && !link.location) warningManager.generateNotSupportedWarning(WarningTypes.BadlyFormattedHyperlink);
28629
+ if (!link.relTarget && !link.location) warningManager.generateNotSupportedWarning("Badly formatted hyperlink");
28733
28630
  return markdownLink(label, link.relTarget ? link.relTarget : buildSheetLink(splitReference(link.location).sheetName));
28734
28631
  }
28735
28632
  function getSheetDims(sheet) {
@@ -30852,7 +30749,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
30852
30749
  * There should not be any side effects in this method.
30853
30750
  */
30854
30751
  allowDispatch(command) {
30855
- return CommandResult.Success;
30752
+ return "Success";
30856
30753
  }
30857
30754
  /**
30858
30755
  * This method is useful when a plugin need to perform some action before a
@@ -30888,10 +30785,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
30888
30785
  for (const validation of validations) {
30889
30786
  let results = validation.call(this, toValidate);
30890
30787
  if (!Array.isArray(results)) results = [results];
30891
- const cancelledReasons = results.filter((result) => result !== CommandResult.Success);
30788
+ const cancelledReasons = results.filter((result) => result !== "Success");
30892
30789
  if (cancelledReasons.length) return cancelledReasons;
30893
30790
  }
30894
- return CommandResult.Success;
30791
+ return "Success";
30895
30792
  };
30896
30793
  }
30897
30794
  checkValidations(command, ...validations) {
@@ -30950,7 +30847,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
30950
30847
  allowDispatch(cmd) {
30951
30848
  switch (cmd.type) {
30952
30849
  case "SET_BORDER": return this.checkBordersUnchanged(cmd);
30953
- default: return CommandResult.Success;
30850
+ default: return "Success";
30954
30851
  }
30955
30852
  }
30956
30853
  handle(cmd) {
@@ -31322,8 +31219,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
31322
31219
  checkBordersUnchanged(cmd) {
31323
31220
  const currentBorder = this.getCellBorder(cmd);
31324
31221
  const areAllNewBordersUndefined = !cmd.border?.bottom && !cmd.border?.left && !cmd.border?.right && !cmd.border?.top;
31325
- if (!currentBorder && areAllNewBordersUndefined || deepEquals(currentBorder, cmd.border)) return CommandResult.NoChanges;
31326
- return CommandResult.Success;
31222
+ if (!currentBorder && areAllNewBordersUndefined || deepEquals(currentBorder, cmd.border)) return "NoChanges";
31223
+ return "Success";
31327
31224
  }
31328
31225
  import(data) {
31329
31226
  if (Object.keys(data.borders || {}).length) for (const sheet of data.sheets) for (const xc in sheet.cells) {
@@ -31390,8 +31287,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
31390
31287
  switch (cmd.type) {
31391
31288
  case "UPDATE_CELL": return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessUpdateCell);
31392
31289
  case "CLEAR_CELL": return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessClearCell);
31393
- case "UPDATE_CELL_POSITION": return !cmd.cellId || this.cells[cmd.sheetId]?.[cmd.cellId] ? CommandResult.Success : CommandResult.InvalidCellId;
31394
- default: return CommandResult.Success;
31290
+ case "UPDATE_CELL_POSITION": return !cmd.cellId || this.cells[cmd.sheetId]?.[cmd.cellId] ? "Success" : "InvalidCellId";
31291
+ default: return "Success";
31395
31292
  }
31396
31293
  }
31397
31294
  handle(cmd) {
@@ -31757,25 +31654,30 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
31757
31654
  }
31758
31655
  checkCellOutOfSheet(cmd) {
31759
31656
  const { sheetId, col, row } = cmd;
31760
- if (!this.getters.tryGetSheet(sheetId)) return CommandResult.InvalidSheetId;
31761
- return isInside(col, row, this.getters.getSheetZone(sheetId)) ? CommandResult.Success : CommandResult.TargetOutOfSheet;
31657
+ if (!this.getters.tryGetSheet(sheetId)) return "InvalidSheetId";
31658
+ return isInside(col, row, this.getters.getSheetZone(sheetId)) ? "Success" : "TargetOutOfSheet";
31762
31659
  }
31763
31660
  checkUselessClearCell(cmd) {
31764
31661
  const cell = this.getters.getCell(cmd);
31765
- if (!cell) return CommandResult.NoChanges;
31766
- if (!cell.content && !cell.style && !cell.format) return CommandResult.NoChanges;
31767
- return CommandResult.Success;
31662
+ if (!cell) return "NoChanges";
31663
+ if (!cell.content && !cell.style && !cell.format) return "NoChanges";
31664
+ return "Success";
31768
31665
  }
31769
31666
  checkUselessUpdateCell(cmd) {
31770
31667
  const cell = this.getters.getCell(cmd);
31771
31668
  const hasContent = "content" in cmd || "formula" in cmd;
31772
31669
  const hasStyle = "style" in cmd;
31773
31670
  const hasFormat = "format" in cmd;
31774
- if ((!hasContent || cell?.content === cmd.content) && (!hasStyle || deepEquals(cell?.style, cmd.style)) && (!hasFormat || cell?.format === cmd.format)) return CommandResult.NoChanges;
31775
- return CommandResult.Success;
31671
+ if ((!hasContent || cell?.content === cmd.content) && (!hasStyle || deepEquals(cell?.style, cmd.style)) && (!hasFormat || cell?.format === cmd.format)) return "NoChanges";
31672
+ return "Success";
31776
31673
  }
31777
31674
  };
31778
31675
  var FormulaCellWithDependencies = class {
31676
+ id;
31677
+ format;
31678
+ style;
31679
+ sheetId;
31680
+ getRangeString;
31779
31681
  isFormula = true;
31780
31682
  compiledFormula;
31781
31683
  constructor(id, compiledFormula, format, style, dependencies, sheetId, getRangeString) {
@@ -31810,6 +31712,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
31810
31712
  }
31811
31713
  };
31812
31714
  var RangeReferenceToken = class {
31715
+ ranges;
31716
+ rangeIndex;
31717
+ sheetId;
31718
+ getRangeString;
31813
31719
  type = "REFERENCE";
31814
31720
  constructor(ranges, rangeIndex, sheetId, getRangeString) {
31815
31721
  this.ranges = ranges;
@@ -31844,7 +31750,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
31844
31750
  switch (cmd.type) {
31845
31751
  case "CREATE_CHART": return this.checkValidations(cmd, this.chainValidations(this.validateChartDefinition, this.checkChartDuplicate));
31846
31752
  case "UPDATE_CHART": return this.checkValidations(cmd, this.chainValidations(this.validateChartDefinition, this.checkChartExists));
31847
- default: return CommandResult.Success;
31753
+ default: return "Success";
31848
31754
  }
31849
31755
  }
31850
31756
  handle(cmd) {
@@ -31963,10 +31869,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
31963
31869
  if (sheetId) this.history.update("charts", id, this.createChart(id, definition, sheetId));
31964
31870
  }
31965
31871
  checkChartDuplicate(cmd) {
31966
- return this.getters.getFigureSheetId(cmd.id) ? CommandResult.DuplicatedChartId : CommandResult.Success;
31872
+ return this.getters.getFigureSheetId(cmd.id) ? "DuplicatedChartId" : "Success";
31967
31873
  }
31968
31874
  checkChartExists(cmd) {
31969
- return this.isChartDefined(cmd.id) ? CommandResult.Success : CommandResult.ChartDoesNotExist;
31875
+ return this.isChartDefined(cmd.id) ? "Success" : "ChartDoesNotExist";
31970
31876
  }
31971
31877
  };
31972
31878
 
@@ -32293,7 +32199,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
32293
32199
  case "ADD_CONDITIONAL_FORMAT": return this.checkValidations(cmd, this.checkCFRule, this.checkEmptyRange);
32294
32200
  case "CHANGE_CONDITIONAL_FORMAT_PRIORITY": return this.checkValidPriorityChange(cmd.cfId, cmd.delta, cmd.sheetId);
32295
32201
  }
32296
- return CommandResult.Success;
32202
+ return "Success";
32297
32203
  }
32298
32204
  handle(cmd) {
32299
32205
  switch (cmd.type) {
@@ -32407,21 +32313,21 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
32407
32313
  this.history.update("cfRules", sheet, currentCF);
32408
32314
  }
32409
32315
  checkValidPriorityChange(cfId, delta, sheetId) {
32410
- if (!this.cfRules[sheetId]) return CommandResult.InvalidSheetId;
32316
+ if (!this.cfRules[sheetId]) return "InvalidSheetId";
32411
32317
  const ruleIndex = this.cfRules[sheetId].findIndex((cf) => cf.id === cfId);
32412
- if (ruleIndex === -1) return CommandResult.InvalidConditionalFormatId;
32318
+ if (ruleIndex === -1) return "InvalidConditionalFormatId";
32413
32319
  const cfIndex2 = ruleIndex - delta;
32414
- if (cfIndex2 < 0 || cfIndex2 >= this.cfRules[sheetId].length) return CommandResult.InvalidConditionalFormatId;
32415
- return CommandResult.Success;
32320
+ if (cfIndex2 < 0 || cfIndex2 >= this.cfRules[sheetId].length) return "InvalidConditionalFormatId";
32321
+ return "Success";
32416
32322
  }
32417
32323
  checkEmptyRange(cmd) {
32418
- return cmd.ranges.length ? CommandResult.Success : CommandResult.EmptyRange;
32324
+ return cmd.ranges.length ? "Success" : "EmptyRange";
32419
32325
  }
32420
32326
  checkCFRule(cmd) {
32421
32327
  const rule = cmd.cf.rule;
32422
32328
  switch (rule.type) {
32423
32329
  case "CellIsRule":
32424
- if (!CellIsOperators[rule.operator]) return CommandResult.InvalidConditionalFormatType;
32330
+ if (!CellIsOperators[rule.operator]) return "InvalidConditionalFormatType";
32425
32331
  return this.checkValidations(rule, this.checkOperatorArgsNumber(2, ["Between", "NotBetween"]), this.checkOperatorArgsNumber(1, [
32426
32332
  "BeginsWith",
32427
32333
  "ContainsText",
@@ -32435,7 +32341,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
32435
32341
  case "ColorScaleRule": return this.checkValidations(rule, this.chainValidations(this.checkThresholds(this.checkFormulaCompilation)), this.chainValidations(this.checkThresholds(this.checkNaN), this.batchValidations(this.checkMinBiggerThanMax, this.checkMinBiggerThanMid, this.checkMidBiggerThanMax)));
32436
32342
  case "IconSetRule": return this.checkValidations(rule, this.chainValidations(this.checkInflectionPoints(this.checkNaN), this.checkLowerBiggerThanUpper), this.chainValidations(this.checkInflectionPoints(this.checkFormulaCompilation)));
32437
32343
  }
32438
- return CommandResult.InvalidConditionalFormatType;
32344
+ return "InvalidConditionalFormatType";
32439
32345
  }
32440
32346
  checkOperatorArgsNumber(expectedNumber, operators) {
32441
32347
  if (expectedNumber > 2) throw new Error("Checking more than 2 arguments is currently not supported. Add the appropriate CommandResult if you want to.");
@@ -32443,11 +32349,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
32443
32349
  if (operators.includes(rule.operator)) {
32444
32350
  const errors = [];
32445
32351
  const isEmpty = (value) => value === void 0 || value === "";
32446
- if (expectedNumber >= 1 && isEmpty(rule.values[0])) errors.push(CommandResult.FirstArgMissing);
32447
- if (expectedNumber >= 2 && isEmpty(rule.values[1])) errors.push(CommandResult.SecondArgMissing);
32448
- return errors.length ? errors : CommandResult.Success;
32352
+ if (expectedNumber >= 1 && isEmpty(rule.values[0])) errors.push("FirstArgMissing");
32353
+ if (expectedNumber >= 2 && isEmpty(rule.values[1])) errors.push("SecondArgMissing");
32354
+ return errors.length ? errors : "Success";
32449
32355
  }
32450
- return CommandResult.Success;
32356
+ return "Success";
32451
32357
  };
32452
32358
  }
32453
32359
  checkNaN(threshold, thresholdName) {
@@ -32456,31 +32362,31 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
32456
32362
  "percentage",
32457
32363
  "percentile"
32458
32364
  ].includes(threshold.type) && (threshold.value === "" || isNaN(threshold.value))) switch (thresholdName) {
32459
- case "min": return CommandResult.MinNaN;
32460
- case "max": return CommandResult.MaxNaN;
32461
- case "mid": return CommandResult.MidNaN;
32462
- case "upperInflectionPoint": return CommandResult.ValueUpperInflectionNaN;
32463
- case "lowerInflectionPoint": return CommandResult.ValueLowerInflectionNaN;
32365
+ case "min": return "MinNaN";
32366
+ case "max": return "MaxNaN";
32367
+ case "mid": return "MidNaN";
32368
+ case "upperInflectionPoint": return "ValueUpperInflectionNaN";
32369
+ case "lowerInflectionPoint": return "ValueLowerInflectionNaN";
32464
32370
  }
32465
- return CommandResult.Success;
32371
+ return "Success";
32466
32372
  }
32467
32373
  checkFormulaCompilation(threshold, thresholdName) {
32468
- if (threshold.type !== "formula") return CommandResult.Success;
32374
+ if (threshold.type !== "formula") return "Success";
32469
32375
  try {
32470
32376
  compile(threshold.value || "");
32471
32377
  } catch (error) {
32472
32378
  switch (thresholdName) {
32473
- case "min": return CommandResult.MinInvalidFormula;
32474
- case "max": return CommandResult.MaxInvalidFormula;
32475
- case "mid": return CommandResult.MidInvalidFormula;
32476
- case "upperInflectionPoint": return CommandResult.ValueUpperInvalidFormula;
32477
- case "lowerInflectionPoint": return CommandResult.ValueLowerInvalidFormula;
32379
+ case "min": return "MinInvalidFormula";
32380
+ case "max": return "MaxInvalidFormula";
32381
+ case "mid": return "MidInvalidFormula";
32382
+ case "upperInflectionPoint": return "ValueUpperInvalidFormula";
32383
+ case "lowerInflectionPoint": return "ValueLowerInvalidFormula";
32478
32384
  }
32479
32385
  }
32480
- return CommandResult.Success;
32386
+ return "Success";
32481
32387
  }
32482
32388
  checkThresholds(check) {
32483
- return this.batchValidations((rule) => check(rule.minimum, "min"), (rule) => check(rule.maximum, "max"), (rule) => rule.midpoint ? check(rule.midpoint, "mid") : CommandResult.Success);
32389
+ return this.batchValidations((rule) => check(rule.minimum, "min"), (rule) => check(rule.maximum, "max"), (rule) => rule.midpoint ? check(rule.midpoint, "mid") : "Success");
32484
32390
  }
32485
32391
  checkInflectionPoints(check) {
32486
32392
  return this.batchValidations((rule) => check(rule.lowerInflectionPoint, "lowerInflectionPoint"), (rule) => check(rule.upperInflectionPoint, "upperInflectionPoint"));
@@ -32492,8 +32398,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
32492
32398
  "number",
32493
32399
  "percentage",
32494
32400
  "percentile"
32495
- ].includes(rule.lowerInflectionPoint.type) && rule.lowerInflectionPoint.type === rule.upperInflectionPoint.type && Number(minValue) > Number(maxValue)) return CommandResult.LowerBiggerThanUpper;
32496
- return CommandResult.Success;
32401
+ ].includes(rule.lowerInflectionPoint.type) && rule.lowerInflectionPoint.type === rule.upperInflectionPoint.type && Number(minValue) > Number(maxValue)) return "LowerBiggerThanUpper";
32402
+ return "Success";
32497
32403
  }
32498
32404
  checkMinBiggerThanMax(rule) {
32499
32405
  const minValue = rule.minimum.value;
@@ -32502,8 +32408,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
32502
32408
  "number",
32503
32409
  "percentage",
32504
32410
  "percentile"
32505
- ].includes(rule.minimum.type) && rule.minimum.type === rule.maximum.type && stringToNumber(minValue) >= stringToNumber(maxValue)) return CommandResult.MinBiggerThanMax;
32506
- return CommandResult.Success;
32411
+ ].includes(rule.minimum.type) && rule.minimum.type === rule.maximum.type && stringToNumber(minValue) >= stringToNumber(maxValue)) return "MinBiggerThanMax";
32412
+ return "Success";
32507
32413
  }
32508
32414
  checkMidBiggerThanMax(rule) {
32509
32415
  const midValue = rule.midpoint?.value;
@@ -32512,8 +32418,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
32512
32418
  "number",
32513
32419
  "percentage",
32514
32420
  "percentile"
32515
- ].includes(rule.midpoint.type) && rule.midpoint.type === rule.maximum.type && stringToNumber(midValue) >= stringToNumber(maxValue)) return CommandResult.MidBiggerThanMax;
32516
- return CommandResult.Success;
32421
+ ].includes(rule.midpoint.type) && rule.midpoint.type === rule.maximum.type && stringToNumber(midValue) >= stringToNumber(maxValue)) return "MidBiggerThanMax";
32422
+ return "Success";
32517
32423
  }
32518
32424
  checkMinBiggerThanMid(rule) {
32519
32425
  const minValue = rule.minimum.value;
@@ -32522,8 +32428,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
32522
32428
  "number",
32523
32429
  "percentage",
32524
32430
  "percentile"
32525
- ].includes(rule.midpoint.type) && rule.minimum.type === rule.midpoint.type && stringToNumber(minValue) >= stringToNumber(midValue)) return CommandResult.MinBiggerThanMid;
32526
- return CommandResult.Success;
32431
+ ].includes(rule.midpoint.type) && rule.minimum.type === rule.midpoint.type && stringToNumber(minValue) >= stringToNumber(midValue)) return "MinBiggerThanMid";
32432
+ return "Success";
32527
32433
  }
32528
32434
  removeConditionalFormatting(id, sheet) {
32529
32435
  const cfIndex = this.cfRules[sheet].findIndex((s) => s.id === id);
@@ -32586,14 +32492,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
32586
32492
  allowDispatch(cmd) {
32587
32493
  switch (cmd.type) {
32588
32494
  case "ADD_DATA_VALIDATION_RULE":
32589
- if (!this.getters.tryGetSheet(cmd.sheetId)) return CommandResult.InvalidSheetId;
32495
+ if (!this.getters.tryGetSheet(cmd.sheetId)) return "InvalidSheetId";
32590
32496
  return this.checkValidations(cmd, this.chainValidations(this.checkCriterionTypeIsValid, this.checkCriterionHasValidNumberOfValues, this.checkCriterionValuesAreValid));
32591
32497
  case "REMOVE_DATA_VALIDATION_RULE":
32592
- if (!this.getters.tryGetSheet(cmd.sheetId)) return CommandResult.InvalidSheetId;
32593
- if (!this.rules[cmd.sheetId].find((rule) => rule.id === cmd.id)) return CommandResult.UnknownDataValidationRule;
32498
+ if (!this.getters.tryGetSheet(cmd.sheetId)) return "InvalidSheetId";
32499
+ if (!this.rules[cmd.sheetId].find((rule) => rule.id === cmd.id)) return "UnknownDataValidationRule";
32594
32500
  break;
32595
32501
  }
32596
- return CommandResult.Success;
32502
+ return "Success";
32597
32503
  }
32598
32504
  handle(cmd) {
32599
32505
  switch (cmd.type) {
@@ -32704,13 +32610,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
32704
32610
  }
32705
32611
  }
32706
32612
  checkCriterionTypeIsValid(cmd) {
32707
- return dataValidationEvaluatorRegistry.contains(cmd.rule.criterion.type) ? CommandResult.Success : CommandResult.UnknownDataValidationCriterionType;
32613
+ return dataValidationEvaluatorRegistry.contains(cmd.rule.criterion.type) ? "Success" : "UnknownDataValidationCriterionType";
32708
32614
  }
32709
32615
  checkCriterionHasValidNumberOfValues(cmd) {
32710
32616
  const criterion = cmd.rule.criterion;
32711
32617
  const expectedNumberOfValues = dataValidationEvaluatorRegistry.get(criterion.type).numberOfValues(criterion);
32712
- if (expectedNumberOfValues !== void 0 && criterion.values.length !== expectedNumberOfValues) return CommandResult.InvalidNumberOfCriterionValues;
32713
- return CommandResult.Success;
32618
+ if (expectedNumberOfValues !== void 0 && criterion.values.length !== expectedNumberOfValues) return "InvalidNumberOfCriterionValues";
32619
+ return "Success";
32714
32620
  }
32715
32621
  checkCriterionValuesAreValid(cmd) {
32716
32622
  const criterion = cmd.rule.criterion;
@@ -32719,8 +32625,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
32719
32625
  if (value.startsWith("=")) return evaluator.allowedValues === "onlyLiterals";
32720
32626
  else if (evaluator.allowedValues === "onlyFormulas") return true;
32721
32627
  else return !evaluator.isCriterionValueValid(value);
32722
- })) return CommandResult.InvalidDataValidationCriterionValue;
32723
- return CommandResult.Success;
32628
+ })) return "InvalidDataValidationCriterionValue";
32629
+ return "Success";
32724
32630
  }
32725
32631
  };
32726
32632
 
@@ -32739,7 +32645,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
32739
32645
  case "CREATE_FIGURE": return this.checkFigureDuplicate(cmd.figure.id);
32740
32646
  case "UPDATE_FIGURE":
32741
32647
  case "DELETE_FIGURE": return this.checkFigureExists(cmd.sheetId, cmd.id);
32742
- default: return CommandResult.Success;
32648
+ default: return "Success";
32743
32649
  }
32744
32650
  }
32745
32651
  beforeHandle(cmd) {
@@ -32833,12 +32739,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
32833
32739
  this.history.update("figures", sheetId, id, void 0);
32834
32740
  }
32835
32741
  checkFigureExists(sheetId, figureId) {
32836
- if (this.figures[sheetId]?.[figureId] === void 0) return CommandResult.FigureDoesNotExist;
32837
- return CommandResult.Success;
32742
+ if (this.figures[sheetId]?.[figureId] === void 0) return "FigureDoesNotExist";
32743
+ return "Success";
32838
32744
  }
32839
32745
  checkFigureDuplicate(figureId) {
32840
- if (Object.values(this.figures).find((sheet) => sheet?.[figureId])) return CommandResult.DuplicatedFigureId;
32841
- return CommandResult.Success;
32746
+ if (Object.values(this.figures).find((sheet) => sheet?.[figureId])) return "DuplicatedFigureId";
32747
+ return "Success";
32842
32748
  }
32843
32749
  getFigures(sheetId) {
32844
32750
  const figures = [];
@@ -32946,23 +32852,23 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
32946
32852
  allowDispatch(cmd) {
32947
32853
  switch (cmd.type) {
32948
32854
  case "CREATE_FILTER_TABLE":
32949
- if (!areZonesContinuous(...cmd.target)) return CommandResult.NonContinuousTargets;
32855
+ if (!areZonesContinuous(...cmd.target)) return "NonContinuousTargets";
32950
32856
  const zone = union(...cmd.target);
32951
32857
  const checkFilterOverlap = () => {
32952
- if (this.getFilterTables(cmd.sheetId).some((filter) => overlap(filter.zone, zone))) return CommandResult.FilterOverlap;
32953
- return CommandResult.Success;
32858
+ if (this.getFilterTables(cmd.sheetId).some((filter) => overlap(filter.zone, zone))) return "FilterOverlap";
32859
+ return "Success";
32954
32860
  };
32955
32861
  const checkMergeInFilter = () => {
32956
32862
  const mergesInTarget = this.getters.getMergesInZone(cmd.sheetId, zone);
32957
- for (const merge of mergesInTarget) if (overlap(zone, merge)) return CommandResult.MergeInFilter;
32958
- return CommandResult.Success;
32863
+ for (const merge of mergesInTarget) if (overlap(zone, merge)) return "MergeInFilter";
32864
+ return "Success";
32959
32865
  };
32960
32866
  return this.checkValidations(cmd, checkFilterOverlap, checkMergeInFilter);
32961
32867
  case "ADD_MERGE":
32962
- for (const merge of cmd.target) for (const filterTable of this.getFilterTables(cmd.sheetId)) if (overlap(filterTable.zone, merge)) return CommandResult.MergeInFilter;
32868
+ for (const merge of cmd.target) for (const filterTable of this.getFilterTables(cmd.sheetId)) if (overlap(filterTable.zone, merge)) return "MergeInFilter";
32963
32869
  break;
32964
32870
  }
32965
- return CommandResult.Success;
32871
+ return "Success";
32966
32872
  }
32967
32873
  handle(cmd) {
32968
32874
  switch (cmd.type) {
@@ -33256,19 +33162,19 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
33256
33162
  allowDispatch(cmd) {
33257
33163
  switch (cmd.type) {
33258
33164
  case "HIDE_COLUMNS_ROWS": {
33259
- if (!this.getters.tryGetSheet(cmd.sheetId)) return CommandResult.InvalidSheetId;
33165
+ if (!this.getters.tryGetSheet(cmd.sheetId)) return "InvalidSheetId";
33260
33166
  const hiddenGroup = cmd.dimension === "COL" ? this.getHiddenColsGroups(cmd.sheetId) : this.getHiddenRowsGroups(cmd.sheetId);
33261
33167
  const elements = cmd.dimension === "COL" ? this.getters.getNumberCols(cmd.sheetId) : this.getters.getNumberRows(cmd.sheetId);
33262
- if (new Set((hiddenGroup || []).flat().concat(cmd.elements)).size >= elements) return CommandResult.TooManyHiddenElements;
33263
- else if (largeMin(cmd.elements) < 0 || largeMax(cmd.elements) > elements) return CommandResult.InvalidHeaderIndex;
33264
- else return CommandResult.Success;
33168
+ if (new Set((hiddenGroup || []).flat().concat(cmd.elements)).size >= elements) return "TooManyHiddenElements";
33169
+ else if (largeMin(cmd.elements) < 0 || largeMax(cmd.elements) > elements) return "InvalidHeaderIndex";
33170
+ else return "Success";
33265
33171
  }
33266
33172
  case "REMOVE_COLUMNS_ROWS":
33267
- if (!this.getters.tryGetSheet(cmd.sheetId)) return CommandResult.InvalidSheetId;
33268
- if (this.checkElementsIncludeAllVisibleHeaders(cmd.sheetId, cmd.dimension, cmd.elements)) return CommandResult.NotEnoughElements;
33269
- return CommandResult.Success;
33173
+ if (!this.getters.tryGetSheet(cmd.sheetId)) return "InvalidSheetId";
33174
+ if (this.checkElementsIncludeAllVisibleHeaders(cmd.sheetId, cmd.dimension, cmd.elements)) return "NotEnoughElements";
33175
+ return "Success";
33270
33176
  }
33271
- return CommandResult.Success;
33177
+ return "Success";
33272
33178
  }
33273
33179
  handle(cmd) {
33274
33180
  switch (cmd.type) {
@@ -33396,9 +33302,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
33396
33302
  allowDispatch(cmd) {
33397
33303
  switch (cmd.type) {
33398
33304
  case "CREATE_IMAGE":
33399
- if (this.getters.getFigure(cmd.sheetId, cmd.figureId)) return CommandResult.InvalidFigureId;
33400
- return CommandResult.Success;
33401
- default: return CommandResult.Success;
33305
+ if (this.getters.getFigure(cmd.sheetId, cmd.figureId)) return "InvalidFigureId";
33306
+ return "Success";
33307
+ default: return "Success";
33402
33308
  }
33403
33309
  }
33404
33310
  handle(cmd) {
@@ -33540,7 +33446,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
33540
33446
  return this.checkValidations(cmd, this.checkDestructiveMerge, this.checkOverlap, this.checkFrozenPanes);
33541
33447
  case "UPDATE_CELL": return this.checkMergedContentUpdate(cmd);
33542
33448
  case "REMOVE_MERGE": return this.checkMergeExists(cmd);
33543
- default: return CommandResult.Success;
33449
+ default: return "Success";
33544
33450
  }
33545
33451
  }
33546
33452
  handle(cmd) {
@@ -33730,18 +33636,18 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
33730
33636
  return range !== void 0 ? rangeToMerge(mergeId, range) : void 0;
33731
33637
  }
33732
33638
  checkDestructiveMerge({ sheetId, target }) {
33733
- if (!this.getters.tryGetSheet(sheetId)) return CommandResult.Success;
33734
- return target.some((zone) => this.isMergeDestructive(sheetId, zone)) ? CommandResult.MergeIsDestructive : CommandResult.Success;
33639
+ if (!this.getters.tryGetSheet(sheetId)) return "Success";
33640
+ return target.some((zone) => this.isMergeDestructive(sheetId, zone)) ? "MergeIsDestructive" : "Success";
33735
33641
  }
33736
33642
  checkOverlap({ target }) {
33737
- for (const zone of target) for (const zone2 of target) if (zone !== zone2 && overlap(zone, zone2)) return CommandResult.MergeOverlap;
33738
- return CommandResult.Success;
33643
+ for (const zone of target) for (const zone2 of target) if (zone !== zone2 && overlap(zone, zone2)) return "MergeOverlap";
33644
+ return "Success";
33739
33645
  }
33740
33646
  checkFrozenPanes({ sheetId, target }) {
33741
- if (!this.getters.tryGetSheet(sheetId)) return CommandResult.Success;
33647
+ if (!this.getters.tryGetSheet(sheetId)) return "Success";
33742
33648
  const { xSplit, ySplit } = this.getters.getPaneDivisions(sheetId);
33743
- for (const zone of target) if (zone.left < xSplit && zone.right >= xSplit || zone.top < ySplit && zone.bottom >= ySplit) return CommandResult.FrozenPaneOverlap;
33744
- return CommandResult.Success;
33649
+ for (const zone of target) if (zone.left < xSplit && zone.right >= xSplit || zone.top < ySplit && zone.bottom >= ySplit) return "FrozenPaneOverlap";
33650
+ return "Success";
33745
33651
  }
33746
33652
  /**
33747
33653
  * The content of a merged cell should always be empty.
@@ -33749,10 +33655,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
33749
33655
  */
33750
33656
  checkMergedContentUpdate(cmd) {
33751
33657
  const { col, row, content } = cmd;
33752
- if (content === void 0) return CommandResult.Success;
33658
+ if (content === void 0) return "Success";
33753
33659
  const { col: mainCol, row: mainRow } = this.getMainCellPosition(cmd);
33754
- if (mainCol === col && mainRow === row) return CommandResult.Success;
33755
- return CommandResult.CellIsMerged;
33660
+ if (mainCol === col && mainRow === row) return "Success";
33661
+ return "CellIsMerged";
33756
33662
  }
33757
33663
  checkMergeExists(cmd) {
33758
33664
  const { sheetId, target } = cmd;
@@ -33763,9 +33669,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
33763
33669
  col: left,
33764
33670
  row: top
33765
33671
  });
33766
- if (merge === void 0 || !isEqual(zone, merge)) return CommandResult.InvalidTarget;
33672
+ if (merge === void 0 || !isEqual(zone, merge)) return "InvalidTarget";
33767
33673
  }
33768
- return CommandResult.Success;
33674
+ return "Success";
33769
33675
  }
33770
33676
  /**
33771
33677
  * Merge the current selection. Note that:
@@ -33911,8 +33817,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
33911
33817
  "getRangeFromZone"
33912
33818
  ];
33913
33819
  allowDispatch(cmd) {
33914
- if (cmd.type === "MOVE_RANGES") return cmd.target.length === 1 ? CommandResult.Success : CommandResult.InvalidZones;
33915
- return CommandResult.Success;
33820
+ if (cmd.type === "MOVE_RANGES") return cmd.target.length === 1 ? "Success" : "InvalidZones";
33821
+ return "Success";
33916
33822
  }
33917
33823
  beforeHandle(command) {}
33918
33824
  handle(cmd) {
@@ -34271,39 +34177,39 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
34271
34177
  cellPosition = {};
34272
34178
  allowDispatch(cmd) {
34273
34179
  const genericChecks = this.chainValidations(this.checkSheetExists, this.checkZonesAreInSheet)(cmd);
34274
- if (genericChecks !== CommandResult.Success) return genericChecks;
34180
+ if (genericChecks !== "Success") return genericChecks;
34275
34181
  switch (cmd.type) {
34276
34182
  case "HIDE_SHEET":
34277
- if (this.getVisibleSheetIds().length === 1) return CommandResult.NotEnoughSheets;
34278
- return CommandResult.Success;
34183
+ if (this.getVisibleSheetIds().length === 1) return "NotEnoughSheets";
34184
+ return "Success";
34279
34185
  case "CREATE_SHEET": return this.checkValidations(cmd, this.checkSheetName, this.checkSheetPosition);
34280
34186
  case "DUPLICATE_SHEET":
34281
- if (this.sheets[cmd.sheetIdTo]) return CommandResult.DuplicatedSheetId;
34282
- if (this.orderedSheetIds.map(this.getSheetName.bind(this)).includes(cmd.sheetNameTo)) return CommandResult.DuplicatedSheetName;
34283
- return CommandResult.Success;
34187
+ if (this.sheets[cmd.sheetIdTo]) return "DuplicatedSheetId";
34188
+ if (this.orderedSheetIds.map(this.getSheetName.bind(this)).includes(cmd.sheetNameTo)) return "DuplicatedSheetName";
34189
+ return "Success";
34284
34190
  case "MOVE_SHEET": try {
34285
34191
  const currentIndex = this.orderedSheetIds.findIndex((id) => id === cmd.sheetId);
34286
34192
  this.findIndexOfTargetSheet(currentIndex, cmd.delta);
34287
- return CommandResult.Success;
34193
+ return "Success";
34288
34194
  } catch (e) {
34289
- return CommandResult.WrongSheetMove;
34195
+ return "WrongSheetMove";
34290
34196
  }
34291
34197
  case "RENAME_SHEET": return this.isRenameAllowed(cmd);
34292
- case "DELETE_SHEET": return this.getVisibleSheetIds().length > 1 ? CommandResult.Success : CommandResult.NotEnoughSheets;
34198
+ case "DELETE_SHEET": return this.getVisibleSheetIds().length > 1 ? "Success" : "NotEnoughSheets";
34293
34199
  case "ADD_COLUMNS_ROWS":
34294
- if (!this.doesHeaderExist(cmd.sheetId, cmd.dimension, cmd.base)) return CommandResult.InvalidHeaderIndex;
34295
- else if (cmd.quantity <= 0) return CommandResult.InvalidQuantity;
34296
- return CommandResult.Success;
34200
+ if (!this.doesHeaderExist(cmd.sheetId, cmd.dimension, cmd.base)) return "InvalidHeaderIndex";
34201
+ else if (cmd.quantity <= 0) return "InvalidQuantity";
34202
+ return "Success";
34297
34203
  case "REMOVE_COLUMNS_ROWS": {
34298
34204
  const min = largeMin(cmd.elements);
34299
34205
  const max = largeMax(cmd.elements);
34300
- if (min < 0 || !this.doesHeaderExist(cmd.sheetId, cmd.dimension, max)) return CommandResult.InvalidHeaderIndex;
34301
- else if (this.checkElementsIncludeAllNonFrozenHeaders(cmd.sheetId, cmd.dimension, cmd.elements)) return CommandResult.NotEnoughElements;
34302
- else return CommandResult.Success;
34206
+ if (min < 0 || !this.doesHeaderExist(cmd.sheetId, cmd.dimension, max)) return "InvalidHeaderIndex";
34207
+ else if (this.checkElementsIncludeAllNonFrozenHeaders(cmd.sheetId, cmd.dimension, cmd.elements)) return "NotEnoughElements";
34208
+ else return "Success";
34303
34209
  }
34304
34210
  case "FREEZE_ROWS": return this.checkValidations(cmd, this.checkRowFreezeQuantity, this.checkRowFreezeOverlapMerge);
34305
34211
  case "FREEZE_COLUMNS": return this.checkValidations(cmd, this.checkColFreezeQuantity, this.checkColFreezeOverlapMerge);
34306
- default: return CommandResult.Success;
34212
+ default: return "Success";
34307
34213
  }
34308
34214
  }
34309
34215
  handle(cmd) {
@@ -34567,12 +34473,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
34567
34473
  * not outside the sheet.
34568
34474
  */
34569
34475
  checkZonesExistInSheet(sheetId, zones) {
34570
- if (!zones.every(isZoneValid)) return CommandResult.InvalidRange;
34476
+ if (!zones.every(isZoneValid)) return "InvalidRange";
34571
34477
  if (zones.length) {
34572
34478
  const sheetZone = this.getSheetZone(sheetId);
34573
- return zones.every((zone) => isZoneInside(zone, sheetZone)) ? CommandResult.Success : CommandResult.TargetOutOfSheet;
34479
+ return zones.every((zone) => isZoneInside(zone, sheetZone)) ? "Success" : "TargetOutOfSheet";
34574
34480
  }
34575
- return CommandResult.Success;
34481
+ return "Success";
34576
34482
  }
34577
34483
  updateCellPosition(cmd) {
34578
34484
  const { sheetId, cellId, col, row } = cmd;
@@ -34654,36 +34560,36 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
34654
34560
  }
34655
34561
  checkSheetName(cmd) {
34656
34562
  const originalSheetName = this.getters.tryGetSheetName(cmd.sheetId);
34657
- if (originalSheetName !== void 0 && cmd.name === originalSheetName) return CommandResult.UnchangedSheetName;
34563
+ if (originalSheetName !== void 0 && cmd.name === originalSheetName) return "UnchangedSheetName";
34658
34564
  const { orderedSheetIds, sheets } = this;
34659
34565
  const name = cmd.name && cmd.name.trim().toLowerCase();
34660
- if (orderedSheetIds.find((id) => isSheetNameEqual(sheets[id]?.name, name) && id !== cmd.sheetId)) return CommandResult.DuplicatedSheetName;
34661
- if (FORBIDDEN_IN_EXCEL_REGEX.test(name)) return CommandResult.ForbiddenCharactersInSheetName;
34662
- return CommandResult.Success;
34566
+ if (orderedSheetIds.find((id) => isSheetNameEqual(sheets[id]?.name, name) && id !== cmd.sheetId)) return "DuplicatedSheetName";
34567
+ if (FORBIDDEN_IN_EXCEL_REGEX.test(name)) return "ForbiddenCharactersInSheetName";
34568
+ return "Success";
34663
34569
  }
34664
34570
  checkSheetPosition(cmd) {
34665
34571
  const { orderedSheetIds } = this;
34666
- if (cmd.position > orderedSheetIds.length || cmd.position < 0) return CommandResult.WrongSheetPosition;
34667
- return CommandResult.Success;
34572
+ if (cmd.position > orderedSheetIds.length || cmd.position < 0) return "WrongSheetPosition";
34573
+ return "Success";
34668
34574
  }
34669
34575
  checkRowFreezeQuantity(cmd) {
34670
- return cmd.quantity >= 1 && cmd.quantity < this.getNumberRows(cmd.sheetId) ? CommandResult.Success : CommandResult.InvalidFreezeQuantity;
34576
+ return cmd.quantity >= 1 && cmd.quantity < this.getNumberRows(cmd.sheetId) ? "Success" : "InvalidFreezeQuantity";
34671
34577
  }
34672
34578
  checkColFreezeQuantity(cmd) {
34673
- return cmd.quantity >= 1 && cmd.quantity < this.getNumberCols(cmd.sheetId) ? CommandResult.Success : CommandResult.InvalidFreezeQuantity;
34579
+ return cmd.quantity >= 1 && cmd.quantity < this.getNumberCols(cmd.sheetId) ? "Success" : "InvalidFreezeQuantity";
34674
34580
  }
34675
34581
  checkRowFreezeOverlapMerge(cmd) {
34676
34582
  const merges = this.getters.getMerges(cmd.sheetId);
34677
- for (const merge of merges) if (merge.top < cmd.quantity && cmd.quantity <= merge.bottom) return CommandResult.MergeOverlap;
34678
- return CommandResult.Success;
34583
+ for (const merge of merges) if (merge.top < cmd.quantity && cmd.quantity <= merge.bottom) return "MergeOverlap";
34584
+ return "Success";
34679
34585
  }
34680
34586
  checkColFreezeOverlapMerge(cmd) {
34681
34587
  const merges = this.getters.getMerges(cmd.sheetId);
34682
- for (const merge of merges) if (merge.left < cmd.quantity && cmd.quantity <= merge.right) return CommandResult.MergeOverlap;
34683
- return CommandResult.Success;
34588
+ for (const merge of merges) if (merge.left < cmd.quantity && cmd.quantity <= merge.right) return "MergeOverlap";
34589
+ return "Success";
34684
34590
  }
34685
34591
  isRenameAllowed(cmd) {
34686
- if (!(cmd.name && cmd.name.trim().toLowerCase())) return CommandResult.MissingSheetName;
34592
+ if (!(cmd.name && cmd.name.trim().toLowerCase())) return "MissingSheetName";
34687
34593
  return this.checkSheetName(cmd);
34688
34594
  }
34689
34595
  renameSheet(sheet, name) {
@@ -34905,17 +34811,17 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
34905
34811
  * sheet.
34906
34812
  */
34907
34813
  checkSheetExists(cmd) {
34908
- if (cmd.type !== "CREATE_SHEET" && "sheetId" in cmd && this.sheets[cmd.sheetId] === void 0) return CommandResult.InvalidSheetId;
34909
- else if (cmd.type === "CREATE_SHEET" && this.sheets[cmd.sheetId] !== void 0) return CommandResult.DuplicatedSheetId;
34910
- return CommandResult.Success;
34814
+ if (cmd.type !== "CREATE_SHEET" && "sheetId" in cmd && this.sheets[cmd.sheetId] === void 0) return "InvalidSheetId";
34815
+ else if (cmd.type === "CREATE_SHEET" && this.sheets[cmd.sheetId] !== void 0) return "DuplicatedSheetId";
34816
+ return "Success";
34911
34817
  }
34912
34818
  /**
34913
34819
  * Check if zones in the command are well formed and
34914
34820
  * not outside the sheet.
34915
34821
  */
34916
34822
  checkZonesAreInSheet(cmd) {
34917
- if (!("sheetId" in cmd)) return CommandResult.Success;
34918
- if ("ranges" in cmd && cmd.ranges.some((rangeData) => !this.getters.tryGetSheet(rangeData._sheetId))) return CommandResult.InvalidSheetId;
34823
+ if (!("sheetId" in cmd)) return "Success";
34824
+ if ("ranges" in cmd && cmd.ranges.some((rangeData) => !this.getters.tryGetSheet(rangeData._sheetId))) return "InvalidSheetId";
34919
34825
  return this.checkZonesExistInSheet(cmd.sheetId, this.getCommandZones(cmd));
34920
34826
  }
34921
34827
  };
@@ -34938,28 +34844,28 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
34938
34844
  switch (cmd.type) {
34939
34845
  case "GROUP_HEADERS": {
34940
34846
  const { start, end, sheetId } = cmd;
34941
- if (!this.getters.tryGetSheet(sheetId)) return CommandResult.InvalidSheetId;
34942
- if (!this.getters.doesHeadersExist(cmd.sheetId, cmd.dimension, [start, end])) return CommandResult.InvalidHeaderGroupStartEnd;
34943
- if (start > end) return CommandResult.InvalidHeaderGroupStartEnd;
34944
- if (this.findGroupWithStartEnd(cmd.sheetId, cmd.dimension, start, end)) return CommandResult.HeaderGroupAlreadyExists;
34847
+ if (!this.getters.tryGetSheet(sheetId)) return "InvalidSheetId";
34848
+ if (!this.getters.doesHeadersExist(cmd.sheetId, cmd.dimension, [start, end])) return "InvalidHeaderGroupStartEnd";
34849
+ if (start > end) return "InvalidHeaderGroupStartEnd";
34850
+ if (this.findGroupWithStartEnd(cmd.sheetId, cmd.dimension, start, end)) return "HeaderGroupAlreadyExists";
34945
34851
  break;
34946
34852
  }
34947
34853
  case "UNGROUP_HEADERS": {
34948
34854
  const { start, end, sheetId } = cmd;
34949
- if (!this.getters.tryGetSheet(sheetId)) return CommandResult.InvalidSheetId;
34950
- if (!this.getters.doesHeadersExist(cmd.sheetId, cmd.dimension, [start, end])) return CommandResult.InvalidHeaderGroupStartEnd;
34951
- if (start > end) return CommandResult.InvalidHeaderGroupStartEnd;
34855
+ if (!this.getters.tryGetSheet(sheetId)) return "InvalidSheetId";
34856
+ if (!this.getters.doesHeadersExist(cmd.sheetId, cmd.dimension, [start, end])) return "InvalidHeaderGroupStartEnd";
34857
+ if (start > end) return "InvalidHeaderGroupStartEnd";
34952
34858
  break;
34953
34859
  }
34954
34860
  case "UNFOLD_HEADER_GROUP":
34955
34861
  case "FOLD_HEADER_GROUP":
34956
- if (!this.getters.tryGetSheet(cmd.sheetId)) return CommandResult.InvalidSheetId;
34862
+ if (!this.getters.tryGetSheet(cmd.sheetId)) return "InvalidSheetId";
34957
34863
  const group = this.findGroupWithStartEnd(cmd.sheetId, cmd.dimension, cmd.start, cmd.end);
34958
- if (!group) return CommandResult.UnknownHeaderGroup;
34959
- if (range(0, this.getters.getNumberHeaders(cmd.sheetId, cmd.dimension)).every((i) => i >= group.start && i <= group.end || this.getters.isHeaderHiddenByUser(cmd.sheetId, cmd.dimension, i))) return CommandResult.NotEnoughElements;
34864
+ if (!group) return "UnknownHeaderGroup";
34865
+ if (range(0, this.getters.getNumberHeaders(cmd.sheetId, cmd.dimension)).every((i) => i >= group.start && i <= group.end || this.getters.isHeaderHiddenByUser(cmd.sheetId, cmd.dimension, i))) return "NotEnoughElements";
34960
34866
  break;
34961
34867
  }
34962
- return CommandResult.Success;
34868
+ return "Success";
34963
34869
  }
34964
34870
  handle(cmd) {
34965
34871
  switch (cmd.type) {
@@ -35242,9 +35148,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
35242
35148
  locale = DEFAULT_LOCALE;
35243
35149
  allowDispatch(cmd) {
35244
35150
  switch (cmd.type) {
35245
- case "UPDATE_LOCALE": return isValidLocale(cmd.locale) ? CommandResult.Success : CommandResult.InvalidLocale;
35151
+ case "UPDATE_LOCALE": return isValidLocale(cmd.locale) ? "Success" : "InvalidLocale";
35246
35152
  }
35247
- return CommandResult.Success;
35153
+ return "Success";
35248
35154
  }
35249
35155
  handle(cmd) {
35250
35156
  switch (cmd.type) {
@@ -35317,6 +35223,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
35317
35223
  return new CompilationParametersBuilder(context, getters, computeCell).getParameters();
35318
35224
  }
35319
35225
  var CompilationParametersBuilder = class {
35226
+ getters;
35227
+ computeCell;
35320
35228
  evalContext;
35321
35229
  rangeCache = {};
35322
35230
  constructor(context, getters, computeCell) {
@@ -35360,12 +35268,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
35360
35268
  value: null,
35361
35269
  format: this.getters.getCell(position)?.format
35362
35270
  };
35363
- if (evaluatedCell.type === CellValueType.error) throw evaluatedCell.error;
35271
+ if (evaluatedCell.type === "error") throw evaluatedCell.error;
35364
35272
  return evaluatedCell;
35365
35273
  }
35366
35274
  getEvaluatedCellIfNotEmpty(position) {
35367
35275
  const evaluatedCell = this.computeCell(position);
35368
- if (evaluatedCell.type === CellValueType.empty) {
35276
+ if (evaluatedCell.type === "empty") {
35369
35277
  const cell = this.getters.getCell(position);
35370
35278
  if (!cell || !cell.isFormula && cell.content === "") return;
35371
35279
  }
@@ -35404,7 +35312,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
35404
35312
  col,
35405
35313
  row
35406
35314
  });
35407
- if (evaluatedCell?.type === CellValueType.error) {
35315
+ if (evaluatedCell?.type === "error") {
35408
35316
  this.rangeCache[cacheKey] = evaluatedCell.error;
35409
35317
  throw evaluatedCell.error;
35410
35318
  }
@@ -35800,6 +35708,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
35800
35708
  * It uses an R-Tree data structure to efficiently find dependent cells.
35801
35709
  */
35802
35710
  var FormulaDependencyGraph = class {
35711
+ encoder;
35803
35712
  dependencies = /* @__PURE__ */ new Map();
35804
35713
  rTree;
35805
35714
  constructor(encoder, data = []) {
@@ -35936,6 +35845,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
35936
35845
  //#region src/plugins/ui_core_views/cell_evaluation/evaluator.ts
35937
35846
  const MAX_ITERATION = 30;
35938
35847
  var Evaluator = class {
35848
+ context;
35939
35849
  getters;
35940
35850
  compilationParams;
35941
35851
  encoder = new PositionBitsEncoder();
@@ -36097,7 +36007,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
36097
36007
  return evaluatedCell;
36098
36008
  }
36099
36009
  handleError(e) {
36100
- if (!(e instanceof EvaluationError)) e = new EvaluationError(CellErrorType.GenericError, e.message);
36010
+ if (!(e instanceof EvaluationError)) e = new EvaluationError("#ERROR", e.message);
36101
36011
  const __lastFnCalled = this.compilationParams[2].__lastFnCalled || "";
36102
36012
  e.message = e.message.replace("[[FUNCTION_NAME]]", __lastFnCalled);
36103
36013
  return errorCell(e);
@@ -36198,7 +36108,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
36198
36108
  col: i + col,
36199
36109
  row: j + row
36200
36110
  };
36201
- if (this.getters.getCell(position)?.content || this.getters.getEvaluatedCell(position).type !== CellValueType.empty) {
36111
+ if (this.getters.getCell(position)?.content || this.getters.getEvaluatedCell(position).type !== "empty") {
36202
36112
  this.blockedArrayFormulas.add(formulaPositionId);
36203
36113
  throw new Error(_t("Array result was not expanded because it would overwrite data in %s.", toXC(position.col, position.row)));
36204
36114
  }
@@ -36452,7 +36362,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
36452
36362
  sheetId,
36453
36363
  col,
36454
36364
  row
36455
- })).every((cell) => cell.type === CellValueType.empty);
36365
+ })).every((cell) => cell.type === "empty");
36456
36366
  }
36457
36367
  exportForExcel(data) {
36458
36368
  for (const sheet of data.sheets) sheet.formulaSpillRanges = {};
@@ -36863,7 +36773,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
36863
36773
  return computedIcons;
36864
36774
  }
36865
36775
  parsePoint(sheetId, range, threshold, functionName) {
36866
- const rangeValues = this.getters.getEvaluatedCellsInZone(sheetId, this.getters.getRangeFromSheetXC(sheetId, range).zone).filter((cell) => cell.type === CellValueType.number).map((cell) => cell.value);
36776
+ const rangeValues = this.getters.getEvaluatedCellsInZone(sheetId, this.getters.getRangeFromSheetXC(sheetId, range).zone).filter((cell) => cell.type === "number").map((cell) => cell.value);
36867
36777
  switch (threshold.type) {
36868
36778
  case "value": return functionName === "max" ? largeMax(rangeValues) : largeMin(rangeValues);
36869
36779
  case "number": return Number(threshold.value);
@@ -36894,7 +36804,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
36894
36804
  col,
36895
36805
  row
36896
36806
  });
36897
- if (cell.type !== CellValueType.number) continue;
36807
+ if (cell.type !== "number") continue;
36898
36808
  const icon = this.computeIcon(cell.value, upperInflectionPoint, rule.upperInflectionPoint.operator, lowerInflectionPoint, rule.lowerInflectionPoint.operator, iconSet);
36899
36809
  if (!computedIcons[col]) computedIcons[col] = [];
36900
36810
  computedIcons[col][row] = icon;
@@ -36935,7 +36845,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
36935
36845
  col,
36936
36846
  row
36937
36847
  });
36938
- if (cell.type === CellValueType.number) {
36848
+ if (cell.type === "number") {
36939
36849
  const value = clip(cell.value, minValue, maxValue);
36940
36850
  let color;
36941
36851
  if (colorCellArgs.length === 2 && midValue) color = value <= midValue ? this.colorCell(value, colorCellArgs[0].minValue, colorCellArgs[0].minColor, colorCellArgs[0].colorDiffUnit) : this.colorCell(value, colorCellArgs[1].minValue, colorCellArgs[1].minColor, colorCellArgs[1].colorDiffUnit);
@@ -36969,7 +36879,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
36969
36879
  */
36970
36880
  rulePredicate = { CellIsRule: (target, rule) => {
36971
36881
  const cell = this.getters.getEvaluatedCell(target);
36972
- if (cell.type === CellValueType.error) return false;
36882
+ if (cell.type === "error") return false;
36973
36883
  const [value0, value1] = rule.values.map((val) => {
36974
36884
  if (val.startsWith("=")) return this.getters.evaluateFormula(target.sheetId, val) ?? "";
36975
36885
  return parseLiteral(val, DEFAULT_LOCALE);
@@ -37076,7 +36986,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
37076
36986
  if (!validationResults[col]) validationResults[col] = [];
37077
36987
  validationResults[col][row] = lazy(() => {
37078
36988
  const evaluatedCell = this.getters.getEvaluatedCell(cellPosition);
37079
- if (evaluatedCell.type === CellValueType.empty) return VALID_RESULT;
36989
+ if (evaluatedCell.type === "empty") return VALID_RESULT;
37080
36990
  return this.getValidationResultForCellValue(evaluatedCell.value, cellPosition);
37081
36991
  });
37082
36992
  }
@@ -37116,7 +37026,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
37116
37026
  const evaluated = this.getters.evaluateFormula(sheetId, translatedFormula);
37117
37027
  return evaluated && !isMatrix(evaluated) ? evaluated.toString() : "";
37118
37028
  } catch (e) {
37119
- return e instanceof EvaluationError ? e.errorType : CellErrorType.GenericError;
37029
+ return e instanceof EvaluationError ? e.errorType : "#ERROR";
37120
37030
  }
37121
37031
  });
37122
37032
  }
@@ -37317,7 +37227,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
37317
37227
  *
37318
37228
  */
37319
37229
  var AutofillPlugin = class extends UIPlugin {
37320
- static layers = [LAYERS.Autofill];
37230
+ static layers = [5];
37321
37231
  static getters = ["getAutofillTooltip"];
37322
37232
  autofillZone;
37323
37233
  steps;
@@ -37330,13 +37240,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
37330
37240
  const sheetId = this.getters.getActiveSheetId();
37331
37241
  this.lastCellSelected.col = cmd.col === -1 ? this.lastCellSelected.col : clip(cmd.col, 0, this.getters.getNumberCols(sheetId));
37332
37242
  this.lastCellSelected.row = cmd.row === -1 ? this.lastCellSelected.row : clip(cmd.row, 0, this.getters.getNumberRows(sheetId));
37333
- if (this.lastCellSelected.col !== void 0 && this.lastCellSelected.row !== void 0) return CommandResult.Success;
37334
- return CommandResult.InvalidAutofillSelection;
37243
+ if (this.lastCellSelected.col !== void 0 && this.lastCellSelected.row !== void 0) return "Success";
37244
+ return "InvalidAutofillSelection";
37335
37245
  case "AUTOFILL_AUTO":
37336
37246
  const zone = this.getters.getSelectedZone();
37337
- return zone.top === zone.bottom ? CommandResult.Success : CommandResult.CancelledForUnknownReason;
37247
+ return zone.top === zone.bottom ? "Success" : "CancelledForUnknownReason";
37338
37248
  }
37339
- return CommandResult.Success;
37249
+ return "Success";
37340
37250
  }
37341
37251
  handle(cmd) {
37342
37252
  switch (cmd.type) {
@@ -37368,7 +37278,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
37368
37278
  const target = this.autofillZone;
37369
37279
  const autofillCellsData = [];
37370
37280
  switch (this.direction) {
37371
- case DIRECTION.DOWN:
37281
+ case "down":
37372
37282
  for (let col = source.left; col <= source.right; col++) {
37373
37283
  const xcs = [];
37374
37284
  for (let row = source.top; row <= source.bottom; row++) xcs.push(toXC(col, row));
@@ -37376,7 +37286,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
37376
37286
  for (let row = target.top; row <= target.bottom; row++) autofillCellsData.push(this.computeNewCell(generator, col, row));
37377
37287
  }
37378
37288
  break;
37379
- case DIRECTION.UP:
37289
+ case "up":
37380
37290
  for (let col = source.left; col <= source.right; col++) {
37381
37291
  const xcs = [];
37382
37292
  for (let row = source.bottom; row >= source.top; row--) xcs.push(toXC(col, row));
@@ -37384,7 +37294,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
37384
37294
  for (let row = target.bottom; row >= target.top; row--) autofillCellsData.push(this.computeNewCell(generator, col, row));
37385
37295
  }
37386
37296
  break;
37387
- case DIRECTION.LEFT:
37297
+ case "left":
37388
37298
  for (let row = source.top; row <= source.bottom; row++) {
37389
37299
  const xcs = [];
37390
37300
  for (let col = source.right; col >= source.left; col--) xcs.push(toXC(col, row));
@@ -37392,7 +37302,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
37392
37302
  for (let col = target.right; col >= target.left; col--) autofillCellsData.push(this.computeNewCell(generator, col, row));
37393
37303
  }
37394
37304
  break;
37395
- case DIRECTION.RIGHT:
37305
+ case "right":
37396
37306
  for (let row = source.top; row <= source.bottom; row++) {
37397
37307
  const xcs = [];
37398
37308
  for (let col = source.left; col <= source.right; col++) xcs.push(toXC(col, row));
@@ -37518,19 +37428,19 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
37518
37428
  }
37519
37429
  this.direction = this.getDirection(col, row);
37520
37430
  switch (this.direction) {
37521
- case DIRECTION.UP:
37431
+ case "up":
37522
37432
  this.saveZone(row, source.top - 1, source.left, source.right);
37523
37433
  this.steps = source.top - row;
37524
37434
  break;
37525
- case DIRECTION.DOWN:
37435
+ case "down":
37526
37436
  this.saveZone(source.bottom + 1, row, source.left, source.right);
37527
37437
  this.steps = row - source.bottom;
37528
37438
  break;
37529
- case DIRECTION.LEFT:
37439
+ case "left":
37530
37440
  this.saveZone(source.top, source.bottom, col, source.left - 1);
37531
37441
  this.steps = source.left - col;
37532
37442
  break;
37533
- case DIRECTION.RIGHT:
37443
+ case "right":
37534
37444
  this.saveZone(source.top, source.bottom, source.right + 1, col);
37535
37445
  this.steps = col - source.right;
37536
37446
  break;
@@ -37662,19 +37572,19 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
37662
37572
  const position = {
37663
37573
  up: {
37664
37574
  number: source.top - row,
37665
- value: DIRECTION.UP
37575
+ value: "up"
37666
37576
  },
37667
37577
  down: {
37668
37578
  number: row - source.bottom,
37669
- value: DIRECTION.DOWN
37579
+ value: "down"
37670
37580
  },
37671
37581
  left: {
37672
37582
  number: source.left - col,
37673
- value: DIRECTION.LEFT
37583
+ value: "left"
37674
37584
  },
37675
37585
  right: {
37676
37586
  number: col - source.right,
37677
- value: DIRECTION.RIGHT
37587
+ value: "right"
37678
37588
  }
37679
37589
  };
37680
37590
  if (Object.values(position).map((x) => x.number > 0 ? 1 : 0).reduce((acc, value) => acc + value) === 1) return Object.values(position).find((x) => x.number > 0 ? 1 : 0).value;
@@ -37877,7 +37787,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
37877
37787
  return this.getters.isEmpty(sheetId, zone) || this.getters.isSingleCellOrMerge(sheetId, zone);
37878
37788
  }
37879
37789
  isNumber(cell) {
37880
- return cell.type === CellValueType.number && !(cell.format && isDateTimeFormat(cell.format));
37790
+ return cell.type === "number" && !(cell.format && isDateTimeFormat(cell.format));
37881
37791
  }
37882
37792
  isZoneValid(zone) {
37883
37793
  return zone.bottom >= zone.top && zone.right >= zone.left;
@@ -38045,10 +37955,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
38045
37955
  try {
38046
37956
  cellPopoverRegistry.get(cmd.popoverType);
38047
37957
  } catch (error) {
38048
- return CommandResult.InvalidCellPopover;
37958
+ return "InvalidCellPopover";
38049
37959
  }
38050
- return CommandResult.Success;
38051
- default: return CommandResult.Success;
37960
+ return "Success";
37961
+ default: return "Success";
38052
37962
  }
38053
37963
  }
38054
37964
  handle(cmd) {
@@ -38458,6 +38368,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
38458
38368
  //#endregion
38459
38369
  //#region src/collaborative/revisions.ts
38460
38370
  var Revision = class {
38371
+ rootCommand;
38372
+ timestamp;
38461
38373
  id;
38462
38374
  clientId;
38463
38375
  _commands = [];
@@ -38494,6 +38406,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
38494
38406
  //#region src/collaborative/session.ts
38495
38407
  var ClientDisconnectedError = class extends Error {};
38496
38408
  var Session = class extends EventBus {
38409
+ revisions;
38410
+ transportService;
38411
+ serverRevisionId;
38497
38412
  /**
38498
38413
  * Positions of the others client.
38499
38414
  */
@@ -38869,7 +38784,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
38869
38784
  "getConnectedClients",
38870
38785
  "isFullySynchronized"
38871
38786
  ];
38872
- static layers = [LAYERS.Selection];
38787
+ static layers = [6];
38873
38788
  availableColors = new Set(colors);
38874
38789
  colors = {};
38875
38790
  session;
@@ -38951,6 +38866,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
38951
38866
  //#region src/helpers/clipboard/clipboard_abstract_cell_state.ts
38952
38867
  /** Abstract state of the clipboard when copying/cutting content that is pasted in cells of the sheet */
38953
38868
  var ClipboardCellsAbstractState = class {
38869
+ getters;
38870
+ dispatch;
38871
+ selection;
38954
38872
  operation;
38955
38873
  sheetId;
38956
38874
  constructor(operation, getters, dispatch, selection) {
@@ -38961,10 +38879,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
38961
38879
  this.sheetId = getters.getActiveSheetId();
38962
38880
  }
38963
38881
  isCutAllowed(target) {
38964
- return CommandResult.Success;
38882
+ return "Success";
38965
38883
  }
38966
38884
  isPasteAllowed(target, clipboardOption) {
38967
- return CommandResult.Success;
38885
+ return "Success";
38968
38886
  }
38969
38887
  /**
38970
38888
  * Add columns and/or rows to ensure that col + width and row + height are still
@@ -39072,23 +38990,23 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
39072
38990
  this.copiedTables = tables;
39073
38991
  }
39074
38992
  isCutAllowed(target) {
39075
- if (target.length !== 1) return CommandResult.WrongCutSelection;
39076
- return CommandResult.Success;
38993
+ if (target.length !== 1) return "WrongCutSelection";
38994
+ return "Success";
39077
38995
  }
39078
38996
  isPasteAllowed(target, clipboardOption) {
39079
38997
  const sheetId = this.getters.getActiveSheetId();
39080
- if (this.operation === "CUT" && clipboardOption?.pasteOption !== void 0) return CommandResult.WrongPasteOption;
38998
+ if (this.operation === "CUT" && clipboardOption?.pasteOption !== void 0) return "WrongPasteOption";
39081
38999
  if (target.length > 1) {
39082
- if (this.cells.length > 1 || this.cells[0].length > 1) return CommandResult.WrongPasteSelection;
39000
+ if (this.cells.length > 1 || this.cells[0].length > 1) return "WrongPasteSelection";
39083
39001
  }
39084
39002
  const clipboardHeight = this.cells.length;
39085
39003
  const clipboardWidth = this.cells[0].length;
39086
39004
  for (const zone of this.getPasteZones(target)) if (this.getters.doesIntersectMerge(sheetId, zone)) {
39087
- if (target.length > 1 || !this.getters.isSingleCellOrMerge(sheetId, target[0]) || clipboardHeight * clipboardWidth !== 1) return CommandResult.WillRemoveExistingMerge;
39005
+ if (target.length > 1 || !this.getters.isSingleCellOrMerge(sheetId, target[0]) || clipboardHeight * clipboardWidth !== 1) return "WillRemoveExistingMerge";
39088
39006
  }
39089
39007
  const { xSplit, ySplit } = this.getters.getPaneDivisions(sheetId);
39090
- for (const zone of this.getPasteZones(target)) if (zone.left < xSplit && zone.right >= xSplit || zone.top < ySplit && zone.bottom >= ySplit) return CommandResult.FrozenPaneOverlap;
39091
- return CommandResult.Success;
39008
+ for (const zone of this.getPasteZones(target)) if (zone.left < xSplit && zone.right >= xSplit || zone.top < ySplit && zone.bottom >= ySplit) return "FrozenPaneOverlap";
39009
+ return "Success";
39092
39010
  }
39093
39011
  /**
39094
39012
  * Paste the clipboard content in the given target
@@ -39319,8 +39237,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
39319
39237
  }
39320
39238
  getClipboardContent() {
39321
39239
  return {
39322
- [ClipboardMIMEType.PlainText]: this.getPlainTextContent(),
39323
- [ClipboardMIMEType.Html]: this.getHTMLContent()
39240
+ ["text/plain"]: this.getPlainTextContent(),
39241
+ ["text/html"]: this.getHTMLContent()
39324
39242
  };
39325
39243
  }
39326
39244
  getPlainTextContent() {
@@ -39513,7 +39431,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
39513
39431
  switch (cmd.type) {
39514
39432
  case "REMOVE_DUPLICATES": return this.checkValidations(cmd, this.chainValidations(this.checkSingleRangeSelected, this.checkNoMergeInZone, this.checkRangeContainsValues, this.checkColumnsIncludedInZone), this.chainValidations(this.checkNoColumnProvided, this.checkColumnsAreUnique));
39515
39433
  }
39516
- return CommandResult.Success;
39434
+ return "Success";
39517
39435
  }
39518
39436
  handle(cmd) {
39519
39437
  switch (cmd.type) {
@@ -39590,34 +39508,34 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
39590
39508
  });
39591
39509
  }
39592
39510
  checkSingleRangeSelected() {
39593
- if (this.getters.getSelectedZones().length !== 1) return CommandResult.MoreThanOneRangeSelected;
39594
- return CommandResult.Success;
39511
+ if (this.getters.getSelectedZones().length !== 1) return "MoreThanOneRangeSelected";
39512
+ return "Success";
39595
39513
  }
39596
39514
  checkNoMergeInZone() {
39597
39515
  const sheetId = this.getters.getActiveSheetId();
39598
39516
  const zone = this.getters.getSelectedZone();
39599
- if (this.getters.getMergesInZone(sheetId, zone).length > 0) return CommandResult.WillRemoveExistingMerge;
39600
- return CommandResult.Success;
39517
+ if (this.getters.getMergesInZone(sheetId, zone).length > 0) return "WillRemoveExistingMerge";
39518
+ return "Success";
39601
39519
  }
39602
39520
  checkRangeContainsValues(cmd) {
39603
39521
  const sheetId = this.getters.getActiveSheetId();
39604
39522
  const zone = this.getters.getSelectedZone();
39605
39523
  if (cmd.hasHeader) zone.top += 1;
39606
- if (this.getters.getEvaluatedCellsInZone(sheetId, zone).every((evaluatedCel) => evaluatedCel.type === "empty")) return CommandResult.EmptyTarget;
39607
- return CommandResult.Success;
39524
+ if (this.getters.getEvaluatedCellsInZone(sheetId, zone).every((evaluatedCel) => evaluatedCel.type === "empty")) return "EmptyTarget";
39525
+ return "Success";
39608
39526
  }
39609
39527
  checkNoColumnProvided(cmd) {
39610
- if (cmd.columns.length === 0) return CommandResult.NoColumnsProvided;
39611
- return CommandResult.Success;
39528
+ if (cmd.columns.length === 0) return "NoColumnsProvided";
39529
+ return "Success";
39612
39530
  }
39613
39531
  checkColumnsIncludedInZone(cmd) {
39614
39532
  const zone = this.getters.getSelectedZone();
39615
- if (cmd.columns.some((colIndex) => colIndex < zone.left || colIndex > zone.right)) return CommandResult.ColumnsNotIncludedInZone;
39616
- return CommandResult.Success;
39533
+ if (cmd.columns.some((colIndex) => colIndex < zone.left || colIndex > zone.right)) return "ColumnsNotIncludedInZone";
39534
+ return "Success";
39617
39535
  }
39618
39536
  checkColumnsAreUnique(cmd) {
39619
- if (cmd.columns.length !== new Set(cmd.columns).size) return CommandResult.DuplicatesColumnsSelected;
39620
- return CommandResult.Success;
39537
+ if (cmd.columns.length !== new Set(cmd.columns).size) return "DuplicatesColumnsSelected";
39538
+ return "Success";
39621
39539
  }
39622
39540
  trimWhitespace() {
39623
39541
  const zones = this.getters.getSelectedZones();
@@ -39654,12 +39572,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
39654
39572
  //#region src/plugins/ui_feature/find_and_replace.ts
39655
39573
  const BORDER_COLOR = "#8B008B";
39656
39574
  const BACKGROUND_COLOR = "#8B008B33";
39657
- var Direction = /* @__PURE__ */ function(Direction) {
39658
- Direction[Direction["previous"] = -1] = "previous";
39659
- Direction[Direction["current"] = 0] = "current";
39660
- Direction[Direction["next"] = 1] = "next";
39661
- return Direction;
39662
- }(Direction || {});
39663
39575
  /**
39664
39576
  * Find and Replace Plugin
39665
39577
  *
@@ -39670,7 +39582,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
39670
39582
  * the search with a new value.
39671
39583
  */
39672
39584
  var FindAndReplacePlugin = class extends UIPlugin {
39673
- static layers = [LAYERS.Search];
39585
+ static layers = [3];
39674
39586
  static getters = ["getSearchMatches", "getCurrentSelectedMatchIndex"];
39675
39587
  searchMatches = [];
39676
39588
  selectedMatchIndex = null;
@@ -39691,10 +39603,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
39691
39603
  this.clearSearch();
39692
39604
  break;
39693
39605
  case "SELECT_SEARCH_PREVIOUS_MATCH":
39694
- this.selectNextCell(Direction.previous);
39606
+ this.selectNextCell(-1);
39695
39607
  break;
39696
39608
  case "SELECT_SEARCH_NEXT_MATCH":
39697
- this.selectNextCell(Direction.next);
39609
+ this.selectNextCell(1);
39698
39610
  break;
39699
39611
  case "REPLACE_SEARCH":
39700
39612
  this.replace(cmd.replaceWith);
@@ -39746,8 +39658,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
39746
39658
  * refresh the matches according to the current search options
39747
39659
  */
39748
39660
  refreshSearch() {
39749
- this.searchMatches = this.findMatches();
39750
- this.selectNextCell(Direction.current);
39661
+ const matches = this.findMatches();
39662
+ this.searchMatches = matches;
39663
+ this.selectNextCell(0);
39751
39664
  }
39752
39665
  /**
39753
39666
  * Updates the regex based on the current searchOptions and
@@ -39948,7 +39861,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
39948
39861
  getCellNumberFormat(position) {
39949
39862
  for (const pos of [position]) {
39950
39863
  const cell = this.getters.getEvaluatedCell(pos);
39951
- if (cell.type === CellValueType.number && !(cell.format && isDateTimeFormat(cell.format))) return cell.format || createDefaultFormat(cell.value);
39864
+ if (cell.type === "number" && !(cell.format && isDateTimeFormat(cell.format))) return cell.format || createDefaultFormat(cell.value);
39952
39865
  }
39953
39866
  }
39954
39867
  };
@@ -40015,7 +39928,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
40015
39928
  * HighlightPlugin
40016
39929
  */
40017
39930
  var HighlightPlugin = class extends UIPlugin {
40018
- static layers = [LAYERS.Highlights];
39931
+ static layers = [1];
40019
39932
  static getters = ["getHighlights"];
40020
39933
  getHighlights() {
40021
39934
  return this.prepareHighlights(this.getters.getComposerHighlights().concat(this.getters.getSelectionInputHighlights()));
@@ -40059,7 +39972,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
40059
39972
  //#endregion
40060
39973
  //#region src/plugins/ui_feature/renderer.ts
40061
39974
  var RendererPlugin = class extends UIPlugin {
40062
- static layers = [LAYERS.Background, LAYERS.Headers];
39975
+ static layers = [0, 7];
40063
39976
  static getters = ["getColDimensionsInViewport", "getRowDimensionsInViewport"];
40064
39977
  boxes = [];
40065
39978
  /**
@@ -40101,7 +40014,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
40101
40014
  }
40102
40015
  drawGrid(renderingContext, layer) {
40103
40016
  switch (layer) {
40104
- case LAYERS.Background:
40017
+ case 0:
40105
40018
  this.drawGlobalBackground(renderingContext);
40106
40019
  for (const { zone, rect } of this.getters.getAllActiveViewportsZonesAndRect()) {
40107
40020
  const { ctx } = renderingContext;
@@ -40120,7 +40033,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
40120
40033
  }
40121
40034
  this.drawFrozenPanes(renderingContext);
40122
40035
  break;
40123
- case LAYERS.Headers:
40036
+ case 7:
40124
40037
  if (!this.getters.isDashboard()) {
40125
40038
  this.drawHeaders(renderingContext);
40126
40039
  this.drawFrozenPanesHeaders(renderingContext);
@@ -40468,7 +40381,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
40468
40381
  const nextCellBorder = this.getters.getCellBorderWithFilterBorder(position);
40469
40382
  const cellHasIcon = this.getters.doesCellHaveGridIcon(position);
40470
40383
  const cellHasCheckbox = this.getters.isCellValidCheckbox(position);
40471
- if (nextCell.type !== CellValueType.empty || this.getters.isInMerge(position) || nextCellBorder?.left || cellHasIcon || cellHasCheckbox) return col;
40384
+ if (nextCell.type !== "empty" || this.getters.isInMerge(position) || nextCellBorder?.left || cellHasIcon || cellHasCheckbox) return col;
40472
40385
  col++;
40473
40386
  }
40474
40387
  return col;
@@ -40486,7 +40399,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
40486
40399
  const previousCellBorder = this.getters.getCellBorderWithFilterBorder(position);
40487
40400
  const cellHasIcon = this.getters.doesCellHaveGridIcon(position);
40488
40401
  const cellHasCheckbox = this.getters.isCellValidCheckbox(position);
40489
- if (previousCell.type !== CellValueType.empty || this.getters.isInMerge(position) || previousCellBorder?.right || cellHasIcon || cellHasCheckbox) return col;
40402
+ if (previousCell.type !== "empty" || this.getters.isInMerge(position) || previousCellBorder?.right || cellHasIcon || cellHasCheckbox) return col;
40490
40403
  col--;
40491
40404
  }
40492
40405
  return col;
@@ -40495,7 +40408,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
40495
40408
  if (this.getters.getCell(position)?.isFormula && this.getters.shouldShowFormulas()) return "left";
40496
40409
  const { align } = this.getters.getCellStyle(position);
40497
40410
  const evaluatedCell = this.getters.getEvaluatedCell(position);
40498
- if (isOverflowing && evaluatedCell.type === CellValueType.number) return align !== "center" ? "left" : align;
40411
+ if (isOverflowing && evaluatedCell.type === "number") return align !== "center" ? "left" : align;
40499
40412
  return align || evaluatedCell.defaultAlign;
40500
40413
  }
40501
40414
  createZoneBox(sheetId, zone, viewport) {
@@ -40519,9 +40432,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
40519
40432
  border: this.getters.getCellBorderWithFilterBorder(position) || void 0,
40520
40433
  style: this.getters.getCellComputedStyle(position),
40521
40434
  verticalAlign,
40522
- isError: cell.type === CellValueType.error && cell.error.isVerbose || this.getters.isDataValidationInvalid(position)
40435
+ isError: cell.type === "error" && cell.error.isVerbose || this.getters.isDataValidationInvalid(position)
40523
40436
  };
40524
- if (cell.type === CellValueType.empty || this.getters.isCellValidCheckbox(position)) return box;
40437
+ if (cell.type === "empty" || this.getters.isCellValidCheckbox(position)) return box;
40525
40438
  /** Icon CF */
40526
40439
  const cfIcon = this.getters.getConditionalIcon(position);
40527
40440
  const fontSizePX = computeTextFontSizeInPixels(box.style);
@@ -40683,7 +40596,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
40683
40596
  * This plugin handles this internal state.
40684
40597
  */
40685
40598
  var SelectionInputPlugin = class extends UIPlugin {
40686
- static layers = [LAYERS.Highlights];
40599
+ inputHasSingleRange;
40600
+ static layers = [1];
40687
40601
  static getters = [];
40688
40602
  ranges = [];
40689
40603
  focusedRangeIndex = null;
@@ -40894,7 +40808,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
40894
40808
  * This plugin handles this internal state.
40895
40809
  */
40896
40810
  var SelectionInputsManagerPlugin = class extends UIPlugin {
40897
- static layers = [LAYERS.Highlights];
40811
+ config;
40812
+ static layers = [1];
40898
40813
  static getters = [
40899
40814
  "getSelectionInput",
40900
40815
  "getSelectionInputValue",
@@ -40915,26 +40830,26 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
40915
40830
  case "FOCUS_RANGE":
40916
40831
  case "CHANGE_RANGE":
40917
40832
  case "ADD_EMPTY_RANGE":
40918
- case "REMOVE_RANGE": if (!this.inputs[cmd.id]) return CommandResult.InvalidInputId;
40833
+ case "REMOVE_RANGE": if (!this.inputs[cmd.id]) return "InvalidInputId";
40919
40834
  }
40920
40835
  switch (cmd.type) {
40921
40836
  case "FOCUS_RANGE":
40922
40837
  const index = this.currentInput?.getIndex(cmd.rangeId);
40923
- if (this.focusedInputId === cmd.id && this.currentInput?.focusedRangeIndex === index) return CommandResult.InputAlreadyFocused;
40838
+ if (this.focusedInputId === cmd.id && this.currentInput?.focusedRangeIndex === index) return "InputAlreadyFocused";
40924
40839
  break;
40925
40840
  case "ADD_RANGE":
40926
40841
  case "ADD_EMPTY_RANGE":
40927
40842
  const input = this.inputs[cmd.id];
40928
- if (input.inputHasSingleRange && input.ranges.length === 1) return CommandResult.MaximumRangesReached;
40843
+ if (input.inputHasSingleRange && input.ranges.length === 1) return "MaximumRangesReached";
40929
40844
  break;
40930
40845
  case "REMOVE_RANGE":
40931
- if (this.inputs[cmd.id].ranges.length === 1) return CommandResult.MinimumRangesReached;
40846
+ if (this.inputs[cmd.id].ranges.length === 1) return "MinimumRangesReached";
40932
40847
  break;
40933
40848
  case "CHANGE_RANGE":
40934
- if (this.inputs[cmd.id].inputHasSingleRange && cmd.value.split(",").length > 1) return CommandResult.MaximumRangesReached;
40849
+ if (this.inputs[cmd.id].inputHasSingleRange && cmd.value.split(",").length > 1) return "MaximumRangesReached";
40935
40850
  break;
40936
40851
  }
40937
- return CommandResult.Success;
40852
+ return "Success";
40938
40853
  }
40939
40854
  handle(cmd) {
40940
40855
  switch (cmd.type) {
@@ -41053,7 +40968,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
41053
40968
  if (!isInside(cmd.col, cmd.row, cmd.zone)) throw new Error(_t("The anchor must be part of the provided zone"));
41054
40969
  return this.checkValidations(cmd, this.checkMerge, this.checkMergeSizes);
41055
40970
  }
41056
- return CommandResult.Success;
40971
+ return "Success";
41057
40972
  }
41058
40973
  handle(cmd) {
41059
40974
  switch (cmd.type) {
@@ -41063,24 +40978,24 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
41063
40978
  }
41064
40979
  }
41065
40980
  checkMerge({ sheetId, zone }) {
41066
- if (!this.getters.doesIntersectMerge(sheetId, zone)) return CommandResult.Success;
40981
+ if (!this.getters.doesIntersectMerge(sheetId, zone)) return "Success";
41067
40982
  if (positions(zone).some(({ col, row }) => !this.getters.isInMerge({
41068
40983
  sheetId,
41069
40984
  col,
41070
40985
  row
41071
- }))) return CommandResult.InvalidSortZone;
41072
- return CommandResult.Success;
40986
+ }))) return "InvalidSortZone";
40987
+ return "Success";
41073
40988
  }
41074
40989
  checkMergeSizes({ sheetId, zone }) {
41075
- if (!this.getters.doesIntersectMerge(sheetId, zone)) return CommandResult.Success;
40990
+ if (!this.getters.doesIntersectMerge(sheetId, zone)) return "Success";
41076
40991
  const merges = this.getters.getMerges(sheetId).filter((merge) => overlap(merge, zone));
41077
40992
  const mergeDimension = zoneToDimension(merges[0]);
41078
40993
  const [widthFirst, heightFirst] = [mergeDimension.numberOfCols, mergeDimension.numberOfRows];
41079
40994
  if (!merges.every((merge) => {
41080
40995
  const [widthCurrent, heightCurrent] = [merge.right - merge.left + 1, merge.bottom - merge.top + 1];
41081
40996
  return widthCurrent === widthFirst && heightCurrent === heightFirst;
41082
- })) return CommandResult.InvalidSortZone;
41083
- return CommandResult.Success;
40997
+ })) return "InvalidSortZone";
40998
+ return "Success";
41084
40999
  }
41085
41000
  /**
41086
41001
  * safe-version of expandZone to make sure we don't get out of the grid
@@ -41236,9 +41151,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
41236
41151
  col,
41237
41152
  row
41238
41153
  }).type));
41239
- if (cells[0][0] === CellValueType.empty) cells = cells.slice(1);
41240
- if (cells.some((item) => item[0] === CellValueType.empty)) return false;
41241
- else if (cells.some((item) => item[1] !== CellValueType.empty && item[0] !== item[1])) return true;
41154
+ if (cells[0][0] === "empty") cells = cells.slice(1);
41155
+ if (cells.some((item) => item[0] === "empty")) return false;
41156
+ else if (cells.some((item) => item[1] !== "empty" && item[0] !== item[1])) return true;
41242
41157
  else return false;
41243
41158
  }
41244
41159
  sortZone(sheetId, anchor, zone, sortDirection, options) {
@@ -41421,8 +41336,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
41421
41336
  * sheet.
41422
41337
  */
41423
41338
  checkSheetExists(cmd) {
41424
- if ("sheetId" in cmd && this.getters.tryGetSheet(cmd.sheetId) === void 0) return CommandResult.InvalidSheetId;
41425
- return CommandResult.Success;
41339
+ if ("sheetId" in cmd && this.getters.tryGetSheet(cmd.sheetId) === void 0) return "InvalidSheetId";
41340
+ return "Success";
41426
41341
  }
41427
41342
  /**
41428
41343
  * Check if zones in the command are well formed and
@@ -41430,11 +41345,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
41430
41345
  */
41431
41346
  checkZonesAreInSheet(cmd) {
41432
41347
  const sheetId = "sheetId" in cmd ? cmd.sheetId : this.getters.tryGetActiveSheetId();
41433
- if ("ranges" in cmd && cmd.ranges.some((rangeData) => !this.getters.tryGetSheet(rangeData._sheetId))) return CommandResult.InvalidSheetId;
41348
+ if ("ranges" in cmd && cmd.ranges.some((rangeData) => !this.getters.tryGetSheet(rangeData._sheetId))) return "InvalidSheetId";
41434
41349
  const zones = this.getters.getCommandZones(cmd);
41435
- if (!sheetId && zones.length > 0) return CommandResult.NoActiveSheet;
41350
+ if (!sheetId && zones.length > 0) return "NoActiveSheet";
41436
41351
  if (sheetId && zones.length > 0) return this.getters.checkZonesExistInSheet(sheetId, zones);
41437
- return CommandResult.Success;
41352
+ return "Success";
41438
41353
  }
41439
41354
  autoResizeRows(sheetId, rows) {
41440
41355
  const rowSizes = [];
@@ -41707,13 +41622,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
41707
41622
  allowDispatch(cmd) {
41708
41623
  switch (cmd.type) {
41709
41624
  case "REQUEST_UNDO":
41710
- if (!this.canUndo()) return CommandResult.EmptyUndoStack;
41625
+ if (!this.canUndo()) return "EmptyUndoStack";
41711
41626
  break;
41712
41627
  case "REQUEST_REDO":
41713
- if (!this.canRedo()) return CommandResult.EmptyRedoStack;
41628
+ if (!this.canRedo()) return "EmptyRedoStack";
41714
41629
  break;
41715
41630
  }
41716
- return CommandResult.Success;
41631
+ return "Success";
41717
41632
  }
41718
41633
  handle(cmd) {
41719
41634
  switch (cmd.type) {
@@ -41775,7 +41690,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
41775
41690
  switch (cmd.type) {
41776
41691
  case "SPLIT_TEXT_INTO_COLUMNS": return this.chainValidations(this.batchValidations(this.checkSingleColSelected, this.checkNonEmptySelector), this.batchValidations(this.checkNotOverwritingContent, this.checkSeparatorInSelection))(cmd);
41777
41692
  }
41778
- return CommandResult.Success;
41693
+ return "Success";
41779
41694
  }
41780
41695
  handle(cmd) {
41781
41696
  switch (cmd.type) {
@@ -41786,7 +41701,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
41786
41701
  }
41787
41702
  getAutomaticSeparator() {
41788
41703
  const cells = this.getters.getSelectedCells();
41789
- for (const cell of cells) if (cell.value && cell.type === CellValueType.text) {
41704
+ for (const cell of cells) if (cell.value && cell.type === "text") {
41790
41705
  const separator = this.getAutoSeparatorForString(cell.value);
41791
41706
  if (separator) return separator;
41792
41707
  }
@@ -41922,24 +41837,24 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
41922
41837
  });
41923
41838
  }
41924
41839
  checkSingleColSelected() {
41925
- if (!this.getters.isSingleColSelected()) return CommandResult.MoreThanOneColumnSelected;
41926
- return CommandResult.Success;
41840
+ if (!this.getters.isSingleColSelected()) return "MoreThanOneColumnSelected";
41841
+ return "Success";
41927
41842
  }
41928
41843
  checkNonEmptySelector(cmd) {
41929
- if (cmd.separator === "") return CommandResult.EmptySplitSeparator;
41930
- return CommandResult.Success;
41844
+ if (cmd.separator === "") return "EmptySplitSeparator";
41845
+ return "Success";
41931
41846
  }
41932
41847
  checkNotOverwritingContent(cmd) {
41933
- if (cmd.addNewColumns || cmd.force) return CommandResult.Success;
41848
+ if (cmd.addNewColumns || cmd.force) return "Success";
41934
41849
  const selection = this.getters.getSelectedZones()[0];
41935
41850
  const splitted = this.getSplittedCols(selection, cmd.separator);
41936
- if (this.willSplittedColsOverwriteContent(selection, splitted)) return CommandResult.SplitWillOverwriteContent;
41937
- return CommandResult.Success;
41851
+ if (this.willSplittedColsOverwriteContent(selection, splitted)) return "SplitWillOverwriteContent";
41852
+ return "Success";
41938
41853
  }
41939
41854
  checkSeparatorInSelection({ separator }) {
41940
41855
  const cells = this.getters.getSelectedCells();
41941
- for (const cell of cells) if (cell.formattedValue.includes(separator)) return CommandResult.Success;
41942
- return CommandResult.NoSplitSeparatorInSelection;
41856
+ for (const cell of cells) if (cell.formattedValue.includes(separator)) return "Success";
41857
+ return "NoSplitSeparatorInSelection";
41943
41858
  }
41944
41859
  };
41945
41860
 
@@ -41947,6 +41862,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
41947
41862
  //#region src/helpers/clipboard/clipboard_figure_state.ts
41948
41863
  /** State of the clipboard when copying/cutting figures */
41949
41864
  var ClipboardFigureState = class {
41865
+ operation;
41866
+ getters;
41867
+ dispatch;
41950
41868
  sheetId;
41951
41869
  copiedFigure;
41952
41870
  copiedFigureContent;
@@ -41971,12 +41889,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
41971
41889
  }
41972
41890
  }
41973
41891
  isCutAllowed(target) {
41974
- return CommandResult.Success;
41892
+ return "Success";
41975
41893
  }
41976
41894
  isPasteAllowed(target, option) {
41977
- if (target.length === 0) return CommandResult.EmptyTarget;
41978
- if (option?.pasteOption !== void 0) return CommandResult.WrongFigurePasteOption;
41979
- return CommandResult.Success;
41895
+ if (target.length === 0) return "EmptyTarget";
41896
+ if (option?.pasteOption !== void 0) return "WrongFigurePasteOption";
41897
+ return "Success";
41980
41898
  }
41981
41899
  /**
41982
41900
  * Paste the clipboard content in the given target
@@ -42006,7 +41924,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
42006
41924
  this.dispatch("SELECT_FIGURE", { id: newId });
42007
41925
  }
42008
41926
  getClipboardContent() {
42009
- return { [ClipboardMIMEType.PlainText]: " " };
41927
+ return { ["text/plain"]: " " };
42010
41928
  }
42011
41929
  isColRowDirtyingClipboard(position, dimension) {
42012
41930
  return false;
@@ -42014,6 +41932,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
42014
41932
  drawClipboard(renderingContext) {}
42015
41933
  };
42016
41934
  var ClipboardFigureChart = class {
41935
+ dispatch;
41936
+ sheetId;
42017
41937
  copiedChart;
42018
41938
  constructor(dispatch, getters, sheetId, copiedFigureId) {
42019
41939
  this.dispatch = dispatch;
@@ -42034,11 +41954,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
42034
41954
  }
42035
41955
  };
42036
41956
  var ClipboardFigureImage = class {
41957
+ dispatch;
41958
+ sheetId;
42037
41959
  copiedImage;
42038
41960
  constructor(dispatch, getters, sheetId, copiedFigureId) {
42039
41961
  this.dispatch = dispatch;
42040
41962
  this.sheetId = sheetId;
42041
- this.copiedImage = deepCopy(getters.getImage(copiedFigureId));
41963
+ const image = getters.getImage(copiedFigureId);
41964
+ this.copiedImage = deepCopy(image);
42042
41965
  }
42043
41966
  paste(sheetId, figureId, position, size) {
42044
41967
  const copy = deepCopy(this.copiedImage);
@@ -42064,8 +41987,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
42064
41987
  isPasteAllowed(target, clipboardOption) {
42065
41988
  const sheetId = this.getters.getActiveSheetId();
42066
41989
  const pasteZone = this.getPasteZone(target);
42067
- if (this.getters.doesIntersectMerge(sheetId, pasteZone)) return CommandResult.WillRemoveExistingMerge;
42068
- return CommandResult.Success;
41990
+ if (this.getters.doesIntersectMerge(sheetId, pasteZone)) return "WillRemoveExistingMerge";
41991
+ return "Success";
42069
41992
  }
42070
41993
  paste(target, clipboardOption) {
42071
41994
  if (clipboardOption?.pasteOption === "onlyFormat") return;
@@ -42097,7 +42020,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
42097
42020
  }, { scrollIntoView: false });
42098
42021
  }
42099
42022
  getClipboardContent() {
42100
- return { [ClipboardMIMEType.PlainText]: this.values.map((values) => values.join(" ")).join("\n") };
42023
+ return { ["text/plain"]: this.values.map((values) => values.join(" ")).join("\n") };
42101
42024
  }
42102
42025
  getPasteZone(target) {
42103
42026
  const height = this.values.length;
@@ -42121,7 +42044,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
42121
42044
  * application, and with the OS clipboard as well.
42122
42045
  */
42123
42046
  var ClipboardPlugin = class extends UIPlugin {
42124
- static layers = [LAYERS.Clipboard];
42047
+ static layers = [2];
42125
42048
  static getters = [
42126
42049
  "getClipboardContent",
42127
42050
  "getClipboardTextContent",
@@ -42139,18 +42062,18 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
42139
42062
  const zones = this.getters.getSelectedZones();
42140
42063
  return this.getClipboardState(zones, cmd.type).isCutAllowed(zones);
42141
42064
  case "PASTE":
42142
- if (!this.state) return CommandResult.EmptyClipboard;
42065
+ if (!this.state) return "EmptyClipboard";
42143
42066
  const pasteOption = cmd.pasteOption || (this.paintFormatStatus !== "inactive" ? "onlyFormat" : void 0);
42144
42067
  return this.state.isPasteAllowed(cmd.target, { pasteOption });
42145
42068
  case "PASTE_FROM_OS_CLIPBOARD": return new ClipboardOsState(cmd.text, this.getters, this.dispatch, this.selection).isPasteAllowed(cmd.target, { pasteOption: cmd.pasteOption });
42146
42069
  case "COPY_PASTE_CELLS_ABOVE": {
42147
42070
  const zones = this.getters.getSelectedZones();
42148
- if (zones.length > 1 || zones[0].top === 0 && zones[0].bottom === 0) return CommandResult.InvalidCopyPasteSelection;
42071
+ if (zones.length > 1 || zones[0].top === 0 && zones[0].bottom === 0) return "InvalidCopyPasteSelection";
42149
42072
  break;
42150
42073
  }
42151
42074
  case "COPY_PASTE_CELLS_ON_LEFT": {
42152
42075
  const zones = this.getters.getSelectedZones();
42153
- if (zones.length > 1 || zones[0].left === 0 && zones[0].right === 0) return CommandResult.InvalidCopyPasteSelection;
42076
+ if (zones.length > 1 || zones[0].left === 0 && zones[0].right === 0) return "InvalidCopyPasteSelection";
42154
42077
  break;
42155
42078
  }
42156
42079
  case "INSERT_CELL": {
@@ -42161,9 +42084,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
42161
42084
  const { cut, paste } = this.getDeleteCellsTargets(cmd.zone, cmd.shiftDimension);
42162
42085
  return this.getClipboardStateForCopyCells(cut, "CUT", "shiftCells").isPasteAllowed(paste);
42163
42086
  }
42164
- case "ACTIVATE_PAINT_FORMAT": if (this.paintFormatStatus !== "inactive") return CommandResult.AlreadyInPaintingFormatMode;
42087
+ case "ACTIVATE_PAINT_FORMAT": if (this.paintFormatStatus !== "inactive") return "AlreadyInPaintingFormatMode";
42165
42088
  }
42166
- return CommandResult.Success;
42089
+ return "Success";
42167
42090
  }
42168
42091
  handle(cmd) {
42169
42092
  switch (cmd.type) {
@@ -42300,10 +42223,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
42300
42223
  * considered as a copy content.
42301
42224
  */
42302
42225
  getClipboardContent() {
42303
- return this.state?.getClipboardContent() || { [ClipboardMIMEType.PlainText]: " " };
42226
+ return this.state?.getClipboardContent() || { ["text/plain"]: " " };
42304
42227
  }
42305
42228
  getClipboardTextContent() {
42306
- return this.state?.getClipboardContent()[ClipboardMIMEType.PlainText] || " ";
42229
+ return this.state?.getClipboardContent()["text/plain"] || " ";
42307
42230
  }
42308
42231
  isCutOperation() {
42309
42232
  return this.state ? this.state.operation === "CUT" : false;
@@ -42498,10 +42421,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
42498
42421
  }
42499
42422
  break;
42500
42423
  case "STOP_EDITION":
42501
- if (this.mode === "inactive") return CommandResult.Success;
42424
+ if (this.mode === "inactive") return "Success";
42502
42425
  return this.checkDataValidation(cmd);
42503
42426
  }
42504
- return CommandResult.Success;
42427
+ return "Success";
42505
42428
  }
42506
42429
  handleEvent(event) {
42507
42430
  const sheetId = this.getters.getActiveSheetId();
@@ -42684,7 +42607,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
42684
42607
  });
42685
42608
  }
42686
42609
  validateSelection(length, start, end) {
42687
- return start >= 0 && start <= length && end >= 0 && end <= length ? CommandResult.Success : CommandResult.WrongComposerSelection;
42610
+ return start >= 0 && start <= length && end >= 0 && end <= length ? "Success" : "WrongComposerSelection";
42688
42611
  }
42689
42612
  onColumnsRemoved(cmd) {
42690
42613
  if (cmd.elements.includes(this.col) && this.mode !== "inactive") {
@@ -42840,11 +42763,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
42840
42763
  if (cell?.isFormula) return localizeFormula(cell.content, locale);
42841
42764
  const { format, value, type, formattedValue } = this.getters.getEvaluatedCell(position);
42842
42765
  switch (type) {
42843
- case CellValueType.text:
42844
- case CellValueType.empty: return value;
42845
- case CellValueType.boolean: return formattedValue;
42846
- case CellValueType.error: return cell?.content || "";
42847
- case CellValueType.number:
42766
+ case "text":
42767
+ case "empty": return value;
42768
+ case "boolean": return formattedValue;
42769
+ case "error": return cell?.content || "";
42770
+ case "number":
42848
42771
  if (format && isDateTimeFormat(format)) {
42849
42772
  if (parseDateTime(formattedValue, locale) !== null) return formattedValue;
42850
42773
  return formatValue(value, {
@@ -43066,12 +42989,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
43066
42989
  try {
43067
42990
  const content = this.getCurrentCanonicalContent();
43068
42991
  const cellValue = content.startsWith("=") ? this.getters.evaluateFormula(this.sheetId, content) : parseLiteral(content, this.getters.getLocale());
43069
- if (isMatrix(cellValue)) return CommandResult.Success;
42992
+ if (isMatrix(cellValue)) return "Success";
43070
42993
  const validationResult = this.getters.getValidationResultForCellValue(cellValue, cellPosition);
43071
- if (!validationResult.isValid && validationResult.rule.isBlocking) return CommandResult.BlockingValidationRule;
43072
- return CommandResult.Success;
42994
+ if (!validationResult.isValid && validationResult.rule.isBlocking) return "BlockingValidationRule";
42995
+ return "Success";
43073
42996
  } catch (e) {
43074
- return this.getters.getValidationRuleForCell(cellPosition)?.isBlocking ? CommandResult.BlockingValidationRule : CommandResult.Success;
42997
+ return this.getters.getValidationRuleForCell(cellPosition)?.isBlocking ? "BlockingValidationRule" : "Success";
43075
42998
  }
43076
42999
  }
43077
43000
  };
@@ -43091,10 +43014,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
43091
43014
  allowDispatch(cmd) {
43092
43015
  switch (cmd.type) {
43093
43016
  case "UPDATE_FILTER":
43094
- if (!this.getters.getFilterId(cmd)) return CommandResult.FilterNotFound;
43017
+ if (!this.getters.getFilterId(cmd)) return "FilterNotFound";
43095
43018
  break;
43096
43019
  }
43097
- return CommandResult.Success;
43020
+ return "Success";
43098
43021
  }
43099
43022
  handle(cmd) {
43100
43023
  switch (cmd.type) {
@@ -43295,41 +43218,41 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
43295
43218
  const selectionStatisticFunctions = [
43296
43219
  {
43297
43220
  name: _t("Sum"),
43298
- types: [CellValueType.number],
43221
+ types: ["number"],
43299
43222
  compute: (values, locale) => SUM.compute.bind({ locale })([values])
43300
43223
  },
43301
43224
  {
43302
43225
  name: _t("Avg"),
43303
- types: [CellValueType.number],
43226
+ types: ["number"],
43304
43227
  compute: (values, locale) => AVERAGE.compute.bind({ locale })([values])
43305
43228
  },
43306
43229
  {
43307
43230
  name: _t("Min"),
43308
- types: [CellValueType.number],
43231
+ types: ["number"],
43309
43232
  compute: (values, locale) => MIN.compute.bind({ locale })([values])
43310
43233
  },
43311
43234
  {
43312
43235
  name: _t("Max"),
43313
- types: [CellValueType.number],
43236
+ types: ["number"],
43314
43237
  compute: (values, locale) => MAX.compute.bind({ locale })([values])
43315
43238
  },
43316
43239
  {
43317
43240
  name: _t("Count"),
43318
43241
  types: [
43319
- CellValueType.number,
43320
- CellValueType.text,
43321
- CellValueType.boolean,
43322
- CellValueType.error
43242
+ "number",
43243
+ "text",
43244
+ "boolean",
43245
+ "error"
43323
43246
  ],
43324
43247
  compute: (values, locale) => COUNTA.compute.bind({ locale })([values])
43325
43248
  },
43326
43249
  {
43327
43250
  name: _t("Count Numbers"),
43328
43251
  types: [
43329
- CellValueType.number,
43330
- CellValueType.text,
43331
- CellValueType.boolean,
43332
- CellValueType.error
43252
+ "number",
43253
+ "text",
43254
+ "boolean",
43255
+ "error"
43333
43256
  ],
43334
43257
  compute: (values, locale) => COUNT.compute.bind({ locale })([values])
43335
43258
  }
@@ -43338,7 +43261,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
43338
43261
  * SelectionPlugin
43339
43262
  */
43340
43263
  var GridSelectionPlugin = class extends UIPlugin {
43341
- static layers = [LAYERS.Selection];
43264
+ static layers = [6];
43342
43265
  static getters = [
43343
43266
  "getActiveSheet",
43344
43267
  "getActiveSheetId",
@@ -43395,11 +43318,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
43395
43318
  this.getters.getSheet(cmd.sheetIdTo);
43396
43319
  break;
43397
43320
  } catch (error) {
43398
- return CommandResult.InvalidSheetId;
43321
+ return "InvalidSheetId";
43399
43322
  }
43400
43323
  case "MOVE_COLUMNS_ROWS": return this.isMoveElementAllowed(cmd);
43401
43324
  }
43402
- return CommandResult.Success;
43325
+ return "Success";
43403
43326
  }
43404
43327
  handleEvent(event) {
43405
43328
  const anchor = event.anchor;
@@ -43614,7 +43537,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
43614
43537
  col,
43615
43538
  row
43616
43539
  });
43617
- if (evaluatedCell.type !== CellValueType.empty) cells.add(evaluatedCell);
43540
+ if (evaluatedCell.type !== "empty") cells.add(evaluatedCell);
43618
43541
  }
43619
43542
  const cellsTypes = /* @__PURE__ */ new Set();
43620
43543
  const cellsValues = [];
@@ -43642,7 +43565,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
43642
43565
  col,
43643
43566
  row
43644
43567
  });
43645
- if (cell.type === CellValueType.number) {
43568
+ if (cell.type === "number") {
43646
43569
  n++;
43647
43570
  aggregate += cell.value;
43648
43571
  }
@@ -43739,7 +43662,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
43739
43662
  }, [zone]);
43740
43663
  }
43741
43664
  setActiveSheet(id) {
43742
- this.activeSheet = this.getters.getSheet(id);
43665
+ const sheet = this.getters.getSheet(id);
43666
+ this.activeSheet = sheet;
43743
43667
  }
43744
43668
  activateNextSheet(direction) {
43745
43669
  const sheetIds = this.getters.getSheetIds();
@@ -43858,11 +43782,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
43858
43782
  const end = cmd.elements[cmd.elements.length - 1];
43859
43783
  const id = cmd.sheetId;
43860
43784
  const doesElementsHaveCommonMerges = isCol ? this.getters.doesColumnsHaveCommonMerges : this.getters.doesRowsHaveCommonMerges;
43861
- if (doesElementsHaveCommonMerges(id, start - 1, start) || doesElementsHaveCommonMerges(id, end, end + 1) || doesElementsHaveCommonMerges(id, cmd.base - 1, cmd.base)) return CommandResult.WillRemoveExistingMerge;
43785
+ if (doesElementsHaveCommonMerges(id, start - 1, start) || doesElementsHaveCommonMerges(id, end, end + 1) || doesElementsHaveCommonMerges(id, cmd.base - 1, cmd.base)) return "WillRemoveExistingMerge";
43862
43786
  const headers = [cmd.base, ...cmd.elements];
43863
43787
  const maxHeaderValue = isCol ? this.getters.getNumberCols(id) : this.getters.getNumberRows(id);
43864
- if (headers.some((h) => h < 0 || h >= maxHeaderValue)) return CommandResult.InvalidHeaderIndex;
43865
- return CommandResult.Success;
43788
+ if (headers.some((h) => h < 0 || h >= maxHeaderValue)) return "InvalidHeaderIndex";
43789
+ return "Success";
43866
43790
  }
43867
43791
  fallbackToVisibleSheet() {
43868
43792
  if (!this.getters.tryGetSheet(this.getters.getActiveSheetId())) {
@@ -43943,6 +43867,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
43943
43867
  //#endregion
43944
43868
  //#region src/helpers/internal_viewport.ts
43945
43869
  var InternalViewport = class {
43870
+ getters;
43871
+ sheetId;
43872
+ boundaries;
43946
43873
  top;
43947
43874
  bottom;
43948
43875
  left;
@@ -44293,7 +44220,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
44293
44220
  switch (cmd.type) {
44294
44221
  case "SET_VIEWPORT_OFFSET": return this.checkScrollingDirection(cmd);
44295
44222
  case "RESIZE_SHEETVIEW": return this.chainValidations(this.checkValuesAreDifferent, this.checkPositiveDimension)(cmd);
44296
- default: return CommandResult.Success;
44223
+ default: return "Success";
44297
44224
  }
44298
44225
  }
44299
44226
  handleEvent(event) {
@@ -44674,18 +44601,18 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
44674
44601
  return Object.values(this.viewports[sheetId]).filter(isDefined$1);
44675
44602
  }
44676
44603
  checkPositiveDimension(cmd) {
44677
- if (cmd.width < 0 || cmd.height < 0) return CommandResult.InvalidViewportSize;
44678
- return CommandResult.Success;
44604
+ if (cmd.width < 0 || cmd.height < 0) return "InvalidViewportSize";
44605
+ return "Success";
44679
44606
  }
44680
44607
  checkValuesAreDifferent(cmd) {
44681
44608
  const { height, width } = this.getSheetViewDimension();
44682
- if (cmd.gridOffsetX === this.gridOffsetX && cmd.gridOffsetY === this.gridOffsetY && cmd.width === width && cmd.height === height) return CommandResult.ValuesNotChanged;
44683
- return CommandResult.Success;
44609
+ if (cmd.gridOffsetX === this.gridOffsetX && cmd.gridOffsetY === this.gridOffsetY && cmd.width === width && cmd.height === height) return "ValuesNotChanged";
44610
+ return "Success";
44684
44611
  }
44685
44612
  checkScrollingDirection({ offsetX, offsetY }) {
44686
44613
  const pane = this.getMainInternalViewport(this.getters.getActiveSheetId());
44687
- if (!pane.canScrollHorizontally && offsetX > 0 || !pane.canScrollVertically && offsetY > 0) return CommandResult.InvalidScrollingDirection;
44688
- return CommandResult.Success;
44614
+ if (!pane.canScrollHorizontally && offsetX > 0 || !pane.canScrollVertically && offsetY > 0) return "InvalidScrollingDirection";
44615
+ return "Success";
44689
44616
  }
44690
44617
  getMainViewport(sheetId) {
44691
44618
  const viewport = this.getMainInternalViewport(sheetId);
@@ -45279,9 +45206,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
45279
45206
  sheetId,
45280
45207
  name
45281
45208
  });
45282
- if (result.reasons.includes(CommandResult.MissingSheetName)) env.raiseError(_t("The sheet name cannot be empty."), errorCallback);
45283
- else if (result.reasons.includes(CommandResult.DuplicatedSheetName)) env.raiseError(_t("A sheet with the name %s already exists. Please select another name.", name), errorCallback);
45284
- else if (result.reasons.includes(CommandResult.ForbiddenCharactersInSheetName)) env.raiseError(_t("Some used characters are not allowed in a sheet name (Forbidden characters are %s).", FORBIDDEN_SHEET_CHARS.join(" ")), errorCallback);
45209
+ if (result.reasons.includes("MissingSheetName")) env.raiseError(_t("The sheet name cannot be empty."), errorCallback);
45210
+ else if (result.reasons.includes("DuplicatedSheetName")) env.raiseError(_t("A sheet with the name %s already exists. Please select another name.", name), errorCallback);
45211
+ else if (result.reasons.includes("ForbiddenCharactersInSheetName")) env.raiseError(_t("Some used characters are not allowed in a sheet name (Forbidden characters are %s).", FORBIDDEN_SHEET_CHARS.join(" ")), errorCallback);
45285
45212
  }
45286
45213
 
45287
45214
  //#endregion
@@ -45780,7 +45707,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
45780
45707
  canvasPosition;
45781
45708
  hoveredCell;
45782
45709
  setup() {
45783
- this.canvasPosition = useAbsoluteBoundingRect((0, _odoo_owl.useRef)("grid"));
45710
+ const gridRef = (0, _odoo_owl.useRef)("grid");
45711
+ this.canvasPosition = useAbsoluteBoundingRect(gridRef);
45784
45712
  this.hoveredCell = (0, _odoo_owl.useState)({
45785
45713
  col: void 0,
45786
45714
  row: void 0
@@ -45895,7 +45823,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
45895
45823
  css`
45896
45824
  .o-header-group {
45897
45825
  .o-header-group-header {
45898
- z-index: ${ComponentsImportance.HeaderGroupingButton};
45826
+ z-index: ${6};
45899
45827
  .o-group-fold-button {
45900
45828
  cursor: pointer;
45901
45829
  width: 13px;
@@ -46689,7 +46617,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
46689
46617
  });
46690
46618
  return cssPropertiesToCss({
46691
46619
  "border-color": SELECTION_BORDER_COLOR,
46692
- "z-index": String(ComponentsImportance.TopBarComposer)
46620
+ "z-index": String(30)
46693
46621
  });
46694
46622
  }
46695
46623
  };
@@ -46875,7 +46803,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
46875
46803
  overflow-y: auto;
46876
46804
  overflow-x: hidden;
46877
46805
  padding: 2px;
46878
- z-index: ${ComponentsImportance.Dropdown};
46806
+ z-index: ${21};
46879
46807
  box-shadow: 1px 2px 5px 2px rgba(51, 51, 51, 0.15);
46880
46808
  background-color: white;
46881
46809
 
@@ -47013,6 +46941,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
47013
46941
  return new WebClipboardWrapper(navigator.clipboard);
47014
46942
  }
47015
46943
  var WebClipboardWrapper = class {
46944
+ clipboard;
47016
46945
  constructor(clipboard) {
47017
46946
  this.clipboard = clipboard;
47018
46947
  }
@@ -47042,8 +46971,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
47042
46971
  }
47043
46972
  getClipboardItems(content) {
47044
46973
  return [new ClipboardItem({
47045
- [ClipboardMIMEType.PlainText]: this.getBlob(content, ClipboardMIMEType.PlainText),
47046
- [ClipboardMIMEType.Html]: this.getBlob(content, ClipboardMIMEType.Html)
46974
+ ["text/plain"]: this.getBlob(content, "text/plain"),
46975
+ ["text/html"]: this.getBlob(content, "text/html")
47047
46976
  })];
47048
46977
  }
47049
46978
  getBlob(clipboardContent, type) {
@@ -47462,6 +47391,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
47462
47391
  * @param operations initial operations
47463
47392
  */
47464
47393
  var Branch = class Branch {
47394
+ buildTransformation;
47395
+ operations;
47465
47396
  constructor(buildTransformation, operations = []) {
47466
47397
  this.buildTransformation = buildTransformation;
47467
47398
  this.operations = operations;
@@ -47578,6 +47509,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
47578
47509
  * to revert it).
47579
47510
  */
47580
47511
  var Operation = class {
47512
+ id;
47513
+ data;
47581
47514
  constructor(id, data) {
47582
47515
  this.id = id;
47583
47516
  this.data = data;
@@ -47587,6 +47520,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
47587
47520
  }
47588
47521
  };
47589
47522
  var LazyOperation = class LazyOperation {
47523
+ id;
47524
+ lazyData;
47590
47525
  constructor(id, lazyData) {
47591
47526
  this.id = id;
47592
47527
  this.lazyData = lazyData;
@@ -47612,6 +47547,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
47612
47547
  * ```
47613
47548
  */
47614
47549
  var OperationSequence = class OperationSequence {
47550
+ operations;
47615
47551
  constructor(operations) {
47616
47552
  this.operations = operations;
47617
47553
  }
@@ -47687,6 +47623,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
47687
47623
  *
47688
47624
  */
47689
47625
  var Tree = class {
47626
+ buildTransformation;
47690
47627
  branches;
47691
47628
  branchingOperationIds = /* @__PURE__ */ new Map();
47692
47629
  constructor(buildTransformation, initialBranch) {
@@ -48279,6 +48216,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48279
48216
  * with the new selected anchor
48280
48217
  */
48281
48218
  var SelectionStreamProcessorImpl = class {
48219
+ getters;
48282
48220
  stream;
48283
48221
  /**
48284
48222
  * "Active" anchor used as a reference to compute new anchors
@@ -48374,7 +48312,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48374
48312
  * Set the selection to one of the cells adjacent to the current anchor cell.
48375
48313
  */
48376
48314
  moveAnchorCell(direction, step = 1) {
48377
- if (step !== "end" && step <= 0) return new DispatchResult(CommandResult.InvalidSelectionStep);
48315
+ if (step !== "end" && step <= 0) return new DispatchResult("InvalidSelectionStep");
48378
48316
  const { col, row } = this.getNextAvailablePosition(direction, step);
48379
48317
  return this.selectCell(col, row);
48380
48318
  }
@@ -48436,7 +48374,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48436
48374
  * of the anchor zone which moves.
48437
48375
  */
48438
48376
  resizeAnchorZone(direction, step = 1) {
48439
- if (step !== "end" && step <= 0) return new DispatchResult(CommandResult.InvalidSelectionStep);
48377
+ if (step !== "end" && step <= 0) return new DispatchResult("InvalidSelectionStep");
48440
48378
  const sheetId = this.getters.getActiveSheetId();
48441
48379
  const anchor = this.anchor;
48442
48380
  const { col: anchorCol, row: anchorRow } = anchor.cell;
@@ -48682,7 +48620,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48682
48620
  previousAnchor: deepCopy(this.anchor)
48683
48621
  };
48684
48622
  const commandResult = this.checkEventAnchorZone(event);
48685
- if (commandResult !== CommandResult.Success) return new DispatchResult(commandResult);
48623
+ if (commandResult !== "Success") return new DispatchResult(commandResult);
48686
48624
  this.anchor = event.anchor;
48687
48625
  this.stream.send(event);
48688
48626
  return DispatchResult.Success;
@@ -48692,15 +48630,15 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48692
48630
  }
48693
48631
  checkAnchorZone(anchor) {
48694
48632
  const { cell, zone } = anchor;
48695
- if (!isInside(cell.col, cell.row, zone)) return CommandResult.InvalidAnchorZone;
48633
+ if (!isInside(cell.col, cell.row, zone)) return "InvalidAnchorZone";
48696
48634
  const { left, right, top, bottom } = zone;
48697
48635
  const sheetId = this.getters.getActiveSheetId();
48698
48636
  const refCol = this.getters.findVisibleHeader(sheetId, "COL", left, right);
48699
- if (this.getters.findVisibleHeader(sheetId, "ROW", top, bottom) === void 0 || refCol === void 0) return CommandResult.SelectionOutOfBound;
48700
- return CommandResult.Success;
48637
+ if (this.getters.findVisibleHeader(sheetId, "ROW", top, bottom) === void 0 || refCol === void 0) return "SelectionOutOfBound";
48638
+ return "Success";
48701
48639
  }
48702
48640
  checkAnchorZoneOrThrow(anchor) {
48703
- if (this.checkAnchorZone(anchor) === CommandResult.InvalidAnchorZone) throw new Error(_t("The provided anchor is invalid. The cell must be part of the zone."));
48641
+ if (this.checkAnchorZone(anchor) === "InvalidAnchorZone") throw new Error(_t("The provided anchor is invalid. The cell must be part of the zone."));
48704
48642
  }
48705
48643
  /**
48706
48644
  * ---- PRIVATE ----
@@ -48850,7 +48788,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48850
48788
  col,
48851
48789
  row
48852
48790
  });
48853
- return this.getters.getEvaluatedCell(position).type === CellValueType.empty;
48791
+ return this.getters.getEvaluatedCell(position).type === "empty";
48854
48792
  }
48855
48793
  /** Computes the next cell position in the given direction by crossing through merges and skipping hidden cells.
48856
48794
  *
@@ -49357,7 +49295,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
49357
49295
  return ast;
49358
49296
  });
49359
49297
  ast = convertAstNodes(ast, "REFERENCE", (ast) => {
49360
- return ast.value === CellErrorType.InvalidReference ? {
49298
+ return ast.value === "#REF" ? {
49361
49299
  ...ast,
49362
49300
  value: "#REF!"
49363
49301
  } : ast;
@@ -49365,7 +49303,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
49365
49303
  return ast ? astToFormula(ast) : formulaText;
49366
49304
  }
49367
49305
  function adaptFormulaValueToExcel(formulaValue) {
49368
- return formulaValue === CellErrorType.InvalidReference ? "#REF!" : formulaValue;
49306
+ return formulaValue === "#REF" ? "#REF!" : formulaValue;
49369
49307
  }
49370
49308
  /**
49371
49309
  * Some Excel function need required args that might not be mandatory in o-spreadsheet.
@@ -50416,13 +50354,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
50416
50354
 
50417
50355
  //#endregion
50418
50356
  //#region src/model.ts
50419
- var Status = /* @__PURE__ */ function(Status) {
50420
- Status[Status["Ready"] = 0] = "Ready";
50421
- Status[Status["Running"] = 1] = "Running";
50422
- Status[Status["RunningCore"] = 2] = "RunningCore";
50423
- Status[Status["Finalizing"] = 3] = "Finalizing";
50424
- return Status;
50425
- }(Status || {});
50426
50357
  var Model = class extends EventBus {
50427
50358
  corePlugins = [];
50428
50359
  featurePlugins = [];
@@ -50446,7 +50377,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
50446
50377
  /**
50447
50378
  * Internal status of the model. Important for command handling coordination
50448
50379
  */
50449
- status = Status.Ready;
50380
+ status = 0;
50450
50381
  /**
50451
50382
  * The config object contains some configuration flag and callbacks
50452
50383
  */
@@ -50571,7 +50502,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
50571
50502
  onRemoteRevisionReceived({ commands }) {
50572
50503
  for (const command of commands) {
50573
50504
  const previousStatus = this.status;
50574
- this.status = Status.RunningCore;
50505
+ this.status = 2;
50575
50506
  this.dispatchToHandlers(this.statefulUIPlugins, command);
50576
50507
  this.status = previousStatus;
50577
50508
  }
@@ -50665,7 +50596,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
50665
50596
  */
50666
50597
  checkDispatchAllowed(command) {
50667
50598
  const results = isCoreCommand(command) ? this.checkDispatchAllowedCoreCommand(command) : this.checkDispatchAllowedLocalCommand(command);
50668
- if (results.some((r) => r !== CommandResult.Success)) return new DispatchResult(results.flat());
50599
+ if (results.some((r) => r !== "Success")) return new DispatchResult(results.flat());
50669
50600
  return DispatchResult.Success;
50670
50601
  }
50671
50602
  checkDispatchAllowedCoreCommand(command) {
@@ -50677,9 +50608,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
50677
50608
  return this.uiHandlers.map((handler) => handler.allowDispatch(command));
50678
50609
  }
50679
50610
  finalize() {
50680
- this.status = Status.Finalizing;
50611
+ this.status = 3;
50681
50612
  for (const h of this.handlers) h.finalize();
50682
- this.status = Status.Ready;
50613
+ this.status = 0;
50683
50614
  }
50684
50615
  /**
50685
50616
  * Check if a command can be dispatched, and returns a DispatchResult object with the possible
@@ -50705,23 +50636,23 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
50705
50636
  dispatch = (type, payload) => {
50706
50637
  const command = createCommand(type, payload);
50707
50638
  const status = this.status;
50708
- if (this.getters.isReadonly() && !canExecuteInReadonly(command)) return new DispatchResult(CommandResult.Readonly);
50709
- if (!this.session.canApplyOptimisticUpdate()) return new DispatchResult(CommandResult.WaitingSessionConfirmation);
50639
+ if (this.getters.isReadonly() && !canExecuteInReadonly(command)) return new DispatchResult("Readonly");
50640
+ if (!this.session.canApplyOptimisticUpdate()) return new DispatchResult("WaitingSessionConfirmation");
50710
50641
  switch (status) {
50711
- case Status.Ready:
50642
+ case 0:
50712
50643
  const result = this.checkDispatchAllowed(command);
50713
50644
  if (!result.isSuccessful) return result;
50714
- this.status = Status.Running;
50645
+ this.status = 1;
50715
50646
  const { changes, commands } = this.state.recordChanges(() => {
50716
50647
  if (isCoreCommand(command)) this.state.addCommand(command);
50717
50648
  this.dispatchToHandlers(this.handlers, command);
50718
50649
  this.finalize();
50719
50650
  });
50720
50651
  this.session.save(command, commands, changes);
50721
- this.status = Status.Ready;
50652
+ this.status = 0;
50722
50653
  this.trigger("update");
50723
50654
  break;
50724
- case Status.Running:
50655
+ case 1:
50725
50656
  if (isCoreCommand(command)) {
50726
50657
  const dispatchResult = this.checkDispatchAllowed(command);
50727
50658
  if (!dispatchResult.isSuccessful) return dispatchResult;
@@ -50729,8 +50660,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
50729
50660
  }
50730
50661
  this.dispatchToHandlers(this.handlers, command);
50731
50662
  break;
50732
- case Status.Finalizing: throw new Error("Cannot dispatch commands in the finalize state");
50733
- case Status.RunningCore:
50663
+ case 3: throw new Error("Cannot dispatch commands in the finalize state");
50664
+ case 2:
50734
50665
  if (isCoreCommand(command)) throw new Error(`A UI plugin cannot dispatch ${type} while handling a core command`);
50735
50666
  this.dispatchToHandlers(this.handlers, command);
50736
50667
  }
@@ -50743,7 +50674,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
50743
50674
  dispatchFromCorePlugin = (type, payload) => {
50744
50675
  const command = createCommand(type, payload);
50745
50676
  const previousStatus = this.status;
50746
- this.status = Status.RunningCore;
50677
+ this.status = 2;
50747
50678
  const handlers = this.isReplayingCommand ? this.coreHandlers : this.handlers;
50748
50679
  this.dispatchToHandlers(handlers, command);
50749
50680
  this.status = previousStatus;
@@ -50982,8 +50913,8 @@ exports.setDefaultSheetViewSize = setDefaultSheetViewSize;
50982
50913
  exports.setTranslationMethod = setTranslationMethod;
50983
50914
  exports.tokenize = tokenize;
50984
50915
 
50985
- __info__.version = "17.0.98";
50986
- __info__.date = "2026-05-12T12:15:04.723Z";
50987
- __info__.hash = "ce2a580";
50916
+ __info__.version = "17.0.99";
50917
+ __info__.date = "2026-05-27T05:56:40.513Z";
50918
+ __info__.hash = "54d8c62";
50988
50919
 
50989
50920
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);