@kition/kit-table-ui 0.0.0-stage → 0.1.1

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.
Files changed (120) hide show
  1. package/package.json +43 -4
  2. package/table-ui/LICENSE +177 -0
  3. package/table-ui/NOTICE +223 -0
  4. package/table-ui/THIRD_PARTY_NOTICES.txt +11689 -0
  5. package/table-ui/agent/checks.json +56 -0
  6. package/table-ui/agent/guide.md +367 -0
  7. package/table-ui/assets/common-B-bp9Ip3.js +1 -0
  8. package/table-ui/assets/common-BMUmnQ1g.js +1 -0
  9. package/table-ui/assets/common-Bhm8gfvH.js +1 -0
  10. package/table-ui/assets/common-CeDowx6y.js +1 -0
  11. package/table-ui/assets/common-CrgxgxUu.js +1 -0
  12. package/table-ui/assets/common-DBFkHMZV.js +1 -0
  13. package/table-ui/assets/dev-DLKWf75z.js +1 -0
  14. package/table-ui/assets/index-B4NhVTGq.css +1 -0
  15. package/table-ui/assets/index-Cnt14ZRl.js +167 -0
  16. package/table-ui/assets/kit-ui-protocol-BNgs-zwK.js +1 -0
  17. package/table-ui/assets/kitEngine.worker-xC2uPuSX-BzMhIUM6.js +7 -0
  18. package/table-ui/assets/loro_wasm_bg-Gulzks_0-Gulzks_0.wasm +0 -0
  19. package/table-ui/assets/table--j5_5jI6.js +1 -0
  20. package/table-ui/assets/table-B5yY2dYW.js +1 -0
  21. package/table-ui/assets/table-Bpba-GrO.js +1 -0
  22. package/table-ui/assets/table-CpZGkC_z.js +1 -0
  23. package/table-ui/assets/table-CqH5qF2L.js +1 -0
  24. package/table-ui/assets/table-DpGGBEXD.js +1 -0
  25. package/table-ui/engine/kition_table_kit.js +1451 -0
  26. package/table-ui/engine/kition_table_kit_bg.wasm +0 -0
  27. package/table-ui/fonts/droid-sans-fallback/DroidSansFallbackFull.ttf +0 -0
  28. package/table-ui/fonts/droid-sans-fallback/LICENSE +177 -0
  29. package/table-ui/fonts/droid-sans-fallback/NOTICE +190 -0
  30. package/table-ui/fonts/inter/Inter-Variable.ttf +0 -0
  31. package/table-ui/fonts/inter/OFL.txt +93 -0
  32. package/table-ui/fonts/nanum-gothic/NanumGothic-Regular.ttf +0 -0
  33. package/table-ui/fonts/nanum-gothic/OFL.txt +96 -0
  34. package/table-ui/fonts/noto-color-emoji/Noto-COLRv1.ttf +0 -0
  35. package/table-ui/fonts/noto-color-emoji/OFL.txt +92 -0
  36. package/table-ui/index.html +14 -0
  37. package/table-ui/kit-ui.json +1 -0
  38. package/table-ui/kit.json +250 -0
  39. package/table-ui/model/schema.json +108 -0
  40. package/table-ui/templates/batch-product-designer/manifest.json +368 -0
  41. package/table-ui/templates/batch-product-designer/records/record-01/design-01.webp +0 -0
  42. package/table-ui/templates/batch-product-designer/records/record-01/design-02.webp +0 -0
  43. package/table-ui/templates/batch-product-designer/records/record-01/feature-image-01.webp +0 -0
  44. package/table-ui/templates/batch-product-designer/records/record-01/lifestyle-shot-01.webp +0 -0
  45. package/table-ui/templates/batch-product-designer/records/record-01/orthographic-views-01.webp +0 -0
  46. package/table-ui/templates/batch-product-designer/records/record-01/style-board-01.webp +0 -0
  47. package/table-ui/templates/batch-product-designer/records/record-02/design-01.webp +0 -0
  48. package/table-ui/templates/batch-product-designer/records/record-02/design-02.webp +0 -0
  49. package/table-ui/templates/batch-product-designer/records/record-02/feature-image-01.webp +0 -0
  50. package/table-ui/templates/batch-product-designer/records/record-02/lifestyle-shot-01.webp +0 -0
  51. package/table-ui/templates/batch-product-designer/records/record-02/orthographic-views-01.webp +0 -0
  52. package/table-ui/templates/batch-product-designer/records/record-02/style-board-01.webp +0 -0
  53. package/table-ui/templates/batch-product-designer/records/record-03/design-01.webp +0 -0
  54. package/table-ui/templates/batch-product-designer/records/record-03/design-02.webp +0 -0
  55. package/table-ui/templates/batch-product-designer/records/record-03/feature-image-01.webp +0 -0
  56. package/table-ui/templates/batch-product-designer/records/record-03/lifestyle-shot-01.webp +0 -0
  57. package/table-ui/templates/batch-product-designer/records/record-03/orthographic-views-01.webp +0 -0
  58. package/table-ui/templates/batch-product-designer/records/record-03/style-board-01.webp +0 -0
  59. package/table-ui/templates/batch-product-designer/records/record-04/design-01.webp +0 -0
  60. package/table-ui/templates/batch-product-designer/records/record-04/design-02.webp +0 -0
  61. package/table-ui/templates/batch-product-designer/records/record-04/feature-image-01.webp +0 -0
  62. package/table-ui/templates/batch-product-designer/records/record-04/lifestyle-shot-01.webp +0 -0
  63. package/table-ui/templates/batch-product-designer/records/record-04/orthographic-views-01.webp +0 -0
  64. package/table-ui/templates/batch-product-designer/records/record-04/style-board-01.webp +0 -0
  65. package/table-ui/templates/batch-product-designer/records/record-05/design-01.webp +0 -0
  66. package/table-ui/templates/batch-product-designer/records/record-05/design-02.webp +0 -0
  67. package/table-ui/templates/batch-product-designer/records/record-05/feature-image-01.webp +0 -0
  68. package/table-ui/templates/batch-product-designer/records/record-05/lifestyle-shot-01.webp +0 -0
  69. package/table-ui/templates/batch-product-designer/records/record-05/orthographic-views-01.webp +0 -0
  70. package/table-ui/templates/batch-product-designer/records/record-05/style-board-01.webp +0 -0
  71. package/table-ui/templates/receipt-ocr-database/cover.webp +0 -0
  72. package/table-ui/templates/receipt-ocr-database/manifest.json +128 -0
  73. package/table-ui/templates/receipt-ocr-database/records/record-01/receipt.webp +0 -0
  74. package/table-ui/templates/receipt-ocr-database/records/record-02/receipt.webp +0 -0
  75. package/table-ui/templates/receipt-ocr-database/records/record-03/receipt.webp +0 -0
  76. package/table-ui/templates/receipt-ocr-database/records/record-04/receipt.webp +0 -0
  77. package/table-ui/templates/receipt-ocr-database/records/record-05/receipt.webp +0 -0
  78. package/table-ui/templates/receipt-ocr-database/records/record-06/receipt.webp +0 -0
  79. package/table-ui/templates/receipt-ocr-database/records/record-07/receipt.webp +0 -0
  80. package/table-ui/templates/receipt-ocr-database/records/record-08/receipt.webp +0 -0
  81. package/table-ui/templates/receipt-ocr-database/records/record-09/receipt.webp +0 -0
  82. package/table-ui/templates/receipt-ocr-database/records/record-10/receipt.webp +0 -0
  83. package/table-ui/templates/table-covers/batch-product-designer.webp +0 -0
  84. package/table-ui/templates/table-covers/business-analytics-dashboard.webp +0 -0
  85. package/table-ui/templates/table-covers/leads-landing-page.webp +0 -0
  86. package/table-ui/templates/table-covers/lumiere-restaurant.webp +0 -0
  87. package/table-ui/templates/table-covers/product-launch-website.webp +0 -0
  88. package/table-ui/templates/table-covers/project-gantt.webp +0 -0
  89. package/table-ui/templates/table-covers/receipt-ocr-database.webp +0 -0
  90. package/table-ui/templates/table-covers/sdr-cold-call-manager.webp +0 -0
  91. package/table-ui/templates/table-covers/simple-client-crm.webp +0 -0
  92. package/table-ui/templates/table-covers/task-tracker.webp +0 -0
  93. package/table-ui/templates/table-covers/thumbnail-generator.webp +0 -0
  94. package/table-ui/templates/youtube-tiktok-thumbnail-generator/manifest.json +308 -0
  95. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-01/face-photo-01.webp +0 -0
  96. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-01/thumbnail-16x9-01.webp +0 -0
  97. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-01/thumbnail-16x9-02.webp +0 -0
  98. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-01/thumbnail-9x16-01.webp +0 -0
  99. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-01/thumbnail-9x16-02.webp +0 -0
  100. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-02/face-photo-01.webp +0 -0
  101. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-02/thumbnail-16x9-01.webp +0 -0
  102. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-02/thumbnail-16x9-02.webp +0 -0
  103. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-02/thumbnail-9x16-01.webp +0 -0
  104. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-02/thumbnail-9x16-02.webp +0 -0
  105. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-03/face-photo-01.webp +0 -0
  106. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-03/thumbnail-16x9-01.webp +0 -0
  107. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-03/thumbnail-16x9-02.webp +0 -0
  108. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-03/thumbnail-9x16-01.webp +0 -0
  109. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-03/thumbnail-9x16-02.webp +0 -0
  110. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-04/face-photo-01.webp +0 -0
  111. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-04/thumbnail-16x9-01.webp +0 -0
  112. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-04/thumbnail-16x9-02.webp +0 -0
  113. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-04/thumbnail-9x16-01.webp +0 -0
  114. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-04/thumbnail-9x16-02.webp +0 -0
  115. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-05/face-photo-01.webp +0 -0
  116. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-05/thumbnail-16x9-01.webp +0 -0
  117. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-05/thumbnail-16x9-02.webp +0 -0
  118. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-05/thumbnail-9x16-01.webp +0 -0
  119. package/table-ui/templates/youtube-tiktok-thumbnail-generator/records/record-05/thumbnail-9x16-02.webp +0 -0
  120. package/README.md +0 -3
