@odoo/o-spreadsheet 16.0.60 → 16.0.62

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.
@@ -1099,9 +1099,16 @@
1099
1099
  }
1100
1100
  return true;
1101
1101
  }
1102
- /** Check if the given array contains all the values of the other array. */
1102
+ /**
1103
+ * Check if the given array contains all the values of the other array.
1104
+ * It makes the assumption that both array do not contain duplicates.
1105
+ */
1103
1106
  function includesAll(arr, values) {
1104
- return values.every((value) => arr.includes(value));
1107
+ if (arr.length < values.length) {
1108
+ return false;
1109
+ }
1110
+ const set = new Set(arr);
1111
+ return values.every((value) => set.has(value));
1105
1112
  }
1106
1113
  /**
1107
1114
  * Return an object with all the keys in the object that have a falsy value removed.
@@ -2376,6 +2383,37 @@
2376
2383
  setIsFastStrategy(isFast) {
2377
2384
  this.isFastIdStrategy = isFast;
2378
2385
  }
2386
+ /**
2387
+ * Generates a custom UUID using a simple 26^8 method (8-character alphanumeric string with lowercase letters)
2388
+ * This has a higher chance of collision than a UUIDv4, but not only faster to generate than an UUIDV4,
2389
+ * it also has a smaller size, which is preferable to alleviate the overall data size.
2390
+ *
2391
+ * This method is preferable when generating uuids for the core data (sheetId, figureId, etc)
2392
+ * as they will appear several times in the revisions and local history.
2393
+ *
2394
+ */
2395
+ smallUuid() {
2396
+ if (this.isFastIdStrategy) {
2397
+ this.fastIdStart++;
2398
+ return String(this.fastIdStart);
2399
+ //@ts-ignore
2400
+ }
2401
+ else if (window.crypto && window.crypto.getRandomValues) {
2402
+ //@ts-ignore
2403
+ return ([1e7] + -1e3).replace(/[018]/g, (c) => (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16));
2404
+ }
2405
+ else {
2406
+ // mainly for jest and other browsers that do not have the crypto functionality
2407
+ return "xxxxxxxx-xxxx".replace(/[xy]/g, function (c) {
2408
+ var r = (Math.random() * 16) | 0, v = c == "x" ? r : (r & 0x3) | 0x8;
2409
+ return v.toString(16);
2410
+ });
2411
+ }
2412
+ }
2413
+ /**
2414
+ * Generates an UUIDV4, has astronomically low chance of collision, but is larger in size than the smallUuid.
2415
+ * This method should be used when you need to avoid collisions at all costs, like the id of a revision.
2416
+ */
2379
2417
  uuidv4() {
2380
2418
  if (this.isFastIdStrategy) {
2381
2419
  this.fastIdStart++;
@@ -2489,17 +2527,20 @@
2489
2527
  */
2490
2528
  function toUnboundedZone(xc) {
2491
2529
  const zone = toZoneWithoutBoundaryChanges(xc);
2530
+ reorderZone(zone);
2531
+ return zone;
2532
+ }
2533
+ function reorderZone(zone) {
2492
2534
  if (zone.right !== undefined && zone.right < zone.left) {
2493
- const tmp = zone.left;
2535
+ const right = zone.left;
2494
2536
  zone.left = zone.right;
2495
- zone.right = tmp;
2537
+ zone.right = right;
2496
2538
  }
2497
2539
  if (zone.bottom !== undefined && zone.bottom < zone.top) {
2498
- const tmp = zone.top;
2540
+ const bottom = zone.top;
2499
2541
  zone.top = zone.bottom;
2500
- zone.bottom = tmp;
2542
+ zone.bottom = bottom;
2501
2543
  }
2502
- return zone;
2503
2544
  }
2504
2545
  /**
2505
2546
  * Convert from a cartesian reference to a Zone.
@@ -3387,67 +3428,68 @@
3387
3428
  CommandResult[CommandResult["InvalidRange"] = 25] = "InvalidRange";
3388
3429
  CommandResult[CommandResult["InvalidZones"] = 26] = "InvalidZones";
3389
3430
  CommandResult[CommandResult["InvalidSheetId"] = 27] = "InvalidSheetId";
3390
- CommandResult[CommandResult["InputAlreadyFocused"] = 28] = "InputAlreadyFocused";
3391
- CommandResult[CommandResult["MaximumRangesReached"] = 29] = "MaximumRangesReached";
3392
- CommandResult[CommandResult["InvalidInputId"] = 30] = "InvalidInputId";
3393
- CommandResult[CommandResult["InvalidChartDefinition"] = 31] = "InvalidChartDefinition";
3394
- CommandResult[CommandResult["InvalidDataSet"] = 32] = "InvalidDataSet";
3395
- CommandResult[CommandResult["InvalidLabelRange"] = 33] = "InvalidLabelRange";
3396
- CommandResult[CommandResult["InvalidScorecardKeyValue"] = 34] = "InvalidScorecardKeyValue";
3397
- CommandResult[CommandResult["InvalidScorecardBaseline"] = 35] = "InvalidScorecardBaseline";
3398
- CommandResult[CommandResult["InvalidGaugeDataRange"] = 36] = "InvalidGaugeDataRange";
3399
- CommandResult[CommandResult["EmptyGaugeRangeMin"] = 37] = "EmptyGaugeRangeMin";
3400
- CommandResult[CommandResult["GaugeRangeMinNaN"] = 38] = "GaugeRangeMinNaN";
3401
- CommandResult[CommandResult["EmptyGaugeRangeMax"] = 39] = "EmptyGaugeRangeMax";
3402
- CommandResult[CommandResult["GaugeRangeMaxNaN"] = 40] = "GaugeRangeMaxNaN";
3403
- CommandResult[CommandResult["GaugeRangeMinBiggerThanRangeMax"] = 41] = "GaugeRangeMinBiggerThanRangeMax";
3404
- CommandResult[CommandResult["GaugeLowerInflectionPointNaN"] = 42] = "GaugeLowerInflectionPointNaN";
3405
- CommandResult[CommandResult["GaugeUpperInflectionPointNaN"] = 43] = "GaugeUpperInflectionPointNaN";
3406
- CommandResult[CommandResult["GaugeLowerBiggerThanUpper"] = 44] = "GaugeLowerBiggerThanUpper";
3407
- CommandResult[CommandResult["InvalidAutofillSelection"] = 45] = "InvalidAutofillSelection";
3408
- CommandResult[CommandResult["WrongComposerSelection"] = 46] = "WrongComposerSelection";
3409
- CommandResult[CommandResult["MinBiggerThanMax"] = 47] = "MinBiggerThanMax";
3410
- CommandResult[CommandResult["LowerBiggerThanUpper"] = 48] = "LowerBiggerThanUpper";
3411
- CommandResult[CommandResult["MidBiggerThanMax"] = 49] = "MidBiggerThanMax";
3412
- CommandResult[CommandResult["MinBiggerThanMid"] = 50] = "MinBiggerThanMid";
3413
- CommandResult[CommandResult["FirstArgMissing"] = 51] = "FirstArgMissing";
3414
- CommandResult[CommandResult["SecondArgMissing"] = 52] = "SecondArgMissing";
3415
- CommandResult[CommandResult["MinNaN"] = 53] = "MinNaN";
3416
- CommandResult[CommandResult["MidNaN"] = 54] = "MidNaN";
3417
- CommandResult[CommandResult["MaxNaN"] = 55] = "MaxNaN";
3418
- CommandResult[CommandResult["ValueUpperInflectionNaN"] = 56] = "ValueUpperInflectionNaN";
3419
- CommandResult[CommandResult["ValueLowerInflectionNaN"] = 57] = "ValueLowerInflectionNaN";
3420
- CommandResult[CommandResult["MinInvalidFormula"] = 58] = "MinInvalidFormula";
3421
- CommandResult[CommandResult["MidInvalidFormula"] = 59] = "MidInvalidFormula";
3422
- CommandResult[CommandResult["MaxInvalidFormula"] = 60] = "MaxInvalidFormula";
3423
- CommandResult[CommandResult["ValueUpperInvalidFormula"] = 61] = "ValueUpperInvalidFormula";
3424
- CommandResult[CommandResult["ValueLowerInvalidFormula"] = 62] = "ValueLowerInvalidFormula";
3425
- CommandResult[CommandResult["InvalidSortZone"] = 63] = "InvalidSortZone";
3426
- CommandResult[CommandResult["WaitingSessionConfirmation"] = 64] = "WaitingSessionConfirmation";
3427
- CommandResult[CommandResult["MergeOverlap"] = 65] = "MergeOverlap";
3428
- CommandResult[CommandResult["TooManyHiddenElements"] = 66] = "TooManyHiddenElements";
3429
- CommandResult[CommandResult["Readonly"] = 67] = "Readonly";
3430
- CommandResult[CommandResult["InvalidViewportSize"] = 68] = "InvalidViewportSize";
3431
- CommandResult[CommandResult["InvalidScrollingDirection"] = 69] = "InvalidScrollingDirection";
3432
- CommandResult[CommandResult["FigureDoesNotExist"] = 70] = "FigureDoesNotExist";
3433
- CommandResult[CommandResult["InvalidConditionalFormatId"] = 71] = "InvalidConditionalFormatId";
3434
- CommandResult[CommandResult["InvalidCellPopover"] = 72] = "InvalidCellPopover";
3435
- CommandResult[CommandResult["EmptyTarget"] = 73] = "EmptyTarget";
3436
- CommandResult[CommandResult["InvalidFreezeQuantity"] = 74] = "InvalidFreezeQuantity";
3437
- CommandResult[CommandResult["FrozenPaneOverlap"] = 75] = "FrozenPaneOverlap";
3438
- CommandResult[CommandResult["ValuesNotChanged"] = 76] = "ValuesNotChanged";
3439
- CommandResult[CommandResult["InvalidFilterZone"] = 77] = "InvalidFilterZone";
3440
- CommandResult[CommandResult["FilterOverlap"] = 78] = "FilterOverlap";
3441
- CommandResult[CommandResult["FilterNotFound"] = 79] = "FilterNotFound";
3442
- CommandResult[CommandResult["MergeInFilter"] = 80] = "MergeInFilter";
3443
- CommandResult[CommandResult["NonContinuousTargets"] = 81] = "NonContinuousTargets";
3444
- CommandResult[CommandResult["DuplicatedFigureId"] = 82] = "DuplicatedFigureId";
3445
- CommandResult[CommandResult["InvalidSelectionStep"] = 83] = "InvalidSelectionStep";
3446
- CommandResult[CommandResult["DuplicatedChartId"] = 84] = "DuplicatedChartId";
3447
- CommandResult[CommandResult["ChartDoesNotExist"] = 85] = "ChartDoesNotExist";
3448
- CommandResult[CommandResult["InvalidHeaderIndex"] = 86] = "InvalidHeaderIndex";
3449
- CommandResult[CommandResult["InvalidQuantity"] = 87] = "InvalidQuantity";
3450
- CommandResult[CommandResult["NoChanges"] = 88] = "NoChanges";
3431
+ CommandResult[CommandResult["InvalidCellId"] = 28] = "InvalidCellId";
3432
+ CommandResult[CommandResult["InputAlreadyFocused"] = 29] = "InputAlreadyFocused";
3433
+ CommandResult[CommandResult["MaximumRangesReached"] = 30] = "MaximumRangesReached";
3434
+ CommandResult[CommandResult["InvalidInputId"] = 31] = "InvalidInputId";
3435
+ CommandResult[CommandResult["InvalidChartDefinition"] = 32] = "InvalidChartDefinition";
3436
+ CommandResult[CommandResult["InvalidDataSet"] = 33] = "InvalidDataSet";
3437
+ CommandResult[CommandResult["InvalidLabelRange"] = 34] = "InvalidLabelRange";
3438
+ CommandResult[CommandResult["InvalidScorecardKeyValue"] = 35] = "InvalidScorecardKeyValue";
3439
+ CommandResult[CommandResult["InvalidScorecardBaseline"] = 36] = "InvalidScorecardBaseline";
3440
+ CommandResult[CommandResult["InvalidGaugeDataRange"] = 37] = "InvalidGaugeDataRange";
3441
+ CommandResult[CommandResult["EmptyGaugeRangeMin"] = 38] = "EmptyGaugeRangeMin";
3442
+ CommandResult[CommandResult["GaugeRangeMinNaN"] = 39] = "GaugeRangeMinNaN";
3443
+ CommandResult[CommandResult["EmptyGaugeRangeMax"] = 40] = "EmptyGaugeRangeMax";
3444
+ CommandResult[CommandResult["GaugeRangeMaxNaN"] = 41] = "GaugeRangeMaxNaN";
3445
+ CommandResult[CommandResult["GaugeRangeMinBiggerThanRangeMax"] = 42] = "GaugeRangeMinBiggerThanRangeMax";
3446
+ CommandResult[CommandResult["GaugeLowerInflectionPointNaN"] = 43] = "GaugeLowerInflectionPointNaN";
3447
+ CommandResult[CommandResult["GaugeUpperInflectionPointNaN"] = 44] = "GaugeUpperInflectionPointNaN";
3448
+ CommandResult[CommandResult["GaugeLowerBiggerThanUpper"] = 45] = "GaugeLowerBiggerThanUpper";
3449
+ CommandResult[CommandResult["InvalidAutofillSelection"] = 46] = "InvalidAutofillSelection";
3450
+ CommandResult[CommandResult["WrongComposerSelection"] = 47] = "WrongComposerSelection";
3451
+ CommandResult[CommandResult["MinBiggerThanMax"] = 48] = "MinBiggerThanMax";
3452
+ CommandResult[CommandResult["LowerBiggerThanUpper"] = 49] = "LowerBiggerThanUpper";
3453
+ CommandResult[CommandResult["MidBiggerThanMax"] = 50] = "MidBiggerThanMax";
3454
+ CommandResult[CommandResult["MinBiggerThanMid"] = 51] = "MinBiggerThanMid";
3455
+ CommandResult[CommandResult["FirstArgMissing"] = 52] = "FirstArgMissing";
3456
+ CommandResult[CommandResult["SecondArgMissing"] = 53] = "SecondArgMissing";
3457
+ CommandResult[CommandResult["MinNaN"] = 54] = "MinNaN";
3458
+ CommandResult[CommandResult["MidNaN"] = 55] = "MidNaN";
3459
+ CommandResult[CommandResult["MaxNaN"] = 56] = "MaxNaN";
3460
+ CommandResult[CommandResult["ValueUpperInflectionNaN"] = 57] = "ValueUpperInflectionNaN";
3461
+ CommandResult[CommandResult["ValueLowerInflectionNaN"] = 58] = "ValueLowerInflectionNaN";
3462
+ CommandResult[CommandResult["MinInvalidFormula"] = 59] = "MinInvalidFormula";
3463
+ CommandResult[CommandResult["MidInvalidFormula"] = 60] = "MidInvalidFormula";
3464
+ CommandResult[CommandResult["MaxInvalidFormula"] = 61] = "MaxInvalidFormula";
3465
+ CommandResult[CommandResult["ValueUpperInvalidFormula"] = 62] = "ValueUpperInvalidFormula";
3466
+ CommandResult[CommandResult["ValueLowerInvalidFormula"] = 63] = "ValueLowerInvalidFormula";
3467
+ CommandResult[CommandResult["InvalidSortZone"] = 64] = "InvalidSortZone";
3468
+ CommandResult[CommandResult["WaitingSessionConfirmation"] = 65] = "WaitingSessionConfirmation";
3469
+ CommandResult[CommandResult["MergeOverlap"] = 66] = "MergeOverlap";
3470
+ CommandResult[CommandResult["TooManyHiddenElements"] = 67] = "TooManyHiddenElements";
3471
+ CommandResult[CommandResult["Readonly"] = 68] = "Readonly";
3472
+ CommandResult[CommandResult["InvalidViewportSize"] = 69] = "InvalidViewportSize";
3473
+ CommandResult[CommandResult["InvalidScrollingDirection"] = 70] = "InvalidScrollingDirection";
3474
+ CommandResult[CommandResult["FigureDoesNotExist"] = 71] = "FigureDoesNotExist";
3475
+ CommandResult[CommandResult["InvalidConditionalFormatId"] = 72] = "InvalidConditionalFormatId";
3476
+ CommandResult[CommandResult["InvalidCellPopover"] = 73] = "InvalidCellPopover";
3477
+ CommandResult[CommandResult["EmptyTarget"] = 74] = "EmptyTarget";
3478
+ CommandResult[CommandResult["InvalidFreezeQuantity"] = 75] = "InvalidFreezeQuantity";
3479
+ CommandResult[CommandResult["FrozenPaneOverlap"] = 76] = "FrozenPaneOverlap";
3480
+ CommandResult[CommandResult["ValuesNotChanged"] = 77] = "ValuesNotChanged";
3481
+ CommandResult[CommandResult["InvalidFilterZone"] = 78] = "InvalidFilterZone";
3482
+ CommandResult[CommandResult["FilterOverlap"] = 79] = "FilterOverlap";
3483
+ CommandResult[CommandResult["FilterNotFound"] = 80] = "FilterNotFound";
3484
+ CommandResult[CommandResult["MergeInFilter"] = 81] = "MergeInFilter";
3485
+ CommandResult[CommandResult["NonContinuousTargets"] = 82] = "NonContinuousTargets";
3486
+ CommandResult[CommandResult["DuplicatedFigureId"] = 83] = "DuplicatedFigureId";
3487
+ CommandResult[CommandResult["InvalidSelectionStep"] = 84] = "InvalidSelectionStep";
3488
+ CommandResult[CommandResult["DuplicatedChartId"] = 85] = "DuplicatedChartId";
3489
+ CommandResult[CommandResult["ChartDoesNotExist"] = 86] = "ChartDoesNotExist";
3490
+ CommandResult[CommandResult["InvalidHeaderIndex"] = 87] = "InvalidHeaderIndex";
3491
+ CommandResult[CommandResult["InvalidQuantity"] = 88] = "InvalidQuantity";
3492
+ CommandResult[CommandResult["NoChanges"] = 89] = "NoChanges";
3451
3493
  })(exports.CommandResult || (exports.CommandResult = {}));
3452
3494
 
3453
3495
  function isMatrix(x) {
@@ -4977,7 +5019,7 @@
4977
5019
  });
4978
5020
  }
4979
5021
  }
4980
- if (result.isCancelledBecause(63 /* CommandResult.InvalidSortZone */)) {
5022
+ if (result.isCancelledBecause(64 /* CommandResult.InvalidSortZone */)) {
4981
5023
  const { col, row } = anchor;
4982
5024
  env.model.selection.selectZone({ cell: { col, row }, zone });
4983
5025
  env.raiseError(_lt("Cannot sort. To sort, select only cells or only merges that have the same size."));
@@ -5000,13 +5042,13 @@
5000
5042
  };
5001
5043
  function interactiveAddFilter(env, sheetId, target) {
5002
5044
  const result = env.model.dispatch("CREATE_FILTER_TABLE", { target, sheetId });
5003
- if (result.isCancelledBecause(78 /* CommandResult.FilterOverlap */)) {
5045
+ if (result.isCancelledBecause(79 /* CommandResult.FilterOverlap */)) {
5004
5046
  env.raiseError(AddFilterInteractiveContent.filterOverlap);
5005
5047
  }
5006
- else if (result.isCancelledBecause(80 /* CommandResult.MergeInFilter */)) {
5048
+ else if (result.isCancelledBecause(81 /* CommandResult.MergeInFilter */)) {
5007
5049
  env.raiseError(AddFilterInteractiveContent.mergeInFilter);
5008
5050
  }
5009
- else if (result.isCancelledBecause(81 /* CommandResult.NonContinuousTargets */)) {
5051
+ else if (result.isCancelledBecause(82 /* CommandResult.NonContinuousTargets */)) {
5010
5052
  env.raiseError(AddFilterInteractiveContent.nonContinuousTargets);
5011
5053
  }
5012
5054
  }
@@ -5028,7 +5070,7 @@
5028
5070
  else if (result.reasons.includes(22 /* CommandResult.WrongFigurePasteOption */)) {
5029
5071
  env.raiseError(PasteInteractiveContent.wrongFigurePasteOption);
5030
5072
  }
5031
- else if (result.reasons.includes(75 /* CommandResult.FrozenPaneOverlap */)) {
5073
+ else if (result.reasons.includes(76 /* CommandResult.FrozenPaneOverlap */)) {
5032
5074
  env.raiseError(PasteInteractiveContent.frozenPaneOverlap);
5033
5075
  }
5034
5076
  }
@@ -5533,7 +5575,7 @@
5533
5575
  const CREATE_SHEET_ACTION = (env) => {
5534
5576
  const activeSheetId = env.model.getters.getActiveSheetId();
5535
5577
  const position = env.model.getters.getSheetIds().indexOf(activeSheetId) + 1;
5536
- const sheetId = env.model.uuidGenerator.uuidv4();
5578
+ const sheetId = env.model.uuidGenerator.smallUuid();
5537
5579
  env.model.dispatch("CREATE_SHEET", { sheetId, position });
5538
5580
  env.model.dispatch("ACTIVATE_SHEET", { sheetIdFrom: activeSheetId, sheetIdTo: sheetId });
5539
5581
  };
@@ -5544,7 +5586,7 @@
5544
5586
  const getters = env.model.getters;
5545
5587
  const zone = getters.getSelectedZone();
5546
5588
  let dataSetZone = zone;
5547
- const id = env.model.uuidGenerator.uuidv4();
5589
+ const id = env.model.uuidGenerator.smallUuid();
5548
5590
  let labelRange;
5549
5591
  if (zone.left !== zone.right) {
5550
5592
  dataSetZone = { ...zone, left: zone.left + 1 };
@@ -6020,7 +6062,7 @@
6020
6062
  name: _lt("Delete"),
6021
6063
  sequence: 10,
6022
6064
  isVisible: (env) => {
6023
- return env.model.getters.getSheetIds().length > 1;
6065
+ return env.model.getters.getVisibleSheetIds().length > 1;
6024
6066
  },
6025
6067
  action: (env) => env.askConfirmation(_lt("Are you sure you want to delete this sheet ?"), () => {
6026
6068
  env.model.dispatch("DELETE_SHEET", { sheetId: env.model.getters.getActiveSheetId() });
@@ -6031,7 +6073,7 @@
6031
6073
  sequence: 20,
6032
6074
  action: (env) => {
6033
6075
  const sheetIdFrom = env.model.getters.getActiveSheetId();
6034
- const sheetIdTo = env.model.uuidGenerator.uuidv4();
6076
+ const sheetIdTo = env.model.uuidGenerator.smallUuid();
6035
6077
  env.model.dispatch("DUPLICATE_SHEET", {
6036
6078
  sheetId: sheetIdFrom,
6037
6079
  sheetIdTo,
@@ -6079,22 +6121,22 @@
6079
6121
  const CfTerms = {
6080
6122
  Errors: {
6081
6123
  [25 /* CommandResult.InvalidRange */]: _lt("The range is invalid"),
6082
- [51 /* CommandResult.FirstArgMissing */]: _lt("The argument is missing. Please provide a value"),
6083
- [52 /* CommandResult.SecondArgMissing */]: _lt("The second argument is missing. Please provide a value"),
6084
- [53 /* CommandResult.MinNaN */]: _lt("The minpoint must be a number"),
6085
- [54 /* CommandResult.MidNaN */]: _lt("The midpoint must be a number"),
6086
- [55 /* CommandResult.MaxNaN */]: _lt("The maxpoint must be a number"),
6087
- [56 /* CommandResult.ValueUpperInflectionNaN */]: _lt("The first value must be a number"),
6088
- [57 /* CommandResult.ValueLowerInflectionNaN */]: _lt("The second value must be a number"),
6089
- [47 /* CommandResult.MinBiggerThanMax */]: _lt("Minimum must be smaller then Maximum"),
6090
- [50 /* CommandResult.MinBiggerThanMid */]: _lt("Minimum must be smaller then Midpoint"),
6091
- [49 /* CommandResult.MidBiggerThanMax */]: _lt("Midpoint must be smaller then Maximum"),
6092
- [48 /* CommandResult.LowerBiggerThanUpper */]: _lt("Lower inflection point must be smaller than upper inflection point"),
6093
- [58 /* CommandResult.MinInvalidFormula */]: _lt("Invalid Minpoint formula"),
6094
- [60 /* CommandResult.MaxInvalidFormula */]: _lt("Invalid Maxpoint formula"),
6095
- [59 /* CommandResult.MidInvalidFormula */]: _lt("Invalid Midpoint formula"),
6096
- [61 /* CommandResult.ValueUpperInvalidFormula */]: _lt("Invalid upper inflection point formula"),
6097
- [62 /* CommandResult.ValueLowerInvalidFormula */]: _lt("Invalid lower inflection point formula"),
6124
+ [52 /* CommandResult.FirstArgMissing */]: _lt("The argument is missing. Please provide a value"),
6125
+ [53 /* CommandResult.SecondArgMissing */]: _lt("The second argument is missing. Please provide a value"),
6126
+ [54 /* CommandResult.MinNaN */]: _lt("The minpoint must be a number"),
6127
+ [55 /* CommandResult.MidNaN */]: _lt("The midpoint must be a number"),
6128
+ [56 /* CommandResult.MaxNaN */]: _lt("The maxpoint must be a number"),
6129
+ [57 /* CommandResult.ValueUpperInflectionNaN */]: _lt("The first value must be a number"),
6130
+ [58 /* CommandResult.ValueLowerInflectionNaN */]: _lt("The second value must be a number"),
6131
+ [48 /* CommandResult.MinBiggerThanMax */]: _lt("Minimum must be smaller then Maximum"),
6132
+ [51 /* CommandResult.MinBiggerThanMid */]: _lt("Minimum must be smaller then Midpoint"),
6133
+ [50 /* CommandResult.MidBiggerThanMax */]: _lt("Midpoint must be smaller then Maximum"),
6134
+ [49 /* CommandResult.LowerBiggerThanUpper */]: _lt("Lower inflection point must be smaller than upper inflection point"),
6135
+ [59 /* CommandResult.MinInvalidFormula */]: _lt("Invalid Minpoint formula"),
6136
+ [61 /* CommandResult.MaxInvalidFormula */]: _lt("Invalid Maxpoint formula"),
6137
+ [60 /* CommandResult.MidInvalidFormula */]: _lt("Invalid Midpoint formula"),
6138
+ [62 /* CommandResult.ValueUpperInvalidFormula */]: _lt("Invalid upper inflection point formula"),
6139
+ [63 /* CommandResult.ValueLowerInvalidFormula */]: _lt("Invalid lower inflection point formula"),
6098
6140
  [24 /* CommandResult.EmptyRange */]: _lt("A range needs to be defined"),
6099
6141
  Unexpected: _lt("The rule is invalid for an unknown reason"),
6100
6142
  },
@@ -6122,20 +6164,20 @@
6122
6164
  Errors: {
6123
6165
  Unexpected: _lt("The chart definition is invalid for an unknown reason"),
6124
6166
  // BASIC CHART ERRORS (LINE | BAR | PIE)
6125
- [32 /* CommandResult.InvalidDataSet */]: _lt("The dataset is invalid"),
6126
- [33 /* CommandResult.InvalidLabelRange */]: _lt("Labels are invalid"),
6167
+ [33 /* CommandResult.InvalidDataSet */]: _lt("The dataset is invalid"),
6168
+ [34 /* CommandResult.InvalidLabelRange */]: _lt("Labels are invalid"),
6127
6169
  // SCORECARD CHART ERRORS
6128
- [34 /* CommandResult.InvalidScorecardKeyValue */]: _lt("The key value is invalid"),
6129
- [35 /* CommandResult.InvalidScorecardBaseline */]: _lt("The baseline value is invalid"),
6170
+ [35 /* CommandResult.InvalidScorecardKeyValue */]: _lt("The key value is invalid"),
6171
+ [36 /* CommandResult.InvalidScorecardBaseline */]: _lt("The baseline value is invalid"),
6130
6172
  // GAUGE CHART ERRORS
6131
- [36 /* CommandResult.InvalidGaugeDataRange */]: _lt("The data range is invalid"),
6132
- [37 /* CommandResult.EmptyGaugeRangeMin */]: _lt("A minimum range limit value is needed"),
6133
- [38 /* CommandResult.GaugeRangeMinNaN */]: _lt("The minimum range limit value must be a number"),
6134
- [39 /* CommandResult.EmptyGaugeRangeMax */]: _lt("A maximum range limit value is needed"),
6135
- [40 /* CommandResult.GaugeRangeMaxNaN */]: _lt("The maximum range limit value must be a number"),
6136
- [41 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */]: _lt("Minimum range limit must be smaller than maximum range limit"),
6137
- [42 /* CommandResult.GaugeLowerInflectionPointNaN */]: _lt("The lower inflection point value must be a number"),
6138
- [43 /* CommandResult.GaugeUpperInflectionPointNaN */]: _lt("The upper inflection point value must be a number"),
6173
+ [37 /* CommandResult.InvalidGaugeDataRange */]: _lt("The data range is invalid"),
6174
+ [38 /* CommandResult.EmptyGaugeRangeMin */]: _lt("A minimum range limit value is needed"),
6175
+ [39 /* CommandResult.GaugeRangeMinNaN */]: _lt("The minimum range limit value must be a number"),
6176
+ [40 /* CommandResult.EmptyGaugeRangeMax */]: _lt("A maximum range limit value is needed"),
6177
+ [41 /* CommandResult.GaugeRangeMaxNaN */]: _lt("The maximum range limit value must be a number"),
6178
+ [42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */]: _lt("Minimum range limit must be smaller than maximum range limit"),
6179
+ [43 /* CommandResult.GaugeLowerInflectionPointNaN */]: _lt("The lower inflection point value must be a number"),
6180
+ [44 /* CommandResult.GaugeUpperInflectionPointNaN */]: _lt("The upper inflection point value must be a number"),
6139
6181
  },
6140
6182
  };
6141
6183
  const NumberFormatTerms = {
@@ -6159,7 +6201,7 @@
6159
6201
  const sheetId = env.model.getters.getActiveSheetId();
6160
6202
  const cmd = dimension === "COL" ? "FREEZE_COLUMNS" : "FREEZE_ROWS";
6161
6203
  const result = env.model.dispatch(cmd, { sheetId, quantity: base });
6162
- if (result.isCancelledBecause(65 /* CommandResult.MergeOverlap */)) {
6204
+ if (result.isCancelledBecause(66 /* CommandResult.MergeOverlap */)) {
6163
6205
  env.raiseError(MergeErrorMessage);
6164
6206
  }
6165
6207
  }
@@ -6670,7 +6712,7 @@
6670
6712
  class SelectionInput extends owl.Component {
6671
6713
  constructor() {
6672
6714
  super(...arguments);
6673
- this.id = uuidGenerator$1.uuidv4();
6715
+ this.id = uuidGenerator$1.smallUuid();
6674
6716
  this.previousRanges = this.props.ranges || [];
6675
6717
  this.originSheet = this.env.model.getters.getActiveSheetId();
6676
6718
  this.state = owl.useState({
@@ -6805,11 +6847,11 @@
6805
6847
  }
6806
6848
  get isDatasetInvalid() {
6807
6849
  var _a;
6808
- return !!((_a = this.state.datasetDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(32 /* CommandResult.InvalidDataSet */));
6850
+ return !!((_a = this.state.datasetDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(33 /* CommandResult.InvalidDataSet */));
6809
6851
  }
6810
6852
  get isLabelInvalid() {
6811
6853
  var _a;
6812
- return !!((_a = this.state.labelsDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(33 /* CommandResult.InvalidLabelRange */));
6854
+ return !!((_a = this.state.labelsDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(34 /* CommandResult.InvalidLabelRange */));
6813
6855
  }
6814
6856
  onUpdateDataSetsHaveTitle(ev) {
6815
6857
  this.props.updateChart(this.props.figureId, {
@@ -7153,11 +7195,11 @@
7153
7195
  if (definition.dataSets) {
7154
7196
  const invalidRanges = definition.dataSets.find((range) => !rangeReference.test(range)) !== undefined;
7155
7197
  if (invalidRanges) {
7156
- return 32 /* CommandResult.InvalidDataSet */;
7198
+ return 33 /* CommandResult.InvalidDataSet */;
7157
7199
  }
7158
7200
  const zones = definition.dataSets.map(toUnboundedZone);
7159
7201
  if (zones.some((zone) => zone.top !== zone.bottom && isFullRow(zone))) {
7160
- return 32 /* CommandResult.InvalidDataSet */;
7202
+ return 33 /* CommandResult.InvalidDataSet */;
7161
7203
  }
7162
7204
  }
7163
7205
  return 0 /* CommandResult.Success */;
@@ -7166,7 +7208,7 @@
7166
7208
  if (definition.labelRange) {
7167
7209
  const invalidLabels = !rangeReference.test(definition.labelRange || "");
7168
7210
  if (invalidLabels) {
7169
- return 33 /* CommandResult.InvalidLabelRange */;
7211
+ return 34 /* CommandResult.InvalidLabelRange */;
7170
7212
  }
7171
7213
  }
7172
7214
  return 0 /* CommandResult.Success */;
@@ -7627,7 +7669,7 @@
7627
7669
  });
7628
7670
  function isDataRangeValid(definition) {
7629
7671
  return definition.dataRange && !rangeReference.test(definition.dataRange)
7630
- ? 36 /* CommandResult.InvalidGaugeDataRange */
7672
+ ? 37 /* CommandResult.InvalidGaugeDataRange */
7631
7673
  : 0 /* CommandResult.Success */;
7632
7674
  }
7633
7675
  function checkRangeLimits(check, batchValidations) {
@@ -7659,7 +7701,7 @@
7659
7701
  function checkRangeMinBiggerThanRangeMax(definition) {
7660
7702
  if (definition.sectionRule) {
7661
7703
  if (Number(definition.sectionRule.rangeMin) >= Number(definition.sectionRule.rangeMax)) {
7662
- return 41 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */;
7704
+ return 42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */;
7663
7705
  }
7664
7706
  }
7665
7707
  return 0 /* CommandResult.Success */;
@@ -7668,9 +7710,9 @@
7668
7710
  if (value === "") {
7669
7711
  switch (valueName) {
7670
7712
  case "rangeMin":
7671
- return 37 /* CommandResult.EmptyGaugeRangeMin */;
7713
+ return 38 /* CommandResult.EmptyGaugeRangeMin */;
7672
7714
  case "rangeMax":
7673
- return 39 /* CommandResult.EmptyGaugeRangeMax */;
7715
+ return 40 /* CommandResult.EmptyGaugeRangeMax */;
7674
7716
  }
7675
7717
  }
7676
7718
  return 0 /* CommandResult.Success */;
@@ -7679,13 +7721,13 @@
7679
7721
  if (isNaN(value)) {
7680
7722
  switch (valueName) {
7681
7723
  case "rangeMin":
7682
- return 38 /* CommandResult.GaugeRangeMinNaN */;
7724
+ return 39 /* CommandResult.GaugeRangeMinNaN */;
7683
7725
  case "rangeMax":
7684
- return 40 /* CommandResult.GaugeRangeMaxNaN */;
7726
+ return 41 /* CommandResult.GaugeRangeMaxNaN */;
7685
7727
  case "lowerInflectionPointValue":
7686
- return 42 /* CommandResult.GaugeLowerInflectionPointNaN */;
7728
+ return 43 /* CommandResult.GaugeLowerInflectionPointNaN */;
7687
7729
  case "upperInflectionPointValue":
7688
- return 43 /* CommandResult.GaugeUpperInflectionPointNaN */;
7730
+ return 44 /* CommandResult.GaugeUpperInflectionPointNaN */;
7689
7731
  }
7690
7732
  }
7691
7733
  return 0 /* CommandResult.Success */;
@@ -8426,7 +8468,7 @@
8426
8468
  const dataset = {
8427
8469
  label,
8428
8470
  data,
8429
- borderColor: "#FFFFFF",
8471
+ borderColor: chart.background || "#FFFFFF",
8430
8472
  backgroundColor,
8431
8473
  };
8432
8474
  config.data.datasets.push(dataset);
@@ -8445,12 +8487,12 @@
8445
8487
  });
8446
8488
  function checkKeyValue(definition) {
8447
8489
  return definition.keyValue && !rangeReference.test(definition.keyValue)
8448
- ? 34 /* CommandResult.InvalidScorecardKeyValue */
8490
+ ? 35 /* CommandResult.InvalidScorecardKeyValue */
8449
8491
  : 0 /* CommandResult.Success */;
8450
8492
  }
8451
8493
  function checkBaseline(definition) {
8452
8494
  return definition.baseline && !rangeReference.test(definition.baseline)
8453
- ? 35 /* CommandResult.InvalidScorecardBaseline */
8495
+ ? 36 /* CommandResult.InvalidScorecardBaseline */
8454
8496
  : 0 /* CommandResult.Success */;
8455
8497
  }
8456
8498
  class ScorecardChart$1 extends AbstractChart {
@@ -8879,7 +8921,7 @@
8879
8921
  }
8880
8922
  get isDataRangeInvalid() {
8881
8923
  var _a;
8882
- return !!((_a = this.state.dataRangeDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(36 /* CommandResult.InvalidGaugeDataRange */));
8924
+ return !!((_a = this.state.dataRangeDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(37 /* CommandResult.InvalidGaugeDataRange */));
8883
8925
  }
8884
8926
  onDataRangeChanged(ranges) {
8885
8927
  this.dataRange = ranges[0];
@@ -8966,28 +9008,28 @@
8966
9008
  }
8967
9009
  isRangeMinInvalid() {
8968
9010
  var _a, _b, _c;
8969
- return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(37 /* CommandResult.EmptyGaugeRangeMin */)) ||
8970
- ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(38 /* CommandResult.GaugeRangeMinNaN */)) ||
8971
- ((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(41 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
9011
+ return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(38 /* CommandResult.EmptyGaugeRangeMin */)) ||
9012
+ ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(39 /* CommandResult.GaugeRangeMinNaN */)) ||
9013
+ ((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
8972
9014
  }
8973
9015
  isRangeMaxInvalid() {
8974
9016
  var _a, _b, _c;
8975
- return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(39 /* CommandResult.EmptyGaugeRangeMax */)) ||
8976
- ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(40 /* CommandResult.GaugeRangeMaxNaN */)) ||
8977
- ((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(41 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
9017
+ return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(40 /* CommandResult.EmptyGaugeRangeMax */)) ||
9018
+ ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(41 /* CommandResult.GaugeRangeMaxNaN */)) ||
9019
+ ((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
8978
9020
  }
8979
9021
  // ---------------------------------------------------------------------------
8980
9022
  // COLOR_SECTION_TEMPLATE
8981
9023
  // ---------------------------------------------------------------------------
8982
9024
  get isLowerInflectionPointInvalid() {
8983
9025
  var _a, _b;
8984
- return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(42 /* CommandResult.GaugeLowerInflectionPointNaN */)) ||
8985
- ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(44 /* CommandResult.GaugeLowerBiggerThanUpper */)));
9026
+ return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(43 /* CommandResult.GaugeLowerInflectionPointNaN */)) ||
9027
+ ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(45 /* CommandResult.GaugeLowerBiggerThanUpper */)));
8986
9028
  }
8987
9029
  get isUpperInflectionPointInvalid() {
8988
9030
  var _a, _b;
8989
- return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(43 /* CommandResult.GaugeUpperInflectionPointNaN */)) ||
8990
- ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(44 /* CommandResult.GaugeLowerBiggerThanUpper */)));
9031
+ return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(44 /* CommandResult.GaugeUpperInflectionPointNaN */)) ||
9032
+ ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(45 /* CommandResult.GaugeLowerBiggerThanUpper */)));
8991
9033
  }
8992
9034
  updateInflectionPointValue(attr, ev) {
8993
9035
  const sectionRule = deepCopy(this.props.definition.sectionRule);
@@ -9090,11 +9132,11 @@
9090
9132
  }
9091
9133
  get isKeyValueInvalid() {
9092
9134
  var _a;
9093
- return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(34 /* CommandResult.InvalidScorecardKeyValue */));
9135
+ return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(35 /* CommandResult.InvalidScorecardKeyValue */));
9094
9136
  }
9095
9137
  get isBaselineInvalid() {
9096
9138
  var _a;
9097
- return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(35 /* CommandResult.InvalidScorecardBaseline */));
9139
+ return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(36 /* CommandResult.InvalidScorecardBaseline */));
9098
9140
  }
9099
9141
  onKeyValueRangeChanged(ranges) {
9100
9142
  this.keyValue = ranges[0];
@@ -9787,7 +9829,7 @@
9787
9829
  rule: this.getEditorRule(),
9788
9830
  id: this.state.mode === "edit"
9789
9831
  ? this.state.currentCF.id
9790
- : this.env.model.uuidGenerator.uuidv4(),
9832
+ : this.env.model.uuidGenerator.smallUuid(),
9791
9833
  },
9792
9834
  ranges: this.state.currentCF.ranges.map((xc) => this.env.model.getters.getRangeDataFromXc(sheetId, xc)),
9793
9835
  sheetId,
@@ -9855,7 +9897,7 @@
9855
9897
  this.state.mode = "add";
9856
9898
  this.state.currentCFType = "CellIsRule";
9857
9899
  this.state.currentCF = {
9858
- id: this.env.model.uuidGenerator.uuidv4(),
9900
+ id: this.env.model.uuidGenerator.smallUuid(),
9859
9901
  ranges: this.env.model.getters
9860
9902
  .getSelectedZones()
9861
9903
  .map((zone) => this.env.model.getters.zoneToXC(this.env.model.getters.getActiveSheetId(), zone)),
@@ -9934,11 +9976,11 @@
9934
9976
  ****************************************************************************/
9935
9977
  get isValue1Invalid() {
9936
9978
  var _a;
9937
- return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(51 /* CommandResult.FirstArgMissing */));
9979
+ return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(52 /* CommandResult.FirstArgMissing */));
9938
9980
  }
9939
9981
  get isValue2Invalid() {
9940
9982
  var _a;
9941
- return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(52 /* CommandResult.SecondArgMissing */));
9983
+ return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(53 /* CommandResult.SecondArgMissing */));
9942
9984
  }
9943
9985
  toggleStyle(tool) {
9944
9986
  const style = this.state.rules.cellIs.style;
@@ -9955,17 +9997,17 @@
9955
9997
  isValueInvalid(threshold) {
9956
9998
  switch (threshold) {
9957
9999
  case "minimum":
9958
- return (this.state.errors.includes(58 /* CommandResult.MinInvalidFormula */) ||
9959
- this.state.errors.includes(50 /* CommandResult.MinBiggerThanMid */) ||
9960
- this.state.errors.includes(47 /* CommandResult.MinBiggerThanMax */) ||
9961
- this.state.errors.includes(53 /* CommandResult.MinNaN */));
10000
+ return (this.state.errors.includes(59 /* CommandResult.MinInvalidFormula */) ||
10001
+ this.state.errors.includes(51 /* CommandResult.MinBiggerThanMid */) ||
10002
+ this.state.errors.includes(48 /* CommandResult.MinBiggerThanMax */) ||
10003
+ this.state.errors.includes(54 /* CommandResult.MinNaN */));
9962
10004
  case "midpoint":
9963
- return (this.state.errors.includes(59 /* CommandResult.MidInvalidFormula */) ||
9964
- this.state.errors.includes(54 /* CommandResult.MidNaN */) ||
9965
- this.state.errors.includes(49 /* CommandResult.MidBiggerThanMax */));
10005
+ return (this.state.errors.includes(60 /* CommandResult.MidInvalidFormula */) ||
10006
+ this.state.errors.includes(55 /* CommandResult.MidNaN */) ||
10007
+ this.state.errors.includes(50 /* CommandResult.MidBiggerThanMax */));
9966
10008
  case "maximum":
9967
- return (this.state.errors.includes(60 /* CommandResult.MaxInvalidFormula */) ||
9968
- this.state.errors.includes(55 /* CommandResult.MaxNaN */));
10009
+ return (this.state.errors.includes(61 /* CommandResult.MaxInvalidFormula */) ||
10010
+ this.state.errors.includes(56 /* CommandResult.MaxNaN */));
9969
10011
  default:
9970
10012
  return false;
9971
10013
  }
@@ -10017,13 +10059,13 @@
10017
10059
  isInflectionPointInvalid(inflectionPoint) {
10018
10060
  switch (inflectionPoint) {
10019
10061
  case "lowerInflectionPoint":
10020
- return (this.state.errors.includes(57 /* CommandResult.ValueLowerInflectionNaN */) ||
10021
- this.state.errors.includes(62 /* CommandResult.ValueLowerInvalidFormula */) ||
10022
- this.state.errors.includes(48 /* CommandResult.LowerBiggerThanUpper */));
10062
+ return (this.state.errors.includes(58 /* CommandResult.ValueLowerInflectionNaN */) ||
10063
+ this.state.errors.includes(63 /* CommandResult.ValueLowerInvalidFormula */) ||
10064
+ this.state.errors.includes(49 /* CommandResult.LowerBiggerThanUpper */));
10023
10065
  case "upperInflectionPoint":
10024
- return (this.state.errors.includes(56 /* CommandResult.ValueUpperInflectionNaN */) ||
10025
- this.state.errors.includes(61 /* CommandResult.ValueUpperInvalidFormula */) ||
10026
- this.state.errors.includes(48 /* CommandResult.LowerBiggerThanUpper */));
10066
+ return (this.state.errors.includes(57 /* CommandResult.ValueUpperInflectionNaN */) ||
10067
+ this.state.errors.includes(62 /* CommandResult.ValueUpperInvalidFormula */) ||
10068
+ this.state.errors.includes(49 /* CommandResult.LowerBiggerThanUpper */));
10027
10069
  default:
10028
10070
  return true;
10029
10071
  }
@@ -10343,7 +10385,7 @@
10343
10385
  this.uuidGenerator = new UuidGenerator();
10344
10386
  }
10345
10387
  add(name, value) {
10346
- const component = { ...value, id: this.uuidGenerator.uuidv4() };
10388
+ const component = { ...value, id: this.uuidGenerator.smallUuid() };
10347
10389
  return super.add(name, component);
10348
10390
  }
10349
10391
  }
@@ -12341,6 +12383,26 @@
12341
12383
  isExported: true,
12342
12384
  };
12343
12385
  // -----------------------------------------------------------------------------
12386
+ // LOG
12387
+ // -----------------------------------------------------------------------------
12388
+ const LOG = {
12389
+ description: _lt("The logarithm of a number, for a given base."),
12390
+ args: args(`
12391
+ value (number) ${_lt("The value for which to calculate the logarithm, base e.")}
12392
+ base (number, default=10) ${_lt("The base of the logarithm.")}
12393
+ `),
12394
+ returns: ["NUMBER"],
12395
+ compute: function (value, base = 10) {
12396
+ const _value = toNumber(value);
12397
+ const _base = toNumber(base);
12398
+ assert(() => _value > 0, _lt("The value (%s) must be strictly positive.", _value.toString()));
12399
+ assert(() => _base > 0, _lt("The base (%s) must be strictly positive.", _base.toString()));
12400
+ assert(() => _base !== 1, _lt("The base must be different from 1."));
12401
+ return Math.log10(_value) / Math.log10(_base);
12402
+ },
12403
+ isExported: true,
12404
+ };
12405
+ // -----------------------------------------------------------------------------
12344
12406
  // MOD
12345
12407
  // -----------------------------------------------------------------------------
12346
12408
  const MOD = {
@@ -12809,6 +12871,7 @@
12809
12871
  ISO_CEILING: ISO_CEILING,
12810
12872
  ISODD: ISODD,
12811
12873
  LN: LN,
12874
+ LOG: LOG,
12812
12875
  MOD: MOD,
12813
12876
  ODD: ODD,
12814
12877
  PI: PI,
@@ -19685,7 +19748,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
19685
19748
  validateSelection(length, start, end) {
19686
19749
  return start >= 0 && start <= length && end >= 0 && end <= length
19687
19750
  ? 0 /* CommandResult.Success */
19688
- : 46 /* CommandResult.WrongComposerSelection */;
19751
+ : 47 /* CommandResult.WrongComposerSelection */;
19689
19752
  }
19690
19753
  onColumnsRemoved(cmd) {
19691
19754
  if (cmd.elements.includes(this.col) && this.mode !== "inactive") {
@@ -27245,7 +27308,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
27245
27308
  for (const sheet of data.sheets || []) {
27246
27309
  for (const figure of sheet.figures || []) {
27247
27310
  if (figureIds.has(figure.id)) {
27248
- figure.id += uuidGenerator.uuidv4();
27311
+ figure.id += uuidGenerator.smallUuid();
27249
27312
  }
27250
27313
  figureIds.add(figure.id);
27251
27314
  }
@@ -27930,7 +27993,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
27930
27993
  const currentBorder = this.getCellBorder(cmd.sheetId, cmd.col, cmd.row);
27931
27994
  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);
27932
27995
  if ((!currentBorder && areAllNewBordersUndefined) || deepEquals(currentBorder, cmd.border)) {
27933
- return 88 /* CommandResult.NoChanges */;
27996
+ return 89 /* CommandResult.NoChanges */;
27934
27997
  }
27935
27998
  return 0 /* CommandResult.Success */;
27936
27999
  }
@@ -28036,11 +28099,16 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28036
28099
  // Command Handling
28037
28100
  // ---------------------------------------------------------------------------
28038
28101
  allowDispatch(cmd) {
28102
+ var _a;
28039
28103
  switch (cmd.type) {
28040
28104
  case "UPDATE_CELL":
28041
28105
  return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessUpdateCell);
28042
28106
  case "CLEAR_CELL":
28043
28107
  return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessClearCell);
28108
+ case "UPDATE_CELL_POSITION":
28109
+ return !cmd.cellId || ((_a = this.cells[cmd.sheetId]) === null || _a === void 0 ? void 0 : _a[cmd.cellId])
28110
+ ? 0 /* CommandResult.Success */
28111
+ : 28 /* CommandResult.InvalidCellId */;
28044
28112
  default:
28045
28113
  return 0 /* CommandResult.Success */;
28046
28114
  }
@@ -28079,6 +28147,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28079
28147
  format: "",
28080
28148
  });
28081
28149
  break;
28150
+ case "DELETE_SHEET": {
28151
+ this.history.update("cells", cmd.sheetId, undefined);
28152
+ }
28082
28153
  }
28083
28154
  }
28084
28155
  /**
@@ -28394,9 +28465,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28394
28465
  checkUselessClearCell(cmd) {
28395
28466
  const cell = this.getters.getCell(cmd.sheetId, cmd.col, cmd.row);
28396
28467
  if (!cell)
28397
- return 88 /* CommandResult.NoChanges */;
28468
+ return 89 /* CommandResult.NoChanges */;
28398
28469
  if (!cell.content && !cell.style && !cell.format) {
28399
- return 88 /* CommandResult.NoChanges */;
28470
+ return 89 /* CommandResult.NoChanges */;
28400
28471
  }
28401
28472
  return 0 /* CommandResult.Success */;
28402
28473
  }
