@zeke-02/docx-editor-core 0.1.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/LICENSE +201 -0
- package/README.md +89 -0
- package/dist/ImageExtension-BN327PNe.d.mts +38 -0
- package/dist/ImageExtension-BlI5afZD.d.ts +38 -0
- package/dist/Subscribable-DOz6Ohoo.d.mts +33 -0
- package/dist/Subscribable-DOz6Ohoo.d.ts +33 -0
- package/dist/agent/index.d.mts +168 -0
- package/dist/agent/index.d.ts +168 -0
- package/dist/agent/index.js +1 -0
- package/dist/agent/index.mjs +1 -0
- package/dist/borders-BH_GoYU3.d.mts +58 -0
- package/dist/borders-Z9hPno2u.d.ts +58 -0
- package/dist/chunk-2HFQ4QTU.js +1 -0
- package/dist/chunk-2KHWHVTA.js +1 -0
- package/dist/chunk-2MSZXH6Q.mjs +2 -0
- package/dist/chunk-3COGZG7O.mjs +1 -0
- package/dist/chunk-3NRMSZX2.mjs +1 -0
- package/dist/chunk-3SXJPJSV.mjs +1 -0
- package/dist/chunk-44FHVKSI.js +1 -0
- package/dist/chunk-4BFNWPKW.js +1 -0
- package/dist/chunk-4G6AJ4ZM.js +1 -0
- package/dist/chunk-4GER4JLW.js +1 -0
- package/dist/chunk-4Q2IP5FW.js +1 -0
- package/dist/chunk-56D223FM.mjs +1 -0
- package/dist/chunk-5VBNOHRE.mjs +1 -0
- package/dist/chunk-67LVRQIR.mjs +1 -0
- package/dist/chunk-6LVPRTB6.js +1 -0
- package/dist/chunk-6NQSIC27.mjs +1 -0
- package/dist/chunk-6Y6LON6Y.mjs +1 -0
- package/dist/chunk-6ZXL3EIP.mjs +2 -0
- package/dist/chunk-7AMYZMCX.js +1 -0
- package/dist/chunk-7E5VBRDL.mjs +1 -0
- package/dist/chunk-7HANRHHL.js +1 -0
- package/dist/chunk-7LRR7RKE.mjs +15 -0
- package/dist/chunk-7RDCZLTU.js +1 -0
- package/dist/chunk-7U4I6BKJ.js +1 -0
- package/dist/chunk-7Z2AGPNQ.mjs +10 -0
- package/dist/chunk-AAPBAMD7.js +1 -0
- package/dist/chunk-AGVFAXVQ.mjs +9 -0
- package/dist/chunk-AMENZY5F.mjs +1 -0
- package/dist/chunk-ARHPXIBJ.mjs +1 -0
- package/dist/chunk-BGY3CB37.mjs +1 -0
- package/dist/chunk-BHBOAP6Z.js +3 -0
- package/dist/chunk-BOOHU5EW.mjs +1 -0
- package/dist/chunk-C2BAPYGJ.js +1 -0
- package/dist/chunk-CGJ6S3AH.mjs +1 -0
- package/dist/chunk-CKKO4JWE.mjs +1 -0
- package/dist/chunk-CTHHUJAB.mjs +2 -0
- package/dist/chunk-CUY2THAO.mjs +1 -0
- package/dist/chunk-CXQDYR2Y.js +1 -0
- package/dist/chunk-D4RPOJC7.js +1 -0
- package/dist/chunk-D6GO7UGD.mjs +1 -0
- package/dist/chunk-DC7S76ZX.js +1 -0
- package/dist/chunk-DROCYKAR.js +1 -0
- package/dist/chunk-DV6GWBUJ.js +2 -0
- package/dist/chunk-DZYYLV2O.js +1 -0
- package/dist/chunk-E4JMCA5X.js +2 -0
- package/dist/chunk-ERNVFCGN.js +59 -0
- package/dist/chunk-ESI4BSBF.js +1 -0
- package/dist/chunk-F44ZLDZS.js +4 -0
- package/dist/chunk-FCJWLEKT.mjs +1 -0
- package/dist/chunk-FDEDN2RC.mjs +0 -0
- package/dist/chunk-FRYMBAHP.js +3 -0
- package/dist/chunk-FWTP7BN7.mjs +4 -0
- package/dist/chunk-G3YJ5RKC.mjs +1 -0
- package/dist/chunk-GGPKPXON.js +1 -0
- package/dist/chunk-HKVAW3RE.js +1 -0
- package/dist/chunk-HQPWFUP5.js +2 -0
- package/dist/chunk-I6PMX4BO.js +1 -0
- package/dist/chunk-ILJUDEZ5.mjs +1 -0
- package/dist/chunk-IMKU4O3P.js +1 -0
- package/dist/chunk-IP2VXNWG.js +1 -0
- package/dist/chunk-J4J2Y6EU.js +10 -0
- package/dist/chunk-J7NADDC4.mjs +1 -0
- package/dist/chunk-JFZIXFRC.js +1 -0
- package/dist/chunk-JHZ3HLSR.mjs +1 -0
- package/dist/chunk-JY5EFI4D.js +1 -0
- package/dist/chunk-JZESIPVC.mjs +3 -0
- package/dist/chunk-K7GVLZS6.mjs +1 -0
- package/dist/chunk-KESNGXGO.js +1 -0
- package/dist/chunk-KQTB5Y7P.mjs +1 -0
- package/dist/chunk-L2U3TTAD.js +9 -0
- package/dist/chunk-LBKMYD3M.mjs +1 -0
- package/dist/chunk-LCICADWM.js +2 -0
- package/dist/chunk-LE67NTCN.mjs +1 -0
- package/dist/chunk-LTHT4A4S.js +1 -0
- package/dist/chunk-MCFHOMA2.js +2 -0
- package/dist/chunk-MCX4GVRX.mjs +1 -0
- package/dist/chunk-MJ5FQX7Q.js +1 -0
- package/dist/chunk-MJ6XZFVD.mjs +1 -0
- package/dist/chunk-MNOHUTKE.js +15 -0
- package/dist/chunk-MOKKS75W.mjs +3 -0
- package/dist/chunk-MP4QSEO2.mjs +1 -0
- package/dist/chunk-MVZOTKNL.mjs +1 -0
- package/dist/chunk-MZ7LW5CH.js +1 -0
- package/dist/chunk-MZOVDLYL.js +1 -0
- package/dist/chunk-N3Y5BUKV.js +1 -0
- package/dist/chunk-NBLJPT54.mjs +1 -0
- package/dist/chunk-NDDJ67FQ.mjs +1 -0
- package/dist/chunk-NMUHXIF5.js +1 -0
- package/dist/chunk-NXLJVVVE.js +1 -0
- package/dist/chunk-OBMN4VSM.mjs +1 -0
- package/dist/chunk-OCAX2KJQ.js +4 -0
- package/dist/chunk-OEXVWIHW.mjs +2 -0
- package/dist/chunk-OZMNIX6U.mjs +1 -0
- package/dist/chunk-PRRM64JO.mjs +1 -0
- package/dist/chunk-PXE2OWEA.mjs +1 -0
- package/dist/chunk-Q4CKLXWA.js +1 -0
- package/dist/chunk-Q5QOBZWT.mjs +1 -0
- package/dist/chunk-QJJQ53V6.mjs +1 -0
- package/dist/chunk-QLPQVR5W.mjs +1 -0
- package/dist/chunk-QLX4HX3I.mjs +59 -0
- package/dist/chunk-QPFJJPIC.mjs +1 -0
- package/dist/chunk-QYUPLKLP.mjs +1 -0
- package/dist/chunk-RFC2SXZ6.mjs +4 -0
- package/dist/chunk-RNOXNNSD.mjs +0 -0
- package/dist/chunk-RPIQG46O.mjs +1 -0
- package/dist/chunk-RQN4C636.js +1 -0
- package/dist/chunk-SHJBS42Y.js +1 -0
- package/dist/chunk-SORYYVJ7.js +1 -0
- package/dist/chunk-SWC6T7YQ.js +1 -0
- package/dist/chunk-TE2AF7FM.js +1 -0
- package/dist/chunk-TE2VQJZG.js +1 -0
- package/dist/chunk-TUIEV7Q7.js +1 -0
- package/dist/chunk-U4UCHBZ7.js +1 -0
- package/dist/chunk-U74VPTIU.js +1 -0
- package/dist/chunk-UCJGOQ4J.mjs +1 -0
- package/dist/chunk-UQ6WNWXX.js +1 -0
- package/dist/chunk-VHUVPHPI.mjs +1 -0
- package/dist/chunk-VQWZHPWI.mjs +1 -0
- package/dist/chunk-VW22RZ6C.mjs +1 -0
- package/dist/chunk-WLHNIXWC.mjs +2 -0
- package/dist/chunk-WLKRUBY4.js +1 -0
- package/dist/chunk-WTFLNYAT.mjs +1 -0
- package/dist/chunk-XNDGWWDT.js +1 -0
- package/dist/chunk-XXU7YQVV.js +1 -0
- package/dist/chunk-Y74ANBPV.js +1 -0
- package/dist/chunk-YMZ3F2FZ.mjs +1 -0
- package/dist/chunk-YTDWMXNS.js +1 -0
- package/dist/chunk-YUZQTRI2.js +1 -0
- package/dist/chunk-ZX26QZJ5.mjs +1 -0
- package/dist/chunk-ZY7EMTZ3.mjs +1 -0
- package/dist/colorResolver-BZ_yScf4.d.ts +390 -0
- package/dist/colorResolver-C6DtsoFI.d.mts +390 -0
- package/dist/colors-C3vA7HUU.d.mts +70 -0
- package/dist/colors-C3vA7HUU.d.ts +70 -0
- package/dist/content-5Mrz6w_b.d.mts +1360 -0
- package/dist/content-CmqAwdFL.d.ts +1360 -0
- package/dist/core-plugins.d.mts +63 -0
- package/dist/core-plugins.d.ts +63 -0
- package/dist/core-plugins.js +1 -0
- package/dist/core-plugins.mjs +1 -0
- package/dist/core.d.mts +398 -0
- package/dist/core.d.ts +398 -0
- package/dist/core.js +1 -0
- package/dist/core.mjs +1 -0
- package/dist/documentSerializer-BRaaXIHm.d.ts +36 -0
- package/dist/documentSerializer-DgO3A9av.d.mts +36 -0
- package/dist/docx/index.d.mts +1123 -0
- package/dist/docx/index.d.ts +1123 -0
- package/dist/docx/index.js +1 -0
- package/dist/docx/index.mjs +1 -0
- package/dist/docx/parser.d.mts +108 -0
- package/dist/docx/parser.d.ts +108 -0
- package/dist/docx/parser.js +1 -0
- package/dist/docx/parser.mjs +1 -0
- package/dist/docx/rezip.d.mts +312 -0
- package/dist/docx/rezip.d.ts +312 -0
- package/dist/docx/rezip.js +1 -0
- package/dist/docx/rezip.mjs +1 -0
- package/dist/docx/serializer/index.d.mts +125 -0
- package/dist/docx/serializer/index.d.ts +125 -0
- package/dist/docx/serializer/index.js +1 -0
- package/dist/docx/serializer/index.mjs +1 -0
- package/dist/docx/wrapTypes.d.mts +19 -0
- package/dist/docx/wrapTypes.d.ts +19 -0
- package/dist/docx/wrapTypes.js +1 -0
- package/dist/docx/wrapTypes.mjs +1 -0
- package/dist/docxInput-DTbCa48g.d.mts +21 -0
- package/dist/docxInput-DTbCa48g.d.ts +21 -0
- package/dist/executor-DZAMMQ35.js +1 -0
- package/dist/executor-ZCJRLT3Z.mjs +1 -0
- package/dist/findParagraphByParaId-Maw_8M5D.d.mts +28 -0
- package/dist/findParagraphByParaId-Maw_8M5D.d.ts +28 -0
- package/dist/fontLoader-8b4X-AIh.d.mts +283 -0
- package/dist/fontLoader-CK2QLq68.d.ts +283 -0
- package/dist/footnotes-lCH_P3N3.d.mts +78 -0
- package/dist/footnotes-skVvEHvZ.d.ts +78 -0
- package/dist/formatting-BH4hcZiq.d.mts +410 -0
- package/dist/formatting-_OXU8gLB.d.ts +410 -0
- package/dist/headerFooterLayout-72Vz7yp3.d.mts +292 -0
- package/dist/headerFooterLayout-Ca4ESDHF.d.ts +292 -0
- package/dist/headless.d.mts +109 -0
- package/dist/headless.d.ts +109 -0
- package/dist/headless.js +1 -0
- package/dist/headless.mjs +1 -0
- package/dist/layout-bridge/clickToPositionDom.d.mts +56 -0
- package/dist/layout-bridge/clickToPositionDom.d.ts +56 -0
- package/dist/layout-bridge/clickToPositionDom.js +1 -0
- package/dist/layout-bridge/clickToPositionDom.mjs +1 -0
- package/dist/layout-bridge/index.d.mts +462 -0
- package/dist/layout-bridge/index.d.ts +462 -0
- package/dist/layout-bridge/index.js +1 -0
- package/dist/layout-bridge/index.mjs +1 -0
- package/dist/layout-bridge/measuring/index.d.mts +377 -0
- package/dist/layout-bridge/measuring/index.d.ts +377 -0
- package/dist/layout-bridge/measuring/index.js +1 -0
- package/dist/layout-bridge/measuring/index.mjs +1 -0
- package/dist/layout-bridge/tableInsertHover.d.mts +45 -0
- package/dist/layout-bridge/tableInsertHover.d.ts +45 -0
- package/dist/layout-bridge/tableInsertHover.js +1 -0
- package/dist/layout-bridge/tableInsertHover.mjs +1 -0
- package/dist/layout-bridge/toFlowBlocks.d.mts +130 -0
- package/dist/layout-bridge/toFlowBlocks.d.ts +130 -0
- package/dist/layout-bridge/toFlowBlocks.js +1 -0
- package/dist/layout-bridge/toFlowBlocks.mjs +1 -0
- package/dist/layout-engine/index.d.mts +352 -0
- package/dist/layout-engine/index.d.ts +352 -0
- package/dist/layout-engine/index.js +1 -0
- package/dist/layout-engine/index.mjs +1 -0
- package/dist/layout-engine/types.d.mts +943 -0
- package/dist/layout-engine/types.d.ts +943 -0
- package/dist/layout-engine/types.js +1 -0
- package/dist/layout-engine/types.mjs +1 -0
- package/dist/layout-painter/index.d.mts +22 -0
- package/dist/layout-painter/index.d.ts +22 -0
- package/dist/layout-painter/index.js +1 -0
- package/dist/layout-painter/index.mjs +1 -0
- package/dist/layout-painter/renderPage.d.mts +680 -0
- package/dist/layout-painter/renderPage.d.ts +680 -0
- package/dist/layout-painter/renderPage.js +1 -0
- package/dist/layout-painter/renderPage.mjs +1 -0
- package/dist/managers/AutoSaveManager.d.mts +95 -0
- package/dist/managers/AutoSaveManager.d.ts +95 -0
- package/dist/managers/AutoSaveManager.js +1 -0
- package/dist/managers/AutoSaveManager.mjs +1 -0
- package/dist/managers/TableSelectionManager.d.mts +94 -0
- package/dist/managers/TableSelectionManager.d.ts +94 -0
- package/dist/managers/TableSelectionManager.js +1 -0
- package/dist/managers/TableSelectionManager.mjs +1 -0
- package/dist/managers/types.d.mts +121 -0
- package/dist/managers/types.d.ts +121 -0
- package/dist/managers/types.js +1 -0
- package/dist/managers/types.mjs +0 -0
- package/dist/marks-BY573yZn.d.mts +56 -0
- package/dist/marks-CjC9tF5k.d.ts +56 -0
- package/dist/mcp-cli.mjs +138 -0
- package/dist/mcp.d.mts +183 -0
- package/dist/mcp.d.ts +183 -0
- package/dist/mcp.js +16 -0
- package/dist/mcp.mjs +16 -0
- package/dist/nodes-7753Bgi_.d.mts +320 -0
- package/dist/nodes-CC_nwkT_.d.ts +320 -0
- package/dist/plugin-api/RenderedDomContext.d.mts +74 -0
- package/dist/plugin-api/RenderedDomContext.d.ts +74 -0
- package/dist/plugin-api/RenderedDomContext.js +1 -0
- package/dist/plugin-api/RenderedDomContext.mjs +1 -0
- package/dist/plugin-api/index.d.mts +15 -0
- package/dist/plugin-api/index.d.ts +15 -0
- package/dist/plugin-api/index.js +1 -0
- package/dist/plugin-api/index.mjs +0 -0
- package/dist/plugin-api/resolveItemPositions.d.mts +54 -0
- package/dist/plugin-api/resolveItemPositions.d.ts +54 -0
- package/dist/plugin-api/resolveItemPositions.js +1 -0
- package/dist/plugin-api/resolveItemPositions.mjs +1 -0
- package/dist/plugin-api/types.d.mts +190 -0
- package/dist/plugin-api/types.d.ts +190 -0
- package/dist/plugin-api/types.js +1 -0
- package/dist/plugin-api/types.mjs +0 -0
- package/dist/processTemplate-GPFDLQMX.mjs +1 -0
- package/dist/processTemplate-HH2E3HBO.js +1 -0
- package/dist/prosemirror/commands/formatting.d.mts +100 -0
- package/dist/prosemirror/commands/formatting.d.ts +100 -0
- package/dist/prosemirror/commands/formatting.js +1 -0
- package/dist/prosemirror/commands/formatting.mjs +1 -0
- package/dist/prosemirror/commands/index.d.mts +188 -0
- package/dist/prosemirror/commands/index.d.ts +188 -0
- package/dist/prosemirror/commands/index.js +1 -0
- package/dist/prosemirror/commands/index.mjs +1 -0
- package/dist/prosemirror/commands/pageBreak.d.mts +20 -0
- package/dist/prosemirror/commands/pageBreak.d.ts +20 -0
- package/dist/prosemirror/commands/pageBreak.js +1 -0
- package/dist/prosemirror/commands/pageBreak.mjs +1 -0
- package/dist/prosemirror/commands/paragraph.d.mts +70 -0
- package/dist/prosemirror/commands/paragraph.d.ts +70 -0
- package/dist/prosemirror/commands/paragraph.js +1 -0
- package/dist/prosemirror/commands/paragraph.mjs +1 -0
- package/dist/prosemirror/conversion/fromProseDoc.d.mts +65 -0
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +65 -0
- package/dist/prosemirror/conversion/fromProseDoc.js +1 -0
- package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -0
- package/dist/prosemirror/conversion/index.d.mts +85 -0
- package/dist/prosemirror/conversion/index.d.ts +85 -0
- package/dist/prosemirror/conversion/index.js +1 -0
- package/dist/prosemirror/conversion/index.mjs +1 -0
- package/dist/prosemirror/editor.css +823 -0
- package/dist/prosemirror/extensions/index.d.mts +79 -0
- package/dist/prosemirror/extensions/index.d.ts +79 -0
- package/dist/prosemirror/extensions/index.js +1 -0
- package/dist/prosemirror/extensions/index.mjs +1 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.d.mts +30 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.d.ts +30 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.js +1 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.mjs +1 -0
- package/dist/prosemirror/index.d.mts +70 -0
- package/dist/prosemirror/index.d.ts +70 -0
- package/dist/prosemirror/index.js +1 -0
- package/dist/prosemirror/index.mjs +1 -0
- package/dist/prosemirror/plugins/index.d.mts +154 -0
- package/dist/prosemirror/plugins/index.d.ts +154 -0
- package/dist/prosemirror/plugins/index.js +1 -0
- package/dist/prosemirror/plugins/index.mjs +1 -0
- package/dist/prosemirror/plugins/selectionTracker.d.mts +78 -0
- package/dist/prosemirror/plugins/selectionTracker.d.ts +78 -0
- package/dist/prosemirror/plugins/selectionTracker.js +1 -0
- package/dist/prosemirror/plugins/selectionTracker.mjs +1 -0
- package/dist/prosemirror/schema/index.d.mts +29 -0
- package/dist/prosemirror/schema/index.d.ts +29 -0
- package/dist/prosemirror/schema/index.js +1 -0
- package/dist/prosemirror/schema/index.mjs +1 -0
- package/dist/prosemirror/styles/index.d.mts +124 -0
- package/dist/prosemirror/styles/index.d.ts +124 -0
- package/dist/prosemirror/styles/index.js +1 -0
- package/dist/prosemirror/styles/index.mjs +1 -0
- package/dist/prosemirror/template/prosemirror-plugin.d.mts +66 -0
- package/dist/prosemirror/template/prosemirror-plugin.d.ts +66 -0
- package/dist/prosemirror/template/prosemirror-plugin.js +15 -0
- package/dist/prosemirror/template/prosemirror-plugin.mjs +15 -0
- package/dist/prosemirror/utils/ClickPositionResolver.d.mts +109 -0
- package/dist/prosemirror/utils/ClickPositionResolver.d.ts +109 -0
- package/dist/prosemirror/utils/ClickPositionResolver.js +1 -0
- package/dist/prosemirror/utils/ClickPositionResolver.mjs +1 -0
- package/dist/prosemirror/utils/LayoutSelectionGate.d.mts +81 -0
- package/dist/prosemirror/utils/LayoutSelectionGate.d.ts +81 -0
- package/dist/prosemirror/utils/LayoutSelectionGate.js +1 -0
- package/dist/prosemirror/utils/LayoutSelectionGate.mjs +1 -0
- package/dist/prosemirror/utils/PointerEventHandler.d.mts +94 -0
- package/dist/prosemirror/utils/PointerEventHandler.d.ts +94 -0
- package/dist/prosemirror/utils/PointerEventHandler.js +1 -0
- package/dist/prosemirror/utils/PointerEventHandler.mjs +1 -0
- package/dist/prosemirror/utils/extractTrackedChanges.d.mts +85 -0
- package/dist/prosemirror/utils/extractTrackedChanges.d.ts +85 -0
- package/dist/prosemirror/utils/extractTrackedChanges.js +1 -0
- package/dist/prosemirror/utils/extractTrackedChanges.mjs +1 -0
- package/dist/prosemirror/utils/visualLineNavigation.d.mts +45 -0
- package/dist/prosemirror/utils/visualLineNavigation.d.ts +45 -0
- package/dist/prosemirror/utils/visualLineNavigation.js +1 -0
- package/dist/prosemirror/utils/visualLineNavigation.mjs +1 -0
- package/dist/registry-Cpyybgij.d.mts +165 -0
- package/dist/registry-E5pahPKL.d.ts +165 -0
- package/dist/selectionContext-BPAqgNgk.d.ts +570 -0
- package/dist/selectionContext-CoZat7QZ.d.mts +570 -0
- package/dist/selectiveSave-CWaPEv0B.d.ts +31 -0
- package/dist/selectiveSave-jinP_4xa.d.mts +31 -0
- package/dist/selectiveXmlPatch-ypkxlTD_.d.mts +23 -0
- package/dist/selectiveXmlPatch-ypkxlTD_.d.ts +23 -0
- package/dist/styles-BBv7doYK.d.ts +233 -0
- package/dist/styles-EI2lxeEN.d.mts +233 -0
- package/dist/table-P8esKWAc.d.ts +82 -0
- package/dist/table-_t_W8oQf.d.mts +82 -0
- package/dist/types/agentApi.d.mts +467 -0
- package/dist/types/agentApi.d.ts +467 -0
- package/dist/types/agentApi.js +1 -0
- package/dist/types/agentApi.mjs +1 -0
- package/dist/types/content.d.mts +18 -0
- package/dist/types/content.d.ts +18 -0
- package/dist/types/content.js +1 -0
- package/dist/types/content.mjs +0 -0
- package/dist/types/document.d.mts +123 -0
- package/dist/types/document.d.ts +123 -0
- package/dist/types/document.js +1 -0
- package/dist/types/document.mjs +0 -0
- package/dist/types-DXG7vqe9.d.ts +311 -0
- package/dist/types-RchZmPFN.d.mts +137 -0
- package/dist/types-RchZmPFN.d.ts +137 -0
- package/dist/types-dYdjUZMo.d.mts +311 -0
- package/dist/utils/cardStyles.d.mts +31 -0
- package/dist/utils/cardStyles.d.ts +31 -0
- package/dist/utils/cardStyles.js +1 -0
- package/dist/utils/cardStyles.mjs +1 -0
- package/dist/utils/comments.d.mts +121 -0
- package/dist/utils/comments.d.ts +121 -0
- package/dist/utils/comments.js +1 -0
- package/dist/utils/comments.mjs +1 -0
- package/dist/utils/findReplace.d.mts +114 -0
- package/dist/utils/findReplace.d.ts +114 -0
- package/dist/utils/findReplace.js +2 -0
- package/dist/utils/findReplace.mjs +2 -0
- package/dist/utils/findVerticalScrollParent.d.mts +25 -0
- package/dist/utils/findVerticalScrollParent.d.ts +25 -0
- package/dist/utils/findVerticalScrollParent.js +1 -0
- package/dist/utils/findVerticalScrollParent.mjs +1 -0
- package/dist/utils/fontOptions.d.mts +21 -0
- package/dist/utils/fontOptions.d.ts +21 -0
- package/dist/utils/fontOptions.js +1 -0
- package/dist/utils/fontOptions.mjs +1 -0
- package/dist/utils/headingCollector.d.mts +32 -0
- package/dist/utils/headingCollector.d.ts +32 -0
- package/dist/utils/headingCollector.js +1 -0
- package/dist/utils/headingCollector.mjs +1 -0
- package/dist/utils/highlightColors.d.mts +14 -0
- package/dist/utils/highlightColors.d.ts +14 -0
- package/dist/utils/highlightColors.js +1 -0
- package/dist/utils/highlightColors.mjs +1 -0
- package/dist/utils/index.d.mts +710 -0
- package/dist/utils/index.d.ts +710 -0
- package/dist/utils/index.js +82 -0
- package/dist/utils/index.mjs +82 -0
- package/dist/utils/listState.d.mts +27 -0
- package/dist/utils/listState.d.ts +27 -0
- package/dist/utils/listState.js +1 -0
- package/dist/utils/listState.mjs +1 -0
- package/dist/utils/reportIssue.d.mts +23 -0
- package/dist/utils/reportIssue.d.ts +23 -0
- package/dist/utils/reportIssue.js +2 -0
- package/dist/utils/reportIssue.mjs +2 -0
- package/dist/utils/sidebarConstants.d.mts +10 -0
- package/dist/utils/sidebarConstants.d.ts +10 -0
- package/dist/utils/sidebarConstants.js +1 -0
- package/dist/utils/sidebarConstants.mjs +1 -0
- package/dist/utils/textSelection.d.mts +92 -0
- package/dist/utils/textSelection.d.ts +92 -0
- package/dist/utils/textSelection.js +1 -0
- package/dist/utils/textSelection.mjs +1 -0
- package/dist/utils/units.d.mts +91 -0
- package/dist/utils/units.d.ts +91 -0
- package/dist/utils/units.js +1 -0
- package/dist/utils/units.mjs +1 -0
- package/dist/variableDetector-DF3-nxUC.d.mts +115 -0
- package/dist/variableDetector-sBkgVh3f.d.ts +115 -0
- package/package.json +565 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {c,a as a$1,b as b$1}from'./chunk-FCJWLEKT.mjs';import {a as a$2,b}from'./chunk-7E5VBRDL.mjs';import {p}from'./chunk-RFC2SXZ6.mjs';import {a,b as b$2,o}from'./chunk-67LVRQIR.mjs';import {i,j as j$1,k}from'./chunk-VW22RZ6C.mjs';function F(e,a$2){let o$1={};for(let t of e)switch(t.type.name){case "bold":o$1.bold=true;break;case "italic":o$1.italic=true;break;case "underline":{let n=t.attrs;if(n.style||n.color){let r=n.color?a(n.color,a$2):void 0;o$1.underline={style:n.style,color:r};}else o$1.underline=true;break}case "strike":o$1.strike=true;break;case "textColor":{let n=t.attrs;(n.themeColor||n.rgb)&&(o$1.color=a({rgb:n.rgb,themeColor:n.themeColor,themeTint:n.themeTint,themeShade:n.themeShade},a$2));break}case "highlight":o$1.highlight=o(t.attrs.color);break;case "fontSize":{let n=t.attrs;o$1.fontSize=n.size/2;break}case "fontFamily":{let n=t.attrs;o$1.fontFamily=n.ascii||n.hAnsi;break}case "characterSpacing":{let n=t.attrs;n.spacing!=null&&n.spacing!==0&&(o$1.letterSpacing=a$1(n.spacing)),n.position!=null&&n.position!==0&&(o$1.positionPx=j$1(n.position)),n.scale!=null&&n.scale!==100&&(o$1.horizontalScale=n.scale),n.kerning!=null&&n.kerning>0&&(o$1.kerningMinPt=k(n.kerning));break}case "allCaps":o$1.allCaps=true;break;case "smallCaps":o$1.smallCaps=true;break;case "emboss":o$1.emboss=true;break;case "imprint":o$1.imprint=true;break;case "textShadow":o$1.textShadow=true;break;case "textOutline":o$1.textOutline=true;break;case "hidden":o$1.hidden=true;break;case "rtl":o$1.rtl=true;break;case "textEffect":{let n=t.attrs.effect;(n==="blinkBackground"||n==="lights"||n==="antsBlack"||n==="antsRed"||n==="shimmer"||n==="sparkle")&&(o$1.textEffect=n);break}case "emphasisMark":{let n=t.attrs.type;n==="dot"||n==="comma"||n==="circle"||n==="underDot"?o$1.emphasisMark=n:o$1.emphasisMark="dot";break}case "superscript":o$1.superscript=true;break;case "subscript":o$1.subscript=true;break;case "hyperlink":{let n=t.attrs;o$1.hyperlink={href:n.href,tooltip:n.tooltip};break}case "footnoteRef":{let n=t.attrs,r=typeof n.id=="string"?parseInt(n.id,10):n.id;n.noteType==="endnote"?o$1.endnoteRefId=r:o$1.footnoteRefId=r;break}case "comment":{let n=t.attrs.commentId;n&&(o$1.commentIds||(o$1.commentIds=[]),o$1.commentIds.push(n));break}case "insertion":o$1.isInsertion=true,o$1.changeAuthor=t.attrs.author,o$1.changeDate=t.attrs.date,o$1.changeRevisionId=t.attrs.revisionId;break;case "deletion":o$1.isDeletion=true,o$1.changeAuthor=t.attrs.author,o$1.changeDate=t.attrs.date,o$1.changeRevisionId=t.attrs.revisionId;break}return o$1}function _(e){let a=e.defaultTextFormatting;if(!a)return {};let o={};if(a.fontFamily){let t=a.fontFamily.ascii||a.fontFamily.hAnsi;t&&(o.fontFamily=t);}return a.fontSize!=null&&(o.fontSize=a.fontSize/2),o}function E(e){e.hyperlink&&(e.hyperlink={...e.hyperlink,noDefaultStyle:true},delete e.color,delete e.underline);}function L(e,a,o){let t=[],n=a+1,r=o.theme,s=_(e.attrs),l=e.attrs.styleId,g=typeof l=="string"&&/^TOC\d*$/i.test(l);function m(d,f){if(d.isText&&d.text){let i=F(d.marks,r);g&&E(i);let u={kind:"text",text:d.text,...s,...i,pmStart:f,pmEnd:f+d.nodeSize};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 i=F(d.marks,r),u={kind:"tab",...s,...i,pmStart:f,pmEnd:f+d.nodeSize};t.push(u);}else if(d.type.name==="image"){let i=d.attrs,u=b$1(i.width||100,i.height||100,o.pageContentHeight),p={kind:"image",src:i.src,width:u.width,height:u.height,alt:i.alt,transform:i.transform,wrapType:i.wrapType,displayMode:i.displayMode,cssFloat:i.cssFloat,distTop:i.distTop,distBottom:i.distBottom,distLeft:i.distLeft,distRight:i.distRight,position:i.position,cropTop:i.cropTop,cropRight:i.cropRight,cropBottom:i.cropBottom,cropLeft:i.cropLeft,opacity:i.opacity,pmStart:f,pmEnd:f+d.nodeSize};t.push(p);}else if(d.type.name==="field"){let i=d.attrs.fieldType,u=i==="PAGE"?"PAGE":i==="NUMPAGES"?"NUMPAGES":i==="DATE"?"DATE":i==="TIME"?"TIME":"OTHER",p=F(d.marks,r);g&&E(p),t.push({kind:"field",fieldType:u,fallback:d.attrs.displayText||"",...s,...p,pmStart:f,pmEnd:f+d.nodeSize});}else if(d.type.name==="math"){let i=d.attrs.plainText||"[equation]";t.push({kind:"text",text:i,italic:true,fontFamily:"Cambria Math",pmStart:f,pmEnd:f+d.nodeSize});}else if(d.type.name==="sdt"){let i=f+1;d.forEach((u,p)=>{m(u,i+p);});}}return e.forEach((d,f)=>{m(d,n+f);}),t}function U(e){return Math.max(1,Math.round(e/8*1.333))}var Y={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 B(e,a$1){if(!e||!e.style||e.style==="none"||e.style==="nil")return;let o={style:Y[e.style]||"solid",width:U(e.size??0),color:e.color?a(e.color,a$1):"#000000"};return e.space!==void 0&&(o.space=i(e.space)),o}function D(e,a){let o=e.borders;if(!o)return;let t={},n=["top","bottom","left","right"];for(let r of n){let s=o[r],l=s?B(s,a):void 0;t[r]=l??{width:0,style:"none"};}return Object.keys(t).length>0?t:void 0}function $(e,a){let o=[];for(let t=0;t<=a;t+=1){let n=e[t]??0;if(n<=0)break;o.push(n);}return o.length===0?"1.":`${o.join(".")}.`}var G=[[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 N(e,a){if(e<=0)return "";let o=e,t="";for(let[n,r]of G)for(;o>=n;)t+=r,o-=n;return a?t:t.toLowerCase()}function O(e,a){if(e<=0)return "";let o=e,t="";for(;o>0;){let n=(o-1)%26;t=String.fromCharCode(65+n)+t,o=Math.floor((o-1)/26);}return a?t:t.toLowerCase()}function j(e,a){if(e<=0)return "";switch(a){case "upperRoman":return N(e,true);case "lowerRoman":return N(e,false);case "upperLetter":return O(e,true);case "lowerLetter":return O(e,false);case "decimalZero":return e<10?`0${e}`:String(e);case "none":return "";default:return String(e)}}function H(e,a,o){return e.replace(/%(\d)([.):\]])?/g,(t,n,r="")=>{let s=parseInt(n,10)-1;if(s<0)return "";let l=a[s]??0,g=o?.[s]??"decimal",m=j(l,g);return m?m+r:""})}function W(e,a,o){let t=e.numPr;if(!t)return null;let n=t.numId;if(n==null||n===0)return null;if(e.listIsBullet)return p(e.listMarker||"");let r=t.ilvl??0,s=e.listAbstractNumId??n,l=a.get(s)??new Array(9).fill(0),g=`${n}:${r}`;o.has(g)||(o.add(g),e.listStartOverride!=null&&(l[r]=e.listStartOverride-1)),l[r]=(l[r]??0)+1;for(let m=r+1;m<l.length;m+=1)l[m]=0;return a.set(s,l),e.listMarker&&e.listMarker.includes("%")?H(e.listMarker,l,e.listLevelNumFmts??void 0):e.listMarker?e.listMarker:$(l,r)}var V="Calibri",q=11;function K(e,a,o,t,n){let r={};if(e.alignment){let i=e.alignment;i==="both"||i==="distribute"?r.alignment="justify":i==="left"?r.alignment="left":i==="center"?r.alignment="center":i==="right"&&(r.alignment="right");}(e.spaceBefore!=null||e.spaceAfter!=null||e.lineSpacing!=null)&&(r.spacing={},e.spaceBefore!=null&&(r.spacing.before=a$1(e.spaceBefore)),e.spaceAfter!=null&&(r.spacing.after=a$1(e.spaceAfter)),e.lineSpacing!=null&&(e.lineSpacingRule==="exact"||e.lineSpacingRule==="atLeast"?(r.spacing.line=a$1(e.lineSpacing),r.spacing.lineUnit="px",r.spacing.lineRule=e.lineSpacingRule):(r.spacing.line=e.lineSpacing/240,r.spacing.lineUnit="multiplier",r.spacing.lineRule="auto"))),e.spacingExplicit&&(r.spacingExplicit=e.spacingExplicit);let s=e.indentLeft,l=e.indentFirstLine,g=e.hangingIndent;if(e.numPr?.numId&&s==null&&(s=((e.numPr.ilvl??0)+1)*720,l==null&&(l=-360,g=true)),(s!=null||e.indentRight!=null||l!=null)&&(r.indent={},s!=null&&(r.indent.left=a$1(s)),e.indentRight!=null&&(r.indent.right=a$1(e.indentRight)),l!=null&&(g?r.indent.hanging=Math.abs(a$1(l)):r.indent.firstLine=a$1(l))),e.styleId&&(r.styleId=e.styleId),e.borders){let i=e.borders;r.borders={};let u=p=>p?B(p,a):void 0;i.top&&(r.borders.top=u(i.top)),i.bottom&&(r.borders.bottom=u(i.bottom)),i.left&&(r.borders.left=u(i.left)),i.right&&(r.borders.right=u(i.right)),i.between&&(r.borders.between=u(i.between)),i.bar&&(r.borders.bar=u(i.bar)),!r.borders.top&&!r.borders.bottom&&!r.borders.left&&!r.borders.right&&!r.borders.between&&!r.borders.bar&&delete r.borders;}let m=b$2(e.shading?.fill,a);m&&(r.shading=`#${m}`),e.tabs&&e.tabs.length>0&&(r.tabs=e.tabs.map(i=>({val:Z(i.alignment),pos:i.position,leader:i.leader}))),e.pageBreakBefore&&(r.pageBreakBefore=true),e.keepNext&&(r.keepNext=true),e.keepLines&&(r.keepLines=true),e.contextualSpacing&&(r.contextualSpacing=true),e.bidi&&(r.bidi=true),e.styleId&&(r.styleId=e.styleId),e.numPr&&(r.numPr={numId:e.numPr.numId,ilvl:e.numPr.ilvl});let d=o&&t?W(e,o,t):null;d!=null?r.listMarker=d:e.listMarker&&(r.listMarker=e.listMarker),e.listIsBullet!=null&&(r.listIsBullet=e.listIsBullet),e.listMarkerHidden&&(r.listMarkerHidden=true),e.listMarkerFontFamily&&(r.listMarkerFontFamily=e.listMarkerFontFamily),e.listMarkerFontSize&&(r.listMarkerFontSize=e.listMarkerFontSize),e.listMarkerSuffix&&(r.listMarkerSuffix=e.listMarkerSuffix),n!==void 0&&(r.defaultTabStopTwips=n);let f=e.defaultTextFormatting;return f&&(f.fontSize!=null&&(r.defaultFontSize=f.fontSize/2),f.fontFamily&&(r.defaultFontFamily=f.fontFamily.ascii||f.fontFamily.hAnsi)),e.pPrIns&&(r.pPrIns=e.pPrIns),e.pPrDel&&(r.pPrDel=e.pPrDel),r}function Z(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 w(e,a,o){let t=e.attrs,n=L(e,a,o),r=K(t,o.theme,o.listCounters,o.listSeenNumIds,o.defaultTabStopTwips);return {kind:"paragraph",id:c(),runs:n,attrs:r,pmStart:a,pmEnd:a+e.nodeSize}}function J(e,a,o,t){let n=[],r=a+1;e.forEach(p=>{p.type.name==="paragraph"?n.push(w(p,r,o)):p.type.name==="table"&&n.push(X(p,r,o)),r+=p.nodeSize;});let s=e.attrs,l=s.width,g=s.widthType,m=l&&(!g||g==="dxa"||g==="auto")?a$1(l):void 0,d=s.margins,f=(p,b)=>{if(p!=null){let k=a$1(p);if(k>0)return k}if(b!=null){let k=a$1(b);if(k>=0)return k}return 0},i={top:f(d?.top,t?.top),right:f(d?.right,t?.right),bottom:f(d?.bottom,t?.bottom),left:f(d?.left,t?.left)},u=s.cellMarker;return {id:c(),blocks:n,colSpan:s.colspan,rowSpan:s.rowspan,width:m,widthValue:l,widthType:g,verticalAlign:s.verticalAlign,background:s.backgroundColor?`#${s.backgroundColor}`:void 0,borders:D(s,o.theme),padding:i,noWrap:s.noWrap||void 0,trackedMarker:u??void 0}}function Q(e,a,o,t){let n=[],r=a+1;e.forEach(l=>{(l.type.name==="tableCell"||l.type.name==="tableHeader")&&n.push(J(l,r,o,t)),r+=l.nodeSize;});let s=e.attrs;return {id:c(),cells:n,height:s.height?a$1(s.height):void 0,heightRule:s.heightRule??void 0,isHeader:s.isHeader,trackedIns:s.trIns??void 0,trackedDel:s.trDel??void 0}}function X(e,a,o){let t=[],n=a+1,r=e.attrs.cellMargins;e.forEach(b=>{b.type.name==="tableRow"&&t.push(Q(b,n,o,r)),n+=b.nodeSize;});let l=e.attrs.columnWidths?.map(a$1),g=e.attrs.width,m=e.attrs.widthType;if(!l&&t.length>0){let k=t[0].cells.map(S=>S.width);k.every(S=>S!==void 0&&S>0)&&(l=k);}let d=e.attrs.justification,f=e.attrs._originalFormatting,i=f?.indent?.value&&f.indent.type==="dxa"?a$1(f.indent.value):void 0,u=e.attrs.floating,p=u?{horzAnchor:u.horzAnchor,vertAnchor:u.vertAnchor,tblpX:u.tblpX!==void 0?a$1(u.tblpX):void 0,tblpXSpec:u.tblpXSpec,tblpY:u.tblpY!==void 0?a$1(u.tblpY):void 0,tblpYSpec:u.tblpYSpec,topFromText:u.topFromText!==void 0?a$1(u.topFromText):void 0,bottomFromText:u.bottomFromText!==void 0?a$1(u.bottomFromText):void 0,leftFromText:u.leftFromText!==void 0?a$1(u.leftFromText):void 0,rightFromText:u.rightFromText!==void 0?a$1(u.rightFromText):void 0}:void 0;return {kind:"table",id:c(),rows:t,columnWidths:l,width:g,widthType:m,justification:d,indent:i,floating:p,pmStart:a,pmEnd:a+e.nodeSize}}function A(e,a,o){let t=e.attrs,n=t.wrapType,r=n==="behind"||n==="inFront",s=b$1(t.width||100,t.height||100,o);return {kind:"image",id:c(),src:t.src,width:s.width,height:s.height,alt:t.alt,transform:t.transform,anchor:r?{isAnchored:true,offsetH:t.distLeft,offsetV:t.distTop,behindDoc:n==="behind"}:void 0,hlinkHref:t.hlinkHref,pmStart:a,pmEnd:a+e.nodeSize}}function ee(e,a,o){let t=e.attrs,n=[];return e.forEach((r,s)=>{if(r.type.name==="paragraph"){let l=w(r,a+1+s,o);n.push(l);}}),{kind:"textBox",id:c(),width:t.width??b,height:t.height??void 0,fillColor:t.fillColor,outlineWidth:t.outlineWidth,outlineColor:t.outlineColor,outlineStyle:t.outlineStyle,margins:{top:t.marginTop??a$2.top,bottom:t.marginBottom??a$2.bottom,left:t.marginLeft??a$2.left,right:t.marginRight??a$2.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 he(e,a={}){let o=e.attrs?.defaultTabStopTwips,t={...a,defaultFont:a.defaultFont??V,defaultSize:a.defaultSize??q,defaultTabStopTwips:a.defaultTabStopTwips??o},n=[],r=0,s={top:1440,bottom:1440,left:1440,right:1440};return t.listCounters||(t.listCounters=new Map),t.listSeenNumIds||(t.listSeenNumIds=new Set),e.forEach((l,g)=>{let m=r+g;switch(l.type.name){case "paragraph":{let d=w(l,m,t),f=l.attrs;n.push(d);let i=f._sectionProperties;if(i||f.sectionBreakType){let u={kind:"sectionBreak",id:c(),type:i?.sectionStart??f.sectionBreakType};if(i){if((i.pageWidth!==void 0||i.pageHeight!==void 0)&&(u.pageSize={w:a$1(i.pageWidth??12240),h:a$1(i.pageHeight??15840)}),i.marginTop!==void 0||i.marginBottom!==void 0||i.marginLeft!==void 0||i.marginRight!==void 0){let b={top:i.marginTop??s.top,bottom:i.marginBottom??s.bottom,left:i.marginLeft??s.left,right:i.marginRight??s.right};u.margins={top:a$1(b.top),bottom:a$1(b.bottom),left:a$1(b.left),right:a$1(b.right)},s=b;}let p=i.columnCount??1;if(p>1){let b={count:p,gap:a$1(i.columnSpace??720),equalWidth:i.equalWidth??true,separator:i.separator};u.columns=b;}}n.push(u);}}break;case "table":n.push(X(l,m,t));break;case "image":n.push(A(l,m,t.pageContentHeight));break;case "textBox":n.push(ee(l,m,t));break;case "horizontalRule":case "pageBreak":{let d={kind:"pageBreak",id:c(),pmStart:m,pmEnd:m+l.nodeSize};n.push(d);break}}}),n}export{B as a,H as b,he as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"},C={black:"000000",blue:"0000FF",cyan:"00FFFF",darkBlue:"00008B",darkCyan:"008B8B",darkGray:"A9A9A9",darkGreen:"006400",darkMagenta:"8B008B",darkRed:"8B0000",darkYellow:"808000",green:"00FF00",lightGray:"D3D3D3",magenta:"FF00FF",red:"FF0000",white:"FFFFFF",yellow:"FFFF00",none:""},m={dk1:"dk1",lt1:"lt1",dk2:"dk2",lt2:"lt2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hlink:"hlink",folHlink:"folHlink",dark1:"dk1",light1:"lt1",dark2:"dk2",light2:"lt2",hyperlink:"hlink",followedHyperlink:"folHlink",background1:"lt1",text1:"dk1",background2:"lt2",text2:"dk2",tx1:"dk1",tx2:"dk2",bg1:"lt1",bg2:"lt2"};function p(e){if(!e)return 1;let n=parseInt(e,16);return isNaN(n)?1:n/255}function i(e){let n=e.padStart(6,"0").slice(0,6),t=parseInt(n.slice(0,2),16),r=parseInt(n.slice(2,4),16),l=parseInt(n.slice(4,6),16);return {r:isNaN(t)?0:t,g:isNaN(r)?0:r,b:isNaN(l)?0:l}}function g(e,n,t){let r=l=>Math.max(0,Math.min(255,Math.round(l))).toString(16).padStart(2,"0");return `${r(e)}${r(n)}${r(t)}`.toUpperCase()}function c(e,n){if(n>=1)return e;if(n<=0)return "FFFFFF";let t=i(e);return g(Math.min(255,Math.max(0,Math.round(t.r*n+255*(1-n)))),Math.min(255,Math.max(0,Math.round(t.g*n+255*(1-n)))),Math.min(255,Math.max(0,Math.round(t.b*n+255*(1-n)))))}function d(e,n){if(n>=1)return e;if(n<=0)return "000000";let t=i(e);return g(Math.min(255,Math.max(0,Math.round(t.r*n))),Math.min(255,Math.max(0,Math.round(t.g*n))),Math.min(255,Math.max(0,Math.round(t.b*n))))}function x(e,n){let t=m[n]??n,r=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],l=a=>r.includes(a);return e?.colorScheme?l(t)?e.colorScheme[t]??s[t]??"000000":"000000":l(t)?s[t]??"000000":"000000"}function b(e){if(!e)return null;let n=e.toLowerCase();return m[e]??m[n]??null}function u(e,n,t="000000"){if(!e)return `#${t}`;if(e.auto)return `#${t}`;let r;if(e.themeColor){let l=b(e.themeColor);if(l?r=x(n,l):r=e.rgb??t,e.themeTint){let a=p(e.themeTint);r=c(r,a);}else if(e.themeShade){let a=p(e.themeShade);r=d(r,a);}}else e.rgb?r=e.rgb==="auto"?t:e.rgb:r=t;return `#${r.toUpperCase().replace(/^#/,"")}`}function M(e,n){if(!(!e||e.auto)){if(e.themeColor&&n)return u(e,n).slice(1);if(e.rgb&&e.rgb!=="auto")return e.rgb.toUpperCase().replace(/^#/,"")}}function T(e){if(!e||e==="none")return "";let n=C[e];return n?`#${n}`:""}function y(e,n){return e?e.auto?"transparent":u(e,n):""}function V(e,n){if(!e)return false;if(e.auto)return true;let r=u(e,n).replace(/^#/,"").toLowerCase(),l=i(r);return (l.r+l.g+l.b)/3<20}function v(e,n){if(!e)return false;let r=u(e,n).replace(/^#/,"").toLowerCase(),l=i(r);return (l.r+l.g+l.b)/3>235}function A(e,n){if(!e)return "#000000";let r=u(e,n).replace(/^#/,""),l=i(r);return (.299*l.r+.587*l.g+.114*l.b)/255>.5?"#000000":"#FFFFFF"}function H(e){if(!e)return;let n=e.trim();if(n.toLowerCase()==="auto")return {auto:true};let t=b(n);if(t)return {themeColor:t};let r=n.replace(/^#/,"").toUpperCase();return /^[0-9A-F]{6}$/i.test(r)?{rgb:r}:/^[0-9A-F]{3}$/i.test(r)?{rgb:r.split("").map(a=>a+a).join("")}:{rgb:r.padStart(6,"0").slice(0,6)}}function E(e,n,t){let r={themeColor:e};return n!==void 0&&n>0&&n<1&&(r.themeTint=Math.round(n*255).toString(16).toUpperCase().padStart(2,"0")),t!==void 0&&t>0&&t<1&&(r.themeShade=Math.round(t*255).toString(16).toUpperCase().padStart(2,"0")),r}function $(e){return {rgb:e.replace(/^#/,"").toUpperCase()}}function L(e,n,t){let l=u(e,n).replace(/^#/,""),a=1-t/100;return `#${d(l,a)}`}function R(e,n,t){let l=u(e,n).replace(/^#/,""),a=1-t/100;return `#${c(l,a)}`}function B(e,n,t,r){let l=u(e,r).replace(/^#/,""),a=u(n,r).replace(/^#/,""),o=i(l),f=i(a),h={r:Math.round(o.r*(1-t)+f.r*t),g:Math.round(o.g*(1-t)+f.g*t),b:Math.round(o.b*(1-t)+f.b*t)};return `#${g(h.r,h.g,h.b)}`}function S(e){return e.startsWith("#")?e:`#${e}`}function U(e){return T(e)||S(e)}var F=[{slot:"lt1",name:"Background 1"},{slot:"dk1",name:"Text 1"},{slot:"lt2",name:"Background 2"},{slot:"dk2",name:"Text 2"},{slot:"accent1",name:"Accent 1"},{slot:"accent2",name:"Accent 2"},{slot:"accent3",name:"Accent 3"},{slot:"accent4",name:"Accent 4"},{slot:"accent5",name:"Accent 5"},{slot:"accent6",name:"Accent 6"}],k=[{type:"base",value:0,hexValue:"",labelSuffix:""},{type:"tint",value:.8,hexValue:"CC",labelSuffix:", Lighter 80%"},{type:"tint",value:.6,hexValue:"99",labelSuffix:", Lighter 60%"},{type:"tint",value:.4,hexValue:"66",labelSuffix:", Lighter 40%"},{type:"shade",value:.75,hexValue:"BF",labelSuffix:", Darker 25%"},{type:"shade",value:.5,hexValue:"80",labelSuffix:", Darker 50%"}];function D(e,n,t){return n==="tint"?c(e,1-t):d(e,t)}function I(e){let n=e??s;return k.map(t=>F.map(r=>{let l=n[r.slot]??s[r.slot]??"000000",a;t.type==="base"?a=l.toUpperCase():t.type==="tint"?a=c(l,1-t.value):a=d(l,t.value);let o={hex:a,themeSlot:r.slot,label:`${r.name}${t.labelSuffix}`};return t.type==="tint"&&t.hexValue?o.tint=t.hexValue:t.type==="shade"&&t.hexValue&&(o.shade=t.hexValue),o}))}function _(e,n,t){if(!e&&!n)return true;if(!e||!n)return false;let r=u(e,t).toUpperCase(),l=u(n,t).toUpperCase();return r===l}export{u as a,M as b,T as c,y as d,V as e,v as f,A as g,H as h,E as i,$ as j,L as k,R as l,B as m,S as n,U as o,D as p,I as q,_ as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var prosemirrorState=require('prosemirror-state');var f=new prosemirrorState.PluginKey("selectionTracker");function k(t){let{selection:e,doc:i}=t,{from:s,to:m,empty:l}=e,g=i.resolve(s),c=0,a=0;i.forEach((u,p,S)=>{if(p>m)return false;p<=s&&(c=S),p<=m&&(a=S);});let r=L(t),n=g.parent,o={};n.type.name==="paragraph"&&(n.attrs.alignment&&(o.alignment=n.attrs.alignment),n.attrs.lineSpacing&&(o.lineSpacing=n.attrs.lineSpacing,o.lineSpacingRule=n.attrs.lineSpacingRule),n.attrs.indentLeft&&(o.indentLeft=n.attrs.indentLeft),n.attrs.indentRight&&(o.indentRight=n.attrs.indentRight),n.attrs.indentFirstLine&&(o.indentFirstLine=n.attrs.indentFirstLine),n.attrs.hangingIndent&&(o.hangingIndent=n.attrs.hangingIndent),n.attrs.tabs&&(o.tabs=n.attrs.tabs),n.attrs.numPr&&(o.numPr=n.attrs.numPr),n.attrs.styleId&&(o.styleId=n.attrs.styleId));let d=n.attrs?.numPr,b=!!d?.numId,I=d?.numId===1?"bullet":d?.numId?"numbered":void 0,P=d?.ilvl,F=t.storedMarks||(l?g.marks():[]),h=[],x=false,y=false;for(let u of F)u.type.name==="comment"&&u.attrs.commentId&&h.push(u.attrs.commentId),u.type.name==="insertion"&&(x=true),u.type.name==="deletion"&&(y=true);return {hasSelection:!l,isMultiParagraph:c!==a,textFormatting:r,paragraphFormatting:o,startParagraphIndex:c,endParagraphIndex:a,inList:b,listType:I,listLevel:P,activeCommentIds:h,inInsertion:x,inDeletion:y}}function L(t){let{selection:e,doc:i}=t,{empty:s,$from:m,from:l,to:g}=e,c=t.storedMarks;if(!c)if(s)c=m.marks();else {let r=null;i.nodesBetween(l,g,n=>r?false:n.isText?(r=n.marks,false):true),c=r??m.marks();}let a={};for(let r of c)switch(r.type.name){case "bold":a.bold=true;break;case "italic":a.italic=true;break;case "underline":a.underline={style:r.attrs.style||"single",color:r.attrs.color};break;case "strike":r.attrs.double?a.doubleStrike=true:a.strike=true;break;case "textColor":a.color={rgb:r.attrs.rgb,themeColor:r.attrs.themeColor,themeTint:r.attrs.themeTint,themeShade:r.attrs.themeShade};break;case "highlight":a.highlight=r.attrs.color;break;case "fontSize":a.fontSize=r.attrs.size;break;case "fontFamily":a.fontFamily={ascii:r.attrs.ascii,hAnsi:r.attrs.hAnsi,asciiTheme:r.attrs.asciiTheme};break;case "superscript":a.vertAlign="superscript";break;case "subscript":a.vertAlign="subscript";break}return a}function w(t){return new prosemirrorState.Plugin({key:f,state:{init(e,i){return k(i)},apply(e,i,s,m){if(!e.selectionSet&&!e.docChanged)return i;let l=k(m);return t&&!E(i,l)&&setTimeout(()=>t(l),0),l}},view(){return {update(e,i){if(!t||e.state.selection.eq(i.selection)&&e.state.doc.eq(i.doc))return;let s=f.getState(e.state);s&&t(s);}}}})}function v(t,e){if(t===e)return true;if(!t||!e||t.length!==e.length)return false;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return false;return true}function E(t,e){return t.hasSelection===e.hasSelection&&t.isMultiParagraph===e.isMultiParagraph&&t.startParagraphIndex===e.startParagraphIndex&&t.endParagraphIndex===e.endParagraphIndex&&t.inList===e.inList&&t.listType===e.listType&&t.listLevel===e.listLevel&&t.inInsertion===e.inInsertion&&t.inDeletion===e.inDeletion&&v(t.activeCommentIds,e.activeCommentIds)&&JSON.stringify(t.textFormatting)===JSON.stringify(e.textFormatting)&&JSON.stringify(t.paragraphFormatting)===JSON.stringify(e.paragraphFormatting)}function R(t){return f.getState(t)||null}exports.a=f;exports.b=k;exports.c=w;exports.d=R;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-D6GO7UGD.mjs';import {a as a$1}from'./chunk-QYUPLKLP.mjs';var v="docx-editor-autosave",d=3e4,m=1440*60*1e3,S=2e3,c=1;function h(){try{let t="__docx_editor_test__";return localStorage.setItem(t,"test"),localStorage.removeItem(t),!0}catch{return false}}function l(t){return JSON.stringify({...t,originalBuffer:null})}function f(t){try{let s=JSON.parse(t);return !s||typeof s!="object"||!s.document||!s.savedAt?null:(s.version!==c&&console.warn("Auto-save data version mismatch, may need migration"),s)}catch{return null}}function g(t,s){let e=new Date(t).getTime();return Date.now()-e>s}var u=class extends a{constructor(e={}){super({status:"idle",lastSaveTime:null,hasRecoveryData:false,isEnabled:true});a$1(this,"storageKey");a$1(this,"interval");a$1(this,"maxAge");a$1(this,"saveOnChange");a$1(this,"debounceDelay");a$1(this,"onSaveCallback");a$1(this,"onErrorCallback");a$1(this,"onRecoveryAvailableCallback");a$1(this,"storageAvailable");a$1(this,"currentDocument",null);a$1(this,"lastSavedJson",null);a$1(this,"intervalTimer",null);a$1(this,"debounceTimer",null);a$1(this,"status","idle");a$1(this,"lastSaveTime",null);a$1(this,"_hasRecoveryData",false);a$1(this,"_isEnabled");this.storageKey=e.storageKey??v,this.interval=e.interval??d,this.maxAge=e.maxAge??m,this.saveOnChange=e.saveOnChange??true,this.debounceDelay=e.debounceDelay??S,this.onSaveCallback=e.onSave,this.onErrorCallback=e.onError,this.onRecoveryAvailableCallback=e.onRecoveryAvailable,this._isEnabled=true,this.storageAvailable=h(),this.checkRecoveryData();}onDocumentChanged(e){this.currentDocument=e,this._isEnabled&&this.saveOnChange&&e&&this.storageAvailable&&this.debounceSave();}async save(){if(!this.storageAvailable)return this.onErrorCallback?.(new Error("localStorage is not available")),false;let e=this.currentDocument;if(!e)return false;this.updateStatus("saving");try{let r=l(e);if(r===this.lastSavedJson)return this.updateStatus("saved"),!0;this.persistToStorage(r),this.lastSavedJson=r;let i=new Date;return this.lastSaveTime=i,this.updateStatus("saved"),this.onSaveCallback?.(i),!0}catch(r){return console.error("Auto-save failed:",r),this.updateStatus("error"),this.onErrorCallback?.(r),false}}clear(){if(this.storageAvailable)try{localStorage.removeItem(this.storageKey),this._hasRecoveryData=!1,this.lastSavedJson=null,this.emitSnapshot();}catch(e){console.error("Failed to clear auto-save:",e);}}getRecoveryData(){if(!this.storageAvailable)return null;try{let e=localStorage.getItem(this.storageKey);if(!e)return null;let r=f(e);return r?g(r.savedAt,this.maxAge)?(this.clear(),null):r:null}catch{return null}}acceptRecovery(){let e=this.getRecoveryData();return e?(this._hasRecoveryData=false,this.emitSnapshot(),e.document):null}dismissRecovery(){this.clear(),this._hasRecoveryData=false,this.emitSnapshot();}enable(){this._isEnabled=true,this.startInterval(),this.emitSnapshot();}disable(){this._isEnabled=false,this.stopTimers(),this.emitSnapshot();}startInterval(){this.stopTimers(),!(!this._isEnabled||!this.storageAvailable)&&(this.intervalTimer=setInterval(()=>{this.save();},this.interval));}destroy(){if(this.stopTimers(),this._isEnabled&&this.currentDocument&&this.storageAvailable)try{this.persistToStorage(l(this.currentDocument));}catch(e){console.error("Failed to save on destroy:",e);}}checkRecoveryData(){if(!this.storageAvailable)return;let e=this.getRecoveryData();e&&(this._hasRecoveryData=true,this.emitSnapshot(),this.onRecoveryAvailableCallback?.(e));}persistToStorage(e){let r={document:JSON.parse(e),savedAt:new Date().toISOString(),version:c};localStorage.setItem(this.storageKey,JSON.stringify(r));}debounceSave(){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.save();},this.debounceDelay);}stopTimers(){this.intervalTimer&&(clearInterval(this.intervalTimer),this.intervalTimer=null),this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null);}updateStatus(e){this.status=e,this.emitSnapshot();}emitSnapshot(){this.setSnapshot({status:this.status,lastSaveTime:this.lastSaveTime,hasRecoveryData:this._hasRecoveryData,isEnabled:this._isEnabled});}};function p(t){if(!t)return "Never";let e=new Date().getTime()-t.getTime(),r=Math.floor(e/1e3),i=Math.floor(r/60),o=Math.floor(i/60);return r<10?"Just now":r<60?`${r} seconds ago`:i<60?`${i} minute${i===1?"":"s"} ago`:o<24?`${o} hour${o===1?"":"s"} ago`:t.toLocaleDateString()}function D(t){return {idle:"Ready",saving:"Saving...",saved:"Saved",error:"Save failed"}[t]}function y(t=v){try{let s=localStorage.getItem(t);return s?new Blob([s]).size:0}catch{return 0}}function A(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function T(){return h()}export{u as a,p as b,D as c,y as d,A as e,T as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-FCJWLEKT.mjs';import {c as c$1}from'./chunk-7E5VBRDL.mjs';import {a as a$2}from'./chunk-BOOHU5EW.mjs';import {a,b,c}from'./chunk-QPFJJPIC.mjs';import {a as a$3}from'./chunk-AMENZY5F.mjs';function $(e,t,n,i){let a=e-t-n,r=(i.count-1)*i.gap;return (a-r)/i.count}function ce(e){let t={...e.pageSize},n={...e.margins},i=e.columns??{count:1,gap:0},a=false,r,o,s=[],l=[];function c(){return t.h-n.bottom}function m(){return c()-n.top}function f(){return t.w-n.left-n.right}if(m()<=0)throw new Error("Paginator: page size and margins yield no content area");let S=$(t.w,n.left,n.right,i),T=n.top;function M(h){return n.left+h*(S+i.gap)}function x(){(r||o)&&(r&&(t=r),o&&(n=o),r=void 0,o=void 0,S=$(t.w,n.left,n.right,i));let h=s.length+1,P=n.top,E=c(),g=e.footnoteReservedHeights?.get(h)??0,p=E-g,b={number:h,fragments:[],margins:{...n},size:{...t},footnoteReservedHeight:g>0?g:void 0,columns:i.count>1?{...i}:void 0},d={page:b,cursorY:P,columnIndex:0,topMargin:P,contentBottom:p,trailingSpacing:0};return s.push(b),l.push(d),T=P,e.onNewPage&&e.onNewPage(d),d}function B(){return l.length===0?x():l[l.length-1]}function F(h){return h.contentBottom-h.cursorY}function w(h,P){let E=P||B();return F(E)>=h}function R(h){return h.columnIndex<i.count-1?(h.columnIndex+=1,h.cursorY=T,h.trailingSpacing=0,h):x()}function C(h){let P=B(),E=Number.isFinite(h)&&h>0?h:0;for(;!w(E,P);){let g=P.contentBottom-P.topMargin;if(E>g)return a||(a=true,console.warn(`Paginator: fragment height ${E.toFixed(0)}px exceeds page content height ${g.toFixed(0)}px; placing with overflow.`)),P.cursorY!==P.topMargin&&(P=R(P)),P;P=R(P);}return P}function L(h,P,E=0,g=0){let p=Math.max(E,B().trailingSpacing),b=p+P,d=C(b),y=p,z=M(d.columnIndex),I=d.cursorY+y;return h.x=z,h.y=I,d.page.fragments.push(h),d.cursorY=I+P,d.trailingSpacing=g,{state:d,x:z,y:I}}function u(){if(l.length>0){let h=l[l.length-1];if(h.page.fragments.length===0&&h.cursorY===h.topMargin)return h}return x()}function v(){let h=B();return R(h)}function Z(h){i=h,S=$(t.w,n.left,n.right,i);let P=B();P.page.columns=i.count>1?{...i}:void 0,T=P.cursorY,P.columnIndex=0;}function W(h,P,E=true){if(!E){r=h?{...h}:r,o=P?{...P}:o;return}if(h&&(t={...h}),P&&(n={...P}),m()<=0)throw new Error("Paginator: section page size and margins yield no content area");S=$(t.w,n.left,n.right,i),r=void 0,o=void 0;}return {pages:s,states:l,get columnWidth(){return S},get columns(){return {...i}},getCurrentState:B,getAvailableHeight:()=>F(B()),getContentWidth:f,fits:h=>w(h),ensureFits:C,addFragment:L,forcePageBreak:u,forceColumnBreak:v,getColumnX:M,updateColumns:Z,updatePageLayout:W}}function ge(e){let t=new Map,n=new Set;for(let i=0;i<e.length;i++){if(n.has(i))continue;let a=e[i];if(a.kind!=="paragraph"||!a.attrs?.keepNext)continue;let o=[i],s=i;for(let m=i+1;m<e.length;m++){let f=e[m];if(f.kind==="sectionBreak"||f.kind==="pageBreak"||f.kind==="columnBreak"||f.kind!=="paragraph")break;if(f.attrs?.keepNext)o.push(m),s=m,n.add(m);else break}let l=s+1,c=-1;if(l<e.length){let m=e[l];m.kind!=="sectionBreak"&&m.kind!=="pageBreak"&&m.kind!=="columnBreak"&&(c=l);}t.set(i,{startIndex:i,endIndex:s,memberIndices:o,anchorIndex:c});}return t}function fe(e,t,n){let i=0;for(let a of e.memberIndices){let r=t[a],o=n[a];if(r.kind!=="paragraph"||o.kind!=="paragraph")continue;let s=r,l=o,c=s.attrs?.spacing?.before??0;i+=c,i+=l.totalHeight;let m=s.attrs?.spacing?.after??0;i+=m;}if(e.anchorIndex!==-1){let a=n[e.anchorIndex];if(a?.kind==="paragraph"){let r=a;r.lines.length>0&&(i+=r.lines[0].lineHeight);}}return i}function me(e){let t=new Set;for(let n of e.values())for(let i=1;i<n.memberIndices.length;i++)t.add(n.memberIndices[i]);return t}function $e(e){return e.kind!=="paragraph"?false:e.attrs?.keepLines===true}function pe(e){return e.kind!=="paragraph"?false:e.attrs?.pageBreakBefore===true}function q(e){return e.displayMode==="float"||a(e.wrapType)}function qe(e){return q(e)&&!b(e.wrapType)&&e.wrapType!=="topAndBottom"}var Je=1440,de=96,Ce=Je/de,we=11,Le="Calibri",Qe=1,et=.8,tt=.2,j=null;function he(){if(!j){let e=typeof document<"u"?document.createElement("canvas"):null;if(!e)throw new Error("Canvas not available. Ensure this runs in a DOM environment.");if(j=e.getContext("2d"),!j)throw new Error("Failed to get 2D context from canvas")}return j}function Yt(){j=null;}var Be=new Map;function Re(e){let t=Be.get(e);if(t===void 0){let n=a$3(e);t={cssFallback:n.cssFallback,singleLineRatio:n.singleLineRatio},Be.set(e,t);}return t}function nt(e){return Re(e).cssFallback}function be(e){let t=[];e.italic&&t.push("italic"),e.bold&&t.push("bold");let n=e.fontSize??we,i=N(n);t.push(`${i}px`);let a=e.fontFamily??Le;return t.push(nt(a)),t.join(" ")}function K(e){let t=e.fontSize??we,n=e.fontFamily??Le,i=N(t),a=i*et,r=i*tt,o=i*Qe;try{let l=he();l.font=be(e);let c=l.measureText("Hg");typeof c.actualBoundingBoxAscent=="number"&&typeof c.actualBoundingBoxDescent=="number"&&(a=c.actualBoundingBoxAscent,r=c.actualBoundingBoxDescent);}catch{}o=Math.max(o,a+r);let s=Re(n).singleLineRatio;return {fontSize:t,ascent:a,descent:r,lineHeight:o,fontFamily:n,singleLineRatio:s}}function _(e,t){if(!e)return 0;let n=he();n.font=be(t);let a=n.measureText(e).width;return t.letterSpacing&&e.length>1&&(a+=t.letterSpacing*(e.length-1)),a}function Zt(e,t){let n=_(e,t),i=K(t);return {width:n,height:i.ascent+i.descent,ascent:i.ascent,descent:i.descent}}function ve(e,t){let n=K(t);if(!e)return {width:0,charWidths:[],metrics:n};let i=he();i.font=be(t);let a=t.letterSpacing??0,r=[],o=0;for(let s=0;s<e.length;s++){let l=e[s],m=i.measureText(l).width;a&&s<e.length-1&&(m+=a),r.push(m),o+=m;}return {width:o,charWidths:r,metrics:n}}function Ut(e,t){if(t.length===0||e<=0)return 0;let n=0;for(let i=0;i<t.length;i++){let a=t[i],r=n+a/2;if(e<=r)return i;n+=a;}return t.length}function Xt(e,t){if(e<=0||t.length===0)return 0;let n=Math.min(e,t.length),i=0;for(let a=0;a<n;a++)i+=t[a];return i}function Gt(e){return e/Ce}function jt(e){return Math.round(e*Ce)}function N(e){return e*de/72}function it(e){return e*72/de}function Kt(e){return N(e/2)}function Vt(e){return it(e)*2}function xe(e){return e/1440*96}function Se(e){return e/96*1440}function at(e){let{explicitStops:t=[],defaultTabInterval:n=720,leftIndent:i=0}=e,a=t.filter(f=>f.val!=="clear").filter(f=>f.pos>=i),r=t.filter(f=>f.val==="clear").map(f=>f.pos),o=a.reduce((f,S)=>Math.max(f,S.pos),0),s=[...a];i>0&&!a.some(f=>f.pos<=i)&&(r.some(S=>Math.abs(S-i)<20)||s.push({val:"start",pos:i,leader:"none"}));let c=o>0?Math.max(o,i):i,m=i+14400;for(;c<m;){c+=n;let f=a.some(M=>Math.abs(M.pos-c)<20),S=r.some(M=>Math.abs(M-c)<20),T=i>0&&Math.abs(c-i)<20;!f&&!S&&!T&&s.push({val:"start",pos:c,leader:"none"});}return s.sort((f,S)=>f.pos-S.pos)}function Ie(e,t,n={}){let{defaultTabInterval:i=720}=t,a=Se(e),o=at(t).find(c=>c.pos>a);if(!o){let c=xe(i),m=c-e%c;return m<=0&&(m=c),{width:m,alignment:"default"}}let l=xe(o.pos)-e;if(o.val==="center")l-=(n.followingWidth??0)/2;else if(o.val==="end")l-=n.followingWidth??0;else if(o.val==="decimal")l-=n.decimalPrefixWidth??0;else if(o.val==="bar")return {width:0,leader:o.leader,alignment:"bar"};if(l<1){let c=xe(i),m=c-e%c;return m<=0&&(m=c),{width:m,alignment:"default"}}return {width:l,leader:o.leader,alignment:o.val}}var rt="Calibri",ot=11;function st(e){let t=e.attrs,n=e.runs?.find(r=>r.kind==="text"),i=t?.listMarkerFontFamily??n?.fontFamily??t?.defaultFontFamily??rt,a=t?.listMarkerFontSize??n?.fontSize??t?.defaultFontSize??ot;return {fontFamily:i,fontSize:a}}function ke(e){let t=e.attrs;if(!t?.listMarker||t.listMarkerHidden)return 0;let n=t.indent,i=n?.hanging??0;if(i>0)return i;let{fontFamily:a,fontSize:r}=st(e),o={fontFamily:a,fontSize:r},s=_(t.listMarker,o),l=t.listMarkerSuffix??"tab";if(l==="nothing")return s;if(l==="space")return s+_(" ",o);let c=n?.left??0,m=n?.firstLine??0,f=c+m,S=f+s,T=(t.tabs??[]).filter(F=>F.val!=="clear"&&F.val!=="bar").map(F=>a$1(F.pos)).filter(F=>F>=S).sort((F,w)=>F-w)[0],M=a$1(t.defaultTabStopTwips??a$2),x=M>0?(Math.floor(S/M)+1)*M:void 0,B;return T!==void 0&&x!==void 0?B=Math.min(T,x):B=T??x,B===void 0?s+N(r)*.5:B-f}var D=11,X="Calibri",ut=1.15,te=1,Y=.5;function Ee(e,t,n,i=false){let a=1,r=e.length,o=0;for(;a<=r;){let s=a+r>>>1;_(e.slice(0,s),t)<=n?(o=s,a=s+1):r=s-1;}return i&&o===0?1:o}function V(e){return {fontFamily:e.fontFamily??X,fontSize:e.fontSize??D,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function Ae(e,t,n){let i=N(e),a=n?.ascent??i*.8,r=n?.descent??i*.2,o=n?.singleLineRatio??1.15,s=i*o,l;if(t?.lineRule==="exact"&&t.line!==void 0)l=t.line;else if(t?.lineRule==="atLeast"&&t.line!==void 0){let c=s*te;l=Math.max(t.line,c);}else t?.line!==void 0&&t?.lineUnit==="multiplier"?l=s*t.line:t?.line!==void 0&&t?.lineUnit==="px"?l=t.line:l=s*te;return {ascent:a,descent:r,lineHeight:l}}function We(e,t,n){let i=K({fontSize:e,fontFamily:n??X}),a=Ae(e,t,i),r=t?.lineRule??"auto";if(r==="auto"||r==="atLeast"){let o=N(e),s=Math.max(a.lineHeight,o*ut);if(s!==a.lineHeight)return {...a,lineHeight:s}}return a}function J(e){return e.kind==="text"}function _e(e){return e.kind==="tab"}function Oe(e){return e.kind==="image"}function ze(e){return e.kind==="lineBreak"}function Ne(e){return e.kind==="field"}function lt(e){return !e.text||e.text.replace(/\u00a0/g," ").trim().length===0}function ct(e,t){let n=0;for(let i=t+1;i<e.length;i++){let a=e[i];if(_e(a)||ze(a))break;if(J(a))n+=_(a.text||"",V(a));else if(Ne(a)){let r={fontFamily:a.fontFamily??X,fontSize:a.fontSize??D,bold:a.bold,italic:a.italic};n+=_(a.fallback||"1",r);}else Oe(a)&&(n+=a.width||0);}return n}function gt(e){let t=[];for(let n=0;n<e.length;n++){let i=e[n];(i===" "||i==="-"||i===" ")&&t.push(n+1);}return t}function De(e,t,n){let i=Math.max(1,n),a=Math.max(0,e),r=Math.max(0,t);return a>=i||r>=i||a+r>=i?{leftMargin:0,rightMargin:0}:{leftMargin:a,rightMargin:r}}function ft(e,t,n){let i=e.runs,a=e.attrs,r=a?.spacing,o=n?.floatingZones,s=n?.paragraphYOffset??0,l=a?.indent,c$1=l?.left??0,m=l?.right??0,f=(l?.firstLine??0)-(l?.hanging??0),S=Math.max(1,t-c$1-m),T=(l?.hanging??0)===0?ke(e):0,M=Math.max(1,S-f-T),x=0,B=0,F=N(D)*te,w=(g,p)=>{if(!o||o.length===0)return;let b=s+x,d=He(b,g,o,p,U)-b;d>0&&(x+=d,B+=d);};w(F,M);let R=ee(x,F,o,s),C=Math.max(1,Q(R,M)),L=[];if(i.length===0){if(a?.suppressEmptyParagraphHeight)return L.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,ascent:0,descent:0,lineHeight:0}),{kind:"paragraph",lines:L,totalHeight:0};let g=a?.defaultFontSize??D,p=a?.defaultFontFamily??X,b=We(g,r,p);L.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...b});let d=b.lineHeight;return r?.before&&(d+=r.before),r?.after&&(d+=r.after),{kind:"paragraph",lines:L,totalHeight:d}}if(i.length===1&&J(i[0])&<(i[0])){let g=i[0],p=g.fontSize??a?.defaultFontSize??D,b=g.fontFamily??a?.defaultFontFamily??X,d=We(p,r,b);L.push({fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,...d});let y=d.lineHeight;return r?.before&&(y+=r.before),r?.after&&(y+=r.after),{kind:"paragraph",lines:L,totalHeight:y}}let u={fromRun:0,fromChar:0,toRun:0,toChar:0,width:0,maxFontSize:D,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:C,leftOffset:R.leftMargin,rightOffset:R.rightMargin,segmentZones:R.segments},v=()=>{let g=Ae(u.maxFontSize,r,u.maxFontMetrics),p={...g};if(u.maxImageHeightPx>p.lineHeight){let d=u.maxImageHeightPx,y=p.descent;u.fromRun===u.toRun?(p.lineHeight=d+y*2,p.ascent=d+y):(p.lineHeight=d+y,p.ascent=d);}let b={fromRun:u.fromRun,fromChar:u.fromChar,toRun:u.toRun,toChar:u.toChar,width:u.width,...p};u.leftOffset>0&&(b.leftOffset=u.leftOffset),u.rightOffset>0&&(b.rightOffset=u.rightOffset),u.segmentZones?.length&&(b.segments=Z(b,u.segmentZones)),B>0&&(b.floatSkipBefore=B,B=0),L.push(b),x+=g.lineHeight;},Z=(g,p)=>{let b=p[0],d=p[1];if(!b)return;if(!d||g.width<=b.availableWidth+Y)return [{fromRun:g.fromRun,fromChar:g.fromChar,toRun:g.toRun,toChar:g.toChar,width:g.width,leftOffset:b.leftOffset,availableWidth:b.availableWidth}];if(g.fromRun!==g.toRun)return;let y=i[g.fromRun];if(!y||!J(y))return;let z=y,I=z.text.slice(g.fromChar,g.toChar),H=V(z),k=Ee(I,H,b.availableWidth);if(k<=0||k>=I.length)return;let O=g.fromChar+k,A=I.slice(0,k),ie=I.slice(k);return [{fromRun:g.fromRun,fromChar:g.fromChar,toRun:g.toRun,toChar:O,width:_(A,H),leftOffset:b.leftOffset,availableWidth:b.availableWidth},{fromRun:g.fromRun,fromChar:O,toRun:g.toRun,toChar:g.toChar,width:_(ie,H),leftOffset:d.leftOffset,availableWidth:d.availableWidth}]},W=(g,p)=>{v();let b=N(D)*te;w(b,S);let d=ee(x,b,o,s),y=Math.max(1,Q(d,S));u={fromRun:g,fromChar:p,toRun:g,toChar:p,width:0,maxFontSize:D,maxFontMetrics:null,maxImageHeightPx:0,availableWidth:y,leftOffset:d.leftMargin,rightOffset:d.rightMargin,segmentZones:d.segments};},h=g=>{let p=g.fontSize??D;(!u.maxFontMetrics||p>u.maxFontSize)&&(u.maxFontSize=p,u.maxFontMetrics=K(g));};for(let g=0;g<i.length;g++){let p=i[g];if(ze(p)){u.toRun=g,u.toChar=0,W(g+1,0);continue}if(_e(p)){let b=V(p);h(b);let d=ct(i,g),y=u.width+(u.leftOffset??0),z=L.length===0,I=c$1+(z?f:0)+y,H={explicitStops:a?.tabs,leftIndent:Se(c$1)},k=Ie(I,H,{followingWidth:d}).width;if(y+k>u.availableWidth+Y){let O=u.availableWidth-y-d;O>1&&(k=O);}u.width+k>u.availableWidth+Y&&(W(g,0),h(b)),u.width+=k,u.toRun=g,u.toChar=1;continue}if(Oe(p)){let b=p.wrapType,d=p.displayMode==="float"||c(b);if(p.position&&d){u.toRun=g,u.toChar=1;continue}if(b==="topAndBottom"||p.displayMode==="block"){u.width>0&&W(g,0);let H=p.height,k=p.distTop??6,O=p.distBottom??6;u.toRun=g,u.toChar=1,u.maxImageHeightPx=H+k+O,W(g+1,0);continue}let y=p.width,I=p.height+(p.distTop??0)+(p.distBottom??0);I>u.maxImageHeightPx&&(u.maxImageHeightPx=I),u.width+y>u.availableWidth+Y&&W(g,0),u.width+=y,u.toRun=g,u.toChar=1;continue}if(Ne(p)){let b=p.fallback||"1",d={fontFamily:p.fontFamily??X,fontSize:p.fontSize??D,bold:p.bold,italic:p.italic};h(d);let y=_(b,d);u.width>0&&u.width+y>u.availableWidth+Y&&(W(g,0),h(d)),u.width+=y,u.toRun=g,u.toChar=1;continue}if(J(p)){let b=p,d=b.text,y=V(b);if(h(y),!d||d.length===0){u.toRun=g,u.toChar=0;continue}let z=gt(d),I=0;for(;I<d.length;){let H=d.length;for(let A of z)if(A>I){H=A;break}let k=d.slice(I,H),O=_(k,y);if(O>u.availableWidth+Y){let A=0;for(;A<k.length;){let ie=u.availableWidth-u.width+Y,je=k.slice(A),ae=Ee(je,y,ie);if(ae===0){if(u.width>0){W(g,I+A),h(y);continue}ae=1;}let re=A+ae,Ke=k.slice(A,re),Ve=_(Ke,y);u.width+=Ve,u.toRun=g,u.toChar=I+re,A=re,A<k.length&&(W(g,I+A),h(y));}I=H;continue}u.width>0&&u.width+O>u.availableWidth+Y&&(W(g,I),h(y)),u.width+=O,u.toRun=g,u.toChar=H,I=H;}}}v();let E=L.reduce((g,p)=>g+p.lineHeight+(p.floatSkipBefore??0),0);return r?.before&&(E+=r.before),r?.after&&(E+=r.after),{kind:"paragraph",lines:L,totalHeight:E}}function ln(e,t){return e.map(n=>ft(n,t))}function cn(e){let t=V(e);return ve(e.text,t).charWidths}function mn(e,t){return e.map(n=>{let i=n.x-n.distLeft,a=n.x+n.width+n.distRight,r=n.y-n.distTop,o=n.y+n.height+n.distBottom,s=0,l=0,c,m=n.wrapText??"bothSides";m==="right"?s=Me(a):m==="left"?l=Te(i,t):m==="largest"?{leftMargin:s,rightMargin:l}=ht(i,a,t):pt(i,a,t)?c=dt(i,a,t):n.side==="left"?s=Me(a):l=Te(i,t);let f=De(s,l,t);return {leftMargin:f.leftMargin,rightMargin:f.rightMargin,topY:r,bottomY:o,segments:c}})}function Q(e,t){return e.segments?.reduce((i,a)=>i+a.availableWidth,0)??t-e.leftMargin-e.rightMargin}function ee(e,t,n,i){if(!n||n.length===0)return {leftMargin:0,rightMargin:0};let a=0,r=0,o,s=i+e,l=s+t;for(let c of n)if(!(l<=c.topY||s>=c.bottomY)){if(c.segments?.length){o=o?mt(o,c.segments):c.segments;continue}a=Math.max(a,c.leftMargin),r=Math.max(r,c.rightMargin);}return {leftMargin:a,rightMargin:r,segments:o}}function He(e,t,n,i,a){if(!n||n.length===0)return e;let r=e;for(let o=0;o<n.length+2;o++){let s=ee(r,t,n,0);if(Q(s,i)>=a)return r;let c=r+t,m=1/0;for(let f of n)c<=f.topY||r>=f.bottomY||f.bottomY>r&&f.bottomY<m&&(m=f.bottomY);if(!Number.isFinite(m)||m<=r)return r;r=m;}return r}function mt(e,t){let n=[];for(let i of e)for(let a of t){let r=Math.max(i.leftOffset,a.leftOffset),o=Math.min(i.leftOffset+i.availableWidth,a.leftOffset+a.availableWidth);o>r&&n.push({leftOffset:r,availableWidth:o-r});}return n}var U=24;function pt(e,t,n){return e>U&&t+U<n}function dt(e,t,n){return [{leftOffset:0,availableWidth:Math.max(0,e)},{leftOffset:Math.max(0,t),availableWidth:Math.max(0,n-t)}].filter(i=>i.availableWidth>1)}function ht(e,t,n){let i=Math.max(0,e);return Math.max(0,n-t)>=i?{leftMargin:Me(t),rightMargin:0}:{leftMargin:0,rightMargin:Te(e,n)}}function Me(e){return Math.max(0,e)}function Te(e,t){return Math.max(0,t-e)}var Ye={count:1,gap:0};function bt(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}:{...Ye},pendingColumns:null,activeOrientation:null,pendingOrientation:null,hasAnyPages:false}}function xt(e,t){return t.count>1}function ne(e){return e?{count:e.count,gap:e.gap}:{...Ye}}function St(e,t,n){let i={...t},a=e.type??"continuous",r=e.margins,o=e.pageSize,s=e.orientation;r&&(typeof r.top=="number"&&(i.pendingTopMargin=Math.max(0,r.top)),typeof r.bottom=="number"&&(i.pendingBottomMargin=Math.max(0,r.bottom)),typeof r.left=="number"&&(i.pendingLeftMargin=Math.max(0,r.left)),typeof r.right=="number"&&(i.pendingRightMargin=Math.max(0,r.right))),o&&(i.pendingPageSize={w:o.w,h:o.h}),s&&(i.pendingOrientation=s);let l=xt((e.margins,void 0),i.activeColumns);switch(a){case "nextPage":return i.pendingColumns=ne(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false},state:i};case "evenPage":return i.pendingColumns=ne(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false,requiredParity:"even"},state:i};case "oddPage":return i.pendingColumns=ne(void 0),{decision:{forcePageBreak:true,forceMidPageRegion:false,requiredParity:"odd"},state:i};default:return l?(i.pendingColumns=ne(void 0),{decision:{forcePageBreak:false,forceMidPageRegion:true},state:i}):{decision:{forcePageBreak:false,forceMidPageRegion:false},state:i}}}function Mt(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 Tt(e){return {top:e.pendingTopMargin??e.activeTopMargin,bottom:e.pendingBottomMargin??e.activeBottomMargin,left:e.pendingLeftMargin??e.activeLeftMargin,right:e.pendingRightMargin??e.activeRightMargin}}function yt(e){return e.pendingPageSize??e.activePageSize}function Pt(e){return e.pendingColumns??e.activeColumns}function Ft(e,t){for(let n=0;n<e.pages.length;n++)for(let i of e.pages[n].fragments){if(i.pmStart==null)continue;let a=i.pmStart,r=i.pmEnd??a+1;if(t>=a&&t<r)return n}return null}var Bt={w:816,h:1056},G={top:96,right:96,bottom:96,left:96},Xe={count:1,gap:0};function Ct(e,t,n){let i=[],a=[],r=t;for(let o=0;o<e.length;o++){if(e[o].kind!=="sectionBreak")continue;let s=e[o],l={pageSize:s.pageSize??r.pageSize,margins:s.margins??r.margins,columns:s.columns};i.push(l),a.push(o),r=l;}return i.push(n),{configs:i,breakIndices:a}}function Ge(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 Ze(e){let t=e.attrs?.spacing?.before??0;return Ge(e)&&!e.attrs?.spacingExplicit?.before?0:t}function Ue(e){let t=e.attrs?.spacing?.after??0;return Ge(e)&&!e.attrs?.spacingExplicit?.after?0:t}function wt(e){for(let t=0;t<e.length-1;t++){let n=e[t],i=e[t+1];if(n.kind!=="paragraph"||i.kind!=="paragraph")continue;let a=n.attrs,r=i.attrs;a?.contextualSpacing&&r?.contextualSpacing&&a.styleId&&a.styleId===r.styleId&&(a.spacing&&(a.spacing={...a.spacing,after:0}),r.spacing&&(r.spacing={...r.spacing,before:0}));}}function yn(e,t,n={}){if(e.length!==t.length)throw new Error(`layoutDocument: expected one measure per block (blocks=${e.length}, measures=${t.length})`);let i=n.pageSize??Bt,a={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 r={...a},o=n.finalPageSize??i,s=n.finalMargins??r;if(i.w-r.left-r.right<=0)throw new Error("layoutDocument: page size and margins yield no content area");let c={pageSize:i,margins:r,columns:n.columns},m={pageSize:o,margins:s,columns:n.columns},{configs:f,breakIndices:S}=Ct(e,c,m),T=[...S.map(R=>e[R].type),n.bodyBreakType],M=f[0]??c,x=ce({pageSize:M.pageSize,margins:M.margins,columns:M.columns??Xe,footnoteReservedHeights:n.footnoteReservedHeights});wt(e);let B=ge(e),F=me(B),w=0;for(let R=0;R<e.length;R++){let C=e[R],L=t[R];pe(C)&&x.forcePageBreak();let u=B.get(R);if(u&&!F.has(R)){let v=fe(u,e,t),Z=x.getCurrentState(),W=x.getAvailableHeight(),h=Z.contentBottom-Z.topMargin;v<=h&&v>W&&Z.page.fragments.length>0&&x.forcePageBreak();}switch(C.kind){case "paragraph":Lt(C,L,x,x.getContentWidth());break;case "table":C.floating?kt(C,L,x,x.getContentWidth()):It(C,L,x);break;case "image":Et(C,L,x);break;case "textBox":Ht(C,L,x);break;case "pageBreak":x.forcePageBreak();break;case "columnBreak":x.forceColumnBreak();break;case "sectionBreak":{let v=T[w+1]??T[w];At(C,x,f[w+1]??M,v),w++;break}default:c$1(C,"runLayoutPipeline");}}return x.pages.length===0&&x.getCurrentState(),{pageSize:i,pages:x.pages,columns:n.columns,pageGap:n.pageGap}}function Lt(e,t,n,i){if(t.kind!=="paragraph")throw new Error("layoutParagraph: expected paragraph measure");let a=t.lines;if(a.length===0){let l=Ze(e),c=Ue(e),m=n.getCurrentState(),f={kind:"paragraph",blockId:e.id,x:n.getColumnX(m.columnIndex),y:m.cursorY+l,width:i,height:0,fromLine:0,toLine:0,pmStart:e.pmStart,pmEnd:e.pmEnd};n.addFragment(f,0,l,c);return}let r=Ze(e),o=Ue(e),s=0;for(;s<a.length;){let l=n.getCurrentState(),c=n.getAvailableHeight(),m=0,f=0;for(let w=s;w<a.length;w++){let R=a[w].lineHeight+(a[w].floatSkipBefore??0),C=m+R;if((s===0&&w===s?C+r:C)<=c||f===0)m=C,f++;else break}let S=s===0,T=s+f>=a.length,M=S?r:0,x=T?o:0,B={kind:"paragraph",blockId:e.id,x:n.getColumnX(l.columnIndex),y:0,width:i,height:m,fromLine:s,toLine:s+f,pmStart:e.pmStart,pmEnd:e.pmEnd,continuesFromPrev:!S,continuesOnNext:!T},F=n.addFragment(B,m,M,x);B.y=F.y,s+=f,s<a.length&&n.ensureFits(a[s].lineHeight);}}function Rt(e){let t=0;for(let n of e.rows)if(n.isHeader)t++;else break;return t}function vt(e,t){let n=0;for(let i=0;i<t&&i<e.rows.length;i++)n+=e.rows[i].height;return n}function It(e,t,n){if(t.kind!=="table")throw new Error("layoutTable: expected table measure");let i=t.rows;if(i.length===0)return;let a=Rt(e),r=vt(t,a),o=0;for(;o<i.length;){let s=n.getCurrentState(),l=n.getAvailableHeight(),c=o===0,m=c?s.trailingSpacing:0,f=l-m,S=!c&&a>0?r:0,T=0,M=0;for(let C=o;C<i.length;C++){let L=i[C].height;if(T+L+S<=f||M===0)T+=L,M++;else break}let x=T+S,B=o+M>=i.length,F=n.getColumnX(s.columnIndex);e.justification==="center"?F=F+(n.columnWidth-t.totalWidth)/2:e.justification==="right"?F=F+n.columnWidth-t.totalWidth:e.indent&&(F+=e.indent);let w={kind:"table",blockId:e.id,x:F,y:0,width:t.totalWidth,height:x,fromRow:o,toRow:o+M,pmStart:e.pmStart,pmEnd:e.pmEnd,continuesFromPrev:!c,continuesOnNext:!B,headerRowCount:!c&&a>0?a:void 0},R=n.addFragment(w,x,0,0);if(w.y=R.y,w.x=F,o+=M,o<i.length){let C=i[o].height+(a>0?r:0);n.ensureFits(C);}}}function kt(e,t,n,i){if(t.kind!=="table")throw new Error("layoutFloatingTable: expected table measure");let a=n.getCurrentState(),r=e.floating,o=a.page,s=o.margins,l=t.totalWidth,c=t.totalHeight,m=o.size.h-s.top-s.bottom,f=s.left,S=s.top;r?.horzAnchor==="page"&&(f=0),r?.vertAnchor==="page"&&(S=0),r?.vertAnchor==="text"&&(S=a.cursorY);let T=n.getColumnX(a.columnIndex);if(r?.tblpX!==void 0)T=f+r.tblpX;else if(r?.tblpXSpec){let v=r.tblpXSpec;v==="left"||v==="inside"?T=f:v==="right"||v==="outside"?T=f+i-l:v==="center"&&(T=f+(i-l)/2);}else e.justification==="center"?T=f+(i-l)/2:e.justification==="right"&&(T=f+i-l);let M=a.cursorY,x=false;if(r?.tblpY!==void 0)M=S+r.tblpY,x=true;else if(r?.tblpYSpec){x=true;let v=r.tblpYSpec;v==="top"?M=S:v==="bottom"?M=S+m-c:v==="center"&&(M=S+(m-c)/2);}x||(M=n.ensureFits(c).cursorY);let B=s.left,F=s.left+i-l;Number.isFinite(F)&&(T=Math.max(B,Math.min(T,F)));let w={kind:"table",blockId:e.id,x:T,y:M,width:l,height:c,fromRow:0,toRow:e.rows.length,pmStart:e.pmStart,pmEnd:e.pmEnd,isFloating:true};a.page.fragments.push(w);let R=r?.leftFromText??0,C=r?.rightFromText??0,L=T-s.left-R,u=s.left+i-(T+l)-C;if(L<U&&u<U){let v=M+c+(r?.bottomFromText??0);v>a.cursorY&&(a.cursorY=v);}}function Et(e,t,n){if(t.kind!=="image")throw new Error("layoutImage: expected image measure");if(e.anchor?.isAnchored){Wt(e,t,n);return}let i=n.ensureFits(t.height),a={kind:"image",blockId:e.id,x:n.getColumnX(i.columnIndex),y:0,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd},r=n.addFragment(a,t.height,0,0);a.y=r.y;}function Wt(e,t,n){let i=n.getCurrentState(),a=e.anchor,r=a.offsetH??n.getColumnX(i.columnIndex),o=a.offsetV??i.cursorY,s={kind:"image",blockId:e.id,x:r,y:o,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd,isAnchored:true,zIndex:a.behindDoc?-1:1};i.page.fragments.push(s);}function Ht(e,t,n){if(t.kind!=="textBox")throw new Error("layoutTextBox: expected textBox measure");if(q(e)){let o=n.getCurrentState(),s={kind:"textBox",blockId:e.id,x:n.getColumnX(o.columnIndex),y:o.cursorY,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd,isFloating:true,zIndex:e.wrapType==="behind"?-1:1};o.page.fragments.push(s);return}let i=n.ensureFits(t.height),a={kind:"textBox",blockId:e.id,x:n.getColumnX(i.columnIndex),y:0,width:t.width,height:t.height,pmStart:e.pmStart,pmEnd:e.pmEnd},r=n.addFragment(a,t.height,0,0);a.y=r.y;}function At(e,t,n,i){switch(i??"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??Xe);}export{fe as A,me as B,$e as C,pe as D,q as E,qe as F,bt as G,St as H,Mt as I,Tt as J,yt as K,Pt as L,Ft as M,Ct as N,yn as O,vt as P,he as a,Yt as b,be as c,K as d,_ as e,Zt as f,ve as g,Ut as h,Xt as i,Gt as j,jt as k,N as l,it as m,Kt as n,Vt as o,mn as p,ee as q,Ie as r,st as s,ke as t,De as u,ft as v,ln as w,cn as x,ce as y,ge as z};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {d}from'./chunk-OEXVWIHW.mjs';import {i,j,h,l,g,k as k$1,e as e$1}from'./chunk-WLHNIXWC.mjs';import {e}from'./chunk-VW22RZ6C.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
|
+
`)}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 chunkD4RPOJC7_js=require('./chunk-D4RPOJC7.js'),chunkIP2VXNWG_js=require('./chunk-IP2VXNWG.js'),chunkJFZIXFRC_js=require('./chunk-JFZIXFRC.js'),chunkMZOVDLYL_js=require('./chunk-MZOVDLYL.js'),chunkSHJBS42Y_js=require('./chunk-SHJBS42Y.js'),chunkMJ5FQX7Q_js=require('./chunk-MJ5FQX7Q.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js');function j(e){if(!e)return [];let n=[];return e.bold&&n.push(chunkSHJBS42Y_js.b.mark("bold")),e.italic&&n.push(chunkSHJBS42Y_js.b.mark("italic")),e.underline&&e.underline.style!=="none"&&n.push(chunkSHJBS42Y_js.b.mark("underline",{style:e.underline.style,color:e.underline.color})),(e.strike||e.doubleStrike)&&n.push(chunkSHJBS42Y_js.b.mark("strike",{double:e.doubleStrike||false})),e.color&&!e.color.auto&&n.push(chunkSHJBS42Y_js.b.mark("textColor",{rgb:e.color.rgb,themeColor:e.color.themeColor,themeTint:e.color.themeTint,themeShade:e.color.themeShade})),e.highlight&&e.highlight!=="none"&&n.push(chunkSHJBS42Y_js.b.mark("highlight",{color:e.highlight})),e.fontSize&&n.push(chunkSHJBS42Y_js.b.mark("fontSize",{size:e.fontSize})),e.fontFamily&&n.push(chunkSHJBS42Y_js.b.mark("fontFamily",{ascii:e.fontFamily.ascii,hAnsi:e.fontFamily.hAnsi,eastAsia:e.fontFamily.eastAsia,cs:e.fontFamily.cs,asciiTheme:e.fontFamily.asciiTheme,hAnsiTheme:e.fontFamily.hAnsiTheme,eastAsiaTheme:e.fontFamily.eastAsiaTheme,csTheme:e.fontFamily.csTheme})),e.vertAlign==="superscript"?n.push(chunkSHJBS42Y_js.b.mark("superscript")):e.vertAlign==="subscript"&&n.push(chunkSHJBS42Y_js.b.mark("subscript")),e.allCaps&&n.push(chunkSHJBS42Y_js.b.mark("allCaps")),e.smallCaps&&n.push(chunkSHJBS42Y_js.b.mark("smallCaps")),(e.spacing!=null||e.position!=null||e.scale!=null||e.kerning!=null)&&n.push(chunkSHJBS42Y_js.b.mark("characterSpacing",{spacing:e.spacing??null,position:e.position??null,scale:e.scale??null,kerning:e.kerning??null})),e.emboss&&n.push(chunkSHJBS42Y_js.b.mark("emboss")),e.imprint&&n.push(chunkSHJBS42Y_js.b.mark("imprint")),e.shadow&&n.push(chunkSHJBS42Y_js.b.mark("textShadow")),e.emphasisMark&&e.emphasisMark!=="none"&&n.push(chunkSHJBS42Y_js.b.mark("emphasisMark",{type:e.emphasisMark})),e.outline&&n.push(chunkSHJBS42Y_js.b.mark("textOutline")),e.hidden&&n.push(chunkSHJBS42Y_js.b.mark("hidden")),e.rtl&&n.push(chunkSHJBS42Y_js.b.mark("rtl")),e.effect&&e.effect!=="none"&&n.push(chunkSHJBS42Y_js.b.mark("textEffect",{effect:e.effect})),n}function E(e,n){if(!e)return;if(!n)return e;let o=n.resolveRunStyle(e.styleId);return o?chunkMZOVDLYL_js.a(o,e):e}function ee(e,n){let o="",r,t=e.type==="simpleField"?e.content:e.fieldResult;if(t){for(let s of t)if(s.type==="run"){for(let c of s.content)c.type==="text"&&(o+=c.text);!r&&s.formatting&&(r=s.formatting);}}let i=chunkMZOVDLYL_js.a(n,r),l=j(i);return chunkSHJBS42Y_js.b.node("field",{fieldType:e.fieldType,instruction:e.instruction,displayText:o,fieldKind:e.type==="simpleField"?"simple":"complex",fldLock:e.fldLock??false,dirty:e.dirty??false},void 0,l)}function te(e){return chunkSHJBS42Y_js.b.node("math",{display:e.display,ommlXml:e.ommlXml,plainText:e.plainText||""})}function X(e,n,o){let r=[],t=e.formatting?.styleId?o?.getRunStyleOwnProperties(e.formatting.styleId):void 0,i=chunkMZOVDLYL_js.a(chunkMZOVDLYL_js.a(n,t),e.formatting),l=j(i);for(let s of e.content){let c=fe(s,l);r.push(...c);}return r}function fe(e,n){switch(e.type){case "text":return e.text?[chunkSHJBS42Y_js.b.text(e.text,n)]:[];case "break":return e.breakType==="textWrapping"||!e.breakType?[chunkSHJBS42Y_js.b.node("hardBreak",null,void 0,n)]:[];case "tab":return [chunkSHJBS42Y_js.b.node("tab",null,void 0,n)];case "drawing":return e.image?[be(e.image)]:[];case "shape":{let t=e.shape;return t.textBody&&t.textBody.content.length>0?[]:[ye(t)]}case "footnoteRef":let o=chunkSHJBS42Y_js.b.mark("footnoteRef",{id:e.id.toString(),noteType:"footnote"});return [chunkSHJBS42Y_js.b.text(e.id.toString(),[...n,o])];case "endnoteRef":let r=chunkSHJBS42Y_js.b.mark("footnoteRef",{id:e.id.toString(),noteType:"endnote"});return [chunkSHJBS42Y_js.b.text(e.id.toString(),[...n,r])];default:return []}}function be(e){let n=e.size?.width?chunk4Q2IP5FW_js.e(e.size.width):void 0,o=e.size?.height?chunk4Q2IP5FW_js.e(e.size.height):void 0,r=e.wrap.type,t=e.wrap.wrapText,i=e.position?.horizontal?.alignment,l;r==="inline"||r==="topAndBottom"?l="none":r==="square"||r==="tight"||r==="through"?t==="left"?l="right":t==="right"||i==="left"?l="left":i==="right"?l="right":l="none":l="none";let s="inline";r==="inline"?s="inline":r==="topAndBottom"?s="block":chunkJFZIXFRC_js.b(r)||l&&l!=="none"?s="float":s="block";let c;if(e.transform){let P=[];e.transform.rotation&&P.push(`rotate(${e.transform.rotation}deg)`),e.transform.flipH&&P.push("scaleX(-1)"),e.transform.flipV&&P.push("scaleY(-1)"),P.length>0&&(c=P.join(" "));}let u=e.wrap.distT?chunk4Q2IP5FW_js.e(e.wrap.distT):void 0,f=e.wrap.distB?chunk4Q2IP5FW_js.e(e.wrap.distB):void 0,a=e.wrap.distL?chunk4Q2IP5FW_js.e(e.wrap.distL):void 0,m=e.wrap.distR?chunk4Q2IP5FW_js.e(e.wrap.distR):void 0,p;e.position&&(p={horizontal:e.position.horizontal?{relativeTo:e.position.horizontal.relativeTo,posOffset:e.position.horizontal.posOffset,align:e.position.horizontal.alignment}:void 0,vertical:e.position.vertical?{relativeTo:e.position.vertical.relativeTo,posOffset:e.position.vertical.posOffset,align:e.position.vertical.alignment}:void 0});let S,w,M;if(e.outline&&e.outline.width){S=Math.round(e.outline.width/914400*96*100)/100,e.outline.color?.rgb&&(w=`#${e.outline.color.rgb}`);let P={solid:"solid",dot:"dotted",dash:"dashed",lgDash:"dashed",dashDot:"dashed",lgDashDot:"dashed",lgDashDotDot:"dashed",sysDot:"dotted",sysDash:"dashed",sysDashDot:"dashed",sysDashDotDot:"dashed"};M=e.outline.style&&P[e.outline.style]||"solid";}let z=e.padding?.top?chunk4Q2IP5FW_js.e(e.padding.top):void 0,I=e.padding?.bottom?chunk4Q2IP5FW_js.e(e.padding.bottom):void 0,B=e.padding?.left?chunk4Q2IP5FW_js.e(e.padding.left):void 0,g=e.padding?.right?chunk4Q2IP5FW_js.e(e.padding.right):void 0;return chunkSHJBS42Y_js.b.node("image",{src:e.src||"",alt:e.alt,title:e.title,width:n,height:o,rId:e.rId,wrapType:r,displayMode:s,cssFloat:l,transform:c,distTop:u,distBottom:f,distLeft:a,distRight:m,position:p,borderWidth:S,borderColor:w,borderStyle:M,wrapText:t,hlinkHref:e.hlinkHref,cropTop:e.crop?.top,cropRight:e.crop?.right,cropBottom:e.crop?.bottom,cropLeft:e.crop?.left,opacity:e.opacity,effectExtentTop:z,effectExtentBottom:I,effectExtentLeft:B,effectExtentRight:g,layoutInCell:e.layoutInCell,allowOverlap:e.allowOverlap})}function K(e,n,o){let r=[],t=e.href||(e.anchor?`#${e.anchor}`:""),i=chunkSHJBS42Y_js.b.mark("hyperlink",{href:t,tooltip:e.tooltip,rId:e.rId});for(let l of e.children)if(l.type==="run"){let s=l.formatting?.styleId?o?.getRunStyleOwnProperties(l.formatting.styleId):void 0,c=chunkMZOVDLYL_js.a(chunkMZOVDLYL_js.a(n,s),l.formatting),f=[...j(c),i];for(let a of l.content)r.push(...fe(a,f));}return r}function ye(e){let n=e.size?.width?chunk4Q2IP5FW_js.e(e.size.width):100,o=e.size?.height?chunk4Q2IP5FW_js.e(e.size.height):80,r,t="solid",i,l,s;if(e.fill&&(t=e.fill.type,e.fill.color?.rgb&&(r=`#${e.fill.color.rgb}`),e.fill.type==="gradient"&&e.fill.gradient)){let m=e.fill.gradient;i=m.type,l=m.angle,s=JSON.stringify(m.stops.map(p=>({position:p.position,color:p.color.rgb?`#${p.color.rgb}`:"#000000"})));}let c,u,f;e.outline&&(e.outline.width&&(c=Math.round(e.outline.width/914400*96*100)/100),e.outline.color?.rgb&&(u=`#${e.outline.color.rgb}`),f=e.outline.style||"solid");let a;if(e.transform){let m=[];e.transform.rotation&&m.push(`rotate(${e.transform.rotation}deg)`),e.transform.flipH&&m.push("scaleX(-1)"),e.transform.flipV&&m.push("scaleY(-1)"),m.length>0&&(a=m.join(" "));}return chunkSHJBS42Y_js.b.node("shape",{shapeType:e.shapeType||"rect",shapeId:e.id,width:n,height:o,fillColor:r,fillType:t,gradientType:i,gradientAngle:l,gradientStops:s,outlineWidth:c,outlineColor:u,outlineStyle:f,transform:a})}function V(e,n,o,r){let t=Pe(e,n),i=[],l,s=new Set,c;n&&(c=n.resolveParagraphStyle(e.formatting?.styleId).runFormatting);let u=chunkMZOVDLYL_js.a(c,r);for(let f of e.content){if(f.type==="commentRangeStart")s.add(f.id);else if(f.type==="commentRangeEnd")s.delete(f.id);else if(f.type==="run"){let a=X(f,u,n);s.size>0&&(a=O(a,s)),i.push(...a);}else if(f.type==="hyperlink"){let a=K(f,u,n);i.push(...a);}else if(f.type==="simpleField"||f.type==="complexField"){let a=ee(f,u);a&&i.push(a);}else if(f.type==="inlineSdt"){let a=ce(f,u,n);a&&i.push(a);}else if(f.type==="insertion"){let a=J(f,"insertion",u,n);s.size>0&&(a=O(a,s)),i.push(...a);}else if(f.type==="deletion"){let a=J(f,"deletion",u,n);s.size>0&&(a=O(a,s)),i.push(...a);}else if(f.type==="moveFrom"){let a=J(f,"deletion",u,n,true);s.size>0&&(a=O(a,s)),i.push(...a);}else if(f.type==="moveTo"){let a=J(f,"insertion",u,n,true);s.size>0&&(a=O(a,s)),i.push(...a);}else if(f.type==="mathEquation"){let a=te(f);a&&i.push(a);}f.type==="bookmarkStart"&&(l||(l=[]),l.push({id:f.id,name:f.name}));}return l&&(t.bookmarks=l),chunkSHJBS42Y_js.b.node("paragraph",t,i)}function O(e,n){if(n.size===0)return e;let o=[...n][0],r=chunkSHJBS42Y_js.b.marks.comment.create({commentId:o});return e.map(t=>t.isText?t.mark(r.addToSet(t.marks)):t)}function J(e,n,o,r,t=false){let i=[];for(let s of e.content)s.type==="run"?i.push(...X(s,o,r)):s.type==="hyperlink"&&i.push(...K(s,o,r));let l=chunkSHJBS42Y_js.b.marks[n].create({revisionId:e.info.id,author:e.info.author,date:e.info.date??null,isMovePair:t});return i.map(s=>s.isText?s.mark(l.addToSet(s.marks)):s)}function Pe(e,n){let o=e.formatting,r=o?.styleId,t={paraId:e.paraId??void 0,textId:e.textId??void 0,styleId:r,numPr:o?.numPr,listNumFmt:e.listRendering?.numFmt,listIsBullet:e.listRendering?.isBullet,listMarker:e.listRendering?.marker,listMarkerHidden:e.listRendering?.markerHidden||void 0,listMarkerFontFamily:e.listRendering?.markerFontFamily||void 0,listMarkerFontSize:e.listRendering?.markerFontSize||void 0,listMarkerSuffix:e.listRendering?.markerSuffix||void 0,listLevelNumFmts:e.listRendering?.levelNumFmts||void 0,listAbstractNumId:e.listRendering?.abstractNumId,listStartOverride:e.listRendering?.startOverride,_originalFormatting:o||void 0};if(n){let i=n.resolveParagraphStyle(r),l=i.paragraphFormatting,s=i.runFormatting;t.alignment=o?.alignment??l?.alignment,t.spaceBefore=o?.spaceBefore??l?.spaceBefore,t.spaceAfter=o?.spaceAfter??l?.spaceAfter,t.lineSpacing=o?.lineSpacing??l?.lineSpacing,t.lineSpacingRule=o?.lineSpacingRule??l?.lineSpacingRule,o?.spacingExplicit&&(t.spacingExplicit=o.spacingExplicit),t.indentLeft=o?.indentLeft??l?.indentLeft,t.indentRight=o?.indentRight??l?.indentRight,t.indentFirstLine=o?.indentFirstLine??l?.indentFirstLine,t.hangingIndent=o?.hangingIndent??l?.hangingIndent,t.borders=o?.borders??l?.borders,t.shading=o?.shading??l?.shading,t.tabs=o?.tabs??l?.tabs,t.pageBreakBefore=o?.pageBreakBefore??l?.pageBreakBefore,t.keepNext=o?.keepNext??l?.keepNext,t.keepLines=o?.keepLines??l?.keepLines,t.contextualSpacing=o?.contextualSpacing??l?.contextualSpacing,t.outlineLevel=o?.outlineLevel??l?.outlineLevel,t.bidi=o?.bidi??l?.bidi;let c=n.getDefaultCharacterStyle()?.rPr,u=c?chunkMZOVDLYL_js.a(s,c):s,f=E(o?.runProperties,n);t.defaultTextFormatting=chunkMZOVDLYL_js.a(u,f),!o?.numPr&&l?.numPr&&l.numPr.numId!==0&&(t.numPr=l.numPr);}else t.alignment=o?.alignment,t.spaceBefore=o?.spaceBefore,t.spaceAfter=o?.spaceAfter,t.lineSpacing=o?.lineSpacing,t.lineSpacingRule=o?.lineSpacingRule,o?.spacingExplicit&&(t.spacingExplicit=o.spacingExplicit),t.indentLeft=o?.indentLeft,t.indentRight=o?.indentRight,t.indentFirstLine=o?.indentFirstLine,t.hangingIndent=o?.hangingIndent,t.borders=o?.borders,t.shading=o?.shading,t.tabs=o?.tabs,t.pageBreakBefore=o?.pageBreakBefore,t.keepNext=o?.keepNext,t.keepLines=o?.keepLines,t.outlineLevel=o?.outlineLevel,t.bidi=o?.bidi,t.defaultTextFormatting=E(o?.runProperties,n);if(e.sectionProperties){t._sectionProperties=e.sectionProperties;let i=e.sectionProperties.sectionStart;(i==="nextPage"||i==="continuous"||i==="oddPage"||i==="evenPage")&&(t.sectionBreakType=i);}return e.renderedPageBreakBefore&&(t.renderedPageBreakBefore=true),e.pPrIns&&(t.pPrIns={revisionId:e.pPrIns.id,author:e.pPrIns.author,date:e.pPrIns.date??null}),e.pPrDel&&(t.pPrDel={revisionId:e.pPrDel.id,author:e.pPrDel.author,date:e.pPrDel.date??null}),e.propertyChanges&&e.propertyChanges.length>0&&(t.pPrChange=e.propertyChanges),t}function ce(e,n,o){let r=e.properties,t=[];for(let i of e.content)if(i.type==="run"){let l=X(i,n,o);t.push(...l);}else if(i.type==="hyperlink"){let l=K(i,n,o);t.push(...l);}else if(i.type==="simpleField"||i.type==="complexField"){let l=ee(i,n);l&&t.push(l);}else if(i.type==="inlineSdt"){let l=ce(i,n,o);l&&t.push(l);}else if(i.type==="mathEquation"){let l=te(i);l&&t.push(l);}return chunkSHJBS42Y_js.b.node("sdt",{sdtType:r.sdtType,alias:r.alias??null,tag:r.tag??null,lock:r.lock??null,placeholder:r.placeholder??null,showingPlaceholder:r.showingPlaceholder??false,dateFormat:r.dateFormat??null,listItems:r.listItems?JSON.stringify(r.listItems):null,checked:r.checked??null},t.length>0?t:void 0)}function ue(e){function n(r){return r.type==="break"&&r.breakType==="page"}function o(r){if(r.type==="run"){for(let t of r.content)if(n(t))return true;return false}if(r.type==="hyperlink"){for(let t of r.children)if(t.type==="run"&&o(t))return true;return false}if(r.type==="insertion"||r.type==="deletion"){let t=r;for(let i of t.content)if(o(i))return true;return false}return false}for(let r of e.content)if(o(r))return true;return false}function R(e,n,o){if(!e||!n)return;let r=e.getStyle(n);if(!r?.tblStylePr)return;let t=r.tblStylePr.find(c=>c.type===o);if(!t)return;let i=E(t.pPr?.runProperties,e),l=E(t.rPr,e),s=chunkMZOVDLYL_js.a(i,l);return {tcPr:t.tcPr,rPr:s}}function N(e,n){if(!e&&!n)return;if(!e)return n;if(!n)return e;let o={},r=e.tcPr,t=n.tcPr;if(r||t){let i={...r??{},...t??{}};(r?.borders||t?.borders)&&(i.borders={...r?.borders??{},...t?.borders??{}}),(r?.shading||t?.shading)&&(i.shading={...r?.shading??{},...t?.shading??{}}),(r?.margins||t?.margins)&&(i.margins={...r?.margins??{},...t?.margins??{}}),o.tcPr=i;}return o.rPr=chunkMZOVDLYL_js.a(e.rPr,n.rPr),o}function Ce(e){let n=new Map,o=e.rows.length,r=new Map;for(let t=0;t<o;t++){let i=e.rows[t],l=0,s=i.cells.map(u=>{let f=u.formatting?.gridSpan??1,a=l;return l+=f,{colIndex:a,vMerge:u.formatting?.vMerge,key:`${t}-${a}`}});if(s.length>0&&s.every(({colIndex:u,vMerge:f})=>f==="continue"&&r.has(u))){for(let{colIndex:u,key:f}of s)r.delete(u),n.set(f,{rowSpan:1,skip:false});continue}for(let{colIndex:u,vMerge:f,key:a}of s){let m=u;if(f==="restart")r.set(m,t),n.set(a,{rowSpan:1,skip:false});else if(f==="continue"){let p=r.get(m);if(p!==void 0){let S=`${p}-${m}`,w=n.get(S);w&&w.rowSpan++,n.set(a,{rowSpan:1,skip:true});}else n.set(a,{rowSpan:1,skip:false});}else r.delete(m),n.set(a,{rowSpan:1,skip:false});}}return n}function Y(e,n,o){let r=Ce(e),t=e.columnWidths,i=t?.reduce((P,x)=>P+x,0)??0,l=e.formatting?.styleId,s=e.formatting?.look,c=l?n?.getStyle(l):void 0,u=n?.getDefaultTableStyle(),f=e.formatting?.borders??c?.tblPr?.borders??u?.tblPr?.borders,a=e.formatting?.cellMargins??c?.tblPr?.cellMargins??u?.tblPr?.cellMargins??void 0,m=a?{top:a.top?.value,bottom:a.bottom?.value,left:a.left?.value,right:a.right?.value}:void 0,p={styleId:e.formatting?.styleId,width:e.formatting?.width?.value,widthType:e.formatting?.width?.type,justification:e.formatting?.justification,columnWidths:t,floating:e.formatting?.floating,cellMargins:m,look:e.formatting?.look,_originalFormatting:e.formatting||void 0};e.propertyChanges&&e.propertyChanges.length>0&&(p.tblPrChange=e.propertyChanges);let S={wholeTable:R(n,l,"wholeTable"),firstRow:R(n,l,"firstRow"),lastRow:R(n,l,"lastRow"),firstCol:R(n,l,"firstCol"),lastCol:R(n,l,"lastCol"),band1Horz:R(n,l,"band1Horz"),band2Horz:R(n,l,"band2Horz"),band1Vert:R(n,l,"band1Vert"),band2Vert:R(n,l,"band2Vert"),nwCell:R(n,l,"nwCell"),neCell:R(n,l,"neCell"),swCell:R(n,l,"swCell"),seCell:R(n,l,"seCell")},w=s?.noHBand!==true,M=s?.noVBand!==true,z=0,I=e.rows.length,B=t?.length??Math.max(0,...e.rows.map(P=>P.cells.reduce((x,k)=>x+(k.formatting?.gridSpan??1),0))),g=e.rows.map((P,x)=>{let k=x===0&&!!s?.firstRow,v=x===I-1&&!!s?.lastRow,h=w&&!k&&!v?z%2===0?S.band1Horz:S.band2Horz:void 0;return w&&!k&&!v&&z++,we(P,n,k,t,i,S,h,M,s,f,x,I,B,r,m,o)});return chunkSHJBS42Y_js.b.node("table",p,g)}function we(e,n,o,r,t,i,l,s,c,u,f,a,m,p,S,w){let M={height:e.formatting?.height?.value,heightRule:e.formatting?.heightRule,isHeader:!!e.formatting?.header,_originalFormatting:e.formatting||void 0};if(e.structuralChange){let C=e.structuralChange,D={revisionId:C.info.id,author:C.info.author,date:C.info.date??null};C.type==="tableRowInsertion"?M.trIns=D:C.type==="tableRowDeletion"&&(M.trDel=D);}e.propertyChanges&&e.propertyChanges.length>0&&(M.trPrChange=e.propertyChanges);let z=e.cells.length,I=f===0,B=f===(a??1)-1,g=e.formatting?.conditionalFormat,P=g?.firstRow??I,x=g?.lastRow??B,k=m??z,v=0,h=[];for(let C=0;C<e.cells.length;C++){let D=e.cells[C],H=D.formatting?.gridSpan??1,ge=`${f??0}-${v}`,oe=p?.get(ge),he=oe?.skip??false,Te=oe?.rowSpan??1,re;if(r&&t&&t>0){let q=0;for(let A=0;A<H&&v+A<r.length;A++)q+=r[v+A];re=Math.round(q/t*100);}if(v+=H,he)continue;let ie=v-H===0,le=v===k,b=D.formatting?.conditionalFormat,G=b?.firstRow??P,Q=b?.lastRow??x,$=b?.firstColumn??ie,W=b?.lastColumn??le,_;if(s){let q=c?.firstColumn?1:0,A=v-H-q;A>=0&&!(c?.lastColumn&&W)&&!(c?.firstColumn&&$)&&(_=A%2===0?i?.band1Vert:i?.band2Vert);}b?.oddVBand?_=i?.band1Vert:b?.evenVBand&&(_=i?.band2Vert);let L=l;g?.oddHBand?L=i?.band1Horz:g?.evenHBand&&(L=i?.band2Horz),b?.oddHBand?L=i?.band1Horz:b?.evenHBand&&(L=i?.band2Horz);let T=i?.wholeTable;T=N(T,L),T=N(T,_),G&&(c?.firstRow||g?.firstRow||b?.firstRow)&&(T=N(T,i?.firstRow)),Q&&(c?.lastRow||g?.lastRow||b?.lastRow)&&(T=N(T,i?.lastRow)),$&&(c?.firstColumn||g?.firstColumn||b?.firstColumn)&&(T=N(T,i?.firstCol)),W&&(c?.lastColumn||g?.lastColumn||b?.lastColumn)&&(T=N(T,i?.lastCol)),G&&$&&(c?.firstRow||g?.firstRow||b?.firstRow)&&(c?.firstColumn||g?.firstColumn||b?.firstColumn)&&(T=N(T,i?.nwCell)),G&&W&&(c?.firstRow||g?.firstRow||b?.firstRow)&&(c?.lastColumn||g?.lastColumn||b?.lastColumn)&&(T=N(T,i?.neCell)),Q&&$&&(c?.lastRow||g?.lastRow||b?.lastRow)&&(c?.firstColumn||g?.firstColumn||b?.firstColumn)&&(T=N(T,i?.swCell)),Q&&W&&(c?.lastRow||g?.lastRow||b?.lastRow)&&(c?.lastColumn||g?.lastColumn||b?.lastColumn)&&(T=N(T,i?.seCell)),h.push(pe(D,n,o,re,T,u,I,B,ie,le,Te,S,w));}if(h.length===0){let C=Math.max(k,1),D={formatting:C>1?{gridSpan:C}:void 0,content:[{type:"paragraph",content:[]}]},H=N(i?.wholeTable,l);h.push(pe(D,n,o,t&&t>0?100:void 0,H,u,I,B,true,true,1,S,w));}return chunkSHJBS42Y_js.b.node("tableRow",M,h)}var xe=["top","bottom","left","right","insideH","insideV"];function Fe(e,n){if(!e)return e;let o;for(let r of xe){let t=e[r];if(!t?.color?.themeColor||t.color.auto)continue;let i=chunkMJ5FQX7Q_js.b(t.color,n);i&&(o??(o={...e}),o[r]={...t,color:{rgb:i}});}return o??e}function pe(e,n,o,r,t,i,l,s,c,u,f,a,m){let p=e.formatting,S=f??1,w=p?.width?.value,M=p?.width?.type;w===void 0&&r!==void 0&&(w=r,M="pct");let z=chunkMJ5FQX7Q_js.b(p?.shading?.fill??t?.tcPr?.shading?.fill,m),I=i?{top:l?i.top:i.insideH,bottom:s?i.bottom:i.insideH,left:c?i.left:i.insideV,right:u?i.right:i.insideV}:void 0,B=t?.tcPr?.borders,g=p?.borders,P=Fe(I||B||g?{...I??{},...B??{},...g??{}}:void 0,m),x={colspan:p?.gridSpan??1,rowspan:S,width:w,widthType:M,verticalAlign:p?.verticalAlign,backgroundColor:z,textDirection:p?.textDirection,noWrap:p?.noWrap,borders:P,margins:p?.margins?{top:p.margins.top?.value,bottom:p.margins.bottom?.value,left:p.margins.left?.value,right:p.margins.right?.value}:t?.tcPr?.margins?{top:t.tcPr.margins.top?.value,bottom:t.tcPr.margins.bottom?.value,left:t.tcPr.margins.left?.value,right:t.tcPr.margins.right?.value}:a,_originalFormatting:p||void 0,_originalResolvedFill:z};if(e.structuralChange){let h=e.structuralChange,C={revisionId:h.info.id,author:h.info.author,date:h.info.date??null};h.type==="tableCellInsertion"?x.cellMarker={kind:"ins",info:C}:h.type==="tableCellDeletion"?x.cellMarker={kind:"del",info:C}:h.type==="tableCellMerge"&&(x.cellMarker={kind:"merge",info:C,vMerge:h.vMerge??"cont",...h.vMergeOrig?{vMergeOrig:h.vMergeOrig}:{}});}e.propertyChanges&&e.propertyChanges.length>0&&(x.tcPrChange=e.propertyChanges);let k=[];for(let h of e.content)h.type==="paragraph"?k.push(V(h,n,void 0,t?.rPr)):h.type==="table"&&k.push(Y(h,n));k.length===0&&k.push(chunkSHJBS42Y_js.b.node("paragraph",{},[]));let v=o?"tableHeader":"tableCell";return chunkSHJBS42Y_js.b.node(v,x,k)}function ne(e,n){let o=Se(e),r=V(e,n),t=[],i=o.length>0&&r.content.size===0,{anchored:l,inFlow:s}=ke(o);for(let c of l)t.push(me(c,n));i||t.push(r);for(let c of s)t.push(me(c,n));return t}function ke(e){let n=[],o=[];for(let r of e)chunkD4RPOJC7_js.a(r)?n.push(r):o.push(r);return {anchored:n,inFlow:o}}function Se(e){let n=[];for(let o of e.content)if(o.type==="run"){for(let r of o.content)if(r.type==="shape"&&"shape"in r){let t=r.shape;t.textBody&&t.textBody.content.length>0&&n.push({type:"textBox",id:t.id,size:t.size,position:t.position,wrap:t.wrap,fill:t.fill,outline:t.outline,content:t.textBody.content,margins:t.textBody.margins});}}return n}function me(e,n){let o=e.size?.width?chunk4Q2IP5FW_js.e(e.size.width):200,r=e.size?.height?chunk4Q2IP5FW_js.e(e.size.height):void 0,t;e.fill?.color?.rgb&&(t=`#${e.fill.color.rgb}`);let i,l,s;e.outline&&e.outline.width&&(i=Math.round(e.outline.width/914400*96*100)/100,e.outline.color?.rgb&&(l=`#${e.outline.color.rgb}`),s=e.outline.style||"solid");let c=e.margins?.top!=null?chunk4Q2IP5FW_js.e(e.margins.top):4,u=e.margins?.bottom!=null?chunk4Q2IP5FW_js.e(e.margins.bottom):4,f=e.margins?.left!=null?chunk4Q2IP5FW_js.e(e.margins.left):7,a=e.margins?.right!=null?chunk4Q2IP5FW_js.e(e.margins.right):7,m=[];for(let p of e.content)m.push(V(p,n));return m.length===0&&m.push(chunkSHJBS42Y_js.b.node("paragraph",{},[])),chunkSHJBS42Y_js.b.node("textBox",{width:o,height:r,textBoxId:e.id,fillColor:t,outlineWidth:i,outlineColor:l,outlineStyle:s,marginTop:c,marginBottom:u,marginLeft:f,marginRight:a,...chunkD4RPOJC7_js.b(e)},m)}function it(e,n){let o=e.package.document.content,r=[],t=e.package.theme??null,i=n?.styles?chunkIP2VXNWG_js.b(n.styles):null;for(let l of o)if(l.type==="paragraph")r.push(...ne(l,i)),ue(l)&&r.push(chunkSHJBS42Y_js.b.node("pageBreak"));else if(l.type==="table"){let s=Y(l,i,t);r.push(s);}return r.length===0&&r.push(chunkSHJBS42Y_js.b.node("paragraph",{},[])),chunkSHJBS42Y_js.b.node("doc",{defaultTabStopTwips:e.package.settings?.defaultTabStop??null},r)}function Re(e,n){let o=[],r=n?.styles?chunkIP2VXNWG_js.b(n.styles):null,t=n?.theme??null;for(let i of e)i.type==="paragraph"?o.push(...ne(i,r)):i.type==="table"&&o.push(Y(i,r,t));return o.length===0&&o.push(chunkSHJBS42Y_js.b.node("paragraph",{},[])),chunkSHJBS42Y_js.b.node("doc",{defaultTabStopTwips:n?.defaultTabStopTwips??null},o)}function lt(e,n){return Re(e,n)}function st(){return chunkSHJBS42Y_js.b.node("doc",null,[chunkSHJBS42Y_js.b.node("paragraph",{},[])])}exports.a=it;exports.b=Re;exports.c=lt;exports.d=st;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n={top:4,bottom:4,left:7,right:7},o=200;function a(e,t){let r=e.kind??"<unknown>";throw new Error(`${t}: unhandled FlowBlock kind "${r}". Add the case alongside the other FlowBlock switches (see types.ts).`)}export{n as a,o as b,a as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var prosemirrorState=require('prosemirror-state');var i={Highest:0,High:50,Default:100,Low:150,Lowest:200};function u(n){return e=>{let t={...n.defaultOptions,...e};return {type:"extension",config:{name:n.name,priority:n.priority??i.Default,options:t},onSchemaReady(o){return n.onSchemaReady(o,t)}}}}function d(n){return e=>{let t={...n.defaultOptions,...e},o=typeof n.nodeSpec=="function"?n.nodeSpec(t):n.nodeSpec;return {type:"node",config:{name:n.name,priority:n.priority??i.Default,options:t,schemaNodeName:n.schemaNodeName,nodeSpec:o},onSchemaReady(r){return n.onSchemaReady?.(r,t)??{}}}}}function g(n){return e=>{let t={...n.defaultOptions,...e},o=typeof n.markSpec=="function"?n.markSpec(t):n.markSpec;return {type:"mark",config:{name:n.name,priority:n.priority??i.Default,options:t,schemaMarkName:n.schemaMarkName,markSpec:o},onSchemaReady(r){return n.onSchemaReady?.(r,t)??{}}}}}var s=new prosemirrorState.PluginKey("suggestionMode"),S="suggestionModeApplied",f="suggestionModeBypass";var p=Date.now();function x(){return p++}function M(n){let e=s.getState(n);return e?.active?{revisionId:x(),author:e.author,date:new Date().toISOString()}:null}exports.a=i;exports.b=u;exports.c=d;exports.d=g;exports.e=s;exports.f=S;exports.g=f;exports.h=x;exports.i=M;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var l=new Set,d=new Map,y=new Set,f=new Map,w=new Set,p=new Set,u=false;function m(t,n){let e=t instanceof Error?t.message:String(t),o=new Error(`[font] ${n}: ${e}`,{cause:t});if(p.size>0)for(let i of p)try{i(o);}catch(a){console.error("Font error subscriber threw:",a);}else console.warn(o.message);}function x(t,n="normal"){return `${t.trim()}|${n}`}function P(t,n=[400,700],e=["normal","italic"]){let o=encodeURIComponent(t),i=[];for(let s of e){let r=s==="italic"?1:0;for(let c of n)i.push(`${r},${c}`);}i.sort();let a=i.join(";");return `https://fonts.googleapis.com/css2?family=${o}:ital,wght@${a}&display=swap`}async function h(t,n){if(typeof document>"u")return false;let e=t.trim();if(l.has(e))return true;let o=d.get(e);if(o)return o;let i=(async()=>{u=true;try{let a=P(e,n?.weights,n?.styles),s=document.createElement("link");return s.rel="stylesheet",s.href=a,await new Promise(c=>{s.onload=()=>c(!0),s.onerror=()=>c(!1),document.head.appendChild(s),setTimeout(()=>c(!1),5e3);})?(await b(e,3e3),l.add(e),F([e]),!0):!1}catch(a){return m(a,`failed to load "${e}"`),false}finally{d.delete(e),d.size===0&&f.size===0&&(u=false);}})();return d.set(e,i),i}async function A(t,n){let e=t.filter(o=>!l.has(o.trim()));e.length!==0&&await Promise.all(e.map(o=>h(o,n)));}function T(t){return l.has(t.trim())}function z(){return u}function G(){return Array.from(l)}function U(t){return w.add(t),()=>{w.delete(t);}}function F(t){for(let n of w)try{n(t);}catch(e){m(e,"load callback threw");}}function I(t){return p.add(t),()=>{p.delete(t);}}async function b(t,n){if("fonts"in document)try{let e=`400 16px "${t}"`;return await Promise.race([document.fonts.load(e),new Promise(o=>setTimeout(o,n))]),document.fonts.check(e)}catch{}return await new Promise(e=>setTimeout(e,100)),true}function M(t,n="sans-serif"){if(typeof document>"u")return false;let e=(i,a)=>{let r=document.createElement("canvas").getContext("2d");if(!r)return false;r.textBaseline="top";let c="abcdefghijklmnopqrstuvwxyz0123456789";r.font=`72px ${a}`;let g=r.measureText(c).width;return r.font=`72px "${i}", ${a}`,r.measureText(c).width!==g};return e(t,n)?true:e(t,n==="sans-serif"?"serif":"sans-serif")}async function R(t,n,e){if(typeof document>"u")return false;let o=t.trim(),i=x(o,e?.weight);if(y.has(i))return true;let a=f.get(i);if(a)return a;let s=(async()=>{u=true;try{let r=new Blob([n],{type:"font/ttf"}),c=URL.createObjectURL(r),g=document.createElement("style");return g.textContent=`
|
|
2
|
+
@font-face {
|
|
3
|
+
font-family: "${o}";
|
|
4
|
+
src: url(${c}) format('truetype');
|
|
5
|
+
font-weight: ${e?.weight??"normal"};
|
|
6
|
+
font-display: swap;
|
|
7
|
+
}
|
|
8
|
+
`,document.head.appendChild(g),await b(o,3e3),y.add(i),l.add(o),F([o]),!0}catch(r){return m(r,`failed to load "${o}" from buffer`),false}finally{f.delete(i),d.size===0&&f.size===0&&(u=false);}})();return f.set(i,s),s}function C(t){let n=t.split("?")[0].split("#")[0].toLowerCase();return n.endsWith(".woff2")?"woff2":n.endsWith(".woff")?"woff":n.endsWith(".otf")?"opentype":"truetype"}async function $(t,n,e){if(typeof document>"u")return false;if(/[<>]/.test(n))return m(new Error(`invalid src URL for "${t}": contains '<' or '>'`),"rejected src"),false;let o=t.trim(),i=x(o,e?.weight);if(y.has(i))return true;let a=f.get(i);if(a)return a;let s=(async()=>{u=true;try{let r=document.createElement("style");return r.textContent=`
|
|
9
|
+
@font-face {
|
|
10
|
+
font-family: "${o}";
|
|
11
|
+
src: url(${JSON.stringify(n)}) format('${C(n)}');
|
|
12
|
+
font-weight: ${e?.weight??"normal"};
|
|
13
|
+
font-display: swap;
|
|
14
|
+
}
|
|
15
|
+
`,document.head.appendChild(r),await b(o,3e3),y.add(i),l.add(o),F([o]),!0}catch(r){return m(r,`failed to load "${o}" from ${n}`),false}finally{f.delete(i),d.size===0&&f.size===0&&(u=false);}})();return f.set(i,s),s}async function D(t){!t||t.length===0||await Promise.all(t.map(n=>$(n.family,n.src,{weight:n.weight})));}var k={Calibri:"Carlito",Cambria:"Caladea",Arial:"Arimo","Times New Roman":"Tinos","Courier New":"Cousine",Garamond:"EB Garamond","Book Antiqua":"EB Garamond",Georgia:"Tinos",Verdana:"Open Sans",Tahoma:"Open Sans","Trebuchet MS":"Source Sans Pro","Century Gothic":"Poppins","Franklin Gothic":"Libre Franklin",Palatino:"EB Garamond","Palatino Linotype":"EB Garamond","Lucida Sans":"Open Sans","Segoe UI":"Open Sans",Impact:"Anton","Comic Sans MS":"Comic Neue",Consolas:"Inconsolata","Lucida Console":"Inconsolata",Monaco:"Fira Code"};function S(t){let n=t.trim();return k[n]||n}async function E(t){let n=t.trim(),e=S(n);if(e!==n){let o=await h(e);return o&&l.add(n),o}return h(e)}async function v(t){let n=[...new Set(t.map(e=>e.trim()))];await Promise.all(n.map(e=>E(e)));}async function W(){await A(["Carlito","Caladea","Arimo","Tinos","Cousine","EB Garamond"]);}function B(t){let n=new Set,e=t;if(!e?.package)return n;let o=e.package?.document?.content;if(Array.isArray(o)){for(let a of o)if(a?.type==="paragraph"&&Array.isArray(a.content)){for(let s of a.content)if(s?.type==="run"&&s.formatting?.fontFamily){let{ascii:r,hAnsi:c}=s.formatting.fontFamily;r&&n.add(r),c&&c!==r&&n.add(c);}}}let i=e.package?.styles?.styles;if(Array.isArray(i)){for(let a of i)if(a?.runProperties?.fontFamily){let{ascii:s,hAnsi:r}=a.runProperties.fontFamily;s&&n.add(s),r&&r!==s&&n.add(r);}}return n}async function O(t){let n=B(t);n.size!==0&&await v(Array.from(n));}async function j(t){if(t instanceof ArrayBuffer)return t;if(t instanceof Uint8Array){let n=new ArrayBuffer(t.byteLength);return new Uint8Array(n).set(t),n}if(t instanceof Blob)return t.arrayBuffer();throw new TypeError(`Unsupported DocxInput type: ${typeof t}`)}export{h as a,A as b,T as c,z as d,G as e,U as f,I as g,M as h,R as i,$ as j,D as k,k as l,S as m,E as n,v as o,W as p,B as q,O as r,j as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var b=".layout-page-content";function T(l){return Array.from(l.querySelectorAll(`${b} span[data-pm-start][data-pm-end]`))}function C(l){return Array.from(l.querySelectorAll(`${b} .layout-empty-run`))}function D(l){return Array.from(l.querySelectorAll(`${b} [data-pm-start]`))}function B(l,a){return Number.isFinite(a)?l.querySelector(`${b} [data-pm-start="${a}"]`):null}function P(l,a,s,f=1){let g=document.elementsFromPoint(a,s),d=g.find(t=>t.classList.contains("layout-page"));if(!d)return null;let n=g.find(t=>t.tagName==="SPAN"&&t.dataset.pmStart!==void 0&&t.dataset.pmEnd!==void 0);if(n)return L(n,a);let u=g.find(t=>t.classList.contains("layout-empty-run"));if(u){let t=u.closest(".layout-paragraph");if(t&&t.dataset.pmStart)return Number(t.dataset.pmStart)}let i=g.find(t=>t.classList.contains("layout-paragraph")&&t.dataset.pmStart!==void 0);if(i&&i.dataset.pmStart){let t=N(i,a,s);return t!==null?t:Number(i.dataset.pmStart)}let o=g.find(t=>t.classList.contains("layout-table-cell"));return o?N(o,a,s):A(l,d,a,s)}function L(l,a,s){let f=Number(l.dataset.pmStart),g=Number(l.dataset.pmEnd);if(l.classList.contains("layout-run-tab")){let e=l.getBoundingClientRect(),c=(e.left+e.right)/2;return a<c?f:g}let d=l.firstChild;if(!d||d.nodeType!==Node.TEXT_NODE)return f;let n=d,u=n.length;if(u===0)return f;let i=l.ownerDocument;if(!i)return f;let o=0,t=u;for(;o<t;){let e=Math.floor((o+t)/2),c=i.createRange();c.setStart(n,e),c.setEnd(n,e);let m=c.getBoundingClientRect().left;a<m?t=e:o=e+1;}if(o>0&&o<=u){let e=i.createRange();e.setStart(n,o-1),e.setEnd(n,o-1);let c=e.getBoundingClientRect();e.setStart(n,Math.min(o,u)),e.setEnd(n,Math.min(o,u));let r=e.getBoundingClientRect(),m=Math.abs(a-c.left),p=Math.abs(a-r.left);if(m<p)return f+(o-1)}return f+Math.min(o,g-f)}function N(l,a,s){let f=l.querySelector(".layout-empty-run");if(f){let e=f.closest(".layout-paragraph");if(e&&e.dataset.pmStart)return Number(e.dataset.pmStart)}let g=l.querySelectorAll(".layout-line"),d=null,n=1/0;for(let e of Array.from(g)){let c=e,r=c.getBoundingClientRect(),m=(r.top+r.bottom)/2,p=Math.abs(s-m);p<n&&(n=p,d=c);}if(!d){let e=l.querySelector(".layout-paragraph[data-pm-start]");return e?.dataset.pmStart?Number(e.dataset.pmStart):l.dataset.pmStart?Number(l.dataset.pmStart):null}let u=d.querySelectorAll("span[data-pm-start][data-pm-end]");if(u.length===0){let e=d.closest(".layout-paragraph");return e?.dataset.pmStart?Number(e.dataset.pmStart):null}let i=null,o=1/0;for(let e of Array.from(u)){let c=e,r=c.getBoundingClientRect();if(a>=r.left&&a<=r.right)return L(c,a);let m=a<r.left?r.left-a:a-r.right;m<o&&(o=m,i=c);}if(!i)return null;let t=i.getBoundingClientRect();return a<t.left?Number(i.dataset.pmStart):Number(i.dataset.pmEnd)}function A(l,a,s,f,g){if(a.querySelectorAll("span[data-pm-start][data-pm-end]").length===0){let r=a.querySelectorAll(".layout-paragraph");if(r.length>0){let m=r[0];return Number(m.dataset.pmStart)||0}return null}let n=a.querySelectorAll(".layout-line"),u=null,i=1/0;for(let r of Array.from(n)){let m=r,p=m.getBoundingClientRect(),E=(p.top+p.bottom)/2,h=Math.abs(f-E);h<i&&(i=h,u=m);}if(!u)return null;let o=u.querySelectorAll("span[data-pm-start][data-pm-end]");if(o.length===0){let r=u.closest(".layout-paragraph");return r?.dataset.pmStart?Number(r.dataset.pmStart):null}let t=null,e=1/0;for(let r of Array.from(o)){let m=r,p=m.getBoundingClientRect();if(s>=p.left&&s<=p.right)return L(m,s);let E=s<p.left?p.left-s:s-p.right;E<e&&(e=E,t=m);}if(!t)return null;let c=t.getBoundingClientRect();return s<c.left?Number(t.dataset.pmStart):Number(t.dataset.pmEnd)}function w(l,a,s,f){let g=[],d=T(l);for(let n of Array.from(d)){let u=n,i=Number(u.dataset.pmStart);if(Number(u.dataset.pmEnd)<=a||i>=s)continue;let t=u.firstChild;if(!t||t.nodeType!==Node.TEXT_NODE)continue;let e=t,c=u.ownerDocument;if(!c)continue;let r=Math.max(0,a-i),m=Math.min(e.length,s-i);if(r>=m)continue;let p=c.createRange();p.setStart(e,r),p.setEnd(e,m);let E=p.getClientRects(),h=u.closest(".layout-page"),M=h?Number(h.dataset.pageNumber||1)-1:0;for(let y of Array.from(E))g.push({x:y.left-f.left,y:y.top-f.top,width:y.width,height:y.height,pageIndex:M});}return g}function O(l,a,s){let f=T(l);for(let d of Array.from(f)){let n=d,u=Number(n.dataset.pmStart),i=Number(n.dataset.pmEnd);if(n.classList.contains("layout-run-tab")){if(a>=u&&a<i){let o=n.getBoundingClientRect(),t=n.closest(".layout-page"),e=t?Number(t.dataset.pageNumber||1)-1:0,c=n.closest(".layout-line"),r=c?c.offsetHeight:16;return {x:o.left-s.left,y:o.top-s.top,height:r,pageIndex:e}}continue}if(a>=u&&a<=i){let o=n.firstChild;if(!o||o.nodeType!==Node.TEXT_NODE){let y=n.getBoundingClientRect(),S=n.closest(".layout-page"),x=S?Number(S.dataset.pageNumber||1)-1:0,H=n.closest(".layout-line"),R=H?H.offsetHeight:16;return {x:y.left-s.left,y:y.top-s.top,height:R,pageIndex:x}}let t=o,e=Math.min(a-u,t.length),c=n.ownerDocument;if(!c)continue;let r=c.createRange();r.setStart(t,e),r.setEnd(t,e);let m=r.getBoundingClientRect(),p=n.closest(".layout-page"),E=p?Number(p.dataset.pageNumber||1)-1:0,h=n.closest(".layout-line"),M=h?h.offsetHeight:16;return {x:m.left-s.left,y:m.top-s.top,height:M,pageIndex:E}}}let g=l.querySelectorAll(".layout-paragraph");for(let d of Array.from(g)){let n=d,u=Number(n.dataset.pmStart),i=Number(n.dataset.pmEnd);if(a>=u&&a<=i){let t=n.querySelector(".layout-empty-run")||n,e=t.getBoundingClientRect(),c=n.closest(".layout-page"),r=c?Number(c.dataset.pageNumber||1)-1:0,p=(t.closest(".layout-line")||t).offsetHeight||16;return {x:e.left-s.left,y:e.top-s.top,height:p,pageIndex:r}}}return null}exports.a=T;exports.b=C;exports.c=D;exports.d=B;exports.e=P;exports.f=w;exports.g=O;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkHKVAW3RE_js=require('./chunk-HKVAW3RE.js'),chunkSORYYVJ7_js=require('./chunk-SORYYVJ7.js'),chunkLTHT4A4S_js=require('./chunk-LTHT4A4S.js'),chunkDROCYKAR_js=require('./chunk-DROCYKAR.js'),chunkF44ZLDZS_js=require('./chunk-F44ZLDZS.js'),chunk7AMYZMCX_js=require('./chunk-7AMYZMCX.js'),chunkBHBOAP6Z_js=require('./chunk-BHBOAP6Z.js'),chunkN3Y5BUKV_js=require('./chunk-N3Y5BUKV.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js');var Y={fragment:"layout-fragment",paragraph:"layout-fragment-paragraph",table:"layout-fragment-table",image:"layout-fragment-image",line:"layout-line",run:"layout-run"};function ft(e){return e.kind==="paragraph"}function gt(e){return e.kind==="table"}function mt(e){return e.kind==="image"}function de(e){e.style.position="absolute",e.style.overflow="hidden";}function ht(e,t,n){let o=n.createElement("div");return o.className=`${Y.fragment} ${Y.paragraph}`,de(o),o.dataset.blockId=String(e.blockId),o.dataset.fromLine=String(e.fromLine),o.dataset.toLine=String(e.toLine),e.pmStart!==void 0&&(o.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(o.dataset.pmEnd=String(e.pmEnd)),e.continuesFromPrev&&(o.dataset.continuesFromPrev="true"),e.continuesOnNext&&(o.dataset.continuesOnNext="true"),o}function ut(e,t,n){let o=n.createElement("div");return o.className=`${Y.fragment} ${Y.table}`,de(o),o.dataset.blockId=String(e.blockId),o.dataset.fromRow=String(e.fromRow),o.dataset.toRow=String(e.toRow),e.pmStart!==void 0&&(o.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(o.dataset.pmEnd=String(e.pmEnd)),o}function yt(e,t,n){let o=n.createElement("div");return o.className=`${Y.fragment} ${Y.image}`,de(o),o.dataset.blockId=String(e.blockId),e.pmStart!==void 0&&(o.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(o.dataset.pmEnd=String(e.pmEnd)),e.isAnchored&&(o.dataset.anchored="true"),e.zIndex!==void 0&&(o.style.zIndex=String(e.zIndex)),o}function we(e,t,n={}){let o=n.document??document;if(ft(e))return ht(e,t,o);if(gt(e))return ut(e,t,o);if(mt(e))return yt(e,t,o);let r=o.createElement("div");r.className=Y.fragment,de(r);let i=e;return i.blockId!==void 0&&(r.dataset.blockId=String(i.blockId)),i.kind&&(r.dataset.kind=i.kind),r}var L={fragment:"layout-paragraph",line:"layout-line",run:"layout-run",text:"layout-run-text",tab:"layout-run-tab",image:"layout-run-image",lineBreak:"layout-run-linebreak"};function z(e){return e.kind==="text"}function O(e){return e.kind==="tab"}function G(e){return e.kind==="image"}function V(e){return e.kind==="lineBreak"}function U(e){return e.kind==="field"}var Ke={image:"layout-image",imageAnchored:"layout-image-anchored"};function te(e){return !!(e.cropTop||e.cropRight||e.cropBottom||e.cropLeft||e.opacity!=null&&e.opacity<1)}function ne(e,t){let n=t.cropTop??0,o=t.cropRight??0,r=t.cropBottom??0,i=t.cropLeft??0;(n||o||r||i)&&(e.style.clipPath=`inset(${n*100}% ${o*100}% ${r*100}% ${i*100}%)`),t.opacity!=null&&t.opacity<1&&(e.style.opacity=String(Math.max(0,t.opacity)));}function Z(e,t,n,o,r={}){let i=r.document??document,a=i.createElement("div");a.className=Ke.image,e.isAnchored&&a.classList.add(Ke.imageAnchored),a.style.position="absolute",a.style.width=`${e.width}px`,a.style.height=`${e.height}px`,a.style.overflow="hidden",e.zIndex!==void 0&&(a.style.zIndex=String(e.zIndex)),t.anchor?.behindDoc&&(a.style.zIndex="-1"),a.dataset.blockId=String(e.blockId),e.pmStart!==void 0&&(a.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(a.dataset.pmEnd=String(e.pmEnd));let c=i.createElement("img");if(c.src=t.src,c.alt=t.alt??"",c.style.width="100%",c.style.height="100%",c.style.objectFit="contain",c.style.display="block",t.transform&&(c.style.transform=t.transform),c.draggable=false,t.hlinkHref){let s=i.createElement("a");s.href=t.hlinkHref,s.target="_blank",s.rel="noopener noreferrer",s.style.display="block",s.style.width="100%",s.style.height="100%",s.appendChild(c),a.appendChild(s);}else a.appendChild(c);return a}function bt(e,t,n){if(t.fontFamily&&(e.style.fontFamily=chunkN3Y5BUKV_js.a(t.fontFamily).cssFallback),t.fontSize){let r=t.fontSize*96/72;e.style.fontSize=`${r}px`;}if(t.bold&&(e.style.fontWeight="bold"),t.italic&&(e.style.fontStyle="italic"),t.color&&(e.style.color=t.color),t.letterSpacing&&(e.style.letterSpacing=`${t.letterSpacing}px`),t.allCaps&&(e.style.textTransform="uppercase"),t.smallCaps&&(e.style.fontVariant="small-caps"),t.positionPx&&(e.style.verticalAlign=`${t.positionPx}px`),t.horizontalScale&&t.horizontalScale!==100&&(e.style.display="inline-block",e.style.transform=`scaleX(${t.horizontalScale/100})`,e.style.transformOrigin="left center"),t.kerningMinPt&&t.kerningMinPt>0&&(t.fontSize??11)>=t.kerningMinPt&&(e.style.fontKerning="normal"),t.emboss&&(e.style.textShadow="1px 1px 1px rgba(255,255,255,0.5), -1px -1px 1px rgba(0,0,0,0.3)"),t.imprint&&(e.style.textShadow="-1px -1px 1px rgba(255,255,255,0.5), 1px 1px 1px rgba(0,0,0,0.3)"),t.textShadow&&!t.emboss&&!t.imprint&&(e.style.textShadow="1px 1px 2px rgba(0,0,0,0.3)"),t.textOutline&&(e.style.webkitTextStroke="1px currentColor",e.style.webkitTextFillColor="transparent"),t.emphasisMark){let r=t.emphasisMark==="comma"?"filled sesame":t.emphasisMark==="circle"?"filled circle":"filled dot",i=t.emphasisMark==="underDot"?"under right":"over right";e.style.textEmphasis=`${r}`,e.style.textEmphasisPosition=i,e.style.webkitTextEmphasis=r,e.style.webkitTextEmphasisPosition=i;}t.highlight&&(e.style.backgroundColor=t.highlight);let o=[];if(t.underline&&(o.push("underline"),typeof t.underline=="object"&&(t.underline.style&&(e.style.textDecorationStyle=t.underline.style),t.underline.color&&(e.style.textDecorationColor=t.underline.color))),t.strike&&o.push("line-through"),t.commentIds&&t.commentIds.length>0){let r=t.commentIds.find(i=>!n||!n.has(i));r!=null&&(e.style.backgroundColor="rgba(255, 212, 0, 0.15)",e.style.borderBottom="1px solid rgba(255, 212, 0, 0.4)",e.dataset.commentId=String(r));}t.isInsertion&&(e.style.backgroundColor="rgba(52, 168, 83, 0.08)",e.style.borderBottom="2px dashed #2e7d32",e.style.paddingBottom="1px",e.classList.add("docx-insertion"),t.changeAuthor&&(e.dataset.changeAuthor=t.changeAuthor),t.changeDate&&(e.dataset.changeDate=t.changeDate),t.changeRevisionId!=null&&(e.dataset.revisionId=String(t.changeRevisionId))),t.isDeletion&&(e.style.backgroundColor="rgba(211, 47, 47, 0.08)",e.style.color="#c62828",o.includes("line-through")||o.push("line-through"),e.style.textDecorationColor="#c62828",e.classList.add("docx-deletion"),t.changeAuthor&&(e.dataset.changeAuthor=t.changeAuthor),t.changeDate&&(e.dataset.changeDate=t.changeDate),t.changeRevisionId!=null&&(e.dataset.revisionId=String(t.changeRevisionId))),o.length>0&&(e.style.textDecorationLine=o.join(" ")),t.superscript&&(e.style.verticalAlign="super",e.style.fontSize="0.75em"),t.subscript&&(e.style.verticalAlign="sub",e.style.fontSize="0.75em"),t.hidden&&(e.classList.add("docx-hidden"),e.style.opacity="0.4",e.style.textDecoration="underline dotted"),t.rtl&&e.setAttribute("dir","rtl"),t.textEffect&&(e.classList.add("docx-text-effect",`docx-text-effect-${t.textEffect}`),e.dataset.effect=t.textEffect);}function j(e,t,n){t!==void 0&&(e.dataset.pmStart=String(t)),n!==void 0&&(e.dataset.pmEnd=String(n));}function oe(e,t,n){let o=t.createElement("span");if(o.className=`${L.run} ${L.text}`,bt(o,e,n),j(o,e.pmStart,e.pmEnd),e.hyperlink){let r=t.createElement("a");r.href=e.hyperlink.href,e.hyperlink.href.startsWith("#")||(r.target="_blank",r.rel="noopener noreferrer"),e.hyperlink.tooltip&&(r.title=e.hyperlink.tooltip),r.textContent=e.text,r.style.color="inherit",r.style.textDecoration="inherit",e.hyperlink.noDefaultStyle||(e.color||(r.style.color="#0563c1",o.style.color="#0563c1"),e.underline||(r.style.textDecoration="underline")),o.appendChild(r);}else o.textContent=e.text;return o}var xt=1e3;function pe(e,t,n,o){let r=t.createElement("span");r.className=`${L.run} ${L.tab}`,r.style.display="inline-block",r.style.width=`${n}px`,j(r,e.pmStart,e.pmEnd);let i=o&&o!=="none"?St(o):null;if(i){r.style.position="relative",r.textContent="\u200B";let a=t.createElement("span");a.style.position="absolute",a.style.left="0",a.style.right="0",a.style.top="0",a.style.bottom="0",a.style.overflow="hidden",a.style.whiteSpace="nowrap",a.textContent=i.repeat(xt),r.appendChild(a);}else r.textContent="\xA0";return r}function St(e){switch(e){case "dot":return ".";case "hyphen":return "-";case "underscore":return "_";case "middleDot":return "\xB7";case "heavy":return "_";default:return null}}function Xe(e){if(!e)return 0;let t=e.match(/rotate\(([-\d.]+)deg\)/);return t?(parseFloat(t[1])%360+360)%360:0}function Ze(e,t,n){if(n===0||n===180)return {w:e,h:t};if(n===90||n===270)return {w:t,h:e};let o=n*Math.PI/180,r=Math.abs(Math.sin(o)),i=Math.abs(Math.cos(o));return {w:e*i+t*r,h:e*r+t*i}}function Ye(e,t){t.distTop&&(e.style.marginTop=`${t.distTop}px`),t.distBottom&&(e.style.marginBottom=`${t.distBottom}px`);}function kt(e,t){let n=t.createElement("img");n.className=`${L.run} ${L.image}`,n.src=e.src,n.width=e.width,n.height=e.height,n.style.width=`${e.width}px`,n.style.height=`${e.height}px`,e.alt&&(n.alt=e.alt),e.transform&&(n.style.transform=e.transform,n.style.transformOrigin="center center"),te(e)&&ne(n,e);let o=Xe(e.transform);if(o!==0){let r=Ze(e.width,e.height,o),i=t.createElement("span");return i.style.display="inline-block",i.style.position="relative",i.style.width=`${r.w}px`,i.style.height=`${r.h}px`,i.style.verticalAlign="middle",n.style.position="absolute",n.style.left=`${(r.w-e.width)/2}px`,n.style.top=`${(r.h-e.height)/2}px`,Ye(i,e),j(i,e.pmStart,e.pmEnd),i.appendChild(n),i}return n.style.display="inline-block",n.style.verticalAlign="middle",Ye(n,e),j(n,e.pmStart,e.pmEnd),n}function Ue(e,t){let n=t.createElement("div");n.className="layout-block-image",n.style.display="block",n.style.textAlign="center",n.style.marginTop=`${e.distTop??6}px`,n.style.marginBottom=`${e.distBottom??6}px`;let o=t.createElement("img");o.src=e.src,o.width=e.width,o.height=e.height,o.style.marginLeft="auto",o.style.marginRight="auto",e.alt&&(o.alt=e.alt),e.transform&&(o.style.transform=e.transform,o.style.transformOrigin="center center"),te(e)&&ne(o,e);let r=Xe(e.transform);if(r!==0){let i=Ze(e.width,e.height,r);n.style.height=`${i.h}px`,n.style.position="relative",o.style.position="absolute",o.style.left="50%",o.style.top="50%",o.style.marginLeft=`${-e.width/2}px`,o.style.marginRight="0",o.style.marginTop=`${-e.height/2}px`;}return j(n,e.pmStart,e.pmEnd),n.appendChild(o),n}function ce(e,t){return chunkSORYYVJ7_js.f(e)||e.displayMode==="block"||e.wrapType==="topAndBottom"?Ue(e,t):kt(e,t)}function Fe(e,t){let n=t.createElement("br");return n.className=`${L.run} ${L.lineBreak}`,j(n,e.pmStart,e.pmEnd),n}function fe(e,t,n){let o=e.fallback??"";switch(e.fieldType){case "PAGE":o=String(n.pageNumber);break;case "NUMPAGES":o=String(n.totalPages);break;case "DATE":o=new Date().toLocaleDateString();break;case "TIME":o=new Date().toLocaleTimeString();break}let r={...e,text:o};return oe(r,t,n?.resolvedCommentIds)}function Ie(e,t,n){if(z(e))return oe(e,t,n?.resolvedCommentIds);if(O(e))return pe(e,t,48,void 0);if(G(e))return ce(e,t);if(V(e))return Fe(e,t);if(U(e)&&n)return fe(e,t,n);let o=t.createElement("span");return o.className=L.run,o}function Qe(e,t){let n=[],o=e.runs;for(let r=t.fromRun;r<=t.toRun;r++){let i=o[r];if(i)if(z(i)){let a=r===t.fromRun?t.fromChar:0,c=r===t.toRun?t.toChar:i.text.length;if(a>0||c<i.text.length){let s=i.text.slice(a,c);n.push({...i,text:s,pmStart:i.pmStart!==void 0?i.pmStart+a:void 0,pmEnd:i.pmStart!==void 0?i.pmStart+c:void 0});}else n.push(i);}else n.push(i);}return n}function qe(e){return e==="center"?"center":e==="right"?"flex-end":"flex-start"}function Je(e){return [e.pmStart??"no-start",e.pmEnd??"no-end",e.src,e.width,e.height,e.displayMode??"inline",e.wrapType??"none"].join("|")}function Tt(e){return {val:e.val,pos:e.pos,leader:e.leader}}function wt(e,t,n){let o="";for(let r=t+1;r<e.length;r++){let i=e[r];if(z(i))o+=i.text;else if(U(i))i.fieldType==="PAGE"&&n?o+=String(n.pageNumber):i.fieldType==="NUMPAGES"&&n?o+=String(n.totalPages):o+=i.fallback??"";else if(O(i)||V(i))break}return o}var Ft=.5;function It(e,t,n,o){let r=0;for(let i=t+1;i<e.length;i++){let a=e[i];if(O(a)||V(a))break;if(z(a))r+=n(a.text||"",a.fontSize,a.fontFamily,a.bold,a.italic);else if(U(a)){let c;a.fieldType==="PAGE"&&o?c=String(o.pageNumber):a.fieldType==="NUMPAGES"&&o?c=String(o.totalPages):c=a.fallback??"",r+=n(c,a.fontSize,a.fontFamily,a.bold,a.italic);}else G(a)&&!chunkSORYYVJ7_js.f(a)&&(r+=a.width||0);}return r}function Ct(e){let n=e.createElement("canvas").getContext("2d");return (o,r=11,i="Calibri",a=false,c=false)=>{if(!n)return o.length*7;let s=chunkN3Y5BUKV_js.a(i).cssFallback,h=r*96/72,l=[];return c&&l.push("italic"),a&&l.push("bold"),l.push(`${h}px`,s),n.font=l.join(" "),n.measureText(o).width}}function ge(e,t,n,o,r){let i=o.createElement("div");i.className=L.line,i.style.height=`${t.lineHeight}px`,i.style.lineHeight=`${t.lineHeight}px`;let a=Qe(e,t);if(a.length===1&&G(a[0])){let d=a[0].position?.horizontal?.align??n;i.style.display="flex",i.style.alignItems="center",i.style.justifyContent=qe(d),i.dataset.flexLine="true";}else a.some(G)&&(i.style.display="flex",i.style.alignItems="baseline",i.style.justifyContent=qe(n),i.style.lineHeight="normal",i.dataset.flexLine="true");if(a.length===0){let u=o.createElement("span");return u.className=`${L.run} layout-empty-run`,u.innerHTML=" ",i.appendChild(u),i}let c=n==="justify",s=false;c&&r&&(s=!r.isLastLine||r.paragraphEndsWithLineBreak,s&&(i.style.textAlign="justify",i.style.textAlignLast="justify",i.style.width=`${r.availableWidth}px`)),i.style.whiteSpace="pre";let h=a.some(u=>z(u)&&u.highlight);i.style.overflow=h?"hidden":"visible";let l=a.some(O),x,m=Ct(o);if(l){let u=r?.tabStops?.map(Tt),g=r?.leftIndentPx?Math.round(r.leftIndentPx*15):0;x={explicitStops:u,leftIndent:g};}let b=0,k=r?.leftIndentPx??0;if(r?.isFirstLine){let u=r?.firstLineIndentPx??0;b=k+u;}else b=k;for(let u=0;u<a.length;u++){let g=a[u];if(O(g)&&x){let d=It(a,u,m,r?.context),y=wt(a,u,r?.context),p=y.indexOf("."),f=p>=0?m(y.slice(0,p)):0,w=chunkLTHT4A4S_js.r(b,x,{followingWidth:d,decimalPrefixWidth:f}),S=r?.lineRightEdgePx,T=d,P=false;for(let R=u+1;R<a.length&&!V(a[R]);R++)if(O(a[R])){P=true;break}if(S!==void 0&&w.alignment==="end"&&!P&&b+w.width+T>=S-Ft){i.style.display="flex",i.style.alignItems="baseline",i.style.whiteSpace="nowrap",i.style.textIndent="0",i.dataset.flexLine="true",r?.isFirstLine&&r.firstLineIndentPx&&r.firstLineIndentPx<0&&i.firstElementChild instanceof HTMLElement&&(i.firstElementChild.style.marginLeft=`${r.firstLineIndentPx}px`);let R=pe(g,o,0,w.leader);R.style.flex="1 1 0",R.style.minWidth="0",R.style.width="auto",i.appendChild(R);for(let A=u+1;A<a.length;A++){let E=a[A];if(O(E)||V(E))break;if(z(E))i.appendChild(oe(E,o,r?.context?.resolvedCommentIds));else if(U(E)&&r?.context)i.appendChild(fe(E,o,r.context));else if(G(E)){if(chunkSORYYVJ7_js.f(E))continue;let Q=Je(E);r?.renderedInlineImageKeys?.has(Q)||(r?.renderedInlineImageKeys?.add(Q),i.appendChild(ce(E,o)));}else i.appendChild(Ie(E,o,r?.context));}break}let I=w.width;S!==void 0&&b+I+T>S&&(I=Math.max(1,S-b-T));let C=pe(g,o,I,w.leader);i.appendChild(C),b+=I;}else if(z(g)){let d=oe(g,o,r?.context?.resolvedCommentIds);if(g.highlight){let w=(g.fontSize?g.fontSize*96/72:14.67)*1.2,S=Math.max(0,t.lineHeight-w);if(S>0){let T=S/2;d.style.paddingTop=`${T}px`,d.style.paddingBottom=`${T}px`;}}i.appendChild(d);let y=g.fontSize||11,p=g.fontFamily||"Calibri";b+=m(g.text,y,p,g.bold,g.italic);}else if(G(g)){if(chunkSORYYVJ7_js.f(g))continue;let d=Je(g);if(r?.renderedInlineImageKeys?.has(d))continue;r?.renderedInlineImageKeys?.add(d);let y=ce(g,o);i.appendChild(y),g.displayMode!=="block"&&g.wrapType!=="topAndBottom"&&(b+=g.width);}else if(V(g)){let d=Fe(g,o);i.appendChild(d);}else if(U(g)&&r?.context){let d=fe(g,o,r.context);i.appendChild(d);let y=g.fallback??"";g.fieldType==="PAGE"?y=String(r.context.pageNumber):g.fieldType==="NUMPAGES"&&(y=String(r.context.totalPages));let p=g.fontSize||11,f=g.fontFamily||"Calibri";b+=m(y,p,f,g.bold,g.italic);}else {let d=Ie(g,o,r?.context);i.appendChild(d);}}return i}function re(e,t){return !e&&!t?true:!e||!t?false:e.style===t.style&&e.width===t.width&&e.color===t.color}function et(e,t){return !e&&!t||!e||!t?false:re(e.top,t.top)&&re(e.bottom,t.bottom)&&re(e.left,t.left)&&re(e.right,t.right)&&re(e.between,t.between)}function H(e,t,n,o,r={}){let i=r.document??document,a=i.createElement("div");a.className=L.fragment,a.style.position=o.positioning==="absolute"?"absolute":"relative",a.dataset.blockId=String(e.blockId),a.dataset.fromLine=String(e.fromLine),a.dataset.toLine=String(e.toLine),j(a,e.pmStart,e.pmEnd),e.continuesFromPrev&&(a.dataset.continuesFromPrev="true"),e.continuesOnNext&&(a.dataset.continuesOnNext="true");let c=t.attrs?.pPrIns,s=t.attrs?.pPrDel;if(c||s){let S=c??s;a.classList.add("layout-revision-pmark"),a.classList.add(c?"layout-revision-ins":"layout-revision-del"),a.dataset.revisionId=String(S.revisionId),a.dataset.revisionAuthor=S.author,S.date&&(a.dataset.revisionDate=S.date);}let h=n.lines.slice(e.fromLine,e.toLine),l=t.attrs?.alignment;t.attrs?.styleId&&(a.dataset.styleId=t.attrs.styleId);let x=t.attrs?.bidi;x&&(a.dir="rtl"),l?l==="center"?a.style.textAlign="center":l==="right"?a.style.textAlign="right":l==="left"?a.style.textAlign="left":a.style.textAlign=x?"right":"left":x&&(a.style.textAlign="right");let m=t.attrs?.indent,b=0,k=0;m&&(x?(m.left&&m.left>0&&(k=m.left),m.right&&m.right>0&&(b=m.right)):(m.left&&m.left>0&&(b=m.left),m.right&&m.right>0&&(k=m.right)));let u=t.attrs?.borders;if(u){let S=E=>{switch(E){case "single":return "solid";case "double":return "double";case "dotted":return "dotted";case "dashed":return "dashed";case "thick":return "solid";case "wave":return "wavy";case "dashSmallGap":return "dashed";case "nil":case "none":return "none";default:return "solid"}};a.style.boxSizing="border-box";let T=E=>`${E.width}px ${S(E.style)} ${E.color}`,P=et(r.prevBorders,u),F=et(u,r.nextBorders),I=P?u.between:u.top,C=F?void 0:u.bottom,R=i.createElement("div");if(R.className="layout-paragraph-border",R.style.position="absolute",R.style.pointerEvents="none",R.style.boxSizing="border-box",R.style.left=`${b-(u.left?.space??0)}px`,R.style.right=`${k-(u.right?.space??0)}px`,R.style.top=`${-(I?.space??0)}px`,R.style.bottom=`${-(C?.space??0)}px`,I&&(R.style.borderTop=T(I)),C&&(R.style.borderBottom=T(C)),u.left&&(R.style.borderLeft=T(u.left)),u.right&&(R.style.borderRight=T(u.right)),(I||C||u.left||u.right)&&a.appendChild(R),u.bar){let E=i.createElement("div");E.style.position="absolute",E.style.left="-8px",E.style.top="0",E.style.bottom="0",E.style.borderLeft=T(u.bar),a.style.position="relative",a.appendChild(E);}}t.attrs?.shading&&(a.style.backgroundColor=t.attrs.shading);let g=e.width-b-k,y=t.runs[t.runs.length-1]?.kind==="lineBreak",p=n.lines.length,f=0;m?.hanging&&m.hanging>0?f=-m.hanging:m?.firstLine&&m.firstLine>0&&(f=m.firstLine);let w=r.renderedInlineImageKeys??new Set;for(let S=0;S<h.length;S++){let T=h[S],P=e.fromLine+S,F=P===p-1,I=P===0&&!e.continuesFromPrev,C=T.leftOffset??0,R=T.rightOffset??0,A=g;if(I){let v=m?.hanging&&m.hanging>0,B=m?.firstLine&&m.firstLine>0;v&&m?.hanging?A=g+m.hanging:B&&m?.firstLine&&(A=g-m.firstLine);}if(Rt(T,t)){let v=i.createElement("div");v.className=`${L.line} layout-line-split`,v.style.position="relative",v.style.height=`${T.lineHeight}px`,v.style.lineHeight=`${T.lineHeight}px`;for(let B of T.segments){let ke={fromRun:B.fromRun,fromChar:B.fromChar,toRun:B.toRun,toChar:B.toChar,width:B.width,ascent:T.ascent,descent:T.descent,lineHeight:T.lineHeight},_=ge(t,ke,l,i,{availableWidth:B.availableWidth,isLastLine:F,isFirstLine:I,paragraphEndsWithLineBreak:y,tabStops:t.attrs?.tabs,leftIndentPx:b,firstLineIndentPx:I?f:0,context:o,renderedInlineImageKeys:w});_.className+=" layout-line-segment",_.style.position="absolute",_.style.left=`${B.leftOffset}px`,_.style.top="0",_.style.width=`${B.availableWidth}px`,v.appendChild(_);}a.appendChild(v);continue}let E=ge(t,T,l,i,{availableWidth:A-C-R,isLastLine:F,isFirstLine:I,paragraphEndsWithLineBreak:y,tabStops:t.attrs?.tabs,leftIndentPx:b,firstLineIndentPx:I?f:0,context:o,renderedInlineImageKeys:w,lineRightEdgePx:e.width-k-R});if(C>0||R>0){C>0&&(E.style.marginLeft=`${C}px`),R>0&&(E.style.marginRight=`${R}px`);let v=A-C-R;v>0&&(E.style.width=`${v}px`);}T.floatSkipBefore&&T.floatSkipBefore>0&&(E.style.marginTop=`${T.floatSkipBefore}px`);let Q=m?.hanging&&m.hanging>0,Be=m?.firstLine&&m.firstLine>0,dt=E.dataset.flexLine==="true";if(I?b>0&&Q?(E.style.paddingLeft=`${b}px`,dt||(E.style.textIndent=`-${m.hanging}px`)):b>0&&Be?(E.style.paddingLeft=`${b}px`,E.style.textIndent=`${m.firstLine}px`):b>0?E.style.paddingLeft=`${b}px`:Be&&(E.style.textIndent=`${m.firstLine}px`):b>0?E.style.paddingLeft=`${b}px`:Q&&(E.style.paddingLeft=`${m.hanging}px`),k>0&&(E.style.paddingRight=`${k}px`),I&&t.attrs?.listMarker&&!t.attrs?.listMarkerHidden){let v=m?.hanging??0,B=m?.firstLine??0,ke=v>0?Math.max(0,b-v):b+B;E.style.paddingLeft=`${ke}px`,E.style.textIndent="0";let{fontFamily:_,fontSize:pt}=chunkLTHT4A4S_js.s(t),ct=Et(t.attrs.listMarker,chunkLTHT4A4S_js.t(t),i,_,pt);E.insertBefore(ct,E.firstChild);}a.appendChild(E);}if((c||s)&&!e.continuesOnNext){let S=a.lastElementChild;if(S){let T=i.createElement("span");T.className="layout-revision-pmark-glyph",c?T.classList.add("layout-revision-ins"):T.classList.add("layout-revision-del"),T.textContent="\xB6",T.setAttribute("aria-hidden","true"),S.appendChild(T);}}return a}function Rt(e,t){return (e.segments?.length??0)>1&&!t.attrs?.listMarker}function Et(e,t,n,o,r){let i=n.createElement("span");return i.className="layout-list-marker",i.style.fontFamily=chunkN3Y5BUKV_js.a(o).cssFallback,i.style.fontSize=`${r*96/72}px`,i.style.textAlign="left",i.style.boxSizing="border-box",i.style.display="inline-block",i.style.minWidth=`${t}px`,i.textContent=e,i}function X(e,t,n){let o=t.createElement("div");o.className=n.layerClass,o.style.position="absolute",o.style.top="0",o.style.left="0",n.sizing==="inset0"?(o.style.right="0",o.style.bottom="0"):(o.style.width="100%",o.style.height="100%",o.style.overflow="hidden"),o.style.pointerEvents="none",n.layerMode==="front"&&(o.style.zIndex="10");for(let r of e){let i=t.createElement("div");i.className=n.itemClass,i.style.position="absolute",i.style.pointerEvents="auto",i.style.top=`${r.y}px`,i.style.left=`${r.x}px`,r.pmStart!==void 0&&(i.dataset.pmStart=String(r.pmStart)),r.pmEnd!==void 0&&(i.dataset.pmEnd=String(r.pmEnd));let a=t.createElement("img");a.src=r.src,a.style.width=`${r.width}px`,a.style.height=`${r.height}px`,a.style.display="block",r.alt&&(a.alt=r.alt),r.transform&&(a.style.transform=r.transform,a.style.transformOrigin="center center"),te(r)&&ne(a,r),i.appendChild(a),o.appendChild(i);}return o}function Ce(e,t,n,o){e.classList.add(`ep-revision-${t}`,`ep-revision-${n}`),e.dataset.revisionId=String(o.revisionId),e.dataset.revisionAuthor=o.author,o.date&&(e.dataset.revisionDate=o.date);}var D={table:"layout-table",row:"layout-table-row",cell:"layout-table-cell",cellContent:"layout-table-cell-content",resizeHandle:"layout-table-resize-handle",rowResizeHandle:"layout-table-row-resize-handle",tableEdgeHandleBottom:"layout-table-edge-handle-bottom",tableEdgeHandleRight:"layout-table-edge-handle-right"};function Pt(e,t,n){let o=[],r=0;for(let i=0;i<e.blocks.length;i++){let a=e.blocks[i];if(a?.kind!=="paragraph"){let h=t.blocks[i];h&&h.kind==="table"&&(r+=h.totalHeight??0);continue}let c=a;for(let h of c.runs){if(h.kind!=="image")continue;let l=h;if(!chunkSORYYVJ7_js.f(l))continue;let x=l.position,m=l.distTop??0,b=l.distBottom??0,k=l.distLeft??12,u=l.distRight??12,g="left",d=0;if(x?.horizontal){let p=x.horizontal;p.align==="right"?(g="right",d=n-l.width):p.align==="left"?d=0:p.align==="center"?d=(n-l.width)/2:p.posOffset!==void 0&&(d=chunk4Q2IP5FW_js.e(p.posOffset),g=d>n/2?"right":"left");}else l.cssFloat==="right"&&(g="right",d=n-l.width);let y=r;if(x?.vertical){let p=x.vertical;p.posOffset!==void 0?y=r+chunk4Q2IP5FW_js.e(p.posOffset):p.align==="top"&&(y=0);}d=Math.max(0,Math.min(d,n-l.width)),o.push({src:l.src,width:l.width,height:l.height,alt:l.alt,transform:l.transform,x:d,y,side:g,distTop:m,distBottom:b,distLeft:k,distRight:u,wrapText:chunkSORYYVJ7_js.h(l.cssFloat),wrapType:l.wrapType,pmStart:l.pmStart,pmEnd:l.pmEnd});}let s=t.blocks[i];s&&s.kind==="paragraph"&&(r+=s.totalHeight);}return o}function Lt(e,t,n,o){let r=o.createElement("div");r.className=D.cellContent,r.style.position="relative";let i=e.padding?.left??7,a=e.padding?.right??7,c=Math.max(0,t.width-i-a);r.style.width=`${c}px`;let s=Pt(e,t,c),h;if(s.length>0){h=s.filter(chunkSORYYVJ7_js.d).map(k=>{let u=k.x+k.width+k.distRight,g=k.y-k.distTop,d=k.y+k.height+k.distBottom,y=0,p=0,f=k.wrapText??"bothSides";return f==="right"?y=u:f==="left"?p=c-(k.x-k.distLeft):k.side==="left"?y=u:p=c-(k.x-k.distLeft),{leftMargin:y,rightMargin:p,topY:g,bottomY:d}});let b=s.filter(chunkSORYYVJ7_js.e);b.length>0&&r.appendChild(X(b,o,{layerClass:"layout-cell-floating-images-layer",itemClass:"layout-cell-floating-image",sizing:"fullSize",layerMode:"behind"}));}let l=0,x=0;for(let b=0;b<e.blocks.length;b++){let k=e.blocks[b],u=t.blocks[b];if(k?.kind==="paragraph"&&u?.kind==="paragraph"){let g=k,d=u,y=g.attrs?.spacing,p=Math.max(x,y?.before??0);l+=p,h&&h.length>0&&(d=chunkLTHT4A4S_js.v(g,c,{floatingZones:h,paragraphYOffset:l}));let f={blockId:g.id,width:c,height:d.totalHeight,fromLine:0,toLine:d.lines.length,pmStart:g.pmStart,pmEnd:g.pmEnd},w={...n,insideTableCell:true},S=H(f,g,d,w,{document:o});S.style.position="relative",p>0&&(S.style.marginTop=`${p}px`),r.appendChild(S),l+=d.totalHeight,x=y?.after??0;}else if(k?.kind==="table"&&u?.kind==="table"){let g=k,d=u,y=x,p=vt(g,d,n,o);p.style.position="relative",y>0&&(p.style.marginTop=`${y}px`),r.appendChild(p),l+=y+(u.totalHeight??0),x=0;}}x>0&&(r.style.paddingBottom=`${x}px`);let m=s.filter(b=>!chunkSORYYVJ7_js.e(b));return m.length>0&&r.appendChild(X(m,o,{layerClass:"layout-cell-floating-images-layer",itemClass:"layout-cell-floating-image",sizing:"fullSize",layerMode:"front"})),r}function vt(e,t,n,o){let r=o.createElement("div");r.className=`${D.table} layout-nested-table`,r.style.position="relative",r.style.width=`${t.totalWidth}px`,r.style.display="block",e.justification==="center"?(r.style.marginLeft="auto",r.style.marginRight="auto"):e.justification==="right"?r.style.marginLeft="auto":e.indent&&(r.style.marginLeft=`${e.indent}px`),r.dataset.blockId=String(e.id),e.pmStart!==void 0&&(r.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(r.dataset.pmEnd=String(e.pmEnd));let i=e.rows[0],a=i?.trackedIns,c=i?.trackedDel,s=(k,u)=>!!k&&!!u&&(k.author??"")===(u.author??"")&&(k.date??null)===(u.date??null),h=e.rows.length>0&&e.rows.every(k=>a?s(k.trackedIns,a):c?s(k.trackedDel,c):false);if(h){let k=a??c,u=a?"ins":"del";r.classList.add("ep-revision-table",`ep-revision-${u}`),r.dataset.revisionId=String(k.revisionId),r.dataset.revisionAuthor=k.author,k.date&&(r.dataset.revisionDate=k.date);}let l=[],x=0;for(let k=0;k<t.rows.length;k++)l.push(x),x+=t.rows[k]?.height??0;l.push(x);let m=new Map,b=0;for(let k=0;k<e.rows.length;k++){let u=e.rows[k],g=t.rows[k];if(!u||!g)continue;let d=Re(u,g,k,b,t.columnWidths,e.rows.length,n,o,m,l,void 0,h);r.appendChild(d),b+=g.height;}return r.style.height=`${b}px`,r}function me(e,t,n){let o=`border${t.charAt(0).toUpperCase()+t.slice(1)}`;if(!n||n.style==="none"||n.style==="nil"||n.width===0)e.style[o]="none";else {let r=n.width??1,i=n.color??"#000000",a=n.style??"solid";e.style[o]=`${r}px ${a} ${i}`;}}function Bt(e,t,n,o,r,i,a,c){let s=a.createElement("div");s.className=D.cell,e.trackedMarker&&e.trackedMarker.info.revisionId!==c&&Ce(s,"cell",e.trackedMarker.kind,e.trackedMarker.info),s.style.position="absolute",s.style.left=`${n}px`,s.style.top="0",s.style.width=`${t.width}px`,s.style.height=`${o}px`,s.style.overflow="hidden",s.style.boxSizing="border-box";let h=e.padding?.top??1,l=e.padding?.right??7,x=e.padding?.bottom??1,m=e.padding?.left??7;if(s.style.padding=`${h}px ${l}px ${x}px ${m}px`,e.borders&&(r.isFirstRow&&me(s,"top",e.borders.top),me(s,"right",e.borders.right),me(s,"bottom",e.borders.bottom),r.isFirstCol&&me(s,"left",e.borders.left)),e.background&&(s.style.backgroundColor=e.background),e.noWrap&&(s.style.whiteSpace="nowrap"),e.verticalAlign)switch(s.style.display="flex",s.style.flexDirection="column",e.verticalAlign){case "top":s.style.justifyContent="flex-start";break;case "center":s.style.justifyContent="center";break;case "bottom":s.style.justifyContent="flex-end";break}let b=Lt(e,t,i,a);if(s.appendChild(b),e.blocks.length>0){let k=e.blocks[0],u=e.blocks[e.blocks.length-1];k&&"pmStart"in k&&k.pmStart!==void 0&&(s.dataset.pmStart=String(k.pmStart)),u&&"pmEnd"in u&&u.pmEnd!==void 0&&(s.dataset.pmEnd=String(u.pmEnd));}return s}function Re(e,t,n,o,r,i,a,c,s,h,l,x){let m=c.createElement("div");m.className=D.row,x||(e.trackedDel?Ce(m,"row","del",e.trackedDel):e.trackedIns&&Ce(m,"row","ins",e.trackedIns)),m.style.position="absolute",m.style.left="0",m.style.top=`${o}px`,m.style.width="100%",m.style.height=`${t.height}px`,m.dataset.rowIndex=String(n);let b=new Set;if(s){for(let[,g]of s)if(g.startRow<n&&g.startRow+g.rowSpan>n)for(let d=0;d<g.colSpan;d++)b.add(g.columnIndex+d);}let k=0,u=0;for(;b.has(u);)k+=r[u]??0,u++;for(let g=0;g<e.cells.length;g++){let d=e.cells[g],y=t.cells[g];if(!d||!y)continue;let p=d.colSpan??1,f=d.rowSpan??1,w=t.height;if(f>1&&h){w=0;for(let C=n;C<n+f&&C<h.length-1;C++)w+=(h[C+1]??0)-(h[C]??0);w===0&&(w=t.height*f);}let S=n===0||l===true,P=u===0;u+p>=r.length;let I=Bt(d,y,k,w,{isFirstRow:S,isFirstCol:P},a,c,e.trackedIns?.revisionId??e.trackedDel?.revisionId);if(I.dataset.cellIndex=String(g),I.dataset.columnIndex=String(u),f>1&&(I.dataset.rowSpan=String(f)),m.appendChild(I),f>1&&s){let C=`${n}-${u}`;s.set(C,{cell:d,cellMeasure:y,columnIndex:u,startRow:n,rowSpan:f,colSpan:p,x:k,totalHeight:w});}for(let C=0;C<p&&u+C<r.length;C++)k+=r[u+C]??0;for(u+=p;b.has(u);)k+=r[u]??0,u++;}return m}function q(e,t,n,o,r={}){let i=r.document??document,a=i.createElement("div");a.className=D.table,a.style.position=o.positioning==="flow"?"relative":"absolute",a.style.width=`${e.width}px`,a.style.height=`${e.height}px`,a.style.overflow="hidden",a.dataset.blockId=String(e.blockId),a.dataset.fromRow=String(e.fromRow),a.dataset.toRow=String(e.toRow),e.pmStart!==void 0&&(a.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(a.dataset.pmEnd=String(e.pmEnd));let c=t.rows[0],s=c?.trackedIns,h=c?.trackedDel,l=(p,f)=>!!p&&!!f&&(p.author??"")===(f.author??"")&&(p.date??null)===(f.date??null),x=t.rows.length>0&&t.rows.every(p=>s?l(p.trackedIns,s):h?l(p.trackedDel,h):false);if(x){let p=s??h,f=s?"ins":"del";a.classList.add("ep-revision-table",`ep-revision-${f}`),a.dataset.revisionId=String(p.revisionId),a.dataset.revisionAuthor=p.author,p.date&&(a.dataset.revisionDate=p.date),a.style.overflow="visible";}let m=0;for(let p=0;p<n.columnWidths.length-1;p++){m+=n.columnWidths[p]??0;let f=i.createElement("div");f.className=D.resizeHandle,f.style.position="absolute",f.style.left=`${m-3}px`,f.style.top="0",f.style.width="6px",f.style.height="100%",f.style.cursor="col-resize",f.style.zIndex="10",f.dataset.columnIndex=String(p),f.dataset.tableBlockId=String(e.blockId),e.pmStart!==void 0&&(f.dataset.tablePmStart=String(e.pmStart)),a.appendChild(f);}let b=[],k=0;for(let p=0;p<n.rows.length;p++)b.push(k),k+=n.rows[p]?.height??0;b.push(k);let u=new Map,g=e.headerRowCount??0,d=0;if(g>0&&e.continuesFromPrev)for(let p=0;p<g;p++){let f=t.rows[p],w=n.rows[p];if(!f||!w)continue;let S=Re(f,w,p,d,n.columnWidths,t.rows.length,o,i,u,b,p===0,x);S.dataset.repeatedHeader="true",a.appendChild(S),d+=w.height;}for(let p=e.fromRow;p<e.toRow;p++){let f=t.rows[p],w=n.rows[p];if(!f||!w)continue;let S=g>0&&e.continuesFromPrev?false:e.continuesFromPrev&&p===e.fromRow,T=Re(f,w,p,d,n.columnWidths,t.rows.length,o,i,u,b,S,x);a.appendChild(T),d+=w.height;}let y=0;for(let p=e.fromRow;p<e.toRow;p++)if(y+=n.rows[p]?.height??0,p<e.toRow-1){let f=i.createElement("div");f.className=D.rowResizeHandle,f.style.position="absolute",f.style.left="0",f.style.top=`${y-3}px`,f.style.width="100%",f.style.height="6px",f.style.cursor="row-resize",f.style.zIndex="10",f.dataset.rowIndex=String(p),f.dataset.tableBlockId=String(e.blockId),e.pmStart!==void 0&&(f.dataset.tablePmStart=String(e.pmStart)),a.appendChild(f);}if(e.toRow===t.rows.length){let p=i.createElement("div");p.className=D.tableEdgeHandleBottom,p.style.position="absolute",p.style.left="0",p.style.top=`${y-3}px`,p.style.width="100%",p.style.height="6px",p.style.cursor="row-resize",p.style.zIndex="10",p.dataset.rowIndex=String(t.rows.length-1),p.dataset.tableBlockId=String(e.blockId),p.dataset.isEdge="bottom",e.pmStart!==void 0&&(p.dataset.tablePmStart=String(e.pmStart)),a.appendChild(p);}if(e.toRow===t.rows.length){let p=n.columnWidths.reduce((w,S)=>w+S,0),f=i.createElement("div");f.className=D.tableEdgeHandleRight,f.style.position="absolute",f.style.left=`${p-3}px`,f.style.top="0",f.style.width="6px",f.style.height="100%",f.style.cursor="col-resize",f.style.zIndex="10",f.dataset.columnIndex=String(n.columnWidths.length-1),f.dataset.tableBlockId=String(e.blockId),f.dataset.isEdge="right",e.pmStart!==void 0&&(f.dataset.tablePmStart=String(e.pmStart)),a.appendChild(f);}return a}var Mt={textBox:"layout-textbox"};function J(e,t,n,o,r={}){let i=r.document??document,a=i.createElement("div");if(a.className=Mt.textBox,a.style.position="absolute",a.style.width=`${e.width}px`,a.style.height=`${e.height}px`,a.style.overflow="hidden",a.style.boxSizing="border-box",$t(a,e),t.fillColor&&(a.style.backgroundColor=t.fillColor),t.outlineWidth&&t.outlineWidth>0){let l=t.outlineStyle||"solid",x=t.outlineColor||"#000000";a.style.border=`${t.outlineWidth}px ${l} ${x}`;}let c=t.margins??chunkDROCYKAR_js.a;a.style.padding=`${c.top}px ${c.right}px ${c.bottom}px ${c.left}px`,a.dataset.blockId=String(e.blockId),e.pmStart!==void 0&&(a.dataset.pmStart=String(e.pmStart)),e.pmEnd!==void 0&&(a.dataset.pmEnd=String(e.pmEnd));let s=e.width-c.left-c.right,h=0;for(let l=0;l<t.content.length;l++){let x=t.content[l],m=n.innerMeasures[l];if(!m)continue;let b={blockId:x.id,width:s,height:m.totalHeight,pmStart:x.pmStart,pmEnd:x.pmEnd,fromLine:0,toLine:m.lines.length},k=H(b,x,m,{...o,positioning:"flow"},{document:i});a.appendChild(k),h+=m.totalHeight;}return a}function $t(e,t){!t.isFloating&&t.zIndex===void 0||(e.style.zIndex=String(t.zIndex??10));}function tt(e){return {pageWidth:e.size.w,pageHeight:e.size.h,marginLeft:e.margins.left,marginTop:e.margins.top,contentWidth:e.size.w-e.margins.left-e.margins.right,contentHeight:e.size.h-e.margins.top-e.margins.bottom}}function Ee(e,t,n,o){let{x:r,side:i}=Ht(e,n,o),a=zt(e,t,o);return {x:r,y:a,side:i}}function Ht(e,t,n){let o=e.position?.horizontal;if(!o)return e.cssFloat==="right"?{x:t-e.width,side:"right"}:{x:0,side:"left"};let r=At(o.relativeTo,t,n);if(o.align==="right")return {x:r.size?r.base+r.size-e.width:0,side:"right"};if(o.align==="left")return {x:r.base,side:"left"};if(o.align==="center")return {x:r.size?r.base+(r.size-e.width)/2:0,side:"left"};if(o.posOffset!==void 0){let i=r.base+chunk4Q2IP5FW_js.e(o.posOffset);return {x:i,side:i>t/2?"right":"left"}}return {x:r.base,side:"left"}}function At(e,t,n){let o=n?.pageWidth??0,r=n?.marginLeft??0;switch(e){case "page":return {base:-r,size:o};case "leftMargin":return {base:-r,size:r};case "rightMargin":return {base:t,size:r};case "character":return {base:0,size:0};default:return {base:0,size:t}}}function zt(e,t,n){let o=e.position?.vertical;if(!o)return t;let r=Ot(o.relativeTo,t,n);return o.align==="top"?r.base:o.align==="center"?r.size?r.base+(r.size-e.height)/2:t:o.align==="bottom"?r.size?r.base+r.size-e.height:t:o.posOffset!==void 0?r.base+chunk4Q2IP5FW_js.e(o.posOffset):o.relativeTo==="paragraph"||o.relativeTo==="line"?t:r.base}function Ot(e,t,n){let o=n?.pageHeight??0,r=n?.marginTop??0,i=n?.contentHeight??0;switch(e){case "paragraph":case "line":return {base:t,size:0};case "page":return {base:-r,size:o};case "topMargin":return {base:-r,size:r};case "bottomMargin":return {base:i,size:r};default:return {base:0,size:i}}}function nt(e){return e?.align??e?.alignment}function Dt(e,t){let n=e.position.vertical;if(!n)return e.paragraphY;let o=nt(n),r=n.posOffset!==void 0?chunk4Q2IP5FW_js.e(n.posOffset):void 0;if(n.relativeTo==="page"){if(r!==void 0)return r-t.flowTop;if(o==="top")return -t.flowTop;if(o==="bottom")return t.pageHeight-e.height-t.flowTop;if(o==="center")return (t.pageHeight-e.height)/2-t.flowTop}if(n.relativeTo==="margin"){let i=t.margins.top,a=t.pageHeight-t.margins.top-t.margins.bottom;if(r!==void 0)return i+r-t.flowTop;if(o==="top")return i-t.flowTop;if(o==="bottom")return i+a-e.height-t.flowTop;if(o==="center")return i+(a-e.height)/2-t.flowTop}return r!==void 0?e.paragraphY+r:e.paragraphY}function Nt(e,t,n){let o=t.position.horizontal;if(!o){e.style.left="0";return}let r=nt(o);if(o.relativeTo==="page"){if(o.posOffset!==void 0){e.style.left=`${chunk4Q2IP5FW_js.e(o.posOffset)-n.flowLeft}px`;return}if(r==="right"){e.style.left=`${n.pageWidth-t.width-n.flowLeft}px`;return}if(r==="center"){e.style.left=`${(n.pageWidth-t.width)/2-n.flowLeft}px`;return}if(r==="left"){e.style.left=`${-n.flowLeft}px`;return}}if(o.posOffset!==void 0){e.style.left=`${chunk4Q2IP5FW_js.e(o.posOffset)}px`;return}if(r==="right"){e.style.left=`${n.contentWidth-t.width}px`;return}if(r==="center"){e.style.left=`${(n.contentWidth-t.width)/2}px`;return}e.style.left="0";}function ot(e,t){let n=e.tblpY??0;e.vertAnchor==="page"?n-=t.flowTop:e.vertAnchor==="margin"&&(n+=t.margins.top-t.flowTop);let o=e.tblpX??0;return e.horzAnchor==="page"?o-=t.flowLeft:e.horzAnchor==="margin"&&(o+=t.margins.left-t.flowLeft),{left:o,top:n}}function Pe(e,t,n,o){let r=n.document??document,i=r.createElement("div");i.style.position="relative";let a=t.contentWidth??600,c=[],s=0;for(let h=0;h<e.blocks.length;h++){let l=e.blocks[h],x=e.measures[h];if(!(!l||!x))if(l.kind==="paragraph"){if(x.kind!=="paragraph")continue;let m=l,b=x,k=m.attrs?.spacing?.before??0,u=s,g=[];for(let f of m.runs)if(f.kind==="image"&&"position"in f&&f.position){let w=f;c.push({src:w.src,width:w.width,height:w.height,alt:w.alt,paragraphY:u,position:w.position});}else g.push(f);let d={...m,runs:g},y={blockId:m.id,width:a,height:b.totalHeight,fromLine:0,toLine:b.lines.length,pmStart:m.pmStart,pmEnd:m.pmEnd},p=H(y,d,b,{...t,positioning:"absolute"},{document:r});p.style.top=`${s+k}px`,p.style.left="0",p.style.width=`${a}px`,i.appendChild(p),s+=b.totalHeight;}else if(l.kind==="table"){if(x.kind!=="table")continue;let m={blockId:l.id,width:x.totalWidth,height:x.totalHeight,fromRow:0,toRow:x.rows.length,pmStart:l.pmStart,pmEnd:l.pmEnd},b=q(m,l,x,{...t,positioning:"absolute"},{document:r});if(l.floating){let{left:k,top:u}=ot(l.floating,o);b.style.top=`${u}px`,b.style.left=`${k}px`,i.appendChild(b);}else b.style.top=`${s}px`,b.style.left="0",i.appendChild(b),s+=x.totalHeight;}else if(l.kind==="image"){if(x.kind!=="image")continue;let m={blockId:l.id,width:x.width,height:x.height,pmStart:l.pmStart,pmEnd:l.pmEnd},b=Z(m,l,x,{...t},{document:r});b.style.top=`${s}px`,b.style.left="0",i.appendChild(b),s+=x.height;}else if(l.kind==="textBox"){if(x.kind!=="textBox")continue;let m={blockId:l.id,width:x.width,height:x.height,pmStart:l.pmStart,pmEnd:l.pmEnd},b=J(m,l,x,{...t,positioning:"absolute"},{document:r});b.style.top=`${s}px`,b.style.left="0",i.appendChild(b),s+=x.height;}else l.kind==="sectionBreak"||l.kind==="pageBreak"||l.kind==="columnBreak"||chunkDROCYKAR_js.c(l,"renderHeaderFooterContent");}for(let h of c){let l=r.createElement("img");l.src=h.src,l.width=h.width,l.height=h.height,h.alt&&(l.alt=h.alt),l.style.position="absolute",l.style.display="block",l.style.width=`${h.width}px`,l.style.height=`${h.height}px`,l.style.maxWidth="none",l.style.maxHeight="none",Nt(l,h,o),l.style.top=`${Dt(h,o)}px`,i.appendChild(l);}return i}var he=12,rt=6;function _t(e,t){if(e.size!==t.size)return false;for(let[n,o]of e)if(t.get(n)!==o)return false;return true}var Le=8;function Xn(e){let t=[],n=o=>{for(let r of o)if(r.kind==="paragraph")for(let i of r.runs)i.kind==="text"&&i.footnoteRefId!=null&&t.push({footnoteId:i.footnoteRefId,pmPos:i.pmStart??0});else if(r.kind==="table")for(let i of r.rows)for(let a of i.cells)n(a.blocks);else r.kind==="textBox"&&n(r.content);};return n(e),t}function ve(e,t){let n=new Map;if(t.length===0)return n;for(let o of t)for(let r of e){let i=false;for(let a of r.fragments){let c=a.pmStart??-1,s=a.pmEnd??-1;if(c>=0&&s>=0&&o.pmPos>=c&&o.pmPos<s){let h=n.get(r.number)??[];h.includes(o.footnoteId)||h.push(o.footnoteId),n.set(r.number,h),i=true;break}}if(i)break}return n}function Wt(e,t){if(e.length===0)return [{kind:"paragraph",id:`fn-empty-${t}`,runs:[{kind:"text",text:`${t} `,fontSize:Le,superscript:true}]}];let n=e.map(r=>{if(r.kind!=="paragraph")return r;let i=r;return {...i,runs:i.runs.map(a=>(a.kind==="text"||a.kind==="tab")&&a.fontSize==null?{...a,fontSize:Le}:a)}}),o=n[0];if(o.kind==="paragraph"){let r={kind:"text",text:`${t} `,fontSize:Le,superscript:true};n[0]={...o,runs:[r,...o.runs]};}return n}function Gt(e,t,n,o){let r=chunk7AMYZMCX_js.c(e.content,{styles:o.styles??void 0,theme:o.theme??null,defaultTabStopTwips:o.defaultTabStopTwips??null}),i=chunkHKVAW3RE_js.c(r,{theme:o.theme??void 0}),a=Wt(i,t),c=o.measureBlocks(a,n),s=c.reduce((h,l)=>l.kind==="paragraph"||l.kind==="table"?h+l.totalHeight:l.kind==="image"||l.kind==="textBox"?h+l.height:h,0);return {id:e.id,displayNumber:t,blocks:a,measures:c,height:s}}function Zn(e,t,n,o){let r=new Map,i=new Map;for(let s of e)(s.noteType==="normal"||s.noteType==null)&&i.set(s.id,s);let a=1,c=new Set;for(let s of t){if(c.has(s.footnoteId))continue;c.add(s.footnoteId);let h=i.get(s.footnoteId);h&&(r.set(s.footnoteId,Gt(h,a,n,o)),a++);}return r}function it(e,t){let n=new Map;for(let[o,r]of e){let i=0;for(let a of r){let c=t.get(a);c&&(i+=c.height);}i>0&&(i+=he,n.set(o,i));}return n}function qn(e){let{blocks:t,measures:n,layoutOpts:o,footnoteRefs:r,footnoteContentMap:i,initialLayout:a}=e,c=ve(a.pages,r),s=it(c,i);if(s.size===0)return {layout:a,pageFootnoteMap:c,converged:true};let h=a,l=false;for(let x=0;x<rt;x++){h=chunkLTHT4A4S_js.O(t,n,{...o,footnoteReservedHeights:s});let m=ve(h.pages,r),b=it(m,i);if(c=m,_t(s,b)){s=b,l=true;break}s=b;}l||(h=chunkLTHT4A4S_js.O(t,n,{...o,footnoteReservedHeights:s}),c=ve(h.pages,r),console.warn(`[docx-editor] footnote layout did not stabilize within ${rt} passes; settling with best-effort reservation. If footnotes appear misplaced, please file a bug with the document.`));for(let[x,m]of c){let b=h.pages.find(k=>k.number===x);b&&(b.footnoteIds=m);}return {layout:h,pageFootnoteMap:c,converged:l}}function Jn(e,t,n){let o=new Map;if(!n?.package?.footnotes)return o;let r=new Map;for(let i of n.package.footnotes)i.noteType&&i.noteType!=="normal"||r.set(i.id,i);for(let[i,a]of e){let c=[];for(let s of a){let h=r.get(s);if(!h)continue;let l=t.get(s),x=l?.displayNumber??0;c.push({displayNumber:String(x),text:chunkF44ZLDZS_js.x(h),content:l});}c.length>0&&o.set(i,c);}return o}function Vt(e,t,n,o){let r=o.createElement("div");r.className="layout-footnote-content",r.style.position="relative",r.style.width=`${t}px`,r.style.height=`${e.height}px`;let i=0;for(let a=0;a<e.blocks.length;a++){let c=e.blocks[a],s=e.measures[a];if(!(!c||!s)){if(c.kind==="paragraph"&&s.kind==="paragraph"){let h=c.attrs?.spacing?.before??0,l={blockId:c.id,width:t,height:s.totalHeight,pmStart:c.pmStart,pmEnd:c.pmEnd,fromLine:0,toLine:s.lines.length},x=H(l,c,s,{...n,section:"body",contentWidth:t,positioning:"absolute"},{document:o});x.style.top=`${i+h}px`,x.style.left="0",x.style.width=`${t}px`,x.style.height=`${s.totalHeight}px`,r.appendChild(x),i+=s.totalHeight;}else if(c.kind==="table"&&s.kind==="table"){let h={blockId:c.id,width:s.totalWidth,height:s.totalHeight,pmStart:c.pmStart,pmEnd:c.pmEnd,fromRow:0,toRow:s.rows.length},l=q(h,c,s,{...n,section:"body",contentWidth:t,positioning:"absolute"},{document:o});l.style.top=`${i}px`,l.style.left="0",r.appendChild(l),i+=s.totalHeight;}else if(c.kind==="image"&&s.kind==="image"){let h={blockId:c.id,width:s.width,height:s.height,pmStart:c.pmStart,pmEnd:c.pmEnd},l=Z(h,c,s,{...n},{document:o});l.style.top=`${i}px`,l.style.left="0",r.appendChild(l),i+=s.height;}else if(c.kind==="textBox"&&s.kind==="textBox"){let h={blockId:c.id,width:s.width,height:s.height,pmStart:c.pmStart,pmEnd:c.pmEnd},l=J(h,c,s,{...n,section:"body",contentWidth:t,positioning:"absolute"},{document:o});l.style.top=`${i}px`,l.style.left="0",r.appendChild(l),i+=s.height;}}}return r}function jt(e,t){let n=t.createElement("div");n.style.fontSize="10px",n.style.lineHeight="1.3",n.style.marginBottom="4px",n.style.color="#000";let o=t.createElement("sup");o.textContent=e.displayNumber,o.style.fontSize="7px",o.style.marginRight="2px",n.appendChild(o);let r=t.createTextNode(" "+e.text);return n.appendChild(r),n}function at(e){let t=he;for(let n of e)n.content&&(t+=n.content.height);return t}function st(e,t,n,o){let r=o.createElement("div");r.className="layout-footnote-area",r.style.width=`${t}px`;let i=o.createElement("div"),a=.5,c=(he-a)/2;i.style.width="33%",i.style.height=`${a}px`,i.style.backgroundColor="#000",i.style.marginBottom=`${c}px`,i.style.marginTop=`${c}px`,r.appendChild(i);for(let s of e)r.appendChild(s.content?Vt(s.content,t,n,o):jt(s,o));return r}function be(e,t,n){let o={pageNumber:e.number,totalPages:t,section:"body",resolvedCommentIds:n.resolvedCommentIds},r={...n};if(n.titlePg&&e.number===1&&(r.headerContent=n.firstPageHeaderContent,r.footerContent=n.firstPageFooterContent),n.footnotesByPage){let i=n.footnotesByPage.get(e.number);i&&i.length>0&&(r.footnoteArea=i);}return {context:o,pageOptions:r}}function lt(e){let t=[];t.push(`s:${e.size.w},${e.size.h}`),t.push(`m:${e.margins.top},${e.margins.right},${e.margins.bottom},${e.margins.left}`),t.push(`n:${e.number}`),e.footnoteReservedHeight&&t.push(`fn:${e.footnoteReservedHeight}`);for(let n of e.fragments){let o=`${n.kind}:${n.blockId},${n.x},${n.y},${n.width},${n.height}`;n.pmStart!==void 0&&(o+=`,ps:${n.pmStart}`),n.pmEnd!==void 0&&(o+=`,pe:${n.pmEnd}`),n.kind==="paragraph"?o+=`,fl:${n.fromLine},tl:${n.toLine}`:n.kind==="table"&&(o+=`,fr:${n.fromRow},tr:${n.toRow}`),t.push(o);}return t.join("|")}function Kt(e){let t=[];return e.headerContent&&t.push(`hdr:${e.headerContent.blocks.length},${e.headerContent.height},${e.headerContent.visualTop??0},${e.headerContent.visualBottom??e.headerContent.height}`),e.footerContent&&t.push(`ftr:${e.footerContent.blocks.length},${e.footerContent.height},${e.footerContent.visualTop??0},${e.footerContent.visualBottom??e.footerContent.height}`),e.firstPageHeaderContent&&t.push(`fp-hdr:${e.firstPageHeaderContent.blocks.length},${e.firstPageHeaderContent.height}`),e.firstPageFooterContent&&t.push(`fp-ftr:${e.firstPageFooterContent.blocks.length},${e.firstPageFooterContent.height}`),e.titlePg&&t.push("titlePg"),e.theme&&t.push(`thm:${e.theme.name??"default"}`),e.pageBorders&&t.push(`pb:${JSON.stringify(e.pageBorders)}`),e.headerDistance!==void 0&&t.push(`hd:${e.headerDistance}`),e.footerDistance!==void 0&&t.push(`fd:${e.footerDistance}`),t.join("|")}function Yt(e,t){e.style.display="flex",e.style.flexDirection="column",e.style.alignItems="center",e.style.gap=`${t}px`,e.style.padding=`${t}px`,e.style.backgroundColor="var(--doc-bg, #f8f9fa)";}var ue=2,Ut=8;function Xt(e,t,n={}){let o=e.length,r=n.pageGap??24,i=t,a=i.__pageRenderState,c=Kt(n),s=o>=Ut;if(!!a&&a.optionsHash===c&&a.useVirtualization===s){let g=a.pageStates,d=a.pageDataMap,y=i.__pageObserver,p=[];for(let S of e)p.push(lt(S));let f=a.totalPages!==o,w=Math.min(g.length,e.length);for(let S=0;S<w;S++){let T=g[S],P=p[S];if(T.fingerprint===P&&!f){let C=d.get(T.element);C&&(C.page=e[S]);continue}let F=T.element,I=d.get(F);I&&(I.page=e[S],I.rendered&&Zt(F,d,o,n)),T.fingerprint=P,ie(F,e[S].size.w,e[S].size.h,n),F.dataset.pageNumber=String(e[S].number);}if(e.length>g.length){let S=n.document??document;for(let T=g.length;T<e.length;T++){let P=e[T],F,I=false;if(s)F=S.createElement("div"),F.className=n.pageClassName??N.page,F.dataset.pageNumber=String(P.number),F.dataset.pageIndex=String(T),ie(F,P.size.w,P.size.h,n);else {let{context:C,pageOptions:R}=be(P,o,n);F=ae(P,C,R),I=true;}t.appendChild(F),g.push({element:F,fingerprint:p[T]}),d.set(F,{page:P,index:T,rendered:I}),y&&y.observe(F);}}if(e.length<g.length){for(let S=g.length-1;S>=e.length;S--){let T=g[S].element;y&&y.unobserve(T),d.delete(T),t.removeChild(T);}g.length=e.length;}for(let S=0;S<g.length;S++){let T=d.get(g[S].element);T&&(T.index=S);}return a.totalPages=o,a.currentOptions=n,"incremental"}let l=i.__pageObserver;l&&(l.disconnect(),i.__pageObserver=void 0),t.innerHTML="",i.__pageRenderState=void 0,Yt(t,r);let x=[],m=[];for(let g=0;g<e.length;g++){let d=e[g];if(m.push(lt(d)),s){let p=(n.document??document).createElement("div");p.className=n.pageClassName??N.page,p.dataset.pageNumber=String(d.number),p.dataset.pageIndex=String(g),ie(p,d.size.w,d.size.h,n),t.appendChild(p),x.push(p);}else {let{context:y,pageOptions:p}=be(d,o,n),f=ae(d,y,p);t.appendChild(f),x.push(f);}}if(!s){let g=new Map;for(let d=0;d<e.length;d++)g.set(x[d],{page:e[d],index:d,rendered:true});return i.__pageRenderState={pageStates:x.map((d,y)=>({element:d,fingerprint:m[y]})),totalPages:o,optionsHash:c,pageDataMap:g,currentOptions:n,useVirtualization:false},"full"}let b=new Map;for(let g=0;g<e.length;g++)b.set(x[g],{page:e[g],index:g,rendered:false});let k=new IntersectionObserver(g=>{let d=i.__pageRenderState;if(!d)return;let{currentOptions:y,totalPages:p,pageDataMap:f}=d;for(let P of g){let F=P.target,I=f.get(F);if(I&&P.isIntersecting){ye(F,f,p,y);for(let C=-ue;C<=ue;C++){let R=I.index+C;R>=0&&R<d.pageStates.length&&R!==I.index&&ye(d.pageStates[R].element,f,p,y);}}}let w=window.innerHeight,S=w*3,T=new Set;for(let[P,F]of f){if(!F.rendered)continue;let I=P.getBoundingClientRect();I.bottom>-S&&I.top<w+S&&T.add(F.index);}for(let[P,F]of f){if(!F.rendered)continue;let I=false;for(let C of T)if(Math.abs(F.index-C)<=ue+1){I=true;break}!I&&T.size>0&&qt(P,f);}},{root:null,rootMargin:"1500px 0px 1500px 0px"});for(let g of x)k.observe(g);i.__pageObserver=k,i.__pageRenderState={pageStates:x.map((g,d)=>({element:g,fingerprint:m[d]})),totalPages:o,optionsHash:c,pageDataMap:b,currentOptions:n,useVirtualization:true};let u=Math.min(e.length,ue+3);for(let g=0;g<u;g++)ye(x[g],b,o,n);return "full"}function ye(e,t,n,o){let r=t.get(e);if(!r||r.rendered)return;let{context:i,pageOptions:a}=be(r.page,n,o),c=ae(r.page,i,a);for(;c.firstChild;)e.appendChild(c.firstChild);r.rendered=true;}function Zt(e,t,n,o){let r=t.get(e);if(!r)return;let{context:i,pageOptions:a}=be(r.page,n,o),s=ae(r.page,i,a).querySelector(`.${N.content}`),h=e.querySelector(`.${N.content}`);s&&h?e.replaceChild(s,h):(e.innerHTML="",r.rendered=false,ye(e,t,n,o));}function qt(e,t){let n=t.get(e);!n||!n.rendered||(e.innerHTML="",n.rendered=false);}var N={page:"layout-page",content:"layout-page-content",header:"layout-page-header",footer:"layout-page-footer"};function ie(e,t,n,o){e.style.position="relative",e.style.width=`${t}px`,e.style.height=`${n}px`,e.style.backgroundColor=o.backgroundColor??"#ffffff",e.style.overflow="hidden",e.style.fontFamily=chunkN3Y5BUKV_js.a("Calibri").cssFallback,e.style.fontSize=`${1056/72}px`,e.style.color="#000000",o.showBorders&&(e.style.border="1px solid #ccc"),o.showShadow&&(e.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");}function Jt(e,t){switch(t??"allPages"){case "firstPage":return e===1;case "notFirstPage":return e!==1;default:return true}}function xe(e){return e?.space!==void 0?chunk4Q2IP5FW_js.i(e.space):0}function Se(e,t,n,o){if(!t||t.style==="none"||t.style==="nil")return;let r=chunkBHBOAP6Z_js.c(t,n,o);for(let[s,h]of Object.entries(r))e.style[s]=String(h);let i=`border${n}Style`,a=`border${n}Width`;if(e.style[i]==="double"){let s=parseFloat(e.style[a]);(!Number.isFinite(s)||s<3)&&(e.style[a]="3px");}}function Qt(e,t,n){let o=t.pageBorders;if(!o||!Jt(e.number,o.display)||![o.top,o.bottom,o.left,o.right].some(x=>x&&x.style!=="none"&&x.style!=="nil"))return null;let i=o.offsetFrom??"text",a=xe(o.top),c=xe(o.right),s=xe(o.bottom),h=xe(o.left),l=n.createElement("div");return l.className="layout-page-border",l.style.position="absolute",l.style.pointerEvents="none",l.style.boxSizing="border-box",l.style.zIndex=o.zOrder==="back"?"0":"20",i==="page"?(l.style.top=`${a}px`,l.style.right=`${c}px`,l.style.bottom=`${s}px`,l.style.left=`${h}px`):(l.style.top=`${Math.max(0,e.margins.top-a)}px`,l.style.right=`${Math.max(0,e.margins.right-c)}px`,l.style.bottom=`${Math.max(0,e.margins.bottom-s)}px`,l.style.left=`${Math.max(0,e.margins.left-h)}px`),Se(l,o.top,"Top",t.theme),Se(l,o.bottom,"Bottom",t.theme),Se(l,o.left,"Left",t.theme),Se(l,o.right,"Right",t.theme),l}function en(e,t){let n=t.margins;e.style.position="absolute",e.style.top=`${n.top}px`,e.style.left=`${n.left}px`,e.style.right=`${n.right}px`,e.style.bottom=`${n.bottom}px`,e.style.overflow="visible";}function tn(e,t,n){e.style.position="absolute",e.style.left=`${t.x-n.left}px`,e.style.top=`${t.y-n.top}px`,e.style.width=`${t.width}px`,"height"in t&&(e.style.height=`${t.height}px`);}function nn(e,t,n,o){let r=[];for(let i of e.runs){if(i.kind!=="image")continue;let a=i;if(!chunkSORYYVJ7_js.f(a))continue;let c=a.distTop??0,s=a.distBottom??0,h=a.distLeft??12,l=a.distRight??12,{x,y:m,side:b}=Ee(a,t,n,o);r.push({src:a.src,width:a.width,height:a.height,alt:a.alt,transform:a.transform,side:b,x,y:m,distTop:c,distBottom:s,distLeft:h,distRight:l,pmStart:a.pmStart,pmEnd:a.pmEnd,wrapText:chunkSORYYVJ7_js.h(a.cssFloat),wrapType:a.wrapType,cropTop:a.cropTop,cropRight:a.cropRight,cropBottom:a.cropBottom,cropLeft:a.cropLeft,opacity:a.opacity});}return r}function ae(e,t,n={}){let o=n.document??document,r=o.createElement("div");r.className=n.pageClassName??N.page,r.dataset.pageNumber=String(e.number),ie(r,e.size.w,e.size.h,n);let i=Qt(e,n,o);i&&n.pageBorders?.zOrder==="back"&&r.appendChild(i);let a=o.createElement("div");a.className=N.content,en(a,e);let c=tt(e),s=c.contentWidth,h=[],l=[];for(let d of e.fragments)if(d.kind==="paragraph"&&n.blockLookup){let y=n.blockLookup.get(String(d.blockId));if(y?.block.kind==="paragraph"){let p=y.block,f=d.y-e.margins.top,w=nn(p,f,s,c);h.push(...w);}}for(let d of h)chunkSORYYVJ7_js.d(d)&&l.push({side:d.side,x:d.x,y:d.y,width:d.width,height:d.height,distTop:d.distTop,distBottom:d.distBottom,distLeft:d.distLeft,distRight:d.distRight,wrapText:d.wrapText,wrapType:d.wrapType});if(n.blockLookup)for(let d of e.fragments){if(d.kind!=="table")continue;let y=n.blockLookup.get(String(d.blockId));if(y?.block.kind!=="table")continue;let f=y.block.floating;if(!f)continue;let w=d.x-e.margins.left,S=d.y-e.margins.top,T=f.topFromText??0,P=f.bottomFromText??0,F=f.leftFromText??12,I=f.rightFromText??12,C=w<s/2?"left":"right";l.push({side:C,x:w,y:S,width:d.width,height:d.height,distTop:T,distBottom:P,distLeft:F,distRight:I});}if(n.blockLookup)for(let d of e.fragments){if(d.kind!=="textBox")continue;let y=n.blockLookup.get(String(d.blockId));if(y?.block.kind!=="textBox")continue;let p=y.block;if(!chunkLTHT4A4S_js.E(p))continue;let f=d.y-e.margins.top,w=Ee({width:d.width,height:d.height,position:p.position,cssFloat:p.cssFloat},f,s,c);d.x=e.margins.left+w.x,d.y=e.margins.top+w.y,chunkLTHT4A4S_js.F(p)&&l.push({side:w.side,x:w.x,y:w.y,width:d.width,height:d.height,distTop:p.distTop??0,distBottom:p.distBottom??0,distLeft:p.distLeft??12,distRight:p.distRight??12,wrapText:p.wrapText,wrapType:p.wrapType});}let x=l.length>0?chunkLTHT4A4S_js.p(l,s):[],m=h.filter(chunkSORYYVJ7_js.e),b=h.filter(d=>!chunkSORYYVJ7_js.e(d));if(m.length>0){let d=X(m,o,{layerClass:"layout-floating-images-layer",itemClass:"layout-page-floating-image",sizing:"inset0",layerMode:"behind"});a.appendChild(d);}let k=d=>{if(d.kind!=="paragraph"||!n.blockLookup||!d.blockId)return;let y=n.blockLookup.get(String(d.blockId));if(y?.block.kind==="paragraph")return y.block.attrs?.borders},u,g=new Map;for(let d=0;d<e.fragments.length;d++){let y=e.fragments[d],p,f={...t,section:"body",contentWidth:s},w=y.y-e.margins.top;if(n.blockLookup&&y.blockId){let S=n.blockLookup.get(String(y.blockId));if(y.kind==="paragraph"&&S?.block.kind==="paragraph"&&S?.measure.kind==="paragraph"){let T=S.block,P=d+1<e.fragments.length?k(e.fragments[d+1]):void 0,F=String(y.blockId),I=g.get(F);I||(I=new Set,g.set(F,I));let C=S.measure;x.length>0&&(C=chunkLTHT4A4S_js.v(T,s,{floatingZones:x,paragraphYOffset:w})),p=H(y,T,C,f,{document:o,prevBorders:u,nextBorders:P,renderedInlineImageKeys:I}),u=T.attrs?.borders;}else y.kind==="table"&&S?.block.kind==="table"&&S?.measure.kind==="table"?(p=q(y,S.block,S.measure,f,{document:o}),u=void 0):y.kind==="image"&&S?.block.kind==="image"&&S?.measure.kind==="image"?(p=Z(y,S.block,S.measure,f,{document:o}),u=void 0):y.kind==="textBox"&&S?.block.kind==="textBox"&&S?.measure.kind==="textBox"?(p=J(y,S.block,S.measure,f,{document:o}),u=void 0):(p=we(y,f,{document:o}),u=void 0);}else p=we(y,f,{document:o}),u=void 0;tn(p,y,{left:e.margins.left,top:e.margins.top}),a.appendChild(p);}if(b.length>0){let d=X(b,o,{layerClass:"layout-floating-images-layer",itemClass:"layout-page-floating-image",sizing:"inset0",layerMode:"front"});a.appendChild(d);}if(e.columns&&e.columns.separator&&e.columns.count>1){let d=e.columns.count,y=e.columns.gap,p=(s-(d-1)*y)/d,f=e.size.h-e.margins.top-e.margins.bottom;for(let w=0;w<d-1;w++){let S=(w+1)*p+w*y+y/2,T=o.createElement("div");T.style.position="absolute",T.style.left=`${S}px`,T.style.top="0",T.style.height=`${f}px`,T.style.width="0.5px",T.style.backgroundColor="#000",T.style.pointerEvents="none",a.appendChild(T);}}if(n.footnoteArea&&n.footnoteArea.length>0){let d=st(n.footnoteArea,s,t,o);d.style.position="absolute";let y=Math.max(e.footnoteReservedHeight??0,at(n.footnoteArea)),p=e.size.h-e.margins.bottom-e.margins.top;d.style.top=`${Math.max(-e.margins.top,p-y)}px`,d.style.left="0",d.style.right="0",a.appendChild(d);}r.appendChild(a);{let y=n.headerDistance??e.margins.header??48,p=e.size.w-e.margins.left-e.margins.right,f=Math.max(e.margins.top-y,48),w=n.headerContent?.visualTop??0,S=n.headerContent?.visualBottom??n.headerContent?.height??0,T=Math.max(S-w,24),P=S>f,F=o.createElement("div");F.className=N.header,F.style.position="absolute",F.style.top=`${y+w}px`,F.style.left=`${e.margins.left}px`,F.style.right=`${e.margins.right}px`,F.style.width=`${p}px`,F.style.height=`${T}px`,F.style.minHeight=`${T}px`;let I=!P;if(n.headerContent&&n.headerContent.blocks.length>0){let C={flowTop:y,flowLeft:e.margins.left,contentWidth:p,pageWidth:e.size.w,pageHeight:e.size.h,margins:e.margins},R=Pe(n.headerContent,{...t,section:"header",contentWidth:p},n,C);R.style.top=`${-w}px`,R.querySelector("img")&&(I=false),F.appendChild(R);}I&&(F.style.maxHeight=`${f}px`,F.style.overflow="hidden"),r.appendChild(F);}{let y=n.footerDistance??e.margins.footer??48,p=e.size.w-e.margins.left-e.margins.right,f=Math.max(e.margins.bottom-y,48),w=n.footerContent?.visualTop??0,S=n.footerContent?.visualBottom??n.footerContent?.height??0,T=Math.max(S-w,24),P=T>f,F=o.createElement("div");F.className=N.footer,F.style.position="absolute",F.style.top=`${e.size.h-y-T}px`,F.style.left=`${e.margins.left}px`,F.style.right=`${e.margins.right}px`,F.style.width=`${p}px`,F.style.height=`${T}px`,F.style.minHeight=`${T}px`;let I=!P;if(n.footerContent&&n.footerContent.blocks.length>0){let C={flowTop:e.size.h-y-(n.footerContent?.height??0),flowLeft:e.margins.left,contentWidth:p,pageWidth:e.size.w,pageHeight:e.size.h,margins:e.margins},R=Pe(n.footerContent,{...t,section:"footer",contentWidth:p},n,C);R.style.top=`${-w}px`,R.querySelector("img")&&(I=false),F.appendChild(R);}I&&(F.style.maxHeight=`${f}px`,F.style.overflow="hidden"),r.appendChild(F);}return i&&n.pageBorders?.zOrder!=="back"&&r.appendChild(i),r}exports.A=ie;exports.B=ae;exports.a=he;exports.b=rt;exports.c=_t;exports.d=Xn;exports.e=ve;exports.f=Wt;exports.g=Gt;exports.h=Zn;exports.i=it;exports.j=qn;exports.k=Jn;exports.l=Y;exports.m=we;exports.n=Ke;exports.o=Z;exports.p=Qe;exports.q=ge;exports.r=H;exports.s=X;exports.t=D;exports.u=q;exports.v=Mt;exports.w=J;exports.x=ot;exports.y=Xt;exports.z=N;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {b}from'./chunk-ARHPXIBJ.mjs';import {b as b$1,f as f$1}from'./chunk-CGJ6S3AH.mjs';import {f}from'./chunk-CTHHUJAB.mjs';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
|
+
Returns variable names without braces, along with their locations (body, headers, footers, etc.).
|
|
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=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
|
+
The variable can later be substituted with actual values using docx_apply_template.
|
|
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-ZCJRLT3Z.mjs'),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
|
+
Replaces all {variable} placeholders with the corresponding values provided.
|
|
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=b$1(e.buffer,n,{nullGetter:t?"keep":"empty"}),a=await f(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
|
+
Checks for syntax errors like unclosed braces, invalid tag names, etc.
|
|
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=f$1(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};export{M as a,E as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var A=340,_=12,D=176,I=8;exports.a=A;exports.b=_;exports.c=D;exports.d=I;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {c}from'./chunk-K7GVLZS6.mjs';import {a as a$1}from'./chunk-ARHPXIBJ.mjs';import {b,a as a$2}from'./chunk-CUY2THAO.mjs';import {h as h$1,s}from'./chunk-QLX4HX3I.mjs';import {f}from'./chunk-CTHHUJAB.mjs';import {a}from'./chunk-QYUPLKLP.mjs';var P=class o{constructor(t){a(this,"_document");a(this,"_pendingVariables");t instanceof ArrayBuffer||ArrayBuffer.isView(t)?this._document={package:{document:{content:[]}},originalBuffer:t instanceof ArrayBuffer?t:t.buffer}:this._document=t,this._pendingVariables={};}static async fromBuffer(t){let e=await f(t);return new o(e)}static fromDocument(t){return new o(t)}getDocument(){return this._document}getText(){let t=this._document.package.document;return this._getBodyText(t)}getFormattedText(){let t=[],e=this._document.package.document;for(let n of e.content)n.type==="paragraph"&&this._extractParagraphSegments(n,t);return t}getVariables(){return a$1(this._document)}getStyles(){let t=this._document.package.styles;if(!t?.styles)return [];let e=[];for(let[n,r]of Object.entries(t.styles))if(typeof r=="object"&&r!==null){let a=r;e.push({id:n,name:a.name||n,type:a.type==="numbering"?"paragraph":a.type||"paragraph",builtIn:a.default});}return e}getPageCount(){let t=this.getWordCount();return Math.max(1,Math.ceil(t/500))}getWordCount(){return this.getText().split(/\s+/).filter(n=>n.length>0).length}getCharacterCount(t=true){let e=this.getText();return t?e.length:e.replace(/\s/g,"").length}getParagraphCount(){return this._document.package.document.content.filter(t=>t.type==="paragraph").length}getTableCount(){return this._document.package.document.content.filter(t=>t.type==="table").length}getAgentContext(t=100){let e=this._document.package.document,n=e.content.filter(i=>i.type==="paragraph"),r=n.map((i,s)=>{let c=this._getParagraphText(i),p=i.formatting?.styleId;return {index:s,preview:c.slice(0,t),style:p,isHeading:p?.toLowerCase().includes("heading")||false,headingLevel:this._parseHeadingLevel(p),isListItem:!!i.listRendering,isEmpty:c.trim().length===0}}),a=(e.sections||[]).map((i,s)=>({index:s,paragraphCount:i.content?.length||0,pageSize:i.properties?.pageWidth&&i.properties?.pageHeight?{width:i.properties.pageWidth,height:i.properties.pageHeight}:void 0,isLandscape:i.properties?.orientation==="landscape",hasHeader:!!i.properties?.headerReferences?.length,hasFooter:!!i.properties?.footerReferences?.length}));return {paragraphCount:n.length,wordCount:this.getWordCount(),characterCount:this.getCharacterCount(),variables:this.getVariables(),variableCount:this.getVariables().length,availableStyles:this.getStyles(),outline:r,sections:a,hasTables:this.getTableCount()>0,hasImages:this._hasImages(),hasHyperlinks:this._hasHyperlinks()}}insertText(t,e,n={}){let r={type:"insertText",position:t,text:e,formatting:n.formatting};return this._executeCommand(r)}replaceRange(t,e,n={}){let r={type:"replaceText",range:t,text:e,formatting:n.formatting};return this._executeCommand(r)}deleteRange(t){let e={type:"deleteText",range:t};return this._executeCommand(e)}applyFormatting(t,e){let n={type:"formatText",range:t,formatting:e};return this._executeCommand(n)}applyStyle(t,e){let n={type:"applyStyle",paragraphIndex:t,styleId:e};return this._executeCommand(n)}applyParagraphFormatting(t,e){let n={type:"formatParagraph",paragraphIndex:t,formatting:e};return this._executeCommand(n)}insertTable(t,e,n,r={}){let a={type:"insertTable",position:t,rows:e,columns:n,data:r.data,hasHeader:r.hasHeader};return this._executeCommand(a)}insertImage(t,e,n={}){let r={type:"insertImage",position:t,src:e,width:n.width,height:n.height,alt:n.alt};return this._executeCommand(r)}insertHyperlink(t,e,n={}){let r={type:"insertHyperlink",range:t,url:e,displayText:n.displayText,tooltip:n.tooltip};return this._executeCommand(r)}removeHyperlink(t){let e={type:"removeHyperlink",range:t};return this._executeCommand(e)}insertParagraphBreak(t){let e={type:"insertParagraphBreak",position:t};return this._executeCommand(e)}mergeParagraphs(t,e){let n={type:"mergeParagraphs",paragraphIndex:t,count:e};return this._executeCommand(n)}setVariable(t,e){return this._pendingVariables[t]=e,this}setVariables(t){for(let[e,n]of Object.entries(t))this._pendingVariables[e]=n;return this}getPendingVariables(){return {...this._pendingVariables}}clearPendingVariables(){return this._pendingVariables={},this}async applyVariables(t){let e={...this._pendingVariables,...t};if(Object.keys(e).length===0)return this;let n=this._document.originalBuffer;if(!n)throw new Error("Cannot apply variables: no original buffer for processing");let{processTemplate:r}=await import('./processTemplate-GPFDLQMX.mjs'),a=r(n,e),i=await f(a),s=new o(i);return s._pendingVariables={},s}async toBuffer(t){if(this._document.originalBuffer){if(t?.selective){let n=await c(this._document,this._document.originalBuffer,t.selective);if(n)return this._document.originalBuffer=n,n}let e=await h$1(this._document);return this._document.originalBuffer=e,e}return s(this._document)}async toBlob(t="application/vnd.openxmlformats-officedocument.wordprocessingml.document"){let e=await this.toBuffer();return new Blob([e],{type:t})}executeCommands(t){return new o(b(this._document,t))}_executeCommand(t){let e=new o(a$2(this._document,t));return e._pendingVariables={...this._pendingVariables},e}_getBodyText(t){let e=[];for(let n of t.content)n.type==="paragraph"?e.push(this._getParagraphText(n)):n.type==="table"&&e.push(this._getTableText(n));return e.join(`
|
|
2
|
+
`)}_getParagraphText(t){let e=[];for(let n of t.content)n.type==="run"?e.push(this._getRunText(n)):n.type==="hyperlink"&&e.push(this._getHyperlinkText(n));return e.join("")}_getRunText(t){return t.content.filter(e=>e.type==="text").map(e=>e.text).join("")}_getHyperlinkText(t){let e=[];for(let n of t.children)n.type==="run"&&e.push(this._getRunText(n));return e.join("")}_getTableText(t){let e=[];for(let n of t.rows)for(let r of n.cells)for(let a of r.content)a.type==="paragraph"&&e.push(this._getParagraphText(a));return e.join(" ")}_extractParagraphSegments(t,e){for(let n of t.content)if(n.type==="run"){let r=this._getRunText(n);r&&e.push({text:r,formatting:n.formatting});}else if(n.type==="hyperlink"){let r=n.href||"";for(let a of n.children)if(a.type==="run"){let i=this._getRunText(a);i&&e.push({text:i,formatting:a.formatting,isHyperlink:true,hyperlinkUrl:r});}}}_parseHeadingLevel(t){if(!t)return;let e=t.match(/heading\s*(\d)/i);if(e)return parseInt(e[1],10)}_hasImages(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let n of e.content)if(n.type==="run"){for(let r of n.content)if(r.type==="drawing")return true}}return false}_hasHyperlinks(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let n of e.content)if(n.type==="hyperlink")return true}return false}};async function Ct(o){return P.fromBuffer(o)}function kt(o){return P.fromDocument(o)}function M(o,t={}){let{outlineMaxChars:e=100,maxOutlineParagraphs:n=50}=t,r=o.package.document,a=r.content.filter(y=>y.type==="paragraph"),i=z(a,e,n),s=a$1(o),c=W(o),p=$(r),u=U(r),d=G(r),f=r.content.some(y=>y.type==="table"),x=K(r),l=N(r);return {paragraphCount:a.length,wordCount:u,characterCount:d,variables:s,variableCount:s.length,availableStyles:c,outline:i,sections:p,hasTables:f,hasImages:x,hasHyperlinks:l}}function At(o,t,e={}){let{contextChars:n=200,includeSuggestions:r=true}=e,i=o.package.document.content.filter(m=>m.type==="paragraph"),s=i[t.start.paragraphIndex];if(!s)throw new Error(`Paragraph not found at index ${t.start.paragraphIndex}`);let c=g(s),p="";if(t.start.paragraphIndex===t.end.paragraphIndex)p=c.slice(t.start.offset,t.end.offset);else {let m=[];for(let b=t.start.paragraphIndex;b<=t.end.paragraphIndex;b++){let H=i[b];if(!H)continue;let _=g(H);b===t.start.paragraphIndex?m.push(_.slice(t.start.offset)):b===t.end.paragraphIndex?m.push(_.slice(0,t.end.offset)):m.push(_);}p=m.join(`
|
|
3
|
+
`);}let u=Y(i,t.start.paragraphIndex,t.start.offset,n),d=Z(i,t.end.paragraphIndex,t.end.offset,n),f=tt(s,t.start.offset),x=s.formatting||{},l={index:t.start.paragraphIndex,fullText:c,style:s.formatting?.styleId,wordCount:v(c)},y=false,A=et(s,t.start.offset),S=r?nt(p):[];return {selectedText:p,range:t,formatting:f,paragraphFormatting:x,textBefore:u,textAfter:d,paragraph:l,inTable:y,inHyperlink:A,suggestedActions:S}}function L(o){let t=M(o,{outlineMaxChars:50,maxOutlineParagraphs:10}),e=[`Document with ${t.paragraphCount} paragraphs, ${t.wordCount} words.`];t.hasTables&&e.push("Contains tables."),t.hasImages&&e.push("Contains images."),t.hasHyperlinks&&e.push("Contains hyperlinks."),t.variableCount>0&&e.push(`Has ${t.variableCount} template variables: ${t.variables.join(", ")}`);let n=t.outline.filter(r=>r.isHeading);if(n.length>0){e.push(`
|
|
4
|
+
Headings:`);for(let r of n.slice(0,5)){let a=r.headingLevel||1;e.push(`${" ".repeat(a-1)}- ${r.preview}`);}n.length>5&&e.push(` ... and ${n.length-5} more headings`);}return e.join(" ")}function z(o,t,e){let n=[];for(let r=0;r<Math.min(o.length,e);r++){let a=o[r],i=g(a),s=a.formatting?.styleId;n.push({index:r,preview:i.slice(0,t),style:s,isHeading:Q(s),headingLevel:X(s),isListItem:!!a.listRendering,isEmpty:i.trim().length===0});}return n}function W(o){let t=o.package.styles;if(!t?.styles)return [];let e=[];for(let[n,r]of Object.entries(t.styles))if(typeof r=="object"&&r!==null){let a=r;e.push({id:n,name:a.name||n,type:a.type==="numbering"?"paragraph":a.type||"paragraph",builtIn:a.default});}return e}function $(o){return o.sections?o.sections.map((t,e)=>({index:e,paragraphCount:t.content?.length||0,pageSize:t.properties?.pageWidth&&t.properties?.pageHeight?{width:t.properties.pageWidth,height:t.properties.pageHeight}:void 0,isLandscape:t.properties?.orientation==="landscape",hasHeader:!!t.properties?.headerReferences?.length,hasFooter:!!t.properties?.footerReferences?.length})):[]}function U(o){let t=0;for(let e of o.content)if(e.type==="paragraph"){let n=g(e);t+=v(n);}else e.type==="table"&&(t+=q(e));return t}function v(o){return o.split(/\s+/).filter(e=>e.length>0).length}function G(o){let t=0;for(let e of o.content)if(e.type==="paragraph"){let n=g(e);t+=n.length;}else e.type==="table"&&(t+=J(e));return t}function q(o){let t=0;for(let e of o.rows)for(let n of e.cells)for(let r of n.content)if(r.type==="paragraph"){let a=g(r);t+=v(a);}return t}function J(o){let t=0;for(let e of o.rows)for(let n of e.cells)for(let r of n.content)if(r.type==="paragraph"){let a=g(r);t+=a.length;}return t}function g(o){let t=[];for(let e of o.content)e.type==="run"?t.push(T(e)):e.type==="hyperlink"&&t.push(F(e));return t.join("")}function T(o){return o.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function F(o){let t=[];for(let e of o.children)e.type==="run"&&t.push(T(e));return t.join("")}function K(o){for(let t of o.content)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="run"){for(let n of e.content)if(n.type==="drawing")return true}}return false}function N(o){for(let t of o.content)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="hyperlink")return true}return false}function Q(o){return o?o.toLowerCase().includes("heading"):false}function X(o){if(!o)return;let t=o.match(/heading\s*(\d)/i);if(t)return parseInt(t[1],10)}function Y(o,t,e,n){let r=[],a=0,i=o[t];if(i){let p=g(i).slice(0,e);r.unshift(p),a+=p.length;}for(let c=t-1;c>=0&&a<n;c--){let p=o[c];if(!p)continue;let u=g(p);r.unshift(u),a+=u.length;}let s=r.join(`
|
|
5
|
+
`);return s.length>n?"..."+s.slice(-n):s}function Z(o,t,e,n){let r=[],a=0,i=o[t];if(i){let p=g(i).slice(e);r.push(p),a+=p.length;}for(let c=t+1;c<o.length&&a<n;c++){let p=o[c];if(!p)continue;let u=g(p);r.push(u),a+=u.length;}let s=r.join(`
|
|
6
|
+
`);return s.length>n?s.slice(0,n)+"...":s}function tt(o,t){let e=0;for(let n of o.content)if(n.type==="run"){let r=T(n),a=e,i=e+r.length;if(t>=a&&t<i)return n.formatting||{};e=i;}else if(n.type==="hyperlink"){let r=F(n),a=e,i=e+r.length;if(t>=a&&t<i){for(let s of n.children)if(s.type==="run")return s.formatting||{}}e=i;}return {}}function et(o,t){let e=0;for(let n of o.content)if(n.type==="run"){let r=T(n);e+=r.length;}else if(n.type==="hyperlink"){let r=F(n),a=e,i=e+r.length;if(t>=a&&t<i)return true;e=i;}return false}function nt(o,t,e){let n=[];return o.length>0&&(n.push({id:"rewrite",label:"Rewrite",description:"Rewrite this text",priority:10},{id:"summarize",label:"Summarize",description:"Summarize this text",priority:9}),o.length>200&&n.push({id:"summarize",label:"Summarize",description:"Create a shorter version",priority:8}),o.length<50&&o.split(/\s+/).length<10&&n.push({id:"expand",label:"Expand",description:"Add more details",priority:8}),n.push({id:"fixGrammar",label:"Fix Grammar",description:"Fix grammar and spelling",priority:7}),n.push({id:"translate",label:"Translate",description:"Translate to another language",priority:6}),n.push({id:"makeFormal",label:"Make Formal",description:"Use formal tone",priority:5},{id:"makeCasual",label:"Make Casual",description:"Use casual tone",priority:4})),n.sort((r,a)=>(a.priority||0)-(r.priority||0)),n}function rt(o,t,e={}){let{contextCharsBefore:n=200,contextCharsAfter:r=200,includeSuggestions:a=true}=e,i=o.package.document,s=i.content.filter(m=>m.type==="paragraph");if(t.start.paragraphIndex>=s.length)throw new Error(`Invalid start paragraph index: ${t.start.paragraphIndex}`);let c=s[t.start.paragraphIndex],p=ot(s,t),u=at(s,t.start,n),d=it(s,t.end,r),f=st(c,t.start.offset),x=c.formatting||{},l={index:t.start.paragraphIndex,fullText:h(c),style:c.formatting?.styleId,wordCount:R(h(c))},y=pt(i,t.start),A=ut(c,t.start.offset),S=a?lt(p):[];return {selectedText:p,range:t,formatting:f,paragraphFormatting:x,textBefore:u,textAfter:d,paragraph:l,inTable:y,inHyperlink:A,suggestedActions:S}}function wt(o,t,e={}){let n=rt(o,t,e),{includeDocumentSummary:r=true}=e,i=o.package.document.content.filter(l=>l.type==="paragraph"),s=R(n.selectedText),c=n.selectedText.length,p=t.start.paragraphIndex!==t.end.paragraphIndex,u=[];for(let l=t.start.paragraphIndex;l<=t.end.paragraphIndex;l++)u.push(l);let d=gt(i,t),f=r?L(o):void 0,x=ft(n.selectedText);return {...n,documentSummary:f,wordCount:s,characterCount:c,isMultiParagraph:p,paragraphIndices:u,detectedLanguage:x,contentType:d}}function Dt(o,t){let n=o.package.document.content.filter(s=>s.type==="paragraph"),r=[];for(let s=t.start.paragraphIndex;s<=t.end.paragraphIndex;s++){let c=n[s];if(!c)continue;let p=s===t.start.paragraphIndex?t.start.offset:0,u=s===t.end.paragraphIndex?t.end.offset:1/0;ct(c,p,u,r);}let a=r.length<=1||r.every(s=>mt(s,r[0]));return {predominant:r.length>0?r[0]:{},isConsistent:a,allFormatting:r}}function ot(o,t){if(t.start.paragraphIndex===t.end.paragraphIndex){let n=o[t.start.paragraphIndex];return n?h(n).slice(t.start.offset,t.end.offset):""}let e=[];for(let n=t.start.paragraphIndex;n<=t.end.paragraphIndex;n++){let r=o[n];if(!r)continue;let a=h(r);n===t.start.paragraphIndex?e.push(a.slice(t.start.offset)):n===t.end.paragraphIndex?e.push(a.slice(0,t.end.offset)):e.push(a);}return e.join(`
|
|
7
|
+
`)}function at(o,t,e){let n=[],r=0,a=o[t.paragraphIndex];if(a){let c=h(a).slice(0,t.offset);n.unshift(c),r+=c.length;}for(let s=t.paragraphIndex-1;s>=0&&r<e;s--){let c=o[s];if(!c)continue;let p=h(c);n.unshift(p),r+=p.length;}let i=n.join(`
|
|
8
|
+
`);return i.length>e?"..."+i.slice(-e):i}function it(o,t,e){let n=[],r=0,a=o[t.paragraphIndex];if(a){let c=h(a).slice(t.offset);n.push(c),r+=c.length;}for(let s=t.paragraphIndex+1;s<o.length&&r<e;s++){let c=o[s];if(!c)continue;let p=h(c);n.push(p),r+=p.length;}let i=n.join(`
|
|
9
|
+
`);return i.length>e?i.slice(0,e)+"...":i}function st(o,t){let e=0;for(let n of o.content)if(n.type==="run"){let r=C(n),a=e+r.length;if(t>=e&&t<a)return n.formatting||{};e=a;}else if(n.type==="hyperlink"){let r=I(n),a=e+r.length;if(t>=e&&t<a){for(let i of n.children)if(i.type==="run")return i.formatting||{}}e=a;}return {}}function ct(o,t,e,n){let r=0;for(let a of o.content)if(a.type==="run"){let i=C(a),s=r,c=r+i.length;c>t&&s<e&&a.formatting&&n.push({...a.formatting}),r=c;}else if(a.type==="hyperlink"){let i=I(a),s=r,c=r+i.length;if(c>t&&s<e)for(let p of a.children)p.type==="run"&&p.formatting&&n.push({...p.formatting});r=c;}}function pt(o,t){return false}function ut(o,t){let e=0;for(let n of o.content)if(n.type==="run"){let r=C(n);e+=r.length;}else if(n.type==="hyperlink"){let r=I(n),a=e,i=e+r.length;if(t>=a&&t<i)return true;e=i;}return false}function lt(o,t,e){let n=[];if(!o||o.trim().length===0)return n;n.push({id:"askAI",label:"Ask AI",description:"Ask AI about this text",priority:11},{id:"rewrite",label:"Rewrite",description:"Rewrite this text differently",priority:10});let r=R(o);return r>50&&n.push({id:"summarize",label:"Summarize",description:"Create a shorter version",priority:9}),r<20&&n.push({id:"expand",label:"Expand",description:"Add more details",priority:9}),n.push({id:"fixGrammar",label:"Fix Grammar",description:"Fix grammar and spelling",priority:7},{id:"translate",label:"Translate",description:"Translate to another language",priority:6},{id:"explain",label:"Explain",description:"Explain what this means",priority:5}),n.push({id:"makeFormal",label:"Make Formal",description:"Use formal tone",priority:4},{id:"makeCasual",label:"Make Casual",description:"Use casual tone",priority:3}),n.sort((a,i)=>(i.priority||0)-(a.priority||0)),n}function gt(o,t){let e=new Set;for(let n=t.start.paragraphIndex;n<=t.end.paragraphIndex;n++){let r=o[n];r&&(r.listRendering?e.add("list"):r.formatting?.styleId?.toLowerCase().includes("heading")?e.add("heading"):e.add("prose"));}return e.size>1?"mixed":e.has("list")?"list":e.has("heading")?"heading":"prose"}function ft(o){return /[а-яА-ЯёЁ]/.test(o)?"ru":/[一-龯]/.test(o)?"zh":/[ひらがなカタカナ]/.test(o)||/[\u3040-\u309F\u30A0-\u30FF]/.test(o)?"ja":/[가-힣]/.test(o)?"ko":/[àâäéèêëïîôùûüç]/i.test(o)?"fr":/[äöüß]/i.test(o)?"de":/[áéíóúñ]/i.test(o)?"es":"en"}function h(o){let t=[];for(let e of o.content)e.type==="run"?t.push(C(e)):e.type==="hyperlink"&&t.push(I(e));return t.join("")}function C(o){return o.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function I(o){let t=[];for(let e of o.children)e.type==="run"&&t.push(C(e));return t.join("")}function R(o){return o.split(/\s+/).filter(t=>t.length>0).length}function mt(o,t){let e=Object.keys(o),n=Object.keys(t);return e.length!==n.length?false:e.every(r=>{let a=o[r],i=t[r];return a===i})}export{P as a,Ct as b,kt as c,M as d,At as e,L as f,rt as g,wt as h,Dt as i};
|