@@ -0,0 +1,1451 @@
1
+ export class TableDocument {
2
+ static __wrap(ptr) {
3
+ const obj = Object.create(TableDocument.prototype);
4
+ obj.__wbg_ptr = ptr;
5
+ TableDocumentFinalization.register(obj, obj.__wbg_ptr, obj);
6
+ return obj;
7
+ }
8
+ __destroy_into_raw() {
9
+ const ptr = this.__wbg_ptr;
10
+ this.__wbg_ptr = 0;
11
+ TableDocumentFinalization.unregister(this);
12
+ return ptr;
13
+ }
14
+ free() {
15
+ const ptr = this.__destroy_into_raw();
16
+ wasm.__wbg_tabledocument_free(ptr, 0);
17
+ }
18
+ /**
19
+ * Stores a peer's blobs (from their `blobs()` or `blobsSince`) before their changes import.
20
+ * @param {Uint8Array} bytes
21
+ */
22
+ addBlobs(bytes) {
23
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
24
+ const len0 = WASM_VECTOR_LEN;
25
+ const ret = wasm.tabledocument_addBlobs(this.__wbg_ptr, ptr0, len0);
26
+ if (ret[1]) {
27
+ throw takeFromExternrefTable0(ret[0]);
28
+ }
29
+ }
30
+ /**
31
+ * The blobs the changes since `since` name, encoded like `blobs()`: for live sync, so a
32
+ * change ships only the blobs it needs.
33
+ * @param {Uint8Array} since
34
+ * @returns {Uint8Array}
35
+ */
36
+ blobsSince(since) {
37
+ const ptr0 = passArray8ToWasm0(since, wasm.__wbindgen_malloc);
38
+ const len0 = WASM_VECTOR_LEN;
39
+ const ret = wasm.tabledocument_blobsSince(this.__wbg_ptr, ptr0, len0);
40
+ if (ret[3]) {
41
+ throw takeFromExternrefTable0(ret[2]);
42
+ }
43
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
44
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
45
+ return v2;
46
+ }
47
+ /**
48
+ * Every blob (an attachment held in the file) the document holds, for a peer's `addBlobs`.
49
+ * @returns {Uint8Array}
50
+ */
51
+ blobs() {
52
+ const ret = wasm.tabledocument_blobs(this.__wbg_ptr);
53
+ if (ret[3]) {
54
+ throw takeFromExternrefTable0(ret[2]);
55
+ }
56
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
57
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
58
+ return v1;
59
+ }
60
+ /**
61
+ * One `kition-table-api` request: `params` is JSON (an object, or empty for none); answers
62
+ * `{ "result", "change" }` as JSON.
63
+ * @param {string} method
64
+ * @param {string} params
65
+ * @returns {string}
66
+ */
67
+ call(method, params) {
68
+ let deferred4_0;
69
+ let deferred4_1;
70
+ try {
71
+ const ptr0 = passStringToWasm0(method, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
72
+ const len0 = WASM_VECTOR_LEN;
73
+ const ptr1 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
74
+ const len1 = WASM_VECTOR_LEN;
75
+ const ret = wasm.tabledocument_call(this.__wbg_ptr, ptr0, len0, ptr1, len1);
76
+ var ptr3 = ret[0];
77
+ var len3 = ret[1];
78
+ if (ret[3]) {
79
+ ptr3 = 0; len3 = 0;
80
+ throw takeFromExternrefTable0(ret[2]);
81
+ }
82
+ deferred4_0 = ptr3;
83
+ deferred4_1 = len3;
84
+ return getStringFromWasm0(ptr3, len3);
85
+ } finally {
86
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
87
+ }
88
+ }
89
+ /**
90
+ * @returns {boolean}
91
+ */
92
+ canRedo() {
93
+ const ret = wasm.tabledocument_canRedo(this.__wbg_ptr);
94
+ return ret !== 0;
95
+ }
96
+ /**
97
+ * @returns {boolean}
98
+ */
99
+ canUndo() {
100
+ const ret = wasm.tabledocument_canUndo(this.__wbg_ptr);
101
+ return ret !== 0;
102
+ }
103
+ /**
104
+ * `{ "diagnostics": [...] }` as JSON (standard 2.0 A21).
105
+ * @returns {string}
106
+ */
107
+ check() {
108
+ let deferred1_0;
109
+ let deferred1_1;
110
+ try {
111
+ const ret = wasm.tabledocument_check(this.__wbg_ptr);
112
+ deferred1_0 = ret[0];
113
+ deferred1_1 = ret[1];
114
+ return getStringFromWasm0(ret[0], ret[1]);
115
+ } finally {
116
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
117
+ }
118
+ }
119
+ /**
120
+ * @returns {string}
121
+ */
122
+ commands() {
123
+ let deferred1_0;
124
+ let deferred1_1;
125
+ try {
126
+ const ret = wasm.tabledocument_commands(this.__wbg_ptr);
127
+ deferred1_0 = ret[0];
128
+ deferred1_1 = ret[1];
129
+ return getStringFromWasm0(ret[0], ret[1]);
130
+ } finally {
131
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
132
+ }
133
+ }
134
+ /**
135
+ * @returns {number}
136
+ */
137
+ static contractVersion() {
138
+ const ret = wasm.tabledocument_contractVersion();
139
+ return ret >>> 0;
140
+ }
141
+ /**
142
+ * @param {string} name
143
+ * @param {number} width
144
+ * @param {number} height
145
+ * @returns {TableDocument}
146
+ */
147
+ static create(name, width, height) {
148
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
149
+ const len0 = WASM_VECTOR_LEN;
150
+ const ret = wasm.tabledocument_create(ptr0, len0, width, height);
151
+ if (ret[2]) {
152
+ throw takeFromExternrefTable0(ret[1]);
153
+ }
154
+ return TableDocument.__wrap(ret[0]);
155
+ }
156
+ /**
157
+ * @returns {boolean}
158
+ */
159
+ get dirty() {
160
+ const ret = wasm.tabledocument_dirty(this.__wbg_ptr);
161
+ return ret !== 0;
162
+ }
163
+ /**
164
+ * The ids of the commands that cannot run now, as a JSON array.
165
+ * @returns {string}
166
+ */
167
+ disabledCommands() {
168
+ let deferred1_0;
169
+ let deferred1_1;
170
+ try {
171
+ const ret = wasm.tabledocument_disabledCommands(this.__wbg_ptr);
172
+ deferred1_0 = ret[0];
173
+ deferred1_1 = ret[1];
174
+ return getStringFromWasm0(ret[0], ret[1]);
175
+ } finally {
176
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
177
+ }
178
+ }
179
+ /**
180
+ * @returns {string}
181
+ */
182
+ get docId() {
183
+ let deferred1_0;
184
+ let deferred1_1;
185
+ try {
186
+ const ret = wasm.tabledocument_docId(this.__wbg_ptr);
187
+ deferred1_0 = ret[0];
188
+ deferred1_1 = ret[1];
189
+ return getStringFromWasm0(ret[0], ret[1]);
190
+ } finally {
191
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
192
+ }
193
+ }
194
+ /**
195
+ * The editor state that is not the document, as JSON (`KitDocument::editor_state`):
196
+ * an editor puts the person's aside while an agent's step runs in the agent's own.
197
+ * @returns {string}
198
+ */
199
+ editorState() {
200
+ let deferred1_0;
201
+ let deferred1_1;
202
+ try {
203
+ const ret = wasm.tabledocument_editorState(this.__wbg_ptr);
204
+ deferred1_0 = ret[0];
205
+ deferred1_1 = ret[1];
206
+ return getStringFromWasm0(ret[0], ret[1]);
207
+ } finally {
208
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
209
+ }
210
+ }
211
+ /**
212
+ * Runs a command as `origin` (the KDM's commit form, the JSON array `[kind, principal,
213
+ * label]`): the editor's worker runs an agent's step this way, so the step is the agent's and
214
+ * the agent's undo (KitModel M12a) takes it back.
215
+ * @param {string} command
216
+ * @param {string} params
217
+ * @param {string} origin
218
+ * @returns {string}
219
+ */
220
+ executeAs(command, params, origin) {
221
+ let deferred5_0;
222
+ let deferred5_1;
223
+ try {
224
+ const ptr0 = passStringToWasm0(command, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
225
+ const len0 = WASM_VECTOR_LEN;
226
+ const ptr1 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
227
+ const len1 = WASM_VECTOR_LEN;
228
+ const ptr2 = passStringToWasm0(origin, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
229
+ const len2 = WASM_VECTOR_LEN;
230
+ const ret = wasm.tabledocument_executeAs(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
231
+ var ptr4 = ret[0];
232
+ var len4 = ret[1];
233
+ if (ret[3]) {
234
+ ptr4 = 0; len4 = 0;
235
+ throw takeFromExternrefTable0(ret[2]);
236
+ }
237
+ deferred5_0 = ptr4;
238
+ deferred5_1 = len4;
239
+ return getStringFromWasm0(ptr4, len4);
240
+ } finally {
241
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
242
+ }
243
+ }
244
+ /**
245
+ * @param {string} command
246
+ * @param {string} params
247
+ * @returns {string}
248
+ */
249
+ execute(command, params) {
250
+ let deferred4_0;
251
+ let deferred4_1;
252
+ try {
253
+ const ptr0 = passStringToWasm0(command, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
254
+ const len0 = WASM_VECTOR_LEN;
255
+ const ptr1 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
256
+ const len1 = WASM_VECTOR_LEN;
257
+ const ret = wasm.tabledocument_execute(this.__wbg_ptr, ptr0, len0, ptr1, len1);
258
+ var ptr3 = ret[0];
259
+ var len3 = ret[1];
260
+ if (ret[3]) {
261
+ ptr3 = 0; len3 = 0;
262
+ throw takeFromExternrefTable0(ret[2]);
263
+ }
264
+ deferred4_0 = ptr3;
265
+ deferred4_1 = len3;
266
+ return getStringFromWasm0(ptr3, len3);
267
+ } finally {
268
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
269
+ }
270
+ }
271
+ /**
272
+ * @param {Uint8Array} since
273
+ * @returns {Uint8Array}
274
+ */
275
+ exportChanges(since) {
276
+ const ptr0 = passArray8ToWasm0(since, wasm.__wbindgen_malloc);
277
+ const len0 = WASM_VECTOR_LEN;
278
+ const ret = wasm.tabledocument_exportChanges(this.__wbg_ptr, ptr0, len0);
279
+ if (ret[3]) {
280
+ throw takeFromExternrefTable0(ret[2]);
281
+ }
282
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
283
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
284
+ return v2;
285
+ }
286
+ /**
287
+ * @returns {TableDocument}
288
+ */
289
+ forkForPremises() {
290
+ const ret = wasm.tabledocument_forkForPremises(this.__wbg_ptr);
291
+ if (ret[2]) {
292
+ throw takeFromExternrefTable0(ret[1]);
293
+ }
294
+ return TableDocument.__wrap(ret[0]);
295
+ }
296
+ /**
297
+ * Lays out the arrangement `axis` (what `gridOpen` or `gridSync` answered) for the view
298
+ * `params` (`{tableId, viewId?, theme?, brand?}`); answers the axes as JSON.
299
+ * @param {Uint8Array} axis
300
+ * @param {string} params
301
+ * @returns {string}
302
+ */
303
+ gridAxes(axis, params) {
304
+ let deferred4_0;
305
+ let deferred4_1;
306
+ try {
307
+ const ptr0 = passArray8ToWasm0(axis, wasm.__wbindgen_malloc);
308
+ const len0 = WASM_VECTOR_LEN;
309
+ const ptr1 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
310
+ const len1 = WASM_VECTOR_LEN;
311
+ const ret = wasm.tabledocument_gridAxes(this.__wbg_ptr, ptr0, len0, ptr1, len1);
312
+ var ptr3 = ret[0];
313
+ var len3 = ret[1];
314
+ if (ret[3]) {
315
+ ptr3 = 0; len3 = 0;
316
+ throw takeFromExternrefTable0(ret[2]);
317
+ }
318
+ deferred4_0 = ptr3;
319
+ deferred4_1 = len3;
320
+ return getStringFromWasm0(ptr3, len3);
321
+ } finally {
322
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
323
+ }
324
+ }
325
+ /**
326
+ * The bands `keys` (layer, column band, row band triples) of arrangement `epoch` at
327
+ * `dpr` (drafts when `draft`), with the resources page session `session` does not hold
328
+ * yet, as one batch.
329
+ * @param {number} epoch
330
+ * @param {Uint32Array} keys
331
+ * @param {number} dpr
332
+ * @param {number} session
333
+ * @param {boolean} draft
334
+ * @returns {Uint8Array}
335
+ */
336
+ gridBands(epoch, keys, dpr, session, draft) {
337
+ const ptr0 = passArray32ToWasm0(keys, wasm.__wbindgen_malloc);
338
+ const len0 = WASM_VECTOR_LEN;
339
+ const ret = wasm.tabledocument_gridBands(this.__wbg_ptr, epoch, ptr0, len0, dpr, session, draft);
340
+ if (ret[3]) {
341
+ throw takeFromExternrefTable0(ret[2]);
342
+ }
343
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
344
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
345
+ return v2;
346
+ }
347
+ /**
348
+ * Clears records of a table (`{tableId, values}`, the records' ids as numbers) in one
349
+ * `transact`; answers JSON `{result, change}`.
350
+ * @param {string} params
351
+ * @param {Float64Array} ids
352
+ * @returns {string}
353
+ */
354
+ gridClear(params, ids) {
355
+ let deferred4_0;
356
+ let deferred4_1;
357
+ try {
358
+ const ptr0 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
359
+ const len0 = WASM_VECTOR_LEN;
360
+ const ptr1 = passArrayF64ToWasm0(ids, wasm.__wbindgen_malloc);
361
+ const len1 = WASM_VECTOR_LEN;
362
+ const ret = wasm.tabledocument_gridClear(this.__wbg_ptr, ptr0, len0, ptr1, len1);
363
+ var ptr3 = ret[0];
364
+ var len3 = ret[1];
365
+ if (ret[3]) {
366
+ ptr3 = 0; len3 = 0;
367
+ throw takeFromExternrefTable0(ret[2]);
368
+ }
369
+ deferred4_0 = ptr3;
370
+ deferred4_1 = len3;
371
+ return getStringFromWasm0(ptr3, len3);
372
+ } finally {
373
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
374
+ }
375
+ }
376
+ /**
377
+ * Which cells of a run of the arrangement's rows hold the search: `params` is JSON `{epoch,
378
+ * from, count, fieldIds}`; answers the hits (`kition-table-arrange`, hits format v1) as bytes.
379
+ * @param {string} params
380
+ * @returns {Uint8Array}
381
+ */
382
+ gridHits(params) {
383
+ const ptr0 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
384
+ const len0 = WASM_VECTOR_LEN;
385
+ const ret = wasm.tabledocument_gridHits(this.__wbg_ptr, ptr0, len0);
386
+ if (ret[3]) {
387
+ throw takeFromExternrefTable0(ret[2]);
388
+ }
389
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
390
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
391
+ return v2;
392
+ }
393
+ /**
394
+ * How the grid splits `[{text, weight, size}]` into runs and measures them (JSON).
395
+ * @param {string} asks
396
+ * @returns {string}
397
+ */
398
+ gridMeasure(asks) {
399
+ let deferred3_0;
400
+ let deferred3_1;
401
+ try {
402
+ const ptr0 = passStringToWasm0(asks, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
403
+ const len0 = WASM_VECTOR_LEN;
404
+ const ret = wasm.tabledocument_gridMeasure(this.__wbg_ptr, ptr0, len0);
405
+ var ptr2 = ret[0];
406
+ var len2 = ret[1];
407
+ if (ret[3]) {
408
+ ptr2 = 0; len2 = 0;
409
+ throw takeFromExternrefTable0(ret[2]);
410
+ }
411
+ deferred3_0 = ptr2;
412
+ deferred3_1 = len2;
413
+ return getStringFromWasm0(ptr2, len2);
414
+ } finally {
415
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
416
+ }
417
+ }
418
+ /**
419
+ * Arranges a view for the editor: `params` is JSON `{tableId, viewId?, config?, query?,
420
+ * collapsed?}`; answers the axis (`kition-table-arrange`, format v2) as bytes.
421
+ * @param {string} params
422
+ * @returns {Uint8Array}
423
+ */
424
+ gridOpen(params) {
425
+ const ptr0 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
426
+ const len0 = WASM_VECTOR_LEN;
427
+ const ret = wasm.tabledocument_gridOpen(this.__wbg_ptr, ptr0, len0);
428
+ if (ret[3]) {
429
+ throw takeFromExternrefTable0(ret[2]);
430
+ }
431
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
432
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
433
+ return v2;
434
+ }
435
+ /**
436
+ * The optical sizing the grid measures its text with, the page Canvas's: `auto` (the
437
+ * default) or `fixed-default`; answers whether it changed.
438
+ * @param {string} sizing
439
+ * @returns {boolean}
440
+ */
441
+ gridOpticalSizing(sizing) {
442
+ const ptr0 = passStringToWasm0(sizing, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
443
+ const len0 = WASM_VECTOR_LEN;
444
+ const ret = wasm.tabledocument_gridOpticalSizing(this.__wbg_ptr, ptr0, len0);
445
+ if (ret[2]) {
446
+ throw takeFromExternrefTable0(ret[1]);
447
+ }
448
+ return ret[0] !== 0;
449
+ }
450
+ /**
451
+ * A picture the page's browser does not decode, decoded by the engine: width, height,
452
+ * straight RGBA8; no bytes when the engine does not read it either.
453
+ * @param {Uint8Array} bytes
454
+ * @param {number} max_side
455
+ * @returns {Uint8Array}
456
+ */
457
+ gridPicture(bytes, max_side) {
458
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
459
+ const len0 = WASM_VECTOR_LEN;
460
+ const ret = wasm.tabledocument_gridPicture(this.__wbg_ptr, ptr0, len0, max_side);
461
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
462
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
463
+ return v2;
464
+ }
465
+ /**
466
+ * One band as the engine rasterizes it (for the parity test): width, height, RGBA8.
467
+ * @param {number} epoch
468
+ * @param {number} layer
469
+ * @param {number} col_band
470
+ * @param {number} row_band
471
+ * @param {number} dpr
472
+ * @returns {Uint8Array}
473
+ */
474
+ gridRaster(epoch, layer, col_band, row_band, dpr) {
475
+ const ret = wasm.tabledocument_gridRaster(this.__wbg_ptr, epoch, layer, col_band, row_band, dpr);
476
+ if (ret[3]) {
477
+ throw takeFromExternrefTable0(ret[2]);
478
+ }
479
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
480
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
481
+ return v1;
482
+ }
483
+ /**
484
+ * The records of some ids (`{tableId, ids, fields?}`), as JSON `[{id, row_key, values}]`.
485
+ * @param {string} params
486
+ * @returns {string}
487
+ */
488
+ gridRecords(params) {
489
+ let deferred3_0;
490
+ let deferred3_1;
491
+ try {
492
+ const ptr0 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
493
+ const len0 = WASM_VECTOR_LEN;
494
+ const ret = wasm.tabledocument_gridRecords(this.__wbg_ptr, ptr0, len0);
495
+ var ptr2 = ret[0];
496
+ var len2 = ret[1];
497
+ if (ret[3]) {
498
+ ptr2 = 0; len2 = 0;
499
+ throw takeFromExternrefTable0(ret[2]);
500
+ }
501
+ deferred3_0 = ptr2;
502
+ deferred3_1 = len2;
503
+ return getStringFromWasm0(ptr2, len2);
504
+ } finally {
505
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
506
+ }
507
+ }
508
+ /**
509
+ * What each linear row of the laid-out grid is: a record, a group header or an add row.
510
+ * @returns {Uint8Array}
511
+ */
512
+ gridRows() {
513
+ const ret = wasm.tabledocument_gridRows(this.__wbg_ptr);
514
+ if (ret[3]) {
515
+ throw takeFromExternrefTable0(ret[2]);
516
+ }
517
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
518
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
519
+ return v1;
520
+ }
521
+ /**
522
+ * `[{text, weight, size}]` set one line each by the grid's shaping, as a display list,
523
+ * and its raster (for the parity test): list length, the list, width, height, RGBA8.
524
+ * @param {string} asks
525
+ * @param {number} dpr
526
+ * @returns {Uint8Array}
527
+ */
528
+ gridSpecimen(asks, dpr) {
529
+ const ptr0 = passStringToWasm0(asks, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
530
+ const len0 = WASM_VECTOR_LEN;
531
+ const ret = wasm.tabledocument_gridSpecimen(this.__wbg_ptr, ptr0, len0, dpr);
532
+ if (ret[3]) {
533
+ throw takeFromExternrefTable0(ret[2]);
534
+ }
535
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
536
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
537
+ return v2;
538
+ }
539
+ /**
540
+ * How long arranging took, as JSON (for performance tests).
541
+ * @returns {string}
542
+ */
543
+ gridStats() {
544
+ let deferred1_0;
545
+ let deferred1_1;
546
+ try {
547
+ const ret = wasm.tabledocument_gridStats(this.__wbg_ptr);
548
+ deferred1_0 = ret[0];
549
+ deferred1_1 = ret[1];
550
+ return getStringFromWasm0(ret[0], ret[1]);
551
+ } finally {
552
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
553
+ }
554
+ }
555
+ /**
556
+ * The numbers of some fields over the editor's arrangement (`{fields}`), as JSON
557
+ * `[{field, count, sum}]`.
558
+ * @param {string} params
559
+ * @returns {string}
560
+ */
561
+ gridSummary(params) {
562
+ let deferred3_0;
563
+ let deferred3_1;
564
+ try {
565
+ const ptr0 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
566
+ const len0 = WASM_VECTOR_LEN;
567
+ const ret = wasm.tabledocument_gridSummary(this.__wbg_ptr, ptr0, len0);
568
+ var ptr2 = ret[0];
569
+ var len2 = ret[1];
570
+ if (ret[3]) {
571
+ ptr2 = 0; len2 = 0;
572
+ throw takeFromExternrefTable0(ret[2]);
573
+ }
574
+ deferred3_0 = ptr2;
575
+ deferred3_1 = len2;
576
+ return getStringFromWasm0(ptr2, len2);
577
+ } finally {
578
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
579
+ }
580
+ }
581
+ /**
582
+ * The editor's arrangement brought to the document's current state: the new axis, or no
583
+ * bytes when the axis is the same.
584
+ * @returns {Uint8Array}
585
+ */
586
+ gridSync() {
587
+ const ret = wasm.tabledocument_gridSync(this.__wbg_ptr);
588
+ if (ret[3]) {
589
+ throw takeFromExternrefTable0(ret[2]);
590
+ }
591
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
592
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
593
+ return v1;
594
+ }
595
+ /**
596
+ * The file holds its replica: there always is one.
597
+ * @returns {boolean}
598
+ */
599
+ get hasReplica() {
600
+ const ret = wasm.tabledocument_hasReplica(this.__wbg_ptr);
601
+ return ret !== 0;
602
+ }
603
+ /**
604
+ * @returns {number}
605
+ */
606
+ get height() {
607
+ const ret = wasm.tabledocument_height(this.__wbg_ptr);
608
+ return ret >>> 0;
609
+ }
610
+ /**
611
+ * @param {Uint8Array} bytes
612
+ * @returns {string}
613
+ */
614
+ importChanges(bytes) {
615
+ let deferred3_0;
616
+ let deferred3_1;
617
+ try {
618
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
619
+ const len0 = WASM_VECTOR_LEN;
620
+ const ret = wasm.tabledocument_importChanges(this.__wbg_ptr, ptr0, len0);
621
+ var ptr2 = ret[0];
622
+ var len2 = ret[1];
623
+ if (ret[3]) {
624
+ ptr2 = 0; len2 = 0;
625
+ throw takeFromExternrefTable0(ret[2]);
626
+ }
627
+ deferred3_0 = ptr2;
628
+ deferred3_1 = len2;
629
+ return getStringFromWasm0(ptr2, len2);
630
+ } finally {
631
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
632
+ }
633
+ }
634
+ /**
635
+ * @returns {string}
636
+ */
637
+ inspect() {
638
+ let deferred2_0;
639
+ let deferred2_1;
640
+ try {
641
+ const ret = wasm.tabledocument_inspect(this.__wbg_ptr);
642
+ var ptr1 = ret[0];
643
+ var len1 = ret[1];
644
+ if (ret[3]) {
645
+ ptr1 = 0; len1 = 0;
646
+ throw takeFromExternrefTable0(ret[2]);
647
+ }
648
+ deferred2_0 = ptr1;
649
+ deferred2_1 = len1;
650
+ return getStringFromWasm0(ptr1, len1);
651
+ } finally {
652
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
653
+ }
654
+ }
655
+ markSaved() {
656
+ wasm.tabledocument_markSaved(this.__wbg_ptr);
657
+ }
658
+ /**
659
+ * Opens file bytes with the replica a host stored for them (engine contract 2): a snapshot of
660
+ * the file's own document (a co-editing room's) is merged into it, and empty `bytes` (no file
661
+ * yet) open the replica alone.
662
+ * @param {string} name
663
+ * @param {Uint8Array} bytes
664
+ * @param {Uint8Array} snapshot
665
+ * @param {Uint8Array} blobs
666
+ * @returns {TableDocument}
667
+ */
668
+ static openWithReplica(name, bytes, snapshot, blobs) {
669
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
670
+ const len0 = WASM_VECTOR_LEN;
671
+ const ptr1 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
672
+ const len1 = WASM_VECTOR_LEN;
673
+ const ptr2 = passArray8ToWasm0(snapshot, wasm.__wbindgen_malloc);
674
+ const len2 = WASM_VECTOR_LEN;
675
+ const ptr3 = passArray8ToWasm0(blobs, wasm.__wbindgen_malloc);
676
+ const len3 = WASM_VECTOR_LEN;
677
+ const ret = wasm.tabledocument_openWithReplica(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
678
+ if (ret[2]) {
679
+ throw takeFromExternrefTable0(ret[1]);
680
+ }
681
+ return TableDocument.__wrap(ret[0]);
682
+ }
683
+ /**
684
+ * @param {string} name
685
+ * @param {Uint8Array} bytes
686
+ * @returns {TableDocument}
687
+ */
688
+ static open(name, bytes) {
689
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
690
+ const len0 = WASM_VECTOR_LEN;
691
+ const ptr1 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
692
+ const len1 = WASM_VECTOR_LEN;
693
+ const ret = wasm.tabledocument_open(ptr0, len0, ptr1, len1);
694
+ if (ret[2]) {
695
+ throw takeFromExternrefTable0(ret[1]);
696
+ }
697
+ return TableDocument.__wrap(ret[0]);
698
+ }
699
+ /**
700
+ * @returns {number}
701
+ */
702
+ get pinnedLeft() {
703
+ const ret = wasm.tabledocument_pinnedLeft(this.__wbg_ptr);
704
+ return ret >>> 0;
705
+ }
706
+ /**
707
+ * @returns {number}
708
+ */
709
+ get pinnedTop() {
710
+ const ret = wasm.tabledocument_pinnedTop(this.__wbg_ptr);
711
+ return ret >>> 0;
712
+ }
713
+ /**
714
+ * @param {string} method
715
+ * @param {string} params
716
+ * @returns {string}
717
+ */
718
+ premiseRead(method, params) {
719
+ let deferred4_0;
720
+ let deferred4_1;
721
+ try {
722
+ const ptr0 = passStringToWasm0(method, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
723
+ const len0 = WASM_VECTOR_LEN;
724
+ const ptr1 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
725
+ const len1 = WASM_VECTOR_LEN;
726
+ const ret = wasm.tabledocument_premiseRead(this.__wbg_ptr, ptr0, len0, ptr1, len1);
727
+ var ptr3 = ret[0];
728
+ var len3 = ret[1];
729
+ if (ret[3]) {
730
+ ptr3 = 0; len3 = 0;
731
+ throw takeFromExternrefTable0(ret[2]);
732
+ }
733
+ deferred4_0 = ptr3;
734
+ deferred4_1 = len3;
735
+ return getStringFromWasm0(ptr3, len3);
736
+ } finally {
737
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
738
+ }
739
+ }
740
+ /**
741
+ * Redoes the person's last undone step; answers `{"done", "damage"}` as JSON.
742
+ * @returns {string}
743
+ */
744
+ redo() {
745
+ let deferred2_0;
746
+ let deferred2_1;
747
+ try {
748
+ const ret = wasm.tabledocument_redo(this.__wbg_ptr);
749
+ var ptr1 = ret[0];
750
+ var len1 = ret[1];
751
+ if (ret[3]) {
752
+ ptr1 = 0; len1 = 0;
753
+ throw takeFromExternrefTable0(ret[2]);
754
+ }
755
+ deferred2_0 = ptr1;
756
+ deferred2_1 = len1;
757
+ return getStringFromWasm0(ptr1, len1);
758
+ } finally {
759
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
760
+ }
761
+ }
762
+ /**
763
+ * @param {number} x0
764
+ * @param {number} y0
765
+ * @param {number} x1
766
+ * @param {number} y1
767
+ * @param {number} width
768
+ * @param {number} height
769
+ * @returns {Uint8Array}
770
+ */
771
+ renderArea(x0, y0, x1, y1, width, height) {
772
+ const ret = wasm.tabledocument_renderArea(this.__wbg_ptr, x0, y0, x1, y1, width, height);
773
+ if (ret[3]) {
774
+ throw takeFromExternrefTable0(ret[2]);
775
+ }
776
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
777
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
778
+ return v1;
779
+ }
780
+ /**
781
+ * @param {number} x
782
+ * @param {number} y
783
+ * @param {number} scale
784
+ * @param {number} width
785
+ * @param {number} height
786
+ * @returns {Uint8Array}
787
+ */
788
+ render(x, y, scale, width, height) {
789
+ const ret = wasm.tabledocument_render(this.__wbg_ptr, x, y, scale, width, height);
790
+ if (ret[3]) {
791
+ throw takeFromExternrefTable0(ret[2]);
792
+ }
793
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
794
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
795
+ return v1;
796
+ }
797
+ /**
798
+ * Puts back what `editorState()` answered (`KitDocument::restore_editor_state`).
799
+ * @param {string} state
800
+ */
801
+ restoreEditorState(state) {
802
+ const ptr0 = passStringToWasm0(state, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
803
+ const len0 = WASM_VECTOR_LEN;
804
+ const ret = wasm.tabledocument_restoreEditorState(this.__wbg_ptr, ptr0, len0);
805
+ if (ret[1]) {
806
+ throw takeFromExternrefTable0(ret[0]);
807
+ }
808
+ }
809
+ /**
810
+ * @returns {bigint}
811
+ */
812
+ get revision() {
813
+ const ret = wasm.tabledocument_revision(this.__wbg_ptr);
814
+ return BigInt.asUintN(64, ret);
815
+ }
816
+ /**
817
+ * @param {string | null} [name]
818
+ * @returns {Uint8Array}
819
+ */
820
+ save(name) {
821
+ var ptr0 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
822
+ var len0 = WASM_VECTOR_LEN;
823
+ const ret = wasm.tabledocument_save(this.__wbg_ptr, ptr0, len0);
824
+ if (ret[3]) {
825
+ throw takeFromExternrefTable0(ret[2]);
826
+ }
827
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
828
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
829
+ return v2;
830
+ }
831
+ /**
832
+ * Sets the editor state one command reads from a call context `{on?, part?, time?}` as
833
+ * JSON (`KitDocument::set_context`).
834
+ * @param {string} context
835
+ */
836
+ setContext(context) {
837
+ const ptr0 = passStringToWasm0(context, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
838
+ const len0 = WASM_VECTOR_LEN;
839
+ const ret = wasm.tabledocument_setContext(this.__wbg_ptr, ptr0, len0);
840
+ if (ret[1]) {
841
+ throw takeFromExternrefTable0(ret[0]);
842
+ }
843
+ }
844
+ /**
845
+ * The replica as a snapshot, for a peer's `openWithReplica` (engine contract 2).
846
+ * @returns {Uint8Array}
847
+ */
848
+ snapshot() {
849
+ const ret = wasm.tabledocument_snapshot(this.__wbg_ptr);
850
+ if (ret[3]) {
851
+ throw takeFromExternrefTable0(ret[2]);
852
+ }
853
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
854
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
855
+ return v1;
856
+ }
857
+ /**
858
+ * The `TableChange`s of the replica changes imported since the last call, as a JSON array
859
+ * of `table/changed` params.
860
+ * @returns {string}
861
+ */
862
+ takeImported() {
863
+ let deferred1_0;
864
+ let deferred1_1;
865
+ try {
866
+ const ret = wasm.tabledocument_takeImported(this.__wbg_ptr);
867
+ deferred1_0 = ret[0];
868
+ deferred1_1 = ret[1];
869
+ return getStringFromWasm0(ret[0], ret[1]);
870
+ } finally {
871
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
872
+ }
873
+ }
874
+ /**
875
+ * The next chunk of output `id`, at most `max` bytes (engine contract E16).
876
+ * @param {string} id
877
+ * @param {number | null} [max]
878
+ * @returns {Uint8Array}
879
+ */
880
+ takeOutput(id, max) {
881
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
882
+ const len0 = WASM_VECTOR_LEN;
883
+ const ret = wasm.tabledocument_takeOutput(this.__wbg_ptr, ptr0, len0, isLikeNone(max) ? Number.MAX_SAFE_INTEGER : (max) >>> 0);
884
+ if (ret[3]) {
885
+ throw takeFromExternrefTable0(ret[2]);
886
+ }
887
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
888
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
889
+ return v2;
890
+ }
891
+ /**
892
+ * Undoes the person's last step; answers `{"done", "damage"}` as JSON.
893
+ * @returns {string}
894
+ */
895
+ undo() {
896
+ let deferred2_0;
897
+ let deferred2_1;
898
+ try {
899
+ const ret = wasm.tabledocument_undo(this.__wbg_ptr);
900
+ var ptr1 = ret[0];
901
+ var len1 = ret[1];
902
+ if (ret[3]) {
903
+ ptr1 = 0; len1 = 0;
904
+ throw takeFromExternrefTable0(ret[2]);
905
+ }
906
+ deferred2_0 = ptr1;
907
+ deferred2_1 = len1;
908
+ return getStringFromWasm0(ptr1, len1);
909
+ } finally {
910
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
911
+ }
912
+ }
913
+ /**
914
+ * @returns {Uint8Array}
915
+ */
916
+ version() {
917
+ const ret = wasm.tabledocument_version(this.__wbg_ptr);
918
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
919
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
920
+ return v1;
921
+ }
922
+ /**
923
+ * @returns {number}
924
+ */
925
+ get width() {
926
+ const ret = wasm.tabledocument_width(this.__wbg_ptr);
927
+ return ret >>> 0;
928
+ }
929
+ }
930
+ if (Symbol.dispose) TableDocument.prototype[Symbol.dispose] = TableDocument.prototype.free;
931
+
932
+ /**
933
+ * Registers a font file for the document's picture and grid (Kition platform E9; kit-editor
934
+ * calls it for Inter, its `fonts`, before a table opens, and for the others, its `lazyFonts`,
935
+ * once `wantsFonts` answers `true`); answers its family name. Without fonts the picture has no
936
+ * text. Text laid out after it is set in the new face.
937
+ * @param {Uint8Array} bytes
938
+ * @returns {string}
939
+ */
940
+ export function addFont(bytes) {
941
+ let deferred3_0;
942
+ let deferred3_1;
943
+ try {
944
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
945
+ const len0 = WASM_VECTOR_LEN;
946
+ const ret = wasm.addFont(ptr0, len0);
947
+ var ptr2 = ret[0];
948
+ var len2 = ret[1];
949
+ if (ret[3]) {
950
+ ptr2 = 0; len2 = 0;
951
+ throw takeFromExternrefTable0(ret[2]);
952
+ }
953
+ deferred3_0 = ptr2;
954
+ deferred3_1 = len2;
955
+ return getStringFromWasm0(ptr2, len2);
956
+ } finally {
957
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
958
+ }
959
+ }
960
+
961
+ /**
962
+ * Every method `call` answers, with the Kition runtime route it mirrors (relative to
963
+ * `/v1/data-documents/{documentId}`), as a JSON array of `[method, route]`: what a host needs to
964
+ * answer Kition's data-document HTTP API from the engine.
965
+ * @returns {string}
966
+ */
967
+ export function tableMethods() {
968
+ let deferred1_0;
969
+ let deferred1_1;
970
+ try {
971
+ const ret = wasm.tableMethods();
972
+ deferred1_0 = ret[0];
973
+ deferred1_1 = ret[1];
974
+ return getStringFromWasm0(ret[0], ret[1]);
975
+ } finally {
976
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
977
+ }
978
+ }
979
+
980
+ /**
981
+ * Whether text laid out since the last call had a character none of the registered faces covers
982
+ * (it drew as tofu), or an emoji without the emoji face (Kition platform E9a); the call clears it.
983
+ * @returns {boolean}
984
+ */
985
+ export function wantsFonts() {
986
+ const ret = wasm.wantsFonts();
987
+ return ret !== 0;
988
+ }
989
+ function __wbg_get_imports() {
990
+ const import0 = {
991
+ __proto__: null,
992
+ __wbg_Error_30c8987f7c2ed4e2: function(arg0, arg1) {
993
+ const ret = Error(getStringFromWasm0(arg0, arg1));
994
+ return ret;
995
+ },
996
+ __wbg___wbindgen_is_function_1f9d30630b8b1d3d: function(arg0) {
997
+ const ret = typeof(arg0) === 'function';
998
+ return ret;
999
+ },
1000
+ __wbg___wbindgen_is_object_3c45d4f2dde4e749: function(arg0) {
1001
+ const val = arg0;
1002
+ const ret = typeof(val) === 'object' && val !== null;
1003
+ return ret;
1004
+ },
1005
+ __wbg___wbindgen_is_string_90b56bc79aad6f6c: function(arg0) {
1006
+ const ret = typeof(arg0) === 'string';
1007
+ return ret;
1008
+ },
1009
+ __wbg___wbindgen_is_undefined_8865fb403f8fe9d8: function(arg0) {
1010
+ const ret = arg0 === undefined;
1011
+ return ret;
1012
+ },
1013
+ __wbg___wbindgen_number_get_2e0e7dee9f701a71: function(arg0, arg1) {
1014
+ const obj = arg1;
1015
+ const ret = typeof(obj) === 'number' ? obj : undefined;
1016
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1017
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1018
+ },
1019
+ __wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
1020
+ throw new Error(getStringFromWasm0(arg0, arg1));
1021
+ },
1022
+ __wbg_call_187d372bd5fdd4aa: function() { return handleError(function (arg0, arg1, arg2) {
1023
+ const ret = arg0.call(arg1, arg2);
1024
+ return ret;
1025
+ }, arguments); },
1026
+ __wbg_call_6137034ef55c9d0f: function() { return handleError(function (arg0, arg1) {
1027
+ const ret = arg0.call(arg1);
1028
+ return ret;
1029
+ }, arguments); },
1030
+ __wbg_crypto_38df2bab126b63dc: function(arg0) {
1031
+ const ret = arg0.crypto;
1032
+ return ret;
1033
+ },
1034
+ __wbg_getDate_1181c785ea4fdd21: function(arg0) {
1035
+ const ret = arg0.getDate();
1036
+ return ret;
1037
+ },
1038
+ __wbg_getDay_a7e78a6fb31f7a75: function(arg0) {
1039
+ const ret = arg0.getDay();
1040
+ return ret;
1041
+ },
1042
+ __wbg_getFullYear_32050b2c56c56cd8: function(arg0) {
1043
+ const ret = arg0.getFullYear();
1044
+ return ret;
1045
+ },
1046
+ __wbg_getHours_f57dcda3efee150c: function(arg0) {
1047
+ const ret = arg0.getHours();
1048
+ return ret;
1049
+ },
1050
+ __wbg_getMinutes_951e7f98fc4fdb30: function(arg0) {
1051
+ const ret = arg0.getMinutes();
1052
+ return ret;
1053
+ },
1054
+ __wbg_getMonth_aae5f530fd173536: function(arg0) {
1055
+ const ret = arg0.getMonth();
1056
+ return ret;
1057
+ },
1058
+ __wbg_getRandomValues_896855b3a5f89999: function() { return handleError(function (arg0, arg1) {
1059
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1060
+ }, arguments); },
1061
+ __wbg_getRandomValues_973dabfb0ad1769f: function() { return handleError(function (arg0, arg1) {
1062
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1063
+ }, arguments); },
1064
+ __wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
1065
+ arg0.getRandomValues(arg1);
1066
+ }, arguments); },
1067
+ __wbg_getSeconds_8ffcca0e220547af: function(arg0) {
1068
+ const ret = arg0.getSeconds();
1069
+ return ret;
1070
+ },
1071
+ __wbg_getTime_f5a55efff2585d5d: function(arg0) {
1072
+ const ret = arg0.getTime();
1073
+ return ret;
1074
+ },
1075
+ __wbg_getTimezoneOffset_2e851fdaecc2dc92: function(arg0) {
1076
+ const ret = arg0.getTimezoneOffset();
1077
+ return ret;
1078
+ },
1079
+ __wbg_get_31af05bd4842a84f: function() { return handleError(function (arg0, arg1) {
1080
+ const ret = Reflect.get(arg0, arg1);
1081
+ return ret;
1082
+ }, arguments); },
1083
+ __wbg_length_7f3c00c40364105e: function(arg0) {
1084
+ const ret = arg0.length;
1085
+ return ret;
1086
+ },
1087
+ __wbg_msCrypto_bd5a034af96bcba6: function(arg0) {
1088
+ const ret = arg0.msCrypto;
1089
+ return ret;
1090
+ },
1091
+ __wbg_new_0_72d020f0c63443d4: function() {
1092
+ const ret = new Date();
1093
+ return ret;
1094
+ },
1095
+ __wbg_new_34e56228080aa9f8: function(arg0) {
1096
+ const ret = new Date(arg0);
1097
+ return ret;
1098
+ },
1099
+ __wbg_new_with_length_3da0ad195f6f63ba: function(arg0) {
1100
+ const ret = new Uint8Array(arg0 >>> 0);
1101
+ return ret;
1102
+ },
1103
+ __wbg_new_with_year_month_day_0d952a48f939d06b: function(arg0, arg1, arg2) {
1104
+ const ret = new Date(arg0 >>> 0, arg1, arg2);
1105
+ return ret;
1106
+ },
1107
+ __wbg_node_84ea875411254db1: function(arg0) {
1108
+ const ret = arg0.node;
1109
+ return ret;
1110
+ },
1111
+ __wbg_now_08b1211f5e7581ea: function() {
1112
+ const ret = Date.now();
1113
+ return ret;
1114
+ },
1115
+ __wbg_now_aa4ccb83129e9e55: function() {
1116
+ const ret = Date.now();
1117
+ return ret;
1118
+ },
1119
+ __wbg_now_e1044392fce0f3e7: function() { return handleError(function () {
1120
+ const ret = Date.now();
1121
+ return ret;
1122
+ }, arguments); },
1123
+ __wbg_process_44c7a14e11e9f69e: function(arg0) {
1124
+ const ret = arg0.process;
1125
+ return ret;
1126
+ },
1127
+ __wbg_prototypesetcall_bc27214492979395: function(arg0, arg1, arg2) {
1128
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1129
+ },
1130
+ __wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {
1131
+ arg0.randomFillSync(arg1);
1132
+ }, arguments); },
1133
+ __wbg_random_5a4cafd2f02395ff: function() {
1134
+ const ret = Math.random();
1135
+ return ret;
1136
+ },
1137
+ __wbg_require_b4edbdcf3e2a1ef0: function() { return handleError(function () {
1138
+ const ret = module.require;
1139
+ return ret;
1140
+ }, arguments); },
1141
+ __wbg_static_accessor_GLOBAL_266715b9d96ba635: function() {
1142
+ const ret = typeof global === 'undefined' ? null : global;
1143
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1144
+ },
1145
+ __wbg_static_accessor_GLOBAL_THIS_10fb7dc1ae063179: function() {
1146
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1147
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1148
+ },
1149
+ __wbg_static_accessor_SELF_0b583911f537483a: function() {
1150
+ const ret = typeof self === 'undefined' ? null : self;
1151
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1152
+ },
1153
+ __wbg_static_accessor_WINDOW_d7f903d1508cbdc4: function() {
1154
+ const ret = typeof window === 'undefined' ? null : window;
1155
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1156
+ },
1157
+ __wbg_subarray_002b94d5e13d1411: function(arg0, arg1, arg2) {
1158
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1159
+ return ret;
1160
+ },
1161
+ __wbg_versions_276b2795b1c6a219: function(arg0) {
1162
+ const ret = arg0.versions;
1163
+ return ret;
1164
+ },
1165
+ __wbindgen_generic_0000000000000001: function(arg0) {
1166
+ // Cast intrinsic for `F64 -> Externref`.
1167
+ const ret = arg0;
1168
+ return ret;
1169
+ },
1170
+ __wbindgen_generic_0000000000000002: function(arg0, arg1) {
1171
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
1172
+ const ret = getArrayU8FromWasm0(arg0, arg1);
1173
+ return ret;
1174
+ },
1175
+ __wbindgen_generic_0000000000000003: function(arg0, arg1) {
1176
+ // Cast intrinsic for `Ref(String) -> Externref`.
1177
+ const ret = getStringFromWasm0(arg0, arg1);
1178
+ return ret;
1179
+ },
1180
+ __wbindgen_init_externref_table: function() {
1181
+ const table = wasm.__wbindgen_externrefs;
1182
+ const offset = table.grow(4);
1183
+ table.set(0, undefined);
1184
+ table.set(offset + 0, undefined);
1185
+ table.set(offset + 1, null);
1186
+ table.set(offset + 2, true);
1187
+ table.set(offset + 3, false);
1188
+ },
1189
+ };
1190
+ return {
1191
+ __proto__: null,
1192
+ "./kition_table_kit_bg.js": import0,
1193
+ };
1194
+ }
1195
+
1196
+ const TableDocumentFinalization = (typeof FinalizationRegistry === 'undefined')
1197
+ ? { register: () => {}, unregister: () => {} }
1198
+ : new FinalizationRegistry(ptr => wasm.__wbg_tabledocument_free(ptr, 1));
1199
+
1200
+ function addToExternrefTable0(obj) {
1201
+ const idx = wasm.__externref_table_alloc();
1202
+ wasm.__wbindgen_externrefs.set(idx, obj);
1203
+ return idx;
1204
+ }
1205
+
1206
+ function getArrayU8FromWasm0(ptr, len) {
1207
+ ptr = ptr >>> 0;
1208
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
1209
+ }
1210
+
1211
+ let cachedDataViewMemory0 = null;
1212
+ function getDataViewMemory0() {
1213
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
1214
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
1215
+ }
1216
+ return cachedDataViewMemory0;
1217
+ }
1218
+
1219
+ let cachedFloat64ArrayMemory0 = null;
1220
+ function getFloat64ArrayMemory0() {
1221
+ if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
1222
+ cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
1223
+ }
1224
+ return cachedFloat64ArrayMemory0;
1225
+ }
1226
+
1227
+ function getStringFromWasm0(ptr, len) {
1228
+ return decodeText(ptr >>> 0, len);
1229
+ }
1230
+
1231
+ let cachedUint32ArrayMemory0 = null;
1232
+ function getUint32ArrayMemory0() {
1233
+ if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
1234
+ cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
1235
+ }
1236
+ return cachedUint32ArrayMemory0;
1237
+ }
1238
+
1239
+ let cachedUint8ArrayMemory0 = null;
1240
+ function getUint8ArrayMemory0() {
1241
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
1242
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
1243
+ }
1244
+ return cachedUint8ArrayMemory0;
1245
+ }
1246
+
1247
+ function handleError(f, args) {
1248
+ try {
1249
+ return f.apply(this, args);
1250
+ } catch (e) {
1251
+ const idx = addToExternrefTable0(e);
1252
+ wasm.__wbindgen_exn_store(idx);
1253
+ }
1254
+ }
1255
+
1256
+ function isLikeNone(x) {
1257
+ return x === undefined || x === null;
1258
+ }
1259
+
1260
+ function passArray32ToWasm0(arg, malloc) {
1261
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
1262
+ getUint32ArrayMemory0().set(arg, ptr / 4);
1263
+ WASM_VECTOR_LEN = arg.length;
1264
+ return ptr;
1265
+ }
1266
+
1267
+ function passArray8ToWasm0(arg, malloc) {
1268
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
1269
+ getUint8ArrayMemory0().set(arg, ptr / 1);
1270
+ WASM_VECTOR_LEN = arg.length;
1271
+ return ptr;
1272
+ }
1273
+
1274
+ function passArrayF64ToWasm0(arg, malloc) {
1275
+ const ptr = malloc(arg.length * 8, 8) >>> 0;
1276
+ getFloat64ArrayMemory0().set(arg, ptr / 8);
1277
+ WASM_VECTOR_LEN = arg.length;
1278
+ return ptr;
1279
+ }
1280
+
1281
+ function passStringToWasm0(arg, malloc, realloc) {
1282
+ if (realloc === undefined) {
1283
+ const buf = cachedTextEncoder.encode(arg);
1284
+ const ptr = malloc(buf.length, 1) >>> 0;
1285
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
1286
+ WASM_VECTOR_LEN = buf.length;
1287
+ return ptr;
1288
+ }
1289
+
1290
+ let len = arg.length;
1291
+ let ptr = malloc(len, 1) >>> 0;
1292
+
1293
+ const mem = getUint8ArrayMemory0();
1294
+
1295
+ let offset = 0;
1296
+
1297
+ for (; offset < len; offset++) {
1298
+ const code = arg.charCodeAt(offset);
1299
+ if (code > 0x7F) break;
1300
+ mem[ptr + offset] = code;
1301
+ }
1302
+ if (offset !== len) {
1303
+ if (offset !== 0) {
1304
+ arg = arg.slice(offset);
1305
+ }
1306
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
1307
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
1308
+ const ret = cachedTextEncoder.encodeInto(arg, view);
1309
+
1310
+ offset += ret.written;
1311
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
1312
+ }
1313
+
1314
+ WASM_VECTOR_LEN = offset;
1315
+ return ptr;
1316
+ }
1317
+
1318
+ function takeFromExternrefTable0(idx) {
1319
+ const value = wasm.__wbindgen_externrefs.get(idx);
1320
+ wasm.__externref_table_dealloc(idx);
1321
+ return value;
1322
+ }
1323
+
1324
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1325
+ cachedTextDecoder.decode();
1326
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
1327
+ let numBytesDecoded = 0;
1328
+ function decodeText(ptr, len) {
1329
+ numBytesDecoded += len;
1330
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
1331
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1332
+ cachedTextDecoder.decode();
1333
+ numBytesDecoded = len;
1334
+ }
1335
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
1336
+ }
1337
+
1338
+ const cachedTextEncoder = new TextEncoder();
1339
+
1340
+ if (!('encodeInto' in cachedTextEncoder)) {
1341
+ cachedTextEncoder.encodeInto = function (arg, view) {
1342
+ const buf = cachedTextEncoder.encode(arg);
1343
+ view.set(buf);
1344
+ return {
1345
+ read: arg.length,
1346
+ written: buf.length
1347
+ };
1348
+ };
1349
+ }
1350
+
1351
+ let WASM_VECTOR_LEN = 0;
1352
+
1353
+ let wasmModule, wasmInstance, wasm;
1354
+ function __wbg_finalize_init(instance, module) {
1355
+ wasmInstance = instance;
1356
+ wasm = instance.exports;
1357
+ wasmModule = module;
1358
+ cachedDataViewMemory0 = null;
1359
+ cachedFloat64ArrayMemory0 = null;
1360
+ cachedUint32ArrayMemory0 = null;
1361
+ cachedUint8ArrayMemory0 = null;
1362
+ wasm.__wbindgen_start();
1363
+ return wasm;
1364
+ }
1365
+
1366
+ async function __wbg_load(module, imports) {
1367
+ if (typeof Response === 'function' && module instanceof Response) {
1368
+ if (!module.ok) {
1369
+ throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
1370
+ }
1371
+
1372
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
1373
+ try {
1374
+ return await WebAssembly.instantiateStreaming(module, imports);
1375
+ } catch (e) {
1376
+ const validResponse = expectedResponseType(module.type);
1377
+
1378
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
1379
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
1380
+
1381
+ } else { throw e; }
1382
+ }
1383
+ }
1384
+
1385
+ const bytes = await module.arrayBuffer();
1386
+ return await WebAssembly.instantiate(bytes, imports);
1387
+ } else {
1388
+ const instance = await WebAssembly.instantiate(module, imports);
1389
+
1390
+ if (instance instanceof WebAssembly.Instance) {
1391
+ return { instance, module };
1392
+ } else {
1393
+ return instance;
1394
+ }
1395
+ }
1396
+
1397
+ function expectedResponseType(type) {
1398
+ switch (type) {
1399
+ case 'basic': case 'cors': case 'default': return true;
1400
+ }
1401
+ return false;
1402
+ }
1403
+ }
1404
+
1405
+ function initSync(module) {
1406
+ if (wasm !== undefined) return wasm;
1407
+
1408
+
1409
+ if (module !== undefined) {
1410
+ if (Object.getPrototypeOf(module) === Object.prototype) {
1411
+ ({module} = module)
1412
+ } else {
1413
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1414
+ }
1415
+ }
1416
+
1417
+ const imports = __wbg_get_imports();
1418
+ if (!(module instanceof WebAssembly.Module)) {
1419
+ module = new WebAssembly.Module(module);
1420
+ }
1421
+ const instance = new WebAssembly.Instance(module, imports);
1422
+ return __wbg_finalize_init(instance, module);
1423
+ }
1424
+
1425
+ async function __wbg_init(module_or_path) {
1426
+ if (wasm !== undefined) return wasm;
1427
+
1428
+
1429
+ if (module_or_path !== undefined) {
1430
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1431
+ ({module_or_path} = module_or_path)
1432
+ } else {
1433
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1434
+ }
1435
+ }
1436
+
1437
+ if (module_or_path === undefined) {
1438
+ module_or_path = new URL('kition_table_kit_bg.wasm', import.meta.url);
1439
+ }
1440
+ const imports = __wbg_get_imports();
1441
+
1442
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1443
+ module_or_path = fetch(module_or_path);
1444
+ }
1445
+
1446
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
1447
+
1448
+ return __wbg_finalize_init(instance, module);
1449
+ }
1450
+
1451
+ export { initSync, __wbg_init as default };