@@ -28408,7 +28479,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28408
28479
  if ((!hasContent || (cell === null || cell === void 0 ? void 0 : cell.content) === cmd.content) &&
28409
28480
  (!hasStyle || deepEquals(cell === null || cell === void 0 ? void 0 : cell.style, cmd.style)) &&
28410
28481
  (!hasFormat || (cell === null || cell === void 0 ? void 0 : cell.format) === cmd.format)) {
28411
- return 88 /* CommandResult.NoChanges */;
28482
+ return 89 /* CommandResult.NoChanges */;
28412
28483
  }
28413
28484
  return 0 /* CommandResult.Success */;
28414
28485
  }
@@ -28617,13 +28688,13 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28617
28688
  }
28618
28689
  checkChartDuplicate(cmd) {
28619
28690
  return this.getters.getFigureSheetId(cmd.id)
28620
- ? 84 /* CommandResult.DuplicatedChartId */
28691
+ ? 85 /* CommandResult.DuplicatedChartId */
28621
28692
  : 0 /* CommandResult.Success */;
28622
28693
  }
28623
28694
  checkChartExists(cmd) {
28624
28695
  return this.getters.getFigureSheetId(cmd.id)
28625
28696
  ? 0 /* CommandResult.Success */
28626
- : 85 /* CommandResult.ChartDoesNotExist */;
28697
+ : 86 /* CommandResult.ChartDoesNotExist */;
28627
28698
  }
