@odoo/o-spreadsheet 16.1.31 → 16.1.33

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.
@@ -910,7 +910,7 @@
910
910
  function isDateTime(str) {
911
911
  return parseDateTime(str) !== null;
912
912
  }
913
- const MARKDOWN_LINK_REGEX = /^\[([^\[]+)\]\((.+)\)$/;
913
+ const MARKDOWN_LINK_REGEX = /^\[(.+)\]\((.+)\)$/;
914
914
  //link must start with http or https
915
915
  //https://stackoverflow.com/a/3809435/4760614
916
916
  const WEB_LINK_REGEX = /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/;
@@ -2002,27 +2002,30 @@
2002
2002
  }
2003
2003
  function createLargeNumberFormat(format, magnitude, postFix) {
2004
2004
  const internalFormat = parseFormat(format || "#,##0");
2005
- const largeNumberFormat = internalFormat
2006
- .map((formatPart) => {
2007
- if (formatPart.type === "NUMBER") {
2008
- return [
2009
- {
2010
- ...formatPart,
2011
- format: {
2012
- ...formatPart.format,
2013
- magnitude,
2014
- decimalPart: undefined,
2015
- },
2016
- },
2017
- {
2018
- type: "STRING",
2019
- format: postFix,
2020
- },
2021
- ];
2005
+ const largeNumberFormat = [];
2006
+ for (let i = 0; i < internalFormat.length; i++) {
2007
+ const formatPart = internalFormat[i];
2008
+ if (formatPart.type !== "NUMBER") {
2009
+ largeNumberFormat.push(formatPart);
2010
+ continue;
2022
2011
  }
2023
- return formatPart;
2024
- })
2025
- .flat();
2012
+ largeNumberFormat.push({
2013
+ ...formatPart,
2014
+ format: {
2015
+ ...formatPart.format,
2016
+ magnitude,
2017
+ decimalPart: undefined,
2018
+ },
2019
+ });
2020
+ largeNumberFormat.push({
2021
+ type: "STRING",
2022
+ format: postFix,
2023
+ });
2024
+ const nextFormatPart = internalFormat[i + 1];
2025
+ if ((nextFormatPart === null || nextFormatPart === void 0 ? void 0 : nextFormatPart.type) === "STRING" && ["k", "m", "b"].includes(nextFormatPart.format)) {
2026
+ i++;
2027
+ }
2028
+ }
2026
2029
  return convertInternalFormatToFormat(largeNumberFormat);
2027
2030
  }
2028
2031
  function changeDecimalPlaces(format, step) {
@@ -3667,64 +3670,65 @@
3667
3670
  CommandResult[CommandResult["InvalidFigureId"] = 28] = "InvalidFigureId";
3668
3671
  CommandResult[CommandResult["InputAlreadyFocused"] = 29] = "InputAlreadyFocused";
3669
3672
  CommandResult[CommandResult["MaximumRangesReached"] = 30] = "MaximumRangesReached";
3670
- CommandResult[CommandResult["InvalidChartDefinition"] = 31] = "InvalidChartDefinition";
3671
- CommandResult[CommandResult["InvalidDataSet"] = 32] = "InvalidDataSet";
3672
- CommandResult[CommandResult["InvalidLabelRange"] = 33] = "InvalidLabelRange";
3673
- CommandResult[CommandResult["InvalidScorecardKeyValue"] = 34] = "InvalidScorecardKeyValue";
3674
- CommandResult[CommandResult["InvalidScorecardBaseline"] = 35] = "InvalidScorecardBaseline";
3675
- CommandResult[CommandResult["InvalidGaugeDataRange"] = 36] = "InvalidGaugeDataRange";
3676
- CommandResult[CommandResult["EmptyGaugeRangeMin"] = 37] = "EmptyGaugeRangeMin";
3677
- CommandResult[CommandResult["GaugeRangeMinNaN"] = 38] = "GaugeRangeMinNaN";
3678
- CommandResult[CommandResult["EmptyGaugeRangeMax"] = 39] = "EmptyGaugeRangeMax";
3679
- CommandResult[CommandResult["GaugeRangeMaxNaN"] = 40] = "GaugeRangeMaxNaN";
3680
- CommandResult[CommandResult["GaugeRangeMinBiggerThanRangeMax"] = 41] = "GaugeRangeMinBiggerThanRangeMax";
3681
- CommandResult[CommandResult["GaugeLowerInflectionPointNaN"] = 42] = "GaugeLowerInflectionPointNaN";
3682
- CommandResult[CommandResult["GaugeUpperInflectionPointNaN"] = 43] = "GaugeUpperInflectionPointNaN";
3683
- CommandResult[CommandResult["GaugeLowerBiggerThanUpper"] = 44] = "GaugeLowerBiggerThanUpper";
3684
- CommandResult[CommandResult["InvalidAutofillSelection"] = 45] = "InvalidAutofillSelection";
3685
- CommandResult[CommandResult["WrongComposerSelection"] = 46] = "WrongComposerSelection";
3686
- CommandResult[CommandResult["MinBiggerThanMax"] = 47] = "MinBiggerThanMax";
3687
- CommandResult[CommandResult["LowerBiggerThanUpper"] = 48] = "LowerBiggerThanUpper";
3688
- CommandResult[CommandResult["MidBiggerThanMax"] = 49] = "MidBiggerThanMax";
3689
- CommandResult[CommandResult["MinBiggerThanMid"] = 50] = "MinBiggerThanMid";
3690
- CommandResult[CommandResult["FirstArgMissing"] = 51] = "FirstArgMissing";
3691
- CommandResult[CommandResult["SecondArgMissing"] = 52] = "SecondArgMissing";
3692
- CommandResult[CommandResult["MinNaN"] = 53] = "MinNaN";
3693
- CommandResult[CommandResult["MidNaN"] = 54] = "MidNaN";
3694
- CommandResult[CommandResult["MaxNaN"] = 55] = "MaxNaN";
3695
- CommandResult[CommandResult["ValueUpperInflectionNaN"] = 56] = "ValueUpperInflectionNaN";
3696
- CommandResult[CommandResult["ValueLowerInflectionNaN"] = 57] = "ValueLowerInflectionNaN";
3697
- CommandResult[CommandResult["MinInvalidFormula"] = 58] = "MinInvalidFormula";
3698
- CommandResult[CommandResult["MidInvalidFormula"] = 59] = "MidInvalidFormula";
3699
- CommandResult[CommandResult["MaxInvalidFormula"] = 60] = "MaxInvalidFormula";
3700
- CommandResult[CommandResult["ValueUpperInvalidFormula"] = 61] = "ValueUpperInvalidFormula";
3701
- CommandResult[CommandResult["ValueLowerInvalidFormula"] = 62] = "ValueLowerInvalidFormula";
3702
- CommandResult[CommandResult["InvalidSortZone"] = 63] = "InvalidSortZone";
3703
- CommandResult[CommandResult["WaitingSessionConfirmation"] = 64] = "WaitingSessionConfirmation";
3704
- CommandResult[CommandResult["MergeOverlap"] = 65] = "MergeOverlap";
3705
- CommandResult[CommandResult["TooManyHiddenElements"] = 66] = "TooManyHiddenElements";
3706
- CommandResult[CommandResult["Readonly"] = 67] = "Readonly";
3707
- CommandResult[CommandResult["InvalidViewportSize"] = 68] = "InvalidViewportSize";
3708
- CommandResult[CommandResult["InvalidScrollingDirection"] = 69] = "InvalidScrollingDirection";
3709
- CommandResult[CommandResult["FigureDoesNotExist"] = 70] = "FigureDoesNotExist";
3710
- CommandResult[CommandResult["InvalidConditionalFormatId"] = 71] = "InvalidConditionalFormatId";
3711
- CommandResult[CommandResult["InvalidCellPopover"] = 72] = "InvalidCellPopover";
3712
- CommandResult[CommandResult["EmptyTarget"] = 73] = "EmptyTarget";
3713
- CommandResult[CommandResult["InvalidFreezeQuantity"] = 74] = "InvalidFreezeQuantity";
3714
- CommandResult[CommandResult["FrozenPaneOverlap"] = 75] = "FrozenPaneOverlap";
3715
- CommandResult[CommandResult["ValuesNotChanged"] = 76] = "ValuesNotChanged";
3716
- CommandResult[CommandResult["InvalidFilterZone"] = 77] = "InvalidFilterZone";
3717
- CommandResult[CommandResult["FilterOverlap"] = 78] = "FilterOverlap";
3718
- CommandResult[CommandResult["FilterNotFound"] = 79] = "FilterNotFound";
3719
- CommandResult[CommandResult["MergeInFilter"] = 80] = "MergeInFilter";
3720
- CommandResult[CommandResult["NonContinuousTargets"] = 81] = "NonContinuousTargets";
3721
- CommandResult[CommandResult["DuplicatedFigureId"] = 82] = "DuplicatedFigureId";
3722
- CommandResult[CommandResult["InvalidSelectionStep"] = 83] = "InvalidSelectionStep";
3723
- CommandResult[CommandResult["DuplicatedChartId"] = 84] = "DuplicatedChartId";
3724
- CommandResult[CommandResult["ChartDoesNotExist"] = 85] = "ChartDoesNotExist";
3725
- CommandResult[CommandResult["InvalidHeaderIndex"] = 86] = "InvalidHeaderIndex";
3726
- CommandResult[CommandResult["InvalidQuantity"] = 87] = "InvalidQuantity";
3727
- CommandResult[CommandResult["NoChanges"] = 88] = "NoChanges";
3673
+ CommandResult[CommandResult["InvalidInputId"] = 31] = "InvalidInputId";
3674
+ CommandResult[CommandResult["InvalidChartDefinition"] = 32] = "InvalidChartDefinition";
3675
+ CommandResult[CommandResult["InvalidDataSet"] = 33] = "InvalidDataSet";
3676
+ CommandResult[CommandResult["InvalidLabelRange"] = 34] = "InvalidLabelRange";
3677
+ CommandResult[CommandResult["InvalidScorecardKeyValue"] = 35] = "InvalidScorecardKeyValue";
3678
+ CommandResult[CommandResult["InvalidScorecardBaseline"] = 36] = "InvalidScorecardBaseline";
3679
+ CommandResult[CommandResult["InvalidGaugeDataRange"] = 37] = "InvalidGaugeDataRange";
3680
+ CommandResult[CommandResult["EmptyGaugeRangeMin"] = 38] = "EmptyGaugeRangeMin";
3681
+ CommandResult[CommandResult["GaugeRangeMinNaN"] = 39] = "GaugeRangeMinNaN";
3682
+ CommandResult[CommandResult["EmptyGaugeRangeMax"] = 40] = "EmptyGaugeRangeMax";
3683
+ CommandResult[CommandResult["GaugeRangeMaxNaN"] = 41] = "GaugeRangeMaxNaN";
3684
+ CommandResult[CommandResult["GaugeRangeMinBiggerThanRangeMax"] = 42] = "GaugeRangeMinBiggerThanRangeMax";
3685
+ CommandResult[CommandResult["GaugeLowerInflectionPointNaN"] = 43] = "GaugeLowerInflectionPointNaN";
3686
+ CommandResult[CommandResult["GaugeUpperInflectionPointNaN"] = 44] = "GaugeUpperInflectionPointNaN";
3687
+ CommandResult[CommandResult["GaugeLowerBiggerThanUpper"] = 45] = "GaugeLowerBiggerThanUpper";
3688
+ CommandResult[CommandResult["InvalidAutofillSelection"] = 46] = "InvalidAutofillSelection";
3689
+ CommandResult[CommandResult["WrongComposerSelection"] = 47] = "WrongComposerSelection";
3690
+ CommandResult[CommandResult["MinBiggerThanMax"] = 48] = "MinBiggerThanMax";
3691
+ CommandResult[CommandResult["LowerBiggerThanUpper"] = 49] = "LowerBiggerThanUpper";
3692
+ CommandResult[CommandResult["MidBiggerThanMax"] = 50] = "MidBiggerThanMax";
3693
+ CommandResult[CommandResult["MinBiggerThanMid"] = 51] = "MinBiggerThanMid";
3694
+ CommandResult[CommandResult["FirstArgMissing"] = 52] = "FirstArgMissing";
3695
+ CommandResult[CommandResult["SecondArgMissing"] = 53] = "SecondArgMissing";
3696
+ CommandResult[CommandResult["MinNaN"] = 54] = "MinNaN";
3697
+ CommandResult[CommandResult["MidNaN"] = 55] = "MidNaN";
3698
+ CommandResult[CommandResult["MaxNaN"] = 56] = "MaxNaN";
3699
+ CommandResult[CommandResult["ValueUpperInflectionNaN"] = 57] = "ValueUpperInflectionNaN";
3700
+ CommandResult[CommandResult["ValueLowerInflectionNaN"] = 58] = "ValueLowerInflectionNaN";
3701
+ CommandResult[CommandResult["MinInvalidFormula"] = 59] = "MinInvalidFormula";
3702
+ CommandResult[CommandResult["MidInvalidFormula"] = 60] = "MidInvalidFormula";
3703
+ CommandResult[CommandResult["MaxInvalidFormula"] = 61] = "MaxInvalidFormula";
3704
+ CommandResult[CommandResult["ValueUpperInvalidFormula"] = 62] = "ValueUpperInvalidFormula";
3705
+ CommandResult[CommandResult["ValueLowerInvalidFormula"] = 63] = "ValueLowerInvalidFormula";
3706
+ CommandResult[CommandResult["InvalidSortZone"] = 64] = "InvalidSortZone";
3707
+ CommandResult[CommandResult["WaitingSessionConfirmation"] = 65] = "WaitingSessionConfirmation";
3708
+ CommandResult[CommandResult["MergeOverlap"] = 66] = "MergeOverlap";
3709
+ CommandResult[CommandResult["TooManyHiddenElements"] = 67] = "TooManyHiddenElements";
3710
+ CommandResult[CommandResult["Readonly"] = 68] = "Readonly";
3711
+ CommandResult[CommandResult["InvalidViewportSize"] = 69] = "InvalidViewportSize";
3712
+ CommandResult[CommandResult["InvalidScrollingDirection"] = 70] = "InvalidScrollingDirection";
3713
+ CommandResult[CommandResult["FigureDoesNotExist"] = 71] = "FigureDoesNotExist";
3714
+ CommandResult[CommandResult["InvalidConditionalFormatId"] = 72] = "InvalidConditionalFormatId";
3715
+ CommandResult[CommandResult["InvalidCellPopover"] = 73] = "InvalidCellPopover";
3716
+ CommandResult[CommandResult["EmptyTarget"] = 74] = "EmptyTarget";
3717
+ CommandResult[CommandResult["InvalidFreezeQuantity"] = 75] = "InvalidFreezeQuantity";
3718
+ CommandResult[CommandResult["FrozenPaneOverlap"] = 76] = "FrozenPaneOverlap";
3719
+ CommandResult[CommandResult["ValuesNotChanged"] = 77] = "ValuesNotChanged";
3720
+ CommandResult[CommandResult["InvalidFilterZone"] = 78] = "InvalidFilterZone";
3721
+ CommandResult[CommandResult["FilterOverlap"] = 79] = "FilterOverlap";
3722
+ CommandResult[CommandResult["FilterNotFound"] = 80] = "FilterNotFound";
3723
+ CommandResult[CommandResult["MergeInFilter"] = 81] = "MergeInFilter";
3724
+ CommandResult[CommandResult["NonContinuousTargets"] = 82] = "NonContinuousTargets";
3725
+ CommandResult[CommandResult["DuplicatedFigureId"] = 83] = "DuplicatedFigureId";
3726
+ CommandResult[CommandResult["InvalidSelectionStep"] = 84] = "InvalidSelectionStep";
3727
+ CommandResult[CommandResult["DuplicatedChartId"] = 85] = "DuplicatedChartId";
3728
+ CommandResult[CommandResult["ChartDoesNotExist"] = 86] = "ChartDoesNotExist";
3729
+ CommandResult[CommandResult["InvalidHeaderIndex"] = 87] = "InvalidHeaderIndex";
3730
+ CommandResult[CommandResult["InvalidQuantity"] = 88] = "InvalidQuantity";
3731
+ CommandResult[CommandResult["NoChanges"] = 89] = "NoChanges";
3728
3732
  })(exports.CommandResult || (exports.CommandResult = {}));
