@odoo/o-spreadsheet 16.4.18 → 16.4.20

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.
@@ -448,7 +448,7 @@
448
448
  const upperCased = str.toUpperCase();
449
449
  return upperCased === "TRUE" || upperCased === "FALSE";
450
450
  }
451
- const MARKDOWN_LINK_REGEX = /^\[([^\[]+)\]\((.+)\)$/;
451
+ const MARKDOWN_LINK_REGEX = /^\[(.+)\]\((.+)\)$/;
452
452
  //link must start with http or https
453
453
  //https://stackoverflow.com/a/3809435/4760614
454
454
  const WEB_LINK_REGEX = /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/;
@@ -2216,27 +2216,30 @@
2216
2216
  }
2217
2217
  function createLargeNumberFormat(format, magnitude, postFix, locale) {
2218
2218
  const internalFormat = parseFormat(format || "#,##0");
2219
- const largeNumberFormat = internalFormat
2220
- .map((formatPart) => {
2221
- if (formatPart.type === "NUMBER") {
2222
- return [
2223
- {
2224
- ...formatPart,
2225
- format: {
2226
- ...formatPart.format,
2227
- magnitude,
2228
- decimalPart: undefined,
2229
- },
2230
- },
2231
- {
2232
- type: "STRING",
2233
- format: postFix,
2234
- },
2235
- ];
2219
+ const largeNumberFormat = [];
2220
+ for (let i = 0; i < internalFormat.length; i++) {
2221
+ const formatPart = internalFormat[i];
2222
+ if (formatPart.type !== "NUMBER") {
2223
+ largeNumberFormat.push(formatPart);
2224
+ continue;
2236
2225
  }
2237
- return formatPart;
2238
- })
2239
- .flat();
2226
+ largeNumberFormat.push({
2227
+ ...formatPart,
2228
+ format: {
2229
+ ...formatPart.format,
2230
+ magnitude,
2231
+ decimalPart: undefined,
2232
+ },
2233
+ });
2234
+ largeNumberFormat.push({
2235
+ type: "STRING",
2236
+ format: postFix,
2237
+ });
2238
+ const nextFormatPart = internalFormat[i + 1];
2239
+ if (nextFormatPart?.type === "STRING" && ["k", "m", "b"].includes(nextFormatPart.format)) {
2240
+ i++;
2241
+ }
2242
+ }
2240
2243
  return convertInternalFormatToFormat(largeNumberFormat);
2241
2244
  }
2242
2245
  function changeDecimalPlaces(format, step, locale) {
@@ -4255,71 +4258,72 @@
4255
4258
  CommandResult[CommandResult["InputAlreadyFocused"] = 30] = "InputAlreadyFocused";
4256
4259
  CommandResult[CommandResult["MaximumRangesReached"] = 31] = "MaximumRangesReached";
4257
4260
  CommandResult[CommandResult["MinimumRangesReached"] = 32] = "MinimumRangesReached";
4258
- CommandResult[CommandResult["InvalidChartDefinition"] = 33] = "InvalidChartDefinition";
4259
- CommandResult[CommandResult["InvalidDataSet"] = 34] = "InvalidDataSet";
4260
- CommandResult[CommandResult["InvalidLabelRange"] = 35] = "InvalidLabelRange";
4261
- CommandResult[CommandResult["InvalidScorecardKeyValue"] = 36] = "InvalidScorecardKeyValue";
4262
- CommandResult[CommandResult["InvalidScorecardBaseline"] = 37] = "InvalidScorecardBaseline";
4263
- CommandResult[CommandResult["InvalidGaugeDataRange"] = 38] = "InvalidGaugeDataRange";
4264
- CommandResult[CommandResult["EmptyGaugeRangeMin"] = 39] = "EmptyGaugeRangeMin";
4265
- CommandResult[CommandResult["GaugeRangeMinNaN"] = 40] = "GaugeRangeMinNaN";
4266
- CommandResult[CommandResult["EmptyGaugeRangeMax"] = 41] = "EmptyGaugeRangeMax";
4267
- CommandResult[CommandResult["GaugeRangeMaxNaN"] = 42] = "GaugeRangeMaxNaN";
4268
- CommandResult[CommandResult["GaugeRangeMinBiggerThanRangeMax"] = 43] = "GaugeRangeMinBiggerThanRangeMax";
4269
- CommandResult[CommandResult["GaugeLowerInflectionPointNaN"] = 44] = "GaugeLowerInflectionPointNaN";
4270
- CommandResult[CommandResult["GaugeUpperInflectionPointNaN"] = 45] = "GaugeUpperInflectionPointNaN";
4271
- CommandResult[CommandResult["GaugeLowerBiggerThanUpper"] = 46] = "GaugeLowerBiggerThanUpper";
4272
- CommandResult[CommandResult["InvalidAutofillSelection"] = 47] = "InvalidAutofillSelection";
4273
- CommandResult[CommandResult["WrongComposerSelection"] = 48] = "WrongComposerSelection";
4274
- CommandResult[CommandResult["MinBiggerThanMax"] = 49] = "MinBiggerThanMax";
4275
- CommandResult[CommandResult["LowerBiggerThanUpper"] = 50] = "LowerBiggerThanUpper";
4276
- CommandResult[CommandResult["MidBiggerThanMax"] = 51] = "MidBiggerThanMax";
4277
- CommandResult[CommandResult["MinBiggerThanMid"] = 52] = "MinBiggerThanMid";
4278
- CommandResult[CommandResult["FirstArgMissing"] = 53] = "FirstArgMissing";
4279
- CommandResult[CommandResult["SecondArgMissing"] = 54] = "SecondArgMissing";
4280
- CommandResult[CommandResult["MinNaN"] = 55] = "MinNaN";
4281
- CommandResult[CommandResult["MidNaN"] = 56] = "MidNaN";
4282
- CommandResult[CommandResult["MaxNaN"] = 57] = "MaxNaN";
4283
- CommandResult[CommandResult["ValueUpperInflectionNaN"] = 58] = "ValueUpperInflectionNaN";
4284
- CommandResult[CommandResult["ValueLowerInflectionNaN"] = 59] = "ValueLowerInflectionNaN";
4285
- CommandResult[CommandResult["MinInvalidFormula"] = 60] = "MinInvalidFormula";
4286
- CommandResult[CommandResult["MidInvalidFormula"] = 61] = "MidInvalidFormula";
4287
- CommandResult[CommandResult["MaxInvalidFormula"] = 62] = "MaxInvalidFormula";
4288
- CommandResult[CommandResult["ValueUpperInvalidFormula"] = 63] = "ValueUpperInvalidFormula";
4289
- CommandResult[CommandResult["ValueLowerInvalidFormula"] = 64] = "ValueLowerInvalidFormula";
4290
- CommandResult[CommandResult["InvalidSortZone"] = 65] = "InvalidSortZone";
4291
- CommandResult[CommandResult["WaitingSessionConfirmation"] = 66] = "WaitingSessionConfirmation";
4292
- CommandResult[CommandResult["MergeOverlap"] = 67] = "MergeOverlap";
4293
- CommandResult[CommandResult["TooManyHiddenElements"] = 68] = "TooManyHiddenElements";
4294
- CommandResult[CommandResult["Readonly"] = 69] = "Readonly";
4295
- CommandResult[CommandResult["InvalidViewportSize"] = 70] = "InvalidViewportSize";
4296
- CommandResult[CommandResult["InvalidScrollingDirection"] = 71] = "InvalidScrollingDirection";
4297
- CommandResult[CommandResult["FigureDoesNotExist"] = 72] = "FigureDoesNotExist";
4298
- CommandResult[CommandResult["InvalidConditionalFormatId"] = 73] = "InvalidConditionalFormatId";
4299
- CommandResult[CommandResult["InvalidCellPopover"] = 74] = "InvalidCellPopover";
4300
- CommandResult[CommandResult["EmptyTarget"] = 75] = "EmptyTarget";
4301
- CommandResult[CommandResult["InvalidFreezeQuantity"] = 76] = "InvalidFreezeQuantity";
4302
- CommandResult[CommandResult["FrozenPaneOverlap"] = 77] = "FrozenPaneOverlap";
4303
- CommandResult[CommandResult["ValuesNotChanged"] = 78] = "ValuesNotChanged";
4304
- CommandResult[CommandResult["InvalidFilterZone"] = 79] = "InvalidFilterZone";
4305
- CommandResult[CommandResult["FilterOverlap"] = 80] = "FilterOverlap";
4306
- CommandResult[CommandResult["FilterNotFound"] = 81] = "FilterNotFound";
4307
- CommandResult[CommandResult["MergeInFilter"] = 82] = "MergeInFilter";
4308
- CommandResult[CommandResult["NonContinuousTargets"] = 83] = "NonContinuousTargets";
4309
- CommandResult[CommandResult["DuplicatedFigureId"] = 84] = "DuplicatedFigureId";
4310
- CommandResult[CommandResult["InvalidSelectionStep"] = 85] = "InvalidSelectionStep";
4311
- CommandResult[CommandResult["DuplicatedChartId"] = 86] = "DuplicatedChartId";
4312
- CommandResult[CommandResult["ChartDoesNotExist"] = 87] = "ChartDoesNotExist";
4313
- CommandResult[CommandResult["InvalidHeaderIndex"] = 88] = "InvalidHeaderIndex";
4314
- CommandResult[CommandResult["InvalidQuantity"] = 89] = "InvalidQuantity";
4315
- CommandResult[CommandResult["MoreThanOneColumnSelected"] = 90] = "MoreThanOneColumnSelected";
4316
- CommandResult[CommandResult["EmptySplitSeparator"] = 91] = "EmptySplitSeparator";
4317
- CommandResult[CommandResult["SplitWillOverwriteContent"] = 92] = "SplitWillOverwriteContent";
4318
- CommandResult[CommandResult["NoSplitSeparatorInSelection"] = 93] = "NoSplitSeparatorInSelection";
4319
- CommandResult[CommandResult["NoActiveSheet"] = 94] = "NoActiveSheet";
4320
- CommandResult[CommandResult["InvalidLocale"] = 95] = "InvalidLocale";
4321
- CommandResult[CommandResult["AlreadyInPaintingFormatMode"] = 96] = "AlreadyInPaintingFormatMode";
4322
- CommandResult[CommandResult["NoChanges"] = 97] = "NoChanges";
4261
+ CommandResult[CommandResult["InvalidInputId"] = 33] = "InvalidInputId";
4262
+ CommandResult[CommandResult["InvalidChartDefinition"] = 34] = "InvalidChartDefinition";
4263
+ CommandResult[CommandResult["InvalidDataSet"] = 35] = "InvalidDataSet";
4264
+ CommandResult[CommandResult["InvalidLabelRange"] = 36] = "InvalidLabelRange";
4265
+ CommandResult[CommandResult["InvalidScorecardKeyValue"] = 37] = "InvalidScorecardKeyValue";
4266
+ CommandResult[CommandResult["InvalidScorecardBaseline"] = 38] = "InvalidScorecardBaseline";
4267
+ CommandResult[CommandResult["InvalidGaugeDataRange"] = 39] = "InvalidGaugeDataRange";
4268
+ CommandResult[CommandResult["EmptyGaugeRangeMin"] = 40] = "EmptyGaugeRangeMin";
4269
+ CommandResult[CommandResult["GaugeRangeMinNaN"] = 41] = "GaugeRangeMinNaN";
4270
+ CommandResult[CommandResult["EmptyGaugeRangeMax"] = 42] = "EmptyGaugeRangeMax";
4271
+ CommandResult[CommandResult["GaugeRangeMaxNaN"] = 43] = "GaugeRangeMaxNaN";
4272
+ CommandResult[CommandResult["GaugeRangeMinBiggerThanRangeMax"] = 44] = "GaugeRangeMinBiggerThanRangeMax";
4273
+ CommandResult[CommandResult["GaugeLowerInflectionPointNaN"] = 45] = "GaugeLowerInflectionPointNaN";
4274
+ CommandResult[CommandResult["GaugeUpperInflectionPointNaN"] = 46] = "GaugeUpperInflectionPointNaN";
4275
+ CommandResult[CommandResult["GaugeLowerBiggerThanUpper"] = 47] = "GaugeLowerBiggerThanUpper";
4276
+ CommandResult[CommandResult["InvalidAutofillSelection"] = 48] = "InvalidAutofillSelection";
4277
+ CommandResult[CommandResult["WrongComposerSelection"] = 49] = "WrongComposerSelection";
4278
+ CommandResult[CommandResult["MinBiggerThanMax"] = 50] = "MinBiggerThanMax";
4279
+ CommandResult[CommandResult["LowerBiggerThanUpper"] = 51] = "LowerBiggerThanUpper";
4280
+ CommandResult[CommandResult["MidBiggerThanMax"] = 52] = "MidBiggerThanMax";
4281
+ CommandResult[CommandResult["MinBiggerThanMid"] = 53] = "MinBiggerThanMid";
4282
+ CommandResult[CommandResult["FirstArgMissing"] = 54] = "FirstArgMissing";
4283
+ CommandResult[CommandResult["SecondArgMissing"] = 55] = "SecondArgMissing";
4284
+ CommandResult[CommandResult["MinNaN"] = 56] = "MinNaN";
4285
+ CommandResult[CommandResult["MidNaN"] = 57] = "MidNaN";
4286
+ CommandResult[CommandResult["MaxNaN"] = 58] = "MaxNaN";
4287
+ CommandResult[CommandResult["ValueUpperInflectionNaN"] = 59] = "ValueUpperInflectionNaN";
4288
+ CommandResult[CommandResult["ValueLowerInflectionNaN"] = 60] = "ValueLowerInflectionNaN";
4289
+ CommandResult[CommandResult["MinInvalidFormula"] = 61] = "MinInvalidFormula";
4290
+ CommandResult[CommandResult["MidInvalidFormula"] = 62] = "MidInvalidFormula";
4291
+ CommandResult[CommandResult["MaxInvalidFormula"] = 63] = "MaxInvalidFormula";
4292
+ CommandResult[CommandResult["ValueUpperInvalidFormula"] = 64] = "ValueUpperInvalidFormula";
4293
+ CommandResult[CommandResult["ValueLowerInvalidFormula"] = 65] = "ValueLowerInvalidFormula";
4294
+ CommandResult[CommandResult["InvalidSortZone"] = 66] = "InvalidSortZone";
4295
+ CommandResult[CommandResult["WaitingSessionConfirmation"] = 67] = "WaitingSessionConfirmation";
4296
+ CommandResult[CommandResult["MergeOverlap"] = 68] = "MergeOverlap";
4297
+ CommandResult[CommandResult["TooManyHiddenElements"] = 69] = "TooManyHiddenElements";
4298
+ CommandResult[CommandResult["Readonly"] = 70] = "Readonly";
4299
+ CommandResult[CommandResult["InvalidViewportSize"] = 71] = "InvalidViewportSize";
4300
+ CommandResult[CommandResult["InvalidScrollingDirection"] = 72] = "InvalidScrollingDirection";
4301
+ CommandResult[CommandResult["FigureDoesNotExist"] = 73] = "FigureDoesNotExist";
4302
+ CommandResult[CommandResult["InvalidConditionalFormatId"] = 74] = "InvalidConditionalFormatId";
4303
+ CommandResult[CommandResult["InvalidCellPopover"] = 75] = "InvalidCellPopover";
4304
+ CommandResult[CommandResult["EmptyTarget"] = 76] = "EmptyTarget";
4305
+ CommandResult[CommandResult["InvalidFreezeQuantity"] = 77] = "InvalidFreezeQuantity";
4306
+ CommandResult[CommandResult["FrozenPaneOverlap"] = 78] = "FrozenPaneOverlap";
4307
+ CommandResult[CommandResult["ValuesNotChanged"] = 79] = "ValuesNotChanged";
4308
+ CommandResult[CommandResult["InvalidFilterZone"] = 80] = "InvalidFilterZone";
4309
+ CommandResult[CommandResult["FilterOverlap"] = 81] = "FilterOverlap";
4310
+ CommandResult[CommandResult["FilterNotFound"] = 82] = "FilterNotFound";
4311
+ CommandResult[CommandResult["MergeInFilter"] = 83] = "MergeInFilter";
4312
+ CommandResult[CommandResult["NonContinuousTargets"] = 84] = "NonContinuousTargets";
4313
+ CommandResult[CommandResult["DuplicatedFigureId"] = 85] = "DuplicatedFigureId";
4314
+ CommandResult[CommandResult["InvalidSelectionStep"] = 86] = "InvalidSelectionStep";
4315
+ CommandResult[CommandResult["DuplicatedChartId"] = 87] = "DuplicatedChartId";
4316
+ CommandResult[CommandResult["ChartDoesNotExist"] = 88] = "ChartDoesNotExist";
4317
+ CommandResult[CommandResult["InvalidHeaderIndex"] = 89] = "InvalidHeaderIndex";
4318
+ CommandResult[CommandResult["InvalidQuantity"] = 90] = "InvalidQuantity";
4319
+ CommandResult[CommandResult["MoreThanOneColumnSelected"] = 91] = "MoreThanOneColumnSelected";
4320
+ CommandResult[CommandResult["EmptySplitSeparator"] = 92] = "EmptySplitSeparator";
4321
+ CommandResult[CommandResult["SplitWillOverwriteContent"] = 93] = "SplitWillOverwriteContent";
4322
+ CommandResult[CommandResult["NoSplitSeparatorInSelection"] = 94] = "NoSplitSeparatorInSelection";
4323
+ CommandResult[CommandResult["NoActiveSheet"] = 95] = "NoActiveSheet";
4324
+ CommandResult[CommandResult["InvalidLocale"] = 96] = "InvalidLocale";
4325
+ CommandResult[CommandResult["AlreadyInPaintingFormatMode"] = 97] = "AlreadyInPaintingFormatMode";
4326
+ CommandResult[CommandResult["NoChanges"] = 98] = "NoChanges";
4323
4327
  })(exports.CommandResult || (exports.CommandResult = {}));