28628
28699
  }
28629
28700
  ChartPlugin.getters = [
@@ -28831,10 +28902,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28831
28902
  return 27 /* CommandResult.InvalidSheetId */;
28832
28903
  const ruleIndex = this.cfRules[sheetId].findIndex((cf) => cf.id === cfId);
28833
28904
  if (ruleIndex === -1)
28834
- return 71 /* CommandResult.InvalidConditionalFormatId */;
28905
+ return 72 /* CommandResult.InvalidConditionalFormatId */;
28835
28906
  const cfIndex2 = direction === "up" ? ruleIndex - 1 : ruleIndex + 1;
28836
28907
  if (cfIndex2 < 0 || cfIndex2 >= this.cfRules[sheetId].length) {
28837
- return 71 /* CommandResult.InvalidConditionalFormatId */;
28908
+ return 72 /* CommandResult.InvalidConditionalFormatId */;
28838
28909
  }
28839
28910
  return 0 /* CommandResult.Success */;
28840
28911
  }
@@ -28875,10 +28946,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28875
28946
  const errors = [];
28876
28947
  const isEmpty = (value) => value === undefined || value === "";
28877
28948
  if (expectedNumber >= 1 && isEmpty(rule.values[0])) {
28878
- errors.push(51 /* CommandResult.FirstArgMissing */);
28949
+ errors.push(52 /* CommandResult.FirstArgMissing */);
28879
28950
  }
