open-agreements 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (429) hide show
  1. package/content/templates/closing-checklist/template.docx +0 -0
  2. package/dist/core/checklist/docx-import.d.ts +50 -0
  3. package/dist/core/checklist/docx-import.d.ts.map +1 -0
  4. package/dist/core/checklist/docx-import.js +613 -0
  5. package/dist/core/checklist/docx-import.js.map +1 -0
  6. package/dist/core/checklist/docx-table-helpers.d.ts +33 -0
  7. package/dist/core/checklist/docx-table-helpers.d.ts.map +1 -0
  8. package/dist/core/checklist/docx-table-helpers.js +154 -0
  9. package/dist/core/checklist/docx-table-helpers.js.map +1 -0
  10. package/dist/core/checklist/format-checklist-docx.d.ts.map +1 -1
  11. package/dist/core/checklist/format-checklist-docx.js +37 -88
  12. package/dist/core/checklist/format-checklist-docx.js.map +1 -1
  13. package/dist/core/checklist/index.d.ts +15 -12
  14. package/dist/core/checklist/index.d.ts.map +1 -1
  15. package/dist/core/checklist/index.js +48 -30
  16. package/dist/core/checklist/index.js.map +1 -1
  17. package/dist/core/checklist/status-labels.d.ts +6 -0
  18. package/dist/core/checklist/status-labels.d.ts.map +1 -1
  19. package/dist/core/checklist/status-labels.js +8 -0
  20. package/dist/core/checklist/status-labels.js.map +1 -1
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +1 -1
  24. package/dist/index.js.map +1 -1
  25. package/node_modules/@usejunior/docx-core/dist/atomizer.d.ts +218 -0
  26. package/node_modules/@usejunior/docx-core/dist/atomizer.d.ts.map +1 -0
  27. package/node_modules/@usejunior/docx-core/dist/atomizer.js +869 -0
  28. package/node_modules/@usejunior/docx-core/dist/atomizer.js.map +1 -0
  29. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/atomLcs.d.ts +96 -0
  30. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/atomLcs.d.ts.map +1 -0
  31. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/atomLcs.js +347 -0
  32. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/atomLcs.js.map +1 -0
  33. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/consumerCompatibility.d.ts +2 -0
  34. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/consumerCompatibility.d.ts.map +1 -0
  35. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/consumerCompatibility.js +188 -0
  36. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/consumerCompatibility.js.map +1 -0
  37. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/debug.d.ts +41 -0
  38. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/debug.d.ts.map +1 -0
  39. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/debug.js +85 -0
  40. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/debug.js.map +1 -0
  41. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.d.ts +64 -0
  42. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.d.ts.map +1 -0
  43. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.js +985 -0
  44. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.js.map +1 -0
  45. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/hierarchicalLcs.d.ts +111 -0
  46. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/hierarchicalLcs.d.ts.map +1 -0
  47. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/hierarchicalLcs.js +469 -0
  48. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/hierarchicalLcs.js.map +1 -0
  49. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.d.ts +277 -0
  50. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.d.ts.map +1 -0
  51. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.js +2279 -0
  52. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.js.map +1 -0
  53. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/numberingIntegration.d.ts +59 -0
  54. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/numberingIntegration.d.ts.map +1 -0
  55. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/numberingIntegration.js +209 -0
  56. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/numberingIntegration.js.map +1 -0
  57. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.d.ts +69 -0
  58. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.d.ts.map +1 -0
  59. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.js +910 -0
  60. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.js.map +1 -0
  61. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/premergeRuns.d.ts +26 -0
  62. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/premergeRuns.d.ts.map +1 -0
  63. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/premergeRuns.js +153 -0
  64. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/premergeRuns.js.map +1 -0
  65. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptor.d.ts +63 -0
  66. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptor.d.ts.map +1 -0
  67. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptor.js +254 -0
  68. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptor.js.map +1 -0
  69. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.d.ts +64 -0
  70. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.d.ts.map +1 -0
  71. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.js +616 -0
  72. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.js.map +1 -0
  73. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/xmlToWmlElement.d.ts +65 -0
  74. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/xmlToWmlElement.d.ts.map +1 -0
  75. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/xmlToWmlElement.js +95 -0
  76. package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/xmlToWmlElement.js.map +1 -0
  77. package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DocxodusWasm.d.ts +51 -0
  78. package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DocxodusWasm.d.ts.map +1 -0
  79. package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DocxodusWasm.js +83 -0
  80. package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DocxodusWasm.js.map +1 -0
  81. package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.d.ts +40 -0
  82. package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.d.ts.map +1 -0
  83. package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.js +135 -0
  84. package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.js.map +1 -0
  85. package/node_modules/@usejunior/docx-core/dist/cli/compare-two.d.ts +28 -0
  86. package/node_modules/@usejunior/docx-core/dist/cli/compare-two.d.ts.map +1 -0
  87. package/node_modules/@usejunior/docx-core/dist/cli/compare-two.js +110 -0
  88. package/node_modules/@usejunior/docx-core/dist/cli/compare-two.js.map +1 -0
  89. package/node_modules/@usejunior/docx-core/dist/cli/index.d.ts +3 -0
  90. package/node_modules/@usejunior/docx-core/dist/cli/index.d.ts.map +1 -0
  91. package/node_modules/@usejunior/docx-core/dist/cli/index.js +21 -0
  92. package/node_modules/@usejunior/docx-core/dist/cli/index.js.map +1 -0
  93. package/node_modules/@usejunior/docx-core/dist/core-types.d.ts +296 -0
  94. package/node_modules/@usejunior/docx-core/dist/core-types.d.ts.map +1 -0
  95. package/node_modules/@usejunior/docx-core/dist/core-types.js +122 -0
  96. package/node_modules/@usejunior/docx-core/dist/core-types.js.map +1 -0
  97. package/node_modules/@usejunior/docx-core/dist/footnotes.d.ts +144 -0
  98. package/node_modules/@usejunior/docx-core/dist/footnotes.d.ts.map +1 -0
  99. package/node_modules/@usejunior/docx-core/dist/footnotes.js +291 -0
  100. package/node_modules/@usejunior/docx-core/dist/footnotes.js.map +1 -0
  101. package/node_modules/@usejunior/docx-core/dist/format-detection.d.ts +120 -0
  102. package/node_modules/@usejunior/docx-core/dist/format-detection.d.ts.map +1 -0
  103. package/node_modules/@usejunior/docx-core/dist/format-detection.js +338 -0
  104. package/node_modules/@usejunior/docx-core/dist/format-detection.js.map +1 -0
  105. package/node_modules/@usejunior/docx-core/dist/index.d.ts +177 -0
  106. package/node_modules/@usejunior/docx-core/dist/index.d.ts.map +1 -0
  107. package/node_modules/@usejunior/docx-core/dist/index.js +55 -0
  108. package/node_modules/@usejunior/docx-core/dist/index.js.map +1 -0
  109. package/node_modules/@usejunior/docx-core/dist/integration/output-artifacts.d.ts +6 -0
  110. package/node_modules/@usejunior/docx-core/dist/integration/output-artifacts.d.ts.map +1 -0
  111. package/node_modules/@usejunior/docx-core/dist/integration/output-artifacts.js +30 -0
  112. package/node_modules/@usejunior/docx-core/dist/integration/output-artifacts.js.map +1 -0
  113. package/node_modules/@usejunior/docx-core/dist/move-detection.d.ts +211 -0
  114. package/node_modules/@usejunior/docx-core/dist/move-detection.d.ts.map +1 -0
  115. package/node_modules/@usejunior/docx-core/dist/move-detection.js +391 -0
  116. package/node_modules/@usejunior/docx-core/dist/move-detection.js.map +1 -0
  117. package/node_modules/@usejunior/docx-core/dist/numbering.d.ts +136 -0
  118. package/node_modules/@usejunior/docx-core/dist/numbering.d.ts.map +1 -0
  119. package/node_modules/@usejunior/docx-core/dist/numbering.js +446 -0
  120. package/node_modules/@usejunior/docx-core/dist/numbering.js.map +1 -0
  121. package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.d.ts +30 -0
  122. package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.d.ts.map +1 -0
  123. package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.js +241 -0
  124. package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.js.map +1 -0
  125. package/node_modules/@usejunior/docx-core/dist/primitives/bookmarks.d.ts +12 -0
  126. package/node_modules/@usejunior/docx-core/dist/primitives/bookmarks.d.ts.map +1 -0
  127. package/node_modules/@usejunior/docx-core/dist/primitives/bookmarks.js +248 -0
  128. package/node_modules/@usejunior/docx-core/dist/primitives/bookmarks.js.map +1 -0
  129. package/node_modules/@usejunior/docx-core/dist/primitives/comments.d.ts +88 -0
  130. package/node_modules/@usejunior/docx-core/dist/primitives/comments.d.ts.map +1 -0
  131. package/node_modules/@usejunior/docx-core/dist/primitives/comments.js +703 -0
  132. package/node_modules/@usejunior/docx-core/dist/primitives/comments.js.map +1 -0
  133. package/node_modules/@usejunior/docx-core/dist/primitives/document.d.ts +186 -0
  134. package/node_modules/@usejunior/docx-core/dist/primitives/document.d.ts.map +1 -0
  135. package/node_modules/@usejunior/docx-core/dist/primitives/document.js +555 -0
  136. package/node_modules/@usejunior/docx-core/dist/primitives/document.js.map +1 -0
  137. package/node_modules/@usejunior/docx-core/dist/primitives/document_view.d.ts +97 -0
  138. package/node_modules/@usejunior/docx-core/dist/primitives/document_view.d.ts.map +1 -0
  139. package/node_modules/@usejunior/docx-core/dist/primitives/document_view.js +749 -0
  140. package/node_modules/@usejunior/docx-core/dist/primitives/document_view.js.map +1 -0
  141. package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.d.ts +94 -0
  142. package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.d.ts.map +1 -0
  143. package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.js +219 -0
  144. package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.js.map +1 -0
  145. package/node_modules/@usejunior/docx-core/dist/primitives/errors.d.ts +7 -0
  146. package/node_modules/@usejunior/docx-core/dist/primitives/errors.d.ts.map +1 -0
  147. package/node_modules/@usejunior/docx-core/dist/primitives/errors.js +10 -0
  148. package/node_modules/@usejunior/docx-core/dist/primitives/errors.js.map +1 -0
  149. package/node_modules/@usejunior/docx-core/dist/primitives/extract_revisions.d.ts +50 -0
  150. package/node_modules/@usejunior/docx-core/dist/primitives/extract_revisions.d.ts.map +1 -0
  151. package/node_modules/@usejunior/docx-core/dist/primitives/extract_revisions.js +340 -0
  152. package/node_modules/@usejunior/docx-core/dist/primitives/extract_revisions.js.map +1 -0
  153. package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.d.ts +37 -0
  154. package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.d.ts.map +1 -0
  155. package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.js +552 -0
  156. package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.js.map +1 -0
  157. package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.d.ts +43 -0
  158. package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.d.ts.map +1 -0
  159. package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.js +291 -0
  160. package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.js.map +1 -0
  161. package/node_modules/@usejunior/docx-core/dist/primitives/index.d.ts +27 -0
  162. package/node_modules/@usejunior/docx-core/dist/primitives/index.d.ts.map +1 -0
  163. package/node_modules/@usejunior/docx-core/dist/primitives/index.js +27 -0
  164. package/node_modules/@usejunior/docx-core/dist/primitives/index.js.map +1 -0
  165. package/node_modules/@usejunior/docx-core/dist/primitives/layout.d.ts +53 -0
  166. package/node_modules/@usejunior/docx-core/dist/primitives/layout.d.ts.map +1 -0
  167. package/node_modules/@usejunior/docx-core/dist/primitives/layout.js +178 -0
  168. package/node_modules/@usejunior/docx-core/dist/primitives/layout.js.map +1 -0
  169. package/node_modules/@usejunior/docx-core/dist/primitives/list_labels.d.ts +19 -0
  170. package/node_modules/@usejunior/docx-core/dist/primitives/list_labels.d.ts.map +1 -0
  171. package/node_modules/@usejunior/docx-core/dist/primitives/list_labels.js +57 -0
  172. package/node_modules/@usejunior/docx-core/dist/primitives/list_labels.js.map +1 -0
  173. package/node_modules/@usejunior/docx-core/dist/primitives/matching.d.ts +31 -0
  174. package/node_modules/@usejunior/docx-core/dist/primitives/matching.d.ts.map +1 -0
  175. package/node_modules/@usejunior/docx-core/dist/primitives/matching.js +223 -0
  176. package/node_modules/@usejunior/docx-core/dist/primitives/matching.js.map +1 -0
  177. package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.d.ts +23 -0
  178. package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.d.ts.map +1 -0
  179. package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.js +243 -0
  180. package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.js.map +1 -0
  181. package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.d.ts +91 -0
  182. package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.d.ts.map +1 -0
  183. package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.js +108 -0
  184. package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.js.map +1 -0
  185. package/node_modules/@usejunior/docx-core/dist/primitives/numbering.d.ts +27 -0
  186. package/node_modules/@usejunior/docx-core/dist/primitives/numbering.d.ts.map +1 -0
  187. package/node_modules/@usejunior/docx-core/dist/primitives/numbering.js +182 -0
  188. package/node_modules/@usejunior/docx-core/dist/primitives/numbering.js.map +1 -0
  189. package/node_modules/@usejunior/docx-core/dist/primitives/prevent_double_elevation.d.ts +18 -0
  190. package/node_modules/@usejunior/docx-core/dist/primitives/prevent_double_elevation.d.ts.map +1 -0
  191. package/node_modules/@usejunior/docx-core/dist/primitives/prevent_double_elevation.js +190 -0
  192. package/node_modules/@usejunior/docx-core/dist/primitives/prevent_double_elevation.js.map +1 -0
  193. package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.d.ts +27 -0
  194. package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.d.ts.map +1 -0
  195. package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.js +371 -0
  196. package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.js.map +1 -0
  197. package/node_modules/@usejunior/docx-core/dist/primitives/relationships.d.ts +7 -0
  198. package/node_modules/@usejunior/docx-core/dist/primitives/relationships.d.ts.map +1 -0
  199. package/node_modules/@usejunior/docx-core/dist/primitives/relationships.js +24 -0
  200. package/node_modules/@usejunior/docx-core/dist/primitives/relationships.js.map +1 -0
  201. package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.d.ts +17 -0
  202. package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.d.ts.map +1 -0
  203. package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.js +58 -0
  204. package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.js.map +1 -0
  205. package/node_modules/@usejunior/docx-core/dist/primitives/simplify_redlines.d.ts +19 -0
  206. package/node_modules/@usejunior/docx-core/dist/primitives/simplify_redlines.d.ts.map +1 -0
  207. package/node_modules/@usejunior/docx-core/dist/primitives/simplify_redlines.js +94 -0
  208. package/node_modules/@usejunior/docx-core/dist/primitives/simplify_redlines.js.map +1 -0
  209. package/node_modules/@usejunior/docx-core/dist/primitives/styles.d.ts +36 -0
  210. package/node_modules/@usejunior/docx-core/dist/primitives/styles.d.ts.map +1 -0
  211. package/node_modules/@usejunior/docx-core/dist/primitives/styles.js +205 -0
  212. package/node_modules/@usejunior/docx-core/dist/primitives/styles.js.map +1 -0
  213. package/node_modules/@usejunior/docx-core/dist/primitives/tables.d.ts +54 -0
  214. package/node_modules/@usejunior/docx-core/dist/primitives/tables.d.ts.map +1 -0
  215. package/node_modules/@usejunior/docx-core/dist/primitives/tables.js +205 -0
  216. package/node_modules/@usejunior/docx-core/dist/primitives/tables.js.map +1 -0
  217. package/node_modules/@usejunior/docx-core/dist/primitives/text.d.ts +30 -0
  218. package/node_modules/@usejunior/docx-core/dist/primitives/text.d.ts.map +1 -0
  219. package/node_modules/@usejunior/docx-core/dist/primitives/text.js +461 -0
  220. package/node_modules/@usejunior/docx-core/dist/primitives/text.js.map +1 -0
  221. package/node_modules/@usejunior/docx-core/dist/primitives/validate_document.d.ts +24 -0
  222. package/node_modules/@usejunior/docx-core/dist/primitives/validate_document.d.ts.map +1 -0
  223. package/node_modules/@usejunior/docx-core/dist/primitives/validate_document.js +147 -0
  224. package/node_modules/@usejunior/docx-core/dist/primitives/validate_document.js.map +1 -0
  225. package/node_modules/@usejunior/docx-core/dist/primitives/xml.d.ts +5 -0
  226. package/node_modules/@usejunior/docx-core/dist/primitives/xml.d.ts.map +1 -0
  227. package/node_modules/@usejunior/docx-core/dist/primitives/xml.js +19 -0
  228. package/node_modules/@usejunior/docx-core/dist/primitives/xml.js.map +1 -0
  229. package/node_modules/@usejunior/docx-core/dist/primitives/zip.d.ts +25 -0
  230. package/node_modules/@usejunior/docx-core/dist/primitives/zip.d.ts.map +1 -0
  231. package/node_modules/@usejunior/docx-core/dist/primitives/zip.js +78 -0
  232. package/node_modules/@usejunior/docx-core/dist/primitives/zip.js.map +1 -0
  233. package/node_modules/@usejunior/docx-core/dist/shared/docx/DocxArchive.d.ts +94 -0
  234. package/node_modules/@usejunior/docx-core/dist/shared/docx/DocxArchive.d.ts.map +1 -0
  235. package/node_modules/@usejunior/docx-core/dist/shared/docx/DocxArchive.js +169 -0
  236. package/node_modules/@usejunior/docx-core/dist/shared/docx/DocxArchive.js.map +1 -0
  237. package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.d.ts +149 -0
  238. package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.d.ts.map +1 -0
  239. package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.js +224 -0
  240. package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.js.map +1 -0
  241. package/node_modules/@usejunior/docx-core/dist/shared/ooxml/types.d.ts +136 -0
  242. package/node_modules/@usejunior/docx-core/dist/shared/ooxml/types.d.ts.map +1 -0
  243. package/node_modules/@usejunior/docx-core/dist/shared/ooxml/types.js +7 -0
  244. package/node_modules/@usejunior/docx-core/dist/shared/ooxml/types.js.map +1 -0
  245. package/node_modules/@usejunior/docx-core/dist/shared/validators/structural.d.ts +31 -0
  246. package/node_modules/@usejunior/docx-core/dist/shared/validators/structural.d.ts.map +1 -0
  247. package/node_modules/@usejunior/docx-core/dist/shared/validators/structural.js +110 -0
  248. package/node_modules/@usejunior/docx-core/dist/shared/validators/structural.js.map +1 -0
  249. package/node_modules/@usejunior/docx-core/package.json +26 -0
  250. package/node_modules/core-util-is/LICENSE +19 -0
  251. package/node_modules/core-util-is/README.md +3 -0
  252. package/node_modules/core-util-is/lib/util.js +107 -0
  253. package/node_modules/core-util-is/package.json +38 -0
  254. package/node_modules/diff-match-patch/LICENSE +202 -0
  255. package/node_modules/diff-match-patch/README.md +94 -0
  256. package/node_modules/diff-match-patch/index.js +2218 -0
  257. package/node_modules/diff-match-patch/package.json +22 -0
  258. package/node_modules/immediate/LICENSE.txt +20 -0
  259. package/node_modules/immediate/README.md +93 -0
  260. package/node_modules/immediate/dist/immediate.js +75 -0
  261. package/node_modules/immediate/dist/immediate.min.js +1 -0
  262. package/node_modules/immediate/lib/browser.js +69 -0
  263. package/node_modules/immediate/lib/index.js +73 -0
  264. package/node_modules/immediate/package.json +42 -0
  265. package/node_modules/inherits/LICENSE +16 -0
  266. package/node_modules/inherits/README.md +42 -0
  267. package/node_modules/inherits/inherits.js +9 -0
  268. package/node_modules/inherits/inherits_browser.js +27 -0
  269. package/node_modules/inherits/package.json +29 -0
  270. package/node_modules/isarray/.npmignore +1 -0
  271. package/node_modules/isarray/.travis.yml +4 -0
  272. package/node_modules/isarray/Makefile +6 -0
  273. package/node_modules/isarray/README.md +60 -0
  274. package/node_modules/isarray/component.json +19 -0
  275. package/node_modules/isarray/index.js +5 -0
  276. package/node_modules/isarray/package.json +45 -0
  277. package/node_modules/isarray/test.js +20 -0
  278. package/node_modules/jszip/.codeclimate.yml +16 -0
  279. package/node_modules/jszip/.editorconfig +8 -0
  280. package/node_modules/jszip/.eslintrc.js +43 -0
  281. package/node_modules/jszip/.github/workflows/pr.yaml +58 -0
  282. package/node_modules/jszip/.jekyll-metadata +0 -0
  283. package/node_modules/jszip/.travis.yml +17 -0
  284. package/node_modules/jszip/CHANGES.md +204 -0
  285. package/node_modules/jszip/LICENSE.markdown +651 -0
  286. package/node_modules/jszip/README.markdown +33 -0
  287. package/node_modules/jszip/deps.js +37 -0
  288. package/node_modules/jszip/dist/jszip.js +11577 -0
  289. package/node_modules/jszip/dist/jszip.min.js +13 -0
  290. package/node_modules/jszip/graph.svg +601 -0
  291. package/node_modules/jszip/index.d.ts +330 -0
  292. package/node_modules/jszip/lib/base64.js +106 -0
  293. package/node_modules/jszip/lib/compressedObject.js +74 -0
  294. package/node_modules/jszip/lib/compressions.js +14 -0
  295. package/node_modules/jszip/lib/crc32.js +77 -0
  296. package/node_modules/jszip/lib/defaults.js +11 -0
  297. package/node_modules/jszip/lib/external.js +18 -0
  298. package/node_modules/jszip/lib/flate.js +85 -0
  299. package/node_modules/jszip/lib/generate/ZipFileWorker.js +539 -0
  300. package/node_modules/jszip/lib/generate/index.js +57 -0
  301. package/node_modules/jszip/lib/index.js +55 -0
  302. package/node_modules/jszip/lib/license_header.js +11 -0
  303. package/node_modules/jszip/lib/load.js +88 -0
  304. package/node_modules/jszip/lib/nodejs/NodejsStreamInputAdapter.js +74 -0
  305. package/node_modules/jszip/lib/nodejs/NodejsStreamOutputAdapter.js +42 -0
  306. package/node_modules/jszip/lib/nodejsUtils.js +57 -0
  307. package/node_modules/jszip/lib/object.js +384 -0
  308. package/node_modules/jszip/lib/readable-stream-browser.js +10 -0
  309. package/node_modules/jszip/lib/reader/ArrayReader.js +57 -0
  310. package/node_modules/jszip/lib/reader/DataReader.js +116 -0
  311. package/node_modules/jszip/lib/reader/NodeBufferReader.js +19 -0
  312. package/node_modules/jszip/lib/reader/StringReader.js +38 -0
  313. package/node_modules/jszip/lib/reader/Uint8ArrayReader.js +22 -0
  314. package/node_modules/jszip/lib/reader/readerFor.js +28 -0
  315. package/node_modules/jszip/lib/signature.js +7 -0
  316. package/node_modules/jszip/lib/stream/ConvertWorker.js +26 -0
  317. package/node_modules/jszip/lib/stream/Crc32Probe.js +24 -0
  318. package/node_modules/jszip/lib/stream/DataLengthProbe.js +29 -0
  319. package/node_modules/jszip/lib/stream/DataWorker.js +116 -0
  320. package/node_modules/jszip/lib/stream/GenericWorker.js +263 -0
  321. package/node_modules/jszip/lib/stream/StreamHelper.js +214 -0
  322. package/node_modules/jszip/lib/support.js +38 -0
  323. package/node_modules/jszip/lib/utf8.js +275 -0
  324. package/node_modules/jszip/lib/utils.js +501 -0
  325. package/node_modules/jszip/lib/zipEntries.js +261 -0
  326. package/node_modules/jszip/lib/zipEntry.js +293 -0
  327. package/node_modules/jszip/lib/zipObject.js +133 -0
  328. package/node_modules/jszip/package.json +67 -0
  329. package/node_modules/jszip/sponsors.md +21 -0
  330. package/node_modules/jszip/tsconfig.json +101 -0
  331. package/node_modules/jszip/vendor/FileSaver.js +247 -0
  332. package/node_modules/lie/README.md +62 -0
  333. package/node_modules/lie/dist/lie.js +350 -0
  334. package/node_modules/lie/dist/lie.min.js +1 -0
  335. package/node_modules/lie/dist/lie.polyfill.js +358 -0
  336. package/node_modules/lie/dist/lie.polyfill.min.js +1 -0
  337. package/node_modules/lie/lib/browser.js +273 -0
  338. package/node_modules/lie/lib/index.js +298 -0
  339. package/node_modules/lie/license.md +7 -0
  340. package/node_modules/lie/lie.d.ts +244 -0
  341. package/node_modules/lie/package.json +69 -0
  342. package/node_modules/lie/polyfill.js +4 -0
  343. package/node_modules/pako/LICENSE +21 -0
  344. package/node_modules/pako/README.md +191 -0
  345. package/node_modules/pako/dist/pako.js +6818 -0
  346. package/node_modules/pako/dist/pako.min.js +1 -0
  347. package/node_modules/pako/dist/pako_deflate.js +3997 -0
  348. package/node_modules/pako/dist/pako_deflate.min.js +1 -0
  349. package/node_modules/pako/dist/pako_inflate.js +3300 -0
  350. package/node_modules/pako/dist/pako_inflate.min.js +1 -0
  351. package/node_modules/pako/index.js +14 -0
  352. package/node_modules/pako/lib/deflate.js +400 -0
  353. package/node_modules/pako/lib/inflate.js +423 -0
  354. package/node_modules/pako/lib/utils/common.js +105 -0
  355. package/node_modules/pako/lib/utils/strings.js +187 -0
  356. package/node_modules/pako/lib/zlib/README +59 -0
  357. package/node_modules/pako/lib/zlib/adler32.js +51 -0
  358. package/node_modules/pako/lib/zlib/constants.js +68 -0
  359. package/node_modules/pako/lib/zlib/crc32.js +59 -0
  360. package/node_modules/pako/lib/zlib/deflate.js +1874 -0
  361. package/node_modules/pako/lib/zlib/gzheader.js +58 -0
  362. package/node_modules/pako/lib/zlib/inffast.js +345 -0
  363. package/node_modules/pako/lib/zlib/inflate.js +1556 -0
  364. package/node_modules/pako/lib/zlib/inftrees.js +343 -0
  365. package/node_modules/pako/lib/zlib/messages.js +32 -0
  366. package/node_modules/pako/lib/zlib/trees.js +1222 -0
  367. package/node_modules/pako/lib/zlib/zstream.js +47 -0
  368. package/node_modules/pako/package.json +44 -0
  369. package/node_modules/process-nextick-args/index.js +45 -0
  370. package/node_modules/process-nextick-args/license.md +19 -0
  371. package/node_modules/process-nextick-args/package.json +25 -0
  372. package/node_modules/process-nextick-args/readme.md +18 -0
  373. package/node_modules/readable-stream/.travis.yml +34 -0
  374. package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
  375. package/node_modules/readable-stream/GOVERNANCE.md +136 -0
  376. package/node_modules/readable-stream/LICENSE +47 -0
  377. package/node_modules/readable-stream/README.md +58 -0
  378. package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
  379. package/node_modules/readable-stream/duplex-browser.js +1 -0
  380. package/node_modules/readable-stream/duplex.js +1 -0
  381. package/node_modules/readable-stream/lib/_stream_duplex.js +131 -0
  382. package/node_modules/readable-stream/lib/_stream_passthrough.js +47 -0
  383. package/node_modules/readable-stream/lib/_stream_readable.js +1019 -0
  384. package/node_modules/readable-stream/lib/_stream_transform.js +214 -0
  385. package/node_modules/readable-stream/lib/_stream_writable.js +685 -0
  386. package/node_modules/readable-stream/lib/internal/streams/BufferList.js +78 -0
  387. package/node_modules/readable-stream/lib/internal/streams/destroy.js +84 -0
  388. package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
  389. package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
  390. package/node_modules/readable-stream/package.json +52 -0
  391. package/node_modules/readable-stream/passthrough.js +1 -0
  392. package/node_modules/readable-stream/readable-browser.js +7 -0
  393. package/node_modules/readable-stream/readable.js +19 -0
  394. package/node_modules/readable-stream/transform.js +1 -0
  395. package/node_modules/readable-stream/writable-browser.js +1 -0
  396. package/node_modules/readable-stream/writable.js +8 -0
  397. package/node_modules/safe-buffer/LICENSE +21 -0
  398. package/node_modules/safe-buffer/README.md +584 -0
  399. package/node_modules/safe-buffer/index.d.ts +187 -0
  400. package/node_modules/safe-buffer/index.js +62 -0
  401. package/node_modules/safe-buffer/package.json +37 -0
  402. package/node_modules/setimmediate/LICENSE.txt +20 -0
  403. package/node_modules/setimmediate/package.json +30 -0
  404. package/node_modules/setimmediate/setImmediate.js +186 -0
  405. package/node_modules/string_decoder/.travis.yml +50 -0
  406. package/node_modules/string_decoder/LICENSE +48 -0
  407. package/node_modules/string_decoder/README.md +47 -0
  408. package/node_modules/string_decoder/lib/string_decoder.js +296 -0
  409. package/node_modules/string_decoder/package.json +31 -0
  410. package/node_modules/util-deprecate/History.md +16 -0
  411. package/node_modules/util-deprecate/LICENSE +24 -0
  412. package/node_modules/util-deprecate/README.md +53 -0
  413. package/node_modules/util-deprecate/browser.js +67 -0
  414. package/node_modules/util-deprecate/node.js +6 -0
  415. package/node_modules/util-deprecate/package.json +27 -0
  416. package/package.json +9 -4
  417. package/packages/docx-core/node_modules/@xmldom/xmldom/CHANGELOG.md +468 -0
  418. package/packages/docx-core/node_modules/@xmldom/xmldom/LICENSE +8 -0
  419. package/packages/docx-core/node_modules/@xmldom/xmldom/SECURITY.md +50 -0
  420. package/packages/docx-core/node_modules/@xmldom/xmldom/index.d.ts +43 -0
  421. package/packages/docx-core/node_modules/@xmldom/xmldom/lib/.eslintrc.yml +2 -0
  422. package/packages/docx-core/node_modules/@xmldom/xmldom/lib/conventions.js +203 -0
  423. package/packages/docx-core/node_modules/@xmldom/xmldom/lib/dom-parser.js +322 -0
  424. package/packages/docx-core/node_modules/@xmldom/xmldom/lib/dom.js +1879 -0
  425. package/packages/docx-core/node_modules/@xmldom/xmldom/lib/entities.js +2166 -0
  426. package/packages/docx-core/node_modules/@xmldom/xmldom/lib/index.js +4 -0
  427. package/packages/docx-core/node_modules/@xmldom/xmldom/lib/sax.js +662 -0
  428. package/packages/docx-core/node_modules/@xmldom/xmldom/package.json +71 -0
  429. package/packages/docx-core/node_modules/@xmldom/xmldom/readme.md +356 -0
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Track Changes Acceptor/Rejector (AST-based)
3
+ *
4
+ * AST-based utilities to accept or reject all track changes in a document.
5
+ * Replaces the regex-based implementation for better reliability with nested structures.
6
+ */
7
+ /**
8
+ * Accept all track changes in document XML (AST-based).
9
+ *
10
+ * - Removes w:del elements entirely (deleted content disappears)
11
+ * - Unwraps w:ins elements (inserted content becomes normal)
12
+ * - Handles w:moveFrom (remove) and w:moveTo (unwrap)
13
+ * - Removes format change tracking elements
14
+ *
15
+ * @param documentXml - The document.xml content with track changes
16
+ * @returns Document XML with all changes accepted
17
+ */
18
+ export declare function acceptAllChanges(documentXml: string): string;
19
+ /**
20
+ * Reject all track changes in document XML (AST-based).
21
+ *
22
+ * - Removes w:ins elements entirely (inserted content disappears)
23
+ * - Unwraps w:del elements and converts w:delText to w:t
24
+ * - Handles w:moveFrom (unwrap) and w:moveTo (remove)
25
+ * - Removes format change tracking elements
26
+ *
27
+ * @param documentXml - The document.xml content with track changes
28
+ * @returns Document XML with all changes rejected
29
+ */
30
+ export declare function rejectAllChanges(documentXml: string): string;
31
+ /**
32
+ * Extract plain text content from document XML (AST-based).
33
+ *
34
+ * @param documentXml - The document.xml content
35
+ * @returns Plain text content
36
+ */
37
+ export declare function extractTextContent(documentXml: string): string;
38
+ /**
39
+ * Extract text in document order, respecting paragraph breaks (AST-based).
40
+ */
41
+ export declare function extractTextWithParagraphs(documentXml: string): string;
42
+ /**
43
+ * Normalize text for comparison (handles whitespace differences).
44
+ *
45
+ * Performs the following normalization:
46
+ * - Convert CRLF and CR to LF
47
+ * - Convert tabs to spaces
48
+ * - Collapse multiple spaces to single space
49
+ * - Strip trailing spaces from each line
50
+ * - Collapse multiple newlines to single newline
51
+ * - Trim leading/trailing whitespace
52
+ */
53
+ export declare function normalizeText(text: string): string;
54
+ /**
55
+ * Compare two texts and return detailed differences.
56
+ */
57
+ export declare function compareTexts(expected: string, actual: string): {
58
+ identical: boolean;
59
+ normalizedIdentical: boolean;
60
+ expectedLength: number;
61
+ actualLength: number;
62
+ differences: string[];
63
+ };
64
+ //# sourceMappingURL=trackChangesAcceptorAst.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trackChangesAcceptorAst.d.ts","sourceRoot":"","sources":["../../../src/baselines/atomizer/trackChangesAcceptorAst.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA+VH;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CA0I5D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CA2G5D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAqB9D;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CA4BrE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAUlD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb;IACD,SAAS,EAAE,OAAO,CAAC;IACnB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAmCA"}
@@ -0,0 +1,616 @@
1
+ /**
2
+ * Track Changes Acceptor/Rejector (AST-based)
3
+ *
4
+ * AST-based utilities to accept or reject all track changes in a document.
5
+ * Replaces the regex-based implementation for better reliability with nested structures.
6
+ */
7
+ import { parseDocumentXml, serializeToXml } from './xmlToWmlElement.js';
8
+ import { removeAllByTagName, unwrapAllByTagName, findAllByTagName, renameElement, insertChildAt, childElements, getLeafText, NODE_TYPE, } from '../../primitives/index.js';
9
+ /** xmldom does not implement parentElement; use parentNode with an Element guard. */
10
+ function parentElement(node) {
11
+ const p = node.parentNode;
12
+ return p && p.nodeType === NODE_TYPE.ELEMENT ? p : undefined;
13
+ }
14
+ function getParagraphPPr(p) {
15
+ return childElements(p).find((c) => c.tagName === 'w:pPr');
16
+ }
17
+ function paragraphHasParaMarker(p, tagName) {
18
+ const pPr = getParagraphPPr(p);
19
+ if (!pPr)
20
+ return false;
21
+ return findAllByTagName(pPr, tagName).length > 0;
22
+ }
23
+ function removeParaMarkers(root) {
24
+ // Remove paragraph-level revision markers (<w:ins/> / <w:del/>) that live under <w:pPr>.
25
+ for (const p of findAllByTagName(root, 'w:p')) {
26
+ const pPr = getParagraphPPr(p);
27
+ if (!pPr)
28
+ continue;
29
+ const markers = [
30
+ ...findAllByTagName(pPr, 'w:ins'),
31
+ ...findAllByTagName(pPr, 'w:del'),
32
+ ];
33
+ for (const m of markers) {
34
+ if (m.parentNode)
35
+ m.parentNode.removeChild(m);
36
+ }
37
+ }
38
+ }
39
+ function findContainingParagraph(node) {
40
+ let current = node;
41
+ while (current) {
42
+ if (current.tagName === 'w:p') {
43
+ return current;
44
+ }
45
+ current = parentElement(current);
46
+ }
47
+ return undefined;
48
+ }
49
+ function findNeighborParagraphOutsideRemoval(paragraph, paragraphsToRemove, direction) {
50
+ const parent = parentElement(paragraph);
51
+ if (!parent) {
52
+ return undefined;
53
+ }
54
+ const siblings = childElements(parent);
55
+ const paragraphIndex = siblings.indexOf(paragraph);
56
+ if (paragraphIndex < 0) {
57
+ return undefined;
58
+ }
59
+ const step = direction === 'previous' ? -1 : 1;
60
+ for (let i = paragraphIndex + step; i >= 0 && i < siblings.length; i += step) {
61
+ const sibling = siblings[i];
62
+ if (sibling?.tagName !== 'w:p') {
63
+ continue;
64
+ }
65
+ if (paragraphsToRemove.has(sibling)) {
66
+ continue;
67
+ }
68
+ return sibling;
69
+ }
70
+ return undefined;
71
+ }
72
+ /**
73
+ * Tag names that represent visible content inside a w:r element.
74
+ * A run containing at least one of these is considered substantive (non-empty).
75
+ */
76
+ const RUN_VISIBLE_CONTENT_TAGS = new Set([
77
+ 'w:t', 'w:tab', 'w:br', 'w:cr', 'w:drawing', 'w:object', 'w:pict',
78
+ 'w:sym', 'w:fldChar', 'w:instrText',
79
+ ]);
80
+ /**
81
+ * Returns true if a w:r element contains at least one visible content child.
82
+ * Empty runs (containing only w:rPr or nothing) return false.
83
+ */
84
+ function runHasVisibleContent(run) {
85
+ for (let i = 0; i < run.childNodes.length; i++) {
86
+ const child = run.childNodes[i];
87
+ if (child.nodeType === NODE_TYPE.ELEMENT && RUN_VISIBLE_CONTENT_TAGS.has(child.tagName)) {
88
+ return true;
89
+ }
90
+ }
91
+ return false;
92
+ }
93
+ function paragraphContentStartIndex(paragraph) {
94
+ const children = childElements(paragraph);
95
+ let idx = 0;
96
+ while (idx < children.length && children[idx]?.tagName === 'w:pPr') {
97
+ idx++;
98
+ }
99
+ return idx;
100
+ }
101
+ function moveBookmarkMarker(marker, targetParagraph, position) {
102
+ if (marker.tagName === 'w:bookmarkStart') {
103
+ const markerId = marker.getAttribute('w:id');
104
+ const markerName = marker.getAttribute('w:name');
105
+ for (const existing of findAllByTagName(targetParagraph, 'w:bookmarkStart')) {
106
+ if (markerId && existing.getAttribute('w:id') === markerId) {
107
+ if (marker.parentNode)
108
+ marker.parentNode.removeChild(marker);
109
+ return;
110
+ }
111
+ if (markerName && existing.getAttribute('w:name') === markerName) {
112
+ if (marker.parentNode)
113
+ marker.parentNode.removeChild(marker);
114
+ return;
115
+ }
116
+ }
117
+ }
118
+ if (marker.tagName === 'w:bookmarkEnd') {
119
+ const markerId = marker.getAttribute('w:id');
120
+ if (markerId) {
121
+ for (const existing of findAllByTagName(targetParagraph, 'w:bookmarkEnd')) {
122
+ if (existing.getAttribute('w:id') === markerId) {
123
+ if (marker.parentNode)
124
+ marker.parentNode.removeChild(marker);
125
+ return;
126
+ }
127
+ }
128
+ }
129
+ }
130
+ if (marker.parentNode) {
131
+ marker.parentNode.removeChild(marker);
132
+ }
133
+ if (position === 'start') {
134
+ insertChildAt(targetParagraph, marker, paragraphContentStartIndex(targetParagraph));
135
+ return;
136
+ }
137
+ targetParagraph.appendChild(marker);
138
+ }
139
+ function collectBookmarksById(nodes) {
140
+ const byId = new Map();
141
+ for (const node of nodes) {
142
+ const id = node.getAttribute('w:id');
143
+ if (!id) {
144
+ continue;
145
+ }
146
+ const existing = byId.get(id);
147
+ if (existing) {
148
+ existing.push(node);
149
+ }
150
+ else {
151
+ byId.set(id, [node]);
152
+ }
153
+ }
154
+ return byId;
155
+ }
156
+ function hasCounterpartOutsideRemovedParagraphs(counterpartNodes, paragraphsToRemove, sourceParagraph) {
157
+ if (!counterpartNodes || counterpartNodes.length === 0) {
158
+ return false;
159
+ }
160
+ for (const node of counterpartNodes) {
161
+ if (!node.parentNode) {
162
+ continue;
163
+ }
164
+ const nodeParagraph = findContainingParagraph(node);
165
+ if (!nodeParagraph || nodeParagraph === sourceParagraph) {
166
+ continue;
167
+ }
168
+ if (!paragraphsToRemove.has(nodeParagraph)) {
169
+ return true;
170
+ }
171
+ }
172
+ return false;
173
+ }
174
+ function collectReferencedBookmarkNamesOutsideRemovedParagraphs(root, paragraphsToRemove) {
175
+ const names = new Set();
176
+ const refRegex = /\b(?:PAGEREF|REF)\s+([^\s\\]+)/g;
177
+ for (const instrText of findAllByTagName(root, 'w:instrText')) {
178
+ const paragraph = findContainingParagraph(instrText);
179
+ if (paragraph && paragraphsToRemove.has(paragraph)) {
180
+ continue;
181
+ }
182
+ const text = getLeafText(instrText) ?? '';
183
+ for (const match of text.matchAll(refRegex)) {
184
+ const name = match[1]?.trim();
185
+ if (name) {
186
+ names.add(name);
187
+ }
188
+ }
189
+ }
190
+ return names;
191
+ }
192
+ function getBookmarkNameForId(startsById, id) {
193
+ const starts = startsById.get(id);
194
+ if (!starts)
195
+ return undefined;
196
+ for (const start of starts) {
197
+ const name = start.getAttribute('w:name');
198
+ if (name)
199
+ return name;
200
+ }
201
+ return undefined;
202
+ }
203
+ /**
204
+ * Preserve bookmark markers that span outside paragraphs being removed during Reject All.
205
+ *
206
+ * Inserted paragraphs are removed wholesale. If they contain a bookmark boundary whose
207
+ * counterpart sits in a kept paragraph, dropping that boundary corrupts bookmark pairing.
208
+ * Move those boundary markers into adjacent kept paragraphs before removal.
209
+ */
210
+ function preserveCrossParagraphBookmarksForReject(root, paragraphsToRemove) {
211
+ if (paragraphsToRemove.size === 0) {
212
+ return;
213
+ }
214
+ const startsById = collectBookmarksById(findAllByTagName(root, 'w:bookmarkStart'));
215
+ const endsById = collectBookmarksById(findAllByTagName(root, 'w:bookmarkEnd'));
216
+ const referencedNamesOutsideRemoved = collectReferencedBookmarkNamesOutsideRemovedParagraphs(root, paragraphsToRemove);
217
+ for (const paragraph of paragraphsToRemove) {
218
+ const startTarget = findNeighborParagraphOutsideRemoval(paragraph, paragraphsToRemove, 'next') ??
219
+ findNeighborParagraphOutsideRemoval(paragraph, paragraphsToRemove, 'previous');
220
+ const endTarget = findNeighborParagraphOutsideRemoval(paragraph, paragraphsToRemove, 'previous') ??
221
+ findNeighborParagraphOutsideRemoval(paragraph, paragraphsToRemove, 'next');
222
+ if (!startTarget && !endTarget) {
223
+ continue;
224
+ }
225
+ for (const start of findAllByTagName(paragraph, 'w:bookmarkStart')) {
226
+ if (!start.parentNode || !startTarget) {
227
+ continue;
228
+ }
229
+ const id = start.getAttribute('w:id');
230
+ if (!id) {
231
+ continue;
232
+ }
233
+ const startName = start.getAttribute('w:name');
234
+ const hasDuplicateStartOutside = hasCounterpartOutsideRemovedParagraphs(startsById.get(id), paragraphsToRemove, paragraph);
235
+ if (hasDuplicateStartOutside) {
236
+ // A surviving start marker with this ID already exists outside removed
237
+ // paragraphs. Moving this marker would create duplicate starts after
238
+ // Reject All.
239
+ continue;
240
+ }
241
+ const hasCounterpartOutside = hasCounterpartOutsideRemovedParagraphs(endsById.get(id), paragraphsToRemove, paragraph);
242
+ const referencedOutside = startName ? referencedNamesOutsideRemoved.has(startName) : false;
243
+ if (!hasCounterpartOutside && !referencedOutside) {
244
+ continue;
245
+ }
246
+ moveBookmarkMarker(start, startTarget, 'start');
247
+ }
248
+ for (const end of findAllByTagName(paragraph, 'w:bookmarkEnd')) {
249
+ if (!end.parentNode || !endTarget) {
250
+ continue;
251
+ }
252
+ const id = end.getAttribute('w:id');
253
+ if (!id) {
254
+ continue;
255
+ }
256
+ const hasDuplicateEndOutside = hasCounterpartOutsideRemovedParagraphs(endsById.get(id), paragraphsToRemove, paragraph);
257
+ if (hasDuplicateEndOutside) {
258
+ // A surviving end marker with this ID already exists outside removed
259
+ // paragraphs. Moving this marker would create duplicate ends after
260
+ // Reject All.
261
+ continue;
262
+ }
263
+ const hasCounterpartOutside = hasCounterpartOutsideRemovedParagraphs(startsById.get(id), paragraphsToRemove, paragraph);
264
+ const pairedName = getBookmarkNameForId(startsById, id);
265
+ const referencedOutside = pairedName ? referencedNamesOutsideRemoved.has(pairedName) : false;
266
+ if (!hasCounterpartOutside && !referencedOutside) {
267
+ continue;
268
+ }
269
+ moveBookmarkMarker(end, endTarget, 'end');
270
+ }
271
+ }
272
+ }
273
+ /**
274
+ * Accept all track changes in document XML (AST-based).
275
+ *
276
+ * - Removes w:del elements entirely (deleted content disappears)
277
+ * - Unwraps w:ins elements (inserted content becomes normal)
278
+ * - Handles w:moveFrom (remove) and w:moveTo (unwrap)
279
+ * - Removes format change tracking elements
280
+ *
281
+ * @param documentXml - The document.xml content with track changes
282
+ * @returns Document XML with all changes accepted
283
+ */
284
+ export function acceptAllChanges(documentXml) {
285
+ const root = parseDocumentXml(documentXml);
286
+ // First, find paragraphs that ONLY contain w:del or w:moveFrom content (no w:ins, no regular w:r)
287
+ // These paragraphs should be removed entirely when accepting
288
+ const paragraphsToRemove = new Set();
289
+ // Paragraph-level deletion markers (Aspose/Word encode deleted paragraphs via <w:pPr><w:rPr><w:del .../></w:rPr>)
290
+ // should remove the paragraph on Accept All.
291
+ for (const p of findAllByTagName(root, 'w:p')) {
292
+ if (paragraphHasParaMarker(p, 'w:del')) {
293
+ paragraphsToRemove.add(p);
294
+ }
295
+ }
296
+ // Check w:del elements
297
+ for (const del of findAllByTagName(root, 'w:del')) {
298
+ // Walk up to find containing w:p
299
+ let p;
300
+ let current = parentElement(del);
301
+ while (current) {
302
+ if (current.tagName === 'w:p') {
303
+ p = current;
304
+ break;
305
+ }
306
+ current = parentElement(current);
307
+ }
308
+ if (p) {
309
+ // Check if this paragraph has any w:ins elements (should keep those)
310
+ const insElements = findAllByTagName(p, 'w:ins');
311
+ if (insElements.length > 0) {
312
+ continue; // Paragraph has inserted content, don't remove it
313
+ }
314
+ // Check if this paragraph has any w:r elements outside of w:del
315
+ // If the only content is inside w:del, we can remove the paragraph
316
+ let hasContentOutsideDel = false;
317
+ for (const child of childElements(p)) {
318
+ if (child.tagName === 'w:r') {
319
+ hasContentOutsideDel = true;
320
+ break;
321
+ }
322
+ if (child.tagName !== 'w:del' && child.tagName !== 'w:pPr' &&
323
+ child.tagName !== 'w:moveFromRangeStart' && child.tagName !== 'w:moveFromRangeEnd') {
324
+ // Check if this non-del child has w:r descendants
325
+ const runsInChild = findAllByTagName(child, 'w:r');
326
+ if (runsInChild.length > 0) {
327
+ hasContentOutsideDel = true;
328
+ break;
329
+ }
330
+ }
331
+ }
332
+ if (!hasContentOutsideDel) {
333
+ paragraphsToRemove.add(p);
334
+ }
335
+ }
336
+ }
337
+ // Also check w:moveFrom elements (moved-away content, also removed when accepting)
338
+ for (const moveFrom of findAllByTagName(root, 'w:moveFrom')) {
339
+ // Walk up to find containing w:p
340
+ let p;
341
+ let current = parentElement(moveFrom);
342
+ while (current) {
343
+ if (current.tagName === 'w:p') {
344
+ p = current;
345
+ break;
346
+ }
347
+ current = parentElement(current);
348
+ }
349
+ if (p && !paragraphsToRemove.has(p)) {
350
+ // Check if this paragraph has any w:ins or w:moveTo elements (should keep those)
351
+ const insElements = findAllByTagName(p, 'w:ins');
352
+ const moveToElements = findAllByTagName(p, 'w:moveTo');
353
+ if (insElements.length > 0 || moveToElements.length > 0) {
354
+ continue;
355
+ }
356
+ // Check if this paragraph has any w:r elements outside of w:del/w:moveFrom
357
+ let hasContentOutsideRemoved = false;
358
+ for (const child of childElements(p)) {
359
+ if (child.tagName === 'w:r') {
360
+ hasContentOutsideRemoved = true;
361
+ break;
362
+ }
363
+ if (child.tagName !== 'w:del' && child.tagName !== 'w:moveFrom' &&
364
+ child.tagName !== 'w:pPr' &&
365
+ child.tagName !== 'w:moveFromRangeStart' && child.tagName !== 'w:moveFromRangeEnd') {
366
+ const runsInChild = findAllByTagName(child, 'w:r');
367
+ if (runsInChild.length > 0) {
368
+ hasContentOutsideRemoved = true;
369
+ break;
370
+ }
371
+ }
372
+ }
373
+ if (!hasContentOutsideRemoved) {
374
+ paragraphsToRemove.add(p);
375
+ }
376
+ }
377
+ }
378
+ // Remove w:del elements entirely (deleted content disappears)
379
+ removeAllByTagName(root, 'w:del');
380
+ // Remove w:moveFrom elements entirely
381
+ removeAllByTagName(root, 'w:moveFrom');
382
+ // Remove move range markers
383
+ removeAllByTagName(root, 'w:moveFromRangeStart');
384
+ removeAllByTagName(root, 'w:moveFromRangeEnd');
385
+ removeAllByTagName(root, 'w:moveToRangeStart');
386
+ removeAllByTagName(root, 'w:moveToRangeEnd');
387
+ // Unwrap w:ins elements (keep content, remove wrapper)
388
+ unwrapAllByTagName(root, 'w:ins');
389
+ // Unwrap w:moveTo elements
390
+ unwrapAllByTagName(root, 'w:moveTo');
391
+ // Remove format change tracking
392
+ removeAllByTagName(root, 'w:rPrChange');
393
+ removeAllByTagName(root, 'w:pPrChange');
394
+ // Strip paragraph-level markers now that changes are accepted.
395
+ removeParaMarkers(root);
396
+ // Remove paragraphs that ONLY had w:del content (now empty after removal)
397
+ for (const p of paragraphsToRemove) {
398
+ if (p.parentNode) {
399
+ p.parentNode.removeChild(p);
400
+ }
401
+ }
402
+ return serializeToXml(root);
403
+ }
404
+ /**
405
+ * Reject all track changes in document XML (AST-based).
406
+ *
407
+ * - Removes w:ins elements entirely (inserted content disappears)
408
+ * - Unwraps w:del elements and converts w:delText to w:t
409
+ * - Handles w:moveFrom (unwrap) and w:moveTo (remove)
410
+ * - Removes format change tracking elements
411
+ *
412
+ * @param documentXml - The document.xml content with track changes
413
+ * @returns Document XML with all changes rejected
414
+ */
415
+ export function rejectAllChanges(documentXml) {
416
+ const root = parseDocumentXml(documentXml);
417
+ // Step 1: Find paragraphs where w:ins is the ONLY substantive content
418
+ // (no w:del, no w:r outside track changes)
419
+ const paragraphsToRemove = new Set();
420
+ // Paragraph-level insertion markers (Aspose/Word encode inserted paragraphs via <w:pPr><w:rPr><w:ins .../></w:rPr>)
421
+ // should remove the paragraph on Reject All.
422
+ for (const p of findAllByTagName(root, 'w:p')) {
423
+ if (paragraphHasParaMarker(p, 'w:ins')) {
424
+ paragraphsToRemove.add(p);
425
+ }
426
+ }
427
+ // Also check paragraphs where ALL substantive content is inside w:ins and/or
428
+ // w:moveTo wrappers (no bare w:r, no w:del, no w:moveFrom). These paragraphs
429
+ // should be removed on reject even without an explicit PPR-INS paragraph marker.
430
+ // This handles the inplace modifier's no-op wrapParagraphAsInserted (which omits
431
+ // PPR-INS for Google Docs compatibility).
432
+ for (const p of findAllByTagName(root, 'w:p')) {
433
+ if (paragraphsToRemove.has(p))
434
+ continue;
435
+ // Must have at least one w:ins or w:moveTo
436
+ const insEls = findAllByTagName(p, 'w:ins');
437
+ const moveToEls = findAllByTagName(p, 'w:moveTo');
438
+ if (insEls.length === 0 && moveToEls.length === 0)
439
+ continue;
440
+ // Skip if paragraph has deleted/moveFrom content (those survive reject)
441
+ const dels = findAllByTagName(p, 'w:del');
442
+ const moveFroms = findAllByTagName(p, 'w:moveFrom');
443
+ if (dels.length > 0 || moveFroms.length > 0)
444
+ continue;
445
+ // Check if this paragraph has any w:r elements with visible content
446
+ // outside of w:ins/w:moveTo. Empty w:r shells (no w:t, w:tab, w:br, etc.)
447
+ // should NOT count as substantive content — they are artifacts that would
448
+ // otherwise prevent paragraph removal, leaving ghost paragraphs after reject.
449
+ let hasContentOutsideRemoved = false;
450
+ for (const child of childElements(p)) {
451
+ if (child.tagName === 'w:r') {
452
+ if (runHasVisibleContent(child)) {
453
+ hasContentOutsideRemoved = true;
454
+ break;
455
+ }
456
+ continue;
457
+ }
458
+ if (child.tagName !== 'w:ins' && child.tagName !== 'w:moveTo' &&
459
+ child.tagName !== 'w:pPr' &&
460
+ child.tagName !== 'w:moveToRangeStart' && child.tagName !== 'w:moveToRangeEnd' &&
461
+ child.tagName !== 'w:bookmarkStart' && child.tagName !== 'w:bookmarkEnd') {
462
+ const runsInChild = findAllByTagName(child, 'w:r');
463
+ if (runsInChild.some(runHasVisibleContent)) {
464
+ hasContentOutsideRemoved = true;
465
+ break;
466
+ }
467
+ }
468
+ }
469
+ if (!hasContentOutsideRemoved) {
470
+ paragraphsToRemove.add(p);
471
+ }
472
+ }
473
+ preserveCrossParagraphBookmarksForReject(root, paragraphsToRemove);
474
+ // Step 2: Remove w:ins elements entirely (inserted content disappears)
475
+ removeAllByTagName(root, 'w:ins');
476
+ // Step 3: Remove paragraphs that ONLY had w:ins content
477
+ for (const p of paragraphsToRemove) {
478
+ if (p.parentNode) {
479
+ p.parentNode.removeChild(p);
480
+ }
481
+ }
482
+ // Remove w:moveTo elements entirely
483
+ removeAllByTagName(root, 'w:moveTo');
484
+ // Remove move range markers
485
+ removeAllByTagName(root, 'w:moveFromRangeStart');
486
+ removeAllByTagName(root, 'w:moveFromRangeEnd');
487
+ removeAllByTagName(root, 'w:moveToRangeStart');
488
+ removeAllByTagName(root, 'w:moveToRangeEnd');
489
+ // Unwrap w:del elements (keep content, remove wrapper)
490
+ unwrapAllByTagName(root, 'w:del');
491
+ // Unwrap w:moveFrom elements
492
+ unwrapAllByTagName(root, 'w:moveFrom');
493
+ // Convert w:delText to w:t
494
+ for (const delText of findAllByTagName(root, 'w:delText')) {
495
+ renameElement(delText, 'w:t');
496
+ }
497
+ // Convert w:delInstrText to w:instrText
498
+ for (const delInstrText of findAllByTagName(root, 'w:delInstrText')) {
499
+ renameElement(delInstrText, 'w:instrText');
500
+ }
501
+ // Remove format change tracking
502
+ removeAllByTagName(root, 'w:rPrChange');
503
+ removeAllByTagName(root, 'w:pPrChange');
504
+ // Strip paragraph-level markers now that changes are rejected.
505
+ removeParaMarkers(root);
506
+ return serializeToXml(root);
507
+ }
508
+ /**
509
+ * Extract plain text content from document XML (AST-based).
510
+ *
511
+ * @param documentXml - The document.xml content
512
+ * @returns Plain text content
513
+ */
514
+ export function extractTextContent(documentXml) {
515
+ const root = parseDocumentXml(documentXml);
516
+ const texts = [];
517
+ // Extract text from w:t elements
518
+ for (const t of findAllByTagName(root, 'w:t')) {
519
+ const text = getLeafText(t) ?? '';
520
+ if (text) {
521
+ texts.push(text);
522
+ }
523
+ }
524
+ // Also extract from w:delText (for rejected changes before conversion)
525
+ for (const delText of findAllByTagName(root, 'w:delText')) {
526
+ const text = getLeafText(delText) ?? '';
527
+ if (text) {
528
+ texts.push(text);
529
+ }
530
+ }
531
+ return texts.join('');
532
+ }
533
+ /**
534
+ * Extract text in document order, respecting paragraph breaks (AST-based).
535
+ */
536
+ export function extractTextWithParagraphs(documentXml) {
537
+ const root = parseDocumentXml(documentXml);
538
+ const paragraphs = [];
539
+ // Find all paragraphs
540
+ for (const p of findAllByTagName(root, 'w:p')) {
541
+ const texts = [];
542
+ // Extract text from w:t elements within this paragraph
543
+ for (const t of findAllByTagName(p, 'w:t')) {
544
+ const text = getLeafText(t) ?? '';
545
+ if (text) {
546
+ texts.push(text);
547
+ }
548
+ }
549
+ // Also check w:delText
550
+ for (const delText of findAllByTagName(p, 'w:delText')) {
551
+ const text = getLeafText(delText) ?? '';
552
+ if (text) {
553
+ texts.push(text);
554
+ }
555
+ }
556
+ paragraphs.push(texts.join(''));
557
+ }
558
+ return paragraphs.join('\n');
559
+ }
560
+ /**
561
+ * Normalize text for comparison (handles whitespace differences).
562
+ *
563
+ * Performs the following normalization:
564
+ * - Convert CRLF and CR to LF
565
+ * - Convert tabs to spaces
566
+ * - Collapse multiple spaces to single space
567
+ * - Strip trailing spaces from each line
568
+ * - Collapse multiple newlines to single newline
569
+ * - Trim leading/trailing whitespace
570
+ */
571
+ export function normalizeText(text) {
572
+ return text
573
+ .replace(/\r\n/g, '\n')
574
+ .replace(/\r/g, '\n')
575
+ .replace(/\t/g, ' ')
576
+ .replace(/ +/g, ' ')
577
+ .replace(/ \n/g, '\n') // Strip trailing spaces from lines
578
+ .replace(/\n /g, '\n') // Strip leading spaces from lines
579
+ .replace(/\n+/g, '\n')
580
+ .trim();
581
+ }
582
+ /**
583
+ * Compare two texts and return detailed differences.
584
+ */
585
+ export function compareTexts(expected, actual) {
586
+ const normalizedExpected = normalizeText(expected);
587
+ const normalizedActual = normalizeText(actual);
588
+ const differences = [];
589
+ if (expected !== actual) {
590
+ // Find first difference
591
+ let firstDiff = 0;
592
+ while (firstDiff < expected.length && firstDiff < actual.length) {
593
+ if (expected[firstDiff] !== actual[firstDiff]) {
594
+ break;
595
+ }
596
+ firstDiff++;
597
+ }
598
+ if (firstDiff < expected.length || firstDiff < actual.length) {
599
+ const context = 50;
600
+ const start = Math.max(0, firstDiff - context);
601
+ const expectedSnippet = expected.slice(start, firstDiff + context);
602
+ const actualSnippet = actual.slice(start, firstDiff + context);
603
+ differences.push(`First difference at position ${firstDiff}:`);
604
+ differences.push(` Expected: "...${expectedSnippet}..."`);
605
+ differences.push(` Actual: "...${actualSnippet}..."`);
606
+ }
607
+ }
608
+ return {
609
+ identical: expected === actual,
610
+ normalizedIdentical: normalizedExpected === normalizedActual,
611
+ expectedLength: expected.length,
612
+ actualLength: actual.length,
613
+ differences,
614
+ };
615
+ }
616
+ //# sourceMappingURL=trackChangesAcceptorAst.js.map