4324
4328
 
4325
4329
  const borderStyles = ["thin", "medium", "thick", "dashed", "dotted"];
@@ -16104,11 +16108,11 @@
16104
16108
  if (definition.dataSets) {
16105
16109
  const invalidRanges = definition.dataSets.find((range) => !rangeReference.test(range)) !== undefined;
16106
16110
  if (invalidRanges) {
16107
- return 34 /* CommandResult.InvalidDataSet */;
16111
+ return 35 /* CommandResult.InvalidDataSet */;
16108
16112
  }
16109
16113
  const zones = definition.dataSets.map(toUnboundedZone);
16110
16114
  if (zones.some((zone) => zone.top !== zone.bottom && isFullRow(zone))) {
16111
- return 34 /* CommandResult.InvalidDataSet */;
16115
+ return 35 /* CommandResult.InvalidDataSet */;
16112
16116
  }
16113
16117
  }
16114
16118
  return 0 /* CommandResult.Success */;
@@ -16117,7 +16121,7 @@
16117
16121
  if (definition.labelRange) {
16118
16122
  const invalidLabels = !rangeReference.test(definition.labelRange || "");
16119
16123
  if (invalidLabels) {
16120
- return 35 /* CommandResult.InvalidLabelRange */;
16124
+ return 36 /* CommandResult.InvalidLabelRange */;
16121
16125
  }
16122
16126
  }
16123
16127
  return 0 /* CommandResult.Success */;
