allyhub 0.6.0 → 0.7.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 (621) hide show
  1. package/dist/audio-text.js +1 -1
  2. package/dist/commands/add.js +2 -2
  3. package/dist/commands/cloud-tools.js +5 -5
  4. package/dist/commands/dev.js +1 -1
  5. package/dist/commands/frames/piece.js +1 -1
  6. package/dist/commands/frames/sheet.js +1 -1
  7. package/dist/commands/frames.js +8 -8
  8. package/dist/commands/index.js +1 -1
  9. package/dist/commands/inspect/common.js +1 -1
  10. package/dist/commands/inspect/layout.js +1 -1
  11. package/dist/commands/render.js +1 -1
  12. package/dist/commands/sheet.js +5 -5
  13. package/dist/commands/site.js +3 -2
  14. package/dist/commands/skills.js +3 -3
  15. package/dist/commands/slides.js +2 -2
  16. package/dist/node_modules/@allyhub-next/audio/dist/node/index.js +1 -1
  17. package/dist/node_modules/@allyhub-next/audio/dist/node/master.js +1 -1
  18. package/dist/node_modules/@allyhub-next/audio/package.json +1 -1
  19. package/dist/node_modules/@allyhub-next/browser/dist/html.js +1 -1
  20. package/dist/node_modules/@allyhub-next/browser/package.json +1 -1
  21. package/dist/node_modules/@allyhub-next/build/dist/content.d.ts +4 -0
  22. package/dist/node_modules/@allyhub-next/build/dist/content.js +1 -1
  23. package/dist/node_modules/@allyhub-next/build/dist/index.d.ts +2 -2
  24. package/dist/node_modules/@allyhub-next/build/dist/index.js +1 -1
  25. package/dist/node_modules/@allyhub-next/build/dist/meta-worker.d.ts +2 -2
  26. package/dist/node_modules/@allyhub-next/build/dist/meta-worker.js +3 -3
  27. package/dist/node_modules/@allyhub-next/build/dist/move-refs.d.ts +1 -1
  28. package/dist/node_modules/@allyhub-next/build/dist/move-refs.js +1 -1
  29. package/dist/node_modules/@allyhub-next/build/dist/plugin.d.ts +12 -3
  30. package/dist/node_modules/@allyhub-next/build/dist/plugin.js +7 -6
  31. package/dist/node_modules/@allyhub-next/build/dist/prepare.d.ts +9 -5
  32. package/dist/node_modules/@allyhub-next/build/dist/prepare.js +2 -2
  33. package/dist/node_modules/@allyhub-next/build/dist/vite.d.ts +10 -0
  34. package/dist/node_modules/@allyhub-next/build/dist/vite.js +2 -2
  35. package/dist/node_modules/@allyhub-next/build/package.json +1 -1
  36. package/dist/node_modules/@allyhub-next/chart/dist/chart-xml.js +2 -2
  37. package/dist/node_modules/@allyhub-next/chart/dist/chart.d.ts +14 -5
  38. package/dist/node_modules/@allyhub-next/chart/dist/chart.js +1 -1
  39. package/dist/node_modules/@allyhub-next/chart/package.json +1 -1
  40. package/dist/node_modules/@allyhub-next/check/dist/check.js +3 -3
  41. package/dist/node_modules/@allyhub-next/check/package.json +1 -1
  42. package/dist/node_modules/@allyhub-next/cloud/dist/blobs.js +2 -0
  43. package/dist/node_modules/@allyhub-next/cloud/dist/call.js +4 -2
  44. package/dist/node_modules/@allyhub-next/cloud/dist/client.js +1 -1
  45. package/dist/node_modules/@allyhub-next/cloud/dist/errors.js +1 -1
  46. package/dist/node_modules/@allyhub-next/cloud/dist/hashes.js +2 -0
  47. package/dist/node_modules/@allyhub-next/cloud/dist/index.js +1 -1
  48. package/dist/node_modules/@allyhub-next/cloud/dist/sites.js +2 -0
  49. package/dist/node_modules/@allyhub-next/cloud/dist/voice.js +1 -1
  50. package/dist/node_modules/@allyhub-next/cloud/package.json +1 -1
  51. package/dist/node_modules/@allyhub-next/components/package.json +1 -1
  52. package/dist/node_modules/@allyhub-next/components/r/caption-subtitle.json +1 -1
  53. package/dist/node_modules/@allyhub-next/components/src/caption-subtitle.ts +54 -16
  54. package/dist/node_modules/@allyhub-next/dev-server/dist/background.js +1 -1
  55. package/dist/node_modules/@allyhub-next/dev-server/dist/fonts.js +2 -0
  56. package/dist/node_modules/@allyhub-next/dev-server/dist/index.js +1 -1
  57. package/dist/node_modules/@allyhub-next/dev-server/dist/live.js +1 -1
  58. package/dist/node_modules/@allyhub-next/dev-server/dist/project.js +1 -1
  59. package/dist/node_modules/@allyhub-next/dev-server/dist/reach.js +2 -0
  60. package/dist/node_modules/@allyhub-next/dev-server/dist/record.js +2 -0
  61. package/dist/node_modules/@allyhub-next/dev-server/dist/server.js +2 -2
  62. package/dist/node_modules/@allyhub-next/dev-server/dist/tools.js +1 -1
  63. package/dist/node_modules/@allyhub-next/dev-server/dist/tree.js +2 -0
  64. package/dist/node_modules/@allyhub-next/dev-server/package.json +1 -1
  65. package/dist/node_modules/@allyhub-next/doc/package.json +1 -1
  66. package/dist/node_modules/@allyhub-next/export/dist/deck-pptx.js +1 -1
  67. package/dist/node_modules/@allyhub-next/export/dist/export.js +5 -5
  68. package/dist/node_modules/@allyhub-next/export/dist/index.js +1 -1
  69. package/dist/node_modules/@allyhub-next/export/package.json +1 -1
  70. package/dist/node_modules/@allyhub-next/formats/dist/data/deck-code.d.ts +205 -0
  71. package/dist/node_modules/@allyhub-next/formats/dist/data/deck-code.js +2 -0
  72. package/dist/node_modules/@allyhub-next/formats/dist/data/script.d.ts +4 -1
  73. package/dist/node_modules/@allyhub-next/formats/dist/data/script.js +1 -1
  74. package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +69 -18
  75. package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.js +1 -1
  76. package/dist/node_modules/@allyhub-next/formats/dist/data/slides.d.ts +847 -116
  77. package/dist/node_modules/@allyhub-next/formats/dist/data/slides.js +1 -1
  78. package/dist/node_modules/@allyhub-next/formats/dist/data/website.d.ts +20 -0
  79. package/dist/node_modules/@allyhub-next/formats/dist/data/website.js +2 -0
  80. package/dist/node_modules/@allyhub-next/formats/dist/index.d.ts +3 -0
  81. package/dist/node_modules/@allyhub-next/formats/dist/index.js +1 -1
  82. package/dist/node_modules/@allyhub-next/formats/dist/items.d.ts +1 -1
  83. package/dist/node_modules/@allyhub-next/formats/dist/items.js +1 -1
  84. package/dist/node_modules/@allyhub-next/formats/dist/media-type.d.ts +3 -0
  85. package/dist/node_modules/@allyhub-next/formats/dist/media-type.js +2 -0
  86. package/dist/node_modules/@allyhub-next/formats/dist/schemas.d.ts +501 -38
  87. package/dist/node_modules/@allyhub-next/formats/dist/schemas.js +1 -1
  88. package/dist/node_modules/@allyhub-next/formats/dist/strict.d.ts +2 -0
  89. package/dist/node_modules/@allyhub-next/formats/dist/strict.js +1 -1
  90. package/dist/node_modules/@allyhub-next/formats/package.json +2 -1
  91. package/dist/node_modules/@allyhub-next/measure/package.json +1 -1
  92. package/dist/node_modules/@allyhub-next/media/dist/index.d.ts +1 -1
  93. package/dist/node_modules/@allyhub-next/media/dist/index.js +1 -1
  94. package/dist/node_modules/@allyhub-next/media/dist/sheet.d.ts +2 -0
  95. package/dist/node_modules/@allyhub-next/media/dist/sheet.js +7 -7
  96. package/dist/node_modules/@allyhub-next/media/package.json +1 -1
  97. package/dist/node_modules/@allyhub-next/model/package.json +1 -1
  98. package/dist/node_modules/@allyhub-next/ooxml/dist/brightness.d.ts +31 -0
  99. package/dist/node_modules/@allyhub-next/ooxml/dist/brightness.js +2 -0
  100. package/dist/node_modules/@allyhub-next/ooxml/dist/color.d.ts +33 -0
  101. package/dist/node_modules/@allyhub-next/ooxml/dist/color.js +2 -0
  102. package/dist/node_modules/@allyhub-next/ooxml/dist/enums.d.ts +13 -0
  103. package/dist/node_modules/@allyhub-next/ooxml/dist/enums.js +2 -0
  104. package/dist/node_modules/@allyhub-next/ooxml/dist/ext.d.ts +79 -0
  105. package/dist/node_modules/@allyhub-next/ooxml/dist/ext.js +2 -0
  106. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/enums.d.ts +132 -0
  107. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/enums.js +2 -0
  108. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/presets.d.ts +28 -0
  109. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/presets.js +2 -0
  110. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/spec.d.ts +4708 -0
  111. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/spec.js +2 -0
  112. package/dist/node_modules/@allyhub-next/ooxml/dist/geometry/index.d.ts +57 -0
  113. package/dist/node_modules/@allyhub-next/ooxml/dist/geometry/index.js +2 -0
  114. package/dist/node_modules/@allyhub-next/ooxml/dist/index.d.ts +10 -0
  115. package/dist/node_modules/@allyhub-next/ooxml/dist/index.js +2 -0
  116. package/dist/node_modules/@allyhub-next/ooxml/dist/mce.d.ts +12 -0
  117. package/dist/node_modules/@allyhub-next/ooxml/dist/mce.js +2 -0
  118. package/dist/node_modules/@allyhub-next/ooxml/dist/node.d.ts +111 -0
  119. package/dist/node_modules/@allyhub-next/ooxml/dist/node.js +2 -0
  120. package/dist/node_modules/@allyhub-next/ooxml/dist/ns.d.ts +45 -0
  121. package/dist/node_modules/@allyhub-next/ooxml/dist/ns.js +2 -0
  122. package/dist/node_modules/@allyhub-next/ooxml/dist/opc.d.ts +48 -0
  123. package/dist/node_modules/@allyhub-next/ooxml/dist/opc.js +2 -0
  124. package/dist/node_modules/@allyhub-next/ooxml/dist/report.d.ts +45 -0
  125. package/dist/node_modules/@allyhub-next/ooxml/dist/report.js +2 -0
  126. package/dist/node_modules/@allyhub-next/ooxml/dist/xml.d.ts +28 -0
  127. package/dist/node_modules/@allyhub-next/ooxml/dist/xml.js +2 -0
  128. package/dist/node_modules/@allyhub-next/ooxml/package.json +26 -0
  129. package/dist/node_modules/@allyhub-next/project/dist/deck-keys.js +2 -0
  130. package/dist/node_modules/@allyhub-next/project/dist/deck-measure.js +2 -0
  131. package/dist/node_modules/@allyhub-next/project/dist/deck-pool.js +2 -0
  132. package/dist/node_modules/@allyhub-next/project/dist/index.js +1 -1
  133. package/dist/node_modules/@allyhub-next/project/dist/session.js +1 -1
  134. package/dist/node_modules/@allyhub-next/project/dist/stills.js +2 -0
  135. package/dist/node_modules/@allyhub-next/project/package.json +1 -1
  136. package/dist/node_modules/@allyhub-next/protocol/dist/account.d.ts +338 -0
  137. package/dist/node_modules/@allyhub-next/protocol/dist/account.js +2 -0
  138. package/dist/node_modules/@allyhub-next/protocol/dist/auth.d.ts +12 -13
  139. package/dist/node_modules/@allyhub-next/protocol/dist/auth.js +1 -1
  140. package/dist/node_modules/@allyhub-next/protocol/dist/blobs.d.ts +35 -0
  141. package/dist/node_modules/@allyhub-next/protocol/dist/blobs.js +2 -0
  142. package/dist/node_modules/@allyhub-next/protocol/dist/cloud.d.ts +101 -32
  143. package/dist/node_modules/@allyhub-next/protocol/dist/cloud.js +1 -1
  144. package/dist/node_modules/@allyhub-next/protocol/dist/editor.d.ts +79 -5
  145. package/dist/node_modules/@allyhub-next/protocol/dist/editor.js +1 -1
  146. package/dist/node_modules/@allyhub-next/protocol/dist/files.d.ts +2 -2
  147. package/dist/node_modules/@allyhub-next/protocol/dist/index.d.ts +6 -0
  148. package/dist/node_modules/@allyhub-next/protocol/dist/index.js +1 -1
  149. package/dist/node_modules/@allyhub-next/protocol/dist/notes.d.ts +21 -0
  150. package/dist/node_modules/@allyhub-next/protocol/dist/notes.js +1 -1
  151. package/dist/node_modules/@allyhub-next/protocol/dist/open.d.ts +13 -0
  152. package/dist/node_modules/@allyhub-next/protocol/dist/open.js +2 -0
  153. package/dist/node_modules/@allyhub-next/protocol/dist/registry.d.ts +73 -59
  154. package/dist/node_modules/@allyhub-next/protocol/dist/registry.js +1 -1
  155. package/dist/node_modules/@allyhub-next/protocol/dist/routes.d.ts +1 -1
  156. package/dist/node_modules/@allyhub-next/protocol/dist/routes.js +1 -1
  157. package/dist/node_modules/@allyhub-next/protocol/dist/shares.d.ts +115 -0
  158. package/dist/node_modules/@allyhub-next/protocol/dist/shares.js +2 -0
  159. package/dist/node_modules/@allyhub-next/protocol/dist/sites.d.ts +293 -0
  160. package/dist/node_modules/@allyhub-next/protocol/dist/sites.js +2 -0
  161. package/dist/node_modules/@allyhub-next/protocol/dist/snapshots.d.ts +377 -0
  162. package/dist/node_modules/@allyhub-next/protocol/dist/snapshots.js +2 -0
  163. package/dist/node_modules/@allyhub-next/protocol/dist/teams.d.ts +27 -9
  164. package/dist/node_modules/@allyhub-next/protocol/dist/teams.js +1 -1
  165. package/dist/node_modules/@allyhub-next/protocol/dist/tools.d.ts +53 -14
  166. package/dist/node_modules/@allyhub-next/protocol/dist/tools.js +1 -1
  167. package/dist/node_modules/@allyhub-next/protocol/package.json +2 -1
  168. package/dist/node_modules/@allyhub-next/registry/package.json +1 -1
  169. package/dist/node_modules/@allyhub-next/render/dist/doc/fonts.js +3 -2
  170. package/dist/node_modules/@allyhub-next/render/dist/doc/index.js +1 -1
  171. package/dist/node_modules/@allyhub-next/render/dist/doc/pdf.js +34 -0
  172. package/dist/node_modules/@allyhub-next/render/dist/doc/print.js +4 -4
  173. package/dist/node_modules/@allyhub-next/render/dist/exports.js +2 -2
  174. package/dist/node_modules/@allyhub-next/render/dist/pdf.js +2 -0
  175. package/dist/node_modules/@allyhub-next/render/package.json +1 -1
  176. package/dist/node_modules/@allyhub-next/runtime/dist/fonts.js +1 -1
  177. package/dist/node_modules/@allyhub-next/runtime/dist/music.js +1 -1
  178. package/dist/node_modules/@allyhub-next/runtime/package.json +1 -1
  179. package/dist/node_modules/@allyhub-next/runtimes/package.json +1 -1
  180. package/dist/node_modules/@allyhub-next/runtimes/schemas/runtimes.schema.json +25 -5
  181. package/dist/node_modules/@allyhub-next/scaffold/dist/index.js +4 -4
  182. package/dist/node_modules/@allyhub-next/scaffold/package.json +1 -1
  183. package/dist/node_modules/@allyhub-next/scenery/package.json +1 -1
  184. package/dist/node_modules/@allyhub-next/scenery-host/dist/bundle.d.ts +10 -0
  185. package/dist/node_modules/@allyhub-next/scenery-host/dist/bundle.js +3 -3
  186. package/dist/node_modules/@allyhub-next/scenery-host/package.json +1 -1
  187. package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.d.ts +9 -3
  188. package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.js +1 -1
  189. package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.d.ts +5 -1
  190. package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.js +1 -1
  191. package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.d.ts +60 -13
  192. package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.js +1 -1
  193. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/aggregate.js +1 -1
  194. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/convert.d.ts +4 -0
  195. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/convert.js +2 -0
  196. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/criteria.js +1 -1
  197. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/database.js +1 -1
  198. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/date.js +1 -1
  199. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.d.ts +27 -1
  200. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.js +1 -1
  201. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/delimiters.d.ts +16 -0
  202. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/delimiters.js +2 -0
  203. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.d.ts +18 -1
  204. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.js +1 -1
  205. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/finance.js +1 -1
  206. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.d.ts +2 -0
  207. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.js +1 -1
  208. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/info.js +1 -1
  209. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/kernels.js +1 -1
  210. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/logical.js +1 -1
  211. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/lookup.js +1 -1
  212. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/maths.js +1 -1
  213. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/modern.d.ts +2 -0
  214. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/modern.js +2 -0
  215. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/text.js +1 -1
  216. package/dist/node_modules/@allyhub-next/sheet/dist/calc/graph.d.ts +38 -0
  217. package/dist/node_modules/@allyhub-next/sheet/dist/calc/graph.js +2 -0
  218. package/dist/node_modules/@allyhub-next/sheet/dist/calc/indexes.d.ts +19 -0
  219. package/dist/node_modules/@allyhub-next/sheet/dist/calc/indexes.js +2 -0
  220. package/dist/node_modules/@allyhub-next/sheet/dist/calc/remote.d.ts +49 -0
  221. package/dist/node_modules/@allyhub-next/sheet/dist/calc/remote.js +2 -0
  222. package/dist/node_modules/@allyhub-next/sheet/dist/calc/server.d.ts +82 -0
  223. package/dist/node_modules/@allyhub-next/sheet/dist/calc/server.js +2 -0
  224. package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.d.ts +6 -1
  225. package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.js +1 -1
  226. package/dist/node_modules/@allyhub-next/sheet/dist/chart.js +1 -1
  227. package/dist/node_modules/@allyhub-next/sheet/dist/check.js +1 -1
  228. package/dist/node_modules/@allyhub-next/sheet/dist/diff.d.ts +15 -0
  229. package/dist/node_modules/@allyhub-next/sheet/dist/diff.js +1 -1
  230. package/dist/node_modules/@allyhub-next/sheet/dist/export.d.ts +29 -8
  231. package/dist/node_modules/@allyhub-next/sheet/dist/export.js +3 -4
  232. package/dist/node_modules/@allyhub-next/sheet/dist/file.js +2 -2
  233. package/dist/node_modules/@allyhub-next/sheet/dist/format.d.ts +8 -2
  234. package/dist/node_modules/@allyhub-next/sheet/dist/format.js +1 -1
  235. package/dist/node_modules/@allyhub-next/sheet/dist/html.d.ts +52 -4
  236. package/dist/node_modules/@allyhub-next/sheet/dist/html.js +43 -11
  237. package/dist/node_modules/@allyhub-next/sheet/dist/index.d.ts +7 -3
  238. package/dist/node_modules/@allyhub-next/sheet/dist/index.js +1 -1
  239. package/dist/node_modules/@allyhub-next/sheet/dist/inspect.js +1 -1
  240. package/dist/node_modules/@allyhub-next/sheet/dist/paginate.d.ts +98 -0
  241. package/dist/node_modules/@allyhub-next/sheet/dist/paginate.js +2 -0
  242. package/dist/node_modules/@allyhub-next/sheet/dist/structure.js +1 -1
  243. package/dist/node_modules/@allyhub-next/sheet/dist/table-style.d.ts +32 -0
  244. package/dist/node_modules/@allyhub-next/sheet/dist/table-style.js +2 -0
  245. package/dist/node_modules/@allyhub-next/sheet/dist/table-styles.d.ts +3 -0
  246. package/dist/node_modules/@allyhub-next/sheet/dist/table-styles.js +2 -0
  247. package/dist/node_modules/@allyhub-next/sheet/dist/values.js +1 -1
  248. package/dist/node_modules/@allyhub-next/sheet/dist/workbook.d.ts +10 -1
  249. package/dist/node_modules/@allyhub-next/sheet/dist/workbook.js +1 -1
  250. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.d.ts +10 -1
  251. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.js +1 -1
  252. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.d.ts +14 -4
  253. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.js +2 -2
  254. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.d.ts +11 -1
  255. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.js +36 -16
  256. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.d.ts +3 -1
  257. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.js +1 -1
  258. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.d.ts +42 -1
  259. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.js +2 -1
  260. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/sax.d.ts +23 -0
  261. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/sax.js +2 -0
  262. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.d.ts +2 -0
  263. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.js +1 -1
  264. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.d.ts +6 -0
  265. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.js +1 -1
  266. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/zip.d.ts +40 -0
  267. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/zip.js +2 -0
  268. package/dist/node_modules/@allyhub-next/sheet/package.json +1 -1
  269. package/dist/node_modules/@allyhub-next/slides-core/dist/animation.js +1 -1
  270. package/dist/node_modules/@allyhub-next/slides-core/dist/api.d.ts +59 -39
  271. package/dist/node_modules/@allyhub-next/slides-core/dist/api.js +2 -2
  272. package/dist/node_modules/@allyhub-next/slides-core/dist/capabilities.js +1 -1
  273. package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.d.ts +27 -13
  274. package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.js +1 -1
  275. package/dist/node_modules/@allyhub-next/slides-core/dist/check.js +1 -1
  276. package/dist/node_modules/@allyhub-next/slides-core/dist/code.d.ts +33 -0
  277. package/dist/node_modules/@allyhub-next/slides-core/dist/code.js +2 -0
  278. package/dist/node_modules/@allyhub-next/slides-core/dist/components.d.ts +31 -0
  279. package/dist/node_modules/@allyhub-next/slides-core/dist/components.js +2 -0
  280. package/dist/node_modules/@allyhub-next/slides-core/dist/enums.d.ts +179 -16
  281. package/dist/node_modules/@allyhub-next/slides-core/dist/enums.js +1 -1
  282. package/dist/node_modules/@allyhub-next/slides-core/dist/file.d.ts +43 -21
  283. package/dist/node_modules/@allyhub-next/slides-core/dist/file.js +3 -3
  284. package/dist/node_modules/@allyhub-next/slides-core/dist/identity.d.ts +17 -0
  285. package/dist/node_modules/@allyhub-next/slides-core/dist/identity.js +2 -0
  286. package/dist/node_modules/@allyhub-next/slides-core/dist/index.d.ts +5 -1
  287. package/dist/node_modules/@allyhub-next/slides-core/dist/index.js +1 -1
  288. package/dist/node_modules/@allyhub-next/slides-core/dist/lang.d.ts +6 -0
  289. package/dist/node_modules/@allyhub-next/slides-core/dist/lang.js +2 -0
  290. package/dist/node_modules/@allyhub-next/slides-core/dist/measure.js +1 -1
  291. package/dist/node_modules/@allyhub-next/slides-core/dist/merge.d.ts +58 -0
  292. package/dist/node_modules/@allyhub-next/slides-core/dist/merge.js +2 -0
  293. package/dist/node_modules/@allyhub-next/slides-core/dist/model.d.ts +2 -4
  294. package/dist/node_modules/@allyhub-next/slides-core/dist/office.d.ts +17 -1
  295. package/dist/node_modules/@allyhub-next/slides-core/dist/office.js +1 -1
  296. package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.d.ts +21 -5
  297. package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.js +1 -1
  298. package/dist/node_modules/@allyhub-next/slides-core/dist/script.d.ts +18 -16
  299. package/dist/node_modules/@allyhub-next/slides-core/dist/script.js +2 -2
  300. package/dist/node_modules/@allyhub-next/slides-core/dist/stage.d.ts +51 -53
  301. package/dist/node_modules/@allyhub-next/slides-core/dist/strict.js +1 -1
  302. package/dist/node_modules/@allyhub-next/slides-core/dist/units.d.ts +27 -0
  303. package/dist/node_modules/@allyhub-next/slides-core/dist/units.js +1 -1
  304. package/dist/node_modules/@allyhub-next/slides-core/dist/values.d.ts +7 -0
  305. package/dist/node_modules/@allyhub-next/slides-core/dist/values.js +2 -0
  306. package/dist/node_modules/@allyhub-next/slides-core/package.json +1 -1
  307. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/code.js +4 -0
  308. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/index.js +3 -0
  309. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/names.js +2 -0
  310. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/script.js +2 -0
  311. package/dist/node_modules/@allyhub-next/slides-pptx/dist/index.js +1 -1
  312. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/chart.js +2 -0
  313. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/common.js +2 -0
  314. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/index.js +4 -0
  315. package/dist/{site.js → node_modules/@allyhub-next/slides-pptx/dist/read/model.js} +1 -1
  316. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/shapes.js +2 -0
  317. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/table.js +2 -0
  318. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/text.js +2 -0
  319. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/timing.js +2 -0
  320. package/dist/node_modules/@allyhub-next/slides-pptx/dist/shapes.js +1 -1
  321. package/dist/node_modules/@allyhub-next/slides-pptx/dist/text.js +1 -1
  322. package/dist/node_modules/@allyhub-next/slides-pptx/dist/theme.js +1 -1
  323. package/dist/node_modules/@allyhub-next/slides-pptx/dist/timing.js +1 -1
  324. package/dist/node_modules/@allyhub-next/slides-pptx/dist/write.js +2 -2
  325. package/dist/node_modules/@allyhub-next/slides-pptx/dist/xml.js +2 -2
  326. package/dist/node_modules/@allyhub-next/slides-pptx/package.json +1 -1
  327. package/dist/node_modules/@allyhub-next/slides-runtime/dist/component.js +2 -0
  328. package/dist/node_modules/@allyhub-next/slides-runtime/dist/draw.js +2 -2
  329. package/dist/node_modules/@allyhub-next/slides-runtime/dist/index.js +1 -1
  330. package/dist/node_modules/@allyhub-next/slides-runtime/dist/load.js +5 -5
  331. package/dist/node_modules/@allyhub-next/slides-runtime/package.json +5 -1
  332. package/dist/node_modules/@allyhub-next/stage/dist/index.js +1 -1
  333. package/dist/node_modules/@allyhub-next/stage/dist/page.js +22 -12
  334. package/dist/node_modules/@allyhub-next/stage/dist/scenery-page.js +5 -5
  335. package/dist/node_modules/@allyhub-next/stage/dist/server.js +1 -1
  336. package/dist/node_modules/@allyhub-next/stage/package.json +1 -1
  337. package/dist/node_modules/@allyhub-next/stage-page/dist/host.js +1 -20
  338. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/probe.html +8 -0
  339. package/dist/{astro.js → node_modules/@allyhub-next/stage-page/dist/runtime/probe.js} +1 -1
  340. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/runtime.js +79 -0
  341. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/stage.html +21 -0
  342. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/stage.js +3 -0
  343. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/viewer.html +9 -0
  344. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/viewer.js +3 -0
  345. package/dist/node_modules/@allyhub-next/stage-page/package.json +2 -3
  346. package/dist/node_modules/@allyhub-next/video-core/dist/captions.js +6 -6
  347. package/dist/node_modules/@allyhub-next/video-core/dist/fact.d.ts +47 -8
  348. package/dist/node_modules/@allyhub-next/video-core/dist/fact.js +1 -1
  349. package/dist/node_modules/@allyhub-next/video-core/dist/index.d.ts +1 -0
  350. package/dist/node_modules/@allyhub-next/video-core/dist/index.js +1 -1
  351. package/dist/node_modules/@allyhub-next/video-core/dist/marks.d.ts +14 -0
  352. package/dist/node_modules/@allyhub-next/video-core/dist/marks.js +1 -1
  353. package/dist/node_modules/@allyhub-next/video-core/dist/music.d.ts +2 -1
  354. package/dist/node_modules/@allyhub-next/video-core/dist/piece.d.ts +11 -2
  355. package/dist/node_modules/@allyhub-next/video-core/dist/problem.d.ts +4 -0
  356. package/dist/node_modules/@allyhub-next/video-core/dist/problem.js +1 -1
  357. package/dist/node_modules/@allyhub-next/video-core/dist/schema.d.ts +2 -2
  358. package/dist/node_modules/@allyhub-next/video-core/dist/schema.js +1 -1
  359. package/dist/node_modules/@allyhub-next/video-core/dist/script.d.ts +2 -1
  360. package/dist/node_modules/@allyhub-next/video-core/dist/script.js +1 -1
  361. package/dist/node_modules/@allyhub-next/video-core/dist/source.d.ts +7 -0
  362. package/dist/node_modules/@allyhub-next/video-core/dist/source.js +2 -0
  363. package/dist/node_modules/@allyhub-next/video-core/dist/timeline.d.ts +10 -33
  364. package/dist/node_modules/@allyhub-next/video-core/package.json +1 -1
  365. package/dist/node_modules/@allyhub-next/website/LICENSE +241 -0
  366. package/dist/node_modules/@allyhub-next/website/dist/index.js +2 -0
  367. package/dist/node_modules/@allyhub-next/website/dist/publish.js +3 -0
  368. package/dist/node_modules/@allyhub-next/website/dist/rules.js +2 -0
  369. package/dist/node_modules/@allyhub-next/website/dist/website.js +4 -0
  370. package/dist/node_modules/@allyhub-next/website/package.json +13 -0
  371. package/dist/text/facts-text.js +4 -4
  372. package/dist/works.js +1 -1
  373. package/editor-web/assets/calc-worker-Bz9r26p1.js +158 -0
  374. package/editor-web/assets/dist-0emakyZE.js +36 -0
  375. package/editor-web/assets/dist-B3UoDUa5.js +37 -0
  376. package/editor-web/assets/dist-B6KzR3pN.js +10 -0
  377. package/editor-web/assets/dist-Bc5iA5k1.js +1 -0
  378. package/editor-web/assets/dist-CTQIm8Im.js +10 -0
  379. package/editor-web/assets/dist-CiHNHwyq.js +2 -0
  380. package/editor-web/assets/dist-DNZ8PQ-E.js +224 -0
  381. package/editor-web/assets/index-CFt3ovRY.js +69 -0
  382. package/editor-web/assets/index-ujKjdu_s.css +2 -0
  383. package/editor-web/assets/minus-BhoPZC5P.js +1 -0
  384. package/editor-web/assets/react-C_-rEEBU.js +101 -0
  385. package/editor-web/assets/tabs-Den4gHrU.js +105 -0
  386. package/editor-web/assets/text-align-start-CsW4nqqL.js +1 -0
  387. package/editor-web/index.html +5 -5
  388. package/package.json +8 -14
  389. package/dist/astro.d.ts +0 -2
  390. package/dist/node_modules/@allyhub-next/audio/dist/at-cut.d.ts +0 -52
  391. package/dist/node_modules/@allyhub-next/audio/dist/decode.d.ts +0 -33
  392. package/dist/node_modules/@allyhub-next/audio/dist/envelope.d.ts +0 -37
  393. package/dist/node_modules/@allyhub-next/audio/dist/index.d.ts +0 -17
  394. package/dist/node_modules/@allyhub-next/audio/dist/levels.d.ts +0 -97
  395. package/dist/node_modules/@allyhub-next/audio/dist/master.d.ts +0 -29
  396. package/dist/node_modules/@allyhub-next/audio/dist/music.d.ts +0 -11
  397. package/dist/node_modules/@allyhub-next/audio/dist/node/decode.d.ts +0 -39
  398. package/dist/node_modules/@allyhub-next/audio/dist/node/ebur128.d.ts +0 -25
  399. package/dist/node_modules/@allyhub-next/audio/dist/node/ffmpeg.d.ts +0 -31
  400. package/dist/node_modules/@allyhub-next/audio/dist/node/index.d.ts +0 -8
  401. package/dist/node_modules/@allyhub-next/audio/dist/node/loudness.d.ts +0 -18
  402. package/dist/node_modules/@allyhub-next/audio/dist/node/master.d.ts +0 -42
  403. package/dist/node_modules/@allyhub-next/audio/dist/node/measure.d.ts +0 -60
  404. package/dist/node_modules/@allyhub-next/audio/dist/node/mix.d.ts +0 -31
  405. package/dist/node_modules/@allyhub-next/audio/dist/plan.d.ts +0 -143
  406. package/dist/node_modules/@allyhub-next/audio/dist/recorded.d.ts +0 -26
  407. package/dist/node_modules/@allyhub-next/audio/dist/recording/bandwidth.d.ts +0 -47
  408. package/dist/node_modules/@allyhub-next/audio/dist/recording/chain.d.ts +0 -89
  409. package/dist/node_modules/@allyhub-next/audio/dist/recording/dynamics.d.ts +0 -64
  410. package/dist/node_modules/@allyhub-next/audio/dist/recording/fft.d.ts +0 -26
  411. package/dist/node_modules/@allyhub-next/audio/dist/recording/filters.d.ts +0 -42
  412. package/dist/node_modules/@allyhub-next/audio/dist/recording/fit.d.ts +0 -56
  413. package/dist/node_modules/@allyhub-next/audio/dist/recording/index.d.ts +0 -10
  414. package/dist/node_modules/@allyhub-next/audio/dist/recording/loudness.d.ts +0 -12
  415. package/dist/node_modules/@allyhub-next/audio/dist/recording/measure.d.ts +0 -67
  416. package/dist/node_modules/@allyhub-next/audio/dist/recording/mic.d.ts +0 -32
  417. package/dist/node_modules/@allyhub-next/audio/dist/recording/noise.d.ts +0 -27
  418. package/dist/node_modules/@allyhub-next/audio/dist/recording/presets.d.ts +0 -64
  419. package/dist/node_modules/@allyhub-next/audio/dist/recording/room.d.ts +0 -78
  420. package/dist/node_modules/@allyhub-next/audio/dist/recording/setup.d.ts +0 -111
  421. package/dist/node_modules/@allyhub-next/audio/dist/recording/vec.d.ts +0 -3
  422. package/dist/node_modules/@allyhub-next/audio/dist/render.d.ts +0 -26
  423. package/dist/node_modules/@allyhub-next/audio/dist/sfx.d.ts +0 -10
  424. package/dist/node_modules/@allyhub-next/audio/dist/shape.d.ts +0 -118
  425. package/dist/node_modules/@allyhub-next/audio/dist/voice.d.ts +0 -45
  426. package/dist/node_modules/@allyhub-next/browser/dist/browser.d.ts +0 -24
  427. package/dist/node_modules/@allyhub-next/browser/dist/capture.d.ts +0 -61
  428. package/dist/node_modules/@allyhub-next/browser/dist/cdp.d.ts +0 -51
  429. package/dist/node_modules/@allyhub-next/browser/dist/flags.d.ts +0 -13
  430. package/dist/node_modules/@allyhub-next/browser/dist/frames.d.ts +0 -35
  431. package/dist/node_modules/@allyhub-next/browser/dist/html.d.ts +0 -19
  432. package/dist/node_modules/@allyhub-next/browser/dist/index.d.ts +0 -10
  433. package/dist/node_modules/@allyhub-next/browser/dist/launch.d.ts +0 -35
  434. package/dist/node_modules/@allyhub-next/browser/dist/page.d.ts +0 -67
  435. package/dist/node_modules/@allyhub-next/browser/dist/server.d.ts +0 -26
  436. package/dist/node_modules/@allyhub-next/check/dist/cache.d.ts +0 -46
  437. package/dist/node_modules/@allyhub-next/check/dist/check.d.ts +0 -142
  438. package/dist/node_modules/@allyhub-next/check/dist/generated.d.ts +0 -22
  439. package/dist/node_modules/@allyhub-next/check/dist/index.d.ts +0 -7
  440. package/dist/node_modules/@allyhub-next/check/dist/plans.d.ts +0 -111
  441. package/dist/node_modules/@allyhub-next/check/dist/result.d.ts +0 -12
  442. package/dist/node_modules/@allyhub-next/check/dist/scenery.d.ts +0 -23
  443. package/dist/node_modules/@allyhub-next/dev-server/dist/background.d.ts +0 -50
  444. package/dist/node_modules/@allyhub-next/dev-server/dist/card.d.ts +0 -17
  445. package/dist/node_modules/@allyhub-next/dev-server/dist/exports.d.ts +0 -18
  446. package/dist/node_modules/@allyhub-next/dev-server/dist/index.d.ts +0 -11
  447. package/dist/node_modules/@allyhub-next/dev-server/dist/live.d.ts +0 -77
  448. package/dist/node_modules/@allyhub-next/dev-server/dist/mime.d.ts +0 -2
  449. package/dist/node_modules/@allyhub-next/dev-server/dist/mime.js +0 -2
  450. package/dist/node_modules/@allyhub-next/dev-server/dist/paths.d.ts +0 -27
  451. package/dist/node_modules/@allyhub-next/dev-server/dist/project.d.ts +0 -153
  452. package/dist/node_modules/@allyhub-next/dev-server/dist/reveal.d.ts +0 -6
  453. package/dist/node_modules/@allyhub-next/dev-server/dist/server.d.ts +0 -47
  454. package/dist/node_modules/@allyhub-next/dev-server/dist/sound.d.ts +0 -21
  455. package/dist/node_modules/@allyhub-next/dev-server/dist/stage.d.ts +0 -82
  456. package/dist/node_modules/@allyhub-next/dev-server/dist/stage.js +0 -121
  457. package/dist/node_modules/@allyhub-next/dev-server/dist/tools.d.ts +0 -24
  458. package/dist/node_modules/@allyhub-next/dev-server/dist/validate.d.ts +0 -6
  459. package/dist/node_modules/@allyhub-next/dev-server/dist/watcher.d.ts +0 -47
  460. package/dist/node_modules/@allyhub-next/dev-server/dist/writer.d.ts +0 -51
  461. package/dist/node_modules/@allyhub-next/export/dist/batch.d.ts +0 -70
  462. package/dist/node_modules/@allyhub-next/export/dist/deck-fonts.d.ts +0 -24
  463. package/dist/node_modules/@allyhub-next/export/dist/deck-pptx.d.ts +0 -12
  464. package/dist/node_modules/@allyhub-next/export/dist/export.d.ts +0 -123
  465. package/dist/node_modules/@allyhub-next/export/dist/index.d.ts +0 -5
  466. package/dist/node_modules/@allyhub-next/export/dist/names.d.ts +0 -36
  467. package/dist/node_modules/@allyhub-next/measure/dist/compare.d.ts +0 -195
  468. package/dist/node_modules/@allyhub-next/measure/dist/contrast.d.ts +0 -14
  469. package/dist/node_modules/@allyhub-next/measure/dist/cut-sheet.d.ts +0 -90
  470. package/dist/node_modules/@allyhub-next/measure/dist/cuts.d.ts +0 -108
  471. package/dist/node_modules/@allyhub-next/measure/dist/facts.d.ts +0 -60
  472. package/dist/node_modules/@allyhub-next/measure/dist/fidelity.d.ts +0 -40
  473. package/dist/node_modules/@allyhub-next/measure/dist/flat.d.ts +0 -42
  474. package/dist/node_modules/@allyhub-next/measure/dist/index.d.ts +0 -24
  475. package/dist/node_modules/@allyhub-next/measure/dist/loop.d.ts +0 -22
  476. package/dist/node_modules/@allyhub-next/measure/dist/overlay.d.ts +0 -57
  477. package/dist/node_modules/@allyhub-next/measure/dist/recording-report.d.ts +0 -66
  478. package/dist/node_modules/@allyhub-next/measure/dist/reference/compare.d.ts +0 -118
  479. package/dist/node_modules/@allyhub-next/measure/dist/reference/folder.d.ts +0 -75
  480. package/dist/node_modules/@allyhub-next/measure/dist/reference/interpret.d.ts +0 -39
  481. package/dist/node_modules/@allyhub-next/measure/dist/reference/piece.d.ts +0 -53
  482. package/dist/node_modules/@allyhub-next/measure/dist/reference/sections.d.ts +0 -53
  483. package/dist/node_modules/@allyhub-next/measure/dist/reference/sets.d.ts +0 -84
  484. package/dist/node_modules/@allyhub-next/measure/dist/reference/text.d.ts +0 -27
  485. package/dist/node_modules/@allyhub-next/measure/dist/reference/video.d.ts +0 -55
  486. package/dist/node_modules/@allyhub-next/measure/dist/seams.d.ts +0 -46
  487. package/dist/node_modules/@allyhub-next/measure/dist/sound-measures.d.ts +0 -74
  488. package/dist/node_modules/@allyhub-next/measure/dist/sound-report.d.ts +0 -156
  489. package/dist/node_modules/@allyhub-next/measure/dist/still.d.ts +0 -58
  490. package/dist/node_modules/@allyhub-next/measure/dist/version-voice.d.ts +0 -12
  491. package/dist/node_modules/@allyhub-next/project/dist/console.d.ts +0 -34
  492. package/dist/node_modules/@allyhub-next/project/dist/digest.d.ts +0 -9
  493. package/dist/node_modules/@allyhub-next/project/dist/index.d.ts +0 -11
  494. package/dist/node_modules/@allyhub-next/project/dist/ledger.d.ts +0 -17
  495. package/dist/node_modules/@allyhub-next/project/dist/media-index.d.ts +0 -27
  496. package/dist/node_modules/@allyhub-next/project/dist/page.d.ts +0 -119
  497. package/dist/node_modules/@allyhub-next/project/dist/says.d.ts +0 -15
  498. package/dist/node_modules/@allyhub-next/project/dist/scenery.d.ts +0 -35
  499. package/dist/node_modules/@allyhub-next/project/dist/session.d.ts +0 -37
  500. package/dist/node_modules/@allyhub-next/project/dist/stretch.d.ts +0 -38
  501. package/dist/node_modules/@allyhub-next/project/dist/version.d.ts +0 -114
  502. package/dist/node_modules/@allyhub-next/render/dist/cap.d.ts +0 -41
  503. package/dist/node_modules/@allyhub-next/render/dist/capture.d.ts +0 -78
  504. package/dist/node_modules/@allyhub-next/render/dist/clip.d.ts +0 -27
  505. package/dist/node_modules/@allyhub-next/render/dist/composite.d.ts +0 -106
  506. package/dist/node_modules/@allyhub-next/render/dist/delivery.d.ts +0 -18
  507. package/dist/node_modules/@allyhub-next/render/dist/doc/fonts.d.ts +0 -3
  508. package/dist/node_modules/@allyhub-next/render/dist/doc/index.d.ts +0 -3
  509. package/dist/node_modules/@allyhub-next/render/dist/doc/print.d.ts +0 -51
  510. package/dist/node_modules/@allyhub-next/render/dist/encode.d.ts +0 -111
  511. package/dist/node_modules/@allyhub-next/render/dist/errors.d.ts +0 -15
  512. package/dist/node_modules/@allyhub-next/render/dist/exports.d.ts +0 -67
  513. package/dist/node_modules/@allyhub-next/render/dist/ffmpeg.d.ts +0 -75
  514. package/dist/node_modules/@allyhub-next/render/dist/footage.d.ts +0 -169
  515. package/dist/node_modules/@allyhub-next/render/dist/image.d.ts +0 -16
  516. package/dist/node_modules/@allyhub-next/render/dist/index.d.ts +0 -26
  517. package/dist/node_modules/@allyhub-next/render/dist/junction.d.ts +0 -70
  518. package/dist/node_modules/@allyhub-next/render/dist/look.d.ts +0 -21
  519. package/dist/node_modules/@allyhub-next/render/dist/page.d.ts +0 -178
  520. package/dist/node_modules/@allyhub-next/render/dist/parts.d.ts +0 -140
  521. package/dist/node_modules/@allyhub-next/render/dist/png.d.ts +0 -37
  522. package/dist/node_modules/@allyhub-next/render/dist/pool.d.ts +0 -54
  523. package/dist/node_modules/@allyhub-next/render/dist/post-probe.d.ts +0 -27
  524. package/dist/node_modules/@allyhub-next/render/dist/post.d.ts +0 -27
  525. package/dist/node_modules/@allyhub-next/render/dist/render.d.ts +0 -151
  526. package/dist/node_modules/@allyhub-next/render/dist/segments.d.ts +0 -40
  527. package/dist/node_modules/@allyhub-next/render/dist/sound.d.ts +0 -24
  528. package/dist/node_modules/@allyhub-next/render/dist/stills.d.ts +0 -41
  529. package/dist/node_modules/@allyhub-next/render/dist/tools.d.ts +0 -25
  530. package/dist/node_modules/@allyhub-next/render/dist/webp.d.ts +0 -17
  531. package/dist/node_modules/@allyhub-next/runtime/dist/bridge.d.ts +0 -211
  532. package/dist/node_modules/@allyhub-next/runtime/dist/captions.d.ts +0 -24
  533. package/dist/node_modules/@allyhub-next/runtime/dist/clock.d.ts +0 -32
  534. package/dist/node_modules/@allyhub-next/runtime/dist/compose.d.ts +0 -149
  535. package/dist/node_modules/@allyhub-next/runtime/dist/console.d.ts +0 -21
  536. package/dist/node_modules/@allyhub-next/runtime/dist/contrast.d.ts +0 -13
  537. package/dist/node_modules/@allyhub-next/runtime/dist/embed.d.ts +0 -50
  538. package/dist/node_modules/@allyhub-next/runtime/dist/env.d.ts +0 -101
  539. package/dist/node_modules/@allyhub-next/runtime/dist/errors.d.ts +0 -21
  540. package/dist/node_modules/@allyhub-next/runtime/dist/facade.d.ts +0 -42
  541. package/dist/node_modules/@allyhub-next/runtime/dist/fonts.d.ts +0 -110
  542. package/dist/node_modules/@allyhub-next/runtime/dist/footage.d.ts +0 -52
  543. package/dist/node_modules/@allyhub-next/runtime/dist/frame.d.ts +0 -61
  544. package/dist/node_modules/@allyhub-next/runtime/dist/guards.d.ts +0 -32
  545. package/dist/node_modules/@allyhub-next/runtime/dist/index.d.ts +0 -14
  546. package/dist/node_modules/@allyhub-next/runtime/dist/inspect.d.ts +0 -112
  547. package/dist/node_modules/@allyhub-next/runtime/dist/locate.d.ts +0 -11
  548. package/dist/node_modules/@allyhub-next/runtime/dist/measure.d.ts +0 -41
  549. package/dist/node_modules/@allyhub-next/runtime/dist/mix-plan.d.ts +0 -42
  550. package/dist/node_modules/@allyhub-next/runtime/dist/music.d.ts +0 -29
  551. package/dist/node_modules/@allyhub-next/runtime/dist/output.d.ts +0 -5
  552. package/dist/node_modules/@allyhub-next/runtime/dist/pictures.d.ts +0 -39
  553. package/dist/node_modules/@allyhub-next/runtime/dist/piece.d.ts +0 -34
  554. package/dist/node_modules/@allyhub-next/runtime/dist/player/clips.d.ts +0 -41
  555. package/dist/node_modules/@allyhub-next/runtime/dist/player/cutout.d.ts +0 -57
  556. package/dist/node_modules/@allyhub-next/runtime/dist/player/player.d.ts +0 -78
  557. package/dist/node_modules/@allyhub-next/runtime/dist/reads.d.ts +0 -132
  558. package/dist/node_modules/@allyhub-next/runtime/dist/sound.d.ts +0 -22
  559. package/dist/node_modules/@allyhub-next/runtime/dist/speech.d.ts +0 -107
  560. package/dist/node_modules/@allyhub-next/runtime/dist/stage-kit.d.ts +0 -12
  561. package/dist/node_modules/@allyhub-next/runtime/dist/stage.d.ts +0 -34
  562. package/dist/node_modules/@allyhub-next/runtime/dist/styles.d.ts +0 -35
  563. package/dist/node_modules/@allyhub-next/runtime/dist/takes.d.ts +0 -72
  564. package/dist/node_modules/@allyhub-next/runtime/dist/titles.d.ts +0 -10
  565. package/dist/node_modules/@allyhub-next/runtime/dist/transitions.d.ts +0 -26
  566. package/dist/node_modules/@allyhub-next/site/dist/assets.d.ts +0 -59
  567. package/dist/node_modules/@allyhub-next/site/dist/assets.js +0 -2
  568. package/dist/node_modules/@allyhub-next/site/dist/astro.d.ts +0 -22
  569. package/dist/node_modules/@allyhub-next/site/dist/astro.js +0 -3
  570. package/dist/node_modules/@allyhub-next/site/dist/lockfile.d.ts +0 -40
  571. package/dist/node_modules/@allyhub-next/site/dist/lockfile.js +0 -3
  572. package/dist/node_modules/@allyhub-next/site/dist/media.d.ts +0 -24
  573. package/dist/node_modules/@allyhub-next/site/dist/media.js +0 -4
  574. package/dist/node_modules/@allyhub-next/site/package.json +0 -25
  575. package/dist/node_modules/@allyhub-next/slides-core/dist/preset.d.ts +0 -5
  576. package/dist/node_modules/@allyhub-next/slides-core/dist/preset.js +0 -2
  577. package/dist/node_modules/@allyhub-next/slides-pptx/dist/charts.d.ts +0 -6
  578. package/dist/node_modules/@allyhub-next/slides-pptx/dist/fonts.d.ts +0 -45
  579. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import.d.ts +0 -18
  580. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import.js +0 -3
  581. package/dist/node_modules/@allyhub-next/slides-pptx/dist/index.d.ts +0 -5
  582. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read.d.ts +0 -56
  583. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read.js +0 -4
  584. package/dist/node_modules/@allyhub-next/slides-pptx/dist/shapes.d.ts +0 -72
  585. package/dist/node_modules/@allyhub-next/slides-pptx/dist/text.d.ts +0 -32
  586. package/dist/node_modules/@allyhub-next/slides-pptx/dist/theme.d.ts +0 -4
  587. package/dist/node_modules/@allyhub-next/slides-pptx/dist/timing.d.ts +0 -32
  588. package/dist/node_modules/@allyhub-next/slides-pptx/dist/write.d.ts +0 -32
  589. package/dist/node_modules/@allyhub-next/slides-pptx/dist/xml.d.ts +0 -32
  590. package/dist/node_modules/@allyhub-next/slides-runtime/dist/draw.d.ts +0 -43
  591. package/dist/node_modules/@allyhub-next/slides-runtime/dist/edit.d.ts +0 -4
  592. package/dist/node_modules/@allyhub-next/slides-runtime/dist/edit.js +0 -2
  593. package/dist/node_modules/@allyhub-next/slides-runtime/dist/index.d.ts +0 -4
  594. package/dist/node_modules/@allyhub-next/slides-runtime/dist/ink.d.ts +0 -10
  595. package/dist/node_modules/@allyhub-next/slides-runtime/dist/load.d.ts +0 -6
  596. package/dist/node_modules/@allyhub-next/stage/dist/bakes.d.ts +0 -42
  597. package/dist/node_modules/@allyhub-next/stage/dist/graphics.d.ts +0 -7
  598. package/dist/node_modules/@allyhub-next/stage/dist/identity.d.ts +0 -2
  599. package/dist/node_modules/@allyhub-next/stage/dist/index.d.ts +0 -9
  600. package/dist/node_modules/@allyhub-next/stage/dist/page.d.ts +0 -87
  601. package/dist/node_modules/@allyhub-next/stage/dist/scenery-page.d.ts +0 -69
  602. package/dist/node_modules/@allyhub-next/stage/dist/scenery-solve.d.ts +0 -49
  603. package/dist/node_modules/@allyhub-next/stage/dist/scenery.d.ts +0 -8
  604. package/dist/node_modules/@allyhub-next/stage/dist/server.d.ts +0 -21
  605. package/dist/node_modules/@allyhub-next/stage-page/dist/host.d.ts +0 -22
  606. package/dist/node_modules/@allyhub-next/stage-page/dist/page.js +0 -79
  607. package/dist/site.d.ts +0 -2
  608. package/editor-web/assets/dist-BW2s9FMO.js +0 -4
  609. package/editor-web/assets/dist-C-6JmebI.js +0 -233
  610. package/editor-web/assets/dist-CCYMLMKN.js +0 -6
  611. package/editor-web/assets/dist-CHzurjMx.js +0 -33
  612. package/editor-web/assets/dist-DF7H1dxw.js +0 -1
  613. package/editor-web/assets/dist-Da5AUSKX.js +0 -2
  614. package/editor-web/assets/index-B7S9RZhL.css +0 -2
  615. package/editor-web/assets/index-CovQYWvD.js +0 -69
  616. package/editor-web/assets/minus-BrvjaJyO.js +0 -1
  617. package/editor-web/assets/react-DV5fPdiH.js +0 -101
  618. package/editor-web/assets/textarea-B0vCGdZI.js +0 -105
  619. package/editor-web/assets/trash-2-B0dvc1cZ.js +0 -1
  620. package/editor-web/assets/undo-2-A1EPubPO.js +0 -1
  621. /package/dist/node_modules/@allyhub-next/{site → ooxml}/LICENSE +0 -0
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{createHash as ve}from"node:crypto";import{zipSync as Me}from"fflate";import{AUTOSHAPE_STYLE as Pe,CONNECTOR_STYLE as $e,joinPath as le,placeholderFrame as Le,plainLevels as Te,Pt as De}from"@allyhub-next/slides-core";import{chartBook as Ee,chartXml as Ce}from"./charts.js";import{asFace as Ie,fontInfo as Oe,eotOf as Re}from"./fonts.js";import{NO_PARAGRAPHS as Be,shapeXml as de,treeXml as ee}from"./shapes.js";import{bodyOfStyle as Ne,bodyProps as q,LINK as Ae,SLIDE_NUMBER as je,levelOf as pe,listStyle as B,txBody as j}from"./text.js";import{themeXml as me}from"./theme.js";import{timingXml as Fe,transitionXml as He}from"./timing.js";import{HEAD as w,PML as T,el as n,esc as ze,fill as ce,unesc as Ge}from"./xml.js";const te={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif"},fe={mp4:"video/mp4",m4v:"video/mp4",mov:"video/quicktime"},N=e=>(e.split(".").pop()??"").toLowerCase(),Ue=[["regular","p:regular","Regular"],["bold","p:bold","Bold"],["italic","p:italic","Italic"],["boldItalic","p:boldItalic","Bold Italic"]],l={hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",chart:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",package:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package",font:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/font",officeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",core:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",app:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",slideMaster:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster",slideLayout:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout",slide:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide",theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",notesMaster:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster",notesSlide:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide",image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",video:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video",media:"http://schemas.microsoft.com/office/2007/relationships/media",presProps:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps",viewProps:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps",tableStyles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles"},b={chart:"application/vnd.openxmlformats-officedocument.drawingml.chart+xml",workbook:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",presentation:"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml",slideMaster:"application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml",slideLayout:"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml",slide:"application/vnd.openxmlformats-officedocument.presentationml.slide+xml",theme:"application/vnd.openxmlformats-officedocument.theme+xml",notesMaster:"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml",notesSlide:"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml",presProps:"application/vnd.openxmlformats-officedocument.presentationml.presProps+xml",viewProps:"application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml",tableStyles:"application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml",core:"application/vnd.openxmlformats-package.core-properties+xml",app:"application/vnd.openxmlformats-officedocument.extended-properties+xml"};class D{list=[];linked(t){return t.replaceAll(new RegExp(`r:id="${Ae}([^"]*)"`,"gu"),(i,o)=>`r:id="${this.add(l.hyperlink,Ge(o),!0)}"`)}add(t,i,o=!1){const r=this.list.find(s=>s.type===t&&s.target===i);if(r)return r.id;const d=`rId${String(this.list.length+1)}`;return this.list.push({id:d,type:t,target:i,...o?{external:o}:{}}),d}xml(){return w+n("Relationships",{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},...this.list.map(t=>n("Relationship",{Id:t.id,Type:t.type,Target:t.target,TargetMode:t.external?"External":void 0})))}}class Xe{list=[];add(t,i){return this.list.push({chart:t,frame:i}),`../charts/chart${String(this.list.length)}.xml`}}class We{parts=new Map;byHash=new Map;add(t,i,o){const r=ve("sha256").update(t).digest("hex"),d=this.byHash.get(`${o}:${r}`);if(d)return d;const s=`${o}${String(this.parts.size+1)}.${i}`;return this.parts.set(`ppt/media/${s}`,t),this.byHash.set(`${o}:${r}`,`../media/${s}`),`../media/${s}`}}function he(e){return e.kind==="component"||e.kind==="movie"?!1:e.kind==="picture"?te[N(e.media?.path??"")]!==void 0:!0}function ne(e){return e.kind==="component"||e.kind==="movie"?!0:e.kind==="picture"?te[N(e.media?.path??"")]===void 0:!1}export function picturedShapes(e){return e.slides.flatMap(t=>t.shapes.filter(i=>ne(i)).map(i=>({key:`${t.id}/${i.name}`,slide:t.id,shape:i.name,frame:i.frame})))}export function filesOf(e){const t=new Set;for(const i of e.masters)for(const o of[...i.shapes,...i.layouts.flatMap(r=>r.shapes)])o.media&&he(o)&&t.add(le(o.media.base,o.media.path));for(const i of e.slides)for(const o of i.shapes)o.media&&(o.kind==="picture"||o.kind==="movie")&&t.add(o.media.path);return[...t].sort()}const Je=n("p:nvGrpSpPr",{},n("p:cNvPr",{id:1,name:""}),n("p:cNvGrpSpPr"),n("p:nvPr")),Ye=n("p:grpSpPr",{},n("a:xfrm",{},n("a:off",{x:0,y:0}),n("a:ext",{cx:0,cy:0}),n("a:chOff",{x:0,y:0}),n("a:chExt",{cx:0,cy:0}))),X=e=>n("p:spTree",{},Je,Ye,...e),ue={bg1:"lt1",tx1:"dk1",bg2:"lt2",tx2:"dk2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hlink:"hlink",folHlink:"folHlink"},oe=e=>n("p:bg",{},n("p:bgPr",{},n("a:solidFill",{},qe(e)),n("a:effectLst"))),qe=e=>typeof e=="string"?n("a:schemeClr",{val:e}):n("a:srgbClr",{val:e.rgb.replace("#","").toUpperCase()}),xe=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function ge(e){return{...e.fill_transparency===void 0?{}:{fillTransparency:e.fill_transparency,...e.fill===void 0?{}:{fill:e.fill}},...e.gradient?{gradient:e.gradient}:{},...e.shadow?{shadow:e.shadow}:{}}}function Z(e){const t=i=>({...e.fill===void 0||"fill"in i&&xe(e.fill,i.fill)?{}:{fill:e.fill},...e.line===void 0||xe(e.line,i.line)?{}:{line:e.line},...e.line_width===void 0||e.line_width===i.line_width?{}:{lineWidth:e.line_width}});return e.kind==="autoshape"?e.geometry==="line"?{style:"connector",...t($e)}:{style:"shape",...t(Pe)}:{...e.kind==="textbox"?{fill:e.fill??null}:e.fill===void 0?{}:{fill:e.fill},...e.line===void 0?{}:{line:e.line},...e.line_width===void 0?{}:{lineWidth:e.line_width}}}const Ze=(e,t)=>Array.from({length:Math.max(e.length,t.length)},(i,o)=>{const r=e[o]??{},d=t[o]??{},s={...r.font,...d.font};return{...r,...d,...Object.keys(s).length>0?{font:s}:{}}});function ye(e,t,i,o,r,d,s,m){const g=o!==void 0&&r!==void 0&&JSON.stringify(o.text_styles.other)!==JSON.stringify(r.text_styles.other);return j("p:txBody",q(t,s,e==="autoshape"?{rtlCol:0}:{}),B(g?Ze(o.text_styles.other,t.levels):t.levels),i,d,m)}const Ke="{2D5ABB26-0587-4C30-8999-92F81FD0307C}",Ve=[["left","a:lnL"],["right","a:lnR"],["top","a:lnT"],["bottom","a:lnB"]];function Se(e,t){return n("a:tbl",{},n("a:tblPr",{firstRow:e.first_row?1:void 0,firstCol:e.first_col?1:void 0,lastRow:e.last_row?1:void 0,lastCol:e.last_col?1:void 0,bandRow:e.horz_banding?1:void 0,bandCol:e.vert_banding?1:void 0},n("a:tableStyleId",{},Ke)),n("a:tblGrid",{},...e.columns.map(i=>n("a:gridCol",{w:i}))),...e.rows.map((i,o)=>n("a:tr",{h:i.height},...i.cells.map((r,d)=>{const s=r.text.own??r.text,m=i.cells[d-1],g=e.rows[o-1]?.cells[d];return n("a:tc",{gridSpan:r.span_width,rowSpan:r.span_height,hMerge:r.spanned&&m&&(m.spanned||m.span_width)?1:void 0,vMerge:r.spanned&&g&&(g.spanned||g.span_height)?1:void 0},j("a:txBody",n("a:bodyPr"),n("a:lstStyle"),r.text.paragraphs,t,ie(r.fileText)),n("a:tcPr",{marL:s.margin_left,marR:s.margin_right,marT:s.margin_top,marB:s.margin_bottom,anchor:s.vertical_anchor},...Ve.map(([P,$])=>{const E=r.borders?.[P];return E?n($,{w:E.width},ce(E.color)):""}),r.fill===void 0?"":ce(r.fill)))}))))}const ae=e=>e.group===void 0?{}:{group:e.group},K=e=>({...e.line_dash===void 0?{}:{lineDash:e.line_dash},...e.line_begin===void 0?{}:{lineBegin:e.line_begin},...e.line_end===void 0?{}:{lineEnd:e.line_end}});function be(e,t,i,o,r,d,s){const m={...ge(e),id:t,name:e.name,...e.frame?{frame:e.frame}:{},...e.rotation===void 0?{}:{rotation:e.rotation}};if(e.kind==="placeholder"&&e.placeholder){const g=s.on==="master"?{...Le(e.placeholder.type),...e.text}:e.text;return{...m,kind:"sp",placeholder:{...e.placeholder},...e.fill===void 0?{}:{fill:e.fill},...e.line===void 0?{}:{line:e.line},...e.line_width===void 0?{}:{lineWidth:e.line_width},...e.fill===void 0&&e.line===void 0?{}:{geometry:e.geometry??"rect"},text:j("p:txBody",g?q(g):n("a:bodyPr"),B(g?.levels??[]),e.placeholder.type==="sldNum"?je:Be,d)}}if(he(e)){if(e.table)return{...m,kind:"table",table:Se(e.table,d)};if(e.kind==="picture"&&e.media){const g=r(le(e.media.base,e.media.path));return g?{...m,kind:"pic",picture:{image:i.add(l.image,o.add(g,N(e.media.path),"image")),descr:e.media.path.split("/").pop()??""}}:void 0}return e.geometry==="line"?{...m,kind:"cxn",...e.flip?{flip:e.flip}:{},...Z(e),...K(e)}:{...m,kind:"sp",...e.kind==="textbox"?{textbox:!0}:{},...e.path?{path:e.path}:{geometry:e.geometry??"rect"},...e.adjustments?{adjustments:e.adjustments}:{},...Z(e),...K(e),...e.text?{text:ye(e.kind,e.text,e.text.paragraphs,s.master,s.first,d)}:{}}}}function ie(e,t){if(e)return{font:{...e.size===void 0?{}:{size:De(e.size)},...e.bold===void 0?{}:{bold:e.bold},...e.font===void 0?{}:{name:e.font},...e.color===void 0?{}:e.color.startsWith("#")?{rgb:e.color.toUpperCase()}:{color:e.color}},...e.align===void 0?{}:{alignment:e.align},...e.numbered===void 0?{}:{numbered:e.numbered,...t?.levels[0]?{margin_left:t.levels[0].margin_left,indent:t.levels[0].indent}:{}}}}function Qe(e,t,i,o,r,d,s,m,g){const P=`${e.id}/${t.name}`,$=d.deck.fitted[P];if(t.level!=="slide"&&!ne(t))return;const E=t.level==="slide"&&t.placeholder?{placeholder:{...t.placeholder}}:{},F=!t.placeholder||t.sources.frame.from==="slide"||t.sources.frame.from==="code"?{frame:t.frame}:{},k={...ge(t),id:i,name:t.name,...E,...F,...t.rotation===void 0?{}:{rotation:t.rotation}},W=()=>{const f=d.pictures.get(P);return f?{image:o.add(l.image,r.add(f,"png","image")),descr:t.name}:void 0};if(t.table)return{...k,kind:"table",table:Se(t.table,s)};if(t.chart)return{...k,frame:t.frame,kind:"chart",chart:o.add(l.chart,g.add(t.chart,t.frame))};if(t.kind==="movie"&&t.media){const f=W(),I=fe[N(t.media.path)]?d.file(t.media.path):void 0;if(!f)return;if(!I)return{...k,frame:t.frame,kind:"pic",picture:f};const O=r.add(I,N(t.media.path),"media");return m.push(i),{...k,frame:t.frame,kind:"pic",picture:{image:f.image},video:{link:o.add(l.video,O),media:o.add(l.media,O)}}}if(ne(t)){const f=W(),I=d.movies?.get(P);if(f&&I){const O=r.add(I.bytes,"mp4","media");return m.push(i),{...k,frame:t.frame,kind:"pic",picture:{image:f.image},video:{link:o.add(l.video,O),media:o.add(l.media,O)}}}return f?{...k,frame:t.frame,kind:"pic",picture:f}:void 0}if(t.kind==="picture"&&t.media){const f=d.file(t.media.path);return f?{...k,frame:t.frame,kind:"pic",picture:{image:o.add(l.image,r.add(f,N(t.media.path),"image")),...t.media.crop?{crop:t.media.crop}:{},descr:t.media.path.split("/").pop()??""}}:void 0}if(t.geometry==="line")return{...k,kind:"cxn",...t.flip?{flip:t.flip}:{},...Z(t),...K(t)};const v=t.text,J=d.deck.masters.find(f=>f.name===e.master),H=v?t.placeholder?j("p:txBody",$===void 0?n("a:bodyPr"):q({},$),n("a:lstStyle"),v.paragraphs,s,ie(t.fileText,v.style)):v.own?ye(t.kind,v.own,v.paragraphs,J,d.deck.masters[0],s,$,ie(t.fileText,v.style)):j("p:txBody",q(Ne(v.style),$),B(v.style.levels.map(pe)),v.paragraphs,s):void 0,z=t.sources.frame.from==="code",G=t.fill!==void 0&&(z||t.sources.fill?.from==="slide"),C=t.line!==void 0&&(z||t.sources.line?.from==="slide");return{...k,kind:"sp",...t.kind==="textbox"?{textbox:!0}:{},...t.path?{path:t.path}:!t.placeholder||G||C?{geometry:t.geometry??"rect"}:{},...t.adjustments?{adjustments:t.adjustments}:{},...K(t),...t.placeholder?{...G?{fill:t.fill}:{},...C?{line:t.line}:{},...t.line_width===void 0?{}:{lineWidth:t.line_width}}:Z(t),...H?{text:H}:{}}}const et={cx:6858e3,cy:9144e3};function _e(e,t){const i=de({id:2,name:"Slide Image Placeholder 1",kind:"sp",placeholder:{type:"sldImg",idx:2},...e===void 0?{frame:{left:1143e3,top:685800,width:4572e3,height:3429e3}}:{}}),o=de({id:3,name:"Notes Placeholder 2",kind:"sp",placeholder:{type:"body",idx:3,sz:"quarter"},...e===void 0?{frame:{left:685800,top:4343400,width:5486400,height:4114800}}:{},text:j("p:txBody",n("a:bodyPr"),n("a:lstStyle"),(e??"").split(`
3
- `).map(r=>({runs:[{text:r}],level:0})),t)});return[i,o]}export function pptxParts(e){const{deck:t}=e,i=t.lang?.split("-").map((a,p)=>p===0?a.toLowerCase():a.toUpperCase()).join("-"),o=new Map,r=new We,d=new Xe,s=[],m=new D,g=[],P=new Map;let $=2147483648;t.masters.forEach((a,p)=>{const c=p+1,_=$++,x=`ppt/slideMasters/slideMaster${String(c)}.xml`,y=`ppt/theme/theme${String(c)}.xml`;o.set(y,me(t.theme)),s.push([y,b.theme]);const S=new D,L=[];a.layouts.forEach(M=>{const h=P.size+1,u=`ppt/slideLayouts/slideLayout${String(h)}.xml`;P.set(M,u);const U=new D;U.add(l.slideMaster,`../slideMasters/slideMaster${String(c)}.xml`);const we=M.shapes.flatMap((se,ke)=>{const re=be(se,ke+2,U,r,e.file,i,{master:a,first:e.deck.masters[0],on:"layout"});return re?[{...re,...ae(se)}]:[]});o.set(u,w+n("p:sldLayout",{...T,...M.display_master_shapes===!1?{showMasterSp:0}:{},preserve:1},n("p:cSld",{name:M.name},M.background===void 0?"":oe(M.background),X(ee(we))),n("p:clrMapOvr",{},n("a:masterClrMapping")))),o.set(`ppt/slideLayouts/_rels/slideLayout${String(h)}.xml.rels`,U.xml()),s.push([u,b.slideLayout]),L.push(n("p:sldLayoutId",{id:$++,"r:id":S.add(l.slideLayout,`../slideLayouts/slideLayout${String(h)}.xml`)}))}),S.add(l.theme,`../theme/theme${String(c)}.xml`);const Y=a.shapes.flatMap((M,h)=>{const u=be(M,h+2,S,r,e.file,i,{master:a,first:e.deck.masters[0],on:"master"});return u?[{...u,...ae(M)}]:[]}),A=a.text_styles;o.set(x,w+n("p:sldMaster",T,n("p:cSld",{name:a.name},oe(a.background),X(ee(Y))),n("p:clrMap",ue),n("p:sldLayoutIdLst",{},...L),n("p:txStyles",{},B(A.title,"p:titleStyle"),B(A.body,"p:bodyStyle"),B(A.other,"p:otherStyle")))),o.set(`ppt/slideMasters/_rels/slideMaster${String(c)}.xml.rels`,S.xml()),s.push([x,b.slideMaster]),g.push(n("p:sldMasterId",{id:_,"r:id":m.add(l.slideMaster,`slideMasters/slideMaster${String(c)}.xml`)}))});const E=t.slides.some(a=>a.notes!==void 0),V=`ppt/theme/theme${String(t.masters.length+1)}.xml`;let F="";if(E){o.set(V,me(t.theme)),s.push([V,b.theme]);const a=new D;a.add(l.theme,`../theme/theme${String(t.masters.length+1)}.xml`),o.set("ppt/notesMasters/notesMaster1.xml",w+n("p:notesMaster",T,n("p:cSld",{},oe("lt1"),X(_e(void 0,i))),n("p:clrMap",ue))),o.set("ppt/notesMasters/_rels/notesMaster1.xml.rels",a.xml()),s.push(["ppt/notesMasters/notesMaster1.xml",b.notesMaster]),F=m.add(l.notesMaster,"notesMasters/notesMaster1.xml")}const k=[],W=new Map(t.masters.flatMap(a=>a.layouts.map(p=>[p.name,p]))),v=a=>{const p=new Set,c=t.slides[a];for(const[_,x]of[[t.slides[a-1],c],[c,t.slides[a+1]]])if(_&&x&&x.transition?.type==="morph")for(const y of _.shapes)y.level==="slide"&&x.shapes.some(S=>S.name===y.name)&&p.add(y.name);return p};t.slides.forEach((a,p)=>{const c=p+1,_=`ppt/slides/slide${String(c)}.xml`,x=new D,y=W.get(a.layout),S=y?P.get(y):void 0;S&&x.add(l.slideLayout,`../${S.slice(4)}`);const L=[],Y=new Map;let A=1;const M=a.shapes.flatMap(h=>{const u=Qe(a,h,++A,x,r,e,i,L,d);if(!u)return A--,[];Y.set(h.name,u.id);const U=v(p).has(h.name)?{name:`!!${u.name}`}:{};return[{...u,...ae(h),...U}]});if(a.notes!==void 0){const h=`ppt/notesSlides/notesSlide${String(c)}.xml`,u=new D;u.add(l.notesMaster,"../notesMasters/notesMaster1.xml"),u.add(l.slide,`../slides/slide${String(c)}.xml`),o.set(h,w+n("p:notes",T,n("p:cSld",{},X(_e(a.notes,i))),n("p:clrMapOvr",{},n("a:masterClrMapping")))),o.set(`ppt/notesSlides/_rels/notesSlide${String(c)}.xml.rels`,u.xml()),s.push([h,b.notesSlide]),x.add(l.notesSlide,`../notesSlides/notesSlide${String(c)}.xml`)}o.set(_,w+n("p:sld",{...T,show:a.hidden?0:void 0},n("p:cSld",{name:a.id},x.linked(X(ee(M)))),n("p:clrMapOvr",{},n("a:masterClrMapping")),He(a.transition),Fe(a.animations,L,h=>Y.get(h),h=>a.shapes.find(u=>u.name===h)?.text!==void 0,t,new Map(a.shapes.flatMap(h=>{const u=e.movies?.get(`${a.id}/${h.name}`);return u?[[h.name,u.seconds]]:[]}))))),o.set(`ppt/slides/_rels/slide${String(c)}.xml.rels`,x.xml()),s.push([_,b.slide]),k.push(n("p:sldId",{id:256+p,"r:id":m.add(l.slide,`slides/slide${String(c)}.xml`)}))}),m.add(l.theme,"theme/theme1.xml"),m.add(l.presProps,"presProps.xml"),m.add(l.viewProps,"viewProps.xml"),m.add(l.tableStyles,"tableStyles.xml");const J=new Map;let H=0;const z=(e.fonts??[]).flatMap(a=>{const p=Ue.flatMap(([c,_,x])=>{const y=a[c]&&Ie(a[c],a.typeface,x),S=y&&Oe(y);if(!y||!S)return[];const L=`fonts/font${String(++H)}.fntdata`;return J.set(`ppt/${L}`,Re(y,S,a.typeface,x)),[n(_,{"r:id":m.add(l.font,L)})]});return p.length===0?[]:[n("p:embeddedFont",{},n("p:font",{typeface:a.typeface}),...p)]}),G=z.length===0?"":n("p:embeddedFontLst",{},...z);o.set("ppt/presentation.xml",w+n("p:presentation",{...T,...G===""?{}:{embedTrueTypeFonts:1},saveSubsetFonts:1},n("p:sldMasterIdLst",{},...g),F===""?"":n("p:notesMasterIdLst",{},n("p:notesMasterId",{"r:id":F})),n("p:sldIdLst",{},...k),n("p:sldSz",{cx:t.width,cy:t.height}),n("p:notesSz",et),G,e.deck.masters[0]?B(Te(e.deck.masters[0]).map(pe),"p:defaultTextStyle"):"")),o.set("ppt/_rels/presentation.xml.rels",m.xml()),s.push(["ppt/presentation.xml",b.presentation]),o.set("ppt/presProps.xml",w+n("p:presentationPr",T)),o.set("ppt/viewProps.xml",w+n("p:viewPr",T)),o.set("ppt/tableStyles.xml",w+n("a:tblStyleLst",{"xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main",def:"{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}"})),s.push(["ppt/presProps.xml",b.presProps]),s.push(["ppt/viewProps.xml",b.viewProps]),s.push(["ppt/tableStyles.xml",b.tableStyles]),o.set("docProps/core.xml",w+n("cp:coreProperties",{"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/"},e.title===void 0?"":`<dc:title>${ze(e.title)}</dc:title>`)),o.set("docProps/app.xml",w+n("Properties",{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"},n("Application",{},"AllyHub"),n("Slides",{},String(t.slides.length)),n("Notes",{},String(t.slides.filter(a=>a.notes!==void 0).length)),n("HiddenSlides",{},String(t.slides.filter(a=>a.hidden).length)))),s.push(["docProps/core.xml",b.core]),s.push(["docProps/app.xml",b.app]);const C=new D;C.add(l.officeDocument,"ppt/presentation.xml"),C.add(l.core,"docProps/core.xml"),C.add(l.app,"docProps/app.xml");const f=new Map;d.list.forEach(({chart:a,frame:p},c)=>{const _=String(c+1),x=`ppt/charts/chart${_}.xml`,y=new D,S=`Microsoft_Excel_Sheet${_}.xlsx`;f.set(`ppt/embeddings/${S}`,Ee(a)),o.set(x,Ce(a,p,y.add(l.package,`../embeddings/${S}`))),o.set(`ppt/charts/_rels/chart${_}.xml.rels`,y.xml()),s.push([x,b.chart])});const I=new Set([...r.parts.keys(),...f.keys()].map(N)),O=w+n("Types",{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},n("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),n("Default",{Extension:"xml",ContentType:"application/xml"}),H>0?n("Default",{Extension:"fntdata",ContentType:"application/x-fontdata"}):"",...[...I].sort().map(a=>n("Default",{Extension:a,ContentType:a==="xlsx"?b.workbook:te[a]??fe[a]??"application/octet-stream"})),...s.map(([a,p])=>n("Override",{PartName:`/${a}`,ContentType:p}))),Q=new TextEncoder,R=new Map;R.set("[Content_Types].xml",Q.encode(O)),R.set("_rels/.rels",Q.encode(C.xml()));for(const[a,p]of o)R.set(a,Q.encode(p));for(const[a,p]of r.parts)R.set(a,p);for(const[a,p]of f)R.set(a,p);for(const[a,p]of J)R.set(a,p);return R}const tt=new Date(1980,0,1);export function writePptx(e){const t={};for(const[i,o]of pptxParts(e))t[i]=[o,{level:/\.(png|jpe?g|gif|mp4|m4v|mov)$/u.test(i)?0:6,mtime:tt}];return Me(t)}
2
+ import{createHash as $e}from"node:crypto";import{zipSync as Le}from"fflate";import{AUTOSHAPE_STYLE as De,colorOfFile as Te,CONNECTOR_STYLE as Ee,isConnectorGeometry as ne,joinPath as me,placeholderFrame as Ie,plainLevels as Oe,Pt as ae}from"@allyhub-next/slides-core";import{chartBook as Ce,chartXml as Re}from"./charts.js";import{asFace as Be,fontInfo as je,eotOf as Ne}from"./fonts.js";import{NO_PARAGRAPHS as Ae,shapeXml as ce,treeXml as oe}from"./shapes.js";import{bodyOfStyle as Fe,bodyProps as K,bodyUnder as ie,LINK as ze,SLIDE_NUMBER as He,levelOf as fe,listStyle as N,txBody as H}from"./text.js";import{themeXml as he}from"./theme.js";import{timingXml as Ge,transitionXml as Xe}from"./timing.js";import{HEAD as w,PML as I,color as Ue,el as n,esc as We,fill as ue,gradientFill as Je,unesc as Ye}from"./xml.js";const V={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",tif:"image/tiff",tiff:"image/tiff",emf:"image/x-emf",wmf:"image/x-wmf"},ge={mp4:"video/mp4",m4v:"video/mp4",mov:"video/quicktime"},D=e=>(e.split(".").pop()??"").toLowerCase(),Ze=[["regular","p:regular","Regular"],["bold","p:bold","Bold"],["italic","p:italic","Italic"],["boldItalic","p:boldItalic","Bold Italic"]],d={hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",chart:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",package:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package",font:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/font",officeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",core:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",app:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",slideMaster:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster",slideLayout:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout",slide:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide",theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",notesMaster:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster",notesSlide:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide",image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",video:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video",media:"http://schemas.microsoft.com/office/2007/relationships/media",presProps:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps",viewProps:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps",tableStyles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles"},S={chart:"application/vnd.openxmlformats-officedocument.drawingml.chart+xml",workbook:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",presentation:"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml",slideMaster:"application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml",slideLayout:"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml",slide:"application/vnd.openxmlformats-officedocument.presentationml.slide+xml",theme:"application/vnd.openxmlformats-officedocument.theme+xml",notesMaster:"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml",notesSlide:"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml",presProps:"application/vnd.openxmlformats-officedocument.presentationml.presProps+xml",viewProps:"application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml",tableStyles:"application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml",core:"application/vnd.openxmlformats-package.core-properties+xml",app:"application/vnd.openxmlformats-officedocument.extended-properties+xml"};class O{list=[];linked(t){return t.replaceAll(new RegExp(`r:id="${ze}([^"]*)"`,"gu"),(i,a)=>`r:id="${this.add(d.hyperlink,Ye(a),!0)}"`)}add(t,i,a=!1){const r=this.list.find(s=>s.type===t&&s.target===i);if(r)return r.id;const p=`rId${String(this.list.length+1)}`;return this.list.push({id:p,type:t,target:i,...a?{external:a}:{}}),p}xml(){return w+n("Relationships",{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},...this.list.map(t=>n("Relationship",{Id:t.id,Type:t.type,Target:t.target,TargetMode:t.external?"External":void 0})))}}class qe{list=[];add(t,i){return this.list.push({chart:t,frame:i}),`../charts/chart${String(this.list.length)}.xml`}}class Ke{parts=new Map;byHash=new Map;add(t,i,a,r){const p=$e("sha256").update(t).digest("hex"),s=this.byHash.get(`${a}:${p}`);if(s)return s;const m=r?.split("/").pop()?.replace(/\.[^.]*$/u,"").replace(/[^A-Za-z0-9_-]+/gu,"-").replace(/^-+|-+$/gu,""),u=m===void 0||m===""?void 0:m;let b=`${u??`${a}${String(this.parts.size+1)}`}.${i}`;for(let M=2;this.parts.has(`ppt/media/${b}`);M++)b=`${u??a}-${String(M)}.${i}`;return this.parts.set(`ppt/media/${b}`,t),this.byHash.set(`${a}:${p}`,`../media/${b}`),`../media/${b}`}}function xe(e){return e.kind==="component"||e.kind==="movie"?!1:e.kind==="picture"?V[D(e.media?.path??"")]!==void 0:!0}function re(e){return e.kind==="component"||e.kind==="movie"?!0:e.kind==="picture"?V[D(e.media?.path??"")]===void 0:!1}export function picturedShapes(e){return e.slides.flatMap(t=>t.shapes.filter(i=>re(i)).map(i=>({key:`${t.id}/${i.name}`,slide:t.id,shape:i.name,frame:i.frame})))}export function filesOf(e){const t=new Set;for(const i of e.masters)for(const a of[...i.shapes,...i.layouts.flatMap(r=>r.shapes)])a.media&&xe(a)&&t.add(me(a.media.base,a.media.path));for(const i of e.slides){i.background_picture!==void 0&&t.add(i.background_picture);for(const a of i.shapes)a.media&&(a.kind==="picture"||a.kind==="movie")&&t.add(a.media.path)}return[...t].sort()}const Ve=n("p:nvGrpSpPr",{},n("p:cNvPr",{id:1,name:""}),n("p:cNvGrpSpPr"),n("p:nvPr")),Qe=n("p:grpSpPr",{},n("a:xfrm",{},n("a:off",{x:0,y:0}),n("a:ext",{cx:0,cy:0}),n("a:chOff",{x:0,y:0}),n("a:chExt",{cx:0,cy:0}))),J=e=>n("p:spTree",{},Ve,Qe,...e),ye={bg1:"lt1",tx1:"dk1",bg2:"lt2",tx2:"dk2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hlink:"hlink",folHlink:"folHlink"},Q=e=>n("p:bg",{},n("p:bgPr",{},n("a:solidFill",{},Ue(e)),n("a:effectLst")));function et(e,t,i){if(e.background_picture!==void 0){const a=i(e.background_picture);if(a!==void 0)return n("p:bg",{},n("p:bgPr",{},n("a:blipFill",{dpi:0,rotWithShape:1},n("a:blip",{"r:embed":a}),n("a:srcRect"),n("a:stretch",{},n("a:fillRect"))),n("a:effectLst")))}return e.background_gradient?n("p:bg",{},n("p:bgPr",{},Je(e.background_gradient),n("a:effectLst"))):se(e.background,t)?"":Q(e.background)}const se=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function be(e){return{...e.fill_transparency===void 0?{}:{fillTransparency:e.fill_transparency,...e.fill===void 0?{}:{fill:e.fill}},...e.gradient?{gradient:e.gradient}:{},...e.shadow?{shadow:e.shadow}:{}}}function ee(e){const t=i=>({...e.fill===void 0||"fill"in i&&se(e.fill,i.fill)?{}:{fill:e.fill},...e.line===void 0||se(e.line,i.line)?{}:{line:e.line},...e.line_width===void 0||e.line_width===i.line_width?{}:{lineWidth:e.line_width}});return e.kind==="autoshape"?ne(e.geometry)?{style:"connector",...t(Ee)}:{style:"shape",...t(De)}:{...e.kind==="textbox"?{fill:e.fill??null}:e.fill===void 0?{}:{fill:e.fill},...e.line===void 0?{}:{line:e.line},...e.line_width===void 0?{}:{lineWidth:e.line_width}}}const tt=(e,t)=>Array.from({length:Math.max(e.length,t.length)},(i,a)=>{const r=e[a]??{},p=t[a]??{},s={...r.font,...p.font};return{...r,...p,...Object.keys(s).length>0?{font:s}:{}}});function _e(e,t,i,a,r,p,s,m){const u=a!==void 0&&r!==void 0&&JSON.stringify(a.text_styles.other)!==JSON.stringify(r.text_styles.other);return H("p:txBody",K(ie(t,m),s,e==="autoshape"?{rtlCol:0}:{}),N(u?tt(a.text_styles.other,t.levels):t.levels),i,p,m)}const nt="{2D5ABB26-0587-4C30-8999-92F81FD0307C}",at=[["left","a:lnL"],["right","a:lnR"],["top","a:lnT"],["bottom","a:lnB"]];function Se(e,t){return n("a:tbl",{},n("a:tblPr",{firstRow:e.first_row?1:void 0,firstCol:e.first_col?1:void 0,lastRow:e.last_row?1:void 0,lastCol:e.last_col?1:void 0,bandRow:e.horz_banding?1:void 0,bandCol:e.vert_banding?1:void 0},n("a:tableStyleId",{},nt)),n("a:tblGrid",{},...e.columns.map(i=>n("a:gridCol",{w:i}))),...e.rows.map((i,a)=>n("a:tr",{h:i.height},...i.cells.map((r,p)=>{const s=r.text.own??r.text,m=we(r.fileText,r.text.style),u=i.cells[p-1],b=e.rows[a-1]?.cells[p];return n("a:tc",{gridSpan:r.span_width,rowSpan:r.span_height,hMerge:r.spanned&&u&&(u.spanned||u.span_width)?1:void 0,vMerge:r.spanned&&b&&(b.spanned||b.span_height)?1:void 0},H("a:txBody",n("a:bodyPr"),n("a:lstStyle"),r.text.paragraphs,t,m),n("a:tcPr",{marL:s.margin_left,marR:s.margin_right,marT:s.margin_top,marB:s.margin_bottom,anchor:ie(s,m).vertical_anchor},...at.map(([M,G])=>{const C=r.borders?.[M];return C?n(G,{w:C.width},ue(C.color)):""}),r.fill===void 0?"":ue(r.fill)))}))))}const le=e=>e.group===void 0?{}:{group:e.group},te=e=>({...e.line_dash===void 0?{}:{lineDash:e.line_dash},...e.line_begin===void 0?{}:{lineBegin:e.line_begin},...e.line_end===void 0?{}:{lineEnd:e.line_end}});function ke(e,t,i,a,r,p,s){const m={...be(e),id:t,name:e.name,...e.frame?{frame:e.frame}:{},...e.rotation===void 0?{}:{rotation:e.rotation},...e.flip?{flip:e.flip}:{}};if(e.kind==="placeholder"&&e.placeholder){const u=s.on==="master"?{...Ie(e.placeholder.type),...e.text}:e.text;return{...m,kind:"sp",placeholder:{...e.placeholder},...e.fill===void 0?{}:{fill:e.fill},...e.line===void 0?{}:{line:e.line},...e.line_width===void 0?{}:{lineWidth:e.line_width},...e.fill===void 0&&e.line===void 0?{}:{geometry:e.geometry??"rect"},text:H("p:txBody",u?K(u):n("a:bodyPr"),N(u?.levels??[]),e.placeholder.type==="sldNum"?He:Ae,p)}}if(xe(e)){if(e.table)return{...m,kind:"table",table:Se(e.table,p)};if(e.kind==="picture"&&e.media){const u=r(me(e.media.base,e.media.path));return u?{...m,kind:"pic",picture:{image:i.add(d.image,a.add(u,D(e.media.path),"image",e.media.path))},descr:e.media.path.split("/").pop()??""}:void 0}return!e.path&&ne(e.geometry)?{...m,kind:"cxn",geometry:e.geometry??"line",...e.adjustments?{adjustments:e.adjustments}:{},...ee(e),...te(e)}:{...m,kind:"sp",...e.kind==="textbox"?{textbox:!0}:{},...e.path?{path:e.path}:{geometry:e.geometry??"rect"},...e.adjustments?{adjustments:e.adjustments}:{},...ee(e),...te(e),...e.text?{text:_e(e.kind,e.text,e.text.paragraphs,s.master,s.first,p)}:{}}}}function we(e,t){if(!e)return;const i=e.numbered!==void 0||e.bullet!==void 0&&e.bullet!==!1;return{font:{...e.size===void 0?{}:{size:ae(e.size)},...e.bold===void 0?{}:{bold:e.bold},...e.italic===void 0?{}:{italic:e.italic},...e.underline===void 0?{}:{underline:e.underline},...e.strike===void 0?{}:{strike:e.strike},...e.font===void 0?{}:{name:e.font},...e.color===void 0?{}:{color:Te(e.color)}},paragraph:{...e.align===void 0?{}:{alignment:e.align},...e.line_spacing===void 0?{}:{line_spacing:{lines:e.line_spacing}},...e.space_before===void 0?{}:{space_before:ae(e.space_before)},...e.space_after===void 0?{}:{space_after:ae(e.space_after)},...e.numbered!==void 0?{numbered:e.numbered}:e.bullet===void 0?{}:{bullet:e.bullet===!1?null:e.bullet}},...i&&t?{levels:t.levels.map(a=>({margin_left:a.margin_left,indent:a.indent}))}:{},...e.anchor===void 0?{}:{anchor:e.anchor}}}function ot(e,t,i,a,r,p,s,m,u){const b=`${e.id}/${t.name}`,M=p.deck.fitted[b];if(t.level!=="slide"&&!re(t))return;const G=t.level==="slide"&&t.placeholder?{placeholder:{...t.placeholder}}:{},X=!t.placeholder||t.sources.frame.from==="slide"||t.sources.frame.from==="code"?{frame:t.frame}:{},v={...be(t),id:i,name:t.name,...G,...X,...t.rotation===void 0?{}:{rotation:t.rotation},...t.flip?{flip:t.flip}:{},...t.alt===void 0?{}:{descr:t.alt},...t.locked?{locked:!0}:{}},Y=()=>{const x=p.pictures.get(b);return x?{image:a.add(d.image,r.add(x,"png","image"))}:void 0};if(t.table)return{...v,kind:"table",table:Se(t.table,s)};if(t.chart)return{...v,frame:t.frame,kind:"chart",chart:a.add(d.chart,u.add(t.chart,t.frame))};if(t.kind==="movie"&&t.media){const x=Y(),B=ge[D(t.media.path)]?p.file(t.media.path):void 0;if(!x)return;if(!B)return{...v,frame:t.frame,kind:"pic",picture:x};const L=r.add(B,D(t.media.path),"media",t.media.path);return m.push(i),{...v,frame:t.frame,kind:"pic",picture:{image:x.image},video:{link:a.add(d.video,L),media:a.add(d.media,L)}}}if(re(t)){const x=Y(),B=p.movies?.get(b);if(x&&B){const L=r.add(B.bytes,"mp4","media");return m.push(i),{...v,frame:t.frame,kind:"pic",picture:{image:x.image},video:{link:a.add(d.video,L),media:a.add(d.media,L)}}}return x?{...v,frame:t.frame,kind:"pic",picture:x}:void 0}if(t.kind==="picture"&&t.media){const x=p.file(t.media.path);return x?{...v,kind:"pic",picture:{image:a.add(d.image,r.add(x,D(t.media.path),"image",t.media.path)),...t.media.crop?{crop:t.media.crop}:{}},descr:t.alt??t.media.path.split("/").pop()??""}:void 0}if(!t.path&&ne(t.geometry))return{...v,kind:"cxn",geometry:t.geometry??"line",...t.adjustments?{adjustments:t.adjustments}:{},...ee(t),...te(t)};const P=t.text,Z=p.deck.masters.find(x=>x.name===e.master),A=we(t.fileText,P?.style),U=P?t.placeholder?H("p:txBody",K(ie({},A),M),n("a:lstStyle"),P.paragraphs,s,A):P.own?_e(t.kind,P.own,P.paragraphs,Z,p.deck.masters[0],s,M,A):H("p:txBody",K(Fe(P.style),M),N(P.style.levels.map(fe)),P.paragraphs,s):void 0,W=t.sources.frame.from==="code",R=t.fill!==void 0&&(W||t.sources.fill?.from==="slide"),F=t.line!==void 0&&(W||t.sources.line?.from==="slide");return{...v,kind:"sp",...t.kind==="textbox"?{textbox:!0}:{},...t.path?{path:t.path}:!t.placeholder||R||F?{geometry:t.geometry??"rect"}:{},...t.adjustments?{adjustments:t.adjustments}:{},...te(t),...t.placeholder?{...R?{fill:t.fill}:{},...F?{line:t.line}:{},...t.line_width===void 0?{}:{lineWidth:t.line_width}}:ee(t),...U?{text:U}:{}}}const it={cx:6858e3,cy:9144e3};function ve(e,t){const i=ce({id:2,name:"Slide Image Placeholder 1",kind:"sp",placeholder:{type:"sldImg",idx:2},...e===void 0?{frame:{left:1143e3,top:685800,width:4572e3,height:3429e3}}:{}}),a=ce({id:3,name:"Notes Placeholder 2",kind:"sp",placeholder:{type:"body",idx:3,sz:"quarter"},...e===void 0?{frame:{left:685800,top:4343400,width:5486400,height:4114800}}:{},text:H("p:txBody",n("a:bodyPr"),n("a:lstStyle"),(e??"").split(`
3
+ `).map(r=>({runs:[{text:r}],level:0})),t)});return[i,a]}export function pptxParts(e){const{deck:t}=e,i=t.lang?.split("-").map((o,c)=>c===0?o.toLowerCase():o.toUpperCase()).join("-"),a=new Map,r=new Ke,p=new qe,s=[],m=new O,u=[],b=new Map;let M=2147483648;t.masters.forEach((o,c)=>{const f=c+1,k=M++,g=`ppt/slideMasters/slideMaster${String(f)}.xml`,y=`ppt/theme/theme${String(f)}.xml`;a.set(y,he(t.theme)),s.push([y,S.theme]);const _=new O,T=[];o.layouts.forEach($=>{const l=b.size+1,h=`ppt/slideLayouts/slideLayout${String(l)}.xml`;b.set($,h);const E=new O;E.add(d.slideMaster,`../slideMasters/slideMaster${String(f)}.xml`);const Me=$.shapes.flatMap((de,Pe)=>{const pe=ke(de,Pe+2,E,r,e.file,i,{master:o,first:e.deck.masters[0],on:"layout"});return pe?[{...pe,...le(de)}]:[]});a.set(h,w+n("p:sldLayout",{...I,...$.display_master_shapes===!1?{showMasterSp:0}:{},preserve:1},n("p:cSld",{name:$.name},$.background===void 0?"":Q($.background),J(oe(Me))),n("p:clrMapOvr",{},n("a:masterClrMapping")))),a.set(`ppt/slideLayouts/_rels/slideLayout${String(l)}.xml.rels`,E.xml()),s.push([h,S.slideLayout]),T.push(n("p:sldLayoutId",{id:M++,"r:id":_.add(d.slideLayout,`../slideLayouts/slideLayout${String(l)}.xml`)}))}),_.add(d.theme,`../theme/theme${String(f)}.xml`);const q=o.shapes.flatMap(($,l)=>{const h=ke($,l+2,_,r,e.file,i,{master:o,first:e.deck.masters[0],on:"master"});return h?[{...h,...le($)}]:[]}),z=o.text_styles;a.set(g,w+n("p:sldMaster",I,n("p:cSld",{name:o.name},Q(o.background),J(oe(q))),n("p:clrMap",ye),n("p:sldLayoutIdLst",{},...T),n("p:txStyles",{},N(z.title,"p:titleStyle"),N(z.body,"p:bodyStyle"),N(z.other,"p:otherStyle")))),a.set(`ppt/slideMasters/_rels/slideMaster${String(f)}.xml.rels`,_.xml()),s.push([g,S.slideMaster]),u.push(n("p:sldMasterId",{id:k,"r:id":m.add(d.slideMaster,`slideMasters/slideMaster${String(f)}.xml`)}))});const G=t.slides.some(o=>o.notes!==void 0),C=`ppt/theme/theme${String(t.masters.length+1)}.xml`;let X="";if(G){a.set(C,he(t.theme)),s.push([C,S.theme]);const o=new O;o.add(d.theme,`../theme/theme${String(t.masters.length+1)}.xml`),a.set("ppt/notesMasters/notesMaster1.xml",w+n("p:notesMaster",I,n("p:cSld",{},Q("lt1"),J(ve(void 0,i))),n("p:clrMap",ye))),a.set("ppt/notesMasters/_rels/notesMaster1.xml.rels",o.xml()),s.push(["ppt/notesMasters/notesMaster1.xml",S.notesMaster]),X=m.add(d.notesMaster,"notesMasters/notesMaster1.xml")}const v=[],Y=new Map(t.masters.flatMap(o=>o.layouts.map(c=>[c.name,c]))),P=o=>{const c=new Set,f=t.slides[o];for(const[k,g]of[[t.slides[o-1],f],[f,t.slides[o+1]]])if(k&&g&&g.transition?.type==="morph")for(const y of k.shapes)y.level==="slide"&&g.shapes.some(_=>_.name===y.name)&&c.add(y.name);return c};t.slides.forEach((o,c)=>{const f=c+1,k=`ppt/slides/slide${String(f)}.xml`,g=new O,y=Y.get(o.layout),_=y?b.get(y):void 0;_&&g.add(d.slideLayout,`../${_.slice(4)}`);const T=[],q=new Map;let z=1;const $=o.shapes.flatMap(l=>{const h=ot(o,l,++z,g,r,e,i,T,p);if(!h)return z--,[];q.set(l.name,h.id);const E=P(c).has(l.name)?{name:`!!${h.name}`}:{};return[{...h,...le(l),...E}]});if(o.notes!==void 0){const l=`ppt/notesSlides/notesSlide${String(f)}.xml`,h=new O;h.add(d.notesMaster,"../notesMasters/notesMaster1.xml"),h.add(d.slide,`../slides/slide${String(f)}.xml`),a.set(l,w+n("p:notes",I,n("p:cSld",{},J(ve(o.notes,i))),n("p:clrMapOvr",{},n("a:masterClrMapping")))),a.set(`ppt/notesSlides/_rels/notesSlide${String(f)}.xml.rels`,h.xml()),s.push([l,S.notesSlide]),g.add(d.notesSlide,`../notesSlides/notesSlide${String(f)}.xml`)}a.set(k,w+n("p:sld",{...I,show:o.hidden?0:void 0},n("p:cSld",{name:o.id},et(o,y?.background??t.masters.find(l=>l.name===o.master)?.background,l=>{const h=e.file(l);return h&&V[D(l)]!==void 0?g.add(d.image,r.add(h,D(l),"image",l)):void 0}),g.linked(J(oe($)))),n("p:clrMapOvr",{},n("a:masterClrMapping")),Xe(o.transition,o.advance),Ge(o.animations,T,l=>q.get(l),l=>o.shapes.find(h=>h.name===l)?.text!==void 0,t,new Map(o.shapes.flatMap(l=>{const h=e.movies?.get(`${o.id}/${l.name}`),E=l.kind==="movie"&&l.media?e.lengths?.get(l.media.path):h?.seconds;return E===void 0?[]:[[l.name,E]]}))))),a.set(`ppt/slides/_rels/slide${String(f)}.xml.rels`,g.xml()),s.push([k,S.slide]),v.push(n("p:sldId",{id:256+c,"r:id":m.add(d.slide,`slides/slide${String(f)}.xml`)}))}),m.add(d.theme,"theme/theme1.xml"),m.add(d.presProps,"presProps.xml"),m.add(d.viewProps,"viewProps.xml"),m.add(d.tableStyles,"tableStyles.xml");const Z=new Map;let A=0;const U=(e.fonts??[]).flatMap(o=>{const c=Ze.flatMap(([f,k,g])=>{const y=o[f]&&Be(o[f],o.typeface,g),_=y&&je(y);if(!y||!_)return[];const T=`fonts/font${String(++A)}.fntdata`;return Z.set(`ppt/${T}`,Ne(y,_,o.typeface,g)),[n(k,{"r:id":m.add(d.font,T)})]});return c.length===0?[]:[n("p:embeddedFont",{},n("p:font",{typeface:o.typeface}),...c)]}),W=U.length===0?"":n("p:embeddedFontLst",{},...U);a.set("ppt/presentation.xml",w+n("p:presentation",{...I,...W===""?{}:{embedTrueTypeFonts:1},saveSubsetFonts:1},n("p:sldMasterIdLst",{},...u),X===""?"":n("p:notesMasterIdLst",{},n("p:notesMasterId",{"r:id":X})),n("p:sldIdLst",{},...v),n("p:sldSz",{cx:t.width,cy:t.height}),n("p:notesSz",it),W,e.deck.masters[0]?N(Oe(e.deck.masters[0]).map(fe),"p:defaultTextStyle"):"")),a.set("ppt/_rels/presentation.xml.rels",m.xml()),s.push(["ppt/presentation.xml",S.presentation]),a.set("ppt/presProps.xml",w+n("p:presentationPr",I)),a.set("ppt/viewProps.xml",w+n("p:viewPr",I)),a.set("ppt/tableStyles.xml",w+n("a:tblStyleLst",{"xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main",def:"{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}"})),s.push(["ppt/presProps.xml",S.presProps]),s.push(["ppt/viewProps.xml",S.viewProps]),s.push(["ppt/tableStyles.xml",S.tableStyles]),a.set("docProps/core.xml",w+n("cp:coreProperties",{"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/"},e.title===void 0?"":`<dc:title>${We(e.title)}</dc:title>`)),a.set("docProps/app.xml",w+n("Properties",{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"},n("Application",{},"AllyHub"),n("Slides",{},String(t.slides.length)),n("Notes",{},String(t.slides.filter(o=>o.notes!==void 0).length)),n("HiddenSlides",{},String(t.slides.filter(o=>o.hidden).length)))),s.push(["docProps/core.xml",S.core]),s.push(["docProps/app.xml",S.app]);const R=new O;R.add(d.officeDocument,"ppt/presentation.xml"),R.add(d.core,"docProps/core.xml"),R.add(d.app,"docProps/app.xml");const F=new Map;p.list.forEach(({chart:o,frame:c},f)=>{const k=String(f+1),g=`ppt/charts/chart${k}.xml`,y=new O,_=`Microsoft_Excel_Sheet${k}.xlsx`;F.set(`ppt/embeddings/${_}`,Ce(o)),a.set(g,Re(o,c,y.add(d.package,`../embeddings/${_}`))),a.set(`ppt/charts/_rels/chart${k}.xml.rels`,y.xml()),s.push([g,S.chart])});const x=new Set([...r.parts.keys(),...F.keys()].map(D)),B=w+n("Types",{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},n("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),n("Default",{Extension:"xml",ContentType:"application/xml"}),A>0?n("Default",{Extension:"fntdata",ContentType:"application/x-fontdata"}):"",...[...x].sort().map(o=>n("Default",{Extension:o,ContentType:o==="xlsx"?S.workbook:V[o]??ge[o]??"application/octet-stream"})),...s.map(([o,c])=>n("Override",{PartName:`/${o}`,ContentType:c}))),L=new TextEncoder,j=new Map;j.set("[Content_Types].xml",L.encode(B)),j.set("_rels/.rels",L.encode(R.xml()));for(const[o,c]of a)j.set(o,L.encode(c));for(const[o,c]of r.parts)j.set(o,c);for(const[o,c]of F)j.set(o,c);for(const[o,c]of Z)j.set(o,c);return j}const rt=new Date(1980,0,1);export function writePptx(e){const t={};for(const[i,a]of pptxParts(e))t[i]=[a,{level:/\.(png|jpe?g|gif|mp4|m4v|mov)$/u.test(i)?0:6,mtime:rt}];return Le(t)}
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- const s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},p=t=>{const o=t.charCodeAt(0);return o<32&&o!==9&&o!==10&&o!==13||o===65534||o===65535};export const esc=t=>Array.from(t,o=>p(o)?"":s[o]??o).join(""),unesc=t=>t.replaceAll("&quot;",'"').replaceAll("&gt;",">").replaceAll("&lt;","<").replaceAll("&amp;","&");export function el(t,o={},...e){const r=Object.entries(o).filter(([,n])=>n!==void 0).map(([n,a])=>` ${n}="${esc(typeof a=="boolean"?a?"1":"0":String(a))}"`).join(""),l=e.join("");return l===""?`<${t}${r}/>`:`<${t}${r}>${l}</${t}>`}export const HEAD=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
3
- `,NS={a:"http://schemas.openxmlformats.org/drawingml/2006/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",p:"http://schemas.openxmlformats.org/presentationml/2006/main",p14:"http://schemas.microsoft.com/office/powerpoint/2010/main"},PML={"xmlns:a":NS.a,"xmlns:r":NS.r,"xmlns:p":NS.p};export function color(t,o=0){const e=o>0?el("a:alpha",{val:Math.round((1-o)*1e5)}):"";return typeof t=="string"?el("a:schemeClr",{val:t},e):el("a:srgbClr",{val:t.rgb.replace("#","").toUpperCase()},e)}export const fill=(t,o=0)=>t===null?el("a:noFill"):el("a:solidFill",{},color(t,o)),gradientFill=t=>el("a:gradFill",{rotWithShape:1},el("a:gsLst",{},...[...t.stops].sort((o,e)=>o.at-e.at).map(o=>el("a:gs",{pos:Math.round(o.at*1e5)},color(o.color,o.transparency)))),el("a:lin",{ang:Math.round(t.angle*6e4),scaled:0})),effects=t=>el("a:effectLst",{},el("a:outerShdw",{blurRad:t.blur,dist:t.distance,dir:Math.round(t.angle*6e4),algn:"ctr",rotWithShape:0},color(t.color,t.transparency))),centipoints=t=>Math.round(t/127);
2
+ import{lumOf as s}from"@allyhub-next/ooxml/brightness";const p={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},i=t=>{const o=t.charCodeAt(0);return o<32&&o!==9&&o!==10&&o!==13||o===65534||o===65535};export const esc=t=>Array.from(t,o=>i(o)?"":p[o]??o).join(""),unesc=t=>t.replaceAll("&quot;",'"').replaceAll("&gt;",">").replaceAll("&lt;","<").replaceAll("&amp;","&");export function el(t,o={},...e){const n=Object.entries(o).filter(([,a])=>a!==void 0).map(([a,l])=>` ${a}="${esc(typeof l=="boolean"?l?"1":"0":String(l))}"`).join(""),r=e.join("");return r===""?`<${t}${n}/>`:`<${t}${n}>${r}</${t}>`}export const HEAD=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
3
+ `,NS={a:"http://schemas.openxmlformats.org/drawingml/2006/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",p:"http://schemas.openxmlformats.org/presentationml/2006/main",p14:"http://schemas.microsoft.com/office/powerpoint/2010/main"},PML={"xmlns:a":NS.a,"xmlns:r":NS.r,"xmlns:p":NS.p};export function color(t,o=0){const e=o>0?el("a:alpha",{val:Math.round((1-o)*1e5)}):"";if(typeof t=="string")return el("a:schemeClr",{val:t},e);if("rgb"in t)return el("a:srgbClr",{val:t.rgb.replace("#","").toUpperCase()},e);const{lumMod:n,lumOff:r}=s(t.brightness);return el("a:schemeClr",{val:t.theme_color},el("a:lumMod",{val:n}),r===void 0?"":el("a:lumOff",{val:r}),e)}export const fill=(t,o=0)=>t===null?el("a:noFill"):el("a:solidFill",{},color(t,o)),gradientFill=t=>el("a:gradFill",{rotWithShape:1},el("a:gsLst",{},...[...t.stops].sort((o,e)=>o.at-e.at).map(o=>el("a:gs",{pos:Math.round(o.at*1e5)},color(o.color,o.transparency)))),el("a:lin",{ang:Math.round(t.angle*6e4),scaled:0})),effects=t=>el("a:effectLst",{},el("a:outerShdw",{blurRad:t.blur,dist:t.distance,dir:Math.round(t.angle*6e4),algn:"ctr",rotWithShape:0},color(t.color,t.transparency))),centipoints=t=>Math.round(t/127);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/slides-pptx",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{consoleAt as s,createEnv as b,loadTextFonts as x,pictureWaiter as E}from"@allyhub-next/runtime/stage";import{CLEAN_LOOK as k,LAYER_BRAND as S,SEEK_LIMIT as $}from"@allyhub-next/video-core";import{importDeck as j,stageContext as v}from"./load.js";export async function componentStage(i,y,o){const d=b(i,y),h=await j(i),w=i.looks?.clean??k;document.documentElement.style.background="transparent",document.body.style.background="transparent";let a=[];const m=()=>{for(const t of a)s({phase:"mount",layer:t.layer.component},()=>{t.layer.unmount?.(t.el,t.layer.props,t.ctx)});a=[],o.replaceChildren()};return{async draw(t){m();const l=h.components[t.name];if(!l)throw new Error(`There is no component ${t.name} in slides.ts (it has ${Object.keys(h.components).join(", ")||"none"}).`);Object.assign(o.style,{position:"relative",width:`${String(t.width)}px`,height:`${String(t.height)}px`,overflow:"hidden",background:"transparent"});const u=[],f=s({phase:"build"},()=>l.layers(t.props,{width:t.width,height:t.height,slide:""}));for(const[g,r]of f.entries()){if(typeof r!="object"||r===null||r[S]!=="graphic")continue;const e=r,n=document.createElement("div");Object.assign(n.style,{position:"absolute",inset:"0px"}),o.append(n);const c=v({look:w,width:t.width,height:t.height,start:0,end:Math.max(t.t,0)+1,combo:d.combo,format:`${String(Math.round(t.width))}x${String(Math.round(t.height))}`,asset:p=>d.log.asset(p),wait:p=>u.push(p),report:()=>{}});a.push({layer:e,el:n,ctx:c}),s({phase:"mount",layer:e.component,index:g},()=>{e.mount(n,e.props,c)}),s({phase:"render",layer:e.component,index:g},()=>{e.render(n,Math.max(0,t.t),e.props,c)})}await x(o),await Promise.all(u),await E(o)($*1e3)},dispose:m}}
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{ADJUSTMENT_DEFAULTS as z,chartDrawing as L,EMU_PER_PT as v,presetPath as I,Pt as R}from"@allyhub-next/slides-core";export const SHAPE_ATTR="data-ak-shape",LINE_WIDTH=R(.75),SINGLE_SPACING=1.2,MIN_FONT_SCALE=.25;export function themeCss(e){const t={};for(const[i,o]of Object.entries(e.colors))t[`--ak-theme-${i}`]=o;return t["--ak-theme-major"]=$(e.fonts.major),t["--ak-theme-minor"]=$(e.fonts.minor),t["--ak-theme-major-ea"]=$(e.fonts.major_east_asian),t["--ak-theme-minor-ea"]=$(e.fonts.minor_east_asian),t}const $=e=>e.includes(",")||e.includes('"')?e:`"${e}", "Noto Sans SC", sans-serif`;export const colorCss=e=>e==null?"transparent":typeof e=="string"?`var(--ak-theme-${e})`:e.rgb;const C=e=>e===void 0?void 0:e==="+mj-lt"?"var(--ak-theme-major)":e==="+mn-lt"?"var(--ak-theme-minor)":$(e),B={l:"left",ctr:"center",r:"right",just:"justify"},U={t:"flex-start",ctr:"center",b:"flex-end"},G=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\u2E80-\u2FDF\u3000-\u303F\uFF00-\uFFEF]/u,W=/[\u2018\u2019\u201C\u201D\u2026\u2014\u2013\u2025\u00B7]/u;export function eastAsianRuns(e,t){const i=[];for(const o of e){const n=G.test(o)||t&&W.test(o),d=i.at(-1);d?.ea===n?d.text+=o:i.push({text:o,ea:n})}return i}function M(e,t,i,o){if(!t)return;const n=C(t.name);n&&(e.style.fontFamily=n),t.size!==void 0&&(e.style.fontSize=`${String(t.size*i*o)}px`),t.bold!==void 0&&(e.style.fontWeight=t.bold?"700":"400"),t.italic!==void 0&&(e.style.fontStyle=t.italic?"italic":"normal"),(t.underline!==void 0||t.strike!==void 0||t.link)&&(e.style.textDecorationLine=[t.underline===!0||t.link!==void 0?"underline":"",t.strike===!0?"line-through":""].filter(d=>d!=="").join(" ")||"none"),t.highlight!==void 0&&(e.style.backgroundColor=t.highlight),t.baseline!==void 0&&t.baseline!==0&&(e.style.fontSize="0.66em",e.style.verticalAlign=`${String(t.baseline/.66)}em`),t.spacing!==void 0&&(e.style.letterSpacing=`${String(t.spacing*i*o)}px`),t.link!==void 0?e.style.color=colorCss("hlink"):t.rgb!==void 0?e.style.color=t.rgb:t.color!==void 0&&(e.style.color=colorCss(t.color))}function q(){if(document.getElementById("ak-bullet-style"))return;const e=document.createElement("style");e.id="ak-bullet-style",e.textContent="[data-ak-bullet]::before{content:attr(data-ak-bullet)}",document.head.append(e)}function J(e,t){const i=t[e.level]??t[0];if(!i)throw new Error("A text style has nine levels.");return{...i,...e.alignment===void 0?{}:{alignment:e.alignment},...e.line_spacing===void 0?{}:{line_spacing:e.line_spacing},...e.space_before===void 0?{}:{space_before:e.space_before},...e.space_after===void 0?{}:{space_after:e.space_after},...e.margin_left===void 0?{}:{margin_left:e.margin_left},...e.indent===void 0?{}:{indent:e.indent},...e.numbered===void 0?{}:{numbered:e.numbered},font:{...i.font,...e.font}}}export function numberText(e,t){const i=n=>(n>26?i(Math.floor((n-1)/26)):"")+String.fromCharCode(97+(n-1)%26),o=n=>{const d=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]];let a="",u=n;for(const[r,c]of d)for(;u>=r;)a+=c,u-=r;return a};return e==="arabicParenR"?`${String(t)})`:e==="alphaLcPeriod"?`${i(t)}.`:e==="alphaUcPeriod"?`${i(t).toUpperCase()}.`:e==="romanLcPeriod"?`${o(t)}.`:e==="romanUcPeriod"?`${o(t).toUpperCase()}.`:`${String(t)}.`}const K=e=>{const t=[...e?.link===void 0?[]:[`link="${e.link}"`],...e?.highlight===void 0?[]:[`highlight="${e.highlight}"`],...e?.baseline===void 0?[]:[`baseline="${String(e.baseline)}"`],...e?.strike===!0?['strike="true"']:[]];return t.length>0?t.join(" "):void 0};function F(e,t,i,o,n=!1){e.replaceChildren();const d=[];t.paragraphs.forEach((a,u)=>{const r=J(a,t.style.levels);d.length=a.level+1,r.numbered===void 0?d[a.level]=0:d[a.level]=(d[a.level]??0)+1;const c=document.createElement("div");c.dataset.akParagraph=String(u),c.dataset.akLevel=String(a.level);const l=r.font.size*i*o,s="lines"in r.line_spacing?String(r.line_spacing.lines*SINGLE_SPACING):`${String(r.line_spacing.fixed*i*o)}px`,f=a.runs.some(m=>m.text!==""&&m.text!=="\v")?r.bullet:void 0;Object.assign(c.style,{position:"relative",textAlign:B[r.alignment],paddingLeft:`${String(r.margin_left*i)}px`,textIndent:f?"0px":`${String(r.indent*i)}px`,marginTop:u===0?"0px":`${String(r.space_before*i*o)}px`,marginBottom:`${String(r.space_after*i*o)}px`,lineHeight:s,fontSize:`${String(l)}px`,minHeight:"lines"in r.line_spacing?`${String(l*r.line_spacing.lines*SINGLE_SPACING)}px`:s}),M(c,r.font,i,o);const b=r.numbered===void 0?f?.char:numberText(r.numbered,d[a.level]??1);if(b!==void 0){q();const m=document.createElement("span");m.dataset.akBullet=b,Object.assign(m.style,{position:"absolute",left:`${String((r.margin_left+r.indent)*i)}px`,...f?.font===void 0?{}:{fontFamily:C(f.font)}}),c.append(m)}for(const m of a.runs){const p=document.createElement("span");M(p,m.font,i,o);const x=m.font?.color??m.font?.rgb;x!==void 0&&(p.dataset.akColor=x);const y=K(m.font);y!==void 0&&(p.dataset.akAttrs=y),m.code?p.dataset.akCode="":m.font?.name!==void 0&&(p.dataset.akFont=m.font.name);const A=`var(--ak-theme-${(m.font?.name??r.font.name)==="+mj-lt"?"major":"minor"}-ea)`;for(const h of eastAsianRuns(m.text.replaceAll("\v",`
3
- `),n)){if(!h.ea){p.append(h.text);continue}const w=document.createElement("span");w.style.fontFamily=A,w.textContent=h.text,p.append(w)}c.append(p)}e.append(c)})}const _=e=>e!==void 0&&/^(zh|ja|ko)(-|$)/iu.test(e);function k(e,t,i){const{style:o}=e,n=o.auto_size==="shape",d=document.createElement("div");d.dataset.akText="",d.dataset.akAutofit=o.auto_size,Object.assign(d.style,{position:n?"relative":"absolute",inset:n?"auto":"0px",minHeight:"100%",display:"flex",flexDirection:"column",justifyContent:U[o.vertical_anchor],padding:`${String(o.margins.top*t)}px ${String(o.margins.right*t)}px ${String(o.margins.bottom*t)}px ${String(o.margins.left*t)}px`,whiteSpace:o.word_wrap?"pre-wrap":"pre",overflowWrap:"break-word",boxSizing:"border-box"});const a=document.createElement("div");return a.dataset.akBody="",d.append(a),F(a,e,t,1,i),d.akText=e,i&&(d.dataset.akCjk=""),d}export function fitText(e,t){const i=e.akText,o=e.querySelector("[data-ak-body]");if(!i||!o||e.dataset.akAutofit!=="text")return 1;const n=e.clientHeight-parseFloat(getComputedStyle(e).paddingTop)-parseFloat(getComputedStyle(e).paddingBottom),d=r=>(F(o,i,t,r,e.dataset.akCjk!==void 0),o.scrollHeight<=n+.5);if(d(1))return 1;let a=MIN_FONT_SCALE,u=1;if(!d(a))return a;for(;u-a>.01;){const r=(a+u)/2;d(r)?a=r:u=r}return d(a),e.dataset.akFontScale=a.toFixed(2),a}function V(e,t,i,o){const n=t.frame.width*i,d=t.frame.height*i,a=t.flip?.h?n:0,u=t.flip?.v?d:0,r="http://www.w3.org/2000/svg",c=document.createElementNS(r,"svg");c.setAttribute("width",String(Math.max(n,1))),c.setAttribute("height",String(Math.max(d,1))),Object.assign(c.style,{position:"absolute",left:"0px",top:"0px",overflow:"visible"});const l=n-a,s=d-u,g=colorCss(t.line??"accent1"),f=h=>h===void 0||h==="none"||h==="arrow"?0:o*1.5,b=Math.hypot(l-a,s-u)||1,m=(l-a)/b,p=(s-u)/b,x=f(t.line_begin),y=f(t.line_end),S=document.createElementNS(r,"line");S.setAttribute("x1",String(a+m*x)),S.setAttribute("y1",String(u+p*x)),S.setAttribute("x2",String(l-m*y)),S.setAttribute("y2",String(s-p*y)),S.setAttribute("stroke",g),S.setAttribute("stroke-width",String(o));const A=N(t.line_dash,o);A&&S.setAttribute("stroke-dasharray",A),c.append(S);for(const[h,w,D,H,P]of[[t.line_begin,a,u,-m,-p],[t.line_end,l,s,m,p]]){const j=Q(h,w,D,H,P,o,g);j&&c.append(j)}e.append(c)}const Z={sysDash:[3,1],sysDot:[1,1],dash:[4,3],dashDot:[4,3,1,3],lgDash:[8,3],lgDashDot:[8,3,1,3],lgDashDotDot:[8,3,1,3,1,3]},N=(e,t)=>e&&Z[e]?.map(i=>String(i*t)).join(" ");function Q(e,t,i,o,n,d,a){if(e===void 0||e==="none")return;const u="http://www.w3.org/2000/svg",r=d*3,c=(f,b)=>`${String(t-o*f-n*b)},${String(i-n*f+o*b)}`;if(e==="oval"){const f=document.createElementNS(u,"circle");return f.setAttribute("cx",String(t)),f.setAttribute("cy",String(i)),f.setAttribute("r",String(r/2)),f.setAttribute("fill",a),f}const l=e==="arrow",s=document.createElementNS(u,l?"polyline":"polygon"),g={triangle:[c(0,0),c(r,r/2),c(r,-r/2)],stealth:[c(0,0),c(r,r/2),c(r*.7,0),c(r,-r/2)],diamond:[c(-r/2,0),c(0,r/2),c(r/2,0),c(0,-r/2)],arrow:[c(r,r/2),c(0,0),c(r,-r/2)]}[e];return s.setAttribute("points",g.join(" ")),l?(s.setAttribute("fill","none"),s.setAttribute("stroke",a),s.setAttribute("stroke-width",String(d))):s.setAttribute("fill",a),s}function X(e,t,i,o){const n=t.path;if(!n)return;const d=t.frame.width*i,a=t.frame.height*i,u=n.w===0?0:d/n.w,r=n.h===0?0:a/n.h,c=n.steps.map(f=>f.op==="close"?"Z":f.op==="move"?`M${String(f.x*u)} ${String(f.y*r)}`:f.op==="line"?`L${String(f.x*u)} ${String(f.y*r)}`:`C${String(f.x1*u)} ${String(f.y1*r)} ${String(f.x2*u)} ${String(f.y2*r)} ${String(f.x*u)} ${String(f.y*r)}`).join(""),l="http://www.w3.org/2000/svg",s=document.createElementNS(l,"svg");s.setAttribute("width",String(Math.max(d,1))),s.setAttribute("height",String(Math.max(a,1))),Object.assign(s.style,{position:"absolute",left:"0px",top:"0px",overflow:"visible"});const g=document.createElementNS(l,"path");if(g.setAttribute("d",c),g.setAttribute("fill-rule","evenodd"),g.setAttribute("fill",colorCss(t.fill)),t.fill_transparency!==void 0&&g.setAttribute("fill-opacity",String(1-t.fill_transparency)),t.gradient){const f=`ak-gradient-${String(tt++)}`;s.append(et(l,f,t.gradient,t.frame)),g.setAttribute("fill",`url(#${f})`)}if(t.line!==void 0&&t.line!==null){g.setAttribute("stroke",colorCss(t.line)),g.setAttribute("stroke-width",String(o));const f=N(t.line_dash,o);f&&g.setAttribute("stroke-dasharray",f)}s.append(g),e.append(s)}const E=(e,t)=>t===void 0||t===0?colorCss(e):`color-mix(in srgb, ${colorCss(e)} ${String((1-t)*100)}%, transparent)`,Y=e=>`linear-gradient(${String(e.angle+90)}deg, ${e.stops.map(t=>`${E(t.color,t.transparency)} ${String(t.at*100)}%`).join(", ")})`,O=e=>e.gradient?Y(e.gradient):e.fill===null||e.fill===void 0?"transparent":E(e.fill,e.fill_transparency);let tt=0;function et(e,t,i,o){const n=document.createElementNS(e,"linearGradient");n.id=t;const d=i.angle*Math.PI/180,a=Math.cos(d),u=Math.sin(d),r=(Math.abs(o.width*a)+Math.abs(o.height*u))/Math.max(o.width,o.height,1)/2;n.setAttribute("x1",String(.5-a*r)),n.setAttribute("y1",String(.5-u*r)),n.setAttribute("x2",String(.5+a*r)),n.setAttribute("y2",String(.5+u*r));for(const c of i.stops){const l=document.createElementNS(e,"stop");l.setAttribute("offset",String(c.at)),l.setAttribute("stop-color",colorCss(c.color)),c.transparency!==void 0&&l.setAttribute("stop-opacity",String(1-c.transparency)),n.append(l)}return n}function nt(e,t,i){const o=t.angle*Math.PI/180,n=t.distance*i;e.style.filter=`drop-shadow(${String(n*Math.cos(o))}px ${String(n*Math.sin(o))}px ${String(t.blur*i)}px ${E(t.color,t.transparency)})`}function it(e,t,i){const o=t.geometry??"rect",n=t.frame.width*i,d=t.frame.height*i;o==="roundRect"?e.style.borderRadius=`${String(Math.min(n,d)*Math.min(.5,Math.max(0,t.adjustments?.[0]??z.roundRect?.[0]??0)))}px`:o==="ellipse"&&(e.style.borderRadius="50%")}const ot={left:"borderLeft",right:"borderRight",top:"borderTop",bottom:"borderBottom"},T="http://www.w3.org/2000/svg";function rt(e,t,i,o){const n=i.width/v,d=i.height/v,a=o*v,u=L(t,n,d),r=document.createElementNS(T,"svg");r.setAttribute("viewBox",`0 0 ${String(n)} ${String(d)}`),r.setAttribute("width","100%"),r.setAttribute("height","100%"),Object.assign(r.style,{position:"absolute",inset:"0px",overflow:"visible"});const c=(s,g)=>{const f=document.createElementNS(T,s);for(const[b,m]of Object.entries(g))f.setAttribute(b,String(m));r.append(f)},l=s=>{c("path",{d:s.d,fill:s.fill===void 0?"none":colorCss(s.fill),stroke:s.width>0?colorCss(s.color):"none","stroke-width":s.width,"stroke-linejoin":"round"})};for(const s of[...u.grid,...u.shapes])l(s);for(const s of[...u.boxes,...u.keys])c("rect",{x:s.x,y:s.y,width:s.width,height:s.height,fill:colorCss(s.color)});for(const s of[...u.axes,...u.lines])l(s);for(const s of u.dots)c("circle",{cx:s.x,cy:s.y,r:s.r,fill:colorCss(s.color)});e.append(r);for(const s of u.words){const g=document.createElement("div");g.textContent=s.text,Object.assign(g.style,{position:"absolute",left:`${String(s.x*a)}px`,top:`${String(s.y*a)}px`,transform:`translate(${{start:"0",middle:"-50%",end:"-100%"}[s.anchor]}, -50%)`,fontSize:`${String(s.size*a)}px`,lineHeight:"1",whiteSpace:"nowrap",color:colorCss(s.color),fontFamily:"var(--ak-theme-minor)"}),e.append(g)}}function st(e,t,i,o){const n=document.createElement("table");Object.assign(n.style,{borderCollapse:"collapse",tableLayout:"fixed",width:`${String(t.columns.reduce((a,u)=>a+u,0)*i)}px`});const d=document.createElement("colgroup");for(const a of t.columns){const u=document.createElement("col");u.style.width=`${String(a*i)}px`,d.append(u)}n.append(d);for(const[a,u]of t.rows.entries()){const r=document.createElement("tr");r.style.height=`${String(u.height*i)}px`;for(const[c,l]of u.cells.entries()){if(l.spanned)continue;const s=document.createElement("td");s.dataset.akCell=`${String(a)},${String(c)}`,l.span_width&&(s.colSpan=l.span_width),l.span_height&&(s.rowSpan=l.span_height),s.style.padding="0px",s.style.verticalAlign={t:"top",ctr:"middle",b:"bottom"}[l.text.style.vertical_anchor],l.fill!==void 0&&(s.style.background=colorCss(l.fill));for(const[f,b]of Object.entries(ot)){const m=l.borders?.[f];m&&(s.style[b]=`${String(m.width*i)}px solid ${colorCss(m.color)}`)}const g=k(l.text,i,o);g.style.minHeight="0px",s.append(g),r.append(s)}n.append(r)}e.style.height="auto",e.append(n)}export function drawShape(e,t,i){const{k:o}=i;if(t.kind==="placeholder"&&t.text?.empty===!0&&!i.editing)return;const n=document.createElement("div");n.setAttribute(SHAPE_ATTR,`${e}/${t.name}`);const{left:d,top:a,width:u,height:r}=t.frame;Object.assign(n.style,{position:"absolute",left:`${String(d*o)}px`,top:`${String(a*o)}px`,width:`${String(u*o)}px`,height:`${String(r*o)}px`}),t.rotation!==void 0&&(n.style.transform=`rotate(${String(t.rotation)}deg)`);const c=(t.line_width??LINE_WIDTH)*o;if(t.chart)rt(n,t.chart,t.frame,o);else if(t.table)return st(n,t.table,o,_(i.lang)),n;if(t.shadow&&nt(n,t.shadow,o),t.kind==="autoshape"){if(t.geometry==="line")return V(n,t,o,c),n;const l=t.path??I(t.geometry,t.frame.width,t.frame.height);if(l)return X(n,{...t,path:l},o,c),t.text&&n.append(k(t.text,o,_(i.lang))),n;n.style.background=O(t),it(n,t,o)}else(t.fill!==void 0||t.gradient)&&(n.style.background=O(t));if(t.line!==void 0&&t.line!==null&&(n.style.outline=`${String(c)}px ${t.line_dash===void 0||t.line_dash==="solid"?"solid":"dashed"} ${colorCss(t.line)}`),t.text?.style.auto_size==="shape"&&(n.style.height="auto",n.style.minHeight="0px",t.text.style.word_wrap||(n.style.width="max-content")),t.kind==="picture"&&t.media){n.style.overflow="hidden";const l=document.createElement("img");l.alt="",l.src=i.url(t.media.path);const s=t.media.crop??{left:0,top:0,right:0,bottom:0},g=1-s.left-s.right,f=1-s.top-s.bottom;Object.assign(l.style,{position:"absolute",width:`${String(100/g)}%`,height:`${String(100/f)}%`,left:`${String(-s.left/g*100)}%`,top:`${String(-s.top/f*100)}%`,maxWidth:"none"}),n.append(l)}else if(t.kind==="movie"&&t.media&&!i.playing)n.dataset.akFilm="";else if(t.kind==="movie"&&t.media){const l=document.createElement("video");l.src=i.url(t.media.path),l.muted=!0,l.playsInline=!0,l.preload="auto",t.media.poster!==void 0&&(l.currentTime=t.media.poster),Object.assign(l.style,{width:"100%",height:"100%",objectFit:"fill"}),n.append(l)}return t.text&&n.append(k(t.text,o,_(i.lang))),n}export function drawSlide(e,t){const i=document.createElement("div");i.dataset.akSlide=e.id,Object.assign(i.style,{position:"absolute",inset:"0px",background:colorCss(e.background),overflow:"hidden"});for(const o of e.shapes){const n=drawShape(e.id,o,t);n&&i.append(n)}return i}
2
+ import{adjustmentDefaults as P,chartDrawing as z,colorRgb as I,CONNECTOR_STYLE as B,EMU_PER_PT as v,isConnectorGeometry as G,Pt as U,runLang as Z}from"@allyhub-next/slides-core";import{presetOutline as C}from"@allyhub-next/ooxml/geometry";export const SHAPE_ATTR="data-ak-shape",LINE_WIDTH=U(.75),SINGLE_SPACING=1.2,MIN_FONT_SCALE=.25;export function themeCss(e){const t={};for(const[i,r]of Object.entries(e.colors))t[`--ak-theme-${i}`]=r;return t["--ak-theme-major"]=y(e.fonts.major),t["--ak-theme-minor"]=y(e.fonts.minor),t["--ak-theme-major-ea"]=y(e.fonts.major_east_asian),t["--ak-theme-minor-ea"]=y(e.fonts.minor_east_asian),t}const y=e=>e.includes(",")||e.includes('"')?e:`"${e}", "Noto Sans SC", sans-serif`;export const colorCss=(e,t)=>e==null?"transparent":I(e,t);const O=e=>e===void 0?void 0:e==="+mj-lt"?"var(--ak-theme-major)":e==="+mn-lt"?"var(--ak-theme-minor)":y(e),W={l:"left",ctr:"center",r:"right",just:"justify"},q={t:"flex-start",ctr:"center",b:"flex-end"},J=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\u2E80-\u2FDF\u3000-\u303F\uFF00-\uFFEF]/u,K=/[\u2018\u2019\u201C\u201D\u2026\u2014\u2013\u2025\u00B7]/u;export function eastAsianRuns(e,t){const i=[];for(const r of e){const n=J.test(r)||t&&K.test(r),o=i.at(-1);o?.ea===n?o.text+=r:i.push({text:r,ea:n})}return i}const x=e=>`calc(${String(e)}px * var(--ak-fit, 1))`;function M(e,t,i,r){if(!t)return;const n=O(t.name);n&&(e.style.fontFamily=n),t.size!==void 0&&(e.style.fontSize=x(t.size*i)),t.bold!==void 0&&(e.style.fontWeight=t.bold?"700":"400"),t.italic!==void 0&&(e.style.fontStyle=t.italic?"italic":"normal"),(t.underline!==void 0||t.strike!==void 0||t.link)&&(e.style.textDecorationLine=[t.underline===!0||t.link!==void 0?"underline":"",t.strike===!0?"line-through":""].filter(o=>o!=="").join(" ")||"none"),t.highlight!==void 0&&(e.style.backgroundColor=t.highlight),t.baseline!==void 0&&t.baseline!==0&&(e.style.fontSize="0.66em",e.style.verticalAlign=`${String(t.baseline/.66)}em`),t.spacing!==void 0&&(e.style.letterSpacing=x(t.spacing*i)),t.link!==void 0?e.style.color=colorCss("hlink",r):t.color!==void 0&&(e.style.color=colorCss(t.color,r))}function V(){if(document.getElementById("ak-bullet-style"))return;const e=document.createElement("style");e.id="ak-bullet-style",e.textContent="[data-ak-bullet]::before{content:attr(data-ak-bullet)}",document.head.append(e)}export function paragraphStyle(e,t){const i=t[e.level]??t[0];if(!i)throw new Error("A text style has nine levels.");return{...i,...e.alignment===void 0?{}:{alignment:e.alignment},...e.line_spacing===void 0?{}:{line_spacing:e.line_spacing},...e.space_before===void 0?{}:{space_before:e.space_before},...e.space_after===void 0?{}:{space_after:e.space_after},...e.margin_left===void 0?{}:{margin_left:e.margin_left},...e.indent===void 0?{}:{indent:e.indent},...e.numbered===void 0?{}:{numbered:e.numbered},font:{...i.font,...e.font}}}export function numberText(e,t){const i=n=>(n>26?i(Math.floor((n-1)/26)):"")+String.fromCharCode(97+(n-1)%26),r=n=>{const o=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]];let s="",a=n;for(const[u,d]of o)for(;a>=u;)s+=d,a-=u;return s};return e==="arabicParenR"?`${String(t)})`:e==="alphaLcPeriod"?`${i(t)}.`:e==="alphaUcPeriod"?`${i(t).toUpperCase()}.`:e==="romanLcPeriod"?`${r(t)}.`:e==="romanUcPeriod"?`${r(t).toUpperCase()}.`:`${String(t)}.`}export function paragraphLabels(e,t){const i=[];return e.map(r=>{const n=paragraphStyle(r,t);i.length=r.level+1,n.numbered===void 0?i[r.level]=0:i[r.level]=(i[r.level]??0)+1;const o=r.runs.some(s=>s.text!==""&&s.text!=="\v");return n.numbered===void 0?o?n.bullet?.char:void 0:numberText(n.numbered,i[r.level]??1)})}export function paragraphElement(e,t,i,r,n,o){const s=paragraphStyle(e,i),a=document.createElement("div");a.dataset.akParagraph=String(t),a.dataset.akLevel=String(e.level);const u=s.font.size*n,d="lines"in s.line_spacing?String(s.line_spacing.lines*SINGLE_SPACING):x(s.line_spacing.fixed*n),f=s.numbered===void 0&&r!==void 0;if(Object.assign(a.style,{position:"relative",textAlign:W[s.alignment],paddingLeft:`${String(s.margin_left*n)}px`,textIndent:f?"0px":`${String(s.indent*n)}px`,marginTop:t===0?"0px":x(s.space_before*n),marginBottom:x(s.space_after*n),lineHeight:d,fontSize:x(u),minHeight:"lines"in s.line_spacing?x(u*s.line_spacing.lines*SINGLE_SPACING):d}),M(a,s.font,n,o),r!==void 0){V();const c=document.createElement("span");c.dataset.akBullet=r;const l=s.numbered===void 0?s.bullet?.font:void 0;Object.assign(c.style,{position:"absolute",left:`${String((s.margin_left+s.indent)*n)}px`,...l===void 0?{}:{fontFamily:O(l)}}),a.append(c)}return a}export const exactSpacing=(e,t)=>!("lines"in paragraphStyle(e,t).line_spacing);export function runElement(e,t,i,r=!1,n){const o=document.createElement("span");M(o,e.font,t,i);const s=e.text===void 0?n:Z(e.text,n);return s!==void 0&&s!==n&&(o.lang=s),r&&(o.style.lineHeight="0"),e.font?.link!==void 0&&(o.dataset.akLink=e.font.link),o}export function eastAsianFace(e,t){return`var(--ak-theme-${(e.font?.name??t)==="+mj-lt"?"major":"minor"}-ea)`}function Y(e,t,i,r,n){const o=isCjk(r);e.replaceChildren();const s=paragraphLabels(t.paragraphs,t.style.levels);t.paragraphs.forEach((a,u)=>{const d=paragraphElement(a,u,t.style.levels,s[u],i,n),f=paragraphStyle(a,t.style.levels).font.name,c=exactSpacing(a,t.style.levels);for(const l of a.runs){const g=runElement(l,i,n,c,r),m=eastAsianFace(l,f);for(const b of eastAsianRuns(l.text.replaceAll("\v",`
3
+ `),o)){if(!b.ea){g.append(b.text);continue}const p=document.createElement("span");p.style.fontFamily=m,p.textContent=b.text,g.append(p)}d.append(g)}e.append(d)})}export const isCjk=e=>e!==void 0&&/^(zh|ja|ko)(-|$)/iu.test(e);function k(e,t,i,r){const{style:n}=e,o=n.auto_size==="shape",s=document.createElement("div");s.dataset.akText="",s.dataset.akAutofit=n.auto_size,Object.assign(s.style,{position:o?"relative":"absolute",inset:o?"auto":"0px",minHeight:"100%",display:"flex",flexDirection:"column",justifyContent:q[n.vertical_anchor],padding:`${String(n.margins.top*t)}px ${String(n.margins.right*t)}px ${String(n.margins.bottom*t)}px ${String(n.margins.left*t)}px`,whiteSpace:n.word_wrap?"pre-wrap":"pre",overflowWrap:"break-word",boxSizing:"border-box"});const a=document.createElement("div");return a.dataset.akBody="",s.append(a),Y(a,e,t,i,r),i!==void 0&&(s.lang=i),isCjk(i)&&(s.dataset.akCjk=""),s}export function fitText(e){const t=e.querySelector("[data-ak-body]");if(!t||e.dataset.akAutofit!=="text")return 1;const i=e.clientHeight-parseFloat(getComputedStyle(e).paddingTop)-parseFloat(getComputedStyle(e).paddingBottom),r=s=>(e.style.setProperty("--ak-fit",String(s)),t.scrollHeight<=i+.5);if(r(1))return delete e.dataset.akFontScale,1;let n=MIN_FONT_SCALE,o=1;if(!r(n))return e.dataset.akFontScale=n.toFixed(2),n;for(;o-n>.01;){const s=(n+o)/2;r(s)?n=s:o=s}return r(n),e.dataset.akFontScale=n.toFixed(2),n}function Q(e,t,i,r){const n=e.split(" "),o=[],s=a=>{const u=Number(n[a]),d=Number(n[a+1]);return[r?.h?t-u:u,r?.v?i-d:d]};for(let a=0;a<n.length;){const u=n[a++];u==="M"||u==="L"?(o.push({op:u,at:[s(a)]}),a+=2):u==="C"?(o.push({op:u,at:[s(a),s(a+2),s(a+4)]}),a+=6):u==="Z"&&o.push({op:u})}return o}const X=e=>e.map(t=>t.op==="Z"?"Z":`${t.op}${t.at.map(([i,r])=>`${String(i)} ${String(r)}`).join(" ")}`).join(" ");function tt(e,t){const i=e.flatMap(o=>o.op==="Z"?[]:o.at),r=t?[...i].reverse():i,n=r[0];if(n)for(const o of r.slice(1)){const s=Math.hypot(n[0]-o[0],n[1]-o[1]);if(s>1e-6)return{at:n,out:[(n[0]-o[0])/s,(n[1]-o[1])/s]}}}function et(e,t,i,r){const n=e.filter(a=>a.op!=="Z"),o=t?n[n.length-1]:n[0];if(!o)return;const s=t?o.at.slice(o.op==="C"?-2:-1):[...o.at,...n[1]?.op==="C"?n[1].at.slice(0,1):[]];for(const a of s)a[0]+=i,a[1]+=r}function nt(e,t,i,r,n){if(t.line===null)return;const o=t.frame.width*i,s=t.frame.height*i,a=(C(t.geometry??"line",o,s,t.adjustments)?.paths??[]).filter(p=>p.stroke).map(p=>Q(p.d,o,s,t.flip)),u=a[0],d=a[a.length-1];if(!u||!d)return;const f="http://www.w3.org/2000/svg",c=document.createElementNS(f,"svg");c.setAttribute("width",String(Math.max(o,1))),c.setAttribute("height",String(Math.max(s,1))),Object.assign(c.style,{position:"absolute",left:"0px",top:"0px",overflow:"visible"});const l=colorCss(t.line??B.line,n),g=Math.max(r,ot*i),m=p=>p===void 0||p==="none"||p==="arrow"?0:g*1.5,b=[];for(const[p,S,h]of[[t.line_begin,u,!1],[t.line_end,d,!0]]){const w=tt(S,h);if(!w)continue;const[T,R]=w.at,[A,E]=w.out,j=rt(p,T,R,A,E,r,g,l);j&&b.push(j);const $=m(p);$>0&&et(S,h,-A*$,-E*$)}for(const p of a){const S=document.createElementNS(f,"path");S.setAttribute("d",X(p)),S.setAttribute("fill","none"),S.setAttribute("stroke",l),S.setAttribute("stroke-width",String(r));const h=F(t.line_dash,r);h&&S.setAttribute("stroke-dasharray",h),c.append(S)}c.append(...b),e.append(c)}const it={sysDash:[3,1],sysDot:[1,1],dash:[4,3],dashDot:[4,3,1,3],lgDash:[8,3],lgDashDot:[8,3,1,3],lgDashDotDot:[8,3,1,3,1,3]},F=(e,t)=>e&&it[e]?.map(i=>String(i*t)).join(" "),ot=25200;function rt(e,t,i,r,n,o,s,a){if(e===void 0||e==="none")return;const u="http://www.w3.org/2000/svg",d=s*(e==="arrow"?3.5:3),f=(m,b)=>`${String(t-r*m-n*b)},${String(i-n*m+r*b)}`;if(e==="oval"){const m=document.createElementNS(u,"circle");return m.setAttribute("cx",String(t)),m.setAttribute("cy",String(i)),m.setAttribute("r",String(d/2)),m.setAttribute("fill",a),m}const c=e==="arrow",l=document.createElementNS(u,c?"polyline":"polygon"),g={triangle:[f(0,0),f(d,d/2),f(d,-d/2)],stealth:[f(0,0),f(d,d/2),f(d*.7,0),f(d,-d/2)],diamond:[f(-d/2,0),f(0,d/2),f(d/2,0),f(0,-d/2)],arrow:[f(d,d/2),f(0,0),f(d,-d/2)]}[e];return l.setAttribute("points",g.join(" ")),c?(l.setAttribute("fill","none"),l.setAttribute("stroke",a),l.setAttribute("stroke-width",String(o))):l.setAttribute("fill",a),l}function st(e,t,i,r,n,o){const s=t.frame.width*r,a=t.frame.height*r,u="http://www.w3.org/2000/svg",d=document.createElementNS(u,"svg");d.setAttribute("width",String(Math.max(s,1))),d.setAttribute("height",String(Math.max(a,1))),Object.assign(d.style,{position:"absolute",left:"0px",top:"0px",overflow:"visible"}),N(d,t);let f=colorCss(t.fill,o);if(t.gradient){const c=`ak-gradient-${String(dt++)}`;d.append(ut(u,c,t.gradient,t.frame,o)),f=`url(#${c})`}for(const c of i){const l=document.createElementNS(u,"path");if(l.setAttribute("d",c.d),l.setAttribute("fill-rule","evenodd"),l.setAttribute("fill",c.fill==="none"||t.fill===null||t.fill===void 0?c.fill==="none"||!t.gradient?"none":f:c.fill==="norm"?f:lt[c.fill](colorCss(t.fill,o))),t.fill_transparency!==void 0&&l.setAttribute("fill-opacity",String(1-t.fill_transparency)),c.stroke&&t.line!==void 0&&t.line!==null){l.setAttribute("stroke",colorCss(t.line,o)),l.setAttribute("stroke-width",String(n)),l.setAttribute("stroke-linejoin","round");const g=F(t.line_dash,n);g&&l.setAttribute("stroke-dasharray",g)}d.append(l)}e.append(d)}const lt={darken:e=>`color-mix(in srgb, ${e} 60%, black)`,darkenLess:e=>`color-mix(in srgb, ${e} 80%, black)`,lighten:e=>`color-mix(in srgb, ${e} 60%, white)`,lightenLess:e=>`color-mix(in srgb, ${e} 80%, white)`};function at(e,t){const i=e.path;if(!i)return[];const r=i.w===0?0:e.frame.width*t/i.w,n=i.h===0?0:e.frame.height*t/i.h;return[{d:i.steps.map(s=>s.op==="close"?"Z":s.op==="move"?`M${String(s.x*r)} ${String(s.y*n)}`:s.op==="line"?`L${String(s.x*r)} ${String(s.y*n)}`:`C${String(s.x1*r)} ${String(s.y1*n)} ${String(s.x2*r)} ${String(s.y2*n)} ${String(s.x*r)} ${String(s.y*n)}`).join(""),fill:"norm",stroke:!0}]}function N(e,t){!t.flip?.h&&!t.flip?.v||(e.style.transform=`scale(${t.flip.h?"-1":"1"}, ${t.flip.v?"-1":"1"})`)}const ct=new Set(["rect","roundRect","ellipse"]),_=(e,t,i)=>t===void 0||t===0?colorCss(e,i):`color-mix(in srgb, ${colorCss(e,i)} ${String((1-t)*100)}%, transparent)`,D=(e,t)=>`linear-gradient(${String(e.angle+90)}deg, ${e.stops.map(i=>`${_(i.color,i.transparency,t)} ${String(i.at*100)}%`).join(", ")})`,H=(e,t)=>e.gradient?D(e.gradient,t):e.fill===null||e.fill===void 0?"transparent":_(e.fill,e.fill_transparency,t);let dt=0;function ut(e,t,i,r,n){const o=document.createElementNS(e,"linearGradient");o.id=t;const s=i.angle*Math.PI/180,a=Math.cos(s),u=Math.sin(s),d=(Math.abs(r.width*a)+Math.abs(r.height*u))/Math.max(r.width,r.height,1)/2;o.setAttribute("x1",String(.5-a*d)),o.setAttribute("y1",String(.5-u*d)),o.setAttribute("x2",String(.5+a*d)),o.setAttribute("y2",String(.5+u*d));for(const f of i.stops){const c=document.createElementNS(e,"stop");c.setAttribute("offset",String(f.at)),c.setAttribute("stop-color",colorCss(f.color,n)),f.transparency!==void 0&&c.setAttribute("stop-opacity",String(1-f.transparency)),o.append(c)}return o}function ft(e,t,i,r){const n=t.angle*Math.PI/180,o=t.distance*i;e.style.filter=`drop-shadow(${String(o*Math.cos(n))}px ${String(o*Math.sin(n))}px ${String(t.blur*i)}px ${_(t.color,t.transparency,r)})`}function gt(e,t,i){const r=t.geometry??"rect",n=t.frame.width*i,o=t.frame.height*i;r==="roundRect"?e.style.borderRadius=`${String(Math.min(n,o)*Math.min(.5,Math.max(0,t.adjustments?.[0]??P("roundRect")[0]??0)))}px`:r==="ellipse"&&(e.style.borderRadius="50%")}const mt={left:"borderLeft",right:"borderRight",top:"borderTop",bottom:"borderBottom"},L="http://www.w3.org/2000/svg";function pt(e,t,i,r,n){const o=i.width/v,s=i.height/v,a=r*v,u=z(t,o,s),d=document.createElementNS(L,"svg");d.setAttribute("viewBox",`0 0 ${String(o)} ${String(s)}`),d.setAttribute("width","100%"),d.setAttribute("height","100%"),Object.assign(d.style,{position:"absolute",inset:"0px",overflow:"visible"});const f=(l,g)=>{const m=document.createElementNS(L,l);for(const[b,p]of Object.entries(g))m.setAttribute(b,String(p));d.append(m)},c=l=>{f("path",{d:l.d,fill:l.fill===void 0?"none":colorCss(l.fill,n),stroke:l.width>0?colorCss(l.color,n):"none","stroke-width":l.width,"stroke-linejoin":"round"})};for(const l of[...u.grid,...u.shapes])c(l);for(const l of[...u.boxes,...u.keys])f("rect",{x:l.x,y:l.y,width:l.width,height:l.height,fill:colorCss(l.color,n)});for(const l of[...u.axes,...u.lines])c(l);for(const l of u.dots)f("circle",{cx:l.x,cy:l.y,r:l.r,fill:colorCss(l.color,n)});e.append(d);for(const l of u.words){const g=document.createElement("div");g.textContent=l.text,Object.assign(g.style,{position:"absolute",left:`${String(l.x*a)}px`,top:`${String(l.y*a)}px`,transform:`translate(${{start:"0",middle:"-50%",end:"-100%"}[l.anchor]}, -50%)`,fontSize:`${String(l.size*a)}px`,lineHeight:"1",whiteSpace:"nowrap",color:colorCss(l.color,n),fontFamily:"var(--ak-theme-minor)"}),e.append(g)}}function bt(e,t,i,r,n){const o=document.createElement("table");Object.assign(o.style,{borderCollapse:"collapse",tableLayout:"fixed",width:`${String(t.columns.reduce((a,u)=>a+u,0)*i)}px`});const s=document.createElement("colgroup");for(const a of t.columns){const u=document.createElement("col");u.style.width=`${String(a*i)}px`,s.append(u)}o.append(s);for(const[a,u]of t.rows.entries()){const d=document.createElement("tr");d.style.height=`${String(u.height*i)}px`;for(const[f,c]of u.cells.entries()){if(c.spanned)continue;const l=document.createElement("td");l.dataset.akCell=`${String(a)},${String(f)}`,c.span_width&&(l.colSpan=c.span_width),c.span_height&&(l.rowSpan=c.span_height),l.style.padding="0px",l.style.verticalAlign={t:"top",ctr:"middle",b:"bottom"}[c.text.style.vertical_anchor],c.fill!==void 0&&(l.style.background=colorCss(c.fill,n));for(const[m,b]of Object.entries(mt)){const p=c.borders?.[m];p&&(l.style[b]=`${String(p.width*i)}px solid ${colorCss(p.color,n)}`)}const g=k(c.text,i,r,n);g.style.minHeight="0px",l.append(g),d.append(l)}o.append(d)}e.style.height="auto",e.append(o)}export function drawShape(e,t,i){const{k:r,colors:n}=i;if(t.kind==="placeholder"&&t.text?.empty===!0&&!i.editing)return;const o=document.createElement("div");o.setAttribute(SHAPE_ATTR,`${e}/${t.name}`);const{left:s,top:a,width:u,height:d}=t.frame;Object.assign(o.style,{position:"absolute",left:`${String(s*r)}px`,top:`${String(a*r)}px`,width:`${String(u*r)}px`,height:`${String(d*r)}px`}),t.rotation!==void 0&&(o.style.transform=`rotate(${String(t.rotation)}deg)`);const f=(t.line_width??LINE_WIDTH)*r;if(t.chart)pt(o,t.chart,t.frame,r,n);else if(t.table)return bt(o,t.table,r,i.lang,n),o;if(t.shadow&&ft(o,t.shadow,r,n),t.alt!==void 0&&o.setAttribute("aria-label",t.alt),t.kind==="autoshape"){if(!t.path&&G(t.geometry))return nt(o,t,r,f,n),o;const c=t.path?at(t,r):ct.has(t.geometry??"rect")?void 0:C(t.geometry??"rect",t.frame.width*r,t.frame.height*r,t.adjustments)?.paths;if(c)return st(o,t,c,r,f,n),t.text&&o.append(k(t.text,r,i.lang,n)),o;o.style.background=H(t,n),gt(o,t,r)}else(t.fill!==void 0||t.gradient)&&(o.style.background=H(t,n));if(t.line!==void 0&&t.line!==null&&(o.style.outline=`${String(f)}px ${t.line_dash===void 0||t.line_dash==="solid"?"solid":"dashed"} ${colorCss(t.line,n)}`),t.text?.style.auto_size==="shape"&&(o.style.height="auto",o.style.minHeight="0px",t.text.style.word_wrap||(o.style.width="max-content")),t.kind==="picture"&&t.media){o.style.overflow="hidden";const c=document.createElement("img");c.alt=t.alt??"",c.src=i.url(t.media.path),N(c,t);const l=t.media.crop??{left:0,top:0,right:0,bottom:0},g=1-l.left-l.right,m=1-l.top-l.bottom;Object.assign(c.style,{position:"absolute",width:`${String(100/g)}%`,height:`${String(100/m)}%`,left:`${String(-l.left/g*100)}%`,top:`${String(-l.top/m*100)}%`,maxWidth:"none"}),t.flip&&(c.style.transformOrigin=`${String(50/g-l.left/g*100)}% ${String(50/m-l.top/m*100)}%`),o.append(c)}else if(t.kind==="movie"&&t.media&&!i.playing)o.dataset.akFilm="";else if(t.kind==="movie"&&t.media){const c=document.createElement("video");c.src=i.url(t.media.path),c.muted=!0,c.playsInline=!0,c.preload="auto",t.media.poster!==void 0&&(c.currentTime=t.media.poster),Object.assign(c.style,{width:"100%",height:"100%",objectFit:"fill"}),o.append(c)}return t.text&&o.append(k(t.text,r,i.lang,n)),o}export function drawSlide(e,t){const i=document.createElement("div");i.dataset.akSlide=e.id,Object.assign(i.style,{position:"absolute",inset:"0px",background:colorCss(e.background,t.colors),overflow:"hidden"}),e.background_gradient&&(i.style.background=D(e.background_gradient,t.colors)),e.background_picture!==void 0&&(i.style.background=`${colorCss(e.background,t.colors)} url(${JSON.stringify(t.url(e.background_picture))}) center / 100% 100% no-repeat`);for(const r of e.shapes){const n=drawShape(e.id,r,t);n&&i.append(n)}return i}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export{DECK_FPS,SLIDE_SECONDS}from"@allyhub-next/slides-core";export{loadDeck}from"./load.js";export{drawShape,drawSlide,fitText,themeCss,colorCss,SHAPE_ATTR,LINE_WIDTH,SINGLE_SPACING,MIN_FONT_SCALE}from"./draw.js";
2
+ export{DECK_FPS,SLIDE_SECONDS}from"@allyhub-next/slides-core";export{deckCodeOf,loadDeck,SLIDES_KEPT}from"./load.js";export{componentStage}from"./component.js";export{drawShape,drawSlide,fitText,themeCss,colorCss,SHAPE_ATTR,LINE_WIDTH,SINGLE_SPACING,MIN_FONT_SCALE}from"./draw.js";
@@ -1,6 +1,6 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{LoadFailure as B,consoleAt as z,consoleAtAsync as Nt,createEnv as It,domHash as bt,inkOfBlock as Bt,loadTextFonts as Wt,pictureWaiter as Kt,realTimers as zt,textBlocks as St}from"@allyhub-next/runtime/stage";import{animationTargets as Gt,clockOf as Ut,DECK_FPS as q,drawnAt as Yt,morphFrame as Jt,transitionAt as Vt,EMU_PER_INCH as kt,EMU_PER_PT as $t,evaluateDeck as Qt,fontFace as nt,isDeck as Xt,resolveDeck as Zt,themeOfLook as te}from"@allyhub-next/slides-core";import{CLEAN_LOOK as ee,LAYER_BRAND as ne,SEEK_LIMIT as vt,countWords as oe,lookCss as se,measureMoment as ae,messagePrefix as ie,problem as ot}from"@allyhub-next/video-core";import{SLIDES_FILE as Mt}from"@allyhub-next/formats";import{drawSlide as re,fitText as ce,SHAPE_ATTR as D,themeCss as le}from"./draw.js";import{deckEditor as de}from"./edit.js";import{inkLines as pe,union as Et}from"./ink.js";export const SLIDE_LAYER="slide";const he=.5,fe=.3,At={top:0,bottom:0,left:0,right:0};async function me(i){i.muted=!1,await i.play().catch(async()=>{i.muted=!0,await i.play().catch(()=>{})})}function ue(i){const $=p=>{if(i.peek(p)!==void 0)return i.s(p);const v=[...new Set(i.keysUnder(p).map(m=>m.slice(p.length+1).split(".")[0]).filter(m=>m!==void 0&&/^\d+$/u.test(m)))].sort((m,R)=>Number(m)-Number(R));if(v.length!==0)return v.map(m=>$(`${p}.${m}`)).filter(m=>m!==void 0)};return $}export async function loadDeck(i,$,p){const v=It(i,$),{log:m,ledger:R,guards:Pt}=v,[M,F]=i.format.split("x").map(Number);if(!(M>0&&F>0))throw new B("bad_format",`${i.piece} is drawn at ${i.format}: a deck's stage is WIDTHxHEIGHT pixels.`);for(const t of i.styles??[]){const e=document.createElement("link");e.rel="stylesheet",e.href=t;const n=new Promise(o=>{e.onload=o,e.onerror=o});document.head.append(e),await n}let st;try{st=await Nt({phase:"module"},()=>import(i.module))}catch(t){const e=t instanceof Error?t:new Error(String(t));throw new B("load_failed",`Failed to load the deck's module: ${e.message}
3
- ${e.stack??""}`)}const at=st.default;if(!Xt(at))throw new B("no_content",`The default export of ${i.file} is not a presentation({ … }) from @allyhub/sdk/slides.`);let W;try{W=z({phase:"build"},()=>Qt(at))}catch(t){throw new B("load_failed",`The deck's code failed: ${t instanceof Error?t.message:String(t)}`)}const it=ie(i.piece),G=i.looks?.clean??ee,U=i.file.split("/").slice(0,-1).join("/"),Y={file:`${U===""?"":`${U}/`}${Mt}`},{deck:b,problems:Ct}=Zt({def:W,file:i.slides??{slides:[]},words:ue(m),prefix:it,base:U,theme:te(G),data:t=>m.readData(t)});for(const t of Ct)R.problems.push(ot("AK-M011",t.message,{...t.slide===void 0?{}:{part:t.slide},where:Y}));if(b.slides.length===0)throw new B("no_parts",`The deck has no slides: its ${Mt} lists none (AK-K003).`);const g=M/b.width;Object.assign(p.style,{position:"relative",width:`${String(M)}px`,height:`${String(F)}px`,overflow:"hidden"});for(const[t,e]of Object.entries({...se(G),...le(b.theme)}))p.style.setProperty(t,e);p.replaceChildren();const rt=$.purpose==="play";$.purpose==="render"&&(document.documentElement.style.background="transparent",document.body.style.background="transparent");const Ot=t=>m.mediaAt(t)?.url??"",J=t=>Math.round(t*q)/q,S=[],V=[],ct=[];let Q=0;b.slides.forEach((t,e)=>{const n=Ut(t,e===0),{rests:o,comesOn:s,goesOff:a}=n,c=Q,h=c+(o.at(-1)??0),d=t.shapes.flatMap(l=>l.kind!=="movie"||!l.media?[]:[{shape:l.name,from:s(l.name),poster:l.media.poster??0,length:m.mediaAt(l.media.path)?.duration??0,rest:o.at(-1)??0}]),u=Math.max(h+1/q,...d.map(l=>c+l.from+l.length-l.poster));Q=u;const y=v.combo.lang,r=re(t,{k:g,url:Ot,editing:$.editing===!0,playing:rt,...y===void 0?{}:{lang:y}});r.style.visibility="hidden",p.append(r);const _=[],w=[[]];for(const l of t.shapes){const P=r.querySelector(`[${D}="${CSS.escape(`${t.id}/${l.name}`)}"]`);if(P&&w.at(-1)?.push(P),l.component&&P){const E=W.components[l.component.name];if(!E)continue;const T=l.frame.width*g,C=l.frame.height*g;z({phase:"build",part:t.id},()=>E.layers(l.component?.props??{},{width:T,height:C,slide:t.id})).forEach((O,f)=>{if(typeof O!="object"||O===null||O[ne]!=="graphic"){R.problems.push(ot("AK-M011",`Component ${E.name} on slide ${t.id} drew something that is not a graphic layer (custom(), a component): a footage layer is a movie shape on a slide.`,{part:t.id,where:Y}));return}const x=O,k=document.createElement("div");Object.assign(k.style,{position:"absolute",inset:"0px"}),P.append(k);const A=we({look:G,width:T,height:C,start:c,end:u,combo:v.combo,format:i.format,asset:j=>m.asset(j),wait:j=>ct.push(j),report:j=>R.problems.push(ot(j.code,j.message,{part:t.id,where:Y}))});_.push({layer:x,el:k,ctx:A,props:x.props,from:s(l.name)}),z({phase:"mount",part:t.id,layer:x.component,index:f},()=>{x.mount(k,x.props,A)})})}if(l.kind==="movie"&&l.media&&!rt&&m.mediaAt(l.media.path)){const E=[l.frame.left*g,l.frame.top*g,l.frame.width*g,l.frame.height*g],T=J(s(l.name)),C=a(l.name);V.push({part:t.id,file:l.media.path,start:c+T,end:C===void 0?u:c+J(C),from:(l.media.poster??0)-((o.at(-1)??0)-T),speed:1,gainDb:0,audio:!1,fit:"cover",box:E,picture:E,over:w.length}),w.push([])}}for(;w.length>1&&w.at(-1)?.length===0;)w.pop();const N=J(h);S.push({slide:t,el:r,layers:_,targets:Gt(n.timed),lead:n.lead,movies:d,planes:w,part:{key:t.id,layers:[...new Set(_.map(l=>l.layer.component))],start:c,end:u,planes:w.map(l=>({layers:[{component:SLIDE_LAYER,start:c,end:u},..._.filter(P=>l.some(E=>E.contains(P.el))).map(P=>({component:P.layer.component,start:c,end:u}))]})),still:N,...o.length>1?{steps:o.map(l=>Math.round((c+l)*q)/q)}:{},...ge(t),...t.hidden?{hidden:!0}:{}}})});const X=Q,_t={fps:q,width:M,height:F,paper:`${String(b.width/kt)}in ${String(b.height/kt)}in`,duration:X,background:b.theme.colors.lt1,parts:S.map(t=>t.part),cues:[],...V.length>0?{footage:V}:{},audio:{}},Tt=Kt(p);let lt;const dt=new WeakMap,I=[],L=(t,e)=>{const n={...e};for(const o of Object.keys(e))n[o]=t.style[o];I.push(()=>{Object.assign(t.style,n)}),Object.assign(t.style,e)},Z=(t,e)=>t.el.querySelector(`[${D}="${CSS.escape(`${t.slide.id}/${e}`)}"]`);let pt;const ht=(t,e)=>Z(t,e)?.querySelector("video")??void 0,tt=new Set,jt=(t,e)=>{const n=pt;if(n&&n.m!==t){for(const s of n.m.movies)ht(n.m,s.shape)?.pause();tt.clear()}const o=n?.m===t&&e>n.t&&e-n.t<he;pt={m:t,t:e};for(const s of t.movies){const a=ht(t,s.shape);if(!a)continue;const c=s.poster+Math.max(0,e-s.from);if(o&&e>=s.from&&c<s.length){Math.abs(a.currentTime-c)>fe&&(a.currentTime=c),a.paused&&me(a);continue}a.pause(),o&&c>=s.length&&tt.add(s.shape);const h=tt.has(s.shape)?s.length:Math.max(0,s.poster-(s.rest-e));Math.abs(a.currentTime-h)>1/q&&(a.currentTime=h)}},qt=(t,e)=>{const n=t.slide.transition;if(!n||e>=t.lead)return;const o=S.indexOf(t),s=S.slice(0,o).reverse().find(d=>!d.slide.hidden);if(!s)return;ft(s,s.part.still-s.part.start),s.el.style.visibility="visible";const a=Math.min(1,e/t.lead);if(n.type!=="morph"){const d=Vt(n,a),u=(r,_)=>`translate(${String(r*100)}%, ${String(_*100)}%)`,y=d.incoming.clip;L(t.el,{opacity:String(d.incoming.opacity),transform:u(d.incoming.x,d.incoming.y),...y?{clipPath:`inset(${String(y.top*100)}% ${String(y.right*100)}% ${String(y.bottom*100)}% ${String(y.left*100)}%)`}:{}}),L(s.el,{transform:u(d.outgoing.x,d.outgoing.y)});return}const c=new Map(s.slide.shapes.map(d=>[d.name,d]));L(t.el,{background:`color-mix(in srgb, ${getComputedStyle(t.el).backgroundColor} ${String(a*100)}%, transparent)`});const h=new Set;for(const d of t.slide.shapes){const u=Z(t,d.name);if(!u)continue;const y=c.get(d.name);if(!y){L(u,{opacity:String(a)});continue}h.add(d.name);const r=Jt(y.frame,d.frame,a),_=d.frame.width>0?r.width/d.frame.width:1,w=d.frame.height>0?r.height/d.frame.height:1;L(u,{transformOrigin:"0 0",transform:`translate(${String((r.left-d.frame.left)*g)}px, ${String((r.top-d.frame.top)*g)}px) scale(${String(_)}, ${String(w)}) ${u.style.transform}`})}for(const d of s.slide.shapes){const u=Z(s,d.name);u&&(h.has(d.name)?L(u,{visibility:"hidden"}):L(u,{opacity:String(1-a)}))}},ft=(t,e)=>{for(const n of t.targets){const o=t.slide.shapes.find(y=>y.name===n.shape),s=t.el.querySelector(`[${D}="${CSS.escape(`${t.slide.id}/${n.shape}`)}"]`);if(!o||!s)continue;const a=n.paragraph===void 0?s:s.querySelector(`[data-ak-paragraph="${String(n.paragraph)}"]`);if(!a)continue;const c=dt.get(a)??{transform:a.style.transform,clipPath:a.style.clipPath};dt.set(a,c);const h=Yt(n.animations,e,o.frame,{width:b.width,height:b.height});a.style.visibility=h.hidden?"hidden":"",a.style.opacity=h.opacity===1?"":String(h.opacity);const d=h.x!==0||h.y!==0?`translate(${String(h.x*g)}px, ${String(h.y*g)}px)`:"",u=h.scale===1?"":`scale(${String(h.scale)})`;a.style.transform=[d,u,c.transform].filter(y=>y!=="").join(" "),a.style.clipPath=h.clip?`inset(${String(h.clip.top*100)}% ${String(h.clip.right*100)}% ${String(h.clip.bottom*100)}% ${String(h.clip.left*100)}%)`:c.clipPath}},Dt=(t,e)=>{if(e>0){const n=t.el.style.background;t.el.style.background="none",I.push(()=>{t.el.style.background=n})}for(const[n,o]of t.planes.entries())for(const s of n===e?[]:o){const a=s.style.visibility;s.style.visibility="hidden",I.push(()=>{s.style.visibility=a})}},H=async(t,e)=>{const n=Math.min(Math.max(0,t),X-1/q),o=S.find(a=>n<a.part.end-1e-6)??S[S.length-1];if(!o)return;for(const a of S)a.el.style.visibility=a===o?"visible":"hidden";lt=o,Pt.setMoment(n,`${v.seedBase}:${o.slide.id}`);const s=n-o.part.start;for(;I.length>0;)I.pop()?.();ft(o,s),qt(o,s),jt(o,s);for(const[a,c]of o.layers.entries())z({phase:"render",part:o.slide.id,layer:c.layer.component,index:a,t:n-o.part.start},()=>{c.layer.render(c.el,Math.max(0,s-c.from),c.props,c.ctx)});e!==void 0&&Dt(o,e),await Tt(vt*1e3)},et=()=>lt??S[0],Lt=de(p,g),mt=async t=>{await H(t);const e=et(),n=p.getBoundingClientRect(),o=n.width>0?M/n.width:1;return{m:e,blocks:e?St(e.el,p,M):[],scale:o}},Rt=()=>{const t=new Map,e=b.theme.fonts;for(const n of[e.major,e.minor,e.major_east_asian,e.minor_east_asian])t.set(nt(n),"theme");for(const n of b.slides)for(const o of n.shapes){const s=[...o.text?.style.levels.map(a=>a.font.name)??[],...o.text?.paragraphs.flatMap(a=>[a.font?.name,...a.runs.map(c=>c.font?.name)])??[]];for(const a of s)a!==void 0&&!a.startsWith("+")&&!t.has(nt(a))&&t.set(nt(a),"text")}return[...t].map(([n,o])=>({name:n,where:o}))},Ft=t=>{const e=t.text?.paragraphs[0],n=e?.alignment??t.text?.style.levels[e?.level??0]?.alignment;return n===void 0?{}:{align:n}},Ht=(t,e)=>{const n=p.getBoundingClientRect(),o=n.width>0?M/n.width:1,s=[],a=[],c=[],h=[],d=[],u=[],y=g*$t;return t.slide.shapes.forEach((r,_)=>{const w=t.el.querySelector(`[${D}="${CSS.escape(`${t.slide.id}/${r.name}`)}"]`);if(!w)return;const N=w.getBoundingClientRect(),l=[Math.round((N.left-n.left)*o),Math.round((N.top-n.top)*o),Math.round(N.width*o),Math.round(N.height*o)],P=getComputedStyle(w).visibility==="hidden",E=St(w,p,M).filter(f=>f.ink!==null&&f.runs.some(x=>getComputedStyle(x.el).visibility!=="hidden")),T=E.map(f=>pe([...new Set(f.runs.map(x=>x.el))],p,M));E.forEach((f,x)=>{const k=T[x]??[],A=Et(k);A&&(s.push({layer:r.name,z:"front",text:f.text,box:A,...f.opacity<1?{opacity:f.opacity}:{}}),a.push(_),c.push(f.containers),h.push(A),d.push(k))});const C={name:r.name,kind:r.geometry==="line"?"line":r.kind,level:r.level,...r.placeholder?{placeholder:r.placeholder.type}:{},frame:[Math.round(r.frame.left*g),Math.round(r.frame.top*g),Math.round(r.frame.width*g),Math.round(r.frame.height*g)],box:l,...P?{hidden:P}:{},opaque:r.kind==="picture"||r.kind==="movie"||r.geometry!=="line"&&r.fill!==void 0&&r.fill!==null};if(r.chart){const f=r.chart.series.flatMap(x=>x.values.filter(k=>k!==null));C.chart={type:r.chart.type,categories:r.chart.categories.length,series:r.chart.series.length,...f.length>0?{low:Math.min(...f),high:Math.max(...f)}:{},...r.chart.source===void 0?{}:{source:r.chart.source}}}if(r.table){const f=[...w.querySelectorAll("tr")];C.rows=r.table.rows.map((x,k)=>({set:Math.round(x.height*g),drawn:Math.round((f[k]?.getBoundingClientRect().height??0)*o)}))}const K=T.flat();if(K.length>0){const f=new Map;for(const A of E)for(const j of A.runs){const gt=getComputedStyle(j.el),yt=Math.round(parseFloat(gt.fontSize)/y*10)/10,wt=parseInt(gt.fontWeight,10)||400,xt=`${String(yt)}/${String(wt)}`;f.has(xt)||f.set(xt,{size:yt,weight:wt,...A.xHeight===void 0?{}:{xHeight:Math.round(A.xHeight/y*10)/10}})}const x=E.map(A=>A.text).join(`
4
- `),k=w.querySelector("[data-ak-font-scale]")?.dataset.akFontScale;C.text={text:x,words:oe(x).words,lines:K,glyphs:Et(K),type:[...f.values()],...k===void 0?{}:{scale:Number(k)},...Ft(r)}}const O=w.querySelector("img");if(O&&O.naturalWidth>0){const f=r.media?.crop??{left:0,top:0,right:0,bottom:0};C.picture={source:[O.naturalWidth,O.naturalHeight],shown:[Math.round(O.naturalWidth*(1-f.left-f.right)),Math.round(O.naturalHeight*(1-f.top-f.bottom))]}}u.push(C)}),{moment:ae({t:e,part:t.slide.id,texts:s,safe:At,width:M,height:F,owner:a,containers:c,seen:h,glyphs:d}),slide:{slide:t.slide.id,steps:t.part.steps?.length??1,t:e,layout:t.slide.layout,hidden:t.slide.hidden,...t.slide.notes===void 0?{}:{notes:t.slide.notes},shapes:u}}},ut={kind:"slides",get timeline(){return _t},async ready(){await Wt(p);for(const t of S){t.el.style.visibility="visible";for(const e of t.el.querySelectorAll("[data-ak-autofit='text']"))ce(e,g);t.el.style.visibility="hidden"}await Promise.all(ct),await H(S[0]?.part.still??0)},seek:(t,e)=>H(t,e?.plane),edit:(t,e)=>{Lt(t,e)},words:()=>[],lines:()=>[],captionOptions:()=>null,setPlaying:()=>{},text:()=>S.map(t=>({key:t.slide.id,...t.slide.notes===void 0?{}:{notes:t.slide.notes},onScreen:t.slide.shapes.flatMap(e=>e.text&&!e.text.empty?[e.text.paragraphs.map(n=>n.runs.map(o=>o.text).join("")).join(`
5
- `)]:[])})),reads:()=>m.reads(it,S.map(t=>t.slide.id)),problems:()=>[...m.problems,...R.problems,...m.translationProblems()],stuck:()=>{},seekLimit:vt,facts:()=>[],says:()=>[],signs:()=>Object.fromEntries(S.map(t=>[t.slide.id,JSON.stringify({slide:t.slide,theme:b.theme,width:M,height:F})])),mixPlan:()=>({duration:X,speech:[],footage:[],sfx:[]}),covers:()=>[],drawCover:()=>Promise.resolve(),async measure(t){const e=[],n=[];for(const o of t??S.flatMap(s=>s.part.steps??[s.part.still])){await H(o);const s=et();if(!s)continue;const a=Ht(s,o);e.push(a.moment),n.push(a.slide)}return{width:M,height:F,deck:{pxPerPt:g*$t,slides:n,fonts:Rt()},safe:At,moments:e,footage:[]}},tracks:()=>Promise.resolve([]),deck:()=>{const t={};for(const n of S)for(const o of n.el.querySelectorAll("[data-ak-font-scale]")){const s=o.closest(`[${D}]`)?.getAttribute(D),a=Number(o.dataset.akFontScale);s&&a<1&&(t[s]=a)}const e=v.combo.lang;return{width:b.width,height:b.height,theme:b.theme,masters:W.masters,slides:b.slides,fitted:t,...e===void 0?{}:{lang:e}}},async inks(t){const{blocks:e,scale:n}=await mt(t);return e.flatMap(o=>o.ink===null?[]:[{text:{layer:"slide",z:"front",text:o.text,box:o.box},...Bt(o,n)}])},async objects(t){const{m:e,blocks:n}=await mt(t),o=p.getBoundingClientRect(),s=o.width>0?M/o.width:1;return{t,elements:e?[...e.el.querySelectorAll(`[${D}]`)].map(a=>{const c=a.getBoundingClientRect();return{id:a.getAttribute(D)??"",box:[(c.left-o.left)*s,(c.top-o.top)*s,c.width*s,c.height*s]}}):[],texts:n.map(a=>({text:a.text,box:[a.box[0],a.box[1],a.box[2],a.box[3]],size:a.size,keys:m.keysShowing(a.text)}))}},signature:()=>{const t=et();if(!(!t||t.el.querySelector("canvas, video, iframe")))return bt(JSON.stringify(b.theme)+t.el.outerHTML)},async signatureAt(t){return await H(t),ut.signature()},async partSignature(t,e){const n=S.find(s=>s.slide.id===t);if(!n)return{unknown:`no slide ${t}`};const o=[];for(const s of e){if(await H(s),n.el.querySelector("canvas, video, iframe"))return{unknown:"a canvas, a video or a frame on the slide"};o.push(n.el.outerHTML)}return{sign:bt(o.join(`
6
- `)),owners:n.layers.map(s=>s.layer.component)}},ask:()=>Promise.resolve([]),dispose(){p.replaceChildren()}};return ut}const ge=i=>{const $=ye(i);return $===void 0?{}:{title:$}};function ye(i){const p=i.shapes.find(v=>v.placeholder?.type==="title"||v.placeholder?.type==="ctrTitle")?.text?.paragraphs.map(v=>v.runs.map(m=>m.text).join("")).join(" ").trim();return p===void 0||p===""?void 0:p}function we(i){const $=p=>()=>{throw new Error(`${p} is a video's: a slide has no speech.`)};return{look:i.look,format:i.format,dims:{width:i.width,height:i.height,orient:i.width>i.height?"landscape":i.width<i.height?"portrait":"square",safe:{top:0,bottom:0,left:0,right:0}},combo:i.combo,dur:i.end-i.start,asset:i.asset,words:()=>[],at:$("ctx.at()"),layer:{start:0,end:i.end-i.start},wait:i.wait,report:i.report,captions:()=>[],face:()=>{},faces:()=>[],texts:()=>[],covered:[],content:[0,0,i.width,i.height],realTimers:zt}}
2
+ import{LoadFailure as G,consoleAt as F,consoleAtAsync as ot,createEnv as _e,domHash as Te,inkOfBlock as st,loadTextFonts as at,pictureWaiter as it,realTimers as rt,textBlocks as je}from"@allyhub-next/runtime/stage";import{animationTargets as ct,clockOf as lt,DECK_FPS as L,deckCode as De,drawnAt as dt,morphFrame as pt,transitionAt as ft,EMU_PER_INCH as qe,EMU_PER_PT as Le,evaluateDeck as ht,fontFace as le,isConnectorGeometry as Ne,isDeck as mt,isDeckCode as ut,resolveDeck as gt,slideSign as yt,themeOfLook as wt}from"@allyhub-next/slides-core";import{CLEAN_LOOK as Re,LAYER_BRAND as St,SEEK_LIMIT as de,countWords as xt,lookCss as kt,measureMoment as bt,messagePrefix as vt,problem as Fe}from"@allyhub-next/video-core";import{SLIDES_FILE as $t}from"@allyhub-next/formats";import{drawSlide as Mt,fitText as Ot,SHAPE_ATTR as N,themeCss as At}from"./draw.js";import{inkLines as Et,union as He}from"./ink.js";export const SLIDE_LAYER="slide",SLIDES_KEPT=5;const Ct=.5,Pt=.3,Ie={top:0,bottom:0,left:0,right:0};async function _t(i){i.muted=!1,await i.play().catch(async()=>{i.muted=!0,await i.play().catch(()=>{})})}function Tt(i){const b=u=>{if(i.peek(u)!==void 0)return i.s(u);const y=[...new Set(i.keysUnder(u).map(h=>h.slice(u.length+1).split(".")[0]).filter(h=>h!==void 0&&/^\d+$/u.test(h)))].sort((h,P)=>Number(h)-Number(P));if(y.length!==0)return y.map(h=>b(`${u}.${h}`)).filter(h=>h!==void 0)};return b}const Be=i=>!(i.kind==="placeholder"&&i.text?.empty===!0),jt=i=>typeof i=="object"&&i!==null&&i[St]==="graphic";export async function importDeck(i){for(const y of i.styles??[]){const h=document.createElement("link");h.rel="stylesheet",h.href=y;const P=new Promise(J=>{h.onload=J,h.onerror=J});document.head.append(h),await P}let b;try{b=await ot({phase:"module"},()=>import(i.module))}catch(y){const h=y instanceof Error?y:new Error(String(y));throw new G("load_failed",`Failed to load the deck's module: ${h.message}
3
+ ${h.stack??""}`)}const u=b.default;if(!mt(u))throw new G("no_content",`The default export of ${i.file} is not a presentation({ … }) from @allyhub/sdk/slides.`);try{return F({phase:"build"},()=>ht(u))}catch(y){throw new G("load_failed",`The deck's code failed: ${y instanceof Error?y.message:String(y)}`)}}export async function deckCodeOf(i,b){const{log:u}=_e(i,b),y=await importDeck(i);return{code:F({phase:"build"},()=>De(y,P=>u.readData(P))),theme:We(i)}}const We=i=>wt(i.looks?.clean??Re);export async function loadDeck(i,b,u){const y=_e(i,b),{log:h,ledger:P,guards:J}=y,[M,I]=i.format.split("x").map(Number);if(!(M>0&&I>0))throw new G("bad_format",`${i.piece} is drawn at ${i.format}: a deck's stage is WIDTHxHEIGHT pixels.`);const pe=await importDeck(i),fe=ut(i.code)?i.code:F({phase:"build"},()=>De(pe,e=>h.readData(e))),he=vt(i.piece),me=i.looks?.clean??Re,Q=i.file.split("/").slice(0,-1).join("/"),ue={file:`${Q===""?"":`${Q}/`}${$t}`},{deck:ze}=gt({code:fe,file:i.slides??{slides:[]},words:Tt(h),prefix:he,base:Q,theme:We(i),data:e=>h.readData(e)});let k=ze;if(k.slides.length===0)throw new G("no_parts","The deck has no slides to draw (AK-K003).");const S=M/k.width;Object.assign(u.style,{position:"relative",width:`${String(M)}px`,height:`${String(I)}px`,overflow:"hidden"});const ge=()=>{for(const[e,t]of Object.entries({...kt(me),...At(k.theme)}))u.style.setProperty(e,t)};ge(),u.replaceChildren();const X=b.purpose==="play";b.purpose==="render"&&(document.documentElement.style.background="transparent",document.body.style.background="transparent");const ye=new Map,Z=e=>ye.get(e)??h.mediaAt(e),Ke=e=>Z(e)?.url??"",ee=e=>Math.round(e*L)/L,U=y.combo.lang,Ge=(e,t,n)=>{const o=lt(e,t===0),{rests:s,comesOn:a,goesOff:p}=o,l=n+(s.at(-1)??0),g=e.shapes.flatMap(d=>d.kind!=="movie"||!d.media?[]:[{shape:d.name,from:a(d.name),poster:d.media.poster??0,length:Z(d.media.path)?.duration??0,rest:s.at(-1)??0}]),c=Math.max(l+1/L,...g.map(d=>n+d.from+d.length-d.poster)),f=[],r=[],$=new Map,m=[!1];for(const d of e.shapes){Be(d)&&($.set(d.name,m.length-1),m[m.length-1]=!0);const A=d.component&&Be(d)?pe.components[d.component.name]:void 0;if(A){const v=F({phase:"build",part:e.id},()=>A.layers(d.component?.props??{},{width:d.frame.width*S,height:d.frame.height*S,slide:e.id}));for(const T of v)jt(T)?f.push({shape:d.name,layer:T}):P.problems.push(Fe("AK-M011",`Component ${A.name} on slide ${e.id} drew something that is not a graphic layer (custom(), a component): a footage layer is a movie shape on a slide.`,{part:e.id,where:ue}))}if(d.kind==="movie"&&d.media&&!X&&Z(d.media.path)){const v=[d.frame.left*S,d.frame.top*S,d.frame.width*S,d.frame.height*S],T=ee(a(d.name)),j=p(d.name);r.push({part:e.id,file:d.media.path,start:n+T,end:j===void 0?c:n+ee(j),from:(d.media.poster??0)-((s.at(-1)??0)-T),speed:1,gainDb:0,audio:!1,fit:"cover",box:v,picture:v,over:m.length}),m.push(!1)}}for(;m.length>1&&m.at(-1)===!1;)m.pop();const _=m.length,ce=ee(l),V=d=>f.filter(A=>A.shape===d).map(A=>A.layer.component);return{slide:e,sign:yt(k,e),clock:o,movies:g,footage:r,planeOf:$,planes:_,made:f,part:{key:e.id,layers:[...new Set(f.map(d=>d.layer.component))],start:n,end:c,planes:Array.from({length:_},(d,A)=>({layers:[{component:SLIDE_LAYER,start:n,end:c},...e.shapes.filter(v=>$.get(v.name)===A).flatMap(v=>V(v.name)).map(v=>({component:v,start:n,end:c}))]})),still:ce,...s.length>1?{steps:s.map(d=>Math.round((n+d)*L)/L)}:{},...Dt(e),...e.hidden?{hidden:!0}:{}}}},we=e=>{let t=0;return e.slides.map((n,o)=>{const s=Ge(n,o,t);return t=s.part.end,s})};let x=we(k);const te=x.at(-1)?.part.end??0,Se={fps:L,width:M,height:I,paper:`${String(k.width/qe)}in ${String(k.height/qe)}in`,duration:te,background:k.theme.colors.lt1,parts:x.map(e=>e.part),cues:[],...x.some(e=>e.footage.length>0)?{footage:x.flatMap(e=>e.footage)}:{},audio:{}},O=new Map,ne=new Map;let H,B;const Je=async e=>{const{slide:t,part:n}=e,o=Mt(t,{k:S,url:Ke,editing:!1,playing:X,...U===void 0?{}:{lang:U},colors:k.theme.colors});o.style.visibility="hidden",u.append(o);const s=Array.from({length:e.planes},()=>[]),a=[],p=[];for(const l of t.shapes){const g=o.querySelector(`[${N}="${CSS.escape(`${t.id}/${l.name}`)}"]`);if(g){s[e.planeOf.get(l.name)??0]?.push(g);for(const[c,{layer:f}]of e.made.filter(r=>r.shape===l.name).entries()){const r=document.createElement("div");Object.assign(r.style,{position:"absolute",inset:"0px"}),g.append(r);const $=stageContext({look:me,width:l.frame.width*S,height:l.frame.height*S,start:n.start,end:n.end,combo:y.combo,format:i.format,asset:m=>h.asset(m),wait:m=>p.push(m),report:m=>P.problems.push(Fe(m.code,m.message,{part:t.id,where:ue}))});a.push({layer:f,el:r,ctx:$,props:f.props,from:e.clock.comesOn(l.name)}),F({phase:"mount",part:t.id,layer:f.component,index:c},()=>{f.mount(r,f.props,$)})}}}await at(o),o.style.visibility="visible";for(const l of o.querySelectorAll("[data-ak-autofit='text']"))Ot(l);return o.style.visibility="hidden",await Promise.all(p),{slide:t,slot:e,el:o,part:n,layers:a,targets:ct(e.clock.timed),lead:e.clock.lead,movies:e.movies,planes:s,pictures:it(o)}},Y=e=>{O.delete(e.slide.id);for(const[t,n]of e.layers.entries())F({phase:"mount",part:e.slide.id,layer:n.layer.component,index:t},()=>{n.layer.unmount?.(n.el,n.props,n.ctx)});e.el.remove(),H===e&&(H=void 0),B===e&&(B=void 0)},W=async e=>{const t=e.slide.id,n=O.get(t);if(n?.slot===e)return O.delete(t),O.set(t,n),n;n&&Y(n);let o=ne.get(t);o||(o=Je(e).finally(()=>ne.delete(t)),ne.set(t,o));const s=await o,a=se(t);return a&&a!==e?(s.el.remove(),W(a)):(O.set(t,s),s)},oe=()=>{for(const e of[...O.values()]){if(O.size<=SLIDES_KEPT)return;e!==H&&e!==B&&Y(e)}},se=e=>x.find(t=>t.slide.id===e),Ue=e=>{let t=0,n=x.length-1;for(;t<n;){const o=t+n>>1,s=x[o];s&&e<s.part.end-1e-6?n=o:t=o+1}return x[t]},Ye=e=>x.slice(0,x.indexOf(e)).reverse().find(t=>!t.slide.hidden),xe=new WeakMap,z=[],C=(e,t)=>{const n={...t};for(const o of Object.keys(t))n[o]=e.style[o];z.push(()=>{Object.assign(e.style,n)}),Object.assign(e.style,t)},ae=(e,t)=>e.el.querySelector(`[${N}="${CSS.escape(`${e.slide.id}/${t}`)}"]`);let ke;const be=(e,t)=>ae(e,t)?.querySelector("video")??void 0,ie=new Set,Ve=(e,t)=>{const n=ke;if(n&&n.m!==e){for(const s of n.m.movies)be(n.m,s.shape)?.pause();ie.clear()}const o=n?.m===e&&t>n.t&&t-n.t<Ct;ke={m:e,t};for(const s of e.movies){const a=be(e,s.shape);if(!a)continue;const p=s.poster+Math.max(0,t-s.from);if(o&&t>=s.from&&p<s.length){Math.abs(a.currentTime-p)>Pt&&(a.currentTime=p),a.paused&&_t(a);continue}a.pause(),o&&p>=s.length&&ie.add(s.shape);const l=ie.has(s.shape)?s.length:Math.max(0,s.poster-(s.rest-t));Math.abs(a.currentTime-l)>1/L&&(a.currentTime=l)}},Qe=(e,t)=>{const n=e.slide.transition;if(!n||t>=e.lead)return;const o=B;if(!o)return;ve(o,o.part.still-o.part.start),o.el.style.visibility="visible";const s=Math.min(1,t/e.lead);if(n.type!=="morph"){const c=ft(n,s),f=($,m)=>`translate(${String($*100)}%, ${String(m*100)}%)`,r=c.incoming.clip;C(e.el,{opacity:String(c.incoming.opacity),transform:f(c.incoming.x,c.incoming.y),...r?{clipPath:`inset(${String(r.top*100)}% ${String(r.right*100)}% ${String(r.bottom*100)}% ${String(r.left*100)}%)`}:{}}),C(o.el,{transform:f(c.outgoing.x,c.outgoing.y)});return}const a=new Map(o.slide.shapes.map(c=>[c.name,c]));C(e.el,{background:`color-mix(in srgb, ${getComputedStyle(e.el).backgroundColor} ${String(s*100)}%, transparent)`});const p=(c,f,r)=>{C(c,{left:`${String(r.left*S)}px`,top:`${String(r.top*S)}px`,width:`${String(r.width*S)}px`,height:`${String(r.height*S)}px`});const $=f.width>0?r.width/f.width:1,m=f.height>0?r.height/f.height:1;for(const _ of c.querySelectorAll(":scope > svg:not([viewBox])"))C(_,{transformOrigin:"0 0",transform:`scale(${String($)}, ${String(m)})`})},l=c=>JSON.stringify({...c,frame:void 0,sources:void 0}),g=new Map;for(const c of e.slide.shapes){const f=ae(e,c.name);if(!f)continue;const r=a.get(c.name);if(!r){C(f,{opacity:String(s)});continue}const $=pt(r.frame,c.frame,s),m=l(r)===l(c);g.set(c.name,{frame:$,same:m}),p(f,c.frame,$),m||C(f,{opacity:String(s)})}for(const c of o.slide.shapes){const f=ae(o,c.name);if(!f)continue;const r=g.get(c.name);r?r.same?C(f,{visibility:"hidden"}):(p(f,c.frame,r.frame),C(f,{opacity:String(1-s)})):C(f,{opacity:String(1-s)})}},ve=(e,t)=>{for(const n of e.targets){const o=e.slide.shapes.find(f=>f.name===n.shape),s=e.el.querySelector(`[${N}="${CSS.escape(`${e.slide.id}/${n.shape}`)}"]`);if(!o||!s)continue;const a=n.paragraph===void 0?s:s.querySelector(`[data-ak-paragraph="${String(n.paragraph)}"]`);if(!a)continue;const p=xe.get(a)??{transform:a.style.transform,clipPath:a.style.clipPath};xe.set(a,p);const l=dt(n.animations,t,o.frame,{width:k.width,height:k.height});a.style.visibility=l.hidden?"hidden":"",a.style.opacity=l.opacity===1?"":String(l.opacity);const g=l.x!==0||l.y!==0?`translate(${String(l.x*S)}px, ${String(l.y*S)}px)`:"",c=l.scale===1?"":`scale(${String(l.scale)})`;a.style.transform=[g,c,p.transform].filter(f=>f!=="").join(" "),a.style.clipPath=l.clip?`inset(${String(l.clip.top*100)}% ${String(l.clip.right*100)}% ${String(l.clip.bottom*100)}% ${String(l.clip.left*100)}%)`:p.clipPath}},Xe=(e,t)=>{if(t>0){const n=e.el.style.background;e.el.style.background="none",z.push(()=>{e.el.style.background=n})}for(const[n,o]of e.planes.entries())for(const s of n===t?[]:o){const a=s.style.visibility;s.style.visibility="hidden",z.push(()=>{s.style.visibility=a})}};let K;const R=async(e,t)=>{K={t:e,plane:t};const n=Math.min(Math.max(0,e),te-1/L),o=Ue(n);if(!o)return;const s=n-o.part.start,a=await W(o),p=o.slide.transition&&s<o.clock.lead?Ye(o):void 0,l=p?await W(p):void 0;if(K.t===e){for(const g of O.values())g.el.style.visibility=g===a?"visible":"hidden";for(H=a,B=l,J.setMoment(n,`${y.seedBase}:${a.slide.id}`);z.length>0;)z.pop()?.();ve(a,s),Qe(a,s),Ve(a,s);for(const[g,c]of a.layers.entries())F({phase:"render",part:a.slide.id,layer:c.layer.component,index:g,t:s},()=>{c.layer.render(c.el,Math.max(0,s-c.from),c.props,c.ctx)});if(t!==void 0&&Xe(a,t),await Promise.all([a.pictures(de*1e3),...l?[l.pictures(de*1e3)]:[]]),oe(),X){const g=x[x.indexOf(o)+1];g&&!O.has(g.slide.id)&&W(g).then(oe,()=>{})}}},re=()=>H,$e=async e=>{await R(e);const t=re(),n=u.getBoundingClientRect(),o=n.width>0?M/n.width:1;return{m:t,blocks:t?je(t.el,u,M):[],scale:o}},Ze=()=>{const e=new Map,t=k.theme.fonts;for(const n of[t.major,t.minor,t.major_east_asian,t.minor_east_asian])e.set(le(n),"theme");for(const n of k.slides)for(const o of n.shapes){const s=[...o.text?.style.levels.map(a=>a.font.name)??[],...o.text?.paragraphs.flatMap(a=>[a.font?.name,...a.runs.map(p=>p.font?.name)])??[]];for(const a of s)a!==void 0&&!a.startsWith("+")&&!e.has(le(a))&&e.set(le(a),"text")}return[...e].map(([n,o])=>({name:n,where:o}))},et=e=>{const t=e.text?.paragraphs[0],n=t?.alignment??e.text?.style.levels[t?.level??0]?.alignment;return n===void 0?{}:{align:n}},tt=(e,t)=>{const n=u.getBoundingClientRect(),o=n.width>0?M/n.width:1,s=[],a=[],p=[],l=[],g=[],c=[],f=S*Le;return e.slide.shapes.forEach((r,$)=>{const m=e.el.querySelector(`[${N}="${CSS.escape(`${e.slide.id}/${r.name}`)}"]`);if(!m)return;const _=m.getBoundingClientRect(),ce=[Math.round((_.left-n.left)*o),Math.round((_.top-n.top)*o),Math.round(_.width*o),Math.round(_.height*o)],V=getComputedStyle(m).visibility==="hidden",d=je(m,u,M).filter(w=>w.ink!==null&&w.runs.some(E=>getComputedStyle(E.el).visibility!=="hidden")),A=d.map(w=>Et([...new Set(w.runs.map(E=>E.el))],u,M));d.forEach((w,E)=>{const D=A[E]??[],q=He(D);q&&(s.push({layer:r.name,z:"front",text:w.text,box:q,...w.opacity<1?{opacity:w.opacity}:{}}),a.push($),p.push(w.containers),l.push(q),g.push(D))});const v={name:r.name,kind:Ne(r.geometry)?"line":r.kind,level:r.level,...r.placeholder?{placeholder:r.placeholder.type}:{},frame:[Math.round(r.frame.left*S),Math.round(r.frame.top*S),Math.round(r.frame.width*S),Math.round(r.frame.height*S)],box:ce,...V?{hidden:V}:{},opaque:r.kind==="picture"||r.kind==="movie"||!Ne(r.geometry)&&r.fill!==void 0&&r.fill!==null};if(r.chart){const w=r.chart.series.flatMap(E=>E.values.filter(D=>D!==null));v.chart={type:r.chart.type,categories:r.chart.categories.length,series:r.chart.series.length,...w.length>0?{low:Math.min(...w),high:Math.max(...w)}:{},...r.chart.source===void 0?{}:{source:r.chart.source}}}if(r.table){const w=[...m.querySelectorAll("tr")];v.rows=r.table.rows.map((E,D)=>({set:Math.round(E.height*S),drawn:Math.round((w[D]?.getBoundingClientRect().height??0)*o)}))}const T=A.flat();if(T.length>0){const w=new Map;for(const q of d)for(const nt of q.runs){const Ae=getComputedStyle(nt.el),Ee=Math.round(parseFloat(Ae.fontSize)/f*10)/10,Ce=parseInt(Ae.fontWeight,10)||400,Pe=`${String(Ee)}/${String(Ce)}`;w.has(Pe)||w.set(Pe,{size:Ee,weight:Ce,...q.xHeight===void 0?{}:{xHeight:Math.round(q.xHeight/f*10)/10}})}const E=d.map(q=>q.text).join(`
4
+ `),D=m.querySelector("[data-ak-font-scale]")?.dataset.akFontScale;v.text={text:E,words:xt(E).words,lines:T,glyphs:He(T),type:[...w.values()],...D===void 0?{}:{scale:Number(D)},...et(r)}}const j=m.querySelector("img");if(j&&j.naturalWidth>0){const w=r.media?.crop??{left:0,top:0,right:0,bottom:0};v.picture={source:[j.naturalWidth,j.naturalHeight],shown:[Math.round(j.naturalWidth*(1-w.left-w.right)),Math.round(j.naturalHeight*(1-w.top-w.bottom))]}}c.push(v)}),{moment:bt({t,part:e.slide.id,texts:s,safe:Ie,width:M,height:I,owner:a,containers:p,seen:l,glyphs:g}),slide:{slide:e.slide.id,steps:e.part.steps?.length??1,t,layout:e.slide.layout,hidden:e.slide.hidden,...e.slide.notes===void 0?{}:{notes:e.slide.notes},shapes:c}}},Me=e=>JSON.stringify(e.map(t=>[t.part.key,t.part.start,t.part.end,t.part.still,t.part.steps,t.part.hidden,t.part.layers,t.footage])),Oe={kind:"slides",get timeline(){return Se},async ready(){await R(x[0]?.part.still??0)},seek:(e,t)=>R(e,t?.plane),async update(e,t){const n=e;for(const[p,l]of Object.entries(t??{}))ye.set(p,l);const o=k;k=n;const s=we(n);if(n.width!==o.width||n.height!==o.height||Me(s)!==Me(x))return k=o,{redrawn:[],reload:!0};const a=[];x=s.map((p,l)=>{const g=x[l];return g?.sign===p.sign?g:(a.push(p.slide.id),p)}),Se.parts=x.map(p=>p.part),ge();for(const p of[...O.values()])se(p.slide.id)!==p.slot&&Y(p);return K&&a.length>0&&await R(K.t,K.plane),{redrawn:a}},sheet:()=>H?.el,words:()=>[],lines:()=>[],captionOptions:()=>null,setPlaying:()=>{},text:()=>x.map(({slide:e})=>({key:e.id,...e.notes===void 0?{}:{notes:e.notes},onScreen:e.shapes.flatMap(t=>t.text&&!t.text.empty?[t.text.paragraphs.map(n=>n.runs.map(o=>o.text).join("")).join(`
5
+ `)]:[])})),reads:()=>h.reads(he,x.map(e=>e.slide.id)),problems:()=>[...h.problems,...P.problems,...h.translationProblems()],stuck:()=>{},seekLimit:de,facts:()=>[],says:()=>[],signs:()=>Object.fromEntries(x.map(e=>[e.slide.id,JSON.stringify({slide:JSON.parse(e.sign),width:M})])),mixPlan:()=>({duration:te,speech:[],footage:[],sfx:[]}),covers:()=>[],drawCover:()=>Promise.resolve(),async measure(e){const t=[],n=[];for(const o of e??x.flatMap(s=>s.part.steps??[s.part.still])){await R(o);const s=re();if(!s)continue;const a=tt(s,o);t.push(a.moment),n.push(a.slide)}return{width:M,height:I,deck:{pxPerPt:S*Le,slides:n,fonts:Ze()},safe:Ie,moments:t,footage:[]}},tracks:()=>Promise.resolve([]),async deck(){const e={};for(const t of x){const n=await W(t);for(const o of n.el.querySelectorAll("[data-ak-font-scale]")){const s=o.closest(`[${N}]`)?.getAttribute(N),a=Number(o.dataset.akFontScale);s&&a<1&&(e[s]=a)}oe()}return{width:k.width,height:k.height,theme:k.theme,masters:fe.masters,slides:k.slides,fitted:e,...U===void 0?{}:{lang:U}}},async inks(e){const{blocks:t,scale:n}=await $e(e);return t.flatMap(o=>o.ink===null?[]:[{text:{layer:"slide",z:"front",text:o.text,box:o.box},...st(o,n)}])},async objects(e){const{m:t,blocks:n}=await $e(e),o=u.getBoundingClientRect(),s=o.width>0?M/o.width:1;return{t:e,elements:t?[...t.el.querySelectorAll(`[${N}]`)].map(a=>{const p=a.getBoundingClientRect();return{id:a.getAttribute(N)??"",box:[(p.left-o.left)*s,(p.top-o.top)*s,p.width*s,p.height*s]}}):[],texts:n.map(a=>({text:a.text,box:[a.box[0],a.box[1],a.box[2],a.box[3]],size:a.size,keys:h.keysShowing(a.text)}))}},signature:()=>{const e=re();if(!(!e||e.el.querySelector("canvas, video, iframe")))return Te(JSON.stringify(k.theme)+e.el.outerHTML)},async signatureAt(e){return await R(e),Oe.signature()},async partSignature(e,t){const n=se(e);if(!n)return{unknown:`no slide ${e}`};const o=[];for(const s of t){await R(s);const a=O.get(e);if(!a)return{unknown:`slide ${e} is not at ${String(s)}`};if(a.el.querySelector("canvas, video, iframe"))return{unknown:"a canvas, a video or a frame on the slide"};o.push(a.el.outerHTML)}return{sign:Te(o.join(`
6
+ `)),owners:[...new Set(n.made.map(s=>s.layer.component))]}},ask:()=>Promise.resolve([]),dispose(){for(const e of[...O.values()])Y(e);u.replaceChildren()}};return Oe}const Dt=i=>{const b=qt(i);return b===void 0?{}:{title:b}};function qt(i){const u=i.shapes.find(y=>y.placeholder?.type==="title"||y.placeholder?.type==="ctrTitle")?.text?.paragraphs.map(y=>y.runs.map(h=>h.text).join("")).join(" ").trim();return u===void 0||u===""?void 0:u}export function stageContext(i){const b=u=>()=>{throw new Error(`${u} is a video's: a slide has no speech.`)};return{look:i.look,format:i.format,dims:{width:i.width,height:i.height,orient:i.width>i.height?"landscape":i.width<i.height?"portrait":"square",safe:{top:0,bottom:0,left:0,right:0}},combo:i.combo,dur:i.end-i.start,asset:i.asset,words:()=>[],at:b("ctx.at()"),layer:{start:0,end:i.end-i.start},wait:i.wait,report:i.report,captions:()=>[],face:()=>{},faces:()=>[],texts:()=>[],covered:[],content:[0,0,i.width,i.height],realTimers:rt}}
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "@allyhub-next/slides-runtime",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
8
8
  "default": "./dist/index.js"
