@eigenpal/docx-js-editor 0.0.7 → 0.0.9

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 (52) hide show
  1. package/README.md +52 -14
  2. package/dist/{chunk-FOU7PS3K.cjs → chunk-A7VY2V4X.cjs} +1 -1
  3. package/dist/chunk-GQ4JYQWC.js +58 -0
  4. package/dist/{chunk-ZRXLWSRP.cjs → chunk-H3JNHCD7.cjs} +4 -4
  5. package/dist/{chunk-VFBM3YKJ.js → chunk-L2UUZRZI.js} +4 -4
  6. package/dist/{chunk-AQ35GWDV.js → chunk-MMJD2DLL.js} +1 -1
  7. package/dist/chunk-PM4Y7OFN.js +12 -0
  8. package/dist/{chunk-PYAIJMEG.cjs → chunk-QOIY4Y6N.cjs} +2 -2
  9. package/dist/chunk-QYKJKSKZ.cjs +58 -0
  10. package/dist/{chunk-NZ7XUW4I.cjs → chunk-S6FZ7HL6.js} +1 -1
  11. package/dist/{chunk-AEANV5BR.js → chunk-TPUJJJWA.js} +1 -1
  12. package/dist/chunk-TRAQI6RX.cjs +12 -0
  13. package/dist/chunk-Y37VT37I.cjs +1 -0
  14. package/dist/{colorResolver-CQcFBxHC.d.ts → colorResolver-BNj-uZ58.d.ts} +1 -1
  15. package/dist/{colorResolver-Di-JRsr9.d.cts → colorResolver-DiMquGWR.d.cts} +1 -1
  16. package/dist/core-plugins.cjs +1 -1
  17. package/dist/core-plugins.d.cts +3 -3
  18. package/dist/core-plugins.d.ts +3 -3
  19. package/dist/core-plugins.js +1 -1
  20. package/dist/executor-44OB3DFD.js +1 -0
  21. package/dist/executor-U3BZPPGN.cjs +1 -0
  22. package/dist/headless.cjs +2 -2
  23. package/dist/headless.d.cts +4 -4
  24. package/dist/headless.d.ts +4 -4
  25. package/dist/headless.js +2 -2
  26. package/dist/index.cjs +26 -27
  27. package/dist/index.css +1 -1
  28. package/dist/index.d.cts +90 -152
  29. package/dist/index.d.ts +90 -152
  30. package/dist/index.js +26 -27
  31. package/dist/mcp-cli.js +21 -20
  32. package/dist/mcp.cjs +12 -12
  33. package/dist/mcp.d.cts +2 -2
  34. package/dist/mcp.d.ts +2 -2
  35. package/dist/mcp.js +12 -12
  36. package/dist/{registry-CrAzNdUO.d.cts → registry-BUTMLqSj.d.cts} +1 -1
  37. package/dist/{registry-aux2uuQs.d.ts → registry-CzqAPdui.d.ts} +1 -1
  38. package/dist/selectionRects-I5JVL73G.cjs +1 -0
  39. package/dist/selectionRects-LO3FJT47.js +1 -0
  40. package/dist/styles.css +1 -1
  41. package/dist/{types-BnShY2aQ.d.ts → types-BALm1KBi.d.cts} +3 -1
  42. package/dist/{types-BnShY2aQ.d.cts → types-BALm1KBi.d.ts} +3 -1
  43. package/package.json +10 -5
  44. package/dist/chunk-2CFVFSUH.js +0 -57
  45. package/dist/chunk-CDSUWDYP.cjs +0 -11
  46. package/dist/chunk-TL3YTVN2.cjs +0 -57
  47. package/dist/chunk-W2TDS3UO.js +0 -1
  48. package/dist/chunk-ZZNWTYMW.js +0 -11
  49. package/dist/executor-7DZMHPUF.js +0 -1
  50. package/dist/executor-FSMRGT73.cjs +0 -1
  51. package/dist/selectionRects-5TGQE33Q.cjs +0 -1
  52. package/dist/selectionRects-JSPKYXPU.js +0 -1