28880
28951
  if (expectedNumber >= 2 && isEmpty(rule.values[1])) {
28881
- errors.push(52 /* CommandResult.SecondArgMissing */);
28952
+ errors.push(53 /* CommandResult.SecondArgMissing */);
28882
28953
  }
28883
28954
  return errors.length ? errors : 0 /* CommandResult.Success */;
28884
28955
  }
@@ -28890,15 +28961,15 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28890
28961
  (threshold.value === "" || isNaN(threshold.value))) {
28891
28962
  switch (thresholdName) {
28892
28963
  case "min":
28893
- return 53 /* CommandResult.MinNaN */;
28964
+ return 54 /* CommandResult.MinNaN */;
28894
28965
  case "max":
28895
- return 55 /* CommandResult.MaxNaN */;
28966
+ return 56 /* CommandResult.MaxNaN */;
28896
28967
  case "mid":
28897
- return 54 /* CommandResult.MidNaN */;
28968
+ return 55 /* CommandResult.MidNaN */;
28898
28969
  case "upperInflectionPoint":
28899
- return 56 /* CommandResult.ValueUpperInflectionNaN */;
28970
+ return 57 /* CommandResult.ValueUpperInflectionNaN */;
28900
28971
  case "lowerInflectionPoint":
28901
- return 57 /* CommandResult.ValueLowerInflectionNaN */;
28972
+ return 58 /* CommandResult.ValueLowerInflectionNaN */;
28902
28973
  }
28903
28974
  }