3729
3733
 
3730
3734
  function isMatrix(x) {
@@ -3998,11 +4002,11 @@
3998
4002
  if (definition.dataSets) {
3999
4003
  const invalidRanges = definition.dataSets.find((range) => !rangeReference.test(range)) !== undefined;
4000
4004
  if (invalidRanges) {
4001
- return 32 /* CommandResult.InvalidDataSet */;
4005
+ return 33 /* CommandResult.InvalidDataSet */;
4002
4006
  }
4003
4007
  const zones = definition.dataSets.map(toUnboundedZone);
4004
4008
  if (zones.some((zone) => zone.top !== zone.bottom && isFullRow(zone))) {
4005
- return 32 /* CommandResult.InvalidDataSet */;
4009
+ return 33 /* CommandResult.InvalidDataSet */;
4006
4010
  }
4007
4011
  }
4008
4012
  return 0 /* CommandResult.Success */;
@@ -4011,7 +4015,7 @@
4011
4015
  if (definition.labelRange) {
4012
4016
  const invalidLabels = !rangeReference.test(definition.labelRange || "");
4013
4017
  if (invalidLabels) {
4014
- return 33 /* CommandResult.InvalidLabelRange */;
4018
+ return 34 /* CommandResult.InvalidLabelRange */;
4015
4019
  }
4016
4020
  }
4017
4021
  return 0 /* CommandResult.Success */;
@@ -4084,22 +4088,22 @@
4084
4088
  const CfTerms = {
4085
4089
  Errors: {
4086
4090
  [25 /* CommandResult.InvalidRange */]: _lt("The range is invalid"),
4087
- [51 /* CommandResult.FirstArgMissing */]: _lt("The argument is missing. Please provide a value"),
4088
- [52 /* CommandResult.SecondArgMissing */]: _lt("The second argument is missing. Please provide a value"),
4089
- [53 /* CommandResult.MinNaN */]: _lt("The minpoint must be a number"),
4090
- [54 /* CommandResult.MidNaN */]: _lt("The midpoint must be a number"),
4091
- [55 /* CommandResult.MaxNaN */]: _lt("The maxpoint must be a number"),
4092
- [56 /* CommandResult.ValueUpperInflectionNaN */]: _lt("The first value must be a number"),
4093
- [57 /* CommandResult.ValueLowerInflectionNaN */]: _lt("The second value must be a number"),
4094
- [47 /* CommandResult.MinBiggerThanMax */]: _lt("Minimum must be smaller then Maximum"),
4095
- [50 /* CommandResult.MinBiggerThanMid */]: _lt("Minimum must be smaller then Midpoint"),
4096
- [49 /* CommandResult.MidBiggerThanMax */]: _lt("Midpoint must be smaller then Maximum"),
4097
- [48 /* CommandResult.LowerBiggerThanUpper */]: _lt("Lower inflection point must be smaller than upper inflection point"),
4098
- [58 /* CommandResult.MinInvalidFormula */]: _lt("Invalid Minpoint formula"),
4099
- [60 /* CommandResult.MaxInvalidFormula */]: _lt("Invalid Maxpoint formula"),
4100
- [59 /* CommandResult.MidInvalidFormula */]: _lt("Invalid Midpoint formula"),
4101
- [61 /* CommandResult.ValueUpperInvalidFormula */]: _lt("Invalid upper inflection point formula"),
4102
- [62 /* CommandResult.ValueLowerInvalidFormula */]: _lt("Invalid lower inflection point formula"),
4091
+ [52 /* CommandResult.FirstArgMissing */]: _lt("The argument is missing. Please provide a value"),
4092
+ [53 /* CommandResult.SecondArgMissing */]: _lt("The second argument is missing. Please provide a value"),
4093
+ [54 /* CommandResult.MinNaN */]: _lt("The minpoint must be a number"),
4094
+ [55 /* CommandResult.MidNaN */]: _lt("The midpoint must be a number"),
4095
+ [56 /* CommandResult.MaxNaN */]: _lt("The maxpoint must be a number"),
4096
+ [57 /* CommandResult.ValueUpperInflectionNaN */]: _lt("The first value must be a number"),
4097
+ [58 /* CommandResult.ValueLowerInflectionNaN */]: _lt("The second value must be a number"),
4098
+ [48 /* CommandResult.MinBiggerThanMax */]: _lt("Minimum must be smaller then Maximum"),
4099
+ [51 /* CommandResult.MinBiggerThanMid */]: _lt("Minimum must be smaller then Midpoint"),
4100
+ [50 /* CommandResult.MidBiggerThanMax */]: _lt("Midpoint must be smaller then Maximum"),
4101
+ [49 /* CommandResult.LowerBiggerThanUpper */]: _lt("Lower inflection point must be smaller than upper inflection point"),
4102
+ [59 /* CommandResult.MinInvalidFormula */]: _lt("Invalid Minpoint formula"),
4103
+ [61 /* CommandResult.MaxInvalidFormula */]: _lt("Invalid Maxpoint formula"),
4104
+ [60 /* CommandResult.MidInvalidFormula */]: _lt("Invalid Midpoint formula"),
4105
+ [62 /* CommandResult.ValueUpperInvalidFormula */]: _lt("Invalid upper inflection point formula"),
4106
+ [63 /* CommandResult.ValueLowerInvalidFormula */]: _lt("Invalid lower inflection point formula"),
4103
4107
  [24 /* CommandResult.EmptyRange */]: _lt("A range needs to be defined"),
4104
4108
  Unexpected: _lt("The rule is invalid for an unknown reason"),
4105
4109
  },
@@ -4127,20 +4131,20 @@
4127
4131
  Errors: {
4128
4132
  Unexpected: _lt("The chart definition is invalid for an unknown reason"),
4129
4133
  // BASIC CHART ERRORS (LINE | BAR | PIE)
4130
- [32 /* CommandResult.InvalidDataSet */]: _lt("The dataset is invalid"),
4131
- [33 /* CommandResult.InvalidLabelRange */]: _lt("Labels are invalid"),
4134
+ [33 /* CommandResult.InvalidDataSet */]: _lt("The dataset is invalid"),
4135
+ [34 /* CommandResult.InvalidLabelRange */]: _lt("Labels are invalid"),
4132
4136
  // SCORECARD CHART ERRORS
4133
- [34 /* CommandResult.InvalidScorecardKeyValue */]: _lt("The key value is invalid"),
4134
- [35 /* CommandResult.InvalidScorecardBaseline */]: _lt("The baseline value is invalid"),
4137
+ [35 /* CommandResult.InvalidScorecardKeyValue */]: _lt("The key value is invalid"),
4138
+ [36 /* CommandResult.InvalidScorecardBaseline */]: _lt("The baseline value is invalid"),
4135
4139
  // GAUGE CHART ERRORS
4136
- [36 /* CommandResult.InvalidGaugeDataRange */]: _lt("The data range is invalid"),
4137
- [37 /* CommandResult.EmptyGaugeRangeMin */]: _lt("A minimum range limit value is needed"),
4138
- [38 /* CommandResult.GaugeRangeMinNaN */]: _lt("The minimum range limit value must be a number"),
4139
- [39 /* CommandResult.EmptyGaugeRangeMax */]: _lt("A maximum range limit value is needed"),
4140
- [40 /* CommandResult.GaugeRangeMaxNaN */]: _lt("The maximum range limit value must be a number"),
4141
- [41 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */]: _lt("Minimum range limit must be smaller than maximum range limit"),
4142
- [42 /* CommandResult.GaugeLowerInflectionPointNaN */]: _lt("The lower inflection point value must be a number"),
4143
- [43 /* CommandResult.GaugeUpperInflectionPointNaN */]: _lt("The upper inflection point value must be a number"),
4140
+ [37 /* CommandResult.InvalidGaugeDataRange */]: _lt("The data range is invalid"),
4141
+ [38 /* CommandResult.EmptyGaugeRangeMin */]: _lt("A minimum range limit value is needed"),
4142
+ [39 /* CommandResult.GaugeRangeMinNaN */]: _lt("The minimum range limit value must be a number"),
4143
+ [40 /* CommandResult.EmptyGaugeRangeMax */]: _lt("A maximum range limit value is needed"),
4144
+ [41 /* CommandResult.GaugeRangeMaxNaN */]: _lt("The maximum range limit value must be a number"),
4145
+ [42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */]: _lt("Minimum range limit must be smaller than maximum range limit"),
4146
+ [43 /* CommandResult.GaugeLowerInflectionPointNaN */]: _lt("The lower inflection point value must be a number"),
4147
+ [44 /* CommandResult.GaugeUpperInflectionPointNaN */]: _lt("The upper inflection point value must be a number"),
4144
4148
  },
4145
4149
  };
4146
4150
  const NumberFormatTerms = {
@@ -4512,7 +4516,7 @@
4512
4516
 
4513
4517
  function isDataRangeValid(definition) {
4514
4518
  return definition.dataRange && !rangeReference.test(definition.dataRange)
4515
- ? 36 /* CommandResult.InvalidGaugeDataRange */
4519
+ ? 37 /* CommandResult.InvalidGaugeDataRange */
4516
4520
  : 0 /* CommandResult.Success */;
4517
4521
  }
4518
4522
  function checkRangeLimits(check, batchValidations) {
@@ -4544,7 +4548,7 @@
4544
4548
  function checkRangeMinBiggerThanRangeMax(definition) {
4545
4549
  if (definition.sectionRule) {
4546
4550
  if (Number(definition.sectionRule.rangeMin) >= Number(definition.sectionRule.rangeMax)) {
4547
- return 41 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */;
4551
+ return 42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */;
4548
4552
  }
4549
4553
  }
4550
4554
  return 0 /* CommandResult.Success */;
@@ -4553,9 +4557,9 @@
4553
4557
  if (value === "") {
4554
4558
  switch (valueName) {
4555
4559
  case "rangeMin":
4556
- return 37 /* CommandResult.EmptyGaugeRangeMin */;
4560
+ return 38 /* CommandResult.EmptyGaugeRangeMin */;
4557
4561
  case "rangeMax":
4558
- return 39 /* CommandResult.EmptyGaugeRangeMax */;
4562
+ return 40 /* CommandResult.EmptyGaugeRangeMax */;
4559
4563
  }
4560
4564
  }
4561
4565
  return 0 /* CommandResult.Success */;
@@ -4564,13 +4568,13 @@
4564
4568
  if (isNaN(value)) {
4565
4569
  switch (valueName) {
4566
4570
  case "rangeMin":
4567
- return 38 /* CommandResult.GaugeRangeMinNaN */;
4571
+ return 39 /* CommandResult.GaugeRangeMinNaN */;
4568
4572
  case "rangeMax":
4569
- return 40 /* CommandResult.GaugeRangeMaxNaN */;
4573
+ return 41 /* CommandResult.GaugeRangeMaxNaN */;
4570
4574
  case "lowerInflectionPointValue":
4571
- return 42 /* CommandResult.GaugeLowerInflectionPointNaN */;
4575
+ return 43 /* CommandResult.GaugeLowerInflectionPointNaN */;
4572
4576
  case "upperInflectionPointValue":
4573
- return 43 /* CommandResult.GaugeUpperInflectionPointNaN */;
4577
+ return 44 /* CommandResult.GaugeUpperInflectionPointNaN */;
4574
4578
  }
4575
4579
  }
4576
4580
  return 0 /* CommandResult.Success */;
@@ -5321,12 +5325,12 @@
5321
5325
 
5322
5326
  function checkKeyValue(definition) {
5323
5327
  return definition.keyValue && !rangeReference.test(definition.keyValue)
5324
- ? 34 /* CommandResult.InvalidScorecardKeyValue */
5328
+ ? 35 /* CommandResult.InvalidScorecardKeyValue */
5325
5329
  : 0 /* CommandResult.Success */;
5326
5330
  }
5327
5331
  function checkBaseline(definition) {
5328
5332
  return definition.baseline && !rangeReference.test(definition.baseline)
5329
- ? 35 /* CommandResult.InvalidScorecardBaseline */
5333
+ ? 36 /* CommandResult.InvalidScorecardBaseline */
5330
5334
  : 0 /* CommandResult.Success */;
5331
5335
  }
5332
5336
  class ScorecardChart extends AbstractChart {
@@ -6368,7 +6372,7 @@
6368
6372
  else if (result.reasons.includes(22 /* CommandResult.WrongFigurePasteOption */)) {
6369
6373
  env.raiseError(PasteInteractiveContent.wrongFigurePasteOption);
6370
6374
  }
6371
- else if (result.reasons.includes(75 /* CommandResult.FrozenPaneOverlap */)) {
6375
+ else if (result.reasons.includes(76 /* CommandResult.FrozenPaneOverlap */)) {
6372
6376
  env.raiseError(PasteInteractiveContent.frozenPaneOverlap);
6373
6377
  }
6374
6378
  }
@@ -6655,7 +6659,7 @@
6655
6659
  });
6656
6660
  }
6657
6661
  }
6658
- if (result.isCancelledBecause(63 /* CommandResult.InvalidSortZone */)) {
6662
+ if (result.isCancelledBecause(64 /* CommandResult.InvalidSortZone */)) {
6659
6663
  const { col, row } = anchor;
6660
6664
  env.model.selection.selectZone({ cell: { col, row }, zone });
6661
6665
  env.raiseError(_lt("Cannot sort. To sort, select only cells or only merges that have the same size."));
@@ -6669,13 +6673,13 @@
6669
6673
  };
6670
6674
  function interactiveAddFilter(env, sheetId, target) {
6671
6675
  const result = env.model.dispatch("CREATE_FILTER_TABLE", { target, sheetId });
6672
- if (result.isCancelledBecause(78 /* CommandResult.FilterOverlap */)) {
6676
+ if (result.isCancelledBecause(79 /* CommandResult.FilterOverlap */)) {
6673
6677
  env.raiseError(AddFilterInteractiveContent.filterOverlap);
6674
6678
  }
6675
- else if (result.isCancelledBecause(80 /* CommandResult.MergeInFilter */)) {
6679
+ else if (result.isCancelledBecause(81 /* CommandResult.MergeInFilter */)) {
6676
6680
  env.raiseError(AddFilterInteractiveContent.mergeInFilter);
6677
6681
  }
6678
- else if (result.isCancelledBecause(81 /* CommandResult.NonContinuousTargets */)) {
6682
+ else if (result.isCancelledBecause(82 /* CommandResult.NonContinuousTargets */)) {
6679
6683
  env.raiseError(AddFilterInteractiveContent.nonContinuousTargets);
6680
6684
  }
6681
6685
  }
@@ -16626,7 +16630,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
16626
16630
  validateSelection(length, start, end) {
16627
16631
  return start >= 0 && start <= length && end >= 0 && end <= length
16628
16632
  ? 0 /* CommandResult.Success */
16629
- : 46 /* CommandResult.WrongComposerSelection */;
16633
+ : 47 /* CommandResult.WrongComposerSelection */;
16630
16634
  }
16631
16635
  onColumnsRemoved(cmd) {
16632
16636
  if (cmd.elements.includes(this.col) && this.mode !== "inactive") {
@@ -16940,9 +16944,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
16940
16944
  */
16941
16945
  getReferencedRanges() {
16942
16946
  const editionSheetId = this.getters.getEditionSheet();
16943
- return this.currentTokens
16947
+ const referenceRanges = this.currentTokens
16944
16948
  .filter((token) => token.type === "REFERENCE")
16945
16949
  .map((token) => this.getters.getRangeFromSheetXC(editionSheetId, token.value));
16950
+ return referenceRanges.filter((range) => !range.invalidSheetName && !range.invalidXc);
16946
16951
  }
16947
16952
  /**
16948
16953
  * Function used to determine when composer selection can start.
@@ -19380,7 +19385,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
19380
19385
  const sheetId = env.model.getters.getActiveSheetId();
19381
19386
  const cmd = dimension === "COL" ? "FREEZE_COLUMNS" : "FREEZE_ROWS";
19382
19387
  const result = env.model.dispatch(cmd, { sheetId, quantity: base });
19383
- if (result.isCancelledBecause(65 /* CommandResult.MergeOverlap */)) {
19388
+ if (result.isCancelledBecause(66 /* CommandResult.MergeOverlap */)) {
19384
19389
  env.raiseError(MergeErrorMessage);
19385
19390
  }
19386
19391
  }
@@ -20095,11 +20100,11 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20095
20100
  }
20096
20101
  get isDatasetInvalid() {
20097
20102
  var _a;
20098
- return !!((_a = this.state.datasetDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(32 /* CommandResult.InvalidDataSet */));
20103
+ return !!((_a = this.state.datasetDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(33 /* CommandResult.InvalidDataSet */));
20099
20104
  }
20100
20105
  get isLabelInvalid() {
20101
20106
  var _a;
20102
- return !!((_a = this.state.labelsDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(33 /* CommandResult.InvalidLabelRange */));
20107
+ return !!((_a = this.state.labelsDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(34 /* CommandResult.InvalidLabelRange */));
20103
20108
  }
20104
20109
  onUpdateDataSetsHaveTitle(ev) {
20105
20110
  this.props.updateChart(this.props.figureId, {
@@ -20472,7 +20477,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20472
20477
  }
20473
20478
  get isDataRangeInvalid() {
20474
20479
  var _a;
20475
- return !!((_a = this.state.dataRangeDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(36 /* CommandResult.InvalidGaugeDataRange */));
20480
+ return !!((_a = this.state.dataRangeDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(37 /* CommandResult.InvalidGaugeDataRange */));
20476
20481
  }
20477
20482
  onDataRangeChanged(ranges) {
20478
20483
  this.dataRange = ranges[0];
@@ -20564,28 +20569,28 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20564
20569
  }
20565
20570
  isRangeMinInvalid() {
20566
20571
  var _a, _b, _c;
20567
- return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(37 /* CommandResult.EmptyGaugeRangeMin */)) ||
20568
- ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(38 /* CommandResult.GaugeRangeMinNaN */)) ||
20569
- ((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(41 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
20572
+ return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(38 /* CommandResult.EmptyGaugeRangeMin */)) ||
20573
+ ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(39 /* CommandResult.GaugeRangeMinNaN */)) ||
20574
+ ((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
20570
20575
  }
20571
20576
  isRangeMaxInvalid() {
20572
20577
  var _a, _b, _c;
20573
- return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(39 /* CommandResult.EmptyGaugeRangeMax */)) ||
20574
- ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(40 /* CommandResult.GaugeRangeMaxNaN */)) ||
20575
- ((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(41 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
20578
+ return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(40 /* CommandResult.EmptyGaugeRangeMax */)) ||
20579
+ ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(41 /* CommandResult.GaugeRangeMaxNaN */)) ||
20580
+ ((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
20576
20581
  }
20577
20582
  // ---------------------------------------------------------------------------
20578
20583
  // COLOR_SECTION_TEMPLATE
20579
20584
  // ---------------------------------------------------------------------------
20580
20585
  get isLowerInflectionPointInvalid() {
20581
20586
  var _a, _b;
20582
- return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(42 /* CommandResult.GaugeLowerInflectionPointNaN */)) ||
20583
- ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(44 /* CommandResult.GaugeLowerBiggerThanUpper */)));
20587
+ return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(43 /* CommandResult.GaugeLowerInflectionPointNaN */)) ||
20588
+ ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(45 /* CommandResult.GaugeLowerBiggerThanUpper */)));
20584
20589
  }
20585
20590
  get isUpperInflectionPointInvalid() {
20586
20591
  var _a, _b;
20587
- return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(43 /* CommandResult.GaugeUpperInflectionPointNaN */)) ||
20588
- ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(44 /* CommandResult.GaugeLowerBiggerThanUpper */)));
20592
+ return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(44 /* CommandResult.GaugeUpperInflectionPointNaN */)) ||
20593
+ ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(45 /* CommandResult.GaugeLowerBiggerThanUpper */)));
20589
20594
  }
20590
20595
  updateInflectionPointValue(attr, ev) {
20591
20596
  const sectionRule = deepCopy(this.props.definition.sectionRule);
@@ -20698,11 +20703,11 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
20698
20703
  }
20699
20704
  get isKeyValueInvalid() {
20700
20705
  var _a;
20701
- return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(34 /* CommandResult.InvalidScorecardKeyValue */));
20706
+ return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(35 /* CommandResult.InvalidScorecardKeyValue */));
20702
20707
  }