@@ -16204,22 +16208,22 @@
16204
16208
  const CfTerms = {
16205
16209
  Errors: {
16206
16210
  [26 /* CommandResult.InvalidRange */]: _lt("The range is invalid"),
16207
- [53 /* CommandResult.FirstArgMissing */]: _lt("The argument is missing. Please provide a value"),
16208
- [54 /* CommandResult.SecondArgMissing */]: _lt("The second argument is missing. Please provide a value"),
16209
- [55 /* CommandResult.MinNaN */]: _lt("The minpoint must be a number"),
16210
- [56 /* CommandResult.MidNaN */]: _lt("The midpoint must be a number"),
16211
- [57 /* CommandResult.MaxNaN */]: _lt("The maxpoint must be a number"),
16212
- [58 /* CommandResult.ValueUpperInflectionNaN */]: _lt("The first value must be a number"),
16213
- [59 /* CommandResult.ValueLowerInflectionNaN */]: _lt("The second value must be a number"),
16214
- [49 /* CommandResult.MinBiggerThanMax */]: _lt("Minimum must be smaller then Maximum"),
16215
- [52 /* CommandResult.MinBiggerThanMid */]: _lt("Minimum must be smaller then Midpoint"),
16216
- [51 /* CommandResult.MidBiggerThanMax */]: _lt("Midpoint must be smaller then Maximum"),
16217
- [50 /* CommandResult.LowerBiggerThanUpper */]: _lt("Lower inflection point must be smaller than upper inflection point"),
16218
- [60 /* CommandResult.MinInvalidFormula */]: _lt("Invalid Minpoint formula"),
16219
- [62 /* CommandResult.MaxInvalidFormula */]: _lt("Invalid Maxpoint formula"),
16220
- [61 /* CommandResult.MidInvalidFormula */]: _lt("Invalid Midpoint formula"),
16221
- [63 /* CommandResult.ValueUpperInvalidFormula */]: _lt("Invalid upper inflection point formula"),
16222
- [64 /* CommandResult.ValueLowerInvalidFormula */]: _lt("Invalid lower inflection point formula"),
16211
+ [54 /* CommandResult.FirstArgMissing */]: _lt("The argument is missing. Please provide a value"),
16212
+ [55 /* CommandResult.SecondArgMissing */]: _lt("The second argument is missing. Please provide a value"),
16213
+ [56 /* CommandResult.MinNaN */]: _lt("The minpoint must be a number"),
16214
+ [57 /* CommandResult.MidNaN */]: _lt("The midpoint must be a number"),
16215
+ [58 /* CommandResult.MaxNaN */]: _lt("The maxpoint must be a number"),
16216
+ [59 /* CommandResult.ValueUpperInflectionNaN */]: _lt("The first value must be a number"),
16217
+ [60 /* CommandResult.ValueLowerInflectionNaN */]: _lt("The second value must be a number"),
16218
+ [50 /* CommandResult.MinBiggerThanMax */]: _lt("Minimum must be smaller then Maximum"),
16219
+ [53 /* CommandResult.MinBiggerThanMid */]: _lt("Minimum must be smaller then Midpoint"),
16220
+ [52 /* CommandResult.MidBiggerThanMax */]: _lt("Midpoint must be smaller then Maximum"),
16221
+ [51 /* CommandResult.LowerBiggerThanUpper */]: _lt("Lower inflection point must be smaller than upper inflection point"),
16222
+ [61 /* CommandResult.MinInvalidFormula */]: _lt("Invalid Minpoint formula"),
16223
+ [63 /* CommandResult.MaxInvalidFormula */]: _lt("Invalid Maxpoint formula"),
16224
+ [62 /* CommandResult.MidInvalidFormula */]: _lt("Invalid Midpoint formula"),
16225
+ [64 /* CommandResult.ValueUpperInvalidFormula */]: _lt("Invalid upper inflection point formula"),
16226
+ [65 /* CommandResult.ValueLowerInvalidFormula */]: _lt("Invalid lower inflection point formula"),
16223
16227
  [25 /* CommandResult.EmptyRange */]: _lt("A range needs to be defined"),
16224
16228
  Unexpected: _lt("The rule is invalid for an unknown reason"),
16225
16229
  },
@@ -16247,20 +16251,20 @@
16247
16251
  Errors: {
16248
16252
  Unexpected: _lt("The chart definition is invalid for an unknown reason"),
16249
16253
  // BASIC CHART ERRORS (LINE | BAR | PIE)
16250
- [34 /* CommandResult.InvalidDataSet */]: _lt("The dataset is invalid"),
16251
- [35 /* CommandResult.InvalidLabelRange */]: _lt("Labels are invalid"),
16254
+ [35 /* CommandResult.InvalidDataSet */]: _lt("The dataset is invalid"),
16255
+ [36 /* CommandResult.InvalidLabelRange */]: _lt("Labels are invalid"),
16252
16256
  // SCORECARD CHART ERRORS
16253
- [36 /* CommandResult.InvalidScorecardKeyValue */]: _lt("The key value is invalid"),
16254
- [37 /* CommandResult.InvalidScorecardBaseline */]: _lt("The baseline value is invalid"),
16257
+ [37 /* CommandResult.InvalidScorecardKeyValue */]: _lt("The key value is invalid"),
16258
+ [38 /* CommandResult.InvalidScorecardBaseline */]: _lt("The baseline value is invalid"),
16255
16259
  // GAUGE CHART ERRORS
16256
- [38 /* CommandResult.InvalidGaugeDataRange */]: _lt("The data range is invalid"),
16257
- [39 /* CommandResult.EmptyGaugeRangeMin */]: _lt("A minimum range limit value is needed"),
16258
- [40 /* CommandResult.GaugeRangeMinNaN */]: _lt("The minimum range limit value must be a number"),
16259
- [41 /* CommandResult.EmptyGaugeRangeMax */]: _lt("A maximum range limit value is needed"),
16260
- [42 /* CommandResult.GaugeRangeMaxNaN */]: _lt("The maximum range limit value must be a number"),
16261
- [43 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */]: _lt("Minimum range limit must be smaller than maximum range limit"),
16262
- [44 /* CommandResult.GaugeLowerInflectionPointNaN */]: _lt("The lower inflection point value must be a number"),
16263
- [45 /* CommandResult.GaugeUpperInflectionPointNaN */]: _lt("The upper inflection point value must be a number"),
16260
+ [39 /* CommandResult.InvalidGaugeDataRange */]: _lt("The data range is invalid"),
16261
+ [40 /* CommandResult.EmptyGaugeRangeMin */]: _lt("A minimum range limit value is needed"),
16262
+ [41 /* CommandResult.GaugeRangeMinNaN */]: _lt("The minimum range limit value must be a number"),
16263
+ [42 /* CommandResult.EmptyGaugeRangeMax */]: _lt("A maximum range limit value is needed"),
16264
+ [43 /* CommandResult.GaugeRangeMaxNaN */]: _lt("The maximum range limit value must be a number"),
16265
+ [44 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */]: _lt("Minimum range limit must be smaller than maximum range limit"),
16266
+ [45 /* CommandResult.GaugeLowerInflectionPointNaN */]: _lt("The lower inflection point value must be a number"),
16267
+ [46 /* CommandResult.GaugeUpperInflectionPointNaN */]: _lt("The upper inflection point value must be a number"),
16264
16268
  },
16265
16269
  };
