@eigenpal/docx-editor-core 1.6.0 → 1.6.1

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 (184) hide show
  1. package/dist/agent/index.d.mts +3 -3
  2. package/dist/agent/index.d.ts +3 -3
  3. package/dist/agent/index.js +1 -1
  4. package/dist/agent/index.mjs +1 -1
  5. package/dist/chunk-47SKD7QB.mjs +4 -0
  6. package/dist/{chunk-CDGV7CLS.js → chunk-4HNEXEGS.js} +1 -1
  7. package/dist/chunk-4U2S3WV2.js +1 -0
  8. package/dist/{chunk-C57BOE7B.mjs → chunk-5EP47PMQ.mjs} +1 -1
  9. package/dist/chunk-7EU6E64E.mjs +1 -0
  10. package/dist/{chunk-E7UN3PVC.mjs → chunk-A7C3DGQA.mjs} +1 -1
  11. package/dist/chunk-BMP2OSXE.js +1 -0
  12. package/dist/{chunk-2KUOYHXX.js → chunk-DEQFU56O.js} +1 -1
  13. package/dist/chunk-DFDL337G.js +4 -0
  14. package/dist/chunk-DKUHG27E.js +1 -0
  15. package/dist/{chunk-NY36MZ55.mjs → chunk-DU5TWD2W.mjs} +1 -1
  16. package/dist/chunk-DUVSDFRG.js +2 -0
  17. package/dist/{chunk-CWPIXUU2.js → chunk-DUXHJ6QP.js} +1 -1
  18. package/dist/chunk-HQ76VZAN.mjs +1 -0
  19. package/dist/{chunk-5JULVEYK.mjs → chunk-ICNIAAH7.mjs} +1 -1
  20. package/dist/{chunk-F44XU6G5.js → chunk-K7NSOCSY.js} +1 -1
  21. package/dist/{chunk-RGHRXIIZ.js → chunk-KEDY4GFG.js} +2 -2
  22. package/dist/{chunk-WEQA5PPW.mjs → chunk-KPWWI5UW.mjs} +1 -1
  23. package/dist/chunk-NKIDBERV.js +1 -0
  24. package/dist/chunk-NN2EJIO7.mjs +1 -0
  25. package/dist/{chunk-YMXWLXVF.mjs → chunk-O4RCQNUW.mjs} +1 -1
  26. package/dist/chunk-O5L4BZCZ.mjs +1 -0
  27. package/dist/chunk-OSTMAXZZ.mjs +1 -0
  28. package/dist/{chunk-XTPT4TNP.mjs → chunk-OWGY46IW.mjs} +1 -1
  29. package/dist/chunk-PGWY6UFK.js +1 -0
  30. package/dist/{chunk-T3UP6LF5.js → chunk-PM4KDJJ2.js} +1 -1
  31. package/dist/{chunk-6AGU57TL.mjs → chunk-QCPISGPW.mjs} +1 -1
  32. package/dist/{chunk-WQJWT4RB.mjs → chunk-QRBFMR7Z.mjs} +1 -1
  33. package/dist/chunk-SHZOAUHB.mjs +1 -0
  34. package/dist/chunk-TT3ILFZC.js +1 -0
  35. package/dist/chunk-TXAB4I4M.mjs +2 -0
  36. package/dist/{chunk-BBJMUBTD.mjs → chunk-VMBCUUZM.mjs} +1 -1
  37. package/dist/{chunk-7UMOUKSF.js → chunk-WTIN6QHX.js} +1 -1
  38. package/dist/{chunk-V3NE7Q22.js → chunk-WVY2UXAK.js} +1 -1
  39. package/dist/{chunk-EJ2JAYRI.js → chunk-XCTYXYEU.js} +1 -1
  40. package/dist/{chunk-2ZTKTE7P.js → chunk-XCXQWCV2.js} +1 -1
  41. package/dist/{chunk-KSW6W2EK.mjs → chunk-YSBX4LFA.mjs} +1 -1
  42. package/dist/{chunk-DX5XU6JN.js → chunk-YUHOVME2.js} +1 -1
  43. package/dist/{content-CbBCrsr0.d.mts → content-BEFz1zcs.d.mts} +1 -1
  44. package/dist/{content-BebvPfXc.d.ts → content-DNcMlHU0.d.ts} +1 -1
  45. package/dist/{contentControlValues-Com1GnZS.d.ts → contentControlValues-2pV4M4kG.d.ts} +1 -1
  46. package/dist/{contentControlValues-DVJyudKU.d.mts → contentControlValues-CKWIIkkr.d.mts} +1 -1
  47. package/dist/core-plugins.d.mts +1 -1
  48. package/dist/core-plugins.d.ts +1 -1
  49. package/dist/core-plugins.js +1 -1
  50. package/dist/core-plugins.mjs +1 -1
  51. package/dist/core.d.mts +6 -6
  52. package/dist/core.d.ts +6 -6
  53. package/dist/core.js +1 -1
  54. package/dist/core.mjs +1 -1
  55. package/dist/docx/index.d.mts +1 -1
  56. package/dist/docx/index.d.ts +1 -1
  57. package/dist/docx/index.js +1 -1
  58. package/dist/docx/index.mjs +1 -1
  59. package/dist/docx/parser.d.mts +1 -1
  60. package/dist/docx/parser.d.ts +1 -1
  61. package/dist/docx/parser.js +1 -1
  62. package/dist/docx/parser.mjs +1 -1
  63. package/dist/docx/rezip.d.mts +1 -1
  64. package/dist/docx/rezip.d.ts +1 -1
  65. package/dist/docx/serializer/index.d.mts +2 -2
  66. package/dist/docx/serializer/index.d.ts +2 -2
  67. package/dist/editor/index.d.mts +1 -1
  68. package/dist/editor/index.d.ts +1 -1
  69. package/dist/editor/index.js +1 -1
  70. package/dist/editor/index.mjs +1 -1
  71. package/dist/{fontLoader-D9SBYuZZ.d.ts → fontLoader-CH12AtFF.d.ts} +1 -1
  72. package/dist/{fontLoader-B4uFKpAy.d.mts → fontLoader-D3X2Qgb_.d.mts} +1 -1
  73. package/dist/{headerFooterLayout-CtVsfqxQ.d.ts → headerFooterLayout-BdGTU0IA.d.ts} +31 -16
  74. package/dist/{headerFooterLayout-D2LZLkDC.d.mts → headerFooterLayout-D5-u-IsD.d.mts} +31 -16
  75. package/dist/headless.d.mts +4 -4
  76. package/dist/headless.d.ts +4 -4
  77. package/dist/headless.js +1 -1
  78. package/dist/headless.mjs +1 -1
  79. package/dist/layout-bridge/index.d.mts +2 -2
  80. package/dist/layout-bridge/index.d.ts +2 -2
  81. package/dist/layout-bridge/index.js +1 -1
  82. package/dist/layout-bridge/index.mjs +1 -1
  83. package/dist/layout-bridge/measuring/index.d.mts +1 -1
  84. package/dist/layout-bridge/measuring/index.d.ts +1 -1
  85. package/dist/layout-bridge/measuring/index.js +1 -1
  86. package/dist/layout-bridge/measuring/index.mjs +1 -1
  87. package/dist/layout-bridge/tableInsertHover.js +1 -1
  88. package/dist/layout-bridge/tableInsertHover.mjs +1 -1
  89. package/dist/layout-bridge/toFlowBlocks.d.mts +1 -1
  90. package/dist/layout-bridge/toFlowBlocks.d.ts +1 -1
  91. package/dist/layout-bridge/toFlowBlocks.js +1 -1
  92. package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
  93. package/dist/layout-engine/index.d.mts +1 -1
  94. package/dist/layout-engine/index.d.ts +1 -1
  95. package/dist/layout-engine/index.js +1 -1
  96. package/dist/layout-engine/index.mjs +1 -1
  97. package/dist/layout-engine/types.d.mts +1 -1
  98. package/dist/layout-engine/types.d.ts +1 -1
  99. package/dist/layout-painter/index.d.mts +2 -2
  100. package/dist/layout-painter/index.d.ts +2 -2
  101. package/dist/layout-painter/index.js +1 -1
  102. package/dist/layout-painter/index.mjs +1 -1
  103. package/dist/layout-painter/renderPage.d.mts +2 -2
  104. package/dist/layout-painter/renderPage.d.ts +2 -2
  105. package/dist/layout-painter/renderPage.js +1 -1
  106. package/dist/layout-painter/renderPage.mjs +1 -1
  107. package/dist/managers/AutoSaveManager.d.mts +1 -1
  108. package/dist/managers/AutoSaveManager.d.ts +1 -1
  109. package/dist/managers/TableSelectionManager.d.mts +1 -1
  110. package/dist/managers/TableSelectionManager.d.ts +1 -1
  111. package/dist/managers/types.d.mts +1 -1
  112. package/dist/managers/types.d.ts +1 -1
  113. package/dist/mcp-cli.mjs +23 -23
  114. package/dist/mcp.d.mts +1 -1
  115. package/dist/mcp.d.ts +1 -1
  116. package/dist/mcp.js +2 -2
  117. package/dist/mcp.mjs +1 -1
  118. package/dist/{nodes-BvO8GGD4.d.mts → nodes-5w_QaI3g.d.mts} +13 -1
  119. package/dist/{nodes-Bd6tTkp0.d.ts → nodes-qQdZtu3Z.d.ts} +13 -1
  120. package/dist/prosemirror/applyFormatting.js +1 -1
  121. package/dist/prosemirror/applyFormatting.mjs +1 -1
  122. package/dist/prosemirror/commands/formatting.js +1 -1
  123. package/dist/prosemirror/commands/formatting.mjs +1 -1
  124. package/dist/prosemirror/commands/index.js +1 -1
  125. package/dist/prosemirror/commands/index.mjs +1 -1
  126. package/dist/prosemirror/commands/paragraph.js +1 -1
  127. package/dist/prosemirror/commands/paragraph.mjs +1 -1
  128. package/dist/prosemirror/commentIdAllocator.d.mts +1 -1
  129. package/dist/prosemirror/commentIdAllocator.d.ts +1 -1
  130. package/dist/prosemirror/commentOps.d.mts +1 -1
  131. package/dist/prosemirror/commentOps.d.ts +1 -1
  132. package/dist/prosemirror/conversion/fromProseDoc.d.mts +1 -1
  133. package/dist/prosemirror/conversion/fromProseDoc.d.ts +1 -1
  134. package/dist/prosemirror/conversion/fromProseDoc.js +1 -1
  135. package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -1
  136. package/dist/prosemirror/conversion/index.d.mts +1 -1
  137. package/dist/prosemirror/conversion/index.d.ts +1 -1
  138. package/dist/prosemirror/conversion/index.js +1 -1
  139. package/dist/prosemirror/conversion/index.mjs +1 -1
  140. package/dist/prosemirror/extensions/index.js +1 -1
  141. package/dist/prosemirror/extensions/index.mjs +1 -1
  142. package/dist/prosemirror/index.d.mts +3 -3
  143. package/dist/prosemirror/index.d.ts +3 -3
  144. package/dist/prosemirror/index.js +2 -2
  145. package/dist/prosemirror/index.mjs +2 -2
  146. package/dist/prosemirror/plugins/index.d.mts +1 -1
  147. package/dist/prosemirror/plugins/index.d.ts +1 -1
  148. package/dist/prosemirror/queries.d.mts +1 -1
  149. package/dist/prosemirror/queries.d.ts +1 -1
  150. package/dist/prosemirror/schema/index.d.mts +2 -2
  151. package/dist/prosemirror/schema/index.d.ts +2 -2
  152. package/dist/prosemirror/schema/index.js +1 -1
  153. package/dist/prosemirror/schema/index.mjs +1 -1
  154. package/dist/prosemirror/utils/extractTrackedChanges.d.mts +1 -1
  155. package/dist/prosemirror/utils/extractTrackedChanges.d.ts +1 -1
  156. package/dist/{sectionPropertiesSerializer-CzgskSoA.d.ts → sectionPropertiesSerializer-BJSNK-Wl.d.ts} +1 -1
  157. package/dist/{sectionPropertiesSerializer-D3yI82iZ.d.mts → sectionPropertiesSerializer-DI3OIQ1j.d.mts} +1 -1
  158. package/dist/types/content.d.mts +1 -1
  159. package/dist/types/content.d.ts +1 -1
  160. package/dist/types/document.d.mts +2 -2
  161. package/dist/types/document.d.ts +2 -2
  162. package/dist/utils/comments.d.mts +1 -1
  163. package/dist/utils/comments.d.ts +1 -1
  164. package/dist/utils/index.d.mts +2 -2
  165. package/dist/utils/index.d.ts +2 -2
  166. package/dist/{variableDetector-D2-xDa2O.d.mts → variableDetector-7xBsshP0.d.mts} +1 -1
  167. package/dist/{variableDetector-d-PpDlNV.d.ts → variableDetector-Bv5Tm0D-.d.ts} +1 -1
  168. package/package.json +1 -1
  169. package/dist/chunk-2KPOGFFR.js +0 -1
  170. package/dist/chunk-34DJT72K.js +0 -1
  171. package/dist/chunk-4QJEMD23.mjs +0 -4
  172. package/dist/chunk-4QSFBX26.mjs +0 -1
  173. package/dist/chunk-4SZAFWLV.mjs +0 -1
  174. package/dist/chunk-6KYOT4E7.js +0 -4
  175. package/dist/chunk-77X765ZO.js +0 -1
  176. package/dist/chunk-AXVWVIIN.js +0 -1
  177. package/dist/chunk-BKP5QMTS.js +0 -1
  178. package/dist/chunk-IM56AITE.mjs +0 -1
  179. package/dist/chunk-KK673XRZ.mjs +0 -1
  180. package/dist/chunk-M65C4SQJ.mjs +0 -2
  181. package/dist/chunk-NO6PIL32.mjs +0 -1
  182. package/dist/chunk-NTYJIOUE.js +0 -2
  183. package/dist/chunk-WCB25ESG.mjs +0 -1
  184. package/dist/chunk-WWG6PUWU.js +0 -1