20703
20708
  get isBaselineInvalid() {
20704
20709
  var _a;
20705
- return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(35 /* CommandResult.InvalidScorecardBaseline */));
20710
+ return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(36 /* CommandResult.InvalidScorecardBaseline */));
20706
20711
  }
20707
20712
  onKeyValueRangeChanged(ranges) {
20708
20713
  this.keyValue = ranges[0];
@@ -21558,11 +21563,11 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
21558
21563
  ****************************************************************************/
21559
21564
  get isValue1Invalid() {
21560
21565
  var _a;
21561
- return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(51 /* CommandResult.FirstArgMissing */));
21566
+ return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(52 /* CommandResult.FirstArgMissing */));
21562
21567
  }
21563
21568
  get isValue2Invalid() {
21564
21569
  var _a;
21565
- return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(52 /* CommandResult.SecondArgMissing */));
21570
+ return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(53 /* CommandResult.SecondArgMissing */));
21566
21571
  }
21567
21572
  toggleStyle(tool) {
21568
21573
  const style = this.state.rules.cellIs.style;
@@ -21579,17 +21584,17 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
21579
21584
  isValueInvalid(threshold) {
21580
21585
  switch (threshold) {
21581
21586
  case "minimum":
21582
- return (this.state.errors.includes(58 /* CommandResult.MinInvalidFormula */) ||
21583
- this.state.errors.includes(50 /* CommandResult.MinBiggerThanMid */) ||
21584
- this.state.errors.includes(47 /* CommandResult.MinBiggerThanMax */) ||
21585
- this.state.errors.includes(53 /* CommandResult.MinNaN */));
21587
+ return (this.state.errors.includes(59 /* CommandResult.MinInvalidFormula */) ||
21588
+ this.state.errors.includes(51 /* CommandResult.MinBiggerThanMid */) ||
21589
+ this.state.errors.includes(48 /* CommandResult.MinBiggerThanMax */) ||
21590
+ this.state.errors.includes(54 /* CommandResult.MinNaN */));
21586
21591
  case "midpoint":
21587
- return (this.state.errors.includes(59 /* CommandResult.MidInvalidFormula */) ||
21588
- this.state.errors.includes(54 /* CommandResult.MidNaN */) ||
21589
- this.state.errors.includes(49 /* CommandResult.MidBiggerThanMax */));
21592
+ return (this.state.errors.includes(60 /* CommandResult.MidInvalidFormula */) ||
21593
+ this.state.errors.includes(55 /* CommandResult.MidNaN */) ||
21594
+ this.state.errors.includes(50 /* CommandResult.MidBiggerThanMax */));
21590
21595
  case "maximum":
21591
- return (this.state.errors.includes(60 /* CommandResult.MaxInvalidFormula */) ||
21592
- this.state.errors.includes(55 /* CommandResult.MaxNaN */));
21596
+ return (this.state.errors.includes(61 /* CommandResult.MaxInvalidFormula */) ||
21597
+ this.state.errors.includes(56 /* CommandResult.MaxNaN */));
21593
21598
  default:
21594
21599
  return false;
21595
21600
  }
@@ -21638,13 +21643,13 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
21638
21643
  isInflectionPointInvalid(inflectionPoint) {
21639
21644
  switch (inflectionPoint) {
21640
21645
  case "lowerInflectionPoint":
21641
- return (this.state.errors.includes(57 /* CommandResult.ValueLowerInflectionNaN */) ||
21642
- this.state.errors.includes(62 /* CommandResult.ValueLowerInvalidFormula */) ||
21643
- this.state.errors.includes(48 /* CommandResult.LowerBiggerThanUpper */));
21646
+ return (this.state.errors.includes(58 /* CommandResult.ValueLowerInflectionNaN */) ||
21647
+ this.state.errors.includes(63 /* CommandResult.ValueLowerInvalidFormula */) ||
21648
+ this.state.errors.includes(49 /* CommandResult.LowerBiggerThanUpper */));
21644
21649
  case "upperInflectionPoint":
21645
- return (this.state.errors.includes(56 /* CommandResult.ValueUpperInflectionNaN */) ||
21646
- this.state.errors.includes(61 /* CommandResult.ValueUpperInvalidFormula */) ||
21647
- this.state.errors.includes(48 /* CommandResult.LowerBiggerThanUpper */));
21650
+ return (this.state.errors.includes(57 /* CommandResult.ValueUpperInflectionNaN */) ||
21651
+ this.state.errors.includes(62 /* CommandResult.ValueUpperInvalidFormula */) ||
21652
+ this.state.errors.includes(49 /* CommandResult.LowerBiggerThanUpper */));
21648
21653
  default:
21649
21654
  return true;
21650
21655
  }
@@ -28440,7 +28445,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28440
28445
  const currentBorder = this.getCellBorder(cmd);
28441
28446
  const areAllNewBordersUndefined = !((_a = cmd.border) === null || _a === void 0 ? void 0 : _a.bottom) && !((_b = cmd.border) === null || _b === void 0 ? void 0 : _b.left) && !((_c = cmd.border) === null || _c === void 0 ? void 0 : _c.right) && !((_d = cmd.border) === null || _d === void 0 ? void 0 : _d.top);
28442
28447
  if ((!currentBorder && areAllNewBordersUndefined) || deepEquals(currentBorder, cmd.border)) {
28443
- return 88 /* CommandResult.NoChanges */;
28448
+ return 89 /* CommandResult.NoChanges */;
28444
28449
  }
28445
28450
  return 0 /* CommandResult.Success */;
28446
28451
  }
@@ -28962,9 +28967,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28962
28967
  checkUselessClearCell(cmd) {
28963
28968
  const cell = this.getters.getCell(cmd);
28964
28969
  if (!cell)
28965
- return 88 /* CommandResult.NoChanges */;
28970
+ return 89 /* CommandResult.NoChanges */;
28966
28971
  if (!cell.content && !cell.style && !cell.format) {
28967
- return 88 /* CommandResult.NoChanges */;
28972
+ return 89 /* CommandResult.NoChanges */;
28968
28973
  }
28969
28974
  return 0 /* CommandResult.Success */;
28970
28975
  }
@@ -29173,13 +29178,13 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29173
29178
  }
29174
29179
  checkChartDuplicate(cmd) {
29175
29180
  return this.getters.getFigureSheetId(cmd.id)
29176
- ? 84 /* CommandResult.DuplicatedChartId */
29181
+ ? 85 /* CommandResult.DuplicatedChartId */
29177
29182
  : 0 /* CommandResult.Success */;
29178
29183
  }
29179
29184
  checkChartExists(cmd) {
29180
29185
  return this.getters.getFigureSheetId(cmd.id)
29181
29186
  ? 0 /* CommandResult.Success */
29182
- : 85 /* CommandResult.ChartDoesNotExist */;
29187
+ : 86 /* CommandResult.ChartDoesNotExist */;
29183
29188
  }
29184
29189
  }