16266
16270
  const CustomCurrencyTerms = {
@@ -16270,9 +16274,9 @@
16270
16274
  const SplitToColumnsTerms = {
16271
16275
  Errors: {
16272
16276
  Unexpected: _lt("Cannot split the selection for an unknown reason"),
16273
- [93 /* CommandResult.NoSplitSeparatorInSelection */]: _lt("There is no match for the selected separator in the selection"),
16274
- [90 /* CommandResult.MoreThanOneColumnSelected */]: _lt("Only a selection from a single column can be split"),
16275
- [92 /* CommandResult.SplitWillOverwriteContent */]: _lt("Splitting will overwrite existing content"),
16277
+ [94 /* CommandResult.NoSplitSeparatorInSelection */]: _lt("There is no match for the selected separator in the selection"),
16278
+ [91 /* CommandResult.MoreThanOneColumnSelected */]: _lt("Only a selection from a single column can be split"),
16279
+ [93 /* CommandResult.SplitWillOverwriteContent */]: _lt("Splitting will overwrite existing content"),
16276
16280
  },
16277
16281
  };
16278
16282
 
@@ -16677,7 +16681,7 @@
16677
16681
 
16678
16682
  function isDataRangeValid(definition) {
16679
16683
  return definition.dataRange && !rangeReference.test(definition.dataRange)
16680
- ? 38 /* CommandResult.InvalidGaugeDataRange */
16684
+ ? 39 /* CommandResult.InvalidGaugeDataRange */
16681
16685
  : 0 /* CommandResult.Success */;
16682
16686
  }
16683
16687
  function checkRangeLimits(check, batchValidations) {
@@ -16709,7 +16713,7 @@
16709
16713
  function checkRangeMinBiggerThanRangeMax(definition) {
16710
16714
  if (definition.sectionRule) {
16711
16715
  if (Number(definition.sectionRule.rangeMin) >= Number(definition.sectionRule.rangeMax)) {
16712
- return 43 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */;
16716
+ return 44 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */;
16713
16717
  }
16714
16718
  }
16715
16719
  return 0 /* CommandResult.Success */;
@@ -16718,9 +16722,9 @@
16718
16722
  if (value === "") {
16719
16723
  switch (valueName) {
16720
16724
  case "rangeMin":
16721
- return 39 /* CommandResult.EmptyGaugeRangeMin */;
16725
+ return 40 /* CommandResult.EmptyGaugeRangeMin */;
16722
16726
  case "rangeMax":
16723
- return 41 /* CommandResult.EmptyGaugeRangeMax */;
16727
+ return 42 /* CommandResult.EmptyGaugeRangeMax */;
16724
16728
  }
16725
16729
  }
16726
16730
  return 0 /* CommandResult.Success */;
@@ -16729,13 +16733,13 @@
16729
16733
  if (isNaN(value)) {
16730
16734
  switch (valueName) {
16731
16735
  case "rangeMin":
16732
- return 40 /* CommandResult.GaugeRangeMinNaN */;
16736
+ return 41 /* CommandResult.GaugeRangeMinNaN */;
16733
16737
  case "rangeMax":
16734
- return 42 /* CommandResult.GaugeRangeMaxNaN */;
16738
+ return 43 /* CommandResult.GaugeRangeMaxNaN */;
16735
16739
  case "lowerInflectionPointValue":
16736
- return 44 /* CommandResult.GaugeLowerInflectionPointNaN */;
16740
+ return 45 /* CommandResult.GaugeLowerInflectionPointNaN */;
16737
16741
  case "upperInflectionPointValue":
16738
- return 45 /* CommandResult.GaugeUpperInflectionPointNaN */;
16742
+ return 46 /* CommandResult.GaugeUpperInflectionPointNaN */;
16739
16743
  }
16740
16744
  }
16741
16745
  return 0 /* CommandResult.Success */;
@@ -17531,12 +17535,12 @@
17531
17535
 
17532
17536
  function checkKeyValue(definition) {
17533
17537
  return definition.keyValue && !rangeReference.test(definition.keyValue)
17534
- ? 36 /* CommandResult.InvalidScorecardKeyValue */
17538
+ ? 37 /* CommandResult.InvalidScorecardKeyValue */
17535
17539
  : 0 /* CommandResult.Success */;
17536
17540
  }
17537
17541
  function checkBaseline(definition) {
17538
17542
  return definition.baseline && !rangeReference.test(definition.baseline)
17539
- ? 37 /* CommandResult.InvalidScorecardBaseline */
17543
+ ? 38 /* CommandResult.InvalidScorecardBaseline */
17540
17544
  : 0 /* CommandResult.Success */;
17541
17545
  }
17542
17546
  class ScorecardChart extends AbstractChart {
@@ -18063,7 +18067,7 @@
18063
18067
  };
18064
18068
  function interactiveAddMerge(env, sheetId, target) {
18065
18069
  const result = env.model.dispatch("ADD_MERGE", { sheetId, target });
18066
- if (result.isCancelledBecause(82 /* CommandResult.MergeInFilter */)) {
18070
+ if (result.isCancelledBecause(83 /* CommandResult.MergeInFilter */)) {
18067
18071
  env.raiseError(AddMergeInteractiveContent.MergeInFilter);
18068
18072
  }
18069
18073
  else if (result.isCancelledBecause(3 /* CommandResult.MergeIsDestructive */)) {
@@ -18090,7 +18094,7 @@
18090
18094
  else if (result.reasons.includes(23 /* CommandResult.WrongFigurePasteOption */)) {
18091
18095
  env.raiseError(PasteInteractiveContent.wrongFigurePasteOption);
18092
18096
  }
18093
- else if (result.reasons.includes(77 /* CommandResult.FrozenPaneOverlap */)) {
18097
+ else if (result.reasons.includes(78 /* CommandResult.FrozenPaneOverlap */)) {
18094
18098
  env.raiseError(PasteInteractiveContent.frozenPaneOverlap);
18095
18099
  }
18096
18100
  }
@@ -19265,7 +19269,7 @@
19265
19269
  });
19266
19270
  }
19267
19271
  }
19268
- if (result.isCancelledBecause(65 /* CommandResult.InvalidSortZone */)) {
19272
+ if (result.isCancelledBecause(66 /* CommandResult.InvalidSortZone */)) {
19269
19273
  const { col, row } = anchor;
19270
19274
  env.model.selection.selectZone({ cell: { col, row }, zone });
19271
19275
  env.raiseError(_lt("Cannot sort. To sort, select only cells or only merges that have the same size."));
@@ -19279,13 +19283,13 @@
19279
19283
  };
19280
19284
  function interactiveAddFilter(env, sheetId, target) {
19281
19285
  const result = env.model.dispatch("CREATE_FILTER_TABLE", { target, sheetId });
19282
- if (result.isCancelledBecause(80 /* CommandResult.FilterOverlap */)) {
19286
+ if (result.isCancelledBecause(81 /* CommandResult.FilterOverlap */)) {
19283
19287
  env.raiseError(AddFilterInteractiveContent.filterOverlap);
19284
19288
  }
19285
- else if (result.isCancelledBecause(82 /* CommandResult.MergeInFilter */)) {
19289
+ else if (result.isCancelledBecause(83 /* CommandResult.MergeInFilter */)) {
19286
19290
  env.raiseError(AddFilterInteractiveContent.mergeInFilter);
19287
19291
  }
19288
- else if (result.isCancelledBecause(83 /* CommandResult.NonContinuousTargets */)) {
19292
+ else if (result.isCancelledBecause(84 /* CommandResult.NonContinuousTargets */)) {
19289
19293
  env.raiseError(AddFilterInteractiveContent.nonContinuousTargets);
19290
19294
  }
19291
19295
  }
@@ -19722,7 +19726,7 @@
19722
19726
  const sheetId = env.model.getters.getActiveSheetId();
19723
19727
  const cmd = dimension === "COL" ? "FREEZE_COLUMNS" : "FREEZE_ROWS";
19724
19728
  const result = env.model.dispatch(cmd, { sheetId, quantity: base });
19725
- if (result.isCancelledBecause(67 /* CommandResult.MergeOverlap */)) {
19729
+ if (result.isCancelledBecause(68 /* CommandResult.MergeOverlap */)) {
19726
19730
  env.raiseError(MergeErrorMessage);
19727
19731
  }
19728
19732
  }
@@ -20862,10 +20866,10 @@
20862
20866
  return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
20863
20867
  }
20864
20868
  get isDatasetInvalid() {
20865
- return !!this.state.datasetDispatchResult?.isCancelledBecause(34 /* CommandResult.InvalidDataSet */);
20869
+ return !!this.state.datasetDispatchResult?.isCancelledBecause(35 /* CommandResult.InvalidDataSet */);
20866
20870
  }
20867
20871
  get isLabelInvalid() {
20868
- return !!this.state.labelsDispatchResult?.isCancelledBecause(35 /* CommandResult.InvalidLabelRange */);
20872
+ return !!this.state.labelsDispatchResult?.isCancelledBecause(36 /* CommandResult.InvalidLabelRange */);
20869
20873
  }
20870
20874
  onUpdateDataSetsHaveTitle(ev) {
20871
20875
  this.props.updateChart(this.props.figureId, {
@@ -21539,7 +21543,7 @@
21539
21543
  return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
21540
21544
  }
21541
21545
  get isDataRangeInvalid() {
21542
- return !!this.state.dataRangeDispatchResult?.isCancelledBecause(38 /* CommandResult.InvalidGaugeDataRange */);
21546
+ return !!this.state.dataRangeDispatchResult?.isCancelledBecause(39 /* CommandResult.InvalidGaugeDataRange */);
21543
21547
  }
21544
21548
  onDataRangeChanged(ranges) {
21545
21549
  this.dataRange = ranges[0];
@@ -21623,25 +21627,25 @@
21623
21627
  });
21624
21628
  }
21625
21629
  isRangeMinInvalid() {
21626
- return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(39 /* CommandResult.EmptyGaugeRangeMin */) ||
21627
- this.state.sectionRuleDispatchResult?.isCancelledBecause(40 /* CommandResult.GaugeRangeMinNaN */) ||
21628
- this.state.sectionRuleDispatchResult?.isCancelledBecause(43 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */));
21630
+ return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(40 /* CommandResult.EmptyGaugeRangeMin */) ||
21631
+ this.state.sectionRuleDispatchResult?.isCancelledBecause(41 /* CommandResult.GaugeRangeMinNaN */) ||
21632
+ this.state.sectionRuleDispatchResult?.isCancelledBecause(44 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */));
21629
21633
  }
21630
21634
  isRangeMaxInvalid() {
21631
- return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(41 /* CommandResult.EmptyGaugeRangeMax */) ||
21632
- this.state.sectionRuleDispatchResult?.isCancelledBecause(42 /* CommandResult.GaugeRangeMaxNaN */) ||
21633
- this.state.sectionRuleDispatchResult?.isCancelledBecause(43 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */));
21635
+ return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(42 /* CommandResult.EmptyGaugeRangeMax */) ||
21636
+ this.state.sectionRuleDispatchResult?.isCancelledBecause(43 /* CommandResult.GaugeRangeMaxNaN */) ||
21637
+ this.state.sectionRuleDispatchResult?.isCancelledBecause(44 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */));
21634
21638
  }
21635
21639
  // ---------------------------------------------------------------------------
21636
21640
  // COLOR_SECTION_TEMPLATE
21637
21641
  // ---------------------------------------------------------------------------
21638
21642
  get isLowerInflectionPointInvalid() {
21639
- return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(44 /* CommandResult.GaugeLowerInflectionPointNaN */) ||
21640
- this.state.sectionRuleDispatchResult?.isCancelledBecause(46 /* CommandResult.GaugeLowerBiggerThanUpper */));
21643
+ return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(45 /* CommandResult.GaugeLowerInflectionPointNaN */) ||
21644
+ this.state.sectionRuleDispatchResult?.isCancelledBecause(47 /* CommandResult.GaugeLowerBiggerThanUpper */));
21641
21645
  }
21642
21646
  get isUpperInflectionPointInvalid() {
21643
- return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(45 /* CommandResult.GaugeUpperInflectionPointNaN */) ||
21644
- this.state.sectionRuleDispatchResult?.isCancelledBecause(46 /* CommandResult.GaugeLowerBiggerThanUpper */));
21647
+ return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(46 /* CommandResult.GaugeUpperInflectionPointNaN */) ||
21648
+ this.state.sectionRuleDispatchResult?.isCancelledBecause(47 /* CommandResult.GaugeLowerBiggerThanUpper */));
21645
21649
  }
21646
21650
  updateSectionColor(target, color) {
21647
21651
  const sectionRule = deepCopy(this.state.sectionRule);
@@ -21729,10 +21733,10 @@
21729
21733
  return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
21730
21734
  }
21731
21735
  get isKeyValueInvalid() {
21732
- return !!this.state.keyValueDispatchResult?.isCancelledBecause(36 /* CommandResult.InvalidScorecardKeyValue */);
21736
+ return !!this.state.keyValueDispatchResult?.isCancelledBecause(37 /* CommandResult.InvalidScorecardKeyValue */);
21733
21737
  }
21734
21738
  get isBaselineInvalid() {
21735
- return !!this.state.keyValueDispatchResult?.isCancelledBecause(37 /* CommandResult.InvalidScorecardBaseline */);
21739
+ return !!this.state.keyValueDispatchResult?.isCancelledBecause(38 /* CommandResult.InvalidScorecardBaseline */);
21736
21740
  }