@@ -1 +1 @@
1
- 'use strict';var K="Calibri";var _=null;function W(){if(!_){let e=typeof document<"u"?document.createElement("canvas"):null;if(!e)throw new Error("Canvas not available. Ensure this runs in a DOM environment.");if(_=e.getContext("2d"),!_)throw new Error("Failed to get 2D context from canvas")}return _}function ce(){_=null;}var oe='"Segoe UI", Arial, sans-serif';function U(e){let n=[];e.italic&&n.push("italic"),e.bold&&n.push("bold");let c=e.fontSize??11,r=J(c);n.push(`${r}px`);let a=e.fontFamily??K,t=a.includes(" ")?`"${a}"`:a;return n.push(`${t}, ${oe}`),n.join(" ")}function ae(e){let n=e.fontSize??11,c=e.fontFamily??K,r=J(n),a=r*.8,t=r*.2,s=r*1.15;try{let i=W();i.font=U(e);let o=i.measureText("Hg");typeof o.actualBoundingBoxAscent=="number"&&typeof o.actualBoundingBoxDescent=="number"&&(a=o.actualBoundingBoxAscent,t=o.actualBoundingBoxDescent),typeof o.fontBoundingBoxAscent=="number"&&typeof o.fontBoundingBoxDescent=="number"&&(s=o.fontBoundingBoxAscent+o.fontBoundingBoxDescent);}catch{}return s=Math.max(s,a+t),{fontSize:n,ascent:a,descent:t,lineHeight:s,fontFamily:c}}function se(e,n){if(!e)return 0;let c=W();c.font=U(n);let r=c.measureText(e),a=r.width,t=(r.actualBoundingBoxLeft||0)+(r.actualBoundingBoxRight||0),s=Math.max(a,t);return n.letterSpacing&&e.length>1&&(s+=n.letterSpacing*(e.length-1)),e.length>1&&(s+=(e.length-1)*.15),s}function G(e,n){let c=ae(n);if(!e)return {width:0,charWidths:[],metrics:c};let r=W();r.font=U(n);let a=n.letterSpacing??0,t=[],s=0;for(let i=0;i<e.length;i++){let o=e[i],m=r.measureText(o).width;a&&i<e.length-1&&(m+=a),t.push(m),s+=m;}return {width:s,charWidths:t,metrics:c}}function le(e,n){if(n.length===0||e<=0)return 0;let c=0;for(let r=0;r<n.length;r++){let a=n[r],t=c+a/2;if(e<=t)return r;c+=a;}return n.length}function J(e){return e*96/72}function $(e,n){let c=e.pageGap??0,r=0;for(let a=0;a<n&&a<e.pages.length;a++){let s=e.pages[a].size?.h??e.pageSize.h;r+=s+c;}return r}function Q(e,n){return e.findIndex(c=>c.id===n)}function ie(e,n){let c=0;for(let r=e.fromLine;r<e.toLine&&r<n.lines.length;r++)c+=n.lines[r].lineHeight;return c}function ge(e,n,c,r){let a=[...e.page.fragments].sort((t,s)=>{let i=t.y-s.y;return Math.abs(i)>.5?i:t.x-s.x});for(let t of a){let s=Q(n,t.blockId);if(s===-1)continue;let i=n[s],o=c[s];if(!i||!o)continue;let g;if(t.kind==="paragraph"){if(i.kind!=="paragraph"||o.kind!=="paragraph")continue;g=ie(t,o);}else if(t.kind==="table")g=t.height;else if(t.kind==="image")g=t.height;else continue;let m=r.x>=t.x&&r.x<=t.x+t.width,l=r.y>=t.y&&r.y<=t.y+g;if(m&&l)return {fragment:t,block:i,measure:o,pageIndex:e.pageIndex,localX:r.x-t.x,localY:r.y-t.y}}return null}function fe(e,n,c,r){for(let a of e.page.fragments){if(a.kind!=="table")continue;let t=a,s=r.x>=t.x&&r.x<=t.x+t.width,i=r.y>=t.y&&r.y<=t.y+t.height;if(!s||!i)continue;let o=Q(n,t.blockId);if(o===-1)continue;let g=n[o],m=c[o];if(!g||g.kind!=="table"||!m||m.kind!=="table")continue;let l=g,f=m,p=r.x-t.x,M=r.y-t.y,b=0,d=-1;if(f.rows.length===0||l.rows.length===0)continue;for(let u=t.fromRow;u<t.toRow&&u<f.rows.length;u++){let w=f.rows[u];if(M>=b&&M<b+w.height){d=u;break}b+=w.height;}if(d===-1&&(d=Math.min(t.toRow-1,f.rows.length-1),d<t.fromRow))continue;let h=f.rows[d],T=l.rows[d];if(!h||!T)continue;let x=0,k=-1;if(h.cells.length===0||T.cells.length===0)continue;for(let u=0;u<h.cells.length;u++){let w=h.cells[u];if(p>=x&&p<x+w.width){k=u;break}x+=w.width;}if(k===-1&&(k=h.cells.length-1,k<0))continue;let I=h.cells[k],B=T.cells[k];if(!I||!B)continue;let F=0;for(let u=t.fromRow;u<d;u++)F+=f.rows[u]?.height??0;let y=0;for(let u=0;u<k;u++)y+=h.cells[u]?.width??0;let S,P;if(B.blocks&&B.blocks.length>0){let u=B.blocks[0],w=I.blocks[0];u.kind==="paragraph"&&w?.kind==="paragraph"&&(S=u,P=w);}let R=p-y,H=M-F;return {fragment:t,block:l,measure:f,pageIndex:e.pageIndex,rowIndex:d,colIndex:k,cellBlock:S,cellMeasure:P,cellLocalX:Math.max(0,R),cellLocalY:Math.max(0,H)}}return null}function V(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function Z(e,n){return e.findIndex(c=>c.id===n)}function z(e,n){let r=(e.pmStart??0)+1,a=0,t;for(let o=0;o<e.runs.length&&o<=n.toRun;o++){let g=e.runs[o];if(g){if(o<n.fromRun)g.kind==="text"?a+=(g.text??"").length:a+=1;else if(o===n.fromRun){a+=n.fromChar,t=r+a;break}}}t===void 0&&(t=r);let s=0;for(let o=n.fromRun;o<=n.toRun&&o<e.runs.length;o++){let g=e.runs[o];if(g)if(g.kind==="text"){let m=g.text??"",l=o===n.fromRun?n.fromChar:0,f=o===n.toRun?n.toChar:m.length;s+=f-l;}else s+=1;}let i=t+s;return {pmStart:t,pmEnd:i}}function ee(e,n,c,r){let a=[];for(let t=0;t<n.lines.length;t++){let s=n.lines[t],i=z(e,s);i.pmStart===void 0||i.pmEnd===void 0||i.pmEnd>c&&i.pmStart<r&&a.push({line:s,index:t});}return a}function X(e,n,c){let r=z(e,n);return r.pmStart===void 0?0:Math.max(0,c-r.pmStart)}function A(e,n,c,r){let a=0,t=0;for(let s=n.fromRun;s<=n.toRun&&s<e.runs.length;s++){let i=e.runs[s];if(i){if(i.kind==="tab"){let o=i.width??48;if(t+1>=c)return c<=t?a:a+o;a+=o,t+=1;continue}if(i.kind==="image"){let o=i.width;if(t+1>=c)return c<=t?a:a+o;a+=o,t+=1;continue}if(i.kind==="lineBreak"){if(c<=t)return a;t+=1;continue}if(i.kind==="text"){let o=i.text??"",g=s===n.fromRun,m=s===n.toRun,l=g?n.fromChar:0,f=m?n.toChar:o.length,p=o.slice(l,f);if(t+p.length>=c){let d=c-t,h=V(i),T=G(p.slice(0,d),h);return a+T.width}let M=V(i),b=G(p,M);a+=b.width,t+=p.length;}}}return a}function Y(e,n){let c=0;for(let r=0;r<n&&r<e.lines.length;r++)c+=e.lines[r].lineHeight;return c}function de(e,n,c,r,a){if(r===a)return [];let t=Math.min(r,a),s=Math.max(r,a),i=[];for(let o=0;o<e.pages.length;o++){let g=e.pages[o],m=$(e,o);for(let l of g.fragments){if(l.kind==="paragraph"){let f=Z(n,l.blockId);if(f===-1)continue;let p=n[f],M=c[f];if(!p||p.kind!=="paragraph"||!M||M.kind!=="paragraph")continue;let b=p,d=M,h=l,T=ee(b,d,t,s);for(let{line:x,index:k}of T){if(k<h.fromLine||k>=h.toLine)continue;let I=z(b,x);if(I.pmStart===void 0||I.pmEnd===void 0)continue;let B=Math.max(I.pmStart,t),F=Math.min(I.pmEnd,s);if(B>=F)continue;let y=X(b,x,B),S=X(b,x,F),P=b.attrs?.indent,R=P?.left??0,H=P?.right??0,u=Math.max(0,l.width-R-H),w=A(b,x,y),D=A(b,x,S),C=b.attrs?.alignment??"left",L=0;C==="center"?L=Math.max(0,(u-x.width)/2):C==="right"&&(L=Math.max(0,u-x.width));let v=Y(d,k)-Y(d,h.fromLine),E=l.x+R+L+Math.min(w,D),N=Math.max(1,Math.abs(D-w)),O=l.y+v;i.push({x:E,y:O+m,width:N,height:x.lineHeight,pageIndex:o});}}if(l.kind==="table"){let f=Z(n,l.blockId);if(f===-1)continue;let p=n[f],M=c[f];if(!p||p.kind!=="table"||!M||M.kind!=="table")continue;let b=p,d=M,h=l,T=0;for(let x=h.fromRow;x<h.toRow&&x<b.rows.length;x++){let k=b.rows[x],I=d.rows[x];if(!k||!I)continue;let B=0;for(let F=0;F<k.cells.length;F++){let y=k.cells[F],S=I.cells[F];if(!(!y||!S)){for(let P=0;P<y.blocks.length;P++){let R=y.blocks[P],H=S.blocks[P];if(!R||R.kind!=="paragraph"||!H||H.kind!=="paragraph")continue;let u=R,w=H,D=ee(u,w,t,s),C=0;for(let{line:L,index:v}of D){let E=z(u,L);if(E.pmStart===void 0||E.pmEnd===void 0)continue;let N=Math.max(E.pmStart,t),O=Math.min(E.pmEnd,s);if(N>=O)continue;let te=X(u,L,N),ne=X(u,L,O),j=A(u,L,te,S.width),q=A(u,L,ne,S.width),re=Y(w,v);i.push({x:h.x+B+Math.min(j,q),y:h.y+T+C+re+m,width:Math.max(1,Math.abs(q-j)),height:L.lineHeight,pageIndex:o});}C+=w.totalHeight;}B+=S.width;}}T+=I.height;}}if(l.kind==="image"){let f=l.pmStart??0;(l.pmEnd??f+1)>t&&f<s&&i.push({x:l.x,y:l.y+m,width:l.width,height:l.height,pageIndex:o});}}}return i}function xe(e,n,c,r){for(let a=0;a<e.pages.length;a++){let t=e.pages[a],s=$(e,a);for(let i of t.fragments){if(i.kind==="paragraph"){let o=Z(n,i.blockId);if(o===-1)continue;let g=n[o],m=c[o];if(!g||g.kind!=="paragraph"||!m||m.kind!=="paragraph")continue;let l=g,f=m,p=i,M=l.pmStart??0,b=l.pmEnd??M;if(r<M||r>b)continue;for(let d=p.fromLine;d<p.toLine;d++){let h=f.lines[d];if(!h)continue;let T=z(l,h);if(!(T.pmStart===void 0||T.pmEnd===void 0)&&r>=T.pmStart&&r<=T.pmEnd){let x=X(l,h,r),k=l.attrs?.indent,I=k?.left??0,B=k?.right??0,F=Math.max(0,i.width-I-B),y=A(l,h,x),S=l.attrs?.alignment??"left",P=0;S==="center"?P=Math.max(0,(F-h.width)/2):S==="right"&&(P=Math.max(0,F-h.width));let R=Y(f,d)-Y(f,p.fromLine);return {x:i.x+I+P+y,y:i.y+R+s,height:h.lineHeight,pageIndex:a}}}}if(i.kind==="image"){let o=i.pmStart??0,g=i.pmEnd??o+1;if(r>=o&&r<=g){let m=r===o?0:i.width;return {x:i.x+m,y:i.y+s,height:i.height,pageIndex:a}}}}}return null}function be(e){return e.length<=1?false:new Set(e.map(c=>c.pageIndex)).size>1}function ke(e){let n=new Map;for(let c of e){let r=n.get(c.pageIndex)??[];r.push(c),n.set(c.pageIndex,r);}return n}exports.a=ce;exports.b=ae;exports.c=se;exports.d=G;exports.e=le;exports.f=J;exports.g=ge;exports.h=fe;exports.i=de;exports.j=xe;exports.k=be;exports.l=ke;
1
+ var K="Calibri";var _=null;function W(){if(!_){let e=typeof document<"u"?document.createElement("canvas"):null;if(!e)throw new Error("Canvas not available. Ensure this runs in a DOM environment.");if(_=e.getContext("2d"),!_)throw new Error("Failed to get 2D context from canvas")}return _}function ce(){_=null;}var oe='"Segoe UI", Arial, sans-serif';function U(e){let n=[];e.italic&&n.push("italic"),e.bold&&n.push("bold");let c=e.fontSize??11,r=J(c);n.push(`${r}px`);let a=e.fontFamily??K,t=a.includes(" ")?`"${a}"`:a;return n.push(`${t}, ${oe}`),n.join(" ")}function ae(e){let n=e.fontSize??11,c=e.fontFamily??K,r=J(n),a=r*.8,t=r*.2,s=r*1.15;try{let i=W();i.font=U(e);let o=i.measureText("Hg");typeof o.actualBoundingBoxAscent=="number"&&typeof o.actualBoundingBoxDescent=="number"&&(a=o.actualBoundingBoxAscent,t=o.actualBoundingBoxDescent),typeof o.fontBoundingBoxAscent=="number"&&typeof o.fontBoundingBoxDescent=="number"&&(s=o.fontBoundingBoxAscent+o.fontBoundingBoxDescent);}catch{}return s=Math.max(s,a+t),{fontSize:n,ascent:a,descent:t,lineHeight:s,fontFamily:c}}function se(e,n){if(!e)return 0;let c=W();c.font=U(n);let a=c.measureText(e).width;return n.letterSpacing&&e.length>1&&(a+=n.letterSpacing*(e.length-1)),a}function G(e,n){let c=ae(n);if(!e)return {width:0,charWidths:[],metrics:c};let r=W();r.font=U(n);let a=n.letterSpacing??0,t=[],s=0;for(let i=0;i<e.length;i++){let o=e[i],m=r.measureText(o).width;a&&i<e.length-1&&(m+=a),t.push(m),s+=m;}return {width:s,charWidths:t,metrics:c}}function le(e,n){if(n.length===0||e<=0)return 0;let c=0;for(let r=0;r<n.length;r++){let a=n[r],t=c+a/2;if(e<=t)return r;c+=a;}return n.length}function J(e){return e*96/72}function $(e,n){let c=e.pageGap??0,r=0;for(let a=0;a<n&&a<e.pages.length;a++){let s=e.pages[a].size?.h??e.pageSize.h;r+=s+c;}return r}function Q(e,n){return e.findIndex(c=>c.id===n)}function ie(e,n){let c=0;for(let r=e.fromLine;r<e.toLine&&r<n.lines.length;r++)c+=n.lines[r].lineHeight;return c}function ge(e,n,c,r){let a=[...e.page.fragments].sort((t,s)=>{let i=t.y-s.y;return Math.abs(i)>.5?i:t.x-s.x});for(let t of a){let s=Q(n,t.blockId);if(s===-1)continue;let i=n[s],o=c[s];if(!i||!o)continue;let g;if(t.kind==="paragraph"){if(i.kind!=="paragraph"||o.kind!=="paragraph")continue;g=ie(t,o);}else if(t.kind==="table")g=t.height;else if(t.kind==="image")g=t.height;else continue;let m=r.x>=t.x&&r.x<=t.x+t.width,l=r.y>=t.y&&r.y<=t.y+g;if(m&&l)return {fragment:t,block:i,measure:o,pageIndex:e.pageIndex,localX:r.x-t.x,localY:r.y-t.y}}return null}function fe(e,n,c,r){for(let a of e.page.fragments){if(a.kind!=="table")continue;let t=a,s=r.x>=t.x&&r.x<=t.x+t.width,i=r.y>=t.y&&r.y<=t.y+t.height;if(!s||!i)continue;let o=Q(n,t.blockId);if(o===-1)continue;let g=n[o],m=c[o];if(!g||g.kind!=="table"||!m||m.kind!=="table")continue;let l=g,f=m,p=r.x-t.x,M=r.y-t.y,b=0,d=-1;if(f.rows.length===0||l.rows.length===0)continue;for(let u=t.fromRow;u<t.toRow&&u<f.rows.length;u++){let w=f.rows[u];if(M>=b&&M<b+w.height){d=u;break}b+=w.height;}if(d===-1&&(d=Math.min(t.toRow-1,f.rows.length-1),d<t.fromRow))continue;let h=f.rows[d],T=l.rows[d];if(!h||!T)continue;let x=0,k=-1;if(h.cells.length===0||T.cells.length===0)continue;for(let u=0;u<h.cells.length;u++){let w=h.cells[u];if(p>=x&&p<x+w.width){k=u;break}x+=w.width;}if(k===-1&&(k=h.cells.length-1,k<0))continue;let I=h.cells[k],y=T.cells[k];if(!I||!y)continue;let F=0;for(let u=t.fromRow;u<d;u++)F+=f.rows[u]?.height??0;let B=0;for(let u=0;u<k;u++)B+=h.cells[u]?.width??0;let S,P;if(y.blocks&&y.blocks.length>0){let u=y.blocks[0],w=I.blocks[0];u.kind==="paragraph"&&w?.kind==="paragraph"&&(S=u,P=w);}let R=p-B,H=M-F;return {fragment:t,block:l,measure:f,pageIndex:e.pageIndex,rowIndex:d,colIndex:k,cellBlock:S,cellMeasure:P,cellLocalX:Math.max(0,R),cellLocalY:Math.max(0,H)}}return null}function V(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function Z(e,n){return e.findIndex(c=>c.id===n)}function z(e,n){let r=(e.pmStart??0)+1,a=0,t;for(let o=0;o<e.runs.length&&o<=n.toRun;o++){let g=e.runs[o];if(g){if(o<n.fromRun)g.kind==="text"?a+=(g.text??"").length:a+=1;else if(o===n.fromRun){a+=n.fromChar,t=r+a;break}}}t===void 0&&(t=r);let s=0;for(let o=n.fromRun;o<=n.toRun&&o<e.runs.length;o++){let g=e.runs[o];if(g)if(g.kind==="text"){let m=g.text??"",l=o===n.fromRun?n.fromChar:0,f=o===n.toRun?n.toChar:m.length;s+=f-l;}else s+=1;}let i=t+s;return {pmStart:t,pmEnd:i}}function ee(e,n,c,r){let a=[];for(let t=0;t<n.lines.length;t++){let s=n.lines[t],i=z(e,s);i.pmStart===void 0||i.pmEnd===void 0||i.pmEnd>c&&i.pmStart<r&&a.push({line:s,index:t});}return a}function X(e,n,c){let r=z(e,n);return r.pmStart===void 0?0:Math.max(0,c-r.pmStart)}function A(e,n,c,r){let a=0,t=0;for(let s=n.fromRun;s<=n.toRun&&s<e.runs.length;s++){let i=e.runs[s];if(i){if(i.kind==="tab"){let o=i.width??48;if(t+1>=c)return c<=t?a:a+o;a+=o,t+=1;continue}if(i.kind==="image"){let o=i.width;if(t+1>=c)return c<=t?a:a+o;a+=o,t+=1;continue}if(i.kind==="lineBreak"){if(c<=t)return a;t+=1;continue}if(i.kind==="text"){let o=i.text??"",g=s===n.fromRun,m=s===n.toRun,l=g?n.fromChar:0,f=m?n.toChar:o.length,p=o.slice(l,f);if(t+p.length>=c){let d=c-t,h=V(i),T=G(p.slice(0,d),h);return a+T.width}let M=V(i),b=G(p,M);a+=b.width,t+=p.length;}}}return a}function Y(e,n){let c=0;for(let r=0;r<n&&r<e.lines.length;r++)c+=e.lines[r].lineHeight;return c}function de(e,n,c,r,a){if(r===a)return [];let t=Math.min(r,a),s=Math.max(r,a),i=[];for(let o=0;o<e.pages.length;o++){let g=e.pages[o],m=$(e,o);for(let l of g.fragments){if(l.kind==="paragraph"){let f=Z(n,l.blockId);if(f===-1)continue;let p=n[f],M=c[f];if(!p||p.kind!=="paragraph"||!M||M.kind!=="paragraph")continue;let b=p,d=M,h=l,T=ee(b,d,t,s);for(let{line:x,index:k}of T){if(k<h.fromLine||k>=h.toLine)continue;let I=z(b,x);if(I.pmStart===void 0||I.pmEnd===void 0)continue;let y=Math.max(I.pmStart,t),F=Math.min(I.pmEnd,s);if(y>=F)continue;let B=X(b,x,y),S=X(b,x,F),P=b.attrs?.indent,R=P?.left??0,H=P?.right??0,u=Math.max(0,l.width-R-H),w=A(b,x,B),D=A(b,x,S),C=b.attrs?.alignment??"left",L=0;C==="center"?L=Math.max(0,(u-x.width)/2):C==="right"&&(L=Math.max(0,u-x.width));let v=Y(d,k)-Y(d,h.fromLine),E=l.x+R+L+Math.min(w,D),N=Math.max(1,Math.abs(D-w)),O=l.y+v;i.push({x:E,y:O+m,width:N,height:x.lineHeight,pageIndex:o});}}if(l.kind==="table"){let f=Z(n,l.blockId);if(f===-1)continue;let p=n[f],M=c[f];if(!p||p.kind!=="table"||!M||M.kind!=="table")continue;let b=p,d=M,h=l,T=0;for(let x=h.fromRow;x<h.toRow&&x<b.rows.length;x++){let k=b.rows[x],I=d.rows[x];if(!k||!I)continue;let y=0;for(let F=0;F<k.cells.length;F++){let B=k.cells[F],S=I.cells[F];if(!(!B||!S)){for(let P=0;P<B.blocks.length;P++){let R=B.blocks[P],H=S.blocks[P];if(!R||R.kind!=="paragraph"||!H||H.kind!=="paragraph")continue;let u=R,w=H,D=ee(u,w,t,s),C=0;for(let{line:L,index:v}of D){let E=z(u,L);if(E.pmStart===void 0||E.pmEnd===void 0)continue;let N=Math.max(E.pmStart,t),O=Math.min(E.pmEnd,s);if(N>=O)continue;let te=X(u,L,N),ne=X(u,L,O),j=A(u,L,te,S.width),q=A(u,L,ne,S.width),re=Y(w,v);i.push({x:h.x+y+Math.min(j,q),y:h.y+T+C+re+m,width:Math.max(1,Math.abs(q-j)),height:L.lineHeight,pageIndex:o});}C+=w.totalHeight;}y+=S.width;}}T+=I.height;}}if(l.kind==="image"){let f=l.pmStart??0;(l.pmEnd??f+1)>t&&f<s&&i.push({x:l.x,y:l.y+m,width:l.width,height:l.height,pageIndex:o});}}}return i}function xe(e,n,c,r){for(let a=0;a<e.pages.length;a++){let t=e.pages[a],s=$(e,a);for(let i of t.fragments){if(i.kind==="paragraph"){let o=Z(n,i.blockId);if(o===-1)continue;let g=n[o],m=c[o];if(!g||g.kind!=="paragraph"||!m||m.kind!=="paragraph")continue;let l=g,f=m,p=i,M=l.pmStart??0,b=l.pmEnd??M;if(r<M||r>b)continue;for(let d=p.fromLine;d<p.toLine;d++){let h=f.lines[d];if(!h)continue;let T=z(l,h);if(!(T.pmStart===void 0||T.pmEnd===void 0)&&r>=T.pmStart&&r<=T.pmEnd){let x=X(l,h,r),k=l.attrs?.indent,I=k?.left??0,y=k?.right??0,F=Math.max(0,i.width-I-y),B=A(l,h,x),S=l.attrs?.alignment??"left",P=0;S==="center"?P=Math.max(0,(F-h.width)/2):S==="right"&&(P=Math.max(0,F-h.width));let R=Y(f,d)-Y(f,p.fromLine);return {x:i.x+I+P+B,y:i.y+R+s,height:h.lineHeight,pageIndex:a}}}}if(i.kind==="image"){let o=i.pmStart??0,g=i.pmEnd??o+1;if(r>=o&&r<=g){let m=r===o?0:i.width;return {x:i.x+m,y:i.y+s,height:i.height,pageIndex:a}}}}}return null}function be(e){return e.length<=1?false:new Set(e.map(c=>c.pageIndex)).size>1}function ke(e){let n=new Map;for(let c of e){let r=n.get(c.pageIndex)??[];r.push(c),n.set(c.pageIndex,r);}return n}export{ce as a,ae as b,se as c,G as d,le as e,J as f,ge as g,fe as h,de as i,xe as j,be as k,ke as l};
@@ -1,4 +1,4 @@
1
- import {a,n}from'./chunk-VFBM3YKJ.js';import {d,e as e$1}from'./chunk-2CFVFSUH.js';import {m as m$1}from'./chunk-ZZNWTYMW.js';import {b,a as a$1}from'./chunk-AQ35GWDV.js';import {e}from'./chunk-3IYNTJO5.js';var W={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"},J={black:"000000",blue:"0000FF",cyan:"00FFFF",darkBlue:"00008B",darkCyan:"008B8B",darkGray:"A9A9A9",darkGreen:"006400",darkMagenta:"8B008B",darkRed:"8B0000",darkYellow:"808000",green:"00FF00",lightGray:"D3D3D3",magenta:"FF00FF",red:"FF0000",white:"FFFFFF",yellow:"FFFF00",none:""},w={dk1:"dk1",lt1:"lt1",dk2:"dk2",lt2:"lt2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hlink:"hlink",folHlink:"folHlink",dark1:"dk1",light1:"lt1",dark2:"dk2",light2:"lt2",hyperlink:"hlink",followedHyperlink:"folHlink",background1:"lt1",text1:"dk1",background2:"lt2",text2:"dk2",tx1:"dk1",tx2:"dk2",bg1:"lt1",bg2:"lt2"};function $(n){if(!n)return 1;let t=parseInt(n,16);return isNaN(t)?1:t/255}function C(n){let t=n.padStart(6,"0").slice(0,6),e=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),a=parseInt(t.slice(4,6),16);return {r:isNaN(e)?0:e,g:isNaN(r)?0:r,b:isNaN(a)?0:a}}function E(n,t,e){let r=a=>Math.max(0,Math.min(255,Math.round(a))).toString(16).padStart(2,"0");return `${r(n)}${r(t)}${r(e)}`.toUpperCase()}function U(n,t,e){n/=255,t/=255,e/=255;let r=Math.max(n,t,e),a=Math.min(n,t,e),o=(r+a)/2;if(r===a)return {h:0,s:0,l:o};let i=r-a,s=o>.5?i/(2-r-a):i/(r+a),c;switch(r){case n:c=((t-e)/i+(t<e?6:0))/6;break;case t:c=((e-n)/i+2)/6;break;case e:c=((n-t)/i+4)/6;break;default:c=0;}return {h:c*360,s,l:o}}function G(n,t,e){if(n=n/360,t===0){let i=Math.round(e*255);return {r:i,g:i,b:i}}let r=(i,s,c)=>(c<0&&(c+=1),c>1&&(c-=1),c<1/6?i+(s-i)*6*c:c<1/2?s:c<2/3?i+(s-i)*(2/3-c)*6:i),a=e<.5?e*(1+t):e+t-e*t,o=2*e-a;return {r:Math.round(r(o,a,n+1/3)*255),g:Math.round(r(o,a,n)*255),b:Math.round(r(o,a,n-1/3)*255)}}function q(n,t){if(t<=0||t>=1)return t>=1?"FFFFFF":n;let e=C(n),r=U(e.r,e.g,e.b);r.l=r.l+(1-r.l)*t;let a=G(r.h,r.s,r.l);return E(a.r,a.g,a.b)}function X(n,t){if(t<=0||t>=1)return t<=0?"000000":n;let e=C(n),r=U(e.r,e.g,e.b);r.l=r.l*t;let a=G(r.h,r.s,r.l);return E(a.r,a.g,a.b)}function Q(n,t){let e=w[t]??t,r=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],a=o=>r.includes(o);return n?.colorScheme?a(e)?n.colorScheme[e]??W[e]??"000000":"000000":a(e)?W[e]??"000000":"000000"}function K(n){if(!n)return null;let t=n.toLowerCase();return w[n]??w[t]??null}function g(n,t,e="000000"){if(!n)return `#${e}`;if(n.auto)return `#${e}`;let r;if(n.themeColor){let a=K(n.themeColor);if(a?r=Q(t,a):r=n.rgb??e,n.themeTint){let o=$(n.themeTint);r=q(r,o);}else if(n.themeShade){let o=$(n.themeShade);r=X(r,o);}}else n.rgb?r=n.rgb:r=e;return `#${r.toUpperCase().replace(/^#/,"")}`}function Et(n){if(!n||n==="none")return "";let t=J[n];return t?`#${t}`:""}function Bt(n,t){return n?n.auto?"transparent":g(n,t):""}function vt(n,t){if(!n)return false;if(n.auto)return true;let r=g(n,t).replace(/^#/,"").toLowerCase(),a=C(r);return (a.r+a.g+a.b)/3<20}function Ot(n,t){if(!n)return false;let r=g(n,t).replace(/^#/,"").toLowerCase(),a=C(r);return (a.r+a.g+a.b)/3>235}function Nt(n,t){if(!n)return "#000000";let r=g(n,t).replace(/^#/,""),a=C(r);return (.299*a.r+.587*a.g+.114*a.b)/255>.5?"#000000":"#FFFFFF"}function Vt(n){if(!n)return;let t=n.trim();if(t.toLowerCase()==="auto")return {auto:true};let e=K(t);if(e)return {themeColor:e};let r=t.replace(/^#/,"").toUpperCase();return /^[0-9A-F]{6}$/i.test(r)?{rgb:r}:/^[0-9A-F]{3}$/i.test(r)?{rgb:r.split("").map(o=>o+o).join("")}:{rgb:r.padStart(6,"0").slice(0,6)}}function Lt(n,t,e){let r={themeColor:n};return t!==void 0&&t>0&&t<1&&(r.themeTint=Math.round(t*255).toString(16).toUpperCase().padStart(2,"0")),e!==void 0&&e>0&&e<1&&(r.themeShade=Math.round(e*255).toString(16).toUpperCase().padStart(2,"0")),r}function Mt(n){return {rgb:n.replace(/^#/,"").toUpperCase()}}function jt(n,t,e){let a=g(n,t).replace(/^#/,""),o=1-e/100;return `#${X(a,o)}`}function zt(n,t,e){let a=g(n,t).replace(/^#/,""),o=e/100;return `#${q(a,o)}`}function Wt(n,t,e,r){let a=g(n,r).replace(/^#/,""),o=g(t,r).replace(/^#/,""),i=C(a),s=C(o),c={r:Math.round(i.r*(1-e)+s.r*e),g:Math.round(i.g*(1-e)+s.g*e),b:Math.round(i.b*(1-e)+s.b*e)};return `#${E(c.r,c.g,c.b)}`}function $t(n,t,e){if(!n&&!t)return true;if(!n||!t)return false;let r=g(n,e).toUpperCase(),a=g(t,e).toUpperCase();return r===a}function Gt(n){return n/1440*96}function qt(n){return n/96*1440}function Xt(n){return n/914400*96}function Kt(n){return n/96*914400}function Yt(n){return n/914400*1440}function Jt(n){return n/1440*914400}function Qt(n){return n/72*96}function Zt(n){return n/144*96}function te(n){return n/2}function ee(n){return n/576*96}function Z(n,t=2){let e=Math.pow(10,t);return Math.round(n*e)/e}function ne(n){return `${Z(n)}px`}var S=class n$1{constructor(t){e(this,"_document");e(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 m$1(t);return new n$1(e)}static fromDocument(t){return new n$1(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 r of e.content)r.type==="paragraph"&&this._extractParagraphSegments(r,t);return t}getVariables(){return a(this._document)}getStyles(){let t=this._document.package.styles;if(!t?.styles)return [];let e=[];for(let[r,a]of Object.entries(t.styles))if(typeof a=="object"&&a!==null){let o=a;e.push({id:r,name:o.name||r,type:o.type==="numbering"?"paragraph":o.type||"paragraph",builtIn:o.default});}return e}getPageCount(){let t=this.getWordCount();return Math.max(1,Math.ceil(t/500))}getWordCount(){return this.getText().split(/\s+/).filter(r=>r.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,r=e.content.filter(i=>i.type==="paragraph"),a=r.map((i,s)=>{let c=this._getParagraphText(i),u=i.formatting?.styleId;return {index:s,preview:c.slice(0,t),style:u,isHeading:u?.toLowerCase().includes("heading")||false,headingLevel:this._parseHeadingLevel(u),isListItem:!!i.listRendering,isEmpty:c.trim().length===0}}),o=(e.sections||[]).map((i,s)=>({index:s,paragraphCount:i.content?.length||0,pageSize:i.properties?.pageWidth&&i.properties?.pageHeight?{width:i.properties.pageWidth,height:i.properties.pageHeight}:void 0,isLandscape:i.properties?.orientation==="landscape",hasHeader:!!i.properties?.headerReferences?.length,hasFooter:!!i.properties?.footerReferences?.length}));return {paragraphCount:r.length,wordCount:this.getWordCount(),characterCount:this.getCharacterCount(),variables:this.getVariables(),variableCount:this.getVariables().length,availableStyles:this.getStyles(),outline:a,sections:o,hasTables:this.getTableCount()>0,hasImages:this._hasImages(),hasHyperlinks:this._hasHyperlinks()}}insertText(t,e,r={}){let a={type:"insertText",position:t,text:e,formatting:r.formatting};return this._executeCommand(a)}replaceRange(t,e,r={}){let a={type:"replaceText",range:t,text:e,formatting:r.formatting};return this._executeCommand(a)}deleteRange(t){let e={type:"deleteText",range:t};return this._executeCommand(e)}applyFormatting(t,e){let r={type:"formatText",range:t,formatting:e};return this._executeCommand(r)}applyStyle(t,e){let r={type:"applyStyle",paragraphIndex:t,styleId:e};return this._executeCommand(r)}applyParagraphFormatting(t,e){let r={type:"formatParagraph",paragraphIndex:t,formatting:e};return this._executeCommand(r)}insertTable(t,e,r,a={}){let o={type:"insertTable",position:t,rows:e,columns:r,data:a.data,hasHeader:a.hasHeader};return this._executeCommand(o)}insertImage(t,e,r={}){let a={type:"insertImage",position:t,src:e,width:r.width,height:r.height,alt:r.alt};return this._executeCommand(a)}insertHyperlink(t,e,r={}){let a={type:"insertHyperlink",range:t,url:e,displayText:r.displayText,tooltip:r.tooltip};return this._executeCommand(a)}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 r={type:"mergeParagraphs",paragraphIndex:t,count:e};return this._executeCommand(r)}setVariable(t,e){return this._pendingVariables[t]=e,this}setVariables(t){for(let[e,r]of Object.entries(t))this._pendingVariables[e]=r;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 r=this._document.originalBuffer;if(!r)throw new Error("Cannot apply variables: no original buffer for processing");let a=n(r,e),o=await m$1(a),i=new n$1(o);return i._pendingVariables={},i}async toBuffer(){return this._document.originalBuffer?d(this._document):e$1(this._document)}async toBlob(t="application/vnd.openxmlformats-officedocument.wordprocessingml.document"){let e=await this.toBuffer();return new Blob([e],{type:t})}executeCommands(t){let e=b(this._document,t);return new n$1(e)}_executeCommand(t){let e=a$1(this._document,t),r=new n$1(e);return r._pendingVariables={...this._pendingVariables},r}_getBodyText(t){let e=[];for(let r of t.content)r.type==="paragraph"?e.push(this._getParagraphText(r)):r.type==="table"&&e.push(this._getTableText(r));return e.join(`
1
+ import {a,n}from'./chunk-L2UUZRZI.js';import {d,e as e$1}from'./chunk-GQ4JYQWC.js';import {o}from'./chunk-PM4Y7OFN.js';import {b,a as a$1}from'./chunk-MMJD2DLL.js';import {e}from'./chunk-3IYNTJO5.js';var W={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"},J={black:"000000",blue:"0000FF",cyan:"00FFFF",darkBlue:"00008B",darkCyan:"008B8B",darkGray:"A9A9A9",darkGreen:"006400",darkMagenta:"8B008B",darkRed:"8B0000",darkYellow:"808000",green:"00FF00",lightGray:"D3D3D3",magenta:"FF00FF",red:"FF0000",white:"FFFFFF",yellow:"FFFF00",none:""},w={dk1:"dk1",lt1:"lt1",dk2:"dk2",lt2:"lt2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hlink:"hlink",folHlink:"folHlink",dark1:"dk1",light1:"lt1",dark2:"dk2",light2:"lt2",hyperlink:"hlink",followedHyperlink:"folHlink",background1:"lt1",text1:"dk1",background2:"lt2",text2:"dk2",tx1:"dk1",tx2:"dk2",bg1:"lt1",bg2:"lt2"};function $(n){if(!n)return 1;let t=parseInt(n,16);return isNaN(t)?1:t/255}function C(n){let t=n.padStart(6,"0").slice(0,6),e=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),a=parseInt(t.slice(4,6),16);return {r:isNaN(e)?0:e,g:isNaN(r)?0:r,b:isNaN(a)?0:a}}function E(n,t,e){let r=a=>Math.max(0,Math.min(255,Math.round(a))).toString(16).padStart(2,"0");return `${r(n)}${r(t)}${r(e)}`.toUpperCase()}function U(n,t,e){n/=255,t/=255,e/=255;let r=Math.max(n,t,e),a=Math.min(n,t,e),o=(r+a)/2;if(r===a)return {h:0,s:0,l:o};let i=r-a,s=o>.5?i/(2-r-a):i/(r+a),c;switch(r){case n:c=((t-e)/i+(t<e?6:0))/6;break;case t:c=((e-n)/i+2)/6;break;case e:c=((n-t)/i+4)/6;break;default:c=0;}return {h:c*360,s,l:o}}function G(n,t,e){if(n=n/360,t===0){let i=Math.round(e*255);return {r:i,g:i,b:i}}let r=(i,s,c)=>(c<0&&(c+=1),c>1&&(c-=1),c<1/6?i+(s-i)*6*c:c<1/2?s:c<2/3?i+(s-i)*(2/3-c)*6:i),a=e<.5?e*(1+t):e+t-e*t,o=2*e-a;return {r:Math.round(r(o,a,n+1/3)*255),g:Math.round(r(o,a,n)*255),b:Math.round(r(o,a,n-1/3)*255)}}function q(n,t){if(t<=0||t>=1)return t>=1?"FFFFFF":n;let e=C(n),r=U(e.r,e.g,e.b);r.l=r.l+(1-r.l)*t;let a=G(r.h,r.s,r.l);return E(a.r,a.g,a.b)}function X(n,t){if(t<=0||t>=1)return t<=0?"000000":n;let e=C(n),r=U(e.r,e.g,e.b);r.l=r.l*t;let a=G(r.h,r.s,r.l);return E(a.r,a.g,a.b)}function Q(n,t){let e=w[t]??t,r=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],a=o=>r.includes(o);return n?.colorScheme?a(e)?n.colorScheme[e]??W[e]??"000000":"000000":a(e)?W[e]??"000000":"000000"}function K(n){if(!n)return null;let t=n.toLowerCase();return w[n]??w[t]??null}function g(n,t,e="000000"){if(!n)return `#${e}`;if(n.auto)return `#${e}`;let r;if(n.themeColor){let a=K(n.themeColor);if(a?r=Q(t,a):r=n.rgb??e,n.themeTint){let o=$(n.themeTint);r=q(r,o);}else if(n.themeShade){let o=$(n.themeShade);r=X(r,o);}}else n.rgb?r=n.rgb:r=e;return `#${r.toUpperCase().replace(/^#/,"")}`}function Et(n){if(!n||n==="none")return "";let t=J[n];return t?`#${t}`:""}function Bt(n,t){return n?n.auto?"transparent":g(n,t):""}function vt(n,t){if(!n)return false;if(n.auto)return true;let r=g(n,t).replace(/^#/,"").toLowerCase(),a=C(r);return (a.r+a.g+a.b)/3<20}function Ot(n,t){if(!n)return false;let r=g(n,t).replace(/^#/,"").toLowerCase(),a=C(r);return (a.r+a.g+a.b)/3>235}function Nt(n,t){if(!n)return "#000000";let r=g(n,t).replace(/^#/,""),a=C(r);return (.299*a.r+.587*a.g+.114*a.b)/255>.5?"#000000":"#FFFFFF"}function Vt(n){if(!n)return;let t=n.trim();if(t.toLowerCase()==="auto")return {auto:true};let e=K(t);if(e)return {themeColor:e};let r=t.replace(/^#/,"").toUpperCase();return /^[0-9A-F]{6}$/i.test(r)?{rgb:r}:/^[0-9A-F]{3}$/i.test(r)?{rgb:r.split("").map(o=>o+o).join("")}:{rgb:r.padStart(6,"0").slice(0,6)}}function Lt(n,t,e){let r={themeColor:n};return t!==void 0&&t>0&&t<1&&(r.themeTint=Math.round(t*255).toString(16).toUpperCase().padStart(2,"0")),e!==void 0&&e>0&&e<1&&(r.themeShade=Math.round(e*255).toString(16).toUpperCase().padStart(2,"0")),r}function Mt(n){return {rgb:n.replace(/^#/,"").toUpperCase()}}function jt(n,t,e){let a=g(n,t).replace(/^#/,""),o=1-e/100;return `#${X(a,o)}`}function zt(n,t,e){let a=g(n,t).replace(/^#/,""),o=e/100;return `#${q(a,o)}`}function Wt(n,t,e,r){let a=g(n,r).replace(/^#/,""),o=g(t,r).replace(/^#/,""),i=C(a),s=C(o),c={r:Math.round(i.r*(1-e)+s.r*e),g:Math.round(i.g*(1-e)+s.g*e),b:Math.round(i.b*(1-e)+s.b*e)};return `#${E(c.r,c.g,c.b)}`}function $t(n,t,e){if(!n&&!t)return true;if(!n||!t)return false;let r=g(n,e).toUpperCase(),a=g(t,e).toUpperCase();return r===a}function Gt(n){return n/1440*96}function qt(n){return n/96*1440}function Xt(n){return n/914400*96}function Kt(n){return n/96*914400}function Yt(n){return n/914400*1440}function Jt(n){return n/1440*914400}function Qt(n){return n/72*96}function Zt(n){return n/144*96}function te(n){return n/2}function ee(n){return n/576*96}function Z(n,t=2){let e=Math.pow(10,t);return Math.round(n*e)/e}function ne(n){return `${Z(n)}px`}var S=class n$1{constructor(t){e(this,"_document");e(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 o(t);return new n$1(e)}static fromDocument(t){return new n$1(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 r of e.content)r.type==="paragraph"&&this._extractParagraphSegments(r,t);return t}getVariables(){return a(this._document)}getStyles(){let t=this._document.package.styles;if(!t?.styles)return [];let e=[];for(let[r,a]of Object.entries(t.styles))if(typeof a=="object"&&a!==null){let o=a;e.push({id:r,name:o.name||r,type:o.type==="numbering"?"paragraph":o.type||"paragraph",builtIn:o.default});}return e}getPageCount(){let t=this.getWordCount();return Math.max(1,Math.ceil(t/500))}getWordCount(){return this.getText().split(/\s+/).filter(r=>r.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,r=e.content.filter(i=>i.type==="paragraph"),a=r.map((i,s)=>{let c=this._getParagraphText(i),u=i.formatting?.styleId;return {index:s,preview:c.slice(0,t),style:u,isHeading:u?.toLowerCase().includes("heading")||false,headingLevel:this._parseHeadingLevel(u),isListItem:!!i.listRendering,isEmpty:c.trim().length===0}}),o=(e.sections||[]).map((i,s)=>({index:s,paragraphCount:i.content?.length||0,pageSize:i.properties?.pageWidth&&i.properties?.pageHeight?{width:i.properties.pageWidth,height:i.properties.pageHeight}:void 0,isLandscape:i.properties?.orientation==="landscape",hasHeader:!!i.properties?.headerReferences?.length,hasFooter:!!i.properties?.footerReferences?.length}));return {paragraphCount:r.length,wordCount:this.getWordCount(),characterCount:this.getCharacterCount(),variables:this.getVariables(),variableCount:this.getVariables().length,availableStyles:this.getStyles(),outline:a,sections:o,hasTables:this.getTableCount()>0,hasImages:this._hasImages(),hasHyperlinks:this._hasHyperlinks()}}insertText(t,e,r={}){let a={type:"insertText",position:t,text:e,formatting:r.formatting};return this._executeCommand(a)}replaceRange(t,e,r={}){let a={type:"replaceText",range:t,text:e,formatting:r.formatting};return this._executeCommand(a)}deleteRange(t){let e={type:"deleteText",range:t};return this._executeCommand(e)}applyFormatting(t,e){let r={type:"formatText",range:t,formatting:e};return this._executeCommand(r)}applyStyle(t,e){let r={type:"applyStyle",paragraphIndex:t,styleId:e};return this._executeCommand(r)}applyParagraphFormatting(t,e){let r={type:"formatParagraph",paragraphIndex:t,formatting:e};return this._executeCommand(r)}insertTable(t,e,r,a={}){let o={type:"insertTable",position:t,rows:e,columns:r,data:a.data,hasHeader:a.hasHeader};return this._executeCommand(o)}insertImage(t,e,r={}){let a={type:"insertImage",position:t,src:e,width:r.width,height:r.height,alt:r.alt};return this._executeCommand(a)}insertHyperlink(t,e,r={}){let a={type:"insertHyperlink",range:t,url:e,displayText:r.displayText,tooltip:r.tooltip};return this._executeCommand(a)}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 r={type:"mergeParagraphs",paragraphIndex:t,count:e};return this._executeCommand(r)}setVariable(t,e){return this._pendingVariables[t]=e,this}setVariables(t){for(let[e,r]of Object.entries(t))this._pendingVariables[e]=r;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 r=this._document.originalBuffer;if(!r)throw new Error("Cannot apply variables: no original buffer for processing");let a=n(r,e),o$1=await o(a),i=new n$1(o$1);return i._pendingVariables={},i}async toBuffer(){return this._document.originalBuffer?d(this._document):e$1(this._document)}async toBlob(t="application/vnd.openxmlformats-officedocument.wordprocessingml.document"){let e=await this.toBuffer();return new Blob([e],{type:t})}executeCommands(t){let e=b(this._document,t);return new n$1(e)}_executeCommand(t){let e=a$1(this._document,t),r=new n$1(e);return r._pendingVariables={...this._pendingVariables},r}_getBodyText(t){let e=[];for(let r of t.content)r.type==="paragraph"?e.push(this._getParagraphText(r)):r.type==="table"&&e.push(this._getTableText(r));return e.join(`
2
2
  `)}_getParagraphText(t){let e=[];for(let r of t.content)r.type==="run"?e.push(this._getRunText(r)):r.type==="hyperlink"&&e.push(this._getHyperlinkText(r));return e.join("")}_getRunText(t){return t.content.filter(e=>e.type==="text").map(e=>e.text).join("")}_getHyperlinkText(t){let e=[];for(let r of t.children)r.type==="run"&&e.push(this._getRunText(r));return e.join("")}_getTableText(t){let e=[];for(let r of t.rows)for(let a of r.cells)for(let o of a.content)o.type==="paragraph"&&e.push(this._getParagraphText(o));return e.join(" ")}_extractParagraphSegments(t,e){for(let r of t.content)if(r.type==="run"){let a=this._getRunText(r);a&&e.push({text:a,formatting:r.formatting});}else if(r.type==="hyperlink"){let a=r.href||"";for(let o of r.children)if(o.type==="run"){let i=this._getRunText(o);i&&e.push({text:i,formatting:o.formatting,isHyperlink:true,hyperlinkUrl:a});}}}_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 r of e.content)if(r.type==="run"){for(let a of r.content)if(a.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 r of e.content)if(r.type==="hyperlink")return true}return false}};async function ue(n){return S.fromBuffer(n)}function le(n){return S.fromDocument(n)}function tt(n,t={}){let{outlineMaxChars:e=100,maxOutlineParagraphs:r=50}=t,a$1=n.package.document,o=a$1.content.filter(y=>y.type==="paragraph"),i=et(o,e,r),s=a(n),c=nt(n),u=rt(a$1),l=at(a$1),x=ot(a$1),d=a$1.content.some(y=>y.type==="table"),b=ct(a$1),p=ut(a$1);return {paragraphCount:o.length,wordCount:l,characterCount:x,variables:s,variableCount:s.length,availableStyles:c,outline:i,sections:u,hasTables:d,hasImages:b,hasHyperlinks:p}}function de(n,t,e={}){let{contextChars:r=200,includeSuggestions:a=true}=e,i=n.package.document.content.filter(f=>f.type==="paragraph"),s=i[t.start.paragraphIndex];if(!s)throw new Error(`Paragraph not found at index ${t.start.paragraphIndex}`);let c=m(s),u="";if(t.start.paragraphIndex===t.end.paragraphIndex)u=c.slice(t.start.offset,t.end.offset);else {let f=[];for(let P=t.start.paragraphIndex;P<=t.end.paragraphIndex;P++){let N=i[P];if(!N)continue;let R=m(N);P===t.start.paragraphIndex?f.push(R.slice(t.start.offset)):P===t.end.paragraphIndex?f.push(R.slice(0,t.end.offset)):f.push(R);}u=f.join(`
3
3
  `);}let l=mt(i,t.start.paragraphIndex,t.start.offset,r),x=gt(i,t.end.paragraphIndex,t.end.offset,r),d=dt(s,t.start.offset),b=s.formatting||{},p={index:t.start.paragraphIndex,fullText:c,style:s.formatting?.styleId,wordCount:B(c)},y=false,F=ft(s,t.start.offset),_=a?ht(u):[];return {selectedText:u,range:t,formatting:d,paragraphFormatting:b,textBefore:l,textAfter:x,paragraph:p,inTable:y,inHyperlink:F,suggestedActions:_}}function Y(n){let t=tt(n,{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 r=t.outline.filter(a=>a.isHeading);if(r.length>0){e.push(`
4
4
  Headings:`);for(let a of r.slice(0,5)){let o=a.headingLevel||1;e.push(`${" ".repeat(o-1)}- ${a.preview}`);}r.length>5&&e.push(` ... and ${r.length-5} more headings`);}return e.join(" ")}function et(n,t,e){let r=[];for(let a=0;a<Math.min(n.length,e);a++){let o=n[a],i=m(o),s=o.formatting?.styleId;r.push({index:a,preview:i.slice(0,t),style:s,isHeading:lt(s),headingLevel:pt(s),isListItem:!!o.listRendering,isEmpty:i.trim().length===0});}return r}function nt(n){let t=n.package.styles;if(!t?.styles)return [];let e=[];for(let[r,a]of Object.entries(t.styles))if(typeof a=="object"&&a!==null){let o=a;e.push({id:r,name:o.name||r,type:o.type==="numbering"?"paragraph":o.type||"paragraph",builtIn:o.default});}return e}function rt(n){return n.sections?n.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 at(n){let t=0;for(let e of n.content)if(e.type==="paragraph"){let r=m(e);t+=B(r);}else e.type==="table"&&(t+=it(e));return t}function B(n){return n.split(/\s+/).filter(e=>e.length>0).length}function ot(n){let t=0;for(let e of n.content)if(e.type==="paragraph"){let r=m(e);t+=r.length;}else e.type==="table"&&(t+=st(e));return t}function it(n){let t=0;for(let e of n.rows)for(let r of e.cells)for(let a of r.content)if(a.type==="paragraph"){let o=m(a);t+=B(o);}return t}function st(n){let t=0;for(let e of n.rows)for(let r of e.cells)for(let a of r.content)if(a.type==="paragraph"){let o=m(a);t+=o.length;}return t}function m(n){let t=[];for(let e of n.content)e.type==="run"?t.push(A(e)):e.type==="hyperlink"&&t.push(v(e));return t.join("")}function A(n){return n.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function v(n){let t=[];for(let e of n.children)e.type==="run"&&t.push(A(e));return t.join("")}function ct(n){for(let t of n.content)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="run"){for(let r of e.content)if(r.type==="drawing")return true}}return false}function ut(n){for(let t of n.content)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="hyperlink")return true}return false}function lt(n){return n?n.toLowerCase().includes("heading"):false}function pt(n){if(!n)return;let t=n.match(/heading\s*(\d)/i);if(t)return parseInt(t[1],10)}function mt(n,t,e,r){let a=[],o=0,i=n[t];if(i){let u=m(i).slice(0,e);a.unshift(u),o+=u.length;}for(let c=t-1;c>=0&&o<r;c--){let u=n[c];if(!u)continue;let l=m(u);a.unshift(l),o+=l.length;}let s=a.join(`
@@ -0,0 +1,12 @@
1
+ 'use strict';var Zt=require('jszip'),xmlJs=require('xml-js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Zt__default=/*#__PURE__*/_interopDefault(Zt);var G=new Set,ne=new Map,be=new Set,ye=false;function Pe(e,t=[400,700],n=["normal","italic"]){let o=encodeURIComponent(e),r=[];for(let a of n){let c=a==="italic"?1:0;for(let f of t)r.push(`${c},${f}`);}r.sort();let i=r.join(";");return `https://fonts.googleapis.com/css2?family=${o}:ital,wght@${i}&display=swap`}async function Be(e,t){let n=e.trim();if(G.has(n))return true;let o=ne.get(n);if(o)return o;let r=(async()=>{ye=true;try{let i=Pe(n,t?.weights,t?.styles),a=document.createElement("link");return a.rel="stylesheet",a.href=i,await new Promise(f=>{a.onload=()=>f(!0),a.onerror=()=>f(!1),document.head.appendChild(a),setTimeout(()=>f(!1),5e3);})?(await Ne(n,3e3),G.add(n),Ae([n]),!0):!1}catch(i){return console.warn(`Failed to load font "${n}":`,i),false}finally{ne.delete(n),ne.size===0&&(ye=false);}})();return ne.set(n,r),r}async function Vt(e,t){let n=e.filter(o=>!G.has(o.trim()));n.length!==0&&await Promise.all(n.map(o=>Be(o,t)));}function Lo(e){return G.has(e.trim())}function Do(){return ye}function Ho(){return Array.from(G)}function Oo(e){return be.add(e),()=>{be.delete(e);}}function Ae(e){for(let t of be)try{t(e);}catch(n){console.warn("Font load callback error:",n);}}async function Ne(e,t){if("fonts"in document)try{let n=`400 16px "${e}"`;return await Promise.race([document.fonts.load(n),new Promise(o=>setTimeout(o,t))]),document.fonts.check(n)}catch{}return await new Promise(n=>setTimeout(n,100)),true}function Wo(e,t="sans-serif"){if(typeof document>"u")return false;let n=(r,i)=>{let c=document.createElement("canvas").getContext("2d");if(!c)return false;c.textBaseline="top";let f="abcdefghijklmnopqrstuvwxyz0123456789";c.font=`72px ${i}`;let u=c.measureText(f).width;return c.font=`72px "${r}", ${i}`,c.measureText(f).width!==u};return n(e,t)?true:n(e,t==="sans-serif"?"serif":"sans-serif")}async function jo(e,t,n){let o=e.trim();if(G.has(o))return true;try{let r=new Blob([t],{type:"font/ttf"}),i=URL.createObjectURL(r),a=document.createElement("style");return a.textContent=`
2
+ @font-face {
3
+ font-family: "${o}";
4
+ src: url(${i}) format('truetype');
5
+ font-weight: ${n?.weight??"normal"};
6
+ font-style: ${n?.style??"normal"};
7
+ font-display: swap;
8
+ }
9
+ `,document.head.appendChild(a),await Ne(o,3e3),G.add(o),Ae([o]),!0}catch(r){return console.warn(`Failed to load font "${o}" from buffer:`,r),false}}var zt={Calibri:"Carlito",Cambria:"Caladea",Arial:"Arimo","Times New Roman":"Tinos","Courier New":"Cousine",Garamond:"EB Garamond","Book Antiqua":"EB Garamond",Georgia:"Tinos",Verdana:"Open Sans",Tahoma:"Open Sans","Trebuchet MS":"Source Sans Pro","Century Gothic":"Poppins","Franklin Gothic":"Libre Franklin",Palatino:"EB Garamond","Palatino Linotype":"EB Garamond","Lucida Sans":"Open Sans","Segoe UI":"Open Sans",Impact:"Anton","Comic Sans MS":"Comic Neue",Consolas:"Inconsolata","Lucida Console":"Inconsolata",Monaco:"Fira Code"};function Ut(e){let t=e.trim();return zt[t]||t}async function $t(e){let t=e.trim(),n=Ut(t);return n!==t?(await _t(t,n),G.add(t),G.add(n),true):Be(n)}async function _t(e,t){let n=`font-alias-${e.toLowerCase().replace(/\s+/g,"-")}`;if(!document.getElementById(n))try{let o=Pe(t,[400,700],["normal","italic"]),r=await fetch(o);if(!r.ok){console.warn(`Failed to fetch Google Fonts CSS for "${t}": ${r.status}`);return}let i=await r.text(),a=new RegExp(`font-family:\\s*['"]${Gt(t)}['"]`,"gi"),c=i.replace(a,`font-family: '${e}'`),f=document.createElement("style");f.id=n,f.textContent=c,document.head.appendChild(f);}catch(o){console.warn(`Failed to create font alias for "${e}":`,o);}}function Gt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}async function xe(e){let t=[...new Set(e.map(n=>n.trim()))];await Promise.all(t.map(n=>$t(n)));}async function Vo(){await Vt(["Carlito","Caladea","Arimo","Tinos","Cousine","EB Garamond"]);}function qt(e){let t=new Set,n=e;if(!n?.package)return t;let o=n.package?.document?.content;if(Array.isArray(o)){for(let i of o)if(i?.type==="paragraph"&&Array.isArray(i.content)){for(let a of i.content)if(a?.type==="run"&&a.formatting?.fontFamily){let{ascii:c,hAnsi:f}=a.formatting.fontFamily;c&&t.add(c),f&&f!==c&&t.add(f);}}}let r=n.package?.styles?.styles;if(Array.isArray(r)){for(let i of r)if(i?.runProperties?.fontFamily){let{ascii:a,hAnsi:c}=i.runProperties.fontFamily;a&&t.add(a),c&&c!==a&&t.add(c);}}return t}async function zo(e){let t=qt(e);t.size!==0&&await xe(Array.from(t));}async function Ie(e){if(e instanceof ArrayBuffer)return e;if(e instanceof Uint8Array){let t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(e),t}if(e instanceof Blob)return e.arrayBuffer();throw new TypeError(`Unsupported DocxInput type: ${typeof e}`)}async function Xe(e){let t=await Zt__default.default.loadAsync(e),n={documentXml:null,stylesXml:null,themeXml:null,numberingXml:null,fontTableXml:null,settingsXml:null,webSettingsXml:null,headers:new Map,footers:new Map,footnotesXml:null,endnotesXml:null,commentsXml:null,commentsExtensibleXml:null,documentRels:null,packageRels:null,contentTypesXml:null,corePropsXml:null,appPropsXml:null,customPropsXml:null,media:new Map,fonts:new Map,allXml:new Map,originalZip:t,originalBuffer:e};for(let[o,r]of Object.entries(t.files)){if(r.dir)continue;let i=o.toLowerCase();if(i.endsWith(".xml")||i.endsWith(".rels")){let a=await r.async("text");if(n.allXml.set(o,a),i==="word/document.xml")n.documentXml=a;else if(i==="word/styles.xml")n.stylesXml=a;else if(i==="word/theme/theme1.xml")n.themeXml=a;else if(i==="word/numbering.xml")n.numberingXml=a;else if(i==="word/fonttable.xml")n.fontTableXml=a;else if(i==="word/settings.xml")n.settingsXml=a;else if(i==="word/websettings.xml")n.webSettingsXml=a;else if(i==="word/footnotes.xml")n.footnotesXml=a;else if(i==="word/endnotes.xml")n.endnotesXml=a;else if(i==="word/comments.xml")n.commentsXml=a;else if(i==="word/commentsextensible.xml"||i==="word/commentsextended.xml")n.commentsExtensibleXml||(n.commentsExtensibleXml=a);else if(i==="word/_rels/document.xml.rels")n.documentRels=a;else if(i==="_rels/.rels")n.packageRels=a;else if(i==="[content_types].xml")n.contentTypesXml=a;else if(i==="docprops/core.xml")n.corePropsXml=a;else if(i==="docprops/app.xml")n.appPropsXml=a;else if(i==="docprops/custom.xml")n.customPropsXml=a;else if(i.match(/^word\/header\d+\.xml$/)){let c=o.split("/").pop()||o;n.headers.set(c,a);}else if(i.match(/^word\/footer\d+\.xml$/)){let c=o.split("/").pop()||o;n.footers.set(c,a);}}else if(i.startsWith("word/media/")){let a=await r.async("arraybuffer");n.media.set(o,a);}else if(i.startsWith("word/fonts/")){let a=await r.async("arraybuffer");n.fonts.set(o,a);}}return n}function Le(e){switch(e.toLowerCase().split(".").pop()){case "png":return "image/png";case "jpg":case "jpeg":return "image/jpeg";case "gif":return "image/gif";case "bmp":return "image/bmp";case "tif":case "tiff":return "image/tiff";case "wmf":return "image/x-wmf";case "emf":return "image/x-emf";case "svg":return "image/svg+xml";case "webp":return "image/webp";default:return "application/octet-stream"}}function j(e){return xmlJs.xml2js(e,{compact:false,ignoreComment:true,ignoreInstruction:true,ignoreDoctype:true,alwaysArray:false,trim:false,captureSpacesBetweenElements:true,attributesKey:"attributes",textKey:"text"})}function De(e){return xmlJs.js2xml({elements:[e]},{compact:false,spaces:0})}function q(e){try{let t=j(e);return t.elements&&t.elements.length>0?t.elements.find(n=>n.type==="element")??null:t}catch(t){return console.warn("Failed to parse XML:",t),null}}function oe(e){let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function l(e,t,n){if(!e||!e.elements)return null;let o=`${t}:${n}`;for(let r of e.elements)if(r.type==="element"&&(r.name===o||oe(r.name||"")===n))return r;return null}function N(e,t,n){if(!e||!e.elements)return [];let o=`${t}:${n}`,r=[];for(let i of e.elements)i.type==="element"&&(i.name===o||oe(i.name||"")===n)&&r.push(i);return r}function D(e){return !e||!e.elements?[]:e.elements.filter(t=>t.type==="element")}function s(e,t,n){if(!e||!e.attributes)return null;let o=e.attributes;if(t){let r=`${t}:${n}`;if(r in o)return o[r]}return n in o?o[n]:null}function re(e){if(!e)return "";if("text"in e&&typeof e.text=="string")return e.text;if(!e.elements)return "";let t="";for(let n of e.elements)n.type==="text"&&"text"in n?t+=n.text??"":n.type==="element"&&(t+=re(n));return t}function g(e,t,n,o=1){let r=s(e,t,n);if(r===null)return;let i=parseInt(r,10);if(!isNaN(i))return i*o}function F(e,t="w"){if(!e)return false;let n=s(e,t,"val");return n===null?true:!(n==="0"||n==="false"||n==="off")}var ie={image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",header:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",footer:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",footnotes:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",endnotes:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes",styles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",numbering:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",fontTable:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",settings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",webSettings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings",oleObject:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject",chart:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",diagramData:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramData",officeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",coreProperties:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",extendedProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",customProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",customXml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml"};function ae(e){let t=new Map;if(!e||e.trim().length===0)return t;let n=q(e);if(!n)return console.warn("Failed to parse relationships XML"),t;let o=D(n);for(let r of o){let i=r.name||"";if(!i.endsWith("Relationship")&&!i.includes(":Relationship"))continue;let a=s(r,null,"Id"),c=s(r,null,"Type"),f=s(r,null,"Target"),u=s(r,null,"TargetMode");if(!a||!c||!f){console.warn("Relationship missing required attributes:",{id:a,type:c,target:f});continue}let p={id:a,type:c,target:f};u==="External"?p.targetMode="External":u==="Internal"&&(p.targetMode="Internal"),t.set(a,p);}return t}function He(e){return e.type===ie.hyperlink&&e.targetMode==="External"}var je={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"},se={majorFont:{latin:"Calibri Light",ea:"",cs:"",fonts:{}},minorFont:{latin:"Calibri",ea:"",cs:"",fonts:{}}},Te={name:"Office Theme",colorScheme:je,fontScheme:se},Jt=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"];function Qt(e){if(!e)return null;switch(oe(e.name||"")){case "srgbClr":return s(e,"a","val")??s(e,null,"val")??null;case "sysClr":{let n=s(e,"a","lastClr")??s(e,null,"lastClr");if(n)return n;switch(s(e,"a","val")??s(e,null,"val")){case "windowText":case "menuText":case "captionText":case "btnText":return "000000";case "window":case "menu":case "btnFace":case "btnHighlight":return "FFFFFF";case "highlight":return "0078D7";case "highlightText":return "FFFFFF";case "grayText":return "808080";default:return null}}case "schemeClr":{s(e,"a","val")??s(e,null,"val");return null}default:return null}}function en(e){let t={...je};if(!e)return t;for(let n of Jt){let o=l(e,"a",n);if(o){let r=D(o);if(r.length>0){let i=Qt(r[0]);i&&(t[n]=i);}}}return t}function Oe(e){let t={latin:"",ea:"",cs:"",fonts:{}};if(!e)return t;let n=l(e,"a","latin");n&&(t.latin=s(n,"a","typeface")??s(n,null,"typeface")??"");let o=l(e,"a","ea");o&&(t.ea=s(o,"a","typeface")??s(o,null,"typeface")??"");let r=l(e,"a","cs");r&&(t.cs=s(r,"a","typeface")??s(r,null,"typeface")??"");let i=N(e,"a","font");for(let a of i){let c=s(a,"a","script")??s(a,null,"script"),f=s(a,"a","typeface")??s(a,null,"typeface");c&&f&&(t.fonts=t.fonts||{},t.fonts[c]=f);}return t}function tn(e){let t={...se};if(!e)return t;let n=l(e,"a","majorFont");n&&(t.majorFont=Oe(n));let o=l(e,"a","minorFont");return o&&(t.minorFont=Oe(o)),t}function Ve(e){if(!e)return {...Te};try{let t=q(e);if(!t)return {...Te};let n=s(t,"a","name")??s(t,null,"name")??"Office Theme",o=l(t,"a","themeElements"),r=l(o,"a","clrScheme"),i=en(r),a=l(o,"a","fontScheme"),c=tn(a);return {name:n,colorScheme:i,fontScheme:c}}catch(t){return console.warn("Failed to parse theme:",t),{...Te}}}function nn(e,t="latin"){if(!e?.fontScheme?.majorFont)return se.majorFont?.latin??"Calibri Light";let n=e.fontScheme.majorFont;return t==="latin"?n.latin||"Calibri Light":t==="ea"?n.ea||"":t==="cs"?n.cs||"":n.fonts?.[t]?n.fonts[t]:n.latin||"Calibri Light"}function We(e,t="latin"){if(!e?.fontScheme?.minorFont)return se.minorFont?.latin??"Calibri";let n=e.fontScheme.minorFont;return t==="latin"?n.latin||"Calibri":t==="ea"?n.ea||"":t==="cs"?n.cs||"":n.fonts?.[t]?n.fonts[t]:n.latin||"Calibri"}function _(e,t){if(!t)return "Calibri";let n=t.toLowerCase().includes("major"),o=t.toLowerCase().includes("minor"),r="latin",i=t.toLowerCase();return i.includes("eastasia")?r="ea":(i.includes("bidi")||i.includes("cs"))&&(r="cs"),n?nn(e,r):o?We(e,r):We(e,"latin")}function le(e,t){if(!e)return;let n={},o=l(e,"w","b");o&&(n.bold=F(o));let r=l(e,"w","bCs");r&&(n.boldCs=F(r));let i=l(e,"w","i");i&&(n.italic=F(i));let a=l(e,"w","iCs");a&&(n.italicCs=F(a));let c=l(e,"w","u");if(c){let R=s(c,"w","val");if(R){n.underline={style:R};let M=s(c,"w","color"),L=s(c,"w","themeColor");(M||L)&&(n.underline.color=Fe(M,L,s(c,"w","themeTint"),s(c,"w","themeShade")));}}let f=l(e,"w","strike");f&&(n.strike=F(f));let u=l(e,"w","dstrike");u&&(n.doubleStrike=F(u));let p=l(e,"w","vertAlign");if(p){let R=s(p,"w","val");(R==="superscript"||R==="subscript"||R==="baseline")&&(n.vertAlign=R);}let m=l(e,"w","smallCaps");m&&(n.smallCaps=F(m));let h=l(e,"w","caps");h&&(n.allCaps=F(h));let T=l(e,"w","vanish");T&&(n.hidden=F(T));let d=l(e,"w","color");d&&(n.color=Fe(s(d,"w","val"),s(d,"w","themeColor"),s(d,"w","themeTint"),s(d,"w","themeShade")));let w=l(e,"w","highlight");if(w){let R=s(w,"w","val");R&&(n.highlight=R);}let E=l(e,"w","shd");E&&(n.shading=ce(E));let k=l(e,"w","sz");if(k){let R=g(k,"w","val");R!==void 0&&(n.fontSize=R);}let P=l(e,"w","szCs");if(P){let R=g(P,"w","val");R!==void 0&&(n.fontSizeCs=R);}let C=l(e,"w","rFonts");if(C){n.fontFamily={ascii:s(C,"w","ascii")??void 0,hAnsi:s(C,"w","hAnsi")??void 0,eastAsia:s(C,"w","eastAsia")??void 0,cs:s(C,"w","cs")??void 0};let R=s(C,"w","asciiTheme");R&&(n.fontFamily.asciiTheme=R,t&&!n.fontFamily.ascii&&(n.fontFamily.ascii=_(t,R)));let M=s(C,"w","hAnsiTheme");M&&(n.fontFamily.hAnsiTheme=M,t&&!n.fontFamily.hAnsi&&(n.fontFamily.hAnsi=_(t,M)));let L=s(C,"w","eastAsiaTheme");L&&(n.fontFamily.eastAsiaTheme=L,t&&!n.fontFamily.eastAsia&&(n.fontFamily.eastAsia=_(t,L)));let $=s(C,"w","cstheme");$&&(n.fontFamily.csTheme=$,t&&!n.fontFamily.cs&&(n.fontFamily.cs=_(t,$)));}let b=l(e,"w","spacing");if(b){let R=g(b,"w","val");R!==void 0&&(n.spacing=R);}let x=l(e,"w","position");if(x){let R=g(x,"w","val");R!==void 0&&(n.position=R);}let S=l(e,"w","w");if(S){let R=g(S,"w","val");R!==void 0&&(n.scale=R);}let y=l(e,"w","kern");if(y){let R=g(y,"w","val");R!==void 0&&(n.kerning=R);}let v=l(e,"w","effect");if(v){let R=s(v,"w","val");R&&(n.effect=R);}let B=l(e,"w","em");if(B){let R=s(B,"w","val");R&&(n.emphasisMark=R);}let A=l(e,"w","emboss");A&&(n.emboss=F(A));let I=l(e,"w","imprint");I&&(n.imprint=F(I));let O=l(e,"w","outline");O&&(n.outline=F(O));let U=l(e,"w","shadow");U&&(n.shadow=F(U));let K=l(e,"w","rtl");K&&(n.rtl=F(K));let H=l(e,"w","cs");H&&(n.cs=F(H));let W=l(e,"w","rStyle");if(W){let R=s(W,"w","val");R&&(n.styleId=R);}return Object.keys(n).length>0?n:void 0}function Fe(e,t,n,o){let r={};return e&&e!=="auto"?r.rgb=e:e==="auto"&&(r.auto=true),t&&(r.themeColor=t),n&&(r.themeTint=n),o&&(r.themeShade=o),r}function ce(e){if(!e)return;let t={},n=s(e,"w","color");n&&n!=="auto"&&(t.color={rgb:n});let o=s(e,"w","fill");o&&o!=="auto"&&(t.fill={rgb:o});let r=s(e,"w","themeFill");r&&(t.fill=t.fill||{},t.fill.themeColor=r);let i=s(e,"w","themeFillTint");i&&t.fill&&(t.fill.themeTint=i);let a=s(e,"w","themeFillShade");a&&t.fill&&(t.fill.themeShade=a);let c=s(e,"w","val");return c&&(t.pattern=c),Object.keys(t).length>0?t:void 0}function V(e){if(!e)return;let t=s(e,"w","val");if(!t)return;let n={style:t},o=s(e,"w","color"),r=s(e,"w","themeColor");(o||r)&&(n.color=Fe(o,r,s(e,"w","themeTint"),s(e,"w","themeShade")));let i=g(e,"w","sz");i!==void 0&&(n.size=i);let a=g(e,"w","space");a!==void 0&&(n.space=a);let c=s(e,"w","shadow");c&&(n.shadow=c==="1"||c==="true");let f=s(e,"w","frame");return f&&(n.frame=f==="1"||f==="true"),n}function on(e){if(!e)return;let t=N(e,"w","tab");if(t.length===0)return;let n=[];for(let o of t){let r=g(o,"w","pos"),i=s(o,"w","val");if(r!==void 0&&i){let a={position:r,alignment:i},c=s(o,"w","leader");c&&(a.leader=c),n.push(a);}}return n.length>0?n:void 0}function Se(e,t){if(!e)return;let n={},o=l(e,"w","jc");if(o){let x=s(o,"w","val");x&&(n.alignment=x);}let r=l(e,"w","bidi");r&&(n.bidi=F(r));let i=l(e,"w","spacing");if(i){let x=g(i,"w","before");x!==void 0&&(n.spaceBefore=x);let S=g(i,"w","after");S!==void 0&&(n.spaceAfter=S);let y=g(i,"w","line");y!==void 0&&(n.lineSpacing=y);let v=s(i,"w","lineRule");v&&(n.lineSpacingRule=v);let B=s(i,"w","beforeAutospacing");B&&(n.beforeAutospacing=B==="1"||B==="true");let A=s(i,"w","afterAutospacing");A&&(n.afterAutospacing=A==="1"||A==="true");}let a=l(e,"w","ind");if(a){let x=g(a,"w","left");x!==void 0&&(n.indentLeft=x);let S=g(a,"w","right");S!==void 0&&(n.indentRight=S);let y=g(a,"w","firstLine");y!==void 0&&(n.indentFirstLine=y);let v=g(a,"w","hanging");v!==void 0&&(n.indentFirstLine=-v,n.hangingIndent=true);}let c=l(e,"w","pBdr");if(c){let x={},S=V(l(c,"w","top"));S&&(x.top=S);let y=V(l(c,"w","bottom"));y&&(x.bottom=y);let v=V(l(c,"w","left"));v&&(x.left=v);let B=V(l(c,"w","right"));B&&(x.right=B);let A=V(l(c,"w","between"));A&&(x.between=A);let I=V(l(c,"w","bar"));I&&(x.bar=I),Object.keys(x).length>0&&(n.borders=x);}let f=l(e,"w","shd");f&&(n.shading=ce(f));let u=l(e,"w","tabs");u&&(n.tabs=on(u));let p=l(e,"w","keepNext");p&&(n.keepNext=F(p));let m=l(e,"w","keepLines");m&&(n.keepLines=F(m));let h=l(e,"w","widowControl");h&&(n.widowControl=F(h));let T=l(e,"w","pageBreakBefore");T&&(n.pageBreakBefore=F(T));let d=l(e,"w","contextualSpacing");d&&(n.contextualSpacing=F(d));let w=l(e,"w","numPr");if(w){let x=l(w,"w","numId"),S=l(w,"w","ilvl");if(x||S){if(n.numPr={},x){let y=g(x,"w","val");y!==void 0&&(n.numPr.numId=y);}if(S){let y=g(S,"w","val");y!==void 0&&(n.numPr.ilvl=y);}}}let E=l(e,"w","outlineLvl");if(E){let x=g(E,"w","val");x!==void 0&&(n.outlineLevel=x);}let k=l(e,"w","pStyle");if(k){let x=s(k,"w","val");x&&(n.styleId=x);}let P=l(e,"w","suppressLineNumbers");P&&(n.suppressLineNumbers=F(P));let C=l(e,"w","suppressAutoHyphens");C&&(n.suppressAutoHyphens=F(C));let b=l(e,"w","rPr");return b&&(n.runProperties=le(b,t)),Object.keys(n).length>0?n:void 0}function Z(e){if(!e)return;let t=g(e,"w","w"),n=s(e,"w","type");if(t!==void 0&&n)return {value:t,type:n}}function _e(e){if(!e)return;let t={},n=V(l(e,"w","top"));n&&(t.top=n);let o=V(l(e,"w","bottom"));o&&(t.bottom=o);let r=V(l(e,"w","left"));r&&(t.left=r);let i=V(l(e,"w","right"));i&&(t.right=i);let a=V(l(e,"w","insideH"));a&&(t.insideH=a);let c=V(l(e,"w","insideV"));return c&&(t.insideV=c),Object.keys(t).length>0?t:void 0}function Ge(e){if(!e)return;let t={},n=Z(l(e,"w","top"));n&&(t.top=n);let o=Z(l(e,"w","bottom"));o&&(t.bottom=o);let r=Z(l(e,"w","left"));r&&(t.left=r);let i=Z(l(e,"w","right"));return i&&(t.right=i),Object.keys(t).length>0?t:void 0}function rn(e){if(!e)return;let t={},n=s(e,"w","val");if(n){let u=parseInt(n,16);isNaN(u)||(t.firstRow=(u&32)!==0,t.lastRow=(u&64)!==0,t.firstColumn=(u&128)!==0,t.lastColumn=(u&256)!==0,t.noHBand=(u&512)!==0,t.noVBand=(u&1024)!==0);}let o=s(e,"w","firstColumn");o&&(t.firstColumn=o==="1");let r=s(e,"w","firstRow");r&&(t.firstRow=r==="1");let i=s(e,"w","lastColumn");i&&(t.lastColumn=i==="1");let a=s(e,"w","lastRow");a&&(t.lastRow=a==="1");let c=s(e,"w","noHBand");c&&(t.noHBand=c==="1");let f=s(e,"w","noVBand");return f&&(t.noVBand=f==="1"),Object.keys(t).length>0?t:void 0}function ze(e,t){if(!e)return;let n={},o=l(e,"w","tblW");o&&(n.width=Z(o));let r=l(e,"w","jc");if(r){let d=s(r,"w","val");(d==="left"||d==="center"||d==="right")&&(n.justification=d);}let i=l(e,"w","tblCellSpacing");i&&(n.cellSpacing=Z(i));let a=l(e,"w","tblInd");a&&(n.indent=Z(a));let c=l(e,"w","tblBorders");c&&(n.borders=_e(c));let f=l(e,"w","tblCellMar");f&&(n.cellMargins=Ge(f));let u=l(e,"w","tblLayout");if(u){let d=s(u,"w","type");(d==="fixed"||d==="autofit")&&(n.layout=d);}let p=l(e,"w","tblStyle");if(p){let d=s(p,"w","val");d&&(n.styleId=d);}let m=l(e,"w","tblLook");m&&(n.look=rn(m));let h=l(e,"w","shd");h&&(n.shading=ce(h));let T=l(e,"w","bidiVisual");return T&&(n.bidi=F(T)),Object.keys(n).length>0?n:void 0}function Ue(e){if(!e)return;let t={},n=l(e,"w","trHeight");if(n){t.height=Z(n);let c=s(n,"w","hRule");c&&(t.heightRule=c);}let o=l(e,"w","tblHeader");o&&(t.header=F(o));let r=l(e,"w","cantSplit");r&&(t.cantSplit=F(r));let i=l(e,"w","jc");if(i){let c=s(i,"w","val");(c==="left"||c==="center"||c==="right")&&(t.justification=c);}let a=l(e,"w","hidden");return a&&(t.hidden=F(a)),Object.keys(t).length>0?t:void 0}function $e(e,t){if(!e)return;let n={},o=l(e,"w","tcW");o&&(n.width=Z(o));let r=l(e,"w","tcBorders");r&&(n.borders=_e(r));let i=l(e,"w","tcMar");i&&(n.margins=Ge(i));let a=l(e,"w","shd");a&&(n.shading=ce(a));let c=l(e,"w","vAlign");if(c){let d=s(c,"w","val");(d==="top"||d==="center"||d==="bottom")&&(n.verticalAlign=d);}let f=l(e,"w","textDirection");if(f){let d=s(f,"w","val");d&&(n.textDirection=d);}let u=l(e,"w","gridSpan");if(u){let d=g(u,"w","val");d!==void 0&&(n.gridSpan=d);}let p=l(e,"w","vMerge");if(p){let d=s(p,"w","val");n.vMerge=d==="restart"?"restart":"continue";}let m=l(e,"w","tcFitText");m&&(n.fitText=F(m));let h=l(e,"w","noWrap");h&&(n.noWrap=F(h));let T=l(e,"w","hideMark");return T&&(n.hideMark=F(T)),Object.keys(n).length>0?n:void 0}function an(e,t){let n={styleId:s(e,"w","styleId")??"",type:s(e,"w","type")??"paragraph"},o=s(e,"w","default");o&&(n.default=o==="1"||o==="true");let r=l(e,"w","name");r&&(n.name=s(r,"w","val")??void 0);let i=l(e,"w","basedOn");i&&(n.basedOn=s(i,"w","val")??void 0);let a=l(e,"w","next");a&&(n.next=s(a,"w","val")??void 0);let c=l(e,"w","link");c&&(n.link=s(c,"w","val")??void 0);let f=l(e,"w","uiPriority");if(f){let b=g(f,"w","val");b!==void 0&&(n.uiPriority=b);}let u=l(e,"w","hidden");u&&(n.hidden=F(u));let p=l(e,"w","semiHidden");p&&(n.semiHidden=F(p));let m=l(e,"w","unhideWhenUsed");m&&(n.unhideWhenUsed=F(m));let h=l(e,"w","qFormat");h&&(n.qFormat=F(h));let T=l(e,"w","personal");T&&(n.personal=F(T));let d=l(e,"w","pPr");d&&(n.pPr=Se(d,t));let w=l(e,"w","rPr");w&&(n.rPr=le(w,t));let E=l(e,"w","tblPr");E&&(n.tblPr=ze(E));let k=l(e,"w","trPr");k&&(n.trPr=Ue(k));let P=l(e,"w","tcPr");P&&(n.tcPr=$e(P));let C=N(e,"w","tblStylePr");if(C.length>0){n.tblStylePr=[];for(let b of C){let x=s(b,"w","type");if(x){let S={type:x},y=l(b,"w","pPr");y&&(S.pPr=Se(y,t));let v=l(b,"w","rPr");v&&(S.rPr=le(v,t));let B=l(b,"w","tblPr");B&&(S.tblPr=ze(B));let A=l(b,"w","trPr");A&&(S.trPr=Ue(A));let I=l(b,"w","tcPr");I&&(S.tcPr=$e(I)),n.tblStylePr.push(S);}}}return n}function sn(e,t){if(!e)return;let n={},o=l(e,"w","rPrDefault");if(o){let i=l(o,"w","rPr");i&&(n.rPr=le(i,t));}let r=l(e,"w","pPrDefault");if(r){let i=l(r,"w","pPr");i&&(n.pPr=Se(i,t));}return n.rPr||n.pPr?n:void 0}function qe(e,t){if(!t)return e;if(!e)return t?{...t}:void 0;let n={...e};for(let o of Object.keys(t)){let r=t[o];r!==void 0&&(n[o]=typeof r=="object"&&r!==null?{...n[o]||{},...r}:r);}return n}function ln(e,t){if(!t)return e;if(!e)return t?{...t}:void 0;let n={...e};for(let o of Object.keys(t)){let r=t[o];if(r!==void 0)if(o==="runProperties")n.runProperties=qe(n.runProperties,t.runProperties);else if(o==="borders"||o==="numPr"||o==="frame"){let i=n[o],a=r;n[o]={...i||{},...a||{}};}else o==="tabs"&&Array.isArray(r)?n.tabs=[...r]:n[o]=r;}return n}function Ze(e,t,n,o=new Set){if(o.has(e.styleId)||(o.add(e.styleId),!e.basedOn))return e;let r=t.get(e.basedOn);if(!r)return e;let i=Ze(r,t,n,o),a={...e,pPr:ln(i.pPr,e.pPr),rPr:qe(i.rPr,e.rPr)};return e.type==="table"&&((i.tblPr||e.tblPr)&&(a.tblPr={...i.tblPr||{},...e.tblPr||{}}),(i.trPr||e.trPr)&&(a.trPr={...i.trPr||{},...e.trPr||{}}),(i.tcPr||e.tcPr)&&(a.tcPr={...i.tcPr||{},...e.tcPr||{}})),a}function Ce(e,t){let n=new Map;try{let o=q(e);if(!o)return n;let r=N(o,"w","style");for(let i of r){let a=an(i,t);a.styleId&&n.set(a.styleId,a);}for(let[i,a]of n){let c=Ze(a,n,t);n.set(i,c);}}catch(o){console.warn("Failed to parse styles:",o);}return n}function Ye(e,t){let n={styles:[]};try{let o=q(e);if(!o)return n;let r=l(o,"w","docDefaults");n.docDefaults=sn(r,t);let i=l(o,"w","latentStyles");i&&(n.latentStyles={defLockedState:s(i,"w","defLockedState")==="1",defUIPriority:g(i,"w","defUIPriority"),defSemiHidden:s(i,"w","defSemiHidden")==="1",defUnhideWhenUsed:s(i,"w","defUnhideWhenUsed")==="1",defQFormat:s(i,"w","defQFormat")==="1",count:g(i,"w","count")});let a=Ce(e,t);n.styles=Array.from(a.values());}catch(o){console.warn("Failed to parse style definitions:",o);}return n}function Ke(e){let t={abstractNums:[],nums:[]};if(!e)return ke(t);let n=q(e);if(!n)return ke(t);let o=N(n,"w","abstractNum");for(let i of o){let a=cn(i);a&&t.abstractNums.push(a);}let r=N(n,"w","num");for(let i of r){let a=fn(i);a&&t.nums.push(a);}return ke(t)}function cn(e){let t=s(e,"w","abstractNumId");if(t===null)return null;let n=parseInt(t,10);if(isNaN(n))return null;let o={abstractNumId:n,levels:[]},r=l(e,"w","multiLevelType");if(r){let u=s(r,"w","val");(u==="hybridMultilevel"||u==="multilevel"||u==="singleLevel")&&(o.multiLevelType=u);}let i=l(e,"w","name");i&&(o.name=s(i,"w","val")??void 0);let a=l(e,"w","numStyleLink");a&&(o.numStyleLink=s(a,"w","val")??void 0);let c=l(e,"w","styleLink");c&&(o.styleLink=s(c,"w","val")??void 0);let f=N(e,"w","lvl");for(let u of f){let p=Je(u);p&&o.levels.push(p);}return o.levels.sort((u,p)=>u.ilvl-p.ilvl),o}function fn(e){let t=s(e,"w","numId");if(t===null)return null;let n=parseInt(t,10);if(isNaN(n))return null;let o=l(e,"w","abstractNumId");if(!o)return null;let r=s(o,"w","val");if(r===null)return null;let i=parseInt(r,10);if(isNaN(i))return null;let a={numId:n,abstractNumId:i},c=N(e,"w","lvlOverride");if(c.length>0){a.levelOverrides=[];for(let f of c){let u=s(f,"w","ilvl");if(u===null)continue;let p=parseInt(u,10);if(isNaN(p))continue;let m={ilvl:p},h=l(f,"w","startOverride");if(h){let d=s(h,"w","val");if(d!==null){let w=parseInt(d,10);isNaN(w)||(m.startOverride=w);}}let T=l(f,"w","lvl");T&&(m.lvl=Je(T)??void 0),a.levelOverrides.push(m);}}return a}function Je(e){let t=s(e,"w","ilvl");if(t===null)return null;let n=parseInt(t,10);if(isNaN(n)||n<0||n>8)return null;let o={ilvl:n,numFmt:"decimal",lvlText:""},r=l(e,"w","start");if(r){let d=s(r,"w","val");if(d!==null){let w=parseInt(d,10);isNaN(w)||(o.start=w);}}let i=l(e,"w","numFmt");if(i){let d=s(i,"w","val");d&&(o.numFmt=un(d));}let a=l(e,"w","lvlText");a&&(o.lvlText=s(a,"w","val")??"");let c=l(e,"w","lvlJc");if(c){let d=s(c,"w","val");(d==="left"||d==="center"||d==="right")&&(o.lvlJc=d);}let f=l(e,"w","suff");if(f){let d=s(f,"w","val");(d==="tab"||d==="space"||d==="nothing")&&(o.suffix=d);}let u=l(e,"w","isLgl");u&&(o.isLgl=F(u));let p=l(e,"w","lvlRestart");if(p){let d=s(p,"w","val");if(d!==null){let w=parseInt(d,10);isNaN(w)||(o.lvlRestart=w);}}let m=l(e,"w","legacy");m&&(o.legacy={legacy:F(m),legacySpace:g(m,"w","legacySpace"),legacyIndent:g(m,"w","legacyIndent")});let h=l(e,"w","pPr");h&&(o.pPr=dn(h));let T=l(e,"w","rPr");return T&&(o.rPr=gn(T)),o}function un(e){return {decimal:"decimal",upperRoman:"upperRoman",lowerRoman:"lowerRoman",upperLetter:"upperLetter",lowerLetter:"lowerLetter",ordinal:"ordinal",cardinalText:"cardinalText",ordinalText:"ordinalText",hex:"hex",chicago:"chicago",bullet:"bullet",none:"none",decimalZero:"decimalZero",ganada:"ganada",chosung:"chosung",ideographDigital:"ideographDigital",japaneseCounting:"japaneseCounting",aiueo:"aiueo",iroha:"iroha",decimalFullWidth:"decimalFullWidth",decimalHalfWidth:"decimalHalfWidth",japaneseLegal:"japaneseLegal",japaneseDigitalTenThousand:"japaneseDigitalTenThousand",decimalEnclosedCircle:"decimalEnclosedCircle",decimalFullWidth2:"decimalFullWidth2",aiueoFullWidth:"aiueoFullWidth",irohaFullWidth:"irohaFullWidth",decimalEnclosedFullstop:"decimalEnclosedFullstop",decimalEnclosedParen:"decimalEnclosedParen",decimalEnclosedCircleChinese:"decimalEnclosedCircleChinese",ideographEnclosedCircle:"ideographEnclosedCircle",ideographTraditional:"ideographTraditional",ideographZodiac:"ideographZodiac",ideographZodiacTraditional:"ideographZodiacTraditional",taiwaneseCounting:"taiwaneseCounting",ideographLegalTraditional:"ideographLegalTraditional",taiwaneseCountingThousand:"taiwaneseCountingThousand",taiwaneseDigital:"taiwaneseDigital",chineseCounting:"chineseCounting",chineseLegalSimplified:"chineseLegalSimplified",chineseCountingThousand:"chineseCountingThousand",koreanDigital:"koreanDigital",koreanCounting:"koreanCounting",koreanLegal:"koreanLegal",koreanDigital2:"koreanDigital2",vietnameseCounting:"vietnameseCounting",russianLower:"russianLower",russianUpper:"russianUpper",numberInDash:"numberInDash",hebrew1:"hebrew1",hebrew2:"hebrew2",arabicAlpha:"arabicAlpha",arabicAbjad:"arabicAbjad",hindiVowels:"hindiVowels",hindiConsonants:"hindiConsonants",hindiNumbers:"hindiNumbers",hindiCounting:"hindiCounting",thaiLetters:"thaiLetters",thaiNumbers:"thaiNumbers",thaiCounting:"thaiCounting"}[e]??"decimal"}function dn(e){let t={},n=l(e,"w","ind");if(n){let r=g(n,"w","left"),i=g(n,"w","right"),a=g(n,"w","firstLine"),c=g(n,"w","hanging");r!==void 0&&(t.indentLeft=r),i!==void 0&&(t.indentRight=i),c!==void 0?(t.indentFirstLine=-c,t.hangingIndent=true):a!==void 0&&(t.indentFirstLine=a);}let o=l(e,"w","tabs");if(o){t.tabs=[];let r=N(o,"w","tab");for(let i of r){let a=g(i,"w","pos"),c=s(i,"w","val"),f=s(i,"w","leader");a!==void 0&&c&&t.tabs.push({position:a,alignment:pn(c),leader:mn(f)});}}return t}function pn(e){switch(e){case "left":return "left";case "center":return "center";case "right":return "right";case "decimal":return "decimal";case "bar":return "bar";case "clear":return "clear";case "num":return "num";default:return "left"}}function mn(e){if(e)switch(e){case "none":return "none";case "dot":return "dot";case "hyphen":return "hyphen";case "underscore":return "underscore";case "heavy":return "heavy";case "middleDot":return "middleDot";default:return}}function gn(e){let t={},n=l(e,"w","rFonts");n&&(t.fontFamily={ascii:s(n,"w","ascii")??void 0,hAnsi:s(n,"w","hAnsi")??void 0,eastAsia:s(n,"w","eastAsia")??void 0,cs:s(n,"w","cs")??void 0});let o=l(e,"w","sz");if(o){let c=g(o,"w","val");c!==void 0&&(t.fontSize=c);}let r=l(e,"w","color");if(r){let c=s(r,"w","val"),f=s(r,"w","themeColor");c==="auto"?t.color={auto:true}:f?t.color={themeColor:f,themeTint:s(r,"w","themeTint")??void 0,themeShade:s(r,"w","themeShade")??void 0}:c&&(t.color={rgb:c});}let i=l(e,"w","b");i&&(t.bold=F(i));let a=l(e,"w","i");return a&&(t.italic=F(a)),t}function ke(e){let t=new Map;for(let o of e.abstractNums)t.set(o.abstractNumId,o);let n=new Map;for(let o of e.nums)n.set(o.numId,o);return {definitions:e,getLevel(o,r){let i=n.get(o);if(!i)return null;if(i.levelOverrides){let c=i.levelOverrides.find(f=>f.ilvl===r);if(c){if(c.lvl)return c.lvl;let f=t.get(i.abstractNumId);if(f){let u=f.levels.find(p=>p.ilvl===r);if(u&&c.startOverride!==void 0)return {...u,start:c.startOverride}}}}let a=t.get(i.abstractNumId);return a?a.levels.find(c=>c.ilvl===r)??null:null},getAbstract(o){return t.get(o)??null},hasNumbering(o){return n.has(o)}}}var hn=914400,wn=96;function ar(e){return e==null||isNaN(e)?0:Math.round(e*wn/hn)}function bn(e){if(!e)return;let t=parseInt(e,10);if(!isNaN(t))return t/6e4}function X(e,t){let n=D(e);for(let o of n)if(o.name===t)return o;return null}function yn(e,t){let n=D(e);for(let o of n)if(t.includes(o.name||""))return o;return null}function Qe(e){if(!e)return {width:0,height:0};let t=g(e,null,"cx")??0,n=g(e,null,"cy")??0;return {width:t,height:n}}function et(e){if(!e)return;let t=g(e,null,"l")??0,n=g(e,null,"t")??0,o=g(e,null,"r")??0,r=g(e,null,"b")??0;if(!(t===0&&n===0&&o===0&&r===0))return {left:t,top:n,right:o,bottom:r}}function tt(e){if(!e)return {};let t=s(e,null,"id")??void 0,n=s(e,null,"name")??void 0,o=s(e,null,"descr")??void 0,r=s(e,null,"title")??void 0,i=s(e,null,"decorative")==="1";return {id:t,name:n,alt:o,title:r,decorative:i||void 0}}function xn(e){if(!e)return;let t=s(e,null,"relativeFrom")??"column",n=X(e,"wp:align");if(n){let r=n.elements?.[0]?.text??null;return {relativeTo:t,alignment:r}}let o=X(e,"wp:posOffset");if(o){let r=String(o.elements?.[0]?.text??"0"),i=parseInt(r,10);return {relativeTo:t,posOffset:isNaN(i)?0:i}}return {relativeTo:t}}function Tn(e){if(!e)return;let t=s(e,null,"relativeFrom")??"paragraph",n=X(e,"wp:align");if(n){let r=n.elements?.[0]?.text??null;return {relativeTo:t,alignment:r}}let o=X(e,"wp:posOffset");if(o){let r=String(o.elements?.[0]?.text??"0"),i=parseInt(r,10);return {relativeTo:t,posOffset:isNaN(i)?0:i}}return {relativeTo:t}}var Fn=["wp:wrapNone","wp:wrapSquare","wp:wrapTight","wp:wrapThrough","wp:wrapTopAndBottom"];function Sn(e,t,n){if(!e){let E={type:t?"behind":"inFront"};return n?.distT!==void 0&&(E.distT=n.distT),n?.distB!==void 0&&(E.distB=n.distB),n?.distL!==void 0&&(E.distL=n.distL),n?.distR!==void 0&&(E.distR=n.distR),E}let r=(e.name||"").replace("wp:",""),i=g(e,null,"distT")??void 0,a=g(e,null,"distB")??void 0,c=g(e,null,"distL")??void 0,f=g(e,null,"distR")??void 0,u=i??n?.distT,p=a??n?.distB,m=c??n?.distL,h=f??n?.distR,T=s(e,null,"wrapText")??void 0,d;switch(r){case "wrapNone":d=t?"behind":"inFront";break;case "wrapSquare":d="square";break;case "wrapTight":d="tight";break;case "wrapThrough":d="through";break;case "wrapTopAndBottom":d="topAndBottom";break;default:d="square";}let w={type:d};return T&&(w.wrapText=T),u!==void 0&&(w.distT=u),p!==void 0&&(w.distB=p),m!==void 0&&(w.distL=m),h!==void 0&&(w.distR=h),w}function nt(e){if(!e)return;let t=s(e,null,"rot"),n=s(e,null,"flipH")==="1",o=s(e,null,"flipV")==="1",r=bn(t);if(r===void 0&&!n&&!o)return;let i={};return r!==void 0&&(i.rotation=r),n&&(i.flipH=true),o&&(i.flipV=true),i}function ot(e){let t=X(e,"a:graphic");if(!t)return null;let n=X(t,"a:graphicData");if(!n)return null;let o=X(n,"pic:pic");if(!o)return null;let r=X(o,"pic:blipFill");return r?X(r,"a:blip"):null}function rt(e){if(!e)return "";let t=s(e,"r","embed");if(t)return t;let n=s(e,null,"embed");if(n)return n;let o=s(e,"r","link");return o||""}function it(e){let t=X(e,"a:graphic");if(!t)return null;let n=X(t,"a:graphicData");if(!n)return null;let o=X(n,"pic:pic");if(!o)return null;let r=X(o,"pic:spPr");return r?X(r,"a:xfrm"):null}function Cn(e){if(!e)return e;let t=e.replace(/^\/+/,"");return t.startsWith("media/")?t=`word/${t}`:t.startsWith("word/")||(t=`word/${t}`),t}function kn(e){let t=e.split(".").pop()?.toLowerCase()??"";return {png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",tiff:"image/tiff",tif:"image/tiff",webp:"image/webp",svg:"image/svg+xml",emf:"image/x-emf",wmf:"image/x-wmf"}[t]??"application/octet-stream"}function at(e,t,n){if(!e||!t)return {};let o=t.get(e);if(!o)return {};let r=o.target;if(!r)return {};let i=Cn(r),a=r.split("/").pop(),c=(f,u)=>{let p=u.toLowerCase();for(let[m,h]of f.entries())if(m.toLowerCase()===p)return h};if(n){let f=c(n,i);if(f)return {src:f.dataUrl||f.base64,mimeType:f.mimeType,filename:a};let u=r.replace(/^\/+/,""),p=c(n,u);if(p)return {src:p.dataUrl||p.base64,mimeType:p.mimeType,filename:a};let m=`word/${u}`,h=c(n,m);if(h)return {src:h.dataUrl||h.base64,mimeType:h.mimeType,filename:a}}return {mimeType:kn(r),filename:a}}function Mn(e,t,n){let o=X(e,"wp:extent"),r=Qe(o),i=X(e,"wp:effectExtent"),a=et(i),c=X(e,"wp:docPr"),f=tt(c),u=ot(e),p=rt(u),m=at(p,t,n),h=it(e),T=nt(h),d=g(e,null,"distT")??void 0,w=g(e,null,"distB")??void 0,E=g(e,null,"distL")??void 0,k=g(e,null,"distR")??void 0,P={type:"inline"};d!==void 0&&(P.distT=d),w!==void 0&&(P.distB=w),E!==void 0&&(P.distL=E),k!==void 0&&(P.distR=k);let C={type:"image",rId:p,size:r,wrap:P};return f.id&&(C.id=f.id),f.alt&&(C.alt=f.alt),f.title&&(C.title=f.title),f.decorative&&(C.decorative=true),m.src&&(C.src=m.src),m.mimeType&&(C.mimeType=m.mimeType),m.filename&&(C.filename=m.filename),a&&(C.padding=a),T&&(C.transform=T),C}function vn(e,t,n){let o=X(e,"wp:extent"),r=Qe(o),i=X(e,"wp:effectExtent"),a=et(i),c=X(e,"wp:docPr"),f=tt(c),u=s(e,null,"behindDoc")==="1",p={distT:g(e,null,"distT")??void 0,distB:g(e,null,"distB")??void 0,distL:g(e,null,"distL")??void 0,distR:g(e,null,"distR")??void 0},m=yn(e,Fn),h=Sn(m,u,p),T=X(e,"wp:positionH"),d=X(e,"wp:positionV"),w=xn(T),E=Tn(d),k;(w||E)&&(k={horizontal:w??{relativeTo:"column"},vertical:E??{relativeTo:"paragraph"}});let P=ot(e),C=rt(P),b=at(C,t,n),x=it(e),S=nt(x),y={type:"image",rId:C,size:r,wrap:h};return f.id&&(y.id=f.id),f.alt&&(y.alt=f.alt),f.title&&(y.title=f.title),f.decorative&&(y.decorative=true),b.src&&(y.src=b.src),b.mimeType&&(y.mimeType=b.mimeType),b.filename&&(y.filename=b.filename),k&&(y.position=k),a&&(y.padding=a),S&&(y.transform=S),y}function Rn(e,t,n){let o=D(e);for(let r of o){let i=r.name||"";if(i==="wp:inline")return Mn(r,t,n);if(i==="wp:anchor")return vn(r,t,n)}return null}function st(e,t,n){return Rn(e,t,n)}function lt(e,t,n,o){let r={};return e&&e!=="auto"?r.rgb=e:e==="auto"&&(r.auto=true),t&&(r.themeColor=t),n&&(r.themeTint=n),o&&(r.themeShade=o),r}function En(e){if(!e)return;let t={},n=s(e,"w","color");n&&n!=="auto"&&(t.color={rgb:n});let o=s(e,"w","fill");o&&o!=="auto"&&(t.fill={rgb:o});let r=s(e,"w","themeFill");r&&(t.fill=t.fill||{},t.fill.themeColor=r);let i=s(e,"w","themeFillTint");i&&t.fill&&(t.fill.themeTint=i);let a=s(e,"w","themeFillShade");a&&t.fill&&(t.fill.themeShade=a);let c=s(e,"w","val");return c&&(t.pattern=c),Object.keys(t).length>0?t:void 0}function Me(e,t,n){if(!e)return;let o={},r=l(e,"w","b");r&&(o.bold=F(r));let i=l(e,"w","bCs");i&&(o.boldCs=F(i));let a=l(e,"w","i");a&&(o.italic=F(a));let c=l(e,"w","iCs");c&&(o.italicCs=F(c));let f=l(e,"w","u");if(f){let M=s(f,"w","val");if(M){o.underline={style:M};let L=s(f,"w","color"),$=s(f,"w","themeColor");(L||$)&&(o.underline.color=lt(L,$,s(f,"w","themeTint"),s(f,"w","themeShade")));}}let u=l(e,"w","strike");u&&(o.strike=F(u));let p=l(e,"w","dstrike");p&&(o.doubleStrike=F(p));let m=l(e,"w","vertAlign");if(m){let M=s(m,"w","val");(M==="superscript"||M==="subscript"||M==="baseline")&&(o.vertAlign=M);}let h=l(e,"w","smallCaps");h&&(o.smallCaps=F(h));let T=l(e,"w","caps");T&&(o.allCaps=F(T));let d=l(e,"w","vanish");d&&(o.hidden=F(d));let w=l(e,"w","color");w&&(o.color=lt(s(w,"w","val"),s(w,"w","themeColor"),s(w,"w","themeTint"),s(w,"w","themeShade")));let E=l(e,"w","highlight");if(E){let M=s(E,"w","val");M&&(o.highlight=M);}let k=l(e,"w","shd");k&&(o.shading=En(k));let P=l(e,"w","sz");if(P){let M=g(P,"w","val");M!==void 0&&(o.fontSize=M);}let C=l(e,"w","szCs");if(C){let M=g(C,"w","val");M!==void 0&&(o.fontSizeCs=M);}let b=l(e,"w","rFonts");if(b){o.fontFamily={ascii:s(b,"w","ascii")??void 0,hAnsi:s(b,"w","hAnsi")??void 0,eastAsia:s(b,"w","eastAsia")??void 0,cs:s(b,"w","cs")??void 0};let M=s(b,"w","asciiTheme");M&&(o.fontFamily.asciiTheme=M,t&&!o.fontFamily.ascii&&(o.fontFamily.ascii=_(t,M)));let L=s(b,"w","hAnsiTheme");L&&(o.fontFamily.hAnsiTheme=L,t&&!o.fontFamily.hAnsi&&(o.fontFamily.hAnsi=_(t,L)));let $=s(b,"w","eastAsiaTheme");$&&(o.fontFamily.eastAsiaTheme=$,t&&!o.fontFamily.eastAsia&&(o.fontFamily.eastAsia=_(t,$)));let we=s(b,"w","cstheme");we&&(o.fontFamily.csTheme=we,t&&!o.fontFamily.cs&&(o.fontFamily.cs=_(t,we)));}let x=l(e,"w","spacing");if(x){let M=g(x,"w","val");M!==void 0&&(o.spacing=M);}let S=l(e,"w","position");if(S){let M=g(S,"w","val");M!==void 0&&(o.position=M);}let y=l(e,"w","w");if(y){let M=g(y,"w","val");M!==void 0&&(o.scale=M);}let v=l(e,"w","kern");if(v){let M=g(v,"w","val");M!==void 0&&(o.kerning=M);}let B=l(e,"w","effect");if(B){let M=s(B,"w","val");M&&(o.effect=M);}let A=l(e,"w","em");if(A){let M=s(A,"w","val");M&&(o.emphasisMark=M);}let I=l(e,"w","emboss");I&&(o.emboss=F(I));let O=l(e,"w","imprint");O&&(o.imprint=F(O));let U=l(e,"w","outline");U&&(o.outline=F(U));let K=l(e,"w","shadow");K&&(o.shadow=F(K));let H=l(e,"w","rtl");H&&(o.rtl=F(H));let W=l(e,"w","cs");W&&(o.cs=F(W));let R=l(e,"w","rStyle");if(R){let M=s(R,"w","val");M&&(o.styleId=M);}return Object.keys(o).length>0?o:void 0}function Pn(e){let t=re(e),n=s(e,"xml","space")==="preserve";return {type:"text",text:t,preserveSpace:n||void 0}}function Bn(){return {type:"tab"}}function An(e){let t=s(e,"w","type"),n=s(e,"w","clear"),o={type:"break"};return (t==="page"||t==="column"||t==="textWrapping")&&(o.breakType=t),(n==="none"||n==="left"||n==="right"||n==="all")&&(o.clear=n),o}function Nn(e){let t=s(e,"w","font")??"",n=s(e,"w","char")??"";return {type:"symbol",font:t,char:n}}function In(e){return {type:"footnoteRef",id:g(e,"w","id")??0}}function Xn(e){return {type:"endnoteRef",id:g(e,"w","id")??0}}function Ln(e){let t=s(e,"w","fldCharType"),n=s(e,"w","fldLock")==="true"||s(e,"w","fldLock")==="1",o=s(e,"w","dirty")==="true"||s(e,"w","dirty")==="1",r="begin";return t==="separate"?r="separate":t==="end"&&(r="end"),{type:"fieldChar",charType:r,fldLock:n||void 0,dirty:o||void 0}}function Dn(e){return {type:"instrText",text:re(e)}}function Hn(e,t,n){let o=st(e,t??void 0,n??void 0);return o?{type:"drawing",image:o}:null}function On(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function Wn(e,t,n){let o=[],r=D(e);for(let i of r)switch(On(i.name)){case "t":o.push(Pn(i));break;case "tab":o.push(Bn());break;case "br":o.push(An(i));break;case "sym":o.push(Nn(i));break;case "footnoteReference":o.push(In(i));break;case "endnoteReference":o.push(Xn(i));break;case "fldChar":o.push(Ln(i));break;case "instrText":o.push(Dn(i));break;case "softHyphen":o.push({type:"softHyphen"});break;case "noBreakHyphen":o.push({type:"noBreakHyphen"});break;case "drawing":let c=Hn(i,t,n);c&&o.push(c);break;case "pict":case "object":break;case "rPr":break;case "lastRenderedPageBreak":break;case "cr":o.push({type:"break",breakType:"textWrapping"});break;}return o}function ee(e,t,n,o=null,r=null){let i={type:"run",content:[]},a=l(e,"w","rPr");return a&&(i.formatting=Me(a,n)),i.content=Wn(e,o,r),i}function jn(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function Vn(e){let t=g(e,"w","id")??0,n=s(e,"w","name")??"",o={type:"bookmarkStart",id:t,name:n},r=g(e,"w","colFirst");r!==void 0&&(o.colFirst=r);let i=g(e,"w","colLast");return i!==void 0&&(o.colLast=i),o}function zn(e){return {type:"bookmarkEnd",id:g(e,"w","id")??0}}function ct(e,t,n=null,o=null,r=null){let i={type:"hyperlink",children:[]},a=s(e,"r","id");if(a&&(i.rId=a,t)){let T=t.get(a);T&&(He(T),i.href=T.target);}let c=s(e,"w","anchor");c&&(i.anchor=c,i.href||(i.href=`#${c}`));let f=s(e,"w","tooltip");f&&(i.tooltip=f);let u=s(e,"w","tgtFrame");u&&(i.target=u);let p=s(e,"w","history");(p==="1"||p==="true")&&(i.history=true);let m=s(e,"w","docLocation");m&&(i.docLocation=m);let h=D(e);for(let T of h)switch(jn(T.name)){case "r":i.children.push(ee(T,n,o,t,r));break;case "bookmarkStart":i.children.push(Vn(T));break;case "bookmarkEnd":i.children.push(zn(T));break}return i}function ft(e){let t=g(e,"w","id")??0,n=s(e,"w","name")??"",o={type:"bookmarkStart",id:t,name:n},r=g(e,"w","colFirst");r!==void 0&&(o.colFirst=r);let i=g(e,"w","colLast");return i!==void 0&&(o.colLast=i),o}function ut(e){return {type:"bookmarkEnd",id:g(e,"w","id")??0}}function Un(e){if(!e)return;let t=g(e,"w","w")??0,n=s(e,"w","type")??"dxa",o="dxa";return (n==="auto"||n==="dxa"||n==="nil"||n==="pct")&&(o=n),{value:t,type:o}}function Y(e){return Un(e)}function J(e){if(!e)return;let o={style:s(e,"w","val")??"none"},r=g(e,"w","sz");r!==void 0&&(o.size=r);let i=g(e,"w","space");i!==void 0&&(o.space=i);let a=s(e,"w","color"),c=s(e,"w","themeColor"),f=s(e,"w","themeTint"),u=s(e,"w","themeShade");(a||c||f||u)&&(o.color={rgb:a??void 0,themeColor:c,themeTint:f??void 0,themeShade:u??void 0});let p=s(e,"w","shadow");(p==="1"||p==="true")&&(o.shadow=true);let m=s(e,"w","frame");return (m==="1"||m==="true")&&(o.frame=true),o}function dt(e){if(!e)return;let t={},n=J(l(e,"w","top"));n&&(t.top=n);let o=J(l(e,"w","bottom"));o&&(t.bottom=o);let r=J(l(e,"w","left")??l(e,"w","start"));r&&(t.left=r);let i=J(l(e,"w","right")??l(e,"w","end"));i&&(t.right=i);let a=J(l(e,"w","insideH"));a&&(t.insideH=a);let c=J(l(e,"w","insideV"));if(c&&(t.insideV=c),Object.keys(t).length!==0)return t}function pt(e){if(!e)return;let t={},n=Y(l(e,"w","top"));n&&(t.top=n);let o=Y(l(e,"w","bottom"));o&&(t.bottom=o);let r=Y(l(e,"w","left")??l(e,"w","start"));r&&(t.left=r);let i=Y(l(e,"w","right")??l(e,"w","end"));if(i&&(t.right=i),Object.keys(t).length!==0)return t}function mt(e){if(!e)return;let t={},n=s(e,"w","fill");n&&n!=="auto"&&(t.fill={rgb:n});let o=s(e,"w","themeFill");if(o){t.fill={themeColor:o};let a=s(e,"w","themeFillTint");a&&t.fill&&(t.fill.themeTint=a);let c=s(e,"w","themeFillShade");c&&t.fill&&(t.fill.themeShade=c);}let r=s(e,"w","color");r&&r!=="auto"&&(t.color={rgb:r});let i=s(e,"w","val");if(i&&(t.pattern=i),Object.keys(t).length!==0)return t}function $n(e){if(!e)return;let t={},n=s(e,"w","firstRow");(n==="1"||n==="true")&&(t.firstRow=true);let o=s(e,"w","lastRow");(o==="1"||o==="true")&&(t.lastRow=true);let r=s(e,"w","firstColumn");(r==="1"||r==="true")&&(t.firstColumn=true);let i=s(e,"w","lastColumn");(i==="1"||i==="true")&&(t.lastColumn=true);let a=s(e,"w","noHBand");(a==="1"||a==="true")&&(t.noHBand=true);let c=s(e,"w","noVBand");(c==="1"||c==="true")&&(t.noVBand=true);let f=s(e,"w","val");if(f){let u=parseInt(f,16);isNaN(u)||(u&32&&(t.firstRow=true),u&64&&(t.lastRow=true),u&128&&(t.firstColumn=true),u&256&&(t.lastColumn=true),u&512&&(t.noHBand=true),u&1024&&(t.noVBand=true));}if(Object.keys(t).length!==0)return t}function _n(e){if(!e)return;let t={},n=s(e,"w","horzAnchor");(n==="margin"||n==="page"||n==="text")&&(t.horzAnchor=n);let o=s(e,"w","vertAnchor");(o==="margin"||o==="page"||o==="text")&&(t.vertAnchor=o);let r=g(e,"w","tblpX");r!==void 0&&(t.tblpX=r);let i=s(e,"w","tblpXSpec");i&&(t.tblpXSpec=i);let a=g(e,"w","tblpY");a!==void 0&&(t.tblpY=a);let c=s(e,"w","tblpYSpec");c&&(t.tblpYSpec=c);let f=g(e,"w","topFromText");f!==void 0&&(t.topFromText=f);let u=g(e,"w","bottomFromText");u!==void 0&&(t.bottomFromText=u);let p=g(e,"w","leftFromText");p!==void 0&&(t.leftFromText=p);let m=g(e,"w","rightFromText");if(m!==void 0&&(t.rightFromText=m),Object.keys(t).length!==0)return t}function Gn(e){if(!e)return;let t={},n=Y(l(e,"w","tblW"));n&&(t.width=n);let o=l(e,"w","jc");if(o){let w=s(o,"w","val");(w==="left"||w==="center"||w==="right"||w==="start")&&(t.justification=w==="start"?"left":w);}let r=Y(l(e,"w","tblCellSpacing"));r&&(t.cellSpacing=r);let i=Y(l(e,"w","tblInd"));i&&(t.indent=i);let a=dt(l(e,"w","tblBorders"));a&&(t.borders=a);let c=pt(l(e,"w","tblCellMar"));c&&(t.cellMargins=c);let f=l(e,"w","tblLayout");if(f){let w=s(f,"w","type");(w==="fixed"||w==="autofit")&&(t.layout=w);}let u=l(e,"w","tblStyle");if(u){let w=s(u,"w","val");w&&(t.styleId=w);}let p=$n(l(e,"w","tblLook"));p&&(t.look=p);let m=mt(l(e,"w","shd"));m&&(t.shading=m);let h=l(e,"w","tblOverlap");if(h){let w=s(h,"w","val");(w==="never"||w==="overlap")&&(t.overlap=w);}let T=_n(l(e,"w","tblpPr"));if(T&&(t.floating=T),F(l(e,"w","bidiVisual"))&&(t.bidi=true),Object.keys(t).length!==0)return t}function qn(e){if(!e)return;let t={},n=l(e,"w","trHeight");if(n){let f=Y(n);f&&(t.height=f);let u=s(n,"w","hRule");(u==="auto"||u==="atLeast"||u==="exact")&&(t.heightRule=u);}F(l(e,"w","tblHeader"))&&(t.header=true),F(l(e,"w","cantSplit"))&&(t.cantSplit=true);let i=l(e,"w","jc");if(i){let f=s(i,"w","val");(f==="left"||f==="center"||f==="right")&&(t.justification=f);}F(l(e,"w","hidden"))&&(t.hidden=true);let c=gt(l(e,"w","cnfStyle"));if(c&&(t.conditionalFormat=c),Object.keys(t).length!==0)return t}function gt(e){if(!e)return;let t={},n=s(e,"w","firstRow");(n==="1"||n==="true")&&(t.firstRow=true);let o=s(e,"w","lastRow");(o==="1"||o==="true")&&(t.lastRow=true);let r=s(e,"w","firstColumn");(r==="1"||r==="true")&&(t.firstColumn=true);let i=s(e,"w","lastColumn");(i==="1"||i==="true")&&(t.lastColumn=true);let a=s(e,"w","oddHBand");(a==="1"||a==="true")&&(t.oddHBand=true);let c=s(e,"w","evenHBand");(c==="1"||c==="true")&&(t.evenHBand=true);let f=s(e,"w","oddVBand");(f==="1"||f==="true")&&(t.oddVBand=true);let u=s(e,"w","evenVBand");(u==="1"||u==="true")&&(t.evenVBand=true);let p=s(e,"w","firstRowFirstColumn");(p==="1"||p==="true")&&(t.nwCell=true);let m=s(e,"w","firstRowLastColumn");(m==="1"||m==="true")&&(t.neCell=true);let h=s(e,"w","lastRowFirstColumn");(h==="1"||h==="true")&&(t.swCell=true);let T=s(e,"w","lastRowLastColumn");(T==="1"||T==="true")&&(t.seCell=true);let d=s(e,"w","val");if(d&&d.length===12&&(d[0]==="1"&&(t.firstRow=true),d[1]==="1"&&(t.lastRow=true),d[2]==="1"&&(t.firstColumn=true),d[3]==="1"&&(t.lastColumn=true),d[4]==="1"&&(t.oddVBand=true),d[5]==="1"&&(t.evenVBand=true),d[6]==="1"&&(t.oddHBand=true),d[7]==="1"&&(t.evenHBand=true),d[8]==="1"&&(t.nwCell=true),d[9]==="1"&&(t.neCell=true),d[10]==="1"&&(t.swCell=true),d[11]==="1"&&(t.seCell=true)),Object.keys(t).length!==0)return t}function Zn(e){if(!e)return;let t={},n=Y(l(e,"w","tcW"));n&&(t.width=n);let o=dt(l(e,"w","tcBorders"));o&&(t.borders=o);let r=pt(l(e,"w","tcMar"));r&&(t.margins=r);let i=mt(l(e,"w","shd"));i&&(t.shading=i);let a=l(e,"w","vAlign");if(a){let d=s(a,"w","val");(d==="top"||d==="center"||d==="bottom")&&(t.verticalAlign=d);}let c=l(e,"w","textDirection");if(c){let d=s(c,"w","val");d&&(t.textDirection=d);}let f=l(e,"w","gridSpan");if(f){let d=g(f,"w","val");d!==void 0&&d>1&&(t.gridSpan=d);}let u=l(e,"w","vMerge");u&&(s(u,"w","val")==="restart"?t.vMerge="restart":t.vMerge="continue"),F(l(e,"w","tcFitText"))&&(t.fitText=true),F(l(e,"w","noWrap"))&&(t.noWrap=true),F(l(e,"w","hideMark"))&&(t.hideMark=true);let T=gt(l(e,"w","cnfStyle"));if(T&&(t.conditionalFormat=T),Object.keys(t).length!==0)return t}function Yn(e,t,n,o,r,i){let a=[],c=e.elements||[];for(let f of c){if(!f.name)continue;let u=f.name.split(":").pop();if(u==="p"){let p=z(f,t,n,o,r,i);a.push(p);}else if(u==="tbl"){let p=te(f,t,n,o,r,i);a.push(p);}}return a.length===0&&a.push({type:"paragraph",content:[]}),a}function Kn(e,t,n,o,r,i){let a={type:"tableCell",content:[]},c=Zn(l(e,"w","tcPr"));return c&&(a.formatting=c),a.content=Yn(e,t,n,o,r,i),a}function Jn(e,t,n,o,r,i){let a={type:"tableRow",cells:[]},c=qn(l(e,"w","trPr"));c&&(a.formatting=c);let f=N(e,"w","tc");for(let u of f){let p=Kn(u,t,n,o,r,i);a.cells.push(p);}return a}function Qn(e){if(!e)return;let t=[],n=N(e,"w","gridCol");for(let o of n){let r=g(o,"w","w")??0;t.push(r);}return t.length>0?t:void 0}function te(e,t,n,o,r,i){let a={type:"table",rows:[]},c=Gn(l(e,"w","tblPr"));c&&(a.formatting=c);let f=Qn(l(e,"w","tblGrid"));f&&(a.columnWidths=f);let u=N(e,"w","tr");for(let p of u){let m=Jn(p,t,n,o,r,i);a.rows.push(m);}return a}function ht(e){switch(e){case "first":return "first";case "even":return "even";default:return "default"}}function wt(e){let t=s(e,"w","type"),n=s(e,"r","id")??"";return {type:ht(t),rId:n}}function bt(e){let t=s(e,"w","type"),n=s(e,"r","id")??"";return {type:ht(t),rId:n}}function ve(e,t,n,o,r,i){let a=[],c=e.elements??[];for(let f of c){if(f.type!=="element")continue;let u=f.name??"";if(u==="w:p"||u.endsWith(":p")){let p=z(f,t,n,o,r,i);a.push(p);}else if(u==="w:tbl"||u.endsWith(":tbl")){let p=te(f,t,n,o,r,i);a.push(p);}else if(u==="w:sdt"||u.endsWith(":sdt")){let p=(f.elements??[]).find(m=>m.type==="element"&&(m.name==="w:sdtContent"||m.name?.endsWith(":sdtContent")));if(p){let m=ve(p,t,n,o,r,i);a.push(...m);}}}return a}function yt(e,t="default",n=null,o=null,r=null,i=null,a=null){let c={type:"header",hdrFtrType:t,content:[]};if(!e)return c;let f=j(e);if(!f)return c;let u=f.elements?.find(p=>p.type==="element"&&(p.name==="w:hdr"||p.name?.endsWith(":hdr")));return u&&(c.content=ve(u,n,o,r,i,a)),c}function xt(e,t="default",n=null,o=null,r=null,i=null,a=null){let c={type:"footer",hdrFtrType:t,content:[]};if(!e)return c;let f=j(e);if(!f)return c;let u=f.elements?.find(p=>p.type==="element"&&(p.name==="w:ftr"||p.name?.endsWith(":ftr")));return u&&(c.content=ve(u,n,o,r,i,a)),c}function Tt(e){switch(e){case "separator":return "separator";case "continuationSeparator":return "continuationSeparator";case "continuationNotice":return "continuationNotice";default:return "normal"}}function eo(e,t,n,o,r,i){let a=g(e,"w","id")??0,c=s(e,"w","type"),f=Tt(c),p=N(e,"w","p").map(m=>z(m,t,n,o,r));return {type:"footnote",id:a,noteType:f,content:p}}function Ft(e,t=null,n=null,o=null,r=null,i=null){let a=new Map,c=[];if(!e)return fe(a,c);let f=j(e);if(!f)return fe(a,c);let u=f.elements?.find(m=>m.type==="element"&&(m.name==="w:footnotes"||m.name?.endsWith(":footnotes")));if(!u)return fe(a,c);let p=N(u,"w","footnote");for(let m of p){let h=eo(m,t,n,o,r);a.set(h.id,h),c.push(h);}return fe(a,c)}function fe(e,t){return {byId:e,footnotes:t,getFootnote(n){return e.get(n)},hasFootnote(n){return e.has(n)},getNormalFootnotes(){return t.filter(n=>n.noteType==="normal")},getSeparator(){return t.find(n=>n.noteType==="separator")},getContinuationSeparator(){return t.find(n=>n.noteType==="continuationSeparator")}}}function to(e,t,n,o,r,i){let a=g(e,"w","id")??0,c=s(e,"w","type"),f=Tt(c),p=N(e,"w","p").map(m=>z(m,t,n,o,r));return {type:"endnote",id:a,noteType:f,content:p}}function St(e,t=null,n=null,o=null,r=null,i=null){let a=new Map,c=[];if(!e)return ue(a,c);let f=j(e);if(!f)return ue(a,c);let u=f.elements?.find(m=>m.type==="element"&&(m.name==="w:endnotes"||m.name?.endsWith(":endnotes")));if(!u)return ue(a,c);let p=N(u,"w","endnote");for(let m of p){let h=to(m,t,n,o,r);a.set(h.id,h),c.push(h);}return ue(a,c)}function ue(e,t){return {byId:e,endnotes:t,getEndnote(n){return e.get(n)},hasEndnote(n){return e.has(n)},getNormalEndnotes(){return t.filter(n=>n.noteType==="normal")},getSeparator(){return t.find(n=>n.noteType==="separator")},getContinuationSeparator(){return t.find(n=>n.noteType==="continuationSeparator")}}}function Ct(e){return e?{decimal:"decimal",upperRoman:"upperRoman",lowerRoman:"lowerRoman",upperLetter:"upperLetter",lowerLetter:"lowerLetter",ordinal:"ordinal",cardinalText:"cardinalText",ordinalText:"ordinalText",bullet:"bullet",chicago:"chicago",none:"none"}[e]:void 0}function no(e){switch(e){case "pageBottom":return "pageBottom";case "beneathText":return "beneathText";case "sectEnd":return "sectEnd";case "docEnd":return "docEnd";default:return}}function oo(e){switch(e){case "sectEnd":return "sectEnd";case "docEnd":return "docEnd";default:return}}function kt(e){switch(e){case "continuous":return "continuous";case "eachSect":return "eachSect";case "eachPage":return "eachPage";default:return}}function Mt(e){let t={};if(!e)return t;let n=l(e,"w","pos");if(n){let a=s(n,"w","val");t.position=no(a);}let o=l(e,"w","numFmt");if(o){let a=s(o,"w","val");t.numFmt=Ct(a);}let r=l(e,"w","numStart");r&&(t.numStart=g(r,"w","val")??void 0);let i=l(e,"w","numRestart");if(i){let a=s(i,"w","val");t.numRestart=kt(a);}return t}function vt(e){let t={};if(!e)return t;let n=l(e,"w","pos");if(n){let a=s(n,"w","val");t.position=oo(a);}let o=l(e,"w","numFmt");if(o){let a=s(o,"w","val");t.numFmt=Ct(a);}let r=l(e,"w","numStart");r&&(t.numStart=g(r,"w","val")??void 0);let i=l(e,"w","numRestart");if(i){let a=s(i,"w","val");t.numRestart=kt(a);}return t}function vr(e){let t=[];for(let n of e.content){let o=[];for(let r of n.content)if(r.type==="run")for(let i of r.content)i.type==="text"&&o.push(i.text);t.push(o.join(""));}return t.join(`
10
+ `)}function ro(e,t,n,o){if(!e&&!t)return;let r={};return e&&e!=="auto"?r.rgb=e:e==="auto"&&(r.auto=true),t&&(r.themeColor=t),n&&(r.themeTint=n),o&&(r.themeShade=o),Object.keys(r).length>0?r:void 0}function de(e){if(!e)return;let o={style:s(e,"w","val")??"none"},r=g(e,"w","sz");r!==void 0&&(o.size=r);let i=g(e,"w","space");i!==void 0&&(o.space=i);let a=s(e,"w","color"),c=s(e,"w","themeColor"),f=s(e,"w","themeTint"),u=s(e,"w","themeShade"),p=ro(a,c,f,u);p&&(o.color=p);let m=s(e,"w","shadow");(m==="1"||m==="true")&&(o.shadow=true);let h=s(e,"w","frame");return (h==="1"||h==="true")&&(o.frame=true),o}function io(e){switch(e){case "landscape":return "landscape";case "portrait":return "portrait";default:return}}function ao(e){switch(e){case "continuous":return "continuous";case "nextPage":return "nextPage";case "oddPage":return "oddPage";case "evenPage":return "evenPage";case "nextColumn":return "nextColumn";default:return}}function so(e){switch(e){case "top":return "top";case "center":return "center";case "both":return "both";case "bottom":return "bottom";default:return}}function lo(e){switch(e){case "continuous":return "continuous";case "newPage":return "newPage";case "newSection":return "newSection";default:return}}function pe(e,t){let n={};if(!e)return n;let o=l(e,"w","pgSz");if(o){let b=g(o,"w","w");b!==void 0&&(n.pageWidth=b);let x=g(o,"w","h");x!==void 0&&(n.pageHeight=x);let S=s(o,"w","orient"),y=io(S);y&&(n.orientation=y);}let r=l(e,"w","pgMar");if(r){let b=g(r,"w","top");b!==void 0&&(n.marginTop=b);let x=g(r,"w","bottom");x!==void 0&&(n.marginBottom=x);let S=g(r,"w","left");S!==void 0&&(n.marginLeft=S);let y=g(r,"w","right");y!==void 0&&(n.marginRight=y);let v=g(r,"w","header");v!==void 0&&(n.headerDistance=v);let B=g(r,"w","footer");B!==void 0&&(n.footerDistance=B);let A=g(r,"w","gutter");A!==void 0&&(n.gutter=A);}let i=l(e,"w","cols");if(i){let b=g(i,"w","num");b!==void 0&&(n.columnCount=b);let x=g(i,"w","space");x!==void 0&&(n.columnSpace=x);let S=s(i,"w","equalWidth");S==="1"||S==="true"?n.equalWidth=true:(S==="0"||S==="false")&&(n.equalWidth=false);let y=s(i,"w","sep");(y==="1"||y==="true")&&(n.separator=true);let v=N(i,"w","col");if(v.length>0){n.columns=[];for(let B of v){let A={},I=g(B,"w","w");I!==void 0&&(A.width=I);let O=g(B,"w","space");O!==void 0&&(A.space=O),n.columns.push(A);}}}let a=l(e,"w","type");if(a){let b=s(a,"w","val"),x=ao(b);x&&(n.sectionStart=x);}let c=l(e,"w","vAlign");if(c){let b=s(c,"w","val"),x=so(b);x&&(n.verticalAlign=x);}let f=l(e,"w","bidi");f&&(n.bidi=F(f));let u=N(e,"w","headerReference");u.length>0&&(n.headerReferences=u.map(b=>wt(b)));let p=N(e,"w","footerReference");p.length>0&&(n.footerReferences=p.map(b=>bt(b)));let m=l(e,"w","titlePg");m&&(n.titlePg=F(m));let h=l(e,"w","evenAndOddHeaders");h&&(n.evenAndOddHeaders=F(h));let T=l(e,"w","lnNumType");if(T){n.lineNumbers={};let b=g(T,"w","start");b!==void 0&&(n.lineNumbers.start=b);let x=g(T,"w","countBy");x!==void 0&&(n.lineNumbers.countBy=x);let S=g(T,"w","distance");S!==void 0&&(n.lineNumbers.distance=S);let y=s(T,"w","restart"),v=lo(y);v&&(n.lineNumbers.restart=v);}let d=l(e,"w","pgBorders");if(d){n.pageBorders={};let b=de(l(d,"w","top"));b&&(n.pageBorders.top=b);let x=de(l(d,"w","bottom"));x&&(n.pageBorders.bottom=x);let S=de(l(d,"w","left"));S&&(n.pageBorders.left=S);let y=de(l(d,"w","right"));y&&(n.pageBorders.right=y);let v=s(d,"w","display");(v==="allPages"||v==="firstPage"||v==="notFirstPage")&&(n.pageBorders.display=v);let B=s(d,"w","offsetFrom");(B==="page"||B==="text")&&(n.pageBorders.offsetFrom=B);let A=s(d,"w","zOrder");(A==="front"||A==="back")&&(n.pageBorders.zOrder=A);}let w=l(e,"w","background");if(w){n.background={};let b=s(w,"w","color");b&&b!=="auto"&&(n.background.color={rgb:b});let x=s(w,"w","themeColor");x&&(n.background.themeColor=x);let S=s(w,"w","themeTint");S&&(n.background.themeTint=S);let y=s(w,"w","themeShade");y&&(n.background.themeShade=y);}let E=l(e,"w","footnotePr");if(E){let b=Mt(E);Object.keys(b).length>0&&(n.footnotePr=b);}let k=l(e,"w","endnotePr");if(k){let b=vt(k);Object.keys(b).length>0&&(n.endnotePr=b);}let P=l(e,"w","docGrid");if(P){n.docGrid={};let b=s(P,"w","type");(b==="default"||b==="lines"||b==="linesAndChars"||b==="snapToChars")&&(n.docGrid.type=b);let x=g(P,"w","linePitch");x!==void 0&&(n.docGrid.linePitch=x);let S=g(P,"w","charSpace");S!==void 0&&(n.docGrid.charSpace=S);}let C=l(e,"w","paperSrc");if(C){let b=g(C,"w","first");b!==void 0&&(n.paperSrcFirst=b);let x=g(C,"w","other");x!==void 0&&(n.paperSrcOther=x);}return n}function Rt(){return {pageWidth:12240,pageHeight:15840,orientation:"portrait",marginTop:1440,marginBottom:1440,marginLeft:1440,marginRight:1440,headerDistance:720,footerDistance:720,gutter:0,columnCount:1,columnSpace:720,equalWidth:true,sectionStart:"nextPage",verticalAlign:"top"}}function co(e,t){return !e&&!t?true:!(!e||!t||e.bold!==t.bold||e.boldCs!==t.boldCs||e.italic!==t.italic||e.italicCs!==t.italicCs||e.strike!==t.strike||e.doubleStrike!==t.doubleStrike||e.smallCaps!==t.smallCaps||e.allCaps!==t.allCaps||e.hidden!==t.hidden||e.emboss!==t.emboss||e.imprint!==t.imprint||e.outline!==t.outline||e.shadow!==t.shadow||e.rtl!==t.rtl||e.cs!==t.cs||e.fontSize!==t.fontSize||e.fontSizeCs!==t.fontSizeCs||e.spacing!==t.spacing||e.position!==t.position||e.scale!==t.scale||e.kerning!==t.kerning||e.vertAlign!==t.vertAlign||e.highlight!==t.highlight||e.effect!==t.effect||e.emphasisMark!==t.emphasisMark||e.styleId!==t.styleId||!fo(e.underline,t.underline)||!me(e.color,t.color)||!uo(e.shading,t.shading)||!po(e.fontFamily,t.fontFamily))}function fo(e,t){return !e&&!t?true:!e||!t||e.style!==t.style?false:me(e.color,t.color)}function me(e,t){return !e&&!t?true:!e||!t?false:e.rgb===t.rgb&&e.auto===t.auto&&e.themeColor===t.themeColor&&e.themeTint===t.themeTint&&e.themeShade===t.themeShade}function uo(e,t){return !e&&!t?true:!(!e||!t||e.pattern!==t.pattern||!me(e.color,t.color)||!me(e.fill,t.fill))}function po(e,t){return !e&&!t?true:!e||!t?false:e.ascii===t.ascii&&e.hAnsi===t.hAnsi&&e.eastAsia===t.eastAsia&&e.cs===t.cs&&e.asciiTheme===t.asciiTheme&&e.hAnsiTheme===t.hAnsiTheme&&e.eastAsiaTheme===t.eastAsiaTheme&&e.csTheme===t.csTheme}function mo(e){return e.type==="text"||e.type==="softHyphen"||e.type==="noBreakHyphen"}function Et(e){return e.content.length===0?true:e.content.every(mo)}function go(e,t){let n=[];for(let o of e)n.push(o);if(n.length>0&&t.length>0&&n[n.length-1].type==="text"&&t[0].type==="text"){let o=n[n.length-1],r=t[0];n[n.length-1]={type:"text",text:o.text+r.text,preserveSpace:o.preserveSpace||r.preserveSpace||void 0};for(let i=1;i<t.length;i++)n.push(t[i]);}else for(let o of t)n.push(o);return n}function ho(e){if(e.length<=1)return e;let t=[],n=null;for(let o of e)if(o.content.length!==0){if(n===null){n={...o,content:[...o.content]};continue}Et(n)&&Et(o)&&co(n.formatting,o.formatting)?n={type:"run",formatting:n.formatting,content:go(n.content,o.content)}:(t.push(n),n={...o,content:[...o.content]});}return n!==null&&t.push(n),t}function Re(e){if(e.length<=1)return e;let t=[],n=[];function o(){if(n.length>0){let r=ho(n);t.push(...r),n.length=0;}}for(let r of e)if(r.type==="run")n.push(r);else if(o(),r.type==="hyperlink"){let i={...r,children:Re(r.children)};t.push(i);}else t.push(r);return o(),t}function wo(e){let t={sdtType:"richText"};if(!e||!e.elements)return t;for(let n of e.elements){if(n.type!=="element")continue;switch(n.name?.replace(/^w:/,"")??""){case "alias":t.alias=s(n,"w","val")??void 0;break;case "tag":t.tag=s(n,"w","val")??void 0;break;case "lock":t.lock=s(n,"w","val")??"unlocked";break;case "placeholder":{let r=l(n,"w","docPart");if(r){let i=l(r,"w","val");t.placeholder=i?s(i,"w","val")??void 0:void 0;}break}case "showingPlcHdr":t.showingPlaceholder=true;break;case "text":t.sdtType="plainText";break;case "date":t.sdtType="date",t.dateFormat=s(n,"w","fullDate")??void 0;break;case "dropDownList":t.sdtType="dropdown",t.listItems=Pt(n);break;case "comboBox":t.sdtType="comboBox",t.listItems=Pt(n);break;case "checkbox":{t.sdtType="checkbox";let r=l(n,"w14","checked")??l(n,"w","checked");t.checked=r?s(r,"w14","val")==="1"||s(r,"w","val")==="1":false;break}case "picture":t.sdtType="picture";break;case "docPartObj":t.sdtType="buildingBlockGallery";break;case "group":t.sdtType="group";break}}return t}function Pt(e){let t=[];for(let n of e.elements??[])n.type==="element"&&(n.name==="w:listItem"||n.name?.endsWith(":listItem"))&&t.push({displayText:s(n,"w","displayText")??"",value:s(n,"w","value")??""});return t}function Bt(e){let t="";if(e.type==="text"&&typeof e.text=="string")return e.text;if(e.elements)for(let n of e.elements)if((n.name?.replace(/^.*:/,"")??"")==="t"&&n.elements)for(let r of n.elements)r.type==="text"&&typeof r.text=="string"&&(t+=r.text);else t+=Bt(n);return t}function bo(e,t,n,o){let r={};return e&&e!=="auto"?r.rgb=e:e==="auto"&&(r.auto=true),t&&(r.themeColor=t),n&&(r.themeTint=n),o&&(r.themeShade=o),r}function yo(e){if(!e)return;let t={},n=s(e,"w","color");n&&n!=="auto"&&(t.color={rgb:n});let o=s(e,"w","fill");o&&o!=="auto"&&(t.fill={rgb:o});let r=s(e,"w","themeFill");r&&(t.fill=t.fill||{},t.fill.themeColor=r);let i=s(e,"w","themeFillTint");i&&t.fill&&(t.fill.themeTint=i);let a=s(e,"w","themeFillShade");a&&t.fill&&(t.fill.themeShade=a);let c=s(e,"w","val");return c&&(t.pattern=c),Object.keys(t).length>0?t:void 0}function Q(e){if(!e)return;let t=s(e,"w","val");if(!t)return;let n={style:t},o=s(e,"w","color"),r=s(e,"w","themeColor");(o||r)&&(n.color=bo(o,r,s(e,"w","themeTint"),s(e,"w","themeShade")));let i=g(e,"w","sz");i!==void 0&&(n.size=i);let a=g(e,"w","space");a!==void 0&&(n.space=a);let c=s(e,"w","shadow");c&&(n.shadow=c==="1"||c==="true");let f=s(e,"w","frame");return f&&(n.frame=f==="1"||f==="true"),n}function xo(e){if(!e)return;let t=N(e,"w","tab");if(t.length===0)return;let n=[];for(let o of t){let r=g(o,"w","pos"),i=s(o,"w","val");if(r!==void 0&&i){let a={position:r,alignment:i},c=s(o,"w","leader");c&&(a.leader=c),n.push(a);}}return n.length>0?n:void 0}function To(e){if(!e)return;let t={},n=g(e,"w","w");n!==void 0&&(t.width=n);let o=g(e,"w","h");o!==void 0&&(t.height=o);let r=s(e,"w","hAnchor");(r==="text"||r==="margin"||r==="page")&&(t.hAnchor=r);let i=s(e,"w","vAnchor");(i==="text"||i==="margin"||i==="page")&&(t.vAnchor=i);let a=g(e,"w","x");a!==void 0&&(t.x=a);let c=g(e,"w","y");c!==void 0&&(t.y=c);let f=s(e,"w","xAlign");f&&(t.xAlign=f);let u=s(e,"w","yAlign");u&&(t.yAlign=u);let p=s(e,"w","wrap");return p&&(t.wrap=p),Object.keys(t).length>0?t:void 0}function Fo(e,t,n){if(!e)return;let o={},r=l(e,"w","jc");if(r){let y=s(r,"w","val");y&&(o.alignment=y);}let i=l(e,"w","bidi");i&&(o.bidi=F(i));let a=l(e,"w","spacing");if(a){let y=g(a,"w","before");y!==void 0&&(o.spaceBefore=y);let v=g(a,"w","after");v!==void 0&&(o.spaceAfter=v);let B=g(a,"w","line");B!==void 0&&(o.lineSpacing=B);let A=s(a,"w","lineRule");A&&(o.lineSpacingRule=A);let I=s(a,"w","beforeAutospacing");I&&(o.beforeAutospacing=I==="1"||I==="true");let O=s(a,"w","afterAutospacing");O&&(o.afterAutospacing=O==="1"||O==="true");}let c=l(e,"w","ind");if(c){let y=g(c,"w","left");y!==void 0&&(o.indentLeft=y);let v=g(c,"w","right");v!==void 0&&(o.indentRight=v);let B=g(c,"w","firstLine");B!==void 0&&(o.indentFirstLine=B);let A=g(c,"w","hanging");A!==void 0&&(o.indentFirstLine=-A,o.hangingIndent=true);let I=g(c,"w","start");I!==void 0&&o.indentLeft===void 0&&(o.indentLeft=I);let O=g(c,"w","end");O!==void 0&&o.indentRight===void 0&&(o.indentRight=O);}let f=l(e,"w","pBdr");if(f){let y={},v=Q(l(f,"w","top"));v&&(y.top=v);let B=Q(l(f,"w","bottom"));B&&(y.bottom=B);let A=Q(l(f,"w","left"));A&&(y.left=A);let I=Q(l(f,"w","right"));I&&(y.right=I);let O=Q(l(f,"w","between"));O&&(y.between=O);let U=Q(l(f,"w","bar"));U&&(y.bar=U),Object.keys(y).length>0&&(o.borders=y);}let u=l(e,"w","shd");u&&(o.shading=yo(u));let p=l(e,"w","tabs");p&&(o.tabs=xo(p));let m=l(e,"w","keepNext");m&&(o.keepNext=F(m));let h=l(e,"w","keepLines");h&&(o.keepLines=F(h));let T=l(e,"w","widowControl");T&&(o.widowControl=F(T));let d=l(e,"w","pageBreakBefore");d&&(o.pageBreakBefore=F(d));let w=l(e,"w","contextualSpacing");w&&(o.contextualSpacing=F(w));let E=l(e,"w","numPr");if(E){let y=l(E,"w","numId"),v=l(E,"w","ilvl");if(y||v){if(o.numPr={},y){let B=g(y,"w","val");B!==void 0&&(o.numPr.numId=B);}if(v){let B=g(v,"w","val");B!==void 0&&(o.numPr.ilvl=B);}}}let k=l(e,"w","outlineLvl");if(k){let y=g(k,"w","val");y!==void 0&&(o.outlineLevel=y);}let P=l(e,"w","pStyle");if(P){let y=s(P,"w","val");y&&(o.styleId=y);}let C=l(e,"w","framePr");C&&(o.frame=To(C));let b=l(e,"w","suppressLineNumbers");b&&(o.suppressLineNumbers=F(b));let x=l(e,"w","suppressAutoHyphens");x&&(o.suppressAutoHyphens=F(x));let S=l(e,"w","rPr");return S&&(o.runProperties=Me(S,t)),Object.keys(o).length>0?o:void 0}function At(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function So(e,t,n,o,r){return ct(e,t,n,o,r)}function Co(e){return ft(e)}function ko(e){return ut(e)}function Nt(e){let t=e.trim().match(/^\\?([A-Z]+)/i);if(!t)return "UNKNOWN";let n=t[1].toUpperCase();return ["PAGE","NUMPAGES","NUMWORDS","NUMCHARS","DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","DOCPROPERTY","DOCVARIABLE","REF","PAGEREF","NOTEREF","HYPERLINK","TOC","TOA","INDEX","SEQ","STYLEREF","AUTONUM","AUTONUMLGL","AUTONUMOUT","IF","MERGEFIELD","NEXT","NEXTIF","ASK","SET","QUOTE","INCLUDETEXT","INCLUDEPICTURE","SYMBOL","ADVANCE","EDITTIME","REVNUM","SECTION","SECTIONPAGES","USERADDRESS","USERNAME","USERINITIALS"].includes(n)?n:"UNKNOWN"}function Mo(e,t,n,o,r){let i=s(e,"w","instr")??"",a=Nt(i),c={type:"simpleField",instruction:i,fieldType:a,content:[]},f=s(e,"w","fldLock");(f==="1"||f==="true")&&(c.fldLock=true);let u=s(e,"w","dirty");(u==="1"||u==="true")&&(c.dirty=true);let p=D(e);for(let m of p)At(m.name)==="r"&&c.content.push(ee(m,t,n,o,r));return c}function ge(e,t,n,o,r,i){let a=[],c=D(e),f=false,u="",p=[],m=[],h=false,T=false,d=false;for(let w of c){let E=At(w.name);switch(E){case "r":{let k=ee(w,t,n,r,i),P=false,C=false,b=false,x="";for(let S of k.content)S.type==="fieldChar"?S.charType==="begin"?(P=true,S.fldLock&&(T=true),S.dirty&&(d=true)):S.charType==="separate"?C=true:S.charType==="end"&&(b=true):S.type==="instrText"&&(x+=S.text);if(P&&(f=true,h=false,u="",p=[],m=[],T=false,d=false),f){if(x&&(u+=x),C&&(h=true),h&&!b?C||m.push(k):!h&&!P&&p.push(k),b){let S={type:"complexField",instruction:u.trim(),fieldType:Nt(u),fieldCode:p,fieldResult:m};T&&(S.fldLock=true),d&&(S.dirty=true),a.push(S),f=false;}}else a.push(k);break}case "hyperlink":a.push(So(w,r,t,n,i));break;case "bookmarkStart":a.push(Co(w));break;case "bookmarkEnd":a.push(ko(w));break;case "fldSimple":a.push(Mo(w,t,n,r,i));break;case "pPr":break;case "proofErr":case "permStart":case "permEnd":case "customXml":break;case "sdt":{let k=(w.elements??[]).find(C=>C.type==="element"&&(C.name==="w:sdtPr"||C.name?.endsWith(":sdtPr"))),P=(w.elements??[]).find(C=>C.type==="element"&&(C.name==="w:sdtContent"||C.name?.endsWith(":sdtContent")));if(P){let C=ge(P,t,n,null,r,i),x={type:"inlineSdt",properties:wo(k??null),content:C.filter(S=>S.type==="run"||S.type==="hyperlink")};a.push(x);}break}case "ins":{let k={id:parseInt(s(w,"w","id")??"0",10),author:s(w,"w","author")??"Unknown",date:s(w,"w","date")??void 0},P=ge(w,t,n,null,r,i),C={type:"insertion",info:k,content:P.filter(b=>b.type==="run"||b.type==="hyperlink")};a.push(C);break}case "del":{let k={id:parseInt(s(w,"w","id")??"0",10),author:s(w,"w","author")??"Unknown",date:s(w,"w","date")??void 0},P=ge(w,t,n,null,r,i),C={type:"deletion",info:k,content:P.filter(b=>b.type==="run"||b.type==="hyperlink")};a.push(C);break}case "smartTag":case "moveTo":case "moveFrom":break;case "commentRangeStart":{let k=parseInt(s(w,"w","id")??"0",10);a.push({type:"commentRangeStart",id:k});break}case "commentRangeEnd":{let k=parseInt(s(w,"w","id")??"0",10);a.push({type:"commentRangeEnd",id:k});break}case "oMath":case "oMathPara":{let k=E==="oMathPara",P=De(w),C=Bt(w),b={type:"mathEquation",display:k?"block":"inline",ommlXml:P,plainText:C||void 0};a.push(b);break}}}return a}function z(e,t,n,o,r=null,i=null){let a={type:"paragraph",content:[]},c=s(e,"w14","paraId")??s(e,"w","paraId");c&&(a.paraId=c);let f=s(e,"w14","textId")??s(e,"w","textId");f&&(a.textId=f);let u=l(e,"w","pPr");if(u){a.formatting=Fo(u,n);let h=l(u,"w","sectPr");h&&(a.sectionProperties=pe(h));}let p=ge(e,t,n,o,r,i);a.content=Re(p);let m=a.formatting?.numPr;if(!m&&a.formatting?.styleId&&t){let h=t.get(a.formatting.styleId);h?.pPr?.numPr&&(m=h.pPr.numPr,a.formatting||(a.formatting={}),a.formatting.numPr=m);}if(m&&o){let{numId:h,ilvl:T=0}=m;if(h!==void 0&&h!==0){let d=o.getLevel(h,T);if(d&&(a.listRendering={level:T,numId:h,marker:d.lvlText,isBullet:d.numFmt==="bullet",numFmt:d.numFmt},d.pPr)){a.formatting||(a.formatting={});let w=u?l(u,"w","ind"):null,E=w!=null&&(s(w,"w","left")!==null||s(w,"w","start")!==null),k=w!=null&&(s(w,"w","firstLine")!==null||s(w,"w","hanging")!==null);!E&&d.pPr.indentLeft!==void 0&&(a.formatting.indentLeft=d.pPr.indentLeft),k||(d.pPr.indentFirstLine!==void 0&&(a.formatting.indentFirstLine=d.pPr.indentFirstLine),d.pPr.hangingIndent!==void 0&&(a.formatting.hangingIndent=d.pPr.hangingIndent));}}}return a}function Ee(e){let t="";for(let n of e.content)if(n.type==="run")for(let o of n.content)o.type==="text"?t+=o.text:o.type==="tab"?t+=" ":o.type==="break"&&(o.breakType==="page"?t+="\f":t+=`
11
+ `);else if(n.type==="hyperlink"){for(let o of n.children)if(o.type==="run")for(let r of o.content)r.type==="text"&&(t+=r.text);}else if(n.type==="simpleField"){for(let o of n.content)if(o.type==="run")for(let r of o.content)r.type==="text"&&(t+=r.text);}else if(n.type==="complexField")for(let o of n.fieldResult)for(let r of o.content)r.type==="text"&&(t+=r.text);return t}function vo(e){if(!e||e.trim()==="")return "\u2022";let t=e.charCodeAt(0),n={183:"\u2022",111:"\u25CB",167:"\u25A0",252:"\u2713",110:"\u25A0",113:"\u25CB",117:"\u25C6",118:"\u2756",168:"\u2713",251:"\u2713",254:"\u2713",61623:"\u2022",61550:"\u25A0",61551:"\u25CB",61607:"\u25A0",61692:"\u2713",8226:"\u2022",9679:"\u25CF",9675:"\u25CB",9632:"\u25A0",9633:"\u25A1",9670:"\u25C6",9671:"\u25C7",8211:"\u2013",8212:"\u2014",62:">",45:"-"};return n[t]?n[t]:t>=57344&&t<=63743||t<32||t>=127&&t<160?"\u2022":e}function Ro(e,t,n){let o=e.listRendering;if(!o||!t)return;let{numId:r,level:i}=o;if(r===void 0||r===0)return;n.has(r)||n.set(r,new Array(9).fill(0));let a=n.get(r);a[i]=(a[i]||0)+1;for(let u=i+1;u<a.length;u++)a[u]=0;let c=o.marker;if(o.isBullet){let u=c||"";o.marker=vo(u);return}let f=c;for(let u=0;u<=i;u++){let p=`%${u+1}`;if(f.includes(p)){let m=a[u],h=t.getLevel(r,u),T=Eo(m,h?.numFmt||"decimal");f=f.replace(p,T);}}o.marker=f;}function Eo(e,t){switch(t){case "decimal":case "decimalZero":return String(e);case "lowerLetter":return String.fromCharCode(96+(e-1)%26+1);case "upperLetter":return String.fromCharCode(64+(e-1)%26+1);case "lowerRoman":return It(e).toLowerCase();case "upperRoman":return It(e);case "bullet":return "\u2022";default:return String(e)}}function It(e){let t=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],n="";for(let[o,r]of t)for(;e>=o;)n+=r,e-=o;return n}var Xt=/\{\{([^{}]+)\}\}/g;function Lt(e){let t=[],n;for(Xt.lastIndex=0;(n=Xt.exec(e))!==null;){let o=n[1].trim();o&&!t.includes(o)&&t.push(o);}return t}function Dt(e){let t=[];for(let n of e)if(n.type==="paragraph"){let o=Ee(n),r=Lt(o);for(let i of r)t.includes(i)||t.push(i);}else if(n.type==="table"){let o=Ht(n);for(let r of o)t.includes(r)||t.push(r);}return t}function Ht(e){let t=[];for(let n of e.rows)for(let o of n.cells)for(let r of o.content)if(r.type==="paragraph"){let i=Ee(r),a=Lt(i);for(let c of a)t.includes(c)||t.push(c);}else if(r.type==="table"){let i=Ht(r);for(let a of i)t.includes(a)||t.push(a);}return t}function Ot(e,t,n,o,r,i){let a=[],c=D(e),f=new Map;for(let u of c){let p=u.name??"";if(p==="w:p"||p.endsWith(":p")){let m=z(u,t,n,o,r,i);Ro(m,o,f),a.push(m);}else if(p==="w:tbl"||p.endsWith(":tbl")){let m=te(u,t,n,o,r,i);a.push(m);}else if(p==="w:sdt"||p.endsWith(":sdt")){let m=(u.elements??[]).find(h=>h.type==="element"&&(h.name==="w:sdtContent"||h.name?.endsWith(":sdtContent")));if(m){let h=Ot(m,t,n,o,r,i);a.push(...h);}}}return a}function Po(e,t){let n=[],o=[];for(let r of e)o.push(r),r.type==="paragraph"&&r.sectionProperties&&(n.push({properties:r.sectionProperties,content:o}),o=[]);return (o.length>0||n.length===0)&&n.push({properties:t??Rt(),content:o}),n}function Wt(e,t=null,n=null,o=null,r=null,i=null){let a={content:[]};if(!e)return a;let c=j(e);if(!c)return a;let f=(c.elements??[]).find(m=>m.type==="element"&&(m.name==="w:document"||m.name?.endsWith(":document")));if(!f)return a;let u=l(f,"w","body");if(!u)return a;a.content=Ot(u,t,n,o,r,i);let p=l(u,"w","sectPr");return p&&(a.finalSectionProperties=pe(p)),a.sections=Po(a.content,a.finalSectionProperties),a}function Bo(e){let t=new Map,n=j(e);if(!n)return t;let o=l(n,"w16cex","commentsExtensible")??n;for(let r of D(o)){if((r.name?.replace(/^.*:/,"")??"")!=="comment")continue;let a=s(r,"w16cex","paraId")??s(r,"w15","paraId")??r.attributes?.["w16cex:paraId"]??r.attributes?.["w15:paraId"],c=s(r,"w16cex","dateUtc")??s(r,"w15","dateUtc")??r.attributes?.["w16cex:dateUtc"]??r.attributes?.["w15:dateUtc"];a&&c&&t.set(String(a).toUpperCase(),String(c));}return t}function jt(e,t,n,o,r,i){if(!e)return [];let a=j(e);if(!a)return [];let c=i?Bo(i):new Map,f=l(a,"w","comments")??a,u=D(f),p=[];for(let m of u){if((m.name?.replace(/^.*:/,"")??"")!=="comment")continue;let T=parseInt(s(m,"w","id")??"0",10),d=s(m,"w","author")??"Unknown",w=s(m,"w","initials"),E=w!=null?String(w):void 0,k=s(m,"w","date"),P=k!=null?String(k):void 0,C=s(m,"w14","paraId")??m.attributes?.["w14:paraId"]??s(m,"w","paraId"),x=(C?c.get(String(C).toUpperCase()):void 0)??P,S=[];for(let y of D(m))if((y.name?.replace(/^.*:/,"")??"")==="p"){let B=z(y,t,n,null,o,r);S.push(B);}p.push({id:T,author:d,initials:E,date:x,content:S});}return p}async function ai(e,t={}){let n=e instanceof ArrayBuffer?e:await Ie(e),{onProgress:o=()=>{},preloadFonts:r=true,parseHeadersFooters:i=true,parseNotes:a=true,detectVariables:c=true}=t,f=[];try{let h=function(H,W){let R=performance.now(),M=W(),L=performance.now()-R;return m.push({stage:H,ms:L}),L>1e3&&console.warn(`[parseDocx] ${H} took ${Math.round(L)}ms`),M};var u=h;let p=performance.now(),m=[];async function T(H,W){let R=performance.now(),M=await W(),L=performance.now()-R;return m.push({stage:H,ms:L}),L>1e3&&console.warn(`[parseDocx] ${H} took ${Math.round(L)}ms`),M}o("Extracting DOCX...",0);let d=await T("unzip",()=>Xe(n));o("Extracted DOCX",10),o("Parsing relationships...",10);let w=h("relationships",()=>d.documentRels?ae(d.documentRels):new Map);o("Parsed relationships",15),o("Parsing theme...",15);let E=h("theme",()=>Ve(d.themeXml));o("Parsed theme",20),o("Parsing styles...",20);let k=null,P;h("styles",()=>{d.stylesXml&&(k=Ce(d.stylesXml,E),P=Ye(d.stylesXml,E));}),o("Parsed styles",30),o("Parsing numbering...",30);let C=h("numbering",()=>Ke(d.numberingXml));o("Parsed numbering",35),o("Processing media files...",35);let b=h("media",()=>Ao(d,w));o("Processed media",40),o("Parsing document body...",40);let x={content:[]};h("documentBody",()=>{d.documentXml?x=Wt(d.documentXml,k,E,C,w,b):f.push("No document.xml found in DOCX");}),o("Parsed document body",55);let S,y;if(i){o("Parsing headers/footers...",55);let H=h("headersFooters",()=>No(d,k,E,C,w,b));S=H.headers,y=H.footers,o("Parsed headers/footers",65);}else o("Skipping headers/footers",65);let v,B;if(a){o("Parsing footnotes/endnotes...",65);let H=h("footnotesEndnotes",()=>Io(d,k,E,C,w,b));v=H.footnotes,B=H.endnotes,o("Parsed footnotes/endnotes",75);}else o("Skipping footnotes/endnotes",75);o("Parsing comments...",75);let A=h("comments",()=>jt(d.commentsXml,k,E,w,b,d.commentsExtensibleXml));A.length>0&&(x.comments=A);let I;c?(o("Detecting template variables...",75),I=h("variables",()=>Dt(x.content)),o("Detected variables",80)):o("Skipping variable detection",80),r?(o("Loading fonts...",80),await T("fonts",()=>Xo(E,P,x)),o("Loaded fonts",95)):o("Skipping font loading",95),o("Assembling document...",95);let U={package:{document:x,styles:P,theme:E,numbering:C.definitions,headers:S,footers:y,footnotes:v,endnotes:B,relationships:w,media:b},originalBuffer:n,templateVariables:I,warnings:f.length>0?f:void 0},K=performance.now()-p;if(K>2e3){let H=m.filter(W=>W.ms>100).map(W=>`${W.stage}: ${Math.round(W.ms)}ms`).join(", ");console.warn(`[parseDocx] Total: ${Math.round(K)}ms`+(H?` (${H})`:""));}return o("Complete",100),U}catch(p){let m=p instanceof Error?p.message:String(p);throw console.error("[parseDocx] Failed to parse DOCX:",m,p),new Error(`Failed to parse DOCX: ${m}`)}}function Ao(e,t){let n=new Map;for(let[o,r]of e.media.entries()){let i=o.split("/").pop()||o,a=Le(o),c=new Uint8Array(r),f="";for(let T=0;T<c.length;T++)f+=String.fromCharCode(c[T]);let u=btoa(f),p=`data:${a};base64,${u}`,m={path:o,filename:i,mimeType:a,data:r,dataUrl:p};n.set(o,m);let h=o.replace(/^word\//,"");h!==o&&n.set(h,m);}return n}function he(e,t){let n=t.toLowerCase();for(let[o,r]of e.entries())if(o.toLowerCase()===n)return r}function No(e,t,n,o,r,i){let a=new Map,c=new Map;for(let[f,u]of r.entries())if(u.type===ie.header&&u.target){let p=u.target.split("/").pop()||u.target,m=he(e.headers,p);if(m){let h=`word/_rels/${p}.rels`,T=he(e.allXml,h),d=T?ae(T):r,w=yt(m,"default",t,n,o,d,i);a.set(f,w);}}else if(u.type===ie.footer&&u.target){let p=u.target.split("/").pop()||u.target,m=he(e.footers,p);if(m){let h=`word/_rels/${p}.rels`,T=he(e.allXml,h),d=T?ae(T):r,w=xt(m,"default",t,n,o,d,i);c.set(f,w);}}return {headers:a,footers:c}}function Io(e,t,n,o,r,i){let a=Ft(e.footnotesXml,t,n,o,r,i),c=St(e.endnotesXml,t,n,o,r,i);return {footnotes:a.getNormalFootnotes(),endnotes:c.getNormalEndnotes()}}async function Xo(e,t,n){let o=new Set;if(e?.fontScheme){let{majorFont:r,minorFont:i}=e.fontScheme;r?.latin&&o.add(r.latin),i?.latin&&o.add(i.latin);}if(t?.docDefaults?.rPr?.fontFamily?.ascii&&o.add(t.docDefaults.rPr.fontFamily.ascii),t?.styles)for(let r of t.styles)r.rPr?.fontFamily?.ascii&&o.add(r.rPr.fontFamily.ascii),r.rPr?.fontFamily?.hAnsi&&o.add(r.rPr.fontFamily.hAnsi);if(n.content){for(let r of n.content)if(r.type==="paragraph")for(let i of r.content)i.type==="run"&&i.formatting?.fontFamily&&(i.formatting.fontFamily.ascii&&o.add(i.formatting.fontFamily.ascii),i.formatting.fontFamily.hAnsi&&o.add(i.formatting.fontFamily.hAnsi));}if(o.size>0)try{await xe(Array.from(o));}catch(r){console.warn("Failed to load some fonts:",r);}}
12
+ exports.a=ar;exports.b=ie;exports.c=vr;exports.d=Be;exports.e=Vt;exports.f=Lo;exports.g=Do;exports.h=Ho;exports.i=Oo;exports.j=Wo;exports.k=jo;exports.l=Vo;exports.m=zo;exports.n=Ie;exports.o=ai;
@@ -0,0 +1 @@
1
+ 'use strict';var K="Calibri";var _=null;function W(){if(!_){let e=typeof document<"u"?document.createElement("canvas"):null;if(!e)throw new Error("Canvas not available. Ensure this runs in a DOM environment.");if(_=e.getContext("2d"),!_)throw new Error("Failed to get 2D context from canvas")}return _}function ce(){_=null;}var oe='"Segoe UI", Arial, sans-serif';function U(e){let n=[];e.italic&&n.push("italic"),e.bold&&n.push("bold");let c=e.fontSize??11,r=J(c);n.push(`${r}px`);let a=e.fontFamily??K,t=a.includes(" ")?`"${a}"`:a;return n.push(`${t}, ${oe}`),n.join(" ")}function ae(e){let n=e.fontSize??11,c=e.fontFamily??K,r=J(n),a=r*.8,t=r*.2,s=r*1.15;try{let i=W();i.font=U(e);let o=i.measureText("Hg");typeof o.actualBoundingBoxAscent=="number"&&typeof o.actualBoundingBoxDescent=="number"&&(a=o.actualBoundingBoxAscent,t=o.actualBoundingBoxDescent),typeof o.fontBoundingBoxAscent=="number"&&typeof o.fontBoundingBoxDescent=="number"&&(s=o.fontBoundingBoxAscent+o.fontBoundingBoxDescent);}catch{}return s=Math.max(s,a+t),{fontSize:n,ascent:a,descent:t,lineHeight:s,fontFamily:c}}function se(e,n){if(!e)return 0;let c=W();c.font=U(n);let a=c.measureText(e).width;return n.letterSpacing&&e.length>1&&(a+=n.letterSpacing*(e.length-1)),a}function G(e,n){let c=ae(n);if(!e)return {width:0,charWidths:[],metrics:c};let r=W();r.font=U(n);let a=n.letterSpacing??0,t=[],s=0;for(let i=0;i<e.length;i++){let o=e[i],m=r.measureText(o).width;a&&i<e.length-1&&(m+=a),t.push(m),s+=m;}return {width:s,charWidths:t,metrics:c}}function le(e,n){if(n.length===0||e<=0)return 0;let c=0;for(let r=0;r<n.length;r++){let a=n[r],t=c+a/2;if(e<=t)return r;c+=a;}return n.length}function J(e){return e*96/72}function $(e,n){let c=e.pageGap??0,r=0;for(let a=0;a<n&&a<e.pages.length;a++){let s=e.pages[a].size?.h??e.pageSize.h;r+=s+c;}return r}function Q(e,n){return e.findIndex(c=>c.id===n)}function ie(e,n){let c=0;for(let r=e.fromLine;r<e.toLine&&r<n.lines.length;r++)c+=n.lines[r].lineHeight;return c}function ge(e,n,c,r){let a=[...e.page.fragments].sort((t,s)=>{let i=t.y-s.y;return Math.abs(i)>.5?i:t.x-s.x});for(let t of a){let s=Q(n,t.blockId);if(s===-1)continue;let i=n[s],o=c[s];if(!i||!o)continue;let g;if(t.kind==="paragraph"){if(i.kind!=="paragraph"||o.kind!=="paragraph")continue;g=ie(t,o);}else if(t.kind==="table")g=t.height;else if(t.kind==="image")g=t.height;else continue;let m=r.x>=t.x&&r.x<=t.x+t.width,l=r.y>=t.y&&r.y<=t.y+g;if(m&&l)return {fragment:t,block:i,measure:o,pageIndex:e.pageIndex,localX:r.x-t.x,localY:r.y-t.y}}return null}function fe(e,n,c,r){for(let a of e.page.fragments){if(a.kind!=="table")continue;let t=a,s=r.x>=t.x&&r.x<=t.x+t.width,i=r.y>=t.y&&r.y<=t.y+t.height;if(!s||!i)continue;let o=Q(n,t.blockId);if(o===-1)continue;let g=n[o],m=c[o];if(!g||g.kind!=="table"||!m||m.kind!=="table")continue;let l=g,f=m,p=r.x-t.x,M=r.y-t.y,b=0,d=-1;if(f.rows.length===0||l.rows.length===0)continue;for(let u=t.fromRow;u<t.toRow&&u<f.rows.length;u++){let w=f.rows[u];if(M>=b&&M<b+w.height){d=u;break}b+=w.height;}if(d===-1&&(d=Math.min(t.toRow-1,f.rows.length-1),d<t.fromRow))continue;let h=f.rows[d],T=l.rows[d];if(!h||!T)continue;let x=0,k=-1;if(h.cells.length===0||T.cells.length===0)continue;for(let u=0;u<h.cells.length;u++){let w=h.cells[u];if(p>=x&&p<x+w.width){k=u;break}x+=w.width;}if(k===-1&&(k=h.cells.length-1,k<0))continue;let I=h.cells[k],y=T.cells[k];if(!I||!y)continue;let F=0;for(let u=t.fromRow;u<d;u++)F+=f.rows[u]?.height??0;let B=0;for(let u=0;u<k;u++)B+=h.cells[u]?.width??0;let S,P;if(y.blocks&&y.blocks.length>0){let u=y.blocks[0],w=I.blocks[0];u.kind==="paragraph"&&w?.kind==="paragraph"&&(S=u,P=w);}let R=p-B,H=M-F;return {fragment:t,block:l,measure:f,pageIndex:e.pageIndex,rowIndex:d,colIndex:k,cellBlock:S,cellMeasure:P,cellLocalX:Math.max(0,R),cellLocalY:Math.max(0,H)}}return null}function V(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function Z(e,n){return e.findIndex(c=>c.id===n)}function z(e,n){let r=(e.pmStart??0)+1,a=0,t;for(let o=0;o<e.runs.length&&o<=n.toRun;o++){let g=e.runs[o];if(g){if(o<n.fromRun)g.kind==="text"?a+=(g.text??"").length:a+=1;else if(o===n.fromRun){a+=n.fromChar,t=r+a;break}}}t===void 0&&(t=r);let s=0;for(let o=n.fromRun;o<=n.toRun&&o<e.runs.length;o++){let g=e.runs[o];if(g)if(g.kind==="text"){let m=g.text??"",l=o===n.fromRun?n.fromChar:0,f=o===n.toRun?n.toChar:m.length;s+=f-l;}else s+=1;}let i=t+s;return {pmStart:t,pmEnd:i}}function ee(e,n,c,r){let a=[];for(let t=0;t<n.lines.length;t++){let s=n.lines[t],i=z(e,s);i.pmStart===void 0||i.pmEnd===void 0||i.pmEnd>c&&i.pmStart<r&&a.push({line:s,index:t});}return a}function X(e,n,c){let r=z(e,n);return r.pmStart===void 0?0:Math.max(0,c-r.pmStart)}function A(e,n,c,r){let a=0,t=0;for(let s=n.fromRun;s<=n.toRun&&s<e.runs.length;s++){let i=e.runs[s];if(i){if(i.kind==="tab"){let o=i.width??48;if(t+1>=c)return c<=t?a:a+o;a+=o,t+=1;continue}if(i.kind==="image"){let o=i.width;if(t+1>=c)return c<=t?a:a+o;a+=o,t+=1;continue}if(i.kind==="lineBreak"){if(c<=t)return a;t+=1;continue}if(i.kind==="text"){let o=i.text??"",g=s===n.fromRun,m=s===n.toRun,l=g?n.fromChar:0,f=m?n.toChar:o.length,p=o.slice(l,f);if(t+p.length>=c){let d=c-t,h=V(i),T=G(p.slice(0,d),h);return a+T.width}let M=V(i),b=G(p,M);a+=b.width,t+=p.length;}}}return a}function Y(e,n){let c=0;for(let r=0;r<n&&r<e.lines.length;r++)c+=e.lines[r].lineHeight;return c}function de(e,n,c,r,a){if(r===a)return [];let t=Math.min(r,a),s=Math.max(r,a),i=[];for(let o=0;o<e.pages.length;o++){let g=e.pages[o],m=$(e,o);for(let l of g.fragments){if(l.kind==="paragraph"){let f=Z(n,l.blockId);if(f===-1)continue;let p=n[f],M=c[f];if(!p||p.kind!=="paragraph"||!M||M.kind!=="paragraph")continue;let b=p,d=M,h=l,T=ee(b,d,t,s);for(let{line:x,index:k}of T){if(k<h.fromLine||k>=h.toLine)continue;let I=z(b,x);if(I.pmStart===void 0||I.pmEnd===void 0)continue;let y=Math.max(I.pmStart,t),F=Math.min(I.pmEnd,s);if(y>=F)continue;let B=X(b,x,y),S=X(b,x,F),P=b.attrs?.indent,R=P?.left??0,H=P?.right??0,u=Math.max(0,l.width-R-H),w=A(b,x,B),D=A(b,x,S),C=b.attrs?.alignment??"left",L=0;C==="center"?L=Math.max(0,(u-x.width)/2):C==="right"&&(L=Math.max(0,u-x.width));let v=Y(d,k)-Y(d,h.fromLine),E=l.x+R+L+Math.min(w,D),N=Math.max(1,Math.abs(D-w)),O=l.y+v;i.push({x:E,y:O+m,width:N,height:x.lineHeight,pageIndex:o});}}if(l.kind==="table"){let f=Z(n,l.blockId);if(f===-1)continue;let p=n[f],M=c[f];if(!p||p.kind!=="table"||!M||M.kind!=="table")continue;let b=p,d=M,h=l,T=0;for(let x=h.fromRow;x<h.toRow&&x<b.rows.length;x++){let k=b.rows[x],I=d.rows[x];if(!k||!I)continue;let y=0;for(let F=0;F<k.cells.length;F++){let B=k.cells[F],S=I.cells[F];if(!(!B||!S)){for(let P=0;P<B.blocks.length;P++){let R=B.blocks[P],H=S.blocks[P];if(!R||R.kind!=="paragraph"||!H||H.kind!=="paragraph")continue;let u=R,w=H,D=ee(u,w,t,s),C=0;for(let{line:L,index:v}of D){let E=z(u,L);if(E.pmStart===void 0||E.pmEnd===void 0)continue;let N=Math.max(E.pmStart,t),O=Math.min(E.pmEnd,s);if(N>=O)continue;let te=X(u,L,N),ne=X(u,L,O),j=A(u,L,te,S.width),q=A(u,L,ne,S.width),re=Y(w,v);i.push({x:h.x+y+Math.min(j,q),y:h.y+T+C+re+m,width:Math.max(1,Math.abs(q-j)),height:L.lineHeight,pageIndex:o});}C+=w.totalHeight;}y+=S.width;}}T+=I.height;}}if(l.kind==="image"){let f=l.pmStart??0;(l.pmEnd??f+1)>t&&f<s&&i.push({x:l.x,y:l.y+m,width:l.width,height:l.height,pageIndex:o});}}}return i}function xe(e,n,c,r){for(let a=0;a<e.pages.length;a++){let t=e.pages[a],s=$(e,a);for(let i of t.fragments){if(i.kind==="paragraph"){let o=Z(n,i.blockId);if(o===-1)continue;let g=n[o],m=c[o];if(!g||g.kind!=="paragraph"||!m||m.kind!=="paragraph")continue;let l=g,f=m,p=i,M=l.pmStart??0,b=l.pmEnd??M;if(r<M||r>b)continue;for(let d=p.fromLine;d<p.toLine;d++){let h=f.lines[d];if(!h)continue;let T=z(l,h);if(!(T.pmStart===void 0||T.pmEnd===void 0)&&r>=T.pmStart&&r<=T.pmEnd){let x=X(l,h,r),k=l.attrs?.indent,I=k?.left??0,y=k?.right??0,F=Math.max(0,i.width-I-y),B=A(l,h,x),S=l.attrs?.alignment??"left",P=0;S==="center"?P=Math.max(0,(F-h.width)/2):S==="right"&&(P=Math.max(0,F-h.width));let R=Y(f,d)-Y(f,p.fromLine);return {x:i.x+I+P+B,y:i.y+R+s,height:h.lineHeight,pageIndex:a}}}}if(i.kind==="image"){let o=i.pmStart??0,g=i.pmEnd??o+1;if(r>=o&&r<=g){let m=r===o?0:i.width;return {x:i.x+m,y:i.y+s,height:i.height,pageIndex:a}}}}}return null}function be(e){return e.length<=1?false:new Set(e.map(c=>c.pageIndex)).size>1}function ke(e){let n=new Map;for(let c of e){let r=n.get(c.pageIndex)??[];r.push(c),n.set(c.pageIndex,r);}return n}exports.a=ce;exports.b=ae;exports.c=se;exports.d=G;exports.e=le;exports.f=J;exports.g=ge;exports.h=fe;exports.i=de;exports.j=xe;exports.k=be;exports.l=ke;
@@ -1,4 +1,4 @@
1
- import { h as Document, T as TextFormatting, a6 as StyleInfo, k as AgentContext, g as Position, Y as Range, U as ParagraphFormatting, j as AgentCommand, a2 as SelectionContext, D as DocumentBody, a1 as SectionProperties, al as ColorValue, ab as Theme, am as ThemeColorSlot } from './types-BnShY2aQ.js';
1
+ import { h as Document, T as TextFormatting, a6 as StyleInfo, k as AgentContext, g as Position, Y as Range, U as ParagraphFormatting, j as AgentCommand, a2 as SelectionContext, D as DocumentBody, a1 as SectionProperties, al as ColorValue, ab as Theme, am as ThemeColorSlot } from './types-BALm1KBi.js';
2
2
 
3
3
  /**
4
4
  * Flexible input types for DOCX documents.
@@ -1,4 +1,4 @@
1
- import { h as Document, T as TextFormatting, a6 as StyleInfo, k as AgentContext, g as Position, Y as Range, U as ParagraphFormatting, j as AgentCommand, a2 as SelectionContext, D as DocumentBody, a1 as SectionProperties, al as ColorValue, ab as Theme, am as ThemeColorSlot } from './types-BnShY2aQ.cjs';
1
+ import { h as Document, T as TextFormatting, a6 as StyleInfo, k as AgentContext, g as Position, Y as Range, U as ParagraphFormatting, j as AgentCommand, a2 as SelectionContext, D as DocumentBody, a1 as SectionProperties, al as ColorValue, ab as Theme, am as ThemeColorSlot } from './types-BALm1KBi.cjs';
2
2
 
3
3
  /**
4
4
  * Flexible input types for DOCX documents.
@@ -1 +1 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkZRXLWSRP_cjs=require('./chunk-ZRXLWSRP.cjs');require('./chunk-CDSUWDYP.cjs');var chunkXVFMG77A_cjs=require('./chunk-XVFMG77A.cjs');require('./chunk-RTESADL3.cjs');Object.defineProperty(exports,"docxtemplaterPlugin",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.x}});Object.defineProperty(exports,"isZodSchema",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.w}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.a}});Object.defineProperty(exports,"createPluginRegistrar",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.d}});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.b}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.c}});
1
+ 'use strict';var chunkH3JNHCD7_cjs=require('./chunk-H3JNHCD7.cjs');require('./chunk-TRAQI6RX.cjs');var chunkXVFMG77A_cjs=require('./chunk-XVFMG77A.cjs');require('./chunk-RTESADL3.cjs');Object.defineProperty(exports,"docxtemplaterPlugin",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.x}});Object.defineProperty(exports,"isZodSchema",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.w}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.a}});Object.defineProperty(exports,"createPluginRegistrar",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.d}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.c}});
@@ -1,6 +1,6 @@
1
- import { C as CorePlugin } from './types-BnShY2aQ.cjs';
2
- export { b as CommandHandler, o as CommandResult, aF as ExtractCommand, J as JsonSchema, y as LoadedDocument, d as McpSession, z as McpToolAnnotations, G as McpToolContent, K as McpToolContext, M as McpToolDefinition, aG as McpToolExample, N as McpToolHandler, O as McpToolResult, W as PluginCommand, b as PluginCommandHandler, X as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, M as ToolDefinition, N as ToolHandler, O as ToolResult, aH as TypedCommandHandler, ac as ZodSchemaLike, ak as isZodSchema } from './types-BnShY2aQ.cjs';
3
- export { P as PluginRegistry, c as createPluginRegistrar, p as default, p as pluginRegistry, r as registerPlugins } from './registry-CrAzNdUO.cjs';
1
+ import { C as CorePlugin } from './types-BALm1KBi.cjs';
2
+ export { b as CommandHandler, o as CommandResult, aD as ExtractCommand, J as JsonSchema, y as LoadedDocument, d as McpSession, z as McpToolAnnotations, G as McpToolContent, K as McpToolContext, M as McpToolDefinition, aE as McpToolExample, N as McpToolHandler, O as McpToolResult, W as PluginCommand, b as PluginCommandHandler, X as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, M as ToolDefinition, N as ToolHandler, O as ToolResult, aF as TypedCommandHandler, ac as ZodSchemaLike, ak as isZodSchema } from './types-BALm1KBi.cjs';
3
+ export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-BUTMLqSj.cjs';
4
4
 
5
5
  /**
6
6
  * Docxtemplater Plugin
@@ -1,6 +1,6 @@
1
- import { C as CorePlugin } from './types-BnShY2aQ.js';
2
- export { b as CommandHandler, o as CommandResult, aF as ExtractCommand, J as JsonSchema, y as LoadedDocument, d as McpSession, z as McpToolAnnotations, G as McpToolContent, K as McpToolContext, M as McpToolDefinition, aG as McpToolExample, N as McpToolHandler, O as McpToolResult, W as PluginCommand, b as PluginCommandHandler, X as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, M as ToolDefinition, N as ToolHandler, O as ToolResult, aH as TypedCommandHandler, ac as ZodSchemaLike, ak as isZodSchema } from './types-BnShY2aQ.js';
3
- export { P as PluginRegistry, c as createPluginRegistrar, p as default, p as pluginRegistry, r as registerPlugins } from './registry-aux2uuQs.js';
1
+ import { C as CorePlugin } from './types-BALm1KBi.js';
2
+ export { b as CommandHandler, o as CommandResult, aD as ExtractCommand, J as JsonSchema, y as LoadedDocument, d as McpSession, z as McpToolAnnotations, G as McpToolContent, K as McpToolContext, M as McpToolDefinition, aE as McpToolExample, N as McpToolHandler, O as McpToolResult, W as PluginCommand, b as PluginCommandHandler, X as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, M as ToolDefinition, N as ToolHandler, O as ToolResult, aF as TypedCommandHandler, ac as ZodSchemaLike, ak as isZodSchema } from './types-BALm1KBi.js';
3
+ export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-CzqAPdui.js';
4
4
 
5
5
  /**
6
6
  * Docxtemplater Plugin
@@ -1 +1 @@
1
- export{x as docxtemplaterPlugin,w as isZodSchema}from'./chunk-VFBM3YKJ.js';import'./chunk-ZZNWTYMW.js';export{a as PluginRegistry,d as createPluginRegistrar,b as default,b as pluginRegistry,c as registerPlugins}from'./chunk-QHWHCIUW.js';import'./chunk-3IYNTJO5.js';
1
+ export{x as docxtemplaterPlugin,w as isZodSchema}from'./chunk-L2UUZRZI.js';import'./chunk-PM4Y7OFN.js';export{a as PluginRegistry,d as createPluginRegistrar,b as pluginRegistry,c as registerPlugins}from'./chunk-QHWHCIUW.js';import'./chunk-3IYNTJO5.js';
@@ -0,0 +1 @@
1
+ export{a as executeCommand,b as executeCommands}from'./chunk-MMJD2DLL.js';import'./chunk-QHWHCIUW.js';import'./chunk-3IYNTJO5.js';
@@ -0,0 +1 @@
1
+ 'use strict';var chunkA7VY2V4X_cjs=require('./chunk-A7VY2V4X.cjs');require('./chunk-XVFMG77A.cjs'),require('./chunk-RTESADL3.cjs');Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkA7VY2V4X_cjs.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkA7VY2V4X_cjs.b}});
package/dist/headless.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkPYAIJMEG_cjs=require('./chunk-PYAIJMEG.cjs'),chunkZRXLWSRP_cjs=require('./chunk-ZRXLWSRP.cjs'),chunkTL3YTVN2_cjs=require('./chunk-TL3YTVN2.cjs'),chunkCDSUWDYP_cjs=require('./chunk-CDSUWDYP.cjs'),chunkFOU7PS3K_cjs=require('./chunk-FOU7PS3K.cjs'),chunkXVFMG77A_cjs=require('./chunk-XVFMG77A.cjs');require('./chunk-RTESADL3.cjs');function p(n){let e=[];for(let t of n.content)t.type==="run"?e.push(c(t)):t.type==="hyperlink"&&e.push(g(t));return e.join("")}function c(n){return n.content.filter(e=>e.type==="text").map(e=>e.text).join("")}function g(n){let e=[];for(let t of n.children)t.type==="run"&&e.push(c(t));return e.join("")}function x(n){let e=[];for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&e.push(p(r));return e.join(" ")}function Me(n){let e=[];for(let t of n.content)t.type==="paragraph"?e.push(p(t)):t.type==="table"&&e.push(x(t));return e.join(`
1
+ 'use strict';var chunkQOIY4Y6N_cjs=require('./chunk-QOIY4Y6N.cjs'),chunkH3JNHCD7_cjs=require('./chunk-H3JNHCD7.cjs'),chunkQYKJKSKZ_cjs=require('./chunk-QYKJKSKZ.cjs'),chunkTRAQI6RX_cjs=require('./chunk-TRAQI6RX.cjs'),chunkA7VY2V4X_cjs=require('./chunk-A7VY2V4X.cjs'),chunkXVFMG77A_cjs=require('./chunk-XVFMG77A.cjs');require('./chunk-RTESADL3.cjs');function p(n){let e=[];for(let t of n.content)t.type==="run"?e.push(c(t)):t.type==="hyperlink"&&e.push(g(t));return e.join("")}function c(n){return n.content.filter(e=>e.type==="text").map(e=>e.text).join("")}function g(n){let e=[];for(let t of n.children)t.type==="run"&&e.push(c(t));return e.join("")}function m(n){let e=[];for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&e.push(p(r));return e.join(" ")}function Me(n){let e=[];for(let t of n.content)t.type==="paragraph"?e.push(p(t)):t.type==="table"&&e.push(m(t));return e.join(`
2
2
  `)}function f(n){return n.split(/\s+/).filter(t=>t.length>0).length}function je(n,e=true){return e?n.length:n.replace(/\s/g,"").length}function We(n){let e=0;for(let t of n.content)t.type==="paragraph"?e+=f(p(t)):t.type==="table"&&(e+=ze(t));return e}function ze(n){let e=0;for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&(e+=f(p(r)));return e}function Ne(n){let e=0;for(let t of n.content)t.type==="paragraph"?e+=p(t).length:t.type==="table"&&(e+=qe(t));return e}function qe(n){let e=0;for(let t of n.rows)for(let o of t.cells)for(let r of o.content)r.type==="paragraph"&&(e+=p(r).length);return e}function Ze(n,e,t){let o=[],r=0,i=n[e.paragraphIndex];if(i){let s=p(i).slice(0,e.offset);o.unshift(s),r+=s.length;}for(let l=e.paragraphIndex-1;l>=0&&r<t;l--){let s=n[l];if(!s)continue;let u=p(s);o.unshift(u),r+=u.length;}let a=o.join(`
3
3
  `);return a.length>t?"..."+a.slice(-t):a}function _e(n,e,t){let o=[],r=0,i=n[e.paragraphIndex];if(i){let s=p(i).slice(e.offset);o.push(s),r+=s.length;}for(let l=e.paragraphIndex+1;l<n.length&&r<t;l++){let s=n[l];if(!s)continue;let u=p(s);o.push(u),r+=u.length;}let a=o.join(`
4
- `);return a.length>t?a.slice(0,t)+"...":a}function Je(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o),i=t+r.length;if(e>=t&&e<i)return o.formatting||{};t=i;}else if(o.type==="hyperlink"){let r=g(o),i=t+r.length;if(e>=t&&e<i){for(let a of o.children)if(a.type==="run")return a.formatting||{}}t=i;}return {}}function Ue(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o);t+=r.length;}else if(o.type==="hyperlink"){let r=g(o),i=t,a=t+r.length;if(e>=i&&e<a)return true;t=a;}return false}function Ge(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o);t+=r.length;}else if(o.type==="hyperlink"){let r=g(o),i=t,a=t+r.length;if(e>=i&&e<a)return o;t=a;}}function Ke(n){return n?n.toLowerCase().includes("heading"):false}function Qe(n){if(!n)return;let e=n.match(/heading\s*(\d)/i);if(e)return parseInt(e[1],10)}function Xe(n){for(let e of n.content)if(e.type==="paragraph"){for(let t of e.content)if(t.type==="run"){for(let o of t.content)if(o.type==="drawing")return true}}return false}function Ye(n){for(let e of n.content)if(e.type==="paragraph"){for(let t of e.content)if(t.type==="hyperlink")return true}return false}function $e(n){return n.content.some(e=>e.type==="table")}function y(n){return n.content.filter(e=>e.type==="paragraph")}function et(n,e){return y(n)[e]}function tt(n,e){let t=0;for(let o=0;o<n.content.length;o++)if(n.content[o].type==="paragraph"){if(t===e)return o;t++;}return -1}var ot="0.0.2";Object.defineProperty(exports,"DEFAULT_AI_ACTIONS",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.P}});Object.defineProperty(exports,"DocumentAgent",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.y}});Object.defineProperty(exports,"blendColors",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.l}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.F}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.E}});Object.defineProperty(exports,"buildSelectionContextFromContext",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.C}});Object.defineProperty(exports,"colorsEqual",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.m}});Object.defineProperty(exports,"comparePositions",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.M}});Object.defineProperty(exports,"createAgent",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.z}});Object.defineProperty(exports,"createAgentFromDocument",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.A}});Object.defineProperty(exports,"createCollapsedRange",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.J}});Object.defineProperty(exports,"createCommand",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.Q}});Object.defineProperty(exports,"createDocumentWithText",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.I}});Object.defineProperty(exports,"createEmptyDocument",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.H}});Object.defineProperty(exports,"createRange",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.K}});Object.defineProperty(exports,"createRgbColor",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.i}});Object.defineProperty(exports,"createThemeColor",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.h}});Object.defineProperty(exports,"darkenColor",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.j}});Object.defineProperty(exports,"default",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.y}});Object.defineProperty(exports,"emuToPixels",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.p}});Object.defineProperty(exports,"emuToTwips",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.r}});Object.defineProperty(exports,"formatPx",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.x}});Object.defineProperty(exports,"getActionDescription",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.O}});Object.defineProperty(exports,"getActionLabel",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.N}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.B}});Object.defineProperty(exports,"getContrastingColor",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.f}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.D}});Object.defineProperty(exports,"getSelectionFormattingSummary",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.G}});Object.defineProperty(exports,"halfPointsToPixels",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.u}});Object.defineProperty(exports,"isBlack",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.d}});Object.defineProperty(exports,"isPositionInRange",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.L}});Object.defineProperty(exports,"isWhite",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.e}});Object.defineProperty(exports,"lightenColor",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.k}});Object.defineProperty(exports,"parseColorString",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.g}});Object.defineProperty(exports,"pixelsToEmu",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.q}});Object.defineProperty(exports,"pixelsToTwips",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.o}});Object.defineProperty(exports,"pointsToPixels",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.t}});Object.defineProperty(exports,"resolveColor",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.a}});Object.defineProperty(exports,"resolveHighlightColor",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.b}});Object.defineProperty(exports,"resolveShadingColor",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.c}});Object.defineProperty(exports,"twipsToEmu",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.s}});Object.defineProperty(exports,"twipsToPixels",{enumerable:true,get:function(){return chunkPYAIJMEG_cjs.n}});Object.defineProperty(exports,"createTemplateProcessor",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.v}});Object.defineProperty(exports,"detectVariables",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.a}});Object.defineProperty(exports,"detectVariablesDetailed",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.b}});Object.defineProperty(exports,"detectVariablesInBody",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.c}});Object.defineProperty(exports,"detectVariablesInParagraph",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.d}});Object.defineProperty(exports,"documentHasVariables",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.m}});Object.defineProperty(exports,"extractVariablesFromText",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.e}});Object.defineProperty(exports,"formatVariable",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.i}});Object.defineProperty(exports,"getMissingVariables",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.s}});Object.defineProperty(exports,"getTemplateTags",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.q}});Object.defineProperty(exports,"hasTemplateVariables",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.f}});Object.defineProperty(exports,"isValidVariableName",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.g}});Object.defineProperty(exports,"isZodSchema",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.w}});Object.defineProperty(exports,"parseVariable",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.j}});Object.defineProperty(exports,"previewTemplate",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.t}});Object.defineProperty(exports,"processTemplate",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.n}});Object.defineProperty(exports,"processTemplateAdvanced",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.u}});Object.defineProperty(exports,"processTemplateAsBlob",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.p}});Object.defineProperty(exports,"processTemplateDetailed",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.o}});Object.defineProperty(exports,"removeVariables",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.l}});Object.defineProperty(exports,"replaceVariables",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.k}});Object.defineProperty(exports,"sanitizeVariableName",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.h}});Object.defineProperty(exports,"validateTemplate",{enumerable:true,get:function(){return chunkZRXLWSRP_cjs.r}});Object.defineProperty(exports,"createDocx",{enumerable:true,get:function(){return chunkTL3YTVN2_cjs.e}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunkTL3YTVN2_cjs.d}});Object.defineProperty(exports,"serializeDocumentBody",{enumerable:true,get:function(){return chunkTL3YTVN2_cjs.b}});Object.defineProperty(exports,"serializeDocx",{enumerable:true,get:function(){return chunkTL3YTVN2_cjs.c}});Object.defineProperty(exports,"serializeSectionProperties",{enumerable:true,get:function(){return chunkTL3YTVN2_cjs.a}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunkCDSUWDYP_cjs.m}});Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkFOU7PS3K_cjs.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkFOU7PS3K_cjs.b}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.a}});Object.defineProperty(exports,"createPluginRegistrar",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.d}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.c}});exports.VERSION=ot;exports.countCharacters=je;exports.countWords=f;exports.getBlockIndexForParagraph=tt;exports.getBodyCharacterCount=Ne;exports.getBodyText=Me;exports.getBodyWordCount=We;exports.getFormattingAtPosition=Je;exports.getHyperlinkAtPosition=Ge;exports.getHyperlinkText=g;exports.getParagraphAtIndex=et;exports.getParagraphText=p;exports.getParagraphs=y;exports.getRunText=c;exports.getTableText=x;exports.getTextAfter=_e;exports.getTextBefore=Ze;exports.hasHyperlinks=Ye;exports.hasImages=Xe;exports.hasTables=$e;exports.isHeadingStyle=Ke;exports.isPositionInHyperlink=Ue;exports.parseHeadingLevel=Qe;
4
+ `);return a.length>t?a.slice(0,t)+"...":a}function Je(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o),i=t+r.length;if(e>=t&&e<i)return o.formatting||{};t=i;}else if(o.type==="hyperlink"){let r=g(o),i=t+r.length;if(e>=t&&e<i){for(let a of o.children)if(a.type==="run")return a.formatting||{}}t=i;}return {}}function Ue(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o);t+=r.length;}else if(o.type==="hyperlink"){let r=g(o),i=t,a=t+r.length;if(e>=i&&e<a)return true;t=a;}return false}function Ge(n,e){let t=0;for(let o of n.content)if(o.type==="run"){let r=c(o);t+=r.length;}else if(o.type==="hyperlink"){let r=g(o),i=t,a=t+r.length;if(e>=i&&e<a)return o;t=a;}}function Ke(n){return n?n.toLowerCase().includes("heading"):false}function Qe(n){if(!n)return;let e=n.match(/heading\s*(\d)/i);if(e)return parseInt(e[1],10)}function Xe(n){for(let e of n.content)if(e.type==="paragraph"){for(let t of e.content)if(t.type==="run"){for(let o of t.content)if(o.type==="drawing")return true}}return false}function Ye(n){for(let e of n.content)if(e.type==="paragraph"){for(let t of e.content)if(t.type==="hyperlink")return true}return false}function $e(n){return n.content.some(e=>e.type==="table")}function x(n){return n.content.filter(e=>e.type==="paragraph")}function et(n,e){return x(n)[e]}function tt(n,e){let t=0;for(let o=0;o<n.content.length;o++)if(n.content[o].type==="paragraph"){if(t===e)return o;t++;}return -1}var ot="0.0.2";Object.defineProperty(exports,"DEFAULT_AI_ACTIONS",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.P}});Object.defineProperty(exports,"DocumentAgent",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.y}});Object.defineProperty(exports,"blendColors",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.l}});Object.defineProperty(exports,"buildExtendedSelectionContext",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.F}});Object.defineProperty(exports,"buildSelectionContext",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.E}});Object.defineProperty(exports,"buildSelectionContextFromContext",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.C}});Object.defineProperty(exports,"colorsEqual",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.m}});Object.defineProperty(exports,"comparePositions",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.M}});Object.defineProperty(exports,"createAgent",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.z}});Object.defineProperty(exports,"createAgentFromDocument",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.A}});Object.defineProperty(exports,"createCollapsedRange",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.J}});Object.defineProperty(exports,"createCommand",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.Q}});Object.defineProperty(exports,"createDocumentWithText",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.I}});Object.defineProperty(exports,"createEmptyDocument",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.H}});Object.defineProperty(exports,"createRange",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.K}});Object.defineProperty(exports,"createRgbColor",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.i}});Object.defineProperty(exports,"createThemeColor",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.h}});Object.defineProperty(exports,"darkenColor",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.j}});Object.defineProperty(exports,"emuToPixels",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.p}});Object.defineProperty(exports,"emuToTwips",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.r}});Object.defineProperty(exports,"formatPx",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.x}});Object.defineProperty(exports,"getActionDescription",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.O}});Object.defineProperty(exports,"getActionLabel",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.N}});Object.defineProperty(exports,"getAgentContext",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.B}});Object.defineProperty(exports,"getContrastingColor",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.f}});Object.defineProperty(exports,"getDocumentSummary",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.D}});Object.defineProperty(exports,"getSelectionFormattingSummary",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.G}});Object.defineProperty(exports,"halfPointsToPixels",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.u}});Object.defineProperty(exports,"isBlack",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.d}});Object.defineProperty(exports,"isPositionInRange",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.L}});Object.defineProperty(exports,"isWhite",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.e}});Object.defineProperty(exports,"lightenColor",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.k}});Object.defineProperty(exports,"parseColorString",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.g}});Object.defineProperty(exports,"pixelsToEmu",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.q}});Object.defineProperty(exports,"pixelsToTwips",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.o}});Object.defineProperty(exports,"pointsToPixels",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.t}});Object.defineProperty(exports,"resolveColor",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.a}});Object.defineProperty(exports,"resolveHighlightColor",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.b}});Object.defineProperty(exports,"resolveShadingColor",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.c}});Object.defineProperty(exports,"twipsToEmu",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.s}});Object.defineProperty(exports,"twipsToPixels",{enumerable:true,get:function(){return chunkQOIY4Y6N_cjs.n}});Object.defineProperty(exports,"createTemplateProcessor",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.v}});Object.defineProperty(exports,"detectVariables",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.a}});Object.defineProperty(exports,"detectVariablesDetailed",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.b}});Object.defineProperty(exports,"detectVariablesInBody",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.c}});Object.defineProperty(exports,"detectVariablesInParagraph",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.d}});Object.defineProperty(exports,"documentHasVariables",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.m}});Object.defineProperty(exports,"extractVariablesFromText",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.e}});Object.defineProperty(exports,"formatVariable",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.i}});Object.defineProperty(exports,"getMissingVariables",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.s}});Object.defineProperty(exports,"getTemplateTags",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.q}});Object.defineProperty(exports,"hasTemplateVariables",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.f}});Object.defineProperty(exports,"isValidVariableName",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.g}});Object.defineProperty(exports,"isZodSchema",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.w}});Object.defineProperty(exports,"parseVariable",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.j}});Object.defineProperty(exports,"previewTemplate",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.t}});Object.defineProperty(exports,"processTemplate",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.n}});Object.defineProperty(exports,"processTemplateAdvanced",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.u}});Object.defineProperty(exports,"processTemplateAsBlob",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.p}});Object.defineProperty(exports,"processTemplateDetailed",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.o}});Object.defineProperty(exports,"removeVariables",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.l}});Object.defineProperty(exports,"replaceVariables",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.k}});Object.defineProperty(exports,"sanitizeVariableName",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.h}});Object.defineProperty(exports,"validateTemplate",{enumerable:true,get:function(){return chunkH3JNHCD7_cjs.r}});Object.defineProperty(exports,"createDocx",{enumerable:true,get:function(){return chunkQYKJKSKZ_cjs.e}});Object.defineProperty(exports,"repackDocx",{enumerable:true,get:function(){return chunkQYKJKSKZ_cjs.d}});Object.defineProperty(exports,"serializeDocumentBody",{enumerable:true,get:function(){return chunkQYKJKSKZ_cjs.b}});Object.defineProperty(exports,"serializeDocx",{enumerable:true,get:function(){return chunkQYKJKSKZ_cjs.c}});Object.defineProperty(exports,"serializeSectionProperties",{enumerable:true,get:function(){return chunkQYKJKSKZ_cjs.a}});Object.defineProperty(exports,"parseDocx",{enumerable:true,get:function(){return chunkTRAQI6RX_cjs.o}});Object.defineProperty(exports,"executeCommand",{enumerable:true,get:function(){return chunkA7VY2V4X_cjs.a}});Object.defineProperty(exports,"executeCommands",{enumerable:true,get:function(){return chunkA7VY2V4X_cjs.b}});Object.defineProperty(exports,"PluginRegistry",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.a}});Object.defineProperty(exports,"createPluginRegistrar",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.d}});Object.defineProperty(exports,"pluginRegistry",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.b}});Object.defineProperty(exports,"registerPlugins",{enumerable:true,get:function(){return chunkXVFMG77A_cjs.c}});exports.VERSION=ot;exports.countCharacters=je;exports.countWords=f;exports.getBlockIndexForParagraph=tt;exports.getBodyCharacterCount=Ne;exports.getBodyText=Me;exports.getBodyWordCount=We;exports.getFormattingAtPosition=Je;exports.getHyperlinkAtPosition=Ge;exports.getHyperlinkText=g;exports.getParagraphAtIndex=et;exports.getParagraphText=p;exports.getParagraphs=x;exports.getRunText=c;exports.getTableText=m;exports.getTextAfter=_e;exports.getTextBefore=Ze;exports.hasHyperlinks=Ye;exports.hasImages=Xe;exports.hasTables=$e;exports.isHeadingStyle=Ke;exports.isPositionInHyperlink=Ue;exports.parseHeadingLevel=Qe;
@@ -1,7 +1,7 @@
1
- export { A as AgentContextOptions, S as ContextSelectionOptions, C as CreateEmptyDocumentOptions, D as DocumentAgent, E as ExtendedSelectionContext, F as FormattedTextSegment, a as FormattingSummary, I as InsertHyperlinkOptions, b as InsertImageOptions, c as InsertTableOptions, d as InsertTextOptions, P as ProcessTemplateOptions, e as ProcessTemplateResult, f as SelectionContextOptions, T as TemplateError, g as blendColors, h as buildExtendedSelectionContext, i as buildSelectionContext, j as buildSelectionContextFromContext, k as colorsEqual, l as createAgent, m as createAgentFromDocument, n as createDocumentWithText, o as createEmptyDocument, p as createRgbColor, q as createTemplateProcessor, r as createThemeColor, s as darkenColor, D as default, t as emuToPixels, u as emuToTwips, v as executeCommand, w as executeCommands, x as formatPx, y as getAgentContext, z as getContrastingColor, B as getDocumentSummary, G as getMissingVariables, H as getSelectionFormattingSummary, J as getTemplateTags, K as halfPointsToPixels, L as isBlack, M as isWhite, N as lightenColor, O as parseColorString, Q as parseDocx, R as pixelsToEmu, U as pixelsToTwips, V as pointsToPixels, W as previewTemplate, X as processTemplate, Y as processTemplateAdvanced, Z as processTemplateAsBlob, _ as processTemplateDetailed, $ as resolveColor, a0 as resolveHighlightColor, a1 as resolveShadingColor, a2 as serializeDocumentBody, a3 as serializeDocx, a4 as serializeSectionProperties, a5 as twipsToEmu, a6 as twipsToPixels, a7 as validateTemplate } from './colorResolver-Di-JRsr9.cjs';
2
- import { D as DocumentBody, e as Paragraph, T as TextFormatting, H as Hyperlink, R as Run, f as Table, g as Position, h as Document } from './types-BnShY2aQ.cjs';
3
- export { A as AIAction, i as AIActionRequest, j as AgentCommand, k as AgentContext, l as AgentResponse, m as ApplyStyleCommand, n as ApplyVariablesCommand, B as BlockContent, b as CommandHandler, o as CommandResult, C as CorePlugin, p as DEFAULT_AI_ACTIONS, q as DeleteTextCommand, r as DocxPackage, E as Endnote, F as Footnote, s as FormatParagraphCommand, t as FormatTextCommand, I as Image, u as InsertHyperlinkCommand, v as InsertImageCommand, w as InsertTableCommand, x as InsertTextCommand, J as JsonSchema, L as ListLevel, y as LoadedDocument, d as McpSession, z as McpToolAnnotations, G as McpToolContent, K as McpToolContext, M as McpToolDefinition, N as McpToolHandler, O as McpToolResult, Q as NumberingDefinitions, S as ParagraphContext, U as ParagraphFormatting, V as ParagraphOutline, C as Plugin, W as PluginCommand, b as PluginCommandHandler, X as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, Y as Range, Z as Relationship, _ as ReplaceTextCommand, $ as RunContent, a0 as SectionInfo, a1 as SectionProperties, a2 as SelectionContext, a3 as SetVariableCommand, a4 as Style, a5 as StyleDefinitions, a6 as StyleInfo, a7 as SuggestedAction, a8 as TableCell, a9 as TableRow, aa as TextContent, ab as Theme, M as ToolDefinition, N as ToolHandler, O as ToolResult, ac as ZodSchemaLike, ad as comparePositions, ae as createCollapsedRange, af as createCommand, ag as createRange, ah as getActionDescription, ai as getActionLabel, aj as isPositionInRange, ak as isZodSchema } from './types-BnShY2aQ.cjs';
4
- export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-CrAzNdUO.cjs';
1
+ export { A as AgentContextOptions, S as ContextSelectionOptions, C as CreateEmptyDocumentOptions, D as DocumentAgent, E as ExtendedSelectionContext, F as FormattedTextSegment, a as FormattingSummary, I as InsertHyperlinkOptions, b as InsertImageOptions, c as InsertTableOptions, d as InsertTextOptions, P as ProcessTemplateOptions, e as ProcessTemplateResult, f as SelectionContextOptions, T as TemplateError, g as blendColors, h as buildExtendedSelectionContext, i as buildSelectionContext, j as buildSelectionContextFromContext, k as colorsEqual, l as createAgent, m as createAgentFromDocument, n as createDocumentWithText, o as createEmptyDocument, p as createRgbColor, q as createTemplateProcessor, r as createThemeColor, s as darkenColor, t as emuToPixels, u as emuToTwips, v as executeCommand, w as executeCommands, x as formatPx, y as getAgentContext, z as getContrastingColor, B as getDocumentSummary, G as getMissingVariables, H as getSelectionFormattingSummary, J as getTemplateTags, K as halfPointsToPixels, L as isBlack, M as isWhite, N as lightenColor, O as parseColorString, Q as parseDocx, R as pixelsToEmu, U as pixelsToTwips, V as pointsToPixels, W as previewTemplate, X as processTemplate, Y as processTemplateAdvanced, Z as processTemplateAsBlob, _ as processTemplateDetailed, $ as resolveColor, a0 as resolveHighlightColor, a1 as resolveShadingColor, a2 as serializeDocumentBody, a3 as serializeDocx, a4 as serializeSectionProperties, a5 as twipsToEmu, a6 as twipsToPixels, a7 as validateTemplate } from './colorResolver-DiMquGWR.cjs';
2
+ import { D as DocumentBody, e as Paragraph, T as TextFormatting, H as Hyperlink, R as Run, f as Table, g as Position, h as Document } from './types-BALm1KBi.cjs';
3
+ export { A as AIAction, i as AIActionRequest, j as AgentCommand, k as AgentContext, l as AgentResponse, m as ApplyStyleCommand, n as ApplyVariablesCommand, B as BlockContent, b as CommandHandler, o as CommandResult, C as CorePlugin, p as DEFAULT_AI_ACTIONS, q as DeleteTextCommand, r as DocxPackage, E as Endnote, F as Footnote, s as FormatParagraphCommand, t as FormatTextCommand, I as Image, u as InsertHyperlinkCommand, v as InsertImageCommand, w as InsertTableCommand, x as InsertTextCommand, J as JsonSchema, L as ListLevel, y as LoadedDocument, d as McpSession, z as McpToolAnnotations, G as McpToolContent, K as McpToolContext, M as McpToolDefinition, N as McpToolHandler, O as McpToolResult, Q as NumberingDefinitions, S as ParagraphContext, U as ParagraphFormatting, V as ParagraphOutline, C as Plugin, W as PluginCommand, b as PluginCommandHandler, X as PluginEvent, c as PluginEventListener, P as PluginOptions, a as PluginRegistrationResult, Y as Range, Z as Relationship, _ as ReplaceTextCommand, $ as RunContent, a0 as SectionInfo, a1 as SectionProperties, a2 as SelectionContext, a3 as SetVariableCommand, a4 as Style, a5 as StyleDefinitions, a6 as StyleInfo, a7 as SuggestedAction, a8 as TableCell, a9 as TableRow, aa as TextContent, ab as Theme, M as ToolDefinition, N as ToolHandler, O as ToolResult, ac as ZodSchemaLike, ad as comparePositions, ae as createCollapsedRange, af as createCommand, ag as createRange, ah as getActionDescription, ai as getActionLabel, aj as isPositionInRange, ak as isZodSchema } from './types-BALm1KBi.cjs';
4
+ export { P as PluginRegistry, c as createPluginRegistrar, p as pluginRegistry, r as registerPlugins } from './registry-BUTMLqSj.cjs';
5
5
 
6
6
  /**
7
7
  * Shared Text Utilities for Agent Module