29185
29190
  ChartPlugin.getters = [
@@ -29381,10 +29386,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29381
29386
  return 27 /* CommandResult.InvalidSheetId */;
29382
29387
  const ruleIndex = this.cfRules[sheetId].findIndex((cf) => cf.id === cfId);
29383
29388
  if (ruleIndex === -1)
29384
- return 71 /* CommandResult.InvalidConditionalFormatId */;
29389
+ return 72 /* CommandResult.InvalidConditionalFormatId */;
29385
29390
  const cfIndex2 = direction === "up" ? ruleIndex - 1 : ruleIndex + 1;
29386
29391
  if (cfIndex2 < 0 || cfIndex2 >= this.cfRules[sheetId].length) {
29387
- return 71 /* CommandResult.InvalidConditionalFormatId */;
29392
+ return 72 /* CommandResult.InvalidConditionalFormatId */;
29388
29393
  }
29389
29394
  return 0 /* CommandResult.Success */;
29390
29395
  }
@@ -29425,10 +29430,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29425
29430
  const errors = [];
29426
29431
  const isEmpty = (value) => value === undefined || value === "";
29427
29432
  if (expectedNumber >= 1 && isEmpty(rule.values[0])) {
29428
- errors.push(51 /* CommandResult.FirstArgMissing */);
29433
+ errors.push(52 /* CommandResult.FirstArgMissing */);
29429
29434
  }