21737
21741
  onKeyValueRangeChanged(ranges) {
21738
21742
  this.keyValue = ranges[0];
@@ -22627,10 +22631,10 @@
22627
22631
  * Cell Is Rule
22628
22632
  ****************************************************************************/
22629
22633
  get isValue1Invalid() {
22630
- return !!this.state.errors?.includes(53 /* CommandResult.FirstArgMissing */);
22634
+ return !!this.state.errors?.includes(54 /* CommandResult.FirstArgMissing */);
22631
22635
  }
22632
22636
  get isValue2Invalid() {
22633
- return !!this.state.errors?.includes(54 /* CommandResult.SecondArgMissing */);
22637
+ return !!this.state.errors?.includes(55 /* CommandResult.SecondArgMissing */);
22634
22638
  }
22635
22639
  toggleStyle(tool) {
22636
22640
  const style = this.state.rules.cellIs.style;
@@ -22647,17 +22651,17 @@
22647
22651
  isValueInvalid(threshold) {
22648
22652
  switch (threshold) {
22649
22653
  case "minimum":
22650
- return (this.state.errors.includes(60 /* CommandResult.MinInvalidFormula */) ||
22651
- this.state.errors.includes(52 /* CommandResult.MinBiggerThanMid */) ||
22652
- this.state.errors.includes(49 /* CommandResult.MinBiggerThanMax */) ||
22653
- this.state.errors.includes(55 /* CommandResult.MinNaN */));
22654
+ return (this.state.errors.includes(61 /* CommandResult.MinInvalidFormula */) ||
22655
+ this.state.errors.includes(53 /* CommandResult.MinBiggerThanMid */) ||
22656
+ this.state.errors.includes(50 /* CommandResult.MinBiggerThanMax */) ||
22657
+ this.state.errors.includes(56 /* CommandResult.MinNaN */));
22654
22658
  case "midpoint":
22655
- return (this.state.errors.includes(61 /* CommandResult.MidInvalidFormula */) ||
22656
- this.state.errors.includes(56 /* CommandResult.MidNaN */) ||
22657
- this.state.errors.includes(51 /* CommandResult.MidBiggerThanMax */));
22659
+ return (this.state.errors.includes(62 /* CommandResult.MidInvalidFormula */) ||
22660
+ this.state.errors.includes(57 /* CommandResult.MidNaN */) ||
22661
+ this.state.errors.includes(52 /* CommandResult.MidBiggerThanMax */));
22658
22662
  case "maximum":
22659
- return (this.state.errors.includes(62 /* CommandResult.MaxInvalidFormula */) ||
22660
- this.state.errors.includes(57 /* CommandResult.MaxNaN */));
22663
+ return (this.state.errors.includes(63 /* CommandResult.MaxInvalidFormula */) ||
22664
+ this.state.errors.includes(58 /* CommandResult.MaxNaN */));
22661
22665
  default:
22662
22666
  return false;
22663
22667
  }
@@ -22705,13 +22709,13 @@
22705
22709
  isInflectionPointInvalid(inflectionPoint) {
22706
22710
  switch (inflectionPoint) {
22707
22711
  case "lowerInflectionPoint":
22708
- return (this.state.errors.includes(59 /* CommandResult.ValueLowerInflectionNaN */) ||
22709
- this.state.errors.includes(64 /* CommandResult.ValueLowerInvalidFormula */) ||
22710
- this.state.errors.includes(50 /* CommandResult.LowerBiggerThanUpper */));
22712
+ return (this.state.errors.includes(60 /* CommandResult.ValueLowerInflectionNaN */) ||
22713
+ this.state.errors.includes(65 /* CommandResult.ValueLowerInvalidFormula */) ||
22714
+ this.state.errors.includes(51 /* CommandResult.LowerBiggerThanUpper */));
22711
22715
  case "upperInflectionPoint":
22712
- return (this.state.errors.includes(58 /* CommandResult.ValueUpperInflectionNaN */) ||
22713
- this.state.errors.includes(63 /* CommandResult.ValueUpperInvalidFormula */) ||
22714
- this.state.errors.includes(50 /* CommandResult.LowerBiggerThanUpper */));
22716
+ return (this.state.errors.includes(59 /* CommandResult.ValueUpperInflectionNaN */) ||
22717
+ this.state.errors.includes(64 /* CommandResult.ValueUpperInvalidFormula */) ||
22718
+ this.state.errors.includes(51 /* CommandResult.LowerBiggerThanUpper */));
22715
22719
  default:
22716
22720
  return true;
22717
22721
  }
@@ -23074,7 +23078,7 @@
23074
23078
  };
23075
23079
  function interactiveSplitToColumns(env, separator, addNewColumns) {
23076
23080
  let result = env.model.dispatch("SPLIT_TEXT_INTO_COLUMNS", { separator, addNewColumns });
23077
- if (result.isCancelledBecause(92 /* CommandResult.SplitWillOverwriteContent */)) {
23081
+ if (result.isCancelledBecause(93 /* CommandResult.SplitWillOverwriteContent */)) {
23078
23082
  env.askConfirmation(SplitToColumnsInteractiveContent.SplitIsDestructive, () => {
23079
23083
  result = env.model.dispatch("SPLIT_TEXT_INTO_COLUMNS", {
23080
23084
  separator,
@@ -23138,8 +23142,8 @@
23138
23142
  const errors = new Set();
23139
23143
  for (const reason of cancelledReasons) {
23140
23144
  switch (reason) {
23141
- case 92 /* CommandResult.SplitWillOverwriteContent */:
23142
- case 91 /* CommandResult.EmptySplitSeparator */:
23145
+ case 93 /* CommandResult.SplitWillOverwriteContent */:
23146
+ case 92 /* CommandResult.EmptySplitSeparator */:
23143
23147
  break;
23144
23148
  default:
23145
23149
  errors.add(SplitToColumnsTerms.Errors[reason] || SplitToColumnsTerms.Errors.Unexpected);
@@ -23154,8 +23158,8 @@
23154
23158
  addNewColumns: this.state.addNewColumns,
23155
23159
  force: false,
23156
23160
  }).reasons;
23157
- if (cancelledReasons.includes(92 /* CommandResult.SplitWillOverwriteContent */)) {
23158
- warnings.push(SplitToColumnsTerms.Errors[92 /* CommandResult.SplitWillOverwriteContent */]);
23161
+ if (cancelledReasons.includes(93 /* CommandResult.SplitWillOverwriteContent */)) {
23162
+ warnings.push(SplitToColumnsTerms.Errors[93 /* CommandResult.SplitWillOverwriteContent */]);
23159
23163
  }
23160
23164
  return warnings;
23161
23165
  }
@@ -24375,6 +24379,9 @@
24375
24379
  const token = tokens.filter((token) => token.value.includes(currentSelectedText) &&
24376
24380
  token.start <= currentSelection.start &&
24377
24381
  token.end >= currentSelection.end)[0];
24382
+ if (!token) {
24383
+ return;
24384
+ }
24378
24385
  if (token.type === "REFERENCE") {
24379
24386
  this.env.model.dispatch("CHANGE_COMPOSER_CURSOR_SELECTION", {
24380
24387
  start: token.start,
@@ -31679,7 +31686,7 @@
31679
31686
  const currentBorder = this.getCellBorder(cmd);
31680
31687
  const areAllNewBordersUndefined = !cmd.border?.bottom && !cmd.border?.left && !cmd.border?.right && !cmd.border?.top;
31681
31688
  if ((!currentBorder && areAllNewBordersUndefined) || deepEquals(currentBorder, cmd.border)) {
31682
- return 97 /* CommandResult.NoChanges */;
31689
+ return 98 /* CommandResult.NoChanges */;
31683
31690
  }
31684
31691
  return 0 /* CommandResult.Success */;
31685
31692
  }
@@ -32190,9 +32197,9 @@
32190
32197
  checkUselessClearCell(cmd) {
32191
32198
  const cell = this.getters.getCell(cmd);
32192
32199
  if (!cell)
32193
- return 97 /* CommandResult.NoChanges */;
32200
+ return 98 /* CommandResult.NoChanges */;
32194
32201
  if (!cell.content && !cell.style && !cell.format) {
32195
- return 97 /* CommandResult.NoChanges */;
32202
+ return 98 /* CommandResult.NoChanges */;
32196
32203
  }
32197
32204
  return 0 /* CommandResult.Success */;
32198
32205
  }
@@ -32417,13 +32424,13 @@
32417
32424
  }
32418
32425
  checkChartDuplicate(cmd) {
32419
32426
  return this.getters.getFigureSheetId(cmd.id)
32420
- ? 86 /* CommandResult.DuplicatedChartId */
32427
+ ? 87 /* CommandResult.DuplicatedChartId */
32421
32428
  : 0 /* CommandResult.Success */;
32422
32429
  }
32423
32430
  checkChartExists(cmd) {
32424
32431
  return this.getters.getFigureSheetId(cmd.id)
32425
32432
  ? 0 /* CommandResult.Success */
32426
- : 87 /* CommandResult.ChartDoesNotExist */;
32433
+ : 88 /* CommandResult.ChartDoesNotExist */;
32427
32434
  }
32428
32435
  }
32429
32436
 
@@ -32635,10 +32642,10 @@
32635
32642
  return 28 /* CommandResult.InvalidSheetId */;
32636
32643
  const ruleIndex = this.cfRules[sheetId].findIndex((cf) => cf.id === cfId);
32637
32644
  if (ruleIndex === -1)
32638
- return 73 /* CommandResult.InvalidConditionalFormatId */;
32645
+ return 74 /* CommandResult.InvalidConditionalFormatId */;
32639
32646
  const cfIndex2 = direction === "up" ? ruleIndex - 1 : ruleIndex + 1;
32640
32647
  if (cfIndex2 < 0 || cfIndex2 >= this.cfRules[sheetId].length) {
32641
- return 73 /* CommandResult.InvalidConditionalFormatId */;
32648
+ return 74 /* CommandResult.InvalidConditionalFormatId */;
32642
32649
  }
32643
32650
  return 0 /* CommandResult.Success */;
32644
32651
  }
@@ -32679,10 +32686,10 @@
32679
32686
  const errors = [];
32680
32687
  const isEmpty = (value) => value === undefined || value === "";
32681
32688
  if (expectedNumber >= 1 && isEmpty(rule.values[0])) {
32682
- errors.push(53 /* CommandResult.FirstArgMissing */);
32689
+ errors.push(54 /* CommandResult.FirstArgMissing */);
32683
32690
  }
32684
32691
  if (expectedNumber >= 2 && isEmpty(rule.values[1])) {
32685
- errors.push(54 /* CommandResult.SecondArgMissing */);
32692
+ errors.push(55 /* CommandResult.SecondArgMissing */);
32686
32693
  }
32687
32694
  return errors.length ? errors : 0 /* CommandResult.Success */;
32688
32695
  }
@@ -32694,15 +32701,15 @@
32694
32701
  (threshold.value === "" || isNaN(threshold.value))) {
32695
32702
  switch (thresholdName) {
32696
32703
  case "min":
32697
- return 55 /* CommandResult.MinNaN */;
32704
+ return 56 /* CommandResult.MinNaN */;
32698
32705
  case "max":
32699
- return 57 /* CommandResult.MaxNaN */;
32706
+ return 58 /* CommandResult.MaxNaN */;
32700
32707
  case "mid":
32701
- return 56 /* CommandResult.MidNaN */;
32708
+ return 57 /* CommandResult.MidNaN */;
32702
32709
  case "upperInflectionPoint":
32703
- return 58 /* CommandResult.ValueUpperInflectionNaN */;
32710
+ return 59 /* CommandResult.ValueUpperInflectionNaN */;
32704
32711
  case "lowerInflectionPoint":
32705
- return 59 /* CommandResult.ValueLowerInflectionNaN */;
32712
+ return 60 /* CommandResult.ValueLowerInflectionNaN */;
32706
32713
  }
32707
32714
  }
32708
32715
  return 0 /* CommandResult.Success */;
@@ -32716,15 +32723,15 @@
32716
32723
  catch (error) {
32717
32724
  switch (thresholdName) {
32718
32725
  case "min":
32719
- return 60 /* CommandResult.MinInvalidFormula */;
32726
+ return 61 /* CommandResult.MinInvalidFormula */;
32720
32727
  case "max":
32721
- return 62 /* CommandResult.MaxInvalidFormula */;
32728
+ return 63 /* CommandResult.MaxInvalidFormula */;
32722
32729
  case "mid":
32723
- return 61 /* CommandResult.MidInvalidFormula */;
32730
+ return 62 /* CommandResult.MidInvalidFormula */;
32724
32731
  case "upperInflectionPoint":
32725
- return 63 /* CommandResult.ValueUpperInvalidFormula */;
32732
+ return 64 /* CommandResult.ValueUpperInvalidFormula */;
32726
32733
  case "lowerInflectionPoint":
32727
- return 64 /* CommandResult.ValueLowerInvalidFormula */;
32734
+ return 65 /* CommandResult.ValueLowerInvalidFormula */;
32728
32735
  }
32729
32736
  }
32730
32737
  return 0 /* CommandResult.Success */;
@@ -32741,7 +32748,7 @@
32741
32748
  if (["number", "percentage", "percentile"].includes(rule.lowerInflectionPoint.type) &&
32742
32749
  rule.lowerInflectionPoint.type === rule.upperInflectionPoint.type &&
32743
32750
  Number(minValue) > Number(maxValue)) {
32744
- return 50 /* CommandResult.LowerBiggerThanUpper */;
32751
+ return 51 /* CommandResult.LowerBiggerThanUpper */;
32745
32752
  }
32746
32753
  return 0 /* CommandResult.Success */;
32747
32754
  }
@@ -32751,7 +32758,7 @@
32751
32758
  if (["number", "percentage", "percentile"].includes(rule.minimum.type) &&
32752
32759
  rule.minimum.type === rule.maximum.type &&
32753
32760
  stringToNumber(minValue) >= stringToNumber(maxValue)) {
32754
- return 49 /* CommandResult.MinBiggerThanMax */;
32761
+ return 50 /* CommandResult.MinBiggerThanMax */;
32755
32762
  }
32756
32763
  return 0 /* CommandResult.Success */;
32757
32764
  }
@@ -32762,7 +32769,7 @@
32762
32769
  ["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
32763
32770
  rule.midpoint.type === rule.maximum.type &&
32764
32771
  stringToNumber(midValue) >= stringToNumber(maxValue)) {
32765
- return 51 /* CommandResult.MidBiggerThanMax */;
32772
+ return 52 /* CommandResult.MidBiggerThanMax */;
32766
32773
  }
32767
32774
  return 0 /* CommandResult.Success */;
32768
32775
  }
@@ -32773,7 +32780,7 @@
32773
32780
  ["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
32774
32781
  rule.minimum.type === rule.midpoint.type &&
32775
32782
  stringToNumber(minValue) >= stringToNumber(midValue)) {
32776
- return 52 /* CommandResult.MinBiggerThanMid */;
32783
+ return 53 /* CommandResult.MinBiggerThanMid */;
32777
32784
  }
32778
32785
  return 0 /* CommandResult.Success */;
32779
32786
  }
@@ -32905,13 +32912,13 @@
32905
32912
  }
32906
32913
  checkFigureExists(sheetId, figureId) {
32907
32914
  if (this.figures[sheetId]?.[figureId] === undefined) {
32908
- return 72 /* CommandResult.FigureDoesNotExist */;
32915
+ return 73 /* CommandResult.FigureDoesNotExist */;
32909
32916
  }
32910
32917
  return 0 /* CommandResult.Success */;
32911
32918
  }
32912
32919
  checkFigureDuplicate(figureId) {
32913
32920
  if (Object.values(this.figures).find((sheet) => sheet?.[figureId])) {
32914
- return 84 /* CommandResult.DuplicatedFigureId */;
32921
+ return 85 /* CommandResult.DuplicatedFigureId */;
32915
32922
  }
32916
32923
  return 0 /* CommandResult.Success */;
32917
32924
  }
@@ -33023,12 +33030,12 @@
33023
33030
  switch (cmd.type) {
33024
33031
  case "CREATE_FILTER_TABLE":
33025
33032
  if (!areZonesContinuous(...cmd.target)) {
33026
- return 83 /* CommandResult.NonContinuousTargets */;
33033
+ return 84 /* CommandResult.NonContinuousTargets */;
33027
33034
  }
33028
33035
  const zone = union(...cmd.target);
33029
33036
  const checkFilterOverlap = () => {
33030
33037
  if (this.getFilterTables(cmd.sheetId).some((filter) => overlap(filter.zone, zone))) {
33031
- return 80 /* CommandResult.FilterOverlap */;
33038
+ return 81 /* CommandResult.FilterOverlap */;
33032
33039
  }
33033
33040
  return 0 /* CommandResult.Success */;
33034
33041
  };
@@ -33036,7 +33043,7 @@
33036
33043
  const mergesInTarget = this.getters.getMergesInZone(cmd.sheetId, zone);
33037
33044
  for (let merge of mergesInTarget) {
33038
33045
  if (overlap(zone, merge)) {
33039
- return 82 /* CommandResult.MergeInFilter */;
33046
+ return 83 /* CommandResult.MergeInFilter */;
33040
33047
  }
33041
33048
  }
33042
33049
  return 0 /* CommandResult.Success */;
@@ -33046,7 +33053,7 @@
33046
33053
  for (let merge of cmd.target) {
33047
33054
  for (let filterTable of this.getFilterTables(cmd.sheetId)) {
33048
33055
  if (overlap(filterTable.zone, merge)) {
33049
- return 82 /* CommandResult.MergeInFilter */;
33056
+ return 83 /* CommandResult.MergeInFilter */;
33050
33057
  }
33051
33058
  }
33052
33059
  }
@@ -33415,10 +33422,10 @@
33415
33422
  : this.getters.getNumberRows(cmd.sheetId);
33416
33423
  const hiddenElements = new Set((hiddenGroup || []).flat().concat(cmd.elements));
33417
33424
  if (hiddenElements.size >= elements) {
33418
- return 68 /* CommandResult.TooManyHiddenElements */;
33425
+ return 69 /* CommandResult.TooManyHiddenElements */;
33419
33426
  }
33420
33427
  else if (Math.min(...cmd.elements) < 0 || Math.max(...cmd.elements) > elements) {
33421
- return 88 /* CommandResult.InvalidHeaderIndex */;
33428
+ return 89 /* CommandResult.InvalidHeaderIndex */;
33422
33429
  }
33423
33430
  else {
33424
33431
  return 0 /* CommandResult.Success */;
@@ -33982,7 +33989,7 @@
33982
33989
  for (const zone of target) {
33983
33990
  for (const zone2 of target) {
33984
33991
  if (zone !== zone2 && overlap(zone, zone2)) {
33985
- return 67 /* CommandResult.MergeOverlap */;
33992
+ return 68 /* CommandResult.MergeOverlap */;
33986
33993
  }
33987
33994
  }
33988
33995
  }
@@ -33996,7 +34003,7 @@
33996
34003
  for (const zone of target) {
33997
34004
  if ((zone.left < xSplit && zone.right >= xSplit) ||
33998
34005
  (zone.top < ySplit && zone.bottom >= ySplit)) {
33999
- return 77 /* CommandResult.FrozenPaneOverlap */;
34006
+ return 78 /* CommandResult.FrozenPaneOverlap */;
34000
34007
  }
34001
34008
  }
34002
34009
  return 0 /* CommandResult.Success */;
@@ -34519,9 +34526,9 @@
34519
34526
  * Get a Xc string that represent a part of a range
34520
34527
  */
34521
34528
  getRangePartString(range, part) {
34522
- const colFixed = range.parts && range.parts[part].colFixed ? "$" : "";
34529
+ const colFixed = range.parts && range.parts[part]?.colFixed ? "$" : "";
34523
34530
  const col = part === 0 ? numberToLetters(range.zone.left) : numberToLetters(range.zone.right);
34524
- const rowFixed = range.parts && range.parts[part].rowFixed ? "$" : "";
34531
+ const rowFixed = range.parts && range.parts[part]?.rowFixed ? "$" : "";
34525
34532
  const row = part === 0 ? String(range.zone.top + 1) : String(range.zone.bottom + 1);
34526
34533
  let str = "";
34527
34534
  if (range.isFullCol) {
@@ -34629,10 +34636,10 @@
34629
34636
  ? this.getNumberCols(cmd.sheetId)
34630
34637
  : this.getNumberRows(cmd.sheetId);
34631
34638
  if (cmd.base < 0 || cmd.base >= elements) {
34632
- return 88 /* CommandResult.InvalidHeaderIndex */;
34639
+ return 89 /* CommandResult.InvalidHeaderIndex */;
34633
34640
  }
34634
34641
  else if (cmd.quantity <= 0) {
34635
- return 89 /* CommandResult.InvalidQuantity */;
34642
+ return 90 /* CommandResult.InvalidQuantity */;
34636
34643
  }
34637
34644
  return 0 /* CommandResult.Success */;
34638
34645
  case "REMOVE_COLUMNS_ROWS": {
@@ -34640,7 +34647,7 @@
34640
34647
  ? this.getNumberCols(cmd.sheetId)
34641
34648
  : this.getNumberRows(cmd.sheetId);
34642
34649
  if (Math.min(...cmd.elements) < 0 || Math.max(...cmd.elements) > elements) {
34643
- return 88 /* CommandResult.InvalidHeaderIndex */;
34650
+ return 89 /* CommandResult.InvalidHeaderIndex */;
34644
34651
  }
34645
34652
  else if (this.checkElementsIncludeAllNonFrozenHeaders(cmd.sheetId, cmd.dimension, cmd.elements)) {
34646
34653
  return 8 /* CommandResult.NotEnoughElements */;
@@ -35120,18 +35127,18 @@
35120
35127
  checkRowFreezeQuantity(cmd) {
35121
35128
  return cmd.quantity >= 1 && cmd.quantity < this.getNumberRows(cmd.sheetId)
35122
35129
  ? 0 /* CommandResult.Success */
35123
- : 76 /* CommandResult.InvalidFreezeQuantity */;
35130
+ : 77 /* CommandResult.InvalidFreezeQuantity */;
35124
35131
  }
35125
35132
  checkColFreezeQuantity(cmd) {
35126
35133
  return cmd.quantity >= 1 && cmd.quantity < this.getNumberCols(cmd.sheetId)
35127
35134
  ? 0 /* CommandResult.Success */
35128
- : 76 /* CommandResult.InvalidFreezeQuantity */;
35135
+ : 77 /* CommandResult.InvalidFreezeQuantity */;
35129
35136
  }
35130
35137
  checkRowFreezeOverlapMerge(cmd) {
35131
35138
  const merges = this.getters.getMerges(cmd.sheetId);
35132
35139
  for (let merge of merges) {
35133
35140
  if (merge.top < cmd.quantity && cmd.quantity <= merge.bottom) {
35134
- return 67 /* CommandResult.MergeOverlap */;
35141
+ return 68 /* CommandResult.MergeOverlap */;
35135
35142
  }
35136
35143
  }
35137
35144
  return 0 /* CommandResult.Success */;
@@ -35140,7 +35147,7 @@
35140
35147
  const merges = this.getters.getMerges(cmd.sheetId);
35141
35148
  for (let merge of merges) {
35142
35149
  if (merge.left < cmd.quantity && cmd.quantity <= merge.right) {
35143
- return 67 /* CommandResult.MergeOverlap */;
35150
+ return 68 /* CommandResult.MergeOverlap */;
35144
35151
  }
35145
35152
  }
35146
35153
  return 0 /* CommandResult.Success */;
@@ -35461,7 +35468,7 @@
35461
35468
  allowDispatch(cmd) {
35462
35469
  switch (cmd.type) {
35463
35470
  case "UPDATE_LOCALE":
35464
- return isValidLocale(cmd.locale) ? 0 /* CommandResult.Success */ : 95 /* CommandResult.InvalidLocale */;
35471
+ return isValidLocale(cmd.locale) ? 0 /* CommandResult.Success */ : 96 /* CommandResult.InvalidLocale */;
35465
35472
  }
35466
35473
  return 0 /* CommandResult.Success */;
35467
35474
  }
@@ -35542,22 +35549,17 @@
35542
35549
  * The `compute` of the formula's function must process it completely
35543
35550
  */
35544
35551
  refFn(range, isMeta, functionName, paramNumber) {
35552
+ this.assertRangeValid(range);
35545
35553
  if (isMeta) {
35546
35554
  // Use zoneToXc of zone instead of getRangeString to avoid sending unbounded ranges
35547
35555
  return { value: zoneToXc(range.zone) };
35548
35556
  }
35549
- if (!isZoneValid(range.zone)) {
35550
- throw new InvalidReferenceError();
35551
- }
35552
35557
  // if the formula definition could have accepted a range, we would pass through the _range function and not here
35553
35558
  if (range.zone.bottom !== range.zone.top || range.zone.left !== range.zone.right) {
35554
35559
  throw new Error(paramNumber
35555
35560
  ? _lt("Function %s expects the parameter %s to be a single value or a single cell reference, not a range.", functionName.toString(), paramNumber.toString())
35556
35561
  : _lt("Function %s expects its parameters to be single values or single cell references, not ranges.", functionName.toString()));
35557
35562
  }
35558
- if (range.invalidSheetName) {
35559
- throw new Error(_lt("Invalid sheet name: %s", range.invalidSheetName));
35560
- }
35561
35563
  return this.readCell(range);
35562
35564
  }
35563
35565
  readCell(range) {
@@ -35592,10 +35594,10 @@
35592
35594
  * Note that each col is possibly sparse: it only contain the values of cells
35593
35595
  * that are actually present in the grid.
35594
35596
  */
35595
- range({ sheetId, zone }) {
35596
- if (!isZoneValid(zone)) {
35597
- throw new InvalidReferenceError();
35598
- }
35597
+ range(range) {
35598
+ this.assertRangeValid(range);
35599
+ const sheetId = range.sheetId;
35600
+ const zone = range.zone;
35599
35601
  // Performance issue: Avoid fetching data on positions that are out of the spreadsheet
35600
35602
  // e.g. A1:ZZZ9999 in a sheet with 10 cols and 10 rows should ignore everything past J10 and return a 10x10 array
35601
35603
  const sheetZone = this.getters.getSheetZone(sheetId);
@@ -35638,6 +35640,14 @@
35638
35640
  this.rangeCache[cacheKey] = result;
35639
35641
  return result;
35640
35642
  }
35643
+ assertRangeValid(range) {
35644
+ if (!isZoneValid(range.zone)) {
35645
+ throw new InvalidReferenceError();
35646
+ }
35647
+ if (range.invalidSheetName) {
35648
+ throw new Error(_lt("Invalid sheet name: %s", range.invalidSheetName));
35649
+ }
35650
+ }
35641
35651
  }
35642
35652
 
35643
35653
  function quickselect(arr, k, left, right, compare) {
@@ -37916,7 +37926,7 @@
37916
37926
  if (this.lastCellSelected.col !== undefined && this.lastCellSelected.row !== undefined) {
37917
37927
  return 0 /* CommandResult.Success */;
37918
37928
  }
37919
- return 47 /* CommandResult.InvalidAutofillSelection */;
37929
+ return 48 /* CommandResult.InvalidAutofillSelection */;
37920
37930
  case "AUTOFILL_AUTO":
37921
37931
  const zone = this.getters.getSelectedZone();
37922
37932
  return zone.top === zone.bottom
@@ -38535,7 +38545,7 @@
38535
38545
  cellPopoverRegistry.get(cmd.popoverType);
38536
38546
  }
38537
38547
  catch (error) {
38538
- return 74 /* CommandResult.InvalidCellPopover */;
38548
+ return 75 /* CommandResult.InvalidCellPopover */;
38539
38549
  }
38540
38550
  return 0 /* CommandResult.Success */;
38541
38551
  default:
@@ -40675,27 +40685,6 @@
40675
40685
  // ---------------------------------------------------------------------------
40676
40686
  // Command Handling
40677
40687
  // ---------------------------------------------------------------------------
40678
- allowDispatch(cmd) {
40679
- switch (cmd.type) {
40680
- case "ADD_RANGE":
40681
- case "ADD_EMPTY_RANGE":
40682
- if (this.inputHasSingleRange && this.ranges.length === 1) {
40683
- return 31 /* CommandResult.MaximumRangesReached */;
40684
- }
40685
- break;
40686
- case "REMOVE_RANGE":
40687
- if (this.ranges.length === 1) {
40688
- return 32 /* CommandResult.MinimumRangesReached */;
40689
- }
40690
- break;
40691
- case "CHANGE_RANGE":
40692
- if (this.inputHasSingleRange && cmd.value.split(",").length > 1) {
40693
- return 31 /* CommandResult.MaximumRangesReached */;
40694
- }
40695
- break;
40696
- }
40697
- return 0 /* CommandResult.Success */;
40698
- }
40699
40688
  handleEvent(event) {
40700
40689
  const inputSheetId = this.activeSheet;
40701
40690
  const sheetId = this.getters.getActiveSheetId();
@@ -40915,6 +40904,15 @@
40915
40904
  // Command Handling
40916
40905
  // ---------------------------------------------------------------------------
40917
40906
  allowDispatch(cmd) {
40907
+ switch (cmd.type) {
40908
+ case "FOCUS_RANGE":
40909
+ case "CHANGE_RANGE":
40910
+ case "ADD_EMPTY_RANGE":
40911
+ case "REMOVE_RANGE":
40912
+ if (!this.inputs[cmd.id]) {
40913
+ return 33 /* CommandResult.InvalidInputId */;
40914
+ }
40915
+ }
40918
40916
  switch (cmd.type) {
40919
40917
  case "FOCUS_RANGE":
40920
40918
  const index = this.currentInput?.getIndex(cmd.rangeId);
@@ -40922,9 +40920,25 @@
40922
40920
  return 30 /* CommandResult.InputAlreadyFocused */;
40923
40921
  }
40924
40922
  break;
40925
- }
40926
- if (this.currentInput) {
40927
- return this.currentInput.allowDispatch(cmd);
40923
+ case "ADD_RANGE":
40924
+ case "ADD_EMPTY_RANGE":
40925
+ const input = this.inputs[cmd.id];
40926
+ if (input.inputHasSingleRange && input.ranges.length === 1) {
40927
+ return 31 /* CommandResult.MaximumRangesReached */;
40928
+ }
40929
+ break;
40930
+ case "REMOVE_RANGE":
40931
+ if (this.inputs[cmd.id].ranges.length === 1) {
40932
+ return 32 /* CommandResult.MinimumRangesReached */;
40933
+ }
40934
+ break;
40935
+ case "CHANGE_RANGE": {
40936
+ const input = this.inputs[cmd.id];
40937
+ if (input.inputHasSingleRange && cmd.value.split(",").length > 1) {
40938
+ return 31 /* CommandResult.MaximumRangesReached */;
40939
+ }
40940
+ break;
40941
+ }
40928
40942
  }
40929
40943
  return 0 /* CommandResult.Success */;
40930
40944
  }
@@ -41054,7 +41068,7 @@
41054
41068
  /*Test the presence of single cells*/
41055
41069
  const singleCells = positions(zone).some(({ col, row }) => !this.getters.isInMerge({ sheetId, col, row }));
41056
41070
  if (singleCells) {
41057
- return 65 /* CommandResult.InvalidSortZone */;
41071
+ return 66 /* CommandResult.InvalidSortZone */;
41058
41072
  }
41059
41073
  return 0 /* CommandResult.Success */;
41060
41074
  }
@@ -41073,7 +41087,7 @@
41073
41087
  ];
41074
41088
  return widthCurrent === widthFirst && heightCurrent === heightFirst;
41075
41089
  })) {
41076
- return 65 /* CommandResult.InvalidSortZone */;
41090
+ return 66 /* CommandResult.InvalidSortZone */;
41077
41091
  }
41078
41092
  return 0 /* CommandResult.Success */;
41079
41093
  }
@@ -41511,7 +41525,7 @@
41511
41525
  const sheetId = "sheetId" in cmd ? cmd.sheetId : this.getters.tryGetActiveSheetId();
41512
41526
  const zones = this.getters.getCommandZones(cmd);
41513
41527
  if (!sheetId && zones.length > 0) {
41514
- return 94 /* CommandResult.NoActiveSheet */;
41528
+ return 95 /* CommandResult.NoActiveSheet */;
41515
41529
  }
41516
41530
  if (sheetId && zones.length > 0) {
41517
41531
  return this.getters.checkZonesExistInSheet(sheetId, zones);
@@ -41993,13 +42007,13 @@
41993
42007
  }
41994
42008
  checkSingleColSelected() {
41995
42009
  if (!this.getters.isSingleColSelected()) {
41996
- return 90 /* CommandResult.MoreThanOneColumnSelected */;
42010
+ return 91 /* CommandResult.MoreThanOneColumnSelected */;
41997
42011
  }
41998
42012
  return 0 /* CommandResult.Success */;
41999
42013
  }
42000
42014
  checkNonEmptySelector(cmd) {
42001
42015
  if (cmd.separator === "") {
42002
- return 91 /* CommandResult.EmptySplitSeparator */;
42016
+ return 92 /* CommandResult.EmptySplitSeparator */;
42003
42017
  }
42004
42018
  return 0 /* CommandResult.Success */;
42005
42019
  }
@@ -42010,7 +42024,7 @@
42010
42024
  const selection = this.getters.getSelectedZones()[0];
42011
42025
  const splitted = this.getSplittedCols(selection, cmd.separator);
42012
42026
  if (this.willSplittedColsOverwriteContent(selection, splitted)) {
42013
- return 92 /* CommandResult.SplitWillOverwriteContent */;
42027
+ return 93 /* CommandResult.SplitWillOverwriteContent */;
42014
42028
  }
42015
42029
  return 0 /* CommandResult.Success */;
42016
42030
  }
@@ -42021,7 +42035,7 @@
42021
42035
  return 0 /* CommandResult.Success */;
42022
42036
  }
42023
42037
  }
42024
- return 93 /* CommandResult.NoSplitSeparatorInSelection */;
42038
+ return 94 /* CommandResult.NoSplitSeparatorInSelection */;
42025
42039
  }
