@eigenpal/docx-editor-core 1.3.0 → 1.3.2

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 (107) hide show
  1. package/dist/chunk-2LEFMTNZ.mjs +1 -0
  2. package/dist/chunk-4MYKVWNF.js +1 -0
  3. package/dist/chunk-4PANZ3VU.js +1 -0
  4. package/dist/{chunk-Q5B5GKXD.mjs → chunk-55XWETY4.mjs} +1 -1
  5. package/dist/chunk-6WZW3NSJ.js +1 -0
  6. package/dist/chunk-HKN2NKOG.mjs +1 -0
  7. package/dist/chunk-HPJBZL37.mjs +1 -0
  8. package/dist/{chunk-TURYWKNS.js → chunk-J3YFJDZD.js} +1 -1
  9. package/dist/chunk-JHTURDPX.mjs +1 -0
  10. package/dist/chunk-KKXCBWVG.mjs +1 -0
  11. package/dist/chunk-LJE7HQEJ.mjs +1 -0
  12. package/dist/chunk-LX35TFGF.mjs +1 -0
  13. package/dist/chunk-NRWQ65NX.js +1 -0
  14. package/dist/chunk-PFMM7QON.js +1 -0
  15. package/dist/chunk-PMSGJXOE.mjs +1 -0
  16. package/dist/chunk-QVRNNRG5.js +1 -0
  17. package/dist/chunk-RSU4HTC6.js +1 -0
  18. package/dist/{chunk-L6YTCHOQ.mjs → chunk-UEPLDKKM.mjs} +1 -1
  19. package/dist/chunk-YPQACU4A.js +1 -0
  20. package/dist/{chunk-TJRROR6U.js → chunk-ZAZWHK4J.js} +1 -1
  21. package/dist/core.d.mts +2 -2
  22. package/dist/core.d.ts +2 -2
  23. package/dist/core.js +1 -1
  24. package/dist/core.mjs +1 -1
  25. package/dist/editor/index.d.mts +128 -0
  26. package/dist/editor/index.d.ts +128 -0
  27. package/dist/editor/index.js +1 -0
  28. package/dist/editor/index.mjs +1 -0
  29. package/dist/{footnotes-BtVc6VFl.d.mts → footnotes-BZ24OTAT.d.mts} +11 -1
  30. package/dist/{footnotes-DcUMWXul.d.ts → footnotes-DMsicPGd.d.ts} +11 -1
  31. package/dist/{headerFooterLayout-4E-S4Aay.d.ts → headerFooterLayout-AtAOhM8E.d.ts} +18 -2
  32. package/dist/{headerFooterLayout-DlJLWmpR.d.mts → headerFooterLayout-CU6hvszp.d.mts} +18 -2
  33. package/dist/layout-bridge/clickToPositionDom.js +1 -1
  34. package/dist/layout-bridge/clickToPositionDom.mjs +1 -1
  35. package/dist/layout-bridge/index.d.mts +109 -5
  36. package/dist/layout-bridge/index.d.ts +109 -5
  37. package/dist/layout-bridge/index.js +1 -1
  38. package/dist/layout-bridge/index.mjs +1 -1
  39. package/dist/layout-bridge/measuring/index.d.mts +5 -95
  40. package/dist/layout-bridge/measuring/index.d.ts +5 -95
  41. package/dist/layout-bridge/measuring/index.js +1 -1
  42. package/dist/layout-bridge/measuring/index.mjs +1 -1
  43. package/dist/layout-bridge/tableInsertHover.js +1 -1
  44. package/dist/layout-bridge/tableInsertHover.mjs +1 -1
  45. package/dist/layout-bridge/toFlowBlocks.js +1 -1
  46. package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
  47. package/dist/layout-engine/index.js +1 -1
  48. package/dist/layout-engine/index.mjs +1 -1
  49. package/dist/layout-painter/index.d.mts +2 -2
  50. package/dist/layout-painter/index.d.ts +2 -2
  51. package/dist/layout-painter/index.js +1 -1
  52. package/dist/layout-painter/index.mjs +1 -1
  53. package/dist/layout-painter/renderPage.d.mts +8 -3
  54. package/dist/layout-painter/renderPage.d.ts +8 -3
  55. package/dist/layout-painter/renderPage.js +1 -1
  56. package/dist/layout-painter/renderPage.mjs +1 -1
  57. package/dist/measureBlocksPipeline-BMqbRFQB.d.mts +96 -0
  58. package/dist/measureBlocksPipeline-iYNzAH-o.d.ts +96 -0
  59. package/dist/prosemirror/applyFormatting.d.mts +67 -0
  60. package/dist/prosemirror/applyFormatting.d.ts +67 -0
  61. package/dist/prosemirror/applyFormatting.js +1 -0
  62. package/dist/prosemirror/applyFormatting.mjs +1 -0
  63. package/dist/prosemirror/commentIdAllocator.d.mts +50 -0
  64. package/dist/prosemirror/commentIdAllocator.d.ts +50 -0
  65. package/dist/prosemirror/commentIdAllocator.js +1 -0
  66. package/dist/prosemirror/commentIdAllocator.mjs +1 -0
  67. package/dist/prosemirror/commentOps.d.mts +46 -0
  68. package/dist/prosemirror/commentOps.d.ts +46 -0
  69. package/dist/prosemirror/commentOps.js +1 -0
  70. package/dist/prosemirror/commentOps.mjs +1 -0
  71. package/dist/prosemirror/conversion/index.js +1 -1
  72. package/dist/prosemirror/conversion/index.mjs +1 -1
  73. package/dist/prosemirror/imageCommit.d.mts +35 -0
  74. package/dist/prosemirror/imageCommit.d.ts +35 -0
  75. package/dist/prosemirror/imageCommit.js +1 -0
  76. package/dist/prosemirror/imageCommit.mjs +1 -0
  77. package/dist/prosemirror/index.js +2 -2
  78. package/dist/prosemirror/index.mjs +1 -1
  79. package/dist/prosemirror/paraText.d.mts +52 -0
  80. package/dist/prosemirror/paraText.d.ts +52 -0
  81. package/dist/prosemirror/paraText.js +1 -0
  82. package/dist/prosemirror/paraText.mjs +1 -0
  83. package/dist/prosemirror/queries.d.mts +65 -0
  84. package/dist/prosemirror/queries.d.ts +65 -0
  85. package/dist/prosemirror/queries.js +2 -0
  86. package/dist/prosemirror/queries.mjs +2 -0
  87. package/dist/prosemirror/tableResize.d.mts +58 -0
  88. package/dist/prosemirror/tableResize.d.ts +58 -0
  89. package/dist/prosemirror/tableResize.js +1 -0
  90. package/dist/prosemirror/tableResize.mjs +1 -0
  91. package/dist/utils/autoScroll.d.mts +24 -0
  92. package/dist/utils/autoScroll.d.ts +24 -0
  93. package/dist/utils/autoScroll.js +1 -0
  94. package/dist/utils/autoScroll.mjs +1 -0
  95. package/package.json +73 -1
  96. package/dist/chunk-72KLR6TJ.mjs +0 -1
  97. package/dist/chunk-7JQVKJRN.mjs +0 -1
  98. package/dist/chunk-7WGN2OBZ.js +0 -1
  99. package/dist/chunk-B46V5G46.mjs +0 -1
  100. package/dist/chunk-BUCOTKYY.js +0 -1
  101. package/dist/chunk-FQS436KN.js +0 -1
  102. package/dist/chunk-IUVQJ6PX.mjs +0 -1
  103. package/dist/chunk-JUMHC5Z6.mjs +0 -1
  104. package/dist/chunk-MEVZCB56.mjs +0 -1
  105. package/dist/chunk-T4RYVPAB.js +0 -1
  106. package/dist/chunk-WDBZ3QVB.js +0 -1
  107. package/dist/chunk-XWC67YLW.js +0 -1