29430
29435
  if (expectedNumber >= 2 && isEmpty(rule.values[1])) {
29431
- errors.push(52 /* CommandResult.SecondArgMissing */);
29436
+ errors.push(53 /* CommandResult.SecondArgMissing */);
29432
29437
  }
29433
29438
  return errors.length ? errors : 0 /* CommandResult.Success */;
29434
29439
  }
@@ -29440,15 +29445,15 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29440
29445
  (threshold.value === "" || isNaN(threshold.value))) {
29441
29446
  switch (thresholdName) {
29442
29447
  case "min":
29443
- return 53 /* CommandResult.MinNaN */;
29448
+ return 54 /* CommandResult.MinNaN */;
29444
29449
  case "max":
29445
- return 55 /* CommandResult.MaxNaN */;
29450
+ return 56 /* CommandResult.MaxNaN */;
29446
29451
  case "mid":
29447
- return 54 /* CommandResult.MidNaN */;
29452
+ return 55 /* CommandResult.MidNaN */;
29448
29453
  case "upperInflectionPoint":
29449
- return 56 /* CommandResult.ValueUpperInflectionNaN */;
29454
+ return 57 /* CommandResult.ValueUpperInflectionNaN */;
29450
29455
  case "lowerInflectionPoint":
29451
- return 57 /* CommandResult.ValueLowerInflectionNaN */;
29456
+ return 58 /* CommandResult.ValueLowerInflectionNaN */;
29452
29457
  }
29453
29458
  }