42026
42040
  }
42027
42041
 
@@ -42169,7 +42183,7 @@
42169
42183
  for (const zone of this.getPasteZones(target)) {
42170
42184
  if ((zone.left < xSplit && zone.right >= xSplit) ||
42171
42185
  (zone.top < ySplit && zone.bottom >= ySplit)) {
42172
- return 77 /* CommandResult.FrozenPaneOverlap */;
42186
+ return 78 /* CommandResult.FrozenPaneOverlap */;
42173
42187
  }
42174
42188
  }
42175
42189
  return 0 /* CommandResult.Success */;
@@ -42621,7 +42635,7 @@
42621
42635
  }
42622
42636
  isPasteAllowed(target, option) {
42623
42637
  if (target.length === 0) {
42624
- return 75 /* CommandResult.EmptyTarget */;
42638
+ return 76 /* CommandResult.EmptyTarget */;
42625
42639
  }
42626
42640
  if (option?.pasteOption !== undefined) {
42627
42641
  return 23 /* CommandResult.WrongFigurePasteOption */;
@@ -42854,7 +42868,7 @@
42854
42868
  }
42855
42869
  case "ACTIVATE_PAINT_FORMAT": {
42856
42870
  if (this.paintFormatStatus !== "inactive") {
42857
- return 96 /* CommandResult.AlreadyInPaintingFormatMode */;
42871
+ return 97 /* CommandResult.AlreadyInPaintingFormatMode */;
42858
42872
  }
42859
42873
  }
42860
42874
  }
