@eigenpal/docx-editor-core 1.0.3 → 1.2.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 (266) hide show
  1. package/LICENSE +13 -16
  2. package/dist/agent/index.d.mts +42 -7
  3. package/dist/agent/index.d.ts +42 -7
  4. package/dist/agent/index.js +1 -1
  5. package/dist/agent/index.mjs +1 -1
  6. package/dist/chunk-2EQGBVPV.js +2 -0
  7. package/dist/chunk-2XP6GLA4.mjs +1 -0
  8. package/dist/chunk-44FHVKSI.js +1 -0
  9. package/dist/{chunk-2IE6UDHJ.mjs → chunk-44JKHPGF.mjs} +1 -1
  10. package/dist/{chunk-ABBG4WD2.js → chunk-4QEETB7U.js} +2 -2
  11. package/dist/chunk-53VKL6CG.js +1 -0
  12. package/dist/chunk-5BLQHXWK.mjs +1 -0
  13. package/dist/chunk-5M7TI6TV.js +1 -0
  14. package/dist/chunk-6JKM7TWJ.mjs +1 -0
  15. package/dist/{chunk-EQVNAHL7.mjs → chunk-6Y6LON6Y.mjs} +1 -1
  16. package/dist/{chunk-QVEAQOMR.mjs → chunk-6ZXL3EIP.mjs} +1 -1
  17. package/dist/{chunk-GHQS3I2W.mjs → chunk-7BVHKWEW.mjs} +1 -1
  18. package/dist/chunk-7HANRHHL.js +1 -0
  19. package/dist/chunk-7LRR7RKE.mjs +15 -0
  20. package/dist/chunk-7OW3VCZE.mjs +1 -0
  21. package/dist/chunk-7ZN4WI5N.mjs +4 -0
  22. package/dist/chunk-AMB6Y77B.js +1 -0
  23. package/dist/{chunk-3JXR6YU4.mjs → chunk-BOOHU5EW.mjs} +1 -1
  24. package/dist/{chunk-XBHF5Q2F.js → chunk-BXWOLARZ.js} +1 -1
  25. package/dist/chunk-C45EFOVP.js +1 -0
  26. package/dist/chunk-CCPBNE2F.mjs +2 -0
  27. package/dist/{chunk-XWQB6APW.mjs → chunk-D62KS7QG.mjs} +1 -1
  28. package/dist/chunk-DI6CRWSW.mjs +1 -0
  29. package/dist/chunk-DTTWBKGN.mjs +0 -0
  30. package/dist/chunk-DV6GWBUJ.js +2 -0
  31. package/dist/{chunk-EPX7BBJD.js → chunk-E4JMCA5X.js} +2 -2
  32. package/dist/chunk-EQAORQC3.mjs +1 -0
  33. package/dist/chunk-FO6IX2DB.js +6 -0
  34. package/dist/chunk-FW23IMBF.mjs +1 -0
  35. package/dist/chunk-FYKRDDKG.js +1 -0
  36. package/dist/chunk-GSKMHXHG.js +1 -0
  37. package/dist/chunk-GUQFNJHE.mjs +1 -0
  38. package/dist/{chunk-D536HC5M.js → chunk-HQPWFUP5.js} +1 -1
  39. package/dist/chunk-ICE6NC3S.mjs +1 -0
  40. package/dist/chunk-IFUED5ZS.mjs +1 -0
  41. package/dist/chunk-ISKTBM4L.js +1 -0
  42. package/dist/chunk-IYKBX24M.js +1 -0
  43. package/dist/chunk-KOEWROYV.mjs +6 -0
  44. package/dist/chunk-KRN6YSR2.mjs +1 -0
  45. package/dist/chunk-KZXZWGFX.mjs +1 -0
  46. package/dist/chunk-L24C5TEX.mjs +1 -0
  47. package/dist/chunk-L72YAV5N.js +3 -0
  48. package/dist/chunk-LK6I3HMH.mjs +0 -0
  49. package/dist/{chunk-XBIKSAH6.js → chunk-LTHT4A4S.js} +1 -1
  50. package/dist/chunk-LWH66Q7Q.js +1 -0
  51. package/dist/chunk-MERJFGEP.mjs +59 -0
  52. package/dist/chunk-MJ6XZFVD.mjs +1 -0
  53. package/dist/chunk-MNOHUTKE.js +15 -0
  54. package/dist/chunk-MP4QSEO2.mjs +1 -0
  55. package/dist/{chunk-HL5PQT3A.mjs → chunk-OEXVWIHW.mjs} +1 -1
  56. package/dist/chunk-PVAVS3IU.js +1 -0
  57. package/dist/chunk-QEACB5VG.js +1 -0
  58. package/dist/{chunk-EV6W6KXG.mjs → chunk-QKLY4F2J.mjs} +1 -1
  59. package/dist/chunk-QYF7BRG3.js +2 -0
  60. package/dist/chunk-ROG4MNOR.js +4 -0
  61. package/dist/{chunk-D5E5TA74.js → chunk-RORPREG3.js} +1 -1
  62. package/dist/chunk-SORYYVJ7.js +1 -0
  63. package/dist/chunk-SZIOF5SG.js +59 -0
  64. package/dist/{chunk-SAFW7UQZ.js → chunk-THLJYXFB.js} +1 -1
  65. package/dist/chunk-TUIEV7Q7.js +1 -0
  66. package/dist/{chunk-Z4SJCSTS.js → chunk-U4WUDHDK.js} +1 -1
  67. package/dist/chunk-U4XMGWF7.js +1 -0
  68. package/dist/chunk-U67MWOPZ.mjs +1 -0
  69. package/dist/chunk-VMRUBLPI.js +1 -0
  70. package/dist/chunk-WLDI6N3B.mjs +3 -0
  71. package/dist/chunk-WLHNIXWC.mjs +2 -0
  72. package/dist/chunk-WVERBZZU.js +1 -0
  73. package/dist/chunk-XCKTBNKN.js +1 -0
  74. package/dist/chunk-XPV6VILW.mjs +1 -0
  75. package/dist/chunk-Z5MJYQSD.mjs +1 -0
  76. package/dist/chunk-ZBFNOJGY.js +1 -0
  77. package/dist/chunk-ZX26QZJ5.mjs +1 -0
  78. package/dist/content-CE-ZdMwG.d.mts +1418 -0
  79. package/dist/content-CYXJ2tfQ.d.ts +1418 -0
  80. package/dist/contentControlValues-DAwTWfgR.d.mts +187 -0
  81. package/dist/contentControlValues-gyVPsi6m.d.ts +187 -0
  82. package/dist/core-plugins.d.mts +1 -2
  83. package/dist/core-plugins.d.ts +1 -2
  84. package/dist/core-plugins.js +1 -1
  85. package/dist/core-plugins.mjs +1 -1
  86. package/dist/core.d.mts +6 -7
  87. package/dist/core.d.ts +6 -7
  88. package/dist/core.js +1 -1
  89. package/dist/core.mjs +1 -1
  90. package/dist/{documentSerializer-C1ueey5d.d.mts → documentSerializer-Bghq9rFI.d.mts} +1 -1
  91. package/dist/{documentSerializer-Chn7J1WG.d.ts → documentSerializer-C4lFC60P.d.ts} +1 -1
  92. package/dist/documentStyles-D87dxl18.d.mts +34 -0
  93. package/dist/documentStyles-DToJv9co.d.ts +34 -0
  94. package/dist/docx/index.d.mts +1 -2
  95. package/dist/docx/index.d.ts +1 -2
  96. package/dist/docx/index.js +1 -1
  97. package/dist/docx/index.mjs +1 -1
  98. package/dist/docx/parser.d.mts +1 -2
  99. package/dist/docx/parser.d.ts +1 -2
  100. package/dist/docx/parser.js +1 -1
  101. package/dist/docx/parser.mjs +1 -1
  102. package/dist/docx/rezip.d.mts +1 -2
  103. package/dist/docx/rezip.d.ts +1 -2
  104. package/dist/docx/rezip.js +1 -1
  105. package/dist/docx/rezip.mjs +1 -1
  106. package/dist/docx/serializer/index.d.mts +2 -3
  107. package/dist/docx/serializer/index.d.ts +2 -3
  108. package/dist/docx/serializer/index.js +1 -1
  109. package/dist/docx/serializer/index.mjs +1 -1
  110. package/dist/{fontLoader-QPwbcX5j.d.ts → fontLoader-Cm02v7PO.d.ts} +63 -3
  111. package/dist/{fontLoader-BOt95Jtf.d.mts → fontLoader-Z7pqeNvZ.d.mts} +63 -3
  112. package/dist/{headerFooterLayout-B5LyDpSM.d.ts → headerFooterLayout-Bd58Tum3.d.ts} +74 -2
  113. package/dist/{headerFooterLayout-DVFcJ832.d.mts → headerFooterLayout-CuIJiIzi.d.mts} +74 -2
  114. package/dist/headless.d.mts +7 -6
  115. package/dist/headless.d.ts +7 -6
  116. package/dist/headless.js +1 -1
  117. package/dist/headless.mjs +1 -1
  118. package/dist/layout-bridge/index.d.mts +4 -4
  119. package/dist/layout-bridge/index.d.ts +4 -4
  120. package/dist/layout-bridge/index.js +1 -1
  121. package/dist/layout-bridge/index.mjs +1 -1
  122. package/dist/layout-bridge/measuring/index.d.mts +4 -0
  123. package/dist/layout-bridge/measuring/index.d.ts +4 -0
  124. package/dist/layout-bridge/measuring/index.js +1 -1
  125. package/dist/layout-bridge/measuring/index.mjs +1 -1
  126. package/dist/layout-bridge/tableInsertHover.js +1 -1
  127. package/dist/layout-bridge/tableInsertHover.mjs +1 -1
  128. package/dist/layout-bridge/toFlowBlocks.d.mts +2 -1
  129. package/dist/layout-bridge/toFlowBlocks.d.ts +2 -1
  130. package/dist/layout-bridge/toFlowBlocks.js +1 -1
  131. package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
  132. package/dist/layout-engine/index.d.mts +4 -1
  133. package/dist/layout-engine/index.d.ts +4 -1
  134. package/dist/layout-engine/index.js +1 -1
  135. package/dist/layout-engine/index.mjs +1 -1
  136. package/dist/layout-engine/types.d.mts +74 -1
  137. package/dist/layout-engine/types.d.ts +74 -1
  138. package/dist/layout-painter/index.d.mts +4 -4
  139. package/dist/layout-painter/index.d.ts +4 -4
  140. package/dist/layout-painter/index.js +1 -1
  141. package/dist/layout-painter/index.mjs +1 -1
  142. package/dist/layout-painter/renderPage.d.mts +27 -4
  143. package/dist/layout-painter/renderPage.d.ts +27 -4
  144. package/dist/layout-painter/renderPage.js +1 -1
  145. package/dist/layout-painter/renderPage.mjs +1 -1
  146. package/dist/managers/AutoSaveManager.d.mts +1 -2
  147. package/dist/managers/AutoSaveManager.d.ts +1 -2
  148. package/dist/managers/TableSelectionManager.d.mts +1 -2
  149. package/dist/managers/TableSelectionManager.d.ts +1 -2
  150. package/dist/managers/types.d.mts +1 -2
  151. package/dist/managers/types.d.ts +1 -2
  152. package/dist/mcp-cli.mjs +23 -22
  153. package/dist/mcp.d.mts +1 -2
  154. package/dist/mcp.d.ts +1 -2
  155. package/dist/mcp.js +3 -3
  156. package/dist/mcp.mjs +1 -1
  157. package/dist/{nodes-D7PTUJ2N.d.ts → nodes-BNkRKBBX.d.ts} +64 -3
  158. package/dist/{nodes-CL8M0L-a.d.mts → nodes-Bz-UHhLE.d.mts} +64 -3
  159. package/dist/prosemirror/commands/formatting.js +1 -1
  160. package/dist/prosemirror/commands/formatting.mjs +1 -1
  161. package/dist/prosemirror/commands/index.d.mts +80 -6
  162. package/dist/prosemirror/commands/index.d.ts +80 -6
  163. package/dist/prosemirror/commands/index.js +1 -1
  164. package/dist/prosemirror/commands/index.mjs +1 -1
  165. package/dist/prosemirror/commands/paragraph.js +1 -1
  166. package/dist/prosemirror/commands/paragraph.mjs +1 -1
  167. package/dist/prosemirror/conversion/fromProseDoc.d.mts +2 -3
  168. package/dist/prosemirror/conversion/fromProseDoc.d.ts +2 -3
  169. package/dist/prosemirror/conversion/fromProseDoc.js +1 -1
  170. package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -1
  171. package/dist/prosemirror/conversion/index.d.mts +3 -4
  172. package/dist/prosemirror/conversion/index.d.ts +3 -4
  173. package/dist/prosemirror/conversion/index.js +1 -1
  174. package/dist/prosemirror/conversion/index.mjs +1 -1
  175. package/dist/prosemirror/editor.css +302 -95
  176. package/dist/prosemirror/extensions/index.js +1 -1
  177. package/dist/prosemirror/extensions/index.mjs +1 -1
  178. package/dist/prosemirror/extensions/nodes/TableExtension.js +1 -1
  179. package/dist/prosemirror/extensions/nodes/TableExtension.mjs +1 -1
  180. package/dist/prosemirror/index.d.mts +94 -7
  181. package/dist/prosemirror/index.d.ts +94 -7
  182. package/dist/prosemirror/index.js +3 -1
  183. package/dist/prosemirror/index.mjs +3 -1
  184. package/dist/prosemirror/plugins/index.d.mts +124 -17
  185. package/dist/prosemirror/plugins/index.d.ts +124 -17
  186. package/dist/prosemirror/plugins/index.js +1 -1
  187. package/dist/prosemirror/plugins/index.mjs +1 -1
  188. package/dist/prosemirror/schema/index.d.mts +3 -4
  189. package/dist/prosemirror/schema/index.d.ts +3 -4
  190. package/dist/prosemirror/schema/index.js +1 -1
  191. package/dist/prosemirror/schema/index.mjs +1 -1
  192. package/dist/prosemirror/styles/index.d.mts +9 -0
  193. package/dist/prosemirror/styles/index.d.ts +9 -0
  194. package/dist/prosemirror/styles/index.js +1 -1
  195. package/dist/prosemirror/styles/index.mjs +1 -1
  196. package/dist/prosemirror/utils/extractTrackedChanges.d.mts +44 -22
  197. package/dist/prosemirror/utils/extractTrackedChanges.d.ts +44 -22
  198. package/dist/prosemirror/utils/extractTrackedChanges.js +1 -1
  199. package/dist/prosemirror/utils/extractTrackedChanges.mjs +1 -1
  200. package/dist/types/content.d.mts +4 -1167
  201. package/dist/types/content.d.ts +4 -1167
  202. package/dist/types/document.d.mts +2 -4
  203. package/dist/types/document.d.ts +2 -4
  204. package/dist/utils/comments.d.mts +78 -5
  205. package/dist/utils/comments.d.ts +78 -5
  206. package/dist/utils/comments.js +1 -1
  207. package/dist/utils/comments.mjs +1 -1
  208. package/dist/utils/highlightColors.js +1 -1
  209. package/dist/utils/highlightColors.mjs +1 -1
  210. package/dist/utils/index.d.mts +2 -3
  211. package/dist/utils/index.d.ts +2 -3
  212. package/dist/utils/index.js +3 -3
  213. package/dist/utils/index.mjs +3 -3
  214. package/dist/{variableDetector-CAdt8yOr.d.mts → variableDetector-C7BLz9sJ.d.mts} +1 -1
  215. package/dist/{variableDetector-W4XEN9YC.d.ts → variableDetector-HPZbJ_gw.d.ts} +1 -1
  216. package/package.json +3 -3
  217. package/dist/chunk-3AZWLVLC.js +0 -1
  218. package/dist/chunk-3NLVHZMT.js +0 -59
  219. package/dist/chunk-5SU4HPQS.mjs +0 -1
  220. package/dist/chunk-7PX32GLB.mjs +0 -1
  221. package/dist/chunk-AHXPHBMT.js +0 -1
  222. package/dist/chunk-B6LYBJ4H.mjs +0 -1
  223. package/dist/chunk-BFB4PRS4.mjs +0 -1
  224. package/dist/chunk-BRHHK4MG.mjs +0 -2
  225. package/dist/chunk-CP5OSG5Z.mjs +0 -1
  226. package/dist/chunk-CUXXRGPQ.mjs +0 -1
  227. package/dist/chunk-D4RPOJC7.js +0 -1
  228. package/dist/chunk-FWTP7BN7.mjs +0 -4
  229. package/dist/chunk-G7AKYAKU.mjs +0 -1
  230. package/dist/chunk-HAAMO2Z2.mjs +0 -1
  231. package/dist/chunk-ILJUDEZ5.mjs +0 -1
  232. package/dist/chunk-IN6IYQ2X.js +0 -1
  233. package/dist/chunk-IO6HZ7KR.js +0 -2
  234. package/dist/chunk-IP2VXNWG.js +0 -1
  235. package/dist/chunk-KBU6QQFU.js +0 -9
  236. package/dist/chunk-LBKMYD3M.mjs +0 -1
  237. package/dist/chunk-LDKESXXK.mjs +0 -3
  238. package/dist/chunk-MZOVDLYL.js +0 -1
  239. package/dist/chunk-N3EIZN65.js +0 -1
  240. package/dist/chunk-NBLJPT54.mjs +0 -1
  241. package/dist/chunk-NERY274X.js +0 -1
  242. package/dist/chunk-NNQWQOC5.mjs +0 -1
  243. package/dist/chunk-NO5LW2DQ.mjs +0 -1
  244. package/dist/chunk-OCAX2KJQ.js +0 -4
  245. package/dist/chunk-OTDF6PZK.js +0 -1
  246. package/dist/chunk-P3AXSRLG.mjs +0 -1
  247. package/dist/chunk-Q4CKLXWA.js +0 -1
  248. package/dist/chunk-QMLIXLZJ.mjs +0 -4
  249. package/dist/chunk-QXHL67FG.mjs +0 -1
  250. package/dist/chunk-TGPS3SRR.mjs +0 -1
  251. package/dist/chunk-TMISJEGL.js +0 -1
  252. package/dist/chunk-TRJWRZZD.js +0 -1
  253. package/dist/chunk-TRQN2SFW.mjs +0 -59
  254. package/dist/chunk-UGXSKZVM.js +0 -1
  255. package/dist/chunk-V435QKZB.js +0 -3
  256. package/dist/chunk-V6SWUCTS.js +0 -2
  257. package/dist/chunk-VQWZHPWI.mjs +0 -1
  258. package/dist/chunk-X3NB7STJ.js +0 -1
  259. package/dist/chunk-XOH7YAYL.js +0 -1
  260. package/dist/chunk-Y5HZAMND.mjs +0 -9
  261. package/dist/chunk-Y7I5QDCN.mjs +0 -1
  262. package/dist/chunk-YCDB5TA6.js +0 -4
  263. package/dist/chunk-YE357WVA.js +0 -1
  264. package/dist/chunk-YVYB4YCI.js +0 -1
  265. package/dist/lists-CvG_iVK3.d.mts +0 -148
  266. package/dist/lists-UTp_tk7B.d.ts +0 -148
@@ -1,2 +1,2 @@
1
- import {a,r,s,t,u,q,B,D,O,N,C,b as b$2}from'./chunk-QMLIXLZJ.mjs';import {b as b$1}from'./chunk-3JXR6YU4.mjs';import {p,l as l$1}from'./chunk-Y5HZAMND.mjs';import {a as a$3}from'./chunk-ILJUDEZ5.mjs';import {b,a as a$1}from'./chunk-HL5PQT3A.mjs';import {c,f,j,e,m,l,a as a$2,i}from'./chunk-B6LYBJ4H.mjs';import Ve from'jszip';async function G(e){let n=await Ve.loadAsync(e),t={documentXml:null,stylesXml:null,themeXml:null,numberingXml:null,fontTableXml:null,settingsXml:null,webSettingsXml:null,headers:new Map,footers:new Map,footnotesXml:null,endnotesXml:null,commentsXml:null,commentsExtensibleXml:null,commentsExtendedXml:null,documentRels:null,packageRels:null,contentTypesXml:null,corePropsXml:null,appPropsXml:null,customPropsXml:null,media:new Map,fonts:new Map,allXml:new Map,originalZip:n,originalBuffer:e};for(let[o,s]of Object.entries(n.files)){if(s.dir)continue;let r=o.toLowerCase();if(r.endsWith(".xml")||r.endsWith(".rels")){let a=await s.async("text");if(t.allXml.set(o,a),r==="word/document.xml")t.documentXml=a;else if(r==="word/styles.xml")t.stylesXml=a;else if(r==="word/theme/theme1.xml")t.themeXml=a;else if(r==="word/numbering.xml")t.numberingXml=a;else if(r==="word/fonttable.xml")t.fontTableXml=a;else if(r==="word/settings.xml")t.settingsXml=a;else if(r==="word/websettings.xml")t.webSettingsXml=a;else if(r==="word/footnotes.xml")t.footnotesXml=a;else if(r==="word/endnotes.xml")t.endnotesXml=a;else if(r==="word/comments.xml")t.commentsXml=a;else if(r==="word/commentsextensible.xml")t.commentsExtensibleXml=a;else if(r==="word/commentsextended.xml")t.commentsExtendedXml=a;else if(r==="word/_rels/document.xml.rels")t.documentRels=a;else if(r==="_rels/.rels")t.packageRels=a;else if(r==="[content_types].xml")t.contentTypesXml=a;else if(r==="docprops/core.xml")t.corePropsXml=a;else if(r==="docprops/app.xml")t.appPropsXml=a;else if(r==="docprops/custom.xml")t.customPropsXml=a;else if(r.match(/^word\/header\d+\.xml$/)){let c=o.split("/").pop()||o;t.headers.set(c,a);}else if(r.match(/^word\/footer\d+\.xml$/)){let c=o.split("/").pop()||o;t.footers.set(c,a);}}else if(r.startsWith("word/media/")){let a=await s.async("arraybuffer");t.media.set(o,a);}else if(r.startsWith("word/fonts/")){let a=await s.async("arraybuffer");t.fonts.set(o,a);}}return t}function Ce(e){switch(e.toLowerCase().split(".").pop()){case "png":return "image/png";case "jpg":case "jpeg":return "image/jpeg";case "gif":return "image/gif";case "bmp":return "image/bmp";case "tif":case "tiff":return "image/tiff";case "wmf":return "image/x-wmf";case "emf":return "image/x-emf";case "svg":return "image/svg+xml";case "webp":return "image/webp";default:return "application/octet-stream"}}function Y(e,n,t,o){let s={};return e&&e!=="auto"?s.rgb=e:e==="auto"&&(s.auto=true),n&&(s.themeColor=n),t&&(s.themeTint=t),o&&(s.themeShade=o),s}function $(e){if(!e)return;let n={},t=j(e,"w","color");t&&t!=="auto"&&(n.color={rgb:t});let o=j(e,"w","fill");o&&o!=="auto"&&(n.fill={rgb:o});let s=j(e,"w","themeFill");s&&(n.fill=n.fill||{},n.fill.themeColor=s);let r=j(e,"w","themeFillTint");r&&n.fill&&(n.fill.themeTint=r);let a=j(e,"w","themeFillShade");a&&n.fill&&(n.fill.themeShade=a);let c=j(e,"w","val");return c&&(n.pattern=c),Object.keys(n).length>0?n:void 0}function Z(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","b");o&&(t.bold=m(o));let s=e(e$1,"w","bCs");s&&(t.boldCs=m(s));let r=e(e$1,"w","i");r&&(t.italic=m(r));let a=e(e$1,"w","iCs");a&&(t.italicCs=m(a));let c=e(e$1,"w","u");if(c){let g=j(c,"w","val");if(g){t.underline={style:g};let k=j(c,"w","color"),j$1=j(c,"w","themeColor");(k||j$1)&&(t.underline.color=Y(k,j$1,j(c,"w","themeTint"),j(c,"w","themeShade")));}}let d=e(e$1,"w","strike");d&&(t.strike=m(d));let u=e(e$1,"w","dstrike");u&&(t.doubleStrike=m(u));let m$1=e(e$1,"w","vertAlign");if(m$1){let g=j(m$1,"w","val");(g==="superscript"||g==="subscript"||g==="baseline")&&(t.vertAlign=g);}let h=e(e$1,"w","smallCaps");h&&(t.smallCaps=m(h));let p=e(e$1,"w","caps");p&&(t.allCaps=m(p));let x=e(e$1,"w","vanish");x&&(t.hidden=m(x));let f=e(e$1,"w","color");f&&(t.color=Y(j(f,"w","val"),j(f,"w","themeColor"),j(f,"w","themeTint"),j(f,"w","themeShade")));let b=e(e$1,"w","highlight");if(b){let g=j(b,"w","val");g&&(t.highlight=g);}let T=e(e$1,"w","shd");T&&(t.shading=$(T));let M=e(e$1,"w","sz");if(M){let g=l(M,"w","val");g!==void 0&&(t.fontSize=g);}let X=e(e$1,"w","szCs");if(X){let g=l(X,"w","val");g!==void 0&&(t.fontSizeCs=g);}let P=e(e$1,"w","rFonts");if(P){t.fontFamily={ascii:j(P,"w","ascii")??void 0,hAnsi:j(P,"w","hAnsi")??void 0,eastAsia:j(P,"w","eastAsia")??void 0,cs:j(P,"w","cs")??void 0};let g=j(P,"w","asciiTheme");g&&(t.fontFamily.asciiTheme=g,n&&!t.fontFamily.ascii&&(t.fontFamily.ascii=b$2(n,g)));let k=j(P,"w","hAnsiTheme");k&&(t.fontFamily.hAnsiTheme=k,n&&!t.fontFamily.hAnsi&&(t.fontFamily.hAnsi=b$2(n,k)));let j$1=j(P,"w","eastAsiaTheme");j$1&&(t.fontFamily.eastAsiaTheme=j$1,n&&!t.fontFamily.eastAsia&&(t.fontFamily.eastAsia=b$2(n,j$1)));let B=j(P,"w","cstheme");B&&(t.fontFamily.csTheme=B,n&&!t.fontFamily.cs&&(t.fontFamily.cs=b$2(n,B)));}let F=e(e$1,"w","spacing");if(F){let g=l(F,"w","val");g!==void 0&&(t.spacing=g);}let y=e(e$1,"w","position");if(y){let g=l(y,"w","val");g!==void 0&&(t.position=g);}let S=e(e$1,"w","w");if(S){let g=l(S,"w","val");g!==void 0&&(t.scale=g);}let C=e(e$1,"w","kern");if(C){let g=l(C,"w","val");g!==void 0&&(t.kerning=g);}let D=e(e$1,"w","effect");if(D){let g=j(D,"w","val");g&&(t.effect=g);}let I=e(e$1,"w","em");if(I){let g=j(I,"w","val");g&&(t.emphasisMark=g);}let N=e(e$1,"w","emboss");N&&(t.emboss=m(N));let L=e(e$1,"w","imprint");L&&(t.imprint=m(L));let O=e(e$1,"w","outline");O&&(t.outline=m(O));let W=e(e$1,"w","shadow");W&&(t.shadow=m(W));let H=e(e$1,"w","rtl");H&&(t.rtl=m(H));let R=e(e$1,"w","cs");R&&(t.cs=m(R));let A=e(e$1,"w","rStyle");if(A){let g=j(A,"w","val");g&&(t.styleId=g);}return Object.keys(t).length>0?t:void 0}function E(e){if(!e)return;let n=j(e,"w","val");if(!n)return;let t={style:n},o=j(e,"w","color"),s=j(e,"w","themeColor");(o||s)&&(t.color=Y(o,s,j(e,"w","themeTint"),j(e,"w","themeShade")));let r=l(e,"w","sz");r!==void 0&&(t.size=r);let a=l(e,"w","space");a!==void 0&&(t.space=a);let c=j(e,"w","shadow");c&&(t.shadow=c==="1"||c==="true");let d=j(e,"w","frame");return d&&(t.frame=d==="1"||d==="true"),t}function je(e){if(!e)return;let n=f(e,"w","tab");if(n.length===0)return;let t=[];for(let o of n){let s=l(o,"w","pos"),r=j(o,"w","val");if(s!==void 0&&r){let a={position:s,alignment:r},c=j(o,"w","leader");c&&(a.leader=c),t.push(a);}}return t.length>0?t:void 0}function K(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","jc");if(o){let y=j(o,"w","val");y&&(t.alignment=y);}let s=e(e$1,"w","bidi");s&&(t.bidi=m(s));let r=e(e$1,"w","spacing");if(r){let y=l(r,"w","before");y!==void 0&&(t.spaceBefore=y);let S=l(r,"w","after");S!==void 0&&(t.spaceAfter=S);let C=l(r,"w","line");C!==void 0&&(t.lineSpacing=C);let D=j(r,"w","lineRule");D&&(t.lineSpacingRule=D);let I=j(r,"w","beforeAutospacing");I&&(t.beforeAutospacing=I==="1"||I==="true");let N=j(r,"w","afterAutospacing");N&&(t.afterAutospacing=N==="1"||N==="true");}let a=e(e$1,"w","ind");if(a){let y=l(a,"w","left");y!==void 0&&(t.indentLeft=y);let S=l(a,"w","right");S!==void 0&&(t.indentRight=S);let C=l(a,"w","firstLine");C!==void 0&&(t.indentFirstLine=C);let D=l(a,"w","hanging");D!==void 0&&(t.indentFirstLine=-D,t.hangingIndent=true);}let c=e(e$1,"w","pBdr");if(c){let y={},S=E(e(c,"w","top"));S&&(y.top=S);let C=E(e(c,"w","bottom"));C&&(y.bottom=C);let D=E(e(c,"w","left"));D&&(y.left=D);let I=E(e(c,"w","right"));I&&(y.right=I);let N=E(e(c,"w","between"));N&&(y.between=N);let L=E(e(c,"w","bar"));L&&(y.bar=L),Object.keys(y).length>0&&(t.borders=y);}let d=e(e$1,"w","shd");d&&(t.shading=$(d));let u=e(e$1,"w","tabs");u&&(t.tabs=je(u));let m$1=e(e$1,"w","keepNext");m$1&&(t.keepNext=m(m$1));let h=e(e$1,"w","keepLines");h&&(t.keepLines=m(h));let p=e(e$1,"w","widowControl");p&&(t.widowControl=m(p));let x=e(e$1,"w","pageBreakBefore");x&&(t.pageBreakBefore=m(x));let f=e(e$1,"w","contextualSpacing");f&&(t.contextualSpacing=m(f));let b=e(e$1,"w","numPr");if(b){let y=e(b,"w","numId"),S=e(b,"w","ilvl");if(y||S){if(t.numPr={},y){let C=l(y,"w","val");C!==void 0&&(t.numPr.numId=C);}if(S){let C=l(S,"w","val");C!==void 0&&(t.numPr.ilvl=C);}}}let T=e(e$1,"w","outlineLvl");if(T){let y=l(T,"w","val");y!==void 0&&(t.outlineLevel=y);}let M=e(e$1,"w","pStyle");if(M){let y=j(M,"w","val");y&&(t.styleId=y);}let X=e(e$1,"w","suppressLineNumbers");X&&(t.suppressLineNumbers=m(X));let P=e(e$1,"w","suppressAutoHyphens");P&&(t.suppressAutoHyphens=m(P));let F=e(e$1,"w","rPr");return F&&(t.runProperties=Z(F,n)),Object.keys(t).length>0?t:void 0}function U(e){if(!e)return;let n=l(e,"w","w"),t=j(e,"w","type");if(n!==void 0&&t)return {value:n,type:t}}function Pe(e$1){if(!e$1)return;let n={},t=E(e(e$1,"w","top"));t&&(n.top=t);let o=E(e(e$1,"w","bottom"));o&&(n.bottom=o);let s=E(e(e$1,"w","left"));s&&(n.left=s);let r=E(e(e$1,"w","right"));r&&(n.right=r);let a=E(e(e$1,"w","insideH"));a&&(n.insideH=a);let c=E(e(e$1,"w","insideV"));return c&&(n.insideV=c),Object.keys(n).length>0?n:void 0}function Fe(e$1){if(!e$1)return;let n={},t=U(e(e$1,"w","top"));t&&(n.top=t);let o=U(e(e$1,"w","bottom"));o&&(n.bottom=o);let s=U(e(e$1,"w","left"));s&&(n.left=s);let r=U(e(e$1,"w","right"));return r&&(n.right=r),Object.keys(n).length>0?n:void 0}function Oe(e){if(!e)return;let n={},t=j(e,"w","val");if(t){let u=parseInt(t,16);isNaN(u)||(n.firstRow=(u&32)!==0,n.lastRow=(u&64)!==0,n.firstColumn=(u&128)!==0,n.lastColumn=(u&256)!==0,n.noHBand=(u&512)!==0,n.noVBand=(u&1024)!==0);}let o=j(e,"w","firstColumn");o&&(n.firstColumn=o==="1");let s=j(e,"w","firstRow");s&&(n.firstRow=s==="1");let r=j(e,"w","lastColumn");r&&(n.lastColumn=r==="1");let a=j(e,"w","lastRow");a&&(n.lastRow=a==="1");let c=j(e,"w","noHBand");c&&(n.noHBand=c==="1");let d=j(e,"w","noVBand");return d&&(n.noVBand=d==="1"),Object.keys(n).length>0?n:void 0}function se(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","tblW");o&&(t.width=U(o));let s=e(e$1,"w","jc");if(s){let f=j(s,"w","val");(f==="left"||f==="center"||f==="right")&&(t.justification=f);}let r=e(e$1,"w","tblCellSpacing");r&&(t.cellSpacing=U(r));let a=e(e$1,"w","tblInd");a&&(t.indent=U(a));let c=e(e$1,"w","tblBorders");c&&(t.borders=Pe(c));let d=e(e$1,"w","tblCellMar");d&&(t.cellMargins=Fe(d));let u=e(e$1,"w","tblLayout");if(u){let f=j(u,"w","type");(f==="fixed"||f==="autofit")&&(t.layout=f);}let m$1=e(e$1,"w","tblStyle");if(m$1){let f=j(m$1,"w","val");f&&(t.styleId=f);}let h=e(e$1,"w","tblLook");h&&(t.look=Oe(h));let p=e(e$1,"w","shd");p&&(t.shading=$(p));let x=e(e$1,"w","bidiVisual");return x&&(t.bidi=m(x)),Object.keys(t).length>0?t:void 0}function ae(e$1){if(!e$1)return;let n={},t=e(e$1,"w","trHeight");if(t){n.height=U(t);let c=j(t,"w","hRule");c&&(n.heightRule=c);}let o=e(e$1,"w","tblHeader");o&&(n.header=m(o));let s=e(e$1,"w","cantSplit");s&&(n.cantSplit=m(s));let r=e(e$1,"w","jc");if(r){let c=j(r,"w","val");(c==="left"||c==="center"||c==="right")&&(n.justification=c);}let a=e(e$1,"w","hidden");return a&&(n.hidden=m(a)),Object.keys(n).length>0?n:void 0}function le(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","tcW");o&&(t.width=U(o));let s=e(e$1,"w","tcBorders");s&&(t.borders=Pe(s));let r=e(e$1,"w","tcMar");r&&(t.margins=Fe(r));let a=e(e$1,"w","shd");a&&(t.shading=$(a));let c=e(e$1,"w","vAlign");if(c){let f=j(c,"w","val");(f==="top"||f==="center"||f==="bottom")&&(t.verticalAlign=f);}let d=e(e$1,"w","textDirection");if(d){let f=j(d,"w","val");f&&(t.textDirection=f);}let u=e(e$1,"w","gridSpan");if(u){let f=l(u,"w","val");f!==void 0&&(t.gridSpan=f);}let m$1=e(e$1,"w","vMerge");if(m$1){let f=j(m$1,"w","val");t.vMerge=f==="restart"?"restart":"continue";}let h=e(e$1,"w","tcFitText");h&&(t.fitText=m(h));let p=e(e$1,"w","noWrap");p&&(t.noWrap=m(p));let x=e(e$1,"w","hideMark");return x&&(t.hideMark=m(x)),Object.keys(t).length>0?t:void 0}function He(e$1,n){let t={styleId:j(e$1,"w","styleId")??"",type:j(e$1,"w","type")??"paragraph"},o=j(e$1,"w","default");o&&(t.default=o==="1"||o==="true");let s=e(e$1,"w","name");s&&(t.name=j(s,"w","val")??void 0);let r=e(e$1,"w","basedOn");r&&(t.basedOn=j(r,"w","val")??void 0);let a=e(e$1,"w","next");a&&(t.next=j(a,"w","val")??void 0);let c=e(e$1,"w","link");c&&(t.link=j(c,"w","val")??void 0);let d=e(e$1,"w","uiPriority");if(d){let F=l(d,"w","val");F!==void 0&&(t.uiPriority=F);}let u=e(e$1,"w","hidden");u&&(t.hidden=m(u));let m$1=e(e$1,"w","semiHidden");m$1&&(t.semiHidden=m(m$1));let h=e(e$1,"w","unhideWhenUsed");h&&(t.unhideWhenUsed=m(h));let p=e(e$1,"w","qFormat");p&&(t.qFormat=m(p));let x=e(e$1,"w","personal");x&&(t.personal=m(x));let f$1=e(e$1,"w","pPr");f$1&&(t.pPr=K(f$1,n));let b=e(e$1,"w","rPr");b&&(t.rPr=Z(b,n));let T=e(e$1,"w","tblPr");T&&(t.tblPr=se(T));let M=e(e$1,"w","trPr");M&&(t.trPr=ae(M));let X=e(e$1,"w","tcPr");X&&(t.tcPr=le(X));let P=f(e$1,"w","tblStylePr");if(P.length>0){t.tblStylePr=[];for(let F of P){let y=j(F,"w","type");if(y){let S={type:y},C=e(F,"w","pPr");C&&(S.pPr=K(C,n));let D=e(F,"w","rPr");D&&(S.rPr=Z(D,n));let I=e(F,"w","tblPr");I&&(S.tblPr=se(I));let N=e(F,"w","trPr");N&&(S.trPr=ae(N));let L=e(F,"w","tcPr");L&&(S.tcPr=le(L)),t.tblStylePr.push(S);}}}return t}function Ue(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","rPrDefault");if(o){let r=e(o,"w","rPr");r&&(t.rPr=Z(r,n));}let s=e(e$1,"w","pPrDefault");if(s){let r=e(s,"w","pPr");r&&(t.pPr=K(r,n));}return t.rPr||t.pPr?t:void 0}function We(e,n){if(!n)return e;if(!e)return n?{...n}:void 0;let t={...e};for(let o of Object.keys(n)){let s=n[o];if(s!==void 0)if(o==="runProperties")t.runProperties=a$3(t.runProperties,n.runProperties);else if(o==="borders"||o==="numPr"||o==="frame"){let r=t[o],a=s;t[o]={...r||{},...a||{}};}else o==="tabs"&&Array.isArray(s)?t.tabs=[...s]:t[o]=s;}return t}function Ne(e,n,t,o=new Set){if(o.has(e.styleId)||(o.add(e.styleId),!e.basedOn))return e;let s=n.get(e.basedOn);if(!s)return e;let r=Ne(s,n,t,o),a={...e,pPr:We(r.pPr,e.pPr),rPr:a$3(r.rPr,e.rPr)};return e.type==="table"&&((r.tblPr||e.tblPr)&&(a.tblPr={...r.tblPr||{},...e.tblPr||{}}),(r.trPr||e.trPr)&&(a.trPr={...r.trPr||{},...e.trPr||{}}),(r.tcPr||e.tcPr)&&(a.tcPr={...r.tcPr||{},...e.tcPr||{}})),a}function ce(e,n){let t=new Map;try{let o=c(e);if(!o)return t;let s=f(o,"w","style");for(let r of s){let a=He(r,n);a.styleId&&t.set(a.styleId,a);}for(let[r,a]of t){let c=Ne(a,t,n);t.set(r,c);}}catch(o){console.warn("Failed to parse styles:",o);}return t}function Me(e$1,n){let t={styles:[]};try{let o=c(e$1);if(!o)return t;let s=e(o,"w","docDefaults");t.docDefaults=Ue(s,n);let r=e(o,"w","latentStyles");r&&(t.latentStyles={defLockedState:j(r,"w","defLockedState")==="1",defUIPriority:l(r,"w","defUIPriority"),defSemiHidden:j(r,"w","defSemiHidden")==="1",defUnhideWhenUsed:j(r,"w","defUnhideWhenUsed")==="1",defQFormat:j(r,"w","defQFormat")==="1",count:l(r,"w","count")});let a=ce(e$1,n);t.styles=Array.from(a.values());}catch(o){console.warn("Failed to parse style definitions:",o);}return t}function Ie(e){let n={abstractNums:[],nums:[]};if(!e)return fe(n);let t=c(e);if(!t)return fe(n);let o=f(t,"w","abstractNum");for(let r of o){let a=ze(r);a&&n.abstractNums.push(a);}let s=f(t,"w","num");for(let r of s){let a=$e(r);a&&n.nums.push(a);}return fe(n)}function ze(e$1){let n=j(e$1,"w","abstractNumId");if(n===null)return null;let t=parseInt(n,10);if(isNaN(t))return null;let o={abstractNumId:t,levels:[]},s=e(e$1,"w","multiLevelType");if(s){let u=j(s,"w","val");(u==="hybridMultilevel"||u==="multilevel"||u==="singleLevel")&&(o.multiLevelType=u);}let r=e(e$1,"w","name");r&&(o.name=j(r,"w","val")??void 0);let a=e(e$1,"w","numStyleLink");a&&(o.numStyleLink=j(a,"w","val")??void 0);let c=e(e$1,"w","styleLink");c&&(o.styleLink=j(c,"w","val")??void 0);let d=f(e$1,"w","lvl");for(let u of d){let m=Ae(u);m&&o.levels.push(m);}return o.levels.sort((u,m)=>u.ilvl-m.ilvl),o}function $e(e$1){let n=j(e$1,"w","numId");if(n===null)return null;let t=parseInt(n,10);if(isNaN(t))return null;let o=e(e$1,"w","abstractNumId");if(!o)return null;let s=j(o,"w","val");if(s===null)return null;let r=parseInt(s,10);if(isNaN(r))return null;let a={numId:t,abstractNumId:r},c=f(e$1,"w","lvlOverride");if(c.length>0){a.levelOverrides=[];for(let d of c){let u=j(d,"w","ilvl");if(u===null)continue;let m=parseInt(u,10);if(isNaN(m))continue;let h={ilvl:m},p=e(d,"w","startOverride");if(p){let f=j(p,"w","val");if(f!==null){let b=parseInt(f,10);isNaN(b)||(h.startOverride=b);}}let x=e(d,"w","lvl");x&&(h.lvl=Ae(x)??void 0),a.levelOverrides.push(h);}}return a}function Ae(e$1){let n=j(e$1,"w","ilvl");if(n===null)return null;let t=parseInt(n,10);if(isNaN(t)||t<0||t>8)return null;let o={ilvl:t,numFmt:"decimal",lvlText:""},s=e(e$1,"w","start");if(s){let f=j(s,"w","val");if(f!==null){let b=parseInt(f,10);isNaN(b)||(o.start=b);}}let r=e(e$1,"w","numFmt");if(r){let f=j(r,"w","val");f&&(o.numFmt=Ze(f));}let a=e(e$1,"w","lvlText");a&&(o.lvlText=j(a,"w","val")??"");let c=e(e$1,"w","lvlJc");if(c){let f=j(c,"w","val");(f==="left"||f==="center"||f==="right")&&(o.lvlJc=f);}let d=e(e$1,"w","suff");if(d){let f=j(d,"w","val");(f==="tab"||f==="space"||f==="nothing")&&(o.suffix=f);}let u=e(e$1,"w","isLgl");u&&(o.isLgl=m(u));let m$1=e(e$1,"w","lvlRestart");if(m$1){let f=j(m$1,"w","val");if(f!==null){let b=parseInt(f,10);isNaN(b)||(o.lvlRestart=b);}}let h=e(e$1,"w","legacy");h&&(o.legacy={legacy:m(h),legacySpace:l(h,"w","legacySpace"),legacyIndent:l(h,"w","legacyIndent")});let p=e(e$1,"w","pPr");p&&(o.pPr=_e(p));let x=e(e$1,"w","rPr");return x&&(o.rPr=Qe(x)),o}function Ze(e){return {decimal:"decimal",upperRoman:"upperRoman",lowerRoman:"lowerRoman",upperLetter:"upperLetter",lowerLetter:"lowerLetter",ordinal:"ordinal",cardinalText:"cardinalText",ordinalText:"ordinalText",hex:"hex",chicago:"chicago",bullet:"bullet",none:"none",decimalZero:"decimalZero",ganada:"ganada",chosung:"chosung",ideographDigital:"ideographDigital",japaneseCounting:"japaneseCounting",aiueo:"aiueo",iroha:"iroha",decimalFullWidth:"decimalFullWidth",decimalHalfWidth:"decimalHalfWidth",japaneseLegal:"japaneseLegal",japaneseDigitalTenThousand:"japaneseDigitalTenThousand",decimalEnclosedCircle:"decimalEnclosedCircle",decimalFullWidth2:"decimalFullWidth2",aiueoFullWidth:"aiueoFullWidth",irohaFullWidth:"irohaFullWidth",decimalEnclosedFullstop:"decimalEnclosedFullstop",decimalEnclosedParen:"decimalEnclosedParen",decimalEnclosedCircleChinese:"decimalEnclosedCircleChinese",ideographEnclosedCircle:"ideographEnclosedCircle",ideographTraditional:"ideographTraditional",ideographZodiac:"ideographZodiac",ideographZodiacTraditional:"ideographZodiacTraditional",taiwaneseCounting:"taiwaneseCounting",ideographLegalTraditional:"ideographLegalTraditional",taiwaneseCountingThousand:"taiwaneseCountingThousand",taiwaneseDigital:"taiwaneseDigital",chineseCounting:"chineseCounting",chineseLegalSimplified:"chineseLegalSimplified",chineseCountingThousand:"chineseCountingThousand",koreanDigital:"koreanDigital",koreanCounting:"koreanCounting",koreanLegal:"koreanLegal",koreanDigital2:"koreanDigital2",vietnameseCounting:"vietnameseCounting",russianLower:"russianLower",russianUpper:"russianUpper",numberInDash:"numberInDash",hebrew1:"hebrew1",hebrew2:"hebrew2",arabicAlpha:"arabicAlpha",arabicAbjad:"arabicAbjad",hindiVowels:"hindiVowels",hindiConsonants:"hindiConsonants",hindiNumbers:"hindiNumbers",hindiCounting:"hindiCounting",thaiLetters:"thaiLetters",thaiNumbers:"thaiNumbers",thaiCounting:"thaiCounting"}[e]??"decimal"}function _e(e$1){let n={},t=e(e$1,"w","ind");if(t){let s=l(t,"w","left"),r=l(t,"w","right"),a=l(t,"w","start"),c=l(t,"w","end"),d=l(t,"w","firstLine"),u=l(t,"w","hanging"),m=s??a,h=r??c;m!==void 0&&(n.indentLeft=m),h!==void 0&&(n.indentRight=h),u!==void 0?(n.indentFirstLine=-u,n.hangingIndent=true):d!==void 0&&(n.indentFirstLine=d);}let o=e(e$1,"w","tabs");if(o){n.tabs=[];let s=f(o,"w","tab");for(let r of s){let a=l(r,"w","pos"),c=j(r,"w","val"),d=j(r,"w","leader");a!==void 0&&c&&n.tabs.push({position:a,alignment:Je(c),leader:qe(d)});}}return n}function Je(e){switch(e){case "left":return "left";case "center":return "center";case "right":return "right";case "decimal":return "decimal";case "bar":return "bar";case "clear":return "clear";case "num":return "num";default:return "left"}}function qe(e){if(e)switch(e){case "none":return "none";case "dot":return "dot";case "hyphen":return "hyphen";case "underscore":return "underscore";case "heavy":return "heavy";case "middleDot":return "middleDot";default:return}}function Qe(e$1){let n={},t=e(e$1,"w","rFonts");t&&(n.fontFamily={ascii:j(t,"w","ascii")??void 0,hAnsi:j(t,"w","hAnsi")??void 0,eastAsia:j(t,"w","eastAsia")??void 0,cs:j(t,"w","cs")??void 0});let o=e(e$1,"w","sz");if(o){let d=l(o,"w","val");d!==void 0&&(n.fontSize=d);}let s=e(e$1,"w","color");if(s){let d=j(s,"w","val"),u=j(s,"w","themeColor");d==="auto"?n.color={auto:true}:u?n.color={themeColor:u,themeTint:j(s,"w","themeTint")??void 0,themeShade:j(s,"w","themeShade")??void 0}:d&&(n.color={rgb:d});}let r=e(e$1,"w","b");r&&(n.bold=m(r));let a=e(e$1,"w","i");a&&(n.italic=m(a));let c=e(e$1,"w","vanish");return c&&(n.hidden=m(c)),n}function fe(e){let n=new Map;for(let o of e.abstractNums)n.set(o.abstractNumId,o);let t=new Map;for(let o of e.nums)t.set(o.numId,o);return {definitions:e,getLevel(o,s){let r=t.get(o);if(!r)return null;if(r.levelOverrides){let c=r.levelOverrides.find(d=>d.ilvl===s);if(c){if(c.lvl)return c.lvl;let d=n.get(r.abstractNumId);if(d){let u=d.levels.find(m=>m.ilvl===s);if(u&&c.startOverride!==void 0)return {...u,start:c.startOverride}}}}let a=n.get(r.abstractNumId);if(!a)return null;if(a.numStyleLink&&a.levels.length===0){for(let c of n.values())if(c.styleLink===a.numStyleLink&&c.levels.length>0){a=c;break}}return a.levels.find(c=>c.ilvl===s)??null},getAbstract(o){return n.get(o)??null},getInstance(o){return t.get(o)??null},hasNumbering(o){return t.has(o)}}}function Ge(e,n){switch(n){case "decimal":case "decimalZero":return e.toString();case "upperRoman":return De(e).toUpperCase();case "lowerRoman":return De(e).toLowerCase();case "upperLetter":return Xe(e).toUpperCase();case "lowerLetter":return Xe(e).toLowerCase();case "ordinal":return Ye(e);case "bullet":return "\u2022";case "none":return "";case "decimalEnclosedParen":return `(${e})`;case "numberInDash":return `-${e}-`;default:return e.toString()}}function De(e){if(e<=0||e>3999)return e.toString();let n=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],t="",o=e;for(let[s,r]of n)for(;o>=s;)t+=r,o-=s;return t}function Xe(e){if(e<=0)return "";let n="",t=e;for(;t>0;)t--,n=String.fromCharCode(97+t%26)+n,t=Math.floor(t/26);return n}function Ye(e){let n=["th","st","nd","rd"],t=e%100;return e+(n[(t-20)%10]||n[t]||n[0])}function Pt(e,n,t){let o=e;for(let s=1;s<=9;s++){let r=`%${s}`;if(o.includes(r)){let a=s-1,c=n[a]??1,d=t[a]??"decimal",u=Ge(c,d);o=o.replace(r,u);}}return o}function Ft(e){if(e.lvlText)return e.lvlText;let n=e.rPr?.fontFamily?.ascii||e.rPr?.fontFamily?.hAnsi;if(n){let t=n.toLowerCase();if(t==="symbol")return "\u2022";if(t.includes("wingding"))return "\u2751"}return "\u2022"}function Nt(e){return e.numFmt==="bullet"||e.numFmt==="none"}var Le=/\{([a-zA-Z_][a-zA-Z0-9_\-\.]*)\}/g;function ke(e){let n=[],t;for(Le.lastIndex=0;(t=Le.exec(e))!==null;){let o=t[1].trim();o&&!n.includes(o)&&n.push(o);}return n}function ee(e){let n=[];for(let t of e)if(t.type==="paragraph"){let o=N(t),s=ke(o);for(let r of s)n.includes(r)||n.push(r);}else if(t.type==="table"){let o=Ee(t);for(let s of o)n.includes(s)||n.push(s);}return n}function Ee(e){let n=[];for(let t of e.rows)for(let o of t.cells)for(let s of o.content)if(s.type==="paragraph"){let r=N(s),a=ke(r);for(let c of a)n.includes(c)||n.push(c);}else if(s.type==="table"){let r=Ee(s);for(let a of r)n.includes(a)||n.push(a);}return n}function Ke(e,n){let t=[],o=[];for(let s of e)o.push(s),s.type==="paragraph"&&s.sectionProperties&&(t.push({properties:s.sectionProperties,content:o}),o=[]);return (o.length>0||t.length===0)&&t.push({properties:n??C(),content:o}),t}function te(e$1,n=null,t=null,o=null,s=null,r=null){let a={content:[]};if(!e$1)return a;let c=a$2(e$1);if(!c)return a;let d=(c.elements??[]).find(p=>p.type==="element"&&(p.name==="w:document"||p.name?.endsWith(":document")));if(!d)return a;let u=e(d,"w","body");if(!u)return a;a.content=q(u,n,t,o,s,r);let m=e(u,"w","sectPr");m&&(a.finalSectionProperties=B(m,s));let h=Ke(a.content,a.finalSectionProperties);return a.sections=D(h),a.finalSectionProperties&&a.sections.length>0&&(a.finalSectionProperties=a.sections[a.sections.length-1].properties),a}function et(e$1){let n=new Map,t=a$2(e$1);if(!t)return n;let o=e(t,"w16cex","commentsExtensible")??t;for(let s of i(o)){if((s.name?.replace(/^.*:/,"")??"")!=="comment")continue;let a=j(s,"w16cex","paraId")??j(s,"w15","paraId")??s.attributes?.["w16cex:paraId"]??s.attributes?.["w15:paraId"],c=j(s,"w16cex","dateUtc")??j(s,"w15","dateUtc")??s.attributes?.["w16cex:dateUtc"]??s.attributes?.["w15:dateUtc"];a&&c&&n.set(String(a).toUpperCase(),String(c));}return n}function tt(e$1){let n=new Map,t=new Map,o=a$2(e$1);if(!o)return {parentByParaId:n,doneByParaId:t};let s=e(o,"w15","commentsEx")??o;for(let r of i(s)){if((r.name?.replace(/^.*:/,"")??"")!=="commentEx")continue;let c=j(r,"w15","paraId")??r.attributes?.["w15:paraId"],d=j(r,"w15","paraIdParent")??r.attributes?.["w15:paraIdParent"],u=j(r,"w15","done")??r.attributes?.["w15:done"];if(c){let m=String(c).toUpperCase();d&&n.set(m,String(d).toUpperCase()),u==="1"&&t.set(m,true);}}return {parentByParaId:n,doneByParaId:t}}function Re(e$1,n,t,o,s,r,a){if(!e$1)return [];let c=a$2(e$1);if(!c)return [];let d=r?et(r):new Map,u=a?tt(a):null,m=e(c,"w","comments")??c,h=i(m),p=[],x=[];for(let f of h){if((f.name?.replace(/^.*:/,"")??"")!=="comment")continue;let T=parseInt(j(f,"w","id")??"0",10),M=j(f,"w","author")??"Unknown",X=j(f,"w","initials"),P=X!=null?String(X):void 0,F=j(f,"w","date"),y=F!=null?String(F):void 0,S=j(f,"w14","paraId")??f.attributes?.["w14:paraId"]??j(f,"w","paraId"),D=(S?d.get(String(S).toUpperCase()):void 0)??y,I=j(f,"w","done")??f.attributes?.["w:done"],N=I==="1"||I==="true"?true:void 0,L=j(f,"w16cid","parentId")??j(f,"w","parentId")??f.attributes?.["w16cid:parentId"]??f.attributes?.["w:parentId"],O$1=L!=null?parseInt(String(L),10):void 0,W=[],H="";for(let R of i(f))if((R.name?.replace(/^.*:/,"")??"")==="p"){let g=O(R,n,t,null,o,s);W.push(g);let k=j(R,"w14","paraId")??R.attributes?.["w14:paraId"];k&&(H=String(k).toUpperCase());}N==null&&u&&H&&u.doneByParaId.get(H)&&(N=true),x.push(H),p.push({id:T,author:M,initials:P,date:D,content:W,...N!=null?{done:N}:{},...O$1!=null&&!isNaN(O$1)?{parentId:O$1}:{}});}if(u&&u.parentByParaId.size>0){let f=new Map;for(let b=0;b<p.length;b++){let T=x[b];T&&f.set(T,p[b].id);}for(let b=0;b<p.length;b++){if(p[b].parentId!=null)continue;let T=x[b];if(!T)continue;let M=u.parentByParaId.get(T);if(!M)continue;let X=f.get(M);X!=null&&(p[b]={...p[b],parentId:X});}}return p}async function Be(e,n={}){let t=e instanceof ArrayBuffer?e:await p(e),{onProgress:o=()=>{},preloadFonts:s=true,parseHeadersFooters:r=true,parseNotes:a$1=true,detectVariables:c=true}=n,d=[];try{let p=function(A,g){let k=performance.now(),j=g(),B=performance.now()-k;return h.push({stage:A,ms:B}),B>1e3&&console.warn(`[parseDocx] ${A} took ${Math.round(B)}ms`),j};var u=p;let m=performance.now(),h=[];async function x(A,g){let k=performance.now(),j=await g(),B=performance.now()-k;return h.push({stage:A,ms:B}),B>1e3&&console.warn(`[parseDocx] ${A} took ${Math.round(B)}ms`),j}o("Extracting DOCX...",0);let f=await x("unzip",()=>G(t));o("Extracted DOCX",10),o("Parsing relationships...",10);let b$2=p("relationships",()=>f.documentRels?b(f.documentRels):new Map);o("Parsed relationships",15),o("Parsing theme...",15);let T=p("theme",()=>a(f.themeXml));o("Parsed theme",20),o("Parsing styles...",20);let M=null,X;p("styles",()=>{f.stylesXml&&(M=ce(f.stylesXml,T),X=Me(f.stylesXml,T));}),o("Parsed styles",30),o("Parsing numbering...",30);let P=p("numbering",()=>Ie(f.numberingXml)),F=p("settings",()=>b$1(f.settingsXml));o("Parsed numbering",35),o("Processing media files...",35);let y=p("media",()=>nt(f,b$2));o("Processed media",40),o("Parsing document body...",40);let S={content:[]};p("documentBody",()=>{f.documentXml?S=te(f.documentXml,M,T,P,b$2,y):d.push("No document.xml found in DOCX");}),o("Parsed document body",55);let C,D;if(r){o("Parsing headers/footers...",55);let A=p("headersFooters",()=>ot(f,M,T,P,b$2,y));C=A.headers,D=A.footers,o("Parsed headers/footers",65);}else o("Skipping headers/footers",65);let I,N;if(a$1){o("Parsing footnotes/endnotes...",65);let A=p("footnotesEndnotes",()=>rt(f,M,T,P,b$2,y));I=A.footnotes,N=A.endnotes,o("Parsed footnotes/endnotes",75);}else o("Skipping footnotes/endnotes",75);o("Parsing comments...",75);let L=p("comments",()=>Re(f.commentsXml,M,T,b$2,y,f.commentsExtensibleXml,f.commentsExtendedXml));L.length>0&&(S.comments=L);let O;c?(o("Detecting template variables...",75),O=p("variables",()=>ee(S.content)),o("Detected variables",80)):o("Skipping variable detection",80),s?(o("Loading fonts...",80),await x("fonts",()=>it(T,X,S)),o("Loaded fonts",95)):o("Skipping font loading",95),o("Assembling document...",95);let H={package:{document:S,styles:X,theme:T,numbering:P.definitions,settings:F,headers:C,footers:D,footnotes:I,endnotes:N,relationships:b$2,media:y},originalBuffer:t,templateVariables:O,warnings:d.length>0?d:void 0},R=performance.now()-m;if(R>2e3){let A=h.filter(g=>g.ms>100).map(g=>`${g.stage}: ${Math.round(g.ms)}ms`).join(", ");console.warn(`[parseDocx] Total: ${Math.round(R)}ms`+(A?` (${A})`:""));}return o("Complete",100),H}catch(m){let h=m instanceof Error?m.message:String(m);throw console.error("[parseDocx] Failed to parse DOCX:",h,m),new Error(`Failed to parse DOCX: ${h}`)}}function nt(e,n){let t=new Map;for(let[o,s]of e.media.entries()){let r=o.split("/").pop()||o,a=Ce(o),c=new Uint8Array(s),d="";for(let x=0;x<c.length;x++)d+=String.fromCharCode(c[x]);let u=btoa(d),m=`data:${a};base64,${u}`,h={path:o,filename:r,mimeType:a,data:s,dataUrl:m};t.set(o,h);let p=o.replace(/^word\//,"");p!==o&&t.set(p,h);}return t}function ne(e,n){let t=n.toLowerCase();for(let[o,s]of e.entries())if(o.toLowerCase()===t)return s}function ot(e,n,t,o,s$1,r$1){let a=new Map,c=new Map;for(let[d,u]of s$1.entries())if(u.type===a$1.header&&u.target){let m=u.target.split("/").pop()||u.target,h=ne(e.headers,m);if(h){let p=`word/_rels/${m}.rels`,x=ne(e.allXml,p),f=x?b(x):s$1,b$1=r(h,"default",n,t,o,f,r$1);a.set(d,b$1);}}else if(u.type===a$1.footer&&u.target){let m=u.target.split("/").pop()||u.target,h=ne(e.footers,m);if(h){let p=`word/_rels/${m}.rels`,x=ne(e.allXml,p),f=x?b(x):s$1,b$1=s(h,"default",n,t,o,f,r$1);c.set(d,b$1);}}return {headers:a,footers:c}}function rt(e,n,t$1,o,s,r){let a=t(e.footnotesXml,n,t$1,o,s,r),c=u(e.endnotesXml,n,t$1,o,s,r);return {footnotes:a.getNormalFootnotes(),endnotes:c.getNormalEndnotes()}}async function it(e,n,t){let o=new Set;if(e?.fontScheme){let{majorFont:s,minorFont:r}=e.fontScheme;s?.latin&&o.add(s.latin),r?.latin&&o.add(r.latin);}if(n?.docDefaults?.rPr?.fontFamily?.ascii&&o.add(n.docDefaults.rPr.fontFamily.ascii),n?.styles)for(let s of n.styles)s.rPr?.fontFamily?.ascii&&o.add(s.rPr.fontFamily.ascii),s.rPr?.fontFamily?.hAnsi&&o.add(s.rPr.fontFamily.hAnsi);if(t.content){for(let s of t.content)if(s.type==="paragraph")for(let r of s.content)r.type==="run"&&r.formatting?.fontFamily&&(r.formatting.fontFamily.ascii&&o.add(r.formatting.fontFamily.ascii),r.formatting.fontFamily.hAnsi&&o.add(r.formatting.fontFamily.hAnsi));}if(o.size>0)try{await l$1(Array.from(o));}catch(s){console.warn("Failed to load some fonts:",s);}}async function qt(e){return Be(e,{preloadFonts:false,parseHeadersFooters:false,parseNotes:false,detectVariables:true})}async function Qt(e,n){return Be(e,{onProgress:n,preloadFonts:true,parseHeadersFooters:true,parseNotes:true,detectVariables:true})}async function Gt(e){let n=await G(e);if(!n.documentXml)return [];let t=te(n.documentXml);return ee(t.content)}async function Yt(e){let n=await G(e),t=n.documentXml?ee(te(n.documentXml).content):[];return {hasDocument:n.documentXml!==null,hasStyles:n.stylesXml!==null,hasTheme:n.themeXml!==null,hasNumbering:n.numberingXml!==null,headerCount:n.headers.size,footerCount:n.footers.size,mediaCount:n.media.size,variableCount:t.length}}
1
+ import {a,r,s as s$1,t,u,q,B,D,O,N,C,b as b$3}from'./chunk-7ZN4WI5N.mjs';import {b as b$1}from'./chunk-BOOHU5EW.mjs';import {s,o}from'./chunk-7LRR7RKE.mjs';import {b,a as a$1}from'./chunk-OEXVWIHW.mjs';import {c,f,j,e,m,l,a as a$2,i}from'./chunk-WLHNIXWC.mjs';import {b as b$2}from'./chunk-DI6CRWSW.mjs';import Ve from'jszip';async function G(e){let n=await Ve.loadAsync(e),t={documentXml:null,stylesXml:null,themeXml:null,numberingXml:null,fontTableXml:null,settingsXml:null,webSettingsXml:null,headers:new Map,footers:new Map,footnotesXml:null,endnotesXml:null,commentsXml:null,commentsExtensibleXml:null,commentsExtendedXml:null,documentRels:null,packageRels:null,contentTypesXml:null,corePropsXml:null,appPropsXml:null,customPropsXml:null,media:new Map,fonts:new Map,allXml:new Map,originalZip:n,originalBuffer:e};for(let[o,s]of Object.entries(n.files)){if(s.dir)continue;let r=o.toLowerCase();if(r.endsWith(".xml")||r.endsWith(".rels")){let a=await s.async("text");if(t.allXml.set(o,a),r==="word/document.xml")t.documentXml=a;else if(r==="word/styles.xml")t.stylesXml=a;else if(r==="word/theme/theme1.xml")t.themeXml=a;else if(r==="word/numbering.xml")t.numberingXml=a;else if(r==="word/fonttable.xml")t.fontTableXml=a;else if(r==="word/settings.xml")t.settingsXml=a;else if(r==="word/websettings.xml")t.webSettingsXml=a;else if(r==="word/footnotes.xml")t.footnotesXml=a;else if(r==="word/endnotes.xml")t.endnotesXml=a;else if(r==="word/comments.xml")t.commentsXml=a;else if(r==="word/commentsextensible.xml")t.commentsExtensibleXml=a;else if(r==="word/commentsextended.xml")t.commentsExtendedXml=a;else if(r==="word/_rels/document.xml.rels")t.documentRels=a;else if(r==="_rels/.rels")t.packageRels=a;else if(r==="[content_types].xml")t.contentTypesXml=a;else if(r==="docprops/core.xml")t.corePropsXml=a;else if(r==="docprops/app.xml")t.appPropsXml=a;else if(r==="docprops/custom.xml")t.customPropsXml=a;else if(r.match(/^word\/header\d+\.xml$/)){let c=o.split("/").pop()||o;t.headers.set(c,a);}else if(r.match(/^word\/footer\d+\.xml$/)){let c=o.split("/").pop()||o;t.footers.set(c,a);}}else if(r.startsWith("word/media/")){let a=await s.async("arraybuffer");t.media.set(o,a);}else if(r.startsWith("word/fonts/")){let a=await s.async("arraybuffer");t.fonts.set(o,a);}}return t}function Ce(e){switch(e.toLowerCase().split(".").pop()){case "png":return "image/png";case "jpg":case "jpeg":return "image/jpeg";case "gif":return "image/gif";case "bmp":return "image/bmp";case "tif":case "tiff":return "image/tiff";case "wmf":return "image/x-wmf";case "emf":return "image/x-emf";case "svg":return "image/svg+xml";case "webp":return "image/webp";default:return "application/octet-stream"}}function Y(e,n,t,o){let s={};return e&&e!=="auto"?s.rgb=e:e==="auto"&&(s.auto=true),n&&(s.themeColor=n),t&&(s.themeTint=t),o&&(s.themeShade=o),s}function $(e){if(!e)return;let n={},t=j(e,"w","color");t&&t!=="auto"&&(n.color={rgb:t});let o=j(e,"w","fill");o&&o!=="auto"&&(n.fill={rgb:o});let s=j(e,"w","themeFill");s&&(n.fill=n.fill||{},n.fill.themeColor=s);let r=j(e,"w","themeFillTint");r&&n.fill&&(n.fill.themeTint=r);let a=j(e,"w","themeFillShade");a&&n.fill&&(n.fill.themeShade=a);let c=j(e,"w","val");return c&&(n.pattern=c),Object.keys(n).length>0?n:void 0}function Z(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","b");o&&(t.bold=m(o));let s=e(e$1,"w","bCs");s&&(t.boldCs=m(s));let r=e(e$1,"w","i");r&&(t.italic=m(r));let a=e(e$1,"w","iCs");a&&(t.italicCs=m(a));let c=e(e$1,"w","u");if(c){let g=j(c,"w","val");if(g){t.underline={style:g};let k=j(c,"w","color"),j$1=j(c,"w","themeColor");(k||j$1)&&(t.underline.color=Y(k,j$1,j(c,"w","themeTint"),j(c,"w","themeShade")));}}let d=e(e$1,"w","strike");d&&(t.strike=m(d));let u=e(e$1,"w","dstrike");u&&(t.doubleStrike=m(u));let m$1=e(e$1,"w","vertAlign");if(m$1){let g=j(m$1,"w","val");(g==="superscript"||g==="subscript"||g==="baseline")&&(t.vertAlign=g);}let h=e(e$1,"w","smallCaps");h&&(t.smallCaps=m(h));let p=e(e$1,"w","caps");p&&(t.allCaps=m(p));let x=e(e$1,"w","vanish");x&&(t.hidden=m(x));let f=e(e$1,"w","color");f&&(t.color=Y(j(f,"w","val"),j(f,"w","themeColor"),j(f,"w","themeTint"),j(f,"w","themeShade")));let b=e(e$1,"w","highlight");if(b){let g=j(b,"w","val");g&&(t.highlight=g);}let T=e(e$1,"w","shd");T&&(t.shading=$(T));let M=e(e$1,"w","sz");if(M){let g=l(M,"w","val");g!==void 0&&(t.fontSize=g);}let X=e(e$1,"w","szCs");if(X){let g=l(X,"w","val");g!==void 0&&(t.fontSizeCs=g);}let P=e(e$1,"w","rFonts");if(P){t.fontFamily={ascii:j(P,"w","ascii")??void 0,hAnsi:j(P,"w","hAnsi")??void 0,eastAsia:j(P,"w","eastAsia")??void 0,cs:j(P,"w","cs")??void 0};let g=j(P,"w","asciiTheme");g&&(t.fontFamily.asciiTheme=g,n&&!t.fontFamily.ascii&&(t.fontFamily.ascii=b$3(n,g)));let k=j(P,"w","hAnsiTheme");k&&(t.fontFamily.hAnsiTheme=k,n&&!t.fontFamily.hAnsi&&(t.fontFamily.hAnsi=b$3(n,k)));let j$1=j(P,"w","eastAsiaTheme");j$1&&(t.fontFamily.eastAsiaTheme=j$1,n&&!t.fontFamily.eastAsia&&(t.fontFamily.eastAsia=b$3(n,j$1)));let B=j(P,"w","cstheme");B&&(t.fontFamily.csTheme=B,n&&!t.fontFamily.cs&&(t.fontFamily.cs=b$3(n,B)));}let F=e(e$1,"w","spacing");if(F){let g=l(F,"w","val");g!==void 0&&(t.spacing=g);}let y=e(e$1,"w","position");if(y){let g=l(y,"w","val");g!==void 0&&(t.position=g);}let S=e(e$1,"w","w");if(S){let g=l(S,"w","val");g!==void 0&&(t.scale=g);}let C=e(e$1,"w","kern");if(C){let g=l(C,"w","val");g!==void 0&&(t.kerning=g);}let D=e(e$1,"w","effect");if(D){let g=j(D,"w","val");g&&(t.effect=g);}let I=e(e$1,"w","em");if(I){let g=j(I,"w","val");g&&(t.emphasisMark=g);}let N=e(e$1,"w","emboss");N&&(t.emboss=m(N));let L=e(e$1,"w","imprint");L&&(t.imprint=m(L));let O=e(e$1,"w","outline");O&&(t.outline=m(O));let W=e(e$1,"w","shadow");W&&(t.shadow=m(W));let H=e(e$1,"w","rtl");H&&(t.rtl=m(H));let R=e(e$1,"w","cs");R&&(t.cs=m(R));let A=e(e$1,"w","rStyle");if(A){let g=j(A,"w","val");g&&(t.styleId=g);}return Object.keys(t).length>0?t:void 0}function E(e){if(!e)return;let n=j(e,"w","val");if(!n)return;let t={style:n},o=j(e,"w","color"),s=j(e,"w","themeColor");(o||s)&&(t.color=Y(o,s,j(e,"w","themeTint"),j(e,"w","themeShade")));let r=l(e,"w","sz");r!==void 0&&(t.size=r);let a=l(e,"w","space");a!==void 0&&(t.space=a);let c=j(e,"w","shadow");c&&(t.shadow=c==="1"||c==="true");let d=j(e,"w","frame");return d&&(t.frame=d==="1"||d==="true"),t}function je(e){if(!e)return;let n=f(e,"w","tab");if(n.length===0)return;let t=[];for(let o of n){let s=l(o,"w","pos"),r=j(o,"w","val");if(s!==void 0&&r){let a={position:s,alignment:r},c=j(o,"w","leader");c&&(a.leader=c),t.push(a);}}return t.length>0?t:void 0}function K(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","jc");if(o){let y=j(o,"w","val");y&&(t.alignment=y);}let s=e(e$1,"w","bidi");s&&(t.bidi=m(s));let r=e(e$1,"w","spacing");if(r){let y=l(r,"w","before");y!==void 0&&(t.spaceBefore=y);let S=l(r,"w","after");S!==void 0&&(t.spaceAfter=S);let C=l(r,"w","line");C!==void 0&&(t.lineSpacing=C);let D=j(r,"w","lineRule");D&&(t.lineSpacingRule=D);let I=j(r,"w","beforeAutospacing");I&&(t.beforeAutospacing=I==="1"||I==="true");let N=j(r,"w","afterAutospacing");N&&(t.afterAutospacing=N==="1"||N==="true");}let a=e(e$1,"w","ind");if(a){let y=l(a,"w","left");y!==void 0&&(t.indentLeft=y);let S=l(a,"w","right");S!==void 0&&(t.indentRight=S);let C=l(a,"w","firstLine");C!==void 0&&(t.indentFirstLine=C);let D=l(a,"w","hanging");D!==void 0&&(t.indentFirstLine=-D,t.hangingIndent=true);}let c=e(e$1,"w","pBdr");if(c){let y={},S=E(e(c,"w","top"));S&&(y.top=S);let C=E(e(c,"w","bottom"));C&&(y.bottom=C);let D=E(e(c,"w","left"));D&&(y.left=D);let I=E(e(c,"w","right"));I&&(y.right=I);let N=E(e(c,"w","between"));N&&(y.between=N);let L=E(e(c,"w","bar"));L&&(y.bar=L),Object.keys(y).length>0&&(t.borders=y);}let d=e(e$1,"w","shd");d&&(t.shading=$(d));let u=e(e$1,"w","tabs");u&&(t.tabs=je(u));let m$1=e(e$1,"w","keepNext");m$1&&(t.keepNext=m(m$1));let h=e(e$1,"w","keepLines");h&&(t.keepLines=m(h));let p=e(e$1,"w","widowControl");p&&(t.widowControl=m(p));let x=e(e$1,"w","pageBreakBefore");x&&(t.pageBreakBefore=m(x));let f=e(e$1,"w","contextualSpacing");f&&(t.contextualSpacing=m(f));let b=e(e$1,"w","numPr");if(b){let y=e(b,"w","numId"),S=e(b,"w","ilvl");if(y||S){if(t.numPr={},y){let C=l(y,"w","val");C!==void 0&&(t.numPr.numId=C);}if(S){let C=l(S,"w","val");C!==void 0&&(t.numPr.ilvl=C);}}}let T=e(e$1,"w","outlineLvl");if(T){let y=l(T,"w","val");y!==void 0&&(t.outlineLevel=y);}let M=e(e$1,"w","pStyle");if(M){let y=j(M,"w","val");y&&(t.styleId=y);}let X=e(e$1,"w","suppressLineNumbers");X&&(t.suppressLineNumbers=m(X));let P=e(e$1,"w","suppressAutoHyphens");P&&(t.suppressAutoHyphens=m(P));let F=e(e$1,"w","rPr");return F&&(t.runProperties=Z(F,n)),Object.keys(t).length>0?t:void 0}function U(e){if(!e)return;let n=l(e,"w","w"),t=j(e,"w","type");if(n!==void 0&&t)return {value:n,type:t}}function Pe(e$1){if(!e$1)return;let n={},t=E(e(e$1,"w","top"));t&&(n.top=t);let o=E(e(e$1,"w","bottom"));o&&(n.bottom=o);let s=E(e(e$1,"w","left"));s&&(n.left=s);let r=E(e(e$1,"w","right"));r&&(n.right=r);let a=E(e(e$1,"w","insideH"));a&&(n.insideH=a);let c=E(e(e$1,"w","insideV"));return c&&(n.insideV=c),Object.keys(n).length>0?n:void 0}function Fe(e$1){if(!e$1)return;let n={},t=U(e(e$1,"w","top"));t&&(n.top=t);let o=U(e(e$1,"w","bottom"));o&&(n.bottom=o);let s=U(e(e$1,"w","left"));s&&(n.left=s);let r=U(e(e$1,"w","right"));return r&&(n.right=r),Object.keys(n).length>0?n:void 0}function Oe(e){if(!e)return;let n={},t=j(e,"w","val");if(t){let u=parseInt(t,16);isNaN(u)||(n.firstRow=(u&32)!==0,n.lastRow=(u&64)!==0,n.firstColumn=(u&128)!==0,n.lastColumn=(u&256)!==0,n.noHBand=(u&512)!==0,n.noVBand=(u&1024)!==0);}let o=j(e,"w","firstColumn");o&&(n.firstColumn=o==="1");let s=j(e,"w","firstRow");s&&(n.firstRow=s==="1");let r=j(e,"w","lastColumn");r&&(n.lastColumn=r==="1");let a=j(e,"w","lastRow");a&&(n.lastRow=a==="1");let c=j(e,"w","noHBand");c&&(n.noHBand=c==="1");let d=j(e,"w","noVBand");return d&&(n.noVBand=d==="1"),Object.keys(n).length>0?n:void 0}function se(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","tblW");o&&(t.width=U(o));let s=e(e$1,"w","jc");if(s){let f=j(s,"w","val");(f==="left"||f==="center"||f==="right")&&(t.justification=f);}let r=e(e$1,"w","tblCellSpacing");r&&(t.cellSpacing=U(r));let a=e(e$1,"w","tblInd");a&&(t.indent=U(a));let c=e(e$1,"w","tblBorders");c&&(t.borders=Pe(c));let d=e(e$1,"w","tblCellMar");d&&(t.cellMargins=Fe(d));let u=e(e$1,"w","tblLayout");if(u){let f=j(u,"w","type");(f==="fixed"||f==="autofit")&&(t.layout=f);}let m$1=e(e$1,"w","tblStyle");if(m$1){let f=j(m$1,"w","val");f&&(t.styleId=f);}let h=e(e$1,"w","tblLook");h&&(t.look=Oe(h));let p=e(e$1,"w","shd");p&&(t.shading=$(p));let x=e(e$1,"w","bidiVisual");return x&&(t.bidi=m(x)),Object.keys(t).length>0?t:void 0}function ae(e$1){if(!e$1)return;let n={},t=e(e$1,"w","trHeight");if(t){n.height=U(t);let c=j(t,"w","hRule");c&&(n.heightRule=c);}let o=e(e$1,"w","tblHeader");o&&(n.header=m(o));let s=e(e$1,"w","cantSplit");s&&(n.cantSplit=m(s));let r=e(e$1,"w","jc");if(r){let c=j(r,"w","val");(c==="left"||c==="center"||c==="right")&&(n.justification=c);}let a=e(e$1,"w","hidden");return a&&(n.hidden=m(a)),Object.keys(n).length>0?n:void 0}function le(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","tcW");o&&(t.width=U(o));let s=e(e$1,"w","tcBorders");s&&(t.borders=Pe(s));let r=e(e$1,"w","tcMar");r&&(t.margins=Fe(r));let a=e(e$1,"w","shd");a&&(t.shading=$(a));let c=e(e$1,"w","vAlign");if(c){let f=j(c,"w","val");(f==="top"||f==="center"||f==="bottom")&&(t.verticalAlign=f);}let d=e(e$1,"w","textDirection");if(d){let f=j(d,"w","val");f&&(t.textDirection=f);}let u=e(e$1,"w","gridSpan");if(u){let f=l(u,"w","val");f!==void 0&&(t.gridSpan=f);}let m$1=e(e$1,"w","vMerge");if(m$1){let f=j(m$1,"w","val");t.vMerge=f==="restart"?"restart":"continue";}let h=e(e$1,"w","tcFitText");h&&(t.fitText=m(h));let p=e(e$1,"w","noWrap");p&&(t.noWrap=m(p));let x=e(e$1,"w","hideMark");return x&&(t.hideMark=m(x)),Object.keys(t).length>0?t:void 0}function He(e$1,n){let t={styleId:j(e$1,"w","styleId")??"",type:j(e$1,"w","type")??"paragraph"},o=j(e$1,"w","default");o&&(t.default=o==="1"||o==="true");let s=e(e$1,"w","name");s&&(t.name=j(s,"w","val")??void 0);let r=e(e$1,"w","basedOn");r&&(t.basedOn=j(r,"w","val")??void 0);let a=e(e$1,"w","next");a&&(t.next=j(a,"w","val")??void 0);let c=e(e$1,"w","link");c&&(t.link=j(c,"w","val")??void 0);let d=e(e$1,"w","uiPriority");if(d){let F=l(d,"w","val");F!==void 0&&(t.uiPriority=F);}let u=e(e$1,"w","hidden");u&&(t.hidden=m(u));let m$1=e(e$1,"w","semiHidden");m$1&&(t.semiHidden=m(m$1));let h=e(e$1,"w","unhideWhenUsed");h&&(t.unhideWhenUsed=m(h));let p=e(e$1,"w","qFormat");p&&(t.qFormat=m(p));let x=e(e$1,"w","personal");x&&(t.personal=m(x));let f$1=e(e$1,"w","pPr");f$1&&(t.pPr=K(f$1,n));let b=e(e$1,"w","rPr");b&&(t.rPr=Z(b,n));let T=e(e$1,"w","tblPr");T&&(t.tblPr=se(T));let M=e(e$1,"w","trPr");M&&(t.trPr=ae(M));let X=e(e$1,"w","tcPr");X&&(t.tcPr=le(X));let P=f(e$1,"w","tblStylePr");if(P.length>0){t.tblStylePr=[];for(let F of P){let y=j(F,"w","type");if(y){let S={type:y},C=e(F,"w","pPr");C&&(S.pPr=K(C,n));let D=e(F,"w","rPr");D&&(S.rPr=Z(D,n));let I=e(F,"w","tblPr");I&&(S.tblPr=se(I));let N=e(F,"w","trPr");N&&(S.trPr=ae(N));let L=e(F,"w","tcPr");L&&(S.tcPr=le(L)),t.tblStylePr.push(S);}}}return t}function Ue(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","rPrDefault");if(o){let r=e(o,"w","rPr");r&&(t.rPr=Z(r,n));}let s=e(e$1,"w","pPrDefault");if(s){let r=e(s,"w","pPr");r&&(t.pPr=K(r,n));}return t.rPr||t.pPr?t:void 0}function We(e,n){if(!n)return e;if(!e)return n?{...n}:void 0;let t={...e};for(let o of Object.keys(n)){let s=n[o];if(s!==void 0)if(o==="runProperties")t.runProperties=b$2(t.runProperties,n.runProperties);else if(o==="borders"||o==="numPr"||o==="frame"){let r=t[o],a=s;t[o]={...r||{},...a||{}};}else o==="tabs"&&Array.isArray(s)?t.tabs=[...s]:t[o]=s;}return t}function Ne(e,n,t,o=new Set){if(o.has(e.styleId)||(o.add(e.styleId),!e.basedOn))return e;let s=n.get(e.basedOn);if(!s)return e;let r=Ne(s,n,t,o),a={...e,pPr:We(r.pPr,e.pPr),rPr:b$2(r.rPr,e.rPr)};return e.type==="table"&&((r.tblPr||e.tblPr)&&(a.tblPr={...r.tblPr||{},...e.tblPr||{}}),(r.trPr||e.trPr)&&(a.trPr={...r.trPr||{},...e.trPr||{}}),(r.tcPr||e.tcPr)&&(a.tcPr={...r.tcPr||{},...e.tcPr||{}})),a}function ce(e,n){let t=new Map;try{let o=c(e);if(!o)return t;let s=f(o,"w","style");for(let r of s){let a=He(r,n);a.styleId&&t.set(a.styleId,a);}for(let[r,a]of t){let c=Ne(a,t,n);t.set(r,c);}}catch(o){console.warn("Failed to parse styles:",o);}return t}function Me(e$1,n){let t={styles:[]};try{let o=c(e$1);if(!o)return t;let s=e(o,"w","docDefaults");t.docDefaults=Ue(s,n);let r=e(o,"w","latentStyles");r&&(t.latentStyles={defLockedState:j(r,"w","defLockedState")==="1",defUIPriority:l(r,"w","defUIPriority"),defSemiHidden:j(r,"w","defSemiHidden")==="1",defUnhideWhenUsed:j(r,"w","defUnhideWhenUsed")==="1",defQFormat:j(r,"w","defQFormat")==="1",count:l(r,"w","count")});let a=ce(e$1,n);t.styles=Array.from(a.values());}catch(o){console.warn("Failed to parse style definitions:",o);}return t}function Ie(e){let n={abstractNums:[],nums:[]};if(!e)return fe(n);let t=c(e);if(!t)return fe(n);let o=f(t,"w","abstractNum");for(let r of o){let a=ze(r);a&&n.abstractNums.push(a);}let s=f(t,"w","num");for(let r of s){let a=$e(r);a&&n.nums.push(a);}return fe(n)}function ze(e$1){let n=j(e$1,"w","abstractNumId");if(n===null)return null;let t=parseInt(n,10);if(isNaN(t))return null;let o={abstractNumId:t,levels:[]},s=e(e$1,"w","multiLevelType");if(s){let u=j(s,"w","val");(u==="hybridMultilevel"||u==="multilevel"||u==="singleLevel")&&(o.multiLevelType=u);}let r=e(e$1,"w","name");r&&(o.name=j(r,"w","val")??void 0);let a=e(e$1,"w","numStyleLink");a&&(o.numStyleLink=j(a,"w","val")??void 0);let c=e(e$1,"w","styleLink");c&&(o.styleLink=j(c,"w","val")??void 0);let d=f(e$1,"w","lvl");for(let u of d){let m=Ae(u);m&&o.levels.push(m);}return o.levels.sort((u,m)=>u.ilvl-m.ilvl),o}function $e(e$1){let n=j(e$1,"w","numId");if(n===null)return null;let t=parseInt(n,10);if(isNaN(t))return null;let o=e(e$1,"w","abstractNumId");if(!o)return null;let s=j(o,"w","val");if(s===null)return null;let r=parseInt(s,10);if(isNaN(r))return null;let a={numId:t,abstractNumId:r},c=f(e$1,"w","lvlOverride");if(c.length>0){a.levelOverrides=[];for(let d of c){let u=j(d,"w","ilvl");if(u===null)continue;let m=parseInt(u,10);if(isNaN(m))continue;let h={ilvl:m},p=e(d,"w","startOverride");if(p){let f=j(p,"w","val");if(f!==null){let b=parseInt(f,10);isNaN(b)||(h.startOverride=b);}}let x=e(d,"w","lvl");x&&(h.lvl=Ae(x)??void 0),a.levelOverrides.push(h);}}return a}function Ae(e$1){let n=j(e$1,"w","ilvl");if(n===null)return null;let t=parseInt(n,10);if(isNaN(t)||t<0||t>8)return null;let o={ilvl:t,numFmt:"decimal",lvlText:""},s=e(e$1,"w","start");if(s){let f=j(s,"w","val");if(f!==null){let b=parseInt(f,10);isNaN(b)||(o.start=b);}}let r=e(e$1,"w","numFmt");if(r){let f=j(r,"w","val");f&&(o.numFmt=Ze(f));}let a=e(e$1,"w","lvlText");a&&(o.lvlText=j(a,"w","val")??"");let c=e(e$1,"w","lvlJc");if(c){let f=j(c,"w","val");(f==="left"||f==="center"||f==="right")&&(o.lvlJc=f);}let d=e(e$1,"w","suff");if(d){let f=j(d,"w","val");(f==="tab"||f==="space"||f==="nothing")&&(o.suffix=f);}let u=e(e$1,"w","isLgl");u&&(o.isLgl=m(u));let m$1=e(e$1,"w","lvlRestart");if(m$1){let f=j(m$1,"w","val");if(f!==null){let b=parseInt(f,10);isNaN(b)||(o.lvlRestart=b);}}let h=e(e$1,"w","legacy");h&&(o.legacy={legacy:m(h),legacySpace:l(h,"w","legacySpace"),legacyIndent:l(h,"w","legacyIndent")});let p=e(e$1,"w","pPr");p&&(o.pPr=_e(p));let x=e(e$1,"w","rPr");return x&&(o.rPr=Qe(x)),o}function Ze(e){return {decimal:"decimal",upperRoman:"upperRoman",lowerRoman:"lowerRoman",upperLetter:"upperLetter",lowerLetter:"lowerLetter",ordinal:"ordinal",cardinalText:"cardinalText",ordinalText:"ordinalText",hex:"hex",chicago:"chicago",bullet:"bullet",none:"none",decimalZero:"decimalZero",ganada:"ganada",chosung:"chosung",ideographDigital:"ideographDigital",japaneseCounting:"japaneseCounting",aiueo:"aiueo",iroha:"iroha",decimalFullWidth:"decimalFullWidth",decimalHalfWidth:"decimalHalfWidth",japaneseLegal:"japaneseLegal",japaneseDigitalTenThousand:"japaneseDigitalTenThousand",decimalEnclosedCircle:"decimalEnclosedCircle",decimalFullWidth2:"decimalFullWidth2",aiueoFullWidth:"aiueoFullWidth",irohaFullWidth:"irohaFullWidth",decimalEnclosedFullstop:"decimalEnclosedFullstop",decimalEnclosedParen:"decimalEnclosedParen",decimalEnclosedCircleChinese:"decimalEnclosedCircleChinese",ideographEnclosedCircle:"ideographEnclosedCircle",ideographTraditional:"ideographTraditional",ideographZodiac:"ideographZodiac",ideographZodiacTraditional:"ideographZodiacTraditional",taiwaneseCounting:"taiwaneseCounting",ideographLegalTraditional:"ideographLegalTraditional",taiwaneseCountingThousand:"taiwaneseCountingThousand",taiwaneseDigital:"taiwaneseDigital",chineseCounting:"chineseCounting",chineseLegalSimplified:"chineseLegalSimplified",chineseCountingThousand:"chineseCountingThousand",koreanDigital:"koreanDigital",koreanCounting:"koreanCounting",koreanLegal:"koreanLegal",koreanDigital2:"koreanDigital2",vietnameseCounting:"vietnameseCounting",russianLower:"russianLower",russianUpper:"russianUpper",numberInDash:"numberInDash",hebrew1:"hebrew1",hebrew2:"hebrew2",arabicAlpha:"arabicAlpha",arabicAbjad:"arabicAbjad",hindiVowels:"hindiVowels",hindiConsonants:"hindiConsonants",hindiNumbers:"hindiNumbers",hindiCounting:"hindiCounting",thaiLetters:"thaiLetters",thaiNumbers:"thaiNumbers",thaiCounting:"thaiCounting"}[e]??"decimal"}function _e(e$1){let n={},t=e(e$1,"w","ind");if(t){let s=l(t,"w","left"),r=l(t,"w","right"),a=l(t,"w","start"),c=l(t,"w","end"),d=l(t,"w","firstLine"),u=l(t,"w","hanging"),m=s??a,h=r??c;m!==void 0&&(n.indentLeft=m),h!==void 0&&(n.indentRight=h),u!==void 0?(n.indentFirstLine=-u,n.hangingIndent=true):d!==void 0&&(n.indentFirstLine=d);}let o=e(e$1,"w","tabs");if(o){n.tabs=[];let s=f(o,"w","tab");for(let r of s){let a=l(r,"w","pos"),c=j(r,"w","val"),d=j(r,"w","leader");a!==void 0&&c&&n.tabs.push({position:a,alignment:Je(c),leader:qe(d)});}}return n}function Je(e){switch(e){case "left":return "left";case "center":return "center";case "right":return "right";case "decimal":return "decimal";case "bar":return "bar";case "clear":return "clear";case "num":return "num";default:return "left"}}function qe(e){if(e)switch(e){case "none":return "none";case "dot":return "dot";case "hyphen":return "hyphen";case "underscore":return "underscore";case "heavy":return "heavy";case "middleDot":return "middleDot";default:return}}function Qe(e$1){let n={},t=e(e$1,"w","rFonts");t&&(n.fontFamily={ascii:j(t,"w","ascii")??void 0,hAnsi:j(t,"w","hAnsi")??void 0,eastAsia:j(t,"w","eastAsia")??void 0,cs:j(t,"w","cs")??void 0});let o=e(e$1,"w","sz");if(o){let d=l(o,"w","val");d!==void 0&&(n.fontSize=d);}let s=e(e$1,"w","color");if(s){let d=j(s,"w","val"),u=j(s,"w","themeColor");d==="auto"?n.color={auto:true}:u?n.color={themeColor:u,themeTint:j(s,"w","themeTint")??void 0,themeShade:j(s,"w","themeShade")??void 0}:d&&(n.color={rgb:d});}let r=e(e$1,"w","b");r&&(n.bold=m(r));let a=e(e$1,"w","i");a&&(n.italic=m(a));let c=e(e$1,"w","vanish");return c&&(n.hidden=m(c)),n}function fe(e){let n=new Map;for(let o of e.abstractNums)n.set(o.abstractNumId,o);let t=new Map;for(let o of e.nums)t.set(o.numId,o);return {definitions:e,getLevel(o,s){let r=t.get(o);if(!r)return null;if(r.levelOverrides){let c=r.levelOverrides.find(d=>d.ilvl===s);if(c){if(c.lvl)return c.lvl;let d=n.get(r.abstractNumId);if(d){let u=d.levels.find(m=>m.ilvl===s);if(u&&c.startOverride!==void 0)return {...u,start:c.startOverride}}}}let a=n.get(r.abstractNumId);if(!a)return null;if(a.numStyleLink&&a.levels.length===0){for(let c of n.values())if(c.styleLink===a.numStyleLink&&c.levels.length>0){a=c;break}}return a.levels.find(c=>c.ilvl===s)??null},getAbstract(o){return n.get(o)??null},getInstance(o){return t.get(o)??null},hasNumbering(o){return t.has(o)}}}function Ge(e,n){switch(n){case "decimal":case "decimalZero":return e.toString();case "upperRoman":return De(e).toUpperCase();case "lowerRoman":return De(e).toLowerCase();case "upperLetter":return Xe(e).toUpperCase();case "lowerLetter":return Xe(e).toLowerCase();case "ordinal":return Ye(e);case "bullet":return "\u2022";case "none":return "";case "decimalEnclosedParen":return `(${e})`;case "numberInDash":return `-${e}-`;default:return e.toString()}}function De(e){if(e<=0||e>3999)return e.toString();let n=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],t="",o=e;for(let[s,r]of n)for(;o>=s;)t+=r,o-=s;return t}function Xe(e){if(e<=0)return "";let n="",t=e;for(;t>0;)t--,n=String.fromCharCode(97+t%26)+n,t=Math.floor(t/26);return n}function Ye(e){let n=["th","st","nd","rd"],t=e%100;return e+(n[(t-20)%10]||n[t]||n[0])}function Pt(e,n,t){let o=e;for(let s=1;s<=9;s++){let r=`%${s}`;if(o.includes(r)){let a=s-1,c=n[a]??1,d=t[a]??"decimal",u=Ge(c,d);o=o.replace(r,u);}}return o}function Ft(e){if(e.lvlText)return e.lvlText;let n=e.rPr?.fontFamily?.ascii||e.rPr?.fontFamily?.hAnsi;if(n){let t=n.toLowerCase();if(t==="symbol")return "\u2022";if(t.includes("wingding"))return "\u2751"}return "\u2022"}function Nt(e){return e.numFmt==="bullet"||e.numFmt==="none"}var Le=/\{([a-zA-Z_][a-zA-Z0-9_\-\.]*)\}/g;function ke(e){let n=[],t;for(Le.lastIndex=0;(t=Le.exec(e))!==null;){let o=t[1].trim();o&&!n.includes(o)&&n.push(o);}return n}function ee(e){let n=[];for(let t of e)if(t.type==="paragraph"){let o=N(t),s=ke(o);for(let r of s)n.includes(r)||n.push(r);}else if(t.type==="table"){let o=Ee(t);for(let s of o)n.includes(s)||n.push(s);}return n}function Ee(e){let n=[];for(let t of e.rows)for(let o of t.cells)for(let s of o.content)if(s.type==="paragraph"){let r=N(s),a=ke(r);for(let c of a)n.includes(c)||n.push(c);}else if(s.type==="table"){let r=Ee(s);for(let a of r)n.includes(a)||n.push(a);}return n}function Ke(e,n){let t=[],o=[];for(let s of e)o.push(s),s.type==="paragraph"&&s.sectionProperties&&(t.push({properties:s.sectionProperties,content:o}),o=[]);return (o.length>0||t.length===0)&&t.push({properties:n??C(),content:o}),t}function te(e$1,n=null,t=null,o=null,s=null,r=null){let a={content:[]};if(!e$1)return a;let c=a$2(e$1);if(!c)return a;let d=(c.elements??[]).find(p=>p.type==="element"&&(p.name==="w:document"||p.name?.endsWith(":document")));if(!d)return a;let u=e(d,"w","body");if(!u)return a;a.content=q(u,n,t,o,s,r);let m=e(u,"w","sectPr");m&&(a.finalSectionProperties=B(m,s));let h=Ke(a.content,a.finalSectionProperties);return a.sections=D(h),a.finalSectionProperties&&a.sections.length>0&&(a.finalSectionProperties=a.sections[a.sections.length-1].properties),a}function et(e$1){let n=new Map,t=a$2(e$1);if(!t)return n;let o=e(t,"w16cex","commentsExtensible")??t;for(let s of i(o)){if((s.name?.replace(/^.*:/,"")??"")!=="comment")continue;let a=j(s,"w16cex","paraId")??j(s,"w15","paraId")??s.attributes?.["w16cex:paraId"]??s.attributes?.["w15:paraId"],c=j(s,"w16cex","dateUtc")??j(s,"w15","dateUtc")??s.attributes?.["w16cex:dateUtc"]??s.attributes?.["w15:dateUtc"];a&&c&&n.set(String(a).toUpperCase(),String(c));}return n}function tt(e$1){let n=new Map,t=new Map,o=a$2(e$1);if(!o)return {parentByParaId:n,doneByParaId:t};let s=e(o,"w15","commentsEx")??o;for(let r of i(s)){if((r.name?.replace(/^.*:/,"")??"")!=="commentEx")continue;let c=j(r,"w15","paraId")??r.attributes?.["w15:paraId"],d=j(r,"w15","paraIdParent")??r.attributes?.["w15:paraIdParent"],u=j(r,"w15","done")??r.attributes?.["w15:done"];if(c){let m=String(c).toUpperCase();d&&n.set(m,String(d).toUpperCase()),u==="1"&&t.set(m,true);}}return {parentByParaId:n,doneByParaId:t}}function Re(e$1,n,t,o,s,r,a){if(!e$1)return [];let c=a$2(e$1);if(!c)return [];let d=r?et(r):new Map,u=a?tt(a):null,m=e(c,"w","comments")??c,h=i(m),p=[],x=[];for(let f of h){if((f.name?.replace(/^.*:/,"")??"")!=="comment")continue;let T=parseInt(j(f,"w","id")??"0",10),M=j(f,"w","author")??"Unknown",X=j(f,"w","initials"),P=X!=null?String(X):void 0,F=j(f,"w","date"),y=F!=null?String(F):void 0,S=j(f,"w14","paraId")??f.attributes?.["w14:paraId"]??j(f,"w","paraId"),D=(S?d.get(String(S).toUpperCase()):void 0)??y,I=j(f,"w","done")??f.attributes?.["w:done"],N=I==="1"||I==="true"?true:void 0,L=j(f,"w16cid","parentId")??j(f,"w","parentId")??f.attributes?.["w16cid:parentId"]??f.attributes?.["w:parentId"],O$1=L!=null?parseInt(String(L),10):void 0,W=[],H="";for(let R of i(f))if((R.name?.replace(/^.*:/,"")??"")==="p"){let g=O(R,n,t,null,o,s);W.push(g);let k=j(R,"w14","paraId")??R.attributes?.["w14:paraId"];k&&(H=String(k).toUpperCase());}N==null&&u&&H&&u.doneByParaId.get(H)&&(N=true),x.push(H),p.push({id:T,author:M,initials:P,date:D,content:W,...N!=null?{done:N}:{},...O$1!=null&&!isNaN(O$1)?{parentId:O$1}:{}});}if(u&&u.parentByParaId.size>0){let f=new Map;for(let b=0;b<p.length;b++){let T=x[b];T&&f.set(T,p[b].id);}for(let b=0;b<p.length;b++){if(p[b].parentId!=null)continue;let T=x[b];if(!T)continue;let M=u.parentByParaId.get(T);if(!M)continue;let X=f.get(M);X!=null&&(p[b]={...p[b],parentId:X});}}return p}async function Be(e,n={}){let t=e instanceof ArrayBuffer?e:await s(e),{onProgress:o=()=>{},preloadFonts:s$1=true,parseHeadersFooters:r=true,parseNotes:a$1=true,detectVariables:c=true}=n,d=[];try{let p=function(A,g){let k=performance.now(),j=g(),B=performance.now()-k;return h.push({stage:A,ms:B}),B>1e3&&console.warn(`[parseDocx] ${A} took ${Math.round(B)}ms`),j};var u=p;let m=performance.now(),h=[];async function x(A,g){let k=performance.now(),j=await g(),B=performance.now()-k;return h.push({stage:A,ms:B}),B>1e3&&console.warn(`[parseDocx] ${A} took ${Math.round(B)}ms`),j}o("Extracting DOCX...",0);let f=await x("unzip",()=>G(t));o("Extracted DOCX",10),o("Parsing relationships...",10);let b$2=p("relationships",()=>f.documentRels?b(f.documentRels):new Map);o("Parsed relationships",15),o("Parsing theme...",15);let T=p("theme",()=>a(f.themeXml));o("Parsed theme",20),o("Parsing styles...",20);let M=null,X;p("styles",()=>{f.stylesXml&&(M=ce(f.stylesXml,T),X=Me(f.stylesXml,T));}),o("Parsed styles",30),o("Parsing numbering...",30);let P=p("numbering",()=>Ie(f.numberingXml)),F=p("settings",()=>b$1(f.settingsXml));o("Parsed numbering",35),o("Processing media files...",35);let y=p("media",()=>nt(f,b$2));o("Processed media",40),o("Parsing document body...",40);let S={content:[]};p("documentBody",()=>{f.documentXml?S=te(f.documentXml,M,T,P,b$2,y):d.push("No document.xml found in DOCX");}),o("Parsed document body",55);let C,D;if(r){o("Parsing headers/footers...",55);let A=p("headersFooters",()=>ot(f,M,T,P,b$2,y));C=A.headers,D=A.footers,o("Parsed headers/footers",65);}else o("Skipping headers/footers",65);let I,N;if(a$1){o("Parsing footnotes/endnotes...",65);let A=p("footnotesEndnotes",()=>rt(f,M,T,P,b$2,y));I=A.footnotes,N=A.endnotes,o("Parsed footnotes/endnotes",75);}else o("Skipping footnotes/endnotes",75);o("Parsing comments...",75);let L=p("comments",()=>Re(f.commentsXml,M,T,b$2,y,f.commentsExtensibleXml,f.commentsExtendedXml));L.length>0&&(S.comments=L);let O;c?(o("Detecting template variables...",75),O=p("variables",()=>ee(S.content)),o("Detected variables",80)):o("Skipping variable detection",80),s$1?(o("Loading fonts...",80),await x("fonts",()=>it(T,X,S)),o("Loaded fonts",95)):o("Skipping font loading",95),o("Assembling document...",95);let H={package:{document:S,styles:X,theme:T,numbering:P.definitions,settings:F,headers:C,footers:D,footnotes:I,endnotes:N,relationships:b$2,media:y},originalBuffer:t,templateVariables:O,warnings:d.length>0?d:void 0},R=performance.now()-m;if(R>2e3){let A=h.filter(g=>g.ms>100).map(g=>`${g.stage}: ${Math.round(g.ms)}ms`).join(", ");console.warn(`[parseDocx] Total: ${Math.round(R)}ms`+(A?` (${A})`:""));}return o("Complete",100),H}catch(m){let h=m instanceof Error?m.message:String(m);throw console.error("[parseDocx] Failed to parse DOCX:",h,m),new Error(`Failed to parse DOCX: ${h}`)}}function nt(e,n){let t=new Map;for(let[o,s]of e.media.entries()){let r=o.split("/").pop()||o,a=Ce(o),c=new Uint8Array(s),d="";for(let x=0;x<c.length;x++)d+=String.fromCharCode(c[x]);let u=btoa(d),m=`data:${a};base64,${u}`,h={path:o,filename:r,mimeType:a,data:s,dataUrl:m};t.set(o,h);let p=o.replace(/^word\//,"");p!==o&&t.set(p,h);}return t}function ne(e,n){let t=n.toLowerCase();for(let[o,s]of e.entries())if(o.toLowerCase()===t)return s}function ot(e,n,t,o,s,r$1){let a=new Map,c=new Map;for(let[d,u]of s.entries())if(u.type===a$1.header&&u.target){let m=u.target.split("/").pop()||u.target,h=ne(e.headers,m);if(h){let p=`word/_rels/${m}.rels`,x=ne(e.allXml,p),f=x?b(x):s,b$1=r(h,"default",n,t,o,f,r$1);a.set(d,b$1);}}else if(u.type===a$1.footer&&u.target){let m=u.target.split("/").pop()||u.target,h=ne(e.footers,m);if(h){let p=`word/_rels/${m}.rels`,x=ne(e.allXml,p),f=x?b(x):s,b$1=s$1(h,"default",n,t,o,f,r$1);c.set(d,b$1);}}return {headers:a,footers:c}}function rt(e,n,t$1,o,s,r){let a=t(e.footnotesXml,n,t$1,o,s,r),c=u(e.endnotesXml,n,t$1,o,s,r);return {footnotes:a.getNormalFootnotes(),endnotes:c.getNormalEndnotes()}}async function it(e,n,t){let o$1=new Set;if(e?.fontScheme){let{majorFont:s,minorFont:r}=e.fontScheme;s?.latin&&o$1.add(s.latin),r?.latin&&o$1.add(r.latin);}if(n?.docDefaults?.rPr?.fontFamily?.ascii&&o$1.add(n.docDefaults.rPr.fontFamily.ascii),n?.styles)for(let s of n.styles)s.rPr?.fontFamily?.ascii&&o$1.add(s.rPr.fontFamily.ascii),s.rPr?.fontFamily?.hAnsi&&o$1.add(s.rPr.fontFamily.hAnsi);if(t.content){for(let s of t.content)if(s.type==="paragraph")for(let r of s.content)r.type==="run"&&r.formatting?.fontFamily&&(r.formatting.fontFamily.ascii&&o$1.add(r.formatting.fontFamily.ascii),r.formatting.fontFamily.hAnsi&&o$1.add(r.formatting.fontFamily.hAnsi));}if(o$1.size>0)try{await o(Array.from(o$1));}catch(s){console.warn("Failed to load some fonts:",s);}}async function qt(e){return Be(e,{preloadFonts:false,parseHeadersFooters:false,parseNotes:false,detectVariables:true})}async function Qt(e,n){return Be(e,{onProgress:n,preloadFonts:true,parseHeadersFooters:true,parseNotes:true,detectVariables:true})}async function Gt(e){let n=await G(e);if(!n.documentXml)return [];let t=te(n.documentXml);return ee(t.content)}async function Yt(e){let n=await G(e),t=n.documentXml?ee(te(n.documentXml).content):[];return {hasDocument:n.documentXml!==null,hasStyles:n.stylesXml!==null,hasTheme:n.themeXml!==null,hasNumbering:n.numberingXml!==null,headerCount:n.headers.size,footerCount:n.footers.size,mediaCount:n.media.size,variableCount:t.length}}
2
2
  export{Ie as a,Ge as b,Pt as c,Ft as d,Nt as e,Be as f,qt as g,Qt as h,Gt as i,Yt as j};
@@ -1,10 +1,10 @@
1
- 'use strict';var chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkESI4BSBF_js=require('./chunk-ESI4BSBF.js'),chunkV6SWUCTS_js=require('./chunk-V6SWUCTS.js');function M(o){return typeof o=="object"&&o!==null&&("_def"in o||"parse"in o||"safeParse"in o)}function v(o,i){let s=i,{position:n,variableName:t}=s,e=JSON.parse(JSON.stringify(o)),a=e.package.document.content.filter(m=>m.type==="paragraph");if(n.paragraphIndex>=a.length)throw new Error(`Paragraph index ${n.paragraphIndex} out of bounds`);let l=a[n.paragraphIndex],p=`{${t}}`;return C(l,n.offset,p),e.templateVariables||(e.templateVariables=[]),e.templateVariables.includes(t)||e.templateVariables.push(t),e}function w(o,i){let s=i,{range:n,variableName:t}=s,e=JSON.parse(JSON.stringify(o)),a=e.package.document.content.filter(m=>m.type==="paragraph");if(n.start.paragraphIndex!==n.end.paragraphIndex)throw new Error("Template variable replacement cannot span multiple paragraphs");if(n.start.paragraphIndex>=a.length)throw new Error(`Paragraph index ${n.start.paragraphIndex} out of bounds`);let l=a[n.start.paragraphIndex];I(l,n.start.offset,n.end.offset);let p=`{${t}}`;return C(l,n.start.offset,p),e.templateVariables||(e.templateVariables=[]),e.templateVariables.includes(t)||e.templateVariables.push(t),e}function C(o,i,s){let n=0,t=false;for(let e=0;e<o.content.length;e++){let r=o.content[e];if(r.type==="run"){let a=g(r),l=n,p=n+a.length;if(!t&&i>=l&&i<=p){let m=i-l,f=a.slice(0,m),x=a.slice(m),d=[];for(let c=0;c<e;c++)d.push(o.content[c]);f&&d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:f}]}),d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:s}]}),x&&d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:x}]});for(let c=e+1;c<o.content.length;c++)d.push(o.content[c]);o.content=d,t=true;break}n=p;}else if(r.type==="hyperlink")for(let a of r.children)a.type==="run"&&(n+=g(a).length);}t||o.content.push({type:"run",content:[{type:"text",text:s}]});}function I(o,i,s){let n=[],t=0;for(let e of o.content)if(e.type==="run"){let r=g(e),a=t,l=t+r.length;if(l<=i||a>=s)n.push(e);else {let p="";a<i&&(p+=r.slice(0,i-a)),l>s&&(p+=r.slice(s-a)),p.length>0&&n.push({type:"run",formatting:e.formatting,content:[{type:"text",text:p}]});}t=l;}else n.push(e);o.content=n;}function g(o){return o.content.filter(i=>i.type==="text").map(i=>i.text).join("")}var u={type:"string",description:"Document ID from a previous docx_load call"},D={type:"object",properties:{paragraphIndex:{type:"number",description:"Index of the paragraph (0-indexed)"},offset:{type:"number",description:"Character offset within the paragraph"}},required:["paragraphIndex","offset"]},V={name:"docx_get_variables",description:`List all template variables ({name} format) found in the document.
1
+ 'use strict';var chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkESI4BSBF_js=require('./chunk-ESI4BSBF.js'),chunkQYF7BRG3_js=require('./chunk-QYF7BRG3.js');function M(o){return typeof o=="object"&&o!==null&&("_def"in o||"parse"in o||"safeParse"in o)}function v(o,i){let s=i,{position:n,variableName:t}=s,e=JSON.parse(JSON.stringify(o)),a=e.package.document.content.filter(m=>m.type==="paragraph");if(n.paragraphIndex>=a.length)throw new Error(`Paragraph index ${n.paragraphIndex} out of bounds`);let l=a[n.paragraphIndex],p=`{${t}}`;return C(l,n.offset,p),e.templateVariables||(e.templateVariables=[]),e.templateVariables.includes(t)||e.templateVariables.push(t),e}function w(o,i){let s=i,{range:n,variableName:t}=s,e=JSON.parse(JSON.stringify(o)),a=e.package.document.content.filter(m=>m.type==="paragraph");if(n.start.paragraphIndex!==n.end.paragraphIndex)throw new Error("Template variable replacement cannot span multiple paragraphs");if(n.start.paragraphIndex>=a.length)throw new Error(`Paragraph index ${n.start.paragraphIndex} out of bounds`);let l=a[n.start.paragraphIndex];I(l,n.start.offset,n.end.offset);let p=`{${t}}`;return C(l,n.start.offset,p),e.templateVariables||(e.templateVariables=[]),e.templateVariables.includes(t)||e.templateVariables.push(t),e}function C(o,i,s){let n=0,t=false;for(let e=0;e<o.content.length;e++){let r=o.content[e];if(r.type==="run"){let a=g(r),l=n,p=n+a.length;if(!t&&i>=l&&i<=p){let m=i-l,f=a.slice(0,m),x=a.slice(m),d=[];for(let c=0;c<e;c++)d.push(o.content[c]);f&&d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:f}]}),d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:s}]}),x&&d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:x}]});for(let c=e+1;c<o.content.length;c++)d.push(o.content[c]);o.content=d,t=true;break}n=p;}else if(r.type==="hyperlink")for(let a of r.children)a.type==="run"&&(n+=g(a).length);}t||o.content.push({type:"run",content:[{type:"text",text:s}]});}function I(o,i,s){let n=[],t=0;for(let e of o.content)if(e.type==="run"){let r=g(e),a=t,l=t+r.length;if(l<=i||a>=s)n.push(e);else {let p="";a<i&&(p+=r.slice(0,i-a)),l>s&&(p+=r.slice(s-a)),p.length>0&&n.push({type:"run",formatting:e.formatting,content:[{type:"text",text:p}]});}t=l;}else n.push(e);o.content=n;}function g(o){return o.content.filter(i=>i.type==="text").map(i=>i.text).join("")}var u={type:"string",description:"Document ID from a previous docx_load call"},D={type:"object",properties:{paragraphIndex:{type:"number",description:"Index of the paragraph (0-indexed)"},offset:{type:"number",description:"Character offset within the paragraph"}},required:["paragraphIndex","offset"]},V={name:"docx_get_variables",description:`List all template variables ({name} format) found in the document.
2
2
  Returns variable names without braces, along with their locations (body, headers, footers, etc.).
3
3
  Use this to discover what data fields a template document expects.`,inputSchema:{type:"object",properties:{documentId:u},required:["documentId"]},handler:async(o,i)=>{let{documentId:s}=o,n=i.session.documents.get(s);if(!n)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};try{let t=chunkU4UCHBZ7_js.b(n.document);return {content:[{type:"text",text:JSON.stringify({variables:t.variables,count:t.variables.length,totalOccurrences:t.totalOccurrences,byLocation:t.byLocation},null,2)}]}}catch(t){return {isError:true,content:[{type:"text",text:`Failed to detect variables: ${t.message}`}]}}},annotations:{category:"template",readOnly:true,complexity:"low",examples:[{description:"Get all variables from a loaded document",input:{documentId:"doc_123"},output:'{"variables": ["customer_name", "invoice_date"], "count": 2}'}]}},R={name:"docx_insert_variable",description:`Insert a template variable placeholder ({name}) at a specific position in the document.
4
4
  The variable can later be substituted with actual values using docx_apply_template.
5
5
  Variable names should follow the pattern: letters, numbers, underscores, starting with a letter.`,inputSchema:{type:"object",properties:{documentId:u,position:D,variableName:{type:"string",description:'Variable name without braces (e.g., "customer_name"). Will be inserted as {customer_name}',pattern:"^[a-zA-Z_][a-zA-Z0-9_]*$"}},required:["documentId","position","variableName"]},handler:async(o,i)=>{let{documentId:s,position:n,variableName:t}=o,e=i.session.documents.get(s);if(!e)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!/^[a-zA-Z_][a-zA-Z0-9_\-.]*$/.test(t))return {isError:true,content:[{type:"text",text:`Invalid variable name: ${t}. Must start with letter/underscore and contain only alphanumeric, underscore, hyphen, or dot.`}]};try{let{executeCommand:r}=await import('./executor-DZAMMQ35.js'),a=r(e.document,{type:"insertText",position:n,text:`{${t}}`});return e.document=a,e.lastModified=Date.now(),a.templateVariables||(a.templateVariables=[]),a.templateVariables.includes(t)||a.templateVariables.push(t),{content:[{type:"text",text:JSON.stringify({success:!0,variable:t,insertedAs:`{${t}}`,position:n})}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to insert variable: ${r.message}`}]}}},annotations:{category:"template",readOnly:false,complexity:"low",examples:[{description:"Insert customer name variable at start of first paragraph",input:{documentId:"doc_123",position:{paragraphIndex:0,offset:0},variableName:"customer_name"}}]}},S={name:"docx_apply_template",description:`Substitute template variables with actual values in the document.
6
6
  Replaces all {variable} placeholders with the corresponding values provided.
7
7
  Preserves all formatting (fonts, styles, colors, tables).
8
- Use docx_get_variables first to discover what variables exist in the document.`,inputSchema:{type:"object",properties:{documentId:u,variables:{type:"object",description:'Map of variable names to values (e.g., {"customer_name": "John Doe", "date": "2024-01-15"})',additionalProperties:{type:"string"}},keepUnmatchedVariables:{type:"boolean",description:"If true, keep {variable} placeholders for variables not in the map. If false, replace with empty string. Default: true",default:true}},required:["documentId","variables"]},handler:async(o,i)=>{let{documentId:s,variables:n,keepUnmatchedVariables:t=true}=o,e=i.session.documents.get(s);if(!e)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!e.buffer)return {isError:true,content:[{type:"text",text:"Cannot apply template: document was not loaded from a DOCX buffer"}]};try{let r=chunkESI4BSBF_js.b(e.buffer,n,{nullGetter:t?"keep":"empty"}),a=await chunkV6SWUCTS_js.f(r.buffer);return e.document=a,e.buffer=r.buffer,e.lastModified=Date.now(),{content:[{type:"text",text:JSON.stringify({success:!0,replacedVariables:r.replacedVariables,unreplacedVariables:r.unreplacedVariables,warnings:r.warnings})}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to apply template: ${r.message}`}]}}},annotations:{category:"template",readOnly:false,complexity:"medium",examples:[{description:"Fill in customer and date values",input:{documentId:"doc_123",variables:{customer_name:"Jane Smith",invoice_date:"2024-02-15",amount:"$1,234.56"}}}]}},k={name:"docx_validate_template",description:`Validate that a document is a valid docxtemplater template.
8
+ Use docx_get_variables first to discover what variables exist in the document.`,inputSchema:{type:"object",properties:{documentId:u,variables:{type:"object",description:'Map of variable names to values (e.g., {"customer_name": "John Doe", "date": "2024-01-15"})',additionalProperties:{type:"string"}},keepUnmatchedVariables:{type:"boolean",description:"If true, keep {variable} placeholders for variables not in the map. If false, replace with empty string. Default: true",default:true}},required:["documentId","variables"]},handler:async(o,i)=>{let{documentId:s,variables:n,keepUnmatchedVariables:t=true}=o,e=i.session.documents.get(s);if(!e)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!e.buffer)return {isError:true,content:[{type:"text",text:"Cannot apply template: document was not loaded from a DOCX buffer"}]};try{let r=chunkESI4BSBF_js.b(e.buffer,n,{nullGetter:t?"keep":"empty"}),a=await chunkQYF7BRG3_js.f(r.buffer);return e.document=a,e.buffer=r.buffer,e.lastModified=Date.now(),{content:[{type:"text",text:JSON.stringify({success:!0,replacedVariables:r.replacedVariables,unreplacedVariables:r.unreplacedVariables,warnings:r.warnings})}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to apply template: ${r.message}`}]}}},annotations:{category:"template",readOnly:false,complexity:"medium",examples:[{description:"Fill in customer and date values",input:{documentId:"doc_123",variables:{customer_name:"Jane Smith",invoice_date:"2024-02-15",amount:"$1,234.56"}}}]}},k={name:"docx_validate_template",description:`Validate that a document is a valid docxtemplater template.
9
9
  Checks for syntax errors like unclosed braces, invalid tag names, etc.
10
10
  Returns validation result with any errors found and list of valid tags.`,inputSchema:{type:"object",properties:{documentId:u},required:["documentId"]},handler:async(o,i)=>{let{documentId:s}=o,n=i.session.documents.get(s);if(!n)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!n.buffer)return {isError:true,content:[{type:"text",text:"Cannot validate template: document was not loaded from a DOCX buffer"}]};try{let t=chunkESI4BSBF_js.f(n.buffer);return {content:[{type:"text",text:JSON.stringify({valid:t.valid,tags:t.tags,errors:t.errors.map(e=>({message:e.message,variable:e.variable,type:e.type}))},null,2)}]}}catch(t){return {isError:true,content:[{type:"text",text:`Failed to validate template: ${t.message}`}]}}},annotations:{category:"template",readOnly:true,complexity:"low"}},P=[V,R,S,k];var E={id:"docxtemplater",name:"Docxtemplater",version:"1.0.0",description:"Template variable support using standard docxtemplater syntax ({variable})",commandHandlers:{insertTemplateVariable:v,replaceWithTemplateVariable:w},mcpTools:P};exports.a=M;exports.b=E;
