ooxml-core 1.50.2 → 1.51.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (366) hide show
  1. package/README.md +11 -0
  2. package/dist/{PptxHandler-PVQW47CY.mjs → PptxHandler-6GRVJRHP.mjs} +2 -2
  3. package/dist/PptxHandler-E6QYPF7X.mjs +8 -0
  4. package/dist/PptxHandler-UNQVCIGM.cjs +17 -0
  5. package/dist/PresentationBuilder-DVDJSV5R.mjs +8 -0
  6. package/dist/PresentationBuilder-F5UWRF6H.cjs +25 -0
  7. package/dist/{PresentationBuilder-ZOOVSBPR.mjs → PresentationBuilder-T6YKWPF7.mjs} +2 -2
  8. package/dist/automation/index.cjs +5806 -4494
  9. package/dist/automation/index.mjs +5806 -4494
  10. package/dist/chunk-25IJEN7R.cjs +36 -0
  11. package/dist/chunk-25JN3ZQM.mjs +58 -0
  12. package/dist/{chunk-7XYVFUB3.cjs → chunk-2IO523MM.cjs} +1 -0
  13. package/dist/{chunk-53KMIHYN.mjs → chunk-4LUZHBTT.mjs} +83 -31
  14. package/dist/chunk-554UZLPS.mjs +237 -0
  15. package/dist/{chunk-VLKUMQGT.mjs → chunk-63RAF3TS.mjs} +1 -1
  16. package/dist/{chunk-7UM5IFPR.mjs → chunk-6IUYKP77.mjs} +1 -1
  17. package/dist/{chunk-VK2G4BGX.mjs → chunk-BIMV5FVL.mjs} +481 -193
  18. package/dist/{chunk-CODMW5KF.cjs → chunk-CVUMILG3.cjs} +1 -0
  19. package/dist/{chunk-NBMXEVHL.mjs → chunk-FX6WL42B.mjs} +1 -0
  20. package/dist/chunk-GI4Y6BBX.mjs +21 -0
  21. package/dist/{chunk-MX2GFMZS.mjs → chunk-GZL4ERW3.mjs} +1 -1
  22. package/dist/chunk-HWL2AGLD.cjs +98 -0
  23. package/dist/chunk-HZAB3YDO.cjs +234 -0
  24. package/dist/chunk-IDATIFCG.mjs +226 -0
  25. package/dist/chunk-LO55N7VL.cjs +247 -0
  26. package/dist/{chunk-FFLU4LUQ.cjs → chunk-LUBPW5NP.cjs} +1629 -1609
  27. package/dist/chunk-MUNEIE2J.cjs +62 -0
  28. package/dist/{chunk-ZCKEKP7N.mjs → chunk-RYUADJV6.mjs} +4 -4
  29. package/dist/chunk-TOBK5FC4.mjs +88 -0
  30. package/dist/chunk-UV4LMGVZ.mjs +31 -0
  31. package/dist/{chunk-O3YGBYGZ.mjs → chunk-VRVHM6TJ.mjs} +1 -0
  32. package/dist/chunk-W7LVJC32.cjs +25 -0
  33. package/dist/chunk-WAZ7T2BL.cjs +169 -0
  34. package/dist/{chunk-3OKY56UM.mjs → chunk-YX33WEKS.mjs} +411 -391
  35. package/dist/docx/auto-number-fields.d.ts +22 -0
  36. package/dist/docx/auto-number-fields.d.ts.map +1 -0
  37. package/dist/docx/block-parser.d.ts.map +1 -1
  38. package/dist/docx/character-styles.d.ts.map +1 -1
  39. package/dist/docx/clipboard/css.d.ts +21 -0
  40. package/dist/docx/clipboard/css.d.ts.map +1 -0
  41. package/dist/docx/clipboard/html-tokens.d.ts +38 -0
  42. package/dist/docx/clipboard/html-tokens.d.ts.map +1 -0
  43. package/dist/docx/clipboard/index.d.ts +6 -0
  44. package/dist/docx/clipboard/index.d.ts.map +1 -0
  45. package/dist/docx/clipboard/word-fields.d.ts +13 -0
  46. package/dist/docx/clipboard/word-fields.d.ts.map +1 -0
  47. package/dist/docx/clipboard/word-fragment.d.ts +14 -0
  48. package/dist/docx/clipboard/word-fragment.d.ts.map +1 -0
  49. package/dist/docx/clipboard/word-html.d.ts +22 -0
  50. package/dist/docx/clipboard/word-html.d.ts.map +1 -0
  51. package/dist/docx/clipboard/word-list-scan.d.ts +25 -0
  52. package/dist/docx/clipboard/word-list-scan.d.ts.map +1 -0
  53. package/dist/docx/clipboard/word-lists.d.ts +13 -0
  54. package/dist/docx/clipboard/word-lists.d.ts.map +1 -0
  55. package/dist/docx/clipboard/word-runs.d.ts +18 -0
  56. package/dist/docx/clipboard/word-runs.d.ts.map +1 -0
  57. package/dist/docx/clipboard/word-styles.d.ts +35 -0
  58. package/dist/docx/clipboard/word-styles.d.ts.map +1 -0
  59. package/dist/docx/compare/build.d.ts +48 -0
  60. package/dist/docx/compare/build.d.ts.map +1 -0
  61. package/dist/docx/compare/compare.d.ts +18 -0
  62. package/dist/docx/compare/compare.d.ts.map +1 -0
  63. package/dist/docx/compare/context.d.ts +42 -0
  64. package/dist/docx/compare/context.d.ts.map +1 -0
  65. package/dist/docx/compare/diff.d.ts +20 -0
  66. package/dist/docx/compare/diff.d.ts.map +1 -0
  67. package/dist/docx/compare/index.d.ts +4 -0
  68. package/dist/docx/compare/index.d.ts.map +1 -0
  69. package/dist/docx/compare/slide.d.ts +9 -0
  70. package/dist/docx/compare/slide.d.ts.map +1 -0
  71. package/dist/docx/compare/spans.d.ts +13 -0
  72. package/dist/docx/compare/spans.d.ts.map +1 -0
  73. package/dist/docx/compare/story.d.ts +7 -0
  74. package/dist/docx/compare/story.d.ts.map +1 -0
  75. package/dist/docx/compare/table.d.ts +23 -0
  76. package/dist/docx/compare/table.d.ts.map +1 -0
  77. package/dist/docx/compare/tokens.d.ts +50 -0
  78. package/dist/docx/compare/tokens.d.ts.map +1 -0
  79. package/dist/docx/compare/types.d.ts +51 -0
  80. package/dist/docx/compare/types.d.ts.map +1 -0
  81. package/dist/docx/compatibility.d.ts +46 -0
  82. package/dist/docx/compatibility.d.ts.map +1 -0
  83. package/dist/docx/computed-fields.d.ts +39 -0
  84. package/dist/docx/computed-fields.d.ts.map +1 -0
  85. package/dist/docx/doc-property-field.d.ts +17 -0
  86. package/dist/docx/doc-property-field.d.ts.map +1 -0
  87. package/dist/docx/document-parts.d.ts +2 -0
  88. package/dist/docx/document-parts.d.ts.map +1 -1
  89. package/dist/docx/drawing-wrap.d.ts +21 -0
  90. package/dist/docx/drawing-wrap.d.ts.map +1 -0
  91. package/dist/docx/drawing.d.ts.map +1 -1
  92. package/dist/docx/embedded.cjs +3965 -2313
  93. package/dist/docx/embedded.mjs +3965 -2313
  94. package/dist/docx/field-format.d.ts +45 -0
  95. package/dist/docx/field-format.d.ts.map +1 -0
  96. package/dist/docx/field-result-spans.d.ts +62 -0
  97. package/dist/docx/field-result-spans.d.ts.map +1 -0
  98. package/dist/docx/field-runs.d.ts.map +1 -1
  99. package/dist/docx/field-stories.d.ts +9 -0
  100. package/dist/docx/field-stories.d.ts.map +1 -0
  101. package/dist/docx/find-stories.d.ts +27 -0
  102. package/dist/docx/find-stories.d.ts.map +1 -0
  103. package/dist/docx/highlight.d.ts +19 -0
  104. package/dist/docx/highlight.d.ts.map +1 -1
  105. package/dist/docx/hyperlink.d.ts +7 -0
  106. package/dist/docx/hyperlink.d.ts.map +1 -1
  107. package/dist/docx/index.cjs +7359 -3476
  108. package/dist/docx/index.d.ts +13 -1
  109. package/dist/docx/index.d.ts.map +1 -1
  110. package/dist/docx/index.mjs +7327 -3476
  111. package/dist/docx/inline-model.d.ts +21 -0
  112. package/dist/docx/inline-model.d.ts.map +1 -1
  113. package/dist/docx/inline-slots.d.ts.map +1 -1
  114. package/dist/docx/inspect-document.d.ts +21 -0
  115. package/dist/docx/inspect-document.d.ts.map +1 -0
  116. package/dist/docx/kinsoku-settings.d.ts +9 -0
  117. package/dist/docx/kinsoku-settings.d.ts.map +1 -0
  118. package/dist/docx/layout/adapt-table-floating.d.ts +11 -0
  119. package/dist/docx/layout/adapt-table-floating.d.ts.map +1 -0
  120. package/dist/docx/layout/adapt-table.d.ts.map +1 -1
  121. package/dist/docx/layout/adapter.d.ts.map +1 -1
  122. package/dist/docx/layout/computed-field-runs.d.ts +8 -0
  123. package/dist/docx/layout/computed-field-runs.d.ts.map +1 -0
  124. package/dist/docx/layout/floats.d.ts +3 -1
  125. package/dist/docx/layout/floats.d.ts.map +1 -1
  126. package/dist/docx/layout/flow-floating-table.d.ts +13 -0
  127. package/dist/docx/layout/flow-floating-table.d.ts.map +1 -0
  128. package/dist/docx/layout/flow-table.d.ts +1 -1
  129. package/dist/docx/layout/flow-table.d.ts.map +1 -1
  130. package/dist/docx/layout/index.cjs +2280 -941
  131. package/dist/docx/layout/index.mjs +2276 -942
  132. package/dist/docx/layout/input.d.ts +50 -0
  133. package/dist/docx/layout/input.d.ts.map +1 -1
  134. package/dist/docx/layout/layout.d.ts.map +1 -1
  135. package/dist/docx/layout/page-cursor.d.ts.map +1 -1
  136. package/dist/docx/layout/page-flow.d.ts.map +1 -1
  137. package/dist/docx/layout/paragraph-layout.d.ts.map +1 -1
  138. package/dist/docx/layout/paragraph-tokens.d.ts +6 -0
  139. package/dist/docx/layout/paragraph-tokens.d.ts.map +1 -1
  140. package/dist/docx/layout/result.d.ts +12 -0
  141. package/dist/docx/layout/result.d.ts.map +1 -1
  142. package/dist/docx/layout/section-flow.d.ts.map +1 -1
  143. package/dist/docx/layout/table-autofit-distribute.d.ts +18 -0
  144. package/dist/docx/layout/table-autofit-distribute.d.ts.map +1 -0
  145. package/dist/docx/layout/table-autofit-measure.d.ts +15 -0
  146. package/dist/docx/layout/table-autofit-measure.d.ts.map +1 -0
  147. package/dist/docx/layout/table-autofit.d.ts +10 -0
  148. package/dist/docx/layout/table-autofit.d.ts.map +1 -0
  149. package/dist/docx/layout/table-cell-layout.d.ts.map +1 -1
  150. package/dist/docx/layout/text-breaks.d.ts +38 -13
  151. package/dist/docx/layout/text-breaks.d.ts.map +1 -1
  152. package/dist/docx/layout/wrap.d.ts +1 -1
  153. package/dist/docx/layout/wrap.d.ts.map +1 -1
  154. package/dist/docx/list-number-fields.d.ts +25 -0
  155. package/dist/docx/list-number-fields.d.ts.map +1 -0
  156. package/dist/docx/load/index.cjs +4355 -2703
  157. package/dist/docx/load/index.mjs +4355 -2703
  158. package/dist/docx/model-paragraph.d.ts +12 -1
  159. package/dist/docx/model-paragraph.d.ts.map +1 -1
  160. package/dist/docx/model.d.ts +26 -1
  161. package/dist/docx/model.d.ts.map +1 -1
  162. package/dist/docx/note-convert.d.ts +45 -0
  163. package/dist/docx/note-convert.d.ts.map +1 -0
  164. package/dist/docx/numbering-counters.d.ts +17 -0
  165. package/dist/docx/numbering-counters.d.ts.map +1 -0
  166. package/dist/docx/numbering-format.d.ts +11 -2
  167. package/dist/docx/numbering-format.d.ts.map +1 -1
  168. package/dist/docx/outline-numbering.d.ts +6 -0
  169. package/dist/docx/outline-numbering.d.ts.map +1 -0
  170. package/dist/docx/package-information-save.d.ts +9 -0
  171. package/dist/docx/package-information-save.d.ts.map +1 -0
  172. package/dist/docx/package-information.d.ts +43 -0
  173. package/dist/docx/package-information.d.ts.map +1 -0
  174. package/dist/docx/package-properties.d.ts +5 -0
  175. package/dist/docx/package-properties.d.ts.map +1 -0
  176. package/dist/docx/paragraph-styles.d.ts +2 -0
  177. package/dist/docx/paragraph-styles.d.ts.map +1 -1
  178. package/dist/docx/parse-revisions.d.ts +2 -0
  179. package/dist/docx/parse-revisions.d.ts.map +1 -1
  180. package/dist/docx/parse-table-floating.d.ts +5 -0
  181. package/dist/docx/parse-table-floating.d.ts.map +1 -0
  182. package/dist/docx/parse-table.d.ts.map +1 -1
  183. package/dist/docx/parse.d.ts.map +1 -1
  184. package/dist/docx/part-relationships.d.ts.map +1 -1
  185. package/dist/docx/personal-information.d.ts +18 -0
  186. package/dist/docx/personal-information.d.ts.map +1 -0
  187. package/dist/docx/picture-crop-edit.d.ts +18 -0
  188. package/dist/docx/picture-crop-edit.d.ts.map +1 -0
  189. package/dist/docx/picture-watermark.d.ts +29 -0
  190. package/dist/docx/picture-watermark.d.ts.map +1 -0
  191. package/dist/docx/relationship-allocator.d.ts.map +1 -1
  192. package/dist/docx/remove-document-information.d.ts +8 -0
  193. package/dist/docx/remove-document-information.d.ts.map +1 -0
  194. package/dist/docx/revision-commands.d.ts +6 -1
  195. package/dist/docx/revision-commands.d.ts.map +1 -1
  196. package/dist/docx/revision-ids.d.ts.map +1 -1
  197. package/dist/docx/run-language.d.ts +9 -0
  198. package/dist/docx/run-language.d.ts.map +1 -0
  199. package/dist/docx/run-properties-snapshot.d.ts +9 -0
  200. package/dist/docx/run-properties-snapshot.d.ts.map +1 -0
  201. package/dist/docx/run-style-model.d.ts +4 -0
  202. package/dist/docx/run-style-model.d.ts.map +1 -1
  203. package/dist/docx/save-modified.d.ts +2 -1
  204. package/dist/docx/save-modified.d.ts.map +1 -1
  205. package/dist/docx/save.d.ts.map +1 -1
  206. package/dist/docx/style-ref-fields.d.ts +1 -8
  207. package/dist/docx/style-ref-fields.d.ts.map +1 -1
  208. package/dist/docx/symbol-field.d.ts +21 -0
  209. package/dist/docx/symbol-field.d.ts.map +1 -0
  210. package/dist/docx/table-cell-write.d.ts.map +1 -1
  211. package/dist/docx/table-defaults.d.ts +2 -0
  212. package/dist/docx/table-defaults.d.ts.map +1 -1
  213. package/dist/docx/table-margins.d.ts +18 -0
  214. package/dist/docx/table-margins.d.ts.map +1 -0
  215. package/dist/docx/table-model.d.ts +23 -0
  216. package/dist/docx/table-model.d.ts.map +1 -1
  217. package/dist/docx/table-structure-check.d.ts.map +1 -1
  218. package/dist/docx/table-styles.d.ts.map +1 -1
  219. package/dist/docx/ui/index.cjs +787 -435
  220. package/dist/docx/ui/index.d.ts +1 -0
  221. package/dist/docx/ui/index.d.ts.map +1 -1
  222. package/dist/docx/ui/index.mjs +784 -436
  223. package/dist/docx/ui/inline-content-schema.d.ts.map +1 -1
  224. package/dist/docx/ui/paragraph-attributes.d.ts +6 -0
  225. package/dist/docx/ui/paragraph-attributes.d.ts.map +1 -1
  226. package/dist/docx/ui/ribbon-action-ids.d.ts +1 -1
  227. package/dist/docx/ui/ribbon-action-ids.d.ts.map +1 -1
  228. package/dist/docx/ui/ribbon-legacy-labels.d.ts +1 -1
  229. package/dist/docx/ui/ribbon-legacy-labels.d.ts.map +1 -1
  230. package/dist/docx/ui/run-adapter.d.ts.map +1 -1
  231. package/dist/docx/ui/schema-marks.d.ts +2 -19
  232. package/dist/docx/ui/schema-marks.d.ts.map +1 -1
  233. package/dist/docx/ui/track-run-formatting.d.ts.map +1 -1
  234. package/dist/docx/ui/yjs-document-attributes.d.ts +5 -0
  235. package/dist/docx/ui/yjs-document-attributes.d.ts.map +1 -1
  236. package/dist/docx/write-drawing-wrap.d.ts +22 -0
  237. package/dist/docx/write-drawing-wrap.d.ts.map +1 -0
  238. package/dist/docx/write-drawing.d.ts.map +1 -1
  239. package/dist/docx/write-revisions.d.ts +3 -1
  240. package/dist/docx/write-revisions.d.ts.map +1 -1
  241. package/dist/docx/write-shape.d.ts.map +1 -1
  242. package/dist/docx/write-table-properties.d.ts.map +1 -1
  243. package/dist/docx/write.d.ts.map +1 -1
  244. package/dist/drawingml/html-text-paste.d.ts +28 -0
  245. package/dist/drawingml/html-text-paste.d.ts.map +1 -0
  246. package/dist/drawingml/html-text-style.d.ts +18 -0
  247. package/dist/drawingml/html-text-style.d.ts.map +1 -0
  248. package/dist/drawingml/index.cjs +762 -0
  249. package/dist/drawingml/index.d.ts +1 -0
  250. package/dist/drawingml/index.d.ts.map +1 -1
  251. package/dist/drawingml/index.mjs +760 -1
  252. package/dist/index.cjs +1237 -285
  253. package/dist/index.mjs +1237 -285
  254. package/dist/pptx/automation/index.cjs +561 -180
  255. package/dist/pptx/automation/index.d.ts +4 -4
  256. package/dist/pptx/automation/index.mjs +6 -5
  257. package/dist/pptx/chunks/{index-BCy58n13.d.ts → index-8ZfPndYR.d.ts} +2 -2
  258. package/dist/pptx/chunks/{index-BCy58n13.d.ts.map → index-8ZfPndYR.d.ts.map} +1 -1
  259. package/dist/pptx/chunks/{index-OwiX5IVw.d.ts → index-DVhD9Kd5.d.ts} +4 -4
  260. package/dist/pptx/chunks/{index-OwiX5IVw.d.ts.map → index-DVhD9Kd5.d.ts.map} +1 -1
  261. package/dist/pptx/chunks/{index-oQHWAO7M.d.ts → index-DsUnUj-V.d.ts} +5 -5
  262. package/dist/pptx/chunks/{index-oQHWAO7M.d.ts.map → index-DsUnUj-V.d.ts.map} +1 -1
  263. package/dist/pptx/chunks/{index-AZN38e6S.d.ts → index-xB7MDLI7.d.ts} +4 -4
  264. package/dist/pptx/chunks/{index-AZN38e6S.d.ts.map → index-xB7MDLI7.d.ts.map} +1 -1
  265. package/dist/pptx/chunks/{presentation-DOaYIW-l.d.ts → presentation-BvnVkFPJ.d.ts} +26 -2
  266. package/dist/pptx/chunks/{presentation-DOaYIW-l.d.ts.map → presentation-BvnVkFPJ.d.ts.map} +1 -1
  267. package/dist/pptx/chunks/{text-operations-CYSXno9L.d.ts → text-operations-D7TCPhlv.d.ts} +2 -2
  268. package/dist/pptx/chunks/{text-operations-CYSXno9L.d.ts.map → text-operations-D7TCPhlv.d.ts.map} +1 -1
  269. package/dist/pptx/cli/index.cjs +504 -124
  270. package/dist/pptx/cli/index.d.ts +1 -1
  271. package/dist/pptx/cli/index.mjs +4 -4
  272. package/dist/pptx/converter/index.d.ts +1 -1
  273. package/dist/pptx/converter/index.mjs +2 -2
  274. package/dist/pptx/editor/render/custom-show-operations.cjs +2 -2
  275. package/dist/pptx/editor/render/custom-show-operations.mjs +1 -1
  276. package/dist/pptx/editor/render/find-replace.cjs +16 -15
  277. package/dist/pptx/editor/render/find-replace.d.ts +2 -2
  278. package/dist/pptx/editor/render/find-replace.mjs +3 -2
  279. package/dist/pptx/editor/render/font-family-update.d.ts +2 -2
  280. package/dist/pptx/editor/render/paragraph-geometry-overrides.d.ts +2 -2
  281. package/dist/pptx/editor/render/segments-text-edit.cjs +159 -0
  282. package/dist/pptx/editor/render/segments-text-edit.d.ts +26 -0
  283. package/dist/pptx/editor/render/segments-text-edit.d.ts.map +1 -0
  284. package/dist/pptx/editor/render/segments-text-edit.mjs +156 -0
  285. package/dist/pptx/editor/render/slide-operations.cjs +12 -9
  286. package/dist/pptx/editor/render/slide-operations.mjs +6 -3
  287. package/dist/pptx/editor/render/table-cell-edit.cjs +5 -5
  288. package/dist/pptx/editor/render/table-cell-edit.d.ts.map +1 -1
  289. package/dist/pptx/editor/render/table-cell-edit.mjs +1 -1
  290. package/dist/pptx/editor/render/table-cell-merge.cjs +3 -3
  291. package/dist/pptx/editor/render/table-cell-merge.mjs +1 -1
  292. package/dist/pptx/editor/render/table-cell-rich-text.cjs +41 -0
  293. package/dist/pptx/editor/render/table-cell-rich-text.d.ts +50 -0
  294. package/dist/pptx/editor/render/table-cell-rich-text.d.ts.map +1 -0
  295. package/dist/pptx/editor/render/table-cell-rich-text.mjs +8 -0
  296. package/dist/pptx/editor/render/table-cell-source.cjs +23 -0
  297. package/dist/pptx/editor/render/table-cell-source.d.ts +31 -0
  298. package/dist/pptx/editor/render/table-cell-source.d.ts.map +1 -0
  299. package/dist/pptx/editor/render/table-cell-source.mjs +6 -0
  300. package/dist/pptx/editor/render/table-cells-text-style.cjs +116 -0
  301. package/dist/pptx/editor/render/table-cells-text-style.d.ts +37 -0
  302. package/dist/pptx/editor/render/table-cells-text-style.d.ts.map +1 -0
  303. package/dist/pptx/editor/render/table-cells-text-style.mjs +113 -0
  304. package/dist/pptx/editor/render/table-data-grid-ops.cjs +40 -94
  305. package/dist/pptx/editor/render/table-data-grid-ops.mjs +3 -88
  306. package/dist/pptx/editor/render/table-grid-fill.cjs +30 -0
  307. package/dist/pptx/editor/render/table-grid-fill.d.ts +34 -0
  308. package/dist/pptx/editor/render/table-grid-fill.d.ts.map +1 -0
  309. package/dist/pptx/editor/render/table-grid-fill.mjs +28 -0
  310. package/dist/pptx/editor/render/table-layout.cjs +6 -6
  311. package/dist/pptx/editor/render/table-layout.d.ts +2 -2
  312. package/dist/pptx/editor/render/table-layout.d.ts.map +1 -1
  313. package/dist/pptx/editor/render/table-layout.mjs +1 -1
  314. package/dist/pptx/editor/render/table-merge.cjs +5 -5
  315. package/dist/pptx/editor/render/table-merge.mjs +1 -1
  316. package/dist/pptx/editor/render/text-content-style.d.ts +2 -2
  317. package/dist/pptx/editor/render/text-runs-style-patch.d.ts +2 -2
  318. package/dist/pptx/editor/render/text-style-scope.d.ts +2 -2
  319. package/dist/pptx/editor/render/update-text-segment-style.d.ts +2 -2
  320. package/dist/pptx/index.cjs +519 -201
  321. package/dist/pptx/index.d.ts +7 -7
  322. package/dist/pptx/index.mjs +5 -5
  323. package/dist/pptx/node/index.d.ts +1 -1
  324. package/dist/pptx/smartart-layouts/index.d.ts +2 -2
  325. package/dist/teams/index.cjs +35 -25
  326. package/dist/teams/index.mjs +35 -25
  327. package/dist/text/complex-breaks.d.ts +24 -0
  328. package/dist/text/complex-breaks.d.ts.map +1 -0
  329. package/dist/text/east-asian.d.ts +32 -0
  330. package/dist/text/east-asian.d.ts.map +1 -0
  331. package/dist/text/html-tokens.d.ts +45 -0
  332. package/dist/text/html-tokens.d.ts.map +1 -0
  333. package/dist/text/index.cjs +567 -96
  334. package/dist/text/index.d.ts +6 -0
  335. package/dist/text/index.d.ts.map +1 -1
  336. package/dist/text/index.mjs +544 -97
  337. package/dist/text/kinsoku.d.ts +55 -0
  338. package/dist/text/kinsoku.d.ts.map +1 -0
  339. package/dist/text/truetype/embedding.d.ts +42 -0
  340. package/dist/text/truetype/embedding.d.ts.map +1 -0
  341. package/dist/text/truetype/glyphless.d.ts +5 -0
  342. package/dist/text/truetype/glyphless.d.ts.map +1 -0
  343. package/dist/text/truetype/sfnt-write.d.ts +10 -0
  344. package/dist/text/truetype/sfnt-write.d.ts.map +1 -0
  345. package/dist/text/truetype/subset.d.ts.map +1 -1
  346. package/dist/text/windows-1252.d.ts +10 -0
  347. package/dist/text/windows-1252.d.ts.map +1 -0
  348. package/dist/xlsx/collab/index.cjs +10 -6
  349. package/dist/xlsx/collab/index.mjs +10 -6
  350. package/dist/xlsx/edit/clipboard-html-parse.d.ts +1 -0
  351. package/dist/xlsx/edit/clipboard-html-parse.d.ts.map +1 -1
  352. package/dist/xlsx/formula/functions/text-convert.d.ts.map +1 -1
  353. package/dist/xlsx/index.cjs +96 -51
  354. package/dist/xlsx/index.mjs +96 -51
  355. package/dist/xlsx/load/index.cjs +10 -6
  356. package/dist/xlsx/load/index.mjs +10 -6
  357. package/dist/xlsx/ui/index.cjs +97 -52
  358. package/dist/xlsx/ui/index.mjs +97 -52
  359. package/package.json +1 -1
  360. package/dist/PptxHandler-72NTA5ZY.cjs +0 -14
  361. package/dist/PptxHandler-O4IJ3TKZ.mjs +0 -5
  362. package/dist/PresentationBuilder-ORM22QGC.mjs +0 -5
  363. package/dist/PresentationBuilder-T2ETYT3L.cjs +0 -22
  364. package/dist/chunk-X4RL5AZ7.cjs +0 -120
  365. package/dist/{chunk-PRGXRAAU.mjs → chunk-4Y76EAKK.mjs} +131 -131
  366. package/dist/{chunk-EN3KSEW5.cjs → chunk-MMULWQOM.cjs} +131 -131