@@ -43432,7 +43446,7 @@
43432
43446
  validateSelection(length, start, end) {
43433
43447
  return start >= 0 && start <= length && end >= 0 && end <= length
43434
43448
  ? 0 /* CommandResult.Success */
43435
- : 48 /* CommandResult.WrongComposerSelection */;
43449
+ : 49 /* CommandResult.WrongComposerSelection */;
43436
43450
  }
43437
43451
  onColumnsRemoved(cmd) {
43438
43452
  if (cmd.elements.includes(this.col) && this.mode !== "inactive") {
@@ -43744,9 +43758,10 @@
43744
43758
  */
43745
43759
  getReferencedRanges() {
43746
43760
  const editionSheetId = this.getters.getCurrentEditedCell().sheetId;
43747
- return this.currentTokens
43761
+ const referenceRanges = this.currentTokens
43748
43762
  .filter((token) => token.type === "REFERENCE")
43749
43763
  .map((token) => this.getters.getRangeFromSheetXC(editionSheetId, token.value));
43764
+ return referenceRanges.filter((range) => !range.invalidSheetName && !range.invalidXc);
43750
43765
  }
43751
43766
  /**
43752
43767
  * Function used to determine when composer selection can start.
@@ -43813,7 +43828,7 @@
43813
43828
  switch (cmd.type) {
43814
43829
  case "UPDATE_FILTER":
43815
43830
  if (!this.getters.getFilterId(cmd)) {
43816
- return 81 /* CommandResult.FilterNotFound */;
43831
+ return 82 /* CommandResult.FilterNotFound */;
43817
43832
  }
43818
43833
  break;
43819
43834
  }
