@mog-sdk/node 0.1.11 → 0.1.13

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.
package/dist/index.cjs CHANGED
@@ -90,10 +90,45 @@ function activeCellToStoreCellData(data, row, col) {
90
90
  }
91
91
  async function getData(ctx, sheetId, row, col) {
92
92
  const cellId = await ctx.computeBridge.getCellIdAt(sheetId, row, col);
93
- if (!cellId) return void 0;
94
- const data = await ctx.computeBridge.getActiveCell(sheetId, cellId);
95
- if (!data) return void 0;
96
- return activeCellToStoreCellData(data, row, col);
93
+ if (cellId) {
94
+ const data = await ctx.computeBridge.getActiveCell(sheetId, cellId);
95
+ if (data) return activeCellToStoreCellData(data, row, col);
96
+ }
97
+ const cellData = await ctx.computeBridge.getCellData(sheetId, row, col);
98
+ if (cellData != null) {
99
+ const obj = cellData;
100
+ const rawValue = obj.value ?? obj.raw;
101
+ if (rawValue != null) {
102
+ const value = parseMirrorValue(rawValue);
103
+ if (value !== null && value !== void 0) {
104
+ return {
105
+ id: obj.cell_id ?? obj.cellId ?? "",
106
+ row,
107
+ col,
108
+ raw: value
109
+ };
110
+ }
111
+ }
112
+ }
113
+ return void 0;
114
+ }
115
+ function parseMirrorValue(json) {
116
+ if (typeof json !== "object" || json === null) return null;
117
+ const obj = json;
118
+ switch (obj.type) {
119
+ case "number":
120
+ return obj.value;
121
+ case "text":
122
+ return obj.value;
123
+ case "boolean":
124
+ return obj.value;
125
+ case "error":
126
+ return obj.value;
127
+ case "null":
128
+ return null;
129
+ default:
130
+ return null;
131
+ }
97
132
  }