29454
29459
  return 0 /* CommandResult.Success */;
@@ -29462,15 +29467,15 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29462
29467
  catch (error) {
29463
29468
  switch (thresholdName) {
29464
29469
  case "min":
29465
- return 58 /* CommandResult.MinInvalidFormula */;
29470
+ return 59 /* CommandResult.MinInvalidFormula */;
29466
29471
  case "max":
29467
- return 60 /* CommandResult.MaxInvalidFormula */;
29472
+ return 61 /* CommandResult.MaxInvalidFormula */;
29468
29473
  case "mid":
29469
- return 59 /* CommandResult.MidInvalidFormula */;
29474
+ return 60 /* CommandResult.MidInvalidFormula */;
29470
29475
  case "upperInflectionPoint":
29471
- return 61 /* CommandResult.ValueUpperInvalidFormula */;
29476
+ return 62 /* CommandResult.ValueUpperInvalidFormula */;
29472
29477
  case "lowerInflectionPoint":
29473
- return 62 /* CommandResult.ValueLowerInvalidFormula */;
29478
+ return 63 /* CommandResult.ValueLowerInvalidFormula */;
29474
29479
  }
29475
29480
  }
29476
29481
  return 0 /* CommandResult.Success */;
@@ -29487,7 +29492,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29487
29492
  if (["number", "percentage", "percentile"].includes(rule.lowerInflectionPoint.type) &&
29488
29493
  rule.lowerInflectionPoint.type === rule.upperInflectionPoint.type &&
29489
29494
  Number(minValue) > Number(maxValue)) {
29490
- return 48 /* CommandResult.LowerBiggerThanUpper */;
29495
+ return 49 /* CommandResult.LowerBiggerThanUpper */;
29491
29496
  }
29492
29497
  return 0 /* CommandResult.Success */;
29493
29498
  }
@@ -29497,7 +29502,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29497
29502
  if (["number", "percentage", "percentile"].includes(rule.minimum.type) &&
29498
29503
  rule.minimum.type === rule.maximum.type &&
29499
29504
  stringToNumber(minValue) >= stringToNumber(maxValue)) {
29500
- return 47 /* CommandResult.MinBiggerThanMax */;
29505
+ return 48 /* CommandResult.MinBiggerThanMax */;
29501
29506
  }
29502
29507
  return 0 /* CommandResult.Success */;
29503
29508
  }
@@ -29509,7 +29514,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29509
29514
  ["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
29510
29515
  rule.midpoint.type === rule.maximum.type &&
29511
29516
  stringToNumber(midValue) >= stringToNumber(maxValue)) {
29512
- return 49 /* CommandResult.MidBiggerThanMax */;
29517
+ return 50 /* CommandResult.MidBiggerThanMax */;
29513
29518
  }
29514
29519
  return 0 /* CommandResult.Success */;
29515
29520
  }
@@ -29521,7 +29526,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29521
29526
  ["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
29522
29527
  rule.minimum.type === rule.midpoint.type &&
29523
29528
  stringToNumber(minValue) >= stringToNumber(midValue)) {
29524
- return 50 /* CommandResult.MinBiggerThanMid */;
29529
+ return 51 /* CommandResult.MinBiggerThanMid */;
29525
29530
  }
29526
29531
  return 0 /* CommandResult.Success */;
29527
29532
  }
@@ -29622,13 +29627,13 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29622
29627
  checkFigureExists(sheetId, figureId) {
29623
29628
  var _a;
29624
29629
  if (((_a = this.figures[sheetId]) === null || _a === void 0 ? void 0 : _a[figureId]) === undefined) {
29625
- return 70 /* CommandResult.FigureDoesNotExist */;
29630
+ return 71 /* CommandResult.FigureDoesNotExist */;
29626
29631
  }
29627
29632
  return 0 /* CommandResult.Success */;
29628
29633
  }
29629
29634
  checkFigureDuplicate(figureId) {
29630
29635
  if (Object.values(this.figures).find((sheet) => sheet === null || sheet === void 0 ? void 0 : sheet[figureId])) {
29631
- return 82 /* CommandResult.DuplicatedFigureId */;
29636
+ return 83 /* CommandResult.DuplicatedFigureId */;
29632
29637
  }
29633
29638
  return 0 /* CommandResult.Success */;
29634
29639
  }