@@ -44608,7 +44623,7 @@
44608
44623
  const headers = [cmd.base, ...cmd.elements];
44609
44624
  const maxHeaderValue = isCol ? this.getters.getNumberCols(id) : this.getters.getNumberRows(id);
44610
44625
  if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
44611
- return 88 /* CommandResult.InvalidHeaderIndex */;
44626
+ return 89 /* CommandResult.InvalidHeaderIndex */;
44612
44627
  }
44613
44628
  return 0 /* CommandResult.Success */;
44614
44629
  }
@@ -45424,7 +45439,7 @@
45424
45439
  }
45425
45440
  checkPositiveDimension(cmd) {
45426
45441
  if (cmd.width < 0 || cmd.height < 0) {
45427
- return 70 /* CommandResult.InvalidViewportSize */;
45442
+ return 71 /* CommandResult.InvalidViewportSize */;
45428
45443
  }
45429
45444
  return 0 /* CommandResult.Success */;
45430
45445
  }
@@ -45434,7 +45449,7 @@
45434
45449
  cmd.gridOffsetY === this.gridOffsetY &&
45435
45450
  cmd.width === width &&
45436
45451
  cmd.height === height) {
45437
- return 78 /* CommandResult.ValuesNotChanged */;
45452
+ return 79 /* CommandResult.ValuesNotChanged */;
45438
45453
  }
45439
45454
  return 0 /* CommandResult.Success */;
45440
45455
  }
@@ -45442,7 +45457,7 @@
45442
45457
  const pane = this.getMainInternalViewport(this.getters.getActiveSheetId());
45443
45458
  if ((!pane.canScrollHorizontally && offsetX > 0) ||
45444
45459
  (!pane.canScrollVertically && offsetY > 0)) {
45445
- return 71 /* CommandResult.InvalidScrollingDirection */;
45460
+ return 72 /* CommandResult.InvalidScrollingDirection */;
45446
45461
  }
45447
45462
  return 0 /* CommandResult.Success */;
45448
45463
  }
@@ -48901,7 +48916,7 @@
48901
48916
  */
48902
48917
  moveAnchorCell(direction, step = 1) {
48903
48918
  if (step !== "end" && step <= 0) {
48904
- return new DispatchResult(85 /* CommandResult.InvalidSelectionStep */);
48919
+ return new DispatchResult(86 /* CommandResult.InvalidSelectionStep */);
48905
48920
  }
48906
48921
  const { col, row } = this.getNextAvailablePosition(direction, step);
48907
48922
  return this.selectCell(col, row);
@@ -48947,7 +48962,7 @@
48947
48962
  */
48948
48963
  resizeAnchorZone(direction, step = 1) {
48949
48964
  if (step !== "end" && step <= 0) {
48950
- return new DispatchResult(85 /* CommandResult.InvalidSelectionStep */);
48965
+ return new DispatchResult(86 /* CommandResult.InvalidSelectionStep */);
48951
48966
  }
48952
48967
  const sheetId = this.getters.getActiveSheetId();
48953
48968
  const anchor = this.anchor;
@@ -51304,10 +51319,10 @@
51304
51319
  const command = createCommand(type, payload);
51305
51320
  let status = this.status;
51306
51321
  if (this.getters.isReadonly() && !canExecuteInReadonly(command)) {
51307
- return new DispatchResult(69 /* CommandResult.Readonly */);
51322
+ return new DispatchResult(70 /* CommandResult.Readonly */);
51308
51323
  }
51309
51324
  if (!this.session.canApplyOptimisticUpdate()) {
51310
- return new DispatchResult(66 /* CommandResult.WaitingSessionConfirmation */);
51325
+ return new DispatchResult(67 /* CommandResult.WaitingSessionConfirmation */);
51311
51326
  }
51312
51327
  switch (status) {
51313
51328
  case 0 /* Status.Ready */:
@@ -51596,9 +51611,9 @@
51596
51611
  Object.defineProperty(exports, '__esModule', { value: true });
51597
51612
 
51598
51613
 
51599
- __info__.version = '16.4.18';
51600
- __info__.date = '2024-01-12T13:43:10.143Z';
51601
- __info__.hash = 'f438e08';
51614
+ __info__.version = '16.4.20';
51615
+ __info__.date = '2024-01-29T13:50:12.345Z';
51616
+ __info__.hash = '06c0ecf';
51602
51617
 
51603
51618
 
51604
51619
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);