allyhub 0.18.0 → 0.20.0

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 (1050) hide show
  1. package/bin/allyhub.js +10 -0
  2. package/dist/args.js +1 -1
  3. package/dist/command.js +1 -1
  4. package/dist/commands/add.js +1 -1
  5. package/dist/commands/align.js +1 -1
  6. package/dist/commands/auth.js +1 -1
  7. package/dist/commands/check.js +1 -1
  8. package/dist/commands/cloud-tools.js +2 -2
  9. package/dist/commands/cloud.js +1 -1
  10. package/dist/commands/contributed.js +1 -1
  11. package/dist/commands/dev.js +5 -5
  12. package/dist/commands/export.js +3 -0
  13. package/dist/commands/found-extensions.js +2 -0
  14. package/dist/commands/frames/common.js +1 -1
  15. package/dist/commands/frames/doc.js +1 -1
  16. package/dist/commands/frames/piece.js +1 -1
  17. package/dist/commands/frames/sheet.js +1 -1
  18. package/dist/commands/frames.js +9 -9
  19. package/dist/commands/index.js +1 -1
  20. package/dist/commands/inspect/combos.js +1 -1
  21. package/dist/commands/inspect/common.js +3 -3
  22. package/dist/commands/inspect/facts.js +2 -2
  23. package/dist/commands/inspect/index.js +1 -1
  24. package/dist/commands/inspect/layout.js +1 -1
  25. package/dist/commands/inspect/views.js +1 -1
  26. package/dist/commands/list.js +2 -0
  27. package/dist/commands/mail.js +1 -1
  28. package/dist/commands/migrate.js +3 -0
  29. package/dist/commands/run-context.js +2 -0
  30. package/dist/commands/skills.js +3 -3
  31. package/dist/commands/upgrade.js +5 -0
  32. package/dist/commands.json +1 -0
  33. package/dist/fields.js +1 -1
  34. package/dist/help.js +3 -3
  35. package/dist/main.js +8 -7
  36. package/dist/node_modules/@allyhub/3d-extension/dist/build.js +1 -1
  37. package/dist/node_modules/@allyhub/3d-extension/dist/scenery-build.js +1 -1
  38. package/dist/node_modules/@allyhub/3d-extension/package.json +4 -3
  39. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  40. package/dist/node_modules/@allyhub/blocks/LICENSE +241 -0
  41. package/dist/node_modules/@allyhub/blocks/dist/alt.js +2 -0
  42. package/dist/node_modules/@allyhub/blocks/dist/elements.js +2 -0
  43. package/dist/node_modules/@allyhub/blocks/dist/flow-resolve.js +2 -0
  44. package/dist/node_modules/@allyhub/blocks/dist/flow-table.js +2 -0
  45. package/dist/node_modules/@allyhub/blocks/dist/format.js +2 -0
  46. package/dist/node_modules/@allyhub/blocks/dist/gantt.js +2 -0
  47. package/dist/node_modules/@allyhub/blocks/dist/grids.js +2 -0
  48. package/dist/node_modules/@allyhub/blocks/dist/html.js +75 -0
  49. package/dist/node_modules/@allyhub/blocks/dist/icons.generated.js +2 -0
  50. package/dist/node_modules/@allyhub/blocks/dist/icons.js +2 -0
  51. package/dist/node_modules/@allyhub/blocks/dist/index.js +2 -0
  52. package/dist/node_modules/@allyhub/blocks/dist/layout.js +2 -0
  53. package/dist/node_modules/@allyhub/blocks/dist/look.js +2 -0
  54. package/dist/node_modules/@allyhub/blocks/dist/measure.js +3 -0
  55. package/dist/node_modules/@allyhub/blocks/dist/model.js +2 -0
  56. package/dist/node_modules/@allyhub/blocks/dist/page.js +2 -0
  57. package/dist/node_modules/@allyhub/blocks/dist/palette.js +2 -0
  58. package/dist/node_modules/@allyhub/blocks/dist/path.js +2 -0
  59. package/dist/node_modules/@allyhub/blocks/dist/resolve.js +2 -0
  60. package/dist/node_modules/@allyhub/blocks/dist/samples.js +2 -0
  61. package/dist/node_modules/@allyhub/blocks/dist/sankey.js +2 -0
  62. package/dist/node_modules/@allyhub/blocks/dist/svg.js +2 -0
  63. package/dist/node_modules/@allyhub/blocks/dist/tidy.js +2 -0
  64. package/dist/node_modules/@allyhub/blocks/dist/trees.js +2 -0
  65. package/dist/node_modules/@allyhub/blocks/package.json +19 -0
  66. package/dist/node_modules/@allyhub/browser/dist/html.js +1 -1
  67. package/dist/node_modules/@allyhub/browser/package.json +1 -1
  68. package/dist/node_modules/@allyhub/build/dist/build-plugins.js +1 -1
  69. package/dist/node_modules/@allyhub/build/dist/fonts.js +9 -3
  70. package/dist/node_modules/@allyhub/build/dist/index.js +1 -1
  71. package/dist/node_modules/@allyhub/build/dist/inspect-view.js +1 -1
  72. package/dist/node_modules/@allyhub/build/dist/meta-worker.js +1 -1
  73. package/dist/node_modules/@allyhub/build/dist/migrate.js +2 -0
  74. package/dist/node_modules/@allyhub/build/dist/plugin.js +9 -9
  75. package/dist/node_modules/@allyhub/build/dist/prepare.js +3 -3
  76. package/dist/node_modules/@allyhub/build/dist/project-root.js +1 -1
  77. package/dist/node_modules/@allyhub/build/dist/scan.js +1 -1
  78. package/dist/node_modules/@allyhub/build/dist/sdk-parts.js +2 -0
  79. package/dist/node_modules/@allyhub/build/dist/vite.js +2 -2
  80. package/dist/node_modules/@allyhub/build/dist/work.js +3 -3
  81. package/dist/node_modules/@allyhub/build/package.json +13 -1
  82. package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
  83. package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
  84. package/dist/node_modules/@allyhub/chart/dist/chart-file.js +2 -1
  85. package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +4 -3
  86. package/dist/node_modules/@allyhub/chart/dist/chart.js +4 -2
  87. package/dist/node_modules/@allyhub/chart/dist/chartex-xml.js +4 -0
  88. package/dist/node_modules/@allyhub/chart/dist/classic.js +2 -0
  89. package/dist/node_modules/@allyhub/chart/dist/embedded.js +2 -2
  90. package/dist/node_modules/@allyhub/chart/dist/extended.js +2 -0
  91. package/dist/node_modules/@allyhub/chart/dist/index.js +1 -1
  92. package/dist/node_modules/@allyhub/chart/dist/svg.js +1 -1
  93. package/dist/node_modules/@allyhub/chart/dist/tree.js +2 -0
  94. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  95. package/dist/node_modules/@allyhub/check/dist/check.js +2 -2
  96. package/dist/node_modules/@allyhub/check/package.json +1 -1
  97. package/dist/node_modules/@allyhub/cloud/dist/blobs.js +1 -1
  98. package/dist/node_modules/@allyhub/cloud/dist/call.js +4 -4
  99. package/dist/node_modules/@allyhub/cloud/dist/catalog.js +1 -1
  100. package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
  101. package/dist/node_modules/@allyhub/cloud/dist/config.js +1 -1
  102. package/dist/node_modules/@allyhub/cloud/dist/credentials.js +1 -1
  103. package/dist/node_modules/@allyhub/cloud/dist/device.js +1 -1
  104. package/dist/node_modules/@allyhub/cloud/dist/errors.js +1 -1
  105. package/dist/node_modules/@allyhub/cloud/dist/index.js +1 -1
  106. package/dist/node_modules/@allyhub/cloud/dist/loopback.js +2 -2
  107. package/dist/node_modules/@allyhub/cloud/dist/mail.js +1 -1
  108. package/dist/node_modules/@allyhub/cloud/dist/records.js +1 -1
  109. package/dist/node_modules/@allyhub/cloud/dist/signin.js +2 -2
  110. package/dist/node_modules/@allyhub/cloud/dist/sites.js +1 -1
  111. package/dist/node_modules/@allyhub/cloud/dist/storage.js +2 -0
  112. package/dist/node_modules/@allyhub/cloud/dist/token.js +1 -1
  113. package/dist/node_modules/@allyhub/cloud/dist/tools.js +2 -0
  114. package/dist/node_modules/@allyhub/cloud/dist/uploads.js +2 -2
  115. package/dist/node_modules/@allyhub/cloud/dist/voice.js +1 -1
  116. package/dist/node_modules/@allyhub/cloud/package.json +5 -1
  117. package/dist/node_modules/@allyhub/components/package.json +1 -1
  118. package/dist/node_modules/@allyhub/dev-server/dist/background.js +1 -1
  119. package/dist/node_modules/@allyhub/dev-server/dist/item-process.js +2 -0
  120. package/dist/node_modules/@allyhub/dev-server/dist/item-worker.js +2 -0
  121. package/dist/node_modules/@allyhub/dev-server/dist/live.js +1 -1
  122. package/dist/node_modules/@allyhub/dev-server/dist/pages.js +20 -1
  123. package/dist/node_modules/@allyhub/dev-server/dist/project.js +1 -1
  124. package/dist/node_modules/@allyhub/dev-server/dist/record.js +1 -1
  125. package/dist/node_modules/@allyhub/dev-server/dist/server.js +2 -2
  126. package/dist/node_modules/@allyhub/dev-server/dist/tools.js +1 -1
  127. package/dist/node_modules/@allyhub/dev-server/dist/validate.js +2 -2
  128. package/dist/node_modules/@allyhub/dev-server/dist/writer.js +3 -3
  129. package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
  130. package/dist/node_modules/@allyhub/diagnostics/dist/rules.js +1 -1
  131. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  132. package/dist/node_modules/@allyhub/doc/dist/blocks.js +2 -0
  133. package/dist/node_modules/@allyhub/doc/dist/chart.js +1 -1
  134. package/dist/node_modules/@allyhub/doc/dist/color.js +1 -1
  135. package/dist/node_modules/@allyhub/doc/dist/docx-read.js +12 -0
  136. package/dist/node_modules/@allyhub/doc/dist/docx.js +5 -4
  137. package/dist/node_modules/@allyhub/doc/dist/html.js +83 -48
  138. package/dist/node_modules/@allyhub/doc/dist/index.js +1 -1
  139. package/dist/node_modules/@allyhub/doc/dist/markdown.js +1 -1
  140. package/dist/node_modules/@allyhub/doc/dist/merges.js +2 -0
  141. package/dist/node_modules/@allyhub/doc/dist/model.js +1 -1
  142. package/dist/node_modules/@allyhub/doc/dist/numbering.js +2 -0
  143. package/dist/node_modules/@allyhub/doc/dist/omml.js +3 -0
  144. package/dist/node_modules/@allyhub/doc/dist/page.js +2 -1
  145. package/dist/node_modules/@allyhub/doc/dist/paper.js +1 -1
  146. package/dist/node_modules/@allyhub/doc/dist/parse.js +5 -4
  147. package/dist/node_modules/@allyhub/doc/dist/redline.js +2 -0
  148. package/dist/node_modules/@allyhub/doc/dist/revisions.js +2 -0
  149. package/dist/node_modules/@allyhub/doc/dist/shapes.js +4 -0
  150. package/dist/node_modules/@allyhub/doc/dist/styles.js +2 -0
  151. package/dist/node_modules/@allyhub/doc/dist/table.js +1 -1
  152. package/dist/node_modules/@allyhub/doc/dist/write.js +65 -39
  153. package/dist/node_modules/@allyhub/doc/package.json +5 -1
  154. package/dist/node_modules/@allyhub/doc-extension/dist/build.js +2 -2
  155. package/dist/node_modules/@allyhub/doc-extension/dist/cli/find.js +1 -1
  156. package/dist/node_modules/@allyhub/doc-extension/dist/cli/import.js +3 -0
  157. package/dist/node_modules/@allyhub/doc-extension/dist/cli/index.js +1 -1
  158. package/dist/node_modules/@allyhub/doc-extension/dist/cli/styles.js +4 -0
  159. package/dist/node_modules/@allyhub/doc-extension/dist/export.js +1 -1
  160. package/dist/node_modules/@allyhub/doc-extension/dist/inspect.js +1 -1
  161. package/dist/node_modules/@allyhub/doc-extension/dist/project-tools.js +1 -1
  162. package/dist/node_modules/@allyhub/doc-extension/dist/tools.js +1 -1
  163. package/dist/node_modules/@allyhub/doc-extension/dist/workspace.js +1 -1
  164. package/dist/node_modules/@allyhub/doc-extension/package.json +22 -2
  165. package/dist/node_modules/@allyhub/doc-print/dist/drawn.js +4 -4
  166. package/dist/node_modules/@allyhub/doc-print/dist/index.js +1 -1
  167. package/dist/node_modules/@allyhub/doc-print/dist/layout.js +8 -7
  168. package/dist/node_modules/@allyhub/doc-print/dist/print.js +22 -16
  169. package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
  170. package/dist/node_modules/@allyhub/export/dist/export.js +1 -1
  171. package/dist/node_modules/@allyhub/export/package.json +1 -1
  172. package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
  173. package/dist/node_modules/@allyhub/extension-host/dist/points.js +1 -1
  174. package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
  175. package/dist/node_modules/@allyhub/formats/dist/data/blocks-flow.js +2 -0
  176. package/dist/node_modules/@allyhub/formats/dist/data/blocks.d.ts +146 -0
  177. package/dist/node_modules/@allyhub/formats/dist/data/blocks.js +2 -0
  178. package/dist/node_modules/@allyhub/formats/dist/data/cell-styles.d.ts +9 -0
  179. package/dist/node_modules/@allyhub/formats/dist/data/cell-styles.js +2 -0
  180. package/dist/node_modules/@allyhub/formats/dist/data/deck-code.d.ts +47 -40
  181. package/dist/node_modules/@allyhub/formats/dist/data/deck-code.js +1 -1
  182. package/dist/node_modules/@allyhub/formats/dist/data/diagram-kinds.d.ts +6 -0
  183. package/dist/node_modules/@allyhub/formats/dist/data/diagram-kinds.js +2 -0
  184. package/dist/node_modules/@allyhub/formats/dist/data/diagrams.d.ts +29 -0
  185. package/dist/node_modules/@allyhub/formats/dist/data/diagrams.js +2 -0
  186. package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +18 -0
  187. package/dist/node_modules/@allyhub/formats/dist/data/faces.js +1 -1
  188. package/dist/node_modules/@allyhub/formats/dist/data/page-data.d.ts +59 -0
  189. package/dist/node_modules/@allyhub/formats/dist/data/page-data.js +2 -0
  190. package/dist/node_modules/@allyhub/formats/dist/data/reference.d.ts +1 -1
  191. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +698 -258
  192. package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
  193. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +14104 -2167
  194. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  195. package/dist/node_modules/@allyhub/formats/dist/data/themes.d.ts +82 -0
  196. package/dist/node_modules/@allyhub/formats/dist/data/themes.js +2 -0
  197. package/dist/node_modules/@allyhub/formats/dist/data/tokens.d.ts +67 -0
  198. package/dist/node_modules/@allyhub/formats/dist/data/tokens.js +2 -0
  199. package/dist/node_modules/@allyhub/formats/dist/data/work.d.ts +42 -0
  200. package/dist/node_modules/@allyhub/formats/dist/data/work.js +1 -1
  201. package/dist/node_modules/@allyhub/formats/dist/index.d.ts +7 -0
  202. package/dist/node_modules/@allyhub/formats/dist/index.js +1 -1
  203. package/dist/node_modules/@allyhub/formats/dist/items.d.ts +36 -10
  204. package/dist/node_modules/@allyhub/formats/dist/items.js +1 -1
  205. package/dist/node_modules/@allyhub/formats/dist/note-shape.d.ts +1 -1
  206. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +3260 -290
  207. package/dist/node_modules/@allyhub/formats/dist/schemas.js +1 -1
  208. package/dist/node_modules/@allyhub/formats/dist/tolerant.d.ts +45 -0
  209. package/dist/node_modules/@allyhub/formats/dist/tolerant.js +2 -0
  210. package/dist/node_modules/@allyhub/formats/package.json +25 -1
  211. package/dist/node_modules/@allyhub/html-extension/dist/project-tools.js +21 -9
  212. package/dist/node_modules/@allyhub/html-extension/dist/tools.js +1 -1
  213. package/dist/node_modules/@allyhub/html-extension/markup/allyhub.yaml +2 -0
  214. package/dist/node_modules/@allyhub/html-extension/markup/markup.json +14 -4
  215. package/dist/node_modules/@allyhub/html-extension/markup/pages/budget.html +22 -1
  216. package/dist/node_modules/@allyhub/html-extension/package.json +9 -1
  217. package/dist/node_modules/@allyhub/i18n/package.json +1 -1
  218. package/dist/node_modules/@allyhub/image-draw/dist/fonts.js +1 -1
  219. package/dist/node_modules/@allyhub/image-draw/dist/inspect.js +2 -2
  220. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  221. package/dist/node_modules/@allyhub/image-extension/dist/build-plugins.js +1 -1
  222. package/dist/node_modules/@allyhub/image-extension/dist/cli.js +1 -1
  223. package/dist/node_modules/@allyhub/image-extension/package.json +2 -2
  224. package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +1 -1
  225. package/dist/node_modules/@allyhub/image-measure/dist/layout.js +2 -2
  226. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  227. package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
  228. package/dist/node_modules/@allyhub/image-render/package.json +1 -1
  229. package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
  230. package/dist/node_modules/@allyhub/image-sdk/dist/block.js +2 -0
  231. package/dist/node_modules/@allyhub/image-sdk/dist/blocks.js +2 -0
  232. package/dist/node_modules/@allyhub/image-sdk/dist/index.js +1 -1
  233. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  234. package/dist/node_modules/@allyhub/jobs/package.json +1 -1
  235. package/dist/node_modules/@allyhub/linkedin-extension/package.json +1 -3
  236. package/dist/node_modules/@allyhub/linkedin-extension/skills/allyhub/references/linkedin.md +3 -3
  237. package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
  238. package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
  239. package/dist/node_modules/@allyhub/linkedin-view/src/style.css +1 -600
  240. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  241. package/dist/node_modules/@allyhub/media/package.json +5 -1
  242. package/dist/node_modules/@allyhub/media-extension/dist/analyses/faces.js +1 -1
  243. package/dist/node_modules/@allyhub/media-extension/dist/asr/hear.js +1 -1
  244. package/dist/node_modules/@allyhub/media-extension/dist/asr/transcribe.js +1 -1
  245. package/dist/node_modules/@allyhub/media-extension/dist/ocr/text.js +1 -1
  246. package/dist/node_modules/@allyhub/media-extension/dist/vision/faces.js +1 -1
  247. package/dist/node_modules/@allyhub/media-extension/dist/vision/index-media.js +3 -2
  248. package/dist/node_modules/@allyhub/media-extension/dist/vision/track.js +1 -1
  249. package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
  250. package/dist/node_modules/@allyhub/model/package.json +1 -1
  251. package/dist/node_modules/@allyhub/office-extension/markup/csv/allyhub.yaml +2 -0
  252. package/dist/node_modules/@allyhub/office-extension/markup/csv/markup.json +1 -1
  253. package/dist/node_modules/@allyhub/office-extension/markup/document/allyhub.yaml +2 -0
  254. package/dist/node_modules/@allyhub/office-extension/markup/presentation/allyhub.yaml +2 -0
  255. package/dist/node_modules/@allyhub/office-extension/markup/workbook/allyhub.yaml +2 -0
  256. package/dist/node_modules/@allyhub/office-extension/markup/workbook/markup.json +1 -1
  257. package/dist/node_modules/@allyhub/office-extension/package.json +1 -1
  258. package/dist/node_modules/@allyhub/ooxml/dist/ext.js +1 -1
  259. package/dist/node_modules/@allyhub/ooxml/dist/mce.js +1 -1
  260. package/dist/node_modules/@allyhub/ooxml/dist/node.js +1 -1
  261. package/dist/node_modules/@allyhub/ooxml/dist/ns.js +1 -1
  262. package/dist/node_modules/@allyhub/ooxml/dist/opc.js +1 -1
  263. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  264. package/dist/node_modules/@allyhub/piece/dist/export.d.ts +1 -1
  265. package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +1 -2
  266. package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +2 -0
  267. package/dist/node_modules/@allyhub/piece/dist/look.d.ts +10 -2
  268. package/dist/node_modules/@allyhub/piece/dist/look.js +1 -1
  269. package/dist/node_modules/@allyhub/piece/dist/media.d.ts +9 -3
  270. package/dist/node_modules/@allyhub/piece/dist/script.js +1 -1
  271. package/dist/node_modules/@allyhub/piece/dist/source.d.ts +5 -2
  272. package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +2 -2
  273. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  274. package/dist/node_modules/@allyhub/project/dist/media-index.js +1 -1
  275. package/dist/node_modules/@allyhub/project/package.json +1 -1
  276. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  277. package/dist/node_modules/@allyhub/protocol/dist/blobs.js +1 -1
  278. package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
  279. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  280. package/dist/node_modules/@allyhub/protocol/dist/errors.js +1 -1
  281. package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
  282. package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
  283. package/dist/node_modules/@allyhub/protocol/dist/jsonrpc.js +1 -1
  284. package/dist/node_modules/@allyhub/protocol/dist/kinds.js +1 -1
  285. package/dist/node_modules/@allyhub/protocol/dist/mail.js +1 -1
  286. package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
  287. package/dist/node_modules/@allyhub/protocol/dist/page-frame.js +2 -0
  288. package/dist/node_modules/@allyhub/protocol/dist/paywall.js +1 -1
  289. package/dist/node_modules/@allyhub/protocol/dist/purposes.js +1 -1
  290. package/dist/node_modules/@allyhub/protocol/dist/registry.js +1 -1
  291. package/dist/node_modules/@allyhub/protocol/dist/sites.js +1 -1
  292. package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
  293. package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
  294. package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
  295. package/dist/node_modules/@allyhub/protocol/package.json +41 -1
  296. package/dist/node_modules/@allyhub/registry/package.json +1 -1
  297. package/dist/node_modules/@allyhub/render/dist/errors.js +1 -1
  298. package/dist/node_modules/@allyhub/render/dist/post-probe.js +1 -1
  299. package/dist/node_modules/@allyhub/render/package.json +9 -1
  300. package/dist/node_modules/@allyhub/runtime/dist/footage.js +1 -1
  301. package/dist/node_modules/@allyhub/runtime/package.json +1 -1
  302. package/dist/node_modules/@allyhub/runtimes/dist/bundled.js +1 -1
  303. package/dist/node_modules/@allyhub/runtimes/dist/declared.js +1 -1
  304. package/dist/node_modules/@allyhub/runtimes/dist/index.js +1 -1
  305. package/dist/node_modules/@allyhub/runtimes/dist/manifest.js +1 -1
  306. package/dist/node_modules/@allyhub/runtimes/dist/packages.js +2 -2
  307. package/dist/node_modules/@allyhub/runtimes/dist/runtimes.js +3 -3
  308. package/dist/node_modules/@allyhub/runtimes/package.json +9 -1
  309. package/dist/node_modules/@allyhub/scaffold/dist/index.js +12 -8
  310. package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
  311. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  312. package/dist/node_modules/@allyhub/scenery-host/dist/bundle.js +3 -3
  313. package/dist/node_modules/@allyhub/scenery-host/dist/fact.d.ts +1 -1
  314. package/dist/node_modules/@allyhub/scenery-host/dist/model-stage.js +2 -2
  315. package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
  316. package/dist/node_modules/@allyhub/sheet/dist/annotations.js +1 -1
  317. package/dist/node_modules/@allyhub/sheet/dist/api/capabilities.js +1 -1
  318. package/dist/node_modules/@allyhub/sheet/dist/api/charts.js +1 -1
  319. package/dist/node_modules/@allyhub/sheet/dist/api/index.js +1 -1
  320. package/dist/node_modules/@allyhub/sheet/dist/api/styles.js +1 -1
  321. package/dist/node_modules/@allyhub/sheet/dist/api/workbook.js +1 -1
  322. package/dist/node_modules/@allyhub/sheet/dist/arrange.js +1 -1
  323. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  324. package/dist/node_modules/@allyhub/sheet/dist/calc/server.js +1 -1
  325. package/dist/node_modules/@allyhub/sheet/dist/cell-styles.js +2 -0
  326. package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
  327. package/dist/node_modules/@allyhub/sheet/dist/check.js +1 -1
  328. package/dist/node_modules/@allyhub/sheet/dist/file.js +2 -2
  329. package/dist/node_modules/@allyhub/sheet/dist/filter.js +1 -1
  330. package/dist/node_modules/@allyhub/sheet/dist/generated.js +1 -1
  331. package/dist/node_modules/@allyhub/sheet/dist/heatmap.js +2 -0
  332. package/dist/node_modules/@allyhub/sheet/dist/html.js +9 -9
  333. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  334. package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
  335. package/dist/node_modules/@allyhub/sheet/dist/paginate.js +1 -1
  336. package/dist/node_modules/@allyhub/sheet/dist/printed.js +1 -1
  337. package/dist/node_modules/@allyhub/sheet/dist/sdk.js +1 -1
  338. package/dist/node_modules/@allyhub/sheet/dist/sparklines.js +2 -0
  339. package/dist/node_modules/@allyhub/sheet/dist/table-style.js +1 -1
  340. package/dist/node_modules/@allyhub/sheet/dist/table-styles.js +1 -1
  341. package/dist/node_modules/@allyhub/sheet/dist/theme.js +2 -0
  342. package/dist/node_modules/@allyhub/sheet/dist/tiles.js +2 -0
  343. package/dist/node_modules/@allyhub/sheet/dist/units.js +2 -0
  344. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  345. package/dist/node_modules/@allyhub/sheet/dist/write.js +14 -14
  346. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  347. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  348. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  349. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
  350. package/dist/node_modules/@allyhub/sheet/dist/xlsx/theme.js +1 -1
  351. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  352. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  353. package/dist/node_modules/@allyhub/sheet-extension/dist/build.js +1 -1
  354. package/dist/node_modules/@allyhub/sheet-extension/dist/cli/open.js +1 -1
  355. package/dist/node_modules/@allyhub/sheet-extension/dist/cli/sheet.js +7 -7
  356. package/dist/node_modules/@allyhub/sheet-extension/dist/code.js +1 -1
  357. package/dist/node_modules/@allyhub/sheet-extension/dist/evaluate.js +2 -2
  358. package/dist/node_modules/@allyhub/sheet-extension/dist/export.js +2 -2
  359. package/dist/node_modules/@allyhub/sheet-extension/dist/inspect.js +2 -2
  360. package/dist/node_modules/@allyhub/sheet-extension/dist/migrations.js +4 -0
  361. package/dist/node_modules/@allyhub/sheet-extension/dist/project-tools.js +1 -1
  362. package/dist/node_modules/@allyhub/sheet-extension/dist/tools.js +1 -1
  363. package/dist/node_modules/@allyhub/sheet-extension/package.json +7 -3
  364. package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
  365. package/dist/node_modules/@allyhub/slides-core/dist/blocks.js +2 -0
  366. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  367. package/dist/node_modules/@allyhub/slides-core/dist/chart-api.js +1 -1
  368. package/dist/node_modules/@allyhub/slides-core/dist/code.js +1 -1
  369. package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
  370. package/dist/node_modules/@allyhub/slides-core/dist/file.js +3 -3
  371. package/dist/node_modules/@allyhub/slides-core/dist/index.js +1 -1
  372. package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
  373. package/dist/node_modules/@allyhub/slides-core/dist/model.js +1 -1
  374. package/dist/node_modules/@allyhub/slides-core/dist/office-layouts.js +2 -0
  375. package/dist/node_modules/@allyhub/slides-core/dist/office.js +1 -1
  376. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  377. package/dist/node_modules/@allyhub/slides-core/dist/script.js +2 -2
  378. package/dist/node_modules/@allyhub/slides-core/dist/styles/brief.js +2 -0
  379. package/dist/node_modules/@allyhub/slides-core/dist/styles/editorial.js +2 -0
  380. package/dist/node_modules/@allyhub/slides-core/dist/styles/index.js +2 -0
  381. package/dist/node_modules/@allyhub/slides-core/dist/styles/kit.js +2 -0
  382. package/dist/node_modules/@allyhub/slides-core/dist/styles/layouts.js +2 -0
  383. package/dist/node_modules/@allyhub/slides-core/dist/styles/pitch.js +2 -0
  384. package/dist/node_modules/@allyhub/slides-core/dist/styles/stage.js +2 -0
  385. package/dist/node_modules/@allyhub/slides-core/dist/styles/tiles.js +2 -0
  386. package/dist/node_modules/@allyhub/slides-core/dist/theme.js +1 -1
  387. package/dist/node_modules/@allyhub/slides-core/dist/units.js +1 -1
  388. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  389. package/dist/node_modules/@allyhub/slides-extension/dist/check.js +1 -1
  390. package/dist/node_modules/@allyhub/slides-extension/dist/cli/slides.js +2 -2
  391. package/dist/node_modules/@allyhub/slides-extension/dist/deck-fonts.js +1 -1
  392. package/dist/node_modules/@allyhub/slides-extension/dist/project-tools.js +1 -1
  393. package/dist/node_modules/@allyhub/slides-extension/package.json +24 -1
  394. package/dist/node_modules/@allyhub/slides-pptx/dist/charts.js +1 -1
  395. package/dist/node_modules/@allyhub/slides-pptx/dist/fonts.js +1 -1
  396. package/dist/node_modules/@allyhub/slides-pptx/dist/image-size.js +2 -0
  397. package/dist/node_modules/@allyhub/slides-pptx/dist/import/code.js +3 -3
  398. package/dist/node_modules/@allyhub/slides-pptx/dist/import/index.js +7 -2
  399. package/dist/node_modules/@allyhub/slides-pptx/dist/import/names.js +1 -1
  400. package/dist/node_modules/@allyhub/slides-pptx/dist/import/script.js +1 -1
  401. package/dist/node_modules/@allyhub/slides-pptx/dist/index.js +1 -1
  402. package/dist/node_modules/@allyhub/slides-pptx/dist/mtx.js +2 -0
  403. package/dist/node_modules/@allyhub/slides-pptx/dist/read/chart.js +3 -2
  404. package/dist/node_modules/@allyhub/slides-pptx/dist/read/chartex.js +3 -0
  405. package/dist/node_modules/@allyhub/slides-pptx/dist/read/common.js +1 -1
  406. package/dist/node_modules/@allyhub/slides-pptx/dist/read/index.js +2 -2
  407. package/dist/node_modules/@allyhub/slides-pptx/dist/read/shapes.js +1 -1
  408. package/dist/node_modules/@allyhub/slides-pptx/dist/read/table.js +1 -1
  409. package/dist/node_modules/@allyhub/slides-pptx/dist/read/text.js +1 -1
  410. package/dist/node_modules/@allyhub/slides-pptx/dist/read/timing.js +1 -1
  411. package/dist/node_modules/@allyhub/slides-pptx/dist/shapes.js +1 -1
  412. package/dist/node_modules/@allyhub/slides-pptx/dist/text.js +1 -1
  413. package/dist/node_modules/@allyhub/slides-pptx/dist/write.js +2 -2
  414. package/dist/node_modules/@allyhub/slides-pptx/dist/xml.js +3 -2
  415. package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
  416. package/dist/node_modules/@allyhub/slides-runtime/dist/draw.js +2 -2
  417. package/dist/node_modules/@allyhub/slides-runtime/dist/load.js +1 -1
  418. package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
  419. package/dist/node_modules/@allyhub/stage/package.json +1 -1
  420. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/LICENSE +93 -0
  421. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-400-italic.woff2 +0 -0
  422. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-400-normal.woff2 +0 -0
  423. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-700-italic.woff2 +0 -0
  424. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-700-normal.woff2 +0 -0
  425. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-400-italic.woff2 +0 -0
  426. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-400-normal.woff2 +0 -0
  427. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-700-italic.woff2 +0 -0
  428. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/files/archivo-latin-ext-700-normal.woff2 +0 -0
  429. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-400-italic.css +1 -0
  430. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-400.css +1 -0
  431. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-700-italic.css +1 -0
  432. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-700.css +1 -0
  433. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-400-italic.css +1 -0
  434. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-400.css +1 -0
  435. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-700-italic.css +1 -0
  436. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo/latin-ext-700.css +1 -0
  437. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/LICENSE +93 -0
  438. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/files/archivo-black-latin-400-normal.woff2 +0 -0
  439. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/files/archivo-black-latin-ext-400-normal.woff2 +0 -0
  440. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/latin-400.css +1 -0
  441. package/dist/node_modules/@allyhub/stage-page/dist/fonts/archivo-black/latin-ext-400.css +1 -0
  442. package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/400-italic.css +1 -79
  443. package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/400.css +1 -79
  444. package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/700-italic.css +1 -79
  445. package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/700.css +1 -79
  446. package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/arial.css +1 -316
  447. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400-italic.css +1 -19
  448. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400.css +1 -19
  449. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700-italic.css +1 -19
  450. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700.css +1 -19
  451. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/cambria.css +1 -76
  452. package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/400-italic.css +1 -69
  453. package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/400.css +1 -69
  454. package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/700-italic.css +1 -69
  455. package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/700.css +1 -69
  456. package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/calibri.css +1 -276
  457. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400-italic.css +1 -79
  458. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400.css +1 -79
  459. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700-italic.css +1 -79
  460. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700.css +1 -79
  461. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/courier-new.css +1 -316
  462. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/LICENSE +93 -0
  463. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-400-italic.woff2 +0 -0
  464. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-400-normal.woff2 +0 -0
  465. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-700-italic.woff2 +0 -0
  466. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-700-normal.woff2 +0 -0
  467. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-400-italic.woff2 +0 -0
  468. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-400-normal.woff2 +0 -0
  469. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-700-italic.woff2 +0 -0
  470. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-ext-700-normal.woff2 +0 -0
  471. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-400-italic.css +1 -0
  472. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-400.css +1 -0
  473. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-700-italic.css +1 -0
  474. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-700.css +1 -0
  475. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-400-italic.css +1 -0
  476. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-400.css +1 -0
  477. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-700-italic.css +1 -0
  478. package/dist/node_modules/@allyhub/stage-page/dist/fonts/ibm-plex-sans/latin-ext-700.css +1 -0
  479. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/LICENSE +93 -0
  480. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-400-italic.woff2 +0 -0
  481. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-400-normal.woff2 +0 -0
  482. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-700-italic.woff2 +0 -0
  483. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-700-normal.woff2 +0 -0
  484. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-400-italic.woff2 +0 -0
  485. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-400-normal.woff2 +0 -0
  486. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-700-italic.woff2 +0 -0
  487. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/files/inter-latin-ext-700-normal.woff2 +0 -0
  488. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-400-italic.css +1 -0
  489. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-400.css +1 -0
  490. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-700-italic.css +1 -0
  491. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-700.css +1 -0
  492. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-400-italic.css +1 -0
  493. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-400.css +1 -0
  494. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-700-italic.css +1 -0
  495. package/dist/node_modules/@allyhub/stage-page/dist/fonts/inter-static/latin-ext-700.css +1 -0
  496. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/LICENSE +93 -0
  497. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-400-italic.woff2 +0 -0
  498. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-400-normal.woff2 +0 -0
  499. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-700-italic.woff2 +0 -0
  500. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-700-normal.woff2 +0 -0
  501. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-400-italic.woff2 +0 -0
  502. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-400-normal.woff2 +0 -0
  503. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-700-italic.woff2 +0 -0
  504. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/files/newsreader-latin-ext-700-normal.woff2 +0 -0
  505. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-400-italic.css +1 -0
  506. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-400.css +1 -0
  507. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-700-italic.css +1 -0
  508. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-700.css +1 -0
  509. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-400-italic.css +1 -0
  510. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-400.css +1 -0
  511. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-700-italic.css +1 -0
  512. package/dist/node_modules/@allyhub/stage-page/dist/fonts/newsreader/latin-ext-700.css +1 -0
  513. package/dist/node_modules/@allyhub/stage-page/dist/fonts/noto-color-emoji/emoji.css +1 -8
  514. package/dist/node_modules/@allyhub/stage-page/dist/fonts/noto-sans-sc/400.css +1 -1009
  515. package/dist/node_modules/@allyhub/stage-page/dist/fonts/noto-sans-sc/700.css +1 -1009
  516. package/dist/node_modules/@allyhub/stage-page/dist/fonts/noto-sans-sc/microsoft-yahei.css +1 -2018
  517. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/LICENSE +93 -0
  518. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-400-italic.woff2 +0 -0
  519. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-400-normal.woff2 +0 -0
  520. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-700-italic.woff2 +0 -0
  521. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-700-normal.woff2 +0 -0
  522. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-400-italic.woff2 +0 -0
  523. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-400-normal.woff2 +0 -0
  524. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-700-italic.woff2 +0 -0
  525. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/files/plus-jakarta-sans-latin-ext-700-normal.woff2 +0 -0
  526. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-400-italic.css +1 -0
  527. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-400.css +1 -0
  528. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-700-italic.css +1 -0
  529. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-700.css +1 -0
  530. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-400-italic.css +1 -0
  531. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-400.css +1 -0
  532. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-700-italic.css +1 -0
  533. package/dist/node_modules/@allyhub/stage-page/dist/fonts/plus-jakarta-sans/latin-ext-700.css +1 -0
  534. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400-italic.css +1 -79
  535. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400.css +1 -79
  536. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700-italic.css +1 -79
  537. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700.css +1 -79
  538. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/times-new-roman.css +1 -316
  539. package/dist/node_modules/@allyhub/stage-page/dist/host.js +1 -1
  540. package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.html +42 -0
  541. package/dist/node_modules/@allyhub/stage-page/dist/style-faces.js +2 -0
  542. package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
  543. package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +96 -92
  544. package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
  545. package/dist/node_modules/@allyhub/telemetry/dist/doc.js +1 -1
  546. package/dist/node_modules/@allyhub/telemetry/dist/errors.js +1 -1
  547. package/dist/node_modules/@allyhub/telemetry/dist/limit.js +2 -0
  548. package/dist/node_modules/@allyhub/telemetry/dist/telemetry.js +2 -2
  549. package/dist/node_modules/@allyhub/telemetry/package.json +5 -1
  550. package/dist/node_modules/@allyhub/text-extension/markup/allyhub.yaml +2 -0
  551. package/dist/node_modules/@allyhub/text-extension/markup-file/allyhub.yaml +2 -0
  552. package/dist/node_modules/@allyhub/text-extension/package.json +1 -1
  553. package/dist/node_modules/@allyhub/video-core/dist/footage-motion.js +1 -1
  554. package/dist/node_modules/@allyhub/video-core/dist/measure.js +1 -1
  555. package/dist/node_modules/@allyhub/video-core/dist/seams.js +1 -1
  556. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  557. package/dist/node_modules/@allyhub/video-extension/dist/build-plugins.js +1 -1
  558. package/dist/node_modules/@allyhub/video-extension/dist/cli/reference-text.js +1 -1
  559. package/dist/node_modules/@allyhub/video-extension/dist/inspect/index.js +1 -1
  560. package/dist/node_modules/@allyhub/video-extension/dist/inspect/joins.js +1 -1
  561. package/dist/node_modules/@allyhub/video-extension/dist/inspect/loop.js +3 -0
  562. package/dist/node_modules/@allyhub/video-extension/package.json +7 -26
  563. package/dist/node_modules/@allyhub/video-measure/dist/check.js +2 -2
  564. package/dist/node_modules/@allyhub/video-measure/dist/index.js +1 -1
  565. package/dist/node_modules/@allyhub/video-measure/dist/plans.js +2 -2
  566. package/dist/node_modules/@allyhub/video-measure/dist/reference/video.js +1 -1
  567. package/dist/node_modules/@allyhub/video-measure/dist/seams.js +1 -1
  568. package/dist/node_modules/@allyhub/video-measure/dist/version.js +1 -1
  569. package/dist/node_modules/@allyhub/video-measure/package.json +5 -1
  570. package/dist/node_modules/@allyhub/video-sdk/dist/config.js +2 -0
  571. package/dist/node_modules/@allyhub/video-sdk/dist/free.js +1 -1
  572. package/dist/node_modules/@allyhub/video-sdk/dist/piece.js +1 -1
  573. package/dist/node_modules/@allyhub/video-sdk/package.json +5 -1
  574. package/dist/node_modules/@allyhub/website/dist/index.js +1 -1
  575. package/dist/node_modules/@allyhub/website/dist/website.js +2 -2
  576. package/dist/node_modules/@allyhub/website/package.json +1 -1
  577. package/dist/node_modules/@allyhub/website-extension/dist/build.js +1 -1
  578. package/dist/node_modules/@allyhub/website-extension/package.json +6 -6
  579. package/dist/node_modules/@allyhub/x-extension/dist/build.js +1 -1
  580. package/dist/node_modules/@allyhub/x-extension/package.json +8 -4
  581. package/dist/node_modules/@allyhub/x-extension/skills/allyhub/references/x.md +3 -3
  582. package/dist/node_modules/@allyhub/x-model/package.json +1 -1
  583. package/dist/node_modules/@allyhub/x-view/package.json +1 -1
  584. package/dist/node_modules/@allyhub/x-view/src/style.css +1 -709
  585. package/dist/package.json +14 -14
  586. package/dist/project.js +1 -1
  587. package/dist/resources.js +1 -1
  588. package/dist/sdk-docs.js +1 -1
  589. package/dist/self-upgrade.js +2 -0
  590. package/dist/slot.js +4 -0
  591. package/dist/telemetry.js +1 -1
  592. package/dist/text/batch-text.js +1 -1
  593. package/dist/text/facts-text.js +5 -5
  594. package/dist/text/format.js +2 -2
  595. package/dist/update-notice.js +3 -0
  596. package/dist/version.js +1 -1
  597. package/dist/works.js +1 -1
  598. package/editor-web/assets/{abnfDiagram-WEYOIA3C-Hy4-O0wN.js → abnfDiagram-WEYOIA3C-BkVJMd53.js} +1 -1
  599. package/editor-web/assets/{architecture-WOLXFQ4H-43JEVxqz.js → architecture-WOLXFQ4H-C6rnaynZ.js} +1 -1
  600. package/editor-web/assets/{architectureDiagram-ZHVYKT53-7bFTl41n.js → architectureDiagram-ZHVYKT53-D3vrh8LK.js} +1 -1
  601. package/editor-web/assets/arrow-down-D-QZrqcz.js +1 -0
  602. package/editor-web/assets/arrow-up-B1zjKUHX.js +1 -0
  603. package/editor-web/assets/article-DHf6mOY_.js +7 -0
  604. package/editor-web/assets/article-Dns1-Xh-.js +3 -0
  605. package/editor-web/assets/{audio-lines-PZj77e7t.js → audio-lines-BFoW_IeO.js} +1 -1
  606. package/editor-web/assets/bar-button-CKPfx2AB.js +1 -0
  607. package/editor-web/assets/{blockDiagram-RJAE7QA3-DcoNo1WH.js → blockDiagram-RJAE7QA3-BKngt8H7.js} +1 -1
  608. package/editor-web/assets/{browser-C9NP0ZYz.js → browser-DEGNhKTV.js} +1 -1
  609. package/editor-web/assets/{c4Diagram-XDPPPE54-CsMt61gx.js → c4Diagram-XDPPPE54-j7sUELqF.js} +1 -1
  610. package/editor-web/assets/calc-worker-Cr4a0xmt.js +168 -0
  611. package/editor-web/assets/channel-CVWSV3su.js +1 -0
  612. package/editor-web/assets/{chart-no-axes-column-Be0lFcGF.js → chart-no-axes-column-Dyy25XZ_.js} +1 -1
  613. package/editor-web/assets/chip-Bn_9JRRG.js +1 -0
  614. package/editor-web/assets/{chunk-2E7WHVMD-fj-TJIRG.js → chunk-2E7WHVMD-BXa-uRSi.js} +1 -1
  615. package/editor-web/assets/{chunk-4EMNKR2T-Du5cRy-Y.js → chunk-4EMNKR2T-B3ntcsZN.js} +1 -1
  616. package/editor-web/assets/{chunk-55XCU76K-BHXxBBtm.js → chunk-55XCU76K-AMvnFwUg.js} +1 -1
  617. package/editor-web/assets/{chunk-7S6XSTFO-R5HW6X5I.js → chunk-7S6XSTFO-BA6esfFu.js} +1 -1
  618. package/editor-web/assets/{chunk-AQDTSKZB-C98F2BUb.js → chunk-AQDTSKZB-BT_vANXs.js} +1 -1
  619. package/editor-web/assets/{chunk-DSNLSHJZ-NIGsJ2cK.js → chunk-DSNLSHJZ-DoUgmzGB.js} +1 -1
  620. package/editor-web/assets/{chunk-HAGFOTED-BtHxtfW5.js → chunk-HAGFOTED-DtnIrCZb.js} +1 -1
  621. package/editor-web/assets/{chunk-HNE4Q36P-BI8i7Vkk.js → chunk-HNE4Q36P-BlPwQx3_.js} +1 -1
  622. package/editor-web/assets/{chunk-NQOKRVIF-DP_Z_zEA.js → chunk-NQOKRVIF-D2r7jp2r.js} +1 -1
  623. package/editor-web/assets/{chunk-UHW7PFBP-C_8bui28.js → chunk-UHW7PFBP-Cmc0_F5o.js} +1 -1
  624. package/editor-web/assets/{chunk-VQ5W62QI-CKZgzWB2.js → chunk-VQ5W62QI-nJSMqAr0.js} +1 -1
  625. package/editor-web/assets/{chunk-WQQL4CDK-Ff4DgCht.js → chunk-WQQL4CDK-Btq2nbF6.js} +1 -1
  626. package/editor-web/assets/{chunk-YZO67HFG-Csbx1-pi.js → chunk-YZO67HFG-DTbcCoGt.js} +1 -1
  627. package/editor-web/assets/{chunk-ZAUX2LTX-BO1kcV3w.js → chunk-ZAUX2LTX-DVwkg-2N.js} +1 -1
  628. package/editor-web/assets/{chunk-ZCHMQSOR-CxeNZYZG.js → chunk-ZCHMQSOR-BV39jOOE.js} +1 -1
  629. package/editor-web/assets/{classDiagram-v2-4MYWR3UA-D8eHQa5i.js → classDiagram-v2-4MYWR3UA-Cj74-fhM.js} +1 -1
  630. package/editor-web/assets/code-Ch6AB5bZ.js +1 -0
  631. package/editor-web/assets/collaborator-XiHOxwGM.js +1 -0
  632. package/editor-web/assets/{copy-CuJSs0nI.js → copy-SoaMYqsN.js} +1 -1
  633. package/editor-web/assets/{createLucideIcon-lm_6n8YT.js → createLucideIcon-euu7Wcd9.js} +1 -1
  634. package/editor-web/assets/{cynefin-EF2NZ3EQ-lIUY3WQQ.js → cynefin-EF2NZ3EQ-C0CkiipV.js} +1 -1
  635. package/editor-web/assets/{cynefinDiagram-WF24UDRP-CFOOhEEs.js → cynefinDiagram-WF24UDRP-hdsnJ4cI.js} +1 -1
  636. package/editor-web/assets/{dagre-NK4GIZVX-DdHVup2I.js → dagre-NK4GIZVX-CC7WSgaK.js} +1 -1
  637. package/editor-web/assets/deck-DQpNIS2p.js +1 -0
  638. package/editor-web/assets/{diagram-CBK3MWTC-CFAD9Y2B.js → diagram-CBK3MWTC-DmaVm13J.js} +1 -1
  639. package/editor-web/assets/{diagram-I5XIIV2D-DZJAn95A.js → diagram-I5XIIV2D-De8jqp7b.js} +1 -1
  640. package/editor-web/assets/{diagram-ODIL2UCW-BcIeYTaY.js → diagram-ODIL2UCW-B5pBTulX.js} +1 -1
  641. package/editor-web/assets/{diagram-PFBEJUXE-CnZmh_fl.js → diagram-PFBEJUXE-BYsXg5_w.js} +1 -1
  642. package/editor-web/assets/{diagram-RJA3I4VV-DpDd9rGx.js → diagram-RJA3I4VV-DZ8f6bYe.js} +1 -1
  643. package/editor-web/assets/{diagram-TYUNFSNR-ouGiUQcR.js → diagram-TYUNFSNR-qXHUsauD.js} +1 -1
  644. package/editor-web/assets/dist--z0ZHp4T.js +16 -0
  645. package/editor-web/assets/dist-9kuRjUTN.js +41 -0
  646. package/editor-web/assets/dist-B3rd02Cg.js +6 -0
  647. package/editor-web/assets/dist-B5GOGGEe.js +1 -0
  648. package/editor-web/assets/dist-Bx6q9kCu.js +1 -0
  649. package/editor-web/assets/dist-C4hHtrJr.js +1 -0
  650. package/editor-web/assets/dist-CCXJewsi.js +19 -0
  651. package/editor-web/assets/dist-CfK2BLl8.js +4 -0
  652. package/editor-web/assets/dist-Cmux3oJ_.js +1 -0
  653. package/editor-web/assets/dist-Cspf85KV.js +6 -0
  654. package/editor-web/assets/dist-DA72-4WB.js +82 -0
  655. package/editor-web/assets/{dist-DruvDNQe.js → dist-DAhe-kFC.js} +5 -5
  656. package/editor-web/assets/dist-DIJnhQFK.js +9 -0
  657. package/editor-web/assets/dist-DOrGo1GD.js +19 -0
  658. package/editor-web/assets/{dist-Bd8IxQPP.js → dist-DQ6RpEJD.js} +2 -2
  659. package/editor-web/assets/dist-DjiCHlSu.js +35 -0
  660. package/editor-web/assets/dist-Do4a40Wn.js +19 -0
  661. package/editor-web/assets/dist-FKEWS3Co.js +547 -0
  662. package/editor-web/assets/dist-QKd2i6kG.js +5 -0
  663. package/editor-web/assets/dist-SGnOfLhx.js +24 -0
  664. package/editor-web/assets/dist-VmVB7tl4.js +3 -0
  665. package/editor-web/assets/{docx-draw-C4aiB8HI.js → docx-draw-L54blreB.js} +1 -1
  666. package/editor-web/assets/{ebnfDiagram-V4P3TTPT-HRjVlbUf.js → ebnfDiagram-V4P3TTPT-B7-IfVI-.js} +1 -1
  667. package/editor-web/assets/{elk-QONTBCTQ-BFmtKyOf.js → elk-QONTBCTQ-Gj_WaeBn.js} +1 -1
  668. package/editor-web/assets/{erDiagram-KYQIGQAA-C9gcGEgK.js → erDiagram-KYQIGQAA-BDF6Qoqx.js} +1 -1
  669. package/editor-web/assets/esm-PQD5Pn8a.js +21 -0
  670. package/editor-web/assets/{eventmodeling-K75KTNOO-Bpma5Bdb.js → eventmodeling-K75KTNOO-elxVXXEe.js} +1 -1
  671. package/editor-web/assets/{file-question-mark-DlIjUK37.js → file-question-mark-PeZgyqkK.js} +1 -1
  672. package/editor-web/assets/flowDiagram-IUGLLWBU-B-25n8zE.js +1 -0
  673. package/editor-web/assets/{ganttDiagram-R7GPNTJY-CE5ut4C3.js → ganttDiagram-R7GPNTJY-CEogW3jW.js} +1 -1
  674. package/editor-web/assets/{gitGraph-VSP46ZUC-Dva3iGx2.js → gitGraph-VSP46ZUC-Bh9cRWFa.js} +1 -1
  675. package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-CJXFsAWp.js → gitGraphDiagram-PDYL7XHY-BQAvdM_V.js} +1 -1
  676. package/editor-web/assets/{group-BdrTp7gi.js → group-DwM2yqU8.js} +1 -1
  677. package/editor-web/assets/hint-CbwoSBMw.js +1 -0
  678. package/editor-web/assets/index-CXisi0Cj.css +2 -0
  679. package/editor-web/assets/index-wMlfx8aT.js +28 -0
  680. package/editor-web/assets/{info-OHQRW6UA-BY0AOfex.js → info-OHQRW6UA-CdPrqere.js} +1 -1
  681. package/editor-web/assets/{infoDiagram-MVDRKAX5-4Up1gMvC.js → infoDiagram-MVDRKAX5-uwIMeP44.js} +1 -1
  682. package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-BkvB9Qbn.js → ishikawaDiagram-HPEHV2GE-rtfvqK7E.js} +1 -1
  683. package/editor-web/assets/iso-UwGLGD3F.js +1 -0
  684. package/editor-web/assets/{italic-zw4_eUNF.js → italic-BV7iHxoP.js} +1 -1
  685. package/editor-web/assets/{journeyDiagram-BOSHW7O7-BxV09WdR.js → journeyDiagram-BOSHW7O7-mmhfIyVG.js} +1 -1
  686. package/editor-web/assets/{kanban-definition-FNSA4HC5-zTJtIDPG.js → kanban-definition-FNSA4HC5-Fe7jBsi-.js} +1 -1
  687. package/editor-web/assets/{link-DopSU3aa.js → link-CFOv3nz-.js} +1 -1
  688. package/editor-web/assets/{mermaid-parser.core-BWT9UQh_.js → mermaid-parser.core-BxOSjBH9.js} +3 -3
  689. package/editor-web/assets/{mermaid.core-DFf_Vg5X.js → mermaid.core-BOln9YdH.js} +4 -4
  690. package/editor-web/assets/{mindmap-definition-6OY57UG3-BYexiugS.js → mindmap-definition-6OY57UG3-M3Q1LOtO.js} +1 -1
  691. package/editor-web/assets/minus-ngE8owxs.js +1 -0
  692. package/editor-web/assets/{packet-JDAUHWVQ-DX_kSrI6.js → packet-JDAUHWVQ-Dbb0TUG6.js} +1 -1
  693. package/editor-web/assets/{pegDiagram-ECIUJNBX-I3SrcMLp.js → pegDiagram-ECIUJNBX-BZMRpSFC.js} +1 -1
  694. package/editor-web/assets/{pie-XZMESJXO-BmAFSw3E.js → pie-XZMESJXO-Ctm9XdKp.js} +1 -1
  695. package/editor-web/assets/{pieDiagram-GNMPY74T-DIZKcme5.js → pieDiagram-GNMPY74T-cGbs5ZTl.js} +1 -1
  696. package/editor-web/assets/progress-DZQTiRLv.js +6 -0
  697. package/editor-web/assets/{quadrantDiagram-D57K4MC3-CO3oSqpQ.js → quadrantDiagram-D57K4MC3-BUe_zsxT.js} +1 -1
  698. package/editor-web/assets/{radar-ABXABTNO-D5CkFrrb.js → radar-ABXABTNO-CCmKtqLs.js} +1 -1
  699. package/editor-web/assets/{railroad-I3PHUGI6-BeKY1p0K.js → railroad-I3PHUGI6-k-yhjhjA.js} +1 -1
  700. package/editor-web/assets/{railroad-abnf-LNEFI6M7-CIYV9_3-.js → railroad-abnf-LNEFI6M7-B-PvntB3.js} +1 -1
  701. package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-DN0zDl6d.js → railroad-ebnf-DWYD2UWJ-Ds2rua1h.js} +1 -1
  702. package/editor-web/assets/{railroad-peg-JR7BVNR7-Bd_GcO24.js → railroad-peg-JR7BVNR7-jNZ2wEp2.js} +1 -1
  703. package/editor-web/assets/{railroadDiagram-Y72NRBL7-DlFoiMhb.js → railroadDiagram-Y72NRBL7-CTqSQ15w.js} +1 -1
  704. package/editor-web/assets/react-Byupo4pA.js +1 -0
  705. package/editor-web/assets/replace-CLLMtF4e.js +1 -0
  706. package/editor-web/assets/{requirementDiagram-EQYSW5RA-LWAEz8Gy.js → requirementDiagram-EQYSW5RA-CUblhR5M.js} +1 -1
  707. package/editor-web/assets/ribbon-DajdQ_Ya.js +1 -0
  708. package/editor-web/assets/row-Bei9HNEe.js +1 -0
  709. package/editor-web/assets/{sankeyDiagram-SY24JHO5-B_pZGwUK.js → sankeyDiagram-SY24JHO5-nSz6zDX3.js} +1 -1
  710. package/editor-web/assets/schemas-C21MyseF.js +1 -0
  711. package/editor-web/assets/{iso-ahTwmFwH.js → schemas-DlRAoVtq.js} +1 -1
  712. package/editor-web/assets/{scissors-B_xOiUhd.js → scissors-m6QcoEf2.js} +1 -1
  713. package/editor-web/assets/search-D75Bi2GU.js +1 -0
  714. package/editor-web/assets/{sequenceDiagram-BLEHNHQU-bNhyCq0C.js → sequenceDiagram-BLEHNHQU-DxTpOYuo.js} +1 -1
  715. package/editor-web/assets/{session-Beijw9EK.js → session-BhClkDyr.js} +1 -1
  716. package/editor-web/assets/{sigma-DSUsJhMn.js → sigma-B4AWtnVA.js} +1 -1
  717. package/editor-web/assets/snapshots-DwGHDN3t.js +1 -0
  718. package/editor-web/assets/sound-DkR3qxSt.js +1 -0
  719. package/editor-web/assets/split-DBAbwPZ5.js +3 -0
  720. package/editor-web/assets/{square-arrow-out-up-right-DF5dvsSp.js → square-arrow-out-up-right-1NqFsNDe.js} +1 -1
  721. package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-DI-oM3qz.js → stateDiagram-v2-A6IESKWZ-C3e14iHY.js} +1 -1
  722. package/editor-web/assets/{sticky-note-BdkIu5_D.js → sticky-note-s4QfzaBB.js} +1 -1
  723. package/editor-web/assets/surface-CIF0Ae0z.js +1 -0
  724. package/editor-web/assets/swatch-BUzr_XmH.js +1 -0
  725. package/editor-web/assets/{swimlanes-B3ENRKFQ-awDmoLdW.js → swimlanes-B3ENRKFQ-DPPdzNzu.js} +1 -1
  726. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-B8n3zOw_.js +8 -0
  727. package/editor-web/assets/switch-DrZxoPQS.js +1 -0
  728. package/editor-web/assets/{syntax-CU_WPKxt.js → syntax-emXV4DnN.js} +1 -1
  729. package/editor-web/assets/table-BW43XXVd.js +1 -0
  730. package/editor-web/assets/tabs-BwU2E7bU.js +1 -0
  731. package/editor-web/assets/text-wrap-Baus6l-V.js +1 -0
  732. package/editor-web/assets/textarea-BX_ax3X8.js +1 -0
  733. package/editor-web/assets/{timeline-definition-JXYKGLGB-CayduPvL.js → timeline-definition-JXYKGLGB-DRTJ1_Er.js} +1 -1
  734. package/editor-web/assets/tolerant-DM9s0Mt1.js +1 -0
  735. package/editor-web/assets/{treeView-D4JQ5SDB-BVEuNzCO.js → treeView-D4JQ5SDB-BYJ_m-i5.js} +1 -1
  736. package/editor-web/assets/{treemap-SAJKECNS-BOB14HP3.js → treemap-SAJKECNS-BcU6I6Rg.js} +1 -1
  737. package/editor-web/assets/type-CvZ0HZsV.js +41 -0
  738. package/editor-web/assets/{undo-2-C47jrRp5.js → undo-2-DCbMWoug.js} +1 -1
  739. package/editor-web/assets/{usecaseDiagram-WPOLBNNX-DxT99uaq.js → usecaseDiagram-WPOLBNNX-YV92pS4o.js} +1 -1
  740. package/editor-web/assets/{vennDiagram-Q3Y3IDCW-CWUKom-r.js → vennDiagram-Q3Y3IDCW-oAvfHZtf.js} +1 -1
  741. package/editor-web/assets/video-SJvDRCJK.js +1 -0
  742. package/editor-web/assets/{wardley-7MLQ67FV-BAQyTneD.js → wardley-7MLQ67FV-BLNiqxtt.js} +1 -1
  743. package/editor-web/assets/{wardleyDiagram-IVAIDKWA-CiIYz4lZ.js → wardleyDiagram-IVAIDKWA-SppgC6xW.js} +1 -1
  744. package/editor-web/assets/{whole-word-D3ZAtnkw.js → whole-word-C9TkGBCY.js} +1 -1
  745. package/editor-web/assets/{words-0Ww2RyT4.js → words-BUlNNuH2.js} +3 -3
  746. package/editor-web/assets/words-zMedmPWc.js +3 -0
  747. package/editor-web/assets/workbook-BZKYx4WB.js +41 -0
  748. package/editor-web/assets/{xychartDiagram-4URNHDU4-D_D5IGmd.js → xychartDiagram-4URNHDU4-BHMn_jwJ.js} +1 -1
  749. package/editor-web/assets/{zoom-in-PgsC94hP.js → zoom-in-yAGKspfC.js} +1 -1
  750. package/editor-web/index.html +9 -8
  751. package/package.json +3 -3
  752. package/CHANGELOG.md +0 -243
  753. package/dist/commands/render.js +0 -3
  754. package/dist/node_modules/@allyhub/browser/dist/browser.d.ts +0 -24
  755. package/dist/node_modules/@allyhub/browser/dist/capture.d.ts +0 -61
  756. package/dist/node_modules/@allyhub/browser/dist/cdp.d.ts +0 -51
  757. package/dist/node_modules/@allyhub/browser/dist/emoji.d.ts +0 -29
  758. package/dist/node_modules/@allyhub/browser/dist/flags.d.ts +0 -13
  759. package/dist/node_modules/@allyhub/browser/dist/frames.d.ts +0 -35
  760. package/dist/node_modules/@allyhub/browser/dist/html.d.ts +0 -19
  761. package/dist/node_modules/@allyhub/browser/dist/index.d.ts +0 -10
  762. package/dist/node_modules/@allyhub/browser/dist/launch.d.ts +0 -35
  763. package/dist/node_modules/@allyhub/browser/dist/page.d.ts +0 -74
  764. package/dist/node_modules/@allyhub/browser/dist/picture.d.ts +0 -18
  765. package/dist/node_modules/@allyhub/browser/dist/server.d.ts +0 -26
  766. package/dist/node_modules/@allyhub/build/dist/build-plugins.d.ts +0 -91
  767. package/dist/node_modules/@allyhub/build/dist/cli-command.d.ts +0 -84
  768. package/dist/node_modules/@allyhub/build/dist/code.d.ts +0 -26
  769. package/dist/node_modules/@allyhub/build/dist/content.d.ts +0 -64
  770. package/dist/node_modules/@allyhub/build/dist/data.d.ts +0 -11
  771. package/dist/node_modules/@allyhub/build/dist/evaluate.d.ts +0 -44
  772. package/dist/node_modules/@allyhub/build/dist/file-check.d.ts +0 -35
  773. package/dist/node_modules/@allyhub/build/dist/files.d.ts +0 -4
  774. package/dist/node_modules/@allyhub/build/dist/fonts.d.ts +0 -26
  775. package/dist/node_modules/@allyhub/build/dist/generated.d.ts +0 -29
  776. package/dist/node_modules/@allyhub/build/dist/imports.d.ts +0 -17
  777. package/dist/node_modules/@allyhub/build/dist/index.d.ts +0 -37
  778. package/dist/node_modules/@allyhub/build/dist/inspect-view.d.ts +0 -119
  779. package/dist/node_modules/@allyhub/build/dist/kind-build.d.ts +0 -530
  780. package/dist/node_modules/@allyhub/build/dist/made-notes.d.ts +0 -9
  781. package/dist/node_modules/@allyhub/build/dist/matrix.d.ts +0 -19
  782. package/dist/node_modules/@allyhub/build/dist/media.d.ts +0 -10
  783. package/dist/node_modules/@allyhub/build/dist/messages.d.ts +0 -60
  784. package/dist/node_modules/@allyhub/build/dist/meta-worker.d.ts +0 -59
  785. package/dist/node_modules/@allyhub/build/dist/meta.d.ts +0 -24
  786. package/dist/node_modules/@allyhub/build/dist/model-info.d.ts +0 -6
  787. package/dist/node_modules/@allyhub/build/dist/move-refs.d.ts +0 -16
  788. package/dist/node_modules/@allyhub/build/dist/places.d.ts +0 -23
  789. package/dist/node_modules/@allyhub/build/dist/plugin.d.ts +0 -50
  790. package/dist/node_modules/@allyhub/build/dist/prepare.d.ts +0 -138
  791. package/dist/node_modules/@allyhub/build/dist/project-root.d.ts +0 -19
  792. package/dist/node_modules/@allyhub/build/dist/project-tool.d.ts +0 -136
  793. package/dist/node_modules/@allyhub/build/dist/references.d.ts +0 -6
  794. package/dist/node_modules/@allyhub/build/dist/scan.d.ts +0 -45
  795. package/dist/node_modules/@allyhub/build/dist/stage-route.d.ts +0 -80
  796. package/dist/node_modules/@allyhub/build/dist/takes.d.ts +0 -9
  797. package/dist/node_modules/@allyhub/build/dist/types.d.ts +0 -11
  798. package/dist/node_modules/@allyhub/build/dist/uses.d.ts +0 -44
  799. package/dist/node_modules/@allyhub/build/dist/version.d.ts +0 -56
  800. package/dist/node_modules/@allyhub/build/dist/vite.d.ts +0 -115
  801. package/dist/node_modules/@allyhub/build/dist/work.d.ts +0 -38
  802. package/dist/node_modules/@allyhub/cloud/dist/blobs.d.ts +0 -48
  803. package/dist/node_modules/@allyhub/cloud/dist/call.d.ts +0 -91
  804. package/dist/node_modules/@allyhub/cloud/dist/catalog.d.ts +0 -12
  805. package/dist/node_modules/@allyhub/cloud/dist/client.d.ts +0 -64
  806. package/dist/node_modules/@allyhub/cloud/dist/config.d.ts +0 -40
  807. package/dist/node_modules/@allyhub/cloud/dist/credentials.d.ts +0 -76
  808. package/dist/node_modules/@allyhub/cloud/dist/device.d.ts +0 -14
  809. package/dist/node_modules/@allyhub/cloud/dist/errors.d.ts +0 -24
  810. package/dist/node_modules/@allyhub/cloud/dist/hashes.d.ts +0 -43
  811. package/dist/node_modules/@allyhub/cloud/dist/index.d.ts +0 -19
  812. package/dist/node_modules/@allyhub/cloud/dist/keychain.d.ts +0 -18
  813. package/dist/node_modules/@allyhub/cloud/dist/loopback.d.ts +0 -22
  814. package/dist/node_modules/@allyhub/cloud/dist/mail.d.ts +0 -16
  815. package/dist/node_modules/@allyhub/cloud/dist/pkce.d.ts +0 -11
  816. package/dist/node_modules/@allyhub/cloud/dist/records.d.ts +0 -42
  817. package/dist/node_modules/@allyhub/cloud/dist/signin-worker.d.ts +0 -2
  818. package/dist/node_modules/@allyhub/cloud/dist/signin.d.ts +0 -48
  819. package/dist/node_modules/@allyhub/cloud/dist/sites.d.ts +0 -20
  820. package/dist/node_modules/@allyhub/cloud/dist/token.d.ts +0 -20
  821. package/dist/node_modules/@allyhub/cloud/dist/uploads.d.ts +0 -58
  822. package/dist/node_modules/@allyhub/cloud/dist/voice.d.ts +0 -22
  823. package/dist/node_modules/@allyhub/jobs/dist/index.d.ts +0 -3
  824. package/dist/node_modules/@allyhub/jobs/dist/jobs.d.ts +0 -139
  825. package/dist/node_modules/@allyhub/jobs/dist/show.d.ts +0 -41
  826. package/dist/node_modules/@allyhub/measure/dist/compare.d.ts +0 -195
  827. package/dist/node_modules/@allyhub/measure/dist/grain.d.ts +0 -8
  828. package/dist/node_modules/@allyhub/measure/dist/image.d.ts +0 -16
  829. package/dist/node_modules/@allyhub/measure/dist/index.d.ts +0 -4
  830. package/dist/node_modules/@allyhub/media/dist/analysis.d.ts +0 -25
  831. package/dist/node_modules/@allyhub/media/dist/audio.d.ts +0 -16
  832. package/dist/node_modules/@allyhub/media/dist/beats.d.ts +0 -100
  833. package/dist/node_modules/@allyhub/media/dist/cache.d.ts +0 -26
  834. package/dist/node_modules/@allyhub/media/dist/errors.d.ts +0 -34
  835. package/dist/node_modules/@allyhub/media/dist/fetch.d.ts +0 -11
  836. package/dist/node_modules/@allyhub/media/dist/grid.d.ts +0 -101
  837. package/dist/node_modules/@allyhub/media/dist/index.d.ts +0 -21
  838. package/dist/node_modules/@allyhub/media/dist/picture.d.ts +0 -130
  839. package/dist/node_modules/@allyhub/media/dist/probe.d.ts +0 -52
  840. package/dist/node_modules/@allyhub/media/dist/progress.d.ts +0 -16
  841. package/dist/node_modules/@allyhub/media/dist/run.d.ts +0 -25
  842. package/dist/node_modules/@allyhub/media/dist/sheet.d.ts +0 -67
  843. package/dist/node_modules/@allyhub/media/dist/shots.d.ts +0 -110
  844. package/dist/node_modules/@allyhub/media/dist/sync.d.ts +0 -156
  845. package/dist/node_modules/@allyhub/media/dist/tools.d.ts +0 -25
  846. package/dist/node_modules/@allyhub/media/dist/video.d.ts +0 -35
  847. package/dist/node_modules/@allyhub/media/dist/vision/cache.d.ts +0 -42
  848. package/dist/node_modules/@allyhub/media/dist/vision/probe.d.ts +0 -39
  849. package/dist/node_modules/@allyhub/media/dist/vision/types.d.ts +0 -2
  850. package/dist/node_modules/@allyhub/media/dist/voice-shape.d.ts +0 -51
  851. package/dist/node_modules/@allyhub/model/dist/authoring.d.ts +0 -48
  852. package/dist/node_modules/@allyhub/model/dist/bevel-attributes.d.ts +0 -19
  853. package/dist/node_modules/@allyhub/model/dist/bevel-collapse.d.ts +0 -12
  854. package/dist/node_modules/@allyhub/model/dist/bevel-corner-plan.d.ts +0 -24
  855. package/dist/node_modules/@allyhub/model/dist/bevel-deform.d.ts +0 -5
  856. package/dist/node_modules/@allyhub/model/dist/bevel-fans.d.ts +0 -12
  857. package/dist/node_modules/@allyhub/model/dist/bevel-junction.d.ts +0 -16
  858. package/dist/node_modules/@allyhub/model/dist/bevel-marks.d.ts +0 -14
  859. package/dist/node_modules/@allyhub/model/dist/bevel-metric.d.ts +0 -4
  860. package/dist/node_modules/@allyhub/model/dist/bevel-mixed.d.ts +0 -12
  861. package/dist/node_modules/@allyhub/model/dist/bevel-offsets.d.ts +0 -22
  862. package/dist/node_modules/@allyhub/model/dist/bevel-patch.d.ts +0 -45
  863. package/dist/node_modules/@allyhub/model/dist/bevel-profile.d.ts +0 -13
  864. package/dist/node_modules/@allyhub/model/dist/bevel-projection.d.ts +0 -10
  865. package/dist/node_modules/@allyhub/model/dist/bevel-reflex.d.ts +0 -10
  866. package/dist/node_modules/@allyhub/model/dist/bevel-square-out.d.ts +0 -18
  867. package/dist/node_modules/@allyhub/model/dist/bevel-strips.d.ts +0 -8
  868. package/dist/node_modules/@allyhub/model/dist/bmesh-cycles.d.ts +0 -52
  869. package/dist/node_modules/@allyhub/model/dist/build-cache.d.ts +0 -42
  870. package/dist/node_modules/@allyhub/model/dist/build-job.d.ts +0 -34
  871. package/dist/node_modules/@allyhub/model/dist/build-worker.d.ts +0 -2
  872. package/dist/node_modules/@allyhub/model/dist/build.d.ts +0 -67
  873. package/dist/node_modules/@allyhub/model/dist/cancel.d.ts +0 -8
  874. package/dist/node_modules/@allyhub/model/dist/curve-math.d.ts +0 -21
  875. package/dist/node_modules/@allyhub/model/dist/curve-mesh.d.ts +0 -30
  876. package/dist/node_modules/@allyhub/model/dist/evaluation-guard.d.ts +0 -11
  877. package/dist/node_modules/@allyhub/model/dist/export.d.ts +0 -12
  878. package/dist/node_modules/@allyhub/model/dist/mesh-queries.d.ts +0 -34
  879. package/dist/node_modules/@allyhub/model/dist/names.d.ts +0 -9
  880. package/dist/node_modules/@allyhub/model/dist/png.d.ts +0 -12
  881. package/dist/node_modules/@allyhub/model/dist/polygon-triangulation.d.ts +0 -4
  882. package/dist/node_modules/@allyhub/model/dist/program-location.d.ts +0 -7
  883. package/dist/node_modules/@allyhub/model/dist/report.d.ts +0 -70
  884. package/dist/node_modules/@allyhub/piece/dist/page/console.d.ts +0 -21
  885. package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +0 -4
  886. package/dist/node_modules/@allyhub/piece/dist/page/locate.d.ts +0 -17
  887. package/dist/node_modules/@allyhub/piece/dist/page/runtimes.d.ts +0 -9
  888. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +0 -661
  889. package/dist/node_modules/@allyhub/protocol/dist/account.js +0 -2
  890. package/dist/node_modules/@allyhub/protocol/dist/app.d.ts +0 -30
  891. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +0 -200
  892. package/dist/node_modules/@allyhub/protocol/dist/blobs.d.ts +0 -44
  893. package/dist/node_modules/@allyhub/protocol/dist/cli.d.ts +0 -68
  894. package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.d.ts +0 -77
  895. package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.js +0 -2
  896. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +0 -577
  897. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +0 -674
  898. package/dist/node_modules/@allyhub/protocol/dist/errors.d.ts +0 -7
  899. package/dist/node_modules/@allyhub/protocol/dist/events.d.ts +0 -803
  900. package/dist/node_modules/@allyhub/protocol/dist/files.d.ts +0 -103
  901. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +0 -247
  902. package/dist/node_modules/@allyhub/protocol/dist/image.d.ts +0 -8
  903. package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +0 -38
  904. package/dist/node_modules/@allyhub/protocol/dist/jobs.d.ts +0 -91
  905. package/dist/node_modules/@allyhub/protocol/dist/jsonrpc.d.ts +0 -83
  906. package/dist/node_modules/@allyhub/protocol/dist/kinds.d.ts +0 -144
  907. package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +0 -274
  908. package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +0 -211
  909. package/dist/node_modules/@allyhub/protocol/dist/open.d.ts +0 -13
  910. package/dist/node_modules/@allyhub/protocol/dist/paywall.d.ts +0 -134
  911. package/dist/node_modules/@allyhub/protocol/dist/peer.d.ts +0 -59
  912. package/dist/node_modules/@allyhub/protocol/dist/peer.js +0 -2
  913. package/dist/node_modules/@allyhub/protocol/dist/place.d.ts +0 -21
  914. package/dist/node_modules/@allyhub/protocol/dist/presence.d.ts +0 -125
  915. package/dist/node_modules/@allyhub/protocol/dist/purposes.d.ts +0 -47
  916. package/dist/node_modules/@allyhub/protocol/dist/registry.d.ts +0 -191
  917. package/dist/node_modules/@allyhub/protocol/dist/routes.d.ts +0 -14
  918. package/dist/node_modules/@allyhub/protocol/dist/routes.js +0 -2
  919. package/dist/node_modules/@allyhub/protocol/dist/runtimes.d.ts +0 -96
  920. package/dist/node_modules/@allyhub/protocol/dist/shape.d.ts +0 -35
  921. package/dist/node_modules/@allyhub/protocol/dist/shape.js +0 -2
  922. package/dist/node_modules/@allyhub/protocol/dist/shares.d.ts +0 -156
  923. package/dist/node_modules/@allyhub/protocol/dist/shares.js +0 -2
  924. package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.d.ts +0 -34
  925. package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.js +0 -2
  926. package/dist/node_modules/@allyhub/protocol/dist/sites.d.ts +0 -298
  927. package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +0 -503
  928. package/dist/node_modules/@allyhub/protocol/dist/sources.d.ts +0 -14
  929. package/dist/node_modules/@allyhub/protocol/dist/studio-server.d.ts +0 -264
  930. package/dist/node_modules/@allyhub/protocol/dist/studio-server.js +0 -2
  931. package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.d.ts +0 -18
  932. package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.js +0 -2
  933. package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.d.ts +0 -97
  934. package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.js +0 -2
  935. package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +0 -196
  936. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +0 -578
  937. package/dist/node_modules/@allyhub/protocol/dist/turns.d.ts +0 -71
  938. package/dist/node_modules/@allyhub/protocol/dist/turns.js +0 -2
  939. package/dist/node_modules/@allyhub/runtimes/dist/bundled.d.ts +0 -10
  940. package/dist/node_modules/@allyhub/runtimes/dist/declared.d.ts +0 -14
  941. package/dist/node_modules/@allyhub/runtimes/dist/download.d.ts +0 -38
  942. package/dist/node_modules/@allyhub/runtimes/dist/errors.d.ts +0 -20
  943. package/dist/node_modules/@allyhub/runtimes/dist/ffmpeg.d.ts +0 -15
  944. package/dist/node_modules/@allyhub/runtimes/dist/home.d.ts +0 -2
  945. package/dist/node_modules/@allyhub/runtimes/dist/index.d.ts +0 -12
  946. package/dist/node_modules/@allyhub/runtimes/dist/lock.d.ts +0 -14
  947. package/dist/node_modules/@allyhub/runtimes/dist/manifest.d.ts +0 -3
  948. package/dist/node_modules/@allyhub/runtimes/dist/node-program.d.ts +0 -12
  949. package/dist/node_modules/@allyhub/runtimes/dist/packages.d.ts +0 -101
  950. package/dist/node_modules/@allyhub/runtimes/dist/runtimes.d.ts +0 -73
  951. package/dist/node_modules/@allyhub/runtimes/dist/unpack.d.ts +0 -14
  952. package/dist/node_modules/@allyhub/scenery-host/dist/allyhub.d.ts +0 -20
  953. package/dist/node_modules/@allyhub/scenery-host/dist/bake/digest.d.ts +0 -14
  954. package/dist/node_modules/@allyhub/scenery-host/dist/bake/envmap.d.ts +0 -21
  955. package/dist/node_modules/@allyhub/scenery-host/dist/bake/run.d.ts +0 -63
  956. package/dist/node_modules/@allyhub/scenery-host/dist/budget.d.ts +0 -40
  957. package/dist/node_modules/@allyhub/scenery-host/dist/bundle.d.ts +0 -92
  958. package/dist/node_modules/@allyhub/scenery-host/dist/commands.d.ts +0 -54
  959. package/dist/node_modules/@allyhub/scenery-host/dist/draw2d.d.ts +0 -47
  960. package/dist/node_modules/@allyhub/scenery-host/dist/glass.d.ts +0 -39
  961. package/dist/node_modules/@allyhub/scenery-host/dist/index.d.ts +0 -25
  962. package/dist/node_modules/@allyhub/scenery-host/dist/inventory.d.ts +0 -18
  963. package/dist/node_modules/@allyhub/scenery-host/dist/layer/fidelity.d.ts +0 -70
  964. package/dist/node_modules/@allyhub/scenery-host/dist/layer/grade.d.ts +0 -7
  965. package/dist/node_modules/@allyhub/scenery-host/dist/layer/moire.d.ts +0 -6
  966. package/dist/node_modules/@allyhub/scenery-host/dist/measure/contacts.d.ts +0 -45
  967. package/dist/node_modules/@allyhub/scenery-host/dist/measure/health.d.ts +0 -10
  968. package/dist/node_modules/@allyhub/scenery-host/dist/measure/index.d.ts +0 -110
  969. package/dist/node_modules/@allyhub/scenery-host/dist/measure/relations.d.ts +0 -17
  970. package/dist/node_modules/@allyhub/scenery-host/dist/measure/solid.d.ts +0 -32
  971. package/dist/node_modules/@allyhub/scenery-host/dist/measure/support.d.ts +0 -11
  972. package/dist/node_modules/@allyhub/scenery-host/dist/model-stage.d.ts +0 -32
  973. package/dist/node_modules/@allyhub/scenery-host/dist/queries/inventory.d.ts +0 -5
  974. package/dist/node_modules/@allyhub/scenery-host/dist/queries/map.d.ts +0 -5
  975. package/dist/node_modules/@allyhub/scenery-host/dist/queries/view.d.ts +0 -10
  976. package/dist/node_modules/@allyhub/scenery-host/dist/scene.d.ts +0 -35
  977. package/dist/node_modules/@allyhub/scenery-host/dist/screen-dom.d.ts +0 -24
  978. package/dist/node_modules/@allyhub/scenery-host/dist/stage/bakes.d.ts +0 -42
  979. package/dist/node_modules/@allyhub/scenery-host/dist/stage/index.d.ts +0 -6
  980. package/dist/node_modules/@allyhub/scenery-host/dist/stage/page.d.ts +0 -70
  981. package/dist/node_modules/@allyhub/scenery-host/dist/stage/solve.d.ts +0 -49
  982. package/dist/node_modules/@allyhub/scenery-host/dist/stage/version.d.ts +0 -73
  983. package/dist/node_modules/@allyhub/scenery-host/dist/stage/view.d.ts +0 -18
  984. package/dist/node_modules/@allyhub/scenery-host/dist/steady.d.ts +0 -4
  985. package/dist/node_modules/@allyhub/scenery-host/dist/viewer.d.ts +0 -134
  986. package/dist/node_modules/@allyhub/video-extension/dist/inspect/motion.js +0 -4
  987. package/dist/node_modules/@allyhub/video-measure/dist/still.js +0 -2
  988. package/editor-web/assets/arrow-down-B8VUPCGi.js +0 -1
  989. package/editor-web/assets/arrow-up-Ds4juY8X.js +0 -1
  990. package/editor-web/assets/article-CS48wwvk.js +0 -3
  991. package/editor-web/assets/article-Cyle57uq.js +0 -7
  992. package/editor-web/assets/bar-button-J9vbfzTx.js +0 -1
  993. package/editor-web/assets/calc-worker-BdHh5LXM.js +0 -45
  994. package/editor-web/assets/channel-HUlo15J7.js +0 -1
  995. package/editor-web/assets/chart-amT4lgX3.js +0 -2
  996. package/editor-web/assets/chart-file-CfbWK9l1.js +0 -1
  997. package/editor-web/assets/code-CD-CbJG9.js +0 -1
  998. package/editor-web/assets/collaborator-BU4qU7O3.js +0 -1
  999. package/editor-web/assets/deck-CtEtDHo2.js +0 -1
  1000. package/editor-web/assets/dist-BBshIz1Q.js +0 -5
  1001. package/editor-web/assets/dist-BI8QjOsV.js +0 -1
  1002. package/editor-web/assets/dist-BajH5QfK.js +0 -24
  1003. package/editor-web/assets/dist-Bl74xqMW.js +0 -19
  1004. package/editor-web/assets/dist-BrUtQth3.js +0 -18
  1005. package/editor-web/assets/dist-CN5A7Au2.js +0 -1
  1006. package/editor-web/assets/dist-CcL6r6l3.js +0 -1
  1007. package/editor-web/assets/dist-D2E3cgRP.js +0 -4
  1008. package/editor-web/assets/dist-D3C6FyrO.js +0 -82
  1009. package/editor-web/assets/dist-DGKjn59H.js +0 -16
  1010. package/editor-web/assets/dist-NQNQ5HqZ.js +0 -17
  1011. package/editor-web/assets/dist-SV0sOVIC.js +0 -43
  1012. package/editor-web/assets/dist-YW8hS4IM.js +0 -9
  1013. package/editor-web/assets/dist-Y_XZZa8q.js +0 -531
  1014. package/editor-web/assets/dist-ZrBAbqyJ.js +0 -3
  1015. package/editor-web/assets/dist-d4dayaWE.js +0 -17
  1016. package/editor-web/assets/dist-elglzHMT.js +0 -6
  1017. package/editor-web/assets/dist-hHcrvNn9.js +0 -1
  1018. package/editor-web/assets/esm-DzxAod8Q.js +0 -21
  1019. package/editor-web/assets/file-exclamation-point-_L3ElCJ5.js +0 -1
  1020. package/editor-web/assets/flowDiagram-IUGLLWBU-tz5ewhC5.js +0 -1
  1021. package/editor-web/assets/hint-rlht0uxG.js +0 -1
  1022. package/editor-web/assets/index-Dvh1t1om.css +0 -2
  1023. package/editor-web/assets/index-q7X6hdHp.js +0 -28
  1024. package/editor-web/assets/minus-CbPnUIOy.js +0 -1
  1025. package/editor-web/assets/progress-CwKcXARv.js +0 -6
  1026. package/editor-web/assets/props-form-DUFxM5eb.js +0 -1
  1027. package/editor-web/assets/react-Edyoga_4.js +0 -1
  1028. package/editor-web/assets/row-C_svyL8o.js +0 -1
  1029. package/editor-web/assets/schemas-moE_A7Nj.js +0 -1
  1030. package/editor-web/assets/search-Ba2BbT6T.js +0 -1
  1031. package/editor-web/assets/slides-oQ_C0SVJ.js +0 -1
  1032. package/editor-web/assets/snapshots-Dd0Wd_qM.js +0 -1
  1033. package/editor-web/assets/sound-bTlco_K3.js +0 -1
  1034. package/editor-web/assets/split-zARio3J8.js +0 -3
  1035. package/editor-web/assets/strikethrough-BwXWi4zg.js +0 -1
  1036. package/editor-web/assets/surface-DtCjIlrq.js +0 -1
  1037. package/editor-web/assets/svg-CWIBMIQ9.js +0 -1
  1038. package/editor-web/assets/swatch-DhztHwPU.js +0 -1
  1039. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-X35m3xN6.js +0 -8
  1040. package/editor-web/assets/switch-8MU4Nfxe.js +0 -1
  1041. package/editor-web/assets/table-DRbddzx0.js +0 -1
  1042. package/editor-web/assets/tabs-BHBvbekZ.js +0 -1
  1043. package/editor-web/assets/tag-CIfWT8B_.js +0 -1
  1044. package/editor-web/assets/text-align-start-Cic2-TLh.js +0 -1
  1045. package/editor-web/assets/textarea-D7TnPwv1.js +0 -1
  1046. package/editor-web/assets/video-oJ3qa1Qv.js +0 -1
  1047. package/editor-web/assets/words-XlXG79Ur.js +0 -3
  1048. package/editor-web/assets/workbook-DznVDqoE.js +0 -45
  1049. package/editor-web/assets/x-DlhyIKuu.js +0 -41
  1050. /package/dist/node_modules/@allyhub/{protocol/dist/runtimes.js → runtimes/dist/schema.js} +0 -0
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{SHEET_SEPARATOR as P}from"@allyhub/formats";import{MAX_ROWS as B,cellName as U,columnIndex as C,columnLetter as j,contains as y,overlaps as v,rangeName as D,readAddress as A,readArea as $,readAreas as z}from"./address.js";import{readCsv as _}from"@allyhub/formats";import{CODE as R,ENTRY as E,readSheetFile as G}from"./file.js";import{withGenerated as O}from"./generated.js";import"@allyhub/formats";import{moveFormula as H}from"./formula/move.js";import{parseFormula as X}from"./formula/parse.js";import{printFormula as Y}from"./formula/print.js";import{readTyped as x}from"./values.js";export class SharedFormula{node;error;analysis;text;row;col;source;constructor(e,t,s,n){this.text=e,this.row=t,this.col=s,this.source=n;const i=X(e);i.ok?this.node=i.node:this.error=i.error}}export class FormulaCell{value=null;array;spill;blocked;state=1;mark=0;shared;sheet;row;col;constructor(e,t,s,n){this.shared=e,this.sheet=t,this.row=s,this.col=n}get moved(){const{node:e,row:t,col:s}=this.shared;if(!e)throw new Error(`${this.shared.text} does not parse.`);return H(e,this.row-t,this.col-s)}get text(){const{node:e,text:t,row:s,col:n}=this.shared;return!e||s===this.row&&n===this.col?t:Y(this.moved)}}class Z{columns=[];firsts=[];lasts=[];formulas=[];get(e,t){return this.columns[t]?.[e]}set(e,t,s){let n=this.columns[t];n||(n=[],this.columns[t]=n,this.firsts[t]=e,this.lasts[t]=e),n[e]instanceof FormulaCell&&(this.formulas[t]=(this.formulas[t]??1)-1),s instanceof FormulaCell&&(this.formulas[t]=(this.formulas[t]??0)+1),n[e]=s,e<(this.firsts[t]??e)&&(this.firsts[t]=e),e>(this.lasts[t]??e)&&(this.lasts[t]=e)}get width(){return this.columns.length}holds(e,t,s){const n=Math.min(e.right,this.columns.length-1);for(let i=e.left;i<=n;i++){const r=this.columns[i];if(!r)continue;const l=Math.min(e.bottom,this.last(i));for(let o=Math.max(e.top,this.first(i));o<=l;o++)if(r[o]!==void 0&&!(o===t&&i===s))return!0}return!1}first(e){return this.firsts[e]??1/0}last(e){return this.lasts[e]??-1}hasFormulas(e){return(this.formulas[e]??0)>0}}export class Table{columns=[];rows=0;lines=[];places=[];records=[];name;sheet;at;file;spec;constructor(e,t,s,n,i){this.name=e,this.sheet=t,this.at=s,this.file=n,this.spec=i}get area(){return{top:this.at.row,left:this.at.col,bottom:this.at.row+this.rows,right:this.at.col+Math.max(this.columns.length,1)-1}}get data(){const e=this.area;return{...e,top:e.top+1}}column(e){const t=e.toLowerCase();return this.columns.find(s=>s.name.toLowerCase()===t)}}export const placeKey=(a,e)=>a*16384+e;function T(a,e){a.bottom=Math.max(a.bottom,e.bottom),a.right=Math.max(a.right,e.right);for(let t=e.left;t<=e.right;t++){const s=a.columns.get(t);a.columns.set(t,[Math.min(s?.[0]??e.top,e.top),Math.max(s?.[1]??e.bottom,e.bottom)])}}export class Worksheet{tables=[];blocks=[];merges=[];formulas=new Set;implied=new Map;keys=new Map;fills=[];blanks=new Set;conditions=[];validations=[];filters=[];charts=[];names=new Map;freeze;generated=!1;grid=new Z;expanded=!1;lowest=-1;ghosts=new Map;spills=new Set;stopped=new Set;reach;lookAreas;name;index;spec;constructor(e,t,s){this.name=e,this.index=t,this.spec=s}respec(e){const t=e.charts!==this.spec.charts;this.spec=e,this.lookAreas=void 0,t&&(this.charts.length=0,e.charts?.forEach((s,n)=>{const i=W(s,n,[],()=>{});i&&this.charts.push(i)}))}put(e,t,s){s instanceof FormulaCell&&this.formulas.add(s),this.grid.set(e,t,s),e>this.lowest&&(this.lowest=e)}replace(e,t,s){this.expand();const n=this.grid.get(e,t);n instanceof FormulaCell&&this.formulas.delete(n),s instanceof FormulaCell&&this.formulas.add(s),this.grid.set(e,t,s),e>this.lowest&&(this.lowest=e)}expand(){if(!this.expanded){this.expanded=!0;for(let e=this.fills.length-1;e>=0;e--){const t=this.fills[e];if(!t)continue;const{area:s,shared:n,value:i,format:r,start:l}=t;for(let o=s.top;o<=s.bottom;o++)for(let f=s.left;f<=s.right;f++)if(this.grid.get(o,f)===void 0&&!this.blanks.has(placeKey(o,f)))if(n){const h=new FormulaCell(n,this,o,f);l!==void 0&&(h.value=l),this.put(o,f,h)}else i!=null&&(this.put(o,f,i),r!==void 0&&this.implied.set(placeKey(o,f),r))}}}at(e,t){return this.expand(),this.grid.get(e,t)}spillAt(e,t){return this.ghosts.size===0?void 0:this.ghosts.get(placeKey(e,t))}holds(e,t){return this.expand(),this.grid.holds(e,t.row,t.col)}spillsIn(e){if(this.spills.size===0)return[];if((e.bottom-e.top+1)*(e.right-e.left+1)>=this.spills.size)return[...this.spills].filter(n=>n.spill!==void 0&&v(n.spill,e));const s=new Set;for(let n=e.top;n<=e.bottom;n++)for(let i=e.left;i<=e.right;i++){const r=this.ghosts.get(placeKey(n,i));r&&s.add(r)}return[...s]}blockedBy(e){if(this.stopped.size===0)return[];const t=[];for(const s of this.stopped)s.blocked&&v(s.blocked,e)&&t.push(s);return t}placeSpill(e,t){e.spill=t,this.spills.add(e);for(let s=t.top;s<=t.bottom;s++)for(let n=t.left;n<=t.right;n++)(s!==e.row||n!==e.col)&&this.ghosts.set(placeKey(s,n),e);this.reach&&T(this.reach,t)}blockSpill(e,t){e.blocked=t,this.stopped.add(e)}clearSpill(e){const t=e.spill;if(t)for(let s=t.top;s<=t.bottom;s++)for(let n=t.left;n<=t.right;n++)this.ghosts.get(placeKey(s,n))===e&&this.ghosts.delete(placeKey(s,n));e.spill=void 0,e.blocked=void 0,this.spills.delete(e),this.stopped.delete(e)}clearSpills(){for(const e of[...this.spills,...this.stopped])e.spill=void 0,e.blocked=void 0;this.spills.clear(),this.stopped.clear(),this.ghosts.clear(),this.reach=void 0}tighten(){this.reach=void 0}spillReach(){if(this.reach)return this.reach;const e={columns:new Map,bottom:-1,right:-1};for(const{spill:t}of this.spills)t&&T(e,t);return this.reach=e,e}hasFormulas(e){return this.expand(),this.grid.hasFormulas(e)}span(e,t,s){this.expand();const n=this.grid.first(e),i=this.grid.last(e);if(this.spills.size===0)return[Math.max(t,n),Math.min(s,i)];const[r,l]=this.spillReach().columns.get(e)??[1/0,-1];return[Math.max(t,Math.min(n,r)),Math.min(s,Math.max(i,l))]}get columnsUsed(){return this.expand(),this.spills.size===0?this.grid.width:Math.max(this.grid.width,this.spillReach().right+1)}get lastRow(){return this.expand(),this.spills.size===0?this.lowest:Math.max(this.lowest,this.spillReach().bottom)}get used(){const e=this.lastRow,t=this.columnsUsed-1;return e<0||t<0?void 0:{top:0,left:0,bottom:e,right:t}}tableAt(e,t){return this.tables.find(s=>y(s.area,e,t))}blockAt(e,t){return this.blocks.find(s=>y(s.area,e,t))}looks(){if(this.lookAreas)return this.lookAreas;const e=[];for(const s of this.spec.format??[]){const n=$(s.range);n&&e.push({area:n,entry:s})}const t=[];for(const[s,n]of Object.entries(this.spec.cells??{})){if(!s.includes(":")||n===null||typeof n!="object")continue;const i=$(s);i&&t.push({area:i,entry:n})}return this.lookAreas={formats:e,ranges:t},this.lookAreas}styledAreas(){const{formats:e,ranges:t}=this.looks();return[...e,...t.filter(s=>Object.keys(s.entry).some(n=>F.has(n)))]}lookAt(e,t){const s={},n=c=>{if(c)for(const[b,w]of Object.entries(c))F.has(b)&&w!==void 0&&(s[b]=b==="border"?{...s.border,...w}:w)},i=this.implied.get(placeKey(e,t));i!==void 0&&(s.format=i);const r=this.ghosts.size===0?void 0:this.spillAt(e,t),l=r&&this.lookAt(r.row,r.col).format;l!==void 0&&(s.format=l),this.spec.columns&&n(this.spec.columns[j(t)]),this.spec.rows&&n(this.spec.rows[String(e+1)]);const o=this.tableAt(e,t);o&&e>o.at.row&&n(o.columns[t-o.at.col]?.spec);const{formats:f,ranges:h}=this.looks();for(const c of f)y(c.area,e,t)&&n(c.entry);for(const c of h)y(c.area,e,t)&&n(c.entry);const d=this.keys.get(placeKey(e,t)),g=d===void 0?void 0:this.spec.cells?.[d];if(g!==null&&typeof g=="object"&&n(g),s.border){const c=Object.entries(s.border).filter(([,b])=>b?.style!=="none");c.length===0?delete s.border:s.border=Object.fromEntries(c)}return s}runsAt(e,t){const s=this.keys.get(placeKey(e,t)),n=s===void 0?void 0:this.spec.cells?.[s];return n!==null&&typeof n=="object"?n.runs:void 0}mergeAt(e,t){return this.merges.find(s=>y(s,e,t))}validationAt(e,t){return this.validations.find(s=>s.areas.some(n=>y(n,e,t)))}filterHeadAt(e,t){return this.filters.find(s=>e===s.area.top&&t>=s.area.left&&t<=s.area.right)}filterAt(e,t){return this.filters.find(s=>y(s.area,e,t))}filesAt(e,t){const s=this.tableAt(e,t);if(s&&e>s.at.row){const n=s.columns[t-s.at.col]?.spec?.files;if(n!==void 0)return n}return s?.at.row===e?void 0:this.spec.columns?.[j(t)]?.files}}export const filesSeparator=a=>(typeof a=="object"?a.separator:void 0)??P;export function filesIn(a,e){const t=filesSeparator(e);return a.split(t.trim()===""?t:t.trim()).map(s=>s.trim()).filter(s=>s!=="")}const F=new Set(["bold","italic","underline","strike","font","size","color","fill","align","valign","wrap","shrink","indent","rotation","border","locked","hide_formula","format"]);export class Workbook{title;sheets=[];names=new Map;checks=[];bySheet=new Map;byTable=new Map;file;generated;ordinary=[];constructor(e,t){this.file=e,this.title=e.title,this.generated=t}respec(e){this.file=O(e,this.generated).file,this.title=e.title,this.sheets.forEach(t=>{const s=e.sheets.find(n=>n.name===t.name);s&&t.respec(s)})}sheet(e){return this.bySheet.get(e.toLowerCase())}table(e){return this.byTable.get(e.toLowerCase())}name(e,t){const s=e.toLowerCase();return(t?.names.size?t.names.get(s):void 0)??this.names.get(s)}definitions(e){const t=e.toLowerCase(),s=[],n=this.names.get(t);n&&s.push(n);for(const i of this.sheets){const r=i.names.get(t);r&&s.push(r)}return s}get tables(){return[...this.byTable.values()]}addSheet(e){this.sheets.push(e),this.bySheet.set(e.name.toLowerCase(),e)}addTable(e){e.sheet.tables.push(e),this.byTable.set(e.name.toLowerCase(),e)}sourceOf(e,t,s){if(e.generated)return{file:R};const n=this.sheets.indexOf(e),i=e.tableAt(t,s);if(i){const o=i.columns[s-i.at.col],f=t-i.at.row-1,h=o?.csv!==void 0&&(i.records[f]?.[o.csv]??"")!=="";return f>=0&&o?.formula&&!h?o.formula.source:{file:i.file,line:f<0?1:i.lines[f]??1}}const r=e.blockAt(t,s);if(r)return{file:r.file,line:r.lines[t-r.area.top]??1};const l=e.keys.get(placeKey(t,s));if(l!==void 0)return{file:E,path:["sheets",n,"cells",l]};for(const o of Object.keys(e.spec.cells??{})){if(!o.includes(":"))continue;const f=$(o);if(f&&y(f,t,s))return{file:E,path:["sheets",n,"cells",o]}}}}export const MAX_FILL_CELLS=5e6;const q=/^[\p{L}_\\][\p{L}\p{N}_.\\?]*$/u;export function validName(a){return q.test(a)&&A(a)===void 0&&!/^(?:TRUE|FALSE)$/iu.test(a)&&!/^[Rr](?:\d+)?(?:[Cc]\d*)?$/u.test(a)&&!/^[Cc]\d*$/u.test(a)}const M="made",k=a=>a[0]===M?R:E;class N{problems=[];wb;read_;lineOf;own;madeNames;constructor(e,t,s,n,i){this.wb=e,this.read_=t,this.lineOf=s,this.own=n,this.madeNames=i}yaml(e,t){const s=this.lineOf(e);this.problems.push({file:k(e),...s===void 0?{}:{line:s},message:t})}sheetPath(e){return e<this.own?["sheets",e]:[M,"sheets",e-this.own]}read(){const{file:e}=this.wb;e.sheets.forEach((t,s)=>{const n=this.sheetPath(s);if(this.wb.sheet(t.name)){this.yaml([...n,"name"],`two sheets are named ${t.name}`);return}(/[\\/?*[\]:]/u.test(t.name)||t.name.length>31)&&this.yaml([...n,"name"],`${t.name} cannot be a sheet's name: at most 31 characters, none of \\ / ? * [ ] :`);const i=new Worksheet(t.name,this.wb.sheets.length,t);i.generated=s>=this.own,this.wb.addSheet(i)}),this.names();for(const[t,s]of e.sheets.entries()){const n=this.wb.sheets[t];n?.spec===s&&this.sheet(n,this.sheetPath(t))}e.checks?.forEach((t,s)=>{const n={file:E,path:["checks",s,"formula"]};this.wb.checks.push({name:t.name,formula:new SharedFormula(t.formula,0,0,n),source:n})})}names(){const{file:e}=this.wb;this.namesOf(e.names,e.hidden_names,t=>this.madeNames.has(t)?[M,"names",t]:["names",t],this.wb.names,void 0),e.sheets.forEach((t,s)=>{const n=this.wb.sheets[s];n?.spec===t&&this.namesOf(t.names,t.hidden_names,i=>[...this.sheetPath(s),"names",i],n.names,n)})}namesOf(e,t,s,n,i){const r=new Set(t?.map(l=>l.toLowerCase()));for(const[l,o]of Object.entries(e??{})){const f=s(l);if(!validName(l)){this.yaml(f,`${l} cannot be a name`);continue}const h={file:k(f),path:f},d=typeof o=="string"&&o.startsWith("=")?{name:l,formula:new SharedFormula(o,0,0,h),source:h}:{name:l,value:typeof o=="string"?x(o).value:o,source:h};i&&(d.sheet=i),r.has(l.toLowerCase())&&(d.hidden=!0),n.set(l.toLowerCase(),d)}}sheet(e,t){const{spec:s}=e;if(s.freeze!==void 0){const n=A(s.freeze);n?e.freeze=n:this.yaml([...t,"freeze"],`${s.freeze} is not a cell`)}s.tables?.forEach((n,i)=>{this.table(e,n,[...t,"tables",i])});for(const[n,i]of e.tables.entries())for(const r of e.tables.slice(n+1))v(i.area,r.area)&&this.problems.push({file:E,message:`tables ${i.name} and ${r.name} overlap on ${e.name}`});s.blocks?.forEach((n,i)=>{this.block(e,n.at,n.rows,[...t,"blocks",i])}),this.cells(e,s.cells??{},[...t,"cells"]),s.merges?.forEach((n,i)=>{const r=$(n);r?e.merges.push(r):this.yaml([...t,"merges",i],`${n} is not a range`)}),s.format?.forEach((n,i)=>{$(n.range)||this.yaml([...t,"format",i,"range"],`${n.range} is not a range`)}),s.conditional?.forEach((n,i)=>{this.condition(e,n,[...t,"conditional",i])}),s.validations?.forEach((n,i)=>{this.validation(e,n,[...t,"validations",i])}),this.filters(e,t),s.charts?.forEach((n,i)=>{this.chart(e,n,i,[...t,"charts",i])});for(const n of Object.keys(s.columns??{}))C(n)===void 0&&this.yaml([...t,"columns",n],`${n} is not a column`);for(const n of Object.keys(s.rows??{}))(!/^[1-9]\d*$/u.test(n)||Number(n)>B)&&this.yaml([...t,"rows",n],`${n} is not a row`)}chart(e,t,s,n){const i=W(t,s,n,(r,l)=>{this.yaml(r,l)});i&&e.charts.push(i)}bound(e,t,s){if(!(typeof e!="string"||!e.startsWith("=")||e.length<2))return new SharedFormula(e,t?.top??0,t?.left??0,{file:k(s),path:s})}condition(e,t,s){const n=z(t.range);if(!n){this.yaml([...s,"range"],`${t.range} is not a range`);return}const[i]=n,r=[],l=(o,f)=>{const h=this.bound(o,i,f);h&&r.push(h)};if(t.type==="expression"){const o=t.formula.startsWith("=")?t.formula:`=${t.formula}`;l(o,[...s,"formula"])}if(t.type==="cellIs"&&t.formula.forEach((o,f)=>{l(o,[...s,"formula",f])}),t.type==="dataBar")for(const o of["min","max"])l(t[o]?.value,[...s,o,"value"]);(t.type==="colorScale"||t.type==="iconSet")&&t.stops?.forEach((o,f)=>{l(o.value,[...s,"stops",f,"value"])}),e.conditions.push({spec:t,areas:n,formulas:r})}validation(e,t,s){const n=z(t.range);if(!n){this.yaml([...s,"range"],`${t.range} is not a range`);return}const i=(t.formula??[]).map((o,f)=>this.bound(o,n[0],[...s,"formula",f])),r=t.formula?.length??0,l=t.type!=="list"&&t.type!=="custom"&&(t.operator===void 0||t.operator==="between"||t.operator==="notBetween");!(t.type==="list"&&t.values!==void 0)&&r<(l?2:1)&&this.yaml(s,`a ${t.type} validation needs its bounds`),e.validations.push({spec:t,areas:n,formulas:i})}filters(e,t){const{spec:s}=e;if(s.filter){const n=[...t,"filter"],i=$(s.filter.range);if(!i)this.yaml([...n,"range"],`${s.filter.range} is not a range`);else{const r=new Map;for(const[o,f]of Object.entries(s.filter.columns??{})){const h=C(o);h===void 0||h<i.left||h>i.right?this.yaml([...n,"columns",o],`${o} is not a column of ${s.filter.range}`):r.set(h,f)}const l=e.tables.find(o=>v(o.area,i));l&&this.yaml(n,`a filter over table ${l.name}: a table has its own`),e.filters.push({area:i,columns:r})}}e.tables.forEach((n,i)=>{const{filter:r}=n.spec;if(r===!1)return;const l=new Map;for(const[o,f]of Object.entries(r?.columns??{})){const h=n.column(o);h?l.set(n.at.col+h.index,f):this.yaml([...t,"tables",i,"filter","columns",o],`table ${n.name} has no column ${o}`)}e.filters.push({area:n.area,table:n,columns:l})})}csv(e,t,s){const n=this.read_(e);return n||this.yaml(t,`${s}: ${e} is not there`),n}overlapping(e,t){const s=e.tables.find(i=>v(i.area,t));if(s)return`table ${s.name}`;const n=e.blocks.find(i=>v(i.area,t));return n?`the block of ${n.file}`:void 0}typed(e,t,s,n,i){if(n.formula!==void 0){const r=new SharedFormula(n.formula,t,s,i),l=new FormulaCell(r,e,t,s);n.start!==void 0&&(l.value=n.start),e.put(t,s,l);return}n.value!==null&&(e.put(t,s,n.value),n.format!==void 0&&e.implied.set(placeKey(t,s),n.format))}table(e,t,s){const n=A(t.at);if(!n){this.yaml([...s,"at"],`${t.at} is not a cell`);return}if(!validName(t.name)){this.yaml([...s,"name"],`${t.name} cannot be a table's name`);return}if(this.wb.table(t.name)){this.yaml([...s,"name"],`two tables are named ${t.name}`);return}this.wb.name(t.name)&&this.yaml([...s,"name"],`${t.name} is a defined name and a table's`);const i=new Table(t.name,e,n,t.rows,t),r=this.csv(t.rows,[...s,"rows"],`table ${t.name}`),l=r?.rows??[],o=r?.lines??[],f=l[0],h=o[0]??1,d=new Set,g=f?.length===0?[""]:f??[];g.forEach((u,m)=>{const p=u.trim();p===""&&this.problems.push({file:t.rows,line:h,message:`column ${String(m+1)} has no name`}),d.has(p.toLowerCase())&&this.problems.push({file:t.rows,line:h,message:`two columns are named ${p}`}),d.add(p.toLowerCase()),i.columns.push({name:p,index:i.columns.length,csv:m})});for(const[u,m]of Object.entries(t.columns??{})){const p=i.column(u),S=p??{name:u,index:i.columns.length};p||(m.formula===void 0&&this.yaml([...s,"columns",u],`table ${t.name} has no column ${u}`),i.columns.push(S)),S.spec=m}const c=g.length;for(let u=1;u<l.length;u++){const m=l[u];if(!m||m.length===0)continue;const p=o[u]??u+1;i.places.push(u),i.records.push(m),i.lines.push(p),m.length>c&&this.problems.push({file:t.rows,line:p,message:`this row has ${String(m.length)} fields and the header ${String(c)}`})}i.rows=i.records.length;const b=this.overlapping(e,i.area);b&&this.yaml(s,`table ${t.name} overlaps ${b} on ${e.name}`),this.wb.addTable(i),this.tableKey(i,s);const w=n.row+1;i.columns.forEach(u=>{const m=n.col+u.index;e.put(n.row,m,u.name);const p=u.spec?.formula;p!==void 0&&(u.formula=new SharedFormula(p,w,m,{file:k(s),path:[...s,"columns",u.name,"formula"]}),i.rows>0&&e.fills.push({area:{top:w,left:m,bottom:w+i.rows-1,right:m},shared:u.formula})),u.csv!==void 0&&i.records.forEach((S,L)=>{this.typed(e,w+L,m,x(S[u.csv??0]??""),{file:t.rows,line:i.lines[L]??1})})})}tableKey(e,t){const{key:s}=e.spec;if(s===void 0)return;const n=e.column(s);if(n?.csv===void 0){this.yaml([...t,"key"],`table ${e.name} has no column ${s} in ${e.file}`);return}const i=new Set;e.records.forEach((r,l)=>{const o=r[n.csv??0]??"",f=e.lines[l]??1;o===""?this.problems.push({file:e.file,line:f,message:`this row has no ${s}, table ${e.name}'s key`}):i.has(o)&&this.problems.push({file:e.file,line:f,message:`two rows have the key ${o}`}),i.add(o)})}block(e,t,s,n){const i=A(t);if(!i){this.yaml([...n,"at"],`${t} is not a cell`);return}const r=this.csv(s,[...n,"rows"],"a block");if(!r)return;const l=r.rows,o=l.map((g,c)=>r.lines[c]??c+1),f=l.reduce((g,c)=>Math.max(g,c.length),1),h={top:i.row,left:i.col,bottom:i.row+Math.max(l.length,1)-1,right:i.col+f-1},d=this.overlapping(e,h);d&&this.yaml(n,`the block of ${s} overlaps ${d} on ${e.name}`),e.blocks.push({area:h,file:s,lines:o}),l.forEach((g,c)=>{g.forEach((b,w)=>{this.typed(e,i.row+c,i.col+w,x(b),{file:s,line:o[c]??c+1})})})}cells(e,t,s){const n=[];for(const[i,r]of Object.entries(t)){const l=[...s,i],o=$(i);if(!o){this.yaml(l,`${i} is not a cell or a range`);continue}const f=this.overlapping(e,o);if(f&&this.yaml(l,`${i} overlaps ${f}`),i.includes(":")){const h=(o.bottom-o.top+1)*(o.right-o.left+1);h>MAX_FILL_CELLS?this.yaml(l,`${i} is ${String(h)} cells`):(r!==null&&typeof r=="object"&&r.runs&&this.yaml([...l,"runs"],`${i} is a range: runs are one cell's`),this.fill(e,o,r,l))}else n.push([i,r,{row:o.top,col:o.left}])}for(const[i,r,l]of n){const o=[...s,i],f=K(r),h=placeKey(l.row,l.col);e.keys.set(h,i),f.value===null&&f.formula===void 0&&e.blanks.add(h),this.typed(e,l.row,l.col,f,{file:k(o),path:o});const d=r!==null&&typeof r=="object"?r.name:void 0;d!==void 0&&this.cellName(e,l,d,o)}}cellName(e,t,s,n){if(!validName(s)){this.yaml(n,`${s} cannot be a name`);return}if(this.wb.name(s)){this.yaml(n,`two places are named ${s}`);return}const i={file:k(n),path:n},r=U(t).replace(/^([A-Z]+)(\d+)$/u,"$$$1$$$2"),l=`='${e.name.replaceAll("'","''")}'!${r}`;this.wb.names.set(s.toLowerCase(),{name:s,formula:new SharedFormula(l,0,0,i),source:i})}fill(e,t,s,n){const i=K(s),r={file:k(n),path:n};e.fills.push(i.formula===void 0?{area:t,value:i.value,...i.format===void 0?{}:{format:i.format}}:{area:t,shared:new SharedFormula(i.formula,t.top,t.left,r),...i.start===void 0?{}:{start:i.start}})}}function W(a,e,t,s){const n=A(a.at);if(!n){s([...t,"at"],`${a.at} is not a cell`);return}const i=(o,f)=>{const h=new SharedFormula(chartFormula(o),0,0,{file:k(f),path:f});return h.node&&!I(h.node)&&s(f,`${o} is not a range or a table's column`),h},r=(o,f)=>o?.startsWith("=")===!0?i(o,f):void 0,l=r(a.title,[...t,"title"]);return{spec:a,at:n,index:e,...a.categories===void 0?{}:{categories:i(a.categories,[...t,"categories"])},...l?{title:l}:{},series:a.series.map((o,f)=>{const h=[...t,"series",f],d=r(o.name,[...h,"name"]);return{values:i(o.values,[...h,"values"]),...o.x===void 0?{}:{x:i(o.x,[...h,"x"])},...d?{name:d}:{}}})}}export const chartFormula=a=>a.startsWith("=")?a:`=${a}`;function I(a){switch(a.kind){case"error":case"ref":case"structured":case"name":return!0;case"paren":case"postfix":return I(a.arg);case"binary":return a.op===":"||a.op===",";default:return!1}}export const runsText=a=>a.map(e=>e.text).join("");function K(a){if(a===null)return{value:null};if(typeof a=="string")return x(a);if(typeof a!="object")return{value:a};if(a.formula!==void 0)return{value:null,formula:a.formula.startsWith("=")?a.formula:`=${a.formula}`,...a.start===void 0?{}:{start:typeof a.start=="string"?x(a.start).value:a.start}};if(a.runs!==void 0)return{value:runsText(a.runs)};const{value:e}=a;return typeof e=="string"?x(e):{value:e??null}}export function readWorkbook(a){const e=G(a.text),t=l=>l[0]===M?void 0:e.lineOf(l);if(!e.file)return{problems:e.problems,lineOf:t};const s=O(e.file,a.generated),n=new Workbook(s.file,a.generated);n.ordinary=s.ordinary;const i=[],r=new N(n,l=>{const o=a.generated?.csv[l]??a.read(l);if(o===void 0)return;const f=_(o);for(const h of f.problems)i.push({file:l,line:h.line,message:h.message});return{rows:f.records.map(h=>h.end===h.start?[]:h.fields),lines:f.records.map(h=>h.line)}},t,s.own,s.names);return r.read(),{workbook:n,problems:[...i,...r.problems],lineOf:t}}export function workbookOf(a){const e=O(a.file,a.generated),t=new Workbook(e.file,a.generated);return t.ordinary=e.ordinary,new N(t,s=>{const n=a.generated?.csv[s];if(n!==void 0)return{rows:_(n).records.map(r=>r.end===r.start?[]:r.fields),lines:[]};const i=a.rows(s);return i&&{rows:i,lines:[]}},()=>{},e.own,e.names).read(),t}export{D as rangeName};
2
+ import{OPENPYXL_CELL_STYLE_NAMES as J,SHEET_CELL_STYLES as z,SHEET_SEPARATOR as Q,OFFICE_COLORS as ee,blockKindOf as R,colorsOfTheme as N,nearest as te,spelledAs as F}from"@allyhub/formats";import{heatmapCondition as se}from"./heatmap.js";import{sparklineCells as ne}from"./sparklines.js";import{MAX_ROWS as oe,cellName as W,columnIndex as I,columnLetter as K,contains as k,overlaps as O,rangeName as ie,readAddress as E,readArea as $,readAreas as P}from"./address.js";import{readCsv as B}from"@allyhub/formats";import{CODE as H,ENTRY as A,readSheetFile as re,sizeSaid as L}from"./file.js";import{cellStyleLook as Y}from"./cell-styles.js";import{lookInTheme as le,themeOrder as U}from"./theme.js";import{columnWidth as ae,rowHeight as fe}from"./paginate.js";import{withGenerated as M}from"./generated.js";import{moveFormula as ce,relativeKey as he}from"./formula/move.js";import{parseFormula as de}from"./formula/parse.js";import{printFormula as ue}from"./formula/print.js";import{readTyped as S}from"./values.js";export class SharedFormula{node;error;analysis;text;row;col;atRow;atCol;source;constructor(e,t,s,n,o){this.text=e,this.atRow=t,this.atCol=s,this.source=n;const r=de(e);if(!r.ok){this.error=r.error,this.row=t,this.col=s;return}const l=o===void 0||!me(r.node)?void 0:he(r.node,t,s),i=l===void 0?void 0:o?.get(l);if(i){this.node=i.node,this.row=i.row,this.col=i.col;return}this.node=r.node,this.row=t,this.col=s,l!==void 0&&o?.set(l,{node:r.node,row:t,col:s})}}function me(a){let e=!0;const t=s=>{if(!e||s===null||typeof s!="object")return;const n=s;if(n.kind==="call"&&typeof n.name=="string"&&n.name.toUpperCase()==="TABLE"){e=!1;return}for(const o of Object.values(s))if(Array.isArray(o))for(const r of o)t(r);else o!==null&&typeof o=="object"&&t(o)};return t(a),e}export class FormulaCell{value=null;array;spill;blocked;state=1;mark=0;shared;sheet;row;col;constructor(e,t,s,n){this.shared=e,this.sheet=t,this.row=s,this.col=n}get moved(){const{node:e,row:t,col:s}=this.shared;if(!e)throw new Error(`${this.shared.text} does not parse.`);return ce(e,this.row-t,this.col-s)}get text(){const{node:e,text:t,atRow:s,atCol:n}=this.shared;return!e||s===this.row&&n===this.col?t:ue(this.moved)}}class pe{columns=[];firsts=[];lasts=[];formulas=[];get(e,t){return this.columns[t]?.[e]}set(e,t,s){let n=this.columns[t];n||(n=[],this.columns[t]=n,this.firsts[t]=e,this.lasts[t]=e),n[e]instanceof FormulaCell&&(this.formulas[t]=(this.formulas[t]??1)-1),s instanceof FormulaCell&&(this.formulas[t]=(this.formulas[t]??0)+1),n[e]=s,e<(this.firsts[t]??e)&&(this.firsts[t]=e),e>(this.lasts[t]??e)&&(this.lasts[t]=e)}get width(){return this.columns.length}holds(e,t,s){const n=Math.min(e.right,this.columns.length-1);for(let o=e.left;o<=n;o++){const r=this.columns[o];if(!r)continue;const l=Math.min(e.bottom,this.last(o));for(let i=Math.max(e.top,this.first(o));i<=l;i++)if(r[i]!==void 0&&!(i===t&&o===s))return!0}return!1}first(e){return this.firsts[e]??1/0}last(e){return this.lasts[e]??-1}hasFormulas(e){return(this.formulas[e]??0)>0}}export class Table{columns=[];rows=0;lines=[];places=[];records=[];name;sheet;at;file;spec;constructor(e,t,s,n,o){this.name=e,this.sheet=t,this.at=s,this.file=n,this.spec=o}get area(){return{top:this.at.row,left:this.at.col,bottom:this.at.row+this.rows,right:this.at.col+Math.max(this.columns.length,1)-1}}get data(){const e=this.area;return{...e,top:e.top+1}}column(e){const t=e.toLowerCase();return this.columns.find(s=>s.name.toLowerCase()===t)}}export const placeKey=(a,e)=>a*16384+e;function V(a,e){a.bottom=Math.max(a.bottom,e.bottom),a.right=Math.max(a.right,e.right);for(let t=e.left;t<=e.right;t++){const s=a.columns.get(t);a.columns.set(t,[Math.min(s?.[0]??e.top,e.top),Math.max(s?.[1]??e.bottom,e.bottom)])}}export class Worksheet{tables=[];blocks=[];merges=[];formulas=new Set;implied=new Map;keys=new Map;fills=[];blanks=new Set;conditions=[];validations=[];filters=[];charts=[];tiles=[];sparklines=[];names=new Map;freeze;generated=!1;grid=new pe;expanded=!1;lowest=-1;ghosts=new Map;spills=new Set;stopped=new Set;reach;lookAreas;name;index;spec;book;constructor(e,t,s){this.name=e,this.index=t,this.spec=s}respec(e){const t=e.charts!==this.spec.charts;this.spec=e,this.lookAreas=void 0,t&&(this.charts.length=0,e.charts?.forEach((s,n)=>{const o=chartOf(_(this,s),n,[],()=>{});o&&this.charts.push(o)}))}put(e,t,s){s instanceof FormulaCell&&this.formulas.add(s),this.grid.set(e,t,s),e>this.lowest&&(this.lowest=e)}replace(e,t,s){this.expand();const n=this.grid.get(e,t);n instanceof FormulaCell&&this.formulas.delete(n),s instanceof FormulaCell&&this.formulas.add(s),this.grid.set(e,t,s),e>this.lowest&&(this.lowest=e)}expand(){if(!this.expanded){this.expanded=!0;for(let e=this.fills.length-1;e>=0;e--){const t=this.fills[e];if(!t)continue;const{area:s,shared:n,value:o,format:r,start:l}=t;for(let i=s.top;i<=s.bottom;i++)for(let f=s.left;f<=s.right;f++)if(this.grid.get(i,f)===void 0&&!this.blanks.has(placeKey(i,f)))if(n){const c=new FormulaCell(n,this,i,f);l!==void 0&&(c.value=l),this.put(i,f,c)}else o!=null&&(this.put(i,f,o),r!==void 0&&this.implied.set(placeKey(i,f),r))}}}at(e,t){return this.expand(),this.grid.get(e,t)}spillAt(e,t){return this.ghosts.size===0?void 0:this.ghosts.get(placeKey(e,t))}holds(e,t){return this.expand(),this.grid.holds(e,t.row,t.col)}spillsIn(e){if(this.spills.size===0)return[];if((e.bottom-e.top+1)*(e.right-e.left+1)>=this.spills.size)return[...this.spills].filter(n=>n.spill!==void 0&&O(n.spill,e));const s=new Set;for(let n=e.top;n<=e.bottom;n++)for(let o=e.left;o<=e.right;o++){const r=this.ghosts.get(placeKey(n,o));r&&s.add(r)}return[...s]}blockedBy(e){if(this.stopped.size===0)return[];const t=[];for(const s of this.stopped)s.blocked&&O(s.blocked,e)&&t.push(s);return t}placeSpill(e,t){e.spill=t,this.spills.add(e);for(let s=t.top;s<=t.bottom;s++)for(let n=t.left;n<=t.right;n++)(s!==e.row||n!==e.col)&&this.ghosts.set(placeKey(s,n),e);this.reach&&V(this.reach,t)}blockSpill(e,t){e.blocked=t,this.stopped.add(e)}clearSpill(e){const t=e.spill;if(t)for(let s=t.top;s<=t.bottom;s++)for(let n=t.left;n<=t.right;n++)this.ghosts.get(placeKey(s,n))===e&&this.ghosts.delete(placeKey(s,n));e.spill=void 0,e.blocked=void 0,this.spills.delete(e),this.stopped.delete(e)}clearSpills(){for(const e of[...this.spills,...this.stopped])e.spill=void 0,e.blocked=void 0;this.spills.clear(),this.stopped.clear(),this.ghosts.clear(),this.reach=void 0}tighten(){this.reach=void 0}spillReach(){if(this.reach)return this.reach;const e={columns:new Map,bottom:-1,right:-1};for(const{spill:t}of this.spills)t&&V(e,t);return this.reach=e,e}hasFormulas(e){return this.expand(),this.grid.hasFormulas(e)}span(e,t,s){this.expand();const n=this.grid.first(e),o=this.grid.last(e);if(this.spills.size===0)return[Math.max(t,n),Math.min(s,o)];const[r,l]=this.spillReach().columns.get(e)??[1/0,-1];return[Math.max(t,Math.min(n,r)),Math.min(s,Math.max(o,l))]}get columnsUsed(){return this.expand(),this.spills.size===0?this.grid.width:Math.max(this.grid.width,this.spillReach().right+1)}get lastRow(){return this.expand(),this.spills.size===0?this.lowest:Math.max(this.lowest,this.spillReach().bottom)}get used(){const e=this.lastRow,t=this.columnsUsed-1;return e<0||t<0?void 0:{top:0,left:0,bottom:e,right:t}}tableAt(e,t){return this.tables.find(s=>k(s.area,e,t))}blockAt(e,t){return this.blocks.find(s=>k(s.area,e,t))}looks(){if(this.lookAreas)return this.lookAreas;const e=[];for(const s of this.spec.format??[]){const n=$(s.range);n&&e.push({area:n,entry:s})}const t=[];for(const[s,n]of Object.entries(this.spec.cells??{})){if(!s.includes(":")||n===null||typeof n!="object")continue;const o=$(s);o&&t.push({area:o,entry:n})}return this.lookAreas={formats:e,ranges:t},this.lookAreas}styledAreas(){const{formats:e,ranges:t}=this.looks();return[...e,...t.filter(s=>Object.keys(s.entry).some(n=>D.has(n)))]}lookAt(e,t){const s={},n=h=>{if(!h)return;const g=h.style;typeof g=="string"&&n(this.styleLook(g));for(const[w,y]of Object.entries(h))D.has(w)&&y!==void 0&&(s[w]=w==="border"?{...s.border,...y}:y)},o=this.implied.get(placeKey(e,t));o!==void 0&&(s.format=o);const r=this.ghosts.size===0?void 0:this.spillAt(e,t),l=r&&this.lookAt(r.row,r.col).format;l!==void 0&&(s.format=l),this.spec.columns&&n(this.spec.columns[K(t)]),this.spec.rows&&n(this.spec.rows[String(e+1)]);const i=this.tableAt(e,t);i&&e>i.at.row&&n(i.columns[t-i.at.col]?.spec);const{formats:f,ranges:c}=this.looks();for(const h of f)k(h.area,e,t)&&n(h.entry);for(const h of c)k(h.area,e,t)&&n(h.entry);const u=this.keys.get(placeKey(e,t)),m=u===void 0?void 0:this.spec.cells?.[u];if(m!==null&&typeof m=="object"&&n(m),s.border){const h=Object.entries(s.border).filter(([,g])=>g?.style!=="none");h.length===0?delete s.border:s.border=Object.fromEntries(h)}return X(s,this.book?.colors)}styleLook(e){if(this.book)return this.book.styleLook(e);const t=C(e,void 0);return t&&"builtin"in t?Y(t.builtin):void 0}runsAt(e,t){const s=this.keys.get(placeKey(e,t)),n=s===void 0?void 0:this.spec.cells?.[s];return n!==null&&typeof n=="object"?n.runs:void 0}mergeAt(e,t){return this.merges.find(s=>k(s,e,t))}validationAt(e,t){return this.validations.find(s=>s.areas.some(n=>k(n,e,t)))}filterHeadAt(e,t){return this.filters.find(s=>e===s.area.top&&t>=s.area.left&&t<=s.area.right)}filterAt(e,t){return this.filters.find(s=>k(s.area,e,t))}filesAt(e,t){const s=this.tableAt(e,t);if(s&&e>s.at.row){const n=s.columns[t-s.at.col]?.spec?.files;if(n!==void 0)return n}return s?.at.row===e?void 0:this.spec.columns?.[K(t)]?.files}}export const filesSeparator=a=>(typeof a=="object"?a.separator:void 0)??Q;export function filesIn(a,e){const t=filesSeparator(e);return a.split(t.trim()===""?t:t.trim()).map(s=>s.trim()).filter(s=>s!=="")}function X(a,e){const t=o=>typeof o=="string"&&!o.startsWith("#"),s=a.fill;return t(a.color)||t(s)||typeof s=="object"&&(t(s.color)||t(s.background))||Object.values(a.border??{}).some(o=>t(o?.color))?le(a,e??ee):a}function C(a,e){if(e&&a in e)return{own:a};const t=e?F(a,Object.keys(e)):void 0;if(t!==void 0)return{own:t};const s=F(a,z);return s===void 0?void 0:{builtin:J[s]??s}}const D=new Set(["style","bold","italic","underline","strike","font","size","color","fill","align","valign","wrap","shrink","indent","rotation","border","locked","hide_formula","format"]);export class Workbook{title;sheets=[];names=new Map;checks=[];bySheet=new Map;byTable=new Map;file;generated;ordinary=[];colors;themeOrder;projectTheme;constructor(e,t,s){this.file=e,this.title=e.title,this.generated=t,this.projectTheme=s,this.colors=N(this.theme),this.themeOrder=U(this.colors)}get theme(){return this.file.theme??this.projectTheme}respec(e){this.file=M(e,this.generated).file,this.title=e.title,this.colors=N(this.theme),this.themeOrder=U(this.colors),this.sheets.forEach(t=>{const s=e.sheets.find(n=>n.name===t.name);s&&t.respec(s)})}sheet(e){return this.bySheet.get(e.toLowerCase())}styleLook(e,t=0){const s=this.file.styles,n=C(e,s);if(!n)return;if("builtin"in n)return Y(n.builtin,this.colors);const o=s?.[n.own];if(o){const l={...o.style!==void 0&&o.style!==e&&t<8?this.styleLook(o.style,t+1):void 0};for(const[i,f]of Object.entries(o))i!=="style"&&f!==void 0&&(l[i]=i==="border"?{...l.border,...f}:f);return X(l,this.colors)}}styleNamed(e){return C(e,this.file.styles)}table(e){return this.byTable.get(e.toLowerCase())}name(e,t){const s=e.toLowerCase();return(t?.names.size?t.names.get(s):void 0)??this.names.get(s)}definitions(e){const t=e.toLowerCase(),s=[],n=this.names.get(t);n&&s.push(n);for(const o of this.sheets){const r=o.names.get(t);r&&s.push(r)}return s}get tables(){return[...this.byTable.values()]}addSheet(e){e.book=this,this.sheets.push(e),this.bySheet.set(e.name.toLowerCase(),e)}addTable(e){e.sheet.tables.push(e),this.byTable.set(e.name.toLowerCase(),e)}sourceOf(e,t,s){if(e.generated)return{file:H};const n=this.sheets.indexOf(e),o=e.tableAt(t,s);if(o){const i=o.columns[s-o.at.col],f=t-o.at.row-1,c=i?.csv!==void 0&&(o.records[f]?.[i.csv]??"")!=="";return f>=0&&i?.formula&&!c?i.formula.source:{file:o.file,line:f<0?1:o.lines[f]??1}}const r=e.blockAt(t,s);if(r)return{file:r.file,line:r.lines[t-r.area.top]??1};const l=e.keys.get(placeKey(t,s));if(l!==void 0)return{file:A,path:["sheets",n,"cells",l]};for(const i of Object.keys(e.spec.cells??{})){if(!i.includes(":"))continue;const f=$(i);if(f&&k(f,t,s))return{file:A,path:["sheets",n,"cells",i]}}}}export const CSV_FILE_MOST=60*1e3*1e3,CSV_WORKBOOK_MOST=150*1e3*1e3,MAX_FILL_CELLS=5e6;const be=/^[\p{L}_\\][\p{L}\p{N}_.\\?]*$/u;export function validName(a){return be.test(a)&&E(a)===void 0&&!/^(?:TRUE|FALSE)$/iu.test(a)&&!/^[Rr](?:\d+)?(?:[Cc]\d*)?$/u.test(a)&&!/^[Cc]\d*$/u.test(a)}const j="made",v=a=>a[0]===j?H:A;function ge(a){let e=a.length;for(;e>1&&(a[e-1]??"").trim()==="";)e--;return a.slice(0,e)}class G{problems=[];wb;read_;lineOf;own;madeNames;trees=new Map;unread=new Set;constructor(e,t,s,n,o){this.wb=e,this.read_=t,this.lineOf=s,this.own=n,this.madeNames=o}yaml(e,t){const s=this.lineOf(e);this.problems.push({file:v(e),...s===void 0?{}:{line:s},message:t})}sheetPath(e){return e<this.own?["sheets",e]:[j,"sheets",e-this.own]}read(){const{file:e}=this.wb;e.sheets.forEach((t,s)=>{const n=this.sheetPath(s);if(this.wb.sheet(t.name)){this.yaml([...n,"name"],`two sheets are named ${t.name}`);return}(/[\\/?*[\]:]/u.test(t.name)||t.name.length>31)&&this.yaml([...n,"name"],`${t.name} cannot be a sheet's name: at most 31 characters, none of \\ / ? * [ ] :`);const o=new Worksheet(t.name,this.wb.sheets.length,t);o.generated=s>=this.own,this.wb.addSheet(o)}),this.names();for(const[t,s]of e.sheets.entries()){const n=this.wb.sheets[t];n?.spec===s&&this.sheet(n,this.sheetPath(t))}this.styles(),e.checks?.forEach((t,s)=>{const n={file:A,path:["checks",s,"formula"]};this.wb.checks.push({name:t.name,formula:new SharedFormula(t.formula,0,0,n),source:n})})}styles(){const{file:e}=this.wb,t=Object.keys(e.styles??{}),s=(n,o)=>{if(o===null||typeof o!="object")return;const r=o.style;if(typeof r!="string"||this.wb.styleNamed(r))return;const l=te(r,[...t,...z]);this.yaml([...n,"style"],`${r} is no cell style${l===void 0?"":`: did you mean "${l}"?`} A style is one of Excel's (Heading 1, Input, Total, 20% - Accent1…) or one \`styles\` defines`)};for(const[n,o]of Object.entries(e.styles??{}))s(["styles",n],o);e.sheets.forEach((n,o)=>{if(o>=this.own)return;const r=["sheets",o];for(const[l,i]of Object.entries(n.cells??{}))s([...r,"cells",l],i);n.format?.forEach((l,i)=>{s([...r,"format",i],l)});for(const[l,i]of Object.entries(n.columns??{}))s([...r,"columns",l],i);for(const[l,i]of Object.entries(n.rows??{}))s([...r,"rows",l],i);n.tables?.forEach((l,i)=>{for(const[f,c]of Object.entries(l.columns??{}))s([...r,"tables",i,"columns",f],c)})})}names(){const{file:e}=this.wb;this.namesOf(e.names,e.hidden_names,t=>this.madeNames.has(t)?[j,"names",t]:["names",t],this.wb.names,void 0),e.sheets.forEach((t,s)=>{const n=this.wb.sheets[s];n?.spec===t&&this.namesOf(t.names,t.hidden_names,o=>[...this.sheetPath(s),"names",o],n.names,n)})}namesOf(e,t,s,n,o){const r=new Set(t?.map(l=>l.toLowerCase()));for(const[l,i]of Object.entries(e??{})){const f=s(l);if(!validName(l)){this.yaml(f,`${l} cannot be a name`);continue}const c={file:v(f),path:f},u=typeof i=="string"&&i.startsWith("=")?{name:l,formula:new SharedFormula(i,0,0,c),source:c}:{name:l,value:typeof i=="string"?S(i).value:i,source:c};o&&(u.sheet=o),r.has(l.toLowerCase())&&(u.hidden=!0),n.set(l.toLowerCase(),u)}}sheet(e,t){const{spec:s}=e;if(s.freeze!==void 0){const n=E(s.freeze);n?e.freeze=n:this.yaml([...t,"freeze"],`${s.freeze} is not a cell`)}s.tables?.forEach((n,o)=>{this.table(e,n,[...t,"tables",o])});for(const[n,o]of e.tables.entries())for(const r of e.tables.slice(n+1))O(o.area,r.area)&&this.problems.push({file:A,message:`tables ${o.name} and ${r.name} overlap on ${e.name}`});s.blocks?.forEach((n,o)=>{this.block(e,n.at,n.rows,[...t,"blocks",o])}),this.cells(e,s.cells??{},[...t,"cells"]),s.merges?.forEach((n,o)=>{const r=$(n);r?e.merges.push(r):this.yaml([...t,"merges",o],`${n} is not a range`)}),s.format?.forEach((n,o)=>{$(n.range)||this.yaml([...t,"format",o,"range"],`${n.range} is not a range`)}),s.conditional?.forEach((n,o)=>{this.condition(e,n,[...t,"conditional",o])}),s.validations?.forEach((n,o)=>{this.validation(e,n,[...t,"validations",o])}),this.filters(e,t),s.charts?.forEach((n,o)=>{this.chart(e,n,o,[...t,"charts",o])}),s.tiles?.forEach((n,o)=>{const r=_(e,n),l=Object.keys(n).find(f=>R(f)!==void 0);if(l!==void 0&&R(l)==="heatmap"){const f=se(n.at,n[l],this.wb.colors);for(const c of f.problems)this.yaml([...t,"tiles",o,l],c);f.rule&&this.condition(e,f.rule,[...t,"tiles",o,"at"]);return}const i=E(r.at);i?l!==void 0&&e.tiles.push({spec:r,at:i,index:o,kind:l}):this.yaml([...t,"tiles",o,"at"],`${n.at} is not a cell`)}),s.sparklines?.forEach((n,o)=>{const r=ne(e.name,n);r.cells?e.sparklines.push({spec:n,index:o,cells:r.cells}):this.yaml([...t,"sparklines",o],r.problem??"not a sparkline")});for(const n of Object.keys(s.columns??{}))I(n)===void 0&&this.yaml([...t,"columns",n],`${n} is not a column`);for(const n of Object.keys(s.rows??{}))(!/^[1-9]\d*$/u.test(n)||Number(n)>oe)&&this.yaml([...t,"rows",n],`${n} is not a row`)}chart(e,t,s,n){const o=chartOf(_(e,t),s,n,(r,l)=>{this.yaml(r,l)});o&&e.charts.push(o)}bound(e,t,s){if(!(typeof e!="string"||!e.startsWith("=")||e.length<2))return new SharedFormula(e,t?.top??0,t?.left??0,{file:v(s),path:s})}condition(e,t,s){const n=P(t.range);if(!n){this.yaml([...s,"range"],`${t.range} is not a range`);return}const[o]=n,r=[],l=(i,f)=>{const c=this.bound(i,o,f);c&&r.push(c)};if(t.type==="expression"){const i=t.formula.startsWith("=")?t.formula:`=${t.formula}`;l(i,[...s,"formula"])}if(t.type==="cellIs"&&t.formula.forEach((i,f)=>{l(i,[...s,"formula",f])}),t.type==="dataBar")for(const i of["min","max"])l(t[i]?.value,[...s,i,"value"]);(t.type==="colorScale"||t.type==="iconSet")&&t.stops?.forEach((i,f)=>{l(i.value,[...s,"stops",f,"value"])}),e.conditions.push({spec:t,areas:n,formulas:r})}validation(e,t,s){const n=P(t.range);if(!n){this.yaml([...s,"range"],`${t.range} is not a range`);return}const o=(t.formula??[]).map((i,f)=>this.bound(i,n[0],[...s,"formula",f])),r=t.formula?.length??0,l=t.type!=="list"&&t.type!=="custom"&&(t.operator===void 0||t.operator==="between"||t.operator==="notBetween");!(t.type==="list"&&t.values!==void 0)&&r<(l?2:1)&&this.yaml(s,`a ${t.type} validation needs its bounds`),e.validations.push({spec:t,areas:n,formulas:o})}filters(e,t){const{spec:s}=e;if(s.filter){const n=[...t,"filter"],o=$(s.filter.range);if(!o)this.yaml([...n,"range"],`${s.filter.range} is not a range`);else{const r=new Map;for(const[i,f]of Object.entries(s.filter.columns??{})){const c=I(i);c===void 0||c<o.left||c>o.right?this.yaml([...n,"columns",i],`${i} is not a column of ${s.filter.range}`):r.set(c,f)}const l=e.tables.find(i=>O(i.area,o));l&&this.yaml(n,`a filter over table ${l.name}: a table has its own`),e.filters.push({area:o,columns:r})}}e.tables.forEach((n,o)=>{const{filter:r}=n.spec;if(r===!1)return;const l=new Map;for(const[i,f]of Object.entries(r?.columns??{})){const c=n.column(i);c?l.set(n.at.col+c.index,f):this.unread.has(n)||this.yaml([...t,"tables",o,"filter","columns",i],`table ${n.name} has no column ${i}`)}e.filters.push({area:n.area,table:n,columns:l})})}csv(e,t,s){const n=this.read_(e);return n||this.yaml(t,`${s}: ${e} is not there, from this file's folder or from the project's root`),n}overlapping(e,t){const s=e.tables.find(o=>O(o.area,t));if(s)return`table ${s.name}`;const n=e.blocks.find(o=>O(o.area,t));return n?`the block of ${n.file}`:void 0}typed(e,t,s,n,o){if(n.formula!==void 0){const r=new SharedFormula(n.formula,t,s,o,this.trees),l=new FormulaCell(r,e,t,s);n.start!==void 0&&(l.value=n.start),e.put(t,s,l);return}n.value!==null&&(e.put(t,s,n.value),n.format!==void 0&&e.implied.set(placeKey(t,s),n.format))}table(e,t,s){const n=E(t.at);if(!n){this.yaml([...s,"at"],`${t.at} is not a cell`);return}if(!validName(t.name)){this.yaml([...s,"name"],`${t.name} cannot be a table's name`);return}if(this.wb.table(t.name)){this.yaml([...s,"name"],`two tables are named ${t.name}`);return}this.wb.name(t.name)&&this.yaml([...s,"name"],`${t.name} is a defined name and a table's`);const o=new Table(t.name,e,n,t.rows,t),r=this.csv(t.rows,[...s,"rows"],`table ${t.name}`),l=r?.rows??[],i=r?.lines??[],f=l[0],c=i[0]??1,u=new Set,m=ge(f??[]),h=f?.length===0?[""]:l.slice(1).every(d=>d.slice(m.length).every(p=>p.trim()===""))?m:f??[];h.forEach((d,p)=>{const b=d.trim();b===""&&this.problems.push({file:t.rows,line:c,message:`column ${String(p+1)} has no name`}),u.has(b.toLowerCase())&&this.problems.push({file:t.rows,line:c,message:`two columns are named ${b}`}),u.add(b.toLowerCase()),o.columns.push({name:b,index:o.columns.length,csv:p})});for(const[d,p]of Object.entries(t.columns??{})){const b=o.column(d),x=b??{name:d,index:o.columns.length};b||(p.formula===void 0&&r&&this.yaml([...s,"columns",d],`table ${t.name} has no column ${d}`),o.columns.push(x)),x.spec=p}const g=h.length;for(let d=1;d<l.length;d++){const p=l[d];if(!p||p.length===0)continue;const b=i[d]??d+1;o.places.push(d),o.records.push(p),o.lines.push(b),p.slice(g).some(x=>x.trim()!=="")&&this.problems.push({file:t.rows,line:b,message:`this row has ${String(p.length)} fields and the header ${String(g)}`})}o.rows=o.records.length;const w=this.overlapping(e,o.area);w&&this.yaml(s,`table ${t.name} overlaps ${w} on ${e.name}`),this.wb.addTable(o),r?this.tableKey(o,s):this.unread.add(o);const y=n.row+1;o.columns.forEach(d=>{const p=n.col+d.index;e.put(n.row,p,d.name);const b=d.spec?.formula;b!==void 0&&(d.formula=new SharedFormula(b,y,p,{file:v(s),path:[...s,"columns",d.name,"formula"]}),o.rows>0&&e.fills.push({area:{top:y,left:p,bottom:y+o.rows-1,right:p},shared:d.formula})),d.csv!==void 0&&o.records.forEach((x,T)=>{this.typed(e,y+T,p,S(x[d.csv??0]??""),{file:t.rows,line:o.lines[T]??1})})})}tableKey(e,t){const{key:s}=e.spec;if(s===void 0)return;const n=e.column(s);if(n?.csv===void 0){this.yaml([...t,"key"],`table ${e.name} has no column ${s} in ${e.file}`);return}const o=new Set;e.records.forEach((r,l)=>{const i=r[n.csv??0]??"",f=e.lines[l]??1;i===""?this.problems.push({file:e.file,line:f,message:`this row has no ${s}, table ${e.name}'s key`}):o.has(i)&&this.problems.push({file:e.file,line:f,message:`two rows have the key ${i}`}),o.add(i)})}block(e,t,s,n){const o=E(t);if(!o){this.yaml([...n,"at"],`${t} is not a cell`);return}const r=this.csv(s,[...n,"rows"],"a block");if(!r)return;const l=r.rows,i=l.map((m,h)=>r.lines[h]??h+1),f=l.reduce((m,h)=>Math.max(m,h.length),1),c={top:o.row,left:o.col,bottom:o.row+Math.max(l.length,1)-1,right:o.col+f-1},u=this.overlapping(e,c);u&&this.yaml(n,`the block of ${s} overlaps ${u} on ${e.name}`),e.blocks.push({area:c,file:s,lines:i}),l.forEach((m,h)=>{m.forEach((g,w)=>{this.typed(e,o.row+h,o.col+w,S(g),{file:s,line:i[h]??h+1})})})}cells(e,t,s){const n=[];for(const[o,r]of Object.entries(t)){const l=[...s,o],i=$(o);if(!i){this.yaml(l,`${o} is not a cell or a range`);continue}const f=this.overlapping(e,i);if(f&&this.yaml(l,`${o} overlaps ${f}`),o.includes(":")){const c=(i.bottom-i.top+1)*(i.right-i.left+1);c>MAX_FILL_CELLS?this.yaml(l,`${o} is ${String(c)} cells`):(r!==null&&typeof r=="object"&&r.runs&&this.yaml([...l,"runs"],`${o} is a range: runs are one cell's`),this.fill(e,i,r,l))}else n.push([o,r,{row:i.top,col:i.left}])}for(const[o,r,l]of n){const i=[...s,o],f=q(r),c=placeKey(l.row,l.col);e.keys.set(c,o),f.value===null&&f.formula===void 0&&e.blanks.add(c),this.typed(e,l.row,l.col,f,{file:v(i),path:i});const u=r!==null&&typeof r=="object"?r.name:void 0;u!==void 0&&this.cellName(e,l,u,i)}}cellName(e,t,s,n){if(!validName(s)){this.yaml(n,`${s} cannot be a name`);return}if(this.wb.name(s)){this.yaml(n,`two places are named ${s}`);return}const o={file:v(n),path:n},r=W(t).replace(/^([A-Z]+)(\d+)$/u,"$$$1$$$2"),l=`='${e.name.replaceAll("'","''")}'!${r}`;this.wb.names.set(s.toLowerCase(),{name:s,formula:new SharedFormula(l,0,0,o),source:o})}fill(e,t,s,n){const o=q(s),r={file:v(n),path:n};e.fills.push(o.formula===void 0?{area:t,value:o.value,...o.format===void 0?{}:{format:o.format}}:{area:t,shared:new SharedFormula(o.formula,t.top,t.left,r),...o.start===void 0?{}:{start:o.start}})}}function _(a,e){const t=e.at.includes(":")?$(e.at):void 0;if(!t)return e;let s=0;for(let o=t.left;o<=t.right;o++)s+=ae(a,o);let n=0;for(let o=t.top;o<=t.bottom;o++)n+=fe(a,o);return{...e,at:W({row:t.top,col:t.left}),width:e.width??s,height:e.height??n}}export function chartOf(a,e,t,s){const n=E(a.at);if(!n){s([...t,"at"],`${a.at} is not a cell`);return}const o=(i,f)=>{const c=new SharedFormula(chartFormula(i),0,0,{file:v(f),path:f});return c.node&&!Z(c.node)&&s(f,`${i} is not a range or a table's column`),c},r=(i,f)=>i?.startsWith("=")===!0?o(i,f):void 0,l=r(a.title,[...t,"title"]);return{spec:a,at:n,index:e,...a.categories===void 0?{}:{categories:o(a.categories,[...t,"categories"])},...l?{title:l}:{},series:a.series.map((i,f)=>{const c=[...t,"series",f],u=r(i.name,[...c,"name"]);return{values:o(i.values,[...c,"values"]),...i.x===void 0?{}:{x:o(i.x,[...c,"x"])},...i.sizes===void 0?{}:{sizes:o(i.sizes,[...c,"sizes"])},...u?{name:u}:{}}})}}export const chartFormula=a=>a.startsWith("=")?a:`=${a}`;function Z(a){switch(a.kind){case"error":case"ref":case"structured":case"name":return!0;case"paren":case"postfix":return Z(a.arg);case"binary":return a.op===":"||a.op===",";default:return!1}}export const runsText=a=>a.map(e=>e.text).join("");function q(a){if(a===null)return{value:null};if(typeof a=="string")return S(a);if(typeof a!="object")return{value:a};if(a.formula!==void 0)return{value:null,formula:a.formula.startsWith("=")?a.formula:`=${a.formula}`,...a.start===void 0?{}:{start:typeof a.start=="string"?S(a.start).value:a.start}};if(a.runs!==void 0)return{value:runsText(a.runs)};const{value:e}=a;return typeof e=="string"?S(e):{value:e??null}}export function readWorkbook(a){const e=re(a.text),t=f=>f[0]===j?void 0:e.lineOf(f),s=e.file??e.partial;if(!s)return{problems:e.problems,lineOf:t};const n=M(s,a.generated),o=new Workbook(n.file,a.generated,a.theme);o.ordinary=n.ordinary;const r=[];let l=0;const i=new G(o,f=>{const c=a.generated?.csv[f]??a.read(f);if(c===void 0)return;if(c.length>CSV_FILE_MOST)return r.push({file:f,line:1,message:`this file is ${L(c.length)}; a table's CSV over ${L(CSV_FILE_MOST)} is not read`}),{rows:[],lines:[]};if(l+c.length>CSV_WORKBOOK_MOST)return r.push({file:f,line:1,message:`with this file the workbook's tables are ${L(l+c.length)}; tables over ${L(CSV_WORKBOOK_MOST)} together are not read`}),{rows:[],lines:[]};l+=c.length;const u=B(c);for(const m of u.problems)r.push({file:f,line:m.line,message:m.message});return{rows:u.records.map(m=>m.end===m.start?[]:m.fields),lines:u.records.map(m=>m.line)}},t,n.own,n.names);return i.read(),{workbook:o,problems:[...e.problems,...r,...i.problems],lineOf:t}}export function workbookOf(a){const e=M(a.file,a.generated),t=new Workbook(e.file,a.generated,a.theme);return t.ordinary=e.ordinary,new G(t,s=>{const n=a.generated?.csv[s];if(n!==void 0)return{rows:B(n).records.map(r=>r.end===r.start?[]:r.fields),lines:[]};const o=a.rows(s);return o&&{rows:o,lines:[]}},()=>{},e.own,e.names).read(),t}export{ie as rangeName};
@@ -1,21 +1,21 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{Document as D,isMap as d,isScalar as Y,isSeq as l,parseDocument as I}from"yaml";const L=n=>Y(n.key)?String(n.key.value):void 0,F=96,J=n=>Y(n)&&!(typeof n.value=="string"&&/[\n\r]/u.test(n.value)),G=n=>J(n)||l(n)&&n.items.every(J),H=new Set(["","sheets[]","tables[]","cells","columns","rows","names","scenarios"]);function $(n,t){if(l(n)){for(const e of n.items)$(e,`${t}[]`);n.flow=n.items.every(J)}else if(d(n)){for(const e of n.items)$(e.value,L(e)??"");n.flow=!H.has(t)&&n.items.length>0&&n.items.every(e=>G(e.value)||d(e.value)&&e.value.flow===!0),n.flow&&new D(n).toString({lineWidth:0,flowCollectionPadding:!0}).length>F&&(n.flow=!1)}}const P={lineWidth:0,flowCollectionPadding:!0};export function writeYaml(n){const t=new D(n,{aliasDuplicateObjects:!1});$(t.contents,"");const e=t.toString(P);return e===`{}
3
- `?"":b(e)}function b(n){const t=I(n,{uniqueKeys:!1});if(t.errors.length>0)return n;const e=[];M(t.contents,r=>{if(!l(r)||!r.flow||!r.range)return;const[o,s]=r.range;if(n[o]!=="["||n[s-1]!=="]")return;const c=n.slice(o+1,s-1),u=/^ [^[\]{}"'\n]* $/u.test(c);(u||c.startsWith(" {"))&&n[o+1]===" "&&e.push(o+1),(u||c.endsWith("} "))&&n[s-2]===" "&&e.push(s-2)});let i=n;for(const r of[...new Set(e)].sort((o,s)=>s-o))i=i.slice(0,r)+i.slice(r+1);return i}function M(n,t){if(t(n),d(n))for(const e of n.items)M(e.key,t),M(e.value,t);else if(l(n))for(const e of n.items)M(e,t)}const T=n=>typeof n=="object"&&n!==null&&!Array.isArray(n);function m(n,t){if(n===t)return!0;if(Array.isArray(n)&&Array.isArray(t))return n.length===t.length&&n.every((r,o)=>m(r,t[o]));if(!T(n)||!T(t))return!1;const e=r=>Object.keys(r).filter(o=>r[o]!==void 0),i=e(n);return i.length===e(t).length&&i.every(r=>r in t&&m(n[r],t[r]))}function q(n,t,e,i,r){if(!m(t,e)){if(d(n)&&!n.flow&&T(t)&&T(e)){for(const o of new Set([...Object.keys(t),...Object.keys(e)])){const s=n.items.find(c=>L(c)===o)?.value;m(t[o],e[o])||q(s,t[o],e[o],[...i,o],r)}return}if(l(n)&&!n.flow&&Array.isArray(t)&&Array.isArray(e)&&e.length>0){const o=Math.min(t.length,e.length);let s=0;for(;s<o&&m(t[s],e[s]);)s++;let c=0;for(;c<o-s&&m(t[t.length-1-c],e[e.length-1-c]);)c++;const u=t.length-s-c,y=e.length-s-c,h=Math.min(u,y);for(let f=s;f<s+h;f++)q(n.items[f],t[f],e[f],[...i,f],r);for(let f=s+u-1;f>=s+h;f--)r.push({path:[...i,f],value:void 0});for(let f=s+h;f<s+y;f++)r.push({path:[...i,f],value:e[f],...c>0?{insert:!0}:{}});return}r.push({path:i,value:e})}}const A=(n,t)=>n.lastIndexOf(`
4
- `,t-1)+1,W=(n,t)=>{const e=n.indexOf(`
5
- `,t);return e<0?n.length:e+1},E=(n,t)=>n.split(`
2
+ import{asWritten as U}from"./units.js";import{Document as D,isMap as d,isScalar as E,isSeq as l,parseDocument as W}from"yaml";const I=n=>E(n.key)?String(n.key.value):void 0,G=96,J=n=>E(n)&&!(typeof n.value=="string"&&/[\n\r]/u.test(n.value)),H=n=>J(n)||l(n)&&n.items.every(J),Q=new Set(["","sheets[]","tables[]","cells","columns","rows","names","scenarios"]);function $(n,t){if(l(n)){for(const e of n.items)$(e,`${t}[]`);n.flow=n.items.every(J)}else if(d(n)){for(const e of n.items)$(e.value,I(e)??"");n.flow=!Q.has(t)&&n.items.length>0&&n.items.every(e=>H(e.value)||d(e.value)&&e.value.flow===!0),n.flow&&new D(n).toString({lineWidth:0,flowCollectionPadding:!0}).length>G&&(n.flow=!1)}}const P={lineWidth:0,flowCollectionPadding:!0};export function writeYaml(n){const t=new D(n,{aliasDuplicateObjects:!1});$(t.contents,"");const e=t.toString(P);return e===`{}
3
+ `?"":Y(e)}function Y(n){const t=W(n,{uniqueKeys:!1});if(t.errors.length>0)return n;const e=[];L(t.contents,r=>{if(!l(r)||!r.flow||!r.range)return;const[o,s]=r.range;if(n[o]!=="["||n[s-1]!=="]")return;const c=n.slice(o+1,s-1),u=/^ [^[\]{}"'\n]* $/u.test(c);(u||c.startsWith(" {"))&&n[o+1]===" "&&e.push(o+1),(u||c.endsWith("} "))&&n[s-2]===" "&&e.push(s-2)});let i=n;for(const r of[...new Set(e)].sort((o,s)=>s-o))i=i.slice(0,r)+i.slice(r+1);return i}function L(n,t){if(t(n),d(n))for(const e of n.items)L(e.key,t),L(e.value,t);else if(l(n))for(const e of n.items)L(e,t)}const M=n=>typeof n=="object"&&n!==null&&!Array.isArray(n);function m(n,t){if(n===t)return!0;if(Array.isArray(n)&&Array.isArray(t))return n.length===t.length&&n.every((r,o)=>m(r,t[o]));if(!M(n)||!M(t))return!1;const e=r=>Object.keys(r).filter(o=>r[o]!==void 0),i=e(n);return i.length===e(t).length&&i.every(r=>r in t&&m(n[r],t[r]))}function b(n,t,e,i,r){if(!m(t,e)){if(d(n)&&!n.flow&&M(t)&&M(e)){for(const o of new Set([...Object.keys(t),...Object.keys(e)])){const s=n.items.find(c=>I(c)===o)?.value;m(t[o],e[o])||b(s,t[o],e[o],[...i,o],r)}return}if(l(n)&&!n.flow&&Array.isArray(t)&&Array.isArray(e)&&e.length>0){const o=Math.min(t.length,e.length);let s=0;for(;s<o&&m(t[s],e[s]);)s++;let c=0;for(;c<o-s&&m(t[t.length-1-c],e[e.length-1-c]);)c++;const u=t.length-s-c,p=e.length-s-c,g=Math.min(u,p);for(let f=s;f<s+g;f++)b(n.items[f],t[f],e[f],[...i,f],r);for(let f=s+u-1;f>=s+g;f--)r.push({path:[...i,f],value:void 0});for(let f=s+g;f<s+p;f++)r.push({path:[...i,f],value:e[f],...c>0?{insert:!0}:{}});return}r.push({path:i,value:e})}}const A=(n,t)=>n.lastIndexOf(`
4
+ `,t-1)+1,T=(n,t)=>{const e=n.indexOf(`
5
+ `,t);return e<0?n.length:e+1},K=(n,t)=>n.split(`
6
6
  `).map((e,i)=>i===0||e===""?e:" ".repeat(t)+e).join(`
7
- `);function K(n,t,e,i){const r=new D({[n]:t},{aliasDuplicateObjects:!1}),o=r.contents;$(o,"");const s=o.items[0];return(d(i)||l(i))&&(d(s?.value)||l(s?.value))&&(s.value.flow=i.flow??!1),E(b(r.toString(P).replace(/\n$/,"")),e)}function _(n,t,e){const i=new D([n],{aliasDuplicateObjects:!1}),r=i.contents;return $(r,e),r.flow=!1,E(b(i.toString(P).replace(/\n$/,"")),t)}function Q(n,t){let e=n.contents;for(const i of t.slice(0,-1))if(d(e)){if(e.flow)return;e=e.items.find(r=>L(r)===String(i))?.value}else if(l(e)){if(e.flow)return;e=e.items[Number(i)]}else return;return d(e)||l(e)?e:void 0}function V(n,t){const e=t.items[0]?.range?.[0];if(e===void 0)return;const i=A(n,e),r=n.indexOf("-",i);return r>=0&&r<e?r-i:void 0}function X(n,t){const e=I(n);if(e.errors.length>0)return;const{path:i,value:r}=t,o=i[i.length-1],s=Q(e,i);if(o===void 0||!s||s.flow)return;if(l(s)){const g=Number(o),a=V(n,s);if(a===void 0)return;const p=s.items[g];if(r===void 0){const v=p?.range?.[0],S=p?.range?.[1];return v===void 0||S===void 0?void 0:n.slice(0,A(n,v))+n.slice(W(n,S-1))}if(t.insert===!0){const v=p?.range?.[0];if(v===void 0)return;const S=A(n,v);return`${n.slice(0,S)}${" ".repeat(a)}${_(r,a,String(i[i.length-2]))}
8
- ${n.slice(S)}`}if(p)return;const N=s.items[s.items.length-1]?.range?.[1];if(N===void 0)return;const j=n.charAt(N-1)===`
9
- `?N:W(n,N),B=j>0&&n.charAt(j-1)!==`
7
+ `);function _(n,t,e,i){const r=new D({[n]:t},{aliasDuplicateObjects:!1}),o=r.contents;$(o,"");const s=o.items[0];return(d(i)||l(i))&&(d(s?.value)||l(s?.value))&&(s.value.flow=i.flow??!1),K(Y(r.toString(P).replace(/\n$/,"")),e)}function z(n,t,e){const i=new D([n],{aliasDuplicateObjects:!1}),r=i.contents;return $(r,e),r.flow=!1,K(Y(i.toString(P).replace(/\n$/,"")),t)}function V(n,t){let e=n.contents;for(const i of t.slice(0,-1))if(d(e)){if(e.flow)return;e=e.items.find(r=>I(r)===String(i))?.value}else if(l(e)){if(e.flow)return;e=e.items[Number(i)]}else return;return d(e)||l(e)?e:void 0}function X(n,t){const e=t.items[0]?.range?.[0];if(e===void 0)return;const i=A(n,e),r=n.indexOf("-",i);return r>=0&&r<e?r-i:void 0}function Z(n,t){const e=W(n);if(e.errors.length>0)return;const{path:i,value:r}=t,o=i[i.length-1],s=V(e,i);if(o===void 0||!s||s.flow)return;if(l(s)){const h=Number(o),a=X(n,s);if(a===void 0)return;const y=s.items[h];if(r===void 0){const S=y?.range?.[0],v=y?.range?.[1];return S===void 0||v===void 0?void 0:n.slice(0,A(n,S))+n.slice(T(n,v-1))}if(t.insert===!0){const S=y?.range?.[0];if(S===void 0)return;const v=A(n,S);return`${n.slice(0,v)}${" ".repeat(a)}${z(r,a,String(i[i.length-2]))}
8
+ ${n.slice(v)}`}if(y)return;const N=s.items[s.items.length-1]?.range?.[1];if(N===void 0)return;const j=n.charAt(N-1)===`
9
+ `?N:T(n,N),F=j>0&&n.charAt(j-1)!==`
10
10
  `?`
11
- `:"";return`${n.slice(0,j)}${B}${" ".repeat(a)}${_(r,a,String(i[i.length-2]??""))}
12
- ${n.slice(j)}`}const c=String(o),u=s.items.find(g=>L(g)===c),y=u?.key,h=u?.value??void 0,C=s.items[0]?.key?.range?.[0],O=C===void 0?2*(i.length-1):C-A(n,C);if(u&&y?.range){const g=y.range[0],a=h?.range?h.range[1]:y.range[1];if(r===void 0)return n.slice(0,A(n,g))+n.slice(W(n,a-1));const p=n.charAt(a-1)===`
11
+ `:"";return`${n.slice(0,j)}${F}${" ".repeat(a)}${z(r,a,String(i[i.length-2]??""))}
12
+ ${n.slice(j)}`}const c=String(o),u=s.items.find(h=>I(h)===c),p=u?.key,g=u?.value??void 0,C=s.items[0]?.key?.range?.[0],O=C===void 0?2*(i.length-1):C-A(n,C);if(u&&p?.range){const h=p.range[0],a=g?.range?g.range[1]:p.range[1];if(r===void 0)return n.slice(0,A(n,h))+n.slice(T(n,a-1));const y=n.charAt(a-1)===`
13
13
  `?`
14
- `:"";return n.slice(0,g)+K(c,r,O,h)+p+n.slice(a)}if(r===void 0)return n;const R=K(c,r,O,void 0),U=s.items[s.items.length-1],w=(U?.value??U?.key)?.range?.[1];if(w===void 0){const g=n===""||n.endsWith(`
14
+ `:"";return n.slice(0,h)+_(c,r,O,g)+y+n.slice(a)}if(r===void 0)return n;const q=_(c,r,O,void 0),R=s.items[s.items.length-1],w=(R?.value??R?.key)?.range?.[1];if(w===void 0){const h=n===""||n.endsWith(`
15
15
  `)?"":`
16
- `;return`${n}${g}${" ".repeat(O)}${R}
16
+ `;return`${n}${h}${" ".repeat(O)}${q}
17
17
  `}const k=n.charAt(w-1)===`
18
- `?w:W(n,w),z=k>0&&n.charAt(k-1)!==`
18
+ `?w:T(n,w),B=k>0&&n.charAt(k-1)!==`
19
19
  `?`
20
- `:"";return`${n.slice(0,k)}${z}${" ".repeat(O)}${R}
21
- ${n.slice(k)}`}const Z=400;export function patchYaml(n,t){const e=I(n);if(e.errors.length>0||n.trim()!==""&&!d(e.contents)||n.trim()==="")return writeYaml(t);const i=[];if(q(e.contents,e.toJS(),t,[],i),i.length===0)return n;if(i.length>Z)return writeYaml(t);let r=n;for(const s of i){const c=X(r,s);if(c===void 0)return writeYaml(t);r=c}const o=I(r);return o.errors.length===0&&m(o.toJS(),x(t))?r:writeYaml(t)}const x=n=>JSON.parse(JSON.stringify(n));
20
+ `:"";return`${n.slice(0,k)}${B}${" ".repeat(O)}${q}
21
+ ${n.slice(k)}`}const x=400;export function patchYaml(n,t){const e=W(n);if(e.errors.length>0||n.trim()!==""&&!d(e.contents)||n.trim()==="")return writeYaml(t);const i=[];if(b(e.contents,e.toJS(),t,[],i),i.length===0)return n;if(i.length>x)return writeYaml(t);let r=n;for(const s of i){const c=Z(r,s);if(c===void 0)return writeYaml(t);r=c}const o=W(r);return o.errors.length===0&&m(o.toJS(),nn(t))?r:writeYaml(t)}const nn=n=>JSON.parse(JSON.stringify(n));export function writeSheetYaml(n){return writeYaml(U(n))}export function patchSheetYaml(n,t){return patchYaml(n,U(t))}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{CHART_DEFAULTS as we,chartSpaceXml as Se}from"@allyhub/chart";import{columnLetter as ye}from"../address.js";import{Reference as be,Union as Me}from"../calc/types.js";import{CellError as Fe}from"../values.js";import{categoryNumbers as Re,chartDef as De,chartSize as Ne}from"../chart.js";import{parseFormula as _e}from"../formula/parse.js";import{sheetPrefix as ve}from"../formula/print.js";import{HEAD as je,attr as v,el as a,flag as $e,numberAttr as E,tag as o,tags as A,textOf as S}from"./xml.js";const Ee="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",Le="http://schemas.openxmlformats.org/drawingml/2006/main",Oe="http://schemas.openxmlformats.org/drawingml/2006/chart",Ae="http://schemas.openxmlformats.org/officeDocument/2006/relationships",$=9525,ze=(e,t)=>`${ve(e.sheet.name)}$${ye(e.left)}$${String(e.top+1)}${e.single?"":`:$${ye(e.right)}$${String(t+1)}`}`;function L(e,t,r){if(!r?.node)return;const n=e.eval(r.node,{sheet:t,row:0,col:0,dr:0,dc:0}),s=f=>ze(f,Math.min(f.bottom,Math.max(f.top,f.sheet.lastRow)));if(n instanceof be)return s(n);if(n instanceof Me)return`(${n.parts.map(s).join(",")})`;const d=r.node;if(d.kind==="name"&&d.sheet!==void 0&&!(n instanceof Fe&&n.code==="#NAME?"))return`${ve(d.sheet)}${d.name}`}function Ge(e,t,r){if(!r?.node)return!1;const n=e.eval(r.node,{sheet:t,row:0,col:0,dr:0,dc:0});return n instanceof be&&typeof e.value(n.sheet,n.top,n.left)=="number"}export function chartPart(e,t,r){const n=De(e,t,r),s=r.series.map((c,l)=>({s:c,i:l,values:L(e,t,c.values)})).filter(c=>c.values!==void 0),d={...n,series:s.flatMap(c=>n.series[c.i]??[])},f=Ge(e,t,r.categories),m=f?Re(e,t,r):void 0,g={name:c=>L(e,t,s[c]?.s.name),categories:L(e,t,r.categories),numeric:f,...m===void 0?{}:{categoryNumbers:m.values,categoryFormat:m.format},values:c=>s[c]?.values??"",x:c=>L(e,t,s[c]?.s.x??r.categories)},x=L(e,t,r.title);return Se(d,{refs:g,...x===void 0?{}:{titleRef:x}})}const Ie=(e,t,r)=>a("xdr:oneCellAnchor",{},a("xdr:from",{},`<xdr:col>${String(e.col)}</xdr:col>`,`<xdr:colOff>${String(Math.round(e.x*$))}</xdr:colOff>`,`<xdr:row>${String(e.row)}</xdr:row>`,`<xdr:rowOff>${String(Math.round((e.y??0)*$))}</xdr:rowOff>`),a("xdr:ext",{cx:Math.round(e.width*$),cy:Math.round(e.height*$)}),a("xdr:pic",{},a("xdr:nvPicPr",{},a("xdr:cNvPr",{id:t,name:e.name,descr:e.path}),a("xdr:cNvPicPr",{},a("a:picLocks",{noChangeAspect:!0}))),a("xdr:blipFill",{},a("a:blip",{"xmlns:r":Ae,"r:embed":`rId${String(r)}`}),a("a:stretch",{},a("a:fillRect"))),a("xdr:spPr",{},a("a:xfrm",{},a("a:off",{x:0,y:0}),a("a:ext",{cx:Math.round(e.width*$),cy:Math.round(e.height*$)})),a("a:prstGeom",{prst:"rect"},a("a:avLst")))),a("xdr:clientData"));export function drawingPart(e,t=[]){const r=(n,s)=>{const{width:d,height:f}=Ne(n.spec);return a("xdr:oneCellAnchor",{},a("xdr:from",{},`<xdr:col>${String(n.at.col)}</xdr:col>`,`<xdr:colOff>${String(Math.round((n.spec.x??0)*$))}</xdr:colOff>`,`<xdr:row>${String(n.at.row)}</xdr:row>`,`<xdr:rowOff>${String(Math.round((n.spec.y??0)*$))}</xdr:rowOff>`),a("xdr:ext",{cx:Math.round(d*$),cy:Math.round(f*$)}),a("xdr:graphicFrame",{macro:""},a("xdr:nvGraphicFramePr",{},a("xdr:cNvPr",{id:s+2,name:`Chart ${String(s+1)}`}),a("xdr:cNvGraphicFramePr")),a("xdr:xfrm",{},a("a:off",{x:0,y:0}),a("a:ext",{cx:0,cy:0})),a("a:graphic",{},a("a:graphicData",{uri:Oe},a("c:chart",{"xmlns:c":Oe,"xmlns:r":Ae,"r:id":`rId${String(s+1)}`})))),a("xdr:clientData"))};return je+a("xdr:wsDr",{"xmlns:xdr":Ee,"xmlns:a":Le},...e.map(r),...t.map((n,s)=>Ie(n,e.length+s+2,e.length+s+1)))}function ne(e){if(Array.isArray(e))return e.map(ne).join("");if(typeof e!="object"||e===null)return"";const t=e,r=[];for(const[n,s]of Object.entries(t))n==="t"?r.push(S(s)):typeof s=="object"&&r.push(ne(s));return r.join("")}const re=e=>{const t=o(e?.solidFill),r=v(o(t?.srgbClr),"val");return r!==void 0?`#${r.toUpperCase()}`:Te[v(o(t?.schemeClr),"val")??""]},Te={accent1:"#4472C4",accent2:"#ED7D31",accent3:"#A5A5A5",accent4:"#FFC000",accent5:"#5B9BD5",accent6:"#70AD47"},C=(e,t)=>v(o(e?.[t]),"val"),F=(e,t)=>E(o(e?.[t]),"val"),z=(e,t)=>$e(o(e?.[t]),"val"),We=e=>/^"(?:[^"]|"")*"$/u.test(e)?e.slice(1,-1).replaceAll('""','"'):void 0,Ce=e=>We(e)??`=${e}`;function ke(e){if(!e)return;const t=o(e.tx),r=o(t?.strRef);if(r)return Ce(S(r.f));const n=ne(t?.rich);return n===""?void 0:n}function oe(e){if(!e)return;const t=o(e.scaling),r=o(e.numFmt),n=v(r,"formatCode"),s={},d=ke(o(e.title));d!==void 0&&(s.title=d);const f=F(t,"min"),m=F(t,"max"),g=F(e,"majorUnit");return f!==void 0&&(s.min=f),m!==void 0&&(s.max=m),g!==void 0&&g>0&&(s.major=g),z(e,"delete")===!0&&(s.visible=!1),C(t,"orientation")==="maxMin"&&(s.reverse=!0),n!==void 0&&n!=="General"&&$e(r,"sourceLinked")!==!0&&(s.format=n),s}const G=e=>{const t=o(e?.numRef)??o(e?.strRef),r=t?S(t.f):"";return r===""?void 0:r};function Ue(e,t){const r=G(o(e[t?"yVal":"val"]));if(r===void 0)return"its numbers are written in the chart";const n={values:r},s=o(e.tx),d=G(s);if(d!==void 0)n.name=Ce(d);else{const u=S(s?.v);u!==""&&(n.name=u)}const f=o(e.spPr),m=o(f?.ln),g=o(e.marker),x=t||g!==void 0,c=re(f)??(x?re(m)??re(o(g?.spPr)):void 0);c!==void 0&&(n.color=c);const l=E(m,"w");if(x&&l!==void 0&&m?.noFill===void 0){const u=Math.max(.25,Number((l/12700).toFixed(2)));u!==we.lineWidth&&(n.line_width=u)}z(e,"smooth")===!0&&(n.smooth=!0);const h=F(g,"size");h!==void 0&&h!==we.marker&&(n.marker_size=h);const w=t?G(o(e.xVal)):void 0;w!==void 0&&(n.x=w);const O=t?void 0:G(o(e.cat));return{series:n,...O===void 0?{}:{categories:O}}}function se(e,t){const r=A(t.ser),n=d=>o(o(d.spPr)?.ln)?.noFill!==void 0,s=d=>C(o(d.marker),"symbol")==="none";switch(e){case"barChart":return Be(t);case"lineChart":return r.every(s)?"line":"line-markers";case"areaChart":return Ve(t);case"pieChart":return"pie";case"doughnutChart":return"doughnut";case"scatterChart":return r.every(n)?"scatter":r.some(d=>z(d,"smooth")===!0)?"scatter-smooth":"scatter-lines";default:return}}function Be(e){const t=C(e,"barDir")==="bar"?"bar":"column",r=C(e,"grouping");return r==="stacked"?`${t}-stacked`:r==="percentStacked"?`${t}-stacked-100`:`${t}-clustered`}function Ve(e){const t=C(e,"grouping");return t==="stacked"?"area-stacked":t==="percentStacked"?"area-stacked-100":"area"}function I(e,t,r){if(e===void 0)return;const n=e.replace(/^=/u,"");if(/(?:^|[(,])'?\[\d+\]/u.test(n))return"it reads another workbook";if(e.includes("#REF!"))return"its cells were deleted (#REF!)";const s=/^(?:'((?:[^']|'')+)'|([^!'(),]+))!/u.exec(n),d=s?.[1]?.replaceAll("''","'")??s?.[2];if(d!==void 0&&!t(d))return`it reads a sheet the workbook does not have (${d})`;const f=_e(`=${n}`);if(!f.ok||!T(f.node,r))return`it names no cells (${n})`}function T(e,t){switch(e.kind){case"ref":case"structured":return!0;case"name":return e.sheet!==void 0||t(e.name);case"paren":return T(e.arg,t);case"binary":return(e.op===","||e.op===":")&&T(e.left,t)&&T(e.right,t);default:return!1}}export function readChart(e,t=[],r=()=>!0,n=()=>!0){const s=o(e?.chartSpace),d=o(s?.chart),f=o(d?.plotArea);if(!d||!f)return"it has no plot";const m=Object.entries(f).filter(([i])=>i.endsWith("Chart")).flatMap(([i,p])=>A(p).map(P=>({kind:i,plot:P}))),[g]=m;if(!g)return"it has no plot";const x=A(f.valAx),c=i=>A(i.axId).map(p=>v(p,"val")),l=i=>{const p=x.find(P=>c(i).includes(v(o(P.axId),"val")));return p!==void 0&&C(p,"axPos")==="r"},h=m.length>1,w=m.map(({kind:i,plot:p})=>({kind:i,plot:p,type:se(i,p),secondary:h&&l(p)}));if(h&&w.some(i=>i.type===void 0||!(i.type.startsWith("column")||i.type.startsWith("line")||i.type.startsWith("area"))))return"it combines several kinds of chart, not columns, lines and areas";const O=w.find(i=>!i.secondary)??w[0]??g,{kind:u,plot:b}=O,R=u==="scatterChart",M=[];let D,N;const U=w.flatMap(i=>A(i.plot.ser).map(p=>({s:p,of:i}))),B=U.filter(({s:i})=>i.trendline!==void 0).length;B>0&&t.push(B===1?"trendline":`trendlines of ${String(B)} series`);const V=U.filter(({s:i})=>i.errBars!==void 0).length;V>0&&t.push(V===1?"error bars":`error bars of ${String(V)} series`);for(const[i,{s:p,of:P}]of U.entries()){const y=Ue(p,R);if(typeof y=="string")return y;if(h){const te=P.type;te!==void 0&&te!==se(u,b)&&(y.series.type=te),P.secondary&&(y.series.secondary=!0)}const ee=I(y.series.values,r,n);if(ee!==void 0){t.push(`series ${String(i+1)}, as ${ee}`),N=ee;continue}y.series.name?.startsWith("=")===!0&&I(y.series.name,r,n)!==void 0&&delete y.series.name,I(y.series.x,r,n)!==void 0&&delete y.series.x,M.push(y.series),I(y.categories,r,n)===void 0&&(D??=y.categories)}if(M.length===0)return N===void 0?"it has no series":`every series ${N.replace(/^it /u,"")}`;const j=se(u,b);if(!j)return`a sheet has no ${u.replace(/Chart$/u,"")} chart`;const ie=ke(o(d.title)),ce=o(d.legend),H=C(ce,"legendPos"),ae=o(b.dLbls),k=i=>z(ae,i)===!0,Pe=k("showVal")||k("showPercent")||k("showCatName")||k("showSerName"),de=C(ae,"dLblPos"),X=F(b,"gapWidth"),fe=F(b,"overlap"),q=F(b,"holeSize"),ue=z(b,"varyColors"),le=j==="pie"||j==="doughnut",me=i=>c(b).includes(v(o(i.axId),"val")),he=[...A(f.catAx),...A(f.dateAx)],_={value:h?x.find(me)??x[0]:x.find((i,p,P)=>R?p===P.length-1:!0),category:R?x[0]:h?he.find(me)??he[0]:o(f.catAx)??o(f.dateAx),second:w.some(i=>i.secondary)?x.find(i=>C(i,"axPos")==="r"):void 0},J=oe(_.value),K=oe(_.category);J&&_.value?.majorGridlines===void 0&&(J.gridlines=!1),K&&_.category?.majorGridlines!==void 0&&(K.gridlines=!0);const Q=E(o(o(o(o(s?.txPr)?.p)?.pPr)?.defRPr),"sz"),Y=i=>i&&Object.keys(i).length>0?i:void 0,pe=Y(J),xe=Y(K),Z=oe(_.second);Z&&_.second?.majorGridlines!==void 0&&(Z.gridlines=!0);const ge=Y(Z);return{type:j,at:"A1",...ie===void 0?{}:{title:ie},...D===void 0?{}:{categories:D},series:le?M.slice(0,1):M,...ce?{legend:H==="b"?"bottom":H==="t"?"top":H==="l"?"left":"right"}:{},...Pe?{labels:{...k("showVal")?{value:!0}:{},...k("showPercent")?{percentage:!0}:{},...k("showCatName")?{category:!0}:{},...k("showSerName")?{series:!0}:{},...de===void 0?{}:{position:de}}}:{},...X===void 0||X===150?{}:{gap_width:X},...fe===void 0||j.includes("stacked")?{}:{overlap:fe},...q===void 0||q===50?{}:{hole_size:q},...ue===!0&&u==="barChart"?{vary_by_categories:!0}:{},...ue===!1&&le?{vary_by_categories:!1}:{},...pe?{value_axis:pe}:{},...xe?{category_axis:xe}:{},...ge?{secondary_axis:ge}:{},...Q===void 0||Q===900?{}:{size:Q/100}}}const W=e=>Math.round(e/$);export function chartAnchors(e,t,r){const n=o(e?.wsDr),s=[],d=[];let f=0;const m=c=>({col:Number(S(c?.col)),row:Number(S(c?.row)),colOff:W(Number(S(c?.colOff))),rowOff:W(Number(S(c?.rowOff)))}),g=c=>v(o(o(o(o(c.graphicFrame)?.graphic)?.graphicData)?.chart),"id"),x=(c,l,h,w)=>{const O={at:{row:l.row,col:l.col},...l.colOff>0?{x:l.colOff}:{},...l.rowOff>0?{y:l.rowOff}:{},width:h,height:w},u=o(c.pic),b=v(o(o(u?.blipFill)?.blip),"embed");if(u&&b!==void 0){const M=o(o(u.nvPicPr)?.cNvPr),D=v(M,"name"),N=v(M,"descr");d.push({id:b,...O,...D===void 0?{}:{name:D},...N===void 0?{}:{descr:N}});return}const R=g(c);if(R===void 0){f+=1;return}s.push({id:R,...O})};for(const c of A(n?.oneCellAnchor)){const l=o(c.ext);x(c,m(o(c.from)),W(E(l,"cx")??0),W(E(l,"cy")??0))}for(const c of A(n?.twoCellAnchor)){const l=m(o(c.from)),h=m(o(c.to));let w=h.colOff-l.colOff;for(let u=l.col;u<h.col;u++)w+=t(u);let O=h.rowOff-l.rowOff;for(let u=l.row;u<h.row;u++)O+=r(u);x(c,l,w,O)}return{anchors:s,pictures:d,others:f}}
2
+ import{acrossBase as je,CHART_DEFAULTS as Se,chartExRequires as we,CHARTEX_URI as Ie,chartExReference as Te,chartExXml as Ge,chartSpaceXml as Be,isExtended as _e}from"@allyhub/chart";import{columnLetter as Pe}from"../address.js";import{Reference as Me,Union as We}from"../calc/types.js";import{CellError as Ue}from"../values.js";import{categoryNumbers as Xe,chartDef as qe,chartSize as Ve}from"../chart.js";import{parseFormula as He}from"../formula/parse.js";import{sheetPrefix as Ne}from"../formula/print.js";import{HEAD as Je,attr as m,el as o,flag as De,numberAttr as ee,tag as t,tags as C,textOf as M}from"./xml.js";const Ke="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",Qe="http://schemas.openxmlformats.org/drawingml/2006/main",Fe="http://schemas.openxmlformats.org/drawingml/2006/chart",Re="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Ye="http://schemas.openxmlformats.org/markup-compatibility/2006",_=9525,Ze=(e,n)=>`${Ne(e.sheet.name)}$${Pe(e.left)}$${String(e.top+1)}${e.single?"":`:$${Pe(e.right)}$${String(n+1)}`}`;function te(e,n,s){if(!s?.node)return;const r=e.eval(s.node,{sheet:n,row:0,col:0,dr:0,dc:0}),i=l=>Ze(l,Math.min(l.bottom,Math.max(l.top,l.sheet.lastRow)));if(r instanceof Me)return i(r);if(r instanceof We)return`(${r.parts.map(i).join(",")})`;const c=s.node;if(c.kind==="name"&&c.sheet!==void 0&&!(r instanceof Ue&&r.code==="#NAME?"))return`${Ne(c.sheet)}${c.name}`}function et(e,n,s){if(!s?.node)return!1;const r=e.eval(s.node,{sheet:n,row:0,col:0,dr:0,dc:0});return r instanceof Me&&typeof e.value(r.sheet,r.top,r.left)=="number"}export function chartPart(e,n,s){const r=qe(e,n,s),i=s.series.map((a,u)=>({s:a,i:u,values:te(e,n,a.values)})).filter(a=>a.values!==void 0),c={...r,series:i.flatMap(a=>r.series[a.i]??[])},l=et(e,n,s.categories),p=l?Xe(e,n,s):void 0,f={name:a=>te(e,n,i[a]?.s.name),categories:te(e,n,s.categories),numeric:l,...p===void 0?{}:{categoryNumbers:p.values,categoryFormat:p.format},values:a=>i[a]?.values??"",x:a=>te(e,n,i[a]?.s.x??s.categories),sizes:a=>te(e,n,i[a]?.s.sizes)},g=te(e,n,s.title);return _e(c.type)?Ge(c,{refs:{name:f.name,categories:c.categories.length===0?void 0:f.categories,values:f.values}}):Be(c,{refs:f,...g===void 0?{}:{titleRef:g}})}const tt=(e,n,s)=>o("xdr:oneCellAnchor",{},o("xdr:from",{},`<xdr:col>${String(e.col)}</xdr:col>`,`<xdr:colOff>${String(Math.round(e.x*_))}</xdr:colOff>`,`<xdr:row>${String(e.row)}</xdr:row>`,`<xdr:rowOff>${String(Math.round((e.y??0)*_))}</xdr:rowOff>`),o("xdr:ext",{cx:Math.round(e.width*_),cy:Math.round(e.height*_)}),o("xdr:pic",{},o("xdr:nvPicPr",{},o("xdr:cNvPr",{id:n,name:e.name,descr:e.path}),o("xdr:cNvPicPr",{},o("a:picLocks",{noChangeAspect:!0}))),o("xdr:blipFill",{},o("a:blip",{"xmlns:r":Re,"r:embed":`rId${String(s)}`}),o("a:stretch",{},o("a:fillRect"))),o("xdr:spPr",{},o("a:xfrm",{},o("a:off",{x:0,y:0}),o("a:ext",{cx:Math.round(e.width*_),cy:Math.round(e.height*_)})),o("a:prstGeom",{prst:"rect"},o("a:avLst")))),o("xdr:clientData"));export function drawingPart(e,n=[]){const s=(r,i)=>{const{width:c,height:l}=Ve(r.spec),p=o("xdr:graphicFrame",{macro:""},o("xdr:nvGraphicFramePr",{},o("xdr:cNvPr",{id:i+2,name:`Chart ${String(i+1)}`}),o("xdr:cNvGraphicFramePr")),o("xdr:xfrm",{},o("a:off",{x:0,y:0}),o("a:ext",{cx:0,cy:0})),o("a:graphic",{},o("a:graphicData",{uri:Ie},Te(`rId${String(i+1)}`)))),f=o("mc:AlternateContent",{"xmlns:mc":Ye},o("mc:Choice",{[`xmlns:${we(r.spec.type).prefix}`]:we(r.spec.type).namespace,Requires:we(r.spec.type).prefix},p),o("mc:Fallback",{},o("xdr:sp",{macro:"",textlink:""},o("xdr:nvSpPr",{},o("xdr:cNvPr",{id:i+2,name:`Chart ${String(i+1)}`}),o("xdr:cNvSpPr",{},o("a:spLocks",{noTextEdit:!0}))),o("xdr:spPr",{},o("a:xfrm",{},o("a:off",{x:0,y:0}),o("a:ext",{cx:Math.round(c*_),cy:Math.round(l*_)})),o("a:prstGeom",{prst:"rect"},o("a:avLst")),o("a:solidFill",{},o("a:prstClr",{val:"white"})),o("a:ln",{w:1},o("a:solidFill",{},o("a:prstClr",{val:"green"})))),o("xdr:txBody",{},o("a:bodyPr",{vertOverflow:"clip",horzOverflow:"clip"}),o("a:lstStyle"),o("a:p",{},o("a:r",{},o("a:rPr",{lang:"en-US",sz:1100}),o("a:t",{},"This chart isn't available in your version of Excel.")))))));return _e(r.spec.type)?o("xdr:oneCellAnchor",{},o("xdr:from",{},`<xdr:col>${String(r.at.col)}</xdr:col>`,`<xdr:colOff>${String(Math.round((r.spec.x??0)*_))}</xdr:colOff>`,`<xdr:row>${String(r.at.row)}</xdr:row>`,`<xdr:rowOff>${String(Math.round((r.spec.y??0)*_))}</xdr:rowOff>`),o("xdr:ext",{cx:Math.round(c*_),cy:Math.round(l*_)}),f,o("xdr:clientData")):o("xdr:oneCellAnchor",{},o("xdr:from",{},`<xdr:col>${String(r.at.col)}</xdr:col>`,`<xdr:colOff>${String(Math.round((r.spec.x??0)*_))}</xdr:colOff>`,`<xdr:row>${String(r.at.row)}</xdr:row>`,`<xdr:rowOff>${String(Math.round((r.spec.y??0)*_))}</xdr:rowOff>`),o("xdr:ext",{cx:Math.round(c*_),cy:Math.round(l*_)}),o("xdr:graphicFrame",{macro:""},o("xdr:nvGraphicFramePr",{},o("xdr:cNvPr",{id:i+2,name:`Chart ${String(i+1)}`}),o("xdr:cNvGraphicFramePr")),o("xdr:xfrm",{},o("a:off",{x:0,y:0}),o("a:ext",{cx:0,cy:0})),o("a:graphic",{},o("a:graphicData",{uri:Fe},o("c:chart",{"xmlns:c":Fe,"xmlns:r":Re,"r:id":`rId${String(i+1)}`})))),o("xdr:clientData"))};return Je+o("xdr:wsDr",{"xmlns:xdr":Ke,"xmlns:a":Qe},...e.map(s),...n.map((r,i)=>tt(r,e.length+i+2,e.length+i+1)))}function le(e){if(Array.isArray(e))return e.map(le).join("");if(typeof e!="object"||e===null)return"";const n=e,s=[];for(const[r,i]of Object.entries(n))r==="t"?s.push(M(i)):typeof i=="object"&&s.push(le(i));return s.join("")}const ie=e=>{const n=t(e?.solidFill),s=m(t(n?.srgbClr),"val");return s!==void 0?`#${s.toUpperCase()}`:Ee[m(t(n?.schemeClr),"val")??""]},Ee={accent1:"#4472C4",accent2:"#ED7D31",accent3:"#A5A5A5",accent4:"#FFC000",accent5:"#5B9BD5",accent6:"#70AD47"},R=(e,n)=>m(t(e?.[n]),"val"),G=(e,n)=>ee(t(e?.[n]),"val"),ae=(e,n)=>De(t(e?.[n]),"val"),nt=e=>/^"(?:[^"]|"")*"$/u.test(e)?e.slice(1,-1).replaceAll('""','"'):void 0,ue=e=>nt(e)??`=${e}`;function Le(e){if(!e)return;const n=t(e.tx),s=t(n?.strRef);if(s)return ue(M(s.f));const r=le(n?.rich);return r===""?void 0:r}function ke(e){if(!e)return;const n=t(e.scaling),s=t(e.numFmt),r=m(s,"formatCode"),i={},c=Le(t(e.title));c!==void 0&&(i.title=c);const l=G(n,"min"),p=G(n,"max"),f=G(e,"majorUnit");return l!==void 0&&(i.min=l),p!==void 0&&(i.max=p),f!==void 0&&f>0&&(i.major=f),ae(e,"delete")===!0&&(i.visible=!1),R(n,"orientation")==="maxMin"&&(i.reverse=!0),r!==void 0&&r!=="General"&&De(s,"sourceLinked")!==!0&&(i.format=r),i}const U=e=>{const n=t(e?.numRef)??t(e?.strRef),s=n?M(n.f):"";return s===""?void 0:s};function rt(e,n,s=!1){const r=U(t(e[n?"yVal":"val"]));if(r===void 0)return"its numbers are written in the chart";const i={values:r},c=t(e.tx),l=U(c);if(l!==void 0)i.name=ue(l);else{const P=M(c?.v);P!==""&&(i.name=P)}const p=t(e.spPr),f=t(p?.ln),g=t(e.marker),a=n||g!==void 0,u=ie(p)??(a?ie(f)??ie(t(g?.spPr)):void 0);u!==void 0&&(i.color=u);const x=ee(f,"w");if(a&&x!==void 0&&f?.noFill===void 0){const P=Math.max(.25,Number((x/12700).toFixed(2)));P!==Se.lineWidth&&(i.line_width=P)}s&&f?.noFill!==void 0&&(i.line_width=0),ae(e,"smooth")===!0&&(i.smooth=!0);const $=G(g,"size");$!==void 0&&$!==Se.marker&&(i.marker_size=$);const A=n?U(t(e.xVal)):void 0;A!==void 0&&(i.x=A);const h=U(t(e.bubbleSize));h!==void 0&&(i.sizes=h);const v=n?void 0:U(t(e.cat));return{series:i,...v===void 0?{}:{categories:v}}}function Ce(e,n){const s=C(n.ser),r=c=>t(t(c.spPr)?.ln)?.noFill!==void 0,i=c=>R(t(c.marker),"symbol")==="none";switch(e){case"barChart":return st(n);case"lineChart":return s.every(i)?"line":"line-markers";case"areaChart":return ot(n);case"pieChart":return"pie";case"doughnutChart":return"doughnut";case"scatterChart":return s.every(r)?"scatter":s.some(c=>ae(c,"smooth")===!0)?"scatter-smooth":"scatter-lines";case"radarChart":return R(n,"radarStyle")==="filled"?"radar-filled":s.every(i)?"radar":"radar-markers";case"bubbleChart":return"bubble";case"stockChart":return s.length>=4&&n.upDownBars!==void 0?"stock-ohlc":"stock-hlc";default:return}}function st(e){const n=R(e,"barDir")==="bar"?"bar":"column",s=R(e,"grouping");return s==="stacked"?`${n}-stacked`:s==="percentStacked"?`${n}-stacked-100`:`${n}-clustered`}function ot(e){const n=R(e,"grouping");return n==="stacked"?"area-stacked":n==="percentStacked"?"area-stacked-100":"area"}function ze(e){const n=t(t(e?.numRef)?.numCache)??t(e?.numLit),s=[];for(const r of C(n?.pt)){const i=Number(M(r.v));s[ee(r,"idx")??s.length]=Number.isFinite(i)?i:null}return Array.from(s,r=>r??null)}function it(e){const n=[];for(const s of C(e.ser)){const r=C(s.errBars),i=R(r[0],"errDir"),c=t(s.marker),l=R(c,"symbol"),p=t(s.tx),f=r.length===1&&i==="x"?"actual":r.length===1&&i==="y"?"target":r.length>0?void 0:p===void 0&&l==="none"?"join":l!=="none"?"dot":void 0,g=t(s.xVal),a=U(g);if(f===void 0||a===void 0)return;const u={values:a},x=U(p),$=M(p?.v);x!==void 0?u.name=ue(x):$!==""&&(u.name=$);const A=ie(f==="dot"?t(c?.spPr):t(t(r[0]?.spPr)?.ln));A!==void 0&&(u.color=A);const h=G(c,"size");f==="dot"&&h!==void 0&&h!==9&&(u.marker_size=h),n.push({kind:f,series:u,numbers:ze(g)})}return n}function at(e,n,s){const r=n.find(y=>y.kind==="actual"),i=n.find(y=>y.kind==="target"),c=n.filter(y=>y.kind==="dot");if(!r&&(i!==void 0||c.length===0))return;const l=r?"bullet":"dumbbell",p=(y,j)=>{const{color:I,...T}=y.series;return I===void 0||I===Ee[`accent${String(j%6+1)}`]?T:y.series},f=r?[p(r,0),...i?[i.series]:[],...[...e.series].reverse()]:c.map(p),g=r?[r.numbers,i?.numbers??[],...C(s.ser).map(y=>ze(t(y.val)))]:c.map(y=>y.numbers),a=Math.max(0,...g.map(y=>y.length)),u=je({type:l,categories:Array.from({length:a},()=>""),series:g.map((y,j)=>({name:String(j),values:y}))}).value_axis??{},{gap_width:x,category_axis:$,value_axis:A,...h}=e;delete h.overlap;const v={...$};delete v.reverse;const{min:P,max:k,major:b,gridlines:N,...L}=A??{},z={...L,...P===void 0||P===u.minimum_scale?{}:{min:P},...k===void 0||k===u.maximum_scale?{}:{max:k},...b===void 0||b===u.major_unit?{}:{major:b},...N===void 0||N===(u.has_major_gridlines??!0)?{}:{gridlines:N}};return{...h,type:l,series:f,...x===void 0||x===60?{}:{gap_width:x},...Object.keys(z).length>0?{value_axis:z}:{},...Object.keys(v).length>0?{category_axis:v}:{}}}function B(e,n,s){if(e===void 0)return;const r=e.replace(/^=/u,"");if(/(?:^|[(,])'?\[\d+\]/u.test(r))return"it reads another workbook";if(e.includes("#REF!"))return"its cells were deleted (#REF!)";const i=/^(?:'((?:[^']|'')+)'|([^!'(),]+))!/u.exec(r),c=i?.[1]?.replaceAll("''","'")??i?.[2];if(c!==void 0&&!n(c))return`it reads a sheet the workbook does not have (${c})`;const l=He(`=${r}`);if(!l.ok||!fe(l.node,s))return`it names no cells (${r})`}function fe(e,n){switch(e.kind){case"ref":case"structured":return!0;case"name":return e.sheet!==void 0||n(e.name);case"paren":return fe(e.arg,n);case"binary":return(e.op===","||e.op===":")&&fe(e.left,n)&&fe(e.right,n);default:return!1}}export function readChart(e,n=[],s=()=>!0,r=()=>!0){const i=t(e?.chartSpace);if(i?.chartData!==void 0)return dt(i,s,r);const c=t(i?.chart),l=t(c?.plotArea);if(!c||!l)return"it has no plot";const p=Object.entries(l).filter(([d])=>d.endsWith("Chart")).flatMap(([d,O])=>C(O).map(F=>({kind:d,plot:F}))),[f]=p;if(!f)return"it has no plot";const[g,a]=p,u=p.length===2&&g?.kind==="barChart"&&R(g.plot,"barDir")==="bar"&&a?.kind==="scatterChart"?it(a.plot):void 0;if(u&&g&&a){const d=C(a.plot.axId).map(S=>m(S,"val")),O={...l};delete O.scatterChart;const F=readChart({chartSpace:{...i,chart:{...c,plotArea:{...O,valAx:C(l.valAx).filter(S=>!d.includes(m(t(S.axId),"val")))}}}},n,s,r);return typeof F=="string"?F:at(F,u,g.plot)??F}const x=C(l.valAx),$=d=>C(d.axId).map(O=>m(O,"val")),A=d=>{const O=x.find(F=>$(d).includes(m(t(F.axId),"val")));return O!==void 0&&R(O,"axPos")==="r"},h=p.length>1,v=p.map(({kind:d,plot:O})=>({kind:d,plot:O,type:Ce(d,O),secondary:h&&A(O)}));if(h&&v.some(d=>d.type===void 0||!(d.type.startsWith("column")||d.type.startsWith("line")||d.type.startsWith("area"))))return"it combines several kinds of chart, not columns, lines and areas";const P=v.find(d=>!d.secondary)??v[0]??f,{kind:k,plot:b}=P,N=k==="scatterChart"||k==="bubbleChart",L=[];let z,y;const j=v.flatMap(d=>C(d.plot.ser).map(O=>({s:O,of:d}))),I=j.filter(({s:d})=>d.trendline!==void 0).length;I>0&&n.push(I===1?"trendline":`trendlines of ${String(I)} series`);const T=j.filter(({s:d})=>d.errBars!==void 0).length;T>0&&n.push(T===1?"error bars":`error bars of ${String(T)} series`);for(const[d,{s:O,of:F}]of j.entries()){const S=rt(O,N,F.kind==="lineChart");if(typeof S=="string")return S;if(h){const ve=F.type;ve!==void 0&&ve!==Ce(k,b)&&(S.series.type=ve),F.secondary&&(S.series.secondary=!0)}const ye=B(S.series.values,s,r);if(ye!==void 0){n.push(`series ${String(d+1)}, as ${ye}`),y=ye;continue}S.series.name?.startsWith("=")===!0&&B(S.series.name,s,r)!==void 0&&delete S.series.name,B(S.series.x,s,r)!==void 0&&delete S.series.x,B(S.series.sizes,s,r)!==void 0&&delete S.series.sizes,L.push(S.series),B(S.categories,s,r)===void 0&&(z??=S.categories)}if(L.length===0)return y===void 0?"it has no series":`every series ${y.replace(/^it /u,"")}`;const W=Ce(k,b);if(!W)return`a sheet has no ${k.replace(/Chart$/u,"")} chart`;const ne=Le(t(c.title)),re=t(c.legend),X=R(re,"legendPos"),q=t(b.dLbls),E=d=>ae(q,d)===!0,se=E("showVal")||E("showPercent")||E("showCatName")||E("showSerName"),w=R(q,"dLblPos"),D=G(b,"gapWidth"),V=k==="lineChart"&&b.hiLowLines!==void 0?!0:void 0,H=v.find(d=>d.secondary&&d.kind==="barChart"&&d.plot!==b),J=H===void 0?void 0:G(H.plot,"gapWidth"),K=G(b,"overlap"),Q=G(b,"holeSize"),oe=ae(b,"varyColors"),Y=W==="pie"||W==="doughnut",ce=d=>$(b).includes(m(t(d.axId),"val")),de=[...C(l.catAx),...C(l.dateAx)],Z={value:h?x.find(ce)??x[0]:x.find((d,O,F)=>N?O===F.length-1:!0),category:N?x[0]:h?de.find(ce)??de[0]:t(l.catAx)??t(l.dateAx),second:v.some(d=>d.secondary)?x.find(d=>R(d,"axPos")==="r"):void 0},he=ke(Z.value),pe=ke(Z.category);he&&Z.value?.majorGridlines===void 0&&(he.gridlines=!1),pe&&Z.category?.majorGridlines!==void 0&&(pe.gridlines=!0);const xe=ee(t(t(t(t(i?.txPr)?.p)?.pPr)?.defRPr),"sz"),ge=d=>d&&Object.keys(d).length>0?d:void 0,$e=ge(he),Ae=ge(pe),be=ke(Z.second);be&&Z.second?.majorGridlines!==void 0&&(be.gridlines=!0);const Oe=ge(be);return{type:W,at:"A1",...ne===void 0?{}:{title:ne},...z===void 0?{}:{categories:z},series:Y?L.slice(0,1):L,...re?{legend:X==="b"?"bottom":X==="t"?"top":X==="l"?"left":"right"}:{},...se?{labels:{...E("showVal")?{value:!0}:{},...E("showPercent")?{percentage:!0}:{},...E("showCatName")?{category:!0}:{},...E("showSerName")?{series:!0}:{},...w===void 0?{}:{position:w}}}:{},...D===void 0||D===150?{}:{gap_width:D},...K===void 0||W.includes("stacked")?{}:{overlap:K},...Q===void 0||Q===50?{}:{hole_size:Q},...V?{high_low_lines:!0}:{},...J===void 0||J===(D??150)?{}:{secondary_gap_width:J},...oe===!0&&k==="barChart"?{vary_by_categories:!0}:{},...oe===!1&&Y?{vary_by_categories:!1}:{},...$e?{value_axis:$e}:{},...Ae?{category_axis:Ae}:{},...Oe?{secondary_axis:Oe}:{},...xe===void 0||xe===900?{}:{size:xe/100}}}const ct={waterfall:"waterfall",boxWhisker:"box-whisker",clusteredColumn:"histogram",treemap:"treemap",sunburst:"sunburst",funnel:"funnel"};function dt(e,n,s){const r=t(e.chart),i=t(t(r?.plotArea)?.plotAreaRegion),c=C(i?.series),l=c.filter(w=>m(w,"layoutId")!=="paretoLine"),p=c.some(w=>m(w,"layoutId")==="paretoLine"),f=l[0];if(!f)return"it has no series";const g=ct[m(f,"layoutId")??""];if(g===void 0)return`a sheet has no ${m(f,"layoutId")??""} chart`;const a=p?"pareto":g,u=new Map(C(t(e.chartData)?.data).map(w=>[m(w,"id")??"0",w])),x=a==="box-whisker",$=[];let A,h=[];for(const w of x?l:[f]){const D=u.get(m(t(w.dataId),"val")??"0"),V=M(t(D?.numDim)?.f);if(V==="")return"its numbers are written in the chart";if(B(V,n,s)!==void 0)return`its numbers ${String(B(V,n,s))}`;const H={values:V},J=t(t(w.tx)?.txData),K=M(J?.f),Q=M(J?.v);K!==""&&B(K,n,s)===void 0?H.name=ue(K):Q!==""&&(H.name=Q),$.push(H);const oe=t(D?.strDim),Y=M(oe?.f);if(Y!==""&&B(Y,n,s)===void 0&&(A??=Y),h.length===0){const ce=C(oe?.lvl)[0];h=C(ce?.pt).map(de=>M(de))}}const v=t(f.layoutPr),P=t(v?.visibility),k=w=>{const D=m(P,w);return D===void 0?void 0:D==="1"||D==="true"},b=t(v?.binning),N=w=>w===void 0||w.trim()===""||!Number.isFinite(Number(w))?void 0:Number(w),L=N(m(t(b?.binSize),"val")),z=N(m(t(b?.binCount),"val")),y=N(m(b,"overflow")),j=N(m(b,"underflow")),I=C(t(v?.subtotals)?.idx).flatMap(w=>{const D=h[Number(m(w,"val"))];return D===void 0||D===""?[]:[D]}),T=m(t(v?.parentLabelLayout),"val"),W=m(t(v?.statistics),"quartileMethod"),ne=t(r?.title),re=M(t(t(ne?.tx)?.txData)?.v)||le(t(ne?.tx)?.rich),X=t(r?.legend),q=m(X,"pos"),E=t(f.dataLabels),se=t(E?.visibility);return{type:a,at:"A1",...re===""?{}:{title:re},...A===void 0?{}:{categories:A},series:$,...X?{legend:q==="b"?"bottom":q==="t"?"top":q==="l"?"left":"right"}:{},...E===void 0&&(a==="waterfall"||a==="funnel"||a==="treemap"||a==="sunburst")?{labels:!1}:E!==void 0&&!(a==="waterfall"||a==="funnel"||a==="treemap"||a==="sunburst")?{labels:{...m(se,"value")==="1"?{value:!0}:{},...m(se,"categoryName")==="1"?{category:!0}:{},...m(se,"seriesName")==="1"?{series:!0}:{}}}:{},...I.length>0?{totals:I}:{},...k("connectorLines")===!1?{connector_lines:!1}:{},...W==="inclusive"?{quartiles:"inclusive"}:{},...k("meanMarker")===!1?{mean_markers:!1}:{},...k("meanLine")===!0?{mean_line:!0}:{},...k("outliers")===!1?{outliers:!1}:{},...k("nonoutliers")===!0?{inner_points:!0}:{},...L!==void 0&&L>0?{bin_width:L}:z!==void 0&&z>0?{bin_count:Math.round(z)}:{},...y===void 0?{}:{overflow:y},...j===void 0?{}:{underflow:j},...m(b,"intervalClosed")==="l"?{interval_closed:"left"}:{},...T==="overlapping"||T==="none"?{parent_labels:T}:{}}}const me=e=>Math.round(e/_);export function chartAnchors(e,n,s){const r=t(e?.wsDr),i=[],c=[];let l=0;const p=a=>({col:Number(M(a?.col)),row:Number(M(a?.row)),colOff:me(Number(M(a?.colOff))),rowOff:me(Number(M(a?.rowOff)))}),f=a=>{const u=t(a.graphicFrame)??t(t(t(a.AlternateContent)?.Choice)?.graphicFrame);return m(t(t(t(u?.graphic)?.graphicData)?.chart),"id")},g=(a,u,x,$)=>{const A={at:{row:u.row,col:u.col},...u.colOff>0?{x:u.colOff}:{},...u.rowOff>0?{y:u.rowOff}:{},width:x,height:$},h=t(a.pic),v=m(t(t(h?.blipFill)?.blip),"embed");if(h&&v!==void 0){const k=t(t(h.nvPicPr)?.cNvPr),b=m(k,"name"),N=m(k,"descr");c.push({id:v,...A,...b===void 0?{}:{name:b},...N===void 0?{}:{descr:N}});return}const P=f(a);if(P===void 0){l+=1;return}i.push({id:P,...A})};for(const a of C(r?.oneCellAnchor)){const u=t(a.ext);g(a,p(t(a.from)),me(ee(u,"cx")??0),me(ee(u,"cy")??0))}for(const a of C(r?.twoCellAnchor)){const u=p(t(a.from)),x=p(t(a.to));let $=x.colOff-u.colOff;for(let h=u.col;h<x.col;h++)$+=n(h);let A=x.rowOff-u.rowOff;for(let h=u.row;h<x.row;h++)A+=s(h);g(a,u,$,A)}return{anchors:i,pictures:c,others:l}}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{SHEET_FILE as le,SHEET_NOTE_AUTHOR as fe,SHEET_PICTURE_HEIGHT as W,SHEET_SEPARATOR as ae}from"@allyhub/formats";import{cellName as $,columnLetter as M,contains as z,overlaps as R,rangeName as C,readAddress as ce,readArea as B}from"../address.js";import{rectangles as O}from"../api/rectangles.js";import{chartAfter as ue}from"../chart.js";import{analyse as he}from"../calc/analyse.js";import{ITERATION_DEFAULTS as de}from"../calc/engine.js";import{FUNCTIONS as me}from"../calc/functions/index.js";import{checkWorkbook as pe}from"../check.js";import{writeCsv as we}from"@allyhub/formats";import{pictureSize as ge}from"../files.js";import{isDateCode as N}from"../format.js";import{moveFormula as ke,relativeKey as be}from"../formula/move.js";import{printFormula as L,sheetPrefix as U}from"../formula/print.js";import{mapNode as V,walk as I}from"../formula/walk.js";import{CellError as _,isoOfSerial as ye,readTyped as j,writeTyped as H}from"../values.js";import{joinedRuns as $e,plainRuns as xe}from"../rich.js";import{runsOver as Le}from"./runs.js";import{FormulaCell as Z,validName as q}from"../workbook.js";import{writeYaml as ve}from"../write.js";import{readFileFormula as Ce}from"./formula.js";import{hasDate as J}from"./numfmt.js";import{placesLine as A,readXlsx as Se}from"./read.js";import{LISTS_SHEET as Ee}from"./write.js";const K=100,Me=.5,Y=1462,X=64,G=1e4;export const COMPARE_TOLERANCE=1e-9;const Q=f=>f.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/gu,"")||"rows",b=f=>{for(const e in f)if(Object.hasOwn(f,e))return!1;return!0},F=(f,e)=>`${String(f)} ${e}${f===1?"":"s"}`,S=f=>({row:f.row,col:f.col});function ee(f){return f===""||f.length>255||/^[/\\]|^[A-Za-z]:|\\|\0/u.test(f)?!1:f.split("/").every(e=>e!==""&&e!=="."&&e!=="..")}class Oe{cells;starts;first;constructor(e){let o=!0;for(let t=1;t<e.length&&o;t++){const s=e[t-1],l=e[t];s&&l&&(l.row<s.row||l.row===s.row&&l.col<=s.col)&&(o=!1)}if(!o){e.sort((t,s)=>t.row-s.row||t.col-s.col);for(let t=e.length-1;t>0;t--){const s=e[t-1],l=e[t];l&&s?.row===l.row&&s.col===l.col&&e.splice(t-1,1)}}this.cells=e;const n=e[0]?.row??0,i=e[e.length-1]?.row??-1;this.first=n,this.starts=new Int32Array(Math.max(0,i-n+2));let r=0;for(let t=0;t<this.starts.length;t++){for(;r<e.length&&(e[r]?.row??0)<n+t;)r++;this.starts[t]=r}}get(e,o){const n=e-this.first;if(n<0||n>=this.starts.length-1)return;let i=this.starts[n]??0,r=(this.starts[n+1]??0)-1;for(;i<=r;){const t=i+r>>1,s=this.cells[t];if(!s)return;if(s.col===o)return s;s.col<o?i=t+1:r=t-1}}}class te{list=[];add(e){this.list.push(e)}has(e,o){for(const n of this.list)if(z(n,e,o))return!0;return!1}}function oe(f){const e=/\.([A-Za-z0-9]+)$/u.exec(f)?.[1]?.toLowerCase();return e==="jpeg"?"jpg":e==="tif"?"tiff":e}function ne(f,e){const o=e.toLowerCase();return V(f,n=>n.kind!=="structured"||n.table?.toLowerCase()!==o||!n.thisRow&&n.columns.length===0&&n.sections.length===0?n:Object.fromEntries(Object.entries(n).filter(([i])=>i!=="table")))}function _e(f){const e=new Map;for(const n of f.sheets)for(const i of n.tables)i.totals>0&&e.set(i.name.toLowerCase(),{t:i,sheet:n.name});if(e.size===0)return;const o=(n,i)=>{const r=i.table===void 0?void 0:e.get(i.table.toLowerCase());if(!r||i.thisRow)return;const{t}=r,s=i.sections,l=s.includes("#All");if(!l&&!s.includes("#Totals"))return;const a=y=>t.columns.findIndex(x=>x.name.toLowerCase()===y.toLowerCase()),[c,u]=i.columns,h=c===void 0?0:a(c),p=c===void 0?t.columns.length-1:u===void 0?h:a(u);if(h<0||p<0)return;const m=l?t.ref.top:s.includes("#Data")?t.ref.top+t.headers:s.includes("#Headers")?t.ref.top:t.ref.bottom-t.totals+1,w=t.ref.bottom,d=t.ref.left+Math.min(h,p),g=t.ref.left+Math.max(h,p),k=m!==w||d!==g;return{kind:"ref",...r.sheet===n?{}:{sheet:r.sheet},col:{index:d,abs:!0},row:{index:m,abs:!0},...k?{col2:{index:g,abs:!0},row2:{index:w,abs:!0}}:{},range:k}};for(const n of f.sheets)for(const i of n.cells)i.node&&(i.node=V(i.node,r=>r.kind==="structured"?o(n.name,r)??r:r.kind==="unary"&&r.op==="@"&&r.arg.kind==="ref"&&!r.arg.range?r.arg:r))}const Ae=1e3;function se(f){return f.headers===0?"has no header row":f.columns.length!==f.ref.right-f.ref.left+1||!q(f.name)?"cannot be held as a table":new Set(f.columns.map(e=>e.name.toLowerCase())).size===f.columns.length?void 0:"has two columns of one name"}function D(f,e,o){let n;const i=new Set;I(f,t=>{t.kind==="call"&&(t.name==="LET"||t.name==="LAMBDA")&&t.args.forEach(s=>{s.kind==="name"&&i.add(s.name.toLowerCase())})});const r=t=>i.has(t)||o===void 0||o.names.has(t)||o.tables.has(t);return I(f,t=>{n===void 0&&(t.kind==="call"&&!me.has(t.name)&&(r(t.written.toLowerCase())||(n=`no function ${t.name}`)),t.kind==="name"&&!r(t.name.toLowerCase())&&(n=`no name ${t.name}`),t.kind==="structured"&&t.table!==void 0&&!r(t.table.toLowerCase())&&(n=`no table ${t.table}`),(t.kind==="ref"||t.kind==="name"||t.kind==="error")&&t.sheet!==void 0&&(t.sheet.startsWith("[")?n="it reads another workbook":e.has(t.sheet.toLowerCase())||(n=`no sheet ${t.sheet}`)))}),n}function Te(f){const e=new Set(f.book.sheets.map(o=>o.name.toLowerCase()));for(const o of f.book.sheets){const n=new Map,i=(t,s)=>{const l=n.get(s),a=$(t);l?l.push(a):n.set(s,[a])},r=[];for(const t of o.cells){if(t.unread!==void 0){i(t,/^\[|[!']\[|\[\d+\]/u.test(t.unread)?"it reads another workbook":`it could not be read: ${t.unread}`);continue}if(!t.node)continue;const s=D(t.node,e,f);s!==void 0?(delete t.node,i(t,s)):(f.carried.set(t,o),t.array&&C(t.array)!==$(t)&&r.push(t))}ze(f,o,r);for(const[t,s]of n)f.lost.push(`${o.name}: ${F(s.length,"formula")} kept as ${s.length===1?"its value":"their values"}, as ${t} (${A(s)})`)}}function ze(f,e,o){if(o.length===0)return;const n=new Set;for(const i of o){const{array:r}=i;if(r)for(const t of e.cells)t!==i&&!t.node&&z(r,t.row,t.col)&&n.add(t)}e.cells=e.cells.filter(i=>!n.has(i));for(const i of n)f.spilled.set(i,e)}function E(f,e){const{value:o}=e;if(!f.book.date1904||typeof o!="number")return o;const n=f.book.looks[e.style]?.format;return N(n)&&n!==void 0&&J(n)?o+Y:o}function P(f,e){if(typeof f!="number"||e===void 0||!N(e)||!J(e)||f<1)return;const o=ye(f);return j(o).value===f?o:void 0}const Re=(f,e)=>P(f,e)??H(f??null);function re(f,e){const o=P(f,e);return o!==void 0?o:f==null?null:typeof f=="number"||typeof f=="boolean"?f:H(f)}function Ne(f){const e=[];for(let s=0;s<f.length;s++){const l=f[s];if(!l)continue;const a=e[e.length-1];a?.row===l.row&&a.right===l.col-1?(a.right=l.col,a.last=s):e.push({row:l.row,left:l.col,right:l.col,first:s,last:s})}const o=e.map((s,l)=>l),n=s=>{let l=s;for(;o[l]!==l;){const a=o[o[l]??l]??l;o[l]=a,l=a}return l};let i=0,r=0;for(let s=0;s<e.length;s++){const l=e[s];if(l){s>0&&e[s-1]?.row!==l.row&&(i=e[s-1]?.row===l.row-1?r:s,r=s);for(let a=i;a<r;a++){const c=e[a];c?.row===l.row-1&&c.right>=l.left&&c.left<=l.right&&(o[n(s)]=n(a))}}}const t=new Map;return e.forEach((s,l)=>{const a=n(l),c=t.get(a),u=s.right-s.left+1;c?(c.box.top=Math.min(c.box.top,s.row),c.box.bottom=Math.max(c.box.bottom,s.row),c.box.left=Math.min(c.box.left,s.left),c.box.right=Math.max(c.box.right,s.right),c.count+=u,c.runs.push(l)):t.set(a,{box:{top:s.row,bottom:s.row,left:s.left,right:s.right},count:u,runs:[l]})}),[...t.values()].map(s=>({box:s.box,count:s.count,cells:()=>s.runs.flatMap(l=>{const a=e[l];return a?f.slice(a.first,a.last+1):[]})}))}const ie=f=>JSON.stringify(f);class Ie{ctx;read;cells;inTables=new te;columnLooks=new Map;rowLooks=new Map;lookDone=new te;tables=[];areas=[];filtered=[];ownLooks=new Map;fileColumns=new Map;pictured=new Map;over=[];keys=new Map;constructor(e,o){this.ctx=e,this.read=o,this.cells=new Oe(o.cells)}at(e,o){return this.cells.get(e,o)}look(e){return this.ctx.book.looks[e.style]??{}}runs(e){if(!e.runs||e.node||typeof e.value!="string")return;const o=$e(Le(e.runs,this.look(e),this.ctx.book.font));return o.length===0||xe(o)?void 0:o}code(e){return this.look(e).format}text(e){return e.node?L(e.node):Re(E(this.ctx,e),this.code(e))}baseLooks(){const{read:e}=this,{looks:o}=this.ctx.book;let n=-1;for(const r of e.cells)r.col>n&&(n=r.col);for(const r of e.columns){if(r.style===void 0)continue;const t=o[r.style];if(!(!t||b(t)))for(let s=r.min;s<=Math.min(r.max,n);s++)this.columnLooks.set(s,t)}for(const r of e.rows){const t=r.style===void 0?void 0:o[r.style];t&&!b(t)&&this.rowLooks.set(r.row,t)}const i=(r,t)=>{for(const s in t)if(!(s in r))return!1;return!0};for(const r of e.cells){const t=this.look(r),s=this.columnLooks.get(r.col);s&&!i(t,s)&&this.columnLooks.delete(r.col);const l=this.rowLooks.get(r.row);l&&!i(t,l)&&this.rowLooks.delete(r.row)}}ownLook(e){const o=this.columnLooks.get(e.col),n=this.rowLooks.get(e.row),i=this.look(e),r=i.format!==void 0&&N(i.format);if(!o&&!n&&!r){let a=this.ownLooks.get(e.style);return a||(a={look:i,key:ie(i)},this.ownLooks.set(e.style,a)),a}const t={...o,...n},s={};for(const[a,c]of Object.entries(i))JSON.stringify(c)!==JSON.stringify(t[a])&&(s[a]=c);const l=s.format;if(typeof l=="string"){const a=e.node?void 0:P(E(this.ctx,e),l);a!==void 0&&j(a).format===l&&delete s.format}return{look:s,key:ie(s)}}keyOf(e,o){if(e.key!==void 0)return e.key;const n=be(o,e.row,e.col),i=this.keys.get(n);return i!==void 0?e.key=i:(this.keys.set(n,n),e.key=n)}columnFormula(e,o,n){const i=new Map,r=n-o+1;for(let s=o;s<=n;s++){const l=this.at(s,e);if(!l||l.value===void 0&&!l.node||l.value===null&&!l.node)return;if(!l.node)continue;const a=this.keyOf(l,l.node),c=i.get(a);c?c.n+=1:i.set(a,{n:1,cell:l})}let t;for(const s of i.values())(!t||s.n>t.n)&&(t=s);return t&&t.n*2>r?t.cell:void 0}csv(e,o){const n=[];for(let i=0;i<e;i+=G){const r=[];for(let t=i;t<Math.min(e,i+G);t++)r.push(o(t));n.push(we(r))}return n.join("")}table(e){const{read:o,ctx:n}=this,i=d=>n.lost.push(`${o.name}: table ${e.name} ${d}`),r=e.ref.right-e.ref.left+1,t=se(e);if(t!==void 0)return i(`${t}, so its cells are kept and it is no table`),!1;const s=e.ref.top,l=s+1;let a=e.ref.bottom-e.totals;if(e.totals===0){let d=s;for(const g of o.cells)g.col>=e.ref.left&&g.col<=e.ref.right&&g.row>d&&(d=g.row);a-d>Ae&&(i(`runs ${String(a-d)} empty rows past what it holds, which are left out`),a=d)}e.totals>0&&i("has a totals row, kept as plain cells under it");const c=e.columns.map((d,g)=>a>=l?this.columnFormula(e.ref.left+g,l,a):void 0),u=d=>{const g=c[d];if(!g)return!1;for(let k=l;k<=a;k++)if(this.at(k,e.ref.left+d)?.key!==g.key)return!1;return!0};let h=r;for(;h>1&&u(h-1);)h-=1;const p={},m=this.path(e.name);n.files.set(m,this.csv(a-l+2,d=>{if(d===0)return e.columns.slice(0,h).map(y=>y.name);const g=l+d-1,k=[];for(let y=0;y<h;y++){const x=this.at(g,e.ref.left+y),v=c[y];x?v&&x.key===v.key?k.push(""):x.node?k.push(L(ne(x.node,e.name))):k.push(this.text(x)):k.push("")}return k})),this.inTables.add({...e.ref,bottom:a}),e.columns.forEach((d,g)=>{const k=e.ref.left+g,y=this.columnLook(k,l,a),x=c[g];x?.node&&(y.formula=L(ne(ke(x.node,l-x.row,0),e.name)));const v=this.fileColumns.get(k);v!==void 0&&l<=a&&(y.files=v===W?!0:{height:v}),b(y)||(p[d.name]=y)});const w=new Map;for(const[d,g]of e.filter?.columns??[]){const k=e.columns[d]?.name;k!==void 0&&w.set(k,g)}return(e.filter?.unread??0)>0&&i(`has ${F(e.filter?.unread??0,"filter")} by condition, its rows left as they were hidden`),this.tables.push({name:e.name,at:$({row:s,col:e.ref.left}),rows:m,...e.style!==void 0&&e.style!=="TableStyleMedium2"?{style:e.style}:{},...e.options,...b(p)?{}:{columns:p},...e.filter===void 0?{filter:!1}:w.size>0?{filter:{columns:Object.fromEntries(w)}}:{}}),e.filter?.unread===0&&e.filter.columns.size>0&&this.filtered.push({...e.ref,bottom:a}),this.areas.push({...e.ref,bottom:a}),!0}columnLook(e,o,n){let i,r={};for(let t=o;t<=n;t++){const s=this.at(t,e),l=s?this.ownLook(s):{look:{},key:"{}"};if(i===void 0)i=l.key,r=l.look;else if(i!==l.key)return{}}return b(r)?{}:(this.lookDone.add({top:o,bottom:n,left:e,right:e}),{...r})}path(e){const o=Q(e);let n=`${o}.csv`;for(let i=2;this.ctx.files.has(n)||this.ctx.taken(n);i++)n=`${o}-${String(i)}.csv`;return n}loose(){const e=[],o=[];for(const n of this.read.cells)this.inTables.has(n.row,n.col)||(n.node?e.push(n):n.value!==void 0&&n.value!==null&&o.push(n));return{formulas:e,typed:o}}blockAreas(e,o){const n=[],i=O(o.map(S)),r=s=>!n.some(l=>R(l,s))&&!this.areas.some(l=>R(l,s))&&!i.some(l=>R(l,s)),t=s=>(s.bottom-s.top+1)*(s.right-s.left+1);for(const s of Ne(e)){const{box:l}=s;if(!(t(l)<K)){if(s.count/t(l)>=Me&&r(l)){n.push(l);continue}for(const a of O(s.cells().map(S)))t(a)>=K&&r(a)&&n.push(a)}}return n.sort((s,l)=>s.top-l.top||s.left-l.left)}cells_(e){const{formulas:o,typed:n}=this.loose(),i=new Map;for(const c of n){const u=this.runs(c);u&&i.set(c,u)}const r=this.read.cells.filter(c=>this.inTables.has(c.row,c.col)&&this.runs(c)!==void 0);r.length>0&&this.ctx.lost.push(`${this.read.name}: ${F(r.length,"cell")} of rich text in a table, kept as plain text (${A(r.map(c=>$(c)))})`);const t=this.blockAreas(n.filter(c=>!i.has(c)),[...o,...i.keys()]),s=c=>t.some(u=>z(u,c.row,c.col));t.length>0&&(e.blocks=t.map(c=>{const u=this.path(this.read.name);return this.ctx.files.set(u,this.csv(c.bottom-c.top+1,h=>{const p=[];for(let m=c.left;m<=c.right;m++){const w=this.at(c.top+h,m);p.push(w?this.text(w):"")}return p})),{at:$({row:c.top,col:c.left}),rows:u}}));const l=[],a=new Map;for(const c of o){if(!c.node)continue;const u=this.keyOf(c,c.node),h=a.get(u);h?h.push(c):a.set(u,[c])}for(const c of a.values())for(const u of O(c.map(S))){const h=this.at(u.top,u.left);h?.node&&l.push([{row:u.top,col:u.left},C(u),L(h.node)])}for(const c of n){if(t.length>0&&s(c))continue;const u=i.get(c);l.push([S(c),$(c),u?{runs:u}:re(E(this.ctx,c),this.code(c))])}l.sort(([c],[u])=>c.row-u.row||c.col-u.col),l.length>0&&(e.cells=Object.fromEntries(l.map(([,c,u])=>[c,u])))}formats(e){const o=new Map,n=this.lookDone.list.length>0;for(const r of this.read.cells){if(n&&this.lookDone.has(r.row,r.col))continue;const t=this.ownLook(r);if(b(t.look))continue;const s=o.get(t.key);s?s.places.push(S(r)):o.set(t.key,{look:t.look,places:[S(r)]})}const i=[];for(const{look:r,places:t}of o.values())for(const s of O(t))i.push({range:C(s),...r});i.length>0&&(e.format=i)}columns(e){const{read:o}=this,n=new Map;let i=0;for(const t of o.cells)t.col>i&&(i=t.col);const r=[];for(const t of o.columns){if(t.width===void 0&&t.hidden!==!0&&t.level===void 0)continue;const s=t.max-Math.max(t.min,i+1)+1>X?Math.max(i,t.min+X-1):t.max;s<t.max&&r.push(`${M(s+1)}:${M(t.max)}`);const l=t.width!==void 0&&t.width<=0;for(let a=t.min;a<=s;a++)n.set(a,{...t.width===void 0||l?{}:{width:t.width},...t.hidden===!0||l?{hidden:!0}:{},...t.level===void 0?{}:{level:t.level}})}for(const[t,s]of this.columnLooks)n.set(t,{...n.get(t),...s});for(const[t,s]of this.fileColumns)this.tableColumn(t)||n.set(t,{...n.get(t),files:s===W?!0:{height:s}});n.size>0&&(e.columns=Object.fromEntries([...n.keys()].sort((t,s)=>t-s).map(t=>[M(t),n.get(t)??{}]))),r.length>0&&this.ctx.lost.push(`${o.name}: the size of columns ${A(r)}, past those that hold anything`)}tableColumn(e){return this.areas.some(o=>e>=o.left&&e<=o.right)}rows(e){const o={};for(const n of this.read.rows){const i=this.rowLooks.get(n.row),r=this.filtered.some(a=>n.row>a.top&&n.row<=a.bottom),t=n.height!==void 0&&this.pictured.get(n.row)!==n.height?n.height:void 0,s=t!==void 0&&t<=0,l={...t===void 0||s?{}:{height:t},...(n.hidden===!0||s)&&!r?{hidden:!0}:{},...n.level===void 0?{}:{level:n.level},...i};b(l)||(o[String(n.row+1)]=l)}b(o)||(e.rows=o)}assetPath(e,o){const n=s=>{const l=this.ctx.assets.get(s);return l?je(l,o.bytes):!this.ctx.taken(s)};if(e!==void 0&&oe(e)===oe(`.${o.type}`)&&ee(e)&&n(e))return e;const r=Q((o.name??"picture").replace(/\.[A-Za-z0-9]+$/u,""));let t=`${r}.${o.type}`;for(let s=2;!n(t);s++)t=`${r}-${String(s)}.${o.type}`;return t}pictures(){const e=this.over;for(const o of this.read.pictures){const n=this.at(o.row,o.col),i=typeof n?.value=="string"?n.value:"";if(o.y===void 0&&o.descr!==void 0&&ee(o.descr)&&i.split(ae).includes(o.descr)&&o.descr!==void 0){this.ctx.assets.set(o.descr,o.bytes),this.fileColumns.set(o.col,Math.max(this.fileColumns.get(o.col)??0,o.height)),this.pictured.set(o.row,Math.max(this.pictured.get(o.row)??0,o.height));continue}if(o.width<=0||o.height<=0){this.ctx.lost.push(`${this.read.name}: a picture of no size at ${$({row:o.row,col:o.col})}`);continue}const t=this.assetPath(o.descr,o);this.ctx.assets.set(t,o.bytes);const s=ge(o.bytes),l=s?.width===o.width&&s.height===o.height;e.push({file:t,at:$({row:o.row,col:o.col}),...o.x===void 0?{}:{x:o.x},...o.y===void 0?{}:{y:o.y},...l?{}:{width:o.width,height:o.height}})}}build(){const{read:e}=this;this.baseLooks(),this.pictures();for(const n of e.tables)this.table(n);const o={name:e.name};return e.state!=="visible"&&(o.hidden=!0),e.gridlines===!1&&(o.gridlines=!1),e.tab!==void 0&&(o.tab=e.tab),e.state==="veryHidden"&&this.ctx.lost.push(`${e.name}: being very hidden; it is hidden`),e.freeze&&(e.freeze.row>0||e.freeze.col>0)&&(o.freeze=$(e.freeze)),this.tables.length>0&&(o.tables=this.tables),this.filter(o),this.columns(o),this.rows(o),this.cells_(o),e.merges.length>0&&(o.merges=e.merges.map(C)),this.formats(o),e.conditional.length>0&&(o.conditional=e.conditional),e.validations.length>0&&(o.validations=e.validations),e.charts.length>0&&(o.charts=e.charts.map(n=>this.chart(n))),this.over.length>0&&(o.pictures=this.over),b(e.links)||(o.links=e.links),e.notes.length>0&&(o.notes=Object.fromEntries(e.notes.map(n=>[n.ref,n.author===void 0||n.author===fe?n.text:{text:n.text,author:n.author}]))),e.print&&(o.print=e.print),e.protect===!0&&(o.protect=!0),e.outline&&(o.outline=e.outline),o}chart(e){return ue(e,o=>{const n=this.chartReference(o.replace(/^=/u,""));return o.startsWith("=")?`=${n}`:n})}chartReference(e){const o=e.lastIndexOf("!"),i=(o<0?this.read.name:e.slice(0,o)).replace(/^'|'$/gu,"").replaceAll("''","'"),r=B(e.slice(o+1).replaceAll("$",""));if(!r)return e;const t=this.ctx.book.sheets.find(s=>s.name.toLowerCase()===i.toLowerCase());for(const s of t?.tables??[]){const l=s.ref.top+1,c=r.left===r.right&&r.top===l&&r.bottom===s.ref.bottom&&r.left>=s.ref.left&&r.left<=s.ref.right?s.columns[r.left-s.ref.left]:void 0;if(c&&this.ctx.tables.has(s.name.toLowerCase()))return L({kind:"structured",table:s.name,sections:[],columns:[c.name],thisRow:!1}).slice(1)}return`${t===this.read||o<0?"":`${e.slice(0,o)}!`}${C(r)}`}filter(e){const{filter:o}=this.read;if(!o)return;const n={};for(const[i,r]of o.columns)n[M(o.ref.left+i)]=r;e.filter={range:C(o.ref),...b(n)?{}:{columns:n}},o.unread===0&&!b(n)&&this.filtered.push(o.ref)}}const je=(f,e)=>f.length===e.length&&f.every((o,n)=>o===e[n]),He=new Set(["_xlnm._FilterDatabase","_xlnm.Print_Area","_xlnm.Print_Titles"]);function Fe(f){const e={},o=[],n=new Map,{book:i,lost:r}=f,t=new Set(i.sheets.map(u=>u.name.toLowerCase())),s=new Set,l=[];let a;const c=u=>{a=void 0;const h=We(u.text);if(h!==void 0)return typeof h=="string"?H(h):h;const p=Ce(u.text,!0),m=p.ok?D(p.node,t):"it could not be read";if(!p.ok||m!==void 0||Pe(p.node)){r.push(`the name ${u.name} (${u.text})${m===void 0?"":`: ${m}`}`);return}return a=p.node,L(p.node)};for(const u of i.names){if(u.name.startsWith("_xlnm.")){He.has(u.name)||r.push(`Excel's name ${u.name}`);continue}if(/^_xl(?:fn|pm|ws|udf)/iu.test(u.name))continue;const h=u.name.toLowerCase(),p=u.sheet===void 0?"":String(u.sheet);if(!q(u.name)||f.tables.has(h)){r.push(`the name ${u.name}, which cannot be held here`);continue}if(s.has(`${p}|${h}`)){r.push(`a second name ${u.name}${p===""?"":` of ${i.sheets[u.sheet??0]?.name??""}`}`);continue}const m=c(u);if(m===void 0)continue;s.add(`${p}|${h}`),f.names.add(h);const w=u.sheet===void 0?void 0:n.get(u.sheet)??{names:{},hidden:[]},d=w?.names??e;d[u.name]=m,u.hidden===!0&&(w?.hidden??o).push(u.name),w&&u.sheet!==void 0&&n.set(u.sheet,w),a&&l.push({held:d,n:u,node:a})}for(const{held:u,n:h,node:p}of l){const m=D(p,t,{names:f.names,tables:f.tables});m!==void 0&&(u[h.name]="=#NAME?",r.push(`the name ${h.name} (${h.text}): ${m}; it holds #NAME?, as in Excel`))}return{names:e,hidden:o,sheets:n}}function De(f,e){const o={},n=new Map;for(const[i,r]of Object.entries(e))typeof r=="string"&&r.startsWith("=")&&n.set(r.slice(1).replaceAll("$","").toLowerCase(),i);for(const i of f.book.sheets)for(const r of i.scenarios){const t={};let s=!0;for(const{at:l,value:a}of r.cells){const c=ce(l),u=c&&i.cells.find(m=>m.row===c.row&&m.col===c.col);String(u?.value??"")!==a&&(s=!1);const h=n.get(`${U(i.name)}${l}`.toLowerCase())??n.get(l.toLowerCase()),p=j(a);h===void 0?f.lost.push(`${i.name}: scenario ${r.name}'s cell ${l}, which has no name`):t[h]=typeof p.value=="number"?p.value:a}!s&&!b(t)&&(o[r.name]={...o[r.name],...t})}return o}function Pe(f){let e=!1;return I(f,o=>{e||=o.kind==="error"&&o.code==="#REF!"}),e}function We(f){const e=f.trim();return/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/u.test(e)?Number(e):/^true$/iu.test(e)?!0:/^false$/iu.test(e)?!1:/^"((?:[^"]|"")*)"$/u.exec(e)?.[1]?.replaceAll('""','"')}const Be=new RegExp(`^${Ee.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")}(?: \\(\\d+\\))?$`,"u");function Ue(f){const e=f.sheets.find(r=>r.state==="veryHidden"&&Be.test(r.name));if(!e)return;const o=U(e.name).toLowerCase(),n=r=>{const t=r.replace(/^=/u,"");if(!t.toLowerCase().startsWith(o))return;const s=B(t.slice(o.length).replaceAll("$",""));if(!s||s.left!==s.right)return;const l=[];for(let a=s.top;a<=s.bottom;a++){const c=e.cells.find(u=>u.row===a&&u.col===s.left);l.push(typeof c?.value=="string"?c.value:"")}return l};for(const r of f.sheets)r.validations=r.validations.map(t=>{const[s]=t.formula??[],l=t.type==="list"&&typeof s=="string"?n(s):void 0;if(!l)return t;const a={...t,values:l};return delete a.formula,a});const i=f.sheets.indexOf(e);f.sheets=f.sheets.filter(r=>r!==e),f.names=f.names.flatMap(r=>r.sheet===void 0||r.sheet<i?[r]:r.sheet===i?[]:[{...r,sheet:r.sheet-1}])}const T=f=>f instanceof _?f.code:f??null,Ve=new Map([["#SPILL!","#VALUE!"],["#CALC!","#VALUE!"]]);export function sameValue(f,e,o){if(typeof f=="number"&&typeof e=="number")return f===e?!0:Math.abs(f-e)<=Math.max(Math.abs(f),Math.abs(e))*o;if(f instanceof _||e instanceof _){const n=i=>i instanceof _?Ve.get(i.code)??i.code:void 0;return n(f)===n(e)}if(f===null||e===null){const n=f??e;return n===null||n===""||n===0||n===!1}return f===e}function Ze(f,e){const o=[];for(const r of e.sheets)for(const t of r.formulas)t.shared.node&&he(e,t.shared,r).volatile&&o.push(t);const n=new Set(o),i=[...o];for(;;){const r=i.pop();if(!r)return n;for(const t of f.readers(r.sheet,r.row,r.col))n.has(t)||(n.add(t),i.push(t))}}function qe(f){const e=f.file.iteration;return(e===void 0||e===!0?void 0:e.max_change)??de.max_change}function Je(f,e,o,n){const i={formulas:0,same:0,uncached:0,moving:0,differences:[]},r=Ze(o,e);for(const[t,s]of f.carried){if(!t.node)continue;const l=e.sheet(s.name);if(!l)continue;i.formulas+=1;const a=l.at(t.row,t.col);if(a instanceof Z&&r.has(a)){i.moving+=1;continue}const c=E(f,t);if(c===void 0){i.uncached+=1;continue}const u=o.value(l,t.row,t.col);a instanceof Z&&o.iterates(a)&&typeof c=="number"&&typeof u=="number"&&Math.abs(c-u)<=qe(e)||sameValue(c,u,n)?i.same+=1:i.differences.push({sheet:s.name,cell:$(t),formula:L(t.node),file:T(c),engine:T(u)})}for(const[t,s]of f.spilled){const l=e.sheet(s.name);if(!l)continue;i.formulas+=1;const a=l.spillAt(t.row,t.col);if(a&&r.has(a)){i.moving+=1;continue}const c=E(f,t),u=o.value(l,t.row,t.col);c===void 0?i.uncached+=1:sameValue(c,u,n)?i.same+=1:i.differences.push({sheet:s.name,cell:$(t),formula:a?`${$(a)}#`:"",file:T(c),engine:T(u)})}return i}function Ke(f,e){const o=new Map,n=[];for(const i of f){const r=e.find(l=>i.startsWith(`${l}: `));if(r===void 0){n.push(i);continue}const t=i.slice(r.length+2),s=o.get(t);s?s.push(r):o.set(t,[r])}for(const[i,r]of o)n.push(r.length===1?`${r[0]??""}: ${i}`:`${i}, on ${String(r.length)} sheets (${A(r)})`);return n}function Ye(f,e,o){const n=o.circularCells();if(n.length===0)return!1;const i=new Map;for(const[s,l]of f.carried)i.set(`${l.name}|${String(s.row)}|${String(s.col)}`,s);let r=0,t=0;for(const s of n){const l=i.get(`${s.sheet.name}|${String(s.row)}|${String(s.col)}`),a=l===void 0?void 0:E(f,l),c=e[s.sheet.index],u=s.shared.source.path??[];if(a===void 0||!c||u[2]!=="cells"){a!==void 0&&(t+=1);continue}const h=re(a,void 0),p=c.cells??={},m=$(s),w=p[m],d=p[String(u[3])],g=d!==null&&typeof d=="object"?d:{};p[m]=w!==null&&typeof w=="object"?{...w,start:h}:{...g,formula:s.text,start:h},r+=1}return t>0&&f.lost.push(`where ${String(t)} cells of a table or a block start iterative calculation: they start from 0`),r>0}export function importXlsx(f,e){const o=Se(f,e.zip);if(Ue(o),_e(o),o.sheets.length===0)throw new Error("It holds no sheets.");const n={book:o,taken:e.taken??(()=>!1),files:new Map,assets:new Map,lost:[...o.lost],tables:new Set(o.sheets.flatMap(m=>m.tables.filter(w=>se(w)===void 0).map(w=>w.name.toLowerCase()))),names:new Set,carried:new Map,spilled:new Map};o.date1904&&n.lost.push(`the 1904 date system: dates are moved to the 1900 one, ${String(Y)} days on`),(o.font.name!==void 0&&o.font.name!=="Calibri"||o.font.size!==void 0&&o.font.size!==11)&&n.lost.push(`its default font, ${o.font.name??""} ${String(o.font.size??"")}`);const i=Fe(n);Te(n);const r=o.sheets.map((m,w)=>{const d=new Ie(n,m).build(),g=i.sheets.get(w);return g&&!b(g.names)&&(d.names=g.names),g&&g.hidden.length>0&&(d.hidden_names=g.hidden),d}),t=De(n,i.names),s={title:o.title??e.name,...b(i.names)?{}:{names:i.names},...i.hidden.length>0?{hidden_names:i.hidden}:{},sheets:r,...b(t)?{}:{scenarios:t},...o.iteration===void 0?{}:{iteration:o.iteration}},l=()=>{const m=ve(s),w=new Map([[le,m],...n.files]);return{files:w,...pe({text:m,read:d=>w.get(d),exists:d=>w.has(d)||n.assets.has(d)})}};let a=l();a.calc&&Ye(n,r,a.calc)&&(a=l());const{files:c,workbook:u,calc:h,problems:p}=a;return{files:c,assets:n.assets,lost:Ke(n.lost,o.sheets.map(m=>m.name)),problems:p,compared:u&&h?Je(n,u,h,e.tolerance??COMPARE_TOLERANCE):{formulas:0,same:0,uncached:0,moving:0,differences:[]},sheets:o.sheets.length,tables:n.tables.size}}
2
+ import{SHEET_FILE as le,SHEET_NOTE_AUTHOR as fe,SHEET_PICTURE_HEIGHT as W,SHEET_SEPARATOR as ae}from"@allyhub/formats";import{cellName as $,columnLetter as M,contains as z,overlaps as R,rangeName as S,readAddress as ce,readArea as B}from"../address.js";import{rectangles as O}from"../api/rectangles.js";import{chartAfter as ue}from"../chart.js";import{analyse as he}from"../calc/analyse.js";import{ITERATION_DEFAULTS as de}from"../calc/engine.js";import{FUNCTIONS as me}from"../calc/functions/index.js";import{checkWorkbook as pe}from"../check.js";import{writeCsv as we}from"@allyhub/formats";import{pictureSize as ge}from"../files.js";import{isDateCode as N}from"../format.js";import{moveFormula as ke,relativeKey as be}from"../formula/move.js";import{printFormula as L,sheetPrefix as U}from"../formula/print.js";import{mapNode as V,walk as I}from"../formula/walk.js";import{CellError as _,isoOfSerial as ye,readTyped as j,writeTyped as H}from"../values.js";import{joinedRuns as $e,plainRuns as xe}from"../rich.js";import{runsOver as Le}from"./runs.js";import{FormulaCell as Z,validName as q}from"../workbook.js";import{writeSheetYaml as ve}from"../write.js";import{readFileFormula as Se}from"./formula.js";import{hasDate as J}from"./numfmt.js";import{placesLine as A,readXlsx as Ce}from"./read.js";import{LISTS_SHEET as Ee}from"./write.js";const K=100,Me=.5,Y=1462,X=64,G=1e4;export const COMPARE_TOLERANCE=1e-9;const Q=f=>f.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/gu,"")||"rows",b=f=>{for(const e in f)if(Object.hasOwn(f,e))return!1;return!0},F=(f,e)=>`${String(f)} ${e}${f===1?"":"s"}`,C=f=>({row:f.row,col:f.col});function ee(f){return f===""||f.length>255||/^[/\\]|^[A-Za-z]:|\\|\0/u.test(f)?!1:f.split("/").every(e=>e!==""&&e!=="."&&e!=="..")}class Oe{cells;starts;first;constructor(e){let n=!0;for(let t=1;t<e.length&&n;t++){const s=e[t-1],l=e[t];s&&l&&(l.row<s.row||l.row===s.row&&l.col<=s.col)&&(n=!1)}if(!n){e.sort((t,s)=>t.row-s.row||t.col-s.col);for(let t=e.length-1;t>0;t--){const s=e[t-1],l=e[t];l&&s?.row===l.row&&s.col===l.col&&e.splice(t-1,1)}}this.cells=e;const o=e[0]?.row??0,i=e[e.length-1]?.row??-1;this.first=o,this.starts=new Int32Array(Math.max(0,i-o+2));let r=0;for(let t=0;t<this.starts.length;t++){for(;r<e.length&&(e[r]?.row??0)<o+t;)r++;this.starts[t]=r}}get(e,n){const o=e-this.first;if(o<0||o>=this.starts.length-1)return;let i=this.starts[o]??0,r=(this.starts[o+1]??0)-1;for(;i<=r;){const t=i+r>>1,s=this.cells[t];if(!s)return;if(s.col===n)return s;s.col<n?i=t+1:r=t-1}}}class te{list=[];add(e){this.list.push(e)}has(e,n){for(const o of this.list)if(z(o,e,n))return!0;return!1}}function ne(f){const e=/\.([A-Za-z0-9]+)$/u.exec(f)?.[1]?.toLowerCase();return e==="jpeg"?"jpg":e==="tif"?"tiff":e}function oe(f,e){const n=e.toLowerCase();return V(f,o=>o.kind!=="structured"||o.table?.toLowerCase()!==n||!o.thisRow&&o.columns.length===0&&o.sections.length===0?o:Object.fromEntries(Object.entries(o).filter(([i])=>i!=="table")))}function _e(f){const e=new Map;for(const o of f.sheets)for(const i of o.tables)i.totals>0&&e.set(i.name.toLowerCase(),{t:i,sheet:o.name});if(e.size===0)return;const n=(o,i)=>{const r=i.table===void 0?void 0:e.get(i.table.toLowerCase());if(!r||i.thisRow)return;const{t}=r,s=i.sections,l=s.includes("#All");if(!l&&!s.includes("#Totals"))return;const a=y=>t.columns.findIndex(x=>x.name.toLowerCase()===y.toLowerCase()),[c,u]=i.columns,h=c===void 0?0:a(c),p=c===void 0?t.columns.length-1:u===void 0?h:a(u);if(h<0||p<0)return;const m=l?t.ref.top:s.includes("#Data")?t.ref.top+t.headers:s.includes("#Headers")?t.ref.top:t.ref.bottom-t.totals+1,w=t.ref.bottom,d=t.ref.left+Math.min(h,p),g=t.ref.left+Math.max(h,p),k=m!==w||d!==g;return{kind:"ref",...r.sheet===o?{}:{sheet:r.sheet},col:{index:d,abs:!0},row:{index:m,abs:!0},...k?{col2:{index:g,abs:!0},row2:{index:w,abs:!0}}:{},range:k}};for(const o of f.sheets)for(const i of o.cells)i.node&&(i.node=V(i.node,r=>r.kind==="structured"?n(o.name,r)??r:r.kind==="unary"&&r.op==="@"&&r.arg.kind==="ref"&&!r.arg.range?r.arg:r))}const Ae=1e3;function se(f){return f.headers===0?"has no header row":f.columns.length!==f.ref.right-f.ref.left+1||!q(f.name)?"cannot be held as a table":new Set(f.columns.map(e=>e.name.toLowerCase())).size===f.columns.length?void 0:"has two columns of one name"}function D(f,e,n){let o;const i=new Set;I(f,t=>{t.kind==="call"&&(t.name==="LET"||t.name==="LAMBDA")&&t.args.forEach(s=>{s.kind==="name"&&i.add(s.name.toLowerCase())})});const r=t=>i.has(t)||n===void 0||n.names.has(t)||n.tables.has(t);return I(f,t=>{o===void 0&&(t.kind==="call"&&!me.has(t.name)&&(r(t.written.toLowerCase())||(o=`no function ${t.name}`)),t.kind==="name"&&!r(t.name.toLowerCase())&&(o=`no name ${t.name}`),t.kind==="structured"&&t.table!==void 0&&!r(t.table.toLowerCase())&&(o=`no table ${t.table}`),(t.kind==="ref"||t.kind==="name"||t.kind==="error")&&t.sheet!==void 0&&(t.sheet.startsWith("[")?o="it reads another workbook":e.has(t.sheet.toLowerCase())||(o=`no sheet ${t.sheet}`)))}),o}function Te(f){const e=new Set(f.book.sheets.map(n=>n.name.toLowerCase()));for(const n of f.book.sheets){const o=new Map,i=(t,s)=>{const l=o.get(s),a=$(t);l?l.push(a):o.set(s,[a])},r=[];for(const t of n.cells){if(t.unread!==void 0){i(t,/^\[|[!']\[|\[\d+\]/u.test(t.unread)?"it reads another workbook":`it could not be read: ${t.unread}`);continue}if(!t.node)continue;const s=D(t.node,e,f);s!==void 0?(delete t.node,i(t,s)):(f.carried.set(t,n),t.array&&S(t.array)!==$(t)&&r.push(t))}ze(f,n,r);for(const[t,s]of o)f.lost.push(`${n.name}: ${F(s.length,"formula")} kept as ${s.length===1?"its value":"their values"}, as ${t} (${A(s)})`)}}function ze(f,e,n){if(n.length===0)return;const o=new Set;for(const i of n){const{array:r}=i;if(r)for(const t of e.cells)t!==i&&!t.node&&z(r,t.row,t.col)&&o.add(t)}e.cells=e.cells.filter(i=>!o.has(i));for(const i of o)f.spilled.set(i,e)}function E(f,e){const{value:n}=e;if(!f.book.date1904||typeof n!="number")return n;const o=f.book.looks[e.style]?.format;return N(o)&&o!==void 0&&J(o)?n+Y:n}function P(f,e){if(typeof f!="number"||e===void 0||!N(e)||!J(e)||f<1)return;const n=ye(f);return j(n).value===f?n:void 0}const Re=(f,e)=>P(f,e)??H(f??null);function re(f,e){const n=P(f,e);return n!==void 0?n:f==null?null:typeof f=="number"||typeof f=="boolean"?f:H(f)}function Ne(f){const e=[];for(let s=0;s<f.length;s++){const l=f[s];if(!l)continue;const a=e[e.length-1];a?.row===l.row&&a.right===l.col-1?(a.right=l.col,a.last=s):e.push({row:l.row,left:l.col,right:l.col,first:s,last:s})}const n=e.map((s,l)=>l),o=s=>{let l=s;for(;n[l]!==l;){const a=n[n[l]??l]??l;n[l]=a,l=a}return l};let i=0,r=0;for(let s=0;s<e.length;s++){const l=e[s];if(l){s>0&&e[s-1]?.row!==l.row&&(i=e[s-1]?.row===l.row-1?r:s,r=s);for(let a=i;a<r;a++){const c=e[a];c?.row===l.row-1&&c.right>=l.left&&c.left<=l.right&&(n[o(s)]=o(a))}}}const t=new Map;return e.forEach((s,l)=>{const a=o(l),c=t.get(a),u=s.right-s.left+1;c?(c.box.top=Math.min(c.box.top,s.row),c.box.bottom=Math.max(c.box.bottom,s.row),c.box.left=Math.min(c.box.left,s.left),c.box.right=Math.max(c.box.right,s.right),c.count+=u,c.runs.push(l)):t.set(a,{box:{top:s.row,bottom:s.row,left:s.left,right:s.right},count:u,runs:[l]})}),[...t.values()].map(s=>({box:s.box,count:s.count,cells:()=>s.runs.flatMap(l=>{const a=e[l];return a?f.slice(a.first,a.last+1):[]})}))}const ie=f=>JSON.stringify(f);class Ie{ctx;read;cells;inTables=new te;columnLooks=new Map;rowLooks=new Map;lookDone=new te;tables=[];areas=[];filtered=[];ownLooks=new Map;fileColumns=new Map;pictured=new Map;over=[];keys=new Map;constructor(e,n){this.ctx=e,this.read=n,this.cells=new Oe(n.cells)}at(e,n){return this.cells.get(e,n)}look(e){return this.ctx.book.looks[e.style]??{}}runs(e){if(!e.runs||e.node||typeof e.value!="string")return;const n=$e(Le(e.runs,this.look(e),this.ctx.book.font));return n.length===0||xe(n)?void 0:n}code(e){return this.look(e).format}text(e){return e.node?L(e.node):Re(E(this.ctx,e),this.code(e))}baseLooks(){const{read:e}=this,{looks:n}=this.ctx.book;let o=-1;for(const r of e.cells)r.col>o&&(o=r.col);for(const r of e.columns){if(r.style===void 0)continue;const t=n[r.style];if(!(!t||b(t)))for(let s=r.min;s<=Math.min(r.max,o);s++)this.columnLooks.set(s,t)}for(const r of e.rows){const t=r.style===void 0?void 0:n[r.style];t&&!b(t)&&this.rowLooks.set(r.row,t)}const i=(r,t)=>{for(const s in t)if(!(s in r))return!1;return!0};for(const r of e.cells){const t=this.look(r),s=this.columnLooks.get(r.col);s&&!i(t,s)&&this.columnLooks.delete(r.col);const l=this.rowLooks.get(r.row);l&&!i(t,l)&&this.rowLooks.delete(r.row)}}ownLook(e){const n=this.columnLooks.get(e.col),o=this.rowLooks.get(e.row),i=this.look(e),r=i.format!==void 0&&N(i.format);if(!n&&!o&&!r){let a=this.ownLooks.get(e.style);return a||(a={look:i,key:ie(i)},this.ownLooks.set(e.style,a)),a}const t={...n,...o},s={};for(const[a,c]of Object.entries(i))JSON.stringify(c)!==JSON.stringify(t[a])&&(s[a]=c);const l=s.format;if(typeof l=="string"){const a=e.node?void 0:P(E(this.ctx,e),l);a!==void 0&&j(a).format===l&&delete s.format}return{look:s,key:ie(s)}}keyOf(e,n){if(e.key!==void 0)return e.key;const o=be(n,e.row,e.col),i=this.keys.get(o);return i!==void 0?e.key=i:(this.keys.set(o,o),e.key=o)}columnFormula(e,n,o){const i=new Map,r=o-n+1;for(let s=n;s<=o;s++){const l=this.at(s,e);if(!l||l.value===void 0&&!l.node||l.value===null&&!l.node)return;if(!l.node)continue;const a=this.keyOf(l,l.node),c=i.get(a);c?c.n+=1:i.set(a,{n:1,cell:l})}let t;for(const s of i.values())(!t||s.n>t.n)&&(t=s);return t&&t.n*2>r?t.cell:void 0}csv(e,n){const o=[];for(let i=0;i<e;i+=G){const r=[];for(let t=i;t<Math.min(e,i+G);t++)r.push(n(t));o.push(we(r))}return o.join("")}table(e){const{read:n,ctx:o}=this,i=d=>o.lost.push(`${n.name}: table ${e.name} ${d}`),r=e.ref.right-e.ref.left+1,t=se(e);if(t!==void 0)return i(`${t}, so its cells are kept and it is no table`),!1;const s=e.ref.top,l=s+1;let a=e.ref.bottom-e.totals;if(e.totals===0){let d=s;for(const g of n.cells)g.col>=e.ref.left&&g.col<=e.ref.right&&g.row>d&&(d=g.row);a-d>Ae&&(i(`runs ${String(a-d)} empty rows past what it holds, which are left out`),a=d)}e.totals>0&&i("has a totals row, kept as plain cells under it");const c=e.columns.map((d,g)=>a>=l?this.columnFormula(e.ref.left+g,l,a):void 0),u=d=>{const g=c[d];if(!g)return!1;for(let k=l;k<=a;k++)if(this.at(k,e.ref.left+d)?.key!==g.key)return!1;return!0};let h=r;for(;h>1&&u(h-1);)h-=1;const p={},m=this.path(e.name);o.files.set(m,this.csv(a-l+2,d=>{if(d===0)return e.columns.slice(0,h).map(y=>y.name);const g=l+d-1,k=[];for(let y=0;y<h;y++){const x=this.at(g,e.ref.left+y),v=c[y];x?v&&x.key===v.key?k.push(""):x.node?k.push(L(oe(x.node,e.name))):k.push(this.text(x)):k.push("")}return k})),this.inTables.add({...e.ref,bottom:a}),e.columns.forEach((d,g)=>{const k=e.ref.left+g,y=this.columnLook(k,l,a),x=c[g];x?.node&&(y.formula=L(oe(ke(x.node,l-x.row,0),e.name)));const v=this.fileColumns.get(k);v!==void 0&&l<=a&&(y.files=v===W?!0:{height:v}),b(y)||(p[d.name]=y)});const w=new Map;for(const[d,g]of e.filter?.columns??[]){const k=e.columns[d]?.name;k!==void 0&&w.set(k,g)}return(e.filter?.unread??0)>0&&i(`has ${F(e.filter?.unread??0,"filter")} by condition, its rows left as they were hidden`),this.tables.push({name:e.name,at:$({row:s,col:e.ref.left}),rows:m,...e.style!==void 0&&e.style!=="TableStyleMedium2"?{style:e.style}:{},...e.options,...b(p)?{}:{columns:p},...e.filter===void 0?{filter:!1}:w.size>0?{filter:{columns:Object.fromEntries(w)}}:{}}),e.filter?.unread===0&&e.filter.columns.size>0&&this.filtered.push({...e.ref,bottom:a}),this.areas.push({...e.ref,bottom:a}),!0}columnLook(e,n,o){let i,r={};for(let t=n;t<=o;t++){const s=this.at(t,e),l=s?this.ownLook(s):{look:{},key:"{}"};if(i===void 0)i=l.key,r=l.look;else if(i!==l.key)return{}}return b(r)?{}:(this.lookDone.add({top:n,bottom:o,left:e,right:e}),{...r})}path(e){const n=Q(e);let o=`${n}.csv`;for(let i=2;this.ctx.files.has(o)||this.ctx.taken(o);i++)o=`${n}-${String(i)}.csv`;return o}loose(){const e=[],n=[];for(const o of this.read.cells)this.inTables.has(o.row,o.col)||(o.node?e.push(o):o.value!==void 0&&o.value!==null&&n.push(o));return{formulas:e,typed:n}}blockAreas(e,n){const o=[],i=O(n.map(C)),r=s=>!o.some(l=>R(l,s))&&!this.areas.some(l=>R(l,s))&&!i.some(l=>R(l,s)),t=s=>(s.bottom-s.top+1)*(s.right-s.left+1);for(const s of Ne(e)){const{box:l}=s;if(!(t(l)<K)){if(s.count/t(l)>=Me&&r(l)){o.push(l);continue}for(const a of O(s.cells().map(C)))t(a)>=K&&r(a)&&o.push(a)}}return o.sort((s,l)=>s.top-l.top||s.left-l.left)}cells_(e){const{formulas:n,typed:o}=this.loose(),i=new Map;for(const c of o){const u=this.runs(c);u&&i.set(c,u)}const r=this.read.cells.filter(c=>this.inTables.has(c.row,c.col)&&this.runs(c)!==void 0);r.length>0&&this.ctx.lost.push(`${this.read.name}: ${F(r.length,"cell")} of rich text in a table, kept as plain text (${A(r.map(c=>$(c)))})`);const t=this.blockAreas(o.filter(c=>!i.has(c)),[...n,...i.keys()]),s=c=>t.some(u=>z(u,c.row,c.col));t.length>0&&(e.blocks=t.map(c=>{const u=this.path(this.read.name);return this.ctx.files.set(u,this.csv(c.bottom-c.top+1,h=>{const p=[];for(let m=c.left;m<=c.right;m++){const w=this.at(c.top+h,m);p.push(w?this.text(w):"")}return p})),{at:$({row:c.top,col:c.left}),rows:u}}));const l=[],a=new Map;for(const c of n){if(!c.node)continue;const u=this.keyOf(c,c.node),h=a.get(u);h?h.push(c):a.set(u,[c])}for(const c of a.values())for(const u of O(c.map(C))){const h=this.at(u.top,u.left);h?.node&&l.push([{row:u.top,col:u.left},S(u),L(h.node)])}for(const c of o){if(t.length>0&&s(c))continue;const u=i.get(c);l.push([C(c),$(c),u?{runs:u}:re(E(this.ctx,c),this.code(c))])}l.sort(([c],[u])=>c.row-u.row||c.col-u.col),l.length>0&&(e.cells=Object.fromEntries(l.map(([,c,u])=>[c,u])))}formats(e){const n=new Map,o=this.lookDone.list.length>0;for(const r of this.read.cells){if(o&&this.lookDone.has(r.row,r.col))continue;const t=this.ownLook(r);if(b(t.look))continue;const s=n.get(t.key);s?s.places.push(C(r)):n.set(t.key,{look:t.look,places:[C(r)]})}const i=[];for(const{look:r,places:t}of n.values())for(const s of O(t))i.push({range:S(s),...r});i.length>0&&(e.format=i)}columns(e){const{read:n}=this,o=new Map;let i=0;for(const t of n.cells)t.col>i&&(i=t.col);const r=[];for(const t of n.columns){if(t.width===void 0&&t.hidden!==!0&&t.level===void 0)continue;const s=t.max-Math.max(t.min,i+1)+1>X?Math.max(i,t.min+X-1):t.max;s<t.max&&r.push(`${M(s+1)}:${M(t.max)}`);const l=t.width!==void 0&&t.width<=0;for(let a=t.min;a<=s;a++)o.set(a,{...t.width===void 0||l?{}:{width:t.width},...t.hidden===!0||l?{hidden:!0}:{},...t.level===void 0?{}:{level:t.level}})}for(const[t,s]of this.columnLooks)o.set(t,{...o.get(t),...s});for(const[t,s]of this.fileColumns)this.tableColumn(t)||o.set(t,{...o.get(t),files:s===W?!0:{height:s}});o.size>0&&(e.columns=Object.fromEntries([...o.keys()].sort((t,s)=>t-s).map(t=>[M(t),o.get(t)??{}]))),r.length>0&&this.ctx.lost.push(`${n.name}: the size of columns ${A(r)}, past those that hold anything`)}tableColumn(e){return this.areas.some(n=>e>=n.left&&e<=n.right)}rows(e){const n={};for(const o of this.read.rows){const i=this.rowLooks.get(o.row),r=this.filtered.some(a=>o.row>a.top&&o.row<=a.bottom),t=o.height!==void 0&&this.pictured.get(o.row)!==o.height?o.height:void 0,s=t!==void 0&&t<=0,l={...t===void 0||s?{}:{height:t},...(o.hidden===!0||s)&&!r?{hidden:!0}:{},...o.level===void 0?{}:{level:o.level},...i};b(l)||(n[String(o.row+1)]=l)}b(n)||(e.rows=n)}assetPath(e,n){const o=s=>{const l=this.ctx.assets.get(s);return l?je(l,n.bytes):!this.ctx.taken(s)};if(e!==void 0&&ne(e)===ne(`.${n.type}`)&&ee(e)&&o(e))return e;const r=Q((n.name??"picture").replace(/\.[A-Za-z0-9]+$/u,""));let t=`${r}.${n.type}`;for(let s=2;!o(t);s++)t=`${r}-${String(s)}.${n.type}`;return t}pictures(){const e=this.over;for(const n of this.read.pictures){const o=this.at(n.row,n.col),i=typeof o?.value=="string"?o.value:"";if(n.y===void 0&&n.descr!==void 0&&ee(n.descr)&&i.split(ae).includes(n.descr)&&n.descr!==void 0){this.ctx.assets.set(n.descr,n.bytes),this.fileColumns.set(n.col,Math.max(this.fileColumns.get(n.col)??0,n.height)),this.pictured.set(n.row,Math.max(this.pictured.get(n.row)??0,n.height));continue}if(n.width<=0||n.height<=0){this.ctx.lost.push(`${this.read.name}: a picture of no size at ${$({row:n.row,col:n.col})}`);continue}const t=this.assetPath(n.descr,n);this.ctx.assets.set(t,n.bytes);const s=ge(n.bytes),l=s?.width===n.width&&s.height===n.height;e.push({file:t,at:$({row:n.row,col:n.col}),...n.x===void 0?{}:{x:n.x},...n.y===void 0?{}:{y:n.y},...l?{}:{width:n.width,height:n.height}})}}build(){const{read:e}=this;this.baseLooks(),this.pictures();for(const o of e.tables)this.table(o);const n={name:e.name};return e.state!=="visible"&&(n.hidden=!0),e.gridlines===!1&&(n.gridlines=!1),e.tab!==void 0&&(n.tab=e.tab),e.state==="veryHidden"&&this.ctx.lost.push(`${e.name}: being very hidden; it is hidden`),e.freeze&&(e.freeze.row>0||e.freeze.col>0)&&(n.freeze=$(e.freeze)),this.tables.length>0&&(n.tables=this.tables),this.filter(n),this.columns(n),this.rows(n),this.cells_(n),e.merges.length>0&&(n.merges=e.merges.map(S)),this.formats(n),e.conditional.length>0&&(n.conditional=e.conditional),e.sparklines!==void 0&&(n.sparklines=e.sparklines),e.validations.length>0&&(n.validations=e.validations),e.charts.length>0&&(n.charts=e.charts.map(o=>this.chart(o))),this.over.length>0&&(n.pictures=this.over),b(e.links)||(n.links=e.links),e.notes.length>0&&(n.notes=Object.fromEntries(e.notes.map(o=>[o.ref,o.author===void 0||o.author===fe?o.text:{text:o.text,author:o.author}]))),e.print&&(n.print=e.print),e.protect===!0&&(n.protect=!0),e.outline&&(n.outline=e.outline),n}chart(e){return ue(e,n=>{const o=this.chartReference(n.replace(/^=/u,""));return n.startsWith("=")?`=${o}`:o})}chartReference(e){const n=e.lastIndexOf("!"),i=(n<0?this.read.name:e.slice(0,n)).replace(/^'|'$/gu,"").replaceAll("''","'"),r=B(e.slice(n+1).replaceAll("$",""));if(!r)return e;const t=this.ctx.book.sheets.find(s=>s.name.toLowerCase()===i.toLowerCase());for(const s of t?.tables??[]){const l=s.ref.top+1,c=r.left===r.right&&r.top===l&&r.bottom===s.ref.bottom&&r.left>=s.ref.left&&r.left<=s.ref.right?s.columns[r.left-s.ref.left]:void 0;if(c&&this.ctx.tables.has(s.name.toLowerCase()))return L({kind:"structured",table:s.name,sections:[],columns:[c.name],thisRow:!1}).slice(1)}return`${t===this.read||n<0?"":`${e.slice(0,n)}!`}${S(r)}`}filter(e){const{filter:n}=this.read;if(!n)return;const o={};for(const[i,r]of n.columns)o[M(n.ref.left+i)]=r;e.filter={range:S(n.ref),...b(o)?{}:{columns:o}},n.unread===0&&!b(o)&&this.filtered.push(n.ref)}}const je=(f,e)=>f.length===e.length&&f.every((n,o)=>n===e[o]),He=new Set(["_xlnm._FilterDatabase","_xlnm.Print_Area","_xlnm.Print_Titles"]);function Fe(f){const e={},n=[],o=new Map,{book:i,lost:r}=f,t=new Set(i.sheets.map(u=>u.name.toLowerCase())),s=new Set,l=[];let a;const c=u=>{a=void 0;const h=We(u.text);if(h!==void 0)return typeof h=="string"?H(h):h;const p=Se(u.text,!0),m=p.ok?D(p.node,t):"it could not be read";if(!p.ok||m!==void 0||Pe(p.node)){r.push(`the name ${u.name} (${u.text})${m===void 0?"":`: ${m}`}`);return}return a=p.node,L(p.node)};for(const u of i.names){if(u.name.startsWith("_xlnm.")){He.has(u.name)||r.push(`Excel's name ${u.name}`);continue}if(/^_xl(?:fn|pm|ws|udf)/iu.test(u.name))continue;const h=u.name.toLowerCase(),p=u.sheet===void 0?"":String(u.sheet);if(!q(u.name)||f.tables.has(h)){r.push(`the name ${u.name}, which cannot be held here`);continue}if(s.has(`${p}|${h}`)){r.push(`a second name ${u.name}${p===""?"":` of ${i.sheets[u.sheet??0]?.name??""}`}`);continue}const m=c(u);if(m===void 0)continue;s.add(`${p}|${h}`),f.names.add(h);const w=u.sheet===void 0?void 0:o.get(u.sheet)??{names:{},hidden:[]},d=w?.names??e;d[u.name]=m,u.hidden===!0&&(w?.hidden??n).push(u.name),w&&u.sheet!==void 0&&o.set(u.sheet,w),a&&l.push({held:d,n:u,node:a})}for(const{held:u,n:h,node:p}of l){const m=D(p,t,{names:f.names,tables:f.tables});m!==void 0&&(u[h.name]="=#NAME?",r.push(`the name ${h.name} (${h.text}): ${m}; it holds #NAME?, as in Excel`))}return{names:e,hidden:n,sheets:o}}function De(f,e){const n={},o=new Map;for(const[i,r]of Object.entries(e))typeof r=="string"&&r.startsWith("=")&&o.set(r.slice(1).replaceAll("$","").toLowerCase(),i);for(const i of f.book.sheets)for(const r of i.scenarios){const t={};let s=!0;for(const{at:l,value:a}of r.cells){const c=ce(l),u=c&&i.cells.find(m=>m.row===c.row&&m.col===c.col);String(u?.value??"")!==a&&(s=!1);const h=o.get(`${U(i.name)}${l}`.toLowerCase())??o.get(l.toLowerCase()),p=j(a);h===void 0?f.lost.push(`${i.name}: scenario ${r.name}'s cell ${l}, which has no name`):t[h]=typeof p.value=="number"?p.value:a}!s&&!b(t)&&(n[r.name]={...n[r.name],...t})}return n}function Pe(f){let e=!1;return I(f,n=>{e||=n.kind==="error"&&n.code==="#REF!"}),e}function We(f){const e=f.trim();return/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/u.test(e)?Number(e):/^true$/iu.test(e)?!0:/^false$/iu.test(e)?!1:/^"((?:[^"]|"")*)"$/u.exec(e)?.[1]?.replaceAll('""','"')}const Be=new RegExp(`^${Ee.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")}(?: \\(\\d+\\))?$`,"u");function Ue(f){const e=f.sheets.find(r=>r.state==="veryHidden"&&Be.test(r.name));if(!e)return;const n=U(e.name).toLowerCase(),o=r=>{const t=r.replace(/^=/u,"");if(!t.toLowerCase().startsWith(n))return;const s=B(t.slice(n.length).replaceAll("$",""));if(!s||s.left!==s.right)return;const l=[];for(let a=s.top;a<=s.bottom;a++){const c=e.cells.find(u=>u.row===a&&u.col===s.left);l.push(typeof c?.value=="string"?c.value:"")}return l};for(const r of f.sheets)r.validations=r.validations.map(t=>{const[s]=t.formula??[],l=t.type==="list"&&typeof s=="string"?o(s):void 0;if(!l)return t;const a={...t,values:l};return delete a.formula,a});const i=f.sheets.indexOf(e);f.sheets=f.sheets.filter(r=>r!==e),f.names=f.names.flatMap(r=>r.sheet===void 0||r.sheet<i?[r]:r.sheet===i?[]:[{...r,sheet:r.sheet-1}])}const T=f=>f instanceof _?f.code:f??null,Ve=new Map([["#SPILL!","#VALUE!"],["#CALC!","#VALUE!"]]);export function sameValue(f,e,n){if(typeof f=="number"&&typeof e=="number")return f===e?!0:Math.abs(f-e)<=Math.max(Math.abs(f),Math.abs(e))*n;if(f instanceof _||e instanceof _){const o=i=>i instanceof _?Ve.get(i.code)??i.code:void 0;return o(f)===o(e)}if(f===null||e===null){const o=f??e;return o===null||o===""||o===0||o===!1}return f===e}function Ze(f,e){const n=[];for(const r of e.sheets)for(const t of r.formulas)t.shared.node&&he(e,t.shared,r).volatile&&n.push(t);const o=new Set(n),i=[...n];for(;;){const r=i.pop();if(!r)return o;for(const t of f.readers(r.sheet,r.row,r.col))o.has(t)||(o.add(t),i.push(t))}}function qe(f){const e=f.file.iteration;return(e===void 0||e===!0?void 0:e.max_change)??de.max_change}function Je(f,e,n,o){const i={formulas:0,same:0,uncached:0,moving:0,differences:[]},r=Ze(n,e);for(const[t,s]of f.carried){if(!t.node)continue;const l=e.sheet(s.name);if(!l)continue;i.formulas+=1;const a=l.at(t.row,t.col);if(a instanceof Z&&r.has(a)){i.moving+=1;continue}const c=E(f,t);if(c===void 0){i.uncached+=1;continue}const u=n.value(l,t.row,t.col);a instanceof Z&&n.iterates(a)&&typeof c=="number"&&typeof u=="number"&&Math.abs(c-u)<=qe(e)||sameValue(c,u,o)?i.same+=1:i.differences.push({sheet:s.name,cell:$(t),formula:L(t.node),file:T(c),engine:T(u)})}for(const[t,s]of f.spilled){const l=e.sheet(s.name);if(!l)continue;i.formulas+=1;const a=l.spillAt(t.row,t.col);if(a&&r.has(a)){i.moving+=1;continue}const c=E(f,t),u=n.value(l,t.row,t.col);c===void 0?i.uncached+=1:sameValue(c,u,o)?i.same+=1:i.differences.push({sheet:s.name,cell:$(t),formula:a?`${$(a)}#`:"",file:T(c),engine:T(u)})}return i}function Ke(f,e){const n=new Map,o=[];for(const i of f){const r=e.find(l=>i.startsWith(`${l}: `));if(r===void 0){o.push(i);continue}const t=i.slice(r.length+2),s=n.get(t);s?s.push(r):n.set(t,[r])}for(const[i,r]of n)o.push(r.length===1?`${r[0]??""}: ${i}`:`${i}, on ${String(r.length)} sheets (${A(r)})`);return o}function Ye(f,e,n){const o=n.circularCells();if(o.length===0)return!1;const i=new Map;for(const[s,l]of f.carried)i.set(`${l.name}|${String(s.row)}|${String(s.col)}`,s);let r=0,t=0;for(const s of o){const l=i.get(`${s.sheet.name}|${String(s.row)}|${String(s.col)}`),a=l===void 0?void 0:E(f,l),c=e[s.sheet.index],u=s.shared.source.path??[];if(a===void 0||!c||u[2]!=="cells"){a!==void 0&&(t+=1);continue}const h=re(a,void 0),p=c.cells??={},m=$(s),w=p[m],d=p[String(u[3])],g=d!==null&&typeof d=="object"?d:{};p[m]=w!==null&&typeof w=="object"?{...w,start:h}:{...g,formula:s.text,start:h},r+=1}return t>0&&f.lost.push(`where ${String(t)} cells of a table or a block start iterative calculation: they start from 0`),r>0}export function importXlsx(f,e){const n=Ce(f,e.zip);if(Ue(n),_e(n),n.sheets.length===0)throw new Error("It holds no sheets.");const o={book:n,taken:e.taken??(()=>!1),files:new Map,assets:new Map,lost:[...n.lost],tables:new Set(n.sheets.flatMap(m=>m.tables.filter(w=>se(w)===void 0).map(w=>w.name.toLowerCase()))),names:new Set,carried:new Map,spilled:new Map};n.date1904&&o.lost.push(`the 1904 date system: dates are moved to the 1900 one, ${String(Y)} days on`),(n.font.name!==void 0&&n.font.name!=="Calibri"||n.font.size!==void 0&&n.font.size!==11)&&o.lost.push(`its default font, ${n.font.name??""} ${String(n.font.size??"")}`);const i=Fe(o);Te(o);const r=n.sheets.map((m,w)=>{const d=new Ie(o,m).build(),g=i.sheets.get(w);return g&&!b(g.names)&&(d.names=g.names),g&&g.hidden.length>0&&(d.hidden_names=g.hidden),d}),t=De(o,i.names),s={title:n.title??e.name,...n.theme===void 0?{}:{theme:n.theme},...b(i.names)?{}:{names:i.names},...i.hidden.length>0?{hidden_names:i.hidden}:{},sheets:r,...b(t)?{}:{scenarios:t},...n.iteration===void 0?{}:{iteration:n.iteration}},l=()=>{const m=ve(s),w=new Map([[le,m],...o.files]);return{files:w,...pe({text:m,read:d=>w.get(d),exists:d=>w.has(d)||o.assets.has(d)})}};let a=l();a.calc&&Ye(o,r,a.calc)&&(a=l());const{files:c,workbook:u,calc:h,problems:p}=a;return{files:c,assets:o.assets,lost:Ke(o.lost,n.sheets.map(m=>m.name)),problems:p,compared:u&&h?Je(o,u,h,e.tolerance??COMPARE_TOLERANCE):{formulas:0,same:0,uncached:0,moving:0,differences:[]},sheets:n.sheets.length,tables:o.tables.size}}