@@ -1 +0,0 @@
1
- import {c}from'./chunk-B46V5G46.mjs';import {V,L,k,l}from'./chunk-72KLR6TJ.mjs';import {b}from'./chunk-IUVQJ6PX.mjs';import {e}from'./chunk-VW22RZ6C.mjs';function Q(e,n){if(e.pages.length===0)return null;let a=e.pageGap??0,r=0,t=null,o=1/0;for(let s=0;s<e.pages.length;s++){let i=e.pages[s],l=i.size?.h??e.pageSize.h,f=r,u=f+l;if(n.y>=f&&n.y<u)return {pageIndex:s,page:i,pageY:n.y-f};let c=f+l/2,p=Math.abs(n.y-c);p<o&&(o=p,t=s),r=u+a;}if(t!==null){let s=e.pages[t],i=D(e,t);return {pageIndex:t,page:s,pageY:Math.max(0,Math.min(n.y-i,s.size?.h??e.pageSize.h))}}return null}function D(e,n){let a=e.pageGap??0,r=0;for(let t=0;t<n&&t<e.pages.length;t++){let s=e.pages[t].size?.h??e.pageSize.h;r+=s+a;}return r}function Ee(e,n){return Q(e,{y:n})?.pageIndex??null}function Z(e,n){return e.findIndex(a=>a.id===n)}function Le(e,n){let a=0;for(let r=e.fromLine;r<e.toLine&&r<n.lines.length;r++)a+=n.lines[r].lineHeight;return a}function fe(e,n,a,r){let t=[...e.page.fragments].sort((o,s)=>{let i=o.y-s.y;return Math.abs(i)>.5?i:o.x-s.x});for(let o of t){let s=Z(n,o.blockId);if(s===-1)continue;let i=n[s],l=a[s];if(!i||!l)continue;let f;if(o.kind==="paragraph"){if(i.kind!=="paragraph"||l.kind!=="paragraph")continue;f=Le(o,l);}else if(o.kind==="table")f=o.height;else if(o.kind==="image")f=o.height;else continue;let u=r.x>=o.x&&r.x<=o.x+o.width,c=r.y>=o.y&&r.y<=o.y+f;if(u&&c)return {fragment:o,block:i,measure:l,pageIndex:e.pageIndex,localX:r.x-o.x,localY:r.y-o.y}}return null}function Ce(e,n,a,r){for(let t of e.page.fragments){if(t.kind!=="image")continue;let o=Z(n,t.blockId);if(o===-1)continue;let s=n[o],i=a[o];if(!s||!i)continue;let l=r.x>=t.x&&r.x<=t.x+t.width,f=r.y>=t.y&&r.y<=t.y+t.height;if(l&&f)return {fragment:t,block:s,measure:i,pageIndex:e.pageIndex,localX:r.x-t.x,localY:r.y-t.y}}return null}function de(e,n,a,r){for(let t of e.page.fragments){if(t.kind!=="table")continue;let o=t,s=r.x>=o.x&&r.x<=o.x+o.width,i=r.y>=o.y&&r.y<=o.y+o.height;if(!s||!i)continue;let l=Z(n,o.blockId);if(l===-1)continue;let f=n[l],u=a[l];if(!f||f.kind!=="table"||!u||u.kind!=="table")continue;let c=f,p=u,g=r.x-o.x,x=r.y-o.y,d=o.headerRowCount??0,h=d>0&&o.continuesFromPrev?V(p,d):0,m=0,b=-1;if(p.rows.length===0||c.rows.length===0)continue;if(h>0&&x<h){let T=0;for(let H=0;H<d&&H<p.rows.length;H++){let C=p.rows[H];if(x>=T&&x<T+C.height){b=H;break}T+=C.height;}b===-1&&(b=0);}else {let T=x-h;for(let H=o.fromRow;H<o.toRow&&H<p.rows.length;H++){let C=p.rows[H];if(T>=m&&T<m+C.height){b=H;break}m+=C.height;}}if(b===-1&&(b=Math.min(o.toRow-1,p.rows.length-1),b<o.fromRow))continue;let k=p.rows[b],P=c.rows[b];if(!k||!P)continue;let M=0,y=-1;if(k.cells.length===0||P.cells.length===0)continue;for(let T=0;T<k.cells.length;T++){let H=k.cells[T];if(g>=M&&g<M+H.width){y=T;break}M+=H.width;}if(y===-1&&(y=k.cells.length-1,y<0))continue;let w=k.cells[y],R=P.cells[y];if(!w||!R)continue;let F=0;if(h>0&&b<d)for(let T=0;T<b;T++)F+=p.rows[T]?.height??0;else {F=h;for(let T=o.fromRow;T<b;T++)F+=p.rows[T]?.height??0;}let I=0;for(let T=0;T<y;T++)I+=k.cells[T]?.width??0;let v,S;if(R.blocks&&R.blocks.length>0){let T=R.blocks[0],H=w.blocks[0];T.kind==="paragraph"&&H?.kind==="paragraph"&&(v=T,S=H);}let L=g-I,E=x-F;return {fragment:o,block:c,measure:p,pageIndex:e.pageIndex,rowIndex:b,colIndex:y,cellBlock:v,cellMeasure:S,cellLocalX:Math.max(0,L),cellLocalY:Math.max(0,E)}}return null}function De(e,n,a,r){let t={pageHit:null,fragmentHit:null,tableCellHit:null};if(t.pageHit=Q(e,r),!t.pageHit)return t;let o=D(e,t.pageHit.pageIndex),s={x:r.x,y:r.y-o};return t.fragmentHit=fe(t.pageHit,n,a,s),t.fragmentHit?.fragment.kind==="table"&&(t.tableCellHit=de(t.pageHit,n,a,s)),t}function Ae(e){if(e.pages.length===0)return 0;let n=e.pageGap??0,a=0;for(let r=0;r<e.pages.length;r++){let t=e.pages[r];a+=t.size?.h??e.pageSize.h,r<e.pages.length-1&&(a+=n);}return a}function _e(e,n){return D(e,n)}function Oe(e,n){if(n<0||n>=e.pages.length)return null;let a=D(e,n),t=e.pages[n].size?.h??e.pageSize.h;return {top:a,bottom:a+t}}function ee(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function he(e,n){let a=[];for(let r=n.fromRun;r<=n.toRun&&r<e.runs.length;r++){let t=e.runs[r];if(t){if(t.kind==="tab"||t.kind==="image"||t.kind==="lineBreak"){a.push(t);continue}if(t.kind==="text"){let o=t.text??"",s=r===n.fromRun,i=r===n.toRun;if(s||i){let l=s?n.fromChar:0,f=i?n.toChar:o.length,u=o.slice(l,f);u.length>0&&a.push({...t,text:u});}else a.push(t);}}}return a}function me(e,n){let a,r,t=e.pmStart??0,o=0;for(let s=0;s<e.runs.length&&s<=n.toRun;s++){let i=e.runs[s];i&&(s<n.fromRun?i.kind==="text"?o+=(i.text??"").length:(i.kind==="tab"||i.kind==="lineBreak"||i.kind==="image")&&(o+=1):s===n.fromRun&&(o+=n.fromChar,a=t+o,i.kind==="text"&&(o=n.fromChar)));}if(a!==void 0){let s=0;for(let i=n.fromRun;i<=n.toRun&&i<e.runs.length;i++){let l=e.runs[i];if(l)if(l.kind==="text"){let f=l.text??"",u=i===n.fromRun?n.fromChar:0,c=i===n.toRun?n.toChar:f.length;s+=c-u;}else (l.kind==="tab"||l.kind==="lineBreak"||l.kind==="image")&&(s+=1);}r=a+s;}return {pmStart:a,pmEnd:r}}function Xe(e,n,a,r){let t=0;for(let o=a;o<r&&o<e.lines.length;o++){let i=e.lines[o].lineHeight;if(n>=t&&n<t+i)return o;t+=i;}return r>a?Math.min(r-1,e.lines.length-1):null}function ve(e,n,a,r){let{pmStart:t,pmEnd:o}=me(e,n);if(t===void 0||o===void 0)return {charOffset:0,pmPosition:e.pmStart??0};let s=e.attrs?.alignment??"left",i=0;s==="center"?i=Math.max(0,(r-n.width)/2):s==="right"&&(i=Math.max(0,r-n.width));let l$1=Math.max(0,a-i);if(l$1<=0)return {charOffset:0,pmPosition:t};let f=he(e,n);if(f.length===0)return {charOffset:0,pmPosition:t};let u=0,c=0;for(let g of f){if(g.kind==="tab"){let x=g.width??48,d=u+x;if(l$1<=d){let h=u+x/2;return l$1<h?{charOffset:c,pmPosition:t+c}:{charOffset:c+1,pmPosition:t+c+1}}u=d,c+=1;continue}if(g.kind==="image"){let x=g.width,d=u+x;if(l$1<=d){let h=u+x/2;return l$1<h?{charOffset:c,pmPosition:t+c}:{charOffset:c+1,pmPosition:t+c+1}}u=d,c+=1;continue}if(g.kind==="lineBreak"){if(l$1>=u)return {charOffset:c,pmPosition:t+c};c+=1;continue}if(g.kind==="text"){let x=g.text??"";if(x.length===0)continue;let d=ee(g),h=k(x,d),m=u+h.width;if(l$1<=m){let b=l$1-u,k=l(b,h.charWidths),P=c+k;return {charOffset:P,pmPosition:t+P}}u=m,c+=x.length;}}return {charOffset:o-t,pmPosition:o}}function te(e){let{fragment:n,block:a,measure:r,localX:t,localY:o}=e;if(n.kind!=="paragraph"||a.kind!=="paragraph"||r.kind!=="paragraph")return null;let s=n,i=a,l=r,f=Xe(l,o,s.fromLine,s.toLine);if(f===null)return null;let u=l.lines[f];if(!u)return null;let c=0;for(let k=s.fromLine;k<f;k++)c+=l.lines[k]?.lineHeight??0;let p=i.attrs?.indent,g=p?.left??0,x=p?.right??0,d=Math.max(0,n.width-g-x),h=t-g,{charOffset:m,pmPosition:b}=ve(i,u,h,d);return {pmPosition:b,charOffset:m,lineIndex:f}}function ge(e){let{cellBlock:n,cellMeasure:a,cellLocalX:r,cellLocalY:t}=e;if(!n||!a)return null;let o={fragment:{kind:"paragraph",blockId:n.id,x:0,y:0,width:a.lines.reduce((i,l)=>Math.max(i,l.width),100),fromLine:0,toLine:a.lines.length,height:a.totalHeight},block:n,measure:a,pageIndex:e.pageIndex,localX:r,localY:t};return te(o)?.pmPosition??null}function Ne(e,n){if(n)return ge(n);if(!e)return null;let{fragment:a}=e;return a.kind==="paragraph"?te(e)?.pmPosition??null:a.kind==="image"?a.pmStart??null:null}function pe(e,n,a,r){let t=e.pmStart??0,o=e.pmEnd??t;if(a<t||a>o)return null;let s=a-t;for(let i=0;i<n.lines.length;i++){let l=n.lines[i],{pmStart:f,pmEnd:u}=me(e,l);if(f===void 0||u===void 0)continue;let c=f-t,p=u-t;if(s>=c&&s<=p){let g=s-c,x=he(e,l),d=0,h=0;for(let m of x)if(m.kind==="tab"){if(g<=h+1)return g<=h?{x:d,lineIndex:i}:{x:d+(m.width??48),lineIndex:i};d+=m.width??48,h+=1;}else if(m.kind==="image"){if(g<=h+1)return g<=h?{x:d,lineIndex:i}:{x:d+m.width,lineIndex:i};d+=m.width,h+=1;}else if(m.kind==="lineBreak"){if(g<=h)return {x:d,lineIndex:i};h+=1;}else if(m.kind==="text"){let b=m.text??"";if(g<=h+b.length){let M=g-h,y=ee(m),w=k(b.slice(0,M),y);return {x:d+w.width,lineIndex:i}}let k$1=ee(m),P=k(b,k$1);d+=P.width,h+=b.length;}return {x:d,lineIndex:i}}}return null}function Ye(e,n,a,r,t,o,s){let i=pe(e,n,a);if(!i)return null;let l=e.attrs?.alignment??"left",f=e.attrs?.indent,u=f?.left??0,c=f?.right??0,p=Math.max(0,o-u-c),g=n.lines[i.lineIndex];if(!g)return null;let x=0;l==="center"?x=Math.max(0,(p-g.width)/2):l==="right"&&(x=Math.max(0,p-g.width));let d=0;for(let h=s;h<i.lineIndex;h++)d+=n.lines[h]?.lineHeight??0;return {x:r+u+x+i.x,y:t+d,height:g.lineHeight}}function be(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function ne(e,n){return e.findIndex(a=>a.id===n)}function U(e,n){let r=(e.pmStart??0)+1,t=0,o;for(let l=0;l<e.runs.length&&l<=n.toRun;l++){let f=e.runs[l];if(f){if(l<n.fromRun)f.kind==="text"?t+=(f.text??"").length:t+=1;else if(l===n.fromRun){t+=n.fromChar,o=r+t;break}}}o===void 0&&(o=r);let s=0;for(let l=n.fromRun;l<=n.toRun&&l<e.runs.length;l++){let f=e.runs[l];if(f)if(f.kind==="text"){let u=f.text??"",c=l===n.fromRun?n.fromChar:0,p=l===n.toRun?n.toChar:u.length;s+=p-c;}else s+=1;}let i=o+s;return {pmStart:o,pmEnd:i}}function xe(e,n,a,r){let t=[];for(let o=0;o<n.lines.length;o++){let s=n.lines[o],i=U(e,s);i.pmStart===void 0||i.pmEnd===void 0||i.pmEnd>a&&i.pmStart<r&&t.push({line:s,index:o});}return t}function G(e,n,a){let r=U(e,n);return r.pmStart===void 0?0:Math.max(0,a-r.pmStart)}function W(e,n,a,r){let t=0,o=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 l=i.width??48;if(o+1>=a)return a<=o?t:t+l;t+=l,o+=1;continue}if(i.kind==="image"){let l=i.width;if(o+1>=a)return a<=o?t:t+l;t+=l,o+=1;continue}if(i.kind==="lineBreak"){if(a<=o)return t;o+=1;continue}if(i.kind==="text"){let l=i.text??"",f=s===n.fromRun,u=s===n.toRun,c=f?n.fromChar:0,p=u?n.toChar:l.length,g=l.slice(c,p);if(o+g.length>=a){let h=a-o,m=be(i),b=k(g.slice(0,h),m);return t+b.width}let x=be(i),d=k(g,x);t+=d.width,o+=g.length;}}}return t}function j(e,n){let a=0;for(let r=0;r<n&&r<e.lines.length;r++)a+=e.lines[r].lineHeight;return a}function ze(e,n,a,r,t){if(r===t)return [];let o=Math.min(r,t),s=Math.max(r,t),i=[];for(let l=0;l<e.pages.length;l++){let f=e.pages[l],u=D(e,l);for(let c of f.fragments){if(c.kind==="paragraph"){let p=ne(n,c.blockId);if(p===-1)continue;let g=n[p],x=a[p];if(!g||g.kind!=="paragraph"||!x||x.kind!=="paragraph")continue;let d=g,h=x,m=c,b=xe(d,h,o,s);for(let{line:k,index:P}of b){if(P<m.fromLine||P>=m.toLine)continue;let M=U(d,k);if(M.pmStart===void 0||M.pmEnd===void 0)continue;let y=Math.max(M.pmStart,o),w=Math.min(M.pmEnd,s);if(y>=w)continue;let R=G(d,k,y),F=G(d,k,w),B=d.attrs?.indent,I=B?.left??0,v=B?.right??0,S=Math.max(0,c.width-I-v),L=W(d,k,R),E=W(d,k,F),T=d.attrs?.alignment??"left",H=0;T==="center"?H=Math.max(0,(S-k.width)/2):T==="right"&&(H=Math.max(0,S-k.width));let C=j(h,P)-j(h,m.fromLine),_=c.x+I+H+Math.min(L,E),Y=Math.max(1,Math.abs(E-L)),z=c.y+C;i.push({x:_,y:z+u,width:Y,height:k.lineHeight,pageIndex:l});}}if(c.kind==="table"){let p=ne(n,c.blockId);if(p===-1)continue;let g=n[p],x=a[p];if(!g||g.kind!=="table"||!x||x.kind!=="table")continue;let d=g,h=x,m=c,b=[],k=0;for(let F=0;F<h.rows.length;F++)b.push(Math.round(k)),k+=h.rows[F]?.height??0;b.push(Math.round(k));let P=m.headerRowCount??0,M=P>0&&m.continuesFromPrev?V(h,P):0,y=(b[m.fromRow]??0)+(m.topClip??0),w=m.bottomClip!==void 0?Math.round(m.height):M+((b[m.toRow]??0)-y),R=F=>M+(F-y);for(let F=m.fromRow;F<m.toRow&&F<d.rows.length;F++){let B=d.rows[F],I=h.rows[F];if(!B||!I)continue;let v=b[F]??0,S=0;for(let L$1=0;L$1<B.cells.length;L$1++){let E=B.cells[L$1],T=I.cells[L$1];if(!E||!T)continue;let H=E.padding?.top??0,C=L(E.blocks,T.blocks,H);for(let _=0;_<E.blocks.length;_++){let Y=E.blocks[_],z=T.blocks[_];if(!Y||Y.kind!=="paragraph"||!z||z.kind!=="paragraph")continue;let N=Y,He=z,we=C.lineTops[_]??[],Re=xe(N,He,o,s);for(let{line:O,index:Be}of Re){let V=U(N,O);if(V.pmStart===void 0||V.pmEnd===void 0)continue;let oe=Math.max(V.pmStart,o),re=Math.min(V.pmEnd,s);if(oe>=re)continue;let J=R(v+(we[Be]??0));if(J+O.lineHeight<=M||J>=w)continue;let Ie=G(N,O,oe),Se=G(N,O,re),ie=W(N,O,Ie,T.width),ae=W(N,O,Se,T.width);i.push({x:m.x+S+Math.min(ie,ae),y:m.y+J+u,width:Math.max(1,Math.abs(ae-ie)),height:O.lineHeight,pageIndex:l});}}S+=T.width;}}}if(c.kind==="image"){let p=c.pmStart??0;(c.pmEnd??p+1)>o&&p<s&&i.push({x:c.x,y:c.y+u,width:c.width,height:c.height,pageIndex:l});}}}return i}function Ge(e,n,a,r){for(let t=0;t<e.pages.length;t++){let o=e.pages[t],s=D(e,t);for(let i of o.fragments){if(i.kind==="paragraph"){let l=ne(n,i.blockId);if(l===-1)continue;let f=n[l],u=a[l];if(!f||f.kind!=="paragraph"||!u||u.kind!=="paragraph")continue;let c=f,p=u,g=i,x=c.pmStart??0,d=c.pmEnd??x;if(r<x||r>d)continue;for(let h=g.fromLine;h<g.toLine;h++){let m=p.lines[h];if(!m)continue;let b=U(c,m);if(!(b.pmStart===void 0||b.pmEnd===void 0)&&r>=b.pmStart&&r<=b.pmEnd){let k=G(c,m,r),P=c.attrs?.indent,M=P?.left??0,y=P?.right??0,w=Math.max(0,i.width-M-y),R=W(c,m,k),F=c.attrs?.alignment??"left",B=0;F==="center"?B=Math.max(0,(w-m.width)/2):F==="right"&&(B=Math.max(0,w-m.width));let I=j(p,h)-j(p,g.fromLine);return {x:i.x+M+B+R,y:i.y+I+s,height:m.lineHeight,pageIndex:t}}}}if(i.kind==="image"){let l=i.pmStart??0,f=i.pmEnd??l+1;if(r>=l&&r<=f){let u=r===l?0:i.width;return {x:i.x+u,y:i.y+s,height:i.height,pageIndex:t}}}}}return null}function We(e){return e.length<=1?false:new Set(e.map(a=>a.pageIndex)).size>1}function Ue(e){let n=new Map;for(let a of e){let r=n.get(a.pageIndex)??[];r.push(a),n.set(a.pageIndex,r);}return n}function Ve(e){if(e.kind!=="paragraph")return false;let n=e.attrs;return n?!!(n.borders?.top||n.borders?.bottom||n.spacingExplicit?.before||n.spacingExplicit?.after):false}function Te(e){return ke(e)}function ke(e){let n=new Set;for(let a=1;a<e.length;a++){let r=e[a-1],t=e[a];r.kind==="table"&&t.kind==="paragraph"&&(t.runs.length>0||Ve(t)||n.add(a));}return e.map((a,r)=>{if(a.kind==="table")return qe(a);if(a.kind!=="paragraph")return a;let t=n.has(r),o=a.attrs?.spacingExplicit,s=a.attrs?.spacing?.before!=null,i=a.attrs?.spacing?.after!=null,l=s&&!o?.before,f=i&&!o?.after,u=l||f;if(!u&&!t)return a;let c=a.attrs;return u&&c?.spacing&&(c={...c,spacing:{...c.spacing,before:o?.before?c.spacing.before:void 0,after:o?.after?c.spacing.after:void 0}}),t&&(c={...c??{},suppressEmptyParagraphHeight:true}),{...a,attrs:c}})}function qe(e){let n=false,a=e.rows.map(r=>{let t=false,o=r.cells.map(s=>{let i=ke(s.blocks);return i.some((f,u)=>f!==s.blocks[u])?(t=true,{...s,blocks:i}):s});return t?(n=true,{...r,cells:o}):r});return n?{...e,rows:a}:e}function je(e){return e?.align??e?.alignment}function Fe(e$1,n,a,r){let t=r.section==="header"?r.margins.header??48:r.pageSize.h-(r.margins.footer??48)-a,o=e$1.position?.vertical;if(!o)return n;let s=je(o),i=o.posOffset!==void 0?e(o.posOffset):void 0;if(o.relativeTo==="page"){if(i!==void 0)return i-t;if(s==="top")return -t;if(s==="bottom")return r.pageSize.h-e$1.height-t;if(s==="center")return (r.pageSize.h-e$1.height)/2-t}if(o.relativeTo==="margin"){let l=r.margins.top,f=r.pageSize.h-r.margins.top-r.margins.bottom;if(i!==void 0)return l+i-t;if(s==="top")return l-t;if(s==="bottom")return l+f-e$1.height-t;if(s==="center")return l+(f-e$1.height)/2-t}return i!==void 0?n+i:n}function Pe(e,n,a,r){let t=0,o=a,s=0;for(let i=0;i<e.length;i++){let l=e[i],f=n[i];if(!(!l||!f)){if(l.kind==="paragraph"&&f.kind==="paragraph"){let u=s,c=u+f.totalHeight;t=Math.min(t,u),o=Math.max(o,c);for(let p of l.runs){if(p.kind!=="image"||!p.position)continue;let g=Fe(p,u,a,r);t=Math.min(t,g),o=Math.max(o,g+p.height);}s=c;}else if(l.kind==="table"&&f.kind==="table"){let u=s+f.totalHeight;t=Math.min(t,s),o=Math.max(o,u),s=u;}else if(l.kind==="image"&&f.kind==="image"){let u=s+f.height;t=Math.min(t,s),o=Math.max(o,u),s=u;}else if(l.kind==="textBox"&&f.kind==="textBox"){let u=s+f.height;t=Math.min(t,s),o=Math.max(o,u),s=u;}}}return {visualTop:t,visualBottom:o}}function $e(e,n,a,r){if(!e||!e.content||e.content.length===0)return;let t=b(e.content,{styles:r.styles??void 0,theme:r.theme??null,defaultTabStopTwips:r.defaultTabStopTwips??null});return Me(t,n,a,r)}function Me(e,n,a,r){let t=c(e,{theme:r.theme??void 0});if(t.length===0)return;let o=Te(t),s=r.measureBlocks(o,n),i=s.reduce((u,c)=>c.kind==="paragraph"||c.kind==="table"?u+c.totalHeight:c.kind==="image"||c.kind==="textBox"?u+c.height:u,0),{visualTop:l,visualBottom:f}=Pe(t,s,i,a);return {blocks:o,measures:s,height:i,visualTop:l,visualBottom:f}}var $={header:null,footer:null};function Je(){$.header=null,$.footer=null;}function ye(e,n){let a=n.querySelectorAll(`.layout-page-${e}`);if(a.length===0)return null;let r=n.defaultView,t=r?r.innerHeight/2:0,o=a[0],s=1/0;for(let c of Array.from(a)){let p=c.getBoundingClientRect(),g=Math.abs((p.top+p.bottom)/2-t);g<s&&(s=g,o=c);}let i=$[e];if(i&&i.host===o&&i.host.isConnected)return i;let l=Array.from(o.querySelectorAll("span[data-pm-start][data-pm-end]")),f=Array.from(o.querySelectorAll("[data-pm-start][data-pm-end]")),u={host:o,spans:l,ranged:f};return $[e]=u,u}function Ke(e,n,a=globalThis.document){let r=e.state.selection;if(!r.empty)return null;let t=r.head,o=ye(n,a);if(!o)return null;let{host:s,spans:i}=o;for(let d of i){let h=Number(d.dataset.pmStart),m=Number(d.dataset.pmEnd);if(!(!Number.isFinite(h)||!Number.isFinite(m))&&t>=h&&t<=m){let b=s.ownerDocument.createRange(),k=s.ownerDocument.createTreeWalker(d,NodeFilter.SHOW_TEXT),P=t-h,M=k.nextNode();for(;M;){let R=M.data.length;if(P<=R){try{b.setStart(M,P),b.setEnd(M,P);let F=b.getClientRects()[0]??b.getBoundingClientRect();if(F&&F.height>0)return {top:F.top,left:F.left,height:F.height}}catch{}break}P-=R,M=k.nextNode();}let y=d.getBoundingClientRect(),w=(t-h)/Math.max(1,m-h);return {top:y.top,left:y.left+y.width*w,height:y.height}}}let l=s.querySelector(`[data-pm-start="${t}"]`);if(l){let d=l.getBoundingClientRect();return {top:d.top,left:d.left+1,height:d.height||16}}let f=o.ranged,u=null,c=1/0;for(let d of f){let h=Number(d.dataset.pmStart),m=Number(d.dataset.pmEnd);if(!Number.isFinite(h)||!Number.isFinite(m)||t<h||t>m)continue;let b=m-h;b<c&&(c=b,u=d);}if(u){let d=u.getBoundingClientRect(),h=Number(u.dataset.pmEnd),m=t>=h;return {top:d.top,left:m?d.right:d.left+1,height:d.height||16}}let p=null,g=-1/0;for(let d of f){let h=Number(d.dataset.pmStart);Number.isFinite(h)&&(h>t||h>g&&(g=h,p=d));}if(p){let d=p.getBoundingClientRect();return {top:d.top,left:d.right,height:d.height||16}}let x=s.getBoundingClientRect();return {top:x.top+2,left:x.left+2,height:16}}function Qe(e,n,a=globalThis.document){let r=e.state.selection;if(r.empty)return [];let t=r.from,o=r.to,s=[],i=ye(n,a);if(!i)return s;let{host:l,spans:f}=i;for(let u of f){let c=Number(u.dataset.pmStart),p=Number(u.dataset.pmEnd);if(!Number.isFinite(c)||!Number.isFinite(p)||p<=t||c>=o)continue;if(u.classList.contains("layout-run-tab")){let m=u.getBoundingClientRect();s.push({top:m.top,left:m.left,width:m.width,height:m.height});continue}let g=null;if(u.firstChild?.nodeType===Node.TEXT_NODE?g=u.firstChild:u.firstChild?.nodeType===Node.ELEMENT_NODE&&u.firstChild.tagName==="A"&&u.firstChild.firstChild?.nodeType===Node.TEXT_NODE&&(g=u.firstChild.firstChild),!g)continue;let x=Math.max(0,t-c),d=Math.min(g.length,o-c);if(x>=d)continue;let h=l.ownerDocument.createRange();h.setStart(g,x),h.setEnd(g,d);for(let m of Array.from(h.getClientRects()))s.push({top:m.top,left:m.left,width:m.width,height:m.height});}return s}var Ze=816,et=1056,tt=96,nt=48;function A(e){return Math.round(e/1440*96)}function ot(e){return {w:e?.pageWidth?A(e.pageWidth):816,h:e?.pageHeight?A(e.pageHeight):1056}}function rt(e){return {top:e?.marginTop?A(e.marginTop):96,right:e?.marginRight?A(e.marginRight):96,bottom:e?.marginBottom?A(e.marginBottom):96,left:e?.marginLeft?A(e.marginLeft):96,header:e?.headerDistance?A(e.headerDistance):48,footer:e?.footerDistance?A(e.footerDistance):48}}function it(e,n){let a={header:null,footer:null,firstHeader:null,firstFooter:null};if(!e?.package)return a;let r=e.package.headers,t=e.package.footers,o=null,s=null,i=null,l=null;if(r&&n?.headerReferences){let f=n.headerReferences.find(c=>c.type==="default");f?.rId&&(o=r.get(f.rId)??null);let u=n.headerReferences.find(c=>c.type==="first");u?.rId&&(i=r.get(u.rId)??null);}if(t&&n?.footerReferences){let f=n.footerReferences.find(c=>c.type==="default");f?.rId&&(s=t.get(f.rId)??null);let u=n.footerReferences.find(c=>c.type==="first");u?.rId&&(l=t.get(u.rId)??null);}return n?.titlePg||(!o&&i&&(o=i),!s&&l&&(s=l)),{header:o,footer:s,firstHeader:i,firstFooter:l}}export{Qe as A,Ze as B,et as C,tt as D,nt as E,ot as F,rt as G,it as H,Q as a,D as b,Ee as c,fe as d,Ce as e,de as f,De as g,Ae as h,_e as i,Oe as j,te as k,ge as l,Ne as m,pe as n,Ye as o,ze as p,Ge as q,We as r,Ue as s,Te as t,Fe as u,Pe as v,$e as w,Me as x,Je as y,Ke as z};
@@ -1 +0,0 @@
1
- var M=".layout-page-content";function L(s){return Array.from(s.querySelectorAll(`${M} span[data-pm-start][data-pm-end]`))}function B(s){return Array.from(s.querySelectorAll(`${M} .layout-empty-run`))}function I(s){return Array.from(s.querySelectorAll(`${M} [data-pm-start]`))}function q(s,e){return Number.isFinite(e)?s.querySelector(`${M} [data-pm-start="${e}"]`):null}function _(s,e,r,p=1){let g=document.elementsFromPoint(e,r),d=g.find(t=>t.classList.contains("layout-page"));if(!d)return null;let a=g.find(t=>t.tagName==="SPAN"&&t.dataset.pmStart!==void 0&&t.dataset.pmEnd!==void 0);if(a)return S(a,e);let l=g.find(t=>t.classList.contains("layout-empty-run"));if(l){let t=l.closest(".layout-paragraph");if(t&&t.dataset.pmStart)return Number(t.dataset.pmStart)}let i=g.find(t=>t.classList.contains("layout-paragraph")&&t.dataset.pmStart!==void 0);if(i&&i.dataset.pmStart){let t=N(i,e,r);return t!==null?t:Number(i.dataset.pmStart)}let u=g.find(t=>t.classList.contains("layout-table-cell"));return u?N(u,e,r):C(s,d,e,r)}function S(s,e,r){let p=Number(s.dataset.pmStart),g=Number(s.dataset.pmEnd);if(s.classList.contains("layout-run-tab")){let n=s.getBoundingClientRect(),c=(n.left+n.right)/2;return e<c?p:g}let d=s.firstChild;if(!d||d.nodeType!==Node.TEXT_NODE)return p;let a=d,l=a.length;if(l===0)return p;let i=s.ownerDocument;if(!i)return p;let u=0,t=l;for(;u<t;){let n=Math.floor((u+t)/2),c=i.createRange();c.setStart(a,n),c.setEnd(a,n);let m=c.getBoundingClientRect().left;e<m?t=n:u=n+1;}if(u>0&&u<=l){let n=i.createRange();n.setStart(a,u-1),n.setEnd(a,u-1);let c=n.getBoundingClientRect();n.setStart(a,Math.min(u,l)),n.setEnd(a,Math.min(u,l));let o=n.getBoundingClientRect(),m=Math.abs(e-c.left),f=Math.abs(e-o.left);if(m<f)return p+(u-1)}return p+Math.min(u,g-p)}function N(s,e,r){let p=s.querySelector(".layout-empty-run");if(p){let n=p.closest(".layout-paragraph");if(n&&n.dataset.pmStart)return Number(n.dataset.pmStart)}let g=s.querySelectorAll(".layout-line"),d=null,a=1/0;for(let n of Array.from(g)){let c=n,o=c.getBoundingClientRect(),m=(o.top+o.bottom)/2,f=Math.abs(r-m);f<a&&(a=f,d=c);}if(!d){let n=s.querySelector(".layout-paragraph[data-pm-start]");return n?.dataset.pmStart?Number(n.dataset.pmStart):s.dataset.pmStart?Number(s.dataset.pmStart):null}let l=d.querySelectorAll("span[data-pm-start][data-pm-end]");if(l.length===0){let n=d.closest(".layout-paragraph");return n?.dataset.pmStart?Number(n.dataset.pmStart):null}let i=null,u=1/0;for(let n of Array.from(l)){let c=n,o=c.getBoundingClientRect();if(e>=o.left&&e<=o.right)return S(c,e);let m=e<o.left?o.left-e:e-o.right;m<u&&(u=m,i=c);}if(!i)return null;let t=i.getBoundingClientRect();return e<t.left?Number(i.dataset.pmStart):Number(i.dataset.pmEnd)}function C(s,e,r,p,g){if(e.querySelectorAll("span[data-pm-start][data-pm-end]").length===0){let o=e.querySelectorAll(".layout-paragraph");if(o.length>0){let m=o[0];return Number(m.dataset.pmStart)||0}return null}let a=e.querySelectorAll(".layout-line"),l=null,i=1/0;for(let o of Array.from(a)){let m=o,f=m.getBoundingClientRect(),h=(f.top+f.bottom)/2,b=Math.abs(p-h);b<i&&(i=b,l=m);}if(!l)return null;let u=l.querySelectorAll("span[data-pm-start][data-pm-end]");if(u.length===0){let o=l.closest(".layout-paragraph");return o?.dataset.pmStart?Number(o.dataset.pmStart):null}let t=null,n=1/0;for(let o of Array.from(u)){let m=o,f=m.getBoundingClientRect();if(r>=f.left&&r<=f.right)return S(m,r);let h=r<f.left?f.left-r:r-f.right;h<n&&(n=h,t=m);}if(!t)return null;let c=t.getBoundingClientRect();return r<c.left?Number(t.dataset.pmStart):Number(t.dataset.pmEnd)}var A=.5;function D(s,e){let r=s.closest(".layout-table:not(.layout-nested-table)");if(!r)return {left:e.left,top:e.top,right:e.right,bottom:e.bottom};let p=r.getBoundingClientRect(),g=Math.max(e.top,p.top),d=Math.min(e.bottom,p.bottom);return d-g<=A?null:{left:e.left,top:g,right:e.right,bottom:d}}function O(s,e,r,p){let g=[],d=L(s);for(let a of Array.from(d)){let l=a,i=Number(l.dataset.pmStart);if(Number(l.dataset.pmEnd)<=e||i>=r)continue;let t=l.firstChild;if(!t||t.nodeType!==Node.TEXT_NODE)continue;let n=t,c=l.ownerDocument;if(!c)continue;let o=Math.max(0,e-i),m=Math.min(n.length,r-i);if(o>=m)continue;let f=c.createRange();f.setStart(n,o),f.setEnd(n,m);let h=f.getClientRects(),b=l.closest(".layout-page"),T=b?Number(b.dataset.pageNumber||1)-1:0;for(let y of Array.from(h)){let E=D(l,y);E&&g.push({x:E.left-p.left,y:E.top-p.top,width:E.right-E.left,height:E.bottom-E.top,pageIndex:T});}}return g}function $(s,e,r){let p=L(s);for(let d of Array.from(p)){let a=d,l=Number(a.dataset.pmStart),i=Number(a.dataset.pmEnd);if(a.classList.contains("layout-run-tab")){if(e>=l&&e<i){let u=a.getBoundingClientRect(),t=a.closest(".layout-page"),n=t?Number(t.dataset.pageNumber||1)-1:0,c=a.closest(".layout-line"),o=c?c.offsetHeight:16;return {x:u.left-r.left,y:u.top-r.top,height:o,pageIndex:n}}continue}if(e>=l&&e<=i){let u=a.firstChild;if(!u||u.nodeType!==Node.TEXT_NODE){let y=a.getBoundingClientRect(),E=a.closest(".layout-page"),x=E?Number(E.dataset.pageNumber||1)-1:0,H=a.closest(".layout-line"),R=H?H.offsetHeight:16;return {x:y.left-r.left,y:y.top-r.top,height:R,pageIndex:x}}let t=u,n=Math.min(e-l,t.length),c=a.ownerDocument;if(!c)continue;let o=c.createRange();o.setStart(t,n),o.setEnd(t,n);let m=o.getBoundingClientRect(),f=a.closest(".layout-page"),h=f?Number(f.dataset.pageNumber||1)-1:0,b=a.closest(".layout-line"),T=b?b.offsetHeight:16;return {x:m.left-r.left,y:m.top-r.top,height:T,pageIndex:h}}}let g=s.querySelectorAll(".layout-paragraph");for(let d of Array.from(g)){let a=d,l=Number(a.dataset.pmStart),i=Number(a.dataset.pmEnd);if(e>=l&&e<=i){let t=a.querySelector(".layout-empty-run")||a,n=t.getBoundingClientRect(),c=a.closest(".layout-page"),o=c?Number(c.dataset.pageNumber||1)-1:0,f=(t.closest(".layout-line")||t).offsetHeight||16;return {x:n.left-r.left,y:n.top-r.top,height:f,pageIndex:o}}}return null}export{L as a,B as b,I as c,q as d,_ as e,D as f,O as g,$ as h};
@@ -1 +0,0 @@
1
- 'use strict';var chunkIMKU4O3P_js=require('./chunk-IMKU4O3P.js'),chunkDROCYKAR_js=require('./chunk-DROCYKAR.js'),chunkFIGLFSNR_js=require('./chunk-FIGLFSNR.js'),chunkJFZIXFRC_js=require('./chunk-JFZIXFRC.js'),chunkN3Y5BUKV_js=require('./chunk-N3Y5BUKV.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js');function q(e,t,n,r){let o=e-t-n,i=(r.count-1)*r.gap;return (o-i)/r.count}function ce(e){let t={...e.pageSize},n={...e.margins},r=e.columns??{count:1,gap:0},o=false,i,s,a=[],l=[];function c(){return t.h-n.bottom}function u(){return c()-n.top}function f(){return t.w-n.left-n.right}if(u()<=0)throw new Error("Paginator: page size and margins yield no content area");let b=q(t.w,n.left,n.right,r),S=n.top;function y(d){return n.left+d*(b+r.gap)}function T(){(i||s)&&(i&&(t=i),s&&(n=s),i=void 0,s=void 0,b=q(t.w,n.left,n.right,r));let d=a.length+1,F=n.top,v=c(),m=e.footnoteReservedHeights?.get(d)??0,p=v-m,x={number:d,fragments:[],margins:{...n},size:{...t},footnoteReservedHeight:m>0?m:void 0,columns:r.count>1?{...r}:void 0},h={page:x,cursorY:F,columnIndex:0,topMargin:F,contentBottom:p,trailingSpacing:0};return a.push(x),l.push(h),S=F,e.onNewPage&&e.onNewPage(h),h}function P(){return l.length===0?T():l[l.length-1]}function M(d){return d.contentBottom-d.cursorY}function I(d,F){let v=F||P();return M(v)>=d}function B(d){return d.columnIndex<r.count-1?(d.columnIndex+=1,d.cursorY=S,d.trailingSpacing=0,d):T()}function C(d){let F=P(),v=Number.isFinite(d)&&d>0?d:0;for(;!I(v,F);){let m=F.contentBottom-F.topMargin;if(v>m)return o||(o=true,console.warn(`Paginator: fragment height ${v.toFixed(0)}px exceeds page content height ${m.toFixed(0)}px; placing with overflow.`)),F.cursorY!==F.topMargin&&(F=B(F)),F;F=B(F);}return F}function R(d,F,v=0,m=0){let p=Math.max(v,P().trailingSpacing),x=p+F,h=C(x),w=p,N=y(h.columnIndex),k=h.cursorY+w;return d.x=N,d.y=k,h.page.fragments.push(d),h.cursorY=k+F,h.trailingSpacing=m,{state:h,x:N,y:k}}function g(){if(l.length>0){let d=l[l.length-1];if(d.page.fragments.length===0&&d.cursorY===d.topMargin)return d}return T()}function L(){let d=P();return B(d)}function H(d){r=d,b=q(t.w,n.left,n.right,r);let F=P();F.page.columns=r.count>1?{...r}:void 0,S=F.cursorY,F.columnIndex=0;}function W(d,F,v=true){if(!v){i=d?{...d}:i,s=F?{...F}:s;return}if(d&&(t={...d}),F&&(n={...F}),u()<=0)throw new Error("Paginator: section page size and margins yield no content area");b=q(t.w,n.left,n.right,r),i=void 0,s=void 0;}return {pages:a,states:l,get columnWidth(){return b},get columns(){return {...r}},getCurrentState:P,getAvailableHeight:()=>M(P()),getContentWidth:f,fits:d=>I(d),ensureFits:C,addFragment:R,forcePageBreak:g,forceColumnBreak:L,getColumnX:y,updateColumns:H,updatePageLayout:W}}function fe(e){let t=new Map,n=new Set;for(let r=0;r<e.length;r++){if(n.has(r))continue;let o=e[r];if(o.kind!=="paragraph"||!o.attrs?.keepNext)continue;let s=[r],a=r;for(let u=r+1;u<e.length;u++){let f=e[u];if(f.kind==="sectionBreak"||f.kind==="pageBreak"||f.kind==="columnBreak"||f.kind!=="paragraph")break;if(f.attrs?.keepNext)s.push(u),a=u,n.add(u);else break}let l=a+1,c=-1;if(l<e.length){let u=e[l];u.kind!=="sectionBreak"&&u.kind!=="pageBreak"&&u.kind!=="columnBreak"&&(c=l);}t.set(r,{startIndex:r,endIndex:a,memberIndices:s,anchorIndex:c});}return t}function ge(e,t,n){let r=0;for(let o of e.memberIndices){let i=t[o],s=n[o];if(i.kind!=="paragraph"||s.kind!=="paragraph")continue;let a=i,l=s,c=a.attrs?.spacing?.before??0;r+=c,r+=l.totalHeight;let u=a.attrs?.spacing?.after??0;r+=u;}if(e.anchorIndex!==-1){let o=n[e.anchorIndex];if(o?.kind==="paragraph"){let i=o;i.lines.length>0&&(r+=i.lines[0].lineHeight);}}return r}function me(e){let t=new Set;for(let n of e.values())for(let r=1;r<n.memberIndices.length;r++)t.add(n.memberIndices[r]);return t}function nt(e){return e.kind!=="paragraph"?false:e.attrs?.keepLines===true}function pe(e){return e.kind!=="paragraph"?false:e.attrs?.pageBreakBefore===true}function K(e){return e.displayMode==="float"||chunkJFZIXFRC_js.a(e.wrapType)||e.wrapType==="topAndBottom"}function rt(e){return K(e)&&e.wrapType==="topAndBottom"}function ot(e){return K(e)&&!chunkJFZIXFRC_js.b(e.wrapType)&&e.wrapType!=="topAndBottom"}function jt(e,t,n){if(!(!e||e<=0)){if(t==="pct")return n*e/5e3;if(!t||t==="dxa"||t==="auto")return chunk4Q2IP5FW_js.c(e)}}function Be(e){let t=new Map,n=[];for(let r=0;r<e.rows.length;r++){let o=e.rows[r]?.cells??[],i=t.get(r)??new Set,s=0;for(;i.has(s);)s++;for(let a=0;a<o.length;a++){let l=o[a];if(!l)continue;let c=l.colSpan??1,u=l.rowSpan??1;if(n.push({rowIndex:r,cellIndex:a,columnIndex:s,colSpan:c,rowSpan:u}),u>1)for(let f=r+1;f<r+u;f++){t.has(f)||t.set(f,new Set);let b=t.get(f);for(let S=0;S<c;S++)b.add(s+S);}for(s+=c;i.has(s);)s++;}}return n}function Vt(e){return Math.max(1,...e.rows.map(t=>t.cells.reduce((n,r)=>n+Math.max(1,r.colSpan??1),0)))}function $t(e,t,n){if(t<=0)return [];let r=n>0?n/t:0;if(e.length===0)return Array(t).fill(r);let o=e.slice(0,t),i=t-o.length;if(i>0){let u=o.filter(b=>b>0),f=u.length>0?u.reduce((b,S)=>b+S,0)/u.length:r;o=o.concat(Array(i).fill(f));}let s=o.reduce((u,f)=>u+(f>0?f:0),0),a=o.filter(u=>u<=0).length;if(s<=0)return Array(t).fill(r);if(a===0)return o;let l=Math.max(0,n-s),c=l>0?l/a:s/Math.max(1,t-a);return o.map(u=>u>0?u:c)}function Ce(e,t,n){let r=[],o=[],i=n,s=0,a=t?.length??0;for(let l=0;l<a;l++){let c=t[l],u=e?.[l];if(u?.kind==="paragraph"&&c?.kind==="paragraph"){let f=u.attrs?.spacing;i+=Math.max(s,f?.before??0);let b=[];for(let S of c.lines)i+=S.floatSkipBefore??0,b.push(i),i+=S.lineHeight,o.push(i);r.push(b),s=f?.after??0;}else c&&"totalHeight"in c&&typeof c.totalHeight=="number"?(i+=s+c.totalHeight,r.push([]),o.push(i),s=0):r.push([]);}return {lineTops:r,flatBottoms:o,contentHeight:i-n+s}}function Re(e,t){let n=t.rows.length,r=[],o=0;for(let a=0;a<n;a++)r.push(o),o+=t.rows[a]?.height??0;r.push(o);let i=Be(e),s=[];for(let a=0;a<n;a++){let l=t.rows[a]?.height??0,c=new Set;c.add(l);for(let u of i){if(u.rowIndex>a||u.rowIndex+u.rowSpan-1<a)continue;let f=e.rows[u.rowIndex]?.cells?.[u.cellIndex],b=t.rows[u.rowIndex]?.cells?.[u.cellIndex];if(!f||!b)continue;let S=f.padding?.top??0,{flatBottoms:y}=Ce(f.blocks,b.blocks,S),T=r[a]-r[u.rowIndex];for(let P of y){let M=P-T;M>0&&M<l&&c.add(M);}}s.push([...c].sort((u,f)=>u-f));}return {rowTops:r,breakOffsets:s}}function Le(e,t,n,r){let o=e.breakOffsets[t];if(!o||o.length===0)return 0;let i=n+r,s=0;for(let a of o)if(!(a<=n))if(a<=i)s=a-n;else break;return s}var it=1440,de=96,Ie=it/de,ve=11,Ee="Calibri",at=1,st=.8,lt=.2,j=null;function he(){if(!j){let e=typeof document<"u"?document.createElement("canvas"):null;if(!e)throw new Error("Canvas not available. Ensure this runs in a DOM environment.");if(j=e.getContext("2d"),!j)throw new Error("Failed to get 2D context from canvas")}return j}function rn(){j=null;}var ke=new Map;function We(e){let t=ke.get(e);if(t===void 0){let n=chunkN3Y5BUKV_js.a(e);t={cssFallback:n.cssFallback,singleLineRatio:n.singleLineRatio},ke.set(e,t);}return t}function ut(e){return We(e).cssFallback}function be(e){let t=[];e.italic&&t.push("italic"),e.bold&&t.push("bold");let n=e.fontSize??ve,r=Y(n);t.push(`${r}px`);let o=e.fontFamily??Ee;return t.push(ut(o)),t.join(" ")}function V(e){let t=e.fontSize??ve,n=e.fontFamily??Ee,r=Y(t),o=r*st,i=r*lt,s=r*at;try{let l=he();l.font=be(e);let c=l.measureText("Hg");typeof c.actualBoundingBoxAscent=="number"&&typeof c.actualBoundingBoxDescent=="number"&&(o=c.actualBoundingBoxAscent,i=c.actualBoundingBoxDescent);}catch{}s=Math.max(s,o+i);let a=We(n).singleLineRatio;return {fontSize:t,ascent:o,descent:i,lineHeight:s,fontFamily:n,singleLineRatio:a}}function _(e,t){if(!e)return 0;let n=he();n.font=be(t);let o=n.measureText(e).width;return t.letterSpacing&&e.length>1&&(o+=t.letterSpacing*(e.length-1)),o}function on(e,t){let n=_(e,t),r=V(t);return {width:n,height:r.ascent+r.descent,ascent:r.ascent,descent:r.descent}}function He(e,t){let n=V(t);if(!e)return {width:0,charWidths:[],metrics:n};let r=he();r.font=be(t);let o=t.letterSpacing??0,i=[],s=0;for(let a=0;a<e.length;a++){let l=e[a],u=r.measureText(l).width;o&&a<e.length-1&&(u+=o),i.push(u),s+=u;}return {width:s,charWidths:i,metrics:n}}function an(e,t){if(t.length===0||e<=0)return 0;let n=0;for(let r=0;r<t.length;r++){let o=t[r],i=n+o/2;if(e<=i)return r;n+=o;}return t.length}function sn(e,t){if(e<=0||t.length===0)return 0;let n=Math.min(e,t.length),r=0;for(let o=0;o<n;o++)r+=t[o];return r}function ln(e){return e/Ie}function un(e){return Math.round(e*Ie)}function Y(e){return e*de/72}function ct(e){return e*72/de}function cn(e){return Y(e/2)}function fn(e){return ct(e)*2}function xe(e){return e/1440*96}function Se(e){return e/96*1440}function ft(e){let{explicitStops:t=[],defaultTabInterval:n=720,leftIndent:r=0}=e,o=t.filter(f=>f.val!=="clear").filter(f=>f.pos>=r),i=t.filter(f=>f.val==="clear").map(f=>f.pos),s=o.reduce((f,b)=>Math.max(f,b.pos),0),a=[...o];r>0&&!o.some(f=>f.pos<=r)&&(i.some(b=>Math.abs(b-r)<20)||a.push({val:"start",pos:r,leader:"none"}));let c=s>0?Math.max(s,r):r,u=r+14400;for(;c<u;){c+=n;let f=o.some(y=>Math.abs(y.pos-c)<20),b=i.some(y=>Math.abs(y-c)<20),S=r>0&&Math.abs(c-r)<20;!f&&!b&&!S&&a.push({val:"start",pos:c,leader:"none"});}return a.sort((f,b)=>f.pos-b.pos)}function Ae(e,t,n={}){let{defaultTabInterval:r=720}=t,o=Se(e),s=ft(t).find(c=>c.pos>o);if(!s){let c=xe(r),u=c-e%c;return u<=0&&(u=c),{width:u,alignment:"default"}}let l=xe(s.pos)-e;if(s.val==="center")l-=(n.followingWidth??0)/2;else if(s.val==="end")l-=n.followingWidth??0;else if(s.val==="decimal")l-=n.decimalPrefixWidth??0;else if(s.val==="bar")return {width:0,leader:s.leader,alignment:"bar"};if(l<1){let c=xe(r),u=c-e%c;return u<=0&&(u=c),{width:u,alignment:"default"}}return {width:l,leader:s.leader,alignment:s.val}}var gt="Calibri",mt=11;function pt(e){let t=e.attrs,n=e.runs?.find(i=>i.kind==="text"),r=t?.listMarkerFontFamily??n?.fontFamily??t?.defaultFontFamily??gt,o=t?.listMarkerFontSize??n?.fontSize??t?.defaultFontSize??mt;return {fontFamily:r,fontSize:o}}function Oe(e){let t=e.attrs;if(!t?.listMarker||t.listMarkerHidden)return 0;let n=t.indent,r=n?.hanging??0;if(r>0)return r;let{fontFamily:o,fontSize:i}=pt(e),s={fontFamily:o,fontSize:i},a=_(t.listMarker,s),l=t.listMarkerSuffix??"tab";if(l==="nothing")return a;if(l==="space")return a+_(" ",s);let c=n?.left??0,u=n?.firstLine??0,f=c+u,b=f+a,S=(t.tabs??[]).filter(M=>M.val!=="clear"&&M.val!=="bar").map(M=>chunkIMKU4O3P_js.a(M.pos)).filter(M=>M>=b).sort((M,I)=>M-I)[0],y=chunkIMKU4O3P_js.a(t.defaultTabStopTwips??chunkFIGLFSNR_js.a),T=y>0?(Math.floor(b/y)+1)*y:void 0,P;return S!==void 0&&T!==void 0?P=Math.min(S,T):P=S??T,P===void 0?a+Y(i)*.5:P-f}var D=11,X="Calibri",dt=1.15,te=1,Z=.5;function _e(e,t,n,r=false){let o=1,i=e.length,s=0;for(;o<=i;){let a=o+i>>>1;_(e.slice(0,a),t)<=n?(s=a,o=a+1):i=a-1;}return r&&s===0?1:s}function $(e){return {fontFamily:e.fontFamily??X,fontSize:e.fontSize??D,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function Ye(e,t,n){let r=Y(e),o=n?.ascent??r*.8,i=n?.descent??r*.2,s=n?.singleLineRatio??1.15,a=r*s,l;if(t?.lineRule==="exact"&&t.line!==void 0)l=t.line;else if(t?.lineRule==="atLeast"&&t.line!==void 0){let c=a*te;l=Math.max(t.line,c);}else t?.line!==void 0&&t?.lineUnit==="multiplier"?l=a*t.line:t?.line!==void 0&&t?.lineUnit==="px"?l=t.line:l=a*te;return {ascent:o,descent:i,lineHeight:l}}function ze(e,t,n){let r=V({fontSize:e,fontFamily:n??X}),o=Ye(e,t,r),i=t?.lineRule??"auto";if(i==="auto"||i==="atLeast"){let s=Y(e),a=Math.max(o.lineHeight,s*dt);if(a!==o.lineHeight)return {...o,lineHeight:a}}return o}function J(e){return e.kind==="text"}function De(e){return e.kind==="tab"}function Ze(e){return e.kind==="image"}function Ue(e){return e.kind==="lineBreak"}function Xe(e){return e.kind==="field"}function ht(e){return !e.text||e.text.replace(/\u00a0/g," ").trim().length===0}function bt(e,t){let n=0;for(let r=t+1;r<e.length;r++){let o=e[r];if(De(o)||Ue(o))break;if(J(o))n+=_(o.text||"",$(o));else if(Xe(o)){let i={fontFamily:o.fontFamily??X,fontSize:o.fontSize??D,bold:o.bold,italic:o.italic};n+=_(o.fallback||"1",i);}else Ze(o)&&(n+=o.width||0);}return n}function xt(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];(r===" "||r==="-"||r===" ")&&t.push(n+1);}return t}function Ge(e,t,n){let r=Math.max(1,n),o=Math.max(0,e),i=Math.max(0,t);return o>=r||i>=r||o+i>=r?{leftMargin:0,rightMargin:0}:{leftMargin:o,rightMargin:i}}function St(e,t,n){let r=e.runs,o=e.attrs,i=o?.spacing,s=n?.floatingZones,a=n?.paragraphYOffset??0,l=o?.indent,c=l?.left??0,u=l?.right??0,f=(l?.firstLine??0)-(l?.hanging??0),b=Math.max(1,t-c-u),S=(l?.hanging??0)===0?Oe(e):0,y=Math.max(1,b-f-S),T=0,P=0,M=Y(D)*te,I=(m,p)=>{if(!s||s.length===0)return;let x=a+T,h=Ne(x,m,s,p,U)-x;h>0&&(T+=h,P+=h);};I(M,y);let B=ee(T,M,s,a),C=Math.max(1,Q(B,y)),R=[];if(r.length===0){if(o?.suppressEmptyParagraphHeight)return R.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,ascent:0,descent:0,lineHeight:0}),{kind:"paragraph",lines:R,totalHeight:0};let m=o?.defaultFontSize??D,p=o?.defaultFontFamily??X,x=ze(m,i,p);R.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...x});let h=x.lineHeight;return i?.before&&(h+=i.before),i?.after&&(h+=i.after),{kind:"paragraph",lines:R,totalHeight:h}}if(r.length===1&&J(r[0])&&ht(r[0])){let m=r[0],p=m.fontSize??o?.defaultFontSize??D,x=m.fontFamily??o?.defaultFontFamily??X,h=ze(p,i,x);R.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...h});let w=h.lineHeight;return i?.before&&(w+=i.before),i?.after&&(w+=i.after),{kind:"paragraph",lines:R,totalHeight:w}}let g={fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,maxFontSize:D,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:C,leftOffset:B.leftMargin,rightOffset:B.rightMargin,segmentZones:B.segments},L=()=>{let m=Ye(g.maxFontSize,i,g.maxFontMetrics),p={...m};if(g.maxImageHeightPx>p.lineHeight){let h=g.maxImageHeightPx,w=p.descent;g.fromRun===g.toRun?(p.lineHeight=h+w*2,p.ascent=h+w):(p.lineHeight=h+w,p.ascent=h);}let x={fromRun:g.fromRun,fromChar:g.fromChar,toRun:g.toRun,toChar:g.toChar,width:g.width,...p};g.leftOffset>0&&(x.leftOffset=g.leftOffset),g.rightOffset>0&&(x.rightOffset=g.rightOffset),g.segmentZones?.length&&(x.segments=H(x,g.segmentZones)),P>0&&(x.floatSkipBefore=P,P=0),R.push(x),T+=m.lineHeight;},H=(m,p)=>{let x=p[0],h=p[1];if(!x)return;if(!h||m.width<=x.availableWidth+Z)return [{fromRun:m.fromRun,fromChar:m.fromChar,toRun:m.toRun,toChar:m.toChar,width:m.width,leftOffset:x.leftOffset,availableWidth:x.availableWidth}];if(m.fromRun!==m.toRun)return;let w=r[m.fromRun];if(!w||!J(w))return;let N=w,k=N.text.slice(m.fromChar,m.toChar),A=$(N),E=_e(k,A,x.availableWidth);if(E<=0||E>=k.length)return;let z=m.fromChar+E,O=k.slice(0,E),re=k.slice(E);return [{fromRun:m.fromRun,fromChar:m.fromChar,toRun:m.toRun,toChar:z,width:_(O,A),leftOffset:x.leftOffset,availableWidth:x.availableWidth},{fromRun:m.fromRun,fromChar:z,toRun:m.toRun,toChar:m.toChar,width:_(re,A),leftOffset:h.leftOffset,availableWidth:h.availableWidth}]},W=(m,p)=>{L();let x=Y(D)*te;I(x,b);let h=ee(T,x,s,a),w=Math.max(1,Q(h,b));g={fromRun:m,fromChar:p,toRun:m,toChar:p,width:0,maxFontSize:D,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:w,leftOffset:h.leftMargin,rightOffset:h.rightMargin,segmentZones:h.segments};},d=m=>{let p=m.fontSize??D;(!g.maxFontMetrics||p>g.maxFontSize)&&(g.maxFontSize=p,g.maxFontMetrics=V(m));};for(let m=0;m<r.length;m++){let p=r[m];if(Ue(p)){g.toRun=m,g.toChar=0,W(m+1,0);continue}if(De(p)){let x=$(p);d(x);let h=bt(r,m),w=g.width+(g.leftOffset??0),N=R.length===0,k=c+(N?f:0)+w,A={explicitStops:o?.tabs,leftIndent:Se(c)},E=Ae(k,A,{followingWidth:h}).width;if(w+E>g.availableWidth+Z){let z=g.availableWidth-w-h;z>1&&(E=z);}g.width+E>g.availableWidth+Z&&(W(m,0),d(x)),g.width+=E,g.toRun=m,g.toChar=1;continue}if(Ze(p)){let x=p.wrapType,h=p.displayMode==="float"||chunkJFZIXFRC_js.c(x);if(p.position&&h){g.toRun=m,g.toChar=1;continue}if(x==="topAndBottom"||p.displayMode==="block"){g.width>0&&W(m,0);let A=p.height,E=p.distTop??6,z=p.distBottom??6;g.toRun=m,g.toChar=1,g.maxImageHeightPx=A+E+z,W(m+1,0);continue}let w=p.width,k=p.height+(p.distTop??0)+(p.distBottom??0);k>g.maxImageHeightPx&&(g.maxImageHeightPx=k),g.width+w>g.availableWidth+Z&&W(m,0),g.width+=w,g.toRun=m,g.toChar=1;continue}if(Xe(p)){let x=p.fallback||"1",h={fontFamily:p.fontFamily??X,fontSize:p.fontSize??D,bold:p.bold,italic:p.italic};d(h);let w=_(x,h);g.width>0&&g.width+w>g.availableWidth+Z&&(W(m,0),d(h)),g.width+=w,g.toRun=m,g.toChar=1;continue}if(J(p)){let x=p,h=x.text,w=$(x);if(d(w),!h||h.length===0){g.toRun=m,g.toChar=0;continue}let N=xt(h),k=0;for(;k<h.length;){let A=h.length;for(let O of N)if(O>k){A=O;break}let E=h.slice(k,A),z=_(E,w);if(z>g.availableWidth+Z){let O=0;for(;O<E.length;){let re=g.availableWidth-g.width+Z,Qe=E.slice(O),oe=_e(Qe,w,re);if(oe===0){if(g.width>0){W(m,k+O),d(w);continue}oe=1;}let ie=O+oe,et=E.slice(O,ie),tt=_(et,w);g.width+=tt,g.toRun=m,g.toChar=k+ie,O=ie,O<E.length&&(W(m,k+O),d(w));}k=A;continue}g.width>0&&g.width+z>g.availableWidth+Z&&(W(m,k),d(w)),g.width+=z,g.toRun=m,g.toChar=A,k=A;}}}L();let v=R.reduce((m,p)=>m+p.lineHeight+(p.floatSkipBefore??0),0);return i?.before&&(v+=i.before),i?.after&&(v+=i.after),{kind:"paragraph",lines:R,totalHeight:v}}function Fn(e,t){return e.map(n=>St(n,t))}function wn(e){let t=$(e);return He(e.text,t).charWidths}function Rn(e,t){return e.map(n=>{let r=n.x-n.distLeft,o=n.x+n.width+n.distRight,i=n.y-n.distTop,s=n.y+n.height+n.distBottom;if(n.wrapType==="topAndBottom")return {leftMargin:0,rightMargin:0,topY:i,bottomY:s,fullWidthBlock:true};let a=0,l=0,c,u=n.wrapText??"bothSides";u==="right"?a=Te(o):u==="left"?l=Me(r,t):u==="largest"?{leftMargin:a,rightMargin:l}=Pt(r,o,t):Mt(r,o,t)?c=yt(r,o,t):n.side==="left"?a=Te(o):l=Me(r,t);let f=Ge(a,l,t);return {leftMargin:f.leftMargin,rightMargin:f.rightMargin,topY:i,bottomY:s,segments:c}})}function Q(e,t){return e.segments?.reduce((r,o)=>r+o.availableWidth,0)??t-e.leftMargin-e.rightMargin}function ee(e,t,n,r){if(!n||n.length===0)return {leftMargin:0,rightMargin:0};let o=0,i=0,s,a=r+e,l=a+t;for(let c of n)if(!(l<=c.topY||a>=c.bottomY)){if(c.fullWidthBlock)return {leftMargin:0,rightMargin:0,segments:[{leftOffset:0,availableWidth:0}]};if(c.segments?.length){s=s?Tt(s,c.segments):c.segments;continue}o=Math.max(o,c.leftMargin),i=Math.max(i,c.rightMargin);}return {leftMargin:o,rightMargin:i,segments:s}}function Ne(e,t,n,r,o){if(!n||n.length===0)return e;let i=e;for(let s=0;s<n.length+2;s++){let a=ee(i,t,n,0);if(Q(a,r)>=o)return i;let c=i+t,u=1/0;for(let f of n)c<=f.topY||i>=f.bottomY||f.bottomY>i&&f.bottomY<u&&(u=f.bottomY);if(!Number.isFinite(u)||u<=i)return i;i=u;}return i}function Tt(e,t){let n=[];for(let r of e)for(let o of t){let i=Math.max(r.leftOffset,o.leftOffset),s=Math.min(r.leftOffset+r.availableWidth,o.leftOffset+o.availableWidth);s>i&&n.push({leftOffset:i,availableWidth:s-i});}return n}var U=24;function Mt(e,t,n){return e>U&&t+U<n}function yt(e,t,n){return [{leftOffset:0,availableWidth:Math.max(0,e)},{leftOffset:Math.max(0,t),availableWidth:Math.max(0,n-t)}].filter(r=>r.availableWidth>1)}function Pt(e,t,n){let r=Math.max(0,e);return Math.max(0,n-t)>=r?{leftMargin:Te(t),rightMargin:0}:{leftMargin:0,rightMargin:Me(e,n)}}function Te(e){return Math.max(0,e)}function Me(e,t){return Math.max(0,t-e)}var Ke={count:1,gap:0};function Ft(e,t,n){return {activeTopMargin:e.top,activeBottomMargin:e.bottom,activeLeftMargin:e.left,activeRightMargin:e.right,pendingTopMargin:null,pendingBottomMargin:null,pendingLeftMargin:null,pendingRightMargin:null,activePageSize:{...t},pendingPageSize:null,activeColumns:n?{...n}:{...Ke},pendingColumns:null,activeOrientation:null,pendingOrientation:null,hasAnyPages:false}}function wt(e,t){return t.count>1}function ne(e){return e?{count:e.count,gap:e.gap}:{...Ke}}function Bt(e,t,n){let r={...t},o=e.type??"continuous",i=e.margins,s=e.pageSize,a=e.orientation;i&&(typeof i.top=="number"&&(r.pendingTopMargin=Math.max(0,i.top)),typeof i.bottom=="number"&&(r.pendingBottomMargin=Math.max(0,i.bottom)),typeof i.left=="number"&&(r.pendingLeftMargin=Math.max(0,i.left)),typeof i.right=="number"&&(r.pendingRightMargin=Math.max(0,i.right))),s&&(r.pendingPageSize={w:s.w,h:s.h}),a&&(r.pendingOrientation=a);let l=wt((e.margins,void 0),r.activeColumns);switch(o){case "nextPage":return r.pendingColumns=ne(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false},state:r};case "evenPage":return r.pendingColumns=ne(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false,requiredParity:"even"},state:r};case "oddPage":return r.pendingColumns=ne(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false,requiredParity:"odd"},state:r};default:return l?(r.pendingColumns=ne(void 0),{decision:{forcePageBreak:false,forceMidPageRegion:true},state:r}):{decision:{forcePageBreak:false,forceMidPageRegion:false},state:r}}}function Ct(e){let t={...e};return t.pendingTopMargin!==null&&(t.activeTopMargin=t.pendingTopMargin,t.pendingTopMargin=null),t.pendingBottomMargin!==null&&(t.activeBottomMargin=t.pendingBottomMargin,t.pendingBottomMargin=null),t.pendingLeftMargin!==null&&(t.activeLeftMargin=t.pendingLeftMargin,t.pendingLeftMargin=null),t.pendingRightMargin!==null&&(t.activeRightMargin=t.pendingRightMargin,t.pendingRightMargin=null),t.pendingPageSize!==null&&(t.activePageSize=t.pendingPageSize,t.pendingPageSize=null),t.pendingColumns!==null&&(t.activeColumns=t.pendingColumns,t.pendingColumns=null),t.pendingOrientation!==null&&(t.activeOrientation=t.pendingOrientation,t.pendingOrientation=null),t}function Rt(e){return {top:e.pendingTopMargin??e.activeTopMargin,bottom:e.pendingBottomMargin??e.activeBottomMargin,left:e.pendingLeftMargin??e.activeLeftMargin,right:e.pendingRightMargin??e.activeRightMargin}}function Lt(e){return e.pendingPageSize??e.activePageSize}function kt(e){return e.pendingColumns??e.activeColumns}function It(e,t){for(let n=0;n<e.pages.length;n++)for(let r of e.pages[n].fragments){if(r.pmStart==null)continue;let o=r.pmStart,i=r.pmEnd??o+1;if(t>=o&&t<i)return n}return null}var vt={w:816,h:1056},G={top:96,right:96,bottom:96,left:96},$e={count:1,gap:0};function Et(e,t,n){let r=[],o=[],i=t;for(let s=0;s<e.length;s++){if(e[s].kind!=="sectionBreak")continue;let a=e[s],l={pageSize:a.pageSize??i.pageSize,margins:a.margins??i.margins,columns:a.columns};r.push(l),o.push(s),i=l;}return r.push(n),{configs:r,breakIndices:o}}function qe(e){if(e.runs.length===0)return true;if(e.runs.length!==1)return false;let t=e.runs[0];return t.kind==="text"&&(t.text??"")===""}function je(e){let t=e.attrs?.spacing?.before??0;return qe(e)&&!e.attrs?.spacingExplicit?.before?0:t}function Ve(e){let t=e.attrs?.spacing?.after??0;return qe(e)&&!e.attrs?.spacingExplicit?.after?0:t}function Je(e){for(let t=0;t<e.length-1;t++){let n=e[t],r=e[t+1];if(n.kind!=="paragraph"||r.kind!=="paragraph")continue;let o=n.attrs,i=r.attrs;o?.contextualSpacing&&i?.contextualSpacing&&o.styleId&&o.styleId===i.styleId&&(o.spacing&&(o.spacing={...o.spacing,after:0}),i.spacing&&(i.spacing={...i.spacing,before:0}));}for(let t of e)if(t.kind==="table")for(let n of t.rows)for(let r of n.cells)Je(r.blocks);}function _n(e,t,n={}){if(e.length!==t.length)throw new Error(`layoutDocument: expected one measure per block (blocks=${e.length}, measures=${t.length})`);let r=n.pageSize??vt,o={top:n.margins?.top??G.top,right:n.margins?.right??G.right,bottom:n.margins?.bottom??G.bottom,left:n.margins?.left??G.left,header:n.margins?.header??n.margins?.top??G.top,footer:n.margins?.footer??n.margins?.bottom??G.bottom};n.headerContentHeights,n.footerContentHeights,n.titlePage,n.evenAndOddHeaders;let i={...o},s=n.finalPageSize??r,a=n.finalMargins??i;if(r.w-i.left-i.right<=0)throw new Error("layoutDocument: page size and margins yield no content area");let c={pageSize:r,margins:i,columns:n.columns},u={pageSize:s,margins:a,columns:n.columns},{configs:f,breakIndices:b}=Et(e,c,u),S=[...b.map(B=>e[B].type),n.bodyBreakType],y=f[0]??c,T=ce({pageSize:y.pageSize,margins:y.margins,columns:y.columns??$e,footnoteReservedHeights:n.footnoteReservedHeights});Je(e);let P=fe(e),M=me(P),I=0;for(let B=0;B<e.length;B++){let C=e[B],R=t[B];pe(C)&&T.forcePageBreak();let g=P.get(B);if(g&&!M.has(B)){let L=ge(g,e,t),H=T.getCurrentState(),W=T.getAvailableHeight(),d=H.contentBottom-H.topMargin;L<=d&&L>W&&H.page.fragments.length>0&&T.forcePageBreak();}switch(C.kind){case "paragraph":Wt(C,R,T,T.getContentWidth());break;case "table":C.floating?_t(C,R,T,T.getContentWidth()):Ot(C,R,T);break;case "image":zt(C,R,T);break;case "textBox":Yt(C,R,T);break;case "pageBreak":T.forcePageBreak();break;case "columnBreak":T.forceColumnBreak();break;case "sectionBreak":{let L=S[I+1]??S[I];Dt(C,T,f[I+1]??y,L),I++;break}default:chunkDROCYKAR_js.c(C,"runLayoutPipeline");}}return T.pages.length===0&&T.getCurrentState(),{pageSize:r,pages:T.pages,columns:n.columns,pageGap:n.pageGap}}function Wt(e,t,n,r){if(t.kind!=="paragraph")throw new Error("layoutParagraph: expected paragraph measure");let o=t.lines;if(o.length===0){let l=je(e),c=Ve(e),u=n.getCurrentState(),f={kind:"paragraph",blockId:e.id,x:n.getColumnX(u.columnIndex),y:u.cursorY+l,width:r,height:0,fromLine:0,toLine:0,pmStart:e.pmStart,pmEnd:e.pmEnd};n.addFragment(f,0,l,c);return}let i=je(e),s=Ve(e),a=0;for(;a<o.length;){let l=n.getCurrentState(),c=n.getAvailableHeight(),u=0,f=0;for(let I=a;I<o.length;I++){let B=o[I].lineHeight+(o[I].floatSkipBefore??0),C=u+B;if((a===0&&I===a?C+i:C)<=c||f===0)u=C,f++;else break}let b=a===0,S=a+f>=o.length,y=b?i:0,T=S?s:0,P={kind:"paragraph",blockId:e.id,x:n.getColumnX(l.columnIndex),y:0,width:r,height:u,fromLine:a,toLine:a+f,pmStart:e.pmStart,pmEnd:e.pmEnd,continuesFromPrev:!b,continuesOnNext:!S},M=n.addFragment(P,u,y,T);P.y=M.y,a+=f,a<o.length&&n.ensureFits(o[a].lineHeight);}}function Ht(e){let t=0;for(let n of e.rows)if(n.isHeader)t++;else break;return t}function At(e,t){let n=0;for(let r=0;r<t&&r<e.rows.length;r++)n+=e.rows[r].height;return n}function Ot(e,t,n){if(t.kind!=="table")throw new Error("layoutTable: expected table measure");let r=t.rows;if(r.length===0)return;let o=Ht(e),i=At(t,o),s=Re(e,t),a=0,l=0;for(;a<r.length;){let c=n.getCurrentState(),u=a===0&&l===0,f=u?c.trailingSpacing:0,b=!u&&o>0?i:0,S=n.getAvailableHeight()-f-b,y=a,T=l,P=0,M=a,I=l,B=a,C,R=false;for(;M<r.length;){let F=r[M].height,v=M===y?I:0,m=F-v;if(P+m<=S){P+=m,M+=1,B=M;continue}let p=S-P,x=e.rows[M]?.cantSplit?0:Le(s,M,v,p);x>0?(P+=x,B=M+1,C=v+x,R=true):B>y||(P+=m,B=M+1);break}let g=b+P,L=B===r.length&&!R,H=n.getColumnX(c.columnIndex);e.justification==="center"?H=H+(n.columnWidth-t.totalWidth)/2:e.justification==="right"?H=H+n.columnWidth-t.totalWidth:e.indent&&(H+=e.indent);let W={kind:"table",blockId:e.id,x:H,y:0,width:t.totalWidth,height:g,fromRow:y,toRow:B,pmStart:e.pmStart,pmEnd:e.pmEnd,continuesFromPrev:!u,continuesOnNext:!L,headerRowCount:!u&&o>0?o:void 0,topClip:T>0?T:void 0,bottomClip:C},d=n.addFragment(W,g,0,0);if(W.y=d.y,W.x=H,R?(a=B-1,l=C??0):(a=B,l=0),a<r.length){let F=(o>0?i:0)+(r[a].height-l);n.ensureFits(F);}}}function _t(e,t,n,r){if(t.kind!=="table")throw new Error("layoutFloatingTable: expected table measure");let o=n.getCurrentState(),i=e.floating,s=o.page,a=s.margins,l=t.totalWidth,c=t.totalHeight,u=s.size.h-a.top-a.bottom,f=a.left,b=a.top;i?.horzAnchor==="page"&&(f=0),i?.vertAnchor==="page"&&(b=0),i?.vertAnchor==="text"&&(b=o.cursorY);let S=n.getColumnX(o.columnIndex);if(i?.tblpX!==void 0)S=f+i.tblpX;else if(i?.tblpXSpec){let L=i.tblpXSpec;L==="left"||L==="inside"?S=f:L==="right"||L==="outside"?S=f+r-l:L==="center"&&(S=f+(r-l)/2);}else e.justification==="center"?S=f+(r-l)/2:e.justification==="right"&&(S=f+r-l);let y=o.cursorY,T=false;if(i?.tblpY!==void 0)y=b+i.tblpY,T=true;else if(i?.tblpYSpec){T=true;let L=i.tblpYSpec;L==="top"?y=b:L==="bottom"?y=b+u-c:L==="center"&&(y=b+(u-c)/2);}T||(y=n.ensureFits(c).cursorY);let P=a.left,M=a.left+r-l;Number.isFinite(M)&&(S=Math.max(P,Math.min(S,M)));let I={kind:"table",blockId:e.id,x:S,y,width:l,height:c,fromRow:0,toRow:e.rows.length,pmStart:e.pmStart,pmEnd:e.pmEnd,isFloating:true};o.page.fragments.push(I);let B=i?.leftFromText??0,C=i?.rightFromText??0,R=S-a.left-B,g=a.left+r-(S+l)-C;if(R<U&&g<U){let L=y+c+(i?.bottomFromText??0);L>o.cursorY&&(o.cursorY=L);}}function zt(e,t,n){if(t.kind!=="image")throw new Error("layoutImage: expected image measure");if(e.anchor?.isAnchored){Nt(e,t,n);return}let r=n.ensureFits(t.height),o={kind:"image",blockId:e.id,x:n.getColumnX(r.columnIndex),y:0,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd},i=n.addFragment(o,t.height,0,0);o.y=i.y;}function Nt(e,t,n){let r=n.getCurrentState(),o=e.anchor,i=o.offsetH??n.getColumnX(r.columnIndex),s=o.offsetV??r.cursorY,a={kind:"image",blockId:e.id,x:i,y:s,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd,isAnchored:true,zIndex:o.behindDoc?-1:1};r.page.fragments.push(a);}function Yt(e,t,n){if(t.kind!=="textBox")throw new Error("layoutTextBox: expected textBox measure");if(K(e)){let s=n.getCurrentState(),a={kind:"textBox",blockId:e.id,x:n.getColumnX(s.columnIndex),y:s.cursorY,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd,isFloating:true,zIndex:e.wrapType==="behind"?-1:1};s.page.fragments.push(a);return}let r=n.ensureFits(t.height),o={kind:"textBox",blockId:e.id,x:n.getColumnX(r.columnIndex),y:0,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd},i=n.addFragment(o,t.height,0,0);o.y=i.y;}function Dt(e,t,n,r){switch(r??"nextPage"){case "nextPage":t.updatePageLayout(n.pageSize,n.margins),t.forcePageBreak();break;case "evenPage":{t.updatePageLayout(n.pageSize,n.margins),t.forcePageBreak().page.number%2!==0&&t.forcePageBreak();break}case "oddPage":{t.updatePageLayout(n.pageSize,n.margins),t.forcePageBreak().page.number%2===0&&t.forcePageBreak();break}case "continuous":t.updatePageLayout(n.pageSize,n.margins,false);break}t.updateColumns(n.columns??$e);}exports.A=Fn;exports.B=wn;exports.C=ce;exports.D=fe;exports.E=ge;exports.F=me;exports.G=nt;exports.H=pe;exports.I=K;exports.J=rt;exports.K=ot;exports.L=Ce;exports.M=Ft;exports.N=Bt;exports.O=Ct;exports.P=Rt;exports.Q=Lt;exports.R=kt;exports.S=It;exports.T=Et;exports.U=_n;exports.V=At;exports.a=jt;exports.b=Be;exports.c=Vt;exports.d=$t;exports.e=he;exports.f=rn;exports.g=be;exports.h=V;exports.i=_;exports.j=on;exports.k=He;exports.l=an;exports.m=sn;exports.n=ln;exports.o=un;exports.p=Y;exports.q=ct;exports.r=cn;exports.s=fn;exports.t=Rn;exports.u=ee;exports.v=Ae;exports.w=pt;exports.x=Oe;exports.y=Ge;exports.z=St;
@@ -1 +0,0 @@
1
- 'use strict';var chunkFQS436KN_js=require('./chunk-FQS436KN.js'),chunkTURYWKNS_js=require('./chunk-TURYWKNS.js'),chunkT4RYVPAB_js=require('./chunk-T4RYVPAB.js'),chunkDROCYKAR_js=require('./chunk-DROCYKAR.js'),chunkLERLET2D_js=require('./chunk-LERLET2D.js'),chunkBUCOTKYY_js=require('./chunk-BUCOTKYY.js'),chunkBHBOAP6Z_js=require('./chunk-BHBOAP6Z.js'),chunkN3Y5BUKV_js=require('./chunk-N3Y5BUKV.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js');function Je(e,t,n,o,r){let a=new Map,i=[];for(let m of e.fragments){let s=o(m);if(s.length===0||!("height"in m))continue;let b=m.y-e.margins.top,g=b+m.height;s.forEach((u,E)=>{let y=`${E}:${u.id}`,f=a.get(y);f?(f.top=Math.min(f.top,b),f.bottom=Math.max(f.bottom,g)):(a.set(y,{group:u,depth:E,top:b,bottom:g}),i.push(y));});}let d=2,l=[];for(let m of i){let{group:s,depth:b,top:g,bottom:u}=a.get(m),E=b*(d+1),y=r.createElement("div");y.className="layout-block-sdt-box",y.dataset.sdtGroupId=s.id,y.dataset.sdtType=s.sdtType,y.dataset.sdtDepth=String(b+1),s.tag!=null&&(y.dataset.sdtTag=s.tag),s.alias!=null&&(y.dataset.sdtAlias=s.alias),s.lock!=null&&(y.dataset.sdtLock=s.lock),y.style.position="absolute",y.style.left=`${E}px`,y.style.top=`${g-d}px`,y.style.width=`${n-E*2}px`,y.style.height=`${u-g+d*2}px`;let f=s.alias||s.tag||s.sdtType;if(f){let F=r.createElement("span");F.className="layout-block-sdt-label",F.textContent=f,y.appendChild(F);}let w=wt(s.sdtType);if(w&&s.tag!=null&&!s.bound&&s.lock!=="contentLocked"&&s.lock!=="sdtContentLocked"){let F=r.createElement("button");F.type="button",F.className="layout-sdt-widget",F.dataset.sdtWidget=w,F.dataset.sdtTag=s.tag,F.dataset.sdtGroupId=s.id,F.setAttribute("aria-label",`${w} control ${s.alias||s.tag}`),w==="dropdown"?F.setAttribute("aria-haspopup","listbox"):w==="date"&&F.setAttribute("aria-haspopup","dialog"),F.textContent=w==="dropdown"?"\u25BE":w==="date"?"\u{1F4C5}":s.checked?"\u2612":"\u2610",y.appendChild(F);}if(s.repeatingItem&&!s.bound){let F=r.createElement("div");F.className="layout-sdt-repeat-controls";for(let c of ["add","remove"]){let x=r.createElement("button");x.type="button",x.className="layout-sdt-repeat-btn",x.dataset.sdtRepeat=c,x.dataset.sdtGroupId=s.id,x.setAttribute("aria-label",c==="add"?"Add item":"Remove item"),x.textContent=c==="add"?"\uFF0B":"\u2715",F.appendChild(x);}y.appendChild(F);}t.appendChild(y),l.push(y);}Tt(t,l);}function wt(e){return e==="checkbox"?"checkbox":e==="dropDownList"||e==="comboBox"?"dropdown":e==="date"?"date":null}function Tt(e,t){if(t.length===0||typeof e.addEventListener!="function")return;let n=(d,l)=>{for(let m of t){let s=m.getBoundingClientRect(),b=d>=s.left&&d<=s.right&&l>=s.top&&l<=s.bottom;b!==m.classList.contains("is-active")&&m.classList.toggle("is-active",b);}},o=typeof requestAnimationFrame=="function"?requestAnimationFrame:d=>d(),r=false,a=0,i=0;e.addEventListener("mousemove",d=>{a=d.clientX,i=d.clientY,!r&&(r=true,o(()=>{r=false,n(a,i);}));}),e.addEventListener("mouseleave",()=>{for(let d of t)d.classList.remove("is-active");});}function yn(e,t,n){let o=new Set,r=e.content.size,a=i=>{let d=e.resolve(Math.max(0,Math.min(i,r)));for(let l=1;l<=d.depth;l++)d.node(l).type.name==="blockSdt"&&o.add(`sdt@${d.before(l)}`);};return a(t),n!==t&&a(n),o}function bn(e,t){let n=e.querySelectorAll(".layout-block-sdt-box");for(let o of n){let r=o.dataset.sdtGroupId,a=r!=null&&t.has(r);a!==o.classList.contains("is-focused")&&o.classList.toggle("is-focused",a);}}var U={fragment:"layout-fragment",paragraph:"layout-fragment-paragraph",table:"layout-fragment-table",image:"layout-fragment-image",line:"layout-line",run:"layout-run"};function It(e){return e.kind==="paragraph"}function Ft(e){return e.kind==="table"}function Ct(e){return e.kind==="image"}function ce(e){e.style.position="absolute",e.style.overflow="hidden";}function Rt(e,t,n){let o=n.createElement("div");return o.className=`${U.fragment} ${U.paragraph}`,ce(o),o.dataset.blockId=String(e.blockId),o.dataset.fromLine=String(e.fromLine),o.dataset.toLine=String(e.toLine),e.pmStart!==void 0&&(o.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(o.dataset.pmEnd=String(e.pmEnd)),e.continuesFromPrev&&(o.dataset.continuesFromPrev="true"),e.continuesOnNext&&(o.dataset.continuesOnNext="true"),o}function Et(e,t,n){let o=n.createElement("div");return o.className=`${U.fragment} ${U.table}`,ce(o),o.dataset.blockId=String(e.blockId),o.dataset.fromRow=String(e.fromRow),o.dataset.toRow=String(e.toRow),e.pmStart!==void 0&&(o.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(o.dataset.pmEnd=String(e.pmEnd)),o}function Lt(e,t,n){let o=n.createElement("div");return o.className=`${U.fragment} ${U.image}`,ce(o),o.dataset.blockId=String(e.blockId),e.pmStart!==void 0&&(o.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(o.dataset.pmEnd=String(e.pmEnd)),e.isAnchored&&(o.dataset.anchored="true"),e.zIndex!==void 0&&(o.style.zIndex=String(e.zIndex)),o}function Te(e,t,n={}){let o=n.document??document;if(It(e))return Rt(e,t,o);if(Ft(e))return Et(e,t,o);if(Ct(e))return Lt(e,t,o);let r=o.createElement("div");r.className=U.fragment,ce(r);let a=e;return a.blockId!==void 0&&(r.dataset.blockId=String(a.blockId)),a.kind&&(r.dataset.kind=a.kind),r}var B={fragment:"layout-paragraph",line:"layout-line",run:"layout-run",text:"layout-run-text",tab:"layout-run-tab",image:"layout-run-image",lineBreak:"layout-run-linebreak"};function z(e){return e.kind==="text"}function D(e){return e.kind==="tab"}function G(e){return e.kind==="image"}function Y(e){return e.kind==="lineBreak"}function X(e){return e.kind==="field"}var Qe={image:"layout-image",imageAnchored:"layout-image-anchored"};function ne(e){return !!(e.cropTop||e.cropRight||e.cropBottom||e.cropLeft||e.opacity!=null&&e.opacity<1)}function oe(e,t){let n=t.cropTop??0,o=t.cropRight??0,r=t.cropBottom??0,a=t.cropLeft??0;(n||o||r||a)&&(e.style.clipPath=`inset(${n*100}% ${o*100}% ${r*100}% ${a*100}%)`),t.opacity!=null&&t.opacity<1&&(e.style.opacity=String(Math.max(0,t.opacity)));}function Z(e,t,n,o,r={}){let a=r.document??document,i=a.createElement("div");i.className=Qe.image,e.isAnchored&&i.classList.add(Qe.imageAnchored),i.style.position="absolute",i.style.width=`${e.width}px`,i.style.height=`${e.height}px`,i.style.overflow="hidden",e.zIndex!==void 0&&(i.style.zIndex=String(e.zIndex)),t.anchor?.behindDoc&&(i.style.zIndex="-1"),i.dataset.blockId=String(e.blockId),e.pmStart!==void 0&&(i.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(i.dataset.pmEnd=String(e.pmEnd));let d=a.createElement("img");if(d.src=t.src,d.alt=t.alt??"",d.style.width="100%",d.style.height="100%",d.style.objectFit="contain",d.style.display="block",t.transform&&(d.style.transform=t.transform),d.draggable=false,t.hlinkHref){let l=a.createElement("a");l.href=t.hlinkHref,l.target="_blank",l.rel="noopener noreferrer",l.style.display="block",l.style.width="100%",l.style.height="100%",l.appendChild(d),i.appendChild(l);}else i.appendChild(d);return i}function vt(e,t,n){if(t.fontFamily&&(e.style.fontFamily=chunkN3Y5BUKV_js.a(t.fontFamily).cssFallback),t.fontSize){let r=t.fontSize*96/72;e.style.fontSize=`${r}px`;}if(t.bold&&(e.style.fontWeight="bold"),t.italic&&(e.style.fontStyle="italic"),t.color&&(e.style.color=t.color),t.letterSpacing&&(e.style.letterSpacing=`${t.letterSpacing}px`),t.allCaps&&(e.style.textTransform="uppercase"),t.smallCaps&&(e.style.fontVariant="small-caps"),t.positionPx&&(e.style.verticalAlign=`${t.positionPx}px`),t.horizontalScale&&t.horizontalScale!==100&&(e.style.display="inline-block",e.style.transform=`scaleX(${t.horizontalScale/100})`,e.style.transformOrigin="left center"),t.kerningMinPt&&t.kerningMinPt>0&&(t.fontSize??11)>=t.kerningMinPt&&(e.style.fontKerning="normal"),t.emboss&&(e.style.textShadow="1px 1px 1px rgba(255,255,255,0.5), -1px -1px 1px rgba(0,0,0,0.3)"),t.imprint&&(e.style.textShadow="-1px -1px 1px rgba(255,255,255,0.5), 1px 1px 1px rgba(0,0,0,0.3)"),t.textShadow&&!t.emboss&&!t.imprint&&(e.style.textShadow="1px 1px 2px rgba(0,0,0,0.3)"),t.textOutline&&(e.style.webkitTextStroke="1px currentColor",e.style.webkitTextFillColor="transparent"),t.emphasisMark){let r=t.emphasisMark==="comma"?"filled sesame":t.emphasisMark==="circle"?"filled circle":"filled dot",a=t.emphasisMark==="underDot"?"under right":"over right";e.style.textEmphasis=`${r}`,e.style.textEmphasisPosition=a,e.style.webkitTextEmphasis=r,e.style.webkitTextEmphasisPosition=a;}t.highlight&&(e.style.backgroundColor=t.highlight);let o=[];if(t.underline&&(o.push("underline"),typeof t.underline=="object"&&(t.underline.style&&(e.style.textDecorationStyle=t.underline.style),t.underline.color&&(e.style.textDecorationColor=t.underline.color))),t.strike&&o.push("line-through"),t.commentIds&&t.commentIds.length>0){let r=t.commentIds.find(a=>!n||!n.has(a));r!=null&&(e.style.backgroundColor="rgba(255, 212, 0, 0.15)",e.style.borderBottom="1px solid rgba(255, 212, 0, 0.4)",e.dataset.commentId=String(r));}t.isInsertion&&(e.style.backgroundColor="rgba(52, 168, 83, 0.08)",e.style.borderBottom="2px dashed #2e7d32",e.style.paddingBottom="1px",e.classList.add("docx-insertion"),t.changeAuthor&&(e.dataset.changeAuthor=t.changeAuthor),t.changeDate&&(e.dataset.changeDate=t.changeDate),t.changeRevisionId!=null&&(e.dataset.revisionId=String(t.changeRevisionId))),t.isDeletion&&(e.style.backgroundColor="rgba(211, 47, 47, 0.08)",e.style.color="#c62828",o.includes("line-through")||o.push("line-through"),e.style.textDecorationColor="#c62828",e.classList.add("docx-deletion"),t.changeAuthor&&(e.dataset.changeAuthor=t.changeAuthor),t.changeDate&&(e.dataset.changeDate=t.changeDate),t.changeRevisionId!=null&&(e.dataset.revisionId=String(t.changeRevisionId))),o.length>0&&(e.style.textDecorationLine=o.join(" ")),t.superscript&&(e.style.verticalAlign="super",e.style.fontSize="0.75em"),t.subscript&&(e.style.verticalAlign="sub",e.style.fontSize="0.75em"),t.hidden&&(e.classList.add("docx-hidden"),e.style.opacity="0.4",e.style.textDecoration="underline dotted"),t.rtl&&e.setAttribute("dir","rtl"),t.textEffect&&(e.classList.add("docx-text-effect",`docx-text-effect-${t.textEffect}`),e.dataset.effect=t.textEffect);}function j(e,t,n){t!==void 0&&(e.dataset.pmStart=String(t)),n!==void 0&&(e.dataset.pmEnd=String(n));}function re(e,t,n){let o=t.createElement("span");if(o.className=`${B.run} ${B.text}`,vt(o,e,n),j(o,e.pmStart,e.pmEnd),e.hyperlink){let r=t.createElement("a");r.href=e.hyperlink.href,e.hyperlink.href.startsWith("#")||(r.target="_blank",r.rel="noopener noreferrer"),e.hyperlink.tooltip&&(r.title=e.hyperlink.tooltip),r.textContent=e.text,r.style.color="inherit",r.style.textDecoration="inherit",e.hyperlink.noDefaultStyle||(e.color||(r.style.color="#0563c1",o.style.color="#0563c1"),e.underline||(r.style.textDecoration="underline")),o.appendChild(r);}else o.textContent=e.text;return o}var Pt=1e3;function pe(e,t,n,o){let r=t.createElement("span");r.className=`${B.run} ${B.tab}`,r.style.display="inline-block",r.style.width=`${n}px`,j(r,e.pmStart,e.pmEnd);let a=o&&o!=="none"?Bt(o):null;if(a){r.style.position="relative",r.textContent="\u200B";let i=t.createElement("span");i.style.position="absolute",i.style.left="0",i.style.right="0",i.style.top="0",i.style.bottom="0",i.style.overflow="hidden",i.style.whiteSpace="nowrap",i.textContent=a.repeat(Pt),r.appendChild(i);}else r.textContent="\xA0";return r}function Bt(e){switch(e){case "dot":return ".";case "hyphen":return "-";case "underscore":return "_";case "middleDot":return "\xB7";case "heavy":return "_";default:return null}}function nt(e){if(!e)return 0;let t=e.match(/rotate\(([-\d.]+)deg\)/);return t?(parseFloat(t[1])%360+360)%360:0}function ot(e,t,n){if(n===0||n===180)return {w:e,h:t};if(n===90||n===270)return {w:t,h:e};let o=n*Math.PI/180,r=Math.abs(Math.sin(o)),a=Math.abs(Math.cos(o));return {w:e*a+t*r,h:e*r+t*a}}function et(e,t){t.distTop&&(e.style.marginTop=`${t.distTop}px`),t.distBottom&&(e.style.marginBottom=`${t.distBottom}px`);}function Mt(e,t){let n=t.createElement("img");n.className=`${B.run} ${B.image}`,n.src=e.src,n.width=e.width,n.height=e.height,n.style.width=`${e.width}px`,n.style.height=`${e.height}px`,e.alt&&(n.alt=e.alt),e.transform&&(n.style.transform=e.transform,n.style.transformOrigin="center center"),ne(e)&&oe(n,e);let o=nt(e.transform);if(o!==0){let r=ot(e.width,e.height,o),a=t.createElement("span");return a.style.display="inline-block",a.style.position="relative",a.style.width=`${r.w}px`,a.style.height=`${r.h}px`,a.style.verticalAlign="middle",n.style.position="absolute",n.style.left=`${(r.w-e.width)/2}px`,n.style.top=`${(r.h-e.height)/2}px`,et(a,e),j(a,e.pmStart,e.pmEnd),a.appendChild(n),a}return n.style.display="inline-block",n.style.verticalAlign="middle",et(n,e),j(n,e.pmStart,e.pmEnd),n}function tt(e,t){let n=t.createElement("div");n.className="layout-block-image",n.style.display="block",n.style.textAlign="center",n.style.marginTop=`${e.distTop??6}px`,n.style.marginBottom=`${e.distBottom??6}px`;let o=t.createElement("img");o.src=e.src,o.width=e.width,o.height=e.height,o.style.marginLeft="auto",o.style.marginRight="auto",e.alt&&(o.alt=e.alt),e.transform&&(o.style.transform=e.transform,o.style.transformOrigin="center center"),ne(e)&&oe(o,e);let r=nt(e.transform);if(r!==0){let a=ot(e.width,e.height,r);n.style.height=`${a.h}px`,n.style.position="relative",o.style.position="absolute",o.style.left="50%",o.style.top="50%",o.style.marginLeft=`${-e.width/2}px`,o.style.marginRight="0",o.style.marginTop=`${-e.height/2}px`;}return j(n,e.pmStart,e.pmEnd),n.appendChild(o),n}function fe(e,t){let n;return chunkTURYWKNS_js.c(e)||e.displayMode==="block"||e.wrapType==="topAndBottom"?n=tt(e,t):n=Mt(e,t),$t(n,e),n}function $t(e,t){if(t.isInsertion)e.style.outline="2px solid #2e7d32",e.style.outlineOffset="1px",e.classList.add("docx-insertion");else if(t.isDeletion)e.style.outline="2px solid #c62828",e.style.outlineOffset="1px",e.style.opacity="0.6",e.classList.add("docx-deletion");else return;t.changeAuthor&&(e.dataset.changeAuthor=t.changeAuthor),t.changeDate&&(e.dataset.changeDate=t.changeDate),t.changeRevisionId!=null&&(e.dataset.revisionId=String(t.changeRevisionId));}function Ie(e,t){let n=t.createElement("br");return n.className=`${B.run} ${B.lineBreak}`,j(n,e.pmStart,e.pmEnd),n}function ge(e,t,n){let o=e.fallback??"";switch(e.fieldType){case "PAGE":o=String(n.pageNumber);break;case "NUMPAGES":o=String(n.totalPages);break;case "DATE":o=new Date().toLocaleDateString();break;case "TIME":o=new Date().toLocaleTimeString();break}let r={...e,text:o};return re(r,t,n?.resolvedCommentIds)}function Fe(e,t,n){if(z(e))return re(e,t,n?.resolvedCommentIds);if(D(e))return pe(e,t,48,void 0);if(G(e))return fe(e,t);if(Y(e))return Ie(e,t);if(X(e)&&n)return ge(e,t,n);let o=t.createElement("span");return o.className=B.run,o}function at(e,t){let n=[],o=e.runs;for(let r=t.fromRun;r<=t.toRun;r++){let a=o[r];if(a)if(z(a)){let i=r===t.fromRun?t.fromChar:0,d=r===t.toRun?t.toChar:a.text.length;if(i>0||d<a.text.length){let l=a.text.slice(i,d);n.push({...a,text:l,pmStart:a.pmStart!==void 0?a.pmStart+i:void 0,pmEnd:a.pmStart!==void 0?a.pmStart+d:void 0});}else n.push(a);}else n.push(a);}return n}function rt(e){return e==="center"?"center":e==="right"?"flex-end":"flex-start"}function it(e){return [e.pmStart??"no-start",e.pmEnd??"no-end",e.src,e.width,e.height,e.displayMode??"inline",e.wrapType??"none"].join("|")}function Ht(e){return {val:e.val,pos:e.pos,leader:e.leader}}function At(e,t,n){let o="";for(let r=t+1;r<e.length;r++){let a=e[r];if(z(a))o+=a.text;else if(X(a))a.fieldType==="PAGE"&&n?o+=String(n.pageNumber):a.fieldType==="NUMPAGES"&&n?o+=String(n.totalPages):o+=a.fallback??"";else if(D(a)||Y(a))break}return o}var Ot=.5;function zt(e,t,n,o){let r=0;for(let a=t+1;a<e.length;a++){let i=e[a];if(D(i)||Y(i))break;if(z(i))r+=n(i.text||"",i.fontSize,i.fontFamily,i.bold,i.italic);else if(X(i)){let d;i.fieldType==="PAGE"&&o?d=String(o.pageNumber):i.fieldType==="NUMPAGES"&&o?d=String(o.totalPages):d=i.fallback??"",r+=n(d,i.fontSize,i.fontFamily,i.bold,i.italic);}else G(i)&&!chunkTURYWKNS_js.c(i)&&(r+=i.width||0);}return r}function Dt(e){let n=e.createElement("canvas").getContext("2d");return (o,r=11,a="Calibri",i=false,d=false)=>{if(!n)return o.length*7;let l=chunkN3Y5BUKV_js.a(a).cssFallback,m=r*96/72,s=[];return d&&s.push("italic"),i&&s.push("bold"),s.push(`${m}px`,l),n.font=s.join(" "),n.measureText(o).width}}function me(e,t,n,o,r){let a=o.createElement("div");a.className=B.line,a.style.height=`${t.lineHeight}px`,a.style.lineHeight=`${t.lineHeight}px`;let i=at(e,t);if(i.length===1&&G(i[0])){let w=i[0].position?.horizontal?.align??n;a.style.display="flex",a.style.alignItems="center",a.style.justifyContent=rt(w),a.dataset.flexLine="true";}else i.some(G)&&(a.style.display="flex",a.style.alignItems="baseline",a.style.justifyContent=rt(n),a.style.lineHeight="normal",a.dataset.flexLine="true");if(i.length===0){let y=o.createElement("span");return y.className=`${B.run} layout-empty-run`,y.innerHTML="&nbsp;",a.appendChild(y),a}let d=n==="justify",l=false;d&&r&&(l=!r.isLastLine||r.paragraphEndsWithLineBreak,l&&(a.style.textAlign="justify",a.style.textAlignLast="justify",a.style.width=`${r.availableWidth}px`)),a.style.whiteSpace="pre";let m=i.some(y=>z(y)&&y.highlight);a.style.overflow=m?"hidden":"visible";let s=i.some(D),b,g=Dt(o);if(s){let y=r?.tabStops?.map(Ht),f=r?.leftIndentPx?Math.round(r.leftIndentPx*15):0;b={explicitStops:y,leftIndent:f};}let u=0,E=r?.leftIndentPx??0;if(r?.isFirstLine){let y=r?.firstLineIndentPx??0;u=E+y;}else u=E;for(let y=0;y<i.length;y++){let f=i[y];if(D(f)&&b){let w=zt(i,y,g,r?.context),F=At(i,y,r?.context),c=F.indexOf("."),x=c>=0?g(F.slice(0,c)):0,T=chunkT4RYVPAB_js.v(u,b,{followingWidth:w,decimalPrefixWidth:x}),S=r?.lineRightEdgePx,k=w,p=false;for(let I=y+1;I<i.length&&!Y(i[I]);I++)if(D(i[I])){p=true;break}if(S!==void 0&&T.alignment==="end"&&!p&&u+T.width+k>=S-Ot){a.style.display="flex",a.style.alignItems="baseline",a.style.whiteSpace="nowrap",a.style.textIndent="0",a.dataset.flexLine="true",r?.isFirstLine&&r.firstLineIndentPx&&r.firstLineIndentPx<0&&a.firstElementChild instanceof HTMLElement&&(a.firstElementChild.style.marginLeft=`${r.firstLineIndentPx}px`);let I=pe(f,o,0,T.leader);I.style.flex="1 1 0",I.style.minWidth="0",I.style.width="auto",a.appendChild(I);for(let v=y+1;v<i.length;v++){let L=i[v];if(D(L)||Y(L))break;if(z(L))a.appendChild(re(L,o,r?.context?.resolvedCommentIds));else if(X(L)&&r?.context)a.appendChild(ge(L,o,r.context));else if(G(L)){if(chunkTURYWKNS_js.c(L))continue;let P=it(L);r?.renderedInlineImageKeys?.has(P)||(r?.renderedInlineImageKeys?.add(P),a.appendChild(fe(L,o)));}else a.appendChild(Fe(L,o,r?.context));}break}let R=T.width;S!==void 0&&u+R+k>S&&(R=Math.max(1,S-u-k));let C=pe(f,o,R,T.leader);a.appendChild(C),u+=R;}else if(z(f)){let w=re(f,o,r?.context?.resolvedCommentIds);if(f.highlight){let T=(f.fontSize?f.fontSize*96/72:14.67)*1.2,S=Math.max(0,t.lineHeight-T);if(S>0){let k=S/2;w.style.paddingTop=`${k}px`,w.style.paddingBottom=`${k}px`;}}a.appendChild(w);let F=f.fontSize||11,c=f.fontFamily||"Calibri";u+=g(f.text,F,c,f.bold,f.italic);}else if(G(f)){if(chunkTURYWKNS_js.c(f))continue;let w=it(f);if(r?.renderedInlineImageKeys?.has(w))continue;r?.renderedInlineImageKeys?.add(w);let F=fe(f,o);a.appendChild(F),f.displayMode!=="block"&&f.wrapType!=="topAndBottom"&&(u+=f.width);}else if(Y(f)){let w=Ie(f,o);a.appendChild(w);}else if(X(f)&&r?.context){let w=ge(f,o,r.context);a.appendChild(w);let F=f.fallback??"";f.fieldType==="PAGE"?F=String(r.context.pageNumber):f.fieldType==="NUMPAGES"&&(F=String(r.context.totalPages));let c=f.fontSize||11,x=f.fontFamily||"Calibri";u+=g(F,c,x,f.bold,f.italic);}else {let w=Fe(f,o,r?.context);a.appendChild(w);}}return a}function ie(e,t){return !e&&!t?true:!e||!t?false:e.style===t.style&&e.width===t.width&&e.color===t.color}function st(e,t){return !e&&!t||!e||!t?false:ie(e.top,t.top)&&ie(e.bottom,t.bottom)&&ie(e.left,t.left)&&ie(e.right,t.right)&&ie(e.between,t.between)}function O(e,t,n,o,r={}){let a=r.document??document,i=a.createElement("div");i.className=B.fragment,i.style.position=o.positioning==="absolute"?"absolute":"relative",i.dataset.blockId=String(e.blockId),i.dataset.fromLine=String(e.fromLine),i.dataset.toLine=String(e.toLine),j(i,e.pmStart,e.pmEnd),e.continuesFromPrev&&(i.dataset.continuesFromPrev="true"),e.continuesOnNext&&(i.dataset.continuesOnNext="true");let d=t.attrs?.pPrIns,l=t.attrs?.pPrDel;if(d||l){let S=d??l;i.classList.add("layout-revision-pmark"),i.classList.add(d?"layout-revision-ins":"layout-revision-del"),i.dataset.revisionId=String(S.revisionId),i.dataset.revisionAuthor=S.author,S.date&&(i.dataset.revisionDate=S.date);}let m=n.lines.slice(e.fromLine,e.toLine),s=t.attrs?.alignment;t.attrs?.styleId&&(i.dataset.styleId=t.attrs.styleId);let b=t.attrs?.bidi;b&&(i.dir="rtl"),s?s==="center"?i.style.textAlign="center":s==="right"?i.style.textAlign="right":s==="left"?i.style.textAlign="left":i.style.textAlign=b?"right":"left":b&&(i.style.textAlign="right");let g=t.attrs?.indent,u=0,E=0;g&&(b?(g.left&&g.left>0&&(E=g.left),g.right&&g.right>0&&(u=g.right)):(g.left&&g.left>0&&(u=g.left),g.right&&g.right>0&&(E=g.right)));let y=t.attrs?.borders;if(y){let S=L=>{switch(L){case "single":return "solid";case "double":return "double";case "dotted":return "dotted";case "dashed":return "dashed";case "thick":return "solid";case "wave":return "wavy";case "dashSmallGap":return "dashed";case "nil":case "none":return "none";default:return "solid"}};i.style.boxSizing="border-box";let k=L=>`${L.width}px ${S(L.style)} ${L.color}`,p=st(r.prevBorders,y),h=st(y,r.nextBorders),R=p?y.between:y.top,C=h?void 0:y.bottom,I=a.createElement("div");if(I.className="layout-paragraph-border",I.style.position="absolute",I.style.pointerEvents="none",I.style.boxSizing="border-box",I.style.left=`${u-(y.left?.space??0)}px`,I.style.right=`${E-(y.right?.space??0)}px`,I.style.top=`${-(R?.space??0)}px`,I.style.bottom=`${-(C?.space??0)}px`,R&&(I.style.borderTop=k(R)),C&&(I.style.borderBottom=k(C)),y.left&&(I.style.borderLeft=k(y.left)),y.right&&(I.style.borderRight=k(y.right)),(R||C||y.left||y.right)&&i.appendChild(I),y.bar){let L=a.createElement("div");L.style.position="absolute",L.style.left="-8px",L.style.top="0",L.style.bottom="0",L.style.borderLeft=k(y.bar),i.style.position="relative",i.appendChild(L);}}t.attrs?.shading&&(i.style.backgroundColor=t.attrs.shading);let f=e.width-u-E,F=t.runs[t.runs.length-1]?.kind==="lineBreak",c=n.lines.length,x=0;g?.hanging&&g.hanging>0?x=-g.hanging:g?.firstLine&&g.firstLine>0&&(x=g.firstLine);let T=r.renderedInlineImageKeys??new Set;for(let S=0;S<m.length;S++){let k=m[S],p=e.fromLine+S,h=p===c-1,R=p===0&&!e.continuesFromPrev,C=k.leftOffset??0,I=k.rightOffset??0,v=f;if(R){let M=g?.hanging&&g.hanging>0,$=g?.firstLine&&g.firstLine>0;M&&g?.hanging?v=f+g.hanging:$&&g?.firstLine&&(v=f-g.firstLine);}if(Nt(k,t)){let M=a.createElement("div");M.className=`${B.line} layout-line-split`,M.style.position="relative",M.style.height=`${k.lineHeight}px`,M.style.lineHeight=`${k.lineHeight}px`;for(let $ of k.segments){let Se={fromRun:$.fromRun,fromChar:$.fromChar,toRun:$.toRun,toChar:$.toChar,width:$.width,ascent:k.ascent,descent:k.descent,lineHeight:k.lineHeight},_=me(t,Se,s,a,{availableWidth:$.availableWidth,isLastLine:h,isFirstLine:R,paragraphEndsWithLineBreak:F,tabStops:t.attrs?.tabs,leftIndentPx:u,firstLineIndentPx:R?x:0,context:o,renderedInlineImageKeys:T});_.className+=" layout-line-segment",_.style.position="absolute",_.style.left=`${$.leftOffset}px`,_.style.top="0",_.style.width=`${$.availableWidth}px`,M.appendChild(_);}i.appendChild(M);continue}let L=me(t,k,s,a,{availableWidth:v-C-I,isLastLine:h,isFirstLine:R,paragraphEndsWithLineBreak:F,tabStops:t.attrs?.tabs,leftIndentPx:u,firstLineIndentPx:R?x:0,context:o,renderedInlineImageKeys:T,lineRightEdgePx:e.width-E-I});if(C>0||I>0){C>0&&(L.style.marginLeft=`${C}px`),I>0&&(L.style.marginRight=`${I}px`);let M=v-C-I;M>0&&(L.style.width=`${M}px`);}k.floatSkipBefore&&k.floatSkipBefore>0&&(L.style.marginTop=`${k.floatSkipBefore}px`);let P=g?.hanging&&g.hanging>0,He=g?.firstLine&&g.firstLine>0,xt=L.dataset.flexLine==="true";if(R?u>0&&P?(L.style.paddingLeft=`${u}px`,xt||(L.style.textIndent=`-${g.hanging}px`)):u>0&&He?(L.style.paddingLeft=`${u}px`,L.style.textIndent=`${g.firstLine}px`):u>0?L.style.paddingLeft=`${u}px`:He&&(L.style.textIndent=`${g.firstLine}px`):u>0?L.style.paddingLeft=`${u}px`:P&&(L.style.paddingLeft=`${g.hanging}px`),E>0&&(L.style.paddingRight=`${E}px`),R&&t.attrs?.listMarker&&!t.attrs?.listMarkerHidden){let M=g?.hanging??0,$=g?.firstLine??0,Se=M>0?Math.max(0,u-M):u+$;L.style.paddingLeft=`${Se}px`,L.style.textIndent="0";let{fontFamily:_,fontSize:St}=chunkT4RYVPAB_js.w(t),kt=Wt(t.attrs.listMarker,chunkT4RYVPAB_js.x(t),a,_,St,t.attrs.listMarkerRevision);L.insertBefore(kt,L.firstChild);}i.appendChild(L);}if((d||l)&&!e.continuesOnNext){let S=i.lastElementChild;if(S){let k=a.createElement("span");k.className="layout-revision-pmark-glyph",d?k.classList.add("layout-revision-ins"):k.classList.add("layout-revision-del"),k.textContent="\xB6",k.setAttribute("aria-hidden","true"),S.appendChild(k);}}return i}function Nt(e,t){return (e.segments?.length??0)>1&&!t.attrs?.listMarker}function Wt(e,t,n,o,r,a){let i=n.createElement("span");return i.className="layout-list-marker",i.style.fontFamily=chunkN3Y5BUKV_js.a(o).cssFallback,i.style.fontSize=`${r*96/72}px`,i.style.textAlign="left",i.style.boxSizing="border-box",i.style.display="inline-block",i.style.minWidth=`${t}px`,i.textContent=e,a==="ins"?i.style.color="#2e7d32":a==="del"&&(i.style.color="#c62828",i.style.textDecoration="line-through"),i}function q(e,t,n){let o=t.createElement("div");o.className=n.layerClass,o.style.position="absolute",o.style.top="0",o.style.left="0",n.sizing==="inset0"?(o.style.right="0",o.style.bottom="0"):(o.style.width="100%",o.style.height="100%",o.style.overflow="hidden"),o.style.pointerEvents="none",n.layerMode==="front"&&(o.style.zIndex="10");for(let r of e){let a=t.createElement("div");a.className=n.itemClass,a.style.position="absolute",a.style.pointerEvents="auto",a.style.top=`${r.y}px`,a.style.left=`${r.x}px`,r.pmStart!==void 0&&(a.dataset.pmStart=String(r.pmStart)),r.pmEnd!==void 0&&(a.dataset.pmEnd=String(r.pmEnd));let i=t.createElement("img");i.src=r.src,i.style.width=`${r.width}px`,i.style.height=`${r.height}px`,i.style.display="block",i.style.maxWidth="none",i.style.maxHeight="none",r.alt&&(i.alt=r.alt),r.transform&&(i.style.transform=r.transform,i.style.transformOrigin="center center"),ne(r)&&oe(i,r),a.appendChild(i),o.appendChild(a);}return o}function lt(e,t,n){let o=[],r=0;for(let a=0;a<e.blocks.length;a++){let i=e.blocks[a];if(i?.kind!=="paragraph"){let m=t.blocks[a];m&&m.kind==="table"&&(r+=m.totalHeight??0);continue}let d=i;for(let m of d.runs){if(m.kind!=="image")continue;let s=m;if(!chunkTURYWKNS_js.c(s))continue;let b=s.position,g=s.distTop??0,u=s.distBottom??0,E=s.distLeft??12,y=s.distRight??12,f="left",w=0;if(b?.horizontal){let c=b.horizontal;c.align==="right"?(f="right",w=n-s.width):c.align==="left"?w=0:c.align==="center"?w=(n-s.width)/2:c.posOffset!==void 0&&(w=chunk4Q2IP5FW_js.e(c.posOffset),f=w>n/2?"right":"left");}else s.cssFloat==="right"&&(f="right",w=n-s.width);let F=r;if(b?.vertical){let c=b.vertical;c.posOffset!==void 0?F=r+chunk4Q2IP5FW_js.e(c.posOffset):c.align==="top"&&(F=0);}w=Math.max(0,Math.min(w,n-s.width)),o.push({src:s.src,width:s.width,height:s.height,alt:s.alt,transform:s.transform,x:w,y:F,side:f,distTop:g,distBottom:u,distLeft:E,distRight:y,wrapText:chunkTURYWKNS_js.e(s.cssFloat),wrapType:s.wrapType,pmStart:s.pmStart,pmEnd:s.pmEnd});}let l=t.blocks[a];l&&l.kind==="paragraph"&&(r+=l.totalHeight);}return o}function Ce(e){return !!e&&e.style!=="none"&&e.style!=="nil"&&e.width!==0}function J(e,t,n){let o=`border${t.charAt(0).toUpperCase()+t.slice(1)}`;if(!Ce(n))e.style[o]="none";else {let r=n.width??1,a=n.color??"#000000",i=n.style??"solid";e.style[o]=`${r}px ${i} ${a}`;}}function Re(e){let t=[],n=0;for(let o of e)t.push(Math.round(n)),n+=o?.height??0;return t.push(Math.round(n)),t}function dt(e,t){let n=e.createElement("div");n.className="layout-table-cut-border",n.style.position="absolute",n.style.left=`${t.x}px`,n.style.width=`${t.width}px`;let o=t.border.width??1;return n.style.top=`${t.edge==="bottom"?t.topY-o:t.topY}px`,J(n,"top",t.border),n}function Ee(e,t,n,o){e.classList.add(`ep-revision-${t}`,`ep-revision-${n}`),e.dataset.revisionId=String(o.revisionId),e.dataset.revisionAuthor=o.author,o.date&&(e.dataset.revisionDate=o.date);}var N={table:"layout-table",row:"layout-table-row",cell:"layout-table-cell",cellContent:"layout-table-cell-content",resizeHandle:"layout-table-resize-handle",rowResizeHandle:"layout-table-row-resize-handle",tableEdgeHandleBottom:"layout-table-edge-handle-bottom",tableEdgeHandleRight:"layout-table-edge-handle-right"};function _t(e,t,n,o){let r=o.createElement("div");r.className=N.cellContent,r.style.position="relative";let a=e.padding?.left??7,i=e.padding?.right??7,d=Math.max(0,t.width-a-i);r.style.width=`${d}px`;let l=lt(e,t,d),m;if(l.length>0){m=l.filter(chunkTURYWKNS_js.a).map(E=>{let y=E.x+E.width+E.distRight,f=E.y-E.distTop,w=E.y+E.height+E.distBottom,F=0,c=0,x=E.wrapText??"bothSides";return x==="right"?F=y:x==="left"?c=d-(E.x-E.distLeft):E.side==="left"?F=y:c=d-(E.x-E.distLeft),{leftMargin:F,rightMargin:c,topY:f,bottomY:w}});let u=l.filter(chunkTURYWKNS_js.b);u.length>0&&r.appendChild(q(u,o,{layerClass:"layout-cell-floating-images-layer",itemClass:"layout-cell-floating-image",sizing:"fullSize",layerMode:"behind"}));}let s=0,b=0;for(let u=0;u<e.blocks.length;u++){let E=e.blocks[u],y=t.blocks[u];if(E?.kind==="paragraph"&&y?.kind==="paragraph"){let f=E,w=y,F=f.attrs?.spacing,c=Math.max(b,F?.before??0);s+=c,m&&m.length>0&&(w=chunkT4RYVPAB_js.z(f,d,{floatingZones:m,paragraphYOffset:s}));let x={blockId:f.id,width:d,height:w.totalHeight,fromLine:0,toLine:w.lines.length,pmStart:f.pmStart,pmEnd:f.pmEnd},T={...n,insideTableCell:true},S=O(x,f,w,T,{document:o});S.style.position="relative",c>0&&(S.style.marginTop=`${c}px`),r.appendChild(S),s+=w.totalHeight,b=F?.after??0;}else if(E?.kind==="table"&&y?.kind==="table"){let f=E,w=y,F=b,c=Gt(f,w,n,o);c.style.position="relative",F>0&&(c.style.marginTop=`${F}px`),r.appendChild(c),s+=F+(y.totalHeight??0),b=0;}}b>0&&(r.style.paddingBottom=`${b}px`);let g=l.filter(u=>!chunkTURYWKNS_js.b(u));return g.length>0&&r.appendChild(q(g,o,{layerClass:"layout-cell-floating-images-layer",itemClass:"layout-cell-floating-image",sizing:"fullSize",layerMode:"front"})),r}function Gt(e,t,n,o){let r=o.createElement("div");r.className=`${N.table} layout-nested-table`,r.style.position="relative",r.style.width=`${t.totalWidth}px`,r.style.display="block",e.justification==="center"?(r.style.marginLeft="auto",r.style.marginRight="auto"):e.justification==="right"?r.style.marginLeft="auto":e.indent&&(r.style.marginLeft=`${e.indent}px`),r.dataset.blockId=String(e.id),e.pmStart!==void 0&&(r.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(r.dataset.pmEnd=String(e.pmEnd));let a=e.rows[0],i=a?.trackedIns,d=a?.trackedDel,l=(g,u)=>!!g&&!!u&&(g.author??"")===(u.author??"")&&(g.date??null)===(u.date??null),m=e.rows.length>0&&e.rows.every(g=>i?l(g.trackedIns,i):d?l(g.trackedDel,d):false);if(m){let g=i??d,u=i?"ins":"del";r.classList.add("ep-revision-table",`ep-revision-${u}`),r.dataset.revisionId=String(g.revisionId),r.dataset.revisionAuthor=g.author,g.date&&(r.dataset.revisionDate=g.date);}let s=Re(t.rows),b=new Map;for(let g=0;g<e.rows.length;g++){let u=e.rows[g],E=t.rows[g];if(!u||!E)continue;let y=Le(u,E,g,s[g]??0,t.columnWidths,e.rows.length,n,o,b,s,void 0,m);r.appendChild(y);}return r.style.height=`${s[e.rows.length]??0}px`,r}function ct(e,t,n,o,r,a,i,d){let l=i.createElement("div");l.className=N.cell,e.trackedMarker&&e.trackedMarker.info.revisionId!==d&&Ee(l,"cell",e.trackedMarker.kind,e.trackedMarker.info),l.style.position="absolute",l.style.left=`${n}px`,l.style.top="0",l.style.width=`${t.width}px`,l.style.height=`${o}px`,l.style.overflow="hidden",l.style.boxSizing="border-box";let m=e.padding?.top??1,s=e.padding?.right??7,b=e.padding?.bottom??1,g=e.padding?.left??7;l.style.padding=`${m}px ${s}px ${b}px ${g}px`,e.borders&&(r.isFirstRow&&J(l,"top",e.borders.top),J(l,"right",e.borders.right),J(l,"bottom",e.borders.bottom),r.isFirstCol&&J(l,"left",e.borders.left)),e.background&&(l.style.backgroundColor=e.background),e.noWrap&&(l.style.whiteSpace="nowrap");let u=(t.height??0)>=o-.5;if(e.verticalAlign&&!u)switch(l.style.display="flex",l.style.flexDirection="column",e.verticalAlign){case "top":l.style.justifyContent="flex-start";break;case "center":l.style.justifyContent="center";break;case "bottom":l.style.justifyContent="flex-end";break}let E=_t(e,t,a,i);if(l.appendChild(E),e.blocks.length>0){let y=e.blocks[0],f=e.blocks[e.blocks.length-1];y&&"pmStart"in y&&y.pmStart!==void 0&&(l.dataset.pmStart=String(y.pmStart)),f&&"pmEnd"in f&&f.pmEnd!==void 0&&(l.dataset.pmEnd=String(f.pmEnd));}return l}function Yt(e,t){return chunkT4RYVPAB_js.b(e).map(n=>{let o=0;for(let r=0;r<n.columnIndex;r++)o+=t[r]??0;return {rowIndex:n.rowIndex,cellIndex:n.cellIndex,columnIndex:n.columnIndex,x:o,colSpan:n.colSpan,rowSpan:n.rowSpan,cell:e.rows[n.rowIndex].cells[n.cellIndex]}})}function Le(e,t,n,o,r,a,i,d,l,m,s,b){let g=d.createElement("div");g.className=N.row,b||(e.trackedDel?Ee(g,"row","del",e.trackedDel):e.trackedIns&&Ee(g,"row","ins",e.trackedIns));let u=m&&m.length>n+1?(m[n+1]??0)-(m[n]??0):t.height;g.style.position="absolute",g.style.left="0",g.style.top=`${o}px`,g.style.width="100%",g.style.height=`${u}px`,g.dataset.rowIndex=String(n);let E=new Set;if(l){for(let[,w]of l)if(w.startRow<n&&w.startRow+w.rowSpan>n)for(let F=0;F<w.colSpan;F++)E.add(w.columnIndex+F);}let y=0,f=0;for(;E.has(f);)y+=r[f]??0,f++;for(let w=0;w<e.cells.length;w++){let F=e.cells[w],c=t.cells[w];if(!F||!c)continue;let x=F.colSpan??1,T=F.rowSpan??1,S=u;if(T>1&&m){S=0;for(let I=n;I<n+T&&I<m.length-1;I++)S+=(m[I+1]??0)-(m[I]??0);S===0&&(S=t.height*T);}let k=n===0||s===true,h=f===0;f+x>=r.length;let C=ct(F,c,y,S,{isFirstRow:k,isFirstCol:h},i,d,e.trackedIns?.revisionId??e.trackedDel?.revisionId);if(C.dataset.cellIndex=String(w),C.dataset.columnIndex=String(f),T>1&&(C.dataset.rowSpan=String(T)),g.appendChild(C),T>1&&l){let I=`${n}-${f}`;l.set(I,{cell:F,cellMeasure:c,columnIndex:f,startRow:n,rowSpan:T,colSpan:x,x:y,totalHeight:S});}for(let I=0;I<x&&f+I<r.length;I++)y+=r[f+I]??0;for(f+=x;E.has(f);)y+=r[f]??0,f++;}return g}function Q(e,t,n,o,r={}){let a=r.document??document,i=a.createElement("div");i.className=N.table,i.style.position=o.positioning==="flow"?"relative":"absolute",i.style.width=`${e.width}px`,i.style.overflow="hidden",i.dataset.blockId=String(e.blockId),i.dataset.fromRow=String(e.fromRow),i.dataset.toRow=String(e.toRow),e.pmStart!==void 0&&(i.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(i.dataset.pmEnd=String(e.pmEnd));let d=t.rows[0],l=d?.trackedIns,m=d?.trackedDel,s=(p,h)=>!!p&&!!h&&(p.author??"")===(h.author??"")&&(p.date??null)===(h.date??null),b=t.rows.length>0&&t.rows.every(p=>l?s(p.trackedIns,l):m?s(p.trackedDel,m):false);if(b){let p=l??m,h=l?"ins":"del";i.classList.add("ep-revision-table",`ep-revision-${h}`),i.dataset.revisionId=String(p.revisionId),i.dataset.revisionAuthor=p.author,p.date&&(i.dataset.revisionDate=p.date),i.style.overflowX="visible",i.style.overflowY="hidden";}let g=0;for(let p=0;p<n.columnWidths.length-1;p++){g+=n.columnWidths[p]??0;let h=a.createElement("div");h.className=N.resizeHandle,h.style.position="absolute",h.style.left=`${g-3}px`,h.style.top="0",h.style.width="6px",h.style.height="100%",h.style.cursor="col-resize",h.style.zIndex="10",h.dataset.columnIndex=String(p),h.dataset.tableBlockId=String(e.blockId),e.pmStart!==void 0&&(h.dataset.tablePmStart=String(e.pmStart)),i.appendChild(h);}let u=Re(n.rows),E=Yt(t,n.columnWidths),y=e.headerRowCount??0,f=0;if(y>0&&e.continuesFromPrev){let p=new Map;for(let h=0;h<y;h++){let R=t.rows[h],C=n.rows[h];if(!R||!C)continue;let I=Le(R,C,h,f,n.columnWidths,t.rows.length,o,a,p,u,h===0,b);I.dataset.repeatedHeader="true",i.appendChild(I),f+=C.height;}}let w=(u[e.fromRow]??0)+(e.topClip??0),F=p=>f+(p-w),c=e.bottomClip!==void 0?Math.round(e.height):F(u[e.toRow]??0);i.style.height=`${c}px`;let x=new Map,T=y>0&&e.continuesFromPrev;for(let p of E){if(p.rowSpan<=1||p.rowIndex>=e.fromRow||p.rowIndex+p.rowSpan<=e.fromRow||T&&p.rowIndex<y)continue;let h=n.rows[p.rowIndex]?.cells?.[p.cellIndex];if(!h)continue;let R=0;for(let P=p.rowIndex;P<p.rowIndex+p.rowSpan&&P<u.length-1;P++)R+=(u[P+1]??0)-(u[P]??0);x.set(`${p.rowIndex}-${p.columnIndex}`,{cell:p.cell,cellMeasure:h,columnIndex:p.columnIndex,startRow:p.rowIndex,rowSpan:p.rowSpan,colSpan:p.colSpan,x:p.x,totalHeight:R});p.rowIndex+p.rowSpan>=t.rows.length;let I=p.columnIndex===0;p.columnIndex+p.colSpan>=n.columnWidths.length;let L=ct(p.cell,h,p.x,R,{isFirstRow:false,isFirstCol:I},o,a);L.style.top=`${F(u[p.rowIndex]??0)}px`,L.dataset.columnIndex=String(p.columnIndex),L.dataset.vmergeContinuation="true",delete L.dataset.pmStart,delete L.dataset.pmEnd,i.appendChild(L);}for(let p=e.fromRow;p<e.toRow;p++){let h=t.rows[p],R=n.rows[p];if(!h||!R)continue;let C=y>0&&e.continuesFromPrev?false:e.continuesFromPrev&&p===e.fromRow&&!e.topClip,I=Le(h,R,p,F(u[p]??0),n.columnWidths,t.rows.length,o,a,x,u,C,b);i.appendChild(I);}let S=(p,h,R,C)=>{for(let I of E){if(I.rowIndex>p||I.rowIndex+I.rowSpan-1<p||C&&!(h==="bottom"?I.rowIndex+I.rowSpan-1>p:I.rowIndex<p))continue;let v=I.cell.borders?.[h];if(!Ce(v))continue;let L=0;for(let P=0;P<I.colSpan;P++)L+=n.columnWidths[I.columnIndex+P]??0;i.appendChild(dt(a,{x:I.x,topY:R,width:L,edge:h,border:v}));}};e.topClip?S(e.fromRow,"top",f,false):e.continuesFromPrev&&S(e.fromRow,"top",f,true),e.bottomClip!==void 0?S(e.toRow-1,"bottom",c,false):e.continuesOnNext&&S(e.toRow-1,"bottom",c,true);for(let p=e.fromRow;p<e.toRow-1;p++){let h=F(u[p+1]??0);if(h<=f||h>=e.height)continue;let R=a.createElement("div");R.className=N.rowResizeHandle,R.style.position="absolute",R.style.left="0",R.style.top=`${h-3}px`,R.style.width="100%",R.style.height="6px",R.style.cursor="row-resize",R.style.zIndex="10",R.dataset.rowIndex=String(p),R.dataset.tableBlockId=String(e.blockId),e.pmStart!==void 0&&(R.dataset.tablePmStart=String(e.pmStart)),i.appendChild(R);}let k=e.toRow===t.rows.length&&e.bottomClip===void 0;if(k){let p=a.createElement("div");p.className=N.tableEdgeHandleBottom,p.style.position="absolute",p.style.left="0",p.style.top=`${F(u[e.toRow]??0)-3}px`,p.style.width="100%",p.style.height="6px",p.style.cursor="row-resize",p.style.zIndex="10",p.dataset.rowIndex=String(t.rows.length-1),p.dataset.tableBlockId=String(e.blockId),p.dataset.isEdge="bottom",e.pmStart!==void 0&&(p.dataset.tablePmStart=String(e.pmStart)),i.appendChild(p);}if(k){let p=n.columnWidths.reduce((R,C)=>R+C,0),h=a.createElement("div");h.className=N.tableEdgeHandleRight,h.style.position="absolute",h.style.left=`${p-3}px`,h.style.top="0",h.style.width="6px",h.style.height="100%",h.style.cursor="col-resize",h.style.zIndex="10",h.dataset.columnIndex=String(n.columnWidths.length-1),h.dataset.tableBlockId=String(e.blockId),h.dataset.isEdge="right",e.pmStart!==void 0&&(h.dataset.tablePmStart=String(e.pmStart)),i.appendChild(h);}return i}var jt={textBox:"layout-textbox"};function ee(e,t,n,o,r={}){let a=r.document??document,i=a.createElement("div");if(i.className=jt.textBox,i.style.position="absolute",i.style.width=`${e.width}px`,i.style.height=`${e.height}px`,i.style.overflow="hidden",i.style.boxSizing="border-box",Kt(i,e),t.fillColor&&(i.style.backgroundColor=t.fillColor),t.outlineWidth&&t.outlineWidth>0){let s=t.outlineStyle||"solid",b=t.outlineColor||"#000000";i.style.border=`${t.outlineWidth}px ${s} ${b}`;}let d=t.margins??chunkDROCYKAR_js.a;i.style.padding=`${d.top}px ${d.right}px ${d.bottom}px ${d.left}px`,i.dataset.blockId=String(e.blockId),e.pmStart!==void 0&&(i.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(i.dataset.pmEnd=String(e.pmEnd));let l=e.width-d.left-d.right,m=0;for(let s=0;s<t.content.length;s++){let b=t.content[s],g=n.innerMeasures[s];if(!g)continue;let u={blockId:b.id,width:l,height:g.totalHeight,pmStart:b.pmStart,pmEnd:b.pmEnd,fromLine:0,toLine:g.lines.length},E=O(u,b,g,{...o,positioning:"flow"},{document:a});i.appendChild(E),m+=g.totalHeight;}return i}function Kt(e,t){!t.isFloating&&t.zIndex===void 0||(e.style.zIndex=String(t.zIndex??10));}var Vt="layout-watermark-layer";function Ut(e,t){let n=Math.max(e.trim().length,1),o=t/(n*.62);return Math.max(24,Math.min(o,180))}function Xt(e,t,n){let o=n.createElement("div");o.style.position="absolute",o.style.top="50%",o.style.left="50%",o.style.whiteSpace="nowrap",o.style.fontWeight="bold",o.style.color=e.color,o.style.fontFamily=chunkN3Y5BUKV_js.a(e.font).cssFallback,o.style.userSelect="none";let r=t.size.w-t.margins.left-t.margins.right,a=e.layout==="diagonal"?r*1.3:r,i=e.fontSize!==void 0?e.fontSize*96/72:Ut(e.text,a);o.style.fontSize=`${i}px`,o.style.lineHeight="1",o.style.opacity=e.semitransparent?"0.5":"0.85";let d=e.layout==="diagonal"?-45:0;return o.style.transform=`translate(-50%, -50%) rotate(${d}deg)`,o.style.transformOrigin="center center",o.textContent=e.text,o}function qt(e,t,n){if(!e.dataUrl)return null;let o=n.createElement("img");o.src=e.dataUrl,o.alt="",o.style.position="absolute",o.style.top="50%",o.style.left="50%",o.style.transform="translate(-50%, -50%)";let r=t.size.w-t.margins.left-t.margins.right,a=e.widthEmu!==void 0?e.widthEmu/(914400/96):r*.75;return o.style.width=`${a*(e.scale||1)}px`,o.style.height="auto",e.washout&&(o.style.opacity="0.5",o.style.filter="brightness(1.4) contrast(0.4)"),o}function pt(e,t,n=document){let o=e.kind==="text"?Xt(e,t,n):qt(e,t,n);if(!o)return null;let r=n.createElement("div");return r.className=Vt,r.setAttribute("aria-hidden","true"),r.style.position="absolute",r.style.inset="0",r.style.overflow="hidden",r.style.pointerEvents="none",r.style.zIndex="0",r.appendChild(o),r}function ft(e){return e?.align??e?.alignment}function Zt(e,t){let n=e.position.vertical;if(!n)return e.paragraphY;let o=ft(n),r=n.posOffset!==void 0?chunk4Q2IP5FW_js.e(n.posOffset):void 0;if(n.relativeTo==="page"){if(r!==void 0)return r-t.flowTop;if(o==="top")return -t.flowTop;if(o==="bottom")return t.pageHeight-e.height-t.flowTop;if(o==="center")return (t.pageHeight-e.height)/2-t.flowTop}if(n.relativeTo==="margin"){let a=t.margins.top,i=t.pageHeight-t.margins.top-t.margins.bottom;if(r!==void 0)return a+r-t.flowTop;if(o==="top")return a-t.flowTop;if(o==="bottom")return a+i-e.height-t.flowTop;if(o==="center")return a+(i-e.height)/2-t.flowTop}return r!==void 0?e.paragraphY+r:e.paragraphY}function ve(e,t,n){if(!t)return "0";let o=ft(t);if(t.relativeTo==="page"){if(t.posOffset!==void 0)return `${chunk4Q2IP5FW_js.e(t.posOffset)-n.flowLeft}px`;if(o==="right")return `${n.pageWidth-e-n.flowLeft}px`;if(o==="center")return `${(n.pageWidth-e)/2-n.flowLeft}px`;if(o==="left")return `${-n.flowLeft}px`}return t.posOffset!==void 0?`${chunk4Q2IP5FW_js.e(t.posOffset)}px`:o==="right"?`${n.contentWidth-e}px`:o==="center"?`${(n.contentWidth-e)/2}px`:"0"}function Jt(e,t,n){e.style.left=ve(t.width,t.position.horizontal,n);}function gt(e,t){let n=e.tblpY??0;e.vertAnchor==="page"?n-=t.flowTop:e.vertAnchor==="margin"&&(n+=t.margins.top-t.flowTop);let o=e.tblpX??0;return e.horzAnchor==="page"?o-=t.flowLeft:e.horzAnchor==="margin"&&(o+=t.margins.left-t.flowLeft),{left:o,top:n}}function Pe(e,t,n,o){let r=n.document??document,a=r.createElement("div");a.style.position="relative";let i=t.contentWidth??600,d=[],l=0;for(let m=0;m<e.blocks.length;m++){let s=e.blocks[m],b=e.measures[m];if(!(!s||!b))if(s.kind==="paragraph"){if(b.kind!=="paragraph")continue;let g=s,u=b,E=g.attrs?.spacing?.before??0,y=l,f=[];for(let x of g.runs)if(x.kind==="image"&&"position"in x&&x.position){let T=x;d.push({src:T.src,width:T.width,height:T.height,alt:T.alt,paragraphY:y,position:T.position});}else f.push(x);let w={...g,runs:f},F={blockId:g.id,width:i,height:u.totalHeight,fromLine:0,toLine:u.lines.length,pmStart:g.pmStart,pmEnd:g.pmEnd},c=O(F,w,u,{...t,positioning:"absolute"},{document:r});c.style.top=`${l+E}px`,c.style.left="0",c.style.width=`${i}px`,a.appendChild(c),l+=u.totalHeight;}else if(s.kind==="table"){if(b.kind!=="table")continue;let g={blockId:s.id,width:b.totalWidth,height:b.totalHeight,fromRow:0,toRow:b.rows.length,pmStart:s.pmStart,pmEnd:s.pmEnd},u=Q(g,s,b,{...t,positioning:"absolute"},{document:r});if(s.floating){let{left:E,top:y}=gt(s.floating,o);u.style.top=`${y}px`,u.style.left=`${E}px`,a.appendChild(u);}else u.style.top=`${l}px`,u.style.left="0",a.appendChild(u),l+=b.totalHeight;}else if(s.kind==="image"){if(b.kind!=="image")continue;let g={blockId:s.id,width:b.width,height:b.height,pmStart:s.pmStart,pmEnd:s.pmEnd},u=Z(g,s,b,{...t},{document:r});u.style.top=`${l}px`,u.style.left="0",a.appendChild(u),l+=b.height;}else if(s.kind==="textBox"){if(b.kind!=="textBox")continue;let g={blockId:s.id,width:b.width,height:b.height,pmStart:s.pmStart,pmEnd:s.pmEnd},u=ee(g,s,b,{...t,positioning:"absolute"},{document:r});u.style.top=`${l}px`,u.style.left=ve(b.width,s.position?.horizontal,o),a.appendChild(u),l+=b.height;}else s.kind==="sectionBreak"||s.kind==="pageBreak"||s.kind==="columnBreak"||chunkDROCYKAR_js.c(s,"renderHeaderFooterContent");}for(let m of d){let s=r.createElement("img");s.src=m.src,s.width=m.width,s.height=m.height,m.alt&&(s.alt=m.alt),s.style.position="absolute",s.style.display="block",s.style.width=`${m.width}px`,s.style.height=`${m.height}px`,s.style.maxWidth="none",s.style.maxHeight="none",Jt(s,m,o),s.style.top=`${Zt(m,o)}px`,a.appendChild(s);}return a}var ue=12,mt=6;function Qt(e,t){if(e.size!==t.size)return false;for(let[n,o]of e)if(t.get(n)!==o)return false;return true}var Be=8;function bo(e){let t=[],n=o=>{for(let r of o)if(r.kind==="paragraph")for(let a of r.runs)a.kind==="text"&&a.footnoteRefId!=null&&t.push({footnoteId:a.footnoteRefId,pmPos:a.pmStart??0});else if(r.kind==="table")for(let a of r.rows)for(let i of a.cells)n(i.blocks);else r.kind==="textBox"&&n(r.content);};return n(e),t}function Me(e,t){let n=new Map;if(t.length===0)return n;for(let o of t)for(let r of e){let a=false;for(let i of r.fragments){let d=i.pmStart??-1,l=i.pmEnd??-1;if(d>=0&&l>=0&&o.pmPos>=d&&o.pmPos<l){let m=n.get(r.number)??[];m.includes(o.footnoteId)||m.push(o.footnoteId),n.set(r.number,m),a=true;break}}if(a)break}return n}function en(e,t){if(e.length===0)return [{kind:"paragraph",id:`fn-empty-${t}`,runs:[{kind:"text",text:`${t} `,fontSize:Be,superscript:true}]}];let n=e.map(r=>{if(r.kind!=="paragraph")return r;let a=r;return {...a,runs:a.runs.map(i=>(i.kind==="text"||i.kind==="tab")&&i.fontSize==null?{...i,fontSize:Be}:i)}}),o=n[0];if(o.kind==="paragraph"){let r={kind:"text",text:`${t} `,fontSize:Be,superscript:true};n[0]={...o,runs:[r,...o.runs]};}return n}function tn(e,t,n,o){let r=chunkBUCOTKYY_js.c(e.content,{styles:o.styles??void 0,theme:o.theme??null,defaultTabStopTwips:o.defaultTabStopTwips??null}),a=chunkFQS436KN_js.c(r,{theme:o.theme??void 0}),i=en(a,t),d=o.measureBlocks(i,n),l=d.reduce((m,s)=>s.kind==="paragraph"||s.kind==="table"?m+s.totalHeight:s.kind==="image"||s.kind==="textBox"?m+s.height:m,0);return {id:e.id,displayNumber:t,blocks:i,measures:d,height:l}}function xo(e,t,n,o){let r=new Map,a=new Map;for(let l of e)(l.noteType==="normal"||l.noteType==null)&&a.set(l.id,l);let i=1,d=new Set;for(let l of t){if(d.has(l.footnoteId))continue;d.add(l.footnoteId);let m=a.get(l.footnoteId);m&&(r.set(l.footnoteId,tn(m,i,n,o)),i++);}return r}function ut(e,t){let n=new Map;for(let[o,r]of e){let a=0;for(let i of r){let d=t.get(i);d&&(a+=d.height);}a>0&&(a+=ue,n.set(o,a));}return n}function So(e){let{blocks:t,measures:n,layoutOpts:o,footnoteRefs:r,footnoteContentMap:a,initialLayout:i}=e,d=Me(i.pages,r),l=ut(d,a);if(l.size===0)return {layout:i,pageFootnoteMap:d,converged:true};let m=i,s=false;for(let b=0;b<mt;b++){m=chunkT4RYVPAB_js.U(t,n,{...o,footnoteReservedHeights:l});let g=Me(m.pages,r),u=ut(g,a);if(d=g,Qt(l,u)){l=u,s=true;break}l=u;}s||(m=chunkT4RYVPAB_js.U(t,n,{...o,footnoteReservedHeights:l}),d=Me(m.pages,r),console.warn(`[docx-editor] footnote layout did not stabilize within ${mt} passes; settling with best-effort reservation. If footnotes appear misplaced, please file a bug with the document.`));for(let[b,g]of d){let u=m.pages.find(E=>E.number===b);u&&(u.footnoteIds=g);}return {layout:m,pageFootnoteMap:d,converged:s}}function ko(e,t,n){let o=new Map;if(!n?.package?.footnotes)return o;let r=new Map;for(let a of n.package.footnotes)a.noteType&&a.noteType!=="normal"||r.set(a.id,a);for(let[a,i]of e){let d=[];for(let l of i){let m=r.get(l);if(!m)continue;let s=t.get(l),b=s?.displayNumber??0;d.push({displayNumber:String(b),text:chunkLERLET2D_js.x(m),content:s});}d.length>0&&o.set(a,d);}return o}function nn(e,t,n,o){let r=o.createElement("div");r.className="layout-footnote-content",r.style.position="relative",r.style.width=`${t}px`,r.style.height=`${e.height}px`;let a=0;for(let i=0;i<e.blocks.length;i++){let d=e.blocks[i],l=e.measures[i];if(!(!d||!l)){if(d.kind==="paragraph"&&l.kind==="paragraph"){let m=d.attrs?.spacing?.before??0,s={blockId:d.id,width:t,height:l.totalHeight,pmStart:d.pmStart,pmEnd:d.pmEnd,fromLine:0,toLine:l.lines.length},b=O(s,d,l,{...n,section:"body",contentWidth:t,positioning:"absolute"},{document:o});b.style.top=`${a+m}px`,b.style.left="0",b.style.width=`${t}px`,b.style.height=`${l.totalHeight}px`,r.appendChild(b),a+=l.totalHeight;}else if(d.kind==="table"&&l.kind==="table"){let m={blockId:d.id,width:l.totalWidth,height:l.totalHeight,pmStart:d.pmStart,pmEnd:d.pmEnd,fromRow:0,toRow:l.rows.length},s=Q(m,d,l,{...n,section:"body",contentWidth:t,positioning:"absolute"},{document:o});s.style.top=`${a}px`,s.style.left="0",r.appendChild(s),a+=l.totalHeight;}else if(d.kind==="image"&&l.kind==="image"){let m={blockId:d.id,width:l.width,height:l.height,pmStart:d.pmStart,pmEnd:d.pmEnd},s=Z(m,d,l,{...n},{document:o});s.style.top=`${a}px`,s.style.left="0",r.appendChild(s),a+=l.height;}else if(d.kind==="textBox"&&l.kind==="textBox"){let m={blockId:d.id,width:l.width,height:l.height,pmStart:d.pmStart,pmEnd:d.pmEnd},s=ee(m,d,l,{...n,section:"body",contentWidth:t,positioning:"absolute"},{document:o});s.style.top=`${a}px`,s.style.left="0",r.appendChild(s),a+=l.height;}}}return r}function on(e,t){let n=t.createElement("div");n.style.fontSize="10px",n.style.lineHeight="1.3",n.style.marginBottom="4px",n.style.color="#000";let o=t.createElement("sup");o.textContent=e.displayNumber,o.style.fontSize="7px",o.style.marginRight="2px",n.appendChild(o);let r=t.createTextNode(" "+e.text);return n.appendChild(r),n}function ht(e){let t=ue;for(let n of e)n.content&&(t+=n.content.height);return t}function yt(e,t,n,o){let r=o.createElement("div");r.className="layout-footnote-area",r.style.width=`${t}px`;let a=o.createElement("div"),i=.5,d=(ue-i)/2;a.style.width="33%",a.style.height=`${i}px`,a.style.backgroundColor="#000",a.style.marginBottom=`${d}px`,a.style.marginTop=`${d}px`,r.appendChild(a);for(let l of e)r.appendChild(l.content?nn(l.content,t,n,o):on(l,o));return r}function $e(e,t,n){let o={pageNumber:e.number,totalPages:t,section:"body",resolvedCommentIds:n.resolvedCommentIds},r={...n};if(n.titlePg&&e.number===1&&(r.headerContent=n.firstPageHeaderContent,r.footerContent=n.firstPageFooterContent),n.footnotesByPage){let a=n.footnotesByPage.get(e.number);a&&a.length>0&&(r.footnoteArea=a);}return {context:o,pageOptions:r}}function bt(e){let t=[];t.push(`s:${e.size.w},${e.size.h}`),t.push(`m:${e.margins.top},${e.margins.right},${e.margins.bottom},${e.margins.left}`),t.push(`n:${e.number}`),e.footnoteReservedHeight&&t.push(`fn:${e.footnoteReservedHeight}`);for(let n of e.fragments){let o=`${n.kind}:${n.blockId},${n.x},${n.y},${n.width},${n.height}`;n.pmStart!==void 0&&(o+=`,ps:${n.pmStart}`),n.pmEnd!==void 0&&(o+=`,pe:${n.pmEnd}`),n.kind==="paragraph"?o+=`,fl:${n.fromLine},tl:${n.toLine}`:n.kind==="table"&&(o+=`,fr:${n.fromRow},tr:${n.toRow}`),t.push(o);}return t.join("|")}function rn(e){let t=[];return e.headerContent&&t.push(`hdr:${e.headerContent.blocks.length},${e.headerContent.height},${e.headerContent.visualTop??0},${e.headerContent.visualBottom??e.headerContent.height}`),e.footerContent&&t.push(`ftr:${e.footerContent.blocks.length},${e.footerContent.height},${e.footerContent.visualTop??0},${e.footerContent.visualBottom??e.footerContent.height}`),e.firstPageHeaderContent&&t.push(`fp-hdr:${e.firstPageHeaderContent.blocks.length},${e.firstPageHeaderContent.height}`),e.firstPageFooterContent&&t.push(`fp-ftr:${e.firstPageFooterContent.blocks.length},${e.firstPageFooterContent.height}`),e.titlePg&&t.push("titlePg"),e.theme&&t.push(`thm:${e.theme.name??"default"}`),e.pageBorders&&t.push(`pb:${JSON.stringify(e.pageBorders)}`),e.headerDistance!==void 0&&t.push(`hd:${e.headerDistance}`),e.footerDistance!==void 0&&t.push(`fd:${e.footerDistance}`),t.join("|")}function an(e,t){e.style.display="flex",e.style.flexDirection="column",e.style.alignItems="center",e.style.gap=`${t}px`,e.style.padding=`${t}px`,e.style.backgroundColor="var(--doc-bg, #f8f9fa)";}var he=2,sn=8;function ln(e,t,n={}){let o=e.length,r=n.pageGap??24,a=t,i=a.__pageRenderState,d=rn(n),l=o>=sn;if(i&&i.optionsHash===d&&l){let f=i.pageStates,w=i.pageDataMap,F=a.__pageObserver,c=[];for(let S of e)c.push(bt(S));let x=i.totalPages!==o,T=Math.min(f.length,e.length);for(let S=0;S<T;S++){let k=f[S],p=c[S];if(k.fingerprint===p&&!x){let C=w.get(k.element);C&&(C.page=e[S]);continue}let h=k.element,R=w.get(h);R&&(R.page=e[S],R.rendered&&dn(h,w,o,n)),k.fingerprint=p,se(h,e[S].size.w,e[S].size.h,n),h.dataset.pageNumber=String(e[S].number);}if(e.length>f.length){let S=n.document??document;for(let k=f.length;k<e.length;k++){let p=e[k],h=S.createElement("div");h.className=n.pageClassName??W.page,h.dataset.pageNumber=String(p.number),h.dataset.pageIndex=String(k),se(h,p.size.w,p.size.h,n),t.appendChild(h),f.push({element:h,fingerprint:c[k]}),w.set(h,{page:p,index:k,rendered:false}),F&&F.observe(h);}}if(e.length<f.length){for(let S=f.length-1;S>=e.length;S--){let k=f[S].element;F&&F.unobserve(k),w.delete(k),t.removeChild(k);}f.length=e.length;}for(let S=0;S<f.length;S++){let k=w.get(f[S].element);k&&(k.index=S);}return i.totalPages=o,i.currentOptions=n,"incremental"}let s=a.__pageObserver;s&&(s.disconnect(),a.__pageObserver=void 0),t.innerHTML="",a.__pageRenderState=void 0,an(t,r);let b=[],g=[];for(let f=0;f<e.length;f++){let w=e[f];if(g.push(bt(w)),l){let c=(n.document??document).createElement("div");c.className=n.pageClassName??W.page,c.dataset.pageNumber=String(w.number),c.dataset.pageIndex=String(f),se(c,w.size.w,w.size.h,n),t.appendChild(c),b.push(c);}else {let{context:F,pageOptions:c}=$e(w,o,n),x=ye(w,F,c);t.appendChild(x),b.push(x);}}if(!l)return "full";let u=new Map;for(let f=0;f<e.length;f++)u.set(b[f],{page:e[f],index:f,rendered:false});let E=new IntersectionObserver(f=>{let w=a.__pageRenderState;if(!w)return;let{currentOptions:F,totalPages:c,pageDataMap:x}=w;for(let p of f){let h=p.target,R=x.get(h);if(R&&p.isIntersecting){ae(h,x,c,F);for(let C=-he;C<=he;C++){let I=R.index+C;I>=0&&I<w.pageStates.length&&I!==R.index&&ae(w.pageStates[I].element,x,c,F);}}}let T=window.innerHeight,S=T*3,k=new Set;for(let[p,h]of x){if(!h.rendered)continue;let R=p.getBoundingClientRect();R.bottom>-S&&R.top<T+S&&k.add(h.index);}for(let[p,h]of x){if(!h.rendered)continue;let R=false;for(let C of k)if(Math.abs(h.index-C)<=he+1){R=true;break}!R&&k.size>0&&cn(p,x);}},{root:null,rootMargin:"1500px 0px 1500px 0px"});for(let f of b)E.observe(f);a.__pageObserver=E,a.__pageRenderState={pageStates:b.map((f,w)=>({element:f,fingerprint:g[w]})),totalPages:o,optionsHash:d,pageDataMap:u,currentOptions:n};let y=Math.min(e.length,he+3);for(let f=0;f<y;f++)ae(b[f],u,o,n);return "full"}function ae(e,t,n,o){let r=t.get(e);if(!r||r.rendered)return;let{context:a,pageOptions:i}=$e(r.page,n,o),d=ye(r.page,a,i);for(;d.firstChild;)e.appendChild(d.firstChild);r.rendered=true;}function dn(e,t,n,o){let r=t.get(e);if(!r)return;let{context:a,pageOptions:i}=$e(r.page,n,o),l=ye(r.page,a,i).querySelector(`.${W.content}`),m=e.querySelector(`.${W.content}`);l&&m?e.replaceChild(l,m):(e.innerHTML="",r.rendered=false,ae(e,t,n,o));}function cn(e,t){let n=t.get(e);!n||!n.rendered||(e.innerHTML="",n.rendered=false);}function pn(e){let n=e.__pageRenderState;if(!n)return 0;let{pageStates:o,totalPages:r,currentOptions:a,pageDataMap:i}=n,d=0;for(let{element:l}of o){let m=i.get(l);!m||m.rendered||(ae(l,i,r,a),d++);}return d}var W={page:"layout-page",content:"layout-page-content",header:"layout-page-header",footer:"layout-page-footer"};function se(e,t,n,o){e.style.position="relative",e.style.width=`${t}px`,e.style.height=`${n}px`,e.style.backgroundColor=o.backgroundColor??"#ffffff",e.style.overflow="hidden",e.style.fontFamily=chunkN3Y5BUKV_js.a("Calibri").cssFallback,e.style.fontSize=`${1056/72}px`,e.style.color="#000000",o.showBorders&&(e.style.border="1px solid #ccc"),o.showShadow&&(e.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");}function fn(e,t){switch(t??"allPages"){case "firstPage":return e===1;case "notFirstPage":return e!==1;default:return true}}function be(e){return e?.space!==void 0?chunk4Q2IP5FW_js.i(e.space):0}function xe(e,t,n,o){if(!t||t.style==="none"||t.style==="nil")return;let r=chunkBHBOAP6Z_js.c(t,n,o);for(let[l,m]of Object.entries(r))e.style[l]=String(m);let a=`border${n}Style`,i=`border${n}Width`;if(e.style[a]==="double"){let l=parseFloat(e.style[i]);(!Number.isFinite(l)||l<3)&&(e.style[i]="3px");}}function gn(e,t,n){let o=t.pageBorders;if(!o||!fn(e.number,o.display)||![o.top,o.bottom,o.left,o.right].some(b=>b&&b.style!=="none"&&b.style!=="nil"))return null;let a=o.offsetFrom??"text",i=be(o.top),d=be(o.right),l=be(o.bottom),m=be(o.left),s=n.createElement("div");return s.className="layout-page-border",s.style.position="absolute",s.style.pointerEvents="none",s.style.boxSizing="border-box",s.style.zIndex=o.zOrder==="back"?"0":"20",a==="page"?(s.style.top=`${i}px`,s.style.right=`${d}px`,s.style.bottom=`${l}px`,s.style.left=`${m}px`):(s.style.top=`${Math.max(0,e.margins.top-i)}px`,s.style.right=`${Math.max(0,e.margins.right-d)}px`,s.style.bottom=`${Math.max(0,e.margins.bottom-l)}px`,s.style.left=`${Math.max(0,e.margins.left-m)}px`),xe(s,o.top,"Top",t.theme),xe(s,o.bottom,"Bottom",t.theme),xe(s,o.left,"Left",t.theme),xe(s,o.right,"Right",t.theme),s}function mn(e,t){let n=t.margins;e.style.position="absolute",e.style.top=`${n.top}px`,e.style.left=`${n.left}px`,e.style.right=`${n.right}px`,e.style.bottom=`${n.bottom}px`,e.style.overflow="visible";}function un(e,t,n){e.style.position="absolute",e.style.left=`${t.x-n.left}px`;let o=t.y-n.top;e.style.top=`${t.kind==="table"?Math.round(o):o}px`,e.style.width=`${t.width}px`,"height"in t&&t.kind!=="table"&&(e.style.height=`${t.height}px`);}function hn(e,t,n,o){let r=[];for(let a of e.runs){if(a.kind!=="image")continue;let i=a;if(!chunkTURYWKNS_js.c(i))continue;let d=i.distTop??0,l=i.distBottom??0,m=i.distLeft??12,s=i.distRight??12,{x:b,y:g,side:u}=chunkTURYWKNS_js.g(i,t,n,o);r.push({src:i.src,width:i.width,height:i.height,alt:i.alt,transform:i.transform,side:u,x:b,y:g,distTop:d,distBottom:l,distLeft:m,distRight:s,pmStart:i.pmStart,pmEnd:i.pmEnd,wrapText:chunkTURYWKNS_js.e(i.cssFloat),wrapType:i.wrapType,cropTop:i.cropTop,cropRight:i.cropRight,cropBottom:i.cropBottom,cropLeft:i.cropLeft,opacity:i.opacity});}return r}function ye(e,t,n={}){let o=n.document??document,r=o.createElement("div");if(r.className=n.pageClassName??W.page,r.dataset.pageNumber=String(e.number),se(r,e.size.w,e.size.h,n),n.watermark){let c=pt(n.watermark,e,o);c&&r.appendChild(c);}let a=gn(e,n,o);a&&n.pageBorders?.zOrder==="back"&&r.appendChild(a);let i=o.createElement("div");i.className=W.content,mn(i,e);let d=chunkTURYWKNS_js.f(e),l=d.contentWidth,m=[],s=[];for(let c of e.fragments)if(c.kind==="paragraph"&&n.blockLookup){let x=n.blockLookup.get(String(c.blockId));if(x?.block.kind==="paragraph"){let T=x.block,S=c.y-e.margins.top,k=hn(T,S,l,d);m.push(...k);}}for(let c of m)chunkTURYWKNS_js.a(c)&&s.push({side:c.side,x:c.x,y:c.y,width:c.width,height:c.height,distTop:c.distTop,distBottom:c.distBottom,distLeft:c.distLeft,distRight:c.distRight,wrapText:c.wrapText,wrapType:c.wrapType});if(n.blockLookup)for(let c of e.fragments){if(c.kind!=="table")continue;let x=n.blockLookup.get(String(c.blockId));if(x?.block.kind!=="table")continue;let S=x.block.floating;if(!S)continue;let k=c.x-e.margins.left,p=c.y-e.margins.top,h=S.topFromText??0,R=S.bottomFromText??0,C=S.leftFromText??12,I=S.rightFromText??12,v=k<l/2?"left":"right";s.push({side:v,x:k,y:p,width:c.width,height:c.height,distTop:h,distBottom:R,distLeft:C,distRight:I});}if(n.blockLookup)for(let c of e.fragments){if(c.kind!=="textBox")continue;let x=n.blockLookup.get(String(c.blockId));if(x?.block.kind!=="textBox")continue;let T=x.block;if(!chunkT4RYVPAB_js.I(T))continue;let S=c.y-e.margins.top,k=chunkTURYWKNS_js.g({width:c.width,height:c.height,position:T.position,cssFloat:T.cssFloat},S,l,d);c.x=e.margins.left+k.x,c.y=e.margins.top+k.y,!(!chunkT4RYVPAB_js.J(T)&&!chunkT4RYVPAB_js.K(T))&&s.push({side:k.side,x:k.x,y:k.y,width:c.width,height:c.height,distTop:T.distTop??0,distBottom:T.distBottom??0,distLeft:T.distLeft??12,distRight:T.distRight??12,wrapText:T.wrapText,wrapType:T.wrapType});}let b=s.length>0?chunkT4RYVPAB_js.t(s,l):[],g=m.filter(chunkTURYWKNS_js.b),u=m.filter(c=>!chunkTURYWKNS_js.b(c));if(g.length>0){let c=q(g,o,{layerClass:"layout-floating-images-layer",itemClass:"layout-page-floating-image",sizing:"inset0",layerMode:"behind"});i.appendChild(c);}let E=c=>{if(c.kind!=="paragraph"||!n.blockLookup||!c.blockId)return;let x=n.blockLookup.get(String(c.blockId));if(x?.block.kind==="paragraph")return x.block.attrs?.borders},y,f=new Map,w=c=>!n.blockLookup||!c.blockId?[]:n.blockLookup.get(String(c.blockId))?.block.sdtGroups??[],F=(c,x)=>{if(x.length===0)return;let T=x[x.length-1];c.classList.add("layout-block-sdt"),c.dataset.sdtGroupId=T.id,c.dataset.sdtType=T.sdtType,c.dataset.sdtDepth=String(x.length),T.tag!=null&&(c.dataset.sdtTag=T.tag),T.alias!=null&&(c.dataset.sdtAlias=T.alias),T.lock!=null&&(c.dataset.sdtLock=T.lock);};for(let c=0;c<e.fragments.length;c++){let x=e.fragments[c],T,S={...t,section:"body",contentWidth:l},k=x.y-e.margins.top;if(n.blockLookup&&x.blockId){let p=n.blockLookup.get(String(x.blockId));if(x.kind==="paragraph"&&p?.block.kind==="paragraph"&&p?.measure.kind==="paragraph"){let h=p.block,R=c+1<e.fragments.length?E(e.fragments[c+1]):void 0,C=String(x.blockId),I=f.get(C);I||(I=new Set,f.set(C,I));let v=p.measure;b.length>0&&(v=chunkT4RYVPAB_js.z(h,l,{floatingZones:b,paragraphYOffset:k})),T=O(x,h,v,S,{document:o,prevBorders:y,nextBorders:R,renderedInlineImageKeys:I}),y=h.attrs?.borders;}else x.kind==="table"&&p?.block.kind==="table"&&p?.measure.kind==="table"?(T=Q(x,p.block,p.measure,S,{document:o}),y=void 0):x.kind==="image"&&p?.block.kind==="image"&&p?.measure.kind==="image"?(T=Z(x,p.block,p.measure,S,{document:o}),y=void 0):x.kind==="textBox"&&p?.block.kind==="textBox"&&p?.measure.kind==="textBox"?(T=ee(x,p.block,p.measure,S,{document:o}),y=void 0):(T=Te(x,S,{document:o}),y=void 0);}else T=Te(x,S,{document:o}),y=void 0;un(T,x,{left:e.margins.left,top:e.margins.top}),F(T,w(x)),i.appendChild(T);}if(Je(e,i,l,w,o),u.length>0){let c=q(u,o,{layerClass:"layout-floating-images-layer",itemClass:"layout-page-floating-image",sizing:"inset0",layerMode:"front"});i.appendChild(c);}if(e.columns&&e.columns.separator&&e.columns.count>1){let c=e.columns.count,x=e.columns.gap,T=(l-(c-1)*x)/c,S=e.size.h-e.margins.top-e.margins.bottom;for(let k=0;k<c-1;k++){let p=(k+1)*T+k*x+x/2,h=o.createElement("div");h.style.position="absolute",h.style.left=`${p}px`,h.style.top="0",h.style.height=`${S}px`,h.style.width="0.5px",h.style.backgroundColor="#000",h.style.pointerEvents="none",i.appendChild(h);}}if(n.footnoteArea&&n.footnoteArea.length>0){let c=yt(n.footnoteArea,l,t,o);c.style.position="absolute";let x=Math.max(e.footnoteReservedHeight??0,ht(n.footnoteArea)),T=e.size.h-e.margins.bottom-e.margins.top;c.style.top=`${Math.max(-e.margins.top,T-x)}px`,c.style.left="0",c.style.right="0",i.appendChild(c);}r.appendChild(i);{let x=n.headerDistance??e.margins.header??48,T=e.size.w-e.margins.left-e.margins.right,S=Math.max(e.margins.top-x,48),k=n.headerContent?.visualTop??0,p=n.headerContent?.visualBottom??n.headerContent?.height??0,h=Math.max(p-k,24),R=p>S,C=o.createElement("div");C.className=W.header,C.style.position="absolute",C.style.top=`${x+k}px`,C.style.left=`${e.margins.left}px`,C.style.right=`${e.margins.right}px`,C.style.width=`${T}px`,C.style.height=`${h}px`,C.style.minHeight=`${h}px`;let I=!R;if(n.headerContent&&n.headerContent.blocks.length>0){let v={flowTop:x,flowLeft:e.margins.left,contentWidth:T,pageWidth:e.size.w,pageHeight:e.size.h,margins:e.margins},L=Pe(n.headerContent,{...t,section:"header",contentWidth:T},n,v);L.style.top=`${-k}px`,L.querySelector("img")&&(I=false),C.appendChild(L);}I&&(C.style.maxHeight=`${S}px`,C.style.overflow="hidden"),r.appendChild(C);}{let x=n.footerDistance??e.margins.footer??48,T=e.size.w-e.margins.left-e.margins.right,S=Math.max(e.margins.bottom-x,48),k=n.footerContent?.visualTop??0,p=n.footerContent?.visualBottom??n.footerContent?.height??0,h=Math.max(p-k,24),R=h>S,C=o.createElement("div");C.className=W.footer,C.style.position="absolute",C.style.top=`${e.size.h-x-h}px`,C.style.left=`${e.margins.left}px`,C.style.right=`${e.margins.right}px`,C.style.width=`${T}px`,C.style.height=`${h}px`,C.style.minHeight=`${h}px`;let I=!R;if(n.footerContent&&n.footerContent.blocks.length>0){let v={flowTop:e.size.h-x-(n.footerContent?.height??0),flowLeft:e.margins.left,contentWidth:T,pageWidth:e.size.w,pageHeight:e.size.h,margins:e.margins},L=Pe(n.footerContent,{...t,section:"footer",contentWidth:T},n,v);L.style.top=`${-k}px`,L.querySelector("img")&&(I=false),C.appendChild(L);}I&&(C.style.maxHeight=`${S}px`,C.style.overflow="hidden"),r.appendChild(C);}return a&&n.pageBorders?.zOrder!=="back"&&r.appendChild(a),r}exports.A=gt;exports.B=ln;exports.C=pn;exports.D=W;exports.E=se;exports.F=ye;exports.a=ue;exports.b=mt;exports.c=Qt;exports.d=bo;exports.e=Me;exports.f=en;exports.g=tn;exports.h=xo;exports.i=ut;exports.j=So;exports.k=ko;exports.l=yn;exports.m=bn;exports.n=U;exports.o=Te;exports.p=Qe;exports.q=Z;exports.r=at;exports.s=me;exports.t=O;exports.u=q;exports.v=N;exports.w=Q;exports.x=jt;exports.y=ee;exports.z=ve;
@@ -1 +0,0 @@
1
- 'use strict';var chunkFQS436KN_js=require('./chunk-FQS436KN.js'),chunkT4RYVPAB_js=require('./chunk-T4RYVPAB.js'),chunkBUCOTKYY_js=require('./chunk-BUCOTKYY.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js');function Q(e,n){if(e.pages.length===0)return null;let a=e.pageGap??0,r=0,t=null,o=1/0;for(let s=0;s<e.pages.length;s++){let i=e.pages[s],l=i.size?.h??e.pageSize.h,f=r,u=f+l;if(n.y>=f&&n.y<u)return {pageIndex:s,page:i,pageY:n.y-f};let c=f+l/2,p=Math.abs(n.y-c);p<o&&(o=p,t=s),r=u+a;}if(t!==null){let s=e.pages[t],i=D(e,t);return {pageIndex:t,page:s,pageY:Math.max(0,Math.min(n.y-i,s.size?.h??e.pageSize.h))}}return null}function D(e,n){let a=e.pageGap??0,r=0;for(let t=0;t<n&&t<e.pages.length;t++){let s=e.pages[t].size?.h??e.pageSize.h;r+=s+a;}return r}function Ee(e,n){return Q(e,{y:n})?.pageIndex??null}function Z(e,n){return e.findIndex(a=>a.id===n)}function Le(e,n){let a=0;for(let r=e.fromLine;r<e.toLine&&r<n.lines.length;r++)a+=n.lines[r].lineHeight;return a}function fe(e,n,a,r){let t=[...e.page.fragments].sort((o,s)=>{let i=o.y-s.y;return Math.abs(i)>.5?i:o.x-s.x});for(let o of t){let s=Z(n,o.blockId);if(s===-1)continue;let i=n[s],l=a[s];if(!i||!l)continue;let f;if(o.kind==="paragraph"){if(i.kind!=="paragraph"||l.kind!=="paragraph")continue;f=Le(o,l);}else if(o.kind==="table")f=o.height;else if(o.kind==="image")f=o.height;else continue;let u=r.x>=o.x&&r.x<=o.x+o.width,c=r.y>=o.y&&r.y<=o.y+f;if(u&&c)return {fragment:o,block:i,measure:l,pageIndex:e.pageIndex,localX:r.x-o.x,localY:r.y-o.y}}return null}function Ce(e,n,a,r){for(let t of e.page.fragments){if(t.kind!=="image")continue;let o=Z(n,t.blockId);if(o===-1)continue;let s=n[o],i=a[o];if(!s||!i)continue;let l=r.x>=t.x&&r.x<=t.x+t.width,f=r.y>=t.y&&r.y<=t.y+t.height;if(l&&f)return {fragment:t,block:s,measure:i,pageIndex:e.pageIndex,localX:r.x-t.x,localY:r.y-t.y}}return null}function de(e,n,a,r){for(let t of e.page.fragments){if(t.kind!=="table")continue;let o=t,s=r.x>=o.x&&r.x<=o.x+o.width,i=r.y>=o.y&&r.y<=o.y+o.height;if(!s||!i)continue;let l=Z(n,o.blockId);if(l===-1)continue;let f=n[l],u=a[l];if(!f||f.kind!=="table"||!u||u.kind!=="table")continue;let c=f,p=u,g=r.x-o.x,x=r.y-o.y,d=o.headerRowCount??0,h=d>0&&o.continuesFromPrev?chunkT4RYVPAB_js.V(p,d):0,m=0,b=-1;if(p.rows.length===0||c.rows.length===0)continue;if(h>0&&x<h){let T=0;for(let H=0;H<d&&H<p.rows.length;H++){let C=p.rows[H];if(x>=T&&x<T+C.height){b=H;break}T+=C.height;}b===-1&&(b=0);}else {let T=x-h;for(let H=o.fromRow;H<o.toRow&&H<p.rows.length;H++){let C=p.rows[H];if(T>=m&&T<m+C.height){b=H;break}m+=C.height;}}if(b===-1&&(b=Math.min(o.toRow-1,p.rows.length-1),b<o.fromRow))continue;let k=p.rows[b],P=c.rows[b];if(!k||!P)continue;let M=0,y=-1;if(k.cells.length===0||P.cells.length===0)continue;for(let T=0;T<k.cells.length;T++){let H=k.cells[T];if(g>=M&&g<M+H.width){y=T;break}M+=H.width;}if(y===-1&&(y=k.cells.length-1,y<0))continue;let w=k.cells[y],R=P.cells[y];if(!w||!R)continue;let F=0;if(h>0&&b<d)for(let T=0;T<b;T++)F+=p.rows[T]?.height??0;else {F=h;for(let T=o.fromRow;T<b;T++)F+=p.rows[T]?.height??0;}let I=0;for(let T=0;T<y;T++)I+=k.cells[T]?.width??0;let v,S;if(R.blocks&&R.blocks.length>0){let T=R.blocks[0],H=w.blocks[0];T.kind==="paragraph"&&H?.kind==="paragraph"&&(v=T,S=H);}let L=g-I,E=x-F;return {fragment:o,block:c,measure:p,pageIndex:e.pageIndex,rowIndex:b,colIndex:y,cellBlock:v,cellMeasure:S,cellLocalX:Math.max(0,L),cellLocalY:Math.max(0,E)}}return null}function De(e,n,a,r){let t={pageHit:null,fragmentHit:null,tableCellHit:null};if(t.pageHit=Q(e,r),!t.pageHit)return t;let o=D(e,t.pageHit.pageIndex),s={x:r.x,y:r.y-o};return t.fragmentHit=fe(t.pageHit,n,a,s),t.fragmentHit?.fragment.kind==="table"&&(t.tableCellHit=de(t.pageHit,n,a,s)),t}function Ae(e){if(e.pages.length===0)return 0;let n=e.pageGap??0,a=0;for(let r=0;r<e.pages.length;r++){let t=e.pages[r];a+=t.size?.h??e.pageSize.h,r<e.pages.length-1&&(a+=n);}return a}function _e(e,n){return D(e,n)}function Oe(e,n){if(n<0||n>=e.pages.length)return null;let a=D(e,n),t=e.pages[n].size?.h??e.pageSize.h;return {top:a,bottom:a+t}}function ee(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function he(e,n){let a=[];for(let r=n.fromRun;r<=n.toRun&&r<e.runs.length;r++){let t=e.runs[r];if(t){if(t.kind==="tab"||t.kind==="image"||t.kind==="lineBreak"){a.push(t);continue}if(t.kind==="text"){let o=t.text??"",s=r===n.fromRun,i=r===n.toRun;if(s||i){let l=s?n.fromChar:0,f=i?n.toChar:o.length,u=o.slice(l,f);u.length>0&&a.push({...t,text:u});}else a.push(t);}}}return a}function me(e,n){let a,r,t=e.pmStart??0,o=0;for(let s=0;s<e.runs.length&&s<=n.toRun;s++){let i=e.runs[s];i&&(s<n.fromRun?i.kind==="text"?o+=(i.text??"").length:(i.kind==="tab"||i.kind==="lineBreak"||i.kind==="image")&&(o+=1):s===n.fromRun&&(o+=n.fromChar,a=t+o,i.kind==="text"&&(o=n.fromChar)));}if(a!==void 0){let s=0;for(let i=n.fromRun;i<=n.toRun&&i<e.runs.length;i++){let l=e.runs[i];if(l)if(l.kind==="text"){let f=l.text??"",u=i===n.fromRun?n.fromChar:0,c=i===n.toRun?n.toChar:f.length;s+=c-u;}else (l.kind==="tab"||l.kind==="lineBreak"||l.kind==="image")&&(s+=1);}r=a+s;}return {pmStart:a,pmEnd:r}}function Xe(e,n,a,r){let t=0;for(let o=a;o<r&&o<e.lines.length;o++){let i=e.lines[o].lineHeight;if(n>=t&&n<t+i)return o;t+=i;}return r>a?Math.min(r-1,e.lines.length-1):null}function ve(e,n,a,r){let{pmStart:t,pmEnd:o}=me(e,n);if(t===void 0||o===void 0)return {charOffset:0,pmPosition:e.pmStart??0};let s=e.attrs?.alignment??"left",i=0;s==="center"?i=Math.max(0,(r-n.width)/2):s==="right"&&(i=Math.max(0,r-n.width));let l=Math.max(0,a-i);if(l<=0)return {charOffset:0,pmPosition:t};let f=he(e,n);if(f.length===0)return {charOffset:0,pmPosition:t};let u=0,c=0;for(let g of f){if(g.kind==="tab"){let x=g.width??48,d=u+x;if(l<=d){let h=u+x/2;return l<h?{charOffset:c,pmPosition:t+c}:{charOffset:c+1,pmPosition:t+c+1}}u=d,c+=1;continue}if(g.kind==="image"){let x=g.width,d=u+x;if(l<=d){let h=u+x/2;return l<h?{charOffset:c,pmPosition:t+c}:{charOffset:c+1,pmPosition:t+c+1}}u=d,c+=1;continue}if(g.kind==="lineBreak"){if(l>=u)return {charOffset:c,pmPosition:t+c};c+=1;continue}if(g.kind==="text"){let x=g.text??"";if(x.length===0)continue;let d=ee(g),h=chunkT4RYVPAB_js.k(x,d),m=u+h.width;if(l<=m){let b=l-u,k=chunkT4RYVPAB_js.l(b,h.charWidths),P=c+k;return {charOffset:P,pmPosition:t+P}}u=m,c+=x.length;}}return {charOffset:o-t,pmPosition:o}}function te(e){let{fragment:n,block:a,measure:r,localX:t,localY:o}=e;if(n.kind!=="paragraph"||a.kind!=="paragraph"||r.kind!=="paragraph")return null;let s=n,i=a,l=r,f=Xe(l,o,s.fromLine,s.toLine);if(f===null)return null;let u=l.lines[f];if(!u)return null;let c=0;for(let k=s.fromLine;k<f;k++)c+=l.lines[k]?.lineHeight??0;let p=i.attrs?.indent,g=p?.left??0,x=p?.right??0,d=Math.max(0,n.width-g-x),h=t-g,{charOffset:m,pmPosition:b}=ve(i,u,h,d);return {pmPosition:b,charOffset:m,lineIndex:f}}function ge(e){let{cellBlock:n,cellMeasure:a,cellLocalX:r,cellLocalY:t}=e;if(!n||!a)return null;let o={fragment:{kind:"paragraph",blockId:n.id,x:0,y:0,width:a.lines.reduce((i,l)=>Math.max(i,l.width),100),fromLine:0,toLine:a.lines.length,height:a.totalHeight},block:n,measure:a,pageIndex:e.pageIndex,localX:r,localY:t};return te(o)?.pmPosition??null}function Ne(e,n){if(n)return ge(n);if(!e)return null;let{fragment:a}=e;return a.kind==="paragraph"?te(e)?.pmPosition??null:a.kind==="image"?a.pmStart??null:null}function pe(e,n,a,r){let t=e.pmStart??0,o=e.pmEnd??t;if(a<t||a>o)return null;let s=a-t;for(let i=0;i<n.lines.length;i++){let l=n.lines[i],{pmStart:f,pmEnd:u}=me(e,l);if(f===void 0||u===void 0)continue;let c=f-t,p=u-t;if(s>=c&&s<=p){let g=s-c,x=he(e,l),d=0,h=0;for(let m of x)if(m.kind==="tab"){if(g<=h+1)return g<=h?{x:d,lineIndex:i}:{x:d+(m.width??48),lineIndex:i};d+=m.width??48,h+=1;}else if(m.kind==="image"){if(g<=h+1)return g<=h?{x:d,lineIndex:i}:{x:d+m.width,lineIndex:i};d+=m.width,h+=1;}else if(m.kind==="lineBreak"){if(g<=h)return {x:d,lineIndex:i};h+=1;}else if(m.kind==="text"){let b=m.text??"";if(g<=h+b.length){let M=g-h,y=ee(m),w=chunkT4RYVPAB_js.k(b.slice(0,M),y);return {x:d+w.width,lineIndex:i}}let k=ee(m),P=chunkT4RYVPAB_js.k(b,k);d+=P.width,h+=b.length;}return {x:d,lineIndex:i}}}return null}function Ye(e,n,a,r,t,o,s){let i=pe(e,n,a);if(!i)return null;let l=e.attrs?.alignment??"left",f=e.attrs?.indent,u=f?.left??0,c=f?.right??0,p=Math.max(0,o-u-c),g=n.lines[i.lineIndex];if(!g)return null;let x=0;l==="center"?x=Math.max(0,(p-g.width)/2):l==="right"&&(x=Math.max(0,p-g.width));let d=0;for(let h=s;h<i.lineIndex;h++)d+=n.lines[h]?.lineHeight??0;return {x:r+u+x+i.x,y:t+d,height:g.lineHeight}}function be(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function ne(e,n){return e.findIndex(a=>a.id===n)}function U(e,n){let r=(e.pmStart??0)+1,t=0,o;for(let l=0;l<e.runs.length&&l<=n.toRun;l++){let f=e.runs[l];if(f){if(l<n.fromRun)f.kind==="text"?t+=(f.text??"").length:t+=1;else if(l===n.fromRun){t+=n.fromChar,o=r+t;break}}}o===void 0&&(o=r);let s=0;for(let l=n.fromRun;l<=n.toRun&&l<e.runs.length;l++){let f=e.runs[l];if(f)if(f.kind==="text"){let u=f.text??"",c=l===n.fromRun?n.fromChar:0,p=l===n.toRun?n.toChar:u.length;s+=p-c;}else s+=1;}let i=o+s;return {pmStart:o,pmEnd:i}}function xe(e,n,a,r){let t=[];for(let o=0;o<n.lines.length;o++){let s=n.lines[o],i=U(e,s);i.pmStart===void 0||i.pmEnd===void 0||i.pmEnd>a&&i.pmStart<r&&t.push({line:s,index:o});}return t}function G(e,n,a){let r=U(e,n);return r.pmStart===void 0?0:Math.max(0,a-r.pmStart)}function W(e,n,a,r){let t=0,o=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 l=i.width??48;if(o+1>=a)return a<=o?t:t+l;t+=l,o+=1;continue}if(i.kind==="image"){let l=i.width;if(o+1>=a)return a<=o?t:t+l;t+=l,o+=1;continue}if(i.kind==="lineBreak"){if(a<=o)return t;o+=1;continue}if(i.kind==="text"){let l=i.text??"",f=s===n.fromRun,u=s===n.toRun,c=f?n.fromChar:0,p=u?n.toChar:l.length,g=l.slice(c,p);if(o+g.length>=a){let h=a-o,m=be(i),b=chunkT4RYVPAB_js.k(g.slice(0,h),m);return t+b.width}let x=be(i),d=chunkT4RYVPAB_js.k(g,x);t+=d.width,o+=g.length;}}}return t}function j(e,n){let a=0;for(let r=0;r<n&&r<e.lines.length;r++)a+=e.lines[r].lineHeight;return a}function ze(e,n,a,r,t){if(r===t)return [];let o=Math.min(r,t),s=Math.max(r,t),i=[];for(let l=0;l<e.pages.length;l++){let f=e.pages[l],u=D(e,l);for(let c of f.fragments){if(c.kind==="paragraph"){let p=ne(n,c.blockId);if(p===-1)continue;let g=n[p],x=a[p];if(!g||g.kind!=="paragraph"||!x||x.kind!=="paragraph")continue;let d=g,h=x,m=c,b=xe(d,h,o,s);for(let{line:k,index:P}of b){if(P<m.fromLine||P>=m.toLine)continue;let M=U(d,k);if(M.pmStart===void 0||M.pmEnd===void 0)continue;let y=Math.max(M.pmStart,o),w=Math.min(M.pmEnd,s);if(y>=w)continue;let R=G(d,k,y),F=G(d,k,w),B=d.attrs?.indent,I=B?.left??0,v=B?.right??0,S=Math.max(0,c.width-I-v),L=W(d,k,R),E=W(d,k,F),T=d.attrs?.alignment??"left",H=0;T==="center"?H=Math.max(0,(S-k.width)/2):T==="right"&&(H=Math.max(0,S-k.width));let C=j(h,P)-j(h,m.fromLine),_=c.x+I+H+Math.min(L,E),Y=Math.max(1,Math.abs(E-L)),z=c.y+C;i.push({x:_,y:z+u,width:Y,height:k.lineHeight,pageIndex:l});}}if(c.kind==="table"){let p=ne(n,c.blockId);if(p===-1)continue;let g=n[p],x=a[p];if(!g||g.kind!=="table"||!x||x.kind!=="table")continue;let d=g,h=x,m=c,b=[],k=0;for(let F=0;F<h.rows.length;F++)b.push(Math.round(k)),k+=h.rows[F]?.height??0;b.push(Math.round(k));let P=m.headerRowCount??0,M=P>0&&m.continuesFromPrev?chunkT4RYVPAB_js.V(h,P):0,y=(b[m.fromRow]??0)+(m.topClip??0),w=m.bottomClip!==void 0?Math.round(m.height):M+((b[m.toRow]??0)-y),R=F=>M+(F-y);for(let F=m.fromRow;F<m.toRow&&F<d.rows.length;F++){let B=d.rows[F],I=h.rows[F];if(!B||!I)continue;let v=b[F]??0,S=0;for(let L=0;L<B.cells.length;L++){let E=B.cells[L],T=I.cells[L];if(!E||!T)continue;let H=E.padding?.top??0,C=chunkT4RYVPAB_js.L(E.blocks,T.blocks,H);for(let _=0;_<E.blocks.length;_++){let Y=E.blocks[_],z=T.blocks[_];if(!Y||Y.kind!=="paragraph"||!z||z.kind!=="paragraph")continue;let N=Y,He=z,we=C.lineTops[_]??[],Re=xe(N,He,o,s);for(let{line:O,index:Be}of Re){let V=U(N,O);if(V.pmStart===void 0||V.pmEnd===void 0)continue;let oe=Math.max(V.pmStart,o),re=Math.min(V.pmEnd,s);if(oe>=re)continue;let J=R(v+(we[Be]??0));if(J+O.lineHeight<=M||J>=w)continue;let Ie=G(N,O,oe),Se=G(N,O,re),ie=W(N,O,Ie,T.width),ae=W(N,O,Se,T.width);i.push({x:m.x+S+Math.min(ie,ae),y:m.y+J+u,width:Math.max(1,Math.abs(ae-ie)),height:O.lineHeight,pageIndex:l});}}S+=T.width;}}}if(c.kind==="image"){let p=c.pmStart??0;(c.pmEnd??p+1)>o&&p<s&&i.push({x:c.x,y:c.y+u,width:c.width,height:c.height,pageIndex:l});}}}return i}function Ge(e,n,a,r){for(let t=0;t<e.pages.length;t++){let o=e.pages[t],s=D(e,t);for(let i of o.fragments){if(i.kind==="paragraph"){let l=ne(n,i.blockId);if(l===-1)continue;let f=n[l],u=a[l];if(!f||f.kind!=="paragraph"||!u||u.kind!=="paragraph")continue;let c=f,p=u,g=i,x=c.pmStart??0,d=c.pmEnd??x;if(r<x||r>d)continue;for(let h=g.fromLine;h<g.toLine;h++){let m=p.lines[h];if(!m)continue;let b=U(c,m);if(!(b.pmStart===void 0||b.pmEnd===void 0)&&r>=b.pmStart&&r<=b.pmEnd){let k=G(c,m,r),P=c.attrs?.indent,M=P?.left??0,y=P?.right??0,w=Math.max(0,i.width-M-y),R=W(c,m,k),F=c.attrs?.alignment??"left",B=0;F==="center"?B=Math.max(0,(w-m.width)/2):F==="right"&&(B=Math.max(0,w-m.width));let I=j(p,h)-j(p,g.fromLine);return {x:i.x+M+B+R,y:i.y+I+s,height:m.lineHeight,pageIndex:t}}}}if(i.kind==="image"){let l=i.pmStart??0,f=i.pmEnd??l+1;if(r>=l&&r<=f){let u=r===l?0:i.width;return {x:i.x+u,y:i.y+s,height:i.height,pageIndex:t}}}}}return null}function We(e){return e.length<=1?false:new Set(e.map(a=>a.pageIndex)).size>1}function Ue(e){let n=new Map;for(let a of e){let r=n.get(a.pageIndex)??[];r.push(a),n.set(a.pageIndex,r);}return n}function Ve(e){if(e.kind!=="paragraph")return false;let n=e.attrs;return n?!!(n.borders?.top||n.borders?.bottom||n.spacingExplicit?.before||n.spacingExplicit?.after):false}function Te(e){return ke(e)}function ke(e){let n=new Set;for(let a=1;a<e.length;a++){let r=e[a-1],t=e[a];r.kind==="table"&&t.kind==="paragraph"&&(t.runs.length>0||Ve(t)||n.add(a));}return e.map((a,r)=>{if(a.kind==="table")return qe(a);if(a.kind!=="paragraph")return a;let t=n.has(r),o=a.attrs?.spacingExplicit,s=a.attrs?.spacing?.before!=null,i=a.attrs?.spacing?.after!=null,l=s&&!o?.before,f=i&&!o?.after,u=l||f;if(!u&&!t)return a;let c=a.attrs;return u&&c?.spacing&&(c={...c,spacing:{...c.spacing,before:o?.before?c.spacing.before:void 0,after:o?.after?c.spacing.after:void 0}}),t&&(c={...c??{},suppressEmptyParagraphHeight:true}),{...a,attrs:c}})}function qe(e){let n=false,a=e.rows.map(r=>{let t=false,o=r.cells.map(s=>{let i=ke(s.blocks);return i.some((f,u)=>f!==s.blocks[u])?(t=true,{...s,blocks:i}):s});return t?(n=true,{...r,cells:o}):r});return n?{...e,rows:a}:e}function je(e){return e?.align??e?.alignment}function Fe(e,n,a,r){let t=r.section==="header"?r.margins.header??48:r.pageSize.h-(r.margins.footer??48)-a,o=e.position?.vertical;if(!o)return n;let s=je(o),i=o.posOffset!==void 0?chunk4Q2IP5FW_js.e(o.posOffset):void 0;if(o.relativeTo==="page"){if(i!==void 0)return i-t;if(s==="top")return -t;if(s==="bottom")return r.pageSize.h-e.height-t;if(s==="center")return (r.pageSize.h-e.height)/2-t}if(o.relativeTo==="margin"){let l=r.margins.top,f=r.pageSize.h-r.margins.top-r.margins.bottom;if(i!==void 0)return l+i-t;if(s==="top")return l-t;if(s==="bottom")return l+f-e.height-t;if(s==="center")return l+(f-e.height)/2-t}return i!==void 0?n+i:n}function Pe(e,n,a,r){let t=0,o=a,s=0;for(let i=0;i<e.length;i++){let l=e[i],f=n[i];if(!(!l||!f)){if(l.kind==="paragraph"&&f.kind==="paragraph"){let u=s,c=u+f.totalHeight;t=Math.min(t,u),o=Math.max(o,c);for(let p of l.runs){if(p.kind!=="image"||!p.position)continue;let g=Fe(p,u,a,r);t=Math.min(t,g),o=Math.max(o,g+p.height);}s=c;}else if(l.kind==="table"&&f.kind==="table"){let u=s+f.totalHeight;t=Math.min(t,s),o=Math.max(o,u),s=u;}else if(l.kind==="image"&&f.kind==="image"){let u=s+f.height;t=Math.min(t,s),o=Math.max(o,u),s=u;}else if(l.kind==="textBox"&&f.kind==="textBox"){let u=s+f.height;t=Math.min(t,s),o=Math.max(o,u),s=u;}}}return {visualTop:t,visualBottom:o}}function $e(e,n,a,r){if(!e||!e.content||e.content.length===0)return;let t=chunkBUCOTKYY_js.b(e.content,{styles:r.styles??void 0,theme:r.theme??null,defaultTabStopTwips:r.defaultTabStopTwips??null});return Me(t,n,a,r)}function Me(e,n,a,r){let t=chunkFQS436KN_js.c(e,{theme:r.theme??void 0});if(t.length===0)return;let o=Te(t),s=r.measureBlocks(o,n),i=s.reduce((u,c)=>c.kind==="paragraph"||c.kind==="table"?u+c.totalHeight:c.kind==="image"||c.kind==="textBox"?u+c.height:u,0),{visualTop:l,visualBottom:f}=Pe(t,s,i,a);return {blocks:o,measures:s,height:i,visualTop:l,visualBottom:f}}var $={header:null,footer:null};function Je(){$.header=null,$.footer=null;}function ye(e,n){let a=n.querySelectorAll(`.layout-page-${e}`);if(a.length===0)return null;let r=n.defaultView,t=r?r.innerHeight/2:0,o=a[0],s=1/0;for(let c of Array.from(a)){let p=c.getBoundingClientRect(),g=Math.abs((p.top+p.bottom)/2-t);g<s&&(s=g,o=c);}let i=$[e];if(i&&i.host===o&&i.host.isConnected)return i;let l=Array.from(o.querySelectorAll("span[data-pm-start][data-pm-end]")),f=Array.from(o.querySelectorAll("[data-pm-start][data-pm-end]")),u={host:o,spans:l,ranged:f};return $[e]=u,u}function Ke(e,n,a=globalThis.document){let r=e.state.selection;if(!r.empty)return null;let t=r.head,o=ye(n,a);if(!o)return null;let{host:s,spans:i}=o;for(let d of i){let h=Number(d.dataset.pmStart),m=Number(d.dataset.pmEnd);if(!(!Number.isFinite(h)||!Number.isFinite(m))&&t>=h&&t<=m){let b=s.ownerDocument.createRange(),k=s.ownerDocument.createTreeWalker(d,NodeFilter.SHOW_TEXT),P=t-h,M=k.nextNode();for(;M;){let R=M.data.length;if(P<=R){try{b.setStart(M,P),b.setEnd(M,P);let F=b.getClientRects()[0]??b.getBoundingClientRect();if(F&&F.height>0)return {top:F.top,left:F.left,height:F.height}}catch{}break}P-=R,M=k.nextNode();}let y=d.getBoundingClientRect(),w=(t-h)/Math.max(1,m-h);return {top:y.top,left:y.left+y.width*w,height:y.height}}}let l=s.querySelector(`[data-pm-start="${t}"]`);if(l){let d=l.getBoundingClientRect();return {top:d.top,left:d.left+1,height:d.height||16}}let f=o.ranged,u=null,c=1/0;for(let d of f){let h=Number(d.dataset.pmStart),m=Number(d.dataset.pmEnd);if(!Number.isFinite(h)||!Number.isFinite(m)||t<h||t>m)continue;let b=m-h;b<c&&(c=b,u=d);}if(u){let d=u.getBoundingClientRect(),h=Number(u.dataset.pmEnd),m=t>=h;return {top:d.top,left:m?d.right:d.left+1,height:d.height||16}}let p=null,g=-1/0;for(let d of f){let h=Number(d.dataset.pmStart);Number.isFinite(h)&&(h>t||h>g&&(g=h,p=d));}if(p){let d=p.getBoundingClientRect();return {top:d.top,left:d.right,height:d.height||16}}let x=s.getBoundingClientRect();return {top:x.top+2,left:x.left+2,height:16}}function Qe(e,n,a=globalThis.document){let r=e.state.selection;if(r.empty)return [];let t=r.from,o=r.to,s=[],i=ye(n,a);if(!i)return s;let{host:l,spans:f}=i;for(let u of f){let c=Number(u.dataset.pmStart),p=Number(u.dataset.pmEnd);if(!Number.isFinite(c)||!Number.isFinite(p)||p<=t||c>=o)continue;if(u.classList.contains("layout-run-tab")){let m=u.getBoundingClientRect();s.push({top:m.top,left:m.left,width:m.width,height:m.height});continue}let g=null;if(u.firstChild?.nodeType===Node.TEXT_NODE?g=u.firstChild:u.firstChild?.nodeType===Node.ELEMENT_NODE&&u.firstChild.tagName==="A"&&u.firstChild.firstChild?.nodeType===Node.TEXT_NODE&&(g=u.firstChild.firstChild),!g)continue;let x=Math.max(0,t-c),d=Math.min(g.length,o-c);if(x>=d)continue;let h=l.ownerDocument.createRange();h.setStart(g,x),h.setEnd(g,d);for(let m of Array.from(h.getClientRects()))s.push({top:m.top,left:m.left,width:m.width,height:m.height});}return s}var Ze=816,et=1056,tt=96,nt=48;function A(e){return Math.round(e/1440*96)}function ot(e){return {w:e?.pageWidth?A(e.pageWidth):816,h:e?.pageHeight?A(e.pageHeight):1056}}function rt(e){return {top:e?.marginTop?A(e.marginTop):96,right:e?.marginRight?A(e.marginRight):96,bottom:e?.marginBottom?A(e.marginBottom):96,left:e?.marginLeft?A(e.marginLeft):96,header:e?.headerDistance?A(e.headerDistance):48,footer:e?.footerDistance?A(e.footerDistance):48}}function it(e,n){let a={header:null,footer:null,firstHeader:null,firstFooter:null};if(!e?.package)return a;let r=e.package.headers,t=e.package.footers,o=null,s=null,i=null,l=null;if(r&&n?.headerReferences){let f=n.headerReferences.find(c=>c.type==="default");f?.rId&&(o=r.get(f.rId)??null);let u=n.headerReferences.find(c=>c.type==="first");u?.rId&&(i=r.get(u.rId)??null);}if(t&&n?.footerReferences){let f=n.footerReferences.find(c=>c.type==="default");f?.rId&&(s=t.get(f.rId)??null);let u=n.footerReferences.find(c=>c.type==="first");u?.rId&&(l=t.get(u.rId)??null);}return n?.titlePg||(!o&&i&&(o=i),!s&&l&&(s=l)),{header:o,footer:s,firstHeader:i,firstFooter:l}}exports.A=Qe;exports.B=Ze;exports.C=et;exports.D=tt;exports.E=nt;exports.F=ot;exports.G=rt;exports.H=it;exports.a=Q;exports.b=D;exports.c=Ee;exports.d=fe;exports.e=Ce;exports.f=de;exports.g=De;exports.h=Ae;exports.i=_e;exports.j=Oe;exports.k=te;exports.l=ge;exports.m=Ne;exports.n=pe;exports.o=Ye;exports.p=ze;exports.q=Ge;exports.r=We;exports.s=Ue;exports.t=Te;exports.u=Fe;exports.v=Pe;exports.w=$e;exports.x=Me;exports.y=Je;exports.z=Ke;