@@ -29730,12 +29735,12 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29730
29735
  switch (cmd.type) {
29731
29736
  case "CREATE_FILTER_TABLE":
29732
29737
  if (!areZonesContinuous(...cmd.target)) {
29733
- return 81 /* CommandResult.NonContinuousTargets */;
29738
+ return 82 /* CommandResult.NonContinuousTargets */;
29734
29739
  }
29735
29740
  const zone = union(...cmd.target);
29736
29741
  const checkFilterOverlap = () => {
29737
29742
  if (this.getFilterTables(cmd.sheetId).some((filter) => overlap(filter.zone, zone))) {
29738
- return 78 /* CommandResult.FilterOverlap */;
29743
+ return 79 /* CommandResult.FilterOverlap */;
29739
29744
  }
29740
29745
  return 0 /* CommandResult.Success */;
29741
29746
  };
@@ -29743,7 +29748,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29743
29748
  const mergesInTarget = this.getters.getMergesInZone(cmd.sheetId, zone);
29744
29749
  for (let merge of mergesInTarget) {
29745
29750
  if (overlap(zone, merge)) {
29746
- return 80 /* CommandResult.MergeInFilter */;
29751
+ return 81 /* CommandResult.MergeInFilter */;
29747
29752
  }
29748
29753
  }
29749
29754
  return 0 /* CommandResult.Success */;
@@ -29753,7 +29758,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29753
29758
  for (let merge of cmd.target) {
29754
29759
  for (let filterTable of this.getFilterTables(cmd.sheetId)) {
29755
29760
  if (overlap(filterTable.zone, merge)) {
29756
- return 80 /* CommandResult.MergeInFilter */;
29761
+ return 81 /* CommandResult.MergeInFilter */;
29757
29762
  }
29758
29763
  }
29759
29764
  }
@@ -30253,10 +30258,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
30253
30258
  : this.getters.getNumberRows(cmd.sheetId);
30254
30259
  const hiddenElements = new Set((hiddenGroup || []).flat().concat(cmd.elements));
30255
30260
  if (hiddenElements.size >= elements) {
30256
- return 66 /* CommandResult.TooManyHiddenElements */;
30261
+ return 67 /* CommandResult.TooManyHiddenElements */;
30257
30262
  }
30258
30263
  else if (Math.min(...cmd.elements) < 0 || Math.max(...cmd.elements) > elements) {
30259
- return 86 /* CommandResult.InvalidHeaderIndex */;
30264
+ return 87 /* CommandResult.InvalidHeaderIndex */;
30260
30265
  }
30261
30266
  else {
30262
30267
  return 0 /* CommandResult.Success */;
@@ -30782,7 +30787,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
30782
30787
  for (const zone of target) {
30783
30788
  for (const zone2 of target) {
30784
30789
  if (zone !== zone2 && overlap(zone, zone2)) {
30785
- return 65 /* CommandResult.MergeOverlap */;
30790
+ return 66 /* CommandResult.MergeOverlap */;
30786
30791
  }
30787
30792
  }
30788
30793
  }
@@ -30796,7 +30801,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
30796
30801
  for (const zone of target) {
30797
30802
  if ((zone.left < xSplit && zone.right >= xSplit) ||
30798
30803
  (zone.top < ySplit && zone.bottom >= ySplit)) {
30799
- return 75 /* CommandResult.FrozenPaneOverlap */;
30804
+ return 76 /* CommandResult.FrozenPaneOverlap */;
30800
30805
  }
30801
30806
  }
30802
30807
  return 0 /* CommandResult.Success */;
@@ -31328,9 +31333,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
31328
31333
  * Get a Xc string that represent a part of a range
31329
31334
  */
31330
31335
  getRangePartString(range, part) {
31331
- const colFixed = range.parts && range.parts[part].colFixed ? "$" : "";
31336
+ var _a, _b;
31337
+ const colFixed = range.parts && ((_a = range.parts[part]) === null || _a === void 0 ? void 0 : _a.colFixed) ? "$" : "";
31332
31338
  const col = part === 0 ? numberToLetters(range.zone.left) : numberToLetters(range.zone.right);
31333
- const rowFixed = range.parts && range.parts[part].rowFixed ? "$" : "";
31339
+ const rowFixed = range.parts && ((_b = range.parts[part]) === null || _b === void 0 ? void 0 : _b.rowFixed) ? "$" : "";
31334
31340
  const row = part === 0 ? String(range.zone.top + 1) : String(range.zone.bottom + 1);
31335
31341
  let str = "";
31336
31342
  if (range.isFullCol) {
@@ -31429,10 +31435,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
31429
31435
  ? this.getNumberCols(cmd.sheetId)
31430
31436
  : this.getNumberRows(cmd.sheetId);
31431
31437
  if (cmd.base < 0 || cmd.base >= elements) {
31432
- return 86 /* CommandResult.InvalidHeaderIndex */;
31438
+ return 87 /* CommandResult.InvalidHeaderIndex */;
31433
31439
  }
31434
31440
  else if (cmd.quantity <= 0) {
31435
- return 87 /* CommandResult.InvalidQuantity */;
31441
+ return 88 /* CommandResult.InvalidQuantity */;
31436
31442
  }
31437
31443
  return 0 /* CommandResult.Success */;
31438
31444
  case "REMOVE_COLUMNS_ROWS": {
@@ -31440,7 +31446,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
31440
31446
  ? this.getNumberCols(cmd.sheetId)
31441
31447
  : this.getNumberRows(cmd.sheetId);
31442
31448
  if (Math.min(...cmd.elements) < 0 || Math.max(...cmd.elements) > elements) {
31443
- return 86 /* CommandResult.InvalidHeaderIndex */;
31449
+ return 87 /* CommandResult.InvalidHeaderIndex */;
31444
31450
  }
31445
31451
  else if (this.checkElementsIncludeAllNonFrozenHeaders(cmd.sheetId, cmd.dimension, cmd.elements)) {
31446
31452
  return 8 /* CommandResult.NotEnoughElements */;
@@ -31884,18 +31890,18 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
31884
31890
  checkRowFreezeQuantity(cmd) {
31885
31891
  return cmd.quantity >= 1 && cmd.quantity < this.getNumberRows(cmd.sheetId)
31886
31892
  ? 0 /* CommandResult.Success */
31887
- : 74 /* CommandResult.InvalidFreezeQuantity */;
31893
+ : 75 /* CommandResult.InvalidFreezeQuantity */;
31888
31894
  }
31889
31895
  checkColFreezeQuantity(cmd) {
31890
31896
  return cmd.quantity >= 1 && cmd.quantity < this.getNumberCols(cmd.sheetId)
31891
31897
  ? 0 /* CommandResult.Success */
31892
- : 74 /* CommandResult.InvalidFreezeQuantity */;
31898
+ : 75 /* CommandResult.InvalidFreezeQuantity */;
31893
31899
  }
31894
31900
  checkRowFreezeOverlapMerge(cmd) {
31895
31901
  const merges = this.getters.getMerges(cmd.sheetId);
31896
31902
  for (let merge of merges) {
31897
31903
  if (merge.top < cmd.quantity && cmd.quantity <= merge.bottom) {
31898
- return 65 /* CommandResult.MergeOverlap */;
31904
+ return 66 /* CommandResult.MergeOverlap */;
31899
31905
  }
31900
31906
  }
31901
31907
  return 0 /* CommandResult.Success */;
@@ -31904,7 +31910,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
31904
31910
  const merges = this.getters.getMerges(cmd.sheetId);
31905
31911
  for (let merge of merges) {
31906
31912
  if (merge.left < cmd.quantity && cmd.quantity <= merge.right) {
31907
- return 65 /* CommandResult.MergeOverlap */;
31913
+ return 66 /* CommandResult.MergeOverlap */;
31908
31914
  }
31909
31915
  }
31910
31916
  return 0 /* CommandResult.Success */;
@@ -32641,10 +32647,8 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
32641
32647
  * that are actually present in the grid.
32642
32648
  */
32643
32649
  function range(range) {
32650
+ assertRangeValid(range);
32644
32651
  const sheetId = range.sheetId;
32645
- if (!isZoneValid(range.zone)) {
32646
- throw new InvalidReferenceError();
32647
- }
32648
32652
  // Performance issue: Avoid fetching data on positions that are out of the spreadsheet
32649
32653
  // e.g. A1:ZZZ9999 in a sheet with 10 cols and 10 rows should ignore everything past J10 and return a 10x10 array
32650
32654
  const sheetZone = getters.getSheetZone(sheetId);
@@ -32679,23 +32683,26 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
32679
32683
  * The `compute` of the formula's function must process it completely
32680
32684
  */
32681
32685
  function refFn(range, isMeta, functionName, paramNumber) {
32686
+ assertRangeValid(range);
32682
32687
  if (isMeta) {
32683
32688
  // Use zoneToXc of zone instead of getRangeString to avoid sending unbounded ranges
32684
32689
  return { value: zoneToXc(range.zone) };
32685
32690
  }
32686
- if (!isZoneValid(range.zone)) {
32687
- throw new InvalidReferenceError();
32688
- }
32689
32691
  // if the formula definition could have accepted a range, we would pass through the _range function and not here
32690
32692
  if (range.zone.bottom !== range.zone.top || range.zone.left !== range.zone.right) {
32691
32693
  throw new Error(paramNumber
32692
32694
  ? _lt("Function %s expects the parameter %s to be a single value or a single cell reference, not a range.", functionName.toString(), paramNumber.toString())
32693
32695
  : _lt("Function %s expects its parameters to be single values or single cell references, not ranges.", functionName.toString()));
32694
32696
  }
32697
+ return readCell(range);
32698
+ }
32699
+ function assertRangeValid(range) {
32700
+ if (!isZoneValid(range.zone)) {
32701
+ throw new InvalidReferenceError();
32702
+ }
32695
32703
  if (range.invalidSheetName) {
32696
32704
  throw new Error(_lt("Invalid sheet name: %s", range.invalidSheetName));
32697
32705
  }
32698
- return readCell(range);
32699
32706
  }
32700
32707
  return [refFn, range, evalContext];
32701
32708
  }
@@ -33194,7 +33201,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
33194
33201
  switch (cmd.type) {
33195
33202
  case "UPDATE_FILTER":
33196
33203
  if (!this.getters.getFilterId(cmd)) {
33197
- return 79 /* CommandResult.FilterNotFound */;
33204
+ return 80 /* CommandResult.FilterNotFound */;
33198
33205
  }
33199
33206
  break;
33200
33207
  }
@@ -34140,7 +34147,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
34140
34147
  }
34141
34148
  checkPositiveDimension(cmd) {
34142
34149
  if (cmd.width < 0 || cmd.height < 0) {
34143
- return 68 /* CommandResult.InvalidViewportSize */;
34150
+ return 69 /* CommandResult.InvalidViewportSize */;
34144
34151
  }
34145
34152
  return 0 /* CommandResult.Success */;
34146
34153
  }
@@ -34150,7 +34157,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
34150
34157
  cmd.gridOffsetY === this.gridOffsetY &&
34151
34158
  cmd.width === width &&
34152
34159
  cmd.height === height) {
34153
- return 76 /* CommandResult.ValuesNotChanged */;
34160
+ return 77 /* CommandResult.ValuesNotChanged */;
34154
34161
  }
34155
34162
  return 0 /* CommandResult.Success */;
34156
34163
  }
@@ -34158,7 +34165,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
34158
34165
  const pane = this.getMainInternalViewport(this.getters.getActiveSheetId());
34159
34166
  if ((!pane.canScrollHorizontally && offsetX > 0) ||
34160
34167
  (!pane.canScrollVertically && offsetY > 0)) {
34161
- return 69 /* CommandResult.InvalidScrollingDirection */;
34168
+ return 70 /* CommandResult.InvalidScrollingDirection */;
34162
34169
  }
34163
34170
  return 0 /* CommandResult.Success */;
34164
34171
  }
@@ -34414,7 +34421,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
34414
34421
  if (this.lastCellSelected.col !== undefined && this.lastCellSelected.row !== undefined) {
34415
34422
  return 0 /* CommandResult.Success */;
34416
34423
  }
34417
- return 45 /* CommandResult.InvalidAutofillSelection */;
34424
+ return 46 /* CommandResult.InvalidAutofillSelection */;
34418
34425
  case "AUTOFILL_AUTO":
34419
34426
  const zone = this.getters.getSelectedZone();
34420
34427
  return zone.top === zone.bottom
@@ -35016,7 +35023,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
35016
35023
  cellPopoverRegistry.get(cmd.popoverType);
35017
35024
  }
35018
35025
  catch (error) {
35019
- return 72 /* CommandResult.InvalidCellPopover */;
35026
+ return 73 /* CommandResult.InvalidCellPopover */;
35020
35027
  }
35021
35028
  return 0 /* CommandResult.Success */;
35022
35029
  default:
@@ -36219,21 +36226,6 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
36219
36226
  // ---------------------------------------------------------------------------
36220
36227
  // Command Handling
36221
36228
  // ---------------------------------------------------------------------------
36222
- allowDispatch(cmd) {
36223
- switch (cmd.type) {
36224
- case "ADD_EMPTY_RANGE":
36225
- if (this.inputHasSingleRange && this.ranges.length === 1) {
36226
- return 30 /* CommandResult.MaximumRangesReached */;
36227
- }
36228
- break;
36229
- case "CHANGE_RANGE":
36230
- if (this.inputHasSingleRange && cmd.value.split(",").length > 1) {
36231
- return 30 /* CommandResult.MaximumRangesReached */;
36232
- }
36233
- break;
36234
- }
36235
- return 0 /* CommandResult.Success */;
36236
- }
36237
36229
  handleEvent(event) {
36238
36230
  const xc = zoneToXc(event.anchor.zone);
36239
36231
  const inputSheetId = this.activeSheet;
@@ -36445,6 +36437,15 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
36445
36437
  // ---------------------------------------------------------------------------
36446
36438
  allowDispatch(cmd) {
36447
36439
  var _a, _b;
36440
+ switch (cmd.type) {
36441
+ case "FOCUS_RANGE":
36442
+ case "CHANGE_RANGE":
36443
+ case "ADD_EMPTY_RANGE":
36444
+ case "REMOVE_RANGE":
36445
+ if (!this.inputs[cmd.id]) {
36446
+ return 31 /* CommandResult.InvalidInputId */;
36447
+ }
36448
+ }
36448
36449
  switch (cmd.type) {
36449
36450
  case "FOCUS_RANGE":
36450
36451
  const index = (_a = this.currentInput) === null || _a === void 0 ? void 0 : _a.getIndex(cmd.rangeId);
@@ -36452,9 +36453,19 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
36452
36453
  return 29 /* CommandResult.InputAlreadyFocused */;
36453
36454
  }
36454
36455
  break;
36455
- }
36456
- if (this.currentInput) {
36457
- return this.currentInput.allowDispatch(cmd);
36456
+ case "ADD_EMPTY_RANGE":
36457
+ const input = this.inputs[cmd.id];
36458
+ if (input.inputHasSingleRange && input.ranges.length === 1) {
36459
+ return 30 /* CommandResult.MaximumRangesReached */;
36460
+ }
36461
+ break;
36462
+ case "CHANGE_RANGE": {
36463
+ const input = this.inputs[cmd.id];
36464
+ if (input.inputHasSingleRange && cmd.value.split(",").length > 1) {
36465
+ return 30 /* CommandResult.MaximumRangesReached */;
36466
+ }
36467
+ break;
36468
+ }
36458
36469
  }
36459
36470
  return 0 /* CommandResult.Success */;
36460
36471
  }
@@ -37437,7 +37448,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
37437
37448
  /*Test the presence of single cells*/
37438
37449
  const singleCells = positions(zone).some(({ col, row }) => !this.getters.isInMerge({ sheetId, col, row }));
37439
37450
  if (singleCells) {
37440
- return 63 /* CommandResult.InvalidSortZone */;
37451
+ return 64 /* CommandResult.InvalidSortZone */;
37441
37452
  }
37442
37453
  return 0 /* CommandResult.Success */;
37443
37454
  }
@@ -37456,7 +37467,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
37456
37467
  ];
