allyhub 0.9.0 → 0.10.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 (461) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/commands/auth.js +4 -4
  3. package/dist/commands/cloud-tools.js +11 -11
  4. package/dist/commands/frames/compare.js +2 -2
  5. package/dist/commands/frames/piece.js +1 -1
  6. package/dist/commands/frames.js +8 -8
  7. package/dist/commands/index.js +1 -1
  8. package/dist/commands/inspect/common.js +4 -2
  9. package/dist/commands/inspect/facts.js +3 -3
  10. package/dist/commands/inspect/layout.js +1 -1
  11. package/dist/commands/orgs.js +2 -2
  12. package/dist/help.js +4 -4
  13. package/dist/main.js +8 -7
  14. package/dist/node_modules/@allyhub/3d-extension/package.json +34 -2
  15. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  16. package/dist/node_modules/@allyhub/browser/package.json +1 -1
  17. package/dist/node_modules/@allyhub/build/package.json +1 -1
  18. package/dist/node_modules/@allyhub/canvas-extension/package.json +2 -1
  19. package/dist/node_modules/@allyhub/canvas-extension/skills/allyhub/references/canvas.md +4 -24
  20. package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
  21. package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +2 -2
  22. package/dist/node_modules/@allyhub/chart/dist/chart.js +1 -1
  23. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  24. package/dist/node_modules/@allyhub/check/package.json +1 -1
  25. package/dist/node_modules/@allyhub/cloud/dist/client.d.ts +10 -0
  26. package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
  27. package/dist/node_modules/@allyhub/cloud/dist/config.d.ts +9 -0
  28. package/dist/node_modules/@allyhub/cloud/dist/config.js +1 -1
  29. package/dist/node_modules/@allyhub/cloud/dist/credentials.d.ts +4 -4
  30. package/dist/node_modules/@allyhub/cloud/dist/credentials.js +2 -2
  31. package/dist/node_modules/@allyhub/cloud/dist/device.d.ts +12 -0
  32. package/dist/node_modules/@allyhub/cloud/dist/device.js +2 -0
  33. package/dist/node_modules/@allyhub/cloud/package.json +1 -1
  34. package/dist/node_modules/@allyhub/components/package.json +1 -1
  35. package/dist/node_modules/@allyhub/components/r/callout.json +1 -1
  36. package/dist/node_modules/@allyhub/components/src/callout.ts +98 -13
  37. package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
  38. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  39. package/dist/node_modules/@allyhub/doc/dist/captions.js +1 -1
  40. package/dist/node_modules/@allyhub/doc/dist/docx.js +4 -4
  41. package/dist/node_modules/@allyhub/doc/dist/html.js +50 -47
  42. package/dist/node_modules/@allyhub/doc/dist/model.js +1 -1
  43. package/dist/node_modules/@allyhub/doc/dist/page.js +1 -1
  44. package/dist/node_modules/@allyhub/doc/dist/paper.js +1 -1
  45. package/dist/node_modules/@allyhub/doc/dist/table.js +1 -1
  46. package/dist/node_modules/@allyhub/doc/dist/write.js +22 -22
  47. package/dist/node_modules/@allyhub/doc/package.json +1 -1
  48. package/dist/node_modules/@allyhub/doc-extension/dist/export.js +1 -1
  49. package/dist/node_modules/@allyhub/doc-extension/package.json +17 -2
  50. package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
  51. package/dist/node_modules/@allyhub/export/dist/export.js +1 -1
  52. package/dist/node_modules/@allyhub/export/package.json +1 -1
  53. package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
  54. package/dist/node_modules/@allyhub/extension-host/dist/points.js +1 -1
  55. package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
  56. package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +1 -1
  57. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +87 -1
  58. package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
  59. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +89 -0
  60. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  61. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +50 -0
  62. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  63. package/dist/node_modules/@allyhub/i18n/package.json +1 -1
  64. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  65. package/dist/node_modules/@allyhub/image-extension/package.json +16 -1
  66. package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +7 -39
  67. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  68. package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
  69. package/dist/node_modules/@allyhub/image-render/package.json +1 -1
  70. package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
  71. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  72. package/dist/node_modules/@allyhub/jobs/package.json +1 -1
  73. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  74. package/dist/node_modules/@allyhub/media/package.json +1 -1
  75. package/dist/node_modules/@allyhub/media-extension/dist/vision/faces.js +1 -1
  76. package/dist/node_modules/@allyhub/media-extension/package.json +7 -4
  77. package/dist/node_modules/@allyhub/model/package.json +1 -1
  78. package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.js +1 -1
  79. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  80. package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +16 -0
  81. package/dist/node_modules/@allyhub/piece/dist/page/locate.js +1 -1
  82. package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +6 -0
  83. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  84. package/dist/node_modules/@allyhub/project/dist/version.js +1 -1
  85. package/dist/node_modules/@allyhub/project/package.json +1 -1
  86. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +132 -0
  87. package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
  88. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +19 -1
  89. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  90. package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.d.ts +337 -0
  91. package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.js +2 -0
  92. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +153 -0
  93. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  94. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +4 -2
  95. package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
  96. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +43 -188
  97. package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
  98. package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +1 -0
  99. package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
  100. package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +1 -0
  101. package/dist/node_modules/@allyhub/protocol/dist/mail.js +1 -1
  102. package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +51 -91
  103. package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
  104. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +3 -3
  105. package/dist/node_modules/@allyhub/protocol/package.json +5 -1
  106. package/dist/node_modules/@allyhub/registry/package.json +1 -1
  107. package/dist/node_modules/@allyhub/render/dist/look.js +1 -1
  108. package/dist/node_modules/@allyhub/render/package.json +1 -1
  109. package/dist/node_modules/@allyhub/runtime/dist/compose.js +1 -1
  110. package/dist/node_modules/@allyhub/runtime/dist/embed.js +1 -1
  111. package/dist/node_modules/@allyhub/runtime/dist/player/clips.js +1 -1
  112. package/dist/node_modules/@allyhub/runtime/package.json +1 -1
  113. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  114. package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
  115. package/dist/node_modules/@allyhub/scenery/dist/index.d.ts +2 -2
  116. package/dist/node_modules/@allyhub/scenery/dist/index.js +1 -1
  117. package/dist/node_modules/@allyhub/scenery/dist/moire.d.ts +45 -5
  118. package/dist/node_modules/@allyhub/scenery/dist/moire.js +2 -2
  119. package/dist/node_modules/@allyhub/scenery/dist/phone.d.ts +4 -3
  120. package/dist/node_modules/@allyhub/scenery/dist/phone.js +1 -1
  121. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  122. package/dist/node_modules/@allyhub/scenery-host/dist/layer/grade.d.ts +7 -0
  123. package/dist/node_modules/@allyhub/scenery-host/dist/layer/grade.js +2 -0
  124. package/dist/node_modules/@allyhub/scenery-host/dist/layer/index.d.ts +4 -3
  125. package/dist/node_modules/@allyhub/scenery-host/dist/layer/index.js +1 -1
  126. package/dist/node_modules/@allyhub/scenery-host/dist/layer/screens.d.ts +1 -1
  127. package/dist/node_modules/@allyhub/scenery-host/dist/layer/screens.js +1 -1
  128. package/dist/node_modules/@allyhub/scenery-host/dist/measure/facts.js +1 -1
  129. package/dist/node_modules/@allyhub/scenery-host/dist/page/screens.d.ts +8 -0
  130. package/dist/node_modules/@allyhub/scenery-host/dist/page/screens.js +1 -1
  131. package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
  132. package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
  133. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  134. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
  135. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
  136. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.js +1 -1
  137. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
  138. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/kernels.js +1 -1
  139. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
  140. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/maths.js +1 -1
  141. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
  142. package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.js +1 -1
  143. package/dist/node_modules/@allyhub/sheet/dist/calc/types.js +1 -1
  144. package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
  145. package/dist/node_modules/@allyhub/sheet/dist/formula/move.js +1 -1
  146. package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
  147. package/dist/node_modules/@allyhub/sheet/dist/formula/print.js +1 -1
  148. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  149. package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
  150. package/dist/node_modules/@allyhub/sheet/dist/printed.js +2 -0
  151. package/dist/node_modules/@allyhub/sheet/dist/values.js +1 -1
  152. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  153. package/dist/node_modules/@allyhub/sheet/dist/write.js +15 -15
  154. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  155. package/dist/node_modules/@allyhub/sheet/dist/xlsx/formula.js +2 -2
  156. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  157. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  158. package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.js +3 -1
  159. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
  160. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  161. package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.js +3 -2
  162. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  163. package/dist/node_modules/@allyhub/sheet-extension/dist/export.js +4 -4
  164. package/dist/node_modules/@allyhub/sheet-extension/package.json +22 -3
  165. package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
  166. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  167. package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
  168. package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
  169. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  170. package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +1 -1
  171. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  172. package/dist/node_modules/@allyhub/slides-extension/package.json +20 -1
  173. package/dist/node_modules/@allyhub/slides-pptx/dist/import/code.js +2 -2
  174. package/dist/node_modules/@allyhub/slides-pptx/dist/import/index.js +2 -2
  175. package/dist/node_modules/@allyhub/slides-pptx/dist/read/common.js +1 -1
  176. package/dist/node_modules/@allyhub/slides-pptx/dist/read/shapes.js +1 -1
  177. package/dist/node_modules/@allyhub/slides-pptx/dist/read/text.js +1 -1
  178. package/dist/node_modules/@allyhub/slides-pptx/dist/shapes.js +1 -1
  179. package/dist/node_modules/@allyhub/slides-pptx/dist/text.js +1 -1
  180. package/dist/node_modules/@allyhub/slides-pptx/dist/write.js +2 -2
  181. package/dist/node_modules/@allyhub/slides-pptx/dist/xml.js +1 -1
  182. package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
  183. package/dist/node_modules/@allyhub/slides-runtime/dist/draw.js +2 -2
  184. package/dist/node_modules/@allyhub/slides-runtime/dist/load.js +5 -5
  185. package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
  186. package/dist/node_modules/@allyhub/stage/package.json +1 -1
  187. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400-italic.css +19 -0
  188. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400.css +19 -0
  189. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700-italic.css +19 -0
  190. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700.css +19 -0
  191. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/LICENSE +93 -0
  192. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/cambria.css +76 -0
  193. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-400-italic.woff2 +0 -0
  194. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-400-normal.woff2 +0 -0
  195. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-700-italic.woff2 +0 -0
  196. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-700-normal.woff2 +0 -0
  197. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-400-italic.woff2 +0 -0
  198. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-400-normal.woff2 +0 -0
  199. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-700-italic.woff2 +0 -0
  200. package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/files/caladea-latin-ext-700-normal.woff2 +0 -0
  201. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400-italic.css +79 -0
  202. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400.css +79 -0
  203. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700-italic.css +79 -0
  204. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700.css +79 -0
  205. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/LICENSE +93 -0
  206. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/courier-new.css +316 -0
  207. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-400-italic.woff2 +0 -0
  208. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-400-normal.woff2 +0 -0
  209. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-700-italic.woff2 +0 -0
  210. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-700-normal.woff2 +0 -0
  211. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-400-italic.woff2 +0 -0
  212. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-400-normal.woff2 +0 -0
  213. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-700-italic.woff2 +0 -0
  214. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-cyrillic-ext-700-normal.woff2 +0 -0
  215. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-400-italic.woff2 +0 -0
  216. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-400-normal.woff2 +0 -0
  217. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-700-italic.woff2 +0 -0
  218. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-700-normal.woff2 +0 -0
  219. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-400-italic.woff2 +0 -0
  220. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-400-normal.woff2 +0 -0
  221. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-700-italic.woff2 +0 -0
  222. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-greek-ext-700-normal.woff2 +0 -0
  223. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-400-italic.woff2 +0 -0
  224. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-400-normal.woff2 +0 -0
  225. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-700-italic.woff2 +0 -0
  226. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-hebrew-700-normal.woff2 +0 -0
  227. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-400-italic.woff2 +0 -0
  228. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-400-normal.woff2 +0 -0
  229. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-700-italic.woff2 +0 -0
  230. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-700-normal.woff2 +0 -0
  231. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-400-italic.woff2 +0 -0
  232. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-400-normal.woff2 +0 -0
  233. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-700-italic.woff2 +0 -0
  234. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-latin-ext-700-normal.woff2 +0 -0
  235. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-400-italic.woff2 +0 -0
  236. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-400-normal.woff2 +0 -0
  237. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-700-italic.woff2 +0 -0
  238. package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/files/cousine-vietnamese-700-normal.woff2 +0 -0
  239. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400-italic.css +79 -0
  240. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400.css +79 -0
  241. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700-italic.css +79 -0
  242. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700.css +79 -0
  243. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/LICENSE +93 -0
  244. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-400-italic.woff2 +0 -0
  245. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-400-normal.woff2 +0 -0
  246. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-700-italic.woff2 +0 -0
  247. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-700-normal.woff2 +0 -0
  248. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-400-italic.woff2 +0 -0
  249. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-400-normal.woff2 +0 -0
  250. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-700-italic.woff2 +0 -0
  251. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-cyrillic-ext-700-normal.woff2 +0 -0
  252. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-400-italic.woff2 +0 -0
  253. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-400-normal.woff2 +0 -0
  254. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-700-italic.woff2 +0 -0
  255. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-700-normal.woff2 +0 -0
  256. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-400-italic.woff2 +0 -0
  257. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-400-normal.woff2 +0 -0
  258. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-700-italic.woff2 +0 -0
  259. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-greek-ext-700-normal.woff2 +0 -0
  260. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-400-italic.woff2 +0 -0
  261. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-400-normal.woff2 +0 -0
  262. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-700-italic.woff2 +0 -0
  263. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-hebrew-700-normal.woff2 +0 -0
  264. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-400-italic.woff2 +0 -0
  265. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-400-normal.woff2 +0 -0
  266. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-700-italic.woff2 +0 -0
  267. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-700-normal.woff2 +0 -0
  268. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-400-italic.woff2 +0 -0
  269. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-400-normal.woff2 +0 -0
  270. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-700-italic.woff2 +0 -0
  271. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-latin-ext-700-normal.woff2 +0 -0
  272. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-400-italic.woff2 +0 -0
  273. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-400-normal.woff2 +0 -0
  274. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-700-italic.woff2 +0 -0
  275. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/files/tinos-vietnamese-700-normal.woff2 +0 -0
  276. package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/times-new-roman.css +316 -0
  277. package/dist/node_modules/@allyhub/stage-page/dist/host.js +1 -1
  278. package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.html +3 -0
  279. package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
  280. package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +19 -19
  281. package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
  282. package/dist/node_modules/@allyhub/video-core/dist/schema.js +1 -1
  283. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  284. package/dist/node_modules/@allyhub/video-extension/package.json +16 -1
  285. package/dist/node_modules/@allyhub/video-measure/dist/version.js +1 -1
  286. package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
  287. package/dist/node_modules/@allyhub/video-sdk/dist/phone.js +1 -1
  288. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  289. package/dist/node_modules/@allyhub/website/package.json +1 -1
  290. package/dist/node_modules/@allyhub/website-extension/dist/held.js +2 -0
  291. package/dist/node_modules/@allyhub/website-extension/dist/project-tools.js +24 -1
  292. package/dist/node_modules/@allyhub/website-extension/dist/tools.js +1 -1
  293. package/dist/node_modules/@allyhub/website-extension/package.json +49 -2
  294. package/dist/node_modules/@allyhub/x-extension/package.json +34 -4
  295. package/dist/node_modules/@allyhub/x-extension/skills/allyhub/references/x.md +7 -62
  296. package/dist/node_modules/@allyhub/x-model/package.json +1 -1
  297. package/dist/node_modules/@allyhub/x-view/dist/article.js +1 -1
  298. package/dist/node_modules/@allyhub/x-view/dist/index.js +1 -1
  299. package/dist/node_modules/@allyhub/x-view/dist/post.js +2 -2
  300. package/dist/node_modules/@allyhub/x-view/package.json +1 -1
  301. package/dist/package.json +10 -10
  302. package/dist/text/facts-text.js +5 -5
  303. package/dist/text/index.js +1 -1
  304. package/dist/text/long-text.js +4 -0
  305. package/dist/works.js +1 -1
  306. package/editor-web/assets/{abnfDiagram-WEYOIA3C-CN5PiJYY.js → abnfDiagram-WEYOIA3C-CjAmWsNR.js} +1 -1
  307. package/editor-web/assets/alt-DnBZJzEh.js +4 -0
  308. package/editor-web/assets/{architecture-WOLXFQ4H-BnvZtQYk.js → architecture-WOLXFQ4H-DeeKhyhZ.js} +1 -1
  309. package/editor-web/assets/{architectureDiagram-ZHVYKT53-tkcEcFQ8.js → architectureDiagram-ZHVYKT53-b32qTaJg.js} +1 -1
  310. package/editor-web/assets/{arrow-up-DTP2yVSU.js → arrow-up-L4YV_65f.js} +1 -1
  311. package/editor-web/assets/article-DLMjAdbP.js +73 -0
  312. package/editor-web/assets/{audio-lines-Ti8-m7H2.js → audio-lines-BFcM7G2L.js} +1 -1
  313. package/editor-web/assets/{blockDiagram-RJAE7QA3-DhqEIpie.js → blockDiagram-RJAE7QA3-BNbnMNmw.js} +1 -1
  314. package/editor-web/assets/button-Chk675Xu.js +41 -0
  315. package/editor-web/assets/{c4Diagram-XDPPPE54-Bg9G95tl.js → c4Diagram-XDPPPE54-BEuemvMw.js} +1 -1
  316. package/editor-web/assets/calc-worker-D2pGis6e.js +45 -0
  317. package/editor-web/assets/channel-EzYq4r0d.js +1 -0
  318. package/editor-web/assets/chart-Be9Hj5GL.js +1 -0
  319. package/editor-web/assets/choice-BgmBh4yu.js +1 -0
  320. package/editor-web/assets/{chunk-2E7WHVMD-C8Ve9lAa.js → chunk-2E7WHVMD-Zb5nPx_e.js} +1 -1
  321. package/editor-web/assets/{chunk-4EMNKR2T-BDWwPUnT.js → chunk-4EMNKR2T-DSEM2reX.js} +1 -1
  322. package/editor-web/assets/{chunk-55XCU76K-BQiNPKgx.js → chunk-55XCU76K-BOZa_65H.js} +1 -1
  323. package/editor-web/assets/{chunk-7S6XSTFO-QoEt-6jf.js → chunk-7S6XSTFO-DeiGeVpB.js} +1 -1
  324. package/editor-web/assets/{chunk-AQDTSKZB-BeuwIv0-.js → chunk-AQDTSKZB-fPuQFBJc.js} +1 -1
  325. package/editor-web/assets/{chunk-DSNLSHJZ-BHW7sLAz.js → chunk-DSNLSHJZ-5vdnoak2.js} +1 -1
  326. package/editor-web/assets/{chunk-HAGFOTED-bbGED0hu.js → chunk-HAGFOTED-DFF2mZJ1.js} +1 -1
  327. package/editor-web/assets/{chunk-HNE4Q36P-FltWp8yo.js → chunk-HNE4Q36P-g6-ZLbTg.js} +1 -1
  328. package/editor-web/assets/{chunk-NQOKRVIF-NeQzr6kH.js → chunk-NQOKRVIF-o3hNcHMJ.js} +1 -1
  329. package/editor-web/assets/{chunk-UHW7PFBP-eA4-WUhn.js → chunk-UHW7PFBP-BQiDI9dK.js} +1 -1
  330. package/editor-web/assets/{chunk-VQ5W62QI-BPPv325z.js → chunk-VQ5W62QI-CJlMXWWz.js} +1 -1
  331. package/editor-web/assets/{chunk-WQQL4CDK-DOCIz7Te.js → chunk-WQQL4CDK-pNBU8dXv.js} +1 -1
  332. package/editor-web/assets/{chunk-YZO67HFG-Dc_ihQJi.js → chunk-YZO67HFG-2x-BiWd-.js} +1 -1
  333. package/editor-web/assets/{chunk-ZAUX2LTX-CoqwCPSm.js → chunk-ZAUX2LTX-etFStEM8.js} +1 -1
  334. package/editor-web/assets/{chunk-ZCHMQSOR-CZUQPkJx.js → chunk-ZCHMQSOR-B3AYRhIY.js} +1 -1
  335. package/editor-web/assets/{classDiagram-v2-4MYWR3UA-DUh9c50k.js → classDiagram-v2-4MYWR3UA-6y2yX0oq.js} +1 -1
  336. package/editor-web/assets/collaborator-LRd0hELn.js +1 -0
  337. package/editor-web/assets/createLucideIcon-CPS-TrJJ.js +1 -0
  338. package/editor-web/assets/{cynefin-EF2NZ3EQ-DUTZiog0.js → cynefin-EF2NZ3EQ-CX4BTQQe.js} +1 -1
  339. package/editor-web/assets/{cynefinDiagram-WF24UDRP-oAjpfbrU.js → cynefinDiagram-WF24UDRP-LbDkOTy3.js} +1 -1
  340. package/editor-web/assets/{dagre-NK4GIZVX-BrKvKCvb.js → dagre-NK4GIZVX-wCKQk7hi.js} +1 -1
  341. package/editor-web/assets/{diagram-CBK3MWTC-GekVRnmm.js → diagram-CBK3MWTC-a9fofQwk.js} +1 -1
  342. package/editor-web/assets/{diagram-I5XIIV2D-CDd1VFRT.js → diagram-I5XIIV2D-UCLZWch5.js} +1 -1
  343. package/editor-web/assets/{diagram-ODIL2UCW-535RISTn.js → diagram-ODIL2UCW-CAEe88Lp.js} +1 -1
  344. package/editor-web/assets/{diagram-PFBEJUXE-MXzzKCGG.js → diagram-PFBEJUXE-Cp1o45bs.js} +1 -1
  345. package/editor-web/assets/{diagram-RJA3I4VV-vKVwkQxY.js → diagram-RJA3I4VV-c6OVxDyq.js} +1 -1
  346. package/editor-web/assets/{diagram-TYUNFSNR-UwGAiQLx.js → diagram-TYUNFSNR-BVRWslDM.js} +1 -1
  347. package/editor-web/assets/{dist-CKyfo5RM.js → dist--KKyT5zP.js} +1 -1
  348. package/editor-web/assets/dist-1k0MHB3i.js +1 -0
  349. package/editor-web/assets/dist-B9KHJqL5.js +4 -0
  350. package/editor-web/assets/dist-BbJyrhIY.js +1 -0
  351. package/editor-web/assets/dist-CJXCQxQM.js +37 -0
  352. package/editor-web/assets/dist-D9xQGwe9.js +5 -0
  353. package/editor-web/assets/dist-DFiLzbx8.js +219 -0
  354. package/editor-web/assets/{dist-shKo7XVN.js → dist-DIPV6xfF.js} +1 -1
  355. package/editor-web/assets/dist-Dp-fQMtx.js +6 -0
  356. package/editor-web/assets/dist-Duw28VxJ.js +16 -0
  357. package/editor-web/assets/{dist-9ymlIMhr.js → dist-DwGhfliS.js} +1 -1
  358. package/editor-web/assets/dist-OBE2IIYP.js +24 -0
  359. package/editor-web/assets/dist-j6ZLVcgf.js +38 -0
  360. package/editor-web/assets/{ebnfDiagram-V4P3TTPT-73yGokYa.js → ebnfDiagram-V4P3TTPT-KdOTJgFu.js} +1 -1
  361. package/editor-web/assets/{elk-QONTBCTQ-BW6V9y6a.js → elk-QONTBCTQ-Cmlrp7qB.js} +1 -1
  362. package/editor-web/assets/{erDiagram-KYQIGQAA-BPqIJ22h.js → erDiagram-KYQIGQAA-CBM7-aQm.js} +1 -1
  363. package/editor-web/assets/{eventmodeling-K75KTNOO-_VZ8jvuy.js → eventmodeling-K75KTNOO-CEoJkbuW.js} +1 -1
  364. package/editor-web/assets/flowDiagram-IUGLLWBU-Xm2E2ib_.js +1 -0
  365. package/editor-web/assets/{ganttDiagram-R7GPNTJY-DZ157JN2.js → ganttDiagram-R7GPNTJY-D4S6ZSYD.js} +1 -1
  366. package/editor-web/assets/{gitGraph-VSP46ZUC-fmcNL9bq.js → gitGraph-VSP46ZUC-BvkL6RSh.js} +1 -1
  367. package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-DiZDyksR.js → gitGraphDiagram-PDYL7XHY-lTGguloH.js} +1 -1
  368. package/editor-web/assets/hint-BimUgJms.js +1 -0
  369. package/editor-web/assets/index-C-i_iuxN.js +28 -0
  370. package/editor-web/assets/index-Cxh_Shkm.css +2 -0
  371. package/editor-web/assets/{info-OHQRW6UA-V06620kN.js → info-OHQRW6UA-DvKzqNvp.js} +1 -1
  372. package/editor-web/assets/{infoDiagram-MVDRKAX5-CbIgheWX.js → infoDiagram-MVDRKAX5-D7hCpehs.js} +1 -1
  373. package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-D5oJQPkG.js → ishikawaDiagram-HPEHV2GE-Bg93sZQe.js} +1 -1
  374. package/editor-web/assets/{italic-CDhZKo_q.js → italic-BQBwRTe8.js} +1 -1
  375. package/editor-web/assets/{journeyDiagram-BOSHW7O7-BZEv6JI4.js → journeyDiagram-BOSHW7O7-CKm_KONJ.js} +1 -1
  376. package/editor-web/assets/{kanban-definition-FNSA4HC5-CLG1R8y_.js → kanban-definition-FNSA4HC5-BKknnpTR.js} +1 -1
  377. package/editor-web/assets/{mermaid-parser.core-DxDwXM7z.js → mermaid-parser.core-BzqkDnqL.js} +3 -3
  378. package/editor-web/assets/{mermaid.core-tU55ZwVG.js → mermaid.core-CEpvTOAe.js} +4 -4
  379. package/editor-web/assets/{mindmap-definition-6OY57UG3-CYf4zzAh.js → mindmap-definition-6OY57UG3-BJ0qG8Wi.js} +1 -1
  380. package/editor-web/assets/minus-oPj1GxwA.js +1 -0
  381. package/editor-web/assets/{packet-JDAUHWVQ-DsHeKYNL.js → packet-JDAUHWVQ-ew3kvyFm.js} +1 -1
  382. package/editor-web/assets/{pegDiagram-ECIUJNBX-CQyh6TTa.js → pegDiagram-ECIUJNBX-DqUS2xit.js} +1 -1
  383. package/editor-web/assets/{pie-XZMESJXO-3vCIvpNB.js → pie-XZMESJXO-DTIAMPGm.js} +1 -1
  384. package/editor-web/assets/{pieDiagram-GNMPY74T-DF5yGBLn.js → pieDiagram-GNMPY74T-DoKOE02-.js} +1 -1
  385. package/editor-web/assets/progress-CPEbDOoN.js +6 -0
  386. package/editor-web/assets/{quadrantDiagram-D57K4MC3-B7pxlDYP.js → quadrantDiagram-D57K4MC3-DauOpYun.js} +1 -1
  387. package/editor-web/assets/{radar-ABXABTNO-cpEA41mL.js → radar-ABXABTNO-BvMJXUU-.js} +1 -1
  388. package/editor-web/assets/{railroad-I3PHUGI6-BLyy5R2c.js → railroad-I3PHUGI6-D3jdJmhM.js} +1 -1
  389. package/editor-web/assets/{railroad-abnf-LNEFI6M7-Y-oyol19.js → railroad-abnf-LNEFI6M7-Dm8ZpmPj.js} +1 -1
  390. package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-o58wHZsr.js → railroad-ebnf-DWYD2UWJ-oc0Du7Ag.js} +1 -1
  391. package/editor-web/assets/{railroad-peg-JR7BVNR7-CcD3PXZ8.js → railroad-peg-JR7BVNR7-CMrQL_7U.js} +1 -1
  392. package/editor-web/assets/{railroadDiagram-Y72NRBL7-BuCC4eyy.js → railroadDiagram-Y72NRBL7-y99z0C7i.js} +1 -1
  393. package/editor-web/assets/react-DztDSW4P.js +1 -0
  394. package/editor-web/assets/{repeat-2-C5PCbNsg.js → repeat-2-DJi4LW5C.js} +1 -1
  395. package/editor-web/assets/{requirementDiagram-EQYSW5RA-Dp-JFGn4.js → requirementDiagram-EQYSW5RA-jMr_uoF6.js} +1 -1
  396. package/editor-web/assets/row-ClBisiBs.js +1 -0
  397. package/editor-web/assets/{sankeyDiagram-SY24JHO5-rYuCqEvw.js → sankeyDiagram-SY24JHO5-DcUyx03Q.js} +1 -1
  398. package/editor-web/assets/schemas-68mjUjP5.js +1 -0
  399. package/editor-web/assets/{sequenceDiagram-BLEHNHQU-DryW8x6d.js → sequenceDiagram-BLEHNHQU-R4X8wRCd.js} +1 -1
  400. package/editor-web/assets/session-2u9U7koW.js +1 -0
  401. package/editor-web/assets/slides-BByblSSR.js +1 -0
  402. package/editor-web/assets/snapshots-C9KV-Y2_.js +56 -0
  403. package/editor-web/assets/sound-DExlNJbb.js +1 -0
  404. package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-Bnp0XfpT.js → stateDiagram-v2-A6IESKWZ-BqvXKbCA.js} +1 -1
  405. package/editor-web/assets/{strikethrough-DJckA35o.js → strikethrough-CyUBnGTl.js} +1 -1
  406. package/editor-web/assets/{svg-BjM9RazX.js → svg-lBRT-uhy.js} +1 -1
  407. package/editor-web/assets/swatch-1c1uVn1z.js +1 -0
  408. package/editor-web/assets/{swimlanes-B3ENRKFQ-BiRRhhbd.js → swimlanes-B3ENRKFQ-hjTXIc6M.js} +1 -1
  409. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-BLfytmPY.js +8 -0
  410. package/editor-web/assets/switch-D0K-K8-C.js +1 -0
  411. package/editor-web/assets/{syntax-CC6QYhCz.js → syntax-Bih_jv7W.js} +1 -1
  412. package/editor-web/assets/tabs-CxxOnGLR.js +1 -0
  413. package/editor-web/assets/{textarea-BGtPqZdB.js → textarea-Fu93tFO3.js} +1 -1
  414. package/editor-web/assets/{timeline-definition-JXYKGLGB-D-Q5ZtDF.js → timeline-definition-JXYKGLGB-BcSoN4Dq.js} +1 -1
  415. package/editor-web/assets/{trash-2-Bjj6cWzP.js → trash-2-BAKAeziW.js} +1 -1
  416. package/editor-web/assets/{treeView-D4JQ5SDB-B6DDatXq.js → treeView-D4JQ5SDB-CsFN2jrc.js} +1 -1
  417. package/editor-web/assets/{treemap-SAJKECNS-D7j5ZhiI.js → treemap-SAJKECNS-DP1eqXJ2.js} +1 -1
  418. package/editor-web/assets/{undo-2-yOSG766T.js → undo-2-DQ5CBmki.js} +1 -1
  419. package/editor-web/assets/{usecaseDiagram-WPOLBNNX-tkrdKUJB.js → usecaseDiagram-WPOLBNNX-BGxa0osF.js} +1 -1
  420. package/editor-web/assets/{vennDiagram-Q3Y3IDCW-Ch4XbSnD.js → vennDiagram-Q3Y3IDCW-D2XhTF49.js} +1 -1
  421. package/editor-web/assets/video-CDbPX4Cr.js +1 -0
  422. package/editor-web/assets/{wardley-7MLQ67FV-Bynt7qNQ.js → wardley-7MLQ67FV-DM3jMAbZ.js} +1 -1
  423. package/editor-web/assets/{wardleyDiagram-IVAIDKWA-DRuSgm_L.js → wardleyDiagram-IVAIDKWA-Bf-DaZEg.js} +1 -1
  424. package/editor-web/assets/{xychartDiagram-4URNHDU4-DctpvfkL.js → xychartDiagram-4URNHDU4-dp-mdcWd.js} +1 -1
  425. package/editor-web/index.html +6 -5
  426. package/package.json +2 -2
  427. package/editor-web/assets/alt-BOVao_9S.js +0 -4
  428. package/editor-web/assets/article-B6YCzhj8.js +0 -73
  429. package/editor-web/assets/calc-worker-B5-fDWnb.js +0 -45
  430. package/editor-web/assets/channel-C26aBI4o.js +0 -1
  431. package/editor-web/assets/chart-BOnxneyw.js +0 -1
  432. package/editor-web/assets/choice-O5nwc2N0.js +0 -1
  433. package/editor-web/assets/collaborator-BJU5qwHd.js +0 -1
  434. package/editor-web/assets/createLucideIcon-B3B95oX5.js +0 -1
  435. package/editor-web/assets/dist-C6NqUEG4.js +0 -16
  436. package/editor-web/assets/dist-C9UGmCG9.js +0 -6
  437. package/editor-web/assets/dist-CAk5bjBm.js +0 -1
  438. package/editor-web/assets/dist-CRaWqNwq.js +0 -37
  439. package/editor-web/assets/dist-CwIBc7HQ.js +0 -1
  440. package/editor-web/assets/dist-DXRmkezB.js +0 -38
  441. package/editor-web/assets/dist-EKK5i0dG.js +0 -219
  442. package/editor-web/assets/dist-hHJlpLWo.js +0 -5
  443. package/editor-web/assets/dist-oYKcwWUj.js +0 -4
  444. package/editor-web/assets/dist-wrKxBrVu.js +0 -24
  445. package/editor-web/assets/flowDiagram-IUGLLWBU-ouDQYiTr.js +0 -1
  446. package/editor-web/assets/hint-_AQWCDMj.js +0 -1
  447. package/editor-web/assets/index-BsstP-cI.js +0 -28
  448. package/editor-web/assets/index-DQRcmxBO.css +0 -2
  449. package/editor-web/assets/minus-Cgmm6ncD.js +0 -1
  450. package/editor-web/assets/progress-0B_TVsPi.js +0 -6
  451. package/editor-web/assets/react-BP46yLMB.js +0 -1
  452. package/editor-web/assets/react-pgBZqVxJ.js +0 -96
  453. package/editor-web/assets/schemas-Ewwjtbf4.js +0 -1
  454. package/editor-web/assets/session-DiI9KYRI.js +0 -1
  455. package/editor-web/assets/slides-CCwgBcGH.js +0 -1
  456. package/editor-web/assets/sound-CqryteNl.js +0 -1
  457. package/editor-web/assets/swatch-DL3HqIjW.js +0 -1
  458. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-BkOls8Tv.js +0 -8
  459. package/editor-web/assets/switch-DltnKqN-.js +0 -1
  460. package/editor-web/assets/tabs-C-re0Kxn.js +0 -1
  461. package/editor-web/assets/video-DXFiCNGc.js +0 -1