98
133
  function getEffectiveValue(data) {
99
134
  if (data.formula !== void 0) {
@@ -295,36 +330,6 @@ var init_errors = __esm({
295
330
  }
296
331
  });
297
332
 
298
- // ../../contracts/src/document/protection.ts
299
- var DEFAULT_PROTECTION_OPTIONS, DEFAULT_WORKBOOK_PROTECTION_OPTIONS;
300
- var init_protection = __esm({
301
- "../../contracts/src/document/protection.ts"() {
302
- "use strict";
303
- init_cjs_shims();
304
- DEFAULT_PROTECTION_OPTIONS = {
305
- // Selection defaults to true (users can always select cells)
306
- selectLockedCells: true,
307
- selectUnlockedCells: true,
308
- // All other operations blocked by default
309
- insertRows: false,
310
- insertColumns: false,
311
- deleteRows: false,
312
- deleteColumns: false,
313
- formatCells: false,
314
- formatColumns: false,
315
- formatRows: false,
316
- sort: false,
317
- useAutoFilter: false,
318
- usePivotTableReports: false,
319
- editObjects: false,
320
- editScenarios: false
321
- };
322
- DEFAULT_WORKBOOK_PROTECTION_OPTIONS = {
323
- structure: true
324
- };
325
- }
326
- });
327
-
328
333
  // ../../infra/transport/src/command-metadata.gen.ts
329
334
  var BYTES_TUPLE_COMMANDS, RECALC_COMMANDS;
330
335
  var init_command_metadata_gen = __esm({
@@ -2233,101 +2238,6 @@ var init_mutation_result_handler = __esm({
2233
2238
  }
2234
2239
  });
2235
2240
 
2236
- // ../../contracts/src/core/commands.ts
2237
- var init_commands = __esm({
2238
- "../../contracts/src/core/commands.ts"() {
2239
- "use strict";
2240
- init_cjs_shims();
2241
- }
2242
- });
2243
-
2244
- // ../../contracts/src/core/core.ts
2245
- var init_core2 = __esm({
2246
- "../../contracts/src/core/core.ts"() {
2247
- "use strict";
2248
- init_cjs_shims();
2249
- }
2250
- });
2251
-
2252
- // ../../contracts/src/core/disposable.ts
2253
- var init_disposable = __esm({
2254
- "../../contracts/src/core/disposable.ts"() {
2255
- "use strict";
2256
- init_cjs_shims();
2257
- }
2258
- });
2259
-
2260
- // ../../contracts/src/core/event-base.ts
2261
- var init_event_base = __esm({
2262
- "../../contracts/src/core/event-base.ts"() {
2263
- "use strict";
2264
- init_cjs_shims();
2265
- }
2266
- });
2267
-
2268
- // ../../contracts/src/core/execution.ts
2269
- var init_execution = __esm({
2270
- "../../contracts/src/core/execution.ts"() {
2271
- "use strict";
2272
- init_cjs_shims();
2273
- }
2274
- });
2275
-
2276
- // ../../contracts/src/core/result.ts
2277
- var init_result = __esm({
2278
- "../../contracts/src/core/result.ts"() {
2279
- "use strict";
2280
- init_cjs_shims();
2281
- }
2282
- });
2283
-
2284
- // ../../contracts/src/core/schema.ts
2285
- var init_schema = __esm({
2286
- "../../contracts/src/core/schema.ts"() {
2287
- "use strict";
2288
- init_cjs_shims();
2289
- }
2290
- });
2291
-
2292
- // ../../contracts/src/core/formatted-text.ts
2293
- function asFormattedText(s) {
2294
- return s;
2295
- }
2296
- function displayStringOrNull(text) {
2297
- return text;
2298
- }
2299
- var init_formatted_text = __esm({
2300
- "../../contracts/src/core/formatted-text.ts"() {
2301
- "use strict";
2302
- init_cjs_shims();
2303
- }
2304
- });
2305
-
2306
- // ../../contracts/src/core/testing.ts
2307
- var init_testing = __esm({
2308
- "../../contracts/src/core/testing.ts"() {
2309
- "use strict";
2310
- init_cjs_shims();
2311
- }
2312
- });
2313
-
2314
- // ../../contracts/src/core/index.ts
2315
- var init_core3 = __esm({
2316
- "../../contracts/src/core/index.ts"() {
2317
- "use strict";
2318
- init_cjs_shims();
2319
- init_commands();
2320
- init_core2();
2321
- init_disposable();
2322
- init_event_base();
2323
- init_execution();
2324
- init_result();
2325
- init_schema();
2326
- init_formatted_text();
2327
- init_testing();
2328
- }
2329
- });
2330
-
2331
2241
  // ../../kernel/src/bridges/wire/constants.gen.ts
2332
2242
  var HEADER_SIZE, CELL_STRIDE, MERGE_STRIDE, DIM_STRIDE, NO_STRING, MUTATION_HEADER_SIZE, PATCH_STRIDE, OFF_NUMBER_VALUE, OFF_DISPLAY_OFF, OFF_ERROR_OFF, OFF_FLAGS, OFF_FORMAT_IDX, OFF_DISPLAY_LEN, OFF_ERROR_LEN, OFF_BG_COLOR_OVERRIDE, OFF_FONT_COLOR_OVERRIDE, DATA_BAR_ENTRY_STRIDE, ICON_ENTRY_STRIDE, MUT_HAS_PROJECTION_CHANGES, MUT_HAS_ERRORS, MUT_HAS_PALETTE, ICON_SET_NAMES;
2333
2243
  var init_constants_gen = __esm({
@@ -2385,12 +2295,12 @@ var init_constants_gen = __esm({
2385
2295
  });
2386
2296
 
2387
2297
  // ../../kernel/src/bridges/wire/binary-mutation-reader.ts
2388
- var sharedDecoder, BinaryMutationReader;
2298
+ var import_core, sharedDecoder, BinaryMutationReader;
2389
2299
  var init_binary_mutation_reader = __esm({
2390
2300
  "../../kernel/src/bridges/wire/binary-mutation-reader.ts"() {
2391
2301
  "use strict";
2392
2302
  init_cjs_shims();
2393
- init_core3();
2303
+ import_core = require("@mog-sdk/spreadsheet-contracts/core");
2394
2304
  init_constants_gen();
2395
2305
  sharedDecoder = new TextDecoder("utf-8");
2396
2306
  BinaryMutationReader = class {
@@ -2489,7 +2399,7 @@ var init_binary_mutation_reader = __esm({
2489
2399
  const displayLen = this._view.getUint16(recOff + OFF_DISPLAY_LEN, true);
2490
2400
  if (displayOff === NO_STRING || displayLen === 0) return null;
2491
2401
  const start = this._stringPoolStart + displayOff;
2492
- return asFormattedText(sharedDecoder.decode(this._bytes.subarray(start, start + displayLen)));
2402
+ return (0, import_core.asFormattedText)(sharedDecoder.decode(this._bytes.subarray(start, start + displayLen)));
2493
2403
  }
2494
2404
  /**
2495
2405
  * Get a zero-copy subarray view of the raw UTF-8 display bytes for patch i.
@@ -2641,7 +2551,7 @@ var init_binary_mutation_reader = __esm({
2641
2551
  const displayLen = this._view.getUint16(recOff + OFF_DISPLAY_LEN, true);
2642
2552
  if (displayOff === NO_STRING || displayLen === 0) return null;
2643
2553
  const start = this._stringPoolStart + displayOff;
2644
- return asFormattedText(sharedDecoder.decode(this._bytes.subarray(start, start + displayLen)));
2554
+ return (0, import_core.asFormattedText)(sharedDecoder.decode(this._bytes.subarray(start, start + displayLen)));
2645
2555
  }
2646
2556
  /**
2647
2557
  * Get a zero-copy subarray view of the raw UTF-8 display bytes for spill patch i.
@@ -2690,12 +2600,12 @@ function rgbaU32ToHex(value) {
2690
2600
  const b = value >>> 8 & 255;
2691
2601
  return "#" + (1 << 24 | r << 16 | g << 8 | b).toString(16).slice(1).toUpperCase();
2692
2602
  }
2693
- var sharedEncoder, sharedDecoder2, EMPTY_FORMAT, BinaryViewportBuffer, CellAccessor;
2603
+ var import_core2, sharedEncoder, sharedDecoder2, EMPTY_FORMAT, BinaryViewportBuffer, CellAccessor;
2694
2604
  var init_binary_viewport_buffer = __esm({
2695
2605
  "../../kernel/src/bridges/wire/binary-viewport-buffer.ts"() {
2696
2606
  "use strict";
2697
2607
  init_cjs_shims();
2698
- init_core3();
2608
+ import_core2 = require("@mog-sdk/spreadsheet-contracts/core");
2699
2609
  init_constants_gen();
2700
2610
  init_constants_gen();
2701
2611
  sharedEncoder = new TextEncoder();
@@ -3015,7 +2925,7 @@ var init_binary_viewport_buffer = __esm({
3015
2925
  sampleCells.push({
3016
2926
  row,
3017
2927
  col,
3018
- displayText: displayStringOrNull(reader.patchDisplayText(i))
2928
+ displayText: (0, import_core2.displayStringOrNull)(reader.patchDisplayText(i))
3019
2929
  });
3020
2930
  }
3021
2931
  }
@@ -3034,7 +2944,7 @@ var init_binary_viewport_buffer = __esm({
3034
2944
  sampleCells.push({
3035
2945
  row,
3036
2946
  col,
3037
- displayText: displayStringOrNull(reader.spillPatchDisplayText(i))
2947
+ displayText: (0, import_core2.displayStringOrNull)(reader.spillPatchDisplayText(i))
3038
2948
  });
3039
2949
  }
3040
2950
  }
@@ -3792,7 +3702,7 @@ var init_binary_viewport_buffer = __esm({
3792
3702
  */
3793
3703
  get displayText() {
3794
3704
  const decoded = this._buffer.getOrDecodeString(this._displayOff, this._displayLen);
3795
- return decoded !== null ? asFormattedText(decoded) : null;
3705
+ return decoded !== null ? (0, import_core2.asFormattedText)(decoded) : null;
3796
3706
  }
3797
3707
  /**
3798
3708
  * Get the error text for the current cell.
@@ -3854,13 +3764,13 @@ var init_binary_viewport_buffer = __esm({
3854
3764
  function cellKey(row, col) {
3855
3765
  return `${row},${col}`;
3856
3766
  }
3857
- var ViewportCoordinator;
3767
+ var import_core3, ViewportCoordinator;
3858
3768
  var init_viewport_coordinator = __esm({
3859
3769
  "../../kernel/src/bridges/wire/viewport-coordinator.ts"() {
3860
3770
  "use strict";
3861
3771
  init_cjs_shims();
3862
3772
  init_binary_viewport_buffer();
3863
- init_core3();
3773
+ import_core3 = require("@mog-sdk/spreadsheet-contracts/core");
3864
3774
  ViewportCoordinator = class {
3865
3775
  constructor(viewportId) {
3866
3776
  /** Monotonically increasing version, incremented on every write. */
@@ -3981,7 +3891,7 @@ var init_viewport_coordinator = __esm({
3981
3891
  flags: reader.patchFlags(i),
3982
3892
  numberValue: reader.patchNumberValue(i),
3983
3893
  formatIdx: reader.patchFormatIdx(i),
3984
- displayString: displayStringOrNull(reader.patchDisplayText(i)),
3894
+ displayString: (0, import_core3.displayStringOrNull)(reader.patchDisplayText(i)),
3985
3895
  errorString: reader.patchErrorText(i),
3986
3896
  bgColorOverride: reader.patchBgColorOverride(i),
3987
3897
  fontColorOverride: reader.patchFontColorOverride(i),
@@ -3998,7 +3908,7 @@ var init_viewport_coordinator = __esm({
3998
3908
  flags: reader.spillPatchFlags(i),
3999
3909
  numberValue: reader.spillPatchNumberValue(i),
4000
3910
  formatIdx: reader.spillPatchFormatIdx(i),
4001
- displayString: displayStringOrNull(reader.spillPatchDisplayText(i)),
3911
+ displayString: (0, import_core3.displayStringOrNull)(reader.spillPatchDisplayText(i)),
4002
3912
  errorString: reader.spillPatchErrorText(i),
4003
3913
  bgColorOverride: reader.spillPatchBgColorOverride(i),
4004
3914
  fontColorOverride: reader.spillPatchFontColorOverride(i),
@@ -5158,10 +5068,11 @@ var init_compute_core = __esm({
5158
5068
  * Requires at least CONTEXT_SET phase (the engine may or may not have been started yet).
5159
5069
  * After fullRecalc completes, the bridge transitions to STARTED phase.
5160
5070
  */
5161
- async fullRecalc() {
5071
+ async fullRecalc(options) {
5162
5072
  this.ensurePhase("CONTEXT_SET", "fullRecalc");
5163
5073
  const result = await this.transport.call("compute_full_recalc", {
5164
- docId: this.docId
5074
+ docId: this.docId,
5075
+ options: options ?? {}
5165
5076
  });
5166
5077
  this._phase = "STARTED";
5167
5078
  this.mutationHandler?.applyAndNotify({ recalc: result });
@@ -6797,6 +6708,9 @@ var init_compute_bridge_gen = __esm({
6797
6708
  pivotUnregisterDef(sheetId, pivotName) {
6798
6709
  return this.core.mutatePlain(this.core.transport.call("compute_pivot_unregister_def", { docId: this.core.docId, sheetId, pivotName }));
6799
6710
  }
6711
+ pivotMaterialize(sheetId, pivotId, expansionState) {
6712
+ return this.core.query(this.core.transport.call("compute_pivot_materialize", { docId: this.core.docId, sheetId, pivotId, expansionState }));
6713
+ }
6800
6714
  registerViewport(viewportId, sheetId, startRow, startCol, endRow, endCol) {
6801
6715
  return this.core.mutatePlain(this.core.transport.call("compute_register_viewport", { docId: this.core.docId, viewportId, sheetId, startRow, startCol, endRow, endCol }));
6802
6716
  }
@@ -6923,13 +6837,13 @@ async function rustSchemaInferColumn(values) {
6923
6837
  const t = await getSchemaTransport();
6924
6838
  return t.call("compute_schema_infer_column", { values });
6925
6839
  }
6926
- var ComputeBridge, schemaTransport;
6840
+ var import_protection, ComputeBridge, schemaTransport;
6927
6841
  var init_compute_bridge = __esm({
6928
6842
  "../../kernel/src/bridges/compute/compute-bridge.ts"() {
6929
6843
  "use strict";
6930
6844
  init_cjs_shims();
6931
6845
  init_formula_string();
6932
- init_protection();
6846
+ import_protection = require("@mog-sdk/spreadsheet-contracts/protection");
6933
6847
  init_src();
6934
6848
  init_compute_wire_converters();
6935
6849
  init_compute_core();
@@ -7053,8 +6967,8 @@ var init_compute_bridge = __esm({
7053
6967
  // ===========================================================================
7054
6968
  // Error Recovery delegates
7055
6969
  // ===========================================================================
7056
- fullRecalc() {
7057
- return this.core.fullRecalc();
6970
+ fullRecalc(options) {
6971
+ return this.core.fullRecalc(options);
7058
6972
  }
7059
6973
  exportToXlsxBytes() {
7060
6974
  return this.core.exportToXlsxBytes();
@@ -7271,7 +7185,7 @@ var init_compute_bridge = __esm({
7271
7185
  async getSheetProtectionOptions(sheetId) {
7272
7186
  const settings = await this.getSheetSettings(sheetId);
7273
7187
  if (!settings.isProtected) return null;
7274
- return { ...DEFAULT_PROTECTION_OPTIONS, ...settings.protectionOptions };
7188
+ return { ...import_protection.DEFAULT_PROTECTION_OPTIONS, ...settings.protectionOptions };
7275
7189
  }
7276
7190
  /** Set multiple sheet settings at once (iterates entries). */
7277
7191
  async setSheetSettings(sheetId, updates) {
@@ -7355,77 +7269,19 @@ var init_compute_bridge = __esm({
7355
7269
  }
7356
7270
  });
7357
7271
 
7358
- // ../../contracts/src/rendering/grid-renderer.ts
7359
- var init_grid_renderer = __esm({
7360
- "../../contracts/src/rendering/grid-renderer.ts"() {
7361
- "use strict";
7362
- init_cjs_shims();
7363
- }
7364
- });
7365
-
7366
- // ../../contracts/src/rendering/constants.ts
7367
- var DEFAULT_COL_WIDTH_WINDOWS, DEFAULT_COL_WIDTH_MACOS, _isMac, DEFAULT_COL_WIDTH;
7368
- var init_constants = __esm({
7369
- "../../contracts/src/rendering/constants.ts"() {
7370
- "use strict";
7371
- init_cjs_shims();
7372
- DEFAULT_COL_WIDTH_WINDOWS = 64;
7373
- DEFAULT_COL_WIDTH_MACOS = 72;
7374
- _isMac = typeof navigator !== "undefined" && /Mac/.test(navigator.platform ?? "");
7375
- DEFAULT_COL_WIDTH = _isMac ? DEFAULT_COL_WIDTH_MACOS : DEFAULT_COL_WIDTH_WINDOWS;
7376
- }
7377
- });
7378
-
7379
- // ../../contracts/src/rendering/data-sources.ts
7380
- var DEFAULT_CHROME_THEME;
7381
- var init_data_sources = __esm({
7382
- "../../contracts/src/rendering/data-sources.ts"() {
7383
- "use strict";
7384
- init_cjs_shims();
7385
- DEFAULT_CHROME_THEME = {
7386
- canvasBackground: "#ffffff",
7387
- gridlineColor: "#e0e0e0",
7388
- headerBackground: "#f8f9fa",
7389
- headerText: "#333333",
7390
- headerBorder: "#dadce0",
7391
- headerHighlightBackground: "#e8eaed",
7392
- headerHighlightText: "#1a73e8",
7393
- selectionFill: "rgba(66, 133, 244, 0.1)",
7394
- selectionBorder: "#4285f4",
7395
- activeCellBorder: "#1a73e8",
7396
- fillHandleColor: "#4285f4",
7397
- dragSourceColor: "rgba(66, 133, 244, 0.15)",
7398
- dragTargetColor: "#4285f4",
7399
- scrollbarTrack: "#f1f1f1",
7400
- scrollbarThumb: "#c1c1c1"
7401
- };
7402
- }
7403
- });
7404
-
7405
- // ../../contracts/src/rendering/index.ts
7406
- var init_rendering = __esm({
7407
- "../../contracts/src/rendering/index.ts"() {
7408
- "use strict";
7409
- init_cjs_shims();
7410
- init_grid_renderer();
7411
- init_constants();
7412
- init_data_sources();
7413
- }
7414
- });
7415
-
7416
7272
  // ../../kernel/src/domain/sheets/sheet-meta-defaults.ts
7417
7273
  function getSheetMetaDefault(field) {
7418
7274
  const def = SHEET_META_SCHEMA[field];
7419
7275
  return def.default;
7420
7276
  }
7421
- var SHEET_META_DEFAULT_ROW_HEIGHT, SHEET_META_DEFAULT_COL_WIDTH, SHEET_META_DEFAULT_GRIDLINE_COLOR, SHEET_META_SCHEMA;
7277
+ var import_rendering, SHEET_META_DEFAULT_ROW_HEIGHT, SHEET_META_DEFAULT_COL_WIDTH, SHEET_META_DEFAULT_GRIDLINE_COLOR, SHEET_META_SCHEMA;
7422
7278
  var init_sheet_meta_defaults = __esm({
7423
7279
  "../../kernel/src/domain/sheets/sheet-meta-defaults.ts"() {
7424
7280
  "use strict";
7425
7281
  init_cjs_shims();
7426
- init_rendering();
7282
+ import_rendering = require("@mog-sdk/spreadsheet-contracts/rendering");
7427
7283
  SHEET_META_DEFAULT_ROW_HEIGHT = 20;
7428
- SHEET_META_DEFAULT_COL_WIDTH = DEFAULT_COL_WIDTH;
7284
+ SHEET_META_DEFAULT_COL_WIDTH = import_rendering.DEFAULT_COL_WIDTH;
7429
7285
  SHEET_META_DEFAULT_GRIDLINE_COLOR = "#e2e2e2";
7430
7286
  SHEET_META_SCHEMA = {
7431
7287
  // ===========================================================================
@@ -7965,11 +7821,12 @@ function normalizeRange(range2) {
7965
7821
  sheetId: range2.sheetId
7966
7822
  };
7967
7823
  }
7824
+ var import_core4;
7968
7825
  var init_range = __esm({
7969
7826
  "../../spreadsheet-utils/src/range.ts"() {
7970
7827
  "use strict";
7971
7828
  init_cjs_shims();
7972
- init_core3();
7829
+ import_core4 = require("@mog-sdk/spreadsheet-contracts/core");
7973
7830
  }
7974
7831
  });
7975
7832
 
@@ -7997,6 +7854,15 @@ function letterToCol(letters) {
7997
7854
  function toA12(row, col) {
7998
7855
  return `${colToLetter3(col)}${row + 1}`;
7999
7856
  }
7857
+ function quoteSheetName(name) {
7858
+ if (/[^A-Za-z0-9_]/.test(name) || /^\d/.test(name)) {
7859
+ return `'${name.replace(/'/g, "''")}'`;
7860
+ }
7861
+ return name;
7862
+ }
7863
+ function toSheetA1(row, col, sheetName) {
7864
+ return `${quoteSheetName(sheetName)}!${colToLetter3(col)}${row + 1}`;
7865
+ }
8000
7866
  function parseCellAddress(ref) {
8001
7867
  const match = ref.match(CELL_ADDRESS_REGEX);
8002
7868
  if (!match) return null;
@@ -9426,7 +9292,7 @@ var init_data_extractor = __esm({
9426
9292
  });
9427
9293
 
9428
9294
  // ../../charts/src/core/index.ts
9429
- var init_core4 = __esm({
9295
+ var init_core2 = __esm({
9430
9296
  "../../charts/src/core/index.ts"() {
9431
9297
  "use strict";
9432
9298
  init_cjs_shims();
@@ -13410,7 +13276,7 @@ var init_src2 = __esm({
13410
13276
  "../../charts/src/index.ts"() {
13411
13277
  "use strict";
13412
13278
  init_cjs_shims();
13413
- init_core4();
13279
+ init_core2();
13414
13280
  init_primitives();
13415
13281
  init_compiler();
13416
13282
  }
@@ -13423,6 +13289,15 @@ __export(chart_bridge_exports, {
13423
13289
  createChartBridge: () => createChartBridge,
13424
13290
  initChartWasm: () => initChartWasm
13425
13291
  });
13292
+ function normalizeAxisForRendering(axis) {
13293
+ const normAxis = (a) => a ? { ...a, type: a.type ?? a.axisType, show: a.show ?? a.visible } : a;
13294
+ return {
13295
+ ...axis,
13296
+ xAxis: normAxis(axis.categoryAxis ?? axis.xAxis),
13297
+ yAxis: normAxis(axis.valueAxis ?? axis.yAxis),
13298
+ secondaryYAxis: normAxis(axis.secondaryValueAxis ?? axis.secondaryYAxis)
13299
+ };
13300
+ }
13426
13301
  function toChartConfig(chart) {
13427
13302
  return {
13428
13303
  type: chart.chartType ?? "bar",
@@ -13437,12 +13312,13 @@ function toChartConfig(chart) {
13437
13312
  title: chart.title,
13438
13313
  subtitle: chart.subtitle,
13439
13314
  legend: chart.legend,
13440
- axis: chart.axis,
13315
+ axis: chart.axis ? normalizeAxisForRendering(chart.axis) : chart.axis,
13441
13316
  colors: chart.colors,
13442
13317
  series: chart.series,
13443
13318
  dataLabels: chart.dataLabels,
13444
13319
  pieSlice: chart.pieSlice,
13445
- trendline: chart.trendline,
13320
+ trendline: Array.isArray(chart.trendline) ? chart.trendline[0] : chart.trendline,
13321
+ trendlines: chart.trendline,
13446
13322
  showLines: chart.showLines,
13447
13323
  smoothLines: chart.smoothLines,
13448
13324
  radarFilled: chart.radarFilled,
@@ -13458,7 +13334,7 @@ function toChartConfig(chart) {
13458
13334
  splitType: chart.splitType,
13459
13335
  splitValue: chart.splitValue,
13460
13336
  subType: chart.subType,
13461
- extra: chart.definition
13337
+ extra: chart.ooxml
13462
13338
  };
13463
13339
  }
13464
13340
  function initChartWasm(exports2) {
@@ -13856,7 +13732,7 @@ var init_chart_bridge = __esm({
13856
13732
  type: "nominal"
13857
13733
  };
13858
13734
  }
13859
- const chartTitle = chart.definition && typeof chart.definition === "object" ? chart.definition.chartTitle : void 0;
13735
+ const chartTitle = chart.ooxml && typeof chart.ooxml === "object" ? chart.ooxml.chartTitle : void 0;
13860
13736
  let titleSpec;
13861
13737
  if (chart.title) {
13862
13738
  titleSpec = {
@@ -13898,7 +13774,7 @@ var init_chart_bridge = __esm({
13898
13774
  if (chart.colors && chart.colors.length > 0) {
13899
13775
  specConfig.range = { category: chart.colors };
13900
13776
  }
13901
- const chartArea = chart.definition && typeof chart.definition === "object" ? chart.definition.chartArea : void 0;
13777
+ const chartArea = chart.ooxml && typeof chart.ooxml === "object" ? chart.ooxml.chartArea : void 0;
13902
13778
  if (chartArea?.fill && typeof chartArea.fill === "object") {
13903
13779
  specConfig.background = chartArea.fill.color;
13904
13780
  }
@@ -15923,10 +15799,11 @@ var init_cell_properties = __esm({
15923
15799
  });
15924
15800
 
15925
15801
  // ../../kernel/src/api/internal/value-conversions.ts
15926
- function viewportCellValueToCellValue(cv) {
15802
+ function normalizeCellValue(cv) {
15803
+ if (cv !== null && isCellError(cv)) return errorDisplayString(cv.value);
15927
15804
  return cv;
15928
15805
  }
15929
- function viewportCellValueToString(cv) {
15806
+ function cellValueToString(cv) {
15930
15807
  if (cv === null || cv === void 0) return "";
15931
15808
  if (typeof cv === "string") return cv;
15932
15809
  if (typeof cv === "number") return String(cv);
@@ -16090,15 +15967,14 @@ function buildBaseFields(data) {
16090
15967
  name: data.name,
16091
15968
  visible: data.visible,
16092
15969
  groupId: data.groupId,
16093
- altText: data.altText,
15970
+ altText: "altText" in data ? data.altText : void 0,
16094
15971
  createdAt: data.createdAt,
16095
15972
  updatedAt: data.updatedAt
16096
15973
  };
16097
15974
  }
16098
- function toShapeObject(data) {
16099
- const d = data;
15975
+ function toShapeObject(d) {
16100
15976
  return {
16101
- ...buildBaseFields(data),
15977
+ ...buildBaseFields(d),
16102
15978
  type: "shape",
16103
15979
  shapeType: d.shapeType ?? "rect",
16104
15980
  fill: d.fill,
@@ -16108,10 +15984,9 @@ function toShapeObject(data) {
16108
15984
  adjustments: d.adjustments
16109
15985
  };
16110
15986
  }
16111
- function toPictureObject(data) {
16112
- const d = data;
15987
+ function toPictureObject(d) {
16113
15988
  return {
16114
- ...buildBaseFields(data),
15989
+ ...buildBaseFields(d),
16115
15990
  type: "picture",
16116
15991
  src: d.src ?? "",
16117
15992
  originalWidth: d.originalWidth ?? 0,
@@ -16120,10 +15995,9 @@ function toPictureObject(data) {
16120
15995
  adjustments: d.adjustments
16121
15996
  };
16122
15997
  }
16123
- function toTextBoxObject(data) {
16124
- const d = data;
15998
+ function toTextBoxObject(d) {
16125
15999
  return {
16126
- ...buildBaseFields(data),
16000
+ ...buildBaseFields(d),
16127
16001
  type: "textbox",
16128
16002
  content: d.content ?? "",
16129
16003
  defaultFormat: d.defaultFormat,
@@ -16134,10 +16008,9 @@ function toTextBoxObject(data) {
16134
16008
  wordArt: d.wordArt
16135
16009
  };
16136
16010
  }
16137
- function toConnectorObject(data) {
16138
- const d = data;
16011
+ function toConnectorObject(d) {
16139
16012
  return {
16140
- ...buildBaseFields(data),
16013
+ ...buildBaseFields(d),
16141
16014
  type: "connector",
16142
16015
  shapeType: d.shapeType ?? "connector",
16143
16016
  startConnection: d.startConnection,
@@ -16146,8 +16019,7 @@ function toConnectorObject(data) {
16146
16019
  outline: d.outline
16147
16020
  };
16148
16021
  }
16149
- function toChartObject(data) {
16150
- const d = data;
16022
+ function toChartObject(d) {
16151
16023
  const chartConfig = {
16152
16024
  subType: d.subType,
16153
16025
  seriesOrientation: d.seriesOrientation,
@@ -16176,41 +16048,38 @@ function toChartObject(data) {
16176
16048
  tableCategoryColumn: d.tableCategoryColumn,
16177
16049
  useTableColumnNamesAsLabels: d.useTableColumnNamesAsLabels,
16178
16050
  tableColumnNames: d.tableColumnNames,
16179
- definition: d.definition,
16180
16051
  ooxml: d.ooxml
16181
16052
  };
16182
16053
  return {
16183
- ...buildBaseFields(data),
16054
+ ...buildBaseFields(d),
16184
16055
  type: "chart",
16185
16056
  chartType: d.chartType ?? "column",
16186
- anchorMode: data.anchor.anchorMode === "twoCell" ? "twoCell" : "oneCell",
16187
- widthCells: d.widthCells ?? data.width ?? 8,
16188
- heightCells: d.heightCells ?? data.height ?? 15,
16057
+ anchorMode: d.anchor.anchorMode === "twoCell" ? "twoCell" : "oneCell",
16058
+ widthCells: d.widthCells ?? d.width ?? 8,
16059
+ heightCells: d.heightCells ?? d.height ?? 15,
16189
16060
  chartConfig,
16190
16061
  dataRangeIdentity: d.dataRangeIdentity,
16191
16062
  seriesRangeIdentity: d.seriesRangeIdentity,
16192
16063
  categoryRangeIdentity: d.categoryRangeIdentity
16193
16064
  };
16194
16065
  }
16195
- function toEquationObject(data) {
16196
- const d = data;
16066
+ function toEquationObject(d) {
16067
+ const equation = typeof d.equation === "string" ? { id: d.id, omml: d.equation } : d.equation;
16197
16068
  return {
16198
- ...buildBaseFields(data),
16069
+ ...buildBaseFields(d),
16199
16070
  type: "equation",
16200
- equation: d.equation
16071
+ equation
16201
16072
  };
16202
16073
  }
16203
- function toSmartArtObject(data) {
16204
- const d = data;
16074
+ function toSmartArtObject(d) {
16205
16075
  return {
16206
- ...buildBaseFields(data),
16076
+ ...buildBaseFields(d),
16207
16077
  type: "smartart",
16208
16078
  diagram: d.definition ?? {}
16209
16079
  };
16210
16080
  }
16211
- function toDrawingObject(data) {
16212
- const common = buildBaseFields(data);
16213
- const d = data;
16081
+ function toDrawingObject(d) {
16082
+ const common = buildBaseFields(d);
16214
16083
  const strokes = /* @__PURE__ */ new Map();
16215
16084
  if (d.strokes) {
16216
16085
  for (const [id, stroke] of Object.entries(d.strokes)) {
@@ -16235,10 +16104,9 @@ function toDrawingObject(data) {
16235
16104
  backgroundColor: d.backgroundColor
16236
16105
  };
16237
16106
  }
16238
- function toOleObjectObject(data) {
16239
- const d = data;
16107
+ function toOleObjectObject(d) {
16240
16108
  return {
16241
- ...buildBaseFields(data),
16109
+ ...buildBaseFields(d),
16242
16110
  type: "oleObject",
16243
16111
  progId: d.progId ?? "",
16244
16112
  dvAspect: d.dvAspect ?? "content",
@@ -16249,8 +16117,7 @@ function toOleObjectObject(data) {
16249
16117
  };
16250
16118
  }
16251
16119
  function toFloatingObject(data) {
16252
- const objectType = data.type ?? "shape";
16253
- switch (objectType) {
16120
+ switch (data.type) {
16254
16121
  case "shape":
16255
16122
  return toShapeObject(data);
16256
16123
  case "picture":
@@ -16270,10 +16137,43 @@ function toFloatingObject(data) {
16270
16137
  case "drawing":
16271
16138
  return toDrawingObject(data);
16272
16139
  case "slicer":
16273
- default:
16274
- return toShapeObject({ ...data, type: "shape" });
16140
+ case "camera":
16141
+ case "formControl":
16142
+ default: {
16143
+ const fallback = Object.assign({}, data, { type: "shape" });
16144
+ return toShapeObject(fallback);
16145
+ }
16275
16146
  }
16276
16147
  }
16148
+ function createMinimalFloatingObject(type, id, sheetId, extras) {
16149
+ const wire = {
16150
+ id,
16151
+ sheetId,
16152
+ type,
16153
+ anchor: {
16154
+ anchorRow: 0,
16155
+ anchorCol: 0,
16156
+ anchorRowOffset: 0,
16157
+ anchorColOffset: 0,
16158
+ anchorMode: "absolute"
16159
+ },
16160
+ width: 100,
16161
+ height: 100,
16162
+ zIndex: 0,
16163
+ rotation: 0,
16164
+ flipH: false,
16165
+ flipV: false,
16166
+ locked: false,
16167
+ visible: true,
16168
+ printable: true,
16169
+ opacity: 1,
16170
+ name: "",
16171
+ createdAt: 0,
16172
+ updatedAt: 0,
16173
+ ...extras
16174
+ };
16175
+ return toFloatingObject(wire);
16176
+ }
16277
16177
  var init_floating_object_mapper = __esm({
16278
16178
  "../../kernel/src/bridges/compute/floating-object-mapper.ts"() {
16279
16179
  "use strict";
@@ -16486,7 +16386,7 @@ function toDisposable(fn) {
16486
16386
  return disposable;
16487
16387
  }
16488
16388
  var DisposableBase, DisposableStore, DisposableNone;
16489
- var init_disposable2 = __esm({
16389
+ var init_disposable = __esm({
16490
16390
  "../../spreadsheet-utils/src/disposable.ts"() {
16491
16391
  "use strict";
16492
16392
  init_cjs_shims();
@@ -16550,7 +16450,7 @@ function ok(value) {
16550
16450
  function err(error) {
16551
16451
  return { ok: false, error };
16552
16452
  }
16553
- var init_result2 = __esm({
16453
+ var init_result = __esm({
16554
16454
  "../../spreadsheet-utils/src/result.ts"() {
16555
16455
  "use strict";
16556
16456
  init_cjs_shims();
@@ -16563,7 +16463,7 @@ var init_subscribable = __esm({
16563
16463
  "../../kernel/src/services/primitives/subscribable.ts"() {
16564
16464
  "use strict";
16565
16465
  init_cjs_shims();
16566
- init_disposable2();
16466
+ init_disposable();
16567
16467
  Subscribable = class extends DisposableBase {
16568
16468
  constructor() {
16569
16469
  super(...arguments);
@@ -16623,7 +16523,7 @@ var init_event_emitter = __esm({
16623
16523
  "../../kernel/src/services/primitives/event-emitter.ts"() {
16624
16524
  "use strict";
16625
16525
  init_cjs_shims();
16626
- init_disposable2();
16526
+ init_disposable();
16627
16527
  TypedEventEmitter = class extends DisposableBase {
16628
16528
  constructor() {
16629
16529
  super(...arguments);
@@ -16688,8 +16588,8 @@ var init_primitives3 = __esm({
16688
16588
  "../../kernel/src/services/primitives/index.ts"() {
16689
16589
  "use strict";
16690
16590
  init_cjs_shims();
16691
- init_disposable2();
16692
- init_result2();
16591
+ init_disposable();
16592
+ init_result();
16693
16593
  init_subscribable();
16694
16594
  init_event_emitter();
16695
16595
  }
@@ -24739,37 +24639,10 @@ var init_equation_bridge = __esm({
24739
24639
  }
24740
24640
  });
24741
24641
 
24742
- // ../../contracts/src/bridges/ink-recognition-bridge.ts
24743
- var DEFAULT_RECOGNITION_THRESHOLDS;
24744
- var init_ink_recognition_bridge = __esm({
24745
- "../../contracts/src/bridges/ink-recognition-bridge.ts"() {
24746
- "use strict";
24747
- init_cjs_shims();
24748
- DEFAULT_RECOGNITION_THRESHOLDS = {
24749
- line: 0.7,
24750
- rectangle: 0.65,
24751
- ellipse: 0.7,
24752
- triangle: 0.6,
24753
- arrow: 0.6,
24754
- star: 0.65,
24755
- text: 0.5
24756
- };
24757
- }
24758
- });
24759
-
24760
- // ../../contracts/src/bridges/index.ts
24761
- var init_bridges = __esm({
24762
- "../../contracts/src/bridges/index.ts"() {
24763
- "use strict";
24764
- init_cjs_shims();
24765
- init_ink_recognition_bridge();
24766
- }
24767
- });
24768
-
24769
24642
  // ../../kernel/src/domain/drawing/ink-recognition-bridge.ts
24770
24643
  function createInkRecognitionBridge(initialThresholds) {
24771
24644
  let thresholds = {
24772
- ...DEFAULT_RECOGNITION_THRESHOLDS,
24645
+ ...import_bridges.DEFAULT_RECOGNITION_THRESHOLDS,
24773
24646
  ...initialThresholds
24774
24647
  };
24775
24648
  return {
@@ -25182,11 +25055,12 @@ async function recognizeWithBrowserAPI(strokes) {
25182
25055
  }
25183
25056
  return null;
25184
25057
  }
25185
- var init_ink_recognition_bridge2 = __esm({
25058
+ var import_bridges;
25059
+ var init_ink_recognition_bridge = __esm({
25186
25060
  "../../kernel/src/domain/drawing/ink-recognition-bridge.ts"() {
25187
25061
  "use strict";
25188
25062
  init_cjs_shims();
25189
- init_bridges();
25063
+ import_bridges = require("@mog-sdk/spreadsheet-contracts/bridges");
25190
25064
  }
25191
25065
  });
25192
25066
 
@@ -25424,7 +25298,7 @@ var init_pivot_bridge = __esm({
25424
25298
  expandedColumns: {}
25425
25299
  };
25426
25300
  try {
25427
- const result = await this.ctx.computeBridge.pivotComputeFromSource(
25301
+ const result = await this.ctx.computeBridge.pivotMaterialize(
25428
25302
  sheetId,
25429
25303
  pivotId,
25430
25304
  expansionState ?? null
@@ -25628,7 +25502,7 @@ var init_pivot_bridge = __esm({
25628
25502
  const rowData = [];
25629
25503
  for (let col = range2.startCol; col <= range2.endCol; col++) {
25630
25504
  const cell = cellMap.get(`${row},${col}`);
25631
- rowData.push(cell ? viewportCellValueToCellValue(cell.value) ?? null : null);
25505
+ rowData.push(cell ? normalizeCellValue(cell.value) ?? null : null);
25632
25506
  }
25633
25507
  data.push(rowData);
25634
25508
  }
@@ -30199,7 +30073,7 @@ var init_arrows = __esm({
30199
30073
 
30200
30074
  // ../../canvas/drawing/shapes/src/presets/constants.ts
30201
30075
  var KAPPA;
30202
- var init_constants2 = __esm({
30076
+ var init_constants = __esm({
30203
30077
  "../../canvas/drawing/shapes/src/presets/constants.ts"() {
30204
30078
  "use strict";
30205
30079
  init_cjs_shims();
@@ -30223,7 +30097,7 @@ var init_primitives4 = __esm({
30223
30097
  "use strict";
30224
30098
  init_cjs_shims();
30225
30099
  init_src3();
30226
- init_constants2();
30100
+ init_constants();
30227
30101
  }
30228
30102
  });
30229
30103
 
@@ -30233,7 +30107,7 @@ var init_basic = __esm({
30233
30107
  "use strict";
30234
30108
  init_cjs_shims();
30235
30109
  init_src3();
30236
- init_constants2();
30110
+ init_constants();
30237
30111
  init_primitives4();
30238
30112
  init_registry3();
30239
30113
  init_primitives4();
@@ -70306,438 +70180,23 @@ var init_rules = __esm({
70306
70180
  }
70307
70181
  });
70308
70182
 
70309
- // ../../contracts/src/smartart/layouts.ts
70310
- var init_layouts2 = __esm({
70311
- "../../contracts/src/smartart/layouts.ts"() {
70312
- "use strict";
70313
- init_cjs_shims();
70314
- }
70315
- });
70316
-
70317
- // ../../contracts/src/smartart/ooxml-algorithm-types.ts
70318
- var ParameterId, VALID_PARAMS_BY_ALGORITHM;
70319
- var init_ooxml_algorithm_types = __esm({
70320
- "../../contracts/src/smartart/ooxml-algorithm-types.ts"() {
70321
- "use strict";
70322
- init_cjs_shims();
70323
- ParameterId = {
70324
- // ── Alignment Parameters ──────────────────────────────────────────────────
70325
- /** Horizontal alignment of children within the layout area. */
70326
- horzAlign: "horzAlign",
70327
- /** Vertical alignment of children within the layout area. */
70328
- vertAlign: "vertAlign",
70329
- /** Horizontal alignment for individual nodes (hierarchy algorithms). */
70330
- nodeHorzAlign: "nodeHorzAlign",
70331
- /** Vertical alignment for individual nodes (hierarchy algorithms). */
70332
- nodeVertAlign: "nodeVertAlign",
70333
- /** Hierarchy alignment (16 possible values for tree orientation). */
70334
- hierAlign: "hierAlign",
70335
- /** Text alignment (whether text should be aligned with shape). */
70336
- alignTx: "alignTx",
70337
- // ── Direction Parameters ──────────────────────────────────────────────────
70338
- /** Child direction (horizontal or vertical arrangement of children). */
70339
- chDir: "chDir",
70340
- /** Child alignment (how children align on the cross-axis). */
70341
- chAlign: "chAlign",
70342
- /** Secondary child alignment (for complex hierarchy layouts). */
70343
- secChAlign: "secChAlign",
70344
- /** Linear direction (which edge children flow from). */
70345
- linDir: "linDir",
70346
- /** Secondary linear direction (for complex hierarchy layouts). */
70347
- secLinDir: "secLinDir",
70348
- /** Text direction (horizontal or vertical text blocks). */
70349
- txDir: "txDir",
70350
- /** Text block direction (horizontal or vertical text flow). */
70351
- txBlDir: "txBlDir",
70352
- /** Growth direction (which corner the snake starts from). */
70353
- grDir: "grDir",
70354
- /** Flow direction (whether snake flows by row or column). */
70355
- flowDir: "flowDir",
70356
- /** Continue direction (same direction or reversed for each row). */
70357
- contDir: "contDir",
70358
- // ── Connector Parameters ──────────────────────────────────────────────────
70359
- /** Connector routing style (straight, bend, curve, long curve). */
70360
- connRout: "connRout",
70361
- /** Beginning/start arrowhead style for connectors. */
70362
- begSty: "begSty",
70363
- /** Ending arrowhead style for connectors. */
70364
- endSty: "endSty",
70365
- /** Connector dimension (1D, 2D, or custom). */
70366
- dim: "dim",
70367
- /** Source node name for connector routing. */
70368
- srcNode: "srcNode",
70369
- /** Destination node name for connector routing. */
70370
- dstNode: "dstNode",
70371
- /** Beginning connection points (which points on the source shape). */
70372
- begPts: "begPts",
70373
- /** Ending connection points (which points on the destination shape). */
70374
- endPts: "endPts",
70375
- /** Bend point position for right-angle connectors. */
70376
- bendPt: "bendPt",
70377
- // ── Cycle/Circular Parameters ─────────────────────────────────────────────
70378
- /** Start angle in degrees for cycle algorithm. */
70379
- stAng: "stAng",
70380
- /** Span angle in degrees for cycle algorithm. */
70381
- spanAng: "spanAng",
70382
- /** Rotation path (none or along the circular path). */
70383
- rotPath: "rotPath",
70384
- /** Center shape mapping (whether first node goes to center). */
70385
- ctrShpMap: "ctrShpMap",
70386
- // ── Snake Parameters ──────────────────────────────────────────────────────
70387
- /** Breakpoint logic for snake wrapping (end of canvas, balanced, fixed). */
70388
- bkpt: "bkpt",
70389
- /** Breakpoint fixed value (number of items per row when bkpt=fixed). */
70390
- bkPtFixedVal: "bkPtFixedVal",
70391
- /** Offset mode for staggered rows in snake layout. */
70392
- off: "off",
70393
- // ── Linear/Sequence Parameters ────────────────────────────────────────────
70394
- /** Starting element index (which node type starts the alternating sequence). */
70395
- stElem: "stElem",
70396
- /** Starting bullet level for text algorithm. */
70397
- stBulletLvl: "stBulletLvl",
70398
- // ── Pyramid Parameters ────────────────────────────────────────────────────
70399
- /** Pyramid accent position (before or after the level). */
70400
- pyraAcctPos: "pyraAcctPos",
70401
- /** Pyramid accent text margin (step or stack behavior). */
70402
- pyraAcctTxMar: "pyraAcctTxMar",
70403
- /** Pyramid level node name. */
70404
- pyraLvlNode: "pyraLvlNode",
70405
- /** Pyramid accent background node name. */
70406
- pyraAcctBkgdNode: "pyraAcctBkgdNode",
70407
- /** Pyramid accent text node name. */
70408
- pyraAcctTxNode: "pyraAcctTxNode",
70409
- // ── Text Parameters ───────────────────────────────────────────────────────
70410
- /** Parent text LTR alignment. */
70411
- parTxLTRAlign: "parTxLTRAlign",
70412
- /** Parent text RTL alignment. */
70413
- parTxRTLAlign: "parTxRTLAlign",
70414
- /** Shape text LTR alignment for children. */
70415
- shpTxLTRAlignCh: "shpTxLTRAlignCh",
70416
- /** Shape text RTL alignment for children. */
70417
- shpTxRTLAlignCh: "shpTxRTLAlignCh",
70418
- /** Text anchor horizontal position. */
70419
- txAnchorHorz: "txAnchorHorz",
70420
- /** Text anchor vertical position. */
70421
- txAnchorVert: "txAnchorVert",
70422
- /** Text anchor horizontal position for children. */
70423
- txAnchorHorzCh: "txAnchorHorzCh",
70424
- /** Text anchor vertical position for children. */
70425
- txAnchorVertCh: "txAnchorVertCh",
70426
- /** Auto text rotation mode (none, upright, gravity-based). */
70427
- autoTxRot: "autoTxRot",
70428
- // ── Spacing & Sizing Parameters ───────────────────────────────────────────
70429
- /** Aspect ratio value. */
70430
- ar: "ar",
70431
- /** Line spacing for parent text (percentage). */
70432
- lnSpPar: "lnSpPar",
70433
- /** Line spacing after parent paragraph (percentage). */
70434
- lnSpAfParP: "lnSpAfParP",
70435
- /** Line spacing for child text (percentage). */
70436
- lnSpCh: "lnSpCh",
70437
- /** Line spacing after child paragraph (percentage). */
70438
- lnSpAfChP: "lnSpAfChP",
70439
- // ── Hierarchy-Specific Parameters ─────────────────────────────────────────
70440
- /** Root short distance flag (hierarchy algorithms). */
70441
- rtShortDist: "rtShortDist",
70442
- // ── Fallback Parameter ────────────────────────────────────────────────────
70443
- /** Fallback dimension for the algorithm. */
70444
- fallback: "fallback"
70445
- };
70446
- VALID_PARAMS_BY_ALGORITHM = {
70447
- composite: [ParameterId.ar],
70448
- lin: [
70449
- ParameterId.linDir,
70450
- ParameterId.chDir,
70451
- ParameterId.chAlign,
70452
- ParameterId.horzAlign,
70453
- ParameterId.vertAlign,
70454
- ParameterId.stElem,
70455
- ParameterId.fallback,
70456
- ParameterId.nodeHorzAlign,
70457
- ParameterId.nodeVertAlign
70458
- ],
70459
- snake: [
70460
- ParameterId.grDir,
70461
- ParameterId.flowDir,
70462
- ParameterId.contDir,
70463
- ParameterId.bkpt,
70464
- ParameterId.bkPtFixedVal,
70465
- ParameterId.off
70466
- ],
70467
- cycle: [ParameterId.stAng, ParameterId.spanAng, ParameterId.rotPath, ParameterId.ctrShpMap],
70468
- hierRoot: [
70469
- ParameterId.hierAlign,
70470
- ParameterId.nodeHorzAlign,
70471
- ParameterId.nodeVertAlign,
70472
- ParameterId.rtShortDist
70473
- ],
70474
- hierChild: [
70475
- ParameterId.chAlign,
70476
- ParameterId.linDir,
70477
- ParameterId.secChAlign,
70478
- ParameterId.secLinDir
70479
- ],
70480
- pyra: [
70481
- ParameterId.linDir,
70482
- ParameterId.txDir,
70483
- ParameterId.pyraAcctPos,
70484
- ParameterId.pyraAcctTxMar,
70485
- ParameterId.pyraLvlNode,
70486
- ParameterId.pyraAcctBkgdNode,
70487
- ParameterId.pyraAcctTxNode
70488
- ],
70489
- conn: [
70490
- ParameterId.srcNode,
70491
- ParameterId.dstNode,
70492
- ParameterId.connRout,
70493
- ParameterId.begSty,
70494
- ParameterId.endSty,
70495
- ParameterId.dim,
70496
- ParameterId.bendPt,
70497
- ParameterId.begPts,
70498
- ParameterId.endPts
70499
- ],
70500
- tx: [
70501
- ParameterId.parTxLTRAlign,
70502
- ParameterId.parTxRTLAlign,
70503
- ParameterId.shpTxLTRAlignCh,
70504
- ParameterId.shpTxRTLAlignCh,
70505
- ParameterId.txAnchorVert,
70506
- ParameterId.txAnchorHorz,
70507
- ParameterId.txAnchorVertCh,
70508
- ParameterId.txAnchorHorzCh,
70509
- ParameterId.txBlDir,
70510
- ParameterId.autoTxRot,
70511
- ParameterId.stBulletLvl,
70512
- ParameterId.lnSpPar,
70513
- ParameterId.lnSpAfParP,
70514
- ParameterId.lnSpCh,
70515
- ParameterId.lnSpAfChP,
70516
- ParameterId.alignTx
70517
- ],
70518
- sp: []
70519
- };
70520
- }
70521
- });
70522
-
70523
- // ../../contracts/src/smartart/ooxml-data-model-types.ts
70524
- var init_ooxml_data_model_types = __esm({
70525
- "../../contracts/src/smartart/ooxml-data-model-types.ts"() {
70526
- "use strict";
70527
- init_cjs_shims();
70528
- }
70529
- });
70530
-
70531
- // ../../contracts/src/smartart/ooxml-drawing-types.ts
70532
- var init_ooxml_drawing_types = __esm({
70533
- "../../contracts/src/smartart/ooxml-drawing-types.ts"() {
70534
- "use strict";
70535
- init_cjs_shims();
70536
- }
70537
- });
70538
-
70539
- // ../../contracts/src/smartart/ooxml-engine-types.ts
70540
- var POSITIONAL_CONSTRAINT_TYPES, DIMENSIONAL_CONSTRAINT_TYPES, MARGIN_CONSTRAINT_TYPES, FONT_CONSTRAINT_TYPES, SPACING_CONSTRAINT_TYPES, GEOMETRY_CONSTRAINT_TYPES, USER_DEFINED_CONSTRAINT_TYPES, ALL_CONSTRAINT_TYPES, ALL_ELEMENT_TYPES, ALL_FUNCTION_TYPES, ALL_FUNCTION_OPERATORS, ALL_FUNCTION_ARGUMENTS;
70541
- var init_ooxml_engine_types = __esm({
70542
- "../../contracts/src/smartart/ooxml-engine-types.ts"() {
70543
- "use strict";
70544
- init_cjs_shims();
70545
- POSITIONAL_CONSTRAINT_TYPES = [
70546
- "l",
70547
- "t",
70548
- "r",
70549
- "b",
70550
- "lOff",
70551
- "tOff",
70552
- "rOff",
70553
- "bOff",
70554
- "ctrX",
70555
- "ctrY",
70556
- "ctrXOff",
70557
- "ctrYOff"
70558
- ];
70559
- DIMENSIONAL_CONSTRAINT_TYPES = [
70560
- "w",
70561
- "h",
70562
- "wOff",
70563
- "hOff"
70564
- ];
70565
- MARGIN_CONSTRAINT_TYPES = [
70566
- "lMarg",
70567
- "tMarg",
70568
- "rMarg",
70569
- "bMarg",
70570
- "begMarg",
70571
- "endMarg"
70572
- ];
70573
- FONT_CONSTRAINT_TYPES = [
70574
- "primFontSz",
70575
- "secFontSz"
70576
- ];
70577
- SPACING_CONSTRAINT_TYPES = [
70578
- "sp",
70579
- "sibSp",
70580
- "secSibSp"
70581
- ];
70582
- GEOMETRY_CONSTRAINT_TYPES = [
70583
- "connDist",
70584
- "diam",
70585
- "stemThick",
70586
- "begPad",
70587
- "endPad",
70588
- "wArH",
70589
- "hArH",
70590
- "bendDist"
70591
- ];
70592
- USER_DEFINED_CONSTRAINT_TYPES = [
70593
- "userA",
70594
- "userB",
70595
- "userC",
70596
- "userD",
70597
- "userE",
70598
- "userF",
70599
- "userG",
70600
- "userH",
70601
- "userI",
70602
- "userJ",
70603
- "userK",
70604
- "userL",
70605
- "userM",
70606
- "userN",
70607
- "userO",
70608
- "userP",
70609
- "userQ",
70610
- "userR",
70611
- "userS",
70612
- "userT",
70613
- "userU",
70614
- "userV",
70615
- "userW",
70616
- "userX",
70617
- "userY",
70618
- "userZ"
70619
- ];
70620
- ALL_CONSTRAINT_TYPES = [
70621
- ...POSITIONAL_CONSTRAINT_TYPES,
70622
- ...DIMENSIONAL_CONSTRAINT_TYPES,
70623
- ...MARGIN_CONSTRAINT_TYPES,
70624
- ...FONT_CONSTRAINT_TYPES,
70625
- ...SPACING_CONSTRAINT_TYPES,
70626
- ...GEOMETRY_CONSTRAINT_TYPES,
70627
- "pyraAcctRatio",
70628
- "alignOff",
70629
- ...USER_DEFINED_CONSTRAINT_TYPES,
70630
- "none"
70631
- ];
70632
- ALL_ELEMENT_TYPES = [
70633
- "all",
70634
- "doc",
70635
- "node",
70636
- "norm",
70637
- "nonNorm",
70638
- "asst",
70639
- "nonAsst",
70640
- "parTrans",
70641
- "pres",
70642
- "sibTrans"
70643
- ];
70644
- ALL_FUNCTION_TYPES = [
70645
- "cnt",
70646
- "pos",
70647
- "revPos",
70648
- "posEven",
70649
- "posOdd",
70650
- "var",
70651
- "depth",
70652
- "maxDepth"
70653
- ];
70654
- ALL_FUNCTION_OPERATORS = [
70655
- "equ",
70656
- "neq",
70657
- "gt",
70658
- "lt",
70659
- "gte",
70660
- "lte"
70661
- ];
70662
- ALL_FUNCTION_ARGUMENTS = [
70663
- "none",
70664
- "orgChart",
70665
- "chMax",
70666
- "chPref",
70667
- "bulEnabled",
70668
- "dir",
70669
- "hierBranch",
70670
- "animOne",
70671
- "animLvl",
70672
- "resizeHandles"
70673
- ];
70674
- }
70675
- });
70676
-
70677
- // ../../contracts/src/smartart/ooxml-layout-types.ts
70678
- var init_ooxml_layout_types = __esm({
70679
- "../../contracts/src/smartart/ooxml-layout-types.ts"() {
70680
- "use strict";
70681
- init_cjs_shims();
70682
- }
70683
- });
70684
-
70685
- // ../../contracts/src/smartart/ooxml-style-types.ts
70686
- var init_ooxml_style_types = __esm({
70687
- "../../contracts/src/smartart/ooxml-style-types.ts"() {
70688
- "use strict";
70689
- init_cjs_shims();
70690
- }
70691
- });
70692
-
70693
- // ../../contracts/src/smartart/styles.ts
70694
- var init_styles3 = __esm({
70695
- "../../contracts/src/smartart/styles.ts"() {
70696
- "use strict";
70697
- init_cjs_shims();
70698
- }
70699
- });
70700
-
70701
- // ../../contracts/src/smartart/types.ts
70702
- var init_types4 = __esm({
70703
- "../../contracts/src/smartart/types.ts"() {
70704
- "use strict";
70705
- init_cjs_shims();
70706
- }
70707
- });
70708
-
70709
- // ../../contracts/src/smartart/index.ts
70710
- var init_smartart = __esm({
70711
- "../../contracts/src/smartart/index.ts"() {
70712
- "use strict";
70713
- init_cjs_shims();
70714
- init_layouts2();
70715
- init_ooxml_algorithm_types();
70716
- init_ooxml_data_model_types();
70717
- init_ooxml_drawing_types();
70718
- init_ooxml_engine_types();
70719
- init_ooxml_layout_types();
70720
- init_ooxml_style_types();
70721
- init_styles3();
70722
- init_types4();
70723
- }
70724
- });
70725
-
70726
70183
  // ../../canvas/drawing/smartart/src/engine/algorithms/composite.ts
70184
+ var import_smartart2;
70727
70185
  var init_composite = __esm({
70728
70186
  "../../canvas/drawing/smartart/src/engine/algorithms/composite.ts"() {
70729
70187
  "use strict";
70730
70188
  init_cjs_shims();
70731
- init_smartart();
70189
+ import_smartart2 = require("@mog-sdk/spreadsheet-contracts/smartart");
70732
70190
  }
70733
70191
  });
70734
70192
 
70735
70193
  // ../../canvas/drawing/smartart/src/engine/algorithms/linear.ts
70194
+ var import_smartart3;
70736
70195
  var init_linear2 = __esm({
70737
70196
  "../../canvas/drawing/smartart/src/engine/algorithms/linear.ts"() {
70738
70197
  "use strict";
70739
70198
  init_cjs_shims();
70740
- init_smartart();
70199
+ import_smartart3 = require("@mog-sdk/spreadsheet-contracts/smartart");
70741
70200
  }
70742
70201
  });
70743
70202
 
@@ -70750,82 +70209,90 @@ var init_param_utils = __esm({
70750
70209
  });
70751
70210
 
70752
70211
  // ../../canvas/drawing/smartart/src/engine/algorithms/snake.ts
70212
+ var import_smartart4;
70753
70213
  var init_snake = __esm({
70754
70214
  "../../canvas/drawing/smartart/src/engine/algorithms/snake.ts"() {
70755
70215
  "use strict";
70756
70216
  init_cjs_shims();
70757
- init_smartart();
70217
+ import_smartart4 = require("@mog-sdk/spreadsheet-contracts/smartart");
70758
70218
  init_param_utils();
70759
70219
  }
70760
70220
  });
70761
70221
 
70762
70222
  // ../../canvas/drawing/smartart/src/engine/algorithms/cycle.ts
70223
+ var import_smartart5;
70763
70224
  var init_cycle2 = __esm({
70764
70225
  "../../canvas/drawing/smartart/src/engine/algorithms/cycle.ts"() {
70765
70226
  "use strict";
70766
70227
  init_cjs_shims();
70767
- init_smartart();
70228
+ import_smartart5 = require("@mog-sdk/spreadsheet-contracts/smartart");
70768
70229
  init_param_utils();
70769
70230
  }
70770
70231
  });
70771
70232
 
70772
70233
  // ../../canvas/drawing/smartart/src/engine/algorithms/hier-root.ts
70234
+ var import_smartart6;
70773
70235
  var init_hier_root = __esm({
70774
70236
  "../../canvas/drawing/smartart/src/engine/algorithms/hier-root.ts"() {
70775
70237
  "use strict";
70776
70238
  init_cjs_shims();
70777
- init_smartart();
70239
+ import_smartart6 = require("@mog-sdk/spreadsheet-contracts/smartart");
70778
70240
  init_param_utils();
70779
70241
  }
70780
70242
  });
70781
70243
 
70782
70244
  // ../../canvas/drawing/smartart/src/engine/algorithms/hier-child.ts
70245
+ var import_smartart7;
70783
70246
  var init_hier_child = __esm({
70784
70247
  "../../canvas/drawing/smartart/src/engine/algorithms/hier-child.ts"() {
70785
70248
  "use strict";
70786
70249
  init_cjs_shims();
70787
- init_smartart();
70250
+ import_smartart7 = require("@mog-sdk/spreadsheet-contracts/smartart");
70788
70251
  init_param_utils();
70789
70252
  }
70790
70253
  });
70791
70254
 
70792
70255
  // ../../canvas/drawing/smartart/src/engine/algorithms/pyramid.ts
70256
+ var import_smartart8;
70793
70257
  var init_pyramid2 = __esm({
70794
70258
  "../../canvas/drawing/smartart/src/engine/algorithms/pyramid.ts"() {
70795
70259
  "use strict";
70796
70260
  init_cjs_shims();
70797
- init_smartart();
70261
+ import_smartart8 = require("@mog-sdk/spreadsheet-contracts/smartart");
70798
70262
  init_param_utils();
70799
70263
  }
70800
70264
  });
70801
70265
 
70802
70266
  // ../../canvas/drawing/smartart/src/engine/algorithms/connector.ts
70267
+ var import_smartart9;
70803
70268
  var init_connector = __esm({
70804
70269
  "../../canvas/drawing/smartart/src/engine/algorithms/connector.ts"() {
70805
70270
  "use strict";
70806
70271
  init_cjs_shims();
70807
- init_smartart();
70272
+ import_smartart9 = require("@mog-sdk/spreadsheet-contracts/smartart");
70808
70273
  init_connector_routing();
70809
70274
  init_param_utils();
70810
70275
  }
70811
70276
  });
70812
70277
 
70813
70278
  // ../../canvas/drawing/smartart/src/engine/algorithms/text.ts
70279
+ var import_smartart10;
70814
70280
  var init_text3 = __esm({
70815
70281
  "../../canvas/drawing/smartart/src/engine/algorithms/text.ts"() {
70816
70282
  "use strict";
70817
70283
  init_cjs_shims();
70818
- init_smartart();
70284
+ import_smartart10 = require("@mog-sdk/spreadsheet-contracts/smartart");
70819
70285
  init_param_utils();
70820
70286
  }
70821
70287
  });
70822
70288
 
70823
70289
  // ../../canvas/drawing/smartart/src/engine/algorithms/space.ts
70290
+ var import_smartart11;
70824
70291
  var init_space = __esm({
70825
70292
  "../../canvas/drawing/smartart/src/engine/algorithms/space.ts"() {
70826
70293
  "use strict";
70827
70294
  init_cjs_shims();
70828
- init_smartart();
70295
+ import_smartart11 = require("@mog-sdk/spreadsheet-contracts/smartart");
70829
70296
  }
70830
70297
  });
70831
70298
 
@@ -70984,19 +70451,19 @@ var init_drawing_parser = __esm({
70984
70451
  });
70985
70452
 
70986
70453
  // ../../canvas/drawing/smartart/src/parser/layout-def-parser.ts
70987
- var VALID_ELEMENT_TYPES, VALID_FUNCTION_TYPES, VALID_FUNCTION_OPERATORS, VALID_FUNCTION_ARGUMENTS;
70454
+ var import_smartart12, VALID_ELEMENT_TYPES, VALID_FUNCTION_TYPES, VALID_FUNCTION_OPERATORS, VALID_FUNCTION_ARGUMENTS;
70988
70455
  var init_layout_def_parser = __esm({
70989
70456
  "../../canvas/drawing/smartart/src/parser/layout-def-parser.ts"() {
70990
70457
  "use strict";
70991
70458
  init_cjs_shims();
70992
- init_smartart();
70459
+ import_smartart12 = require("@mog-sdk/spreadsheet-contracts/smartart");
70993
70460
  init_data_model_parser();
70994
70461
  init_drawingml_helpers();
70995
70462
  init_xml_helpers();
70996
- VALID_ELEMENT_TYPES = new Set(ALL_ELEMENT_TYPES);
70997
- VALID_FUNCTION_TYPES = new Set(ALL_FUNCTION_TYPES);
70998
- VALID_FUNCTION_OPERATORS = new Set(ALL_FUNCTION_OPERATORS);
70999
- VALID_FUNCTION_ARGUMENTS = new Set(ALL_FUNCTION_ARGUMENTS);
70463
+ VALID_ELEMENT_TYPES = new Set(import_smartart12.ALL_ELEMENT_TYPES);
70464
+ VALID_FUNCTION_TYPES = new Set(import_smartart12.ALL_FUNCTION_TYPES);
70465
+ VALID_FUNCTION_OPERATORS = new Set(import_smartart12.ALL_FUNCTION_OPERATORS);
70466
+ VALID_FUNCTION_ARGUMENTS = new Set(import_smartart12.ALL_FUNCTION_ARGUMENTS);
71000
70467
  }
71001
70468
  });
71002
70469
 
@@ -74891,7 +74358,7 @@ var init_cell_anchor_resolver = __esm({
74891
74358
  });
74892
74359
 
74893
74360
  // ../../kernel/src/floating-objects/types.ts
74894
- var init_types5 = __esm({
74361
+ var init_types4 = __esm({
74895
74362
  "../../kernel/src/floating-objects/types.ts"() {
74896
74363
  "use strict";
74897
74364
  init_cjs_shims();
@@ -74990,7 +74457,7 @@ var init_picture_manager = __esm({
74990
74457
  "use strict";
74991
74458
  init_cjs_shims();
74992
74459
  init_document();
74993
- init_types5();
74460
+ init_types4();
74994
74461
  }
74995
74462
  });
74996
74463
 
@@ -75092,7 +74559,7 @@ var init_textbox_manager = __esm({
75092
74559
  "../../kernel/src/floating-objects/managers/textbox-manager.ts"() {
75093
74560
  "use strict";
75094
74561
  init_cjs_shims();
75095
- init_types5();
74562
+ init_types4();
75096
74563
  DEFAULT_TEXTBOX_FILL = { type: "solid", color: "#ffffff" };
75097
74564
  DEFAULT_TEXTBOX_BORDER = { style: "solid", color: "#000000", width: 1 };
75098
74565
  }
@@ -76273,7 +75740,7 @@ var init_kernel_context = __esm({
76273
75740
  init_cjs_shims();
76274
75741
  init_chart_bridge();
76275
75742
  init_equation_bridge();
76276
- init_ink_recognition_bridge2();
75743
+ init_ink_recognition_bridge();
76277
75744
  init_locale_bridge();
76278
75745
  init_pivot_bridge();
76279
75746
  init_schema_bridge();
@@ -77295,20 +76762,7 @@ var WorkbookHistoryImpl = class {
77295
76762
 
77296
76763
  // ../../kernel/src/api/workbook/names.ts
77297
76764
  init_cjs_shims();
77298
-
77299
- // ../../contracts/src/api/index.ts
77300
- init_cjs_shims();
77301
-
77302
- // ../../contracts/src/api/types.ts
77303
- init_cjs_shims();
77304
-
77305
- // ../../contracts/src/api/worksheet/index.ts
77306
- init_cjs_shims();
77307
-
77308
- // ../../contracts/src/api/worksheet/format-mappings.ts
77309
- init_cjs_shims();
77310
-
77311
- // ../../kernel/src/api/workbook/names.ts
76765
+ var import_api = require("@mog-sdk/spreadsheet-contracts/api");
77312
76766
  init_errors();
77313
76767
 
77314
76768
  // ../../kernel/src/domain/formulas/named-ranges.ts
@@ -77931,13 +77385,13 @@ var WorkbookNamesImpl = class {
77931
77385
  if (!values) return null;
77932
77386
  return values.map(
77933
77387
  (row) => row.map((cell) => {
77934
- if (cell === null || cell === void 0) return "Empty" /* Empty */;
77935
- if (typeof cell === "boolean") return "Boolean" /* Boolean */;
77936
- if (typeof cell === "number") return "Double" /* Double */;
77937
- if (typeof cell === "string") return "String" /* String */;
77388
+ if (cell === null || cell === void 0) return import_api.RangeValueType.Empty;
77389
+ if (typeof cell === "boolean") return import_api.RangeValueType.Boolean;
77390
+ if (typeof cell === "number") return import_api.RangeValueType.Double;
77391
+ if (typeof cell === "string") return import_api.RangeValueType.String;
77938
77392
  if (typeof cell === "object" && cell !== null && "type" in cell)
77939
- return "Error" /* Error */;
77940
- return "String" /* String */;
77393
+ return import_api.RangeValueType.Error;
77394
+ return import_api.RangeValueType.String;
77941
77395
  })
77942
77396
  );
77943
77397
  }
@@ -78029,7 +77483,7 @@ var BUILT_IN_LISTS = [
78029
77483
  ];
78030
77484
 
78031
77485
  // ../../kernel/src/domain/workbook/workbook.ts
78032
- init_protection();
77486
+ var import_protection2 = require("@mog-sdk/spreadsheet-contracts/protection");
78033
77487
 
78034
77488
  // ../../spreadsheet-utils/src/protection.ts
78035
77489
  init_cjs_shims();
@@ -78069,7 +77523,7 @@ async function setSelectedSheetIds(ctx, sheetIds, _origin = "user") {
78069
77523
  }
78070
77524
  async function protect(ctx, password, options, _origin = "user") {
78071
77525
  const fullOptions = {
78072
- ...DEFAULT_WORKBOOK_PROTECTION_OPTIONS,
77526
+ ...import_protection2.DEFAULT_WORKBOOK_PROTECTION_OPTIONS,
78073
77527
  ...options
78074
77528
  };
78075
77529
  const current = await getSettings(ctx);
@@ -78485,7 +77939,7 @@ init_sheet_meta();
78485
77939
 
78486
77940
  // ../../kernel/src/api/worksheet/worksheet-impl.ts
78487
77941
  init_cjs_shims();
78488
- init_core3();
77942
+ var import_core6 = require("@mog-sdk/spreadsheet-contracts/core");
78489
77943
  init_errors3();
78490
77944
  init_errors();
78491
77945
 
@@ -79398,9 +78852,13 @@ async function setCells(ctx, sheetId, cells) {
79398
78852
  const result = { cellsWritten: uniqueEdits.length, errors: null };
79399
78853
  if (duplicatesRemoved > 0) {
79400
78854
  result.warnings = [
79401
- createWarning("API_DUPLICATE_COORDINATES", `${duplicatesRemoved} duplicate coordinate(s) resolved by last-write-wins`, {
79402
- duplicatesRemoved
79403
- })
78855
+ createWarning(
78856
+ "API_DUPLICATE_COORDINATES",
78857
+ `${duplicatesRemoved} duplicate coordinate(s) resolved by last-write-wins`,
78858
+ {
78859
+ duplicatesRemoved
78860
+ }
78861
+ )
79404
78862
  ];
79405
78863
  }
79406
78864
  return result;
@@ -79501,22 +78959,18 @@ async function batchGetCellPositions(ctx, sheetId, cellIds) {
79501
78959
 
79502
78960
  // ../../kernel/src/api/worksheet/operations/dependency-operations.ts
79503
78961
  init_cjs_shims();
79504
- function colToLetter4(col) {
79505
- let result = "";
79506
- let c = col;
79507
- while (c >= 0) {
79508
- result = String.fromCharCode(c % 26 + 65) + result;
79509
- c = Math.floor(c / 26) - 1;
79510
- }
79511
- return result;
79512
- }
78962
+ init_a1();
79513
78963
  async function getDependents(ctx, sheetId, row, col) {
79514
78964
  const results = await ctx.computeBridge.getDependents(sheetId, row, col);
79515
- return results.map((r) => `${colToLetter4(r.col)}${r.row + 1}`);
78965
+ return results.map(
78966
+ (r) => r.sheetId === sheetId ? toA12(r.row, r.col) : toSheetA1(r.row, r.col, r.sheetName)
78967
+ );
79516
78968
  }
79517
78969
  async function getPrecedents(ctx, sheetId, row, col) {
79518
78970
  const results = await ctx.computeBridge.getPrecedents(sheetId, row, col);
79519
- return results.map((r) => `${colToLetter4(r.col)}${r.row + 1}`);
78971
+ return results.map(
78972
+ (r) => r.sheetId === sheetId ? toA12(r.row, r.col) : toSheetA1(r.row, r.col, r.sheetName)
78973
+ );
79520
78974
  }
79521
78975
 
79522
78976
  // ../../kernel/src/api/worksheet/operations/fill-operations.ts
@@ -79837,7 +79291,7 @@ async function findCells(ctx, sheetId, predicate) {
79837
79291
  const results = [];
79838
79292
  for (const cell of rangeResult.cells) {
79839
79293
  const cellData = {
79840
- value: viewportCellValueToCellValue(cell.value),
79294
+ value: normalizeCellValue(cell.value),
79841
79295
  formula: cell.formula
79842
79296
  };
79843
79297
  if (predicate(cellData, cell.row, cell.col)) {
@@ -79890,18 +79344,18 @@ async function regexSearch(ctx, sheetId, patterns, options) {
79890
79344
  bounds.maxCol
79891
79345
  );
79892
79346
  for (const cell of rangeResult.cells) {
79893
- const valueStr = cell.formatted ?? viewportCellValueToString(cell.value);
79347
+ const valueStr = cell.formatted ?? cellValueToString(cell.value);
79894
79348
  for (const { regex, source } of compiledPatterns) {
79895
79349
  regex.lastIndex = 0;
79896
79350
  if (regex.test(valueStr)) {
79897
- const address = `${colToLetter3(cell.col)}${cell.row + 1}`;
79351
+ const address = toA12(cell.row, cell.col);
79898
79352
  results.push({ address, value: valueStr, sheetName, matchedPattern: source });
79899
79353
  break;
79900
79354
  }
79901
79355
  if (options?.includeFormulas && cell.formula) {
79902
79356
  regex.lastIndex = 0;
79903
79357
  if (regex.test(cell.formula)) {
79904
- const address = `${colToLetter3(cell.col)}${cell.row + 1}`;
79358
+ const address = toA12(cell.row, cell.col);
79905
79359
  results.push({ address, value: valueStr, sheetName, matchedPattern: source });
79906
79360
  break;
79907
79361
  }
@@ -79934,9 +79388,9 @@ async function getRangeWithIdentity(ctx, sheetId, startRow, startCol, endRow, en
79934
79388
  cellId: cell.cellId,
79935
79389
  row: cell.row,
79936
79390
  col: cell.col,
79937
- value: viewportCellValueToCellValue(cell.value),
79391
+ value: normalizeCellValue(cell.value),
79938
79392
  formulaText: cell.formula,
79939
- displayString: cell.formatted ?? viewportCellValueToString(cell.value)
79393
+ displayString: cell.formatted ?? cellValueToString(cell.value)
79940
79394
  }));
79941
79395
  }
79942
79396
 
@@ -79965,7 +79419,7 @@ async function getRange(ctx, sheetId, range2) {
79965
79419
  if (!cell) {
79966
79420
  rowData.push({ value: null });
79967
79421
  } else {
79968
- const value = viewportCellValueToCellValue(cell.value);
79422
+ const value = normalizeCellValue(cell.value);
79969
79423
  rowData.push({
79970
79424
  value: value ?? null,
79971
79425
  formula: cell.formula,
@@ -80068,6 +79522,7 @@ async function clearRange2(ctx, sheetId, range2) {
80068
79522
 
80069
79523
  // ../../kernel/src/api/worksheet/operations/range-query-operations.ts
80070
79524
  init_cjs_shims();
79525
+ var import_api3 = require("@mog-sdk/spreadsheet-contracts/api");
80071
79526
  init_a1();
80072
79527
  init_value_conversions();
80073
79528
  async function clearWithMode(ctx, sheetId, range2, applyTo = "all") {
@@ -80143,7 +79598,7 @@ async function getDisplayText(ctx, sheetId, range2) {
80143
79598
  if (!cell) {
80144
79599
  rowData.push("");
80145
79600
  } else {
80146
- rowData.push(cell.formatted ?? viewportCellValueToString(cell.value));
79601
+ rowData.push(cell.formatted ?? cellValueToString(cell.value));
80147
79602
  }
80148
79603
  }
80149
79604
  result.push(rowData);
@@ -80169,9 +79624,9 @@ async function getValueTypes(ctx, sheetId, range2) {
80169
79624
  for (let col = n.startCol; col <= n.endCol; col++) {
80170
79625
  const cell = cellMap.get(`${row},${col}`);
80171
79626
  if (!cell) {
80172
- rowData.push("Empty" /* Empty */);
79627
+ rowData.push(import_api3.RangeValueType.Empty);
80173
79628
  } else {
80174
- rowData.push(classifyValueType(viewportCellValueToCellValue(cell.value)));
79629
+ rowData.push(classifyValueType(normalizeCellValue(cell.value)));
80175
79630
  }
80176
79631
  }
80177
79632
  result.push(rowData);
@@ -80179,12 +79634,16 @@ async function getValueTypes(ctx, sheetId, range2) {
80179
79634
  return result;
80180
79635
  }
80181
79636
  function classifyValueType(value) {
80182
- if (value === null || value === void 0) return "Empty" /* Empty */;
80183
- if (typeof value === "string") return value === "" ? "Empty" /* Empty */ : "String" /* String */;
80184
- if (typeof value === "number") return "Double" /* Double */;
80185
- if (typeof value === "boolean") return "Boolean" /* Boolean */;
80186
- if (typeof value === "object" && value !== null && "type" in value) return "Error" /* Error */;
80187
- return "String" /* String */;
79637
+ if (value === null || value === void 0) return import_api3.RangeValueType.Empty;
79638
+ if (typeof value === "string") {
79639
+ if (value === "") return import_api3.RangeValueType.Empty;
79640
+ if (value.startsWith("#")) return import_api3.RangeValueType.Error;
79641
+ return import_api3.RangeValueType.String;
79642
+ }
79643
+ if (typeof value === "number") return import_api3.RangeValueType.Double;
79644
+ if (typeof value === "boolean") return import_api3.RangeValueType.Boolean;
79645
+ if (typeof value === "object" && value !== null && "type" in value) return import_api3.RangeValueType.Error;
79646
+ return import_api3.RangeValueType.String;
80188
79647
  }
80189
79648
  async function findInRange(ctx, sheetId, range2, text, options) {
80190
79649
  const n = normalizeRange(range2);
@@ -80206,7 +79665,7 @@ async function findInRange(ctx, sheetId, range2, text, options) {
80206
79665
  n.endCol
80207
79666
  );
80208
79667
  for (const cell of rangeResult.cells) {
80209
- const valueStr = cell.formatted ?? viewportCellValueToString(cell.value);
79668
+ const valueStr = cell.formatted ?? cellValueToString(cell.value);
80210
79669
  if (pattern.test(valueStr)) {
80211
79670
  return {
80212
79671
  address: `${colToLetter3(cell.col)}${cell.row + 1}`,
@@ -80238,7 +79697,7 @@ async function replaceAll(ctx, sheetId, range2, text, replacement, options) {
80238
79697
  const edits = [];
80239
79698
  for (const cell of rangeResult.cells) {
80240
79699
  if (cell.formula) continue;
80241
- const valueStr = viewportCellValueToString(cell.value);
79700
+ const valueStr = cellValueToString(cell.value);
80242
79701
  if (!valueStr) continue;
80243
79702
  pattern.lastIndex = 0;
80244
79703
  if (pattern.test(valueStr)) {
@@ -80281,46 +79740,46 @@ async function getNumberFormatCategories(ctx, sheetId, range2) {
80281
79740
  }
80282
79741
  function detectFormatType(formatCode) {
80283
79742
  if (!formatCode || formatCode === "" || formatCode === "General") {
80284
- return "General" /* General */;
79743
+ return import_api3.NumberFormatCategory.General;
80285
79744
  }
80286
79745
  if (formatCode === "@") {
80287
- return "Text" /* Text */;
79746
+ return import_api3.NumberFormatCategory.Text;
80288
79747
  }
80289
79748
  const stripped = formatCode.replace(/\[[^\]]*\]/g, "").replace(/"[^"]*"/g, "");
80290
79749
  if (/[yYmMdD]/.test(stripped) && /[yYdD]/.test(stripped)) {
80291
- return "Date" /* Date */;
79750
+ return import_api3.NumberFormatCategory.Date;
80292
79751
  }
80293
79752
  if (/[hHsS]/.test(stripped)) {
80294
79753
  if (/[yYdD]/.test(stripped)) {
80295
- return "Date" /* Date */;
79754
+ return import_api3.NumberFormatCategory.Date;
80296
79755
  }
80297
- return "Time" /* Time */;
79756
+ return import_api3.NumberFormatCategory.Time;
80298
79757
  }
80299
79758
  if (/AM\/PM/i.test(stripped)) {
80300
- return "Time" /* Time */;
79759
+ return import_api3.NumberFormatCategory.Time;
80301
79760
  }
80302
79761
  if (stripped.includes("%")) {
80303
- return "Percentage" /* Percentage */;
79762
+ return import_api3.NumberFormatCategory.Percentage;
80304
79763
  }
80305
79764
  if (/[eE][+-]/.test(stripped)) {
80306
- return "Scientific" /* Scientific */;
79765
+ return import_api3.NumberFormatCategory.Scientific;
80307
79766
  }
80308
79767
  if (stripped.includes("/") && !/[yYmMdDhHsS]/.test(stripped)) {
80309
- return "Fraction" /* Fraction */;
79768
+ return import_api3.NumberFormatCategory.Fraction;
80310
79769
  }
80311
79770
  if (/[_*]/.test(stripped) && /[$(]/.test(stripped)) {
80312
- return "Accounting" /* Accounting */;
79771
+ return import_api3.NumberFormatCategory.Accounting;
80313
79772
  }
80314
79773
  if (/[$€£¥₹]/.test(formatCode)) {
80315
- return "Currency" /* Currency */;
79774
+ return import_api3.NumberFormatCategory.Currency;
80316
79775
  }
80317
79776
  if (/^0{5}/.test(stripped) || /^0{3}-0{2}-0{4}/.test(stripped)) {
80318
- return "Special" /* Special */;
79777
+ return import_api3.NumberFormatCategory.Special;
80319
79778
  }
80320
79779
  if (/[#0]/.test(stripped)) {
80321
- return "Number" /* Number */;
79780
+ return import_api3.NumberFormatCategory.Number;
80322
79781
  }
80323
- return "Custom" /* Custom */;
79782
+ return import_api3.NumberFormatCategory.Custom;
80324
79783
  }
80325
79784
 
80326
79785
  // ../../kernel/src/api/worksheet/operations/sort-operations.ts
@@ -80363,9 +79822,18 @@ init_cjs_shims();
80363
79822
  // ../../kernel/src/api/worksheet/collections/object-collection-impl.ts
80364
79823
  init_cjs_shims();
80365
79824
 
79825
+ // ../../kernel/src/api/worksheet/handles/floating-object-handle-factory.ts
79826
+ init_cjs_shims();
79827
+
80366
79828
  // ../../kernel/src/api/worksheet/handles/floating-object-handle-impl.ts
80367
79829
  init_cjs_shims();
80368
79830
  init_errors();
79831
+ function narrowHandle(handle, expected) {
79832
+ if (handle.type !== expected) {
79833
+ throw new KernelError("OPERATION_FAILED", `Expected ${expected}, got ${handle.type}`);
79834
+ }
79835
+ return handle;
79836
+ }
80369
79837
  var FloatingObjectHandleImpl = class _FloatingObjectHandleImpl {
80370
79838
  constructor(id, type, objectsImpl, boundsReader) {
80371
79839
  this.id = id;
@@ -80412,11 +79880,11 @@ var FloatingObjectHandleImpl = class _FloatingObjectHandleImpl {
80412
79880
  return this.boundsReader?.getBounds(this.id) ?? null;
80413
79881
  }
80414
79882
  async getData() {
80415
- const info = await this.objectsImpl.get(this.id);
80416
- if (!info) throw new KernelError("OPERATION_FAILED", `Object ${this.id} not found`);
80417
- return info;
79883
+ const obj = await this.objectsImpl.getFullObject(this.id);
79884
+ if (!obj) throw new KernelError("OPERATION_FAILED", `Object ${this.id} not found`);
79885
+ return obj;
80418
79886
  }
80419
- // -- Type narrowing --
79887
+ // -- Type narrowing (is* predicates) --
80420
79888
  isShape() {
80421
79889
  return this.type === "shape";
80422
79890
  }
@@ -80453,58 +79921,43 @@ var FloatingObjectHandleImpl = class _FloatingObjectHandleImpl {
80453
79921
  isSlicer() {
80454
79922
  return this.type === "slicer";
80455
79923
  }
80456
- /** @internal Throw if this handle's type doesn't match expected. */
80457
- assertType(expected) {
80458
- if (this.type !== expected) {
80459
- throw new KernelError("OPERATION_FAILED", `Expected ${expected}, got ${this.type}`);
80460
- }
80461
- }
79924
+ /**
79925
+ * Type-checked narrowing — throws if this handle's type does not match.
79926
+ * The factory (createFloatingObjectHandle) guarantees that when type === 'shape',
79927
+ * `this` is a ShapeHandleImpl which implements ShapeHandle, etc.
79928
+ */
80462
79929
  asShape() {
80463
- this.assertType("shape");
80464
- return this;
79930
+ return narrowHandle(this, "shape");
80465
79931
  }
80466
79932
  asPicture() {
80467
- this.assertType("picture");
80468
- return this;
79933
+ return narrowHandle(this, "picture");
80469
79934
  }
80470
79935
  asTextBox() {
80471
- this.assertType("textbox");
80472
- return this;
79936
+ return narrowHandle(this, "textbox");
80473
79937
  }
80474
79938
  asDrawing() {
80475
- this.assertType("drawing");
80476
- return this;
79939
+ return narrowHandle(this, "drawing");
80477
79940
  }
80478
79941
  asEquation() {
80479
- this.assertType("equation");
80480
- return this;
79942
+ return narrowHandle(this, "equation");
80481
79943
  }
80482
79944
  asWordArt() {
80483
- this.assertType("wordart");
80484
- return this;
79945
+ throw new KernelError("OPERATION_FAILED", `Expected wordart, got ${this.type}`);
80485
79946
  }
80486
79947
  asSmartArt() {
80487
- this.assertType("smartart");
80488
- return this;
79948
+ return narrowHandle(this, "smartart");
80489
79949
  }
80490
79950
  asChart() {
80491
- this.assertType("chart");
80492
- return this;
80493
- }
80494
- asCamera() {
80495
- throw new KernelError("OPERATION_FAILED", "Camera objects are no longer supported");
79951
+ return narrowHandle(this, "chart");
80496
79952
  }
80497
79953
  asConnector() {
80498
- this.assertType("connector");
80499
- return this;
79954
+ return narrowHandle(this, "connector");
80500
79955
  }
80501
79956
  asOleObject() {
80502
- this.assertType("oleObject");
80503
- return this;
79957
+ return narrowHandle(this, "oleObject");
80504
79958
  }
80505
79959
  asSlicer() {
80506
- this.assertType("slicer");
80507
- return this;
79960
+ return narrowHandle(this, "slicer");
80508
79961
  }
80509
79962
  };
80510
79963
 
@@ -80524,9 +79977,9 @@ var ShapeHandleImpl = class _ShapeHandleImpl extends FloatingObjectHandleImpl {
80524
79977
  return new _ShapeHandleImpl(receipt.id, this.shapeType, this.objectsImpl, this.boundsReader);
80525
79978
  }
80526
79979
  async getData() {
80527
- const shape = await this.objectsImpl.getShape(this.id);
80528
- if (!shape) throw new KernelError("OPERATION_FAILED", `Shape ${this.id} not found`);
80529
- return shape;
79980
+ const obj = await this.objectsImpl.getFullObject(this.id);
79981
+ if (!obj || obj.type !== "shape") throw new KernelError("OPERATION_FAILED", `Shape ${this.id} not found`);
79982
+ return obj;
80530
79983
  }
80531
79984
  };
80532
79985
 
@@ -80545,9 +79998,9 @@ var PictureHandleImpl = class _PictureHandleImpl extends FloatingObjectHandleImp
80545
79998
  return new _PictureHandleImpl(receipt.id, this.objectsImpl, this.boundsReader);
80546
79999
  }
80547
80000
  async getData() {
80548
- const info = await this.objectsImpl.get(this.id);
80549
- if (!info) throw new KernelError("OPERATION_FAILED", `Picture ${this.id} not found`);
80550
- return info;
80001
+ const obj = await this.objectsImpl.getFullObject(this.id);
80002
+ if (!obj || obj.type !== "picture") throw new KernelError("OPERATION_FAILED", `Picture ${this.id} not found`);
80003
+ return obj;
80551
80004
  }
80552
80005
  };
80553
80006
 
@@ -80566,9 +80019,9 @@ var TextBoxHandleImpl = class _TextBoxHandleImpl extends FloatingObjectHandleImp
80566
80019
  return new _TextBoxHandleImpl(receipt.id, this.objectsImpl, this.boundsReader);
80567
80020
  }
80568
80021
  async getData() {
80569
- const info = await this.objectsImpl.get(this.id);
80570
- if (!info) throw new KernelError("OPERATION_FAILED", `TextBox ${this.id} not found`);
80571
- return info;
80022
+ const obj = await this.objectsImpl.getFullObject(this.id);
80023
+ if (!obj || obj.type !== "textbox") throw new KernelError("OPERATION_FAILED", `TextBox ${this.id} not found`);
80024
+ return obj;
80572
80025
  }
80573
80026
  };
80574
80027
 
@@ -80623,9 +80076,9 @@ var EquationHandleImpl = class _EquationHandleImpl extends FloatingObjectHandleI
80623
80076
  return new _EquationHandleImpl(receipt.id, this.objectsImpl, this.boundsReader);
80624
80077
  }
80625
80078
  async getData() {
80626
- const info = await this.objectsImpl.get(this.id);
80627
- if (!info) throw new KernelError("OPERATION_FAILED", `Equation ${this.id} not found`);
80628
- return info;
80079
+ const obj = await this.objectsImpl.getFullObject(this.id);
80080
+ if (!obj || obj.type !== "equation") throw new KernelError("OPERATION_FAILED", `Equation ${this.id} not found`);
80081
+ return obj;
80629
80082
  }
80630
80083
  };
80631
80084
 
@@ -80644,9 +80097,9 @@ var ConnectorHandleImpl = class _ConnectorHandleImpl extends FloatingObjectHandl
80644
80097
  return new _ConnectorHandleImpl(receipt.id, this.objectsImpl, this.boundsReader);
80645
80098
  }
80646
80099
  async getData() {
80647
- const info = await this.objectsImpl.get(this.id);
80648
- if (!info) throw new KernelError("OPERATION_FAILED", `Connector ${this.id} not found`);
80649
- return info;
80100
+ const obj = await this.objectsImpl.getFullObject(this.id);
80101
+ if (!obj || obj.type !== "connector") throw new KernelError("OPERATION_FAILED", `Connector ${this.id} not found`);
80102
+ return obj;
80650
80103
  }
80651
80104
  };
80652
80105
 
@@ -80662,9 +80115,9 @@ var ChartHandleImpl = class _ChartHandleImpl extends FloatingObjectHandleImpl {
80662
80115
  return new _ChartHandleImpl(receipt.id, this.objectsImpl, this.boundsReader);
80663
80116
  }
80664
80117
  async getData() {
80665
- const info = await this.objectsImpl.get(this.id);
80666
- if (!info) throw new KernelError("OPERATION_FAILED", `Chart ${this.id} not found`);
80667
- return info;
80118
+ const obj = await this.objectsImpl.getFullObject(this.id);
80119
+ if (!obj || obj.type !== "chart") throw new KernelError("OPERATION_FAILED", `Chart ${this.id} not found`);
80120
+ return obj;
80668
80121
  }
80669
80122
  };
80670
80123
 
@@ -80680,9 +80133,9 @@ var SmartArtHandleImpl = class _SmartArtHandleImpl extends FloatingObjectHandleI
80680
80133
  return new _SmartArtHandleImpl(receipt.id, this.objectsImpl, this.boundsReader);
80681
80134
  }
80682
80135
  async getData() {
80683
- const info = await this.objectsImpl.get(this.id);
80684
- if (!info) throw new KernelError("OPERATION_FAILED", `SmartArt ${this.id} not found`);
80685
- return info;
80136
+ const obj = await this.objectsImpl.getFullObject(this.id);
80137
+ if (!obj || obj.type !== "smartart") throw new KernelError("OPERATION_FAILED", `SmartArt ${this.id} not found`);
80138
+ return obj;
80686
80139
  }
80687
80140
  };
80688
80141
 
@@ -80698,9 +80151,9 @@ var SlicerHandleImpl = class _SlicerHandleImpl extends FloatingObjectHandleImpl
80698
80151
  return new _SlicerHandleImpl(receipt.id, this.objectsImpl, this.boundsReader);
80699
80152
  }
80700
80153
  async getData() {
80701
- const info = await this.objectsImpl.get(this.id);
80702
- if (!info) throw new KernelError("OPERATION_FAILED", `Slicer ${this.id} not found`);
80703
- return info;
80154
+ const obj = await this.objectsImpl.getFullObject(this.id);
80155
+ if (!obj) throw new KernelError("OPERATION_FAILED", `Slicer ${this.id} not found`);
80156
+ return obj;
80704
80157
  }
80705
80158
  };
80706
80159
 
@@ -80716,12 +80169,50 @@ var OleObjectHandleImpl = class _OleObjectHandleImpl extends FloatingObjectHandl
80716
80169
  return new _OleObjectHandleImpl(receipt.id, this.objectsImpl, this.boundsReader);
80717
80170
  }
80718
80171
  async getData() {
80719
- const info = await this.objectsImpl.get(this.id);
80720
- if (!info) throw new KernelError("OPERATION_FAILED", `OleObject ${this.id} not found`);
80721
- return info;
80172
+ const obj = await this.objectsImpl.getFullObject(this.id);
80173
+ if (!obj || obj.type !== "oleObject") throw new KernelError("OPERATION_FAILED", `OleObject ${this.id} not found`);
80174
+ return obj;
80722
80175
  }
80723
80176
  };
80724
80177
 
80178
+ // ../../kernel/src/api/worksheet/handles/floating-object-handle-factory.ts
80179
+ function createFloatingObjectHandle(id, type, objectsImpl, boundsReader, shapeType) {
80180
+ switch (type) {
80181
+ case "shape":
80182
+ return new ShapeHandleImpl(
80183
+ id,
80184
+ shapeType ?? "rect",
80185
+ objectsImpl,
80186
+ boundsReader
80187
+ );
80188
+ case "picture":
80189
+ return new PictureHandleImpl(id, objectsImpl, boundsReader);
80190
+ case "textbox":
80191
+ return new TextBoxHandleImpl(id, objectsImpl, boundsReader);
80192
+ case "drawing":
80193
+ return new DrawingHandleImpl(id, objectsImpl, boundsReader);
80194
+ case "equation":
80195
+ return new EquationHandleImpl(id, objectsImpl, boundsReader);
80196
+ case "connector":
80197
+ return new ConnectorHandleImpl(id, objectsImpl, boundsReader);
80198
+ case "chart":
80199
+ return new ChartHandleImpl(id, objectsImpl, boundsReader);
80200
+ case "smartart":
80201
+ return new SmartArtHandleImpl(id, objectsImpl, boundsReader);
80202
+ case "slicer":
80203
+ return new SlicerHandleImpl(id, objectsImpl, boundsReader);
80204
+ case "oleObject":
80205
+ return new OleObjectHandleImpl(id, objectsImpl, boundsReader);
80206
+ default:
80207
+ return new FloatingObjectHandleImpl(
80208
+ id,
80209
+ type,
80210
+ objectsImpl,
80211
+ boundsReader
80212
+ );
80213
+ }
80214
+ }
80215
+
80725
80216
  // ../../kernel/src/api/worksheet/collections/object-collection-impl.ts
80726
80217
  var WorksheetObjectCollectionImpl = class {
80727
80218
  constructor(objectsImpl, boundsReader) {
@@ -80790,30 +80281,7 @@ var WorksheetObjectCollectionImpl = class {
80790
80281
  return this.objectsImpl.ungroup(groupId);
80791
80282
  }
80792
80283
  createHandle(id, type) {
80793
- switch (type) {
80794
- case "shape":
80795
- return new ShapeHandleImpl(id, "rect", this.objectsImpl, this.boundsReader);
80796
- case "picture":
80797
- return new PictureHandleImpl(id, this.objectsImpl, this.boundsReader);
80798
- case "textbox":
80799
- return new TextBoxHandleImpl(id, this.objectsImpl, this.boundsReader);
80800
- case "drawing":
80801
- return new DrawingHandleImpl(id, this.objectsImpl, this.boundsReader);
80802
- case "equation":
80803
- return new EquationHandleImpl(id, this.objectsImpl, this.boundsReader);
80804
- case "connector":
80805
- return new ConnectorHandleImpl(id, this.objectsImpl, this.boundsReader);
80806
- case "chart":
80807
- return new ChartHandleImpl(id, this.objectsImpl, this.boundsReader);
80808
- case "smartart":
80809
- return new SmartArtHandleImpl(id, this.objectsImpl, this.boundsReader);
80810
- case "slicer":
80811
- return new SlicerHandleImpl(id, this.objectsImpl, this.boundsReader);
80812
- case "oleObject":
80813
- return new OleObjectHandleImpl(id, this.objectsImpl, this.boundsReader);
80814
- default:
80815
- return new FloatingObjectHandleImpl(id, type, this.objectsImpl, this.boundsReader);
80816
- }
80284
+ return createFloatingObjectHandle(id, type, this.objectsImpl, this.boundsReader);
80817
80285
  }
80818
80286
  };
80819
80287
 
@@ -80961,9 +80429,9 @@ var WordArtHandleImpl = class _WordArtHandleImpl extends FloatingObjectHandleImp
80961
80429
  return new _WordArtHandleImpl(receipt.id, this.objectsImpl, this.boundsReader);
80962
80430
  }
80963
80431
  async getData() {
80964
- const info = await this.objectsImpl.get(this.id);
80965
- if (!info) throw new KernelError("OPERATION_FAILED", `WordArt ${this.id} not found`);
80966
- return info;
80432
+ const obj = await this.objectsImpl.getFullObject(this.id);
80433
+ if (!obj || obj.type !== "textbox") throw new KernelError("OPERATION_FAILED", `WordArt ${this.id} not found`);
80434
+ return obj;
80967
80435
  }
80968
80436
  };
80969
80437
 
@@ -81241,7 +80709,7 @@ function chartConfigToInternal(config) {
81241
80709
  series: config.series,
81242
80710
  dataLabels: config.dataLabels,
81243
80711
  pieSlice: config.pieSlice,
81244
- trendline: config.trendline,
80712
+ trendline: config.trendlines ?? (config.trendline ? [config.trendline] : void 0),
81245
80713
  showLines: config.showLines,
81246
80714
  smoothLines: config.smoothLines,
81247
80715
  radarFilled: config.radarFilled,
@@ -81258,7 +80726,7 @@ function chartConfigToInternal(config) {
81258
80726
  splitValue: config.splitValue,
81259
80727
  widthCells: config.width,
81260
80728
  heightCells: config.height,
81261
- definition: buildStatisticalExtra(config)
80729
+ ooxml: buildStatisticalExtra(config)
81262
80730
  };
81263
80731
  }
81264
80732
  function chartUpdatesToInternal(updates) {
@@ -81285,7 +80753,11 @@ function chartUpdatesToInternal(updates) {
81285
80753
  if (updates.series !== void 0) result.series = updates.series;
81286
80754
  if (updates.dataLabels !== void 0) result.dataLabels = updates.dataLabels;
81287
80755
  if (updates.pieSlice !== void 0) result.pieSlice = updates.pieSlice;
81288
- if (updates.trendline !== void 0) result.trendline = updates.trendline;
80756
+ if (updates.trendlines !== void 0) {
80757
+ result.trendline = updates.trendlines;
80758
+ } else if (updates.trendline !== void 0) {
80759
+ result.trendline = updates.trendline ? [updates.trendline] : void 0;
80760
+ }
81289
80761
  if (updates.showLines !== void 0) result.showLines = updates.showLines;
81290
80762
  if (updates.smoothLines !== void 0) result.smoothLines = updates.smoothLines;
81291
80763
  if (updates.radarFilled !== void 0) result.radarFilled = updates.radarFilled;
@@ -81302,7 +80774,7 @@ function chartUpdatesToInternal(updates) {
81302
80774
  if (updates.splitValue !== void 0) result.splitValue = updates.splitValue;
81303
80775
  if (updates.name !== void 0) result.name = updates.name;
81304
80776
  const statisticalExtra = buildStatisticalExtra(updates);
81305
- if (statisticalExtra) result.definition = statisticalExtra;
80777
+ if (statisticalExtra) result.ooxml = statisticalExtra;
81306
80778
  return result;
81307
80779
  }
81308
80780
  function serializedChartToChart(chart) {
@@ -81327,7 +80799,8 @@ function serializedChartToChart(chart) {
81327
80799
  series: chart.series,
81328
80800
  dataLabels: chart.dataLabels,
81329
80801
  pieSlice: chart.pieSlice,
81330
- trendline: chart.trendline,
80802
+ trendline: Array.isArray(chart.trendline) ? chart.trendline[0] : chart.trendline,
80803
+ trendlines: chart.trendline,
81331
80804
  showLines: chart.showLines,
81332
80805
  smoothLines: chart.smoothLines,
81333
80806
  radarFilled: chart.radarFilled,
@@ -81342,7 +80815,7 @@ function serializedChartToChart(chart) {
81342
80815
  bubbleScale: chart.bubbleScale,
81343
80816
  splitType: chart.splitType,
81344
80817
  splitValue: chart.splitValue,
81345
- ...unpackStatisticalExtra(chart.definition),
80818
+ ...unpackStatisticalExtra(chart.ooxml),
81346
80819
  name: chart.name || void 0,
81347
80820
  createdAt: chart.createdAt,
81348
80821
  updatedAt: chart.updatedAt
@@ -81370,7 +80843,10 @@ async function applyUpdate(ctx, sheetId, chartId, updates) {
81370
80843
  function ensurePointsArray(series, minLength) {
81371
80844
  const points = [...series.points ?? []];
81372
80845
  while (points.length <= minLength) {
81373
- points.push({});
80846
+ points.push({ idx: points.length });
80847
+ }
80848
+ for (let i = 0; i < points.length; i++) {
80849
+ points[i].idx = i;
81374
80850
  }
81375
80851
  return points;
81376
80852
  }
@@ -81597,40 +81073,6 @@ init_cjs_shims();
81597
81073
  init_a1();
81598
81074
  init_compute_core();
81599
81075
  init_errors();
81600
- function cellRefToA1(cellRef) {
81601
- const parts = cellRef.split(":");
81602
- if (parts.length !== 2) return cellRef;
81603
- const col = parseInt(parts[0], 10);
81604
- const row = parseInt(parts[1], 10);
81605
- if (isNaN(col) || isNaN(row)) return cellRef;
81606
- return toA12(row, col);
81607
- }
81608
- function toApiComment(c) {
81609
- const text = c.content ?? c.runs.map((r) => r.text).join("");
81610
- return {
81611
- id: c.id,
81612
- cellId: c.cellRef,
81613
- cellAddress: cellRefToA1(c.cellRef),
81614
- author: c.author,
81615
- authorId: c.authorId,
81616
- text,
81617
- content: c.runs.length > 0 ? c.runs.map((r) => ({
81618
- text: r.text,
81619
- bold: r.bold || void 0,
81620
- italic: r.italic || void 0,
81621
- underline: r.underline || void 0,
81622
- strikethrough: r.strikethrough || void 0,
81623
- color: r.color ?? void 0,
81624
- fontName: r.fontName ?? void 0,
81625
- fontSize: r.fontSize ?? void 0
81626
- })) : void 0,
81627
- threadId: c.threadId || void 0,
81628
- parentId: c.parentId ?? void 0,
81629
- resolved: c.resolved ?? void 0,
81630
- createdAt: c.createdAt ?? 0,
81631
- modifiedAt: c.modifiedAt ?? void 0
81632
- };
81633
- }
81634
81076
  function propagateResolved(comments) {
81635
81077
  const rootResolved = /* @__PURE__ */ new Map();
81636
81078
  for (const c of comments) {
@@ -81756,7 +81198,7 @@ var WorksheetCommentsImpl = class {
81756
81198
  "addCommentByPosition: no comment returned in MutationResult.data"
81757
81199
  );
81758
81200
  }
81759
- return toApiComment(comment);
81201
+ return comment;
81760
81202
  }
81761
81203
  async update(commentId, text) {
81762
81204
  if (!text || text.trim().length === 0) {
@@ -81775,7 +81217,7 @@ var WorksheetCommentsImpl = class {
81775
81217
  }
81776
81218
  async list() {
81777
81219
  const comments = await this.ctx.computeBridge.getAllComments(this.sheetId);
81778
- return propagateResolved(comments.map(toApiComment));
81220
+ return propagateResolved(comments);
81779
81221
  }
81780
81222
  async getForCell(a, b) {
81781
81223
  const { row, col } = resolveCell(a, b);
@@ -81784,7 +81226,7 @@ var WorksheetCommentsImpl = class {
81784
81226
  row,
81785
81227
  col
81786
81228
  );
81787
- return comments.map(toApiComment);
81229
+ return comments;
81788
81230
  }
81789
81231
  async addReply(commentId, text, author) {
81790
81232
  const parent = await this.ctx.computeBridge.getComment(this.sheetId, commentId);
@@ -81801,7 +81243,7 @@ var WorksheetCommentsImpl = class {
81801
81243
  author,
81802
81244
  { parentId: commentId }
81803
81245
  );
81804
- return toApiComment(comment);
81246
+ return comment;
81805
81247
  }
81806
81248
  async getThread(commentId) {
81807
81249
  const comment = await this.ctx.computeBridge.getComment(this.sheetId, commentId);
@@ -81810,11 +81252,11 @@ var WorksheetCommentsImpl = class {
81810
81252
  }
81811
81253
  const threadId = comment.threadId ?? comment.id;
81812
81254
  const thread = await this.ctx.computeBridge.getCommentThread(this.sheetId, threadId);
81813
- return propagateResolved(thread.map(toApiComment));
81255
+ return propagateResolved(thread);
81814
81256
  }
81815
81257
  async getById(commentId) {
81816
81258
  const comment = await this.ctx.computeBridge.getComment(this.sheetId, commentId);
81817
- return comment ? toApiComment(comment) : null;
81259
+ return comment ?? null;
81818
81260
  }
81819
81261
  };
81820
81262
 
@@ -82037,18 +81479,9 @@ var WorksheetFiltersImpl = class {
82037
81479
  const filters = await this.ctx.computeBridge.getFiltersInSheet(this.sheetId);
82038
81480
  if (filters.length === 0) return null;
82039
81481
  const filter = filters[0];
82040
- const columns = /* @__PURE__ */ new Map();
82041
- if (filter.columnFilters) {
82042
- for (const [key, value] of Object.entries(filter.columnFilters)) {
82043
- const colIdx = parseInt(key, 10);
82044
- if (!isNaN(colIdx) && value) {
82045
- columns.set(colIdx, value);
82046
- }
82047
- }
82048
- }
82049
81482
  return {
82050
81483
  range: `${toA12(filter.startRow ?? 0, filter.startCol ?? 0)}:${toA12(filter.endRow ?? 0, filter.endCol ?? 0)}`,
82051
- columns
81484
+ columnFilters: filter.columnFilters ?? {}
82052
81485
  };
82053
81486
  }
82054
81487
  async getForRange(range2) {
@@ -82119,9 +81552,9 @@ var WorksheetFiltersImpl = class {
82119
81552
  async list() {
82120
81553
  const raw = await this.ctx.computeBridge.getFiltersInSheet(this.sheetId);
82121
81554
  return raw.map((f) => ({
82122
- id: f.id ?? f.filterId,
82123
- range: f.range,
82124
- columns: f.columns
81555
+ id: f.id,
81556
+ range: void 0,
81557
+ columnFilters: f.columnFilters
82125
81558
  }));
82126
81559
  }
82127
81560
  async listDetails() {
@@ -82139,13 +81572,22 @@ var WorksheetFiltersImpl = class {
82139
81572
  }
82140
81573
  async getSortState(filterId) {
82141
81574
  try {
82142
- return await this.ctx.computeBridge.getFilterSortState(this.sheetId, filterId);
81575
+ const sortState = await this.ctx.computeBridge.getFilterSortState(this.sheetId, filterId);
81576
+ if (!sortState) return null;
81577
+ return {
81578
+ column: sortState.columnCellId,
81579
+ direction: sortState.order === "asc" ? "asc" : "desc"
81580
+ };
82143
81581
  } catch {
82144
81582
  return null;
82145
81583
  }
82146
81584
  }
82147
81585
  async setSortState(filterId, state) {
82148
- await this.ctx.computeBridge.setFilterSortState(this.sheetId, filterId, state);
81586
+ await this.ctx.computeBridge.setFilterSortState(this.sheetId, filterId, {
81587
+ columnCellId: String(state.column),
81588
+ order: state.direction === "asc" ? "asc" : "desc",
81589
+ sortBy: "value"
81590
+ });
82149
81591
  }
82150
81592
  };
82151
81593
 
@@ -82179,6 +81621,7 @@ init_cjs_shims();
82179
81621
 
82180
81622
  // ../../number-formats/src/constants.ts
82181
81623
  init_cjs_shims();
81624
+ var import_constants4 = require("@mog-sdk/spreadsheet-contracts/number-formats/constants");
82182
81625
 
82183
81626
  // ../../number-formats/src/format-utils.ts
82184
81627
  init_cjs_shims();
@@ -82422,7 +81865,11 @@ var WorksheetFormatsImpl = class {
82422
81865
  col = b;
82423
81866
  format = c;
82424
81867
  }
82425
- const result = await this.ctx.computeBridge.setFormatForRanges(this.sheetId, [[row, col, row, col]], format);
81868
+ const result = await this.ctx.computeBridge.setFormatForRanges(
81869
+ this.sheetId,
81870
+ [[row, col, row, col]],
81871
+ format
81872
+ );
82426
81873
  return { cellCount: result.propertyChanges?.length ?? 0 };
82427
81874
  }
82428
81875
  async setRange(a, b) {
@@ -82471,7 +81918,11 @@ var WorksheetFormatsImpl = class {
82471
81918
  }
82472
81919
  async get(a, b) {
82473
81920
  const { row, col } = resolveCell(a, b);
82474
- return this.ctx.computeBridge.getResolvedFormat(this.sheetId, row, col);
81921
+ return this.ctx.computeBridge.getResolvedFormat(
81922
+ this.sheetId,
81923
+ row,
81924
+ col
81925
+ );
82475
81926
  }
82476
81927
  async adjustIndent(a, b, c) {
82477
81928
  let row, col, amount;
@@ -83513,7 +82964,12 @@ var WorksheetPivotsImpl = class _WorksheetPivotsImpl {
83513
82964
  }
83514
82965
  async queryPivot(pivotName, filters) {
83515
82966
  const pivot = await this.findPivotByName(pivotName);
83516
- if (!pivot) return null;
82967
+ if (!pivot) {
82968
+ throw new KernelError(
82969
+ "COMPUTE_ERROR",
82970
+ `queryPivot: Pivot table "${pivotName}" not found on this sheet`
82971
+ );
82972
+ }
83517
82973
  const pivotId = pivot.id ?? pivot.name;
83518
82974
  const result = await this.ctx.pivot.compute(this.sheetId, pivotId);
83519
82975
  if (!result) return null;
@@ -83870,7 +83326,7 @@ init_errors();
83870
83326
 
83871
83327
  // ../../kernel/src/api/worksheet/operations/sheet-management-operations.ts
83872
83328
  init_cjs_shims();
83873
- init_protection();
83329
+ var import_protection4 = require("@mog-sdk/spreadsheet-contracts/protection");
83874
83330
  function parseCellRef2(ref) {
83875
83331
  const match = ref.match(/^([A-Z]+)(\d+)$/i);
83876
83332
  if (!match) return null;
@@ -84294,12 +83750,35 @@ var WorksheetSlicersImpl = class {
84294
83750
  }
84295
83751
  async add(config) {
84296
83752
  const caption = config.caption ?? config.name ?? "";
83753
+ const source = config.source ?? {
83754
+ type: "table",
83755
+ tableId: config.tableName ?? "",
83756
+ columnCellId: config.columnName ?? ""
83757
+ };
83758
+ const defaultStyle = {
83759
+ columnCount: 1,
83760
+ buttonHeight: 30,
83761
+ showSelectionIndicator: true,
83762
+ crossFilter: "showItemsWithDataAtTop",
83763
+ customListSort: true,
83764
+ showItemsWithNoData: true,
83765
+ sortOrder: "ascending"
83766
+ };
84297
83767
  const storedConfig = {
84298
- ...config,
84299
- caption
83768
+ id: config.id ?? "",
83769
+ sheetId: config.sheetId ?? "",
83770
+ source,
83771
+ caption,
83772
+ style: config.style ?? defaultStyle,
83773
+ position: config.position,
83774
+ zIndex: config.zIndex ?? 0,
83775
+ locked: config.locked ?? false,
83776
+ showHeader: config.showHeader ?? true,
83777
+ multiSelect: config.multiSelect ?? true,
83778
+ selectedValues: config.selectedValues ?? []
84300
83779
  };
84301
83780
  await this.ctx.computeBridge.createSlicer(this.sheetId, storedConfig);
84302
- return storedConfig.id ?? "";
83781
+ return storedConfig.id;
84303
83782
  }
84304
83783
  async remove(slicerId) {
84305
83784
  validateSlicerId(slicerId, "deleteSlicer");
@@ -84461,11 +83940,15 @@ var WorksheetSlicersImpl = class {
84461
83940
  }
84462
83941
  async updateConfig(slicerId, updates) {
84463
83942
  validateSlicerId(slicerId, "updateSlicerConfig");
84464
- await this.ctx.computeBridge.updateSlicerConfig(
84465
- this.sheetId,
84466
- slicerId,
84467
- updates
84468
- );
83943
+ const bridgeUpdate = {};
83944
+ if (updates.caption !== void 0) bridgeUpdate.caption = updates.caption;
83945
+ if (updates.name !== void 0 && bridgeUpdate.caption === void 0) {
83946
+ bridgeUpdate.caption = updates.name;
83947
+ }
83948
+ if (updates.style !== void 0) bridgeUpdate.style = updates.style;
83949
+ if (updates.position !== void 0) bridgeUpdate.position = updates.position;
83950
+ if (updates.showHeader !== void 0) bridgeUpdate.showHeader = updates.showHeader;
83951
+ await this.ctx.computeBridge.updateSlicerConfig(this.sheetId, slicerId, bridgeUpdate);
84469
83952
  }
84470
83953
  async getState(slicerId) {
84471
83954
  const state = await this.ctx.computeBridge.getSlicerState(this.sheetId, slicerId);
@@ -85059,6 +84542,7 @@ function toBridgeTextToColumnsOptions(options) {
85059
84542
  // ../../kernel/src/api/worksheet/tables.ts
85060
84543
  init_cjs_shims();
85061
84544
  init_errors();
84545
+ init_value_conversions();
85062
84546
 
85063
84547
  // ../../kernel/src/api/worksheet/operations/table-operations.ts
85064
84548
  init_cjs_shims();
@@ -85080,31 +84564,15 @@ function bridgeTableToTableInfo(table) {
85080
84564
  const endRowA1 = table.range.endRow + 1;
85081
84565
  const range2 = `${startLetter}${startRowA1}:${endLetter}${endRowA1}`;
85082
84566
  return {
85083
- id: table.id,
85084
- name: table.name,
85085
- range: range2,
85086
- hasHeaders: table.hasHeaderRow,
85087
- showTotals: table.hasTotalsRow,
85088
- style: table.style || void 0,
85089
- highlightFirstColumn: table.emphasizeFirstColumn,
85090
- highlightLastColumn: table.emphasizeLastColumn,
85091
- showBandedColumns: table.bandedColumns,
85092
- showBandedRows: table.bandedRows,
85093
- showFilterButton: table.showFilterButtons,
85094
- showHeaders: table.hasHeaderRow,
85095
- columns: table.columns.map((col) => ({
85096
- name: col.name,
85097
- index: col.index,
85098
- totalFunction: col.totalsFunction ?? void 0,
85099
- calculatedFormula: col.calculatedFormula ?? void 0
85100
- }))
84567
+ ...table,
84568
+ range: range2
85101
84569
  };
85102
84570
  }
85103
84571
  function getTableColumnDataCellsFromInfo(table, colIndex) {
85104
84572
  const parsed = parseA1Range(table.range);
85105
84573
  if (!parsed) return [];
85106
- const dataStartRow = table.hasHeaders ? parsed.startRow + 1 : parsed.startRow;
85107
- const dataEndRow = table.showTotals ? parsed.endRow - 1 : parsed.endRow;
84574
+ const dataStartRow = table.hasHeaderRow ? parsed.startRow + 1 : parsed.startRow;
84575
+ const dataEndRow = table.hasTotalsRow ? parsed.endRow - 1 : parsed.endRow;
85108
84576
  if (dataStartRow > dataEndRow) return [];
85109
84577
  const col = parsed.startCol + colIndex;
85110
84578
  if (col > parsed.endCol) return [];
@@ -85117,15 +84585,15 @@ function getTableColumnDataCellsFromInfo(table, colIndex) {
85117
84585
  function getDataBodyRangeFromInfo(table) {
85118
84586
  const parsed = parseA1Range(table.range);
85119
84587
  if (!parsed) return null;
85120
- const dataStartRow = table.hasHeaders ? parsed.startRow + 1 : parsed.startRow;
85121
- const dataEndRow = table.showTotals ? parsed.endRow - 1 : parsed.endRow;
84588
+ const dataStartRow = table.hasHeaderRow ? parsed.startRow + 1 : parsed.startRow;
84589
+ const dataEndRow = table.hasTotalsRow ? parsed.endRow - 1 : parsed.endRow;
85122
84590
  if (dataStartRow > dataEndRow) return null;
85123
84591
  const startLetter = colToLetter3(parsed.startCol);
85124
84592
  const endLetter = colToLetter3(parsed.endCol);
85125
84593
  return `${startLetter}${dataStartRow + 1}:${endLetter}${dataEndRow + 1}`;
85126
84594
  }
85127
84595
  function getHeaderRowRangeFromInfo(table) {
85128
- if (!table.hasHeaders) return null;
84596
+ if (!table.hasHeaderRow) return null;
85129
84597
  const parsed = parseA1Range(table.range);
85130
84598
  if (!parsed) return null;
85131
84599
  const startLetter = colToLetter3(parsed.startCol);
@@ -85134,7 +84602,7 @@ function getHeaderRowRangeFromInfo(table) {
85134
84602
  return `${startLetter}${headerRow}:${endLetter}${headerRow}`;
85135
84603
  }
85136
84604
  function getTotalRowRangeFromInfo(table) {
85137
- if (!table.showTotals) return null;
84605
+ if (!table.hasTotalsRow) return null;
85138
84606
  const parsed = parseA1Range(table.range);
85139
84607
  if (!parsed) return null;
85140
84608
  const startLetter = colToLetter3(parsed.startCol);
@@ -85230,23 +84698,23 @@ var WorksheetTablesImpl = class {
85230
84698
  if (updates.name !== void 0) {
85231
84699
  await this.ctx.computeBridge.renameTable(tableName, updates.name);
85232
84700
  }
85233
- const boolOptionMap = {
85234
- highlightFirstColumn: "emphasizeFirstColumn",
85235
- highlightLastColumn: "emphasizeLastColumn",
85236
- showBandedColumns: "bandedColumns",
85237
- showBandedRows: "bandedRows",
85238
- showFilterButton: "showFilterButtons"
85239
- };
85240
- for (const [key, bridgeOption] of Object.entries(boolOptionMap)) {
84701
+ const boolOptions = [
84702
+ "emphasizeFirstColumn",
84703
+ "emphasizeLastColumn",
84704
+ "bandedColumns",
84705
+ "bandedRows",
84706
+ "showFilterButtons"
84707
+ ];
84708
+ for (const key of boolOptions) {
85241
84709
  if (updates[key] !== void 0) {
85242
- await this.ctx.computeBridge.setTableBoolOption(tableName, bridgeOption, updates[key]);
84710
+ await this.ctx.computeBridge.setTableBoolOption(tableName, key, updates[key]);
85243
84711
  }
85244
84712
  }
85245
- if (updates.showHeaders !== void 0) {
85246
- await this.setShowHeaders(tableName, updates.showHeaders);
84713
+ if (updates.hasHeaderRow !== void 0) {
84714
+ await this.setShowHeaders(tableName, updates.hasHeaderRow);
85247
84715
  }
85248
- if (updates.showTotals !== void 0) {
85249
- await this.setShowTotals(tableName, updates.showTotals);
84716
+ if (updates.hasTotalsRow !== void 0) {
84717
+ await this.setShowTotals(tableName, updates.hasTotalsRow);
85250
84718
  }
85251
84719
  }
85252
84720
  async getAtCell(row, col) {
@@ -85367,14 +84835,14 @@ var WorksheetTablesImpl = class {
85367
84835
  async setShowHeaders(tableName, visible) {
85368
84836
  const table = await this.get(tableName);
85369
84837
  if (!table) throw new KernelError("COMPUTE_ERROR", `Table not found: ${tableName}`);
85370
- if (table.hasHeaders !== visible) {
84838
+ if (table.hasHeaderRow !== visible) {
85371
84839
  await this.ctx.computeBridge.toggleHeaderRow(tableName);
85372
84840
  }
85373
84841
  }
85374
84842
  async setShowTotals(tableName, visible) {
85375
84843
  const table = await this.get(tableName);
85376
84844
  if (!table) throw new KernelError("COMPUTE_ERROR", `Table not found: ${tableName}`);
85377
- if ((table.showTotals ?? false) !== visible) {
84845
+ if (table.hasTotalsRow !== visible) {
85378
84846
  await this.ctx.computeBridge.toggleTotalsRow(tableName);
85379
84847
  }
85380
84848
  }
@@ -85408,8 +84876,8 @@ var WorksheetTablesImpl = class {
85408
84876
  if (!table) throw new KernelError("COMPUTE_ERROR", `Table not found: ${tableName}`);
85409
84877
  const parsed = parseA1Range2(table.range);
85410
84878
  if (!parsed) return 0;
85411
- const dataStartRow = table.hasHeaders ? parsed.startRow + 1 : parsed.startRow;
85412
- const dataEndRow = table.showTotals ? parsed.endRow - 1 : parsed.endRow;
84879
+ const dataStartRow = table.hasHeaderRow ? parsed.startRow + 1 : parsed.startRow;
84880
+ const dataEndRow = table.hasTotalsRow ? parsed.endRow - 1 : parsed.endRow;
85413
84881
  return Math.max(0, dataEndRow - dataStartRow + 1);
85414
84882
  }
85415
84883
  async getRowRange(tableName, index) {
@@ -85417,7 +84885,7 @@ var WorksheetTablesImpl = class {
85417
84885
  if (!table) throw new KernelError("COMPUTE_ERROR", `Table not found: ${tableName}`);
85418
84886
  const parsed = parseA1Range2(table.range);
85419
84887
  if (!parsed) throw new KernelError("COMPUTE_ERROR", `Invalid table range: ${table.range}`);
85420
- const dataStartRow = table.hasHeaders ? parsed.startRow + 1 : parsed.startRow;
84888
+ const dataStartRow = table.hasHeaderRow ? parsed.startRow + 1 : parsed.startRow;
85421
84889
  const absRow = dataStartRow + index;
85422
84890
  const startLetter = colToLetter3(parsed.startCol);
85423
84891
  const endLetter = colToLetter3(parsed.endCol);
@@ -85428,7 +84896,7 @@ var WorksheetTablesImpl = class {
85428
84896
  if (!table) throw new KernelError("COMPUTE_ERROR", `Table not found: ${tableName}`);
85429
84897
  const parsed = parseA1Range2(table.range);
85430
84898
  if (!parsed) return [];
85431
- const dataStartRow = table.hasHeaders ? parsed.startRow + 1 : parsed.startRow;
84899
+ const dataStartRow = table.hasHeaderRow ? parsed.startRow + 1 : parsed.startRow;
85432
84900
  const absRow = dataStartRow + index;
85433
84901
  return queryRangeValues(this.ctx, this.sheetId, absRow, parsed.startCol, absRow, parsed.endCol);
85434
84902
  }
@@ -85437,7 +84905,7 @@ var WorksheetTablesImpl = class {
85437
84905
  if (!table) throw new KernelError("COMPUTE_ERROR", `Table not found: ${tableName}`);
85438
84906
  const parsed = parseA1Range2(table.range);
85439
84907
  if (!parsed) return;
85440
- const dataStartRow = table.hasHeaders ? parsed.startRow + 1 : parsed.startRow;
84908
+ const dataStartRow = table.hasHeaderRow ? parsed.startRow + 1 : parsed.startRow;
85441
84909
  const absRow = dataStartRow + index;
85442
84910
  const edits = values.map((val, i) => ({
85443
84911
  row: absRow,
@@ -85456,15 +84924,15 @@ var WorksheetTablesImpl = class {
85456
84924
  if (!parsed) return null;
85457
84925
  const col = parsed.startCol + columnIndex;
85458
84926
  if (col > parsed.endCol) return null;
85459
- const dataStartRow = table.hasHeaders ? parsed.startRow + 1 : parsed.startRow;
85460
- const dataEndRow = table.showTotals ? parsed.endRow - 1 : parsed.endRow;
84927
+ const dataStartRow = table.hasHeaderRow ? parsed.startRow + 1 : parsed.startRow;
84928
+ const dataEndRow = table.hasTotalsRow ? parsed.endRow - 1 : parsed.endRow;
85461
84929
  if (dataStartRow > dataEndRow) return null;
85462
84930
  const letter = colToLetter3(col);
85463
84931
  return `${letter}${dataStartRow + 1}:${letter}${dataEndRow + 1}`;
85464
84932
  }
85465
84933
  async getColumnHeaderRange(tableName, columnIndex) {
85466
84934
  const table = await this.get(tableName);
85467
- if (!table || !table.hasHeaders) return null;
84935
+ if (!table || !table.hasHeaderRow) return null;
85468
84936
  const parsed = parseA1Range2(table.range);
85469
84937
  if (!parsed) return null;
85470
84938
  const col = parsed.startCol + columnIndex;
@@ -85485,7 +84953,7 @@ var WorksheetTablesImpl = class {
85485
84953
  }
85486
84954
  async getColumnTotalRange(tableName, columnIndex) {
85487
84955
  const table = await this.get(tableName);
85488
- if (!table || !table.showTotals) return null;
84956
+ if (!table || !table.hasTotalsRow) return null;
85489
84957
  const parsed = parseA1Range2(table.range);
85490
84958
  if (!parsed) return null;
85491
84959
  const col = parsed.startCol + columnIndex;
@@ -85501,8 +84969,8 @@ var WorksheetTablesImpl = class {
85501
84969
  if (!parsed) return [];
85502
84970
  const col = parsed.startCol + columnIndex;
85503
84971
  if (col > parsed.endCol) return [];
85504
- const dataStartRow = table.hasHeaders ? parsed.startRow + 1 : parsed.startRow;
85505
- const dataEndRow = table.showTotals ? parsed.endRow - 1 : parsed.endRow;
84972
+ const dataStartRow = table.hasHeaderRow ? parsed.startRow + 1 : parsed.startRow;
84973
+ const dataEndRow = table.hasTotalsRow ? parsed.endRow - 1 : parsed.endRow;
85506
84974
  if (dataStartRow > dataEndRow) return [];
85507
84975
  return queryRangeValues(this.ctx, this.sheetId, dataStartRow, col, dataEndRow, col);
85508
84976
  }
@@ -85513,7 +84981,7 @@ var WorksheetTablesImpl = class {
85513
84981
  if (!parsed) return;
85514
84982
  const col = parsed.startCol + columnIndex;
85515
84983
  if (col > parsed.endCol) return;
85516
- const dataStartRow = table.hasHeaders ? parsed.startRow + 1 : parsed.startRow;
84984
+ const dataStartRow = table.hasHeaderRow ? parsed.startRow + 1 : parsed.startRow;
85517
84985
  const edits = values.map((val, i) => ({
85518
84986
  row: dataStartRow + i,
85519
84987
  col,
@@ -85529,8 +84997,8 @@ var WorksheetTablesImpl = class {
85529
84997
  if (!table) throw new KernelError("COMPUTE_ERROR", `Table not found: ${tableName}`);
85530
84998
  const parsed = parseA1Range2(table.range);
85531
84999
  if (!parsed) return;
85532
- const dataStartRow = table.hasHeaders ? parsed.startRow + 1 : parsed.startRow;
85533
- const dataEndRow = table.showTotals ? parsed.endRow - 1 : parsed.endRow;
85000
+ const dataStartRow = table.hasHeaderRow ? parsed.startRow + 1 : parsed.startRow;
85001
+ const dataEndRow = table.hasTotalsRow ? parsed.endRow - 1 : parsed.endRow;
85534
85002
  if (dataStartRow > dataEndRow) return;
85535
85003
  const numCols = parsed.endCol - parsed.startCol + 1;
85536
85004
  const numRows = dataEndRow - dataStartRow + 1;
@@ -85550,7 +85018,7 @@ var WorksheetTablesImpl = class {
85550
85018
  const row = [];
85551
85019
  for (let c = 0; c < numCols; c++) {
85552
85020
  const cell = cellMap.get(`${dataStartRow + r},${parsed.startCol + c}`);
85553
- row.push(cell?.value ?? null);
85021
+ row.push(normalizeCellValue(cell?.value ?? null));
85554
85022
  }
85555
85023
  rows.push(row);
85556
85024
  }
@@ -85622,7 +85090,7 @@ async function queryRangeValues(ctx, sheetId, startRow, startCol, endRow, endCol
85622
85090
  for (let r = startRow; r <= endRow; r++) {
85623
85091
  for (let c = startCol; c <= endCol; c++) {
85624
85092
  const cell = cellMap.get(`${r},${c}`);
85625
- values.push(cell?.value ?? null);
85093
+ values.push(normalizeCellValue(cell?.value ?? null));
85626
85094
  }
85627
85095
  }
85628
85096
  return values;
@@ -86212,6 +85680,117 @@ var WorksheetViewImpl = class {
86212
85680
  }
86213
85681
  };
86214
85682
 
85683
+ // ../../kernel/src/api/worksheet/what-if.ts
85684
+ init_cjs_shims();
85685
+
85686
+ // ../../kernel/src/api/worksheet/operations/data-table-operations.ts
85687
+ init_cjs_shims();
85688
+ init_errors();
85689
+ async function dataTable(ctx, sheetId, formulaCell, options) {
85690
+ const formulaPos = resolveCell(formulaCell);
85691
+ const formulaCellId = await getCellIdAt2(ctx, sheetId, formulaPos.row, formulaPos.col);
85692
+ if (!formulaCellId) {
85693
+ throw new KernelError("COMPUTE_ERROR", `Formula cell ${formulaCell} has no content.`);
85694
+ }
85695
+ let rowInputCellId = null;
85696
+ if (options.rowInputCell) {
85697
+ const pos = resolveCell(options.rowInputCell);
85698
+ const cid = await getCellIdAt2(ctx, sheetId, pos.row, pos.col);
85699
+ if (!cid) {
85700
+ throw new KernelError(
85701
+ "COMPUTE_ERROR",
85702
+ `Row input cell ${options.rowInputCell} must contain a value before calling dataTable().`
85703
+ );
85704
+ }
85705
+ rowInputCellId = cid;
85706
+ }
85707
+ let colInputCellId = null;
85708
+ if (options.colInputCell) {
85709
+ const pos = resolveCell(options.colInputCell);
85710
+ const cid = await getCellIdAt2(ctx, sheetId, pos.row, pos.col);
85711
+ if (!cid) {
85712
+ throw new KernelError(
85713
+ "COMPUTE_ERROR",
85714
+ `Column input cell ${options.colInputCell} must contain a value before calling dataTable().`
85715
+ );
85716
+ }
85717
+ colInputCellId = cid;
85718
+ }
85719
+ const bridgeResult = await ctx.computeBridge.dataTable({
85720
+ formula_cell: formulaCellId,
85721
+ row_input_cell: rowInputCellId,
85722
+ col_input_cell: colInputCellId,
85723
+ row_values: options.rowValues,
85724
+ col_values: options.colValues
85725
+ });
85726
+ const result = bridgeResult;
85727
+ return {
85728
+ results: result.results,
85729
+ cellCount: result.cellCount ?? result.cell_count ?? 0,
85730
+ elapsedMs: result.elapsedMs ?? result.elapsed_ms ?? 0,
85731
+ cancelled: result.cancelled ?? false
85732
+ };
85733
+ }
85734
+
85735
+ // ../../kernel/src/api/worksheet/operations/goal-seek-operations.ts
85736
+ init_cjs_shims();
85737
+ init_errors();
85738
+ async function goalSeek(ctx, sheetId, targetCell, targetValue, changingCell) {
85739
+ const targetPos = resolveCell(targetCell);
85740
+ const changingPos = resolveCell(changingCell);
85741
+ const formulaCellId = await getCellIdAt2(
85742
+ ctx,
85743
+ sheetId,
85744
+ targetPos.row,
85745
+ targetPos.col
85746
+ );
85747
+ if (!formulaCellId) {
85748
+ throw new KernelError("COMPUTE_ERROR", `Target cell ${targetCell} has no content.`);
85749
+ }
85750
+ const inputCellId = await getCellIdAt2(
85751
+ ctx,
85752
+ sheetId,
85753
+ changingPos.row,
85754
+ changingPos.col
85755
+ );
85756
+ if (!inputCellId) {
85757
+ throw new KernelError("COMPUTE_ERROR", `Changing cell ${changingCell} has no content.`);
85758
+ }
85759
+ const changingData = await getCell(ctx, sheetId, changingPos.row, changingPos.col);
85760
+ const initialGuess = typeof changingData?.value === "number" ? changingData.value : 0;
85761
+ const bridgeResult = await ctx.computeBridge.goalSeek({
85762
+ formula_cell: formulaCellId,
85763
+ target: targetValue,
85764
+ input_cell: inputCellId,
85765
+ initial_guess: initialGuess
85766
+ });
85767
+ const result = bridgeResult;
85768
+ const solutionValue = result.solutionValue ?? result.solution_value;
85769
+ const iterations = result.iterations;
85770
+ if (result.found && solutionValue != null) {
85771
+ await setCell(ctx, sheetId, changingPos.row, changingPos.col, solutionValue);
85772
+ }
85773
+ return {
85774
+ found: result.found,
85775
+ value: solutionValue,
85776
+ iterations
85777
+ };
85778
+ }
85779
+
85780
+ // ../../kernel/src/api/worksheet/what-if.ts
85781
+ var WorksheetWhatIfImpl = class {
85782
+ constructor(ctx, sheetId) {
85783
+ this.ctx = ctx;
85784
+ this.sheetId = sheetId;
85785
+ }
85786
+ async goalSeek(targetCell, targetValue, changingCell) {
85787
+ return goalSeek(this.ctx, this.sheetId, targetCell, targetValue, changingCell);
85788
+ }
85789
+ async dataTable(formulaCell, options) {
85790
+ return dataTable(this.ctx, this.sheetId, formulaCell, options);
85791
+ }
85792
+ };
85793
+
86215
85794
  // ../../kernel/src/api/worksheet/objects.ts
86216
85795
  init_cjs_shims();
86217
85796
  init_errors();
@@ -86915,8 +86494,8 @@ function objectToInfo(obj) {
86915
86494
  flipH: obj.position?.flipH,
86916
86495
  flipV: obj.position?.flipV,
86917
86496
  zIndex: obj.zIndex,
86918
- visible: obj.visible,
86919
- groupId: obj.groupId,
86497
+ visible: "visible" in obj ? obj.visible : void 0,
86498
+ groupId: "groupId" in obj ? obj.groupId : void 0,
86920
86499
  anchorType: obj.position?.anchorType,
86921
86500
  altText: obj.altText
86922
86501
  };
@@ -87129,7 +86708,7 @@ async function getConnectorData(manager, connectorId) {
87129
86708
  }
87130
86709
  async function getGroupMembers(manager, _ctx, sheetId, groupId) {
87131
86710
  const objects = await manager.getObjectsInSheet(sheetId);
87132
- return objects.filter((obj) => obj.groupId === groupId).map((obj) => obj.id);
86711
+ return objects.filter((obj) => "groupId" in obj && obj.groupId === groupId).map((obj) => obj.id);
87133
86712
  }
87134
86713
  function deriveImageFormat(src) {
87135
86714
  const dataUrlMatch = src.match(/^data:image\/([^;,]+)/);
@@ -87178,6 +86757,7 @@ async function getConnectionSiteCount(manager, objectId) {
87178
86757
 
87179
86758
  // ../../kernel/src/api/worksheet/operations/shape-operations.ts
87180
86759
  init_cjs_shims();
86760
+ init_floating_object_mapper();
87181
86761
  function shapeObjectToShape(shape, sheetId) {
87182
86762
  return {
87183
86763
  id: shape.id,
@@ -87217,7 +86797,7 @@ function buildMutationReceipt2(change, action) {
87217
86797
  domain: "floatingObject",
87218
86798
  action,
87219
86799
  id: change.objectId,
87220
- object: change.data,
86800
+ object: change.data ? toFloatingObject(change.data) : createMinimalFloatingObject("shape", change.objectId, ""),
87221
86801
  bounds
87222
86802
  };
87223
86803
  }
@@ -87252,7 +86832,7 @@ async function createShape(ctx, sheetId, config) {
87252
86832
  domain: "floatingObject",
87253
86833
  action: "create",
87254
86834
  id: "",
87255
- object: { id: "", sheetId, type: "shape", shapeType: config.type },
86835
+ object: createMinimalFloatingObject("shape", "", sheetId),
87256
86836
  bounds: {
87257
86837
  x: 0,
87258
86838
  y: 0,
@@ -87342,7 +86922,7 @@ async function updateShape(ctx, sheetId, shapeId, updates) {
87342
86922
  domain: "floatingObject",
87343
86923
  action: "update",
87344
86924
  id: shapeId,
87345
- object: { id: shapeId, sheetId, type: "shape" },
86925
+ object: createMinimalFloatingObject("shape", shapeId, sheetId),
87346
86926
  bounds: { x: 0, y: 0, width: 0, height: 0, rotation: 0 }
87347
86927
  };
87348
86928
  }
@@ -87618,6 +87198,15 @@ var WorksheetObjectsImpl = class {
87618
87198
  async get(objectId) {
87619
87199
  return await getFloatingObject(this.mgr, this.ctx, this.sheetId, objectId);
87620
87200
  }
87201
+ /**
87202
+ * Get the full domain-typed FloatingObject for an object by ID.
87203
+ * Returns the discriminated union variant (ShapeObject, PictureObject, etc.)
87204
+ * directly from the manager, bypassing the API-level FloatingObjectInfo projection.
87205
+ */
87206
+ async getFullObject(objectId) {
87207
+ const obj = await this.mgr.getObject(objectId);
87208
+ return obj ?? null;
87209
+ }
87621
87210
  async computeObjectBounds(objectId) {
87622
87211
  const obj = await this.mgr.getObject(objectId);
87623
87212
  if (!obj) return null;
@@ -87986,7 +87575,7 @@ var WorksheetImpl = class {
87986
87575
  async getValue(a, b) {
87987
87576
  const { row, col } = resolveCell(a, b);
87988
87577
  const data = await getCell(this.ctx, this.sheetId, row, col);
87989
- return data?.value ?? null;
87578
+ return normalizeCellValue(data?.value ?? null);
87990
87579
  }
87991
87580
  async getData() {
87992
87581
  const range2 = await getUsedRange2(this.ctx, this.sheetId);
@@ -87998,7 +87587,7 @@ var WorksheetImpl = class {
87998
87587
  endRow: range2.endRow,
87999
87588
  endCol: range2.endCol
88000
87589
  });
88001
- return cellData.map((row) => row.map((cell) => cell.value ?? null));
87590
+ return cellData.map((row) => row.map((cell) => normalizeCellValue(cell.value ?? null)));
88002
87591
  }
88003
87592
  async getRange(a, b, c, d) {
88004
87593
  const bounds = resolveRange(a, b, c, d);
@@ -88122,7 +87711,7 @@ var WorksheetImpl = class {
88122
87711
  rowData.push({ value: null });
88123
87712
  } else {
88124
87713
  rowData.push({
88125
- value: viewportCellValueToCellValue(vc.value) ?? null,
87714
+ value: normalizeCellValue(vc.value) ?? null,
88126
87715
  formula: vc.formula,
88127
87716
  format: vc.format ?? void 0
88128
87717
  });
@@ -88149,10 +87738,10 @@ var WorksheetImpl = class {
88149
87738
  const { row, col } = resolveCell(address);
88150
87739
  const data = await getCell(this.ctx, this.sheetId, row, col);
88151
87740
  if (!data) return "";
88152
- const displayValue = await getDisplayValue2(this.ctx, this.sheetId, row, col);
88153
- let result = displayValue;
87741
+ const rawValue = cellValueToString(data.value);
87742
+ let result = rawValue;
88154
87743
  if (data.formula) {
88155
- result = displayValue !== "" ? `${displayValue}(${data.formula})` : `(${data.formula})`;
87744
+ result = rawValue !== "" ? `${rawValue}(${data.formula})` : `(${data.formula})`;
88156
87745
  }
88157
87746
  const styleHintsStr = await getStyleHints(this.ctx, this.sheetId, row, col);
88158
87747
  if (styleHintsStr) {
@@ -88193,7 +87782,7 @@ var WorksheetImpl = class {
88193
87782
  row,
88194
87783
  col,
88195
87784
  formula: vc.formula,
88196
- value: viewportCellValueToCellValue(vc.value)
87785
+ value: normalizeCellValue(vc.value)
88197
87786
  });
88198
87787
  }
88199
87788
  }
@@ -88218,8 +87807,8 @@ var WorksheetImpl = class {
88218
87807
  rowValues.push(`${cellAddr}:`);
88219
87808
  continue;
88220
87809
  }
88221
- const displayValue = vc.formatted ?? viewportCellValueToString(vc.value);
88222
- let cellStr = displayValue;
87810
+ const rawValue = cellValueToString(vc.value);
87811
+ let cellStr = rawValue;
88223
87812
  if (vc.formula) {
88224
87813
  const abbreviation = formulaAnalysis.formulaToId.get(`${row},${col}`);
88225
87814
  if (abbreviation) {
@@ -88240,7 +87829,7 @@ var WorksheetImpl = class {
88240
87829
  const styleCells = rangeData.cells.map((vc) => ({
88241
87830
  row: vc.row,
88242
87831
  col: vc.col,
88243
- value: viewportCellValueToCellValue(vc.value),
87832
+ value: normalizeCellValue(vc.value),
88244
87833
  format: vc.format
88245
87834
  }));
88246
87835
  const styleLines = analyzeStylePatterns(styleCells);
@@ -88262,7 +87851,7 @@ var WorksheetImpl = class {
88262
87851
  const leftCellData = leftRange.cells.map((vc) => ({
88263
87852
  row: vc.row,
88264
87853
  col: vc.col,
88265
- value: viewportCellValueToCellValue(vc.value),
87854
+ value: normalizeCellValue(vc.value),
88266
87855
  formatted: vc.formatted ?? void 0,
88267
87856
  indent: 0
88268
87857
  // indent not available from queryRange; would need format.indent
@@ -88291,7 +87880,7 @@ var WorksheetImpl = class {
88291
87880
  const aboveCellData = aboveRange.cells.map((vc) => ({
88292
87881
  row: vc.row,
88293
87882
  col: vc.col,
88294
- value: viewportCellValueToCellValue(vc.value),
87883
+ value: normalizeCellValue(vc.value),
88295
87884
  formatted: vc.formatted ?? void 0
88296
87885
  }));
88297
87886
  const aboveLine = buildAboveContext(
@@ -88394,9 +87983,7 @@ var WorksheetImpl = class {
88394
87983
  }
88395
87984
  const firstRowCells = (rowMap.get(finalRange.startRow) ?? []).slice().sort((a, b) => a.col - b.col);
88396
87985
  if (firstRowCells.length > 0) {
88397
- const allStrings = firstRowCells.every(
88398
- (vc) => typeof vc.value === "string" && !vc.formula
88399
- );
87986
+ const allStrings = firstRowCells.every((vc) => typeof vc.value === "string" && !vc.formula);
88400
87987
  if (allStrings) {
88401
87988
  const headers = firstRowCells.map((vc) => String(vc.value));
88402
87989
  lines.push(`Headers: ${headers.join(", ")}`);
@@ -88432,7 +88019,7 @@ var WorksheetImpl = class {
88432
88019
  const cells = (rowMap.get(row) ?? []).slice().sort((a, b) => a.col - b.col);
88433
88020
  const rowData = [];
88434
88021
  for (const vc of cells) {
88435
- const rawValue = viewportCellValueToString(vc.value);
88022
+ const rawValue = cellValueToString(vc.value);
88436
88023
  const addr = toA12(vc.row, vc.col);
88437
88024
  if (vc.formula) {
88438
88025
  rowData.push(`${addr}:${rawValue}(=${vc.formula})`);
@@ -88640,7 +88227,7 @@ var WorksheetImpl = class {
88640
88227
  fields.push("");
88641
88228
  continue;
88642
88229
  }
88643
- let str = cell.formatted != null && cell.formatted !== "" ? cell.formatted : isCellError(val) ? `#${val.value}!` : String(val);
88230
+ let str = cell.formatted != null && cell.formatted !== "" ? cell.formatted : String(normalizeCellValue(val));
88644
88231
  if (str.length > 0 && "=+-@".includes(str[0])) {
88645
88232
  str = " " + str;
88646
88233
  }
@@ -88693,7 +88280,7 @@ var WorksheetImpl = class {
88693
88280
  const row = cellData[i];
88694
88281
  const obj = {};
88695
88282
  for (let j = 0; j < headers.length; j++) {
88696
- obj[headers[j]] = row[j]?.value ?? null;
88283
+ obj[headers[j]] = normalizeCellValue(row[j]?.value ?? null);
88697
88284
  }
88698
88285
  result.push(obj);
88699
88286
  }
@@ -88744,48 +88331,6 @@ var WorksheetImpl = class {
88744
88331
  });
88745
88332
  return formatValues(this.ctx, bridgeEntries);
88746
88333
  }
88747
- async goalSeek(targetCell, targetValue, changingCell) {
88748
- const sheetId = this.sheetId;
88749
- const targetPos = resolveCell(targetCell);
88750
- const changingPos = resolveCell(changingCell);
88751
- const formulaCellId = await getCellIdAt2(
88752
- this.ctx,
88753
- sheetId,
88754
- targetPos.row,
88755
- targetPos.col
88756
- );
88757
- if (!formulaCellId) {
88758
- throw new KernelError("COMPUTE_ERROR", `Target cell ${targetCell} has no content.`);
88759
- }
88760
- const inputCellId = await getCellIdAt2(
88761
- this.ctx,
88762
- sheetId,
88763
- changingPos.row,
88764
- changingPos.col
88765
- );
88766
- if (!inputCellId) {
88767
- throw new KernelError("COMPUTE_ERROR", `Changing cell ${changingCell} has no content.`);
88768
- }
88769
- const changingData = await getCell(this.ctx, sheetId, changingPos.row, changingPos.col);
88770
- const initialGuess = typeof changingData?.value === "number" ? changingData.value : 0;
88771
- const bridgeResult = await this.ctx.computeBridge.goalSeek({
88772
- formula_cell: formulaCellId,
88773
- target: targetValue,
88774
- input_cell: inputCellId,
88775
- initial_guess: initialGuess
88776
- });
88777
- const result = bridgeResult;
88778
- const solutionValue = result.solutionValue ?? result.solution_value;
88779
- const iterations = result.iterations;
88780
- if (result.found && solutionValue != null) {
88781
- await setCell(this.ctx, sheetId, changingPos.row, changingPos.col, solutionValue);
88782
- }
88783
- return {
88784
- found: result.found,
88785
- value: solutionValue,
88786
- iterations
88787
- };
88788
- }
88789
88334
  // ===========================================================================
88790
88335
  // Visibility
88791
88336
  // ===========================================================================
@@ -88857,7 +88402,7 @@ var WorksheetImpl = class {
88857
88402
  case 1:
88858
88403
  return accessor.numberValue;
88859
88404
  case 2:
88860
- return displayStringOrNull(accessor.displayText);
88405
+ return (0, import_core6.displayStringOrNull)(accessor.displayText);
88861
88406
  case 3:
88862
88407
  return accessor.numberValue !== 0;
88863
88408
  case 4: {
@@ -89123,6 +88668,9 @@ var WorksheetImpl = class {
89123
88668
  get protection() {
89124
88669
  return this._protection ??= new WorksheetProtectionImpl(this.ctx, this.sheetId);
89125
88670
  }
88671
+ get whatIf() {
88672
+ return this._whatIf ??= new WorksheetWhatIfImpl(this.ctx, this.sheetId);
88673
+ }
89126
88674
  get print() {
89127
88675
  return this._print ??= new WorksheetPrintImpl(this.ctx, this.sheetId);
89128
88676
  }
@@ -89354,8 +88902,7 @@ var WorkbookStylesImpl = class {
89354
88902
  this.ctx = ctx;
89355
88903
  }
89356
88904
  async getTableStyles() {
89357
- const styles = await this.ctx.computeBridge.getAllCustomTableStyles();
89358
- return styles;
88905
+ return this.ctx.computeBridge.getAllCustomTableStyles();
89359
88906
  }
89360
88907
  async createTableStyle(config) {
89361
88908
  const result = await this.ctx.computeBridge.createCustomTableStyle(
@@ -89481,7 +89028,7 @@ var WorkbookThemeImpl = class {
89481
89028
 
89482
89029
  // ../../kernel/src/api/workbook/workbook-impl.ts
89483
89030
  init_cjs_shims();
89484
- init_disposable2();
89031
+ init_disposable();
89485
89032
  init_errors();
89486
89033
 
89487
89034
  // ../../kernel/src/domain/form-controls/index.ts
@@ -90068,27 +89615,8 @@ var globalRegistry = new FunctionRegistry();
90068
89615
 
90069
89616
  // ../../spreadsheet-utils/src/function-catalog.ts
90070
89617
  init_cjs_shims();
90071
-
90072
- // ../../contracts/src/utils/function-registry.ts
90073
- init_cjs_shims();
90074
- var FunctionCategory = /* @__PURE__ */ ((FunctionCategory2) => {
90075
- FunctionCategory2["MATH"] = "Math";
90076
- FunctionCategory2["STATISTICAL"] = "Statistical";
90077
- FunctionCategory2["TEXT"] = "Text";
90078
- FunctionCategory2["LOGICAL"] = "Logical";
90079
- FunctionCategory2["DATE_TIME"] = "Date & Time";
90080
- FunctionCategory2["LOOKUP"] = "Lookup & Reference";
90081
- FunctionCategory2["FINANCIAL"] = "Financial";
90082
- FunctionCategory2["INFORMATION"] = "Information";
90083
- FunctionCategory2["DATABASE"] = "Database";
90084
- FunctionCategory2["ENGINEERING"] = "Engineering";
90085
- FunctionCategory2["WEB"] = "Web";
90086
- FunctionCategory2["TESTING"] = "Testing";
90087
- return FunctionCategory2;
90088
- })(FunctionCategory || {});
90089
-
90090
- // ../../spreadsheet-utils/src/function-catalog.ts
90091
- var C = FunctionCategory;
89618
+ var import_function_registry = require("@mog-sdk/spreadsheet-contracts/utils/function-registry");
89619
+ var C = import_function_registry.FunctionCategory;
90092
89620
  var INLINE_FUNCTIONS = [
90093
89621
  // Aggregates
90094
89622
  ["SUM", C.MATH, "Adds all numbers in a range of cells", 1, -1],
@@ -90954,7 +90482,7 @@ function convertToFunctionInfo(metadata) {
90954
90482
 
90955
90483
  // ../../kernel/src/api/workbook/viewport.ts
90956
90484
  init_cjs_shims();
90957
- init_disposable2();
90485
+ init_disposable();
90958
90486
  var regionCounter = 0;
90959
90487
  var ViewportRegionImpl = class extends DisposableBase {
90960
90488
  constructor(sheetId, bounds, computeBridge, viewportId) {
@@ -91008,7 +90536,7 @@ var WorkbookViewportImpl = class {
91008
90536
  };
91009
90537
 
91010
90538
  // ../../kernel/src/api/workbook/workbook-impl.ts
91011
- init_rendering();
90539
+ var import_rendering2 = require("@mog-sdk/spreadsheet-contracts/rendering");
91012
90540
  var API_EVENT_TO_INTERNAL = {
91013
90541
  cellChanged: "cell:changed",
91014
90542
  rangeChanged: "range:changed",
@@ -91302,24 +90830,41 @@ var WorkbookImpl = class {
91302
90830
  timestamp: cp.timestamp
91303
90831
  }));
91304
90832
  }
91305
- async calculate(calculationType) {
91306
- const type = calculationType ?? "full";
91307
- try {
91308
- switch (type) {
91309
- case "recalculate":
91310
- await this.ctx.computeBridge.fullRecalc();
91311
- break;
91312
- case "full":
91313
- await this.ctx.computeBridge.fullRecalc();
91314
- break;
91315
- case "fullRebuild":
91316
- await this.ctx.computeBridge.fullRecalc();
91317
- break;
90833
+ async calculate(options) {
90834
+ const opts = typeof options === "string" ? { calculationType: options } : options ?? {};
90835
+ const recalcOptions = {};
90836
+ if (opts.iterative !== void 0) {
90837
+ if (typeof opts.iterative === "boolean") {
90838
+ recalcOptions.iterative = opts.iterative;
90839
+ } else {
90840
+ recalcOptions.iterative = true;
90841
+ if (opts.iterative.maxIterations !== void 0) {
90842
+ recalcOptions.maxIterations = opts.iterative.maxIterations;
90843
+ }
90844
+ if (opts.iterative.maxChange !== void 0) {
90845
+ recalcOptions.maxChange = opts.iterative.maxChange;
90846
+ }
91318
90847
  }
90848
+ }
90849
+ try {
90850
+ const result = await this.ctx.computeBridge.fullRecalc(recalcOptions);
90851
+ return {
90852
+ hasCircularRefs: result.metrics?.hasCircularRefs ?? false,
90853
+ converged: result.metrics?.iterativeConverged ?? false,
90854
+ iterations: result.metrics?.iterativeIterations ?? 0,
90855
+ maxDelta: result.metrics?.iterativeMaxDelta ?? 0,
90856
+ circularCellCount: result.metrics?.circularCellCount ?? 0
90857
+ };
91319
90858
  } catch (e) {
91320
90859
  const msg = String(e);
91321
90860
  if (msg.includes("Unknown napi method") || msg.includes("not a function") || msg.includes("not found")) {
91322
- return;
90861
+ return {
90862
+ hasCircularRefs: false,
90863
+ converged: false,
90864
+ iterations: 0,
90865
+ maxDelta: 0,
90866
+ circularCellCount: 0
90867
+ };
91323
90868
  }
91324
90869
  throw new KernelError("COMPUTE_ERROR", `Full recalculation failed: ${msg}`);
91325
90870
  }
@@ -91349,7 +90894,10 @@ var WorkbookImpl = class {
91349
90894
  }
91350
90895
  async setIterativeCalculation(enabled) {
91351
90896
  const settings = await this.ctx.computeBridge.getWorkbookSettings();
91352
- const calcSettings = { ...settings.calculationSettings ?? {}, enableIterativeCalculation: enabled };
90897
+ const calcSettings = {
90898
+ ...settings.calculationSettings ?? {},
90899
+ enableIterativeCalculation: enabled
90900
+ };
91353
90901
  await this.ctx.computeBridge.patchWorkbookSettings({
91354
90902
  calculationSettings: calcSettings
91355
90903
  });
@@ -91689,7 +91237,7 @@ var WorkbookImpl = class {
91689
91237
  get theme() {
91690
91238
  return this._theme ??= new WorkbookThemeImpl(
91691
91239
  { ctx: this.ctx, eventBus: this.eventBus },
91692
- DEFAULT_CHROME_THEME
91240
+ import_rendering2.DEFAULT_CHROME_THEME
91693
91241
  );
91694
91242
  }
91695
91243
  get viewport() {
@@ -91778,6 +91326,7 @@ var api_spec_default = {
91778
91326
  viewport: "WorkbookViewport"
91779
91327
  },
91780
91328
  ws: {
91329
+ whatIf: "WorksheetWhatIf",
91781
91330
  smartArt: "WorksheetSmartArt",
91782
91331
  changes: "WorksheetChanges",
91783
91332
  formats: "WorksheetFormats",
@@ -91875,10 +91424,12 @@ var api_spec_default = {
91875
91424
  ]
91876
91425
  },
91877
91426
  calculate: {
91878
- signature: "calculate(calculationType?: CalculationType): Promise<void>;",
91879
- docstring: "Trigger recalculation of formulas.\n@param calculationType - Type of recalculation (default: 'full')\n - 'recalculate' \u2014 recalculate dirty cells only\n - 'full' \u2014 recalculate all cells\n - 'fullRebuild' \u2014 rebuild dependency graph and recalculate all",
91427
+ signature: "calculate(options?: CalculateOptions | CalculationType): Promise<CalculateResult>;",
91428
+ docstring: "Trigger recalculation of formulas.\n@param options - Calculation options, or a CalculationType string for backward compatibility",
91880
91429
  usedTypes: [
91881
- "CalculationType"
91430
+ "CalculateOptions",
91431
+ "CalculationType",
91432
+ "CalculateResult"
91882
91433
  ]
91883
91434
  },
91884
91435
  getCalculationMode: {
@@ -91898,17 +91449,17 @@ var api_spec_default = {
91898
91449
  },
91899
91450
  setIterativeCalculation: {
91900
91451
  signature: "setIterativeCalculation(enabled: boolean): Promise<void>;",
91901
- docstring: "Set whether iterative calculation is enabled for circular references.\nConvenience mutator \u2014 patches `calculationSettings.enableIterativeCalculation`.",
91452
+ docstring: "Set whether iterative calculation is enabled for circular references.\nConvenience mutator \u2014 patches `calculationSettings.enableIterativeCalculation`.\n@deprecated Use calculate({ iterative: ... }) instead.",
91902
91453
  usedTypes: []
91903
91454
  },
91904
91455
  setMaxIterations: {
91905
91456
  signature: "setMaxIterations(n: number): Promise<void>;",
91906
- docstring: "Set the maximum number of iterations for iterative calculation.\nConvenience mutator \u2014 patches `calculationSettings.maxIterations`.",
91457
+ docstring: "Set the maximum number of iterations for iterative calculation.\nConvenience mutator \u2014 patches `calculationSettings.maxIterations`.\n@deprecated Use calculate({ iterative: { maxIterations: n } }) instead.",
91907
91458
  usedTypes: []
91908
91459
  },
91909
91460
  setConvergenceThreshold: {
91910
91461
  signature: "setConvergenceThreshold(threshold: number): Promise<void>;",
91911
- docstring: "Set the convergence threshold (maximum change) for iterative calculation.\nConvenience mutator \u2014 patches `calculationSettings.maxChange`.",
91462
+ docstring: "Set the convergence threshold (maximum change) for iterative calculation.\nConvenience mutator \u2014 patches `calculationSettings.maxChange`.\n@deprecated Use calculate({ iterative: { maxChange: threshold } }) instead.",
91912
91463
  usedTypes: []
91913
91464
  },
91914
91465
  getUsePrecisionAsDisplayed: {
@@ -92366,13 +91917,6 @@ var api_spec_default = {
92366
91917
  "FormatEntry"
92367
91918
  ]
92368
91919
  },
92369
- goalSeek: {
92370
- signature: "goalSeek(targetCell: string, targetValue: number, changingCell: string): Promise<GoalSeekResult>;",
92371
- docstring: "Run a goal seek to find the input value that produces a target result.",
92372
- usedTypes: [
92373
- "GoalSeekResult"
92374
- ]
92375
- },
92376
91920
  isVisible: {
92377
91921
  signature: "isVisible(): boolean;",
92378
91922
  docstring: "Check if the sheet is visible (sync -- local metadata).",
@@ -92894,6 +92438,25 @@ var api_spec_default = {
92894
92438
  }
92895
92439
  }
92896
92440
  },
92441
+ WorksheetWhatIf: {
92442
+ docstring: "Sub-API for What-If analysis operations.",
92443
+ functions: {
92444
+ goalSeek: {
92445
+ signature: "goalSeek(targetCell: string, targetValue: number, changingCell: string): Promise<GoalSeekResult>;",
92446
+ docstring: "Run a goal seek to find the input value that produces a target result.",
92447
+ usedTypes: [
92448
+ "GoalSeekResult"
92449
+ ]
92450
+ },
92451
+ dataTable: {
92452
+ signature: "dataTable(\n formulaCell: string,\n options: {\n rowInputCell?: string | null;\n colInputCell?: string | null;\n rowValues: (string | number | boolean | null)[];\n colValues: (string | number | boolean | null)[];\n },\n ): Promise<DataTableResult>;",
92453
+ docstring: "Evaluate a formula with different input values (What-If Data Table).\n\nOne-variable table: provide either `rowInputCell` or `colInputCell` (not both).\nTwo-variable table: provide both `rowInputCell` and `colInputCell`.\n\nFor one-variable tables, pass an empty array for the unused dimension's values.\n\nInput cells must already contain a value before calling this method.\n\n@param formulaCell - A1 address of the cell containing the formula to evaluate\n@param options - Input cells and substitution values\n@returns 2D grid of computed results",
92454
+ usedTypes: [
92455
+ "DataTableResult"
92456
+ ]
92457
+ }
92458
+ }
92459
+ },
92897
92460
  WorksheetSmartArt: {
92898
92461
  docstring: "",
92899
92462
  functions: {
@@ -93033,7 +92596,18 @@ var api_spec_default = {
93033
92596
  functions: {
93034
92597
  set: {
93035
92598
  signature: "set(address: string, format: CellFormat): Promise<FormatChangeResult>;",
93036
- docstring: 'Set format for a single cell.\n\n@param address - A1-style cell address (e.g. "A1", "B3")\n@param format - Format properties to apply',
92599
+ docstring: `Set format for a single cell.
92600
+
92601
+ @param address - A1-style cell address (e.g. "A1", "B3")
92602
+ @param format - Format properties to apply
92603
+
92604
+ @example
92605
+ // Bold red currency
92606
+ await ws.formats.set('A1', { bold: true, fontColor: '#ff0000', numberFormat: '$#,##0.00' });
92607
+ // Date format
92608
+ await ws.formats.set('B1', { numberFormat: 'YYYY-MM-DD' });
92609
+ // Header style
92610
+ await ws.formats.set('A1', { bold: true, fontSize: 14, backgroundColor: '#4472c4', fontColor: '#ffffff' });`,
93037
92611
  usedTypes: [
93038
92612
  "CellFormat",
93039
92613
  "FormatChangeResult"
@@ -93041,7 +92615,21 @@ var api_spec_default = {
93041
92615
  },
93042
92616
  setRange: {
93043
92617
  signature: "setRange(range: string, format: CellFormat): Promise<FormatChangeResult>;",
93044
- docstring: 'Set format for a contiguous range.\n\n@param range - A1-style range string (e.g. "A1:B2")\n@param format - Format properties to apply',
92618
+ docstring: `Set format for a contiguous range.
92619
+
92620
+ @param range - A1-style range string (e.g. "A1:B2")
92621
+ @param format - Format properties to apply
92622
+
92623
+ @example
92624
+ // Currency column
92625
+ await ws.formats.setRange('B2:B100', { numberFormat: '$#,##0.00' });
92626
+ // Header row with borders
92627
+ await ws.formats.setRange('A1:F1', {
92628
+ bold: true,
92629
+ backgroundColor: '#4472c4',
92630
+ fontColor: '#ffffff',
92631
+ borders: { bottom: { style: 'medium', color: '#2f5496' } }
92632
+ });`,
93045
92633
  usedTypes: [
93046
92634
  "CellFormat",
93047
92635
  "FormatChangeResult"
@@ -93873,7 +93461,7 @@ var api_spec_default = {
93873
93461
  usedTypes: []
93874
93462
  },
93875
93463
  setCriteria: {
93876
- signature: "setCriteria(\n filterId: string,\n col: number,\n criteria: ColumnFilterCriteria,\n ): Promise<void>;",
93464
+ signature: "setCriteria(filterId: string, col: number, criteria: ColumnFilterCriteria): Promise<void>;",
93877
93465
  docstring: "Set filter criteria for a column using filter ID.\n\n@param filterId - Filter ID\n@param col - Column index (0-based)\n@param criteria - Filter criteria to apply",
93878
93466
  usedTypes: [
93879
93467
  "ColumnFilterCriteria"
@@ -95218,8 +94806,8 @@ var api_spec_default = {
95218
94806
  },
95219
94807
  AxisConfig: {
95220
94808
  name: "AxisConfig",
95221
- definition: "{\n xAxis?: {\n type: AxisType;\n title?: string;\n min?: number;\n max?: number;\n gridLines?: boolean;\n /** Show minor gridlines between major gridlines */\n minorGridLines?: boolean;\n majorUnit?: number;\n minorUnit?: number;\n tickMarks?: 'inside' | 'outside' | 'cross' | 'none';\n /** Minor tick mark style (separate from major tickMarks) */\n minorTickMarks?: 'inside' | 'outside' | 'cross' | 'none';\n numberFormat?: string;\n reverse?: boolean;\n visible?: boolean;\n position?: 'bottom' | 'top' | 'left' | 'right';\n logBase?: number;\n displayUnit?: string;\n };\n yAxis?: {\n type: AxisType;\n title?: string;\n min?: number;\n max?: number;\n gridLines?: boolean;\n /** Show minor gridlines between major gridlines */\n minorGridLines?: boolean;\n majorUnit?: number;\n minorUnit?: number;\n tickMarks?: 'inside' | 'outside' | 'cross' | 'none';\n /** Minor tick mark style (separate from major tickMarks) */\n minorTickMarks?: 'inside' | 'outside' | 'cross' | 'none';\n numberFormat?: string;\n reverse?: boolean;\n visible?: boolean;\n position?: 'bottom' | 'top' | 'left' | 'right';\n logBase?: number;\n displayUnit?: string;\n };\n secondaryYAxis?: {\n type: AxisType;\n title?: string;\n min?: number;\n max?: number;\n show: boolean;\n majorUnit?: number;\n minorUnit?: number;\n tickMarks?: 'inside' | 'outside' | 'cross' | 'none';\n /** Minor tick mark style (separate from major tickMarks) */\n minorTickMarks?: 'inside' | 'outside' | 'cross' | 'none';\n numberFormat?: string;\n reverse?: boolean;\n visible?: boolean;\n position?: 'bottom' | 'top' | 'left' | 'right';\n logBase?: number;\n displayUnit?: string;\n };\n}",
95222
- docstring: "Axis configuration"
94809
+ definition: "{\n categoryAxis?: SingleAxisConfig;\n valueAxis?: SingleAxisConfig;\n secondaryCategoryAxis?: SingleAxisConfig;\n secondaryValueAxis?: SingleAxisConfig;\n /** @deprecated Use categoryAxis instead */\n xAxis?: SingleAxisConfig;\n /** @deprecated Use valueAxis instead */\n yAxis?: SingleAxisConfig;\n /** @deprecated Use secondaryValueAxis instead */\n secondaryYAxis?: SingleAxisConfig;\n}",
94810
+ docstring: "Axis configuration (matches AxisData wire type).\n\nWire field names: categoryAxis, valueAxis, secondaryCategoryAxis, secondaryValueAxis.\nLegacy aliases: xAxis, yAxis, secondaryYAxis (mapped in chart-bridge)."
95223
94811
  },
95224
94812
  AxisType: {
95225
94813
  name: "AxisType",
@@ -95374,7 +94962,34 @@ var api_spec_default = {
95374
94962
  CellFormat: {
95375
94963
  name: "CellFormat",
95376
94964
  definition: `{
94965
+ /** Excel-compatible number format code string.
94966
+
94967
+ Common format codes:
94968
+ - Currency: '$#,##0.00'
94969
+ - Accounting: '_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'
94970
+ - Percentage: '0.00%'
94971
+ - Date: 'M/D/YYYY', 'YYYY-MM-DD', 'MMM D, YYYY'
94972
+ - Time: 'h:mm AM/PM', 'HH:mm:ss'
94973
+ - Number: '#,##0.00', '0.00'
94974
+ - Scientific: '0.00E+00'
94975
+ - Text: '@'
94976
+ - Fraction: '# ?/?'
94977
+
94978
+ See the \`formatPresets\` section in api-spec.json for the full catalog
94979
+ of 85+ pre-defined format codes with examples.
94980
+
94981
+ @example
94982
+ // Currency
94983
+ { numberFormat: '$#,##0.00' }
94984
+ // Percentage with 1 decimal
94985
+ { numberFormat: '0.0%' }
94986
+ // ISO date
94987
+ { numberFormat: 'YYYY-MM-DD' } */
95377
94988
  numberFormat?: string;
94989
+ /** Number format category hint. Auto-detected from numberFormat when not set.
94990
+ Valid values: 'general' | 'number' | 'currency' | 'accounting' | 'date' |
94991
+ 'time' | 'percentage' | 'fraction' | 'scientific' | 'text' |
94992
+ 'special' | 'custom' */
95378
94993
  numberFormatType?: NumberFormatType;
95379
94994
  fontFamily?: string;
95380
94995
  fontSize?: number;
@@ -95593,8 +95208,8 @@ Example: { ignoreError: true } to suppress error indicators. */
95593
95208
  },
95594
95209
  ChartBorder: {
95595
95210
  name: "ChartBorder",
95596
- definition: "{\n color?: string;\n width?: number;\n style?: 'solid' | 'dashed' | 'dotted' | 'none';\n}",
95597
- docstring: "Shared chart border configuration"
95211
+ definition: "{\n color?: string;\n width?: number;\n style?: string;\n}",
95212
+ docstring: "Shared chart border configuration (matches ChartBorderData wire type)"
95598
95213
  },
95599
95214
  ChartConfig: {
95600
95215
  name: "ChartConfig",
@@ -95625,7 +95240,10 @@ Example: { ignoreError: true } to suppress error indicators. */
95625
95240
  series?: SeriesConfig[];
95626
95241
  dataLabels?: DataLabelConfig;
95627
95242
  pieSlice?: PieSliceConfig;
95243
+ /** @deprecated Use trendlines[] instead \u2014 kept for backward compat */
95628
95244
  trendline?: TrendlineConfig;
95245
+ /** Wire-compatible trendline array */
95246
+ trendlines?: TrendlineConfig[];
95629
95247
  /** Connect scatter points with lines (scatter-lines variant) */
95630
95248
  showLines?: boolean;
95631
95249
  /** Use smooth curves for scatter lines (scatter-smooth-lines variant) */
@@ -95735,11 +95353,6 @@ that are stored on the chart but not part of the core config schema. */
95735
95353
  definition: "{\n /** Column index to write to (0-indexed) */\n columnIndex: number;\n /** JSONPath or field name to extract from data */\n dataPath: string;\n /** Optional transform formula (receives value as input) */\n transform?: string;\n /** Header text (if headerRow >= 0) */\n headerText?: string;\n}",
95736
95354
  docstring: "Column mapping for a sheet data binding."
95737
95355
  },
95738
- Comment: {
95739
- name: "Comment",
95740
- definition: "{\n id: string;\n cellId: string;\n cellAddress: string;\n text: string;\n author: string;\n threadId?: string;\n resolved?: boolean;\n createdAt?: number;\n parentId?: string;\n authorId?: string;\n modifiedAt?: number;\n content?: RichTextSegment[];\n}",
95741
- docstring: "A cell comment (thread-aware)."
95742
- },
95743
95356
  ConditionalFormat: {
95744
95357
  name: "ConditionalFormat",
95745
95358
  definition: "{\n /** Unique format identifier. */\n id: string;\n /** Cell ranges this format applies to. */\n ranges: CellRange[];\n /** Rules to evaluate (sorted by priority). */\n rules: CFRule[];\n}",
@@ -95797,8 +95410,8 @@ that are stored on the chart but not part of the core config schema. */
95797
95410
  },
95798
95411
  DataLabelConfig: {
95799
95412
  name: "DataLabelConfig",
95800
- definition: "{\n show: boolean;\n position?: 'inside' | 'outside' | 'top' | 'bottom' | 'left' | 'right';\n format?: string;\n showCategoryName?: boolean;\n showSeriesName?: boolean;\n showPercentage?: boolean;\n showBubbleSize?: boolean;\n showLegendKey?: boolean;\n separator?: string;\n /** Show leader lines connecting data labels to their data points (pie/doughnut charts) */\n showLeaderLines?: boolean;\n}",
95801
- docstring: "Data label configuration"
95413
+ definition: "{\n show: boolean;\n position?: string;\n format?: string;\n showValue?: boolean;\n showCategoryName?: boolean;\n showSeriesName?: boolean;\n showPercentage?: boolean;\n showBubbleSize?: boolean;\n showLegendKey?: boolean;\n separator?: string;\n showLeaderLines?: boolean;\n text?: string;\n}",
95414
+ docstring: "Data label configuration (matches DataLabelData wire type)"
95802
95415
  },
95803
95416
  DatePeriod: {
95804
95417
  name: "DatePeriod",
@@ -95852,8 +95465,8 @@ that are stored on the chart but not part of the core config schema. */
95852
95465
  },
95853
95466
  ErrorBarConfig: {
95854
95467
  name: "ErrorBarConfig",
95855
- definition: "{\n visible?: boolean;\n type?: 'fixedValue' | 'percentage' | 'standardDeviation' | 'standardError' | 'custom';\n include?: 'both' | 'plus' | 'minus';\n value?: number;\n}",
95856
- docstring: "Error bar configuration for series"
95468
+ definition: "{\n visible?: boolean;\n direction?: string;\n barType?: string;\n valueType?: string;\n value?: number;\n noEndCap?: boolean;\n}",
95469
+ docstring: "Error bar configuration for series (matches ErrorBarData wire type)"
95857
95470
  },
95858
95471
  ErrorVariant: {
95859
95472
  name: "ErrorVariant",
@@ -95895,7 +95508,7 @@ Used in condition filters where users specify rules like
95895
95508
  },
95896
95509
  FilterDetailInfo: {
95897
95510
  name: "FilterDetailInfo",
95898
- definition: "{\n /** Filter ID */\n id: string;\n /** Resolved numeric range of the filter */\n range: { startRow: number; startCol: number; endRow: number; endCol: number };\n /** Per-column filter criteria, keyed by header cell ID */\n columnFilters: Record<string, ColumnFilterCriteria>;\n}",
95511
+ definition: "{\n /** Filter ID */\n id: string;\n /** Resolved numeric range of the filter */\n range: { startRow: number; startCol: number; endRow: number; endCol: number };\n /** Per-column filter criteria, keyed by header cell ID */\n columnFilters: Record<string, ColumnFilter>;\n}",
95899
95512
  docstring: "Detailed filter information including resolved numeric range and column filters."
95900
95513
  },
95901
95514
  FilterInfo: {
@@ -95910,8 +95523,8 @@ Used in condition filters where users specify rules like
95910
95523
  },
95911
95524
  FilterState: {
95912
95525
  name: "FilterState",
95913
- definition: "{\n /** The range the auto-filter is applied to (A1 notation) */\n range: string;\n /** Per-column filter criteria, keyed by column index */\n columns: Map<number, ColumnFilterCriteria>;\n}",
95914
- docstring: "Current auto-filter state for a sheet."
95526
+ definition: "{\n /** The range the auto-filter is applied to (A1 notation) */\n range: string;\n /** Per-column filter criteria, keyed by column identifier (string) */\n columnFilters: Record<string, ColumnFilter>;\n}",
95527
+ docstring: "API filter state \u2014 derived from Rust FilterState with A1-notation range."
95915
95528
  },
95916
95529
  FloatingObject: {
95917
95530
  name: "FloatingObject",
@@ -96013,13 +95626,8 @@ Used in condition filters where users specify rules like
96013
95626
  },
96014
95627
  LegendConfig: {
96015
95628
  name: "LegendConfig",
96016
- definition: "{\n show: boolean;\n position: LegendPosition;\n visible?: boolean;\n overlay?: boolean;\n font?: ChartFont;\n}",
96017
- docstring: "Legend configuration"
96018
- },
96019
- LegendPosition: {
96020
- name: "LegendPosition",
96021
- definition: "'top' | 'bottom' | 'left' | 'right' | 'none'",
96022
- docstring: "Legend position options"
95629
+ definition: "{\n show: boolean;\n position: string;\n visible: boolean;\n overlay?: boolean;\n font?: ChartFont;\n}",
95630
+ docstring: "Legend configuration (matches LegendData wire type)"
96023
95631
  },
96024
95632
  LineDash: {
96025
95633
  name: "LineDash",
@@ -96084,7 +95692,7 @@ Used in condition filters where users specify rules like
96084
95692
  Note: {
96085
95693
  name: "Note",
96086
95694
  definition: "{\n content: string;\n author: string;\n cellAddress: string;\n}",
96087
- docstring: "A cell note (simple, single string per cell)."
95695
+ docstring: "A cell note (simple, single string per cell). API-only type (no Rust equivalent)."
96088
95696
  },
96089
95697
  NumberFormatCategory: {
96090
95698
  name: "NumberFormatCategory",
@@ -96105,11 +95713,6 @@ Used in condition filters where users specify rules like
96105
95713
  },
96106
95714
  docstring: "Number format category classification.\nMatches the FormatType enum from Rust compute-formats."
96107
95715
  },
96108
- NumberFormatType: {
96109
- name: "NumberFormatType",
96110
- definition: "| 'general'\n | 'number'\n | 'currency'\n | 'accounting'\n | 'date'\n | 'time'\n | 'percentage'\n | 'fraction'\n | 'scientific'\n | 'text'\n | 'special'\n | 'custom'",
96111
- docstring: "Number format types"
96112
- },
96113
95716
  ObjectAnchorType: {
96114
95717
  name: "ObjectAnchorType",
96115
95718
  definition: "| 'twoCell' // Anchored to two cells (moves and resizes with cells)\n | 'oneCell' // Anchored to one cell (moves but doesn't resize)\n | 'absolute'",
@@ -96221,8 +95824,8 @@ Used in condition filters where users specify rules like
96221
95824
  },
96222
95825
  PieSliceConfig: {
96223
95826
  name: "PieSliceConfig",
96224
- definition: "{\n /** Index of slice to explode (pull out from center) */\n explodedIndex?: number;\n /** Array of indices to explode */\n explodedIndices?: number[];\n /** Distance to explode (0-1, default 0.1) */\n explodeOffset?: number;\n /** Allow clicking to select/explode slices */\n selectable?: boolean;\n}",
96225
- docstring: "Pie/doughnut slice configuration for exploded slices"
95827
+ definition: "{\n explosion?: number;\n explodedIndices?: number[];\n explodeOffset?: number;\n}",
95828
+ docstring: "Pie/doughnut slice configuration (matches PieSliceData wire type)"
96226
95829
  },
96227
95830
  PivotQueryRecord: {
96228
95831
  name: "PivotQueryRecord",
@@ -96261,8 +95864,8 @@ Used in condition filters where users specify rules like
96261
95864
  },
96262
95865
  PointFormat: {
96263
95866
  name: "PointFormat",
96264
- definition: "{\n fill?: string;\n border?: ChartBorder;\n dataLabel?: DataLabelConfig;\n}",
96265
- docstring: "Per-point formatting for individual data points in a series"
95867
+ definition: "{\n idx: number;\n fill?: string;\n border?: ChartBorder;\n dataLabel?: DataLabelConfig;\n}",
95868
+ docstring: "Per-point formatting for individual data points (matches PointFormatData wire type)"
96266
95869
  },
96267
95870
  PrintSettings: {
96268
95871
  name: "PrintSettings",
@@ -96311,11 +95914,6 @@ Used in condition filters where users specify rules like
96311
95914
  definition: "{\n [K in keyof CellFormat]-?: CellFormat[K] | null;\n}",
96312
95915
  docstring: "Dense cell format where every property is explicitly present (null when unset). Returned by formats.get()."
96313
95916
  },
96314
- RichTextSegment: {
96315
- name: "RichTextSegment",
96316
- definition: "{\n text: string;\n bold?: boolean;\n italic?: boolean;\n underline?: boolean;\n strikethrough?: boolean;\n color?: string;\n fontName?: string;\n fontSize?: number;\n}",
96317
- docstring: "A single segment of rich text content."
96318
- },
96319
95917
  Scenario: {
96320
95918
  name: "Scenario",
96321
95919
  definition: "{\n /** Unique scenario ID */\n id: string;\n /** Creation timestamp (Unix ms) */\n createdAt: number;\n}",
@@ -96343,46 +95941,8 @@ Used in condition filters where users specify rules like
96343
95941
  },
96344
95942
  SeriesConfig: {
96345
95943
  name: "SeriesConfig",
96346
- definition: `{
96347
- name?: string;
96348
- type?: ChartType;
96349
- color?: string;
96350
- yAxisIndex?: 0 | 1;
96351
- showMarkers?: boolean;
96352
- markerSize?: number;
96353
- markerStyle?: | 'circle'
96354
- | 'dash'
96355
- | 'diamond'
96356
- | 'dot'
96357
- | 'picture'
96358
- | 'plus'
96359
- | 'square'
96360
- | 'star'
96361
- | 'triangle'
96362
- | 'x'
96363
- | 'auto'
96364
- | 'none';
96365
- lineWidth?: number;
96366
- smooth?: boolean;
96367
- dataLabels?: DataLabelConfig;
96368
- trendline?: TrendlineConfig;
96369
- errorBars?: ErrorBarConfig;
96370
- /** Separate X-axis error bars (for scatter/bubble charts) */
96371
- xErrorBars?: ErrorBarConfig;
96372
- /** Separate Y-axis error bars (for scatter/bubble charts) */
96373
- yErrorBars?: ErrorBarConfig;
96374
- /** Whether to invert the fill color for negative values */
96375
- invertIfNegative?: boolean;
96376
- /** Explosion distance for pie/doughnut per-series (0-400%) */
96377
- explosion?: number;
96378
- /** Data values range in A1 notation (e.g., "B2:B10") */
96379
- values?: string;
96380
- /** Category labels range in A1 notation (e.g., "A2:A10") */
96381
- categories?: string;
96382
- /** Per-point formatting overrides */
96383
- points?: PointFormat[];
96384
- }`,
96385
- docstring: "Individual series configuration"
95944
+ definition: "{\n name?: string;\n type?: string;\n color?: string;\n values?: string;\n categories?: string;\n bubbleSize?: string;\n smooth?: boolean;\n explosion?: number;\n invertIfNegative?: boolean;\n yAxisIndex?: number;\n showMarkers?: boolean;\n markerSize?: number;\n markerStyle?: string;\n lineWidth?: number;\n points?: PointFormat[];\n dataLabels?: DataLabelConfig;\n trendlines?: TrendlineConfig[];\n errorBars?: ErrorBarConfig;\n xErrorBars?: ErrorBarConfig;\n yErrorBars?: ErrorBarConfig;\n idx?: number;\n order?: number;\n /** @deprecated Use trendlines[] instead */\n trendline?: TrendlineConfig;\n}",
95945
+ docstring: "Individual series configuration (matches ChartSeriesData wire type)"
96386
95946
  },
96387
95947
  SeriesOrientation: {
96388
95948
  name: "SeriesOrientation",
@@ -96459,6 +96019,11 @@ Used in condition filters where users specify rules like
96459
96019
  definition: "{\n /** Sheet ID */\n id: string;\n /** Sheet name */\n name: string;\n /** Sheet index (0-based) */\n index: number;\n /** Range containing all non-empty cells (A1 notation), or null if empty */\n usedRange: string | null;\n /** Number of cells with data */\n cellCount: number;\n /** Number of cells with formulas */\n formulaCount: number;\n /** Number of charts in this sheet */\n chartCount: number;\n /** Sheet dimensions */\n dimensions: { rows: number; cols: number };\n}",
96460
96020
  docstring: "A summary snapshot of a single sheet."
96461
96021
  },
96022
+ SingleAxisConfig: {
96023
+ name: "SingleAxisConfig",
96024
+ definition: "{\n title?: string;\n visible: boolean;\n min?: number;\n max?: number;\n axisType?: string;\n gridLines?: boolean;\n minorGridLines?: boolean;\n majorUnit?: number;\n minorUnit?: number;\n tickMarks?: string;\n minorTickMarks?: string;\n numberFormat?: string;\n reverse?: boolean;\n position?: string;\n logBase?: number;\n displayUnit?: string;\n /** @deprecated Alias for axisType \u2014 kept for backward compat with charts package */\n type?: AxisType;\n /** @deprecated Alias for visible \u2014 kept for backward compat with charts package */\n show?: boolean;\n}",
96025
+ docstring: "Single axis configuration (matches SingleAxisData wire type)."
96026
+ },
96462
96027
  Slicer: {
96463
96028
  name: "Slicer",
96464
96029
  definition: "{\n /** Currently selected filter items */\n selectedItems: CellValue[];\n /** Position and dimensions in pixels */\n position: { x: number; y: number; width: number; height: number };\n}",
@@ -96466,7 +96031,7 @@ Used in condition filters where users specify rules like
96466
96031
  },
96467
96032
  SlicerConfig: {
96468
96033
  name: "SlicerConfig",
96469
- definition: "{\n /** Name of the table to connect the slicer to */\n tableName?: string;\n /** Column name within the table to filter on */\n columnName?: string;\n /** Display name for the slicer (auto-generated if omitted) */\n name?: string;\n /** Position and dimensions in pixels */\n position?: { x: number; y: number; width: number; height: number };\n /** Data source connection (rich alternative to tableName/columnName) */\n source?: SlicerSource;\n /** Slicer caption (header text) */\n caption?: string;\n /** Style configuration (partial for incremental updates) */\n style?: Partial<SlicerStyle>;\n /** Show slicer header */\n showHeader?: boolean;\n /** Currently selected date range start (timeline slicers) */\n selectedStartDate?: number;\n /** Currently selected date range end (timeline slicers) */\n selectedEndDate?: number;\n /** Current aggregation level (timeline slicers) */\n timelineLevel?: TimelineLevel;\n}",
96034
+ definition: "{\n /** Slicer ID (generated if omitted) */\n id?: string;\n /** Sheet ID the slicer belongs to */\n sheetId?: string;\n /** Name of the table to connect the slicer to */\n tableName?: string;\n /** Column name within the table to filter on */\n columnName?: string;\n /** Display name for the slicer (auto-generated if omitted) */\n name?: string;\n /** Position and dimensions in pixels */\n position?: { x: number; y: number; width: number; height: number };\n /** Data source connection (rich alternative to tableName/columnName) */\n source?: SlicerSource;\n /** Slicer caption (header text) */\n caption?: string;\n /** Style configuration */\n style?: SlicerStyle;\n /** Show slicer header */\n showHeader?: boolean;\n /** Z-order within the sheet */\n zIndex?: number;\n /** Whether slicer position is locked */\n locked?: boolean;\n /** Whether multi-select is enabled */\n multiSelect?: boolean;\n /** Initial selected values */\n selectedValues?: CellValue[];\n /** Currently selected date range start (timeline slicers) */\n selectedStartDate?: number;\n /** Currently selected date range end (timeline slicers) */\n selectedEndDate?: number;\n /** Current aggregation level (timeline slicers) */\n timelineLevel?: TimelineLevel;\n}",
96470
96035
  docstring: "Configuration for creating a new slicer."
96471
96036
  },
96472
96037
  SlicerCustomStyle: {
@@ -96576,13 +96141,13 @@ Used in condition filters where users specify rules like
96576
96141
  },
96577
96142
  TableColumn: {
96578
96143
  name: "TableColumn",
96579
- definition: "{\n /** Column header name */\n name: string;\n /** Column index within the table (0-based) */\n index: number;\n /** Total row function type */\n totalFunction?: TotalFunction;\n /** Calculated column formula */\n calculatedFormula?: string;\n}",
96580
- docstring: "A single column in a table."
96144
+ definition: "{\n /** Unique column ID */\n id: string;\n /** Column header name */\n name: string;\n /** Column index within the table (0-based) */\n index: number;\n /** Total row function type */\n totalsFunction: TotalsFunction | null;\n /** Total row label */\n totalsLabel: string | null;\n /** Calculated column formula */\n calculatedFormula?: string;\n}",
96145
+ docstring: "A single column in a table.\n\nField names match the Rust-generated `TableColumn` type (compute-types.gen.ts)."
96581
96146
  },
96582
96147
  TableInfo: {
96583
96148
  name: "TableInfo",
96584
- definition: "{\n /** Internal table identifier (opaque string) */\n id?: string;\n /** Table name */\n name: string;\n /** Table range in A1 notation */\n range: string;\n /** Whether the table has a header row */\n hasHeaders: boolean;\n /** Table style preset name */\n style?: TableStylePreset;\n /** Column definitions */\n columns: TableColumn[];\n /** Whether the total row is visible */\n showTotals?: boolean;\n /** Whether first column is highlighted */\n highlightFirstColumn?: boolean;\n /** Whether last column is highlighted */\n highlightLastColumn?: boolean;\n /** Whether banded columns are shown */\n showBandedColumns?: boolean;\n /** Whether banded rows are shown */\n showBandedRows?: boolean;\n /** Whether filter buttons are shown */\n showFilterButton?: boolean;\n /** Whether the header row is shown (mirrors hasHeaders) */\n showHeaders?: boolean;\n}",
96585
- docstring: "Information about an existing table."
96149
+ definition: "{\n /** Internal table identifier */\n id: string;\n /** Table name */\n name: string;\n /** Display name */\n displayName: string;\n /** Sheet the table belongs to */\n sheetId: string;\n /** Table range in A1 notation (converted from Rust SheetRange) */\n range: string;\n /** Column definitions */\n columns: TableColumn[];\n /** Whether the table has a header row */\n hasHeaderRow: boolean;\n /** Whether the totals row is visible */\n hasTotalsRow: boolean;\n /** Table style name */\n style: string;\n /** Whether banded rows are shown */\n bandedRows: boolean;\n /** Whether banded columns are shown */\n bandedColumns: boolean;\n /** Whether first column is emphasized */\n emphasizeFirstColumn: boolean;\n /** Whether last column is emphasized */\n emphasizeLastColumn: boolean;\n /** Whether filter buttons are shown */\n showFilterButtons: boolean;\n}",
96150
+ docstring: "Information about an existing table.\n\nField names match the Rust-generated `Table` type (compute-types.gen.ts)\nexcept `range` which is converted from `SheetRange` to A1 notation string."
96586
96151
  },
96587
96152
  TableOptions: {
96588
96153
  name: "TableOptions",
@@ -96594,16 +96159,6 @@ Used in condition filters where users specify rules like
96594
96159
  definition: "{\n /** Style name */\n name: string;\n}",
96595
96160
  docstring: "Configuration for creating/updating a custom table style."
96596
96161
  },
96597
- TableStyleInfo: {
96598
- name: "TableStyleInfo",
96599
- definition: "{\n /** Style name/ID */\n name: string;\n /** Display name */\n displayName?: string;\n /** Whether this is a built-in style */\n isBuiltIn?: boolean;\n}",
96600
- docstring: "Information about a custom table style."
96601
- },
96602
- TableStylePreset: {
96603
- name: "TableStylePreset",
96604
- definition: "| 'none'\n // Light styles\n | 'light1'\n | 'light2'\n | 'light3'\n | 'light4'\n | 'light5'\n | 'light6'\n | 'light7'\n | 'light8'\n | 'light9'\n | 'light10'\n | 'light11'\n | 'light12'\n | 'light13'\n | 'light14'\n | 'light15'\n | 'light16'\n | 'light17'\n | 'light18'\n | 'light19'\n | 'light20'\n | 'light21'\n // Medium styles\n | 'medium1'\n | 'medium2'\n | 'medium3'\n | 'medium4'\n | 'medium5'\n | 'medium6'\n | 'medium7'\n | 'medium8'\n | 'medium9'\n | 'medium10'\n | 'medium11'\n | 'medium12'\n | 'medium13'\n | 'medium14'\n | 'medium15'\n | 'medium16'\n | 'medium17'\n | 'medium18'\n | 'medium19'\n | 'medium20'\n | 'medium21'\n | 'medium22'\n | 'medium23'\n | 'medium24'\n | 'medium25'\n | 'medium26'\n | 'medium27'\n | 'medium28'\n // Dark styles\n | 'dark1'\n | 'dark2'\n | 'dark3'\n | 'dark4'\n | 'dark5'\n | 'dark6'\n | 'dark7'\n | 'dark8'\n | 'dark9'\n | 'dark10'\n | 'dark11'",
96605
- docstring: "Table style presets matching Excel's table style gallery.\nLight styles (1-21), Medium styles (1-28), Dark styles (1-11)."
96606
- },
96607
96162
  TextBoxBorder: {
96608
96163
  name: "TextBoxBorder",
96609
96164
  definition: "{\n /** Corner radius in pixels (for rounded corners) */\n radius?: number;\n}",
@@ -96663,20 +96218,15 @@ Used in condition filters where users specify rules like
96663
96218
  definition: "{\n text?: string;\n visible?: boolean;\n position?: 'top' | 'bottom' | 'left' | 'right' | 'overlay';\n font?: ChartFont;\n}",
96664
96219
  docstring: "Rich title configuration"
96665
96220
  },
96666
- TotalFunction: {
96667
- name: "TotalFunction",
96668
- definition: "| 'none'\n | 'sum'\n | 'count'\n | 'average'\n | 'min'\n | 'max'\n | 'stdDev'\n | 'var'\n | 'countNums'\n | 'custom'",
96669
- docstring: "Total row function types.\nMaps to Excel's total row dropdown options."
96221
+ TotalsFunction: {
96222
+ name: "TotalsFunction",
96223
+ definition: "| 'average'\n | 'count'\n | 'countNums'\n | 'max'\n | 'min'\n | 'stdDev'\n | 'sum'\n | 'var'\n | 'custom'\n | 'none'",
96224
+ docstring: "Totals function type (matches Rust TotalsFunction)."
96670
96225
  },
96671
96226
  TrendlineConfig: {
96672
96227
  name: "TrendlineConfig",
96673
- definition: "{\n show: boolean;\n type: TrendlineType;\n color?: string;\n lineWidth?: number;\n showEquation?: boolean;\n showR2?: boolean;\n order?: number;\n period?: number;\n intercept?: number;\n forwardPeriod?: number;\n backwardPeriod?: number;\n name?: string;\n}",
96674
- docstring: "Trendline configuration"
96675
- },
96676
- TrendlineType: {
96677
- name: "TrendlineType",
96678
- definition: "| 'linear'\n | 'exponential'\n | 'logarithmic'\n | 'polynomial'\n | 'power'\n | 'moving-average'",
96679
- docstring: "Trendline types for scatter charts"
96228
+ definition: "{\n show?: boolean;\n type?: string;\n color?: string;\n lineWidth?: number;\n order?: number;\n period?: number;\n forward?: number;\n backward?: number;\n intercept?: number;\n displayEquation?: boolean;\n displayRSquared?: boolean;\n name?: string;\n /** @deprecated Use displayEquation instead */\n showEquation?: boolean;\n /** @deprecated Use displayRSquared instead */\n showR2?: boolean;\n /** @deprecated Use forward instead */\n forwardPeriod?: number;\n /** @deprecated Use backward instead */\n backwardPeriod?: number;\n}",
96229
+ docstring: "Trendline configuration (matches TrendlineData wire type)"
96680
96230
  },
96681
96231
  UndoHistoryEntry: {
96682
96232
  name: "UndoHistoryEntry",
@@ -96795,6 +96345,415 @@ Used in condition filters where users specify rules like
96795
96345
  definition: "{\n /** All sheets in the workbook */\n sheets: SheetSnapshot[];\n /** ID of the currently active sheet */\n activeSheetId: string;\n /** Total number of sheets */\n sheetCount: number;\n}",
96796
96346
  docstring: "A summary snapshot of the entire workbook state."
96797
96347
  }
96348
+ },
96349
+ formatPresets: {
96350
+ general: {
96351
+ default: {
96352
+ code: "General",
96353
+ description: "",
96354
+ example: "1234.5"
96355
+ }
96356
+ },
96357
+ number: {
96358
+ integer: {
96359
+ code: "0",
96360
+ description: "No decimal places",
96361
+ example: "1235"
96362
+ },
96363
+ decimal1: {
96364
+ code: "0.0",
96365
+ description: "1 decimal place",
96366
+ example: "1234.5"
96367
+ },
96368
+ decimal2: {
96369
+ code: "0.00",
96370
+ description: "2 decimal places",
96371
+ example: "1234.50"
96372
+ },
96373
+ decimal3: {
96374
+ code: "0.000",
96375
+ description: "3 decimal places",
96376
+ example: "1234.500"
96377
+ },
96378
+ thousands: {
96379
+ code: "#,##0",
96380
+ description: "Thousands separator, no decimals",
96381
+ example: "1,235"
96382
+ },
96383
+ thousandsDecimal1: {
96384
+ code: "#,##0.0",
96385
+ description: "Thousands separator, 1 decimal",
96386
+ example: "1,234.5"
96387
+ },
96388
+ thousandsDecimal2: {
96389
+ code: "#,##0.00",
96390
+ description: "Thousands separator, 2 decimals",
96391
+ example: "1,234.50"
96392
+ },
96393
+ negativeRed: {
96394
+ code: "#,##0.00;[Red]-#,##0.00",
96395
+ description: "Red negative numbers",
96396
+ example: "-1,234.50"
96397
+ },
96398
+ negativeParens: {
96399
+ code: "#,##0.00;(#,##0.00)",
96400
+ description: "Parentheses for negatives",
96401
+ example: "(1,234.50)"
96402
+ },
96403
+ negativeParensRed: {
96404
+ code: "#,##0.00;[Red](#,##0.00)",
96405
+ description: "Red parentheses for negatives",
96406
+ example: "(1,234.50)"
96407
+ }
96408
+ },
96409
+ currency: {
96410
+ usd: {
96411
+ code: "$#,##0.00",
96412
+ description: "US Dollar",
96413
+ example: "$1,234.50"
96414
+ },
96415
+ usdNegMinus: {
96416
+ code: "$#,##0.00;-$#,##0.00",
96417
+ description: "USD minus",
96418
+ example: "-$1,234.50"
96419
+ },
96420
+ usdNegParens: {
96421
+ code: "$#,##0.00;($#,##0.00)",
96422
+ description: "USD parentheses",
96423
+ example: "($1,234.50)"
96424
+ },
96425
+ usdNegRed: {
96426
+ code: "$#,##0.00;[Red]-$#,##0.00",
96427
+ description: "USD red minus",
96428
+ example: "-$1,234.50"
96429
+ },
96430
+ usdNegParensRed: {
96431
+ code: "$#,##0.00;[Red]($#,##0.00)",
96432
+ description: "USD red parentheses",
96433
+ example: "($1,234.50)"
96434
+ },
96435
+ eur: {
96436
+ code: "\u20AC#,##0.00",
96437
+ description: "Euro",
96438
+ example: "\u20AC1,234.50"
96439
+ },
96440
+ gbp: {
96441
+ code: "\xA3#,##0.00",
96442
+ description: "British Pound",
96443
+ example: "\xA31,234.50"
96444
+ },
96445
+ jpy: {
96446
+ code: "\xA5#,##0",
96447
+ description: "Japanese Yen (no decimals)",
96448
+ example: "\xA51,235"
96449
+ },
96450
+ cny: {
96451
+ code: "\xA5#,##0.00",
96452
+ description: "Chinese Yuan",
96453
+ example: "\xA51,234.50"
96454
+ },
96455
+ inr: {
96456
+ code: "\u20B9#,##0.00",
96457
+ description: "Indian Rupee",
96458
+ example: "\u20B91,234.50"
96459
+ },
96460
+ krw: {
96461
+ code: "\u20A9#,##0",
96462
+ description: "Korean Won (no decimals)",
96463
+ example: "\u20A91,235"
96464
+ },
96465
+ chf: {
96466
+ code: "CHF #,##0.00",
96467
+ description: "Swiss Franc",
96468
+ example: "CHF 1,234.50"
96469
+ },
96470
+ cad: {
96471
+ code: "CA$#,##0.00",
96472
+ description: "Canadian Dollar",
96473
+ example: "CA$1,234.50"
96474
+ },
96475
+ aud: {
96476
+ code: "A$#,##0.00",
96477
+ description: "Australian Dollar",
96478
+ example: "A$1,234.50"
96479
+ }
96480
+ },
96481
+ accounting: {
96482
+ usd: {
96483
+ code: '_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)',
96484
+ description: "USD Accounting",
96485
+ example: "$ 1,234.50"
96486
+ },
96487
+ eur: {
96488
+ code: '_(\u20AC* #,##0.00_);_(\u20AC* (#,##0.00);_(\u20AC* "-"??_);_(@_)',
96489
+ description: "EUR Accounting",
96490
+ example: "\u20AC 1,234.50"
96491
+ },
96492
+ gbp: {
96493
+ code: '_(\xA3* #,##0.00_);_(\xA3* (#,##0.00);_(\xA3* "-"??_);_(@_)',
96494
+ description: "GBP Accounting",
96495
+ example: "\xA3 1,234.50"
96496
+ }
96497
+ },
96498
+ date: {
96499
+ shortUS: {
96500
+ code: "m/d/yyyy",
96501
+ description: "Short date (US)",
96502
+ example: "12/13/2025"
96503
+ },
96504
+ mediumUS: {
96505
+ code: "mmm d, yyyy",
96506
+ description: "Medium date (US)",
96507
+ example: "Dec 13, 2025"
96508
+ },
96509
+ longUS: {
96510
+ code: "mmmm d, yyyy",
96511
+ description: "Long date (US)",
96512
+ example: "December 13, 2025"
96513
+ },
96514
+ fullUS: {
96515
+ code: "dddd, mmmm d, yyyy",
96516
+ description: "Full date (US)",
96517
+ example: "Saturday, December 13, 2025"
96518
+ },
96519
+ iso: {
96520
+ code: "yyyy-mm-dd",
96521
+ description: "ISO 8601",
96522
+ example: "2025-12-13"
96523
+ },
96524
+ shortEU: {
96525
+ code: "d/m/yyyy",
96526
+ description: "Short date (EU)",
96527
+ example: "13/12/2025"
96528
+ },
96529
+ mediumEU: {
96530
+ code: "d mmm yyyy",
96531
+ description: "Medium date (EU)",
96532
+ example: "13 Dec 2025"
96533
+ },
96534
+ longEU: {
96535
+ code: "d mmmm yyyy",
96536
+ description: "Long date (EU)",
96537
+ example: "13 December 2025"
96538
+ },
96539
+ monthYear: {
96540
+ code: "mmmm yyyy",
96541
+ description: "Month and year",
96542
+ example: "December 2025"
96543
+ },
96544
+ monthYearShort: {
96545
+ code: "mmm yyyy",
96546
+ description: "Short month and year",
96547
+ example: "Dec 2025"
96548
+ },
96549
+ dayMonth: {
96550
+ code: "d mmmm",
96551
+ description: "Day and month",
96552
+ example: "13 December"
96553
+ },
96554
+ dayMonthShort: {
96555
+ code: "d mmm",
96556
+ description: "Short day and month",
96557
+ example: "13 Dec"
96558
+ },
96559
+ excelShort: {
96560
+ code: "m/d/yy",
96561
+ description: "Excel short date",
96562
+ example: "12/13/25"
96563
+ },
96564
+ excelMedium: {
96565
+ code: "d-mmm-yy",
96566
+ description: "Excel medium date",
96567
+ example: "13-Dec-25"
96568
+ },
96569
+ excelLong: {
96570
+ code: "d-mmm-yyyy",
96571
+ description: "Excel long date",
96572
+ example: "13-Dec-2025"
96573
+ }
96574
+ },
96575
+ time: {
96576
+ short12: {
96577
+ code: "h:mm AM/PM",
96578
+ description: "12-hour short",
96579
+ example: "3:45 PM"
96580
+ },
96581
+ long12: {
96582
+ code: "h:mm:ss AM/PM",
96583
+ description: "12-hour with seconds",
96584
+ example: "3:45:30 PM"
96585
+ },
96586
+ short24: {
96587
+ code: "HH:mm",
96588
+ description: "24-hour short",
96589
+ example: "15:45"
96590
+ },
96591
+ long24: {
96592
+ code: "HH:mm:ss",
96593
+ description: "24-hour with seconds",
96594
+ example: "15:45:30"
96595
+ },
96596
+ dateTime12: {
96597
+ code: "m/d/yyyy h:mm AM/PM",
96598
+ description: "Date and 12-hour time",
96599
+ example: "12/13/2025 3:45 PM"
96600
+ },
96601
+ dateTime24: {
96602
+ code: "yyyy-mm-dd HH:mm",
96603
+ description: "ISO date and 24-hour time",
96604
+ example: "2025-12-13 15:45"
96605
+ },
96606
+ durationHM: {
96607
+ code: "[h]:mm",
96608
+ description: "Hours and minutes (elapsed)",
96609
+ example: "25:30"
96610
+ },
96611
+ durationHMS: {
96612
+ code: "[h]:mm:ss",
96613
+ description: "Hours, minutes, seconds (elapsed)",
96614
+ example: "25:30:45"
96615
+ },
96616
+ durationMS: {
96617
+ code: "[mm]:ss",
96618
+ description: "Minutes and seconds (elapsed)",
96619
+ example: "1530:45"
96620
+ }
96621
+ },
96622
+ percentage: {
96623
+ integer: {
96624
+ code: "0%",
96625
+ description: "No decimal places",
96626
+ example: "50%"
96627
+ },
96628
+ decimal1: {
96629
+ code: "0.0%",
96630
+ description: "1 decimal place",
96631
+ example: "50.0%"
96632
+ },
96633
+ decimal2: {
96634
+ code: "0.00%",
96635
+ description: "2 decimal places",
96636
+ example: "50.00%"
96637
+ },
96638
+ decimal3: {
96639
+ code: "0.000%",
96640
+ description: "3 decimal places",
96641
+ example: "50.000%"
96642
+ }
96643
+ },
96644
+ fraction: {
96645
+ halves: {
96646
+ code: "# ?/2",
96647
+ description: "Halves (1/2)",
96648
+ example: "1 1/2"
96649
+ },
96650
+ quarters: {
96651
+ code: "# ?/4",
96652
+ description: "Quarters (1/4)",
96653
+ example: "1 1/4"
96654
+ },
96655
+ eighths: {
96656
+ code: "# ?/8",
96657
+ description: "Eighths (1/8)",
96658
+ example: "1 3/8"
96659
+ },
96660
+ sixteenths: {
96661
+ code: "# ??/16",
96662
+ description: "Sixteenths (1/16)",
96663
+ example: "1 5/16"
96664
+ },
96665
+ tenths: {
96666
+ code: "# ?/10",
96667
+ description: "Tenths (1/10)",
96668
+ example: "1 3/10"
96669
+ },
96670
+ hundredths: {
96671
+ code: "# ??/100",
96672
+ description: "Hundredths (1/100)",
96673
+ example: "1 25/100"
96674
+ },
96675
+ upToOneDigit: {
96676
+ code: "# ?/?",
96677
+ description: "Up to one digit (1/4)",
96678
+ example: "1 2/3"
96679
+ },
96680
+ upToTwoDigits: {
96681
+ code: "# ??/??",
96682
+ description: "Up to two digits (21/25)",
96683
+ example: "1 25/67"
96684
+ },
96685
+ upToThreeDigits: {
96686
+ code: "# ???/???",
96687
+ description: "Up to three digits (312/943)",
96688
+ example: "1 312/943"
96689
+ }
96690
+ },
96691
+ scientific: {
96692
+ default: {
96693
+ code: "0.00E+00",
96694
+ description: "2 decimal places",
96695
+ example: "1.23E+03"
96696
+ },
96697
+ decimal1: {
96698
+ code: "0.0E+00",
96699
+ description: "1 decimal place",
96700
+ example: "1.2E+03"
96701
+ },
96702
+ decimal3: {
96703
+ code: "0.000E+00",
96704
+ description: "3 decimal places",
96705
+ example: "1.235E+03"
96706
+ },
96707
+ noDecimals: {
96708
+ code: "0E+00",
96709
+ description: "No decimal places",
96710
+ example: "1E+03"
96711
+ }
96712
+ },
96713
+ text: {
96714
+ default: {
96715
+ code: "@",
96716
+ description: "Display as entered",
96717
+ example: "1234"
96718
+ }
96719
+ },
96720
+ special: {
96721
+ zipCode: {
96722
+ code: "00000",
96723
+ description: "ZIP Code (5-digit)",
96724
+ example: "01234"
96725
+ },
96726
+ zipPlus4: {
96727
+ code: "00000-0000",
96728
+ description: "ZIP+4 Code",
96729
+ example: "01234-5678"
96730
+ },
96731
+ phone: {
96732
+ code: "(###) ###-####",
96733
+ description: "Phone Number",
96734
+ example: "(555) 123-4567"
96735
+ },
96736
+ ssn: {
96737
+ code: "000-00-0000",
96738
+ description: "Social Security Number",
96739
+ example: "123-45-6789"
96740
+ }
96741
+ },
96742
+ custom: {}
96743
+ },
96744
+ defaultFormats: {
96745
+ accounting: '_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)',
96746
+ currency: "$#,##0.00",
96747
+ custom: "General",
96748
+ date: "m/d/yyyy",
96749
+ fraction: "# ?/?",
96750
+ general: "General",
96751
+ number: "#,##0.00",
96752
+ percentage: "0.00%",
96753
+ scientific: "0.00E+00",
96754
+ special: "00000",
96755
+ text: "@",
96756
+ time: "h:mm AM/PM"
96798
96757
  }
96799
96758
  };
96800
96759