9
+ },
10
+ "./draw": {
11
+ "types": "./dist/draw.d.ts",
12
+ "default": "./dist/draw.js"
9
13
  }
10
14
  },
11
15
  "sideEffects": false,
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export{BUILD_BASE,STAGE_BASE,STAGE_PAGE,mediaUrl,serveStage}from"./server.js";export{LoadError,StagePage}from"./page.js";export{graphicsPage}from"./graphics.js";export{sceneryHost,serveDecoders}from"./scenery.js";export{stageIdentity}from"./identity.js";export{SceneryCallError,SceneryStage,sceneryBuildDir}from"./scenery-page.js";export{BAKE_INDEX,bakeReportFile,bakeStatus,bakesOnDisk,keepBake,readBakeIndex}from"./bakes.js";export{solveSceneryCamera,solvedPicture}from"./scenery-solve.js";
2
+ export{BUILD_BASE,STAGE_BASE,STAGE_PAGE,runtimeMounts,serveStage}from"./server.js";export{LoadError,StagePage}from"./page.js";export{graphicsPage}from"./graphics.js";export{sceneryHost,serveDecoders}from"./scenery.js";export{stageIdentity}from"./identity.js";export{SceneryCallError,SceneryStage,sceneryBuildDir}from"./scenery-page.js";export{BAKE_INDEX,bakeReportFile,bakeStatus,bakesOnDisk,keepBake,readBakeIndex}from"./bakes.js";export{solveSceneryCamera,solvedPicture}from"./scenery-solve.js";
@@ -1,6 +1,6 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{EvaluationError as c,beginFrames as l,openPage as h,screenshots as p}from"@allyhub-next/browser";import{HIDE_OUTLINE_CSS as d,HIDE_TEXT_CSS as g,formatInfo as m}from"@allyhub-next/video-core";import{STAGE_PAGE as w}from"./server.js";const f="ak-hide-text";export class LoadError extends Error{code;detail;constructor(e,t,r=t){super(t),this.name="LoadError",this.code=e,this.detail=r}}const n=(o,...e)=>`window.allyhub.${o}(${e.map(t=>t===void 0?"undefined":JSON.stringify(t)).join(", ")})`;export class StagePage{page;drawing;summary;constructor(e,t){this.page=e,this.drawing=t}static async open(e,t){const r=m(e.format);if(!r)throw new Error(`${e.format} is not a format.`);const s=t.beginFrame===!0,a=await h(t.browser,{width:r.width,height:r.height,allow:t.server.allow,beginFrame:s}),i=s?l(a):p(a);try{await i.settle(a.goto(`${t.server.origin}${w}`)),await i.settle(a.evaluate("new Promise((resolve) => { const ok = () => window.allyhub ? resolve(true) : setTimeout(ok, 10); ok(); })"))}catch(u){throw await a.close(),u}return new StagePage(a,i)}async load(e,t){try{return this.summary=await this.drawing.settle(this.page.evaluate(n("load",e,t),{timeoutMs:3e5})),this.summary}catch(r){if(r instanceof c){const s=/^(?:LoadFailure: )?([a-z_]+|AK-[A-Z]\d{3}): ([\s\S]*)$/u.exec(r.message.split(`
3
- `)[0]??"");if(s?.[1]&&s[2])throw new LoadError(s[1],s[2],r.message)}throw r}}output(e,...t){return this.drawing.settle(this.page.evaluate(n(`output.${e}`,...t),{timeoutMs:3e5}))}seek(e,t){return this.output("seek",e,t)}signature(){return this.page.evaluate("window.allyhub.output.signature() ?? null").then(e=>e??void 0)}signatureAt(e){return this.output("signatureAt",e).then(t=>t??void 0)}capture(e={}){return this.drawing.frame({format:e.format??"png",...e.quality===void 0?{}:{quality:e.quality},alpha:e.alpha??!1})}partSignature(e,t){return this.output("partSignature",e,t)}problems(){return this.output("problems")}stuck(){return this.page.evaluate("window.allyhub.output.stuck() ?? null").then(e=>e??void 0)}words(){return this.output("words")}lines(){return this.output("lines")}captionOptions(){return this.output("captionOptions").then(e=>e??void 0)}measure(e){return this.output("measure",e)}tracks(e,t){return this.output("tracks",e,t)}inks(e){return this.output("inks",e)}deck(){return this.output("deck")}async hideText(e,t=!1){const r=t?d:g,s=JSON.stringify(f);await this.page.evaluate(`(() => { const w = window; const kept = w[${s}]; document.adoptedStyleSheets = document.adoptedStyleSheets.filter((x) => x !== kept); if (!${String(e)}) return; const s = new CSSStyleSheet(); s.replaceSync(${JSON.stringify(r)}); w[${s}] = s; document.adoptedStyleSheets = [...document.adoptedStyleSheets, s]; })()`)}drawCover(e){return this.output("drawCover",e)}ask(e,t){return this.output("ask",e,t)}async print(e,t){const r=this.summary?.timeline;if(!r)throw new Error("Print a stage page once a piece is loaded.");await this.drawing.settle(this.page.evaluate(`(${y})(${JSON.stringify({pages:e,width:r.width,height:r.height,paper:t})})`,{timeoutMs:3e5}));const s=await this.page.session.send("Page.printToPDF",{printBackground:!0,preferCSSPageSize:!0,generateTaggedPDF:!0,generateDocumentOutline:!0});return Buffer.from(s.data,"base64")}console(){return this.page.evaluate(n("console"))}refused(){return this.page.refused()}close(){return this.page.close()}}const y=`async ({ pages, width, height, paper }) => {
2
+ import{EvaluationError as c,beginFrames as l,openPage as h,screenshots as p}from"@allyhub-next/browser";import{HIDE_OUTLINE_CSS as d,HIDE_TEXT_CSS as g,formatInfo as m}from"@allyhub-next/video-core";import{STAGE_PAGE as w}from"./server.js";const f="ak-hide-text";export class LoadError extends Error{code;detail;constructor(e,t,s=t){super(t),this.name="LoadError",this.code=e,this.detail=s}}const o=(i,...e)=>`window.allyhub.${i}(${e.map(t=>t===void 0?"undefined":JSON.stringify(t)).join(", ")})`;export class StagePage{page;drawing;summary;constructor(e,t){this.page=e,this.drawing=t}static async open(e,t){const s=m(e.format);if(!s)throw new Error(`${e.format} is not a format.`);const r=t.beginFrame===!0,a=await h(t.browser,{width:s.width,height:s.height,allow:t.server.allow,beginFrame:r}),n=r?l(a):p(a);try{await n.settle(a.goto(`${t.server.origin}${w}`)),await n.settle(a.evaluate("new Promise((resolve) => { const ok = () => window.allyhub ? resolve(true) : setTimeout(ok, 10); ok(); })"))}catch(u){throw await a.close(),u}return new StagePage(a,n)}async load(e,t){try{return this.summary=await this.drawing.settle(this.page.evaluate(o("load",e,t),{timeoutMs:3e5})),this.summary}catch(s){if(s instanceof c){const r=/^(?:LoadFailure: )?([a-z_]+|AK-[A-Z]\d{3}): ([\s\S]*)$/u.exec(s.message.split(`
3
+ `)[0]??"");if(r?.[1]&&r[2])throw new LoadError(r[1],r[2],s.message)}throw s}}component(e,t,s){return this.drawing.settle(this.page.evaluate(o("component",e,t,s),{timeoutMs:3e5}))}output(e,...t){return this.drawing.settle(this.page.evaluate(o(`output.${e}`,...t),{timeoutMs:3e5}))}seek(e,t){return this.output("seek",e,t)}signature(){return this.page.evaluate("window.allyhub.output.signature() ?? null").then(e=>e??void 0)}signatureAt(e){return this.output("signatureAt",e).then(t=>t??void 0)}capture(e={}){return this.drawing.frame({format:e.format??"png",...e.quality===void 0?{}:{quality:e.quality},alpha:e.alpha??!1,...e.scale===void 0?{}:{scale:e.scale}})}partSignature(e,t){return this.output("partSignature",e,t)}problems(){return this.output("problems")}stuck(){return this.page.evaluate("window.allyhub.output.stuck() ?? null").then(e=>e??void 0)}words(){return this.output("words")}lines(){return this.output("lines")}captionOptions(){return this.output("captionOptions").then(e=>e??void 0)}measure(e){return this.output("measure",e)}tracks(e,t){return this.output("tracks",e,t)}inks(e){return this.output("inks",e)}deck(){return this.output("deck")}async hideText(e,t=!1){const s=t?d:g,r=JSON.stringify(f);await this.page.evaluate(`(() => { const w = window; const kept = w[${r}]; document.adoptedStyleSheets = document.adoptedStyleSheets.filter((x) => x !== kept); if (!${String(e)}) return; const s = new CSSStyleSheet(); s.replaceSync(${JSON.stringify(s)}); w[${r}] = s; document.adoptedStyleSheets = [...document.adoptedStyleSheets, s]; })()`)}drawCover(e){return this.output("drawCover",e)}ask(e,t){return this.output("ask",e,t)}async print(e,t){const s=this.summary?.timeline;if(!s)throw new Error("Print a stage page once a piece is loaded.");await this.drawing.settle(this.page.evaluate(`(${y})(${JSON.stringify({pages:e,width:s.width,height:s.height,paper:t})})`,{timeoutMs:3e5}));const r=await this.page.session.send("Page.printToPDF",{printBackground:!0,preferCSSPageSize:!0,generateTaggedPDF:!0});return Buffer.from(r.data,"base64")}console(){return this.page.evaluate(o("console"))}refused(){return this.page.refused()}close(){return this.page.close()}}const y=`async ({ pages, width, height, paper }) => {
4
4
  const stage = document.getElementById("ak-stage");
5
5
  if (!stage) throw new Error("no stage");
6
6
  const [pw = width + "px", ph = height + "px"] = paper.split(" ");
@@ -10,21 +10,27 @@ import{EvaluationError as c,beginFrames as l,openPage as h,screenshots as p}from
10
10
  const scale = probe.getBoundingClientRect().width / width;
11
11
  probe.remove();
12
12
  const sheets = [];
13
- for (const { still, title, background } of pages) {
14
- await window.allyhub.output.seek(still);
15
- const copy = stage.cloneNode(true);
13
+ const output = window.allyhub.output;
14
+ for (const { still, background } of pages) {
15
+ await output.seek(still);
16
+ // What the sheet shows: a deck's slide on show alone, in a copy of the
17
+ // stage without its other slides; else the whole stage.
18
+ const shown = output.sheet ? output.sheet() : undefined;
19
+ const source = shown ?? stage;
20
+ const copy = stage.cloneNode(!shown);
21
+ if (shown) copy.append(shown.cloneNode(true));
16
22
  copy.style.background = background;
17
23
  // A deck's film has shapes under it, its slide's background among them:
18
24
  // its box shows that part of the page's picture, in its place among them.
19
25
  const picture = background.startsWith("url(") ? background.slice(0, background.indexOf(") ") + 1) : "";
20
26
  const at = stage.getBoundingClientRect();
21
- const films = stage.querySelectorAll("[data-ak-film]");
27
+ const films = source.querySelectorAll("[data-ak-film]");
22
28
  copy.querySelectorAll("[data-ak-film]").forEach((film, i) => {
23
29
  const box = films[i]?.getBoundingClientRect();
24
30
  if (!box || picture === "") return;
25
31
  film.style.background = picture + " " + (at.left - box.left) + "px " + (at.top - box.top) + "px / " + width + "px " + height + "px no-repeat";
26
32
  });
27
- const from = stage.querySelectorAll("canvas");
33
+ const from = source.querySelectorAll("canvas");
28
34
  copy.querySelectorAll("canvas").forEach((c, i) => {
29
35
  const img = document.createElement("img");
30
36
  img.src = from[i] ? from[i].toDataURL() : "";
@@ -36,13 +42,17 @@ import{EvaluationError as c,beginFrames as l,openPage as h,screenshots as p}from
36
42
  copy.removeAttribute("id");
37
43
  copy.style.transform = scale === 1 ? "" : "scale(" + scale + ")";
38
44
  copy.style.transformOrigin = "0 0";
39
- const heading = document.createElement("h1");
40
- heading.textContent = title;
41
- heading.style.cssText = "position:absolute;left:0;top:0;margin:0;padding:0;font-size:1px;line-height:1px;color:transparent;white-space:nowrap;pointer-events:none";
45
+ // A link in its text is one in the PDF: Chrome prints an anchor as one.
46
+ copy.querySelectorAll("[data-ak-link]").forEach((run) => {
47
+ const a = document.createElement("a");
48
+ a.href = run.dataset.akLink;
49
+ a.style.cssText = "color:inherit;text-decoration:inherit";
50
+ run.replaceWith(a);
51
+ a.append(run);
52
+ });
42
53
  const sheet = document.createElement("div");
43
54
  sheet.style.cssText = "position:relative;width:" + pw + ";height:" + ph + ";overflow:hidden;break-after:page;";
44
- if (copy.querySelector("h1, h2, h3, h4, h5, h6")) sheet.append(copy);
45
- else sheet.append(heading, copy);
55
+ sheet.append(copy);
46
56
  sheets.push(sheet);
47
57
  }
48
58
  const style = document.createElement("style");
@@ -1,12 +1,12 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{readFile as p}from"node:fs/promises";import{join as d}from"node:path";import{PACKAGE_FILE as k}from"@allyhub-next/formats";import{openPage as g,startServer as S}from"@allyhub-next/browser";import{allyhubPlugin as v,listFiles as $,loadUserVite as D,readMedia as O}from"@allyhub-next/build";import{BAKE_DIR as E,ruleOf as x}from"@allyhub-next/scenery-host";import{bundleScenery as U}from"@allyhub-next/scenery-host/bundle";import{bakesOnDisk as N}from"./bakes.js";import{sceneryHost as W}from"./scenery.js";export const BAKE_TIMEOUT_MS=720*6e4;export class SceneryCallError extends Error{kind;rule;needsTime;constructor(e,t,a){super(t),this.name="SceneryCallError",this.kind=e,this.rule=x(e),this.needsTime=a}}const A=new Set(["build","renderer","file","camera","name"]),h=r=>new SceneryCallError(r.kind!==void 0&&A.has(r.kind)?r.kind:"build",r.message??"",r.needsTime),y="/scenery.html";export class SceneryStage{page;server;constructor(e,t){this.page=e,this.server=t}static async open(e){const{root:t,file:a,buildDir:s}=e,o=W(t),u=await D(t),n=await U({root:t,file:a,outDir:s,dependencies:e.dependencies,plugins:[v({root:t,media:e.media,dependencies:e.dependencies,lent:o.lent,mediaUrl:i=>`/files/${i}`})],...u?{user:u}:{}}),b={module:a,decoders:`/build/${n.decoders}`,seed:a,manifoldWasm:`/build/${n.manifoldWasm}`,xatlasWasm:`/build/${n.xatlasWasm}`,...e.unbaked?{unbaked:!0}:{}},m=e.unbaked?[]:[...await N(t)],f=`<!doctype html><html><head><meta charset="utf-8"><style>html,body{margin:0;background:#000}</style></head><body><script type="module">
2
+ import{readFile as k}from"node:fs/promises";import{join as c}from"node:path";import{PACKAGE_FILE as g}from"@allyhub-next/formats";import{openPage as S,startServer as v}from"@allyhub-next/browser";import{allyhubPlugin as E,listFiles as D,loadUserVite as O,readMedia as $}from"@allyhub-next/build";import{BAKE_DIR as x,ruleOf as N}from"@allyhub-next/scenery-host";import{SCENERY_STAGE as U,bundleScenery as A,sceneryHref as C}from"@allyhub-next/scenery-host/bundle";import{bakesOnDisk as T}from"./bakes.js";import{sceneryHost as W}from"./scenery.js";export const BAKE_TIMEOUT_MS=720*6e4;export class SceneryCallError extends Error{kind;rule;needsTime;constructor(e,t,a){super(t),this.name="SceneryCallError",this.kind=e,this.rule=N(e),this.needsTime=a}}const j=new Set(["build","renderer","file","camera","name"]),y=r=>new SceneryCallError(r.kind!==void 0&&j.has(r.kind)?r.kind:"build",r.message??"",r.needsTime),p="/scenery.html";export class SceneryStage{page;server;constructor(e,t){this.page=e,this.server=t}static async open(e){const{root:t,file:a,buildDir:n}=e,d=W(t),u=await O(t),i=await A({root:t,file:a,outDir:n,dependencies:e.dependencies,plugins:[E({root:t,media:e.media,dependencies:e.dependencies,lent:d.lent})],...u?{user:u}:{}}),o=s=>`/scenery/${C(s)}`,f={module:a,decoders:o(i.decoders),seed:a,manifoldWasm:o(i.manifoldWasm),xatlasWasm:o(i.xatlasWasm),...e.unbaked?{unbaked:!0}:{}},w=e.unbaked?[]:[...await T(t)],b=`<!doctype html><html><head><meta charset="utf-8"><style>html,body{margin:0;background:#000}</style></head><body><script type="module">
3
3
  try {
4
- const m = await import(${JSON.stringify(`/build/${n.module}`)});
5
- const bakes = new Set(${JSON.stringify(m)});
4
+ const m = await import(${JSON.stringify(o(i.module))});
5
+ const bakes = new Set(${JSON.stringify(w)});
6
6
  const bakeUrl = (d, r) => (bakes.has(d + "." + r) ? "/bakes/" + d + "." + r + ".bin" : undefined);
7
- const opened = await m.openScenery(m.scenery, { ...${JSON.stringify(b)}, assetUrl: (p) => "/files/" + p, bakeUrl });
7
+ const opened = await m.openScenery(m.scenery, { ...${JSON.stringify(f)}, assetUrl: (p) => "/media/" + p.replace(/^\\/+/, "").split("/").map(encodeURIComponent).join("/"), bakeUrl });
8
8
  window.scenery = opened;
9
9
  } catch (e) {
10
10
  window.scenery = { ok: false, kind: "build", message: String((e && e.stack) || e) };
11
11
  }
12
- <\/script></body></html>`,c=await S([{at:y,body:f,type:"text/html; charset=utf-8"},{at:"/build/",dir:s},{at:"/files/",dir:t,only:new Set(Object.keys(e.media))},{at:"/bakes/",dir:d(t,E),only:new Set(m.map(i=>`${i}.bin`))}]),l=await g(e.browser,{width:e.width??1280,height:e.height??720,allow:c.allow}),w=new SceneryStage(l,c);try{await l.goto(`${c.origin}${y}`);const i=await l.evaluate("new Promise((ok) => { const w = () => (window.scenery ? ok(window.scenery.ok ? { ok: true } : window.scenery) : setTimeout(w, 20)); w(); })",{timeoutMs:12e4});if(!i.ok)throw h(i)}catch(i){throw await w.close(),i}return w}call(e,...t){return this.callWithin(3e5,e,...t)}callWithin(e,t,...a){const s=a.map(o=>JSON.stringify(o)).join(", ");return this.page.evaluate(`window.scenery.value.${t}(${s})`,{timeoutMs:e})}async value(e){const t=await e;if(!t.ok)throw h(t);return t.value}async bake(){const e=await this.value(this.callWithin(BAKE_TIMEOUT_MS,"bake")),t=[],a=4<<20;for(let s=0;s<e.bytes;s+=a)t.push(Buffer.from(await this.value(this.call("bakeChunk",s,a)),"base64"));return{report:e,bytes:new Uint8Array(Buffer.concat(t))}}static async ofProject(e){const t=await $(e.root);return SceneryStage.open({...e,buildDir:e.buildDir??sceneryBuildDir(e.root),media:await O(e.root,t),dependencies:await P(e.root)})}async close(){await this.page.close(),await this.server.close()}}async function P(r){try{const e=JSON.parse(await p(d(r,k),"utf8"));return new Set(["dependencies","devDependencies","peerDependencies","optionalDependencies"].flatMap(t=>Object.keys(e[t]??{})))}catch{return new Set}}export const sceneryBuildDir=r=>d(r,".allyhub/cache/build-scenery");
12
+ <\/script></body></html>`,l=await v([{at:p,body:b,type:"text/html; charset=utf-8"},{at:"/scenery/",dir:c(n,U)},{at:"/media/",dir:t,only:new Set(Object.keys(e.media))},{at:"/bakes/",dir:c(t,x),only:new Set(w.map(s=>`${s}.bin`))}]),m=await S(e.browser,{width:e.width??1280,height:e.height??720,allow:l.allow}),h=new SceneryStage(m,l);try{await m.goto(`${l.origin}${p}`);const s=await m.evaluate("new Promise((ok) => { const w = () => (window.scenery ? ok(window.scenery.ok ? { ok: true } : window.scenery) : setTimeout(w, 20)); w(); })",{timeoutMs:12e4});if(!s.ok)throw y(s)}catch(s){throw await h.close(),s}return h}call(e,...t){return this.callWithin(3e5,e,...t)}callWithin(e,t,...a){const n=a.map(d=>JSON.stringify(d)).join(", ");return this.page.evaluate(`window.scenery.value.${t}(${n})`,{timeoutMs:e})}async value(e){const t=await e;if(!t.ok)throw y(t);return t.value}async bake(){const e=await this.value(this.callWithin(BAKE_TIMEOUT_MS,"bake")),t=[],a=4<<20;for(let n=0;n<e.bytes;n+=a)t.push(Buffer.from(await this.value(this.call("bakeChunk",n,a)),"base64"));return{report:e,bytes:new Uint8Array(Buffer.concat(t))}}static async ofProject(e){const t=await D(e.root);return SceneryStage.open({...e,buildDir:e.buildDir??sceneryBuildDir(e.root),media:await $(e.root,t),dependencies:await P(e.root)})}async close(){await this.page.close(),await this.server.close()}}async function P(r){try{const e=JSON.parse(await k(c(r,g),"utf8"));return new Set(["dependencies","devDependencies","peerDependencies","optionalDependencies"].flatMap(t=>Object.keys(e[t]??{})))}catch{return new Set}}export const sceneryBuildDir=r=>c(r,".allyhub/cache/build-scenery");
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{readFileSync as o}from"node:fs";import{startServer as i}from"@allyhub-next/browser";import{stageFiles as m,stageHtml as s}from"@allyhub-next/stage-page";export const STAGE_BASE="/__allyhub/",STAGE_PAGE=`${STAGE_BASE}stage.html`,BUILD_BASE="/build/",mediaUrl=t=>`/media/${t.split("/").map(encodeURIComponent).join("/")}`;export function serveStage(t){const e=m();return i([{at:STAGE_PAGE,body:s({base:STAGE_BASE}),type:"text/html; charset=utf-8"},{at:`${STAGE_BASE}runtime.js`,body:o(e.runtime),type:"text/javascript; charset=utf-8"},...Object.entries(e.fonts).map(([r,a])=>({at:`${STAGE_BASE}${r}/`,dir:a})),{at:BUILD_BASE,dir:t.buildDir},{at:"/media/",dir:t.root,only:new Set(t.media)},...t.mounts??[]])}
2
+ import{startServer as o}from"@allyhub-next/browser";import{BUILD_FOLDER as i}from"@allyhub-next/build";import{stageFiles as n}from"@allyhub-next/stage-page";export const STAGE_BASE="/runtime/",STAGE_PAGE=`${STAGE_BASE}stage.html`,BUILD_BASE=`/${i}`;export function runtimeMounts(){const t=n();return[...Object.entries(t.fonts).map(([r,e])=>({at:`${STAGE_BASE}${r}/`,dir:e})),{at:STAGE_BASE,dir:t.dir}]}export function serveStage(t){return o([...runtimeMounts(),{at:BUILD_BASE,dir:t.buildDir},{at:"/media/",dir:t.root,only:new Set(t.media)},...t.mounts??[]])}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/stage",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {