@zeke-02/docx-editor 0.5.2 → 0.5.3

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 (211) hide show
  1. package/LICENSE +204 -0
  2. package/dist/FindReplaceDialog-7SQOVQWH.js +1 -0
  3. package/dist/FindReplaceDialog-RK3A7MSK.mjs +1 -0
  4. package/dist/{FootnotePropertiesDialog-XQ7NIFIU.js → FootnotePropertiesDialog-2Q2SHVMR.js} +1 -1
  5. package/dist/{FootnotePropertiesDialog-TNVJJCY6.mjs → FootnotePropertiesDialog-ZKQXW3YO.mjs} +1 -1
  6. package/dist/{HyperlinkDialog-FR4IZZ7E.mjs → HyperlinkDialog-QV3CVFQU.mjs} +1 -1
  7. package/dist/HyperlinkDialog-XVAF7FVN.js +1 -0
  8. package/dist/{ImagePositionDialog-JSZSIKF5.mjs → ImagePositionDialog-EGRH3HPP.mjs} +1 -1
  9. package/dist/{ImagePositionDialog-2YXRAGZS.js → ImagePositionDialog-HIVHUTBT.js} +1 -1
  10. package/dist/ImagePropertiesDialog-67WLFIIZ.mjs +1 -0
  11. package/dist/ImagePropertiesDialog-HSM3JJ22.js +1 -0
  12. package/dist/KeyboardShortcutsDialog-5D_FoAp6.d.ts +395 -0
  13. package/dist/KeyboardShortcutsDialog-D7ihAj18.d.mts +395 -0
  14. package/dist/PageSetupDialog-642IAVG2.js +1 -0
  15. package/dist/PageSetupDialog-ERUQDHAY.mjs +1 -0
  16. package/dist/{SplitCellDialog-NP3JJYHD.mjs → SplitCellDialog-GFWCFCTD.mjs} +1 -1
  17. package/dist/{SplitCellDialog-JIAC3RYV.js → SplitCellDialog-M7WF7ANE.js} +1 -1
  18. package/dist/{TablePropertiesDialog-TIK4AA5M.mjs → TablePropertiesDialog-TZ7VCL6V.mjs} +1 -1
  19. package/dist/{TablePropertiesDialog-T7D4HSVP.js → TablePropertiesDialog-ZKU2FTUX.js} +1 -1
  20. package/dist/agentApi-C41hiW-n.d.mts +486 -0
  21. package/dist/agentApi-D4AZmNfB.d.ts +486 -0
  22. package/dist/chunk-2XXILKEQ.js +1 -0
  23. package/dist/chunk-35DG3R42.js +2 -0
  24. package/dist/chunk-47VJOBJD.mjs +60 -0
  25. package/dist/chunk-5UX5CD4C.js +1 -0
  26. package/dist/chunk-7QQSDIWK.mjs +2 -0
  27. package/dist/chunk-AW5TISUL.js +3 -0
  28. package/dist/chunk-AYMGSTNG.js +1 -0
  29. package/dist/chunk-B45ECEGY.js +18 -0
  30. package/dist/chunk-B7CCL7SL.mjs +2 -0
  31. package/dist/chunk-BRMTZRLJ.js +2 -0
  32. package/dist/chunk-D47GTKGU.js +2 -0
  33. package/dist/chunk-E6MQXELR.js +1 -0
  34. package/dist/chunk-F5SERL7X.mjs +2 -0
  35. package/dist/chunk-FWPVBFKQ.mjs +1 -0
  36. package/dist/chunk-GGQK26JO.js +2 -0
  37. package/dist/chunk-GM2S2WMT.mjs +1 -0
  38. package/dist/chunk-ILYKDR3C.js +1 -0
  39. package/dist/chunk-IP5NAYHL.js +60 -0
  40. package/dist/chunk-JPF5R2ZM.mjs +1 -0
  41. package/dist/chunk-KOXCF3CL.mjs +1 -0
  42. package/dist/chunk-KRLNX56Y.mjs +2 -0
  43. package/dist/chunk-LUJ6HCMH.mjs +1 -0
  44. package/dist/chunk-MKNSJOCN.js +70 -0
  45. package/dist/chunk-NIBCC7WQ.js +1 -0
  46. package/dist/chunk-NLFXR2VH.js +2 -0
  47. package/dist/chunk-ONIYA2FU.mjs +2 -0
  48. package/dist/chunk-ONNHQWAX.mjs +1 -0
  49. package/dist/chunk-RCIZ7OM3.mjs +70 -0
  50. package/dist/{chunk-EHFEG3TX.js → chunk-SNZ57XBI.js} +1 -1
  51. package/dist/chunk-SOTWG3KJ.mjs +1 -0
  52. package/dist/chunk-TYPGB4KF.js +1 -0
  53. package/dist/chunk-U7ZW2DOO.mjs +2 -0
  54. package/dist/{chunk-PKEOQIQO.mjs → chunk-WPI3YRFO.mjs} +1 -1
  55. package/dist/chunk-XQZTWWRF.mjs +18 -0
  56. package/dist/chunk-ZVAFVHWR.mjs +3 -0
  57. package/dist/chunk-ZXPCJWVY.js +2 -0
  58. package/dist/{agentApi-DLt94vXk.d.mts → content-B2MzIMwA.d.mts} +8 -755
  59. package/dist/{agentApi-DLt94vXk.d.ts → content-B2MzIMwA.d.ts} +8 -755
  60. package/dist/dialogs.d.mts +25 -0
  61. package/dist/dialogs.d.ts +25 -0
  62. package/dist/dialogs.js +1 -0
  63. package/dist/dialogs.mjs +1 -0
  64. package/dist/document-DZ_ZeZEH.d.ts +294 -0
  65. package/dist/document-Di1qGqLS.d.mts +294 -0
  66. package/dist/executor-EPEB53SJ.js +1 -0
  67. package/dist/executor-TVJ6K6MW.mjs +1 -0
  68. package/dist/findReplace-CpIoILbP.d.mts +138 -0
  69. package/dist/findReplace-pkMskVJU.d.ts +138 -0
  70. package/dist/hooks.d.mts +598 -0
  71. package/dist/hooks.d.ts +598 -0
  72. package/dist/hooks.js +1 -0
  73. package/dist/hooks.mjs +1 -0
  74. package/dist/index.d.mts +1013 -483
  75. package/dist/index.d.ts +1013 -483
  76. package/dist/index.js +40 -120
  77. package/dist/index.mjs +40 -120
  78. package/dist/layout-bridge-5GYGYKM5.mjs +1 -0
  79. package/dist/layout-bridge-QQDA7ELH.js +1 -0
  80. package/dist/plugin-api.d.mts +176 -0
  81. package/dist/plugin-api.d.ts +176 -0
  82. package/dist/plugin-api.js +260 -0
  83. package/dist/plugin-api.mjs +260 -0
  84. package/dist/processTemplate-BTBTR7AM.js +1 -0
  85. package/dist/{processTemplate-W2C5PXZB.mjs → processTemplate-MBX2KDLE.mjs} +1 -1
  86. package/dist/styles.css +1 -1
  87. package/dist/styles.d.mts +18 -0
  88. package/dist/styles.d.ts +18 -0
  89. package/dist/styles.js +1 -0
  90. package/dist/styles.mjs +1 -0
  91. package/dist/types-Bd_YzkhG.d.mts +281 -0
  92. package/dist/types-Bd_YzkhG.d.ts +281 -0
  93. package/dist/types-CkfDgB0O.d.mts +39 -0
  94. package/dist/types-DZUhB7Ao.d.mts +18 -0
  95. package/dist/types-DZUhB7Ao.d.ts +18 -0
  96. package/dist/types-DcxHFUSc.d.ts +39 -0
  97. package/dist/ui.d.mts +111 -552
  98. package/dist/ui.d.ts +111 -552
  99. package/dist/ui.js +111 -1
  100. package/dist/ui.mjs +111 -1
  101. package/dist/useFindReplace-DDs533b-.d.mts +261 -0
  102. package/dist/useFindReplace-eyhMSZZf.d.ts +261 -0
  103. package/package.json +41 -43
  104. package/dist/ClipboardManager-CVKX0v9q.d.ts +0 -464
  105. package/dist/ClipboardManager-V3aaMnWE.d.mts +0 -464
  106. package/dist/DocumentAgent-BWflKHpH.d.mts +0 -442
  107. package/dist/DocumentAgent-DsdXtetF.d.ts +0 -442
  108. package/dist/FindReplaceDialog-L3YF5HIS.mjs +0 -1
  109. package/dist/FindReplaceDialog-SEBWC5P7.js +0 -1
  110. package/dist/HyperlinkDialog-WEK6JSAC.js +0 -1
  111. package/dist/ImagePropertiesDialog-527MFLQO.mjs +0 -1
  112. package/dist/ImagePropertiesDialog-HG4K3IE7.js +0 -1
  113. package/dist/PageSetupDialog-GALVJMUB.js +0 -1
  114. package/dist/PageSetupDialog-TGQIAMI7.mjs +0 -1
  115. package/dist/TableToolbar-DUgmob2I.d.ts +0 -1273
  116. package/dist/TableToolbar-YL74HNS1.d.mts +0 -1273
  117. package/dist/chunk-23SXXIZS.js +0 -111
  118. package/dist/chunk-3F52AP2Q.js +0 -1
  119. package/dist/chunk-42O5GXM5.mjs +0 -82
  120. package/dist/chunk-54ULJEHM.mjs +0 -1
  121. package/dist/chunk-5XK326FI.mjs +0 -1
  122. package/dist/chunk-6WPRCJ5A.mjs +0 -1
  123. package/dist/chunk-76IYR7C7.mjs +0 -1
  124. package/dist/chunk-AGRIVA4G.js +0 -1
  125. package/dist/chunk-BTCQ2QI3.mjs +0 -3
  126. package/dist/chunk-BUEMG4NW.js +0 -1
  127. package/dist/chunk-BXRC4U3X.mjs +0 -2
  128. package/dist/chunk-CPAYKE6X.mjs +0 -1
  129. package/dist/chunk-DACWLFKI.mjs +0 -1
  130. package/dist/chunk-EPBFWE36.js +0 -2
  131. package/dist/chunk-FXES3YDB.js +0 -82
  132. package/dist/chunk-HI66BSGS.mjs +0 -9
  133. package/dist/chunk-INTPVEO6.mjs +0 -9
  134. package/dist/chunk-IOAGVW6Q.mjs +0 -2
  135. package/dist/chunk-JCEWC5QL.mjs +0 -4
  136. package/dist/chunk-JTIUFACT.js +0 -1
  137. package/dist/chunk-LUF7PWIC.js +0 -10
  138. package/dist/chunk-MGEN6GOE.mjs +0 -2
  139. package/dist/chunk-MOE2ZGUE.js +0 -18
  140. package/dist/chunk-MWLHJWB6.js +0 -9
  141. package/dist/chunk-OFYVDN3U.mjs +0 -2
  142. package/dist/chunk-P4VSHBGZ.js +0 -2
  143. package/dist/chunk-P5FQHIES.mjs +0 -1
  144. package/dist/chunk-PBC7XAYZ.js +0 -3
  145. package/dist/chunk-PEMB6SZT.js +0 -2
  146. package/dist/chunk-PQMSZTBB.js +0 -9
  147. package/dist/chunk-Q7UDQXAF.js +0 -1
  148. package/dist/chunk-QGTAIC5E.js +0 -1
  149. package/dist/chunk-QVPR2W5S.js +0 -1
  150. package/dist/chunk-R3QMYPL5.mjs +0 -59
  151. package/dist/chunk-RBUTXXQJ.mjs +0 -18
  152. package/dist/chunk-RRWYZ2TS.mjs +0 -111
  153. package/dist/chunk-S3STEPVO.js +0 -182
  154. package/dist/chunk-SFUM35DH.js +0 -2
  155. package/dist/chunk-SNLC6EK2.js +0 -1
  156. package/dist/chunk-TMTLIGLZ.js +0 -59
  157. package/dist/chunk-TSE2PWFX.mjs +0 -10
  158. package/dist/chunk-UKESXQS5.mjs +0 -182
  159. package/dist/chunk-UWYD42WV.js +0 -4
  160. package/dist/chunk-UXVACQCY.mjs +0 -1
  161. package/dist/chunk-W4EIKDM6.mjs +0 -2
  162. package/dist/chunk-W53SI3XW.mjs +0 -1
  163. package/dist/chunk-WNS2RBQD.js +0 -2
  164. package/dist/chunk-Z3KMSHUP.js +0 -1
  165. package/dist/core-plugins-reexport.d.mts +0 -31
  166. package/dist/core-plugins-reexport.d.ts +0 -31
  167. package/dist/core-plugins-reexport.js +0 -1
  168. package/dist/core-plugins-reexport.mjs +0 -1
  169. package/dist/core-reexport.d.mts +0 -340
  170. package/dist/core-reexport.d.ts +0 -340
  171. package/dist/core-reexport.js +0 -1
  172. package/dist/core-reexport.mjs +0 -1
  173. package/dist/documentSerializer-DtS_-oGA.d.mts +0 -664
  174. package/dist/documentSerializer-Wj1p2ASa.d.ts +0 -664
  175. package/dist/executor-C3VXF7QA.mjs +0 -1
  176. package/dist/executor-GDBV3AGV.js +0 -1
  177. package/dist/headless-reexport.d.mts +0 -197
  178. package/dist/headless-reexport.d.ts +0 -197
  179. package/dist/headless-reexport.js +0 -1
  180. package/dist/headless-reexport.mjs +0 -1
  181. package/dist/insertOperations-BTH1Asas.d.mts +0 -176
  182. package/dist/insertOperations-CbUnXAXH.d.ts +0 -176
  183. package/dist/layout-bridge-EA4DJ227.js +0 -1
  184. package/dist/layout-bridge-XDPSO6GO.mjs +0 -1
  185. package/dist/mcp-reexport.d.mts +0 -156
  186. package/dist/mcp-reexport.d.ts +0 -156
  187. package/dist/mcp-reexport.js +0 -16
  188. package/dist/mcp-reexport.mjs +0 -16
  189. package/dist/processTemplate-MJ2PCSO5.js +0 -1
  190. package/dist/react-B0W16SV6.d.ts +0 -1330
  191. package/dist/react-D0Pn1nww.d.mts +0 -1330
  192. package/dist/react.css +0 -1
  193. package/dist/react.d.mts +0 -10
  194. package/dist/react.d.ts +0 -10
  195. package/dist/react.js +0 -1
  196. package/dist/react.mjs +0 -1
  197. package/dist/registry-CH9V-IX0.d.ts +0 -165
  198. package/dist/registry-CWBKYlNW.d.mts +0 -165
  199. package/dist/types-UDsUq8D3.d.mts +0 -310
  200. package/dist/types-jbivc9Lj.d.ts +0 -310
  201. package/dist/variableDetector-CdQ7ZTzA.d.mts +0 -204
  202. package/dist/variableDetector-DsRV3A9z.d.ts +0 -204
  203. package/i18n/de.json +0 -792
  204. package/i18n/en.json +0 -792
  205. package/i18n/he.json +0 -792
  206. package/i18n/pl.json +0 -792
  207. package/i18n/pt-BR.json +0 -792
  208. package/i18n/tr.json +0 -792
  209. package/i18n/zh-CN.json +0 -792
  210. /package/dist/{chunk-YC5KZSYD.js → chunk-ESZ6JRTW.js} +0 -0
  211. /package/dist/{chunk-LVGJKS7Y.mjs → chunk-TZMMD6RR.mjs} +0 -0
@@ -1,9 +0,0 @@
1
- 'use strict';var chunkLUF7PWIC_js=require('./chunk-LUF7PWIC.js'),chunkTMTLIGLZ_js=require('./chunk-TMTLIGLZ.js'),chunkQGTAIC5E_js=require('./chunk-QGTAIC5E.js'),chunkP4VSHBGZ_js=require('./chunk-P4VSHBGZ.js'),chunkMOE2ZGUE_js=require('./chunk-MOE2ZGUE.js'),chunkH5NTJZO4_js=require('./chunk-H5NTJZO4.js');function at(r,t){let e=ft(t),n=new RegExp(`<w:p[\\s][^>]*w14:paraId="${e}"`,"g"),o=[],a;for(;(a=n.exec(r))!==null;)o.push(a.index);if(o.length===0||o.length>1)return null;let s=o[0],i=s,c=0;for(;i<r.length;){let l=r.indexOf("<",i);if(l===-1)break;if(r.startsWith("<w:p",l)){let g=r[l+4];if(g===">"||g===" "||g==="/"){let f=r.indexOf(">",l);if(f===-1)break;if(r[f-1]==="/"){if(c===0)return {start:s,end:f+1};i=f+1;}else c++,i=f+1;}else i=l+1;}else if(r.startsWith("</w:p>",l)){if(c--,c===0)return {start:s,end:l+6};i=l+6;}else i=l+1;}return null}function ut(r,t){let e=at(r,t);return e?r.substring(e.start,e.end):null}function rt(r){let t=0,e=/<w:p[\s>]/g,n;for(;(n=e.exec(r))!==null;){let o=n.index,a=r[o+4];(a===">"||a===" ")&&t++;}return t}function ot(r){let t=new Map,e=/w14:paraId="([^"]+)"/g,n;for(;(n=e.exec(r))!==null;){let o=n[1];t.set(o,(t.get(o)||0)+1);}return t}function gt(r,t,e){if(e.size===0)return {safe:true};let n=ot(r),o=ot(t);for(let i of e){let c=n.get(i)||0;if(c===0)return {safe:false,reason:`paraId-not-found-in-original: ${i}`};if(c>1)return {safe:false,reason:`duplicate-paraId-in-original: ${i}`}}for(let i of e){let c=o.get(i)||0;if(c===0)return {safe:false,reason:`paraId-not-found-in-serialized: ${i}`};if(c>1)return {safe:false,reason:`duplicate-paraId-in-serialized: ${i}`}}let a=rt(r),s=rt(t);return a!==s?{safe:false,reason:`paragraph-count-mismatch: original=${a}, serialized=${s}`}:{safe:true}}function it(r,t,e){if(e.size===0)return r;if(!gt(r,t,e).safe)return null;let o=[];for(let s of e){let i=at(r,s);if(!i)return null;let c=ut(t,s);if(!c)return null;o.push({start:i.start,end:i.end,newXml:c});}o.sort((s,i)=>i.start-s.start);let a=r;for(let{start:s,end:i,newXml:c}of o)a=a.substring(0,s)+c+a.substring(i);return a}function ft(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function st(r){for(let t of r)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="run"){for(let n of e.content)if(n.type==="drawing"&&n.image?.src?.startsWith("data:")&&!n.image?.rId)return true}else if(e.type==="hyperlink"&&e.href&&!e.rId&&!e.anchor)return true}else if(t.type==="table"){for(let e of t.rows)for(let n of e.cells)if(st(n.content))return true}return false}async function ct(r,t,e){let{changedParaIds:n,structuralChange:o,hasUntrackedChanges:a}=e;if(o||a||!t)return null;let s=r.package.document.content;if(st(s))return null;let i=r.package.document.comments,c=i&&i.length>0,l=chunkTMTLIGLZ_js.p(r);try{let f=await(await import('./lib-U35UU4OU.js')).default.loadAsync(t),p=new Map;if(n.size>0){let u=f.file("word/document.xml");if(!u)return null;let m=await u.async("text"),C=chunkTMTLIGLZ_js.c(r),b=it(m,C,n);if(!b)return null;p.set("word/document.xml",b);}if(c){let{xml:u,paraInfos:m}=chunkTMTLIGLZ_js.d(i);p.set("word/comments.xml",u);let C=chunkTMTLIGLZ_js.e(m);C&&p.set("word/commentsExtended.xml",C);let b=chunkTMTLIGLZ_js.f(m);b&&p.set("word/commentsIds.xml",b);let d=chunkTMTLIGLZ_js.g(m,i);d&&p.set("word/commentsExtensible.xml",d);let T=f.file("[Content_Types].xml");if(T){let y=p.get("[Content_Types].xml")??await T.async("text"),S=!1,O=[["/word/comments.xml",chunkTMTLIGLZ_js.j],["/word/commentsExtended.xml",chunkTMTLIGLZ_js.k],["/word/commentsIds.xml",chunkTMTLIGLZ_js.l],["/word/commentsExtensible.xml",chunkTMTLIGLZ_js.m]];for(let[w,F]of O)y.includes(w)||(y=y.replace("</Types>",`<Override PartName="${w}" ContentType="${F}"/></Types>`),S=!0);S&&p.set("[Content_Types].xml",y);}let I="word/_rels/document.xml.rels",k=f.file(I);if(k){let y=p.get(I)??await k.async("text"),S=!1,O=[["comments.xml",chunkMOE2ZGUE_js.i.comments],["commentsExtended.xml",chunkMOE2ZGUE_js.i.commentsExtended],["commentsIds.xml",chunkMOE2ZGUE_js.i.commentsIds],["commentsExtensible.xml",chunkMOE2ZGUE_js.i.commentsExtensible]];for(let[w,F]of O)if(!y.includes(w)){let pt=chunkTMTLIGLZ_js.h(y);y=y.replace("</Relationships>",`<Relationship Id="rId${pt+1}" Type="${F}" Target="${w}"/></Relationships>`),S=!0;}S&&p.set(I,y);}}for(let[u,m]of l)p.set(u,m);let x=f.file("docProps/core.xml");if(x){let u=await x.async("text");p.set("docProps/core.xml",chunkTMTLIGLZ_js.q(u,{updateModifiedDate:!0}));}return await chunkTMTLIGLZ_js.o(f,p)}catch{return null}}var v=class r{constructor(t){chunkH5NTJZO4_js.d(this,"_document");chunkH5NTJZO4_js.d(this,"_pendingVariables");t instanceof ArrayBuffer||ArrayBuffer.isView(t)?this._document={package:{document:{content:[]}},originalBuffer:t instanceof ArrayBuffer?t:t.buffer}:this._document=t,this._pendingVariables={};}static async fromBuffer(t){let e=await chunkP4VSHBGZ_js.a(t);return new r(e)}static fromDocument(t){return new r(t)}getDocument(){return this._document}getText(){let t=this._document.package.document;return this._getBodyText(t)}getFormattedText(){let t=[],e=this._document.package.document;for(let n of e.content)n.type==="paragraph"&&this._extractParagraphSegments(n,t);return t}getVariables(){return chunkLUF7PWIC_js.a(this._document)}getStyles(){let t=this._document.package.styles;if(!t?.styles)return [];let e=[];for(let[n,o]of Object.entries(t.styles))if(typeof o=="object"&&o!==null){let a=o;e.push({id:n,name:a.name||n,type:a.type==="numbering"?"paragraph":a.type||"paragraph",builtIn:a.default});}return e}getPageCount(){let t=this.getWordCount();return Math.max(1,Math.ceil(t/500))}getWordCount(){return this.getText().split(/\s+/).filter(n=>n.length>0).length}getCharacterCount(t=true){let e=this.getText();return t?e.length:e.replace(/\s/g,"").length}getParagraphCount(){return this._document.package.document.content.filter(t=>t.type==="paragraph").length}getTableCount(){return this._document.package.document.content.filter(t=>t.type==="table").length}getAgentContext(t=100){let e=this._document.package.document,n=e.content.filter(s=>s.type==="paragraph"),o=n.map((s,i)=>{let c=this._getParagraphText(s),l=s.formatting?.styleId;return {index:i,preview:c.slice(0,t),style:l,isHeading:l?.toLowerCase().includes("heading")||false,headingLevel:this._parseHeadingLevel(l),isListItem:!!s.listRendering,isEmpty:c.trim().length===0}}),a=(e.sections||[]).map((s,i)=>({index:i,paragraphCount:s.content?.length||0,pageSize:s.properties?.pageWidth&&s.properties?.pageHeight?{width:s.properties.pageWidth,height:s.properties.pageHeight}:void 0,isLandscape:s.properties?.orientation==="landscape",hasHeader:!!s.properties?.headerReferences?.length,hasFooter:!!s.properties?.footerReferences?.length}));return {paragraphCount:n.length,wordCount:this.getWordCount(),characterCount:this.getCharacterCount(),variables:this.getVariables(),variableCount:this.getVariables().length,availableStyles:this.getStyles(),outline:o,sections:a,hasTables:this.getTableCount()>0,hasImages:this._hasImages(),hasHyperlinks:this._hasHyperlinks()}}insertText(t,e,n={}){let o={type:"insertText",position:t,text:e,formatting:n.formatting};return this._executeCommand(o)}replaceRange(t,e,n={}){let o={type:"replaceText",range:t,text:e,formatting:n.formatting};return this._executeCommand(o)}deleteRange(t){let e={type:"deleteText",range:t};return this._executeCommand(e)}applyFormatting(t,e){let n={type:"formatText",range:t,formatting:e};return this._executeCommand(n)}applyStyle(t,e){let n={type:"applyStyle",paragraphIndex:t,styleId:e};return this._executeCommand(n)}applyParagraphFormatting(t,e){let n={type:"formatParagraph",paragraphIndex:t,formatting:e};return this._executeCommand(n)}insertTable(t,e,n,o={}){let a={type:"insertTable",position:t,rows:e,columns:n,data:o.data,hasHeader:o.hasHeader};return this._executeCommand(a)}insertImage(t,e,n={}){let o={type:"insertImage",position:t,src:e,width:n.width,height:n.height,alt:n.alt};return this._executeCommand(o)}insertHyperlink(t,e,n={}){let o={type:"insertHyperlink",range:t,url:e,displayText:n.displayText,tooltip:n.tooltip};return this._executeCommand(o)}removeHyperlink(t){let e={type:"removeHyperlink",range:t};return this._executeCommand(e)}insertParagraphBreak(t){let e={type:"insertParagraphBreak",position:t};return this._executeCommand(e)}mergeParagraphs(t,e){let n={type:"mergeParagraphs",paragraphIndex:t,count:e};return this._executeCommand(n)}setVariable(t,e){return this._pendingVariables[t]=e,this}setVariables(t){for(let[e,n]of Object.entries(t))this._pendingVariables[e]=n;return this}getPendingVariables(){return {...this._pendingVariables}}clearPendingVariables(){return this._pendingVariables={},this}async applyVariables(t){let e={...this._pendingVariables,...t};if(Object.keys(e).length===0)return this;let n=this._document.originalBuffer;if(!n)throw new Error("Cannot apply variables: no original buffer for processing");let{processTemplate:o}=await import('./processTemplate-MJ2PCSO5.js'),a=o(n,e),s=await chunkP4VSHBGZ_js.a(a),i=new r(s);return i._pendingVariables={},i}async toBuffer(t){if(this._document.originalBuffer){if(t?.selective){let n=await ct(this._document,this._document.originalBuffer,t.selective);if(n)return this._document.originalBuffer=n,n}let e=await chunkTMTLIGLZ_js.i(this._document);return this._document.originalBuffer=e,e}return chunkTMTLIGLZ_js.r(this._document)}async toBlob(t="application/vnd.openxmlformats-officedocument.wordprocessingml.document"){let e=await this.toBuffer();return new Blob([e],{type:t})}executeCommands(t){return new r(chunkQGTAIC5E_js.b(this._document,t))}_executeCommand(t){let e=new r(chunkQGTAIC5E_js.a(this._document,t));return e._pendingVariables={...this._pendingVariables},e}_getBodyText(t){let e=[];for(let n of t.content)n.type==="paragraph"?e.push(this._getParagraphText(n)):n.type==="table"&&e.push(this._getTableText(n));return e.join(`
2
- `)}_getParagraphText(t){let e=[];for(let n of t.content)n.type==="run"?e.push(this._getRunText(n)):n.type==="hyperlink"&&e.push(this._getHyperlinkText(n));return e.join("")}_getRunText(t){return t.content.filter(e=>e.type==="text").map(e=>e.text).join("")}_getHyperlinkText(t){let e=[];for(let n of t.children)n.type==="run"&&e.push(this._getRunText(n));return e.join("")}_getTableText(t){let e=[];for(let n of t.rows)for(let o of n.cells)for(let a of o.content)a.type==="paragraph"&&e.push(this._getParagraphText(a));return e.join(" ")}_extractParagraphSegments(t,e){for(let n of t.content)if(n.type==="run"){let o=this._getRunText(n);o&&e.push({text:o,formatting:n.formatting});}else if(n.type==="hyperlink"){let o=n.href||"";for(let a of n.children)if(a.type==="run"){let s=this._getRunText(a);s&&e.push({text:s,formatting:a.formatting,isHyperlink:true,hyperlinkUrl:o});}}}_parseHeadingLevel(t){if(!t)return;let e=t.match(/heading\s*(\d)/i);if(e)return parseInt(e[1],10)}_hasImages(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let n of e.content)if(n.type==="run"){for(let o of n.content)if(o.type==="drawing")return true}}return false}_hasHyperlinks(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let n of e.content)if(n.type==="hyperlink")return true}return false}};async function ee(r){return v.fromBuffer(r)}function ne(r){return v.fromDocument(r)}function mt(r,t={}){let{outlineMaxChars:e=100,maxOutlineParagraphs:n=50}=t,o=r.package.document,a=o.content.filter(m=>m.type==="paragraph"),s=dt(a,e,n),i=chunkLUF7PWIC_js.a(r),c=ht(r),l=xt(o),g=yt(o),f=bt(o),p=o.content.some(m=>m.type==="table"),x=Pt(o),u=It(o);return {paragraphCount:a.length,wordCount:g,characterCount:f,variables:i,variableCount:i.length,availableStyles:c,outline:s,sections:l,hasTables:p,hasImages:x,hasHyperlinks:u}}function ie(r,t,e={}){let{contextChars:n=200,includeSuggestions:o=true}=e,s=r.package.document.content.filter(d=>d.type==="paragraph"),i=s[t.start.paragraphIndex];if(!i)throw new Error(`Paragraph not found at index ${t.start.paragraphIndex}`);let c=h(i),l="";if(t.start.paragraphIndex===t.end.paragraphIndex)l=c.slice(t.start.offset,t.end.offset);else {let d=[];for(let T=t.start.paragraphIndex;T<=t.end.paragraphIndex;T++){let I=s[T];if(!I)continue;let k=h(I);T===t.start.paragraphIndex?d.push(k.slice(t.start.offset)):T===t.end.paragraphIndex?d.push(k.slice(0,t.end.offset)):d.push(k);}l=d.join(`
3
- `);}let g=wt(s,t.start.paragraphIndex,t.start.offset,n),f=At(s,t.end.paragraphIndex,t.end.offset,n),p=_t(i,t.start.offset),x=i.formatting||{},u={index:t.start.paragraphIndex,fullText:c,style:i.formatting?.styleId,wordCount:j(c)},m=false,C=Dt(i,t.start.offset),b=o?vt(l):[];return {selectedText:l,range:t,formatting:p,paragraphFormatting:x,textBefore:g,textAfter:f,paragraph:u,inTable:m,inHyperlink:C,suggestedActions:b}}function lt(r){let t=mt(r,{outlineMaxChars:50,maxOutlineParagraphs:10}),e=[`Document with ${t.paragraphCount} paragraphs, ${t.wordCount} words.`];t.hasTables&&e.push("Contains tables."),t.hasImages&&e.push("Contains images."),t.hasHyperlinks&&e.push("Contains hyperlinks."),t.variableCount>0&&e.push(`Has ${t.variableCount} template variables: ${t.variables.join(", ")}`);let n=t.outline.filter(o=>o.isHeading);if(n.length>0){e.push(`
4
- Headings:`);for(let o of n.slice(0,5)){let a=o.headingLevel||1;e.push(`${" ".repeat(a-1)}- ${o.preview}`);}n.length>5&&e.push(` ... and ${n.length-5} more headings`);}return e.join(" ")}function dt(r,t,e){let n=[];for(let o=0;o<Math.min(r.length,e);o++){let a=r[o],s=h(a),i=a.formatting?.styleId;n.push({index:o,preview:s.slice(0,t),style:i,isHeading:kt(i),headingLevel:St(i),isListItem:!!a.listRendering,isEmpty:s.trim().length===0});}return n}function ht(r){let t=r.package.styles;if(!t?.styles)return [];let e=[];for(let[n,o]of Object.entries(t.styles))if(typeof o=="object"&&o!==null){let a=o;e.push({id:n,name:a.name||n,type:a.type==="numbering"?"paragraph":a.type||"paragraph",builtIn:a.default});}return e}function xt(r){return r.sections?r.sections.map((t,e)=>({index:e,paragraphCount:t.content?.length||0,pageSize:t.properties?.pageWidth&&t.properties?.pageHeight?{width:t.properties.pageWidth,height:t.properties.pageHeight}:void 0,isLandscape:t.properties?.orientation==="landscape",hasHeader:!!t.properties?.headerReferences?.length,hasFooter:!!t.properties?.footerReferences?.length})):[]}function yt(r){let t=0;for(let e of r.content)if(e.type==="paragraph"){let n=h(e);t+=j(n);}else e.type==="table"&&(t+=Ct(e));return t}function j(r){return r.split(/\s+/).filter(e=>e.length>0).length}function bt(r){let t=0;for(let e of r.content)if(e.type==="paragraph"){let n=h(e);t+=n.length;}else e.type==="table"&&(t+=Tt(e));return t}function Ct(r){let t=0;for(let e of r.rows)for(let n of e.cells)for(let o of n.content)if(o.type==="paragraph"){let a=h(o);t+=j(a);}return t}function Tt(r){let t=0;for(let e of r.rows)for(let n of e.cells)for(let o of n.content)if(o.type==="paragraph"){let a=h(o);t+=a.length;}return t}function h(r){let t=[];for(let e of r.content)e.type==="run"?t.push(E(e)):e.type==="hyperlink"&&t.push(M(e));return t.join("")}function E(r){return r.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function M(r){let t=[];for(let e of r.children)e.type==="run"&&t.push(E(e));return t.join("")}function Pt(r){for(let t of r.content)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="run"){for(let n of e.content)if(n.type==="drawing")return true}}return false}function It(r){for(let t of r.content)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="hyperlink")return true}return false}function kt(r){return r?r.toLowerCase().includes("heading"):false}function St(r){if(!r)return;let t=r.match(/heading\s*(\d)/i);if(t)return parseInt(t[1],10)}function wt(r,t,e,n){let o=[],a=0,s=r[t];if(s){let l=h(s).slice(0,e);o.unshift(l),a+=l.length;}for(let c=t-1;c>=0&&a<n;c--){let l=r[c];if(!l)continue;let g=h(l);o.unshift(g),a+=g.length;}let i=o.join(`
5
- `);return i.length>n?"..."+i.slice(-n):i}function At(r,t,e,n){let o=[],a=0,s=r[t];if(s){let l=h(s).slice(e);o.push(l),a+=l.length;}for(let c=t+1;c<r.length&&a<n;c++){let l=r[c];if(!l)continue;let g=h(l);o.push(g),a+=g.length;}let i=o.join(`
6
- `);return i.length>n?i.slice(0,n)+"...":i}function _t(r,t){let e=0;for(let n of r.content)if(n.type==="run"){let o=E(n),a=e,s=e+o.length;if(t>=a&&t<s)return n.formatting||{};e=s;}else if(n.type==="hyperlink"){let o=M(n),a=e,s=e+o.length;if(t>=a&&t<s){for(let i of n.children)if(i.type==="run")return i.formatting||{}}e=s;}return {}}function Dt(r,t){let e=0;for(let n of r.content)if(n.type==="run"){let o=E(n);e+=o.length;}else if(n.type==="hyperlink"){let o=M(n),a=e,s=e+o.length;if(t>=a&&t<s)return true;e=s;}return false}function vt(r,t,e){let n=[];return r.length>0&&(n.push({id:"rewrite",label:"Rewrite",description:"Rewrite this text",priority:10},{id:"summarize",label:"Summarize",description:"Summarize this text",priority:9}),r.length>200&&n.push({id:"summarize",label:"Summarize",description:"Create a shorter version",priority:8}),r.length<50&&r.split(/\s+/).length<10&&n.push({id:"expand",label:"Expand",description:"Add more details",priority:8}),n.push({id:"fixGrammar",label:"Fix Grammar",description:"Fix grammar and spelling",priority:7}),n.push({id:"translate",label:"Translate",description:"Translate to another language",priority:6}),n.push({id:"makeFormal",label:"Make Formal",description:"Use formal tone",priority:5},{id:"makeCasual",label:"Make Casual",description:"Use casual tone",priority:4})),n.sort((o,a)=>(a.priority||0)-(o.priority||0)),n}function Et(r,t,e={}){let{contextCharsBefore:n=200,contextCharsAfter:o=200,includeSuggestions:a=true}=e,s=r.package.document,i=s.content.filter(d=>d.type==="paragraph");if(t.start.paragraphIndex>=i.length)throw new Error(`Invalid start paragraph index: ${t.start.paragraphIndex}`);let c=i[t.start.paragraphIndex],l=Rt(i,t),g=Ot(i,t.start,n),f=Ft(i,t.end,o),p=Ht(c,t.start.offset),x=c.formatting||{},u={index:t.start.paragraphIndex,fullText:P(c),style:c.formatting?.styleId,wordCount:V(P(c))},m=jt(s,t.start),C=Mt(c,t.start.offset),b=a?Vt(l):[];return {selectedText:l,range:t,formatting:p,paragraphFormatting:x,textBefore:g,textAfter:f,paragraph:u,inTable:m,inHyperlink:C,suggestedActions:b}}function le(r,t,e={}){let n=Et(r,t,e),{includeDocumentSummary:o=true}=e,s=r.package.document.content.filter(u=>u.type==="paragraph"),i=V(n.selectedText),c=n.selectedText.length,l=t.start.paragraphIndex!==t.end.paragraphIndex,g=[];for(let u=t.start.paragraphIndex;u<=t.end.paragraphIndex;u++)g.push(u);let f=zt(s,t),p=o?lt(r):void 0,x=$t(n.selectedText);return {...n,documentSummary:p,wordCount:i,characterCount:c,isMultiParagraph:l,paragraphIndices:g,detectedLanguage:x,contentType:f}}function pe(r,t){let n=r.package.document.content.filter(i=>i.type==="paragraph"),o=[];for(let i=t.start.paragraphIndex;i<=t.end.paragraphIndex;i++){let c=n[i];if(!c)continue;let l=i===t.start.paragraphIndex?t.start.offset:0,g=i===t.end.paragraphIndex?t.end.offset:1/0;Bt(c,l,g,o);}let a=o.length<=1||o.every(i=>Lt(i,o[0]));return {predominant:o.length>0?o[0]:{},isConsistent:a,allFormatting:o}}function Rt(r,t){if(t.start.paragraphIndex===t.end.paragraphIndex){let n=r[t.start.paragraphIndex];return n?P(n).slice(t.start.offset,t.end.offset):""}let e=[];for(let n=t.start.paragraphIndex;n<=t.end.paragraphIndex;n++){let o=r[n];if(!o)continue;let a=P(o);n===t.start.paragraphIndex?e.push(a.slice(t.start.offset)):n===t.end.paragraphIndex?e.push(a.slice(0,t.end.offset)):e.push(a);}return e.join(`
7
- `)}function Ot(r,t,e){let n=[],o=0,a=r[t.paragraphIndex];if(a){let c=P(a).slice(0,t.offset);n.unshift(c),o+=c.length;}for(let i=t.paragraphIndex-1;i>=0&&o<e;i--){let c=r[i];if(!c)continue;let l=P(c);n.unshift(l),o+=l.length;}let s=n.join(`
8
- `);return s.length>e?"..."+s.slice(-e):s}function Ft(r,t,e){let n=[],o=0,a=r[t.paragraphIndex];if(a){let c=P(a).slice(t.offset);n.push(c),o+=c.length;}for(let i=t.paragraphIndex+1;i<r.length&&o<e;i++){let c=r[i];if(!c)continue;let l=P(c);n.push(l),o+=l.length;}let s=n.join(`
9
- `);return s.length>e?s.slice(0,e)+"...":s}function Ht(r,t){let e=0;for(let n of r.content)if(n.type==="run"){let o=_(n),a=e+o.length;if(t>=e&&t<a)return n.formatting||{};e=a;}else if(n.type==="hyperlink"){let o=R(n),a=e+o.length;if(t>=e&&t<a){for(let s of n.children)if(s.type==="run")return s.formatting||{}}e=a;}return {}}function Bt(r,t,e,n){let o=0;for(let a of r.content)if(a.type==="run"){let s=_(a),i=o,c=o+s.length;c>t&&i<e&&a.formatting&&n.push({...a.formatting}),o=c;}else if(a.type==="hyperlink"){let s=R(a),i=o,c=o+s.length;if(c>t&&i<e)for(let l of a.children)l.type==="run"&&l.formatting&&n.push({...l.formatting});o=c;}}function jt(r,t){return false}function Mt(r,t){let e=0;for(let n of r.content)if(n.type==="run"){let o=_(n);e+=o.length;}else if(n.type==="hyperlink"){let o=R(n),a=e,s=e+o.length;if(t>=a&&t<s)return true;e=s;}return false}function Vt(r,t,e){let n=[];if(!r||r.trim().length===0)return n;n.push({id:"askAI",label:"Ask AI",description:"Ask AI about this text",priority:11},{id:"rewrite",label:"Rewrite",description:"Rewrite this text differently",priority:10});let o=V(r);return o>50&&n.push({id:"summarize",label:"Summarize",description:"Create a shorter version",priority:9}),o<20&&n.push({id:"expand",label:"Expand",description:"Add more details",priority:9}),n.push({id:"fixGrammar",label:"Fix Grammar",description:"Fix grammar and spelling",priority:7},{id:"translate",label:"Translate",description:"Translate to another language",priority:6},{id:"explain",label:"Explain",description:"Explain what this means",priority:5}),n.push({id:"makeFormal",label:"Make Formal",description:"Use formal tone",priority:4},{id:"makeCasual",label:"Make Casual",description:"Use casual tone",priority:3}),n.sort((a,s)=>(s.priority||0)-(a.priority||0)),n}function zt(r,t){let e=new Set;for(let n=t.start.paragraphIndex;n<=t.end.paragraphIndex;n++){let o=r[n];o&&(o.listRendering?e.add("list"):o.formatting?.styleId?.toLowerCase().includes("heading")?e.add("heading"):e.add("prose"));}return e.size>1?"mixed":e.has("list")?"list":e.has("heading")?"heading":"prose"}function $t(r){return /[а-яА-ЯёЁ]/.test(r)?"ru":/[一-龯]/.test(r)?"zh":/[ひらがなカタカナ]/.test(r)||/[\u3040-\u309F\u30A0-\u30FF]/.test(r)?"ja":/[가-힣]/.test(r)?"ko":/[àâäéèêëïîôùûüç]/i.test(r)?"fr":/[äöüß]/i.test(r)?"de":/[áéíóúñ]/i.test(r)?"es":"en"}function P(r){let t=[];for(let e of r.content)e.type==="run"?t.push(_(e)):e.type==="hyperlink"&&t.push(R(e));return t.join("")}function _(r){return r.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function R(r){let t=[];for(let e of r.children)e.type==="run"&&t.push(_(e));return t.join("")}function V(r){return r.split(/\s+/).filter(t=>t.length>0).length}function Lt(r,t){let e=Object.keys(r),n=Object.keys(t);return e.length!==n.length?false:e.every(o=>{let a=r[o],s=t[o];return a===s})}exports.a=gt;exports.b=it;exports.c=ct;exports.d=v;exports.e=ee;exports.f=ne;exports.g=mt;exports.h=ie;exports.i=lt;exports.j=Et;exports.k=le;exports.l=pe;
@@ -1 +0,0 @@
1
- 'use strict';function u(n){return n/1440*96}function o(n){return n/96*1440}function P(n){return n==null||isNaN(n)?0:Math.round(n*96/914400)}function _(n){return Math.round(n/96*914400)}function I(n){return Math.round(n/914400*1440)}function E(n){return Math.round(n/1440*914400)}function i(n){return n/72*96}function m(n){return n/144*96}function N(n){return n/2}function H(n){return n/576*96}function e(n,t=2){let r=Math.pow(10,t);return Math.round(n*r)/r}function b(n){return `${e(n)}px`}exports.a=u;exports.b=o;exports.c=P;exports.d=_;exports.e=I;exports.f=E;exports.g=i;exports.h=m;exports.i=N;exports.j=H;exports.k=b;
@@ -1 +0,0 @@
1
- 'use strict';var chunkBUEMG4NW_js=require('./chunk-BUEMG4NW.js'),chunkQ7UDQXAF_js=require('./chunk-Q7UDQXAF.js');function R(s,t){let a=chunkBUEMG4NW_js.b.getCommandHandler(t.type);if(a)return a(s,t);switch(t.type){case "insertText":return E(s,t);case "replaceText":return B(s,t);case "deleteText":return S(s,t);case "formatText":return V(s,t);case "formatParagraph":return $(s,t);case "applyStyle":return H(s,t);case "insertTable":return A(s,t);case "insertImage":return F(s,t);case "insertHyperlink":return j(s,t);case "removeHyperlink":return N(s,t);case "insertParagraphBreak":return v(s,t);case "mergeParagraphs":return M(s,t);case "splitParagraph":return O(s,t);case "setVariable":return _(s,t);case "applyVariables":return J(s,t);default:let r=t;throw new Error(`Unknown command type: ${r.type}`)}}function q(s,t){return t.reduce((a,r)=>R(a,r),s)}function h(s){return JSON.parse(JSON.stringify(s))}function g(s,t){let a=0;for(let r=0;r<s.content.length;r++)if(s.content[r].type==="paragraph"){if(a===t)return r;a++;}return -1}function I(s){let t="";for(let a of s.content)if(a.type==="run")for(let r of a.content)r.type==="text"&&(t+=r.text);else if(a.type==="hyperlink"){for(let r of a.children)if(r.type==="run")for(let e of r.content)e.type==="text"&&(t+=e.text);}return t}function b(s,t){return {type:"run",formatting:t,content:[{type:"text",text:s}]}}function C(s,t,a,r){let e=[],o=0,p=false;for(let n of s.content)if(n.type==="run"){let c=n.content.filter(l=>l.type==="text").map(l=>l.text).join(""),i=o,u=o+c.length;if(!p&&t>=i&&t<=u){let l=t-i;l>0&&e.push({...n,content:[{type:"text",text:c.slice(0,l)}]}),e.push(b(a,r||n.formatting)),l<c.length&&e.push({...n,content:[{type:"text",text:c.slice(l)}]}),p=true;}else e.push(n);o=u;}else e.push(n);return p||e.push(b(a,r)),e}function y(s,t,a){let r=[],e=0;for(let o of s.content)if(o.type==="run"){let p=o.content.filter(i=>i.type==="text").map(i=>i.text).join(""),n=e,c=e+p.length;if(c<=t||n>=a)r.push(o);else {let i="";n<t&&(i+=p.slice(0,t-n)),c>a&&(i+=p.slice(a-n)),i.length>0&&r.push({...o,content:[{type:"text",text:i}]});}e=c;}else r.push(o);return r}function D(s,t,a,r){let e=[],o=0;for(let p of s.content)if(p.type==="run"){let n=p.content.filter(u=>u.type==="text").map(u=>u.text).join(""),c=o,i=o+n.length;if(i<=t||c>=a)e.push(p);else if(c>=t&&i<=a)e.push({...p,formatting:{...p.formatting,...r}});else {let u=Math.max(t,c),l=Math.min(a,i);c<u&&e.push({...p,content:[{type:"text",text:n.slice(0,u-c)}]}),e.push({...p,formatting:{...p.formatting,...r},content:[{type:"text",text:n.slice(u-c,l-c)}]}),i>l&&e.push({...p,content:[{type:"text",text:n.slice(l-c)}]});}o=i;}else e.push(p);return e}function E(s,t){let a=h(s),r=a.package.document,e=g(r,t.position.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.position.paragraphIndex} not found`);let o=r.content[e];return o.content=C(o,t.position.offset,t.text,t.formatting),a}function B(s,t){let a=h(s),r=a.package.document,{start:e,end:o}=t.range;if(e.paragraphIndex===o.paragraphIndex){let p=g(r,e.paragraphIndex);if(p===-1)throw new Error(`Paragraph index ${e.paragraphIndex} not found`);let n=r.content[p];n.content=y(n,e.offset,o.offset),n.content=C(n,e.offset,t.text,t.formatting);}else {let p=g(r,e.paragraphIndex),n=r.content[p],c=I(n);n.content=y(n,e.offset,c.length),n.content=C(n,e.offset,t.text,t.formatting);let i=[];for(let u=e.paragraphIndex+1;u<=o.paragraphIndex;u++)i.push(g(r,u));for(let u=i.length-1;u>=0;u--)i[u]!==-1&&r.content.splice(i[u],1);}return a}function S(s,t){let a=h(s),r=a.package.document,{start:e,end:o}=t.range;if(e.paragraphIndex===o.paragraphIndex){let p=g(r,e.paragraphIndex);if(p===-1)throw new Error(`Paragraph index ${e.paragraphIndex} not found`);let n=r.content[p];n.content=y(n,e.offset,o.offset);}else {let p=g(r,e.paragraphIndex),n=r.content[p],c=I(n);n.content=y(n,e.offset,c.length);let i=g(r,o.paragraphIndex),u=r.content[i];u.content=y(u,0,o.offset),n.content.push(...u.content);let l=[];for(let f=e.paragraphIndex+1;f<=o.paragraphIndex;f++)l.push(g(r,f));for(let f=l.length-1;f>=0;f--)l[f]!==-1&&r.content.splice(l[f],1);}return a}function V(s,t){let a=h(s),r=a.package.document,{start:e,end:o}=t.range;if(e.paragraphIndex===o.paragraphIndex){let p=g(r,e.paragraphIndex);if(p===-1)throw new Error(`Paragraph index ${e.paragraphIndex} not found`);let n=r.content[p];n.content=D(n,e.offset,o.offset,t.formatting);}else for(let p=e.paragraphIndex;p<=o.paragraphIndex;p++){let n=g(r,p);if(n===-1)continue;let c=r.content[n],i=I(c),u=0,l=i.length;p===e.paragraphIndex&&(u=e.offset),p===o.paragraphIndex&&(l=o.offset),c.content=D(c,u,l,t.formatting);}return a}function $(s,t){let a=h(s),r=a.package.document,e=g(r,t.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.paragraphIndex} not found`);let o=r.content[e];if(o.formatting={...o.formatting,...t.formatting},"numPr"in t.formatting){let p=t.formatting.numPr;if(p&&p.numId!==void 0&&p.numId!==0){let n=p.ilvl??0,c=p.numId===1,i=c?"\u2022":"1.";if(a.package.numbering){let u=a.package.numbering.nums.find(l=>l.numId===p.numId);if(u){let l=a.package.numbering.abstractNums.find(f=>f.abstractNumId===u.abstractNumId);if(l){let f=l.levels.find(x=>x.ilvl===n);f&&(i=f.lvlText||i);}}}o.listRendering={level:n,numId:p.numId,marker:i,isBullet:c};}else delete o.listRendering;}return a}function H(s,t){let a=h(s),r=a.package.document,e=g(r,t.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.paragraphIndex} not found`);let o=r.content[e];return o.formatting={...o.formatting,styleId:t.styleId},a}function A(s,t){let a=h(s),r=a.package.document,e=[];for(let n=0;n<t.rows;n++){let c=[];for(let i=0;i<t.columns;i++){let u=t.data?.[n]?.[i]||"";c.push({type:"tableCell",content:[{type:"paragraph",content:u?[b(u)]:[]}]});}e.push({type:"tableRow",formatting:n===0&&t.hasHeader?{header:true}:void 0,cells:c});}let o={type:"table",rows:e},p=g(r,t.position.paragraphIndex);return p===-1?r.content.push(o):r.content.splice(p+1,0,o),a}function F(s,t){let a=h(s),r=a.package.document,e=g(r,t.position.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.position.paragraphIndex} not found`);let o=r.content[e],n={type:"run",content:[{type:"drawing",image:{type:"image",rId:`rId_img_${Date.now()}`,src:t.src,alt:t.alt,size:{width:chunkQ7UDQXAF_js.d(t.width||100),height:chunkQ7UDQXAF_js.d(t.height||100)},wrap:{type:"inline"}}}]},c=C(o,t.position.offset,"",void 0),i=false,u=0;for(let l=0;l<c.length;l++){let f=c[l];if(f.type==="run"){let x=f.content.filter(d=>d.type==="text").map(d=>d.text).join("");if(u+=x.length,!i&&u>=t.position.offset){c.splice(l+1,0,n),i=true;break}}}return i||c.push(n),o.content=c,a}function j(s,t){let a=h(s),r=a.package.document,{start:e,end:o}=t.range;if(e.paragraphIndex!==o.paragraphIndex)throw new Error("Hyperlinks cannot span multiple paragraphs");let p=g(r,e.paragraphIndex);if(p===-1)throw new Error(`Paragraph index ${e.paragraphIndex} not found`);let n=r.content[p],c=I(n),i=t.displayText||c.slice(e.offset,o.offset);n.content=y(n,e.offset,o.offset);let u={type:"hyperlink",href:t.url,tooltip:t.tooltip,children:[b(i)]},l=false,f=0,x=[];for(let d of n.content)if(d.type==="run"){let P=d.content.filter(m=>m.type==="text").map(m=>m.text).join(""),k=f+P.length;if(!l&&f<=e.offset&&e.offset<=k){let m=e.offset-f;m>0&&x.push({...d,content:[{type:"text",text:P.slice(0,m)}]}),x.push(u),m<P.length&&x.push({...d,content:[{type:"text",text:P.slice(m)}]}),l=true;}else x.push(d);f=k;}else x.push(d);return l||x.push(u),n.content=x,a}function N(s,t){let a=h(s),r=a.package.document,{start:e}=t.range,o=g(r,e.paragraphIndex);if(o===-1)throw new Error(`Paragraph index ${e.paragraphIndex} not found`);let p=r.content[o],n=[];for(let c of p.content)if(c.type==="hyperlink")for(let i of c.children)i.type==="run"&&n.push(i);else n.push(c);return p.content=n,a}function v(s,t){let a=h(s),r=a.package.document,e=g(r,t.position.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.position.paragraphIndex} not found`);let o=r.content[e],p=I(o),n=y({...o,content:[...o.content]},t.position.offset,p.length),c=y({...o,content:[...o.content]},0,t.position.offset);o.content=n;let i={type:"paragraph",formatting:o.formatting,content:c};return r.content.splice(e+1,0,i),a}function M(s,t){let a=h(s),r=a.package.document,e=g(r,t.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.paragraphIndex} not found`);let o=r.content[e],p=[];for(let n=1;n<=t.count;n++){let c=g(r,t.paragraphIndex+n);if(c!==-1){let i=r.content[c];o.content.push(...i.content),p.push(c);}}for(let n=p.length-1;n>=0;n--)r.content.splice(p[n],1);return a}function O(s,t){return v(s,{position:t.position})}function _(s,t){let a=h(s);return a.templateVariables||(a.templateVariables=[]),a.templateVariables.includes(t.name)||a.templateVariables.push(t.name),a}function J(s,t){let a=h(s),r=a.package.document;function e(n){for(let c of n.content)if(c.type==="text")for(let[i,u]of Object.entries(t.values)){let l=new RegExp(`\\{${i}\\}`,"g");c.text=c.text.replace(l,u);}}function o(n){for(let c of n.content)if(c.type==="run")e(c);else if(c.type==="hyperlink")for(let i of c.children)i.type==="run"&&e(i);}function p(n){if(n.type==="paragraph")o(n);else if(n.type==="table")for(let c of n.rows)for(let i of c.cells)for(let u of i.content)p(u);}for(let n of r.content)p(n);return a}exports.a=R;exports.b=q;
@@ -1 +0,0 @@
1
- 'use strict';function n(e){return {start:e,end:e,collapsed:true}}function r(e,t){return {start:e,end:t,collapsed:e.paragraphIndex===t.paragraphIndex&&e.offset===t.offset}}function o(e,t){return !(e.paragraphIndex<t.start.paragraphIndex||e.paragraphIndex===t.start.paragraphIndex&&e.offset<t.start.offset||e.paragraphIndex>t.end.paragraphIndex||e.paragraphIndex===t.end.paragraphIndex&&e.offset>t.end.offset)}function i(e,t){return e.paragraphIndex<t.paragraphIndex?-1:e.paragraphIndex>t.paragraphIndex?1:e.offset<t.offset?-1:e.offset>t.offset?1:0}function s(e){return {askAI:"Ask AI",rewrite:"Rewrite",expand:"Expand",summarize:"Summarize",translate:"Translate",explain:"Explain",fixGrammar:"Fix Grammar",makeFormal:"Make Formal",makeCasual:"Make Casual",custom:"Custom Prompt"}[e]}function m(e){return {askAI:"Ask AI a question about this text",rewrite:"Rewrite this text in a different way",expand:"Expand this text with more details",summarize:"Summarize this text to be shorter",translate:"Translate this text to another language",explain:"Explain what this text means",fixGrammar:"Fix grammar and spelling errors",makeFormal:"Make the tone more formal",makeCasual:"Make the tone more casual",custom:"Enter a custom prompt"}[e]}var p=["askAI","rewrite","expand","summarize","translate","explain"];function g(e){return {...e,id:a()}}function a(){return `cmd_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}exports.a=n;exports.b=r;exports.c=o;exports.d=i;exports.e=s;exports.f=m;exports.g=p;exports.h=g;
@@ -1,59 +0,0 @@
1
- import {a as a$1}from'./chunk-76IYR7C7.mjs';import {a}from'./chunk-WOHFANC5.mjs';import {i}from'./chunk-RBUTXXQJ.mjs';import {c}from'./chunk-TAUMSKRE.mjs';function p(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function s(e){return e==null||!Number.isFinite(e)?"0":String(Math.round(e))}var W=1e5;function G(){W=1e5;}function U(e){return e!=null&&e!==""&&e!==0?String(e):String(W++)}var Pe=new Set(["black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","red","white","yellow"]);function be(e){if(!e)return "";let t=[];return e.auto?t.push('w:val="auto"'):e.rgb&&t.push(`w:val="${e.rgb}"`),e.themeColor&&t.push(`w:themeColor="${e.themeColor}"`),e.themeTint&&t.push(`w:themeTint="${e.themeTint}"`),e.themeShade&&t.push(`w:themeShade="${e.themeShade}"`),t.length===0?"":`<w:color ${t.join(" ")}/>`}function Ce(e){if(!e)return "";let t=[];return e.pattern?t.push(`w:val="${e.pattern}"`):t.push('w:val="clear"'),e.color?.rgb?t.push(`w:color="${e.color.rgb}"`):e.color?.auto&&t.push('w:color="auto"'),e.fill?.rgb?t.push(`w:fill="${e.fill.rgb}"`):e.fill?.auto&&t.push('w:fill="auto"'),e.fill?.themeColor&&t.push(`w:themeFill="${e.fill.themeColor}"`),e.fill?.themeTint&&t.push(`w:themeFillTint="${e.fill.themeTint}"`),e.fill?.themeShade&&t.push(`w:themeFillShade="${e.fill.themeShade}"`),t.length===0?"":`<w:shd ${t.join(" ")}/>`}function S(e){if(!e)return "";let t=[];if(e.styleId&&t.push(`<w:rStyle w:val="${p(e.styleId)}"/>`),e.fontFamily){let o=[];e.fontFamily.ascii&&o.push(`w:ascii="${p(e.fontFamily.ascii)}"`),e.fontFamily.hAnsi&&o.push(`w:hAnsi="${p(e.fontFamily.hAnsi)}"`),e.fontFamily.eastAsia&&o.push(`w:eastAsia="${p(e.fontFamily.eastAsia)}"`),e.fontFamily.cs&&o.push(`w:cs="${p(e.fontFamily.cs)}"`),e.fontFamily.asciiTheme&&o.push(`w:asciiTheme="${e.fontFamily.asciiTheme}"`),e.fontFamily.hAnsiTheme&&o.push(`w:hAnsiTheme="${e.fontFamily.hAnsiTheme}"`),e.fontFamily.eastAsiaTheme&&o.push(`w:eastAsiaTheme="${e.fontFamily.eastAsiaTheme}"`),e.fontFamily.csTheme&&o.push(`w:csTheme="${e.fontFamily.csTheme}"`),o.length>0&&t.push(`<w:rFonts ${o.join(" ")}/>`);}e.bold===true?t.push("<w:b/>"):e.bold===false&&t.push('<w:b w:val="0"/>'),e.boldCs===true?t.push("<w:bCs/>"):e.boldCs===false&&t.push('<w:bCs w:val="0"/>'),e.italic===true?t.push("<w:i/>"):e.italic===false&&t.push('<w:i w:val="0"/>'),e.italicCs===true?t.push("<w:iCs/>"):e.italicCs===false&&t.push('<w:iCs w:val="0"/>'),e.allCaps&&t.push("<w:caps/>"),e.smallCaps&&t.push("<w:smallCaps/>"),e.strike&&t.push("<w:strike/>"),e.doubleStrike&&t.push("<w:dstrike/>"),e.outline&&t.push("<w:outline/>"),e.shadow&&t.push("<w:shadow/>"),e.emboss&&t.push("<w:emboss/>"),e.imprint&&t.push("<w:imprint/>"),e.hidden&&t.push("<w:vanish/>");let n=be(e.color);if(n&&t.push(n),e.spacing!==void 0&&t.push(`<w:spacing w:val="${s(e.spacing)}"/>`),e.scale!==void 0&&t.push(`<w:w w:val="${s(e.scale)}"/>`),e.kerning!==void 0&&t.push(`<w:kern w:val="${s(e.kerning)}"/>`),e.position!==void 0&&t.push(`<w:position w:val="${s(e.position)}"/>`),e.fontSize!==void 0&&t.push(`<w:sz w:val="${s(e.fontSize)}"/>`),e.fontSizeCs!==void 0&&t.push(`<w:szCs w:val="${s(e.fontSizeCs)}"/>`),e.highlight&&e.highlight!=="none"){if(Pe.has(e.highlight))t.push(`<w:highlight w:val="${e.highlight}"/>`);else if(!e.shading){let o=e.highlight.replace(/^#/,"");/^[0-9a-fA-F]{6}$/.test(o)&&t.push(`<w:shd w:val="clear" w:color="auto" w:fill="${o}"/>`);}}if(e.underline){let o=[`w:val="${e.underline.style}"`];e.underline.color&&(e.underline.color.rgb&&o.push(`w:color="${e.underline.color.rgb}"`),e.underline.color.themeColor&&o.push(`w:themeColor="${e.underline.color.themeColor}"`),e.underline.color.themeTint&&o.push(`w:themeTint="${e.underline.color.themeTint}"`),e.underline.color.themeShade&&o.push(`w:themeShade="${e.underline.color.themeShade}"`)),t.push(`<w:u ${o.join(" ")}/>`);}e.effect&&e.effect!=="none"&&t.push(`<w:effect w:val="${e.effect}"/>`),e.emphasisMark&&e.emphasisMark!=="none"&&t.push(`<w:em w:val="${e.emphasisMark}"/>`);let r=Ce(e.shading);return r&&t.push(r),e.vertAlign&&e.vertAlign!=="baseline"&&t.push(`<w:vertAlign w:val="${e.vertAlign}"/>`),e.rtl&&t.push("<w:rtl/>"),e.cs&&t.push("<w:cs/>"),t.length===0?"":`<w:rPr>${t.join("")}</w:rPr>`}function ve(e){return !e.startsWith("<w:rPr>")||!e.endsWith("</w:rPr>")?"":e.slice(7,-8)}function Fe(e){let t=Number.isInteger(e.info.id)&&e.info.id>=0?e.info.id:0,n=typeof e.info.author=="string"?e.info.author.trim():"",r=n.length>0?n:"Unknown",o=typeof e.info.date=="string"?e.info.date.trim():void 0,i=typeof e.info.rsid=="string"?e.info.rsid.trim():void 0,c=[`w:id="${t}"`,`w:author="${p(r)}"`];o&&c.push(`w:date="${p(o)}"`),i&&c.push(`w:rsid="${p(i)}"`);let a=S(e.previousFormatting)||"<w:rPr/>";return `<w:rPrChange ${c.join(" ")}>${a}</w:rPrChange>`}function Se(e,t){let n=S(e),r=n?ve(n):"",o=(t??[]).map(Fe).join(""),i=`${r}${o}`;return i?`<w:rPr>${i}</w:rPr>`:""}function Ie(e){return `<w:t${e.preserveSpace||e.text.startsWith(" ")||e.text.endsWith(" ")||e.text.includes(" ")?' xml:space="preserve"':""}>${p(e.text)}</w:t>`}function Re(e){return "<w:tab/>"}function Ee(e){let t=[];return e.breakType==="page"?t.push('w:type="page"'):e.breakType==="column"?t.push('w:type="column"'):e.breakType==="textWrapping"&&(t.push('w:type="textWrapping"'),e.clear&&e.clear!=="none"&&t.push(`w:clear="${e.clear}"`)),t.length===0?"<w:br/>":`<w:br ${t.join(" ")}/>`}function Ae(e){return `<w:sym w:font="${p(e.font)}" w:char="${p(e.char)}"/>`}function De(e){return e.type==="footnoteRef"?`<w:footnoteReference w:id="${e.id}"/>`:`<w:endnoteReference w:id="${e.id}"/>`}function ke(e){let t=[`w:fldCharType="${e.charType}"`];return e.fldLock&&t.push('w:fldLock="true"'),e.dirty&&t.push('w:dirty="true"'),`<w:fldChar ${t.join(" ")}/>`}function ze(e){return `<w:instrText${e.text.startsWith(" ")||e.text.endsWith(" ")||e.text.includes(" ")?' xml:space="preserve"':""}>${p(e.text)}</w:instrText>`}function Be(e){return "<w:softHyphen/>"}function je(e){return "<w:noBreakHyphen/>"}function L(e){if(!e)return "";if(e.rgb)return `<a:srgbClr val="${e.rgb.replace("#","")}"/>`;if(e.themeColor){let t=`<a:schemeClr val="${e.themeColor}"`;return e.themeTint?t+=`><a:tint val="${e.themeTint}"/></a:schemeClr>`:e.themeShade?t+=`><a:shade val="${e.themeShade}"/></a:schemeClr>`:t+="/>",t}return ""}function Oe(e){if(!e||e.type==="none")return "<a:noFill/>";if(e.type==="solid"&&e.color)return `<a:solidFill>${L(e.color)}</a:solidFill>`;if(e.type==="gradient"&&e.gradient){let t=e.gradient,n=t.stops.map(o=>`<a:gs pos="${o.position}">${L(o.color)}</a:gs>`).join(""),r=t.type==="linear"?`<a:lin ang="${(t.angle||0)*6e4}" scaled="1"/>`:"";return `<a:gradFill><a:gsLst>${n}</a:gsLst>${r}</a:gradFill>`}return ""}function Z(e){if(!e)return "";let t=[];e.width!=null&&t.push(`w="${e.width}"`),e.cap&&t.push(`cap="${e.cap}"`);let n=[];return e.color&&n.push(`<a:solidFill>${L(e.color)}</a:solidFill>`),e.style&&e.style!=="solid"&&n.push(`<a:prstDash val="${e.style}"/>`),e.headEnd&&n.push(`<a:headEnd type="${e.headEnd.type}"${e.headEnd.width?` w="${e.headEnd.width}"`:""}${e.headEnd.length?` len="${e.headEnd.length}"`:""}/>`),e.tailEnd&&n.push(`<a:tailEnd type="${e.tailEnd.type}"${e.tailEnd.width?` w="${e.tailEnd.width}"`:""}${e.tailEnd.length?` len="${e.tailEnd.length}"`:""}/>`),n.length===0&&t.length===0?"":`<a:ln${t.length?" "+t.join(" "):""}>${n.join("")}</a:ln>`}function V(e){let t=[],n=e.horizontal;t.push(`<wp:positionH relativeFrom="${n.relativeTo}">`),n.alignment?t.push(`<wp:align>${n.alignment}</wp:align>`):t.push(`<wp:posOffset>${s(n.posOffset)}</wp:posOffset>`),t.push("</wp:positionH>");let r=e.vertical;return t.push(`<wp:positionV relativeFrom="${r.relativeTo}">`),r.alignment?t.push(`<wp:align>${r.alignment}</wp:align>`):t.push(`<wp:posOffset>${s(r.posOffset)}</wp:posOffset>`),t.push("</wp:positionV>"),t.join("")}function Y(e){let t=e.wrapText?` wrapText="${e.wrapText}"`:' wrapText="bothSides"';switch(e.type){case "square":return `<wp:wrapSquare${t}/>`;case "tight":return `<wp:wrapTight${t}><wp:wrapPolygon edited="0"><wp:start x="0" y="0"/><wp:lineTo x="0" y="21600"/><wp:lineTo x="21600" y="21600"/><wp:lineTo x="21600" y="0"/><wp:lineTo x="0" y="0"/></wp:wrapPolygon></wp:wrapTight>`;case "through":return `<wp:wrapThrough${t}><wp:wrapPolygon edited="0"><wp:start x="0" y="0"/><wp:lineTo x="0" y="21600"/><wp:lineTo x="21600" y="21600"/><wp:lineTo x="21600" y="0"/><wp:lineTo x="0" y="0"/></wp:wrapPolygon></wp:wrapThrough>`;case "topAndBottom":return "<wp:wrapTopAndBottom/>";case "behind":case "inFront":return "<wp:wrapNone/>";default:return "<wp:wrapNone/>"}}function Xe(e,t){let n=e.size.width,r=e.size.height,o=e.rId||"rId1",i=t,c=e.filename||`image${i}`,a="";e.transform?.rotation&&(a+=` rot="${Math.round(e.transform.rotation*6e4)}"`),e.transform?.flipH&&(a+=' flipH="1"'),e.transform?.flipV&&(a+=' flipV="1"');let l=e.opacity!==void 0&&e.opacity<1?`<a:alphaModFix amt="${Math.round(Math.max(0,Math.min(1,e.opacity))*1e5)}"/>`:"",u=l?`<a:blip r:embed="${o}">${l}</a:blip>`:`<a:blip r:embed="${o}"/>`,f=[];e.crop?.left&&f.push(`l="${Math.round(e.crop.left*1e5)}"`),e.crop?.top&&f.push(`t="${Math.round(e.crop.top*1e5)}"`),e.crop?.right&&f.push(`r="${Math.round(e.crop.right*1e5)}"`),e.crop?.bottom&&f.push(`b="${Math.round(e.crop.bottom*1e5)}"`);let m=f.length>0?`<a:srcRect ${f.join(" ")}/>`:"";return ['<a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">','<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">','<pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture">',"<pic:nvPicPr>",`<pic:cNvPr id="${i}" name="${p(c)}"${e.alt?` descr="${p(e.alt)}"`:""}/>`,"<pic:cNvPicPr/>","</pic:nvPicPr>","<pic:blipFill>",u,m,"<a:stretch><a:fillRect/></a:stretch>","</pic:blipFill>","<pic:spPr>",`<a:xfrm${a}>`,'<a:off x="0" y="0"/>',`<a:ext cx="${s(n)}" cy="${s(r)}"/>`,"</a:xfrm>",'<a:prstGeom prst="rect"><a:avLst/></a:prstGeom>',e.outline?Z(e.outline):"","</pic:spPr>","</pic:pic>","</a:graphicData>","</a:graphic>"].join("")}function Me(e){let t=e.image,n=t.wrap.type!=="inline",r=t.size.width,o=t.size.height,i=t.wrap.distT??0,c=t.wrap.distB??0,a=t.wrap.distL??0,l=t.wrap.distR??0,u=t.padding?.left??0,f=t.padding?.top??0,m=t.padding?.right??0,d=t.padding?.bottom??0,g=`<wp:effectExtent l="${s(u)}" t="${s(f)}" r="${s(m)}" b="${s(d)}"/>`,x=U(t.id),F=t.title||t.filename||`Picture ${x}`,T=Xe(t,x);if(!n)return ["<w:drawing>",`<wp:inline distT="${s(i)}" distB="${s(c)}" distL="${s(a)}" distR="${s(l)}">`,`<wp:extent cx="${s(r)}" cy="${s(o)}"/>`,g,`<wp:docPr id="${x}" name="${p(F)}"${t.alt?` descr="${p(t.alt)}"`:""}${t.decorative?' hidden="1"':""}/>`,'<wp:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1"/></wp:cNvGraphicFramePr>',T,"</wp:inline>","</w:drawing>"].join("");let j=t.wrap.type==="behind"?"1":"0",O=t.position?V(t.position):'<wp:positionH relativeFrom="column"><wp:posOffset>0</wp:posOffset></wp:positionH><wp:positionV relativeFrom="paragraph"><wp:posOffset>0</wp:posOffset></wp:positionV>',X=Y(t.wrap);return ["<w:drawing>",`<wp:anchor distT="${s(i)}" distB="${s(c)}" distL="${s(a)}" distR="${s(l)}" simplePos="0" relativeHeight="251658240" behindDoc="${j}" locked="0" layoutInCell="${t.layoutInCell===false?"0":"1"}" allowOverlap="${t.allowOverlap===false?"0":"1"}">`,'<wp:simplePos x="0" y="0"/>',O,`<wp:extent cx="${s(r)}" cy="${s(o)}"/>`,g,X,`<wp:docPr id="${x}" name="${p(F)}"${t.alt?` descr="${p(t.alt)}"`:""}/>`,'<wp:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1"/></wp:cNvGraphicFramePr>',T,"</wp:anchor>","</w:drawing>"].join("")}function Le(e){return e.map(t=>b(t)).join("")}function Ne(e){let t=e.shape,n=t.size.width,r=t.size.height,o=t.shapeType==="textBox",i=t.wrap&&t.wrap.type!=="inline",c=t.wrap?.distT??0,a=t.wrap?.distB??0,l=t.wrap?.distL??0,u=t.wrap?.distR??0,f=U(t.id),m=t.name||(o?`TextBox ${f}`:`Shape ${f}`),d="";t.transform?.rotation&&(d+=` rot="${Math.round(t.transform.rotation*6e4)}"`),t.transform?.flipH&&(d+=' flipH="1"'),t.transform?.flipV&&(d+=' flipV="1"');let g=["<wps:spPr>",`<a:xfrm${d}>`,'<a:off x="0" y="0"/>',`<a:ext cx="${s(n)}" cy="${s(r)}"/>`,"</a:xfrm>",`<a:prstGeom prst="${t.shapeType==="textBox"?"rect":t.shapeType}"><a:avLst/></a:prstGeom>`,Oe(t.fill),Z(t.outline),"</wps:spPr>"].join(""),x="";if(t.textBody){let h=t.textBody,P=['rot="0"','vert="horz"'];h.anchor&&P.push(`anchor="${h.anchor==="middle"?"ctr":h.anchor}"`),h.anchorCenter&&P.push('anchorCtr="1"'),h.margins&&(h.margins.left!=null&&P.push(`lIns="${s(h.margins.left)}"`),h.margins.top!=null&&P.push(`tIns="${s(h.margins.top)}"`),h.margins.right!=null&&P.push(`rIns="${s(h.margins.right)}"`),h.margins.bottom!=null&&P.push(`bIns="${s(h.margins.bottom)}"`)),o?x=["<wps:txbx><w:txbxContent>",Le(h.content),"</w:txbxContent></wps:txbx>",`<wps:bodyPr ${P.join(" ")}/>`].join(""):x=[`<wps:bodyPr ${P.join(" ")}/>`].join("");}let T=['<a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">','<a:graphicData uri="http://schemas.microsoft.com/office/word/2010/wordprocessingShape">',["<wps:wsp>",`<wps:cNvSpPr${o?' txBox="1"':""}/>`,g,x,"</wps:wsp>"].join(""),"</a:graphicData>","</a:graphic>"].join("");if(!i)return ["<w:drawing>",`<wp:inline distT="${s(c)}" distB="${s(a)}" distL="${s(l)}" distR="${s(u)}">`,`<wp:extent cx="${s(n)}" cy="${s(r)}"/>`,'<wp:effectExtent l="0" t="0" r="0" b="0"/>',`<wp:docPr id="${f}" name="${p(m)}"/>`,"<wp:cNvGraphicFramePr/>",T,"</wp:inline>","</w:drawing>"].join("");let j=t.wrap?.type==="behind"?"1":"0",O=t.position?V(t.position):'<wp:positionH relativeFrom="column"><wp:posOffset>0</wp:posOffset></wp:positionH><wp:positionV relativeFrom="paragraph"><wp:posOffset>0</wp:posOffset></wp:positionV>',X=Y(t.wrap);return ["<w:drawing>",`<wp:anchor distT="${s(c)}" distB="${s(a)}" distL="${s(l)}" distR="${s(u)}" simplePos="0" relativeHeight="251658240" behindDoc="${j}" locked="0" layoutInCell="1" allowOverlap="1">`,'<wp:simplePos x="0" y="0"/>',O,`<wp:extent cx="${s(n)}" cy="${s(r)}"/>`,'<wp:effectExtent l="0" t="0" r="0" b="0"/>',X,`<wp:docPr id="${f}" name="${p(m)}"/>`,"<wp:cNvGraphicFramePr/>",T,"</wp:anchor>","</w:drawing>"].join("")}function He(e){switch(e.type){case "text":return Ie(e);case "tab":return Re();case "break":return Ee(e);case "symbol":return Ae(e);case "footnoteRef":case "endnoteRef":return De(e);case "fieldChar":return ke(e);case "instrText":return ze(e);case "softHyphen":return Be();case "noBreakHyphen":return je();case "drawing":return Me(e);case "shape":return Ne(e);default:return ""}}function $(e){let t=[],n=Se(e.formatting,e.propertyChanges);n&&t.push(n);for(let r of e.content){let o=He(r);o&&t.push(o);}return `<w:r>${t.join("")}</w:r>`}function I(e,t){if(!e||e.style==="none"||e.style==="nil")return "";let n=[`w:val="${e.style}"`];return e.size!==void 0&&n.push(`w:sz="${s(e.size)}"`),e.space!==void 0&&n.push(`w:space="${s(e.space)}"`),e.color&&(e.color.auto?n.push('w:color="auto"'):e.color.rgb&&n.push(`w:color="${e.color.rgb}"`),e.color.themeColor&&n.push(`w:themeColor="${e.color.themeColor}"`),e.color.themeTint&&n.push(`w:themeTint="${e.color.themeTint}"`),e.color.themeShade&&n.push(`w:themeShade="${e.color.themeShade}"`)),e.shadow&&n.push('w:shadow="true"'),e.frame&&n.push('w:frame="true"'),`<w:${t} ${n.join(" ")}/>`}function _e(e){if(!e)return "";let t=[];if(e.top){let n=I(e.top,"top");n&&t.push(n);}if(e.left){let n=I(e.left,"left");n&&t.push(n);}if(e.bottom){let n=I(e.bottom,"bottom");n&&t.push(n);}if(e.right){let n=I(e.right,"right");n&&t.push(n);}if(e.between){let n=I(e.between,"between");n&&t.push(n);}if(e.bar){let n=I(e.bar,"bar");n&&t.push(n);}return t.length===0?"":`<w:pBdr>${t.join("")}</w:pBdr>`}function We(e){if(!e)return "";let t=[];return e.pattern?t.push(`w:val="${e.pattern}"`):t.push('w:val="clear"'),e.color?.rgb?t.push(`w:color="${e.color.rgb}"`):e.color?.auto&&t.push('w:color="auto"'),e.fill?.rgb?t.push(`w:fill="${e.fill.rgb}"`):e.fill?.auto&&t.push('w:fill="auto"'),e.fill?.themeColor&&t.push(`w:themeFill="${e.fill.themeColor}"`),e.fill?.themeTint&&t.push(`w:themeFillTint="${e.fill.themeTint}"`),e.fill?.themeShade&&t.push(`w:themeFillShade="${e.fill.themeShade}"`),t.length===0?"":`<w:shd ${t.join(" ")}/>`}function Ge(e){return !e||e.length===0?"":`<w:tabs>${e.map(n=>{let r=[`w:val="${n.alignment}"`,`w:pos="${s(n.position)}"`];return n.leader&&n.leader!=="none"&&r.push(`w:leader="${n.leader}"`),`<w:tab ${r.join(" ")}/>`}).join("")}</w:tabs>`}function Ue(e){let t=[];return e.spaceBefore!==void 0&&t.push(`w:before="${s(e.spaceBefore)}"`),e.spaceAfter!==void 0&&t.push(`w:after="${s(e.spaceAfter)}"`),e.lineSpacing!==void 0&&t.push(`w:line="${s(e.lineSpacing)}"`),e.lineSpacingRule&&t.push(`w:lineRule="${e.lineSpacingRule}"`),e.beforeAutospacing&&t.push('w:beforeAutospacing="1"'),e.afterAutospacing&&t.push('w:afterAutospacing="1"'),t.length===0?"":`<w:spacing ${t.join(" ")}/>`}function Ze(e){let t=[];return e.indentLeft!==void 0&&t.push(`w:left="${s(e.indentLeft)}"`),e.indentRight!==void 0&&t.push(`w:right="${s(e.indentRight)}"`),e.indentFirstLine!==void 0&&(e.hangingIndent?t.push(`w:hanging="${s(Math.abs(e.indentFirstLine))}"`):e.indentFirstLine!==0&&t.push(`w:firstLine="${s(e.indentFirstLine)}"`)),t.length===0?"":`<w:ind ${t.join(" ")}/>`}function Ve(e){if(!e)return "";let t=[];return e.ilvl!==void 0&&t.push(`<w:ilvl w:val="${s(e.ilvl)}"/>`),e.numId!==void 0&&t.push(`<w:numId w:val="${s(e.numId)}"/>`),t.length===0?"":`<w:numPr>${t.join("")}</w:numPr>`}function Ye(e){if(!e)return "";let t=[];return e.width!==void 0&&t.push(`w:w="${s(e.width)}"`),e.height!==void 0&&t.push(`w:h="${s(e.height)}"`),e.hAnchor&&t.push(`w:hAnchor="${e.hAnchor}"`),e.vAnchor&&t.push(`w:vAnchor="${e.vAnchor}"`),e.x!==void 0&&t.push(`w:x="${s(e.x)}"`),e.y!==void 0&&t.push(`w:y="${s(e.y)}"`),e.xAlign&&t.push(`w:xAlign="${e.xAlign}"`),e.yAlign&&t.push(`w:yAlign="${e.yAlign}"`),e.wrap&&t.push(`w:wrap="${e.wrap}"`),t.length===0?"":`<w:framePr ${t.join(" ")}/>`}function q(e,t){let n=[];if(e){e.styleId&&n.push(`<w:pStyle w:val="${p(e.styleId)}"/>`),e.keepNext&&n.push("<w:keepNext/>"),e.keepLines&&n.push("<w:keepLines/>"),e.contextualSpacing&&n.push("<w:contextualSpacing/>"),e.pageBreakBefore&&n.push("<w:pageBreakBefore/>");let r=Ye(e.frame);r&&n.push(r),e.widowControl===false?n.push('<w:widowControl w:val="0"/>'):e.widowControl===true&&n.push("<w:widowControl/>");let o=Ve(e.numPr);o&&n.push(o);let i=_e(e.borders);i&&n.push(i);let c=We(e.shading);c&&n.push(c);let a=Ge(e.tabs);a&&n.push(a),e.suppressLineNumbers&&n.push("<w:suppressLineNumbers/>"),e.suppressAutoHyphens&&n.push("<w:suppressAutoHyphens/>");let l=Ue(e);l&&n.push(l);let u=Ze(e);if(u&&n.push(u),e.bidi&&n.push("<w:bidi/>"),e.alignment&&n.push(`<w:jc w:val="${e.alignment}"/>`),e.outlineLevel!==void 0&&n.push(`<w:outlineLvl w:val="${e.outlineLevel}"/>`),e.runProperties){let f=S(e.runProperties);f&&n.push(f);}}return t&&t.length>0&&n.push(...t.map(r=>qe(r))),n.length===0?"":`<w:pPr>${n.join("")}</w:pPr>`}function Je(e){return !e.startsWith("<w:pPr>")||!e.endsWith("</w:pPr>")?"":e.slice(7,-8)}function qe(e){let t=Number.isInteger(e.info.id)&&e.info.id>=0?e.info.id:0,n=typeof e.info.author=="string"?e.info.author.trim():"",r=n.length>0?n:"Unknown",o=typeof e.info.date=="string"?e.info.date.trim():void 0,i=typeof e.info.rsid=="string"?e.info.rsid.trim():void 0,c=[`w:id="${t}"`,`w:author="${p(r)}"`];o&&c.push(`w:date="${p(o)}"`),i&&c.push(`w:rsid="${p(i)}"`);let a=q(e.previousFormatting)||"<w:pPr/>",l=Je(a),u=l.length>0?`<w:pPr>${l}</w:pPr>`:"<w:pPr/>";return `<w:pPrChange ${c.join(" ")}>${u}</w:pPrChange>`}function N(e){let t=[];e.rId&&t.push(`r:id="${e.rId}"`),e.anchor&&t.push(`w:anchor="${p(e.anchor)}"`),e.tooltip&&t.push(`w:tooltip="${p(e.tooltip)}"`),e.target&&t.push(`w:tgtFrame="${p(e.target)}"`),e.history===false&&t.push('w:history="0"'),e.docLocation&&t.push(`w:docLocation="${p(e.docLocation)}"`);let n=e.children.map(o=>o.type==="run"?$(o):o.type==="bookmarkStart"?K(o):o.type==="bookmarkEnd"?Q(o):"").join("");return `<w:hyperlink${t.length>0?" "+t.join(" "):""}>${n}</w:hyperlink>`}function K(e){let t=[`w:id="${e.id}"`,`w:name="${p(e.name)}"`];return e.colFirst!==void 0&&t.push(`w:colFirst="${e.colFirst}"`),e.colLast!==void 0&&t.push(`w:colLast="${e.colLast}"`),`<w:bookmarkStart ${t.join(" ")}/>`}function Q(e){return `<w:bookmarkEnd w:id="${e.id}"/>`}function Ke(e){let t=[],n=e.content.find(a=>a.type==="run"),r=n?.formatting?S(n.formatting):"",o=['w:fldCharType="begin"'];e.fldLock&&o.push('w:fldLock="true"'),t.push(`<w:r>${r}<w:fldChar ${o.join(" ")}/></w:r>`);let c=e.instruction.startsWith(" ")||e.instruction.endsWith(" ")||e.instruction.includes(" ")?' xml:space="preserve"':"";t.push(`<w:r>${r}<w:instrText${c}>${p(e.instruction)}</w:instrText></w:r>`),t.push(`<w:r>${r}<w:fldChar w:fldCharType="separate"/></w:r>`);for(let a of e.content)a.type==="run"&&t.push($(a));return t.push(`<w:r>${r}<w:fldChar w:fldCharType="end"/></w:r>`),t.join("")}function Qe(e){let t=[],n=e.fieldResult?.[0]?.formatting,r=n?S(n):"",o=['w:fldCharType="begin"'];if(e.fldLock&&o.push('w:fldLock="true"'),t.push(`<w:r>${r}<w:fldChar ${o.join(" ")}/></w:r>`),e.fieldCode.length>0)t.push(...e.fieldCode.map(i=>$(i)));else {let c=e.instruction.startsWith(" ")||e.instruction.endsWith(" ")||e.instruction.includes(" ")?' xml:space="preserve"':"";t.push(`<w:r>${r}<w:instrText${c}>${p(e.instruction)}</w:instrText></w:r>`);}return t.push(`<w:r>${r}<w:fldChar w:fldCharType="separate"/></w:r>`),t.push(...e.fieldResult.map(i=>$(i))),t.push(`<w:r>${r}<w:fldChar w:fldCharType="end"/></w:r>`),t.join("")}function et(e){let t=e.properties,n=[];switch(t.alias&&n.push(`<w:alias w:val="${p(t.alias)}"/>`),t.tag&&n.push(`<w:tag w:val="${p(t.tag)}"/>`),t.lock&&t.lock!=="unlocked"&&n.push(`<w:lock w:val="${t.lock}"/>`),t.showingPlaceholder&&n.push("<w:showingPlcHdr/>"),t.sdtType){case "plainText":n.push("<w:text/>");break;case "date":t.dateFormat?n.push(`<w:date w:fullDate="${p(t.dateFormat)}"/>`):n.push("<w:date/>");break;case "dropdown":{let o=(t.listItems??[]).map(i=>`<w:listItem w:displayText="${p(i.displayText)}" w:value="${p(i.value)}"/>`).join("");n.push(`<w:dropDownList>${o}</w:dropDownList>`);break}case "comboBox":{let o=(t.listItems??[]).map(i=>`<w:listItem w:displayText="${p(i.displayText)}" w:value="${p(i.value)}"/>`).join("");n.push(`<w:comboBox>${o}</w:comboBox>`);break}case "checkbox":n.push(`<w14:checkbox><w14:checked w14:val="${t.checked?"1":"0"}"/></w14:checkbox>`);break;case "picture":n.push("<w:picture/>");break}let r=e.content.map(o=>o.type==="run"?$(o):o.type==="hyperlink"?N(o):"").join("");return `<w:sdt><w:sdtPr>${n.join("")}</w:sdtPr><w:sdtContent>${r}</w:sdtContent></w:sdt>`}function J(e,t){let n=[`w:id="${t.id}"`,`w:name="${p(t.name)}"`];return `<w:${e} ${n.join(" ")}/>`}function D(e,t){let n=t.info,r=Number.isInteger(n.id)&&n.id>=0?n.id:0,o=typeof n.author=="string"?n.author.trim():"",i=o.length>0?o:"Unknown",c=typeof n.date=="string"?n.date.trim():void 0,a=[`w:id="${r}"`,`w:author="${p(i)}"`];c&&a.push(`w:date="${p(c)}"`);let l=t.content.map(u=>u.type==="run"?e==="del"||e==="moveFrom"?$(u).replace(/<w:t\b/g,"<w:delText").replace(/<\/w:t>/g,"</w:delText>").replace(/<w:instrText\b/g,"<w:delInstrText").replace(/<\/w:instrText>/g,"</w:delInstrText>"):$(u):u.type==="hyperlink"?N(u):"").join("");return `<w:${e} ${a.join(" ")}>${l}</w:${e}>`}function tt(e){switch(e.type){case "run":return $(e);case "hyperlink":return N(e);case "bookmarkStart":return K(e);case "bookmarkEnd":return Q(e);case "simpleField":return Ke(e);case "complexField":return Qe(e);case "inlineSdt":return et(e);case "commentRangeStart":return `<w:commentRangeStart w:id="${e.id}"/>`;case "commentRangeEnd":return `<w:commentRangeEnd w:id="${e.id}"/><w:r><w:rPr><w:rStyle w:val="CommentReference"/></w:rPr><w:commentReference w:id="${e.id}"/></w:r>`;case "insertion":return D("ins",e);case "deletion":return D("del",e);case "moveFrom":return D("moveFrom",e);case "moveTo":return D("moveTo",e);case "moveFromRangeStart":return J("moveFromRangeStart",e);case "moveFromRangeEnd":return `<w:moveFromRangeEnd w:id="${e.id}"/>`;case "moveToRangeStart":return J("moveToRangeStart",e);case "moveToRangeEnd":return `<w:moveToRangeEnd w:id="${e.id}"/>`;case "mathEquation":return e.ommlXml||"";default:return ""}}function b(e){let t=[],n=[];e.paraId&&n.push(`w14:paraId="${e.paraId}"`),e.textId&&n.push(`w14:textId="${e.textId}"`);let r=n.length>0?" "+n.join(" "):"",o=q(e.formatting,e.propertyChanges);o&&t.push(o);let i=!!e.renderedPageBreakBefore;for(let c of e.content){let a=tt(c);if(a){if(i){let l=nt(a);l&&(a=l,i=false);}t.push(a);}}return `<w:p${r}>${t.join("")}</w:p>`}function nt(e){let t=/<w:r(?=[\s>/])[^>]*>/;return t.test(e)?e.replace(t,n=>`${n}<w:lastRenderedPageBreak/>`):null}function rt(e){let t=Number.isInteger(e.id)&&e.id>=0?e.id:0,n=typeof e.author=="string"?e.author.trim():"",r=n.length>0?n:"Unknown",o=typeof e.date=="string"?e.date.trim():void 0;return {id:t,author:r,date:o}}function v(e,t){let n=rt(e),r=[`w:id="${n.id}"`,`w:author="${p(n.author)}"`];return n.date&&r.push(`w:date="${p(n.date)}"`),t&&t.trim().length>0&&r.push(`w:rsid="${p(t.trim())}"`),r.join(" ")}function C(e,t){if(!e)return "";let n=[`w:w="${s(e.value)}"`,`w:type="${e.type}"`];return `<w:${t} ${n.join(" ")}/>`}function R(e,t){if(!e||e.style==="none"||e.style==="nil")return "";let n=[`w:val="${e.style}"`];return e.size!==void 0&&n.push(`w:sz="${s(e.size)}"`),e.space!==void 0&&n.push(`w:space="${s(e.space)}"`),e.color&&(e.color.auto?n.push('w:color="auto"'):e.color.rgb&&n.push(`w:color="${e.color.rgb}"`),e.color.themeColor&&n.push(`w:themeColor="${e.color.themeColor}"`),e.color.themeTint&&n.push(`w:themeTint="${e.color.themeTint}"`),e.color.themeShade&&n.push(`w:themeShade="${e.color.themeShade}"`)),e.shadow&&n.push('w:shadow="true"'),e.frame&&n.push('w:frame="true"'),`<w:${t} ${n.join(" ")}/>`}function ee(e,t){if(!e)return "";let n=[];if(e.top){let r=R(e.top,"top");r&&n.push(r);}if(e.left){let r=R(e.left,"left");r&&n.push(r);}if(e.bottom){let r=R(e.bottom,"bottom");r&&n.push(r);}if(e.right){let r=R(e.right,"right");r&&n.push(r);}if(e.insideH){let r=R(e.insideH,"insideH");r&&n.push(r);}if(e.insideV){let r=R(e.insideV,"insideV");r&&n.push(r);}return n.length===0?"":`<w:${t}>${n.join("")}</w:${t}>`}function te(e,t){if(!e)return "";let n=[];return e.top&&n.push(C(e.top,"top")),e.left&&n.push(C(e.left,"left")),e.bottom&&n.push(C(e.bottom,"bottom")),e.right&&n.push(C(e.right,"right")),n.length===0?"":`<w:${t}>${n.join("")}</w:${t}>`}function ne(e){if(!e)return "";let t=[];return e.pattern?t.push(`w:val="${e.pattern}"`):t.push('w:val="clear"'),e.color?.rgb?t.push(`w:color="${e.color.rgb}"`):e.color?.auto&&t.push('w:color="auto"'),e.fill?.rgb?t.push(`w:fill="${e.fill.rgb}"`):e.fill?.auto&&t.push('w:fill="auto"'),e.fill?.themeColor&&t.push(`w:themeFill="${e.fill.themeColor}"`),e.fill?.themeTint&&t.push(`w:themeFillTint="${e.fill.themeTint}"`),e.fill?.themeShade&&t.push(`w:themeFillShade="${e.fill.themeShade}"`),t.length===0?"":`<w:shd ${t.join(" ")}/>`}function ot(e){if(!e)return "";let t=[];return e.firstRow&&t.push('w:firstRow="1"'),e.lastRow&&t.push('w:lastRow="1"'),e.firstColumn&&t.push('w:firstColumn="1"'),e.lastColumn&&t.push('w:lastColumn="1"'),e.noHBand&&t.push('w:noHBand="1"'),e.noVBand&&t.push('w:noVBand="1"'),t.length===0?"":`<w:tblLook ${t.join(" ")}/>`}function it(e){if(!e)return "";let t=[];return e.horzAnchor&&t.push(`w:horzAnchor="${e.horzAnchor}"`),e.vertAnchor&&t.push(`w:vertAnchor="${e.vertAnchor}"`),e.tblpX!==void 0&&t.push(`w:tblpX="${s(e.tblpX)}"`),e.tblpXSpec&&t.push(`w:tblpXSpec="${e.tblpXSpec}"`),e.tblpY!==void 0&&t.push(`w:tblpY="${s(e.tblpY)}"`),e.tblpYSpec&&t.push(`w:tblpYSpec="${e.tblpYSpec}"`),e.topFromText!==void 0&&t.push(`w:topFromText="${s(e.topFromText)}"`),e.bottomFromText!==void 0&&t.push(`w:bottomFromText="${s(e.bottomFromText)}"`),e.leftFromText!==void 0&&t.push(`w:leftFromText="${s(e.leftFromText)}"`),e.rightFromText!==void 0&&t.push(`w:rightFromText="${s(e.rightFromText)}"`),t.length===0?"":`<w:tblpPr ${t.join(" ")}/>`}function re(e,t){let n=[];if(e){e.styleId&&n.push(`<w:tblStyle w:val="${p(e.styleId)}"/>`);let r=it(e.floating);r&&n.push(r),e.bidi&&n.push("<w:bidiVisual/>");let o=C(e.width,"tblW");o&&n.push(o),e.justification&&n.push(`<w:jc w:val="${e.justification}"/>`);let i=C(e.cellSpacing,"tblCellSpacing");i&&n.push(i);let c=C(e.indent,"tblInd");c&&n.push(c);let a=ee(e.borders,"tblBorders");a&&n.push(a);let l=te(e.cellMargins,"tblCellMar");l&&n.push(l),e.layout&&n.push(`<w:tblLayout w:type="${e.layout}"/>`);let u=ne(e.shading);u&&n.push(u);let f=ot(e.look);f&&n.push(f),e.overlap&&n.push(`<w:tblOverlap w:val="${e.overlap}"/>`);}return t&&t.length>0&&n.push(...t.map(r=>at(r))),n.length===0?"":`<w:tblPr>${n.join("")}</w:tblPr>`}function st(e){return !e.startsWith("<w:tblPr>")||!e.endsWith("</w:tblPr>")?"":e.slice(9,-10)}function at(e){let t=v(e.info,e.info.rsid),n=re(e.previousFormatting)||"<w:tblPr/>",r=st(n),o=r.length>0?`<w:tblPr>${r}</w:tblPr>`:"<w:tblPr/>";return `<w:tblPrChange ${t}>${o}</w:tblPrChange>`}function oe(e,t,n){let r=[];if(e){if(e.cantSplit&&r.push("<w:cantSplit/>"),e.header&&r.push("<w:tblHeader/>"),e.height){let o=[`w:val="${s(e.height.value)}"`];e.heightRule&&o.push(`w:hRule="${e.heightRule}"`),r.push(`<w:trHeight ${o.join(" ")}/>`);}e.justification&&r.push(`<w:jc w:val="${e.justification}"/>`),e.hidden&&r.push("<w:hidden/>");}return n&&(n.type==="tableRowInsertion"?r.push(`<w:ins ${v(n.info)}/>`):n.type==="tableRowDeletion"&&r.push(`<w:del ${v(n.info)}/>`)),t&&t.length>0&&r.push(...t.map(o=>lt(o))),r.length===0?"":`<w:trPr>${r.join("")}</w:trPr>`}function ct(e){return !e.startsWith("<w:trPr>")||!e.endsWith("</w:trPr>")?"":e.slice(8,-9)}function lt(e){let t=v(e.info,e.info.rsid),n=oe(e.previousFormatting)||"<w:trPr/>",r=ct(n),o=r.length>0?`<w:trPr>${r}</w:trPr>`:"<w:trPr/>";return `<w:trPrChange ${t}>${o}</w:trPrChange>`}function pt(e){if(!e)return "";let n=[e.firstRow?"1":"0",e.lastRow?"1":"0",e.firstColumn?"1":"0",e.lastColumn?"1":"0",e.oddVBand?"1":"0",e.evenVBand?"1":"0",e.oddHBand?"1":"0",e.evenHBand?"1":"0",e.nwCell?"1":"0",e.neCell?"1":"0",e.swCell?"1":"0",e.seCell?"1":"0"].join("");return n==="000000000000"?"":`<w:cnfStyle w:val="${n}"/>`}function ie(e,t,n){let r=[];if(e){let o=pt(e.conditionalFormat);o&&r.push(o);let i=C(e.width,"tcW");i&&r.push(i),e.gridSpan&&e.gridSpan>1&&r.push(`<w:gridSpan w:val="${s(e.gridSpan)}"/>`),e.vMerge&&(e.vMerge==="restart"?r.push('<w:vMerge w:val="restart"/>'):r.push("<w:vMerge/>"));let c=ee(e.borders,"tcBorders");c&&r.push(c);let a=ne(e.shading);a&&r.push(a),e.noWrap&&r.push("<w:noWrap/>");let l=te(e.margins,"tcMar");l&&r.push(l),e.textDirection&&r.push(`<w:textDirection w:val="${e.textDirection}"/>`),e.fitText&&r.push("<w:tcFitText/>"),e.verticalAlign&&r.push(`<w:vAlign w:val="${e.verticalAlign}"/>`),e.hideMark&&r.push("<w:hideMark/>");}return n&&(n.type==="tableCellInsertion"?r.push(`<w:cellIns ${v(n.info)}/>`):n.type==="tableCellDeletion"?r.push(`<w:cellDel ${v(n.info)}/>`):n.type==="tableCellMerge"&&r.push(`<w:cellMerge ${v(n.info)}/>`)),t&&t.length>0&&r.push(...t.map(o=>ut(o))),r.length===0?"":`<w:tcPr>${r.join("")}</w:tcPr>`}function ft(e){return !e.startsWith("<w:tcPr>")||!e.endsWith("</w:tcPr>")?"":e.slice(8,-9)}function ut(e){let t=v(e.info,e.info.rsid),n=ie(e.previousFormatting)||"<w:tcPr/>",r=ft(n),o=r.length>0?`<w:tcPr>${r}</w:tcPr>`:"<w:tcPr/>";return `<w:tcPrChange ${t}>${o}</w:tcPrChange>`}function mt(e){return !e||e.length===0?"":`<w:tblGrid>${e.map(n=>`<w:gridCol w:w="${s(n)}"/>`).join("")}</w:tblGrid>`}function dt(e){let t=[];for(let n of e)n.type==="paragraph"?t.push(b(n)):n.type==="table"&&t.push(E(n));return t.length===0&&t.push("<w:p/>"),t.join("")}function ht(e){let t=[],n=ie(e.formatting,e.propertyChanges,e.structuralChange);return n&&t.push(n),t.push(dt(e.content)),`<w:tc>${t.join("")}</w:tc>`}function wt(e){let t=[],n=oe(e.formatting,e.propertyChanges,e.structuralChange);n&&t.push(n);for(let r of e.cells)t.push(ht(r));return `<w:tr>${t.join("")}</w:tr>`}function E(e){let t=[],n=re(e.formatting,e.propertyChanges);n&&t.push(n);let r=mt(e.columnWidths);r&&t.push(r);for(let o of e.rows)t.push(wt(o));return `<w:tbl>${t.join("")}</w:tbl>`}var w={wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"};function gt(){let e={wpc:w.wpc,mc:w.mc,o:w.o,r:w.r,m:w.m,v:w.v,wp14:w.wp14,wp:w.wp,w10:w.w10,w:w.w,w14:w.w14,w15:w.w15,wpg:w.wpg,wps:w.wps};return Object.entries(e).map(([t,n])=>`xmlns:${t}="${n}"`).join(" ")}function k(e,t){if(!e||e.style==="none"||e.style==="nil")return "";let n=[`w:val="${e.style}"`];return e.size!==void 0&&n.push(`w:sz="${s(e.size)}"`),e.space!==void 0&&n.push(`w:space="${s(e.space)}"`),e.color&&(e.color.auto?n.push('w:color="auto"'):e.color.rgb&&n.push(`w:color="${e.color.rgb}"`),e.color.themeColor&&n.push(`w:themeColor="${e.color.themeColor}"`),e.color.themeTint&&n.push(`w:themeTint="${e.color.themeTint}"`),e.color.themeShade&&n.push(`w:themeShade="${e.color.themeShade}"`)),e.shadow&&n.push('w:shadow="true"'),e.frame&&n.push('w:frame="true"'),`<w:${t} ${n.join(" ")}/>`}function xt(e){return `<w:headerReference ${[`w:type="${e.type}"`,`r:id="${e.rId}"`].join(" ")}/>`}function yt(e){return `<w:footerReference ${[`w:type="${e.type}"`,`r:id="${e.rId}"`].join(" ")}/>`}function $t(e){if(!e)return "";let t=[];return e.position&&t.push(`<w:pos w:val="${e.position}"/>`),e.numFmt&&t.push(`<w:numFmt w:val="${e.numFmt}"/>`),e.numStart!==void 0&&t.push(`<w:numStart w:val="${e.numStart}"/>`),e.numRestart&&t.push(`<w:numRestart w:val="${e.numRestart}"/>`),t.length===0?"":`<w:footnotePr>${t.join("")}</w:footnotePr>`}function Tt(e){if(!e)return "";let t=[];return e.position&&t.push(`<w:pos w:val="${e.position}"/>`),e.numFmt&&t.push(`<w:numFmt w:val="${e.numFmt}"/>`),e.numStart!==void 0&&t.push(`<w:numStart w:val="${e.numStart}"/>`),e.numRestart&&t.push(`<w:numRestart w:val="${e.numRestart}"/>`),t.length===0?"":`<w:endnotePr>${t.join("")}</w:endnotePr>`}function Pt(e){let t=[];return e.pageWidth!==void 0&&t.push(`w:w="${s(e.pageWidth)}"`),e.pageHeight!==void 0&&t.push(`w:h="${s(e.pageHeight)}"`),e.orientation==="landscape"&&t.push('w:orient="landscape"'),t.length===0?"":`<w:pgSz ${t.join(" ")}/>`}function bt(e){let t=[];return e.marginTop!==void 0&&t.push(`w:top="${s(e.marginTop)}"`),e.marginRight!==void 0&&t.push(`w:right="${s(e.marginRight)}"`),e.marginBottom!==void 0&&t.push(`w:bottom="${s(e.marginBottom)}"`),e.marginLeft!==void 0&&t.push(`w:left="${s(e.marginLeft)}"`),e.headerDistance!==void 0&&t.push(`w:header="${s(e.headerDistance)}"`),e.footerDistance!==void 0&&t.push(`w:footer="${s(e.footerDistance)}"`),e.gutter!==void 0&&t.push(`w:gutter="${s(e.gutter)}"`),t.length===0?"":`<w:pgMar ${t.join(" ")}/>`}function Ct(e){if(!e.columnCount&&!e.columns?.length)return "";let t=[];e.columnCount!==void 0&&e.columnCount>1&&t.push(`w:num="${s(e.columnCount)}"`),e.columnSpace!==void 0&&t.push(`w:space="${s(e.columnSpace)}"`),e.equalWidth!==void 0&&t.push(`w:equalWidth="${e.equalWidth?"1":"0"}"`),e.separator&&t.push('w:sep="1"');let n="";return e.columns&&e.columns.length>0&&(n=e.columns.map(o=>{let i=[];return o.width!==void 0&&i.push(`w:w="${s(o.width)}"`),o.space!==void 0&&i.push(`w:space="${s(o.space)}"`),`<w:col ${i.join(" ")}/>`}).join("")),t.length===0&&!n?"":`<w:cols${t.length>0?" "+t.join(" "):""}>${n}</w:cols>`}function vt(e){if(!e.lineNumbers)return "";let t=e.lineNumbers,n=[];return t.countBy!==void 0&&n.push(`w:countBy="${s(t.countBy)}"`),t.start!==void 0&&n.push(`w:start="${s(t.start)}"`),t.distance!==void 0&&n.push(`w:distance="${s(t.distance)}"`),t.restart&&n.push(`w:restart="${t.restart}"`),n.length===0?"":`<w:lnNumType ${n.join(" ")}/>`}function Ft(e){if(!e.pageBorders)return "";let t=e.pageBorders,n=[],r=[];if(t.display&&n.push(`w:display="${t.display}"`),t.offsetFrom&&n.push(`w:offsetFrom="${t.offsetFrom}"`),t.zOrder&&n.push(`w:zOrder="${t.zOrder}"`),t.top){let i=k(t.top,"top");i&&r.push(i);}if(t.left){let i=k(t.left,"left");i&&r.push(i);}if(t.bottom){let i=k(t.bottom,"bottom");i&&r.push(i);}if(t.right){let i=k(t.right,"right");i&&r.push(i);}return r.length===0?"":`<w:pgBorders${n.length>0?" "+n.join(" "):""}>${r.join("")}</w:pgBorders>`}function St(e){if(!e.docGrid)return "";let t=e.docGrid,n=[];return t.type&&n.push(`w:type="${t.type}"`),t.linePitch!==void 0&&n.push(`w:linePitch="${t.linePitch}"`),t.charSpace!==void 0&&n.push(`w:charSpace="${t.charSpace}"`),n.length===0?"":`<w:docGrid ${n.join(" ")}/>`}function It(e){if(!e)return "";let t=[];if(e.headerReferences)for(let f of e.headerReferences)t.push(xt(f));if(e.footerReferences)for(let f of e.footerReferences)t.push(yt(f));let n=$t(e.footnotePr);n&&t.push(n);let r=Tt(e.endnotePr);r&&t.push(r),e.sectionStart&&t.push(`<w:type w:val="${e.sectionStart}"/>`);let o=Pt(e);o&&t.push(o);let i=bt(e);if(i&&t.push(i),e.paperSrcFirst!==void 0||e.paperSrcOther!==void 0){let f=[];e.paperSrcFirst!==void 0&&f.push(`w:first="${e.paperSrcFirst}"`),e.paperSrcOther!==void 0&&f.push(`w:other="${e.paperSrcOther}"`),t.push(`<w:paperSrc ${f.join(" ")}/>`);}let c=Ft(e);c&&t.push(c);let a=vt(e);a&&t.push(a);let l=Ct(e);l&&t.push(l);let u=St(e);return u&&t.push(u),e.verticalAlign&&t.push(`<w:vAlign w:val="${e.verticalAlign}"/>`),e.bidi&&t.push("<w:bidi/>"),e.titlePg&&t.push("<w:titlePg/>"),e.evenAndOddHeaders&&t.push("<w:evenAndOddHeaders/>"),t.length===0?"":`<w:sectPr>${t.join("")}</w:sectPr>`}function se(e){if(e.type==="paragraph")return b(e);if(e.type==="table")return E(e);if(e.type==="blockSdt"){let t=e.content.map(o=>se(o)).join(""),n=e.properties,r=[];return n.alias&&r.push(`<w:alias w:val="${n.alias}"/>`),n.tag&&r.push(`<w:tag w:val="${n.tag}"/>`),`<w:sdt><w:sdtPr>${r.join("")}</w:sdtPr><w:sdtContent>${t}</w:sdtContent></w:sdt>`}return ""}function Rt(e){return e.map(t=>se(t)).join("")}function Et(e){let t=[];return t.push(Rt(e.content)),e.finalSectionProperties&&t.push(It(e.finalSectionProperties)),t.join("")}function ae(e){G();let t=[];t.push('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>');let n=gt();return t.push(`<w:document ${n} mc:Ignorable="w14 w15 wp14">`),t.push("<w:body>"),t.push(Et(e.package.document)),t.push("</w:body>"),t.push("</w:document>"),t.join("")}var A=c(a());var At={wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"};function Dt(){return Object.entries(At).map(([e,t])=>`xmlns:${e}="${t}"`).join(" ")}function kt(e){return e.type==="paragraph"?b(e):e.type==="table"?E(e):""}function ce(e){let t=e.type==="header"?"w:hdr":"w:ftr",n=Dt(),r=e.content.map(o=>kt(o)).join("");return r||(r="<w:p><w:pPr/></w:p>"),`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
- <${t} ${n}>${r}</${t}>`}var z='xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:oel="http://schemas.microsoft.com/office/2019/extlst" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cex="http://schemas.microsoft.com/office/word/2018/wordml/cex" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16="http://schemas.microsoft.com/office/word/2018/wordml" xmlns:w16du="http://schemas.microsoft.com/office/word/2023/wordml/word16du" xmlns:w16sdtdh="http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash" xmlns:w16sdtfl="http://schemas.microsoft.com/office/word/2024/wordml/sdtformatlock" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape"',B='mc:Ignorable="w14 w15 w16se w16cid w16 w16cex w16sdtdh w16sdtfl w16du wp14"';function ue(e){let t="<w:r>",n=[];e.formatting?.bold&&n.push("<w:b/>"),e.formatting?.italic&&n.push("<w:i/>"),n.length>0&&(t+=`<w:rPr>${n.join("")}</w:rPr>`);for(let r of e.content)if(r.type==="text"){let o=r.text!==r.text.trim()||r.text.includes(" ");t+=o?`<w:t xml:space="preserve">${p(r.text)}</w:t>`:`<w:t>${p(r.text)}</w:t>`;}else r.type==="break"&&(t+="<w:br/>");return t+="</w:r>",t}function le(e,t){let n=t?`<w:p w14:paraId="${t}">`:"<w:p>";for(let r of e.content)r.type==="run"&&(n+=ue(r));return n+="</w:p>",n}function pe(e,t){let n=t?`<w:p w14:paraId="${t}">`:"<w:p>";n+='<w:r><w:rPr><w:rStyle w:val="CommentReference"/></w:rPr><w:annotationRef/></w:r>';for(let r of e.content)r.type==="run"&&(n+=ue(r));return n+="</w:p>",n}function fe(e,t){let n=a$1(),r=[`w:id="${e.id}"`];if(e.author&&r.push(`w:author="${p(e.author)}"`),e.initials?r.push(`w:initials="${p(e.initials)}"`):r.push('w:initials=""'),e.date){let i=e.date.replace(/\.\d{3}Z$/,"Z");r.push(`w:date="${p(i)}"`);}let o=`<w:comment ${r.join(" ")}>`;if(e.content&&e.content.length>0)if(e.content.length===1)o+=pe(e.content[0],n);else {o+=pe(e.content[0]);for(let i=1;i<e.content.length-1;i++)o+=le(e.content[i]);o+=le(e.content[e.content.length-1],n);}else o+=`<w:p w14:paraId="${n}"><w:r><w:rPr><w:rStyle w:val="CommentReference"/></w:rPr><w:annotationRef/></w:r></w:p>`;return o+="</w:comment>",t.push({commentId:e.id,lastParaId:n,durableId:a$1(),parentId:e.parentId,done:e.done}),o}function me(e){if(!e||e.length===0)return {xml:"",paraInfos:[]};let t=[],n=[];for(let i of e)(i.parentId==null?t:n).push(i);let r=[],o=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:comments ${z} ${B}>`;for(let i of t)o+=fe(i,r);for(let i of n)o+=fe(i,r);return o+="</w:comments>",{xml:o,paraInfos:r}}function de(e){if(e.length===0)return "";let t=new Map;for(let r of e)t.set(r.commentId,r.lastParaId);let n=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w15:commentsEx ${z} ${B}>`;for(let r of e){let o=`w15:paraId="${r.lastParaId}" w15:done="${r.done?"1":"0"}"`;if(r.parentId!=null){let i=t.get(r.parentId);i&&(o+=` w15:paraIdParent="${i}"`);}n+=`<w15:commentEx ${o} />`;}return n+="</w15:commentsEx>",n}function he(e){if(e.length===0)return "";let t=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w16cid:commentsIds ${z} ${B}>`;for(let n of e)t+=`<w16cid:commentId w16cid:paraId="${n.lastParaId}" w16cid:durableId="${n.durableId}" />`;return t+="</w16cid:commentsIds>",t}function we(e,t){if(e.length===0)return "";let n=new Map;for(let o of t)n.set(o.id,o);let r=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w16cex:commentsExtensible ${z} ${B}>`;for(let o of e){let i=n.get(o.commentId);if(!i?.date)continue;let c=o.durableId,a=(i.date.endsWith("Z")?i.date:i.date+"Z").replace(/\.\d{3}Z$/,"Z");r+=`<w16cex:commentExtensible w16cex:durableId="${c}" w16cex:dateUtc="${a}"/>`;}return r+="</w16cex:commentsExtensible>",r}function H(e){let t=0;for(let n of e.matchAll(/Id="rId(\d+)"/g)){let r=parseInt(n[1],10);r>t&&(t=r);}return t}async function zt(e,t,n){let r=e.package.document.comments;if(!r||r.length===0)return;let{xml:o,paraInfos:i}=me(r);t.file("word/comments.xml",o,{compression:"DEFLATE",compressionOptions:{level:n}});let c=de(i);c&&t.file("word/commentsExtended.xml",c,{compression:"DEFLATE",compressionOptions:{level:n}});let a=he(i);a&&t.file("word/commentsIds.xml",a,{compression:"DEFLATE",compressionOptions:{level:n}});let l=we(i,r);l&&t.file("word/commentsExtensible.xml",l,{compression:"DEFLATE",compressionOptions:{level:n}}),await qt(t,n);}function ge(e){let t=[];for(let n of e)if(n.type==="paragraph"){for(let r of n.content)if(r.type==="run")for(let o of r.content)o.type==="drawing"&&o.image.src?.startsWith("data:")&&t.push(o.image);}else if(n.type==="table")for(let r of n.rows)for(let o of r.cells)t.push(...ge(o.content));return t}var Bt={"image/png":"png","image/jpeg":"jpeg","image/gif":"gif","image/bmp":"bmp","image/tiff":"tiff","image/webp":"webp","image/svg+xml":"svg"};function jt(e){let t=e.match(/^data:([^;]+);base64,(.+)$/);if(!t)throw new Error("Invalid data URL");let n=atob(t[2]),r=new Uint8Array(n.length);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return {data:r.buffer,extension:Bt[t[1]]||"png"}}var Ot=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
3
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"></Relationships>`;function xe(e){return e.startsWith("/")?e.slice(1):`word/${e}`}function Xt(e){let t=[{relsPath:"word/_rels/document.xml.rels",blocks:e.package.document.content}],n=e.package.relationships;if(!n)return t;let r=(o,i)=>{if(o)for(let[c,a]of o.entries()){let l=n.get(c);if(!l||l.type!==i||!l.target)continue;let f=xe(l.target).replace(/^word\//,"");t.push({relsPath:`word/_rels/${f}.rels`,blocks:a.content});}};return r(e.package.headers,i.header),r(e.package.footers,i.footer),t}async function _(e,t){let n=e.file(t);return (n?await n.async("text"):Ot).replace(/<Relationships([^>]*)\/>/,"<Relationships$1></Relationships>")}async function Mt(e,t,n){if(t.size===0)return;let r=e.file("[Content_Types].xml");if(!r)return;let o=await r.async("text"),i=false;for(let c of t)if(!o.includes(`Extension="${c}"`)){let a=nn(c);o=o.replace("</Types>",`<Default Extension="${c}" ContentType="${a}"/></Types>`),i=true;}i&&e.file("[Content_Types].xml",o,{compression:"DEFLATE",compressionOptions:{level:n}});}function Lt(e){let t=0;return e.forEach(n=>{let r=n.match(/^word\/media\/image(\d+)\./);if(r){let o=parseInt(r[1],10);o>t&&(t=o);}}),t}async function Nt(e,t,n){let r=Lt(t),o=new Set;for(let{relsPath:i$1,blocks:c}of e){let a=ge(c);if(a.length===0)continue;let l=await _(t,i$1),u=H(l),f=[];for(let d of a){let{data:g,extension:x}=jt(d.src);r++,u++;let F=`image${r}.${x}`,T=`rId${u}`;t.file(`word/media/${F}`,g,{compression:"DEFLATE",compressionOptions:{level:n}}),f.push(`<Relationship Id="${T}" Type="${i.image}" Target="media/${F}"/>`),o.add(x),d.rId=T;}let m=l.replace("</Relationships>",f.join("")+"</Relationships>");t.file(i$1,m,{compression:"DEFLATE",compressionOptions:{level:n}});}await Mt(t,o,n);}function ye(e){let t=[];for(let n of e)if(n.type==="paragraph")for(let r of n.content)r.type==="hyperlink"&&r.href&&!r.rId&&!r.anchor&&t.push(r);else if(n.type==="table")for(let r of n.rows)for(let o of r.cells)t.push(...ye(o.content));return t}async function Ht(e,t,n){for(let{relsPath:r,blocks:o}of e){let i$1=ye(o);if(i$1.length===0)continue;let c=await _(t,r),a=H(c),l=[];for(let f of i$1){a++;let m=`rId${a}`;l.push(`<Relationship Id="${m}" Type="${i.hyperlink}" Target="${p(f.href)}" TargetMode="External"/>`),f.rId=m;}let u=c.replace("</Relationships>",l.join("")+"</Relationships>");t.file(r,u,{compression:"DEFLATE",compressionOptions:{level:n}});}}async function _t(e,t={}){if(!e.originalBuffer)throw new Error("Cannot repack document: no original buffer for round-trip. Use createDocx() for new documents.");let{compressionLevel:n=6,updateModifiedDate:r=true,modifiedBy:o}=t,i=e,c=await A.default.loadAsync(e.originalBuffer),a=new A.default;for(let[m,d]of Object.entries(c.files)){if(d.dir){a.folder(m.replace(/\/$/,""));continue}let g=await d.async("arraybuffer");a.file(m,g,{compression:"DEFLATE",compressionOptions:{level:n}});}let l=Xt(i);await Nt(l,a,n),await Ht(l,a,n);let u=ae(i);if(a.file("word/document.xml",u,{compression:"DEFLATE",compressionOptions:{level:n}}),en(i,a,n),await Jt(i,a,n),await zt(i,a,n),r){let m="docProps/core.xml",d=c.file(m);if(d){let g=await d.async("text"),x=tn(g,{updateModifiedDate:r,modifiedBy:o});a.file(m,x,{compression:"DEFLATE",compressionOptions:{level:n}});}}return await a.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:n}})}var Wt="application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",Gt="application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",Ut="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml",Zt="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml",Vt="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsIds+xml",Yt="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtensible+xml";async function Jt(e,t,n){let r=e.package.relationships;if(!r)return;let o=[];for(let[u,f]of r){if(!f.target)continue;let m=f.type===i.header?Wt:f.type===i.footer?Gt:null;m&&o.push({rId:u,target:f.target.replace(/^(\/?word\/)/,""),contentType:m,relType:f.type});}if(o.length===0)return;let i$1=t.file("[Content_Types].xml");if(i$1){let u=await i$1.async("text"),f=false;for(let{target:m,contentType:d}of o){let g=`/word/${m}`;u.includes(`PartName="${g}"`)||(u=u.replace("</Types>",`<Override PartName="${g}" ContentType="${d}"/></Types>`),f=true);}f&&t.file("[Content_Types].xml",u,{compression:"DEFLATE",compressionOptions:{level:n}});}let c="word/_rels/document.xml.rels",a=await _(t,c),l=false;for(let{rId:u,relType:f,target:m}of o)a.includes(`Id="${u}"`)||(a=a.replace("</Relationships>",`<Relationship Id="${u}" Type="${f}" Target="${m}"/></Relationships>`),l=true);l&&t.file(c,a,{compression:"DEFLATE",compressionOptions:{level:n}});}async function qt(e,t){let n=[{partName:"/word/comments.xml",contentType:Ut,target:"comments.xml",relType:i.comments},{partName:"/word/commentsExtended.xml",contentType:Zt,target:"commentsExtended.xml",relType:i.commentsExtended},{partName:"/word/commentsIds.xml",contentType:Vt,target:"commentsIds.xml",relType:i.commentsIds},{partName:"/word/commentsExtensible.xml",contentType:Yt,target:"commentsExtensible.xml",relType:i.commentsExtensible}],r=e.file("[Content_Types].xml");if(r){let c=await r.async("text"),a=false;for(let{partName:l,contentType:u}of n)c.includes(l)||(c=c.replace("</Types>",`<Override PartName="${l}" ContentType="${u}"/></Types>`),a=true);a&&e.file("[Content_Types].xml",c,{compression:"DEFLATE",compressionOptions:{level:t}});}let o="word/_rels/document.xml.rels",i$1=e.file(o);if(i$1){let c=await i$1.async("text"),a=false;for(let{target:l,relType:u}of n)if(!c.includes(l)){let f=`rId${H(c)+1}`;c=c.replace("</Relationships>",`<Relationship Id="${f}" Type="${u}" Target="${l}"/></Relationships>`),a=true;}a&&e.file(o,c,{compression:"DEFLATE",compressionOptions:{level:t}});}}async function An(e,t,n={}){let r=await A.default.loadAsync(e);return Kt(r,t,n)}async function Kt(e,t,n={}){let{compressionLevel:r=6}=n;for(let[o,i]of t)e.file(o,i,{compression:"DEFLATE",compressionOptions:{level:r}});return e.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:r}})}function Qt(e){let t=new Map,n=e.package.relationships;if(!n)return t;let r=[{map:e.package.headers,type:i.header},{map:e.package.footers,type:i.footer}];for(let{map:o,type:i}of r)if(o)for(let[c,a]of o.entries()){let l=n.get(c);l&&l.type===i&&l.target&&t.set(xe(l.target),ce(a));}return t}function en(e,t,n){let r={level:n};for(let[o,i]of Qt(e))t.file(o,i,{compression:"DEFLATE",compressionOptions:r});}function tn(e,t){let n=e;if(t.updateModifiedDate){let r=new Date().toISOString();n.includes("<dcterms:modified")?n=n.replace(/<dcterms:modified[^>]*>[^<]*<\/dcterms:modified>/,`<dcterms:modified xsi:type="dcterms:W3CDTF">${r}</dcterms:modified>`):n=n.replace("</cp:coreProperties>",`<dcterms:modified xsi:type="dcterms:W3CDTF">${r}</dcterms:modified></cp:coreProperties>`);}return t.modifiedBy&&(n.includes("<cp:lastModifiedBy")?n=n.replace(/<cp:lastModifiedBy>[^<]*<\/cp:lastModifiedBy>/,`<cp:lastModifiedBy>${p(t.modifiedBy)}</cp:lastModifiedBy>`):n=n.replace("</cp:coreProperties>",`<cp:lastModifiedBy>${p(t.modifiedBy)}</cp:lastModifiedBy></cp:coreProperties>`)),n}function nn(e,t){return {png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",tif:"image/tiff",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp",wmf:"image/x-wmf",emf:"image/x-emf"}[e]||"application/octet-stream"}async function rn(){let e=new A.default;e.file("[Content_Types].xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
4
- <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
5
- <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
6
- <Default Extension="xml" ContentType="application/xml"/>
7
- <Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/>
8
- <Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/>
9
- <Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
10
- <Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
11
- </Types>`),e.file("_rels/.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
12
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
13
- <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/>
14
- <Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>
15
- <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
16
- </Relationships>`),e.file("word/_rels/document.xml.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
17
- <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
18
- <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>
19
- </Relationships>`),e.file("word/document.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
20
- <w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
21
- <w:body>
22
- <w:p>
23
- <w:r>
24
- <w:t></w:t>
25
- </w:r>
26
- </w:p>
27
- <w:sectPr>
28
- <w:pgSz w:w="12240" w:h="15840"/>
29
- <w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/>
30
- </w:sectPr>
31
- </w:body>
32
- </w:document>`),e.file("word/styles.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
33
- <w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
34
- <w:docDefaults>
35
- <w:rPrDefault>
36
- <w:rPr>
37
- <w:rFonts w:ascii="Calibri" w:hAnsi="Calibri"/>
38
- <w:sz w:val="22"/>
39
- </w:rPr>
40
- </w:rPrDefault>
41
- <w:pPrDefault>
42
- <w:pPr>
43
- <w:spacing w:after="200" w:line="276" w:lineRule="auto"/>
44
- </w:pPr>
45
- </w:pPrDefault>
46
- </w:docDefaults>
47
- <w:style w:type="paragraph" w:default="1" w:styleId="Normal">
48
- <w:name w:val="Normal"/>
49
- </w:style>
50
- </w:styles>`);let t=new Date().toISOString();return e.file("docProps/core.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
51
- <cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
52
- <dc:creator>EigenPal DOCX Editor</dc:creator>
53
- <dcterms:created xsi:type="dcterms:W3CDTF">${t}</dcterms:created>
54
- <dcterms:modified xsi:type="dcterms:W3CDTF">${t}</dcterms:modified>
55
- </cp:coreProperties>`),e.file("docProps/app.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
56
- <Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties">
57
- <Application>EigenPal DOCX Editor</Application>
58
- <AppVersion>1.0.0</AppVersion>
59
- </Properties>`),e.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:6}})}async function Dn(e){let t=await rn(),n={...e,originalBuffer:t};return _t(n)}export{It as a,Et as b,ae as c,me as d,de as e,he as f,we as g,H as h,_t as i,Ut as j,Zt as k,Vt as l,Yt as m,An as n,Kt as o,Qt as p,tn as q,Dn as r};