package/dist/index.mjs CHANGED
@@ -1802,10 +1802,10 @@ function squarify(nodes, box) {
1802
1802
  const result = [];
1803
1803
  let rect3 = { ...box };
1804
1804
  let remaining = items;
1805
- for (let first2 = remaining[0]; first2 !== void 0; first2 = remaining[0]) {
1805
+ for (let first3 = remaining[0]; first3 !== void 0; first3 = remaining[0]) {
1806
1806
  const side = Math.min(rect3.w, rect3.h);
1807
- let row2 = [first2];
1808
- let rowAreas = [first2.area];
1807
+ let row2 = [first3];
1808
+ let rowAreas = [first3.area];
1809
1809
  let worst = worstAspectRatio(rowAreas, side);
1810
1810
  let cursor = 1;
1811
1811
  for (let next = remaining[cursor]; next !== void 0; next = remaining[cursor]) {
@@ -5336,10 +5336,10 @@ function lerpStops(a2, b, t) {
5336
5336
  };
5337
5337
  }
5338
5338
  function gradientColorAt(stops, position) {
5339
- const first2 = stops[0];
5339
+ const first3 = stops[0];
5340
5340
  const last = stops[stops.length - 1];
5341
- if (position <= first2.position) {
5342
- return { color: first2.color, opacity: first2.opacity ?? 1 };
5341
+ if (position <= first3.position) {
5342
+ return { color: first3.color, opacity: first3.opacity ?? 1 };
5343
5343
  }
5344
5344
  if (position >= last.position) {
5345
5345
  return { color: last.color, opacity: last.opacity ?? 1 };
@@ -5451,8 +5451,8 @@ function buildRectPathGradientExactSvg(stops, focalPoint, fillToRect) {
5451
5451
  const pairs = [0, 2, 4, 6].map((i2) => `${points2[i2]},${points2[i2 + 1]}`).join(" ");
5452
5452
  return `<polygon points="${pairs}" fill="url(#${side.id})"/>`;
5453
5453
  }).join("");
5454
- const first2 = sorted[0];
5455
- const plateau = right - left > 1e-3 && bottom - top > 1e-3 ? `<rect x="${n3(left)}" y="${n3(top)}" width="${n3(right - left)}" height="${n3(bottom - top)}" fill="${first2.color}"${alpha(first2.opacity, "fill-opacity")}/>` : "";
5454
+ const first3 = sorted[0];
5455
+ const plateau = right - left > 1e-3 && bottom - top > 1e-3 ? `<rect x="${n3(left)}" y="${n3(top)}" width="${n3(right - left)}" height="${n3(bottom - top)}" fill="${first3.color}"${alpha(first3.opacity, "fill-opacity")}/>` : "";
5456
5456
  return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none" shape-rendering="crispEdges"><defs>${defs}</defs>${polygons}${plateau}</svg>`;
5457
5457
  }
5458
5458
  function buildRectPathGradientImage(stops, focalPoint, fillToRect) {
@@ -8427,13 +8427,13 @@ function distributeRunsText(oldTexts, newText) {
8427
8427
  return result;
8428
8428
  }
8429
8429
  function realignOrCollapseRuns(runs, text3) {
8430
- const first2 = runs[0];
8431
- if (!first2) return [];
8430
+ const first3 = runs[0];
8431
+ if (!first3) return [];
8432
8432
  const distributed = distributeRunsText(
8433
8433
  runs.map((run2) => run2.text),
8434
8434
  text3
8435
8435
  );
8436
- return distributed ? runs.map((run2, index) => ({ ...run2, text: distributed[index] ?? "" })) : [{ ...first2, text: text3 }];
8436
+ return distributed ? runs.map((run2, index) => ({ ...run2, text: distributed[index] ?? "" })) : [{ ...first3, text: text3 }];
8437
8437
  }
8438
8438
 
8439
8439
  // chart/edit/title-realign.ts
@@ -8485,9 +8485,9 @@ function retextChartTextBody(body, text3) {
8485
8485
  { label: "Chart title" }
8486
8486
  ).documentElement;
8487
8487
  const runs = [...root.getElementsByTagNameNS(NS.a, "r")];
8488
- const first2 = runs[0]?.getElementsByTagNameNS(NS.a, "t")[0];
8489
- if (!first2) return void 0;
8490
- first2.textContent = text3;
8488
+ const first3 = runs[0]?.getElementsByTagNameNS(NS.a, "t")[0];
8489
+ if (!first3) return void 0;
8490
+ first3.textContent = text3;
8491
8491
  for (const run3 of runs.slice(1)) run3.parentNode?.removeChild(run3);
8492
8492
  return chartTextBodyFromXml(innerXml(root));
8493
8493
  }
@@ -9098,8 +9098,8 @@ function seriesWithKeys(space3) {
9098
9098
  }
9099
9099
  function standardChartLayoutSheet(space3, categoryCount) {
9100
9100
  const entries = seriesWithKeys(space3);
9101
- const first2 = entries[0]?.series[entries[0].val]?.formula;
9102
- const sheet = first2 ? parseChartFormulaRange(first2)?.sheetName : void 0;
9101
+ const first3 = entries[0]?.series[entries[0].val]?.formula;
9102
+ const sheet = first3 ? parseChartFormulaRange(first3)?.sheetName : void 0;
9103
9103
  if (!sheet) return void 0;
9104
9104
  const standard = entries.every(({ series: series2, cat, val: val2 }, index) => {
9105
9105
  const expected = standardChartFormulas(sheet, index, categoryCount);
@@ -9154,9 +9154,9 @@ function dimensionWrites(dimension2, resolve) {
9154
9154
  col: horizontal ? range2.end.col : start.col,
9155
9155
  row: horizontal ? start.row : range2.end.row
9156
9156
  };
9157
- const first2 = absolute2(start.col, start.row), last = absolute2(end.col, end.row);
9157
+ const first3 = absolute2(start.col, start.row), last = absolute2(end.col, end.row);
9158
9158
  return {
9159
- formula: `${quoteChartSheetName(range2.sheetName)}!${first2 === last ? first2 : `${first2}:${last}`}`,
9159
+ formula: `${quoteChartSheetName(range2.sheetName)}!${first3 === last ? first3 : `${first3}:${last}`}`,
9160
9160
  isNumeric: dimension2.kind === "numDim",
9161
9161
  values
9162
9162
  };
@@ -9282,10 +9282,10 @@ function chartExDataLayout(space3, sheetName) {
9282
9282
  columns.push([level4.name ?? `Data ${columns.length + 1}`, ...data2]);
9283
9283
  }
9284
9284
  if (!count2) throw new Error("ChartEx source has no data points.");
9285
- const first2 = ref(start, count2).split(":")[0];
9285
+ const first3 = ref(start, count2).split(":")[0];
9286
9286
  const last = ref(columns.length - 1, count2).split(":")[1];
9287
9287
  dimension2.formula = {
9288
- formula: `${first2}:${last}`,
9288
+ formula: `${first3}:${last}`,
9289
9289
  ...dimension2.formula?.direction ? { direction: "col" } : {}
9290
9290
  };
9291
9291
  }
@@ -10520,9 +10520,9 @@ function stockStyle(group2) {
10520
10520
  };
10521
10521
  }
10522
10522
  function extraGroups(chartSpace, firstType) {
10523
- const [first2, ...rest] = chartSpace.plotArea.groups;
10524
- if (!first2 || !["column", "line", "area"].includes(firstType)) return [];
10525
- const primary = valueAxisId(chartSpace, first2.axisIds);
10523
+ const [first3, ...rest] = chartSpace.plotArea.groups;
10524
+ if (!first3 || !["column", "line", "area"].includes(firstType)) return [];
10525
+ const primary = valueAxisId(chartSpace, first3.axisIds);
10526
10526
  const out = [];
10527
10527
  for (const group2 of rest) {
10528
10528
  const stockOverColumns = group2.kind === "stock" && firstType === "column";
@@ -12884,10 +12884,10 @@ function generateIntervalTicks(range2, unit) {
12884
12884
  return [];
12885
12885
  }
12886
12886
  const tolerance = Math.max(1, Math.abs(range2.min), Math.abs(range2.max)) * 1e-12;
12887
- const first2 = Math.ceil((range2.min - tolerance) / unit);
12887
+ const first3 = Math.ceil((range2.min - tolerance) / unit);
12888
12888
  const last = Math.floor((range2.max + tolerance) / unit);
12889
- const count = Math.min(Math.max(last - first2 + 1, 0), 2e3);
12890
- return Array.from({ length: count }, (_, index) => (first2 + index) * unit);
12889
+ const count = Math.min(Math.max(last - first3 + 1, 0), 2e3);
12890
+ return Array.from({ length: count }, (_, index) => (first3 + index) * unit);
12891
12891
  }
12892
12892
  function generateAxisTicks(range2, axis2, defaultIntervals) {
12893
12893
  if (range2.logScale && range2.logBase) {
@@ -13021,6 +13021,7 @@ var drawingml_exports = {};
13021
13021
  __export(drawingml_exports, {
13022
13022
  ARTISTIC_PRIMARY_ATTRIBUTE: () => ARTISTIC_PRIMARY_ATTRIBUTE,
13023
13023
  BODY_PROPERTIES_ORDER: () => BODY_PROPERTIES_ORDER,
13024
+ DEFAULT_HTML_TEXT_PASTE_LIMITS: () => DEFAULT_HTML_TEXT_PASTE_LIMITS,
13024
13025
  DEFAULT_THEME_COLOR_MAP: () => DEFAULT_THEME_COLOR_MAP,
13025
13026
  DOM_3D_READER: () => DOM_3D_READER,
13026
13027
  OFFICE_GRADIENT_PRESETS: () => OFFICE_GRADIENT_PRESETS,
@@ -13058,6 +13059,7 @@ __export(drawingml_exports, {
13058
13059
  drawingLineXml: () => drawingLineXml,
13059
13060
  drawingParagraphPropertiesXml: () => drawingParagraphPropertiesXml,
13060
13061
  drawingParagraphText: () => drawingParagraphText,
13062
+ drawingParagraphsText: () => drawingParagraphsText,
13061
13063
  drawingPathData: () => drawingPathData,
13062
13064
  drawingRichTextBodyXml: () => drawingRichTextBodyXml,
13063
13065
  drawingRunPropertiesXml: () => drawingRunPropertiesXml,
@@ -13065,6 +13067,7 @@ __export(drawingml_exports, {
13065
13067
  drawingThemeXml: () => drawingThemeXml,
13066
13068
  fillElementOf: () => fillElementOf,
13067
13069
  gradientColorAt: () => gradientColorAt,
13070
+ htmlToDrawingParagraphs: () => htmlToDrawingParagraphs,
13068
13071
  imageContentType: () => imageContentType,
13069
13072
  inspectRasterImage: () => inspectRasterImage,
13070
13073
  integerAttribute: () => integerAttribute,
@@ -15740,6 +15743,776 @@ function capCompensatedDashArray(pattern, strokeWidth, lineCap) {
15740
15743
  return out.map((n3) => Number(n3.toFixed(4))).join(" ");
15741
15744
  }
15742
15745
 
15746
+ // opc/safe-href.ts
15747
+ var SAFE_SCHEMES = /* @__PURE__ */ new Set(["http:", "https:", "mailto:"]);
15748
+ function isSafeHyperlinkHref(href) {
15749
+ const scheme2 = /^([a-z][a-z0-9+.-]*:)/i.exec(href.trim())?.[1];
15750
+ return scheme2 !== void 0 && SAFE_SCHEMES.has(scheme2.toLowerCase());
15751
+ }
15752
+ var OPEN_SCHEMES = /* @__PURE__ */ new Set(["http", "https", "mailto"]);
15753
+ var STORE_SCHEMES = /* @__PURE__ */ new Set([...OPEN_SCHEMES, "ftp", "file"]);
15754
+ var SCRIPT_SCHEMES = /* @__PURE__ */ new Set([
15755
+ "javascript",
15756
+ "vbscript",
15757
+ "livescript",
15758
+ "jscript",
15759
+ "mocha",
15760
+ "data",
15761
+ "mhtml",
15762
+ "ms-its",
15763
+ "mk",
15764
+ "x-javascript",
15765
+ "blob"
15766
+ ]);
15767
+ var IGNORABLE = new RegExp(
15768
+ "[\\u0000-\\u0020\\u007f\\u00ad\\u200b-\\u200f\\u202a-\\u202e\\u2060-\\u2064\\ufeff]",
15769
+ "gu"
15770
+ );
15771
+ var CONTROL = new RegExp("[\\u0000-\\u001f\\u007f]", "u");
15772
+ var SCHEME = /^([a-z][a-z0-9+.-]*):/;
15773
+ var STORE_ONLY = { store: true, open: false, reason: "not-openable" };
15774
+ var reject = (reason) => ({
15775
+ store: false,
15776
+ open: false,
15777
+ reason
15778
+ });
15779
+ function hyperlinkPolicy(href, options2 = {}) {
15780
+ if (typeof href !== "string") return reject("empty");
15781
+ const trimmed = href.trim();
15782
+ const normalized = trimmed.replace(IGNORABLE, "").toLowerCase();
15783
+ if (normalized.length === 0) return reject("empty");
15784
+ const scheme2 = SCHEME.exec(normalized)?.[1];
15785
+ if (scheme2 !== void 0 && SCRIPT_SCHEMES.has(scheme2)) return reject("script-scheme");
15786
+ if (scheme2 !== void 0 && !trimmed.toLowerCase().startsWith(`${scheme2}:`))
15787
+ return reject("obfuscated-scheme");
15788
+ if (CONTROL.test(trimmed)) return reject("control-characters");
15789
+ if (scheme2 === void 0) return options2.openRelative ? { store: true, open: true } : STORE_ONLY;
15790
+ if (scheme2.length === 1) return STORE_ONLY;
15791
+ if (OPEN_SCHEMES.has(scheme2)) return { store: true, open: true };
15792
+ if (options2.additionalOpenSchemes?.some((allowed) => allowed.toLowerCase() === scheme2))
15793
+ return { store: true, open: true };
15794
+ if (STORE_SCHEMES.has(scheme2)) return STORE_ONLY;
15795
+ return reject("unsupported-scheme");
15796
+ }
15797
+ function isStorableHyperlinkHref(href, options2) {
15798
+ return hyperlinkPolicy(href, options2).store;
15799
+ }
15800
+ function isOpenableHyperlinkHref(href, options2) {
15801
+ return hyperlinkPolicy(href, options2).open;
15802
+ }
15803
+
15804
+ // text/html-tokens.ts
15805
+ var ENTITIES2 = {
15806
+ amp: "&",
15807
+ lt: "<",
15808
+ gt: ">",
15809
+ quot: '"',
15810
+ apos: "'",
15811
+ nbsp: "\xA0",
15812
+ ensp: "\u2002",
15813
+ emsp: "\u2003",
15814
+ thinsp: "\u2009",
15815
+ ndash: "\u2013",
15816
+ mdash: "\u2014",
15817
+ lsquo: "\u2018",
15818
+ rsquo: "\u2019",
15819
+ ldquo: "\u201C",
15820
+ rdquo: "\u201D",
15821
+ bull: "\u2022",
15822
+ hellip: "\u2026",
15823
+ copy: "\xA9",
15824
+ reg: "\xAE",
15825
+ trade: "\u2122",
15826
+ euro: "\u20AC"
15827
+ };
15828
+ function codePoint(value) {
15829
+ if (!Number.isFinite(value) || value <= 0 || value > 1114111) return "\uFFFD";
15830
+ if (value >= 55296 && value <= 57343) return "\uFFFD";
15831
+ return String.fromCodePoint(value);
15832
+ }
15833
+ function decodeHtmlEntities(text3) {
15834
+ return text3.replace(/&(#x[0-9a-f]{1,8}|#\d{1,10}|[a-z]{1,10});/gi, (whole, name2) => {
15835
+ if (name2[1] === "x" || name2[1] === "X") return codePoint(parseInt(name2.slice(2), 16));
15836
+ if (name2.startsWith("#")) return codePoint(Number(name2.slice(1)));
15837
+ return ENTITIES2[name2.toLowerCase()] ?? whole;
15838
+ });
15839
+ }
15840
+ function parseHtmlAttributes(text3) {
15841
+ const attrs2 = /* @__PURE__ */ new Map();
15842
+ for (const m of text3.matchAll(
15843
+ /([\w:-]{1,64})\s{0,16}=\s{0,16}(?:"([^"]*)"|'([^']*)'|([^\s>]+))/g
15844
+ ))
15845
+ attrs2.set((m[1] ?? "").toLowerCase(), decodeHtmlEntities(m[2] ?? m[3] ?? m[4] ?? ""));
15846
+ return attrs2;
15847
+ }
15848
+ function parseCssDeclarations(text3) {
15849
+ const out = /* @__PURE__ */ new Map();
15850
+ for (const decl of text3.split(";")) {
15851
+ const colon = decl.indexOf(":");
15852
+ if (colon < 0) continue;
15853
+ out.set(
15854
+ decl.slice(0, colon).trim().toLowerCase(),
15855
+ decl.slice(colon + 1).replace(/!important/gi, "").trim()
15856
+ );
15857
+ }
15858
+ return out;
15859
+ }
15860
+ var NAMED_COLORS2 = {
15861
+ black: "000000",
15862
+ white: "FFFFFF",
15863
+ red: "FF0000",
15864
+ green: "008000",
15865
+ lime: "00FF00",
15866
+ blue: "0000FF",
15867
+ yellow: "FFFF00",
15868
+ orange: "FFA500",
15869
+ purple: "800080",
15870
+ gray: "808080",
15871
+ grey: "808080",
15872
+ silver: "C0C0C0",
15873
+ navy: "000080",
15874
+ maroon: "800000",
15875
+ teal: "008080",
15876
+ olive: "808000",
15877
+ aqua: "00FFFF",
15878
+ cyan: "00FFFF",
15879
+ fuchsia: "FF00FF",
15880
+ magenta: "FF00FF",
15881
+ darkblue: "00008B",
15882
+ darkred: "8B0000",
15883
+ darkgreen: "006400",
15884
+ darkcyan: "008B8B",
15885
+ darkmagenta: "8B008B",
15886
+ darkgray: "A9A9A9",
15887
+ darkgrey: "A9A9A9",
15888
+ lightgray: "D3D3D3",
15889
+ lightgrey: "D3D3D3",
15890
+ darkyellow: "808000"
15891
+ };
15892
+ function parseCssColorHex(text3) {
15893
+ const value = text3.trim().toLowerCase();
15894
+ const hex = /^#([0-9a-f]{3}|[0-9a-f]{6})$/.exec(value)?.[1];
15895
+ if (hex) return (hex.length === 3 ? [...hex].map((ch) => ch + ch).join("") : hex).toUpperCase();
15896
+ const rgb = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*([\d.]+))?/.exec(value);
15897
+ if (rgb) {
15898
+ if (rgb[4] !== void 0 && Number(rgb[4]) === 0) return void 0;
15899
+ return rgb.slice(1, 4).map((n3) => Math.min(255, Number(n3)).toString(16).padStart(2, "0")).join("").toUpperCase();
15900
+ }
15901
+ return NAMED_COLORS2[value];
15902
+ }
15903
+ var MAX_TAG_LENGTH = 8192;
15904
+ var RAW_TEXT = /* @__PURE__ */ new Set([
15905
+ "script",
15906
+ "style",
15907
+ "textarea",
15908
+ "title",
15909
+ "xmp",
15910
+ "noscript",
15911
+ "template",
15912
+ "head",
15913
+ "xml",
15914
+ "svg",
15915
+ "math",
15916
+ "iframe",
15917
+ "object",
15918
+ "canvas",
15919
+ "select"
15920
+ ]);
15921
+ function htmlClipboardFragment(html) {
15922
+ const start = html.indexOf("<!--StartFragment-->");
15923
+ const end = html.indexOf("<!--EndFragment-->", start < 0 ? 0 : start);
15924
+ if (start >= 0 && end > start) return html.slice(start + "<!--StartFragment-->".length, end);
15925
+ const first3 = html.indexOf("<");
15926
+ return first3 > 0 && /^Version:\d/.test(html) ? html.slice(first3) : html;
15927
+ }
15928
+ function tagEnd(html, from) {
15929
+ let quote = "";
15930
+ const limit = Math.min(html.length, from + MAX_TAG_LENGTH);
15931
+ for (let i2 = from; i2 < limit; i2++) {
15932
+ const ch = html[i2];
15933
+ if (quote) {
15934
+ if (ch === quote) quote = "";
15935
+ } else if (ch === '"' || ch === "'") quote = ch;
15936
+ else if (ch === ">") return i2;
15937
+ else if (ch === "<") return -1;
15938
+ }
15939
+ return -1;
15940
+ }
15941
+ function tokenizeHtml(html, maxTokens = Number.POSITIVE_INFINITY) {
15942
+ const tokens = [];
15943
+ let text3 = "";
15944
+ const flush = () => {
15945
+ if (text3) tokens.push({ kind: "text", text: decodeHtmlEntities(text3) });
15946
+ text3 = "";
15947
+ };
15948
+ let i2 = 0;
15949
+ while (i2 < html.length) {
15950
+ if (tokens.length >= maxTokens) {
15951
+ text3 += textWithoutTags(html.slice(i2));
15952
+ break;
15953
+ }
15954
+ const lt = html.indexOf("<", i2);
15955
+ if (lt < 0) {
15956
+ text3 += html.slice(i2);
15957
+ break;
15958
+ }
15959
+ text3 += html.slice(i2, lt);
15960
+ i2 = lt;
15961
+ if (html.startsWith("<!--", i2)) {
15962
+ const close = html.indexOf("-->", i2 + 4);
15963
+ i2 = close < 0 ? html.length : close + 3;
15964
+ continue;
15965
+ }
15966
+ if (html.startsWith("<![", i2)) {
15967
+ const close = html.indexOf("]>", i2 + 3);
15968
+ const body = html.slice(i2 + 3, close < 0 ? html.length : close).toLowerCase();
15969
+ flush();
15970
+ if (/^\s*if\b/.test(body))
15971
+ tokens.push({
15972
+ kind: "conditional",
15973
+ open: true,
15974
+ supportLists: body.includes("supportlists")
15975
+ });
15976
+ else if (/^\s*endif\b/.test(body))
15977
+ tokens.push({ kind: "conditional", open: false, supportLists: false });
15978
+ i2 = close < 0 ? html.length : close + 2;
15979
+ continue;
15980
+ }
15981
+ const next = html[i2 + 1] ?? "";
15982
+ if (next === "!" || next === "?") {
15983
+ const close = html.indexOf(">", i2 + 2);
15984
+ i2 = close < 0 ? html.length : close + 1;
15985
+ continue;
15986
+ }
15987
+ const closing = next === "/";
15988
+ const nameMatch = /^[a-zA-Z][\w:-]{0,63}/.exec(html.slice(i2 + (closing ? 2 : 1), i2 + 70));
15989
+ const end = nameMatch ? tagEnd(html, i2 + 1) : -1;
15990
+ if (!nameMatch || end < 0) {
15991
+ text3 += "<";
15992
+ i2 += 1;
15993
+ continue;
15994
+ }
15995
+ const name2 = nameMatch[0].toLowerCase();
15996
+ flush();
15997
+ if (closing) {
15998
+ tokens.push({ kind: "close", name: name2 });
15999
+ i2 = end + 1;
16000
+ continue;
16001
+ }
16002
+ const inner = html.slice(i2 + 1 + nameMatch[0].length, end);
16003
+ const selfClosing = inner.trimEnd().endsWith("/");
16004
+ i2 = end + 1;
16005
+ if (RAW_TEXT.has(name2)) {
16006
+ tokens.push({ kind: "text", text: "" });
16007
+ if (selfClosing) continue;
16008
+ const closer = new RegExp(`</${name2}`, "gi");
16009
+ closer.lastIndex = i2;
16010
+ const found = closer.exec(html);
16011
+ const after = found ? html.indexOf(">", found.index) : -1;
16012
+ i2 = after < 0 ? html.length : after + 1;
16013
+ continue;
16014
+ }
16015
+ tokens.push({ kind: "open", name: name2, attrs: parseHtmlAttributes(inner), selfClosing });
16016
+ }
16017
+ flush();
16018
+ return tokens;
16019
+ }
16020
+ function textWithoutTags(html) {
16021
+ let out = "";
16022
+ let at2 = 0;
16023
+ for (let lt = html.indexOf("<"); lt >= 0; lt = html.indexOf("<", at2)) {
16024
+ const gt = html.indexOf(">", lt + 1);
16025
+ if (gt < 0) break;
16026
+ const inner = html.indexOf("<", lt + 1);
16027
+ if (inner >= 0 && inner < gt) {
16028
+ out += html.slice(at2, inner);
16029
+ at2 = inner;
16030
+ continue;
16031
+ }
16032
+ out += html.slice(at2, lt);
16033
+ at2 = gt + 1;
16034
+ }
16035
+ return out + html.slice(at2);
16036
+ }
16037
+
16038
+ // drawingml/html-text-style.ts
16039
+ var srgb = (value) => ({ kind: "srgb", value, transforms: [] });
16040
+ var GENERIC_FAMILIES = /* @__PURE__ */ new Set([
16041
+ "serif",
16042
+ "sans-serif",
16043
+ "monospace",
16044
+ "cursive",
16045
+ "fantasy",
16046
+ "system-ui",
16047
+ "inherit",
16048
+ "initial",
16049
+ "unset"
16050
+ ]);
16051
+ function cssFirstFontFamily(value) {
16052
+ for (const part of value.split(",")) {
16053
+ const name2 = part.trim().replace(/^["']|["']$/g, "");
16054
+ if (name2 && name2.length <= 64 && !GENERIC_FAMILIES.has(name2.toLowerCase())) return name2;
16055
+ }
16056
+ return void 0;
16057
+ }
16058
+ function cssFontSizePt(value) {
16059
+ const keyword = {
16060
+ "xx-small": 7,
16061
+ "x-small": 7.5,
16062
+ small: 10,
16063
+ medium: 12,
16064
+ large: 13.5,
16065
+ "x-large": 18,
16066
+ "xx-large": 24
16067
+ };
16068
+ const v = value.trim().toLowerCase();
16069
+ if (keyword[v] !== void 0) return keyword[v];
16070
+ const m = /^(\d{1,4}(?:\.\d{1,3})?)(pt|px)$/.exec(v);
16071
+ if (!m) return void 0;
16072
+ const pt2 = Number(m[1]) * (m[2] === "px" ? 0.75 : 1);
16073
+ return pt2 >= 1 && pt2 <= 4e3 ? Math.round(pt2 * 100) / 100 : void 0;
16074
+ }
16075
+ var FONT_SIZE_ATTR = [7.5, 10, 12, 13.5, 18, 24, 36];
16076
+ function tagRunProperties(name2, attrs2) {
16077
+ switch (name2) {
16078
+ case "b":
16079
+ case "strong":
16080
+ return { bold: true };
16081
+ case "i":
16082
+ case "em":
16083
+ case "cite":
16084
+ case "dfn":
16085
+ return { italic: true };
16086
+ case "u":
16087
+ case "ins":
16088
+ return { underline: "sng" };
16089
+ case "s":
16090
+ case "strike":
16091
+ case "del":
16092
+ return { strike: "sngStrike" };
16093
+ case "sup":
16094
+ return { baseline: 0.3 };
16095
+ case "sub":
16096
+ return { baseline: -0.25 };
16097
+ case "mark":
16098
+ return { highlight: srgb("FFFF00") };
16099
+ case "code":
16100
+ case "kbd":
16101
+ case "samp":
16102
+ case "tt":
16103
+ case "pre":
16104
+ return { latin: { typeface: "Courier New" } };
16105
+ case "h1":
16106
+ return { bold: true, sizePt: 24 };
16107
+ case "h2":
16108
+ return { bold: true, sizePt: 18 };
16109
+ case "h3":
16110
+ return { bold: true, sizePt: 14 };
16111
+ case "h4":
16112
+ case "h5":
16113
+ case "h6":
16114
+ return { bold: true };
16115
+ case "font": {
16116
+ const props = {};
16117
+ const face = attrs2.get("face");
16118
+ const family = face ? cssFirstFontFamily(face) : void 0;
16119
+ if (family) props.latin = { typeface: family };
16120
+ const color2 = attrs2.get("color");
16121
+ const hex = color2 ? parseCssColorHex(color2) : void 0;
16122
+ if (hex) props.fill = { kind: "solid", color: srgb(hex) };
16123
+ const size = Number(attrs2.get("size"));
16124
+ const sizePt = Number.isInteger(size) ? FONT_SIZE_ATTR[size - 1] : void 0;
16125
+ if (sizePt !== void 0) props.sizePt = sizePt;
16126
+ return props;
16127
+ }
16128
+ default:
16129
+ return void 0;
16130
+ }
16131
+ }
16132
+ function cssRunProperties(style, inline) {
16133
+ const css = parseCssDeclarations(style);
16134
+ const props = {};
16135
+ const weight = css.get("font-weight");
16136
+ if (weight) props.bold = weight === "bold" || weight === "bolder" || Number(weight) >= 600;
16137
+ const fontStyle = css.get("font-style");
16138
+ if (fontStyle) props.italic = fontStyle === "italic" || fontStyle === "oblique";
16139
+ const decoration = css.get("text-decoration-line") ?? css.get("text-decoration");
16140
+ if (decoration) {
16141
+ if (decoration.includes("underline")) props.underline = "sng";
16142
+ if (decoration.includes("line-through")) props.strike = "sngStrike";
16143
+ if (decoration.includes("none")) {
16144
+ props.underline = "none";
16145
+ props.strike = "noStrike";
16146
+ }
16147
+ }
16148
+ const family = css.get("font-family");
16149
+ const typeface2 = family ? cssFirstFontFamily(family) : void 0;
16150
+ if (typeface2) props.latin = { typeface: typeface2 };
16151
+ const size = css.get("font-size");
16152
+ const sizePt = size ? cssFontSizePt(size) : void 0;
16153
+ if (sizePt !== void 0) props.sizePt = sizePt;
16154
+ const color2 = css.get("color");
16155
+ const hex = color2 ? parseCssColorHex(color2) : void 0;
16156
+ if (hex) props.fill = { kind: "solid", color: srgb(hex) };
16157
+ const shorthand = css.get("background");
16158
+ const highlight = css.get("mso-highlight") ?? (inline ? css.get("background-color") ?? (shorthand ? /^(rgba?\([^)]*\)|#\w+|[a-z]+)/i.exec(shorthand.trim())?.[1] : void 0) : void 0);
16159
+ const highlightHex = highlight ? parseCssColorHex(highlight) : void 0;
16160
+ if (highlightHex) props.highlight = srgb(highlightHex);
16161
+ const vertical = css.get("vertical-align");
16162
+ if (vertical === "super") props.baseline = 0.3;
16163
+ else if (vertical === "sub") props.baseline = -0.25;
16164
+ const caps = css.get("font-variant");
16165
+ if (caps === "small-caps") props.caps = "small";
16166
+ if (css.get("text-transform") === "uppercase") props.caps = "all";
16167
+ return props;
16168
+ }
16169
+ var ALIGN = {
16170
+ left: "l",
16171
+ start: "l",
16172
+ center: "ctr",
16173
+ right: "r",
16174
+ end: "r",
16175
+ justify: "just"
16176
+ };
16177
+ function blockAlignment(name2, attrs2) {
16178
+ if (name2 === "center") return "ctr";
16179
+ const css = parseCssDeclarations(attrs2.get("style") ?? "");
16180
+ return ALIGN[(css.get("text-align") ?? attrs2.get("align") ?? "").trim().toLowerCase()];
16181
+ }
16182
+ function msoListLevel(attrs2) {
16183
+ const css = parseCssDeclarations(attrs2.get("style") ?? "");
16184
+ const list2 = css.get("mso-list");
16185
+ if (!list2 || /^\s*ignore\b/i.test(list2)) return void 0;
16186
+ const level4 = /level(\d{1,2})/i.exec(list2)?.[1];
16187
+ return Math.min(8, Math.max(0, (level4 ? Number(level4) : 1) - 1));
16188
+ }
16189
+ var MARKER_CHARS = /* @__PURE__ */ new Set([
16190
+ "\u2022",
16191
+ "\u25AA",
16192
+ "\u25CF",
16193
+ "\u25CB",
16194
+ "\u25A0",
16195
+ "\u2013",
16196
+ "-",
16197
+ "*",
16198
+ "o"
16199
+ ]);
16200
+ function bulletFromMarker(marker) {
16201
+ const text3 = marker.replace(/\s+/g, "");
16202
+ const numbered = /^(\(?)(\d{1,4}|[a-z]|[A-Z]|[ivxlc]{1,6}|[IVXLC]{1,6})([.)])$/.exec(text3);
16203
+ if (numbered) {
16204
+ const body = numbered[2] ?? "";
16205
+ const suffix = numbered[1] ? "ParenBoth" : numbered[3] === ")" ? "ParenR" : "Period";
16206
+ const kind = /^\d+$/.test(body) ? "arabic" : /^[ivxlc]+$/.test(body) && body !== "c" ? "romanLc" : /^[IVXLC]+$/.test(body) && body !== "C" ? "romanUc" : /^[a-z]$/.test(body) ? "alphaLc" : "alphaUc";
16207
+ const startAt = /^\d+$/.test(body) ? Number(body) : void 0;
16208
+ return { kind: "autoNumber", scheme: `${kind}${suffix}`, ...startAt ? { startAt } : {} };
16209
+ }
16210
+ const char = [...text3][0] ?? "";
16211
+ return { kind: "char", char: MARKER_CHARS.has(char) ? char : "\u2022" };
16212
+ }
16213
+ function listBullet(ordered2, attrs2, level4) {
16214
+ if (!ordered2)
16215
+ return { kind: "char", char: ["\u2022", "\u2013", "\u2022"][level4 % 3] ?? "\u2022" };
16216
+ const type = attrs2.get("type") ?? "1";
16217
+ const scheme2 = { a: "alphaLcPeriod", A: "alphaUcPeriod", i: "romanLcPeriod", I: "romanUcPeriod" }[type] ?? "arabicPeriod";
16218
+ const start = Math.trunc(Number(attrs2.get("start")));
16219
+ return {
16220
+ kind: "autoNumber",
16221
+ scheme: scheme2,
16222
+ ...Number.isFinite(start) && start > 1 && start < 32768 ? { startAt: start } : {}
16223
+ };
16224
+ }
16225
+
16226
+ // drawingml/html-text-paste.ts
16227
+ var DEFAULT_HTML_TEXT_PASTE_LIMITS = {
16228
+ maxInputLength: 2e6,
16229
+ maxTokens: 5e4,
16230
+ maxDepth: 64,
16231
+ maxTextLength: 1e5,
16232
+ maxParagraphs: 2e3
16233
+ };
16234
+ var BLOCKS = /* @__PURE__ */ new Set([
16235
+ "p",
16236
+ "div",
16237
+ "h1",
16238
+ "h2",
16239
+ "h3",
16240
+ "h4",
16241
+ "h5",
16242
+ "h6",
16243
+ "li",
16244
+ "ul",
16245
+ "ol",
16246
+ "dl",
16247
+ "dt",
16248
+ "dd",
16249
+ "blockquote",
16250
+ "pre",
16251
+ "address",
16252
+ "article",
16253
+ "aside",
16254
+ "section",
16255
+ "header",
16256
+ "footer",
16257
+ "nav",
16258
+ "main",
16259
+ "figure",
16260
+ "figcaption",
16261
+ "center",
16262
+ "table",
16263
+ "tbody",
16264
+ "thead",
16265
+ "tfoot",
16266
+ "tr",
16267
+ "caption",
16268
+ "body",
16269
+ "html"
16270
+ ]);
16271
+ var VOID = /* @__PURE__ */ new Set([
16272
+ "br",
16273
+ "img",
16274
+ "hr",
16275
+ "meta",
16276
+ "link",
16277
+ "input",
16278
+ "wbr",
16279
+ "col",
16280
+ "area",
16281
+ "base",
16282
+ "source",
16283
+ "embed",
16284
+ "param",
16285
+ "track"
16286
+ ]);
16287
+ var BULLET_INDENT_EMU = 285750;
16288
+ var LEVEL_STEP_EMU = 457200;
16289
+ var sameProps = (a2, b) => JSON.stringify(a2 ?? {}) === JSON.stringify(b ?? {});
16290
+ function htmlToDrawingParagraphs(html, limits = {}) {
16291
+ const bounds2 = { ...DEFAULT_HTML_TEXT_PASTE_LIMITS, ...limits };
16292
+ let truncated = html.length > bounds2.maxInputLength;
16293
+ const source2 = htmlClipboardFragment(truncated ? html.slice(0, bounds2.maxInputLength) : html);
16294
+ const tokens = tokenizeHtml(source2, bounds2.maxTokens);
16295
+ if (tokens.length >= bounds2.maxTokens) truncated = true;
16296
+ const paragraphs = [];
16297
+ const hyperlinks = {};
16298
+ const stack = [{ name: "#root", run: {}, pre: false, marker: false }];
16299
+ let current = null;
16300
+ let textLength = 0;
16301
+ let marker = null;
16302
+ let conditionalMarker = false;
16303
+ let stopped = false;
16304
+ const top = () => stack[stack.length - 1];
16305
+ const paragraphProperties = () => {
16306
+ const props = {};
16307
+ let listDepth = 0;
16308
+ let item2;
16309
+ let list2;
16310
+ let msoLevel;
16311
+ for (let i2 = stack.length - 1; i2 >= 0; i2--) {
16312
+ const frame2 = stack[i2];
16313
+ if (props.align === void 0 && frame2.align) props.align = frame2.align;
16314
+ if (frame2.name === "li" && !item2) item2 = frame2;
16315
+ if (frame2.name === "ul" || frame2.name === "ol") {
16316
+ listDepth++;
16317
+ list2 ??= frame2;
16318
+ }
16319
+ if (msoLevel === void 0 && frame2.msoLevel !== void 0) msoLevel = frame2.msoLevel;
16320
+ }
16321
+ if (item2 && list2) {
16322
+ const level4 = Math.min(8, listDepth - 1);
16323
+ props.bullet = listBullet(list2.ordered ?? false, list2.attrs ?? /* @__PURE__ */ new Map(), level4);
16324
+ if (level4 > 0) props.level = level4;
16325
+ props.marginLeftEmu = BULLET_INDENT_EMU + level4 * LEVEL_STEP_EMU;
16326
+ props.indentEmu = -BULLET_INDENT_EMU;
16327
+ } else if (msoLevel !== void 0) {
16328
+ if (msoLevel > 0) props.level = msoLevel;
16329
+ props.marginLeftEmu = BULLET_INDENT_EMU + msoLevel * LEVEL_STEP_EMU;
16330
+ props.indentEmu = -BULLET_INDENT_EMU;
16331
+ props.bullet = { kind: "char", char: "\u2022" };
16332
+ }
16333
+ return Object.keys(props).length ? props : void 0;
16334
+ };
16335
+ const finish2 = () => {
16336
+ current = null;
16337
+ };
16338
+ const ensure2 = () => {
16339
+ if (current) return current;
16340
+ if (paragraphs.length >= bounds2.maxParagraphs) {
16341
+ truncated = stopped = true;
16342
+ return null;
16343
+ }
16344
+ const properties = paragraphProperties();
16345
+ current = { items: [], ...properties ? { properties } : {} };
16346
+ paragraphs.push(current);
16347
+ return current;
16348
+ };
16349
+ const lastChar = (paragraph2) => {
16350
+ const last = paragraph2.items[paragraph2.items.length - 1];
16351
+ if (!last) return "";
16352
+ return last.kind === "run" ? last.text.slice(-1) : "\n";
16353
+ };
16354
+ const addText = (raw2, verbatim = false) => {
16355
+ const frame2 = top();
16356
+ if (marker !== null || frame2.marker) {
16357
+ if (marker !== null) marker += raw2;
16358
+ return;
16359
+ }
16360
+ let text3 = frame2.pre || verbatim ? raw2.replace(/\r\n?/g, "\n") : raw2.replace(/[ \t\n\r\f]+/g, " ");
16361
+ if (!frame2.pre && !current && text3.trim() === "") return;
16362
+ const paragraph2 = ensure2();
16363
+ if (!paragraph2) return;
16364
+ if (!frame2.pre && text3.startsWith(" ") && /^$|[ \n]/.test(lastChar(paragraph2)))
16365
+ text3 = text3.slice(1);
16366
+ text3 = text3.replace(/\u00a0/g, " ");
16367
+ if (textLength + text3.length > bounds2.maxTextLength) {
16368
+ text3 = text3.slice(0, Math.max(0, bounds2.maxTextLength - textLength));
16369
+ truncated = stopped = true;
16370
+ }
16371
+ textLength += text3.length;
16372
+ const lines2 = text3.split("\n");
16373
+ for (const [index, line4] of lines2.entries()) {
16374
+ if (index > 0) paragraph2.items.push({ kind: "break", properties: { ...frame2.run } });
16375
+ if (!line4) continue;
16376
+ const last = paragraph2.items[paragraph2.items.length - 1];
16377
+ if (last?.kind === "run" && sameProps(last.properties, frame2.run)) last.text += line4;
16378
+ else
16379
+ paragraph2.items.push({
16380
+ kind: "run",
16381
+ text: line4,
16382
+ ...Object.keys(frame2.run).length ? { properties: { ...frame2.run } } : {}
16383
+ });
16384
+ }
16385
+ };
16386
+ const close = (name2) => {
16387
+ for (let i2 = stack.length - 1; i2 > 0; i2--) {
16388
+ if (stack[i2].name !== name2) continue;
16389
+ while (stack.length > i2) {
16390
+ const frame2 = stack.pop();
16391
+ if (BLOCKS.has(frame2.name)) finish2();
16392
+ }
16393
+ return true;
16394
+ }
16395
+ return false;
16396
+ };
16397
+ for (const token2 of tokens) {
16398
+ if (stopped) break;
16399
+ if (token2.kind === "text") {
16400
+ if (token2.text) addText(token2.text);
16401
+ continue;
16402
+ }
16403
+ if (token2.kind === "conditional") {
16404
+ if (token2.open && token2.supportLists) {
16405
+ conditionalMarker = true;
16406
+ marker = "";
16407
+ } else if (!token2.open && conditionalMarker) {
16408
+ conditionalMarker = false;
16409
+ const typed = marker ?? "";
16410
+ marker = null;
16411
+ applyMarker(typed);
16412
+ }
16413
+ continue;
16414
+ }
16415
+ if (token2.kind === "close") {
16416
+ const frame3 = top();
16417
+ if (frame3.marker && frame3.name === token2.name) {
16418
+ stack.pop();
16419
+ const typed = marker ?? "";
16420
+ marker = null;
16421
+ applyMarker(typed);
16422
+ continue;
16423
+ }
16424
+ close(token2.name);
16425
+ continue;
16426
+ }
16427
+ const { name: name2, attrs: attrs2 } = token2;
16428
+ if (name2 === "br") {
16429
+ const paragraph2 = ensure2();
16430
+ paragraph2?.items.push({ kind: "break", properties: { ...top().run } });
16431
+ continue;
16432
+ }
16433
+ if (name2 === "hr") {
16434
+ finish2();
16435
+ continue;
16436
+ }
16437
+ if ((name2 === "td" || name2 === "th") && current) {
16438
+ addText(" ", true);
16439
+ }
16440
+ if (VOID.has(name2) || token2.selfClosing) continue;
16441
+ if (name2 === "p" || name2 === "li" || /^h[1-6]$/.test(name2) || name2 === "div") {
16442
+ if (top().name === "p") close("p");
16443
+ }
16444
+ if (name2 === "li") {
16445
+ for (let i2 = stack.length - 1; i2 > 0; i2--) {
16446
+ const open = stack[i2].name;
16447
+ if (open === "ul" || open === "ol") break;
16448
+ if (open === "li") {
16449
+ close("li");
16450
+ break;
16451
+ }
16452
+ }
16453
+ }
16454
+ if (BLOCKS.has(name2)) finish2();
16455
+ if (stack.length > bounds2.maxDepth) {
16456
+ truncated = true;
16457
+ continue;
16458
+ }
16459
+ const parent = top();
16460
+ const block = BLOCKS.has(name2);
16461
+ const run2 = {
16462
+ ...parent.run,
16463
+ ...tagRunProperties(name2, attrs2),
16464
+ ...cssRunProperties(attrs2.get("style") ?? "", !block)
16465
+ };
16466
+ const href = name2 === "a" ? attrs2.get("href")?.trim() : void 0;
16467
+ if (href && !href.startsWith("#") && hyperlinkPolicy(href).store) {
16468
+ const relId = `htmlLink${Object.keys(hyperlinks).length + 1}`;
16469
+ hyperlinks[relId] = href;
16470
+ const tooltip = attrs2.get("title")?.slice(0, 256);
16471
+ run2.hyperlinkClick = { relId, ...tooltip ? { tooltip } : {} };
16472
+ }
16473
+ const isMarker = /mso-list\s*:\s*ignore/i.test(attrs2.get("style") ?? "");
16474
+ const frame2 = {
16475
+ name: name2,
16476
+ run: run2,
16477
+ pre: parent.pre || name2 === "pre",
16478
+ marker: isMarker
16479
+ };
16480
+ if (block) {
16481
+ const align = blockAlignment(name2, attrs2);
16482
+ if (align) frame2.align = align;
16483
+ const level4 = name2 === "p" || name2 === "div" ? msoListLevel(attrs2) : void 0;
16484
+ if (level4 !== void 0) frame2.msoLevel = level4;
16485
+ }
16486
+ if (name2 === "ul" || name2 === "ol") {
16487
+ frame2.ordered = name2 === "ol";
16488
+ frame2.attrs = attrs2;
16489
+ }
16490
+ stack.push(frame2);
16491
+ if (isMarker && marker === null) marker = "";
16492
+ }
16493
+ function applyMarker(typed) {
16494
+ const paragraph2 = ensure2();
16495
+ if (!paragraph2 || !typed.trim()) return;
16496
+ paragraph2.properties = { ...paragraph2.properties, bullet: bulletFromMarker(typed) };
16497
+ }
16498
+ for (const paragraph2 of paragraphs) {
16499
+ const last = paragraph2.items[paragraph2.items.length - 1];
16500
+ if (last?.kind === "run") {
16501
+ last.text = last.text.replace(/ +$/, "");
16502
+ if (!last.text) paragraph2.items.pop();
16503
+ }
16504
+ }
16505
+ const empty = (p2) => p2 !== void 0 && p2.items.length === 0 && !p2.properties?.bullet;
16506
+ while (empty(paragraphs[paragraphs.length - 1])) paragraphs.pop();
16507
+ while (empty(paragraphs[0])) paragraphs.shift();
16508
+ return { paragraphs, hyperlinks, truncated };
16509
+ }
16510
+ function drawingParagraphsText(paragraphs) {
16511
+ return paragraphs.map(
16512
+ (p2) => p2.items.map((item2) => item2.kind === "break" ? "\n" : "text" in item2 ? item2.text : "").join("")
16513
+ ).join("\n");
16514
+ }
16515
+
15743
16516
  // chart/region-map/value-color-positions.ts
15744
16517
  function schemaPosition(node, end) {
15745
16518
  for (const kind of ["number", "percent"]) {
@@ -15968,10 +16741,10 @@ function liveLevels(ref, evaluateRef) {
15968
16741
  return levels;
15969
16742
  }
15970
16743
  function hierarchyView(chart, model, evaluateRef) {
15971
- const first2 = model.series[0];
16744
+ const first3 = model.series[0];
15972
16745
  const live = liveLevels(chart.series[0]?.categoriesRef, evaluateRef);
15973
16746
  if (live?.[0]) model.categories = live[0];
15974
- const count = Math.max(first2?.values.length ?? 0, model.categories.length);
16747
+ const count = Math.max(first3?.values.length ?? 0, model.categories.length);
15975
16748
  const supplied = live ?? chart.hierarchy?.levels ?? [];
15976
16749
  const levels = supplied.length > 1 ? normalizeLevels(supplied, count) : [];
15977
16750
  model.hierarchy = {
@@ -16201,16 +16974,16 @@ function waterfallView(chart, model, ctx) {
16201
16974
  model.categories = steps.map((_, i2) => labels2[i2] ?? String(i2 + 1));
16202
16975
  }
16203
16976
  function histogramView(chart, model) {
16204
- const first2 = model.series[0];
16205
- if (!first2) return;
16206
- const raw2 = first2.values.map((v) => v ?? Number.NaN);
16977
+ const first3 = model.series[0];
16978
+ if (!first3) return;
16979
+ const raw2 = first3.values.map((v) => v ?? Number.NaN);
16207
16980
  const options2 = chart.histogram ?? {};
16208
16981
  const bins = options2.aggregateByCategory ? aggregateByCategory(
16209
- first2.values.map((v) => v ?? 0),
16982
+ first3.values.map((v) => v ?? 0),
16210
16983
  model.categories
16211
16984
  ) : computeHistogramBins(raw2, options2, formatAxisValue);
16212
16985
  model.categories = bins.map((bin) => bin.label);
16213
- first2.values = bins.map((bin) => bin.value);
16986
+ first3.values = bins.map((bin) => bin.value);
16214
16987
  model.barGapWidth = 0;
16215
16988
  model.barOverlap = 0;
16216
16989
  }
@@ -17244,12 +18017,12 @@ function resolveValueColorStops(valueColors, valueColorPositions, minVal, maxVal
17244
18017
  function buildValueColorScale(stops) {
17245
18018
  const sorted = [...stops].sort((a2, b) => a2.position - b.position);
17246
18019
  return (t) => {
17247
- const clamped = Math.max(0, Math.min(1, t)), first2 = sorted[0];
17248
- if (!first2) {
18020
+ const clamped = Math.max(0, Math.min(1, t)), first3 = sorted[0];
18021
+ if (!first3) {
17249
18022
  return "#94a3b8";
17250
18023
  }
17251
18024
  if (sorted.length === 1) {
17252
- return first2.color;
18025
+ return first3.color;
17253
18026
  }
17254
18027
  for (let i2 = 0; i2 < sorted.length - 1; i2++) {
17255
18028
  const a2 = sorted[i2], b = sorted[i2 + 1];
@@ -17261,8 +18034,8 @@ function buildValueColorScale(stops) {
17261
18034
  );
17262
18035
  }
17263
18036
  }
17264
- const last = sorted[sorted.length - 1] ?? first2;
17265
- return clamped <= first2.position ? first2.color : last.color;
18037
+ const last = sorted[sorted.length - 1] ?? first3;
18038
+ return clamped <= first3.position ? first3.color : last.color;
17266
18039
  };
17267
18040
  }
17268
18041
 
@@ -18295,15 +19068,15 @@ function sliceLabels(model, marks, out) {
18295
19068
  outside: Math.hypot(x - mark.cx, y - mark.cy) > mark.outer
18296
19069
  });
18297
19070
  }
18298
- const first2 = marks[0];
18299
- if (!first2) return;
19071
+ const first3 = marks[0];
19072
+ if (!first3) return;
18300
19073
  const nudges = nudgeOutsideLabels(
18301
19074
  items.flatMap(
18302
19075
  (item2, id) => item2.outside && !item2.label.layout ? [{ id, x: item2.x, y: item2.y, w: item2.m.w, h: item2.m.h }] : []
18303
19076
  ),
18304
- { cx: first2.cx, cy: first2.cy, r: first2.outer },
18305
- first2.cy - first2.outer,
18306
- first2.cy + first2.outer
19077
+ { cx: first3.cx, cy: first3.cy, r: first3.outer },
19078
+ first3.cy - first3.outer,
19079
+ first3.cy + first3.outer
18307
19080
  );
18308
19081
  for (const [id, item2] of items.entries()) {
18309
19082
  const { mark, label, m } = item2;
@@ -18451,9 +19224,9 @@ function radarSvg(model, area) {
18451
19224
 
18452
19225
  // chart/render/chart-svg-hierarchy.ts
18453
19226
  var colorAt = (model, index) => {
18454
- const first2 = model.series[0];
18455
- const colors = first2?.pointColors;
18456
- return (colors && colors.length > 0 ? colors[index % colors.length] : void 0) ?? first2?.color ?? "#4472C4";
19227
+ const first3 = model.series[0];
19228
+ const colors = first3?.pointColors;
19229
+ return (colors && colors.length > 0 ? colors[index % colors.length] : void 0) ?? first3?.color ?? "#4472C4";
18457
19230
  };
18458
19231
  var leafValues = (model) => (model.series[0]?.values ?? []).map((v) => v ?? 0);
18459
19232
  function treemapSvg(model, area) {
@@ -18613,17 +19386,17 @@ function chartLegendSvg(model, area, frame2, options2) {
18613
19386
  }
18614
19387
  function legendEntries(model) {
18615
19388
  if (model.type === "pie" || model.type === "doughnut") {
18616
- const first2 = model.series[0];
19389
+ const first3 = model.series[0];
18617
19390
  return model.categories.map((label, i2) => ({
18618
19391
  label,
18619
- color: first2?.pointColors?.[i2] ?? first2?.color ?? "#4472C4"
19392
+ color: first3?.pointColors?.[i2] ?? first3?.color ?? "#4472C4"
18620
19393
  }));
18621
19394
  }
18622
19395
  if ((model.type === "treemap" || model.type === "sunburst") && model.hierarchy) {
18623
- const first2 = model.series[0];
19396
+ const first3 = model.series[0];
18624
19397
  return model.hierarchy.branches.map((label, i2) => ({
18625
19398
  label,
18626
- color: first2?.pointColors?.[i2 % Math.max(1, first2.pointColors.length)] ?? first2?.color ?? "#4472C4"
19399
+ color: first3?.pointColors?.[i2 % Math.max(1, first3.pointColors.length)] ?? first3?.color ?? "#4472C4"
18627
19400
  }));
18628
19401
  }
18629
19402
  if (model.type === "waterfall" && model.waterfall)
@@ -20627,10 +21400,10 @@ function setChartTypedCategories(space3, values) {
20627
21400
  ...source2.levels.map((level4) => chartCacheValues(level4).length)
20628
21401
  ) !== values.length)
20629
21402
  throw new RangeError("Growing a hierarchy requires every category level.");
20630
- const first2 = source2.levels[0];
20631
- if (!first2) throw new RangeError("The category hierarchy has no levels.");
20632
- first2.pointCount = values.length;
20633
- first2.points = values.flatMap((value, index) => value === "" ? [] : [{ index, value }]);
21403
+ const first3 = source2.levels[0];
21404
+ if (!first3) throw new RangeError("The category hierarchy has no levels.");
21405
+ first3.pointCount = values.length;
21406
+ first3.points = values.flatMap((value, index) => value === "" ? [] : [{ index, value }]);
20634
21407
  } else if (source2?.cache?.type === "number" || key === "xValues") {
20635
21408
  const numbers = values.map((value) => value.trim() === "" ? null : Number(value));
20636
21409
  series2[key] = key === "xValues" || numbers.every((value) => value === null || Number.isFinite(value)) ? numberSource(numbers, source2, source2?.formula) : categorySource(values, source2);
@@ -20774,7 +21547,7 @@ function defaultChartAxes(horizontal, scatter2, ids = DEFAULT_CHART_AXIS_IDS) {
20774
21547
  tickLabelPosition: "nextTo",
20775
21548
  crosses: "autoZero"
20776
21549
  });
20777
- const first2 = scatter2 ? {
21550
+ const first3 = scatter2 ? {
20778
21551
  ...common(),
20779
21552
  kind: "val",
20780
21553
  id: firstId,
@@ -20803,7 +21576,7 @@ function defaultChartAxes(horizontal, scatter2, ids = DEFAULT_CHART_AXIS_IDS) {
20803
21576
  crossAxisId: firstId,
20804
21577
  crossBetween: scatter2 ? "midCat" : "between"
20805
21578
  };
20806
- return [first2, second];
21579
+ return [first3, second];
20807
21580
  }
20808
21581
  var CATEGORY_ONLY = [
20809
21582
  "auto",
@@ -21036,7 +21809,7 @@ function applyChartColorPalette(space3, from, to) {
21036
21809
  });
21037
21810
  });
21038
21811
  }
21039
- var srgb = (hex) => ({
21812
+ var srgb2 = (hex) => ({
21040
21813
  kind: "srgb",
21041
21814
  value: hex.replace("#", "").toUpperCase(),
21042
21815
  transforms: []
@@ -21061,14 +21834,14 @@ function applyChartStylePreset(space3, id) {
21061
21834
  const points2 = new Map(series2.dataPoints.map((point) => [point.index ?? 0, point]));
21062
21835
  for (let at2 = 0; at2 < count; at2++) {
21063
21836
  const point = points2.get(at2) ?? { index: at2 };
21064
- point.spPr = paintShape(point.spPr, srgb(colors[at2 % colors.length]), false);
21837
+ point.spPr = paintShape(point.spPr, srgb2(colors[at2 % colors.length]), false);
21065
21838
  points2.set(at2, point);
21066
21839
  }
21067
21840
  series2.dataPoints = [...points2.values()].sort((a2, b) => (a2.index ?? 0) - (b.index ?? 0));
21068
21841
  return;
21069
21842
  }
21070
21843
  const line4 = LINE_KINDS.has(group2.kind);
21071
- series2.spPr = paintShape(series2.spPr, srgb(colors[index % colors.length]), line4);
21844
+ series2.spPr = paintShape(series2.spPr, srgb2(colors[index % colors.length]), line4);
21072
21845
  if (series2.marker?.spPr) delete series2.marker.spPr.fill;
21073
21846
  for (const point of series2.dataPoints) {
21074
21847
  if (point.spPr) delete point.spPr.fill;
@@ -21587,14 +22360,14 @@ function axisPair(space3, group2) {
21587
22360
  }
21588
22361
  function chartSeriesSecondaryAxisSupported(space3, seriesIndex) {
21589
22362
  const { group: group2 } = chartSeriesEntryAt(space3, seriesIndex);
21590
- const first2 = space3.plotArea.groups[0];
21591
- if (!first2 || seriesIndex === 0 || group2.is3D || first2.is3D) return false;
21592
- if (![group2.kind, first2.kind].every((kind) => ["bar", "line", "area"].includes(kind)))
22363
+ const first3 = space3.plotArea.groups[0];
22364
+ if (!first3 || seriesIndex === 0 || group2.is3D || first3.is3D) return false;
22365
+ if (![group2.kind, first3.kind].every((kind) => ["bar", "line", "area"].includes(kind)))
21593
22366
  return false;
21594
- if (group2.barDirection === "bar" || first2.barDirection === "bar") return false;
22367
+ if (group2.barDirection === "bar" || first3.barDirection === "bar") return false;
21595
22368
  if (group2.series.length > 1 && (group2.grouping === "stacked" || group2.grouping === "percentStacked" || !!group2.extLst))
21596
22369
  return false;
21597
- return !!axisPair(space3, group2) && !!axisPair(space3, first2);
22370
+ return !!axisPair(space3, group2) && !!axisPair(space3, first3);
21598
22371
  }
21599
22372
  function chartSeriesOnSecondaryAxis(space3, seriesIndex) {
21600
22373
  const { group: group2 } = chartSeriesEntryAt(space3, seriesIndex);
@@ -21712,14 +22485,14 @@ function applyChartEditIntent(space3, intent) {
21712
22485
  function chartSpaceDataSheet(space3) {
21713
22486
  const entries = chartSeriesEntries(space3);
21714
22487
  const firstEntry = entries[0];
21715
- const first2 = firstEntry ? isXYChartKind(firstEntry.group.kind) ? firstEntry.series.xValues : firstEntry.series.categories : void 0;
22488
+ const first3 = firstEntry ? isXYChartKind(firstEntry.group.kind) ? firstEntry.series.xValues : firstEntry.series.categories : void 0;
21716
22489
  const valuesOf = (index) => {
21717
22490
  const entry3 = entries[index];
21718
22491
  const source2 = isXYChartKind(entry3.group.kind) ? entry3.series.yValues : entry3.series.values;
21719
22492
  return chartSourceValues(source2).map((value) => typeof value === "number" ? value : null);
21720
22493
  };
21721
22494
  const longest = entries.reduce((max, _, index) => Math.max(max, valuesOf(index).length), 0);
21722
- const labels2 = chartSourceValues(first2).map(String);
22495
+ const labels2 = chartSourceValues(first3).map(String);
21723
22496
  const count = Math.max(labels2.length, longest);
21724
22497
  const categories = Array.from({ length: count }, (_, index) => labels2[index] ?? "");
21725
22498
  return {
@@ -21825,11 +22598,11 @@ function axis(kind, id, crossAxisId, position) {
21825
22598
  }
21826
22599
  function minimalChartAxes(group2, ids) {
21827
22600
  if (!groupHasAxes(group2.element)) return [];
21828
- const [first2, second, third] = ids;
22601
+ const [first3, second, third] = ids;
21829
22602
  const horizontal = group2.kind === "bar" && group2.barDirection === "bar";
21830
22603
  const axes = [
21831
- axis(isXYChartKind(group2.kind) ? "val" : "cat", first2, second, horizontal ? "l" : "b"),
21832
- axis("val", second, first2, horizontal ? "b" : "l")
22604
+ axis(isXYChartKind(group2.kind) ? "val" : "cat", first3, second, horizontal ? "l" : "b"),
22605
+ axis("val", second, first3, horizontal ? "b" : "l")
21833
22606
  ];
21834
22607
  if (group2.element === "line3DChart" || group2.kind === "surface")
21835
22608
  axes.push(axis("ser", third, second, "b"));
@@ -21890,17 +22663,17 @@ function series(sheet, index, options2, sheetName) {
21890
22663
  }
21891
22664
  function axisIds(options2) {
21892
22665
  const ids = options2.axisIds ?? [];
21893
- const [first2, second, third] = [
22666
+ const [first3, second, third] = [
21894
22667
  ids[0] ?? DEFAULT_CHART_AXIS_IDS[0],
21895
22668
  ids[1] ?? DEFAULT_CHART_AXIS_IDS[1],
21896
22669
  ids[2] ?? DEFAULT_CHART_AXIS_IDS[1] + 1
21897
22670
  ];
21898
- for (const id of [first2, second, third])
22671
+ for (const id of [first3, second, third])
21899
22672
  if (!Number.isSafeInteger(id) || id < 0)
21900
22673
  throw new RangeError("Chart axis ids must be non-negative whole numbers");
21901
- if ((/* @__PURE__ */ new Set([first2, second, third])).size !== 3)
22674
+ if ((/* @__PURE__ */ new Set([first3, second, third])).size !== 3)
21902
22675
  throw new RangeError("Chart axis ids must differ");
21903
- return [first2, second, third];
22676
+ return [first3, second, third];
21904
22677
  }
21905
22678
  function withAxisIds(space3, ids) {
21906
22679
  return editChartSpace(space3, (draft) => {
@@ -22801,9 +23574,9 @@ function setChartSeriesAxis(space3, seriesIndex, valueAxisId2) {
22801
23574
 
22802
23575
  // chart/edit/series-type.ts
22803
23576
  function sameGroupSettings(a2, b) {
22804
- const { series: _a, ...first2 } = a2;
23577
+ const { series: _a, ...first3 } = a2;
22805
23578
  const { series: _b, ...second } = b;
22806
- return JSON.stringify(first2) === JSON.stringify(second);
23579
+ return JSON.stringify(first3) === JSON.stringify(second);
22807
23580
  }
22808
23581
  function joinChartGroups(space3) {
22809
23582
  return editChartSpace(space3, (draft) => {
@@ -22844,11 +23617,11 @@ function setChartSeriesType(space3, index, target) {
22844
23617
  draft.plotArea.groups.splice(groupIndex, 1, ...fragments);
22845
23618
  const groups = draft.plotArea.groups;
22846
23619
  const placed2 = groupIndex + (at2 > 0 ? 1 : 0);
22847
- const join = (first2) => {
22848
- const [a2, b] = [groups[first2], groups[first2 + 1]];
23620
+ const join = (first3) => {
23621
+ const [a2, b] = [groups[first3], groups[first3 + 1]];
22849
23622
  if (!a2 || !b || !sameGroupSettings(a2, b)) return;
22850
23623
  a2.series.push(...b.series);
22851
- groups.splice(first2 + 1, 1);
23624
+ groups.splice(first3 + 1, 1);
22852
23625
  };
22853
23626
  join(placed2);
22854
23627
  if (placed2 > 0) join(placed2 - 1);
@@ -23097,9 +23870,9 @@ function sharesCategories(space3) {
23097
23870
  const entries = chartSeriesEntries(space3);
23098
23871
  if (entries.some(({ group: group2 }) => isXYChartKind(group2.kind))) return false;
23099
23872
  if (entries.some(({ series: series2 }) => series2.categories?.levels || !series2.values)) return false;
23100
- const first2 = JSON.stringify(chartSourceValues(entries[0]?.series.categories));
23873
+ const first3 = JSON.stringify(chartSourceValues(entries[0]?.series.categories));
23101
23874
  return entries.every(
23102
- ({ series: series2 }) => JSON.stringify(chartSourceValues(series2.categories)) === first2
23875
+ ({ series: series2 }) => JSON.stringify(chartSourceValues(series2.categories)) === first3
23103
23876
  );
23104
23877
  }
23105
23878
  function standardLayout(space3, sheetName) {
@@ -23314,11 +24087,13 @@ function relativeFolder(from, to) {
23314
24087
  // text/index.ts
23315
24088
  var text_exports = {};
23316
24089
  __export(text_exports, {
24090
+ AUTO_SPACE_EM: () => AUTO_SPACE_EM,
23317
24091
  FONT_SUBSTITUTION_MAP: () => FONT_SUBSTITUTION_MAP,
23318
24092
  GOOGLE_FONTS_CATALOGUE_DATE: () => GOOGLE_FONTS_CATALOGUE_DATE,
23319
24093
  GOOGLE_FONTS_CSS2_BASE: () => GOOGLE_FONTS_CSS2_BASE,
23320
24094
  GOOGLE_FONTS_FAMILIES: () => GOOGLE_FONTS_FAMILIES,
23321
24095
  GOOGLE_WEBFONT_AXIS: () => GOOGLE_WEBFONT_AXIS,
24096
+ MAX_GLYPHLESS_GLYPHS: () => MAX_GLYPHLESS_GLYPHS,
23322
24097
  METRIC_FONT_SUBSTITUTES: () => METRIC_FONT_SUBSTITUTES,
23323
24098
  OOXML_DATETIME_PATTERNS: () => OOXML_DATETIME_PATTERNS,
23324
24099
  PANOSE_FAMILY_MAP: () => PANOSE_FAMILY_MAP,
@@ -23335,11 +24110,15 @@ __export(text_exports, {
23335
24110
  classifyPanose: () => classifyPanose,
23336
24111
  collectRunFamilies: () => collectRunFamilies,
23337
24112
  collectWebfontFaces: () => collectWebfontFaces,
24113
+ complexBreakAllowed: () => complexBreakAllowed,
23338
24114
  decimalAnchorIndex: () => decimalAnchorIndex,
23339
24115
  decimalSeparatorForLanguage: () => decimalSeparatorForLanguage,
24116
+ decodeHtmlEntities: () => decodeHtmlEntities,
23340
24117
  designTextWidthEm: () => designTextWidthEm,
23341
24118
  detectFontScript: () => detectFontScript,
23342
24119
  distributeRunsText: () => distributeRunsText,
24120
+ eastAsianAutoSpace: () => eastAsianAutoSpace,
24121
+ embeddingPermission: () => embeddingPermission,
23343
24122
  findGoogleFontsFamily: () => findGoogleFontsFamily,
23344
24123
  findLookAlikeGoogleFontsFamily: () => findLookAlikeGoogleFontsFamily,
23345
24124
  findMetricCompatibleGoogleFontsFamily: () => findMetricCompatibleGoogleFontsFamily,
@@ -23354,22 +24133,39 @@ __export(text_exports, {
23354
24133
  getPanoseWeight: () => getPanoseWeight,
23355
24134
  getSubstituteFontFamily: () => getSubstituteFontFamily,
23356
24135
  getSubstituteFonts: () => getSubstituteFonts,
24136
+ glyphlessTrueType: () => glyphlessTrueType,
24137
+ hangsAtLineEnd: () => hangsAtLineEnd,
23357
24138
  hasDesignAdvances: () => hasDesignAdvances,
23358
24139
  hasDirectSubstitution: () => hasDirectSubstitution,
23359
24140
  hasDistinctScriptFonts: () => hasDistinctScriptFonts,
24141
+ htmlClipboardFragment: () => htmlClipboardFragment,
24142
+ isComplexBreakChar: () => isComplexBreakChar,
24143
+ isEastAsianChar: () => isEastAsianChar,
24144
+ isEastAsianLetter: () => isEastAsianLetter,
24145
+ kinsokuLanguage: () => kinsokuLanguage,
24146
+ kinsokuSets: () => kinsokuSets,
23360
24147
  matchGoogleWebfontFragments: () => matchGoogleWebfontFragments,
24148
+ mayDisplayEmbeddedFont: () => mayDisplayEmbeddedFont,
24149
+ mayEmbedFontInEditableDocument: () => mayEmbedFontInEditableDocument,
24150
+ mayEmbedFontSubset: () => mayEmbedFontSubset,
23361
24151
  mergeTextThreeWay: () => mergeTextThreeWay,
23362
24152
  metricFontFamily: () => metricFontFamily,
23363
24153
  namedFontVerticalMetrics: () => namedFontVerticalMetrics,
23364
24154
  normalizeGoogleFontsBaseUrl: () => normalizeGoogleFontsBaseUrl,
23365
24155
  officeFontVerticalMetrics: () => officeFontVerticalMetrics,
23366
24156
  ooxmlDateTimeFieldPicture: () => ooxmlDateTimeFieldPicture,
24157
+ parseCssColorHex: () => parseCssColorHex,
24158
+ parseCssDeclarations: () => parseCssDeclarations,
23367
24159
  parseFontWeightName: () => parseFontWeightName,
24160
+ parseHtmlAttributes: () => parseHtmlAttributes,
23368
24161
  parseLocaleNumber: () => parseLocaleNumber,
23369
24162
  parsePanoseBytes: () => parsePanoseBytes,
23370
24163
  parsePanoseString: () => parsePanoseString,
23371
24164
  parseTrueType: () => parseTrueType,
23372
24165
  parseTsv: () => parseTsv,
24166
+ prohibitedAtLineEnd: () => prohibitedAtLineEnd,
24167
+ prohibitedAtLineStart: () => prohibitedAtLineStart,
24168
+ readSfntFsType: () => readSfntFsType,
23373
24169
  realignOrCollapseRuns: () => realignOrCollapseRuns,
23374
24170
  resolveFontForScript: () => resolveFontForScript,
23375
24171
  resolveFontItalic: () => resolveFontItalic,
@@ -23384,60 +24180,61 @@ __export(text_exports, {
23384
24180
  stripFontStyleSuffix: () => stripFontStyleSuffix,
23385
24181
  subsetTrueType: () => subsetTrueType,
23386
24182
  toTsv: () => toTsv,
24183
+ tokenizeHtml: () => tokenizeHtml,
23387
24184
  wrapStyledRuns: () => wrapStyledRuns
23388
24185
  });
23389
24186
 
23390
24187
  // text/unicode-script-detection.ts
23391
- function detectFontScript(codePoint) {
23392
- if (codePoint >= 11904 && codePoint <= 40959 || // CJK radicals, unified ideographs
23393
- codePoint >= 44032 && codePoint <= 55215 || // Hangul syllables
23394
- codePoint >= 63744 && codePoint <= 64255 || // CJK compatibility ideographs
23395
- codePoint >= 65072 && codePoint <= 65103 || // CJK compatibility forms
23396
- codePoint >= 131072 && codePoint <= 195103 || // CJK extension B-F
23397
- codePoint >= 12288 && codePoint <= 12351 || // CJK symbols & punctuation
23398
- codePoint >= 12352 && codePoint <= 12447 || // Hiragana
23399
- codePoint >= 12448 && codePoint <= 12543 || // Katakana
23400
- codePoint >= 12784 && codePoint <= 12799 || // Katakana extensions
23401
- codePoint >= 65280 && codePoint <= 65519) {
24188
+ function detectFontScript(codePoint2) {
24189
+ if (codePoint2 >= 11904 && codePoint2 <= 40959 || // CJK radicals, unified ideographs
24190
+ codePoint2 >= 44032 && codePoint2 <= 55215 || // Hangul syllables
24191
+ codePoint2 >= 63744 && codePoint2 <= 64255 || // CJK compatibility ideographs
24192
+ codePoint2 >= 65072 && codePoint2 <= 65103 || // CJK compatibility forms
24193
+ codePoint2 >= 131072 && codePoint2 <= 195103 || // CJK extension B-F
24194
+ codePoint2 >= 12288 && codePoint2 <= 12351 || // CJK symbols & punctuation
24195
+ codePoint2 >= 12352 && codePoint2 <= 12447 || // Hiragana
24196
+ codePoint2 >= 12448 && codePoint2 <= 12543 || // Katakana
24197
+ codePoint2 >= 12784 && codePoint2 <= 12799 || // Katakana extensions
24198
+ codePoint2 >= 65280 && codePoint2 <= 65519) {
23402
24199
  return "eastAsia";
23403
24200
  }
23404
- if (codePoint >= 1424 && codePoint <= 1535 || // Hebrew
23405
- codePoint >= 1536 && codePoint <= 1791 || // Arabic
23406
- codePoint >= 1792 && codePoint <= 1871 || // Syriac
23407
- codePoint >= 1872 && codePoint <= 1919 || // Arabic Supplement
23408
- codePoint >= 1920 && codePoint <= 1983 || // Thaana
23409
- codePoint >= 1984 && codePoint <= 2047 || // NKo
23410
- codePoint >= 2048 && codePoint <= 2111 || // Samaritan
23411
- codePoint >= 2304 && codePoint <= 2431 || // Devanagari
23412
- codePoint >= 2432 && codePoint <= 2559 || // Bengali
23413
- codePoint >= 2560 && codePoint <= 2687 || // Gurmukhi
23414
- codePoint >= 2688 && codePoint <= 2815 || // Gujarati
23415
- codePoint >= 2816 && codePoint <= 2943 || // Oriya
23416
- codePoint >= 2944 && codePoint <= 3071 || // Tamil
23417
- codePoint >= 3072 && codePoint <= 3199 || // Telugu
23418
- codePoint >= 3200 && codePoint <= 3327 || // Kannada
23419
- codePoint >= 3328 && codePoint <= 3455 || // Malayalam
23420
- codePoint >= 3456 && codePoint <= 3583 || // Sinhala
23421
- codePoint >= 3584 && codePoint <= 3711 || // Thai
23422
- codePoint >= 3712 && codePoint <= 3839 || // Lao
23423
- codePoint >= 3840 && codePoint <= 4095 || // Tibetan
23424
- codePoint >= 4096 && codePoint <= 4255 || // Myanmar
23425
- codePoint >= 4256 && codePoint <= 4351 || // Georgian
23426
- codePoint >= 6016 && codePoint <= 6143 || // Khmer
23427
- codePoint >= 64336 && codePoint <= 65023 || // Arabic Presentation Forms-A
23428
- codePoint >= 65136 && codePoint <= 65279) {
24201
+ if (codePoint2 >= 1424 && codePoint2 <= 1535 || // Hebrew
24202
+ codePoint2 >= 1536 && codePoint2 <= 1791 || // Arabic
24203
+ codePoint2 >= 1792 && codePoint2 <= 1871 || // Syriac
24204
+ codePoint2 >= 1872 && codePoint2 <= 1919 || // Arabic Supplement
24205
+ codePoint2 >= 1920 && codePoint2 <= 1983 || // Thaana
24206
+ codePoint2 >= 1984 && codePoint2 <= 2047 || // NKo
24207
+ codePoint2 >= 2048 && codePoint2 <= 2111 || // Samaritan
24208
+ codePoint2 >= 2304 && codePoint2 <= 2431 || // Devanagari
24209
+ codePoint2 >= 2432 && codePoint2 <= 2559 || // Bengali
24210
+ codePoint2 >= 2560 && codePoint2 <= 2687 || // Gurmukhi
24211
+ codePoint2 >= 2688 && codePoint2 <= 2815 || // Gujarati
24212
+ codePoint2 >= 2816 && codePoint2 <= 2943 || // Oriya
24213
+ codePoint2 >= 2944 && codePoint2 <= 3071 || // Tamil
24214
+ codePoint2 >= 3072 && codePoint2 <= 3199 || // Telugu
24215
+ codePoint2 >= 3200 && codePoint2 <= 3327 || // Kannada
24216
+ codePoint2 >= 3328 && codePoint2 <= 3455 || // Malayalam
24217
+ codePoint2 >= 3456 && codePoint2 <= 3583 || // Sinhala
24218
+ codePoint2 >= 3584 && codePoint2 <= 3711 || // Thai
24219
+ codePoint2 >= 3712 && codePoint2 <= 3839 || // Lao
24220
+ codePoint2 >= 3840 && codePoint2 <= 4095 || // Tibetan
24221
+ codePoint2 >= 4096 && codePoint2 <= 4255 || // Myanmar
24222
+ codePoint2 >= 4256 && codePoint2 <= 4351 || // Georgian
24223
+ codePoint2 >= 6016 && codePoint2 <= 6143 || // Khmer
24224
+ codePoint2 >= 64336 && codePoint2 <= 65023 || // Arabic Presentation Forms-A
24225
+ codePoint2 >= 65136 && codePoint2 <= 65279) {
23429
24226
  return "complexScript";
23430
24227
  }
23431
- if (codePoint >= 8592 && codePoint <= 8703 || // Arrows
23432
- codePoint >= 8704 && codePoint <= 8959 || // Mathematical operators
23433
- codePoint >= 8960 && codePoint <= 9215 || // Misc technical
23434
- codePoint >= 9472 && codePoint <= 9599 || // Box drawing
23435
- codePoint >= 9600 && codePoint <= 9631 || // Block elements
23436
- codePoint >= 9632 && codePoint <= 9727 || // Geometric shapes
23437
- codePoint >= 9728 && codePoint <= 9983 || // Misc symbols
23438
- codePoint >= 9984 && codePoint <= 10175 || // Dingbats
23439
- codePoint >= 57344 && codePoint <= 63743 || // Private Use Area
23440
- codePoint >= 126976 && codePoint <= 129535) {
24228
+ if (codePoint2 >= 8592 && codePoint2 <= 8703 || // Arrows
24229
+ codePoint2 >= 8704 && codePoint2 <= 8959 || // Mathematical operators
24230
+ codePoint2 >= 8960 && codePoint2 <= 9215 || // Misc technical
24231
+ codePoint2 >= 9472 && codePoint2 <= 9599 || // Box drawing
24232
+ codePoint2 >= 9600 && codePoint2 <= 9631 || // Block elements
24233
+ codePoint2 >= 9632 && codePoint2 <= 9727 || // Geometric shapes
24234
+ codePoint2 >= 9728 && codePoint2 <= 9983 || // Misc symbols
24235
+ codePoint2 >= 9984 && codePoint2 <= 10175 || // Dingbats
24236
+ codePoint2 >= 57344 && codePoint2 <= 63743 || // Private Use Area
24237
+ codePoint2 >= 126976 && codePoint2 <= 129535) {
23441
24238
  return "symbol";
23442
24239
  }
23443
24240
  return "latin";
@@ -23451,14 +24248,14 @@ function segmentByScript(text3) {
23451
24248
  let currentStart = 0;
23452
24249
  let currentText = "";
23453
24250
  for (let i2 = 0; i2 < text3.length; i2++) {
23454
- const codePoint = text3.codePointAt(i2);
23455
- if (codePoint === void 0) {
24251
+ const codePoint2 = text3.codePointAt(i2);
24252
+ if (codePoint2 === void 0) {
23456
24253
  continue;
23457
24254
  }
23458
- const charLength = codePoint > 65535 ? 2 : 1;
24255
+ const charLength = codePoint2 > 65535 ? 2 : 1;
23459
24256
  const char = text3.substring(i2, i2 + charLength);
23460
- const isNeutral = codePoint <= 127 && !/[a-zA-Z0-9]/u.test(char);
23461
- const script = isNeutral ? currentScript ?? "latin" : detectFontScript(codePoint);
24257
+ const isNeutral = codePoint2 <= 127 && !/[a-zA-Z0-9]/u.test(char);
24258
+ const script = isNeutral ? currentScript ?? "latin" : detectFontScript(codePoint2);
23462
24259
  if (script !== currentScript && currentScript !== null) {
23463
24260
  runs.push({
23464
24261
  text: currentText,
@@ -23666,16 +24463,16 @@ function decimalSeparatorForLanguage(language) {
23666
24463
  }
23667
24464
  }
23668
24465
  function decimalAnchorIndex(text3, separator) {
23669
- const first2 = text3.search(/[0-9]/u);
23670
- if (first2 < 0) {
24466
+ const first3 = text3.search(/[0-9]/u);
24467
+ if (first3 < 0) {
23671
24468
  return text3.length;
23672
24469
  }
23673
- let end = first2;
24470
+ let end = first3;
23674
24471
  while (end < text3.length && /[0-9.,]/u.test(text3.charAt(end))) {
23675
24472
  end++;
23676
24473
  }
23677
- const sep = text3.slice(first2, end).indexOf(separator);
23678
- return sep >= 0 ? first2 + sep : end;
24474
+ const sep = text3.slice(first3, end).indexOf(separator);
24475
+ return sep >= 0 ? first3 + sep : end;
23679
24476
  }
23680
24477
 
23681
24478
  // text/change-case.ts
@@ -24188,6 +24985,106 @@ function formatLocaleNumber(value, language) {
24188
24985
  return decimal === "." ? plain : plain.replace(".", decimal);
24189
24986
  }
24190
24987
 
24988
+ // text/east-asian.ts
24989
+ function isEastAsianChar(ch) {
24990
+ const cp = ch.codePointAt(0) ?? 0;
24991
+ return cp >= 4352 && cp <= 4607 || cp >= 11904 && cp <= 40959 || cp >= 43360 && cp <= 43391 || cp >= 44032 && cp <= 55295 || cp >= 63744 && cp <= 64255 || cp >= 65072 && cp <= 65103 || cp >= 65280 && cp <= 65519 || cp >= 131072 && cp <= 262143;
24992
+ }
24993
+ var EAST_ASIAN_LETTER = /^[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u;
24994
+ var LETTER = /^\p{L}/u;
24995
+ var DIGIT = /^\p{Nd}/u;
24996
+ function isEastAsianLetter(grapheme) {
24997
+ return EAST_ASIAN_LETTER.test(grapheme);
24998
+ }
24999
+ function westernKind(grapheme) {
25000
+ if (!grapheme || isEastAsianChar(grapheme)) return void 0;
25001
+ if (DIGIT.test(grapheme)) return "digit";
25002
+ return LETTER.test(grapheme) ? "alpha" : void 0;
25003
+ }
25004
+ function eastAsianAutoSpace(before, after) {
25005
+ if (isEastAsianLetter(before)) return westernKind(after);
25006
+ if (isEastAsianLetter(after)) return westernKind(before);
25007
+ return void 0;
25008
+ }
25009
+ var AUTO_SPACE_EM = 0.25;
25010
+
25011
+ // text/kinsoku.ts
25012
+ var JAPANESE = {
25013
+ noStart: "!%),.:;?]}\xA2\xB0\u2019\u201D\u2030\u2032\u2033\u2103\u3001\u3002\u3005\u3009\u300B\u300D\u300F\u3011\u3015\u309B\u309C\u309D\u309E\u30FB\u30FD\u30FE\uFF01\uFF05\uFF09\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF3D\uFF5D\uFF61\uFF63\uFF64\uFF65\uFF9E\uFF9F\uFFE0",
25014
+ noEnd: "$([\\{\xA3\xA5\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\uFF04\uFF08\uFF3B\uFF5B\uFF62\uFFE1\uFFE5"
25015
+ };
25016
+ var JAPANESE_STRICT_EXTRA = "\u3041\u3043\u3045\u3047\u3049\u3063\u3083\u3085\u3087\u308E\u30A1\u30A3\u30A5\u30A7\u30A9\u30C3\u30E3\u30E5\u30E7\u30EE\u30F5\u30F6\u30FC\uFF67\uFF68\uFF69\uFF6A\uFF6B\uFF6C\uFF6D\uFF6E\uFF6F\uFF70";
25017
+ var DEFAULTS = {
25018
+ ja: JAPANESE,
25019
+ "zh-Hans": {
25020
+ noStart: "!%),.:;>?]}\xA2\xA8\xB0\xB7\u2015\u2016\u2019\u201D\u2026\u2030\u2032\u2033\u203A\u2103\u3001\u3002\u3003\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u301E\uFE36\uFE3A\uFE3E\uFE40\uFE44\uFE5A\uFE5C\uFE5E\uFF01\uFF02\uFF05\uFF07\uFF09\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF3D\uFF40\uFF5C\uFF5D\uFF5E\uFFE0",
25021
+ noEnd: "$([{\xA3\xA5\xB7\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u301D\uFE59\uFE5B\uFE5D\uFF04\uFF08\uFF0E\uFF3B\uFF5B\uFFE1\uFFE5"
25022
+ },
25023
+ "zh-Hant": {
25024
+ noStart: "!),.:;?]}\xA2\xB7\u2019\u201D\u2022\u2025\u2026\u2027\u2032\u3001\u3002\u3009\u300B\u300D\u300F\u3011\u3015\u301E\uFE30\uFE31\uFE33\uFE34\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE4F\uFE50\uFE51\uFE52\uFE54\uFE55\uFE56\uFE57\uFE5A\uFE5C\uFE5E\uFF01\uFF09\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF3D\uFF5C\uFF5D\uFF64",
25025
+ noEnd: "([{\xA3\xA5\u2018\u201C\u2035\u3008\u300A\u300C\u300E\u3010\u3014\u301D\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE59\uFE5B\uFE5D\uFF08\uFF5B"
25026
+ },
25027
+ ko: { noStart: "", noEnd: "" }
25028
+ };
25029
+ function kinsokuLanguage(tag3) {
25030
+ if (!tag3) return void 0;
25031
+ const lower = tag3.toLowerCase();
25032
+ const [primary] = lower.split(/[-_]/);
25033
+ if (primary === "ja") return "ja";
25034
+ if (primary === "ko") return "ko";
25035
+ if (primary !== "zh") return void 0;
25036
+ return /-(hant|tw|hk|mo)(-|$)/.test(lower) ? "zh-Hant" : "zh-Hans";
25037
+ }
25038
+ function kinsokuSets(language, settings = {}) {
25039
+ const base = DEFAULTS[language];
25040
+ const custom = (override) => override && kinsokuLanguage(override.language) === language ? override.chars : void 0;
25041
+ const strictExtra = settings.strict && language === "ja" ? JAPANESE_STRICT_EXTRA : "";
25042
+ return {
25043
+ noStart: custom(settings.noLineBreaksBefore) ?? base.noStart + strictExtra,
25044
+ noEnd: custom(settings.noLineBreaksAfter) ?? base.noEnd
25045
+ };
25046
+ }
25047
+ var first2 = (text3) => String.fromCodePoint(text3.codePointAt(0) ?? 0);
25048
+ function prohibitedAtLineStart(grapheme, sets) {
25049
+ return grapheme.length > 0 && sets.noStart.includes(first2(grapheme));
25050
+ }
25051
+ function prohibitedAtLineEnd(grapheme, sets) {
25052
+ return grapheme.length > 0 && sets.noEnd.includes(first2(grapheme));
25053
+ }
25054
+ var HANGING = {
25055
+ ja: ",.\u2019\u201D\u3001\u3002\u300D\u300F\u3011\uFF09\uFF0C\uFF0E\uFF3D\uFF5D\uFF61\uFF64",
25056
+ "zh-Hans": "!%),.:;>?]}\xA2\xB0\u2019\u201D\u2030\u2032\u2033\u2103\u3001\u3002\u3003\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u301E\uFE5A\uFE5C\uFE5E\uFF01\uFF02\uFF05\uFF07\uFF09\uFF0C\uFF1A\uFF1B\uFF1F\uFF3D\uFF5D\uFFE0",
25057
+ "zh-Hant": "!),.:;?]}\u2019\u201D\u2032\u3001\u3002\u3009\u300B\u300D\u300F\u3011\u3015\u301E\uFE5A\uFE5C\uFE5E\uFF01\uFF09\uFF0C\uFF0E\uFF1A\uFF1B\uFF1F\uFF3D\uFF5D",
25058
+ ko: ""
25059
+ };
25060
+ function hangsAtLineEnd(grapheme, language) {
25061
+ return grapheme.length > 0 && HANGING[language].includes(first2(grapheme));
25062
+ }
25063
+
25064
+ // text/complex-breaks.ts
25065
+ function isComplexBreakChar(ch) {
25066
+ const cp = ch.codePointAt(0) ?? 0;
25067
+ return cp >= 3584 && cp <= 3839 || // Thai, Lao
25068
+ cp >= 4096 && cp <= 4255 || // Myanmar
25069
+ cp >= 6016 && cp <= 6143 || // Khmer
25070
+ cp >= 6624 && cp <= 6655 || // Khmer Symbols
25071
+ cp >= 43488 && cp <= 43519 || // Myanmar Extended-B
25072
+ cp >= 43616 && cp <= 43647;
25073
+ }
25074
+ function isLeadingVowel(cp) {
25075
+ return cp >= 3648 && cp <= 3652 || cp >= 3776 && cp <= 3780;
25076
+ }
25077
+ function isStacker(cp) {
25078
+ return cp === 6098 || cp === 4153;
25079
+ }
25080
+ function complexBreakAllowed(before, after) {
25081
+ if (!before || !after) return false;
25082
+ if (!isComplexBreakChar(before) || !isComplexBreakChar(after)) return false;
25083
+ const last = before.codePointAt(before.length - 1) ?? 0;
25084
+ const lead = before.codePointAt(0) ?? 0;
25085
+ return !(before.length === 1 && isLeadingVowel(lead)) && !isStacker(last);
25086
+ }
25087
+
24191
25088
  // text/font-substitution-map.ts
24192
25089
  var FONT_SUBSTITUTION_MAP = {
24193
25090
  // Microsoft Office default fonts. The Aptos family became the Office
@@ -24636,6 +25533,150 @@ function segmentByFont(text3, fonts) {
24636
25533
  return result;
24637
25534
  }
24638
25535
 
25536
+ // text/truetype/embedding.ts
25537
+ var RESTRICTED = 2;
25538
+ var PREVIEW_PRINT = 4;
25539
+ var EDITABLE = 8;
25540
+ var NO_SUBSETTING = 256;
25541
+ var BITMAP_ONLY = 512;
25542
+ function embeddingPermission(fsType) {
25543
+ const licence = fsType & EDITABLE ? "editable" : fsType & PREVIEW_PRINT ? "preview-print" : fsType & RESTRICTED ? "restricted" : "installable";
25544
+ return {
25545
+ licence,
25546
+ noSubsetting: (fsType & NO_SUBSETTING) !== 0,
25547
+ bitmapOnly: (fsType & BITMAP_ONLY) !== 0
25548
+ };
25549
+ }
25550
+ function mayDisplayEmbeddedFont(permission) {
25551
+ return permission.licence !== "restricted";
25552
+ }
25553
+ function mayEmbedFontInEditableDocument(permission) {
25554
+ return (permission.licence === "installable" || permission.licence === "editable") && !permission.bitmapOnly;
25555
+ }
25556
+ function mayEmbedFontSubset(permission) {
25557
+ return mayDisplayEmbeddedFont(permission) && !permission.noSubsetting && !permission.bitmapOnly;
25558
+ }
25559
+ var SFNT_VERSIONS = /* @__PURE__ */ new Set([65536, 1330926671, 1953658213]);
25560
+ var TTC_TAG = 1953784678;
25561
+ var OS2_TAG = 1330851634;
25562
+ function readSfntFsType(data, header) {
25563
+ const byte = (offset) => header && offset < header.length ? header[offset] : data[offset];
25564
+ const u162 = (offset) => {
25565
+ const hi = byte(offset);
25566
+ const lo = byte(offset + 1);
25567
+ return hi === void 0 || lo === void 0 ? void 0 : hi << 8 | lo;
25568
+ };
25569
+ const u322 = (offset) => {
25570
+ const hi = u162(offset);
25571
+ const lo = u162(offset + 2);
25572
+ return hi === void 0 || lo === void 0 ? void 0 : hi * 65536 + lo;
25573
+ };
25574
+ let base = 0;
25575
+ if (u322(0) === TTC_TAG) {
25576
+ const first3 = u322(12);
25577
+ if (first3 === void 0) return void 0;
25578
+ base = first3;
25579
+ }
25580
+ const version = u322(base);
25581
+ if (version === void 0 || !SFNT_VERSIONS.has(version)) return void 0;
25582
+ const numTables = u162(base + 4) ?? 0;
25583
+ for (let i2 = 0; i2 < numTables; i2++) {
25584
+ const record = base + 12 + i2 * 16;
25585
+ const tag3 = u322(record);
25586
+ if (tag3 === void 0) return void 0;
25587
+ if (tag3 === OS2_TAG) {
25588
+ const offset = u322(record + 8);
25589
+ return offset === void 0 ? void 0 : u162(offset + 8);
25590
+ }
25591
+ }
25592
+ return void 0;
25593
+ }
25594
+
25595
+ // text/truetype/sfnt-write.ts
25596
+ var pad4 = (n3) => n3 + 3 & -4;
25597
+ function checksum(bytes) {
25598
+ let sum = 0;
25599
+ for (let i2 = 0; i2 < bytes.length; i2 += 4)
25600
+ sum = sum + ((bytes[i2] ?? 0) << 24 | (bytes[i2 + 1] ?? 0) << 16 | (bytes[i2 + 2] ?? 0) << 8 | (bytes[i2 + 3] ?? 0)) >>> 0;
25601
+ return sum;
25602
+ }
25603
+ function writeSfnt(tables) {
25604
+ const directory = 12 + tables.length * 16;
25605
+ let total = directory;
25606
+ for (const [, bytes] of tables) total += pad4(bytes.length);
25607
+ const out = new Uint8Array(total);
25608
+ const view = new DataView(out.buffer);
25609
+ view.setUint32(0, 65536);
25610
+ view.setUint16(4, tables.length);
25611
+ const power = 2 ** Math.floor(Math.log2(tables.length));
25612
+ view.setUint16(6, power * 16);
25613
+ view.setUint16(8, Math.log2(power));
25614
+ view.setUint16(10, tables.length * 16 - power * 16);
25615
+ let position = directory;
25616
+ let headAt = -1;
25617
+ tables.forEach(([name2, bytes], index) => {
25618
+ const entry3 = 12 + index * 16;
25619
+ for (let i2 = 0; i2 < 4; i2++) out[entry3 + i2] = name2.charCodeAt(i2);
25620
+ view.setUint32(entry3 + 4, checksum(bytes));
25621
+ view.setUint32(entry3 + 8, position);
25622
+ view.setUint32(entry3 + 12, bytes.length);
25623
+ out.set(bytes, position);
25624
+ if (name2 === "head") headAt = position;
25625
+ position += pad4(bytes.length);
25626
+ });
25627
+ if (headAt >= 0) view.setUint32(headAt + 8, 2981146554 - checksum(out) >>> 0);
25628
+ return out;
25629
+ }
25630
+
25631
+ // text/truetype/glyphless.ts
25632
+ var MAX_GLYPHLESS_GLYPHS = 65535;
25633
+ function glyphlessTrueType(advances2) {
25634
+ const count = Math.min(MAX_GLYPHLESS_GLYPHS, Math.max(1, advances2.length));
25635
+ const advance = (glyph2) => Math.max(0, Math.min(65535, Math.round(advances2[glyph2] ?? 0)));
25636
+ let widest = 0;
25637
+ const hmtx = new Uint8Array(count * 4);
25638
+ const hmtxView = new DataView(hmtx.buffer);
25639
+ for (let glyph2 = 0; glyph2 < count; glyph2++) {
25640
+ hmtxView.setUint16(glyph2 * 4, advance(glyph2));
25641
+ widest = Math.max(widest, advance(glyph2));
25642
+ }
25643
+ const head2 = new Uint8Array(54);
25644
+ const headView = new DataView(head2.buffer);
25645
+ headView.setUint32(0, 65536);
25646
+ headView.setUint32(4, 65536);
25647
+ headView.setUint32(12, 1594834165);
25648
+ headView.setUint16(16, 11);
25649
+ headView.setUint16(18, 1e3);
25650
+ headView.setInt16(38, -200);
25651
+ headView.setInt16(40, 1e3);
25652
+ headView.setInt16(42, 800);
25653
+ headView.setUint16(46, 8);
25654
+ headView.setInt16(48, 2);
25655
+ const hhea = new Uint8Array(36);
25656
+ const hheaView = new DataView(hhea.buffer);
25657
+ hheaView.setUint32(0, 65536);
25658
+ hheaView.setInt16(4, 800);
25659
+ hheaView.setInt16(6, -200);
25660
+ hheaView.setUint16(10, widest);
25661
+ hheaView.setInt16(18, 1);
25662
+ hheaView.setUint16(34, count);
25663
+ const maxp = new Uint8Array(32);
25664
+ const maxpView = new DataView(maxp.buffer);
25665
+ maxpView.setUint32(0, 65536);
25666
+ maxpView.setUint16(4, count);
25667
+ maxpView.setUint16(14, 1);
25668
+ const loca = new Uint8Array((count + 1) * 2);
25669
+ const glyf = new Uint8Array(4);
25670
+ return writeSfnt([
25671
+ ["glyf", glyf],
25672
+ ["head", head2],
25673
+ ["hhea", hhea],
25674
+ ["hmtx", hmtx],
25675
+ ["loca", loca],
25676
+ ["maxp", maxp]
25677
+ ]);
25678
+ }
25679
+
24639
25680
  // text/truetype/parse.ts
24640
25681
  var u16 = (v, o) => o + 2 <= v.byteLength ? v.getUint16(o) : 0;
24641
25682
  var i16 = (v, o) => o + 2 <= v.byteLength ? v.getInt16(o) : 0;
@@ -24765,13 +25806,6 @@ function parseTrueType(data) {
24765
25806
  }
24766
25807
 
24767
25808
  // text/truetype/subset.ts
24768
- var pad4 = (n3) => n3 + 3 & -4;
24769
- function checksum(bytes) {
24770
- let sum = 0;
24771
- for (let i2 = 0; i2 < bytes.length; i2 += 4)
24772
- sum = sum + ((bytes[i2] ?? 0) << 24 | (bytes[i2 + 1] ?? 0) << 16 | (bytes[i2 + 2] ?? 0) << 8 | (bytes[i2 + 3] ?? 0)) >>> 0;
24773
- return sum;
24774
- }
24775
25809
  function components(outline2) {
24776
25810
  if (outline2.length < 10) return [];
24777
25811
  const view = new DataView(outline2.buffer, outline2.byteOffset, outline2.byteLength);
@@ -24804,8 +25838,8 @@ function subsetTrueType(font, used) {
24804
25838
  const source2 = font.outline(glyph2);
24805
25839
  if (!source2.length) return source2;
24806
25840
  const copy = Uint8Array.from(source2);
24807
- const view2 = new DataView(copy.buffer);
24808
- for (const part of components(copy)) view2.setUint16(part.offset, mapped.get(part.glyph) ?? 0);
25841
+ const view = new DataView(copy.buffer);
25842
+ for (const part of components(copy)) view.setUint16(part.offset, mapped.get(part.glyph) ?? 0);
24809
25843
  return copy;
24810
25844
  });
24811
25845
  const count = glyphs.length;
@@ -24848,31 +25882,7 @@ function subsetTrueType(font, used) {
24848
25882
  ["maxp", maxp]
24849
25883
  ])
24850
25884
  if (bytes) tables.push([name2, bytes]);
24851
- const directory = 12 + tables.length * 16;
24852
- let total = directory;
24853
- for (const [, bytes] of tables) total += pad4(bytes.length);
24854
- const out = new Uint8Array(total);
24855
- const view = new DataView(out.buffer);
24856
- view.setUint32(0, 65536);
24857
- view.setUint16(4, tables.length);
24858
- const power = 2 ** Math.floor(Math.log2(tables.length));
24859
- view.setUint16(6, power * 16);
24860
- view.setUint16(8, Math.log2(power));
24861
- view.setUint16(10, tables.length * 16 - power * 16);
24862
- let position = directory;
24863
- let headAt = 0;
24864
- tables.forEach(([name2, bytes], index) => {
24865
- const entry3 = 12 + index * 16;
24866
- for (let i2 = 0; i2 < 4; i2++) out[entry3 + i2] = name2.charCodeAt(i2);
24867
- view.setUint32(entry3 + 4, checksum(bytes));
24868
- view.setUint32(entry3 + 8, position);
24869
- view.setUint32(entry3 + 12, bytes.length);
24870
- out.set(bytes, position);
24871
- if (name2 === "head") headAt = position;
24872
- position += pad4(bytes.length);
24873
- });
24874
- view.setUint32(headAt + 8, 2981146554 - checksum(out) >>> 0);
24875
- return { data: out, glyphs };
25885
+ return { data: writeSfnt(tables), glyphs };
24876
25886
  }
24877
25887
 
24878
25888
  // text/webfonts/google-fonts-catalogue.ts
@@ -27016,9 +28026,9 @@ function impliedStyle(typeface2) {
27016
28026
  return cached;
27017
28027
  }
27018
28028
  function primaryFamily(familyOrList) {
27019
- const first2 = familyOrList.split(",")[0]?.trim() ?? "";
27020
- const quoted = /^(["'])(.*)\1$/u.exec(first2);
27021
- return quoted ? (quoted[2] ?? "").replace(/\\(.)/gu, "$1") : first2;
28029
+ const first3 = familyOrList.split(",")[0]?.trim() ?? "";
28030
+ const quoted = /^(["'])(.*)\1$/u.exec(first3);
28031
+ return quoted ? (quoted[2] ?? "").replace(/\\(.)/gu, "$1") : first3;
27022
28032
  }
27023
28033
  function resolveFontWeight(fontFamily, bold) {
27024
28034
  const implied = fontFamily ? impliedStyle(primaryFamily(fontFamily))?.weight : void 0;
@@ -27742,8 +28752,8 @@ function withHostMenuCommands(entries, commands, context) {
27742
28752
  const middle = entries.map(
27743
28753
  (entry3, index) => index === 0 ? { ...entry3, separatorBefore: top.length > 0 } : entry3
27744
28754
  );
27745
- const first2 = bottom[0];
27746
- if (first2 && top.length + middle.length > 0) first2.separatorBefore = true;
28755
+ const first3 = bottom[0];
28756
+ if (first3 && top.length + middle.length > 0) first3.separatorBefore = true;
27747
28757
  return [...top, ...middle, ...bottom];
27748
28758
  }
27749
28759
  function withoutHiddenEntries(entries, hidden) {
@@ -28446,7 +29456,7 @@ function parseAttributes(source2) {
28446
29456
  }
28447
29457
  return attrs2;
28448
29458
  }
28449
- function tagEnd(xml2, from) {
29459
+ function tagEnd2(xml2, from) {
28450
29460
  let quote = "";
28451
29461
  for (let i2 = from; i2 < xml2.length; i2++) {
28452
29462
  const ch = xml2[i2];
@@ -28477,17 +29487,17 @@ function parseOrderedXml(xml2) {
28477
29487
  i2 = close < 0 ? -1 : xml2.indexOf("<", close + 3);
28478
29488
  continue;
28479
29489
  }
28480
- const end = tagEnd(xml2, i2 + 1);
29490
+ const end = tagEnd2(xml2, i2 + 1);
28481
29491
  if (end < 0) {
28482
29492
  break;
28483
29493
  }
28484
29494
  const next = xml2.indexOf("<", end + 1);
28485
- const first2 = xml2[i2 + 1];
28486
- if (first2 === "?" || first2 === "!") {
29495
+ const first3 = xml2[i2 + 1];
29496
+ if (first3 === "?" || first3 === "!") {
28487
29497
  i2 = next;
28488
29498
  continue;
28489
29499
  }
28490
- const closing = first2 === "/";
29500
+ const closing = first3 === "/";
28491
29501
  let cursor = closing ? i2 + 2 : i2 + 1;
28492
29502
  const nameStart = cursor;
28493
29503
  while (cursor < end && isNameChar2(xml2[cursor])) {
@@ -29315,8 +30325,8 @@ var Glyph = class {
29315
30325
  }
29316
30326
  /** `M p0 L p1 ... Z` through the points. */
29317
30327
  poly(points2, close = true) {
29318
- const [first2, ...rest] = points2;
29319
- return `M ${this.pt(first2)}${rest.map((q) => ` L ${this.pt(q)}`).join("")}${close ? " Z" : ""}`;
30328
+ const [first3, ...rest] = points2;
30329
+ return `M ${this.pt(first3)}${rest.map((q) => ` L ${this.pt(q)}`).join("")}${close ? " Z" : ""}`;
29320
30330
  }
29321
30331
  /** A full circle of radius `r` centred on `(cx, cy)`. */
29322
30332
  circle(cx, cy, r) {
@@ -35873,15 +36883,15 @@ var heart2 = {
35873
36883
  };
35874
36884
  function buildIrregularSeal(name2, points2) {
35875
36885
  const commands = [];
35876
- const first2 = points2[0];
35877
- if (!first2) {
36886
+ const first3 = points2[0];
36887
+ if (!first3) {
35878
36888
  return {
35879
36889
  name: name2,
35880
36890
  rect: FULL_RECT7,
35881
36891
  pathLst: [{ commands: [{ kind: "close" }] }]
35882
36892
  };
35883
36893
  }
35884
- commands.push({ kind: "moveTo", x: String(first2[0]), y: String(first2[1]) });
36894
+ commands.push({ kind: "moveTo", x: String(first3[0]), y: String(first3[1]) });
35885
36895
  for (let i2 = 1; i2 < points2.length; i2++) {
35886
36896
  const p2 = points2[i2];
35887
36897
  commands.push({ kind: "lnTo", x: String(p2[0]), y: String(p2[1]) });
@@ -43590,9 +44600,9 @@ function buildLinks(entries) {
43590
44600
  }
43591
44601
  const firstByName = /* @__PURE__ */ new Map();
43592
44602
  for (const { node } of entries) {
43593
- const first2 = firstByName.get(node.name);
43594
- if (first2) {
43595
- groups.union(first2, node);
44603
+ const first3 = firstByName.get(node.name);
44604
+ if (first3) {
44605
+ groups.union(first3, node);
43596
44606
  } else {
43597
44607
  firstByName.set(node.name, node);
43598
44608
  }
@@ -43775,16 +44785,16 @@ function applyEngineFonts(collected, nodeById, fontName) {
43775
44785
  }
43776
44786
  const fitNode = entry3.textNode ?? entry3.node;
43777
44787
  texts.set(fitNode, text3);
43778
- const first2 = sourceIdsOf(fitNode)[0];
43779
- if (first2 && fitNode.alg.type === "tx" && !txBySource.has(first2)) {
43780
- txBySource.set(first2, fitNode);
44788
+ const first3 = sourceIdsOf(fitNode)[0];
44789
+ if (first3 && fitNode.alg.type === "tx" && !txBySource.has(first3)) {
44790
+ txBySource.set(first3, fitNode);
43781
44791
  }
43782
44792
  }
43783
44793
  const twinOf = /* @__PURE__ */ new Map();
43784
44794
  const entries = [];
43785
44795
  for (const [node, text3] of texts) {
43786
- const first2 = sourceIdsOf(node)[0];
43787
- const twin = first2 && node.alg.type !== "tx" ? txBySource.get(first2) : void 0;
44796
+ const first3 = sourceIdsOf(node)[0];
44797
+ const twin = first3 && node.alg.type !== "tx" ? txBySource.get(first3) : void 0;
43788
44798
  if (twin && texts.has(twin)) {
43789
44799
  twinOf.set(node, twin);
43790
44800
  } else {
@@ -43806,8 +44816,8 @@ function applyEngineFonts(collected, nodeById, fontName) {
43806
44816
  const node = textNode ?? renderedNode;
43807
44817
  const pt2 = sizes.get(node) ?? 18;
43808
44818
  const text3 = texts.get(node);
43809
- const { first: first2, secondary } = text3 ? paragraphSizesPt(text3, pt2) : { first: pt2, secondary: Math.round(pt2 * DESCENDANT_FONT_SCALE) };
43810
- rendered.fontSize = first2 * PX_PER_PT5;
44819
+ const { first: first3, secondary } = text3 ? paragraphSizesPt(text3, pt2) : { first: pt2, secondary: Math.round(pt2 * DESCENDANT_FONT_SCALE) };
44820
+ rendered.fontSize = first3 * PX_PER_PT5;
43811
44821
  rendered.descendantFontSize = hasDescendants(node) ? secondary * PX_PER_PT5 : void 0;
43812
44822
  }
43813
44823
  }
@@ -49008,16 +50018,16 @@ function arrangeByChooseAwareSlots(root, flat, box, index, ctx, fontCtx) {
49008
50018
  }
49009
50019
  const fitByRole = fontCtx ? resolveFitByDeclaringRole(fontCtx, slots) : /* @__PURE__ */ new Map();
49010
50020
  return slots.map(({ rect: rect3, content: content2, node: layoutNode, declaringRole }, i2) => {
49011
- const first2 = content2[0];
50021
+ const first3 = content2[0];
49012
50022
  const fit2 = fitByRole.get(declaringRole);
49013
50023
  const rendered = {
49014
50024
  ...presetBoxNode({
49015
- key: `${ctx.elementId}-comp-choose-${first2.id}-${i2}`,
50025
+ key: `${ctx.elementId}-comp-choose-${first3.id}-${i2}`,
49016
50026
  x: rect3.x,
49017
50027
  y: rect3.y,
49018
50028
  width: rect3.width,
49019
50029
  height: rect3.height,
49020
- node: first2,
50030
+ node: first3,
49021
50031
  index: i2,
49022
50032
  total: slots.length,
49023
50033
  palette: ctx.palette,
@@ -49072,16 +50082,16 @@ function renderForEachBoundSlots(slots, flat, box, absX, absY, childrenOf, ctx,
49072
50082
  return;
49073
50083
  }
49074
50084
  const rect3 = resolveSlot(slot2.dims, box, absX, absY);
49075
- const first2 = content2[0];
50085
+ const first3 = content2[0];
49076
50086
  const index = startIndex + offset;
49077
50087
  const entry3 = {
49078
50088
  ...rectNode({
49079
- key: `${ctx.elementId}-comp-feach-${first2.id}-${index}`,
50089
+ key: `${ctx.elementId}-comp-feach-${first3.id}-${index}`,
49080
50090
  x: rect3.x,
49081
50091
  y: rect3.y,
49082
50092
  width: rect3.width,
49083
50093
  height: rect3.height,
49084
- node: first2,
50094
+ node: first3,
49085
50095
  index,
49086
50096
  total: startIndex + slots.length,
49087
50097
  palette: ctx.palette,
@@ -49491,15 +50501,15 @@ function renderAnchoredPair(node, index, total, selfSlot, selfLayoutNode, desSlo
49491
50501
  })
49492
50502
  ];
49493
50503
  if (desSlot && desSlot.content.length > 0) {
49494
- const first2 = desSlot.content[0];
50504
+ const first3 = desSlot.content[0];
49495
50505
  const rendered = {
49496
50506
  ...presetBoxNode({
49497
- key: `${ctx.elementId}-comp-des-${first2.id}-${index}`,
50507
+ key: `${ctx.elementId}-comp-des-${first3.id}-${index}`,
49498
50508
  x: desSlot.rect.x,
49499
50509
  y: desSlot.rect.y,
49500
50510
  width: desSlot.rect.width,
49501
50511
  height: desSlot.rect.height,
49502
- node: first2,
50512
+ node: first3,
49503
50513
  index,
49504
50514
  total,
49505
50515
  palette: ctx.palette,
@@ -49853,9 +50863,9 @@ function resolveHierarchyItemNode(algorithmNode) {
49853
50863
  if (candidates.length === 0) {
49854
50864
  return void 0;
49855
50865
  }
49856
- const first2 = candidates[0];
49857
- if (candidates.length < 2 || !first2) {
49858
- return first2;
50866
+ const first3 = candidates[0];
50867
+ if (candidates.length < 2 || !first3) {
50868
+ return first3;
49859
50869
  }
49860
50870
  const allNames = new Set(
49861
50871
  candidates.map((c2) => c2.name).filter((n3) => n3 !== void 0)
@@ -49870,7 +50880,7 @@ function resolveHierarchyItemNode(algorithmNode) {
49870
50880
  return candidate;
49871
50881
  }
49872
50882
  }
49873
- return first2;
50883
+ return first3;
49874
50884
  }
49875
50885
 
49876
50886
  // diagram/hierarchy/smartart-hierarchy-shared.ts
@@ -52601,10 +53611,10 @@ function projectDiagramNodeText(node, styler, fallbackStyle, options2 = {}) {
52601
53611
  paragraphIndex,
52602
53612
  options2.bulletEnabled ?? false
52603
53613
  );
52604
- let first2 = true;
53614
+ let first3 = true;
52605
53615
  const push = (segment2) => {
52606
- segments.push(first2 ? { ...segment2, ...metadata } : segment2);
52607
- first2 = false;
53616
+ segments.push(first3 ? { ...segment2, ...metadata } : segment2);
53617
+ first3 = false;
52608
53618
  };
52609
53619
  for (const item2 of paragraph2.items) {
52610
53620
  if (item2.kind === "run") {
@@ -52628,7 +53638,7 @@ function projectDiagramNodeText(node, styler, fallbackStyle, options2 = {}) {
52628
53638
  push({ text: " ", style: pStyle });
52629
53639
  }
52630
53640
  }
52631
- if (first2) {
53641
+ if (first3) {
52632
53642
  push({ text: "", style: styler.endParagraphStyle(paragraph2, pStyle) });
52633
53643
  }
52634
53644
  if (paragraphIndex < paragraphs.length - 1) {
@@ -54975,7 +55985,7 @@ function parseDiagramLayoutSummary(source2) {
54975
55985
 
54976
55986
  // diagram/drawing-from-views.ts
54977
55987
  var scheme = (value) => ({ kind: "scheme", value, transforms: [] });
54978
- var srgb2 = (hex) => ({
55988
+ var srgb3 = (hex) => ({
54979
55989
  kind: "srgb",
54980
55990
  value: hex.replace("#", "").toUpperCase(),
54981
55991
  transforms: []
@@ -54986,11 +55996,11 @@ function diagramDrawingFromViews(views, options2 = {}) {
54986
55996
  let filled = 0;
54987
55997
  const shapes2 = views.map((view) => {
54988
55998
  const themed = !view.fillColor && !view.fillNone;
54989
- const fill = view.fillColor ? srgb2(view.fillColor) : scheme(accents[filled++ % accents.length]);
55999
+ const fill = view.fillColor ? srgb3(view.fillColor) : scheme(accents[filled++ % accents.length]);
54990
56000
  if (view.fillOpacity !== void 0 && view.fillOpacity < 1)
54991
56001
  fill.transforms.push({ name: "alpha", value: String(Math.round(view.fillOpacity * 1e5)) });
54992
56002
  const text3 = view.text?.trim() ? view.text : "";
54993
- const textColor = view.fontColor ? srgb2(view.fontColor) : scheme(themed ? "lt1" : "tx1");
56003
+ const textColor = view.fontColor ? srgb3(view.fontColor) : scheme(themed ? "lt1" : "tx1");
54994
56004
  return {
54995
56005
  modelId: view.id,
54996
56006
  frame: {
@@ -55005,7 +56015,7 @@ function diagramDrawingFromViews(views, options2 = {}) {
55005
56015
  fill: view.fillNone ? { kind: "none" } : { kind: "solid", color: fill },
55006
56016
  line: {
55007
56017
  widthEmu: view.strokeWidth === void 0 ? 12700 : view.strokeWidth * 12700,
55008
- fill: view.strokeColor === "none" ? { kind: "none" } : { kind: "solid", color: view.strokeColor ? srgb2(view.strokeColor) : scheme("lt1") }
56018
+ fill: view.strokeColor === "none" ? { kind: "none" } : { kind: "solid", color: view.strokeColor ? srgb3(view.strokeColor) : scheme("lt1") }
55009
56019
  },
55010
56020
  ...text3 ? {
55011
56021
  text: {
@@ -55366,64 +56376,6 @@ async function clonePartGraph(options2) {
55366
56376
  return copies;
55367
56377
  }
55368
56378
 
55369
- // opc/safe-href.ts
55370
- var SAFE_SCHEMES = /* @__PURE__ */ new Set(["http:", "https:", "mailto:"]);
55371
- function isSafeHyperlinkHref(href) {
55372
- const scheme2 = /^([a-z][a-z0-9+.-]*:)/i.exec(href.trim())?.[1];
55373
- return scheme2 !== void 0 && SAFE_SCHEMES.has(scheme2.toLowerCase());
55374
- }
55375
- var OPEN_SCHEMES = /* @__PURE__ */ new Set(["http", "https", "mailto"]);
55376
- var STORE_SCHEMES = /* @__PURE__ */ new Set([...OPEN_SCHEMES, "ftp", "file"]);
55377
- var SCRIPT_SCHEMES = /* @__PURE__ */ new Set([
55378
- "javascript",
55379
- "vbscript",
55380
- "livescript",
55381
- "jscript",
55382
- "mocha",
55383
- "data",
55384
- "mhtml",
55385
- "ms-its",
55386
- "mk",
55387
- "x-javascript",
55388
- "blob"
55389
- ]);
55390
- var IGNORABLE = new RegExp(
55391
- "[\\u0000-\\u0020\\u007f\\u00ad\\u200b-\\u200f\\u202a-\\u202e\\u2060-\\u2064\\ufeff]",
55392
- "gu"
55393
- );
55394
- var CONTROL = new RegExp("[\\u0000-\\u001f\\u007f]", "u");
55395
- var SCHEME = /^([a-z][a-z0-9+.-]*):/;
55396
- var STORE_ONLY = { store: true, open: false, reason: "not-openable" };
55397
- var reject = (reason) => ({
55398
- store: false,
55399
- open: false,
55400
- reason
55401
- });
55402
- function hyperlinkPolicy(href, options2 = {}) {
55403
- if (typeof href !== "string") return reject("empty");
55404
- const trimmed = href.trim();
55405
- const normalized = trimmed.replace(IGNORABLE, "").toLowerCase();
55406
- if (normalized.length === 0) return reject("empty");
55407
- const scheme2 = SCHEME.exec(normalized)?.[1];
55408
- if (scheme2 !== void 0 && SCRIPT_SCHEMES.has(scheme2)) return reject("script-scheme");
55409
- if (scheme2 !== void 0 && !trimmed.toLowerCase().startsWith(`${scheme2}:`))
55410
- return reject("obfuscated-scheme");
55411
- if (CONTROL.test(trimmed)) return reject("control-characters");
55412
- if (scheme2 === void 0) return options2.openRelative ? { store: true, open: true } : STORE_ONLY;
55413
- if (scheme2.length === 1) return STORE_ONLY;
55414
- if (OPEN_SCHEMES.has(scheme2)) return { store: true, open: true };
55415
- if (options2.additionalOpenSchemes?.some((allowed) => allowed.toLowerCase() === scheme2))
55416
- return { store: true, open: true };
55417
- if (STORE_SCHEMES.has(scheme2)) return STORE_ONLY;
55418
- return reject("unsupported-scheme");
55419
- }
55420
- function isStorableHyperlinkHref(href, options2) {
55421
- return hyperlinkPolicy(href, options2).store;
55422
- }
55423
- function isOpenableHyperlinkHref(href, options2) {
55424
- return hyperlinkPolicy(href, options2).open;
55425
- }
55426
-
55427
56379
  // opc/embedded-packages.ts
55428
56380
  var EMBEDDED_ZIP_LIMITS = {
55429
56381
  label: "Embedded",
@@ -55476,7 +56428,7 @@ var PROPERTY_CONTENT_TYPES = {
55476
56428
 
55477
56429
  // opc/properties/patch.ts
55478
56430
  var XMLNS = "http://www.w3.org/2000/xmlns/";
55479
- function tagEnd2(xml2, from) {
56431
+ function tagEnd3(xml2, from) {
55480
56432
  let quote = "";
55481
56433
  for (let i2 = from + 1; i2 < xml2.length; i2++) {
55482
56434
  const ch = xml2[i2];
@@ -55503,7 +56455,7 @@ function scan(xml2) {
55503
56455
  if (skipped !== void 0) i2 = skipped;
55504
56456
  else rootStart = lt;
55505
56457
  }
55506
- const openEnd = tagEnd2(xml2, rootStart);
56458
+ const openEnd = tagEnd3(xml2, rootStart);
55507
56459
  if (xml2[openEnd - 2] === "/") {
55508
56460
  const root = {
55509
56461
  start: rootStart,
@@ -55526,7 +56478,7 @@ function scan(xml2) {
55526
56478
  i2 = skipped;
55527
56479
  continue;
55528
56480
  }
55529
- const end = tagEnd2(xml2, lt);
56481
+ const end = tagEnd3(xml2, lt);
55530
56482
  i2 = end;
55531
56483
  if (xml2[lt + 1] === "/") {
55532
56484
  if (depth === 0) {
@@ -60566,9 +61518,9 @@ function buildCalloutLeaderLineSvgPath(geometry) {
60566
61518
  if (geometry.points.length < 2) {
60567
61519
  return "";
60568
61520
  }
60569
- const first2 = at(geometry.points, 0);
61521
+ const first3 = at(geometry.points, 0);
60570
61522
  const rest = geometry.points.slice(1);
60571
- const parts = [`M ${first2.x} ${first2.y}`];
61523
+ const parts = [`M ${first3.x} ${first3.y}`];
60572
61524
  for (const pt2 of rest) {
60573
61525
  parts.push(`L ${pt2.x} ${pt2.y}`);
60574
61526
  }
@@ -66439,9 +67391,9 @@ function svgPathToSegments(d) {
66439
67391
  let lastCubic;
66440
67392
  let lastQuad;
66441
67393
  const tokens = tokenizeSvgPath(d, { strict: true });
66442
- const first2 = tokens[0];
66443
- if (first2 && first2.type.toUpperCase() !== "M") {
66444
- throw new SyntaxError(`SVG path data must start with a moveto, not ${first2.type}`);
67394
+ const first3 = tokens[0];
67395
+ if (first3 && first3.type.toUpperCase() !== "M") {
67396
+ throw new SyntaxError(`SVG path data must start with a moveto, not ${first3.type}`);
66445
67397
  }
66446
67398
  for (const { type, values } of tokens) {
66447
67399
  const upper = type.toUpperCase();
@@ -66825,11 +67777,11 @@ function distributeElements(elements3, axis2, options2) {
66825
67777
  if (sorted.length < 3) {
66826
67778
  return result;
66827
67779
  }
66828
- const first2 = sorted[0];
67780
+ const first3 = sorted[0];
66829
67781
  const last = sorted[sorted.length - 1];
66830
- const span = start(last) + size(last) - start(first2);
67782
+ const span = start(last) + size(last) - start(first3);
66831
67783
  gap = (span - totalSize) / (sorted.length - 1);
66832
- cursor = start(first2);
67784
+ cursor = start(first3);
66833
67785
  }
66834
67786
  for (const el of sorted) {
66835
67787
  result.set(el.id, horizontal ? { x: cursor } : { y: cursor });