annotation-kit 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 (121) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +75 -0
  3. package/README.md +114 -2
  4. package/README.zh-CN.md +112 -0
  5. package/dist/annotation-kit.css +157 -0
  6. package/dist/chunks/references-ukB-tSle.js +1126 -0
  7. package/dist/chunks/references-ukB-tSle.js.map +1 -0
  8. package/dist/electron/element-context.cjs +72 -0
  9. package/dist/electron/guest-preload.cjs +327 -0
  10. package/dist/electron.js +394 -0
  11. package/dist/electron.js.map +1 -0
  12. package/dist/index.js +910 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/react.js +2282 -0
  15. package/dist/react.js.map +1 -0
  16. package/dist/styles.d.ts +2 -0
  17. package/dist/types/address.d.ts +53 -0
  18. package/dist/types/address.d.ts.map +1 -0
  19. package/dist/types/client/Workbench.d.ts +11 -0
  20. package/dist/types/client/Workbench.d.ts.map +1 -0
  21. package/dist/types/client/composer/PacketPreview.d.ts +12 -0
  22. package/dist/types/client/composer/PacketPreview.d.ts.map +1 -0
  23. package/dist/types/client/composer/ReferenceCard.d.ts +12 -0
  24. package/dist/types/client/composer/ReferenceCard.d.ts.map +1 -0
  25. package/dist/types/client/composer/attachments.d.ts +10 -0
  26. package/dist/types/client/composer/attachments.d.ts.map +1 -0
  27. package/dist/types/client/composer/commit.d.ts +4 -0
  28. package/dist/types/client/composer/commit.d.ts.map +1 -0
  29. package/dist/types/client/composer/packets.d.ts +53 -0
  30. package/dist/types/client/composer/packets.d.ts.map +1 -0
  31. package/dist/types/client/composer/reference-presentation.d.ts +4 -0
  32. package/dist/types/client/composer/reference-presentation.d.ts.map +1 -0
  33. package/dist/types/client/error-copy.d.ts +69 -0
  34. package/dist/types/client/error-copy.d.ts.map +1 -0
  35. package/dist/types/client/errors.d.ts +10 -0
  36. package/dist/types/client/errors.d.ts.map +1 -0
  37. package/dist/types/client/files/FileSelectionAction.d.ts +7 -0
  38. package/dist/types/client/files/FileSelectionAction.d.ts.map +1 -0
  39. package/dist/types/client/files/SelectionCard.d.ts +14 -0
  40. package/dist/types/client/files/SelectionCard.d.ts.map +1 -0
  41. package/dist/types/client/files/document-workflow.d.ts +34 -0
  42. package/dist/types/client/files/document-workflow.d.ts.map +1 -0
  43. package/dist/types/client/files/pages/DocumentChrome.d.ts +30 -0
  44. package/dist/types/client/files/pages/DocumentChrome.d.ts.map +1 -0
  45. package/dist/types/client/files/pages/PageSelectionAction.d.ts +7 -0
  46. package/dist/types/client/files/pages/PageSelectionAction.d.ts.map +1 -0
  47. package/dist/types/client/files/pages/batches.d.ts +21 -0
  48. package/dist/types/client/files/pages/batches.d.ts.map +1 -0
  49. package/dist/types/client/files/pages/geometry.d.ts +16 -0
  50. package/dist/types/client/files/pages/geometry.d.ts.map +1 -0
  51. package/dist/types/client/files/pages/image-store.d.ts +8 -0
  52. package/dist/types/client/files/pages/image-store.d.ts.map +1 -0
  53. package/dist/types/client/files/pages/images.d.ts +41 -0
  54. package/dist/types/client/files/pages/images.d.ts.map +1 -0
  55. package/dist/types/client/files/pages/interaction.d.ts +55 -0
  56. package/dist/types/client/files/pages/interaction.d.ts.map +1 -0
  57. package/dist/types/client/files/pages/selection.d.ts +25 -0
  58. package/dist/types/client/files/pages/selection.d.ts.map +1 -0
  59. package/dist/types/client/files/pages/snapshot.d.ts +31 -0
  60. package/dist/types/client/files/pages/snapshot.d.ts.map +1 -0
  61. package/dist/types/client/files/references.d.ts +80 -0
  62. package/dist/types/client/files/references.d.ts.map +1 -0
  63. package/dist/types/client/files/selection.d.ts +11 -0
  64. package/dist/types/client/files/selection.d.ts.map +1 -0
  65. package/dist/types/client/files/sheets/SheetRecovery.d.ts +12 -0
  66. package/dist/types/client/files/sheets/SheetRecovery.d.ts.map +1 -0
  67. package/dist/types/client/files/sheets/SheetSurface.d.ts +27 -0
  68. package/dist/types/client/files/sheets/SheetSurface.d.ts.map +1 -0
  69. package/dist/types/client/files/sheets/geometry.d.ts +30 -0
  70. package/dist/types/client/files/sheets/geometry.d.ts.map +1 -0
  71. package/dist/types/client/files/sheets/navigation.d.ts +4 -0
  72. package/dist/types/client/files/sheets/navigation.d.ts.map +1 -0
  73. package/dist/types/client/files/sheets/snapshot.d.ts +45 -0
  74. package/dist/types/client/files/sheets/snapshot.d.ts.map +1 -0
  75. package/dist/types/client/locales.d.ts +148 -0
  76. package/dist/types/client/locales.d.ts.map +1 -0
  77. package/dist/types/client/messages/SentAnnotations.d.ts +18 -0
  78. package/dist/types/client/messages/SentAnnotations.d.ts.map +1 -0
  79. package/dist/types/client/messages/presentation.d.ts +39 -0
  80. package/dist/types/client/messages/presentation.d.ts.map +1 -0
  81. package/dist/types/client/model.d.ts +68 -0
  82. package/dist/types/client/model.d.ts.map +1 -0
  83. package/dist/types/client/quoted-context.d.ts +3 -0
  84. package/dist/types/client/quoted-context.d.ts.map +1 -0
  85. package/dist/types/client/responses/ResponseCard.d.ts +12 -0
  86. package/dist/types/client/responses/ResponseCard.d.ts.map +1 -0
  87. package/dist/types/client/responses/ResponseOverlay.d.ts +7 -0
  88. package/dist/types/client/responses/ResponseOverlay.d.ts.map +1 -0
  89. package/dist/types/client/responses/composer.d.ts +11 -0
  90. package/dist/types/client/responses/composer.d.ts.map +1 -0
  91. package/dist/types/client/responses/controller.d.ts +39 -0
  92. package/dist/types/client/responses/controller.d.ts.map +1 -0
  93. package/dist/types/client/responses/references.d.ts +62 -0
  94. package/dist/types/client/responses/references.d.ts.map +1 -0
  95. package/dist/types/client/responses/selection.d.ts +43 -0
  96. package/dist/types/client/responses/selection.d.ts.map +1 -0
  97. package/dist/types/electron/bridge.d.mts +45 -0
  98. package/dist/types/electron/bridge.d.mts.map +1 -0
  99. package/dist/types/electron/build-preload.d.mts +4 -0
  100. package/dist/types/electron/build-preload.d.mts.map +1 -0
  101. package/dist/types/electron/element-context.d.cts +7 -0
  102. package/dist/types/electron/element-context.d.cts.map +1 -0
  103. package/dist/types/electron/guest-preload.d.cts +2 -0
  104. package/dist/types/electron/guest-preload.d.cts.map +1 -0
  105. package/dist/types/electron/index.d.ts +5 -0
  106. package/dist/types/electron/index.d.ts.map +1 -0
  107. package/dist/types/host-contracts.d.ts +104 -0
  108. package/dist/types/host-contracts.d.ts.map +1 -0
  109. package/dist/types/index.d.ts +32 -0
  110. package/dist/types/index.d.ts.map +1 -0
  111. package/dist/types/react.d.ts +14 -0
  112. package/dist/types/react.d.ts.map +1 -0
  113. package/dist/types/shared/desktop.d.ts +75 -0
  114. package/dist/types/shared/desktop.d.ts.map +1 -0
  115. package/dist/types/shared/surface.d.ts +11 -0
  116. package/dist/types/shared/surface.d.ts.map +1 -0
  117. package/dist/types/ui/icons.d.ts +11 -0
  118. package/dist/types/ui/icons.d.ts.map +1 -0
  119. package/dist/types/ui/regions.d.ts +28 -0
  120. package/dist/types/ui/regions.d.ts.map +1 -0
  121. package/package.json +83 -3