28904
28975
  return 0 /* CommandResult.Success */;
@@ -28912,15 +28983,15 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28912
28983
  catch (error) {
28913
28984
  switch (thresholdName) {
28914
28985
  case "min":
28915
- return 58 /* CommandResult.MinInvalidFormula */;
28986
+ return 59 /* CommandResult.MinInvalidFormula */;
28916
28987
  case "max":
28917
- return 60 /* CommandResult.MaxInvalidFormula */;
28988
+ return 61 /* CommandResult.MaxInvalidFormula */;
28918
28989
  case "mid":
28919
- return 59 /* CommandResult.MidInvalidFormula */;
28990
+ return 60 /* CommandResult.MidInvalidFormula */;
28920
28991
  case "upperInflectionPoint":
28921
- return 61 /* CommandResult.ValueUpperInvalidFormula */;
28992
+ return 62 /* CommandResult.ValueUpperInvalidFormula */;
28922
28993
  case "lowerInflectionPoint":
28923
- return 62 /* CommandResult.ValueLowerInvalidFormula */;
28994
+ return 63 /* CommandResult.ValueLowerInvalidFormula */;
28924
28995
  }
28925
28996
  }
28926
28997
  return 0 /* CommandResult.Success */;
@@ -28937,7 +29008,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28937
29008
  if (["number", "percentage", "percentile"].includes(rule.lowerInflectionPoint.type) &&
28938
29009
  rule.lowerInflectionPoint.type === rule.upperInflectionPoint.type &&
28939
29010
  Number(minValue) > Number(maxValue)) {
28940
- return 48 /* CommandResult.LowerBiggerThanUpper */;
29011
+ return 49 /* CommandResult.LowerBiggerThanUpper */;
28941
29012
  }