@@ -0,0 +1 @@
1
+ 'use strict';
@@ -0,0 +1 @@
1
+ import {e,b,c,a as a$1}from'./chunk-KQTB5Y7P.mjs';import {a}from'./chunk-ICE6NC3S.mjs';import {i,g}from'./chunk-MJ6XZFVD.mjs';import {TextSelection}from'prosemirror-state';function O(e){let{$from:t}=e.selection,n=null,r=null,s=null,o=-1,a=-1;for(let i=t.depth;i>0;i--){let d=t.node(i);if(d.type.name==="tableCell"||d.type.name==="tableHeader"){s=d;let l=t.node(i-1);if(l?.type.name==="tableRow"){let b=0;l.forEach((h,y,S)=>{if(a===-1){if(S===t.index(i-1)){a=b;return}b+=h.attrs.colspan||1;}});}}else if(d.type.name==="tableRow")t.node(i-1)?.type.name==="table"&&(o=t.index(i-1));else if(d.type.name==="table"){n=d,r=t.before(i);break}}return !n||r==null||!s||o<0||a<0?null:{table:n,tablePos:r,cell:s,row:o,col:a,rowspan:s.attrs.rowspan||1,colspan:s.attrs.colspan||1}}function H(e){let t=[],n=[],r=0;for(let s=0;s<e.childCount;s++){let o=e.child(s),a=0;o.forEach(i=>{for(;t[s]?.[a];)a++;let d=i.attrs.rowspan||1,l=i.attrs.colspan||1;n.push({data:i,row:s,col:a,rowspan:d,colspan:l});for(let b=s;b<s+d;b++){let h=t[b]??[];t[b]=h;for(let y=a;y<a+l;y++)h[y]=true;}a+=l,r=Math.max(r,a);});}return {anchors:n,totalCols:r}}function j(e,t,n,r,s){let o={...e.attrs},a=s.reduce((l,b)=>l+b,0),i=a$1(s,t,n),d=n!==(e.attrs.colspan||1)||r!==(e.attrs.rowspan||1);return o.colspan=n,o.rowspan=r,o.colwidth=null,a>0&&(o.width=Math.round(i/a*5e3),o.widthType="pct"),d&&(o._originalFormatting=null),o}function K(e,t,n,r){let s=t+1;for(let o=0;o<e.childCount;o++){let a=e.child(o),i=s+1,d=0;for(let l=0;l<a.childCount;l++){let b=a.child(l);if(o===n&&d===r)return i;d+=b.attrs.colspan||1,i+=b.nodeSize;}s+=a.nodeSize;}return null}function Y(e,t){let n=e.attrs.width??9360;return Array.isArray(e.attrs.columnWidths)&&e.attrs.columnWidths.length>0?[...e.attrs.columnWidths]:Array.from({length:t},()=>Math.floor(n/Math.max(t,1)))}function q(e$1){let t=O(e$1);return t?{...e(t.rowspan,t.colspan),capturedCellRow:t.row,capturedCellCol:t.col}:null}function Q(e,t,n,r,s,o){if(n<1||r<1)return false;let a=O(e);if(!a||!t)return false;let i=a;if(s!=null&&o!=null&&(s!==a.row||o!==a.col)){let{anchors:p}=H(a.table),g=p.find(T=>T.row===s&&T.col===o);if(!g)return false;i={...a,cell:g.data,row:g.row,col:g.col,rowspan:g.rowspan,colspan:g.colspan};}if(n<i.rowspan||r<i.colspan||n===1&&r===1)return false;let{anchors:d,totalCols:l}=H(i.table),b$1=Y(i.table,l),h=b(b$1,i.col,i.colspan,r),y=d.find(p=>p.row===i.row&&p.col===i.col);if(!y)return false;let S=c(d,y,n,r,i.table.childCount,p=>{if(p)return y.data;let g=y.data.type.schema.nodes.paragraph.create(),T=j(y.data,0,1,1,h);return y.data.type.create(T,g)}),x=i.row+i.rowspan,P=Array.from({length:S.newRowCount},(p,g)=>g<x?{...i.table.child(g)?.attrs??{}}:g<i.row+n?{...i.table.child(x-1)?.attrs??{}}:{...i.table.child(g-S.deltaRows)?.attrs??{}}),v=Array.from({length:S.newRowCount},()=>[]);S.anchors.sort((p,g)=>p.row===g.row?p.col-g.col:p.row-g.row).forEach(p=>{let g=j(p.data,p.col,p.colspan,p.rowspan,h);v[p.row].push(p.data.type.create(g,p.data.content));});let u=v.map((p,g)=>i.table.type.schema.nodes.tableRow.create(P[g],p)),c$1=i.table.type.create({...i.table.attrs,columnWidths:h},u),f=e.tr.replaceWith(i.tablePos,i.tablePos+i.table.nodeSize,c$1),C=f.doc.nodeAt(i.tablePos);if(C){let p=K(C,i.tablePos,i.row,i.col);p!=null&&(f=f.setSelection(TextSelection.near(f.doc.resolve(p+1))));}return t(f.scrollIntoView()),true}var m=a.getCommands();function ee(e,t){return m.insertTable(e,t)}function te(e,t){return m.addRowAbove()(e,t)}function re(e,t){return m.addRowBelow()(e,t)}function ne(e,t){return m.deleteRow()(e,t)}function oe(e,t){return m.addColumnLeft()(e,t)}function ae(e,t){return m.addColumnRight()(e,t)}function ie(e,t){return m.deleteColumn()(e,t)}function se(e,t){return m.deleteTable()(e,t)}function le(e,t){return m.selectTable()(e,t)}function ce(e,t){return m.selectRow()(e,t)}function de(e,t){return m.selectColumn()(e,t)}function ue(e,t){return m.mergeCells()(e,t)}function pe(e,t){return m.splitCell()(e,t)}function me(e,t,n){return m.setCellBorder(e,t,n)}function fe(e,t){return m.setTableBorders(e,t)}function ge(e,t){return m.removeTableBorders()(e,t)}function be(e,t,n){return m.setAllTableBorders(n)(e,t)}function he(e,t,n){return m.setOutsideTableBorders(n)(e,t)}function ye(e,t,n){return m.setInsideTableBorders(n)(e,t)}function Ce(e){return m.setCellVerticalAlign(e)}function Te(e){return m.setCellMargins(e)}function Se(e){return m.setCellTextDirection(e)}function ve(){return m.toggleNoWrap()}function ke(e,t){return m.setRowHeight(e,t)}function xe(){return m.toggleHeaderRow()}function Pe(){return m.distributeColumns()}function we(){return m.autoFitContents()}function Ie(e){return m.setTableProperties(e)}function Ae(e){return m.applyTableStyle(e)}function Ee(e){return m.setCellFillColor(e)}function Me(e){return m.setTableBorderColor(e)}function Re(e){return m.setTableBorderWidth(e)}var Ne=a.getCommands();function Be(e,t,n,r){if(!t)return true;let s=e.tr.insert(r,n),o=i(e),a=e.schema.marks.insertion;return o&&a&&s.addMark(r,r+n.nodeSize,a.create({revisionId:o.revisionId,author:o.author,date:o.date})),t(s.scrollIntoView()),true}function De(e,t,n){return Ne.setImageWrapType(e,t,n)}function Fe(e){return (t,n)=>{let{from:r,to:s,empty:o}=t.selection;if(o)return false;let a=t.schema.marks.comment;if(!a)return false;if(n){let i=t.tr.addMark(r,s,a.create({commentId:e}));n(i);}return true}}function We(e){return (t,n)=>{let r=t.schema.marks.comment;if(!r)return false;if(n){let s=t.tr;t.doc.descendants((o,a)=>{if(o.isText)for(let i of o.marks)i.type===r&&i.attrs.commentId===e&&s.removeMark(a,a+o.nodeSize,i);}),s.steps.length>0&&n(s);}return true}}function V(e,t,n){return (r,s)=>{let o=r.schema.marks.insertion,a=r.schema.marks.deletion;if(!o&&!a)return false;let i=n==="accept"?o:a,d=n==="accept"?a:o;if(s){let l=r.tr,b=[];r.doc.nodesBetween(e,t,(h,y)=>{if(!h.isInline)return;let S=y+h.nodeSize,x=Math.max(e,y),P=Math.min(t,S);d&&h.marks.some(v=>v.type===d)&&b.push({from:x,to:P}),i&&h.marks.some(v=>v.type===i)&&l.removeMark(x,P,i);});for(let h of b.reverse())l.delete(h.from,h.to);l.steps.length>0&&s(l);}return true}}function Le(e,t){return V(e,t,"accept")}function ze(e,t){return V(e,t,"reject")}function _(e){let t=new Set,n=[],r=a=>{typeof a=="number"&&!t.has(a)&&(t.add(a),n.push(a));},s=e.schema.marks.insertion,o=e.schema.marks.deletion;return e.doc.descendants(a=>{if(a.type.name==="paragraph"){r(a.attrs.pPrIns?.revisionId),r(a.attrs.pPrDel?.revisionId);let i=a.attrs.pPrChange;if(Array.isArray(i))for(let d of i)r(d.info.id);}if(a.type.name==="tableRow"){r(a.attrs.trIns?.revisionId),r(a.attrs.trDel?.revisionId);let i=a.attrs.trPrChange;if(Array.isArray(i))for(let d of i)r(d.info.id);}if(a.type.name==="tableCell"||a.type.name==="tableHeader"){let i=a.attrs.cellMarker;r(i?.info?.revisionId);let d=a.attrs.tcPrChange;if(Array.isArray(d))for(let l of d)r(l.info.id);}if(a.type.name==="table"){let i=a.attrs.tblPrChange;if(Array.isArray(i))for(let d of i)r(d.info.id);}if(a.isInline)for(let i of a.marks)(s&&i.type===s||o&&i.type===o)&&r(i.attrs.revisionId);}),n}function He(){return (e,t)=>{let n=_(e);if(n.length===0)return false;if(!t)return true;let r=e,s=o=>{t(o),r=r.apply(o);};for(let o of n)M(o,"accept")(r,s);return true}}function je(){return (e,t)=>{let n=_(e);if(n.length===0)return false;if(!t)return true;let r=e,s=o=>{t(o),r=r.apply(o);};for(let o of n)M(o,"reject")(r,s);return true}}function $(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((o,a)=>{if(s)return false;if(o.isInline&&!(a+o.nodeSize<=t)){for(let i of o.marks)if(i.type===n||i.type===r)return s={from:Math.max(a,t),to:a+o.nodeSize,type:i.type===n?"insertion":"deletion"},false}}),!s&&t>0?$(e,0):s}function Oe(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let o=r.attrs.pPrIns,a=r.attrs.pPrDel;o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"pPrIns"}),a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"pPrDel"});}),n}function Ve(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let o=r.attrs.pPrChange;Array.isArray(o)&&o.forEach((a,i)=>{!a?.info||typeof a.info.id!="number"||a.info.id===t&&n.push({pos:s,node:r,entryIndex:i,prior:a.previousFormatting,current:a.currentFormatting});});}),n}function _e(e,t){let n=[],r=e.schema.marks.insertion,s=e.schema.marks.deletion;return e.doc.descendants((o,a)=>{if(o.isInline){for(let i of o.marks)if((r&&i.type===r||s&&i.type===s)&&i.attrs.revisionId===t){let d=i.type===r?"insertion":"deletion",l=n[n.length-1];l&&l.markName===d&&l.to===a?l.to=a+o.nodeSize:n.push({from:a,to:a+o.nodeSize,markName:d});}}}),n}function $e(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=t+r.nodeSize,o=e.doc.nodeAt(s);!o||o.type.name!=="paragraph"||(e.setNodeMarkup(t,void 0,{...o.attrs,pPrIns:null,pPrDel:null}),e.join(s));}function N(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s={...r.attrs};s[n]=null,e.setNodeMarkup(t,void 0,s);}function Je(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=r.attrs.pPrChange;if(!Array.isArray(s)||n<0||n>=s.length)return;let o=s.slice();o.splice(n,1),e.setNodeMarkup(t,void 0,{...r.attrs,pPrChange:o.length>0?o:null});}function Ue(e,t,n){let r={...e},s=["alignment","spaceBefore","spaceAfter","lineSpacing","lineSpacingRule","beforeAutospacing","afterAutospacing","spacingExplicit","indentLeft","indentRight","indentFirstLine","hangingIndent","styleId","borders","shading","tabs","pageBreakBefore","keepNext","keepLines","contextualSpacing","bidi","outlineLevel","numPr"];for(let o of s)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]??null);return n?.numPr&&!Object.prototype.hasOwnProperty.call(t,"numPr")&&(r.numPr=null),r.numPr==null&&(r.listIsBullet=null,r.listNumFmt=null,r.listMarker=null),r}function Ge(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableRow")return;let o=r.attrs.trIns,a=r.attrs.trDel;o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"trIns"}),a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"trDel"});}),n}function Ke(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableCell"&&r.type.name!=="tableHeader")return;let o=r.attrs.cellMarker;o?.info?.revisionId===t&&n.push({pos:s,node:r,cellKind:o.kind});}),n}function M(e,t){return (n,r)=>{let s=Oe(n,e),o=_e(n,e),a=Ve(n,e),i=Ge(n,e),d=Ke(n,e);if(s.length===0&&o.length===0&&a.length===0&&i.length===0&&d.length===0)return false;if(!r)return true;let l=n.tr;l.setMeta(g,true);let b=n.schema.marks.insertion,h=n.schema.marks.deletion,y=[...o].sort((u,c)=>c.from-u.from);for(let u of y){let c=u.markName==="insertion";if(t==="accept"&&!c||t==="reject"&&c)l.delete(u.from,u.to);else {let C=c?b:h;C&&l.removeMark(u.from,u.to,C);}}let S=[...s].sort((u,c)=>c.pos-u.pos);for(let u of S){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="paragraph")continue;let C=u.kind==="pPrIns"&&f.attrs.pPrIns?.revisionId===e,p=u.kind==="pPrDel"&&f.attrs.pPrDel?.revisionId===e;if(!C&&!p)continue;if(t==="reject"&&u.kind==="pPrIns"||t==="accept"&&u.kind==="pPrDel"){let T=c+f.nodeSize,R=l.doc.nodeAt(T);!R||R.type.name!=="paragraph"?N(l,c,u.kind):(N(l,c,u.kind),$e(l,c));}else N(l,c,u.kind);}let x=[...a].sort((u,c)=>c.pos-u.pos);for(let u of x){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="paragraph")continue;let C=f.attrs.pPrChange;if(!Array.isArray(C))continue;let p=C.findIndex(g=>g.info.id===e);if(!(p<0))if(t==="reject"&&u.prior){let g=Ue(f.attrs,u.prior,u.current),T=C.slice();T.splice(p,1),l.setNodeMarkup(c,void 0,{...g,pPrChange:T.length>0?T:null});}else Je(l,c,p);}let P=[...d].sort((u,c)=>c.pos-u.pos);for(let u of P){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="tableCell"&&f.type.name!=="tableHeader")continue;let C=f.attrs.cellMarker;!C||C.info.revisionId!==e||l.setNodeMarkup(c,void 0,{...f.attrs,cellMarker:null});}let v=[...i].sort((u,c)=>c.pos-u.pos);for(let u of v){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="tableRow")continue;let C=f.attrs.trIns,p=f.attrs.trDel,g=C?.revisionId===e,T=p?.revisionId===e;if(!g&&!T)continue;if(t==="reject"&&g||t==="accept"&&T){let k=l.doc.resolve(c+1),w=k.node(k.depth-1),I=k.before(k.depth-1);if(w?.type.name==="table"&&w.childCount>1)l.delete(c,c+f.nodeSize);else if(w?.type.name==="table")if(l.doc.resolve(I).parent.childCount===1){let U=l.doc.type.schema.nodes.paragraph;l.replaceWith(I,I+w.nodeSize,U.create());}else l.delete(I,I+w.nodeSize);else {let A={...f.attrs};g&&(A.trIns=null),T&&(A.trDel=null),l.setNodeMarkup(c,void 0,A);}}else {let k={...f.attrs};g&&(k.trIns=null),T&&(k.trDel=null),l.setNodeMarkup(c,void 0,k);}}return l.steps.length===0?false:(r(l),true)}}function Ye(e){return M(e,"accept")}function qe(e){return M(e,"reject")}function J(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((o,a)=>{if(o.isInline){if(a>=t)return false;for(let i of o.marks)(i.type===n||i.type===r)&&(s={from:a,to:a+o.nodeSize,type:i.type===n?"insertion":"deletion"});}}),!s&&t<e.doc.content.size?J(e,e.doc.content.size):s}export{xe as A,Pe as B,we as C,Ie as D,Ae as E,Ee as F,Me as G,Re as H,Be as I,De as J,Fe as K,We as L,Le as M,ze as N,He as O,je as P,$ as Q,Ye as R,qe as S,J as T,q as a,Q as b,ee as c,te as d,re as e,ne as f,oe as g,ae as h,ie as i,se as j,le as k,ce as l,de as m,ue as n,pe as o,me as p,fe as q,ge as r,be as s,he as t,ye as u,Ce as v,Te as w,Se as x,ve as y,ke as z};
@@ -0,0 +1 @@
1
+ 'use strict';var chunkSZIOF5SG_js=require('./chunk-SZIOF5SG.js'),chunkL72YAV5N_js=require('./chunk-L72YAV5N.js'),chunkHQPWFUP5_js=require('./chunk-HQPWFUP5.js');function H(t,s){let r=j(s),e=new RegExp(`<w:p[\\s][^>]*w14:paraId="${r}"`,"g"),o=[],i;for(;(i=e.exec(t))!==null;)o.push(i.index);if(o.length===0||o.length>1)return null;let l=o[0],n=l,a=0;for(;n<t.length;){let f=t.indexOf("<",n);if(f===-1)break;if(t.startsWith("<w:p",f)){let w=t[f+4];if(w===">"||w===" "||w==="/"){let u=t.indexOf(">",f);if(u===-1)break;if(t[u-1]==="/"){if(a===0)return {start:l,end:u+1};n=u+1;}else a++,n=u+1;}else n=f+1;}else if(t.startsWith("</w:p>",f)){if(a--,a===0)return {start:l,end:f+6};n=f+6;}else n=f+1;}return null}function L(t,s){let r=H(t,s);return r?t.substring(r.start,r.end):null}function Y(t){let s=0,r=/<w:p[\s>]/g,e;for(;(e=r.exec(t))!==null;){let o=e.index,i=t[o+4];(i===">"||i===" ")&&s++;}return s}function B(t){let s=new Map,r=/w14:paraId="([^"]+)"/g,e;for(;(e=r.exec(t))!==null;){let o=e[1];s.set(o,(s.get(o)||0)+1);}return s}function V(t,s,r){if(r.size===0)return {safe:true};let e=B(t),o=B(s);for(let n of r){let a=e.get(n)||0;if(a===0)return {safe:false,reason:`paraId-not-found-in-original: ${n}`};if(a>1)return {safe:false,reason:`duplicate-paraId-in-original: ${n}`}}for(let n of r){let a=o.get(n)||0;if(a===0)return {safe:false,reason:`paraId-not-found-in-serialized: ${n}`};if(a>1)return {safe:false,reason:`duplicate-paraId-in-serialized: ${n}`}}let i=Y(t),l=Y(s);return i!==l?{safe:false,reason:`paragraph-count-mismatch: original=${i}, serialized=${l}`}:{safe:true}}function W(t,s,r){if(r.size===0)return t;if(!V(t,s,r).safe)return null;let o=[];for(let l of r){let n=H(t,l);if(!n)return null;let a=L(s,l);if(!a)return null;o.push({start:n.start,end:n.end,newXml:a});}o.sort((l,n)=>n.start-l.start);let i=t;for(let{start:l,end:n,newXml:a}of o)i=i.substring(0,l)+a+i.substring(n);return i}function j(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Z(t){let s=r=>r.content.some(e=>e.type==="drawing"&&e.image?.src?.startsWith("data:")&&!e.image?.rId);for(let r of t)if(r.type==="paragraph")for(let e of r.content)if(e.type==="run"){if(s(e))return true}else {if(e.type==="hyperlink"&&e.href&&!e.rId&&!e.anchor)return true;if(e.type==="insertion"||e.type==="deletion"||e.type==="moveFrom"||e.type==="moveTo"){for(let o of e.content)if(o.type==="run"&&s(o))return true}}else if(r.type==="table"){for(let e of r.rows)for(let o of e.cells)if(Z(o.content))return true}return false}async function nt(t,s,r){let{changedParaIds:e,structuralChange:o,hasUntrackedChanges:i}=r;if(o||i||!s)return null;let l=t.package.document.content;if(Z(l))return null;let n=t.package.document.comments,a=n&&n.length>0,f=chunkSZIOF5SG_js.f(t);try{let u=await(await import('jszip')).default.loadAsync(s),c=new Map;if(e.size>0){let d=u.file("word/document.xml");if(!d)return null;let p=await d.async("text"),y=chunkL72YAV5N_js.g(t),g=W(p,y,e);if(!g)return null;c.set("word/document.xml",g);}if(a){let{xml:d,paraInfos:p}=chunkL72YAV5N_js.i(n);c.set("word/comments.xml",d);let y=chunkL72YAV5N_js.k(p);y&&c.set("word/commentsExtended.xml",y);let g=chunkL72YAV5N_js.l(p);g&&c.set("word/commentsIds.xml",g);let P=chunkL72YAV5N_js.m(p,n);P&&c.set("word/commentsExtensible.xml",P);let S=u.file("[Content_Types].xml");if(S){let m=c.get("[Content_Types].xml")??await S.async("text"),x=!1,C=[["/word/comments.xml",chunkSZIOF5SG_js.b],["/word/commentsExtended.xml",chunkSZIOF5SG_js.c],["/word/commentsIds.xml",chunkSZIOF5SG_js.d],["/word/commentsExtensible.xml",chunkSZIOF5SG_js.e]];for(let[h,b]of C)m.includes(h)||(m=m.replace("</Types>",`<Override PartName="${h}" ContentType="${b}"/></Types>`),x=!0);x&&c.set("[Content_Types].xml",m);}let T="word/_rels/document.xml.rels",N=u.file(T);if(N){let m=c.get(T)??await N.async("text"),x=!1,C=[["comments.xml",chunkHQPWFUP5_js.a.comments],["commentsExtended.xml",chunkHQPWFUP5_js.a.commentsExtended],["commentsIds.xml",chunkHQPWFUP5_js.a.commentsIds],["commentsExtensible.xml",chunkHQPWFUP5_js.a.commentsExtensible]];for(let[h,b]of C)if(!m.includes(h)){let J=chunkSZIOF5SG_js.a(m);m=m.replace("</Relationships>",`<Relationship Id="rId${J+1}" Type="${b}" Target="${h}"/></Relationships>`),x=!0;}x&&c.set(T,m);}}for(let[d,p]of f)c.set(d,p);let I=u.file("docProps/core.xml");if(I){let d=await I.async("text");c.set("docProps/core.xml",chunkSZIOF5SG_js.p(d,{updateModifiedDate:!0}));}return await chunkSZIOF5SG_js.m(u,c)}catch{return null}}exports.a=V;exports.b=W;exports.c=nt;
@@ -0,0 +1 @@
1
+ import {v,B as B$1}from'./chunk-L24C5TEX.mjs';var O=30,F=200,y=24,R=10,B=10,C=24;function N(_){let{mouseX:n,mouseY:l,pagesContainer:d,target:L,hfEditMode:m,edgeProximity:r=O}=_,T=`.${v.table}`,H=`.${v.row}`,p=`.${v.cell}`,h=`.${B$1.header}`,M=`.${B$1.footer}`,E=t=>{let o=!!t.closest(h),e=!!t.closest(M);return !o&&!e?!m:o?m==="header":m==="footer"},c=L.closest(T);if(c&&!E(c)&&(c=null),!c){let t=d.querySelectorAll(T);for(let o of Array.from(t)){if(!E(o))continue;let e=o.getBoundingClientRect(),s=n>=e.left-r&&n<e.left,A=l>=e.top-r&&l<e.top,P=n>=e.left-r&&n<=e.right,I=l>=e.top-r&&l<=e.bottom;if(s&&I||A&&P){c=o;break}}}if(!c)return null;let i=c.getBoundingClientRect(),b=n<i.left+r&&n>=i.left-r,g=l<i.top+r&&l>=i.top-r;if(!b&&!g)return null;let u=c.querySelectorAll(`:scope > ${H}`);if(u.length===0)return null;let S=t=>t&&Number(t.dataset.pmStart)||0;if(b)for(let t=0;t<u.length;t++){let o=u[t].getBoundingClientRect();if(l>=o.top&&l<=o.bottom){let e=u[t].querySelector(p),s=S(e);if(!s)break;return {type:"row",clientX:i.left-y,clientY:o.top+o.height/2-R,cellPmPos:s}}}if(g){let t=u[0].querySelectorAll(`:scope > ${p}`);for(let o=0;o<t.length;o++){let e=t[o].getBoundingClientRect();if(n>=e.left&&n<=e.right){let s=S(t[o]);if(!s)break;return {type:"column",clientX:e.left+e.width/2-B,clientY:i.top-C,cellPmPos:s}}}}return null}export{O as a,F as b,N as c};
@@ -1 +1 @@
1
- import {a as a$1}from'./chunk-FCJWLEKT.mjs';import {c as c$1}from'./chunk-7E5VBRDL.mjs';import {a as a$2}from'./chunk-3JXR6YU4.mjs';import {a,b,c}from'./chunk-QPFJJPIC.mjs';import {a as a$3}from'./chunk-AMENZY5F.mjs';function $(e,t,n,i){let a=e-t-n,r=(i.count-1)*i.gap;return (a-r)/i.count}function ce(e){let t={...e.pageSize},n={...e.margins},i=e.columns??{count:1,gap:0},a=false,r,o,s=[],l=[];function c(){return t.h-n.bottom}function m(){return c()-n.top}function f(){return t.w-n.left-n.right}if(m()<=0)throw new Error("Paginator: page size and margins yield no content area");let S=$(t.w,n.left,n.right,i),T=n.top;function M(h){return n.left+h*(S+i.gap)}function x(){(r||o)&&(r&&(t=r),o&&(n=o),r=void 0,o=void 0,S=$(t.w,n.left,n.right,i));let h=s.length+1,P=n.top,E=c(),g=e.footnoteReservedHeights?.get(h)??0,p=E-g,b={number:h,fragments:[],margins:{...n},size:{...t},footnoteReservedHeight:g>0?g:void 0,columns:i.count>1?{...i}:void 0},d={page:b,cursorY:P,columnIndex:0,topMargin:P,contentBottom:p,trailingSpacing:0};return s.push(b),l.push(d),T=P,e.onNewPage&&e.onNewPage(d),d}function B(){return l.length===0?x():l[l.length-1]}function F(h){return h.contentBottom-h.cursorY}function w(h,P){let E=P||B();return F(E)>=h}function R(h){return h.columnIndex<i.count-1?(h.columnIndex+=1,h.cursorY=T,h.trailingSpacing=0,h):x()}function C(h){let P=B(),E=Number.isFinite(h)&&h>0?h:0;for(;!w(E,P);){let g=P.contentBottom-P.topMargin;if(E>g)return a||(a=true,console.warn(`Paginator: fragment height ${E.toFixed(0)}px exceeds page content height ${g.toFixed(0)}px; placing with overflow.`)),P.cursorY!==P.topMargin&&(P=R(P)),P;P=R(P);}return P}function L(h,P,E=0,g=0){let p=Math.max(E,B().trailingSpacing),b=p+P,d=C(b),y=p,z=M(d.columnIndex),I=d.cursorY+y;return h.x=z,h.y=I,d.page.fragments.push(h),d.cursorY=I+P,d.trailingSpacing=g,{state:d,x:z,y:I}}function u(){if(l.length>0){let h=l[l.length-1];if(h.page.fragments.length===0&&h.cursorY===h.topMargin)return h}return x()}function v(){let h=B();return R(h)}function Z(h){i=h,S=$(t.w,n.left,n.right,i);let P=B();P.page.columns=i.count>1?{...i}:void 0,T=P.cursorY,P.columnIndex=0;}function W(h,P,E=true){if(!E){r=h?{...h}:r,o=P?{...P}:o;return}if(h&&(t={...h}),P&&(n={...P}),m()<=0)throw new Error("Paginator: section page size and margins yield no content area");S=$(t.w,n.left,n.right,i),r=void 0,o=void 0;}return {pages:s,states:l,get columnWidth(){return S},get columns(){return {...i}},getCurrentState:B,getAvailableHeight:()=>F(B()),getContentWidth:f,fits:h=>w(h),ensureFits:C,addFragment:L,forcePageBreak:u,forceColumnBreak:v,getColumnX:M,updateColumns:Z,updatePageLayout:W}}function ge(e){let t=new Map,n=new Set;for(let i=0;i<e.length;i++){if(n.has(i))continue;let a=e[i];if(a.kind!=="paragraph"||!a.attrs?.keepNext)continue;let o=[i],s=i;for(let m=i+1;m<e.length;m++){let f=e[m];if(f.kind==="sectionBreak"||f.kind==="pageBreak"||f.kind==="columnBreak"||f.kind!=="paragraph")break;if(f.attrs?.keepNext)o.push(m),s=m,n.add(m);else break}let l=s+1,c=-1;if(l<e.length){let m=e[l];m.kind!=="sectionBreak"&&m.kind!=="pageBreak"&&m.kind!=="columnBreak"&&(c=l);}t.set(i,{startIndex:i,endIndex:s,memberIndices:o,anchorIndex:c});}return t}function fe(e,t,n){let i=0;for(let a of e.memberIndices){let r=t[a],o=n[a];if(r.kind!=="paragraph"||o.kind!=="paragraph")continue;let s=r,l=o,c=s.attrs?.spacing?.before??0;i+=c,i+=l.totalHeight;let m=s.attrs?.spacing?.after??0;i+=m;}if(e.anchorIndex!==-1){let a=n[e.anchorIndex];if(a?.kind==="paragraph"){let r=a;r.lines.length>0&&(i+=r.lines[0].lineHeight);}}return i}function me(e){let t=new Set;for(let n of e.values())for(let i=1;i<n.memberIndices.length;i++)t.add(n.memberIndices[i]);return t}function $e(e){return e.kind!=="paragraph"?false:e.attrs?.keepLines===true}function pe(e){return e.kind!=="paragraph"?false:e.attrs?.pageBreakBefore===true}function q(e){return e.displayMode==="float"||a(e.wrapType)}function qe(e){return q(e)&&!b(e.wrapType)&&e.wrapType!=="topAndBottom"}var Je=1440,de=96,Ce=Je/de,we=11,Le="Calibri",Qe=1,et=.8,tt=.2,j=null;function he(){if(!j){let e=typeof document<"u"?document.createElement("canvas"):null;if(!e)throw new Error("Canvas not available. Ensure this runs in a DOM environment.");if(j=e.getContext("2d"),!j)throw new Error("Failed to get 2D context from canvas")}return j}function Yt(){j=null;}var Be=new Map;function Re(e){let t=Be.get(e);if(t===void 0){let n=a$3(e);t={cssFallback:n.cssFallback,singleLineRatio:n.singleLineRatio},Be.set(e,t);}return t}function nt(e){return Re(e).cssFallback}function be(e){let t=[];e.italic&&t.push("italic"),e.bold&&t.push("bold");let n=e.fontSize??we,i=N(n);t.push(`${i}px`);let a=e.fontFamily??Le;return t.push(nt(a)),t.join(" ")}function K(e){let t=e.fontSize??we,n=e.fontFamily??Le,i=N(t),a=i*et,r=i*tt,o=i*Qe;try{let l=he();l.font=be(e);let c=l.measureText("Hg");typeof c.actualBoundingBoxAscent=="number"&&typeof c.actualBoundingBoxDescent=="number"&&(a=c.actualBoundingBoxAscent,r=c.actualBoundingBoxDescent);}catch{}o=Math.max(o,a+r);let s=Re(n).singleLineRatio;return {fontSize:t,ascent:a,descent:r,lineHeight:o,fontFamily:n,singleLineRatio:s}}function _(e,t){if(!e)return 0;let n=he();n.font=be(t);let a=n.measureText(e).width;return t.letterSpacing&&e.length>1&&(a+=t.letterSpacing*(e.length-1)),a}function Zt(e,t){let n=_(e,t),i=K(t);return {width:n,height:i.ascent+i.descent,ascent:i.ascent,descent:i.descent}}function ve(e,t){let n=K(t);if(!e)return {width:0,charWidths:[],metrics:n};let i=he();i.font=be(t);let a=t.letterSpacing??0,r=[],o=0;for(let s=0;s<e.length;s++){let l=e[s],m=i.measureText(l).width;a&&s<e.length-1&&(m+=a),r.push(m),o+=m;}return {width:o,charWidths:r,metrics:n}}function Ut(e,t){if(t.length===0||e<=0)return 0;let n=0;for(let i=0;i<t.length;i++){let a=t[i],r=n+a/2;if(e<=r)return i;n+=a;}return t.length}function Xt(e,t){if(e<=0||t.length===0)return 0;let n=Math.min(e,t.length),i=0;for(let a=0;a<n;a++)i+=t[a];return i}function Gt(e){return e/Ce}function jt(e){return Math.round(e*Ce)}function N(e){return e*de/72}function it(e){return e*72/de}function Kt(e){return N(e/2)}function Vt(e){return it(e)*2}function xe(e){return e/1440*96}function Se(e){return e/96*1440}function at(e){let{explicitStops:t=[],defaultTabInterval:n=720,leftIndent:i=0}=e,a=t.filter(f=>f.val!=="clear").filter(f=>f.pos>=i),r=t.filter(f=>f.val==="clear").map(f=>f.pos),o=a.reduce((f,S)=>Math.max(f,S.pos),0),s=[...a];i>0&&!a.some(f=>f.pos<=i)&&(r.some(S=>Math.abs(S-i)<20)||s.push({val:"start",pos:i,leader:"none"}));let c=o>0?Math.max(o,i):i,m=i+14400;for(;c<m;){c+=n;let f=a.some(M=>Math.abs(M.pos-c)<20),S=r.some(M=>Math.abs(M-c)<20),T=i>0&&Math.abs(c-i)<20;!f&&!S&&!T&&s.push({val:"start",pos:c,leader:"none"});}return s.sort((f,S)=>f.pos-S.pos)}function Ie(e,t,n={}){let{defaultTabInterval:i=720}=t,a=Se(e),o=at(t).find(c=>c.pos>a);if(!o){let c=xe(i),m=c-e%c;return m<=0&&(m=c),{width:m,alignment:"default"}}let l=xe(o.pos)-e;if(o.val==="center")l-=(n.followingWidth??0)/2;else if(o.val==="end")l-=n.followingWidth??0;else if(o.val==="decimal")l-=n.decimalPrefixWidth??0;else if(o.val==="bar")return {width:0,leader:o.leader,alignment:"bar"};if(l<1){let c=xe(i),m=c-e%c;return m<=0&&(m=c),{width:m,alignment:"default"}}return {width:l,leader:o.leader,alignment:o.val}}var rt="Calibri",ot=11;function st(e){let t=e.attrs,n=e.runs?.find(r=>r.kind==="text"),i=t?.listMarkerFontFamily??n?.fontFamily??t?.defaultFontFamily??rt,a=t?.listMarkerFontSize??n?.fontSize??t?.defaultFontSize??ot;return {fontFamily:i,fontSize:a}}function ke(e){let t=e.attrs;if(!t?.listMarker||t.listMarkerHidden)return 0;let n=t.indent,i=n?.hanging??0;if(i>0)return i;let{fontFamily:a,fontSize:r}=st(e),o={fontFamily:a,fontSize:r},s=_(t.listMarker,o),l=t.listMarkerSuffix??"tab";if(l==="nothing")return s;if(l==="space")return s+_(" ",o);let c=n?.left??0,m=n?.firstLine??0,f=c+m,S=f+s,T=(t.tabs??[]).filter(F=>F.val!=="clear"&&F.val!=="bar").map(F=>a$1(F.pos)).filter(F=>F>=S).sort((F,w)=>F-w)[0],M=a$1(t.defaultTabStopTwips??a$2),x=M>0?(Math.floor(S/M)+1)*M:void 0,B;return T!==void 0&&x!==void 0?B=Math.min(T,x):B=T??x,B===void 0?s+N(r)*.5:B-f}var D=11,X="Calibri",ut=1.15,te=1,Y=.5;function Ee(e,t,n,i=false){let a=1,r=e.length,o=0;for(;a<=r;){let s=a+r>>>1;_(e.slice(0,s),t)<=n?(o=s,a=s+1):r=s-1;}return i&&o===0?1:o}function V(e){return {fontFamily:e.fontFamily??X,fontSize:e.fontSize??D,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function Ae(e,t,n){let i=N(e),a=n?.ascent??i*.8,r=n?.descent??i*.2,o=n?.singleLineRatio??1.15,s=i*o,l;if(t?.lineRule==="exact"&&t.line!==void 0)l=t.line;else if(t?.lineRule==="atLeast"&&t.line!==void 0){let c=s*te;l=Math.max(t.line,c);}else t?.line!==void 0&&t?.lineUnit==="multiplier"?l=s*t.line:t?.line!==void 0&&t?.lineUnit==="px"?l=t.line:l=s*te;return {ascent:a,descent:r,lineHeight:l}}function We(e,t,n){let i=K({fontSize:e,fontFamily:n??X}),a=Ae(e,t,i),r=t?.lineRule??"auto";if(r==="auto"||r==="atLeast"){let o=N(e),s=Math.max(a.lineHeight,o*ut);if(s!==a.lineHeight)return {...a,lineHeight:s}}return a}function J(e){return e.kind==="text"}function _e(e){return e.kind==="tab"}function Oe(e){return e.kind==="image"}function ze(e){return e.kind==="lineBreak"}function Ne(e){return e.kind==="field"}function lt(e){return !e.text||e.text.replace(/\u00a0/g," ").trim().length===0}function ct(e,t){let n=0;for(let i=t+1;i<e.length;i++){let a=e[i];if(_e(a)||ze(a))break;if(J(a))n+=_(a.text||"",V(a));else if(Ne(a)){let r={fontFamily:a.fontFamily??X,fontSize:a.fontSize??D,bold:a.bold,italic:a.italic};n+=_(a.fallback||"1",r);}else Oe(a)&&(n+=a.width||0);}return n}function gt(e){let t=[];for(let n=0;n<e.length;n++){let i=e[n];(i===" "||i==="-"||i===" ")&&t.push(n+1);}return t}function De(e,t,n){let i=Math.max(1,n),a=Math.max(0,e),r=Math.max(0,t);return a>=i||r>=i||a+r>=i?{leftMargin:0,rightMargin:0}:{leftMargin:a,rightMargin:r}}function ft(e,t,n){let i=e.runs,a=e.attrs,r=a?.spacing,o=n?.floatingZones,s=n?.paragraphYOffset??0,l=a?.indent,c$1=l?.left??0,m=l?.right??0,f=(l?.firstLine??0)-(l?.hanging??0),S=Math.max(1,t-c$1-m),T=(l?.hanging??0)===0?ke(e):0,M=Math.max(1,S-f-T),x=0,B=0,F=N(D)*te,w=(g,p)=>{if(!o||o.length===0)return;let b=s+x,d=He(b,g,o,p,U)-b;d>0&&(x+=d,B+=d);};w(F,M);let R=ee(x,F,o,s),C=Math.max(1,Q(R,M)),L=[];if(i.length===0){if(a?.suppressEmptyParagraphHeight)return L.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,ascent:0,descent:0,lineHeight:0}),{kind:"paragraph",lines:L,totalHeight:0};let g=a?.defaultFontSize??D,p=a?.defaultFontFamily??X,b=We(g,r,p);L.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...b});let d=b.lineHeight;return r?.before&&(d+=r.before),r?.after&&(d+=r.after),{kind:"paragraph",lines:L,totalHeight:d}}if(i.length===1&&J(i[0])&&lt(i[0])){let g=i[0],p=g.fontSize??a?.defaultFontSize??D,b=g.fontFamily??a?.defaultFontFamily??X,d=We(p,r,b);L.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...d});let y=d.lineHeight;return r?.before&&(y+=r.before),r?.after&&(y+=r.after),{kind:"paragraph",lines:L,totalHeight:y}}let u={fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,maxFontSize:D,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:C,leftOffset:R.leftMargin,rightOffset:R.rightMargin,segmentZones:R.segments},v=()=>{let g=Ae(u.maxFontSize,r,u.maxFontMetrics),p={...g};if(u.maxImageHeightPx>p.lineHeight){let d=u.maxImageHeightPx,y=p.descent;u.fromRun===u.toRun?(p.lineHeight=d+y*2,p.ascent=d+y):(p.lineHeight=d+y,p.ascent=d);}let b={fromRun:u.fromRun,fromChar:u.fromChar,toRun:u.toRun,toChar:u.toChar,width:u.width,...p};u.leftOffset>0&&(b.leftOffset=u.leftOffset),u.rightOffset>0&&(b.rightOffset=u.rightOffset),u.segmentZones?.length&&(b.segments=Z(b,u.segmentZones)),B>0&&(b.floatSkipBefore=B,B=0),L.push(b),x+=g.lineHeight;},Z=(g,p)=>{let b=p[0],d=p[1];if(!b)return;if(!d||g.width<=b.availableWidth+Y)return [{fromRun:g.fromRun,fromChar:g.fromChar,toRun:g.toRun,toChar:g.toChar,width:g.width,leftOffset:b.leftOffset,availableWidth:b.availableWidth}];if(g.fromRun!==g.toRun)return;let y=i[g.fromRun];if(!y||!J(y))return;let z=y,I=z.text.slice(g.fromChar,g.toChar),H=V(z),k=Ee(I,H,b.availableWidth);if(k<=0||k>=I.length)return;let O=g.fromChar+k,A=I.slice(0,k),ie=I.slice(k);return [{fromRun:g.fromRun,fromChar:g.fromChar,toRun:g.toRun,toChar:O,width:_(A,H),leftOffset:b.leftOffset,availableWidth:b.availableWidth},{fromRun:g.fromRun,fromChar:O,toRun:g.toRun,toChar:g.toChar,width:_(ie,H),leftOffset:d.leftOffset,availableWidth:d.availableWidth}]},W=(g,p)=>{v();let b=N(D)*te;w(b,S);let d=ee(x,b,o,s),y=Math.max(1,Q(d,S));u={fromRun:g,fromChar:p,toRun:g,toChar:p,width:0,maxFontSize:D,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:y,leftOffset:d.leftMargin,rightOffset:d.rightMargin,segmentZones:d.segments};},h=g=>{let p=g.fontSize??D;(!u.maxFontMetrics||p>u.maxFontSize)&&(u.maxFontSize=p,u.maxFontMetrics=K(g));};for(let g=0;g<i.length;g++){let p=i[g];if(ze(p)){u.toRun=g,u.toChar=0,W(g+1,0);continue}if(_e(p)){let b=V(p);h(b);let d=ct(i,g),y=u.width+(u.leftOffset??0),z=L.length===0,I=c$1+(z?f:0)+y,H={explicitStops:a?.tabs,leftIndent:Se(c$1)},k=Ie(I,H,{followingWidth:d}).width;if(y+k>u.availableWidth+Y){let O=u.availableWidth-y-d;O>1&&(k=O);}u.width+k>u.availableWidth+Y&&(W(g,0),h(b)),u.width+=k,u.toRun=g,u.toChar=1;continue}if(Oe(p)){let b=p.wrapType,d=p.displayMode==="float"||c(b);if(p.position&&d){u.toRun=g,u.toChar=1;continue}if(b==="topAndBottom"||p.displayMode==="block"){u.width>0&&W(g,0);let H=p.height,k=p.distTop??6,O=p.distBottom??6;u.toRun=g,u.toChar=1,u.maxImageHeightPx=H+k+O,W(g+1,0);continue}let y=p.width,I=p.height+(p.distTop??0)+(p.distBottom??0);I>u.maxImageHeightPx&&(u.maxImageHeightPx=I),u.width+y>u.availableWidth+Y&&W(g,0),u.width+=y,u.toRun=g,u.toChar=1;continue}if(Ne(p)){let b=p.fallback||"1",d={fontFamily:p.fontFamily??X,fontSize:p.fontSize??D,bold:p.bold,italic:p.italic};h(d);let y=_(b,d);u.width>0&&u.width+y>u.availableWidth+Y&&(W(g,0),h(d)),u.width+=y,u.toRun=g,u.toChar=1;continue}if(J(p)){let b=p,d=b.text,y=V(b);if(h(y),!d||d.length===0){u.toRun=g,u.toChar=0;continue}let z=gt(d),I=0;for(;I<d.length;){let H=d.length;for(let A of z)if(A>I){H=A;break}let k=d.slice(I,H),O=_(k,y);if(O>u.availableWidth+Y){let A=0;for(;A<k.length;){let ie=u.availableWidth-u.width+Y,je=k.slice(A),ae=Ee(je,y,ie);if(ae===0){if(u.width>0){W(g,I+A),h(y);continue}ae=1;}let re=A+ae,Ke=k.slice(A,re),Ve=_(Ke,y);u.width+=Ve,u.toRun=g,u.toChar=I+re,A=re,A<k.length&&(W(g,I+A),h(y));}I=H;continue}u.width>0&&u.width+O>u.availableWidth+Y&&(W(g,I),h(y)),u.width+=O,u.toRun=g,u.toChar=H,I=H;}}}v();let E=L.reduce((g,p)=>g+p.lineHeight+(p.floatSkipBefore??0),0);return r?.before&&(E+=r.before),r?.after&&(E+=r.after),{kind:"paragraph",lines:L,totalHeight:E}}function ln(e,t){return e.map(n=>ft(n,t))}function cn(e){let t=V(e);return ve(e.text,t).charWidths}function mn(e,t){return e.map(n=>{let i=n.x-n.distLeft,a=n.x+n.width+n.distRight,r=n.y-n.distTop,o=n.y+n.height+n.distBottom,s=0,l=0,c,m=n.wrapText??"bothSides";m==="right"?s=Me(a):m==="left"?l=Te(i,t):m==="largest"?{leftMargin:s,rightMargin:l}=ht(i,a,t):pt(i,a,t)?c=dt(i,a,t):n.side==="left"?s=Me(a):l=Te(i,t);let f=De(s,l,t);return {leftMargin:f.leftMargin,rightMargin:f.rightMargin,topY:r,bottomY:o,segments:c}})}function Q(e,t){return e.segments?.reduce((i,a)=>i+a.availableWidth,0)??t-e.leftMargin-e.rightMargin}function ee(e,t,n,i){if(!n||n.length===0)return {leftMargin:0,rightMargin:0};let a=0,r=0,o,s=i+e,l=s+t;for(let c of n)if(!(l<=c.topY||s>=c.bottomY)){if(c.segments?.length){o=o?mt(o,c.segments):c.segments;continue}a=Math.max(a,c.leftMargin),r=Math.max(r,c.rightMargin);}return {leftMargin:a,rightMargin:r,segments:o}}function He(e,t,n,i,a){if(!n||n.length===0)return e;let r=e;for(let o=0;o<n.length+2;o++){let s=ee(r,t,n,0);if(Q(s,i)>=a)return r;let c=r+t,m=1/0;for(let f of n)c<=f.topY||r>=f.bottomY||f.bottomY>r&&f.bottomY<m&&(m=f.bottomY);if(!Number.isFinite(m)||m<=r)return r;r=m;}return r}function mt(e,t){let n=[];for(let i of e)for(let a of t){let r=Math.max(i.leftOffset,a.leftOffset),o=Math.min(i.leftOffset+i.availableWidth,a.leftOffset+a.availableWidth);o>r&&n.push({leftOffset:r,availableWidth:o-r});}return n}var U=24;function pt(e,t,n){return e>U&&t+U<n}function dt(e,t,n){return [{leftOffset:0,availableWidth:Math.max(0,e)},{leftOffset:Math.max(0,t),availableWidth:Math.max(0,n-t)}].filter(i=>i.availableWidth>1)}function ht(e,t,n){let i=Math.max(0,e);return Math.max(0,n-t)>=i?{leftMargin:Me(t),rightMargin:0}:{leftMargin:0,rightMargin:Te(e,n)}}function Me(e){return Math.max(0,e)}function Te(e,t){return Math.max(0,t-e)}var Ye={count:1,gap:0};function bt(e,t,n){return {activeTopMargin:e.top,activeBottomMargin:e.bottom,activeLeftMargin:e.left,activeRightMargin:e.right,pendingTopMargin:null,pendingBottomMargin:null,pendingLeftMargin:null,pendingRightMargin:null,activePageSize:{...t},pendingPageSize:null,activeColumns:n?{...n}:{...Ye},pendingColumns:null,activeOrientation:null,pendingOrientation:null,hasAnyPages:false}}function xt(e,t){return t.count>1}function ne(e){return e?{count:e.count,gap:e.gap}:{...Ye}}function St(e,t,n){let i={...t},a=e.type??"continuous",r=e.margins,o=e.pageSize,s=e.orientation;r&&(typeof r.top=="number"&&(i.pendingTopMargin=Math.max(0,r.top)),typeof r.bottom=="number"&&(i.pendingBottomMargin=Math.max(0,r.bottom)),typeof r.left=="number"&&(i.pendingLeftMargin=Math.max(0,r.left)),typeof r.right=="number"&&(i.pendingRightMargin=Math.max(0,r.right))),o&&(i.pendingPageSize={w:o.w,h:o.h}),s&&(i.pendingOrientation=s);let l=xt((e.margins,void 0),i.activeColumns);switch(a){case "nextPage":return i.pendingColumns=ne(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false},state:i};case "evenPage":return i.pendingColumns=ne(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false,requiredParity:"even"},state:i};case "oddPage":return i.pendingColumns=ne(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false,requiredParity:"odd"},state:i};default:return l?(i.pendingColumns=ne(void 0),{decision:{forcePageBreak:false,forceMidPageRegion:true},state:i}):{decision:{forcePageBreak:false,forceMidPageRegion:false},state:i}}}function Mt(e){let t={...e};return t.pendingTopMargin!==null&&(t.activeTopMargin=t.pendingTopMargin,t.pendingTopMargin=null),t.pendingBottomMargin!==null&&(t.activeBottomMargin=t.pendingBottomMargin,t.pendingBottomMargin=null),t.pendingLeftMargin!==null&&(t.activeLeftMargin=t.pendingLeftMargin,t.pendingLeftMargin=null),t.pendingRightMargin!==null&&(t.activeRightMargin=t.pendingRightMargin,t.pendingRightMargin=null),t.pendingPageSize!==null&&(t.activePageSize=t.pendingPageSize,t.pendingPageSize=null),t.pendingColumns!==null&&(t.activeColumns=t.pendingColumns,t.pendingColumns=null),t.pendingOrientation!==null&&(t.activeOrientation=t.pendingOrientation,t.pendingOrientation=null),t}function Tt(e){return {top:e.pendingTopMargin??e.activeTopMargin,bottom:e.pendingBottomMargin??e.activeBottomMargin,left:e.pendingLeftMargin??e.activeLeftMargin,right:e.pendingRightMargin??e.activeRightMargin}}function yt(e){return e.pendingPageSize??e.activePageSize}function Pt(e){return e.pendingColumns??e.activeColumns}function Ft(e,t){for(let n=0;n<e.pages.length;n++)for(let i of e.pages[n].fragments){if(i.pmStart==null)continue;let a=i.pmStart,r=i.pmEnd??a+1;if(t>=a&&t<r)return n}return null}var Bt={w:816,h:1056},G={top:96,right:96,bottom:96,left:96},Xe={count:1,gap:0};function Ct(e,t,n){let i=[],a=[],r=t;for(let o=0;o<e.length;o++){if(e[o].kind!=="sectionBreak")continue;let s=e[o],l={pageSize:s.pageSize??r.pageSize,margins:s.margins??r.margins,columns:s.columns};i.push(l),a.push(o),r=l;}return i.push(n),{configs:i,breakIndices:a}}function Ge(e){if(e.runs.length===0)return true;if(e.runs.length!==1)return false;let t=e.runs[0];return t.kind==="text"&&(t.text??"")===""}function Ze(e){let t=e.attrs?.spacing?.before??0;return Ge(e)&&!e.attrs?.spacingExplicit?.before?0:t}function Ue(e){let t=e.attrs?.spacing?.after??0;return Ge(e)&&!e.attrs?.spacingExplicit?.after?0:t}function wt(e){for(let t=0;t<e.length-1;t++){let n=e[t],i=e[t+1];if(n.kind!=="paragraph"||i.kind!=="paragraph")continue;let a=n.attrs,r=i.attrs;a?.contextualSpacing&&r?.contextualSpacing&&a.styleId&&a.styleId===r.styleId&&(a.spacing&&(a.spacing={...a.spacing,after:0}),r.spacing&&(r.spacing={...r.spacing,before:0}));}}function yn(e,t,n={}){if(e.length!==t.length)throw new Error(`layoutDocument: expected one measure per block (blocks=${e.length}, measures=${t.length})`);let i=n.pageSize??Bt,a={top:n.margins?.top??G.top,right:n.margins?.right??G.right,bottom:n.margins?.bottom??G.bottom,left:n.margins?.left??G.left,header:n.margins?.header??n.margins?.top??G.top,footer:n.margins?.footer??n.margins?.bottom??G.bottom};n.headerContentHeights,n.footerContentHeights,n.titlePage,n.evenAndOddHeaders;let r={...a},o=n.finalPageSize??i,s=n.finalMargins??r;if(i.w-r.left-r.right<=0)throw new Error("layoutDocument: page size and margins yield no content area");let c={pageSize:i,margins:r,columns:n.columns},m={pageSize:o,margins:s,columns:n.columns},{configs:f,breakIndices:S}=Ct(e,c,m),T=[...S.map(R=>e[R].type),n.bodyBreakType],M=f[0]??c,x=ce({pageSize:M.pageSize,margins:M.margins,columns:M.columns??Xe,footnoteReservedHeights:n.footnoteReservedHeights});wt(e);let B=ge(e),F=me(B),w=0;for(let R=0;R<e.length;R++){let C=e[R],L=t[R];pe(C)&&x.forcePageBreak();let u=B.get(R);if(u&&!F.has(R)){let v=fe(u,e,t),Z=x.getCurrentState(),W=x.getAvailableHeight(),h=Z.contentBottom-Z.topMargin;v<=h&&v>W&&Z.page.fragments.length>0&&x.forcePageBreak();}switch(C.kind){case "paragraph":Lt(C,L,x,x.getContentWidth());break;case "table":C.floating?kt(C,L,x,x.getContentWidth()):It(C,L,x);break;case "image":Et(C,L,x);break;case "textBox":Ht(C,L,x);break;case "pageBreak":x.forcePageBreak();break;case "columnBreak":x.forceColumnBreak();break;case "sectionBreak":{let v=T[w+1]??T[w];At(C,x,f[w+1]??M,v),w++;break}default:c$1(C,"runLayoutPipeline");}}return x.pages.length===0&&x.getCurrentState(),{pageSize:i,pages:x.pages,columns:n.columns,pageGap:n.pageGap}}function Lt(e,t,n,i){if(t.kind!=="paragraph")throw new Error("layoutParagraph: expected paragraph measure");let a=t.lines;if(a.length===0){let l=Ze(e),c=Ue(e),m=n.getCurrentState(),f={kind:"paragraph",blockId:e.id,x:n.getColumnX(m.columnIndex),y:m.cursorY+l,width:i,height:0,fromLine:0,toLine:0,pmStart:e.pmStart,pmEnd:e.pmEnd};n.addFragment(f,0,l,c);return}let r=Ze(e),o=Ue(e),s=0;for(;s<a.length;){let l=n.getCurrentState(),c=n.getAvailableHeight(),m=0,f=0;for(let w=s;w<a.length;w++){let R=a[w].lineHeight+(a[w].floatSkipBefore??0),C=m+R;if((s===0&&w===s?C+r:C)<=c||f===0)m=C,f++;else break}let S=s===0,T=s+f>=a.length,M=S?r:0,x=T?o:0,B={kind:"paragraph",blockId:e.id,x:n.getColumnX(l.columnIndex),y:0,width:i,height:m,fromLine:s,toLine:s+f,pmStart:e.pmStart,pmEnd:e.pmEnd,continuesFromPrev:!S,continuesOnNext:!T},F=n.addFragment(B,m,M,x);B.y=F.y,s+=f,s<a.length&&n.ensureFits(a[s].lineHeight);}}function Rt(e){let t=0;for(let n of e.rows)if(n.isHeader)t++;else break;return t}function vt(e,t){let n=0;for(let i=0;i<t&&i<e.rows.length;i++)n+=e.rows[i].height;return n}function It(e,t,n){if(t.kind!=="table")throw new Error("layoutTable: expected table measure");let i=t.rows;if(i.length===0)return;let a=Rt(e),r=vt(t,a),o=0;for(;o<i.length;){let s=n.getCurrentState(),l=n.getAvailableHeight(),c=o===0,m=c?s.trailingSpacing:0,f=l-m,S=!c&&a>0?r:0,T=0,M=0;for(let C=o;C<i.length;C++){let L=i[C].height;if(T+L+S<=f||M===0)T+=L,M++;else break}let x=T+S,B=o+M>=i.length,F=n.getColumnX(s.columnIndex);e.justification==="center"?F=F+(n.columnWidth-t.totalWidth)/2:e.justification==="right"?F=F+n.columnWidth-t.totalWidth:e.indent&&(F+=e.indent);let w={kind:"table",blockId:e.id,x:F,y:0,width:t.totalWidth,height:x,fromRow:o,toRow:o+M,pmStart:e.pmStart,pmEnd:e.pmEnd,continuesFromPrev:!c,continuesOnNext:!B,headerRowCount:!c&&a>0?a:void 0},R=n.addFragment(w,x,0,0);if(w.y=R.y,w.x=F,o+=M,o<i.length){let C=i[o].height+(a>0?r:0);n.ensureFits(C);}}}function kt(e,t,n,i){if(t.kind!=="table")throw new Error("layoutFloatingTable: expected table measure");let a=n.getCurrentState(),r=e.floating,o=a.page,s=o.margins,l=t.totalWidth,c=t.totalHeight,m=o.size.h-s.top-s.bottom,f=s.left,S=s.top;r?.horzAnchor==="page"&&(f=0),r?.vertAnchor==="page"&&(S=0),r?.vertAnchor==="text"&&(S=a.cursorY);let T=n.getColumnX(a.columnIndex);if(r?.tblpX!==void 0)T=f+r.tblpX;else if(r?.tblpXSpec){let v=r.tblpXSpec;v==="left"||v==="inside"?T=f:v==="right"||v==="outside"?T=f+i-l:v==="center"&&(T=f+(i-l)/2);}else e.justification==="center"?T=f+(i-l)/2:e.justification==="right"&&(T=f+i-l);let M=a.cursorY,x=false;if(r?.tblpY!==void 0)M=S+r.tblpY,x=true;else if(r?.tblpYSpec){x=true;let v=r.tblpYSpec;v==="top"?M=S:v==="bottom"?M=S+m-c:v==="center"&&(M=S+(m-c)/2);}x||(M=n.ensureFits(c).cursorY);let B=s.left,F=s.left+i-l;Number.isFinite(F)&&(T=Math.max(B,Math.min(T,F)));let w={kind:"table",blockId:e.id,x:T,y:M,width:l,height:c,fromRow:0,toRow:e.rows.length,pmStart:e.pmStart,pmEnd:e.pmEnd,isFloating:true};a.page.fragments.push(w);let R=r?.leftFromText??0,C=r?.rightFromText??0,L=T-s.left-R,u=s.left+i-(T+l)-C;if(L<U&&u<U){let v=M+c+(r?.bottomFromText??0);v>a.cursorY&&(a.cursorY=v);}}function Et(e,t,n){if(t.kind!=="image")throw new Error("layoutImage: expected image measure");if(e.anchor?.isAnchored){Wt(e,t,n);return}let i=n.ensureFits(t.height),a={kind:"image",blockId:e.id,x:n.getColumnX(i.columnIndex),y:0,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd},r=n.addFragment(a,t.height,0,0);a.y=r.y;}function Wt(e,t,n){let i=n.getCurrentState(),a=e.anchor,r=a.offsetH??n.getColumnX(i.columnIndex),o=a.offsetV??i.cursorY,s={kind:"image",blockId:e.id,x:r,y:o,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd,isAnchored:true,zIndex:a.behindDoc?-1:1};i.page.fragments.push(s);}function Ht(e,t,n){if(t.kind!=="textBox")throw new Error("layoutTextBox: expected textBox measure");if(q(e)){let o=n.getCurrentState(),s={kind:"textBox",blockId:e.id,x:n.getColumnX(o.columnIndex),y:o.cursorY,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd,isFloating:true,zIndex:e.wrapType==="behind"?-1:1};o.page.fragments.push(s);return}let i=n.ensureFits(t.height),a={kind:"textBox",blockId:e.id,x:n.getColumnX(i.columnIndex),y:0,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd},r=n.addFragment(a,t.height,0,0);a.y=r.y;}function At(e,t,n,i){switch(i??"nextPage"){case "nextPage":t.updatePageLayout(n.pageSize,n.margins),t.forcePageBreak();break;case "evenPage":{t.updatePageLayout(n.pageSize,n.margins),t.forcePageBreak().page.number%2!==0&&t.forcePageBreak();break}case "oddPage":{t.updatePageLayout(n.pageSize,n.margins),t.forcePageBreak().page.number%2===0&&t.forcePageBreak();break}case "continuous":t.updatePageLayout(n.pageSize,n.margins,false);break}t.updateColumns(n.columns??Xe);}export{fe as A,me as B,$e as C,pe as D,q as E,qe as F,bt as G,St as H,Mt as I,Tt as J,yt as K,Pt as L,Ft as M,Ct as N,yn as O,vt as P,he as a,Yt as b,be as c,K as d,_ as e,Zt as f,ve as g,Ut as h,Xt as i,Gt as j,jt as k,N as l,it as m,Kt as n,Vt as o,mn as p,ee as q,Ie as r,st as s,ke as t,De as u,ft as v,ln as w,cn as x,ce as y,ge as z};
1
+ import {a as a$1}from'./chunk-FCJWLEKT.mjs';import {c as c$1}from'./chunk-7E5VBRDL.mjs';import {a as a$2}from'./chunk-BOOHU5EW.mjs';import {a,b,c}from'./chunk-QPFJJPIC.mjs';import {a as a$3}from'./chunk-AMENZY5F.mjs';function $(e,t,n,i){let a=e-t-n,r=(i.count-1)*i.gap;return (a-r)/i.count}function ce(e){let t={...e.pageSize},n={...e.margins},i=e.columns??{count:1,gap:0},a=false,r,o,s=[],l=[];function c(){return t.h-n.bottom}function m(){return c()-n.top}function f(){return t.w-n.left-n.right}if(m()<=0)throw new Error("Paginator: page size and margins yield no content area");let S=$(t.w,n.left,n.right,i),T=n.top;function M(h){return n.left+h*(S+i.gap)}function x(){(r||o)&&(r&&(t=r),o&&(n=o),r=void 0,o=void 0,S=$(t.w,n.left,n.right,i));let h=s.length+1,P=n.top,E=c(),g=e.footnoteReservedHeights?.get(h)??0,p=E-g,b={number:h,fragments:[],margins:{...n},size:{...t},footnoteReservedHeight:g>0?g:void 0,columns:i.count>1?{...i}:void 0},d={page:b,cursorY:P,columnIndex:0,topMargin:P,contentBottom:p,trailingSpacing:0};return s.push(b),l.push(d),T=P,e.onNewPage&&e.onNewPage(d),d}function B(){return l.length===0?x():l[l.length-1]}function F(h){return h.contentBottom-h.cursorY}function w(h,P){let E=P||B();return F(E)>=h}function R(h){return h.columnIndex<i.count-1?(h.columnIndex+=1,h.cursorY=T,h.trailingSpacing=0,h):x()}function C(h){let P=B(),E=Number.isFinite(h)&&h>0?h:0;for(;!w(E,P);){let g=P.contentBottom-P.topMargin;if(E>g)return a||(a=true,console.warn(`Paginator: fragment height ${E.toFixed(0)}px exceeds page content height ${g.toFixed(0)}px; placing with overflow.`)),P.cursorY!==P.topMargin&&(P=R(P)),P;P=R(P);}return P}function L(h,P,E=0,g=0){let p=Math.max(E,B().trailingSpacing),b=p+P,d=C(b),y=p,z=M(d.columnIndex),I=d.cursorY+y;return h.x=z,h.y=I,d.page.fragments.push(h),d.cursorY=I+P,d.trailingSpacing=g,{state:d,x:z,y:I}}function u(){if(l.length>0){let h=l[l.length-1];if(h.page.fragments.length===0&&h.cursorY===h.topMargin)return h}return x()}function v(){let h=B();return R(h)}function Z(h){i=h,S=$(t.w,n.left,n.right,i);let P=B();P.page.columns=i.count>1?{...i}:void 0,T=P.cursorY,P.columnIndex=0;}function W(h,P,E=true){if(!E){r=h?{...h}:r,o=P?{...P}:o;return}if(h&&(t={...h}),P&&(n={...P}),m()<=0)throw new Error("Paginator: section page size and margins yield no content area");S=$(t.w,n.left,n.right,i),r=void 0,o=void 0;}return {pages:s,states:l,get columnWidth(){return S},get columns(){return {...i}},getCurrentState:B,getAvailableHeight:()=>F(B()),getContentWidth:f,fits:h=>w(h),ensureFits:C,addFragment:L,forcePageBreak:u,forceColumnBreak:v,getColumnX:M,updateColumns:Z,updatePageLayout:W}}function ge(e){let t=new Map,n=new Set;for(let i=0;i<e.length;i++){if(n.has(i))continue;let a=e[i];if(a.kind!=="paragraph"||!a.attrs?.keepNext)continue;let o=[i],s=i;for(let m=i+1;m<e.length;m++){let f=e[m];if(f.kind==="sectionBreak"||f.kind==="pageBreak"||f.kind==="columnBreak"||f.kind!=="paragraph")break;if(f.attrs?.keepNext)o.push(m),s=m,n.add(m);else break}let l=s+1,c=-1;if(l<e.length){let m=e[l];m.kind!=="sectionBreak"&&m.kind!=="pageBreak"&&m.kind!=="columnBreak"&&(c=l);}t.set(i,{startIndex:i,endIndex:s,memberIndices:o,anchorIndex:c});}return t}function fe(e,t,n){let i=0;for(let a of e.memberIndices){let r=t[a],o=n[a];if(r.kind!=="paragraph"||o.kind!=="paragraph")continue;let s=r,l=o,c=s.attrs?.spacing?.before??0;i+=c,i+=l.totalHeight;let m=s.attrs?.spacing?.after??0;i+=m;}if(e.anchorIndex!==-1){let a=n[e.anchorIndex];if(a?.kind==="paragraph"){let r=a;r.lines.length>0&&(i+=r.lines[0].lineHeight);}}return i}function me(e){let t=new Set;for(let n of e.values())for(let i=1;i<n.memberIndices.length;i++)t.add(n.memberIndices[i]);return t}function $e(e){return e.kind!=="paragraph"?false:e.attrs?.keepLines===true}function pe(e){return e.kind!=="paragraph"?false:e.attrs?.pageBreakBefore===true}function q(e){return e.displayMode==="float"||a(e.wrapType)}function qe(e){return q(e)&&!b(e.wrapType)&&e.wrapType!=="topAndBottom"}var Je=1440,de=96,Ce=Je/de,we=11,Le="Calibri",Qe=1,et=.8,tt=.2,j=null;function he(){if(!j){let e=typeof document<"u"?document.createElement("canvas"):null;if(!e)throw new Error("Canvas not available. Ensure this runs in a DOM environment.");if(j=e.getContext("2d"),!j)throw new Error("Failed to get 2D context from canvas")}return j}function Yt(){j=null;}var Be=new Map;function Re(e){let t=Be.get(e);if(t===void 0){let n=a$3(e);t={cssFallback:n.cssFallback,singleLineRatio:n.singleLineRatio},Be.set(e,t);}return t}function nt(e){return Re(e).cssFallback}function be(e){let t=[];e.italic&&t.push("italic"),e.bold&&t.push("bold");let n=e.fontSize??we,i=N(n);t.push(`${i}px`);let a=e.fontFamily??Le;return t.push(nt(a)),t.join(" ")}function K(e){let t=e.fontSize??we,n=e.fontFamily??Le,i=N(t),a=i*et,r=i*tt,o=i*Qe;try{let l=he();l.font=be(e);let c=l.measureText("Hg");typeof c.actualBoundingBoxAscent=="number"&&typeof c.actualBoundingBoxDescent=="number"&&(a=c.actualBoundingBoxAscent,r=c.actualBoundingBoxDescent);}catch{}o=Math.max(o,a+r);let s=Re(n).singleLineRatio;return {fontSize:t,ascent:a,descent:r,lineHeight:o,fontFamily:n,singleLineRatio:s}}function _(e,t){if(!e)return 0;let n=he();n.font=be(t);let a=n.measureText(e).width;return t.letterSpacing&&e.length>1&&(a+=t.letterSpacing*(e.length-1)),a}function Zt(e,t){let n=_(e,t),i=K(t);return {width:n,height:i.ascent+i.descent,ascent:i.ascent,descent:i.descent}}function ve(e,t){let n=K(t);if(!e)return {width:0,charWidths:[],metrics:n};let i=he();i.font=be(t);let a=t.letterSpacing??0,r=[],o=0;for(let s=0;s<e.length;s++){let l=e[s],m=i.measureText(l).width;a&&s<e.length-1&&(m+=a),r.push(m),o+=m;}return {width:o,charWidths:r,metrics:n}}function Ut(e,t){if(t.length===0||e<=0)return 0;let n=0;for(let i=0;i<t.length;i++){let a=t[i],r=n+a/2;if(e<=r)return i;n+=a;}return t.length}function Xt(e,t){if(e<=0||t.length===0)return 0;let n=Math.min(e,t.length),i=0;for(let a=0;a<n;a++)i+=t[a];return i}function Gt(e){return e/Ce}function jt(e){return Math.round(e*Ce)}function N(e){return e*de/72}function it(e){return e*72/de}function Kt(e){return N(e/2)}function Vt(e){return it(e)*2}function xe(e){return e/1440*96}function Se(e){return e/96*1440}function at(e){let{explicitStops:t=[],defaultTabInterval:n=720,leftIndent:i=0}=e,a=t.filter(f=>f.val!=="clear").filter(f=>f.pos>=i),r=t.filter(f=>f.val==="clear").map(f=>f.pos),o=a.reduce((f,S)=>Math.max(f,S.pos),0),s=[...a];i>0&&!a.some(f=>f.pos<=i)&&(r.some(S=>Math.abs(S-i)<20)||s.push({val:"start",pos:i,leader:"none"}));let c=o>0?Math.max(o,i):i,m=i+14400;for(;c<m;){c+=n;let f=a.some(M=>Math.abs(M.pos-c)<20),S=r.some(M=>Math.abs(M-c)<20),T=i>0&&Math.abs(c-i)<20;!f&&!S&&!T&&s.push({val:"start",pos:c,leader:"none"});}return s.sort((f,S)=>f.pos-S.pos)}function Ie(e,t,n={}){let{defaultTabInterval:i=720}=t,a=Se(e),o=at(t).find(c=>c.pos>a);if(!o){let c=xe(i),m=c-e%c;return m<=0&&(m=c),{width:m,alignment:"default"}}let l=xe(o.pos)-e;if(o.val==="center")l-=(n.followingWidth??0)/2;else if(o.val==="end")l-=n.followingWidth??0;else if(o.val==="decimal")l-=n.decimalPrefixWidth??0;else if(o.val==="bar")return {width:0,leader:o.leader,alignment:"bar"};if(l<1){let c=xe(i),m=c-e%c;return m<=0&&(m=c),{width:m,alignment:"default"}}return {width:l,leader:o.leader,alignment:o.val}}var rt="Calibri",ot=11;function st(e){let t=e.attrs,n=e.runs?.find(r=>r.kind==="text"),i=t?.listMarkerFontFamily??n?.fontFamily??t?.defaultFontFamily??rt,a=t?.listMarkerFontSize??n?.fontSize??t?.defaultFontSize??ot;return {fontFamily:i,fontSize:a}}function ke(e){let t=e.attrs;if(!t?.listMarker||t.listMarkerHidden)return 0;let n=t.indent,i=n?.hanging??0;if(i>0)return i;let{fontFamily:a,fontSize:r}=st(e),o={fontFamily:a,fontSize:r},s=_(t.listMarker,o),l=t.listMarkerSuffix??"tab";if(l==="nothing")return s;if(l==="space")return s+_(" ",o);let c=n?.left??0,m=n?.firstLine??0,f=c+m,S=f+s,T=(t.tabs??[]).filter(F=>F.val!=="clear"&&F.val!=="bar").map(F=>a$1(F.pos)).filter(F=>F>=S).sort((F,w)=>F-w)[0],M=a$1(t.defaultTabStopTwips??a$2),x=M>0?(Math.floor(S/M)+1)*M:void 0,B;return T!==void 0&&x!==void 0?B=Math.min(T,x):B=T??x,B===void 0?s+N(r)*.5:B-f}var D=11,X="Calibri",ut=1.15,te=1,Y=.5;function Ee(e,t,n,i=false){let a=1,r=e.length,o=0;for(;a<=r;){let s=a+r>>>1;_(e.slice(0,s),t)<=n?(o=s,a=s+1):r=s-1;}return i&&o===0?1:o}function V(e){return {fontFamily:e.fontFamily??X,fontSize:e.fontSize??D,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function Ae(e,t,n){let i=N(e),a=n?.ascent??i*.8,r=n?.descent??i*.2,o=n?.singleLineRatio??1.15,s=i*o,l;if(t?.lineRule==="exact"&&t.line!==void 0)l=t.line;else if(t?.lineRule==="atLeast"&&t.line!==void 0){let c=s*te;l=Math.max(t.line,c);}else t?.line!==void 0&&t?.lineUnit==="multiplier"?l=s*t.line:t?.line!==void 0&&t?.lineUnit==="px"?l=t.line:l=s*te;return {ascent:a,descent:r,lineHeight:l}}function We(e,t,n){let i=K({fontSize:e,fontFamily:n??X}),a=Ae(e,t,i),r=t?.lineRule??"auto";if(r==="auto"||r==="atLeast"){let o=N(e),s=Math.max(a.lineHeight,o*ut);if(s!==a.lineHeight)return {...a,lineHeight:s}}return a}function J(e){return e.kind==="text"}function _e(e){return e.kind==="tab"}function Oe(e){return e.kind==="image"}function ze(e){return e.kind==="lineBreak"}function Ne(e){return e.kind==="field"}function lt(e){return !e.text||e.text.replace(/\u00a0/g," ").trim().length===0}function ct(e,t){let n=0;for(let i=t+1;i<e.length;i++){let a=e[i];if(_e(a)||ze(a))break;if(J(a))n+=_(a.text||"",V(a));else if(Ne(a)){let r={fontFamily:a.fontFamily??X,fontSize:a.fontSize??D,bold:a.bold,italic:a.italic};n+=_(a.fallback||"1",r);}else Oe(a)&&(n+=a.width||0);}return n}function gt(e){let t=[];for(let n=0;n<e.length;n++){let i=e[n];(i===" "||i==="-"||i===" ")&&t.push(n+1);}return t}function De(e,t,n){let i=Math.max(1,n),a=Math.max(0,e),r=Math.max(0,t);return a>=i||r>=i||a+r>=i?{leftMargin:0,rightMargin:0}:{leftMargin:a,rightMargin:r}}function ft(e,t,n){let i=e.runs,a=e.attrs,r=a?.spacing,o=n?.floatingZones,s=n?.paragraphYOffset??0,l=a?.indent,c$1=l?.left??0,m=l?.right??0,f=(l?.firstLine??0)-(l?.hanging??0),S=Math.max(1,t-c$1-m),T=(l?.hanging??0)===0?ke(e):0,M=Math.max(1,S-f-T),x=0,B=0,F=N(D)*te,w=(g,p)=>{if(!o||o.length===0)return;let b=s+x,d=He(b,g,o,p,U)-b;d>0&&(x+=d,B+=d);};w(F,M);let R=ee(x,F,o,s),C=Math.max(1,Q(R,M)),L=[];if(i.length===0){if(a?.suppressEmptyParagraphHeight)return L.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,ascent:0,descent:0,lineHeight:0}),{kind:"paragraph",lines:L,totalHeight:0};let g=a?.defaultFontSize??D,p=a?.defaultFontFamily??X,b=We(g,r,p);L.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...b});let d=b.lineHeight;return r?.before&&(d+=r.before),r?.after&&(d+=r.after),{kind:"paragraph",lines:L,totalHeight:d}}if(i.length===1&&J(i[0])&&lt(i[0])){let g=i[0],p=g.fontSize??a?.defaultFontSize??D,b=g.fontFamily??a?.defaultFontFamily??X,d=We(p,r,b);L.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...d});let y=d.lineHeight;return r?.before&&(y+=r.before),r?.after&&(y+=r.after),{kind:"paragraph",lines:L,totalHeight:y}}let u={fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,maxFontSize:D,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:C,leftOffset:R.leftMargin,rightOffset:R.rightMargin,segmentZones:R.segments},v=()=>{let g=Ae(u.maxFontSize,r,u.maxFontMetrics),p={...g};if(u.maxImageHeightPx>p.lineHeight){let d=u.maxImageHeightPx,y=p.descent;u.fromRun===u.toRun?(p.lineHeight=d+y*2,p.ascent=d+y):(p.lineHeight=d+y,p.ascent=d);}let b={fromRun:u.fromRun,fromChar:u.fromChar,toRun:u.toRun,toChar:u.toChar,width:u.width,...p};u.leftOffset>0&&(b.leftOffset=u.leftOffset),u.rightOffset>0&&(b.rightOffset=u.rightOffset),u.segmentZones?.length&&(b.segments=Z(b,u.segmentZones)),B>0&&(b.floatSkipBefore=B,B=0),L.push(b),x+=g.lineHeight;},Z=(g,p)=>{let b=p[0],d=p[1];if(!b)return;if(!d||g.width<=b.availableWidth+Y)return [{fromRun:g.fromRun,fromChar:g.fromChar,toRun:g.toRun,toChar:g.toChar,width:g.width,leftOffset:b.leftOffset,availableWidth:b.availableWidth}];if(g.fromRun!==g.toRun)return;let y=i[g.fromRun];if(!y||!J(y))return;let z=y,I=z.text.slice(g.fromChar,g.toChar),H=V(z),k=Ee(I,H,b.availableWidth);if(k<=0||k>=I.length)return;let O=g.fromChar+k,A=I.slice(0,k),ie=I.slice(k);return [{fromRun:g.fromRun,fromChar:g.fromChar,toRun:g.toRun,toChar:O,width:_(A,H),leftOffset:b.leftOffset,availableWidth:b.availableWidth},{fromRun:g.fromRun,fromChar:O,toRun:g.toRun,toChar:g.toChar,width:_(ie,H),leftOffset:d.leftOffset,availableWidth:d.availableWidth}]},W=(g,p)=>{v();let b=N(D)*te;w(b,S);let d=ee(x,b,o,s),y=Math.max(1,Q(d,S));u={fromRun:g,fromChar:p,toRun:g,toChar:p,width:0,maxFontSize:D,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:y,leftOffset:d.leftMargin,rightOffset:d.rightMargin,segmentZones:d.segments};},h=g=>{let p=g.fontSize??D;(!u.maxFontMetrics||p>u.maxFontSize)&&(u.maxFontSize=p,u.maxFontMetrics=K(g));};for(let g=0;g<i.length;g++){let p=i[g];if(ze(p)){u.toRun=g,u.toChar=0,W(g+1,0);continue}if(_e(p)){let b=V(p);h(b);let d=ct(i,g),y=u.width+(u.leftOffset??0),z=L.length===0,I=c$1+(z?f:0)+y,H={explicitStops:a?.tabs,leftIndent:Se(c$1)},k=Ie(I,H,{followingWidth:d}).width;if(y+k>u.availableWidth+Y){let O=u.availableWidth-y-d;O>1&&(k=O);}u.width+k>u.availableWidth+Y&&(W(g,0),h(b)),u.width+=k,u.toRun=g,u.toChar=1;continue}if(Oe(p)){let b=p.wrapType,d=p.displayMode==="float"||c(b);if(p.position&&d){u.toRun=g,u.toChar=1;continue}if(b==="topAndBottom"||p.displayMode==="block"){u.width>0&&W(g,0);let H=p.height,k=p.distTop??6,O=p.distBottom??6;u.toRun=g,u.toChar=1,u.maxImageHeightPx=H+k+O,W(g+1,0);continue}let y=p.width,I=p.height+(p.distTop??0)+(p.distBottom??0);I>u.maxImageHeightPx&&(u.maxImageHeightPx=I),u.width+y>u.availableWidth+Y&&W(g,0),u.width+=y,u.toRun=g,u.toChar=1;continue}if(Ne(p)){let b=p.fallback||"1",d={fontFamily:p.fontFamily??X,fontSize:p.fontSize??D,bold:p.bold,italic:p.italic};h(d);let y=_(b,d);u.width>0&&u.width+y>u.availableWidth+Y&&(W(g,0),h(d)),u.width+=y,u.toRun=g,u.toChar=1;continue}if(J(p)){let b=p,d=b.text,y=V(b);if(h(y),!d||d.length===0){u.toRun=g,u.toChar=0;continue}let z=gt(d),I=0;for(;I<d.length;){let H=d.length;for(let A of z)if(A>I){H=A;break}let k=d.slice(I,H),O=_(k,y);if(O>u.availableWidth+Y){let A=0;for(;A<k.length;){let ie=u.availableWidth-u.width+Y,je=k.slice(A),ae=Ee(je,y,ie);if(ae===0){if(u.width>0){W(g,I+A),h(y);continue}ae=1;}let re=A+ae,Ke=k.slice(A,re),Ve=_(Ke,y);u.width+=Ve,u.toRun=g,u.toChar=I+re,A=re,A<k.length&&(W(g,I+A),h(y));}I=H;continue}u.width>0&&u.width+O>u.availableWidth+Y&&(W(g,I),h(y)),u.width+=O,u.toRun=g,u.toChar=H,I=H;}}}v();let E=L.reduce((g,p)=>g+p.lineHeight+(p.floatSkipBefore??0),0);return r?.before&&(E+=r.before),r?.after&&(E+=r.after),{kind:"paragraph",lines:L,totalHeight:E}}function ln(e,t){return e.map(n=>ft(n,t))}function cn(e){let t=V(e);return ve(e.text,t).charWidths}function mn(e,t){return e.map(n=>{let i=n.x-n.distLeft,a=n.x+n.width+n.distRight,r=n.y-n.distTop,o=n.y+n.height+n.distBottom,s=0,l=0,c,m=n.wrapText??"bothSides";m==="right"?s=Me(a):m==="left"?l=Te(i,t):m==="largest"?{leftMargin:s,rightMargin:l}=ht(i,a,t):pt(i,a,t)?c=dt(i,a,t):n.side==="left"?s=Me(a):l=Te(i,t);let f=De(s,l,t);return {leftMargin:f.leftMargin,rightMargin:f.rightMargin,topY:r,bottomY:o,segments:c}})}function Q(e,t){return e.segments?.reduce((i,a)=>i+a.availableWidth,0)??t-e.leftMargin-e.rightMargin}function ee(e,t,n,i){if(!n||n.length===0)return {leftMargin:0,rightMargin:0};let a=0,r=0,o,s=i+e,l=s+t;for(let c of n)if(!(l<=c.topY||s>=c.bottomY)){if(c.segments?.length){o=o?mt(o,c.segments):c.segments;continue}a=Math.max(a,c.leftMargin),r=Math.max(r,c.rightMargin);}return {leftMargin:a,rightMargin:r,segments:o}}function He(e,t,n,i,a){if(!n||n.length===0)return e;let r=e;for(let o=0;o<n.length+2;o++){let s=ee(r,t,n,0);if(Q(s,i)>=a)return r;let c=r+t,m=1/0;for(let f of n)c<=f.topY||r>=f.bottomY||f.bottomY>r&&f.bottomY<m&&(m=f.bottomY);if(!Number.isFinite(m)||m<=r)return r;r=m;}return r}function mt(e,t){let n=[];for(let i of e)for(let a of t){let r=Math.max(i.leftOffset,a.leftOffset),o=Math.min(i.leftOffset+i.availableWidth,a.leftOffset+a.availableWidth);o>r&&n.push({leftOffset:r,availableWidth:o-r});}return n}var U=24;function pt(e,t,n){return e>U&&t+U<n}function dt(e,t,n){return [{leftOffset:0,availableWidth:Math.max(0,e)},{leftOffset:Math.max(0,t),availableWidth:Math.max(0,n-t)}].filter(i=>i.availableWidth>1)}function ht(e,t,n){let i=Math.max(0,e);return Math.max(0,n-t)>=i?{leftMargin:Me(t),rightMargin:0}:{leftMargin:0,rightMargin:Te(e,n)}}function Me(e){return Math.max(0,e)}function Te(e,t){return Math.max(0,t-e)}var Ye={count:1,gap:0};function bt(e,t,n){return {activeTopMargin:e.top,activeBottomMargin:e.bottom,activeLeftMargin:e.left,activeRightMargin:e.right,pendingTopMargin:null,pendingBottomMargin:null,pendingLeftMargin:null,pendingRightMargin:null,activePageSize:{...t},pendingPageSize:null,activeColumns:n?{...n}:{...Ye},pendingColumns:null,activeOrientation:null,pendingOrientation:null,hasAnyPages:false}}function xt(e,t){return t.count>1}function ne(e){return e?{count:e.count,gap:e.gap}:{...Ye}}function St(e,t,n){let i={...t},a=e.type??"continuous",r=e.margins,o=e.pageSize,s=e.orientation;r&&(typeof r.top=="number"&&(i.pendingTopMargin=Math.max(0,r.top)),typeof r.bottom=="number"&&(i.pendingBottomMargin=Math.max(0,r.bottom)),typeof r.left=="number"&&(i.pendingLeftMargin=Math.max(0,r.left)),typeof r.right=="number"&&(i.pendingRightMargin=Math.max(0,r.right))),o&&(i.pendingPageSize={w:o.w,h:o.h}),s&&(i.pendingOrientation=s);let l=xt((e.margins,void 0),i.activeColumns);switch(a){case "nextPage":return i.pendingColumns=ne(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false},state:i};case "evenPage":return i.pendingColumns=ne(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false,requiredParity:"even"},state:i};case "oddPage":return i.pendingColumns=ne(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false,requiredParity:"odd"},state:i};default:return l?(i.pendingColumns=ne(void 0),{decision:{forcePageBreak:false,forceMidPageRegion:true},state:i}):{decision:{forcePageBreak:false,forceMidPageRegion:false},state:i}}}function Mt(e){let t={...e};return t.pendingTopMargin!==null&&(t.activeTopMargin=t.pendingTopMargin,t.pendingTopMargin=null),t.pendingBottomMargin!==null&&(t.activeBottomMargin=t.pendingBottomMargin,t.pendingBottomMargin=null),t.pendingLeftMargin!==null&&(t.activeLeftMargin=t.pendingLeftMargin,t.pendingLeftMargin=null),t.pendingRightMargin!==null&&(t.activeRightMargin=t.pendingRightMargin,t.pendingRightMargin=null),t.pendingPageSize!==null&&(t.activePageSize=t.pendingPageSize,t.pendingPageSize=null),t.pendingColumns!==null&&(t.activeColumns=t.pendingColumns,t.pendingColumns=null),t.pendingOrientation!==null&&(t.activeOrientation=t.pendingOrientation,t.pendingOrientation=null),t}function Tt(e){return {top:e.pendingTopMargin??e.activeTopMargin,bottom:e.pendingBottomMargin??e.activeBottomMargin,left:e.pendingLeftMargin??e.activeLeftMargin,right:e.pendingRightMargin??e.activeRightMargin}}function yt(e){return e.pendingPageSize??e.activePageSize}function Pt(e){return e.pendingColumns??e.activeColumns}function Ft(e,t){for(let n=0;n<e.pages.length;n++)for(let i of e.pages[n].fragments){if(i.pmStart==null)continue;let a=i.pmStart,r=i.pmEnd??a+1;if(t>=a&&t<r)return n}return null}var Bt={w:816,h:1056},G={top:96,right:96,bottom:96,left:96},Xe={count:1,gap:0};function Ct(e,t,n){let i=[],a=[],r=t;for(let o=0;o<e.length;o++){if(e[o].kind!=="sectionBreak")continue;let s=e[o],l={pageSize:s.pageSize??r.pageSize,margins:s.margins??r.margins,columns:s.columns};i.push(l),a.push(o),r=l;}return i.push(n),{configs:i,breakIndices:a}}function Ge(e){if(e.runs.length===0)return true;if(e.runs.length!==1)return false;let t=e.runs[0];return t.kind==="text"&&(t.text??"")===""}function Ze(e){let t=e.attrs?.spacing?.before??0;return Ge(e)&&!e.attrs?.spacingExplicit?.before?0:t}function Ue(e){let t=e.attrs?.spacing?.after??0;return Ge(e)&&!e.attrs?.spacingExplicit?.after?0:t}function wt(e){for(let t=0;t<e.length-1;t++){let n=e[t],i=e[t+1];if(n.kind!=="paragraph"||i.kind!=="paragraph")continue;let a=n.attrs,r=i.attrs;a?.contextualSpacing&&r?.contextualSpacing&&a.styleId&&a.styleId===r.styleId&&(a.spacing&&(a.spacing={...a.spacing,after:0}),r.spacing&&(r.spacing={...r.spacing,before:0}));}}function yn(e,t,n={}){if(e.length!==t.length)throw new Error(`layoutDocument: expected one measure per block (blocks=${e.length}, measures=${t.length})`);let i=n.pageSize??Bt,a={top:n.margins?.top??G.top,right:n.margins?.right??G.right,bottom:n.margins?.bottom??G.bottom,left:n.margins?.left??G.left,header:n.margins?.header??n.margins?.top??G.top,footer:n.margins?.footer??n.margins?.bottom??G.bottom};n.headerContentHeights,n.footerContentHeights,n.titlePage,n.evenAndOddHeaders;let r={...a},o=n.finalPageSize??i,s=n.finalMargins??r;if(i.w-r.left-r.right<=0)throw new Error("layoutDocument: page size and margins yield no content area");let c={pageSize:i,margins:r,columns:n.columns},m={pageSize:o,margins:s,columns:n.columns},{configs:f,breakIndices:S}=Ct(e,c,m),T=[...S.map(R=>e[R].type),n.bodyBreakType],M=f[0]??c,x=ce({pageSize:M.pageSize,margins:M.margins,columns:M.columns??Xe,footnoteReservedHeights:n.footnoteReservedHeights});wt(e);let B=ge(e),F=me(B),w=0;for(let R=0;R<e.length;R++){let C=e[R],L=t[R];pe(C)&&x.forcePageBreak();let u=B.get(R);if(u&&!F.has(R)){let v=fe(u,e,t),Z=x.getCurrentState(),W=x.getAvailableHeight(),h=Z.contentBottom-Z.topMargin;v<=h&&v>W&&Z.page.fragments.length>0&&x.forcePageBreak();}switch(C.kind){case "paragraph":Lt(C,L,x,x.getContentWidth());break;case "table":C.floating?kt(C,L,x,x.getContentWidth()):It(C,L,x);break;case "image":Et(C,L,x);break;case "textBox":Ht(C,L,x);break;case "pageBreak":x.forcePageBreak();break;case "columnBreak":x.forceColumnBreak();break;case "sectionBreak":{let v=T[w+1]??T[w];At(C,x,f[w+1]??M,v),w++;break}default:c$1(C,"runLayoutPipeline");}}return x.pages.length===0&&x.getCurrentState(),{pageSize:i,pages:x.pages,columns:n.columns,pageGap:n.pageGap}}function Lt(e,t,n,i){if(t.kind!=="paragraph")throw new Error("layoutParagraph: expected paragraph measure");let a=t.lines;if(a.length===0){let l=Ze(e),c=Ue(e),m=n.getCurrentState(),f={kind:"paragraph",blockId:e.id,x:n.getColumnX(m.columnIndex),y:m.cursorY+l,width:i,height:0,fromLine:0,toLine:0,pmStart:e.pmStart,pmEnd:e.pmEnd};n.addFragment(f,0,l,c);return}let r=Ze(e),o=Ue(e),s=0;for(;s<a.length;){let l=n.getCurrentState(),c=n.getAvailableHeight(),m=0,f=0;for(let w=s;w<a.length;w++){let R=a[w].lineHeight+(a[w].floatSkipBefore??0),C=m+R;if((s===0&&w===s?C+r:C)<=c||f===0)m=C,f++;else break}let S=s===0,T=s+f>=a.length,M=S?r:0,x=T?o:0,B={kind:"paragraph",blockId:e.id,x:n.getColumnX(l.columnIndex),y:0,width:i,height:m,fromLine:s,toLine:s+f,pmStart:e.pmStart,pmEnd:e.pmEnd,continuesFromPrev:!S,continuesOnNext:!T},F=n.addFragment(B,m,M,x);B.y=F.y,s+=f,s<a.length&&n.ensureFits(a[s].lineHeight);}}function Rt(e){let t=0;for(let n of e.rows)if(n.isHeader)t++;else break;return t}function vt(e,t){let n=0;for(let i=0;i<t&&i<e.rows.length;i++)n+=e.rows[i].height;return n}function It(e,t,n){if(t.kind!=="table")throw new Error("layoutTable: expected table measure");let i=t.rows;if(i.length===0)return;let a=Rt(e),r=vt(t,a),o=0;for(;o<i.length;){let s=n.getCurrentState(),l=n.getAvailableHeight(),c=o===0,m=c?s.trailingSpacing:0,f=l-m,S=!c&&a>0?r:0,T=0,M=0;for(let C=o;C<i.length;C++){let L=i[C].height;if(T+L+S<=f||M===0)T+=L,M++;else break}let x=T+S,B=o+M>=i.length,F=n.getColumnX(s.columnIndex);e.justification==="center"?F=F+(n.columnWidth-t.totalWidth)/2:e.justification==="right"?F=F+n.columnWidth-t.totalWidth:e.indent&&(F+=e.indent);let w={kind:"table",blockId:e.id,x:F,y:0,width:t.totalWidth,height:x,fromRow:o,toRow:o+M,pmStart:e.pmStart,pmEnd:e.pmEnd,continuesFromPrev:!c,continuesOnNext:!B,headerRowCount:!c&&a>0?a:void 0},R=n.addFragment(w,x,0,0);if(w.y=R.y,w.x=F,o+=M,o<i.length){let C=i[o].height+(a>0?r:0);n.ensureFits(C);}}}function kt(e,t,n,i){if(t.kind!=="table")throw new Error("layoutFloatingTable: expected table measure");let a=n.getCurrentState(),r=e.floating,o=a.page,s=o.margins,l=t.totalWidth,c=t.totalHeight,m=o.size.h-s.top-s.bottom,f=s.left,S=s.top;r?.horzAnchor==="page"&&(f=0),r?.vertAnchor==="page"&&(S=0),r?.vertAnchor==="text"&&(S=a.cursorY);let T=n.getColumnX(a.columnIndex);if(r?.tblpX!==void 0)T=f+r.tblpX;else if(r?.tblpXSpec){let v=r.tblpXSpec;v==="left"||v==="inside"?T=f:v==="right"||v==="outside"?T=f+i-l:v==="center"&&(T=f+(i-l)/2);}else e.justification==="center"?T=f+(i-l)/2:e.justification==="right"&&(T=f+i-l);let M=a.cursorY,x=false;if(r?.tblpY!==void 0)M=S+r.tblpY,x=true;else if(r?.tblpYSpec){x=true;let v=r.tblpYSpec;v==="top"?M=S:v==="bottom"?M=S+m-c:v==="center"&&(M=S+(m-c)/2);}x||(M=n.ensureFits(c).cursorY);let B=s.left,F=s.left+i-l;Number.isFinite(F)&&(T=Math.max(B,Math.min(T,F)));let w={kind:"table",blockId:e.id,x:T,y:M,width:l,height:c,fromRow:0,toRow:e.rows.length,pmStart:e.pmStart,pmEnd:e.pmEnd,isFloating:true};a.page.fragments.push(w);let R=r?.leftFromText??0,C=r?.rightFromText??0,L=T-s.left-R,u=s.left+i-(T+l)-C;if(L<U&&u<U){let v=M+c+(r?.bottomFromText??0);v>a.cursorY&&(a.cursorY=v);}}function Et(e,t,n){if(t.kind!=="image")throw new Error("layoutImage: expected image measure");if(e.anchor?.isAnchored){Wt(e,t,n);return}let i=n.ensureFits(t.height),a={kind:"image",blockId:e.id,x:n.getColumnX(i.columnIndex),y:0,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd},r=n.addFragment(a,t.height,0,0);a.y=r.y;}function Wt(e,t,n){let i=n.getCurrentState(),a=e.anchor,r=a.offsetH??n.getColumnX(i.columnIndex),o=a.offsetV??i.cursorY,s={kind:"image",blockId:e.id,x:r,y:o,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd,isAnchored:true,zIndex:a.behindDoc?-1:1};i.page.fragments.push(s);}function Ht(e,t,n){if(t.kind!=="textBox")throw new Error("layoutTextBox: expected textBox measure");if(q(e)){let o=n.getCurrentState(),s={kind:"textBox",blockId:e.id,x:n.getColumnX(o.columnIndex),y:o.cursorY,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd,isFloating:true,zIndex:e.wrapType==="behind"?-1:1};o.page.fragments.push(s);return}let i=n.ensureFits(t.height),a={kind:"textBox",blockId:e.id,x:n.getColumnX(i.columnIndex),y:0,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd},r=n.addFragment(a,t.height,0,0);a.y=r.y;}function At(e,t,n,i){switch(i??"nextPage"){case "nextPage":t.updatePageLayout(n.pageSize,n.margins),t.forcePageBreak();break;case "evenPage":{t.updatePageLayout(n.pageSize,n.margins),t.forcePageBreak().page.number%2!==0&&t.forcePageBreak();break}case "oddPage":{t.updatePageLayout(n.pageSize,n.margins),t.forcePageBreak().page.number%2===0&&t.forcePageBreak();break}case "continuous":t.updatePageLayout(n.pageSize,n.margins,false);break}t.updateColumns(n.columns??Xe);}export{fe as A,me as B,$e as C,pe as D,q as E,qe as F,bt as G,St as H,Mt as I,Tt as J,yt as K,Pt as L,Ft as M,Ct as N,yn as O,vt as P,he as a,Yt as b,be as c,K as d,_ as e,Zt as f,ve as g,Ut as h,Xt as i,Gt as j,jt as k,N as l,it as m,Kt as n,Vt as o,mn as p,ee as q,Ie as r,st as s,ke as t,De as u,ft as v,ln as w,cn as x,ce as y,ge as z};
@@ -1,2 +1,2 @@
1
- import {d}from'./chunk-HL5PQT3A.mjs';import {i,j,h,l,g,k as k$1,e as e$1}from'./chunk-B6LYBJ4H.mjs';import {e}from'./chunk-VW22RZ6C.mjs';var pe={accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",dk1:"dk1",lt1:"lt1",dk2:"dk2",lt2:"lt2",tx1:"text1",tx2:"text2",bg1:"background1",bg2:"background2",hlink:"hlink",folHlink:"folHlink"},G={black:"000000",white:"FFFFFF",red:"FF0000",green:"00FF00",blue:"0000FF",yellow:"FFFF00",cyan:"00FFFF",magenta:"FF00FF"};function J(e,n){let t=i(n),i$1=t.find(r=>r.name==="a:shade");if(i$1){let r=j(i$1,null,"val");r&&(e.themeShade=Math.round(parseInt(r,10)/1e5*255).toString(16).padStart(2,"0").toUpperCase());}let o=t.find(r=>r.name==="a:tint");if(o){let r=j(o,null,"val");r&&(e.themeTint=Math.round(parseInt(r,10)/1e5*255).toString(16).padStart(2,"0").toUpperCase());}return e}function K(e){if(!e)return;let n=i(e),t=n.find(l=>l.name==="a:srgbClr");if(t){let l=j(t,null,"val");if(l)return J({rgb:l},t)}let i$1=n.find(l=>l.name==="a:schemeClr");if(i$1){let l=j(i$1,null,"val");if(l){let u={themeColor:pe[l]??"dk1"};return J(u,i$1)}}let o=n.find(l=>l.name==="a:sysClr");if(o)return {rgb:j(o,null,"lastClr")??"000000"};let r=n.find(l=>l.name==="a:prstClr");if(r){let l=j(r,null,"val");if(l&&G[l])return {rgb:G[l]}}}function N(e){if(!e)return;let n=i(e);if(n.find(i=>i.name==="a:noFill"))return {type:"none"};let t=n.find(i=>i.name==="a:solidFill");if(t)return {type:"solid",color:K(t)};if(n.find(i=>i.name==="a:gradFill"))return {type:"gradient"}}function S(e){let n=e?h(e,"a:ln"):null;if(!n)return;let t=i(n);if(t.find(u=>u.name==="a:noFill"))return;let i$1={},o=j(n,null,"w");o&&(i$1.width=parseInt(o,10));let r=t.find(u=>u.name==="a:solidFill");r&&(i$1.color=K(r));let l=t.find(u=>u.name==="a:prstDash");if(l){let u=j(l,null,"val");u&&(i$1.style=u);}return i$1}function L(e){if(!e)return;let n=j(e,null,"relativeFrom")??"column",t=h(e,"wp:align");if(t){let o=k$1(t);return {relativeTo:n,alignment:o}}let i=h(e,"wp:posOffset");if(i){let o=k$1(i),r=parseInt(o,10);return {relativeTo:n,posOffset:isNaN(r)?0:r}}return {relativeTo:n}}function z(e){if(!e)return;let n=j(e,null,"relativeFrom")??"paragraph",t=h(e,"wp:align");if(t){let o=k$1(t);return {relativeTo:n,alignment:o}}let i=h(e,"wp:posOffset");if(i){let o=k$1(i),r=parseInt(o,10);return {relativeTo:n,posOffset:isNaN(r)?0:r}}return {relativeTo:n}}function Q(e){let n=h(e,"wp:positionH"),t=h(e,"wp:positionV");if(!(!n&&!t))return {horizontal:L(n)??{relativeTo:"column"},vertical:z(t)??{relativeTo:"paragraph"}}}var W=["wp:wrapNone","wp:wrapSquare","wp:wrapTight","wp:wrapThrough","wp:wrapTopAndBottom"];function D(e,n,t){if(!e){let p={type:n?"behind":"inFront"};return t?.distT!==void 0&&(p.distT=t.distT),t?.distB!==void 0&&(p.distB=t.distB),t?.distL!==void 0&&(p.distL=t.distL),t?.distR!==void 0&&(p.distR=t.distR),p}let o=(e.name||"").replace("wp:",""),r;switch(o){case "wrapNone":r=n?"behind":"inFront";break;case "wrapSquare":r="square";break;case "wrapTight":r="tight";break;case "wrapThrough":r="through";break;case "wrapTopAndBottom":r="topAndBottom";break;default:r="square";}let l$1={type:r},u=j(e,null,"wrapText");u&&(l$1.wrapText=u);let s=l(e,null,"distT")??t?.distT,c=l(e,null,"distB")??t?.distB,m=l(e,null,"distL")??t?.distL,g=l(e,null,"distR")??t?.distR;return s!==void 0&&(l$1.distT=s),c!==void 0&&(l$1.distB=c),m!==void 0&&(l$1.distL=m),g!==void 0&&(l$1.distR=g),l$1}function Y(e){let n=i(e),t=j(e,null,"behindDoc")==="1",i$1=n.find(r=>W.includes(r.name??"")),o={distT:l(e,null,"distT")??void 0,distB:l(e,null,"distB")??void 0,distL:l(e,null,"distL")??void 0,distR:l(e,null,"distR")??void 0};return D(i$1??null,t,o)}var ce={accent1:"5B9BD5",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"4472C4",accent6:"70AD47",dk1:"000000",lt1:"FFFFFF",dk2:"1F497D",lt2:"EEECE1",text1:"000000",text2:"1F497D",background1:"FFFFFF",background2:"EEECE1",hlink:"0563C1",folHlink:"954F72"};function H(e){if(e){if(e.rgb)return `#${e.rgb}`;if(e.themeColor)return `#${ce[e.themeColor]??"000000"}`}}var k=91440;function Z(e){if(!e)return {};let n={},t=l(e,null,"lIns"),i=l(e,null,"rIns"),o=l(e,null,"tIns"),r=l(e,null,"bIns");return (t!==void 0||i!==void 0||o!==void 0||r!==void 0)&&(n.margins={left:t,right:i,top:o,bottom:r}),n}function ve(e){if(!e)return {paragraphElements:[],tableElements:[]};let n=g(e,"p"),t=g(e,"tbl");return {paragraphElements:n,tableElements:t}}function Be(e,n,t,i$1,o,r,l,u){if(!e)return [];let s=[],c=i(e);for(let m of c){let g=m.name||"",p=g.indexOf(":"),T=p>=0?g.substring(p+1):g;if(T==="p"){let b=n(m,i$1,o,r,l);s.push(b);}}return s}function ee(e){let t=i(e).find(u=>u.name==="wp:inline"||u.name==="wp:anchor");if(!t)return false;let i$1=h(t,"a:graphic");if(!i$1)return false;let o=h(i$1,"a:graphicData");if(!o)return false;let r=h(o,"wps:wsp");return r?h(r,"wps:txbx")!==null:false}function Ce(e){return h(e,"wps:txbx")!==null}function Me(e){let t=i(e).find(x=>x.name==="wp:inline"||x.name==="wp:anchor");if(!t)return null;let i$1=t.name==="wp:anchor",o=h(t,"a:graphic");if(!o)return null;let r=h(o,"a:graphicData");if(!r)return null;let l$1=h(r,"wps:wsp");if(!l$1||!h(l$1,"wps:txbx"))return null;let s=i(l$1),c=s.find(x=>x.name==="wps:spPr"),m=s.find(x=>x.name==="wps:bodyPr"),g=h(t,"wp:extent"),p=l(g,null,"cx")??0,T=l(g,null,"cy")??0,b={width:p,height:T},C=h(t,"wp:docPr"),P=C?j(C,null,"id")??void 0:void 0,v=N(c??null),B=S(c??null),E=Z(m??null),y={type:"textBox",size:b,content:[]};if(P&&(y.id=P),v&&(y.fill=v),B&&(y.outline=B),E.margins&&(y.margins=E.margins),i$1){let x=Q(t);x&&(y.position=x);let h=Y(t);h&&(y.wrap=h);}return y}function Re(e){let n=h(e,"wps:txbx");return n?h(n,"w:txbxContent"):null}function Xe(e,n,t,i$1){if(!h(e,"wps:txbx"))return null;let r=i(e),l=r.find(b=>b.name==="wps:spPr"),u=r.find(b=>b.name==="wps:bodyPr"),s=r.find(b=>b.name==="wps:cNvPr"),c=s?j(s,null,"id")??void 0:void 0,m=N(l??null),g=S(l??null),p=Z(u??null),T={type:"textBox",size:n,content:[]};return c&&(T.id=c),m&&(T.fill=m),g&&(T.outline=g),p.margins&&(T.margins=p.margins),t&&(T.position=t),i$1&&(T.wrap=i$1),T}function ke(e$1){return e(e$1.size.width)}function Ae(e$1){return e(e$1.size.height)}function Oe(e$1){return {width:e(e$1.size.width),height:e(e$1.size.height)}}function Ne(e$1){let n=e$1.margins;return {top:e(n?.top??k),bottom:e(n?.bottom??k),left:e(n?.left??k),right:e(n?.right??k)}}function Se(e){return e.position!==void 0||e.wrap!==void 0}function Le(e){return e.fill!==void 0&&e.fill.type!=="none"}function ze(e){return e.outline!==void 0}function We(e){return e.content.length>0}function De(e){let n=[];for(let t of e.content){let i=[];for(let o of t.content)if(o.type==="run")for(let r of o.content)r.type==="text"&&i.push(r.text);n.push(i.join(""));}return n.join(`
1
+ import {d}from'./chunk-OEXVWIHW.mjs';import {i,j,h,l,g,k as k$1,e as e$1}from'./chunk-WLHNIXWC.mjs';import {e}from'./chunk-VW22RZ6C.mjs';var pe={accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",dk1:"dk1",lt1:"lt1",dk2:"dk2",lt2:"lt2",tx1:"text1",tx2:"text2",bg1:"background1",bg2:"background2",hlink:"hlink",folHlink:"folHlink"},G={black:"000000",white:"FFFFFF",red:"FF0000",green:"00FF00",blue:"0000FF",yellow:"FFFF00",cyan:"00FFFF",magenta:"FF00FF"};function J(e,n){let t=i(n),i$1=t.find(r=>r.name==="a:shade");if(i$1){let r=j(i$1,null,"val");r&&(e.themeShade=Math.round(parseInt(r,10)/1e5*255).toString(16).padStart(2,"0").toUpperCase());}let o=t.find(r=>r.name==="a:tint");if(o){let r=j(o,null,"val");r&&(e.themeTint=Math.round(parseInt(r,10)/1e5*255).toString(16).padStart(2,"0").toUpperCase());}return e}function K(e){if(!e)return;let n=i(e),t=n.find(l=>l.name==="a:srgbClr");if(t){let l=j(t,null,"val");if(l)return J({rgb:l},t)}let i$1=n.find(l=>l.name==="a:schemeClr");if(i$1){let l=j(i$1,null,"val");if(l){let u={themeColor:pe[l]??"dk1"};return J(u,i$1)}}let o=n.find(l=>l.name==="a:sysClr");if(o)return {rgb:j(o,null,"lastClr")??"000000"};let r=n.find(l=>l.name==="a:prstClr");if(r){let l=j(r,null,"val");if(l&&G[l])return {rgb:G[l]}}}function N(e){if(!e)return;let n=i(e);if(n.find(i=>i.name==="a:noFill"))return {type:"none"};let t=n.find(i=>i.name==="a:solidFill");if(t)return {type:"solid",color:K(t)};if(n.find(i=>i.name==="a:gradFill"))return {type:"gradient"}}function S(e){let n=e?h(e,"a:ln"):null;if(!n)return;let t=i(n);if(t.find(u=>u.name==="a:noFill"))return;let i$1={},o=j(n,null,"w");o&&(i$1.width=parseInt(o,10));let r=t.find(u=>u.name==="a:solidFill");r&&(i$1.color=K(r));let l=t.find(u=>u.name==="a:prstDash");if(l){let u=j(l,null,"val");u&&(i$1.style=u);}return i$1}function L(e){if(!e)return;let n=j(e,null,"relativeFrom")??"column",t=h(e,"wp:align");if(t){let o=k$1(t);return {relativeTo:n,alignment:o}}let i=h(e,"wp:posOffset");if(i){let o=k$1(i),r=parseInt(o,10);return {relativeTo:n,posOffset:isNaN(r)?0:r}}return {relativeTo:n}}function z(e){if(!e)return;let n=j(e,null,"relativeFrom")??"paragraph",t=h(e,"wp:align");if(t){let o=k$1(t);return {relativeTo:n,alignment:o}}let i=h(e,"wp:posOffset");if(i){let o=k$1(i),r=parseInt(o,10);return {relativeTo:n,posOffset:isNaN(r)?0:r}}return {relativeTo:n}}function Q(e){let n=h(e,"wp:positionH"),t=h(e,"wp:positionV");if(!(!n&&!t))return {horizontal:L(n)??{relativeTo:"column"},vertical:z(t)??{relativeTo:"paragraph"}}}var W=["wp:wrapNone","wp:wrapSquare","wp:wrapTight","wp:wrapThrough","wp:wrapTopAndBottom"];function D(e,n,t){if(!e){let p={type:n?"behind":"inFront"};return t?.distT!==void 0&&(p.distT=t.distT),t?.distB!==void 0&&(p.distB=t.distB),t?.distL!==void 0&&(p.distL=t.distL),t?.distR!==void 0&&(p.distR=t.distR),p}let o=(e.name||"").replace("wp:",""),r;switch(o){case "wrapNone":r=n?"behind":"inFront";break;case "wrapSquare":r="square";break;case "wrapTight":r="tight";break;case "wrapThrough":r="through";break;case "wrapTopAndBottom":r="topAndBottom";break;default:r="square";}let l$1={type:r},u=j(e,null,"wrapText");u&&(l$1.wrapText=u);let s=l(e,null,"distT")??t?.distT,c=l(e,null,"distB")??t?.distB,m=l(e,null,"distL")??t?.distL,g=l(e,null,"distR")??t?.distR;return s!==void 0&&(l$1.distT=s),c!==void 0&&(l$1.distB=c),m!==void 0&&(l$1.distL=m),g!==void 0&&(l$1.distR=g),l$1}function Y(e){let n=i(e),t=j(e,null,"behindDoc")==="1",i$1=n.find(r=>W.includes(r.name??"")),o={distT:l(e,null,"distT")??void 0,distB:l(e,null,"distB")??void 0,distL:l(e,null,"distL")??void 0,distR:l(e,null,"distR")??void 0};return D(i$1??null,t,o)}var ce={accent1:"5B9BD5",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"4472C4",accent6:"70AD47",dk1:"000000",lt1:"FFFFFF",dk2:"1F497D",lt2:"EEECE1",text1:"000000",text2:"1F497D",background1:"FFFFFF",background2:"EEECE1",hlink:"0563C1",folHlink:"954F72"};function H(e){if(e){if(e.rgb)return `#${e.rgb}`;if(e.themeColor)return `#${ce[e.themeColor]??"000000"}`}}var k=91440;function Z(e){if(!e)return {};let n={},t=l(e,null,"lIns"),i=l(e,null,"rIns"),o=l(e,null,"tIns"),r=l(e,null,"bIns");return (t!==void 0||i!==void 0||o!==void 0||r!==void 0)&&(n.margins={left:t,right:i,top:o,bottom:r}),n}function ve(e){if(!e)return {paragraphElements:[],tableElements:[]};let n=g(e,"p"),t=g(e,"tbl");return {paragraphElements:n,tableElements:t}}function Be(e,n,t,i$1,o,r,l,u){if(!e)return [];let s=[],c=i(e);for(let m of c){let g=m.name||"",p=g.indexOf(":"),T=p>=0?g.substring(p+1):g;if(T==="p"){let b=n(m,i$1,o,r,l);s.push(b);}}return s}function ee(e){let t=i(e).find(u=>u.name==="wp:inline"||u.name==="wp:anchor");if(!t)return false;let i$1=h(t,"a:graphic");if(!i$1)return false;let o=h(i$1,"a:graphicData");if(!o)return false;let r=h(o,"wps:wsp");return r?h(r,"wps:txbx")!==null:false}function Ce(e){return h(e,"wps:txbx")!==null}function Me(e){let t=i(e).find(x=>x.name==="wp:inline"||x.name==="wp:anchor");if(!t)return null;let i$1=t.name==="wp:anchor",o=h(t,"a:graphic");if(!o)return null;let r=h(o,"a:graphicData");if(!r)return null;let l$1=h(r,"wps:wsp");if(!l$1||!h(l$1,"wps:txbx"))return null;let s=i(l$1),c=s.find(x=>x.name==="wps:spPr"),m=s.find(x=>x.name==="wps:bodyPr"),g=h(t,"wp:extent"),p=l(g,null,"cx")??0,T=l(g,null,"cy")??0,b={width:p,height:T},C=h(t,"wp:docPr"),P=C?j(C,null,"id")??void 0:void 0,v=N(c??null),B=S(c??null),E=Z(m??null),y={type:"textBox",size:b,content:[]};if(P&&(y.id=P),v&&(y.fill=v),B&&(y.outline=B),E.margins&&(y.margins=E.margins),i$1){let x=Q(t);x&&(y.position=x);let h=Y(t);h&&(y.wrap=h);}return y}function Re(e){let n=h(e,"wps:txbx");return n?h(n,"w:txbxContent"):null}function Xe(e,n,t,i$1){if(!h(e,"wps:txbx"))return null;let r=i(e),l=r.find(b=>b.name==="wps:spPr"),u=r.find(b=>b.name==="wps:bodyPr"),s=r.find(b=>b.name==="wps:cNvPr"),c=s?j(s,null,"id")??void 0:void 0,m=N(l??null),g=S(l??null),p=Z(u??null),T={type:"textBox",size:n,content:[]};return c&&(T.id=c),m&&(T.fill=m),g&&(T.outline=g),p.margins&&(T.margins=p.margins),t&&(T.position=t),i$1&&(T.wrap=i$1),T}function ke(e$1){return e(e$1.size.width)}function Ae(e$1){return e(e$1.size.height)}function Oe(e$1){return {width:e(e$1.size.width),height:e(e$1.size.height)}}function Ne(e$1){let n=e$1.margins;return {top:e(n?.top??k),bottom:e(n?.bottom??k),left:e(n?.left??k),right:e(n?.right??k)}}function Se(e){return e.position!==void 0||e.wrap!==void 0}function Le(e){return e.fill!==void 0&&e.fill.type!=="none"}function ze(e){return e.outline!==void 0}function We(e){return e.content.length>0}function De(e){let n=[];for(let t of e.content){let i=[];for(let o of t.content)if(o.type==="run")for(let r of o.content)r.type==="text"&&i.push(r.text);n.push(i.join(""));}return n.join(`
2
2
  `)}function He(e){if(!(!e.fill||e.fill.type!=="solid"))return H(e.fill.color)}function Ve(e){if(e.outline?.color)return H(e.outline.color)}function _e(e$1){return e$1.outline?.width?e(e$1.outline.width):0}function me(e){if(!e)return;let n=parseInt(e,10);if(!isNaN(n))return n/6e4}function ge(e,n){let t=i(e);for(let i of t)if(n.includes(i.name||""))return i;return null}function ne(e){if(!e)return {width:0,height:0};let n=l(e,null,"cx")??0,t=l(e,null,"cy")??0;return {width:n,height:t}}function te(e){if(!e)return;let n=l(e,null,"l")??0,t=l(e,null,"t")??0,i=l(e,null,"r")??0,o=l(e,null,"b")??0;if(!(n===0&&t===0&&i===0&&o===0))return {left:n,top:t,right:i,bottom:o}}function ie(e){if(!e)return {};let n=j(e,null,"id")??void 0,t=j(e,null,"name")??void 0,i=j(e,null,"descr")??void 0,o=j(e,null,"title")??void 0,r=j(e,null,"decorative")==="1",l=e$1(e,"a","hlinkClick"),u=l?j(l,"r","id")??void 0:void 0;return {id:n,name:t,alt:i,title:o,decorative:r||void 0,hlinkRId:u}}function re(e){if(!e)return;let n=j(e,null,"rot"),t=j(e,null,"flipH")==="1",i=j(e,null,"flipV")==="1",o=me(n);if(o===void 0&&!t&&!i)return;let r={};return o!==void 0&&(r.rotation=o),t&&(r.flipH=true),i&&(r.flipV=true),r}function oe(e){let n=h(e,"a:graphic");if(!n)return {blipFill:null,blip:null};let t=h(n,"a:graphicData");if(!t)return {blipFill:null,blip:null};let i=h(t,"pic:pic");if(!i)return {blipFill:null,blip:null};let o=h(i,"pic:blipFill");return o?{blipFill:o,blip:h(o,"a:blip")}:{blipFill:null,blip:null}}function le(e){if(!e)return;let n=h(e,"a:srcRect");if(!n)return;let t=s=>{let c=l(n,null,s);if(!(c===void 0||c===0))return c/1e5},i=t("l"),o=t("t"),r=t("r"),l$1=t("b");if(i===void 0&&o===void 0&&r===void 0&&l$1===void 0)return;let u={};return i!==void 0&&(u.left=i),o!==void 0&&(u.top=o),r!==void 0&&(u.right=r),l$1!==void 0&&(u.bottom=l$1),u}function ae(e){if(!e)return;let n=h(e,"a:alphaModFix");if(!n)return;let t=l(n,null,"amt");if(!(t===void 0||t>=1e5))return Math.max(0,Math.min(1,t/1e5))}function se(e){if(!e)return "";let n=j(e,"r","embed");if(n)return n;let t=j(e,null,"embed");if(t)return t;let i=j(e,"r","link");return i||""}function ue(e){let n=h(e,"a:graphic");if(!n)return null;let t=h(n,"a:graphicData");if(!t)return null;let i=h(t,"pic:pic");if(!i)return null;let o=h(i,"pic:spPr");return o?h(o,"a:xfrm"):null}function xe(e){if(!e)return e;let n=e.replace(/^\/+/,"");return n.startsWith("media/")?n=`word/${n}`:n.startsWith("word/")||(n=`word/${n}`),n}function he(e){let n=e.split(".").pop()?.toLowerCase()??"";return {png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",tiff:"image/tiff",tif:"image/tiff",webp:"image/webp",svg:"image/svg+xml",emf:"image/x-emf",wmf:"image/x-wmf"}[n]??"application/octet-stream"}function de(e,n,t){if(!e||!n)return {};let i=n.get(e);if(!i)return {};let o=i.target;if(!o)return {};let r=xe(o),l=o.split("/").pop(),u=(s,c)=>{let m=c.toLowerCase();for(let[g,p]of s.entries())if(g.toLowerCase()===m)return p};if(t){let s=u(t,r);if(s)return {src:s.dataUrl||s.base64,mimeType:s.mimeType,filename:l};let c=o.replace(/^\/+/,""),m=u(t,c);if(m)return {src:m.dataUrl||m.base64,mimeType:m.mimeType,filename:l};let g=`word/${c}`,p=u(t,g);if(p)return {src:p.dataUrl||p.base64,mimeType:p.mimeType,filename:l}}return {mimeType:he(o),filename:l}}function Te(e,n,t){let i=h(e,"wp:extent"),o=ne(i),r=h(e,"wp:effectExtent"),l$1=te(r),u=h(e,"wp:docPr"),s=ie(u),{blip:c,blipFill:m}=oe(e),g=se(c),p=le(m),T=ae(c),b=de(g,n,t),C=ue(e),P=re(C),v=l(e,null,"distT")??void 0,B=l(e,null,"distB")??void 0,E=l(e,null,"distL")??void 0,y=l(e,null,"distR")??void 0,x={type:"inline"};v!==void 0&&(x.distT=v),B!==void 0&&(x.distB=B),E!==void 0&&(x.distL=E),y!==void 0&&(x.distR=y);let h$1={type:"image",rId:g,size:o,wrap:x};if(s.id&&(h$1.id=s.id),s.alt&&(h$1.alt=s.alt),s.title&&(h$1.title=s.title),s.decorative&&(h$1.decorative=true),b.src&&(h$1.src=b.src),b.mimeType&&(h$1.mimeType=b.mimeType),b.filename&&(h$1.filename=b.filename),l$1&&(h$1.padding=l$1),P&&(h$1.transform=P),p&&(h$1.crop=p),T!==void 0&&(h$1.opacity=T),s.hlinkRId&&n){let X=d(n,s.hlinkRId);X&&(h$1.hlinkHref=X);}return h$1}function be(e,n,t){let i=h(e,"wp:extent"),o=ne(i),r=h(e,"wp:effectExtent"),l$1=te(r),u=h(e,"wp:docPr"),s=ie(u),c=j(e,null,"behindDoc")==="1",m=j(e,null,"layoutInCell"),g=m===null?void 0:m==="1",p=j(e,null,"allowOverlap"),T=p===null?void 0:p==="1",b={distT:l(e,null,"distT")??void 0,distB:l(e,null,"distB")??void 0,distL:l(e,null,"distL")??void 0,distR:l(e,null,"distR")??void 0},C=ge(e,W),P=D(C,c,b),v=h(e,"wp:positionH"),B=h(e,"wp:positionV"),E=L(v),y=z(B),x;(E||y)&&(x={horizontal:E??{relativeTo:"column"},vertical:y??{relativeTo:"paragraph"}});let{blip:h$1,blipFill:X}=oe(e),V=se(h$1),_=le(X),U=ae(h$1),M=de(V,n,t),fe=ue(e),j$1=re(fe),I={type:"image",rId:V,size:o,wrap:P};if(s.id&&(I.id=s.id),s.alt&&(I.alt=s.alt),s.title&&(I.title=s.title),s.decorative&&(I.decorative=true),M.src&&(I.src=M.src),M.mimeType&&(I.mimeType=M.mimeType),M.filename&&(I.filename=M.filename),x&&(I.position=x),l$1&&(I.padding=l$1),j$1&&(I.transform=j$1),_&&(I.crop=_),U!==void 0&&(I.opacity=U),g!==void 0&&(I.layoutInCell=g),T!==void 0&&(I.allowOverlap=T),s.hlinkRId&&n){let q=d(n,s.hlinkRId);q&&(I.hlinkHref=q);}return I}function we(e,n,t){if(ee(e))return null;let i$1=i(e);for(let o of i$1){let r=o.name||"";if(r==="wp:inline"||r==="wp:anchor")return r==="wp:inline"?Te(o,n,t):be(o,n,t)}return null}function Qe(e,n,t){return we(e,n,t)}function Ye(e){return e.wrap.type==="inline"}function Ze(e){return e.wrap.type!=="inline"}function en(e){return e.wrap.type==="behind"}function nn(e){return e.wrap.type==="inFront"}function tn(e$1){return e(e$1.size.width)}function rn(e$1){return e(e$1.size.height)}function on(e){return e.decorative===true}function ln(e$1){return {top:e(e$1.wrap.distT),bottom:e(e$1.wrap.distB),left:e(e$1.wrap.distL),right:e(e$1.wrap.distR)}}export{Ye as A,Ze as B,en as C,nn as D,tn as E,rn as F,on as G,ln as H,K as a,N as b,Q as c,Y as d,H as e,ve as f,Be as g,ee as h,Ce as i,Me as j,Re as k,Xe as l,ke as m,Ae as n,Oe as o,Ne as p,Se as q,Le as r,ze as s,We as t,De as u,He as v,Ve as w,_e as x,we as y,Qe as z};
@@ -1,4 +1,4 @@
1
- import {b}from'./chunk-ARHPXIBJ.mjs';import {b as b$1,f as f$1}from'./chunk-CGJ6S3AH.mjs';import {f}from'./chunk-2IE6UDHJ.mjs';function M(o){return typeof o=="object"&&o!==null&&("_def"in o||"parse"in o||"safeParse"in o)}function v(o,i){let s=i,{position:n,variableName:t}=s,e=JSON.parse(JSON.stringify(o)),a=e.package.document.content.filter(m=>m.type==="paragraph");if(n.paragraphIndex>=a.length)throw new Error(`Paragraph index ${n.paragraphIndex} out of bounds`);let l=a[n.paragraphIndex],p=`{${t}}`;return C(l,n.offset,p),e.templateVariables||(e.templateVariables=[]),e.templateVariables.includes(t)||e.templateVariables.push(t),e}function w(o,i){let s=i,{range:n,variableName:t}=s,e=JSON.parse(JSON.stringify(o)),a=e.package.document.content.filter(m=>m.type==="paragraph");if(n.start.paragraphIndex!==n.end.paragraphIndex)throw new Error("Template variable replacement cannot span multiple paragraphs");if(n.start.paragraphIndex>=a.length)throw new Error(`Paragraph index ${n.start.paragraphIndex} out of bounds`);let l=a[n.start.paragraphIndex];I(l,n.start.offset,n.end.offset);let p=`{${t}}`;return C(l,n.start.offset,p),e.templateVariables||(e.templateVariables=[]),e.templateVariables.includes(t)||e.templateVariables.push(t),e}function C(o,i,s){let n=0,t=false;for(let e=0;e<o.content.length;e++){let r=o.content[e];if(r.type==="run"){let a=g(r),l=n,p=n+a.length;if(!t&&i>=l&&i<=p){let m=i-l,f=a.slice(0,m),x=a.slice(m),d=[];for(let c=0;c<e;c++)d.push(o.content[c]);f&&d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:f}]}),d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:s}]}),x&&d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:x}]});for(let c=e+1;c<o.content.length;c++)d.push(o.content[c]);o.content=d,t=true;break}n=p;}else if(r.type==="hyperlink")for(let a of r.children)a.type==="run"&&(n+=g(a).length);}t||o.content.push({type:"run",content:[{type:"text",text:s}]});}function I(o,i,s){let n=[],t=0;for(let e of o.content)if(e.type==="run"){let r=g(e),a=t,l=t+r.length;if(l<=i||a>=s)n.push(e);else {let p="";a<i&&(p+=r.slice(0,i-a)),l>s&&(p+=r.slice(s-a)),p.length>0&&n.push({type:"run",formatting:e.formatting,content:[{type:"text",text:p}]});}t=l;}else n.push(e);o.content=n;}function g(o){return o.content.filter(i=>i.type==="text").map(i=>i.text).join("")}var u={type:"string",description:"Document ID from a previous docx_load call"},D={type:"object",properties:{paragraphIndex:{type:"number",description:"Index of the paragraph (0-indexed)"},offset:{type:"number",description:"Character offset within the paragraph"}},required:["paragraphIndex","offset"]},V={name:"docx_get_variables",description:`List all template variables ({name} format) found in the document.
1
+ import {b}from'./chunk-ARHPXIBJ.mjs';import {b as b$1,f as f$1}from'./chunk-CGJ6S3AH.mjs';import {f}from'./chunk-44JKHPGF.mjs';function M(o){return typeof o=="object"&&o!==null&&("_def"in o||"parse"in o||"safeParse"in o)}function v(o,i){let s=i,{position:n,variableName:t}=s,e=JSON.parse(JSON.stringify(o)),a=e.package.document.content.filter(m=>m.type==="paragraph");if(n.paragraphIndex>=a.length)throw new Error(`Paragraph index ${n.paragraphIndex} out of bounds`);let l=a[n.paragraphIndex],p=`{${t}}`;return C(l,n.offset,p),e.templateVariables||(e.templateVariables=[]),e.templateVariables.includes(t)||e.templateVariables.push(t),e}function w(o,i){let s=i,{range:n,variableName:t}=s,e=JSON.parse(JSON.stringify(o)),a=e.package.document.content.filter(m=>m.type==="paragraph");if(n.start.paragraphIndex!==n.end.paragraphIndex)throw new Error("Template variable replacement cannot span multiple paragraphs");if(n.start.paragraphIndex>=a.length)throw new Error(`Paragraph index ${n.start.paragraphIndex} out of bounds`);let l=a[n.start.paragraphIndex];I(l,n.start.offset,n.end.offset);let p=`{${t}}`;return C(l,n.start.offset,p),e.templateVariables||(e.templateVariables=[]),e.templateVariables.includes(t)||e.templateVariables.push(t),e}function C(o,i,s){let n=0,t=false;for(let e=0;e<o.content.length;e++){let r=o.content[e];if(r.type==="run"){let a=g(r),l=n,p=n+a.length;if(!t&&i>=l&&i<=p){let m=i-l,f=a.slice(0,m),x=a.slice(m),d=[];for(let c=0;c<e;c++)d.push(o.content[c]);f&&d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:f}]}),d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:s}]}),x&&d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:x}]});for(let c=e+1;c<o.content.length;c++)d.push(o.content[c]);o.content=d,t=true;break}n=p;}else if(r.type==="hyperlink")for(let a of r.children)a.type==="run"&&(n+=g(a).length);}t||o.content.push({type:"run",content:[{type:"text",text:s}]});}function I(o,i,s){let n=[],t=0;for(let e of o.content)if(e.type==="run"){let r=g(e),a=t,l=t+r.length;if(l<=i||a>=s)n.push(e);else {let p="";a<i&&(p+=r.slice(0,i-a)),l>s&&(p+=r.slice(s-a)),p.length>0&&n.push({type:"run",formatting:e.formatting,content:[{type:"text",text:p}]});}t=l;}else n.push(e);o.content=n;}function g(o){return o.content.filter(i=>i.type==="text").map(i=>i.text).join("")}var u={type:"string",description:"Document ID from a previous docx_load call"},D={type:"object",properties:{paragraphIndex:{type:"number",description:"Index of the paragraph (0-indexed)"},offset:{type:"number",description:"Character offset within the paragraph"}},required:["paragraphIndex","offset"]},V={name:"docx_get_variables",description:`List all template variables ({name} format) found in the document.
2
2
  Returns variable names without braces, along with their locations (body, headers, footers, etc.).
3
3
  Use this to discover what data fields a template document expects.`,inputSchema:{type:"object",properties:{documentId:u},required:["documentId"]},handler:async(o,i)=>{let{documentId:s}=o,n=i.session.documents.get(s);if(!n)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};try{let t=b(n.document);return {content:[{type:"text",text:JSON.stringify({variables:t.variables,count:t.variables.length,totalOccurrences:t.totalOccurrences,byLocation:t.byLocation},null,2)}]}}catch(t){return {isError:true,content:[{type:"text",text:`Failed to detect variables: ${t.message}`}]}}},annotations:{category:"template",readOnly:true,complexity:"low",examples:[{description:"Get all variables from a loaded document",input:{documentId:"doc_123"},output:'{"variables": ["customer_name", "invoice_date"], "count": 2}'}]}},R={name:"docx_insert_variable",description:`Insert a template variable placeholder ({name}) at a specific position in the document.
4
4
  The variable can later be substituted with actual values using docx_apply_template.
@@ -0,0 +1 @@
1
+ 'use strict';var prosemirrorState=require('prosemirror-state');var i={Highest:0,High:50,Default:100,Low:150,Lowest:200};function u(n){return e=>{let t={...n.defaultOptions,...e};return {type:"extension",config:{name:n.name,priority:n.priority??i.Default,options:t},onSchemaReady(o){return n.onSchemaReady(o,t)}}}}function d(n){return e=>{let t={...n.defaultOptions,...e},o=typeof n.nodeSpec=="function"?n.nodeSpec(t):n.nodeSpec;return {type:"node",config:{name:n.name,priority:n.priority??i.Default,options:t,schemaNodeName:n.schemaNodeName,nodeSpec:o},onSchemaReady(r){return n.onSchemaReady?.(r,t)??{}}}}}function g(n){return e=>{let t={...n.defaultOptions,...e},o=typeof n.markSpec=="function"?n.markSpec(t):n.markSpec;return {type:"mark",config:{name:n.name,priority:n.priority??i.Default,options:t,schemaMarkName:n.schemaMarkName,markSpec:o},onSchemaReady(r){return n.onSchemaReady?.(r,t)??{}}}}}var s=new prosemirrorState.PluginKey("suggestionMode"),S="suggestionModeApplied",f="suggestionModeBypass";var p=Date.now();function x(){return p++}function M(n){let e=s.getState(n);return e?.active?{revisionId:x(),author:e.author,date:new Date().toISOString()}:null}exports.a=i;exports.b=u;exports.c=d;exports.d=g;exports.e=s;exports.f=S;exports.g=f;exports.h=x;exports.i=M;
@@ -0,0 +1,15 @@
1
+ var l=new Set,d=new Map,y=new Set,f=new Map,w=new Set,p=new Set,u=false;function m(t,n){let e=t instanceof Error?t.message:String(t),o=new Error(`[font] ${n}: ${e}`,{cause:t});if(p.size>0)for(let i of p)try{i(o);}catch(a){console.error("Font error subscriber threw:",a);}else console.warn(o.message);}function x(t,n="normal"){return `${t.trim()}|${n}`}function P(t,n=[400,700],e=["normal","italic"]){let o=encodeURIComponent(t),i=[];for(let s of e){let r=s==="italic"?1:0;for(let c of n)i.push(`${r},${c}`);}i.sort();let a=i.join(";");return `https://fonts.googleapis.com/css2?family=${o}:ital,wght@${a}&display=swap`}async function h(t,n){if(typeof document>"u")return false;let e=t.trim();if(l.has(e))return true;let o=d.get(e);if(o)return o;let i=(async()=>{u=true;try{let a=P(e,n?.weights,n?.styles),s=document.createElement("link");return s.rel="stylesheet",s.href=a,await new Promise(c=>{s.onload=()=>c(!0),s.onerror=()=>c(!1),document.head.appendChild(s),setTimeout(()=>c(!1),5e3);})?(await b(e,3e3),l.add(e),F([e]),!0):!1}catch(a){return m(a,`failed to load "${e}"`),false}finally{d.delete(e),d.size===0&&f.size===0&&(u=false);}})();return d.set(e,i),i}async function A(t,n){let e=t.filter(o=>!l.has(o.trim()));e.length!==0&&await Promise.all(e.map(o=>h(o,n)));}function T(t){return l.has(t.trim())}function z(){return u}function G(){return Array.from(l)}function U(t){return w.add(t),()=>{w.delete(t);}}function F(t){for(let n of w)try{n(t);}catch(e){m(e,"load callback threw");}}function I(t){return p.add(t),()=>{p.delete(t);}}async function b(t,n){if("fonts"in document)try{let e=`400 16px "${t}"`;return await Promise.race([document.fonts.load(e),new Promise(o=>setTimeout(o,n))]),document.fonts.check(e)}catch{}return await new Promise(e=>setTimeout(e,100)),true}function M(t,n="sans-serif"){if(typeof document>"u")return false;let e=(i,a)=>{let r=document.createElement("canvas").getContext("2d");if(!r)return false;r.textBaseline="top";let c="abcdefghijklmnopqrstuvwxyz0123456789";r.font=`72px ${a}`;let g=r.measureText(c).width;return r.font=`72px "${i}", ${a}`,r.measureText(c).width!==g};return e(t,n)?true:e(t,n==="sans-serif"?"serif":"sans-serif")}async function R(t,n,e){if(typeof document>"u")return false;let o=t.trim(),i=x(o,e?.weight);if(y.has(i))return true;let a=f.get(i);if(a)return a;let s=(async()=>{u=true;try{let r=new Blob([n],{type:"font/ttf"}),c=URL.createObjectURL(r),g=document.createElement("style");return g.textContent=`
2
+ @font-face {
3
+ font-family: "${o}";
4
+ src: url(${c}) format('truetype');
5
+ font-weight: ${e?.weight??"normal"};
6
+ font-display: swap;
7
+ }
8
+ `,document.head.appendChild(g),await b(o,3e3),y.add(i),l.add(o),F([o]),!0}catch(r){return m(r,`failed to load "${o}" from buffer`),false}finally{f.delete(i),d.size===0&&f.size===0&&(u=false);}})();return f.set(i,s),s}function C(t){let n=t.split("?")[0].split("#")[0].toLowerCase();return n.endsWith(".woff2")?"woff2":n.endsWith(".woff")?"woff":n.endsWith(".otf")?"opentype":"truetype"}async function $(t,n,e){if(typeof document>"u")return false;if(/[<>]/.test(n))return m(new Error(`invalid src URL for "${t}": contains '<' or '>'`),"rejected src"),false;let o=t.trim(),i=x(o,e?.weight);if(y.has(i))return true;let a=f.get(i);if(a)return a;let s=(async()=>{u=true;try{let r=document.createElement("style");return r.textContent=`
9
+ @font-face {
10
+ font-family: "${o}";
11
+ src: url(${JSON.stringify(n)}) format('${C(n)}');
12
+ font-weight: ${e?.weight??"normal"};
13
+ font-display: swap;
14
+ }
15
+ `,document.head.appendChild(r),await b(o,3e3),y.add(i),l.add(o),F([o]),!0}catch(r){return m(r,`failed to load "${o}" from ${n}`),false}finally{f.delete(i),d.size===0&&f.size===0&&(u=false);}})();return f.set(i,s),s}async function D(t){!t||t.length===0||await Promise.all(t.map(n=>$(n.family,n.src,{weight:n.weight})));}var k={Calibri:"Carlito",Cambria:"Caladea",Arial:"Arimo","Times New Roman":"Tinos","Courier New":"Cousine",Garamond:"EB Garamond","Book Antiqua":"EB Garamond",Georgia:"Tinos",Verdana:"Open Sans",Tahoma:"Open Sans","Trebuchet MS":"Source Sans Pro","Century Gothic":"Poppins","Franklin Gothic":"Libre Franklin",Palatino:"EB Garamond","Palatino Linotype":"EB Garamond","Lucida Sans":"Open Sans","Segoe UI":"Open Sans",Impact:"Anton","Comic Sans MS":"Comic Neue",Consolas:"Inconsolata","Lucida Console":"Inconsolata",Monaco:"Fira Code"};function S(t){let n=t.trim();return k[n]||n}async function E(t){let n=t.trim(),e=S(n);if(e!==n){let o=await h(e);return o&&l.add(n),o}return h(e)}async function v(t){let n=[...new Set(t.map(e=>e.trim()))];await Promise.all(n.map(e=>E(e)));}async function W(){await A(["Carlito","Caladea","Arimo","Tinos","Cousine","EB Garamond"]);}function B(t){let n=new Set,e=t;if(!e?.package)return n;let o=e.package?.document?.content;if(Array.isArray(o)){for(let a of o)if(a?.type==="paragraph"&&Array.isArray(a.content)){for(let s of a.content)if(s?.type==="run"&&s.formatting?.fontFamily){let{ascii:r,hAnsi:c}=s.formatting.fontFamily;r&&n.add(r),c&&c!==r&&n.add(c);}}}let i=e.package?.styles?.styles;if(Array.isArray(i)){for(let a of i)if(a?.runProperties?.fontFamily){let{ascii:s,hAnsi:r}=a.runProperties.fontFamily;s&&n.add(s),r&&r!==s&&n.add(r);}}return n}async function O(t){let n=B(t);n.size!==0&&await v(Array.from(n));}async function j(t){if(t instanceof ArrayBuffer)return t;if(t instanceof Uint8Array){let n=new ArrayBuffer(t.byteLength);return new Uint8Array(n).set(t),n}if(t instanceof Blob)return t.arrayBuffer();throw new TypeError(`Unsupported DocxInput type: ${typeof t}`)}export{h as a,A as b,T as c,z as d,G as e,U as f,I as g,M as h,R as i,$ as j,D as k,k as l,S as m,E as n,v as o,W as p,B as q,O as r,j as s};
@@ -0,0 +1 @@
1
+ import {a as a$1}from'./chunk-QPFJJPIC.mjs';import {e,f as f$1}from'./chunk-VW22RZ6C.mjs';function u(e){return {sdtType:e.sdtType,id:e.id??null,alias:e.alias??null,tag:e.tag??null,lock:e.lock??null,placeholder:e.placeholder??null,showingPlaceholder:e.showingPlaceholder??false,dateFormat:e.dateFormat??null,listItems:e.listItems?JSON.stringify(e.listItems):null,checked:e.checked??null,dataBinding:e.dataBinding?JSON.stringify(e.dataBinding):null,rawPropertiesXml:e.rawPropertiesXml??null,rawEndPropertiesXml:e.rawEndPropertiesXml??null}}function g(e){let i={sdtType:e.sdtType??"richText"};if(typeof e.id=="number"&&(i.id=e.id),e.alias!=null&&(i.alias=String(e.alias)),e.tag!=null&&(i.tag=String(e.tag)),e.lock!=null&&(i.lock=e.lock),e.placeholder!=null&&(i.placeholder=String(e.placeholder)),e.showingPlaceholder&&(i.showingPlaceholder=true),e.dateFormat!=null&&(i.dateFormat=String(e.dateFormat)),typeof e.listItems=="string"&&e.listItems)try{i.listItems=JSON.parse(e.listItems);}catch{}if(e.checked!=null&&(i.checked=e.checked),typeof e.dataBinding=="string"&&e.dataBinding)try{i.dataBinding=JSON.parse(e.dataBinding);}catch{}return e.rawPropertiesXml!=null&&(i.rawPropertiesXml=String(e.rawPropertiesXml)),e.rawEndPropertiesXml!=null&&(i.rawEndPropertiesXml=String(e.rawEndPropertiesXml)),i}function a(e){return !!e.wrap&&e.wrap.type!=="inline"}function w(e$1){let i=e$1.wrap?.type??"inline",t=e$1.wrap?.wrapText,l=e$1.position?.horizontal?.alignment;return {displayMode:d(i),cssFloat:p(i,t,l),wrapType:i,wrapText:t,anchorTarget:a(e$1)?"followingBlock":void 0,position:e$1.position?f(e$1.position):void 0,distTop:e$1.wrap?.distT!=null?e(e$1.wrap.distT):void 0,distBottom:e$1.wrap?.distB!=null?e(e$1.wrap.distB):void 0,distLeft:e$1.wrap?.distL!=null?e(e$1.wrap.distL):void 0,distRight:e$1.wrap?.distR!=null?e(e$1.wrap.distR):void 0}}function x(e){return e.anchorTarget==="followingBlock"||s(e)}function P(e){let i=e.position;if(!(!i?.horizontal&&!i?.vertical))return {horizontal:{relativeTo:i.horizontal?.relativeTo??"margin",alignment:i.horizontal?.align,posOffset:i.horizontal?.posOffset},vertical:{relativeTo:i.vertical?.relativeTo??"paragraph",alignment:i.vertical?.align,posOffset:i.vertical?.posOffset}}}function y(e){let i=e.wrapType??(e.displayMode==="float"?"square":"inline");if(!i||i==="inline")return;let t={type:i};return e.wrapText&&(t.wrapText=e.wrapText),e.distTop!=null&&(t.distT=f$1(e.distTop)),e.distBottom!=null&&(t.distB=f$1(e.distBottom)),e.distLeft!=null&&(t.distL=f$1(e.distLeft)),e.distRight!=null&&(t.distR=f$1(e.distRight)),t}function d(e){return e==="inline"?"inline":e==="topAndBottom"?"block":"float"}function s(e){return e.displayMode==="float"||a$1(e.wrapType)}function p(e,i,t){return e==="inline"||e==="topAndBottom"?"none":i==="left"?"right":i==="right"||t==="left"?"left":t==="right"?"right":"none"}function f(e){return {horizontal:e.horizontal?{relativeTo:e.horizontal.relativeTo,posOffset:e.horizontal.posOffset,align:e.horizontal.alignment}:void 0,vertical:e.vertical?{relativeTo:e.vertical.relativeTo,posOffset:e.vertical.posOffset,align:e.vertical.alignment}:void 0}}export{u as a,g as b,a as c,w as d,x as e,P as f,y as g};