@eigenpal/docx-editor-core 1.6.1 → 1.6.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 (110) hide show
  1. package/dist/agent/index.js +1 -1
  2. package/dist/agent/index.mjs +1 -1
  3. package/dist/chunk-25775MLP.mjs +2 -0
  4. package/dist/{chunk-DKUHG27E.js → chunk-2AEZLDY4.js} +1 -1
  5. package/dist/chunk-2EFI3BAN.js +59 -0
  6. package/dist/{chunk-XCXQWCV2.js → chunk-2EKWMNCY.js} +1 -1
  7. package/dist/chunk-3QQLHMB6.mjs +4 -0
  8. package/dist/{chunk-DEQFU56O.js → chunk-455DUC37.js} +1 -1
  9. package/dist/chunk-4EATD3FP.js +2 -0
  10. package/dist/chunk-4VLKSJRK.mjs +1 -0
  11. package/dist/{chunk-WTIN6QHX.js → chunk-5CLYWBNI.js} +1 -1
  12. package/dist/{chunk-NKIDBERV.js → chunk-5TLT5TUD.js} +1 -1
  13. package/dist/{chunk-DUXHJ6QP.js → chunk-5ZAMEYCA.js} +1 -1
  14. package/dist/{chunk-O4RCQNUW.mjs → chunk-6BAIXYUY.mjs} +1 -1
  15. package/dist/{chunk-7EU6E64E.mjs → chunk-6UCWVS7Y.mjs} +1 -1
  16. package/dist/chunk-7E2TOWBX.mjs +1 -0
  17. package/dist/{chunk-YSBX4LFA.mjs → chunk-7LPUPZAO.mjs} +2 -2
  18. package/dist/{chunk-OWGY46IW.mjs → chunk-AC6JHCPC.mjs} +1 -1
  19. package/dist/chunk-B3SVS2AF.js +1 -0
  20. package/dist/{chunk-4HNEXEGS.js → chunk-BA4OW45H.js} +1 -1
  21. package/dist/{chunk-KPWWI5UW.mjs → chunk-CF4SIWV2.mjs} +1 -1
  22. package/dist/{chunk-GFM6PERG.js → chunk-CMZXBKDH.js} +1 -1
  23. package/dist/chunk-CRQO6WI3.mjs +2 -0
  24. package/dist/chunk-DPMR7U7D.js +2 -0
  25. package/dist/{chunk-QZPVZY6S.mjs → chunk-EEEED6FG.mjs} +1 -1
  26. package/dist/{chunk-HQ76VZAN.mjs → chunk-IJ2PPHRN.mjs} +1 -1
  27. package/dist/chunk-IUYHWUBF.mjs +1 -0
  28. package/dist/chunk-LMGFGJTJ.mjs +1 -0
  29. package/dist/chunk-LZTEPSU2.js +4 -0
  30. package/dist/{chunk-TXAB4I4M.mjs → chunk-NJBEJTIO.mjs} +1 -1
  31. package/dist/chunk-OBRTIXHC.mjs +59 -0
  32. package/dist/{chunk-TT3ILFZC.js → chunk-OTXLG6KM.js} +1 -1
  33. package/dist/chunk-QI6JDDGO.js +1 -0
  34. package/dist/{chunk-DUVSDFRG.js → chunk-R5DGXEWJ.js} +1 -1
  35. package/dist/{chunk-DU5TWD2W.mjs → chunk-RT5AAIEK.mjs} +1 -1
  36. package/dist/{chunk-KEDY4GFG.js → chunk-SSL74NAS.js} +3 -3
  37. package/dist/{chunk-NN2EJIO7.mjs → chunk-T5G3IWCO.mjs} +1 -1
  38. package/dist/{chunk-QRBFMR7Z.mjs → chunk-U55TPVTA.mjs} +1 -1
  39. package/dist/{chunk-ICNIAAH7.mjs → chunk-V4DLVFYG.mjs} +1 -1
  40. package/dist/chunk-WA4IJOGH.js +1 -0
  41. package/dist/{chunk-PM4KDJJ2.js → chunk-XLY5A37T.js} +1 -1
  42. package/dist/{chunk-K7NSOCSY.js → chunk-XRJFWDCV.js} +1 -1
  43. package/dist/chunk-ZCYUN3EC.js +1 -0
  44. package/dist/{chunk-A7C3DGQA.mjs → chunk-ZW3VG4TK.mjs} +1 -1
  45. package/dist/core-plugins.js +1 -1
  46. package/dist/core-plugins.mjs +1 -1
  47. package/dist/core.js +1 -1
  48. package/dist/core.mjs +1 -1
  49. package/dist/docx/index.js +1 -1
  50. package/dist/docx/index.mjs +1 -1
  51. package/dist/docx/parser.js +1 -1
  52. package/dist/docx/parser.mjs +1 -1
  53. package/dist/docx/rezip.d.mts +2 -2
  54. package/dist/docx/rezip.d.ts +2 -2
  55. package/dist/docx/rezip.js +1 -1
  56. package/dist/docx/rezip.mjs +1 -1
  57. package/dist/docx/serializer/index.js +1 -1
  58. package/dist/docx/serializer/index.mjs +1 -1
  59. package/dist/editor/index.js +1 -1
  60. package/dist/editor/index.mjs +1 -1
  61. package/dist/executor-LAWUSXNG.mjs +1 -0
  62. package/dist/executor-SJOHUTMY.js +1 -0
  63. package/dist/headless.js +1 -1
  64. package/dist/headless.mjs +1 -1
  65. package/dist/layout-bridge/index.js +1 -1
  66. package/dist/layout-bridge/index.mjs +1 -1
  67. package/dist/layout-bridge/tableInsertHover.js +1 -1
  68. package/dist/layout-bridge/tableInsertHover.mjs +1 -1
  69. package/dist/layout-bridge/toFlowBlocks.js +1 -1
  70. package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
  71. package/dist/layout-painter/index.js +1 -1
  72. package/dist/layout-painter/index.mjs +1 -1
  73. package/dist/layout-painter/renderPage.js +1 -1
  74. package/dist/layout-painter/renderPage.mjs +1 -1
  75. package/dist/mcp-cli.mjs +23 -23
  76. package/dist/mcp.js +8 -8
  77. package/dist/mcp.mjs +1 -1
  78. package/dist/prosemirror/applyFormatting.js +1 -1
  79. package/dist/prosemirror/applyFormatting.mjs +1 -1
  80. package/dist/prosemirror/commands/formatting.js +1 -1
  81. package/dist/prosemirror/commands/formatting.mjs +1 -1
  82. package/dist/prosemirror/commands/index.js +1 -1
  83. package/dist/prosemirror/commands/index.mjs +1 -1
  84. package/dist/prosemirror/commands/paragraph.js +1 -1
  85. package/dist/prosemirror/commands/paragraph.mjs +1 -1
  86. package/dist/prosemirror/conversion/index.js +1 -1
  87. package/dist/prosemirror/conversion/index.mjs +1 -1
  88. package/dist/prosemirror/extensions/index.js +1 -1
  89. package/dist/prosemirror/extensions/index.mjs +1 -1
  90. package/dist/prosemirror/index.js +2 -2
  91. package/dist/prosemirror/index.mjs +1 -1
  92. package/dist/prosemirror/schema/index.js +1 -1
  93. package/dist/prosemirror/schema/index.mjs +1 -1
  94. package/package.json +1 -1
  95. package/dist/chunk-2LVK7EF5.mjs +0 -2
  96. package/dist/chunk-47SKD7QB.mjs +0 -4
  97. package/dist/chunk-4JPHW7ZI.js +0 -2
  98. package/dist/chunk-4U2S3WV2.js +0 -1
  99. package/dist/chunk-5EP47PMQ.mjs +0 -2
  100. package/dist/chunk-B6FA4MJ5.mjs +0 -1
  101. package/dist/chunk-C2BAPYGJ.js +0 -1
  102. package/dist/chunk-DFDL337G.js +0 -4
  103. package/dist/chunk-F24WZXN4.mjs +0 -59
  104. package/dist/chunk-FETIBXTH.js +0 -1
  105. package/dist/chunk-JQUIUKRO.js +0 -59
  106. package/dist/chunk-LE67NTCN.mjs +0 -1
  107. package/dist/chunk-SHZOAUHB.mjs +0 -1
  108. package/dist/chunk-WVY2UXAK.js +0 -2
  109. package/dist/executor-FHL5D4CB.js +0 -1
  110. package/dist/executor-FL6XGVP3.mjs +0 -1
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkLZTEPSU2_js=require('./chunk-LZTEPSU2.js'),chunkFIGLFSNR_js=require('./chunk-FIGLFSNR.js'),chunkQVRMX2AC_js=require('./chunk-QVRMX2AC.js'),chunkZ3LGMBJC_js=require('./chunk-Z3LGMBJC.js'),chunkB3SVS2AF_js=require('./chunk-B3SVS2AF.js'),chunkGSKMHXHG_js=require('./chunk-GSKMHXHG.js'),chunkH57LNDBH_js=require('./chunk-H57LNDBH.js'),chunk3R7QHNI5_js=require('./chunk-3R7QHNI5.js'),We=require('jszip');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var We__default=/*#__PURE__*/_interopDefault(We);async function K(t){let n=await We__default.default.loadAsync(t),e={documentXml:null,stylesXml:null,themeXml:null,numberingXml:null,fontTableXml:null,settingsXml:null,webSettingsXml:null,headers:new Map,footers:new Map,footnotesXml:null,endnotesXml:null,commentsXml:null,commentsExtensibleXml:null,commentsExtendedXml:null,documentRels:null,packageRels:null,contentTypesXml:null,corePropsXml:null,appPropsXml:null,customPropsXml:null,media:new Map,fonts:new Map,allXml:new Map,originalZip:n,originalBuffer:t};for(let[o,i]of Object.entries(n.files)){if(i.dir)continue;let r=o.toLowerCase();if(r.endsWith(".xml")||r.endsWith(".rels")){let a=await i.async("text");if(e.allXml.set(o,a),r==="word/document.xml")e.documentXml=a;else if(r==="word/styles.xml")e.stylesXml=a;else if(r==="word/theme/theme1.xml")e.themeXml=a;else if(r==="word/numbering.xml")e.numberingXml=a;else if(r==="word/fonttable.xml")e.fontTableXml=a;else if(r==="word/settings.xml")e.settingsXml=a;else if(r==="word/websettings.xml")e.webSettingsXml=a;else if(r==="word/footnotes.xml")e.footnotesXml=a;else if(r==="word/endnotes.xml")e.endnotesXml=a;else if(r==="word/comments.xml")e.commentsXml=a;else if(r==="word/commentsextensible.xml")e.commentsExtensibleXml=a;else if(r==="word/commentsextended.xml")e.commentsExtendedXml=a;else if(r==="word/_rels/document.xml.rels")e.documentRels=a;else if(r==="_rels/.rels")e.packageRels=a;else if(r==="[content_types].xml")e.contentTypesXml=a;else if(r==="docprops/core.xml")e.corePropsXml=a;else if(r==="docprops/app.xml")e.appPropsXml=a;else if(r==="docprops/custom.xml")e.customPropsXml=a;else if(r.match(/^word\/header\d+\.xml$/)){let c=o.split("/").pop()||o;e.headers.set(c,a);}else if(r.match(/^word\/footer\d+\.xml$/)){let c=o.split("/").pop()||o;e.footers.set(c,a);}}else if(r.startsWith("word/media/")){let a=await i.async("arraybuffer");e.media.set(o,a);}else if(r.startsWith("word/fonts/")){let a=await i.async("arraybuffer");e.fonts.set(o,a);}}return e}function Ae(t){switch(t.toLowerCase().split(".").pop()){case "png":return "image/png";case "jpg":case "jpeg":return "image/jpeg";case "gif":return "image/gif";case "bmp":return "image/bmp";case "tif":case "tiff":return "image/tiff";case "wmf":return "image/x-wmf";case "emf":return "image/x-emf";case "svg":return "image/svg+xml";case "webp":return "image/webp";default:return "application/octet-stream"}}function ee(t,n,e,o){let i={};return t&&t!=="auto"?i.rgb=t:t==="auto"&&(i.auto=true),n&&(i.themeColor=n),e&&(i.themeTint=e),o&&(i.themeShade=o),i}function Z(t){if(!t)return;let n={},e=chunk3R7QHNI5_js.j(t,"w","color");e&&e!=="auto"&&(n.color={rgb:e});let o=chunk3R7QHNI5_js.j(t,"w","fill");o&&o!=="auto"&&(n.fill={rgb:o});let i=chunk3R7QHNI5_js.j(t,"w","themeFill");i&&(n.fill=n.fill||{},n.fill.themeColor=i);let r=chunk3R7QHNI5_js.j(t,"w","themeFillTint");r&&n.fill&&(n.fill.themeTint=r);let a=chunk3R7QHNI5_js.j(t,"w","themeFillShade");a&&n.fill&&(n.fill.themeShade=a);let c=chunk3R7QHNI5_js.j(t,"w","val");return c&&(n.pattern=c),Object.keys(n).length>0?n:void 0}function q(t,n){if(!t)return;let e={},o=chunk3R7QHNI5_js.e(t,"w","b");o&&(e.bold=chunk3R7QHNI5_js.m(o));let i=chunk3R7QHNI5_js.e(t,"w","bCs");i&&(e.boldCs=chunk3R7QHNI5_js.m(i));let r=chunk3R7QHNI5_js.e(t,"w","i");r&&(e.italic=chunk3R7QHNI5_js.m(r));let a=chunk3R7QHNI5_js.e(t,"w","iCs");a&&(e.italicCs=chunk3R7QHNI5_js.m(a));let c=chunk3R7QHNI5_js.e(t,"w","u");if(c){let p=chunk3R7QHNI5_js.j(c,"w","val");if(p){e.underline={style:p};let T=chunk3R7QHNI5_js.j(c,"w","color"),I=chunk3R7QHNI5_js.j(c,"w","themeColor");(T||I)&&(e.underline.color=ee(T,I,chunk3R7QHNI5_js.j(c,"w","themeTint"),chunk3R7QHNI5_js.j(c,"w","themeShade")));}}let g=chunk3R7QHNI5_js.e(t,"w","strike");g&&(e.strike=chunk3R7QHNI5_js.m(g));let d=chunk3R7QHNI5_js.e(t,"w","dstrike");d&&(e.doubleStrike=chunk3R7QHNI5_js.m(d));let h=chunk3R7QHNI5_js.e(t,"w","vertAlign");if(h){let p=chunk3R7QHNI5_js.j(h,"w","val");(p==="superscript"||p==="subscript"||p==="baseline")&&(e.vertAlign=p);}let y=chunk3R7QHNI5_js.e(t,"w","smallCaps");y&&(e.smallCaps=chunk3R7QHNI5_js.m(y));let u=chunk3R7QHNI5_js.e(t,"w","caps");u&&(e.allCaps=chunk3R7QHNI5_js.m(u));let S=chunk3R7QHNI5_js.e(t,"w","vanish");S&&(e.hidden=chunk3R7QHNI5_js.m(S));let f=chunk3R7QHNI5_js.e(t,"w","color");f&&(e.color=ee(chunk3R7QHNI5_js.j(f,"w","val"),chunk3R7QHNI5_js.j(f,"w","themeColor"),chunk3R7QHNI5_js.j(f,"w","themeTint"),chunk3R7QHNI5_js.j(f,"w","themeShade")));let b=chunk3R7QHNI5_js.e(t,"w","highlight");if(b){let p=chunk3R7QHNI5_js.j(b,"w","val");p&&(e.highlight=p);}let C=chunk3R7QHNI5_js.e(t,"w","shd");C&&(e.shading=Z(C));let D=chunk3R7QHNI5_js.e(t,"w","sz");if(D){let p=chunk3R7QHNI5_js.l(D,"w","val");p!==void 0&&(e.fontSize=p);}let B=chunk3R7QHNI5_js.e(t,"w","szCs");if(B){let p=chunk3R7QHNI5_js.l(B,"w","val");p!==void 0&&(e.fontSizeCs=p);}let v=chunk3R7QHNI5_js.e(t,"w","rFonts");if(v){e.fontFamily={ascii:chunk3R7QHNI5_js.j(v,"w","ascii")??void 0,hAnsi:chunk3R7QHNI5_js.j(v,"w","hAnsi")??void 0,eastAsia:chunk3R7QHNI5_js.j(v,"w","eastAsia")??void 0,cs:chunk3R7QHNI5_js.j(v,"w","cs")??void 0};let p=chunk3R7QHNI5_js.j(v,"w","asciiTheme");p&&(e.fontFamily.asciiTheme=p,n&&!e.fontFamily.ascii&&(e.fontFamily.ascii=chunkLZTEPSU2_js.b(n,p)));let T=chunk3R7QHNI5_js.j(v,"w","hAnsiTheme");T&&(e.fontFamily.hAnsiTheme=T,n&&!e.fontFamily.hAnsi&&(e.fontFamily.hAnsi=chunkLZTEPSU2_js.b(n,T)));let I=chunk3R7QHNI5_js.j(v,"w","eastAsiaTheme");I&&(e.fontFamily.eastAsiaTheme=I,n&&!e.fontFamily.eastAsia&&(e.fontFamily.eastAsia=chunkLZTEPSU2_js.b(n,I)));let W=chunk3R7QHNI5_js.j(v,"w","cstheme");W&&(e.fontFamily.csTheme=W,n&&!e.fontFamily.cs&&(e.fontFamily.cs=chunkLZTEPSU2_js.b(n,W)));}let X=chunk3R7QHNI5_js.e(t,"w","spacing");if(X){let p=chunk3R7QHNI5_js.l(X,"w","val");p!==void 0&&(e.spacing=p);}let m=chunk3R7QHNI5_js.e(t,"w","position");if(m){let p=chunk3R7QHNI5_js.l(m,"w","val");p!==void 0&&(e.position=p);}let x=chunk3R7QHNI5_js.e(t,"w","w");if(x){let p=chunk3R7QHNI5_js.l(x,"w","val");p!==void 0&&(e.scale=p);}let F=chunk3R7QHNI5_js.e(t,"w","kern");if(F){let p=chunk3R7QHNI5_js.l(F,"w","val");p!==void 0&&(e.kerning=p);}let k=chunk3R7QHNI5_js.e(t,"w","effect");if(k){let p=chunk3R7QHNI5_js.j(k,"w","val");p&&(e.effect=p);}let A=chunk3R7QHNI5_js.e(t,"w","em");if(A){let p=chunk3R7QHNI5_js.j(A,"w","val");p&&(e.emphasisMark=p);}let M=chunk3R7QHNI5_js.e(t,"w","emboss");M&&(e.emboss=chunk3R7QHNI5_js.m(M));let R=chunk3R7QHNI5_js.e(t,"w","imprint");R&&(e.imprint=chunk3R7QHNI5_js.m(R));let H=chunk3R7QHNI5_js.e(t,"w","outline");H&&(e.outline=chunk3R7QHNI5_js.m(H));let U=chunk3R7QHNI5_js.e(t,"w","shadow");U&&(e.shadow=chunk3R7QHNI5_js.m(U));let N=chunk3R7QHNI5_js.e(t,"w","rtl");N&&(e.rtl=chunk3R7QHNI5_js.m(N));let V=chunk3R7QHNI5_js.e(t,"w","cs");V&&(e.cs=chunk3R7QHNI5_js.m(V));let z=chunk3R7QHNI5_js.e(t,"w","rStyle");if(z){let p=chunk3R7QHNI5_js.j(z,"w","val");p&&(e.styleId=p);}return Object.keys(e).length>0?e:void 0}function E(t){if(!t)return;let n=chunk3R7QHNI5_js.j(t,"w","val");if(!n)return;let e={style:n},o=chunk3R7QHNI5_js.j(t,"w","color"),i=chunk3R7QHNI5_js.j(t,"w","themeColor");(o||i)&&(e.color=ee(o,i,chunk3R7QHNI5_js.j(t,"w","themeTint"),chunk3R7QHNI5_js.j(t,"w","themeShade")));let r=chunk3R7QHNI5_js.l(t,"w","sz");r!==void 0&&(e.size=r);let a=chunk3R7QHNI5_js.l(t,"w","space");a!==void 0&&(e.space=a);let c=chunk3R7QHNI5_js.j(t,"w","shadow");c&&(e.shadow=c==="1"||c==="true");let g=chunk3R7QHNI5_js.j(t,"w","frame");return g&&(e.frame=g==="1"||g==="true"),e}function $e(t){if(!t)return;let n=chunk3R7QHNI5_js.f(t,"w","tab");if(n.length===0)return;let e=[];for(let o of n){let i=chunk3R7QHNI5_js.l(o,"w","pos"),r=chunk3R7QHNI5_js.j(o,"w","val");if(i!==void 0&&r){let a={position:i,alignment:r},c=chunk3R7QHNI5_js.j(o,"w","leader");c&&(a.leader=c),e.push(a);}}return e.length>0?e:void 0}function te(t,n){if(!t)return;let e={},o=chunk3R7QHNI5_js.e(t,"w","jc");if(o){let m=chunk3R7QHNI5_js.j(o,"w","val");m&&(e.alignment=m);}let i=chunk3R7QHNI5_js.e(t,"w","bidi");i&&(e.bidi=chunk3R7QHNI5_js.m(i));let r=chunk3R7QHNI5_js.e(t,"w","spacing");if(r){let m=chunk3R7QHNI5_js.l(r,"w","before");m!==void 0&&(e.spaceBefore=m);let x=chunk3R7QHNI5_js.l(r,"w","after");x!==void 0&&(e.spaceAfter=x);let F=chunk3R7QHNI5_js.l(r,"w","line");F!==void 0&&(e.lineSpacing=F);let k=chunk3R7QHNI5_js.j(r,"w","lineRule");k&&(e.lineSpacingRule=k);let A=chunk3R7QHNI5_js.j(r,"w","beforeAutospacing");A&&(e.beforeAutospacing=A==="1"||A==="true");let M=chunk3R7QHNI5_js.j(r,"w","afterAutospacing");M&&(e.afterAutospacing=M==="1"||M==="true");}let a=chunk3R7QHNI5_js.e(t,"w","ind");if(a){let m=chunk3R7QHNI5_js.l(a,"w","left");m!==void 0&&(e.indentLeft=m);let x=chunk3R7QHNI5_js.l(a,"w","right");x!==void 0&&(e.indentRight=x);let F=chunk3R7QHNI5_js.l(a,"w","firstLine");F!==void 0&&(e.indentFirstLine=F);let k=chunk3R7QHNI5_js.l(a,"w","hanging");k!==void 0&&(e.indentFirstLine=-k,e.hangingIndent=true);}let c=chunk3R7QHNI5_js.e(t,"w","pBdr");if(c){let m={},x=E(chunk3R7QHNI5_js.e(c,"w","top"));x&&(m.top=x);let F=E(chunk3R7QHNI5_js.e(c,"w","bottom"));F&&(m.bottom=F);let k=E(chunk3R7QHNI5_js.e(c,"w","left"));k&&(m.left=k);let A=E(chunk3R7QHNI5_js.e(c,"w","right"));A&&(m.right=A);let M=E(chunk3R7QHNI5_js.e(c,"w","between"));M&&(m.between=M);let R=E(chunk3R7QHNI5_js.e(c,"w","bar"));R&&(m.bar=R),Object.keys(m).length>0&&(e.borders=m);}let g=chunk3R7QHNI5_js.e(t,"w","shd");g&&(e.shading=Z(g));let d=chunk3R7QHNI5_js.e(t,"w","tabs");d&&(e.tabs=$e(d));let h=chunk3R7QHNI5_js.e(t,"w","keepNext");h&&(e.keepNext=chunk3R7QHNI5_js.m(h));let y=chunk3R7QHNI5_js.e(t,"w","keepLines");y&&(e.keepLines=chunk3R7QHNI5_js.m(y));let u=chunk3R7QHNI5_js.e(t,"w","widowControl");u&&(e.widowControl=chunk3R7QHNI5_js.m(u));let S=chunk3R7QHNI5_js.e(t,"w","pageBreakBefore");S&&(e.pageBreakBefore=chunk3R7QHNI5_js.m(S));let f=chunk3R7QHNI5_js.e(t,"w","contextualSpacing");f&&(e.contextualSpacing=chunk3R7QHNI5_js.m(f));let b=chunk3R7QHNI5_js.e(t,"w","numPr");if(b){let m=chunk3R7QHNI5_js.e(b,"w","numId"),x=chunk3R7QHNI5_js.e(b,"w","ilvl");if(m||x){if(e.numPr={},m){let F=chunk3R7QHNI5_js.l(m,"w","val");F!==void 0&&(e.numPr.numId=F);}if(x){let F=chunk3R7QHNI5_js.l(x,"w","val");F!==void 0&&(e.numPr.ilvl=F);}}}let C=chunk3R7QHNI5_js.e(t,"w","outlineLvl");if(C){let m=chunk3R7QHNI5_js.l(C,"w","val");m!==void 0&&(e.outlineLevel=m);}let D=chunk3R7QHNI5_js.e(t,"w","pStyle");if(D){let m=chunk3R7QHNI5_js.j(D,"w","val");m&&(e.styleId=m);}let B=chunk3R7QHNI5_js.e(t,"w","suppressLineNumbers");B&&(e.suppressLineNumbers=chunk3R7QHNI5_js.m(B));let v=chunk3R7QHNI5_js.e(t,"w","suppressAutoHyphens");v&&(e.suppressAutoHyphens=chunk3R7QHNI5_js.m(v));let X=chunk3R7QHNI5_js.e(t,"w","rPr");return X&&(e.runProperties=q(X,n)),Object.keys(e).length>0?e:void 0}function j(t){if(!t)return;let n=chunk3R7QHNI5_js.l(t,"w","w"),e=chunk3R7QHNI5_js.j(t,"w","type");if(n!==void 0&&e)return {value:n,type:e}}function Ie(t){if(!t)return;let n={},e=E(chunk3R7QHNI5_js.e(t,"w","top"));e&&(n.top=e);let o=E(chunk3R7QHNI5_js.e(t,"w","bottom"));o&&(n.bottom=o);let i=E(chunk3R7QHNI5_js.e(t,"w","left"));i&&(n.left=i);let r=E(chunk3R7QHNI5_js.e(t,"w","right"));r&&(n.right=r);let a=E(chunk3R7QHNI5_js.e(t,"w","insideH"));a&&(n.insideH=a);let c=E(chunk3R7QHNI5_js.e(t,"w","insideV"));return c&&(n.insideV=c),Object.keys(n).length>0?n:void 0}function Re(t){if(!t)return;let n={},e=j(chunk3R7QHNI5_js.e(t,"w","top"));e&&(n.top=e);let o=j(chunk3R7QHNI5_js.e(t,"w","bottom"));o&&(n.bottom=o);let i=j(chunk3R7QHNI5_js.e(t,"w","left"));i&&(n.left=i);let r=j(chunk3R7QHNI5_js.e(t,"w","right"));return r&&(n.right=r),Object.keys(n).length>0?n:void 0}function _e(t){if(!t)return;let n={},e=chunk3R7QHNI5_js.j(t,"w","val");if(e){let d=parseInt(e,16);isNaN(d)||(n.firstRow=(d&32)!==0,n.lastRow=(d&64)!==0,n.firstColumn=(d&128)!==0,n.lastColumn=(d&256)!==0,n.noHBand=(d&512)!==0,n.noVBand=(d&1024)!==0);}let o=chunk3R7QHNI5_js.j(t,"w","firstColumn");o&&(n.firstColumn=o==="1");let i=chunk3R7QHNI5_js.j(t,"w","firstRow");i&&(n.firstRow=i==="1");let r=chunk3R7QHNI5_js.j(t,"w","lastColumn");r&&(n.lastColumn=r==="1");let a=chunk3R7QHNI5_js.j(t,"w","lastRow");a&&(n.lastRow=a==="1");let c=chunk3R7QHNI5_js.j(t,"w","noHBand");c&&(n.noHBand=c==="1");let g=chunk3R7QHNI5_js.j(t,"w","noVBand");return g&&(n.noVBand=g==="1"),Object.keys(n).length>0?n:void 0}function ue(t,n){if(!t)return;let e={},o=chunk3R7QHNI5_js.e(t,"w","tblW");o&&(e.width=j(o));let i=chunk3R7QHNI5_js.e(t,"w","jc");if(i){let f=chunk3R7QHNI5_js.j(i,"w","val");(f==="left"||f==="center"||f==="right")&&(e.justification=f);}let r=chunk3R7QHNI5_js.e(t,"w","tblCellSpacing");r&&(e.cellSpacing=j(r));let a=chunk3R7QHNI5_js.e(t,"w","tblInd");a&&(e.indent=j(a));let c=chunk3R7QHNI5_js.e(t,"w","tblBorders");c&&(e.borders=Ie(c));let g=chunk3R7QHNI5_js.e(t,"w","tblCellMar");g&&(e.cellMargins=Re(g));let d=chunk3R7QHNI5_js.e(t,"w","tblLayout");if(d){let f=chunk3R7QHNI5_js.j(d,"w","type");(f==="fixed"||f==="autofit")&&(e.layout=f);}let h=chunk3R7QHNI5_js.e(t,"w","tblStyle");if(h){let f=chunk3R7QHNI5_js.j(h,"w","val");f&&(e.styleId=f);}let y=chunk3R7QHNI5_js.e(t,"w","tblLook");y&&(e.look=_e(y));let u=chunk3R7QHNI5_js.e(t,"w","shd");u&&(e.shading=Z(u));let S=chunk3R7QHNI5_js.e(t,"w","bidiVisual");return S&&(e.bidi=chunk3R7QHNI5_js.m(S)),Object.keys(e).length>0?e:void 0}function de(t){if(!t)return;let n={},e=chunk3R7QHNI5_js.e(t,"w","trHeight");if(e){n.height=j(e);let c=chunk3R7QHNI5_js.j(e,"w","hRule");c&&(n.heightRule=c);}let o=chunk3R7QHNI5_js.e(t,"w","tblHeader");o&&(n.header=chunk3R7QHNI5_js.m(o));let i=chunk3R7QHNI5_js.e(t,"w","cantSplit");i&&(n.cantSplit=chunk3R7QHNI5_js.m(i));let r=chunk3R7QHNI5_js.e(t,"w","jc");if(r){let c=chunk3R7QHNI5_js.j(r,"w","val");(c==="left"||c==="center"||c==="right")&&(n.justification=c);}let a=chunk3R7QHNI5_js.e(t,"w","hidden");return a&&(n.hidden=chunk3R7QHNI5_js.m(a)),Object.keys(n).length>0?n:void 0}function pe(t,n){if(!t)return;let e={},o=chunk3R7QHNI5_js.e(t,"w","tcW");o&&(e.width=j(o));let i=chunk3R7QHNI5_js.e(t,"w","tcBorders");i&&(e.borders=Ie(i));let r=chunk3R7QHNI5_js.e(t,"w","tcMar");r&&(e.margins=Re(r));let a=chunk3R7QHNI5_js.e(t,"w","shd");a&&(e.shading=Z(a));let c=chunk3R7QHNI5_js.e(t,"w","vAlign");if(c){let f=chunk3R7QHNI5_js.j(c,"w","val");(f==="top"||f==="center"||f==="bottom")&&(e.verticalAlign=f);}let g=chunk3R7QHNI5_js.e(t,"w","textDirection");if(g){let f=chunk3R7QHNI5_js.j(g,"w","val");f&&(e.textDirection=f);}let d=chunk3R7QHNI5_js.e(t,"w","gridSpan");if(d){let f=chunk3R7QHNI5_js.l(d,"w","val");f!==void 0&&(e.gridSpan=f);}let h=chunk3R7QHNI5_js.e(t,"w","vMerge");if(h){let f=chunk3R7QHNI5_js.j(h,"w","val");e.vMerge=f==="restart"?"restart":"continue";}let y=chunk3R7QHNI5_js.e(t,"w","tcFitText");y&&(e.fitText=chunk3R7QHNI5_js.m(y));let u=chunk3R7QHNI5_js.e(t,"w","noWrap");u&&(e.noWrap=chunk3R7QHNI5_js.m(u));let S=chunk3R7QHNI5_js.e(t,"w","hideMark");return S&&(e.hideMark=chunk3R7QHNI5_js.m(S)),Object.keys(e).length>0?e:void 0}function Ze(t,n){let e={styleId:chunk3R7QHNI5_js.j(t,"w","styleId")??"",type:chunk3R7QHNI5_js.j(t,"w","type")??"paragraph"},o=chunk3R7QHNI5_js.j(t,"w","default");o&&(e.default=o==="1"||o==="true");let i=chunk3R7QHNI5_js.e(t,"w","name");i&&(e.name=chunk3R7QHNI5_js.j(i,"w","val")??void 0);let r=chunk3R7QHNI5_js.e(t,"w","basedOn");r&&(e.basedOn=chunk3R7QHNI5_js.j(r,"w","val")??void 0);let a=chunk3R7QHNI5_js.e(t,"w","next");a&&(e.next=chunk3R7QHNI5_js.j(a,"w","val")??void 0);let c=chunk3R7QHNI5_js.e(t,"w","link");c&&(e.link=chunk3R7QHNI5_js.j(c,"w","val")??void 0);let g=chunk3R7QHNI5_js.e(t,"w","uiPriority");if(g){let X=chunk3R7QHNI5_js.l(g,"w","val");X!==void 0&&(e.uiPriority=X);}let d=chunk3R7QHNI5_js.e(t,"w","hidden");d&&(e.hidden=chunk3R7QHNI5_js.m(d));let h=chunk3R7QHNI5_js.e(t,"w","semiHidden");h&&(e.semiHidden=chunk3R7QHNI5_js.m(h));let y=chunk3R7QHNI5_js.e(t,"w","unhideWhenUsed");y&&(e.unhideWhenUsed=chunk3R7QHNI5_js.m(y));let u=chunk3R7QHNI5_js.e(t,"w","qFormat");u&&(e.qFormat=chunk3R7QHNI5_js.m(u));let S=chunk3R7QHNI5_js.e(t,"w","personal");S&&(e.personal=chunk3R7QHNI5_js.m(S));let f=chunk3R7QHNI5_js.e(t,"w","pPr");f&&(e.pPr=te(f,n));let b=chunk3R7QHNI5_js.e(t,"w","rPr");b&&(e.rPr=q(b,n));let C=chunk3R7QHNI5_js.e(t,"w","tblPr");C&&(e.tblPr=ue(C));let D=chunk3R7QHNI5_js.e(t,"w","trPr");D&&(e.trPr=de(D));let B=chunk3R7QHNI5_js.e(t,"w","tcPr");B&&(e.tcPr=pe(B));let v=chunk3R7QHNI5_js.f(t,"w","tblStylePr");if(v.length>0){e.tblStylePr=[];for(let X of v){let m=chunk3R7QHNI5_js.j(X,"w","type");if(m){let x={type:m},F=chunk3R7QHNI5_js.e(X,"w","pPr");F&&(x.pPr=te(F,n));let k=chunk3R7QHNI5_js.e(X,"w","rPr");k&&(x.rPr=q(k,n));let A=chunk3R7QHNI5_js.e(X,"w","tblPr");A&&(x.tblPr=ue(A));let M=chunk3R7QHNI5_js.e(X,"w","trPr");M&&(x.trPr=de(M));let R=chunk3R7QHNI5_js.e(X,"w","tcPr");R&&(x.tcPr=pe(R)),e.tblStylePr.push(x);}}}return e}function qe(t,n){if(!t)return;let e={},o=chunk3R7QHNI5_js.e(t,"w","rPrDefault");if(o){let r=chunk3R7QHNI5_js.e(o,"w","rPr");r&&(e.rPr=q(r,n));}let i=chunk3R7QHNI5_js.e(t,"w","pPrDefault");if(i){let r=chunk3R7QHNI5_js.e(i,"w","pPr");r&&(e.pPr=te(r,n));}return e.rPr||e.pPr?e:void 0}function Je(t,n){if(!n)return t;if(!t)return n?{...n}:void 0;let e={...t};for(let o of Object.keys(n)){let i=n[o];if(i!==void 0)if(o==="runProperties")e.runProperties=chunkGSKMHXHG_js.b(e.runProperties,n.runProperties);else if(o==="borders"||o==="numPr"||o==="frame"){let r=e[o],a=i;e[o]={...r||{},...a||{}};}else o==="tabs"&&Array.isArray(i)?e.tabs=[...i]:e[o]=i;}return e}function Ee(t,n,e,o=new Set){if(o.has(t.styleId)||(o.add(t.styleId),!t.basedOn))return t;let i=n.get(t.basedOn);if(!i)return t;let r=Ee(i,n,e,o),a={...t,pPr:Je(r.pPr,t.pPr),rPr:chunkGSKMHXHG_js.b(r.rPr,t.rPr)};return t.type==="table"&&((r.tblPr||t.tblPr)&&(a.tblPr={...r.tblPr||{},...t.tblPr||{}}),(r.trPr||t.trPr)&&(a.trPr={...r.trPr||{},...t.trPr||{}}),(r.tcPr||t.tcPr)&&(a.tcPr={...r.tcPr||{},...t.tcPr||{}})),a}function me(t,n){let e=new Map;try{let o=chunk3R7QHNI5_js.c(t);if(!o)return e;let i=chunk3R7QHNI5_js.f(o,"w","style");for(let r of i){let a=Ze(r,n);a.styleId&&e.set(a.styleId,a);}for(let[r,a]of e){let c=Ee(a,e,n);e.set(r,c);}}catch(o){console.warn("Failed to parse styles:",o);}return e}function Ne(t,n){let e={styles:[]};try{let o=chunk3R7QHNI5_js.c(t);if(!o)return e;let i=chunk3R7QHNI5_js.e(o,"w","docDefaults");e.docDefaults=qe(i,n);let r=chunk3R7QHNI5_js.e(o,"w","latentStyles");r&&(e.latentStyles={defLockedState:chunk3R7QHNI5_js.j(r,"w","defLockedState")==="1",defUIPriority:chunk3R7QHNI5_js.l(r,"w","defUIPriority"),defSemiHidden:chunk3R7QHNI5_js.j(r,"w","defSemiHidden")==="1",defUnhideWhenUsed:chunk3R7QHNI5_js.j(r,"w","defUnhideWhenUsed")==="1",defQFormat:chunk3R7QHNI5_js.j(r,"w","defQFormat")==="1",count:chunk3R7QHNI5_js.l(r,"w","count")});let a=me(t,n);e.styles=Array.from(a.values());}catch(o){console.warn("Failed to parse style definitions:",o);}return e}var He=/\{([a-zA-Z_][a-zA-Z0-9_\-\.]*)\}/g;function Ve(t){let n=[],e;for(He.lastIndex=0;(e=He.exec(t))!==null;){let o=e[1].trim();o&&!n.includes(o)&&n.push(o);}return n}function ne(t){let n=[];for(let e of t)if(e.type==="paragraph"){let o=chunkLZTEPSU2_js.N(e),i=Ve(o);for(let r of i)n.includes(r)||n.push(r);}else if(e.type==="table"){let o=je(e);for(let i of o)n.includes(i)||n.push(i);}return n}function je(t){let n=[];for(let e of t.rows)for(let o of e.cells)for(let i of o.content)if(i.type==="paragraph"){let r=chunkLZTEPSU2_js.N(i),a=Ve(r);for(let c of a)n.includes(c)||n.push(c);}else if(i.type==="table"){let r=je(i);for(let a of r)n.includes(a)||n.push(a);}return n}function Qe(t,n){let e=[],o=[];for(let i of t)o.push(i),i.type==="paragraph"&&i.sectionProperties&&(e.push({properties:i.sectionProperties,content:o}),o=[]);return (o.length>0||e.length===0)&&e.push({properties:n??chunkLZTEPSU2_js.C(),content:o}),e}function oe(t,n=null,e=null,o=null,i=null,r=null){let a={content:[]};if(!t)return a;let c=chunk3R7QHNI5_js.a(t);if(!c)return a;let g=(c.elements??[]).find(u=>u.type==="element"&&(u.name==="w:document"||u.name?.endsWith(":document")));if(!g)return a;let d=chunk3R7QHNI5_js.e(g,"w","body");if(!d)return a;a.content=chunkLZTEPSU2_js.q(d,n,e,o,i,r);let h=chunk3R7QHNI5_js.e(d,"w","sectPr");h&&(a.finalSectionProperties=chunkLZTEPSU2_js.B(h,i));let y=Qe(a.content,a.finalSectionProperties);return a.sections=chunkLZTEPSU2_js.D(y),a.finalSectionProperties&&a.sections.length>0&&(a.finalSectionProperties=a.sections[a.sections.length-1].properties),a}function Ge(t){let n=new Map,e=chunk3R7QHNI5_js.a(t);if(!e)return n;let o=chunk3R7QHNI5_js.e(e,"w16cex","commentsExtensible")??e;for(let i of chunk3R7QHNI5_js.i(o)){if((i.name?.replace(/^.*:/,"")??"")!=="comment")continue;let a=chunk3R7QHNI5_js.j(i,"w16cex","paraId")??chunk3R7QHNI5_js.j(i,"w15","paraId")??i.attributes?.["w16cex:paraId"]??i.attributes?.["w15:paraId"],c=chunk3R7QHNI5_js.j(i,"w16cex","dateUtc")??chunk3R7QHNI5_js.j(i,"w15","dateUtc")??i.attributes?.["w16cex:dateUtc"]??i.attributes?.["w15:dateUtc"];a&&c&&n.set(String(a).toUpperCase(),String(c));}return n}function Ye(t){let n=new Map,e=new Map,o=chunk3R7QHNI5_js.a(t);if(!o)return {parentByParaId:n,doneByParaId:e};let i=chunk3R7QHNI5_js.e(o,"w15","commentsEx")??o;for(let r of chunk3R7QHNI5_js.i(i)){if((r.name?.replace(/^.*:/,"")??"")!=="commentEx")continue;let c=chunk3R7QHNI5_js.j(r,"w15","paraId")??r.attributes?.["w15:paraId"],g=chunk3R7QHNI5_js.j(r,"w15","paraIdParent")??r.attributes?.["w15:paraIdParent"],d=chunk3R7QHNI5_js.j(r,"w15","done")??r.attributes?.["w15:done"];if(c){let h=String(c).toUpperCase();g&&n.set(h,String(g).toUpperCase()),d==="1"&&e.set(h,true);}}return {parentByParaId:n,doneByParaId:e}}function Le(t,n,e,o,i,r,a){if(!t)return [];let c=chunk3R7QHNI5_js.a(t);if(!c)return [];let g=r?Ge(r):new Map,d=a?Ye(a):null,h=chunk3R7QHNI5_js.e(c,"w","comments")??c,y=chunk3R7QHNI5_js.i(h),u=[],S=[];for(let f of y){if((f.name?.replace(/^.*:/,"")??"")!=="comment")continue;let C=parseInt(chunk3R7QHNI5_js.j(f,"w","id")??"0",10),D=chunk3R7QHNI5_js.j(f,"w","author")??"Unknown",B=chunk3R7QHNI5_js.j(f,"w","initials"),v=B!=null?String(B):void 0,X=chunk3R7QHNI5_js.j(f,"w","date"),m=X!=null?String(X):void 0,x=chunk3R7QHNI5_js.j(f,"w14","paraId")??f.attributes?.["w14:paraId"]??chunk3R7QHNI5_js.j(f,"w","paraId"),k=(x?g.get(String(x).toUpperCase()):void 0)??m,A=chunk3R7QHNI5_js.j(f,"w","done")??f.attributes?.["w:done"],M=A==="1"||A==="true"?true:void 0,R=chunk3R7QHNI5_js.j(f,"w16cid","parentId")??chunk3R7QHNI5_js.j(f,"w","parentId")??f.attributes?.["w16cid:parentId"]??f.attributes?.["w:parentId"],H=R!=null?parseInt(String(R),10):void 0,U=[],N="";for(let V of chunk3R7QHNI5_js.i(f))if((V.name?.replace(/^.*:/,"")??"")==="p"){let p=chunkLZTEPSU2_js.O(V,n,e,null,o,i);U.push(p);let T=chunk3R7QHNI5_js.j(V,"w14","paraId")??V.attributes?.["w14:paraId"];T&&(N=String(T).toUpperCase());}M==null&&d&&N&&d.doneByParaId.get(N)&&(M=true),S.push(N),u.push({id:C,author:D,initials:v,date:k,content:U,...M!=null?{done:M}:{},...H!=null&&!isNaN(H)?{parentId:H}:{}});}if(d&&d.parentByParaId.size>0){let f=new Map;for(let b=0;b<u.length;b++){let C=S[b];C&&f.set(C,u[b].id);}for(let b=0;b<u.length;b++){if(u[b].parentId!=null)continue;let C=S[b];if(!C)continue;let D=d.parentByParaId.get(C);if(!D)continue;let B=f.get(D);B!=null&&(u[b]={...u[b],parentId:B});}}return u}function L(t,n){if(t)for(let e of t)if(e.type==="paragraph")e.content=e.content.filter(o=>o.type!=="commentRangeStart"&&o.type!=="commentRangeEnd"||n.has(o.id));else if(e.type==="table")for(let o of e.rows)for(let i of o.cells)L(i.content,n);else e.type==="blockSdt"&&L(e.content,n);}function Oe(t){let n=t.package,e=new Set((n.document.comments??[]).map(o=>o.id));L(n.document.content,e);for(let o of n.headers?.values()??[])L(o.content,e);for(let o of n.footers?.values()??[])L(o.content,e);for(let o of n.footnotes??[])L(o.content,e);for(let o of n.endnotes??[])L(o.content,e);for(let o of n.footnoteSeparators??[])L(o.content,e);for(let o of n.endnoteSeparators??[])L(o.content,e);}function Ke(t){let n=chunkB3SVS2AF_js.a();for(;t.has(n)||!chunkB3SVS2AF_js.b(n);)n=chunkB3SVS2AF_js.a();return n}function et(t,n){t.paraId!=null&&(n.has(t.paraId)&&(t.paraId=Ke(n)),n.add(t.paraId));}function O(t,n){if(t)for(let e of t)if(e.type==="paragraph")et(e,n);else if(e.type==="table")for(let o of e.rows)for(let i of o.cells)O(i.content,n);else e.type==="blockSdt"&&O(e.content,n);}function Ue(t){let n=t.package,e=new Set;O(n.document.content,e);for(let o of n.headers?.values()??[])O(o.content,e);for(let o of n.footers?.values()??[])O(o.content,e);for(let o of n.footnotes??[])O(o.content,e);for(let o of n.endnotes??[])O(o.content,e);for(let o of n.footnoteSeparators??[])O(o.content,e);for(let o of n.endnoteSeparators??[])O(o.content,e);}async function ze(t,n={}){let e=t instanceof ArrayBuffer?t:await chunkQVRMX2AC_js.u(t),{onProgress:o=()=>{},preloadFonts:i=true,parseHeadersFooters:r=true,parseNotes:a=true,detectVariables:c=true}=n,g=[];try{let u=function(T,I){let W=performance.now(),se=I(),$=performance.now()-W;return y.push({stage:T,ms:$}),$>1e3&&console.warn(`[parseDocx] ${T} took ${Math.round($)}ms`),se};var d=u;let h=performance.now(),y=[];async function S(T,I){let W=performance.now(),se=await I(),$=performance.now()-W;return y.push({stage:T,ms:$}),$>1e3&&console.warn(`[parseDocx] ${T} took ${Math.round($)}ms`),se}o("Extracting DOCX...",0);let f=await S("unzip",()=>K(e));o("Extracted DOCX",10),o("Parsing relationships...",10);let b=u("relationships",()=>f.documentRels?chunkZ3LGMBJC_js.b(f.documentRels):new Map);o("Parsed relationships",15),o("Parsing theme...",15);let C=u("theme",()=>chunkLZTEPSU2_js.a(f.themeXml));o("Parsed theme",20),o("Parsing styles...",20);let D=null,B;u("styles",()=>{f.stylesXml&&(D=me(f.stylesXml,C),B=Ne(f.stylesXml,C));}),o("Parsed styles",30),o("Parsing numbering...",30);let v=u("numbering",()=>chunkH57LNDBH_js.a(f.numberingXml)),X=u("settings",()=>chunkFIGLFSNR_js.b(f.settingsXml));o("Parsed numbering",35),o("Processing media files...",35);let m=u("media",()=>tt(f,b));o("Processed media",40),o("Parsing document body...",40);let x={content:[]};u("documentBody",()=>{f.documentXml?x=oe(f.documentXml,D,C,v,b,m):g.push("No document.xml found in DOCX");}),o("Parsed document body",55);let F,k;if(r){o("Parsing headers/footers...",55);let T=u("headersFooters",()=>nt(f,D,C,v,b,m));F=T.headers,k=T.footers,o("Parsed headers/footers",65);}else o("Skipping headers/footers",65);let A,M,R,H;if(a){o("Parsing footnotes/endnotes...",65);let T=u("footnotesEndnotes",()=>ot(f,D,C,v,b,m));A=T.footnotes,M=T.endnotes,R=T.footnoteSeparators,H=T.endnoteSeparators,o("Parsed footnotes/endnotes",75);}else o("Skipping footnotes/endnotes",75);o("Parsing comments...",75);let U=u("comments",()=>Le(f.commentsXml,D,C,b,m,f.commentsExtensibleXml,f.commentsExtendedXml));U.length>0&&(x.comments=U);let N;c?(o("Detecting template variables...",75),N=u("variables",()=>ne(x.content)),o("Detected variables",80)):o("Skipping variable detection",80),i?(o("Loading fonts...",80),await S("fonts",()=>rt(C,B,x)),o("Loaded fonts",95)):o("Skipping font loading",95),o("Assembling document...",95);let z={package:{document:x,styles:B,theme:C,numbering:v.definitions,settings:X,headers:F,footers:k,footnotes:A,endnotes:M,footnoteSeparators:R,endnoteSeparators:H,relationships:b,media:m},originalBuffer:e,templateVariables:N,warnings:g.length>0?g:void 0};Oe(z),Ue(z);let p=performance.now()-h;if(p>2e3){let T=y.filter(I=>I.ms>100).map(I=>`${I.stage}: ${Math.round(I.ms)}ms`).join(", ");console.warn(`[parseDocx] Total: ${Math.round(p)}ms`+(T?` (${T})`:""));}return o("Complete",100),z}catch(h){let y=h instanceof Error?h.message:String(h);throw console.error("[parseDocx] Failed to parse DOCX:",y,h),new Error(`Failed to parse DOCX: ${y}`)}}function tt(t,n){let e=new Map;for(let[o,i]of t.media.entries()){let r=o.split("/").pop()||o,a=Ae(o),c=new Uint8Array(i),g="";for(let S=0;S<c.length;S++)g+=String.fromCharCode(c[S]);let d=btoa(g),h=`data:${a};base64,${d}`,y={path:o,filename:r,mimeType:a,data:i,dataUrl:h};e.set(o,y);let u=o.replace(/^word\//,"");u!==o&&e.set(u,y);}return e}function re(t,n){let e=n.toLowerCase();for(let[o,i]of t.entries())if(o.toLowerCase()===e)return i}function nt(t,n,e,o,i,r){let a=new Map,c=new Map;for(let[g,d]of i.entries())if(d.type===chunkZ3LGMBJC_js.a.header&&d.target){let h=d.target.split("/").pop()||d.target,y=re(t.headers,h);if(y){let u=`word/_rels/${h}.rels`,S=re(t.allXml,u),f=S?chunkZ3LGMBJC_js.b(S):i,b=chunkLZTEPSU2_js.r(y,"default",n,e,o,f,r);a.set(g,b);}}else if(d.type===chunkZ3LGMBJC_js.a.footer&&d.target){let h=d.target.split("/").pop()||d.target,y=re(t.footers,h);if(y){let u=`word/_rels/${h}.rels`,S=re(t.allXml,u),f=S?chunkZ3LGMBJC_js.b(S):i,b=chunkLZTEPSU2_js.s(y,"default",n,e,o,f,r);c.set(g,b);}}return {headers:a,footers:c}}function ot(t,n,e,o,i,r){let a=chunkLZTEPSU2_js.t(t.footnotesXml,n,e,o,i,r),c=chunkLZTEPSU2_js.u(t.endnotesXml,n,e,o,i,r);return {footnotes:a.getNormalFootnotes(),endnotes:c.getNormalEndnotes(),footnoteSeparators:a.footnotes.filter(chunkLZTEPSU2_js.z),endnoteSeparators:c.endnotes.filter(chunkLZTEPSU2_js.A)}}async function rt(t,n,e){let o=new Set;if(t?.fontScheme){let{majorFont:i,minorFont:r}=t.fontScheme;i?.latin&&o.add(i.latin),r?.latin&&o.add(r.latin);}if(n?.docDefaults?.rPr?.fontFamily?.ascii&&o.add(n.docDefaults.rPr.fontFamily.ascii),n?.styles)for(let i of n.styles)i.rPr?.fontFamily?.ascii&&o.add(i.rPr.fontFamily.ascii),i.rPr?.fontFamily?.hAnsi&&o.add(i.rPr.fontFamily.hAnsi);if(e.content){for(let i of e.content)if(i.type==="paragraph")for(let r of i.content)r.type==="run"&&r.formatting?.fontFamily&&(r.formatting.fontFamily.ascii&&o.add(r.formatting.fontFamily.ascii),r.formatting.fontFamily.hAnsi&&o.add(r.formatting.fontFamily.hAnsi));}if(o.size>0)try{await chunkQVRMX2AC_js.q(Array.from(o));}catch(i){console.warn("Failed to load some fonts:",i);}}async function qt(t){return ze(t,{preloadFonts:false,parseHeadersFooters:false,parseNotes:false,detectVariables:true})}async function Jt(t,n){return ze(t,{onProgress:n,preloadFonts:true,parseHeadersFooters:true,parseNotes:true,detectVariables:true})}async function Qt(t){let n=await K(t);if(!n.documentXml)return [];let e=oe(n.documentXml);return ne(e.content)}async function Gt(t){let n=await K(t),e=n.documentXml?ne(oe(n.documentXml).content):[];return {hasDocument:n.documentXml!==null,hasStyles:n.stylesXml!==null,hasTheme:n.themeXml!==null,hasNumbering:n.numberingXml!==null,headerCount:n.headers.size,footerCount:n.footers.size,mediaCount:n.media.size,variableCount:e.length}}
2
+ exports.a=ze;exports.b=qt;exports.c=Jt;exports.d=Qt;exports.e=Gt;
@@ -1,2 +1,2 @@
1
- import {g,a as a$1,c,d,e,f,b,q as q$1,n as n$1}from'./chunk-F24WZXN4.mjs';import {h,j as j$1,l,m,n}from'./chunk-2LVK7EF5.mjs';import {a}from'./chunk-W77JXDEV.mjs';function Z(e,s){let r=G(s),t=new RegExp(`<w:p[\\s][^>]*w14:paraId="${r}"`,"g"),o=[],i;for(;(i=t.exec(e))!==null;)o.push(i.index);if(o.length===0||o.length>1)return null;let l=o[0],n=l,a=0;for(;n<e.length;){let m=e.indexOf("<",n);if(m===-1)break;if(e.startsWith("<w:p",m)){let y=e[m+4];if(y===">"||y===" "||y==="/"){let f=e.indexOf(">",m);if(f===-1)break;if(e[f-1]==="/"){if(a===0)return {start:l,end:f+1};n=f+1;}else a++,n=f+1;}else n=m+1;}else if(e.startsWith("</w:p>",m)){if(a--,a===0)return {start:l,end:m+6};n=m+6;}else n=m+1;}return null}function j(e,s){let r=Z(e,s);return r?e.substring(r.start,r.end):null}function H(e){let s=0,r=/<w:p[\s>]/g,t;for(;(t=r.exec(e))!==null;){let o=t.index,i=e[o+4];(i===">"||i===" ")&&s++;}return s}function W(e){let s=new Map,r=/w14:paraId="([^"]+)"/g,t;for(;(t=r.exec(e))!==null;){let o=t[1];s.set(o,(s.get(o)||0)+1);}return s}function q(e,s,r){if(r.size===0)return {safe:true};let t=W(e),o=W(s);for(let n of r){let a=t.get(n)||0;if(a===0)return {safe:false,reason:`paraId-not-found-in-original: ${n}`};if(a>1)return {safe:false,reason:`duplicate-paraId-in-original: ${n}`}}for(let n of r){let a=o.get(n)||0;if(a===0)return {safe:false,reason:`paraId-not-found-in-serialized: ${n}`};if(a>1)return {safe:false,reason:`duplicate-paraId-in-serialized: ${n}`}}let i=H(e),l=H(s);return i!==l?{safe:false,reason:`paragraph-count-mismatch: original=${i}, serialized=${l}`}:{safe:true}}function J(e,s,r){if(r.size===0)return e;if(!q(e,s,r).safe)return null;let o=[];for(let l of r){let n=Z(e,l);if(!n)return null;let a=j(s,l);if(!a)return null;o.push({start:n.start,end:n.end,newXml:a});}o.sort((l,n)=>n.start-l.start);let i=e;for(let{start:l,end:n,newXml:a}of o)i=i.substring(0,l)+a+i.substring(n);return i}function G(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function L(e){let s=r=>r.content.some(t=>t.type==="drawing"&&t.image?.src?.startsWith("data:")&&!t.image?.rId);for(let r of e)if(r.type==="paragraph")for(let t of r.content)if(t.type==="run"){if(s(t))return true}else {if(t.type==="hyperlink"&&t.href&&!t.rId&&!t.anchor)return true;if(t.type==="insertion"||t.type==="deletion"||t.type==="moveFrom"||t.type==="moveTo"){for(let o of t.content)if(o.type==="run"&&s(o))return true}}else if(r.type==="table"){for(let t of r.rows)for(let o of t.cells)if(L(o.content))return true}return false}async function oe(e$1,s,r){let{changedParaIds:t,structuralChange:o,hasUntrackedChanges:i}=r;if(o||i||!s)return null;let l$1=e$1.package.document.content;if(L(l$1))return null;let n$2=e$1.package.document.comments,a$2=n$2&&n$2.length>0,m$1=g(e$1);try{let f$1=await(await import('jszip')).default.loadAsync(s),u=new Map,I=e$1.package.relationships;if(I)for(let c of I.values()){if(!c.target||c.type!==a.header&&c.type!==a.footer)continue;let d=a$1(c.target).replace(/^\//,"");if(!f$1.file(d))return null}if(t.size>0){let c=f$1.file("word/document.xml");if(!c)return null;let d=await c.async("text"),w=h(e$1),x=J(d,w,t);if(!x)return null;u.set("word/document.xml",x);}if(a$2){let{xml:c$1,paraInfos:d$1}=j$1(n$2);u.set("word/comments.xml",c$1);let w=l(d$1);w&&u.set("word/commentsExtended.xml",w);let x=m(d$1);x&&u.set("word/commentsIds.xml",x);let S=n(d$1,n$2);S&&u.set("word/commentsExtensible.xml",S);let N=f$1.file("[Content_Types].xml");if(N){let p=u.get("[Content_Types].xml")??await N.async("text"),h=!1,C=[["/word/comments.xml",c],["/word/commentsExtended.xml",d],["/word/commentsIds.xml",e],["/word/commentsExtensible.xml",f]];for(let[E,b]of C)p.includes(E)||(p=p.replace("</Types>",`<Override PartName="${E}" ContentType="${b}"/></Types>`),h=!0);h&&u.set("[Content_Types].xml",p);}let T="word/_rels/document.xml.rels",O=f$1.file(T);if(O){let p=u.get(T)??await O.async("text"),h=!1,C=[["comments.xml",a.comments],["commentsExtended.xml",a.commentsExtended],["commentsIds.xml",a.commentsIds],["commentsExtensible.xml",a.commentsExtensible]];for(let[E,b$1]of C)if(!p.includes(E)){let V=b(p);p=p.replace("</Relationships>",`<Relationship Id="rId${V+1}" Type="${b$1}" Target="${E}"/></Relationships>`),h=!0;}h&&u.set(T,p);}}for(let[c,d]of m$1)u.set(c,d);let P=f$1.file("docProps/core.xml");if(P){let c=await P.async("text");u.set("docProps/core.xml",q$1(c,{updateModifiedDate:!0}));}return await n$1(f$1,u)}catch{return null}}
1
+ import {g,a as a$1,c,d,e,f,b,q as q$1,n as n$1}from'./chunk-OBRTIXHC.mjs';import {h,j as j$1,l,m,n}from'./chunk-25775MLP.mjs';import {a}from'./chunk-W77JXDEV.mjs';function Z(e,s){let r=G(s),t=new RegExp(`<w:p[\\s][^>]*w14:paraId="${r}"`,"g"),o=[],i;for(;(i=t.exec(e))!==null;)o.push(i.index);if(o.length===0||o.length>1)return null;let l=o[0],n=l,a=0;for(;n<e.length;){let m=e.indexOf("<",n);if(m===-1)break;if(e.startsWith("<w:p",m)){let y=e[m+4];if(y===">"||y===" "||y==="/"){let f=e.indexOf(">",m);if(f===-1)break;if(e[f-1]==="/"){if(a===0)return {start:l,end:f+1};n=f+1;}else a++,n=f+1;}else n=m+1;}else if(e.startsWith("</w:p>",m)){if(a--,a===0)return {start:l,end:m+6};n=m+6;}else n=m+1;}return null}function j(e,s){let r=Z(e,s);return r?e.substring(r.start,r.end):null}function H(e){let s=0,r=/<w:p[\s>]/g,t;for(;(t=r.exec(e))!==null;){let o=t.index,i=e[o+4];(i===">"||i===" ")&&s++;}return s}function W(e){let s=new Map,r=/w14:paraId="([^"]+)"/g,t;for(;(t=r.exec(e))!==null;){let o=t[1];s.set(o,(s.get(o)||0)+1);}return s}function q(e,s,r){if(r.size===0)return {safe:true};let t=W(e),o=W(s);for(let n of r){let a=t.get(n)||0;if(a===0)return {safe:false,reason:`paraId-not-found-in-original: ${n}`};if(a>1)return {safe:false,reason:`duplicate-paraId-in-original: ${n}`}}for(let n of r){let a=o.get(n)||0;if(a===0)return {safe:false,reason:`paraId-not-found-in-serialized: ${n}`};if(a>1)return {safe:false,reason:`duplicate-paraId-in-serialized: ${n}`}}let i=H(e),l=H(s);return i!==l?{safe:false,reason:`paragraph-count-mismatch: original=${i}, serialized=${l}`}:{safe:true}}function J(e,s,r){if(r.size===0)return e;if(!q(e,s,r).safe)return null;let o=[];for(let l of r){let n=Z(e,l);if(!n)return null;let a=j(s,l);if(!a)return null;o.push({start:n.start,end:n.end,newXml:a});}o.sort((l,n)=>n.start-l.start);let i=e;for(let{start:l,end:n,newXml:a}of o)i=i.substring(0,l)+a+i.substring(n);return i}function G(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function L(e){let s=r=>r.content.some(t=>t.type==="drawing"&&t.image?.src?.startsWith("data:")&&!t.image?.rId);for(let r of e)if(r.type==="paragraph")for(let t of r.content)if(t.type==="run"){if(s(t))return true}else {if(t.type==="hyperlink"&&t.href&&!t.rId&&!t.anchor)return true;if(t.type==="insertion"||t.type==="deletion"||t.type==="moveFrom"||t.type==="moveTo"){for(let o of t.content)if(o.type==="run"&&s(o))return true}}else if(r.type==="table"){for(let t of r.rows)for(let o of t.cells)if(L(o.content))return true}return false}async function oe(e$1,s,r){let{changedParaIds:t,structuralChange:o,hasUntrackedChanges:i}=r;if(o||i||!s)return null;let l$1=e$1.package.document.content;if(L(l$1))return null;let n$2=e$1.package.document.comments,a$2=n$2&&n$2.length>0,m$1=g(e$1);try{let f$1=await(await import('jszip')).default.loadAsync(s),u=new Map,I=e$1.package.relationships;if(I)for(let c of I.values()){if(!c.target||c.type!==a.header&&c.type!==a.footer)continue;let d=a$1(c.target).replace(/^\//,"");if(!f$1.file(d))return null}if(t.size>0){let c=f$1.file("word/document.xml");if(!c)return null;let d=await c.async("text"),w=h(e$1),x=J(d,w,t);if(!x)return null;u.set("word/document.xml",x);}if(a$2){let{xml:c$1,paraInfos:d$1}=j$1(n$2);u.set("word/comments.xml",c$1);let w=l(d$1);w&&u.set("word/commentsExtended.xml",w);let x=m(d$1);x&&u.set("word/commentsIds.xml",x);let S=n(d$1,n$2);S&&u.set("word/commentsExtensible.xml",S);let N=f$1.file("[Content_Types].xml");if(N){let p=u.get("[Content_Types].xml")??await N.async("text"),h=!1,C=[["/word/comments.xml",c],["/word/commentsExtended.xml",d],["/word/commentsIds.xml",e],["/word/commentsExtensible.xml",f]];for(let[E,b]of C)p.includes(E)||(p=p.replace("</Types>",`<Override PartName="${E}" ContentType="${b}"/></Types>`),h=!0);h&&u.set("[Content_Types].xml",p);}let T="word/_rels/document.xml.rels",O=f$1.file(T);if(O){let p=u.get(T)??await O.async("text"),h=!1,C=[["comments.xml",a.comments],["commentsExtended.xml",a.commentsExtended],["commentsIds.xml",a.commentsIds],["commentsExtensible.xml",a.commentsExtensible]];for(let[E,b$1]of C)if(!p.includes(E)){let V=b(p);p=p.replace("</Relationships>",`<Relationship Id="rId${V+1}" Type="${b$1}" Target="${E}"/></Relationships>`),h=!0;}h&&u.set(T,p);}}for(let[c,d]of m$1)u.set(c,d);let P=f$1.file("docProps/core.xml");if(P){let c=await P.async("text");u.set("docProps/core.xml",q$1(c,{updateModifiedDate:!0}));}return await n$1(f$1,u)}catch{return null}}
2
2
  export{q as a,J as b,oe as c};
@@ -1 +1 @@
1
- import {c as c$2}from'./chunk-7EU6E64E.mjs';import {c,f as f$1,a as a$2,g,b,e}from'./chunk-QCPISGPW.mjs';import {v,w,x,X as X$1,L,M,N as N$1,C,z as z$1,b as b$1}from'./chunk-VMBCUUZM.mjs';import {a as a$1,c as c$3}from'./chunk-7E5VBRDL.mjs';import {x as x$1}from'./chunk-47SKD7QB.mjs';import {c as c$1}from'./chunk-NN2EJIO7.mjs';import {c as c$4}from'./chunk-PJEB3ZWG.mjs';import {a}from'./chunk-AMENZY5F.mjs';import {f,j as j$1}from'./chunk-KNY7SXPJ.mjs';function tt(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}`,p=a.get(y);p?(p.top=Math.min(p.top,b),p.bottom=Math.max(p.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 p=s.alias||s.tag||s.sdtType;if(p){let F=r.createElement("span");F.className="layout-block-sdt-label",F.textContent=p,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);}It(t,l);}function wt(e){return e==="checkbox"?"checkbox":e==="dropDownList"||e==="comboBox"?"dropdown":e==="date"?"date":null}function It(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 Fn(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 Rn(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 Tt(e){return e.kind==="paragraph"}function Ft(e){return e.kind==="table"}function Rt(e){return e.kind==="image"}function fe(e){e.style.position="absolute",e.style.overflow="hidden";}function Ct(e,t,n){let o=n.createElement("div");return o.className=`${U.fragment} ${U.paragraph}`,fe(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}`,fe(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}`,fe(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(Tt(e))return Ct(e,t,o);if(Ft(e))return Et(e,t,o);if(Rt(e))return Lt(e,t,o);let r=o.createElement("div");r.className=U.fragment,fe(r);let a=e;return a.blockId!==void 0&&(r.dataset.blockId=String(a.blockId)),a.kind&&(r.dataset.kind=a.kind),r}var P={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 A(e){return e.kind==="text"}function N(e){return e.kind==="tab"}function j(e){return e.kind==="image"}function W(e){return e.kind==="lineBreak"}function X(e){return e.kind==="field"}var nt={image:"layout-image",imageAnchored:"layout-image-anchored"};function oe(e){return !!(e.cropTop||e.cropRight||e.cropBottom||e.cropLeft||e.opacity!=null&&e.opacity<1)}function re(e,t){t.opacity!=null&&t.opacity<1&&(e.style.opacity=String(Math.max(0,t.opacity))),vt(e,t);}function vt(e,t){let n=t.cropTop??0,o=t.cropRight??0,r=t.cropBottom??0,a=t.cropLeft??0;if(!(n||o||r||a))return;let i=a+o>0?a/(a+o)*100:50,d=n+r>0?n/(n+r)*100:50;e.style.objectFit="cover",e.style.objectPosition=`${i}% ${d}%`;}function Z(e,t,n,o,r={}){let a=r.document??document,i=a.createElement("div");i.className=nt.image,e.isAnchored&&i.classList.add(nt.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 Pt(e,t,n){if(t.fontFamily&&(e.style.fontFamily=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.style.cursor="pointer",e.style.transition="background-color 0.15s ease",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.fontSize="0.75em",e.style.position="relative",e.style.top="-0.4em"),t.subscript&&(e.style.fontSize="0.75em",e.style.position="relative",e.style.top="0.2em"),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 z(e,t,n){t!==void 0&&(e.dataset.pmStart=String(t)),n!==void 0&&(e.dataset.pmEnd=String(n));}function Bt(e,t){let n=t.inlineSdtWidget;n&&(e.classList.add("layout-inline-sdt-widget"),e.dataset.sdtWidget=n.kind,e.dataset.sdtGroupId=n.groupId,e.dataset.sdtPos=String(n.pos),n.tag&&(e.dataset.sdtTag=n.tag),n.alias&&(e.dataset.sdtAlias=n.alias),typeof n.checked=="boolean"&&(e.dataset.sdtChecked=String(n.checked),e.setAttribute("aria-checked",String(n.checked))),e.setAttribute("role","checkbox"),e.setAttribute("tabindex","0"),e.setAttribute("aria-label",n.alias||n.tag||"Checkbox content control"));}function ie(e,t,n){let o=t.createElement("span");if(o.className=`${P.run} ${P.text}`,Pt(o,e,n),z(o,e.pmStart,e.pmEnd),Bt(o,e),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 Mt=1e3;function ge(e,t,n,o){let r=t.createElement("span");r.className=`${P.run} ${P.tab}`,r.style.display="inline-block",r.style.width=`${n}px`,z(r,e.pmStart,e.pmEnd);let a=o&&o!=="none"?$t(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(Mt),r.appendChild(i);}else r.textContent="\xA0";return r}function $t(e){switch(e){case "dot":return ".";case "hyphen":return "-";case "underscore":return "_";case "middleDot":return "\xB7";case "heavy":return "_";default:return null}}function it(e){if(!e)return 0;let t=e.match(/rotate\(([-\d.]+)deg\)/);return t?(parseFloat(t[1])%360+360)%360:0}function at(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 ot(e,t){t.distTop&&(e.style.marginTop=`${t.distTop}px`),t.distBottom&&(e.style.marginBottom=`${t.distBottom}px`);}function Ht(e,t){let n=t.createElement("img");n.className=`${P.run} ${P.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"),oe(e)&&re(n,e);let o=it(e.transform);if(o!==0){let r=at(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`,ot(a,e),z(a,e.pmStart,e.pmEnd),a.appendChild(n),a}return n.style.display="inline-block",n.style.verticalAlign="middle",e.width>0&&e.height>0&&(n.style.height="auto",n.style.aspectRatio=`${e.width} / ${e.height}`,n.style.maxWidth="100%"),ot(n,e),z(n,e.pmStart,e.pmEnd),n}function rt(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"),oe(e)&&re(o,e);let r=it(e.transform);if(r!==0){let a=at(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 z(n,e.pmStart,e.pmEnd),n.appendChild(o),n}function me(e,t){let n;return c(e)||e.displayMode==="block"||e.wrapType==="topAndBottom"?n=rt(e,t):n=Ht(e,t),At(n,e),n}function At(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 Fe(e,t){let n=t.createElement("br");return n.className=`${P.run} ${P.lineBreak}`,z(n,e.pmStart,e.pmEnd),n}function ue(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 ie(r,t,n?.resolvedCommentIds)}function Re(e,t,n){if(A(e))return ie(e,t,n?.resolvedCommentIds);if(N(e))return ge(e,t,48,void 0);if(j(e))return me(e,t);if(W(e))return Fe(e,t);if(X(e)&&n)return ue(e,t,n);let o=t.createElement("span");return o.className=P.run,o}function dt(e,t){let n=[],o=e.runs;for(let r=t.fromRun;r<=t.toRun;r++){let a=o[r];if(a)if(A(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 st(e){return e==="center"?"center":e==="right"?"flex-end":"flex-start"}function Ot(e,t){let n=e.position?.horizontal;return n?n.align??"left":t}function lt(e){return [e.pmStart??"no-start",e.pmEnd??"no-end",e.src,e.width,e.height,e.displayMode??"inline",e.wrapType??"none"].join("|")}function zt(e){return {val:e.val,pos:e.pos,leader:e.leader}}function Dt(e,t,n){let o="";for(let r=t+1;r<e.length;r++){let a=e[r];if(A(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(N(a)||W(a))break}return o}var Nt=.5;function Wt(e,t,n,o){let r=0;for(let a=t+1;a<e.length;a++){let i=e[a];if(N(i)||W(i))break;if(A(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 j(i)&&!c(i)&&(r+=i.width||0);}return r}function _t(e){let n=e.createElement("canvas").getContext("2d");return (o,r=11,a$1="Calibri",i=false,d=false)=>{if(!n)return o.length*7;let l=a(a$1).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 he(e,t,n,o,r){let a=o.createElement("div");a.className=P.line,a.style.height=`${t.lineHeight}px`,a.style.lineHeight=`${t.lineHeight}px`;let i=dt(e,t);if(i.length===1&&j(i[0])){let y=i[0],p=Ot(y,n);a.style.display="flex",a.style.alignItems="center",a.style.justifyContent=st(p),a.dataset.flexLine="true";}else i.some(j)&&(a.style.display="flex",a.style.alignItems="baseline",a.style.justifyContent=st(n),a.style.lineHeight="normal",a.dataset.flexLine="true");if(i.length===0){let y=o.createElement("span");return y.className=`${P.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=>A(y)&&y.highlight);a.style.overflow=m?"hidden":"visible";let s=i.some(N),b,g=_t(o);if(s){let y=r?.tabStops?.map(zt),p=r?.leftIndentPx?Math.round(r.leftIndentPx*15):0;b={explicitStops:y,leftIndent:p};}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 p=i[y];if(N(p)&&b){let w=Wt(i,y,g,r?.context),F=Dt(i,y,r?.context),c$1=F.indexOf("."),x=c$1>=0?g(F.slice(0,c$1)):0,I=v(u,b,{followingWidth:w,decimalPrefixWidth:x}),k=r?.lineRightEdgePx,S=w,f=false;for(let T=y+1;T<i.length&&!W(i[T]);T++)if(N(i[T])){f=true;break}if(k!==void 0&&I.alignment==="end"&&!f&&u+I.width+S>=k-Nt){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 T=ge(p,o,0,I.leader);T.style.flex="1 1 0",T.style.minWidth="0",T.style.width="auto",a.appendChild(T);for(let v=y+1;v<i.length;v++){let L=i[v];if(N(L)||W(L))break;if(A(L))a.appendChild(ie(L,o,r?.context?.resolvedCommentIds));else if(X(L)&&r?.context)a.appendChild(ue(L,o,r.context));else if(j(L)){if(c(L))continue;let B=lt(L);r?.renderedInlineImageKeys?.has(B)||(r?.renderedInlineImageKeys?.add(B),a.appendChild(me(L,o)));}else a.appendChild(Re(L,o,r?.context));}break}let C=I.width;k!==void 0&&u+C+S>k&&(C=Math.max(1,k-u-S));let R=ge(p,o,C,I.leader);a.appendChild(R),u+=C;}else if(A(p)){let w=ie(p,o,r?.context?.resolvedCommentIds);if(p.highlight){let I=(p.fontSize?p.fontSize*96/72:14.67)*1.2,k=Math.max(0,t.lineHeight-I);if(k>0){let S=k/2;w.style.paddingTop=`${S}px`,w.style.paddingBottom=`${S}px`;}}a.appendChild(w);let F=p.fontSize||11,c=p.fontFamily||"Calibri";u+=g(p.text,F,c,p.bold,p.italic);}else if(j(p)){if(c(p))continue;let w=lt(p);if(r?.renderedInlineImageKeys?.has(w))continue;r?.renderedInlineImageKeys?.add(w);let F=me(p,o);a.appendChild(F),p.displayMode!=="block"&&p.wrapType!=="topAndBottom"&&(u+=p.width);}else if(W(p)){let w=Fe(p,o);a.appendChild(w);}else if(X(p)&&r?.context){let w=ue(p,o,r.context);a.appendChild(w);let F=p.fallback??"";p.fieldType==="PAGE"?F=String(r.context.pageNumber):p.fieldType==="NUMPAGES"&&(F=String(r.context.totalPages));let c=p.fontSize||11,x=p.fontFamily||"Calibri";u+=g(F,c,x,p.bold,p.italic);}else {let w=Re(p,o,r?.context);a.appendChild(w);}}if(!a.querySelector("span[data-pm-start][data-pm-end]")){let y=i.find(W);if(y?.pmStart!==void 0){let p=o.createElement("span");p.className=P.run,z(p,y.pmStart,y.pmStart),p.textContent="\u200B",a.insertBefore(p,a.firstChild);}}return a}function ae(e,t){return !e&&!t?true:!e||!t?false:e.style===t.style&&e.width===t.width&&e.color===t.color}function ct(e,t){return !e&&!t||!e||!t?false:ae(e.top,t.top)&&ae(e.bottom,t.bottom)&&ae(e.left,t.left)&&ae(e.right,t.right)&&ae(e.between,t.between)}var Gt=/[\u0590-\u085F\u08A0-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,Yt=/[\u0041-\u005A\u0061-\u007A\u00C0-\u02B8\u0370-\u0589\u10A0-\u10FF\u1E00-\u1FFF]/;function jt(e){let t=(e.runs??[]).filter(A);if(!t.some(n=>n.rtl))return false;for(let n of t)for(let o of n.text){if(Gt.test(o))return true;if(Yt.test(o))return false}return true}function D(e,t,n,o,r={}){let a=r.document??document,i=a.createElement("div");i.className=P.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),z(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 k=d??l;i.classList.add("layout-revision-pmark"),i.classList.add(d?"layout-revision-ins":"layout-revision-del"),i.dataset.revisionId=String(k.revisionId),i.dataset.revisionAuthor=k.author,k.date&&(i.dataset.revisionDate=k.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||jt(t);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 k=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 S=L=>`${L.width}px ${k(L.style)} ${L.color}`,f=ct(r.prevBorders,y),h=ct(y,r.nextBorders),C=f?y.between:y.top,R=h?void 0:y.bottom,T=a.createElement("div");if(T.className="layout-paragraph-border",T.style.position="absolute",T.style.pointerEvents="none",T.style.boxSizing="border-box",T.style.left=`${u-(y.left?.space??0)}px`,T.style.right=`${E-(y.right?.space??0)}px`,T.style.top=`${-(C?.space??0)}px`,T.style.bottom=`${-(R?.space??0)}px`,C&&(T.style.borderTop=S(C)),R&&(T.style.borderBottom=S(R)),y.left&&(T.style.borderLeft=S(y.left)),y.right&&(T.style.borderRight=S(y.right)),(C||R||y.left||y.right)&&i.appendChild(T),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=S(y.bar),i.style.position="relative",i.appendChild(L);}}t.attrs?.shading&&(i.style.backgroundColor=t.attrs.shading);let p=e.width-u-E,F=t.runs[t.runs.length-1]?.kind==="lineBreak",c=n.lines.length,x$1=0;g?.hanging&&g.hanging>0?x$1=-g.hanging:g?.firstLine&&g.firstLine>0&&(x$1=g.firstLine);let I=r.renderedInlineImageKeys??new Set;for(let k=0;k<m.length;k++){let S=m[k],f=e.fromLine+k,h=f===c-1,C=f===0&&!e.continuesFromPrev,R=S.leftOffset??0,T=S.rightOffset??0,v=p;if(C){let M=g?.hanging&&g.hanging>0,$=g?.firstLine&&g.firstLine>0;M&&g?.hanging?v=p+g.hanging:$&&g?.firstLine&&(v=p-g.firstLine);}if(Vt(S,t)){let M=a.createElement("div");M.className=`${P.line} layout-line-split`,M.style.position="relative",M.style.height=`${S.lineHeight}px`,M.style.lineHeight=`${S.lineHeight}px`;for(let $ of S.segments){let te={fromRun:$.fromRun,fromChar:$.fromChar,toRun:$.toRun,toChar:$.toChar,width:$.width,ascent:S.ascent,descent:S.descent,lineHeight:S.lineHeight},Y=he(t,te,s,a,{availableWidth:$.availableWidth,isLastLine:h,isFirstLine:C,paragraphEndsWithLineBreak:F,tabStops:t.attrs?.tabs,leftIndentPx:u,firstLineIndentPx:C?x$1:0,context:o,renderedInlineImageKeys:I});Y.className+=" layout-line-segment",Y.style.position="absolute",Y.style.left=`${$.leftOffset}px`,Y.style.top="0",Y.style.width=`${$.availableWidth}px`,M.appendChild(Y);}i.appendChild(M);continue}let L=he(t,S,s,a,{availableWidth:v-R-T,isLastLine:h,isFirstLine:C,paragraphEndsWithLineBreak:F,tabStops:t.attrs?.tabs,leftIndentPx:u,firstLineIndentPx:C?x$1:0,context:o,renderedInlineImageKeys:I,lineRightEdgePx:e.width-E-T});if(R>0||T>0){R>0&&(L.style.marginLeft=`${R}px`),T>0&&(L.style.marginRight=`${T}px`);let M=v-R-T;M>0&&(L.style.width=`${M}px`);}S.floatSkipBefore&&S.floatSkipBefore>0&&(L.style.marginTop=`${S.floatSkipBefore}px`);let B=g?.hanging&&g.hanging>0,Oe=g?.firstLine&&g.firstLine>0,kt=L.dataset.flexLine==="true";if(C?u>0&&B?(L.style.paddingLeft=`${u}px`,kt||(L.style.textIndent=`-${g.hanging}px`)):u>0&&Oe?(L.style.paddingLeft=`${u}px`,L.style.textIndent=`${g.firstLine}px`):u>0?L.style.paddingLeft=`${u}px`:Oe&&(L.style.textIndent=`${g.firstLine}px`):u>0?L.style.paddingLeft=`${u}px`:B&&(L.style.paddingLeft=`${g.hanging}px`),E>0&&(L.style.paddingRight=`${E}px`),C&&t.attrs?.listMarker&&!t.attrs?.listMarkerHidden){let M=g?.hanging??0,$=g?.firstLine??0,te=M>0?u-M:u+$;L.style.paddingLeft=`${Math.max(0,te)}px`,L.style.textIndent="0";let{fontFamily:Y,fontSize:St}=w(t),ze=Kt(t.attrs.listMarker,x(t),a,Y,St,t.attrs.listMarkerRevision);te<0&&u>0&&(ze.style.marginLeft=`${te}px`),L.insertBefore(ze,L.firstChild);}i.appendChild(L);}if((d||l)&&!e.continuesOnNext){let k=i.lastElementChild;if(k){let S=a.createElement("span");S.className="layout-revision-pmark-glyph",d?S.classList.add("layout-revision-ins"):S.classList.add("layout-revision-del"),S.textContent="\xB6",S.setAttribute("aria-hidden","true"),k.appendChild(S);}}return i}function Vt(e,t){return (e.segments?.length??0)>1&&!t.attrs?.listMarker}function Kt(e,t,n,o,r,a$1){let i=n.createElement("span");return i.className="layout-list-marker",i.style.fontFamily=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$1==="ins"?i.style.color="#2e7d32":a$1==="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"),oe(r)&&re(i,r),a.appendChild(i),o.appendChild(a);}return o}function pt(e$1,t,n){let o=[],r=0;for(let a=0;a<e$1.blocks.length;a++){let i=e$1.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(!c(s))continue;let b=s.position,g=s.distTop??0,u=s.distBottom??0,E=s.distLeft??12,y=s.distRight??12,p="left",w=0;if(b?.horizontal){let c=b.horizontal;c.align==="right"?(p="right",w=n-s.width):c.align==="left"?w=0:c.align==="center"?w=(n-s.width)/2:c.posOffset!==void 0&&(w=f(c.posOffset),p=w>n/2?"right":"left");}else s.cssFloat==="right"&&(p="right",w=n-s.width);let F=r;if(b?.vertical){let c=b.vertical;c.posOffset!==void 0?F=r+f(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:p,distTop:g,distBottom:u,distLeft:E,distRight:y,wrapText: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 Ee(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 ft(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 Le(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 _={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 Ut(e,t,n,o){let r=o.createElement("div");r.className=_.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=pt(e,t,d),m;if(l.length>0){m=l.filter(a$2).map(E=>{let y=E.x+E.width+E.distRight,p=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:p,bottomY:w}});let u=l.filter(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$1=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 p=E,w=y,F=p.attrs?.spacing,c=Math.max(b$1,F?.before??0);s+=c,m&&m.length>0&&(w=z$1(p,d,{floatingZones:m,paragraphYOffset:s}));let x={blockId:p.id,width:d,height:w.totalHeight,fromLine:0,toLine:w.lines.length,pmStart:p.pmStart,pmEnd:p.pmEnd},I={...n,insideTableCell:true},k=D(x,p,w,I,{document:o});k.style.position="relative",c>0&&(k.style.marginTop=`${c}px`),r.appendChild(k),s+=w.totalHeight,b$1=F?.after??0;}else if(E?.kind==="table"&&y?.kind==="table"){let p=E,w=y,F=b$1,c=Xt(p,w,n,o);c.style.position="relative",F>0&&(c.style.marginTop=`${F}px`),r.appendChild(c),s+=F+(y.totalHeight??0),b$1=0;}}b$1>0&&(r.style.paddingBottom=`${b$1}px`);let g=l.filter(u=>!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 Xt(e,t,n,o){let r=o.createElement("div");r.className=`${_.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=Ee(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=ve(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 gt(e,t,n,o,r,a,i,d){let l=i.createElement("div");l.className=_.cell,e.trackedMarker&&e.trackedMarker.info.revisionId!==d&&Le(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=Ut(e,t,a,i);if(l.appendChild(E),e.blocks.length>0){let y=e.blocks[0],p=e.blocks[e.blocks.length-1];y&&"pmStart"in y&&y.pmStart!==void 0&&(l.dataset.pmStart=String(y.pmStart)),p&&"pmEnd"in p&&p.pmEnd!==void 0&&(l.dataset.pmEnd=String(p.pmEnd));}return l}function qt(e,t){return b$1(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 ve(e,t,n,o,r,a,i,d,l,m,s,b){let g=d.createElement("div");g.className=_.row,b||(e.trackedDel?Le(g,"row","del",e.trackedDel):e.trackedIns&&Le(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,p=0;for(;E.has(p);)y+=r[p]??0,p++;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,I=F.rowSpan??1,k=u;if(I>1&&m){k=0;for(let T=n;T<n+I&&T<m.length-1;T++)k+=(m[T+1]??0)-(m[T]??0);k===0&&(k=t.height*I);}let S=n===0||s===true,h=p===0;p+x>=r.length;let R=gt(F,c,y,k,{isFirstRow:S,isFirstCol:h},i,d,e.trackedIns?.revisionId??e.trackedDel?.revisionId);if(R.dataset.cellIndex=String(w),R.dataset.columnIndex=String(p),I>1&&(R.dataset.rowSpan=String(I)),g.appendChild(R),I>1&&l){let T=`${n}-${p}`;l.set(T,{cell:F,cellMeasure:c,columnIndex:p,startRow:n,rowSpan:I,colSpan:x,x:y,totalHeight:k});}for(let T=0;T<x&&p+T<r.length;T++)y+=r[p+T]??0;for(p+=x;E.has(p);)y+=r[p]??0,p++;}return g}function Q(e,t,n,o,r={}){let a=r.document??document,i=a.createElement("div");i.className=_.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=(f,h)=>!!f&&!!h&&(f.author??"")===(h.author??"")&&(f.date??null)===(h.date??null),b=t.rows.length>0&&t.rows.every(f=>l?s(f.trackedIns,l):m?s(f.trackedDel,m):false);if(b){let f=l??m,h=l?"ins":"del";i.classList.add("ep-revision-table",`ep-revision-${h}`),i.dataset.revisionId=String(f.revisionId),i.dataset.revisionAuthor=f.author,f.date&&(i.dataset.revisionDate=f.date),i.style.overflowX="visible",i.style.overflowY="hidden";}let g=0;for(let f=0;f<n.columnWidths.length-1;f++){g+=n.columnWidths[f]??0;let h=a.createElement("div");h.className=_.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(f),h.dataset.tableBlockId=String(e.blockId),e.pmStart!==void 0&&(h.dataset.tablePmStart=String(e.pmStart)),i.appendChild(h);}let u=Ee(n.rows),E=qt(t,n.columnWidths),y=e.headerRowCount??0,p=0;if(y>0&&e.continuesFromPrev){let f=new Map;for(let h=0;h<y;h++){let C=t.rows[h],R=n.rows[h];if(!C||!R)continue;let T=ve(C,R,h,p,n.columnWidths,t.rows.length,o,a,f,u,h===0,b);T.dataset.repeatedHeader="true",i.appendChild(T),p+=R.height;}}let w=(u[e.fromRow]??0)+(e.topClip??0),F=f=>p+(f-w),c=e.bottomClip!==void 0?Math.round(e.height):F(u[e.toRow]??0);i.style.height=`${c}px`;let x=new Map,I=y>0&&e.continuesFromPrev;for(let f of E){if(f.rowSpan<=1||f.rowIndex>=e.fromRow||f.rowIndex+f.rowSpan<=e.fromRow||I&&f.rowIndex<y)continue;let h=n.rows[f.rowIndex]?.cells?.[f.cellIndex];if(!h)continue;let C=0;for(let B=f.rowIndex;B<f.rowIndex+f.rowSpan&&B<u.length-1;B++)C+=(u[B+1]??0)-(u[B]??0);x.set(`${f.rowIndex}-${f.columnIndex}`,{cell:f.cell,cellMeasure:h,columnIndex:f.columnIndex,startRow:f.rowIndex,rowSpan:f.rowSpan,colSpan:f.colSpan,x:f.x,totalHeight:C});f.rowIndex+f.rowSpan>=t.rows.length;let T=f.columnIndex===0;f.columnIndex+f.colSpan>=n.columnWidths.length;let L=gt(f.cell,h,f.x,C,{isFirstRow:false,isFirstCol:T},o,a);L.style.top=`${F(u[f.rowIndex]??0)}px`,L.dataset.columnIndex=String(f.columnIndex),L.dataset.vmergeContinuation="true",delete L.dataset.pmStart,delete L.dataset.pmEnd,i.appendChild(L);}for(let f=e.fromRow;f<e.toRow;f++){let h=t.rows[f],C=n.rows[f];if(!h||!C)continue;let R=y>0&&e.continuesFromPrev?false:e.continuesFromPrev&&f===e.fromRow&&!e.topClip,T=ve(h,C,f,F(u[f]??0),n.columnWidths,t.rows.length,o,a,x,u,R,b);i.appendChild(T);}let k=(f,h,C,R)=>{for(let T of E){if(T.rowIndex>f||T.rowIndex+T.rowSpan-1<f||R&&!(h==="bottom"?T.rowIndex+T.rowSpan-1>f:T.rowIndex<f))continue;let v=T.cell.borders?.[h];if(!Ce(v))continue;let L=0;for(let B=0;B<T.colSpan;B++)L+=n.columnWidths[T.columnIndex+B]??0;i.appendChild(ft(a,{x:T.x,topY:C,width:L,edge:h,border:v}));}};e.topClip?k(e.fromRow,"top",p,false):e.continuesFromPrev&&k(e.fromRow,"top",p,true),e.bottomClip!==void 0?k(e.toRow-1,"bottom",c,false):e.continuesOnNext&&k(e.toRow-1,"bottom",c,true);for(let f=e.fromRow;f<e.toRow-1;f++){let h=F(u[f+1]??0);if(h<=p||h>=e.height)continue;let C=a.createElement("div");C.className=_.rowResizeHandle,C.style.position="absolute",C.style.left="0",C.style.top=`${h-3}px`,C.style.width="100%",C.style.height="6px",C.style.cursor="row-resize",C.style.zIndex="10",C.dataset.rowIndex=String(f),C.dataset.tableBlockId=String(e.blockId),e.pmStart!==void 0&&(C.dataset.tablePmStart=String(e.pmStart)),i.appendChild(C);}let S=e.toRow===t.rows.length&&e.bottomClip===void 0;if(S){let f=a.createElement("div");f.className=_.tableEdgeHandleBottom,f.style.position="absolute",f.style.left="0",f.style.top=`${F(u[e.toRow]??0)-3}px`,f.style.width="100%",f.style.height="6px",f.style.cursor="row-resize",f.style.zIndex="10",f.dataset.rowIndex=String(t.rows.length-1),f.dataset.tableBlockId=String(e.blockId),f.dataset.isEdge="bottom",e.pmStart!==void 0&&(f.dataset.tablePmStart=String(e.pmStart)),i.appendChild(f);}if(S){let f=n.columnWidths.reduce((C,R)=>C+R,0),h=a.createElement("div");h.className=_.tableEdgeHandleRight,h.style.position="absolute",h.style.left=`${f-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 Zt={textBox:"layout-textbox"};function ee(e,t,n,o,r={}){let a=r.document??document,i=a.createElement("div");if(i.className=Zt.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",Jt(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??a$1;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=D(u,b,g,{...o,positioning:"flow"},{document:a});i.appendChild(E),m+=g.totalHeight;}return i}function Jt(e,t){!t.isFloating&&t.zIndex===void 0||(e.style.zIndex=String(t.zIndex??10));}var Qt="layout-watermark-layer";function en(e,t){let n=Math.max(e.trim().length,1),o=t/(n*.62);return Math.max(24,Math.min(o,180))}function tn(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=a(e.font).cssFallback,o.style.userSelect="none";let r=t.size.w-t.margins.left-t.margins.right,a$1=e.layout==="diagonal"?r*1.3:r,i=e.fontSize!==void 0?e.fontSize*96/72:en(e.text,a$1);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 nn(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 mt(e,t,n=document){let o=e.kind==="text"?tn(e,t,n):nn(e,t,n);if(!o)return null;let r=n.createElement("div");return r.className=Qt,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 ut(e){return e?.align??e?.alignment}function on(e,t){let n=e.position.vertical;if(!n)return e.paragraphY;let o=ut(n),r=n.posOffset!==void 0?f(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 Pe(e,t,n){if(!t)return "0";let o=ut(t);if(t.relativeTo==="page"){if(t.posOffset!==void 0)return `${f(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?`${f(t.posOffset)}px`:o==="right"?`${n.contentWidth-e}px`:o==="center"?`${(n.contentWidth-e)/2}px`:"0"}function rn(e,t,n){e.style.left=Pe(t.width,t.position.horizontal,n);}function ht(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 Be(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,p=[];for(let x of g.runs)if(x.kind==="image"&&"position"in x&&x.position){let I=x;d.push({src:I.src,width:I.width,height:I.height,alt:I.alt,paragraphY:y,position:I.position});}else p.push(x);let w={...g,runs:p},F={blockId:g.id,width:i,height:u.totalHeight,fromLine:0,toLine:u.lines.length,pmStart:g.pmStart,pmEnd:g.pmEnd},c=D(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}=ht(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=Pe(b.width,s.position?.horizontal,o),a.appendChild(u),s.displayMode!=="float"&&(l+=b.height);}else s.kind==="sectionBreak"||s.kind==="pageBreak"||s.kind==="columnBreak"||c$3(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",rn(s,m,o),s.style.top=`${on(m,o)}px`,a.appendChild(s);}return a}var be=12,Me=6;function an(e,t){if(e.size!==t.size)return false;for(let[n,o]of e)if(t.get(n)!==o)return false;return true}function sn(e,t){for(let[n,o]of t)if((e.get(n)??0)<o)return false;return true}function ln(e,t){let n=new Map(e);for(let[o,r]of t)n.set(o,Math.max(n.get(o)??0,r));return n}var $e=8;function Ro(e){let t=[],n=(o,r)=>{for(let a of o)if(a.kind==="paragraph")for(let i of a.runs)i.kind==="text"&&i.footnoteRefId!=null&&t.push({footnoteId:i.footnoteRefId,pmPos:i.pmStart??0,...r??{}});else a.kind==="table"?a.rows.forEach((i,d)=>{for(let l of i.cells)n(l.blocks,r??{tableBlockId:a.id,rowIndex:d});}):a.kind==="textBox"&&n(a.content,r);};return n(e),t}function ye(e,t){let n=new Map;if(t.length===0)return n;let o=(r,a)=>{let i=n.get(r)??[];i.includes(a)||i.push(a),n.set(r,i);};for(let r of t){let a=false;for(let i of e){for(let d of i.fragments){let l=false;if(r.tableBlockId!=null&&r.rowIndex!=null)l=d.kind==="table"&&d.blockId===r.tableBlockId&&r.rowIndex>=d.fromRow&&r.rowIndex<d.toRow;else {let m=d.pmStart??-1,s=d.pmEnd??-1;l=m>=0&&s>=0&&r.pmPos>=m&&r.pmPos<s;}if(l){o(i.number,r.footnoteId),a=true;break}}if(a)break}}return n}function dn(e,t){if(e.length===0)return [{kind:"paragraph",id:`fn-empty-${t}`,runs:[{kind:"text",text:`${t} `,fontSize:$e,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:$e}:i)}}),o=n[0];if(o.kind==="paragraph"){let r=o,a=r.runs.find(d=>d.kind==="text"),i={kind:"text",text:`${t} `,fontSize:$e,superscript:true,...a?.fontFamily?{fontFamily:a.fontFamily}:{}};n[0]={...r,runs:[i,...r.runs]};}return n}function cn(e,t,n,o){let r=c$1(e.content,{styles:o.styles??void 0,theme:o.theme??null,defaultTabStopTwips:o.defaultTabStopTwips??null}),a=c$2(r,{theme:o.theme??void 0}),i=dn(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 Co(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,cn(m,i,n,o)),i++);}return r}function He(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+=be,n.set(o,a));}return n}function Eo(e){let{blocks:t,measures:n,layoutOpts:o,footnoteRefs:r,footnoteContentMap:a,initialLayout:i}=e,d=ye(i.pages,r),l=He(d,a);if(l.size===0)return {layout:i,pageFootnoteMap:d,converged:true};let m=i,s=false;for(let b=0;b<Me;b++){m=X$1(t,n,{...o,footnoteReservedHeights:l});let g=ye(m.pages,r),u=He(g,a);if(d=g,an(l,u)){l=u,s=true;break}l=u;}if(!s){let b=l,g=false;for(let u=0;u<Me;u++){m=X$1(t,n,{...o,footnoteReservedHeights:b}),d=ye(m.pages,r);let E=He(d,a);if(sn(b,E)){g=true;break}b=ln(b,E);}g||(m=X$1(t,n,{...o,footnoteReservedHeights:b}),d=ye(m.pages,r)),console.warn(`[docx-editor] footnote layout did not stabilize within ${Me} passes; settling with conservative page reservations. 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 Lo(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:x$1(m),content:s});}d.length>0&&o.set(a,d);}return o}function pn(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=D(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 fn(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 yt(e){let t=be;for(let n of e)n.content&&(t+=n.content.height);return t}function bt(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=(be-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?pn(l.content,t,n,o):fn(l,o));return r}function Ae(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 xt(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 gn(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 mn(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 xe=2,un=8;function hn(e,t,n={}){let o=e.length,r=n.pageGap??24,a=t,i=a.__pageRenderState,d=gn(n),l=o>=un;if(i&&i.optionsHash===d&&l){let p=i.pageStates,w=i.pageDataMap,F=a.__pageObserver,c=[];for(let k of e)c.push(xt(k));let x=i.totalPages!==o,I=Math.min(p.length,e.length);for(let k=0;k<I;k++){let S=p[k],f=c[k];if(S.fingerprint===f&&!x){let R=w.get(S.element);R&&(R.page=e[k]);continue}let h=S.element,C=w.get(h);C&&(C.page=e[k],C.rendered&&yn(h,w,o,n)),S.fingerprint=f,le(h,e[k].size.w,e[k].size.h,n),h.dataset.pageNumber=String(e[k].number);}if(e.length>p.length){let k=n.document??document;for(let S=p.length;S<e.length;S++){let f=e[S],h=k.createElement("div");h.className=n.pageClassName??G.page,h.dataset.pageNumber=String(f.number),h.dataset.pageIndex=String(S),le(h,f.size.w,f.size.h,n),t.appendChild(h),p.push({element:h,fingerprint:c[S]}),w.set(h,{page:f,index:S,rendered:false}),F&&F.observe(h);}}if(e.length<p.length){for(let k=p.length-1;k>=e.length;k--){let S=p[k].element;F&&F.unobserve(S),w.delete(S),t.removeChild(S);}p.length=e.length;}for(let k=0;k<p.length;k++){let S=w.get(p[k].element);S&&(S.index=k);}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,mn(t,r);let b=[],g=[];for(let p=0;p<e.length;p++){let w=e[p];if(g.push(xt(w)),l){let c=(n.document??document).createElement("div");c.className=n.pageClassName??G.page,c.dataset.pageNumber=String(w.number),c.dataset.pageIndex=String(p),le(c,w.size.w,w.size.h,n),t.appendChild(c),b.push(c);}else {let{context:F,pageOptions:c}=Ae(w,o,n),x=ke(w,F,c);t.appendChild(x),b.push(x);}}if(!l)return "full";let u=new Map;for(let p=0;p<e.length;p++)u.set(b[p],{page:e[p],index:p,rendered:false});let E=new IntersectionObserver(p=>{let w=a.__pageRenderState;if(!w)return;let{currentOptions:F,totalPages:c,pageDataMap:x}=w;for(let f of p){let h=f.target,C=x.get(h);if(C&&f.isIntersecting){se(h,x,c,F);for(let R=-xe;R<=xe;R++){let T=C.index+R;T>=0&&T<w.pageStates.length&&T!==C.index&&se(w.pageStates[T].element,x,c,F);}}}let I=window.innerHeight,k=I*3,S=new Set;for(let[f,h]of x){if(!h.rendered)continue;let C=f.getBoundingClientRect();C.bottom>-k&&C.top<I+k&&S.add(h.index);}for(let[f,h]of x){if(!h.rendered)continue;let C=false;for(let R of S)if(Math.abs(h.index-R)<=xe+1){C=true;break}!C&&S.size>0&&bn(f,x);}},{root:null,rootMargin:"1500px 0px 1500px 0px"});for(let p of b)E.observe(p);a.__pageObserver=E,a.__pageRenderState={pageStates:b.map((p,w)=>({element:p,fingerprint:g[w]})),totalPages:o,optionsHash:d,pageDataMap:u,currentOptions:n};let y=Math.min(e.length,xe+3);for(let p=0;p<y;p++)se(b[p],u,o,n);return "full"}function se(e,t,n,o){let r=t.get(e);if(!r||r.rendered)return;let{context:a,pageOptions:i}=Ae(r.page,n,o),d=ke(r.page,a,i);for(;d.firstChild;)e.appendChild(d.firstChild);r.rendered=true;}function yn(e,t,n,o){let r=t.get(e);if(!r)return;let{context:a,pageOptions:i}=Ae(r.page,n,o),l=ke(r.page,a,i).querySelector(`.${G.content}`),m=e.querySelector(`.${G.content}`);l&&m?e.replaceChild(l,m):(e.innerHTML="",r.rendered=false,se(e,t,n,o));}function bn(e,t){let n=t.get(e);!n||!n.rendered||(e.innerHTML="",n.rendered=false);}function xn(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||(se(l,i,r,a),d++);}return d}var G={page:"layout-page",content:"layout-page-content",header:"layout-page-header",footer:"layout-page-footer"};function le(e,t,n,o){e.style.position="relative",e.style.width=`${t}px`,e.style.height=`${n}px`,e.style.backgroundColor=o.backgroundColor??"var(--doc-page-bg, #ffffff)",e.style.overflow="hidden",e.style.fontFamily=a("Calibri").cssFallback,e.style.fontSize=`${1056/72}px`,e.style.color="var(--doc-page-text, #000000)",o.showBorders&&(e.style.border="1px solid #ccc"),o.showShadow&&(e.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");}function kn(e,t){switch(t??"allPages"){case "firstPage":return e===1;case "notFirstPage":return e!==1;default:return true}}function Se(e){return e?.space!==void 0?j$1(e.space):0}function we(e,t,n,o){if(!t||t.style==="none"||t.style==="nil")return;let r=c$4(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 Sn(e,t,n){let o=t.pageBorders;if(!o||!kn(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=Se(o.top),d=Se(o.right),l=Se(o.bottom),m=Se(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`),we(s,o.top,"Top",t.theme),we(s,o.bottom,"Bottom",t.theme),we(s,o.left,"Left",t.theme),we(s,o.right,"Right",t.theme),s}function wn(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 In(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 Tn(e$1,t,n,o){let r=[];for(let a of e$1.runs){if(a.kind!=="image")continue;let i=a;if(!c(i))continue;let d=i.distTop??0,l=i.distBottom??0,m=i.distLeft??12,s=i.distRight??12,{x:b,y:g$1,side:u}=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$1,distTop:d,distBottom:l,distLeft:m,distRight:s,pmStart:i.pmStart,pmEnd:i.pmEnd,wrapText:e(i.cssFloat),wrapType:i.wrapType,cropTop:i.cropTop,cropRight:i.cropRight,cropBottom:i.cropBottom,cropLeft:i.cropLeft,opacity:i.opacity});}return r}function ke(e,t,n={}){let o=n.document??document,r=o.createElement("div");if(r.className=n.pageClassName??G.page,r.dataset.pageNumber=String(e.number),le(r,e.size.w,e.size.h,n),n.watermark){let c=mt(n.watermark,e,o);c&&r.appendChild(c);}let a=Sn(e,n,o);a&&n.pageBorders?.zOrder==="back"&&r.appendChild(a);let i=o.createElement("div");i.className=G.content,wn(i,e);let d=f$1(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 I=x.block,k=c.y-e.margins.top,S=Tn(I,k,l,d);m.push(...S);}}for(let c of m)a$2(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 k=x.block.floating;if(!k)continue;let S=c.x-e.margins.left,f=c.y-e.margins.top,h=k.topFromText??0,C=k.bottomFromText??0,R=k.leftFromText??12,T=k.rightFromText??12,v=S<l/2?"left":"right";s.push({side:v,x:S,y:f,width:c.width,height:c.height,distTop:h,distBottom:C,distLeft:R,distRight:T});}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 I=x.block;if(!L(I))continue;let k=c.y-e.margins.top,S=g({width:c.width,height:c.height,position:I.position,cssFloat:I.cssFloat},k,l,d);c.x=e.margins.left+S.x,c.y=e.margins.top+S.y,!(!M(I)&&!N$1(I))&&s.push({side:S.side,x:S.x,y:S.y,width:c.width,height:c.height,distTop:I.distTop??0,distBottom:I.distBottom??0,distLeft:I.distLeft??12,distRight:I.distRight??12,wrapText:I.wrapText,wrapType:I.wrapType});}let b$1=s.length>0?C(s,l):[],g$1=m.filter(b),u=m.filter(c=>!b(c));if(g$1.length>0){let c=q(g$1,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,p=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 I=x[x.length-1];c.classList.add("layout-block-sdt"),c.dataset.sdtGroupId=I.id,c.dataset.sdtType=I.sdtType,c.dataset.sdtDepth=String(x.length),I.tag!=null&&(c.dataset.sdtTag=I.tag),I.alias!=null&&(c.dataset.sdtAlias=I.alias),I.lock!=null&&(c.dataset.sdtLock=I.lock);};for(let c=0;c<e.fragments.length;c++){let x=e.fragments[c],I,k={...t,section:"body",contentWidth:l},S=x.y-e.margins.top;if(n.blockLookup&&x.blockId){let f=n.blockLookup.get(String(x.blockId));if(x.kind==="paragraph"&&f?.block.kind==="paragraph"&&f?.measure.kind==="paragraph"){let h=f.block,C=c+1<e.fragments.length?E(e.fragments[c+1]):void 0,R=String(x.blockId),T=p.get(R);T||(T=new Set,p.set(R,T));let v=f.measure;b$1.length>0&&(v=z$1(h,l,{floatingZones:b$1,paragraphYOffset:S})),I=D(x,h,v,k,{document:o,prevBorders:y,nextBorders:C,renderedInlineImageKeys:T}),y=h.attrs?.borders;}else x.kind==="table"&&f?.block.kind==="table"&&f?.measure.kind==="table"?(I=Q(x,f.block,f.measure,k,{document:o}),y=void 0):x.kind==="image"&&f?.block.kind==="image"&&f?.measure.kind==="image"?(I=Z(x,f.block,f.measure,k,{document:o}),y=void 0):x.kind==="textBox"&&f?.block.kind==="textBox"&&f?.measure.kind==="textBox"?(I=ee(x,f.block,f.measure,k,{document:o}),y=void 0):(I=Te(x,k,{document:o}),y=void 0);}else I=Te(x,k,{document:o}),y=void 0;In(I,x,{left:e.margins.left,top:e.margins.top}),F(I,w(x)),i.appendChild(I);}if(tt(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,I=(l-(c-1)*x)/c,k=e.size.h-e.margins.top-e.margins.bottom;for(let S=0;S<c-1;S++){let f=(S+1)*I+S*x+x/2,h=o.createElement("div");h.style.position="absolute",h.style.left=`${f}px`,h.style.top="0",h.style.height=`${k}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=bt(n.footnoteArea,l,t,o);c.style.position="absolute";let x=Math.max(e.footnoteReservedHeight??0,yt(n.footnoteArea)),I=e.size.h-e.margins.bottom-e.margins.top;c.style.top=`${Math.max(-e.margins.top,I-x)}px`,c.style.left="0",c.style.right="0",i.appendChild(c);}r.appendChild(i);{let x=n.headerDistance??e.margins.header??48,I=e.size.w-e.margins.left-e.margins.right,k=Math.max(e.margins.top-x,48),S=n.headerContent?.visualTop??0,f=n.headerContent?.visualBottom??n.headerContent?.height??0,h=Math.max(f-S,24),C=f>k,R=o.createElement("div");R.className=G.header,R.style.position="absolute",R.style.top=`${x+S}px`,R.style.left=`${e.margins.left}px`,R.style.right=`${e.margins.right}px`,R.style.width=`${I}px`,R.style.height=`${h}px`,R.style.minHeight=`${h}px`;let T=!C;if(n.headerContent&&n.headerContent.blocks.length>0){let v={flowTop:x,flowLeft:e.margins.left,contentWidth:I,pageWidth:e.size.w,pageHeight:e.size.h,margins:e.margins},L=Be(n.headerContent,{...t,section:"header",contentWidth:I},n,v);L.style.top=`${-S}px`,L.querySelector("img")&&(T=false),R.appendChild(L);}T&&(R.style.maxHeight=`${k}px`,R.style.overflow="hidden"),r.appendChild(R);}{let x=n.footerDistance??e.margins.footer??48,I=e.size.w-e.margins.left-e.margins.right,k=Math.max(e.margins.bottom-x,48),S=n.footerContent?.visualTop??0,f=n.footerContent?.visualBottom??n.footerContent?.height??0,h=Math.max(f-S,24),C=h>k,R=o.createElement("div");R.className=G.footer,R.style.position="absolute",R.style.top=`${e.size.h-x-h}px`,R.style.left=`${e.margins.left}px`,R.style.right=`${e.margins.right}px`,R.style.width=`${I}px`,R.style.height=`${h}px`,R.style.minHeight=`${h}px`;let T=!C;if(n.footerContent&&n.footerContent.blocks.length>0){let v={flowTop:e.size.h-x-(n.footerContent?.height??0),flowLeft:e.margins.left,contentWidth:I,pageWidth:e.size.w,pageHeight:e.size.h,margins:e.margins},L=Be(n.footerContent,{...t,section:"footer",contentWidth:I},n,v);L.style.top=`${-S}px`,L.querySelector("img")&&(T=false),R.appendChild(L);}T&&(R.style.maxHeight=`${k}px`,R.style.overflow="hidden"),r.appendChild(R);}return a&&n.pageBorders?.zOrder!=="back"&&r.appendChild(a),r}export{ht as A,hn as B,xn as C,G as D,le as E,ke as F,be as a,Me as b,an as c,Ro as d,ye as e,dn as f,cn as g,Co as h,He as i,Eo as j,Lo as k,Fn as l,Rn as m,U as n,Te as o,nt as p,Z as q,dt as r,he as s,D as t,q as u,_ as v,Q as w,Zt as x,ee as y,Pe as z};
1
+ import {c as c$2}from'./chunk-6UCWVS7Y.mjs';import {c,f as f$1,a as a$2,g,b,e}from'./chunk-QCPISGPW.mjs';import {v,w,x,X as X$1,L,M,N as N$1,C,z as z$1,b as b$1}from'./chunk-VMBCUUZM.mjs';import {a as a$1,c as c$3}from'./chunk-7E5VBRDL.mjs';import {x as x$1}from'./chunk-3QQLHMB6.mjs';import {c as c$1}from'./chunk-T5G3IWCO.mjs';import {c as c$4}from'./chunk-PJEB3ZWG.mjs';import {a}from'./chunk-AMENZY5F.mjs';import {f,j as j$1}from'./chunk-KNY7SXPJ.mjs';function tt(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}`,p=a.get(y);p?(p.top=Math.min(p.top,b),p.bottom=Math.max(p.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 p=s.alias||s.tag||s.sdtType;if(p){let F=r.createElement("span");F.className="layout-block-sdt-label",F.textContent=p,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);}It(t,l);}function wt(e){return e==="checkbox"?"checkbox":e==="dropDownList"||e==="comboBox"?"dropdown":e==="date"?"date":null}function It(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 Fn(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 Rn(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 Tt(e){return e.kind==="paragraph"}function Ft(e){return e.kind==="table"}function Rt(e){return e.kind==="image"}function fe(e){e.style.position="absolute",e.style.overflow="hidden";}function Ct(e,t,n){let o=n.createElement("div");return o.className=`${U.fragment} ${U.paragraph}`,fe(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}`,fe(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}`,fe(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(Tt(e))return Ct(e,t,o);if(Ft(e))return Et(e,t,o);if(Rt(e))return Lt(e,t,o);let r=o.createElement("div");r.className=U.fragment,fe(r);let a=e;return a.blockId!==void 0&&(r.dataset.blockId=String(a.blockId)),a.kind&&(r.dataset.kind=a.kind),r}var P={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 A(e){return e.kind==="text"}function N(e){return e.kind==="tab"}function j(e){return e.kind==="image"}function W(e){return e.kind==="lineBreak"}function X(e){return e.kind==="field"}var nt={image:"layout-image",imageAnchored:"layout-image-anchored"};function oe(e){return !!(e.cropTop||e.cropRight||e.cropBottom||e.cropLeft||e.opacity!=null&&e.opacity<1)}function re(e,t){t.opacity!=null&&t.opacity<1&&(e.style.opacity=String(Math.max(0,t.opacity))),vt(e,t);}function vt(e,t){let n=t.cropTop??0,o=t.cropRight??0,r=t.cropBottom??0,a=t.cropLeft??0;if(!(n||o||r||a))return;let i=a+o>0?a/(a+o)*100:50,d=n+r>0?n/(n+r)*100:50;e.style.objectFit="cover",e.style.objectPosition=`${i}% ${d}%`;}function Z(e,t,n,o,r={}){let a=r.document??document,i=a.createElement("div");i.className=nt.image,e.isAnchored&&i.classList.add(nt.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 Pt(e,t,n){if(t.fontFamily&&(e.style.fontFamily=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.style.cursor="pointer",e.style.transition="background-color 0.15s ease",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.fontSize="0.75em",e.style.position="relative",e.style.top="-0.4em"),t.subscript&&(e.style.fontSize="0.75em",e.style.position="relative",e.style.top="0.2em"),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 z(e,t,n){t!==void 0&&(e.dataset.pmStart=String(t)),n!==void 0&&(e.dataset.pmEnd=String(n));}function Bt(e,t){let n=t.inlineSdtWidget;n&&(e.classList.add("layout-inline-sdt-widget"),e.dataset.sdtWidget=n.kind,e.dataset.sdtGroupId=n.groupId,e.dataset.sdtPos=String(n.pos),n.tag&&(e.dataset.sdtTag=n.tag),n.alias&&(e.dataset.sdtAlias=n.alias),typeof n.checked=="boolean"&&(e.dataset.sdtChecked=String(n.checked),e.setAttribute("aria-checked",String(n.checked))),e.setAttribute("role","checkbox"),e.setAttribute("tabindex","0"),e.setAttribute("aria-label",n.alias||n.tag||"Checkbox content control"));}function ie(e,t,n){let o=t.createElement("span");if(o.className=`${P.run} ${P.text}`,Pt(o,e,n),z(o,e.pmStart,e.pmEnd),Bt(o,e),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 Mt=1e3;function ge(e,t,n,o){let r=t.createElement("span");r.className=`${P.run} ${P.tab}`,r.style.display="inline-block",r.style.width=`${n}px`,z(r,e.pmStart,e.pmEnd);let a=o&&o!=="none"?$t(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(Mt),r.appendChild(i);}else r.textContent="\xA0";return r}function $t(e){switch(e){case "dot":return ".";case "hyphen":return "-";case "underscore":return "_";case "middleDot":return "\xB7";case "heavy":return "_";default:return null}}function it(e){if(!e)return 0;let t=e.match(/rotate\(([-\d.]+)deg\)/);return t?(parseFloat(t[1])%360+360)%360:0}function at(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 ot(e,t){t.distTop&&(e.style.marginTop=`${t.distTop}px`),t.distBottom&&(e.style.marginBottom=`${t.distBottom}px`);}function Ht(e,t){let n=t.createElement("img");n.className=`${P.run} ${P.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"),oe(e)&&re(n,e);let o=it(e.transform);if(o!==0){let r=at(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`,ot(a,e),z(a,e.pmStart,e.pmEnd),a.appendChild(n),a}return n.style.display="inline-block",n.style.verticalAlign="middle",e.width>0&&e.height>0&&(n.style.height="auto",n.style.aspectRatio=`${e.width} / ${e.height}`,n.style.maxWidth="100%"),ot(n,e),z(n,e.pmStart,e.pmEnd),n}function rt(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"),oe(e)&&re(o,e);let r=it(e.transform);if(r!==0){let a=at(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 z(n,e.pmStart,e.pmEnd),n.appendChild(o),n}function me(e,t){let n;return c(e)||e.displayMode==="block"||e.wrapType==="topAndBottom"?n=rt(e,t):n=Ht(e,t),At(n,e),n}function At(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 Fe(e,t){let n=t.createElement("br");return n.className=`${P.run} ${P.lineBreak}`,z(n,e.pmStart,e.pmEnd),n}function ue(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 ie(r,t,n?.resolvedCommentIds)}function Re(e,t,n){if(A(e))return ie(e,t,n?.resolvedCommentIds);if(N(e))return ge(e,t,48,void 0);if(j(e))return me(e,t);if(W(e))return Fe(e,t);if(X(e)&&n)return ue(e,t,n);let o=t.createElement("span");return o.className=P.run,o}function dt(e,t){let n=[],o=e.runs;for(let r=t.fromRun;r<=t.toRun;r++){let a=o[r];if(a)if(A(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 st(e){return e==="center"?"center":e==="right"?"flex-end":"flex-start"}function Ot(e,t){let n=e.position?.horizontal;return n?n.align??"left":t}function lt(e){return [e.pmStart??"no-start",e.pmEnd??"no-end",e.src,e.width,e.height,e.displayMode??"inline",e.wrapType??"none"].join("|")}function zt(e){return {val:e.val,pos:e.pos,leader:e.leader}}function Dt(e,t,n){let o="";for(let r=t+1;r<e.length;r++){let a=e[r];if(A(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(N(a)||W(a))break}return o}var Nt=.5;function Wt(e,t,n,o){let r=0;for(let a=t+1;a<e.length;a++){let i=e[a];if(N(i)||W(i))break;if(A(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 j(i)&&!c(i)&&(r+=i.width||0);}return r}function _t(e){let n=e.createElement("canvas").getContext("2d");return (o,r=11,a$1="Calibri",i=false,d=false)=>{if(!n)return o.length*7;let l=a(a$1).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 he(e,t,n,o,r){let a=o.createElement("div");a.className=P.line,a.style.height=`${t.lineHeight}px`,a.style.lineHeight=`${t.lineHeight}px`;let i=dt(e,t);if(i.length===1&&j(i[0])){let y=i[0],p=Ot(y,n);a.style.display="flex",a.style.alignItems="center",a.style.justifyContent=st(p),a.dataset.flexLine="true";}else i.some(j)&&(a.style.display="flex",a.style.alignItems="baseline",a.style.justifyContent=st(n),a.style.lineHeight="normal",a.dataset.flexLine="true");if(i.length===0){let y=o.createElement("span");return y.className=`${P.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=>A(y)&&y.highlight);a.style.overflow=m?"hidden":"visible";let s=i.some(N),b,g=_t(o);if(s){let y=r?.tabStops?.map(zt),p=r?.leftIndentPx?Math.round(r.leftIndentPx*15):0;b={explicitStops:y,leftIndent:p};}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 p=i[y];if(N(p)&&b){let w=Wt(i,y,g,r?.context),F=Dt(i,y,r?.context),c$1=F.indexOf("."),x=c$1>=0?g(F.slice(0,c$1)):0,I=v(u,b,{followingWidth:w,decimalPrefixWidth:x}),k=r?.lineRightEdgePx,S=w,f=false;for(let T=y+1;T<i.length&&!W(i[T]);T++)if(N(i[T])){f=true;break}if(k!==void 0&&I.alignment==="end"&&!f&&u+I.width+S>=k-Nt){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 T=ge(p,o,0,I.leader);T.style.flex="1 1 0",T.style.minWidth="0",T.style.width="auto",a.appendChild(T);for(let v=y+1;v<i.length;v++){let L=i[v];if(N(L)||W(L))break;if(A(L))a.appendChild(ie(L,o,r?.context?.resolvedCommentIds));else if(X(L)&&r?.context)a.appendChild(ue(L,o,r.context));else if(j(L)){if(c(L))continue;let B=lt(L);r?.renderedInlineImageKeys?.has(B)||(r?.renderedInlineImageKeys?.add(B),a.appendChild(me(L,o)));}else a.appendChild(Re(L,o,r?.context));}break}let C=I.width;k!==void 0&&u+C+S>k&&(C=Math.max(1,k-u-S));let R=ge(p,o,C,I.leader);a.appendChild(R),u+=C;}else if(A(p)){let w=ie(p,o,r?.context?.resolvedCommentIds);if(p.highlight){let I=(p.fontSize?p.fontSize*96/72:14.67)*1.2,k=Math.max(0,t.lineHeight-I);if(k>0){let S=k/2;w.style.paddingTop=`${S}px`,w.style.paddingBottom=`${S}px`;}}a.appendChild(w);let F=p.fontSize||11,c=p.fontFamily||"Calibri";u+=g(p.text,F,c,p.bold,p.italic);}else if(j(p)){if(c(p))continue;let w=lt(p);if(r?.renderedInlineImageKeys?.has(w))continue;r?.renderedInlineImageKeys?.add(w);let F=me(p,o);a.appendChild(F),p.displayMode!=="block"&&p.wrapType!=="topAndBottom"&&(u+=p.width);}else if(W(p)){let w=Fe(p,o);a.appendChild(w);}else if(X(p)&&r?.context){let w=ue(p,o,r.context);a.appendChild(w);let F=p.fallback??"";p.fieldType==="PAGE"?F=String(r.context.pageNumber):p.fieldType==="NUMPAGES"&&(F=String(r.context.totalPages));let c=p.fontSize||11,x=p.fontFamily||"Calibri";u+=g(F,c,x,p.bold,p.italic);}else {let w=Re(p,o,r?.context);a.appendChild(w);}}if(!a.querySelector("span[data-pm-start][data-pm-end]")){let y=i.find(W);if(y?.pmStart!==void 0){let p=o.createElement("span");p.className=P.run,z(p,y.pmStart,y.pmStart),p.textContent="\u200B",a.insertBefore(p,a.firstChild);}}return a}function ae(e,t){return !e&&!t?true:!e||!t?false:e.style===t.style&&e.width===t.width&&e.color===t.color}function ct(e,t){return !e&&!t||!e||!t?false:ae(e.top,t.top)&&ae(e.bottom,t.bottom)&&ae(e.left,t.left)&&ae(e.right,t.right)&&ae(e.between,t.between)}var Gt=/[\u0590-\u085F\u08A0-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,Yt=/[\u0041-\u005A\u0061-\u007A\u00C0-\u02B8\u0370-\u0589\u10A0-\u10FF\u1E00-\u1FFF]/;function jt(e){let t=(e.runs??[]).filter(A);if(!t.some(n=>n.rtl))return false;for(let n of t)for(let o of n.text){if(Gt.test(o))return true;if(Yt.test(o))return false}return true}function D(e,t,n,o,r={}){let a=r.document??document,i=a.createElement("div");i.className=P.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),z(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 k=d??l;i.classList.add("layout-revision-pmark"),i.classList.add(d?"layout-revision-ins":"layout-revision-del"),i.dataset.revisionId=String(k.revisionId),i.dataset.revisionAuthor=k.author,k.date&&(i.dataset.revisionDate=k.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||jt(t);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 k=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 S=L=>`${L.width}px ${k(L.style)} ${L.color}`,f=ct(r.prevBorders,y),h=ct(y,r.nextBorders),C=f?y.between:y.top,R=h?void 0:y.bottom,T=a.createElement("div");if(T.className="layout-paragraph-border",T.style.position="absolute",T.style.pointerEvents="none",T.style.boxSizing="border-box",T.style.left=`${u-(y.left?.space??0)}px`,T.style.right=`${E-(y.right?.space??0)}px`,T.style.top=`${-(C?.space??0)}px`,T.style.bottom=`${-(R?.space??0)}px`,C&&(T.style.borderTop=S(C)),R&&(T.style.borderBottom=S(R)),y.left&&(T.style.borderLeft=S(y.left)),y.right&&(T.style.borderRight=S(y.right)),(C||R||y.left||y.right)&&i.appendChild(T),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=S(y.bar),i.style.position="relative",i.appendChild(L);}}t.attrs?.shading&&(i.style.backgroundColor=t.attrs.shading);let p=e.width-u-E,F=t.runs[t.runs.length-1]?.kind==="lineBreak",c=n.lines.length,x$1=0;g?.hanging&&g.hanging>0?x$1=-g.hanging:g?.firstLine&&g.firstLine>0&&(x$1=g.firstLine);let I=r.renderedInlineImageKeys??new Set;for(let k=0;k<m.length;k++){let S=m[k],f=e.fromLine+k,h=f===c-1,C=f===0&&!e.continuesFromPrev,R=S.leftOffset??0,T=S.rightOffset??0,v=p;if(C){let M=g?.hanging&&g.hanging>0,$=g?.firstLine&&g.firstLine>0;M&&g?.hanging?v=p+g.hanging:$&&g?.firstLine&&(v=p-g.firstLine);}if(Vt(S,t)){let M=a.createElement("div");M.className=`${P.line} layout-line-split`,M.style.position="relative",M.style.height=`${S.lineHeight}px`,M.style.lineHeight=`${S.lineHeight}px`;for(let $ of S.segments){let te={fromRun:$.fromRun,fromChar:$.fromChar,toRun:$.toRun,toChar:$.toChar,width:$.width,ascent:S.ascent,descent:S.descent,lineHeight:S.lineHeight},Y=he(t,te,s,a,{availableWidth:$.availableWidth,isLastLine:h,isFirstLine:C,paragraphEndsWithLineBreak:F,tabStops:t.attrs?.tabs,leftIndentPx:u,firstLineIndentPx:C?x$1:0,context:o,renderedInlineImageKeys:I});Y.className+=" layout-line-segment",Y.style.position="absolute",Y.style.left=`${$.leftOffset}px`,Y.style.top="0",Y.style.width=`${$.availableWidth}px`,M.appendChild(Y);}i.appendChild(M);continue}let L=he(t,S,s,a,{availableWidth:v-R-T,isLastLine:h,isFirstLine:C,paragraphEndsWithLineBreak:F,tabStops:t.attrs?.tabs,leftIndentPx:u,firstLineIndentPx:C?x$1:0,context:o,renderedInlineImageKeys:I,lineRightEdgePx:e.width-E-T});if(R>0||T>0){R>0&&(L.style.marginLeft=`${R}px`),T>0&&(L.style.marginRight=`${T}px`);let M=v-R-T;M>0&&(L.style.width=`${M}px`);}S.floatSkipBefore&&S.floatSkipBefore>0&&(L.style.marginTop=`${S.floatSkipBefore}px`);let B=g?.hanging&&g.hanging>0,Oe=g?.firstLine&&g.firstLine>0,kt=L.dataset.flexLine==="true";if(C?u>0&&B?(L.style.paddingLeft=`${u}px`,kt||(L.style.textIndent=`-${g.hanging}px`)):u>0&&Oe?(L.style.paddingLeft=`${u}px`,L.style.textIndent=`${g.firstLine}px`):u>0?L.style.paddingLeft=`${u}px`:Oe&&(L.style.textIndent=`${g.firstLine}px`):u>0?L.style.paddingLeft=`${u}px`:B&&(L.style.paddingLeft=`${g.hanging}px`),E>0&&(L.style.paddingRight=`${E}px`),C&&t.attrs?.listMarker&&!t.attrs?.listMarkerHidden){let M=g?.hanging??0,$=g?.firstLine??0,te=M>0?u-M:u+$;L.style.paddingLeft=`${Math.max(0,te)}px`,L.style.textIndent="0";let{fontFamily:Y,fontSize:St}=w(t),ze=Kt(t.attrs.listMarker,x(t),a,Y,St,t.attrs.listMarkerRevision);te<0&&u>0&&(ze.style.marginLeft=`${te}px`),L.insertBefore(ze,L.firstChild);}i.appendChild(L);}if((d||l)&&!e.continuesOnNext){let k=i.lastElementChild;if(k){let S=a.createElement("span");S.className="layout-revision-pmark-glyph",d?S.classList.add("layout-revision-ins"):S.classList.add("layout-revision-del"),S.textContent="\xB6",S.setAttribute("aria-hidden","true"),k.appendChild(S);}}return i}function Vt(e,t){return (e.segments?.length??0)>1&&!t.attrs?.listMarker}function Kt(e,t,n,o,r,a$1){let i=n.createElement("span");return i.className="layout-list-marker",i.style.fontFamily=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$1==="ins"?i.style.color="#2e7d32":a$1==="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"),oe(r)&&re(i,r),a.appendChild(i),o.appendChild(a);}return o}function pt(e$1,t,n){let o=[],r=0;for(let a=0;a<e$1.blocks.length;a++){let i=e$1.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(!c(s))continue;let b=s.position,g=s.distTop??0,u=s.distBottom??0,E=s.distLeft??12,y=s.distRight??12,p="left",w=0;if(b?.horizontal){let c=b.horizontal;c.align==="right"?(p="right",w=n-s.width):c.align==="left"?w=0:c.align==="center"?w=(n-s.width)/2:c.posOffset!==void 0&&(w=f(c.posOffset),p=w>n/2?"right":"left");}else s.cssFloat==="right"&&(p="right",w=n-s.width);let F=r;if(b?.vertical){let c=b.vertical;c.posOffset!==void 0?F=r+f(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:p,distTop:g,distBottom:u,distLeft:E,distRight:y,wrapText: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 Ee(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 ft(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 Le(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 _={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 Ut(e,t,n,o){let r=o.createElement("div");r.className=_.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=pt(e,t,d),m;if(l.length>0){m=l.filter(a$2).map(E=>{let y=E.x+E.width+E.distRight,p=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:p,bottomY:w}});let u=l.filter(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$1=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 p=E,w=y,F=p.attrs?.spacing,c=Math.max(b$1,F?.before??0);s+=c,m&&m.length>0&&(w=z$1(p,d,{floatingZones:m,paragraphYOffset:s}));let x={blockId:p.id,width:d,height:w.totalHeight,fromLine:0,toLine:w.lines.length,pmStart:p.pmStart,pmEnd:p.pmEnd},I={...n,insideTableCell:true},k=D(x,p,w,I,{document:o});k.style.position="relative",c>0&&(k.style.marginTop=`${c}px`),r.appendChild(k),s+=w.totalHeight,b$1=F?.after??0;}else if(E?.kind==="table"&&y?.kind==="table"){let p=E,w=y,F=b$1,c=Xt(p,w,n,o);c.style.position="relative",F>0&&(c.style.marginTop=`${F}px`),r.appendChild(c),s+=F+(y.totalHeight??0),b$1=0;}}b$1>0&&(r.style.paddingBottom=`${b$1}px`);let g=l.filter(u=>!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 Xt(e,t,n,o){let r=o.createElement("div");r.className=`${_.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=Ee(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=ve(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 gt(e,t,n,o,r,a,i,d){let l=i.createElement("div");l.className=_.cell,e.trackedMarker&&e.trackedMarker.info.revisionId!==d&&Le(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=Ut(e,t,a,i);if(l.appendChild(E),e.blocks.length>0){let y=e.blocks[0],p=e.blocks[e.blocks.length-1];y&&"pmStart"in y&&y.pmStart!==void 0&&(l.dataset.pmStart=String(y.pmStart)),p&&"pmEnd"in p&&p.pmEnd!==void 0&&(l.dataset.pmEnd=String(p.pmEnd));}return l}function qt(e,t){return b$1(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 ve(e,t,n,o,r,a,i,d,l,m,s,b){let g=d.createElement("div");g.className=_.row,b||(e.trackedDel?Le(g,"row","del",e.trackedDel):e.trackedIns&&Le(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,p=0;for(;E.has(p);)y+=r[p]??0,p++;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,I=F.rowSpan??1,k=u;if(I>1&&m){k=0;for(let T=n;T<n+I&&T<m.length-1;T++)k+=(m[T+1]??0)-(m[T]??0);k===0&&(k=t.height*I);}let S=n===0||s===true,h=p===0;p+x>=r.length;let R=gt(F,c,y,k,{isFirstRow:S,isFirstCol:h},i,d,e.trackedIns?.revisionId??e.trackedDel?.revisionId);if(R.dataset.cellIndex=String(w),R.dataset.columnIndex=String(p),I>1&&(R.dataset.rowSpan=String(I)),g.appendChild(R),I>1&&l){let T=`${n}-${p}`;l.set(T,{cell:F,cellMeasure:c,columnIndex:p,startRow:n,rowSpan:I,colSpan:x,x:y,totalHeight:k});}for(let T=0;T<x&&p+T<r.length;T++)y+=r[p+T]??0;for(p+=x;E.has(p);)y+=r[p]??0,p++;}return g}function Q(e,t,n,o,r={}){let a=r.document??document,i=a.createElement("div");i.className=_.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=(f,h)=>!!f&&!!h&&(f.author??"")===(h.author??"")&&(f.date??null)===(h.date??null),b=t.rows.length>0&&t.rows.every(f=>l?s(f.trackedIns,l):m?s(f.trackedDel,m):false);if(b){let f=l??m,h=l?"ins":"del";i.classList.add("ep-revision-table",`ep-revision-${h}`),i.dataset.revisionId=String(f.revisionId),i.dataset.revisionAuthor=f.author,f.date&&(i.dataset.revisionDate=f.date),i.style.overflowX="visible",i.style.overflowY="hidden";}let g=0;for(let f=0;f<n.columnWidths.length-1;f++){g+=n.columnWidths[f]??0;let h=a.createElement("div");h.className=_.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(f),h.dataset.tableBlockId=String(e.blockId),e.pmStart!==void 0&&(h.dataset.tablePmStart=String(e.pmStart)),i.appendChild(h);}let u=Ee(n.rows),E=qt(t,n.columnWidths),y=e.headerRowCount??0,p=0;if(y>0&&e.continuesFromPrev){let f=new Map;for(let h=0;h<y;h++){let C=t.rows[h],R=n.rows[h];if(!C||!R)continue;let T=ve(C,R,h,p,n.columnWidths,t.rows.length,o,a,f,u,h===0,b);T.dataset.repeatedHeader="true",i.appendChild(T),p+=R.height;}}let w=(u[e.fromRow]??0)+(e.topClip??0),F=f=>p+(f-w),c=e.bottomClip!==void 0?Math.round(e.height):F(u[e.toRow]??0);i.style.height=`${c}px`;let x=new Map,I=y>0&&e.continuesFromPrev;for(let f of E){if(f.rowSpan<=1||f.rowIndex>=e.fromRow||f.rowIndex+f.rowSpan<=e.fromRow||I&&f.rowIndex<y)continue;let h=n.rows[f.rowIndex]?.cells?.[f.cellIndex];if(!h)continue;let C=0;for(let B=f.rowIndex;B<f.rowIndex+f.rowSpan&&B<u.length-1;B++)C+=(u[B+1]??0)-(u[B]??0);x.set(`${f.rowIndex}-${f.columnIndex}`,{cell:f.cell,cellMeasure:h,columnIndex:f.columnIndex,startRow:f.rowIndex,rowSpan:f.rowSpan,colSpan:f.colSpan,x:f.x,totalHeight:C});f.rowIndex+f.rowSpan>=t.rows.length;let T=f.columnIndex===0;f.columnIndex+f.colSpan>=n.columnWidths.length;let L=gt(f.cell,h,f.x,C,{isFirstRow:false,isFirstCol:T},o,a);L.style.top=`${F(u[f.rowIndex]??0)}px`,L.dataset.columnIndex=String(f.columnIndex),L.dataset.vmergeContinuation="true",delete L.dataset.pmStart,delete L.dataset.pmEnd,i.appendChild(L);}for(let f=e.fromRow;f<e.toRow;f++){let h=t.rows[f],C=n.rows[f];if(!h||!C)continue;let R=y>0&&e.continuesFromPrev?false:e.continuesFromPrev&&f===e.fromRow&&!e.topClip,T=ve(h,C,f,F(u[f]??0),n.columnWidths,t.rows.length,o,a,x,u,R,b);i.appendChild(T);}let k=(f,h,C,R)=>{for(let T of E){if(T.rowIndex>f||T.rowIndex+T.rowSpan-1<f||R&&!(h==="bottom"?T.rowIndex+T.rowSpan-1>f:T.rowIndex<f))continue;let v=T.cell.borders?.[h];if(!Ce(v))continue;let L=0;for(let B=0;B<T.colSpan;B++)L+=n.columnWidths[T.columnIndex+B]??0;i.appendChild(ft(a,{x:T.x,topY:C,width:L,edge:h,border:v}));}};e.topClip?k(e.fromRow,"top",p,false):e.continuesFromPrev&&k(e.fromRow,"top",p,true),e.bottomClip!==void 0?k(e.toRow-1,"bottom",c,false):e.continuesOnNext&&k(e.toRow-1,"bottom",c,true);for(let f=e.fromRow;f<e.toRow-1;f++){let h=F(u[f+1]??0);if(h<=p||h>=e.height)continue;let C=a.createElement("div");C.className=_.rowResizeHandle,C.style.position="absolute",C.style.left="0",C.style.top=`${h-3}px`,C.style.width="100%",C.style.height="6px",C.style.cursor="row-resize",C.style.zIndex="10",C.dataset.rowIndex=String(f),C.dataset.tableBlockId=String(e.blockId),e.pmStart!==void 0&&(C.dataset.tablePmStart=String(e.pmStart)),i.appendChild(C);}let S=e.toRow===t.rows.length&&e.bottomClip===void 0;if(S){let f=a.createElement("div");f.className=_.tableEdgeHandleBottom,f.style.position="absolute",f.style.left="0",f.style.top=`${F(u[e.toRow]??0)-3}px`,f.style.width="100%",f.style.height="6px",f.style.cursor="row-resize",f.style.zIndex="10",f.dataset.rowIndex=String(t.rows.length-1),f.dataset.tableBlockId=String(e.blockId),f.dataset.isEdge="bottom",e.pmStart!==void 0&&(f.dataset.tablePmStart=String(e.pmStart)),i.appendChild(f);}if(S){let f=n.columnWidths.reduce((C,R)=>C+R,0),h=a.createElement("div");h.className=_.tableEdgeHandleRight,h.style.position="absolute",h.style.left=`${f-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 Zt={textBox:"layout-textbox"};function ee(e,t,n,o,r={}){let a=r.document??document,i=a.createElement("div");if(i.className=Zt.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",Jt(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??a$1;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=D(u,b,g,{...o,positioning:"flow"},{document:a});i.appendChild(E),m+=g.totalHeight;}return i}function Jt(e,t){!t.isFloating&&t.zIndex===void 0||(e.style.zIndex=String(t.zIndex??10));}var Qt="layout-watermark-layer";function en(e,t){let n=Math.max(e.trim().length,1),o=t/(n*.62);return Math.max(24,Math.min(o,180))}function tn(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=a(e.font).cssFallback,o.style.userSelect="none";let r=t.size.w-t.margins.left-t.margins.right,a$1=e.layout==="diagonal"?r*1.3:r,i=e.fontSize!==void 0?e.fontSize*96/72:en(e.text,a$1);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 nn(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 mt(e,t,n=document){let o=e.kind==="text"?tn(e,t,n):nn(e,t,n);if(!o)return null;let r=n.createElement("div");return r.className=Qt,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 ut(e){return e?.align??e?.alignment}function on(e,t){let n=e.position.vertical;if(!n)return e.paragraphY;let o=ut(n),r=n.posOffset!==void 0?f(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 Pe(e,t,n){if(!t)return "0";let o=ut(t);if(t.relativeTo==="page"){if(t.posOffset!==void 0)return `${f(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?`${f(t.posOffset)}px`:o==="right"?`${n.contentWidth-e}px`:o==="center"?`${(n.contentWidth-e)/2}px`:"0"}function rn(e,t,n){e.style.left=Pe(t.width,t.position.horizontal,n);}function ht(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 Be(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,p=[];for(let x of g.runs)if(x.kind==="image"&&"position"in x&&x.position){let I=x;d.push({src:I.src,width:I.width,height:I.height,alt:I.alt,paragraphY:y,position:I.position});}else p.push(x);let w={...g,runs:p},F={blockId:g.id,width:i,height:u.totalHeight,fromLine:0,toLine:u.lines.length,pmStart:g.pmStart,pmEnd:g.pmEnd},c=D(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}=ht(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=Pe(b.width,s.position?.horizontal,o),a.appendChild(u),s.displayMode!=="float"&&(l+=b.height);}else s.kind==="sectionBreak"||s.kind==="pageBreak"||s.kind==="columnBreak"||c$3(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",rn(s,m,o),s.style.top=`${on(m,o)}px`,a.appendChild(s);}return a}var be=12,Me=6;function an(e,t){if(e.size!==t.size)return false;for(let[n,o]of e)if(t.get(n)!==o)return false;return true}function sn(e,t){for(let[n,o]of t)if((e.get(n)??0)<o)return false;return true}function ln(e,t){let n=new Map(e);for(let[o,r]of t)n.set(o,Math.max(n.get(o)??0,r));return n}var $e=8;function Ro(e){let t=[],n=(o,r)=>{for(let a of o)if(a.kind==="paragraph")for(let i of a.runs)i.kind==="text"&&i.footnoteRefId!=null&&t.push({footnoteId:i.footnoteRefId,pmPos:i.pmStart??0,...r??{}});else a.kind==="table"?a.rows.forEach((i,d)=>{for(let l of i.cells)n(l.blocks,r??{tableBlockId:a.id,rowIndex:d});}):a.kind==="textBox"&&n(a.content,r);};return n(e),t}function ye(e,t){let n=new Map;if(t.length===0)return n;let o=(r,a)=>{let i=n.get(r)??[];i.includes(a)||i.push(a),n.set(r,i);};for(let r of t){let a=false;for(let i of e){for(let d of i.fragments){let l=false;if(r.tableBlockId!=null&&r.rowIndex!=null)l=d.kind==="table"&&d.blockId===r.tableBlockId&&r.rowIndex>=d.fromRow&&r.rowIndex<d.toRow;else {let m=d.pmStart??-1,s=d.pmEnd??-1;l=m>=0&&s>=0&&r.pmPos>=m&&r.pmPos<s;}if(l){o(i.number,r.footnoteId),a=true;break}}if(a)break}}return n}function dn(e,t){if(e.length===0)return [{kind:"paragraph",id:`fn-empty-${t}`,runs:[{kind:"text",text:`${t} `,fontSize:$e,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:$e}:i)}}),o=n[0];if(o.kind==="paragraph"){let r=o,a=r.runs.find(d=>d.kind==="text"),i={kind:"text",text:`${t} `,fontSize:$e,superscript:true,...a?.fontFamily?{fontFamily:a.fontFamily}:{}};n[0]={...r,runs:[i,...r.runs]};}return n}function cn(e,t,n,o){let r=c$1(e.content,{styles:o.styles??void 0,theme:o.theme??null,defaultTabStopTwips:o.defaultTabStopTwips??null}),a=c$2(r,{theme:o.theme??void 0}),i=dn(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 Co(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,cn(m,i,n,o)),i++);}return r}function He(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+=be,n.set(o,a));}return n}function Eo(e){let{blocks:t,measures:n,layoutOpts:o,footnoteRefs:r,footnoteContentMap:a,initialLayout:i}=e,d=ye(i.pages,r),l=He(d,a);if(l.size===0)return {layout:i,pageFootnoteMap:d,converged:true};let m=i,s=false;for(let b=0;b<Me;b++){m=X$1(t,n,{...o,footnoteReservedHeights:l});let g=ye(m.pages,r),u=He(g,a);if(d=g,an(l,u)){l=u,s=true;break}l=u;}if(!s){let b=l,g=false;for(let u=0;u<Me;u++){m=X$1(t,n,{...o,footnoteReservedHeights:b}),d=ye(m.pages,r);let E=He(d,a);if(sn(b,E)){g=true;break}b=ln(b,E);}g||(m=X$1(t,n,{...o,footnoteReservedHeights:b}),d=ye(m.pages,r)),console.warn(`[docx-editor] footnote layout did not stabilize within ${Me} passes; settling with conservative page reservations. 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 Lo(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:x$1(m),content:s});}d.length>0&&o.set(a,d);}return o}function pn(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=D(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 fn(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 yt(e){let t=be;for(let n of e)n.content&&(t+=n.content.height);return t}function bt(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=(be-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?pn(l.content,t,n,o):fn(l,o));return r}function Ae(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 xt(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 gn(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 mn(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 xe=2,un=8;function hn(e,t,n={}){let o=e.length,r=n.pageGap??24,a=t,i=a.__pageRenderState,d=gn(n),l=o>=un;if(i&&i.optionsHash===d&&l){let p=i.pageStates,w=i.pageDataMap,F=a.__pageObserver,c=[];for(let k of e)c.push(xt(k));let x=i.totalPages!==o,I=Math.min(p.length,e.length);for(let k=0;k<I;k++){let S=p[k],f=c[k];if(S.fingerprint===f&&!x){let R=w.get(S.element);R&&(R.page=e[k]);continue}let h=S.element,C=w.get(h);C&&(C.page=e[k],C.rendered&&yn(h,w,o,n)),S.fingerprint=f,le(h,e[k].size.w,e[k].size.h,n),h.dataset.pageNumber=String(e[k].number);}if(e.length>p.length){let k=n.document??document;for(let S=p.length;S<e.length;S++){let f=e[S],h=k.createElement("div");h.className=n.pageClassName??G.page,h.dataset.pageNumber=String(f.number),h.dataset.pageIndex=String(S),le(h,f.size.w,f.size.h,n),t.appendChild(h),p.push({element:h,fingerprint:c[S]}),w.set(h,{page:f,index:S,rendered:false}),F&&F.observe(h);}}if(e.length<p.length){for(let k=p.length-1;k>=e.length;k--){let S=p[k].element;F&&F.unobserve(S),w.delete(S),t.removeChild(S);}p.length=e.length;}for(let k=0;k<p.length;k++){let S=w.get(p[k].element);S&&(S.index=k);}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,mn(t,r);let b=[],g=[];for(let p=0;p<e.length;p++){let w=e[p];if(g.push(xt(w)),l){let c=(n.document??document).createElement("div");c.className=n.pageClassName??G.page,c.dataset.pageNumber=String(w.number),c.dataset.pageIndex=String(p),le(c,w.size.w,w.size.h,n),t.appendChild(c),b.push(c);}else {let{context:F,pageOptions:c}=Ae(w,o,n),x=ke(w,F,c);t.appendChild(x),b.push(x);}}if(!l)return "full";let u=new Map;for(let p=0;p<e.length;p++)u.set(b[p],{page:e[p],index:p,rendered:false});let E=new IntersectionObserver(p=>{let w=a.__pageRenderState;if(!w)return;let{currentOptions:F,totalPages:c,pageDataMap:x}=w;for(let f of p){let h=f.target,C=x.get(h);if(C&&f.isIntersecting){se(h,x,c,F);for(let R=-xe;R<=xe;R++){let T=C.index+R;T>=0&&T<w.pageStates.length&&T!==C.index&&se(w.pageStates[T].element,x,c,F);}}}let I=window.innerHeight,k=I*3,S=new Set;for(let[f,h]of x){if(!h.rendered)continue;let C=f.getBoundingClientRect();C.bottom>-k&&C.top<I+k&&S.add(h.index);}for(let[f,h]of x){if(!h.rendered)continue;let C=false;for(let R of S)if(Math.abs(h.index-R)<=xe+1){C=true;break}!C&&S.size>0&&bn(f,x);}},{root:null,rootMargin:"1500px 0px 1500px 0px"});for(let p of b)E.observe(p);a.__pageObserver=E,a.__pageRenderState={pageStates:b.map((p,w)=>({element:p,fingerprint:g[w]})),totalPages:o,optionsHash:d,pageDataMap:u,currentOptions:n};let y=Math.min(e.length,xe+3);for(let p=0;p<y;p++)se(b[p],u,o,n);return "full"}function se(e,t,n,o){let r=t.get(e);if(!r||r.rendered)return;let{context:a,pageOptions:i}=Ae(r.page,n,o),d=ke(r.page,a,i);for(;d.firstChild;)e.appendChild(d.firstChild);r.rendered=true;}function yn(e,t,n,o){let r=t.get(e);if(!r)return;let{context:a,pageOptions:i}=Ae(r.page,n,o),l=ke(r.page,a,i).querySelector(`.${G.content}`),m=e.querySelector(`.${G.content}`);l&&m?e.replaceChild(l,m):(e.innerHTML="",r.rendered=false,se(e,t,n,o));}function bn(e,t){let n=t.get(e);!n||!n.rendered||(e.innerHTML="",n.rendered=false);}function xn(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||(se(l,i,r,a),d++);}return d}var G={page:"layout-page",content:"layout-page-content",header:"layout-page-header",footer:"layout-page-footer"};function le(e,t,n,o){e.style.position="relative",e.style.width=`${t}px`,e.style.height=`${n}px`,e.style.backgroundColor=o.backgroundColor??"var(--doc-page-bg, #ffffff)",e.style.overflow="hidden",e.style.fontFamily=a("Calibri").cssFallback,e.style.fontSize=`${1056/72}px`,e.style.color="var(--doc-page-text, #000000)",o.showBorders&&(e.style.border="1px solid #ccc"),o.showShadow&&(e.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");}function kn(e,t){switch(t??"allPages"){case "firstPage":return e===1;case "notFirstPage":return e!==1;default:return true}}function Se(e){return e?.space!==void 0?j$1(e.space):0}function we(e,t,n,o){if(!t||t.style==="none"||t.style==="nil")return;let r=c$4(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 Sn(e,t,n){let o=t.pageBorders;if(!o||!kn(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=Se(o.top),d=Se(o.right),l=Se(o.bottom),m=Se(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`),we(s,o.top,"Top",t.theme),we(s,o.bottom,"Bottom",t.theme),we(s,o.left,"Left",t.theme),we(s,o.right,"Right",t.theme),s}function wn(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 In(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 Tn(e$1,t,n,o){let r=[];for(let a of e$1.runs){if(a.kind!=="image")continue;let i=a;if(!c(i))continue;let d=i.distTop??0,l=i.distBottom??0,m=i.distLeft??12,s=i.distRight??12,{x:b,y:g$1,side:u}=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$1,distTop:d,distBottom:l,distLeft:m,distRight:s,pmStart:i.pmStart,pmEnd:i.pmEnd,wrapText:e(i.cssFloat),wrapType:i.wrapType,cropTop:i.cropTop,cropRight:i.cropRight,cropBottom:i.cropBottom,cropLeft:i.cropLeft,opacity:i.opacity});}return r}function ke(e,t,n={}){let o=n.document??document,r=o.createElement("div");if(r.className=n.pageClassName??G.page,r.dataset.pageNumber=String(e.number),le(r,e.size.w,e.size.h,n),n.watermark){let c=mt(n.watermark,e,o);c&&r.appendChild(c);}let a=Sn(e,n,o);a&&n.pageBorders?.zOrder==="back"&&r.appendChild(a);let i=o.createElement("div");i.className=G.content,wn(i,e);let d=f$1(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 I=x.block,k=c.y-e.margins.top,S=Tn(I,k,l,d);m.push(...S);}}for(let c of m)a$2(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 k=x.block.floating;if(!k)continue;let S=c.x-e.margins.left,f=c.y-e.margins.top,h=k.topFromText??0,C=k.bottomFromText??0,R=k.leftFromText??12,T=k.rightFromText??12,v=S<l/2?"left":"right";s.push({side:v,x:S,y:f,width:c.width,height:c.height,distTop:h,distBottom:C,distLeft:R,distRight:T});}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 I=x.block;if(!L(I))continue;let k=c.y-e.margins.top,S=g({width:c.width,height:c.height,position:I.position,cssFloat:I.cssFloat},k,l,d);c.x=e.margins.left+S.x,c.y=e.margins.top+S.y,!(!M(I)&&!N$1(I))&&s.push({side:S.side,x:S.x,y:S.y,width:c.width,height:c.height,distTop:I.distTop??0,distBottom:I.distBottom??0,distLeft:I.distLeft??12,distRight:I.distRight??12,wrapText:I.wrapText,wrapType:I.wrapType});}let b$1=s.length>0?C(s,l):[],g$1=m.filter(b),u=m.filter(c=>!b(c));if(g$1.length>0){let c=q(g$1,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,p=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 I=x[x.length-1];c.classList.add("layout-block-sdt"),c.dataset.sdtGroupId=I.id,c.dataset.sdtType=I.sdtType,c.dataset.sdtDepth=String(x.length),I.tag!=null&&(c.dataset.sdtTag=I.tag),I.alias!=null&&(c.dataset.sdtAlias=I.alias),I.lock!=null&&(c.dataset.sdtLock=I.lock);};for(let c=0;c<e.fragments.length;c++){let x=e.fragments[c],I,k={...t,section:"body",contentWidth:l},S=x.y-e.margins.top;if(n.blockLookup&&x.blockId){let f=n.blockLookup.get(String(x.blockId));if(x.kind==="paragraph"&&f?.block.kind==="paragraph"&&f?.measure.kind==="paragraph"){let h=f.block,C=c+1<e.fragments.length?E(e.fragments[c+1]):void 0,R=String(x.blockId),T=p.get(R);T||(T=new Set,p.set(R,T));let v=f.measure;b$1.length>0&&(v=z$1(h,l,{floatingZones:b$1,paragraphYOffset:S})),I=D(x,h,v,k,{document:o,prevBorders:y,nextBorders:C,renderedInlineImageKeys:T}),y=h.attrs?.borders;}else x.kind==="table"&&f?.block.kind==="table"&&f?.measure.kind==="table"?(I=Q(x,f.block,f.measure,k,{document:o}),y=void 0):x.kind==="image"&&f?.block.kind==="image"&&f?.measure.kind==="image"?(I=Z(x,f.block,f.measure,k,{document:o}),y=void 0):x.kind==="textBox"&&f?.block.kind==="textBox"&&f?.measure.kind==="textBox"?(I=ee(x,f.block,f.measure,k,{document:o}),y=void 0):(I=Te(x,k,{document:o}),y=void 0);}else I=Te(x,k,{document:o}),y=void 0;In(I,x,{left:e.margins.left,top:e.margins.top}),F(I,w(x)),i.appendChild(I);}if(tt(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,I=(l-(c-1)*x)/c,k=e.size.h-e.margins.top-e.margins.bottom;for(let S=0;S<c-1;S++){let f=(S+1)*I+S*x+x/2,h=o.createElement("div");h.style.position="absolute",h.style.left=`${f}px`,h.style.top="0",h.style.height=`${k}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=bt(n.footnoteArea,l,t,o);c.style.position="absolute";let x=Math.max(e.footnoteReservedHeight??0,yt(n.footnoteArea)),I=e.size.h-e.margins.bottom-e.margins.top;c.style.top=`${Math.max(-e.margins.top,I-x)}px`,c.style.left="0",c.style.right="0",i.appendChild(c);}r.appendChild(i);{let x=n.headerDistance??e.margins.header??48,I=e.size.w-e.margins.left-e.margins.right,k=Math.max(e.margins.top-x,48),S=n.headerContent?.visualTop??0,f=n.headerContent?.visualBottom??n.headerContent?.height??0,h=Math.max(f-S,24),C=f>k,R=o.createElement("div");R.className=G.header,R.style.position="absolute",R.style.top=`${x+S}px`,R.style.left=`${e.margins.left}px`,R.style.right=`${e.margins.right}px`,R.style.width=`${I}px`,R.style.height=`${h}px`,R.style.minHeight=`${h}px`;let T=!C;if(n.headerContent&&n.headerContent.blocks.length>0){let v={flowTop:x,flowLeft:e.margins.left,contentWidth:I,pageWidth:e.size.w,pageHeight:e.size.h,margins:e.margins},L=Be(n.headerContent,{...t,section:"header",contentWidth:I},n,v);L.style.top=`${-S}px`,L.querySelector("img")&&(T=false),R.appendChild(L);}T&&(R.style.maxHeight=`${k}px`,R.style.overflow="hidden"),r.appendChild(R);}{let x=n.footerDistance??e.margins.footer??48,I=e.size.w-e.margins.left-e.margins.right,k=Math.max(e.margins.bottom-x,48),S=n.footerContent?.visualTop??0,f=n.footerContent?.visualBottom??n.footerContent?.height??0,h=Math.max(f-S,24),C=h>k,R=o.createElement("div");R.className=G.footer,R.style.position="absolute",R.style.top=`${e.size.h-x-h}px`,R.style.left=`${e.margins.left}px`,R.style.right=`${e.margins.right}px`,R.style.width=`${I}px`,R.style.height=`${h}px`,R.style.minHeight=`${h}px`;let T=!C;if(n.footerContent&&n.footerContent.blocks.length>0){let v={flowTop:e.size.h-x-(n.footerContent?.height??0),flowLeft:e.margins.left,contentWidth:I,pageWidth:e.size.w,pageHeight:e.size.h,margins:e.margins},L=Be(n.footerContent,{...t,section:"footer",contentWidth:I},n,v);L.style.top=`${-S}px`,L.querySelector("img")&&(T=false),R.appendChild(L);}T&&(R.style.maxHeight=`${k}px`,R.style.overflow="hidden"),r.appendChild(R);}return a&&n.pageBorders?.zOrder!=="back"&&r.appendChild(a),r}export{ht as A,hn as B,xn as C,G as D,le as E,ke as F,be as a,Me as b,an as c,Ro as d,ye as e,dn as f,cn as g,Co as h,He as i,Eo as j,Lo as k,Fn as l,Rn as m,U as n,Te as o,nt as p,Z as q,dt as r,he as s,D as t,q as u,_ as v,Q as w,Zt as x,ee as y,Pe as z};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-7E2TOWBX.mjs';import {b as b$1}from'./chunk-3NRMSZX2.mjs';import {g as g$1}from'./chunk-KNY7SXPJ.mjs';function h(c){return JSON.parse(JSON.stringify(c))}function g(c,t){let a=0;for(let r=0;r<c.content.length;r++)if(c.content[r].type==="paragraph"){if(a===t)return r;a++;}return -1}function I(c){let t="";for(let a of c.content)if(a.type==="run")for(let r of a.content)r.type==="text"&&(t+=r.text);else if(a.type==="hyperlink"){for(let r of a.children)if(r.type==="run")for(let e of r.content)e.type==="text"&&(t+=e.text);}return t}function b(c,t){return {type:"run",formatting:t,content:[{type:"text",text:c}]}}function P(c,t,a,r){let e=[],o=0,p=false;for(let n of c.content)if(n.type==="run"){let s=n.content.filter(l=>l.type==="text").map(l=>l.text).join(""),i=o,u=o+s.length;if(!p&&t>=i&&t<=u){let l=t-i;l>0&&e.push({...n,content:[{type:"text",text:s.slice(0,l)}]}),e.push(b(a,r||n.formatting)),l<s.length&&e.push({...n,content:[{type:"text",text:s.slice(l)}]}),p=true;}else e.push(n);o=u;}else e.push(n);return p||e.push(b(a,r)),e}function m(c,t,a){let r=[],e=0;for(let o of c.content)if(o.type==="run"){let p=o.content.filter(i=>i.type==="text").map(i=>i.text).join(""),n=e,s=e+p.length;if(s<=t||n>=a)r.push(o);else {let i="";n<t&&(i+=p.slice(0,t-n)),s>a&&(i+=p.slice(a-n)),i.length>0&&r.push({...o,content:[{type:"text",text:i}]});}e=s;}else r.push(o);return r}function C(c,t,a,r){let e=[],o=0;for(let p of c.content)if(p.type==="run"){let n=p.content.filter(u=>u.type==="text").map(u=>u.text).join(""),s=o,i=o+n.length;if(i<=t||s>=a)e.push(p);else if(s>=t&&i<=a)e.push({...p,formatting:{...p.formatting,...r}});else {let u=Math.max(t,s),l=Math.min(a,i);s<u&&e.push({...p,content:[{type:"text",text:n.slice(0,u-s)}]}),e.push({...p,formatting:{...p.formatting,...r},content:[{type:"text",text:n.slice(u-s,l-s)}]}),i>l&&e.push({...p,content:[{type:"text",text:n.slice(l-s)}]});}o=i;}else e.push(p);return e}function A(c,t){let a=h(c),r=a.package.document,e=g(r,t.position.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.position.paragraphIndex} not found`);let o=r.content[e];return o.content=P(o,t.position.offset,t.text,t.formatting),a}function B(c,t){let a=h(c),r=a.package.document,{start:e,end:o}=t.range;if(e.paragraphIndex===o.paragraphIndex){let p=g(r,e.paragraphIndex);if(p===-1)throw new Error(`Paragraph index ${e.paragraphIndex} not found`);let n=r.content[p];n.content=m(n,e.offset,o.offset),n.content=P(n,e.offset,t.text,t.formatting);}else {let p=g(r,e.paragraphIndex),n=r.content[p],s=I(n);n.content=m(n,e.offset,s.length),n.content=P(n,e.offset,t.text,t.formatting);let i=[];for(let u=e.paragraphIndex+1;u<=o.paragraphIndex;u++)i.push(g(r,u));for(let u=i.length-1;u>=0;u--)i[u]!==-1&&r.content.splice(i[u],1);}return a}function E(c,t){let a=h(c),r=a.package.document,{start:e,end:o}=t.range;if(e.paragraphIndex===o.paragraphIndex){let p=g(r,e.paragraphIndex);if(p===-1)throw new Error(`Paragraph index ${e.paragraphIndex} not found`);let n=r.content[p];n.content=m(n,e.offset,o.offset);}else {let p=g(r,e.paragraphIndex),n=r.content[p],s=I(n);n.content=m(n,e.offset,s.length);let i=g(r,o.paragraphIndex),u=r.content[i];u.content=m(u,0,o.offset),n.content.push(...u.content);let l=[];for(let f=e.paragraphIndex+1;f<=o.paragraphIndex;f++)l.push(g(r,f));for(let f=l.length-1;f>=0;f--)l[f]!==-1&&r.content.splice(l[f],1);}return a}function F(c,t){let a=h(c),r=a.package.document,{start:e,end:o}=t.range;if(e.paragraphIndex===o.paragraphIndex){let p=g(r,e.paragraphIndex);if(p===-1)throw new Error(`Paragraph index ${e.paragraphIndex} not found`);let n=r.content[p];n.content=C(n,e.offset,o.offset,t.formatting);}else for(let p=e.paragraphIndex;p<=o.paragraphIndex;p++){let n=g(r,p);if(n===-1)continue;let s=r.content[n],i=I(s),u=0,l=i.length;p===e.paragraphIndex&&(u=e.offset),p===o.paragraphIndex&&(l=o.offset),s.content=C(s,u,l,t.formatting);}return a}function S(c,t){let a=h(c),r=a.package.document,e=g(r,t.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.paragraphIndex} not found`);let o=r.content[e];if(o.formatting={...o.formatting,...t.formatting},"numPr"in t.formatting){let p=t.formatting.numPr;if(p&&p.numId!==void 0&&p.numId!==0){let n=p.ilvl??0,s=p.numId===1,i=s?"\u2022":"1.";if(a.package.numbering){let u=a.package.numbering.nums.find(l=>l.numId===p.numId);if(u){let l=a.package.numbering.abstractNums.find(f=>f.abstractNumId===u.abstractNumId);if(l){let f=l.levels.find(x=>x.ilvl===n);f&&(i=f.lvlText||i);}}}o.listRendering={level:n,numId:p.numId,marker:i,isBullet:s};}else delete o.listRendering;}return a}function H(c,t){let a=h(c),r=a.package.document,e=g(r,t.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.paragraphIndex} not found`);let o=r.content[e];return o.formatting={...o.formatting,styleId:t.styleId},a}function $(c,t){let a$1=h(c),r=a$1.package.document,e=a(9360,t.columns),o=[];for(let s=0;s<t.rows;s++){let i=[];for(let u=0;u<t.columns;u++){let l=t.data?.[s]?.[u]||"";i.push({type:"tableCell",formatting:e[u]?{width:{value:e[u],type:"dxa"}}:void 0,content:[{type:"paragraph",content:l?[b(l)]:[]}]});}o.push({type:"tableRow",formatting:s===0&&t.hasHeader?{header:true}:void 0,cells:i});}let p={type:"table",formatting:{width:{value:9360,type:"dxa"},layout:"fixed"},columnWidths:e,rows:o},n=g(r,t.position.paragraphIndex);return n===-1?r.content.push(p):r.content.splice(n+1,0,p),a$1}function j(c,t){let a=h(c),r=a.package.document,e=g(r,t.position.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.position.paragraphIndex} not found`);let o=r.content[e],n={type:"run",content:[{type:"drawing",image:{type:"image",rId:`rId_img_${Date.now()}`,src:t.src,alt:t.alt,size:{width:g$1(t.width||100),height:g$1(t.height||100)},wrap:{type:"inline"}}}]},s=P(o,t.position.offset,"",void 0),i=false,u=0;for(let l=0;l<s.length;l++){let f=s[l];if(f.type==="run"){let x=f.content.filter(d=>d.type==="text").map(d=>d.text).join("");if(u+=x.length,!i&&u>=t.position.offset){s.splice(l+1,0,n),i=true;break}}}return i||s.push(n),o.content=s,a}function M(c,t){let a=h(c),r=a.package.document,{start:e,end:o}=t.range;if(e.paragraphIndex!==o.paragraphIndex)throw new Error("Hyperlinks cannot span multiple paragraphs");let p=g(r,e.paragraphIndex);if(p===-1)throw new Error(`Paragraph index ${e.paragraphIndex} not found`);let n=r.content[p],s=I(n),i=t.displayText||s.slice(e.offset,o.offset);n.content=m(n,e.offset,o.offset);let u={type:"hyperlink",href:t.url,tooltip:t.tooltip,children:[b(i)]},l=false,f=0,x=[];for(let d of n.content)if(d.type==="run"){let T=d.content.filter(y=>y.type==="text").map(y=>y.text).join(""),w=f+T.length;if(!l&&f<=e.offset&&e.offset<=w){let y=e.offset-f;y>0&&x.push({...d,content:[{type:"text",text:T.slice(0,y)}]}),x.push(u),y<T.length&&x.push({...d,content:[{type:"text",text:T.slice(y)}]}),l=true;}else x.push(d);f=w;}else x.push(d);return l||x.push(u),n.content=x,a}function N(c,t){let a=h(c),r=a.package.document,{start:e}=t.range,o=g(r,e.paragraphIndex);if(o===-1)throw new Error(`Paragraph index ${e.paragraphIndex} not found`);let p=r.content[o],n=[];for(let s of p.content)if(s.type==="hyperlink")for(let i of s.children)i.type==="run"&&n.push(i);else n.push(s);return p.content=n,a}function k(c,t){let a=h(c),r=a.package.document,e=g(r,t.position.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.position.paragraphIndex} not found`);let o=r.content[e],p=I(o),n=m({...o,content:[...o.content]},t.position.offset,p.length),s=m({...o,content:[...o.content]},0,t.position.offset);o.content=n;let i={type:"paragraph",formatting:o.formatting,content:s};return r.content.splice(e+1,0,i),a}function _(c,t){let a=h(c),r=a.package.document,e=g(r,t.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.paragraphIndex} not found`);let o=r.content[e],p=[];for(let n=1;n<=t.count;n++){let s=g(r,t.paragraphIndex+n);if(s!==-1){let i=r.content[s];o.content.push(...i.content),p.push(s);}}for(let n=p.length-1;n>=0;n--)r.content.splice(p[n],1);return a}function O(c,t){return k(c,{position:t.position})}function W(c,t){let a=h(c);return a.templateVariables||(a.templateVariables=[]),a.templateVariables.includes(t.name)||a.templateVariables.push(t.name),a}function J(c,t){let a=h(c),r=a.package.document;function e(n){for(let s of n.content)if(s.type==="text")for(let[i,u]of Object.entries(t.values)){let l=new RegExp(`\\{${i}\\}`,"g");s.text=s.text.replace(l,u);}}function o(n){for(let s of n.content)if(s.type==="run")e(s);else if(s.type==="hyperlink")for(let i of s.children)i.type==="run"&&e(i);}function p(n){if(n.type==="paragraph")o(n);else if(n.type==="table")for(let s of n.rows)for(let i of s.cells)for(let u of i.content)p(u);}for(let n of r.content)p(n);return a}function L(c,t){let a=b$1.getCommandHandler(t.type);if(a)return a(c,t);switch(t.type){case "insertText":return A(c,t);case "replaceText":return B(c,t);case "deleteText":return E(c,t);case "formatText":return F(c,t);case "formatParagraph":return S(c,t);case "applyStyle":return H(c,t);case "insertTable":return $(c,t);case "insertImage":return j(c,t);case "insertHyperlink":return M(c,t);case "removeHyperlink":return N(c,t);case "insertParagraphBreak":return k(c,t);case "mergeParagraphs":return _(c,t);case "splitParagraph":return O(c,t);case "setVariable":return W(c,t);case "applyVariables":return J(c,t);default:{let r=t;throw new Error(`Unknown command type: ${r.type}`)}}}function ct(c,t){return t.reduce((a,r)=>L(a,r),c)}export{L as a,ct as b};
@@ -0,0 +1 @@
1
+ import {r,q}from'./chunk-NJBEJTIO.mjs';var t=new r(q());t.buildSchema();t.initializeRuntime();var s=t,n=t.getSchema();export{s as a,n as b};