@odoo/o-spreadsheet 16.0.60 → 16.0.63

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