28942
29013
  return 0 /* CommandResult.Success */;
28943
29014
  }
@@ -28947,7 +29018,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28947
29018
  if (["number", "percentage", "percentile"].includes(rule.minimum.type) &&
28948
29019
  rule.minimum.type === rule.maximum.type &&
28949
29020
  stringToNumber(minValue) >= stringToNumber(maxValue)) {
28950
- return 47 /* CommandResult.MinBiggerThanMax */;
29021
+ return 48 /* CommandResult.MinBiggerThanMax */;
28951
29022
  }
28952
29023
  return 0 /* CommandResult.Success */;
28953
29024
  }
@@ -28959,7 +29030,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28959
29030
  ["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
28960
29031
  rule.midpoint.type === rule.maximum.type &&
28961
29032
  stringToNumber(midValue) >= stringToNumber(maxValue)) {
28962
- return 49 /* CommandResult.MidBiggerThanMax */;
29033
+ return 50 /* CommandResult.MidBiggerThanMax */;
28963
29034
  }
28964
29035
  return 0 /* CommandResult.Success */;
28965
29036
  }
@@ -28971,7 +29042,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
28971
29042
  ["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
28972
29043
  rule.minimum.type === rule.midpoint.type &&
28973
29044
  stringToNumber(minValue) >= stringToNumber(midValue)) {
28974
- return 50 /* CommandResult.MinBiggerThanMid */;
29045
+ return 51 /* CommandResult.MinBiggerThanMid */;
28975
29046
  }
28976
29047
  return 0 /* CommandResult.Success */;
28977
29048
  }
@@ -29081,13 +29152,13 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29081
29152
  checkFigureExists(sheetId, figureId) {
29082
29153
  var _a;
29083
29154
  if (((_a = this.figures[sheetId]) === null || _a === void 0 ? void 0 : _a[figureId]) === undefined) {
29084
- return 70 /* CommandResult.FigureDoesNotExist */;
29155
+ return 71 /* CommandResult.FigureDoesNotExist */;
29085
29156
  }
29086
29157
  return 0 /* CommandResult.Success */;
29087
29158
  }
29088
29159
  checkFigureDuplicate(figureId) {
29089
29160
  if (Object.values(this.figures).find((sheet) => sheet === null || sheet === void 0 ? void 0 : sheet[figureId])) {
29090
- return 82 /* CommandResult.DuplicatedFigureId */;
29161
+ return 83 /* CommandResult.DuplicatedFigureId */;
29091
29162
  }
29092
29163
  return 0 /* CommandResult.Success */;
29093
29164
  }
@@ -29135,10 +29206,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29135
29206
  this.filters = [];
29136
29207
  this.zone = zone;
29137
29208
  const uuid = new UuidGenerator();
29138
- this.id = uuid.uuidv4();
29209
+ this.id = uuid.smallUuid();
29139
29210
  for (const i of range(zone.left, zone.right + 1)) {
29140
29211
  const filterZone = { ...this.zone, left: i, right: i };
29141
- this.filters.push(new Filter(uuid.uuidv4(), filterZone));
29212
+ this.filters.push(new Filter(uuid.smallUuid(), filterZone));
29142
29213
  }
29143
29214
  }
29144
29215
  /** Get zone of the table without the headers */
@@ -29189,12 +29260,12 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29189
29260
  switch (cmd.type) {
29190
29261
  case "CREATE_FILTER_TABLE":
29191
29262
  if (!areZonesContinuous(...cmd.target)) {
29192
- return 81 /* CommandResult.NonContinuousTargets */;
29263
+ return 82 /* CommandResult.NonContinuousTargets */;
29193
29264
  }
29194
29265
  const zone = union(...cmd.target);
29195
29266
  const checkFilterOverlap = () => {
29196
29267
  if (this.getFilterTables(cmd.sheetId).some((filter) => overlap(filter.zone, zone))) {
29197
- return 78 /* CommandResult.FilterOverlap */;
29268
+ return 79 /* CommandResult.FilterOverlap */;
29198
29269
  }
29199
29270
  return 0 /* CommandResult.Success */;
29200
29271
  };
@@ -29202,7 +29273,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29202
29273
  const mergesInTarget = this.getters.getMergesInZone(cmd.sheetId, zone);
29203
29274
  for (let merge of mergesInTarget) {
29204
29275
  if (overlap(zone, merge)) {
29205
- return 80 /* CommandResult.MergeInFilter */;
29276
+ return 81 /* CommandResult.MergeInFilter */;
29206
29277
  }
29207
29278
  }
29208
29279
  return 0 /* CommandResult.Success */;
@@ -29212,7 +29283,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29212
29283
  for (let merge of cmd.target) {
29213
29284
  for (let filterTable of this.getFilterTables(cmd.sheetId)) {
29214
29285
  if (overlap(filterTable.zone, merge)) {
29215
- return 80 /* CommandResult.MergeInFilter */;
29286
+ return 81 /* CommandResult.MergeInFilter */;
29216
29287
  }
29217
29288
  }
29218
29289
  }
@@ -29318,7 +29389,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29318
29389
  if (filters.length < zoneToDimension(zone).width) {
29319
29390
  for (let col = zone.left; col <= zone.right; col++) {
29320
29391
  if (!filters.find((filter) => filter.col === col)) {
29321
- filters.push(new Filter(this.uuidGenerator.uuidv4(), { ...zone, left: col, right: col }));
29392
+ filters.push(new Filter(this.uuidGenerator.smallUuid(), { ...zone, left: col, right: col }));
29322
29393
  }
29323
29394
  }
29324
29395
  filters.sort((f1, f2) => f1.col - f2.col);
@@ -29722,10 +29793,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
29722
29793
  : this.getters.getNumberRows(cmd.sheetId);
29723
29794
  const hiddenElements = new Set((hiddenGroup || []).flat().concat(cmd.elements));
29724
29795
  if (hiddenElements.size >= elements) {
29725
- return 66 /* CommandResult.TooManyHiddenElements */;
29796
+ return 67 /* CommandResult.TooManyHiddenElements */;
29726
29797
  }
29727
29798
  else if (largeMin(cmd.elements) < 0 || largeMax(cmd.elements) > elements) {
29728
- return 86 /* CommandResult.InvalidHeaderIndex */;
29799
+ return 87 /* CommandResult.InvalidHeaderIndex */;
29729
29800
  }
29730
29801
  else {
29731
29802
  return 0 /* CommandResult.Success */;
@@ -30128,7 +30199,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
30128
30199
  for (const zone of target) {
30129
30200
  for (const zone2 of target) {
30130
30201
  if (zone !== zone2 && overlap(zone, zone2)) {
30131
- return 65 /* CommandResult.MergeOverlap */;
30202
+ return 66 /* CommandResult.MergeOverlap */;
30132
30203
  }
30133
30204
  }
30134
30205
  }
@@ -30142,7 +30213,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
30142
30213
  for (const zone of target) {
30143
30214
  if ((zone.left < xSplit && zone.right >= xSplit) ||
30144
30215
  (zone.top < ySplit && zone.bottom >= ySplit)) {
30145
- return 75 /* CommandResult.FrozenPaneOverlap */;
30216
+ return 76 /* CommandResult.FrozenPaneOverlap */;
30146
30217
  }
30147
30218
  }
30148
30219
  return 0 /* CommandResult.Success */;
@@ -30360,6 +30431,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
30360
30431
  case "CREATE_SHEET": {
30361
30432
  return this.checkValidations(cmd, this.checkSheetName, this.checkSheetPosition);
30362
30433
  }
30434
+ case "DUPLICATE_SHEET": {
30435
+ return this.sheets[cmd.sheetIdTo] ? 12 /* CommandResult.DuplicatedSheetId */ : 0 /* CommandResult.Success */;
30436
+ }
30363
30437
  case "MOVE_SHEET":
30364
30438
  const currentIndex = this.orderedSheetIds.indexOf(cmd.sheetId);
30365
30439
  if (cmd.direction === "left") {
@@ -30381,7 +30455,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
30381
30455
  case "RENAME_SHEET":
30382
30456
  return this.isRenameAllowed(cmd);
30383
30457
  case "DELETE_SHEET":
30384
- return this.orderedSheetIds.length > 1
30458
+ return this.getVisibleSheetIds().length > 1
30385
30459
  ? 0 /* CommandResult.Success */
30386
30460
  : 9 /* CommandResult.NotEnoughSheets */;
30387
30461
  case "ADD_COLUMNS_ROWS":
@@ -30389,10 +30463,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
30389
30463
  ? this.getNumberCols(cmd.sheetId)
30390
30464
  : this.getNumberRows(cmd.sheetId);
30391
30465
  if (cmd.base < 0 || cmd.base >= elements) {
30392
- return 86 /* CommandResult.InvalidHeaderIndex */;
30466
+ return 87 /* CommandResult.InvalidHeaderIndex */;
30393
30467
  }
30394
30468
  else if (cmd.quantity <= 0) {
30395
- return 87 /* CommandResult.InvalidQuantity */;
30469
+ return 88 /* CommandResult.InvalidQuantity */;
30396
30470
  }
30397
30471
  return 0 /* CommandResult.Success */;
30398
30472
  case "REMOVE_COLUMNS_ROWS": {
@@ -30400,7 +30474,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
30400
30474
  ? this.getNumberCols(cmd.sheetId)
30401
30475
  : this.getNumberRows(cmd.sheetId);
30402
30476
  if (largeMin(cmd.elements) < 0 || largeMax(cmd.elements) > elements) {
30403
- return 86 /* CommandResult.InvalidHeaderIndex */;
30477
+ return 87 /* CommandResult.InvalidHeaderIndex */;
30404
30478
  }
30405
30479
  else if (this.checkElementsIncludeAllNonFrozenHeaders(cmd.sheetId, cmd.dimension, cmd.elements)) {
30406
30480
  return 8 /* CommandResult.NotEnoughElements */;
@@ -30857,18 +30931,18 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
30857
30931
  checkRowFreezeQuantity(cmd) {
30858
30932
  return cmd.quantity >= 1 && cmd.quantity < this.getNumberRows(cmd.sheetId)
30859
30933
  ? 0 /* CommandResult.Success */
30860
- : 74 /* CommandResult.InvalidFreezeQuantity */;
30934
+ : 75 /* CommandResult.InvalidFreezeQuantity */;
30861
30935
  }
30862
30936
  checkColFreezeQuantity(cmd) {
30863
30937
  return cmd.quantity >= 1 && cmd.quantity < this.getNumberCols(cmd.sheetId)
30864
30938
  ? 0 /* CommandResult.Success */
30865
- : 74 /* CommandResult.InvalidFreezeQuantity */;
30939
+ : 75 /* CommandResult.InvalidFreezeQuantity */;
30866
30940
  }
30867
30941
  checkRowFreezeOverlapMerge(cmd) {
30868
30942
  const merges = this.getters.getMerges(cmd.sheetId);
30869
30943
  for (let merge of merges) {
30870
30944
  if (merge.top < cmd.quantity && cmd.quantity <= merge.bottom) {
30871
- return 65 /* CommandResult.MergeOverlap */;
30945
+ return 66 /* CommandResult.MergeOverlap */;
30872
30946
  }
30873
30947
  }
30874
30948
  return 0 /* CommandResult.Success */;
@@ -30877,7 +30951,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
30877
30951
  const merges = this.getters.getMerges(cmd.sheetId);
30878
30952
  for (let merge of merges) {
30879
30953
  if (merge.left < cmd.quantity && cmd.quantity <= merge.right) {
30880
- return 65 /* CommandResult.MergeOverlap */;
30954
+ return 66 /* CommandResult.MergeOverlap */;
30881
30955
  }
30882
30956
  }
30883
30957
  return 0 /* CommandResult.Success */;
@@ -31187,6 +31261,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
31187
31261
  zones.push(...cmd.target);
31188
31262
  }
31189
31263
  if ("ranges" in cmd && Array.isArray(cmd.ranges)) {
31264
+ if (cmd.ranges.some((rangeData) => !this.getters.tryGetSheet(rangeData._sheetId))) {
31265
+ return 27 /* CommandResult.InvalidSheetId */;
31266
+ }
31190
31267
  zones.push(...cmd.ranges.map((rangeData) => this.getters.getRangeFromRangeData(rangeData).zone));
31191
31268
  }
31192
31269
  if (!zones.every(isZoneValid)) {
@@ -31308,7 +31385,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
31308
31385
  if (this.lastCellSelected.col !== undefined && this.lastCellSelected.row !== undefined) {
31309
31386
  return 0 /* CommandResult.Success */;
31310
31387
  }
31311
- return 45 /* CommandResult.InvalidAutofillSelection */;
31388
+ return 46 /* CommandResult.InvalidAutofillSelection */;
31312
31389
  case "AUTOFILL_AUTO":
31313
31390
  const zone = this.getters.getSelectedZone();
31314
31391
  return zone.top === zone.bottom
@@ -31908,7 +31985,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
31908
31985
  cellPopoverRegistry.get(cmd.popoverType);
31909
31986
  }
31910
31987
  catch (error) {
31911
- return 72 /* CommandResult.InvalidCellPopover */;
31988
+ return 73 /* CommandResult.InvalidCellPopover */;
31912
31989
  }
31913
31990
  return 0 /* CommandResult.Success */;
31914
31991
  default:
@@ -32132,7 +32209,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
32132
32209
  for (const zone of this.getPasteZones(target)) {
32133
32210
  if ((zone.left < xSplit && zone.right >= xSplit) ||
32134
32211
  (zone.top < ySplit && zone.bottom >= ySplit)) {
32135
- return 75 /* CommandResult.FrozenPaneOverlap */;
32212
+ return 76 /* CommandResult.FrozenPaneOverlap */;
32136
32213
  }
32137
32214
  }
32138
32215
  return 0 /* CommandResult.Success */;
@@ -32492,7 +32569,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
32492
32569
  }
32493
32570
  isPasteAllowed(target, option) {
32494
32571
  if (target.length === 0) {
32495
- return 73 /* CommandResult.EmptyTarget */;
32572
+ return 74 /* CommandResult.EmptyTarget */;
32496
32573
  }
32497
32574
  if ((option === null || option === void 0 ? void 0 : option.pasteOption) !== undefined) {
32498
32575
  return 22 /* CommandResult.WrongFigurePasteOption */;
@@ -32509,7 +32586,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
32509
32586
  y: this.getters.getRowDimensions(sheetId, target[0].top).start,
32510
32587
  };
32511
32588
  const newChart = this.copiedChart.copyInSheetId(sheetId);
32512
- const newId = new UuidGenerator().uuidv4();
32589
+ const newId = new UuidGenerator().smallUuid();
32513
32590
  this.dispatch("CREATE_CHART", {
32514
32591
  id: newId,
32515
32592
  sheetId,
@@ -33639,7 +33716,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
33639
33716
  const cfInTarget = this.getters
33640
33717
  .getConditionalFormats(targetSheetId)
33641
33718
  .find((cf) => cf.stopIfTrue === originCF.stopIfTrue && deepEquals(cf.rule, originCF.rule));
33642
- return cfInTarget ? cfInTarget : { ...originCF, id: this.uuidGenerator.uuidv4(), ranges: [] };
33719
+ return cfInTarget
33720
+ ? cfInTarget
33721
+ : { ...originCF, id: this.uuidGenerator.smallUuid(), ranges: [] };
33643
33722
  }
33644
33723
  }
33645
33724
  EvaluationConditionalFormatPlugin.getters = ["getConditionalIcon", "getCellComputedStyle"];
@@ -33655,7 +33734,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
33655
33734
  switch (cmd.type) {
33656
33735
  case "UPDATE_FILTER":
33657
33736
  if (!this.getters.getFilterId(cmd.sheetId, cmd.col, cmd.row)) {
33658
- return 79 /* CommandResult.FilterNotFound */;
33737
+ return 80 /* CommandResult.FilterNotFound */;
33659
33738
  }
33660
33739
  break;
33661
33740
  }
@@ -35161,23 +35240,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
35161
35240
  gridSelection: deepCopy(gridSelection),
35162
35241
  };
35163
35242
  }
35164
- if (!this.getters.tryGetSheet(this.getters.getActiveSheetId())) {
35165
- const currentSheetIds = this.getters.getVisibleSheetIds();
35166
- this.activeSheet = this.getters.getSheet(currentSheetIds[0]);
35167
- if (this.activeSheet.id in this.sheetsData) {
35168
- const { anchor } = this.clipSelection(this.activeSheet.id, this.sheetsData[this.activeSheet.id].gridSelection);
35169
- this.selectCell(anchor.cell.col, anchor.cell.row);
35170
- }
35171
- else {
35172
- this.selectCell(0, 0);
35173
- }
35174
- const { col, row } = this.gridSelection.anchor.cell;
35175
- this.moveClient({
35176
- sheetId: this.getters.getActiveSheetId(),
35177
- col,
35178
- row,
35179
- });
35180
- }
35243
+ this.fallbackToVisibleSheet();
35181
35244
  const sheetId = this.getters.getActiveSheetId();
35182
35245
  this.gridSelection.zones = this.gridSelection.zones.map((z) => this.getters.expandZone(sheetId, z));
35183
35246
  this.gridSelection.anchor.zone = this.getters.expandZone(sheetId, this.gridSelection.anchor.zone);
@@ -35187,6 +35250,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
35187
35250
  }
35188
35251
  }
35189
35252
  finalize() {
35253
+ this.fallbackToVisibleSheet();
35190
35254
  /** Any change to the selection has to be reflected in the selection processor. */
35191
35255
  this.selection.resetDefaultAnchor(this, deepCopy(this.gridSelection.anchor));
35192
35256
  }
@@ -35485,10 +35549,29 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
35485
35549
  const headers = [cmd.base, ...cmd.elements];
35486
35550
  const maxHeaderValue = isCol ? this.getters.getNumberCols(id) : this.getters.getNumberRows(id);
35487
35551
  if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
35488
- return 86 /* CommandResult.InvalidHeaderIndex */;
35552
+ return 87 /* CommandResult.InvalidHeaderIndex */;
35489
35553
  }
35490
35554
  return 0 /* CommandResult.Success */;
35491
35555
  }
