allyhub 0.18.0 → 0.19.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 (580) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/bin/allyhub.js +10 -0
  3. package/dist/args.js +1 -1
  4. package/dist/command.js +1 -1
  5. package/dist/commands/add.js +1 -1
  6. package/dist/commands/auth.js +1 -1
  7. package/dist/commands/cloud-tools.js +1 -1
  8. package/dist/commands/cloud.js +1 -1
  9. package/dist/commands/contributed.js +1 -1
  10. package/dist/commands/found-extensions.js +2 -0
  11. package/dist/commands/frames/common.js +1 -1
  12. package/dist/commands/frames/doc.js +1 -1
  13. package/dist/commands/frames.js +9 -9
  14. package/dist/commands/index.js +1 -1
  15. package/dist/commands/inspect/common.js +3 -3
  16. package/dist/commands/inspect/index.js +1 -1
  17. package/dist/commands/inspect/layout.js +1 -1
  18. package/dist/commands/inspect/views.js +1 -1
  19. package/dist/commands/list.js +2 -0
  20. package/dist/commands/mail.js +1 -1
  21. package/dist/commands/render.js +1 -1
  22. package/dist/commands/run-context.js +2 -0
  23. package/dist/commands.json +1 -0
  24. package/dist/fields.js +1 -1
  25. package/dist/main.js +7 -7
  26. package/dist/node_modules/@allyhub/3d-extension/dist/build.js +1 -1
  27. package/dist/node_modules/@allyhub/3d-extension/dist/scenery-build.js +1 -1
  28. package/dist/node_modules/@allyhub/3d-extension/package.json +3 -2
  29. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  30. package/dist/node_modules/@allyhub/browser/package.json +1 -1
  31. package/dist/node_modules/@allyhub/build/dist/build-plugins.js +1 -1
  32. package/dist/node_modules/@allyhub/build/dist/index.js +1 -1
  33. package/dist/node_modules/@allyhub/build/dist/meta-worker.js +1 -1
  34. package/dist/node_modules/@allyhub/build/dist/plugin.js +9 -9
  35. package/dist/node_modules/@allyhub/build/dist/prepare.js +3 -3
  36. package/dist/node_modules/@allyhub/build/dist/project-root.js +1 -1
  37. package/dist/node_modules/@allyhub/build/dist/scan.js +1 -1
  38. package/dist/node_modules/@allyhub/build/dist/sdk-parts.js +2 -0
  39. package/dist/node_modules/@allyhub/build/dist/vite.js +2 -2
  40. package/dist/node_modules/@allyhub/build/package.json +9 -1
  41. package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
  42. package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
  43. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  44. package/dist/node_modules/@allyhub/check/dist/check.js +2 -2
  45. package/dist/node_modules/@allyhub/check/package.json +1 -1
  46. package/dist/node_modules/@allyhub/cloud/dist/blobs.js +1 -1
  47. package/dist/node_modules/@allyhub/cloud/dist/call.js +1 -1
  48. package/dist/node_modules/@allyhub/cloud/dist/catalog.js +1 -1
  49. package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
  50. package/dist/node_modules/@allyhub/cloud/dist/config.js +1 -1
  51. package/dist/node_modules/@allyhub/cloud/dist/credentials.js +1 -1
  52. package/dist/node_modules/@allyhub/cloud/dist/device.js +1 -1
  53. package/dist/node_modules/@allyhub/cloud/dist/errors.js +1 -1
  54. package/dist/node_modules/@allyhub/cloud/dist/index.js +1 -1
  55. package/dist/node_modules/@allyhub/cloud/dist/loopback.js +2 -2
  56. package/dist/node_modules/@allyhub/cloud/dist/mail.js +1 -1
  57. package/dist/node_modules/@allyhub/cloud/dist/records.js +1 -1
  58. package/dist/node_modules/@allyhub/cloud/dist/signin.js +2 -2
  59. package/dist/node_modules/@allyhub/cloud/dist/sites.js +1 -1
  60. package/dist/node_modules/@allyhub/cloud/dist/token.js +1 -1
  61. package/dist/node_modules/@allyhub/cloud/dist/tools.js +2 -0
  62. package/dist/node_modules/@allyhub/cloud/dist/uploads.js +1 -1
  63. package/dist/node_modules/@allyhub/cloud/dist/voice.js +1 -1
  64. package/dist/node_modules/@allyhub/cloud/package.json +5 -1
  65. package/dist/node_modules/@allyhub/components/package.json +1 -1
  66. package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
  67. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  68. package/dist/node_modules/@allyhub/doc/package.json +1 -1
  69. package/dist/node_modules/@allyhub/doc-extension/dist/cli/find.js +1 -1
  70. package/dist/node_modules/@allyhub/doc-extension/dist/workspace.js +1 -1
  71. package/dist/node_modules/@allyhub/doc-extension/package.json +1 -1
  72. package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
  73. package/dist/node_modules/@allyhub/export/package.json +1 -1
  74. package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
  75. package/dist/node_modules/@allyhub/extension-host/dist/points.js +1 -1
  76. package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
  77. package/dist/node_modules/@allyhub/formats/dist/items.d.ts +24 -7
  78. package/dist/node_modules/@allyhub/formats/dist/items.js +1 -1
  79. package/dist/node_modules/@allyhub/formats/dist/note-shape.d.ts +1 -1
  80. package/dist/node_modules/@allyhub/formats/package.json +25 -1
  81. package/dist/node_modules/@allyhub/html-extension/package.json +1 -1
  82. package/dist/node_modules/@allyhub/i18n/package.json +1 -1
  83. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  84. package/dist/node_modules/@allyhub/image-extension/package.json +1 -1
  85. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  86. package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
  87. package/dist/node_modules/@allyhub/image-render/package.json +1 -1
  88. package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
  89. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  90. package/dist/node_modules/@allyhub/jobs/package.json +1 -1
  91. package/dist/node_modules/@allyhub/linkedin-extension/package.json +1 -1
  92. package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
  93. package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
  94. package/dist/node_modules/@allyhub/linkedin-view/src/style.css +1 -600
  95. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  96. package/dist/node_modules/@allyhub/media/package.json +5 -1
  97. package/dist/node_modules/@allyhub/media-extension/dist/asr/hear.js +1 -1
  98. package/dist/node_modules/@allyhub/media-extension/dist/vision/track.js +1 -1
  99. package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
  100. package/dist/node_modules/@allyhub/model/package.json +1 -1
  101. package/dist/node_modules/@allyhub/office-extension/package.json +1 -1
  102. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  103. package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +1 -2
  104. package/dist/node_modules/@allyhub/piece/dist/media.d.ts +1 -1
  105. package/dist/node_modules/@allyhub/piece/dist/source.d.ts +2 -2
  106. package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +2 -2
  107. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  108. package/dist/node_modules/@allyhub/project/package.json +1 -1
  109. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  110. package/dist/node_modules/@allyhub/protocol/dist/blobs.js +1 -1
  111. package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
  112. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  113. package/dist/node_modules/@allyhub/protocol/dist/errors.js +1 -1
  114. package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
  115. package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
  116. package/dist/node_modules/@allyhub/protocol/dist/jsonrpc.js +1 -1
  117. package/dist/node_modules/@allyhub/protocol/dist/kinds.js +1 -1
  118. package/dist/node_modules/@allyhub/protocol/dist/mail.js +1 -1
  119. package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
  120. package/dist/node_modules/@allyhub/protocol/dist/paywall.js +1 -1
  121. package/dist/node_modules/@allyhub/protocol/dist/purposes.js +1 -1
  122. package/dist/node_modules/@allyhub/protocol/dist/registry.js +1 -1
  123. package/dist/node_modules/@allyhub/protocol/dist/sites.js +1 -1
  124. package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
  125. package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
  126. package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
  127. package/dist/node_modules/@allyhub/protocol/package.json +41 -1
  128. package/dist/node_modules/@allyhub/registry/package.json +1 -1
  129. package/dist/node_modules/@allyhub/render/dist/errors.js +1 -1
  130. package/dist/node_modules/@allyhub/render/dist/post-probe.js +1 -1
  131. package/dist/node_modules/@allyhub/render/package.json +9 -1
  132. package/dist/node_modules/@allyhub/runtime/package.json +1 -1
  133. package/dist/node_modules/@allyhub/runtimes/dist/bundled.js +1 -1
  134. package/dist/node_modules/@allyhub/runtimes/dist/declared.js +1 -1
  135. package/dist/node_modules/@allyhub/runtimes/dist/index.js +1 -1
  136. package/dist/node_modules/@allyhub/runtimes/dist/manifest.js +1 -1
  137. package/dist/node_modules/@allyhub/runtimes/dist/runtimes.js +1 -1
  138. package/dist/node_modules/@allyhub/runtimes/package.json +9 -1
  139. package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
  140. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  141. package/dist/node_modules/@allyhub/scenery-host/dist/bundle.js +3 -3
  142. package/dist/node_modules/@allyhub/scenery-host/dist/fact.d.ts +1 -1
  143. package/dist/node_modules/@allyhub/scenery-host/dist/model-stage.js +2 -2
  144. package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
  145. package/dist/node_modules/@allyhub/sheet/dist/annotations.js +1 -1
  146. package/dist/node_modules/@allyhub/sheet/dist/api/workbook.js +1 -1
  147. package/dist/node_modules/@allyhub/sheet/dist/arrange.js +1 -1
  148. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  149. package/dist/node_modules/@allyhub/sheet/dist/filter.js +1 -1
  150. package/dist/node_modules/@allyhub/sheet/dist/generated.js +1 -1
  151. package/dist/node_modules/@allyhub/sheet/dist/html.js +6 -6
  152. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  153. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  154. package/dist/node_modules/@allyhub/sheet-extension/dist/cli/open.js +1 -1
  155. package/dist/node_modules/@allyhub/sheet-extension/dist/code.js +1 -1
  156. package/dist/node_modules/@allyhub/sheet-extension/dist/export.js +2 -2
  157. package/dist/node_modules/@allyhub/sheet-extension/package.json +1 -1
  158. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  159. package/dist/node_modules/@allyhub/slides-extension/package.json +1 -1
  160. package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
  161. package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
  162. package/dist/node_modules/@allyhub/stage/package.json +1 -1
  163. package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/400-italic.css +1 -79
  164. package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/400.css +1 -79
  165. package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/700-italic.css +1 -79
  166. package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/700.css +1 -79
  167. package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/arial.css +1 -316
  168. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400-italic.css +1 -19
  169. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400.css +1 -19
  170. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700-italic.css +1 -19
  171. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700.css +1 -19
  172. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/cambria.css +1 -76
  173. package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/400-italic.css +1 -69
  174. package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/400.css +1 -69
  175. package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/700-italic.css +1 -69
  176. package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/700.css +1 -69
  177. package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/calibri.css +1 -276
  178. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400-italic.css +1 -79
  179. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400.css +1 -79
  180. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700-italic.css +1 -79
  181. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700.css +1 -79
  182. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/courier-new.css +1 -316
  183. package/dist/node_modules/@allyhub/stage-page/dist/fonts/noto-color-emoji/emoji.css +1 -8
  184. package/dist/node_modules/@allyhub/stage-page/dist/fonts/noto-sans-sc/400.css +1 -1009
  185. package/dist/node_modules/@allyhub/stage-page/dist/fonts/noto-sans-sc/700.css +1 -1009
  186. package/dist/node_modules/@allyhub/stage-page/dist/fonts/noto-sans-sc/microsoft-yahei.css +1 -2018
  187. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400-italic.css +1 -79
  188. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400.css +1 -79
  189. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700-italic.css +1 -79
  190. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700.css +1 -79
  191. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/times-new-roman.css +1 -316
  192. package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
  193. package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
  194. package/dist/node_modules/@allyhub/telemetry/dist/doc.js +1 -1
  195. package/dist/node_modules/@allyhub/telemetry/dist/errors.js +1 -1
  196. package/dist/node_modules/@allyhub/telemetry/dist/telemetry.js +2 -2
  197. package/dist/node_modules/@allyhub/telemetry/package.json +1 -1
  198. package/dist/node_modules/@allyhub/text-extension/package.json +1 -1
  199. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  200. package/dist/node_modules/@allyhub/video-extension/dist/build-plugins.js +1 -1
  201. package/dist/node_modules/@allyhub/video-extension/package.json +6 -2
  202. package/dist/node_modules/@allyhub/video-measure/dist/plans.js +2 -2
  203. package/dist/node_modules/@allyhub/video-measure/dist/reference/video.js +1 -1
  204. package/dist/node_modules/@allyhub/video-measure/package.json +5 -1
  205. package/dist/node_modules/@allyhub/video-sdk/dist/config.js +2 -0
  206. package/dist/node_modules/@allyhub/video-sdk/dist/piece.js +1 -1
  207. package/dist/node_modules/@allyhub/video-sdk/package.json +5 -1
  208. package/dist/node_modules/@allyhub/website/package.json +1 -1
  209. package/dist/node_modules/@allyhub/website-extension/dist/build.js +1 -1
  210. package/dist/node_modules/@allyhub/website-extension/package.json +4 -4
  211. package/dist/node_modules/@allyhub/x-extension/dist/build.js +1 -1
  212. package/dist/node_modules/@allyhub/x-extension/package.json +8 -2
  213. package/dist/node_modules/@allyhub/x-model/package.json +1 -1
  214. package/dist/node_modules/@allyhub/x-view/package.json +1 -1
  215. package/dist/node_modules/@allyhub/x-view/src/style.css +1 -709
  216. package/dist/package.json +14 -14
  217. package/dist/project.js +1 -1
  218. package/dist/resources.js +1 -1
  219. package/dist/sdk-docs.js +1 -1
  220. package/dist/slot.js +4 -0
  221. package/dist/telemetry.js +1 -1
  222. package/dist/version.js +1 -1
  223. package/editor-web/assets/{abnfDiagram-WEYOIA3C-Hy4-O0wN.js → abnfDiagram-WEYOIA3C-DYaMS_BB.js} +1 -1
  224. package/editor-web/assets/{architecture-WOLXFQ4H-43JEVxqz.js → architecture-WOLXFQ4H-g_Tjfl_y.js} +1 -1
  225. package/editor-web/assets/{architectureDiagram-ZHVYKT53-7bFTl41n.js → architectureDiagram-ZHVYKT53-CqdhofOL.js} +1 -1
  226. package/editor-web/assets/{article-CS48wwvk.js → article-8evPh712.js} +1 -1
  227. package/editor-web/assets/{article-Cyle57uq.js → article-BhRtWYMd.js} +1 -1
  228. package/editor-web/assets/{blockDiagram-RJAE7QA3-DcoNo1WH.js → blockDiagram-RJAE7QA3-Bc-28Bci.js} +1 -1
  229. package/editor-web/assets/{c4Diagram-XDPPPE54-CsMt61gx.js → c4Diagram-XDPPPE54-CTGJb8FB.js} +1 -1
  230. package/editor-web/assets/{calc-worker-BdHh5LXM.js → calc-worker-oEIqrrTM.js} +1 -1
  231. package/editor-web/assets/channel-wIj_OqDm.js +1 -0
  232. package/editor-web/assets/{chart-file-CfbWK9l1.js → chart-file-dGiRgFcH.js} +1 -1
  233. package/editor-web/assets/{chunk-2E7WHVMD-fj-TJIRG.js → chunk-2E7WHVMD-B2MPOVTU.js} +1 -1
  234. package/editor-web/assets/{chunk-4EMNKR2T-Du5cRy-Y.js → chunk-4EMNKR2T-BUV1ZHP0.js} +1 -1
  235. package/editor-web/assets/{chunk-55XCU76K-BHXxBBtm.js → chunk-55XCU76K-BZlpspL5.js} +1 -1
  236. package/editor-web/assets/{chunk-7S6XSTFO-R5HW6X5I.js → chunk-7S6XSTFO-CpKeisWE.js} +1 -1
  237. package/editor-web/assets/{chunk-AQDTSKZB-C98F2BUb.js → chunk-AQDTSKZB-BJqwAPyo.js} +1 -1
  238. package/editor-web/assets/{chunk-DSNLSHJZ-NIGsJ2cK.js → chunk-DSNLSHJZ-D6oPWl_W.js} +1 -1
  239. package/editor-web/assets/{chunk-HAGFOTED-BtHxtfW5.js → chunk-HAGFOTED-B5pk4MZF.js} +1 -1
  240. package/editor-web/assets/{chunk-HNE4Q36P-BI8i7Vkk.js → chunk-HNE4Q36P-DHbSPvxQ.js} +1 -1
  241. package/editor-web/assets/{chunk-NQOKRVIF-DP_Z_zEA.js → chunk-NQOKRVIF-CcL_GcRA.js} +1 -1
  242. package/editor-web/assets/{chunk-UHW7PFBP-C_8bui28.js → chunk-UHW7PFBP-YgiOL6XE.js} +1 -1
  243. package/editor-web/assets/{chunk-VQ5W62QI-CKZgzWB2.js → chunk-VQ5W62QI-p14b4UYc.js} +1 -1
  244. package/editor-web/assets/{chunk-WQQL4CDK-Ff4DgCht.js → chunk-WQQL4CDK-BWW0x-XH.js} +1 -1
  245. package/editor-web/assets/{chunk-YZO67HFG-Csbx1-pi.js → chunk-YZO67HFG-oG3qd68C.js} +1 -1
  246. package/editor-web/assets/{chunk-ZAUX2LTX-BO1kcV3w.js → chunk-ZAUX2LTX-CpcheH0u.js} +1 -1
  247. package/editor-web/assets/{chunk-ZCHMQSOR-CxeNZYZG.js → chunk-ZCHMQSOR-cWQvLl1w.js} +1 -1
  248. package/editor-web/assets/{classDiagram-v2-4MYWR3UA-D8eHQa5i.js → classDiagram-v2-4MYWR3UA-7PG7YcdU.js} +1 -1
  249. package/editor-web/assets/{cynefin-EF2NZ3EQ-lIUY3WQQ.js → cynefin-EF2NZ3EQ-CtcknEQ_.js} +1 -1
  250. package/editor-web/assets/{cynefinDiagram-WF24UDRP-CFOOhEEs.js → cynefinDiagram-WF24UDRP-Ca7VIsjN.js} +1 -1
  251. package/editor-web/assets/{dagre-NK4GIZVX-DdHVup2I.js → dagre-NK4GIZVX-BzcSLtsr.js} +1 -1
  252. package/editor-web/assets/deck-C7fN0Qtn.js +1 -0
  253. package/editor-web/assets/{diagram-CBK3MWTC-CFAD9Y2B.js → diagram-CBK3MWTC-DpRmTGlG.js} +1 -1
  254. package/editor-web/assets/{diagram-I5XIIV2D-DZJAn95A.js → diagram-I5XIIV2D-BTrs_AX8.js} +1 -1
  255. package/editor-web/assets/{diagram-ODIL2UCW-BcIeYTaY.js → diagram-ODIL2UCW-CkIVjPqH.js} +1 -1
  256. package/editor-web/assets/{diagram-PFBEJUXE-CnZmh_fl.js → diagram-PFBEJUXE-BlFMbAG1.js} +1 -1
  257. package/editor-web/assets/{diagram-RJA3I4VV-DpDd9rGx.js → diagram-RJA3I4VV-D3f8VJ-D.js} +1 -1
  258. package/editor-web/assets/{diagram-TYUNFSNR-ouGiUQcR.js → diagram-TYUNFSNR-Bbpngj6F.js} +1 -1
  259. package/editor-web/assets/{dist-DGKjn59H.js → dist-3iovns9K.js} +1 -1
  260. package/editor-web/assets/dist-BkHnbOEj.js +4 -0
  261. package/editor-web/assets/dist-BvOrNcK-.js +19 -0
  262. package/editor-web/assets/dist-CEIszq39.js +1 -0
  263. package/editor-web/assets/{dist-BI8QjOsV.js → dist-CU5RbLNH.js} +1 -1
  264. package/editor-web/assets/dist-CWZj8IAm.js +1 -0
  265. package/editor-web/assets/{dist-NQNQ5HqZ.js → dist-C_Mtrnif.js} +3 -3
  266. package/editor-web/assets/{dist-BajH5QfK.js → dist-CdqpwdCV.js} +4 -4
  267. package/editor-web/assets/{dist-SV0sOVIC.js → dist-CjT76RAw.js} +1 -1
  268. package/editor-web/assets/{dist-elglzHMT.js → dist-CpzEn9T8.js} +1 -1
  269. package/editor-web/assets/dist-CrFYWl5-.js +3 -0
  270. package/editor-web/assets/{dist-hHcrvNn9.js → dist-D4eBFGVL.js} +1 -1
  271. package/editor-web/assets/dist-DTcjb3cP.js +18 -0
  272. package/editor-web/assets/dist-D_WSM29I.js +17 -0
  273. package/editor-web/assets/{dist-Y_XZZa8q.js → dist-Dp_9ISjP.js} +10 -10
  274. package/editor-web/assets/{dist-BBshIz1Q.js → dist-J-tPYKGS.js} +4 -4
  275. package/editor-web/assets/{docx-draw-C4aiB8HI.js → docx-draw-CoK1oqQD.js} +1 -1
  276. package/editor-web/assets/{ebnfDiagram-V4P3TTPT-HRjVlbUf.js → ebnfDiagram-V4P3TTPT-BaKj-yL6.js} +1 -1
  277. package/editor-web/assets/{elk-QONTBCTQ-BFmtKyOf.js → elk-QONTBCTQ-Cn2qv1_U.js} +1 -1
  278. package/editor-web/assets/{erDiagram-KYQIGQAA-C9gcGEgK.js → erDiagram-KYQIGQAA-Bd7AEIDo.js} +1 -1
  279. package/editor-web/assets/{esm-DzxAod8Q.js → esm-Cjv8ogpP.js} +1 -1
  280. package/editor-web/assets/{eventmodeling-K75KTNOO-Bpma5Bdb.js → eventmodeling-K75KTNOO-Sfp7_461.js} +1 -1
  281. package/editor-web/assets/flowDiagram-IUGLLWBU-BlVUglzw.js +1 -0
  282. package/editor-web/assets/{ganttDiagram-R7GPNTJY-CE5ut4C3.js → ganttDiagram-R7GPNTJY-CBqcGdHI.js} +1 -1
  283. package/editor-web/assets/{gitGraph-VSP46ZUC-Dva3iGx2.js → gitGraph-VSP46ZUC-WTokXKTW.js} +1 -1
  284. package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-CJXFsAWp.js → gitGraphDiagram-PDYL7XHY-BIWZHD9q.js} +1 -1
  285. package/editor-web/assets/index-BQWZnyAQ.js +28 -0
  286. package/editor-web/assets/{info-OHQRW6UA-BY0AOfex.js → info-OHQRW6UA-COC6G-_J.js} +1 -1
  287. package/editor-web/assets/{infoDiagram-MVDRKAX5-4Up1gMvC.js → infoDiagram-MVDRKAX5-DpaqdKBD.js} +1 -1
  288. package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-BkvB9Qbn.js → ishikawaDiagram-HPEHV2GE-Dyn2MAy1.js} +1 -1
  289. package/editor-web/assets/{iso-ahTwmFwH.js → iso-DoC-ZoBr.js} +1 -1
  290. package/editor-web/assets/{journeyDiagram-BOSHW7O7-BxV09WdR.js → journeyDiagram-BOSHW7O7-DeSVfmm7.js} +1 -1
  291. package/editor-web/assets/{kanban-definition-FNSA4HC5-zTJtIDPG.js → kanban-definition-FNSA4HC5-Bfg0lj7B.js} +1 -1
  292. package/editor-web/assets/{mermaid-parser.core-BWT9UQh_.js → mermaid-parser.core-CyhovuYE.js} +3 -3
  293. package/editor-web/assets/{mermaid.core-DFf_Vg5X.js → mermaid.core-Dx1fBVUG.js} +4 -4
  294. package/editor-web/assets/{mindmap-definition-6OY57UG3-BYexiugS.js → mindmap-definition-6OY57UG3-QEU2HF_m.js} +1 -1
  295. package/editor-web/assets/{packet-JDAUHWVQ-DX_kSrI6.js → packet-JDAUHWVQ-ReJTa_hw.js} +1 -1
  296. package/editor-web/assets/{pegDiagram-ECIUJNBX-I3SrcMLp.js → pegDiagram-ECIUJNBX-Bo1jFrvb.js} +1 -1
  297. package/editor-web/assets/{pie-XZMESJXO-BmAFSw3E.js → pie-XZMESJXO-BrtYafNA.js} +1 -1
  298. package/editor-web/assets/{pieDiagram-GNMPY74T-DIZKcme5.js → pieDiagram-GNMPY74T-Cj0zQqs_.js} +1 -1
  299. package/editor-web/assets/{props-form-DUFxM5eb.js → props-form-BpSXbrSF.js} +1 -1
  300. package/editor-web/assets/{quadrantDiagram-D57K4MC3-CO3oSqpQ.js → quadrantDiagram-D57K4MC3-D5npDAVn.js} +1 -1
  301. package/editor-web/assets/{radar-ABXABTNO-D5CkFrrb.js → radar-ABXABTNO-C8RDrRqi.js} +1 -1
  302. package/editor-web/assets/{railroad-I3PHUGI6-BeKY1p0K.js → railroad-I3PHUGI6-ebDrmYTK.js} +1 -1
  303. package/editor-web/assets/{railroad-abnf-LNEFI6M7-CIYV9_3-.js → railroad-abnf-LNEFI6M7-BxKuqg6V.js} +1 -1
  304. package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-DN0zDl6d.js → railroad-ebnf-DWYD2UWJ-DOclnfpr.js} +1 -1
  305. package/editor-web/assets/{railroad-peg-JR7BVNR7-Bd_GcO24.js → railroad-peg-JR7BVNR7-DN0A1fpq.js} +1 -1
  306. package/editor-web/assets/{railroadDiagram-Y72NRBL7-DlFoiMhb.js → railroadDiagram-Y72NRBL7-B3PjoVWw.js} +1 -1
  307. package/editor-web/assets/{requirementDiagram-EQYSW5RA-LWAEz8Gy.js → requirementDiagram-EQYSW5RA-DLdzkQk5.js} +1 -1
  308. package/editor-web/assets/{sankeyDiagram-SY24JHO5-B_pZGwUK.js → sankeyDiagram-SY24JHO5-Dip4Piv_.js} +1 -1
  309. package/editor-web/assets/schemas-CQ_UU8-Z.js +1 -0
  310. package/editor-web/assets/{sequenceDiagram-BLEHNHQU-bNhyCq0C.js → sequenceDiagram-BLEHNHQU-QnPcoybL.js} +1 -1
  311. package/editor-web/assets/{session-Beijw9EK.js → session-DMlLCFWg.js} +1 -1
  312. package/editor-web/assets/slides-7xWhREpt.js +1 -0
  313. package/editor-web/assets/snapshots-BLX4NTQC.js +1 -0
  314. package/editor-web/assets/{split-zARio3J8.js → split-tFGKk-x8.js} +1 -1
  315. package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-DI-oM3qz.js → stateDiagram-v2-A6IESKWZ-D103CiMX.js} +1 -1
  316. package/editor-web/assets/{swimlanes-B3ENRKFQ-awDmoLdW.js → swimlanes-B3ENRKFQ-y4gCqEoa.js} +1 -1
  317. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-DKzB_wSf.js +8 -0
  318. package/editor-web/assets/{tabs-BHBvbekZ.js → tabs-CuEawka3.js} +1 -1
  319. package/editor-web/assets/{timeline-definition-JXYKGLGB-CayduPvL.js → timeline-definition-JXYKGLGB-BMp76v4V.js} +1 -1
  320. package/editor-web/assets/{treeView-D4JQ5SDB-BVEuNzCO.js → treeView-D4JQ5SDB-Q_GYyk0b.js} +1 -1
  321. package/editor-web/assets/{treemap-SAJKECNS-BOB14HP3.js → treemap-SAJKECNS-B5lRWdQB.js} +1 -1
  322. package/editor-web/assets/{usecaseDiagram-WPOLBNNX-DxT99uaq.js → usecaseDiagram-WPOLBNNX--QRllA-U.js} +1 -1
  323. package/editor-web/assets/{vennDiagram-Q3Y3IDCW-CWUKom-r.js → vennDiagram-Q3Y3IDCW-CzkATPA3.js} +1 -1
  324. package/editor-web/assets/{video-oJ3qa1Qv.js → video-D0uTbHWx.js} +1 -1
  325. package/editor-web/assets/{wardley-7MLQ67FV-BAQyTneD.js → wardley-7MLQ67FV-BXzwcdJa.js} +1 -1
  326. package/editor-web/assets/{wardleyDiagram-IVAIDKWA-CiIYz4lZ.js → wardleyDiagram-IVAIDKWA-BQvC8Agx.js} +1 -1
  327. package/editor-web/assets/{words-0Ww2RyT4.js → words-CaUHhQHf.js} +1 -1
  328. package/editor-web/assets/workbook-CiCXkjmN.js +45 -0
  329. package/editor-web/assets/{xychartDiagram-4URNHDU4-D_D5IGmd.js → xychartDiagram-4URNHDU4-aY-lsD5o.js} +1 -1
  330. package/editor-web/index.html +3 -3
  331. package/package.json +2 -2
  332. package/dist/node_modules/@allyhub/browser/dist/browser.d.ts +0 -24
  333. package/dist/node_modules/@allyhub/browser/dist/capture.d.ts +0 -61
  334. package/dist/node_modules/@allyhub/browser/dist/cdp.d.ts +0 -51
  335. package/dist/node_modules/@allyhub/browser/dist/emoji.d.ts +0 -29
  336. package/dist/node_modules/@allyhub/browser/dist/flags.d.ts +0 -13
  337. package/dist/node_modules/@allyhub/browser/dist/frames.d.ts +0 -35
  338. package/dist/node_modules/@allyhub/browser/dist/html.d.ts +0 -19
  339. package/dist/node_modules/@allyhub/browser/dist/index.d.ts +0 -10
  340. package/dist/node_modules/@allyhub/browser/dist/launch.d.ts +0 -35
  341. package/dist/node_modules/@allyhub/browser/dist/page.d.ts +0 -74
  342. package/dist/node_modules/@allyhub/browser/dist/picture.d.ts +0 -18
  343. package/dist/node_modules/@allyhub/browser/dist/server.d.ts +0 -26
  344. package/dist/node_modules/@allyhub/build/dist/build-plugins.d.ts +0 -91
  345. package/dist/node_modules/@allyhub/build/dist/cli-command.d.ts +0 -84
  346. package/dist/node_modules/@allyhub/build/dist/code.d.ts +0 -26
  347. package/dist/node_modules/@allyhub/build/dist/content.d.ts +0 -64
  348. package/dist/node_modules/@allyhub/build/dist/data.d.ts +0 -11
  349. package/dist/node_modules/@allyhub/build/dist/evaluate.d.ts +0 -44
  350. package/dist/node_modules/@allyhub/build/dist/file-check.d.ts +0 -35
  351. package/dist/node_modules/@allyhub/build/dist/files.d.ts +0 -4
  352. package/dist/node_modules/@allyhub/build/dist/fonts.d.ts +0 -26
  353. package/dist/node_modules/@allyhub/build/dist/generated.d.ts +0 -29
  354. package/dist/node_modules/@allyhub/build/dist/imports.d.ts +0 -17
  355. package/dist/node_modules/@allyhub/build/dist/index.d.ts +0 -37
  356. package/dist/node_modules/@allyhub/build/dist/inspect-view.d.ts +0 -119
  357. package/dist/node_modules/@allyhub/build/dist/kind-build.d.ts +0 -530
  358. package/dist/node_modules/@allyhub/build/dist/made-notes.d.ts +0 -9
  359. package/dist/node_modules/@allyhub/build/dist/matrix.d.ts +0 -19
  360. package/dist/node_modules/@allyhub/build/dist/media.d.ts +0 -10
  361. package/dist/node_modules/@allyhub/build/dist/messages.d.ts +0 -60
  362. package/dist/node_modules/@allyhub/build/dist/meta-worker.d.ts +0 -59
  363. package/dist/node_modules/@allyhub/build/dist/meta.d.ts +0 -24
  364. package/dist/node_modules/@allyhub/build/dist/model-info.d.ts +0 -6
  365. package/dist/node_modules/@allyhub/build/dist/move-refs.d.ts +0 -16
  366. package/dist/node_modules/@allyhub/build/dist/places.d.ts +0 -23
  367. package/dist/node_modules/@allyhub/build/dist/plugin.d.ts +0 -50
  368. package/dist/node_modules/@allyhub/build/dist/prepare.d.ts +0 -138
  369. package/dist/node_modules/@allyhub/build/dist/project-root.d.ts +0 -19
  370. package/dist/node_modules/@allyhub/build/dist/project-tool.d.ts +0 -136
  371. package/dist/node_modules/@allyhub/build/dist/references.d.ts +0 -6
  372. package/dist/node_modules/@allyhub/build/dist/scan.d.ts +0 -45
  373. package/dist/node_modules/@allyhub/build/dist/stage-route.d.ts +0 -80
  374. package/dist/node_modules/@allyhub/build/dist/takes.d.ts +0 -9
  375. package/dist/node_modules/@allyhub/build/dist/types.d.ts +0 -11
  376. package/dist/node_modules/@allyhub/build/dist/uses.d.ts +0 -44
  377. package/dist/node_modules/@allyhub/build/dist/version.d.ts +0 -56
  378. package/dist/node_modules/@allyhub/build/dist/vite.d.ts +0 -115
  379. package/dist/node_modules/@allyhub/build/dist/work.d.ts +0 -38
  380. package/dist/node_modules/@allyhub/cloud/dist/blobs.d.ts +0 -48
  381. package/dist/node_modules/@allyhub/cloud/dist/call.d.ts +0 -91
  382. package/dist/node_modules/@allyhub/cloud/dist/catalog.d.ts +0 -12
  383. package/dist/node_modules/@allyhub/cloud/dist/client.d.ts +0 -64
  384. package/dist/node_modules/@allyhub/cloud/dist/config.d.ts +0 -40
  385. package/dist/node_modules/@allyhub/cloud/dist/credentials.d.ts +0 -76
  386. package/dist/node_modules/@allyhub/cloud/dist/device.d.ts +0 -14
  387. package/dist/node_modules/@allyhub/cloud/dist/errors.d.ts +0 -24
  388. package/dist/node_modules/@allyhub/cloud/dist/hashes.d.ts +0 -43
  389. package/dist/node_modules/@allyhub/cloud/dist/index.d.ts +0 -19
  390. package/dist/node_modules/@allyhub/cloud/dist/keychain.d.ts +0 -18
  391. package/dist/node_modules/@allyhub/cloud/dist/loopback.d.ts +0 -22
  392. package/dist/node_modules/@allyhub/cloud/dist/mail.d.ts +0 -16
  393. package/dist/node_modules/@allyhub/cloud/dist/pkce.d.ts +0 -11
  394. package/dist/node_modules/@allyhub/cloud/dist/records.d.ts +0 -42
  395. package/dist/node_modules/@allyhub/cloud/dist/signin-worker.d.ts +0 -2
  396. package/dist/node_modules/@allyhub/cloud/dist/signin.d.ts +0 -48
  397. package/dist/node_modules/@allyhub/cloud/dist/sites.d.ts +0 -20
  398. package/dist/node_modules/@allyhub/cloud/dist/token.d.ts +0 -20
  399. package/dist/node_modules/@allyhub/cloud/dist/uploads.d.ts +0 -58
  400. package/dist/node_modules/@allyhub/cloud/dist/voice.d.ts +0 -22
  401. package/dist/node_modules/@allyhub/jobs/dist/index.d.ts +0 -3
  402. package/dist/node_modules/@allyhub/jobs/dist/jobs.d.ts +0 -139
  403. package/dist/node_modules/@allyhub/jobs/dist/show.d.ts +0 -41
  404. package/dist/node_modules/@allyhub/measure/dist/compare.d.ts +0 -195
  405. package/dist/node_modules/@allyhub/measure/dist/grain.d.ts +0 -8
  406. package/dist/node_modules/@allyhub/measure/dist/image.d.ts +0 -16
  407. package/dist/node_modules/@allyhub/measure/dist/index.d.ts +0 -4
  408. package/dist/node_modules/@allyhub/media/dist/analysis.d.ts +0 -25
  409. package/dist/node_modules/@allyhub/media/dist/audio.d.ts +0 -16
  410. package/dist/node_modules/@allyhub/media/dist/beats.d.ts +0 -100
  411. package/dist/node_modules/@allyhub/media/dist/cache.d.ts +0 -26
  412. package/dist/node_modules/@allyhub/media/dist/errors.d.ts +0 -34
  413. package/dist/node_modules/@allyhub/media/dist/fetch.d.ts +0 -11
  414. package/dist/node_modules/@allyhub/media/dist/grid.d.ts +0 -101
  415. package/dist/node_modules/@allyhub/media/dist/index.d.ts +0 -21
  416. package/dist/node_modules/@allyhub/media/dist/picture.d.ts +0 -130
  417. package/dist/node_modules/@allyhub/media/dist/probe.d.ts +0 -52
  418. package/dist/node_modules/@allyhub/media/dist/progress.d.ts +0 -16
  419. package/dist/node_modules/@allyhub/media/dist/run.d.ts +0 -25
  420. package/dist/node_modules/@allyhub/media/dist/sheet.d.ts +0 -67
  421. package/dist/node_modules/@allyhub/media/dist/shots.d.ts +0 -110
  422. package/dist/node_modules/@allyhub/media/dist/sync.d.ts +0 -156
  423. package/dist/node_modules/@allyhub/media/dist/tools.d.ts +0 -25
  424. package/dist/node_modules/@allyhub/media/dist/video.d.ts +0 -35
  425. package/dist/node_modules/@allyhub/media/dist/vision/cache.d.ts +0 -42
  426. package/dist/node_modules/@allyhub/media/dist/vision/probe.d.ts +0 -39
  427. package/dist/node_modules/@allyhub/media/dist/vision/types.d.ts +0 -2
  428. package/dist/node_modules/@allyhub/media/dist/voice-shape.d.ts +0 -51
  429. package/dist/node_modules/@allyhub/model/dist/authoring.d.ts +0 -48
  430. package/dist/node_modules/@allyhub/model/dist/bevel-attributes.d.ts +0 -19
  431. package/dist/node_modules/@allyhub/model/dist/bevel-collapse.d.ts +0 -12
  432. package/dist/node_modules/@allyhub/model/dist/bevel-corner-plan.d.ts +0 -24
  433. package/dist/node_modules/@allyhub/model/dist/bevel-deform.d.ts +0 -5
  434. package/dist/node_modules/@allyhub/model/dist/bevel-fans.d.ts +0 -12
  435. package/dist/node_modules/@allyhub/model/dist/bevel-junction.d.ts +0 -16
  436. package/dist/node_modules/@allyhub/model/dist/bevel-marks.d.ts +0 -14
  437. package/dist/node_modules/@allyhub/model/dist/bevel-metric.d.ts +0 -4
  438. package/dist/node_modules/@allyhub/model/dist/bevel-mixed.d.ts +0 -12
  439. package/dist/node_modules/@allyhub/model/dist/bevel-offsets.d.ts +0 -22
  440. package/dist/node_modules/@allyhub/model/dist/bevel-patch.d.ts +0 -45
  441. package/dist/node_modules/@allyhub/model/dist/bevel-profile.d.ts +0 -13
  442. package/dist/node_modules/@allyhub/model/dist/bevel-projection.d.ts +0 -10
  443. package/dist/node_modules/@allyhub/model/dist/bevel-reflex.d.ts +0 -10
  444. package/dist/node_modules/@allyhub/model/dist/bevel-square-out.d.ts +0 -18
  445. package/dist/node_modules/@allyhub/model/dist/bevel-strips.d.ts +0 -8
  446. package/dist/node_modules/@allyhub/model/dist/bmesh-cycles.d.ts +0 -52
  447. package/dist/node_modules/@allyhub/model/dist/build-cache.d.ts +0 -42
  448. package/dist/node_modules/@allyhub/model/dist/build-job.d.ts +0 -34
  449. package/dist/node_modules/@allyhub/model/dist/build-worker.d.ts +0 -2
  450. package/dist/node_modules/@allyhub/model/dist/build.d.ts +0 -67
  451. package/dist/node_modules/@allyhub/model/dist/cancel.d.ts +0 -8
  452. package/dist/node_modules/@allyhub/model/dist/curve-math.d.ts +0 -21
  453. package/dist/node_modules/@allyhub/model/dist/curve-mesh.d.ts +0 -30
  454. package/dist/node_modules/@allyhub/model/dist/evaluation-guard.d.ts +0 -11
  455. package/dist/node_modules/@allyhub/model/dist/export.d.ts +0 -12
  456. package/dist/node_modules/@allyhub/model/dist/mesh-queries.d.ts +0 -34
  457. package/dist/node_modules/@allyhub/model/dist/names.d.ts +0 -9
  458. package/dist/node_modules/@allyhub/model/dist/png.d.ts +0 -12
  459. package/dist/node_modules/@allyhub/model/dist/polygon-triangulation.d.ts +0 -4
  460. package/dist/node_modules/@allyhub/model/dist/program-location.d.ts +0 -7
  461. package/dist/node_modules/@allyhub/model/dist/report.d.ts +0 -70
  462. package/dist/node_modules/@allyhub/piece/dist/page/console.d.ts +0 -21
  463. package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +0 -4
  464. package/dist/node_modules/@allyhub/piece/dist/page/locate.d.ts +0 -17
  465. package/dist/node_modules/@allyhub/piece/dist/page/runtimes.d.ts +0 -9
  466. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +0 -661
  467. package/dist/node_modules/@allyhub/protocol/dist/account.js +0 -2
  468. package/dist/node_modules/@allyhub/protocol/dist/app.d.ts +0 -30
  469. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +0 -200
  470. package/dist/node_modules/@allyhub/protocol/dist/blobs.d.ts +0 -44
  471. package/dist/node_modules/@allyhub/protocol/dist/cli.d.ts +0 -68
  472. package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.d.ts +0 -77
  473. package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.js +0 -2
  474. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +0 -577
  475. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +0 -674
  476. package/dist/node_modules/@allyhub/protocol/dist/errors.d.ts +0 -7
  477. package/dist/node_modules/@allyhub/protocol/dist/events.d.ts +0 -803
  478. package/dist/node_modules/@allyhub/protocol/dist/files.d.ts +0 -103
  479. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +0 -247
  480. package/dist/node_modules/@allyhub/protocol/dist/image.d.ts +0 -8
  481. package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +0 -38
  482. package/dist/node_modules/@allyhub/protocol/dist/jobs.d.ts +0 -91
  483. package/dist/node_modules/@allyhub/protocol/dist/jsonrpc.d.ts +0 -83
  484. package/dist/node_modules/@allyhub/protocol/dist/kinds.d.ts +0 -144
  485. package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +0 -274
  486. package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +0 -211
  487. package/dist/node_modules/@allyhub/protocol/dist/open.d.ts +0 -13
  488. package/dist/node_modules/@allyhub/protocol/dist/paywall.d.ts +0 -134
  489. package/dist/node_modules/@allyhub/protocol/dist/peer.d.ts +0 -59
  490. package/dist/node_modules/@allyhub/protocol/dist/peer.js +0 -2
  491. package/dist/node_modules/@allyhub/protocol/dist/place.d.ts +0 -21
  492. package/dist/node_modules/@allyhub/protocol/dist/presence.d.ts +0 -125
  493. package/dist/node_modules/@allyhub/protocol/dist/purposes.d.ts +0 -47
  494. package/dist/node_modules/@allyhub/protocol/dist/registry.d.ts +0 -191
  495. package/dist/node_modules/@allyhub/protocol/dist/routes.d.ts +0 -14
  496. package/dist/node_modules/@allyhub/protocol/dist/routes.js +0 -2
  497. package/dist/node_modules/@allyhub/protocol/dist/runtimes.d.ts +0 -96
  498. package/dist/node_modules/@allyhub/protocol/dist/shape.d.ts +0 -35
  499. package/dist/node_modules/@allyhub/protocol/dist/shape.js +0 -2
  500. package/dist/node_modules/@allyhub/protocol/dist/shares.d.ts +0 -156
  501. package/dist/node_modules/@allyhub/protocol/dist/shares.js +0 -2
  502. package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.d.ts +0 -34
  503. package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.js +0 -2
  504. package/dist/node_modules/@allyhub/protocol/dist/sites.d.ts +0 -298
  505. package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +0 -503
  506. package/dist/node_modules/@allyhub/protocol/dist/sources.d.ts +0 -14
  507. package/dist/node_modules/@allyhub/protocol/dist/studio-server.d.ts +0 -264
  508. package/dist/node_modules/@allyhub/protocol/dist/studio-server.js +0 -2
  509. package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.d.ts +0 -18
  510. package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.js +0 -2
  511. package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.d.ts +0 -97
  512. package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.js +0 -2
  513. package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +0 -196
  514. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +0 -578
  515. package/dist/node_modules/@allyhub/protocol/dist/turns.d.ts +0 -71
  516. package/dist/node_modules/@allyhub/protocol/dist/turns.js +0 -2
  517. package/dist/node_modules/@allyhub/runtimes/dist/bundled.d.ts +0 -10
  518. package/dist/node_modules/@allyhub/runtimes/dist/declared.d.ts +0 -14
  519. package/dist/node_modules/@allyhub/runtimes/dist/download.d.ts +0 -38
  520. package/dist/node_modules/@allyhub/runtimes/dist/errors.d.ts +0 -20
  521. package/dist/node_modules/@allyhub/runtimes/dist/ffmpeg.d.ts +0 -15
  522. package/dist/node_modules/@allyhub/runtimes/dist/home.d.ts +0 -2
  523. package/dist/node_modules/@allyhub/runtimes/dist/index.d.ts +0 -12
  524. package/dist/node_modules/@allyhub/runtimes/dist/lock.d.ts +0 -14
  525. package/dist/node_modules/@allyhub/runtimes/dist/manifest.d.ts +0 -3
  526. package/dist/node_modules/@allyhub/runtimes/dist/node-program.d.ts +0 -12
  527. package/dist/node_modules/@allyhub/runtimes/dist/packages.d.ts +0 -101
  528. package/dist/node_modules/@allyhub/runtimes/dist/runtimes.d.ts +0 -73
  529. package/dist/node_modules/@allyhub/runtimes/dist/unpack.d.ts +0 -14
  530. package/dist/node_modules/@allyhub/scenery-host/dist/allyhub.d.ts +0 -20
  531. package/dist/node_modules/@allyhub/scenery-host/dist/bake/digest.d.ts +0 -14
  532. package/dist/node_modules/@allyhub/scenery-host/dist/bake/envmap.d.ts +0 -21
  533. package/dist/node_modules/@allyhub/scenery-host/dist/bake/run.d.ts +0 -63
  534. package/dist/node_modules/@allyhub/scenery-host/dist/budget.d.ts +0 -40
  535. package/dist/node_modules/@allyhub/scenery-host/dist/bundle.d.ts +0 -92
  536. package/dist/node_modules/@allyhub/scenery-host/dist/commands.d.ts +0 -54
  537. package/dist/node_modules/@allyhub/scenery-host/dist/draw2d.d.ts +0 -47
  538. package/dist/node_modules/@allyhub/scenery-host/dist/glass.d.ts +0 -39
  539. package/dist/node_modules/@allyhub/scenery-host/dist/index.d.ts +0 -25
  540. package/dist/node_modules/@allyhub/scenery-host/dist/inventory.d.ts +0 -18
  541. package/dist/node_modules/@allyhub/scenery-host/dist/layer/fidelity.d.ts +0 -70
  542. package/dist/node_modules/@allyhub/scenery-host/dist/layer/grade.d.ts +0 -7
  543. package/dist/node_modules/@allyhub/scenery-host/dist/layer/moire.d.ts +0 -6
  544. package/dist/node_modules/@allyhub/scenery-host/dist/measure/contacts.d.ts +0 -45
  545. package/dist/node_modules/@allyhub/scenery-host/dist/measure/health.d.ts +0 -10
  546. package/dist/node_modules/@allyhub/scenery-host/dist/measure/index.d.ts +0 -110
  547. package/dist/node_modules/@allyhub/scenery-host/dist/measure/relations.d.ts +0 -17
  548. package/dist/node_modules/@allyhub/scenery-host/dist/measure/solid.d.ts +0 -32
  549. package/dist/node_modules/@allyhub/scenery-host/dist/measure/support.d.ts +0 -11
  550. package/dist/node_modules/@allyhub/scenery-host/dist/model-stage.d.ts +0 -32
  551. package/dist/node_modules/@allyhub/scenery-host/dist/queries/inventory.d.ts +0 -5
  552. package/dist/node_modules/@allyhub/scenery-host/dist/queries/map.d.ts +0 -5
  553. package/dist/node_modules/@allyhub/scenery-host/dist/queries/view.d.ts +0 -10
  554. package/dist/node_modules/@allyhub/scenery-host/dist/scene.d.ts +0 -35
  555. package/dist/node_modules/@allyhub/scenery-host/dist/screen-dom.d.ts +0 -24
  556. package/dist/node_modules/@allyhub/scenery-host/dist/stage/bakes.d.ts +0 -42
  557. package/dist/node_modules/@allyhub/scenery-host/dist/stage/index.d.ts +0 -6
  558. package/dist/node_modules/@allyhub/scenery-host/dist/stage/page.d.ts +0 -70
  559. package/dist/node_modules/@allyhub/scenery-host/dist/stage/solve.d.ts +0 -49
  560. package/dist/node_modules/@allyhub/scenery-host/dist/stage/version.d.ts +0 -73
  561. package/dist/node_modules/@allyhub/scenery-host/dist/stage/view.d.ts +0 -18
  562. package/dist/node_modules/@allyhub/scenery-host/dist/steady.d.ts +0 -4
  563. package/dist/node_modules/@allyhub/scenery-host/dist/viewer.d.ts +0 -134
  564. package/editor-web/assets/channel-HUlo15J7.js +0 -1
  565. package/editor-web/assets/deck-CtEtDHo2.js +0 -1
  566. package/editor-web/assets/dist-Bl74xqMW.js +0 -19
  567. package/editor-web/assets/dist-BrUtQth3.js +0 -18
  568. package/editor-web/assets/dist-CN5A7Au2.js +0 -1
  569. package/editor-web/assets/dist-CcL6r6l3.js +0 -1
  570. package/editor-web/assets/dist-D2E3cgRP.js +0 -4
  571. package/editor-web/assets/dist-ZrBAbqyJ.js +0 -3
  572. package/editor-web/assets/dist-d4dayaWE.js +0 -17
  573. package/editor-web/assets/flowDiagram-IUGLLWBU-tz5ewhC5.js +0 -1
  574. package/editor-web/assets/index-q7X6hdHp.js +0 -28
  575. package/editor-web/assets/schemas-moE_A7Nj.js +0 -1
  576. package/editor-web/assets/slides-oQ_C0SVJ.js +0 -1
  577. package/editor-web/assets/snapshots-Dd0Wd_qM.js +0 -1
  578. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-X35m3xN6.js +0 -8
  579. package/editor-web/assets/workbook-DznVDqoE.js +0 -45
  580. /package/dist/node_modules/@allyhub/{protocol/dist/runtimes.js → runtimes/dist/schema.js} +0 -0
