@mog-sdk/node 0.1.12 → 0.1.14

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.js CHANGED
@@ -67,10 +67,45 @@ function activeCellToStoreCellData(data, row, col) {
67
67
  }
68
68
  async function getData(ctx, sheetId, row, col) {
69
69
  const cellId = await ctx.computeBridge.getCellIdAt(sheetId, row, col);
70
- if (!cellId) return void 0;
71
- const data = await ctx.computeBridge.getActiveCell(sheetId, cellId);
72
- if (!data) return void 0;
73
- return activeCellToStoreCellData(data, row, col);
70
+ if (cellId) {
71
+ const data = await ctx.computeBridge.getActiveCell(sheetId, cellId);
72
+ if (data) return activeCellToStoreCellData(data, row, col);
73
+ }
74
+ const cellData = await ctx.computeBridge.getCellData(sheetId, row, col);
75
+ if (cellData != null) {
76
+ const obj = cellData;
77
+ const rawValue = obj.value ?? obj.raw;
78
+ if (rawValue != null) {
79
+ const value = parseMirrorValue(rawValue);
80
+ if (value !== null && value !== void 0) {
81
+ return {
82
+ id: obj.cell_id ?? obj.cellId ?? "",
83
+ row,
84
+ col,
85
+ raw: value
86
+ };
87
+ }
88
+ }
89
+ }
90
+ return void 0;
91
+ }
92
+ function parseMirrorValue(json) {
93
+ if (typeof json !== "object" || json === null) return null;
94
+ const obj = json;
95
+ switch (obj.type) {
96
+ case "number":
97
+ return obj.value;
98
+ case "text":
99
+ return obj.value;
100
+ case "boolean":
101
+ return obj.value;
102
+ case "error":
103
+ return obj.value;
104
+ case "null":
105
+ return null;
106
+ default:
107
+ return null;
108
+ }
74
109
  }