@@ -0,0 +1 @@
1
+ 'use strict';var chunkIMKU4O3P_js=require('./chunk-IMKU4O3P.js'),chunkDROCYKAR_js=require('./chunk-DROCYKAR.js'),chunkDFDL337G_js=require('./chunk-DFDL337G.js'),chunkMJ5FQX7Q_js=require('./chunk-MJ5FQX7Q.js'),chunkBJSG6TEG_js=require('./chunk-BJSG6TEG.js'),chunkH57LNDBH_js=require('./chunk-H57LNDBH.js');function B(e,s){let r={};for(let t of e)switch(t.type.name){case "bold":r.bold=true;break;case "italic":r.italic=true;break;case "underline":{let n=t.attrs;if(n.style||n.color){let i=n.color?chunkMJ5FQX7Q_js.a(n.color,s):void 0;r.underline={style:n.style,color:i};}else r.underline=true;break}case "strike":r.strike=true;break;case "textColor":{let n=t.attrs;(n.themeColor||n.rgb)&&(r.color=chunkMJ5FQX7Q_js.a({rgb:n.rgb,themeColor:n.themeColor,themeTint:n.themeTint,themeShade:n.themeShade},s));break}case "highlight":r.highlight=chunkMJ5FQX7Q_js.o(t.attrs.color);break;case "fontSize":{let n=t.attrs;r.fontSize=n.size/2;break}case "fontFamily":{let n=t.attrs;r.fontFamily=n.ascii||n.hAnsi;break}case "characterSpacing":{let n=t.attrs;n.spacing!=null&&n.spacing!==0&&(r.letterSpacing=chunkIMKU4O3P_js.a(n.spacing)),n.position!=null&&n.position!==0&&(r.positionPx=chunkBJSG6TEG_js.k(n.position)),n.scale!=null&&n.scale!==100&&(r.horizontalScale=n.scale),n.kerning!=null&&n.kerning>0&&(r.kerningMinPt=chunkBJSG6TEG_js.l(n.kerning));break}case "allCaps":r.allCaps=true;break;case "smallCaps":r.smallCaps=true;break;case "emboss":r.emboss=true;break;case "imprint":r.imprint=true;break;case "textShadow":r.textShadow=true;break;case "textOutline":r.textOutline=true;break;case "hidden":r.hidden=true;break;case "rtl":r.rtl=true;break;case "textEffect":{let n=t.attrs.effect;(n==="blinkBackground"||n==="lights"||n==="antsBlack"||n==="antsRed"||n==="shimmer"||n==="sparkle")&&(r.textEffect=n);break}case "emphasisMark":{let n=t.attrs.type;n==="dot"||n==="comma"||n==="circle"||n==="underDot"?r.emphasisMark=n:r.emphasisMark="dot";break}case "superscript":r.superscript=true;break;case "subscript":r.subscript=true;break;case "hyperlink":{let n=t.attrs;r.hyperlink={href:n.href,tooltip:n.tooltip};break}case "footnoteRef":{let n=t.attrs,i=typeof n.id=="string"?parseInt(n.id,10):n.id;n.noteType==="endnote"?r.endnoteRefId=i:r.footnoteRefId=i,r.superscript=true;break}case "comment":{let n=t.attrs.commentId;n&&(r.commentIds||(r.commentIds=[]),r.commentIds.push(n));break}case "insertion":r.isInsertion=true,r.changeAuthor=t.attrs.author,r.changeDate=t.attrs.date,r.changeRevisionId=t.attrs.revisionId;break;case "deletion":r.isDeletion=true,r.changeAuthor=t.attrs.author,r.changeDate=t.attrs.date,r.changeRevisionId=t.attrs.revisionId;break}return r}function G(e){let s=e.defaultTextFormatting;if(!s)return {};let r={};if(s.fontFamily){let t=s.fontFamily.ascii||s.fontFamily.hAnsi;t&&(r.fontFamily=t);}return s.fontSize!=null&&(r.fontSize=s.fontSize/2),r}function D(e){e.hyperlink&&(e.hyperlink={...e.hyperlink,noDefaultStyle:true},delete e.color,delete e.underline);}function $(e){return e==="contentLocked"||e==="sdtContentLocked"}function Y(e,s){let r=e.attrs;if(r.sdtType==="checkbox"&&!($(r.lock)||r.dataBinding!=null))return {kind:"checkbox",groupId:`sdt@${s}`,pos:s,tag:r.tag!=null?String(r.tag):void 0,alias:r.alias!=null?String(r.alias):void 0,checked:typeof r.checked=="boolean"?r.checked:void 0}}function N(e,s,r){let t=[],n=s+1,i=r.theme,l=G(e.attrs),b=e.attrs.styleId,d=typeof b=="string"&&/^TOC\d*$/i.test(b);function f(u,m,p){if(u.isText&&u.text){let a=B(u.marks,i);d&&D(a);let o={kind:"text",text:u.text,...l,...a,pmStart:m,pmEnd:m+u.nodeSize,inlineSdtWidget:p};t.push(o);}else if(u.type.name==="hardBreak")t.push({kind:"lineBreak",pmStart:m,pmEnd:m+u.nodeSize});else if(u.type.name==="tab"){let a=B(u.marks,i),o={kind:"tab",...l,...a,pmStart:m,pmEnd:m+u.nodeSize};t.push(o);}else if(u.type.name==="image"){let a=u.attrs,o=chunkIMKU4O3P_js.b(a.width||100,a.height||100,r.pageContentHeight),c=B(u.marks,i),h={kind:"image",src:a.src,width:o.width,height:o.height,alt:a.alt,transform:a.transform,wrapType:a.wrapType,displayMode:a.displayMode,cssFloat:a.cssFloat,distTop:a.distTop,distBottom:a.distBottom,distLeft:a.distLeft,distRight:a.distRight,position:a.position,cropTop:a.cropTop,cropRight:a.cropRight,cropBottom:a.cropBottom,cropLeft:a.cropLeft,opacity:a.opacity,isInsertion:c.isInsertion,isDeletion:c.isDeletion,changeAuthor:c.changeAuthor,changeDate:c.changeDate,changeRevisionId:c.changeRevisionId,pmStart:m,pmEnd:m+u.nodeSize};t.push(h);}else if(u.type.name==="field"){let a=u.attrs.fieldType,o=a==="PAGE"?"PAGE":a==="NUMPAGES"?"NUMPAGES":a==="DATE"?"DATE":a==="TIME"?"TIME":"OTHER",c=B(u.marks,i);d&&D(c),t.push({kind:"field",fieldType:o,fallback:u.attrs.displayText||"",...l,...c,pmStart:m,pmEnd:m+u.nodeSize});}else if(u.type.name==="math"){let a=u.attrs.plainText||"[equation]";t.push({kind:"text",text:a,italic:true,fontFamily:"Cambria Math",pmStart:m,pmEnd:m+u.nodeSize});}else if(u.type.name==="sdt"){let a=Y(u,m)??p,o=m+1;u.forEach((c,h)=>{f(c,o+h,a);});}}return e.forEach((u,m)=>{f(u,n+m);}),t}function j(e){return Math.max(1,Math.round(e/8*1.333))}var Z={single:"solid",double:"double",dotted:"dotted",dashed:"dashed",thick:"solid",dashSmallGap:"dashed",dotDash:"dashed",dotDotDash:"dotted",triple:"double",wave:"solid",doubleWave:"double",threeDEmboss:"ridge",threeDEngrave:"groove",outset:"outset",inset:"inset"};function w(e,s){if(!e||!e.style||e.style==="none"||e.style==="nil")return;let r={style:Z[e.style]||"solid",width:j(e.size??0),color:e.color?chunkMJ5FQX7Q_js.a(e.color,s):"#000000"};return e.space!==void 0&&(r.space=chunkBJSG6TEG_js.j(e.space)),r}function O(e,s){let r=e.borders;if(!r)return;let t={},n=["top","bottom","left","right"];for(let i of n){let l=r[i],b=l?w(l,s):void 0;t[i]=b??{width:0,style:"none"};}return Object.keys(t).length>0?t:void 0}function V(e,s){let r=[];for(let t=0;t<=s;t+=1){let n=e[t]??0;if(n<=0)break;r.push(n);}return r.length===0?"1.":`${r.join(".")}.`}var q=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];function W(e,s){if(e<=0)return "";let r=e,t="";for(let[n,i]of q)for(;r>=n;)t+=i,r-=n;return s?t:t.toLowerCase()}function H(e,s){if(e<=0)return "";let r=e,t="";for(;r>0;){let n=(r-1)%26;t=String.fromCharCode(65+n)+t,r=Math.floor((r-1)/26);}return s?t:t.toLowerCase()}function K(e,s){if(e<=0)return "";switch(s){case "upperRoman":return W(e,true);case "lowerRoman":return W(e,false);case "upperLetter":return H(e,true);case "lowerLetter":return H(e,false);case "decimalZero":return chunkH57LNDBH_js.f(e,2);case "decimalZero3":return chunkH57LNDBH_js.f(e,3);case "decimalZero4":return chunkH57LNDBH_js.f(e,4);case "decimalZero5":return chunkH57LNDBH_js.f(e,5);case "none":return "";default:return String(e)}}function X(e,s,r){return e.replace(/%(\d)([.):\]])?/g,(t,n,i="")=>{let l=parseInt(n,10)-1;if(l<0)return "";let b=s[l]??0,d=r?.[l]??"decimal",f=K(b,d);return f?f+i:""})}function _(e,s,r){let t=e.numPr;if(!t)return null;let n=t.numId;if(n==null||n===0)return null;if(e.listIsBullet)return chunkDFDL337G_js.p(e.listMarker||"");let i=t.ilvl??0;if((e.listLevelNumFmts?.[i]??e.listNumFmt)==="none")return e.listMarker?e.listMarker:null;let b=e.listAbstractNumId??n,d=s.get(b)??new Array(9).fill(0),f=`${n}:${i}`;r.has(f)||(r.add(f),e.listStartOverride!=null&&(d[i]=e.listStartOverride-1)),d[i]=(d[i]??0)+1;for(let u=i+1;u<d.length;u+=1)d[u]=0;return s.set(b,d),e.listMarker&&e.listMarker.includes("%")?X(e.listMarker,d,e.listLevelNumFmts??void 0):e.listMarker?e.listMarker:V(d,i)}var J="Calibri",Q=11;function A(e,s,r,t,n){let i={};if(e.alignment){let o=e.alignment;o==="both"||o==="distribute"?i.alignment="justify":o==="left"?i.alignment="left":o==="center"?i.alignment="center":o==="right"&&(i.alignment="right");}let l=e._originalFormatting?.beforeAutospacing,b=e._originalFormatting?.afterAutospacing;(l||b||e.spaceBefore!=null||e.spaceAfter!=null||e.lineSpacing!=null)&&(i.spacing={},l?i.spacing.before=14:e.spaceBefore!=null&&(i.spacing.before=chunkIMKU4O3P_js.a(e.spaceBefore)),b?i.spacing.after=14:e.spaceAfter!=null&&(i.spacing.after=chunkIMKU4O3P_js.a(e.spaceAfter)),e.lineSpacing!=null&&(e.lineSpacingRule==="exact"||e.lineSpacingRule==="atLeast"?(i.spacing.line=chunkIMKU4O3P_js.a(e.lineSpacing),i.spacing.lineUnit="px",i.spacing.lineRule=e.lineSpacingRule):(i.spacing.line=e.lineSpacing/240,i.spacing.lineUnit="multiplier",i.spacing.lineRule="auto"))),e.spacingExplicit&&(i.spacingExplicit=e.spacingExplicit);let d=e.indentLeft,f=e.indentFirstLine,u=e.hangingIndent;if(e.numPr?.numId&&d==null&&(d=((e.numPr.ilvl??0)+1)*720,f==null&&(f=-360,u=true)),(d!=null||e.indentRight!=null||f!=null)&&(i.indent={},d!=null&&(i.indent.left=chunkIMKU4O3P_js.a(d)),e.indentRight!=null&&(i.indent.right=chunkIMKU4O3P_js.a(e.indentRight)),f!=null&&(u?i.indent.hanging=Math.abs(chunkIMKU4O3P_js.a(f)):i.indent.firstLine=chunkIMKU4O3P_js.a(f))),e.styleId&&(i.styleId=e.styleId),e.borders){let o=e.borders;i.borders={};let c=h=>h?w(h,s):void 0;o.top&&(i.borders.top=c(o.top)),o.bottom&&(i.borders.bottom=c(o.bottom)),o.left&&(i.borders.left=c(o.left)),o.right&&(i.borders.right=c(o.right)),o.between&&(i.borders.between=c(o.between)),o.bar&&(i.borders.bar=c(o.bar)),!i.borders.top&&!i.borders.bottom&&!i.borders.left&&!i.borders.right&&!i.borders.between&&!i.borders.bar&&delete i.borders;}let m=chunkMJ5FQX7Q_js.b(e.shading?.fill,s);m&&(i.shading=`#${m}`),e.tabs&&e.tabs.length>0&&(i.tabs=e.tabs.map(o=>({val:ee(o.alignment),pos:o.position,leader:o.leader}))),e.pageBreakBefore&&(i.pageBreakBefore=true),e.keepNext&&(i.keepNext=true),e.keepLines&&(i.keepLines=true),e.contextualSpacing&&(i.contextualSpacing=true),e.bidi&&(i.bidi=true),e.styleId&&(i.styleId=e.styleId),e.numPr&&(i.numPr={numId:e.numPr.numId,ilvl:e.numPr.ilvl});let p=r&&t?_(e,r,t):null;p!=null?i.listMarker=p:e.listMarker&&(i.listMarker=e.listMarker),e.listIsBullet!=null&&(i.listIsBullet=e.listIsBullet),e.listMarkerHidden&&(i.listMarkerHidden=true),e.listMarkerFontFamily&&(i.listMarkerFontFamily=e.listMarkerFontFamily),e.listMarkerFontSize&&(i.listMarkerFontSize=e.listMarkerFontSize),e.listMarkerSuffix&&(i.listMarkerSuffix=e.listMarkerSuffix),n!==void 0&&(i.defaultTabStopTwips=n);let a=e.defaultTextFormatting;if(a&&(a.fontSize!=null&&(i.defaultFontSize=a.fontSize/2),a.fontFamily&&(i.defaultFontFamily=a.fontFamily.ascii||a.fontFamily.hAnsi)),e.pPrIns&&(i.pPrIns=e.pPrIns),e.pPrDel&&(i.pPrDel=e.pPrDel),e.numPr){let o=e.pPrChange,c=Array.isArray(o)&&o.some(h=>!h?.previousFormatting?.numPr);e.pPrDel?i.listMarkerRevision="del":(e.pPrIns||c)&&(i.listMarkerRevision="ins");}return i}function ee(e){switch(e){case "left":return "start";case "right":return "end";case "center":return "center";case "decimal":return "decimal";case "bar":return "bar";case "clear":return "clear";case "num":return "start";default:return "start"}}function M(e,s,r){let t=e.attrs,n=N(e,s,r),i=A(t,r.theme,r.listCounters,r.listSeenNumIds,r.defaultTabStopTwips);return {kind:"paragraph",id:chunkIMKU4O3P_js.c(),runs:n,attrs:i,pmStart:s,pmEnd:s+e.nodeSize}}function te(e,s,r,t){let n=[],i=s+1;e.forEach(o=>{o.type.name==="paragraph"?n.push(M(o,i,r)):o.type.name==="table"&&n.push(U(o,i,r)),i+=o.nodeSize;});let l=e.attrs,b=l.width,d=l.widthType,f=b&&(!d||d==="dxa"||d==="auto")?chunkIMKU4O3P_js.a(b):void 0,u=l.margins,m=(o,c)=>{if(o!=null){let h=chunkIMKU4O3P_js.a(o);if(h>0)return h}if(c!=null){let h=chunkIMKU4O3P_js.a(c);if(h>=0)return h}return 0},p={top:m(u?.top,t?.top),right:m(u?.right,t?.right),bottom:m(u?.bottom,t?.bottom),left:m(u?.left,t?.left)},a=l.cellMarker;return {id:chunkIMKU4O3P_js.c(),blocks:n,colSpan:l.colspan,rowSpan:l.rowspan,width:f,widthValue:b,widthType:d,verticalAlign:l.verticalAlign,background:l.backgroundColor?`#${l.backgroundColor}`:void 0,borders:O(l,r.theme),padding:p,noWrap:l.noWrap||void 0,trackedMarker:a??void 0}}function ne(e,s,r,t){let n=[],i=s+1;e.forEach(d=>{(d.type.name==="tableCell"||d.type.name==="tableHeader")&&n.push(te(d,i,r,t)),i+=d.nodeSize;});let l=e.attrs,b=l._originalFormatting;return {id:chunkIMKU4O3P_js.c(),cells:n,height:l.height?chunkIMKU4O3P_js.a(l.height):void 0,heightRule:l.heightRule??void 0,isHeader:l.isHeader,cantSplit:b?.cantSplit||void 0,trackedIns:l.trIns??void 0,trackedDel:l.trDel??void 0}}function U(e,s,r){let t=[],n=s+1,i=e.attrs.cellMargins;e.forEach(c=>{c.type.name==="tableRow"&&t.push(ne(c,n,r,i)),n+=c.nodeSize;});let b=e.attrs.columnWidths?.map(chunkIMKU4O3P_js.a),d=e.attrs.width,f=e.attrs.widthType;if(!b&&t.length>0){let h=t[0].cells.map(k=>k.width);h.every(k=>k!==void 0&&k>0)&&(b=h);}let u=e.attrs.justification,m=e.attrs._originalFormatting,p=m?.indent?.value&&m.indent.type==="dxa"?chunkIMKU4O3P_js.a(m.indent.value):void 0,a=e.attrs.floating,o=a?{horzAnchor:a.horzAnchor,vertAnchor:a.vertAnchor,tblpX:a.tblpX!==void 0?chunkIMKU4O3P_js.a(a.tblpX):void 0,tblpXSpec:a.tblpXSpec,tblpY:a.tblpY!==void 0?chunkIMKU4O3P_js.a(a.tblpY):void 0,tblpYSpec:a.tblpYSpec,topFromText:a.topFromText!==void 0?chunkIMKU4O3P_js.a(a.topFromText):void 0,bottomFromText:a.bottomFromText!==void 0?chunkIMKU4O3P_js.a(a.bottomFromText):void 0,leftFromText:a.leftFromText!==void 0?chunkIMKU4O3P_js.a(a.leftFromText):void 0,rightFromText:a.rightFromText!==void 0?chunkIMKU4O3P_js.a(a.rightFromText):void 0}:void 0;return {kind:"table",id:chunkIMKU4O3P_js.c(),rows:t,columnWidths:b,width:d,widthType:f,justification:u,indent:p,floating:o,pmStart:s,pmEnd:s+e.nodeSize}}function re(e,s,r){let t=e.attrs,n=t.wrapType,i=n==="behind"||n==="inFront",l=chunkIMKU4O3P_js.b(t.width||100,t.height||100,r);return {kind:"image",id:chunkIMKU4O3P_js.c(),src:t.src,width:l.width,height:l.height,alt:t.alt,transform:t.transform,anchor:i?{isAnchored:true,offsetH:t.distLeft,offsetV:t.distTop,behindDoc:n==="behind"}:void 0,hlinkHref:t.hlinkHref,pmStart:s,pmEnd:s+e.nodeSize}}function ie(e,s,r){let t=e.attrs,n=[];return e.forEach((i,l)=>{if(i.type.name==="paragraph"){let b=M(i,s+1+l,r);n.push(b);}}),{kind:"textBox",id:chunkIMKU4O3P_js.c(),width:t.width??chunkDROCYKAR_js.b,height:t.height??void 0,fillColor:t.fillColor,outlineWidth:t.outlineWidth,outlineColor:t.outlineColor,outlineStyle:t.outlineStyle,margins:{top:t.marginTop??chunkDROCYKAR_js.a.top,bottom:t.marginBottom??chunkDROCYKAR_js.a.bottom,left:t.marginLeft??chunkDROCYKAR_js.a.left,right:t.marginRight??chunkDROCYKAR_js.a.right},content:n,displayMode:t.displayMode,cssFloat:t.cssFloat,wrapType:t.wrapType,wrapText:t.wrapText,anchorTarget:t.anchorTarget,position:t.position,distTop:t.distTop,distBottom:t.distBottom,distLeft:t.distLeft,distRight:t.distRight,pmStart:s,pmEnd:s+e.nodeSize}}function xe(e,s={}){let r=e.attrs?.defaultTabStopTwips,t={...s,defaultFont:s.defaultFont??J,defaultSize:s.defaultSize??Q,defaultTabStopTwips:s.defaultTabStopTwips??r},n=[],i=0,l={top:1440,bottom:1440,left:1440,right:1440};t.listCounters||(t.listCounters=new Map),t.listSeenNumIds||(t.listSeenNumIds=new Set);let b=(d,f,u)=>{if(d.type.name==="blockSdt"){let p=d.attrs,a={id:`sdt@${f}`,sdtType:typeof p.sdtType=="string"?p.sdtType:"richText",tag:p.tag!=null?String(p.tag):void 0,alias:p.alias!=null?String(p.alias):void 0,lock:p.lock!=null?String(p.lock):void 0,checked:typeof p.checked=="boolean"?p.checked:void 0,bound:p.dataBinding!=null?true:void 0,repeatingItem:/<w15:repeatingSectionItem[\s/>]/.test(String(p.rawPropertiesXml??""))?true:void 0},o=[...u,a];d.forEach((c,h)=>{b(c,f+1+h,o);});return}let m=n.length;switch(d.type.name){case "paragraph":{let p=M(d,f,t),a=d.attrs;n.push(p);let o=a._sectionProperties;if(o||a.sectionBreakType){let c={kind:"sectionBreak",id:chunkIMKU4O3P_js.c(),type:o?.sectionStart??a.sectionBreakType};if(o){if((o.pageWidth!==void 0||o.pageHeight!==void 0)&&(c.pageSize={w:chunkIMKU4O3P_js.a(o.pageWidth??12240),h:chunkIMKU4O3P_js.a(o.pageHeight??15840)}),o.marginTop!==void 0||o.marginBottom!==void 0||o.marginLeft!==void 0||o.marginRight!==void 0){let k={top:o.marginTop??l.top,bottom:o.marginBottom??l.bottom,left:o.marginLeft??l.left,right:o.marginRight??l.right};c.margins={top:chunkIMKU4O3P_js.a(k.top),bottom:chunkIMKU4O3P_js.a(k.bottom),left:chunkIMKU4O3P_js.a(k.left),right:chunkIMKU4O3P_js.a(k.right)},l=k;}let h=o.columnCount??1;if(h>1){let k={count:h,gap:chunkIMKU4O3P_js.a(o.columnSpace??720),equalWidth:o.equalWidth??true,separator:o.separator};c.columns=k;}}n.push(c);}}break;case "table":n.push(U(d,f,t));break;case "image":n.push(re(d,f,t.pageContentHeight));break;case "textBox":n.push(ie(d,f,t));break;case "horizontalRule":case "pageBreak":{let p={kind:"pageBreak",id:chunkIMKU4O3P_js.c(),pmStart:f,pmEnd:f+d.nodeSize};n.push(p);break}}if(u.length>0)for(let p=m;p<n.length;p++)n[p].sdtGroups=u;};return e.forEach((d,f)=>{b(d,i+f,[]);}),n}exports.a=w;exports.b=X;exports.c=xe;
@@ -0,0 +1 @@
1
+ import {d,f,g,c,b as b$3}from'./chunk-O5L4BZCZ.mjs';import {b as b$5}from'./chunk-QPFJJPIC.mjs';import {a}from'./chunk-GYWTUUXX.mjs';import {b as b$1}from'./chunk-SHZOAUHB.mjs';import {b}from'./chunk-2XP6GLA4.mjs';import {b as b$4,n}from'./chunk-67LVRQIR.mjs';import {f as f$1}from'./chunk-KNY7SXPJ.mjs';import {b as b$2}from'./chunk-DI6CRWSW.mjs';function ve(e){if(!e||e.pattern&&e.pattern!=="clear")return;let n$1=e.fill?.rgb;if(!(!n$1||e.fill?.auto))return n(n$1)}function j(e){if(!e)return [];let n=[];e.bold&&n.push(b$1.mark("bold")),e.italic&&n.push(b$1.mark("italic")),e.underline&&e.underline.style!=="none"&&n.push(b$1.mark("underline",{style:e.underline.style,color:e.underline.color})),(e.strike||e.doubleStrike)&&n.push(b$1.mark("strike",{double:e.doubleStrike||false})),e.color&&!e.color.auto&&n.push(b$1.mark("textColor",{rgb:e.color.rgb,themeColor:e.color.themeColor,themeTint:e.color.themeTint,themeShade:e.color.themeShade}));let o=e.highlight&&e.highlight!=="none"?e.highlight:ve(e.shading);return o&&n.push(b$1.mark("highlight",{color:o})),e.fontSize&&n.push(b$1.mark("fontSize",{size:e.fontSize})),e.fontFamily&&n.push(b$1.mark("fontFamily",{ascii:e.fontFamily.ascii,hAnsi:e.fontFamily.hAnsi,eastAsia:e.fontFamily.eastAsia,cs:e.fontFamily.cs,asciiTheme:e.fontFamily.asciiTheme,hAnsiTheme:e.fontFamily.hAnsiTheme,eastAsiaTheme:e.fontFamily.eastAsiaTheme,csTheme:e.fontFamily.csTheme})),e.vertAlign==="superscript"?n.push(b$1.mark("superscript")):e.vertAlign==="subscript"&&n.push(b$1.mark("subscript")),e.allCaps&&n.push(b$1.mark("allCaps")),e.smallCaps&&n.push(b$1.mark("smallCaps")),(e.spacing!=null||e.position!=null||e.scale!=null||e.kerning!=null)&&n.push(b$1.mark("characterSpacing",{spacing:e.spacing??null,position:e.position??null,scale:e.scale??null,kerning:e.kerning??null})),e.emboss&&n.push(b$1.mark("emboss")),e.imprint&&n.push(b$1.mark("imprint")),e.shadow&&n.push(b$1.mark("textShadow")),e.emphasisMark&&e.emphasisMark!=="none"&&n.push(b$1.mark("emphasisMark",{type:e.emphasisMark})),e.outline&&n.push(b$1.mark("textOutline")),e.hidden&&n.push(b$1.mark("hidden")),e.rtl&&n.push(b$1.mark("rtl")),e.effect&&e.effect!=="none"&&n.push(b$1.mark("textEffect",{effect:e.effect})),e.styleId&&n.push(b$1.mark("runStyle",{styleId:e.styleId})),n}function E(e,n){if(!e)return;if(!n)return e;let o=n.resolveRunStyle(e.styleId);return o?b$2(o,e):e}function te(e,n){let o="",l,t=e.type==="simpleField"?e.content:e.fieldResult;if(t){for(let s of t)if(s.type==="run"){for(let u of s.content)u.type==="text"&&(o+=u.text);!l&&s.formatting&&(l=s.formatting);}}let r=b$2(n,l),i=j(r);return b$1.node("field",{fieldType:e.fieldType,instruction:e.instruction,displayText:o,fieldKind:e.type==="simpleField"?"simple":"complex",fldLock:e.fldLock??false,dirty:e.dirty??false},void 0,i)}function ne(e){return b$1.node("math",{display:e.display,ommlXml:e.ommlXml,plainText:e.plainText||""})}function U(e,n,o){let l=[],t=e.formatting?.styleId?o?.getRunStyleOwnProperties(e.formatting.styleId):void 0,r=b$2(b$2(n,t),e.formatting),i=j(r);for(let s of e.content){let u=he(s,i);l.push(...u);}return l}function he(e,n){switch(e.type){case "text":return e.text?[b$1.text(e.text,n)]:[];case "break":return e.breakType==="textWrapping"||!e.breakType?[b$1.node("hardBreak",null,void 0,n)]:[];case "tab":return [b$1.node("tab",null,void 0,n)];case "drawing":return e.image?[Me(e.image)]:[];case "shape":{let t=e.shape;return t.textBody&&t.textBody.content.length>0?[]:[Ne(t)]}case "footnoteRef":let o=b$1.mark("footnoteRef",{id:e.id.toString(),noteType:"footnote"});return [b$1.text(e.id.toString(),[...n,o])];case "endnoteRef":let l=b$1.mark("footnoteRef",{id:e.id.toString(),noteType:"endnote"});return [b$1.text(e.id.toString(),[...n,l])];default:return []}}function Me(e){let n=e.size?.width?f$1(e.size.width):void 0,o=e.size?.height?f$1(e.size.height):void 0,l=e.wrap.type,t=e.wrap.wrapText,r=e.position?.horizontal?.alignment,i;l==="inline"||l==="topAndBottom"?i="none":l==="square"||l==="tight"||l==="through"?t==="left"?i="right":t==="right"||r==="left"?i="left":r==="right"?i="right":i="none":i="none";let s="inline";l==="inline"?s="inline":l==="topAndBottom"?s="block":b$5(l)||i&&i!=="none"?s="float":s="block";let u;if(e.transform){let P=[];e.transform.rotation&&P.push(`rotate(${e.transform.rotation}deg)`),e.transform.flipH&&P.push("scaleX(-1)"),e.transform.flipV&&P.push("scaleY(-1)"),P.length>0&&(u=P.join(" "));}let m=e.wrap.distT!=null?f$1(e.wrap.distT):void 0,c=e.wrap.distB!=null?f$1(e.wrap.distB):void 0,f=e.wrap.distL!=null?f$1(e.wrap.distL):void 0,a=e.wrap.distR!=null?f$1(e.wrap.distR):void 0,p;e.position&&(p={horizontal:e.position.horizontal?{relativeTo:e.position.horizontal.relativeTo,posOffset:e.position.horizontal.posOffset,align:e.position.horizontal.alignment}:void 0,vertical:e.position.vertical?{relativeTo:e.position.vertical.relativeTo,posOffset:e.position.vertical.posOffset,align:e.position.vertical.alignment}:void 0});let S,k,v;if(e.outline&&e.outline.width){S=Math.round(e.outline.width/914400*96*100)/100,e.outline.color?.rgb&&(k=`#${e.outline.color.rgb}`);let P={solid:"solid",dot:"dotted",dash:"dashed",lgDash:"dashed",dashDot:"dashed",lgDashDot:"dashed",lgDashDotDot:"dashed",sysDot:"dotted",sysDash:"dashed",sysDashDot:"dashed",sysDashDotDot:"dashed"};v=e.outline.style&&P[e.outline.style]||"solid";}let D=e.padding?.top?f$1(e.padding.top):void 0,N=e.padding?.bottom?f$1(e.padding.bottom):void 0,B=e.padding?.left?f$1(e.padding.left):void 0,g=e.padding?.right?f$1(e.padding.right):void 0;return b$1.node("image",{src:e.src||"",alt:e.alt,title:e.title,width:n,height:o,rId:e.rId,wrapType:l,displayMode:s,cssFloat:i,transform:u,distTop:m,distBottom:c,distLeft:f,distRight:a,position:p,borderWidth:S,borderColor:k,borderStyle:v,wrapText:t,hlinkHref:e.hlinkHref,cropTop:e.crop?.top,cropRight:e.crop?.right,cropBottom:e.crop?.bottom,cropLeft:e.crop?.left,opacity:e.opacity,effectExtentTop:D,effectExtentBottom:N,effectExtentLeft:B,effectExtentRight:g,layoutInCell:e.layoutInCell,allowOverlap:e.allowOverlap})}function Y(e,n,o){let l=[],t=e.href||(e.anchor?`#${e.anchor}`:""),r=b$1.mark("hyperlink",{href:t,tooltip:e.tooltip,rId:e.rId});for(let i of e.children)if(i.type==="run"){let s=i.formatting?.styleId?o?.getRunStyleOwnProperties(i.formatting.styleId):void 0,u=b$2(b$2(n,s),i.formatting),c=[...j(u),r];for(let f of i.content)l.push(...he(f,c));}return l}function Ne(e){let n=e.size?.width?f$1(e.size.width):100,o=e.size?.height?f$1(e.size.height):80,l,t="solid",r,i,s;if(e.fill&&(t=e.fill.type,e.fill.color?.rgb&&(l=`#${e.fill.color.rgb}`),e.fill.type==="gradient"&&e.fill.gradient)){let a=e.fill.gradient;r=a.type,i=a.angle,s=JSON.stringify(a.stops.map(p=>({position:p.position,color:p.color.rgb?`#${p.color.rgb}`:"#000000"})));}let u,m,c;e.outline&&(e.outline.width&&(u=Math.round(e.outline.width/914400*96*100)/100),e.outline.color?.rgb&&(m=`#${e.outline.color.rgb}`),c=e.outline.style||"solid");let f;if(e.transform){let a=[];e.transform.rotation&&a.push(`rotate(${e.transform.rotation}deg)`),e.transform.flipH&&a.push("scaleX(-1)"),e.transform.flipV&&a.push("scaleY(-1)"),a.length>0&&(f=a.join(" "));}return b$1.node("shape",{shapeType:e.shapeType||"rect",shapeId:e.id,width:n,height:o,fillColor:l,fillType:t,gradientType:r,gradientAngle:i,gradientStops:s,outlineWidth:u,outlineColor:m,outlineStyle:c,transform:f})}function $(e,n,o,l){let t=Be(e,n),r=[],i,s=[],u=new Set,m;n&&(m=n.resolveParagraphStyle(e.formatting?.styleId).runFormatting);let c=b$2(m,l);for(let f of e.content){if(f.type==="commentRangeStart")u.add(f.id);else if(f.type==="commentRangeEnd")u.delete(f.id);else if(f.type==="run"){let a=U(f,c,n),p=Ie(f,a);p&&s?s.push(p):s=void 0,u.size>0&&(a=O(a,u)),r.push(...a);}else if(f.type==="hyperlink"){let a=Y(f,c,n);r.push(...a),s=void 0;}else if(f.type==="simpleField"||f.type==="complexField"){let a=te(f,c);a&&r.push(a),s=void 0;}else if(f.type==="inlineSdt"){let a=be(f,c,n);a&&r.push(a),s=void 0;}else if(f.type==="insertion"){let a=J(f,"insertion",c,n);u.size>0&&(a=O(a,u)),r.push(...a),s=void 0;}else if(f.type==="deletion"){let a=J(f,"deletion",c,n);u.size>0&&(a=O(a,u)),r.push(...a),s=void 0;}else if(f.type==="moveFrom"){let a=J(f,"deletion",c,n,true);u.size>0&&(a=O(a,u)),r.push(...a),s=void 0;}else if(f.type==="moveTo"){let a=J(f,"insertion",c,n,true);u.size>0&&(a=O(a,u)),r.push(...a),s=void 0;}else if(f.type==="mathEquation"){let a=ne(f);a&&r.push(a),s=void 0;}else f.type!=="bookmarkStart"&&f.type!=="bookmarkEnd"&&(s=void 0);f.type==="bookmarkStart"&&(i||(i=[]),i.push({id:f.id,name:f.name}));}return i&&(t.bookmarks=i),s&&s.length>0&&(t._originalRunBoundaries=s),b$1.node("paragraph",t,r)}function Ie(e,n){let o="",l;for(let t of n){if(!t.isText)return null;o+=t.text??"";let r=c(t.marks,b$3);if(l!=null&&l!==r)return null;l=r;}return {text:o,...l!=null?{marksKey:l}:{},...e.formatting?{formatting:e.formatting}:{},...e.propertyChanges?{propertyChanges:e.propertyChanges}:{}}}function O(e,n){if(n.size===0)return e;let o=[...n][0],l=b$1.marks.comment.create({commentId:o});return e.map(t=>t.isText?t.mark(l.addToSet(t.marks)):t)}function J(e,n,o,l,t=false){let r=[];for(let s of e.content)s.type==="run"?r.push(...U(s,o,l)):s.type==="hyperlink"&&r.push(...Y(s,o,l));let i=b$1.marks[n].create({revisionId:e.info.id,author:e.info.author,date:e.info.date??null,isMovePair:t});return r.map(s=>s.isText||s.type.allowsMarkType(i.type)?s.mark(i.addToSet(s.marks)):s)}function Be(e,n){let o=e.formatting,l=o?.styleId,t={paraId:e.paraId??void 0,textId:e.textId??void 0,styleId:l,numPr:o?.numPr,numPrFromStyle:o?.numPrFromStyle,listNumFmt:e.listRendering?.numFmt,listIsBullet:e.listRendering?.isBullet,listMarker:e.listRendering?.marker,listMarkerHidden:e.listRendering?.markerHidden||void 0,listMarkerFontFamily:e.listRendering?.markerFontFamily||void 0,listMarkerFontSize:e.listRendering?.markerFontSize||void 0,listMarkerSuffix:e.listRendering?.markerSuffix||void 0,listLevelNumFmts:e.listRendering?.levelNumFmts||void 0,listAbstractNumId:e.listRendering?.abstractNumId,listStartOverride:e.listRendering?.startOverride,_originalFormatting:o||void 0};if(n){let r=n.resolveParagraphStyle(l),i=r.paragraphFormatting,s=r.runFormatting;t.alignment=o?.alignment??i?.alignment,t.spaceBefore=o?.spaceBefore??i?.spaceBefore,t.spaceAfter=o?.spaceAfter??i?.spaceAfter,t.lineSpacing=o?.lineSpacing??i?.lineSpacing,t.lineSpacingRule=o?.lineSpacingRule??i?.lineSpacingRule,o?.spacingExplicit&&(t.spacingExplicit=o.spacingExplicit),t.indentLeft=o?.indentLeft??i?.indentLeft,t.indentRight=o?.indentRight??i?.indentRight;let m=o?.numPr?.numId===0&&i?.numPr&&i.numPr.numId!==0?void 0:i;t.indentFirstLine=o?.indentFirstLine??m?.indentFirstLine,t.hangingIndent=o?.hangingIndent??m?.hangingIndent,t.borders=o?.borders??i?.borders,t.shading=o?.shading??i?.shading,t.tabs=o?.tabs??i?.tabs,t.pageBreakBefore=o?.pageBreakBefore??i?.pageBreakBefore,t.keepNext=o?.keepNext??i?.keepNext,t.keepLines=o?.keepLines??i?.keepLines,t.contextualSpacing=o?.contextualSpacing??i?.contextualSpacing,t.outlineLevel=o?.outlineLevel??i?.outlineLevel,t.bidi=o?.bidi??i?.bidi;let c=n.getDefaultCharacterStyle()?.rPr,f=c?b$2(s,c):s,a=E(o?.runProperties,n);t.defaultTextFormatting=b$2(f,a),!o?.numPr&&i?.numPr&&i.numPr.numId!==0&&(t.numPr=i.numPr,t.numPrFromStyle=i.numPr);}else t.alignment=o?.alignment,t.spaceBefore=o?.spaceBefore,t.spaceAfter=o?.spaceAfter,t.lineSpacing=o?.lineSpacing,t.lineSpacingRule=o?.lineSpacingRule,o?.spacingExplicit&&(t.spacingExplicit=o.spacingExplicit),t.indentLeft=o?.indentLeft,t.indentRight=o?.indentRight,t.indentFirstLine=o?.indentFirstLine,t.hangingIndent=o?.hangingIndent,t.borders=o?.borders,t.shading=o?.shading,t.tabs=o?.tabs,t.pageBreakBefore=o?.pageBreakBefore,t.keepNext=o?.keepNext,t.keepLines=o?.keepLines,t.outlineLevel=o?.outlineLevel,t.bidi=o?.bidi,t.defaultTextFormatting=E(o?.runProperties,n);if(e.sectionProperties){t._sectionProperties=e.sectionProperties;let r=e.sectionProperties.sectionStart;(r==="nextPage"||r==="continuous"||r==="oddPage"||r==="evenPage")&&(t.sectionBreakType=r);}return e.renderedPageBreakBefore&&(t.renderedPageBreakBefore=true),ze(e)&&(t.pageBreakBefore=true),e.pPrIns&&(t.pPrIns={revisionId:e.pPrIns.id,author:e.pPrIns.author,date:e.pPrIns.date??null}),e.pPrDel&&(t.pPrDel={revisionId:e.pPrDel.id,author:e.pPrDel.author,date:e.pPrDel.date??null}),e.propertyChanges&&e.propertyChanges.length>0&&(t.pPrChange=e.propertyChanges),t}function be(e,n,o){let l=e.properties,t=[];for(let r of e.content)if(r.type==="run"){let i=U(r,n,o);t.push(...i);}else if(r.type==="hyperlink"){let i=Y(r,n,o);t.push(...i);}else if(r.type==="simpleField"||r.type==="complexField"){let i=te(r,n);i&&t.push(i);}else if(r.type==="inlineSdt"){let i=be(r,n,o);i&&t.push(i);}else if(r.type==="mathEquation"){let i=ne(r);i&&t.push(i);}return b$1.node("sdt",d(l),t.length>0?t:void 0)}function De(e){return e.type==="text"?e.text.length>0:true}function Te(e,n){for(let o of e)o.type==="break"&&o.breakType==="page"?n.push("pageBreak"):De(o)&&n.push("visible");}function V(e,n){for(let o of e)o.type==="run"?Te(o.content,n):V(o.children.filter(l=>l.type==="run"),n);}function ye(e,n){for(let o of e)switch(o.type){case "run":Te(o.content,n);break;case "hyperlink":V(o.children.filter(l=>l.type==="run"),n);break;case "simpleField":V(o.content,n);break;case "complexField":V([...o.fieldCode,...o.fieldResult],n);break;case "inlineSdt":ye(o.content,n);break;case "insertion":case "deletion":case "moveFrom":case "moveTo":V(o.content,n);break;case "mathEquation":n.push("visible");break}}function Pe(e){let n=[];return ye(e.content,n),n}function ze(e){return Pe(e)[0]==="pageBreak"}function Ce(e){let n=false,o=false;for(let l of Pe(e))if(l==="pageBreak"){if(o||n)return true;n=true;}else o=true;return false}function R(e,n,o){if(!e||!n)return;let l=e.getStyle(n);if(!l?.tblStylePr)return;let t=l.tblStylePr.find(u=>u.type===o);if(!t)return;let r=E(t.pPr?.runProperties,e),i=E(t.rPr,e),s=b$2(r,i);return {tcPr:t.tcPr,rPr:s}}function I(e,n){if(!e&&!n)return;if(!e)return n;if(!n)return e;let o={},l=e.tcPr,t=n.tcPr;if(l||t){let r={...l??{},...t??{}};(l?.borders||t?.borders)&&(r.borders={...l?.borders??{},...t?.borders??{}}),(l?.shading||t?.shading)&&(r.shading={...l?.shading??{},...t?.shading??{}}),(l?.margins||t?.margins)&&(r.margins={...l?.margins??{},...t?.margins??{}}),o.tcPr=r;}return o.rPr=b$2(e.rPr,n.rPr),o}function Ae(e){let n=new Map,o=e.rows.length,l=new Map;for(let t=0;t<o;t++){let r=e.rows[t],i=0,s=r.cells.map(m=>{let c=m.formatting?.gridSpan??1,f=i;return i+=c,{colIndex:f,vMerge:m.formatting?.vMerge,key:`${t}-${f}`}});if(s.length>0&&s.every(({colIndex:m,vMerge:c})=>c==="continue"&&l.has(m))){for(let{colIndex:m,key:c}of s)l.delete(m),n.set(c,{rowSpan:1,skip:false});continue}for(let{colIndex:m,vMerge:c,key:f}of s){let a=m;if(c==="restart")l.set(a,t),n.set(f,{rowSpan:1,skip:false});else if(c==="continue"){let p=l.get(a);if(p!==void 0){let S=`${p}-${a}`,k=n.get(S);k&&k.rowSpan++,n.set(f,{rowSpan:1,skip:true});}else n.set(f,{rowSpan:1,skip:false});}else l.delete(a),n.set(f,{rowSpan:1,skip:false});}}return n}function oe(e,n,o){let l=Ae(e),t=e.columnWidths,r=t?.reduce((P,x)=>P+x,0)??0,i=e.formatting?.styleId,s=e.formatting?.look,u=i?n?.getStyle(i):void 0,m=n?.getDefaultTableStyle(),c=e.formatting?.borders??u?.tblPr?.borders??m?.tblPr?.borders,f=e.formatting?.cellMargins??u?.tblPr?.cellMargins??m?.tblPr?.cellMargins??void 0,a=f?{top:f.top?.value,bottom:f.bottom?.value,left:f.left?.value,right:f.right?.value}:void 0,p={styleId:e.formatting?.styleId,width:e.formatting?.width?.value,widthType:e.formatting?.width?.type,justification:e.formatting?.justification,columnWidths:t,tableLayout:e.formatting?.layout??null,floating:e.formatting?.floating,cellMargins:a,look:e.formatting?.look,_originalFormatting:e.formatting||void 0};e.propertyChanges&&e.propertyChanges.length>0&&(p.tblPrChange=e.propertyChanges);let S={wholeTable:R(n,i,"wholeTable"),firstRow:R(n,i,"firstRow"),lastRow:R(n,i,"lastRow"),firstCol:R(n,i,"firstCol"),lastCol:R(n,i,"lastCol"),band1Horz:R(n,i,"band1Horz"),band2Horz:R(n,i,"band2Horz"),band1Vert:R(n,i,"band1Vert"),band2Vert:R(n,i,"band2Vert"),nwCell:R(n,i,"nwCell"),neCell:R(n,i,"neCell"),swCell:R(n,i,"swCell"),seCell:R(n,i,"seCell")},k=s?.noHBand!==true,v=s?.noVBand!==true,D=0,N=e.rows.length,B=t?.length??Math.max(0,...e.rows.map(P=>P.cells.reduce((x,F)=>x+(F.formatting?.gridSpan??1),0))),g=e.rows.map((P,x)=>{let F=x===0&&!!s?.firstRow,M=x===N-1&&!!s?.lastRow,h=k&&!F&&!M?D%2===0?S.band1Horz:S.band2Horz:void 0;return k&&!F&&!M&&D++,He(P,n,F,t,r,S,h,v,s,c,x,N,B,l,a,o)});return b$1.node("table",p,g)}function He(e,n,o,l,t,r,i,s,u,m,c,f,a,p,S,k){let v={height:e.formatting?.height?.value,heightRule:e.formatting?.heightRule,isHeader:!!e.formatting?.header,_originalFormatting:e.formatting||void 0};if(e.structuralChange){let C=e.structuralChange,z={revisionId:C.info.id,author:C.info.author,date:C.info.date??null};C.type==="tableRowInsertion"?v.trIns=z:C.type==="tableRowDeletion"&&(v.trDel=z);}e.propertyChanges&&e.propertyChanges.length>0&&(v.trPrChange=e.propertyChanges);let D=e.cells.length,N=c===0,B=c===(f??1)-1,g=e.formatting?.conditionalFormat,P=g?.firstRow??N,x=g?.lastRow??B,F=a??D,M=0,h=[];for(let C=0;C<e.cells.length;C++){let z=e.cells[C],H=z.formatting?.gridSpan??1,Fe=`${c??0}-${M}`,ie=p?.get(Fe),Se=ie?.skip??false,Re=ie?.rowSpan??1,le;if(l&&t&&t>0){let K=0;for(let A=0;A<H&&M+A<l.length;A++)K+=l[M+A];le=Math.round(K/t*100);}if(M+=H,Se)continue;let se=M-H===0,ae=M===F,T=z.formatting?.conditionalFormat,G=T?.firstRow??P,Q=T?.lastRow??x,W=T?.firstColumn??se,_=T?.lastColumn??ae,q;if(s){let K=u?.firstColumn?1:0,A=M-H-K;A>=0&&!(u?.lastColumn&&_)&&!(u?.firstColumn&&W)&&(q=A%2===0?r?.band1Vert:r?.band2Vert);}T?.oddVBand?q=r?.band1Vert:T?.evenVBand&&(q=r?.band2Vert);let L=i;g?.oddHBand?L=r?.band1Horz:g?.evenHBand&&(L=r?.band2Horz),T?.oddHBand?L=r?.band1Horz:T?.evenHBand&&(L=r?.band2Horz);let b=r?.wholeTable;b=I(b,L),b=I(b,q),G&&(u?.firstRow||g?.firstRow||T?.firstRow)&&(b=I(b,r?.firstRow)),Q&&(u?.lastRow||g?.lastRow||T?.lastRow)&&(b=I(b,r?.lastRow)),W&&(u?.firstColumn||g?.firstColumn||T?.firstColumn)&&(b=I(b,r?.firstCol)),_&&(u?.lastColumn||g?.lastColumn||T?.lastColumn)&&(b=I(b,r?.lastCol)),G&&W&&(u?.firstRow||g?.firstRow||T?.firstRow)&&(u?.firstColumn||g?.firstColumn||T?.firstColumn)&&(b=I(b,r?.nwCell)),G&&_&&(u?.firstRow||g?.firstRow||T?.firstRow)&&(u?.lastColumn||g?.lastColumn||T?.lastColumn)&&(b=I(b,r?.neCell)),Q&&W&&(u?.lastRow||g?.lastRow||T?.lastRow)&&(u?.firstColumn||g?.firstColumn||T?.firstColumn)&&(b=I(b,r?.swCell)),Q&&_&&(u?.lastRow||g?.lastRow||T?.lastRow)&&(u?.lastColumn||g?.lastColumn||T?.lastColumn)&&(b=I(b,r?.seCell)),h.push(ke(z,n,o,le,b,m,N,B,se,ae,Re,S,k));}if(h.length===0){let C=Math.max(F,1),z={formatting:C>1?{gridSpan:C}:void 0,content:[{type:"paragraph",content:[]}]},H=I(r?.wholeTable,i);h.push(ke(z,n,o,t&&t>0?100:void 0,H,m,N,B,true,true,1,S,k));}return b$1.node("tableRow",v,h)}var Ee=["top","bottom","left","right","insideH","insideV"];function Le(e,n){if(!e)return e;let o;for(let l of Ee){let t=e[l];if(!t?.color?.themeColor||t.color.auto)continue;let r=b$4(t.color,n);r&&(o??(o={...e}),o[l]={...t,color:{rgb:r}});}return o??e}function ke(e,n,o,l,t,r,i,s,u,m,c,f,a){let p=e.formatting,S=c??1,k=p?.width?.value,v=p?.width?.type;k===void 0&&l!==void 0&&(k=l,v="pct");let D=b$4(p?.shading?.fill??t?.tcPr?.shading?.fill,a),N=r?{top:i?r.top:r.insideH,bottom:s?r.bottom:r.insideH,left:u?r.left:r.insideV,right:m?r.right:r.insideV}:void 0,B=t?.tcPr?.borders,g=p?.borders,P=Le(N||B||g?{...N??{},...B??{},...g??{}}:void 0,a),x={colspan:p?.gridSpan??1,rowspan:S,width:k,widthType:v,verticalAlign:p?.verticalAlign,backgroundColor:D,textDirection:p?.textDirection,noWrap:p?.noWrap,borders:P,margins:p?.margins?{top:p.margins.top?.value,bottom:p.margins.bottom?.value,left:p.margins.left?.value,right:p.margins.right?.value}:t?.tcPr?.margins?{top:t.tcPr.margins.top?.value,bottom:t.tcPr.margins.bottom?.value,left:t.tcPr.margins.left?.value,right:t.tcPr.margins.right?.value}:f,_originalFormatting:p||void 0,_originalResolvedFill:D};if(e.structuralChange){let h=e.structuralChange,C={revisionId:h.info.id,author:h.info.author,date:h.info.date??null};h.type==="tableCellInsertion"?x.cellMarker={kind:"ins",info:C}:h.type==="tableCellDeletion"?x.cellMarker={kind:"del",info:C}:h.type==="tableCellMerge"&&(x.cellMarker={kind:"merge",info:C,vMerge:h.vMerge??"cont",...h.vMergeOrig?{vMergeOrig:h.vMergeOrig}:{}});}e.propertyChanges&&e.propertyChanges.length>0&&(x.tcPrChange=e.propertyChanges);let F=[];for(let h of e.content)h.type==="paragraph"?F.push($(h,n,void 0,t?.rPr)):h.type==="table"&&F.push(oe(h,n));F.length===0&&F.push(b$1.node("paragraph",{},[]));let M=o?"tableHeader":"tableCell";return b$1.node(M,x,F)}function we(e,n){let o=Ve(e),l=$(e,n),t=[],r=o.length>0&&l.content.size===0,{anchored:i,inFlow:s}=Oe(o);for(let u of i)t.push(xe(u,n));r||t.push(l);for(let u of s)t.push(xe(u,n));return t}function Oe(e){let n=[],o=[];for(let l of e)f(l)?n.push(l):o.push(l);return {anchored:n,inFlow:o}}function Ve(e){let n=[];for(let o of e.content)if(o.type==="run"){for(let l of o.content)if(l.type==="shape"&&"shape"in l){let t=l.shape;t.textBody&&t.textBody.content.length>0&&n.push({type:"textBox",id:t.id,size:t.size,position:t.position,wrap:t.wrap,fill:t.fill,outline:t.outline,content:t.textBody.content,margins:t.textBody.margins});}}return n}function xe(e,n){let o=e.size?.width?f$1(e.size.width):200,l=e.size?.height?f$1(e.size.height):void 0,t;e.fill?.color?.rgb&&(t=`#${e.fill.color.rgb}`);let r,i,s;e.outline&&e.outline.width&&(r=Math.round(e.outline.width/914400*96*100)/100,e.outline.color?.rgb&&(i=`#${e.outline.color.rgb}`),s=e.outline.style||"solid");let u=e.margins?.top!=null?f$1(e.margins.top):4,m=e.margins?.bottom!=null?f$1(e.margins.bottom):4,c=e.margins?.left!=null?f$1(e.margins.left):7,f=e.margins?.right!=null?f$1(e.margins.right):7,a=[];for(let p of e.content)a.push($(p,n));return a.length===0&&a.push(b$1.node("paragraph",{},[])),b$1.node("textBox",{width:o,height:l,textBoxId:e.id,fillColor:t,outlineWidth:r,outlineColor:i,outlineStyle:s,marginTop:u,marginBottom:m,marginLeft:c,marginRight:f,...g(e)},a)}function re(e,n,o,l){let t=[];for(let r of e)if(r.type==="paragraph")t.push(...we(r,n)),l&&Ce(r)&&t.push(b$1.node("pageBreak"));else if(r.type==="table")t.push(oe(r,n,o));else if(r.type==="blockSdt"){let i=re(r.content,n,o,l),s=i.length>0?i:[b$1.node("paragraph",{},[])];t.push(b$1.node("blockSdt",d(r.properties),s));}return t}function wt(e,n){let o=e.package.theme??null,l=n?.styles?b(n.styles):null,t=re(e.package.document.content,l,o,true);return t.length===0&&t.push(b$1.node("paragraph",{},[])),t[t.length-1]?.type.name==="blockSdt"&&t.push(b$1.node("paragraph",{},[])),b$1.node("doc",{defaultTabStopTwips:e.package.settings?.defaultTabStop??null,watermark:a(e)??null},t)}function $e(e,n){let o=n?.styles?b(n.styles):null,l=n?.theme??null,t=re(e,o,l,false);return t.length===0&&t.push(b$1.node("paragraph",{},[])),b$1.node("doc",{defaultTabStopTwips:n?.defaultTabStopTwips??null},t)}function Ft(e,n){return $e(e,n)}function St(){return b$1.node("doc",null,[b$1.node("paragraph",{},[])])}export{wt as a,$e as b,Ft as c,St as d};
@@ -1 +1 @@
1
- import {a}from'./chunk-NO6PIL32.mjs';var e=a.getCommands();function g(t){return e.setAlignment(t)}var l=e.alignLeft(),u=e.alignCenter(),x=e.alignRight(),C=e.alignJustify();function f(t,n="auto"){return e.setLineSpacing(t,n)}var S=e.singleSpacing(),L=e.oneAndHalfSpacing(),b=e.doubleSpacing();function y(t=720){return e.increaseIndent(t)}function v(t=720){return e.decreaseIndent(t)}function A(t){return e.setIndentLeft(t)}function I(t){return e.setIndentRight(t)}function h(t,n){return e.setIndentFirstLine(t,n)}var R=e.toggleBulletList(),T=e.toggleNumberedList(),P=e.increaseListLevel(),B=e.decreaseListLevel(),k=e.removeList();function E(t){return e.setSpaceBefore(t)}function F(t){return e.setSpaceAfter(t)}function H(t,n){return e.applyStyle(t,n)}var J=e.clearStyle();function N(t){return e.insertSectionBreak(t)}var O=e.removeSectionBreak();function M(t,n="left",r="none"){return e.addTabStop(t,n,r)}function j(t){return e.removeTabStop(t)}var q=e.setRtl(),w=e.setLtr(),z=e.generateTOC();export{j as A,q as B,w as C,z as D,g as a,l as b,u as c,x as d,C as e,f,S as g,L as h,b as i,y as j,v as k,A as l,I as m,h as n,R as o,T as p,P as q,B as r,k as s,E as t,F as u,H as v,J as w,N as x,O as y,M as z};
1
+ import {a}from'./chunk-SHZOAUHB.mjs';var e=a.getCommands();function g(t){return e.setAlignment(t)}var l=e.alignLeft(),u=e.alignCenter(),x=e.alignRight(),C=e.alignJustify();function f(t,n="auto"){return e.setLineSpacing(t,n)}var S=e.singleSpacing(),L=e.oneAndHalfSpacing(),b=e.doubleSpacing();function y(t=720){return e.increaseIndent(t)}function v(t=720){return e.decreaseIndent(t)}function A(t){return e.setIndentLeft(t)}function I(t){return e.setIndentRight(t)}function h(t,n){return e.setIndentFirstLine(t,n)}var R=e.toggleBulletList(),T=e.toggleNumberedList(),P=e.increaseListLevel(),B=e.decreaseListLevel(),k=e.removeList();function E(t){return e.setSpaceBefore(t)}function F(t){return e.setSpaceAfter(t)}function H(t,n){return e.applyStyle(t,n)}var J=e.clearStyle();function N(t){return e.insertSectionBreak(t)}var O=e.removeSectionBreak();function M(t,n="left",r="none"){return e.addTabStop(t,n,r)}function j(t){return e.removeTabStop(t)}var q=e.setRtl(),w=e.setLtr(),z=e.generateTOC();export{j as A,q as B,w as C,z as D,g as a,l as b,u as c,x as d,C as e,f,S as g,L as h,b as i,y as j,v as k,A as l,I as m,h as n,R as o,T as p,P as q,B as r,k as s,E as t,F as u,H as v,J as w,N as x,O as y,M as z};
@@ -0,0 +1 @@
1
+ import {a as a$1}from'./chunk-QPFJJPIC.mjs';import {f as f$1,g as g$1}from'./chunk-KNY7SXPJ.mjs';function g(e){return {sdtType:e.sdtType,id:e.id??null,alias:e.alias??null,tag:e.tag??null,lock:e.lock??null,placeholder:e.placeholder??null,showingPlaceholder:e.showingPlaceholder??false,dateFormat:e.dateFormat??null,listItems:e.listItems?JSON.stringify(e.listItems):null,checked:e.checked??null,dataBinding:e.dataBinding?JSON.stringify(e.dataBinding):null,rawPropertiesXml:e.rawPropertiesXml??null,rawEndPropertiesXml:e.rawEndPropertiesXml??null}}function m(e){let t={sdtType:e.sdtType??"richText"};if(typeof e.id=="number"&&(t.id=e.id),e.alias!=null&&(t.alias=String(e.alias)),e.tag!=null&&(t.tag=String(e.tag)),e.lock!=null&&(t.lock=e.lock),e.placeholder!=null&&(t.placeholder=String(e.placeholder)),e.showingPlaceholder&&(t.showingPlaceholder=true),e.dateFormat!=null&&(t.dateFormat=String(e.dateFormat)),typeof e.listItems=="string"&&e.listItems)try{t.listItems=JSON.parse(e.listItems);}catch{}if(e.checked!=null&&(t.checked=e.checked),typeof e.dataBinding=="string"&&e.dataBinding)try{t.dataBinding=JSON.parse(e.dataBinding);}catch{}return e.rawPropertiesXml!=null&&(t.rawPropertiesXml=String(e.rawPropertiesXml)),e.rawEndPropertiesXml!=null&&(t.rawEndPropertiesXml=String(e.rawEndPropertiesXml)),t}function a(e){return !!e.wrap&&e.wrap.type!=="inline"}function x(e){let t=e.wrap?.type??"inline",i=e.wrap?.wrapText,n=e.position?.horizontal?.alignment;return {displayMode:s(t),cssFloat:p(t,i,n),wrapType:t,wrapText:i,anchorTarget:a(e)?"followingBlock":void 0,position:e.position?f(e.position):void 0,distTop:e.wrap?.distT!=null?f$1(e.wrap.distT):void 0,distBottom:e.wrap?.distB!=null?f$1(e.wrap.distB):void 0,distLeft:e.wrap?.distL!=null?f$1(e.wrap.distL):void 0,distRight:e.wrap?.distR!=null?f$1(e.wrap.distR):void 0}}function y(e){return e.anchorTarget==="followingBlock"||d(e)}function P(e){let t=e.position;if(!(!t?.horizontal&&!t?.vertical))return {horizontal:{relativeTo:t.horizontal?.relativeTo??"margin",alignment:t.horizontal?.align,posOffset:t.horizontal?.posOffset},vertical:{relativeTo:t.vertical?.relativeTo??"paragraph",alignment:t.vertical?.align,posOffset:t.vertical?.posOffset}}}function B(e){let t=e.wrapType??(e.displayMode==="float"?"square":"inline");if(!t||t==="inline")return;let i={type:t};return e.wrapText&&(i.wrapText=e.wrapText),e.distTop!=null&&(i.distT=g$1(e.distTop)),e.distBottom!=null&&(i.distB=g$1(e.distBottom)),e.distLeft!=null&&(i.distL=g$1(e.distLeft)),e.distRight!=null&&(i.distR=g$1(e.distRight)),i}function s(e){return e==="inline"?"inline":e==="topAndBottom"?"block":"float"}function d(e){return e.displayMode==="float"||a$1(e.wrapType)}function p(e,t,i){return e==="inline"||e==="topAndBottom"?"none":t==="left"?"right":t==="right"||i==="left"?"left":i==="right"?"right":"none"}function f(e){return {horizontal:e.horizontal?{relativeTo:e.horizontal.relativeTo,posOffset:e.horizontal.posOffset,align:e.horizontal.alignment}:void 0,vertical:e.vertical?{relativeTo:e.vertical.relativeTo,posOffset:e.vertical.posOffset,align:e.vertical.alignment}:void 0}}var c=new Set(["hyperlink"]),S=new Set(["hyperlink","comment"]);function I(e,t=c){let i=e.filter(n=>!t.has(n.type.name));return i.length===0?"":i.map(n=>`${n.type.name}:${JSON.stringify(n.attrs)}`).sort().join("|")}export{c as a,S as b,I as c,g as d,m as e,a as f,x as g,y as h,P as i,B as j};
@@ -0,0 +1 @@
1
+ import {h,e,i,j,c,b as b$1,a as a$1}from'./chunk-O5L4BZCZ.mjs';import {a,b}from'./chunk-GYWTUUXX.mjs';import {g}from'./chunk-KNY7SXPJ.mjs';function K(t){return t.attrs.href||""}function z(t){return c(t,a$1)}function T(t){let e={};for(let n of t)switch(n.type.name){case "bold":e.bold=true,e.boldCs=true;break;case "italic":e.italic=true,e.italicCs=true;break;case "underline":{let i=n.attrs;e.underline={style:i.style||"single",color:i.color};break}case "strike":n.attrs.double?e.doubleStrike=true:e.strike=true;break;case "textColor":{let i=n.attrs;e.color={rgb:i.rgb,themeColor:i.themeColor,themeTint:i.themeTint,themeShade:i.themeShade};break}case "highlight":e.highlight=n.attrs.color;break;case "fontSize":e.fontSize=n.attrs.size,e.fontSizeCs=n.attrs.size;break;case "fontFamily":{let i=n.attrs;e.fontFamily={ascii:i.ascii,hAnsi:i.hAnsi,eastAsia:i.eastAsia||void 0,cs:i.cs||i.ascii||void 0,asciiTheme:i.asciiTheme,hAnsiTheme:i.hAnsiTheme||void 0,eastAsiaTheme:i.eastAsiaTheme||void 0,csTheme:i.csTheme||void 0};break}case "superscript":e.vertAlign="superscript";break;case "subscript":e.vertAlign="subscript";break;case "allCaps":e.allCaps=true;break;case "smallCaps":e.smallCaps=true;break;case "characterSpacing":{n.attrs.spacing!=null&&(e.spacing=n.attrs.spacing),n.attrs.position!=null&&(e.position=n.attrs.position),n.attrs.scale!=null&&(e.scale=n.attrs.scale),n.attrs.kerning!=null&&(e.kerning=n.attrs.kerning);break}case "emboss":e.emboss=true;break;case "imprint":e.imprint=true;break;case "textShadow":e.shadow=true;break;case "emphasisMark":e.emphasisMark=n.attrs.type||"dot";break;case "textOutline":e.outline=true;break;case "hidden":e.hidden=true;break;case "rtl":e.rtl=true;break;case "textEffect":e.effect=n.attrs.effect||"blinkBackground";break;case "runStyle":n.attrs.styleId&&(e.styleId=n.attrs.styleId);break}return e}function V(t){let e=t.attrs.href;return e?.startsWith("#")?{type:"hyperlink",anchor:e.substring(1),tooltip:t.attrs.tooltip||void 0,children:[]}:{type:"hyperlink",href:e,tooltip:t.attrs.tooltip||void 0,rId:t.attrs.rId||void 0,children:[]}}function M(t,e){let n=e.marks.filter(i=>i.type.name!=="hyperlink");e.isText&&e.text?t.children.push(w(e.text,n)):e.type.name==="tab"?t.children.push(S()):e.type.name==="hardBreak"&&t.children.push(v());}function w(t,e){let n=T(e),i={type:"text",text:t};return {type:"run",formatting:Object.keys(n).length>0?n:void 0,content:[i]}}function U(t,e){let n=t.content[t.content.length-1];n&&n.type==="text"?n.text+=e:t.content.push({type:"text",text:e});}function v(){return {type:"run",content:[{type:"break",breakType:"textWrapping"}]}}function S(){return {type:"run",content:[{type:"tab"}]}}function $(t,e){let n=t.attrs,i=e&&e.length>0?T(e):void 0,r=n.displayText||"";if(!r)switch(n.fieldType){case "PAGE":r="1";break;case "NUMPAGES":r="1";break;default:r=" ";break}let o={type:"run",content:[{type:"text",text:r}],...i&&Object.keys(i).length>0?{formatting:i}:{}};return n.fieldKind==="complex"?{type:"complexField",instruction:n.instruction,fieldType:n.fieldType,fieldCode:[],fieldResult:[o],fldLock:n.fldLock||void 0,dirty:n.dirty||void 0}:{type:"simpleField",instruction:n.instruction,fieldType:n.fieldType,content:[o],fldLock:n.fldLock||void 0,dirty:n.dirty||void 0}}function J(t){let e=t.attrs;return {type:"mathEquation",display:e.display||"inline",ommlXml:e.ommlXml,plainText:e.plainText||void 0}}function I(t){let e=t.attrs,i={type:e.wrapType||"inline"};e.distTop!==void 0&&(i.distT=g(e.distTop)),e.distBottom!==void 0&&(i.distB=g(e.distBottom)),e.distLeft!==void 0&&(i.distL=g(e.distLeft)),e.distRight!==void 0&&(i.distR=g(e.distRight)),e.wrapText&&(i.wrapText=e.wrapText);let r={type:"image",rId:e.rId||"",src:e.src,alt:e.alt||void 0,title:e.title||void 0,size:{width:g(e.width||0),height:g(e.height||0)},wrap:i};if(e.transform){let a=e.transform,l={},d=a.match(/rotate\(([-\d.]+)deg\)/);d&&(l.rotation=parseFloat(d[1])),a.includes("scaleX(-1)")&&(l.flipH=true),a.includes("scaleY(-1)")&&(l.flipV=true),(l.rotation||l.flipH||l.flipV)&&(r.transform=l);}if(e.position?.horizontal&&e.position?.vertical){let a=e.position;r.position={horizontal:{relativeTo:a.horizontal.relativeTo||"column",alignment:a.horizontal.align,posOffset:a.horizontal.posOffset},vertical:{relativeTo:a.vertical.relativeTo||"paragraph",alignment:a.vertical.align,posOffset:a.vertical.posOffset}};}if(e.borderWidth&&e.borderWidth>0){let a={solid:"solid",dotted:"dot",dashed:"dash",double:"solid",groove:"solid",ridge:"solid",inset:"solid",outset:"solid"};r.outline={width:g(e.borderWidth),color:e.borderColor?{rgb:e.borderColor.replace("#","")}:void 0,style:e.borderStyle&&a[e.borderStyle]||"solid"};}if(e.hlinkHref&&(r.hlinkHref=e.hlinkHref),e.cropTop!==void 0||e.cropRight!==void 0||e.cropBottom!==void 0||e.cropLeft!==void 0){let a={};e.cropTop!==void 0&&e.cropTop!==null&&(a.top=e.cropTop),e.cropRight!==void 0&&e.cropRight!==null&&(a.right=e.cropRight),e.cropBottom!==void 0&&e.cropBottom!==null&&(a.bottom=e.cropBottom),e.cropLeft!==void 0&&e.cropLeft!==null&&(a.left=e.cropLeft),Object.keys(a).length>0&&(r.crop=a);}if(e.opacity!==void 0&&e.opacity!==null&&e.opacity<1&&(r.opacity=e.opacity),e.layoutInCell!==void 0&&e.layoutInCell!==null&&(r.layoutInCell=e.layoutInCell),e.allowOverlap!==void 0&&e.allowOverlap!==null&&(r.allowOverlap=e.allowOverlap),e.effectExtentTop||e.effectExtentBottom||e.effectExtentLeft||e.effectExtentRight){let a={};e.effectExtentTop&&(a.top=g(e.effectExtentTop)),e.effectExtentBottom&&(a.bottom=g(e.effectExtentBottom)),e.effectExtentLeft&&(a.left=g(e.effectExtentLeft)),e.effectExtentRight&&(a.right=g(e.effectExtentRight)),Object.keys(a).length>0&&(r.padding=a);}return {type:"run",content:[{type:"drawing",image:r}]}}function B(t){let e=t.attrs,n={type:"shape",shapeType:e.shapeType||"rect",id:e.shapeId||void 0,size:{width:e.width?g(e.width):0,height:e.height?g(e.height):0}};if(e.fillType==="gradient"&&e.gradientStops)try{let r=JSON.parse(e.gradientStops);n.fill={type:"gradient",gradient:{type:e.gradientType||"linear",angle:e.gradientAngle||void 0,stops:r.map(o=>({position:o.position,color:{rgb:o.color.replace("#","")}}))}};}catch{n.fill={type:"solid",color:{rgb:(e.fillColor||"000000").replace("#","")}};}else e.fillColor?n.fill={type:e.fillType||"solid",color:{rgb:e.fillColor.replace("#","")}}:e.fillType==="none"&&(n.fill={type:"none"});if(e.outlineWidth&&e.outlineWidth>0){let r={solid:"solid",dotted:"dot",dashed:"dash"};n.outline={width:g(e.outlineWidth),color:e.outlineColor?{rgb:e.outlineColor.replace("#","")}:void 0,style:e.outlineStyle&&r[e.outlineStyle]||"solid"};}return {type:"run",content:[{type:"shape",shape:n}]}}function x(t){let e=t.attrs,n=Q(G(t),t);n=re(n,t);let i=e.bookmarks;if(i&&i.length>0){let o=i.map(l=>({type:"bookmarkStart",id:l.id,name:l.name})),a=i.map(l=>({type:"bookmarkEnd",id:l.id}));n=[...o,...n,...a];}let r={type:"paragraph",paraId:e.paraId||void 0,textId:e.textId||void 0,formatting:se(e),content:n};return e.renderedPageBreakBefore&&(r.renderedPageBreakBefore=true),e.pPrIns&&(r.pPrIns={id:e.pPrIns.revisionId,author:e.pPrIns.author,...e.pPrIns.date?{date:e.pPrIns.date}:{}}),e.pPrDel&&(r.pPrDel={id:e.pPrDel.revisionId,author:e.pPrDel.author,...e.pPrDel.date?{date:e.pPrDel.date}:{}}),e.pPrChange&&e.pPrChange.length>0&&(r.propertyChanges=e.pPrChange),e._sectionProperties?r.sectionProperties=e._sectionProperties:e.sectionBreakType&&(r.sectionProperties={sectionStart:e.sectionBreakType}),r}function Q(t,e){let n=e.attrs._originalRunBoundaries;if(!n||n.length===0||!t.every(a=>a.type==="run"))return t;let i=t;if(!i.every(Z))return t;let r=i.map(F).join(""),o=n.map(a=>a.text).join("");return r!==o||!ee(e,n)?t:te(i,n)??t}function Z(t){return t.content.every(e=>e.type==="text")}function F(t){return t.content.map(e=>e.type==="text"?e.text:"").join("")}function ee(t,e){let n=0,i=0,r=true;if(t.forEach(o=>{if(!r)return;if(!o.isText){r=false;return}let a=c(o.marks,b$1),l=o.text??"",d=0;for(;d<l.length;){for(;n<e.length&&e[n].text.length===0;)n++;let s=e[n];if(!s||a!==(s.marksKey??"")){r=false;return}let u=s.text.length-i,c=l.length-d,p=Math.min(u,c),m=l.slice(d,d+p),g=s.text.slice(i,i+p);if(m!==g){r=false;return}d+=p,i+=p,i===s.text.length&&(n++,i=0);}}),!r)return false;for(;n<e.length&&e[n].text.length===0;)n++;return n===e.length&&i===0}function te(t,e){let n=[],i={runIndex:0,runOffset:0};for(let r of e){if(r.text.length===0){n.push(ne(r));continue}let o=ie(t,i,r.text.length);if(!o)return null;r.propertyChanges&&r.propertyChanges.length>0&&(o.propertyChanges=r.propertyChanges),n.push(o);}for(;i.runIndex<t.length;){if(F(t[i.runIndex]).length-i.runOffset>0)return null;i.runIndex++,i.runOffset=0;}return n}function ne(t){let e={type:"run",content:[]};return t.formatting&&Object.keys(t.formatting).length>0&&(e.formatting=t.formatting),t.propertyChanges&&t.propertyChanges.length>0&&(e.propertyChanges=t.propertyChanges),e}function ie(t,e,n){let i=n,r="",o,a;for(;i>0;){let d=t[e.runIndex];if(!d)return null;let s=F(d),u=s.length-e.runOffset;if(u<=0){e.runIndex++,e.runOffset=0;continue}let c=JSON.stringify(d.formatting??null);if(a==null)o=d.formatting,a=c;else if(a!==c)return null;let p=Math.min(i,u);r+=s.slice(e.runOffset,e.runOffset+p),e.runOffset+=p,i-=p,e.runOffset===s.length&&(e.runIndex++,e.runOffset=0);}let l={type:"run",content:[{type:"text",text:r}]};return o&&Object.keys(o).length>0&&(l.formatting=o),l}function re(t,e){let n=new Set;if(e.forEach(a=>{for(let l of a.marks)l.type.name==="comment"&&n.add(l.attrs.commentId);}),n.size===0)return t;let i=[],r=new Set,o={index:0};for(e.forEach(a=>{let l=new Set;for(let d of a.marks)d.type.name==="comment"&&l.add(d.attrs.commentId);for(let d of [...r])l.has(d)||(i.push({type:"commentRangeEnd",id:d}),r.delete(d));for(let d of l)r.has(d)||(i.push({type:"commentRangeStart",id:d}),r.add(d));oe(i,t,o,a);});o.index<t.length;)i.push(t[o.index]),o.index++;for(let a of r)i.push({type:"commentRangeEnd",id:a});return i}function oe(t,e,n,i){if(!i.isText){ae(t,e,n);return}let r=(i.text??"").length;for(;r>0&&n.index<e.length;){let o=e[n.index];t.push(o),n.index++,r-=q(o);}}function ae(t,e,n){n.index>=e.length||(t.push(e[n.index]),n.index++);}function q(t){switch(t.type){case "run":return le(t);case "hyperlink":return k(t.children);case "simpleField":return k(t.content);case "complexField":return k(t.fieldResult);case "inlineSdt":return k(t.content);case "insertion":case "deletion":case "moveFrom":case "moveTo":return k(t.content);case "mathEquation":return t.plainText?.length??0;default:return 0}}function k(t){return t.reduce((e,n)=>e+q(n),0)}function le(t){return t.content.reduce((e,n)=>{switch(n.type){case "text":case "instrText":return e+n.text.length;case "symbol":return e+n.char.length;case "tab":case "softHyphen":case "noBreakHyphen":return e+1;default:return e}},0)}function X(t){return t.numPrFromStyle!=null&&t.numPr!=null&&JSON.stringify(t.numPr)===JSON.stringify(t.numPrFromStyle)}function se(t){if(t._originalFormatting){let n=t._originalFormatting,i={...n};return t.alignment!==(n.alignment||void 0)&&(i.alignment=t.alignment||void 0),X(t)?(delete i.numPr,delete i.numPrFromStyle):t.numPr!==n.numPr&&JSON.stringify(t.numPr)!==JSON.stringify(n.numPr)&&(i.numPr=t.numPr||void 0,delete i.numPrFromStyle),t.styleId!==(n.styleId||void 0)&&(i.styleId=t.styleId||void 0),t.pageBreakBefore!==(n.pageBreakBefore||void 0)&&(i.pageBreakBefore=t.pageBreakBefore||void 0),t.bidi!==(n.bidi||void 0)&&(i.bidi=t.bidi||void 0),i}if(t.alignment||t.spaceBefore||t.spaceAfter||t.lineSpacing||t.indentLeft||t.indentRight||t.indentFirstLine||t.numPr||t.styleId||t.borders||t.shading||t.tabs||t.outlineLevel!=null||t.contextualSpacing||t.pageBreakBefore||t.bidi)return {alignment:t.alignment||void 0,spaceBefore:t.spaceBefore||void 0,spaceAfter:t.spaceAfter||void 0,lineSpacing:t.lineSpacing||void 0,lineSpacingRule:t.lineSpacingRule||void 0,indentLeft:t.indentLeft||void 0,indentRight:t.indentRight||void 0,indentFirstLine:t.indentFirstLine||void 0,hangingIndent:t.hangingIndent||void 0,numPr:X(t)?void 0:t.numPr||void 0,styleId:t.styleId||void 0,borders:t.borders||void 0,shading:t.shading||void 0,tabs:t.tabs||void 0,outlineLevel:t.outlineLevel??void 0,contextualSpacing:t.contextualSpacing||void 0,pageBreakBefore:t.pageBreakBefore||void 0,bidi:t.bidi||void 0}}function G(t){let e=[],n=null,i=null,r=null;return t.forEach(o=>{let a=o.marks.find(u=>u.type.name==="footnoteRef");if(a){n&&(e.push(n),n=null,i=null),r&&(e.push(r),r=null);let c={type:a.attrs.noteType==="endnote"?"endnoteRef":"footnoteRef",id:parseInt(a.attrs.id,10)||0};e.push({type:"run",content:[c]});return}let l=o.marks.find(u=>u.type.name==="insertion"),d=o.marks.find(u=>u.type.name==="deletion");if(l||d){n&&(e.push(n),n=null,i=null),r&&(e.push(r),r=null);let u=l||d,c;if(o.type.name==="image")c=I(o);else if(o.type.name==="shape")c=B(o);else {let g=o.marks.filter(y=>y.type.name!=="insertion"&&y.type.name!=="deletion"),h=T(g);c={type:"run",content:o.isText&&o.text?[{type:"text",text:o.text}]:[],...Object.keys(h).length>0?{formatting:h}:{}};}let p={id:u.attrs.revisionId,author:u.attrs.author||"Unknown",date:u.attrs.date||void 0},m=u.attrs.isMovePair===true;l?m?e.push({type:"moveTo",info:p,content:[c]}):e.push({type:"insertion",info:p,content:[c]}):m?e.push({type:"moveFrom",info:p,content:[c]}):e.push({type:"deletion",info:p,content:[c]});return}let s=o.marks.find(u=>u.type.name==="hyperlink");if(s){let u=K(s),c=r?.href||(r?.anchor?`#${r.anchor}`:"");r&&c===u?M(r,o):(n&&(e.push(n),n=null,i=null),r&&e.push(r),r=V(s),M(r,o));return}if(r&&(e.push(r),r=null),o.isText){let u=z(o.marks);n&&i===u?U(n,o.text||""):(n&&e.push(n),n=w(o.text||"",o.marks),i=u);}else o.type.name==="hardBreak"?(n&&(e.push(n),n=null,i=null),e.push(v())):o.type.name==="image"?(n&&(e.push(n),n=null,i=null),e.push(I(o))):o.type.name==="shape"?(n&&(e.push(n),n=null,i=null),e.push(B(o))):o.type.name==="tab"?(n&&(e.push(n),n=null,i=null),e.push(S())):o.type.name==="field"?(n&&(e.push(n),n=null,i=null),e.push($(o,o.marks))):o.type.name==="sdt"?(n&&(e.push(n),n=null,i=null),e.push(de(o))):o.type.name==="math"&&(n&&(e.push(n),n=null,i=null),e.push(J(o)));}),n&&e.push(n),r&&e.push(r),e}function de(t){let e$1=e(t.attrs),i=G(t).filter(r=>r.type==="run"||r.type==="hyperlink"||r.type==="simpleField"||r.type==="complexField"||r.type==="inlineSdt"||r.type==="mathEquation");return {type:"inlineSdt",properties:e$1,content:i}}function ue(t){for(let e of t)for(let n of e.cells){let i=n.formatting?.borders;if(i){let r=i.top||i.left||i.right||i.bottom||i.insideH||i.insideV;return r?{top:i.top??r,bottom:i.bottom??r,left:i.left??r,right:i.right??r,insideH:i.insideH??i.bottom??r,insideV:i.insideV??i.right??r}:void 0}}}function pe(t){let e=[],n=[],i=0;for(let r=0;r<t.childCount;r++){let o=t.child(r),a=0;o.forEach(l=>{if(l.type.name!=="tableCell"&&l.type.name!=="tableHeader")return;for(;e[r]?.[a];)a++;let d=l.attrs.rowspan||1,s=l.attrs.colspan||1;n.push({row:r,col:a,rowspan:d,colspan:s,cell:he(l)});for(let u=r;u<r+d;u++){let c=e[u]??[];e[u]=c;for(let p=a;p<a+s;p++)c[p]=true;}a+=s,i=Math.max(i,a);});}return {anchors:n,totalCols:i}}function ce(t){let e=new Map;t.forEach((i,r)=>{let o=0;for(let a of i.cells){let l=o;if(o+=a.formatting?.gridSpan??1,a.formatting?.vMerge){let d=e.get(l)??[];d.push({rowIndex:r,cell:a}),e.set(l,d);}}});let n=i=>{i.formatting&&(delete i.formatting.vMerge,Object.keys(i.formatting).length===0&&(i.formatting=void 0));};for(let i of e.values()){let r=null,o=0,a=-1,l=()=>{r&&o<2&&n(r),r=null,o=0;};for(let{rowIndex:d,cell:s}of i){let u=s.formatting?.vMerge;u==="restart"?(l(),r=s,o=1,a=d):u==="continue"&&(r&&d===a+1?(o++,a=d):(l(),n(s)));}l();}}function A(t){let e=t.attrs,{anchors:n,totalCols:i}=pe(t),r=new Map,o=new Map;for(let s of n){r.set(`${s.row}-${s.col}`,s);for(let u=s.row;u<s.row+s.rowspan;u++)for(let c=s.col;c<s.col+s.colspan;c++)o.set(`${u}-${c}`,s);}let a=[];for(let s=0;s<t.childCount;s++){let u=t.child(s),c=[];for(let g=0;g<i;){let h=r.get(`${s}-${g}`);if(h){let b={...h.cell.formatting??{}};h.colspan>1?b.gridSpan=h.colspan:delete b.gridSpan,h.rowspan>1?b.vMerge="restart":b.vMerge!=="restart"&&b.vMerge!=="continue"&&delete b.vMerge,c.push({...h.cell,formatting:Object.keys(b).length?b:void 0}),g+=h.colspan;continue}let y=o.get(`${s}-${g}`);if(!y){g++;continue}let C={...y.cell.formatting??{}};y.colspan>1?C.gridSpan=y.colspan:delete C.gridSpan,C.vMerge="continue",c.push({...y.cell,content:[],formatting:C}),g+=y.colspan;}let p=u.attrs,m={type:"tableRow",formatting:ge(p),cells:c};p.trIns?m.structuralChange={type:"tableRowInsertion",info:{id:p.trIns.revisionId,author:p.trIns.author,...p.trIns.date?{date:p.trIns.date}:{}}}:p.trDel&&(m.structuralChange={type:"tableRowDeletion",info:{id:p.trDel.revisionId,author:p.trDel.author,...p.trDel.date?{date:p.trDel.date}:{}}}),p.trPrChange&&p.trPrChange.length>0&&(m.propertyChanges=p.trPrChange),a.push(m);}ce(a);let l=fe(e)||void 0;if(!l?.borders){let s=ue(a);if(s)if(l)l.borders=s;else return {type:"table",columnWidths:e.columnWidths||void 0,formatting:{borders:s},rows:a}}let d={type:"table",columnWidths:e.columnWidths||void 0,formatting:l,rows:a};return e.tblPrChange&&e.tblPrChange.length>0&&(d.propertyChanges=e.tblPrChange),d}function fe(t){if(t._originalFormatting){let r=t._originalFormatting,o={...r};t.styleId!==(r.styleId||void 0)&&(o.styleId=t.styleId||void 0),t.justification!==(r.justification||void 0)&&(o.justification=t.justification||void 0),t.floating!==(r.floating||void 0)&&(o.floating=t.floating||void 0),t.tableLayout!==(r.layout||void 0)&&(o.layout=t.tableLayout||void 0),t.look!==(r.look||void 0)&&(o.look=t.look||void 0);let a=r.width?.value,l=r.width?.type;return (t.width!==a||t.widthType!==l)&&(t.width!=null||t.widthType?o.width={value:t.width??0,type:t.widthType||"dxa"}:o.width=void 0),t.cellMargins&&(o.cellMargins={top:t.cellMargins.top!=null?{value:t.cellMargins.top,type:"dxa"}:void 0,bottom:t.cellMargins.bottom!=null?{value:t.cellMargins.bottom,type:"dxa"}:void 0,left:t.cellMargins.left!=null?{value:t.cellMargins.left,type:"dxa"}:void 0,right:t.cellMargins.right!=null?{value:t.cellMargins.right,type:"dxa"}:void 0}),o}if(!(t.styleId||t.width!=null||t.widthType||t.justification||t.tableLayout||t.floating||t.cellMargins||t.look))return;let n=t.cellMargins?{top:t.cellMargins.top!=null?{value:t.cellMargins.top,type:"dxa"}:void 0,bottom:t.cellMargins.bottom!=null?{value:t.cellMargins.bottom,type:"dxa"}:void 0,left:t.cellMargins.left!=null?{value:t.cellMargins.left,type:"dxa"}:void 0,right:t.cellMargins.right!=null?{value:t.cellMargins.right,type:"dxa"}:void 0}:void 0,i;return (t.width!=null||t.widthType)&&(i={value:t.width??0,type:t.widthType||"dxa"}),{styleId:t.styleId||void 0,width:i,justification:t.justification||void 0,layout:t.tableLayout||void 0,floating:t.floating||void 0,cellMargins:n,look:t.look||void 0}}function ge(t){if(t._originalFormatting){let n=t._originalFormatting,i={...n};return t.height!==(n.height?.value||void 0)&&(i.height=t.height?{value:t.height,type:"dxa"}:void 0),t.heightRule!==(n.heightRule||void 0)&&(i.heightRule=t.heightRule||void 0),t.isHeader!==(n.header||void 0)&&(i.header=t.isHeader||void 0),i}if(t.height||t.isHeader)return {height:t.height?{value:t.height,type:"dxa"}:void 0,heightRule:t.heightRule||void 0,header:t.isHeader||void 0}}function he(t){let e=t.attrs,n=[];t.forEach(r=>{r.type.name==="paragraph"?n.push(x(r)):r.type.name==="table"&&n.push(A(r));});let i={type:"tableCell",formatting:me(e),content:n};if(e.cellMarker){let r=e.cellMarker,o={id:r.info.revisionId,author:r.info.author,...r.info.date?{date:r.info.date}:{}};r.kind==="ins"?i.structuralChange={type:"tableCellInsertion",info:o}:r.kind==="del"?i.structuralChange={type:"tableCellDeletion",info:o}:i.structuralChange={type:"tableCellMerge",info:o,...r.vMerge?{vMerge:r.vMerge}:{},...r.vMergeOrig?{vMergeOrig:r.vMergeOrig}:{}};}return e.tcPrChange&&e.tcPrChange.length>0&&(i.propertyChanges=e.tcPrChange),i}function me(t){if(t._originalFormatting){let i=t._originalFormatting,r={...i};if(t.colspan>1&&(r.gridSpan=t.colspan),t.width!=null&&(r.width={value:t.width,type:t.widthType||"dxa"}),t.verticalAlign!==(i.verticalAlign||void 0)&&(r.verticalAlign=t.verticalAlign||void 0),t.backgroundColor?t._originalResolvedFill===t.backgroundColor&&i.shading?r.shading=i.shading:r.shading={fill:{rgb:t.backgroundColor}}:i.shading&&(r.shading=void 0),t.borders&&(r.borders=t.borders),t.margins){let o=t.margins,a={};o.top!=null&&(a.top={value:o.top,type:"dxa"}),o.bottom!=null&&(a.bottom={value:o.bottom,type:"dxa"}),o.left!=null&&(a.left={value:o.left,type:"dxa"}),o.right!=null&&(a.right={value:o.right,type:"dxa"}),r.margins=a;}return t.textDirection!==(i.textDirection||void 0)&&(r.textDirection=t.textDirection||void 0),r}if(!(t.colspan>1||t.rowspan>1||t.width!=null||t.verticalAlign||t.backgroundColor||t.borders||t.margins||t.textDirection))return;let n;if(t.margins){let i=t.margins;n={},i.top!=null&&(n.top={value:i.top,type:"dxa"}),i.bottom!=null&&(n.bottom={value:i.bottom,type:"dxa"}),i.left!=null&&(n.left={value:i.left,type:"dxa"}),i.right!=null&&(n.right={value:i.right,type:"dxa"});}return {gridSpan:t.colspan>1?t.colspan:void 0,width:t.width!=null?{value:t.width,type:t.widthType||"dxa"}:void 0,verticalAlign:t.verticalAlign||void 0,textDirection:t.textDirection||void 0,shading:t.backgroundColor?{fill:{rgb:t.backgroundColor}}:void 0,borders:t.borders,margins:n}}function O(t){let e=t.attrs,n=[];t.forEach(l=>{l.type.name==="paragraph"&&n.push(x(l));});let i$1={type:"shape",shapeType:"rect",id:e.textBoxId||void 0,size:{width:e.width?g(e.width):0,height:e.height?g(e.height):0},textBody:{content:n.length>0?n:[{type:"paragraph",content:[]}],margins:{top:e.marginTop!=null?g(e.marginTop):void 0,bottom:e.marginBottom!=null?g(e.marginBottom):void 0,left:e.marginLeft!=null?g(e.marginLeft):void 0,right:e.marginRight!=null?g(e.marginRight):void 0}}},r=i(e);r&&(i$1.position=r);let o=j(e);if(o&&(i$1.wrap=o),e.fillColor&&(i$1.fill={type:"solid",color:{rgb:e.fillColor.replace("#","")}}),e.outlineWidth&&e.outlineWidth>0){let l={solid:"solid",dotted:"dot",dashed:"dash"};i$1.outline={width:g(e.outlineWidth),color:e.outlineColor?{rgb:e.outlineColor.replace("#","")}:void 0,style:e.outlineStyle&&l[e.outlineStyle]||"solid"};}return {type:"run",content:[{type:"shape",shape:i$1}]}}function Y(t){return {type:"paragraph",content:[O(t)]}}function ye(t,e){let i={content:N(t),finalSectionProperties:e?.package.document.finalSectionProperties,sections:e?.package.document.sections,comments:e?.package.document.comments},r=e?{...e,package:{...e.package,document:i}}:{package:{document:i}},o=t.attrs.watermark??null,a$1=a(r)??null;return o!==a$1?b(r,o):r}function N(t){let e=[],n=[],i=()=>{for(let r of n)e.push({type:"paragraph",content:[r]});n=[];};return t.forEach(r=>{if(r.type.name==="paragraph"){let o=x(r);n.length>0&&(o.content=[...n,...o.content],n=[]),e.push(o);}else if(r.type.name==="table")i(),e.push(A(r));else if(r.type.name==="blockSdt")i(),e.push(be(r));else if(r.type.name==="textBox"){let o=r.attrs;h(o)?n.push(O(r)):(i(),e.push(Y(r)));}else r.type.name==="pageBreak"&&(i(),e.push(xe()));}),i(),e}function be(t){return {type:"blockSdt",properties:e(t.attrs),content:N(t)}}function xe(){return {type:"paragraph",content:[{type:"run",content:[{type:"break",breakType:"page"}]}]}}function Ke(t,e){return ye(e,t)}function ze(t){return N(t)}export{ye as a,Ke as b,ze as c};
@@ -1,4 +1,4 @@
1
- import {c}from'./chunk-QZPVZY6S.mjs';import {a as a$2}from'./chunk-ARHPXIBJ.mjs';import {b,a as a$3}from'./chunk-B6FA4MJ5.mjs';import {i,t}from'./chunk-F24WZXN4.mjs';import {a as a$1}from'./chunk-C57BOE7B.mjs';import {a}from'./chunk-QYUPLKLP.mjs';var P=class o{constructor(t){a(this,"_document");a(this,"_pendingVariables");t instanceof ArrayBuffer||ArrayBuffer.isView(t)?this._document={package:{document:{content:[]}},originalBuffer:t instanceof ArrayBuffer?t:t.buffer}:this._document=t,this._pendingVariables={};}static async fromBuffer(t){let e=await a$1(t);return new o(e)}static fromDocument(t){return new o(t)}getDocument(){return this._document}getText(){let t=this._document.package.document;return this._getBodyText(t)}getFormattedText(){let t=[],e=this._document.package.document;for(let n of e.content)n.type==="paragraph"&&this._extractParagraphSegments(n,t);return t}getVariables(){return a$2(this._document)}getStyles(){let t=this._document.package.styles;if(!t?.styles)return [];let e=[];for(let[n,r]of Object.entries(t.styles))if(typeof r=="object"&&r!==null){let a=r;e.push({id:n,name:a.name||n,type:a.type==="numbering"?"paragraph":a.type||"paragraph",builtIn:a.default});}return e}getPageCount(){let t=this.getWordCount();return Math.max(1,Math.ceil(t/500))}getWordCount(){return this.getText().split(/\s+/).filter(n=>n.length>0).length}getCharacterCount(t=true){let e=this.getText();return t?e.length:e.replace(/\s/g,"").length}getParagraphCount(){return this._document.package.document.content.filter(t=>t.type==="paragraph").length}getTableCount(){return this._document.package.document.content.filter(t=>t.type==="table").length}getAgentContext(t=100){let e=this._document.package.document,n=e.content.filter(i=>i.type==="paragraph"),r=n.map((i,s)=>{let c=this._getParagraphText(i),p=i.formatting?.styleId;return {index:s,preview:c.slice(0,t),style:p,isHeading:p?.toLowerCase().includes("heading")||false,headingLevel:this._parseHeadingLevel(p),isListItem:!!i.listRendering,isEmpty:c.trim().length===0}}),a=(e.sections||[]).map((i,s)=>({index:s,paragraphCount:i.content?.length||0,pageSize:i.properties?.pageWidth&&i.properties?.pageHeight?{width:i.properties.pageWidth,height:i.properties.pageHeight}:void 0,isLandscape:i.properties?.orientation==="landscape",hasHeader:!!i.properties?.headerReferences?.length,hasFooter:!!i.properties?.footerReferences?.length}));return {paragraphCount:n.length,wordCount:this.getWordCount(),characterCount:this.getCharacterCount(),variables:this.getVariables(),variableCount:this.getVariables().length,availableStyles:this.getStyles(),outline:r,sections:a,hasTables:this.getTableCount()>0,hasImages:this._hasImages(),hasHyperlinks:this._hasHyperlinks()}}insertText(t,e,n={}){let r={type:"insertText",position:t,text:e,formatting:n.formatting};return this._executeCommand(r)}replaceRange(t,e,n={}){let r={type:"replaceText",range:t,text:e,formatting:n.formatting};return this._executeCommand(r)}deleteRange(t){let e={type:"deleteText",range:t};return this._executeCommand(e)}applyFormatting(t,e){let n={type:"formatText",range:t,formatting:e};return this._executeCommand(n)}applyStyle(t,e){let n={type:"applyStyle",paragraphIndex:t,styleId:e};return this._executeCommand(n)}applyParagraphFormatting(t,e){let n={type:"formatParagraph",paragraphIndex:t,formatting:e};return this._executeCommand(n)}insertTable(t,e,n,r={}){let a={type:"insertTable",position:t,rows:e,columns:n,data:r.data,hasHeader:r.hasHeader};return this._executeCommand(a)}insertImage(t,e,n={}){let r={type:"insertImage",position:t,src:e,width:n.width,height:n.height,alt:n.alt};return this._executeCommand(r)}insertHyperlink(t,e,n={}){let r={type:"insertHyperlink",range:t,url:e,displayText:n.displayText,tooltip:n.tooltip};return this._executeCommand(r)}removeHyperlink(t){let e={type:"removeHyperlink",range:t};return this._executeCommand(e)}insertParagraphBreak(t){let e={type:"insertParagraphBreak",position:t};return this._executeCommand(e)}mergeParagraphs(t,e){let n={type:"mergeParagraphs",paragraphIndex:t,count:e};return this._executeCommand(n)}setVariable(t,e){return this._pendingVariables[t]=e,this}setVariables(t){for(let[e,n]of Object.entries(t))this._pendingVariables[e]=n;return this}getPendingVariables(){return {...this._pendingVariables}}clearPendingVariables(){return this._pendingVariables={},this}async applyVariables(t){let e={...this._pendingVariables,...t};if(Object.keys(e).length===0)return this;let n=this._document.originalBuffer;if(!n)throw new Error("Cannot apply variables: no original buffer for processing");let{processTemplate:r}=await import('./processTemplate-GPFDLQMX.mjs'),a=r(n,e),i=await a$1(a),s=new o(i);return s._pendingVariables={},s}async toBuffer(t$1){if(this._document.originalBuffer){if(t$1?.selective){let n=await c(this._document,this._document.originalBuffer,t$1.selective);if(n)return this._document.originalBuffer=n,n}let e=await i(this._document);return this._document.originalBuffer=e,e}return t(this._document)}async toBlob(t="application/vnd.openxmlformats-officedocument.wordprocessingml.document"){let e=await this.toBuffer();return new Blob([e],{type:t})}executeCommands(t){return new o(b(this._document,t))}_executeCommand(t){let e=new o(a$3(this._document,t));return e._pendingVariables={...this._pendingVariables},e}_getBodyText(t){let e=[];for(let n of t.content)n.type==="paragraph"?e.push(this._getParagraphText(n)):n.type==="table"&&e.push(this._getTableText(n));return e.join(`
1
+ import {c}from'./chunk-QZPVZY6S.mjs';import {a as a$2}from'./chunk-ARHPXIBJ.mjs';import {b,a as a$3}from'./chunk-B6FA4MJ5.mjs';import {i,t}from'./chunk-F24WZXN4.mjs';import {a as a$1}from'./chunk-5EP47PMQ.mjs';import {a}from'./chunk-QYUPLKLP.mjs';var P=class o{constructor(t){a(this,"_document");a(this,"_pendingVariables");t instanceof ArrayBuffer||ArrayBuffer.isView(t)?this._document={package:{document:{content:[]}},originalBuffer:t instanceof ArrayBuffer?t:t.buffer}:this._document=t,this._pendingVariables={};}static async fromBuffer(t){let e=await a$1(t);return new o(e)}static fromDocument(t){return new o(t)}getDocument(){return this._document}getText(){let t=this._document.package.document;return this._getBodyText(t)}getFormattedText(){let t=[],e=this._document.package.document;for(let n of e.content)n.type==="paragraph"&&this._extractParagraphSegments(n,t);return t}getVariables(){return a$2(this._document)}getStyles(){let t=this._document.package.styles;if(!t?.styles)return [];let e=[];for(let[n,r]of Object.entries(t.styles))if(typeof r=="object"&&r!==null){let a=r;e.push({id:n,name:a.name||n,type:a.type==="numbering"?"paragraph":a.type||"paragraph",builtIn:a.default});}return e}getPageCount(){let t=this.getWordCount();return Math.max(1,Math.ceil(t/500))}getWordCount(){return this.getText().split(/\s+/).filter(n=>n.length>0).length}getCharacterCount(t=true){let e=this.getText();return t?e.length:e.replace(/\s/g,"").length}getParagraphCount(){return this._document.package.document.content.filter(t=>t.type==="paragraph").length}getTableCount(){return this._document.package.document.content.filter(t=>t.type==="table").length}getAgentContext(t=100){let e=this._document.package.document,n=e.content.filter(i=>i.type==="paragraph"),r=n.map((i,s)=>{let c=this._getParagraphText(i),p=i.formatting?.styleId;return {index:s,preview:c.slice(0,t),style:p,isHeading:p?.toLowerCase().includes("heading")||false,headingLevel:this._parseHeadingLevel(p),isListItem:!!i.listRendering,isEmpty:c.trim().length===0}}),a=(e.sections||[]).map((i,s)=>({index:s,paragraphCount:i.content?.length||0,pageSize:i.properties?.pageWidth&&i.properties?.pageHeight?{width:i.properties.pageWidth,height:i.properties.pageHeight}:void 0,isLandscape:i.properties?.orientation==="landscape",hasHeader:!!i.properties?.headerReferences?.length,hasFooter:!!i.properties?.footerReferences?.length}));return {paragraphCount:n.length,wordCount:this.getWordCount(),characterCount:this.getCharacterCount(),variables:this.getVariables(),variableCount:this.getVariables().length,availableStyles:this.getStyles(),outline:r,sections:a,hasTables:this.getTableCount()>0,hasImages:this._hasImages(),hasHyperlinks:this._hasHyperlinks()}}insertText(t,e,n={}){let r={type:"insertText",position:t,text:e,formatting:n.formatting};return this._executeCommand(r)}replaceRange(t,e,n={}){let r={type:"replaceText",range:t,text:e,formatting:n.formatting};return this._executeCommand(r)}deleteRange(t){let e={type:"deleteText",range:t};return this._executeCommand(e)}applyFormatting(t,e){let n={type:"formatText",range:t,formatting:e};return this._executeCommand(n)}applyStyle(t,e){let n={type:"applyStyle",paragraphIndex:t,styleId:e};return this._executeCommand(n)}applyParagraphFormatting(t,e){let n={type:"formatParagraph",paragraphIndex:t,formatting:e};return this._executeCommand(n)}insertTable(t,e,n,r={}){let a={type:"insertTable",position:t,rows:e,columns:n,data:r.data,hasHeader:r.hasHeader};return this._executeCommand(a)}insertImage(t,e,n={}){let r={type:"insertImage",position:t,src:e,width:n.width,height:n.height,alt:n.alt};return this._executeCommand(r)}insertHyperlink(t,e,n={}){let r={type:"insertHyperlink",range:t,url:e,displayText:n.displayText,tooltip:n.tooltip};return this._executeCommand(r)}removeHyperlink(t){let e={type:"removeHyperlink",range:t};return this._executeCommand(e)}insertParagraphBreak(t){let e={type:"insertParagraphBreak",position:t};return this._executeCommand(e)}mergeParagraphs(t,e){let n={type:"mergeParagraphs",paragraphIndex:t,count:e};return this._executeCommand(n)}setVariable(t,e){return this._pendingVariables[t]=e,this}setVariables(t){for(let[e,n]of Object.entries(t))this._pendingVariables[e]=n;return this}getPendingVariables(){return {...this._pendingVariables}}clearPendingVariables(){return this._pendingVariables={},this}async applyVariables(t){let e={...this._pendingVariables,...t};if(Object.keys(e).length===0)return this;let n=this._document.originalBuffer;if(!n)throw new Error("Cannot apply variables: no original buffer for processing");let{processTemplate:r}=await import('./processTemplate-GPFDLQMX.mjs'),a=r(n,e),i=await a$1(a),s=new o(i);return s._pendingVariables={},s}async toBuffer(t$1){if(this._document.originalBuffer){if(t$1?.selective){let n=await c(this._document,this._document.originalBuffer,t$1.selective);if(n)return this._document.originalBuffer=n,n}let e=await i(this._document);return this._document.originalBuffer=e,e}return t(this._document)}async toBlob(t="application/vnd.openxmlformats-officedocument.wordprocessingml.document"){let e=await this.toBuffer();return new Blob([e],{type:t})}executeCommands(t){return new o(b(this._document,t))}_executeCommand(t){let e=new o(a$3(this._document,t));return e._pendingVariables={...this._pendingVariables},e}_getBodyText(t){let e=[];for(let n of t.content)n.type==="paragraph"?e.push(this._getParagraphText(n)):n.type==="table"&&e.push(this._getTableText(n));return e.join(`
2
2
  `)}_getParagraphText(t){let e=[];for(let n of t.content)n.type==="run"?e.push(this._getRunText(n)):n.type==="hyperlink"&&e.push(this._getHyperlinkText(n));return e.join("")}_getRunText(t){return t.content.filter(e=>e.type==="text").map(e=>e.text).join("")}_getHyperlinkText(t){let e=[];for(let n of t.children)n.type==="run"&&e.push(this._getRunText(n));return e.join("")}_getTableText(t){let e=[];for(let n of t.rows)for(let r of n.cells)for(let a of r.content)a.type==="paragraph"&&e.push(this._getParagraphText(a));return e.join(" ")}_extractParagraphSegments(t,e){for(let n of t.content)if(n.type==="run"){let r=this._getRunText(n);r&&e.push({text:r,formatting:n.formatting});}else if(n.type==="hyperlink"){let r=n.href||"";for(let a of n.children)if(a.type==="run"){let i=this._getRunText(a);i&&e.push({text:i,formatting:a.formatting,isHyperlink:true,hyperlinkUrl:r});}}}_parseHeadingLevel(t){if(!t)return;let e=t.match(/heading\s*(\d)/i);if(e)return parseInt(e[1],10)}_hasImages(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let n of e.content)if(n.type==="run"){for(let r of n.content)if(r.type==="drawing")return true}}return false}_hasHyperlinks(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let n of e.content)if(n.type==="hyperlink")return true}return false}};async function Ct(o){return P.fromBuffer(o)}function kt(o){return P.fromDocument(o)}function M(o,t={}){let{outlineMaxChars:e=100,maxOutlineParagraphs:n=50}=t,r=o.package.document,a=r.content.filter(y=>y.type==="paragraph"),i=z(a,e,n),s=a$2(o),c=W(o),p=$(r),u=U(r),d=G(r),f=r.content.some(y=>y.type==="table"),x=K(r),l=N(r);return {paragraphCount:a.length,wordCount:u,characterCount:d,variables:s,variableCount:s.length,availableStyles:c,outline:i,sections:p,hasTables:f,hasImages:x,hasHyperlinks:l}}function At(o,t,e={}){let{contextChars:n=200,includeSuggestions:r=true}=e,i=o.package.document.content.filter(m=>m.type==="paragraph"),s=i[t.start.paragraphIndex];if(!s)throw new Error(`Paragraph not found at index ${t.start.paragraphIndex}`);let c=g(s),p="";if(t.start.paragraphIndex===t.end.paragraphIndex)p=c.slice(t.start.offset,t.end.offset);else {let m=[];for(let b=t.start.paragraphIndex;b<=t.end.paragraphIndex;b++){let H=i[b];if(!H)continue;let _=g(H);b===t.start.paragraphIndex?m.push(_.slice(t.start.offset)):b===t.end.paragraphIndex?m.push(_.slice(0,t.end.offset)):m.push(_);}p=m.join(`
3
3
  `);}let u=Y(i,t.start.paragraphIndex,t.start.offset,n),d=Z(i,t.end.paragraphIndex,t.end.offset,n),f=tt(s,t.start.offset),x=s.formatting||{},l={index:t.start.paragraphIndex,fullText:c,style:s.formatting?.styleId,wordCount:v(c)},y=false,A=et(s,t.start.offset),S=r?nt(p):[];return {selectedText:p,range:t,formatting:f,paragraphFormatting:x,textBefore:u,textAfter:d,paragraph:l,inTable:y,inHyperlink:A,suggestedActions:S}}function L(o){let t=M(o,{outlineMaxChars:50,maxOutlineParagraphs:10}),e=[`Document with ${t.paragraphCount} paragraphs, ${t.wordCount} words.`];t.hasTables&&e.push("Contains tables."),t.hasImages&&e.push("Contains images."),t.hasHyperlinks&&e.push("Contains hyperlinks."),t.variableCount>0&&e.push(`Has ${t.variableCount} template variables: ${t.variables.join(", ")}`);let n=t.outline.filter(r=>r.isHeading);if(n.length>0){e.push(`
4
4
  Headings:`);for(let r of n.slice(0,5)){let a=r.headingLevel||1;e.push(`${" ".repeat(a-1)}- ${r.preview}`);}n.length>5&&e.push(` ... and ${n.length-5} more headings`);}return e.join(" ")}function z(o,t,e){let n=[];for(let r=0;r<Math.min(o.length,e);r++){let a=o[r],i=g(a),s=a.formatting?.styleId;n.push({index:r,preview:i.slice(0,t),style:s,isHeading:Q(s),headingLevel:X(s),isListItem:!!a.listRendering,isEmpty:i.trim().length===0});}return n}function W(o){let t=o.package.styles;if(!t?.styles)return [];let e=[];for(let[n,r]of Object.entries(t.styles))if(typeof r=="object"&&r!==null){let a=r;e.push({id:n,name:a.name||n,type:a.type==="numbering"?"paragraph":a.type||"paragraph",builtIn:a.default});}return e}function $(o){return o.sections?o.sections.map((t,e)=>({index:e,paragraphCount:t.content?.length||0,pageSize:t.properties?.pageWidth&&t.properties?.pageHeight?{width:t.properties.pageWidth,height:t.properties.pageHeight}:void 0,isLandscape:t.properties?.orientation==="landscape",hasHeader:!!t.properties?.headerReferences?.length,hasFooter:!!t.properties?.footerReferences?.length})):[]}function U(o){let t=0;for(let e of o.content)if(e.type==="paragraph"){let n=g(e);t+=v(n);}else e.type==="table"&&(t+=q(e));return t}function v(o){return o.split(/\s+/).filter(e=>e.length>0).length}function G(o){let t=0;for(let e of o.content)if(e.type==="paragraph"){let n=g(e);t+=n.length;}else e.type==="table"&&(t+=J(e));return t}function q(o){let t=0;for(let e of o.rows)for(let n of e.cells)for(let r of n.content)if(r.type==="paragraph"){let a=g(r);t+=v(a);}return t}function J(o){let t=0;for(let e of o.rows)for(let n of e.cells)for(let r of n.content)if(r.type==="paragraph"){let a=g(r);t+=a.length;}return t}function g(o){let t=[];for(let e of o.content)e.type==="run"?t.push(T(e)):e.type==="hyperlink"&&t.push(F(e));return t.join("")}function T(o){return o.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function F(o){let t=[];for(let e of o.children)e.type==="run"&&t.push(T(e));return t.join("")}function K(o){for(let t of o.content)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="run"){for(let n of e.content)if(n.type==="drawing")return true}}return false}function N(o){for(let t of o.content)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="hyperlink")return true}return false}function Q(o){return o?o.toLowerCase().includes("heading"):false}function X(o){if(!o)return;let t=o.match(/heading\s*(\d)/i);if(t)return parseInt(t[1],10)}function Y(o,t,e,n){let r=[],a=0,i=o[t];if(i){let p=g(i).slice(0,e);r.unshift(p),a+=p.length;}for(let c=t-1;c>=0&&a<n;c--){let p=o[c];if(!p)continue;let u=g(p);r.unshift(u),a+=u.length;}let s=r.join(`
@@ -0,0 +1 @@
1
+ 'use strict';var chunkJFZIXFRC_js=require('./chunk-JFZIXFRC.js'),chunkBJSG6TEG_js=require('./chunk-BJSG6TEG.js');function g(e){return {sdtType:e.sdtType,id:e.id??null,alias:e.alias??null,tag:e.tag??null,lock:e.lock??null,placeholder:e.placeholder??null,showingPlaceholder:e.showingPlaceholder??false,dateFormat:e.dateFormat??null,listItems:e.listItems?JSON.stringify(e.listItems):null,checked:e.checked??null,dataBinding:e.dataBinding?JSON.stringify(e.dataBinding):null,rawPropertiesXml:e.rawPropertiesXml??null,rawEndPropertiesXml:e.rawEndPropertiesXml??null}}function m(e){let t={sdtType:e.sdtType??"richText"};if(typeof e.id=="number"&&(t.id=e.id),e.alias!=null&&(t.alias=String(e.alias)),e.tag!=null&&(t.tag=String(e.tag)),e.lock!=null&&(t.lock=e.lock),e.placeholder!=null&&(t.placeholder=String(e.placeholder)),e.showingPlaceholder&&(t.showingPlaceholder=true),e.dateFormat!=null&&(t.dateFormat=String(e.dateFormat)),typeof e.listItems=="string"&&e.listItems)try{t.listItems=JSON.parse(e.listItems);}catch{}if(e.checked!=null&&(t.checked=e.checked),typeof e.dataBinding=="string"&&e.dataBinding)try{t.dataBinding=JSON.parse(e.dataBinding);}catch{}return e.rawPropertiesXml!=null&&(t.rawPropertiesXml=String(e.rawPropertiesXml)),e.rawEndPropertiesXml!=null&&(t.rawEndPropertiesXml=String(e.rawEndPropertiesXml)),t}function a(e){return !!e.wrap&&e.wrap.type!=="inline"}function x(e){let t=e.wrap?.type??"inline",i=e.wrap?.wrapText,n=e.position?.horizontal?.alignment;return {displayMode:s(t),cssFloat:p(t,i,n),wrapType:t,wrapText:i,anchorTarget:a(e)?"followingBlock":void 0,position:e.position?f(e.position):void 0,distTop:e.wrap?.distT!=null?chunkBJSG6TEG_js.f(e.wrap.distT):void 0,distBottom:e.wrap?.distB!=null?chunkBJSG6TEG_js.f(e.wrap.distB):void 0,distLeft:e.wrap?.distL!=null?chunkBJSG6TEG_js.f(e.wrap.distL):void 0,distRight:e.wrap?.distR!=null?chunkBJSG6TEG_js.f(e.wrap.distR):void 0}}function y(e){return e.anchorTarget==="followingBlock"||d(e)}function P(e){let t=e.position;if(!(!t?.horizontal&&!t?.vertical))return {horizontal:{relativeTo:t.horizontal?.relativeTo??"margin",alignment:t.horizontal?.align,posOffset:t.horizontal?.posOffset},vertical:{relativeTo:t.vertical?.relativeTo??"paragraph",alignment:t.vertical?.align,posOffset:t.vertical?.posOffset}}}function B(e){let t=e.wrapType??(e.displayMode==="float"?"square":"inline");if(!t||t==="inline")return;let i={type:t};return e.wrapText&&(i.wrapText=e.wrapText),e.distTop!=null&&(i.distT=chunkBJSG6TEG_js.g(e.distTop)),e.distBottom!=null&&(i.distB=chunkBJSG6TEG_js.g(e.distBottom)),e.distLeft!=null&&(i.distL=chunkBJSG6TEG_js.g(e.distLeft)),e.distRight!=null&&(i.distR=chunkBJSG6TEG_js.g(e.distRight)),i}function s(e){return e==="inline"?"inline":e==="topAndBottom"?"block":"float"}function d(e){return e.displayMode==="float"||chunkJFZIXFRC_js.a(e.wrapType)}function p(e,t,i){return e==="inline"||e==="topAndBottom"?"none":t==="left"?"right":t==="right"||i==="left"?"left":i==="right"?"right":"none"}function f(e){return {horizontal:e.horizontal?{relativeTo:e.horizontal.relativeTo,posOffset:e.horizontal.posOffset,align:e.horizontal.alignment}:void 0,vertical:e.vertical?{relativeTo:e.vertical.relativeTo,posOffset:e.vertical.posOffset,align:e.vertical.alignment}:void 0}}var c=new Set(["hyperlink"]),S=new Set(["hyperlink","comment"]);function I(e,t=c){let i=e.filter(n=>!t.has(n.type.name));return i.length===0?"":i.map(n=>`${n.type.name}:${JSON.stringify(n.attrs)}`).sort().join("|")}exports.a=c;exports.b=S;exports.c=I;exports.d=g;exports.e=m;exports.f=a;exports.g=x;exports.h=y;exports.i=P;exports.j=B;
@@ -1 +1 @@
1
- 'use strict';var chunk77X765ZO_js=require('./chunk-77X765ZO.js'),chunkBJSG6TEG_js=require('./chunk-BJSG6TEG.js'),chunkDC7S76ZX_js=require('./chunk-DC7S76ZX.js');var i={runImage:"layout-run-image",blockImage:"layout-block-image",pageFloatingImage:"layout-page-floating-image",cellFloatingImage:"layout-cell-floating-image",pageContent:"layout-page-content",paragraph:"layout-paragraph"},y=[`.${i.pageFloatingImage}`,`.${i.cellFloatingImage}`,`.${i.blockImage}`,`.${i.runImage}`].join(", ");function L(n){if(!(n instanceof Element))return null;let e=n.closest(y);if(!e)return null;let o=e.dataset.pmStart;if(o===void 0)return null;let t=Number(o);return Number.isNaN(t)?null:{pos:t,imageEl:e}}function b(n){if(!(n instanceof HTMLElement))return null;if(n.tagName==="IMG"&&n.classList.contains(i.runImage))return n;let e=n.closest(y);return e&&e.dataset.pmStart?e:null}function x(n,e=1){if(!n.classList.contains(i.runImage))return;let o=n.closest(`.${i.pageContent}`),t=n.closest(`.${i.paragraph}`);if(!o||!t)return;let r=n.getBoundingClientRect(),a=o.getBoundingClientRect(),l=t.getBoundingClientRect(),p=e>0?e:1;return {horizontalEmu:Math.round(chunkBJSG6TEG_js.g((r.left-a.left)/p)),verticalEmu:Math.round(chunkBJSG6TEG_js.g((r.top-l.top)/p))}}function T(n,e){return n==="inline"?"inline":n==="behind"?"behind":n==="inFront"?"inFront":n==="square"||n==="tight"||n==="through"?e==="right"?"squareRight":"squareLeft":null}var k=[{choice:"inline",i18nLabelKey:"inLineWithText",i18nDescKey:"inLineWithText",iconHint:"inline"},{choice:"squareLeft",i18nLabelKey:"squareLeft",i18nDescKey:"squareLeft",iconHint:"squareLeft"},{choice:"squareRight",i18nLabelKey:"squareRight",i18nDescKey:"squareRight",iconHint:"squareRight"},{choice:"behind",i18nLabelKey:"behindText",i18nDescKey:"behindText",iconHint:"behind"},{choice:"inFront",i18nLabelKey:"inFrontOfText",i18nDescKey:"inFrontOfText",iconHint:"inFront"}];function I(n,e){return true}function E(n){switch(n){case "inline":return "inline";case "square":case "tight":case "through":return "squareLeft";case "topAndBottom":return "topAndBottom";case "behind":return "behind";case "inFront":return "inFront";case "wrapRight":return "squareLeft";case "wrapLeft":return "squareRight";default:return}}function X(n,e){let o=new Map;for(let t=0;t<n.length;t++){let r=n[t],a=e[t];r&&a&&o.set(String(r.id),{block:r,measure:a});}return o}var c=class{constructor(e={}){chunkDC7S76ZX_js.a(this,"container",null);chunkDC7S76ZX_js.a(this,"blockLookup",new Map);chunkDC7S76ZX_js.a(this,"pageStates",[]);chunkDC7S76ZX_js.a(this,"totalPages",0);chunkDC7S76ZX_js.a(this,"options");chunkDC7S76ZX_js.a(this,"doc");chunkDC7S76ZX_js.a(this,"resolvedCommentIds",new Set);this.options=e,this.doc=e.document??document;}setBlockLookup(e){this.blockLookup=e;}mount(e){this.container=e,this.applyContainerStyles();}unmount(){this.container&&(this.container.innerHTML=""),this.container=null,this.pageStates=[];}applyContainerStyles(){if(!this.container)return;let e=this.options.pageGap??24;this.container.style.display="flex",this.container.style.flexDirection="column",this.container.style.alignItems="center",this.container.style.gap=`${e}px`,this.container.style.padding=`${e}px`,this.container.style.backgroundColor=this.options.containerBackground??"var(--doc-bg, #f8f9fa)",this.container.style.minHeight="100%";}paint(e){if(!this.container)throw new Error("LayoutPainter: not mounted");let{pages:o}=e;this.totalPages=o.length,this.container.innerHTML="",this.pageStates=[];for(let t=0;t<o.length;t++){let r=o[t],a={pageNumber:r.number,totalPages:this.totalPages,section:"body",resolvedCommentIds:this.resolvedCommentIds},l=this.renderPageWithLookup(r,a);this.container.appendChild(l),this.pageStates.push({element:l,pageNumber:r.number,fragmentCount:r.fragments.length});}}renderPageWithLookup(e,o){let t=this.doc.createElement("div");t.className="layout-page",t.dataset.pageNumber=String(e.number),t.style.position="relative",t.style.width=`${e.size.w}px`,t.style.height=`${e.size.h}px`,t.style.backgroundColor=this.options.pageBackground??"var(--doc-page-bg, #ffffff)",t.style.color="var(--doc-page-text, #000000)",t.style.overflow="hidden",this.options.showShadow&&(t.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");let r=this.doc.createElement("div");r.className="layout-page-content",r.style.position="absolute",r.style.top=`${e.margins.top}px`,r.style.left=`${e.margins.left}px`,r.style.right=`${e.margins.right}px`,r.style.bottom=`${e.margins.bottom}px`,r.style.overflow="visible";for(let a of e.fragments){let l=this.renderFragmentWithLookup(a,o);this.applyFragmentPosition(l,a),r.appendChild(l);}return t.appendChild(r),t}renderFragmentWithLookup(e,o){let t=this.blockLookup.get(String(e.blockId));if(e.kind==="paragraph"&&t){let r=t.block,a=t.measure;return chunk77X765ZO_js.t(e,r,a,o,{document:this.doc})}if(e.kind==="table"&&t){let r=t.block,a=t.measure;return chunk77X765ZO_js.w(e,r,a,o,{document:this.doc})}if(e.kind==="image"&&t){let r=t.block,a=t.measure;return chunk77X765ZO_js.q(e,r,a,o,{document:this.doc})}if(e.kind==="textBox"&&t){let r=t.block,a=t.measure;return chunk77X765ZO_js.y(e,r,a,o,{document:this.doc})}return chunk77X765ZO_js.o(e,o,{document:this.doc})}applyFragmentPosition(e,o){e.style.position="absolute",e.style.left=`${o.x}px`,e.style.top=`${o.y}px`,e.style.width=`${o.width}px`,"height"in o&&(e.style.height=`${o.height}px`);}getPageCount(){return this.totalPages}getPageElement(e){return this.pageStates[e]?.element??null}scrollToPage(e){let o=this.pageStates.find(t=>t.pageNumber===e);o?.element&&o.element.scrollIntoView({behavior:"smooth",block:"start"});}};function Z(n){return new c(n)}exports.a=i;exports.b=L;exports.c=b;exports.d=x;exports.e=T;exports.f=k;exports.g=I;exports.h=E;exports.i=X;exports.j=c;exports.k=Z;
1
+ 'use strict';var chunkTT3ILFZC_js=require('./chunk-TT3ILFZC.js'),chunkBJSG6TEG_js=require('./chunk-BJSG6TEG.js'),chunkDC7S76ZX_js=require('./chunk-DC7S76ZX.js');var i={runImage:"layout-run-image",blockImage:"layout-block-image",pageFloatingImage:"layout-page-floating-image",cellFloatingImage:"layout-cell-floating-image",pageContent:"layout-page-content",paragraph:"layout-paragraph"},y=[`.${i.pageFloatingImage}`,`.${i.cellFloatingImage}`,`.${i.blockImage}`,`.${i.runImage}`].join(", ");function L(n){if(!(n instanceof Element))return null;let e=n.closest(y);if(!e)return null;let o=e.dataset.pmStart;if(o===void 0)return null;let t=Number(o);return Number.isNaN(t)?null:{pos:t,imageEl:e}}function b(n){if(!(n instanceof HTMLElement))return null;if(n.tagName==="IMG"&&n.classList.contains(i.runImage))return n;let e=n.closest(y);return e&&e.dataset.pmStart?e:null}function x(n,e=1){if(!n.classList.contains(i.runImage))return;let o=n.closest(`.${i.pageContent}`),t=n.closest(`.${i.paragraph}`);if(!o||!t)return;let r=n.getBoundingClientRect(),a=o.getBoundingClientRect(),l=t.getBoundingClientRect(),p=e>0?e:1;return {horizontalEmu:Math.round(chunkBJSG6TEG_js.g((r.left-a.left)/p)),verticalEmu:Math.round(chunkBJSG6TEG_js.g((r.top-l.top)/p))}}function T(n,e){return n==="inline"?"inline":n==="behind"?"behind":n==="inFront"?"inFront":n==="square"||n==="tight"||n==="through"?e==="right"?"squareRight":"squareLeft":null}var k=[{choice:"inline",i18nLabelKey:"inLineWithText",i18nDescKey:"inLineWithText",iconHint:"inline"},{choice:"squareLeft",i18nLabelKey:"squareLeft",i18nDescKey:"squareLeft",iconHint:"squareLeft"},{choice:"squareRight",i18nLabelKey:"squareRight",i18nDescKey:"squareRight",iconHint:"squareRight"},{choice:"behind",i18nLabelKey:"behindText",i18nDescKey:"behindText",iconHint:"behind"},{choice:"inFront",i18nLabelKey:"inFrontOfText",i18nDescKey:"inFrontOfText",iconHint:"inFront"}];function I(n,e){return true}function E(n){switch(n){case "inline":return "inline";case "square":case "tight":case "through":return "squareLeft";case "topAndBottom":return "topAndBottom";case "behind":return "behind";case "inFront":return "inFront";case "wrapRight":return "squareLeft";case "wrapLeft":return "squareRight";default:return}}function X(n,e){let o=new Map;for(let t=0;t<n.length;t++){let r=n[t],a=e[t];r&&a&&o.set(String(r.id),{block:r,measure:a});}return o}var c=class{constructor(e={}){chunkDC7S76ZX_js.a(this,"container",null);chunkDC7S76ZX_js.a(this,"blockLookup",new Map);chunkDC7S76ZX_js.a(this,"pageStates",[]);chunkDC7S76ZX_js.a(this,"totalPages",0);chunkDC7S76ZX_js.a(this,"options");chunkDC7S76ZX_js.a(this,"doc");chunkDC7S76ZX_js.a(this,"resolvedCommentIds",new Set);this.options=e,this.doc=e.document??document;}setBlockLookup(e){this.blockLookup=e;}mount(e){this.container=e,this.applyContainerStyles();}unmount(){this.container&&(this.container.innerHTML=""),this.container=null,this.pageStates=[];}applyContainerStyles(){if(!this.container)return;let e=this.options.pageGap??24;this.container.style.display="flex",this.container.style.flexDirection="column",this.container.style.alignItems="center",this.container.style.gap=`${e}px`,this.container.style.padding=`${e}px`,this.container.style.backgroundColor=this.options.containerBackground??"var(--doc-bg, #f8f9fa)",this.container.style.minHeight="100%";}paint(e){if(!this.container)throw new Error("LayoutPainter: not mounted");let{pages:o}=e;this.totalPages=o.length,this.container.innerHTML="",this.pageStates=[];for(let t=0;t<o.length;t++){let r=o[t],a={pageNumber:r.number,totalPages:this.totalPages,section:"body",resolvedCommentIds:this.resolvedCommentIds},l=this.renderPageWithLookup(r,a);this.container.appendChild(l),this.pageStates.push({element:l,pageNumber:r.number,fragmentCount:r.fragments.length});}}renderPageWithLookup(e,o){let t=this.doc.createElement("div");t.className="layout-page",t.dataset.pageNumber=String(e.number),t.style.position="relative",t.style.width=`${e.size.w}px`,t.style.height=`${e.size.h}px`,t.style.backgroundColor=this.options.pageBackground??"var(--doc-page-bg, #ffffff)",t.style.color="var(--doc-page-text, #000000)",t.style.overflow="hidden",this.options.showShadow&&(t.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");let r=this.doc.createElement("div");r.className="layout-page-content",r.style.position="absolute",r.style.top=`${e.margins.top}px`,r.style.left=`${e.margins.left}px`,r.style.right=`${e.margins.right}px`,r.style.bottom=`${e.margins.bottom}px`,r.style.overflow="visible";for(let a of e.fragments){let l=this.renderFragmentWithLookup(a,o);this.applyFragmentPosition(l,a),r.appendChild(l);}return t.appendChild(r),t}renderFragmentWithLookup(e,o){let t=this.blockLookup.get(String(e.blockId));if(e.kind==="paragraph"&&t){let r=t.block,a=t.measure;return chunkTT3ILFZC_js.t(e,r,a,o,{document:this.doc})}if(e.kind==="table"&&t){let r=t.block,a=t.measure;return chunkTT3ILFZC_js.w(e,r,a,o,{document:this.doc})}if(e.kind==="image"&&t){let r=t.block,a=t.measure;return chunkTT3ILFZC_js.q(e,r,a,o,{document:this.doc})}if(e.kind==="textBox"&&t){let r=t.block,a=t.measure;return chunkTT3ILFZC_js.y(e,r,a,o,{document:this.doc})}return chunkTT3ILFZC_js.o(e,o,{document:this.doc})}applyFragmentPosition(e,o){e.style.position="absolute",e.style.left=`${o.x}px`,e.style.top=`${o.y}px`,e.style.width=`${o.width}px`,"height"in o&&(e.style.height=`${o.height}px`);}getPageCount(){return this.totalPages}getPageElement(e){return this.pageStates[e]?.element??null}scrollToPage(e){let o=this.pageStates.find(t=>t.pageNumber===e);o?.element&&o.element.scrollIntoView({behavior:"smooth",block:"start"});}};function Z(n){return new c(n)}exports.a=i;exports.b=L;exports.c=b;exports.d=x;exports.e=T;exports.f=k;exports.g=I;exports.h=E;exports.i=X;exports.j=c;exports.k=Z;
@@ -1 +1 @@
1
- import {a as a$1,e,b as b$1,y,L}from'./chunk-BBJMUBTD.mjs';import {b,a,c}from'./chunk-QPFJJPIC.mjs';import {f}from'./chunk-KNY7SXPJ.mjs';function Ge(e){return !b(e.wrapType)&&e.wrapType!=="topAndBottom"}function _e(e){return e.wrapType==="behind"}function De(e){return a(e.wrapType)?true:e.displayMode==="float"}function X(e){return b(e.wrapType)||e.wrapType==="topAndBottom"?false:c(e.wrapType)?true:e.displayMode==="float"&&e.cssFloat!=="none"}function Xe(e){return e==="left"?"right":e==="right"?"left":"bothSides"}function Ve(e){return {pageWidth:e.size.w,pageHeight:e.size.h,marginLeft:e.margins.left,marginTop:e.margins.top,contentWidth:e.size.w-e.margins.left-e.margins.right,contentHeight:e.size.h-e.margins.top-e.margins.bottom}}function Ue(e,n,t,i){let{x:r,side:o}=be(e,t,i),g=j(e,n,i);return {x:r,y:g,side:o}}function N(e,n,t){return j(e,n,t)}function be(e,n,t){let i=e.position?.horizontal;if(!i)return e.cssFloat==="right"?{x:n-e.width,side:"right"}:{x:0,side:"left"};let r=xe(i.relativeTo,n,t);if(i.align==="right")return {x:r.size?r.base+r.size-e.width:0,side:"right"};if(i.align==="left")return {x:r.base,side:"left"};if(i.align==="center")return {x:r.size?r.base+(r.size-e.width)/2:0,side:"left"};if(i.posOffset!==void 0){let o=r.base+f(i.posOffset);return {x:o,side:o>n/2?"right":"left"}}return {x:r.base,side:"left"}}function xe(e,n,t){let i=t?.pageWidth??0,r=t?.marginLeft??0;switch(e){case "page":return {base:-r,size:i};case "leftMargin":return {base:-r,size:r};case "rightMargin":return {base:n,size:r};case "character":return {base:0,size:0};default:return {base:0,size:n}}}function j(e,n,t){let i=e.position?.vertical;if(!i)return n;let r=Te(i.relativeTo,n,t);return i.align==="top"?r.base:i.align==="center"?r.size?r.base+(r.size-e.height)/2:n:i.align==="bottom"?r.size?r.base+r.size-e.height:n:i.posOffset!==void 0?r.base+f(i.posOffset):i.relativeTo==="paragraph"||i.relativeTo==="line"?n:r.base}function Te(e,n,t){let i=t?.pageHeight??0,r=t?.marginTop??0,o=t?.contentHeight??0;switch(e){case "paragraph":case "line":return {base:n,size:0};case "page":return {base:-r,size:i};case "topMargin":return {base:-r,size:r};case "bottomMargin":return {base:o,size:r};default:return {base:0,size:o}}}var V=7,U=0;function ye(e,n){if(e.kind!=="paragraph"||n.kind!=="paragraph")return "totalHeight"in n?n.totalHeight:"height"in n?n.height:0;let t=e.runs.filter(c=>c.kind!=="text"||c.text.length>0);if(!(n.lines.length===1&&t.length>0&&t.every(c=>c.kind==="image")))return n.totalHeight;let r=t.reduce((c,p)=>p.kind==="image"?Math.max(c,p.height):c,0),o=e.attrs?.spacing?.before??0,g=e.attrs?.spacing?.after??0;return o+r+g}function K(e){let n=e?.borders?.top?.width??0,t=e?.borders?.bottom?.width??0;return n+t}function q(e$1,n,t){let i=a$1(e$1.width,e$1.widthType,n),r=i??n,o=e(e$1,n),g=new Map;for(let l of b$1(e$1))g.set(`${l.rowIndex}-${l.cellIndex}`,l.columnIndex);let c=e$1.rows.map((l,s)=>({cells:l.cells.map((u,a)=>{let h=u.colSpan??1,m=g.get(`${s}-${a}`)??0,d=0;for(let b=0;b<h&&m+b<o.length;b++)d+=o[m+b]??0;d===0&&(d=(u.width&&u.width>0?u.width:a$1(u.widthValue,u.widthType,r))??100);let F=u.padding?.left??V,M=u.padding?.right??V,T=Math.max(1,d-F-M);return {blocks:u.blocks.map(b=>t(b,T)),width:d,height:0,colSpan:u.colSpan,rowSpan:u.rowSpan}}),height:0})),p=[];for(let l=0;l<c.length;l++){let s=c[l],u=e$1.rows[l]?.cells,a=0,h=0;for(let M=0;M<s.cells.length;M++){let T=s.cells[M],b=u?.[M],B=0,R=0;for(let I=0;I<T.blocks.length;I++){let z=b?.blocks[I],H=T.blocks[I];if(!z||!H)continue;let me=ye(z,H),Z=z.kind==="paragraph"?z.attrs?.spacing:void 0,E=Z?.before??0,O=Z?.after??0;B+=Math.max(R,E)+(me-E-O),R=O;}B+=R,T.height=B;let fe=b?.padding?.top??U,de=b?.padding?.bottom??U;T.height+=fe+de,(T.rowSpan??1)<=1&&(a=Math.max(a,T.height)),h=Math.max(h,K(b));}let m=e$1.rows[l],d=m?.height,F=m?.heightRule;p[l]=F==="exact"&&!!d,d&&F==="exact"?s.height=d:d?s.height=Math.max(a+h,d):s.height=a+h;}let y=c.map(l=>l.height);for(let l=0;l<c.length;l++){let s=e$1.rows[l]?.cells,u=c[l]?.cells;if(!(!s||!u))for(let a=0;a<s.length;a++){let h=s[a]?.rowSpan??1;if(h<=1)continue;let m=Math.min(l+h-1,c.length-1),d=(u[a]?.height??0)+K(s[a]),F=0;for(let b=l;b<=m;b++)F+=y[b]??0;let M=d-F;if(M<=0)continue;let T=m;for(;T>l&&p[T];)T--;p[T]||(c[T].height+=M);}}let x=c.reduce((l,s)=>l+s.height,0),f=o.reduce((l,s)=>l+s,0)||i||n;return {kind:"table",rows:c,columnWidths:o,totalWidth:f,totalHeight:x}}var Fe=4;function Me(e,n,t,i){let r=Array.isArray(n)?n[0]??0:n,o=Pe(e,r,t,i),g=o.filter(a=>a.isMarginRelative),c=o.filter(a=>!a.isMarginRelative),p=new Map;for(let a of g){let h=p.get(a.topY)??[];h.push(a),p.set(a.topY,h);}let y=Ae(c,Fe),x=[];J(y,x),J(Array.from(p.values()),x);let f=new Map;for(let a of x){let h=a.fullWidthBlock&&a.isMarginRelative?0:a.anchorBlockIndex,m=f.get(h)??[],{anchorBlockIndex:d,isMarginRelative:F,...M}=a;m.push(M),f.set(h,m);}let l=new Set(f.keys()),s=0,u=[];return e.map((a,h)=>{l.has(h)&&(s=0,u=f.get(h)??[]);let m=u.length>0?u:void 0,d=Array.isArray(n)?n[h]??r:n,F=t(a,d,m,s);return "totalHeight"in F&&(a.kind==="table"&&a.floating||(s+=F.totalHeight)),F})}function Pe(e,n,t,i){let r=[];for(let o=0;o<e.length;o++){let g=e[o];switch(g.kind){case "paragraph":we(g,o,n,r);break;case "table":ve(g,o,n,t,r);break;case "textBox":Ce(g,o,n,r,i);break}}return r}function Q(e,n,t,i,r,o){let g=0,c=0,p=e?.horizontal;if(p?.align==="left")g=t+r;else if(p?.align==="right")c=t+i;else if(p?.posOffset!==void 0){let y=f(p.posOffset);y<o/2?g=y+t+r:c=o-y+i;}else n==="left"?g=t+r:n==="right"&&(c=t+i);return y(g,c,o)}function W(e){let n=e?.vertical?.relativeTo;return n==="margin"||n==="page"}function we(e,n,t,i){for(let r of e.runs){if(r.kind!=="image")continue;let o=r;if(!X(o))continue;let g=o.distTop??0,c=o.distBottom??0,p=o.distLeft??12,y=o.distRight??12,x=0,f$1=o.position?.vertical;f$1?.align==="top"&&f$1.relativeTo==="margin"?x=0:f$1?.posOffset!==void 0&&(x=f(f$1.posOffset));let l=x+o.height,{leftMargin:s,rightMargin:u}=Q(o.position,o.cssFloat,o.width,p,y,t);(s>0||u>0)&&i.push({leftMargin:s,rightMargin:u,topY:x-g,bottomY:l+c,anchorBlockIndex:n,isMarginRelative:W(o.position)});}}function ve(e,n,t,i,r){let o=e.floating;if(!o)return;let g=q(e,t,i),c=g.totalWidth,p=g.totalHeight,y$1=o.leftFromText??12,x=o.rightFromText??12,f=o.topFromText??0,l=o.bottomFromText??0,s=0;o.tblpX!==void 0?s=o.tblpX:o.tblpXSpec?o.tblpXSpec==="left"||o.tblpXSpec==="inside"?s=0:o.tblpXSpec==="right"||o.tblpXSpec==="outside"?s=t-c:o.tblpXSpec==="center"&&(s=(t-c)/2):e.justification==="center"?s=(t-c)/2:e.justification==="right"&&(s=t-c);let u=0,a=0;s<t/2?u=s+c+x:a=t-s+y$1,{leftMargin:u,rightMargin:a}=y(u,a,t);let h=o.tblpY??0,m=h+p;r.push({leftMargin:u,rightMargin:a,topY:h-f,bottomY:m+l,anchorBlockIndex:n});}function Ce(e,n,t,i,r){if(!L(e)||b(e.wrapType))return;let o=e.width??0,g=e.height??0;if(o<=0||g<=0)return;let c=e.distTop??0,p=e.distBottom??0,y=e.distLeft??12,x=e.distRight??12;if(e.wrapType==="topAndBottom"){let a=N({height:g,position:e.position},0,r),h=a+g+p;if(h<=0)return;i.push({leftMargin:0,rightMargin:0,topY:Math.max(0,a-c),bottomY:h,anchorBlockIndex:n,isMarginRelative:W(e.position),fullWidthBlock:true});return}let f$1=0;e.position?.vertical?.posOffset!==void 0&&(f$1=f(e.position.vertical.posOffset));let l=f$1+g,{leftMargin:s,rightMargin:u}=Q(e.position,e.cssFloat,o,y,x,t);s<=0&&u<=0||i.push({leftMargin:s,rightMargin:u,topY:f$1-c,bottomY:l+p,anchorBlockIndex:n,isMarginRelative:W(e.position)});}function Ae(e,n){let t=[];for(let i of e){let r=t.find(o=>o.some(g=>Math.abs(g.anchorBlockIndex-i.anchorBlockIndex)<=n&&i.topY<g.bottomY&&i.bottomY>g.topY));r?r.push(i):t.push([i]);}return t}function J(e,n){for(let t of e){let i=Math.min(...t.map(r=>r.anchorBlockIndex));for(let r of t)n.push({...r,anchorBlockIndex:i});}}var ee=2e4,P=new Map;function te(e,n,t){return `${e}|${n}|${t||0}`}function ne(){for(;P.size>ee;){let e=P.keys().next().value;if(e===void 0)break;P.delete(e);}}function Ie(e,n,t=0){let i=te(e,n,t),r=P.get(i);if(r!==void 0)return P.delete(i),P.set(i,r),r.width}function ze(e,n,t,i){let r=te(e,n,t);P.set(r,{width:i}),ne();}function ie(){P.clear();}function ke(e){!Number.isFinite(e)||e<=0||(ee=e,ne());}function re(){return P.size}var Be=1e3,oe=Be,w=new Map;function ae(e,n,t=false,i=false){return `${e}|${n}|${t}|${i}`}function se(){for(;w.size>oe;){let e=w.keys().next().value;if(e===void 0)break;w.delete(e);}}function Re(e,n,t=false,i=false){let r=ae(e,n,t,i),o=w.get(r);if(o!==void 0)return w.delete(r),w.set(r,o),o}function Se(e,n,t,i,r){let o=ae(e,n,t,i);w.set(o,r),se();}function ce(){w.clear();}function We(e){!Number.isFinite(e)||e<=0||(oe=e,se());}function le(){return w.size}var $e=5e3,ge=$e,v=new Map;function $(e){let n=[];for(let i of e.runs)i.kind==="text"?n.push(`t:${i.text}|${i.fontFamily}|${i.fontSize}|${i.bold}|${i.italic}`):i.kind==="tab"?n.push(`tab:${i.width}`):i.kind==="image"?n.push(`img:${i.width}x${i.height}`):i.kind==="lineBreak"&&n.push("br");let t=e.attrs;if(t){t.alignment&&n.push(`align:${t.alignment}`),t.indent&&n.push(`indent:${t.indent.left}|${t.indent.right}|${t.indent.firstLine}|${t.indent.hanging}`),t.spacing&&n.push(`spacing:${t.spacing.before}|${t.spacing.after}|${t.spacing.line}|${t.spacing.lineRule}`),t.defaultFontSize!=null&&n.push(`dfs:${t.defaultFontSize}`),t.defaultFontFamily!=null&&n.push(`dff:${t.defaultFontFamily}`);let i=t.borders;if(i){let r=o=>o?`${o.width??""},${o.style??""},${o.color??""}`:"";n.push(`bdr:${r(i.top)}|${r(i.bottom)}|${r(i.left)}|${r(i.right)}`);}t.suppressEmptyParagraphHeight&&n.push("sup"),t.pPrIns&&n.push(`pins:${t.pPrIns.revisionId}`),t.pPrDel&&n.push(`pdel:${t.pPrDel.revisionId}`);}return n.join("||")}function ue(){for(;v.size>ge;){let e=v.keys().next().value;if(e===void 0)break;v.delete(e);}}function He(e,n){let t=$(e),i=v.get(t);if(i!==void 0&&i.maxWidth===n)return v.delete(t),v.set(t,i),i.measure}function Ze(e,n,t){let i=$(e);v.set(i,{measure:t,maxWidth:n}),ue();}function he(){v.clear();}function Ee(e){!Number.isFinite(e)||e<=0||(ge=e,ue());}function pe(){return v.size}function Oe(){ie(),ce(),he();}function Ye(){return re()+le()+pe()}export{pe as A,Oe as B,Ye as C,Ge as a,_e as b,De as c,X as d,Xe as e,Ve as f,Ue as g,N as h,ye as i,q as j,Me as k,Ie as l,ze as m,ie as n,ke as o,re as p,Re as q,Se as r,ce as s,We as t,le as u,$ as v,He as w,Ze as x,he as y,Ee as z};
1
+ import {a as a$1,e,b as b$1,y,L}from'./chunk-VMBCUUZM.mjs';import {b,a,c}from'./chunk-QPFJJPIC.mjs';import {f}from'./chunk-KNY7SXPJ.mjs';function Ge(e){return !b(e.wrapType)&&e.wrapType!=="topAndBottom"}function _e(e){return e.wrapType==="behind"}function De(e){return a(e.wrapType)?true:e.displayMode==="float"}function X(e){return b(e.wrapType)||e.wrapType==="topAndBottom"?false:c(e.wrapType)?true:e.displayMode==="float"&&e.cssFloat!=="none"}function Xe(e){return e==="left"?"right":e==="right"?"left":"bothSides"}function Ve(e){return {pageWidth:e.size.w,pageHeight:e.size.h,marginLeft:e.margins.left,marginTop:e.margins.top,contentWidth:e.size.w-e.margins.left-e.margins.right,contentHeight:e.size.h-e.margins.top-e.margins.bottom}}function Ue(e,n,t,i){let{x:r,side:o}=be(e,t,i),g=j(e,n,i);return {x:r,y:g,side:o}}function N(e,n,t){return j(e,n,t)}function be(e,n,t){let i=e.position?.horizontal;if(!i)return e.cssFloat==="right"?{x:n-e.width,side:"right"}:{x:0,side:"left"};let r=xe(i.relativeTo,n,t);if(i.align==="right")return {x:r.size?r.base+r.size-e.width:0,side:"right"};if(i.align==="left")return {x:r.base,side:"left"};if(i.align==="center")return {x:r.size?r.base+(r.size-e.width)/2:0,side:"left"};if(i.posOffset!==void 0){let o=r.base+f(i.posOffset);return {x:o,side:o>n/2?"right":"left"}}return {x:r.base,side:"left"}}function xe(e,n,t){let i=t?.pageWidth??0,r=t?.marginLeft??0;switch(e){case "page":return {base:-r,size:i};case "leftMargin":return {base:-r,size:r};case "rightMargin":return {base:n,size:r};case "character":return {base:0,size:0};default:return {base:0,size:n}}}function j(e,n,t){let i=e.position?.vertical;if(!i)return n;let r=Te(i.relativeTo,n,t);return i.align==="top"?r.base:i.align==="center"?r.size?r.base+(r.size-e.height)/2:n:i.align==="bottom"?r.size?r.base+r.size-e.height:n:i.posOffset!==void 0?r.base+f(i.posOffset):i.relativeTo==="paragraph"||i.relativeTo==="line"?n:r.base}function Te(e,n,t){let i=t?.pageHeight??0,r=t?.marginTop??0,o=t?.contentHeight??0;switch(e){case "paragraph":case "line":return {base:n,size:0};case "page":return {base:-r,size:i};case "topMargin":return {base:-r,size:r};case "bottomMargin":return {base:o,size:r};default:return {base:0,size:o}}}var V=7,U=0;function ye(e,n){if(e.kind!=="paragraph"||n.kind!=="paragraph")return "totalHeight"in n?n.totalHeight:"height"in n?n.height:0;let t=e.runs.filter(c=>c.kind!=="text"||c.text.length>0);if(!(n.lines.length===1&&t.length>0&&t.every(c=>c.kind==="image")))return n.totalHeight;let r=t.reduce((c,p)=>p.kind==="image"?Math.max(c,p.height):c,0),o=e.attrs?.spacing?.before??0,g=e.attrs?.spacing?.after??0;return o+r+g}function K(e){let n=e?.borders?.top?.width??0,t=e?.borders?.bottom?.width??0;return n+t}function q(e$1,n,t){let i=a$1(e$1.width,e$1.widthType,n),r=i??n,o=e(e$1,n),g=new Map;for(let l of b$1(e$1))g.set(`${l.rowIndex}-${l.cellIndex}`,l.columnIndex);let c=e$1.rows.map((l,s)=>({cells:l.cells.map((u,a)=>{let h=u.colSpan??1,m=g.get(`${s}-${a}`)??0,d=0;for(let b=0;b<h&&m+b<o.length;b++)d+=o[m+b]??0;d===0&&(d=(u.width&&u.width>0?u.width:a$1(u.widthValue,u.widthType,r))??100);let F=u.padding?.left??V,M=u.padding?.right??V,T=Math.max(1,d-F-M);return {blocks:u.blocks.map(b=>t(b,T)),width:d,height:0,colSpan:u.colSpan,rowSpan:u.rowSpan}}),height:0})),p=[];for(let l=0;l<c.length;l++){let s=c[l],u=e$1.rows[l]?.cells,a=0,h=0;for(let M=0;M<s.cells.length;M++){let T=s.cells[M],b=u?.[M],B=0,R=0;for(let I=0;I<T.blocks.length;I++){let z=b?.blocks[I],H=T.blocks[I];if(!z||!H)continue;let me=ye(z,H),Z=z.kind==="paragraph"?z.attrs?.spacing:void 0,E=Z?.before??0,O=Z?.after??0;B+=Math.max(R,E)+(me-E-O),R=O;}B+=R,T.height=B;let fe=b?.padding?.top??U,de=b?.padding?.bottom??U;T.height+=fe+de,(T.rowSpan??1)<=1&&(a=Math.max(a,T.height)),h=Math.max(h,K(b));}let m=e$1.rows[l],d=m?.height,F=m?.heightRule;p[l]=F==="exact"&&!!d,d&&F==="exact"?s.height=d:d?s.height=Math.max(a+h,d):s.height=a+h;}let y=c.map(l=>l.height);for(let l=0;l<c.length;l++){let s=e$1.rows[l]?.cells,u=c[l]?.cells;if(!(!s||!u))for(let a=0;a<s.length;a++){let h=s[a]?.rowSpan??1;if(h<=1)continue;let m=Math.min(l+h-1,c.length-1),d=(u[a]?.height??0)+K(s[a]),F=0;for(let b=l;b<=m;b++)F+=y[b]??0;let M=d-F;if(M<=0)continue;let T=m;for(;T>l&&p[T];)T--;p[T]||(c[T].height+=M);}}let x=c.reduce((l,s)=>l+s.height,0),f=o.reduce((l,s)=>l+s,0)||i||n;return {kind:"table",rows:c,columnWidths:o,totalWidth:f,totalHeight:x}}var Fe=4;function Me(e,n,t,i){let r=Array.isArray(n)?n[0]??0:n,o=Pe(e,r,t,i),g=o.filter(a=>a.isMarginRelative),c=o.filter(a=>!a.isMarginRelative),p=new Map;for(let a of g){let h=p.get(a.topY)??[];h.push(a),p.set(a.topY,h);}let y=Ae(c,Fe),x=[];J(y,x),J(Array.from(p.values()),x);let f=new Map;for(let a of x){let h=a.fullWidthBlock&&a.isMarginRelative?0:a.anchorBlockIndex,m=f.get(h)??[],{anchorBlockIndex:d,isMarginRelative:F,...M}=a;m.push(M),f.set(h,m);}let l=new Set(f.keys()),s=0,u=[];return e.map((a,h)=>{l.has(h)&&(s=0,u=f.get(h)??[]);let m=u.length>0?u:void 0,d=Array.isArray(n)?n[h]??r:n,F=t(a,d,m,s);return "totalHeight"in F&&(a.kind==="table"&&a.floating||(s+=F.totalHeight)),F})}function Pe(e,n,t,i){let r=[];for(let o=0;o<e.length;o++){let g=e[o];switch(g.kind){case "paragraph":we(g,o,n,r);break;case "table":ve(g,o,n,t,r);break;case "textBox":Ce(g,o,n,r,i);break}}return r}function Q(e,n,t,i,r,o){let g=0,c=0,p=e?.horizontal;if(p?.align==="left")g=t+r;else if(p?.align==="right")c=t+i;else if(p?.posOffset!==void 0){let y=f(p.posOffset);y<o/2?g=y+t+r:c=o-y+i;}else n==="left"?g=t+r:n==="right"&&(c=t+i);return y(g,c,o)}function W(e){let n=e?.vertical?.relativeTo;return n==="margin"||n==="page"}function we(e,n,t,i){for(let r of e.runs){if(r.kind!=="image")continue;let o=r;if(!X(o))continue;let g=o.distTop??0,c=o.distBottom??0,p=o.distLeft??12,y=o.distRight??12,x=0,f$1=o.position?.vertical;f$1?.align==="top"&&f$1.relativeTo==="margin"?x=0:f$1?.posOffset!==void 0&&(x=f(f$1.posOffset));let l=x+o.height,{leftMargin:s,rightMargin:u}=Q(o.position,o.cssFloat,o.width,p,y,t);(s>0||u>0)&&i.push({leftMargin:s,rightMargin:u,topY:x-g,bottomY:l+c,anchorBlockIndex:n,isMarginRelative:W(o.position)});}}function ve(e,n,t,i,r){let o=e.floating;if(!o)return;let g=q(e,t,i),c=g.totalWidth,p=g.totalHeight,y$1=o.leftFromText??12,x=o.rightFromText??12,f=o.topFromText??0,l=o.bottomFromText??0,s=0;o.tblpX!==void 0?s=o.tblpX:o.tblpXSpec?o.tblpXSpec==="left"||o.tblpXSpec==="inside"?s=0:o.tblpXSpec==="right"||o.tblpXSpec==="outside"?s=t-c:o.tblpXSpec==="center"&&(s=(t-c)/2):e.justification==="center"?s=(t-c)/2:e.justification==="right"&&(s=t-c);let u=0,a=0;s<t/2?u=s+c+x:a=t-s+y$1,{leftMargin:u,rightMargin:a}=y(u,a,t);let h=o.tblpY??0,m=h+p;r.push({leftMargin:u,rightMargin:a,topY:h-f,bottomY:m+l,anchorBlockIndex:n});}function Ce(e,n,t,i,r){if(!L(e)||b(e.wrapType))return;let o=e.width??0,g=e.height??0;if(o<=0||g<=0)return;let c=e.distTop??0,p=e.distBottom??0,y=e.distLeft??12,x=e.distRight??12;if(e.wrapType==="topAndBottom"){let a=N({height:g,position:e.position},0,r),h=a+g+p;if(h<=0)return;i.push({leftMargin:0,rightMargin:0,topY:Math.max(0,a-c),bottomY:h,anchorBlockIndex:n,isMarginRelative:W(e.position),fullWidthBlock:true});return}let f$1=0;e.position?.vertical?.posOffset!==void 0&&(f$1=f(e.position.vertical.posOffset));let l=f$1+g,{leftMargin:s,rightMargin:u}=Q(e.position,e.cssFloat,o,y,x,t);s<=0&&u<=0||i.push({leftMargin:s,rightMargin:u,topY:f$1-c,bottomY:l+p,anchorBlockIndex:n,isMarginRelative:W(e.position)});}function Ae(e,n){let t=[];for(let i of e){let r=t.find(o=>o.some(g=>Math.abs(g.anchorBlockIndex-i.anchorBlockIndex)<=n&&i.topY<g.bottomY&&i.bottomY>g.topY));r?r.push(i):t.push([i]);}return t}function J(e,n){for(let t of e){let i=Math.min(...t.map(r=>r.anchorBlockIndex));for(let r of t)n.push({...r,anchorBlockIndex:i});}}var ee=2e4,P=new Map;function te(e,n,t){return `${e}|${n}|${t||0}`}function ne(){for(;P.size>ee;){let e=P.keys().next().value;if(e===void 0)break;P.delete(e);}}function Ie(e,n,t=0){let i=te(e,n,t),r=P.get(i);if(r!==void 0)return P.delete(i),P.set(i,r),r.width}function ze(e,n,t,i){let r=te(e,n,t);P.set(r,{width:i}),ne();}function ie(){P.clear();}function ke(e){!Number.isFinite(e)||e<=0||(ee=e,ne());}function re(){return P.size}var Be=1e3,oe=Be,w=new Map;function ae(e,n,t=false,i=false){return `${e}|${n}|${t}|${i}`}function se(){for(;w.size>oe;){let e=w.keys().next().value;if(e===void 0)break;w.delete(e);}}function Re(e,n,t=false,i=false){let r=ae(e,n,t,i),o=w.get(r);if(o!==void 0)return w.delete(r),w.set(r,o),o}function Se(e,n,t,i,r){let o=ae(e,n,t,i);w.set(o,r),se();}function ce(){w.clear();}function We(e){!Number.isFinite(e)||e<=0||(oe=e,se());}function le(){return w.size}var $e=5e3,ge=$e,v=new Map;function $(e){let n=[];for(let i of e.runs)i.kind==="text"?n.push(`t:${i.text}|${i.fontFamily}|${i.fontSize}|${i.bold}|${i.italic}`):i.kind==="tab"?n.push(`tab:${i.width}`):i.kind==="image"?n.push(`img:${i.width}x${i.height}`):i.kind==="lineBreak"&&n.push("br");let t=e.attrs;if(t){t.alignment&&n.push(`align:${t.alignment}`),t.indent&&n.push(`indent:${t.indent.left}|${t.indent.right}|${t.indent.firstLine}|${t.indent.hanging}`),t.spacing&&n.push(`spacing:${t.spacing.before}|${t.spacing.after}|${t.spacing.line}|${t.spacing.lineRule}`),t.defaultFontSize!=null&&n.push(`dfs:${t.defaultFontSize}`),t.defaultFontFamily!=null&&n.push(`dff:${t.defaultFontFamily}`);let i=t.borders;if(i){let r=o=>o?`${o.width??""},${o.style??""},${o.color??""}`:"";n.push(`bdr:${r(i.top)}|${r(i.bottom)}|${r(i.left)}|${r(i.right)}`);}t.suppressEmptyParagraphHeight&&n.push("sup"),t.pPrIns&&n.push(`pins:${t.pPrIns.revisionId}`),t.pPrDel&&n.push(`pdel:${t.pPrDel.revisionId}`);}return n.join("||")}function ue(){for(;v.size>ge;){let e=v.keys().next().value;if(e===void 0)break;v.delete(e);}}function He(e,n){let t=$(e),i=v.get(t);if(i!==void 0&&i.maxWidth===n)return v.delete(t),v.set(t,i),i.measure}function Ze(e,n,t){let i=$(e);v.set(i,{measure:t,maxWidth:n}),ue();}function he(){v.clear();}function Ee(e){!Number.isFinite(e)||e<=0||(ge=e,ue());}function pe(){return v.size}function Oe(){ie(),ce(),he();}function Ye(){return re()+le()+pe()}export{pe as A,Oe as B,Ye as C,Ge as a,_e as b,De as c,X as d,Xe as e,Ve as f,Ue as g,N as h,ye as i,q as j,Me as k,Ie as l,ze as m,ie as n,ke as o,re as p,Re as q,Se as r,ce as s,We as t,le as u,$ as v,He as w,Ze as x,he as y,Ee as z};
@@ -1 +1 @@
1
- import {t,w,q,y as y$1,o}from'./chunk-4QSFBX26.mjs';import {g}from'./chunk-KNY7SXPJ.mjs';import {a}from'./chunk-QYUPLKLP.mjs';var i={runImage:"layout-run-image",blockImage:"layout-block-image",pageFloatingImage:"layout-page-floating-image",cellFloatingImage:"layout-cell-floating-image",pageContent:"layout-page-content",paragraph:"layout-paragraph"},y=[`.${i.pageFloatingImage}`,`.${i.cellFloatingImage}`,`.${i.blockImage}`,`.${i.runImage}`].join(", ");function L(n){if(!(n instanceof Element))return null;let e=n.closest(y);if(!e)return null;let o=e.dataset.pmStart;if(o===void 0)return null;let t=Number(o);return Number.isNaN(t)?null:{pos:t,imageEl:e}}function b(n){if(!(n instanceof HTMLElement))return null;if(n.tagName==="IMG"&&n.classList.contains(i.runImage))return n;let e=n.closest(y);return e&&e.dataset.pmStart?e:null}function x(n,e=1){if(!n.classList.contains(i.runImage))return;let o=n.closest(`.${i.pageContent}`),t=n.closest(`.${i.paragraph}`);if(!o||!t)return;let r=n.getBoundingClientRect(),a=o.getBoundingClientRect(),l=t.getBoundingClientRect(),p=e>0?e:1;return {horizontalEmu:Math.round(g((r.left-a.left)/p)),verticalEmu:Math.round(g((r.top-l.top)/p))}}function T(n,e){return n==="inline"?"inline":n==="behind"?"behind":n==="inFront"?"inFront":n==="square"||n==="tight"||n==="through"?e==="right"?"squareRight":"squareLeft":null}var k=[{choice:"inline",i18nLabelKey:"inLineWithText",i18nDescKey:"inLineWithText",iconHint:"inline"},{choice:"squareLeft",i18nLabelKey:"squareLeft",i18nDescKey:"squareLeft",iconHint:"squareLeft"},{choice:"squareRight",i18nLabelKey:"squareRight",i18nDescKey:"squareRight",iconHint:"squareRight"},{choice:"behind",i18nLabelKey:"behindText",i18nDescKey:"behindText",iconHint:"behind"},{choice:"inFront",i18nLabelKey:"inFrontOfText",i18nDescKey:"inFrontOfText",iconHint:"inFront"}];function I(n,e){return true}function E(n){switch(n){case "inline":return "inline";case "square":case "tight":case "through":return "squareLeft";case "topAndBottom":return "topAndBottom";case "behind":return "behind";case "inFront":return "inFront";case "wrapRight":return "squareLeft";case "wrapLeft":return "squareRight";default:return}}function X(n,e){let o=new Map;for(let t=0;t<n.length;t++){let r=n[t],a=e[t];r&&a&&o.set(String(r.id),{block:r,measure:a});}return o}var c=class{constructor(e={}){a(this,"container",null);a(this,"blockLookup",new Map);a(this,"pageStates",[]);a(this,"totalPages",0);a(this,"options");a(this,"doc");a(this,"resolvedCommentIds",new Set);this.options=e,this.doc=e.document??document;}setBlockLookup(e){this.blockLookup=e;}mount(e){this.container=e,this.applyContainerStyles();}unmount(){this.container&&(this.container.innerHTML=""),this.container=null,this.pageStates=[];}applyContainerStyles(){if(!this.container)return;let e=this.options.pageGap??24;this.container.style.display="flex",this.container.style.flexDirection="column",this.container.style.alignItems="center",this.container.style.gap=`${e}px`,this.container.style.padding=`${e}px`,this.container.style.backgroundColor=this.options.containerBackground??"var(--doc-bg, #f8f9fa)",this.container.style.minHeight="100%";}paint(e){if(!this.container)throw new Error("LayoutPainter: not mounted");let{pages:o}=e;this.totalPages=o.length,this.container.innerHTML="",this.pageStates=[];for(let t=0;t<o.length;t++){let r=o[t],a={pageNumber:r.number,totalPages:this.totalPages,section:"body",resolvedCommentIds:this.resolvedCommentIds},l=this.renderPageWithLookup(r,a);this.container.appendChild(l),this.pageStates.push({element:l,pageNumber:r.number,fragmentCount:r.fragments.length});}}renderPageWithLookup(e,o){let t=this.doc.createElement("div");t.className="layout-page",t.dataset.pageNumber=String(e.number),t.style.position="relative",t.style.width=`${e.size.w}px`,t.style.height=`${e.size.h}px`,t.style.backgroundColor=this.options.pageBackground??"var(--doc-page-bg, #ffffff)",t.style.color="var(--doc-page-text, #000000)",t.style.overflow="hidden",this.options.showShadow&&(t.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");let r=this.doc.createElement("div");r.className="layout-page-content",r.style.position="absolute",r.style.top=`${e.margins.top}px`,r.style.left=`${e.margins.left}px`,r.style.right=`${e.margins.right}px`,r.style.bottom=`${e.margins.bottom}px`,r.style.overflow="visible";for(let a of e.fragments){let l=this.renderFragmentWithLookup(a,o);this.applyFragmentPosition(l,a),r.appendChild(l);}return t.appendChild(r),t}renderFragmentWithLookup(e,o$1){let t$1=this.blockLookup.get(String(e.blockId));if(e.kind==="paragraph"&&t$1){let r=t$1.block,a=t$1.measure;return t(e,r,a,o$1,{document:this.doc})}if(e.kind==="table"&&t$1){let r=t$1.block,a=t$1.measure;return w(e,r,a,o$1,{document:this.doc})}if(e.kind==="image"&&t$1){let r=t$1.block,a=t$1.measure;return q(e,r,a,o$1,{document:this.doc})}if(e.kind==="textBox"&&t$1){let r=t$1.block,a=t$1.measure;return y$1(e,r,a,o$1,{document:this.doc})}return o(e,o$1,{document:this.doc})}applyFragmentPosition(e,o){e.style.position="absolute",e.style.left=`${o.x}px`,e.style.top=`${o.y}px`,e.style.width=`${o.width}px`,"height"in o&&(e.style.height=`${o.height}px`);}getPageCount(){return this.totalPages}getPageElement(e){return this.pageStates[e]?.element??null}scrollToPage(e){let o=this.pageStates.find(t=>t.pageNumber===e);o?.element&&o.element.scrollIntoView({behavior:"smooth",block:"start"});}};function Z(n){return new c(n)}export{i as a,L as b,b as c,x as d,T as e,k as f,I as g,E as h,X as i,c as j,Z as k};
1
+ import {t,w,q,y as y$1,o}from'./chunk-HQ76VZAN.mjs';import {g}from'./chunk-KNY7SXPJ.mjs';import {a}from'./chunk-QYUPLKLP.mjs';var i={runImage:"layout-run-image",blockImage:"layout-block-image",pageFloatingImage:"layout-page-floating-image",cellFloatingImage:"layout-cell-floating-image",pageContent:"layout-page-content",paragraph:"layout-paragraph"},y=[`.${i.pageFloatingImage}`,`.${i.cellFloatingImage}`,`.${i.blockImage}`,`.${i.runImage}`].join(", ");function L(n){if(!(n instanceof Element))return null;let e=n.closest(y);if(!e)return null;let o=e.dataset.pmStart;if(o===void 0)return null;let t=Number(o);return Number.isNaN(t)?null:{pos:t,imageEl:e}}function b(n){if(!(n instanceof HTMLElement))return null;if(n.tagName==="IMG"&&n.classList.contains(i.runImage))return n;let e=n.closest(y);return e&&e.dataset.pmStart?e:null}function x(n,e=1){if(!n.classList.contains(i.runImage))return;let o=n.closest(`.${i.pageContent}`),t=n.closest(`.${i.paragraph}`);if(!o||!t)return;let r=n.getBoundingClientRect(),a=o.getBoundingClientRect(),l=t.getBoundingClientRect(),p=e>0?e:1;return {horizontalEmu:Math.round(g((r.left-a.left)/p)),verticalEmu:Math.round(g((r.top-l.top)/p))}}function T(n,e){return n==="inline"?"inline":n==="behind"?"behind":n==="inFront"?"inFront":n==="square"||n==="tight"||n==="through"?e==="right"?"squareRight":"squareLeft":null}var k=[{choice:"inline",i18nLabelKey:"inLineWithText",i18nDescKey:"inLineWithText",iconHint:"inline"},{choice:"squareLeft",i18nLabelKey:"squareLeft",i18nDescKey:"squareLeft",iconHint:"squareLeft"},{choice:"squareRight",i18nLabelKey:"squareRight",i18nDescKey:"squareRight",iconHint:"squareRight"},{choice:"behind",i18nLabelKey:"behindText",i18nDescKey:"behindText",iconHint:"behind"},{choice:"inFront",i18nLabelKey:"inFrontOfText",i18nDescKey:"inFrontOfText",iconHint:"inFront"}];function I(n,e){return true}function E(n){switch(n){case "inline":return "inline";case "square":case "tight":case "through":return "squareLeft";case "topAndBottom":return "topAndBottom";case "behind":return "behind";case "inFront":return "inFront";case "wrapRight":return "squareLeft";case "wrapLeft":return "squareRight";default:return}}function X(n,e){let o=new Map;for(let t=0;t<n.length;t++){let r=n[t],a=e[t];r&&a&&o.set(String(r.id),{block:r,measure:a});}return o}var c=class{constructor(e={}){a(this,"container",null);a(this,"blockLookup",new Map);a(this,"pageStates",[]);a(this,"totalPages",0);a(this,"options");a(this,"doc");a(this,"resolvedCommentIds",new Set);this.options=e,this.doc=e.document??document;}setBlockLookup(e){this.blockLookup=e;}mount(e){this.container=e,this.applyContainerStyles();}unmount(){this.container&&(this.container.innerHTML=""),this.container=null,this.pageStates=[];}applyContainerStyles(){if(!this.container)return;let e=this.options.pageGap??24;this.container.style.display="flex",this.container.style.flexDirection="column",this.container.style.alignItems="center",this.container.style.gap=`${e}px`,this.container.style.padding=`${e}px`,this.container.style.backgroundColor=this.options.containerBackground??"var(--doc-bg, #f8f9fa)",this.container.style.minHeight="100%";}paint(e){if(!this.container)throw new Error("LayoutPainter: not mounted");let{pages:o}=e;this.totalPages=o.length,this.container.innerHTML="",this.pageStates=[];for(let t=0;t<o.length;t++){let r=o[t],a={pageNumber:r.number,totalPages:this.totalPages,section:"body",resolvedCommentIds:this.resolvedCommentIds},l=this.renderPageWithLookup(r,a);this.container.appendChild(l),this.pageStates.push({element:l,pageNumber:r.number,fragmentCount:r.fragments.length});}}renderPageWithLookup(e,o){let t=this.doc.createElement("div");t.className="layout-page",t.dataset.pageNumber=String(e.number),t.style.position="relative",t.style.width=`${e.size.w}px`,t.style.height=`${e.size.h}px`,t.style.backgroundColor=this.options.pageBackground??"var(--doc-page-bg, #ffffff)",t.style.color="var(--doc-page-text, #000000)",t.style.overflow="hidden",this.options.showShadow&&(t.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");let r=this.doc.createElement("div");r.className="layout-page-content",r.style.position="absolute",r.style.top=`${e.margins.top}px`,r.style.left=`${e.margins.left}px`,r.style.right=`${e.margins.right}px`,r.style.bottom=`${e.margins.bottom}px`,r.style.overflow="visible";for(let a of e.fragments){let l=this.renderFragmentWithLookup(a,o);this.applyFragmentPosition(l,a),r.appendChild(l);}return t.appendChild(r),t}renderFragmentWithLookup(e,o$1){let t$1=this.blockLookup.get(String(e.blockId));if(e.kind==="paragraph"&&t$1){let r=t$1.block,a=t$1.measure;return t(e,r,a,o$1,{document:this.doc})}if(e.kind==="table"&&t$1){let r=t$1.block,a=t$1.measure;return w(e,r,a,o$1,{document:this.doc})}if(e.kind==="image"&&t$1){let r=t$1.block,a=t$1.measure;return q(e,r,a,o$1,{document:this.doc})}if(e.kind==="textBox"&&t$1){let r=t$1.block,a=t$1.measure;return y$1(e,r,a,o$1,{document:this.doc})}return o(e,o$1,{document:this.doc})}applyFragmentPosition(e,o){e.style.position="absolute",e.style.left=`${o.x}px`,e.style.top=`${o.y}px`,e.style.width=`${o.width}px`,"height"in o&&(e.style.height=`${o.height}px`);}getPageCount(){return this.totalPages}getPageElement(e){return this.pageStates[e]?.element??null}scrollToPage(e){let o=this.pageStates.find(t=>t.pageNumber===e);o?.element&&o.element.scrollIntoView({behavior:"smooth",block:"start"});}};function Z(n){return new c(n)}export{i as a,L as b,b as c,x as d,T as e,k as f,I as g,E as h,X as i,c as j,Z as k};
@@ -0,0 +1 @@
1
+ import {r,q}from'./chunk-TXAB4I4M.mjs';var t=new r(q());t.buildSchema();t.initializeRuntime();var s=t,n=t.getSchema();export{s as a,n as b};
@@ -0,0 +1 @@
1
+ 'use strict';var chunkNKIDBERV_js=require('./chunk-NKIDBERV.js'),chunkYUHOVME2_js=require('./chunk-YUHOVME2.js'),chunkXCTYXYEU_js=require('./chunk-XCTYXYEU.js'),chunkDROCYKAR_js=require('./chunk-DROCYKAR.js'),chunkDFDL337G_js=require('./chunk-DFDL337G.js'),chunkDKUHG27E_js=require('./chunk-DKUHG27E.js'),chunkQ2VALXEU_js=require('./chunk-Q2VALXEU.js'),chunkN3Y5BUKV_js=require('./chunk-N3Y5BUKV.js'),chunkBJSG6TEG_js=require('./chunk-BJSG6TEG.js');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=chunkN3Y5BUKV_js.a(t.fontFamily).cssFallback),t.fontSize){let r=t.fontSize*96/72;e.style.fontSize=`${r}px`;}if(t.bold&&(e.style.fontWeight="bold"),t.italic&&(e.style.fontStyle="italic"),t.color&&(e.style.color=t.color),t.letterSpacing&&(e.style.letterSpacing=`${t.letterSpacing}px`),t.allCaps&&(e.style.textTransform="uppercase"),t.smallCaps&&(e.style.fontVariant="small-caps"),t.positionPx&&(e.style.verticalAlign=`${t.positionPx}px`),t.horizontalScale&&t.horizontalScale!==100&&(e.style.display="inline-block",e.style.transform=`scaleX(${t.horizontalScale/100})`,e.style.transformOrigin="left center"),t.kerningMinPt&&t.kerningMinPt>0&&(t.fontSize??11)>=t.kerningMinPt&&(e.style.fontKerning="normal"),t.emboss&&(e.style.textShadow="1px 1px 1px rgba(255,255,255,0.5), -1px -1px 1px rgba(0,0,0,0.3)"),t.imprint&&(e.style.textShadow="-1px -1px 1px rgba(255,255,255,0.5), 1px 1px 1px rgba(0,0,0,0.3)"),t.textShadow&&!t.emboss&&!t.imprint&&(e.style.textShadow="1px 1px 2px rgba(0,0,0,0.3)"),t.textOutline&&(e.style.webkitTextStroke="1px currentColor",e.style.webkitTextFillColor="transparent"),t.emphasisMark){let r=t.emphasisMark==="comma"?"filled sesame":t.emphasisMark==="circle"?"filled circle":"filled dot",a=t.emphasisMark==="underDot"?"under right":"over right";e.style.textEmphasis=`${r}`,e.style.textEmphasisPosition=a,e.style.webkitTextEmphasis=r,e.style.webkitTextEmphasisPosition=a;}t.highlight&&(e.style.backgroundColor=t.highlight);let o=[];if(t.underline&&(o.push("underline"),typeof t.underline=="object"&&(t.underline.style&&(e.style.textDecorationStyle=t.underline.style),t.underline.color&&(e.style.textDecorationColor=t.underline.color))),t.strike&&o.push("line-through"),t.commentIds&&t.commentIds.length>0){let r=t.commentIds.find(a=>!n||!n.has(a));r!=null&&(e.style.backgroundColor="rgba(255, 212, 0, 0.15)",e.style.borderBottom="1px solid rgba(255, 212, 0, 0.4)",e.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 chunkYUHOVME2_js.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)&&!chunkYUHOVME2_js.c(i)&&(r+=i.width||0);}return r}function _t(e){let n=e.createElement("canvas").getContext("2d");return (o,r=11,a="Calibri",i=false,d=false)=>{if(!n)return o.length*7;let l=chunkN3Y5BUKV_js.a(a).cssFallback,m=r*96/72,s=[];return d&&s.push("italic"),i&&s.push("bold"),s.push(`${m}px`,l),n.font=s.join(" "),n.measureText(o).width}}function 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=F.indexOf("."),x=c>=0?g(F.slice(0,c)):0,I=chunkXCTYXYEU_js.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(chunkYUHOVME2_js.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(chunkYUHOVME2_js.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=0;g?.hanging&&g.hanging>0?x=-g.hanging:g?.firstLine&&g.firstLine>0&&(x=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: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: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}=chunkXCTYXYEU_js.w(t),ze=Kt(t.attrs.listMarker,chunkXCTYXYEU_js.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){let i=n.createElement("span");return i.className="layout-list-marker",i.style.fontFamily=chunkN3Y5BUKV_js.a(o).cssFallback,i.style.fontSize=`${r*96/72}px`,i.style.textAlign="left",i.style.boxSizing="border-box",i.style.display="inline-block",i.style.minWidth=`${t}px`,i.textContent=e,a==="ins"?i.style.color="#2e7d32":a==="del"&&(i.style.color="#c62828",i.style.textDecoration="line-through"),i}function q(e,t,n){let o=t.createElement("div");o.className=n.layerClass,o.style.position="absolute",o.style.top="0",o.style.left="0",n.sizing==="inset0"?(o.style.right="0",o.style.bottom="0"):(o.style.width="100%",o.style.height="100%",o.style.overflow="hidden"),o.style.pointerEvents="none",n.layerMode==="front"&&(o.style.zIndex="10");for(let r of e){let a=t.createElement("div");a.className=n.itemClass,a.style.position="absolute",a.style.pointerEvents="auto",a.style.top=`${r.y}px`,a.style.left=`${r.x}px`,r.pmStart!==void 0&&(a.dataset.pmStart=String(r.pmStart)),r.pmEnd!==void 0&&(a.dataset.pmEnd=String(r.pmEnd));let i=t.createElement("img");i.src=r.src,i.style.width=`${r.width}px`,i.style.height=`${r.height}px`,i.style.display="block",i.style.maxWidth="none",i.style.maxHeight="none",r.alt&&(i.alt=r.alt),r.transform&&(i.style.transform=r.transform,i.style.transformOrigin="center center"),oe(r)&&re(i,r),a.appendChild(i),o.appendChild(a);}return o}function pt(e,t,n){let o=[],r=0;for(let a=0;a<e.blocks.length;a++){let i=e.blocks[a];if(i?.kind!=="paragraph"){let m=t.blocks[a];m&&m.kind==="table"&&(r+=m.totalHeight??0);continue}let d=i;for(let m of d.runs){if(m.kind!=="image")continue;let s=m;if(!chunkYUHOVME2_js.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=chunkBJSG6TEG_js.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+chunkBJSG6TEG_js.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:chunkYUHOVME2_js.e(s.cssFloat),wrapType:s.wrapType,pmStart:s.pmStart,pmEnd:s.pmEnd});}let l=t.blocks[a];l&&l.kind==="paragraph"&&(r+=l.totalHeight);}return o}function Ce(e){return !!e&&e.style!=="none"&&e.style!=="nil"&&e.width!==0}function J(e,t,n){let o=`border${t.charAt(0).toUpperCase()+t.slice(1)}`;if(!Ce(n))e.style[o]="none";else {let r=n.width??1,a=n.color??"#000000",i=n.style??"solid";e.style[o]=`${r}px ${i} ${a}`;}}function 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(chunkYUHOVME2_js.a).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(chunkYUHOVME2_js.b);u.length>0&&r.appendChild(q(u,o,{layerClass:"layout-cell-floating-images-layer",itemClass:"layout-cell-floating-image",sizing:"fullSize",layerMode:"behind"}));}let s=0,b=0;for(let u=0;u<e.blocks.length;u++){let E=e.blocks[u],y=t.blocks[u];if(E?.kind==="paragraph"&&y?.kind==="paragraph"){let p=E,w=y,F=p.attrs?.spacing,c=Math.max(b,F?.before??0);s+=c,m&&m.length>0&&(w=chunkXCTYXYEU_js.z(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=F?.after??0;}else if(E?.kind==="table"&&y?.kind==="table"){let p=E,w=y,F=b,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=0;}}b>0&&(r.style.paddingBottom=`${b}px`);let g=l.filter(u=>!chunkYUHOVME2_js.b(u));return g.length>0&&r.appendChild(q(g,o,{layerClass:"layout-cell-floating-images-layer",itemClass:"layout-cell-floating-image",sizing:"fullSize",layerMode:"front"})),r}function 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 chunkXCTYXYEU_js.b(e).map(n=>{let o=0;for(let r=0;r<n.columnIndex;r++)o+=t[r]??0;return {rowIndex:n.rowIndex,cellIndex:n.cellIndex,columnIndex:n.columnIndex,x:o,colSpan:n.colSpan,rowSpan:n.rowSpan,cell:e.rows[n.rowIndex].cells[n.cellIndex]}})}function 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??chunkDROCYKAR_js.a;i.style.padding=`${d.top}px ${d.right}px ${d.bottom}px ${d.left}px`,i.dataset.blockId=String(e.blockId),e.pmStart!==void 0&&(i.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(i.dataset.pmEnd=String(e.pmEnd));let l=e.width-d.left-d.right,m=0;for(let s=0;s<t.content.length;s++){let b=t.content[s],g=n.innerMeasures[s];if(!g)continue;let u={blockId:b.id,width:l,height:g.totalHeight,pmStart:b.pmStart,pmEnd:b.pmEnd,fromLine:0,toLine:g.lines.length},E=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=chunkN3Y5BUKV_js.a(e.font).cssFallback,o.style.userSelect="none";let r=t.size.w-t.margins.left-t.margins.right,a=e.layout==="diagonal"?r*1.3:r,i=e.fontSize!==void 0?e.fontSize*96/72:en(e.text,a);o.style.fontSize=`${i}px`,o.style.lineHeight="1",o.style.opacity=e.semitransparent?"0.5":"0.85";let d=e.layout==="diagonal"?-45:0;return o.style.transform=`translate(-50%, -50%) rotate(${d}deg)`,o.style.transformOrigin="center center",o.textContent=e.text,o}function 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?chunkBJSG6TEG_js.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 `${chunkBJSG6TEG_js.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?`${chunkBJSG6TEG_js.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"||chunkDROCYKAR_js.c(s,"renderHeaderFooterContent");}for(let m of d){let s=r.createElement("img");s.src=m.src,s.width=m.width,s.height=m.height,m.alt&&(s.alt=m.alt),s.style.position="absolute",s.style.display="block",s.style.width=`${m.width}px`,s.style.height=`${m.height}px`,s.style.maxWidth="none",s.style.maxHeight="none",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=chunkDKUHG27E_js.c(e.content,{styles:o.styles??void 0,theme:o.theme??null,defaultTabStopTwips:o.defaultTabStopTwips??null}),a=chunkNKIDBERV_js.c(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=chunkXCTYXYEU_js.X(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=chunkXCTYXYEU_js.X(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=chunkXCTYXYEU_js.X(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:chunkDFDL337G_js.x(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=chunkN3Y5BUKV_js.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?chunkBJSG6TEG_js.j(e.space):0}function we(e,t,n,o){if(!t||t.style==="none"||t.style==="nil")return;let r=chunkQ2VALXEU_js.c(t,n,o);for(let[l,m]of Object.entries(r))e.style[l]=String(m);let a=`border${n}Style`,i=`border${n}Width`;if(e.style[a]==="double"){let l=parseFloat(e.style[i]);(!Number.isFinite(l)||l<3)&&(e.style[i]="3px");}}function 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,t,n,o){let r=[];for(let a of e.runs){if(a.kind!=="image")continue;let i=a;if(!chunkYUHOVME2_js.c(i))continue;let d=i.distTop??0,l=i.distBottom??0,m=i.distLeft??12,s=i.distRight??12,{x:b,y:g,side:u}=chunkYUHOVME2_js.g(i,t,n,o);r.push({src:i.src,width:i.width,height:i.height,alt:i.alt,transform:i.transform,side:u,x:b,y:g,distTop:d,distBottom:l,distLeft:m,distRight:s,pmStart:i.pmStart,pmEnd:i.pmEnd,wrapText:chunkYUHOVME2_js.e(i.cssFloat),wrapType:i.wrapType,cropTop:i.cropTop,cropRight:i.cropRight,cropBottom:i.cropBottom,cropLeft:i.cropLeft,opacity:i.opacity});}return r}function 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=chunkYUHOVME2_js.f(e),l=d.contentWidth,m=[],s=[];for(let c of e.fragments)if(c.kind==="paragraph"&&n.blockLookup){let x=n.blockLookup.get(String(c.blockId));if(x?.block.kind==="paragraph"){let I=x.block,k=c.y-e.margins.top,S=Tn(I,k,l,d);m.push(...S);}}for(let c of m)chunkYUHOVME2_js.a(c)&&s.push({side:c.side,x:c.x,y:c.y,width:c.width,height:c.height,distTop:c.distTop,distBottom:c.distBottom,distLeft:c.distLeft,distRight:c.distRight,wrapText:c.wrapText,wrapType:c.wrapType});if(n.blockLookup)for(let c of e.fragments){if(c.kind!=="table")continue;let x=n.blockLookup.get(String(c.blockId));if(x?.block.kind!=="table")continue;let 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(!chunkXCTYXYEU_js.L(I))continue;let k=c.y-e.margins.top,S=chunkYUHOVME2_js.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,!(!chunkXCTYXYEU_js.M(I)&&!chunkXCTYXYEU_js.N(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=s.length>0?chunkXCTYXYEU_js.C(s,l):[],g=m.filter(chunkYUHOVME2_js.b),u=m.filter(c=>!chunkYUHOVME2_js.b(c));if(g.length>0){let c=q(g,o,{layerClass:"layout-floating-images-layer",itemClass:"layout-page-floating-image",sizing:"inset0",layerMode:"behind"});i.appendChild(c);}let E=c=>{if(c.kind!=="paragraph"||!n.blockLookup||!c.blockId)return;let x=n.blockLookup.get(String(c.blockId));if(x?.block.kind==="paragraph")return x.block.attrs?.borders},y,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.length>0&&(v=chunkXCTYXYEU_js.z(h,l,{floatingZones:b,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}exports.A=ht;exports.B=hn;exports.C=xn;exports.D=G;exports.E=le;exports.F=ke;exports.a=be;exports.b=Me;exports.c=an;exports.d=Ro;exports.e=ye;exports.f=dn;exports.g=cn;exports.h=Co;exports.i=He;exports.j=Eo;exports.k=Lo;exports.l=Fn;exports.m=Rn;exports.n=U;exports.o=Te;exports.p=nt;exports.q=Z;exports.r=dt;exports.s=he;exports.t=D;exports.u=q;exports.v=_;exports.w=Q;exports.x=Zt;exports.y=ee;exports.z=Pe;