35556
+ fallbackToVisibleSheet() {
35557
+ if (!this.getters.tryGetSheet(this.getters.getActiveSheetId())) {
35558
+ const currentSheetIds = this.getters.getVisibleSheetIds();
35559
+ this.activeSheet = this.getters.getSheet(currentSheetIds[0]);
35560
+ if (this.activeSheet.id in this.sheetsData) {
35561
+ const { anchor } = this.clipSelection(this.activeSheet.id, this.sheetsData[this.activeSheet.id].gridSelection);
35562
+ this.selectCell(anchor.cell.col, anchor.cell.row);
35563
+ }
35564
+ else {
35565
+ this.selectCell(0, 0);
35566
+ }
35567
+ const { col, row } = this.gridSelection.anchor.cell;
35568
+ this.moveClient({
35569
+ sheetId: this.getters.getActiveSheetId(),
35570
+ col,
35571
+ row,
35572
+ });
35573
+ }
35574
+ }
35492
35575
  //-------------------------------------------
35493
35576
  // Helpers for extensions
35494
35577
  // ------------------------------------------
@@ -35713,7 +35796,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
35713
35796
  setContent(index, xc) {
35714
35797
  this.ranges[index] = {
35715
35798
  ...this.ranges[index],
35716
- id: uuidGenerator.uuidv4(),
35799
+ id: uuidGenerator.smallUuid(),
35717
35800
  xc,
35718
35801
  };
35719
35802
  }
@@ -35828,26 +35911,26 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
35828
35911
  case "ADD_EMPTY_RANGE":
35829
35912
  case "REMOVE_RANGE":
35830
35913
  if (!this.inputs[cmd.id]) {
35831
- return 30 /* CommandResult.InvalidInputId */;
35914
+ return 31 /* CommandResult.InvalidInputId */;
35832
35915
  }
35833
35916
  }
35834
35917
  switch (cmd.type) {
35835
35918
  case "FOCUS_RANGE":
35836
35919
  const index = (_a = this.currentInput) === null || _a === void 0 ? void 0 : _a.getIndex(cmd.rangeId);
35837
35920
  if (this.focusedInputId === cmd.id && ((_b = this.currentInput) === null || _b === void 0 ? void 0 : _b.focusedRangeIndex) === index) {
35838
- return 28 /* CommandResult.InputAlreadyFocused */;
35921
+ return 29 /* CommandResult.InputAlreadyFocused */;
35839
35922
  }
35840
35923
  break;
35841
35924
  case "ADD_EMPTY_RANGE":
35842
35925
  const input = this.inputs[cmd.id];
35843
35926
  if (input.inputHasSingleRange && input.ranges.length === 1) {
35844
- return 29 /* CommandResult.MaximumRangesReached */;
35927
+ return 30 /* CommandResult.MaximumRangesReached */;
35845
35928
  }
35846
35929
  break;
35847
35930
  case "CHANGE_RANGE": {
35848
35931
  const input = this.inputs[cmd.id];
35849
35932
  if (input.inputHasSingleRange && cmd.value.split(",").length > 1) {
35850
- return 29 /* CommandResult.MaximumRangesReached */;
35933
+ return 30 /* CommandResult.MaximumRangesReached */;
35851
35934
  }
35852
35935
  break;
35853
35936
  }
@@ -36038,6 +36121,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
36038
36121
  }