package/dist/index.js ADDED
@@ -0,0 +1,910 @@
1
+ import { e as errorEn, a as errorZh, A as AnnotationError, b as annotationFailure, p as pageImageStore, s as selectedFiles, i as imageDrafts } from "./chunks/references-ukB-tSle.js";
2
+ import { c, d, f, D, F, M, P, g, R, h, j, k, l, m, n, o, q, r, t, u, v, w, x, y, z, B, C, E, G, H, I, J, K, L, N, O, Q, S, T, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9 } from "./chunks/references-ukB-tSle.js";
3
+ const documentEn = {
4
+ "page.request": "Request edits",
5
+ "page.ask": "Ask for change",
6
+ "page.placeholder": "Describe a change or ask a question",
7
+ "page.pick": "Select content and ask for changes",
8
+ "page.comment": "Comment",
9
+ "page.edit": "Edit annotation",
10
+ "page.delete": "Delete annotation",
11
+ "page.one": "annotation",
12
+ "page.many": "annotations",
13
+ "page.cancel": "Cancel",
14
+ "page.save": "Save",
15
+ "page.send": "Send",
16
+ "page.sending": "Sending…",
17
+ "page.senderUnavailable": "Document annotations cannot be sent in this session.",
18
+ "page.changes": "Describe your changes…",
19
+ "page.submit": "Submit requested changes"
20
+ };
21
+ const zh = {
22
+ ...errorZh,
23
+ "response.title": "回复批注",
24
+ "response.add": "添加到会话",
25
+ "response.placeholder": "添加可选评论…",
26
+ "response.selected": "所选文字",
27
+ "response.source": "查看原回复",
28
+ "response.edit": "编辑批注",
29
+ "response.location": "助手回复",
30
+ "response.save": "保存评论",
31
+ "sheet.unavailable": "来源文件暂不可用。以下选区保留了保存时的内容,仍可查看或发送。",
32
+ "sheet.cell": "单元格",
33
+ "sheet.value": "保存时的值",
34
+ "sheet.formula": "公式",
35
+ "sheet.raw": "原始值",
36
+ "sheet.empty": "空值",
37
+ "page.request": "请求修改",
38
+ "page.ask": "提出修改",
39
+ "page.placeholder": "描述修改或提出问题",
40
+ "page.pick": "选择内容并提出修改",
41
+ "page.comment": "添加批注",
42
+ "page.edit": "编辑批注",
43
+ "page.delete": "删除批注",
44
+ "page.one": "条批注",
45
+ "page.many": "条批注",
46
+ "page.cancel": "取消",
47
+ "page.save": "保存",
48
+ "page.send": "发送",
49
+ "page.sending": "正在发送…",
50
+ "page.changes": "描述你希望的修改…",
51
+ "page.submit": "提交修改请求",
52
+ "page.senderUnavailable": "当前会话不支持发送文档批注。",
53
+ "page.region": "框选区域",
54
+ "page.regionHint": "在页面上拖动,选择要加入聊天的区域",
55
+ "page.restoring": "正在恢复区域图片…",
56
+ "page.imageMissing": "区域图片不可用",
57
+ "page.officePage": "页码对应当前文档预览",
58
+ "file.one": "个选区",
59
+ "file.many": "个选区",
60
+ "file.selections": "所选文本",
61
+ "file.remove": "移除选区",
62
+ "file.removeAll": "移除全部选区",
63
+ "file.openSource": "打开来源文件",
64
+ "file.openFailed": "无法打开来源文件,已保存的选区仍可查看。",
65
+ "file.sourceBlock": "所示行号为来源段落范围",
66
+ "file.snapshot": "保留添加时的内容",
67
+ "message.expand": "展开",
68
+ "message.collapse": "收起",
69
+ "message.evidence": "查看发送给模型的完整上下文",
70
+ adjust: "调整选区",
71
+ cancel: "取消",
72
+ placeholder: "添加评论…",
73
+ annotating: "批注中",
74
+ send: "发送",
75
+ "packet.one": "条批注",
76
+ "packet.many": "条批注",
77
+ "packet.edit": "编辑批注",
78
+ "packet.removeAll": "移除全部批注",
79
+ annotate: "批注",
80
+ element: "选择元素",
81
+ region: "选择区域",
82
+ close: "结束批注",
83
+ pick: "点击元素或拖出区域以添加评论。",
84
+ comment: "评论",
85
+ save: "保存",
86
+ saving: "正在截图…",
87
+ add: "加入聊天",
88
+ adding: "正在添加…",
89
+ delete: "删除",
90
+ noSession: "请先打开一个会话。",
91
+ empty: "尚未保存批注。",
92
+ saved: "已保存批注",
93
+ screenshot: "保存时自动截取页面。",
94
+ selection: "已选择目标",
95
+ "packet.title": "网页批注",
96
+ "packet.screenshot": "批注截图",
97
+ "packet.done": "完成",
98
+ "packet.remove": "移除批注",
99
+ "file.add": "加入聊天",
100
+ "file.adding": "正在添加…",
101
+ "file.addTitle": "把所选内容加入当前会话",
102
+ "file.openSession": "请先打开会话",
103
+ "file.addFailed": "添加选区失败"
104
+ };
105
+ const en = {
106
+ ...errorEn,
107
+ "response.title": "Response annotations",
108
+ "response.add": "Add to chat",
109
+ "response.placeholder": "Add an optional comment…",
110
+ "response.selected": "Selected text",
111
+ "response.source": "View original response",
112
+ "response.edit": "Edit annotation",
113
+ "response.location": "Assistant response",
114
+ "response.save": "Save comment",
115
+ "sheet.unavailable": "The source is unavailable. These saved selections can still be reviewed or sent.",
116
+ "sheet.cell": "Cell",
117
+ "sheet.value": "Saved value",
118
+ "sheet.formula": "Formula",
119
+ "sheet.raw": "Raw value",
120
+ "sheet.empty": "Empty",
121
+ ...documentEn,
122
+ "page.region": "Select region",
123
+ "page.regionHint": "Drag on a page to select a region for chat",
124
+ "page.restoring": "Restoring region image…",
125
+ "page.imageMissing": "Region image unavailable",
126
+ "page.officePage": "Page numbers refer to the document preview",
127
+ "file.one": "selection",
128
+ "file.many": "selections",
129
+ "file.selections": "Selected text",
130
+ "file.remove": "Remove selection",
131
+ "file.removeAll": "Remove all selections",
132
+ "file.openSource": "Open source file",
133
+ "file.openFailed": "Could not open the source. The saved selection is still available.",
134
+ "file.sourceBlock": "Lines refer to the source block",
135
+ "file.snapshot": "Content saved when added",
136
+ "message.expand": "Expand",
137
+ "message.collapse": "Collapse",
138
+ "message.evidence": "View full context sent to the model",
139
+ adjust: "Adjust",
140
+ cancel: "Cancel",
141
+ placeholder: "Add a comment…",
142
+ annotating: "Annotating",
143
+ send: "Send",
144
+ "packet.one": "annotation",
145
+ "packet.many": "annotations",
146
+ "packet.edit": "Edit annotation",
147
+ "packet.removeAll": "Remove all annotations",
148
+ annotate: "Annotate",
149
+ element: "Select element",
150
+ region: "Select region",
151
+ close: "End annotations",
152
+ pick: "Click an element or drag a region to add a comment.",
153
+ comment: "Comment",
154
+ save: "Save",
155
+ saving: "Capturing…",
156
+ add: "Add to chat",
157
+ adding: "Adding…",
158
+ delete: "Delete",
159
+ noSession: "Open a conversation first.",
160
+ empty: "No saved annotations.",
161
+ saved: "Saved annotations",
162
+ screenshot: "Saving captures the page automatically.",
163
+ selection: "Target selected",
164
+ "packet.title": "Browser comments",
165
+ "packet.screenshot": "Annotation screenshot",
166
+ "packet.done": "Done",
167
+ "packet.remove": "Remove comments",
168
+ "file.add": "Add to chat",
169
+ "file.adding": "Adding…",
170
+ "file.addTitle": "Add the selection to the current conversation",
171
+ "file.openSession": "Open a conversation first",
172
+ "file.addFailed": "Could not add the selection"
173
+ };
174
+ const emptyState = { drafts: {} };
175
+ class AnnotationsModel {
176
+ constructor(desktop, composer, leaseOf = (surface) => {
177
+ const viewport = document.getElementById(surface.viewportId);
178
+ return viewport?.querySelector("webview")?.getAttribute("name") ?? void 0;
179
+ }) {
180
+ this.desktop = desktop;
181
+ this.composer = composer;
182
+ this.leaseOf = leaseOf;
183
+ this.unsubscribe = desktop?.subscribe((event) => this.receive(event)) ?? (() => {
184
+ });
185
+ }
186
+ state = emptyState;
187
+ listeners = /* @__PURE__ */ new Set();
188
+ surfaces = /* @__PURE__ */ new Map();
189
+ operations = /* @__PURE__ */ new Map();
190
+ alive = true;
191
+ nextId = 1;
192
+ visibleMarkers = /* @__PURE__ */ new Set();
193
+ pending = /* @__PURE__ */ new Map();
194
+ unsubscribe;
195
+ getSnapshot = () => this.state;
196
+ subscribe = (listener) => {
197
+ this.listeners.add(listener);
198
+ return () => {
199
+ this.listeners.delete(listener);
200
+ };
201
+ };
202
+ refresh = () => {
203
+ for (const [id, draft] of Object.entries(this.state.drafts)) {
204
+ if (draft.selection && draft.target !== this.composer.targetKey()) {
205
+ this.nextOperation(id);
206
+ this.update(id, { ...draft, selection: void 0, saving: false, comment: "", error: void 0 });
207
+ }
208
+ }
209
+ this.publish({ ...this.state });
210
+ };
211
+ available(surface) {
212
+ return this.alive && this.desktop?.protocolVersion === 1 && surface.enabled && !surface.signal?.aborted;
213
+ }
214
+ hasTarget() {
215
+ return this.composer.hasTarget();
216
+ }
217
+ controls() {
218
+ return this.composer.annotationControls?.();
219
+ }
220
+ markerVisible(id) {
221
+ return this.visibleMarkers.has(id);
222
+ }
223
+ edit = (entry, commit) => {
224
+ const surface = entry.surfaceId ? this.surfaces.get(entry.surfaceId) : void 0;
225
+ if (!surface || !this.available(surface) || surface.url !== entry.selection.url || !this.visibleMarkers.has(entry.id)) return false;
226
+ const draft = this.state.drafts[surface.id];
227
+ if (!draft?.active) return false;
228
+ this.update(surface.id, {
229
+ ...draft,
230
+ selection: entry.selection,
231
+ comment: entry.comment,
232
+ target: this.composer.targetKey(),
233
+ editing: { entry, commit },
234
+ error: void 0
235
+ });
236
+ return true;
237
+ };
238
+ async toggle(surface) {
239
+ const draft = this.state.drafts[surface.id];
240
+ if (draft?.active) {
241
+ this.nextOperation(surface.id);
242
+ this.update(surface.id, { ...draft, active: false, selection: void 0, saving: false, comment: "" });
243
+ await this.desktop?.setMode(draft.lease, "off").catch(() => {
244
+ });
245
+ return;
246
+ }
247
+ if (!this.available(surface)) return;
248
+ const lease = this.leaseOf(surface);
249
+ const operation = this.nextOperation(surface.id);
250
+ this.surfaces.set(surface.id, surface);
251
+ const starting = {
252
+ active: true,
253
+ mode: "element",
254
+ lease: lease ?? "",
255
+ epoch: "",
256
+ comment: draft?.comment ?? "",
257
+ saving: false
258
+ };
259
+ this.update(surface.id, starting);
260
+ if (!lease) {
261
+ this.update(surface.id, { ...starting, error: new AnnotationError("error.browserNotReady") });
262
+ return;
263
+ }
264
+ try {
265
+ const response = await this.desktop.setMode(lease, "element");
266
+ const latest = this.currentOperation(surface, operation, lease);
267
+ if (latest) this.update(surface.id, { ...latest, epoch: response.documentEpoch, error: void 0 });
268
+ } catch (error) {
269
+ const latest = this.currentOperation(surface, operation, lease);
270
+ if (latest) this.update(surface.id, { ...latest, error: annotationFailure(error) });
271
+ }
272
+ }
273
+ async setMode(surface, mode) {
274
+ const current = this.state.drafts[surface.id];
275
+ if (!current?.active || current.saving || !this.available(surface)) return;
276
+ const operation = this.nextOperation(surface.id);
277
+ try {
278
+ const response = await this.desktop.setMode(current.lease, mode);
279
+ const latest = this.currentOperation(surface, operation, current.lease);
280
+ if (latest) this.update(surface.id, { ...latest, mode, epoch: response.documentEpoch, selection: void 0, error: void 0 });
281
+ } catch (error) {
282
+ const latest = this.currentOperation(surface, operation, current.lease);
283
+ if (latest) this.update(surface.id, { ...latest, error: annotationFailure(error) });
284
+ }
285
+ }
286
+ setComment(surfaceId, comment) {
287
+ const draft = this.state.drafts[surfaceId];
288
+ if (draft) this.update(surfaceId, { ...draft, comment });
289
+ }
290
+ cancel(surfaceId) {
291
+ const draft = this.state.drafts[surfaceId];
292
+ if (!draft) return;
293
+ this.nextOperation(surfaceId);
294
+ this.update(surfaceId, { ...draft, selection: void 0, comment: "", saving: false, editing: void 0, error: void 0 });
295
+ void this.desktop?.setMode(draft.lease, draft.mode).catch(() => {
296
+ });
297
+ }
298
+ async save(surface) {
299
+ const draft = this.state.drafts[surface.id];
300
+ if (!draft?.selection || !draft.epoch || draft.saving || !draft.comment.trim() || !this.available(surface)) return;
301
+ const operation = this.operations.get(surface.id);
302
+ if (!draft.target || draft.target !== this.composer.targetKey()) {
303
+ this.update(surface.id, { ...draft, error: new AnnotationError("error.originalSession") });
304
+ return;
305
+ }
306
+ if (draft.editing) {
307
+ draft.editing.commit(draft.comment);
308
+ this.cancel(surface.id);
309
+ return;
310
+ }
311
+ const controller = new AbortController();
312
+ this.pending.set(surface.id, controller);
313
+ const id = this.nextId++;
314
+ const pending = { ...draft, saving: true, error: void 0 };
315
+ this.update(surface.id, pending);
316
+ try {
317
+ const captured = await this.desktop.capture(draft.lease, draft.epoch, draft.selection, id);
318
+ const latest = operation === void 0 ? void 0 : this.currentOperation(surface, operation, draft.lease);
319
+ if (!latest?.saving || latest.epoch !== draft.epoch) return;
320
+ const image = new File([new Uint8Array(captured.png)], `annotation-${crypto.randomUUID()}-${id}.png`, { type: "image/png" });
321
+ const entry = { id, source: surface.source, surfaceId: surface.id, selection: draft.selection, comment: draft.comment, image };
322
+ await this.composer.add({
323
+ text: "",
324
+ annotations: [entry],
325
+ images: [image],
326
+ expectedTarget: draft.target,
327
+ signal: controller.signal,
328
+ focus: false
329
+ });
330
+ if (controller.signal.aborted || !this.currentOperation(surface, operation, draft.lease)) return;
331
+ this.visibleMarkers.add(id);
332
+ this.update(surface.id, { ...latest, saving: false, selection: void 0, comment: "" });
333
+ void this.desktop?.setMode(draft.lease, draft.mode).catch(() => {
334
+ });
335
+ } catch (error) {
336
+ const latest = operation === void 0 ? void 0 : this.currentOperation(surface, operation, draft.lease);
337
+ if (latest?.saving && latest.epoch === draft.epoch) this.update(surface.id, { ...latest, saving: false, error: annotationFailure(error) });
338
+ } finally {
339
+ if (this.pending.get(surface.id) === controller) this.pending.delete(surface.id);
340
+ }
341
+ }
342
+ dispose() {
343
+ this.alive = false;
344
+ for (const controller of this.pending.values()) controller.abort();
345
+ this.pending.clear();
346
+ this.unsubscribe();
347
+ for (const draft of Object.values(this.state.drafts)) {
348
+ if (draft.active && draft.lease) void this.desktop?.setMode(draft.lease, "off").catch(() => {
349
+ });
350
+ }
351
+ this.listeners.clear();
352
+ this.surfaces.clear();
353
+ this.operations.clear();
354
+ this.state = emptyState;
355
+ }
356
+ receive(event) {
357
+ if (!this.alive) return;
358
+ if (event.kind === "identity-cleared") {
359
+ const drafts = { ...this.state.drafts };
360
+ for (const [id, surface] of this.surfaces) if (surface.source === event.source) {
361
+ this.nextOperation(id);
362
+ delete drafts[id];
363
+ this.surfaces.delete(id);
364
+ }
365
+ this.publish({ ...this.state, drafts });
366
+ return;
367
+ }
368
+ for (const [id, draft] of Object.entries(this.state.drafts)) {
369
+ if (draft.lease !== event.lease) continue;
370
+ if (event.kind !== "selection") {
371
+ for (const entry of this.controls()?.entries ?? []) if (entry.surfaceId === id) this.visibleMarkers.delete(entry.id);
372
+ this.nextOperation(id);
373
+ this.update(id, {
374
+ ...draft,
375
+ active: event.kind === "selection-cleared" && draft.active,
376
+ selection: void 0,
377
+ saving: false,
378
+ editing: void 0,
379
+ epoch: event.documentEpoch
380
+ });
381
+ } else if (draft.active && !draft.saving && draft.epoch === event.documentEpoch) {
382
+ this.update(id, { ...draft, selection: event.selection, target: this.composer.targetKey(), comment: "", editing: void 0, error: void 0 });
383
+ }
384
+ }
385
+ }
386
+ update(id, draft) {
387
+ this.publish({ ...this.state, drafts: { ...this.state.drafts, [id]: draft } });
388
+ }
389
+ nextOperation(id) {
390
+ this.pending.get(id)?.abort();
391
+ this.pending.delete(id);
392
+ const next = (this.operations.get(id) ?? 0) + 1;
393
+ this.operations.set(id, next);
394
+ return next;
395
+ }
396
+ currentOperation(surface, operation, lease) {
397
+ const draft = this.state.drafts[surface.id];
398
+ return this.alive && !surface.signal?.aborted && this.operations.get(surface.id) === operation && draft?.active && draft.lease === lease ? draft : void 0;
399
+ }
400
+ publish(state) {
401
+ if (!this.alive) return;
402
+ this.state = state;
403
+ for (const listener of this.listeners) listener();
404
+ }
405
+ }
406
+ function commitToComposer(actions, text, ids, current, release, insert) {
407
+ let attached = false;
408
+ try {
409
+ if (!current()) throw new AnnotationError("error.sessionChangedAdd");
410
+ if (ids.length > 0 && !actions.addAttachments(ids)) throw new AnnotationError("error.composerImages");
411
+ attached = ids.length > 0;
412
+ if (!current()) throw new AnnotationError("error.sessionChangedAdd");
413
+ const span = actions.captureInsertion();
414
+ if (!current()) throw new AnnotationError("error.sessionChangedAdd");
415
+ if (!(insert ? insert(span) : actions.insertText(text, span))) throw new AnnotationError("error.draftChanged");
416
+ } catch (error) {
417
+ if (attached) for (const id of ids) actions.removeAttachment(id);
418
+ for (const id of ids) release(id);
419
+ throw error;
420
+ }
421
+ }
422
+ function bindReferencePresentation(card, input, owns) {
423
+ const nodes = /* @__PURE__ */ new Set();
424
+ const editors = /* @__PURE__ */ new Set();
425
+ const sync = () => {
426
+ const indexes = /* @__PURE__ */ new Map();
427
+ for (const node of card.querySelectorAll("[data-composer-chip]")) {
428
+ const source = node.dataset.composerChip;
429
+ const index = indexes.get(source) ?? 0;
430
+ indexes.set(source, index + 1);
431
+ const ref = input.occurrences.filter((item) => item.source === source)[index];
432
+ const owned = !!ref && owns(source, ref.ref);
433
+ if (owned || nodes.has(node)) node.toggleAttribute("data-aione-annotation-owned", owned);
434
+ if (owned) nodes.add(node);
435
+ }
436
+ const refs = input.occurrences.filter((item) => owns(item.source, item.ref));
437
+ let visibleText = input.draft;
438
+ for (const ref of [...refs].reverse()) visibleText = visibleText.slice(0, ref.offset) + visibleText.slice(ref.offset + ref.length);
439
+ const editor = card.querySelector('[contenteditable="true"]');
440
+ if (editor) {
441
+ editors.add(editor);
442
+ editor.toggleAttribute("data-aione-annotation-only", refs.length > 0 && !visibleText.trim());
443
+ }
444
+ };
445
+ sync();
446
+ const observer = new MutationObserver(sync);
447
+ observer.observe(card, { childList: true, subtree: true });
448
+ return () => {
449
+ observer.disconnect();
450
+ nodes.forEach((node) => node.removeAttribute("data-aione-annotation-owned"));
451
+ editors.forEach((editor) => editor.removeAttribute("data-aione-annotation-only"));
452
+ };
453
+ }
454
+ class PageImages {
455
+ constructor(store = pageImageStore()) {
456
+ this.store = store;
457
+ }
458
+ entries = /* @__PURE__ */ new Map();
459
+ listeners = /* @__PURE__ */ new Set();
460
+ revision = 0;
461
+ disposed = false;
462
+ subscribe = (listener) => {
463
+ this.listeners.add(listener);
464
+ return () => {
465
+ this.listeners.delete(listener);
466
+ };
467
+ };
468
+ getSnapshot = () => this.revision;
469
+ changed() {
470
+ this.revision++;
471
+ for (const listener of this.listeners) listener();
472
+ }
473
+ preview(snapshot) {
474
+ return this.entries.get(snapshot.id);
475
+ }
476
+ async save(snapshot, file, signal) {
477
+ if (!snapshot.image || file.name !== snapshot.image.name || file.type !== "image/png") throw new AnnotationError("error.pageImageMismatch");
478
+ signal?.throwIfAborted();
479
+ await this.store.put(snapshot.id, file);
480
+ if (signal?.aborted || this.disposed) {
481
+ await this.store.remove(snapshot.id);
482
+ throw new AnnotationError("error.cancelled");
483
+ }
484
+ }
485
+ stage(session, snapshot, file, factory, ids) {
486
+ this.entries.set(snapshot.id, { session, snapshot, file, factory, ids, staged: true, url: URL.createObjectURL(file) });
487
+ }
488
+ activate(id) {
489
+ const entry = this.entries.get(id);
490
+ if (entry) entry.staged = false;
491
+ this.changed();
492
+ }
493
+ validate(snapshot) {
494
+ if (snapshot.version !== 2 || !snapshot.image) return;
495
+ const entry = this.entries.get(snapshot.id);
496
+ if (!entry?.file || entry.ids.length !== 1 || entry.factory.resolveDraftAttachments(entry.ids)[0]?.file !== entry.file) {
497
+ throw entry?.error ?? new AnnotationError("error.imageRestoring");
498
+ }
499
+ }
500
+ imageIdsFor(input) {
501
+ return new Set(input ? selectedFiles(input).flatMap(({ snapshot }) => this.entries.get(snapshot.id)?.ids ?? []) : []);
502
+ }
503
+ reconcile(session, input, actions, factory) {
504
+ if (this.disposed || input.phase !== "plain") return;
505
+ const active = new Map(selectedFiles(input).flatMap(({ snapshot }) => snapshot.version === 2 && snapshot.image ? [[snapshot.id, snapshot]] : []));
506
+ for (const [id, snapshot] of active) {
507
+ if (this.entries.has(id)) continue;
508
+ const entry = { session, snapshot, factory, ids: [], staged: false };
509
+ this.entries.set(id, entry);
510
+ void this.store.get(id, snapshot.image.name).then((file) => {
511
+ if (this.disposed || this.entries.get(id) !== entry) return;
512
+ if (!file) throw new AnnotationError("error.imageDraftLost");
513
+ entry.file = file;
514
+ entry.url = URL.createObjectURL(file);
515
+ this.changed();
516
+ }).catch((error) => {
517
+ if (this.disposed || this.entries.get(id) !== entry) return;
518
+ entry.error = error instanceof Error ? error : new AnnotationError("error.restoreImage");
519
+ this.changed();
520
+ });
521
+ }
522
+ for (const [id, entry] of this.entries) {
523
+ if (entry.session !== session || entry.staged) continue;
524
+ if (active.has(id)) {
525
+ if (entry.file && !entry.ids.length && !entry.error) {
526
+ entry.staged = true;
527
+ try {
528
+ const ids = imageDrafts(factory, session, [entry.file]);
529
+ entry.ids = ids;
530
+ if (!actions.addAttachments(ids)) throw new AnnotationError("error.restoreAttachmentRetry");
531
+ } catch (error) {
532
+ for (const imageId of entry.ids) factory.releaseDraftAttachment(imageId);
533
+ entry.ids = [];
534
+ entry.error = error instanceof Error ? error : new AnnotationError("error.restoreAttachment");
535
+ } finally {
536
+ entry.staged = false;
537
+ }
538
+ this.changed();
539
+ }
540
+ } else if (entry.ids.some((imageId) => input.attachmentIds.includes(imageId))) {
541
+ const ids = entry.ids;
542
+ entry.ids = [];
543
+ for (const imageId of ids) {
544
+ actions.removeAttachment(imageId);
545
+ factory.releaseDraftAttachment(imageId);
546
+ }
547
+ this.changed();
548
+ } else if (entry.ids.length && !factory.resolveDraftAttachments(entry.ids).length) {
549
+ this.discard(id);
550
+ void this.store.remove(id).catch(() => void 0);
551
+ }
552
+ }
553
+ }
554
+ discard(id) {
555
+ const entry = this.entries.get(id);
556
+ if (entry?.url) URL.revokeObjectURL(entry.url);
557
+ this.entries.delete(id);
558
+ this.changed();
559
+ }
560
+ async cancel(id) {
561
+ this.discard(id);
562
+ await this.store.remove(id);
563
+ }
564
+ dispose() {
565
+ this.disposed = true;
566
+ for (const entry of this.entries.values()) if (entry.url) URL.revokeObjectURL(entry.url);
567
+ this.entries.clear();
568
+ this.listeners.clear();
569
+ }
570
+ }
571
+ const excluded = 'button,input,textarea,select,svg,script,style,[role="button"],[aria-hidden="true"],[hidden],[inert],[data-code-block-banner],[data-response-annotation-ui]';
572
+ const blocks = /^(P|DIV|LI|UL|OL|BLOCKQUOTE|PRE|H[1-6]|TR|TABLE|SECTION)$/u;
573
+ function projectResponseText(root) {
574
+ let text = "";
575
+ const segments = [];
576
+ const separator = (value) => {
577
+ if (text && !text.endsWith(value)) text += value;
578
+ };
579
+ const visit = (node) => {
580
+ if (node.nodeType === Node.TEXT_NODE) {
581
+ const value = node.textContent ?? "";
582
+ if (value) {
583
+ segments.push({ node, start: text.length, end: text.length + value.length });
584
+ text += value;
585
+ }
586
+ return;
587
+ }
588
+ if (!(node instanceof HTMLElement) || node.matches(excluded)) return;
589
+ const style = getComputedStyle(node);
590
+ if (style.display === "none" || style.visibility === "hidden") return;
591
+ if (node.tagName === "BR") {
592
+ text += "\n";
593
+ return;
594
+ }
595
+ if (blocks.test(node.tagName)) separator("\n");
596
+ if (node.tagName === "TD" || node.tagName === "TH") separator(" ");
597
+ node.childNodes.forEach(visit);
598
+ if (blocks.test(node.tagName)) separator("\n");
599
+ };
600
+ root.childNodes.forEach(visit);
601
+ return { text: text.slice(0, segments.at(-1)?.end ?? 0), segments };
602
+ }
603
+ function prefixHash(text) {
604
+ let hash = 2166136261;
605
+ for (let index = 0; index < text.length; index++) hash = Math.imul(hash ^ text.charCodeAt(index), 16777619);
606
+ return (hash >>> 0).toString(16).padStart(8, "0");
607
+ }
608
+ function sliceRange(range, segment) {
609
+ const nodeRange = document.createRange();
610
+ nodeRange.selectNodeContents(segment.node);
611
+ if (range.compareBoundaryPoints(Range.END_TO_START, nodeRange) >= 0 || range.compareBoundaryPoints(Range.START_TO_END, nodeRange) <= 0) return void 0;
612
+ const start = range.startContainer === segment.node ? range.startOffset : 0;
613
+ const end = range.endContainer === segment.node ? range.endOffset : segment.node.length;
614
+ return end > start ? { start: segment.start + start, end: segment.start + end } : void 0;
615
+ }
616
+ function readResponseSelection(range, surfaces, sessionId) {
617
+ if (range.collapsed) return void 0;
618
+ const first = surfaces.find((surface) => surface.root.contains(range.startContainer));
619
+ const last = surfaces.find((surface) => surface.root.contains(range.endContainer));
620
+ if (!first || !last || first.source.sessionId !== sessionId || last.source.sessionId !== sessionId || first.source.nodeKey !== last.source.nodeKey) return void 0;
621
+ const selected = surfaces.filter((surface) => surface.source.sessionId === sessionId && surface.source.nodeKey === first.source.nodeKey && range.intersectsNode(surface.root)).sort((a, b) => a.source.blockIndex - b.source.blockIndex);
622
+ const anchors = [];
623
+ const ranges = [];
624
+ for (const surface of selected) {
625
+ const projection = projectResponseText(surface.root);
626
+ const portions = projection.segments.flatMap((segment) => {
627
+ const portion = sliceRange(range, segment);
628
+ return portion ? [portion] : [];
629
+ });
630
+ if (!portions.length) continue;
631
+ const start = portions[0].start;
632
+ const end = portions.at(-1).end;
633
+ const anchor = {
634
+ blockIndex: surface.source.blockIndex,
635
+ start,
636
+ end,
637
+ text: projection.text.slice(start, end),
638
+ prefixHash: prefixHash(projection.text.slice(0, end))
639
+ };
640
+ anchors.push(anchor);
641
+ ranges.push(...rangesForAnchor(projection, anchor));
642
+ }
643
+ const text = anchors.map((anchor) => anchor.text).join("\n\n");
644
+ if (!text.trim()) return void 0;
645
+ const { blockIndex: _block, text: _source, ...source } = first.source;
646
+ return {
647
+ snapshot: { version: 1, id: crypto.randomUUID(), ...source, text, comment: "", anchors },
648
+ ranges,
649
+ sources: selected.map((surface) => ({ surface, text: surface.source.text }))
650
+ };
651
+ }
652
+ function rangesForAnchor(projection, anchor) {
653
+ if (projection.text.slice(anchor.start, anchor.end) !== anchor.text || prefixHash(projection.text.slice(0, anchor.end)) !== anchor.prefixHash) return [];
654
+ return projection.segments.flatMap((segment) => {
655
+ const start = Math.max(anchor.start, segment.start);
656
+ const end = Math.min(anchor.end, segment.end);
657
+ if (end <= start) return [];
658
+ const range = document.createRange();
659
+ range.setStart(segment.node, start - segment.start);
660
+ range.setEnd(segment.node, end - segment.start);
661
+ return [range];
662
+ });
663
+ }
664
+ function selectionCurrent(selection) {
665
+ return selection.sources.every(({ surface, text }) => surface.root.isConnected && surface.source.text === text) && selection.snapshot.anchors.every((anchor) => {
666
+ const surface = selection.sources.find((item) => item.surface.source.blockIndex === anchor.blockIndex)?.surface;
667
+ return !!surface && rangesForAnchor(projectResponseText(surface.root), anchor).length > 0;
668
+ });
669
+ }
670
+ class ResponseController {
671
+ constructor(composer, load) {
672
+ this.composer = composer;
673
+ this.load = load;
674
+ }
675
+ surfaces = /* @__PURE__ */ new Set();
676
+ listeners = /* @__PURE__ */ new Set();
677
+ revision = 0;
678
+ operation = 0;
679
+ disposed = false;
680
+ candidate;
681
+ editor;
682
+ selectedId;
683
+ selected;
684
+ failure;
685
+ busy = false;
686
+ getSnapshot = () => this.revision;
687
+ subscribe = (listener) => {
688
+ this.listeners.add(listener);
689
+ return () => {
690
+ this.listeners.delete(listener);
691
+ };
692
+ };
693
+ changed = () => {
694
+ this.revision++;
695
+ for (const listener of this.listeners) listener();
696
+ };
697
+ register(surface) {
698
+ this.surfaces.add(surface);
699
+ this.changed();
700
+ return () => {
701
+ this.surfaces.delete(surface);
702
+ this.changed();
703
+ };
704
+ }
705
+ select(sessionId) {
706
+ if (this.busy || this.editor || this.composer.targetKey() !== sessionId) return;
707
+ const selection = window.getSelection();
708
+ this.candidate = selection?.rangeCount === 1 ? readResponseSelection(selection.getRangeAt(0), [...this.surfaces], sessionId) : void 0;
709
+ this.changed();
710
+ }
711
+ dismiss(restoreFocus = false) {
712
+ const editor = this.editor;
713
+ this.operation++;
714
+ this.candidate = void 0;
715
+ this.editor = void 0;
716
+ this.selectedId = void 0;
717
+ this.selected = void 0;
718
+ this.failure = void 0;
719
+ this.changed();
720
+ if (restoreFocus && editor) {
721
+ if (editor.trigger?.isConnected) editor.trigger.focus();
722
+ else this.composer.responses?.focus(editor.snapshot.sessionId);
723
+ }
724
+ }
725
+ async add() {
726
+ const selection = this.candidate;
727
+ if (!selection || this.busy) return;
728
+ const operation = ++this.operation;
729
+ this.failure = void 0;
730
+ this.busy = true;
731
+ this.changed();
732
+ try {
733
+ if (!selectionCurrent(selection)) throw new AnnotationError("error.responseChanged");
734
+ await this.composer.add({ text: "", responseSelection: selection.snapshot, expectedTarget: selection.snapshot.sessionId, focus: false });
735
+ if (this.disposed || operation !== this.operation || this.composer.targetKey() !== selection.snapshot.sessionId) return;
736
+ this.candidate = void 0;
737
+ window.getSelection()?.removeAllRanges();
738
+ this.editor = { snapshot: selection.snapshot, initial: true };
739
+ this.selectedId = selection.snapshot.id;
740
+ this.selected = selection.snapshot;
741
+ } catch (error) {
742
+ if (operation === this.operation) {
743
+ this.candidate = void 0;
744
+ this.failure = annotationFailure(error);
745
+ }
746
+ } finally {
747
+ this.busy = false;
748
+ if (!this.disposed) this.changed();
749
+ }
750
+ }
751
+ ranges(snapshot) {
752
+ const ranges = snapshot.anchors.map((anchor) => {
753
+ const surface = [...this.surfaces].find((item) => item.source.sessionId === snapshot.sessionId && item.source.nodeKey === snapshot.nodeKey && item.source.blockIndex === anchor.blockIndex);
754
+ return surface ? rangesForAnchor(projectResponseText(surface.root), anchor) : [];
755
+ });
756
+ return ranges.every((part) => part.length > 0) ? ranges.flat() : [];
757
+ }
758
+ async open(snapshot, edit, trigger) {
759
+ if (this.composer.targetKey() !== snapshot.sessionId) throw new AnnotationError("error.sessionChangedAdd");
760
+ const operation = ++this.operation;
761
+ if (edit) {
762
+ snapshot = this.composer.responses?.read(snapshot.sessionId).find((item) => item.id === snapshot.id) ?? snapshot;
763
+ }
764
+ const unavailable = () => {
765
+ if (!edit) throw new AnnotationError("error.responseUnavailable");
766
+ this.candidate = void 0;
767
+ this.editor = { snapshot, initial: false, trigger };
768
+ this.selectedId = snapshot.id;
769
+ this.selected = snapshot;
770
+ this.failure = new AnnotationError("error.responseUnavailable");
771
+ this.changed();
772
+ };
773
+ try {
774
+ await this.load(snapshot.sessionId, snapshot.seq);
775
+ } catch {
776
+ if (operation === this.operation && this.composer.targetKey() === snapshot.sessionId) unavailable();
777
+ return;
778
+ }
779
+ for (let attempt = 0; attempt < 20; attempt++) {
780
+ if (this.disposed || operation !== this.operation || this.composer.targetKey() !== snapshot.sessionId) throw new AnnotationError("error.cancelled");
781
+ const surface = [...this.surfaces].find((item) => item.source.sessionId === snapshot.sessionId && item.source.nodeKey === snapshot.nodeKey);
782
+ if (surface) {
783
+ surface.reveal();
784
+ if (!this.ranges(snapshot).length) {
785
+ unavailable();
786
+ return;
787
+ }
788
+ surface.root.scrollIntoView({ block: "center", behavior: "instant" });
789
+ this.candidate = void 0;
790
+ this.failure = void 0;
791
+ this.selectedId = snapshot.id;
792
+ this.selected = snapshot;
793
+ this.editor = edit ? { snapshot, initial: false, trigger } : void 0;
794
+ this.changed();
795
+ return;
796
+ }
797
+ await new Promise((resolve) => setTimeout(resolve, 50));
798
+ }
799
+ unavailable();
800
+ }
801
+ save(comment) {
802
+ if (!this.editor) return;
803
+ try {
804
+ const snapshot = this.editor.snapshot;
805
+ this.composer.responses?.replace({ ...snapshot, comment });
806
+ this.dismiss();
807
+ this.composer.responses?.focus(snapshot.sessionId);
808
+ } catch (error) {
809
+ this.failure = annotationFailure(error);
810
+ this.changed();
811
+ }
812
+ }
813
+ remove() {
814
+ if (!this.editor) return;
815
+ try {
816
+ const snapshot = this.editor.snapshot;
817
+ this.composer.responses?.remove(snapshot.sessionId, snapshot.id);
818
+ this.dismiss();
819
+ this.composer.responses?.focus(snapshot.sessionId);
820
+ } catch (error) {
821
+ this.failure = annotationFailure(error);
822
+ this.changed();
823
+ }
824
+ }
825
+ dispose() {
826
+ this.disposed = true;
827
+ this.operation++;
828
+ this.surfaces.clear();
829
+ this.listeners.clear();
830
+ }
831
+ }
832
+ export {
833
+ c as ANNOTATION_PRESENTATION,
834
+ d as ANNOTATION_SOURCE,
835
+ AnnotationError,
836
+ f as AnnotationPackets,
837
+ AnnotationsModel,
838
+ D as DocumentWorkflow,
839
+ F as FILE_SELECTION_SOURCE,
840
+ M as MAX_SELECTION_BYTES,
841
+ P as PageBatches,
842
+ PageImages,
843
+ g as PaintedCells,
844
+ R as RESPONSE_SELECTION_BYTES,
845
+ h as RESPONSE_SOURCE,
846
+ ResponseController,
847
+ j as absoluteFileAddress,
848
+ k as annotationErrorText,
849
+ annotationFailure,
850
+ l as annotationPresentation,
851
+ m as assertFileDraftCapacity,
852
+ n as assertResponseCapacity,
853
+ bindReferencePresentation,
854
+ o as capturePageRegion,
855
+ q as clip,
856
+ r as columnName,
857
+ commitToComposer,
858
+ t as decodeFileReference,
859
+ u as decodeResponseReference,
860
+ v as draftFactory,
861
+ en,
862
+ w as enclosing,
863
+ x as errorCopy,
864
+ errorEn,
865
+ errorZh,
866
+ y as fileLabel,
867
+ z as fileLocation,
868
+ B as filePath,
869
+ C as fileReference,
870
+ E as formatAnnotations,
871
+ imageDrafts,
872
+ G as isPageSnapshot,
873
+ H as normalizeRect,
874
+ I as packetSpan,
875
+ J as pageBounds,
876
+ pageImageStore,
877
+ K as pageInteraction,
878
+ L as pageRegion,
879
+ N as parseFileAddress,
880
+ prefixHash,
881
+ O as projectAnchors,
882
+ projectResponseText,
883
+ Q as quotedContext,
884
+ S as rangeAnchors,
885
+ T as rangeName,
886
+ rangesForAnchor,
887
+ U as readAnnotation,
888
+ V as readFileSelection,
889
+ W as readPageText,
890
+ X as readRange,
891
+ readResponseSelection,
892
+ Y as readResponseSnapshot,
893
+ Z as readSentFile,
894
+ _ as readSentResponse,
895
+ $ as readSpreadsheetSnapshot,
896
+ a0 as registerSpreadsheet,
897
+ a1 as responseReference,
898
+ a2 as responseSelections,
899
+ a3 as revealSpreadsheet,
900
+ selectedFiles,
901
+ selectionCurrent,
902
+ a4 as serializeFileReference,
903
+ a5 as serializeResponseReference,
904
+ a6 as sessionFileAddress,
905
+ a7 as spreadsheetSnapshot,
906
+ a8 as union,
907
+ a9 as validPageRect,
908
+ zh
909
+ };
910
+ //# sourceMappingURL=index.js.map