@@ -697,16 +697,99 @@ const seconds = (v: Time | undefined): number | undefined =>
697
697
  typeof v === "number" && Number.isFinite(v) ? v : undefined;
698
698
 
699
699
  let fontCanvas: CanvasRenderingContext2D | null | undefined;
700
+ let inkOf: InkOf | undefined;
701
+
702
+ /** A glyph's ink in ems from its pen position: how far above the baseline it reaches, where it starts and ends, and its advance. */
703
+ export interface GlyphInk {
704
+ top: number;
705
+ left: number;
706
+ right: number;
707
+ advance: number;
708
+ }
709
+
710
+ /** A font's face: its style, weight and family, at any size. */
711
+ export type TextFace = Pick<
712
+ CSSStyleDeclaration,
713
+ "fontStyle" | "fontWeight" | "fontFamily"
714
+ >;
715
+
716
+ /** Measures a glyph's ink in a face. */
717
+ export type InkOf = (face: TextFace, glyph: string) => GlyphInk | undefined;
718
+
719
+ /**
720
+ * Measures glyphs' ink by drawing them, each once per font. A canvas's
721
+ * `actualBoundingBox*` is not the ink: Chrome on Linux rounds it to whole
722
+ * pixels below 240px and to 1/64 of an em above (a capital's top 1.5px off
723
+ * at 120px). Drawn at 256px, with a pixel's coverage taken as the share of
724
+ * it inside the outline, the ink is within a few thousandths of an em.
725
+ * Self-contained, so it can be shown to a page as source.
726
+ */
727
+ export function glyphInk(): InkOf {
728
+ const R = 256;
729
+ const ox = R;
730
+ const oy = 1.5 * R;
731
+ const kept = new Map<string, GlyphInk | undefined>();
732
+ let g: CanvasRenderingContext2D | null | undefined;
733
+ return (face, glyph) => {
734
+ const font = `${face.fontStyle} ${face.fontWeight} ${String(R)}px ${face.fontFamily}`;
735
+ const key = `${font}\n${glyph}`;
736
+ if (kept.has(key)) return kept.get(key);
737
+ if (g === undefined) {
738
+ const c = document.createElement("canvas");
739
+ c.width = 3 * R;
740
+ c.height = 2 * R;
741
+ g = c.getContext("2d", { willReadFrequently: true });
742
+ }
743
+ let ink: GlyphInk | undefined;
744
+ if (g) {
745
+ const { width: W, height: H } = g.canvas;
746
+ g.clearRect(0, 0, W, H);
747
+ g.font = font;
748
+ g.textBaseline = "alphabetic";
749
+ g.fillStyle = "#000";
750
+ g.fillText(glyph, ox, oy);
751
+ const a = g.getImageData(0, 0, W, H).data;
752
+ const row = new Float64Array(H);
753
+ const col = new Float64Array(W);
754
+ for (let y = 0; y < H; y++) {
755
+ for (let x = 0; x < W; x++) {
756
+ const v = a[(y * W + x) * 4 + 3] ?? 0;
757
+ if (v > (row[y] ?? 0)) row[y] = v;
758
+ if (v > (col[x] ?? 0)) col[x] = v;
759
+ }
760
+ }
761
+ const t = row.findIndex((v) => v > 0);
762
+ const l = col.findIndex((v) => v > 0);
763
+ const r = col.findLastIndex((v) => v > 0);
764
+ if (t >= 0 && l >= 0 && r >= 0) {
765
+ // An edge's pixel is covered as far as the outline reaches into it.
766
+ const top = t + 1 - (row[t] ?? 0) / 255;
767
+ const left = l + 1 - (col[l] ?? 0) / 255;
768
+ const right = r + (col[r] ?? 0) / 255;
769
+ ink = {
770
+ top: (oy - top) / R,
771
+ left: (left - ox) / R,
772
+ right: (right - ox) / R,
773
+ advance: g.measureText(glyph).width / R,
774
+ };
775
+ }
776
+ }
777
+ kept.set(key, ink);
778
+ return ink;
779
+ };
780
+ }
700
781
 