75
110
  function getEffectiveValue(data) {
76
111
  if (data.formula !== void 0) {
@@ -272,6 +307,36 @@ var init_errors = __esm({
272
307
  }
273
308
  });
274
309
 
310
+ // ../../contracts/src/document/protection.ts
311
+ var DEFAULT_PROTECTION_OPTIONS, DEFAULT_WORKBOOK_PROTECTION_OPTIONS;
312
+ var init_protection = __esm({
313
+ "../../contracts/src/document/protection.ts"() {
314
+ "use strict";
315
+ init_esm_shims();
316
+ DEFAULT_PROTECTION_OPTIONS = {
317
+ // Selection defaults to true (users can always select cells)
318
+ selectLockedCells: true,
319
+ selectUnlockedCells: true,
320
+ // All other operations blocked by default
321
+ insertRows: false,
322
+ insertColumns: false,
323
+ deleteRows: false,
324
+ deleteColumns: false,
325
+ formatCells: false,
326
+ formatColumns: false,
327
+ formatRows: false,
328
+ sort: false,
329
+ useAutoFilter: false,
330
+ usePivotTableReports: false,
331
+ editObjects: false,
332
+ editScenarios: false
333
+ };
334
+ DEFAULT_WORKBOOK_PROTECTION_OPTIONS = {
335
+ structure: true
336
+ };
337
+ }
338
+ });
339
+
275
340
  // ../../infra/transport/src/command-metadata.gen.ts
276
341
  var BYTES_TUPLE_COMMANDS, RECALC_COMMANDS;
277
342
  var init_command_metadata_gen = __esm({
@@ -751,165 +816,6 @@ var init_napi_transport = __esm({
751
816
  }
752
817
  });
753
818
 
754
- // ../../node_modules/.pnpm/@tauri-apps+api@2.10.1/node_modules/@tauri-apps/api/external/tslib/tslib.es6.js
755
- function __classPrivateFieldGet(receiver, state, kind, f) {
756
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
757
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
758
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
759
- }
760
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
761
- if (kind === "m") throw new TypeError("Private method is not writable");
762
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
763
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
764
- return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
765
- }
766
- var init_tslib_es6 = __esm({
767
- "../../node_modules/.pnpm/@tauri-apps+api@2.10.1/node_modules/@tauri-apps/api/external/tslib/tslib.es6.js"() {
768
- "use strict";
769
- init_esm_shims();
770
- }
771
- });
772
-
773
- // ../../node_modules/.pnpm/@tauri-apps+api@2.10.1/node_modules/@tauri-apps/api/core.js
774
- var core_exports = {};
775
- __export(core_exports, {
776
- Channel: () => Channel,
777
- PluginListener: () => PluginListener,
778
- Resource: () => Resource,
779
- SERIALIZE_TO_IPC_FN: () => SERIALIZE_TO_IPC_FN,
780
- addPluginListener: () => addPluginListener,
781
- checkPermissions: () => checkPermissions,
782
- convertFileSrc: () => convertFileSrc,
783
- invoke: () => invoke,
784
- isTauri: () => isTauri2,
785
- requestPermissions: () => requestPermissions,
786
- transformCallback: () => transformCallback
787
- });
788
- function transformCallback(callback, once = false) {
789
- return window.__TAURI_INTERNALS__.transformCallback(callback, once);
790
- }
791
- async function addPluginListener(plugin, event, cb) {
792
- const handler = new Channel(cb);
793
- try {
794
- await invoke(`plugin:${plugin}|register_listener`, {
795
- event,
796
- handler
797
- });
798
- return new PluginListener(plugin, event, handler.id);
799
- } catch {
800
- await invoke(`plugin:${plugin}|registerListener`, { event, handler });
801
- return new PluginListener(plugin, event, handler.id);
802
- }
803
- }
804
- async function checkPermissions(plugin) {
805
- return invoke(`plugin:${plugin}|check_permissions`);
806
- }
807
- async function requestPermissions(plugin) {
808
- return invoke(`plugin:${plugin}|request_permissions`);
809
- }
810
- async function invoke(cmd, args = {}, options) {
811
- return window.__TAURI_INTERNALS__.invoke(cmd, args, options);
812
- }
813
- function convertFileSrc(filePath, protocol = "asset") {
814
- return window.__TAURI_INTERNALS__.convertFileSrc(filePath, protocol);
815
- }
816
- function isTauri2() {
817
- return !!(globalThis || window).isTauri;
818
- }
819
- var _Channel_onmessage, _Channel_nextMessageIndex, _Channel_pendingMessages, _Channel_messageEndIndex, _Resource_rid, SERIALIZE_TO_IPC_FN, Channel, PluginListener, Resource;
820
- var init_core = __esm({
821
- "../../node_modules/.pnpm/@tauri-apps+api@2.10.1/node_modules/@tauri-apps/api/core.js"() {
822
- "use strict";
823
- init_esm_shims();
824
- init_tslib_es6();
825
- SERIALIZE_TO_IPC_FN = "__TAURI_TO_IPC_KEY__";
826
- Channel = class {
827
- constructor(onmessage) {
828
- _Channel_onmessage.set(this, void 0);
829
- _Channel_nextMessageIndex.set(this, 0);
830
- _Channel_pendingMessages.set(this, []);
831
- _Channel_messageEndIndex.set(this, void 0);
832
- __classPrivateFieldSet(this, _Channel_onmessage, onmessage || (() => {
833
- }), "f");
834
- this.id = transformCallback((rawMessage) => {
835
- const index = rawMessage.index;
836
- if ("end" in rawMessage) {
837
- if (index == __classPrivateFieldGet(this, _Channel_nextMessageIndex, "f")) {
838
- this.cleanupCallback();
839
- } else {
840
- __classPrivateFieldSet(this, _Channel_messageEndIndex, index, "f");
841
- }
842
- return;
843
- }
844
- const message = rawMessage.message;
845
- if (index == __classPrivateFieldGet(this, _Channel_nextMessageIndex, "f")) {
846
- __classPrivateFieldGet(this, _Channel_onmessage, "f").call(this, message);
847
- __classPrivateFieldSet(this, _Channel_nextMessageIndex, __classPrivateFieldGet(this, _Channel_nextMessageIndex, "f") + 1, "f");
848
- while (__classPrivateFieldGet(this, _Channel_nextMessageIndex, "f") in __classPrivateFieldGet(this, _Channel_pendingMessages, "f")) {
849
- const message2 = __classPrivateFieldGet(this, _Channel_pendingMessages, "f")[__classPrivateFieldGet(this, _Channel_nextMessageIndex, "f")];
850
- __classPrivateFieldGet(this, _Channel_onmessage, "f").call(this, message2);
851
- delete __classPrivateFieldGet(this, _Channel_pendingMessages, "f")[__classPrivateFieldGet(this, _Channel_nextMessageIndex, "f")];
852
- __classPrivateFieldSet(this, _Channel_nextMessageIndex, __classPrivateFieldGet(this, _Channel_nextMessageIndex, "f") + 1, "f");
853
- }
854
- if (__classPrivateFieldGet(this, _Channel_nextMessageIndex, "f") === __classPrivateFieldGet(this, _Channel_messageEndIndex, "f")) {
855
- this.cleanupCallback();
856
- }
857
- } else {
858
- __classPrivateFieldGet(this, _Channel_pendingMessages, "f")[index] = message;
859
- }
860
- });
861
- }
862
- cleanupCallback() {
863
- window.__TAURI_INTERNALS__.unregisterCallback(this.id);
864
- }
865
- set onmessage(handler) {
866
- __classPrivateFieldSet(this, _Channel_onmessage, handler, "f");
867
- }
868
- get onmessage() {
869
- return __classPrivateFieldGet(this, _Channel_onmessage, "f");
870
- }
871
- [(_Channel_onmessage = /* @__PURE__ */ new WeakMap(), _Channel_nextMessageIndex = /* @__PURE__ */ new WeakMap(), _Channel_pendingMessages = /* @__PURE__ */ new WeakMap(), _Channel_messageEndIndex = /* @__PURE__ */ new WeakMap(), SERIALIZE_TO_IPC_FN)]() {
872
- return `__CHANNEL__:${this.id}`;
873
- }
874
- toJSON() {
875
- return this[SERIALIZE_TO_IPC_FN]();
876
- }
877
- };
878
- PluginListener = class {
879
- constructor(plugin, event, channelId) {
880
- this.plugin = plugin;
881
- this.event = event;
882
- this.channelId = channelId;
883
- }
884
- async unregister() {
885
- return invoke(`plugin:${this.plugin}|remove_listener`, {
886
- event: this.event,
887
- channelId: this.channelId
888
- });
889
- }
890
- };
891
- Resource = class {
892
- get rid() {
893
- return __classPrivateFieldGet(this, _Resource_rid, "f");
894
- }
895
- constructor(rid) {
896
- _Resource_rid.set(this, void 0);
897
- __classPrivateFieldSet(this, _Resource_rid, rid, "f");
898
- }
899
- /**
900
- * Destroys and cleans up this resource from memory.
901
- * **You should not call any method on this object anymore and should drop any reference to it.**
902
- */
903
- async close() {
904
- return invoke("plugin:resources|close", {
905
- rid: this.rid
906
- });
907
- }
908
- };
909
- _Resource_rid = /* @__PURE__ */ new WeakMap();
910
- }
911
- });
912
-
913
819
  // ../../infra/transport/src/tauri-transport.ts
914
820
  function createTauriTransport() {
915
821
  let invokeFunc = null;
@@ -917,8 +823,8 @@ function createTauriTransport() {
917
823
  async call(command, args) {
918
824
  let fn = invokeFunc;
919
825
  if (!fn) {
920
- const { invoke: invoke2 } = await Promise.resolve().then(() => (init_core(), core_exports));
921
- fn = invoke2;
826
+ const { invoke } = await import("@tauri-apps/api/core");
827
+ fn = invoke;
922
828
  invokeFunc = fn;
923
829
  }
924
830
  try {
@@ -2180,6 +2086,101 @@ var init_mutation_result_handler = __esm({
2180
2086
  }
2181
2087
  });
2182
2088
 
2089
+ // ../../contracts/src/core/commands.ts
2090
+ var init_commands = __esm({
2091
+ "../../contracts/src/core/commands.ts"() {
2092
+ "use strict";
2093
+ init_esm_shims();
2094
+ }
2095
+ });
2096
+
2097
+ // ../../contracts/src/core/core.ts
2098
+ var init_core = __esm({
2099
+ "../../contracts/src/core/core.ts"() {
2100
+ "use strict";
2101
+ init_esm_shims();
2102
+ }
2103
+ });
2104
+
2105
+ // ../../contracts/src/core/disposable.ts
2106
+ var init_disposable = __esm({
2107
+ "../../contracts/src/core/disposable.ts"() {
2108
+ "use strict";
2109
+ init_esm_shims();
2110
+ }
2111
+ });
2112
+
2113
+ // ../../contracts/src/core/event-base.ts
2114
+ var init_event_base = __esm({
2115
+ "../../contracts/src/core/event-base.ts"() {
2116
+ "use strict";
2117
+ init_esm_shims();
2118
+ }
2119
+ });
2120
+
2121
+ // ../../contracts/src/core/execution.ts
2122
+ var init_execution = __esm({
2123
+ "../../contracts/src/core/execution.ts"() {
2124
+ "use strict";
2125
+ init_esm_shims();
2126
+ }
2127
+ });
2128
+
2129
+ // ../../contracts/src/core/result.ts
2130
+ var init_result = __esm({
2131
+ "../../contracts/src/core/result.ts"() {
2132
+ "use strict";
2133
+ init_esm_shims();
2134
+ }
2135
+ });
2136
+
2137
+ // ../../contracts/src/core/schema.ts
2138
+ var init_schema = __esm({
2139
+ "../../contracts/src/core/schema.ts"() {
2140
+ "use strict";
2141
+ init_esm_shims();
2142
+ }
2143
+ });
2144
+
2145
+ // ../../contracts/src/core/formatted-text.ts
2146
+ function asFormattedText(s) {
2147
+ return s;
2148
+ }
2149
+ function displayStringOrNull(text) {
2150
+ return text;
2151
+ }
2152
+ var init_formatted_text = __esm({
2153
+ "../../contracts/src/core/formatted-text.ts"() {
2154
+ "use strict";
2155
+ init_esm_shims();
2156
+ }
2157
+ });
2158
+
2159
+ // ../../contracts/src/core/testing.ts
2160
+ var init_testing = __esm({
2161
+ "../../contracts/src/core/testing.ts"() {
2162
+ "use strict";
2163
+ init_esm_shims();
2164
+ }
2165
+ });
2166
+
2167
+ // ../../contracts/src/core/index.ts
2168
+ var init_core2 = __esm({
2169
+ "../../contracts/src/core/index.ts"() {
2170
+ "use strict";
2171
+ init_esm_shims();
2172
+ init_commands();
2173
+ init_core();
2174
+ init_disposable();
2175
+ init_event_base();
2176
+ init_execution();
2177
+ init_result();
2178
+ init_schema();
2179
+ init_formatted_text();
2180
+ init_testing();
2181
+ }
2182
+ });
2183
+
2183
2184
  // ../../kernel/src/bridges/wire/constants.gen.ts
2184
2185
  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;
2185
2186
  var init_constants_gen = __esm({
@@ -2237,12 +2238,12 @@ var init_constants_gen = __esm({
2237
2238
  });
2238
2239
 
2239
2240
  // ../../kernel/src/bridges/wire/binary-mutation-reader.ts
2240
- import { asFormattedText } from "@mog-sdk/spreadsheet-contracts/core";
2241
2241
  var sharedDecoder, BinaryMutationReader;
2242
2242
  var init_binary_mutation_reader = __esm({
2243
2243
  "../../kernel/src/bridges/wire/binary-mutation-reader.ts"() {
2244
2244
  "use strict";
2245
2245
  init_esm_shims();
2246
+ init_core2();
2246
2247
  init_constants_gen();
2247
2248
  sharedDecoder = new TextDecoder("utf-8");
2248
2249
  BinaryMutationReader = class {
@@ -2536,7 +2537,6 @@ var init_binary_mutation_reader = __esm({
2536
2537
  });
2537
2538
 
2538
2539
  // ../../kernel/src/bridges/wire/binary-viewport-buffer.ts
2539
- import { asFormattedText as asFormattedText2, displayStringOrNull } from "@mog-sdk/spreadsheet-contracts/core";
2540
2540
  function rgbaU32ToHex(value) {
2541
2541
  const r = value >>> 24 & 255;
2542
2542
  const g = value >>> 16 & 255;
@@ -2548,6 +2548,7 @@ var init_binary_viewport_buffer = __esm({
2548
2548
  "../../kernel/src/bridges/wire/binary-viewport-buffer.ts"() {
2549
2549
  "use strict";
2550
2550
  init_esm_shims();
2551
+ init_core2();
2551
2552
  init_constants_gen();
2552
2553
  init_constants_gen();
2553
2554
  sharedEncoder = new TextEncoder();
@@ -3644,7 +3645,7 @@ var init_binary_viewport_buffer = __esm({
3644
3645
  */
3645
3646
  get displayText() {
3646
3647
  const decoded = this._buffer.getOrDecodeString(this._displayOff, this._displayLen);
3647
- return decoded !== null ? asFormattedText2(decoded) : null;
3648
+ return decoded !== null ? asFormattedText(decoded) : null;
3648
3649
  }
3649
3650
  /**
3650
3651
  * Get the error text for the current cell.
@@ -3703,7 +3704,6 @@ var init_binary_viewport_buffer = __esm({
3703
3704
  });
3704
3705
 
3705
3706
  // ../../kernel/src/bridges/wire/viewport-coordinator.ts
3706
- import { displayStringOrNull as displayStringOrNull2 } from "@mog-sdk/spreadsheet-contracts/core";
3707
3707
  function cellKey(row, col) {
3708
3708
  return `${row},${col}`;
3709
3709
  }
@@ -3713,6 +3713,7 @@ var init_viewport_coordinator = __esm({
3713
3713
  "use strict";
3714
3714
  init_esm_shims();
3715
3715
  init_binary_viewport_buffer();
3716
+ init_core2();
3716
3717
  ViewportCoordinator = class {
3717
3718
  constructor(viewportId) {
3718
3719
  /** Monotonically increasing version, incremented on every write. */
@@ -3833,7 +3834,7 @@ var init_viewport_coordinator = __esm({
3833
3834
  flags: reader.patchFlags(i),
3834
3835
  numberValue: reader.patchNumberValue(i),
3835
3836
  formatIdx: reader.patchFormatIdx(i),
3836
- displayString: displayStringOrNull2(reader.patchDisplayText(i)),
3837
+ displayString: displayStringOrNull(reader.patchDisplayText(i)),
3837
3838
  errorString: reader.patchErrorText(i),
3838
3839
  bgColorOverride: reader.patchBgColorOverride(i),
3839
3840
  fontColorOverride: reader.patchFontColorOverride(i),
@@ -3850,7 +3851,7 @@ var init_viewport_coordinator = __esm({
3850
3851
  flags: reader.spillPatchFlags(i),
3851
3852
  numberValue: reader.spillPatchNumberValue(i),
3852
3853
  formatIdx: reader.spillPatchFormatIdx(i),
3853
- displayString: displayStringOrNull2(reader.spillPatchDisplayText(i)),
3854
+ displayString: displayStringOrNull(reader.spillPatchDisplayText(i)),
3854
3855
  errorString: reader.spillPatchErrorText(i),
3855
3856
  bgColorOverride: reader.spillPatchBgColorOverride(i),
3856
3857
  fontColorOverride: reader.spillPatchFontColorOverride(i),
@@ -5010,10 +5011,11 @@ var init_compute_core = __esm({
5010
5011
  * Requires at least CONTEXT_SET phase (the engine may or may not have been started yet).
5011
5012
  * After fullRecalc completes, the bridge transitions to STARTED phase.
5012
5013
  */
5013
- async fullRecalc() {
5014
+ async fullRecalc(options) {
5014
5015
  this.ensurePhase("CONTEXT_SET", "fullRecalc");
5015
5016
  const result = await this.transport.call("compute_full_recalc", {
5016
- docId: this.docId
5017
+ docId: this.docId,
5018
+ options: options ?? {}
5017
5019
  });
5018
5020
  this._phase = "STARTED";
5019
5021
  this.mutationHandler?.applyAndNotify({ recalc: result });
@@ -6649,6 +6651,9 @@ var init_compute_bridge_gen = __esm({
6649
6651
  pivotUnregisterDef(sheetId, pivotName) {
6650
6652
  return this.core.mutatePlain(this.core.transport.call("compute_pivot_unregister_def", { docId: this.core.docId, sheetId, pivotName }));
6651
6653
  }
6654
+ pivotMaterialize(sheetId, pivotId, expansionState) {
6655
+ return this.core.query(this.core.transport.call("compute_pivot_materialize", { docId: this.core.docId, sheetId, pivotId, expansionState }));
6656
+ }
6652
6657
  registerViewport(viewportId, sheetId, startRow, startCol, endRow, endCol) {
6653
6658
  return this.core.mutatePlain(this.core.transport.call("compute_register_viewport", { docId: this.core.docId, viewportId, sheetId, startRow, startCol, endRow, endCol }));
6654
6659
  }
@@ -6711,7 +6716,6 @@ __export(compute_bridge_exports, {
6711
6716
  wireTableToTableConfig: () => wireTableToTableConfig,
6712
6717
  wireToIdentityFormula: () => wireToIdentityFormula
6713
6718
  });
6714
- import { DEFAULT_PROTECTION_OPTIONS } from "@mog-sdk/spreadsheet-contracts/protection";
6715
6719
  function emptyMutationResult() {
6716
6720
  return {
6717
6721
  recalc: {
@@ -6782,6 +6786,7 @@ var init_compute_bridge = __esm({
6782
6786
  "use strict";
6783
6787
  init_esm_shims();
6784
6788
  init_formula_string();
6789
+ init_protection();
6785
6790
  init_src();
6786
6791
  init_compute_wire_converters();
6787
6792
  init_compute_core();
@@ -6905,8 +6910,8 @@ var init_compute_bridge = __esm({
6905
6910
  // ===========================================================================
6906
6911
  // Error Recovery delegates
6907
6912
  // ===========================================================================
6908
- fullRecalc() {
6909
- return this.core.fullRecalc();
6913
+ fullRecalc(options) {
6914
+ return this.core.fullRecalc(options);
6910
6915
  }
6911
6916
  exportToXlsxBytes() {
6912
6917
  return this.core.exportToXlsxBytes();
@@ -7207,8 +7212,65 @@ var init_compute_bridge = __esm({
7207
7212
  }
7208
7213
  });
7209
7214
 
7215
+ // ../../contracts/src/rendering/grid-renderer.ts
7216
+ var init_grid_renderer = __esm({
7217
+ "../../contracts/src/rendering/grid-renderer.ts"() {
7218
+ "use strict";
7219
+ init_esm_shims();
7220
+ }
7221
+ });
7222
+
7223
+ // ../../contracts/src/rendering/constants.ts
7224
+ var DEFAULT_COL_WIDTH_WINDOWS, DEFAULT_COL_WIDTH_MACOS, _isMac, DEFAULT_COL_WIDTH;
7225
+ var init_constants = __esm({
7226
+ "../../contracts/src/rendering/constants.ts"() {
7227
+ "use strict";
7228
+ init_esm_shims();
7229
+ DEFAULT_COL_WIDTH_WINDOWS = 64;
7230
+ DEFAULT_COL_WIDTH_MACOS = 72;
7231
+ _isMac = typeof navigator !== "undefined" && /Mac/.test(navigator.platform ?? "");
7232
+ DEFAULT_COL_WIDTH = _isMac ? DEFAULT_COL_WIDTH_MACOS : DEFAULT_COL_WIDTH_WINDOWS;
7233
+ }
7234
+ });
7235
+
7236
+ // ../../contracts/src/rendering/data-sources.ts
7237
+ var DEFAULT_CHROME_THEME;
7238
+ var init_data_sources = __esm({
7239
+ "../../contracts/src/rendering/data-sources.ts"() {
7240
+ "use strict";
7241
+ init_esm_shims();
7242
+ DEFAULT_CHROME_THEME = {
7243
+ canvasBackground: "#ffffff",
7244
+ gridlineColor: "#e0e0e0",
7245
+ headerBackground: "#f8f9fa",
7246
+ headerText: "#333333",
7247
+ headerBorder: "#dadce0",
7248
+ headerHighlightBackground: "#e8eaed",
7249
+ headerHighlightText: "#1a73e8",
7250
+ selectionFill: "rgba(66, 133, 244, 0.1)",
7251
+ selectionBorder: "#4285f4",
7252
+ activeCellBorder: "#1a73e8",
7253
+ fillHandleColor: "#4285f4",
7254
+ dragSourceColor: "rgba(66, 133, 244, 0.15)",
7255
+ dragTargetColor: "#4285f4",
7256
+ scrollbarTrack: "#f1f1f1",
7257
+ scrollbarThumb: "#c1c1c1"
7258
+ };
7259
+ }
7260
+ });
7261
+
7262
+ // ../../contracts/src/rendering/index.ts
7263
+ var init_rendering = __esm({
7264
+ "../../contracts/src/rendering/index.ts"() {
7265
+ "use strict";
7266
+ init_esm_shims();
7267
+ init_grid_renderer();
7268
+ init_constants();
7269
+ init_data_sources();
7270
+ }
7271
+ });
7272
+
7210
7273
  // ../../kernel/src/domain/sheets/sheet-meta-defaults.ts
7211
- import { DEFAULT_COL_WIDTH as _PLATFORM_COL_WIDTH } from "@mog-sdk/spreadsheet-contracts/rendering";
7212
7274
  function getSheetMetaDefault(field) {
7213
7275
  const def = SHEET_META_SCHEMA[field];
7214
7276
  return def.default;
@@ -7218,8 +7280,9 @@ var init_sheet_meta_defaults = __esm({
7218
7280
  "../../kernel/src/domain/sheets/sheet-meta-defaults.ts"() {
7219
7281
  "use strict";
7220
7282
  init_esm_shims();
7283
+ init_rendering();
7221
7284
  SHEET_META_DEFAULT_ROW_HEIGHT = 20;
7222
- SHEET_META_DEFAULT_COL_WIDTH = _PLATFORM_COL_WIDTH;
7285
+ SHEET_META_DEFAULT_COL_WIDTH = DEFAULT_COL_WIDTH;
7223
7286
  SHEET_META_DEFAULT_GRIDLINE_COLOR = "#e2e2e2";
7224
7287
  SHEET_META_SCHEMA = {
7225
7288
  // ===========================================================================
@@ -7748,7 +7811,6 @@ var init_sheet_meta = __esm({
7748
7811
  });
7749
7812
 
7750
7813
  // ../../spreadsheet-utils/src/range.ts
7751
- import { MAX_COLS, MAX_ROWS } from "@mog-sdk/spreadsheet-contracts/core";
7752
7814
  function normalizeRange(range2) {
7753
7815
  return {
7754
7816
  startRow: Math.min(range2.startRow, range2.endRow),
@@ -7764,6 +7826,7 @@ var init_range = __esm({
7764
7826
  "../../spreadsheet-utils/src/range.ts"() {
7765
7827
  "use strict";
7766
7828
  init_esm_shims();
7829
+ init_core2();
7767
7830
  }
7768
7831
  });
7769
7832
 
@@ -7791,6 +7854,15 @@ function letterToCol(letters) {
7791
7854
  function toA12(row, col) {
7792
7855
  return `${colToLetter3(col)}${row + 1}`;
7793
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
+ }
7794
7866
  function parseCellAddress(ref) {
7795
7867
  const match = ref.match(CELL_ADDRESS_REGEX);
7796
7868
  if (!match) return null;
@@ -9220,7 +9292,7 @@ var init_data_extractor = __esm({
9220
9292
  });
9221
9293
 
9222
9294
  // ../../charts/src/core/index.ts
9223
- var init_core2 = __esm({
9295
+ var init_core3 = __esm({
9224
9296
  "../../charts/src/core/index.ts"() {
9225
9297
  "use strict";
9226
9298
  init_esm_shims();
@@ -13204,7 +13276,7 @@ var init_src2 = __esm({
13204
13276
  "../../charts/src/index.ts"() {
13205
13277
  "use strict";
13206
13278
  init_esm_shims();
13207
- init_core2();
13279
+ init_core3();
13208
13280
  init_primitives();
13209
13281
  init_compiler();
13210
13282
  }
@@ -13217,6 +13289,15 @@ __export(chart_bridge_exports, {
13217
13289
  createChartBridge: () => createChartBridge,
13218
13290
  initChartWasm: () => initChartWasm
13219
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
+ }
13220
13301
  function toChartConfig(chart) {
13221
13302
  return {
13222
13303
  type: chart.chartType ?? "bar",
@@ -13231,12 +13312,13 @@ function toChartConfig(chart) {
13231
13312
  title: chart.title,
13232
13313
  subtitle: chart.subtitle,
13233
13314
  legend: chart.legend,
13234
- axis: chart.axis,
13315
+ axis: chart.axis ? normalizeAxisForRendering(chart.axis) : chart.axis,
13235
13316
  colors: chart.colors,
13236
13317
  series: chart.series,
13237
13318
  dataLabels: chart.dataLabels,
13238
13319
  pieSlice: chart.pieSlice,
13239
- trendline: chart.trendline,
13320
+ trendline: Array.isArray(chart.trendline) ? chart.trendline[0] : chart.trendline,
13321
+ trendlines: chart.trendline,
13240
13322
  showLines: chart.showLines,
13241
13323
  smoothLines: chart.smoothLines,
13242
13324
  radarFilled: chart.radarFilled,
@@ -13252,7 +13334,7 @@ function toChartConfig(chart) {
13252
13334
  splitType: chart.splitType,
13253
13335
  splitValue: chart.splitValue,
13254
13336
  subType: chart.subType,
13255
- extra: chart.definition
13337
+ extra: chart.ooxml
13256
13338
  };
13257
13339
  }
13258
13340
  function initChartWasm(exports) {
@@ -13650,7 +13732,7 @@ var init_chart_bridge = __esm({
13650
13732
  type: "nominal"
13651
13733
  };
13652
13734
  }
13653
- 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;
13654
13736
  let titleSpec;
13655
13737
  if (chart.title) {
13656
13738
  titleSpec = {
@@ -13692,7 +13774,7 @@ var init_chart_bridge = __esm({
13692
13774
  if (chart.colors && chart.colors.length > 0) {
13693
13775
  specConfig.range = { category: chart.colors };
13694
13776
  }
13695
- 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;
13696
13778
  if (chartArea?.fill && typeof chartArea.fill === "object") {
13697
13779
  specConfig.background = chartArea.fill.color;
13698
13780
  }
@@ -15717,10 +15799,11 @@ var init_cell_properties = __esm({
15717
15799
  });
15718
15800
 
15719
15801
  // ../../kernel/src/api/internal/value-conversions.ts
15720
- function viewportCellValueToCellValue(cv) {
15802
+ function normalizeCellValue(cv) {
15803
+ if (cv !== null && isCellError(cv)) return errorDisplayString(cv.value);
15721
15804
  return cv;
15722
15805
  }
15723
- function viewportCellValueToString(cv) {
15806
+ function cellValueToString(cv) {
15724
15807
  if (cv === null || cv === void 0) return "";
15725
15808
  if (typeof cv === "string") return cv;
15726
15809
  if (typeof cv === "number") return String(cv);
@@ -15884,15 +15967,14 @@ function buildBaseFields(data) {
15884
15967
  name: data.name,
15885
15968
  visible: data.visible,
15886
15969
  groupId: data.groupId,
15887
- altText: data.altText,
15970
+ altText: "altText" in data ? data.altText : void 0,
15888
15971
  createdAt: data.createdAt,
15889
15972
  updatedAt: data.updatedAt
15890
15973
  };
15891
15974
  }
15892
- function toShapeObject(data) {
15893
- const d = data;
15975
+ function toShapeObject(d) {
15894
15976
  return {
15895
- ...buildBaseFields(data),
15977
+ ...buildBaseFields(d),
15896
15978
  type: "shape",
15897
15979
  shapeType: d.shapeType ?? "rect",
15898
15980
  fill: d.fill,
@@ -15902,10 +15984,9 @@ function toShapeObject(data) {
15902
15984
  adjustments: d.adjustments
15903
15985
  };
15904
15986
  }
15905
- function toPictureObject(data) {
15906
- const d = data;
15987
+ function toPictureObject(d) {
15907
15988
  return {
15908
- ...buildBaseFields(data),
15989
+ ...buildBaseFields(d),
15909
15990
  type: "picture",
15910
15991
  src: d.src ?? "",
15911
15992
  originalWidth: d.originalWidth ?? 0,
@@ -15914,10 +15995,9 @@ function toPictureObject(data) {
15914
15995
  adjustments: d.adjustments
15915
15996
  };
15916
15997
  }
15917
- function toTextBoxObject(data) {
15918
- const d = data;
15998
+ function toTextBoxObject(d) {
15919
15999
  return {
15920
- ...buildBaseFields(data),
16000
+ ...buildBaseFields(d),
15921
16001
  type: "textbox",
15922
16002
  content: d.content ?? "",
15923
16003
  defaultFormat: d.defaultFormat,
@@ -15928,10 +16008,9 @@ function toTextBoxObject(data) {
15928
16008
  wordArt: d.wordArt
15929
16009
  };
15930
16010
  }
15931
- function toConnectorObject(data) {
15932
- const d = data;
16011
+ function toConnectorObject(d) {
15933
16012
  return {
15934
- ...buildBaseFields(data),
16013
+ ...buildBaseFields(d),
15935
16014
  type: "connector",
15936
16015
  shapeType: d.shapeType ?? "connector",
15937
16016
  startConnection: d.startConnection,
@@ -15940,8 +16019,7 @@ function toConnectorObject(data) {
15940
16019
  outline: d.outline
15941
16020
  };
15942
16021
  }
15943
- function toChartObject(data) {
15944
- const d = data;
16022
+ function toChartObject(d) {
15945
16023
  const chartConfig = {
15946
16024
  subType: d.subType,
15947
16025
  seriesOrientation: d.seriesOrientation,
@@ -15970,41 +16048,38 @@ function toChartObject(data) {
15970
16048
  tableCategoryColumn: d.tableCategoryColumn,
15971
16049
  useTableColumnNamesAsLabels: d.useTableColumnNamesAsLabels,
15972
16050
  tableColumnNames: d.tableColumnNames,
15973
- definition: d.definition,
15974
16051
  ooxml: d.ooxml
15975
16052
  };
15976
16053
  return {
15977
- ...buildBaseFields(data),
16054
+ ...buildBaseFields(d),
15978
16055
  type: "chart",
15979
16056
  chartType: d.chartType ?? "column",
15980
- anchorMode: data.anchor.anchorMode === "twoCell" ? "twoCell" : "oneCell",
15981
- widthCells: d.widthCells ?? data.width ?? 8,
15982
- 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,
15983
16060
  chartConfig,
15984
16061
  dataRangeIdentity: d.dataRangeIdentity,
15985
16062
  seriesRangeIdentity: d.seriesRangeIdentity,
15986
16063
  categoryRangeIdentity: d.categoryRangeIdentity
15987
16064
  };
15988
16065
  }
15989
- function toEquationObject(data) {
15990
- const d = data;
16066
+ function toEquationObject(d) {
16067
+ const equation = typeof d.equation === "string" ? { id: d.id, omml: d.equation } : d.equation;
15991
16068
  return {
15992
- ...buildBaseFields(data),
16069
+ ...buildBaseFields(d),
15993
16070
  type: "equation",
15994
- equation: d.equation
16071
+ equation
15995
16072
  };
15996
16073
  }
15997
- function toSmartArtObject(data) {
15998
- const d = data;
16074
+ function toSmartArtObject(d) {
15999
16075
  return {
16000
- ...buildBaseFields(data),
16076
+ ...buildBaseFields(d),
16001
16077
  type: "smartart",
16002
16078
  diagram: d.definition ?? {}
16003
16079
  };
16004
16080
  }
16005
- function toDrawingObject(data) {
16006
- const common = buildBaseFields(data);
16007
- const d = data;
16081
+ function toDrawingObject(d) {
16082
+ const common = buildBaseFields(d);
16008
16083
  const strokes = /* @__PURE__ */ new Map();
16009
16084
  if (d.strokes) {
16010
16085
  for (const [id, stroke] of Object.entries(d.strokes)) {
@@ -16029,10 +16104,9 @@ function toDrawingObject(data) {
16029
16104
  backgroundColor: d.backgroundColor
16030
16105
  };
16031
16106
  }
16032
- function toOleObjectObject(data) {
16033
- const d = data;
16107
+ function toOleObjectObject(d) {
16034
16108
  return {
16035
- ...buildBaseFields(data),
16109
+ ...buildBaseFields(d),
16036
16110
  type: "oleObject",
16037
16111
  progId: d.progId ?? "",
16038
16112
  dvAspect: d.dvAspect ?? "content",
@@ -16043,8 +16117,7 @@ function toOleObjectObject(data) {
16043
16117
  };
16044
16118
  }
16045
16119
  function toFloatingObject(data) {
16046
- const objectType = data.type ?? "shape";
16047
- switch (objectType) {
16120
+ switch (data.type) {
16048
16121
  case "shape":
16049
16122
  return toShapeObject(data);
16050
16123
  case "picture":
@@ -16064,10 +16137,43 @@ function toFloatingObject(data) {
16064
16137
  case "drawing":
16065
16138
  return toDrawingObject(data);
16066
16139
  case "slicer":
16067
- default:
16068
- 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
+ }
16069
16146
  }
16070
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
+ }
16071
16177
  var init_floating_object_mapper = __esm({
16072
16178
  "../../kernel/src/bridges/compute/floating-object-mapper.ts"() {
16073
16179
  "use strict";
@@ -16280,7 +16386,7 @@ function toDisposable(fn) {
16280
16386
  return disposable;
16281
16387
  }
16282
16388
  var DisposableBase, DisposableStore, DisposableNone;
16283
- var init_disposable = __esm({
16389
+ var init_disposable2 = __esm({
16284
16390
  "../../spreadsheet-utils/src/disposable.ts"() {
16285
16391
  "use strict";
16286
16392
  init_esm_shims();
@@ -16344,7 +16450,7 @@ function ok(value) {
16344
16450
  function err(error) {
16345
16451
  return { ok: false, error };
16346
16452
  }
16347
- var init_result = __esm({
16453
+ var init_result2 = __esm({
16348
16454
  "../../spreadsheet-utils/src/result.ts"() {
16349
16455
  "use strict";
16350
16456
  init_esm_shims();
@@ -16357,7 +16463,7 @@ var init_subscribable = __esm({
16357
16463
  "../../kernel/src/services/primitives/subscribable.ts"() {
16358
16464
  "use strict";
16359
16465
  init_esm_shims();
16360
- init_disposable();
16466
+ init_disposable2();
16361
16467
  Subscribable = class extends DisposableBase {
16362
16468
  constructor() {
16363
16469
  super(...arguments);
@@ -16417,7 +16523,7 @@ var init_event_emitter = __esm({
16417
16523
  "../../kernel/src/services/primitives/event-emitter.ts"() {
16418
16524
  "use strict";
16419
16525
  init_esm_shims();
16420
- init_disposable();
16526
+ init_disposable2();
16421
16527
  TypedEventEmitter = class extends DisposableBase {
16422
16528
  constructor() {
16423
16529
  super(...arguments);
@@ -16482,8 +16588,8 @@ var init_primitives3 = __esm({
16482
16588
  "../../kernel/src/services/primitives/index.ts"() {
16483
16589
  "use strict";
16484
16590
  init_esm_shims();
16485
- init_disposable();
16486
- init_result();
16591
+ init_disposable2();
16592
+ init_result2();
16487
16593
  init_subscribable();
16488
16594
  init_event_emitter();
16489
16595
  }
@@ -24533,8 +24639,34 @@ var init_equation_bridge = __esm({
24533
24639
  }
24534
24640
  });
24535
24641
 
24642
+ // ../../contracts/src/bridges/ink-recognition-bridge.ts
24643
+ var DEFAULT_RECOGNITION_THRESHOLDS;
24644
+ var init_ink_recognition_bridge = __esm({
24645
+ "../../contracts/src/bridges/ink-recognition-bridge.ts"() {
24646
+ "use strict";
24647
+ init_esm_shims();
24648
+ DEFAULT_RECOGNITION_THRESHOLDS = {
24649
+ line: 0.7,
24650
+ rectangle: 0.65,
24651
+ ellipse: 0.7,
24652
+ triangle: 0.6,
24653
+ arrow: 0.6,
24654
+ star: 0.65,
24655
+ text: 0.5
24656
+ };
24657
+ }
24658
+ });
24659
+
24660
+ // ../../contracts/src/bridges/index.ts
24661
+ var init_bridges = __esm({
24662
+ "../../contracts/src/bridges/index.ts"() {
24663
+ "use strict";
24664
+ init_esm_shims();
24665
+ init_ink_recognition_bridge();
24666
+ }
24667
+ });
24668
+
24536
24669
  // ../../kernel/src/domain/drawing/ink-recognition-bridge.ts
24537
- import { DEFAULT_RECOGNITION_THRESHOLDS } from "@mog-sdk/spreadsheet-contracts/bridges";
24538
24670
  function createInkRecognitionBridge(initialThresholds) {
24539
24671
  let thresholds = {
24540
24672
  ...DEFAULT_RECOGNITION_THRESHOLDS,
@@ -24950,10 +25082,11 @@ async function recognizeWithBrowserAPI(strokes) {
24950
25082
  }
24951
25083
  return null;
24952
25084
  }
24953
- var init_ink_recognition_bridge = __esm({
25085
+ var init_ink_recognition_bridge2 = __esm({
24954
25086
  "../../kernel/src/domain/drawing/ink-recognition-bridge.ts"() {
24955
25087
  "use strict";
24956
25088
  init_esm_shims();
25089
+ init_bridges();
24957
25090
  }
24958
25091
  });
24959
25092
 
@@ -25191,7 +25324,7 @@ var init_pivot_bridge = __esm({
25191
25324
  expandedColumns: {}
25192
25325
  };
25193
25326
  try {
25194
- const result = await this.ctx.computeBridge.pivotComputeFromSource(
25327
+ const result = await this.ctx.computeBridge.pivotMaterialize(
25195
25328
  sheetId,
25196
25329
  pivotId,
25197
25330
  expansionState ?? null
@@ -25395,7 +25528,7 @@ var init_pivot_bridge = __esm({
25395
25528
  const rowData = [];
25396
25529
  for (let col = range2.startCol; col <= range2.endCol; col++) {
25397
25530
  const cell = cellMap.get(`${row},${col}`);
25398
- rowData.push(cell ? viewportCellValueToCellValue(cell.value) ?? null : null);
25531
+ rowData.push(cell ? normalizeCellValue(cell.value) ?? null : null);
25399
25532
  }
25400
25533
  data.push(rowData);
25401
25534
  }
@@ -29966,7 +30099,7 @@ var init_arrows = __esm({
29966
30099
 
29967
30100
  // ../../canvas/drawing/shapes/src/presets/constants.ts
29968
30101
  var KAPPA;
29969
- var init_constants = __esm({
30102
+ var init_constants2 = __esm({
29970
30103
  "../../canvas/drawing/shapes/src/presets/constants.ts"() {
29971
30104
  "use strict";
29972
30105
  init_esm_shims();
@@ -29990,7 +30123,7 @@ var init_primitives4 = __esm({
29990
30123
  "use strict";
29991
30124
  init_esm_shims();
29992
30125
  init_src3();
29993
- init_constants();
30126
+ init_constants2();
29994
30127
  }
29995
30128
  });
29996
30129
 
@@ -30000,7 +30133,7 @@ var init_basic = __esm({
30000
30133
  "use strict";
30001
30134
  init_esm_shims();
30002
30135
  init_src3();
30003
- init_constants();
30136
+ init_constants2();
30004
30137
  init_primitives4();
30005
30138
  init_registry3();
30006
30139
  init_primitives4();
@@ -70073,21 +70206,438 @@ var init_rules = __esm({
70073
70206
  }
70074
70207
  });
70075
70208
 
70209
+ // ../../contracts/src/smartart/layouts.ts
70210
+ var init_layouts2 = __esm({
70211
+ "../../contracts/src/smartart/layouts.ts"() {
70212
+ "use strict";
70213
+ init_esm_shims();
70214
+ }
70215
+ });
70216
+
70217
+ // ../../contracts/src/smartart/ooxml-algorithm-types.ts
70218
+ var ParameterId, VALID_PARAMS_BY_ALGORITHM;
70219
+ var init_ooxml_algorithm_types = __esm({
70220
+ "../../contracts/src/smartart/ooxml-algorithm-types.ts"() {
70221
+ "use strict";
70222
+ init_esm_shims();
70223
+ ParameterId = {
70224
+ // ── Alignment Parameters ──────────────────────────────────────────────────
70225
+ /** Horizontal alignment of children within the layout area. */
70226
+ horzAlign: "horzAlign",
70227
+ /** Vertical alignment of children within the layout area. */
70228
+ vertAlign: "vertAlign",
70229
+ /** Horizontal alignment for individual nodes (hierarchy algorithms). */
70230
+ nodeHorzAlign: "nodeHorzAlign",
70231
+ /** Vertical alignment for individual nodes (hierarchy algorithms). */
70232
+ nodeVertAlign: "nodeVertAlign",
70233
+ /** Hierarchy alignment (16 possible values for tree orientation). */
70234
+ hierAlign: "hierAlign",
70235
+ /** Text alignment (whether text should be aligned with shape). */
70236
+ alignTx: "alignTx",
70237
+ // ── Direction Parameters ──────────────────────────────────────────────────
70238
+ /** Child direction (horizontal or vertical arrangement of children). */
70239
+ chDir: "chDir",
70240
+ /** Child alignment (how children align on the cross-axis). */
70241
+ chAlign: "chAlign",
70242
+ /** Secondary child alignment (for complex hierarchy layouts). */
70243
+ secChAlign: "secChAlign",
70244
+ /** Linear direction (which edge children flow from). */
70245
+ linDir: "linDir",
70246
+ /** Secondary linear direction (for complex hierarchy layouts). */
70247
+ secLinDir: "secLinDir",
70248
+ /** Text direction (horizontal or vertical text blocks). */
70249
+ txDir: "txDir",
70250
+ /** Text block direction (horizontal or vertical text flow). */
70251
+ txBlDir: "txBlDir",
70252
+ /** Growth direction (which corner the snake starts from). */
70253
+ grDir: "grDir",
70254
+ /** Flow direction (whether snake flows by row or column). */
70255
+ flowDir: "flowDir",
70256
+ /** Continue direction (same direction or reversed for each row). */
70257
+ contDir: "contDir",
70258
+ // ── Connector Parameters ──────────────────────────────────────────────────
70259
+ /** Connector routing style (straight, bend, curve, long curve). */
70260
+ connRout: "connRout",
70261
+ /** Beginning/start arrowhead style for connectors. */
70262
+ begSty: "begSty",
70263
+ /** Ending arrowhead style for connectors. */
70264
+ endSty: "endSty",
70265
+ /** Connector dimension (1D, 2D, or custom). */
70266
+ dim: "dim",
70267
+ /** Source node name for connector routing. */
70268
+ srcNode: "srcNode",
70269
+ /** Destination node name for connector routing. */
70270
+ dstNode: "dstNode",
70271
+ /** Beginning connection points (which points on the source shape). */
70272
+ begPts: "begPts",
70273
+ /** Ending connection points (which points on the destination shape). */
70274
+ endPts: "endPts",
70275
+ /** Bend point position for right-angle connectors. */
70276
+ bendPt: "bendPt",
70277
+ // ── Cycle/Circular Parameters ─────────────────────────────────────────────
70278
+ /** Start angle in degrees for cycle algorithm. */
70279
+ stAng: "stAng",
70280
+ /** Span angle in degrees for cycle algorithm. */
70281
+ spanAng: "spanAng",
70282
+ /** Rotation path (none or along the circular path). */
70283
+ rotPath: "rotPath",
70284
+ /** Center shape mapping (whether first node goes to center). */
70285
+ ctrShpMap: "ctrShpMap",
70286
+ // ── Snake Parameters ──────────────────────────────────────────────────────
70287
+ /** Breakpoint logic for snake wrapping (end of canvas, balanced, fixed). */
70288
+ bkpt: "bkpt",
70289
+ /** Breakpoint fixed value (number of items per row when bkpt=fixed). */
70290
+ bkPtFixedVal: "bkPtFixedVal",
70291
+ /** Offset mode for staggered rows in snake layout. */
70292
+ off: "off",
70293
+ // ── Linear/Sequence Parameters ────────────────────────────────────────────
70294
+ /** Starting element index (which node type starts the alternating sequence). */
70295
+ stElem: "stElem",
70296
+ /** Starting bullet level for text algorithm. */
70297
+ stBulletLvl: "stBulletLvl",
70298
+ // ── Pyramid Parameters ────────────────────────────────────────────────────
70299
+ /** Pyramid accent position (before or after the level). */
70300
+ pyraAcctPos: "pyraAcctPos",
70301
+ /** Pyramid accent text margin (step or stack behavior). */
70302
+ pyraAcctTxMar: "pyraAcctTxMar",
70303
+ /** Pyramid level node name. */
70304
+ pyraLvlNode: "pyraLvlNode",
70305
+ /** Pyramid accent background node name. */
70306
+ pyraAcctBkgdNode: "pyraAcctBkgdNode",
70307
+ /** Pyramid accent text node name. */
70308
+ pyraAcctTxNode: "pyraAcctTxNode",
70309
+ // ── Text Parameters ───────────────────────────────────────────────────────
70310
+ /** Parent text LTR alignment. */
70311
+ parTxLTRAlign: "parTxLTRAlign",
70312
+ /** Parent text RTL alignment. */
70313
+ parTxRTLAlign: "parTxRTLAlign",
70314
+ /** Shape text LTR alignment for children. */
70315
+ shpTxLTRAlignCh: "shpTxLTRAlignCh",
70316
+ /** Shape text RTL alignment for children. */
70317
+ shpTxRTLAlignCh: "shpTxRTLAlignCh",
70318
+ /** Text anchor horizontal position. */
70319
+ txAnchorHorz: "txAnchorHorz",
70320
+ /** Text anchor vertical position. */
70321
+ txAnchorVert: "txAnchorVert",
70322
+ /** Text anchor horizontal position for children. */
70323
+ txAnchorHorzCh: "txAnchorHorzCh",
70324
+ /** Text anchor vertical position for children. */
70325
+ txAnchorVertCh: "txAnchorVertCh",
70326
+ /** Auto text rotation mode (none, upright, gravity-based). */
70327
+ autoTxRot: "autoTxRot",
70328
+ // ── Spacing & Sizing Parameters ───────────────────────────────────────────
70329
+ /** Aspect ratio value. */
70330
+ ar: "ar",
70331
+ /** Line spacing for parent text (percentage). */
70332
+ lnSpPar: "lnSpPar",
70333
+ /** Line spacing after parent paragraph (percentage). */
70334
+ lnSpAfParP: "lnSpAfParP",
70335
+ /** Line spacing for child text (percentage). */
70336
+ lnSpCh: "lnSpCh",
70337
+ /** Line spacing after child paragraph (percentage). */
70338
+ lnSpAfChP: "lnSpAfChP",
70339
+ // ── Hierarchy-Specific Parameters ─────────────────────────────────────────
70340
+ /** Root short distance flag (hierarchy algorithms). */
70341
+ rtShortDist: "rtShortDist",
70342
+ // ── Fallback Parameter ────────────────────────────────────────────────────
70343
+ /** Fallback dimension for the algorithm. */
70344
+ fallback: "fallback"
70345
+ };
70346
+ VALID_PARAMS_BY_ALGORITHM = {
70347
+ composite: [ParameterId.ar],
70348
+ lin: [
70349
+ ParameterId.linDir,
70350
+ ParameterId.chDir,
70351
+ ParameterId.chAlign,
70352
+ ParameterId.horzAlign,
70353
+ ParameterId.vertAlign,
70354
+ ParameterId.stElem,
70355
+ ParameterId.fallback,
70356
+ ParameterId.nodeHorzAlign,
70357
+ ParameterId.nodeVertAlign
70358
+ ],
70359
+ snake: [
70360
+ ParameterId.grDir,
70361
+ ParameterId.flowDir,
70362
+ ParameterId.contDir,
70363
+ ParameterId.bkpt,
70364
+ ParameterId.bkPtFixedVal,
70365
+ ParameterId.off
70366
+ ],
70367
+ cycle: [ParameterId.stAng, ParameterId.spanAng, ParameterId.rotPath, ParameterId.ctrShpMap],
70368
+ hierRoot: [
70369
+ ParameterId.hierAlign,
70370
+ ParameterId.nodeHorzAlign,
70371
+ ParameterId.nodeVertAlign,
70372
+ ParameterId.rtShortDist
70373
+ ],
70374
+ hierChild: [
70375
+ ParameterId.chAlign,
70376
+ ParameterId.linDir,
70377
+ ParameterId.secChAlign,
70378
+ ParameterId.secLinDir
70379
+ ],
70380
+ pyra: [
70381
+ ParameterId.linDir,
70382
+ ParameterId.txDir,
70383
+ ParameterId.pyraAcctPos,
70384
+ ParameterId.pyraAcctTxMar,
70385
+ ParameterId.pyraLvlNode,
70386
+ ParameterId.pyraAcctBkgdNode,
70387
+ ParameterId.pyraAcctTxNode
70388
+ ],
70389
+ conn: [
70390
+ ParameterId.srcNode,
70391
+ ParameterId.dstNode,
70392
+ ParameterId.connRout,
70393
+ ParameterId.begSty,
70394
+ ParameterId.endSty,
70395
+ ParameterId.dim,
70396
+ ParameterId.bendPt,
70397
+ ParameterId.begPts,
70398
+ ParameterId.endPts
70399
+ ],
70400
+ tx: [
70401
+ ParameterId.parTxLTRAlign,
70402
+ ParameterId.parTxRTLAlign,
70403
+ ParameterId.shpTxLTRAlignCh,
70404
+ ParameterId.shpTxRTLAlignCh,
70405
+ ParameterId.txAnchorVert,
70406
+ ParameterId.txAnchorHorz,
70407
+ ParameterId.txAnchorVertCh,
70408
+ ParameterId.txAnchorHorzCh,
70409
+ ParameterId.txBlDir,
70410
+ ParameterId.autoTxRot,
70411
+ ParameterId.stBulletLvl,
70412
+ ParameterId.lnSpPar,
70413
+ ParameterId.lnSpAfParP,
70414
+ ParameterId.lnSpCh,
70415
+ ParameterId.lnSpAfChP,
70416
+ ParameterId.alignTx
70417
+ ],
70418
+ sp: []
70419
+ };
70420
+ }
70421
+ });
70422
+
70423
+ // ../../contracts/src/smartart/ooxml-data-model-types.ts
70424
+ var init_ooxml_data_model_types = __esm({
70425
+ "../../contracts/src/smartart/ooxml-data-model-types.ts"() {
70426
+ "use strict";
70427
+ init_esm_shims();
70428
+ }
70429
+ });
70430
+
70431
+ // ../../contracts/src/smartart/ooxml-drawing-types.ts
70432
+ var init_ooxml_drawing_types = __esm({
70433
+ "../../contracts/src/smartart/ooxml-drawing-types.ts"() {
70434
+ "use strict";
70435
+ init_esm_shims();
70436
+ }
70437
+ });
70438
+
70439
+ // ../../contracts/src/smartart/ooxml-engine-types.ts
70440
+ 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;
70441
+ var init_ooxml_engine_types = __esm({
70442
+ "../../contracts/src/smartart/ooxml-engine-types.ts"() {
70443
+ "use strict";
70444
+ init_esm_shims();
70445
+ POSITIONAL_CONSTRAINT_TYPES = [
70446
+ "l",
70447
+ "t",
70448
+ "r",
70449
+ "b",
70450
+ "lOff",
70451
+ "tOff",
70452
+ "rOff",
70453
+ "bOff",
70454
+ "ctrX",
70455
+ "ctrY",
70456
+ "ctrXOff",
70457
+ "ctrYOff"
70458
+ ];
70459
+ DIMENSIONAL_CONSTRAINT_TYPES = [
70460
+ "w",
70461
+ "h",
70462
+ "wOff",
70463
+ "hOff"
70464
+ ];
70465
+ MARGIN_CONSTRAINT_TYPES = [
70466
+ "lMarg",
70467
+ "tMarg",
70468
+ "rMarg",
70469
+ "bMarg",
70470
+ "begMarg",
70471
+ "endMarg"
70472
+ ];
70473
+ FONT_CONSTRAINT_TYPES = [
70474
+ "primFontSz",
70475
+ "secFontSz"
70476
+ ];
70477
+ SPACING_CONSTRAINT_TYPES = [
70478
+ "sp",
70479
+ "sibSp",
70480
+ "secSibSp"
70481
+ ];
70482
+ GEOMETRY_CONSTRAINT_TYPES = [
70483
+ "connDist",
70484
+ "diam",
70485
+ "stemThick",
70486
+ "begPad",
70487
+ "endPad",
70488
+ "wArH",
70489
+ "hArH",
70490
+ "bendDist"
70491
+ ];
70492
+ USER_DEFINED_CONSTRAINT_TYPES = [
70493
+ "userA",
70494
+ "userB",
70495
+ "userC",
70496
+ "userD",
70497
+ "userE",
70498
+ "userF",
70499
+ "userG",
70500
+ "userH",
70501
+ "userI",
70502
+ "userJ",
70503
+ "userK",
70504
+ "userL",
70505
+ "userM",
70506
+ "userN",
70507
+ "userO",
70508
+ "userP",
70509
+ "userQ",
70510
+ "userR",
70511
+ "userS",
70512
+ "userT",
70513
+ "userU",
70514
+ "userV",
70515
+ "userW",
70516
+ "userX",
70517
+ "userY",
70518
+ "userZ"
70519
+ ];
70520
+ ALL_CONSTRAINT_TYPES = [
70521
+ ...POSITIONAL_CONSTRAINT_TYPES,
70522
+ ...DIMENSIONAL_CONSTRAINT_TYPES,
70523
+ ...MARGIN_CONSTRAINT_TYPES,
70524
+ ...FONT_CONSTRAINT_TYPES,
70525
+ ...SPACING_CONSTRAINT_TYPES,
70526
+ ...GEOMETRY_CONSTRAINT_TYPES,
70527
+ "pyraAcctRatio",
70528
+ "alignOff",
70529
+ ...USER_DEFINED_CONSTRAINT_TYPES,
70530
+ "none"
70531
+ ];
70532
+ ALL_ELEMENT_TYPES = [
70533
+ "all",
70534
+ "doc",
70535
+ "node",
70536
+ "norm",
70537
+ "nonNorm",
70538
+ "asst",
70539
+ "nonAsst",
70540
+ "parTrans",
70541
+ "pres",
70542
+ "sibTrans"
70543
+ ];
70544
+ ALL_FUNCTION_TYPES = [
70545
+ "cnt",
70546
+ "pos",
70547
+ "revPos",
70548
+ "posEven",
70549
+ "posOdd",
70550
+ "var",
70551
+ "depth",
70552
+ "maxDepth"
70553
+ ];
70554
+ ALL_FUNCTION_OPERATORS = [
70555
+ "equ",
70556
+ "neq",
70557
+ "gt",
70558
+ "lt",
70559
+ "gte",
70560
+ "lte"
70561
+ ];
70562
+ ALL_FUNCTION_ARGUMENTS = [
70563
+ "none",
70564
+ "orgChart",
70565
+ "chMax",
70566
+ "chPref",
70567
+ "bulEnabled",
70568
+ "dir",
70569
+ "hierBranch",
70570
+ "animOne",
70571
+ "animLvl",
70572
+ "resizeHandles"
70573
+ ];
70574
+ }
70575
+ });
70576
+
70577
+ // ../../contracts/src/smartart/ooxml-layout-types.ts
70578
+ var init_ooxml_layout_types = __esm({
70579
+ "../../contracts/src/smartart/ooxml-layout-types.ts"() {
70580
+ "use strict";
70581
+ init_esm_shims();
70582
+ }
70583
+ });
70584
+
70585
+ // ../../contracts/src/smartart/ooxml-style-types.ts
70586
+ var init_ooxml_style_types = __esm({
70587
+ "../../contracts/src/smartart/ooxml-style-types.ts"() {
70588
+ "use strict";
70589
+ init_esm_shims();
70590
+ }
70591
+ });
70592
+
70593
+ // ../../contracts/src/smartart/styles.ts
70594
+ var init_styles3 = __esm({
70595
+ "../../contracts/src/smartart/styles.ts"() {
70596
+ "use strict";
70597
+ init_esm_shims();
70598
+ }
70599
+ });
70600
+
70601
+ // ../../contracts/src/smartart/types.ts
70602
+ var init_types4 = __esm({
70603
+ "../../contracts/src/smartart/types.ts"() {
70604
+ "use strict";
70605
+ init_esm_shims();
70606
+ }
70607
+ });
70608
+
70609
+ // ../../contracts/src/smartart/index.ts
70610
+ var init_smartart = __esm({
70611
+ "../../contracts/src/smartart/index.ts"() {
70612
+ "use strict";
70613
+ init_esm_shims();
70614
+ init_layouts2();
70615
+ init_ooxml_algorithm_types();
70616
+ init_ooxml_data_model_types();
70617
+ init_ooxml_drawing_types();
70618
+ init_ooxml_engine_types();
70619
+ init_ooxml_layout_types();
70620
+ init_ooxml_style_types();
70621
+ init_styles3();
70622
+ init_types4();
70623
+ }
70624
+ });
70625
+
70076
70626
  // ../../canvas/drawing/smartart/src/engine/algorithms/composite.ts
70077
- import { AlgorithmType } from "@mog-sdk/spreadsheet-contracts/smartart";
70078
70627
  var init_composite = __esm({
70079
70628
  "../../canvas/drawing/smartart/src/engine/algorithms/composite.ts"() {
70080
70629
  "use strict";
70081
70630
  init_esm_shims();
70631
+ init_smartart();
70082
70632
  }
70083
70633
  });
70084
70634
 
70085
70635
  // ../../canvas/drawing/smartart/src/engine/algorithms/linear.ts
70086
- import { AlgorithmType as AlgorithmType2 } from "@mog-sdk/spreadsheet-contracts/smartart";
70087
70636
  var init_linear2 = __esm({
70088
70637
  "../../canvas/drawing/smartart/src/engine/algorithms/linear.ts"() {
70089
70638
  "use strict";
70090
70639
  init_esm_shims();
70640
+ init_smartart();
70091
70641
  }
70092
70642
  });
70093
70643
 
@@ -70100,82 +70650,82 @@ var init_param_utils = __esm({
70100
70650
  });
70101
70651
 
70102
70652
  // ../../canvas/drawing/smartart/src/engine/algorithms/snake.ts
70103
- import { AlgorithmType as AlgorithmType3 } from "@mog-sdk/spreadsheet-contracts/smartart";
70104
70653
  var init_snake = __esm({
70105
70654
  "../../canvas/drawing/smartart/src/engine/algorithms/snake.ts"() {
70106
70655
  "use strict";
70107
70656
  init_esm_shims();
70657
+ init_smartart();
70108
70658
  init_param_utils();
70109
70659
  }
70110
70660
  });
70111
70661
 
70112
70662
  // ../../canvas/drawing/smartart/src/engine/algorithms/cycle.ts
70113
- import { AlgorithmType as AlgorithmType4 } from "@mog-sdk/spreadsheet-contracts/smartart";
70114
70663
  var init_cycle2 = __esm({
70115
70664
  "../../canvas/drawing/smartart/src/engine/algorithms/cycle.ts"() {
70116
70665
  "use strict";
70117
70666
  init_esm_shims();
70667
+ init_smartart();
70118
70668
  init_param_utils();
70119
70669
  }
70120
70670
  });
70121
70671
 
70122
70672
  // ../../canvas/drawing/smartart/src/engine/algorithms/hier-root.ts
70123
- import { AlgorithmType as AlgorithmType5 } from "@mog-sdk/spreadsheet-contracts/smartart";
70124
70673
  var init_hier_root = __esm({
70125
70674
  "../../canvas/drawing/smartart/src/engine/algorithms/hier-root.ts"() {
70126
70675
  "use strict";
70127
70676
  init_esm_shims();
70677
+ init_smartart();
70128
70678
  init_param_utils();
70129
70679
  }
70130
70680
  });
70131
70681
 
70132
70682
  // ../../canvas/drawing/smartart/src/engine/algorithms/hier-child.ts
70133
- import { AlgorithmType as AlgorithmType6 } from "@mog-sdk/spreadsheet-contracts/smartart";
70134
70683
  var init_hier_child = __esm({
70135
70684
  "../../canvas/drawing/smartart/src/engine/algorithms/hier-child.ts"() {
70136
70685
  "use strict";
70137
70686
  init_esm_shims();
70687
+ init_smartart();
70138
70688
  init_param_utils();
70139
70689
  }
70140
70690
  });
70141
70691
 
70142
70692
  // ../../canvas/drawing/smartart/src/engine/algorithms/pyramid.ts
70143
- import { AlgorithmType as AlgorithmType7 } from "@mog-sdk/spreadsheet-contracts/smartart";
70144
70693
  var init_pyramid2 = __esm({
70145
70694
  "../../canvas/drawing/smartart/src/engine/algorithms/pyramid.ts"() {
70146
70695
  "use strict";
70147
70696
  init_esm_shims();
70697
+ init_smartart();
70148
70698
  init_param_utils();
70149
70699
  }
70150
70700
  });
70151
70701
 
70152
70702
  // ../../canvas/drawing/smartart/src/engine/algorithms/connector.ts
70153
- import { AlgorithmType as AlgorithmType8 } from "@mog-sdk/spreadsheet-contracts/smartart";
70154
70703
  var init_connector = __esm({
70155
70704
  "../../canvas/drawing/smartart/src/engine/algorithms/connector.ts"() {
70156
70705
  "use strict";
70157
70706
  init_esm_shims();
70707
+ init_smartart();
70158
70708
  init_connector_routing();
70159
70709
  init_param_utils();
70160
70710
  }
70161
70711
  });
70162
70712
 
70163
70713
  // ../../canvas/drawing/smartart/src/engine/algorithms/text.ts
70164
- import { AlgorithmType as AlgorithmType9 } from "@mog-sdk/spreadsheet-contracts/smartart";
70165
70714
  var init_text3 = __esm({
70166
70715
  "../../canvas/drawing/smartart/src/engine/algorithms/text.ts"() {
70167
70716
  "use strict";
70168
70717
  init_esm_shims();
70718
+ init_smartart();
70169
70719
  init_param_utils();
70170
70720
  }
70171
70721
  });
70172
70722
 
70173
70723
  // ../../canvas/drawing/smartart/src/engine/algorithms/space.ts
70174
- import { AlgorithmType as AlgorithmType10 } from "@mog-sdk/spreadsheet-contracts/smartart";
70175
70724
  var init_space = __esm({
70176
70725
  "../../canvas/drawing/smartart/src/engine/algorithms/space.ts"() {
70177
70726
  "use strict";
70178
70727
  init_esm_shims();
70728
+ init_smartart();
70179
70729
  }
70180
70730
  });
70181
70731
 
@@ -70334,18 +70884,12 @@ var init_drawing_parser = __esm({
70334
70884
  });
70335
70885
 
70336
70886
  // ../../canvas/drawing/smartart/src/parser/layout-def-parser.ts
70337
- import {
70338
- ALL_ELEMENT_TYPES,
70339
- ALL_FUNCTION_ARGUMENTS,
70340
- ALL_FUNCTION_OPERATORS,
70341
- ALL_FUNCTION_TYPES,
70342
- VARIABLE_LIST_DEFAULTS
70343
- } from "@mog-sdk/spreadsheet-contracts/smartart";
70344
70887
  var VALID_ELEMENT_TYPES, VALID_FUNCTION_TYPES, VALID_FUNCTION_OPERATORS, VALID_FUNCTION_ARGUMENTS;
70345
70888
  var init_layout_def_parser = __esm({
70346
70889
  "../../canvas/drawing/smartart/src/parser/layout-def-parser.ts"() {
70347
70890
  "use strict";
70348
70891
  init_esm_shims();
70892
+ init_smartart();
70349
70893
  init_data_model_parser();
70350
70894
  init_drawingml_helpers();
70351
70895
  init_xml_helpers();
@@ -74247,7 +74791,7 @@ var init_cell_anchor_resolver = __esm({
74247
74791
  });
74248
74792
 
74249
74793
  // ../../kernel/src/floating-objects/types.ts
74250
- var init_types4 = __esm({
74794
+ var init_types5 = __esm({
74251
74795
  "../../kernel/src/floating-objects/types.ts"() {
74252
74796
  "use strict";
74253
74797
  init_esm_shims();
@@ -74346,7 +74890,7 @@ var init_picture_manager = __esm({
74346
74890
  "use strict";
74347
74891
  init_esm_shims();
74348
74892
  init_document();
74349
- init_types4();
74893
+ init_types5();
74350
74894
  }
74351
74895
  });
74352
74896
 
@@ -74448,7 +74992,7 @@ var init_textbox_manager = __esm({
74448
74992
  "../../kernel/src/floating-objects/managers/textbox-manager.ts"() {
74449
74993
  "use strict";
74450
74994
  init_esm_shims();
74451
- init_types4();
74995
+ init_types5();
74452
74996
  DEFAULT_TEXTBOX_FILL = { type: "solid", color: "#ffffff" };
74453
74997
  DEFAULT_TEXTBOX_BORDER = { style: "solid", color: "#000000", width: 1 };
74454
74998
  }
@@ -75629,7 +76173,7 @@ var init_kernel_context = __esm({
75629
76173
  init_esm_shims();
75630
76174
  init_chart_bridge();
75631
76175
  init_equation_bridge();
75632
- init_ink_recognition_bridge();
76176
+ init_ink_recognition_bridge2();
75633
76177
  init_locale_bridge();
75634
76178
  init_pivot_bridge();
75635
76179
  init_schema_bridge();
@@ -76639,8 +77183,21 @@ var WorkbookHistoryImpl = class {
76639
77183
 
76640
77184
  // ../../kernel/src/api/workbook/names.ts
76641
77185
  init_esm_shims();
77186
+
77187
+ // ../../contracts/src/api/index.ts
77188
+ init_esm_shims();
77189
+
77190
+ // ../../contracts/src/api/types.ts
77191
+ init_esm_shims();
77192
+
77193
+ // ../../contracts/src/api/worksheet/index.ts
77194
+ init_esm_shims();
77195
+
77196
+ // ../../contracts/src/api/worksheet/format-mappings.ts
77197
+ init_esm_shims();
77198
+
77199
+ // ../../kernel/src/api/workbook/names.ts
76642
77200
  init_errors();
76643
- import { RangeValueType } from "@mog-sdk/spreadsheet-contracts/api";
76644
77201
 
76645
77202
  // ../../kernel/src/domain/formulas/named-ranges.ts
76646
77203
  init_esm_shims();
@@ -77262,13 +77819,13 @@ var WorkbookNamesImpl = class {
77262
77819
  if (!values) return null;
77263
77820
  return values.map(
77264
77821
  (row) => row.map((cell) => {
77265
- if (cell === null || cell === void 0) return RangeValueType.Empty;
77266
- if (typeof cell === "boolean") return RangeValueType.Boolean;
77267
- if (typeof cell === "number") return RangeValueType.Double;
77268
- if (typeof cell === "string") return RangeValueType.String;
77822
+ if (cell === null || cell === void 0) return "Empty" /* Empty */;
77823
+ if (typeof cell === "boolean") return "Boolean" /* Boolean */;
77824
+ if (typeof cell === "number") return "Double" /* Double */;
77825
+ if (typeof cell === "string") return "String" /* String */;
77269
77826
  if (typeof cell === "object" && cell !== null && "type" in cell)
77270
- return RangeValueType.Error;
77271
- return RangeValueType.String;
77827
+ return "Error" /* Error */;
77828
+ return "String" /* String */;
77272
77829
  })
77273
77830
  );
77274
77831
  }
@@ -77360,7 +77917,7 @@ var BUILT_IN_LISTS = [
77360
77917
  ];
77361
77918
 
77362
77919
  // ../../kernel/src/domain/workbook/workbook.ts
77363
- import { DEFAULT_WORKBOOK_PROTECTION_OPTIONS } from "@mog-sdk/spreadsheet-contracts/protection";
77920
+ init_protection();
77364
77921
 
77365
77922
  // ../../spreadsheet-utils/src/protection.ts
77366
77923
  init_esm_shims();
@@ -77816,9 +78373,9 @@ init_sheet_meta();
77816
78373
 
77817
78374
  // ../../kernel/src/api/worksheet/worksheet-impl.ts
77818
78375
  init_esm_shims();
78376
+ init_core2();
77819
78377
  init_errors3();
77820
78378
  init_errors();
77821
- import { displayStringOrNull as displayStringOrNull3 } from "@mog-sdk/spreadsheet-contracts/core";
77822
78379
 
77823
78380
  // ../../kernel/src/bridges/wire/cell-metadata-cache.ts
77824
78381
  init_esm_shims();
@@ -78836,22 +79393,18 @@ async function batchGetCellPositions(ctx, sheetId, cellIds) {
78836
79393
 
78837
79394
  // ../../kernel/src/api/worksheet/operations/dependency-operations.ts
78838
79395
  init_esm_shims();
78839
- function colToLetter4(col) {
78840
- let result = "";
78841
- let c = col;
78842
- while (c >= 0) {
78843
- result = String.fromCharCode(c % 26 + 65) + result;
78844
- c = Math.floor(c / 26) - 1;
78845
- }
78846
- return result;
78847
- }
79396
+ init_a1();
78848
79397
  async function getDependents(ctx, sheetId, row, col) {
78849
79398
  const results = await ctx.computeBridge.getDependents(sheetId, row, col);
78850
- return results.map((r) => `${colToLetter4(r.col)}${r.row + 1}`);
79399
+ return results.map(
79400
+ (r) => r.sheetId === sheetId ? toA12(r.row, r.col) : toSheetA1(r.row, r.col, r.sheetName)
79401
+ );
78851
79402
  }
78852
79403
  async function getPrecedents(ctx, sheetId, row, col) {
78853
79404
  const results = await ctx.computeBridge.getPrecedents(sheetId, row, col);
78854
- return results.map((r) => `${colToLetter4(r.col)}${r.row + 1}`);
79405
+ return results.map(
79406
+ (r) => r.sheetId === sheetId ? toA12(r.row, r.col) : toSheetA1(r.row, r.col, r.sheetName)
79407
+ );
78855
79408
  }
78856
79409
 
78857
79410
  // ../../kernel/src/api/worksheet/operations/fill-operations.ts
@@ -79172,7 +79725,7 @@ async function findCells(ctx, sheetId, predicate) {
79172
79725
  const results = [];
79173
79726
  for (const cell of rangeResult.cells) {
79174
79727
  const cellData = {
79175
- value: viewportCellValueToCellValue(cell.value),
79728
+ value: normalizeCellValue(cell.value),
79176
79729
  formula: cell.formula
79177
79730
  };
79178
79731
  if (predicate(cellData, cell.row, cell.col)) {
@@ -79225,18 +79778,18 @@ async function regexSearch(ctx, sheetId, patterns, options) {
79225
79778
  bounds.maxCol
79226
79779
  );
79227
79780
  for (const cell of rangeResult.cells) {
79228
- const valueStr = cell.formatted ?? viewportCellValueToString(cell.value);
79781
+ const valueStr = cell.formatted ?? cellValueToString(cell.value);
79229
79782
  for (const { regex, source } of compiledPatterns) {
79230
79783
  regex.lastIndex = 0;
79231
79784
  if (regex.test(valueStr)) {
79232
- const address = `${colToLetter3(cell.col)}${cell.row + 1}`;
79785
+ const address = toA12(cell.row, cell.col);
79233
79786
  results.push({ address, value: valueStr, sheetName, matchedPattern: source });
79234
79787
  break;
79235
79788
  }
79236
79789
  if (options?.includeFormulas && cell.formula) {
79237
79790
  regex.lastIndex = 0;
79238
79791
  if (regex.test(cell.formula)) {
79239
- const address = `${colToLetter3(cell.col)}${cell.row + 1}`;
79792
+ const address = toA12(cell.row, cell.col);
79240
79793
  results.push({ address, value: valueStr, sheetName, matchedPattern: source });
79241
79794
  break;
79242
79795
  }
@@ -79269,9 +79822,9 @@ async function getRangeWithIdentity(ctx, sheetId, startRow, startCol, endRow, en
79269
79822
  cellId: cell.cellId,
79270
79823
  row: cell.row,
79271
79824
  col: cell.col,
79272
- value: viewportCellValueToCellValue(cell.value),
79825
+ value: normalizeCellValue(cell.value),
79273
79826
  formulaText: cell.formula,
79274
- displayString: cell.formatted ?? viewportCellValueToString(cell.value)
79827
+ displayString: cell.formatted ?? cellValueToString(cell.value)
79275
79828
  }));
79276
79829
  }
79277
79830
 
@@ -79300,7 +79853,7 @@ async function getRange(ctx, sheetId, range2) {
79300
79853
  if (!cell) {
79301
79854
  rowData.push({ value: null });
79302
79855
  } else {
79303
- const value = viewportCellValueToCellValue(cell.value);
79856
+ const value = normalizeCellValue(cell.value);
79304
79857
  rowData.push({
79305
79858
  value: value ?? null,
79306
79859
  formula: cell.formula,
@@ -79405,10 +79958,6 @@ async function clearRange2(ctx, sheetId, range2) {
79405
79958
  init_esm_shims();
79406
79959
  init_a1();
79407
79960
  init_value_conversions();
79408
- import {
79409
- NumberFormatCategory,
79410
- RangeValueType as RangeValueType2
79411
- } from "@mog-sdk/spreadsheet-contracts/api";
79412
79961
  async function clearWithMode(ctx, sheetId, range2, applyTo = "all") {
79413
79962
  const n = normalizeRange(range2);
79414
79963
  const promises = [];
@@ -79482,7 +80031,7 @@ async function getDisplayText(ctx, sheetId, range2) {
79482
80031
  if (!cell) {
79483
80032
  rowData.push("");
79484
80033
  } else {
79485
- rowData.push(cell.formatted ?? viewportCellValueToString(cell.value));
80034
+ rowData.push(cell.formatted ?? cellValueToString(cell.value));
79486
80035
  }
79487
80036
  }
79488
80037
  result.push(rowData);
@@ -79508,9 +80057,9 @@ async function getValueTypes(ctx, sheetId, range2) {
79508
80057
  for (let col = n.startCol; col <= n.endCol; col++) {
79509
80058
  const cell = cellMap.get(`${row},${col}`);
79510
80059
  if (!cell) {
79511
- rowData.push(RangeValueType2.Empty);
80060
+ rowData.push("Empty" /* Empty */);
79512
80061
  } else {
79513
- rowData.push(classifyValueType(viewportCellValueToCellValue(cell.value)));
80062
+ rowData.push(classifyValueType(normalizeCellValue(cell.value)));
79514
80063
  }
79515
80064
  }
79516
80065
  result.push(rowData);
@@ -79518,12 +80067,16 @@ async function getValueTypes(ctx, sheetId, range2) {
79518
80067
  return result;
79519
80068
  }
79520
80069
  function classifyValueType(value) {
79521
- if (value === null || value === void 0) return RangeValueType2.Empty;
79522
- if (typeof value === "string") return value === "" ? RangeValueType2.Empty : RangeValueType2.String;
79523
- if (typeof value === "number") return RangeValueType2.Double;
79524
- if (typeof value === "boolean") return RangeValueType2.Boolean;
79525
- if (typeof value === "object" && value !== null && "type" in value) return RangeValueType2.Error;
79526
- return RangeValueType2.String;
80070
+ if (value === null || value === void 0) return "Empty" /* Empty */;
80071
+ if (typeof value === "string") {
80072
+ if (value === "") return "Empty" /* Empty */;
80073
+ if (value.startsWith("#")) return "Error" /* Error */;
80074
+ return "String" /* String */;
80075
+ }
80076
+ if (typeof value === "number") return "Double" /* Double */;
80077
+ if (typeof value === "boolean") return "Boolean" /* Boolean */;
80078
+ if (typeof value === "object" && value !== null && "type" in value) return "Error" /* Error */;
80079
+ return "String" /* String */;
79527
80080
  }
79528
80081
  async function findInRange(ctx, sheetId, range2, text, options) {
79529
80082
  const n = normalizeRange(range2);
@@ -79545,7 +80098,7 @@ async function findInRange(ctx, sheetId, range2, text, options) {
79545
80098
  n.endCol
79546
80099
  );
79547
80100
  for (const cell of rangeResult.cells) {
79548
- const valueStr = cell.formatted ?? viewportCellValueToString(cell.value);
80101
+ const valueStr = cell.formatted ?? cellValueToString(cell.value);
79549
80102
  if (pattern.test(valueStr)) {
79550
80103
  return {
79551
80104
  address: `${colToLetter3(cell.col)}${cell.row + 1}`,
@@ -79577,7 +80130,7 @@ async function replaceAll(ctx, sheetId, range2, text, replacement, options) {
79577
80130
  const edits = [];
79578
80131
  for (const cell of rangeResult.cells) {
79579
80132
  if (cell.formula) continue;
79580
- const valueStr = viewportCellValueToString(cell.value);
80133
+ const valueStr = cellValueToString(cell.value);
79581
80134
  if (!valueStr) continue;
79582
80135
  pattern.lastIndex = 0;
79583
80136
  if (pattern.test(valueStr)) {
@@ -79620,46 +80173,46 @@ async function getNumberFormatCategories(ctx, sheetId, range2) {
79620
80173
  }
79621
80174
  function detectFormatType(formatCode) {
79622
80175
  if (!formatCode || formatCode === "" || formatCode === "General") {
79623
- return NumberFormatCategory.General;
80176
+ return "General" /* General */;
79624
80177
  }
79625
80178
  if (formatCode === "@") {
79626
- return NumberFormatCategory.Text;
80179
+ return "Text" /* Text */;
79627
80180
  }
79628
80181
  const stripped = formatCode.replace(/\[[^\]]*\]/g, "").replace(/"[^"]*"/g, "");
79629
80182
  if (/[yYmMdD]/.test(stripped) && /[yYdD]/.test(stripped)) {
79630
- return NumberFormatCategory.Date;
80183
+ return "Date" /* Date */;
79631
80184
  }
79632
80185
  if (/[hHsS]/.test(stripped)) {
79633
80186
  if (/[yYdD]/.test(stripped)) {
79634
- return NumberFormatCategory.Date;
80187
+ return "Date" /* Date */;
79635
80188
  }
79636
- return NumberFormatCategory.Time;
80189
+ return "Time" /* Time */;
79637
80190
  }
79638
80191
  if (/AM\/PM/i.test(stripped)) {
79639
- return NumberFormatCategory.Time;
80192
+ return "Time" /* Time */;
79640
80193
  }
79641
80194
  if (stripped.includes("%")) {
79642
- return NumberFormatCategory.Percentage;
80195
+ return "Percentage" /* Percentage */;
79643
80196
  }
79644
80197
  if (/[eE][+-]/.test(stripped)) {
79645
- return NumberFormatCategory.Scientific;
80198
+ return "Scientific" /* Scientific */;
79646
80199
  }
79647
80200
  if (stripped.includes("/") && !/[yYmMdDhHsS]/.test(stripped)) {
79648
- return NumberFormatCategory.Fraction;
80201
+ return "Fraction" /* Fraction */;
79649
80202
  }
79650
80203
  if (/[_*]/.test(stripped) && /[$(]/.test(stripped)) {
79651
- return NumberFormatCategory.Accounting;
80204
+ return "Accounting" /* Accounting */;
79652
80205
  }
79653
80206
  if (/[$€£¥₹]/.test(formatCode)) {
79654
- return NumberFormatCategory.Currency;
80207
+ return "Currency" /* Currency */;
79655
80208
  }
79656
80209
  if (/^0{5}/.test(stripped) || /^0{3}-0{2}-0{4}/.test(stripped)) {
79657
- return NumberFormatCategory.Special;
80210
+ return "Special" /* Special */;
79658
80211
  }
79659
80212
  if (/[#0]/.test(stripped)) {
79660
- return NumberFormatCategory.Number;
80213
+ return "Number" /* Number */;
79661
80214
  }
79662
- return NumberFormatCategory.Custom;
80215
+ return "Custom" /* Custom */;
79663
80216
  }
79664
80217
 
79665
80218
  // ../../kernel/src/api/worksheet/operations/sort-operations.ts
@@ -79702,9 +80255,18 @@ init_esm_shims();
79702
80255
  // ../../kernel/src/api/worksheet/collections/object-collection-impl.ts
79703
80256
  init_esm_shims();
79704
80257
 
80258
+ // ../../kernel/src/api/worksheet/handles/floating-object-handle-factory.ts
80259
+ init_esm_shims();
80260
+
79705
80261
  // ../../kernel/src/api/worksheet/handles/floating-object-handle-impl.ts
79706
80262
  init_esm_shims();
79707
80263
  init_errors();
80264
+ function narrowHandle(handle, expected) {
80265
+ if (handle.type !== expected) {
80266
+ throw new KernelError("OPERATION_FAILED", `Expected ${expected}, got ${handle.type}`);
80267
+ }
80268
+ return handle;
80269
+ }
79708
80270
  var FloatingObjectHandleImpl = class _FloatingObjectHandleImpl {
79709
80271
  constructor(id, type, objectsImpl, boundsReader) {
79710
80272
  this.id = id;
@@ -79751,11 +80313,11 @@ var FloatingObjectHandleImpl = class _FloatingObjectHandleImpl {
79751
80313
  return this.boundsReader?.getBounds(this.id) ?? null;
79752
80314
  }
79753
80315
  async getData() {
79754
- const info = await this.objectsImpl.get(this.id);
79755
- if (!info) throw new KernelError("OPERATION_FAILED", `Object ${this.id} not found`);
79756
- return info;
80316
+ const obj = await this.objectsImpl.getFullObject(this.id);
80317
+ if (!obj) throw new KernelError("OPERATION_FAILED", `Object ${this.id} not found`);
80318
+ return obj;
79757
80319
  }
79758
- // -- Type narrowing --
80320
+ // -- Type narrowing (is* predicates) --
79759
80321
  isShape() {
79760
80322
  return this.type === "shape";
79761
80323
  }
@@ -79792,58 +80354,43 @@ var FloatingObjectHandleImpl = class _FloatingObjectHandleImpl {
79792
80354
  isSlicer() {
79793
80355
  return this.type === "slicer";
79794
80356
  }
79795
- /** @internal Throw if this handle's type doesn't match expected. */
79796
- assertType(expected) {
79797
- if (this.type !== expected) {
79798
- throw new KernelError("OPERATION_FAILED", `Expected ${expected}, got ${this.type}`);
79799
- }
79800
- }
80357
+ /**
80358
+ * Type-checked narrowing — throws if this handle's type does not match.
80359
+ * The factory (createFloatingObjectHandle) guarantees that when type === 'shape',
80360
+ * `this` is a ShapeHandleImpl which implements ShapeHandle, etc.
80361
+ */
79801
80362
  asShape() {
79802
- this.assertType("shape");
79803
- return this;
80363
+ return narrowHandle(this, "shape");
79804
80364
  }
79805
80365
  asPicture() {
79806
- this.assertType("picture");
79807
- return this;
80366
+ return narrowHandle(this, "picture");
79808
80367
  }
79809
80368
  asTextBox() {
79810
- this.assertType("textbox");
79811
- return this;
80369
+ return narrowHandle(this, "textbox");
79812
80370
  }
79813
80371
  asDrawing() {
79814
- this.assertType("drawing");
79815
- return this;
80372
+ return narrowHandle(this, "drawing");
79816
80373
  }
79817
80374
  asEquation() {
79818
- this.assertType("equation");
79819
- return this;
80375
+ return narrowHandle(this, "equation");
79820
80376
  }
79821
80377
  asWordArt() {
79822
- this.assertType("wordart");
79823
- return this;
80378
+ throw new KernelError("OPERATION_FAILED", `Expected wordart, got ${this.type}`);
79824
80379
  }
79825
80380
  asSmartArt() {
79826
- this.assertType("smartart");
79827
- return this;
80381
+ return narrowHandle(this, "smartart");
79828
80382
  }
79829
80383
  asChart() {
79830
- this.assertType("chart");
79831
- return this;
79832
- }
79833
- asCamera() {
79834
- throw new KernelError("OPERATION_FAILED", "Camera objects are no longer supported");
80384
+ return narrowHandle(this, "chart");
79835
80385
  }
79836
80386
  asConnector() {
79837
- this.assertType("connector");
79838
- return this;
80387
+ return narrowHandle(this, "connector");
79839
80388
  }
79840
80389
  asOleObject() {
79841
- this.assertType("oleObject");
79842
- return this;
80390
+ return narrowHandle(this, "oleObject");
79843
80391
  }
79844
80392
  asSlicer() {
79845
- this.assertType("slicer");
79846
- return this;
80393
+ return narrowHandle(this, "slicer");
79847
80394
  }
79848
80395
  };
79849
80396
 
@@ -79863,9 +80410,9 @@ var ShapeHandleImpl = class _ShapeHandleImpl extends FloatingObjectHandleImpl {
79863
80410
  return new _ShapeHandleImpl(receipt.id, this.shapeType, this.objectsImpl, this.boundsReader);
79864
80411
  }
79865
80412
  async getData() {
79866
- const shape = await this.objectsImpl.getShape(this.id);
79867
- if (!shape) throw new KernelError("OPERATION_FAILED", `Shape ${this.id} not found`);
79868
- return shape;
80413
+ const obj = await this.objectsImpl.getFullObject(this.id);
80414
+ if (!obj || obj.type !== "shape") throw new KernelError("OPERATION_FAILED", `Shape ${this.id} not found`);
80415
+ return obj;
79869
80416
  }
79870
80417
  };
79871
80418
 
@@ -79884,9 +80431,9 @@ var PictureHandleImpl = class _PictureHandleImpl extends FloatingObjectHandleImp
79884
80431
  return new _PictureHandleImpl(receipt.id, this.objectsImpl, this.boundsReader);
79885
80432
  }
79886
80433
  async getData() {
79887
- const info = await this.objectsImpl.get(this.id);
79888
- if (!info) throw new KernelError("OPERATION_FAILED", `Picture ${this.id} not found`);
79889
- return info;
80434
+ const obj = await this.objectsImpl.getFullObject(this.id);
80435
+ if (!obj || obj.type !== "picture") throw new KernelError("OPERATION_FAILED", `Picture ${this.id} not found`);
80436
+ return obj;
79890
80437
  }
79891
80438
  };
79892
80439
 
@@ -79905,9 +80452,9 @@ var TextBoxHandleImpl = class _TextBoxHandleImpl extends FloatingObjectHandleImp
79905
80452
  return new _TextBoxHandleImpl(receipt.id, this.objectsImpl, this.boundsReader);
79906
80453
  }
79907
80454
  async getData() {
79908
- const info = await this.objectsImpl.get(this.id);
79909
- if (!info) throw new KernelError("OPERATION_FAILED", `TextBox ${this.id} not found`);
79910
- return info;
80455
+ const obj = await this.objectsImpl.getFullObject(this.id);
80456
+ if (!obj || obj.type !== "textbox") throw new KernelError("OPERATION_FAILED", `TextBox ${this.id} not found`);
80457
+ return obj;
79911
80458
  }
79912
80459
  };
79913
80460
 
@@ -79962,9 +80509,9 @@ var EquationHandleImpl = class _EquationHandleImpl extends FloatingObjectHandleI
79962
80509
  return new _EquationHandleImpl(receipt.id, this.objectsImpl, this.boundsReader);
79963
80510
  }
79964
80511
  async getData() {
79965
- const info = await this.objectsImpl.get(this.id);
79966
- if (!info) throw new KernelError("OPERATION_FAILED", `Equation ${this.id} not found`);
79967
- return info;
80512
+ const obj = await this.objectsImpl.getFullObject(this.id);
80513
+ if (!obj || obj.type !== "equation") throw new KernelError("OPERATION_FAILED", `Equation ${this.id} not found`);
80514
+ return obj;
79968
80515
  }
79969
80516
  };
79970
80517
 
@@ -79983,9 +80530,9 @@ var ConnectorHandleImpl = class _ConnectorHandleImpl extends FloatingObjectHandl
79983
80530
  return new _ConnectorHandleImpl(receipt.id, this.objectsImpl, this.boundsReader);
79984
80531
  }
79985
80532
  async getData() {
79986
- const info = await this.objectsImpl.get(this.id);
79987
- if (!info) throw new KernelError("OPERATION_FAILED", `Connector ${this.id} not found`);
79988
- return info;
80533
+ const obj = await this.objectsImpl.getFullObject(this.id);
80534
+ if (!obj || obj.type !== "connector") throw new KernelError("OPERATION_FAILED", `Connector ${this.id} not found`);
80535
+ return obj;
79989
80536
  }
79990
80537
  };
79991
80538
 
@@ -80001,9 +80548,9 @@ var ChartHandleImpl = class _ChartHandleImpl extends FloatingObjectHandleImpl {
80001
80548
  return new _ChartHandleImpl(receipt.id, this.objectsImpl, this.boundsReader);
80002
80549
  }
80003
80550
  async getData() {
80004
- const info = await this.objectsImpl.get(this.id);
80005
- if (!info) throw new KernelError("OPERATION_FAILED", `Chart ${this.id} not found`);
80006
- return info;
80551
+ const obj = await this.objectsImpl.getFullObject(this.id);
80552
+ if (!obj || obj.type !== "chart") throw new KernelError("OPERATION_FAILED", `Chart ${this.id} not found`);
80553
+ return obj;
80007
80554
  }
80008
80555
  };
80009
80556
 
@@ -80019,9 +80566,9 @@ var SmartArtHandleImpl = class _SmartArtHandleImpl extends FloatingObjectHandleI
80019
80566
  return new _SmartArtHandleImpl(receipt.id, this.objectsImpl, this.boundsReader);
80020
80567
  }
80021
80568
  async getData() {
80022
- const info = await this.objectsImpl.get(this.id);
80023
- if (!info) throw new KernelError("OPERATION_FAILED", `SmartArt ${this.id} not found`);
80024
- return info;
80569
+ const obj = await this.objectsImpl.getFullObject(this.id);
80570
+ if (!obj || obj.type !== "smartart") throw new KernelError("OPERATION_FAILED", `SmartArt ${this.id} not found`);
80571
+ return obj;
80025
80572
  }
80026
80573
  };
80027
80574
 
@@ -80037,9 +80584,9 @@ var SlicerHandleImpl = class _SlicerHandleImpl extends FloatingObjectHandleImpl
80037
80584
  return new _SlicerHandleImpl(receipt.id, this.objectsImpl, this.boundsReader);
80038
80585
  }
80039
80586
  async getData() {
80040
- const info = await this.objectsImpl.get(this.id);
80041
- if (!info) throw new KernelError("OPERATION_FAILED", `Slicer ${this.id} not found`);
80042
- return info;
80587
+ const obj = await this.objectsImpl.getFullObject(this.id);
80588
+ if (!obj) throw new KernelError("OPERATION_FAILED", `Slicer ${this.id} not found`);
80589
+ return obj;
80043
80590
  }
80044
80591
  };
80045
80592
 
@@ -80055,12 +80602,50 @@ var OleObjectHandleImpl = class _OleObjectHandleImpl extends FloatingObjectHandl
80055
80602
  return new _OleObjectHandleImpl(receipt.id, this.objectsImpl, this.boundsReader);
80056
80603
  }
80057
80604
  async getData() {
80058
- const info = await this.objectsImpl.get(this.id);
80059
- if (!info) throw new KernelError("OPERATION_FAILED", `OleObject ${this.id} not found`);
80060
- return info;
80605
+ const obj = await this.objectsImpl.getFullObject(this.id);
80606
+ if (!obj || obj.type !== "oleObject") throw new KernelError("OPERATION_FAILED", `OleObject ${this.id} not found`);
80607
+ return obj;
80061
80608
  }
80062
80609
  };
80063
80610
 
80611
+ // ../../kernel/src/api/worksheet/handles/floating-object-handle-factory.ts
80612
+ function createFloatingObjectHandle(id, type, objectsImpl, boundsReader, shapeType) {
80613
+ switch (type) {
80614
+ case "shape":
80615
+ return new ShapeHandleImpl(
80616
+ id,
80617
+ shapeType ?? "rect",
80618
+ objectsImpl,
80619
+ boundsReader
80620
+ );
80621
+ case "picture":
80622
+ return new PictureHandleImpl(id, objectsImpl, boundsReader);
80623
+ case "textbox":
80624
+ return new TextBoxHandleImpl(id, objectsImpl, boundsReader);
80625
+ case "drawing":
80626
+ return new DrawingHandleImpl(id, objectsImpl, boundsReader);
80627
+ case "equation":
80628
+ return new EquationHandleImpl(id, objectsImpl, boundsReader);
80629
+ case "connector":
80630
+ return new ConnectorHandleImpl(id, objectsImpl, boundsReader);
80631
+ case "chart":
80632
+ return new ChartHandleImpl(id, objectsImpl, boundsReader);
80633
+ case "smartart":
80634
+ return new SmartArtHandleImpl(id, objectsImpl, boundsReader);
80635
+ case "slicer":
80636
+ return new SlicerHandleImpl(id, objectsImpl, boundsReader);
80637
+ case "oleObject":
80638
+ return new OleObjectHandleImpl(id, objectsImpl, boundsReader);
80639
+ default:
80640
+ return new FloatingObjectHandleImpl(
80641
+ id,
80642
+ type,
80643
+ objectsImpl,
80644
+ boundsReader
80645
+ );
80646
+ }
80647
+ }
80648
+
80064
80649
  // ../../kernel/src/api/worksheet/collections/object-collection-impl.ts
80065
80650
  var WorksheetObjectCollectionImpl = class {
80066
80651
  constructor(objectsImpl, boundsReader) {
@@ -80129,30 +80714,7 @@ var WorksheetObjectCollectionImpl = class {
80129
80714
  return this.objectsImpl.ungroup(groupId);
80130
80715
  }
80131
80716
  createHandle(id, type) {
80132
- switch (type) {
80133
- case "shape":
80134
- return new ShapeHandleImpl(id, "rect", this.objectsImpl, this.boundsReader);
80135
- case "picture":
80136
- return new PictureHandleImpl(id, this.objectsImpl, this.boundsReader);
80137
- case "textbox":
80138
- return new TextBoxHandleImpl(id, this.objectsImpl, this.boundsReader);
80139
- case "drawing":
80140
- return new DrawingHandleImpl(id, this.objectsImpl, this.boundsReader);
80141
- case "equation":
80142
- return new EquationHandleImpl(id, this.objectsImpl, this.boundsReader);
80143
- case "connector":
80144
- return new ConnectorHandleImpl(id, this.objectsImpl, this.boundsReader);
80145
- case "chart":
80146
- return new ChartHandleImpl(id, this.objectsImpl, this.boundsReader);
80147
- case "smartart":
80148
- return new SmartArtHandleImpl(id, this.objectsImpl, this.boundsReader);
80149
- case "slicer":
80150
- return new SlicerHandleImpl(id, this.objectsImpl, this.boundsReader);
80151
- case "oleObject":
80152
- return new OleObjectHandleImpl(id, this.objectsImpl, this.boundsReader);
80153
- default:
80154
- return new FloatingObjectHandleImpl(id, type, this.objectsImpl, this.boundsReader);
80155
- }
80717
+ return createFloatingObjectHandle(id, type, this.objectsImpl, this.boundsReader);
80156
80718
  }
80157
80719
  };
80158
80720
 
@@ -80300,9 +80862,9 @@ var WordArtHandleImpl = class _WordArtHandleImpl extends FloatingObjectHandleImp
80300
80862
  return new _WordArtHandleImpl(receipt.id, this.objectsImpl, this.boundsReader);
80301
80863
  }
80302
80864
  async getData() {
80303
- const info = await this.objectsImpl.get(this.id);
80304
- if (!info) throw new KernelError("OPERATION_FAILED", `WordArt ${this.id} not found`);
80305
- return info;
80865
+ const obj = await this.objectsImpl.getFullObject(this.id);
80866
+ if (!obj || obj.type !== "textbox") throw new KernelError("OPERATION_FAILED", `WordArt ${this.id} not found`);
80867
+ return obj;
80306
80868
  }
80307
80869
  };
80308
80870
 
@@ -80580,7 +81142,7 @@ function chartConfigToInternal(config) {
80580
81142
  series: config.series,
80581
81143
  dataLabels: config.dataLabels,
80582
81144
  pieSlice: config.pieSlice,
80583
- trendline: config.trendline,
81145
+ trendline: config.trendlines ?? (config.trendline ? [config.trendline] : void 0),
80584
81146
  showLines: config.showLines,
80585
81147
  smoothLines: config.smoothLines,
80586
81148
  radarFilled: config.radarFilled,
@@ -80597,7 +81159,7 @@ function chartConfigToInternal(config) {
80597
81159
  splitValue: config.splitValue,
80598
81160
  widthCells: config.width,
80599
81161
  heightCells: config.height,
80600
- definition: buildStatisticalExtra(config)
81162
+ ooxml: buildStatisticalExtra(config)
80601
81163
  };
80602
81164
  }
80603
81165
  function chartUpdatesToInternal(updates) {
@@ -80624,7 +81186,11 @@ function chartUpdatesToInternal(updates) {
80624
81186
  if (updates.series !== void 0) result.series = updates.series;
80625
81187
  if (updates.dataLabels !== void 0) result.dataLabels = updates.dataLabels;
80626
81188
  if (updates.pieSlice !== void 0) result.pieSlice = updates.pieSlice;
80627
- if (updates.trendline !== void 0) result.trendline = updates.trendline;
81189
+ if (updates.trendlines !== void 0) {
81190
+ result.trendline = updates.trendlines;
81191
+ } else if (updates.trendline !== void 0) {
81192
+ result.trendline = updates.trendline ? [updates.trendline] : void 0;
81193
+ }
80628
81194
  if (updates.showLines !== void 0) result.showLines = updates.showLines;
80629
81195
  if (updates.smoothLines !== void 0) result.smoothLines = updates.smoothLines;
80630
81196
  if (updates.radarFilled !== void 0) result.radarFilled = updates.radarFilled;
@@ -80641,7 +81207,7 @@ function chartUpdatesToInternal(updates) {
80641
81207
  if (updates.splitValue !== void 0) result.splitValue = updates.splitValue;
80642
81208
  if (updates.name !== void 0) result.name = updates.name;
80643
81209
  const statisticalExtra = buildStatisticalExtra(updates);
80644
- if (statisticalExtra) result.definition = statisticalExtra;
81210
+ if (statisticalExtra) result.ooxml = statisticalExtra;
80645
81211
  return result;
80646
81212
  }
80647
81213
  function serializedChartToChart(chart) {
@@ -80666,7 +81232,8 @@ function serializedChartToChart(chart) {
80666
81232
  series: chart.series,
80667
81233
  dataLabels: chart.dataLabels,
80668
81234
  pieSlice: chart.pieSlice,
80669
- trendline: chart.trendline,
81235
+ trendline: Array.isArray(chart.trendline) ? chart.trendline[0] : chart.trendline,
81236
+ trendlines: chart.trendline,
80670
81237
  showLines: chart.showLines,
80671
81238
  smoothLines: chart.smoothLines,
80672
81239
  radarFilled: chart.radarFilled,
@@ -80681,7 +81248,7 @@ function serializedChartToChart(chart) {
80681
81248
  bubbleScale: chart.bubbleScale,
80682
81249
  splitType: chart.splitType,
80683
81250
  splitValue: chart.splitValue,
80684
- ...unpackStatisticalExtra(chart.definition),
81251
+ ...unpackStatisticalExtra(chart.ooxml),
80685
81252
  name: chart.name || void 0,
80686
81253
  createdAt: chart.createdAt,
80687
81254
  updatedAt: chart.updatedAt
@@ -80709,7 +81276,10 @@ async function applyUpdate(ctx, sheetId, chartId, updates) {
80709
81276
  function ensurePointsArray(series, minLength) {
80710
81277
  const points = [...series.points ?? []];
80711
81278
  while (points.length <= minLength) {
80712
- points.push({});
81279
+ points.push({ idx: points.length });
81280
+ }
81281
+ for (let i = 0; i < points.length; i++) {
81282
+ points[i].idx = i;
80713
81283
  }
80714
81284
  return points;
80715
81285
  }
@@ -80936,40 +81506,6 @@ init_esm_shims();
80936
81506
  init_a1();
80937
81507
  init_compute_core();
80938
81508
  init_errors();
80939
- function cellRefToA1(cellRef) {
80940
- const parts = cellRef.split(":");
80941
- if (parts.length !== 2) return cellRef;
80942
- const col = parseInt(parts[0], 10);
80943
- const row = parseInt(parts[1], 10);
80944
- if (isNaN(col) || isNaN(row)) return cellRef;
80945
- return toA12(row, col);
80946
- }
80947
- function toApiComment(c) {
80948
- const text = c.content ?? c.runs.map((r) => r.text).join("");
80949
- return {
80950
- id: c.id,
80951
- cellId: c.cellRef,
80952
- cellAddress: cellRefToA1(c.cellRef),
80953
- author: c.author,
80954
- authorId: c.authorId,
80955
- text,
80956
- content: c.runs.length > 0 ? c.runs.map((r) => ({
80957
- text: r.text,
80958
- bold: r.bold || void 0,
80959
- italic: r.italic || void 0,
80960
- underline: r.underline || void 0,
80961
- strikethrough: r.strikethrough || void 0,
80962
- color: r.color ?? void 0,
80963
- fontName: r.fontName ?? void 0,
80964
- fontSize: r.fontSize ?? void 0
80965
- })) : void 0,
80966
- threadId: c.threadId || void 0,
80967
- parentId: c.parentId ?? void 0,
80968
- resolved: c.resolved ?? void 0,
80969
- createdAt: c.createdAt ?? 0,
80970
- modifiedAt: c.modifiedAt ?? void 0
80971
- };
80972
- }
80973
81509
  function propagateResolved(comments) {
80974
81510
  const rootResolved = /* @__PURE__ */ new Map();
80975
81511
  for (const c of comments) {
@@ -81095,7 +81631,7 @@ var WorksheetCommentsImpl = class {
81095
81631
  "addCommentByPosition: no comment returned in MutationResult.data"
81096
81632
  );
81097
81633
  }
81098
- return toApiComment(comment);
81634
+ return comment;
81099
81635
  }
81100
81636
  async update(commentId, text) {
81101
81637
  if (!text || text.trim().length === 0) {
@@ -81114,7 +81650,7 @@ var WorksheetCommentsImpl = class {
81114
81650
  }
81115
81651
  async list() {
81116
81652
  const comments = await this.ctx.computeBridge.getAllComments(this.sheetId);
81117
- return propagateResolved(comments.map(toApiComment));
81653
+ return propagateResolved(comments);
81118
81654
  }
81119
81655
  async getForCell(a, b) {
81120
81656
  const { row, col } = resolveCell(a, b);
@@ -81123,7 +81659,7 @@ var WorksheetCommentsImpl = class {
81123
81659
  row,
81124
81660
  col
81125
81661
  );
81126
- return comments.map(toApiComment);
81662
+ return comments;
81127
81663
  }
81128
81664
  async addReply(commentId, text, author) {
81129
81665
  const parent = await this.ctx.computeBridge.getComment(this.sheetId, commentId);
@@ -81140,7 +81676,7 @@ var WorksheetCommentsImpl = class {
81140
81676
  author,
81141
81677
  { parentId: commentId }
81142
81678
  );
81143
- return toApiComment(comment);
81679
+ return comment;
81144
81680
  }
81145
81681
  async getThread(commentId) {
81146
81682
  const comment = await this.ctx.computeBridge.getComment(this.sheetId, commentId);
@@ -81149,11 +81685,11 @@ var WorksheetCommentsImpl = class {
81149
81685
  }
81150
81686
  const threadId = comment.threadId ?? comment.id;
81151
81687
  const thread = await this.ctx.computeBridge.getCommentThread(this.sheetId, threadId);
81152
- return propagateResolved(thread.map(toApiComment));
81688
+ return propagateResolved(thread);
81153
81689
  }
81154
81690
  async getById(commentId) {
81155
81691
  const comment = await this.ctx.computeBridge.getComment(this.sheetId, commentId);
81156
- return comment ? toApiComment(comment) : null;
81692
+ return comment ?? null;
81157
81693
  }
81158
81694
  };
81159
81695
 
@@ -81376,18 +81912,9 @@ var WorksheetFiltersImpl = class {
81376
81912
  const filters = await this.ctx.computeBridge.getFiltersInSheet(this.sheetId);
81377
81913
  if (filters.length === 0) return null;
81378
81914
  const filter = filters[0];
81379
- const columns = /* @__PURE__ */ new Map();
81380
- if (filter.columnFilters) {
81381
- for (const [key, value] of Object.entries(filter.columnFilters)) {
81382
- const colIdx = parseInt(key, 10);
81383
- if (!isNaN(colIdx) && value) {
81384
- columns.set(colIdx, value);
81385
- }
81386
- }
81387
- }
81388
81915
  return {
81389
81916
  range: `${toA12(filter.startRow ?? 0, filter.startCol ?? 0)}:${toA12(filter.endRow ?? 0, filter.endCol ?? 0)}`,
81390
- columns
81917
+ columnFilters: filter.columnFilters ?? {}
81391
81918
  };
81392
81919
  }
81393
81920
  async getForRange(range2) {
@@ -81458,9 +81985,9 @@ var WorksheetFiltersImpl = class {
81458
81985
  async list() {
81459
81986
  const raw = await this.ctx.computeBridge.getFiltersInSheet(this.sheetId);
81460
81987
  return raw.map((f) => ({
81461
- id: f.id ?? f.filterId,
81462
- range: f.range,
81463
- columns: f.columns
81988
+ id: f.id,
81989
+ range: void 0,
81990
+ columnFilters: f.columnFilters
81464
81991
  }));
81465
81992
  }
81466
81993
  async listDetails() {
@@ -81478,13 +82005,22 @@ var WorksheetFiltersImpl = class {
81478
82005
  }
81479
82006
  async getSortState(filterId) {
81480
82007
  try {
81481
- return await this.ctx.computeBridge.getFilterSortState(this.sheetId, filterId);
82008
+ const sortState = await this.ctx.computeBridge.getFilterSortState(this.sheetId, filterId);
82009
+ if (!sortState) return null;
82010
+ return {
82011
+ column: sortState.columnCellId,
82012
+ direction: sortState.order === "asc" ? "asc" : "desc"
82013
+ };
81482
82014
  } catch {
81483
82015
  return null;
81484
82016
  }
81485
82017
  }
81486
82018
  async setSortState(filterId, state) {
81487
- await this.ctx.computeBridge.setFilterSortState(this.sheetId, filterId, state);
82019
+ await this.ctx.computeBridge.setFilterSortState(this.sheetId, filterId, {
82020
+ columnCellId: String(state.column),
82021
+ order: state.direction === "asc" ? "asc" : "desc",
82022
+ sortBy: "value"
82023
+ });
81488
82024
  }
81489
82025
  };
81490
82026
 
@@ -81519,6 +82055,12 @@ init_esm_shims();
81519
82055
  // ../../number-formats/src/constants.ts
81520
82056
  init_esm_shims();
81521
82057
 
82058
+ // ../../contracts/src/number-formats/constants.ts
82059
+ init_esm_shims();
82060
+
82061
+ // ../../contracts/src/number-formats/constants.gen.ts
82062
+ init_esm_shims();
82063
+
81522
82064
  // ../../number-formats/src/format-utils.ts
81523
82065
  init_esm_shims();
81524
82066
 
@@ -82860,7 +83402,12 @@ var WorksheetPivotsImpl = class _WorksheetPivotsImpl {
82860
83402
  }
82861
83403
  async queryPivot(pivotName, filters) {
82862
83404
  const pivot = await this.findPivotByName(pivotName);
82863
- if (!pivot) return null;
83405
+ if (!pivot) {
83406
+ throw new KernelError(
83407
+ "COMPUTE_ERROR",
83408
+ `queryPivot: Pivot table "${pivotName}" not found on this sheet`
83409
+ );
83410
+ }
82864
83411
  const pivotId = pivot.id ?? pivot.name;
82865
83412
  const result = await this.ctx.pivot.compute(this.sheetId, pivotId);
82866
83413
  if (!result) return null;
@@ -83217,7 +83764,7 @@ init_errors();
83217
83764
 
83218
83765
  // ../../kernel/src/api/worksheet/operations/sheet-management-operations.ts
83219
83766
  init_esm_shims();
83220
- import { DEFAULT_PROTECTION_OPTIONS as DEFAULT_PROTECTION_OPTIONS2 } from "@mog-sdk/spreadsheet-contracts/protection";
83767
+ init_protection();
83221
83768
  function parseCellRef2(ref) {
83222
83769
  const match = ref.match(/^([A-Z]+)(\d+)$/i);
83223
83770
  if (!match) return null;
@@ -83641,12 +84188,35 @@ var WorksheetSlicersImpl = class {
83641
84188
  }
83642
84189
  async add(config) {
83643
84190
  const caption = config.caption ?? config.name ?? "";
84191
+ const source = config.source ?? {
84192
+ type: "table",
84193
+ tableId: config.tableName ?? "",
84194
+ columnCellId: config.columnName ?? ""
84195
+ };
84196
+ const defaultStyle = {
84197
+ columnCount: 1,
84198
+ buttonHeight: 30,
84199
+ showSelectionIndicator: true,
84200
+ crossFilter: "showItemsWithDataAtTop",
84201
+ customListSort: true,
84202
+ showItemsWithNoData: true,
84203
+ sortOrder: "ascending"
84204
+ };
83644
84205
  const storedConfig = {
83645
- ...config,
83646
- caption
84206
+ id: config.id ?? "",
84207
+ sheetId: config.sheetId ?? "",
84208
+ source,
84209
+ caption,
84210
+ style: config.style ?? defaultStyle,
84211
+ position: config.position,
84212
+ zIndex: config.zIndex ?? 0,
84213
+ locked: config.locked ?? false,
84214
+ showHeader: config.showHeader ?? true,
84215
+ multiSelect: config.multiSelect ?? true,
84216
+ selectedValues: config.selectedValues ?? []
83647
84217
  };
83648
84218
  await this.ctx.computeBridge.createSlicer(this.sheetId, storedConfig);
83649
- return storedConfig.id ?? "";
84219
+ return storedConfig.id;
83650
84220
  }
83651
84221
  async remove(slicerId) {
83652
84222
  validateSlicerId(slicerId, "deleteSlicer");
@@ -83808,11 +84378,15 @@ var WorksheetSlicersImpl = class {
83808
84378
  }
83809
84379
  async updateConfig(slicerId, updates) {
83810
84380
  validateSlicerId(slicerId, "updateSlicerConfig");
83811
- await this.ctx.computeBridge.updateSlicerConfig(
83812
- this.sheetId,
83813
- slicerId,
83814
- updates
83815
- );
84381
+ const bridgeUpdate = {};
84382
+ if (updates.caption !== void 0) bridgeUpdate.caption = updates.caption;
84383
+ if (updates.name !== void 0 && bridgeUpdate.caption === void 0) {
84384
+ bridgeUpdate.caption = updates.name;
84385
+ }
84386
+ if (updates.style !== void 0) bridgeUpdate.style = updates.style;
84387
+ if (updates.position !== void 0) bridgeUpdate.position = updates.position;
84388
+ if (updates.showHeader !== void 0) bridgeUpdate.showHeader = updates.showHeader;
84389
+ await this.ctx.computeBridge.updateSlicerConfig(this.sheetId, slicerId, bridgeUpdate);
83816
84390
  }
83817
84391
  async getState(slicerId) {
83818
84392
  const state = await this.ctx.computeBridge.getSlicerState(this.sheetId, slicerId);
@@ -84406,6 +84980,7 @@ function toBridgeTextToColumnsOptions(options) {
84406
84980
  // ../../kernel/src/api/worksheet/tables.ts
84407
84981
  init_esm_shims();
84408
84982
  init_errors();
84983
+ init_value_conversions();
84409
84984
 
84410
84985
  // ../../kernel/src/api/worksheet/operations/table-operations.ts
84411
84986
  init_esm_shims();
@@ -84427,31 +85002,15 @@ function bridgeTableToTableInfo(table) {
84427
85002
  const endRowA1 = table.range.endRow + 1;
84428
85003
  const range2 = `${startLetter}${startRowA1}:${endLetter}${endRowA1}`;
84429
85004
  return {
84430
- id: table.id,
84431
- name: table.name,
84432
- range: range2,
84433
- hasHeaders: table.hasHeaderRow,
84434
- showTotals: table.hasTotalsRow,
84435
- style: table.style || void 0,
84436
- highlightFirstColumn: table.emphasizeFirstColumn,
84437
- highlightLastColumn: table.emphasizeLastColumn,
84438
- showBandedColumns: table.bandedColumns,
84439
- showBandedRows: table.bandedRows,
84440
- showFilterButton: table.showFilterButtons,
84441
- showHeaders: table.hasHeaderRow,
84442
- columns: table.columns.map((col) => ({
84443
- name: col.name,
84444
- index: col.index,
84445
- totalFunction: col.totalsFunction ?? void 0,
84446
- calculatedFormula: col.calculatedFormula ?? void 0
84447
- }))
85005
+ ...table,
85006
+ range: range2
84448
85007
  };
84449
85008
  }
84450
85009
  function getTableColumnDataCellsFromInfo(table, colIndex) {
84451
85010
  const parsed = parseA1Range(table.range);
84452
85011
  if (!parsed) return [];
84453
- const dataStartRow = table.hasHeaders ? parsed.startRow + 1 : parsed.startRow;
84454
- const dataEndRow = table.showTotals ? parsed.endRow - 1 : parsed.endRow;
85012
+ const dataStartRow = table.hasHeaderRow ? parsed.startRow + 1 : parsed.startRow;
85013
+ const dataEndRow = table.hasTotalsRow ? parsed.endRow - 1 : parsed.endRow;
84455
85014
  if (dataStartRow > dataEndRow) return [];
84456
85015
  const col = parsed.startCol + colIndex;
84457
85016
  if (col > parsed.endCol) return [];
@@ -84464,15 +85023,15 @@ function getTableColumnDataCellsFromInfo(table, colIndex) {
84464
85023
  function getDataBodyRangeFromInfo(table) {
84465
85024
  const parsed = parseA1Range(table.range);
84466
85025
  if (!parsed) return null;
84467
- const dataStartRow = table.hasHeaders ? parsed.startRow + 1 : parsed.startRow;
84468
- const dataEndRow = table.showTotals ? parsed.endRow - 1 : parsed.endRow;
85026
+ const dataStartRow = table.hasHeaderRow ? parsed.startRow + 1 : parsed.startRow;
85027
+ const dataEndRow = table.hasTotalsRow ? parsed.endRow - 1 : parsed.endRow;
84469
85028
  if (dataStartRow > dataEndRow) return null;
84470
85029
  const startLetter = colToLetter3(parsed.startCol);
84471
85030
  const endLetter = colToLetter3(parsed.endCol);
84472
85031
  return `${startLetter}${dataStartRow + 1}:${endLetter}${dataEndRow + 1}`;
84473
85032
  }
84474
85033
  function getHeaderRowRangeFromInfo(table) {
84475
- if (!table.hasHeaders) return null;
85034
+ if (!table.hasHeaderRow) return null;
84476
85035
  const parsed = parseA1Range(table.range);
84477
85036
  if (!parsed) return null;
84478
85037
  const startLetter = colToLetter3(parsed.startCol);
@@ -84481,7 +85040,7 @@ function getHeaderRowRangeFromInfo(table) {
84481
85040
  return `${startLetter}${headerRow}:${endLetter}${headerRow}`;
84482
85041
  }
84483
85042
  function getTotalRowRangeFromInfo(table) {
84484
- if (!table.showTotals) return null;
85043
+ if (!table.hasTotalsRow) return null;
84485
85044
  const parsed = parseA1Range(table.range);
84486
85045
  if (!parsed) return null;
84487
85046
  const startLetter = colToLetter3(parsed.startCol);
@@ -84577,23 +85136,23 @@ var WorksheetTablesImpl = class {
84577
85136
  if (updates.name !== void 0) {
84578
85137
  await this.ctx.computeBridge.renameTable(tableName, updates.name);
84579
85138
  }
84580
- const boolOptionMap = {
84581
- highlightFirstColumn: "emphasizeFirstColumn",
84582
- highlightLastColumn: "emphasizeLastColumn",
84583
- showBandedColumns: "bandedColumns",
84584
- showBandedRows: "bandedRows",
84585
- showFilterButton: "showFilterButtons"
84586
- };
84587
- for (const [key, bridgeOption] of Object.entries(boolOptionMap)) {
85139
+ const boolOptions = [
85140
+ "emphasizeFirstColumn",
85141
+ "emphasizeLastColumn",
85142
+ "bandedColumns",
85143
+ "bandedRows",
85144
+ "showFilterButtons"
85145
+ ];
85146
+ for (const key of boolOptions) {
84588
85147
  if (updates[key] !== void 0) {
84589
- await this.ctx.computeBridge.setTableBoolOption(tableName, bridgeOption, updates[key]);
85148
+ await this.ctx.computeBridge.setTableBoolOption(tableName, key, updates[key]);
84590
85149
  }
84591
85150
  }
84592
- if (updates.showHeaders !== void 0) {
84593
- await this.setShowHeaders(tableName, updates.showHeaders);
85151
+ if (updates.hasHeaderRow !== void 0) {
85152
+ await this.setShowHeaders(tableName, updates.hasHeaderRow);
84594
85153
  }
84595
- if (updates.showTotals !== void 0) {
84596
- await this.setShowTotals(tableName, updates.showTotals);
85154
+ if (updates.hasTotalsRow !== void 0) {
85155
+ await this.setShowTotals(tableName, updates.hasTotalsRow);
84597
85156
  }
84598
85157
  }
84599
85158
  async getAtCell(row, col) {
@@ -84714,14 +85273,14 @@ var WorksheetTablesImpl = class {
84714
85273
  async setShowHeaders(tableName, visible) {
84715
85274
  const table = await this.get(tableName);
84716
85275
  if (!table) throw new KernelError("COMPUTE_ERROR", `Table not found: ${tableName}`);
84717
- if (table.hasHeaders !== visible) {
85276
+ if (table.hasHeaderRow !== visible) {
84718
85277
  await this.ctx.computeBridge.toggleHeaderRow(tableName);
84719
85278
  }
84720
85279
  }
84721
85280
  async setShowTotals(tableName, visible) {
84722
85281
  const table = await this.get(tableName);
84723
85282
  if (!table) throw new KernelError("COMPUTE_ERROR", `Table not found: ${tableName}`);
84724
- if ((table.showTotals ?? false) !== visible) {
85283
+ if (table.hasTotalsRow !== visible) {
84725
85284
  await this.ctx.computeBridge.toggleTotalsRow(tableName);
84726
85285
  }
84727
85286
  }
@@ -84755,8 +85314,8 @@ var WorksheetTablesImpl = class {
84755
85314
  if (!table) throw new KernelError("COMPUTE_ERROR", `Table not found: ${tableName}`);
84756
85315
  const parsed = parseA1Range2(table.range);
84757
85316
  if (!parsed) return 0;
84758
- const dataStartRow = table.hasHeaders ? parsed.startRow + 1 : parsed.startRow;
84759
- const dataEndRow = table.showTotals ? parsed.endRow - 1 : parsed.endRow;
85317
+ const dataStartRow = table.hasHeaderRow ? parsed.startRow + 1 : parsed.startRow;
85318
+ const dataEndRow = table.hasTotalsRow ? parsed.endRow - 1 : parsed.endRow;
84760
85319
  return Math.max(0, dataEndRow - dataStartRow + 1);
84761
85320
  }
84762
85321
  async getRowRange(tableName, index) {
@@ -84764,7 +85323,7 @@ var WorksheetTablesImpl = class {
84764
85323
  if (!table) throw new KernelError("COMPUTE_ERROR", `Table not found: ${tableName}`);
84765
85324
  const parsed = parseA1Range2(table.range);
84766
85325
  if (!parsed) throw new KernelError("COMPUTE_ERROR", `Invalid table range: ${table.range}`);
84767
- const dataStartRow = table.hasHeaders ? parsed.startRow + 1 : parsed.startRow;
85326
+ const dataStartRow = table.hasHeaderRow ? parsed.startRow + 1 : parsed.startRow;
84768
85327
  const absRow = dataStartRow + index;
84769
85328
  const startLetter = colToLetter3(parsed.startCol);
84770
85329
  const endLetter = colToLetter3(parsed.endCol);
@@ -84775,7 +85334,7 @@ var WorksheetTablesImpl = class {
84775
85334
  if (!table) throw new KernelError("COMPUTE_ERROR", `Table not found: ${tableName}`);
84776
85335
  const parsed = parseA1Range2(table.range);
84777
85336
  if (!parsed) return [];
84778
- const dataStartRow = table.hasHeaders ? parsed.startRow + 1 : parsed.startRow;
85337
+ const dataStartRow = table.hasHeaderRow ? parsed.startRow + 1 : parsed.startRow;
84779
85338
  const absRow = dataStartRow + index;
84780
85339
  return queryRangeValues(this.ctx, this.sheetId, absRow, parsed.startCol, absRow, parsed.endCol);
84781
85340
  }
@@ -84784,7 +85343,7 @@ var WorksheetTablesImpl = class {
84784
85343
  if (!table) throw new KernelError("COMPUTE_ERROR", `Table not found: ${tableName}`);
84785
85344
  const parsed = parseA1Range2(table.range);
84786
85345
  if (!parsed) return;
84787
- const dataStartRow = table.hasHeaders ? parsed.startRow + 1 : parsed.startRow;
85346
+ const dataStartRow = table.hasHeaderRow ? parsed.startRow + 1 : parsed.startRow;
84788
85347
  const absRow = dataStartRow + index;
84789
85348
  const edits = values.map((val, i) => ({
84790
85349
  row: absRow,
@@ -84803,15 +85362,15 @@ var WorksheetTablesImpl = class {
84803
85362
  if (!parsed) return null;
84804
85363
  const col = parsed.startCol + columnIndex;
84805
85364
  if (col > parsed.endCol) return null;
84806
- const dataStartRow = table.hasHeaders ? parsed.startRow + 1 : parsed.startRow;
84807
- const dataEndRow = table.showTotals ? parsed.endRow - 1 : parsed.endRow;
85365
+ const dataStartRow = table.hasHeaderRow ? parsed.startRow + 1 : parsed.startRow;
85366
+ const dataEndRow = table.hasTotalsRow ? parsed.endRow - 1 : parsed.endRow;
84808
85367
  if (dataStartRow > dataEndRow) return null;
84809
85368
  const letter = colToLetter3(col);
84810
85369
  return `${letter}${dataStartRow + 1}:${letter}${dataEndRow + 1}`;
84811
85370
  }
84812
85371
  async getColumnHeaderRange(tableName, columnIndex) {
84813
85372
  const table = await this.get(tableName);
84814
- if (!table || !table.hasHeaders) return null;
85373
+ if (!table || !table.hasHeaderRow) return null;
84815
85374
  const parsed = parseA1Range2(table.range);
84816
85375
  if (!parsed) return null;
84817
85376
  const col = parsed.startCol + columnIndex;
@@ -84832,7 +85391,7 @@ var WorksheetTablesImpl = class {
84832
85391
  }
84833
85392
  async getColumnTotalRange(tableName, columnIndex) {
84834
85393
  const table = await this.get(tableName);
84835
- if (!table || !table.showTotals) return null;
85394
+ if (!table || !table.hasTotalsRow) return null;
84836
85395
  const parsed = parseA1Range2(table.range);
84837
85396
  if (!parsed) return null;
84838
85397
  const col = parsed.startCol + columnIndex;
@@ -84848,8 +85407,8 @@ var WorksheetTablesImpl = class {
84848
85407
  if (!parsed) return [];
84849
85408
  const col = parsed.startCol + columnIndex;
84850
85409
  if (col > parsed.endCol) return [];
84851
- const dataStartRow = table.hasHeaders ? parsed.startRow + 1 : parsed.startRow;
84852
- const dataEndRow = table.showTotals ? parsed.endRow - 1 : parsed.endRow;
85410
+ const dataStartRow = table.hasHeaderRow ? parsed.startRow + 1 : parsed.startRow;
85411
+ const dataEndRow = table.hasTotalsRow ? parsed.endRow - 1 : parsed.endRow;
84853
85412
  if (dataStartRow > dataEndRow) return [];
84854
85413
  return queryRangeValues(this.ctx, this.sheetId, dataStartRow, col, dataEndRow, col);
84855
85414
  }
@@ -84860,7 +85419,7 @@ var WorksheetTablesImpl = class {
84860
85419
  if (!parsed) return;
84861
85420
  const col = parsed.startCol + columnIndex;
84862
85421
  if (col > parsed.endCol) return;
84863
- const dataStartRow = table.hasHeaders ? parsed.startRow + 1 : parsed.startRow;
85422
+ const dataStartRow = table.hasHeaderRow ? parsed.startRow + 1 : parsed.startRow;
84864
85423
  const edits = values.map((val, i) => ({
84865
85424
  row: dataStartRow + i,
84866
85425
  col,
@@ -84876,8 +85435,8 @@ var WorksheetTablesImpl = class {
84876
85435
  if (!table) throw new KernelError("COMPUTE_ERROR", `Table not found: ${tableName}`);
84877
85436
  const parsed = parseA1Range2(table.range);
84878
85437
  if (!parsed) return;
84879
- const dataStartRow = table.hasHeaders ? parsed.startRow + 1 : parsed.startRow;
84880
- const dataEndRow = table.showTotals ? parsed.endRow - 1 : parsed.endRow;
85438
+ const dataStartRow = table.hasHeaderRow ? parsed.startRow + 1 : parsed.startRow;
85439
+ const dataEndRow = table.hasTotalsRow ? parsed.endRow - 1 : parsed.endRow;
84881
85440
  if (dataStartRow > dataEndRow) return;
84882
85441
  const numCols = parsed.endCol - parsed.startCol + 1;
84883
85442
  const numRows = dataEndRow - dataStartRow + 1;
@@ -84897,7 +85456,7 @@ var WorksheetTablesImpl = class {
84897
85456
  const row = [];
84898
85457
  for (let c = 0; c < numCols; c++) {
84899
85458
  const cell = cellMap.get(`${dataStartRow + r},${parsed.startCol + c}`);
84900
- row.push(cell?.value ?? null);
85459
+ row.push(normalizeCellValue(cell?.value ?? null));
84901
85460
  }
84902
85461
  rows.push(row);
84903
85462
  }
@@ -84969,7 +85528,7 @@ async function queryRangeValues(ctx, sheetId, startRow, startCol, endRow, endCol
84969
85528
  for (let r = startRow; r <= endRow; r++) {
84970
85529
  for (let c = startCol; c <= endCol; c++) {
84971
85530
  const cell = cellMap.get(`${r},${c}`);
84972
- values.push(cell?.value ?? null);
85531
+ values.push(normalizeCellValue(cell?.value ?? null));
84973
85532
  }
84974
85533
  }
84975
85534
  return values;
@@ -85559,6 +86118,117 @@ var WorksheetViewImpl = class {
85559
86118
  }
85560
86119
  };
85561
86120
 
86121
+ // ../../kernel/src/api/worksheet/what-if.ts
86122
+ init_esm_shims();
86123
+
86124
+ // ../../kernel/src/api/worksheet/operations/data-table-operations.ts
86125
+ init_esm_shims();
86126
+ init_errors();
86127
+ async function dataTable(ctx, sheetId, formulaCell, options) {
86128
+ const formulaPos = resolveCell(formulaCell);
86129
+ const formulaCellId = await getCellIdAt2(ctx, sheetId, formulaPos.row, formulaPos.col);
86130
+ if (!formulaCellId) {
86131
+ throw new KernelError("COMPUTE_ERROR", `Formula cell ${formulaCell} has no content.`);
86132
+ }
86133
+ let rowInputCellId = null;
86134
+ if (options.rowInputCell) {
86135
+ const pos = resolveCell(options.rowInputCell);
86136
+ const cid = await getCellIdAt2(ctx, sheetId, pos.row, pos.col);
86137
+ if (!cid) {
86138
+ throw new KernelError(
86139
+ "COMPUTE_ERROR",
86140
+ `Row input cell ${options.rowInputCell} must contain a value before calling dataTable().`
86141
+ );
86142
+ }
86143
+ rowInputCellId = cid;
86144
+ }
86145
+ let colInputCellId = null;
86146
+ if (options.colInputCell) {
86147
+ const pos = resolveCell(options.colInputCell);
86148
+ const cid = await getCellIdAt2(ctx, sheetId, pos.row, pos.col);
86149
+ if (!cid) {
86150
+ throw new KernelError(
86151
+ "COMPUTE_ERROR",
86152
+ `Column input cell ${options.colInputCell} must contain a value before calling dataTable().`
86153
+ );
86154
+ }
86155
+ colInputCellId = cid;
86156
+ }
86157
+ const bridgeResult = await ctx.computeBridge.dataTable({
86158
+ formula_cell: formulaCellId,
86159
+ row_input_cell: rowInputCellId,
86160
+ col_input_cell: colInputCellId,
86161
+ row_values: options.rowValues,
86162
+ col_values: options.colValues
86163
+ });
86164
+ const result = bridgeResult;
86165
+ return {
86166
+ results: result.results,
86167
+ cellCount: result.cellCount ?? result.cell_count ?? 0,
86168
+ elapsedMs: result.elapsedMs ?? result.elapsed_ms ?? 0,
86169
+ cancelled: result.cancelled ?? false
86170
+ };
86171
+ }
86172
+
86173
+ // ../../kernel/src/api/worksheet/operations/goal-seek-operations.ts
86174
+ init_esm_shims();
86175
+ init_errors();
86176
+ async function goalSeek(ctx, sheetId, targetCell, targetValue, changingCell) {
86177
+ const targetPos = resolveCell(targetCell);
86178
+ const changingPos = resolveCell(changingCell);
86179
+ const formulaCellId = await getCellIdAt2(
86180
+ ctx,
86181
+ sheetId,
86182
+ targetPos.row,
86183
+ targetPos.col
86184
+ );
86185
+ if (!formulaCellId) {
86186
+ throw new KernelError("COMPUTE_ERROR", `Target cell ${targetCell} has no content.`);
86187
+ }
86188
+ const inputCellId = await getCellIdAt2(
86189
+ ctx,
86190
+ sheetId,
86191
+ changingPos.row,
86192
+ changingPos.col
86193
+ );
86194
+ if (!inputCellId) {
86195
+ throw new KernelError("COMPUTE_ERROR", `Changing cell ${changingCell} has no content.`);
86196
+ }
86197
+ const changingData = await getCell(ctx, sheetId, changingPos.row, changingPos.col);
86198
+ const initialGuess = typeof changingData?.value === "number" ? changingData.value : 0;
86199
+ const bridgeResult = await ctx.computeBridge.goalSeek({
86200
+ formula_cell: formulaCellId,
86201
+ target: targetValue,
86202
+ input_cell: inputCellId,
86203
+ initial_guess: initialGuess
86204
+ });
86205
+ const result = bridgeResult;
86206
+ const solutionValue = result.solutionValue ?? result.solution_value;
86207
+ const iterations = result.iterations;
86208
+ if (result.found && solutionValue != null) {
86209
+ await setCell(ctx, sheetId, changingPos.row, changingPos.col, solutionValue);
86210
+ }
86211
+ return {
86212
+ found: result.found,
86213
+ value: solutionValue,
86214
+ iterations
86215
+ };
86216
+ }
86217
+
86218
+ // ../../kernel/src/api/worksheet/what-if.ts
86219
+ var WorksheetWhatIfImpl = class {
86220
+ constructor(ctx, sheetId) {
86221
+ this.ctx = ctx;
86222
+ this.sheetId = sheetId;
86223
+ }
86224
+ async goalSeek(targetCell, targetValue, changingCell) {
86225
+ return goalSeek(this.ctx, this.sheetId, targetCell, targetValue, changingCell);
86226
+ }
86227
+ async dataTable(formulaCell, options) {
86228
+ return dataTable(this.ctx, this.sheetId, formulaCell, options);
86229
+ }
86230
+ };
86231
+
85562
86232
  // ../../kernel/src/api/worksheet/objects.ts
85563
86233
  init_esm_shims();
85564
86234
  init_errors();
@@ -86262,8 +86932,8 @@ function objectToInfo(obj) {
86262
86932
  flipH: obj.position?.flipH,
86263
86933
  flipV: obj.position?.flipV,
86264
86934
  zIndex: obj.zIndex,
86265
- visible: obj.visible,
86266
- groupId: obj.groupId,
86935
+ visible: "visible" in obj ? obj.visible : void 0,
86936
+ groupId: "groupId" in obj ? obj.groupId : void 0,
86267
86937
  anchorType: obj.position?.anchorType,
86268
86938
  altText: obj.altText
86269
86939
  };
@@ -86476,7 +87146,7 @@ async function getConnectorData(manager, connectorId) {
86476
87146
  }
86477
87147
  async function getGroupMembers(manager, _ctx, sheetId, groupId) {
86478
87148
  const objects = await manager.getObjectsInSheet(sheetId);
86479
- return objects.filter((obj) => obj.groupId === groupId).map((obj) => obj.id);
87149
+ return objects.filter((obj) => "groupId" in obj && obj.groupId === groupId).map((obj) => obj.id);
86480
87150
  }
86481
87151
  function deriveImageFormat(src) {
86482
87152
  const dataUrlMatch = src.match(/^data:image\/([^;,]+)/);
@@ -86525,6 +87195,7 @@ async function getConnectionSiteCount(manager, objectId) {
86525
87195
 
86526
87196
  // ../../kernel/src/api/worksheet/operations/shape-operations.ts
86527
87197
  init_esm_shims();
87198
+ init_floating_object_mapper();
86528
87199
  function shapeObjectToShape(shape, sheetId) {
86529
87200
  return {
86530
87201
  id: shape.id,
@@ -86564,7 +87235,7 @@ function buildMutationReceipt2(change, action) {
86564
87235
  domain: "floatingObject",
86565
87236
  action,
86566
87237
  id: change.objectId,
86567
- object: change.data,
87238
+ object: change.data ? toFloatingObject(change.data) : createMinimalFloatingObject("shape", change.objectId, ""),
86568
87239
  bounds
86569
87240
  };
86570
87241
  }
@@ -86599,7 +87270,7 @@ async function createShape(ctx, sheetId, config) {
86599
87270
  domain: "floatingObject",
86600
87271
  action: "create",
86601
87272
  id: "",
86602
- object: { id: "", sheetId, type: "shape", shapeType: config.type },
87273
+ object: createMinimalFloatingObject("shape", "", sheetId),
86603
87274
  bounds: {
86604
87275
  x: 0,
86605
87276
  y: 0,
@@ -86689,7 +87360,7 @@ async function updateShape(ctx, sheetId, shapeId, updates) {
86689
87360
  domain: "floatingObject",
86690
87361
  action: "update",
86691
87362
  id: shapeId,
86692
- object: { id: shapeId, sheetId, type: "shape" },
87363
+ object: createMinimalFloatingObject("shape", shapeId, sheetId),
86693
87364
  bounds: { x: 0, y: 0, width: 0, height: 0, rotation: 0 }
86694
87365
  };
86695
87366
  }
@@ -86965,6 +87636,15 @@ var WorksheetObjectsImpl = class {
86965
87636
  async get(objectId) {
86966
87637
  return await getFloatingObject(this.mgr, this.ctx, this.sheetId, objectId);
86967
87638
  }
87639
+ /**
87640
+ * Get the full domain-typed FloatingObject for an object by ID.
87641
+ * Returns the discriminated union variant (ShapeObject, PictureObject, etc.)
87642
+ * directly from the manager, bypassing the API-level FloatingObjectInfo projection.
87643
+ */
87644
+ async getFullObject(objectId) {
87645
+ const obj = await this.mgr.getObject(objectId);
87646
+ return obj ?? null;
87647
+ }
86968
87648
  async computeObjectBounds(objectId) {
86969
87649
  const obj = await this.mgr.getObject(objectId);
86970
87650
  if (!obj) return null;
@@ -87333,7 +88013,7 @@ var WorksheetImpl = class {
87333
88013
  async getValue(a, b) {
87334
88014
  const { row, col } = resolveCell(a, b);
87335
88015
  const data = await getCell(this.ctx, this.sheetId, row, col);
87336
- return data?.value ?? null;
88016
+ return normalizeCellValue(data?.value ?? null);
87337
88017
  }
87338
88018
  async getData() {
87339
88019
  const range2 = await getUsedRange2(this.ctx, this.sheetId);
@@ -87345,7 +88025,7 @@ var WorksheetImpl = class {
87345
88025
  endRow: range2.endRow,
87346
88026
  endCol: range2.endCol
87347
88027
  });
87348
- return cellData.map((row) => row.map((cell) => cell.value ?? null));
88028
+ return cellData.map((row) => row.map((cell) => normalizeCellValue(cell.value ?? null)));
87349
88029
  }
87350
88030
  async getRange(a, b, c, d) {
87351
88031
  const bounds = resolveRange(a, b, c, d);
@@ -87469,7 +88149,7 @@ var WorksheetImpl = class {
87469
88149
  rowData.push({ value: null });
87470
88150
  } else {
87471
88151
  rowData.push({
87472
- value: viewportCellValueToCellValue(vc.value) ?? null,
88152
+ value: normalizeCellValue(vc.value) ?? null,
87473
88153
  formula: vc.formula,
87474
88154
  format: vc.format ?? void 0
87475
88155
  });
@@ -87496,10 +88176,10 @@ var WorksheetImpl = class {
87496
88176
  const { row, col } = resolveCell(address);
87497
88177
  const data = await getCell(this.ctx, this.sheetId, row, col);
87498
88178
  if (!data) return "";
87499
- const displayValue = await getDisplayValue2(this.ctx, this.sheetId, row, col);
87500
- let result = displayValue;
88179
+ const rawValue = cellValueToString(data.value);
88180
+ let result = rawValue;
87501
88181
  if (data.formula) {
87502
- result = displayValue !== "" ? `${displayValue}(${data.formula})` : `(${data.formula})`;
88182
+ result = rawValue !== "" ? `${rawValue}(${data.formula})` : `(${data.formula})`;
87503
88183
  }
87504
88184
  const styleHintsStr = await getStyleHints(this.ctx, this.sheetId, row, col);
87505
88185
  if (styleHintsStr) {
@@ -87540,7 +88220,7 @@ var WorksheetImpl = class {
87540
88220
  row,
87541
88221
  col,
87542
88222
  formula: vc.formula,
87543
- value: viewportCellValueToCellValue(vc.value)
88223
+ value: normalizeCellValue(vc.value)
87544
88224
  });
87545
88225
  }
87546
88226
  }
@@ -87565,8 +88245,8 @@ var WorksheetImpl = class {
87565
88245
  rowValues.push(`${cellAddr}:`);
87566
88246
  continue;
87567
88247
  }
87568
- const displayValue = vc.formatted ?? viewportCellValueToString(vc.value);
87569
- let cellStr = displayValue;
88248
+ const rawValue = cellValueToString(vc.value);
88249
+ let cellStr = rawValue;
87570
88250
  if (vc.formula) {
87571
88251
  const abbreviation = formulaAnalysis.formulaToId.get(`${row},${col}`);
87572
88252
  if (abbreviation) {
@@ -87587,7 +88267,7 @@ var WorksheetImpl = class {
87587
88267
  const styleCells = rangeData.cells.map((vc) => ({
87588
88268
  row: vc.row,
87589
88269
  col: vc.col,
87590
- value: viewportCellValueToCellValue(vc.value),
88270
+ value: normalizeCellValue(vc.value),
87591
88271
  format: vc.format
87592
88272
  }));
87593
88273
  const styleLines = analyzeStylePatterns(styleCells);
@@ -87609,7 +88289,7 @@ var WorksheetImpl = class {
87609
88289
  const leftCellData = leftRange.cells.map((vc) => ({
87610
88290
  row: vc.row,
87611
88291
  col: vc.col,
87612
- value: viewportCellValueToCellValue(vc.value),
88292
+ value: normalizeCellValue(vc.value),
87613
88293
  formatted: vc.formatted ?? void 0,
87614
88294
  indent: 0
87615
88295
  // indent not available from queryRange; would need format.indent
@@ -87638,7 +88318,7 @@ var WorksheetImpl = class {
87638
88318
  const aboveCellData = aboveRange.cells.map((vc) => ({
87639
88319
  row: vc.row,
87640
88320
  col: vc.col,
87641
- value: viewportCellValueToCellValue(vc.value),
88321
+ value: normalizeCellValue(vc.value),
87642
88322
  formatted: vc.formatted ?? void 0
87643
88323
  }));
87644
88324
  const aboveLine = buildAboveContext(
@@ -87777,7 +88457,7 @@ var WorksheetImpl = class {
87777
88457
  const cells = (rowMap.get(row) ?? []).slice().sort((a, b) => a.col - b.col);
87778
88458
  const rowData = [];
87779
88459
  for (const vc of cells) {
87780
- const rawValue = viewportCellValueToString(vc.value);
88460
+ const rawValue = cellValueToString(vc.value);
87781
88461
  const addr = toA12(vc.row, vc.col);
87782
88462
  if (vc.formula) {
87783
88463
  rowData.push(`${addr}:${rawValue}(=${vc.formula})`);
@@ -87985,7 +88665,7 @@ var WorksheetImpl = class {
87985
88665
  fields.push("");
87986
88666
  continue;
87987
88667
  }
87988
- let str = cell.formatted != null && cell.formatted !== "" ? cell.formatted : isCellError(val) ? `#${val.value}!` : String(val);
88668
+ let str = cell.formatted != null && cell.formatted !== "" ? cell.formatted : String(normalizeCellValue(val));
87989
88669
  if (str.length > 0 && "=+-@".includes(str[0])) {
87990
88670
  str = " " + str;
87991
88671
  }
@@ -88038,7 +88718,7 @@ var WorksheetImpl = class {
88038
88718
  const row = cellData[i];
88039
88719
  const obj = {};
88040
88720
  for (let j = 0; j < headers.length; j++) {
88041
- obj[headers[j]] = row[j]?.value ?? null;
88721
+ obj[headers[j]] = normalizeCellValue(row[j]?.value ?? null);
88042
88722
  }
88043
88723
  result.push(obj);
88044
88724
  }
@@ -88089,48 +88769,6 @@ var WorksheetImpl = class {
88089
88769
  });
88090
88770
  return formatValues(this.ctx, bridgeEntries);
88091
88771
  }
88092
- async goalSeek(targetCell, targetValue, changingCell) {
88093
- const sheetId = this.sheetId;
88094
- const targetPos = resolveCell(targetCell);
88095
- const changingPos = resolveCell(changingCell);
88096
- const formulaCellId = await getCellIdAt2(
88097
- this.ctx,
88098
- sheetId,
88099
- targetPos.row,
88100
- targetPos.col
88101
- );
88102
- if (!formulaCellId) {
88103
- throw new KernelError("COMPUTE_ERROR", `Target cell ${targetCell} has no content.`);
88104
- }
88105
- const inputCellId = await getCellIdAt2(
88106
- this.ctx,
88107
- sheetId,
88108
- changingPos.row,
88109
- changingPos.col
88110
- );
88111
- if (!inputCellId) {
88112
- throw new KernelError("COMPUTE_ERROR", `Changing cell ${changingCell} has no content.`);
88113
- }
88114
- const changingData = await getCell(this.ctx, sheetId, changingPos.row, changingPos.col);
88115
- const initialGuess = typeof changingData?.value === "number" ? changingData.value : 0;
88116
- const bridgeResult = await this.ctx.computeBridge.goalSeek({
88117
- formula_cell: formulaCellId,
88118
- target: targetValue,
88119
- input_cell: inputCellId,
88120
- initial_guess: initialGuess
88121
- });
88122
- const result = bridgeResult;
88123
- const solutionValue = result.solutionValue ?? result.solution_value;
88124
- const iterations = result.iterations;
88125
- if (result.found && solutionValue != null) {
88126
- await setCell(this.ctx, sheetId, changingPos.row, changingPos.col, solutionValue);
88127
- }
88128
- return {
88129
- found: result.found,
88130
- value: solutionValue,
88131
- iterations
88132
- };
88133
- }
88134
88772
  // ===========================================================================
88135
88773
  // Visibility
88136
88774
  // ===========================================================================
@@ -88202,7 +88840,7 @@ var WorksheetImpl = class {
88202
88840
  case 1:
88203
88841
  return accessor.numberValue;
88204
88842
  case 2:
88205
- return displayStringOrNull3(accessor.displayText);
88843
+ return displayStringOrNull(accessor.displayText);
88206
88844
  case 3:
88207
88845
  return accessor.numberValue !== 0;
88208
88846
  case 4: {
@@ -88468,6 +89106,9 @@ var WorksheetImpl = class {
88468
89106
  get protection() {
88469
89107
  return this._protection ??= new WorksheetProtectionImpl(this.ctx, this.sheetId);
88470
89108
  }
89109
+ get whatIf() {
89110
+ return this._whatIf ??= new WorksheetWhatIfImpl(this.ctx, this.sheetId);
89111
+ }
88471
89112
  get print() {
88472
89113
  return this._print ??= new WorksheetPrintImpl(this.ctx, this.sheetId);
88473
89114
  }
@@ -88699,8 +89340,7 @@ var WorkbookStylesImpl = class {
88699
89340
  this.ctx = ctx;
88700
89341
  }
88701
89342
  async getTableStyles() {
88702
- const styles = await this.ctx.computeBridge.getAllCustomTableStyles();
88703
- return styles;
89343
+ return this.ctx.computeBridge.getAllCustomTableStyles();
88704
89344
  }
88705
89345
  async createTableStyle(config) {
88706
89346
  const result = await this.ctx.computeBridge.createCustomTableStyle(
@@ -88826,7 +89466,7 @@ var WorkbookThemeImpl = class {
88826
89466
 
88827
89467
  // ../../kernel/src/api/workbook/workbook-impl.ts
88828
89468
  init_esm_shims();
88829
- init_disposable();
89469
+ init_disposable2();
88830
89470
  init_errors();
88831
89471
 
88832
89472
  // ../../kernel/src/domain/form-controls/index.ts
@@ -89413,7 +90053,26 @@ var globalRegistry = new FunctionRegistry();
89413
90053
 
89414
90054
  // ../../spreadsheet-utils/src/function-catalog.ts
89415
90055
  init_esm_shims();
89416
- import { FunctionCategory } from "@mog-sdk/spreadsheet-contracts/utils/function-registry";
90056
+
90057
+ // ../../contracts/src/utils/function-registry.ts
90058
+ init_esm_shims();
90059
+ var FunctionCategory = /* @__PURE__ */ ((FunctionCategory2) => {
90060
+ FunctionCategory2["MATH"] = "Math";
90061
+ FunctionCategory2["STATISTICAL"] = "Statistical";
90062
+ FunctionCategory2["TEXT"] = "Text";
90063
+ FunctionCategory2["LOGICAL"] = "Logical";
90064
+ FunctionCategory2["DATE_TIME"] = "Date & Time";
90065
+ FunctionCategory2["LOOKUP"] = "Lookup & Reference";
90066
+ FunctionCategory2["FINANCIAL"] = "Financial";
90067
+ FunctionCategory2["INFORMATION"] = "Information";
90068
+ FunctionCategory2["DATABASE"] = "Database";
90069
+ FunctionCategory2["ENGINEERING"] = "Engineering";
90070
+ FunctionCategory2["WEB"] = "Web";
90071
+ FunctionCategory2["TESTING"] = "Testing";
90072
+ return FunctionCategory2;
90073
+ })(FunctionCategory || {});
90074
+
90075
+ // ../../spreadsheet-utils/src/function-catalog.ts
89417
90076
  var C = FunctionCategory;
89418
90077
  var INLINE_FUNCTIONS = [
89419
90078
  // Aggregates
@@ -90280,7 +90939,7 @@ function convertToFunctionInfo(metadata) {
90280
90939
 
90281
90940
  // ../../kernel/src/api/workbook/viewport.ts
90282
90941
  init_esm_shims();
90283
- init_disposable();
90942
+ init_disposable2();
90284
90943
  var regionCounter = 0;
90285
90944
  var ViewportRegionImpl = class extends DisposableBase {
90286
90945
  constructor(sheetId, bounds, computeBridge, viewportId) {
@@ -90334,7 +90993,7 @@ var WorkbookViewportImpl = class {
90334
90993
  };
90335
90994
 
90336
90995
  // ../../kernel/src/api/workbook/workbook-impl.ts
90337
- import { DEFAULT_CHROME_THEME } from "@mog-sdk/spreadsheet-contracts/rendering";
90996
+ init_rendering();
90338
90997
  var API_EVENT_TO_INTERNAL = {
90339
90998
  cellChanged: "cell:changed",
90340
90999
  rangeChanged: "range:changed",
@@ -90628,24 +91287,41 @@ var WorkbookImpl = class {
90628
91287
  timestamp: cp.timestamp
90629
91288
  }));
90630
91289
  }
90631
- async calculate(calculationType) {
90632
- const type = calculationType ?? "full";
90633
- try {
90634
- switch (type) {
90635
- case "recalculate":
90636
- await this.ctx.computeBridge.fullRecalc();
90637
- break;
90638
- case "full":
90639
- await this.ctx.computeBridge.fullRecalc();
90640
- break;
90641
- case "fullRebuild":
90642
- await this.ctx.computeBridge.fullRecalc();
90643
- break;
91290
+ async calculate(options) {
91291
+ const opts = typeof options === "string" ? { calculationType: options } : options ?? {};
91292
+ const recalcOptions = {};
91293
+ if (opts.iterative !== void 0) {
91294
+ if (typeof opts.iterative === "boolean") {
91295
+ recalcOptions.iterative = opts.iterative;
91296
+ } else {
91297
+ recalcOptions.iterative = true;
91298
+ if (opts.iterative.maxIterations !== void 0) {
91299
+ recalcOptions.maxIterations = opts.iterative.maxIterations;
91300
+ }
91301
+ if (opts.iterative.maxChange !== void 0) {
91302
+ recalcOptions.maxChange = opts.iterative.maxChange;
91303
+ }
90644
91304
  }
91305
+ }
91306
+ try {
91307
+ const result = await this.ctx.computeBridge.fullRecalc(recalcOptions);
91308
+ return {
91309
+ hasCircularRefs: result.metrics?.hasCircularRefs ?? false,
91310
+ converged: result.metrics?.iterativeConverged ?? false,
91311
+ iterations: result.metrics?.iterativeIterations ?? 0,
91312
+ maxDelta: result.metrics?.iterativeMaxDelta ?? 0,
91313
+ circularCellCount: result.metrics?.circularCellCount ?? 0
91314
+ };
90645
91315
  } catch (e) {
90646
91316
  const msg = String(e);
90647
91317
  if (msg.includes("Unknown napi method") || msg.includes("not a function") || msg.includes("not found")) {
90648
- return;
91318
+ return {
91319
+ hasCircularRefs: false,
91320
+ converged: false,
91321
+ iterations: 0,
91322
+ maxDelta: 0,
91323
+ circularCellCount: 0
91324
+ };
90649
91325
  }
90650
91326
  throw new KernelError("COMPUTE_ERROR", `Full recalculation failed: ${msg}`);
90651
91327
  }
@@ -91107,6 +91783,7 @@ var api_spec_default = {
91107
91783
  viewport: "WorkbookViewport"
91108
91784
  },
91109
91785
  ws: {
91786
+ whatIf: "WorksheetWhatIf",
91110
91787
  smartArt: "WorksheetSmartArt",
91111
91788
  changes: "WorksheetChanges",
91112
91789
  formats: "WorksheetFormats",
@@ -91204,10 +91881,12 @@ var api_spec_default = {
91204
91881
  ]
91205
91882
  },
91206
91883
  calculate: {
91207
- signature: "calculate(calculationType?: CalculationType): Promise<void>;",
91208
- 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",
91884
+ signature: "calculate(options?: CalculateOptions | CalculationType): Promise<CalculateResult>;",
91885
+ docstring: "Trigger recalculation of formulas.\n@param options - Calculation options, or a CalculationType string for backward compatibility",
91209
91886
  usedTypes: [
91210
- "CalculationType"
91887
+ "CalculateOptions",
91888
+ "CalculationType",
91889
+ "CalculateResult"
91211
91890
  ]
91212
91891
  },
91213
91892
  getCalculationMode: {
@@ -91227,17 +91906,17 @@ var api_spec_default = {
91227
91906
  },
91228
91907
  setIterativeCalculation: {
91229
91908
  signature: "setIterativeCalculation(enabled: boolean): Promise<void>;",
91230
- docstring: "Set whether iterative calculation is enabled for circular references.\nConvenience mutator \u2014 patches `calculationSettings.enableIterativeCalculation`.",
91909
+ docstring: "Set whether iterative calculation is enabled for circular references.\nConvenience mutator \u2014 patches `calculationSettings.enableIterativeCalculation`.\n@deprecated Use calculate({ iterative: ... }) instead.",
91231
91910
  usedTypes: []
91232
91911
  },
91233
91912
  setMaxIterations: {
91234
91913
  signature: "setMaxIterations(n: number): Promise<void>;",
91235
- docstring: "Set the maximum number of iterations for iterative calculation.\nConvenience mutator \u2014 patches `calculationSettings.maxIterations`.",
91914
+ docstring: "Set the maximum number of iterations for iterative calculation.\nConvenience mutator \u2014 patches `calculationSettings.maxIterations`.\n@deprecated Use calculate({ iterative: { maxIterations: n } }) instead.",
91236
91915
  usedTypes: []
91237
91916
  },
91238
91917
  setConvergenceThreshold: {
91239
91918
  signature: "setConvergenceThreshold(threshold: number): Promise<void>;",
91240
- docstring: "Set the convergence threshold (maximum change) for iterative calculation.\nConvenience mutator \u2014 patches `calculationSettings.maxChange`.",
91919
+ docstring: "Set the convergence threshold (maximum change) for iterative calculation.\nConvenience mutator \u2014 patches `calculationSettings.maxChange`.\n@deprecated Use calculate({ iterative: { maxChange: threshold } }) instead.",
91241
91920
  usedTypes: []
91242
91921
  },
91243
91922
  getUsePrecisionAsDisplayed: {
@@ -91695,13 +92374,6 @@ var api_spec_default = {
91695
92374
  "FormatEntry"
91696
92375
  ]
91697
92376
  },
91698
- goalSeek: {
91699
- signature: "goalSeek(targetCell: string, targetValue: number, changingCell: string): Promise<GoalSeekResult>;",
91700
- docstring: "Run a goal seek to find the input value that produces a target result.",
91701
- usedTypes: [
91702
- "GoalSeekResult"
91703
- ]
91704
- },
91705
92377
  isVisible: {
91706
92378
  signature: "isVisible(): boolean;",
91707
92379
  docstring: "Check if the sheet is visible (sync -- local metadata).",
@@ -92223,6 +92895,25 @@ var api_spec_default = {
92223
92895
  }
92224
92896
  }
92225
92897
  },
92898
+ WorksheetWhatIf: {
92899
+ docstring: "Sub-API for What-If analysis operations.",
92900
+ functions: {
92901
+ goalSeek: {
92902
+ signature: "goalSeek(targetCell: string, targetValue: number, changingCell: string): Promise<GoalSeekResult>;",
92903
+ docstring: "Run a goal seek to find the input value that produces a target result.",
92904
+ usedTypes: [
92905
+ "GoalSeekResult"
92906
+ ]
92907
+ },
92908
+ dataTable: {
92909
+ 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>;",
92910
+ 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",
92911
+ usedTypes: [
92912
+ "DataTableResult"
92913
+ ]
92914
+ }
92915
+ }
92916
+ },
92226
92917
  WorksheetSmartArt: {
92227
92918
  docstring: "",
92228
92919
  functions: {
@@ -92362,7 +93053,18 @@ var api_spec_default = {
92362
93053
  functions: {
92363
93054
  set: {
92364
93055
  signature: "set(address: string, format: CellFormat): Promise<FormatChangeResult>;",
92365
- 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',
93056
+ docstring: `Set format for a single cell.
93057
+
93058
+ @param address - A1-style cell address (e.g. "A1", "B3")
93059
+ @param format - Format properties to apply
93060
+
93061
+ @example
93062
+ // Bold red currency
93063
+ await ws.formats.set('A1', { bold: true, fontColor: '#ff0000', numberFormat: '$#,##0.00' });
93064
+ // Date format
93065
+ await ws.formats.set('B1', { numberFormat: 'YYYY-MM-DD' });
93066
+ // Header style
93067
+ await ws.formats.set('A1', { bold: true, fontSize: 14, backgroundColor: '#4472c4', fontColor: '#ffffff' });`,
92366
93068
  usedTypes: [
92367
93069
  "CellFormat",
92368
93070
  "FormatChangeResult"
@@ -92370,7 +93072,21 @@ var api_spec_default = {
92370
93072
  },
92371
93073
  setRange: {
92372
93074
  signature: "setRange(range: string, format: CellFormat): Promise<FormatChangeResult>;",
92373
- 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',
93075
+ docstring: `Set format for a contiguous range.
93076
+
93077
+ @param range - A1-style range string (e.g. "A1:B2")
93078
+ @param format - Format properties to apply
93079
+
93080
+ @example
93081
+ // Currency column
93082
+ await ws.formats.setRange('B2:B100', { numberFormat: '$#,##0.00' });
93083
+ // Header row with borders
93084
+ await ws.formats.setRange('A1:F1', {
93085
+ bold: true,
93086
+ backgroundColor: '#4472c4',
93087
+ fontColor: '#ffffff',
93088
+ borders: { bottom: { style: 'medium', color: '#2f5496' } }
93089
+ });`,
92374
93090
  usedTypes: [
92375
93091
  "CellFormat",
92376
93092
  "FormatChangeResult"
@@ -94547,8 +95263,8 @@ var api_spec_default = {
94547
95263
  },
94548
95264
  AxisConfig: {
94549
95265
  name: "AxisConfig",
94550
- 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}",
94551
- docstring: "Axis configuration"
95266
+ 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}",
95267
+ docstring: "Axis configuration (matches AxisData wire type).\n\nWire field names: categoryAxis, valueAxis, secondaryCategoryAxis, secondaryValueAxis.\nLegacy aliases: xAxis, yAxis, secondaryYAxis (mapped in chart-bridge)."
94552
95268
  },
94553
95269
  AxisType: {
94554
95270
  name: "AxisType",
@@ -94703,7 +95419,34 @@ var api_spec_default = {
94703
95419
  CellFormat: {
94704
95420
  name: "CellFormat",
94705
95421
  definition: `{
95422
+ /** Excel-compatible number format code string.
95423
+
95424
+ Common format codes:
95425
+ - Currency: '$#,##0.00'
95426
+ - Accounting: '_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'
95427
+ - Percentage: '0.00%'
95428
+ - Date: 'M/D/YYYY', 'YYYY-MM-DD', 'MMM D, YYYY'
95429
+ - Time: 'h:mm AM/PM', 'HH:mm:ss'
95430
+ - Number: '#,##0.00', '0.00'
95431
+ - Scientific: '0.00E+00'
95432
+ - Text: '@'
95433
+ - Fraction: '# ?/?'
95434
+
95435
+ See the \`formatPresets\` section in api-spec.json for the full catalog
95436
+ of 85+ pre-defined format codes with examples.
95437
+
95438
+ @example
95439
+ // Currency
95440
+ { numberFormat: '$#,##0.00' }
95441
+ // Percentage with 1 decimal
95442
+ { numberFormat: '0.0%' }
95443
+ // ISO date
95444
+ { numberFormat: 'YYYY-MM-DD' } */
94706
95445
  numberFormat?: string;
95446
+ /** Number format category hint. Auto-detected from numberFormat when not set.
95447
+ Valid values: 'general' | 'number' | 'currency' | 'accounting' | 'date' |
95448
+ 'time' | 'percentage' | 'fraction' | 'scientific' | 'text' |
95449
+ 'special' | 'custom' */
94707
95450
  numberFormatType?: NumberFormatType;
94708
95451
  fontFamily?: string;
94709
95452
  fontSize?: number;
@@ -94922,8 +95665,8 @@ Example: { ignoreError: true } to suppress error indicators. */
94922
95665
  },
94923
95666
  ChartBorder: {
94924
95667
  name: "ChartBorder",
94925
- definition: "{\n color?: string;\n width?: number;\n style?: 'solid' | 'dashed' | 'dotted' | 'none';\n}",
94926
- docstring: "Shared chart border configuration"
95668
+ definition: "{\n color?: string;\n width?: number;\n style?: string;\n}",
95669
+ docstring: "Shared chart border configuration (matches ChartBorderData wire type)"
94927
95670
  },
94928
95671
  ChartConfig: {
94929
95672
  name: "ChartConfig",
@@ -94954,7 +95697,10 @@ Example: { ignoreError: true } to suppress error indicators. */
94954
95697
  series?: SeriesConfig[];
94955
95698
  dataLabels?: DataLabelConfig;
94956
95699
  pieSlice?: PieSliceConfig;
95700
+ /** @deprecated Use trendlines[] instead \u2014 kept for backward compat */
94957
95701
  trendline?: TrendlineConfig;
95702
+ /** Wire-compatible trendline array */
95703
+ trendlines?: TrendlineConfig[];
94958
95704
  /** Connect scatter points with lines (scatter-lines variant) */
94959
95705
  showLines?: boolean;
94960
95706
  /** Use smooth curves for scatter lines (scatter-smooth-lines variant) */
@@ -95064,11 +95810,6 @@ that are stored on the chart but not part of the core config schema. */
95064
95810
  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}",
95065
95811
  docstring: "Column mapping for a sheet data binding."
95066
95812
  },
95067
- Comment: {
95068
- name: "Comment",
95069
- 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}",
95070
- docstring: "A cell comment (thread-aware)."
95071
- },
95072
95813
  ConditionalFormat: {
95073
95814
  name: "ConditionalFormat",
95074
95815
  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}",
@@ -95126,8 +95867,8 @@ that are stored on the chart but not part of the core config schema. */
95126
95867
  },
95127
95868
  DataLabelConfig: {
95128
95869
  name: "DataLabelConfig",
95129
- 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}",
95130
- docstring: "Data label configuration"
95870
+ 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}",
95871
+ docstring: "Data label configuration (matches DataLabelData wire type)"
95131
95872
  },
95132
95873
  DatePeriod: {
95133
95874
  name: "DatePeriod",
@@ -95181,8 +95922,8 @@ that are stored on the chart but not part of the core config schema. */
95181
95922
  },
95182
95923
  ErrorBarConfig: {
95183
95924
  name: "ErrorBarConfig",
95184
- definition: "{\n visible?: boolean;\n type?: 'fixedValue' | 'percentage' | 'standardDeviation' | 'standardError' | 'custom';\n include?: 'both' | 'plus' | 'minus';\n value?: number;\n}",
95185
- docstring: "Error bar configuration for series"
95925
+ definition: "{\n visible?: boolean;\n direction?: string;\n barType?: string;\n valueType?: string;\n value?: number;\n noEndCap?: boolean;\n}",
95926
+ docstring: "Error bar configuration for series (matches ErrorBarData wire type)"
95186
95927
  },
95187
95928
  ErrorVariant: {
95188
95929
  name: "ErrorVariant",
@@ -95224,7 +95965,7 @@ Used in condition filters where users specify rules like
95224
95965
  },
95225
95966
  FilterDetailInfo: {
95226
95967
  name: "FilterDetailInfo",
95227
- 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}",
95968
+ 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}",
95228
95969
  docstring: "Detailed filter information including resolved numeric range and column filters."
95229
95970
  },
95230
95971
  FilterInfo: {
@@ -95239,8 +95980,8 @@ Used in condition filters where users specify rules like
95239
95980
  },
95240
95981
  FilterState: {
95241
95982
  name: "FilterState",
95242
- 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}",
95243
- docstring: "Current auto-filter state for a sheet."
95983
+ 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}",
95984
+ docstring: "API filter state \u2014 derived from Rust FilterState with A1-notation range."
95244
95985
  },
95245
95986
  FloatingObject: {
95246
95987
  name: "FloatingObject",
@@ -95342,13 +96083,8 @@ Used in condition filters where users specify rules like
95342
96083
  },
95343
96084
  LegendConfig: {
95344
96085
  name: "LegendConfig",
95345
- definition: "{\n show: boolean;\n position: LegendPosition;\n visible?: boolean;\n overlay?: boolean;\n font?: ChartFont;\n}",
95346
- docstring: "Legend configuration"
95347
- },
95348
- LegendPosition: {
95349
- name: "LegendPosition",
95350
- definition: "'top' | 'bottom' | 'left' | 'right' | 'none'",
95351
- docstring: "Legend position options"
96086
+ definition: "{\n show: boolean;\n position: string;\n visible: boolean;\n overlay?: boolean;\n font?: ChartFont;\n}",
96087
+ docstring: "Legend configuration (matches LegendData wire type)"
95352
96088
  },
95353
96089
  LineDash: {
95354
96090
  name: "LineDash",
@@ -95413,7 +96149,7 @@ Used in condition filters where users specify rules like
95413
96149
  Note: {
95414
96150
  name: "Note",
95415
96151
  definition: "{\n content: string;\n author: string;\n cellAddress: string;\n}",
95416
- docstring: "A cell note (simple, single string per cell)."
96152
+ docstring: "A cell note (simple, single string per cell). API-only type (no Rust equivalent)."
95417
96153
  },
95418
96154
  NumberFormatCategory: {
95419
96155
  name: "NumberFormatCategory",
@@ -95434,11 +96170,6 @@ Used in condition filters where users specify rules like
95434
96170
  },
95435
96171
  docstring: "Number format category classification.\nMatches the FormatType enum from Rust compute-formats."
95436
96172
  },
95437
- NumberFormatType: {
95438
- name: "NumberFormatType",
95439
- definition: "| 'general'\n | 'number'\n | 'currency'\n | 'accounting'\n | 'date'\n | 'time'\n | 'percentage'\n | 'fraction'\n | 'scientific'\n | 'text'\n | 'special'\n | 'custom'",
95440
- docstring: "Number format types"
95441
- },
95442
96173
  ObjectAnchorType: {
95443
96174
  name: "ObjectAnchorType",
95444
96175
  definition: "| 'twoCell' // Anchored to two cells (moves and resizes with cells)\n | 'oneCell' // Anchored to one cell (moves but doesn't resize)\n | 'absolute'",
@@ -95550,8 +96281,8 @@ Used in condition filters where users specify rules like
95550
96281
  },
95551
96282
  PieSliceConfig: {
95552
96283
  name: "PieSliceConfig",
95553
- 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}",
95554
- docstring: "Pie/doughnut slice configuration for exploded slices"
96284
+ definition: "{\n explosion?: number;\n explodedIndices?: number[];\n explodeOffset?: number;\n}",
96285
+ docstring: "Pie/doughnut slice configuration (matches PieSliceData wire type)"
95555
96286
  },
95556
96287
  PivotQueryRecord: {
95557
96288
  name: "PivotQueryRecord",
@@ -95590,8 +96321,8 @@ Used in condition filters where users specify rules like
95590
96321
  },
95591
96322
  PointFormat: {
95592
96323
  name: "PointFormat",
95593
- definition: "{\n fill?: string;\n border?: ChartBorder;\n dataLabel?: DataLabelConfig;\n}",
95594
- docstring: "Per-point formatting for individual data points in a series"
96324
+ definition: "{\n idx: number;\n fill?: string;\n border?: ChartBorder;\n dataLabel?: DataLabelConfig;\n}",
96325
+ docstring: "Per-point formatting for individual data points (matches PointFormatData wire type)"
95595
96326
  },
95596
96327
  PrintSettings: {
95597
96328
  name: "PrintSettings",
@@ -95640,11 +96371,6 @@ Used in condition filters where users specify rules like
95640
96371
  definition: "{\n [K in keyof CellFormat]-?: CellFormat[K] | null;\n}",
95641
96372
  docstring: "Dense cell format where every property is explicitly present (null when unset). Returned by formats.get()."
95642
96373
  },
95643
- RichTextSegment: {
95644
- name: "RichTextSegment",
95645
- 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}",
95646
- docstring: "A single segment of rich text content."
95647
- },
95648
96374
  Scenario: {
95649
96375
  name: "Scenario",
95650
96376
  definition: "{\n /** Unique scenario ID */\n id: string;\n /** Creation timestamp (Unix ms) */\n createdAt: number;\n}",
@@ -95672,46 +96398,8 @@ Used in condition filters where users specify rules like
95672
96398
  },
95673
96399
  SeriesConfig: {
95674
96400
  name: "SeriesConfig",
95675
- definition: `{
95676
- name?: string;
95677
- type?: ChartType;
95678
- color?: string;
95679
- yAxisIndex?: 0 | 1;
95680
- showMarkers?: boolean;
95681
- markerSize?: number;
95682
- markerStyle?: | 'circle'
95683
- | 'dash'
95684
- | 'diamond'
95685
- | 'dot'
95686
- | 'picture'
95687
- | 'plus'
95688
- | 'square'
95689
- | 'star'
95690
- | 'triangle'
95691
- | 'x'
95692
- | 'auto'
95693
- | 'none';
95694
- lineWidth?: number;
95695
- smooth?: boolean;
95696
- dataLabels?: DataLabelConfig;
95697
- trendline?: TrendlineConfig;
95698
- errorBars?: ErrorBarConfig;
95699
- /** Separate X-axis error bars (for scatter/bubble charts) */
95700
- xErrorBars?: ErrorBarConfig;
95701
- /** Separate Y-axis error bars (for scatter/bubble charts) */
95702
- yErrorBars?: ErrorBarConfig;
95703
- /** Whether to invert the fill color for negative values */
95704
- invertIfNegative?: boolean;
95705
- /** Explosion distance for pie/doughnut per-series (0-400%) */
95706
- explosion?: number;
95707
- /** Data values range in A1 notation (e.g., "B2:B10") */
95708
- values?: string;
95709
- /** Category labels range in A1 notation (e.g., "A2:A10") */
95710
- categories?: string;
95711
- /** Per-point formatting overrides */
95712
- points?: PointFormat[];
95713
- }`,
95714
- docstring: "Individual series configuration"
96401
+ 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}",
96402
+ docstring: "Individual series configuration (matches ChartSeriesData wire type)"
95715
96403
  },
95716
96404
  SeriesOrientation: {
95717
96405
  name: "SeriesOrientation",
@@ -95788,6 +96476,11 @@ Used in condition filters where users specify rules like
95788
96476
  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}",
95789
96477
  docstring: "A summary snapshot of a single sheet."
95790
96478
  },
96479
+ SingleAxisConfig: {
96480
+ name: "SingleAxisConfig",
96481
+ 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}",
96482
+ docstring: "Single axis configuration (matches SingleAxisData wire type)."
96483
+ },
95791
96484
  Slicer: {
95792
96485
  name: "Slicer",
95793
96486
  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}",
@@ -95795,7 +96488,7 @@ Used in condition filters where users specify rules like
95795
96488
  },
95796
96489
  SlicerConfig: {
95797
96490
  name: "SlicerConfig",
95798
- 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}",
96491
+ 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}",
95799
96492
  docstring: "Configuration for creating a new slicer."
95800
96493
  },
95801
96494
  SlicerCustomStyle: {
@@ -95905,13 +96598,13 @@ Used in condition filters where users specify rules like
95905
96598
  },
95906
96599
  TableColumn: {
95907
96600
  name: "TableColumn",
95908
- 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}",
95909
- docstring: "A single column in a table."
96601
+ 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}",
96602
+ docstring: "A single column in a table.\n\nField names match the Rust-generated `TableColumn` type (compute-types.gen.ts)."
95910
96603
  },
95911
96604
  TableInfo: {
95912
96605
  name: "TableInfo",
95913
- 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}",
95914
- docstring: "Information about an existing table."
96606
+ 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}",
96607
+ 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."
95915
96608
  },
95916
96609
  TableOptions: {
95917
96610
  name: "TableOptions",
@@ -95923,16 +96616,6 @@ Used in condition filters where users specify rules like
95923
96616
  definition: "{\n /** Style name */\n name: string;\n}",
95924
96617
  docstring: "Configuration for creating/updating a custom table style."
95925
96618
  },
95926
- TableStyleInfo: {
95927
- name: "TableStyleInfo",
95928
- 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}",
95929
- docstring: "Information about a custom table style."
95930
- },
95931
- TableStylePreset: {
95932
- name: "TableStylePreset",
95933
- 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'",
95934
- docstring: "Table style presets matching Excel's table style gallery.\nLight styles (1-21), Medium styles (1-28), Dark styles (1-11)."
95935
- },
95936
96619
  TextBoxBorder: {
95937
96620
  name: "TextBoxBorder",
95938
96621
  definition: "{\n /** Corner radius in pixels (for rounded corners) */\n radius?: number;\n}",
@@ -95992,20 +96675,15 @@ Used in condition filters where users specify rules like
95992
96675
  definition: "{\n text?: string;\n visible?: boolean;\n position?: 'top' | 'bottom' | 'left' | 'right' | 'overlay';\n font?: ChartFont;\n}",
95993
96676
  docstring: "Rich title configuration"
95994
96677
  },
95995
- TotalFunction: {
95996
- name: "TotalFunction",
95997
- definition: "| 'none'\n | 'sum'\n | 'count'\n | 'average'\n | 'min'\n | 'max'\n | 'stdDev'\n | 'var'\n | 'countNums'\n | 'custom'",
95998
- docstring: "Total row function types.\nMaps to Excel's total row dropdown options."
96678
+ TotalsFunction: {
96679
+ name: "TotalsFunction",
96680
+ definition: "| 'average'\n | 'count'\n | 'countNums'\n | 'max'\n | 'min'\n | 'stdDev'\n | 'sum'\n | 'var'\n | 'custom'\n | 'none'",
96681
+ docstring: "Totals function type (matches Rust TotalsFunction)."
95999
96682
  },
96000
96683
  TrendlineConfig: {
96001
96684
  name: "TrendlineConfig",
96002
- 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}",
96003
- docstring: "Trendline configuration"
96004
- },
96005
- TrendlineType: {
96006
- name: "TrendlineType",
96007
- definition: "| 'linear'\n | 'exponential'\n | 'logarithmic'\n | 'polynomial'\n | 'power'\n | 'moving-average'",
96008
- docstring: "Trendline types for scatter charts"
96685
+ 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}",
96686
+ docstring: "Trendline configuration (matches TrendlineData wire type)"
96009
96687
  },
96010
96688
  UndoHistoryEntry: {
96011
96689
  name: "UndoHistoryEntry",
@@ -96124,6 +96802,415 @@ Used in condition filters where users specify rules like
96124
96802
  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}",
96125
96803
  docstring: "A summary snapshot of the entire workbook state."
96126
96804
  }
96805
+ },
96806
+ formatPresets: {
96807
+ general: {
96808
+ default: {
96809
+ code: "General",
96810
+ description: "",
96811
+ example: "1234.5"
96812
+ }
96813
+ },
96814
+ number: {
96815
+ integer: {
96816
+ code: "0",
96817
+ description: "No decimal places",
96818
+ example: "1235"
96819
+ },
96820
+ decimal1: {
96821
+ code: "0.0",
96822
+ description: "1 decimal place",
96823
+ example: "1234.5"
96824
+ },
96825
+ decimal2: {
96826
+ code: "0.00",
96827
+ description: "2 decimal places",
96828
+ example: "1234.50"
96829
+ },
96830
+ decimal3: {
96831
+ code: "0.000",
96832
+ description: "3 decimal places",
96833
+ example: "1234.500"
96834
+ },
96835
+ thousands: {
96836
+ code: "#,##0",
96837
+ description: "Thousands separator, no decimals",
96838
+ example: "1,235"
96839
+ },
96840
+ thousandsDecimal1: {
96841
+ code: "#,##0.0",
96842
+ description: "Thousands separator, 1 decimal",
96843
+ example: "1,234.5"
96844
+ },
96845
+ thousandsDecimal2: {
96846
+ code: "#,##0.00",
96847
+ description: "Thousands separator, 2 decimals",
96848
+ example: "1,234.50"
96849
+ },
96850
+ negativeRed: {
96851
+ code: "#,##0.00;[Red]-#,##0.00",
96852
+ description: "Red negative numbers",
96853
+ example: "-1,234.50"
96854
+ },
96855
+ negativeParens: {
96856
+ code: "#,##0.00;(#,##0.00)",
96857
+ description: "Parentheses for negatives",
96858
+ example: "(1,234.50)"
96859
+ },
96860
+ negativeParensRed: {
96861
+ code: "#,##0.00;[Red](#,##0.00)",
96862
+ description: "Red parentheses for negatives",
96863
+ example: "(1,234.50)"
96864
+ }
96865
+ },
96866
+ currency: {
96867
+ usd: {
96868
+ code: "$#,##0.00",
96869
+ description: "US Dollar",
96870
+ example: "$1,234.50"
96871
+ },
96872
+ usdNegMinus: {
96873
+ code: "$#,##0.00;-$#,##0.00",
96874
+ description: "USD minus",
96875
+ example: "-$1,234.50"
96876
+ },
96877
+ usdNegParens: {
96878
+ code: "$#,##0.00;($#,##0.00)",
96879
+ description: "USD parentheses",
96880
+ example: "($1,234.50)"
96881
+ },
96882
+ usdNegRed: {
96883
+ code: "$#,##0.00;[Red]-$#,##0.00",
96884
+ description: "USD red minus",
96885
+ example: "-$1,234.50"
96886
+ },
96887
+ usdNegParensRed: {
96888
+ code: "$#,##0.00;[Red]($#,##0.00)",
96889
+ description: "USD red parentheses",
96890
+ example: "($1,234.50)"
96891
+ },
96892
+ eur: {
96893
+ code: "\u20AC#,##0.00",
96894
+ description: "Euro",
96895
+ example: "\u20AC1,234.50"
96896
+ },
96897
+ gbp: {
96898
+ code: "\xA3#,##0.00",
96899
+ description: "British Pound",
96900
+ example: "\xA31,234.50"
96901
+ },
96902
+ jpy: {
96903
+ code: "\xA5#,##0",
96904
+ description: "Japanese Yen (no decimals)",
96905
+ example: "\xA51,235"
96906
+ },
96907
+ cny: {
96908
+ code: "\xA5#,##0.00",
96909
+ description: "Chinese Yuan",
96910
+ example: "\xA51,234.50"
96911
+ },
96912
+ inr: {
96913
+ code: "\u20B9#,##0.00",
96914
+ description: "Indian Rupee",
96915
+ example: "\u20B91,234.50"
96916
+ },
96917
+ krw: {
96918
+ code: "\u20A9#,##0",
96919
+ description: "Korean Won (no decimals)",
96920
+ example: "\u20A91,235"
96921
+ },
96922
+ chf: {
96923
+ code: "CHF #,##0.00",
96924
+ description: "Swiss Franc",
96925
+ example: "CHF 1,234.50"
96926
+ },
96927
+ cad: {
96928
+ code: "CA$#,##0.00",
96929
+ description: "Canadian Dollar",
96930
+ example: "CA$1,234.50"
96931
+ },
96932
+ aud: {
96933
+ code: "A$#,##0.00",
96934
+ description: "Australian Dollar",
96935
+ example: "A$1,234.50"
96936
+ }
96937
+ },
96938
+ accounting: {
96939
+ usd: {
96940
+ code: '_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)',
96941
+ description: "USD Accounting",
96942
+ example: "$ 1,234.50"
96943
+ },
96944
+ eur: {
96945
+ code: '_(\u20AC* #,##0.00_);_(\u20AC* (#,##0.00);_(\u20AC* "-"??_);_(@_)',
96946
+ description: "EUR Accounting",
96947
+ example: "\u20AC 1,234.50"
96948
+ },
96949
+ gbp: {
96950
+ code: '_(\xA3* #,##0.00_);_(\xA3* (#,##0.00);_(\xA3* "-"??_);_(@_)',
96951
+ description: "GBP Accounting",
96952
+ example: "\xA3 1,234.50"
96953
+ }
96954
+ },
96955
+ date: {
96956
+ shortUS: {
96957
+ code: "m/d/yyyy",
96958
+ description: "Short date (US)",
96959
+ example: "12/13/2025"
96960
+ },
96961
+ mediumUS: {
96962
+ code: "mmm d, yyyy",
96963
+ description: "Medium date (US)",
96964
+ example: "Dec 13, 2025"
96965
+ },
96966
+ longUS: {
96967
+ code: "mmmm d, yyyy",
96968
+ description: "Long date (US)",
96969
+ example: "December 13, 2025"
96970
+ },
96971
+ fullUS: {
96972
+ code: "dddd, mmmm d, yyyy",
96973
+ description: "Full date (US)",
96974
+ example: "Saturday, December 13, 2025"
96975
+ },
96976
+ iso: {
96977
+ code: "yyyy-mm-dd",
96978
+ description: "ISO 8601",
96979
+ example: "2025-12-13"
96980
+ },
96981
+ shortEU: {
96982
+ code: "d/m/yyyy",
96983
+ description: "Short date (EU)",
96984
+ example: "13/12/2025"
96985
+ },
96986
+ mediumEU: {
96987
+ code: "d mmm yyyy",
96988
+ description: "Medium date (EU)",
96989
+ example: "13 Dec 2025"
96990
+ },
96991
+ longEU: {
96992
+ code: "d mmmm yyyy",
96993
+ description: "Long date (EU)",
96994
+ example: "13 December 2025"
96995
+ },
96996
+ monthYear: {
96997
+ code: "mmmm yyyy",
96998
+ description: "Month and year",
96999
+ example: "December 2025"
97000
+ },
97001
+ monthYearShort: {
97002
+ code: "mmm yyyy",
97003
+ description: "Short month and year",
97004
+ example: "Dec 2025"
97005
+ },
97006
+ dayMonth: {
97007
+ code: "d mmmm",
97008
+ description: "Day and month",
97009
+ example: "13 December"
97010
+ },
97011
+ dayMonthShort: {
97012
+ code: "d mmm",
97013
+ description: "Short day and month",
97014
+ example: "13 Dec"
97015
+ },
97016
+ excelShort: {
97017
+ code: "m/d/yy",
97018
+ description: "Excel short date",
97019
+ example: "12/13/25"
97020
+ },
97021
+ excelMedium: {
97022
+ code: "d-mmm-yy",
97023
+ description: "Excel medium date",
97024
+ example: "13-Dec-25"
97025
+ },
97026
+ excelLong: {
97027
+ code: "d-mmm-yyyy",
97028
+ description: "Excel long date",
97029
+ example: "13-Dec-2025"
97030
+ }
97031
+ },
97032
+ time: {
97033
+ short12: {
97034
+ code: "h:mm AM/PM",
97035
+ description: "12-hour short",
97036
+ example: "3:45 PM"
97037
+ },
97038
+ long12: {
97039
+ code: "h:mm:ss AM/PM",
97040
+ description: "12-hour with seconds",
97041
+ example: "3:45:30 PM"
97042
+ },
97043
+ short24: {
97044
+ code: "HH:mm",
97045
+ description: "24-hour short",
97046
+ example: "15:45"
97047
+ },
97048
+ long24: {
97049
+ code: "HH:mm:ss",
97050
+ description: "24-hour with seconds",
97051
+ example: "15:45:30"
97052
+ },
97053
+ dateTime12: {
97054
+ code: "m/d/yyyy h:mm AM/PM",
97055
+ description: "Date and 12-hour time",
97056
+ example: "12/13/2025 3:45 PM"
97057
+ },
97058
+ dateTime24: {
97059
+ code: "yyyy-mm-dd HH:mm",
97060
+ description: "ISO date and 24-hour time",
97061
+ example: "2025-12-13 15:45"
97062
+ },
97063
+ durationHM: {
97064
+ code: "[h]:mm",
97065
+ description: "Hours and minutes (elapsed)",
97066
+ example: "25:30"
97067
+ },
97068
+ durationHMS: {
97069
+ code: "[h]:mm:ss",
97070
+ description: "Hours, minutes, seconds (elapsed)",
97071
+ example: "25:30:45"
97072
+ },
97073
+ durationMS: {
97074
+ code: "[mm]:ss",
97075
+ description: "Minutes and seconds (elapsed)",
97076
+ example: "1530:45"
97077
+ }
97078
+ },
97079
+ percentage: {
97080
+ integer: {
97081
+ code: "0%",
97082
+ description: "No decimal places",
97083
+ example: "50%"
97084
+ },
97085
+ decimal1: {
97086
+ code: "0.0%",
97087
+ description: "1 decimal place",
97088
+ example: "50.0%"
97089
+ },
97090
+ decimal2: {
97091
+ code: "0.00%",
97092
+ description: "2 decimal places",
97093
+ example: "50.00%"
97094
+ },
97095
+ decimal3: {
97096
+ code: "0.000%",
97097
+ description: "3 decimal places",
97098
+ example: "50.000%"
97099
+ }
97100
+ },
97101
+ fraction: {
97102
+ halves: {
97103
+ code: "# ?/2",
97104
+ description: "Halves (1/2)",
97105
+ example: "1 1/2"
97106
+ },
97107
+ quarters: {
97108
+ code: "# ?/4",
97109
+ description: "Quarters (1/4)",
97110
+ example: "1 1/4"
97111
+ },
97112
+ eighths: {
97113
+ code: "# ?/8",
97114
+ description: "Eighths (1/8)",
97115
+ example: "1 3/8"
97116
+ },
97117
+ sixteenths: {
97118
+ code: "# ??/16",
97119
+ description: "Sixteenths (1/16)",
97120
+ example: "1 5/16"
97121
+ },
97122
+ tenths: {
97123
+ code: "# ?/10",
97124
+ description: "Tenths (1/10)",
97125
+ example: "1 3/10"
97126
+ },
97127
+ hundredths: {
97128
+ code: "# ??/100",
97129
+ description: "Hundredths (1/100)",
97130
+ example: "1 25/100"
97131
+ },
97132
+ upToOneDigit: {
97133
+ code: "# ?/?",
97134
+ description: "Up to one digit (1/4)",
97135
+ example: "1 2/3"
97136
+ },
97137
+ upToTwoDigits: {
97138
+ code: "# ??/??",
97139
+ description: "Up to two digits (21/25)",
97140
+ example: "1 25/67"
97141
+ },
97142
+ upToThreeDigits: {
97143
+ code: "# ???/???",
97144
+ description: "Up to three digits (312/943)",
97145
+ example: "1 312/943"
97146
+ }
97147
+ },
97148
+ scientific: {
97149
+ default: {
97150
+ code: "0.00E+00",
97151
+ description: "2 decimal places",
97152
+ example: "1.23E+03"
97153
+ },
97154
+ decimal1: {
97155
+ code: "0.0E+00",
97156
+ description: "1 decimal place",
97157
+ example: "1.2E+03"
97158
+ },
97159
+ decimal3: {
97160
+ code: "0.000E+00",
97161
+ description: "3 decimal places",
97162
+ example: "1.235E+03"
97163
+ },
97164
+ noDecimals: {
97165
+ code: "0E+00",
97166
+ description: "No decimal places",
97167
+ example: "1E+03"
97168
+ }
97169
+ },
97170
+ text: {
97171
+ default: {
97172
+ code: "@",
97173
+ description: "Display as entered",
97174
+ example: "1234"
97175
+ }
97176
+ },
97177
+ special: {
97178
+ zipCode: {
97179
+ code: "00000",
97180
+ description: "ZIP Code (5-digit)",
97181
+ example: "01234"
97182
+ },
97183
+ zipPlus4: {
97184
+ code: "00000-0000",
97185
+ description: "ZIP+4 Code",
97186
+ example: "01234-5678"
97187
+ },
97188
+ phone: {
97189
+ code: "(###) ###-####",
97190
+ description: "Phone Number",
97191
+ example: "(555) 123-4567"
97192
+ },
97193
+ ssn: {
97194
+ code: "000-00-0000",
97195
+ description: "Social Security Number",
97196
+ example: "123-45-6789"
97197
+ }
97198
+ },
97199
+ custom: {}
97200
+ },
97201
+ defaultFormats: {
97202
+ accounting: '_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)',
97203
+ currency: "$#,##0.00",
97204
+ custom: "General",
97205
+ date: "m/d/yyyy",
97206
+ fraction: "# ?/?",
97207
+ general: "General",
97208
+ number: "#,##0.00",
97209
+ percentage: "0.00%",
97210
+ scientific: "0.00E+00",
97211
+ special: "00000",
97212
+ text: "@",
97213
+ time: "h:mm AM/PM"
96127
97214
  }
96128
97215
  };
96129
97216