@eigenpal/docx-editor-core 1.4.0 → 1.5.0
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.d.mts +7 -6
- package/dist/agent/index.d.ts +7 -6
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/chunk-2LVK7EF5.mjs +2 -0
- package/dist/chunk-3HENAL6V.mjs +2 -0
- package/dist/{chunk-BUEMXRXH.js → chunk-3SJQRYO7.js} +1 -1
- package/dist/chunk-4JPHW7ZI.js +2 -0
- package/dist/chunk-4RQAAKQI.mjs +1 -0
- package/dist/{chunk-OF373DBR.mjs → chunk-5HA66FH4.mjs} +1 -1
- package/dist/chunk-5WINQXA3.js +1 -0
- package/dist/{chunk-3QPKTG2Y.js → chunk-6KM4VW4L.js} +2 -2
- package/dist/chunk-AA6D2C6R.js +4 -0
- package/dist/{chunk-7CZEZ3UL.mjs → chunk-AMJNIGO2.mjs} +1 -1
- package/dist/chunk-BTSL4AYY.js +1 -0
- package/dist/{chunk-HPAUUQAX.mjs → chunk-CBKJOPOW.mjs} +1 -1
- package/dist/chunk-CDBKFBC2.mjs +15 -0
- package/dist/chunk-COV4LHQ7.js +1 -0
- package/dist/chunk-DZ3FN3JI.js +2 -0
- package/dist/chunk-ENIWJBS7.mjs +2 -0
- package/dist/{chunk-55XWETY4.mjs → chunk-EZNVVB63.mjs} +1 -1
- package/dist/{chunk-CHN26LLL.mjs → chunk-F24WZXN4.mjs} +1 -1
- package/dist/{chunk-ZBCFIW2V.js → chunk-GB7RICH6.js} +1 -1
- package/dist/{chunk-CZSAC65M.js → chunk-GFM6PERG.js} +1 -1
- package/dist/chunk-GKAXYZCE.mjs +1 -0
- package/dist/chunk-H57LNDBH.js +1 -0
- package/dist/chunk-IGYHDSM7.mjs +1 -0
- package/dist/{chunk-BH3ACQ3M.js → chunk-JQUIUKRO.js} +3 -3
- package/dist/chunk-L6ZRNW7Y.mjs +1 -0
- package/dist/{chunk-Q4IEATDJ.js → chunk-LJ2TB6CY.js} +1 -1
- package/dist/{chunk-DFUWJHKF.mjs → chunk-M3UL6EUU.mjs} +3 -3
- package/dist/chunk-M7KTKPGO.mjs +1 -0
- package/dist/chunk-MA3HLGFO.js +1 -0
- package/dist/chunk-ND33YQGU.js +1 -0
- package/dist/{chunk-KXVCCT2A.js → chunk-NPFFCPZ6.js} +1 -1
- package/dist/chunk-NTBZRITU.mjs +1 -0
- package/dist/{chunk-SCK6ZM5V.js → chunk-O2643IUW.js} +1 -1
- package/dist/chunk-P7HWOJC5.js +2 -0
- package/dist/{chunk-YNUPP7UG.mjs → chunk-PYDX4MOT.mjs} +2 -2
- package/dist/{chunk-CHTIWTHQ.mjs → chunk-QUM4DFRE.mjs} +1 -1
- package/dist/chunk-QVRMX2AC.js +15 -0
- package/dist/chunk-QXSDGNJ4.js +1 -0
- package/dist/{chunk-FYRJTDC4.mjs → chunk-QZPVZY6S.mjs} +1 -1
- package/dist/chunk-RT52EYG3.mjs +4 -0
- package/dist/chunk-SHYNWAW6.mjs +1 -0
- package/dist/chunk-SKBHY5MK.mjs +1 -0
- package/dist/chunk-SNTAAXXA.mjs +1 -0
- package/dist/chunk-T4O4PFJD.mjs +1 -0
- package/dist/chunk-TAQTZAVZ.js +1 -0
- package/dist/{chunk-2SGJZYQF.js → chunk-TDYWEVAE.js} +1 -1
- package/dist/{chunk-6IZOFIQH.js → chunk-TV6JLFY5.js} +1 -1
- package/dist/chunk-UKMKGIME.js +1 -0
- package/dist/chunk-UXPY65AC.js +1 -0
- package/dist/chunk-VDKSZ5BQ.mjs +1 -0
- package/dist/chunk-VJFIAFZ5.mjs +1 -0
- package/dist/chunk-WQRWRWSK.js +1 -0
- package/dist/chunk-WWVIVYX6.mjs +1 -0
- package/dist/chunk-WXSGCEBZ.js +1 -0
- package/dist/{chunk-GGUHM74A.mjs → chunk-WYFK4QOF.mjs} +1 -1
- package/dist/chunk-X6AICTHN.js +1 -0
- package/dist/chunk-YHXVNJK5.mjs +1 -0
- package/dist/{chunk-J3YFJDZD.js → chunk-ZETEPB7I.js} +1 -1
- package/dist/{colorResolver-8A-qj-LP.d.ts → colorResolver-C696sd9x.d.ts} +1 -1
- package/dist/{colorResolver-BCvxTlLF.d.mts → colorResolver-DCBfI4ld.d.mts} +1 -1
- package/dist/{content-3xF4WDE8.d.mts → content-BlWiORm-.d.mts} +3 -147
- package/dist/{content-C8fc_tL6.d.ts → content-eG_Rtl0l.d.ts} +3 -147
- package/dist/{contentControlValues-DGDKD589.d.ts → contentControlValues-CO7pUqOf.d.ts} +1 -1
- package/dist/{contentControlValues-DjWvoJQ-.d.mts → contentControlValues-DfYN9BZ8.d.mts} +1 -1
- package/dist/core-plugins.d.mts +4 -3
- package/dist/core-plugins.d.ts +4 -3
- package/dist/core-plugins.js +1 -1
- package/dist/core-plugins.mjs +1 -1
- package/dist/core.d.mts +11 -10
- package/dist/core.d.ts +11 -10
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/{documentStyles-qR0VR2s0.d.mts → documentStyles-1G0xTl1v.d.mts} +1 -1
- package/dist/{documentStyles-C7k_8Sye.d.ts → documentStyles-Bw98BwEy.d.ts} +1 -1
- package/dist/docx/index.d.mts +7 -67
- package/dist/docx/index.d.ts +7 -67
- package/dist/docx/index.js +1 -1
- package/dist/docx/index.mjs +1 -1
- package/dist/docx/parser.d.mts +4 -3
- package/dist/docx/parser.d.ts +4 -3
- package/dist/docx/parser.js +1 -1
- package/dist/docx/parser.mjs +1 -1
- package/dist/docx/rezip.d.mts +4 -3
- package/dist/docx/rezip.d.ts +4 -3
- package/dist/docx/rezip.js +1 -1
- package/dist/docx/rezip.mjs +1 -1
- package/dist/docx/serializer/index.d.mts +5 -4
- package/dist/docx/serializer/index.d.ts +5 -4
- package/dist/docx/serializer/index.js +1 -1
- package/dist/docx/serializer/index.mjs +1 -1
- package/dist/editor/index.d.mts +4 -3
- package/dist/editor/index.d.ts +4 -3
- package/dist/editor/index.js +1 -1
- package/dist/editor/index.mjs +1 -1
- package/dist/{fontLoader-CUS1BPv7.d.mts → fontLoader-3MFD_Hj2.d.mts} +48 -5
- package/dist/{fontLoader-Dl9SEKex.d.ts → fontLoader-C6VvBUVB.d.ts} +48 -5
- package/dist/{formatting-BH4hcZiq.d.mts → formatting-DFtuRFQY.d.mts} +13 -0
- package/dist/{formatting-_OXU8gLB.d.ts → formatting-JhqWT_XM.d.ts} +13 -0
- package/dist/{headerFooterLayout-CU6hvszp.d.mts → headerFooterLayout-DJb-dV7X.d.mts} +2 -2
- package/dist/{headerFooterLayout-AtAOhM8E.d.ts → headerFooterLayout-bdHWlU6g.d.ts} +2 -2
- package/dist/headless.d.mts +9 -8
- package/dist/headless.d.ts +9 -8
- package/dist/headless.js +1 -1
- package/dist/headless.mjs +1 -1
- package/dist/layout-bridge/clickToPositionDom.js +1 -1
- package/dist/layout-bridge/clickToPositionDom.mjs +1 -1
- package/dist/layout-bridge/index.d.mts +5 -4
- package/dist/layout-bridge/index.d.ts +5 -4
- package/dist/layout-bridge/index.js +1 -1
- package/dist/layout-bridge/index.mjs +1 -1
- package/dist/layout-bridge/measuring/index.d.mts +3 -2
- package/dist/layout-bridge/measuring/index.d.ts +3 -2
- 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.d.mts +4 -3
- package/dist/layout-bridge/toFlowBlocks.d.ts +4 -3
- package/dist/layout-bridge/toFlowBlocks.js +1 -1
- package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
- package/dist/layout-engine/index.d.mts +4 -3
- package/dist/layout-engine/index.d.ts +4 -3
- package/dist/layout-engine/index.js +1 -1
- package/dist/layout-engine/index.mjs +1 -1
- package/dist/layout-engine/types.d.mts +21 -9
- package/dist/layout-engine/types.d.ts +21 -9
- package/dist/layout-painter/index.d.mts +5 -4
- package/dist/layout-painter/index.d.ts +5 -4
- package/dist/layout-painter/index.js +1 -1
- package/dist/layout-painter/index.mjs +1 -1
- package/dist/layout-painter/renderPage.d.mts +5 -4
- package/dist/layout-painter/renderPage.d.ts +5 -4
- package/dist/layout-painter/renderPage.js +1 -1
- package/dist/layout-painter/renderPage.mjs +1 -1
- package/dist/lists-Bn29SzeS.d.ts +148 -0
- package/dist/lists-CyGxd5Y2.d.mts +148 -0
- package/dist/managers/AutoSaveManager.d.mts +4 -3
- package/dist/managers/AutoSaveManager.d.ts +4 -3
- package/dist/managers/TableSelectionManager.d.mts +4 -3
- package/dist/managers/TableSelectionManager.d.ts +4 -3
- package/dist/managers/types.d.mts +4 -3
- package/dist/managers/types.d.ts +4 -3
- package/dist/{marks-BY573yZn.d.mts → marks-CzrbFi4o.d.mts} +1 -1
- package/dist/{marks-CjC9tF5k.d.ts → marks-Dq1QsxKA.d.ts} +1 -1
- package/dist/mcp-cli.mjs +23 -23
- package/dist/mcp.d.mts +4 -3
- package/dist/mcp.d.ts +4 -3
- package/dist/mcp.js +3 -3
- package/dist/mcp.mjs +7 -7
- package/dist/{nodes-75Q9GBxV.d.ts → nodes-BJef4KFW.d.ts} +17 -2
- package/dist/{nodes-cEI7hVY2.d.mts → nodes-RfTS-NSv.d.mts} +17 -2
- package/dist/numberingParser-ZSQ3SDCV.d.ts +81 -0
- package/dist/numberingParser-nSPZlzKr.d.mts +81 -0
- package/dist/prosemirror/applyFormatting.d.mts +5 -2
- package/dist/prosemirror/applyFormatting.d.ts +5 -2
- package/dist/prosemirror/applyFormatting.js +1 -1
- package/dist/prosemirror/applyFormatting.mjs +1 -1
- package/dist/prosemirror/cellDragSelection.d.mts +46 -0
- package/dist/prosemirror/cellDragSelection.d.ts +46 -0
- package/dist/prosemirror/cellDragSelection.js +1 -0
- package/dist/prosemirror/cellDragSelection.mjs +1 -0
- package/dist/prosemirror/commands/formatting.d.mts +2 -2
- package/dist/prosemirror/commands/formatting.d.ts +2 -2
- package/dist/prosemirror/commands/formatting.js +1 -1
- package/dist/prosemirror/commands/formatting.mjs +1 -1
- package/dist/prosemirror/commands/index.d.mts +32 -3
- package/dist/prosemirror/commands/index.d.ts +32 -3
- package/dist/prosemirror/commands/index.js +1 -1
- package/dist/prosemirror/commands/index.mjs +1 -1
- package/dist/prosemirror/commands/paragraph.d.mts +11 -1
- package/dist/prosemirror/commands/paragraph.d.ts +11 -1
- package/dist/prosemirror/commands/paragraph.js +1 -1
- package/dist/prosemirror/commands/paragraph.mjs +1 -1
- package/dist/prosemirror/commentIdAllocator.d.mts +3 -2
- package/dist/prosemirror/commentIdAllocator.d.ts +3 -2
- package/dist/prosemirror/commentOps.d.mts +3 -2
- package/dist/prosemirror/commentOps.d.ts +3 -2
- package/dist/prosemirror/conversion/fromProseDoc.d.mts +4 -3
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +4 -3
- package/dist/prosemirror/conversion/fromProseDoc.js +1 -1
- package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -1
- package/dist/prosemirror/conversion/index.d.mts +4 -3
- package/dist/prosemirror/conversion/index.d.ts +4 -3
- package/dist/prosemirror/conversion/index.js +1 -1
- package/dist/prosemirror/conversion/index.mjs +1 -1
- package/dist/prosemirror/editor.css +13 -0
- package/dist/prosemirror/extensions/index.d.mts +1 -1
- package/dist/prosemirror/extensions/index.d.ts +1 -1
- package/dist/prosemirror/extensions/index.js +1 -1
- package/dist/prosemirror/extensions/index.mjs +1 -1
- package/dist/prosemirror/extensions/nodes/TableExtension.js +1 -1
- package/dist/prosemirror/extensions/nodes/TableExtension.mjs +1 -1
- package/dist/prosemirror/index.d.mts +20 -10
- package/dist/prosemirror/index.d.ts +20 -10
- package/dist/prosemirror/index.js +3 -3
- package/dist/prosemirror/index.mjs +3 -3
- package/dist/prosemirror/plugins/index.d.mts +5 -4
- package/dist/prosemirror/plugins/index.d.ts +5 -4
- package/dist/prosemirror/plugins/index.js +1 -1
- package/dist/prosemirror/plugins/index.mjs +1 -1
- package/dist/prosemirror/plugins/selectionTracker.d.mts +1 -1
- package/dist/prosemirror/plugins/selectionTracker.d.ts +1 -1
- package/dist/prosemirror/queries.d.mts +45 -3
- package/dist/prosemirror/queries.d.ts +45 -3
- package/dist/prosemirror/queries.js +2 -2
- package/dist/prosemirror/queries.mjs +2 -2
- package/dist/prosemirror/schema/index.d.mts +5 -4
- package/dist/prosemirror/schema/index.d.ts +5 -4
- package/dist/prosemirror/schema/index.js +1 -1
- package/dist/prosemirror/schema/index.mjs +1 -1
- package/dist/prosemirror/styles/index.d.mts +2 -2
- package/dist/prosemirror/styles/index.d.ts +2 -2
- package/dist/prosemirror/tableResize.js +1 -1
- package/dist/prosemirror/tableResize.mjs +1 -1
- package/dist/prosemirror/utils/extractTrackedChanges.d.mts +3 -2
- package/dist/prosemirror/utils/extractTrackedChanges.d.ts +3 -2
- package/dist/prosemirror/utils/extractTrackedChanges.js +1 -1
- package/dist/prosemirror/utils/extractTrackedChanges.mjs +1 -1
- package/dist/{sectionPropertiesSerializer-D86QlzlT.d.mts → sectionPropertiesSerializer-C8XCmzE4.d.mts} +1 -1
- package/dist/{sectionPropertiesSerializer-uXyGONxu.d.ts → sectionPropertiesSerializer-S8J1V9mb.d.ts} +1 -1
- package/dist/{selectionContext-BPAqgNgk.d.ts → selectionContext-BJZZW1JA.d.ts} +1 -1
- package/dist/{selectionContext-CoZat7QZ.d.mts → selectionContext-BjMyVQZO.d.mts} +1 -1
- package/dist/{styles-BOJ93SAm.d.mts → styles-Dqec8Aw6.d.mts} +1 -1
- package/dist/{styles-BWqX2AS-.d.ts → styles-gEujs7j6.d.ts} +1 -1
- package/dist/types/agentApi.d.mts +1 -1
- package/dist/types/agentApi.d.ts +1 -1
- package/dist/types/content.d.mts +3 -2
- package/dist/types/content.d.ts +3 -2
- package/dist/types/document.d.mts +7 -5
- package/dist/types/document.d.ts +7 -5
- package/dist/utils/comments.d.mts +3 -2
- package/dist/utils/comments.d.ts +3 -2
- package/dist/utils/index.d.mts +6 -5
- package/dist/utils/index.d.ts +6 -5
- package/dist/utils/index.js +3 -3
- package/dist/utils/index.mjs +3 -3
- package/dist/{variableDetector-CaY-sDau.d.mts → variableDetector-CN9_pUR_.d.mts} +1 -1
- package/dist/{variableDetector-1mxzPfs2.d.ts → variableDetector-o4Rb2Csy.d.ts} +1 -1
- package/package.json +9 -1
- package/dist/chunk-2WGTGBBS.js +0 -2
- package/dist/chunk-3G44SFHX.mjs +0 -4
- package/dist/chunk-77GRQUSK.js +0 -1
- package/dist/chunk-7LRR7RKE.mjs +0 -15
- package/dist/chunk-CRMZH7U7.mjs +0 -2
- package/dist/chunk-D3PRIF3Y.mjs +0 -1
- package/dist/chunk-EM33RGHT.mjs +0 -1
- package/dist/chunk-ESCPS4AO.mjs +0 -1
- package/dist/chunk-EUZLYQRB.mjs +0 -1
- package/dist/chunk-EV4LVK4X.js +0 -1
- package/dist/chunk-FW23IMBF.mjs +0 -1
- package/dist/chunk-HKN2NKOG.mjs +0 -1
- package/dist/chunk-INDYZOOS.js +0 -1
- package/dist/chunk-IUJCUITW.mjs +0 -1
- package/dist/chunk-IYKBX24M.js +0 -1
- package/dist/chunk-JHTURDPX.mjs +0 -1
- package/dist/chunk-KAOLVBLH.js +0 -1
- package/dist/chunk-L5NPEM7C.js +0 -1
- package/dist/chunk-LERLET2D.js +0 -4
- package/dist/chunk-MNOHUTKE.js +0 -15
- package/dist/chunk-NAFMAKLK.js +0 -2
- package/dist/chunk-OEC6SBDV.mjs +0 -1
- package/dist/chunk-OTHV7YV2.js +0 -2
- package/dist/chunk-QAJSNLJR.mjs +0 -1
- package/dist/chunk-RSU4HTC6.js +0 -1
- package/dist/chunk-TUIEV7Q7.js +0 -1
- package/dist/chunk-U67MWOPZ.mjs +0 -1
- package/dist/chunk-UE2ZKRYB.mjs +0 -2
- package/dist/chunk-WVERBZZU.js +0 -1
- package/dist/chunk-WWNOXNEX.mjs +0 -2
- package/dist/chunk-XLB6AC5Q.js +0 -1
- package/dist/chunk-YPQACU4A.js +0 -1
- package/dist/chunk-ZX26QZJ5.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-FCJWLEKT.mjs';import {c as c$2}from'./chunk-7E5VBRDL.mjs';import {a as a$2}from'./chunk-MOCGHQ4A.mjs';import {a,b,c as c$1}from'./chunk-QPFJJPIC.mjs';import {a as a$3}from'./chunk-AMENZY5F.mjs';import {c}from'./chunk-VW22RZ6C.mjs';function J(e,t,n,r){let i=e-t-n,o=(r.count-1)*r.gap;return (i-o)/r.count}function fe(e){let t={...e.pageSize},n={...e.margins},r=e.columns??{count:1,gap:0},i=false,o,s,a=[],l=[];function u(){return t.h-n.bottom}function c(){return u()-n.top}function g(){return t.w-n.left-n.right}if(c()<=0)throw new Error(`Paginator: page size and margins yield no content area (pageSize=${Math.round(t.w)}x${Math.round(t.h)} margins top=${Math.round(n.top)} bottom=${Math.round(n.bottom)} left=${Math.round(n.left)} right=${Math.round(n.right)})`);let d=J(t.w,n.left,n.right,r),S=n.top;function P(h){return n.left+h*(d+r.gap)}function M(){(o||s)&&(o&&(t=o),s&&(n=s),o=void 0,s=void 0,d=J(t.w,n.left,n.right,r));let h=a.length+1,F=n.top,v=u(),m=e.footnoteReservedHeights?.get(h)??0,p=v-m,x={number:h,fragments:[],margins:{...n},size:{...t},footnoteReservedHeight:m>0?m:void 0,columns:r.count>1?{...r}:void 0},b={page:x,cursorY:F,columnIndex:0,topMargin:F,contentBottom:p,trailingSpacing:0};return a.push(x),l.push(b),S=F,e.onNewPage&&e.onNewPage(b),b}function B(){return l.length===0?M():l[l.length-1]}function T(h){return h.contentBottom-h.cursorY}function I(h,F){let v=F||B();return T(v)>=h}function w(h){return h.columnIndex<r.count-1?(h.columnIndex+=1,h.cursorY=S,h.trailingSpacing=0,h):M()}function C(h){let F=B(),v=Number.isFinite(h)&&h>0?h:0;for(;!I(v,F);){let m=F.contentBottom-F.topMargin;if(v>m)return i||(i=true,console.warn(`Paginator: fragment height ${v.toFixed(0)}px exceeds page content height ${m.toFixed(0)}px; placing with overflow.`)),F.cursorY!==F.topMargin&&(F=w(F)),F;F=w(F);}return F}function R(h,F,v=0,m=0){let p=Math.max(v,B().trailingSpacing),x=p+F,b=C(x),y=p,z=P(b.columnIndex),k=b.cursorY+y;return h.x=z,h.y=k,b.page.fragments.push(h),b.cursorY=k+F,b.trailingSpacing=m,{state:b,x:z,y:k}}function f(){if(l.length>0){let h=l[l.length-1];if(h.page.fragments.length===0&&h.cursorY===h.topMargin)return h}return M()}function L(){let h=B();return w(h)}function H(h){r=h,d=J(t.w,n.left,n.right,r);let F=B();F.page.columns=r.count>1?{...r}:void 0,S=F.cursorY,F.columnIndex=0;}function W(h,F,v=true){if(!v){o=h?{...h}:o,s=F?{...F}:s;return}if(h&&(t={...h}),F&&(n={...F}),c()<=0)throw new Error("Paginator: section page size and margins yield no content area");d=J(t.w,n.left,n.right,r),o=void 0,s=void 0;}return {pages:a,states:l,get columnWidth(){return d},get columns(){return {...r}},getCurrentState:B,getAvailableHeight:()=>T(B()),getContentWidth:g,fits:h=>I(h),ensureFits:C,addFragment:R,forcePageBreak:f,forceColumnBreak:L,getColumnX:P,updateColumns:H,updatePageLayout:W}}function ge(e){let t=new Map,n=new Set;for(let r=0;r<e.length;r++){if(n.has(r))continue;let i=e[r];if(i.kind!=="paragraph"||!i.attrs?.keepNext)continue;let s=[r],a=r;for(let c=r+1;c<e.length;c++){let g=e[c];if(g.kind==="sectionBreak"||g.kind==="pageBreak"||g.kind==="columnBreak"||g.kind!=="paragraph")break;if(g.attrs?.keepNext)s.push(c),a=c,n.add(c);else break}let l=a+1,u=-1;if(l<e.length){let c=e[l];c.kind!=="sectionBreak"&&c.kind!=="pageBreak"&&c.kind!=="columnBreak"&&(u=l);}t.set(r,{startIndex:r,endIndex:a,memberIndices:s,anchorIndex:u});}return t}function me(e,t,n){let r=0;for(let i of e.memberIndices){let o=t[i],s=n[i];if(o.kind!=="paragraph"||s.kind!=="paragraph")continue;let a=o,l=s,u=a.attrs?.spacing?.before??0;r+=u,r+=l.totalHeight;let c=a.attrs?.spacing?.after??0;r+=c;}if(e.anchorIndex!==-1){let i=n[e.anchorIndex];if(i?.kind==="paragraph"){let o=i;o.lines.length>0&&(r+=o.lines[0].lineHeight);}}return r}function pe(e){let t=new Set;for(let n of e.values())for(let r=1;r<n.memberIndices.length;r++)t.add(n.memberIndices[r]);return t}function it(e){return e.kind!=="paragraph"?false:e.attrs?.keepLines===true}function de(e){return e.kind!=="paragraph"?false:e.attrs?.pageBreakBefore===true}function $(e){return e.displayMode==="float"||a(e.wrapType)||e.wrapType==="topAndBottom"}function ot(e){return $(e)&&e.wrapType==="topAndBottom"}function at(e){return $(e)&&!b(e.wrapType)&&e.wrapType!=="topAndBottom"}function qt(e,t,n){if(!(!e||e<=0)){if(t==="pct")return n*e/5e3;if(!t||t==="dxa"||t==="auto")return c(e)}}function Ce(e){let t=new Map,n=[];for(let r=0;r<e.rows.length;r++){let i=e.rows[r]?.cells??[],o=t.get(r)??new Set,s=0;for(;o.has(s);)s++;for(let a=0;a<i.length;a++){let l=i[a];if(!l)continue;let u=l.colSpan??1,c=l.rowSpan??1;if(n.push({rowIndex:r,cellIndex:a,columnIndex:s,colSpan:u,rowSpan:c}),c>1)for(let g=r+1;g<r+c;g++){t.has(g)||t.set(g,new Set);let d=t.get(g);for(let S=0;S<u;S++)d.add(s+S);}for(s+=u;o.has(s);)s++;}}return n}function Jt(e){return Math.max(1,...e.rows.map(t=>t.cells.reduce((n,r)=>n+Math.max(1,r.colSpan??1),0)))}function Qt(e,t,n){if(t<=0)return [];let r=n>0?n/t:0;if(e.length===0)return Array(t).fill(r);let i=e.slice(0,t),o=t-i.length;if(o>0){let c=i.filter(d=>d>0),g=c.length>0?c.reduce((d,S)=>d+S,0)/c.length:r;i=i.concat(Array(o).fill(g));}let s=i.reduce((c,g)=>c+(g>0?g:0),0),a=i.filter(c=>c<=0).length;if(s<=0)return Array(t).fill(r);if(a===0)return i;let l=Math.max(0,n-s),u=l>0?l/a:s/Math.max(1,t-a);return i.map(c=>c>0?c:u)}function Re(e,t,n){let r=[],i=[],o=n,s=0,a=t?.length??0;for(let l=0;l<a;l++){let u=t[l],c=e?.[l];if(c?.kind==="paragraph"&&u?.kind==="paragraph"){let g=c.attrs?.spacing;o+=Math.max(s,g?.before??0);let d=[];for(let S of u.lines)o+=S.floatSkipBefore??0,d.push(o),o+=S.lineHeight,i.push(o);r.push(d),s=g?.after??0;}else u&&"totalHeight"in u&&typeof u.totalHeight=="number"?(o+=s+u.totalHeight,r.push([]),i.push(o),s=0):r.push([]);}return {lineTops:r,flatBottoms:i,contentHeight:o-n+s}}function Le(e,t){let n=t.rows.length,r=[],i=0;for(let a=0;a<n;a++)r.push(i),i+=t.rows[a]?.height??0;r.push(i);let o=Ce(e),s=[];for(let a=0;a<n;a++){let l=t.rows[a]?.height??0,u=new Set;u.add(l);for(let c of o){if(c.rowIndex>a||c.rowIndex+c.rowSpan-1<a)continue;let g=e.rows[c.rowIndex]?.cells?.[c.cellIndex],d=t.rows[c.rowIndex]?.cells?.[c.cellIndex];if(!g||!d)continue;let S=g.padding?.top??0,{flatBottoms:P}=Re(g.blocks,d.blocks,S),M=r[a]-r[c.rowIndex];for(let B of P){let T=B-M;T>0&&T<l&&u.add(T);}}s.push([...u].sort((c,g)=>c-g));}return {rowTops:r,breakOffsets:s}}function ke(e,t,n,r){let i=e.breakOffsets[t];if(!i||i.length===0)return 0;let o=n+r,s=0;for(let a of i)if(!(a<=n))if(a<=o)s=a-n;else break;return s}var st=1440,he=96,ve=st/he,Ee=11,We="Calibri",lt=1,ut=.8,ct=.2,j=null;function be(){if(!j){let e=typeof document<"u"?document.createElement("canvas"):null;if(!e)throw new Error("Canvas not available. Ensure this runs in a DOM environment.");if(j=e.getContext("2d"),!j)throw new Error("Failed to get 2D context from canvas")}return j}function sn(){j=null;}var Ie=new Map;function He(e){let t=Ie.get(e);if(t===void 0){let n=a$3(e);t={cssFallback:n.cssFallback,singleLineRatio:n.singleLineRatio},Ie.set(e,t);}return t}function ft(e){return He(e).cssFallback}function xe(e){let t=[];e.italic&&t.push("italic"),e.bold&&t.push("bold");let n=e.fontSize??Ee,r=Y(n);t.push(`${r}px`);let i=e.fontFamily??We;return t.push(ft(i)),t.join(" ")}function V(e){let t=e.fontSize??Ee,n=e.fontFamily??We,r=Y(t),i=r*ut,o=r*ct,s=r*lt;try{let l=be();l.font=xe(e);let u=l.measureText("Hg");typeof u.actualBoundingBoxAscent=="number"&&typeof u.actualBoundingBoxDescent=="number"&&(i=u.actualBoundingBoxAscent,o=u.actualBoundingBoxDescent);}catch{}s=Math.max(s,i+o);let a=He(n).singleLineRatio;return {fontSize:t,ascent:i,descent:o,lineHeight:s,fontFamily:n,singleLineRatio:a}}function O(e,t){if(!e)return 0;let n=be();n.font=xe(t);let i=n.measureText(e).width;return t.letterSpacing&&e.length>1&&(i+=t.letterSpacing*(e.length-1)),i}function ln(e,t){let n=O(e,t),r=V(t);return {width:n,height:r.ascent+r.descent,ascent:r.ascent,descent:r.descent}}function Ae(e,t){let n=V(t);if(!e)return {width:0,charWidths:[],metrics:n};let r=be();r.font=xe(t);let i=t.letterSpacing??0,o=[],s=0;for(let a=0;a<e.length;a++){let l=e[a],c=r.measureText(l).width;i&&a<e.length-1&&(c+=i),o.push(c),s+=c;}return {width:s,charWidths:o,metrics:n}}function un(e,t){if(t.length===0||e<=0)return 0;let n=0;for(let r=0;r<t.length;r++){let i=t[r],o=n+i/2;if(e<=o)return r;n+=i;}return t.length}function cn(e,t){if(e<=0||t.length===0)return 0;let n=Math.min(e,t.length),r=0;for(let i=0;i<n;i++)r+=t[i];return r}function fn(e){return e/ve}function gn(e){return Math.round(e*ve)}function Y(e){return e*he/72}function gt(e){return e*72/he}function mn(e){return Y(e/2)}function pn(e){return gt(e)*2}function Se(e){return e/1440*96}function Me(e){return e/96*1440}function mt(e){let{explicitStops:t=[],defaultTabInterval:n=720,leftIndent:r=0}=e,i=t.filter(g=>g.val!=="clear").filter(g=>g.pos>=r),o=t.filter(g=>g.val==="clear").map(g=>g.pos),s=i.reduce((g,d)=>Math.max(g,d.pos),0),a=[...i];r>0&&!i.some(g=>g.pos<=r)&&(o.some(d=>Math.abs(d-r)<20)||a.push({val:"start",pos:r,leader:"none"}));let u=s>0?Math.max(s,r):r,c=r+14400;for(;u<c;){u+=n;let g=i.some(P=>Math.abs(P.pos-u)<20),d=o.some(P=>Math.abs(P-u)<20),S=r>0&&Math.abs(u-r)<20;!g&&!d&&!S&&a.push({val:"start",pos:u,leader:"none"});}return a.sort((g,d)=>g.pos-d.pos)}function Oe(e,t,n={}){let{defaultTabInterval:r=720}=t,i=Me(e),s=mt(t).find(u=>u.pos>i);if(!s){let u=Se(r),c=u-e%u;return c<=0&&(c=u),{width:c,alignment:"default"}}let l=Se(s.pos)-e;if(s.val==="center")l-=(n.followingWidth??0)/2;else if(s.val==="end")l-=n.followingWidth??0;else if(s.val==="decimal")l-=n.decimalPrefixWidth??0;else if(s.val==="bar")return {width:0,leader:s.leader,alignment:"bar"};if(l<1){let u=Se(r),c=u-e%u;return c<=0&&(c=u),{width:c,alignment:"default"}}return {width:l,leader:s.leader,alignment:s.val}}var pt="Calibri",dt=11;function ht(e){let t=e.attrs,n=e.runs?.find(o=>o.kind==="text"),r=t?.listMarkerFontFamily??n?.fontFamily??t?.defaultFontFamily??pt,i=t?.listMarkerFontSize??n?.fontSize??t?.defaultFontSize??dt;return {fontFamily:r,fontSize:i}}function _e(e){let t=e.attrs;if(!t?.listMarker||t.listMarkerHidden)return 0;let n=t.indent,r=n?.hanging??0;if(r>0)return r;let{fontFamily:i,fontSize:o}=ht(e),s={fontFamily:i,fontSize:o},a=O(t.listMarker,s),l=t.listMarkerSuffix??"tab";if(l==="nothing")return a;if(l==="space")return a+O(" ",s);let u=n?.left??0,c=n?.firstLine??0,g=u+c,d=g+a,S=(t.tabs??[]).filter(T=>T.val!=="clear"&&T.val!=="bar").map(T=>a$1(T.pos)).filter(T=>T>=d).sort((T,I)=>T-I)[0],P=a$1(t.defaultTabStopTwips??a$2),M=P>0?(Math.floor(d/P)+1)*P:void 0,B;return S!==void 0&&M!==void 0?B=Math.min(S,M):B=S??M,B===void 0?a+Y(o)*.5:B-g}var D=11,X="Calibri",bt=1.15,ne=1,Z=.5;function ze(e,t,n,r=false){let i=1,o=e.length,s=0;for(;i<=o;){let a=i+o>>>1;O(e.slice(0,a),t)<=n?(s=a,i=a+1):o=a-1;}return r&&s===0?1:s}function q(e){return {fontFamily:e.fontFamily??X,fontSize:e.fontSize??D,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function De(e,t,n){let r=Y(e),i=n?.ascent??r*.8,o=n?.descent??r*.2,s=n?.singleLineRatio??1.15,a=r*s,l;if(t?.lineRule==="exact"&&t.line!==void 0)l=t.line;else if(t?.lineRule==="atLeast"&&t.line!==void 0){let u=a*ne;l=Math.max(t.line,u);}else t?.line!==void 0&&t?.lineUnit==="multiplier"?l=a*t.line:t?.line!==void 0&&t?.lineUnit==="px"?l=t.line:l=a*ne;return {ascent:i,descent:o,lineHeight:l}}function Ne(e,t,n){let r=V({fontSize:e,fontFamily:n??X}),i=De(e,t,r),o=t?.lineRule??"auto";if(o==="auto"||o==="atLeast"){let s=Y(e),a=Math.max(i.lineHeight,s*bt);if(a!==i.lineHeight)return {...i,lineHeight:a}}return i}function Q(e){return e.kind==="text"}function Ze(e){return e.kind==="tab"}function Ue(e){return e.kind==="image"}function Xe(e){return e.kind==="lineBreak"}function Ge(e){return e.kind==="field"}function xt(e){return !e.text||e.text.replace(/\u00a0/g," ").trim().length===0}function St(e,t){let n=0;for(let r=t+1;r<e.length;r++){let i=e[r];if(Ze(i)||Xe(i))break;if(Q(i))n+=O(i.text||"",q(i));else if(Ge(i)){let o={fontFamily:i.fontFamily??X,fontSize:i.fontSize??D,bold:i.bold,italic:i.italic};n+=O(i.fallback||"1",o);}else Ue(i)&&(n+=i.width||0);}return n}function Mt(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];(r===" "||r==="-"||r===" ")&&t.push(n+1);}return t}function Ke(e,t,n){let r=Math.max(1,n),i=Math.max(0,e),o=Math.max(0,t);return i>=r||o>=r||i+o>=r?{leftMargin:0,rightMargin:0}:{leftMargin:i,rightMargin:o}}function Tt(e,t,n){let r=e.runs,i=e.attrs,o=i?.spacing,s=n?.floatingZones,a=n?.paragraphYOffset??0,l=i?.indent,u=l?.left??0,c=l?.right??0,g=(l?.firstLine??0)-(l?.hanging??0),d=Math.max(1,t-u-c),S=(l?.hanging??0)===0?_e(e):0,P=Math.max(1,d-g-S),M=0,B=0,T=Y(D)*ne,I=(m,p)=>{if(!s||s.length===0)return;let x=a+M,b=Ye(x,m,s,p,U)-x;b>0&&(M+=b,B+=b);};I(T,P);let w=te(M,T,s,a),C=Math.max(1,ee(w,P)),R=[];if(r.length===0){if(i?.suppressEmptyParagraphHeight)return R.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,ascent:0,descent:0,lineHeight:0}),{kind:"paragraph",lines:R,totalHeight:0};let m=i?.defaultFontSize??D,p=i?.defaultFontFamily??X,x=Ne(m,o,p);R.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...x});let b=x.lineHeight;return o?.before&&(b+=o.before),o?.after&&(b+=o.after),{kind:"paragraph",lines:R,totalHeight:b}}if(r.length===1&&Q(r[0])&&xt(r[0])){let m=r[0],p=m.fontSize??i?.defaultFontSize??D,x=m.fontFamily??i?.defaultFontFamily??X,b=Ne(p,o,x);R.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...b});let y=b.lineHeight;return o?.before&&(y+=o.before),o?.after&&(y+=o.after),{kind:"paragraph",lines:R,totalHeight:y}}let f={fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,maxFontSize:D,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:C,leftOffset:w.leftMargin,rightOffset:w.rightMargin,segmentZones:w.segments},L=()=>{let m=De(f.maxFontSize,o,f.maxFontMetrics),p={...m};if(f.maxImageHeightPx>p.lineHeight){let b=f.maxImageHeightPx,y=p.descent;f.fromRun===f.toRun?(p.lineHeight=b+y*2,p.ascent=b+y):(p.lineHeight=b+y,p.ascent=b);}let x={fromRun:f.fromRun,fromChar:f.fromChar,toRun:f.toRun,toChar:f.toChar,width:f.width,...p};f.leftOffset>0&&(x.leftOffset=f.leftOffset),f.rightOffset>0&&(x.rightOffset=f.rightOffset),f.segmentZones?.length&&(x.segments=H(x,f.segmentZones)),B>0&&(x.floatSkipBefore=B,B=0),R.push(x),M+=m.lineHeight;},H=(m,p)=>{let x=p[0],b=p[1];if(!x)return;if(!b||m.width<=x.availableWidth+Z)return [{fromRun:m.fromRun,fromChar:m.fromChar,toRun:m.toRun,toChar:m.toChar,width:m.width,leftOffset:x.leftOffset,availableWidth:x.availableWidth}];if(m.fromRun!==m.toRun)return;let y=r[m.fromRun];if(!y||!Q(y))return;let z=y,k=z.text.slice(m.fromChar,m.toChar),_=q(z),E=ze(k,_,x.availableWidth);if(E<=0||E>=k.length)return;let N=m.fromChar+E,A=k.slice(0,E),K=k.slice(E);return [{fromRun:m.fromRun,fromChar:m.fromChar,toRun:m.toRun,toChar:N,width:O(A,_),leftOffset:x.leftOffset,availableWidth:x.availableWidth},{fromRun:m.fromRun,fromChar:N,toRun:m.toRun,toChar:m.toChar,width:O(K,_),leftOffset:b.leftOffset,availableWidth:b.availableWidth}]},W=(m,p)=>{L();let x=Y(D)*ne;I(x,d);let b=te(M,x,s,a),y=Math.max(1,ee(b,d));f={fromRun:m,fromChar:p,toRun:m,toChar:p,width:0,maxFontSize:D,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:y,leftOffset:b.leftMargin,rightOffset:b.rightMargin,segmentZones:b.segments};},h=m=>{let p=m.fontSize??D;(!f.maxFontMetrics||p>f.maxFontSize)&&(f.maxFontSize=p,f.maxFontMetrics=V(m));};for(let m=0;m<r.length;m++){let p=r[m];if(Xe(p)){f.toRun=m,f.toChar=0,W(m+1,0);continue}if(Ze(p)){let x=q(p);h(x);let b=St(r,m),y=f.width+(f.leftOffset??0),z=R.length===0,k=u+(z?g:0)+y,_={explicitStops:i?.tabs,leftIndent:Me(u)},E=Oe(k,_,{followingWidth:b}).width;if(y+E>f.availableWidth+Z){let N=f.availableWidth-y-b;N>1&&(E=N);}f.width+E>f.availableWidth+Z&&(W(m,0),h(x)),f.width+=E,f.toRun=m,f.toChar=1;continue}if(Ue(p)){let x=p.wrapType,b=p.displayMode==="float"||c$1(x);if(p.position&&b){f.toRun=m,f.toChar=1;continue}if(x==="topAndBottom"||p.displayMode==="block"){f.width>0&&W(m,0);let N=p.height,A=p.distTop??6,K=p.distBottom??6;f.toRun=m,f.toChar=1,f.maxImageHeightPx=N+A+K,W(m+1,0);continue}let y=p.width,z=p.height;f.width+y>f.availableWidth+Z&&W(m,0);let k=y>0&&y>f.availableWidth?f.availableWidth/y:1,E=z*k+(p.distTop??0)+(p.distBottom??0);E>f.maxImageHeightPx&&(f.maxImageHeightPx=E),f.width+=y,f.toRun=m,f.toChar=1;continue}if(Ge(p)){let x=p.fallback||"1",b={fontFamily:p.fontFamily??X,fontSize:p.fontSize??D,bold:p.bold,italic:p.italic};h(b);let y=O(x,b);f.width>0&&f.width+y>f.availableWidth+Z&&(W(m,0),h(b)),f.width+=y,f.toRun=m,f.toChar=1;continue}if(Q(p)){let x=p,b=x.text,y=q(x);if(h(y),!b||b.length===0){f.toRun=m,f.toChar=0;continue}let z=Mt(b),k=0;for(;k<b.length;){let _=b.length;for(let A of z)if(A>k){_=A;break}let E=b.slice(k,_),N=O(E,y);if(N>f.availableWidth+Z){let A=0;for(;A<E.length;){let K=f.availableWidth-f.width+Z,tt=E.slice(A),oe=ze(tt,y,K);if(oe===0){if(f.width>0){W(m,k+A),h(y);continue}oe=1;}let ae=A+oe,nt=E.slice(A,ae),rt=O(nt,y);f.width+=rt,f.toRun=m,f.toChar=k+ae,A=ae,A<E.length&&(W(m,k+A),h(y));}k=_;continue}f.width>0&&f.width+N>f.availableWidth+Z&&(W(m,k),h(y)),f.width+=N,f.toRun=m,f.toChar=_,k=_;}}}L();let v=R.reduce((m,p)=>m+p.lineHeight+(p.floatSkipBefore??0),0);return o?.before&&(v+=o.before),o?.after&&(v+=o.after),{kind:"paragraph",lines:R,totalHeight:v}}function Cn(e,t){return e.map(n=>Tt(n,t))}function Rn(e){let t=q(e);return Ae(e.text,t).charWidths}function In(e,t){return e.map(n=>{let r=n.x-n.distLeft,i=n.x+n.width+n.distRight,o=n.y-n.distTop,s=n.y+n.height+n.distBottom;if(n.wrapType==="topAndBottom")return {leftMargin:0,rightMargin:0,topY:o,bottomY:s,fullWidthBlock:true};let a=0,l=0,u,c=n.wrapText??"bothSides";c==="right"?a=Te(i):c==="left"?l=ye(r,t):c==="largest"?{leftMargin:a,rightMargin:l}=Bt(r,i,t):Pt(r,i,t)?u=Ft(r,i,t):n.side==="left"?a=Te(i):l=ye(r,t);let g=Ke(a,l,t);return {leftMargin:g.leftMargin,rightMargin:g.rightMargin,topY:o,bottomY:s,segments:u}})}function ee(e,t){return e.segments?.reduce((r,i)=>r+i.availableWidth,0)??t-e.leftMargin-e.rightMargin}function te(e,t,n,r){if(!n||n.length===0)return {leftMargin:0,rightMargin:0};let i=0,o=0,s,a=r+e,l=a+t;for(let u of n)if(!(l<=u.topY||a>=u.bottomY)){if(u.fullWidthBlock)return {leftMargin:0,rightMargin:0,segments:[{leftOffset:0,availableWidth:0}]};if(u.segments?.length){s=s?yt(s,u.segments):u.segments;continue}i=Math.max(i,u.leftMargin),o=Math.max(o,u.rightMargin);}return {leftMargin:i,rightMargin:o,segments:s}}function Ye(e,t,n,r,i){if(!n||n.length===0)return e;let o=e;for(let s=0;s<n.length+2;s++){let a=te(o,t,n,0);if(ee(a,r)>=i)return o;let u=o+t,c=1/0;for(let g of n)u<=g.topY||o>=g.bottomY||g.bottomY>o&&g.bottomY<c&&(c=g.bottomY);if(!Number.isFinite(c)||c<=o)return o;o=c;}return o}function yt(e,t){let n=[];for(let r of e)for(let i of t){let o=Math.max(r.leftOffset,i.leftOffset),s=Math.min(r.leftOffset+r.availableWidth,i.leftOffset+i.availableWidth);s>o&&n.push({leftOffset:o,availableWidth:s-o});}return n}var U=24;function Pt(e,t,n){return e>U&&t+U<n}function Ft(e,t,n){return [{leftOffset:0,availableWidth:Math.max(0,e)},{leftOffset:Math.max(0,t),availableWidth:Math.max(0,n-t)}].filter(r=>r.availableWidth>1)}function Bt(e,t,n){let r=Math.max(0,e);return Math.max(0,n-t)>=r?{leftMargin:Te(t),rightMargin:0}:{leftMargin:0,rightMargin:ye(e,n)}}function Te(e){return Math.max(0,e)}function ye(e,t){return Math.max(0,t-e)}function wt(e,t){return e==null||!Number.isFinite(e)?0:Math.max(0,Math.min(t,e))}function re(e,t,n){if(e)return e.kind==="text"?typeof e.pmStart=="number"?e.pmStart+wt(t,e.text.length):n==="end"?e.pmEnd:void 0:n==="end"?typeof e.pmEnd=="number"?e.pmEnd:typeof e.pmStart=="number"?e.pmStart+1:void 0:e.pmStart}function $e(e,t,n,r){if(t.lines.length===0||n>=r)return {pmStart:e.pmStart,pmEnd:e.pmEnd};let i=t.lines[n],o=t.lines[r-1],s=i?e.runs[i.fromRun]:void 0,a=o?e.runs[o.toRun]:void 0,l=n===0?e.pmStart??re(s,i?.fromChar??0,"start"):re(s,i?.fromChar??0,"start"),u=r>=t.lines.length?e.pmEnd??re(a,o?.toChar??0,"end"):re(a,o?.toChar??0,"end");return l==null&&(l=e.pmStart),u==null&&(u=e.pmEnd),l!=null&&u!=null&&u<=l&&(u=l+1),{pmStart:l,pmEnd:u}}var je={count:1,gap:0};function Ct(e,t,n){return {activeTopMargin:e.top,activeBottomMargin:e.bottom,activeLeftMargin:e.left,activeRightMargin:e.right,pendingTopMargin:null,pendingBottomMargin:null,pendingLeftMargin:null,pendingRightMargin:null,activePageSize:{...t},pendingPageSize:null,activeColumns:n?{...n}:{...je},pendingColumns:null,activeOrientation:null,pendingOrientation:null,hasAnyPages:false}}function Rt(e,t){return t.count>1}function ie(e){return e?{count:e.count,gap:e.gap}:{...je}}function Lt(e,t,n){let r={...t},i=e.type??"continuous",o=e.margins,s=e.pageSize,a=e.orientation;o&&(typeof o.top=="number"&&(r.pendingTopMargin=Math.max(0,o.top)),typeof o.bottom=="number"&&(r.pendingBottomMargin=Math.max(0,o.bottom)),typeof o.left=="number"&&(r.pendingLeftMargin=Math.max(0,o.left)),typeof o.right=="number"&&(r.pendingRightMargin=Math.max(0,o.right))),s&&(r.pendingPageSize={w:s.w,h:s.h}),a&&(r.pendingOrientation=a);let l=Rt((e.margins,void 0),r.activeColumns);switch(i){case "nextPage":return r.pendingColumns=ie(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false},state:r};case "evenPage":return r.pendingColumns=ie(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false,requiredParity:"even"},state:r};case "oddPage":return r.pendingColumns=ie(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false,requiredParity:"odd"},state:r};default:return l?(r.pendingColumns=ie(void 0),{decision:{forcePageBreak:false,forceMidPageRegion:true},state:r}):{decision:{forcePageBreak:false,forceMidPageRegion:false},state:r}}}function kt(e){let t={...e};return t.pendingTopMargin!==null&&(t.activeTopMargin=t.pendingTopMargin,t.pendingTopMargin=null),t.pendingBottomMargin!==null&&(t.activeBottomMargin=t.pendingBottomMargin,t.pendingBottomMargin=null),t.pendingLeftMargin!==null&&(t.activeLeftMargin=t.pendingLeftMargin,t.pendingLeftMargin=null),t.pendingRightMargin!==null&&(t.activeRightMargin=t.pendingRightMargin,t.pendingRightMargin=null),t.pendingPageSize!==null&&(t.activePageSize=t.pendingPageSize,t.pendingPageSize=null),t.pendingColumns!==null&&(t.activeColumns=t.pendingColumns,t.pendingColumns=null),t.pendingOrientation!==null&&(t.activeOrientation=t.pendingOrientation,t.pendingOrientation=null),t}function It(e){return {top:e.pendingTopMargin??e.activeTopMargin,bottom:e.pendingBottomMargin??e.activeBottomMargin,left:e.pendingLeftMargin??e.activeLeftMargin,right:e.pendingRightMargin??e.activeRightMargin}}function vt(e){return e.pendingPageSize??e.activePageSize}function Et(e){return e.pendingColumns??e.activeColumns}function Wt(e,t){for(let n=0;n<e.pages.length;n++)for(let r of e.pages[n].fragments){if(r.pmStart==null)continue;let i=r.pmStart,o=r.pmEnd??i+1;if(t>=i&&t<o)return n}return null}var Ht={w:816,h:1056},G={top:96,right:96,bottom:96,left:96},Je={count:1,gap:0};function At(e,t,n){let r=[],i=[],o=t;for(let s=0;s<e.length;s++){if(e[s].kind!=="sectionBreak")continue;let a=e[s],l={pageSize:a.pageSize??o.pageSize,margins:a.margins??o.margins,columns:a.columns};r.push(l),i.push(s),o=l;}return r.push(n),{configs:r,breakIndices:i}}function Qe(e){if(e.runs.length===0)return true;if(e.runs.length!==1)return false;let t=e.runs[0];return t.kind==="text"&&(t.text??"")===""}function Ve(e){let t=e.attrs?.spacing?.before??0;return Qe(e)&&!e.attrs?.spacingExplicit?.before?0:t}function qe(e){let t=e.attrs?.spacing?.after??0;return Qe(e)&&!e.attrs?.spacingExplicit?.after?0:t}function et(e){for(let t=0;t<e.length-1;t++){let n=e[t],r=e[t+1];if(n.kind!=="paragraph"||r.kind!=="paragraph")continue;let i=n.attrs,o=r.attrs;i?.contextualSpacing&&o?.contextualSpacing&&i.styleId&&i.styleId===o.styleId&&(i.spacing&&(i.spacing={...i.spacing,after:0}),o.spacing&&(o.spacing={...o.spacing,before:0}));}for(let t of e)if(t.kind==="table")for(let n of t.rows)for(let r of n.cells)et(r.blocks);}function Zn(e,t,n={}){if(e.length!==t.length)throw new Error(`layoutDocument: expected one measure per block (blocks=${e.length}, measures=${t.length})`);let r=n.pageSize??Ht,i={top:n.margins?.top??G.top,right:n.margins?.right??G.right,bottom:n.margins?.bottom??G.bottom,left:n.margins?.left??G.left,header:n.margins?.header??n.margins?.top??G.top,footer:n.margins?.footer??n.margins?.bottom??G.bottom};n.headerContentHeights,n.footerContentHeights,n.titlePage,n.evenAndOddHeaders;let o={...i},s=n.finalPageSize??r,a=n.finalMargins??o;if(r.w-o.left-o.right<=0)throw new Error("layoutDocument: page size and margins yield no content area");let u={pageSize:r,margins:o,columns:n.columns},c={pageSize:s,margins:a,columns:n.columns},{configs:g,breakIndices:d}=At(e,u,c),S=[...d.map(w=>e[w].type),n.bodyBreakType],P=g[0]??u,M=fe({pageSize:P.pageSize,margins:P.margins,columns:P.columns??Je,footnoteReservedHeights:n.footnoteReservedHeights});et(e);let B=ge(e),T=pe(B),I=0;for(let w=0;w<e.length;w++){let C=e[w],R=t[w];de(C)&&M.forcePageBreak();let f=B.get(w);if(f&&!T.has(w)){let L=me(f,e,t),H=M.getCurrentState(),W=M.getAvailableHeight(),h=H.contentBottom-H.topMargin;L<=h&&L>W&&H.page.fragments.length>0&&M.forcePageBreak();}switch(C.kind){case "paragraph":Ot(C,R,M,M.getContentWidth());break;case "table":C.floating?Yt(C,R,M,M.getContentWidth()):Nt(C,R,M);break;case "image":Dt(C,R,M);break;case "textBox":Ut(C,R,M);break;case "pageBreak":M.forcePageBreak();break;case "columnBreak":M.forceColumnBreak();break;case "sectionBreak":{let L=S[I+1]??S[I];Xt(C,M,g[I+1]??P,L),I++;break}default:c$2(C,"runLayoutPipeline");}}return M.pages.length===0&&M.getCurrentState(),{pageSize:r,pages:M.pages,columns:n.columns,pageGap:n.pageGap}}function Ot(e,t,n,r){if(t.kind!=="paragraph")throw new Error("layoutParagraph: expected paragraph measure");let i=t.lines;if(i.length===0){let l=Ve(e),u=qe(e),c=n.getCurrentState(),g={kind:"paragraph",blockId:e.id,x:n.getColumnX(c.columnIndex),y:c.cursorY+l,width:r,height:0,fromLine:0,toLine:0,pmStart:e.pmStart,pmEnd:e.pmEnd};n.addFragment(g,0,l,u);return}let o=Ve(e),s=qe(e),a=0;for(;a<i.length;){let l=n.getCurrentState(),u=a===0?Math.max(o,l.trailingSpacing):0,c=n.getAvailableHeight()-u,g=0,d=0;for(let C=a;C<i.length;C++){let R=i[C].lineHeight+(i[C].floatSkipBefore??0),f=g+R;if(f<=c||d===0)g=f,d++;else break}let S=a===0,P=a+d>=i.length,M=S?o:0,B=P?s:0,T=$e(e,t,a,a+d),I={kind:"paragraph",blockId:e.id,x:n.getColumnX(l.columnIndex),y:0,width:r,height:g,fromLine:a,toLine:a+d,pmStart:T.pmStart,pmEnd:T.pmEnd,continuesFromPrev:!S,continuesOnNext:!P},w=n.addFragment(I,g,M,B);I.y=w.y,a+=d,a<i.length&&n.ensureFits(i[a].lineHeight);}}function _t(e){let t=0;for(let n of e.rows)if(n.isHeader)t++;else break;return t}function zt(e,t){let n=0;for(let r=0;r<t&&r<e.rows.length;r++)n+=e.rows[r].height;return n}function Nt(e,t,n){if(t.kind!=="table")throw new Error("layoutTable: expected table measure");let r=t.rows;if(r.length===0)return;let i=_t(e),o=zt(t,i),s=Le(e,t),a=0,l=0;for(;a<r.length;){let u=n.getCurrentState(),c=a===0&&l===0,g=c?u.trailingSpacing:0,d=!c&&i>0?o:0,S=n.getAvailableHeight()-g-d,P=a,M=l,B=0,T=a,I=l,w=a,C,R=false;for(;T<r.length;){let F=r[T].height,v=T===P?I:0,m=F-v;if(B+m<=S){B+=m,T+=1,w=T;continue}let p=S-B,x=e.rows[T]?.cantSplit?0:ke(s,T,v,p);x>0?(B+=x,w=T+1,C=v+x,R=true):w>P||(B+=m,w=T+1);break}let f=d+B,L=w===r.length&&!R,H=n.getColumnX(u.columnIndex);e.justification==="center"?H=H+(n.columnWidth-t.totalWidth)/2:e.justification==="right"?H=H+n.columnWidth-t.totalWidth:e.indent&&(H+=e.indent);let W={kind:"table",blockId:e.id,x:H,y:0,width:t.totalWidth,height:f,fromRow:P,toRow:w,pmStart:e.pmStart,pmEnd:e.pmEnd,continuesFromPrev:!c,continuesOnNext:!L,headerRowCount:!c&&i>0?i:void 0,topClip:M>0?M:void 0,bottomClip:C},h=n.addFragment(W,f,0,0);if(W.y=h.y,W.x=H,R?(a=w-1,l=C??0):(a=w,l=0),a<r.length){let F=(i>0?o:0)+(r[a].height-l);n.ensureFits(F);}}}function Yt(e,t,n,r){if(t.kind!=="table")throw new Error("layoutFloatingTable: expected table measure");let i=n.getCurrentState(),o=e.floating,s=i.page,a=s.margins,l=t.totalWidth,u=t.totalHeight,c=s.size.h-a.top-a.bottom,g=a.left,d=a.top;o?.horzAnchor==="page"&&(g=0),o?.vertAnchor==="page"&&(d=0),o?.vertAnchor==="text"&&(d=i.cursorY);let S=n.getColumnX(i.columnIndex);if(o?.tblpX!==void 0)S=g+o.tblpX;else if(o?.tblpXSpec){let L=o.tblpXSpec;L==="left"||L==="inside"?S=g:L==="right"||L==="outside"?S=g+r-l:L==="center"&&(S=g+(r-l)/2);}else e.justification==="center"?S=g+(r-l)/2:e.justification==="right"&&(S=g+r-l);let P=i.cursorY,M=false;if(o?.tblpY!==void 0)P=d+o.tblpY,M=true;else if(o?.tblpYSpec){M=true;let L=o.tblpYSpec;L==="top"?P=d:L==="bottom"?P=d+c-u:L==="center"&&(P=d+(c-u)/2);}M||(P=n.ensureFits(u).cursorY);let B=a.left,T=a.left+r-l;Number.isFinite(T)&&(S=Math.max(B,Math.min(S,T)));let I={kind:"table",blockId:e.id,x:S,y:P,width:l,height:u,fromRow:0,toRow:e.rows.length,pmStart:e.pmStart,pmEnd:e.pmEnd,isFloating:true};i.page.fragments.push(I);let w=o?.leftFromText??0,C=o?.rightFromText??0,R=S-a.left-w,f=a.left+r-(S+l)-C;if(R<U&&f<U){let L=P+u+(o?.bottomFromText??0);L>i.cursorY&&(i.cursorY=L);}}function Dt(e,t,n){if(t.kind!=="image")throw new Error("layoutImage: expected image measure");if(e.anchor?.isAnchored){Zt(e,t,n);return}let r=n.ensureFits(t.height),i={kind:"image",blockId:e.id,x:n.getColumnX(r.columnIndex),y:0,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd},o=n.addFragment(i,t.height,0,0);i.y=o.y;}function Zt(e,t,n){let r=n.getCurrentState(),i=e.anchor,o=i.offsetH??n.getColumnX(r.columnIndex),s=i.offsetV??r.cursorY,a={kind:"image",blockId:e.id,x:o,y:s,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd,isAnchored:true,zIndex:i.behindDoc?-1:1};r.page.fragments.push(a);}function Ut(e,t,n){if(t.kind!=="textBox")throw new Error("layoutTextBox: expected textBox measure");if($(e)){let s=n.getCurrentState(),a={kind:"textBox",blockId:e.id,x:n.getColumnX(s.columnIndex),y:s.cursorY,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd,isFloating:true,zIndex:e.wrapType==="behind"?-1:1};s.page.fragments.push(a);return}let r=n.ensureFits(t.height),i={kind:"textBox",blockId:e.id,x:n.getColumnX(r.columnIndex),y:0,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd},o=n.addFragment(i,t.height,0,0);i.y=o.y;}function Xt(e,t,n,r){switch(r??"nextPage"){case "nextPage":t.updatePageLayout(n.pageSize,n.margins),t.forcePageBreak();break;case "evenPage":{t.updatePageLayout(n.pageSize,n.margins),t.forcePageBreak().page.number%2!==0&&t.forcePageBreak();break}case "oddPage":{t.updatePageLayout(n.pageSize,n.margins),t.forcePageBreak().page.number%2===0&&t.forcePageBreak();break}case "continuous":t.updatePageLayout(n.pageSize,n.margins,false);break}t.updateColumns(n.columns??Je);}export{Cn as A,Rn as B,fe as C,ge as D,me as E,pe as F,it as G,de as H,$ as I,ot as J,at as K,Re as L,Ct as M,Lt as N,kt as O,It as P,vt as Q,Et as R,Wt as S,At as T,Zn as U,zt as V,qt as a,Ce as b,Jt as c,Qt as d,be as e,sn as f,xe as g,V as h,O as i,ln as j,Ae as k,un as l,cn as m,fn as n,gn as o,Y as p,gt as q,mn as r,pn as s,In as t,te as u,Oe as v,ht as w,_e as x,Ke as y,Tt as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c}from'./chunk-HKN2NKOG.mjs';import {V as V$1,L,T,k,l}from'./chunk-JHTURDPX.mjs';import {b}from'./chunk-IUJCUITW.mjs';import {e}from'./chunk-VW22RZ6C.mjs';function ee(e,n){if(e.pages.length===0)return null;let a=e.pageGap??0,r=0,t=null,o=1/0;for(let s=0;s<e.pages.length;s++){let i=e.pages[s],l=i.size?.h??e.pageSize.h,f=r,u=f+l;if(n.y>=f&&n.y<u)return {pageIndex:s,page:i,pageY:n.y-f};let c=f+l/2,m=Math.abs(n.y-c);m<o&&(o=m,t=s),r=u+a;}if(t!==null){let s=e.pages[t],i=A(e,t);return {pageIndex:t,page:s,pageY:Math.max(0,Math.min(n.y-i,s.size?.h??e.pageSize.h))}}return null}function A(e,n){let a=e.pageGap??0,r=0;for(let t=0;t<n&&t<e.pages.length;t++){let s=e.pages[t].size?.h??e.pageSize.h;r+=s+a;}return r}function Ne(e,n){return ee(e,{y:n})?.pageIndex??null}function te(e,n){return e.findIndex(a=>a.id===n)}function Ye(e,n){let a=0;for(let r=e.fromLine;r<e.toLine&&r<n.lines.length;r++)a+=n.lines[r].lineHeight;return a}function ge(e,n,a,r){let t=[...e.page.fragments].sort((o,s)=>{let i=o.y-s.y;return Math.abs(i)>.5?i:o.x-s.x});for(let o of t){let s=te(n,o.blockId);if(s===-1)continue;let i=n[s],l=a[s];if(!i||!l)continue;let f;if(o.kind==="paragraph"){if(i.kind!=="paragraph"||l.kind!=="paragraph")continue;f=Ye(o,l);}else if(o.kind==="table")f=o.height;else if(o.kind==="image")f=o.height;else continue;let u=r.x>=o.x&&r.x<=o.x+o.width,c=r.y>=o.y&&r.y<=o.y+f;if(u&&c)return {fragment:o,block:i,measure:l,pageIndex:e.pageIndex,localX:r.x-o.x,localY:r.y-o.y}}return null}function ze(e,n,a,r){for(let t of e.page.fragments){if(t.kind!=="image")continue;let o=te(n,t.blockId);if(o===-1)continue;let s=n[o],i=a[o];if(!s||!i)continue;let l=r.x>=t.x&&r.x<=t.x+t.width,f=r.y>=t.y&&r.y<=t.y+t.height;if(l&&f)return {fragment:t,block:s,measure:i,pageIndex:e.pageIndex,localX:r.x-t.x,localY:r.y-t.y}}return null}function pe(e,n,a,r){for(let t of e.page.fragments){if(t.kind!=="table")continue;let o=t,s=r.x>=o.x&&r.x<=o.x+o.width,i=r.y>=o.y&&r.y<=o.y+o.height;if(!s||!i)continue;let l=te(n,o.blockId);if(l===-1)continue;let f=n[l],u=a[l];if(!f||f.kind!=="table"||!u||u.kind!=="table")continue;let c=f,m=u,g=r.x-o.x,x=r.y-o.y,d=o.headerRowCount??0,h=d>0&&o.continuesFromPrev?V$1(m,d):0,p=0,b=-1;if(m.rows.length===0||c.rows.length===0)continue;if(h>0&&x<h){let M=0;for(let w=0;w<d&&w<m.rows.length;w++){let L=m.rows[w];if(x>=M&&x<M+L.height){b=w;break}M+=L.height;}b===-1&&(b=0);}else {let M=x-h;for(let w=o.fromRow;w<o.toRow&&w<m.rows.length;w++){let L=m.rows[w];if(M>=p&&M<p+L.height){b=w;break}p+=L.height;}}if(b===-1&&(b=Math.min(o.toRow-1,m.rows.length-1),b<o.fromRow))continue;let T=m.rows[b],H=c.rows[b];if(!T||!H)continue;let F=0,k=-1;if(T.cells.length===0||H.cells.length===0)continue;for(let M=0;M<T.cells.length;M++){let w=T.cells[M];if(g>=F&&g<F+w.width){k=M;break}F+=w.width;}if(k===-1&&(k=T.cells.length-1,k<0))continue;let P=T.cells[k],S=H.cells[k];if(!P||!S)continue;let y=0;if(h>0&&b<d)for(let M=0;M<b;M++)y+=m.rows[M]?.height??0;else {y=h;for(let M=o.fromRow;M<b;M++)y+=m.rows[M]?.height??0;}let R=0;for(let M=0;M<k;M++)R+=T.cells[M]?.width??0;let _,I;if(S.blocks&&S.blocks.length>0){let M=S.blocks[0],w=P.blocks[0];M.kind==="paragraph"&&w?.kind==="paragraph"&&(_=M,I=w);}let E=g-R,C=x-y;return {fragment:o,block:c,measure:m,pageIndex:e.pageIndex,rowIndex:b,colIndex:k,cellBlock:_,cellMeasure:I,cellLocalX:Math.max(0,E),cellLocalY:Math.max(0,C)}}return null}function We(e,n,a,r){let t={pageHit:null,fragmentHit:null,tableCellHit:null};if(t.pageHit=ee(e,r),!t.pageHit)return t;let o=A(e,t.pageHit.pageIndex),s={x:r.x,y:r.y-o};return t.fragmentHit=ge(t.pageHit,n,a,s),t.fragmentHit?.fragment.kind==="table"&&(t.tableCellHit=pe(t.pageHit,n,a,s)),t}function Ge(e){if(e.pages.length===0)return 0;let n=e.pageGap??0,a=0;for(let r=0;r<e.pages.length;r++){let t=e.pages[r];a+=t.size?.h??e.pageSize.h,r<e.pages.length-1&&(a+=n);}return a}function Ve(e,n){return A(e,n)}function Ue(e,n){if(n<0||n>=e.pages.length)return null;let a=A(e,n),t=e.pages[n].size?.h??e.pageSize.h;return {top:a,bottom:a+t}}function ne(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function be(e,n){let a=[];for(let r=n.fromRun;r<=n.toRun&&r<e.runs.length;r++){let t=e.runs[r];if(t){if(t.kind==="tab"||t.kind==="image"||t.kind==="lineBreak"){a.push(t);continue}if(t.kind==="text"){let o=t.text??"",s=r===n.fromRun,i=r===n.toRun;if(s||i){let l=s?n.fromChar:0,f=i?n.toChar:o.length,u=o.slice(l,f);u.length>0&&a.push({...t,text:u});}else a.push(t);}}}return a}function xe(e,n){let a,r,t=e.pmStart??0,o=0;for(let s=0;s<e.runs.length&&s<=n.toRun;s++){let i=e.runs[s];i&&(s<n.fromRun?i.kind==="text"?o+=(i.text??"").length:(i.kind==="tab"||i.kind==="lineBreak"||i.kind==="image")&&(o+=1):s===n.fromRun&&(o+=n.fromChar,a=t+o,i.kind==="text"&&(o=n.fromChar)));}if(a!==void 0){let s=0;for(let i=n.fromRun;i<=n.toRun&&i<e.runs.length;i++){let l=e.runs[i];if(l)if(l.kind==="text"){let f=l.text??"",u=i===n.fromRun?n.fromChar:0,c=i===n.toRun?n.toChar:f.length;s+=c-u;}else (l.kind==="tab"||l.kind==="lineBreak"||l.kind==="image")&&(s+=1);}r=a+s;}return {pmStart:a,pmEnd:r}}function $e(e,n,a,r){let t=0;for(let o=a;o<r&&o<e.lines.length;o++){let i=e.lines[o].lineHeight;if(n>=t&&n<t+i)return o;t+=i;}return r>a?Math.min(r-1,e.lines.length-1):null}function qe(e,n,a,r){let{pmStart:t,pmEnd:o}=xe(e,n);if(t===void 0||o===void 0)return {charOffset:0,pmPosition:e.pmStart??0};let s=e.attrs?.alignment??"left",i=0;s==="center"?i=Math.max(0,(r-n.width)/2):s==="right"&&(i=Math.max(0,r-n.width));let l$1=Math.max(0,a-i);if(l$1<=0)return {charOffset:0,pmPosition:t};let f=be(e,n);if(f.length===0)return {charOffset:0,pmPosition:t};let u=0,c=0;for(let g of f){if(g.kind==="tab"){let x=g.width??48,d=u+x;if(l$1<=d){let h=u+x/2;return l$1<h?{charOffset:c,pmPosition:t+c}:{charOffset:c+1,pmPosition:t+c+1}}u=d,c+=1;continue}if(g.kind==="image"){let x=g.width,d=u+x;if(l$1<=d){let h=u+x/2;return l$1<h?{charOffset:c,pmPosition:t+c}:{charOffset:c+1,pmPosition:t+c+1}}u=d,c+=1;continue}if(g.kind==="lineBreak"){if(l$1>=u)return {charOffset:c,pmPosition:t+c};c+=1;continue}if(g.kind==="text"){let x=g.text??"";if(x.length===0)continue;let d=ne(g),h=k(x,d),p=u+h.width;if(l$1<=p){let b=l$1-u,T=l(b,h.charWidths),H=c+T;return {charOffset:H,pmPosition:t+H}}u=p,c+=x.length;}}return {charOffset:o-t,pmPosition:o}}function oe(e){let{fragment:n,block:a,measure:r,localX:t,localY:o}=e;if(n.kind!=="paragraph"||a.kind!=="paragraph"||r.kind!=="paragraph")return null;let s=n,i=a,l=r,f=$e(l,o,s.fromLine,s.toLine);if(f===null)return null;let u=l.lines[f];if(!u)return null;let c=0;for(let T=s.fromLine;T<f;T++)c+=l.lines[T]?.lineHeight??0;let m=i.attrs?.indent,g=m?.left??0,x=m?.right??0,d=Math.max(0,n.width-g-x),h=t-g,{charOffset:p,pmPosition:b}=qe(i,u,h,d);return {pmPosition:b,charOffset:p,lineIndex:f}}function ke(e){let{cellBlock:n,cellMeasure:a,cellLocalX:r,cellLocalY:t}=e;if(!n||!a)return null;let o={fragment:{kind:"paragraph",blockId:n.id,x:0,y:0,width:a.lines.reduce((i,l)=>Math.max(i,l.width),100),fromLine:0,toLine:a.lines.length,height:a.totalHeight},block:n,measure:a,pageIndex:e.pageIndex,localX:r,localY:t};return oe(o)?.pmPosition??null}function je(e,n){if(n)return ke(n);if(!e)return null;let{fragment:a}=e;return a.kind==="paragraph"?oe(e)?.pmPosition??null:a.kind==="image"?a.pmStart??null:null}function Te(e,n,a,r){let t=e.pmStart??0,o=e.pmEnd??t;if(a<t||a>o)return null;let s=a-t;for(let i=0;i<n.lines.length;i++){let l=n.lines[i],{pmStart:f,pmEnd:u}=xe(e,l);if(f===void 0||u===void 0)continue;let c=f-t,m=u-t;if(s>=c&&s<=m){let g=s-c,x=be(e,l),d=0,h=0;for(let p of x)if(p.kind==="tab"){if(g<=h+1)return g<=h?{x:d,lineIndex:i}:{x:d+(p.width??48),lineIndex:i};d+=p.width??48,h+=1;}else if(p.kind==="image"){if(g<=h+1)return g<=h?{x:d,lineIndex:i}:{x:d+p.width,lineIndex:i};d+=p.width,h+=1;}else if(p.kind==="lineBreak"){if(g<=h)return {x:d,lineIndex:i};h+=1;}else if(p.kind==="text"){let b=p.text??"";if(g<=h+b.length){let F=g-h,k$1=ne(p),P=k(b.slice(0,F),k$1);return {x:d+P.width,lineIndex:i}}let T=ne(p),H=k(b,T);d+=H.width,h+=b.length;}return {x:d,lineIndex:i}}}return null}function Je(e,n,a,r,t,o,s){let i=Te(e,n,a);if(!i)return null;let l=e.attrs?.alignment??"left",f=e.attrs?.indent,u=f?.left??0,c=f?.right??0,m=Math.max(0,o-u-c),g=n.lines[i.lineIndex];if(!g)return null;let x=0;l==="center"?x=Math.max(0,(m-g.width)/2):l==="right"&&(x=Math.max(0,m-g.width));let d=0;for(let h=s;h<i.lineIndex;h++)d+=n.lines[h]?.lineHeight??0;return {x:r+u+x+i.x,y:t+d,height:g.lineHeight}}function Ke(e,n,a={}){let r=a.scope??"body",t=r==="body"?"layout-page-content":`layout-page-${r}`,o=`.${t} .layout-table-cell`,s=e.querySelectorAll(`.${t} .layout-table-cell-selected`);for(let c of Array.from(s))c.classList.remove("layout-table-cell-selected");let i=n.selection;if(!("$anchorCell"in i&&typeof i.forEachCell=="function")||!i.forEachCell)return;let f=[];i.forEachCell((c,m)=>{f.push([m,m+c.nodeSize]);});let u=e.querySelectorAll(o);for(let c of Array.from(u)){let m=c,g=m.dataset.pmStart;if(g===void 0)continue;let x=Number(g);for(let[d,h]of f)if(x>=d&&x<h){m.classList.add("layout-table-cell-selected");break}}}function Me(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function re(e,n){return e.findIndex(a=>a.id===n)}function V(e,n){let r=(e.pmStart??0)+1,t=0,o;for(let l=0;l<e.runs.length&&l<=n.toRun;l++){let f=e.runs[l];if(f){if(l<n.fromRun)f.kind==="text"?t+=(f.text??"").length:t+=1;else if(l===n.fromRun){t+=n.fromChar,o=r+t;break}}}o===void 0&&(o=r);let s=0;for(let l=n.fromRun;l<=n.toRun&&l<e.runs.length;l++){let f=e.runs[l];if(f)if(f.kind==="text"){let u=f.text??"",c=l===n.fromRun?n.fromChar:0,m=l===n.toRun?n.toChar:u.length;s+=m-c;}else s+=1;}let i=o+s;return {pmStart:o,pmEnd:i}}function Fe(e,n,a,r){let t=[];for(let o=0;o<n.lines.length;o++){let s=n.lines[o],i=V(e,s);i.pmStart===void 0||i.pmEnd===void 0||i.pmEnd>a&&i.pmStart<r&&t.push({line:s,index:o});}return t}function W(e,n,a){let r=V(e,n);return r.pmStart===void 0?0:Math.max(0,a-r.pmStart)}function G(e,n,a,r){let t=0,o=0;for(let s=n.fromRun;s<=n.toRun&&s<e.runs.length;s++){let i=e.runs[s];if(i){if(i.kind==="tab"){let l=i.width??48;if(o+1>=a)return a<=o?t:t+l;t+=l,o+=1;continue}if(i.kind==="image"){let l=i.width;if(o+1>=a)return a<=o?t:t+l;t+=l,o+=1;continue}if(i.kind==="lineBreak"){if(a<=o)return t;o+=1;continue}if(i.kind==="text"){let l=i.text??"",f=s===n.fromRun,u=s===n.toRun,c=f?n.fromChar:0,m=u?n.toChar:l.length,g=l.slice(c,m);if(o+g.length>=a){let h=a-o,p=Me(i),b=k(g.slice(0,h),p);return t+b.width}let x=Me(i),d=k(g,x);t+=d.width,o+=g.length;}}}return t}function J(e,n){let a=0;for(let r=0;r<n&&r<e.lines.length;r++)a+=e.lines[r].lineHeight;return a}function Qe(e,n,a,r,t){if(r===t)return [];let o=Math.min(r,t),s=Math.max(r,t),i=[];for(let l=0;l<e.pages.length;l++){let f=e.pages[l],u=A(e,l);for(let c of f.fragments){if(c.kind==="paragraph"){let m=re(n,c.blockId);if(m===-1)continue;let g=n[m],x=a[m];if(!g||g.kind!=="paragraph"||!x||x.kind!=="paragraph")continue;let d=g,h=x,p=c,b=Fe(d,h,o,s);for(let{line:T,index:H}of b){if(H<p.fromLine||H>=p.toLine)continue;let F=V(d,T);if(F.pmStart===void 0||F.pmEnd===void 0)continue;let k=Math.max(F.pmStart,o),P=Math.min(F.pmEnd,s);if(k>=P)continue;let S=W(d,T,k),y=W(d,T,P),B=d.attrs?.indent,R=B?.left??0,_=B?.right??0,I=Math.max(0,c.width-R-_),E=G(d,T,S),C=G(d,T,y),M=d.attrs?.alignment??"left",w=0;M==="center"?w=Math.max(0,(I-T.width)/2):M==="right"&&(w=Math.max(0,I-T.width));let L=J(h,H)-J(h,p.fromLine),D=c.x+R+w+Math.min(E,C),Y=Math.max(1,Math.abs(C-E)),z=c.y+L;i.push({x:D,y:z+u,width:Y,height:T.lineHeight,pageIndex:l});}}if(c.kind==="table"){let m=re(n,c.blockId);if(m===-1)continue;let g=n[m],x=a[m];if(!g||g.kind!=="table"||!x||x.kind!=="table")continue;let d=g,h=x,p=c,b=[],T=0;for(let y=0;y<h.rows.length;y++)b.push(Math.round(T)),T+=h.rows[y]?.height??0;b.push(Math.round(T));let H=p.headerRowCount??0,F=H>0&&p.continuesFromPrev?V$1(h,H):0,k=(b[p.fromRow]??0)+(p.topClip??0),P=p.bottomClip!==void 0?Math.round(p.height):F+((b[p.toRow]??0)-k),S=y=>F+(y-k);for(let y=p.fromRow;y<p.toRow&&y<d.rows.length;y++){let B=d.rows[y],R=h.rows[y];if(!B||!R)continue;let _=b[y]??0,I=0;for(let E=0;E<B.cells.length;E++){let C=B.cells[E],M=R.cells[E];if(!C||!M)continue;let w=C.padding?.top??0,L$1=L(C.blocks,M.blocks,w);for(let D=0;D<C.blocks.length;D++){let Y=C.blocks[D],z=M.blocks[D];if(!Y||Y.kind!=="paragraph"||!z||z.kind!=="paragraph")continue;let X=Y,Ae=z,De=L$1.lineTops[D]??[],ve=Fe(X,Ae,o,s);for(let{line:v,index:Oe}of ve){let q=V(X,v);if(q.pmStart===void 0||q.pmEnd===void 0)continue;let ae=Math.max(q.pmStart,o),se=Math.min(q.pmEnd,s);if(ae>=se)continue;let Q=S(_+(De[Oe]??0));if(Q+v.lineHeight<=F||Q>=P)continue;let _e=W(X,v,ae),Xe=W(X,v,se),le=G(X,v,_e,M.width),ce=G(X,v,Xe,M.width);i.push({x:p.x+I+Math.min(le,ce),y:p.y+Q+u,width:Math.max(1,Math.abs(ce-le)),height:v.lineHeight,pageIndex:l});}}I+=M.width;}}}if(c.kind==="image"){let m=c.pmStart??0;(c.pmEnd??m+1)>o&&m<s&&i.push({x:c.x,y:c.y+u,width:c.width,height:c.height,pageIndex:l});}}}return i}function Ze(e,n,a,r){for(let t=0;t<e.pages.length;t++){let o=e.pages[t],s=A(e,t);for(let i of o.fragments){if(i.kind==="paragraph"){let l=re(n,i.blockId);if(l===-1)continue;let f=n[l],u=a[l];if(!f||f.kind!=="paragraph"||!u||u.kind!=="paragraph")continue;let c=f,m=u,g=i,x=c.pmStart??0,d=c.pmEnd??x;if(r<x||r>d)continue;for(let h=g.fromLine;h<g.toLine;h++){let p=m.lines[h];if(!p)continue;let b=V(c,p);if(!(b.pmStart===void 0||b.pmEnd===void 0)&&r>=b.pmStart&&r<=b.pmEnd){let T=W(c,p,r),H=c.attrs?.indent,F=H?.left??0,k=H?.right??0,P=Math.max(0,i.width-F-k),S=G(c,p,T),y=c.attrs?.alignment??"left",B=0;y==="center"?B=Math.max(0,(P-p.width)/2):y==="right"&&(B=Math.max(0,P-p.width));let R=J(m,h)-J(m,g.fromLine);return {x:i.x+F+B+S,y:i.y+R+s,height:p.lineHeight,pageIndex:t}}}}if(i.kind==="image"){let l=i.pmStart??0,f=i.pmEnd??l+1;if(r>=l&&r<=f){let u=r===l?0:i.width;return {x:i.x+u,y:i.y+s,height:i.height,pageIndex:t}}}}}return null}function et(e){return e.length<=1?false:new Set(e.map(a=>a.pageIndex)).size>1}function tt(e){let n=new Map;for(let a of e){let r=n.get(a.pageIndex)??[];r.push(a),n.set(a.pageIndex,r);}return n}function nt(e){if(e.kind!=="paragraph")return false;let n=e.attrs;return n?!!(n.borders?.top||n.borders?.bottom||n.spacingExplicit?.before||n.spacingExplicit?.after):false}function ye(e){return He(e)}function He(e){let n=new Set;for(let a=1;a<e.length;a++){let r=e[a-1],t=e[a];r.kind==="table"&&t.kind==="paragraph"&&(t.runs.length>0||nt(t)||n.add(a));}return e.map((a,r)=>{if(a.kind==="table")return ot(a);if(a.kind!=="paragraph")return a;let t=n.has(r),o=a.attrs?.spacingExplicit,s=a.attrs?.spacing?.before!=null,i=a.attrs?.spacing?.after!=null,l=s&&!o?.before,f=i&&!o?.after,u=l||f;if(!u&&!t)return a;let c=a.attrs;return u&&c?.spacing&&(c={...c,spacing:{...c.spacing,before:o?.before?c.spacing.before:void 0,after:o?.after?c.spacing.after:void 0}}),t&&(c={...c??{},suppressEmptyParagraphHeight:true}),{...a,attrs:c}})}function ot(e){let n=false,a=e.rows.map(r=>{let t=false,o=r.cells.map(s=>{let i=He(s.blocks);return i.some((f,u)=>f!==s.blocks[u])?(t=true,{...s,blocks:i}):s});return t?(n=true,{...r,cells:o}):r});return n?{...e,rows:a}:e}function rt(e){return e?.align??e?.alignment}function we(e$1,n,a,r){let t=r.section==="header"?r.margins.header??48:r.pageSize.h-(r.margins.footer??48)-a,o=e$1.position?.vertical;if(!o)return n;let s=rt(o),i=o.posOffset!==void 0?e(o.posOffset):void 0;if(o.relativeTo==="page"){if(i!==void 0)return i-t;if(s==="top")return -t;if(s==="bottom")return r.pageSize.h-e$1.height-t;if(s==="center")return (r.pageSize.h-e$1.height)/2-t}if(o.relativeTo==="margin"){let l=r.margins.top,f=r.pageSize.h-r.margins.top-r.margins.bottom;if(i!==void 0)return l+i-t;if(s==="top")return l-t;if(s==="bottom")return l+f-e$1.height-t;if(s==="center")return l+(f-e$1.height)/2-t}return i!==void 0?n+i:n}function Pe(e){switch(e.kind){case "paragraph":case "table":return true;case "image":return !e.anchor?.isAnchored;case "textBox":return e.displayMode===void 0||e.displayMode==="inline";default:return false}}function it(e){return e?e.kind==="paragraph"||e.kind==="table"?e.totalHeight:e.kind==="image"||e.kind==="textBox"?e.height:0:0}function Se(e,n,a,r){let t=0,o=0,s=0;for(let i=0;i<e.length;i++){let l=e[i],f=n[i];if(!(!l||!f)){if(l.kind==="paragraph"&&f.kind==="paragraph"){let u=s,c=u+f.totalHeight;t=Math.min(t,u),o=Math.max(o,c);for(let m of l.runs){if(m.kind!=="image"||!m.position)continue;let g=we(m,u,a,r);t=Math.min(t,g),o=Math.max(o,g+m.height);}s=c;}else if(l.kind==="table"&&f.kind==="table"){let u=s+f.totalHeight;t=Math.min(t,s),o=Math.max(o,u),s=u;}else if(l.kind==="image"&&f.kind==="image"){let u=s+f.height;t=Math.min(t,s),o=Math.max(o,u),s=u;}else if(l.kind==="textBox"&&f.kind==="textBox"){let u=s+f.height;t=Math.min(t,s),o=Math.max(o,u),l.displayMode!=="float"&&(s=u);}}}return {visualTop:t,visualBottom:o}}function at(e,n,a,r){if(!e||!e.content||e.content.length===0)return;let t=b(e.content,{styles:r.styles??void 0,theme:r.theme??null,defaultTabStopTwips:r.defaultTabStopTwips??null});return Be(t,n,a,r)}function Be(e,n,a,r){let t=c(e,{theme:r.theme??void 0});if(t.length===0)return;let o=ye(t),s=r.measureBlocks(o,n),i=0,l=0;for(let c=0;c<o.length;c++){let m=it(s[c]);i+=m,Pe(o[c])&&(l+=m);}let{visualTop:f,visualBottom:u}=Se(o,s,i,a);return {blocks:o,measures:s,height:i,flowHeight:l,visualTop:f,visualBottom:u}}var K={header:null,footer:null};function st(){K.header=null,K.footer=null;}function Re(e,n){let a=n.querySelectorAll(`.layout-page-${e}`);if(a.length===0)return null;let r=n.defaultView,t=r?r.innerHeight/2:0,o=a[0],s=1/0;for(let c of Array.from(a)){let m=c.getBoundingClientRect(),g=Math.abs((m.top+m.bottom)/2-t);g<s&&(s=g,o=c);}let i=K[e];if(i&&i.host===o&&i.host.isConnected)return i;let l=Array.from(o.querySelectorAll("span[data-pm-start][data-pm-end]")),f=Array.from(o.querySelectorAll("[data-pm-start][data-pm-end]")),u={host:o,spans:l,ranged:f};return K[e]=u,u}function lt(e,n,a=globalThis.document){let r=e.state.selection;if(!r.empty)return null;let t=r.head,o=Re(n,a);if(!o)return null;let{host:s,spans:i}=o;for(let d of i){let h=Number(d.dataset.pmStart),p=Number(d.dataset.pmEnd);if(!(!Number.isFinite(h)||!Number.isFinite(p))&&t>=h&&t<=p){let b=s.ownerDocument.createRange(),T=s.ownerDocument.createTreeWalker(d,NodeFilter.SHOW_TEXT),H=t-h,F=T.nextNode();for(;F;){let S=F.data.length;if(H<=S){try{b.setStart(F,H),b.setEnd(F,H);let y=b.getClientRects()[0]??b.getBoundingClientRect();if(y&&y.height>0)return {top:y.top,left:y.left,height:y.height}}catch{}break}H-=S,F=T.nextNode();}let k=d.getBoundingClientRect(),P=(t-h)/Math.max(1,p-h);return {top:k.top,left:k.left+k.width*P,height:k.height}}}let l=s.querySelector(`[data-pm-start="${t}"]`);if(l){let d=l.getBoundingClientRect();return {top:d.top,left:d.left+1,height:d.height||16}}let f=o.ranged,u=null,c=1/0;for(let d of f){let h=Number(d.dataset.pmStart),p=Number(d.dataset.pmEnd);if(!Number.isFinite(h)||!Number.isFinite(p)||t<h||t>p)continue;let b=p-h;b<c&&(c=b,u=d);}if(u){let d=u.getBoundingClientRect(),h=Number(u.dataset.pmEnd),p=t>=h;return {top:d.top,left:p?d.right:d.left+1,height:d.height||16}}let m=null,g=-1/0;for(let d of f){let h=Number(d.dataset.pmStart);Number.isFinite(h)&&(h>t||h>g&&(g=h,m=d));}if(m){let d=m.getBoundingClientRect();return {top:d.top,left:d.right,height:d.height||16}}let x=s.getBoundingClientRect();return {top:x.top+2,left:x.left+2,height:16}}function ct(e,n,a=globalThis.document){let r=e.state.selection;if(r.empty)return [];let t=r.from,o=r.to,s=[],i=Re(n,a);if(!i)return s;let{host:l,spans:f}=i;for(let u of f){let c=Number(u.dataset.pmStart),m=Number(u.dataset.pmEnd);if(!Number.isFinite(c)||!Number.isFinite(m)||m<=t||c>=o)continue;if(u.classList.contains("layout-run-tab")){let p=u.getBoundingClientRect();s.push({top:p.top,left:p.left,width:p.width,height:p.height});continue}let g=null;if(u.firstChild?.nodeType===Node.TEXT_NODE?g=u.firstChild:u.firstChild?.nodeType===Node.ELEMENT_NODE&&u.firstChild.tagName==="A"&&u.firstChild.firstChild?.nodeType===Node.TEXT_NODE&&(g=u.firstChild.firstChild),!g)continue;let x=Math.max(0,t-c),d=Math.min(g.length,o-c);if(x>=d)continue;let h=l.ownerDocument.createRange();h.setStart(g,x),h.setEnd(g,d);for(let p of Array.from(h.getClientRects()))s.push({top:p.top,left:p.left,width:p.width,height:p.height});}return s}function Ie(e){return e?e.flowHeight??e.height:0}function ut(e){let{pageSize:n,margins:a,finalMargins:r,bodyBlocks:t,headers:o,footers:s,warn:i}=e,l=a.header??48,f=a.footer??48,u=a.top-l,c=a.bottom-f,m=Math.max(0,...(o??[]).map(Ie)),g=Math.max(0,...(s??[]).map(Ie)),x=m>u,d=g>c;if(!x&&!d)return {margins:a,finalMargins:r};let h=Math.max(0,n.h-24),p=false,b=F=>{let k={...F};return x&&(k.top=Math.max(F.top,l+m)),d&&(k.bottom=Math.max(F.bottom,f+g)),k.top+k.bottom>h&&(p=true,k.bottom=Math.max(0,Math.min(k.bottom,h-k.top)),k.top+k.bottom>h&&(k.top=Math.max(0,h-k.bottom))),k},T=b(a),H=b(r);if(t)for(let F of t){if(F.kind!=="sectionBreak")continue;let k=F;k.margins&&(k.margins=b(k.margins));}return p&&i&&i(`[layout] header/footer content exceeds page height; clamping margins to preserve a content area. pageHeight=${Math.round(n.h)} headerBand=${Math.round(m)} footerBand=${Math.round(g)} top=${Math.round(T.top)} bottom=${Math.round(T.bottom)}`),{margins:T,finalMargins:H}}var Ce=816,Ee=1056,U=96,ie=48;function $(e){return Math.round(e/1440*96)}function N(e,n){return e!=null?$(e):n}function ft(e){return {w:e?.pageWidth?$(e.pageWidth):Ce,h:e?.pageHeight?$(e.pageHeight):Ee}}function dt(e){return {top:N(e?.marginTop,U),right:N(e?.marginRight,U),bottom:N(e?.marginBottom,U),left:N(e?.marginLeft,U),header:N(e?.headerDistance,ie),footer:N(e?.footerDistance,ie)}}function ht(e,n){let a={header:null,footer:null,firstHeader:null,firstFooter:null};if(!e?.package)return a;let r=e.package.headers,t=e.package.footers,o=null,s=null,i=null,l=null;if(r&&n?.headerReferences){let f=n.headerReferences.find(c=>c.type==="default");f?.rId&&(o=r.get(f.rId)??null);let u=n.headerReferences.find(c=>c.type==="first");u?.rId&&(i=r.get(u.rId)??null);}if(t&&n?.footerReferences){let f=n.footerReferences.find(c=>c.type==="default");f?.rId&&(s=t.get(f.rId)??null);let u=n.footerReferences.find(c=>c.type==="first");u?.rId&&(l=t.get(u.rId)??null);}return n?.titlePg||(!o&&i&&(o=i),!s&&l&&(s=l)),{header:o,footer:s,firstHeader:i,firstFooter:l}}function mt(e){let n=e?.columnCount??1;if(n<=1)return;let a=$(e?.columnSpace??720);return {count:n,gap:a,equalWidth:e?.equalWidth??true,separator:e?.separator}}function Le(e){let n=e.pageSize.w-e.margins.left-e.margins.right,a=e.columns;return !a||a.count<=1?n:Math.floor((n-(a.count-1)*a.gap)/a.count)}function gt(e,n,a){let{configs:r,breakIndices:t}=T(e,n,a),o=0,s=[];for(let i=0;i<e.length;i++)s.push(Le(r[o]??n)),o<t.length&&i===t[o]&&o++;return s}export{st as A,lt as B,ct as C,ut as D,Ce as E,Ee as F,U as G,ie as H,$ as I,ft as J,dt as K,ht as L,mt as M,Le as N,gt as O,ee as a,A as b,Ne as c,ge as d,ze as e,pe as f,We as g,Ge as h,Ve as i,Ue as j,oe as k,ke as l,je as m,Te as n,Je as o,Ke as p,Qe as q,Ze as r,et as s,tt as t,ye as u,we as v,Pe as w,Se as x,at as y,Be as z};
|
|
1
|
+
import {c}from'./chunk-L6ZRNW7Y.mjs';import {V as V$1,L,T,k,l}from'./chunk-4RQAAKQI.mjs';import {b}from'./chunk-SHYNWAW6.mjs';import {e}from'./chunk-VW22RZ6C.mjs';function ee(e,n){if(e.pages.length===0)return null;let a=e.pageGap??0,r=0,t=null,o=1/0;for(let s=0;s<e.pages.length;s++){let i=e.pages[s],l=i.size?.h??e.pageSize.h,f=r,u=f+l;if(n.y>=f&&n.y<u)return {pageIndex:s,page:i,pageY:n.y-f};let c=f+l/2,m=Math.abs(n.y-c);m<o&&(o=m,t=s),r=u+a;}if(t!==null){let s=e.pages[t],i=A(e,t);return {pageIndex:t,page:s,pageY:Math.max(0,Math.min(n.y-i,s.size?.h??e.pageSize.h))}}return null}function A(e,n){let a=e.pageGap??0,r=0;for(let t=0;t<n&&t<e.pages.length;t++){let s=e.pages[t].size?.h??e.pageSize.h;r+=s+a;}return r}function Ne(e,n){return ee(e,{y:n})?.pageIndex??null}function te(e,n){return e.findIndex(a=>a.id===n)}function Ye(e,n){let a=0;for(let r=e.fromLine;r<e.toLine&&r<n.lines.length;r++)a+=n.lines[r].lineHeight;return a}function ge(e,n,a,r){let t=[...e.page.fragments].sort((o,s)=>{let i=o.y-s.y;return Math.abs(i)>.5?i:o.x-s.x});for(let o of t){let s=te(n,o.blockId);if(s===-1)continue;let i=n[s],l=a[s];if(!i||!l)continue;let f;if(o.kind==="paragraph"){if(i.kind!=="paragraph"||l.kind!=="paragraph")continue;f=Ye(o,l);}else if(o.kind==="table")f=o.height;else if(o.kind==="image")f=o.height;else continue;let u=r.x>=o.x&&r.x<=o.x+o.width,c=r.y>=o.y&&r.y<=o.y+f;if(u&&c)return {fragment:o,block:i,measure:l,pageIndex:e.pageIndex,localX:r.x-o.x,localY:r.y-o.y}}return null}function ze(e,n,a,r){for(let t of e.page.fragments){if(t.kind!=="image")continue;let o=te(n,t.blockId);if(o===-1)continue;let s=n[o],i=a[o];if(!s||!i)continue;let l=r.x>=t.x&&r.x<=t.x+t.width,f=r.y>=t.y&&r.y<=t.y+t.height;if(l&&f)return {fragment:t,block:s,measure:i,pageIndex:e.pageIndex,localX:r.x-t.x,localY:r.y-t.y}}return null}function pe(e,n,a,r){for(let t of e.page.fragments){if(t.kind!=="table")continue;let o=t,s=r.x>=o.x&&r.x<=o.x+o.width,i=r.y>=o.y&&r.y<=o.y+o.height;if(!s||!i)continue;let l=te(n,o.blockId);if(l===-1)continue;let f=n[l],u=a[l];if(!f||f.kind!=="table"||!u||u.kind!=="table")continue;let c=f,m=u,g=r.x-o.x,x=r.y-o.y,d=o.headerRowCount??0,h=d>0&&o.continuesFromPrev?V$1(m,d):0,p=0,b=-1;if(m.rows.length===0||c.rows.length===0)continue;if(h>0&&x<h){let M=0;for(let w=0;w<d&&w<m.rows.length;w++){let L=m.rows[w];if(x>=M&&x<M+L.height){b=w;break}M+=L.height;}b===-1&&(b=0);}else {let M=x-h;for(let w=o.fromRow;w<o.toRow&&w<m.rows.length;w++){let L=m.rows[w];if(M>=p&&M<p+L.height){b=w;break}p+=L.height;}}if(b===-1&&(b=Math.min(o.toRow-1,m.rows.length-1),b<o.fromRow))continue;let T=m.rows[b],H=c.rows[b];if(!T||!H)continue;let F=0,k=-1;if(T.cells.length===0||H.cells.length===0)continue;for(let M=0;M<T.cells.length;M++){let w=T.cells[M];if(g>=F&&g<F+w.width){k=M;break}F+=w.width;}if(k===-1&&(k=T.cells.length-1,k<0))continue;let P=T.cells[k],S=H.cells[k];if(!P||!S)continue;let y=0;if(h>0&&b<d)for(let M=0;M<b;M++)y+=m.rows[M]?.height??0;else {y=h;for(let M=o.fromRow;M<b;M++)y+=m.rows[M]?.height??0;}let R=0;for(let M=0;M<k;M++)R+=T.cells[M]?.width??0;let _,I;if(S.blocks&&S.blocks.length>0){let M=S.blocks[0],w=P.blocks[0];M.kind==="paragraph"&&w?.kind==="paragraph"&&(_=M,I=w);}let E=g-R,C=x-y;return {fragment:o,block:c,measure:m,pageIndex:e.pageIndex,rowIndex:b,colIndex:k,cellBlock:_,cellMeasure:I,cellLocalX:Math.max(0,E),cellLocalY:Math.max(0,C)}}return null}function We(e,n,a,r){let t={pageHit:null,fragmentHit:null,tableCellHit:null};if(t.pageHit=ee(e,r),!t.pageHit)return t;let o=A(e,t.pageHit.pageIndex),s={x:r.x,y:r.y-o};return t.fragmentHit=ge(t.pageHit,n,a,s),t.fragmentHit?.fragment.kind==="table"&&(t.tableCellHit=pe(t.pageHit,n,a,s)),t}function Ge(e){if(e.pages.length===0)return 0;let n=e.pageGap??0,a=0;for(let r=0;r<e.pages.length;r++){let t=e.pages[r];a+=t.size?.h??e.pageSize.h,r<e.pages.length-1&&(a+=n);}return a}function Ve(e,n){return A(e,n)}function Ue(e,n){if(n<0||n>=e.pages.length)return null;let a=A(e,n),t=e.pages[n].size?.h??e.pageSize.h;return {top:a,bottom:a+t}}function ne(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function be(e,n){let a=[];for(let r=n.fromRun;r<=n.toRun&&r<e.runs.length;r++){let t=e.runs[r];if(t){if(t.kind==="tab"||t.kind==="image"||t.kind==="lineBreak"){a.push(t);continue}if(t.kind==="text"){let o=t.text??"",s=r===n.fromRun,i=r===n.toRun;if(s||i){let l=s?n.fromChar:0,f=i?n.toChar:o.length,u=o.slice(l,f);u.length>0&&a.push({...t,text:u});}else a.push(t);}}}return a}function xe(e,n){let a,r,t=e.pmStart??0,o=0;for(let s=0;s<e.runs.length&&s<=n.toRun;s++){let i=e.runs[s];i&&(s<n.fromRun?i.kind==="text"?o+=(i.text??"").length:(i.kind==="tab"||i.kind==="lineBreak"||i.kind==="image")&&(o+=1):s===n.fromRun&&(o+=n.fromChar,a=t+o,i.kind==="text"&&(o=n.fromChar)));}if(a!==void 0){let s=0;for(let i=n.fromRun;i<=n.toRun&&i<e.runs.length;i++){let l=e.runs[i];if(l)if(l.kind==="text"){let f=l.text??"",u=i===n.fromRun?n.fromChar:0,c=i===n.toRun?n.toChar:f.length;s+=c-u;}else (l.kind==="tab"||l.kind==="lineBreak"||l.kind==="image")&&(s+=1);}r=a+s;}return {pmStart:a,pmEnd:r}}function $e(e,n,a,r){let t=0;for(let o=a;o<r&&o<e.lines.length;o++){let i=e.lines[o].lineHeight;if(n>=t&&n<t+i)return o;t+=i;}return r>a?Math.min(r-1,e.lines.length-1):null}function qe(e,n,a,r){let{pmStart:t,pmEnd:o}=xe(e,n);if(t===void 0||o===void 0)return {charOffset:0,pmPosition:e.pmStart??0};let s=e.attrs?.alignment??"left",i=0;s==="center"?i=Math.max(0,(r-n.width)/2):s==="right"&&(i=Math.max(0,r-n.width));let l$1=Math.max(0,a-i);if(l$1<=0)return {charOffset:0,pmPosition:t};let f=be(e,n);if(f.length===0)return {charOffset:0,pmPosition:t};let u=0,c=0;for(let g of f){if(g.kind==="tab"){let x=g.width??48,d=u+x;if(l$1<=d){let h=u+x/2;return l$1<h?{charOffset:c,pmPosition:t+c}:{charOffset:c+1,pmPosition:t+c+1}}u=d,c+=1;continue}if(g.kind==="image"){let x=g.width,d=u+x;if(l$1<=d){let h=u+x/2;return l$1<h?{charOffset:c,pmPosition:t+c}:{charOffset:c+1,pmPosition:t+c+1}}u=d,c+=1;continue}if(g.kind==="lineBreak"){if(l$1>=u)return {charOffset:c,pmPosition:t+c};c+=1;continue}if(g.kind==="text"){let x=g.text??"";if(x.length===0)continue;let d=ne(g),h=k(x,d),p=u+h.width;if(l$1<=p){let b=l$1-u,T=l(b,h.charWidths),H=c+T;return {charOffset:H,pmPosition:t+H}}u=p,c+=x.length;}}return {charOffset:o-t,pmPosition:o}}function oe(e){let{fragment:n,block:a,measure:r,localX:t,localY:o}=e;if(n.kind!=="paragraph"||a.kind!=="paragraph"||r.kind!=="paragraph")return null;let s=n,i=a,l=r,f=$e(l,o,s.fromLine,s.toLine);if(f===null)return null;let u=l.lines[f];if(!u)return null;let c=0;for(let T=s.fromLine;T<f;T++)c+=l.lines[T]?.lineHeight??0;let m=i.attrs?.indent,g=m?.left??0,x=m?.right??0,d=Math.max(0,n.width-g-x),h=t-g,{charOffset:p,pmPosition:b}=qe(i,u,h,d);return {pmPosition:b,charOffset:p,lineIndex:f}}function ke(e){let{cellBlock:n,cellMeasure:a,cellLocalX:r,cellLocalY:t}=e;if(!n||!a)return null;let o={fragment:{kind:"paragraph",blockId:n.id,x:0,y:0,width:a.lines.reduce((i,l)=>Math.max(i,l.width),100),fromLine:0,toLine:a.lines.length,height:a.totalHeight},block:n,measure:a,pageIndex:e.pageIndex,localX:r,localY:t};return oe(o)?.pmPosition??null}function je(e,n){if(n)return ke(n);if(!e)return null;let{fragment:a}=e;return a.kind==="paragraph"?oe(e)?.pmPosition??null:a.kind==="image"?a.pmStart??null:null}function Te(e,n,a,r){let t=e.pmStart??0,o=e.pmEnd??t;if(a<t||a>o)return null;let s=a-t;for(let i=0;i<n.lines.length;i++){let l=n.lines[i],{pmStart:f,pmEnd:u}=xe(e,l);if(f===void 0||u===void 0)continue;let c=f-t,m=u-t;if(s>=c&&s<=m){let g=s-c,x=be(e,l),d=0,h=0;for(let p of x)if(p.kind==="tab"){if(g<=h+1)return g<=h?{x:d,lineIndex:i}:{x:d+(p.width??48),lineIndex:i};d+=p.width??48,h+=1;}else if(p.kind==="image"){if(g<=h+1)return g<=h?{x:d,lineIndex:i}:{x:d+p.width,lineIndex:i};d+=p.width,h+=1;}else if(p.kind==="lineBreak"){if(g<=h)return {x:d,lineIndex:i};h+=1;}else if(p.kind==="text"){let b=p.text??"";if(g<=h+b.length){let F=g-h,k$1=ne(p),P=k(b.slice(0,F),k$1);return {x:d+P.width,lineIndex:i}}let T=ne(p),H=k(b,T);d+=H.width,h+=b.length;}return {x:d,lineIndex:i}}}return null}function Je(e,n,a,r,t,o,s){let i=Te(e,n,a);if(!i)return null;let l=e.attrs?.alignment??"left",f=e.attrs?.indent,u=f?.left??0,c=f?.right??0,m=Math.max(0,o-u-c),g=n.lines[i.lineIndex];if(!g)return null;let x=0;l==="center"?x=Math.max(0,(m-g.width)/2):l==="right"&&(x=Math.max(0,m-g.width));let d=0;for(let h=s;h<i.lineIndex;h++)d+=n.lines[h]?.lineHeight??0;return {x:r+u+x+i.x,y:t+d,height:g.lineHeight}}function Ke(e,n,a={}){let r=a.scope??"body",t=r==="body"?"layout-page-content":`layout-page-${r}`,o=`.${t} .layout-table-cell`,s=e.querySelectorAll(`.${t} .layout-table-cell-selected`);for(let c of Array.from(s))c.classList.remove("layout-table-cell-selected");let i=n.selection;if(!("$anchorCell"in i&&typeof i.forEachCell=="function")||!i.forEachCell)return;let f=[];i.forEachCell((c,m)=>{f.push([m,m+c.nodeSize]);});let u=e.querySelectorAll(o);for(let c of Array.from(u)){let m=c,g=m.dataset.pmStart;if(g===void 0)continue;let x=Number(g);for(let[d,h]of f)if(x>=d&&x<h){m.classList.add("layout-table-cell-selected");break}}}function Me(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function re(e,n){return e.findIndex(a=>a.id===n)}function V(e,n){let r=(e.pmStart??0)+1,t=0,o;for(let l=0;l<e.runs.length&&l<=n.toRun;l++){let f=e.runs[l];if(f){if(l<n.fromRun)f.kind==="text"?t+=(f.text??"").length:t+=1;else if(l===n.fromRun){t+=n.fromChar,o=r+t;break}}}o===void 0&&(o=r);let s=0;for(let l=n.fromRun;l<=n.toRun&&l<e.runs.length;l++){let f=e.runs[l];if(f)if(f.kind==="text"){let u=f.text??"",c=l===n.fromRun?n.fromChar:0,m=l===n.toRun?n.toChar:u.length;s+=m-c;}else s+=1;}let i=o+s;return {pmStart:o,pmEnd:i}}function Fe(e,n,a,r){let t=[];for(let o=0;o<n.lines.length;o++){let s=n.lines[o],i=V(e,s);i.pmStart===void 0||i.pmEnd===void 0||i.pmEnd>a&&i.pmStart<r&&t.push({line:s,index:o});}return t}function W(e,n,a){let r=V(e,n);return r.pmStart===void 0?0:Math.max(0,a-r.pmStart)}function G(e,n,a,r){let t=0,o=0;for(let s=n.fromRun;s<=n.toRun&&s<e.runs.length;s++){let i=e.runs[s];if(i){if(i.kind==="tab"){let l=i.width??48;if(o+1>=a)return a<=o?t:t+l;t+=l,o+=1;continue}if(i.kind==="image"){let l=i.width;if(o+1>=a)return a<=o?t:t+l;t+=l,o+=1;continue}if(i.kind==="lineBreak"){if(a<=o)return t;o+=1;continue}if(i.kind==="text"){let l=i.text??"",f=s===n.fromRun,u=s===n.toRun,c=f?n.fromChar:0,m=u?n.toChar:l.length,g=l.slice(c,m);if(o+g.length>=a){let h=a-o,p=Me(i),b=k(g.slice(0,h),p);return t+b.width}let x=Me(i),d=k(g,x);t+=d.width,o+=g.length;}}}return t}function J(e,n){let a=0;for(let r=0;r<n&&r<e.lines.length;r++)a+=e.lines[r].lineHeight;return a}function Qe(e,n,a,r,t){if(r===t)return [];let o=Math.min(r,t),s=Math.max(r,t),i=[];for(let l=0;l<e.pages.length;l++){let f=e.pages[l],u=A(e,l);for(let c of f.fragments){if(c.kind==="paragraph"){let m=re(n,c.blockId);if(m===-1)continue;let g=n[m],x=a[m];if(!g||g.kind!=="paragraph"||!x||x.kind!=="paragraph")continue;let d=g,h=x,p=c,b=Fe(d,h,o,s);for(let{line:T,index:H}of b){if(H<p.fromLine||H>=p.toLine)continue;let F=V(d,T);if(F.pmStart===void 0||F.pmEnd===void 0)continue;let k=Math.max(F.pmStart,o),P=Math.min(F.pmEnd,s);if(k>=P)continue;let S=W(d,T,k),y=W(d,T,P),B=d.attrs?.indent,R=B?.left??0,_=B?.right??0,I=Math.max(0,c.width-R-_),E=G(d,T,S),C=G(d,T,y),M=d.attrs?.alignment??"left",w=0;M==="center"?w=Math.max(0,(I-T.width)/2):M==="right"&&(w=Math.max(0,I-T.width));let L=J(h,H)-J(h,p.fromLine),D=c.x+R+w+Math.min(E,C),Y=Math.max(1,Math.abs(C-E)),z=c.y+L;i.push({x:D,y:z+u,width:Y,height:T.lineHeight,pageIndex:l});}}if(c.kind==="table"){let m=re(n,c.blockId);if(m===-1)continue;let g=n[m],x=a[m];if(!g||g.kind!=="table"||!x||x.kind!=="table")continue;let d=g,h=x,p=c,b=[],T=0;for(let y=0;y<h.rows.length;y++)b.push(Math.round(T)),T+=h.rows[y]?.height??0;b.push(Math.round(T));let H=p.headerRowCount??0,F=H>0&&p.continuesFromPrev?V$1(h,H):0,k=(b[p.fromRow]??0)+(p.topClip??0),P=p.bottomClip!==void 0?Math.round(p.height):F+((b[p.toRow]??0)-k),S=y=>F+(y-k);for(let y=p.fromRow;y<p.toRow&&y<d.rows.length;y++){let B=d.rows[y],R=h.rows[y];if(!B||!R)continue;let _=b[y]??0,I=0;for(let E=0;E<B.cells.length;E++){let C=B.cells[E],M=R.cells[E];if(!C||!M)continue;let w=C.padding?.top??0,L$1=L(C.blocks,M.blocks,w);for(let D=0;D<C.blocks.length;D++){let Y=C.blocks[D],z=M.blocks[D];if(!Y||Y.kind!=="paragraph"||!z||z.kind!=="paragraph")continue;let X=Y,Ae=z,De=L$1.lineTops[D]??[],ve=Fe(X,Ae,o,s);for(let{line:v,index:Oe}of ve){let q=V(X,v);if(q.pmStart===void 0||q.pmEnd===void 0)continue;let ae=Math.max(q.pmStart,o),se=Math.min(q.pmEnd,s);if(ae>=se)continue;let Q=S(_+(De[Oe]??0));if(Q+v.lineHeight<=F||Q>=P)continue;let _e=W(X,v,ae),Xe=W(X,v,se),le=G(X,v,_e,M.width),ce=G(X,v,Xe,M.width);i.push({x:p.x+I+Math.min(le,ce),y:p.y+Q+u,width:Math.max(1,Math.abs(ce-le)),height:v.lineHeight,pageIndex:l});}}I+=M.width;}}}if(c.kind==="image"){let m=c.pmStart??0;(c.pmEnd??m+1)>o&&m<s&&i.push({x:c.x,y:c.y+u,width:c.width,height:c.height,pageIndex:l});}}}return i}function Ze(e,n,a,r){for(let t=0;t<e.pages.length;t++){let o=e.pages[t],s=A(e,t);for(let i of o.fragments){if(i.kind==="paragraph"){let l=re(n,i.blockId);if(l===-1)continue;let f=n[l],u=a[l];if(!f||f.kind!=="paragraph"||!u||u.kind!=="paragraph")continue;let c=f,m=u,g=i,x=c.pmStart??0,d=c.pmEnd??x;if(r<x||r>d)continue;for(let h=g.fromLine;h<g.toLine;h++){let p=m.lines[h];if(!p)continue;let b=V(c,p);if(!(b.pmStart===void 0||b.pmEnd===void 0)&&r>=b.pmStart&&r<=b.pmEnd){let T=W(c,p,r),H=c.attrs?.indent,F=H?.left??0,k=H?.right??0,P=Math.max(0,i.width-F-k),S=G(c,p,T),y=c.attrs?.alignment??"left",B=0;y==="center"?B=Math.max(0,(P-p.width)/2):y==="right"&&(B=Math.max(0,P-p.width));let R=J(m,h)-J(m,g.fromLine);return {x:i.x+F+B+S,y:i.y+R+s,height:p.lineHeight,pageIndex:t}}}}if(i.kind==="image"){let l=i.pmStart??0,f=i.pmEnd??l+1;if(r>=l&&r<=f){let u=r===l?0:i.width;return {x:i.x+u,y:i.y+s,height:i.height,pageIndex:t}}}}}return null}function et(e){return e.length<=1?false:new Set(e.map(a=>a.pageIndex)).size>1}function tt(e){let n=new Map;for(let a of e){let r=n.get(a.pageIndex)??[];r.push(a),n.set(a.pageIndex,r);}return n}function nt(e){if(e.kind!=="paragraph")return false;let n=e.attrs;return n?!!(n.borders?.top||n.borders?.bottom||n.spacingExplicit?.before||n.spacingExplicit?.after):false}function ye(e){return He(e)}function He(e){let n=new Set;for(let a=1;a<e.length;a++){let r=e[a-1],t=e[a];r.kind==="table"&&t.kind==="paragraph"&&(t.runs.length>0||nt(t)||n.add(a));}return e.map((a,r)=>{if(a.kind==="table")return ot(a);if(a.kind!=="paragraph")return a;let t=n.has(r),o=a.attrs?.spacingExplicit,s=a.attrs?.spacing?.before!=null,i=a.attrs?.spacing?.after!=null,l=s&&!o?.before,f=i&&!o?.after,u=l||f;if(!u&&!t)return a;let c=a.attrs;return u&&c?.spacing&&(c={...c,spacing:{...c.spacing,before:o?.before?c.spacing.before:void 0,after:o?.after?c.spacing.after:void 0}}),t&&(c={...c??{},suppressEmptyParagraphHeight:true}),{...a,attrs:c}})}function ot(e){let n=false,a=e.rows.map(r=>{let t=false,o=r.cells.map(s=>{let i=He(s.blocks);return i.some((f,u)=>f!==s.blocks[u])?(t=true,{...s,blocks:i}):s});return t?(n=true,{...r,cells:o}):r});return n?{...e,rows:a}:e}function rt(e){return e?.align??e?.alignment}function we(e$1,n,a,r){let t=r.section==="header"?r.margins.header??48:r.pageSize.h-(r.margins.footer??48)-a,o=e$1.position?.vertical;if(!o)return n;let s=rt(o),i=o.posOffset!==void 0?e(o.posOffset):void 0;if(o.relativeTo==="page"){if(i!==void 0)return i-t;if(s==="top")return -t;if(s==="bottom")return r.pageSize.h-e$1.height-t;if(s==="center")return (r.pageSize.h-e$1.height)/2-t}if(o.relativeTo==="margin"){let l=r.margins.top,f=r.pageSize.h-r.margins.top-r.margins.bottom;if(i!==void 0)return l+i-t;if(s==="top")return l-t;if(s==="bottom")return l+f-e$1.height-t;if(s==="center")return l+(f-e$1.height)/2-t}return i!==void 0?n+i:n}function Pe(e){switch(e.kind){case "paragraph":case "table":return true;case "image":return !e.anchor?.isAnchored;case "textBox":return e.displayMode===void 0||e.displayMode==="inline";default:return false}}function it(e){return e?e.kind==="paragraph"||e.kind==="table"?e.totalHeight:e.kind==="image"||e.kind==="textBox"?e.height:0:0}function Se(e,n,a,r){let t=0,o=0,s=0;for(let i=0;i<e.length;i++){let l=e[i],f=n[i];if(!(!l||!f)){if(l.kind==="paragraph"&&f.kind==="paragraph"){let u=s,c=u+f.totalHeight;t=Math.min(t,u),o=Math.max(o,c);for(let m of l.runs){if(m.kind!=="image"||!m.position)continue;let g=we(m,u,a,r);t=Math.min(t,g),o=Math.max(o,g+m.height);}s=c;}else if(l.kind==="table"&&f.kind==="table"){let u=s+f.totalHeight;t=Math.min(t,s),o=Math.max(o,u),s=u;}else if(l.kind==="image"&&f.kind==="image"){let u=s+f.height;t=Math.min(t,s),o=Math.max(o,u),s=u;}else if(l.kind==="textBox"&&f.kind==="textBox"){let u=s+f.height;t=Math.min(t,s),o=Math.max(o,u),l.displayMode!=="float"&&(s=u);}}}return {visualTop:t,visualBottom:o}}function at(e,n,a,r){if(!e||!e.content||e.content.length===0)return;let t=b(e.content,{styles:r.styles??void 0,theme:r.theme??null,defaultTabStopTwips:r.defaultTabStopTwips??null});return Be(t,n,a,r)}function Be(e,n,a,r){let t=c(e,{theme:r.theme??void 0});if(t.length===0)return;let o=ye(t),s=r.measureBlocks(o,n),i=0,l=0;for(let c=0;c<o.length;c++){let m=it(s[c]);i+=m,Pe(o[c])&&(l+=m);}let{visualTop:f,visualBottom:u}=Se(o,s,i,a);return {blocks:o,measures:s,height:i,flowHeight:l,visualTop:f,visualBottom:u}}var K={header:null,footer:null};function st(){K.header=null,K.footer=null;}function Re(e,n){let a=n.querySelectorAll(`.layout-page-${e}`);if(a.length===0)return null;let r=n.defaultView,t=r?r.innerHeight/2:0,o=a[0],s=1/0;for(let c of Array.from(a)){let m=c.getBoundingClientRect(),g=Math.abs((m.top+m.bottom)/2-t);g<s&&(s=g,o=c);}let i=K[e];if(i&&i.host===o&&i.host.isConnected)return i;let l=Array.from(o.querySelectorAll("span[data-pm-start][data-pm-end]")),f=Array.from(o.querySelectorAll("[data-pm-start][data-pm-end]")),u={host:o,spans:l,ranged:f};return K[e]=u,u}function lt(e,n,a=globalThis.document){let r=e.state.selection;if(!r.empty)return null;let t=r.head,o=Re(n,a);if(!o)return null;let{host:s,spans:i}=o;for(let d of i){let h=Number(d.dataset.pmStart),p=Number(d.dataset.pmEnd);if(!(!Number.isFinite(h)||!Number.isFinite(p))&&t>=h&&t<=p){let b=s.ownerDocument.createRange(),T=s.ownerDocument.createTreeWalker(d,NodeFilter.SHOW_TEXT),H=t-h,F=T.nextNode();for(;F;){let S=F.data.length;if(H<=S){try{b.setStart(F,H),b.setEnd(F,H);let y=b.getClientRects()[0]??b.getBoundingClientRect();if(y&&y.height>0)return {top:y.top,left:y.left,height:y.height}}catch{}break}H-=S,F=T.nextNode();}let k=d.getBoundingClientRect(),P=(t-h)/Math.max(1,p-h);return {top:k.top,left:k.left+k.width*P,height:k.height}}}let l=s.querySelector(`[data-pm-start="${t}"]`);if(l){let d=l.getBoundingClientRect();return {top:d.top,left:d.left+1,height:d.height||16}}let f=o.ranged,u=null,c=1/0;for(let d of f){let h=Number(d.dataset.pmStart),p=Number(d.dataset.pmEnd);if(!Number.isFinite(h)||!Number.isFinite(p)||t<h||t>p)continue;let b=p-h;b<c&&(c=b,u=d);}if(u){let d=u.getBoundingClientRect(),h=Number(u.dataset.pmEnd),p=t>=h;return {top:d.top,left:p?d.right:d.left+1,height:d.height||16}}let m=null,g=-1/0;for(let d of f){let h=Number(d.dataset.pmStart);Number.isFinite(h)&&(h>t||h>g&&(g=h,m=d));}if(m){let d=m.getBoundingClientRect();return {top:d.top,left:d.right,height:d.height||16}}let x=s.getBoundingClientRect();return {top:x.top+2,left:x.left+2,height:16}}function ct(e,n,a=globalThis.document){let r=e.state.selection;if(r.empty)return [];let t=r.from,o=r.to,s=[],i=Re(n,a);if(!i)return s;let{host:l,spans:f}=i;for(let u of f){let c=Number(u.dataset.pmStart),m=Number(u.dataset.pmEnd);if(!Number.isFinite(c)||!Number.isFinite(m)||m<=t||c>=o)continue;if(u.classList.contains("layout-run-tab")){let p=u.getBoundingClientRect();s.push({top:p.top,left:p.left,width:p.width,height:p.height});continue}let g=null;if(u.firstChild?.nodeType===Node.TEXT_NODE?g=u.firstChild:u.firstChild?.nodeType===Node.ELEMENT_NODE&&u.firstChild.tagName==="A"&&u.firstChild.firstChild?.nodeType===Node.TEXT_NODE&&(g=u.firstChild.firstChild),!g)continue;let x=Math.max(0,t-c),d=Math.min(g.length,o-c);if(x>=d)continue;let h=l.ownerDocument.createRange();h.setStart(g,x),h.setEnd(g,d);for(let p of Array.from(h.getClientRects()))s.push({top:p.top,left:p.left,width:p.width,height:p.height});}return s}function Ie(e){return e?e.flowHeight??e.height:0}function ut(e){let{pageSize:n,margins:a,finalMargins:r,bodyBlocks:t,headers:o,footers:s,warn:i}=e,l=a.header??48,f=a.footer??48,u=a.top-l,c=a.bottom-f,m=Math.max(0,...(o??[]).map(Ie)),g=Math.max(0,...(s??[]).map(Ie)),x=m>u,d=g>c;if(!x&&!d)return {margins:a,finalMargins:r};let h=Math.max(0,n.h-24),p=false,b=F=>{let k={...F};return x&&(k.top=Math.max(F.top,l+m)),d&&(k.bottom=Math.max(F.bottom,f+g)),k.top+k.bottom>h&&(p=true,k.bottom=Math.max(0,Math.min(k.bottom,h-k.top)),k.top+k.bottom>h&&(k.top=Math.max(0,h-k.bottom))),k},T=b(a),H=b(r);if(t)for(let F of t){if(F.kind!=="sectionBreak")continue;let k=F;k.margins&&(k.margins=b(k.margins));}return p&&i&&i(`[layout] header/footer content exceeds page height; clamping margins to preserve a content area. pageHeight=${Math.round(n.h)} headerBand=${Math.round(m)} footerBand=${Math.round(g)} top=${Math.round(T.top)} bottom=${Math.round(T.bottom)}`),{margins:T,finalMargins:H}}var Ce=816,Ee=1056,U=96,ie=48;function $(e){return Math.round(e/1440*96)}function N(e,n){return e!=null?$(e):n}function ft(e){return {w:e?.pageWidth?$(e.pageWidth):Ce,h:e?.pageHeight?$(e.pageHeight):Ee}}function dt(e){return {top:N(e?.marginTop,U),right:N(e?.marginRight,U),bottom:N(e?.marginBottom,U),left:N(e?.marginLeft,U),header:N(e?.headerDistance,ie),footer:N(e?.footerDistance,ie)}}function ht(e,n){let a={header:null,footer:null,firstHeader:null,firstFooter:null};if(!e?.package)return a;let r=e.package.headers,t=e.package.footers,o=null,s=null,i=null,l=null;if(r&&n?.headerReferences){let f=n.headerReferences.find(c=>c.type==="default");f?.rId&&(o=r.get(f.rId)??null);let u=n.headerReferences.find(c=>c.type==="first");u?.rId&&(i=r.get(u.rId)??null);}if(t&&n?.footerReferences){let f=n.footerReferences.find(c=>c.type==="default");f?.rId&&(s=t.get(f.rId)??null);let u=n.footerReferences.find(c=>c.type==="first");u?.rId&&(l=t.get(u.rId)??null);}return n?.titlePg||(!o&&i&&(o=i),!s&&l&&(s=l)),{header:o,footer:s,firstHeader:i,firstFooter:l}}function mt(e){let n=e?.columnCount??1;if(n<=1)return;let a=$(e?.columnSpace??720);return {count:n,gap:a,equalWidth:e?.equalWidth??true,separator:e?.separator}}function Le(e){let n=e.pageSize.w-e.margins.left-e.margins.right,a=e.columns;return !a||a.count<=1?n:Math.floor((n-(a.count-1)*a.gap)/a.count)}function gt(e,n,a){let{configs:r,breakIndices:t}=T(e,n,a),o=0,s=[];for(let i=0;i<e.length;i++)s.push(Le(r[o]??n)),o<t.length&&i===t[o]&&o++;return s}export{st as A,lt as B,ct as C,ut as D,Ce as E,Ee as F,U as G,ie as H,$ as I,ft as J,dt as K,ht as L,mt as M,Le as N,gt as O,ee as a,A as b,Ne as c,ge as d,ze as e,pe as f,We as g,Ge as h,Ve as i,Ue as j,oe as k,ke as l,je as m,Te as n,Je as o,Ke as p,Qe as q,Ze as r,et as s,tt as t,ye as u,we as v,Pe as w,Se as x,at as y,Be as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkLWH66Q7Q_js=require('./chunk-LWH66Q7Q.js'),chunk7HANRHHL_js=require('./chunk-7HANRHHL.js'),chunkGSKMHXHG_js=require('./chunk-GSKMHXHG.js'),chunkH57LNDBH_js=require('./chunk-H57LNDBH.js'),prosemirrorState=require('prosemirror-state'),prosemirrorCommands=require('prosemirror-commands');function A(t){let e={};for(let n of t)switch(n.type.name){case "bold":e.bold=true;break;case "italic":e.italic=true;break;case "underline":e.underline={style:n.attrs.style||"single"};break;case "strike":e.strike=true;break;case "textColor":e.color=n.attrs;break;case "highlight":e.highlight=n.attrs.color;break;case "fontSize":e.fontSize=n.attrs.size;break;case "fontFamily":e.fontFamily={ascii:n.attrs.ascii,hAnsi:n.attrs.hAnsi};break;case "superscript":e.vertAlign="superscript";break;case "subscript":e.vertAlign="subscript";break}return e}function M(t,e,n){let{$from:r}=t.selection,o=r.parent;if(o.type.name!=="paragraph"||o.textContent.length>0)return e;if(n.length===0)return e.setNodeMarkup(r.before(),void 0,{...o.attrs,defaultTextFormatting:null});let a=A(n);return e.setNodeMarkup(r.before(),void 0,{...o.attrs,defaultTextFormatting:a})}function x(t,e,n){let r=t.tr;r=M(t,r,n),r.setStoredMarks(n),e(r);}function C(t,e){return (n,r)=>{let{from:o,to:a,empty:i}=n.selection,s=t.create(e);if(i){if(r){let u=n.storedMarks||n.selection.$from.marks(),l=t.isInSet(u)?u.filter(m=>m.type!==t):u;x(n,r,[...l,s]);}return true}return r&&r(n.tr.addMark(o,a,s).scrollIntoView()),true}}function P(t){return (e,n)=>{let{from:r,to:o,empty:a}=e.selection;if(a){if(n){let i=(e.storedMarks||e.selection.$from.marks()).filter(s=>s.type!==t);x(e,n,i);}return true}return n&&n(e.tr.removeMark(r,o,t).scrollIntoView()),true}}function q(t,e,n){let{from:r,to:o,empty:a}=t.selection;if(a)return (t.storedMarks||t.selection.$from.marks()).some(u=>u.type!==e?false:n?Object.entries(n).every(([l,m])=>u.attrs[l]===m):true);let i=false;return t.doc.nodesBetween(r,o,s=>{if(s.isText){let u=e.isInSet(s.marks);if(u&&(!n||Object.entries(n).every(([m,p])=>u.attrs[m]===p)))return i=true,false}return true}),i}function G(t,e,n){let{empty:r,$from:o,from:a,to:i}=t.selection;if(r){let u=t.storedMarks||o.marks();for(let l of u)if(l.type===e)return l.attrs[n];return null}let s=null;return t.doc.nodesBetween(a,i,u=>{if(u.isText&&s===null){let l=e.isInSet(u.marks);if(l)return s=l.attrs[n],false}return true}),s}function d(t,e){let n=[];return t.bold&&n.push(e.marks.bold.create()),t.italic&&n.push(e.marks.italic.create()),t.underline&&n.push(e.marks.underline.create({style:t.underline.style||"single",color:t.underline.color})),t.strike&&n.push(e.marks.strike.create()),t.doubleStrike&&n.push(e.marks.strike.create({double:true})),t.color&&n.push(e.marks.textColor.create({rgb:t.color.rgb,themeColor:t.color.themeColor,themeTint:t.color.themeTint,themeShade:t.color.themeShade})),t.highlight&&n.push(e.marks.highlight.create({color:t.highlight})),t.fontSize&&n.push(e.marks.fontSize.create({size:t.fontSize})),t.fontFamily&&n.push(e.marks.fontFamily.create({ascii:t.fontFamily.ascii,hAnsi:t.fontFamily.hAnsi,asciiTheme:t.fontFamily.asciiTheme})),t.vertAlign==="superscript"&&n.push(e.marks.superscript.create()),t.vertAlign==="subscript"&&n.push(e.marks.subscript.create()),n}var J=(t,e)=>{let{from:n,to:r,empty:o}=t.selection;if(o){if(e){let a=M(t,t.tr,[]);a.setStoredMarks([]),e(a);}return true}if(e){let a=t.tr;t.doc.nodesBetween(n,r,(i,s)=>{if(i.isText&&i.marks.length>0){let u=Math.max(n,s),l=Math.min(r,s+i.nodeSize);for(let m of i.marks)a=a.removeMark(u,l,m.type);}}),e(a.scrollIntoView());}return true};function Q(t,e){return C(t,e||{})}function U(t){return P(t)}var b=new prosemirrorState.PluginKey("documentStyles");function ee(t){let e=t instanceof chunkLWH66Q7Q_js.a?t:t?chunkLWH66Q7Q_js.b(t):null;return new prosemirrorState.Plugin({key:b,state:{init:()=>e,apply:(n,r)=>r}})}function v(t){return b.getState(t)??null}function T(t){let e=t.paragraphFormatting,n=t.runFormatting,r=!!n&&Object.keys(n).length>0;return {alignment:e?.alignment??null,spaceBefore:e?.spaceBefore??null,spaceAfter:e?.spaceAfter??null,lineSpacing:e?.lineSpacing??null,lineSpacingRule:e?.lineSpacingRule??null,indentLeft:e?.indentLeft??null,indentRight:e?.indentRight??null,indentFirstLine:e?.indentFirstLine??null,hangingIndent:e?.hangingIndent??null,contextualSpacing:e?.contextualSpacing??null,keepNext:e?.keepNext??null,keepLines:e?.keepLines??null,pageBreakBefore:e?.pageBreakBefore??null,outlineLevel:e?.outlineLevel??null,defaultTextFormatting:r?n:null}}function re(t,e){let n=t.paragraphFormatting?.numPr;if(!n||n.numId===void 0||n.numId===0)return null;let r=e?chunkH57LNDBH_js.d(n,e):null,o=e?.getLevel(n.numId,n.ilvl??0),a={numPr:{numId:n.numId,ilvl:n.ilvl??0},numPrFromStyle:{numId:n.numId,ilvl:n.ilvl??0},listNumFmt:r?.numFmt??null,listIsBullet:r?.isBullet??null,listMarker:r?.marker??null,listMarkerHidden:r?.markerHidden??null,listMarkerFontFamily:r?.markerFontFamily??null,listMarkerFontSize:r?.markerFontSize??null,listMarkerSuffix:r?.markerSuffix??null,listLevelNumFmts:r?.levelNumFmts??null,listAbstractNumId:r?.abstractNumId??null,listStartOverride:r?.startOverride??null},i=t.paragraphFormatting;return o?.pPr&&(i?.indentLeft===void 0&&o.pPr.indentLeft!==void 0&&(a.indentLeft=o.pPr.indentLeft),i?.indentFirstLine!==void 0||i?.hangingIndent!==void 0||(o.pPr.indentFirstLine!==void 0&&(a.indentFirstLine=o.pPr.indentFirstLine),o.pPr.hangingIndent!==void 0&&(a.hangingIndent=o.pPr.hangingIndent))),a}function I(...t){return (e,n,r)=>{for(let o of t)if(o(e,n,r))return true;return false}}var K=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parentOffset!==0||n.parent.type.name!=="paragraph")return false;let r=n.parent.attrs,o=r.indentFirstLine!=null&&r.indentFirstLine>0,a=!!r.hangingIndent,i=r.indentLeft!=null&&r.indentLeft>0;if(!o&&!a&&!i)return false;if(e){let s=n.before(),u=t.tr.setNodeMarkup(s,void 0,{...r,indentFirstLine:null,hangingIndent:null,indentLeft:null});e(u.scrollIntoView());}return true},V=["defaultTextFormatting","styleId","lineSpacing","lineSpacingRule","spaceAfter","spaceBefore","contextualSpacing"],L=new Set(["fontFamily","fontSize","textColor"]);function _(t,e,n,r,o,a){let i=o.resolveParagraphStyle(r);t.setNodeMarkup(e,void 0,{...n.attrs,styleId:r,...T(i),borders:null}),t.setStoredMarks(i.runFormatting?d(i.runFormatting,a):[]);}function j(t,e,n,r,o){let{$from:a}=t.selection,i=a.parent;if(i.type.name!=="paragraph")return;if(o&&e&&i.textContent.length===0){let c=o.getNextStyleId(e.attrs.styleId);if(c){_(t,a.before(),i,c,o,r);return}}let s={...i.attrs},u=false;if(e)for(let c of V){let f=e.attrs[c];f!=null&&s[c]==null&&(s[c]=f,u=true);}if(s.borders&&(s.borders=null,u=true),u&&t.setNodeMarkup(a.before(),void 0,s),i.textContent.length!==0)return;let l=[...n];if(l.length===0&&e){let c=e.attrs.defaultTextFormatting;c&&(l=d(c,r).filter(w=>L.has(w.type.name)));}if(l.length===0)return;let m={...s.defaultTextFormatting??{}},p=false;for(let c of l)if(c.type.name==="fontSize"&&c.attrs.size!==m.fontSize&&(m.fontSize=c.attrs.size,p=true),c.type.name==="fontFamily"){let f=c.attrs.ascii;f&&(!m.fontFamily||m.fontFamily.ascii!==f)&&(m.fontFamily=chunkGSKMHXHG_js.a(m.fontFamily,{ascii:f,hAnsi:c.attrs.hAnsi}),p=true);}p&&t.setNodeMarkup(a.before(),void 0,{...s,defaultTextFormatting:m}),t.setStoredMarks(l);}var Y=(t,e,n)=>{let{$from:r}=t.selection,o=r.parent.type.name==="paragraph"?r.parent:null,i=(t.storedMarks||r.marks()).filter(l=>L.has(l.type.name)),s=null;if(!prosemirrorCommands.splitBlock(t,e?l=>{s=l;}:void 0,n))return false;if(e&&s!==null){let l=s;j(l,o,i,t.schema,v(t)),e(l.scrollIntoView());}return true},fe=chunk7HANRHHL_js.b({name:"baseKeymap",priority:chunk7HANRHHL_js.a.Low,onSchemaReady(t){return {keyboardShortcuts:{...prosemirrorCommands.baseKeymap,Enter:Y,Backspace:I(prosemirrorCommands.deleteSelection,K,prosemirrorCommands.joinBackward),Delete:I(prosemirrorCommands.deleteSelection,prosemirrorCommands.joinForward),"Mod-a":prosemirrorCommands.selectAll,Escape:prosemirrorCommands.selectParentNode}}}});exports.a=T;exports.b=re;exports.c=C;exports.d=P;exports.e=q;exports.f=G;exports.g=d;exports.h=J;exports.i=Q;exports.j=U;exports.k=b;exports.l=ee;exports.m=v;exports.n=L;exports.o=j;exports.p=fe;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
'use strict';var chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkESI4BSBF_js=require('./chunk-ESI4BSBF.js'),
|
|
1
|
+
'use strict';var chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkESI4BSBF_js=require('./chunk-ESI4BSBF.js'),chunkP7HWOJC5_js=require('./chunk-P7HWOJC5.js');function M(o){return typeof o=="object"&&o!==null&&("_def"in o||"parse"in o||"safeParse"in o)}function v(o,i){let s=i,{position:n,variableName:t}=s,e=JSON.parse(JSON.stringify(o)),a=e.package.document.content.filter(m=>m.type==="paragraph");if(n.paragraphIndex>=a.length)throw new Error(`Paragraph index ${n.paragraphIndex} out of bounds`);let l=a[n.paragraphIndex],p=`{${t}}`;return C(l,n.offset,p),e.templateVariables||(e.templateVariables=[]),e.templateVariables.includes(t)||e.templateVariables.push(t),e}function w(o,i){let s=i,{range:n,variableName:t}=s,e=JSON.parse(JSON.stringify(o)),a=e.package.document.content.filter(m=>m.type==="paragraph");if(n.start.paragraphIndex!==n.end.paragraphIndex)throw new Error("Template variable replacement cannot span multiple paragraphs");if(n.start.paragraphIndex>=a.length)throw new Error(`Paragraph index ${n.start.paragraphIndex} out of bounds`);let l=a[n.start.paragraphIndex];I(l,n.start.offset,n.end.offset);let p=`{${t}}`;return C(l,n.start.offset,p),e.templateVariables||(e.templateVariables=[]),e.templateVariables.includes(t)||e.templateVariables.push(t),e}function C(o,i,s){let n=0,t=false;for(let e=0;e<o.content.length;e++){let r=o.content[e];if(r.type==="run"){let a=g(r),l=n,p=n+a.length;if(!t&&i>=l&&i<=p){let m=i-l,f=a.slice(0,m),x=a.slice(m),d=[];for(let c=0;c<e;c++)d.push(o.content[c]);f&&d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:f}]}),d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:s}]}),x&&d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:x}]});for(let c=e+1;c<o.content.length;c++)d.push(o.content[c]);o.content=d,t=true;break}n=p;}else if(r.type==="hyperlink")for(let a of r.children)a.type==="run"&&(n+=g(a).length);}t||o.content.push({type:"run",content:[{type:"text",text:s}]});}function I(o,i,s){let n=[],t=0;for(let e of o.content)if(e.type==="run"){let r=g(e),a=t,l=t+r.length;if(l<=i||a>=s)n.push(e);else {let p="";a<i&&(p+=r.slice(0,i-a)),l>s&&(p+=r.slice(s-a)),p.length>0&&n.push({type:"run",formatting:e.formatting,content:[{type:"text",text:p}]});}t=l;}else n.push(e);o.content=n;}function g(o){return o.content.filter(i=>i.type==="text").map(i=>i.text).join("")}var u={type:"string",description:"Document ID from a previous docx_load call"},D={type:"object",properties:{paragraphIndex:{type:"number",description:"Index of the paragraph (0-indexed)"},offset:{type:"number",description:"Character offset within the paragraph"}},required:["paragraphIndex","offset"]},V={name:"docx_get_variables",description:`List all template variables ({name} format) found in the document.
|
|
2
2
|
Returns variable names without braces, along with their locations (body, headers, footers, etc.).
|
|
3
3
|
Use this to discover what data fields a template document expects.`,inputSchema:{type:"object",properties:{documentId:u},required:["documentId"]},handler:async(o,i)=>{let{documentId:s}=o,n=i.session.documents.get(s);if(!n)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};try{let t=chunkU4UCHBZ7_js.b(n.document);return {content:[{type:"text",text:JSON.stringify({variables:t.variables,count:t.variables.length,totalOccurrences:t.totalOccurrences,byLocation:t.byLocation},null,2)}]}}catch(t){return {isError:true,content:[{type:"text",text:`Failed to detect variables: ${t.message}`}]}}},annotations:{category:"template",readOnly:true,complexity:"low",examples:[{description:"Get all variables from a loaded document",input:{documentId:"doc_123"},output:'{"variables": ["customer_name", "invoice_date"], "count": 2}'}]}},R={name:"docx_insert_variable",description:`Insert a template variable placeholder ({name}) at a specific position in the document.
|
|
4
4
|
The variable can later be substituted with actual values using docx_apply_template.
|
|
5
5
|
Variable names should follow the pattern: letters, numbers, underscores, starting with a letter.`,inputSchema:{type:"object",properties:{documentId:u,position:D,variableName:{type:"string",description:'Variable name without braces (e.g., "customer_name"). Will be inserted as {customer_name}',pattern:"^[a-zA-Z_][a-zA-Z0-9_]*$"}},required:["documentId","position","variableName"]},handler:async(o,i)=>{let{documentId:s,position:n,variableName:t}=o,e=i.session.documents.get(s);if(!e)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!/^[a-zA-Z_][a-zA-Z0-9_\-.]*$/.test(t))return {isError:true,content:[{type:"text",text:`Invalid variable name: ${t}. Must start with letter/underscore and contain only alphanumeric, underscore, hyphen, or dot.`}]};try{let{executeCommand:r}=await import('./executor-DZAMMQ35.js'),a=r(e.document,{type:"insertText",position:n,text:`{${t}}`});return e.document=a,e.lastModified=Date.now(),a.templateVariables||(a.templateVariables=[]),a.templateVariables.includes(t)||a.templateVariables.push(t),{content:[{type:"text",text:JSON.stringify({success:!0,variable:t,insertedAs:`{${t}}`,position:n})}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to insert variable: ${r.message}`}]}}},annotations:{category:"template",readOnly:false,complexity:"low",examples:[{description:"Insert customer name variable at start of first paragraph",input:{documentId:"doc_123",position:{paragraphIndex:0,offset:0},variableName:"customer_name"}}]}},S={name:"docx_apply_template",description:`Substitute template variables with actual values in the document.
|
|
6
6
|
Replaces all {variable} placeholders with the corresponding values provided.
|
|
7
7
|
Preserves all formatting (fonts, styles, colors, tables).
|
|
8
|
-
Use docx_get_variables first to discover what variables exist in the document.`,inputSchema:{type:"object",properties:{documentId:u,variables:{type:"object",description:'Map of variable names to values (e.g., {"customer_name": "John Doe", "date": "2024-01-15"})',additionalProperties:{type:"string"}},keepUnmatchedVariables:{type:"boolean",description:"If true, keep {variable} placeholders for variables not in the map. If false, replace with empty string. Default: true",default:true}},required:["documentId","variables"]},handler:async(o,i)=>{let{documentId:s,variables:n,keepUnmatchedVariables:t=true}=o,e=i.session.documents.get(s);if(!e)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!e.buffer)return {isError:true,content:[{type:"text",text:"Cannot apply template: document was not loaded from a DOCX buffer"}]};try{let r=chunkESI4BSBF_js.b(e.buffer,n,{nullGetter:t?"keep":"empty"}),a=await
|
|
8
|
+
Use docx_get_variables first to discover what variables exist in the document.`,inputSchema:{type:"object",properties:{documentId:u,variables:{type:"object",description:'Map of variable names to values (e.g., {"customer_name": "John Doe", "date": "2024-01-15"})',additionalProperties:{type:"string"}},keepUnmatchedVariables:{type:"boolean",description:"If true, keep {variable} placeholders for variables not in the map. If false, replace with empty string. Default: true",default:true}},required:["documentId","variables"]},handler:async(o,i)=>{let{documentId:s,variables:n,keepUnmatchedVariables:t=true}=o,e=i.session.documents.get(s);if(!e)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!e.buffer)return {isError:true,content:[{type:"text",text:"Cannot apply template: document was not loaded from a DOCX buffer"}]};try{let r=chunkESI4BSBF_js.b(e.buffer,n,{nullGetter:t?"keep":"empty"}),a=await chunkP7HWOJC5_js.a(r.buffer);return e.document=a,e.buffer=r.buffer,e.lastModified=Date.now(),{content:[{type:"text",text:JSON.stringify({success:!0,replacedVariables:r.replacedVariables,unreplacedVariables:r.unreplacedVariables,warnings:r.warnings})}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to apply template: ${r.message}`}]}}},annotations:{category:"template",readOnly:false,complexity:"medium",examples:[{description:"Fill in customer and date values",input:{documentId:"doc_123",variables:{customer_name:"Jane Smith",invoice_date:"2024-02-15",amount:"$1,234.56"}}}]}},k={name:"docx_validate_template",description:`Validate that a document is a valid docxtemplater template.
|
|
9
9
|
Checks for syntax errors like unclosed braces, invalid tag names, etc.
|
|
10
10
|
Returns validation result with any errors found and list of valid tags.`,inputSchema:{type:"object",properties:{documentId:u},required:["documentId"]},handler:async(o,i)=>{let{documentId:s}=o,n=i.session.documents.get(s);if(!n)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!n.buffer)return {isError:true,content:[{type:"text",text:"Cannot validate template: document was not loaded from a DOCX buffer"}]};try{let t=chunkESI4BSBF_js.f(n.buffer);return {content:[{type:"text",text:JSON.stringify({valid:t.valid,tags:t.tags,errors:t.errors.map(e=>({message:e.message,variable:e.variable,type:e.type}))},null,2)}]}}catch(t){return {isError:true,content:[{type:"text",text:`Failed to validate template: ${t.message}`}]}}},annotations:{category:"template",readOnly:true,complexity:"low"}},P=[V,R,S,k];var E={id:"docxtemplater",name:"Docxtemplater",version:"1.0.0",description:"Template variable support using standard docxtemplater syntax ({variable})",commandHandlers:{insertTemplateVariable:v,replaceWithTemplateVariable:w},mcpTools:P};exports.a=M;exports.b=E;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
'use strict';var chunkO2643IUW_js=require('./chunk-O2643IUW.js'),chunkZ3LGMBJC_js=require('./chunk-Z3LGMBJC.js'),chunkH57LNDBH_js=require('./chunk-H57LNDBH.js'),chunk3R7QHNI5_js=require('./chunk-3R7QHNI5.js');var Ie={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"},J={majorFont:{latin:"Calibri Light",ea:"",cs:"",fonts:{}},minorFont:{latin:"Calibri",ea:"",cs:"",fonts:{}}},ge={name:"Office Theme",colorScheme:Ie,fontScheme:J},ht=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"];function wt(e){if(!e)return null;switch(chunk3R7QHNI5_js.d(e.name||"")){case "srgbClr":return chunk3R7QHNI5_js.j(e,"a","val")??chunk3R7QHNI5_js.j(e,null,"val")??null;case "sysClr":{let n=chunk3R7QHNI5_js.j(e,"a","lastClr")??chunk3R7QHNI5_js.j(e,null,"lastClr");if(n)return n;switch(chunk3R7QHNI5_js.j(e,"a","val")??chunk3R7QHNI5_js.j(e,null,"val")){case "windowText":case "menuText":case "captionText":case "btnText":return "000000";case "window":case "menu":case "btnFace":case "btnHighlight":return "FFFFFF";case "highlight":return "0078D7";case "highlightText":return "FFFFFF";case "grayText":return "808080";default:return null}}case "schemeClr":{chunk3R7QHNI5_js.j(e,"a","val")??chunk3R7QHNI5_js.j(e,null,"val");return null}default:return null}}function yt(e){let t={...Ie};if(!e)return t;for(let n of ht){let o=chunk3R7QHNI5_js.e(e,"a",n);if(o){let r=chunk3R7QHNI5_js.i(o);if(r.length>0){let a=wt(r[0]);a&&(t[n]=a);}}}return t}function Ae(e){let t={latin:"",ea:"",cs:"",fonts:{}};if(!e)return t;let n=chunk3R7QHNI5_js.e(e,"a","latin");n&&(t.latin=chunk3R7QHNI5_js.j(n,"a","typeface")??chunk3R7QHNI5_js.j(n,null,"typeface")??"");let o=chunk3R7QHNI5_js.e(e,"a","ea");o&&(t.ea=chunk3R7QHNI5_js.j(o,"a","typeface")??chunk3R7QHNI5_js.j(o,null,"typeface")??"");let r=chunk3R7QHNI5_js.e(e,"a","cs");r&&(t.cs=chunk3R7QHNI5_js.j(r,"a","typeface")??chunk3R7QHNI5_js.j(r,null,"typeface")??"");let a=chunk3R7QHNI5_js.f(e,"a","font");for(let u of a){let l=chunk3R7QHNI5_js.j(u,"a","script")??chunk3R7QHNI5_js.j(u,null,"script"),f=chunk3R7QHNI5_js.j(u,"a","typeface")??chunk3R7QHNI5_js.j(u,null,"typeface");l&&f&&(t.fonts=t.fonts||{},t.fonts[l]=f);}return t}function bt(e){let t={...J};if(!e)return t;let n=chunk3R7QHNI5_js.e(e,"a","majorFont");n&&(t.majorFont=Ae(n));let o=chunk3R7QHNI5_js.e(e,"a","minorFont");return o&&(t.minorFont=Ae(o)),t}function Xn(e){if(!e)return {...ge};try{let t=chunk3R7QHNI5_js.c(e);if(!t)return {...ge};let n=chunk3R7QHNI5_js.j(t,"a","name")??chunk3R7QHNI5_js.j(t,null,"name")??"Office Theme",o=chunk3R7QHNI5_js.e(t,"a","themeElements"),r=chunk3R7QHNI5_js.e(o,"a","clrScheme"),a=yt(r),u=chunk3R7QHNI5_js.e(o,"a","fontScheme"),l=bt(u);return {name:n,colorScheme:a,fontScheme:l}}catch(t){return console.warn("Failed to parse theme:",t),{...ge}}}function Tt(e,t="latin"){if(!e?.fontScheme?.majorFont)return J.majorFont?.latin??"Calibri Light";let n=e.fontScheme.majorFont;return t==="latin"?n.latin||"Calibri Light":t==="ea"?n.ea||"":t==="cs"?n.cs||"":n.fonts?.[t]?n.fonts[t]:n.latin||"Calibri Light"}function He(e,t="latin"){if(!e?.fontScheme?.minorFont)return J.minorFont?.latin??"Calibri";let n=e.fontScheme.minorFont;return t==="latin"?n.latin||"Calibri":t==="ea"?n.ea||"":t==="cs"?n.cs||"":n.fonts?.[t]?n.fonts[t]:n.latin||"Calibri"}function $(e,t){if(!t)return "Calibri";let n=t.toLowerCase().includes("major"),o=t.toLowerCase().includes("minor"),r="latin",a=t.toLowerCase();return a.includes("eastasia")?r="ea":(a.includes("bidi")||a.includes("cs"))&&(r="cs"),n?Tt(e,r):o?He(e,r):He(e,"latin")}function Le(e){if(!e)return;let t=chunk3R7QHNI5_js.l(e,"w","w")??0,n=chunk3R7QHNI5_js.j(e,"w","type")??"dxa",o="dxa";return (n==="auto"||n==="dxa"||n==="nil"||n==="pct")&&(o=n),{value:t,type:o}}function O(e){return Le(e)}function V(e){let t=chunk3R7QHNI5_js.j(e,"w","id"),n=t?parseInt(t,10):0,o=(chunk3R7QHNI5_js.j(e,"w","author")??"").trim(),r=(chunk3R7QHNI5_js.j(e,"w","date")??"").trim();return {id:Number.isInteger(n)&&n>=0?n:0,author:o.length>0?o:"Unknown",date:r.length>0?r:void 0}}function ee(e){return V(e)}function W(e){if(!e)return;let o={style:chunk3R7QHNI5_js.j(e,"w","val")??"none"},r=chunk3R7QHNI5_js.l(e,"w","sz");r!==void 0&&(o.size=r);let a=chunk3R7QHNI5_js.l(e,"w","space");a!==void 0&&(o.space=a);let u=chunk3R7QHNI5_js.j(e,"w","color"),l=chunk3R7QHNI5_js.j(e,"w","themeColor"),f=chunk3R7QHNI5_js.j(e,"w","themeTint"),c=chunk3R7QHNI5_js.j(e,"w","themeShade");(u||l||f||c)&&(o.color={rgb:u??void 0,themeColor:l,themeTint:f??void 0,themeShade:c??void 0});let p=chunk3R7QHNI5_js.j(e,"w","shadow");(p==="1"||p==="true")&&(o.shadow=true);let d=chunk3R7QHNI5_js.j(e,"w","frame");return (d==="1"||d==="true")&&(o.frame=true),o}function te(e){if(!e)return;let t={},n=W(chunk3R7QHNI5_js.e(e,"w","top"));n&&(t.top=n);let o=W(chunk3R7QHNI5_js.e(e,"w","bottom"));o&&(t.bottom=o);let r=W(chunk3R7QHNI5_js.e(e,"w","left")??chunk3R7QHNI5_js.e(e,"w","start"));r&&(t.left=r);let a=W(chunk3R7QHNI5_js.e(e,"w","right")??chunk3R7QHNI5_js.e(e,"w","end"));a&&(t.right=a);let u=W(chunk3R7QHNI5_js.e(e,"w","insideH"));u&&(t.insideH=u);let l=W(chunk3R7QHNI5_js.e(e,"w","insideV"));if(l&&(t.insideV=l),Object.keys(t).length!==0)return t}function ne(e){if(!e)return;let t={},n=O(chunk3R7QHNI5_js.e(e,"w","top"));n&&(t.top=n);let o=O(chunk3R7QHNI5_js.e(e,"w","bottom"));o&&(t.bottom=o);let r=O(chunk3R7QHNI5_js.e(e,"w","left")??chunk3R7QHNI5_js.e(e,"w","start"));r&&(t.left=r);let a=O(chunk3R7QHNI5_js.e(e,"w","right")??chunk3R7QHNI5_js.e(e,"w","end"));if(a&&(t.right=a),Object.keys(t).length!==0)return t}function oe(e){if(!e)return;let t={},n=chunk3R7QHNI5_js.j(e,"w","fill");n&&n!=="auto"&&(t.fill={rgb:n});let o=chunk3R7QHNI5_js.j(e,"w","themeFill");if(o){t.fill={themeColor:o};let u=chunk3R7QHNI5_js.j(e,"w","themeFillTint");u&&t.fill&&(t.fill.themeTint=u);let l=chunk3R7QHNI5_js.j(e,"w","themeFillShade");l&&t.fill&&(t.fill.themeShade=l);}let r=chunk3R7QHNI5_js.j(e,"w","color");r&&r!=="auto"&&(t.color={rgb:r});let a=chunk3R7QHNI5_js.j(e,"w","val");if(a&&(t.pattern=a),Object.keys(t).length!==0)return t}function he(e){if(!e)return;let t={},n=chunk3R7QHNI5_js.j(e,"w","firstRow");(n==="1"||n==="true")&&(t.firstRow=true);let o=chunk3R7QHNI5_js.j(e,"w","lastRow");(o==="1"||o==="true")&&(t.lastRow=true);let r=chunk3R7QHNI5_js.j(e,"w","firstColumn");(r==="1"||r==="true")&&(t.firstColumn=true);let a=chunk3R7QHNI5_js.j(e,"w","lastColumn");(a==="1"||a==="true")&&(t.lastColumn=true);let u=chunk3R7QHNI5_js.j(e,"w","noHBand");(u==="1"||u==="true")&&(t.noHBand=true);let l=chunk3R7QHNI5_js.j(e,"w","noVBand");(l==="1"||l==="true")&&(t.noVBand=true);let f=chunk3R7QHNI5_js.j(e,"w","val");if(f){let c=parseInt(f,16);isNaN(c)||(c&32&&(t.firstRow=true),c&64&&(t.lastRow=true),c&128&&(t.firstColumn=true),c&256&&(t.lastColumn=true),c&512&&(t.noHBand=true),c&1024&&(t.noVBand=true));}if(Object.keys(t).length!==0)return t}function we(e){if(!e)return;let t={},n=chunk3R7QHNI5_js.j(e,"w","horzAnchor");(n==="margin"||n==="page"||n==="text")&&(t.horzAnchor=n);let o=chunk3R7QHNI5_js.j(e,"w","vertAnchor");(o==="margin"||o==="page"||o==="text")&&(t.vertAnchor=o);let r=chunk3R7QHNI5_js.l(e,"w","tblpX");r!==void 0&&(t.tblpX=r);let a=chunk3R7QHNI5_js.j(e,"w","tblpXSpec");a&&(t.tblpXSpec=a);let u=chunk3R7QHNI5_js.l(e,"w","tblpY");u!==void 0&&(t.tblpY=u);let l=chunk3R7QHNI5_js.j(e,"w","tblpYSpec");l&&(t.tblpYSpec=l);let f=chunk3R7QHNI5_js.l(e,"w","topFromText");f!==void 0&&(t.topFromText=f);let c=chunk3R7QHNI5_js.l(e,"w","bottomFromText");c!==void 0&&(t.bottomFromText=c);let p=chunk3R7QHNI5_js.l(e,"w","leftFromText");p!==void 0&&(t.leftFromText=p);let d=chunk3R7QHNI5_js.l(e,"w","rightFromText");if(d!==void 0&&(t.rightFromText=d),Object.keys(t).length!==0)return t}function Ct(e){return e.columnWidths&&e.columnWidths.length>0?e.columnWidths.length:e.rows.length===0?0:e.rows[0].cells.reduce((t,n)=>t+(n.formatting?.gridSpan??1),0)}function Ft(e){return e.rows.length}function xt(e){return e.formatting?.vMerge==="continue"}function kt(e){return e.formatting?.vMerge==="restart"}function St(e){return e.rows.length===0?false:e.rows[0].formatting?.header===true}var Mt={richText:"richText",text:"plainText",date:"date",dropDownList:"dropDownList",comboBox:"comboBox",picture:"picture",docPartObj:"buildingBlockGallery",docPartList:"buildingBlockGallery",group:"group",equation:"equation",citation:"citation",bibliography:"bibliography",checkbox:"checkbox"};function Rt(e){if(!e||!e.elements)return "richText";for(let t of e.elements){if(t.type!=="element"||!t.name)continue;let n=chunk3R7QHNI5_js.d(t.name),o=Mt[n];if(o)return o}return "richText"}function Et(e){let t=[];for(let n of e.elements??[])n.type==="element"&&chunk3R7QHNI5_js.d(n.name||"")==="listItem"&&t.push({displayText:chunk3R7QHNI5_js.j(n,"w","displayText")||"",value:chunk3R7QHNI5_js.j(n,"w","value")||""});return t}function re(e,t){let n={sdtType:Rt(e)};if(e){n.rawPropertiesXml=chunk3R7QHNI5_js.b(e);for(let o of e.elements??[]){if(o.type!=="element"||!o.name)continue;switch(chunk3R7QHNI5_js.d(o.name)){case "id":{let a=chunk3R7QHNI5_js.j(o,"w","val");if(a!=null){let u=parseInt(a,10);Number.isNaN(u)||(n.id=u);}break}case "alias":n.alias=chunk3R7QHNI5_js.j(o,"w","val")??void 0;break;case "tag":n.tag=chunk3R7QHNI5_js.j(o,"w","val")??void 0;break;case "lock":n.lock=chunk3R7QHNI5_js.j(o,"w","val")??"unlocked";break;case "placeholder":{let a=chunk3R7QHNI5_js.e(o,"w","docPart");a&&(n.placeholder=chunk3R7QHNI5_js.j(a,"w","val")??void 0);break}case "showingPlcHdr":{let a=chunk3R7QHNI5_js.j(o,"w","val");n.showingPlaceholder=a==null||!/^(0|false|off)$/i.test(a);break}case "date":{let a=chunk3R7QHNI5_js.e(o,"w","dateFormat");a&&(n.dateFormat=chunk3R7QHNI5_js.j(a,"w","val")??void 0);break}case "dropDownList":case "comboBox":n.listItems=Et(o);break;case "checkbox":{let a=chunk3R7QHNI5_js.e(o,"w14","checked")??chunk3R7QHNI5_js.e(o,"w","checked");n.checked=a?chunk3R7QHNI5_js.j(a,"w14","val")==="1"||chunk3R7QHNI5_js.j(a,"w","val")==="1":false;break}case "dataBinding":{let a={},u=chunk3R7QHNI5_js.j(o,"w","xpath"),l=chunk3R7QHNI5_js.j(o,"w","storeItemID"),f=chunk3R7QHNI5_js.j(o,"w","prefixMappings");u!=null&&(a.xpath=u),l!=null&&(a.storeItemID=l),f!=null&&(a.prefixMappings=f),n.dataBinding=a;break}}}}return t&&(n.rawEndPropertiesXml=chunk3R7QHNI5_js.b(t)),n}var Xe={183:"\u2022",111:"\u25CB",167:"\u25A0",252:"\u2713",110:"\u25A0",113:"\u25CB",117:"\u25C6",118:"\u2756",168:"\u2713",251:"\u2713",254:"\u2713",61623:"\u2022",61550:"\u25A0",61551:"\u25CB",61607:"\u25A0",61692:"\u2713",8226:"\u2022",9679:"\u25CF",9675:"\u25CB",9632:"\u25A0",9633:"\u25A1",9670:"\u25C6",9671:"\u25C7",8211:"\u2013",8212:"\u2014",62:">",45:"-"};function Pt(e){if(!e||e.trim()==="")return "\u2022";let t=e.charCodeAt(0);return Xe[t]?Xe[t]:t>=57344&&t<=63743||t<32||t>=127&&t<160?"\u2022":e}function Bt(e){let t=e.listRendering;t&&t.isBullet&&(t.marker=Pt(t.marker||""));}function vt(e,t,n,o,r,a,u){if(e.content.length===0)return;let l=chunk3R7QHNI5_js.i(t),f=0;function c(p){if(!chunkO2643IUW_js.h(p))return;let d=chunkO2643IUW_js.j(p);if(!d)return;let y=chunk3R7QHNI5_js.n(p,"wps","wsp");if(y){let w=chunkO2643IUW_js.k(y);w&&(d.content=chunkO2643IUW_js.g(w,Y,null,n,o,r,a??void 0,u??void 0));}let F={type:"shape",shapeType:"rect",size:d.size,position:d.position,wrap:d.wrap,fill:d.fill,outline:d.outline,textBody:{content:d.content,margins:d.margins}};d.id&&(F.id=d.id);let h={type:"shape",shape:F},C=f;if(C>=e.content.length){C=-1;for(let w=e.content.length-1;w>=0;w--)if(e.content[w].type==="run"){C=w;break}}if(C>=0){let w=e.content[C];w.type==="run"&&w.content.push(h);}}for(let p of l){if(chunk3R7QHNI5_js.d(p.name??"")!=="r")continue;let d=chunk3R7QHNI5_js.i(p);for(let y of d){let F=chunk3R7QHNI5_js.d(y.name??"");if(F==="drawing")c(y);else if(F==="AlternateContent"){let h=chunk3R7QHNI5_js.i(y),w=h.find(P=>chunk3R7QHNI5_js.d(P.name??"")==="Choice")??h.find(P=>chunk3R7QHNI5_js.d(P.name??"")==="Fallback");if(w)for(let P of chunk3R7QHNI5_js.i(w))chunk3R7QHNI5_js.d(P.name??"")==="drawing"&&c(P);}}f++;}}function q(e,t,n,o,r,a,u){let l=[],f=chunk3R7QHNI5_js.i(e);for(let c of f){let p=c.name??"";if(p==="w:p"||p.endsWith(":p")){let d=Y(c,t,n,o,r,a,u);vt(d,c,t,n,o,r,a),Bt(d),l.push(d);}else if(p==="w:tbl"||p.endsWith(":tbl")){let d=ye(c,t,n,o,r,a,u);l.push(d);}else (p==="w:sdt"||p.endsWith(":sdt"))&&l.push(Nt(c,t,n,o,r,a,u));}return l}function Nt(e,t,n,o,r,a,u){let l=chunk3R7QHNI5_js.e(e,"w","sdtPr"),f=chunk3R7QHNI5_js.e(e,"w","sdtEndPr"),c=chunk3R7QHNI5_js.e(e,"w","sdtContent"),p=re(l,f),d=c?q(c,t,n,o,r,a,u):[];return {type:"blockSdt",properties:p,content:d}}function Oe(e){let t={};if(!e)return t;for(let n of e.split(";")){let o=n.indexOf(":");if(o<0)continue;let r=n.slice(0,o).trim().toLowerCase(),a=n.slice(o+1).trim();r&&(t[r]=a);}return t}function At(e){if(!e)return "#C0C0C0";let t=e.trim();return t.startsWith("#")?t:/^[0-9a-fA-F]{6}$/.test(t)?`#${t}`:t}function De(e){if(!e)return;let t=e.match(/^(-?[0-9.]+)(pt|px|in|cm|mm)?$/);if(!t)return;let n=parseFloat(t[1]);if(!isNaN(n))switch(t[2]){case "in":return n*96;case "cm":return n/2.54*96;case "mm":return n/25.4*96;case "px":return n;default:return n*96/72}}var We=914400/96;function Ht(e,t,n){if(!e||!t)return {};let o=t.get(e);if(!o?.target)return {};let r=o.target,a=r.split("/").pop()??r,u=[r,r.replace(/^\/+/,""),`word/${r.replace(/^\/+/,"")}`,`word/media/${a}`,`media/${a}`];if(n)for(let l of u){let f=l.toLowerCase();for(let[c,p]of n.entries())if(c.toLowerCase()===f)return {dataUrl:p.dataUrl??p.base64,mediaPath:p.path,contentType:p.mimeType}}return {}}function It(e,t){return !!(t.includes("watermark")||(chunk3R7QHNI5_js.j(e,null,"type")??"").includes("_t136"))}function Ve(e,t=null,n=null){if(!e)return;let o=chunk3R7QHNI5_js.o(e,"v","shape");for(let r of o){let a=(chunk3R7QHNI5_js.j(r,null,"id")??"").toLowerCase(),u=chunk3R7QHNI5_js.i(r),l=u.find(y=>y.name==="v:textpath"||y.name?.endsWith(":textpath")),f=u.find(y=>y.name==="v:imagedata"||y.name?.endsWith(":imagedata"));if(!It(r,a)&&!l&&!f)continue;let c=Oe(chunk3R7QHNI5_js.j(r,null,"style")),p=parseFloat(c.rotation??"0")||0,d=Math.abs(p)>5;if(l){let y=chunk3R7QHNI5_js.j(l,null,"string")??"",C=(Oe(chunk3R7QHNI5_js.j(l,null,"style"))["font-family"]??"Calibri").replace(/["']/g,"").replace(/^"|"$/g,"").trim()||"Calibri",w=u.find(M=>M.name==="v:fill"||M.name?.endsWith(":fill")),P=w?chunk3R7QHNI5_js.j(w,null,"opacity"):null,x=P!=null&&parseFloat(P)<1;return {kind:"text",text:y,font:C,color:At(chunk3R7QHNI5_js.j(r,null,"fillcolor")),semitransparent:x,layout:d?"diagonal":"horizontal",fontSize:void 0}}if(f){let y=chunk3R7QHNI5_js.j(f,"r","id")??chunk3R7QHNI5_js.j(f,"r","embed")??chunk3R7QHNI5_js.j(f,null,"id")??"",{dataUrl:F,mediaPath:h,contentType:C}=Ht(y,t,n),w=chunk3R7QHNI5_js.j(f,null,"gain"),P=chunk3R7QHNI5_js.j(f,null,"blacklevel"),x=w!=null||P!=null,M=De(c.width),m=De(c.height);return {kind:"picture",relId:y||void 0,mediaPath:h,contentType:C,dataUrl:F,scale:1,washout:x,widthEmu:M!=null?Math.round(M*We):void 0,heightEmu:m!=null?Math.round(m*We):void 0}}}}function je(e){switch(e){case "first":return "first";case "even":return "even";default:return "default"}}function Ue(e){let t=chunk3R7QHNI5_js.j(e,"w","type"),n=chunk3R7QHNI5_js.j(e,"r","id")??"";return {type:je(t),rId:n}}function ze(e){let t=chunk3R7QHNI5_js.j(e,"w","type"),n=chunk3R7QHNI5_js.j(e,"r","id")??"";return {type:je(t),rId:n}}function to(e,t="default",n=null,o=null,r=null,a=null,u=null){let l={type:"header",hdrFtrType:t,content:[]};if(!e)return l;let f=chunk3R7QHNI5_js.a(e);if(!f)return l;let c=f.elements?.find(d=>d.type==="element"&&(d.name==="w:hdr"||d.name?.endsWith(":hdr")));if(!c)return l;l.content=q(c,n,o,r,a,u,{inHeaderFooter:true});let p=Ve(c,a,u);return p&&(l.watermark=p),l}function no(e,t="default",n=null,o=null,r=null,a=null,u=null){let l={type:"footer",hdrFtrType:t,content:[]};if(!e)return l;let f=chunk3R7QHNI5_js.a(e);if(!f)return l;let c=f.elements?.find(p=>p.type==="element"&&(p.name==="w:ftr"||p.name?.endsWith(":ftr")));return c&&(l.content=q(c,n,o,r,a,u,{inHeaderFooter:true})),l}function _e(e){switch(e){case "separator":return "separator";case "continuationSeparator":return "continuationSeparator";case "continuationNotice":return "continuationNotice";default:return "normal"}}function qe(e,t,n,o,r,a){let u=q(e,t,n,o,r,a),l=false;for(let f of chunk3R7QHNI5_js.i(e)){let c=f.name??"";if(c==="w:bookmarkStart"||c.endsWith(":bookmarkStart")||c==="w:bookmarkEnd"||c.endsWith(":bookmarkEnd")||c==="w:customXml"||c.endsWith(":customXml")){l=true;break}}return {blocks:u,hasUnmodeled:l}}function Lt(e,t,n,o,r,a){let u=chunk3R7QHNI5_js.l(e,"w","id")??0,l=chunk3R7QHNI5_js.j(e,"w","type"),f=_e(l),{blocks:c,hasUnmodeled:p}=qe(e,t,n,o,r,a);return {type:"footnote",id:u,noteType:f,content:c,...p?{verbatimXml:chunk3R7QHNI5_js.b(e)}:{}}}function ao(e,t=null,n=null,o=null,r=null,a=null){let u=new Map,l=[];if(!e)return ie(u,l);let f=chunk3R7QHNI5_js.a(e);if(!f)return ie(u,l);let c=f.elements?.find(d=>d.type==="element"&&(d.name==="w:footnotes"||d.name?.endsWith(":footnotes")));if(!c)return ie(u,l);let p=chunk3R7QHNI5_js.f(c,"w","footnote");for(let d of p){let y=Lt(d,t,n,o,r,a);u.set(y.id,y),l.push(y);}return ie(u,l)}function ie(e,t){return {byId:e,footnotes:t,getFootnote(n){return e.get(n)},hasFootnote(n){return e.has(n)},getNormalFootnotes(){return t.filter(n=>n.noteType==="normal")},getSeparator(){return t.find(n=>n.noteType==="separator")},getContinuationSeparator(){return t.find(n=>n.noteType==="continuationSeparator")}}}function Xt(e,t,n,o,r,a){let u=chunk3R7QHNI5_js.l(e,"w","id")??0,l=chunk3R7QHNI5_js.j(e,"w","type"),f=_e(l),{blocks:c,hasUnmodeled:p}=qe(e,t,n,o,r,a);return {type:"endnote",id:u,noteType:f,content:c,...p?{verbatimXml:chunk3R7QHNI5_js.b(e)}:{}}}function lo(e,t=null,n=null,o=null,r=null,a=null){let u=new Map,l=[];if(!e)return ae(u,l);let f=chunk3R7QHNI5_js.a(e);if(!f)return ae(u,l);let c=f.elements?.find(d=>d.type==="element"&&(d.name==="w:endnotes"||d.name?.endsWith(":endnotes")));if(!c)return ae(u,l);let p=chunk3R7QHNI5_js.f(c,"w","endnote");for(let d of p){let y=Xt(d,t,n,o,r,a);u.set(y.id,y),l.push(y);}return ae(u,l)}function ae(e,t){return {byId:e,endnotes:t,getEndnote(n){return e.get(n)},hasEndnote(n){return e.has(n)},getNormalEndnotes(){return t.filter(n=>n.noteType==="normal")},getSeparator(){return t.find(n=>n.noteType==="separator")},getContinuationSeparator(){return t.find(n=>n.noteType==="continuationSeparator")}}}function Ge(e){return e?{decimal:"decimal",upperRoman:"upperRoman",lowerRoman:"lowerRoman",upperLetter:"upperLetter",lowerLetter:"lowerLetter",ordinal:"ordinal",cardinalText:"cardinalText",ordinalText:"ordinalText",bullet:"bullet",chicago:"chicago",none:"none"}[e]:void 0}function Ot(e){switch(e){case "pageBottom":return "pageBottom";case "beneathText":return "beneathText";case "sectEnd":return "sectEnd";case "docEnd":return "docEnd";default:return}}function Dt(e){switch(e){case "sectEnd":return "sectEnd";case "docEnd":return "docEnd";default:return}}function $e(e){switch(e){case "continuous":return "continuous";case "eachSect":return "eachSect";case "eachPage":return "eachPage";default:return}}function Ye(e){let t={};if(!e)return t;let n=chunk3R7QHNI5_js.e(e,"w","pos");if(n){let u=chunk3R7QHNI5_js.j(n,"w","val");t.position=Ot(u);}let o=chunk3R7QHNI5_js.e(e,"w","numFmt");if(o){let u=chunk3R7QHNI5_js.j(o,"w","val");t.numFmt=Ge(u);}let r=chunk3R7QHNI5_js.e(e,"w","numStart");r&&(t.numStart=chunk3R7QHNI5_js.l(r,"w","val")??void 0);let a=chunk3R7QHNI5_js.e(e,"w","numRestart");if(a){let u=chunk3R7QHNI5_js.j(a,"w","val");t.numRestart=$e(u);}return t}function Ke(e){let t={};if(!e)return t;let n=chunk3R7QHNI5_js.e(e,"w","pos");if(n){let u=chunk3R7QHNI5_js.j(n,"w","val");t.position=Dt(u);}let o=chunk3R7QHNI5_js.e(e,"w","numFmt");if(o){let u=chunk3R7QHNI5_js.j(o,"w","val");t.numFmt=Ge(u);}let r=chunk3R7QHNI5_js.e(e,"w","numStart");r&&(t.numStart=chunk3R7QHNI5_js.l(r,"w","val")??void 0);let a=chunk3R7QHNI5_js.e(e,"w","numRestart");if(a){let u=chunk3R7QHNI5_js.j(a,"w","val");t.numRestart=$e(u);}return t}function so(e){let t=[];for(let n of e.content){if(n.type!=="paragraph")continue;let o=[];for(let r of n.content)if(r.type==="run")for(let a of r.content)a.type==="text"&&o.push(a.text);t.push(o.join(""));}return t.join(`
|
|
2
|
+
`)}function uo(e){let t=[];for(let n of e.content){if(n.type!=="paragraph")continue;let o=[];for(let r of n.content)if(r.type==="run")for(let a of r.content)a.type==="text"&&o.push(a.text);t.push(o.join(""));}return t.join(`
|
|
3
|
+
`)}function fo(e){return e.noteType==="separator"||e.noteType==="continuationSeparator"||e.noteType==="continuationNotice"}function co(e){return e.noteType==="separator"||e.noteType==="continuationSeparator"||e.noteType==="continuationNotice"}function Wt(e,t,n,o){if(!e&&!t)return;let r={};return e&&e!=="auto"?r.rgb=e:e==="auto"&&(r.auto=true),t&&(r.themeColor=t),n&&(r.themeTint=n),o&&(r.themeShade=o),Object.keys(r).length>0?r:void 0}function le(e){if(!e)return;let o={style:chunk3R7QHNI5_js.j(e,"w","val")??"none"},r=chunk3R7QHNI5_js.l(e,"w","sz");r!==void 0&&(o.size=r);let a=chunk3R7QHNI5_js.l(e,"w","space");a!==void 0&&(o.space=a);let u=chunk3R7QHNI5_js.j(e,"w","color"),l=chunk3R7QHNI5_js.j(e,"w","themeColor"),f=chunk3R7QHNI5_js.j(e,"w","themeTint"),c=chunk3R7QHNI5_js.j(e,"w","themeShade"),p=Wt(u,l,f,c);p&&(o.color=p);let d=chunk3R7QHNI5_js.j(e,"w","shadow");(d==="1"||d==="true")&&(o.shadow=true);let y=chunk3R7QHNI5_js.j(e,"w","frame");return (y==="1"||y==="true")&&(o.frame=true),o}function Vt(e){switch(e){case "landscape":return "landscape";case "portrait":return "portrait";default:return}}function jt(e){switch(e){case "continuous":return "continuous";case "nextPage":return "nextPage";case "oddPage":return "oddPage";case "evenPage":return "evenPage";case "nextColumn":return "nextColumn";default:return}}function Ut(e){switch(e){case "top":return "top";case "center":return "center";case "both":return "both";case "bottom":return "bottom";default:return}}function zt(e){switch(e){case "continuous":return "continuous";case "newPage":return "newPage";case "newSection":return "newSection";default:return}}function Qe(e,t){let n={};if(!e)return n;let o=chunk3R7QHNI5_js.e(e,"w","pgSz");if(o){let m=chunk3R7QHNI5_js.l(o,"w","w");m!==void 0&&(n.pageWidth=m);let T=chunk3R7QHNI5_js.l(o,"w","h");T!==void 0&&(n.pageHeight=T);let E=chunk3R7QHNI5_js.j(o,"w","orient"),b=Vt(E);b&&(n.orientation=b);}let r=chunk3R7QHNI5_js.e(e,"w","pgMar");if(r){let m=chunk3R7QHNI5_js.l(r,"w","top");m!==void 0&&(n.marginTop=m);let T=chunk3R7QHNI5_js.l(r,"w","bottom");T!==void 0&&(n.marginBottom=T);let E=chunk3R7QHNI5_js.l(r,"w","left");E!==void 0&&(n.marginLeft=E);let b=chunk3R7QHNI5_js.l(r,"w","right");b!==void 0&&(n.marginRight=b);let k=chunk3R7QHNI5_js.l(r,"w","header");k!==void 0&&(n.headerDistance=k);let B=chunk3R7QHNI5_js.l(r,"w","footer");B!==void 0&&(n.footerDistance=B);let v=chunk3R7QHNI5_js.l(r,"w","gutter");v!==void 0&&(n.gutter=v);}let a=chunk3R7QHNI5_js.e(e,"w","cols");if(a){let m=chunk3R7QHNI5_js.l(a,"w","num");m!==void 0&&(n.columnCount=m);let T=chunk3R7QHNI5_js.l(a,"w","space");T!==void 0&&(n.columnSpace=T);let E=chunk3R7QHNI5_js.j(a,"w","equalWidth");E==="1"||E==="true"?n.equalWidth=true:(E==="0"||E==="false")&&(n.equalWidth=false);let b=chunk3R7QHNI5_js.j(a,"w","sep");(b==="1"||b==="true")&&(n.separator=true);let k=chunk3R7QHNI5_js.f(a,"w","col");if(k.length>0){n.columns=[];for(let B of k){let v={},I=chunk3R7QHNI5_js.l(B,"w","w");I!==void 0&&(v.width=I);let H=chunk3R7QHNI5_js.l(B,"w","space");H!==void 0&&(v.space=H),n.columns.push(v);}n.columnCount===void 0&&(n.columnCount=k.length);}}let u=chunk3R7QHNI5_js.e(e,"w","type");if(u){let m=chunk3R7QHNI5_js.j(u,"w","val"),T=jt(m);T&&(n.sectionStart=T);}let l=chunk3R7QHNI5_js.e(e,"w","vAlign");if(l){let m=chunk3R7QHNI5_js.j(l,"w","val"),T=Ut(m);T&&(n.verticalAlign=T);}let f=chunk3R7QHNI5_js.e(e,"w","bidi");f&&(n.bidi=chunk3R7QHNI5_js.m(f));let c=chunk3R7QHNI5_js.f(e,"w","headerReference");c.length>0&&(n.headerReferences=c.map(m=>Ue(m)));let p=chunk3R7QHNI5_js.f(e,"w","footerReference");p.length>0&&(n.footerReferences=p.map(m=>ze(m)));let d=chunk3R7QHNI5_js.e(e,"w","titlePg");d&&(n.titlePg=chunk3R7QHNI5_js.m(d));let y=chunk3R7QHNI5_js.e(e,"w","evenAndOddHeaders");y&&(n.evenAndOddHeaders=chunk3R7QHNI5_js.m(y));let F=chunk3R7QHNI5_js.e(e,"w","lnNumType");if(F){n.lineNumbers={};let m=chunk3R7QHNI5_js.l(F,"w","start");m!==void 0&&(n.lineNumbers.start=m);let T=chunk3R7QHNI5_js.l(F,"w","countBy");T!==void 0&&(n.lineNumbers.countBy=T);let E=chunk3R7QHNI5_js.l(F,"w","distance");E!==void 0&&(n.lineNumbers.distance=E);let b=chunk3R7QHNI5_js.j(F,"w","restart"),k=zt(b);k&&(n.lineNumbers.restart=k);}let h=chunk3R7QHNI5_js.e(e,"w","pgBorders");if(h){n.pageBorders={};let m=le(chunk3R7QHNI5_js.e(h,"w","top"));m&&(n.pageBorders.top=m);let T=le(chunk3R7QHNI5_js.e(h,"w","bottom"));T&&(n.pageBorders.bottom=T);let E=le(chunk3R7QHNI5_js.e(h,"w","left"));E&&(n.pageBorders.left=E);let b=le(chunk3R7QHNI5_js.e(h,"w","right"));b&&(n.pageBorders.right=b);let k=chunk3R7QHNI5_js.j(h,"w","display");(k==="allPages"||k==="firstPage"||k==="notFirstPage")&&(n.pageBorders.display=k);let B=chunk3R7QHNI5_js.j(h,"w","offsetFrom");(B==="page"||B==="text")&&(n.pageBorders.offsetFrom=B);let v=chunk3R7QHNI5_js.j(h,"w","zOrder");(v==="front"||v==="back")&&(n.pageBorders.zOrder=v);}let C=chunk3R7QHNI5_js.e(e,"w","background");if(C){n.background={};let m=chunk3R7QHNI5_js.j(C,"w","color");m&&m!=="auto"&&(n.background.color={rgb:m});let T=chunk3R7QHNI5_js.j(C,"w","themeColor");T&&(n.background.themeColor=T);let E=chunk3R7QHNI5_js.j(C,"w","themeTint");E&&(n.background.themeTint=E);let b=chunk3R7QHNI5_js.j(C,"w","themeShade");b&&(n.background.themeShade=b);}let w=chunk3R7QHNI5_js.e(e,"w","footnotePr");if(w){let m=Ye(w);Object.keys(m).length>0&&(n.footnotePr=m);}let P=chunk3R7QHNI5_js.e(e,"w","endnotePr");if(P){let m=Ke(P);Object.keys(m).length>0&&(n.endnotePr=m);}let x=chunk3R7QHNI5_js.e(e,"w","docGrid");if(x){n.docGrid={};let m=chunk3R7QHNI5_js.j(x,"w","type");(m==="default"||m==="lines"||m==="linesAndChars"||m==="snapToChars")&&(n.docGrid.type=m);let T=chunk3R7QHNI5_js.l(x,"w","linePitch");T!==void 0&&(n.docGrid.linePitch=T);let E=chunk3R7QHNI5_js.l(x,"w","charSpace");E!==void 0&&(n.docGrid.charSpace=E);}let M=chunk3R7QHNI5_js.e(e,"w","paperSrc");if(M){let m=chunk3R7QHNI5_js.l(M,"w","first");m!==void 0&&(n.paperSrcFirst=m);let T=chunk3R7QHNI5_js.l(M,"w","other");T!==void 0&&(n.paperSrcOther=T);}return n}function wo(){return {pageWidth:12240,pageHeight:15840,orientation:"portrait",marginTop:1440,marginBottom:1440,marginLeft:1440,marginRight:1440,headerDistance:720,footerDistance:720,gutter:0,columnCount:1,columnSpace:720,equalWidth:true,sectionStart:"nextPage",verticalAlign:"top"}}function Ze(e,t){if(!t||t.length===0)return e;let n=new Set((e??[]).map(r=>r.type)),o=t.filter(r=>!n.has(r.type));return o.length===0?e:[...e??[],...o]}function yo(e){if(e.length<2)return e;let t=[e[0]];for(let n=1;n<e.length;n++){let o=t[n-1].properties,r=e[n].properties,a=Ze(r.headerReferences,o.headerReferences),u=Ze(r.footerReferences,o.footerReferences),l=r.titlePg!==void 0?r.titlePg:o.titlePg;if(a===r.headerReferences&&u===r.footerReferences&&l===r.titlePg){t.push(e[n]);continue}t.push({...e[n],properties:{...r,headerReferences:a,footerReferences:u,titlePg:l}});}return t}function _t(e,t){return !e&&!t?true:!(!e||!t||e.bold!==t.bold||e.boldCs!==t.boldCs||e.italic!==t.italic||e.italicCs!==t.italicCs||e.strike!==t.strike||e.doubleStrike!==t.doubleStrike||e.smallCaps!==t.smallCaps||e.allCaps!==t.allCaps||e.hidden!==t.hidden||e.emboss!==t.emboss||e.imprint!==t.imprint||e.outline!==t.outline||e.shadow!==t.shadow||e.rtl!==t.rtl||e.cs!==t.cs||e.fontSize!==t.fontSize||e.fontSizeCs!==t.fontSizeCs||e.spacing!==t.spacing||e.position!==t.position||e.scale!==t.scale||e.kerning!==t.kerning||e.vertAlign!==t.vertAlign||e.highlight!==t.highlight||e.effect!==t.effect||e.emphasisMark!==t.emphasisMark||e.styleId!==t.styleId||!qt(e.underline,t.underline)||!se(e.color,t.color)||!Gt(e.shading,t.shading)||!$t(e.fontFamily,t.fontFamily))}function qt(e,t){return !e&&!t?true:!e||!t||e.style!==t.style?false:se(e.color,t.color)}function se(e,t){return !e&&!t?true:!e||!t?false:e.rgb===t.rgb&&e.auto===t.auto&&e.themeColor===t.themeColor&&e.themeTint===t.themeTint&&e.themeShade===t.themeShade}function Gt(e,t){return !e&&!t?true:!(!e||!t||e.pattern!==t.pattern||!se(e.color,t.color)||!se(e.fill,t.fill))}function $t(e,t){return !e&&!t?true:!e||!t?false:e.ascii===t.ascii&&e.hAnsi===t.hAnsi&&e.eastAsia===t.eastAsia&&e.cs===t.cs&&e.asciiTheme===t.asciiTheme&&e.hAnsiTheme===t.hAnsiTheme&&e.eastAsiaTheme===t.eastAsiaTheme&&e.csTheme===t.csTheme}function Yt(e){return e.type==="text"||e.type==="softHyphen"||e.type==="noBreakHyphen"}function Je(e){return e.content.length===0?true:e.content.every(Yt)}function Kt(e,t){let n=[];for(let o of e)n.push(o);if(n.length>0&&t.length>0&&n[n.length-1].type==="text"&&t[0].type==="text"){let o=n[n.length-1],r=t[0];n[n.length-1]={type:"text",text:o.text+r.text,preserveSpace:o.preserveSpace||r.preserveSpace||void 0};for(let a=1;a<t.length;a++)n.push(t[a]);}else for(let o of t)n.push(o);return n}function Zt(e){if(e.length<=1)return e;let t=[],n=null;for(let o of e)if(o.content.length!==0){if(n===null){n={...o,content:[...o.content]};continue}Je(n)&&Je(o)&&_t(n.formatting,o.formatting)?n={type:"run",formatting:n.formatting,content:Kt(n.content,o.content)}:(t.push(n),n={...o,content:[...o.content]});}return n!==null&&t.push(n),t}function be(e){if(e.length<=1)return e;let t=[],n=[];function o(){if(n.length>0){let r=Zt(n);t.push(...r),n.length=0;}}for(let r of e)if(r.type==="run")n.push(r);else if(o(),r.type==="hyperlink"){let a={...r,children:be(r.children)};t.push(a);}else t.push(r);return o(),t}function et(e,t,n,o){let r={};return e&&e!=="auto"?r.rgb=e:e==="auto"&&(r.auto=true),t&&(r.themeColor=t),n&&(r.themeTint=n),o&&(r.themeShade=o),r}function Qt(e){if(!e)return;let t={},n=chunk3R7QHNI5_js.j(e,"w","color");n&&n!=="auto"&&(t.color={rgb:n});let o=chunk3R7QHNI5_js.j(e,"w","fill");o&&o!=="auto"&&(t.fill={rgb:o});let r=chunk3R7QHNI5_js.j(e,"w","themeFill");r&&(t.fill=t.fill||{},t.fill.themeColor=r);let a=chunk3R7QHNI5_js.j(e,"w","themeFillTint");a&&t.fill&&(t.fill.themeTint=a);let u=chunk3R7QHNI5_js.j(e,"w","themeFillShade");u&&t.fill&&(t.fill.themeShade=u);let l=chunk3R7QHNI5_js.j(e,"w","val");return l&&(t.pattern=l),Object.keys(t).length>0?t:void 0}function fe(e,t,n){if(!e)return;let o={},r=chunk3R7QHNI5_js.e(e,"w","b");r&&(o.bold=chunk3R7QHNI5_js.m(r));let a=chunk3R7QHNI5_js.e(e,"w","bCs");a&&(o.boldCs=chunk3R7QHNI5_js.m(a));let u=chunk3R7QHNI5_js.e(e,"w","i");u&&(o.italic=chunk3R7QHNI5_js.m(u));let l=chunk3R7QHNI5_js.e(e,"w","iCs");l&&(o.italicCs=chunk3R7QHNI5_js.m(l));let f=chunk3R7QHNI5_js.e(e,"w","u");if(f){let S=chunk3R7QHNI5_js.j(f,"w","val");if(S){o.underline={style:S};let U=chunk3R7QHNI5_js.j(f,"w","color"),z=chunk3R7QHNI5_js.j(f,"w","themeColor");(U||z)&&(o.underline.color=et(U,z,chunk3R7QHNI5_js.j(f,"w","themeTint"),chunk3R7QHNI5_js.j(f,"w","themeShade")));}}let c=chunk3R7QHNI5_js.e(e,"w","strike");c&&(o.strike=chunk3R7QHNI5_js.m(c));let p=chunk3R7QHNI5_js.e(e,"w","dstrike");p&&(o.doubleStrike=chunk3R7QHNI5_js.m(p));let d=chunk3R7QHNI5_js.e(e,"w","vertAlign");if(d){let S=chunk3R7QHNI5_js.j(d,"w","val");(S==="superscript"||S==="subscript"||S==="baseline")&&(o.vertAlign=S);}let y=chunk3R7QHNI5_js.e(e,"w","smallCaps");y&&(o.smallCaps=chunk3R7QHNI5_js.m(y));let F=chunk3R7QHNI5_js.e(e,"w","caps");F&&(o.allCaps=chunk3R7QHNI5_js.m(F));let h=chunk3R7QHNI5_js.e(e,"w","vanish");h&&(o.hidden=chunk3R7QHNI5_js.m(h));let C=chunk3R7QHNI5_js.e(e,"w","color");C&&(o.color=et(chunk3R7QHNI5_js.j(C,"w","val"),chunk3R7QHNI5_js.j(C,"w","themeColor"),chunk3R7QHNI5_js.j(C,"w","themeTint"),chunk3R7QHNI5_js.j(C,"w","themeShade")));let w=chunk3R7QHNI5_js.e(e,"w","highlight");if(w){let S=chunk3R7QHNI5_js.j(w,"w","val");S&&(o.highlight=S);}let P=chunk3R7QHNI5_js.e(e,"w","shd");P&&(o.shading=Qt(P));let x=chunk3R7QHNI5_js.e(e,"w","sz");if(x){let S=chunk3R7QHNI5_js.l(x,"w","val");S!==void 0&&(o.fontSize=S);}let M=chunk3R7QHNI5_js.e(e,"w","szCs");if(M){let S=chunk3R7QHNI5_js.l(M,"w","val");S!==void 0&&(o.fontSizeCs=S);}let m=chunk3R7QHNI5_js.e(e,"w","rFonts");if(m){o.fontFamily={ascii:chunk3R7QHNI5_js.j(m,"w","ascii")??void 0,hAnsi:chunk3R7QHNI5_js.j(m,"w","hAnsi")??void 0,eastAsia:chunk3R7QHNI5_js.j(m,"w","eastAsia")??void 0,cs:chunk3R7QHNI5_js.j(m,"w","cs")??void 0};let S=chunk3R7QHNI5_js.j(m,"w","asciiTheme");S&&(o.fontFamily.asciiTheme=S,t&&!o.fontFamily.ascii&&(o.fontFamily.ascii=$(t,S)));let U=chunk3R7QHNI5_js.j(m,"w","hAnsiTheme");U&&(o.fontFamily.hAnsiTheme=U,t&&!o.fontFamily.hAnsi&&(o.fontFamily.hAnsi=$(t,U)));let z=chunk3R7QHNI5_js.j(m,"w","eastAsiaTheme");z&&(o.fontFamily.eastAsiaTheme=z,t&&!o.fontFamily.eastAsia&&(o.fontFamily.eastAsia=$(t,z)));let pe=chunk3R7QHNI5_js.j(m,"w","cstheme");pe&&(o.fontFamily.csTheme=pe,t&&!o.fontFamily.cs&&(o.fontFamily.cs=$(t,pe)));}let T=chunk3R7QHNI5_js.e(e,"w","spacing");if(T){let S=chunk3R7QHNI5_js.l(T,"w","val");S!==void 0&&(o.spacing=S);}let E=chunk3R7QHNI5_js.e(e,"w","position");if(E){let S=chunk3R7QHNI5_js.l(E,"w","val");S!==void 0&&(o.position=S);}let b=chunk3R7QHNI5_js.e(e,"w","w");if(b){let S=chunk3R7QHNI5_js.l(b,"w","val");S!==void 0&&(o.scale=S);}let k=chunk3R7QHNI5_js.e(e,"w","kern");if(k){let S=chunk3R7QHNI5_js.l(k,"w","val");S!==void 0&&(o.kerning=S);}let B=chunk3R7QHNI5_js.e(e,"w","effect");if(B){let S=chunk3R7QHNI5_js.j(B,"w","val");S&&(o.effect=S);}let v=chunk3R7QHNI5_js.e(e,"w","em");if(v){let S=chunk3R7QHNI5_js.j(v,"w","val");S&&(o.emphasisMark=S);}let I=chunk3R7QHNI5_js.e(e,"w","emboss");I&&(o.emboss=chunk3R7QHNI5_js.m(I));let H=chunk3R7QHNI5_js.e(e,"w","imprint");H&&(o.imprint=chunk3R7QHNI5_js.m(H));let X=chunk3R7QHNI5_js.e(e,"w","outline");X&&(o.outline=chunk3R7QHNI5_js.m(X));let Te=chunk3R7QHNI5_js.e(e,"w","shadow");Te&&(o.shadow=chunk3R7QHNI5_js.m(Te));let Ce=chunk3R7QHNI5_js.e(e,"w","rtl");Ce&&(o.rtl=chunk3R7QHNI5_js.m(Ce));let Fe=chunk3R7QHNI5_js.e(e,"w","cs");Fe&&(o.cs=chunk3R7QHNI5_js.m(Fe));let xe=chunk3R7QHNI5_js.e(e,"w","rStyle");if(xe){let S=chunk3R7QHNI5_js.j(xe,"w","val");S&&(o.styleId=S);}return Object.keys(o).length>0?o:void 0}function Jt(e){let t=chunk3R7QHNI5_js.j(e,"w","id"),n=t?parseInt(t,10):0,o=(chunk3R7QHNI5_js.j(e,"w","author")??"").trim(),r=(chunk3R7QHNI5_js.j(e,"w","date")??"").trim(),a=(chunk3R7QHNI5_js.j(e,"w","rsid")??"").trim();return {id:Number.isInteger(n)&&n>=0?n:0,author:o.length>0?o:"Unknown",date:r.length>0?r:void 0,rsid:a.length>0?a:void 0}}function en(e,t,n,o){if(!e)return;let r=chunk3R7QHNI5_js.f(e,"w","rPrChange").map(a=>{let u=chunk3R7QHNI5_js.e(a,"w","rPr");return {type:"runPropertyChange",info:Jt(a),previousFormatting:fe(u,t),currentFormatting:o}}).filter(a=>a.previousFormatting||a.currentFormatting);return r.length>0?r:void 0}function tn(e){let t=chunk3R7QHNI5_js.k(e),n=chunk3R7QHNI5_js.j(e,"xml","space")==="preserve";return {type:"text",text:t,preserveSpace:n||void 0}}function nn(){return {type:"tab"}}function on(e){let t=chunk3R7QHNI5_js.j(e,"w","type"),n=chunk3R7QHNI5_js.j(e,"w","clear"),o={type:"break"};return (t==="page"||t==="column"||t==="textWrapping")&&(o.breakType=t),(n==="none"||n==="left"||n==="right"||n==="all")&&(o.clear=n),o}function rn(e){let t=chunk3R7QHNI5_js.j(e,"w","font")??"",n=chunk3R7QHNI5_js.j(e,"w","char")??"";return {type:"symbol",font:t,char:n}}function an(e){return {type:"footnoteRef",id:chunk3R7QHNI5_js.l(e,"w","id")??0}}function ln(e){return {type:"endnoteRef",id:chunk3R7QHNI5_js.l(e,"w","id")??0}}function sn(e){let t=chunk3R7QHNI5_js.j(e,"w","fldCharType"),n=chunk3R7QHNI5_js.j(e,"w","fldLock")==="true"||chunk3R7QHNI5_js.j(e,"w","fldLock")==="1",o=chunk3R7QHNI5_js.j(e,"w","dirty")==="true"||chunk3R7QHNI5_js.j(e,"w","dirty")==="1",r="begin";return t==="separate"?r="separate":t==="end"&&(r="end"),{type:"fieldChar",charType:r,fldLock:n||void 0,dirty:o||void 0}}function un(e){return {type:"instrText",text:chunk3R7QHNI5_js.k(e)}}function tt(e,t,n){let o=chunkO2643IUW_js.z(e,t??void 0,n??void 0);return o?{type:"drawing",image:o}:null}function ue(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function fn(e,t,n){let o=[],r=chunk3R7QHNI5_js.i(e);for(let a of r)switch(ue(a.name)){case "t":o.push(tn(a));break;case "tab":o.push(nn());break;case "br":o.push(on(a));break;case "sym":o.push(rn(a));break;case "footnoteReference":o.push(an(a));break;case "endnoteReference":o.push(ln(a));break;case "fldChar":o.push(sn(a));break;case "instrText":o.push(un(a));break;case "softHyphen":o.push({type:"softHyphen"});break;case "noBreakHyphen":o.push({type:"noBreakHyphen"});break;case "drawing":let l=tt(a,t,n);l&&o.push(l);break;case "pict":case "object":break;case "rPr":break;case "lastRenderedPageBreak":break;case "cr":o.push({type:"break",breakType:"textWrapping"});break;case "AlternateContent":{let c=chunk3R7QHNI5_js.i(a).find(p=>ue(p.name)==="Choice")??chunk3R7QHNI5_js.i(a).find(p=>ue(p.name)==="Fallback");if(c){for(let p of chunk3R7QHNI5_js.i(c))if(ue(p.name)==="drawing"){let y=tt(p,t,n);y?.image?.src&&o.push(y);}}break}case "footnoteRef":o.push({type:"footnoteRefMark"});break;case "endnoteRef":o.push({type:"endnoteRefMark"});break;case "separator":o.push({type:"separator"});break;case "continuationSeparator":o.push({type:"continuationSeparator"});break;}return o}function K(e,t,n,o=null,r=null){let a={type:"run",content:[]},u=chunk3R7QHNI5_js.e(e,"w","rPr");return u&&(a.formatting=fe(u,n),a.propertyChanges=en(u,n,t,a.formatting)),a.content=fn(e,o,r),a}function cn(e,t,n,o){let r={};return e&&e!=="auto"?r.rgb=e:e==="auto"&&(r.auto=true),t&&(r.themeColor=t),n&&(r.themeTint=n),o&&(r.themeShade=o),r}function pn(e){if(!e)return;let t={},n=chunk3R7QHNI5_js.j(e,"w","color");n&&n!=="auto"&&(t.color={rgb:n});let o=chunk3R7QHNI5_js.j(e,"w","fill");o&&o!=="auto"&&(t.fill={rgb:o});let r=chunk3R7QHNI5_js.j(e,"w","themeFill");r&&(t.fill=t.fill||{},t.fill.themeColor=r);let a=chunk3R7QHNI5_js.j(e,"w","themeFillTint");a&&t.fill&&(t.fill.themeTint=a);let u=chunk3R7QHNI5_js.j(e,"w","themeFillShade");u&&t.fill&&(t.fill.themeShade=u);let l=chunk3R7QHNI5_js.j(e,"w","val");return l&&(t.pattern=l),Object.keys(t).length>0?t:void 0}function G(e){if(!e)return;let t=chunk3R7QHNI5_js.j(e,"w","val");if(!t)return;let n={style:t},o=chunk3R7QHNI5_js.j(e,"w","color"),r=chunk3R7QHNI5_js.j(e,"w","themeColor");(o||r)&&(n.color=cn(o,r,chunk3R7QHNI5_js.j(e,"w","themeTint"),chunk3R7QHNI5_js.j(e,"w","themeShade")));let a=chunk3R7QHNI5_js.l(e,"w","sz");a!==void 0&&(n.size=a);let u=chunk3R7QHNI5_js.l(e,"w","space");u!==void 0&&(n.space=u);let l=chunk3R7QHNI5_js.j(e,"w","shadow");l&&(n.shadow=l==="1"||l==="true");let f=chunk3R7QHNI5_js.j(e,"w","frame");return f&&(n.frame=f==="1"||f==="true"),n}function dn(e){if(!e)return;let t=chunk3R7QHNI5_js.f(e,"w","tab");if(t.length===0)return;let n=[];for(let o of t){let r=chunk3R7QHNI5_js.l(o,"w","pos"),a=chunk3R7QHNI5_js.j(o,"w","val");if(r!==void 0&&a){let u={position:r,alignment:a},l=chunk3R7QHNI5_js.j(o,"w","leader");l&&(u.leader=l),n.push(u);}}return n.length>0?n:void 0}function mn(e){if(!e)return;let t={},n=chunk3R7QHNI5_js.l(e,"w","w");n!==void 0&&(t.width=n);let o=chunk3R7QHNI5_js.l(e,"w","h");o!==void 0&&(t.height=o);let r=chunk3R7QHNI5_js.j(e,"w","hAnchor");(r==="text"||r==="margin"||r==="page")&&(t.hAnchor=r);let a=chunk3R7QHNI5_js.j(e,"w","vAnchor");(a==="text"||a==="margin"||a==="page")&&(t.vAnchor=a);let u=chunk3R7QHNI5_js.l(e,"w","x");u!==void 0&&(t.x=u);let l=chunk3R7QHNI5_js.l(e,"w","y");l!==void 0&&(t.y=l);let f=chunk3R7QHNI5_js.j(e,"w","xAlign");f&&(t.xAlign=f);let c=chunk3R7QHNI5_js.j(e,"w","yAlign");c&&(t.yAlign=c);let p=chunk3R7QHNI5_js.j(e,"w","wrap");return p&&(t.wrap=p),Object.keys(t).length>0?t:void 0}function ce(e,t,n){if(!e)return;let o={},r=chunk3R7QHNI5_js.e(e,"w","jc");if(r){let b=chunk3R7QHNI5_js.j(r,"w","val");b&&(o.alignment=b);}let a=chunk3R7QHNI5_js.e(e,"w","bidi");a&&(o.bidi=chunk3R7QHNI5_js.m(a));let u=chunk3R7QHNI5_js.e(e,"w","spacing");if(u){let b=chunk3R7QHNI5_js.l(u,"w","before");b!==void 0&&(o.spaceBefore=b);let k=chunk3R7QHNI5_js.l(u,"w","after");k!==void 0&&(o.spaceAfter=k);let B=chunk3R7QHNI5_js.l(u,"w","line");B!==void 0&&(o.lineSpacing=B);let v={};b!==void 0&&(v.before=true),k!==void 0&&(v.after=true),(v.before||v.after)&&(o.spacingExplicit=v);let I=chunk3R7QHNI5_js.j(u,"w","lineRule");I&&(o.lineSpacingRule=I);let H=chunk3R7QHNI5_js.j(u,"w","beforeAutospacing");H&&(o.beforeAutospacing=H==="1"||H==="true");let X=chunk3R7QHNI5_js.j(u,"w","afterAutospacing");X&&(o.afterAutospacing=X==="1"||X==="true");}let l=chunk3R7QHNI5_js.e(e,"w","ind");if(l){let b=chunk3R7QHNI5_js.l(l,"w","left");b!==void 0&&(o.indentLeft=b);let k=chunk3R7QHNI5_js.l(l,"w","right");k!==void 0&&(o.indentRight=k);let B=chunk3R7QHNI5_js.l(l,"w","firstLine");B!==void 0&&(o.indentFirstLine=B);let v=chunk3R7QHNI5_js.l(l,"w","hanging");v!==void 0&&(o.indentFirstLine=-v,o.hangingIndent=true);let I=chunk3R7QHNI5_js.l(l,"w","start");I!==void 0&&o.indentLeft===void 0&&(o.indentLeft=I);let H=chunk3R7QHNI5_js.l(l,"w","end");H!==void 0&&o.indentRight===void 0&&(o.indentRight=H);}let f=chunk3R7QHNI5_js.e(e,"w","pBdr");if(f){let b={},k=G(chunk3R7QHNI5_js.e(f,"w","top"));k&&(b.top=k);let B=G(chunk3R7QHNI5_js.e(f,"w","bottom"));B&&(b.bottom=B);let v=G(chunk3R7QHNI5_js.e(f,"w","left"));v&&(b.left=v);let I=G(chunk3R7QHNI5_js.e(f,"w","right"));I&&(b.right=I);let H=G(chunk3R7QHNI5_js.e(f,"w","between"));H&&(b.between=H);let X=G(chunk3R7QHNI5_js.e(f,"w","bar"));X&&(b.bar=X),Object.keys(b).length>0&&(o.borders=b);}let c=chunk3R7QHNI5_js.e(e,"w","shd");c&&(o.shading=pn(c));let p=chunk3R7QHNI5_js.e(e,"w","tabs");p&&(o.tabs=dn(p));let d=chunk3R7QHNI5_js.e(e,"w","keepNext");d&&(o.keepNext=chunk3R7QHNI5_js.m(d));let y=chunk3R7QHNI5_js.e(e,"w","keepLines");y&&(o.keepLines=chunk3R7QHNI5_js.m(y));let F=chunk3R7QHNI5_js.e(e,"w","widowControl");F&&(o.widowControl=chunk3R7QHNI5_js.m(F));let h=chunk3R7QHNI5_js.e(e,"w","pageBreakBefore");h&&(o.pageBreakBefore=chunk3R7QHNI5_js.m(h));let C=chunk3R7QHNI5_js.e(e,"w","contextualSpacing");C&&(o.contextualSpacing=chunk3R7QHNI5_js.m(C));let w=chunk3R7QHNI5_js.e(e,"w","numPr");if(w){let b=chunk3R7QHNI5_js.e(w,"w","numId"),k=chunk3R7QHNI5_js.e(w,"w","ilvl");if(b||k){if(o.numPr={},b){let B=chunk3R7QHNI5_js.l(b,"w","val");B!==void 0&&(o.numPr.numId=B);}if(k){let B=chunk3R7QHNI5_js.l(k,"w","val");B!==void 0&&(o.numPr.ilvl=B);}}}let P=chunk3R7QHNI5_js.e(e,"w","outlineLvl");if(P){let b=chunk3R7QHNI5_js.l(P,"w","val");b!==void 0&&(o.outlineLevel=b);}let x=chunk3R7QHNI5_js.e(e,"w","pStyle");if(x){let b=chunk3R7QHNI5_js.j(x,"w","val");b&&(o.styleId=b);}let M=chunk3R7QHNI5_js.e(e,"w","framePr");M&&(o.frame=mn(M));let m=chunk3R7QHNI5_js.e(e,"w","suppressLineNumbers");m&&(o.suppressLineNumbers=chunk3R7QHNI5_js.m(m));let T=chunk3R7QHNI5_js.e(e,"w","suppressAutoHyphens");T&&(o.suppressAutoHyphens=chunk3R7QHNI5_js.m(T));let E=chunk3R7QHNI5_js.e(e,"w","rPr");return E&&(o.runProperties=fe(E,t)),Object.keys(o).length>0?o:void 0}function gn(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function hn(e){let t=chunk3R7QHNI5_js.l(e,"w","id")??0,n=chunk3R7QHNI5_js.j(e,"w","name")??"",o={type:"bookmarkStart",id:t,name:n},r=chunk3R7QHNI5_js.l(e,"w","colFirst");r!==void 0&&(o.colFirst=r);let a=chunk3R7QHNI5_js.l(e,"w","colLast");return a!==void 0&&(o.colLast=a),o}function wn(e){return {type:"bookmarkEnd",id:chunk3R7QHNI5_js.l(e,"w","id")??0}}function nt(e,t,n=null,o=null,r=null){let a={type:"hyperlink",children:[]},u=chunk3R7QHNI5_js.j(e,"r","id");if(u&&(a.rId=u,t)){let F=t.get(u);F&&(chunkZ3LGMBJC_js.c(F),a.href=F.target);}let l=chunk3R7QHNI5_js.j(e,"w","anchor");l&&(a.anchor=l,a.href||(a.href=`#${l}`));let f=chunk3R7QHNI5_js.j(e,"w","tooltip");f&&(a.tooltip=f);let c=chunk3R7QHNI5_js.j(e,"w","tgtFrame");c&&(a.target=c);let p=chunk3R7QHNI5_js.j(e,"w","history");(p==="1"||p==="true")&&(a.history=true);let d=chunk3R7QHNI5_js.j(e,"w","docLocation");d&&(a.docLocation=d);let y=chunk3R7QHNI5_js.i(e);for(let F of y)switch(gn(F.name)){case "r":a.children.push(K(F,n,o,t,r));break;case "bookmarkStart":a.children.push(hn(F));break;case "bookmarkEnd":a.children.push(wn(F));break}return a}function vo(e){let t="";for(let n of e.children)if(n.type==="run")for(let o of n.content)o.type==="text"?t+=o.text:o.type==="tab"&&(t+=" ");return t}function No(e){return e.href?/^https?:\/\/|^mailto:|^tel:|^ftp:/i.test(e.href):!!e.rId&&!e.anchor}function Ao(e){return !!e.anchor}function Ho(e){return e.href}function Io(e){return e.children.some(t=>t.type==="run")}function Lo(e){return e.children.filter(t=>t.type==="run")}function Xo(e,t){if(e.rId){let n=t.get(e.rId);if(n)return chunkZ3LGMBJC_js.c(n),e.href=n.target,e.href}return e.anchor&&!e.href&&(e.href=`#${e.anchor}`),e.href}function ot(e){let t=chunk3R7QHNI5_js.l(e,"w","id")??0,n=chunk3R7QHNI5_js.j(e,"w","name")??"",o={type:"bookmarkStart",id:t,name:n},r=chunk3R7QHNI5_js.l(e,"w","colFirst");r!==void 0&&(o.colFirst=r);let a=chunk3R7QHNI5_js.l(e,"w","colLast");return a!==void 0&&(o.colLast=a),o}function rt(e){return {type:"bookmarkEnd",id:chunk3R7QHNI5_js.l(e,"w","id")??0}}function at(e){let t="";if(e.type==="text"&&typeof e.text=="string")return e.text;if(e.elements)for(let n of e.elements)if((n.name?.replace(/^.*:/,"")??"")==="t"&&n.elements)for(let r of n.elements)r.type==="text"&&typeof r.text=="string"&&(t+=r.text);else t+=at(n);return t}function Q(e){if(!e)return "";let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function lt(e){let t=new Set(["hyperlink","smartTag","sdt","sdtContent","fldSimple","customXml","ins","del","moveFrom","moveTo"]),n=new Set(["pPr","proofErr","bookmarkStart","bookmarkEnd","commentRangeStart","commentRangeEnd","commentReference","permStart","permEnd","rsidR"]),o=new Set(["t","tab","br","cr","sym","drawing","pict","object","softHyphen","noBreakHyphen","fldChar","instrText","pgNum","separator","continuationSeparator","footnoteRef","endnoteRef","footnoteReference","endnoteReference","ptab","monthShort","monthLong","yearShort","yearLong","dayShort","dayLong"]),r=false;function a(l){for(let f of chunk3R7QHNI5_js.i(l)){let c=Q(f.name);if(!n.has(c)){if(c==="lastRenderedPageBreak"){r=true;continue}if(c==="r"){for(let p of chunk3R7QHNI5_js.i(f)){let d=Q(p.name);if(d!=="rPr"){if(d==="lastRenderedPageBreak"){r=true;continue}if(d==="br"&&chunk3R7QHNI5_js.j(p,"w","type")==="page")return "forced";if(o.has(d))return "visible"}}continue}if(t.has(c)){let p=a(f);if(p!=="continue")return p;continue}return "continue"}}return "continue"}let u=a(e);return u==="forced"?true:u==="visible"?r:false}function it(e,t){if(!e)return `w:${t}`;let n=e.indexOf(":");return n<0?t:`${e.substring(0,n+1)}${t}`}function st(e){if(e.type!=="element")return e;let t=Q(e.name),n=e.name;return t==="delText"?n=it(e.name,"t"):t==="delInstrText"&&(n=it(e.name,"instrText")),{...e,name:n,elements:e.elements?.map(st)}}function Z(e){let t=chunk3R7QHNI5_js.j(e,"w","id"),n=t?parseInt(t,10):0,o=chunk3R7QHNI5_js.j(e,"w","author"),r=chunk3R7QHNI5_js.j(e,"w","date"),a=o?.trim()??"",u=r?.trim()??"";return {id:Number.isInteger(n)&&n>=0?n:0,author:a.length>0?a:"Unknown",date:u.length>0?u:void 0}}function yn(e){return Z(e)}function ut(e,t,n,o){if(!e)return;let r=chunk3R7QHNI5_js.f(e,"w","pPrChange").map(a=>{let u=chunk3R7QHNI5_js.e(a,"w","pPr");return {type:"paragraphPropertyChange",info:yn(a),previousFormatting:ce(u,t),currentFormatting:o}}).filter(a=>a.previousFormatting||a.currentFormatting);return r.length>0?r:void 0}function bn(e,t,n,o,r){return nt(e,t,n,o,r)}function Tn(e){return ot(e)}function Cn(e){return rt(e)}function ft(e){let t=e.trim().match(/^\\?([A-Z]+)/i);if(!t)return "UNKNOWN";let n=t[1].toUpperCase();return ["PAGE","NUMPAGES","NUMWORDS","NUMCHARS","DATE","TIME","CREATEDATE","SAVEDATE","PRINTDATE","AUTHOR","TITLE","SUBJECT","KEYWORDS","COMMENTS","FILENAME","FILESIZE","TEMPLATE","DOCPROPERTY","DOCVARIABLE","REF","PAGEREF","NOTEREF","HYPERLINK","TOC","TOA","INDEX","SEQ","STYLEREF","AUTONUM","AUTONUMLGL","AUTONUMOUT","IF","MERGEFIELD","NEXT","NEXTIF","ASK","SET","QUOTE","INCLUDETEXT","INCLUDEPICTURE","SYMBOL","ADVANCE","EDITTIME","REVNUM","SECTION","SECTIONPAGES","USERADDRESS","USERNAME","USERINITIALS"].includes(n)?n:"UNKNOWN"}function Fn(e,t,n,o,r){let a=chunk3R7QHNI5_js.j(e,"w","instr")??"",u=ft(a),l={type:"simpleField",instruction:a,fieldType:u,content:[]},f=chunk3R7QHNI5_js.j(e,"w","fldLock");(f==="1"||f==="true")&&(l.fldLock=true);let c=chunk3R7QHNI5_js.j(e,"w","dirty");(c==="1"||c==="true")&&(l.dirty=true);let p=chunk3R7QHNI5_js.i(e);for(let d of p)Q(d.name)==="r"&&l.content.push(K(d,t,n,o,r));return l}function j(e,t,n,o,r,a,u="default"){let l=[],f=chunk3R7QHNI5_js.i(e),c=false,p="",d=[],y=[],F=false,h=false,C=false;for(let w of f){let P=Q(w.name);switch(P){case "r":{let x=u==="deletion"?st(w):w,M=K(x,t,n,r,a),m=false,T=false,E=false,b="";for(let k of M.content)k.type==="fieldChar"?k.charType==="begin"?(m=true,k.fldLock&&(h=true),k.dirty&&(C=true)):k.charType==="separate"?T=true:k.charType==="end"&&(E=true):k.type==="instrText"&&(b+=k.text);if(m&&(c=true,F=false,p="",d=[],y=[],h=false,C=false),c){if(b&&(p+=b),T&&(F=true),F&&!E?T||y.push(M):!F&&!m&&d.push(M),E){let k={type:"complexField",instruction:p.trim(),fieldType:ft(p),fieldCode:d,fieldResult:y};h&&(k.fldLock=true),C&&(k.dirty=true),l.push(k),c=false;}}else l.push(M);break}case "hyperlink":l.push(bn(w,r,t,n,a));break;case "bookmarkStart":l.push(Tn(w));break;case "bookmarkEnd":l.push(Cn(w));break;case "fldSimple":l.push(Fn(w,t,n,r,a));break;case "pPr":break;case "proofErr":case "permStart":case "permEnd":case "customXml":break;case "sdt":{let x=(w.elements??[]).find(m=>m.type==="element"&&(m.name==="w:sdtPr"||m.name?.endsWith(":sdtPr"))),M=(w.elements??[]).find(m=>m.type==="element"&&(m.name==="w:sdtContent"||m.name?.endsWith(":sdtContent")));if(M){let m=j(M,t,n,null,r,a,u),E={type:"inlineSdt",properties:re(x??null),content:m.filter(b=>b.type==="run"||b.type==="hyperlink"||b.type==="simpleField"||b.type==="complexField"||b.type==="inlineSdt"||b.type==="mathEquation")};l.push(E);}break}case "ins":{let x=Z(w),M=j(w,t,n,null,r,a),m={type:"insertion",info:x,content:M.filter(T=>T.type==="run"||T.type==="hyperlink")};l.push(m);break}case "del":{let x=Z(w),M=j(w,t,n,null,r,a,"deletion"),m={type:"deletion",info:x,content:M.filter(T=>T.type==="run"||T.type==="hyperlink")};l.push(m);break}case "moveFrom":{let x=Z(w),M=j(w,t,n,null,r,a,"deletion"),m={type:"moveFrom",info:x,content:M.filter(T=>T.type==="run"||T.type==="hyperlink")};l.push(m);break}case "moveTo":{let x=Z(w),M=j(w,t,n,null,r,a),m={type:"moveTo",info:x,content:M.filter(T=>T.type==="run"||T.type==="hyperlink")};l.push(m);break}case "smartTag":break;case "moveFromRangeStart":{let x=parseInt(chunk3R7QHNI5_js.j(w,"w","id")??"0",10),M=chunk3R7QHNI5_js.j(w,"w","name")??"";l.push({type:"moveFromRangeStart",id:x,name:M});break}case "moveFromRangeEnd":{let x=parseInt(chunk3R7QHNI5_js.j(w,"w","id")??"0",10);l.push({type:"moveFromRangeEnd",id:x});break}case "moveToRangeStart":{let x=parseInt(chunk3R7QHNI5_js.j(w,"w","id")??"0",10),M=chunk3R7QHNI5_js.j(w,"w","name")??"";l.push({type:"moveToRangeStart",id:x,name:M});break}case "moveToRangeEnd":{let x=parseInt(chunk3R7QHNI5_js.j(w,"w","id")??"0",10);l.push({type:"moveToRangeEnd",id:x});break}case "commentRangeStart":{let x=parseInt(chunk3R7QHNI5_js.j(w,"w","id")??"0",10);l.push({type:"commentRangeStart",id:x});break}case "commentRangeEnd":{let x=parseInt(chunk3R7QHNI5_js.j(w,"w","id")??"0",10);l.push({type:"commentRangeEnd",id:x});break}case "oMath":case "oMathPara":{let x=P==="oMathPara",M=chunk3R7QHNI5_js.b(w),m=at(w),T={type:"mathEquation",display:x?"block":"inline",ommlXml:M,plainText:m||void 0};l.push(T);break}}}return l}function xn(e){let t="";for(let n of e.content)if(n.type==="run")for(let o of n.content)o.type==="text"?t+=o.text:o.type==="tab"?t+=" ":o.type==="break"&&(o.breakType==="page"?t+="\f":t+=`
|
|
4
|
+
`);else if(n.type==="hyperlink"){for(let o of n.children)if(o.type==="run")for(let r of o.content)r.type==="text"&&(t+=r.text);}else if(n.type==="simpleField"){for(let o of n.content)if(o.type==="run")for(let r of o.content)r.type==="text"&&(t+=r.text);}else if(n.type==="complexField")for(let o of n.fieldResult)for(let r of o.content)r.type==="text"&&(t+=r.text);return t}function ct(e){let t=chunk3R7QHNI5_js.j(e,"w","id");if(t==null)return null;let n=parseInt(t,10);if(Number.isNaN(n))return null;let o=chunk3R7QHNI5_js.j(e,"w","author")??"",r=chunk3R7QHNI5_js.j(e,"w","date")??void 0,a={id:n,author:o};return r&&(a.date=r),a}function Y(e,t,n,o,r=null,a=null,u){let l={type:"paragraph",content:[]},f=chunk3R7QHNI5_js.j(e,"w14","paraId")??chunk3R7QHNI5_js.j(e,"w","paraId");f&&(l.paraId=f);let c=chunk3R7QHNI5_js.j(e,"w14","textId")??chunk3R7QHNI5_js.j(e,"w","textId");c&&(l.textId=c),!u?.inHeaderFooter&<(e)&&(l.renderedPageBreakBefore=true);let p=chunk3R7QHNI5_js.e(e,"w","pPr");if(p){l.formatting=ce(p,n),l.propertyChanges=ut(p,n,t,l.formatting);let h=chunk3R7QHNI5_js.e(p,"w","rPr");if(h){let w=chunk3R7QHNI5_js.e(h,"w","ins");if(w){let x=ct(w);x&&(l.pPrIns=x);}let P=chunk3R7QHNI5_js.e(h,"w","del");if(P){let x=ct(P);x&&(l.pPrDel=x);}}let C=chunk3R7QHNI5_js.e(p,"w","sectPr");C&&(l.sectionProperties=Qe(C));}let d=j(e,t,n,o,r,a);l.content=be(d);let y=l.formatting?.numPr,F=false;if(!y&&l.formatting?.styleId&&t){let h=t.get(l.formatting.styleId);h?.pPr?.numPr&&(y=h.pPr.numPr,F=true,l.formatting||(l.formatting={}),l.formatting.numPr=y,l.formatting.numPrFromStyle=y);}if(y&&o){let h=chunkH57LNDBH_js.d(y,o);if(h){l.listRendering=h;let C=F?kn(l.formatting?.styleId,t):{left:false,firstLine:false},w=o.getLevel(h.numId,h.level);if(w?.pPr){l.formatting||(l.formatting={});let P=p?chunk3R7QHNI5_js.e(p,"w","ind"):null,x=P!=null&&(chunk3R7QHNI5_js.j(P,"w","left")!==null||chunk3R7QHNI5_js.j(P,"w","start")!==null),M=T=>{let E=P?chunk3R7QHNI5_js.j(P,"w",T):null;if(E===null)return false;let b=parseInt(E,10);return Number.isNaN(b)||b!==0},m=P!=null&&(M("firstLine")||M("hanging"));!x&&!C.left&&w.pPr.indentLeft!==void 0&&(l.formatting.indentLeft=w.pPr.indentLeft),!m&&!C.firstLine&&(w.pPr.indentFirstLine!==void 0&&(l.formatting.indentFirstLine=w.pPr.indentFirstLine),w.pPr.hangingIndent!==void 0&&(l.formatting.hangingIndent=w.pPr.hangingIndent));}}}return l}function kn(e,t){let n={left:false,firstLine:false};if(!e||!t)return n;let o=new Set,r=e;for(;r&&!o.has(r);){o.add(r);let a=t.get(r);if(!a)break;let u=a.pPr;if(u&&(n.left||(n.left=u.indentLeft!==void 0),n.firstLine||(n.firstLine=u.indentFirstLine!==void 0||u.hangingIndent!==void 0)),n.left&&n.firstLine)break;r=a.basedOn;}return n}function pt(e){if(!e)return;let t={},n=O(chunk3R7QHNI5_js.e(e,"w","tblW"));n&&(t.width=n);let o=chunk3R7QHNI5_js.e(e,"w","jc");if(o){let C=chunk3R7QHNI5_js.j(o,"w","val");(C==="left"||C==="center"||C==="right"||C==="start")&&(t.justification=C==="start"?"left":C);}let r=O(chunk3R7QHNI5_js.e(e,"w","tblCellSpacing"));r&&(t.cellSpacing=r);let a=O(chunk3R7QHNI5_js.e(e,"w","tblInd"));a&&(t.indent=a);let u=te(chunk3R7QHNI5_js.e(e,"w","tblBorders"));u&&(t.borders=u);let l=ne(chunk3R7QHNI5_js.e(e,"w","tblCellMar"));l&&(t.cellMargins=l);let f=chunk3R7QHNI5_js.e(e,"w","tblLayout");if(f){let C=chunk3R7QHNI5_js.j(f,"w","type");(C==="fixed"||C==="autofit")&&(t.layout=C);}let c=chunk3R7QHNI5_js.e(e,"w","tblStyle");if(c){let C=chunk3R7QHNI5_js.j(c,"w","val");C&&(t.styleId=C);}let p=he(chunk3R7QHNI5_js.e(e,"w","tblLook"));p&&(t.look=p);let d=oe(chunk3R7QHNI5_js.e(e,"w","shd"));d&&(t.shading=d);let y=chunk3R7QHNI5_js.e(e,"w","tblOverlap");if(y){let C=chunk3R7QHNI5_js.j(y,"w","val");(C==="never"||C==="overlap")&&(t.overlap=C);}let F=we(chunk3R7QHNI5_js.e(e,"w","tblpPr"));if(F&&(t.floating=F),chunk3R7QHNI5_js.m(chunk3R7QHNI5_js.e(e,"w","bidiVisual"))&&(t.bidi=true),Object.keys(t).length!==0)return t}function Sn(e,t){if(!e)return;let n=chunk3R7QHNI5_js.f(e,"w","tblPrChange").map(o=>{let r=chunk3R7QHNI5_js.e(o,"w","tblPr");return {type:"tablePropertyChange",info:ee(o),previousFormatting:pt(r),currentFormatting:t}}).filter(o=>o.previousFormatting||o.currentFormatting);return n.length>0?n:void 0}function Mn(e,t){if(!e)return;let n=chunk3R7QHNI5_js.f(e,"w","trPrChange").map(o=>{let r=chunk3R7QHNI5_js.e(o,"w","trPr");return {type:"tableRowPropertyChange",info:ee(o),previousFormatting:dt(r),currentFormatting:t}}).filter(o=>o.previousFormatting||o.currentFormatting);return n.length>0?n:void 0}function Rn(e,t){if(!e)return;let n=chunk3R7QHNI5_js.f(e,"w","tcPrChange").map(o=>{let r=chunk3R7QHNI5_js.e(o,"w","tcPr");return {type:"tableCellPropertyChange",info:ee(o),previousFormatting:gt(r),currentFormatting:t}}).filter(o=>o.previousFormatting||o.currentFormatting);return n.length>0?n:void 0}function En(e){if(!e)return;let t=chunk3R7QHNI5_js.e(e,"w","ins");if(t)return {type:"tableRowInsertion",info:V(t)};let n=chunk3R7QHNI5_js.e(e,"w","del");if(n)return {type:"tableRowDeletion",info:V(n)}}function Pn(e){if(!e)return;let t=chunk3R7QHNI5_js.e(e,"w","cellIns");if(t)return {type:"tableCellInsertion",info:V(t)};let n=chunk3R7QHNI5_js.e(e,"w","cellDel");if(n)return {type:"tableCellDeletion",info:V(n)};let o=chunk3R7QHNI5_js.e(e,"w","cellMerge");if(o){let r=chunk3R7QHNI5_js.j(o,"w","vMerge"),a=chunk3R7QHNI5_js.j(o,"w","vMergeOrig"),u=l=>l==="rest"||l==="cont";return {type:"tableCellMerge",info:V(o),...u(r)?{vMerge:r}:{},...u(a)?{vMergeOrig:a}:{}}}}function dt(e){if(!e)return;let t={},n=chunk3R7QHNI5_js.e(e,"w","trHeight");if(n){let f=chunk3R7QHNI5_js.l(n,"w","val");f!==void 0&&f>0&&(t.height={value:f,type:"dxa"});let c=chunk3R7QHNI5_js.j(n,"w","hRule");(c==="auto"||c==="atLeast"||c==="exact")&&(t.heightRule=c);}chunk3R7QHNI5_js.m(chunk3R7QHNI5_js.e(e,"w","tblHeader"))&&(t.header=true),chunk3R7QHNI5_js.m(chunk3R7QHNI5_js.e(e,"w","cantSplit"))&&(t.cantSplit=true);let a=chunk3R7QHNI5_js.e(e,"w","jc");if(a){let f=chunk3R7QHNI5_js.j(a,"w","val");(f==="left"||f==="center"||f==="right")&&(t.justification=f);}chunk3R7QHNI5_js.m(chunk3R7QHNI5_js.e(e,"w","hidden"))&&(t.hidden=true);let l=mt(chunk3R7QHNI5_js.e(e,"w","cnfStyle"));if(l&&(t.conditionalFormat=l),Object.keys(t).length!==0)return t}function mt(e){if(!e)return;let t={},n=chunk3R7QHNI5_js.j(e,"w","firstRow");(n==="1"||n==="true")&&(t.firstRow=true);let o=chunk3R7QHNI5_js.j(e,"w","lastRow");(o==="1"||o==="true")&&(t.lastRow=true);let r=chunk3R7QHNI5_js.j(e,"w","firstColumn");(r==="1"||r==="true")&&(t.firstColumn=true);let a=chunk3R7QHNI5_js.j(e,"w","lastColumn");(a==="1"||a==="true")&&(t.lastColumn=true);let u=chunk3R7QHNI5_js.j(e,"w","oddHBand");(u==="1"||u==="true")&&(t.oddHBand=true);let l=chunk3R7QHNI5_js.j(e,"w","evenHBand");(l==="1"||l==="true")&&(t.evenHBand=true);let f=chunk3R7QHNI5_js.j(e,"w","oddVBand");(f==="1"||f==="true")&&(t.oddVBand=true);let c=chunk3R7QHNI5_js.j(e,"w","evenVBand");(c==="1"||c==="true")&&(t.evenVBand=true);let p=chunk3R7QHNI5_js.j(e,"w","firstRowFirstColumn");(p==="1"||p==="true")&&(t.nwCell=true);let d=chunk3R7QHNI5_js.j(e,"w","firstRowLastColumn");(d==="1"||d==="true")&&(t.neCell=true);let y=chunk3R7QHNI5_js.j(e,"w","lastRowFirstColumn");(y==="1"||y==="true")&&(t.swCell=true);let F=chunk3R7QHNI5_js.j(e,"w","lastRowLastColumn");(F==="1"||F==="true")&&(t.seCell=true);let h=chunk3R7QHNI5_js.j(e,"w","val");if(h&&h.length===12&&(h[0]==="1"&&(t.firstRow=true),h[1]==="1"&&(t.lastRow=true),h[2]==="1"&&(t.firstColumn=true),h[3]==="1"&&(t.lastColumn=true),h[4]==="1"&&(t.oddVBand=true),h[5]==="1"&&(t.evenVBand=true),h[6]==="1"&&(t.oddHBand=true),h[7]==="1"&&(t.evenHBand=true),h[8]==="1"&&(t.nwCell=true),h[9]==="1"&&(t.neCell=true),h[10]==="1"&&(t.swCell=true),h[11]==="1"&&(t.seCell=true)),Object.keys(t).length!==0)return t}function gt(e){if(!e)return;let t={},n=O(chunk3R7QHNI5_js.e(e,"w","tcW"));n&&(t.width=n);let o=te(chunk3R7QHNI5_js.e(e,"w","tcBorders"));o&&(t.borders=o);let r=ne(chunk3R7QHNI5_js.e(e,"w","tcMar"));r&&(t.margins=r);let a=oe(chunk3R7QHNI5_js.e(e,"w","shd"));a&&(t.shading=a);let u=chunk3R7QHNI5_js.e(e,"w","vAlign");if(u){let h=chunk3R7QHNI5_js.j(u,"w","val");(h==="top"||h==="center"||h==="bottom")&&(t.verticalAlign=h);}let l=chunk3R7QHNI5_js.e(e,"w","textDirection");if(l){let h=chunk3R7QHNI5_js.j(l,"w","val");h&&(t.textDirection=h);}let f=chunk3R7QHNI5_js.e(e,"w","gridSpan");if(f){let h=chunk3R7QHNI5_js.l(f,"w","val");h!==void 0&&h>1&&(t.gridSpan=h);}let c=chunk3R7QHNI5_js.e(e,"w","vMerge");c&&(chunk3R7QHNI5_js.j(c,"w","val")==="restart"?t.vMerge="restart":t.vMerge="continue"),chunk3R7QHNI5_js.m(chunk3R7QHNI5_js.e(e,"w","tcFitText"))&&(t.fitText=true),chunk3R7QHNI5_js.m(chunk3R7QHNI5_js.e(e,"w","noWrap"))&&(t.noWrap=true),chunk3R7QHNI5_js.m(chunk3R7QHNI5_js.e(e,"w","hideMark"))&&(t.hideMark=true);let F=mt(chunk3R7QHNI5_js.e(e,"w","cnfStyle"));if(F&&(t.conditionalFormat=F),Object.keys(t).length!==0)return t}function Bn(e,t,n,o,r,a,u){let l=[],f=e.elements||[];for(let c of f){if(!c.name)continue;let p=c.name.split(":").pop();if(p==="p"){let d=Y(c,t,n,o,r,a,u);l.push(d);}else if(p==="tbl"){let d=ye(c,t,n,o,r,a,u);l.push(d);}}return l.length===0&&l.push({type:"paragraph",content:[]}),l}function vn(e,t,n,o,r,a,u){let l={type:"tableCell",content:[]},f=chunk3R7QHNI5_js.e(e,"w","tcPr"),c=gt(f);return c&&(l.formatting=c),l.propertyChanges=Rn(f,c),l.structuralChange=Pn(f),l.content=Bn(e,t,n,o,r,a,u),l}function Nn(e,t,n,o,r,a,u){let l={type:"tableRow",cells:[]},f=chunk3R7QHNI5_js.e(e,"w","trPr"),c=dt(f);c&&(l.formatting=c),l.propertyChanges=Mn(f,c),l.structuralChange=En(f);let p=chunk3R7QHNI5_js.f(e,"w","tc");for(let d of p){let y=vn(d,t,n,o,r,a,u);l.cells.push(y);}return l}function An(e){if(!e)return;let t=[],n=chunk3R7QHNI5_js.f(e,"w","gridCol");for(let o of n){let r=chunk3R7QHNI5_js.l(o,"w","w")??0;t.push(r);}if(!(t.length>0&&t.every(o=>o<=0)))return t.length>0?t:void 0}function Hn(e){return e.cells.reduce((t,n)=>t+(n.formatting?.gridSpan??1),0)}function In(e){let t=Math.max(e.columnWidths?.length??0,...e.rows.map(n=>Hn(n)));if(!(t<=1))for(let n of e.rows){if(n.cells.length!==1)continue;let o=n.cells[0];(o.formatting?.gridSpan??1)>=t||o.formatting?.vMerge||o.formatting?.gridSpan==null&&(o.formatting={...o.formatting??{},gridSpan:t});}}function ye(e,t,n,o,r,a,u){let l={type:"table",rows:[]},f=chunk3R7QHNI5_js.e(e,"w","tblPr"),c=pt(f);c&&(l.formatting=c),l.propertyChanges=Sn(f,c);let p=An(chunk3R7QHNI5_js.e(e,"w","tblGrid"));p&&(l.columnWidths=p);let d=chunk3R7QHNI5_js.f(e,"w","tr");for(let y of d){let F=Nn(y,t,n,o,r,a,u);l.rows.push(F);}return In(l),l}exports.A=co;exports.B=Qe;exports.C=wo;exports.D=yo;exports.E=K;exports.F=nt;exports.G=vo;exports.H=No;exports.I=Ao;exports.J=Ho;exports.K=Io;exports.L=Lo;exports.M=Xo;exports.N=xn;exports.O=Y;exports.a=Xn;exports.b=$;exports.c=Le;exports.d=W;exports.e=te;exports.f=ne;exports.g=oe;exports.h=he;exports.i=we;exports.j=Ct;exports.k=Ft;exports.l=xt;exports.m=kt;exports.n=St;exports.o=pt;exports.p=Pt;exports.q=q;exports.r=to;exports.s=no;exports.t=ao;exports.u=lo;exports.v=Ye;exports.w=Ke;exports.x=so;exports.y=uo;exports.z=fo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {d}from'./chunk-W77JXDEV.mjs';import {i,j,h,l,g,k as k$1,e as e$1}from'./chunk-3ANZ3252.mjs';
|
|
1
|
+
import {d}from'./chunk-W77JXDEV.mjs';import {e}from'./chunk-VW22RZ6C.mjs';import {i,j,h,l,g,k as k$1,e as e$1}from'./chunk-3ANZ3252.mjs';var pe={accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",dk1:"dk1",lt1:"lt1",dk2:"dk2",lt2:"lt2",tx1:"text1",tx2:"text2",bg1:"background1",bg2:"background2",hlink:"hlink",folHlink:"folHlink"},G={black:"000000",white:"FFFFFF",red:"FF0000",green:"00FF00",blue:"0000FF",yellow:"FFFF00",cyan:"00FFFF",magenta:"FF00FF"};function J(e,n){let t=i(n),i$1=t.find(r=>r.name==="a:shade");if(i$1){let r=j(i$1,null,"val");r&&(e.themeShade=Math.round(parseInt(r,10)/1e5*255).toString(16).padStart(2,"0").toUpperCase());}let o=t.find(r=>r.name==="a:tint");if(o){let r=j(o,null,"val");r&&(e.themeTint=Math.round(parseInt(r,10)/1e5*255).toString(16).padStart(2,"0").toUpperCase());}return e}function K(e){if(!e)return;let n=i(e),t=n.find(l=>l.name==="a:srgbClr");if(t){let l=j(t,null,"val");if(l)return J({rgb:l},t)}let i$1=n.find(l=>l.name==="a:schemeClr");if(i$1){let l=j(i$1,null,"val");if(l){let u={themeColor:pe[l]??"dk1"};return J(u,i$1)}}let o=n.find(l=>l.name==="a:sysClr");if(o)return {rgb:j(o,null,"lastClr")??"000000"};let r=n.find(l=>l.name==="a:prstClr");if(r){let l=j(r,null,"val");if(l&&G[l])return {rgb:G[l]}}}function N(e){if(!e)return;let n=i(e);if(n.find(i=>i.name==="a:noFill"))return {type:"none"};let t=n.find(i=>i.name==="a:solidFill");if(t)return {type:"solid",color:K(t)};if(n.find(i=>i.name==="a:gradFill"))return {type:"gradient"}}function S(e){let n=e?h(e,"a:ln"):null;if(!n)return;let t=i(n);if(t.find(u=>u.name==="a:noFill"))return;let i$1={},o=j(n,null,"w");o&&(i$1.width=parseInt(o,10));let r=t.find(u=>u.name==="a:solidFill");r&&(i$1.color=K(r));let l=t.find(u=>u.name==="a:prstDash");if(l){let u=j(l,null,"val");u&&(i$1.style=u);}return i$1}function L(e){if(!e)return;let n=j(e,null,"relativeFrom")??"column",t=h(e,"wp:align");if(t){let o=k$1(t);return {relativeTo:n,alignment:o}}let i=h(e,"wp:posOffset");if(i){let o=k$1(i),r=parseInt(o,10);return {relativeTo:n,posOffset:isNaN(r)?0:r}}return {relativeTo:n}}function z(e){if(!e)return;let n=j(e,null,"relativeFrom")??"paragraph",t=h(e,"wp:align");if(t){let o=k$1(t);return {relativeTo:n,alignment:o}}let i=h(e,"wp:posOffset");if(i){let o=k$1(i),r=parseInt(o,10);return {relativeTo:n,posOffset:isNaN(r)?0:r}}return {relativeTo:n}}function Q(e){let n=h(e,"wp:positionH"),t=h(e,"wp:positionV");if(!(!n&&!t))return {horizontal:L(n)??{relativeTo:"column"},vertical:z(t)??{relativeTo:"paragraph"}}}var W=["wp:wrapNone","wp:wrapSquare","wp:wrapTight","wp:wrapThrough","wp:wrapTopAndBottom"];function D(e,n,t){if(!e){let p={type:n?"behind":"inFront"};return t?.distT!==void 0&&(p.distT=t.distT),t?.distB!==void 0&&(p.distB=t.distB),t?.distL!==void 0&&(p.distL=t.distL),t?.distR!==void 0&&(p.distR=t.distR),p}let o=(e.name||"").replace("wp:",""),r;switch(o){case "wrapNone":r=n?"behind":"inFront";break;case "wrapSquare":r="square";break;case "wrapTight":r="tight";break;case "wrapThrough":r="through";break;case "wrapTopAndBottom":r="topAndBottom";break;default:r="square";}let l$1={type:r},u=j(e,null,"wrapText");u&&(l$1.wrapText=u);let s=l(e,null,"distT")??t?.distT,c=l(e,null,"distB")??t?.distB,m=l(e,null,"distL")??t?.distL,g=l(e,null,"distR")??t?.distR;return s!==void 0&&(l$1.distT=s),c!==void 0&&(l$1.distB=c),m!==void 0&&(l$1.distL=m),g!==void 0&&(l$1.distR=g),l$1}function Y(e){let n=i(e),t=j(e,null,"behindDoc")==="1",i$1=n.find(r=>W.includes(r.name??"")),o={distT:l(e,null,"distT")??void 0,distB:l(e,null,"distB")??void 0,distL:l(e,null,"distL")??void 0,distR:l(e,null,"distR")??void 0};return D(i$1??null,t,o)}var ce={accent1:"5B9BD5",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"4472C4",accent6:"70AD47",dk1:"000000",lt1:"FFFFFF",dk2:"1F497D",lt2:"EEECE1",text1:"000000",text2:"1F497D",background1:"FFFFFF",background2:"EEECE1",hlink:"0563C1",folHlink:"954F72"};function H(e){if(e){if(e.rgb)return `#${e.rgb}`;if(e.themeColor)return `#${ce[e.themeColor]??"000000"}`}}var k=91440;function Z(e){if(!e)return {};let n={},t=l(e,null,"lIns"),i=l(e,null,"rIns"),o=l(e,null,"tIns"),r=l(e,null,"bIns");return (t!==void 0||i!==void 0||o!==void 0||r!==void 0)&&(n.margins={left:t,right:i,top:o,bottom:r}),n}function ve(e){if(!e)return {paragraphElements:[],tableElements:[]};let n=g(e,"p"),t=g(e,"tbl");return {paragraphElements:n,tableElements:t}}function Be(e,n,t,i$1,o,r,l,u){if(!e)return [];let s=[],c=i(e);for(let m of c){let g=m.name||"",p=g.indexOf(":"),T=p>=0?g.substring(p+1):g;if(T==="p"){let b=n(m,i$1,o,r,l);s.push(b);}}return s}function ee(e){let t=i(e).find(u=>u.name==="wp:inline"||u.name==="wp:anchor");if(!t)return false;let i$1=h(t,"a:graphic");if(!i$1)return false;let o=h(i$1,"a:graphicData");if(!o)return false;let r=h(o,"wps:wsp");return r?h(r,"wps:txbx")!==null:false}function Ce(e){return h(e,"wps:txbx")!==null}function Me(e){let t=i(e).find(x=>x.name==="wp:inline"||x.name==="wp:anchor");if(!t)return null;let i$1=t.name==="wp:anchor",o=h(t,"a:graphic");if(!o)return null;let r=h(o,"a:graphicData");if(!r)return null;let l$1=h(r,"wps:wsp");if(!l$1||!h(l$1,"wps:txbx"))return null;let s=i(l$1),c=s.find(x=>x.name==="wps:spPr"),m=s.find(x=>x.name==="wps:bodyPr"),g=h(t,"wp:extent"),p=l(g,null,"cx")??0,T=l(g,null,"cy")??0,b={width:p,height:T},C=h(t,"wp:docPr"),P=C?j(C,null,"id")??void 0:void 0,v=N(c??null),B=S(c??null),E=Z(m??null),y={type:"textBox",size:b,content:[]};if(P&&(y.id=P),v&&(y.fill=v),B&&(y.outline=B),E.margins&&(y.margins=E.margins),i$1){let x=Q(t);x&&(y.position=x);let h=Y(t);h&&(y.wrap=h);}return y}function Re(e){let n=h(e,"wps:txbx");return n?h(n,"w:txbxContent"):null}function Xe(e,n,t,i$1){if(!h(e,"wps:txbx"))return null;let r=i(e),l=r.find(b=>b.name==="wps:spPr"),u=r.find(b=>b.name==="wps:bodyPr"),s=r.find(b=>b.name==="wps:cNvPr"),c=s?j(s,null,"id")??void 0:void 0,m=N(l??null),g=S(l??null),p=Z(u??null),T={type:"textBox",size:n,content:[]};return c&&(T.id=c),m&&(T.fill=m),g&&(T.outline=g),p.margins&&(T.margins=p.margins),t&&(T.position=t),i$1&&(T.wrap=i$1),T}function ke(e$1){return e(e$1.size.width)}function Ae(e$1){return e(e$1.size.height)}function Oe(e$1){return {width:e(e$1.size.width),height:e(e$1.size.height)}}function Ne(e$1){let n=e$1.margins;return {top:e(n?.top??k),bottom:e(n?.bottom??k),left:e(n?.left??k),right:e(n?.right??k)}}function Se(e){return e.position!==void 0||e.wrap!==void 0}function Le(e){return e.fill!==void 0&&e.fill.type!=="none"}function ze(e){return e.outline!==void 0}function We(e){return e.content.length>0}function De(e){let n=[];for(let t of e.content){let i=[];for(let o of t.content)if(o.type==="run")for(let r of o.content)r.type==="text"&&i.push(r.text);n.push(i.join(""));}return n.join(`
|
|
2
2
|
`)}function He(e){if(!(!e.fill||e.fill.type!=="solid"))return H(e.fill.color)}function Ve(e){if(e.outline?.color)return H(e.outline.color)}function _e(e$1){return e$1.outline?.width?e(e$1.outline.width):0}function me(e){if(!e)return;let n=parseInt(e,10);if(!isNaN(n))return n/6e4}function ge(e,n){let t=i(e);for(let i of t)if(n.includes(i.name||""))return i;return null}function ne(e){if(!e)return {width:0,height:0};let n=l(e,null,"cx")??0,t=l(e,null,"cy")??0;return {width:n,height:t}}function te(e){if(!e)return;let n=l(e,null,"l")??0,t=l(e,null,"t")??0,i=l(e,null,"r")??0,o=l(e,null,"b")??0;if(!(n===0&&t===0&&i===0&&o===0))return {left:n,top:t,right:i,bottom:o}}function ie(e){if(!e)return {};let n=j(e,null,"id")??void 0,t=j(e,null,"name")??void 0,i=j(e,null,"descr")??void 0,o=j(e,null,"title")??void 0,r=j(e,null,"decorative")==="1",l=e$1(e,"a","hlinkClick"),u=l?j(l,"r","id")??void 0:void 0;return {id:n,name:t,alt:i,title:o,decorative:r||void 0,hlinkRId:u}}function re(e){if(!e)return;let n=j(e,null,"rot"),t=j(e,null,"flipH")==="1",i=j(e,null,"flipV")==="1",o=me(n);if(o===void 0&&!t&&!i)return;let r={};return o!==void 0&&(r.rotation=o),t&&(r.flipH=true),i&&(r.flipV=true),r}function oe(e){let n=h(e,"a:graphic");if(!n)return {blipFill:null,blip:null};let t=h(n,"a:graphicData");if(!t)return {blipFill:null,blip:null};let i=h(t,"pic:pic");if(!i)return {blipFill:null,blip:null};let o=h(i,"pic:blipFill");return o?{blipFill:o,blip:h(o,"a:blip")}:{blipFill:null,blip:null}}function le(e){if(!e)return;let n=h(e,"a:srcRect");if(!n)return;let t=s=>{let c=l(n,null,s);if(!(c===void 0||c===0))return c/1e5},i=t("l"),o=t("t"),r=t("r"),l$1=t("b");if(i===void 0&&o===void 0&&r===void 0&&l$1===void 0)return;let u={};return i!==void 0&&(u.left=i),o!==void 0&&(u.top=o),r!==void 0&&(u.right=r),l$1!==void 0&&(u.bottom=l$1),u}function ae(e){if(!e)return;let n=h(e,"a:alphaModFix");if(!n)return;let t=l(n,null,"amt");if(!(t===void 0||t>=1e5))return Math.max(0,Math.min(1,t/1e5))}function se(e){if(!e)return "";let n=j(e,"r","embed");if(n)return n;let t=j(e,null,"embed");if(t)return t;let i=j(e,"r","link");return i||""}function ue(e){let n=h(e,"a:graphic");if(!n)return null;let t=h(n,"a:graphicData");if(!t)return null;let i=h(t,"pic:pic");if(!i)return null;let o=h(i,"pic:spPr");return o?h(o,"a:xfrm"):null}function xe(e){if(!e)return e;let n=e.replace(/^\/+/,"");return n.startsWith("media/")?n=`word/${n}`:n.startsWith("word/")||(n=`word/${n}`),n}function he(e){let n=e.split(".").pop()?.toLowerCase()??"";return {png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",tiff:"image/tiff",tif:"image/tiff",webp:"image/webp",svg:"image/svg+xml",emf:"image/x-emf",wmf:"image/x-wmf"}[n]??"application/octet-stream"}function de(e,n,t){if(!e||!n)return {};let i=n.get(e);if(!i)return {};let o=i.target;if(!o)return {};let r=xe(o),l=o.split("/").pop(),u=(s,c)=>{let m=c.toLowerCase();for(let[g,p]of s.entries())if(g.toLowerCase()===m)return p};if(t){let s=u(t,r);if(s)return {src:s.dataUrl||s.base64,mimeType:s.mimeType,filename:l};let c=o.replace(/^\/+/,""),m=u(t,c);if(m)return {src:m.dataUrl||m.base64,mimeType:m.mimeType,filename:l};let g=`word/${c}`,p=u(t,g);if(p)return {src:p.dataUrl||p.base64,mimeType:p.mimeType,filename:l}}return {mimeType:he(o),filename:l}}function Te(e,n,t){let i=h(e,"wp:extent"),o=ne(i),r=h(e,"wp:effectExtent"),l$1=te(r),u=h(e,"wp:docPr"),s=ie(u),{blip:c,blipFill:m}=oe(e),g=se(c),p=le(m),T=ae(c),b=de(g,n,t),C=ue(e),P=re(C),v=l(e,null,"distT")??void 0,B=l(e,null,"distB")??void 0,E=l(e,null,"distL")??void 0,y=l(e,null,"distR")??void 0,x={type:"inline"};v!==void 0&&(x.distT=v),B!==void 0&&(x.distB=B),E!==void 0&&(x.distL=E),y!==void 0&&(x.distR=y);let h$1={type:"image",rId:g,size:o,wrap:x};if(s.id&&(h$1.id=s.id),s.alt&&(h$1.alt=s.alt),s.title&&(h$1.title=s.title),s.decorative&&(h$1.decorative=true),b.src&&(h$1.src=b.src),b.mimeType&&(h$1.mimeType=b.mimeType),b.filename&&(h$1.filename=b.filename),l$1&&(h$1.padding=l$1),P&&(h$1.transform=P),p&&(h$1.crop=p),T!==void 0&&(h$1.opacity=T),s.hlinkRId&&n){let X=d(n,s.hlinkRId);X&&(h$1.hlinkHref=X);}return h$1}function be(e,n,t){let i=h(e,"wp:extent"),o=ne(i),r=h(e,"wp:effectExtent"),l$1=te(r),u=h(e,"wp:docPr"),s=ie(u),c=j(e,null,"behindDoc")==="1",m=j(e,null,"layoutInCell"),g=m===null?void 0:m==="1",p=j(e,null,"allowOverlap"),T=p===null?void 0:p==="1",b={distT:l(e,null,"distT")??void 0,distB:l(e,null,"distB")??void 0,distL:l(e,null,"distL")??void 0,distR:l(e,null,"distR")??void 0},C=ge(e,W),P=D(C,c,b),v=h(e,"wp:positionH"),B=h(e,"wp:positionV"),E=L(v),y=z(B),x;(E||y)&&(x={horizontal:E??{relativeTo:"column"},vertical:y??{relativeTo:"paragraph"}});let{blip:h$1,blipFill:X}=oe(e),V=se(h$1),_=le(X),U=ae(h$1),M=de(V,n,t),fe=ue(e),j$1=re(fe),I={type:"image",rId:V,size:o,wrap:P};if(s.id&&(I.id=s.id),s.alt&&(I.alt=s.alt),s.title&&(I.title=s.title),s.decorative&&(I.decorative=true),M.src&&(I.src=M.src),M.mimeType&&(I.mimeType=M.mimeType),M.filename&&(I.filename=M.filename),x&&(I.position=x),l$1&&(I.padding=l$1),j$1&&(I.transform=j$1),_&&(I.crop=_),U!==void 0&&(I.opacity=U),g!==void 0&&(I.layoutInCell=g),T!==void 0&&(I.allowOverlap=T),s.hlinkRId&&n){let q=d(n,s.hlinkRId);q&&(I.hlinkHref=q);}return I}function we(e,n,t){if(ee(e))return null;let i$1=i(e);for(let o of i$1){let r=o.name||"";if(r==="wp:inline"||r==="wp:anchor")return r==="wp:inline"?Te(o,n,t):be(o,n,t)}return null}function Qe(e,n,t){return we(e,n,t)}function Ye(e){return e.wrap.type==="inline"}function Ze(e){return e.wrap.type!=="inline"}function en(e){return e.wrap.type==="behind"}function nn(e){return e.wrap.type==="inFront"}function tn(e$1){return e(e$1.size.width)}function rn(e$1){return e(e$1.size.height)}function on(e){return e.decorative===true}function ln(e$1){return {top:e(e$1.wrap.distT),bottom:e(e$1.wrap.distB),left:e(e$1.wrap.distL),right:e(e$1.wrap.distR)}}export{Ye as A,Ze as B,en as C,nn as D,tn as E,rn as F,on as G,ln as H,K as a,N as b,Q as c,Y as d,H as e,ve as f,Be as g,ee as h,Ce as i,Me as j,Re as k,Xe as l,ke as m,Ae as n,Oe as o,Ne as p,Se as q,Le as r,ze as s,We as t,De as u,He as v,Ve as w,_e as x,we as y,Qe as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkIMKU4O3P_js=require('./chunk-IMKU4O3P.js'),chunkDROCYKAR_js=require('./chunk-DROCYKAR.js'),chunkAA6D2C6R_js=require('./chunk-AA6D2C6R.js'),chunkMJ5FQX7Q_js=require('./chunk-MJ5FQX7Q.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js'),chunkH57LNDBH_js=require('./chunk-H57LNDBH.js');function B(e,a){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,a):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},a));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=chunk4Q2IP5FW_js.j(n.position)),n.scale!=null&&n.scale!==100&&(r.horizontalScale=n.scale),n.kerning!=null&&n.kerning>0&&(r.kerningMinPt=chunk4Q2IP5FW_js.k(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;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 U(e){let a=e.defaultTextFormatting;if(!a)return {};let r={};if(a.fontFamily){let t=a.fontFamily.ascii||a.fontFamily.hAnsi;t&&(r.fontFamily=t);}return a.fontSize!=null&&(r.fontSize=a.fontSize/2),r}function E(e){e.hyperlink&&(e.hyperlink={...e.hyperlink,noDefaultStyle:true},delete e.color,delete e.underline);}function G(e){return e==="contentLocked"||e==="sdtContentLocked"}function $(e,a){let r=e.attrs;if(r.sdtType==="checkbox"&&!(G(r.lock)||r.dataBinding!=null))return {kind:"checkbox",groupId:`sdt@${a}`,pos:a,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 D(e,a,r){let t=[],n=a+1,i=r.theme,l=U(e.attrs),m=e.attrs.styleId,c=typeof m=="string"&&/^TOC\d*$/i.test(m);function g(d,f,s){if(d.isText&&d.text){let o=B(d.marks,i);c&&E(o);let u={kind:"text",text:d.text,...l,...o,pmStart:f,pmEnd:f+d.nodeSize,inlineSdtWidget:s};t.push(u);}else if(d.type.name==="hardBreak")t.push({kind:"lineBreak",pmStart:f,pmEnd:f+d.nodeSize});else if(d.type.name==="tab"){let o=B(d.marks,i),u={kind:"tab",...l,...o,pmStart:f,pmEnd:f+d.nodeSize};t.push(u);}else if(d.type.name==="image"){let o=d.attrs,u=chunkIMKU4O3P_js.b(o.width||100,o.height||100,r.pageContentHeight),b=B(d.marks,i),h={kind:"image",src:o.src,width:u.width,height:u.height,alt:o.alt,transform:o.transform,wrapType:o.wrapType,displayMode:o.displayMode,cssFloat:o.cssFloat,distTop:o.distTop,distBottom:o.distBottom,distLeft:o.distLeft,distRight:o.distRight,position:o.position,cropTop:o.cropTop,cropRight:o.cropRight,cropBottom:o.cropBottom,cropLeft:o.cropLeft,opacity:o.opacity,isInsertion:b.isInsertion,isDeletion:b.isDeletion,changeAuthor:b.changeAuthor,changeDate:b.changeDate,changeRevisionId:b.changeRevisionId,pmStart:f,pmEnd:f+d.nodeSize};t.push(h);}else if(d.type.name==="field"){let o=d.attrs.fieldType,u=o==="PAGE"?"PAGE":o==="NUMPAGES"?"NUMPAGES":o==="DATE"?"DATE":o==="TIME"?"TIME":"OTHER",b=B(d.marks,i);c&&E(b),t.push({kind:"field",fieldType:u,fallback:d.attrs.displayText||"",...l,...b,pmStart:f,pmEnd:f+d.nodeSize});}else if(d.type.name==="math"){let o=d.attrs.plainText||"[equation]";t.push({kind:"text",text:o,italic:true,fontFamily:"Cambria Math",pmStart:f,pmEnd:f+d.nodeSize});}else if(d.type.name==="sdt"){let o=$(d,f)??s,u=f+1;d.forEach((b,h)=>{g(b,u+h,o);});}}return e.forEach((d,f)=>{g(d,n+f);}),t}function Y(e){return Math.max(1,Math.round(e/8*1.333))}var j={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,a){if(!e||!e.style||e.style==="none"||e.style==="nil")return;let r={style:j[e.style]||"solid",width:Y(e.size??0),color:e.color?chunkMJ5FQX7Q_js.a(e.color,a):"#000000"};return e.space!==void 0&&(r.space=chunk4Q2IP5FW_js.i(e.space)),r}function N(e,a){let r=e.borders;if(!r)return;let t={},n=["top","bottom","left","right"];for(let i of n){let l=r[i],m=l?w(l,a):void 0;t[i]=m??{width:0,style:"none"};}return Object.keys(t).length>0?t:void 0}function Z(e,a){let r=[];for(let t=0;t<=a;t+=1){let n=e[t]??0;if(n<=0)break;r.push(n);}return r.length===0?"1.":`${r.join(".")}.`}var V=[[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 O(e,a){if(e<=0)return "";let r=e,t="";for(let[n,i]of V)for(;r>=n;)t+=i,r-=n;return a?t:t.toLowerCase()}function W(e,a){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 a?t:t.toLowerCase()}function q(e,a){if(e<=0)return "";switch(a){case "upperRoman":return O(e,true);case "lowerRoman":return O(e,false);case "upperLetter":return W(e,true);case "lowerLetter":return W(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 H(e,a,r){return e.replace(/%(\d)([.):\]])?/g,(t,n,i="")=>{let l=parseInt(n,10)-1;if(l<0)return "";let m=a[l]??0,c=r?.[l]??"decimal",g=q(m,c);return g?g+i:""})}function X(e,a,r){let t=e.numPr;if(!t)return null;let n=t.numId;if(n==null||n===0)return null;if(e.listIsBullet)return chunkAA6D2C6R_js.p(e.listMarker||"");let i=t.ilvl??0;if((e.listLevelNumFmts?.[i]??e.listNumFmt)==="none")return e.listMarker?e.listMarker:null;let m=e.listAbstractNumId??n,c=a.get(m)??new Array(9).fill(0),g=`${n}:${i}`;r.has(g)||(r.add(g),e.listStartOverride!=null&&(c[i]=e.listStartOverride-1)),c[i]=(c[i]??0)+1;for(let d=i+1;d<c.length;d+=1)c[d]=0;return a.set(m,c),e.listMarker&&e.listMarker.includes("%")?H(e.listMarker,c,e.listLevelNumFmts??void 0):e.listMarker?e.listMarker:Z(c,i)}var K="Calibri",J=11;function Q(e,a,r,t,n){let i={};if(e.alignment){let s=e.alignment;s==="both"||s==="distribute"?i.alignment="justify":s==="left"?i.alignment="left":s==="center"?i.alignment="center":s==="right"&&(i.alignment="right");}(e.spaceBefore!=null||e.spaceAfter!=null||e.lineSpacing!=null)&&(i.spacing={},e.spaceBefore!=null&&(i.spacing.before=chunkIMKU4O3P_js.a(e.spaceBefore)),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 l=e.indentLeft,m=e.indentFirstLine,c=e.hangingIndent;if(e.numPr?.numId&&l==null&&(l=((e.numPr.ilvl??0)+1)*720,m==null&&(m=-360,c=true)),(l!=null||e.indentRight!=null||m!=null)&&(i.indent={},l!=null&&(i.indent.left=chunkIMKU4O3P_js.a(l)),e.indentRight!=null&&(i.indent.right=chunkIMKU4O3P_js.a(e.indentRight)),m!=null&&(c?i.indent.hanging=Math.abs(chunkIMKU4O3P_js.a(m)):i.indent.firstLine=chunkIMKU4O3P_js.a(m))),e.styleId&&(i.styleId=e.styleId),e.borders){let s=e.borders;i.borders={};let o=u=>u?w(u,a):void 0;s.top&&(i.borders.top=o(s.top)),s.bottom&&(i.borders.bottom=o(s.bottom)),s.left&&(i.borders.left=o(s.left)),s.right&&(i.borders.right=o(s.right)),s.between&&(i.borders.between=o(s.between)),s.bar&&(i.borders.bar=o(s.bar)),!i.borders.top&&!i.borders.bottom&&!i.borders.left&&!i.borders.right&&!i.borders.between&&!i.borders.bar&&delete i.borders;}let g=chunkMJ5FQX7Q_js.b(e.shading?.fill,a);g&&(i.shading=`#${g}`),e.tabs&&e.tabs.length>0&&(i.tabs=e.tabs.map(s=>({val:A(s.alignment),pos:s.position,leader:s.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 d=r&&t?X(e,r,t):null;d!=null?i.listMarker=d: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 f=e.defaultTextFormatting;if(f&&(f.fontSize!=null&&(i.defaultFontSize=f.fontSize/2),f.fontFamily&&(i.defaultFontFamily=f.fontFamily.ascii||f.fontFamily.hAnsi)),e.pPrIns&&(i.pPrIns=e.pPrIns),e.pPrDel&&(i.pPrDel=e.pPrDel),e.numPr){let s=e.pPrChange,o=Array.isArray(s)&&s.some(u=>!u?.previousFormatting?.numPr);e.pPrDel?i.listMarkerRevision="del":(e.pPrIns||o)&&(i.listMarkerRevision="ins");}return i}function A(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,a,r){let t=e.attrs,n=D(e,a,r),i=Q(t,r.theme,r.listCounters,r.listSeenNumIds,r.defaultTabStopTwips);return {kind:"paragraph",id:chunkIMKU4O3P_js.c(),runs:n,attrs:i,pmStart:a,pmEnd:a+e.nodeSize}}function ee(e,a,r,t){let n=[],i=a+1;e.forEach(u=>{u.type.name==="paragraph"?n.push(M(u,i,r)):u.type.name==="table"&&n.push(_(u,i,r)),i+=u.nodeSize;});let l=e.attrs,m=l.width,c=l.widthType,g=m&&(!c||c==="dxa"||c==="auto")?chunkIMKU4O3P_js.a(m):void 0,d=l.margins,f=(u,b)=>{if(u!=null){let h=chunkIMKU4O3P_js.a(u);if(h>0)return h}if(b!=null){let h=chunkIMKU4O3P_js.a(b);if(h>=0)return h}return 0},s={top:f(d?.top,t?.top),right:f(d?.right,t?.right),bottom:f(d?.bottom,t?.bottom),left:f(d?.left,t?.left)},o=l.cellMarker;return {id:chunkIMKU4O3P_js.c(),blocks:n,colSpan:l.colspan,rowSpan:l.rowspan,width:g,widthValue:m,widthType:c,verticalAlign:l.verticalAlign,background:l.backgroundColor?`#${l.backgroundColor}`:void 0,borders:N(l,r.theme),padding:s,noWrap:l.noWrap||void 0,trackedMarker:o??void 0}}function te(e,a,r,t){let n=[],i=a+1;e.forEach(c=>{(c.type.name==="tableCell"||c.type.name==="tableHeader")&&n.push(ee(c,i,r,t)),i+=c.nodeSize;});let l=e.attrs,m=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:m?.cantSplit||void 0,trackedIns:l.trIns??void 0,trackedDel:l.trDel??void 0}}function _(e,a,r){let t=[],n=a+1,i=e.attrs.cellMargins;e.forEach(b=>{b.type.name==="tableRow"&&t.push(te(b,n,r,i)),n+=b.nodeSize;});let m=e.attrs.columnWidths?.map(chunkIMKU4O3P_js.a),c=e.attrs.width,g=e.attrs.widthType;if(!m&&t.length>0){let h=t[0].cells.map(k=>k.width);h.every(k=>k!==void 0&&k>0)&&(m=h);}let d=e.attrs.justification,f=e.attrs._originalFormatting,s=f?.indent?.value&&f.indent.type==="dxa"?chunkIMKU4O3P_js.a(f.indent.value):void 0,o=e.attrs.floating,u=o?{horzAnchor:o.horzAnchor,vertAnchor:o.vertAnchor,tblpX:o.tblpX!==void 0?chunkIMKU4O3P_js.a(o.tblpX):void 0,tblpXSpec:o.tblpXSpec,tblpY:o.tblpY!==void 0?chunkIMKU4O3P_js.a(o.tblpY):void 0,tblpYSpec:o.tblpYSpec,topFromText:o.topFromText!==void 0?chunkIMKU4O3P_js.a(o.topFromText):void 0,bottomFromText:o.bottomFromText!==void 0?chunkIMKU4O3P_js.a(o.bottomFromText):void 0,leftFromText:o.leftFromText!==void 0?chunkIMKU4O3P_js.a(o.leftFromText):void 0,rightFromText:o.rightFromText!==void 0?chunkIMKU4O3P_js.a(o.rightFromText):void 0}:void 0;return {kind:"table",id:chunkIMKU4O3P_js.c(),rows:t,columnWidths:m,width:c,widthType:g,justification:d,indent:s,floating:u,pmStart:a,pmEnd:a+e.nodeSize}}function ne(e,a,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:a,pmEnd:a+e.nodeSize}}function re(e,a,r){let t=e.attrs,n=[];return e.forEach((i,l)=>{if(i.type.name==="paragraph"){let m=M(i,a+1+l,r);n.push(m);}}),{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:a,pmEnd:a+e.nodeSize}}function Se(e,a={}){let r=e.attrs?.defaultTabStopTwips,t={...a,defaultFont:a.defaultFont??K,defaultSize:a.defaultSize??J,defaultTabStopTwips:a.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 m=(c,g,d)=>{if(c.type.name==="blockSdt"){let s=c.attrs,o={id:`sdt@${g}`,sdtType:typeof s.sdtType=="string"?s.sdtType:"richText",tag:s.tag!=null?String(s.tag):void 0,alias:s.alias!=null?String(s.alias):void 0,lock:s.lock!=null?String(s.lock):void 0,checked:typeof s.checked=="boolean"?s.checked:void 0,bound:s.dataBinding!=null?true:void 0,repeatingItem:/<w15:repeatingSectionItem[\s/>]/.test(String(s.rawPropertiesXml??""))?true:void 0},u=[...d,o];c.forEach((b,h)=>{m(b,g+1+h,u);});return}let f=n.length;switch(c.type.name){case "paragraph":{let s=M(c,g,t),o=c.attrs;n.push(s);let u=o._sectionProperties;if(u||o.sectionBreakType){let b={kind:"sectionBreak",id:chunkIMKU4O3P_js.c(),type:u?.sectionStart??o.sectionBreakType};if(u){if((u.pageWidth!==void 0||u.pageHeight!==void 0)&&(b.pageSize={w:chunkIMKU4O3P_js.a(u.pageWidth??12240),h:chunkIMKU4O3P_js.a(u.pageHeight??15840)}),u.marginTop!==void 0||u.marginBottom!==void 0||u.marginLeft!==void 0||u.marginRight!==void 0){let k={top:u.marginTop??l.top,bottom:u.marginBottom??l.bottom,left:u.marginLeft??l.left,right:u.marginRight??l.right};b.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=u.columnCount??1;if(h>1){let k={count:h,gap:chunkIMKU4O3P_js.a(u.columnSpace??720),equalWidth:u.equalWidth??true,separator:u.separator};b.columns=k;}}n.push(b);}}break;case "table":n.push(_(c,g,t));break;case "image":n.push(ne(c,g,t.pageContentHeight));break;case "textBox":n.push(re(c,g,t));break;case "horizontalRule":case "pageBreak":{let s={kind:"pageBreak",id:chunkIMKU4O3P_js.c(),pmStart:g,pmEnd:g+c.nodeSize};n.push(s);break}}if(d.length>0)for(let s=f;s<n.length;s++)n[s].sdtGroups=d;};return e.forEach((c,g)=>{m(c,i+g,[]);}),n}exports.a=w;exports.b=H;exports.c=Se;
|