37457
37468
  return widthCurrent === widthFirst && heightCurrent === heightFirst;
37458
37469
  })) {
37459
- return 63 /* CommandResult.InvalidSortZone */;
37470
+ return 64 /* CommandResult.InvalidSortZone */;
37460
37471
  }
37461
37472
  return 0 /* CommandResult.Success */;
37462
37473
  }
@@ -38084,7 +38095,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
38084
38095
  for (const zone of this.getPasteZones(target)) {
38085
38096
  if ((zone.left < xSplit && zone.right >= xSplit) ||
38086
38097
  (zone.top < ySplit && zone.bottom >= ySplit)) {
38087
- return 75 /* CommandResult.FrozenPaneOverlap */;
38098
+ return 76 /* CommandResult.FrozenPaneOverlap */;
38088
38099
  }
38089
38100
  }
38090
38101
  return 0 /* CommandResult.Success */;
@@ -38472,7 +38483,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
38472
38483
  }
38473
38484
  isPasteAllowed(target, option) {
38474
38485
  if (target.length === 0) {
38475
- return 73 /* CommandResult.EmptyTarget */;
38486
+ return 74 /* CommandResult.EmptyTarget */;
38476
38487
  }
38477
38488
  if ((option === null || option === void 0 ? void 0 : option.pasteOption) !== undefined) {
38478
38489
  return 22 /* CommandResult.WrongFigurePasteOption */;
@@ -39383,7 +39394,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
39383
39394
  const headers = [cmd.base, ...cmd.elements];
39384
39395
  const maxHeaderValue = isCol ? this.getters.getNumberCols(id) : this.getters.getNumberRows(id);
39385
39396
  if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
39386
- return 86 /* CommandResult.InvalidHeaderIndex */;
39397
+ return 87 /* CommandResult.InvalidHeaderIndex */;
39387
39398
  }
39388
39399
  return 0 /* CommandResult.Success */;
39389
39400
  }
@@ -40191,7 +40202,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
40191
40202
  };
40192
40203
  function interactiveAddMerge(env, sheetId, target) {
40193
40204
  const result = env.model.dispatch("ADD_MERGE", { sheetId, target });
40194
- if (result.isCancelledBecause(80 /* CommandResult.MergeInFilter */)) {
40205
+ if (result.isCancelledBecause(81 /* CommandResult.MergeInFilter */)) {
40195
40206
  env.raiseError(AddMergeInteractiveContent.MergeInFilter);
40196
40207
  }
40197
40208
  else if (result.isCancelledBecause(3 /* CommandResult.MergeIsDestructive */)) {
@@ -42066,7 +42077,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
42066
42077
  */
42067
42078
  moveAnchorCell(direction, step = 1) {
42068
42079
  if (step !== "end" && step <= 0) {
42069
- return new DispatchResult(83 /* CommandResult.InvalidSelectionStep */);
42080
+ return new DispatchResult(84 /* CommandResult.InvalidSelectionStep */);
42070
42081
  }
42071
42082
  const { col, row } = this.getNextAvailablePosition(direction, step);
42072
42083
  return this.selectCell(col, row);
@@ -42112,7 +42123,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
42112
42123
  */
42113
42124
  resizeAnchorZone(direction, step = 1) {
42114
42125
  if (step !== "end" && step <= 0) {
42115
- return new DispatchResult(83 /* CommandResult.InvalidSelectionStep */);
42126
+ return new DispatchResult(84 /* CommandResult.InvalidSelectionStep */);
42116
42127
  }
42117
42128
  const sheetId = this.getters.getActiveSheetId();
42118
42129
  const anchor = this.anchor;
@@ -44072,10 +44083,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
44072
44083
  const command = { ...payload, type };
44073
44084
  let status = this.status;
44074
44085
  if (this.getters.isReadonly() && !canExecuteInReadonly(command)) {
44075
- return new DispatchResult(67 /* CommandResult.Readonly */);
44086
+ return new DispatchResult(68 /* CommandResult.Readonly */);
44076
44087
  }
44077
44088
  if (!this.session.canApplyOptimisticUpdate()) {
44078
- return new DispatchResult(64 /* CommandResult.WaitingSessionConfirmation */);
44089
+ return new DispatchResult(65 /* CommandResult.WaitingSessionConfirmation */);
44079
44090
  }
44080
44091
  switch (status) {
44081
44092
  case 0 /* Status.Ready */:
@@ -44565,9 +44576,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
44565
44576
  Object.defineProperty(exports, '__esModule', { value: true });
44566
44577
 
44567
44578
 
44568
- __info__.version = '16.1.31';
44569
- __info__.date = '2024-01-12T13:42:11.001Z';
44570
- __info__.hash = 'f51befa';
44579
+ __info__.version = '16.1.33';
44580
+ __info__.date = '2024-01-29T13:49:43.259Z';
44581
+ __info__.hash = 'd3b27dd';
44571
44582
 
44572
44583
 
44573
44584
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);