@rowsncolumns/spreadsheet-state 29.1.15 → 29.1.17

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.
@@ -5,9 +5,9 @@ export type UseOnRequestCreateTableProps = {
5
5
  };
6
6
  /**
7
7
  * Open Excel's "Create Table" dialog (Ctrl+T / Insert → Table / Format as Table): the range
8
- * pre-fills with the selection, else the data region around the active cell (Ctrl+A's region),
9
- * and "My table has headers" is guessed from that range's first row. The dialog submits through
10
- * `onCreateTable`.
8
+ * pre-fills with the selection, else — with none, or one collapsed on a single cell — the data
9
+ * region around the active cell (Ctrl+A's region), and "My table has headers" is guessed from
10
+ * that range's first row. The dialog submits through `onCreateTable`.
11
11
  */
12
12
  export declare const useOnRequestCreateTable: ({ getEffectiveExtendedValue, }: UseOnRequestCreateTableProps) => (sheetId: number, activeCell: CellInterface, selections: SelectionArea<SelectionAttributes>[], theme?: TableTheme, bandedRange?: BandedDefinition) => void;
13
13
  //# sourceMappingURL=use-on-request-create-table.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-on-request-create-table.d.ts","sourceRoot":"","sources":["../../../hooks/use-on-request-create-table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,aAAa,EACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACX,MAAM,2BAA2B,CAAC;AASnC,MAAM,MAAM,4BAA4B,GAAG;IACzC,yBAAyB,EAAE,CACzB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,KAChB,aAAa,GAAG,IAAI,GAAG,SAAS,CAAC;CACvC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,gCAErC,4BAA4B,eAMhB,MAAM,cACH,aAAa,cACb,aAAa,CAAC,mBAAmB,CAAC,EAAE,UACxC,UAAU,gBACJ,gBAAgB,SA6BnC,CAAC"}