@@ -1,6 +1,6 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{formatColor as O,isValidFormat as P}from"numfmt";import{cellName as T,columnLetter as k}from"./address.js";import{linkAt as _}from"./annotations.js";import{chartDef as U,chartPlace as q,chartSize as V,chartSvg as K}from"./chart.js";import{fileCells as Y,isPicture as X,pictureHeight as Z,pictureSize as J}from"./files.js";import{generalForms as Q,shownValue as tt}from"./format.js";import{DEFAULT_COLUMN_WIDTH as et,DEFAULT_ROW_HEIGHT as F,columnHidden as N,columnWidth as R,pageTitleCols as nt,pageTitleRows as st,rowHeight as it,rowHidden as E,paginate as ot,usedWithCharts as rt}from"./paginate.js";import{Rules as lt,iconShape as at}from"./rules.js";import{tableStyleLook as dt,tableStyleOf as ct}from"./table-style.js";import{CellError as ht}from"./values.js";import{placeKey as I}from"./workbook.js";export{et as DEFAULT_COLUMN_WIDTH,F as DEFAULT_ROW_HEIGHT};const ft={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},pt=n=>{let t="";for(let e=0;e<n.length;e+=32768)t+=String.fromCharCode(...n.subarray(e,e+32768));return btoa(t)},x=n=>n.replace(/[&<>"]/gu,t=>ft[t]??t),gt={thin:"1px solid",medium:"2px solid",thick:"3px solid",double:"3px double",hair:"1px dotted",dotted:"1px dotted",dashed:"1px dashed",dashDot:"1px dashed",dashDotDot:"1px dashed",mediumDashed:"2px dashed",mediumDashDot:"2px dashed",mediumDashDotDot:"2px dashed",slantDashDot:"2px dashed"},ut={left:"left",center:"center",right:"right",justify:"justify",distributed:"justify",centerContinuous:"center",fill:"left"},mt={top:"top",center:"middle",justify:"middle",distributed:"middle"};function $t(n){if(typeof n=="number")return"right";if(typeof n=="boolean"||n instanceof ht)return"center"}const bt={up:"▲","up-right":"◥",right:"▶","down-right":"◢",down:"▼",circle:"●",flag:"⚑",check:"✔",bang:"!",cross:"✖",triangle:"▲",diamond:"◆",bars:"▮",quarter:"◔"};function wt(n){const{shape:t,color:e,level:o}=at(n.set,n.index),l=(bt[t]??"●").repeat(t==="bars"?o??1:1);return`<span style="float:left;color:${e}">${l}</span>`}function yt(n){const t=[];if(n.bold!==void 0&&t.push(`font-weight:${n.bold?"bold":"normal"}`),n.italic!==void 0&&t.push(`font-style:${n.italic?"italic":"normal"}`),n.underline!==void 0||n.strike!==void 0){const l=[n.underline!==void 0&&n.underline!==!1?"underline":"",n.strike===!0?"line-through":""].filter(Boolean);t.push(`text-decoration:${l.length>0?l.join(" "):"none"}`)}n.font!==void 0&&t.push(`font-family:"${n.font.replace(/["\\]/gu,"")}",var(--font)`),n.size!==void 0&&t.push(`font-size:${String(n.size)}pt`),n.color!==void 0&&t.push(`color:${n.color}`);const e=x(n.text),o=n.script==="superscript"?`<sup>${e}</sup>`:n.script==="subscript"?`<sub>${e}</sub>`:e;return t.length===0&&n.script===void 0?e:`<span${t.length===0?"":` style="${t.join(";")}"`}>${o}</span>`}function xt(n,t,e){const o=[];n.bold===!0&&o.push("font-weight:bold"),n.italic===!0&&o.push("font-style:italic");const l=[n.underline?"underline":"",n.strike===!0?"line-through":""].filter(Boolean);l.length>0&&o.push(`text-decoration:${l.join(" ")}`),n.font!==void 0&&o.push(`font-family:"${n.font.replace(/["\\]/gu,"")}",var(--font)`),n.size!==void 0&&o.push(`font-size:${String(n.size)}pt`);const r=(typeof t=="number"&&e!==void 0&&P(e)?O(e,t)??void 0:void 0)??n.color;typeof r=="string"&&o.push(`color:${r}`);const{fill:a}=n;if(typeof a=="string")o.push(`background:${a}`);else if(a){const i=a.color??a.background;i!==void 0&&o.push(`background:${i}`)}const f=(n.align===void 0||n.align==="general"?void 0:ut[n.align])??$t(t);f!==void 0&&o.push(`text-align:${f}`);const c=n.valign===void 0?void 0:mt[n.valign];c!==void 0&&o.push(`vertical-align:${c}`),n.wrap===!0&&o.push("white-space:pre-wrap","overflow-wrap:anywhere"),n.indent!==void 0&&o.push(`padding-left:${String(3+n.indent*9)}px`);for(const i of["left","right","top","bottom"]){const s=n.border?.[i];s&&s.style!=="none"&&o.push(`border-${i}:${gt[s.style]??"1px solid"} ${s.color??"#000"}`)}return o.join(";")}class L{names=new Map;of(t){if(t==="")return"";let e=this.names.get(t);return e||(e=`s${String(this.names.size)}`,this.names.set(t,e)),e}css(){return[...this.names].map(([t,e])=>`.${e}{${t}}`).join(`
3
- `)}}class W{calc;sheet;rules;read;drawnFiles;bands=new Map;svgs=new Map;constructor(t,e,o){this.calc=t,this.sheet=e,this.read=o,this.rules=e.conditions.length>0?new lt(e,t):void 0}files(){if(this.drawnFiles)return this.drawnFiles;const t=new Map,e=new Map,o=this.read;for(const{row:l,col:r,paths:a,column:f}of o?Y(this.sheet,this.calc):[]){const c=Z(f),i=a.map(s=>{const d=X(s)?o?.(s):void 0,h=d&&J(d);return!d||!h?x(s):(e.set(l,Math.max(e.get(l)??0,c)),`<img src="data:image/${h.type};base64,${pt(d)}" alt="${x(s)}" style="height:${String(c)}px">`)});t.set(I(l,r),i.join(" "))}return this.drawnFiles={cells:t,rows:e},this.drawnFiles}height(t){return this.sheet.spec.rows?.[String(t+1)]?.height??this.files().rows.get(t)??F}band(t,e){if(e===t.at.row)return;let o=this.bands.get(t);if(!o){o=new Map;let l=0;for(let r=t.at.row+1;r<=t.area.bottom;r++)E(this.calc,this.sheet,r)||o.set(r,l++);this.bands.set(t,o)}return o.get(e)??0}cell(t,e,o,l,r){const{sheet:a}=this,f=this.calc.value(a,t,e),c=this.rules?.at(t,e),i=a.lookAt(t,e),s=a.tableAt(t,e),d=s&&ct(s),h=s&&d?dt(d,s,t,e,this.band(s,t)):void 0,p={...h,...i,...c?.look,...c?.scale===void 0?{}:{fill:c.scale}};(h?.border||i.border)&&(p.border={...h?.border,...i.border,...c?.look?.border});const w=p.format;let $=xt(p,f,w);if(c?.bar){const v=`${String(Math.round(c.bar.share*100))}%`;$=[$,`background:linear-gradient(90deg,${c.bar.color} ${v},transparent ${v})`].filter(Boolean).join(";")}const u=this.files().cells.get(I(t,e)),y=c?.icon?wt(c.icon):"",S=typeof f=="string"?a.runsAt(t,e):void 0,b=u??(c?.bare===!0?"":S?S.map(yt).join(""):x(tt(f,w))),C=typeof f=="string"&&p.wrap!==!0&&l&&!o,A=typeof f=="number"&&!u&&y===""&&b!=="",M=A&&(w===void 0||w==="General"),z=[r.of($),C?"over":"",A?"n":""].filter(Boolean).join(" "),D=[z===""?"":` class="${z}"`,M?` data-g="${x(Q(f).slice(1).join(" "))}"`:"",o&&o.rows>1?` rowspan="${String(o.rows)}"`:"",o&&o.cols>1?` colspan="${String(o.cols)}"`:""].join(""),j=A?void 0:_(a.spec,t,e)?.to,g=j!==void 0&&/^(?:https?:|mailto:)/iu.test(j)&&b!==""?`<a href="${x(j)}" style="color:inherit;text-decoration:inherit">${b}</a>`:b;return`<td${D}>${y}${g}</td>`}spans(t,e){const o=new Map,l=new Set;for(const r of this.sheet.merges){const a=t.filter(s=>s>=r.top&&s<=r.bottom),f=e.filter(s=>s>=r.left&&s<=r.right),[c]=a,[i]=f;if(!(c===void 0||i===void 0)){for(const s of a)for(const d of f)l.add(`${String(s)}:${String(d)}`);l.delete(`${String(c)}:${String(i)}`),o.set(`${String(c)}:${String(i)}`,{rows:a.length,cols:f.length})}}return{spans:o,covered:l}}table(t,e,o,l){const{sheet:r}=this,{spans:a,covered:f}=this.spans(t,e),c=e.map(h=>R(r,h)),i=l.headings?B:0,s=c.reduce((h,p)=>h+p,0)+i,d=[`<table class="${l.className??""}" style="width:${String(s)}px"><colgroup>`,l.headings?`<col style="width:${String(i)}px">`:"",...c.map(h=>`<col style="width:${String(h)}px">`),"</colgroup>"];l.headings&&d.push(`<thead><tr><th></th>${e.map(h=>`<th>${k(h)}</th>`).join("")}</tr></thead>`),d.push("<tbody>");for(const h of t)d.push(`<tr style="height:${String(this.height(h))}px">`),l.headings&&d.push(`<th>${String(h+1)}</th>`),e.forEach((p,w)=>{const $=`${String(h)}:${String(p)}`;if(f.has($))return;const u=e[w+1],y=u!==void 0&&r.at(h,u)===void 0&&!f.has(`${String(h)}:${String(u)}`);d.push(this.cell(h,p,a.get($),y,o))}),d.push("</tr>");return d.push("</tbody></table>"),{html:d.join(""),width:s}}svg(t){let e=this.svgs.get(t);if(e===void 0){const{width:o,height:l}=V(t.spec);e=K(U(this.calc,this.sheet,t),o,l,{font:"var(--font)"}),this.svgs.set(t,e)}return e}charts(t,e,o){const{sheet:l}=this;if(l.charts.length===0||t.length===0||e.length===0)return"";const r=(i,s)=>{const d=new Map;let h=0;for(const p of i)d.set(p,h),h+=s(p);return{at:d,sum:h}},a=r(t,i=>this.height(i)),f=r(e,i=>R(l,i)),c=(i,s,d,h)=>{const p=i[0]??0;if(d<p){let $=0;for(let u=d;u<p;u++)$-=h(u);return $}const w=i.find($=>$>=d);return w===void 0?1/0:s.get(w)??0};return l.charts.map(i=>{const s=q(i.spec,h=>c(t,a.at,h,p=>E(this.calc,l,p)?0:it(l,p)),h=>c(e,f.at,h,p=>N(l,p)?0:R(l,p)));return s.left<f.sum&&s.left+s.width>0&&s.top<a.sum&&s.top+s.height>0?`<div class="chart" style="left:${String(o.left+s.left)}px;top:${String(o.top+s.top)}px">${this.svg(i)}</div>`:""}).join("")}}const B=44,vt=`
2
+ import{formatColor as O,isValidFormat as P}from"numfmt";import{cellName as L,columnLetter as _}from"./address.js";import{followableLinkAt as U,linkedLook as q}from"./annotations.js";import{chartDef as V,chartPlace as K,chartSize as Y,chartSvg as X}from"./chart.js";import{fileCells as Z,isPicture as J,pictureHeight as Q,pictureSize as tt}from"./files.js";import{generalForms as et,shownValue as nt}from"./format.js";import{DEFAULT_COLUMN_WIDTH as st,DEFAULT_ROW_HEIGHT as M,columnHidden as N,columnWidth as F,pageTitleCols as it,pageTitleRows as ot,rowHeight as rt,rowHidden as E,paginate as lt,usedWithCharts as at}from"./paginate.js";import{Rules as dt,iconShape as ct}from"./rules.js";import{tableStyleLook as ht,tableStyleOf as ft}from"./table-style.js";import{CellError as gt}from"./values.js";import{placeKey as k}from"./workbook.js";export{st as DEFAULT_COLUMN_WIDTH,M as DEFAULT_ROW_HEIGHT};const pt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},ut=n=>{let t="";for(let e=0;e<n.length;e+=32768)t+=String.fromCharCode(...n.subarray(e,e+32768));return btoa(t)},x=n=>n.replace(/[&<>"]/gu,t=>pt[t]??t),mt={thin:"1px solid",medium:"2px solid",thick:"3px solid",double:"3px double",hair:"1px dotted",dotted:"1px dotted",dashed:"1px dashed",dashDot:"1px dashed",dashDotDot:"1px dashed",mediumDashed:"2px dashed",mediumDashDot:"2px dashed",mediumDashDotDot:"2px dashed",slantDashDot:"2px dashed"},$t={left:"left",center:"center",right:"right",justify:"justify",distributed:"justify",centerContinuous:"center",fill:"left"},bt={top:"top",center:"middle",justify:"middle",distributed:"middle"};function wt(n){if(typeof n=="number")return"right";if(typeof n=="boolean"||n instanceof gt)return"center"}const yt={up:"▲","up-right":"◥",right:"▶","down-right":"◢",down:"▼",circle:"●",flag:"⚑",check:"✔",bang:"!",cross:"✖",triangle:"▲",diamond:"◆",bars:"▮",quarter:"◔"};function xt(n){const{shape:t,color:e,level:o}=ct(n.set,n.index),l=(yt[t]??"●").repeat(t==="bars"?o??1:1);return`<span style="float:left;color:${e}">${l}</span>`}function vt(n){const t=[];if(n.bold!==void 0&&t.push(`font-weight:${n.bold?"bold":"normal"}`),n.italic!==void 0&&t.push(`font-style:${n.italic?"italic":"normal"}`),n.underline!==void 0||n.strike!==void 0){const l=[n.underline!==void 0&&n.underline!==!1?"underline":"",n.strike===!0?"line-through":""].filter(Boolean);t.push(`text-decoration:${l.length>0?l.join(" "):"none"}`)}n.font!==void 0&&t.push(`font-family:"${n.font.replace(/["\\]/gu,"")}",var(--font)`),n.size!==void 0&&t.push(`font-size:${String(n.size)}pt`),n.color!==void 0&&t.push(`color:${n.color}`);const e=x(n.text),o=n.script==="superscript"?`<sup>${e}</sup>`:n.script==="subscript"?`<sub>${e}</sub>`:e;return t.length===0&&n.script===void 0?e:`<span${t.length===0?"":` style="${t.join(";")}"`}>${o}</span>`}function St(n,t,e){const o=[];n.bold===!0&&o.push("font-weight:bold"),n.italic===!0&&o.push("font-style:italic");const l=[n.underline?"underline":"",n.strike===!0?"line-through":""].filter(Boolean);l.length>0&&o.push(`text-decoration:${l.join(" ")}`),n.font!==void 0&&o.push(`font-family:"${n.font.replace(/["\\]/gu,"")}",var(--font)`),n.size!==void 0&&o.push(`font-size:${String(n.size)}pt`);const r=(typeof t=="number"&&e!==void 0&&P(e)?O(e,t)??void 0:void 0)??n.color;typeof r=="string"&&o.push(`color:${r}`);const{fill:a}=n;if(typeof a=="string")o.push(`background:${a}`);else if(a){const i=a.color??a.background;i!==void 0&&o.push(`background:${i}`)}const f=(n.align===void 0||n.align==="general"?void 0:$t[n.align])??wt(t);f!==void 0&&o.push(`text-align:${f}`);const c=n.valign===void 0?void 0:bt[n.valign];c!==void 0&&o.push(`vertical-align:${c}`),n.wrap===!0&&o.push("white-space:pre-wrap","overflow-wrap:anywhere"),n.indent!==void 0&&o.push(`padding-left:${String(3+n.indent*9)}px`);for(const i of["left","right","top","bottom"]){const s=n.border?.[i];s&&s.style!=="none"&&o.push(`border-${i}:${mt[s.style]??"1px solid"} ${s.color??"#000"}`)}return o.join(";")}class I{names=new Map;of(t){if(t==="")return"";let e=this.names.get(t);return e||(e=`s${String(this.names.size)}`,this.names.set(t,e)),e}css(){return[...this.names].map(([t,e])=>`.${e}{${t}}`).join(`
3
+ `)}}class W{calc;sheet;rules;read;drawnFiles;bands=new Map;svgs=new Map;constructor(t,e,o){this.calc=t,this.sheet=e,this.read=o,this.rules=e.conditions.length>0?new dt(e,t):void 0}files(){if(this.drawnFiles)return this.drawnFiles;const t=new Map,e=new Map,o=this.read;for(const{row:l,col:r,paths:a,column:f}of o?Z(this.sheet,this.calc):[]){const c=Q(f),i=a.map(s=>{const d=J(s)?o?.(s):void 0,h=d&&tt(d);return!d||!h?x(s):(e.set(l,Math.max(e.get(l)??0,c)),`<img src="data:image/${h.type};base64,${ut(d)}" alt="${x(s)}" style="height:${String(c)}px">`)});t.set(k(l,r),i.join(" "))}return this.drawnFiles={cells:t,rows:e},this.drawnFiles}height(t){return this.sheet.spec.rows?.[String(t+1)]?.height??this.files().rows.get(t)??M}band(t,e){if(e===t.at.row)return;let o=this.bands.get(t);if(!o){o=new Map;let l=0;for(let r=t.at.row+1;r<=t.area.bottom;r++)E(this.calc,this.sheet,r)||o.set(r,l++);this.bands.set(t,o)}return o.get(e)??0}cell(t,e,o,l,r){const{sheet:a}=this,f=this.calc.value(a,t,e),c=this.rules?.at(t,e),i=a.lookAt(t,e),s=a.tableAt(t,e),d=s&&ft(s),h=s&&d?ht(d,s,t,e,this.band(s,t)):void 0,g=U(this.calc,a,t,e),b={...h,...i,...g?q(i):{},...c?.look,...c?.scale===void 0?{}:{fill:c.scale}};(h?.border||i.border)&&(b.border={...h?.border,...i.border,...c?.look?.border});const m=b.format;let u=St(b,f,m);if(c?.bar){const T=`${String(Math.round(c.bar.share*100))}%`;u=[u,`background:linear-gradient(90deg,${c.bar.color} ${T},transparent ${T})`].filter(Boolean).join(";")}const y=this.files().cells.get(k(t,e)),S=c?.icon?xt(c.icon):"",w=typeof f=="string"?a.runsAt(t,e):void 0,v=y??(c?.bare===!0?"":w?w.map(vt).join(""):x(nt(f,m))),H=typeof f=="string"&&b.wrap!==!0&&l&&!o,j=typeof f=="number"&&!y&&S===""&&v!=="",z=j&&(m===void 0||m==="General"),A=[r.of(u),H?"over":"",j?"n":""].filter(Boolean).join(" "),D=[A===""?"":` class="${A}"`,z?` data-g="${x(et(f).slice(1).join(" "))}"`:"",o&&o.rows>1?` rowspan="${String(o.rows)}"`:"",o&&o.cols>1?` colspan="${String(o.cols)}"`:""].join(""),p=j?void 0:g?.to,C=p!==void 0&&/^(?:https?:|mailto:)/iu.test(p)&&v!==""?`<a href="${x(p)}" style="color:inherit;text-decoration:inherit">${v}</a>`:v;return`<td${D}>${S}${C}</td>`}spans(t,e){const o=new Map,l=new Set;for(const r of this.sheet.merges){const a=t.filter(s=>s>=r.top&&s<=r.bottom),f=e.filter(s=>s>=r.left&&s<=r.right),[c]=a,[i]=f;if(!(c===void 0||i===void 0)){for(const s of a)for(const d of f)l.add(`${String(s)}:${String(d)}`);l.delete(`${String(c)}:${String(i)}`),o.set(`${String(c)}:${String(i)}`,{rows:a.length,cols:f.length})}}return{spans:o,covered:l}}table(t,e,o,l){const{sheet:r}=this,{spans:a,covered:f}=this.spans(t,e),c=e.map(h=>F(r,h)),i=l.headings?B:0,s=c.reduce((h,g)=>h+g,0)+i,d=[`<table class="${l.className??""}" style="width:${String(s)}px"><colgroup>`,l.headings?`<col style="width:${String(i)}px">`:"",...c.map(h=>`<col style="width:${String(h)}px">`),"</colgroup>"];l.headings&&d.push(`<thead><tr><th></th>${e.map(h=>`<th>${_(h)}</th>`).join("")}</tr></thead>`),d.push("<tbody>");for(const h of t)d.push(`<tr style="height:${String(this.height(h))}px">`),l.headings&&d.push(`<th>${String(h+1)}</th>`),e.forEach((g,b)=>{const m=`${String(h)}:${String(g)}`;if(f.has(m))return;const u=e[b+1],y=u!==void 0&&r.at(h,u)===void 0&&!f.has(`${String(h)}:${String(u)}`);d.push(this.cell(h,g,a.get(m),y,o))}),d.push("</tr>");return d.push("</tbody></table>"),{html:d.join(""),width:s}}svg(t){let e=this.svgs.get(t);if(e===void 0){const{width:o,height:l}=Y(t.spec);e=X(V(this.calc,this.sheet,t),o,l,{font:"var(--font)"}),this.svgs.set(t,e)}return e}charts(t,e,o){const{sheet:l}=this;if(l.charts.length===0||t.length===0||e.length===0)return"";const r=(i,s)=>{const d=new Map;let h=0;for(const g of i)d.set(g,h),h+=s(g);return{at:d,sum:h}},a=r(t,i=>this.height(i)),f=r(e,i=>F(l,i)),c=(i,s,d,h)=>{const g=i[0]??0;if(d<g){let m=0;for(let u=d;u<g;u++)m-=h(u);return m}const b=i.find(m=>m>=d);return b===void 0?1/0:s.get(b)??0};return l.charts.map(i=>{const s=K(i.spec,h=>c(t,a.at,h,g=>E(this.calc,l,g)?0:rt(l,g)),h=>c(e,f.at,h,g=>N(l,g)?0:F(l,g)));return s.left<f.sum&&s.left+s.width>0&&s.top<a.sum&&s.top+s.height>0?`<div class="chart" style="left:${String(o.left+s.left)}px;top:${String(o.top+s.top)}px">${this.svg(i)}</div>`:""}).join("")}}const B=44,Ct=`
4
4
  (() => {
5
5
  const fit = () => {
6
6
  const cells = Array.from(document.querySelectorAll("td.n"));
@@ -30,16 +30,16 @@ ${n.css??""}
30
30
  html,body{margin:0;background:#fff;color:#000}
31
31
  body{font:11pt/1.2 var(--font)}
32
32
  table{table-layout:fixed;border-collapse:collapse}
33
- td,th{height:${String(F)}px;padding:0 3px;overflow:hidden;white-space:pre;vertical-align:bottom}
33
+ td,th{height:${String(M)}px;padding:0 3px;overflow:hidden;white-space:pre;vertical-align:bottom}
34
34
  td.over{overflow:visible}
35
35
  .chart{position:absolute;line-height:0}
36
36
  .grid td{border:1px solid #e3e3e3}
37
37
  .edged th{border:1px solid #e3e3e3;background:#f5f5f5;color:#555;font-weight:normal;text-align:center;vertical-align:middle;font-size:9pt}
38
38
  ${t}
39
- </style><script>${vt}<\/script></head><body>${e}</body></html>`}export function sheetHtml(n,t={}){const e=t.sheets??n.wb.sheets.filter(i=>i.spec.hidden!==!0),o=new L,l=[];let r=0;const a=e.length>1&&t.area===void 0,f=e.map(i=>{const s=new W(n,i,t.file),d=t.area??rt(i)??{top:0,left:0,bottom:0,right:0},h=[];for(let b=d.top;b<=d.bottom;b++)E(n,i,b)||h.push(b);const p=[];for(let b=d.left;b<=d.right;b++)N(i,b)||p.push(b);const w=h.slice(0,t.rows??h.length),$=p.slice(0,t.columns??p.length);if(w.length<h.length||$.length<p.length){const b=w[w.length-1]??d.top,C=$[$.length-1]??d.left;l.push(`${i.name}: drew ${T({row:d.top,col:d.left})}:${T({row:b,col:C})} of ${String(h.length)} rows and ${String(p.length)} columns`)}const u=t.headings===!0,y=s.table(w,$,o,{headings:u,className:u?i.spec.gridlines===!1?"edged":"edged grid":""});r=Math.max(r,y.width);const S=s.charts(w,$,{left:u?B:0,top:u?F:0});return`<section class="sheet">${a?`<h2>${x(i.name)}</h2>`:""}<div class="book">${y.html}${S}</div></section>`});return{html:G(t,`h2{font:bold 12pt var(--font);margin:0 0 8px}
39
+ </style><script>${Ct}<\/script></head><body>${e}</body></html>`}export function sheetHtml(n,t={}){const e=t.sheets??n.wb.sheets.filter(i=>i.spec.hidden!==!0),o=new I,l=[];let r=0;const a=e.length>1&&t.area===void 0,f=e.map(i=>{const s=new W(n,i,t.file),d=t.area??at(i)??{top:0,left:0,bottom:0,right:0},h=[];for(let w=d.top;w<=d.bottom;w++)E(n,i,w)||h.push(w);const g=[];for(let w=d.left;w<=d.right;w++)N(i,w)||g.push(w);const b=h.slice(0,t.rows??h.length),m=g.slice(0,t.columns??g.length);if(b.length<h.length||m.length<g.length){const w=b[b.length-1]??d.top,v=m[m.length-1]??d.left;l.push(`${i.name}: drew ${L({row:d.top,col:d.left})}:${L({row:w,col:v})} of ${String(h.length)} rows and ${String(g.length)} columns`)}const u=t.headings===!0,y=s.table(b,m,o,{headings:u,className:u?i.spec.gridlines===!1?"edged":"edged grid":""});r=Math.max(r,y.width);const S=s.charts(b,m,{left:u?B:0,top:u?M:0});return`<section class="sheet">${a?`<h2>${x(i.name)}</h2>`:""}<div class="book">${y.html}${S}</div></section>`});return{html:G(t,`h2{font:bold 12pt var(--font);margin:0 0 8px}
40
40
  .sheet+.sheet{margin-top:24px}
41
41
  .book{position:relative;width:max-content;overflow:hidden}
42
- ${o.css()}`,f.join("")),width:r,cut:l}}const H=n=>String(n).padStart(2,"0");export function headerFooterHtml(n,t){let e="",o=0;const l=a=>{e+=`<span style="${a}">`,o++},r={B:"font-weight:bold",I:"font-style:italic",U:"text-decoration:underline",E:"text-decoration:underline double",S:"text-decoration:line-through",X:"vertical-align:super;font-size:smaller",Y:"vertical-align:sub;font-size:smaller"};for(let a=0;a<n.length;a++){const f=n[a]??"";if(f!=="&"){e+=x(f);continue}const c=n[a+1]??"",i=c.toUpperCase();if(a++,c==="&")e+="&amp;";else if(i==="P"||i==="N"){const s=/^[+-]\d+/u.exec(n.slice(a+1)),d=i==="P"?t.page:t.pages;e+=String(d+(s?Number(s[0]):0)),s&&(a+=s[0].length)}else if(i==="D")e+=`${String(t.date.getFullYear())}-${H(t.date.getMonth()+1)}-${H(t.date.getDate())}`;else if(i==="T")e+=`${H(t.date.getHours())}:${H(t.date.getMinutes())}`;else if(i==="F"||i==="Z")e+=x(t.file);else if(i==="A")e+=x(t.sheet);else{if(i==="G")continue;if(r[i]!==void 0)l(r[i]);else if(c==='"'){const s=n.indexOf('"',a+1),[d="",h=""]=n.slice(a+1,s<0?n.length:s).split(",");a=s<0?n.length:s;const p=[d==="-"||d===""?"":`font-family:"${d.replace(/["\\]/gu,"")}",var(--font)`,/bold/iu.test(h)?"font-weight:bold":"",/italic/iu.test(h)?"font-style:italic":""].filter(Boolean).join(";");p!==""&&l(p)}else if(/\d/u.test(c)){const s=/^\d+/u.exec(n.slice(a))?.[0]??c;a+=s.length-1,l(`font-size:${s}pt`)}else if(i==="K"){const s=n.slice(a+1,a+7);a+=6,/^[0-9A-Fa-f]{6}$/u.test(s)&&l(`color:#${s}`)}}}return e+"</span>".repeat(o)}const m=n=>`${String(Math.round(n*1e3)/1e3)}px`;export class SheetPrint{job;calc;drawers=new Map;file;constructor(t,e={}){this.calc=t,this.file=e.file,this.job=ot(t,{...e.sheets?{sheets:e.sheets}:{},height:(o,l)=>this.drawer(o).height(l)})}drawer(t){let e=this.drawers.get(t);return e||(e=new W(this.calc,t,this.file),this.drawers.set(t,e)),e}html(t,e,o){const l=new L,r=new Map,a=[];for(const c of this.job.pages.slice(t,e)){const{of:i}=c,s=`${m(i.paper.width)} ${m(i.paper.height)}`;let d=r.get(s);d===void 0&&(d=`paper${String(r.size)}`,r.set(s,d)),a.push(this.page(c,l,d,o))}const f=[...r].map(([c,i])=>`@page ${i}{size:${c};margin:0}`).join(`
42
+ ${o.css()}`,f.join("")),width:r,cut:l}}const R=n=>String(n).padStart(2,"0");export function headerFooterHtml(n,t){let e="",o=0;const l=a=>{e+=`<span style="${a}">`,o++},r={B:"font-weight:bold",I:"font-style:italic",U:"text-decoration:underline",E:"text-decoration:underline double",S:"text-decoration:line-through",X:"vertical-align:super;font-size:smaller",Y:"vertical-align:sub;font-size:smaller"};for(let a=0;a<n.length;a++){const f=n[a]??"";if(f!=="&"){e+=x(f);continue}const c=n[a+1]??"",i=c.toUpperCase();if(a++,c==="&")e+="&amp;";else if(i==="P"||i==="N"){const s=/^[+-]\d+/u.exec(n.slice(a+1)),d=i==="P"?t.page:t.pages;e+=String(d+(s?Number(s[0]):0)),s&&(a+=s[0].length)}else if(i==="D")e+=`${String(t.date.getFullYear())}-${R(t.date.getMonth()+1)}-${R(t.date.getDate())}`;else if(i==="T")e+=`${R(t.date.getHours())}:${R(t.date.getMinutes())}`;else if(i==="F"||i==="Z")e+=x(t.file);else if(i==="A")e+=x(t.sheet);else{if(i==="G")continue;if(r[i]!==void 0)l(r[i]);else if(c==='"'){const s=n.indexOf('"',a+1),[d="",h=""]=n.slice(a+1,s<0?n.length:s).split(",");a=s<0?n.length:s;const g=[d==="-"||d===""?"":`font-family:"${d.replace(/["\\]/gu,"")}",var(--font)`,/bold/iu.test(h)?"font-weight:bold":"",/italic/iu.test(h)?"font-style:italic":""].filter(Boolean).join(";");g!==""&&l(g)}else if(/\d/u.test(c)){const s=/^\d+/u.exec(n.slice(a))?.[0]??c;a+=s.length-1,l(`font-size:${s}pt`)}else if(i==="K"){const s=n.slice(a+1,a+7);a+=6,/^[0-9A-Fa-f]{6}$/u.test(s)&&l(`color:#${s}`)}}}return e+"</span>".repeat(o)}const $=n=>`${String(Math.round(n*1e3)/1e3)}px`;export class SheetPrint{job;calc;drawers=new Map;file;constructor(t,e={}){this.calc=t,this.file=e.file,this.job=lt(t,{...e.sheets?{sheets:e.sheets}:{},height:(o,l)=>this.drawer(o).height(l)})}drawer(t){let e=this.drawers.get(t);return e||(e=new W(this.calc,t,this.file),this.drawers.set(t,e)),e}html(t,e,o){const l=new I,r=new Map,a=[];for(const c of this.job.pages.slice(t,e)){const{of:i}=c,s=`${$(i.paper.width)} ${$(i.paper.height)}`;let d=r.get(s);d===void 0&&(d=`paper${String(r.size)}`,r.set(s,d)),a.push(this.page(c,l,d,o))}const f=[...r].map(([c,i])=>`@page ${i}{size:${c};margin:0}`).join(`
43
43
  `);return G(o,`${f}
44
44
  .page{position:relative;overflow:hidden;break-after:page}
45
45
  .page:last-child{break-after:auto}
@@ -49,4 +49,4 @@ ${o.css()}`,f.join("")),width:r,cut:l}}const H=n=>String(n).padStart(2,"0");expo
49
49
  .hf>div{flex:1 1 0;overflow:visible}
50
50
  .hf>.c{text-align:center}
51
51
  .hf>.r{text-align:right}
52
- ${l.css()}`,a.join(""))}page(t,e,o,l){const{of:r}=t,a=this.drawer(r.sheet),{margins:f,scale:c}=r,i=st(t),s=nt(t),d=r.rows.slice(t.down.from,t.down.to),h=r.cols.slice(t.across.from,t.across.to),p=a.table([...i,...d],[...s,...h],e,{headings:!1}),w=i.reduce((g,v)=>g+a.height(v),0),$=s.reduce((g,v)=>g+R(r.sheet,v),0),u=r.rowAt[t.down.from]??0,y=r.colAt[t.across.from]??0,S=(r.rowAt[t.down.to]??0)-u,b=(r.colAt[t.across.to]??0)-y,C=r.charts.filter(g=>g.left<y+b&&g.left+g.width>y&&g.top<u+S&&g.top+g.height>u).map(g=>`<div class="chart" style="left:${m(g.left-y)};top:${m(g.top-u)}">${a.svg(g.chart)}</div>`).join(""),A=C===""?"":`<div class="charts" style="left:${m($)};top:${m(w)};width:${m(b)};height:${m(S)}">${C}</div>`,M=r.paper.width-f.left-f.right,z=r.paper.height-f.top-f.bottom,D={page:t.number,pages:this.job.pages.length,sheet:r.sheet.name,file:l.name,date:l.date},j=(g,v)=>g?`<div class="hf" style="left:${m(f.left)};right:${m(f.right)};${v}"><div>${headerFooterHtml(g.left??"",D)}</div><div class="c">${headerFooterHtml(g.center??"",D)}</div><div class="r">${headerFooterHtml(g.right??"",D)}</div></div>`:"";return`<section class="page" style="page:${o};width:${m(r.paper.width)};height:${m(r.paper.height)}">`+j(r.header,`top:${m(f.header)}`)+`<div class="body" style="left:${m(f.left)};top:${m(f.top)};width:${m(M)};height:${m(z)}"><div class="scaled" style="width:${m(M/c)};height:${m(z/c)}${c===1?"":`;transform:scale(${String(c)})`}">`+p.html+A+"</div></div>"+j(r.footer,`bottom:${m(f.footer)}`)+"</section>"}}
52
+ ${l.css()}`,a.join(""))}page(t,e,o,l){const{of:r}=t,a=this.drawer(r.sheet),{margins:f,scale:c}=r,i=ot(t),s=it(t),d=r.rows.slice(t.down.from,t.down.to),h=r.cols.slice(t.across.from,t.across.to),g=a.table([...i,...d],[...s,...h],e,{headings:!1}),b=i.reduce((p,C)=>p+a.height(C),0),m=s.reduce((p,C)=>p+F(r.sheet,C),0),u=r.rowAt[t.down.from]??0,y=r.colAt[t.across.from]??0,S=(r.rowAt[t.down.to]??0)-u,w=(r.colAt[t.across.to]??0)-y,v=r.charts.filter(p=>p.left<y+w&&p.left+p.width>y&&p.top<u+S&&p.top+p.height>u).map(p=>`<div class="chart" style="left:${$(p.left-y)};top:${$(p.top-u)}">${a.svg(p.chart)}</div>`).join(""),H=v===""?"":`<div class="charts" style="left:${$(m)};top:${$(b)};width:${$(w)};height:${$(S)}">${v}</div>`,j=r.paper.width-f.left-f.right,z=r.paper.height-f.top-f.bottom,A={page:t.number,pages:this.job.pages.length,sheet:r.sheet.name,file:l.name,date:l.date},D=(p,C)=>p?`<div class="hf" style="left:${$(f.left)};right:${$(f.right)};${C}"><div>${headerFooterHtml(p.left??"",A)}</div><div class="c">${headerFooterHtml(p.center??"",A)}</div><div class="r">${headerFooterHtml(p.right??"",A)}</div></div>`:"";return`<section class="page" style="page:${o};width:${$(r.paper.width)};height:${$(r.paper.height)}">`+D(r.header,`top:${$(f.header)}`)+`<div class="body" style="left:${$(f.left)};top:${$(f.top)};width:${$(j)};height:${$(z)}"><div class="scaled" style="width:${$(j/c)};height:${$(z/c)}${c===1?"":`;transform:scale(${String(c)})`}">`+g.html+H+"</div></div>"+D(r.footer,`bottom:${$(f.footer)}`)+"</section>"}}
@@ -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{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{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};
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/sheet",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{stat as m}from"node:fs/promises";import{join as p,relative as f,resolve as w,sep as k}from"node:path";import{nodeLending as b,readWork as y}from"@allyhub/build";import{itemIdOf as S,listedWork as $}from"@allyhub/formats";import{CommandError as h,EXIT as u}from"@allyhub/protocol";import{checkWorkbook as g}from"@allyhub/sheet";import{readSheetSource as x,sheetRoot as E,workbookFiles as j}from"../code.js";const A=/\.ya?ml$/iu;export async function findSheet(t,i,n){const e=w(i,n),o=f(t,e).split(k).join("/"),c=$((await y(t)).work);if(A.test(e)&&(await m(e).catch(()=>{}))?.isFile())return c.some(r=>r.file===o&&r.kind!=="sheet")?void 0:e;const l=new Set([o,n.replace(/^\.\//u,"").replace(/\/+$/u,"")]),s=c.find(r=>r.kind==="sheet"&&l.has(S(r.file)));return s===void 0?void 0:p(t,s.file)}export const SHEET_NAMED="Name it by its file (research/leads.yaml) or its id in allyhub.yaml (research/leads).";export async function sheetAt(t,i,n){const e=await findSheet(t,i,n);if(e!==void 0)return e;throw new h("not-found",`There is no sheet ${n}.`,{exit:u.notFound,hint:SHEET_NAMED})}export async function sourceOfSheet(t,i,n){const e=E(t,i),o=await x(e.root,e.file,{lend:await b(n(e.root),e.root)});return{...e,source:o,files:j(e.root,o)}}export async function openSheet(t,i,n,e){const o=await sheetAt(t,i.cwd,n),{source:c,files:l}=await sourceOfSheet(t,o,a=>i.kinds(a)),{workbook:s,calc:r,problems:d}=g(l,{scenario:e});if(!s||!r)throw new h("bad-file",`${f(t,o)} cannot be read: ${d.map(a=>`${a.line===void 0?"":`line ${String(a.line)}: `}${a.message}`).join("; ")}`,{exit:u.usage,hint:"allyhub check lists what is wrong."});return{file:f(t,o),workbook:s,calc:r,problems:d.length+c.problems.length}}
2
+ import{stat as p}from"node:fs/promises";import{join as w,relative as f,resolve as k,sep as b}from"node:path";import{nodeLending as y,readWork as S}from"@allyhub/build";import{itemIdOf as $,listedWork as g}from"@allyhub/formats";import{CommandError as u,EXIT as m}from"@allyhub/protocol";const x=/\.ya?ml$/iu;export async function findSheet(e,o,i){const t=k(o,i),r=f(e,t).split(b).join("/"),c=g((await S(e)).work);if(x.test(t)&&(await p(t).catch(()=>{}))?.isFile())return c.some(s=>s.file===r&&s.kind!=="sheet")?void 0:t;const n=new Set([r,i.replace(/^\.\//u,"").replace(/\/+$/u,"")]),a=c.find(s=>s.kind==="sheet"&&n.has($(s.file)));return a===void 0?void 0:w(e,a.file)}export const SHEET_NAMED="Name it by its file (research/leads.yaml) or its id in allyhub.yaml (research/leads).";export async function sheetAt(e,o,i){const t=await findSheet(e,o,i);if(t!==void 0)return t;throw new u("not-found",`There is no sheet ${i}.`,{exit:m.notFound,hint:SHEET_NAMED})}export async function sourceOfSheet(e,o,i){const{readSheetSource:t,sheetRoot:r,workbookFiles:c}=await import("../code.js"),n=r(e,o),a=await t(n.root,n.file,{lend:await y(i(n.root),n.root)});return{...n,source:a,files:c(n.root,a)}}export async function openSheet(e,o,i,t){const r=await sheetAt(e,o.cwd,i),{source:c,files:n}=await sourceOfSheet(e,r,l=>o.kinds(l)),{checkWorkbook:a}=await import("@allyhub/sheet"),{workbook:s,calc:d,problems:h}=a(n,{scenario:t});if(!s||!d)throw new u("bad-file",`${f(e,r)} cannot be read: ${h.map(l=>`${l.line===void 0?"":`line ${String(l.line)}: `}${l.message}`).join("; ")}`,{exit:m.usage,hint:"allyhub check lists what is wrong."});return{file:f(e,r),workbook:s,calc:d,problems:h.length+c.problems.length}}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{builtinModules as h}from"node:module";import{existsSync as S,readFileSync as b,realpathSync as w}from"node:fs";import{readFile as m}from"node:fs/promises";import{dirname as E,isAbsolute as $,join as u,posix as p,relative as v}from"node:path";import{MetaLoader as P,besideModule as j,dependenciesOf as A,lineAt as F,nodeStackPlace as O,parse as M,walk as T}from"@allyhub/build";import{dirOf as x}from"@allyhub/formats";import{Calc as W,SHEET_CODE as y,SHEET_ENTRY as C,codeOf as D,dataFilesOf as I,readWorkbook as R,tableRows as N}from"@allyhub/sheet";import{problem as g}from"@allyhub/diagnostics";import{repoPath as k}from"@allyhub/piece";const H=new Set([...h,...h.map(n=>`node:${n}`)]);export const sheetFilePath=n=>e=>e===C||e===""?n.file:e===y||e.startsWith(`${y}/`)?n.code??n.file:p.join(n.dir,e);export function sheetCodeOf(n,e){const t=D(e);return t===void 0?void 0:k(n,t)}async function K(n,e){const t=[],a=new Set,s=async r=>{if(a.has(r))return;a.add(r);const d=await m(u(n,r),"utf8").catch(()=>{});if(d===void 0)return;const c=M(r,d),l=[];T(c.program,o=>{if(o.type!=="ImportDeclaration"&&o.type!=="ImportExpression"&&o.type!=="ExportNamedDeclaration"&&o.type!=="ExportAllDeclaration")return;const i=o.source?.value;typeof i=="string"&&l.push({spec:i,node:o})});for(const{spec:o,node:i}of l){if(H.has(o)){t.push(g("AK-M012",`${r} imports ${o}. A sheet's code reads the project's files with data(), and reaches nothing else.`,{where:{file:r,line:F(d,i.start)}}));continue}if(o.startsWith(".")){const f=k(r,o);f!==void 0&&await s(f)}}};return await s(e),t}export async function runSheetCode(n,e,t){const a=await K(n,e),s=await t.request({type:"run",module:j(import.meta.url,"evaluate"),file:e});if(a.push(...s.problems),!s.ok){if(s.error!=="timeout"){const r=O(s.stack,n);a.push(g("AK-R001",`Failed to run ${e}: ${s.error??""}${r?` (at ${r.file}:${String(r.line)})`:""}`,{where:r?{file:r.file,line:r.line}:{file:e}}))}return{failed:!0,problems:a}}return{generated:s.value,failed:!1,problems:a}}export async function readSheetSource(n,e,t={}){const a=x(e),s=u(n,a),r=await m(u(n,e),"utf8"),d=new Map;for(const i of I(r)){const f=await m(u(s,i),"utf8").catch(()=>{});f!==void 0&&d.set(i,f)}const c=sheetCodeOf(e,r),l={file:e,dir:a,text:r,csv:d,...c===void 0?{}:{code:c},failed:!1,problems:[]};if(c===void 0)return l;const o=t.meta??new P({root:n,media:{},dependencies:[...await A(n)],user:!0,...t.lend?.lent?{lent:{...t.lend.lent}}:{},...t.lend?.sdk?{sdk:{...t.lend.sdk}}:{},...t.lend?.bound?{bound:{...t.lend.bound}}:{},...t.lend?.buildPlugins?{buildPlugins:[...t.lend.buildPlugins]}:{}});try{const i=await runSheetCode(n,c,o);l.failed=i.failed,l.problems=i.problems,i.generated&&(l.generated=i.generated)}finally{t.meta||await o.close()}return l}export function sheetRoot(n,e){const t=v(w(n),w(e));return t.startsWith("..")||$(t)?{root:E(e),file:p.basename(e)}:{root:n,file:t.split("\\").join("/")}}export function workbookFiles(n,e){return{text:e.text,read:t=>e.csv.get(t),generated:e.generated,exists:t=>{const a=p.normalize(p.join(e.dir,t));return!a.startsWith("..")&&S(u(n,a))}}}export function readTable(n,e){const[t="",a=""]=e.split("#"),s=u(n,x(t)),{workbook:r}=R({text:b(u(n,t),"utf8"),read:c=>{try{return b(u(s,c),"utf8")}catch{return}}}),d=r?.table(a);if(!r||!d)throw new Error(`${e} is not a table of a sheet.`);return N(new W(r).calculate(),d)}
2
+ import{builtinModules as h}from"node:module";import{existsSync as S,readFileSync as b,realpathSync as w}from"node:fs";import{readFile as m}from"node:fs/promises";import{dirname as E,isAbsolute as $,join as u,posix as f,relative as v}from"node:path";import{MetaLoader as P,besideModule as j,dependenciesOf as A,lineAt as F,nodeStackPlace as O,parse as M,walk as T}from"@allyhub/build";import{dirOf as x}from"@allyhub/formats";import{Calc as W,SHEET_CODE as y,SHEET_ENTRY as C,codeOf as D,dataFilesOf as I,readWorkbook as R,tableRows as N}from"@allyhub/sheet";import{problem as g}from"@allyhub/diagnostics";import{repoPath as k}from"@allyhub/piece";const H=new Set([...h,...h.map(n=>`node:${n}`)]);export const sheetFilePath=n=>e=>e===C||e===""?n.file:e===y||e.startsWith(`${y}/`)?n.code??n.file:f.join(n.dir,e);export function sheetCodeOf(n,e){const t=D(e);return t===void 0?void 0:k(n,t)}async function K(n,e){const t=[],a=new Set,o=async r=>{if(a.has(r))return;a.add(r);const d=await m(u(n,r),"utf8").catch(()=>{});if(d===void 0)return;const c=M(r,d),l=[];T(c.program,s=>{if(s.type!=="ImportDeclaration"&&s.type!=="ImportExpression"&&s.type!=="ExportNamedDeclaration"&&s.type!=="ExportAllDeclaration")return;const i=s.source?.value;typeof i=="string"&&l.push({spec:i,node:s})});for(const{spec:s,node:i}of l){if(H.has(s)){t.push(g("AK-M012",`${r} imports ${s}. A sheet's code reads the project's files with data(), and reaches nothing else.`,{where:{file:r,line:F(d,i.start)}}));continue}if(s.startsWith(".")){const p=k(r,s);p!==void 0&&await o(p)}}};return await o(e),t}export async function runSheetCode(n,e,t){const a=await K(n,e),o=await t.request({type:"run",module:j(import.meta.url,"evaluate"),file:e});if(a.push(...o.problems),!o.ok){if(o.error!=="timeout"){const r=O(o.stack,n);a.push(g("AK-R001",`Failed to run ${e}: ${o.error??""}${r?` (at ${r.file}:${String(r.line)})`:""}`,{where:r?{file:r.file,line:r.line}:{file:e}}))}return{failed:!0,problems:a}}return{generated:o.value,failed:!1,problems:a}}export async function readSheetSource(n,e,t={}){const a=x(e),o=u(n,a),r=await m(u(n,e),"utf8"),d=new Map;for(const i of I(r)){const p=await m(u(o,i),"utf8").catch(()=>{});p!==void 0&&d.set(i,p)}const c=sheetCodeOf(e,r),l={file:e,dir:a,text:r,csv:d,...c===void 0?{}:{code:c},failed:!1,problems:[]};if(c===void 0)return l;const s=t.meta??new P({root:n,media:{},dependencies:[...await A(n)],user:!0,...t.lend?.lent?{lent:{...t.lend.lent}}:{},...t.lend?.sdk?{sdk:{...t.lend.sdk}}:{},...t.lend?.bound?{bound:{...t.lend.bound}}:{},...t.lend?.parts?{parts:{...t.lend.parts}}:{},...t.lend?.buildPlugins?{buildPlugins:[...t.lend.buildPlugins]}:{}});try{const i=await runSheetCode(n,c,s);l.failed=i.failed,l.problems=i.problems,i.generated&&(l.generated=i.generated)}finally{t.meta||await s.close()}return l}export function sheetRoot(n,e){const t=v(w(n),w(e));return t.startsWith("..")||$(t)?{root:E(e),file:f.basename(e)}:{root:n,file:t.split("\\").join("/")}}export function workbookFiles(n,e){return{text:e.text,read:t=>e.csv.get(t),generated:e.generated,exists:t=>{const a=f.normalize(f.join(e.dir,t));return!a.startsWith("..")&&S(u(n,a))}}}export function readTable(n,e){const[t="",a=""]=e.split("#"),o=u(n,x(t)),{workbook:r}=R({text:b(u(n,t),"utf8"),read:c=>{try{return b(u(o,c),"utf8")}catch{return}}}),d=r?.table(a);if(!r||!d)throw new Error(`${e} is not a table of a sheet.`);return N(new W(r).calculate(),d)}
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{readFileSync as _}from"node:fs";import{mkdir as j,writeFile as x}from"node:fs/promises";import{basename as S,dirname as b,join as F,posix as $}from"node:path";import{nodeLending as L}from"@allyhub/build";import{readSheetSource as R,workbookFiles as T}from"./code.js";import{printPage as k,printPdf as A,SHEET_FONT as v,sheetFontsCss as E}from"@allyhub/doc-print";import{checkWorkbook as H,csvOf as z,printedLines as D,seededRandom as G,sheetHtml as U,SheetPrint as W}from"@allyhub/sheet";import{writeXlsx as I}from"@allyhub/sheet/xlsx";export const SHEET_TYPES=["xlsx","pdf","png","csv"];export function csvNames(n){const e=new Set;return n.map((t,i)=>{const s=t.normalize("NFC").replace(/[\\/:*?"<>|\p{Cc}]+/gu,"-").replace(/\s+/gu," ").trim().replace(/^\.+/u,"")||String(i+1);let a=s;for(let r=2;e.has(a.toLowerCase());r++)a=`${s} (${String(r)})`;return e.add(a.toLowerCase()),a})}export const PNG_ROWS=700,PNG_COLUMNS=200;const M=1e4,J=40;function X(n){const e=n.values,t=n.bom;return{...e==="data"||e==="shown"?{values:e}:{},...typeof t=="boolean"?{bom:t}:{}}}function Y(n){const e=[];let t=0,i=0;return n.job.pages.forEach((s,a)=>{const r=(s.down.to-s.down.from+s.of.titleRows.length)*(s.across.to-s.across.from+s.of.titleCols.length);a>t&&(i+r>M||a-t>=J)&&(e.push([t,a]),t=a,i=0),i+=r}),t<n.job.pages.length&&e.push([t,n.job.pages.length]),e}function q(){const n=Number(process.env.SOURCE_DATE_EPOCH);return Number.isFinite(n)&&n>0?new Date(n*1e3):new Date}export async function printSheet(n,e){const t=new W(n,e.picture===void 0?{}:{file:e.picture}),i=Y(t),s=e.date??q();return await A({file:e.file,title:e.title,tagged:!1,...e.signal===void 0?{}:{signal:e.signal},parts:{count:Math.max(1,i.length),html:async a=>{const[r,u]=i[a]??[0,0],p=t.html(r,u,{name:e.name,date:s,font:v});return p.replace("<style>",`<style>${await E(p)}`)}}}),t.job.pages.length}export async function renderSheet(n,e){const t=e.prepared.sheets.find(o=>o.place===n.id);if(!t||e.types.length===0)return[];const{root:i,log:s}=e,a=X(e.params);s?.(`Rendering ${t.file}…`);const r=await R(i,t.file,{lend:await L(e.prepared.kinds,i)});if(r.failed)return s?.(`${t.file}: its code does not run. allyhub check says why.`),[];const{workbook:u,calc:p}=H(T(i,r),{random:G([r.text,...r.csv.values(),r.generated?JSON.stringify(r.generated):""].join(`
3
- `))});if(!u||!p)return[];const h=o=>{const c=$.normalize($.join(t.dir,o));try{return c.startsWith("..")?void 0:new Uint8Array(_(F(i,c)))}catch{return}},m=[],C=u.sheets.length>1,g=t.place;for(const o of e.types){const c=e.out(o);await j(b(c),{recursive:!0});const w=S(c,`.${o}`),N=u.title??t.title??S(t.place);if(o==="pdf"){await printSheet(p,{file:c,name:w,title:N,picture:h}),m.push({type:o,files:[c]});continue}if(o==="png"){const l=U(p,{font:v,file:h,rows:PNG_ROWS,columns:PNG_COLUMNS,headings:!1}),f=l.cut.map(d=>`${g}.png: ${d}`);await k({html:l.html.replace("<style>",`<style>${await E(l.html)}`),out:b(c),name:w,types:["png"],width:l.width+48,pictureCss:"body{padding:24px}"}),m.push({type:o,files:[c],...f.length?{notes:f}:{}});continue}if(o==="xlsx"){const{bytes:l,left:f}=I(p,{file:h});await x(c,l);for(const d of D(`${g}.xlsx`,p))s?.(d);m.push({type:o,files:[c],...f.length?{notes:f.map(d=>`${g}.xlsx does not hold ${d}.`)}:{}});continue}if(o!=="csv")continue;const y=[],P=c.slice(0,-`.${o}`.length),O=csvNames(u.sheets.map(l=>l.name));u.sheets.forEach((l,f)=>{y.push([C?`${P}-${O[f]??String(f+1)}.csv`:c,z(p,l,a)])});for(const[l,f]of y)await x(l,f),m.push({type:o,files:[l]})}return m}
2
+ import{readFileSync as T}from"node:fs";import{mkdir as j,writeFile as $}from"node:fs/promises";import{basename as E,dirname as v,join as L,posix as C}from"node:path";import{nodeLending as R}from"@allyhub/build";import{readSheetSource as k,workbookFiles as H}from"./code.js";import{checkWorkbook as A,csvOf as z,printedLines as D,seededRandom as G,sheetHtml as U,SheetPrint as W}from"@allyhub/sheet";import{writeXlsx as I}from"@allyhub/sheet/xlsx";export const SHEET_TYPES=["xlsx","pdf","png","csv"];export function csvNames(n){const t=new Set;return n.map((e,r)=>{const s=e.normalize("NFC").replace(/[\\/:*?"<>|\p{Cc}]+/gu,"-").replace(/\s+/gu," ").trim().replace(/^\.+/u,"")||String(r+1);let a=s;for(let i=2;t.has(a.toLowerCase());i++)a=`${s} (${String(i)})`;return t.add(a.toLowerCase()),a})}export const PNG_ROWS=700,PNG_COLUMNS=200;const M=1e4,J=40;function X(n){const t=n.values,e=n.bom;return{...t==="data"||t==="shown"?{values:t}:{},...typeof e=="boolean"?{bom:e}:{}}}function Y(n){const t=[];let e=0,r=0;return n.job.pages.forEach((s,a)=>{const i=(s.down.to-s.down.from+s.of.titleRows.length)*(s.across.to-s.across.from+s.of.titleCols.length);a>e&&(r+i>M||a-e>=J)&&(t.push([e,a]),e=a,r=0),r+=i}),e<n.job.pages.length&&t.push([e,n.job.pages.length]),t}function q(){const n=Number(process.env.SOURCE_DATE_EPOCH);return Number.isFinite(n)&&n>0?new Date(n*1e3):new Date}const N=()=>import("@allyhub/doc-print");export async function printSheet(n,t){const e=new W(n,t.picture===void 0?{}:{file:t.picture}),r=Y(e),s=t.date??q(),{printPdf:a,SHEET_FONT:i,sheetFontsCss:u}=await N();return await a({file:t.file,title:t.title,tagged:!1,...t.signal===void 0?{}:{signal:t.signal},parts:{count:Math.max(1,r.length),html:async p=>{const[m,d]=r[p]??[0,0],g=e.html(m,d,{name:t.name,date:s,font:i});return g.replace("<style>",`<style>${await u(g)}`)}}}),e.job.pages.length}export async function renderSheet(n,t){const e=t.prepared.sheets.find(o=>o.place===n.id);if(!e||t.types.length===0)return[];const{root:r,log:s}=t,a=X(t.params);s?.(`Rendering ${e.file}…`);const i=await k(r,e.file,{lend:await R(t.prepared.kinds,r)});if(i.failed)return s?.(`${e.file}: its code does not run. allyhub check says why.`),[];const{workbook:u,calc:p}=A(H(r,i),{random:G([i.text,...i.csv.values(),i.generated?JSON.stringify(i.generated):""].join(`
3
+ `))});if(!u||!p)return[];const m=o=>{const c=C.normalize(C.join(e.dir,o));try{return c.startsWith("..")?void 0:new Uint8Array(T(L(r,c)))}catch{return}},d=[],g=u.sheets.length>1,y=e.place;for(const o of t.types){const c=t.out(o);await j(v(c),{recursive:!0});const S=E(c,`.${o}`),P=u.title??e.title??E(e.place);if(o==="pdf"){await printSheet(p,{file:c,name:S,title:P,picture:m}),d.push({type:o,files:[c]});continue}if(o==="png"){const{printPage:l,SHEET_FONT:f,sheetFontsCss:h}=await N(),w=U(p,{font:f,file:m,rows:PNG_ROWS,columns:PNG_COLUMNS,headings:!1}),b=w.cut.map(F=>`${y}.png: ${F}`);await l({html:w.html.replace("<style>",`<style>${await h(w.html)}`),out:v(c),name:S,types:["png"],width:w.width+48,pictureCss:"body{padding:24px}"}),d.push({type:o,files:[c],...b.length?{notes:b}:{}});continue}if(o==="xlsx"){const{bytes:l,left:f}=I(p,{file:m});await $(c,l);for(const h of D(`${y}.xlsx`,p))s?.(h);d.push({type:o,files:[c],...f.length?{notes:f.map(h=>`${y}.xlsx does not hold ${h}.`)}:{}});continue}if(o!=="csv")continue;const x=[],O=c.slice(0,-`.${o}`.length),_=csvNames(u.sheets.map(l=>l.name));u.sheets.forEach((l,f)=>{x.push([g?`${O}-${_[f]??String(f+1)}.csv`:c,z(p,l,a)])});for(const[l,f]of x)await $(l,f),d.push({type:o,files:[l]})}return d}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/sheet-extension",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./code": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/slides-core",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/slides-extension",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./tools": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/slides-pptx",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/slides-runtime",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/stage",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,79 +1 @@
1
- /* arimo-cyrillic-ext-400-italic */
2
- @font-face {
3
- font-family: 'Arimo';
4
- font-style: italic;
5
- font-display: swap;
6
- font-weight: 400;
7
- src: url(./files/arimo-cyrillic-ext-400-italic.woff2) format('woff2');
8
- unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
9
- }
10
-
11
- /* arimo-cyrillic-400-italic */
12
- @font-face {
13
- font-family: 'Arimo';
14
- font-style: italic;
15
- font-display: swap;
16
- font-weight: 400;
17
- src: url(./files/arimo-cyrillic-400-italic.woff2) format('woff2');
18
- unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
19
- }
20
-
21
- /* arimo-greek-ext-400-italic */
22
- @font-face {
23
- font-family: 'Arimo';
24
- font-style: italic;
25
- font-display: swap;
26
- font-weight: 400;
27
- src: url(./files/arimo-greek-ext-400-italic.woff2) format('woff2');
28
- unicode-range: U+1F00-1FFF;
29
- }
30
-
31
- /* arimo-greek-400-italic */
32
- @font-face {
33
- font-family: 'Arimo';
34
- font-style: italic;
35
- font-display: swap;
36
- font-weight: 400;
37
- src: url(./files/arimo-greek-400-italic.woff2) format('woff2');
38
- unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF;
39
- }
40
-
41
- /* arimo-hebrew-400-italic */
42
- @font-face {
43
- font-family: 'Arimo';
44
- font-style: italic;
45
- font-display: swap;
46
- font-weight: 400;
47
- src: url(./files/arimo-hebrew-400-italic.woff2) format('woff2');
48
- unicode-range: U+0307-0308,U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F;
49
- }
50
-
51
- /* arimo-vietnamese-400-italic */
52
- @font-face {
53
- font-family: 'Arimo';
54
- font-style: italic;
55
- font-display: swap;
56
- font-weight: 400;
57
- src: url(./files/arimo-vietnamese-400-italic.woff2) format('woff2');
58
- unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
59
- }
60
-
61
- /* arimo-latin-ext-400-italic */
62
- @font-face {
63
- font-family: 'Arimo';
64
- font-style: italic;
65
- font-display: swap;
66
- font-weight: 400;
67
- src: url(./files/arimo-latin-ext-400-italic.woff2) format('woff2');
68
- unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
69
- }
70
-
71
- /* arimo-latin-400-italic */
72
- @font-face {
73
- font-family: 'Arimo';
74
- font-style: italic;
75
- font-display: swap;
76
- font-weight: 400;
77
- src: url(./files/arimo-latin-400-italic.woff2) format('woff2');
78
- unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
79
- }
1
+ @font-face{font-family:Arimo;font-style:italic;font-display:swap;font-weight:400;src:url(./files/arimo-cyrillic-ext-400-italic.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Arimo;font-style:italic;font-display:swap;font-weight:400;src:url(./files/arimo-cyrillic-400-italic.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Arimo;font-style:italic;font-display:swap;font-weight:400;src:url(./files/arimo-greek-ext-400-italic.woff2) format("woff2");unicode-range:U+1F00-1FFF}@font-face{font-family:Arimo;font-style:italic;font-display:swap;font-weight:400;src:url(./files/arimo-greek-400-italic.woff2) format("woff2");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Arimo;font-style:italic;font-display:swap;font-weight:400;src:url(./files/arimo-hebrew-400-italic.woff2) format("woff2");unicode-range:U+0307-0308,U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:Arimo;font-style:italic;font-display:swap;font-weight:400;src:url(./files/arimo-vietnamese-400-italic.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Arimo;font-style:italic;font-display:swap;font-weight:400;src:url(./files/arimo-latin-ext-400-italic.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Arimo;font-style:italic;font-display:swap;font-weight:400;src:url(./files/arimo-latin-400-italic.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@@ -1,79 +1 @@
1
- /* arimo-cyrillic-ext-400-normal */
2
- @font-face {
3
- font-family: 'Arimo';
4
- font-style: normal;
5
- font-display: swap;
6
- font-weight: 400;
7
- src: url(./files/arimo-cyrillic-ext-400-normal.woff2) format('woff2');
8
- unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
9
- }
10
-
11
- /* arimo-cyrillic-400-normal */
12
- @font-face {
13
- font-family: 'Arimo';
14
- font-style: normal;
15
- font-display: swap;
16
- font-weight: 400;
17
- src: url(./files/arimo-cyrillic-400-normal.woff2) format('woff2');
18
- unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
19
- }
20
-
21
- /* arimo-greek-ext-400-normal */
22
- @font-face {
23
- font-family: 'Arimo';
24
- font-style: normal;
25
- font-display: swap;
26
- font-weight: 400;
27
- src: url(./files/arimo-greek-ext-400-normal.woff2) format('woff2');
28
- unicode-range: U+1F00-1FFF;
29
- }
30
-
31
- /* arimo-greek-400-normal */
32
- @font-face {
33
- font-family: 'Arimo';
34
- font-style: normal;
35
- font-display: swap;
36
- font-weight: 400;
37
- src: url(./files/arimo-greek-400-normal.woff2) format('woff2');
38
- unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF;
39
- }
40
-
41
- /* arimo-hebrew-400-normal */
42
- @font-face {
43
- font-family: 'Arimo';
44
- font-style: normal;
45
- font-display: swap;
46
- font-weight: 400;
47
- src: url(./files/arimo-hebrew-400-normal.woff2) format('woff2');
48
- unicode-range: U+0307-0308,U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F;
49
- }
50
-
51
- /* arimo-vietnamese-400-normal */
52
- @font-face {
53
- font-family: 'Arimo';
54
- font-style: normal;
55
- font-display: swap;
56
- font-weight: 400;
57
- src: url(./files/arimo-vietnamese-400-normal.woff2) format('woff2');
58
- unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
59
- }
60
-
61
- /* arimo-latin-ext-400-normal */
62
- @font-face {
63
- font-family: 'Arimo';
64
- font-style: normal;
65
- font-display: swap;
66
- font-weight: 400;
67
- src: url(./files/arimo-latin-ext-400-normal.woff2) format('woff2');
68
- unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
69
- }
70
-
71
- /* arimo-latin-400-normal */
72
- @font-face {
73
- font-family: 'Arimo';
74
- font-style: normal;
75
- font-display: swap;
76
- font-weight: 400;
77
- src: url(./files/arimo-latin-400-normal.woff2) format('woff2');
78
- unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
79
- }
1
+ @font-face{font-family:Arimo;font-style:normal;font-display:swap;font-weight:400;src:url(./files/arimo-cyrillic-ext-400-normal.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Arimo;font-style:normal;font-display:swap;font-weight:400;src:url(./files/arimo-cyrillic-400-normal.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Arimo;font-style:normal;font-display:swap;font-weight:400;src:url(./files/arimo-greek-ext-400-normal.woff2) format("woff2");unicode-range:U+1F00-1FFF}@font-face{font-family:Arimo;font-style:normal;font-display:swap;font-weight:400;src:url(./files/arimo-greek-400-normal.woff2) format("woff2");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Arimo;font-style:normal;font-display:swap;font-weight:400;src:url(./files/arimo-hebrew-400-normal.woff2) format("woff2");unicode-range:U+0307-0308,U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:Arimo;font-style:normal;font-display:swap;font-weight:400;src:url(./files/arimo-vietnamese-400-normal.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Arimo;font-style:normal;font-display:swap;font-weight:400;src:url(./files/arimo-latin-ext-400-normal.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Arimo;font-style:normal;font-display:swap;font-weight:400;src:url(./files/arimo-latin-400-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}