36039
36122
  function createSheetTransformation(cmd, executed) {
36040
36123
  var _a;
36124
+ if (cmd.sheetId === executed.sheetId) {
36125
+ cmd = { ...cmd, sheetId: `${cmd.sheetId}~` };
36126
+ }
36041
36127
  if (cmd.name === executed.name) {
36042
36128
  return {
36043
36129
  ...cmd,
@@ -36613,21 +36699,14 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
36613
36699
  if (!message)
36614
36700
  return;
36615
36701
  if (message.type === "REMOTE_REVISION") {
36616
- const revision = this.revisions.get(message.nextRevisionId);
36702
+ let revision = this.revisions.get(message.nextRevisionId);
36617
36703
  if (revision.commands.length === 0) {
36618
36704
  /**
36619
- * The command is empty, we have to drop all the next local revisions
36705
+ * The command is empty, we have to rebase all the next local revisions
36620
36706
  * to avoid issues with undo/redo
36621
36707
  */
36622
- this.revisions.drop(revision.id);
36623
- const revisionIds = this.pendingMessages
36624
- .filter((message) => message.type === "REMOTE_REVISION")
36625
- .map((message) => message.nextRevisionId);
36626
- this.trigger("pending-revisions-dropped", { revisionIds });
36627
- this.waitingAck = false;
36628
- this.waitingUndoRedoAck = false;
36629
- this.pendingMessages = [];
36630
- return;
36708
+ this.revisions.rebase(revision.id);
36709
+ revision = this.revisions.get(message.nextRevisionId);
36631
36710
  }
36632
36711
  message = {
36633
36712
  ...message,
@@ -36651,7 +36730,6 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
36651
36730
  switch (message.type) {
36652
36731
  case "REMOTE_REVISION":
36653
36732
  case "REVISION_REDONE":
36654
- case "REVISION_UNDONE":
36655
36733
  case "SNAPSHOT_CREATED":
36656
36734
  this.waitingAck = false;
36657
36735
  this.pendingMessages = this.pendingMessages.filter((msg) => msg.nextRevisionId !== message.nextRevisionId);
@@ -36659,6 +36737,25 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
36659
36737
  this.processedRevisions.add(message.nextRevisionId);
36660
36738
  this.sendPendingMessage();
36661
36739
  break;
36740
+ case "REVISION_UNDONE": {
36741
+ this.waitingAck = false;
36742
+ this.pendingMessages = this.pendingMessages.filter((msg) => msg.nextRevisionId !== message.nextRevisionId);
36743
+ const firstPendingRevisionId = this.pendingMessages.findIndex((message) => message.type === "REMOTE_REVISION");
36744
+ if (firstPendingRevisionId !== -1) {
36745
+ /**
36746
+ * Some revisions undergo transformations that may cause issues with
36747
+ * undo/redo if the transformation is destructive (we don't get back
36748
+ * the original command by transforming it with the inverse).
36749
+ * To prevent these problems, we must rebase all subsequent local
36750
+ * revisions.
36751
+ */
36752
+ this.revisions.rebase(this.pendingMessages[firstPendingRevisionId].nextRevisionId);
36753
+ }
36754
+ this.serverRevisionId = message.nextRevisionId;
36755
+ this.processedRevisions.add(message.nextRevisionId);
36756
+ this.sendPendingMessage();
36757
+ break;
36758
+ }
36662
36759
  }
36663
36760
  }
36664
36761
  isAlreadyProcessed(message) {
@@ -37529,7 +37626,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
37529
37626
  }
37530
37627
  checkPositiveDimension(cmd) {
37531
37628
  if (cmd.width < 0 || cmd.height < 0) {
37532
- return 68 /* CommandResult.InvalidViewportSize */;
37629
+ return 69 /* CommandResult.InvalidViewportSize */;
37533
37630
  }
37534
37631
  return 0 /* CommandResult.Success */;
37535
37632
  }
@@ -37539,7 +37636,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
37539
37636
  cmd.gridOffsetY === this.gridOffsetY &&
37540
37637
  cmd.width === width &&
37541
37638
  cmd.height === height) {
37542
- return 76 /* CommandResult.ValuesNotChanged */;
37639
+ return 77 /* CommandResult.ValuesNotChanged */;
37543
37640
  }
37544
37641
  return 0 /* CommandResult.Success */;
37545
37642
  }
@@ -37547,7 +37644,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
37547
37644
  const pane = this.getMainInternalViewport(this.getters.getActiveSheetId());
37548
37645
  if ((!pane.canScrollHorizontally && offsetX > 0) ||
37549
37646
  (!pane.canScrollVertically && offsetY > 0)) {
37550
- return 69 /* CommandResult.InvalidScrollingDirection */;
37647
+ return 70 /* CommandResult.InvalidScrollingDirection */;
37551
37648
  }
37552
37649
  return 0 /* CommandResult.Success */;
37553
37650
  }
@@ -37774,7 +37871,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
37774
37871
  for (let row = zone.top; row <= zone.bottom; row++) {
37775
37872
  for (let col = zone.left; col <= zone.right; col++) {
37776
37873
  if (!this.getters.isInMerge(sheetId, col, row)) {
37777
- return 63 /* CommandResult.InvalidSortZone */;
37874
+ return 64 /* CommandResult.InvalidSortZone */;
37778
37875
  }
37779
37876
  }
37780
37877
  }
@@ -37795,7 +37892,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
37795
37892
  ];
37796
37893
  return widthCurrent === widthFirst && heightCurrent === heightFirst;
37797
37894
  })) {
37798
- return 63 /* CommandResult.InvalidSortZone */;
37895
+ return 64 /* CommandResult.InvalidSortZone */;
37799
37896
  }
37800
37897
  return 0 /* CommandResult.Success */;
37801
37898
  }
@@ -38461,7 +38558,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
38461
38558
  addSheet() {
38462
38559
  const activeSheetId = this.env.model.getters.getActiveSheetId();
38463
38560
  const position = this.env.model.getters.getSheetIds().findIndex((sheetId) => sheetId === activeSheetId) + 1;
38464
- const sheetId = this.env.model.uuidGenerator.uuidv4();
38561
+ const sheetId = this.env.model.uuidGenerator.smallUuid();
38465
38562
  const name = this.env.model.getters.getNextSheetName(this.env._t("Sheet"));
38466
38563
  this.env.model.dispatch("CREATE_SHEET", { sheetId, position, name });
38467
38564
  this.env.model.dispatch("ACTIVATE_SHEET", { sheetIdFrom: activeSheetId, sheetIdTo: sheetId });
@@ -38950,7 +39047,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
38950
39047
  };
38951
39048
  function interactiveAddMerge(env, sheetId, target) {
38952
39049
  const result = env.model.dispatch("ADD_MERGE", { sheetId, target });
38953
- if (result.isCancelledBecause(80 /* CommandResult.MergeInFilter */)) {
39050
+ if (result.isCancelledBecause(81 /* CommandResult.MergeInFilter */)) {
38954
39051
  env.raiseError(AddMergeInteractiveContent.MergeInFilter);
38955
39052
  }
38956
39053
  else if (result.isCancelledBecause(3 /* CommandResult.MergeIsDestructive */)) {
@@ -40083,7 +40180,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
40083
40180
  }
40084
40181
  /**
40085
40182
  * Drop the operation and all following operations in every
40086
- * branch
40183
+ * branches
40087
40184
  */
40088
40185
  drop(operationId) {
40089
40186
  for (const branch of this.branches) {
@@ -40380,9 +40477,16 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
40380
40477
  this.fastForward();
40381
40478
  this.insert(redoId, this.buildEmpty(redoId), insertAfter);
40382
40479
  }
40383
- drop(operationId) {
40480
+ rebase(operationId) {
40481
+ const operation = this.get(operationId);
40482
+ const execution = [...this.tree.execution(this.HEAD_BRANCH).startAfter(operationId)];
40384
40483
  this.revertBefore(operationId);
40484
+ const baseId = this.HEAD_OPERATION.id;
40385
40485
  this.tree.drop(operationId);
40486
+ this.insert(operationId, operation, baseId);
40487
+ for (const { operation } of execution) {
40488
+ this.insert(operation.id, operation.data, this.HEAD_OPERATION.id);
40489
+ }
40386
40490
  }
40387
40491
  /**
40388
40492
  * Revert the state as it was *before* the given operation was executed.
@@ -40505,7 +40609,6 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
40505
40609
  this.session.on("new-local-state-update", this, this.onNewLocalStateUpdate);
40506
40610
  this.session.on("revision-undone", this, ({ commands }) => this.selectiveUndo(commands));
40507
40611
  this.session.on("revision-redone", this, ({ commands }) => this.selectiveRedo(commands));
40508
- this.session.on("pending-revisions-dropped", this, ({ revisionIds }) => this.drop(revisionIds));
40509
40612
  this.session.on("snapshot", this, () => {
40510
40613
  this.undoStack = [];
40511
40614
  this.redoStack = [];
@@ -40558,10 +40661,6 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
40558
40661
  canRedo() {
40559
40662
  return this.redoStack.length > 0;
40560
40663
  }
40561
- drop(revisionIds) {
40562
- this.undoStack = this.undoStack.filter((id) => !revisionIds.includes(id));
40563
- this.redoStack = [];
40564
- }
40565
40664
  onNewLocalStateUpdate({ id }) {
40566
40665
  this.undoStack.push(id);
40567
40666
  this.redoStack = [];
@@ -41142,7 +41241,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
41142
41241
  */
41143
41242
  moveAnchorCell(direction, step = 1) {
41144
41243
  if (step !== "end" && step <= 0) {
41145
- return new DispatchResult(83 /* CommandResult.InvalidSelectionStep */);
41244
+ return new DispatchResult(84 /* CommandResult.InvalidSelectionStep */);
41146
41245
  }
41147
41246
  const { col, row } = this.getNextAvailablePosition(direction, step);
41148
41247
  return this.selectCell(col, row);
@@ -41188,7 +41287,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
41188
41287
  */
41189
41288
  resizeAnchorZone(direction, step = 1) {
41190
41289
  if (step !== "end" && step <= 0) {
41191
- return new DispatchResult(83 /* CommandResult.InvalidSelectionStep */);
41290
+ return new DispatchResult(84 /* CommandResult.InvalidSelectionStep */);
41192
41291
  }
41193
41292
  const sheetId = this.getters.getActiveSheetId();
41194
41293
  const anchor = this.anchor;
@@ -43134,10 +43233,10 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
43134
43233
  const command = { type, ...payload };
43135
43234
  let status = this.status;
43136
43235
  if (this.getters.isReadonly() && !canExecuteInReadonly(command)) {
43137
- return new DispatchResult(67 /* CommandResult.Readonly */);
43236
+ return new DispatchResult(68 /* CommandResult.Readonly */);
43138
43237
  }
43139
43238
  if (!this.session.canApplyOptimisticUpdate()) {
43140
- return new DispatchResult(64 /* CommandResult.WaitingSessionConfirmation */);
43239
+ return new DispatchResult(65 /* CommandResult.WaitingSessionConfirmation */);
43141
43240
  }
43142
43241
  switch (status) {
43143
43242
  case 0 /* Status.Ready */:
@@ -43339,7 +43438,7 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
43339
43438
  }
43340
43439
  setupConfig(config) {
43341
43440
  const client = config.client || {
43342
- id: this.uuidGenerator.uuidv4(),
43441
+ id: this.uuidGenerator.smallUuid(),
43343
43442
  name: _lt("Anonymous").toString(),
43344
43443
  };
43345
43444
  const transportService = config.transportService || new LocalTransportService();
@@ -43589,9 +43688,9 @@ day_count_convention (number, default=${DEFAULT_DAY_COUNT_CONVENTION} ) ${_lt("A
43589
43688
  Object.defineProperty(exports, '__esModule', { value: true });
43590
43689
 
43591
43690
 
43592
- __info__.version = '16.0.60';
43593
- __info__.date = '2025-02-05T06:44:04.651Z';
43594
- __info__.hash = 'd098699';
43691
+ __info__.version = '16.0.62';
43692
+ __info__.date = '2025-02-14T08:36:41.388Z';
43693
+ __info__.hash = '34f2802';
43595
43694
 
43596
43695
 
43597
43696
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);