701
782
  /**
702
783
  * The box an element's text reads as, in client pixels: from its capitals'
703
784
  * tops (the font's cap height above the baseline, lowercase text too) to
704
785
  * its baseline, and from its first glyph's ink to its last's. `g` measures
705
- * the fonts. Undefined when it has no text.
786
+ * the fonts' ascent and descent, `ink` the glyphs' ink. Undefined when it
787
+ * has no text.
706
788
  */
707
789
  export function textBoxOf(
708
790
  node: Element,
709
791
  g: CanvasRenderingContext2D,
792
+ ink: InkOf,
710
793
  ): DOMRect | undefined {
711
794
  const walk = document.createTreeWalker(node, NodeFilter.SHOW_TEXT);
712
795
  let x0 = Infinity;
@@ -719,11 +802,12 @@ export function textBoxOf(
719
802
  if (from < 0 || !n.parentElement) continue;
720
803
  const to = text.trimEnd().length;
721
804
  const cs = getComputedStyle(n.parentElement);
805
+ const size = parseFloat(cs.fontSize);
722
806
  g.font = `${cs.fontStyle} ${cs.fontWeight} ${cs.fontSize} ${cs.fontFamily}`;
723
807
  const H = g.measureText("H");
724
808
  const up = H.fontBoundingBoxAscent;
725
809
  const tall = up + H.fontBoundingBoxDescent;
726
- const cap = H.actualBoundingBoxAscent;
810
+ const cap = (ink(cs, "H")?.top ?? H.actualBoundingBoxAscent / size) * size;
727
811
  const range = document.createRange();
728
812
  range.setStart(n, from);
729
813
  range.setEnd(n, to);
@@ -732,7 +816,7 @@ export function textBoxOf(
732
816
  );
733
817
  const first = lines[0];
734
818
  const last = lines.at(-1);
735
- if (!first || !last || !(tall > 0)) continue;
819
+ if (!first || !last || !(tall > 0) || !(size > 0)) continue;
736
820
  for (const r of lines) {
737
821
  // A line's box is the font's ascent and descent, scaled as it is.
738
822
  const k = r.height / tall;
@@ -740,15 +824,13 @@ export function textBoxOf(
740
824
  y0 = Math.min(y0, baseline - cap * k);
741
825
  y1 = Math.max(y1, baseline);
742
826
  }
743
- const head = g.measureText(text.charAt(from));
744
- const tail = g.measureText(text.charAt(to - 1));
745
- const kf = first.height / tall;
746
- const kl = last.height / tall;
747
- x0 = Math.min(x0, first.left - head.actualBoundingBoxLeft * kf);
748
- x1 = Math.max(
749
- x1,
750
- last.right - (tail.width - tail.actualBoundingBoxRight) * kl,
751
- );
827
+ // A glyph that draws nothing ends where its advance does.
828
+ const head = ink(cs, text.charAt(from));
829
+ const tail = ink(cs, text.charAt(to - 1));
830
+ const kf = (first.height / tall) * size;
831
+ const kl = (last.height / tall) * size;
832
+ x0 = Math.min(x0, first.left + (head ? head.left : 0) * kf);
833
+ x1 = Math.max(x1, last.right - (tail ? tail.advance - tail.right : 0) * kl);
752
834
  }
753
835
  return x1 > x0 && y1 > y0 ? new DOMRect(x0, y0, x1 - x0, y1 - y0) : undefined;
754
836
  }
@@ -778,8 +860,11 @@ function placeOf(
778
860
  }
779
861
  if (!node || root.contains(node)) return undefined;
780
862
  fontCanvas ??= document.createElement("canvas").getContext("2d");
863
+ inkOf ??= glyphInk();
781
864
  const text =
782
- fit === "text" && fontCanvas ? textBoxOf(node, fontCanvas) : undefined;
865
+ fit === "text" && fontCanvas
866
+ ? textBoxOf(node, fontCanvas, inkOf)
867
+ : undefined;
783
868
  const r = text ?? node.getBoundingClientRect();
784
869
  if (!(r.width > 0) || !(r.height > 0)) return undefined;
785
870
  // The stage may be shown at another size (a preview zooms it): measure
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/dev-server",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/diagnostics",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{everyBlock as c}from"./model.js";import{effectiveLook as f}from"./page.js";export function captionWords(t){return t?{figure:"图",table:"表"}:{figure:"Figure",table:"Table"}}export function contentsTitle(t,e){return t.title??(e?"目录":"Contents")}export function captionOf(t){switch(t.type){case"image":case"component":case"table":return t.caption;case"chart":return t.title;default:return}}export function blockId(t){return t.type==="image"||t.type==="component"||t.type==="table"||t.type==="chart"?t.id:void 0}export function writtenInChinese(t){let e=0,n=0;for(const i of c(t))if("content"in i)for(const r of i.content)e+=(r.text.match(/[㐀-鿿぀-ヿ]/gu)??[]).length,n+=(r.text.match(/[A-Za-z]+/gu)??[]).length;return e>n}export function captionNumbers(t,e={}){const n=new Map;if(f(e).captions!=="numbered")return n;const i=captionWords(writtenInChinese(t)),r={figure:0,table:0};for(const u of c(t)){if(captionOf(u)===void 0)continue;const o=u.type==="table"?"table":"figure";r[o]+=1,n.set(u,{kind:o,n:r[o],label:`${i[o]} ${String(r[o])}`})}return n}export function numberedCaption(t,e){return e===void 0?t:/^[图表]/u.test(e.label)?`${e.label} ${t}`:`${e.label}. ${t}`}
2
+ import{everyBlock as c}from"./model.js";import{effectiveLook as a}from"./page.js";export function captionWords(t){return t?{figure:"图",table:"表"}:{figure:"Figure",table:"Table"}}export function contentsTitle(t,e){return t.title??(e?"目录":"Contents")}export function captionOf(t){switch(t.type){case"image":case"component":case"table":return t.caption;case"chart":return t.title;default:return}}export function blockId(t){return t.type==="image"||t.type==="component"||t.type==="table"||t.type==="chart"?t.id:void 0}export function writtenInChinese(t){let e=0,n=0;for(const i of c(t))if("content"in i)for(const r of i.content)e+=(r.text.match(/[㐀-鿿぀-ヿ]/gu)??[]).length,n+=(r.text.match(/[A-Za-z]+/gu)??[]).length;return e>n}export function captionNumbers(t,e={}){const n=new Map;if(a(e).captions==="plain")return n;const i=captionWords(writtenInChinese(t)),r={figure:0,table:0};for(const u of c(t)){if(captionOf(u)===void 0)continue;const o=u.type==="table"?"table":"figure";r[o]+=1,n.set(u,{kind:o,n:r[o],label:`${i[o]} ${String(r[o])}`})}return n}export function numberedCaption(t,e){return e===void 0?t:/^[图表]/u.test(e.label)?`${e.label} ${t}`:`${e.label}. ${t}`}export const withoutTitle=t=>{const e={...t};return delete e.title,e};
@@ -1,5 +1,5 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{chartBook as qe,embeddedChartXml as Ye}from"@allyhub/chart";import{chartFrame as Ve,chartWords as Ze,docChart as Qe}from"./chart.js";import{BACKGROUNDS as Le,TEXT_COLORS as Te,hex as te}from"./color.js";import{columnWidths as Je}from"./columns.js";import{COMPONENT_WIDTH as et,componentName as tt}from"./component.js";import{blockId as Oe,captionNumbers as nt,contentsTitle as it,numberedCaption as ve,writtenInChinese as rt}from"./captions.js";import{sourceList as ot,withSources as st}from"./cite.js";import{HEADING_RULE_SPACE as at,cardKept as dt,columnsKept as ct,docParts as lt,headingAnchors as ht,pageAccent as ut,trendSvg as pt}from"./html.js";import{effectiveLook as Pe,LIST_STEP as ft,lineHeightPt as gt,resolvePage as mt,sizePt as _e}from"./page.js";import{splitTitle as wt}from"./title.js";import{markdownOf as yt}from"./markdown.js";import{columnShares as At,numberColumns as Tt}from"./table.js";import{DRAWN_CODE as Me}from"./math.js";import{PAPER as ie,TONE_COLORS as $e,tagColors as Et}from"./paper.js";import{COVER_ASPECT as Rt,everyBlock as Ee,noteNumbers as St,statTone as zt}from"./model.js";const Re=15,bt=1440/25.4,K=n=>Math.round(n*bt),Fe="ListParagraph",He="bullets",Ct=1.8,fe=ft*20,Xe={sans:{latin:"Calibri"},serif:{latin:"Cambria"},mono:{latin:"Courier New"},times:{latin:"Times New Roman"},song:{latin:"Times New Roman",eastAsia:"宋体"},hei:{latin:"Arial",eastAsia:"黑体"},fangsong:{latin:"Times New Roman",eastAsia:"仿宋"},kai:{latin:"Times New Roman",eastAsia:"楷体"},xiaobiaosong:{latin:"Times New Roman",eastAsia:"方正小标宋简体"}},Ne="Courier New",k=n=>n.slice(1).toUpperCase(),de=k(ie.ink),ce=k(ie.lead),Lt=Buffer.from("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=","base64"),ge=k(ie.rule),De=k(ie.ruleStrong),xe=k(ie.ruleMid),Se=k(ie.stone),re=k(ie.leadSoft),Ue="ALLYHUB-CHART-";function Mt(n){return/[\u3040-\u30ff]/u.test(n)?"Yu Gothic":/[\uac00-\ud7af]/u.test(n)?"Malgun Gothic":"Microsoft YaHei"}const Nt=/^(https?:|mailto:)/i,ze=n=>({indent:0,level:0,room:n,frame:et}),Ge=n=>({...n,indent:n.indent+fe,level:Math.min(n.level+1,8)}),Dt=400,xt=n=>n.type==="bullet"||n.type==="numbered"||n.type==="check";function It(n,p,w){const c=w/Re,S=Math.floor(Math.min(p??n.width,c));return{width:S,height:Math.round(S*n.height/n.width)}}const Be="TOCHeading";function Ot(n,p,w,c,S,r){const{AlignmentType:f,BorderStyle:m,ExternalHyperlink:N,ImageRun:a,Paragraph:o,ShadingType:W,Table:P,TableCell:_,TableLayoutType:H,TableRow:X,TextRun:C,WidthType:z}=n,D=e=>{const t=e.filter(i=>!(i instanceof n.TableOfContents));return t.at(-1)instanceof o?t:[...t,le(0)]},L={ascii:Ne,hAnsi:Ne,cs:Ne,eastAsia:w},U=new Set([1]);let q=0;const Y=[],G=e=>({type:W.CLEAR,color:"auto",fill:e}),oe=(e,t,i=4)=>({style:e,color:t,size:i,space:4}),l=r.page.spacing,y=e=>Math.round(e*20),le=e=>new o({spacing:{before:0,after:y(e),line:14,lineRule:n.LineRuleType.EXACT}}),V=()=>l.after>0?[le(l.after)]:[],se=e=>e==="center"?f.CENTER:e==="right"?f.RIGHT:e==="justify"?f.JUSTIFIED:void 0,B=(e,t,i,u={})=>{if(t.tag!==void 0){const s=Et(t.tag),A={...u,color:k(s.fg),size:Math.round((i.size??r.page.size*2)*.85),shading:G(k(s.bg)),...t.bold||i.bold?{bold:!0}:{},...t.italic?{italics:!0}:{}};return[new C({...A,text:` ${e.replace(/\n/gu," ")} `})]}const g=te(t.color,Te)??i.color,h=te(t.background,Le),d={...u,...t.bold||i.bold?{bold:!0}:{},...t.italic?{italics:!0}:{},...t.underline?{underline:{}}:{},...t.strike?{strike:!0}:{},...g===void 0?{}:{color:g},...i.size===void 0?{}:{size:i.size},...t.code?{font:L,shading:G(h??Se)}:h===void 0?{}:{shading:G(h)}};return e.split(`
3
- `).map((s,A)=>new C({...d,text:s,...A>0?{break:1}:{}}))},$=(e,t={})=>e.flatMap(i=>i.note!==void 0?S.has(i.note.toLowerCase())?[new n.FootnoteReferenceRun(S.get(i.note.toLowerCase())??1)]:[]:i.text===""&&i.href?.startsWith("#")===!0?Ce(i.href.slice(1),i.styles,t):i.href!==void 0&&Nt.test(i.href)?[new N({link:i.href,children:B(i.text,i.styles,t,{style:"Hyperlink"})})]:B(i.text,i.styles,t)),Ce=(e,t,i)=>{const u=decodeURIComponent(e),g=r.refs.get(u)??"",h=r.bookmarks.get(u);return g===""?[]:h===void 0?B(g,t,i):[new n.InternalHyperlink({anchor:h,children:B(g,t,i,{style:"Hyperlink"})})]},he=(e,t)=>{const i=e===void 0?void 0:r.bookmarks.get(e);return i===void 0?t:[new n.Bookmark({id:i,children:t})]},T=e=>{const t=se(e?.align),i=te(e?.background,Le);return{...t===void 0?{}:{alignment:t},...i===void 0?{}:{shading:G(i)}}},R=e=>e.indent===0?{}:{indent:{left:e.indent}},O=e=>{const t={style:m.SINGLE,color:e,size:4};return{top:t,bottom:t,left:t,right:t}},me=(e,t)=>{const i=te(e.look?.background,Le)??Se,u=te(e.look?.color,Te),g=t.room-t.indent,h=y(r.page.size*Ct)+y(l.box.side),d=g-h,s=(A,b)=>({top:y(l.box.top),bottom:y(Math.max(l.box.top-l.after,0)),left:A,right:b,marginUnitType:z.DXA});return new P({layout:H.FIXED,width:{size:g,type:z.DXA},columnWidths:[h,d],...t.indent===0?{}:{indent:{size:t.indent,type:z.DXA}},rows:[new X({cantSplit:!0,children:[new _({width:{size:h,type:z.DXA},shading:G(i),borders:O(i),margins:s(y(l.box.side),0),children:[new o({children:[new C({text:e.icon??"💡"})]})]}),new _({width:{size:d,type:z.DXA},shading:G(i),borders:O(i),margins:s(0,y(l.box.side)),children:[new o({children:$(e.content,{color:u})}),...D(Q(e.children??[],ze(d-y(l.box.side))))]})]})]})},we=(e,t)=>{const i=t.room-t.indent,u=y(l.card.side),g=[...e.title===void 0?[]:[new o({spacing:{after:e.subtitle===void 0?y(l.after):0},children:$([{text:e.title,styles:{bold:!0}}])})],...e.subtitle===void 0?[]:[new o({spacing:{after:y(l.after)},children:[new C({text:e.subtitle,color:ce,size:l.small*2})]})]];return new P({layout:H.FIXED,width:{size:i,type:z.DXA},columnWidths:[i],...t.indent===0?{}:{indent:{size:t.indent,type:z.DXA}},rows:[new X({cantSplit:dt(e,r.page),children:[new _({width:{size:i,type:z.DXA},borders:O(ge),margins:{top:y(l.card.top),bottom:y(Math.max(l.card.top-l.after,0)),left:u,right:u,marginUnitType:z.DXA},children:D([...g,...Q(e.children??[],ze(i-2*u))])})]})]})},ye=(e,t)=>{const i=t.room-t.indent,u=y(l.gap),g=e.stats.length,h=Math.floor((i-u*(g-1))/g),d=e.stats.flatMap((M,F)=>F===0?[h]:[u,h]),s={style:m.NONE,size:0,color:"auto"},A={top:s,bottom:s,left:s,right:s},b=y(l.card.side),E=l.small*2,v=e.stats.flatMap((M,F)=>{const J=zt(M),ae=[...M.delta===void 0?[]:[new C({text:M.delta,color:k($e[J]),size:E})],...M.note===void 0?[]:[new C({text:`${M.delta===void 0?"":" "}${M.note}`,color:ce,size:E})]],x=h-2*b,I=M.trend===void 0?[]:[new o({spacing:{before:60,after:0,line:240},children:[new a({type:"svg",data:Buffer.from(pt(M.trend,$e[J]).replace("<svg ",`<svg xmlns="http://www.w3.org/2000/svg" width="${String(Math.round(x/15))}" height="24" `)),fallback:{type:"png",data:Lt},transformation:{width:Math.round(x/15),height:24}})]})],pe=new _({width:{size:h,type:z.DXA},borders:O(ge),margins:{top:y(l.card.top),bottom:y(l.card.top),left:b,right:b,marginUnitType:z.DXA},children:[new o({spacing:{after:0},children:[new C({text:M.label,color:ce,size:E})]}),new o({spacing:{after:0,line:240,lineRule:n.LineRuleType.AUTO},children:$([{text:M.value,styles:{bold:!0}}],{size:l.figure*2})}),...ae.length===0?[]:[new o({spacing:{after:0},children:ae})],...I]}),ee=new _({width:{size:u,type:z.DXA},borders:A,children:[new o({children:[]})]});return F===0?[pe]:[ee,pe]});return new P({layout:H.FIXED,width:{size:i,type:z.DXA},columnWidths:d,...t.indent===0?{}:{indent:{size:t.indent,type:z.DXA}},rows:[new X({cantSplit:!0,children:v})]})},ne=(e,t)=>{const i=t.room-t.indent,u=Math.max(1,...e.rows.map(x=>x.length)),g=Array.from({length:u},(x,I)=>e.widths?.[I]?(e.widths[I]??0)*Re:void 0),h=g.reduce((x,I)=>x+(I??0),0),d=At(e),s=g.reduce((x,I,pe)=>x+(I===void 0?d[pe]??1:0),0)||1,A=Math.max(i-h,0),b=g.map((x,I)=>x??A*(d[I]??1)/s),E=b.reduce((x,I)=>x+I,0)||1,v=Math.min(1,i/E),M=b.map(x=>Math.round(x*v)),F=e.head===void 0||e.head==="both",J=e.head==="column"||e.head==="both",ae=Tt(e);return new P({layout:H.FIXED,width:{size:M.reduce((x,I)=>x+I,0),type:z.DXA},columnWidths:M,...t.indent===0?{}:{indent:{size:t.indent,type:z.DXA}},rows:e.rows.map((x,I)=>new X({tableHeader:F&&I===0,cantSplit:!0,children:Array.from({length:u},(pe,ee)=>{const Ie=F&&I===0,ke=J&&ee===0&&!Ie;return new _({width:{size:M[ee]??0,type:z.DXA},borders:{top:{style:m.NONE,size:0,color:"auto"},left:{style:m.NONE,size:0,color:"auto"},right:{style:m.NONE,size:0,color:"auto"},bottom:{style:m.SINGLE,size:4,color:F&&I===0?De:ge}},margins:{top:y(l.cell.top),bottom:y(l.cell.top),left:ee===0?0:y(l.cell.side),right:ee===u-1?0:y(l.cell.side),marginUnitType:z.DXA},children:[new o({spacing:{after:0},...ae.has(ee)?{alignment:f.RIGHT}:{},children:$(x[ee]??[],{bold:ke,...Ie?{color:ce}:{},size:l.small*2})})]})})}))})},Z=(e,t,i,u,g,h)=>{const d=se(e.align),s={...R(t),...d===void 0?{}:{alignment:d}},A=i===void 0?void 0:e.caption,b=A!==void 0,E=[new o({...s,keepNext:b,...i?{spacing:{line:240,lineRule:n.LineRuleType.AUTO,...b?{after:y(l.caption)}:{}}}:{},children:i?[new a({type:i.type,data:i.data,transformation:It(i,e.width,t.room-t.indent),altText:{name:e.alt??"",title:e.caption??e.alt??"",description:e.alt??""}})]:[new C({text:u,color:re})]})];return A!==void 0&&E.push(new o({...s,style:"Caption",children:he(h,[new C({text:ve(A,g)})])})),E},ue=(e,t)=>{const i=t.room-t.indent,u=e.columns.map(E=>E.width??1),g=u.reduce((E,v)=>E+v,0)||1,h=u.map(E=>Math.round(i*E/g)),d=Je(e,t.frame),s={style:m.NONE,size:0,color:"auto"},A={top:s,bottom:s,left:s,right:s,insideHorizontal:s,insideVertical:s},b=Dt/2;return new P({layout:H.FIXED,width:{size:i,type:z.DXA},columnWidths:h,borders:A,...t.indent===0?{}:{indent:{size:t.indent,type:z.DXA}},rows:[new X({cantSplit:ct(e,r.page),children:e.columns.map((E,v)=>{const M=h[v]??0,F=v===0?0:b,J=v===e.columns.length-1?0:b,ae=D(Q(E.blocks,{indent:0,level:0,room:M-F-J,frame:d[v]??t.frame}));return new _({width:{size:M,type:z.DXA},borders:A,margins:{top:0,bottom:0,left:F,right:J,marginUnitType:z.DXA},children:ae})})})]})},Ae=(e,t,i)=>{const u=te(e.look?.color,Te),g=Q(e.children??[],Ge(t)),h=T(e.look),d=Fe;return e.type==="check"?[new o({...h,...R(t),style:d,children:[new C({text:e.checked?"☑ ":"☐ "}),...$(e.content,{color:u})]}),...g]:[new o({...h,style:d,numbering:e.type==="bullet"?{reference:He,level:t.level}:{reference:`start-${String(i.start)}`,level:t.level,instance:i.id},children:$(e.content,{color:u})}),...g]},j=(e,t)=>{const i="look"in e?e.look:void 0,u=te(i?.color,Te),g=T(i),h=()=>"children"in e?Q(e.children??[],Ge(t)):[];switch(e.type){case"paragraph":case"toggle":return[new o({...r.sets.align&&e.look?.align===void 0?{alignment:f.JUSTIFIED}:{},...g,...r.sets.indent&&e.type==="paragraph"?{indent:{left:t.indent,firstLine:Math.round(r.page.textIndent*r.page.size*20)}}:R(t),children:$(e.content,{color:u})}),...h()];case"heading":return[new o({...g,...R(t),...e===r.title?{heading:n.HeadingLevel.TITLE}:{heading:n.HeadingLevel[`HEADING_${String(e.level)}`]},children:he(r.anchors.get(e),$(e.content,{color:u}))}),...h()];case"quote":return[new o({...g,indent:{left:t.indent+y(l.quote)},border:{left:{style:m.SINGLE,color:c??De,size:c?12:6,space:Math.floor(l.quote-(c?1.5:.75))}},children:$(e.content,{color:u??ce})}),...h()];case"callout":return[me(e,t),...V()];case"card":return[we(e,t),...V()];case"stats":return[ye(e,t),...V()];case"code":{if(e.language===Me.math||e.language===Me.mermaid){const A=p.drawn?.(e);if(A)return Z({...e.language===Me.math?{}:{align:"center"}},t,A,"")}const d=A=>({style:m.SINGLE,color:Se,size:4,space:A}),s=y(l.box.side+.5);return[new o({indent:{left:t.indent+s,right:s},shading:G(Se),border:{top:d(l.box.top),bottom:d(l.box.top),left:d(l.box.side),right:d(l.box.side)},keepLines:!0,children:e.code.split(`
4
- `).map((A,b)=>new C({text:A,font:L,size:l.small*2,...b>0?{break:1}:{}}))})]}case"columns":return[ue(e,t)];case"chart":{const{chart:d,problems:s}=Qe(e,p),A=oe(m.DASHED,xe);if(!d)return[new o({...R(t),alignment:f.CENTER,border:{top:A,bottom:A,left:A,right:A},children:[new C({text:[e.title??"Chart",...s].join(": "),color:re})]})];const b=Ve(e,t.frame),E=(t.room-t.indent)/Re,v=Math.min(1,E/b.width);return Y.push({chart:d,width:Math.round(b.width*v),height:Math.round(b.height*v),words:Ze(e,d)}),[new o({...R(t),alignment:f.CENTER,spacing:{line:240,lineRule:n.LineRuleType.AUTO},children:[new C({text:`${Ue}${String(Y.length)}`})]})]}case"image":return Z(e,t,p.picture?.(e.src),e.alt??e.caption??e.src,r.numbers.get(e),e.id);case"component":{const d=p.component?.(e);if(d)return Z(e,t,d,"",r.numbers.get(e),e.id);const s=oe(m.DASHED,xe);return[new o({...R(t),alignment:f.CENTER,border:{top:s,bottom:s,left:s,right:s},children:[new C({text:tt(e),color:re})]})]}case"table":return[...e.caption===void 0?[]:[new o({...R(t),style:"Caption",keepNext:!0,spacing:{after:y(l.caption)},children:he(e.id,[new C({text:ve(e.caption,r.numbers.get(e))})])})],ne(e,t),...V()];case"pagebreak":return[new o({spacing:{before:0,after:0,line:20,lineRule:n.LineRuleType.EXACT},children:[new n.PageBreak]})];case"bibliography":{const{page:d}=r,s=d.textIndent>0?Math.round(d.textIndent*d.size*20):480;return r.sources.map(A=>new o({...R(t),alignment:f.LEFT,indent:{left:t.indent+s,hanging:s},spacing:{after:y(l.after)},children:A.pieces.map(b=>{const E=b.italic?{italics:!0}:{};return new C({text:b.text,...E})})}))}case"toc":{const d=e.levels??3,s=r.headings.filter(E=>E.level<=d).map(E=>{const v=r.anchors.get(E)??"",M=p.headingPage?.(v),F=r.bookmarks.get(v);return{title:E.content.map(J=>J.text).join(""),level:E.level,...M===void 0?{}:{page:M},...F===void 0?{}:{href:F}}}),A=Math.min(...s.map(E=>E.level)),b=it(e,r.chinese);return[...b===""?[]:[new o({style:Be,text:b})],new n.TableOfContents(void 0,{hyperlink:!0,headingStyleRange:`1-${String(d)}`,beginDirty:!1,cachedEntries:s.map(E=>({...E,level:E.level-A+1}))})]}case"note":return[];case"divider":return[new o({...R(t),spacing:{before:y(l.divider),after:y(l.divider),line:20,lineRule:n.LineRuleType.EXACT},border:{bottom:{style:m.SINGLE,color:ge,size:4,space:0}}})];case"embed":{const d=/^<\s*([A-Za-z][\w.]*)/.exec(e.source.trim())?.[1],s=oe(m.DASHED,xe);return[new o({...R(t),alignment:f.CENTER,border:{top:s,bottom:s,left:s,right:s},children:[new C({text:d??"",color:re})]})]}case"source":return[];case"bullet":case"numbered":case"check":return[]}};function Q(e,t){const i=[];let u,g;for(const h of e){if(!xt(h)){u=void 0,g=void 0,i.push(...j(h,t));continue}if(u===void 0||g===void 0||g.type==="numbered"!=(h.type==="numbered")){const d=h.type==="numbered"?h.start??1:1;U.add(d),u={id:++q,start:d}}g=h,i.push(...Ae(h,t,u))}return i.flatMap((h,d)=>h instanceof P&&i[d+1]instanceof P?[h,le(0)]:[h])}return{charts:Y,body:(e,t)=>Q(e,ze(t)),footnotes:e=>Object.fromEntries([...Ee(e)].flatMap(t=>{if(t.type!=="note")return[];const i=S.get(t.label.toLowerCase());if(i===void 0)return[];const u=Q(t.children??[],ze(K(r.page.width)-K(r.page.margins.left+r.page.margins.right))).filter(g=>g instanceof o);return[[String(i),{children:[new o({spacing:{after:40},children:$(t.content,{size:18,color:ce})}),...u]}]]})),numbering:()=>[{reference:He,levels:Array.from({length:9},(e,t)=>({level:t,format:n.LevelFormat.BULLET,text:["•","◦","▪"][t%3]??"•",alignment:f.LEFT,style:{paragraph:{indent:{left:(t+1)*fe,hanging:fe}}}}))},...[...U].sort((e,t)=>e-t).map(e=>({reference:`start-${String(e)}`,levels:Array.from({length:9},(t,i)=>({level:i,format:[n.LevelFormat.DECIMAL,n.LevelFormat.LOWER_LETTER,n.LevelFormat.LOWER_ROMAN][i%3]??n.LevelFormat.DECIMAL,text:`%${String(i+1)}.`,alignment:f.LEFT,...i===0?{start:e}:{},style:{paragraph:{indent:{left:(i+1)*fe,hanging:fe}}}}))}))]}}const vt="1980-01-01T00:00:00Z",We=9525,je="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Pt=n=>n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");function _t(n,p,w,c,S){return n.forEach((r,f)=>{const m=String(f+1),N=`rIdChart${m}`,a=`Microsoft_Excel_Worksheet${m}.xlsx`;S(`word/charts/chart${m}.xml`,Ye(r.chart,{width:r.width*.75,height:r.height*.75},"rId1",{frameless:!0})),S(`word/charts/_rels/chart${m}.xml.rels`,`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
5
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${je}/package" Target="../embeddings/${a}"/></Relationships>`),S(`word/embeddings/${a}`,qe(r.chart)),w=w.replace("</Relationships>",`<Relationship Id="${N}" Type="${je}/chart" Target="charts/chart${m}.xml"/></Relationships>`),c=c.replace("</Types>",`<Override ContentType="application/vnd.openxmlformats-officedocument.drawingml.chart+xml" PartName="/word/charts/chart${m}.xml"/></Types>`);const o=String(r.width*We),W=String(r.height*We),P=`<w:r><w:drawing><wp:inline distT="0" distB="0" distL="0" distR="0"><wp:extent cx="${o}" cy="${W}"/><wp:effectExtent l="0" t="0" r="0" b="0"/><wp:docPr id="0" name="Chart ${m}" descr="${Pt(r.words)}"/><wp:cNvGraphicFramePr/><a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/chart"><c:chart xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" r:id="${N}"/></a:graphicData></a:graphic></wp:inline></w:drawing></w:r>`;p=p.replace(new RegExp(`<w:r>(?:(?!<w:r>).)*?<w:t[^>]*>${Ue}${m}</w:t></w:r>`,"su"),P)}),n.length>0&&!c.includes('Extension="xlsx"')&&(c=c.replace("</Types>",'<Default ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" Extension="xlsx"/></Types>')),{document:p,rels:w,types:c}}function $t(n,p,w){const c=p.unzipSync(n),S=D=>{const L=c[D];return L&&new TextDecoder().decode(L)},r=(D,L)=>{c[D]=typeof L=="string"?new TextEncoder().encode(L):L},f="word/document.xml",m="word/_rels/document.xml.rels",N="[Content_Types].xml",a=_t(w,S(f)??"",S(m)??"",S(N)??"",r);r(N,a.types);let o=a.document,W=a.rels;[...new Set([...o.matchAll(/w:hyperlink [^>]*r:id="([^"]+)"/g)].map(D=>D[1]??""))].forEach((D,L)=>{const U=`rIdLink${String(L+1)}`;o=o.split(`"${D}"`).join(`"${U}"`),W=W.split(`"${D}"`).join(`"${U}"`)});let _=0;o=o.replace(/<wp:docPr id="\d+"/g,()=>`<wp:docPr id="${String(++_)}"`);const H=new Map;o=o.replace(/<w:bookmarkStart w:name="([^"]*)" w:id="(\d+)"/g,(D,L,U)=>{const q=String(H.size+1);return H.set(U,q),`<w:bookmarkStart w:name="${L}" w:id="${q}"`}),o=o.replace(/<w:bookmarkEnd w:id="(\d+)"/g,(D,L)=>{const U=H.get(L);return U===void 0?D:`<w:bookmarkEnd w:id="${U}"`}),r(f,o),r(m,W);const X="docProps/core.xml",C=S(X);C!==void 0&&r(X,C.replace(/(<dcterms:(?:created|modified)[^>]*>)[^<]*/g,`$1${vt}`));const z=Object.fromEntries(Object.entries(c).sort(([D],[L])=>D<L?-1:1));return p.zipSync(z,{mtime:new Date(1980,0,1)})}const be=(n,p)=>{const w=Xe[n];return{ascii:w.latin,hAnsi:w.latin,cs:w.latin,eastAsia:w.eastAsia??p}};function Ft(n,p,w){const c={left:[],center:[],right:[]};p.left!==void 0&&c.left.push(p.left),p.center!==void 0&&c.center.push(p.center),p.right!==void 0&&c.right.push(p.right),p.outside!==void 0&&c[w.odd?"right":"left"].push(p.outside),p.inside!==void 0&&c[w.odd?"left":"right"].push(p.inside);const S={size:Math.round(w.size*2),color:w.color,font:be(w.face,w.eastAsia)},r=f=>f.split(/(\{title\}|\{section\}|\{page\}|\{pages\})/u).filter(m=>m!=="").map(m=>m==="{page}"?new n.TextRun({...S,children:[n.PageNumber.CURRENT]}):m==="{pages}"?new n.TextRun({...S,children:[n.PageNumber.TOTAL_PAGES]}):m==="{section}"?new n.SimpleField(`STYLEREF "heading ${String(w.section)}"`,""):new n.TextRun({...S,text:m==="{title}"?w.title:m}));return new n.Paragraph({style:w.style,tabStops:[{type:n.TabStopType.CENTER,position:Math.round(w.width/2)},{type:n.TabStopType.RIGHT,position:w.width}],children:[...r(c.left.join(" ")),new n.TextRun({...S,children:[new n.Tab]}),...r(c.center.join(" ")),new n.TextRun({...S,children:[new n.Tab]}),...r(c.right.join(" "))]})}const Ke=(n,p,w,c)=>({run:{...p?.font===void 0?{}:{font:be(n.font,w)},...p?.size===void 0?{}:{size:Math.round(n.size*2)},...p?.weight===void 0?{}:{bold:n.weight==="bold"},...p?.italic===void 0?{}:{italics:n.italic}},paragraph:p?.align===void 0?{}:{alignment:n.align==="center"?c.AlignmentType.CENTER:n.align==="right"?c.AlignmentType.RIGHT:c.AlignmentType.LEFT}});function Ht(n){const p=new Map,w=new Set;return n.forEach((c,S)=>{const r=c.replace(/[^A-Za-z0-9_]/gu,"_").replace(/^[^A-Za-z]+/u,"");let f=`b_${r}`.slice(0,32);(w.has(f)||r==="")&&(f=`b_${String(S)}_${r}`.slice(0,40)),w.add(f),p.set(c,f)}),p}export async function docxOf(n,p,w,c={}){const S=c.page??{},r=Pe(S).citationStyle??"apa",f=st(w,c.sources??[],r,"block"),m=ot(w,c.sources??[],r),N=Pe(S),a=mt(S),o=Xe[a.font].eastAsia??Mt(yt(f)),W=be(a.font,o),P=te(ut(c.page),{}),_=ht(f),H=nt(f,S),X=new Map;for(const T of Ee(f)){const R=Oe(T),O=H.get(T);R!==void 0&&O!==void 0&&X.set(R,O.label)}for(const[T,R]of _)T.type==="heading"&&X.set(R,T.content.map(O=>O.text).join(""));const{title:C}=wt(f),z=[...Ee(f)].filter(T=>T.type==="heading"&&T!==C),D=Ht([..._.values(),...[...Ee(f)].flatMap(T=>{const R=Oe(T);return R===void 0?[]:[R]})]),L=Ot(n,c,o,P,St(f),{page:a,sets:{indent:N.textIndent!==void 0&&N.textIndent>0,align:N.textAlign==="justify"},numbers:H,refs:X,bookmarks:D,anchors:_,title:C,headings:z,chinese:rt(f),sources:m}),U=lt(f),q={width:K(a.width),height:K(a.height)},Y={top:K(a.margins.top),bottom:K(a.margins.bottom),left:K(a.margins.left),right:K(a.margins.right)},G=c.cover,oe=[a.header,a.footer].some(T=>T!==void 0&&(T.outside!==void 0||T.inside!==void 0)),l=U.map((T,R)=>{const O=T.landscape?q.height:q.width,me=O-Y.left-Y.right,we=L.body(T.blocks,me);if(R===0&&G){const j=Math.round(O/Re);we.unshift(new n.Paragraph({spacing:{before:0,after:0},children:[new n.ImageRun({type:G.type,data:G.data,transformation:{width:j,height:Math.round(j*Rt)},floating:{horizontalPosition:{relative:n.HorizontalPositionRelativeFrom.PAGE,offset:0},verticalPosition:{relative:n.VerticalPositionRelativeFrom.PAGE,offset:0},allowOverlap:!1,margins:{bottom:324e3},wrap:{type:n.TextWrappingType.TOP_AND_BOTTOM}},altText:{name:"Cover",title:"Cover",description:""}})]}))}const ye=(j,Q,e)=>{if(j===void 0)return;const t=i=>Ft(n,j,{style:e,odd:i,width:me,title:c.title??"",section:Math.min(...z.map(u=>u.level),6),face:j.font??a.font,eastAsia:o,size:j.size===void 0?Math.max(7.5,a.size*.75):_e(j.size),color:Q?re:de});return{default:t(!0),...oe?{even:t(!1)}:{}}},ne=ye(a.header,N.header===void 0,"Header"),Z=ye(a.footer,N.footer===void 0,"Footer"),ue=R===0&&G!==void 0&&ne!==void 0,Ae=N.grid===void 0?void 0:{type:n.DocumentGridType.LINES_AND_CHARS,linePitch:Math.round(gt(a)*20),charSpace:Math.round(a.textWidth/25.4*72/N.grid.chars-a.size)*4096};return{properties:{page:{size:{width:q.width,height:q.height,...T.landscape?{orientation:n.PageOrientation.LANDSCAPE}:{}},margin:{...Y,header:Math.max(0,Y.top-K(7)-Math.round(a.size*20*1.2)),footer:Math.max(0,Y.bottom-K(7)-Math.round(a.size*20*1.2))}},...Ae===void 0?{}:{grid:Ae},...ue?{titlePage:!0}:{}},...ne===void 0?{}:{headers:{default:new n.Header({children:[ne.default]}),...ne.even?{even:new n.Header({children:[ne.even]})}:{},...ue?{first:new n.Header({children:[]})}:{}}},...Z===void 0?{}:{footers:{default:new n.Footer({children:[Z.default]}),...Z.even?{even:new n.Footer({children:[Z.even]})}:{},...ue?{first:new n.Footer({children:[Z.default]})}:{}}},children:we}}),y=a.lineHeight,le={spacing:{after:Math.round(a.paragraphSpacing*a.size*20),..."pt"in y?{line:Math.round(y.pt*20),lineRule:n.LineRuleType.EXACT}:{line:Math.round(y.multiple*240),lineRule:n.LineRuleType.AUTO}}},V=a.spacing,se=T=>Math.round(T*20),B=T=>{const R=N.headings?.[T],O=Ke(a.headings[T],R,o,n);return{run:{size:Math.round(a.headings[T].size*2),bold:!0,font:W,color:de,...O.run},paragraph:{spacing:{before:se(V.heading.before),after:se(V.heading.after)},keepNext:!0,keepLines:!0,...a.headings[T].rule?{border:{bottom:{style:n.BorderStyle.SINGLE,size:4,color:ge,space:at}}}:{},...O.paragraph}}},$=Ke(a.title,N.title,o,n),Ce=new n.Document({creator:"AllyHub",lastModifiedBy:"AllyHub",...c.title===void 0?{}:{title:c.title},...oe?{evenAndOddHeaderAndFooters:!0}:{},numbering:{config:L.numbering()},styles:{default:{document:{run:{font:W,size:Math.round(a.size*2),color:de},paragraph:le},hyperlink:{run:{color:P??de,underline:{color:P??De}}},title:{run:{size:Math.round(a.title.size*2),bold:!0,font:W,color:de,...$.run},paragraph:{spacing:{before:0,after:se(V.title)},keepNext:!0,...$.paragraph}},heading1:B(1),heading2:B(2),heading3:B(3),heading4:B(4),heading5:B(5),heading6:B(6)},paragraphStyles:[{id:Be,name:"TOC Heading",basedOn:"Normal",next:"Normal",quickFormat:!0,...B(1)},{id:"Caption",name:"caption",basedOn:"Normal",next:"Normal",quickFormat:!0,run:{size:V.small*2,color:re},paragraph:{spacing:{before:0}}},{id:Fe,name:"List Paragraph",basedOn:"Normal",quickFormat:!0,paragraph:{contextualSpacing:!0}},...[["Header",a.header,N.header===void 0],["Footer",a.footer,N.footer===void 0]].flatMap(([T,R,O])=>R===void 0?[]:[{id:T,name:T.toLowerCase(),basedOn:"Normal",run:{size:Math.round((R.size===void 0?Math.max(7.5,a.size*.75):_e(R.size))*2),color:O?re:de,font:be(R.font??a.font,o)},paragraph:{spacing:{before:0,after:0,line:240}}}])]},sections:l,footnotes:L.footnotes(f)}),he=await n.Packer.toBuffer(Ce);return $t(new Uint8Array(he),p,L.charts)}
2
+ import{chartBook as Qe,embeddedChartXml as Je}from"@allyhub/chart";import{chartFrame as et,chartWords as tt,docChart as nt}from"./chart.js";import{BACKGROUNDS as Ie,TEXT_COLORS as Se,hex as ee}from"./color.js";import{columnWidths as it}from"./columns.js";import{COMPONENT_WIDTH as rt,componentName as ot}from"./component.js";import{blockId as $e,captionNumbers as st,contentsTitle as at,numberedCaption as Oe,writtenInChinese as dt,withoutTitle as ct}from"./captions.js";import{sourceList as lt,withSources as ht}from"./cite.js";import{HEADING_RULE_SPACE as ut,cardKept as pt,columnsKept as ft,docParts as gt,headingAnchors as mt,pageAccent as wt,trendSvg as yt}from"./html.js";import{effectiveLook as Fe,LIST_STEP as At,lineHeightPt as Tt,resolvePage as Et,sizePt as He}from"./page.js";import{splitTitle as Rt}from"./title.js";import{markdownOf as St}from"./markdown.js";import{charsAcross as Xe,columnShares as zt,emptyHead as Lt,numberColumns as Mt}from"./table.js";import{DRAWN_CODE as ve}from"./math.js";import{PAPER as te,TONE_COLORS as Ue,tagColors as Ct}from"./paper.js";import{COVER_ASPECT as Nt,everyBlock as ze,firstNoteMarks as bt,noteNumbers as xt,statTone as Dt}from"./model.js";const ue=15,It=1440/25.4,Y=n=>Math.round(n*It),Ge="ListParagraph",Be="bullets",Ot=1.8,pe=At*20,We={sans:{latin:"Calibri"},serif:{latin:"Cambria"},mono:{latin:"Courier New"},times:{latin:"Times New Roman"},song:{latin:"Times New Roman",eastAsia:"宋体"},hei:{latin:"Arial",eastAsia:"黑体"},fangsong:{latin:"Times New Roman",eastAsia:"仿宋"},kai:{latin:"Times New Roman",eastAsia:"楷体"},xiaobiaosong:{latin:"Times New Roman",eastAsia:"方正小标宋简体"}},Pe="Courier New",W=n=>n.slice(1).toUpperCase(),le=W(te.ink),fe=W(te.lead),vt=Buffer.from("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=","base64"),Le=W(te.rule),ge=W(te.ruleStrong),Me=W(te.ruleMid),Ce=W(te.stone),Pt=W(te.stone3),de=W(te.leadSoft),je="ALLYHUB-CHART-";function _t(n){return/[\u3040-\u30ff]/u.test(n)?"Yu Gothic":/[\uac00-\ud7af]/u.test(n)?"Malgun Gothic":"Microsoft YaHei"}const $t=/^(https?:|mailto:)/i,Ne=n=>({indent:0,level:0,room:n,frame:rt}),Ke=n=>({...n,indent:n.indent+pe,level:Math.min(n.level+1,8)}),Ft=400,Ht=n=>n.type==="bullet"||n.type==="numbered"||n.type==="check";function Xt(n,u,w){const l=w/ue,S=Math.floor(Math.min(u??n.width,l));return{width:S,height:Math.round(S*n.height/n.width)}}const qe="TOCHeading";function Ut(n,u,w,l,S,z,r){const{AlignmentType:m,BorderStyle:y,ExternalHyperlink:c,ImageRun:x,Paragraph:h,ShadingType:Z,Table:F,TableCell:_,TableLayoutType:H,TableRow:G,TextRun:M,WidthType:p}=n,N=e=>{const t=e.filter(i=>!(i instanceof n.TableOfContents));return t.at(-1)instanceof h?t:[...t,Q(0)]},X={ascii:Pe,hAnsi:Pe,cs:Pe,eastAsia:w},$=new Set([1]);let ne=0;const k=[],B=e=>({type:Z.CLEAR,color:"auto",fill:e}),he=(e,t,i=4)=>({style:e,color:t,size:i,space:4}),o=r.page.spacing,E=e=>Math.round(e*20),Q=e=>new h({spacing:{before:0,after:E(e),line:14,lineRule:n.LineRuleType.EXACT}}),J=()=>o.after>0?[Q(o.after)]:[],j=e=>e==="center"?m.CENTER:e==="right"?m.RIGHT:e==="justify"?m.JUSTIFIED:void 0,ie=(e,t,i,f={})=>{if(t.tag!==void 0){const s=Ct(t.tag),R={...f,color:W(s.fg),size:Math.round((i.size??r.page.size*2)*.85),shading:B(W(s.bg)),...t.bold||i.bold?{bold:!0}:{},...t.italic?{italics:!0}:{}};return[new M({...R,text:` ${e.replace(/\n/gu," ")} `})]}const g=ee(t.color,Se)??i.color,a=ee(t.background,Ie),d={...f,...t.bold||i.bold?{bold:!0}:{},...t.italic?{italics:!0}:{},...t.underline?{underline:{}}:{},...t.strike?{strike:!0}:{},...g===void 0?{}:{color:g},...i.size===void 0?{}:{size:i.size},...t.code?{font:X,shading:B(a??Ce)}:a===void 0?{}:{shading:B(a)}};return e.split(`
3
+ `).map((s,R)=>new M({...d,text:s,...R>0?{break:1}:{}}))},U=(e,t={})=>e.flatMap(i=>i.note!==void 0?S.has(i.note.toLowerCase())?z.has(i)?[new n.FootnoteReferenceRun(S.get(i.note.toLowerCase())??1)]:[new M({text:String(S.get(i.note.toLowerCase())??1),style:"FootnoteReference"})]:[]:i.text===""&&i.href?.startsWith("#")===!0?xe(i.href.slice(1),i.styles,t):i.href!==void 0&&$t.test(i.href)?[new c({link:i.href,children:ie(i.text,i.styles,t,{style:"Hyperlink"})})]:ie(i.text,i.styles,t)),xe=(e,t,i)=>{const f=decodeURIComponent(e),g=r.refs.get(f)??"",a=r.bookmarks.get(f);return g===""?[]:a===void 0?ie(g,t,i):[new n.InternalHyperlink({anchor:a,children:ie(g,t,i,{style:"Hyperlink"})})]},T=(e,t)=>{const i=e===void 0?void 0:r.bookmarks.get(e);return i===void 0?t:[new n.Bookmark({id:i,children:t})]},D=e=>{const t=j(e?.align),i=ee(e?.background,Ie);return{...t===void 0?{}:{alignment:t},...i===void 0?{}:{shading:B(i)}}},L=e=>e.indent===0?{}:{indent:{left:e.indent}},re=e=>{const t={style:y.SINGLE,color:e,size:4};return{top:t,bottom:t,left:t,right:t}},me=(e,t)=>{const i=ee(e.look?.background,Ie)??Ce,f=ee(e.look?.color,Se),g=t.room-t.indent,a=e.icon===void 0?0:E(r.page.size*Ot)+E(o.box.side),d=g-a,s=(R,C)=>({top:E(o.box.top),bottom:E(Math.max(o.box.top-o.after,0)),left:R,right:C,marginUnitType:p.DXA});return new F({layout:H.FIXED,width:{size:g,type:p.DXA},columnWidths:a===0?[d]:[a,d],...t.indent===0?{}:{indent:{size:t.indent,type:p.DXA}},rows:[new G({cantSplit:!0,children:[...e.icon===void 0?[]:[new _({width:{size:a,type:p.DXA},shading:B(i),borders:re(i),margins:s(E(o.box.side),0),children:[new h({children:[new M({text:e.icon})]})]})],new _({width:{size:d,type:p.DXA},shading:B(i),borders:re(i),margins:s(a===0?E(o.box.side):0,E(o.box.side)),children:[new h({children:U(e.content,{color:f})}),...N(V(e.children??[],Ne(d-E(o.box.side))))]})]})]})},we=(e,t)=>{const i=t.room-t.indent,f=E(o.card.side),g=[...e.title===void 0?[]:[new h({spacing:{after:e.subtitle===void 0?E(o.after):0},children:U([{text:e.title,styles:{bold:!0}}])})],...e.subtitle===void 0?[]:[new h({spacing:{after:E(o.after)},children:[new M({text:e.subtitle,color:fe,size:o.small*2})]})]];return new F({layout:H.FIXED,width:{size:i,type:p.DXA},columnWidths:[i],...t.indent===0?{}:{indent:{size:t.indent,type:p.DXA}},rows:[new G({cantSplit:pt(e,r.page),children:[new _({width:{size:i,type:p.DXA},borders:re(Le),margins:{top:E(o.card.top),bottom:E(Math.max(o.card.top-o.after,0)),left:f,right:f,marginUnitType:p.DXA},children:N([...g,...V(e.children??[],Ne(i-2*f))])})]})]})},oe=(e,t)=>{const i=t.room-t.indent,f=E(o.gap),g=e.stats.length,a=Math.floor((i-f*(g-1))/g),d=e.stats.flatMap((b,P)=>P===0?[a]:[f,a]),s={style:y.NONE,size:0,color:"auto"},R={top:s,bottom:s,left:s,right:s},C=E(o.card.side),A=o.small*2,v=e.stats.flatMap((b,P)=>{const q=Dt(b),ce=[...b.delta===void 0?[]:[new M({text:b.delta,color:W(Ue[q]),size:A})],...b.note===void 0?[]:[new M({text:`${b.delta===void 0?"":" "}${b.note}`,color:fe,size:A})]],Ae=a-2*C,Te=b.trend===void 0?[]:[new h({spacing:{before:60,after:0,line:240},children:[new x({type:"svg",data:Buffer.from(yt(b.trend,Ue[q]).replace("<svg ",`<svg xmlns="http://www.w3.org/2000/svg" width="${String(Math.round(Ae/15))}" height="24" `)),fallback:{type:"png",data:vt},transformation:{width:Math.round(Ae/15),height:24}})]})],I=new _({width:{size:a,type:p.DXA},borders:re(Le),margins:{top:E(o.card.top),bottom:E(o.card.top),left:C,right:C,marginUnitType:p.DXA},children:[new h({spacing:{after:0},children:[new M({text:b.label,color:fe,size:A})]}),new h({spacing:{after:0,line:240,lineRule:n.LineRuleType.AUTO},children:U([{text:b.value,styles:{bold:!0}}],{size:o.figure*2})}),...ce.length===0?[]:[new h({spacing:{after:0},children:ce})],...Te]}),O=new _({width:{size:f,type:p.DXA},borders:R,children:[new h({children:[]})]});return P===0?[I]:[O,I]});return new F({layout:H.FIXED,width:{size:i,type:p.DXA},columnWidths:d,...t.indent===0?{}:{indent:{size:t.indent,type:p.DXA}},rows:[new G({cantSplit:!0,children:v})]})},se=(e,t)=>{const i=t.room-t.indent,f=Math.max(1,...e.rows.map(I=>I.length)),g=Array.from({length:f},(I,O)=>e.widths?.[O]?(e.widths[O]??0)*ue:void 0),a=g.reduce((I,O)=>I+(O??0),0),d=zt(e,{across:Xe(Math.max(i-a,0)/ue,o.small),margins:Xe(2*o.cell.side*96/72,o.small)}),s=g.reduce((I,O,_e)=>I+(O===void 0?d[_e]??1:0),0)||1,R=Math.max(i-a,0),C=g.map((I,O)=>I??R*(d[O]??1)/s),A=C.reduce((I,O)=>I+O,0)||1,v=Math.min(1,i/A),b=C.map(I=>Math.round(I*v)),P=Lt(e),q=(e.head===void 0||e.head==="both")&&!P,ce=e.head==="column"||e.head==="both",Ae=Mt(e),Te=P?e.rows.slice(1):e.rows;return new F({layout:H.FIXED,width:{size:b.reduce((I,O)=>I+O,0),type:p.DXA},columnWidths:b,...t.indent===0?{}:{indent:{size:t.indent,type:p.DXA}},rows:Te.map((I,O)=>new G({tableHeader:q&&O===0,cantSplit:!0,children:Array.from({length:f},(_e,Ee)=>{const Re=q&&O===0,ke=ce&&Ee===0&&!Re;return new _({width:{size:b[Ee]??0,type:p.DXA},...Re?{shading:B(Pt)}:{},borders:{top:O===0?{style:y.SINGLE,size:8,color:ge}:{style:y.NONE,size:0,color:"auto"},left:{style:y.NONE,size:0,color:"auto"},right:{style:y.NONE,size:0,color:"auto"},bottom:O===Te.length-1?{style:y.SINGLE,size:8,color:ge}:Re?{style:y.SINGLE,size:6,color:ge}:{style:y.SINGLE,size:4,color:Me}},margins:{top:E(o.cell.top),bottom:E(o.cell.top),left:E(o.cell.side),right:E(o.cell.side),marginUnitType:p.DXA},children:[new h({spacing:{after:0},...Ae.has(Ee)?{alignment:m.RIGHT}:{},children:U(I[Ee]??[],{bold:ke||Re,size:o.small*2})})]})})}))})},ae=(e,t,i,f,g,a)=>{const d=j(e.align),s={...L(t),...d===void 0?{}:{alignment:d}},R=i===void 0?void 0:e.caption,C=R!==void 0,A=[new h({...s,keepNext:C,...i?{spacing:{line:240,lineRule:n.LineRuleType.AUTO,...C?{after:E(o.caption)}:{}}}:{},children:i?[new x({type:i.type,data:i.data,transformation:Xt(i,e.width,t.room-t.indent),altText:{name:e.alt??"",title:e.caption??e.alt??"",description:e.alt??""}})]:[new M({text:f,color:de})]})];return R!==void 0&&A.push(new h({...s,style:"Caption",children:T(a,[new M({text:Oe(R,g)})])})),A},ye=(e,t)=>{const i=t.room-t.indent,f=e.columns.map(A=>A.width??1),g=f.reduce((A,v)=>A+v,0)||1,a=f.map(A=>Math.round(i*A/g)),d=it(e,t.frame),s={style:y.NONE,size:0,color:"auto"},R={top:s,bottom:s,left:s,right:s,insideHorizontal:s,insideVertical:s},C=Ft/2;return new F({layout:H.FIXED,width:{size:i,type:p.DXA},columnWidths:a,borders:R,...t.indent===0?{}:{indent:{size:t.indent,type:p.DXA}},rows:[new G({cantSplit:ft(e,r.page),children:e.columns.map((A,v)=>{const b=a[v]??0,P=v===0?0:C,q=v===e.columns.length-1?0:C,ce=N(V(A.blocks,{indent:0,level:0,room:b-P-q,frame:d[v]??t.frame}));return new _({width:{size:b,type:p.DXA},borders:R,margins:{top:0,bottom:0,left:P,right:q,marginUnitType:p.DXA},children:ce})})})]})},K=(e,t,i)=>{const f=ee(e.look?.color,Se),g=V(e.children??[],Ke(t)),a=D(e.look),d=Ge;return e.type==="check"?[new h({...a,...L(t),style:d,children:[new M({text:e.checked?"☑ ":"☐ "}),...U(e.content,{color:f})]}),...g]:[new h({...a,style:d,numbering:e.type==="bullet"?{reference:Be,level:t.level}:{reference:`start-${String(i.start)}`,level:t.level,instance:i.id},children:U(e.content,{color:f})}),...g]},De=(e,t)=>{const i="look"in e?e.look:void 0,f=ee(i?.color,Se),g=D(i),a=()=>"children"in e?V(e.children??[],Ke(t)):[];switch(e.type){case"paragraph":case"toggle":return[new h({...r.sets.align&&e.look?.align===void 0?{alignment:m.JUSTIFIED}:{},...g,...r.sets.indent&&e.type==="paragraph"?{indent:{left:t.indent,firstLine:Math.round(r.page.textIndent*r.page.size*20)}}:L(t),children:U(e.content,{color:f})}),...a()];case"heading":return[new h({...g,...L(t),...e===r.title?{heading:n.HeadingLevel.TITLE}:{heading:n.HeadingLevel[`HEADING_${String(e.level)}`]},children:T(r.anchors.get(e),U(e.content,{color:f}))}),...a()];case"quote":return[new h({...g,indent:{left:t.indent+E(o.quote)},border:{left:{style:y.SINGLE,color:l??ge,size:l?12:6,space:Math.floor(o.quote-(l?1.5:.75))}},children:U(e.content,{color:f??fe})}),...a()];case"callout":return[me(e,t),...J()];case"card":return[we(e,t),...J()];case"stats":return[oe(e,t),...J()];case"code":{if(e.language===ve.math||e.language===ve.mermaid){const R=u.drawn?.(e);if(R)return ae({...e.language===ve.math?{}:{align:"center"}},t,R,"")}const d=R=>({style:y.SINGLE,color:Ce,size:4,space:R}),s=E(o.box.side+.5);return[new h({indent:{left:t.indent+s,right:s},shading:B(Ce),border:{top:d(o.box.top),bottom:d(o.box.top),left:d(o.box.side),right:d(o.box.side)},keepLines:!0,children:e.code.split(`
4
+ `).map((R,C)=>new M({text:R,font:X,size:o.small*2,...C>0?{break:1}:{}}))})]}case"columns":return[ye(e,t)];case"chart":{const d=r.numbers.get(e),s=d===void 0?void 0:e.title,{chart:R,problems:C}=nt(s===void 0?e:ct(e),u),A=he(y.DASHED,Me);if(!R)return[new h({...L(t),alignment:m.CENTER,border:{top:A,bottom:A,left:A,right:A},children:[new M({text:[e.title??"Chart",...C].join(": "),color:de})]})];const v=et(e,t.frame),b=(t.room-t.indent)/ue,P=Math.min(1,b/v.width);return k.push({chart:R,width:Math.round(v.width*P),height:Math.round(v.height*P),words:tt(e,R)}),[new h({...L(t),alignment:m.CENTER,keepNext:s!==void 0,spacing:{line:240,lineRule:n.LineRuleType.AUTO},children:[new M({text:`${je}${String(k.length)}`})]}),...s===void 0?[]:[new h({...L(t),alignment:m.CENTER,style:"Caption",children:T(e.id,[new M({text:Oe(s,d)})])})]]}case"image":return ae(e,t,u.picture?.(e.src),e.alt??e.caption??e.src,r.numbers.get(e),e.id);case"component":{const d=u.component?.(e);if(d)return ae(e,t,d,"",r.numbers.get(e),e.id);const s=he(y.DASHED,Me);return[new h({...L(t),alignment:m.CENTER,border:{top:s,bottom:s,left:s,right:s},children:[new M({text:ot(e),color:de})]})]}case"table":return[...e.caption===void 0?[]:[new h({...L(t),style:"Caption",keepNext:!0,spacing:{after:E(o.caption)},children:T(e.id,[new M({text:Oe(e.caption,r.numbers.get(e))})])})],se(e,t),...J()];case"pagebreak":return[new h({spacing:{before:0,after:0,line:20,lineRule:n.LineRuleType.EXACT},children:[new n.PageBreak]})];case"bibliography":{const{page:d}=r,s=d.textIndent>0?Math.round(d.textIndent*d.size*20):480;return r.sources.map(R=>new h({...L(t),alignment:m.LEFT,indent:{left:t.indent+s,hanging:s},spacing:{after:E(o.after)},children:R.pieces.map(C=>{const A=C.italic?{italics:!0}:{};return new M({text:C.text,...A})})}))}case"toc":{const d=e.levels??3,s=r.headings.filter(A=>A.level<=d).map(A=>{const v=r.anchors.get(A)??"",b=u.headingPage?.(v),P=r.bookmarks.get(v);return{title:A.content.map(q=>q.text).join(""),level:A.level,...b===void 0?{}:{page:b},...P===void 0?{}:{href:P}}}),R=Math.min(...s.map(A=>A.level)),C=at(e,r.chinese);return[...C===""?[]:[new h({style:qe,text:C})],new n.TableOfContents(void 0,{hyperlink:!0,headingStyleRange:`1-${String(d)}`,beginDirty:!1,cachedEntries:s.map(A=>({...A,level:A.level-R+1}))})]}case"note":return[];case"divider":return[new h({...L(t),spacing:{before:E(o.divider),after:E(o.divider),line:20,lineRule:n.LineRuleType.EXACT},border:{bottom:{style:y.SINGLE,color:Le,size:4,space:0}}})];case"embed":{const d=/^<\s*([A-Za-z][\w.]*)/.exec(e.source.trim())?.[1],s=he(y.DASHED,Me);return[new h({...L(t),alignment:m.CENTER,border:{top:s,bottom:s,left:s,right:s},children:[new M({text:d??"",color:de})]})]}case"source":return[];case"bullet":case"numbered":case"check":return[]}};function V(e,t){const i=[];let f,g;for(const a of e){if(!Ht(a)){f=void 0,g=void 0,i.push(...De(a,t));continue}if(f===void 0||g===void 0||g.type==="numbered"!=(a.type==="numbered")){const d=a.type==="numbered"?a.start??1:1;$.add(d),f={id:++ne,start:d}}g=a,i.push(...K(a,t,f))}return i.flatMap((a,d)=>a instanceof F&&i[d+1]instanceof F?[a,Q(0)]:[a])}return{charts:k,body:(e,t)=>V(e,Ne(t)),footnotes:e=>Object.fromEntries([...ze(e)].flatMap(t=>{if(t.type!=="note")return[];const i=S.get(t.label.toLowerCase());if(i===void 0)return[];const f=V(t.children??[],Ne(Y(r.page.width)-Y(r.page.margins.left+r.page.margins.right))).filter(g=>g instanceof h);return[[String(i),{children:[new h({spacing:{after:40},children:U(t.content,{size:18,color:fe})}),...f]}]]})),numbering:()=>[{reference:Be,levels:Array.from({length:9},(e,t)=>({level:t,format:n.LevelFormat.BULLET,text:["•","◦","▪"][t%3]??"•",alignment:m.LEFT,style:{paragraph:{indent:{left:(t+1)*pe,hanging:pe}}}}))},...[...$].sort((e,t)=>e-t).map(e=>({reference:`start-${String(e)}`,levels:Array.from({length:9},(t,i)=>({level:i,format:[n.LevelFormat.DECIMAL,n.LevelFormat.LOWER_LETTER,n.LevelFormat.LOWER_ROMAN][i%3]??n.LevelFormat.DECIMAL,text:`%${String(i+1)}.`,alignment:m.LEFT,...i===0?{start:e}:{},style:{paragraph:{indent:{left:(i+1)*pe,hanging:pe}}}}))}))]}}const Gt="1980-01-01T00:00:00Z",Ye=9525,Ve="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Bt=n=>n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");function Wt(n,u,w,l,S){return n.forEach((z,r)=>{const m=String(r+1),y=`rIdChart${m}`,c=`Microsoft_Excel_Worksheet${m}.xlsx`;S(`word/charts/chart${m}.xml`,Je(z.chart,{width:z.width*.75,height:z.height*.75},"rId1",{frameless:!0})),S(`word/charts/_rels/chart${m}.xml.rels`,`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
5
+ <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${Ve}/package" Target="../embeddings/${c}"/></Relationships>`),S(`word/embeddings/${c}`,Qe(z.chart)),w=w.replace("</Relationships>",`<Relationship Id="${y}" Type="${Ve}/chart" Target="charts/chart${m}.xml"/></Relationships>`),l=l.replace("</Types>",`<Override ContentType="application/vnd.openxmlformats-officedocument.drawingml.chart+xml" PartName="/word/charts/chart${m}.xml"/></Types>`);const x=String(z.width*Ye),h=String(z.height*Ye),Z=`<w:r><w:drawing><wp:inline distT="0" distB="0" distL="0" distR="0"><wp:extent cx="${x}" cy="${h}"/><wp:effectExtent l="0" t="0" r="0" b="0"/><wp:docPr id="0" name="Chart ${m}" descr="${Bt(z.words)}"/><wp:cNvGraphicFramePr/><a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/chart"><c:chart xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" r:id="${y}"/></a:graphicData></a:graphic></wp:inline></w:drawing></w:r>`;u=u.replace(new RegExp(`<w:r>(?:(?!<w:r>).)*?<w:t[^>]*>${je}${m}</w:t></w:r>`,"su"),Z)}),n.length>0&&!l.includes('Extension="xlsx"')&&(l=l.replace("</Types>",'<Default ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" Extension="xlsx"/></Types>')),{document:u,rels:w,types:l}}function jt(n,u,w){const l=u.unzipSync(n),S=p=>{const N=l[p];return N&&new TextDecoder().decode(N)},z=(p,N)=>{l[p]=typeof N=="string"?new TextEncoder().encode(N):N},r="word/document.xml",m="word/_rels/document.xml.rels",y="[Content_Types].xml",c=Wt(w,S(r)??"",S(m)??"",S(y)??"",z);z(y,c.types);let x=c.document,h=c.rels;[...new Set([...x.matchAll(/w:hyperlink [^>]*r:id="([^"]+)"/g)].map(p=>p[1]??""))].forEach((p,N)=>{const X=`rIdLink${String(N+1)}`;x=x.split(`"${p}"`).join(`"${X}"`),h=h.split(`"${p}"`).join(`"${X}"`)});let F=0;x=x.replace(/<wp:docPr id="\d+"/g,()=>`<wp:docPr id="${String(++F)}"`);const _=new Map;x=x.replace(/<w:bookmarkStart w:name="([^"]*)" w:id="(\d+)"/g,(p,N,X)=>{const $=String(_.size+1);return _.set(X,$),`<w:bookmarkStart w:name="${N}" w:id="${$}"`}),x=x.replace(/<w:bookmarkEnd w:id="(\d+)"/g,(p,N)=>{const X=_.get(N);return X===void 0?p:`<w:bookmarkEnd w:id="${X}"`}),z(r,x),z(m,h);const H="docProps/core.xml",G=S(H);G!==void 0&&z(H,G.replace(/(<dcterms:(?:created|modified)[^>]*>)[^<]*/g,`$1${Gt}`));const M=Object.fromEntries(Object.entries(l).sort(([p],[N])=>p<N?-1:1));return u.zipSync(M,{mtime:new Date(1980,0,1)})}const be=(n,u)=>{const w=We[n];return{ascii:w.latin,hAnsi:w.latin,cs:w.latin,eastAsia:w.eastAsia??u}};function Kt(n,u,w){const l={left:[],center:[],right:[]};u.left!==void 0&&l.left.push(u.left),u.center!==void 0&&l.center.push(u.center),u.right!==void 0&&l.right.push(u.right),u.outside!==void 0&&l[w.odd?"right":"left"].push(u.outside),u.inside!==void 0&&l[w.odd?"left":"right"].push(u.inside);const S={size:Math.round(w.size*2),color:w.color,font:be(w.face,w.eastAsia)},z=r=>r.split(/(\{title\}|\{section\}|\{page\}|\{pages\})/u).filter(m=>m!=="").map(m=>m==="{page}"?new n.TextRun({...S,children:[n.PageNumber.CURRENT]}):m==="{pages}"?new n.TextRun({...S,children:[n.PageNumber.TOTAL_PAGES]}):m==="{section}"?new n.SimpleField(`STYLEREF "heading ${String(w.section)}"`,""):new n.TextRun({...S,text:m==="{title}"?w.title:m}));return new n.Paragraph({style:w.style,tabStops:[{type:n.TabStopType.CENTER,position:Math.round(w.width/2)},{type:n.TabStopType.RIGHT,position:w.width}],children:[...z(l.left.join(" ")),new n.TextRun({...S,children:[new n.Tab]}),...z(l.center.join(" ")),new n.TextRun({...S,children:[new n.Tab]}),...z(l.right.join(" "))]})}const Ze=(n,u,w,l)=>({run:{...u?.font===void 0?{}:{font:be(n.font,w)},...u?.size===void 0?{}:{size:Math.round(n.size*2)},...u?.weight===void 0?{}:{bold:n.weight==="bold"},...u?.italic===void 0?{}:{italics:n.italic}},paragraph:u?.align===void 0?{}:{alignment:n.align==="center"?l.AlignmentType.CENTER:n.align==="right"?l.AlignmentType.RIGHT:l.AlignmentType.LEFT}});function qt(n){const u=new Map,w=new Set;return n.forEach((l,S)=>{const z=l.replace(/[^A-Za-z0-9_]/gu,"_").replace(/^[^A-Za-z]+/u,"");let r=`b_${z}`.slice(0,32);(w.has(r)||z==="")&&(r=`b_${String(S)}_${z}`.slice(0,40)),w.add(r),u.set(l,r)}),u}export async function docxOf(n,u,w,l={}){const S=l.page??{},z=Fe(S).citationStyle??"apa",r=ht(w,l.sources??[],z,"block"),m=lt(w,l.sources??[],z),y=Fe(S),c=Et(S),x=We[c.font].eastAsia??_t(St(r)),h=be(c.font,x),Z=ee(wt(l.page),{}),F=mt(r),_=st(r,S),H=new Map;for(const T of ze(r)){const D=$e(T),L=_.get(T);D!==void 0&&L!==void 0&&H.set(D,L.label)}for(const[T,D]of F)T.type==="heading"&&H.set(D,T.content.map(L=>L.text).join(""));const{title:G}=Rt(r),M=[...ze(r)].filter(T=>T.type==="heading"&&T!==G),p=qt([...F.values(),...[...ze(r)].flatMap(T=>{const D=$e(T);return D===void 0?[]:[D]})]),N=Ut(n,l,x,Z,xt(r),bt(r),{page:c,sets:{indent:y.textIndent!==void 0&&y.textIndent>0,align:y.textAlign==="justify"},numbers:_,refs:H,bookmarks:p,anchors:F,title:G,headings:M,chinese:dt(r),sources:m}),X=gt(r),$={width:Y(c.width),height:Y(c.height)},ne={top:Y(c.margins.top),bottom:Y(c.margins.bottom),left:Y(c.margins.left),right:Y(c.margins.right)},k=l.cover,B=[c.header,c.footer].some(T=>T!==void 0&&(T.outside!==void 0||T.inside!==void 0)),he=X.map((T,D)=>{const L=T.landscape?$.height:$.width,re=L-ne.left-ne.right,me=N.body(T.blocks,re);if(D===0&&k){const K=Math.round(L/ue);me.unshift(new n.Paragraph({spacing:{before:0,after:0},children:[new n.ImageRun({type:k.type,data:k.data,transformation:{width:K,height:Math.round(K*Nt)},floating:{horizontalPosition:{relative:n.HorizontalPositionRelativeFrom.PAGE,offset:0},verticalPosition:{relative:n.VerticalPositionRelativeFrom.PAGE,offset:0},allowOverlap:!1,margins:{bottom:324e3},wrap:{type:n.TextWrappingType.TOP_AND_BOTTOM}},altText:{name:"Cover",title:"Cover",description:""}})]}))}const we=(K,De,V)=>{if(K===void 0)return;const e=t=>Kt(n,K,{style:V,odd:t,width:re,title:l.title??"",section:Math.min(...M.map(i=>i.level),6),face:K.font??c.font,eastAsia:x,size:K.size===void 0?Math.max(7.5,c.size*.75):He(K.size),color:De?de:le});return{default:e(!0),...B?{even:e(!1)}:{}}},oe=we(c.header,y.header===void 0,"Header"),se=we(c.footer,y.footer===void 0,"Footer"),ae=D===0&&k!==void 0&&oe!==void 0,ye=y.grid===void 0?void 0:{type:n.DocumentGridType.LINES_AND_CHARS,linePitch:Math.round(Tt(c)*20),charSpace:Math.round(c.textWidth/25.4*72/y.grid.chars-c.size)*4096};return{properties:{page:{size:{width:Math.min($.width,$.height),height:Math.max($.width,$.height),...T.landscape||$.width>$.height?{orientation:n.PageOrientation.LANDSCAPE}:{}},margin:{...ne,header:Math.max(0,ne.top-Y(7)-Math.round(c.size*20*1.2)),footer:Math.max(0,ne.bottom-Y(7)-Math.round(c.size*20*1.2))}},...ye===void 0?{}:{grid:ye},...ae?{titlePage:!0}:{}},...oe===void 0?{}:{headers:{default:new n.Header({children:[oe.default]}),...oe.even?{even:new n.Header({children:[oe.even]})}:{},...ae?{first:new n.Header({children:[]})}:{}}},...se===void 0?{}:{footers:{default:new n.Footer({children:[se.default]}),...se.even?{even:new n.Footer({children:[se.even]})}:{},...ae?{first:new n.Footer({children:[se.default]})}:{}}},children:me}}),o=c.lineHeight,E={spacing:{after:Math.round(c.paragraphSpacing*c.size*20),..."pt"in o?{line:Math.round(o.pt*20),lineRule:n.LineRuleType.EXACT}:{line:Math.round(o.multiple*240),lineRule:n.LineRuleType.AUTO}}},Q=c.spacing,J=T=>Math.round(T*20),j=T=>{const D=y.headings?.[T],L=Ze(c.headings[T],D,x,n);return{run:{size:Math.round(c.headings[T].size*2),bold:!0,font:h,color:le,...L.run},paragraph:{spacing:{before:J(Q.heading.before),after:J(Q.heading.after)},keepNext:!0,keepLines:!0,...c.headings[T].rule?{border:{bottom:{style:n.BorderStyle.SINGLE,size:4,color:Le,space:ut}}}:{},...L.paragraph}}},ie=Ze(c.title,y.title,x,n),U=new n.Document({creator:"AllyHub",lastModifiedBy:"AllyHub",...l.title===void 0?{}:{title:l.title},...B?{evenAndOddHeaderAndFooters:!0}:{},numbering:{config:N.numbering()},styles:{default:{document:{run:{font:h,size:Math.round(c.size*2),color:le},paragraph:E},hyperlink:{run:{color:Z??le,underline:{color:Z??ge}}},title:{run:{size:Math.round(c.title.size*2),bold:!0,font:h,color:le,...ie.run},paragraph:{spacing:{before:0,after:J(Q.title)},keepNext:!0,...ie.paragraph}},heading1:j(1),heading2:j(2),heading3:j(3),heading4:j(4),heading5:j(5),heading6:j(6)},paragraphStyles:[{id:qe,name:"TOC Heading",basedOn:"Normal",next:"Normal",quickFormat:!0,...j(1)},{id:"Caption",name:"caption",basedOn:"Normal",next:"Normal",quickFormat:!0,run:{size:Q.small*2,color:de},paragraph:{spacing:{before:0}}},{id:Ge,name:"List Paragraph",basedOn:"Normal",quickFormat:!0,paragraph:{contextualSpacing:!0}},...[["Header",c.header,y.header===void 0],["Footer",c.footer,y.footer===void 0]].flatMap(([T,D,L])=>D===void 0?[]:[{id:T,name:T.toLowerCase(),basedOn:"Normal",run:{size:Math.round((D.size===void 0?Math.max(7.5,c.size*.75):He(D.size))*2),color:L?de:le,font:be(D.font??c.font,x)},paragraph:{spacing:{before:0,after:0,line:240}}}])]},sections:he,footnotes:N.footnotes(r)}),xe=await n.Packer.toBuffer(U);return jt(new Uint8Array(xe),u,N.charts)}