@eigenpal/docx-editor-core 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/chunk-2D3UPAMA.mjs +1 -0
- package/dist/chunk-2RCMY2GE.mjs +1 -0
- package/dist/chunk-3GNIP6IX.mjs +4 -0
- package/dist/{chunk-YUKBAAB5.mjs → chunk-4S5VOHQK.mjs} +1 -1
- package/dist/chunk-5TNMVXDS.mjs +1 -0
- package/dist/{chunk-SYJAAHUK.js → chunk-6DK4UBGM.js} +1 -1
- package/dist/{chunk-ZRZ2VRQQ.mjs → chunk-6PR4XHQ3.mjs} +1 -1
- package/dist/{chunk-62NPHRTF.js → chunk-7SGC3CXJ.js} +1 -1
- package/dist/{chunk-CKXAHSJQ.js → chunk-AFMMYLPX.js} +2 -2
- package/dist/{chunk-J7ULKGU2.mjs → chunk-AGNZEOVL.mjs} +1 -1
- package/dist/{chunk-GXW7YSFL.mjs → chunk-APFTVA4F.mjs} +1 -1
- package/dist/chunk-BKHQA6JJ.js +1 -0
- package/dist/{chunk-O5X22KZ6.mjs → chunk-BOYVCOLZ.mjs} +1 -1
- package/dist/{chunk-FC6QL3E6.js → chunk-BS35CXMN.js} +1 -1
- package/dist/chunk-BTOBVF4I.mjs +1 -0
- package/dist/chunk-C2BAPYGJ.js +1 -0
- package/dist/{chunk-6ILFFGGS.js → chunk-C6GSFUV2.js} +1 -1
- package/dist/{chunk-WLQEPVDR.js → chunk-CP767TWV.js} +1 -1
- package/dist/{chunk-CWAP26GB.js → chunk-DV6IEOP5.js} +3 -3
- package/dist/{chunk-36VIYQHD.mjs → chunk-EXOP727C.mjs} +1 -1
- package/dist/{chunk-23CP3TOP.js → chunk-GFQM7PKY.js} +1 -1
- package/dist/{chunk-ZYESB4KC.mjs → chunk-LDKESXXK.mjs} +1 -1
- package/dist/chunk-LE67NTCN.mjs +1 -0
- package/dist/{chunk-WNTT4MGC.js → chunk-LTYW3NLX.js} +3 -3
- package/dist/{chunk-S7IKPRC3.js → chunk-NLTX7XVR.js} +1 -1
- package/dist/chunk-NMSU4MWP.mjs +1 -0
- package/dist/chunk-OLKDLRJ4.js +1 -0
- package/dist/chunk-P3AXSRLG.mjs +1 -0
- package/dist/{chunk-LVD6HXRF.mjs → chunk-P6RNOYAG.mjs} +1 -1
- package/dist/{chunk-VKTCTMIO.mjs → chunk-R7RR6M4A.mjs} +1 -1
- package/dist/{chunk-BGC7QKP5.mjs → chunk-RCS6UNIJ.mjs} +1 -1
- package/dist/chunk-T5RYEG2V.js +1 -0
- package/dist/chunk-TYYOBPNK.js +1 -0
- package/dist/{chunk-4EHBV73E.mjs → chunk-UCZVMHB5.mjs} +1 -1
- package/dist/{chunk-CCWOLPZE.js → chunk-V435QKZB.js} +2 -2
- package/dist/{chunk-DFZTUQ7O.js → chunk-VQ2QGHYS.js} +1 -1
- package/dist/chunk-WZP6ZHBR.js +1 -0
- package/dist/{chunk-UDPROEUK.js → chunk-XCMA7AY7.js} +1 -1
- package/dist/{chunk-DWFWYHM5.mjs → chunk-XDH55WXX.mjs} +1 -1
- package/dist/chunk-YE357WVA.js +1 -0
- package/dist/core-plugins.js +1 -1
- package/dist/core-plugins.mjs +1 -1
- package/dist/core.d.mts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/docx/index.js +1 -1
- package/dist/docx/index.mjs +1 -1
- package/dist/docx/parser.js +1 -1
- package/dist/docx/parser.mjs +1 -1
- package/dist/docx/rezip.js +1 -1
- package/dist/docx/rezip.mjs +1 -1
- package/dist/docx/serializer/index.js +1 -1
- package/dist/docx/serializer/index.mjs +1 -1
- package/dist/headless.js +1 -1
- package/dist/headless.mjs +1 -1
- package/dist/layout-bridge/index.d.mts +1 -1
- package/dist/layout-bridge/index.d.ts +1 -1
- package/dist/layout-bridge/index.js +1 -1
- package/dist/layout-bridge/index.mjs +1 -1
- package/dist/layout-bridge/measuring/index.d.mts +17 -1
- package/dist/layout-bridge/measuring/index.d.ts +17 -1
- package/dist/layout-bridge/measuring/index.js +1 -1
- package/dist/layout-bridge/measuring/index.mjs +1 -1
- package/dist/layout-bridge/tableInsertHover.js +1 -1
- package/dist/layout-bridge/tableInsertHover.mjs +1 -1
- package/dist/layout-bridge/toFlowBlocks.js +1 -1
- package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
- package/dist/layout-engine/types.d.mts +8 -4
- package/dist/layout-engine/types.d.ts +8 -4
- package/dist/layout-painter/index.js +1 -1
- package/dist/layout-painter/index.mjs +1 -1
- package/dist/layout-painter/renderPage.d.mts +7 -0
- package/dist/layout-painter/renderPage.d.ts +7 -0
- package/dist/layout-painter/renderPage.js +1 -1
- package/dist/layout-painter/renderPage.mjs +1 -1
- package/dist/mcp-cli.mjs +16 -16
- package/dist/mcp.js +3 -3
- package/dist/mcp.mjs +1 -1
- package/dist/prosemirror/commands/formatting.js +1 -1
- package/dist/prosemirror/commands/formatting.mjs +1 -1
- package/dist/prosemirror/commands/index.js +1 -1
- package/dist/prosemirror/commands/index.mjs +1 -1
- package/dist/prosemirror/commands/paragraph.js +1 -1
- package/dist/prosemirror/commands/paragraph.mjs +1 -1
- package/dist/prosemirror/conversion/fromProseDoc.js +1 -1
- package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -1
- package/dist/prosemirror/conversion/index.js +1 -1
- package/dist/prosemirror/conversion/index.mjs +1 -1
- package/dist/prosemirror/extensions/index.js +1 -1
- package/dist/prosemirror/extensions/index.mjs +1 -1
- package/dist/prosemirror/index.js +1 -1
- package/dist/prosemirror/index.mjs +1 -1
- package/dist/prosemirror/schema/index.js +1 -1
- package/dist/prosemirror/schema/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-4AJYHCPB.js +0 -2
- package/dist/chunk-6VUYFDHY.mjs +0 -1
- package/dist/chunk-7GHQ4YCJ.mjs +0 -1
- package/dist/chunk-BWHUD2XC.mjs +0 -4
- package/dist/chunk-DY2MJCSV.js +0 -1
- package/dist/chunk-G6Y4UZMJ.mjs +0 -1
- package/dist/chunk-JKVXID22.mjs +0 -1
- package/dist/chunk-LMF2ELOB.js +0 -1
- package/dist/chunk-N27FJQTG.js +0 -1
- package/dist/chunk-SUXJX72X.js +0 -1
- package/dist/chunk-T4CPTPRP.js +0 -1
- package/dist/chunk-UIROUI5I.mjs +0 -1
- package/dist/chunk-UOFQYE2L.mjs +0 -1
- package/dist/chunk-V7BKPX67.mjs +0 -2
- package/dist/chunk-Y7JZPBBW.js +0 -1
package/dist/chunk-V7BKPX67.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {d}from'./chunk-7GHQ4YCJ.mjs';import {q as q$1,g,h}from'./chunk-5N5DBQJV.mjs';import {a as a$2}from'./chunk-7E5VBRDL.mjs';import {p,r}from'./chunk-G6Y4UZMJ.mjs';import {v as v$1}from'./chunk-BWHUD2XC.mjs';import {c as c$1}from'./chunk-UIROUI5I.mjs';import {b,a,c}from'./chunk-QPFJJPIC.mjs';import {c as c$2}from'./chunk-MOKKS75W.mjs';import {a as a$1}from'./chunk-AMENZY5F.mjs';import {i,e}from'./chunk-VW22RZ6C.mjs';var _={fragment:"layout-fragment",paragraph:"layout-fragment-paragraph",table:"layout-fragment-table",image:"layout-fragment-image",line:"layout-line",run:"layout-run"};function st(e){return e.kind==="paragraph"}function lt(e){return e.kind==="table"}function dt(e){return e.kind==="image"}function ne(e){e.style.position="absolute",e.style.overflow="hidden";}function pt(e,t,n){let o=n.createElement("div");return o.className=`${_.fragment} ${_.paragraph}`,ne(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 ct(e,t,n){let o=n.createElement("div");return o.className=`${_.fragment} ${_.table}`,ne(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 gt(e,t,n){let o=n.createElement("div");return o.className=`${_.fragment} ${_.image}`,ne(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 xe(e,t,n={}){let o=n.document??document;if(st(e))return pt(e,t,o);if(lt(e))return ct(e,t,o);if(dt(e))return gt(e,t,o);let r=o.createElement("div");r.className=_.fragment,ne(r);let i=e;return i.blockId!==void 0&&(r.dataset.blockId=String(i.blockId)),i.kind&&(r.dataset.kind=i.kind),r}var E={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 W(e){return e.kind==="text"}function j(e){return e.kind==="tab"}function K(e){return e.kind==="image"}function U(e){return e.kind==="lineBreak"}function X(e){return e.kind==="field"}function Z(e){return !b(e.wrapType)&&e.wrapType!=="topAndBottom"}function G(e){return e.wrapType==="behind"}function H(e){return a(e.wrapType)?true:e.displayMode==="float"}function ft(e){return b(e.wrapType)||e.wrapType==="topAndBottom"?false:c(e.wrapType)?true:e.displayMode==="float"&&e.cssFloat!=="none"}function oe(e){return e==="left"?"right":e==="right"?"left":"bothSides"}var je={image:"layout-image",imageAnchored:"layout-image-anchored"};function q(e){return !!(e.cropTop||e.cropRight||e.cropBottom||e.cropLeft||e.opacity!=null&&e.opacity<1)}function J(e,t){let n=t.cropTop??0,o=t.cropRight??0,r=t.cropBottom??0,i=t.cropLeft??0;(n||o||r||i)&&(e.style.clipPath=`inset(${n*100}% ${o*100}% ${r*100}% ${i*100}%)`),t.opacity!=null&&t.opacity<1&&(e.style.opacity=String(Math.max(0,t.opacity)));}function re(e,t,n,o,r={}){let i=r.document??document,a=i.createElement("div");a.className=je.image,e.isAnchored&&a.classList.add(je.imageAnchored),a.style.position="absolute",a.style.width=`${e.width}px`,a.style.height=`${e.height}px`,a.style.overflow="hidden",e.zIndex!==void 0&&(a.style.zIndex=String(e.zIndex)),t.anchor?.behindDoc&&(a.style.zIndex="-1"),a.dataset.blockId=String(e.blockId),e.pmStart!==void 0&&(a.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(a.dataset.pmEnd=String(e.pmEnd));let l=i.createElement("img");if(l.src=t.src,l.alt=t.alt??"",l.style.width="100%",l.style.height="100%",l.style.objectFit="contain",l.style.display="block",t.transform&&(l.style.transform=t.transform),l.draggable=false,t.hlinkHref){let d=i.createElement("a");d.href=t.hlinkHref,d.target="_blank",d.rel="noopener noreferrer",d.style.display="block",d.style.width="100%",d.style.height="100%",d.appendChild(l),a.appendChild(d);}else a.appendChild(l);return a}function mt(e,t,n){if(t.fontFamily&&(e.style.fontFamily=a$1(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",i=t.emphasisMark==="underDot"?"under right":"over right";e.style.textEmphasis=`${r}`,e.style.textEmphasisPosition=i,e.style.webkitTextEmphasis=r,e.style.webkitTextEmphasisPosition=i;}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(i=>!n||!n.has(i));r!=null&&(e.style.backgroundColor="rgba(255, 212, 0, 0.15)",e.style.borderBottom="1px solid rgba(255, 212, 0, 0.4)",e.dataset.commentId=String(r));}t.isInsertion&&(e.style.backgroundColor="rgba(52, 168, 83, 0.08)",e.style.borderBottom="2px dashed #2e7d32",e.style.paddingBottom="1px",e.classList.add("docx-insertion"),t.changeAuthor&&(e.dataset.changeAuthor=t.changeAuthor),t.changeDate&&(e.dataset.changeDate=t.changeDate),t.changeRevisionId!=null&&(e.dataset.revisionId=String(t.changeRevisionId))),t.isDeletion&&(e.style.backgroundColor="rgba(211, 47, 47, 0.08)",e.style.color="#c62828",o.includes("line-through")||o.push("line-through"),e.style.textDecorationColor="#c62828",e.classList.add("docx-deletion"),t.changeAuthor&&(e.dataset.changeAuthor=t.changeAuthor),t.changeDate&&(e.dataset.changeDate=t.changeDate),t.changeRevisionId!=null&&(e.dataset.revisionId=String(t.changeRevisionId))),o.length>0&&(e.style.textDecorationLine=o.join(" ")),t.superscript&&(e.style.verticalAlign="super",e.style.fontSize="0.75em"),t.subscript&&(e.style.verticalAlign="sub",e.style.fontSize="0.75em"),t.hidden&&(e.classList.add("docx-hidden"),e.style.opacity="0.4",e.style.textDecoration="underline dotted"),t.rtl&&e.setAttribute("dir","rtl"),t.textEffect&&(e.classList.add("docx-text-effect",`docx-text-effect-${t.textEffect}`),e.dataset.effect=t.textEffect);}function D(e,t,n){t!==void 0&&(e.dataset.pmStart=String(t)),n!==void 0&&(e.dataset.pmEnd=String(n));}function ie(e,t,n){let o=t.createElement("span");if(o.className=`${E.run} ${E.text}`,mt(o,e,n),D(o,e.pmStart,e.pmEnd),e.hyperlink){let r=t.createElement("a");r.href=e.hyperlink.href,e.hyperlink.href.startsWith("#")||(r.target="_blank",r.rel="noopener noreferrer"),e.hyperlink.tooltip&&(r.title=e.hyperlink.tooltip),r.textContent=e.text;let i=e.color||"#0563c1";r.style.color=i,r.style.textDecoration="underline",o.style.color=i,o.appendChild(r);}else o.textContent=e.text;return o}function Te(e,t,n,o){let r=t.createElement("span");if(r.className=`${E.run} ${E.tab}`,r.style.display="inline-block",r.style.width=`${n}px`,r.style.overflow="hidden",D(r,e.pmStart,e.pmEnd),o&&o!=="none"){let i=ht(o);i&&(r.style.backgroundImage=`url("data:image/svg+xml,${encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' width='4' height='16'><text x='0' y='12' font-size='12' fill='%23000'>${i}</text></svg>`)}")`,r.style.backgroundRepeat="repeat-x",r.style.backgroundPosition="bottom");}return r.textContent="\xA0",r}function ht(e){switch(e){case "dot":return ".";case "hyphen":return "-";case "underscore":return "_";case "middleDot":return "\xB7";case "heavy":return "_";default:return null}}function Ke(e){if(!e)return 0;let t=e.match(/rotate\(([-\d.]+)deg\)/);return t?(parseFloat(t[1])%360+360)%360:0}function Ue(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)),i=Math.abs(Math.cos(o));return {w:e*i+t*r,h:e*r+t*i}}function ut(e,t){let n=t.createElement("img");n.className=`${E.run} ${E.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"),q(e)&&J(n,e);let o=Ke(e.transform);if(o!==0){let r=Ue(e.width,e.height,o),i=t.createElement("span");return i.style.display="inline-block",i.style.position="relative",i.style.width=`${r.w}px`,i.style.height=`${r.h}px`,i.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`,D(i,e.pmStart,e.pmEnd),i.appendChild(n),i}return n.style.display="inline-block",n.style.verticalAlign="middle",D(n,e.pmStart,e.pmEnd),n}function Ye(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"),q(e)&&J(o,e);let r=Ke(e.transform);if(r!==0){let i=Ue(e.width,e.height,r);n.style.height=`${i.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 D(n,e.pmStart,e.pmEnd),n.appendChild(o),n}function Se(e,t){return H(e)||e.displayMode==="block"||e.wrapType==="topAndBottom"?Ye(e,t):ut(e,t)}function we(e,t){let n=t.createElement("br");return n.className=`${E.run} ${E.lineBreak}`,D(n,e.pmStart,e.pmEnd),n}function Fe(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={text:o,bold:e.bold,italic:e.italic,underline:e.underline,strike:e.strike,color:e.color,highlight:e.highlight,fontFamily:e.fontFamily,fontSize:e.fontSize,pmStart:e.pmStart,pmEnd:e.pmEnd};return ie(r,t,n?.resolvedCommentIds)}function Xe(e,t,n){if(W(e))return ie(e,t,n?.resolvedCommentIds);if(j(e))return Te(e,t,48,void 0);if(K(e))return Se(e,t);if(U(e))return we(e,t);if(X(e)&&n)return Fe(e,t,n);let o=t.createElement("span");return o.className=E.run,o}function ke(e){return e/1440*96}function yt(e){return e/96*1440}function bt(e){let{explicitStops:t=[],defaultTabInterval:n=720,leftIndent:o=0}=e,r=t.filter(c=>c.val!=="clear").filter(c=>c.pos>=o),i=t.filter(c=>c.val==="clear").map(c=>c.pos),a=r.reduce((c,x)=>Math.max(c,x.pos),0),l=[...r];o>0&&!r.some(c=>c.pos<=o)&&(i.some(x=>Math.abs(x-o)<20)||l.push({val:"start",pos:o,leader:"none"}));let g=a>0?Math.max(a,o):o,s=o+14400;for(;g<s;){g+=n;let c=r.some(f=>Math.abs(f.pos-g)<20),x=i.some(f=>Math.abs(f-g)<20),b=o>0&&Math.abs(g-o)<20;!c&&!x&&!b&&l.push({val:"start",pos:g,leader:"none"});}return l.sort((c,x)=>c.pos-x.pos)}function Ze(e,t,n="",o,r="."){let{defaultTabInterval:i=720}=t,a=yt(e),d=bt(t).find(c=>c.pos>a);if(!d){let c=ke(i),x=c-e%c;return x<=0&&(x=c),{width:x,alignment:"default"}}let s=ke(d.pos)-e;if(d.val==="center"||d.val==="end"){let c=o?o(n):0;d.val==="center"?s-=c/2:s-=c;}else if(d.val==="decimal"){let c=n.indexOf(r);if(c>=0&&o){let x=n.slice(0,c),b=o(x);s-=b;}}else if(d.val==="bar")return {width:0,leader:d.leader,alignment:"bar"};if(s<1){let c=ke(i),x=c-e%c;return x<=0&&(x=c),{width:x,alignment:"default"}}return {width:s,leader:d.leader,alignment:d.val}}function qe(e,t){let n=[],o=e.runs;for(let r=t.fromRun;r<=t.toRun;r++){let i=o[r];if(i)if(W(i)){let a=r===t.fromRun?t.fromChar:0,l=r===t.toRun?t.toChar:i.text.length;if(a>0||l<i.text.length){let d=i.text.slice(a,l);n.push({...i,text:d,pmStart:i.pmStart!==void 0?i.pmStart+a:void 0,pmEnd:i.pmStart!==void 0?i.pmStart+l:void 0});}else n.push(i);}else n.push(i);}return n}function xt(e){return [e.pmStart??"no-start",e.pmEnd??"no-end",e.src,e.width,e.height,e.displayMode??"inline",e.wrapType??"none"].join("|")}function Tt(e){return {val:e.val,pos:e.pos,leader:e.leader}}function St(e,t,n){let o="";for(let r=t+1;r<e.length;r++){let i=e[r];if(W(i))o+=i.text;else if(X(i))i.fieldType==="PAGE"&&n?o+=String(n.pageNumber):i.fieldType==="NUMPAGES"&&n?o+=String(n.totalPages):o+=i.fallback??"";else if(j(i)||U(i))break}return o}function wt(e){let n=e.createElement("canvas").getContext("2d");return (o,r=11,i="Calibri")=>{if(!n)return o.length*7;let a=a$1(i).cssFallback,l=r*96/72;return n.font=`${l}px ${a}`,n.measureText(o).width}}function ae(e,t,n,o,r){let i=o.createElement("div");i.className=E.line,i.style.height=`${t.lineHeight}px`,i.style.lineHeight=`${t.lineHeight}px`;let a=qe(e,t);if(a.length===1&&K(a[0])){let p=a[0].position?.horizontal?.align??n;i.style.display="flex",i.style.alignItems="center",i.style.justifyContent=p==="center"?"center":p==="right"?"flex-end":"flex-start";}if(a.length===0){let h=o.createElement("span");return h.className=`${E.run} layout-empty-run`,h.innerHTML=" ",i.appendChild(h),i}let l=n==="justify",d=false;l&&r&&(d=!r.isLastLine||r.paragraphEndsWithLineBreak,d&&(i.style.textAlign="justify",i.style.textAlignLast="justify",i.style.width=`${r.availableWidth}px`)),i.style.whiteSpace="pre";let g=a.some(h=>W(h)&&h.highlight);i.style.overflow=g?"hidden":"visible";let s=a.some(j),c,x=wt(o);if(s){let h=r?.tabStops?.map(Tt),m=r?.leftIndentPx?Math.round(r.leftIndentPx*15):0;c={explicitStops:h,leftIndent:m};}let b=0,f=r?.leftIndentPx??0;if(r?.isFirstLine){let h=r?.firstLineIndentPx??0;b=f+h;}else b=f;for(let h=0;h<a.length;h++){let m=a[h];if(j(m)&&c){let p=St(a,h,r?.context),y=Ze(b,c,p,x),u=Te(m,o,y.width,y.leader);i.appendChild(u),b+=y.width;}else if(W(m)){let p=ie(m,o,r?.context?.resolvedCommentIds);if(m.highlight){let F=(m.fontSize?m.fontSize*96/72:14.67)*1.2,S=Math.max(0,t.lineHeight-F);if(S>0){let I=S/2;p.style.paddingTop=`${I}px`,p.style.paddingBottom=`${I}px`;}}i.appendChild(p);let y=m.fontSize||11,u=m.fontFamily||"Calibri";b+=x(m.text,y,u);}else if(K(m)){if(H(m))continue;let p=xt(m);if(r?.renderedInlineImageKeys?.has(p))continue;r?.renderedInlineImageKeys?.add(p);let y=Se(m,o);i.appendChild(y),m.displayMode!=="block"&&m.wrapType!=="topAndBottom"&&(b+=m.width);}else if(U(m)){let p=we(m,o);i.appendChild(p);}else if(X(m)&&r?.context){let p=Fe(m,o,r.context);i.appendChild(p);let y=m.fallback??"";m.fieldType==="PAGE"?y=String(r.context.pageNumber):m.fieldType==="NUMPAGES"&&(y=String(r.context.totalPages));let u=m.fontSize||11,w=m.fontFamily||"Calibri";b+=x(y,u,w);}else {let p=Xe(m,o,r?.context);i.appendChild(p);}}return i}function Q(e,t){return !e&&!t?true:!e||!t?false:e.style===t.style&&e.width===t.width&&e.color===t.color}function Je(e,t){return !e&&!t||!e||!t?false:Q(e.top,t.top)&&Q(e.bottom,t.bottom)&&Q(e.left,t.left)&&Q(e.right,t.right)&&Q(e.between,t.between)}function v(e,t,n,o,r={}){let i=r.document??document,a=i.createElement("div");a.className=E.fragment,a.style.position=o.positioning==="absolute"?"absolute":"relative",a.dataset.blockId=String(e.blockId),a.dataset.fromLine=String(e.fromLine),a.dataset.toLine=String(e.toLine),D(a,e.pmStart,e.pmEnd),e.continuesFromPrev&&(a.dataset.continuesFromPrev="true"),e.continuesOnNext&&(a.dataset.continuesOnNext="true");let l=n.lines.slice(e.fromLine,e.toLine),d=t.attrs?.alignment;t.attrs?.styleId&&(a.dataset.styleId=t.attrs.styleId);let g=t.attrs?.bidi;g&&(a.dir="rtl"),d?d==="center"?a.style.textAlign="center":d==="right"?a.style.textAlign="right":d==="left"?a.style.textAlign="left":a.style.textAlign=g?"right":"left":g&&(a.style.textAlign="right");let s=t.attrs?.indent,c=0,x=0;s&&(g?(s.left&&s.left>0&&(x=s.left),s.right&&s.right>0&&(c=s.right)):(s.left&&s.left>0&&(c=s.left),s.right&&s.right>0&&(x=s.right)));let b=t.attrs?.borders;if(b){let w=R=>{switch(R){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"}};a.style.boxSizing="border-box";let F=R=>`${R.width}px ${w(R.style)} ${R.color}`,S=Je(r.prevBorders,b),I=Je(b,r.nextBorders),C=S?b.between:b.top,T=I?void 0:b.bottom,k=i.createElement("div");if(k.className="layout-paragraph-border",k.style.position="absolute",k.style.pointerEvents="none",k.style.boxSizing="border-box",k.style.left=`${c-(b.left?.space??0)}px`,k.style.right=`${x-(b.right?.space??0)}px`,k.style.top=`${-(C?.space??0)}px`,k.style.bottom=`${-(T?.space??0)}px`,C&&(k.style.borderTop=F(C)),T&&(k.style.borderBottom=F(T)),b.left&&(k.style.borderLeft=F(b.left)),b.right&&(k.style.borderRight=F(b.right)),(C||T||b.left||b.right)&&a.appendChild(k),b.bar){let R=i.createElement("div");R.style.position="absolute",R.style.left="-8px",R.style.top="0",R.style.bottom="0",R.style.borderLeft=F(b.bar),a.style.position="relative",a.appendChild(R);}}t.attrs?.shading&&(a.style.backgroundColor=t.attrs.shading);let f=e.width-c-x,m=t.runs[t.runs.length-1]?.kind==="lineBreak",p=n.lines.length,y=0;s?.hanging&&s.hanging>0?y=-s.hanging:s?.firstLine&&s.firstLine>0&&(y=s.firstLine);let u=r.renderedInlineImageKeys??new Set;for(let w=0;w<l.length;w++){let F=l[w],S=e.fromLine+w,I=S===p-1,C=S===0&&!e.continuesFromPrev,T=F.leftOffset??0,k=F.rightOffset??0,P=f;if(C){let B=s?.hanging&&s.hanging>0,L=s?.firstLine&&s.firstLine>0;B&&s?.hanging?P=f+s.hanging:L&&s?.firstLine&&(P=f-s.firstLine);}if(Ft(F,t)){let B=i.createElement("div");B.className=`${E.line} layout-line-split`,B.style.position="relative",B.style.height=`${F.lineHeight}px`,B.style.lineHeight=`${F.lineHeight}px`;for(let L of F.segments){let he={fromRun:L.fromRun,fromChar:L.fromChar,toRun:L.toRun,toChar:L.toChar,width:L.width,ascent:F.ascent,descent:F.descent,lineHeight:F.lineHeight},O=ae(t,he,d,i,{availableWidth:L.availableWidth,isLastLine:I,isFirstLine:C,paragraphEndsWithLineBreak:m,tabStops:t.attrs?.tabs,leftIndentPx:c,firstLineIndentPx:C?y:0,context:o,renderedInlineImageKeys:u});O.className+=" layout-line-segment",O.style.position="absolute",O.style.left=`${L.leftOffset}px`,O.style.top="0",O.style.width=`${L.availableWidth}px`,B.appendChild(O);}a.appendChild(B);continue}let R=ae(t,F,d,i,{availableWidth:P-T-k,isLastLine:I,isFirstLine:C,paragraphEndsWithLineBreak:m,tabStops:t.attrs?.tabs,leftIndentPx:c,firstLineIndentPx:C?y:0,context:o,renderedInlineImageKeys:u});if(T>0||k>0){T>0&&(R.style.marginLeft=`${T}px`),k>0&&(R.style.marginRight=`${k}px`);let B=P-T-k;B>0&&(R.style.width=`${B}px`);}let Be=s?.hanging&&s.hanging>0,Me=s?.firstLine&&s.firstLine>0;if(C?c>0&&Be?(R.style.paddingLeft=`${c}px`,R.style.textIndent=`-${s.hanging}px`):c>0&&Me?(R.style.paddingLeft=`${c}px`,R.style.textIndent=`${s.firstLine}px`):c>0?R.style.paddingLeft=`${c}px`:Me&&(R.style.textIndent=`${s.firstLine}px`):c>0?R.style.paddingLeft=`${c}px`:Be&&(R.style.paddingLeft=`${s.hanging}px`),x>0&&(R.style.paddingRight=`${x}px`),C&&t.attrs?.listMarker&&!t.attrs?.listMarkerHidden){let B=Math.max(0,c-(s?.hanging??0));R.style.paddingLeft=`${B}px`,R.style.textIndent="0";let L;if(!t.attrs.listMarkerFontFamily||!t.attrs.listMarkerFontSize)for(let $=F.fromRun;$<=F.toRun;$++){let ue=t.runs[$];if(ue&&ue.kind==="text"){L=ue;break}}let he=t.attrs.listMarkerFontFamily??L?.fontFamily??t.attrs.defaultFontFamily,O=t.attrs.listMarkerFontSize??L?.fontSize??t.attrs.defaultFontSize,ve=kt(t.attrs.listMarker,s,i,he,O);if((s?.hanging??0)>0)R.insertBefore(ve,R.firstChild);else {let $=i.createElement("div");$.className="layout-line layout-list-marker-line",$.style.height=`${F.lineHeight}px`,$.style.lineHeight=`${F.lineHeight}px`,$.appendChild(ve),a.appendChild($);}}a.appendChild(R);}return a}function Ft(e,t){return (e.segments?.length??0)>1&&!t.attrs?.listMarker}function kt(e,t,n,o,r){let i=n.createElement("span");if(i.className="layout-list-marker",o&&(i.style.fontFamily=a$1(o).cssFallback),r){let l=r*96/72;i.style.fontSize=`${l}px`;}i.textContent=e,i.style.textAlign="left",i.style.boxSizing="border-box";let a=t?.hanging??0;return i.style.display="inline-block",a>0&&(i.style.minWidth=`${a}px`),i}function V(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 i=t.createElement("div");i.className=n.itemClass,i.style.position="absolute",i.style.pointerEvents="auto",i.style.top=`${r.y}px`,i.style.left=`${r.x}px`,r.pmStart!==void 0&&(i.dataset.pmStart=String(r.pmStart)),r.pmEnd!==void 0&&(i.dataset.pmEnd=String(r.pmEnd));let a=t.createElement("img");a.src=r.src,a.style.width=`${r.width}px`,a.style.height=`${r.height}px`,a.style.display="block",r.alt&&(a.alt=r.alt),r.transform&&(a.style.transform=r.transform,a.style.transformOrigin="center center"),q(r)&&J(a,r),i.appendChild(a),o.appendChild(i);}return o}var A={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 It(e$1,t,n){let o=[],r=0;for(let i=0;i<e$1.blocks.length;i++){let a=e$1.blocks[i];if(a?.kind!=="paragraph"){let g=t.blocks[i];g&&g.kind==="table"&&(r+=g.totalHeight??0);continue}let l=a;for(let g of l.runs){if(g.kind!=="image")continue;let s=g;if(!H(s))continue;let c=s.position,x=s.distTop??0,b=s.distBottom??0,f=s.distLeft??12,h=s.distRight??12,m="left",p=0;if(c?.horizontal){let u=c.horizontal;u.align==="right"?(m="right",p=n-s.width):u.align==="left"?p=0:u.align==="center"?p=(n-s.width)/2:u.posOffset!==void 0&&(p=e(u.posOffset),m=p>n/2?"right":"left");}else s.cssFloat==="right"&&(m="right",p=n-s.width);let y=r;if(c?.vertical){let u=c.vertical;u.posOffset!==void 0?y=r+e(u.posOffset):u.align==="top"&&(y=0);}p=Math.max(0,Math.min(p,n-s.width)),o.push({src:s.src,width:s.width,height:s.height,alt:s.alt,transform:s.transform,x:p,y,side:m,distTop:x,distBottom:b,distLeft:f,distRight:h,wrapText:oe(s.cssFloat),wrapType:s.wrapType,pmStart:s.pmStart,pmEnd:s.pmEnd});}let d=t.blocks[i];d&&d.kind==="paragraph"&&(r+=d.totalHeight);}return o}function Rt(e,t,n,o){let r$1=o.createElement("div");r$1.className=A.cellContent,r$1.style.position="relative";let i=e.padding?.left??7,a=e.padding?.right??7,l=Math.max(0,t.width-i-a);r$1.style.width=`${l}px`;let d=It(e,t,l),g;if(d.length>0){g=d.filter(Z).map(f=>{let h=f.x+f.width+f.distRight,m=f.y-f.distTop,p=f.y+f.height+f.distBottom,y=0,u=0,w=f.wrapText??"bothSides";return w==="right"?y=h:w==="left"?u=l-(f.x-f.distLeft):f.side==="left"?y=h:u=l-(f.x-f.distLeft),{leftMargin:y,rightMargin:u,topY:m,bottomY:p}});let b=d.filter(G);b.length>0&&r$1.appendChild(V(b,o,{layerClass:"layout-cell-floating-images-layer",itemClass:"layout-cell-floating-image",sizing:"fullSize",layerMode:"behind"}));}let s=0,c=0;for(let b=0;b<e.blocks.length;b++){let f=e.blocks[b],h=t.blocks[b];if(f?.kind==="paragraph"&&h?.kind==="paragraph"){let m=f,p=h,y=m.attrs?.spacing,u=Math.max(c,y?.before??0);s+=u,g&&g.length>0&&(p=r(m,l,{floatingZones:g,paragraphYOffset:s}));let w={blockId:m.id,width:l,height:p.totalHeight,fromLine:0,toLine:p.lines.length,pmStart:m.pmStart,pmEnd:m.pmEnd},F={...n,insideTableCell:true},S=v(w,m,p,F,{document:o});S.style.position="relative",u>0&&(S.style.marginTop=`${u}px`),r$1.appendChild(S),s+=p.totalHeight,c=y?.after??0;}else if(f?.kind==="table"&&h?.kind==="table"){let m=f,p=h,y=c,u=Ct(m,p,n,o);u.style.position="relative",y>0&&(u.style.marginTop=`${y}px`),r$1.appendChild(u),s+=y+(h.totalHeight??0),c=0;}}c>0&&(r$1.style.paddingBottom=`${c}px`);let x=d.filter(b=>!G(b));return x.length>0&&r$1.appendChild(V(x,o,{layerClass:"layout-cell-floating-images-layer",itemClass:"layout-cell-floating-image",sizing:"fullSize",layerMode:"front"})),r$1}function Ct(e,t,n,o){let r=o.createElement("div");r.className=`${A.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 i=[],a=0;for(let g=0;g<t.rows.length;g++)i.push(a),a+=t.rows[g]?.height??0;i.push(a);let l=new Map,d=0;for(let g=0;g<e.rows.length;g++){let s=e.rows[g],c=t.rows[g];if(!s||!c)continue;let x=Ie(s,c,g,d,t.columnWidths,e.rows.length,n,o,l,i);r.appendChild(x),d+=c.height;}return r.style.height=`${d}px`,r}function se(e,t,n){let o=`border${t.charAt(0).toUpperCase()+t.slice(1)}`;if(!n||n.style==="none"||n.style==="nil"||n.width===0)e.style[o]="none";else {let r=n.width??1,i=n.color??"#000000",a=n.style??"solid";e.style[o]=`${r}px ${a} ${i}`;}}function Pt(e,t,n,o,r,i,a){let l=a.createElement("div");l.className=A.cell,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 d=e.padding?.top??1,g=e.padding?.right??7,s=e.padding?.bottom??1,c=e.padding?.left??7;if(l.style.padding=`${d}px ${g}px ${s}px ${c}px`,e.borders&&(r.isFirstRow&&se(l,"top",e.borders.top),se(l,"right",e.borders.right),se(l,"bottom",e.borders.bottom),r.isFirstCol&&se(l,"left",e.borders.left)),e.background&&(l.style.backgroundColor=e.background),e.noWrap&&(l.style.whiteSpace="nowrap"),e.verticalAlign)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 x=Rt(e,t,i,a);if(l.appendChild(x),e.blocks.length>0){let b=e.blocks[0],f=e.blocks[e.blocks.length-1];b&&"pmStart"in b&&b.pmStart!==void 0&&(l.dataset.pmStart=String(b.pmStart)),f&&"pmEnd"in f&&f.pmEnd!==void 0&&(l.dataset.pmEnd=String(f.pmEnd));}return l}function Ie(e,t,n,o,r,i,a,l,d,g,s){let c=l.createElement("div");c.className=A.row,c.style.position="absolute",c.style.left="0",c.style.top=`${o}px`,c.style.width="100%",c.style.height=`${t.height}px`,c.dataset.rowIndex=String(n);let x=new Set;if(d){for(let[,h]of d)if(h.startRow<n&&h.startRow+h.rowSpan>n)for(let m=0;m<h.colSpan;m++)x.add(h.columnIndex+m);}let b=0,f=0;for(;x.has(f);)b+=r[f]??0,f++;for(let h=0;h<e.cells.length;h++){let m=e.cells[h],p=t.cells[h];if(!m||!p)continue;let y=m.colSpan??1,u=m.rowSpan??1,w=t.height;if(u>1&&g){w=0;for(let k=n;k<n+u&&k<g.length-1;k++)w+=(g[k+1]??0)-(g[k]??0);w===0&&(w=t.height*u);}let F=n===0||s===true,I=f===0;f+y>=r.length;let T=Pt(m,p,b,w,{isFirstRow:F,isFirstCol:I},a,l);if(T.dataset.cellIndex=String(h),T.dataset.columnIndex=String(f),u>1&&(T.dataset.rowSpan=String(u)),c.appendChild(T),u>1&&d){let k=`${n}-${f}`;d.set(k,{cell:m,cellMeasure:p,columnIndex:f,startRow:n,rowSpan:u,colSpan:y,x:b,totalHeight:w});}for(let k=0;k<y&&f+k<r.length;k++)b+=r[f+k]??0;for(f+=y;x.has(f);)b+=r[f]??0,f++;}return c}function Y(e,t,n,o,r={}){let i=r.document??document,a=i.createElement("div");a.className=A.table,a.style.position=o.positioning==="flow"?"relative":"absolute",a.style.width=`${e.width}px`,a.style.height=`${e.height}px`,a.style.overflow="hidden",a.dataset.blockId=String(e.blockId),a.dataset.fromRow=String(e.fromRow),a.dataset.toRow=String(e.toRow),e.pmStart!==void 0&&(a.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(a.dataset.pmEnd=String(e.pmEnd));let l=0;for(let f=0;f<n.columnWidths.length-1;f++){l+=n.columnWidths[f]??0;let h=i.createElement("div");h.className=A.resizeHandle,h.style.position="absolute",h.style.left=`${l-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)),a.appendChild(h);}let d=[],g=0;for(let f=0;f<n.rows.length;f++)d.push(g),g+=n.rows[f]?.height??0;d.push(g);let s=new Map,c=e.headerRowCount??0,x=0;if(c>0&&e.continuesFromPrev)for(let f=0;f<c;f++){let h=t.rows[f],m=n.rows[f];if(!h||!m)continue;let p=Ie(h,m,f,x,n.columnWidths,t.rows.length,o,i,s,d,f===0);p.dataset.repeatedHeader="true",a.appendChild(p),x+=m.height;}for(let f=e.fromRow;f<e.toRow;f++){let h=t.rows[f],m=n.rows[f];if(!h||!m)continue;let p=c>0&&e.continuesFromPrev?false:e.continuesFromPrev&&f===e.fromRow,y=Ie(h,m,f,x,n.columnWidths,t.rows.length,o,i,s,d,p);a.appendChild(y),x+=m.height;}let b=0;for(let f=e.fromRow;f<e.toRow;f++)if(b+=n.rows[f]?.height??0,f<e.toRow-1){let h=i.createElement("div");h.className=A.rowResizeHandle,h.style.position="absolute",h.style.left="0",h.style.top=`${b-3}px`,h.style.width="100%",h.style.height="6px",h.style.cursor="row-resize",h.style.zIndex="10",h.dataset.rowIndex=String(f),h.dataset.tableBlockId=String(e.blockId),e.pmStart!==void 0&&(h.dataset.tablePmStart=String(e.pmStart)),a.appendChild(h);}if(e.toRow===t.rows.length){let f=i.createElement("div");f.className=A.tableEdgeHandleBottom,f.style.position="absolute",f.style.left="0",f.style.top=`${b-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)),a.appendChild(f);}if(e.toRow===t.rows.length){let f=n.columnWidths.reduce((m,p)=>m+p,0),h=i.createElement("div");h.className=A.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)),a.appendChild(h);}return a}var Et={textBox:"layout-textbox"};function le(e,t,n,o,r={}){let i=r.document??document,a=i.createElement("div");if(a.className=Et.textBox,a.style.position="absolute",a.style.width=`${e.width}px`,a.style.height=`${e.height}px`,a.style.overflow="hidden",a.style.boxSizing="border-box",Lt(a,e),t.fillColor&&(a.style.backgroundColor=t.fillColor),t.outlineWidth&&t.outlineWidth>0){let s=t.outlineStyle||"solid",c=t.outlineColor||"#000000";a.style.border=`${t.outlineWidth}px ${s} ${c}`;}let l=t.margins??a$2;a.style.padding=`${l.top}px ${l.right}px ${l.bottom}px ${l.left}px`,a.dataset.blockId=String(e.blockId),e.pmStart!==void 0&&(a.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(a.dataset.pmEnd=String(e.pmEnd));let d=e.width-l.left-l.right,g=0;for(let s=0;s<t.content.length;s++){let c=t.content[s],x=n.innerMeasures[s];if(!x)continue;let b={blockId:c.id,width:d,height:x.totalHeight,pmStart:c.pmStart,pmEnd:c.pmEnd,fromLine:0,toLine:x.lines.length},f=v(b,c,x,{...o,positioning:"flow"},{document:i});a.appendChild(f),g+=x.totalHeight;}return a}function Lt(e,t){!t.isFloating&&t.zIndex===void 0||(e.style.zIndex=String(t.zIndex??10));}function Qe(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 Re(e,t,n,o){let{x:r,side:i}=Bt(e,n,o),a=vt(e,t,o);return {x:r,y:a,side:i}}function Bt(e$1,t,n){let o=e$1.position?.horizontal;if(!o)return e$1.cssFloat==="right"?{x:t-e$1.width,side:"right"}:{x:0,side:"left"};let r=Mt(o.relativeTo,t,n);if(o.align==="right")return {x:r.size?r.base+r.size-e$1.width:0,side:"right"};if(o.align==="left")return {x:r.base,side:"left"};if(o.align==="center")return {x:r.size?r.base+(r.size-e$1.width)/2:0,side:"left"};if(o.posOffset!==void 0){let i=r.base+e(o.posOffset);return {x:i,side:i>t/2?"right":"left"}}return {x:r.base,side:"left"}}function Mt(e,t,n){let o=n?.pageWidth??0,r=n?.marginLeft??0;switch(e){case "page":return {base:-r,size:o};case "leftMargin":return {base:-r,size:r};case "rightMargin":return {base:t,size:r};case "character":return {base:0,size:0};default:return {base:0,size:t}}}function vt(e$1,t,n){let o=e$1.position?.vertical;if(!o)return t;let r=$t(o.relativeTo,t,n);return o.align==="top"?r.base:o.align==="center"?r.size?r.base+(r.size-e$1.height)/2:t:o.align==="bottom"?r.size?r.base+r.size-e$1.height:t:o.posOffset!==void 0?r.base+e(o.posOffset):o.relativeTo==="paragraph"||o.relativeTo==="line"?t:r.base}function $t(e,t,n){let o=n?.pageHeight??0,r=n?.marginTop??0,i=n?.contentHeight??0;switch(e){case "paragraph":case "line":return {base:t,size:0};case "page":return {base:-r,size:o};case "topMargin":return {base:-r,size:r};case "bottomMargin":return {base:i,size:r};default:return {base:0,size:i}}}function et(e){return e?.align??e?.alignment}function Ht(e$1,t){let n=e$1.position.vertical;if(!n)return e$1.paragraphY;let o=et(n),r=n.posOffset!==void 0?e(n.posOffset):void 0;if(n.relativeTo==="page"){if(r!==void 0)return r-t.flowTop;if(o==="top")return -t.flowTop;if(o==="bottom")return t.pageHeight-e$1.height-t.flowTop;if(o==="center")return (t.pageHeight-e$1.height)/2-t.flowTop}if(n.relativeTo==="margin"){let i=t.margins.top,a=t.pageHeight-t.margins.top-t.margins.bottom;if(r!==void 0)return i+r-t.flowTop;if(o==="top")return i-t.flowTop;if(o==="bottom")return i+a-e$1.height-t.flowTop;if(o==="center")return i+(a-e$1.height)/2-t.flowTop}return r!==void 0?e$1.paragraphY+r:e$1.paragraphY}function At(e$1,t,n){let o=t.position.horizontal;if(!o){e$1.style.left="0";return}let r=et(o);if(o.relativeTo==="page"){if(o.posOffset!==void 0){e$1.style.left=`${e(o.posOffset)-n.flowLeft}px`;return}if(r==="right"){e$1.style.left=`${n.pageWidth-t.width-n.flowLeft}px`;return}if(r==="center"){e$1.style.left=`${(n.pageWidth-t.width)/2-n.flowLeft}px`;return}if(r==="left"){e$1.style.left=`${-n.flowLeft}px`;return}}if(o.posOffset!==void 0){e$1.style.left=`${e(o.posOffset)}px`;return}if(r==="right"){e$1.style.left=`${n.contentWidth-t.width}px`;return}if(r==="center"){e$1.style.left=`${(n.contentWidth-t.width)/2}px`;return}e$1.style.left="0";}function tt(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 Ce(e,t,n,o){let r=n.document??document,i=r.createElement("div");i.style.position="relative";let a=t.contentWidth??600,l=[],d=0;for(let g=0;g<e.blocks.length;g++){let s=e.blocks[g],c=e.measures[g];if(!(!s||!c)){if(s.kind==="paragraph"&&c.kind==="paragraph"){let x=s,b=c,f=x.attrs?.spacing?.before??0,h=d,m=[];for(let w of x.runs)if(w.kind==="image"&&"position"in w&&w.position){let F=w;l.push({src:F.src,width:F.width,height:F.height,alt:F.alt,paragraphY:h,position:F.position});}else m.push(w);let p={...x,runs:m},y={blockId:x.id,width:a,height:b.totalHeight,fromLine:0,toLine:b.lines.length},u=v(y,p,b,{...t,positioning:"absolute"},{document:r});u.style.top=`${d+f}px`,u.style.left="0",u.style.width=`${a}px`,i.appendChild(u),d+=b.totalHeight;}else if(s.kind==="table"&&c.kind==="table"){let x={blockId:s.id,width:c.totalWidth,height:c.totalHeight,fromRow:0,toRow:c.rows.length,pmStart:s.pmStart,pmEnd:s.pmEnd},b=Y(x,s,c,{...t,positioning:"absolute"},{document:r});if(s.floating){let{left:f,top:h}=tt(s.floating,o);b.style.top=`${h}px`,b.style.left=`${f}px`,i.appendChild(b);}else b.style.top=`${d}px`,b.style.left="0",i.appendChild(b),d+=c.totalHeight;}}}for(let g of l){let s=r.createElement("img");s.src=g.src,s.width=g.width,s.height=g.height,g.alt&&(s.alt=g.alt),s.style.position="absolute",s.style.display="block",s.style.width=`${g.width}px`,s.style.height=`${g.height}px`,s.style.maxWidth="none",s.style.maxHeight="none",At(s,g,o),s.style.top=`${Ht(g,o)}px`,i.appendChild(s);}return i}var de=12,nt=6;function zt(e,t){if(e.size!==t.size)return false;for(let[n,o]of e)if(t.get(n)!==o)return false;return true}var Pe=8;function jn(e){let t=[];for(let n of e)if(n.kind==="paragraph")for(let o of n.runs)o.kind==="text"&&o.footnoteRefId!=null&&t.push({footnoteId:o.footnoteRefId,pmPos:o.pmStart??0});return t}function Ee(e,t){let n=new Map;if(t.length===0)return n;for(let o of t)for(let r of e){let i=false;for(let a of r.fragments){let l=a.pmStart??-1,d=a.pmEnd??-1;if(l>=0&&d>=0&&o.pmPos>=l&&o.pmPos<d){let g=n.get(r.number)??[];g.includes(o.footnoteId)||g.push(o.footnoteId),n.set(r.number,g),i=true;break}}if(i)break}return n}function Ot(e,t){if(e.length===0)return [{kind:"paragraph",id:`fn-empty-${t}`,runs:[{kind:"text",text:`${t} `,fontSize:Pe,superscript:true}]}];let n=e.map(r=>{if(r.kind!=="paragraph")return r;let i=r;return {...i,runs:i.runs.map(a=>(a.kind==="text"||a.kind==="tab")&&a.fontSize==null?{...a,fontSize:Pe}:a)}}),o=n[0];if(o.kind==="paragraph"){let r={kind:"text",text:`${t} `,fontSize:Pe,superscript:true};n[0]={...o,runs:[r,...o.runs]};}return n}function Nt(e,t,n,o){let r=c$1(e.content,{styles:o.styles??void 0,theme:o.theme??null}),i=d(r,{theme:o.theme??void 0}),a=Ot(i,t),l=o.measureBlocks(a,n),d$1=l.reduce((g,s)=>s.kind==="paragraph"||s.kind==="table"?g+s.totalHeight:s.kind==="image"||s.kind==="textBox"?g+s.height:g,0);return {id:e.id,displayNumber:t,blocks:a,measures:l,height:d$1}}function Yn(e,t,n,o){let r=new Map,i=new Map;for(let d of e)(d.noteType==="normal"||d.noteType==null)&&i.set(d.id,d);let a=1,l=new Set;for(let d of t){if(l.has(d.footnoteId))continue;l.add(d.footnoteId);let g=i.get(d.footnoteId);g&&(r.set(d.footnoteId,Nt(g,a,n,o)),a++);}return r}function ot(e,t){let n=new Map;for(let[o,r]of e){let i=0;for(let a of r){let l=t.get(a);l&&(i+=l.height);}i>0&&(i+=de,n.set(o,i));}return n}function Kn(e){let{blocks:t,measures:n,layoutOpts:o,footnoteRefs:r,footnoteContentMap:i,initialLayout:a}=e,l=Ee(a.pages,r),d=ot(l,i);if(d.size===0)return {layout:a,pageFootnoteMap:l,converged:true};let g=a,s=false;for(let c=0;c<nt;c++){g=q$1(t,n,{...o,footnoteReservedHeights:d});let x=Ee(g.pages,r),b=ot(x,i);if(l=x,zt(d,b)){d=b,s=true;break}d=b;}s||(g=q$1(t,n,{...o,footnoteReservedHeights:d}),l=Ee(g.pages,r),console.warn(`[docx-editor] footnote layout did not stabilize within ${nt} passes; settling with best-effort reservation. If footnotes appear misplaced, please file a bug with the document.`));for(let[c,x]of l){let b=g.pages.find(f=>f.number===c);b&&(b.footnoteIds=x);}return {layout:g,pageFootnoteMap:l,converged:s}}function Un(e,t,n){let o=new Map;if(!n?.package?.footnotes)return o;let r=new Map;for(let i of n.package.footnotes)i.noteType&&i.noteType!=="normal"||r.set(i.id,i);for(let[i,a]of e){let l=[];for(let d of a){let g=r.get(d);if(!g)continue;let s=t.get(d),c=s?.displayNumber??0;l.push({displayNumber:String(c),text:v$1(g),content:s});}l.length>0&&o.set(i,l);}return o}function Dt(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 i=0;for(let a=0;a<e.blocks.length;a++){let l=e.blocks[a],d=e.measures[a];if(!(!l||!d)){if(l.kind==="paragraph"&&d.kind==="paragraph"){let g=l.attrs?.spacing?.before??0,s={blockId:l.id,width:t,height:d.totalHeight,pmStart:l.pmStart,pmEnd:l.pmEnd,fromLine:0,toLine:d.lines.length},c=v(s,l,d,{...n,section:"body",contentWidth:t,positioning:"absolute"},{document:o});c.style.top=`${i+g}px`,c.style.left="0",c.style.width=`${t}px`,c.style.height=`${d.totalHeight}px`,r.appendChild(c),i+=d.totalHeight;}else if(l.kind==="table"&&d.kind==="table"){let g={blockId:l.id,width:d.totalWidth,height:d.totalHeight,pmStart:l.pmStart,pmEnd:l.pmEnd,fromRow:0,toRow:d.rows.length},s=Y(g,l,d,{...n,section:"body",contentWidth:t,positioning:"absolute"},{document:o});s.style.top=`${i}px`,s.style.left="0",r.appendChild(s),i+=d.totalHeight;}else if(l.kind==="image"&&d.kind==="image"){let g={blockId:l.id,width:d.width,height:d.height,pmStart:l.pmStart,pmEnd:l.pmEnd},s=re(g,l,d,{...n},{document:o});s.style.top=`${i}px`,s.style.left="0",r.appendChild(s),i+=d.height;}else if(l.kind==="textBox"&&d.kind==="textBox"){let g={blockId:l.id,width:d.width,height:d.height,pmStart:l.pmStart,pmEnd:l.pmEnd},s=le(g,l,d,{...n,section:"body",contentWidth:t,positioning:"absolute"},{document:o});s.style.top=`${i}px`,s.style.left="0",r.appendChild(s),i+=d.height;}}}return r}function _t(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 rt(e){let t=de;for(let n of e)n.content&&(t+=n.content.height);return t}function it(e,t,n,o){let r=o.createElement("div");r.className="layout-footnote-area",r.style.width=`${t}px`;let i=o.createElement("div"),a=.5,l=(de-a)/2;i.style.width="33%",i.style.height=`${a}px`,i.style.backgroundColor="#000",i.style.marginBottom=`${l}px`,i.style.marginTop=`${l}px`,r.appendChild(i);for(let d of e)r.appendChild(d.content?Dt(d.content,t,n,o):_t(d,o));return r}function Le(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 i=n.footnotesByPage.get(e.number);i&&i.length>0&&(r.footnoteArea=i);}return {context:o,pageOptions:r}}function at(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 Wt(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 Gt(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 pe=2,Vt=8;function jt(e,t,n={}){let o=e.length,r=n.pageGap??24,i=t,a=i.__pageRenderState,l=Wt(n),d=o>=Vt;if(a&&a.optionsHash===l&&d){let m=a.pageStates,p=a.pageDataMap,y=i.__pageObserver,u=[];for(let S of e)u.push(at(S));let w=a.totalPages!==o,F=Math.min(m.length,e.length);for(let S=0;S<F;S++){let I=m[S],C=u[S];if(I.fingerprint===C&&!w){let P=p.get(I.element);P&&(P.page=e[S]);continue}let T=I.element,k=p.get(T);k&&(k.page=e[S],k.rendered&&Yt(T,p,o,n)),I.fingerprint=C,ee(T,e[S].size.w,e[S].size.h,n),T.dataset.pageNumber=String(e[S].number);}if(e.length>m.length){let S=n.document??document;for(let I=m.length;I<e.length;I++){let C=e[I],T=S.createElement("div");T.className=n.pageClassName??z.page,T.dataset.pageNumber=String(C.number),T.dataset.pageIndex=String(I),ee(T,C.size.w,C.size.h,n),t.appendChild(T),m.push({element:T,fingerprint:u[I]}),p.set(T,{page:C,index:I,rendered:false}),y&&y.observe(T);}}if(e.length<m.length){for(let S=m.length-1;S>=e.length;S--){let I=m[S].element;y&&y.unobserve(I),p.delete(I),t.removeChild(I);}m.length=e.length;}for(let S=0;S<m.length;S++){let I=p.get(m[S].element);I&&(I.index=S);}return a.totalPages=o,a.currentOptions=n,"incremental"}let s=i.__pageObserver;s&&(s.disconnect(),i.__pageObserver=void 0),t.innerHTML="",i.__pageRenderState=void 0,Gt(t,r);let c=[],x=[];for(let m=0;m<e.length;m++){let p=e[m];if(x.push(at(p)),d){let u=(n.document??document).createElement("div");u.className=n.pageClassName??z.page,u.dataset.pageNumber=String(p.number),u.dataset.pageIndex=String(m),ee(u,p.size.w,p.size.h,n),t.appendChild(u),c.push(u);}else {let{context:y,pageOptions:u}=Le(p,o,n),w=ge(p,y,u);t.appendChild(w),c.push(w);}}if(!d)return "full";let b=new Map;for(let m=0;m<e.length;m++)b.set(c[m],{page:e[m],index:m,rendered:false});let f=new IntersectionObserver(m=>{let p=i.__pageRenderState;if(!p)return;let{currentOptions:y,totalPages:u,pageDataMap:w}=p;for(let C of m){let T=C.target,k=w.get(T);if(k&&C.isIntersecting){ce(T,w,u,y);for(let P=-pe;P<=pe;P++){let R=k.index+P;R>=0&&R<p.pageStates.length&&R!==k.index&&ce(p.pageStates[R].element,w,u,y);}}}let F=window.innerHeight,S=F*3,I=new Set;for(let[C,T]of w){if(!T.rendered)continue;let k=C.getBoundingClientRect();k.bottom>-S&&k.top<F+S&&I.add(T.index);}for(let[C,T]of w){if(!T.rendered)continue;let k=false;for(let P of I)if(Math.abs(T.index-P)<=pe+1){k=true;break}!k&&I.size>0&&Kt(C,w);}},{root:null,rootMargin:"1500px 0px 1500px 0px"});for(let m of c)f.observe(m);i.__pageObserver=f,i.__pageRenderState={pageStates:c.map((m,p)=>({element:m,fingerprint:x[p]})),totalPages:o,optionsHash:l,pageDataMap:b,currentOptions:n};let h=Math.min(e.length,pe+3);for(let m=0;m<h;m++)ce(c[m],b,o,n);return "full"}function ce(e,t,n,o){let r=t.get(e);if(!r||r.rendered)return;let{context:i,pageOptions:a}=Le(r.page,n,o),l=ge(r.page,i,a);for(;l.firstChild;)e.appendChild(l.firstChild);r.rendered=true;}function Yt(e,t,n,o){let r=t.get(e);if(!r)return;let{context:i,pageOptions:a}=Le(r.page,n,o),d=ge(r.page,i,a).querySelector(`.${z.content}`),g=e.querySelector(`.${z.content}`);d&&g?e.replaceChild(d,g):(e.innerHTML="",r.rendered=false,ce(e,t,n,o));}function Kt(e,t){let n=t.get(e);!n||!n.rendered||(e.innerHTML="",n.rendered=false);}var z={page:"layout-page",content:"layout-page-content",header:"layout-page-header",footer:"layout-page-footer"};function ee(e,t,n,o){e.style.position="relative",e.style.width=`${t}px`,e.style.height=`${n}px`,e.style.backgroundColor=o.backgroundColor??"#ffffff",e.style.overflow="hidden",e.style.fontFamily=a$1("Calibri").cssFallback,e.style.fontSize=`${1056/72}px`,e.style.color="#000000",o.showBorders&&(e.style.border="1px solid #ccc"),o.showShadow&&(e.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");}function Ut(e,t){switch(t??"allPages"){case "firstPage":return e===1;case "notFirstPage":return e!==1;default:return true}}function fe(e){return e?.space!==void 0?i(e.space):0}function me(e,t,n,o){if(!t||t.style==="none"||t.style==="nil")return;let r=c$2(t,n,o);for(let[d,g]of Object.entries(r))e.style[d]=String(g);let i=`border${n}Style`,a=`border${n}Width`;if(e.style[i]==="double"){let d=parseFloat(e.style[a]);(!Number.isFinite(d)||d<3)&&(e.style[a]="3px");}}function Xt(e,t,n){let o=t.pageBorders;if(!o||!Ut(e.number,o.display)||![o.top,o.bottom,o.left,o.right].some(c=>c&&c.style!=="none"&&c.style!=="nil"))return null;let i=o.offsetFrom??"text",a=fe(o.top),l=fe(o.right),d=fe(o.bottom),g=fe(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",i==="page"?(s.style.top=`${a}px`,s.style.right=`${l}px`,s.style.bottom=`${d}px`,s.style.left=`${g}px`):(s.style.top=`${Math.max(0,e.margins.top-a)}px`,s.style.right=`${Math.max(0,e.margins.right-l)}px`,s.style.bottom=`${Math.max(0,e.margins.bottom-d)}px`,s.style.left=`${Math.max(0,e.margins.left-g)}px`),me(s,o.top,"Top",t.theme),me(s,o.bottom,"Bottom",t.theme),me(s,o.left,"Left",t.theme),me(s,o.right,"Right",t.theme),s}function Zt(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 qt(e,t,n){e.style.position="absolute",e.style.left=`${t.x-n.left}px`,e.style.top=`${t.y-n.top}px`,e.style.width=`${t.width}px`,"height"in t&&(e.style.height=`${t.height}px`);}function Jt(e,t,n,o){let r=[];for(let i of e.runs){if(i.kind!=="image")continue;let a=i;if(!H(a))continue;let l=a.distTop??0,d=a.distBottom??0,g=a.distLeft??12,s=a.distRight??12,{x:c,y:x,side:b}=Re(a,t,n,o);r.push({src:a.src,width:a.width,height:a.height,alt:a.alt,transform:a.transform,side:b,x:c,y:x,distTop:l,distBottom:d,distLeft:g,distRight:s,pmStart:a.pmStart,pmEnd:a.pmEnd,wrapText:oe(a.cssFloat),wrapType:a.wrapType,cropTop:a.cropTop,cropRight:a.cropRight,cropBottom:a.cropBottom,cropLeft:a.cropLeft,opacity:a.opacity});}return r}function ge(e,t,n={}){let o=n.document??document,r$1=o.createElement("div");r$1.className=n.pageClassName??z.page,r$1.dataset.pageNumber=String(e.number),ee(r$1,e.size.w,e.size.h,n);let i=Xt(e,n,o);i&&n.pageBorders?.zOrder==="back"&&r$1.appendChild(i);let a=o.createElement("div");a.className=z.content,Zt(a,e);let l=Qe(e),d=l.contentWidth,g$1=[],s=[];for(let p of e.fragments)if(p.kind==="paragraph"&&n.blockLookup){let y=n.blockLookup.get(String(p.blockId));if(y?.block.kind==="paragraph"){let u=y.block,w=p.y-e.margins.top,F=Jt(u,w,d,l);g$1.push(...F);}}for(let p of g$1)Z(p)&&s.push({side:p.side,x:p.x,y:p.y,width:p.width,height:p.height,distTop:p.distTop,distBottom:p.distBottom,distLeft:p.distLeft,distRight:p.distRight,wrapText:p.wrapText,wrapType:p.wrapType});if(n.blockLookup)for(let p of e.fragments){if(p.kind!=="table")continue;let y=n.blockLookup.get(String(p.blockId));if(y?.block.kind!=="table")continue;let w=y.block.floating;if(!w)continue;let F=p.x-e.margins.left,S=p.y-e.margins.top,I=w.topFromText??0,C=w.bottomFromText??0,T=w.leftFromText??12,k=w.rightFromText??12,P=F<d/2?"left":"right";s.push({side:P,x:F,y:S,width:p.width,height:p.height,distTop:I,distBottom:C,distLeft:T,distRight:k});}if(n.blockLookup)for(let p of e.fragments){if(p.kind!=="textBox")continue;let y=n.blockLookup.get(String(p.blockId));if(y?.block.kind!=="textBox")continue;let u=y.block;if(!g(u))continue;let w=p.y-e.margins.top,F=Re({width:p.width,height:p.height,position:u.position,cssFloat:u.cssFloat},w,d,l);p.x=e.margins.left+F.x,p.y=e.margins.top+F.y,h(u)&&s.push({side:F.side,x:F.x,y:F.y,width:p.width,height:p.height,distTop:u.distTop??0,distBottom:u.distBottom??0,distLeft:u.distLeft??12,distRight:u.distRight??12,wrapText:u.wrapText,wrapType:u.wrapType});}let c=s.length>0?p(s,d):[],x=g$1.filter(G),b=g$1.filter(p=>!G(p));if(x.length>0){let p=V(x,o,{layerClass:"layout-floating-images-layer",itemClass:"layout-page-floating-image",sizing:"inset0",layerMode:"behind"});a.appendChild(p);}let f=p=>{if(p.kind!=="paragraph"||!n.blockLookup||!p.blockId)return;let y=n.blockLookup.get(String(p.blockId));if(y?.block.kind==="paragraph")return y.block.attrs?.borders},h$1,m=new Map;for(let p=0;p<e.fragments.length;p++){let y=e.fragments[p],u,w={...t,section:"body",contentWidth:d},F=y.y-e.margins.top;if(n.blockLookup&&y.blockId){let S=n.blockLookup.get(String(y.blockId));if(y.kind==="paragraph"&&S?.block.kind==="paragraph"&&S?.measure.kind==="paragraph"){let I=S.block,C=p+1<e.fragments.length?f(e.fragments[p+1]):void 0,T=String(y.blockId),k=m.get(T);k||(k=new Set,m.set(T,k));let P=S.measure;c.length>0&&(P=r(I,d,{floatingZones:c,paragraphYOffset:F})),u=v(y,I,P,w,{document:o,prevBorders:h$1,nextBorders:C,renderedInlineImageKeys:k}),h$1=I.attrs?.borders;}else y.kind==="table"&&S?.block.kind==="table"&&S?.measure.kind==="table"?(u=Y(y,S.block,S.measure,w,{document:o}),h$1=void 0):y.kind==="image"&&S?.block.kind==="image"&&S?.measure.kind==="image"?(u=re(y,S.block,S.measure,w,{document:o}),h$1=void 0):y.kind==="textBox"&&S?.block.kind==="textBox"&&S?.measure.kind==="textBox"?(u=le(y,S.block,S.measure,w,{document:o}),h$1=void 0):(u=xe(y,w,{document:o}),h$1=void 0);}else u=xe(y,w,{document:o}),h$1=void 0;qt(u,y,{left:e.margins.left,top:e.margins.top}),a.appendChild(u);}if(b.length>0){let p=V(b,o,{layerClass:"layout-floating-images-layer",itemClass:"layout-page-floating-image",sizing:"inset0",layerMode:"front"});a.appendChild(p);}if(e.columns&&e.columns.separator&&e.columns.count>1){let p=e.columns.count,y=e.columns.gap,u=(d-(p-1)*y)/p,w=e.size.h-e.margins.top-e.margins.bottom;for(let F=0;F<p-1;F++){let S=(F+1)*u+F*y+y/2,I=o.createElement("div");I.style.position="absolute",I.style.left=`${S}px`,I.style.top="0",I.style.height=`${w}px`,I.style.width="0.5px",I.style.backgroundColor="#000",I.style.pointerEvents="none",a.appendChild(I);}}if(n.footnoteArea&&n.footnoteArea.length>0){let p=it(n.footnoteArea,d,t,o);p.style.position="absolute";let y=Math.max(e.footnoteReservedHeight??0,rt(n.footnoteArea)),u=e.size.h-e.margins.bottom-e.margins.top;p.style.top=`${Math.max(-e.margins.top,u-y)}px`,p.style.left="0",p.style.right="0",a.appendChild(p);}r$1.appendChild(a);{let y=n.headerDistance??e.margins.header??48,u=e.size.w-e.margins.left-e.margins.right,w=Math.max(e.margins.top-y,48),F=n.headerContent?.visualTop??0,S=n.headerContent?.visualBottom??n.headerContent?.height??0,I=Math.max(S-F,24),C=S>w,T=o.createElement("div");T.className=z.header,T.style.position="absolute",T.style.top=`${y+F}px`,T.style.left=`${e.margins.left}px`,T.style.right=`${e.margins.right}px`,T.style.width=`${u}px`,T.style.height=`${I}px`,T.style.minHeight=`${I}px`;let k=!C;if(n.headerContent&&n.headerContent.blocks.length>0){let P={flowTop:y,flowLeft:e.margins.left,contentWidth:u,pageWidth:e.size.w,pageHeight:e.size.h,margins:e.margins},R=Ce(n.headerContent,{...t,section:"header",contentWidth:u},n,P);R.style.top=`${-F}px`,R.querySelector("img")&&(k=false),T.appendChild(R);}k&&(T.style.maxHeight=`${w}px`,T.style.overflow="hidden"),r$1.appendChild(T);}{let y=n.footerDistance??e.margins.footer??48,u=e.size.w-e.margins.left-e.margins.right,w=Math.max(e.margins.bottom-y,48),F=n.footerContent?.visualTop??0,S=n.footerContent?.visualBottom??n.footerContent?.height??0,I=Math.max(S-F,24),C=I>w,T=o.createElement("div");T.className=z.footer,T.style.position="absolute",T.style.top=`${e.size.h-y-I}px`,T.style.left=`${e.margins.left}px`,T.style.right=`${e.margins.right}px`,T.style.width=`${u}px`,T.style.height=`${I}px`,T.style.minHeight=`${I}px`;let k=!C;if(n.footerContent&&n.footerContent.blocks.length>0){let P={flowTop:e.size.h-y-(n.footerContent?.height??0),flowLeft:e.margins.left,contentWidth:u,pageWidth:e.size.w,pageHeight:e.size.h,margins:e.margins},R=Ce(n.footerContent,{...t,section:"footer",contentWidth:u},n,P);R.style.top=`${-F}px`,R.querySelector("img")&&(k=false),T.appendChild(R);}k&&(T.style.maxHeight=`${w}px`,T.style.overflow="hidden"),r$1.appendChild(T);}return i&&n.pageBorders?.zOrder!=="back"&&r$1.appendChild(i),r$1}
|
|
2
|
-
export{le as A,tt as B,jt as C,z as D,ee as E,ge as F,de as a,nt as b,zt as c,jn as d,Ee as e,Ot as f,Nt as g,Yn as h,ot as i,Kn as j,Un as k,_ as l,xe as m,Z as n,G as o,H as p,ft as q,je as r,re as s,qe as t,ae as u,v,V as w,A as x,Y as y,Et as z};
|
package/dist/chunk-Y7JZPBBW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkD4RPOJC7_js=require('./chunk-D4RPOJC7.js'),chunkIP2VXNWG_js=require('./chunk-IP2VXNWG.js'),chunkJFZIXFRC_js=require('./chunk-JFZIXFRC.js'),chunkMZOVDLYL_js=require('./chunk-MZOVDLYL.js'),chunkSUXJX72X_js=require('./chunk-SUXJX72X.js'),chunkMJ5FQX7Q_js=require('./chunk-MJ5FQX7Q.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js');function _(e){if(!e)return [];let n=[];return e.bold&&n.push(chunkSUXJX72X_js.b.mark("bold")),e.italic&&n.push(chunkSUXJX72X_js.b.mark("italic")),e.underline&&e.underline.style!=="none"&&n.push(chunkSUXJX72X_js.b.mark("underline",{style:e.underline.style,color:e.underline.color})),(e.strike||e.doubleStrike)&&n.push(chunkSUXJX72X_js.b.mark("strike",{double:e.doubleStrike||false})),e.color&&!e.color.auto&&n.push(chunkSUXJX72X_js.b.mark("textColor",{rgb:e.color.rgb,themeColor:e.color.themeColor,themeTint:e.color.themeTint,themeShade:e.color.themeShade})),e.highlight&&e.highlight!=="none"&&n.push(chunkSUXJX72X_js.b.mark("highlight",{color:e.highlight})),e.fontSize&&n.push(chunkSUXJX72X_js.b.mark("fontSize",{size:e.fontSize})),e.fontFamily&&n.push(chunkSUXJX72X_js.b.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(chunkSUXJX72X_js.b.mark("superscript")):e.vertAlign==="subscript"&&n.push(chunkSUXJX72X_js.b.mark("subscript")),e.allCaps&&n.push(chunkSUXJX72X_js.b.mark("allCaps")),e.smallCaps&&n.push(chunkSUXJX72X_js.b.mark("smallCaps")),(e.spacing!=null||e.position!=null||e.scale!=null||e.kerning!=null)&&n.push(chunkSUXJX72X_js.b.mark("characterSpacing",{spacing:e.spacing??null,position:e.position??null,scale:e.scale??null,kerning:e.kerning??null})),e.emboss&&n.push(chunkSUXJX72X_js.b.mark("emboss")),e.imprint&&n.push(chunkSUXJX72X_js.b.mark("imprint")),e.shadow&&n.push(chunkSUXJX72X_js.b.mark("textShadow")),e.emphasisMark&&e.emphasisMark!=="none"&&n.push(chunkSUXJX72X_js.b.mark("emphasisMark",{type:e.emphasisMark})),e.outline&&n.push(chunkSUXJX72X_js.b.mark("textOutline")),e.hidden&&n.push(chunkSUXJX72X_js.b.mark("hidden")),e.rtl&&n.push(chunkSUXJX72X_js.b.mark("rtl")),e.effect&&e.effect!=="none"&&n.push(chunkSUXJX72X_js.b.mark("textEffect",{effect:e.effect})),n}function A(e,n){if(!e)return;if(!n)return e;let r=n.resolveRunStyle(e.styleId);return r?chunkMZOVDLYL_js.a(r,e):e}function ee(e,n){let r="",i,t=e.type==="simpleField"?e.content:e.fieldResult;if(t){for(let s of t)if(s.type==="run"){for(let f of s.content)f.type==="text"&&(r+=f.text);!i&&s.formatting&&(i=s.formatting);}}let l=chunkMZOVDLYL_js.a(n,i),o=_(l);return chunkSUXJX72X_js.b.node("field",{fieldType:e.fieldType,instruction:e.instruction,displayText:r,fieldKind:e.type==="simpleField"?"simple":"complex",fldLock:e.fldLock??false,dirty:e.dirty??false},void 0,o)}function te(e){return chunkSUXJX72X_js.b.node("math",{display:e.display,ommlXml:e.ommlXml,plainText:e.plainText||""})}function q(e,n,r){let i=[],t=e.formatting?.styleId?r?.getRunStyleOwnProperties(e.formatting.styleId):void 0,l=chunkMZOVDLYL_js.a(chunkMZOVDLYL_js.a(n,t),e.formatting),o=_(l);for(let s of e.content){let f=ge(s,o);i.push(...f);}return i}function ge(e,n){switch(e.type){case "text":return e.text?[chunkSUXJX72X_js.b.text(e.text,n)]:[];case "break":return e.breakType==="textWrapping"||!e.breakType?[chunkSUXJX72X_js.b.node("hardBreak")]:[];case "tab":return [chunkSUXJX72X_js.b.node("tab")];case "drawing":return e.image?[Te(e.image)]:[];case "shape":{let t=e.shape;return t.textBody&&t.textBody.content.length>0?[]:[be(t)]}case "footnoteRef":let r=chunkSUXJX72X_js.b.mark("footnoteRef",{id:e.id.toString(),noteType:"footnote"});return [chunkSUXJX72X_js.b.text(e.id.toString(),[...n,r])];case "endnoteRef":let i=chunkSUXJX72X_js.b.mark("footnoteRef",{id:e.id.toString(),noteType:"endnote"});return [chunkSUXJX72X_js.b.text(e.id.toString(),[...n,i])];default:return []}}function Te(e){let n=e.size?.width?chunk4Q2IP5FW_js.e(e.size.width):void 0,r=e.size?.height?chunk4Q2IP5FW_js.e(e.size.height):void 0,i=e.wrap.type,t=e.wrap.wrapText,l=e.position?.horizontal?.alignment,o;i==="inline"||i==="topAndBottom"?o="none":i==="square"||i==="tight"||i==="through"?t==="left"?o="right":t==="right"||l==="left"?o="left":l==="right"?o="right":o="none":o="none";let s="inline";i==="inline"?s="inline":i==="topAndBottom"?s="block":chunkJFZIXFRC_js.b(i)||o&&o!=="none"?s="float":s="block";let f;if(e.transform){let y=[];e.transform.rotation&&y.push(`rotate(${e.transform.rotation}deg)`),e.transform.flipH&&y.push("scaleX(-1)"),e.transform.flipV&&y.push("scaleY(-1)"),y.length>0&&(f=y.join(" "));}let p=e.wrap.distT?chunk4Q2IP5FW_js.e(e.wrap.distT):void 0,c=e.wrap.distB?chunk4Q2IP5FW_js.e(e.wrap.distB):void 0,d=e.wrap.distL?chunk4Q2IP5FW_js.e(e.wrap.distL):void 0,m=e.wrap.distR?chunk4Q2IP5FW_js.e(e.wrap.distR):void 0,u;e.position&&(u={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 F,k,v;if(e.outline&&e.outline.width){F=Math.round(e.outline.width/914400*96*100)/100,e.outline.color?.rgb&&(k=`#${e.outline.color.rgb}`);let y={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&&y[e.outline.style]||"solid";}let N=e.padding?.top?chunk4Q2IP5FW_js.e(e.padding.top):void 0,R=e.padding?.bottom?chunk4Q2IP5FW_js.e(e.padding.bottom):void 0,B=e.padding?.left?chunk4Q2IP5FW_js.e(e.padding.left):void 0,h=e.padding?.right?chunk4Q2IP5FW_js.e(e.padding.right):void 0;return chunkSUXJX72X_js.b.node("image",{src:e.src||"",alt:e.alt,title:e.title,width:n,height:r,rId:e.rId,wrapType:i,displayMode:s,cssFloat:o,transform:f,distTop:p,distBottom:c,distLeft:d,distRight:m,position:u,borderWidth:F,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:N,effectExtentBottom:R,effectExtentLeft:B,effectExtentRight:h,layoutInCell:e.layoutInCell,allowOverlap:e.allowOverlap})}function j(e,n,r){let i=[],t=e.href||(e.anchor?`#${e.anchor}`:""),l=chunkSUXJX72X_js.b.mark("hyperlink",{href:t,tooltip:e.tooltip,rId:e.rId});for(let o of e.children)if(o.type==="run"){let s=o.formatting?.styleId?r?.resolveRunStyle(o.formatting.styleId):void 0,f=chunkMZOVDLYL_js.a(chunkMZOVDLYL_js.a(n,s),o.formatting),c=[..._(f),l];for(let d of o.content)d.type==="text"&&d.text&&i.push(chunkSUXJX72X_js.b.text(d.text,c));}return i}function be(e){let n=e.size?.width?chunk4Q2IP5FW_js.e(e.size.width):100,r=e.size?.height?chunk4Q2IP5FW_js.e(e.size.height):80,i,t="solid",l,o,s;if(e.fill&&(t=e.fill.type,e.fill.color?.rgb&&(i=`#${e.fill.color.rgb}`),e.fill.type==="gradient"&&e.fill.gradient)){let m=e.fill.gradient;l=m.type,o=m.angle,s=JSON.stringify(m.stops.map(u=>({position:u.position,color:u.color.rgb?`#${u.color.rgb}`:"#000000"})));}let f,p,c;e.outline&&(e.outline.width&&(f=Math.round(e.outline.width/914400*96*100)/100),e.outline.color?.rgb&&(p=`#${e.outline.color.rgb}`),c=e.outline.style||"solid");let d;if(e.transform){let m=[];e.transform.rotation&&m.push(`rotate(${e.transform.rotation}deg)`),e.transform.flipH&&m.push("scaleX(-1)"),e.transform.flipV&&m.push("scaleY(-1)"),m.length>0&&(d=m.join(" "));}return chunkSUXJX72X_js.b.node("shape",{shapeType:e.shapeType||"rect",shapeId:e.id,width:n,height:r,fillColor:i,fillType:t,gradientType:l,gradientAngle:o,gradientStops:s,outlineWidth:f,outlineColor:p,outlineStyle:c,transform:d})}function E(e,n,r,i){let t=ye(e,n),l=[],o,s=new Set,f;n&&(f=n.resolveParagraphStyle(e.formatting?.styleId).runFormatting);let p=chunkMZOVDLYL_js.a(f,i);for(let c of e.content){if(c.type==="commentRangeStart")s.add(c.id);else if(c.type==="commentRangeEnd")s.delete(c.id);else if(c.type==="run"){let d=q(c,p,n);s.size>0&&(d=D(d,s)),l.push(...d);}else if(c.type==="hyperlink"){let d=j(c,p,n);l.push(...d);}else if(c.type==="simpleField"||c.type==="complexField"){let d=ee(c,p);d&&l.push(d);}else if(c.type==="inlineSdt"){let d=fe(c,p,n);d&&l.push(d);}else if(c.type==="insertion"){let d=X(c,"insertion",p,n);s.size>0&&(d=D(d,s)),l.push(...d);}else if(c.type==="deletion"){let d=X(c,"deletion",p,n);s.size>0&&(d=D(d,s)),l.push(...d);}else if(c.type==="moveFrom"){let d=X(c,"deletion",p,n);s.size>0&&(d=D(d,s)),l.push(...d);}else if(c.type==="moveTo"){let d=X(c,"insertion",p,n);s.size>0&&(d=D(d,s)),l.push(...d);}else if(c.type==="mathEquation"){let d=te(c);d&&l.push(d);}c.type==="bookmarkStart"&&(o||(o=[]),o.push({id:c.id,name:c.name}));}return o&&(t.bookmarks=o),chunkSUXJX72X_js.b.node("paragraph",t,l)}function D(e,n){if(n.size===0)return e;let r=[...n][0],i=chunkSUXJX72X_js.b.marks.comment.create({commentId:r});return e.map(t=>t.isText?t.mark(i.addToSet(t.marks)):t)}function X(e,n,r,i){let t=[];for(let o of e.content)o.type==="run"?t.push(...q(o,r,i)):o.type==="hyperlink"&&t.push(...j(o,r,i));let l=chunkSUXJX72X_js.b.marks[n].create({revisionId:e.info.id,author:e.info.author,date:e.info.date??null});return t.map(o=>o.isText?o.mark(l.addToSet(o.marks)):o)}function ye(e,n){let r=e.formatting,i=r?.styleId,t={paraId:e.paraId??void 0,textId:e.textId??void 0,styleId:i,numPr:r?.numPr,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,listLevelNumFmts:e.listRendering?.levelNumFmts||void 0,listAbstractNumId:e.listRendering?.abstractNumId,listStartOverride:e.listRendering?.startOverride,_originalFormatting:r||void 0};if(n){let l=n.resolveParagraphStyle(i),o=l.paragraphFormatting,s=l.runFormatting;t.alignment=r?.alignment??o?.alignment,t.spaceBefore=r?.spaceBefore??o?.spaceBefore,t.spaceAfter=r?.spaceAfter??o?.spaceAfter,t.lineSpacing=r?.lineSpacing??o?.lineSpacing,t.lineSpacingRule=r?.lineSpacingRule??o?.lineSpacingRule,r?.spacingExplicit&&(t.spacingExplicit=r.spacingExplicit),t.indentLeft=r?.indentLeft??o?.indentLeft,t.indentRight=r?.indentRight??o?.indentRight,t.indentFirstLine=r?.indentFirstLine??o?.indentFirstLine,t.hangingIndent=r?.hangingIndent??o?.hangingIndent,t.borders=r?.borders??o?.borders,t.shading=r?.shading??o?.shading,t.tabs=r?.tabs??o?.tabs,t.pageBreakBefore=r?.pageBreakBefore??o?.pageBreakBefore,t.keepNext=r?.keepNext??o?.keepNext,t.keepLines=r?.keepLines??o?.keepLines,t.contextualSpacing=r?.contextualSpacing??o?.contextualSpacing,t.outlineLevel=r?.outlineLevel??o?.outlineLevel,t.bidi=r?.bidi??o?.bidi;let f=n.getDefaultCharacterStyle()?.rPr,p=f?chunkMZOVDLYL_js.a(s,f):s,c=A(r?.runProperties,n);t.defaultTextFormatting=chunkMZOVDLYL_js.a(p,c),!r?.numPr&&o?.numPr&&o.numPr.numId!==0&&(t.numPr=o.numPr);}else t.alignment=r?.alignment,t.spaceBefore=r?.spaceBefore,t.spaceAfter=r?.spaceAfter,t.lineSpacing=r?.lineSpacing,t.lineSpacingRule=r?.lineSpacingRule,r?.spacingExplicit&&(t.spacingExplicit=r.spacingExplicit),t.indentLeft=r?.indentLeft,t.indentRight=r?.indentRight,t.indentFirstLine=r?.indentFirstLine,t.hangingIndent=r?.hangingIndent,t.borders=r?.borders,t.shading=r?.shading,t.tabs=r?.tabs,t.pageBreakBefore=r?.pageBreakBefore,t.keepNext=r?.keepNext,t.keepLines=r?.keepLines,t.outlineLevel=r?.outlineLevel,t.bidi=r?.bidi,t.defaultTextFormatting=A(r?.runProperties,n);if(e.sectionProperties){t._sectionProperties=e.sectionProperties;let l=e.sectionProperties.sectionStart;(l==="nextPage"||l==="continuous"||l==="oddPage"||l==="evenPage")&&(t.sectionBreakType=l);}return e.renderedPageBreakBefore&&(t.renderedPageBreakBefore=true),t}function fe(e,n,r){let i=e.properties,t=[];for(let l of e.content)if(l.type==="run"){let o=q(l,n,r);t.push(...o);}else if(l.type==="hyperlink"){let o=j(l,n,r);t.push(...o);}else if(l.type==="simpleField"||l.type==="complexField"){let o=ee(l,n);o&&t.push(o);}else if(l.type==="inlineSdt"){let o=fe(l,n,r);o&&t.push(o);}else if(l.type==="mathEquation"){let o=te(l);o&&t.push(o);}return chunkSUXJX72X_js.b.node("sdt",{sdtType:i.sdtType,alias:i.alias??null,tag:i.tag??null,lock:i.lock??null,placeholder:i.placeholder??null,showingPlaceholder:i.showingPlaceholder??false,dateFormat:i.dateFormat??null,listItems:i.listItems?JSON.stringify(i.listItems):null,checked:i.checked??null},t.length>0?t:void 0)}function ce(e){function n(i){return i.type==="break"&&i.breakType==="page"}function r(i){if(i.type==="run"){for(let t of i.content)if(n(t))return true;return false}if(i.type==="hyperlink"){for(let t of i.children)if(t.type==="run"&&r(t))return true;return false}if(i.type==="insertion"||i.type==="deletion"){let t=i;for(let l of t.content)if(r(l))return true;return false}return false}for(let i of e.content)if(r(i))return true;return false}function x(e,n,r){if(!e||!n)return;let i=e.getStyle(n);if(!i?.tblStylePr)return;let t=i.tblStylePr.find(f=>f.type===r);if(!t)return;let l=A(t.pPr?.runProperties,e),o=A(t.rPr,e),s=chunkMZOVDLYL_js.a(l,o);return {tcPr:t.tcPr,rPr:s}}function M(e,n){if(!e&&!n)return;if(!e)return n;if(!n)return e;let r={},i=e.tcPr,t=n.tcPr;if(i||t){let l={...i??{},...t??{}};(i?.borders||t?.borders)&&(l.borders={...i?.borders??{},...t?.borders??{}}),(i?.shading||t?.shading)&&(l.shading={...i?.shading??{},...t?.shading??{}}),(i?.margins||t?.margins)&&(l.margins={...i?.margins??{},...t?.margins??{}}),r.tcPr=l;}return r.rPr=chunkMZOVDLYL_js.a(e.rPr,n.rPr),r}function Pe(e){let n=new Map,r=e.rows.length,i=new Map;for(let t=0;t<r;t++){let l=e.rows[t],o=0;for(let s=0;s<l.cells.length;s++){let f=l.cells[s],p=f.formatting?.gridSpan??1,c=f.formatting?.vMerge,d=`${t}-${o}`;if(c==="restart")i.set(o,t),n.set(d,{rowSpan:1,skip:false});else if(c==="continue"){let m=i.get(o);if(m!==void 0){let u=`${m}-${o}`,F=n.get(u);F&&F.rowSpan++;}n.set(d,{rowSpan:1,skip:true});}else i.delete(o),n.set(d,{rowSpan:1,skip:false});o+=p;}}return n}function K(e,n,r){let i=Pe(e),t=e.columnWidths,l=t?.reduce((y,S)=>y+S,0)??0,o=e.formatting?.styleId,s=e.formatting?.look,f=o?n?.getStyle(o):void 0,p=n?.getDefaultTableStyle(),c=e.formatting?.borders??f?.tblPr?.borders??p?.tblPr?.borders,d=e.formatting?.cellMargins??f?.tblPr?.cellMargins??p?.tblPr?.cellMargins??void 0,m=d?{top:d.top?.value,bottom:d.bottom?.value,left:d.left?.value,right:d.right?.value}:void 0,u={styleId:e.formatting?.styleId,width:e.formatting?.width?.value,widthType:e.formatting?.width?.type,justification:e.formatting?.justification,columnWidths:t,floating:e.formatting?.floating,cellMargins:m,look:e.formatting?.look,_originalFormatting:e.formatting||void 0},F={wholeTable:x(n,o,"wholeTable"),firstRow:x(n,o,"firstRow"),lastRow:x(n,o,"lastRow"),firstCol:x(n,o,"firstCol"),lastCol:x(n,o,"lastCol"),band1Horz:x(n,o,"band1Horz"),band2Horz:x(n,o,"band2Horz"),band1Vert:x(n,o,"band1Vert"),band2Vert:x(n,o,"band2Vert"),nwCell:x(n,o,"nwCell"),neCell:x(n,o,"neCell"),swCell:x(n,o,"swCell"),seCell:x(n,o,"seCell")},k=s?.noHBand!==true,v=s?.noVBand!==true,N=0,R=e.rows.length,B=t?.length??Math.max(0,...e.rows.map(y=>y.cells.reduce((S,w)=>S+(w.formatting?.gridSpan??1),0))),h=e.rows.map((y,S)=>{let w=S===0&&!!s?.firstRow,C=S===R-1&&!!s?.lastRow,I=k&&!w&&!C?N%2===0?F.band1Horz:F.band2Horz:void 0;return k&&!w&&!C&&N++,Fe(y,n,w,t,l,F,I,v,s,c,S,R,B,i,m,r)});return chunkSUXJX72X_js.b.node("table",u,h)}function Fe(e,n,r,i,t,l,o,s,f,p,c,d,m,u,F,k){let v={height:e.formatting?.height?.value,heightRule:e.formatting?.heightRule,isHeader:!!e.formatting?.header,_originalFormatting:e.formatting||void 0},N=e.cells.length,R=c===0,B=c===(d??1)-1,h=e.formatting?.conditionalFormat,y=h?.firstRow??R,S=h?.lastRow??B,w=m??N,C=0,I=[];for(let J=0;J<e.cells.length;J++){let Y=e.cells[J],L=Y.formatting?.gridSpan??1,pe=`${c??0}-${C}`,oe=u?.get(pe),me=oe?.skip??false,he=oe?.rowSpan??1,re;if(i&&t&&t>0){let W=0;for(let z=0;z<L&&C+z<i.length;z++)W+=i[C+z];re=Math.round(W/t*100);}if(C+=L,me)continue;let ie=C-L===0,le=C===w,T=Y.formatting?.conditionalFormat,G=T?.firstRow??y,Q=T?.lastRow??S,O=T?.firstColumn??ie,V=T?.lastColumn??le,$;if(s){let W=f?.firstColumn?1:0,z=C-L-W;z>=0&&!(f?.lastColumn&&V)&&!(f?.firstColumn&&O)&&($=z%2===0?l?.band1Vert:l?.band2Vert);}T?.oddVBand?$=l?.band1Vert:T?.evenVBand&&($=l?.band2Vert);let H=o;h?.oddHBand?H=l?.band1Horz:h?.evenHBand&&(H=l?.band2Horz),T?.oddHBand?H=l?.band1Horz:T?.evenHBand&&(H=l?.band2Horz);let g=l?.wholeTable;g=M(g,H),g=M(g,$),G&&(f?.firstRow||h?.firstRow||T?.firstRow)&&(g=M(g,l?.firstRow)),Q&&(f?.lastRow||h?.lastRow||T?.lastRow)&&(g=M(g,l?.lastRow)),O&&(f?.firstColumn||h?.firstColumn||T?.firstColumn)&&(g=M(g,l?.firstCol)),V&&(f?.lastColumn||h?.lastColumn||T?.lastColumn)&&(g=M(g,l?.lastCol)),G&&O&&(f?.firstRow||h?.firstRow||T?.firstRow)&&(f?.firstColumn||h?.firstColumn||T?.firstColumn)&&(g=M(g,l?.nwCell)),G&&V&&(f?.firstRow||h?.firstRow||T?.firstRow)&&(f?.lastColumn||h?.lastColumn||T?.lastColumn)&&(g=M(g,l?.neCell)),Q&&O&&(f?.lastRow||h?.lastRow||T?.lastRow)&&(f?.firstColumn||h?.firstColumn||T?.firstColumn)&&(g=M(g,l?.swCell)),Q&&V&&(f?.lastRow||h?.lastRow||T?.lastRow)&&(f?.lastColumn||h?.lastColumn||T?.lastColumn)&&(g=M(g,l?.seCell)),I.push(Ce(Y,n,r,re,g,p,R,B,ie,le,he,F,k));}return chunkSUXJX72X_js.b.node("tableRow",v,I)}var we=["top","bottom","left","right","insideH","insideV"];function xe(e,n){if(!e)return e;let r;for(let i of we){let t=e[i];if(!t?.color?.themeColor||t.color.auto)continue;let l=chunkMJ5FQX7Q_js.b(t.color,n);l&&(r??(r={...e}),r[i]={...t,color:{rgb:l}});}return r??e}function Ce(e,n,r,i,t,l,o,s,f,p,c,d,m){let u=e.formatting,F=c??1,k=u?.width?.value,v=u?.width?.type;k===void 0&&i!==void 0&&(k=i,v="pct");let N=chunkMJ5FQX7Q_js.b(u?.shading?.fill??t?.tcPr?.shading?.fill,m),R=l?{top:o?l.top:l.insideH,bottom:s?l.bottom:l.insideH,left:f?l.left:l.insideV,right:p?l.right:l.insideV}:void 0,B=t?.tcPr?.borders,h=u?.borders,y=xe(R||B||h?{...R??{},...B??{},...h??{}}:void 0,m),S={colspan:u?.gridSpan??1,rowspan:F,width:k,widthType:v,verticalAlign:u?.verticalAlign,backgroundColor:N,textDirection:u?.textDirection,noWrap:u?.noWrap,borders:y,margins:u?.margins?{top:u.margins.top?.value,bottom:u.margins.bottom?.value,left:u.margins.left?.value,right:u.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}:d,_originalFormatting:u||void 0,_originalResolvedFill:N},w=[];for(let I of e.content)I.type==="paragraph"?w.push(E(I,n,void 0,t?.rPr)):I.type==="table"&&w.push(K(I,n));w.length===0&&w.push(chunkSUXJX72X_js.b.node("paragraph",{},[]));let C=r?"tableHeader":"tableCell";return chunkSUXJX72X_js.b.node(C,S,w)}function ne(e,n){let r=Se(e),i=E(e,n),t=[],l=r.length>0&&i.content.size===0,{anchored:o,inFlow:s}=ke(r);for(let f of o)t.push(ue(f,n));l||t.push(i);for(let f of s)t.push(ue(f,n));return t}function ke(e){let n=[],r=[];for(let i of e)chunkD4RPOJC7_js.a(i)?n.push(i):r.push(i);return {anchored:n,inFlow:r}}function Se(e){let n=[];for(let r of e.content)if(r.type==="run"){for(let i of r.content)if(i.type==="shape"&&"shape"in i){let t=i.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 ue(e,n){let r=e.size?.width?chunk4Q2IP5FW_js.e(e.size.width):200,i=e.size?.height?chunk4Q2IP5FW_js.e(e.size.height):void 0,t;e.fill?.color?.rgb&&(t=`#${e.fill.color.rgb}`);let l,o,s;e.outline&&e.outline.width&&(l=Math.round(e.outline.width/914400*96*100)/100,e.outline.color?.rgb&&(o=`#${e.outline.color.rgb}`),s=e.outline.style||"solid");let f=e.margins?.top!=null?chunk4Q2IP5FW_js.e(e.margins.top):4,p=e.margins?.bottom!=null?chunk4Q2IP5FW_js.e(e.margins.bottom):4,c=e.margins?.left!=null?chunk4Q2IP5FW_js.e(e.margins.left):7,d=e.margins?.right!=null?chunk4Q2IP5FW_js.e(e.margins.right):7,m=[];for(let u of e.content)m.push(E(u,n));return m.length===0&&m.push(chunkSUXJX72X_js.b.node("paragraph",{},[])),chunkSUXJX72X_js.b.node("textBox",{width:r,height:i,textBoxId:e.id,fillColor:t,outlineWidth:l,outlineColor:o,outlineStyle:s,marginTop:f,marginBottom:p,marginLeft:c,marginRight:d,...chunkD4RPOJC7_js.b(e)},m)}function it(e,n){let r=e.package.document.content,i=[],t=e.package.theme??null,l=n?.styles?chunkIP2VXNWG_js.b(n.styles):null;for(let o of r)if(o.type==="paragraph")i.push(...ne(o,l)),ce(o)&&i.push(chunkSUXJX72X_js.b.node("pageBreak"));else if(o.type==="table"){let s=K(o,l,t);i.push(s);}return i.length===0&&i.push(chunkSUXJX72X_js.b.node("paragraph",{},[])),chunkSUXJX72X_js.b.node("doc",null,i)}function Re(e,n){let r=[],i=n?.styles?chunkIP2VXNWG_js.b(n.styles):null,t=n?.theme??null;for(let l of e)l.type==="paragraph"?r.push(...ne(l,i)):l.type==="table"&&r.push(K(l,i,t));return r.length===0&&r.push(chunkSUXJX72X_js.b.node("paragraph",{},[])),chunkSUXJX72X_js.b.node("doc",null,r)}function lt(e,n){return Re(e,n)}function st(){return chunkSUXJX72X_js.b.node("doc",null,[chunkSUXJX72X_js.b.node("paragraph",{},[])])}exports.a=it;exports.b=Re;exports.c=lt;exports.d=st;
|