1
+ {"version":3,"file":"use-on-request-create-table.d.ts","sourceRoot":"","sources":["../../../hooks/use-on-request-create-table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,aAAa,EACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACX,MAAM,2BAA2B,CAAC;AASnC,MAAM,MAAM,4BAA4B,GAAG;IACzC,yBAAyB,EAAE,CACzB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,KAChB,aAAa,GAAG,IAAI,GAAG,SAAS,CAAC;CACvC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,gCAErC,4BAA4B,eAMhB,MAAM,cACH,aAAa,cACb,aAAa,CAAC,mBAAmB,CAAC,EAAE,UACxC,UAAU,gBACJ,gBAAgB,SAkCnC,CAAC"}
@@ -6,9 +6,9 @@ import { useSetCreatingTable } from "../atoms/creating-table.atom";
6
6
  import { useSetCreateTableDialogValue } from "../atoms/dialog-state.atom";
7
7
  /**
8
8
  * Open Excel's "Create Table" dialog (Ctrl+T / Insert → Table / Format as Table): the range
9
- * pre-fills with the selection, else the data region around the active cell (Ctrl+A's region),
10
- * and "My table has headers" is guessed from that range's first row. The dialog submits through
11
- * `onCreateTable`.
9
+ * pre-fills with the selection, else — with none, or one collapsed on a single cell — the data
10
+ * region around the active cell (Ctrl+A's region), and "My table has headers" is guessed from
11
+ * that range's first row. The dialog submits through `onCreateTable`.
12
12
  */
13
13
  export var useOnRequestCreateTable = function (_a) {
14
14
  var getEffectiveExtendedValue = _a.getEffectiveExtendedValue;
@@ -18,7 +18,11 @@ export var useOnRequestCreateTable = function (_a) {
18
18
  return useCallback(function (sheetId, activeCell, selections, theme, bandedRange) {
19
19
  var _a;
20
20
  var lastSelection = selections === null || selections === void 0 ? void 0 : selections[selections.length - 1];
21
- var range = lastSelection
21
+ var collapsed = !lastSelection ||
22
+ (lastSelection.range.startRowIndex === lastSelection.range.endRowIndex &&
23
+ lastSelection.range.startColumnIndex ===
24
+ lastSelection.range.endColumnIndex);
25
+ var range = !collapsed
22
26
  ? lastSelection.range
23
27
  : (_a = getContentfulRangeAroundCell === null || getContentfulRangeAroundCell === void 0 ? void 0 : getContentfulRangeAroundCell(sheetId, activeCell)) !== null && _a !== void 0 ? _a : selectionFromActiveCell(activeCell)[0].range;
24
28
  setCreatingTable({
@@ -1 +1 @@
1
- {"version":3,"file":"delete-cells.d.ts","sourceRoot":"","sources":["../../../interface/delete-cells.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAEb,aAAa,EACd,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EACV,QAAQ,EAER,mBAAmB,EACnB,KAAK,EACN,MAAM,2BAA2B,CAAC;AAKnC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAK/D,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,CAAC;AAEvD,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,KAAK,EAAE,gUAoB9D,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,MAErB,SAAS,MAAM,EACf,MAAM,aAAa,EACnB,YAAY,aAAa,CAAC,mBAAmB,CAAC,EAAE,EAChD,YAAW,SAAsB,SAgSpC,CAAC"}
1
+ {"version":3,"file":"delete-cells.d.ts","sourceRoot":"","sources":["../../../interface/delete-cells.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAEb,aAAa,EACd,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EACV,QAAQ,EAER,mBAAmB,EACnB,KAAK,EACN,MAAM,2BAA2B,CAAC;AAKnC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAM/D,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,CAAC;AAEvD,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,KAAK,EAAE,gUAoB9D,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,MAErB,SAAS,MAAM,EACf,MAAM,aAAa,EACnB,YAAY,aAAa,CAAC,mBAAmB,CAAC,EAAE,EAChD,YAAW,SAAsB,SA+TpC,CAAC"}
@@ -5,6 +5,7 @@ import { produceWithPatches } from "immer";
5
5
  import { createSheetCellIdentifier } from "../api/formula";
6
6
  import { createSheetDraft } from "../api/immer-utils";
7
7
  import { SheetCell } from "../sheet-cell";
8
+ import { releaseTableFilterRows } from "./remove-table";
8
9
  import { getTableHeaderRefills } from "./table-utils";
9
10
  export var deleteCells = function (_a) {
10
11
  var locale = _a.locale, rowCount = _a.rowCount, cellXfsRegistry = _a.cellXfsRegistry, sharedStringRegistry = _a.sharedStringRegistry, getDataValidationById = _a.getDataValidationById, getDependents = _a.getDependents, getDataRowCount = _a.getDataRowCount, onChangeSheetData = _a.onChangeSheetData, onChangeSheets = _a.onChangeSheets, onChangeTables = _a.onChangeTables, onChangeCitations = _a.onChangeCitations, onChangeActiveCell = _a.onChangeActiveCell, enqueueCalculation = _a.enqueueCalculation, enqueueStructureChange = _a.enqueueStructureChange, createHistory = _a.createHistory, isArrayFormula = _a.isArrayFormula, getRowHeight = _a.getRowHeight, tables = _a.tables, generatedNames = _a.generatedNames;
@@ -18,13 +19,28 @@ export var deleteCells = function (_a) {
18
19
  : selectionFromActiveCell(cell);
19
20
  var saveHistory = createHistory();
20
21
  var maxRowCount = getDataRowCount();
21
- // A table survives Delete / Clear (Excel): only its cells empty out, and
22
- // cleared header cells are re-named `ColumnN` so the header row and
23
- // `columns[]` stay in step.
22
+ // Delete / Clear over a selection that covers a whole table deletes the table (Excel's
23
+ // "select the table and press Delete"): the table, its filter and its style go with the
24
+ // cells, and the structured references into it error as they do for any deleted table
25
+ // (Convert to Range is the path that rewrites them to A1).
26
+ var removedTables = shouldClearContents
27
+ ? (tables !== null && tables !== void 0 ? tables : []).filter(function (table) {
28
+ return table.sheetId === sheetId &&
29
+ finalSelections.some(function (selection) {
30
+ return areaInsideArea(table.range, selection.range);
31
+ });
32
+ })
33
+ : [];
34
+ var keptTables = removedTables.length
35
+ ? tables === null || tables === void 0 ? void 0 : tables.filter(function (table) { return !removedTables.includes(table); })
36
+ : tables;
37
+ // A table survives Delete / Clear over part of it (Excel): only its cells
38
+ // empty out, and cleared header cells are re-named `ColumnN` so the header
39
+ // row and `columns[]` stay in step.
24
40
  var headerRefills = shouldClearContents
25
41
  ? getTableHeaderRefills({
26
42
  sheetId: sheetId,
27
- tables: tables,
43
+ tables: keptTables,
28
44
  selections: finalSelections,
29
45
  generatedNames: generatedNames,
30
46
  })
@@ -170,17 +186,36 @@ export var deleteCells = function (_a) {
170
186
  });
171
187
  return nextState;
172
188
  });
173
- // Rename the columns whose header cells were cleared
174
- if (headerRefills.length) {
189
+ // Drop the tables the selection covered, and rename the columns whose header cells were cleared
190
+ if (headerRefills.length || removedTables.length) {
175
191
  onChangeTables === null || onChangeTables === void 0 ? void 0 : onChangeTables(function (prevTables) {
176
192
  var _a = __read(produceWithPatches(prevTables, function (draft) {
177
- var e_4, _a;
178
- var _b;
179
- var _loop_1 = function (tableId, dimensionIndex, name_2) {
193
+ var e_4, _a, e_5, _b;
194
+ var _c;
195
+ var _loop_1 = function (removed) {
196
+ var tableIndex = draft.findIndex(function (table) { return table.id == removed.id; });
197
+ if (tableIndex !== -1) {
198
+ draft.splice(tableIndex, 1);
199
+ }
200
+ };
201
+ try {
202
+ for (var removedTables_1 = __values(removedTables), removedTables_1_1 = removedTables_1.next(); !removedTables_1_1.done; removedTables_1_1 = removedTables_1.next()) {
203
+ var removed = removedTables_1_1.value;
204
+ _loop_1(removed);
205
+ }
206
+ }
207
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
208
+ finally {
209
+ try {
210
+ if (removedTables_1_1 && !removedTables_1_1.done && (_a = removedTables_1.return)) _a.call(removedTables_1);
211
+ }
212
+ finally { if (e_4) throw e_4.error; }
213
+ }
214
+ var _loop_2 = function (tableId, dimensionIndex, name_2) {
180
215
  var table = draft.find(function (table) { return table.sheetId === sheetId && table.id === tableId; });
181
216
  if (!table)
182
217
  return "continue";
183
- (_b = table.columns) !== null && _b !== void 0 ? _b : (table.columns = []);
218
+ (_c = table.columns) !== null && _c !== void 0 ? _c : (table.columns = []);
184
219
  var column = table.columns[dimensionIndex];
185
220
  if (column) {
186
221
  column.name = name_2;
@@ -191,16 +226,16 @@ export var deleteCells = function (_a) {
191
226
  };
192
227
  try {
193
228
  for (var headerRefills_2 = __values(headerRefills), headerRefills_2_1 = headerRefills_2.next(); !headerRefills_2_1.done; headerRefills_2_1 = headerRefills_2.next()) {
194
- var _c = headerRefills_2_1.value, tableId = _c.tableId, dimensionIndex = _c.dimensionIndex, name_2 = _c.name;
195
- _loop_1(tableId, dimensionIndex, name_2);
229
+ var _d = headerRefills_2_1.value, tableId = _d.tableId, dimensionIndex = _d.dimensionIndex, name_2 = _d.name;
230
+ _loop_2(tableId, dimensionIndex, name_2);
196
231
  }
197
232
  }
198
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
233
+ catch (e_5_1) { e_5 = { error: e_5_1 }; }
199
234
  finally {
200
235
  try {
201
- if (headerRefills_2_1 && !headerRefills_2_1.done && (_a = headerRefills_2.return)) _a.call(headerRefills_2);
236
+ if (headerRefills_2_1 && !headerRefills_2_1.done && (_b = headerRefills_2.return)) _b.call(headerRefills_2);
202
237
  }
203
- finally { if (e_4) throw e_4.error; }
238
+ finally { if (e_5) throw e_5.error; }
204
239
  }
205
240
  }), 3), nextState = _a[0], patches = _a[1], inversePatches = _a[2];
206
241
  saveHistory({
@@ -208,6 +243,13 @@ export var deleteCells = function (_a) {
208
243
  });
209
244
  return nextState;
210
245
  });
246
+ releaseTableFilterRows({
247
+ tables: removedTables,
248
+ onChangeSheets: onChangeSheets,
249
+ saveHistory: saveHistory,
250
+ getDependents: getDependents,
251
+ enqueueCalculation: enqueueCalculation,
252
+ });
211
253
  }
212
254
  // Update citations - retire citations whose cited cells lose their contents.
213
255
  // Clearing formats only leaves the cited values in place, so the citations stay.
@@ -215,7 +257,7 @@ export var deleteCells = function (_a) {
215
257
  onChangeCitations === null || onChangeCitations === void 0 ? void 0 : onChangeCitations(function (prevCitations) {
216
258
  var updatedAt = new Date().toISOString();
217
259
  var _a = __read(produceWithPatches(prevCitations, function (draft) {
218
- var _loop_2 = function (idx) {
260
+ var _loop_3 = function (idx) {
219
261
  var citation = draft[idx];
220
262
  // Check if citation is active, on the same sheet and inside a cleared selection
221
263
  if (citation.active !== false &&
@@ -229,7 +271,7 @@ export var deleteCells = function (_a) {
229
271
  }
230
272
  };
231
273
  for (var idx = draft.length - 1; idx >= 0; idx--) {
232
- _loop_2(idx);
274
+ _loop_3(idx);
233
275
  }
234
276
  }), 3), nextState = _a[0], patches = _a[1], inversePatches = _a[2];
235
277
  saveHistory({
@@ -241,11 +283,11 @@ export var deleteCells = function (_a) {
241
283
  // Update banded cells
242
284
  onChangeSheets === null || onChangeSheets === void 0 ? void 0 : onChangeSheets(function (prevSheets) {
243
285
  var _a = __read(produceWithPatches(prevSheets, function (draft) {
244
- var e_5, _a;
286
+ var e_6, _a;
245
287
  var _b, _c, _d, _e, _f;
246
288
  var sheet = draft.find(function (sheet) { return sheet.sheetId === sheetId; });
247
289
  if (sheet) {
248
- var _loop_3 = function (selection) {
290
+ var _loop_4 = function (selection) {
249
291
  for (var rowIndex = selection.range.startRowIndex; rowIndex <=
250
292
  Math.min(maxRowCount !== null && maxRowCount !== void 0 ? maxRowCount : rowCount, selection.range.endRowIndex); rowIndex++) {
251
293
  var isRowResizedByUser = !!((_c = (_b = sheet === null || sheet === void 0 ? void 0 : sheet.rowMetadata) === null || _b === void 0 ? void 0 : _b[rowIndex]) === null || _c === void 0 ? void 0 : _c.resizedByUser);
@@ -270,15 +312,15 @@ export var deleteCells = function (_a) {
270
312
  // Adjust row height
271
313
  for (var finalSelections_3 = __values(finalSelections), finalSelections_3_1 = finalSelections_3.next(); !finalSelections_3_1.done; finalSelections_3_1 = finalSelections_3.next()) {
272
314
  var selection = finalSelections_3_1.value;
273
- _loop_3(selection);
315
+ _loop_4(selection);
274
316
  }
275
317
  }
276
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
318
+ catch (e_6_1) { e_6 = { error: e_6_1 }; }
277
319
  finally {
278
320
  try {
279
321
  if (finalSelections_3_1 && !finalSelections_3_1.done && (_a = finalSelections_3.return)) _a.call(finalSelections_3);
280
322
  }
281
- finally { if (e_5) throw e_5.error; }
323
+ finally { if (e_6) throw e_6.error; }
282
324
  }
283
325
  }
284
326
  }), 3), nextState = _a[0], patches = _a[1], inversePatches = _a[2];
@@ -1,4 +1,15 @@
1
1
  import type { CellData, Sheet, TableView } from "@rowsncolumns/spreadsheet";
2
2
  import type { UseOnTableProps } from "../hooks/use-on-table";
3
3
  export declare const removeTable: <T extends CellData, S extends Sheet>({ locale, cellXfsRegistry, sharedStringRegistry, getSheetName, onChangeTables, onChangeSheets, onChangeSheetData, createHistory, getDependents, getGraphNodes, getBandedCells, enqueueCalculation, enqueueGraphOperation, }: Pick<UseOnTableProps<T, S>, "locale" | "cellXfsRegistry" | "sharedStringRegistry" | "getSheetName" | "onChangeTables" | "onChangeSheets" | "onChangeSheetData" | "getDependents" | "getGraphNodes" | "getBandedCells" | "enqueueCalculation" | "enqueueGraphOperation" | "createHistory">) => (tableView: TableView) => void;
4
+ /**
5
+ * A removed table's filter goes with it: the rows it hid become visible again, in the history step
6
+ * of the removal (`saveHistory`). Their values did not change, so only the formulas that read
7
+ * visibility — `SUBTOTAL(101…111)` / `AGGREGATE` over those rows — are stale; dirtying the
8
+ * un-hidden cells recalculates exactly those dependents. Shared by Convert to Range
9
+ * (`removeTable`) and Delete over a whole table (`deleteCells`).
10
+ */
11
+ export declare const releaseTableFilterRows: <T extends CellData, S extends Sheet>({ tables, onChangeSheets, saveHistory, getDependents, enqueueCalculation, }: Pick<UseOnTableProps<T, S>, "onChangeSheets" | "getDependents" | "enqueueCalculation"> & {
12
+ tables: TableView[];
13
+ saveHistory: ReturnType<UseOnTableProps<T, S>["createHistory"]>;
14
+ }) => void;
4
15
  //# sourceMappingURL=remove-table.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"remove-table.d.ts","sourceRoot":"","sources":["../../../interface/remove-table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAK5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,KAAK,EAAE,6NAc9D,IAAI,CACL,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,EACnB,QAAQ,GACR,iBAAiB,GACjB,sBAAsB,GACtB,cAAc,GACd,gBAAgB,GAChB,gBAAgB,GAChB,mBAAmB,GACnB,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,oBAAoB,GACpB,uBAAuB,GACvB,eAAe,CAClB,MACS,WAAW,SAAS,SAwH7B,CAAC"}
1
+ {"version":3,"file":"remove-table.d.ts","sourceRoot":"","sources":["../../../interface/remove-table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAK5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,KAAK,EAAE,6NAc9D,IAAI,CACL,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,EACnB,QAAQ,GACR,iBAAiB,GACjB,sBAAsB,GACtB,cAAc,GACd,gBAAgB,GAChB,gBAAgB,GAChB,mBAAmB,GACnB,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,oBAAoB,GACpB,uBAAuB,GACvB,eAAe,CAClB,MACS,WAAW,SAAS,SA0E7B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GAAI,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,KAAK,EAAE,6EAMzE,IAAI,CACL,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,EACrB,gBAAgB,GAAG,eAAe,GAAG,oBAAoB,CAC1D,GAAG;IACF,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,WAAW,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC;CACjE,SAoDA,CAAC"}
@@ -59,51 +59,82 @@ export var removeTable = function (_a) {
59
59
  });
60
60
  return nextState;
61
61
  });
62
- // The table's filter goes with it: rows it hid become visible again. Their values did not
63
- // change, so only the formulas that read visibility — `SUBTOTAL(101…111)` / `AGGREGATE` over
64
- // those rows — are stale; dirtying the un-hidden cells recalculates exactly those dependents
65
- // (the rewritten structured references were re-entered above with `force`).
66
- var unhiddenRecalcCells = new Map();
67
- onChangeSheets(function (prevSheets) {
68
- var _a = __read(produceWithPatches(prevSheets, function (draft) {
69
- var e_1, _a;
70
- var _b;
62
+ releaseTableFilterRows({
63
+ tables: [tableView],
64
+ onChangeSheets: onChangeSheets,
65
+ saveHistory: saveHistory,
66
+ getDependents: getDependents,
67
+ enqueueCalculation: enqueueCalculation,
68
+ });
69
+ };
70
+ };
71
+ /**
72
+ * A removed table's filter goes with it: the rows it hid become visible again, in the history step
73
+ * of the removal (`saveHistory`). Their values did not change, so only the formulas that read
74
+ * visibility — `SUBTOTAL(101…111)` / `AGGREGATE` over those rows — are stale; dirtying the
75
+ * un-hidden cells recalculates exactly those dependents. Shared by Convert to Range
76
+ * (`removeTable`) and Delete over a whole table (`deleteCells`).
77
+ */
78
+ export var releaseTableFilterRows = function (_a) {
79
+ var tables = _a.tables, onChangeSheets = _a.onChangeSheets, saveHistory = _a.saveHistory, getDependents = _a.getDependents, enqueueCalculation = _a.enqueueCalculation;
80
+ if (!tables.length)
81
+ return;
82
+ var unhiddenRecalcCells = new Map();
83
+ onChangeSheets(function (prevSheets) {
84
+ var _a = __read(produceWithPatches(prevSheets, function (draft) {
85
+ var e_1, _a;
86
+ var _b;
87
+ var _loop_1 = function (tableView) {
88
+ var e_2, _c;
71
89
  var sheet = draft.find(function (sheet) { return sheet.sheetId === tableView.sheetId; });
72
- if (sheet && tableView) {
73
- if (!sheet.rowMetadata) {
74
- sheet.rowMetadata = [];
75
- }
76
- var range = tableView.range;
77
- for (var rowIndex = range.startRowIndex; rowIndex <= range.endRowIndex; rowIndex++) {
78
- if ((_b = sheet.rowMetadata[rowIndex]) === null || _b === void 0 ? void 0 : _b.hiddenByFilter) {
79
- sheet.rowMetadata[rowIndex].hiddenByFilter = false;
80
- try {
81
- for (var _c = (e_1 = void 0, __values(markTableAsDirty(tableView.sheetId, __assign(__assign({}, range), { startRowIndex: rowIndex, endRowIndex: rowIndex }), getDependents, enqueueCalculation))), _d = _c.next(); !_d.done; _d = _c.next()) {
82
- var _e = __read(_d.value, 2), key = _e[0], position = _e[1];
83
- unhiddenRecalcCells.set(key, position);
84
- }
90
+ if (!sheet)
91
+ return "continue";
92
+ if (!sheet.rowMetadata) {
93
+ sheet.rowMetadata = [];
94
+ }
95
+ var range = tableView.range;
96
+ for (var rowIndex = range.startRowIndex; rowIndex <= range.endRowIndex; rowIndex++) {
97
+ if ((_b = sheet.rowMetadata[rowIndex]) === null || _b === void 0 ? void 0 : _b.hiddenByFilter) {
98
+ sheet.rowMetadata[rowIndex].hiddenByFilter = false;
99
+ try {
100
+ for (var _d = (e_2 = void 0, __values(markTableAsDirty(tableView.sheetId, __assign(__assign({}, range), { startRowIndex: rowIndex, endRowIndex: rowIndex }), getDependents, enqueueCalculation))), _e = _d.next(); !_e.done; _e = _d.next()) {
101
+ var _f = __read(_e.value, 2), key = _f[0], position = _f[1];
102
+ unhiddenRecalcCells.set(key, position);
85
103
  }
86
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
87
- finally {
88
- try {
89
- if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
90
- }
91
- finally { if (e_1) throw e_1.error; }
104
+ }
105
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
106
+ finally {
107
+ try {
108
+ if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
92
109
  }
110
+ finally { if (e_2) throw e_2.error; }
93
111
  }
94
112
  }
95
113
  }
96
- }), 3), nextState = _a[0], patches = _a[1], inversePatches = _a[2];
97
- // Save to history
98
- saveHistory(__assign({ sheets: { patches: patches, inversePatches: inversePatches } }, (unhiddenRecalcCells.size
99
- ? {
100
- recalcCells: {
101
- undo: unhiddenRecalcCells,
102
- redo: unhiddenRecalcCells,
103
- },
114
+ };
115
+ try {
116
+ for (var tables_1 = __values(tables), tables_1_1 = tables_1.next(); !tables_1_1.done; tables_1_1 = tables_1.next()) {
117
+ var tableView = tables_1_1.value;
118
+ _loop_1(tableView);
104
119
  }
105
- : {})));
106
- return nextState;
107
- });
108
- };
120
+ }
121
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
122
+ finally {
123
+ try {
124
+ if (tables_1_1 && !tables_1_1.done && (_a = tables_1.return)) _a.call(tables_1);
125
+ }
126
+ finally { if (e_1) throw e_1.error; }
127
+ }
128
+ }), 3), nextState = _a[0], patches = _a[1], inversePatches = _a[2];
129
+ // Save to history
130
+ saveHistory(__assign({ sheets: { patches: patches, inversePatches: inversePatches } }, (unhiddenRecalcCells.size
131
+ ? {
132
+ recalcCells: {
133
+ undo: unhiddenRecalcCells,
134
+ redo: unhiddenRecalcCells,
135
+ },
136
+ }
137
+ : {})));
138
+ return nextState;
139
+ });
109
140
  };
@@ -1 +1 @@
1
- {"version":3,"file":"use-calculation-worker.d.ts","sourceRoot":"","sources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AAE,MAAM,CAAC;CACnB,CAAC;AAyEF,MAAM,MAAM,yBAAyB,GAAG,mBAAmB,GAAG;IAC5D,MAAM,EAAE,mBAAmB,EAAE,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,8BAA8B,CAAC,QAAQ,CAAC,CAAC;IACxD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oBAAoB,CAAC,EAAE,2BAA2B,CAAC;IACnD,kBAAkB,CAAC,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;IAClD,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC,CAAC;AAsLF,eAAO,MAAM,oBAAoB,GAC/B,OAAO,yBAAyB,KAC/B,wBAokEF,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { CalculationGraph, CalculationWorkerClient, createNamedRangeResolver, createStructuredReferenceResolver, enqueueCalculationOperations, mapOperationToGraphOperation, } from "@rowsncolumns/calculation-worker";
2
2
  import { tokenize as formulaTokenizer } from "@rowsncolumns/calculator";
3
- import { CellNode, CellRangeNode, isCellCoordinate, isCellCoordinateWithinCellRange, isCellNode, isCellRangeNode, isStaticNode, makeKey, } from "@rowsncolumns/dag";
3
+ import { CellNode, CellRangeNode, isCellCoordinate, isCellNode, isCellRangeNode, isStaticNode, makeKey, } from "@rowsncolumns/dag";
4
4
  import { FormulaError } from "@rowsncolumns/fast-formula-parser";
5
5
  import { isAreasEqual } from "@rowsncolumns/grid";
6
6
  import { useCallbackRef } from "@rowsncolumns/spreadsheet";
@@ -441,6 +441,9 @@ export const useCalculationWorker = (props) => {
441
441
  return undefined;
442
442
  }, []);
443
443
  const workerForceRecalcKeysRef = useRef(new Set());
444
+ // #1210: cells re-run once per calculation burst after their evaluation
445
+ // declared a new dynamic precedent (an `INDIRECT` / `OFFSET` target).
446
+ const dynamicRequeuedRef = useRef(new Set());
444
447
  const activeWorkerKeysRef = useRef(new Set());
445
448
  const activeExecutionsRef = useRef(0);
446
449
  const emitStats = useCallback(() => {
@@ -497,8 +500,14 @@ export const useCalculationWorker = (props) => {
497
500
  const sheetOperations = deferredOperationsBySheetRef.current.get(range.sheetId);
498
501
  const positions = [];
499
502
  sheetOperations?.forEach((operation) => {
503
+ // `range` is a bare CellCoordinateRange (a CellRangeNode carries it
504
+ // under `position`): compare the bounds directly.
500
505
  if (isCellCoordinate(operation.position) &&
501
- isCellCoordinateWithinCellRange(operation.position, range)) {
506
+ operation.position.sheetId === range.sheetId &&
507
+ operation.position.rowIndex >= range.startRowIndex &&
508
+ operation.position.rowIndex <= range.endRowIndex &&
509
+ operation.position.columnIndex >= range.startColumnIndex &&
510
+ operation.position.columnIndex <= range.endColumnIndex) {
502
511
  positions.push(operation.position);
503
512
  }
504
513
  });
@@ -1187,6 +1196,19 @@ export const useCalculationWorker = (props) => {
1187
1196
  completedCountRef.current += 1;
1188
1197
  shouldEmitStats = true;
1189
1198
  const enrichedPosition = result.position;
1199
+ if (result.dynamicPrecedents) {
1200
+ // The worker read these beyond the task's precedents: make them
1201
+ // graph edges. A NEW edge means the cell may have computed before
1202
+ // its target in this batch — run it again, now ordered behind it
1203
+ // and with the target's value in its scope.
1204
+ const added = graph.setDynamicPrecedents(enrichedPosition, result.dynamicPrecedents);
1205
+ const dynamicKey = makeKey(enrichedPosition);
1206
+ if (added && !dynamicRequeuedRef.current.has(dynamicKey)) {
1207
+ dynamicRequeuedRef.current.add(dynamicKey);
1208
+ pushPendingOperation({ type: "dirty", position: enrichedPosition });
1209
+ scheduleProcessingRef.current();
1210
+ }
1211
+ }
1190
1212
  if (Array.isArray(result.value)) {
1191
1213
  // Spilled arrays require special handling: persist matrix values and
1192
1214
  // dirty downstream dependents tied to the old spill footprint.
@@ -1208,6 +1230,7 @@ export const useCalculationWorker = (props) => {
1208
1230
  deserializeResultValue,
1209
1231
  graph,
1210
1232
  handleArrayEvaluation,
1233
+ pushPendingOperation,
1211
1234
  queueCellValue,
1212
1235
  queueStaticNotification,
1213
1236
  emitBatchPhaseEvent,
@@ -1332,6 +1355,7 @@ export const useCalculationWorker = (props) => {
1332
1355
  onAfterCalculation();
1333
1356
  pendingArrayDirtyAnchorsRef.current.clear();
1334
1357
  activeWorkerKeysRef.current.clear();
1358
+ dynamicRequeuedRef.current.clear();
1335
1359
  emitStats();
1336
1360
  }
1337
1361
  });
@@ -1 +1 @@
1
- {"version":3,"file":"use-calculation.d.ts","sourceRoot":"","sources":["../../../hooks/use-calculation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EACL,UAAU,EAEV,UAAU,EACX,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,2BAA2B,EAC3B,gBAAgB,EACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EAEnB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAmC,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EACL,aAAa,EAOd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,EAIV,kBAAkB,EACnB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAqBtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAuIjE,MAAM,MAAM,oBAAoB,GA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AAO,CAAC;QACzB,SAAS,CAAC,EAAE,oBAAoB,CAAC;QACjC,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB;;oCAmF8C,MAAM;iCAO7C,eAAe,kBACP,cAAc,GAAG,mBAAmB;sCAQ3B,MAAM,YAAY,cAAc;oCASV,eAAe;;;mCA0B5C,MAAM;+BAhaH,cAAc;8BAWd,cAAc;;;;;;6BAr3C9B,OAAO,2BAA2B,EAAE,UAAU,EAAE,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;8BA2yDxD,OAAO,2BAA2B,EAAE,UAAU,EAAE,GAAG,SAAS;CAmC1E,CAAC"}
@@ -502,6 +502,14 @@ export const useCalculation = ({ locale, functions, iterativeCalculation, onDema
502
502
  reclaimed.push(node);
503
503
  return node;
504
504
  };
505
+ // A dependency-parser range is a bare `CellCoordinateRange`, not a
506
+ // `CellRangeNode` (which carries it under `position`) — compare the
507
+ // bounds directly.
508
+ const isWithinDependencyRange = (position, range) => position.sheetId === range.sheetId &&
509
+ position.rowIndex >= range.startRowIndex &&
510
+ position.rowIndex <= range.endRowIndex &&
511
+ position.columnIndex >= range.startColumnIndex &&
512
+ position.columnIndex <= range.endColumnIndex;
505
513
  const reclaimDeferredNodesInRange = (range) => {
506
514
  const sheetOperations = deferredOperationsBySheetRef.current.get(range.sheetId);
507
515
  if (!sheetOperations?.size) {
@@ -510,7 +518,7 @@ export const useCalculation = ({ locale, functions, iterativeCalculation, onDema
510
518
  const positions = [];
511
519
  sheetOperations.forEach((operation) => {
512
520
  if (!cellNodeByKey.has(makeKey(operation.position)) &&
513
- isCellCoordinateWithinCellRange(operation.position, range)) {
521
+ isWithinDependencyRange(operation.position, range)) {
514
522
  positions.push(operation.position);
515
523
  }
516
524
  });
@@ -526,7 +534,14 @@ export const useCalculation = ({ locale, functions, iterativeCalculation, onDema
526
534
  continue;
527
535
  }
528
536
  const formulaValue = String(userEnteredValue).slice(1);
529
- const dependencies = getCalculator().dependencies(formulaValue, current.position);
537
+ // The formula text names the static precedents; an `INDIRECT` /
538
+ // `OFFSET` target is known only from the cell's last evaluation
539
+ // (#1210) — without it the walk stops at the dynamic cell and its
540
+ // deferred precedent stays stale.
541
+ const dependencies = [
542
+ ...getCalculator().dependencies(formulaValue, current.position),
543
+ ...getCalculator().getDynamicPrecedents(current.position),
544
+ ];
530
545
  for (const dependency of dependencies) {
531
546
  // Named-range refs (StaticReference) come back as deps too
532
547
  // now that the DAG is unified, but this code path is
@@ -552,9 +567,8 @@ export const useCalculation = ({ locale, functions, iterativeCalculation, onDema
552
567
  if (includedKeys.has(candidate.key)) {
553
568
  continue;
554
569
  }
555
- if (isCellRangeNode(dependency) &&
556
- !isDerivedCellPosition(candidate.position) &&
557
- isCellCoordinateWithinCellRange(candidate.position, dependency)) {
570
+ if (!isDerivedCellPosition(candidate.position) &&
571
+ isWithinDependencyRange(candidate.position, dependency)) {
558
572
  includedKeys.add(candidate.key);
559
573
  stack.push(candidate);
560
574
  }
@@ -922,6 +936,10 @@ export const useCalculation = ({ locale, functions, iterativeCalculation, onDema
922
936
  await processCells(cellNodes, recalculatedPosition);
923
937
  };
924
938
  let dirtyCells = [];
939
+ // #1210: a cell whose INDIRECT / OFFSET target was only learned by
940
+ // evaluating it may have computed before that precedent in this pass;
941
+ // it is re-run once per pass, now ordered behind the edge it declared.
942
+ const dynamicRequeued = new Set();
925
943
  while ((dirtyCells = getCalculator().getDirtyCells()) &&
926
944
  dirtyCells.length !== 0) {
927
945
  // Walk the dirty list in topological order, interleaving:
@@ -971,6 +989,13 @@ export const useCalculation = ({ locale, functions, iterativeCalculation, onDema
971
989
  }
972
990
  }
973
991
  await flushPending();
992
+ for (const position of calc.takeDynamicPrecedentChanges()) {
993
+ const key = makeKey(position);
994
+ if (dynamicRequeued.has(key))
995
+ continue;
996
+ dynamicRequeued.add(key);
997
+ calc.markAsDirty(position);
998
+ }
974
999
  }
975
1000
  }
976
1001
  catch (err) {
@@ -5,9 +5,9 @@ export type UseOnRequestCreateTableProps = {
5
5
  };
6
6
  /**
7
7
  * Open Excel's "Create Table" dialog (Ctrl+T / Insert → Table / Format as Table): the range
8
- * pre-fills with the selection, else the data region around the active cell (Ctrl+A's region),
9
- * and "My table has headers" is guessed from that range's first row. The dialog submits through
10
- * `onCreateTable`.
8
+ * pre-fills with the selection, else — with none, or one collapsed on a single cell — the data
9
+ * region around the active cell (Ctrl+A's region), and "My table has headers" is guessed from
10
+ * that range's first row. The dialog submits through `onCreateTable`.
11
11
  */
12
12
  export declare const useOnRequestCreateTable: ({ getEffectiveExtendedValue, }: UseOnRequestCreateTableProps) => (sheetId: number, activeCell: CellInterface, selections: SelectionArea<SelectionAttributes>[], theme?: TableTheme, bandedRange?: BandedDefinition) => void;
13
13
  //# sourceMappingURL=use-on-request-create-table.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-on-request-create-table.d.ts","sourceRoot":"","sources":["../../../hooks/use-on-request-create-table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,aAAa,EACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACX,MAAM,2BAA2B,CAAC;AASnC,MAAM,MAAM,4BAA4B,GAAG;IACzC,yBAAyB,EAAE,CACzB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,KAChB,aAAa,GAAG,IAAI,GAAG,SAAS,CAAC;CACvC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,gCAErC,4BAA4B,eAMhB,MAAM,cACH,aAAa,cACb,aAAa,CAAC,mBAAmB,CAAC,EAAE,UACxC,UAAU,gBACJ,gBAAgB,SA6BnC,CAAC"}
1
+ {"version":3,"file":"use-on-request-create-table.d.ts","sourceRoot":"","sources":["../../../hooks/use-on-request-create-table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,aAAa,EACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACX,MAAM,2BAA2B,CAAC;AASnC,MAAM,MAAM,4BAA4B,GAAG;IACzC,yBAAyB,EAAE,CACzB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,KAChB,aAAa,GAAG,IAAI,GAAG,SAAS,CAAC;CACvC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,gCAErC,4BAA4B,eAMhB,MAAM,cACH,aAAa,cACb,aAAa,CAAC,mBAAmB,CAAC,EAAE,UACxC,UAAU,gBACJ,gBAAgB,SAkCnC,CAAC"}
@@ -6,9 +6,9 @@ import { useSetCreatingTable } from "../atoms/creating-table.atom";
6
6
  import { useSetCreateTableDialogValue } from "../atoms/dialog-state.atom";
7
7
  /**
8
8
  * Open Excel's "Create Table" dialog (Ctrl+T / Insert → Table / Format as Table): the range
9
- * pre-fills with the selection, else the data region around the active cell (Ctrl+A's region),
10
- * and "My table has headers" is guessed from that range's first row. The dialog submits through
11
- * `onCreateTable`.
9
+ * pre-fills with the selection, else — with none, or one collapsed on a single cell — the data
10
+ * region around the active cell (Ctrl+A's region), and "My table has headers" is guessed from
11
+ * that range's first row. The dialog submits through `onCreateTable`.
12
12
  */
13
13
  export const useOnRequestCreateTable = ({ getEffectiveExtendedValue, }) => {
14
14
  const setCreateDialog = useSetCreateTableDialogValue();
@@ -16,7 +16,11 @@ export const useOnRequestCreateTable = ({ getEffectiveExtendedValue, }) => {
16
16
  const getContentfulRangeAroundCell = useGetContentfulRangeAroundCell();
17
17
  return useCallback((sheetId, activeCell, selections, theme, bandedRange) => {
18
18
  const lastSelection = selections?.[selections.length - 1];
19
- const range = lastSelection
19
+ const collapsed = !lastSelection ||
20
+ (lastSelection.range.startRowIndex === lastSelection.range.endRowIndex &&
21
+ lastSelection.range.startColumnIndex ===
22
+ lastSelection.range.endColumnIndex);
23
+ const range = !collapsed
20
24
  ? lastSelection.range
21
25
  : getContentfulRangeAroundCell?.(sheetId, activeCell) ??
22
26
  selectionFromActiveCell(activeCell)[0].range;
@@ -1 +1 @@
1
- {"version":3,"file":"delete-cells.d.ts","sourceRoot":"","sources":["../../../interface/delete-cells.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAEb,aAAa,EACd,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EACV,QAAQ,EAER,mBAAmB,EACnB,KAAK,EACN,MAAM,2BAA2B,CAAC;AAKnC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAK/D,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,CAAC;AAEvD,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,KAAK,EAAE,gUAoB9D,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,MAErB,SAAS,MAAM,EACf,MAAM,aAAa,EACnB,YAAY,aAAa,CAAC,mBAAmB,CAAC,EAAE,EAChD,YAAW,SAAsB,SAgSpC,CAAC"}
1
+ {"version":3,"file":"delete-cells.d.ts","sourceRoot":"","sources":["../../../interface/delete-cells.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAEb,aAAa,EACd,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EACV,QAAQ,EAER,mBAAmB,EACnB,KAAK,EACN,MAAM,2BAA2B,CAAC;AAKnC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAM/D,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,CAAC;AAEvD,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,QAAQ,EAAE,CAAC,SAAS,KAAK,EAAE,gUAoB9D,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,MAErB,SAAS,MAAM,EACf,MAAM,aAAa,EACnB,YAAY,aAAa,CAAC,mBAAmB,CAAC,EAAE,EAChD,YAAW,SAAsB,SA+TpC,CAAC"}