@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
|
+
var t={calibri:{googleFont:"Carlito",category:"sans-serif",fallbackStack:["Calibri","Carlito","Arial","Helvetica","sans-serif"],singleLineRatio:1.2207},cambria:{googleFont:"Caladea",category:"serif",fallbackStack:["Cambria","Caladea","Georgia","serif"],singleLineRatio:1.2676},arial:{googleFont:"Arimo",category:"sans-serif",fallbackStack:["Arial","Arimo","Helvetica","sans-serif"],singleLineRatio:1.1172},"times new roman":{googleFont:"Tinos",category:"serif",fallbackStack:["Times New Roman","Tinos","Times","serif"],singleLineRatio:1.1074},"courier new":{googleFont:"Cousine",category:"monospace",fallbackStack:["Courier New","Cousine","Courier","monospace"],singleLineRatio:1.1328},georgia:{googleFont:"Tinos",category:"serif",fallbackStack:["Georgia","Tinos","Times New Roman","serif"],singleLineRatio:1.1362},verdana:{googleFont:"Open Sans",category:"sans-serif",fallbackStack:["Verdana","Open Sans","Arial","sans-serif"],singleLineRatio:1.2153},tahoma:{googleFont:"Open Sans",category:"sans-serif",fallbackStack:["Tahoma","Open Sans","Arial","sans-serif"],singleLineRatio:1.2075},"trebuchet ms":{googleFont:"Fira Sans",category:"sans-serif",fallbackStack:["Trebuchet MS","Fira Sans","Arial","sans-serif"],singleLineRatio:1.1431},"comic sans ms":{googleFont:"Comic Neue",category:"cursive",fallbackStack:["Comic Sans MS","Comic Neue","cursive"],singleLineRatio:1.3936},impact:{googleFont:"Anton",category:"sans-serif",fallbackStack:["Impact","Anton","Arial Black","sans-serif"],singleLineRatio:1.2197},"palatino linotype":{googleFont:"EB Garamond",category:"serif",fallbackStack:["Palatino Linotype","EB Garamond","Palatino","Georgia","serif"],singleLineRatio:1.0259},"book antiqua":{googleFont:"EB Garamond",category:"serif",fallbackStack:["Book Antiqua","EB Garamond","Palatino","Georgia","serif"],singleLineRatio:1.0259},garamond:{googleFont:"EB Garamond",category:"serif",fallbackStack:["Garamond","EB Garamond","Georgia","serif"],singleLineRatio:1.068},"century gothic":{googleFont:"Questrial",category:"sans-serif",fallbackStack:["Century Gothic","Questrial","Arial","sans-serif"],singleLineRatio:1.1611},"lucida sans":{googleFont:"Open Sans",category:"sans-serif",fallbackStack:["Lucida Sans","Open Sans","Arial","sans-serif"],singleLineRatio:1.1655},"lucida console":{googleFont:"Cousine",category:"monospace",fallbackStack:["Lucida Console","Cousine","Courier New","monospace"],singleLineRatio:1.1387},consolas:{googleFont:"Inconsolata",category:"monospace",fallbackStack:["Consolas","Inconsolata","Cousine","Courier New","monospace"],singleLineRatio:1.1626},"ms mincho":{googleFont:"Noto Serif JP",category:"serif",fallbackStack:["MS Mincho","Noto Serif JP","serif"],singleLineRatio:1.15},"ms gothic":{googleFont:"Noto Sans JP",category:"sans-serif",fallbackStack:["MS Gothic","Noto Sans JP","sans-serif"],singleLineRatio:1.15},simhei:{googleFont:"Noto Sans SC",category:"sans-serif",fallbackStack:["SimHei","Noto Sans SC","sans-serif"],singleLineRatio:1.15},simsun:{googleFont:"Noto Serif SC",category:"serif",fallbackStack:["SimSun","Noto Serif SC","serif"],singleLineRatio:1.15},"malgun gothic":{googleFont:"Noto Sans KR",category:"sans-serif",fallbackStack:["Malgun Gothic","Noto Sans KR","sans-serif"],singleLineRatio:1.15}},r={"sans-serif":"Arial, Helvetica, sans-serif",serif:"Times New Roman, Times, serif",monospace:"Courier New, Courier, monospace",cursive:"cursive",fantasy:"fantasy","system-ui":"system-ui, sans-serif"};function l(o){let e=o.toLowerCase();return e.includes("mono")||e.includes("courier")||e.includes("consolas")||e.includes("console")||e.includes("code")||e.includes("terminal")?"monospace":e.includes("times")||e.includes("georgia")||e.includes("garamond")||e.includes("palatino")||e.includes("baskerville")||e.includes("bodoni")||e.includes("cambria")||e.includes("mincho")||e.includes("ming")||e.includes("song")||e.includes("serif")?"serif":e.includes("script")||e.includes("cursive")||e.includes("comic")||e.includes("brush")||e.includes("hand")?"cursive":"sans-serif"}function c(o){let e=o.trim().toLowerCase(),i=t[e];if(i)return {googleFont:i.googleFont,cssFallback:i.fallbackStack.map(s).join(", "),originalFont:o,hasGoogleEquivalent:true,singleLineRatio:i.singleLineRatio};let n=l(o),a=r[n];return {googleFont:null,cssFallback:`${s(o)}, ${a}`,originalFont:o,hasGoogleEquivalent:false,singleLineRatio:1.15}}function s(o){return ["serif","sans-serif","monospace","cursive","fantasy","system-ui"].includes(o.toLowerCase())?o:/[\s,'"()]/.test(o)?`"${o.replace(/"/g,'\\"')}"`:o}function g(o,e){if(!e)return null;let n=o.toLowerCase().startsWith("major")?e.majorFont:e.minorFont;if(!n)return null;let a=o.toLowerCase();return a.includes("eastasia")||a.includes("ea")?n.ea??n.latin??null:a.includes("cs")||a.includes("bidi")?n.cs??n.latin??null:n.latin??null}export{c as a,g as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function b(e){return h(e).variables}function h(e){let t=[],n={body:[],headers:[],footers:[],footnotes:[],endnotes:[],textBoxes:[]};if(e.package?.document){let r=d(e.package.document);r.forEach(s=>{t.push({name:s,location:"body"});}),n.body=Array.from(new Set(r)).sort();}if(e.package?.document?.sections&&e.package.document.sections.forEach((r,s)=>{r.properties.headerReferences&&r.properties.headerReferences.forEach(R=>{});}),e.package?.footnotes){let r=u(e.package.footnotes);r.forEach(s=>{t.push({name:s,location:"footnote"});}),n.footnotes=Array.from(new Set(r)).sort();}if(e.package?.endnotes){let r=u(e.package.endnotes);r.forEach(s=>{t.push({name:s,location:"endnote"});}),n.endnotes=Array.from(new Set(r)).sort();}e.templateVariables&&e.templateVariables.forEach(r=>{t.some(s=>s.name===r)||t.push({name:r,location:"body"});});let o=new Set;return t.forEach(r=>o.add(r.name)),{variables:Array.from(o).sort(),totalOccurrences:t.length,byLocation:n,occurrences:t}}function d(e){let t=[];if(e.content&&t.push(...c(e.content)),e.sections)for(let n of e.sections)n.content&&t.push(...c(n.content));return t}function c(e){let t=[];for(let n of e)n.type==="paragraph"?t.push(...a(n)):n.type==="table"&&t.push(...l(n));return t}function a(e){let t=[];if(!e.content)return t;for(let n of e.content)n.type==="run"?t.push(...i(n)):n.type==="hyperlink"?t.push(...m(n)):n.type==="simpleField"?t.push(...x(n)):n.type==="complexField"&&t.push(...V(n));return t}function i(e){let t=[];if(!e.content)return t;for(let n of e.content)n.type==="text"&&n.text&&t.push(...g(n.text));return t}function m(e){let t=[];if(!e.children)return t;for(let n of e.children)n.type==="run"&&t.push(...i(n));return t}function x(e){let t=[];if(e.instruction&&t.push(...g(e.instruction)),e.content)for(let n of e.content)n.type==="run"&&t.push(...i(n));return t}function V(e){let t=[];if(e.fieldCode)for(let n of e.fieldCode)n.type==="run"&&t.push(...i(n));if(e.fieldResult)for(let n of e.fieldResult)n.type==="run"&&t.push(...i(n));return t}function l(e){let t=[];if(!e.rows)return t;for(let n of e.rows)if(n.cells)for(let o of n.cells)t.push(...y(o));return t}function y(e){let t=[];if(!e.content)return t;for(let n of e.content)n.type==="paragraph"?t.push(...a(n)):n.type==="table"&&t.push(...l(n));return t}function u(e){let t=[];for(let n of e)if(n.content)for(let o of n.content)o.type==="paragraph"&&t.push(...a(o));return t}var f=/\{([a-zA-Z_][a-zA-Z0-9_\-\.]*)\}/g,p=/\{(.+?)\}/g;function g(e){if(!e)return [];let t=[],n=new RegExp(f),o;for(;(o=n.exec(e))!==null;)t.push(o[1]);return t}function A(e){return f.test(e)}function E(e){return !(!e||typeof e!="string"||e.length===0||e.length>100||!/^[a-zA-Z_]/.test(e)||!/^[a-zA-Z_][a-zA-Z0-9_\-\.]*$/.test(e))}function v(e){if(!e)return "";let t=e.replace(/\s+/g,"_");return t=t.replace(/[^a-zA-Z0-9_\-\.]/g,""),t&&!/^[a-zA-Z_]/.test(t)&&(t="_"+t),t.substring(0,100)}function k(e){return `{${e}}`}function I(e){let t=e.match(/^\{(.+?)\}$/);return t?t[1]:null}function F(e,t){return e&&e.replace(p,(n,o)=>{let r=o.trim();return r in t?t[r]:n})}function T(e,t=""){return e&&e.replace(p,t)}function _(e){return b(e).length>0}export{b as a,h as b,d as c,a as d,g as e,A as f,E as g,v as h,k as i,I as j,F as k,T as l,_ as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {PluginKey,Plugin}from'prosemirror-state';var f=new 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 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}export{f as a,k as b,w as c,R as d};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use strict';var chunkN3Y5BUKV_js=require('./chunk-N3Y5BUKV.js'),chunkMJ5FQX7Q_js=require('./chunk-MJ5FQX7Q.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js');function re(e,n){if(!e)return {};let t={};if(e.fontFamily){let a=null;if(e.fontFamily.asciiTheme&&n?.fontScheme&&(a=chunkN3Y5BUKV_js.b(e.fontFamily.asciiTheme,n.fontScheme)),a||(a=e.fontFamily.ascii||e.fontFamily.hAnsi||e.fontFamily.eastAsia||e.fontFamily.cs||null),a){let d=chunkN3Y5BUKV_js.a(a);t.fontFamily=d.cssFallback;}}if(e.fontSize!==void 0&&(t.fontSize=`${chunk4Q2IP5FW_js.k(e.fontSize)}pt`),e.bold&&(t.fontWeight="bold"),e.italic&&(t.fontStyle="italic"),e.color&&(t.color=chunkMJ5FQX7Q_js.a(e.color,n)),e.highlight&&e.highlight!=="none"&&(t.backgroundColor=chunkMJ5FQX7Q_js.o(e.highlight)),e.shading){let a=T(e.shading,n);a&&!t.backgroundColor&&(t.backgroundColor=a);}let r=[],i=[],o=[];if(e.underline&&e.underline.style!=="none"){r.push("underline");let a=z(e.underline.style);a!=="solid"&&i.push(a),e.underline.color&&o.push(chunkMJ5FQX7Q_js.a(e.underline.color,n));}if(e.strike&&r.push("line-through"),e.doubleStrike&&r.push("line-through"),r.length>0&&(t.textDecoration=r.join(" "),i.length>0&&(t.textDecorationStyle=i[0]),o.length>0&&(t.textDecorationColor=o[0])),e.vertAlign)switch(e.vertAlign){case "superscript":t.verticalAlign="super",t.fontSize||(t.fontSize="0.83em");break;case "subscript":t.verticalAlign="sub",t.fontSize||(t.fontSize="0.83em");break}if(e.position&&e.position!==0){let a=chunk4Q2IP5FW_js.j(e.position);t.position="relative",t.top=chunk4Q2IP5FW_js.p(-a);}return e.allCaps?t.textTransform="uppercase":e.smallCaps&&(t.fontVariant="small-caps"),e.spacing!==void 0&&e.spacing!==0&&(t.letterSpacing=chunk4Q2IP5FW_js.p(chunk4Q2IP5FW_js.c(e.spacing))),e.scale!==void 0&&e.scale!==100&&(t.transform=`scaleX(${e.scale/100})`,t.display="inline-block"),e.hidden&&(t.display="none"),e.emboss&&(t.textShadow="1px 1px 1px rgba(255,255,255,0.5), -1px -1px 1px rgba(0,0,0,0.3)"),e.imprint&&(t.textShadow="-1px -1px 1px rgba(255,255,255,0.5), 1px 1px 1px rgba(0,0,0,0.3)"),e.outline&&(t.WebkitTextStroke="1px currentColor",t.WebkitTextFillColor="transparent"),e.shadow&&!e.emboss&&!e.imprint&&(t.textShadow="1px 1px 2px rgba(0,0,0,0.3)"),e.rtl&&(t.direction="rtl"),t}function ie(e,n){if(!e)return {};let t={};if(e.alignment&&(t.textAlign=j(e.alignment)),e.spaceBefore!==void 0&&(t.marginTop=chunk4Q2IP5FW_js.p(chunk4Q2IP5FW_js.c(e.spaceBefore))),e.spaceAfter!==void 0&&(t.marginBottom=chunk4Q2IP5FW_js.p(chunk4Q2IP5FW_js.c(e.spaceAfter))),e.lineSpacing!==void 0&&e.lineSpacing>0)switch(e.lineSpacingRule){case "exact":{let r=chunk4Q2IP5FW_js.c(e.lineSpacing);r>0&&(t.lineHeight=chunk4Q2IP5FW_js.p(r));break}case "atLeast":{let r=chunk4Q2IP5FW_js.c(e.lineSpacing);r>0&&(t.minHeight=chunk4Q2IP5FW_js.p(r),t.lineHeight=chunk4Q2IP5FW_js.p(r));break}default:{let r=e.lineSpacing/240;r>0&&(t.lineHeight=r.toString());break}}if(e.indentLeft!==void 0&&(t.marginLeft=chunk4Q2IP5FW_js.p(chunk4Q2IP5FW_js.c(e.indentLeft))),e.indentRight!==void 0&&(t.marginRight=chunk4Q2IP5FW_js.p(chunk4Q2IP5FW_js.c(e.indentRight))),e.indentFirstLine!==void 0&&(e.hangingIndent?t.textIndent=chunk4Q2IP5FW_js.p(chunk4Q2IP5FW_js.c(e.indentFirstLine)):t.textIndent=chunk4Q2IP5FW_js.p(chunk4Q2IP5FW_js.c(e.indentFirstLine))),e.borders&&(e.borders.top&&Object.assign(t,h(e.borders.top,"Top",n)),e.borders.bottom&&Object.assign(t,h(e.borders.bottom,"Bottom",n)),e.borders.left&&Object.assign(t,h(e.borders.left,"Left",n)),e.borders.right&&Object.assign(t,h(e.borders.right,"Right",n))),e.shading){let r=T(e.shading,n);r&&(t.backgroundColor=r);}return e.bidi&&(t.direction="rtl"),e.pageBreakBefore&&(t.pageBreakBefore="always"),e.keepNext&&(t.pageBreakAfter="avoid"),e.keepLines&&(t.pageBreakInside="avoid"),t}function h(e,n="",t){if(!e||e.style==="none"||e.style==="nil")return {};let r={},i=e.size?chunk4Q2IP5FW_js.m(e.size):1,o=e.color?chunkMJ5FQX7Q_js.a(e.color,t):"#000000",a=$(e.style),d=`border${n}Width`,g=`border${n}Style`,s=`border${n}Color`;return r[d]=chunk4Q2IP5FW_js.p(Math.max(1,i)),r[g]=a,r[s]=o,r}function T(e,n){return !e||e.pattern==="clear"||e.pattern==="nil"?"":e.fill?e.fill.auto||e.fill.rgb==="auto"||e.fill.rgb==="FFFFFF"?"":chunkMJ5FQX7Q_js.d(e.fill,n):e.pattern==="solid"&&e.color?chunkMJ5FQX7Q_js.d(e.color,n):e.pattern&&e.pattern.startsWith("pct")&&e.color?chunkMJ5FQX7Q_js.d(e.color,n):""}function z(e){switch(e){case "double":return "double";case "dotted":case "dottedHeavy":return "dotted";case "dash":case "dashedHeavy":case "dashLong":case "dashLongHeavy":case "dotDash":case "dashDotHeavy":case "dotDotDash":case "dashDotDotHeavy":return "dashed";case "wave":case "wavyHeavy":case "wavyDouble":return "wavy";default:return "solid"}}function j(e){switch(e){case "center":return "center";case "right":return "right";case "both":case "distribute":return "justify";default:return "left"}}function $(e){switch(e){case "none":case "nil":return "none";case "double":case "triple":return "double";case "dotted":return "dotted";case "dashed":case "dashSmallGap":return "dashed";case "threeDEmboss":return "ridge";case "threeDEngrave":return "groove";case "outset":return "outset";case "inset":return "inset";default:return "solid"}}function oe(...e){let n={};for(let t of e)t&&Object.assign(n,t);return n}function se(e,n){if(!e)return {};let t={};if(e.verticalAlign&&(t.verticalAlign=e.verticalAlign),e.textDirection&&(e.textDirection.includes("rl")||e.textDirection.includes("Rl"))&&(t.direction="rtl"),e.shading){let r=T(e.shading,n);r&&(t.backgroundColor=r);}return e.borders&&(e.borders.top&&Object.assign(t,h(e.borders.top,"Top",n)),e.borders.bottom&&Object.assign(t,h(e.borders.bottom,"Bottom",n)),e.borders.left&&Object.assign(t,h(e.borders.left,"Left",n)),e.borders.right&&Object.assign(t,h(e.borders.right,"Right",n))),e.margins&&(e.margins.top?.value&&(t.paddingTop=chunk4Q2IP5FW_js.p(chunk4Q2IP5FW_js.c(e.margins.top.value))),e.margins.bottom?.value&&(t.paddingBottom=chunk4Q2IP5FW_js.p(chunk4Q2IP5FW_js.c(e.margins.bottom.value))),e.margins.left?.value&&(t.paddingLeft=chunk4Q2IP5FW_js.p(chunk4Q2IP5FW_js.c(e.margins.left.value))),e.margins.right?.value&&(t.paddingRight=chunk4Q2IP5FW_js.p(chunk4Q2IP5FW_js.c(e.margins.right.value)))),t}function ae(e,n){if(!e)return {};let t={};if(e.pageWidth&&(t.width=chunk4Q2IP5FW_js.p(chunk4Q2IP5FW_js.c(e.pageWidth))),e.pageHeight&&(t.minHeight=chunk4Q2IP5FW_js.p(chunk4Q2IP5FW_js.c(e.pageHeight))),e.marginTop&&(t.paddingTop=chunk4Q2IP5FW_js.p(chunk4Q2IP5FW_js.c(e.marginTop))),e.marginBottom&&(t.paddingBottom=chunk4Q2IP5FW_js.p(chunk4Q2IP5FW_js.c(e.marginBottom))),e.marginLeft&&(t.paddingLeft=chunk4Q2IP5FW_js.p(chunk4Q2IP5FW_js.c(e.marginLeft))),e.marginRight&&(t.paddingRight=chunk4Q2IP5FW_js.p(chunk4Q2IP5FW_js.c(e.marginRight))),e.background?.color){let r=chunkMJ5FQX7Q_js.a(e.background.color,n);r&&(t.backgroundColor=r);}return t}var ue="application/x-docx-editor",f={HTML:"text/html",PLAIN:"text/plain"};function pe(e){if(!e)return [];let n=()=>{if(!e.items||e.items.length===0)return [];let s=[];for(let l of Array.from(e.items)){if(l.kind!=="file"||!l.type.startsWith("image/"))continue;let c=l.getAsFile();c&&s.push(c);}return s},t=()=>!e.files||e.files.length===0?[]:Array.from(e.files).filter(s=>s.type.startsWith("image/")),r=n(),i=r.length?r:t();if(i.length<=1)return i;let o=["image/png","image/jpeg","image/webp","image/gif","image/svg+xml","image/bmp","image/tiff"],a=s=>{let l=s[0],c=o.indexOf(l.type);c<0&&(c=Number.MAX_SAFE_INTEGER);for(let y of s.slice(1)){let b=o.indexOf(y.type);if(b<0&&(b=Number.MAX_SAFE_INTEGER),b<c){l=y,c=b;continue}b===c&&y.size>l.size&&(l=y);}return l},d=new Map;for(let s of i){let l=s.name?.trim()??"",y=(l?l.replace(/\.[^/.]+$/,"").toLowerCase():"")||`size:${s.size}`,b=d.get(y);b?b.push(s):d.set(y,[s]);}let g=[];for(let s of d.values())g.push(a(s));return g}async function N(e,n={}){let{includeFormatting:t=true,onError:r,theme:i}=n;try{let o=v(e,t,i);return await S(o)}catch(o){return r?.(o),false}}async function de(e,n={}){let{includeFormatting:t=true,onError:r,theme:i}=n;try{let o=K(e,t,i);return await S(o)}catch(o){return r?.(o),false}}function v(e,n=true,t){let r=e.map(P).join(""),i=n?W(e,t):w(r),o=JSON.stringify(e);return {plainText:r,html:i,internal:o}}function K(e,n=true,t){let r=e.map(V).join(`
|
|
2
|
+
`),i=n?Q(e,t):w(r),o=JSON.stringify(e);return {plainText:r,html:i,internal:o}}async function S(e){try{if(navigator.clipboard&&navigator.clipboard.write){let n=[new ClipboardItem({[f.PLAIN]:new Blob([e.plainText],{type:f.PLAIN}),[f.HTML]:new Blob([e.html],{type:f.HTML})})];return await navigator.clipboard.write(n),!0}return B(e)}catch{return B(e)}}function B(e){let n=document.createElement("div");n.innerHTML=e.html,n.style.position="fixed",n.style.left="-9999px",document.body.appendChild(n);try{let t=window.getSelection();if(!t)return !1;let r=document.createRange();r.selectNodeContents(n),t.removeAllRanges(),t.addRange(r);let i=document.execCommand("copy");return t.removeAllRanges(),i}finally{document.body.removeChild(n);}}async function fe(e={}){let{cleanWordFormatting:n=true,onError:t}=e;try{if(navigator.clipboard&&navigator.clipboard.read){let r=await navigator.clipboard.read();return await G(r,n)}return null}catch(r){return t?.(r),null}}async function G(e,n){let t="",r="";for(let i of e)i.types.includes(f.HTML)&&(t=await(await i.getType(f.HTML)).text()),i.types.includes(f.PLAIN)&&(r=await(await i.getType(f.PLAIN)).text());return O(t,r,n)}function _(e,n={}){let{cleanWordFormatting:t=true}=n,r=e.clipboardData;if(!r)return null;let i=r.getData(f.HTML),o=r.getData(f.PLAIN);return O(i,o,t)}function O(e,n,t=true){let r=U(e),i=X(e);if(i){let d=e.match(/data-docx-editor-content="([^"]+)"/);if(d)try{return {runs:JSON.parse(decodeURIComponent(d[1])),fromWord:!1,fromEditor:!0,plainText:n}}catch{}}let o=e;return r&&t&&(o=J(e)),{runs:Y(o,n),fromWord:r,fromEditor:i,plainText:n}}function U(e){return e.includes("urn:schemas-microsoft-com:office")||e.includes("mso-")||e.includes("MsoNormal")||e.includes('class="Mso')||e.includes("<!--[if gte mso")}function X(e){return e.includes("data-docx-editor")||e.includes("docx-run")||e.includes("docx-paragraph")}function J(e){let n=e;return n=n.replace(/<!--\[if[\s\S]*?<!\[endif\]-->/gi,""),n=n.replace(/<!--[\s\S]*?-->/g,""),n=n.replace(/<\?xml[^>]*>/gi,""),n=n.replace(/<o:[^>]*>[\s\S]*?<\/o:[^>]*>/gi,""),n=n.replace(/<o:[^>]*\/>/gi,""),n=n.replace(/<w:[^>]*>[\s\S]*?<\/w:[^>]*>/gi,""),n=n.replace(/<w:[^>]*\/>/gi,""),n=n.replace(/\s*mso-[^:;]+:[^;]+;?/gi,""),n=n.replace(/\s*style="\s*"/gi,""),n=n.replace(/\s*class="[^"]*Mso[^"]*"/gi,""),n=n.replace(/<span[^>]*>\s*<\/span>/gi,""),n=n.replace(/<\/?font[^>]*>/gi,""),n=n.replace(/\s+/g," ").trim(),n}function Y(e,n){if(!e||e.trim()==="")return n?[F(n)]:[];let t=document.createElement("div");t.innerHTML=e;let r=[];return k(t,r,{}),r.length===0&&n?[F(n)]:r}function k(e,n,t){if(e.nodeType===Node.TEXT_NODE){let a=e.textContent||"";(a.trim()||a.includes(" "))&&n.push(F(a,t));return}if(e.nodeType!==Node.ELEMENT_NODE)return;let r=e,i=r.tagName.toLowerCase(),o={...t,...q(r)};switch(i){case "br":n.push(M(o));return;case "p":case "div":for(let a of r.childNodes)k(a,n,o);r.nextSibling&&n.push(M(o));return;case "b":case "strong":o.bold=true;break;case "i":case "em":o.italic=true;break;case "u":o.underline={style:"single"};break;case "s":case "strike":case "del":o.strike=true;break;case "sup":o.vertAlign="superscript";break;case "sub":o.vertAlign="subscript";break;case "code":case "pre":o.fontFamily={ascii:"Courier New"};break}for(let a of r.childNodes)k(a,n,o);}function q(e){let n={},t=e.style;(t.fontWeight==="bold"||parseInt(t.fontWeight)>=700)&&(n.bold=true),t.fontStyle==="italic"&&(n.italic=true);let r=t.textDecoration||t.textDecorationLine;if(r&&(r.includes("underline")&&(n.underline={style:"single"}),r.includes("line-through")&&(n.strike=true)),t.fontSize){let i=parseFloat(t.fontSize);isNaN(i)||(n.fontSize=Math.round(i/1.333*2));}if(t.fontFamily){let i=t.fontFamily.replace(/["']/g,"").split(",")[0].trim();i&&(n.fontFamily={ascii:i});}if(t.color){let i=I(t.color);i&&(n.color={rgb:i});}if(t.backgroundColor&&t.backgroundColor!=="transparent"){let i=I(t.backgroundColor);i&&(n.shading={fill:{rgb:i}});}return n}function I(e){if(!e||e==="transparent"||e==="inherit")return null;if(e.startsWith("#"))return e.slice(1).toUpperCase();let n=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(n){let t=parseInt(n[1]).toString(16).padStart(2,"0"),r=parseInt(n[2]).toString(16).padStart(2,"0"),i=parseInt(n[3]).toString(16).padStart(2,"0");return (t+r+i).toUpperCase()}return null}function P(e){return e.content.map(n=>n.type==="text"?n.text:n.type==="tab"?" ":n.type==="break"&&n.breakType==="textWrapping"?`
|
|
3
|
+
`:"").join("")}function V(e){return (e.content||[]).map(n=>n.type==="run"?P(n):"").join("")}function W(e,n){return e.map(t=>Z(t,n)).join("")}function Q(e,n){return e.map(t=>`<p>${W(t.content?.filter(r=>r.type==="run")||[],n)}</p>`).join("")}function Z(e,n){let t=P(e);if(!t)return "";let r=w(t),i=e.formatting;if(!i)return r;i.bold&&(r=`<strong>${r}</strong>`),i.italic&&(r=`<em>${r}</em>`),i.underline&&(r=`<u>${r}</u>`),i.strike&&(r=`<s>${r}</s>`),i.vertAlign==="superscript"&&(r=`<sup>${r}</sup>`),i.vertAlign==="subscript"&&(r=`<sub>${r}</sub>`);let o=[];if(i.fontSize){let g=i.fontSize/2;o.push(`font-size: ${g}pt`);}i.fontFamily?.ascii&&o.push(`font-family: "${i.fontFamily.ascii}"`);let a=chunkMJ5FQX7Q_js.b(i.color,n);a&&o.push(`color: #${a}`);let d=chunkMJ5FQX7Q_js.b(i.shading?.fill,n);return d&&o.push(`background-color: #${d}`),o.length>0&&(r=`<span style="${o.join("; ")}">${r}</span>`),r}function w(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function F(e,n){return {type:"run",formatting:n,content:[{type:"text",text:e}]}}function M(e){return {type:"run",formatting:e,content:[{type:"break",breakType:"textWrapping"}]}}function ge(e){let{onCopy:n,onCut:t,onPaste:r,clipboardOptions:i={}}=e;return {handleCopy:async s=>{if(!n)return;let l=n();if(!l)return;s.preventDefault();let c=v(l.runs);s.clipboardData?(s.clipboardData.setData(f.PLAIN,c.plainText),s.clipboardData.setData(f.HTML,c.html)):await S(c);},handleCut:async s=>{if(!t)return;let l=t();if(!l)return;s.preventDefault();let c=v(l.runs);s.clipboardData?(s.clipboardData.setData(f.PLAIN,c.plainText),s.clipboardData.setData(f.HTML,c.html)):await S(c);},handlePaste:s=>{if(!r)return;s.preventDefault();let l=_(s,i);l&&r(l);},handleKeyDown:async s=>{let l=s.ctrlKey||s.metaKey;if(l&&s.key==="c"&&!s.shiftKey&&n){let c=n();c&&await N(c.runs,i);}if(l&&s.key==="x"&&!s.shiftKey&&t){let c=t();c&&await N(c.runs,i);}}}}exports.a=re;exports.b=ie;exports.c=h;exports.d=T;exports.e=oe;exports.f=se;exports.g=ae;exports.h=ue;exports.i=f;exports.j=pe;exports.k=N;exports.l=de;exports.m=v;exports.n=K;exports.o=S;exports.p=fe;exports.q=_;exports.r=O;exports.s=U;exports.t=X;exports.u=J;exports.v=Y;exports.w=ge;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {c,e,j}from'./chunk-WLHNIXWC.mjs';var l=720,s=31680;function p(e$1){let n=e$1?c(e$1):null,o=n?e(n,"w","defaultTabStop"):null,t=o?parseInt(j(o,"w","val")??"",10):NaN;return {defaultTabStop:Number.isFinite(t)&&t>0&&t<=s?t:l}}export{l as a,p as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';function t(){return Math.floor(Math.random()*2147483647).toString(16).toUpperCase().padStart(8,"0")}exports.a=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import p from'pizzip';import l from'docxtemplater';function T(e,r,t={}){return b(e,r,t).buffer}function b(e,r,t={}){let{nullGetter:n="keep",linebreaks:s=true,delimiters:o}=t,a=[],i=[],g=[];try{let d=new p(e),m=new l(d,{paragraphLoop:!0,linebreaks:s,nullGetter:c=>{let f=c.value||"";if(n==="error")throw new Error(`Undefined variable: ${f}`);return n==="empty"?(g.push(f),""):(g.push(f),`{${f}}`)},delimiters:o?{start:o.start||"{",end:o.end||"}"}:void 0});return Object.keys(r).forEach(c=>{r[c]!==void 0&&r[c]!==null&&i.push(c);}),m.setData(r),m.render(),{buffer:m.getZip().generate({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:6}}),replacedVariables:i,unreplacedVariables:g,warnings:a}}catch(d){throw u(d)}}function x(e,r,t={}){let n=T(e,r,t);return new Blob([n],{type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"})}function k(e,r,t="document",n={}){let s=x(e,r,n);E(s,`${t}.docx`);}function R(e){try{let r=new p(e),n=new l(r,{paragraphLoop:!0,linebreaks:!0}).getFullText();return y(n)}catch(r){throw u(r)}}function D(e){let r=[],t=[];try{let n=new p(e),o=new l(n,{paragraphLoop:!0,linebreaks:!0}).getFullText();t=y(o);let a=h(o);for(let i of a)r.push({message:`Unclosed tag: ${i}`,variable:i,type:"parse"});return {valid:r.length===0,errors:r,tags:t}}catch(n){return r.push(u(n)),{valid:false,errors:r,tags:t}}}function L(e,r){return e.filter(t=>!(t in r)||r[t]===void 0||r[t]===null)}function O(e,r){try{let t=new p(e),n=new l(t,{paragraphLoop:!0,linebreaks:!0,nullGetter:s=>`[${s.value||""}]`});return n.setData(r),n.render(),n.getFullText()}catch(t){throw u(t)}}function y(e){let r=[],t=/\{([^{}]+)\}/g,n;for(;(n=t.exec(e))!==null;){let s=n[1].trim();s&&!r.includes(s)&&r.push(s);}return r.sort()}function h(e){let r=[],t=0,n="";for(let s of e)s==="{"?(t++,n=""):s==="}"?(t--,t<0&&(t=0)):t>0&&(n+=s);return t>0&&n.trim()&&r.push(n.trim()),r}function w(e){return "properties"in e&&typeof e.properties=="object"}function u(e){if(e instanceof Error){if(w(e)&&e.properties?.errors){let r=e.properties.errors[0];return {message:r?.message||"Template processing error",variable:r?.properties?.tag,type:"render",originalError:e}}if(e.message.includes("undefined")){let r=e.message.match(/undefined (?:variable|tag):\s*(\S+)/i);return {message:e.message,variable:r?r[1]:void 0,type:"undefined",originalError:e}}return e.message.includes("parse")||e.message.includes("unclosed")||e.message.includes("syntax")?{message:e.message,type:"parse",originalError:e}:{message:e.message,type:"unknown",originalError:e}}return {message:String(e),type:"unknown"}}function E(e,r){let t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=r,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t);}function P(e,r,t={}){let{linebreaks:n=true,delimiters:s}=t;try{let o=new p(e),a=new l(o,{paragraphLoop:!0,linebreaks:n,delimiters:s?{start:s.start||"{",end:s.end||"}"}:void 0});return a.setData(r),a.render(),a.getZip().generate({type:"arraybuffer",compression:"DEFLATE"})}catch(o){throw u(o)}}function U(e={}){return (r,t)=>T(r,t,e)}var z=T;export{T as a,b,x as c,k as d,R as e,D as f,L as g,O as h,P as i,U as j,z as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function i(){return [{styleId:"Normal",type:"paragraph",name:"Normal",default:true,qFormat:true,uiPriority:0,rPr:{fontSize:22,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{lineSpacing:276}},{styleId:"Title",type:"paragraph",name:"Title",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:10,rPr:{fontSize:52,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{lineSpacing:240}},{styleId:"Subtitle",type:"paragraph",name:"Subtitle",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:11,rPr:{fontSize:30,color:{rgb:"666666"},fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{lineSpacing:240}},{styleId:"Heading1",type:"paragraph",name:"Heading 1",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:9,rPr:{fontSize:40,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{spaceBefore:400,spaceAfter:120,lineSpacing:240}},{styleId:"Heading2",type:"paragraph",name:"Heading 2",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:9,rPr:{fontSize:32,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{spaceBefore:360,spaceAfter:80,lineSpacing:240}},{styleId:"Heading3",type:"paragraph",name:"Heading 3",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:9,rPr:{fontSize:28,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{spaceBefore:320,spaceAfter:80,lineSpacing:240}},{styleId:"Heading4",type:"paragraph",name:"Heading 4",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:9,rPr:{fontSize:24,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{spaceBefore:280,spaceAfter:80,lineSpacing:240}}]}function r(){return {pageWidth:12240,pageHeight:15840,orientation:"portrait",marginTop:1440,marginBottom:1440,marginLeft:1440,marginRight:1440,headerDistance:720,footerDistance:720,gutter:0,columnCount:1,columnSpace:720,equalWidth:true,sectionStart:"nextPage",verticalAlign:"top"}}function n(e={}){let t=r();e.pageWidth!==void 0&&(t.pageWidth=Math.round(e.pageWidth)),e.pageHeight!==void 0&&(t.pageHeight=Math.round(e.pageHeight)),e.orientation!==void 0&&(t.orientation=e.orientation),e.marginTop!==void 0&&(t.marginTop=Math.round(e.marginTop)),e.marginBottom!==void 0&&(t.marginBottom=Math.round(e.marginBottom)),e.marginLeft!==void 0&&(t.marginLeft=Math.round(e.marginLeft)),e.marginRight!==void 0&&(t.marginRight=Math.round(e.marginRight));let a={type:"text",text:e.initialText||""};return {package:{document:{content:[{type:"paragraph",content:[{type:"run",content:e.initialText?[a]:[],formatting:{fontSize:22,fontFamily:{ascii:"Arial",hAnsi:"Arial"}}}],formatting:{lineSpacing:276}}],finalSectionProperties:t},styles:{docDefaults:{rPr:{fontSize:22,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{lineSpacing:276}},styles:i()}},templateVariables:[],warnings:[]}}function p(e,t={}){return n({...t,initialText:e})}export{n as a,p as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a,r,s as s$1,t,u,q,B,D,O,N,C,b as b$2}from'./chunk-RFC2SXZ6.mjs';import {b as b$1}from'./chunk-BOOHU5EW.mjs';import {s,o}from'./chunk-7LRR7RKE.mjs';import {a as a$3}from'./chunk-ILJUDEZ5.mjs';import {b,a as a$1}from'./chunk-OEXVWIHW.mjs';import {c,f,j,e,m,l,a as a$2,i}from'./chunk-WLHNIXWC.mjs';import Ve from'jszip';async function G(e){let n=await Ve.loadAsync(e),t={documentXml:null,stylesXml:null,themeXml:null,numberingXml:null,fontTableXml:null,settingsXml:null,webSettingsXml:null,headers:new Map,footers:new Map,footnotesXml:null,endnotesXml:null,commentsXml:null,commentsExtensibleXml:null,commentsExtendedXml:null,documentRels:null,packageRels:null,contentTypesXml:null,corePropsXml:null,appPropsXml:null,customPropsXml:null,media:new Map,fonts:new Map,allXml:new Map,originalZip:n,originalBuffer:e};for(let[o,s]of Object.entries(n.files)){if(s.dir)continue;let r=o.toLowerCase();if(r.endsWith(".xml")||r.endsWith(".rels")){let a=await s.async("text");if(t.allXml.set(o,a),r==="word/document.xml")t.documentXml=a;else if(r==="word/styles.xml")t.stylesXml=a;else if(r==="word/theme/theme1.xml")t.themeXml=a;else if(r==="word/numbering.xml")t.numberingXml=a;else if(r==="word/fonttable.xml")t.fontTableXml=a;else if(r==="word/settings.xml")t.settingsXml=a;else if(r==="word/websettings.xml")t.webSettingsXml=a;else if(r==="word/footnotes.xml")t.footnotesXml=a;else if(r==="word/endnotes.xml")t.endnotesXml=a;else if(r==="word/comments.xml")t.commentsXml=a;else if(r==="word/commentsextensible.xml")t.commentsExtensibleXml=a;else if(r==="word/commentsextended.xml")t.commentsExtendedXml=a;else if(r==="word/_rels/document.xml.rels")t.documentRels=a;else if(r==="_rels/.rels")t.packageRels=a;else if(r==="[content_types].xml")t.contentTypesXml=a;else if(r==="docprops/core.xml")t.corePropsXml=a;else if(r==="docprops/app.xml")t.appPropsXml=a;else if(r==="docprops/custom.xml")t.customPropsXml=a;else if(r.match(/^word\/header\d+\.xml$/)){let c=o.split("/").pop()||o;t.headers.set(c,a);}else if(r.match(/^word\/footer\d+\.xml$/)){let c=o.split("/").pop()||o;t.footers.set(c,a);}}else if(r.startsWith("word/media/")){let a=await s.async("arraybuffer");t.media.set(o,a);}else if(r.startsWith("word/fonts/")){let a=await s.async("arraybuffer");t.fonts.set(o,a);}}return t}function Ce(e){switch(e.toLowerCase().split(".").pop()){case "png":return "image/png";case "jpg":case "jpeg":return "image/jpeg";case "gif":return "image/gif";case "bmp":return "image/bmp";case "tif":case "tiff":return "image/tiff";case "wmf":return "image/x-wmf";case "emf":return "image/x-emf";case "svg":return "image/svg+xml";case "webp":return "image/webp";default:return "application/octet-stream"}}function Y(e,n,t,o){let s={};return e&&e!=="auto"?s.rgb=e:e==="auto"&&(s.auto=true),n&&(s.themeColor=n),t&&(s.themeTint=t),o&&(s.themeShade=o),s}function $(e){if(!e)return;let n={},t=j(e,"w","color");t&&t!=="auto"&&(n.color={rgb:t});let o=j(e,"w","fill");o&&o!=="auto"&&(n.fill={rgb:o});let s=j(e,"w","themeFill");s&&(n.fill=n.fill||{},n.fill.themeColor=s);let r=j(e,"w","themeFillTint");r&&n.fill&&(n.fill.themeTint=r);let a=j(e,"w","themeFillShade");a&&n.fill&&(n.fill.themeShade=a);let c=j(e,"w","val");return c&&(n.pattern=c),Object.keys(n).length>0?n:void 0}function Z(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","b");o&&(t.bold=m(o));let s=e(e$1,"w","bCs");s&&(t.boldCs=m(s));let r=e(e$1,"w","i");r&&(t.italic=m(r));let a=e(e$1,"w","iCs");a&&(t.italicCs=m(a));let c=e(e$1,"w","u");if(c){let g=j(c,"w","val");if(g){t.underline={style:g};let k=j(c,"w","color"),j$1=j(c,"w","themeColor");(k||j$1)&&(t.underline.color=Y(k,j$1,j(c,"w","themeTint"),j(c,"w","themeShade")));}}let d=e(e$1,"w","strike");d&&(t.strike=m(d));let u=e(e$1,"w","dstrike");u&&(t.doubleStrike=m(u));let m$1=e(e$1,"w","vertAlign");if(m$1){let g=j(m$1,"w","val");(g==="superscript"||g==="subscript"||g==="baseline")&&(t.vertAlign=g);}let h=e(e$1,"w","smallCaps");h&&(t.smallCaps=m(h));let p=e(e$1,"w","caps");p&&(t.allCaps=m(p));let x=e(e$1,"w","vanish");x&&(t.hidden=m(x));let f=e(e$1,"w","color");f&&(t.color=Y(j(f,"w","val"),j(f,"w","themeColor"),j(f,"w","themeTint"),j(f,"w","themeShade")));let b=e(e$1,"w","highlight");if(b){let g=j(b,"w","val");g&&(t.highlight=g);}let T=e(e$1,"w","shd");T&&(t.shading=$(T));let M=e(e$1,"w","sz");if(M){let g=l(M,"w","val");g!==void 0&&(t.fontSize=g);}let X=e(e$1,"w","szCs");if(X){let g=l(X,"w","val");g!==void 0&&(t.fontSizeCs=g);}let P=e(e$1,"w","rFonts");if(P){t.fontFamily={ascii:j(P,"w","ascii")??void 0,hAnsi:j(P,"w","hAnsi")??void 0,eastAsia:j(P,"w","eastAsia")??void 0,cs:j(P,"w","cs")??void 0};let g=j(P,"w","asciiTheme");g&&(t.fontFamily.asciiTheme=g,n&&!t.fontFamily.ascii&&(t.fontFamily.ascii=b$2(n,g)));let k=j(P,"w","hAnsiTheme");k&&(t.fontFamily.hAnsiTheme=k,n&&!t.fontFamily.hAnsi&&(t.fontFamily.hAnsi=b$2(n,k)));let j$1=j(P,"w","eastAsiaTheme");j$1&&(t.fontFamily.eastAsiaTheme=j$1,n&&!t.fontFamily.eastAsia&&(t.fontFamily.eastAsia=b$2(n,j$1)));let B=j(P,"w","cstheme");B&&(t.fontFamily.csTheme=B,n&&!t.fontFamily.cs&&(t.fontFamily.cs=b$2(n,B)));}let F=e(e$1,"w","spacing");if(F){let g=l(F,"w","val");g!==void 0&&(t.spacing=g);}let y=e(e$1,"w","position");if(y){let g=l(y,"w","val");g!==void 0&&(t.position=g);}let S=e(e$1,"w","w");if(S){let g=l(S,"w","val");g!==void 0&&(t.scale=g);}let C=e(e$1,"w","kern");if(C){let g=l(C,"w","val");g!==void 0&&(t.kerning=g);}let D=e(e$1,"w","effect");if(D){let g=j(D,"w","val");g&&(t.effect=g);}let I=e(e$1,"w","em");if(I){let g=j(I,"w","val");g&&(t.emphasisMark=g);}let N=e(e$1,"w","emboss");N&&(t.emboss=m(N));let L=e(e$1,"w","imprint");L&&(t.imprint=m(L));let O=e(e$1,"w","outline");O&&(t.outline=m(O));let W=e(e$1,"w","shadow");W&&(t.shadow=m(W));let H=e(e$1,"w","rtl");H&&(t.rtl=m(H));let R=e(e$1,"w","cs");R&&(t.cs=m(R));let A=e(e$1,"w","rStyle");if(A){let g=j(A,"w","val");g&&(t.styleId=g);}return Object.keys(t).length>0?t:void 0}function E(e){if(!e)return;let n=j(e,"w","val");if(!n)return;let t={style:n},o=j(e,"w","color"),s=j(e,"w","themeColor");(o||s)&&(t.color=Y(o,s,j(e,"w","themeTint"),j(e,"w","themeShade")));let r=l(e,"w","sz");r!==void 0&&(t.size=r);let a=l(e,"w","space");a!==void 0&&(t.space=a);let c=j(e,"w","shadow");c&&(t.shadow=c==="1"||c==="true");let d=j(e,"w","frame");return d&&(t.frame=d==="1"||d==="true"),t}function je(e){if(!e)return;let n=f(e,"w","tab");if(n.length===0)return;let t=[];for(let o of n){let s=l(o,"w","pos"),r=j(o,"w","val");if(s!==void 0&&r){let a={position:s,alignment:r},c=j(o,"w","leader");c&&(a.leader=c),t.push(a);}}return t.length>0?t:void 0}function K(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","jc");if(o){let y=j(o,"w","val");y&&(t.alignment=y);}let s=e(e$1,"w","bidi");s&&(t.bidi=m(s));let r=e(e$1,"w","spacing");if(r){let y=l(r,"w","before");y!==void 0&&(t.spaceBefore=y);let S=l(r,"w","after");S!==void 0&&(t.spaceAfter=S);let C=l(r,"w","line");C!==void 0&&(t.lineSpacing=C);let D=j(r,"w","lineRule");D&&(t.lineSpacingRule=D);let I=j(r,"w","beforeAutospacing");I&&(t.beforeAutospacing=I==="1"||I==="true");let N=j(r,"w","afterAutospacing");N&&(t.afterAutospacing=N==="1"||N==="true");}let a=e(e$1,"w","ind");if(a){let y=l(a,"w","left");y!==void 0&&(t.indentLeft=y);let S=l(a,"w","right");S!==void 0&&(t.indentRight=S);let C=l(a,"w","firstLine");C!==void 0&&(t.indentFirstLine=C);let D=l(a,"w","hanging");D!==void 0&&(t.indentFirstLine=-D,t.hangingIndent=true);}let c=e(e$1,"w","pBdr");if(c){let y={},S=E(e(c,"w","top"));S&&(y.top=S);let C=E(e(c,"w","bottom"));C&&(y.bottom=C);let D=E(e(c,"w","left"));D&&(y.left=D);let I=E(e(c,"w","right"));I&&(y.right=I);let N=E(e(c,"w","between"));N&&(y.between=N);let L=E(e(c,"w","bar"));L&&(y.bar=L),Object.keys(y).length>0&&(t.borders=y);}let d=e(e$1,"w","shd");d&&(t.shading=$(d));let u=e(e$1,"w","tabs");u&&(t.tabs=je(u));let m$1=e(e$1,"w","keepNext");m$1&&(t.keepNext=m(m$1));let h=e(e$1,"w","keepLines");h&&(t.keepLines=m(h));let p=e(e$1,"w","widowControl");p&&(t.widowControl=m(p));let x=e(e$1,"w","pageBreakBefore");x&&(t.pageBreakBefore=m(x));let f=e(e$1,"w","contextualSpacing");f&&(t.contextualSpacing=m(f));let b=e(e$1,"w","numPr");if(b){let y=e(b,"w","numId"),S=e(b,"w","ilvl");if(y||S){if(t.numPr={},y){let C=l(y,"w","val");C!==void 0&&(t.numPr.numId=C);}if(S){let C=l(S,"w","val");C!==void 0&&(t.numPr.ilvl=C);}}}let T=e(e$1,"w","outlineLvl");if(T){let y=l(T,"w","val");y!==void 0&&(t.outlineLevel=y);}let M=e(e$1,"w","pStyle");if(M){let y=j(M,"w","val");y&&(t.styleId=y);}let X=e(e$1,"w","suppressLineNumbers");X&&(t.suppressLineNumbers=m(X));let P=e(e$1,"w","suppressAutoHyphens");P&&(t.suppressAutoHyphens=m(P));let F=e(e$1,"w","rPr");return F&&(t.runProperties=Z(F,n)),Object.keys(t).length>0?t:void 0}function U(e){if(!e)return;let n=l(e,"w","w"),t=j(e,"w","type");if(n!==void 0&&t)return {value:n,type:t}}function Pe(e$1){if(!e$1)return;let n={},t=E(e(e$1,"w","top"));t&&(n.top=t);let o=E(e(e$1,"w","bottom"));o&&(n.bottom=o);let s=E(e(e$1,"w","left"));s&&(n.left=s);let r=E(e(e$1,"w","right"));r&&(n.right=r);let a=E(e(e$1,"w","insideH"));a&&(n.insideH=a);let c=E(e(e$1,"w","insideV"));return c&&(n.insideV=c),Object.keys(n).length>0?n:void 0}function Fe(e$1){if(!e$1)return;let n={},t=U(e(e$1,"w","top"));t&&(n.top=t);let o=U(e(e$1,"w","bottom"));o&&(n.bottom=o);let s=U(e(e$1,"w","left"));s&&(n.left=s);let r=U(e(e$1,"w","right"));return r&&(n.right=r),Object.keys(n).length>0?n:void 0}function Oe(e){if(!e)return;let n={},t=j(e,"w","val");if(t){let u=parseInt(t,16);isNaN(u)||(n.firstRow=(u&32)!==0,n.lastRow=(u&64)!==0,n.firstColumn=(u&128)!==0,n.lastColumn=(u&256)!==0,n.noHBand=(u&512)!==0,n.noVBand=(u&1024)!==0);}let o=j(e,"w","firstColumn");o&&(n.firstColumn=o==="1");let s=j(e,"w","firstRow");s&&(n.firstRow=s==="1");let r=j(e,"w","lastColumn");r&&(n.lastColumn=r==="1");let a=j(e,"w","lastRow");a&&(n.lastRow=a==="1");let c=j(e,"w","noHBand");c&&(n.noHBand=c==="1");let d=j(e,"w","noVBand");return d&&(n.noVBand=d==="1"),Object.keys(n).length>0?n:void 0}function se(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","tblW");o&&(t.width=U(o));let s=e(e$1,"w","jc");if(s){let f=j(s,"w","val");(f==="left"||f==="center"||f==="right")&&(t.justification=f);}let r=e(e$1,"w","tblCellSpacing");r&&(t.cellSpacing=U(r));let a=e(e$1,"w","tblInd");a&&(t.indent=U(a));let c=e(e$1,"w","tblBorders");c&&(t.borders=Pe(c));let d=e(e$1,"w","tblCellMar");d&&(t.cellMargins=Fe(d));let u=e(e$1,"w","tblLayout");if(u){let f=j(u,"w","type");(f==="fixed"||f==="autofit")&&(t.layout=f);}let m$1=e(e$1,"w","tblStyle");if(m$1){let f=j(m$1,"w","val");f&&(t.styleId=f);}let h=e(e$1,"w","tblLook");h&&(t.look=Oe(h));let p=e(e$1,"w","shd");p&&(t.shading=$(p));let x=e(e$1,"w","bidiVisual");return x&&(t.bidi=m(x)),Object.keys(t).length>0?t:void 0}function ae(e$1){if(!e$1)return;let n={},t=e(e$1,"w","trHeight");if(t){n.height=U(t);let c=j(t,"w","hRule");c&&(n.heightRule=c);}let o=e(e$1,"w","tblHeader");o&&(n.header=m(o));let s=e(e$1,"w","cantSplit");s&&(n.cantSplit=m(s));let r=e(e$1,"w","jc");if(r){let c=j(r,"w","val");(c==="left"||c==="center"||c==="right")&&(n.justification=c);}let a=e(e$1,"w","hidden");return a&&(n.hidden=m(a)),Object.keys(n).length>0?n:void 0}function le(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","tcW");o&&(t.width=U(o));let s=e(e$1,"w","tcBorders");s&&(t.borders=Pe(s));let r=e(e$1,"w","tcMar");r&&(t.margins=Fe(r));let a=e(e$1,"w","shd");a&&(t.shading=$(a));let c=e(e$1,"w","vAlign");if(c){let f=j(c,"w","val");(f==="top"||f==="center"||f==="bottom")&&(t.verticalAlign=f);}let d=e(e$1,"w","textDirection");if(d){let f=j(d,"w","val");f&&(t.textDirection=f);}let u=e(e$1,"w","gridSpan");if(u){let f=l(u,"w","val");f!==void 0&&(t.gridSpan=f);}let m$1=e(e$1,"w","vMerge");if(m$1){let f=j(m$1,"w","val");t.vMerge=f==="restart"?"restart":"continue";}let h=e(e$1,"w","tcFitText");h&&(t.fitText=m(h));let p=e(e$1,"w","noWrap");p&&(t.noWrap=m(p));let x=e(e$1,"w","hideMark");return x&&(t.hideMark=m(x)),Object.keys(t).length>0?t:void 0}function He(e$1,n){let t={styleId:j(e$1,"w","styleId")??"",type:j(e$1,"w","type")??"paragraph"},o=j(e$1,"w","default");o&&(t.default=o==="1"||o==="true");let s=e(e$1,"w","name");s&&(t.name=j(s,"w","val")??void 0);let r=e(e$1,"w","basedOn");r&&(t.basedOn=j(r,"w","val")??void 0);let a=e(e$1,"w","next");a&&(t.next=j(a,"w","val")??void 0);let c=e(e$1,"w","link");c&&(t.link=j(c,"w","val")??void 0);let d=e(e$1,"w","uiPriority");if(d){let F=l(d,"w","val");F!==void 0&&(t.uiPriority=F);}let u=e(e$1,"w","hidden");u&&(t.hidden=m(u));let m$1=e(e$1,"w","semiHidden");m$1&&(t.semiHidden=m(m$1));let h=e(e$1,"w","unhideWhenUsed");h&&(t.unhideWhenUsed=m(h));let p=e(e$1,"w","qFormat");p&&(t.qFormat=m(p));let x=e(e$1,"w","personal");x&&(t.personal=m(x));let f$1=e(e$1,"w","pPr");f$1&&(t.pPr=K(f$1,n));let b=e(e$1,"w","rPr");b&&(t.rPr=Z(b,n));let T=e(e$1,"w","tblPr");T&&(t.tblPr=se(T));let M=e(e$1,"w","trPr");M&&(t.trPr=ae(M));let X=e(e$1,"w","tcPr");X&&(t.tcPr=le(X));let P=f(e$1,"w","tblStylePr");if(P.length>0){t.tblStylePr=[];for(let F of P){let y=j(F,"w","type");if(y){let S={type:y},C=e(F,"w","pPr");C&&(S.pPr=K(C,n));let D=e(F,"w","rPr");D&&(S.rPr=Z(D,n));let I=e(F,"w","tblPr");I&&(S.tblPr=se(I));let N=e(F,"w","trPr");N&&(S.trPr=ae(N));let L=e(F,"w","tcPr");L&&(S.tcPr=le(L)),t.tblStylePr.push(S);}}}return t}function Ue(e$1,n){if(!e$1)return;let t={},o=e(e$1,"w","rPrDefault");if(o){let r=e(o,"w","rPr");r&&(t.rPr=Z(r,n));}let s=e(e$1,"w","pPrDefault");if(s){let r=e(s,"w","pPr");r&&(t.pPr=K(r,n));}return t.rPr||t.pPr?t:void 0}function We(e,n){if(!n)return e;if(!e)return n?{...n}:void 0;let t={...e};for(let o of Object.keys(n)){let s=n[o];if(s!==void 0)if(o==="runProperties")t.runProperties=a$3(t.runProperties,n.runProperties);else if(o==="borders"||o==="numPr"||o==="frame"){let r=t[o],a=s;t[o]={...r||{},...a||{}};}else o==="tabs"&&Array.isArray(s)?t.tabs=[...s]:t[o]=s;}return t}function Ne(e,n,t,o=new Set){if(o.has(e.styleId)||(o.add(e.styleId),!e.basedOn))return e;let s=n.get(e.basedOn);if(!s)return e;let r=Ne(s,n,t,o),a={...e,pPr:We(r.pPr,e.pPr),rPr:a$3(r.rPr,e.rPr)};return e.type==="table"&&((r.tblPr||e.tblPr)&&(a.tblPr={...r.tblPr||{},...e.tblPr||{}}),(r.trPr||e.trPr)&&(a.trPr={...r.trPr||{},...e.trPr||{}}),(r.tcPr||e.tcPr)&&(a.tcPr={...r.tcPr||{},...e.tcPr||{}})),a}function ce(e,n){let t=new Map;try{let o=c(e);if(!o)return t;let s=f(o,"w","style");for(let r of s){let a=He(r,n);a.styleId&&t.set(a.styleId,a);}for(let[r,a]of t){let c=Ne(a,t,n);t.set(r,c);}}catch(o){console.warn("Failed to parse styles:",o);}return t}function Me(e$1,n){let t={styles:[]};try{let o=c(e$1);if(!o)return t;let s=e(o,"w","docDefaults");t.docDefaults=Ue(s,n);let r=e(o,"w","latentStyles");r&&(t.latentStyles={defLockedState:j(r,"w","defLockedState")==="1",defUIPriority:l(r,"w","defUIPriority"),defSemiHidden:j(r,"w","defSemiHidden")==="1",defUnhideWhenUsed:j(r,"w","defUnhideWhenUsed")==="1",defQFormat:j(r,"w","defQFormat")==="1",count:l(r,"w","count")});let a=ce(e$1,n);t.styles=Array.from(a.values());}catch(o){console.warn("Failed to parse style definitions:",o);}return t}function Ie(e){let n={abstractNums:[],nums:[]};if(!e)return fe(n);let t=c(e);if(!t)return fe(n);let o=f(t,"w","abstractNum");for(let r of o){let a=ze(r);a&&n.abstractNums.push(a);}let s=f(t,"w","num");for(let r of s){let a=$e(r);a&&n.nums.push(a);}return fe(n)}function ze(e$1){let n=j(e$1,"w","abstractNumId");if(n===null)return null;let t=parseInt(n,10);if(isNaN(t))return null;let o={abstractNumId:t,levels:[]},s=e(e$1,"w","multiLevelType");if(s){let u=j(s,"w","val");(u==="hybridMultilevel"||u==="multilevel"||u==="singleLevel")&&(o.multiLevelType=u);}let r=e(e$1,"w","name");r&&(o.name=j(r,"w","val")??void 0);let a=e(e$1,"w","numStyleLink");a&&(o.numStyleLink=j(a,"w","val")??void 0);let c=e(e$1,"w","styleLink");c&&(o.styleLink=j(c,"w","val")??void 0);let d=f(e$1,"w","lvl");for(let u of d){let m=Ae(u);m&&o.levels.push(m);}return o.levels.sort((u,m)=>u.ilvl-m.ilvl),o}function $e(e$1){let n=j(e$1,"w","numId");if(n===null)return null;let t=parseInt(n,10);if(isNaN(t))return null;let o=e(e$1,"w","abstractNumId");if(!o)return null;let s=j(o,"w","val");if(s===null)return null;let r=parseInt(s,10);if(isNaN(r))return null;let a={numId:t,abstractNumId:r},c=f(e$1,"w","lvlOverride");if(c.length>0){a.levelOverrides=[];for(let d of c){let u=j(d,"w","ilvl");if(u===null)continue;let m=parseInt(u,10);if(isNaN(m))continue;let h={ilvl:m},p=e(d,"w","startOverride");if(p){let f=j(p,"w","val");if(f!==null){let b=parseInt(f,10);isNaN(b)||(h.startOverride=b);}}let x=e(d,"w","lvl");x&&(h.lvl=Ae(x)??void 0),a.levelOverrides.push(h);}}return a}function Ae(e$1){let n=j(e$1,"w","ilvl");if(n===null)return null;let t=parseInt(n,10);if(isNaN(t)||t<0||t>8)return null;let o={ilvl:t,numFmt:"decimal",lvlText:""},s=e(e$1,"w","start");if(s){let f=j(s,"w","val");if(f!==null){let b=parseInt(f,10);isNaN(b)||(o.start=b);}}let r=e(e$1,"w","numFmt");if(r){let f=j(r,"w","val");f&&(o.numFmt=Ze(f));}let a=e(e$1,"w","lvlText");a&&(o.lvlText=j(a,"w","val")??"");let c=e(e$1,"w","lvlJc");if(c){let f=j(c,"w","val");(f==="left"||f==="center"||f==="right")&&(o.lvlJc=f);}let d=e(e$1,"w","suff");if(d){let f=j(d,"w","val");(f==="tab"||f==="space"||f==="nothing")&&(o.suffix=f);}let u=e(e$1,"w","isLgl");u&&(o.isLgl=m(u));let m$1=e(e$1,"w","lvlRestart");if(m$1){let f=j(m$1,"w","val");if(f!==null){let b=parseInt(f,10);isNaN(b)||(o.lvlRestart=b);}}let h=e(e$1,"w","legacy");h&&(o.legacy={legacy:m(h),legacySpace:l(h,"w","legacySpace"),legacyIndent:l(h,"w","legacyIndent")});let p=e(e$1,"w","pPr");p&&(o.pPr=_e(p));let x=e(e$1,"w","rPr");return x&&(o.rPr=Qe(x)),o}function Ze(e){return {decimal:"decimal",upperRoman:"upperRoman",lowerRoman:"lowerRoman",upperLetter:"upperLetter",lowerLetter:"lowerLetter",ordinal:"ordinal",cardinalText:"cardinalText",ordinalText:"ordinalText",hex:"hex",chicago:"chicago",bullet:"bullet",none:"none",decimalZero:"decimalZero",ganada:"ganada",chosung:"chosung",ideographDigital:"ideographDigital",japaneseCounting:"japaneseCounting",aiueo:"aiueo",iroha:"iroha",decimalFullWidth:"decimalFullWidth",decimalHalfWidth:"decimalHalfWidth",japaneseLegal:"japaneseLegal",japaneseDigitalTenThousand:"japaneseDigitalTenThousand",decimalEnclosedCircle:"decimalEnclosedCircle",decimalFullWidth2:"decimalFullWidth2",aiueoFullWidth:"aiueoFullWidth",irohaFullWidth:"irohaFullWidth",decimalEnclosedFullstop:"decimalEnclosedFullstop",decimalEnclosedParen:"decimalEnclosedParen",decimalEnclosedCircleChinese:"decimalEnclosedCircleChinese",ideographEnclosedCircle:"ideographEnclosedCircle",ideographTraditional:"ideographTraditional",ideographZodiac:"ideographZodiac",ideographZodiacTraditional:"ideographZodiacTraditional",taiwaneseCounting:"taiwaneseCounting",ideographLegalTraditional:"ideographLegalTraditional",taiwaneseCountingThousand:"taiwaneseCountingThousand",taiwaneseDigital:"taiwaneseDigital",chineseCounting:"chineseCounting",chineseLegalSimplified:"chineseLegalSimplified",chineseCountingThousand:"chineseCountingThousand",koreanDigital:"koreanDigital",koreanCounting:"koreanCounting",koreanLegal:"koreanLegal",koreanDigital2:"koreanDigital2",vietnameseCounting:"vietnameseCounting",russianLower:"russianLower",russianUpper:"russianUpper",numberInDash:"numberInDash",hebrew1:"hebrew1",hebrew2:"hebrew2",arabicAlpha:"arabicAlpha",arabicAbjad:"arabicAbjad",hindiVowels:"hindiVowels",hindiConsonants:"hindiConsonants",hindiNumbers:"hindiNumbers",hindiCounting:"hindiCounting",thaiLetters:"thaiLetters",thaiNumbers:"thaiNumbers",thaiCounting:"thaiCounting"}[e]??"decimal"}function _e(e$1){let n={},t=e(e$1,"w","ind");if(t){let s=l(t,"w","left"),r=l(t,"w","right"),a=l(t,"w","start"),c=l(t,"w","end"),d=l(t,"w","firstLine"),u=l(t,"w","hanging"),m=s??a,h=r??c;m!==void 0&&(n.indentLeft=m),h!==void 0&&(n.indentRight=h),u!==void 0?(n.indentFirstLine=-u,n.hangingIndent=true):d!==void 0&&(n.indentFirstLine=d);}let o=e(e$1,"w","tabs");if(o){n.tabs=[];let s=f(o,"w","tab");for(let r of s){let a=l(r,"w","pos"),c=j(r,"w","val"),d=j(r,"w","leader");a!==void 0&&c&&n.tabs.push({position:a,alignment:Je(c),leader:qe(d)});}}return n}function Je(e){switch(e){case "left":return "left";case "center":return "center";case "right":return "right";case "decimal":return "decimal";case "bar":return "bar";case "clear":return "clear";case "num":return "num";default:return "left"}}function qe(e){if(e)switch(e){case "none":return "none";case "dot":return "dot";case "hyphen":return "hyphen";case "underscore":return "underscore";case "heavy":return "heavy";case "middleDot":return "middleDot";default:return}}function Qe(e$1){let n={},t=e(e$1,"w","rFonts");t&&(n.fontFamily={ascii:j(t,"w","ascii")??void 0,hAnsi:j(t,"w","hAnsi")??void 0,eastAsia:j(t,"w","eastAsia")??void 0,cs:j(t,"w","cs")??void 0});let o=e(e$1,"w","sz");if(o){let d=l(o,"w","val");d!==void 0&&(n.fontSize=d);}let s=e(e$1,"w","color");if(s){let d=j(s,"w","val"),u=j(s,"w","themeColor");d==="auto"?n.color={auto:true}:u?n.color={themeColor:u,themeTint:j(s,"w","themeTint")??void 0,themeShade:j(s,"w","themeShade")??void 0}:d&&(n.color={rgb:d});}let r=e(e$1,"w","b");r&&(n.bold=m(r));let a=e(e$1,"w","i");a&&(n.italic=m(a));let c=e(e$1,"w","vanish");return c&&(n.hidden=m(c)),n}function fe(e){let n=new Map;for(let o of e.abstractNums)n.set(o.abstractNumId,o);let t=new Map;for(let o of e.nums)t.set(o.numId,o);return {definitions:e,getLevel(o,s){let r=t.get(o);if(!r)return null;if(r.levelOverrides){let c=r.levelOverrides.find(d=>d.ilvl===s);if(c){if(c.lvl)return c.lvl;let d=n.get(r.abstractNumId);if(d){let u=d.levels.find(m=>m.ilvl===s);if(u&&c.startOverride!==void 0)return {...u,start:c.startOverride}}}}let a=n.get(r.abstractNumId);if(!a)return null;if(a.numStyleLink&&a.levels.length===0){for(let c of n.values())if(c.styleLink===a.numStyleLink&&c.levels.length>0){a=c;break}}return a.levels.find(c=>c.ilvl===s)??null},getAbstract(o){return n.get(o)??null},getInstance(o){return t.get(o)??null},hasNumbering(o){return t.has(o)}}}function Ge(e,n){switch(n){case "decimal":case "decimalZero":return e.toString();case "upperRoman":return De(e).toUpperCase();case "lowerRoman":return De(e).toLowerCase();case "upperLetter":return Xe(e).toUpperCase();case "lowerLetter":return Xe(e).toLowerCase();case "ordinal":return Ye(e);case "bullet":return "\u2022";case "none":return "";case "decimalEnclosedParen":return `(${e})`;case "numberInDash":return `-${e}-`;default:return e.toString()}}function De(e){if(e<=0||e>3999)return e.toString();let n=[[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"]],t="",o=e;for(let[s,r]of n)for(;o>=s;)t+=r,o-=s;return t}function Xe(e){if(e<=0)return "";let n="",t=e;for(;t>0;)t--,n=String.fromCharCode(97+t%26)+n,t=Math.floor(t/26);return n}function Ye(e){let n=["th","st","nd","rd"],t=e%100;return e+(n[(t-20)%10]||n[t]||n[0])}function Pt(e,n,t){let o=e;for(let s=1;s<=9;s++){let r=`%${s}`;if(o.includes(r)){let a=s-1,c=n[a]??1,d=t[a]??"decimal",u=Ge(c,d);o=o.replace(r,u);}}return o}function Ft(e){if(e.lvlText)return e.lvlText;let n=e.rPr?.fontFamily?.ascii||e.rPr?.fontFamily?.hAnsi;if(n){let t=n.toLowerCase();if(t==="symbol")return "\u2022";if(t.includes("wingding"))return "\u2751"}return "\u2022"}function Nt(e){return e.numFmt==="bullet"||e.numFmt==="none"}var Le=/\{([a-zA-Z_][a-zA-Z0-9_\-\.]*)\}/g;function ke(e){let n=[],t;for(Le.lastIndex=0;(t=Le.exec(e))!==null;){let o=t[1].trim();o&&!n.includes(o)&&n.push(o);}return n}function ee(e){let n=[];for(let t of e)if(t.type==="paragraph"){let o=N(t),s=ke(o);for(let r of s)n.includes(r)||n.push(r);}else if(t.type==="table"){let o=Ee(t);for(let s of o)n.includes(s)||n.push(s);}return n}function Ee(e){let n=[];for(let t of e.rows)for(let o of t.cells)for(let s of o.content)if(s.type==="paragraph"){let r=N(s),a=ke(r);for(let c of a)n.includes(c)||n.push(c);}else if(s.type==="table"){let r=Ee(s);for(let a of r)n.includes(a)||n.push(a);}return n}function Ke(e,n){let t=[],o=[];for(let s of e)o.push(s),s.type==="paragraph"&&s.sectionProperties&&(t.push({properties:s.sectionProperties,content:o}),o=[]);return (o.length>0||t.length===0)&&t.push({properties:n??C(),content:o}),t}function te(e$1,n=null,t=null,o=null,s=null,r=null){let a={content:[]};if(!e$1)return a;let c=a$2(e$1);if(!c)return a;let d=(c.elements??[]).find(p=>p.type==="element"&&(p.name==="w:document"||p.name?.endsWith(":document")));if(!d)return a;let u=e(d,"w","body");if(!u)return a;a.content=q(u,n,t,o,s,r);let m=e(u,"w","sectPr");m&&(a.finalSectionProperties=B(m,s));let h=Ke(a.content,a.finalSectionProperties);return a.sections=D(h),a.finalSectionProperties&&a.sections.length>0&&(a.finalSectionProperties=a.sections[a.sections.length-1].properties),a}function et(e$1){let n=new Map,t=a$2(e$1);if(!t)return n;let o=e(t,"w16cex","commentsExtensible")??t;for(let s of i(o)){if((s.name?.replace(/^.*:/,"")??"")!=="comment")continue;let a=j(s,"w16cex","paraId")??j(s,"w15","paraId")??s.attributes?.["w16cex:paraId"]??s.attributes?.["w15:paraId"],c=j(s,"w16cex","dateUtc")??j(s,"w15","dateUtc")??s.attributes?.["w16cex:dateUtc"]??s.attributes?.["w15:dateUtc"];a&&c&&n.set(String(a).toUpperCase(),String(c));}return n}function tt(e$1){let n=new Map,t=new Map,o=a$2(e$1);if(!o)return {parentByParaId:n,doneByParaId:t};let s=e(o,"w15","commentsEx")??o;for(let r of i(s)){if((r.name?.replace(/^.*:/,"")??"")!=="commentEx")continue;let c=j(r,"w15","paraId")??r.attributes?.["w15:paraId"],d=j(r,"w15","paraIdParent")??r.attributes?.["w15:paraIdParent"],u=j(r,"w15","done")??r.attributes?.["w15:done"];if(c){let m=String(c).toUpperCase();d&&n.set(m,String(d).toUpperCase()),u==="1"&&t.set(m,true);}}return {parentByParaId:n,doneByParaId:t}}function Re(e$1,n,t,o,s,r,a){if(!e$1)return [];let c=a$2(e$1);if(!c)return [];let d=r?et(r):new Map,u=a?tt(a):null,m=e(c,"w","comments")??c,h=i(m),p=[],x=[];for(let f of h){if((f.name?.replace(/^.*:/,"")??"")!=="comment")continue;let T=parseInt(j(f,"w","id")??"0",10),M=j(f,"w","author")??"Unknown",X=j(f,"w","initials"),P=X!=null?String(X):void 0,F=j(f,"w","date"),y=F!=null?String(F):void 0,S=j(f,"w14","paraId")??f.attributes?.["w14:paraId"]??j(f,"w","paraId"),D=(S?d.get(String(S).toUpperCase()):void 0)??y,I=j(f,"w","done")??f.attributes?.["w:done"],N=I==="1"||I==="true"?true:void 0,L=j(f,"w16cid","parentId")??j(f,"w","parentId")??f.attributes?.["w16cid:parentId"]??f.attributes?.["w:parentId"],O$1=L!=null?parseInt(String(L),10):void 0,W=[],H="";for(let R of i(f))if((R.name?.replace(/^.*:/,"")??"")==="p"){let g=O(R,n,t,null,o,s);W.push(g);let k=j(R,"w14","paraId")??R.attributes?.["w14:paraId"];k&&(H=String(k).toUpperCase());}N==null&&u&&H&&u.doneByParaId.get(H)&&(N=true),x.push(H),p.push({id:T,author:M,initials:P,date:D,content:W,...N!=null?{done:N}:{},...O$1!=null&&!isNaN(O$1)?{parentId:O$1}:{}});}if(u&&u.parentByParaId.size>0){let f=new Map;for(let b=0;b<p.length;b++){let T=x[b];T&&f.set(T,p[b].id);}for(let b=0;b<p.length;b++){if(p[b].parentId!=null)continue;let T=x[b];if(!T)continue;let M=u.parentByParaId.get(T);if(!M)continue;let X=f.get(M);X!=null&&(p[b]={...p[b],parentId:X});}}return p}async function Be(e,n={}){let t=e instanceof ArrayBuffer?e:await s(e),{onProgress:o=()=>{},preloadFonts:s$1=true,parseHeadersFooters:r=true,parseNotes:a$1=true,detectVariables:c=true}=n,d=[];try{let p=function(A,g){let k=performance.now(),j=g(),B=performance.now()-k;return h.push({stage:A,ms:B}),B>1e3&&console.warn(`[parseDocx] ${A} took ${Math.round(B)}ms`),j};var u=p;let m=performance.now(),h=[];async function x(A,g){let k=performance.now(),j=await g(),B=performance.now()-k;return h.push({stage:A,ms:B}),B>1e3&&console.warn(`[parseDocx] ${A} took ${Math.round(B)}ms`),j}o("Extracting DOCX...",0);let f=await x("unzip",()=>G(t));o("Extracted DOCX",10),o("Parsing relationships...",10);let b$2=p("relationships",()=>f.documentRels?b(f.documentRels):new Map);o("Parsed relationships",15),o("Parsing theme...",15);let T=p("theme",()=>a(f.themeXml));o("Parsed theme",20),o("Parsing styles...",20);let M=null,X;p("styles",()=>{f.stylesXml&&(M=ce(f.stylesXml,T),X=Me(f.stylesXml,T));}),o("Parsed styles",30),o("Parsing numbering...",30);let P=p("numbering",()=>Ie(f.numberingXml)),F=p("settings",()=>b$1(f.settingsXml));o("Parsed numbering",35),o("Processing media files...",35);let y=p("media",()=>nt(f,b$2));o("Processed media",40),o("Parsing document body...",40);let S={content:[]};p("documentBody",()=>{f.documentXml?S=te(f.documentXml,M,T,P,b$2,y):d.push("No document.xml found in DOCX");}),o("Parsed document body",55);let C,D;if(r){o("Parsing headers/footers...",55);let A=p("headersFooters",()=>ot(f,M,T,P,b$2,y));C=A.headers,D=A.footers,o("Parsed headers/footers",65);}else o("Skipping headers/footers",65);let I,N;if(a$1){o("Parsing footnotes/endnotes...",65);let A=p("footnotesEndnotes",()=>rt(f,M,T,P,b$2,y));I=A.footnotes,N=A.endnotes,o("Parsed footnotes/endnotes",75);}else o("Skipping footnotes/endnotes",75);o("Parsing comments...",75);let L=p("comments",()=>Re(f.commentsXml,M,T,b$2,y,f.commentsExtensibleXml,f.commentsExtendedXml));L.length>0&&(S.comments=L);let O;c?(o("Detecting template variables...",75),O=p("variables",()=>ee(S.content)),o("Detected variables",80)):o("Skipping variable detection",80),s$1?(o("Loading fonts...",80),await x("fonts",()=>it(T,X,S)),o("Loaded fonts",95)):o("Skipping font loading",95),o("Assembling document...",95);let H={package:{document:S,styles:X,theme:T,numbering:P.definitions,settings:F,headers:C,footers:D,footnotes:I,endnotes:N,relationships:b$2,media:y},originalBuffer:t,templateVariables:O,warnings:d.length>0?d:void 0},R=performance.now()-m;if(R>2e3){let A=h.filter(g=>g.ms>100).map(g=>`${g.stage}: ${Math.round(g.ms)}ms`).join(", ");console.warn(`[parseDocx] Total: ${Math.round(R)}ms`+(A?` (${A})`:""));}return o("Complete",100),H}catch(m){let h=m instanceof Error?m.message:String(m);throw console.error("[parseDocx] Failed to parse DOCX:",h,m),new Error(`Failed to parse DOCX: ${h}`)}}function nt(e,n){let t=new Map;for(let[o,s]of e.media.entries()){let r=o.split("/").pop()||o,a=Ce(o),c=new Uint8Array(s),d="";for(let x=0;x<c.length;x++)d+=String.fromCharCode(c[x]);let u=btoa(d),m=`data:${a};base64,${u}`,h={path:o,filename:r,mimeType:a,data:s,dataUrl:m};t.set(o,h);let p=o.replace(/^word\//,"");p!==o&&t.set(p,h);}return t}function ne(e,n){let t=n.toLowerCase();for(let[o,s]of e.entries())if(o.toLowerCase()===t)return s}function ot(e,n,t,o,s,r$1){let a=new Map,c=new Map;for(let[d,u]of s.entries())if(u.type===a$1.header&&u.target){let m=u.target.split("/").pop()||u.target,h=ne(e.headers,m);if(h){let p=`word/_rels/${m}.rels`,x=ne(e.allXml,p),f=x?b(x):s,b$1=r(h,"default",n,t,o,f,r$1);a.set(d,b$1);}}else if(u.type===a$1.footer&&u.target){let m=u.target.split("/").pop()||u.target,h=ne(e.footers,m);if(h){let p=`word/_rels/${m}.rels`,x=ne(e.allXml,p),f=x?b(x):s,b$1=s$1(h,"default",n,t,o,f,r$1);c.set(d,b$1);}}return {headers:a,footers:c}}function rt(e,n,t$1,o,s,r){let a=t(e.footnotesXml,n,t$1,o,s,r),c=u(e.endnotesXml,n,t$1,o,s,r);return {footnotes:a.getNormalFootnotes(),endnotes:c.getNormalEndnotes()}}async function it(e,n,t){let o$1=new Set;if(e?.fontScheme){let{majorFont:s,minorFont:r}=e.fontScheme;s?.latin&&o$1.add(s.latin),r?.latin&&o$1.add(r.latin);}if(n?.docDefaults?.rPr?.fontFamily?.ascii&&o$1.add(n.docDefaults.rPr.fontFamily.ascii),n?.styles)for(let s of n.styles)s.rPr?.fontFamily?.ascii&&o$1.add(s.rPr.fontFamily.ascii),s.rPr?.fontFamily?.hAnsi&&o$1.add(s.rPr.fontFamily.hAnsi);if(t.content){for(let s of t.content)if(s.type==="paragraph")for(let r of s.content)r.type==="run"&&r.formatting?.fontFamily&&(r.formatting.fontFamily.ascii&&o$1.add(r.formatting.fontFamily.ascii),r.formatting.fontFamily.hAnsi&&o$1.add(r.formatting.fontFamily.hAnsi));}if(o$1.size>0)try{await o(Array.from(o$1));}catch(s){console.warn("Failed to load some fonts:",s);}}async function qt(e){return Be(e,{preloadFonts:false,parseHeadersFooters:false,parseNotes:false,detectVariables:true})}async function Qt(e,n){return Be(e,{onProgress:n,preloadFonts:true,parseHeadersFooters:true,parseNotes:true,detectVariables:true})}async function Gt(e){let n=await G(e);if(!n.documentXml)return [];let t=te(n.documentXml);return ee(t.content)}async function Yt(e){let n=await G(e),t=n.documentXml?ee(te(n.documentXml).content):[];return {hasDocument:n.documentXml!==null,hasStyles:n.stylesXml!==null,hasTheme:n.themeXml!==null,hasNumbering:n.numberingXml!==null,headerCount:n.headers.size,footerCount:n.footers.size,mediaCount:n.media.size,variableCount:t.length}}
|
|
2
|
+
export{Ie as a,Ge as b,Pt as c,Ft as d,Nt as e,Be as f,qt as g,Qt as h,Gt as i,Yt as j};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b as b$1}from'./chunk-3NRMSZX2.mjs';import {f}from'./chunk-VW22RZ6C.mjs';function h(c){return JSON.parse(JSON.stringify(c))}function g(c,t){let a=0;for(let r=0;r<c.content.length;r++)if(c.content[r].type==="paragraph"){if(a===t)return r;a++;}return -1}function I(c){let t="";for(let a of c.content)if(a.type==="run")for(let r of a.content)r.type==="text"&&(t+=r.text);else if(a.type==="hyperlink"){for(let r of a.children)if(r.type==="run")for(let e of r.content)e.type==="text"&&(t+=e.text);}return t}function b(c,t){return {type:"run",formatting:t,content:[{type:"text",text:c}]}}function P(c,t,a,r){let e=[],o=0,p=false;for(let n of c.content)if(n.type==="run"){let s=n.content.filter(l=>l.type==="text").map(l=>l.text).join(""),i=o,u=o+s.length;if(!p&&t>=i&&t<=u){let l=t-i;l>0&&e.push({...n,content:[{type:"text",text:s.slice(0,l)}]}),e.push(b(a,r||n.formatting)),l<s.length&&e.push({...n,content:[{type:"text",text:s.slice(l)}]}),p=true;}else e.push(n);o=u;}else e.push(n);return p||e.push(b(a,r)),e}function m(c,t,a){let r=[],e=0;for(let o of c.content)if(o.type==="run"){let p=o.content.filter(i=>i.type==="text").map(i=>i.text).join(""),n=e,s=e+p.length;if(s<=t||n>=a)r.push(o);else {let i="";n<t&&(i+=p.slice(0,t-n)),s>a&&(i+=p.slice(a-n)),i.length>0&&r.push({...o,content:[{type:"text",text:i}]});}e=s;}else r.push(o);return r}function C(c,t,a,r){let e=[],o=0;for(let p of c.content)if(p.type==="run"){let n=p.content.filter(u=>u.type==="text").map(u=>u.text).join(""),s=o,i=o+n.length;if(i<=t||s>=a)e.push(p);else if(s>=t&&i<=a)e.push({...p,formatting:{...p.formatting,...r}});else {let u=Math.max(t,s),l=Math.min(a,i);s<u&&e.push({...p,content:[{type:"text",text:n.slice(0,u-s)}]}),e.push({...p,formatting:{...p.formatting,...r},content:[{type:"text",text:n.slice(u-s,l-s)}]}),i>l&&e.push({...p,content:[{type:"text",text:n.slice(l-s)}]});}o=i;}else e.push(p);return e}function v(c,t){let a=h(c),r=a.package.document,e=g(r,t.position.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.position.paragraphIndex} not found`);let o=r.content[e];return o.content=P(o,t.position.offset,t.text,t.formatting),a}function B(c,t){let a=h(c),r=a.package.document,{start:e,end:o}=t.range;if(e.paragraphIndex===o.paragraphIndex){let p=g(r,e.paragraphIndex);if(p===-1)throw new Error(`Paragraph index ${e.paragraphIndex} not found`);let n=r.content[p];n.content=m(n,e.offset,o.offset),n.content=P(n,e.offset,t.text,t.formatting);}else {let p=g(r,e.paragraphIndex),n=r.content[p],s=I(n);n.content=m(n,e.offset,s.length),n.content=P(n,e.offset,t.text,t.formatting);let i=[];for(let u=e.paragraphIndex+1;u<=o.paragraphIndex;u++)i.push(g(r,u));for(let u=i.length-1;u>=0;u--)i[u]!==-1&&r.content.splice(i[u],1);}return a}function A(c,t){let a=h(c),r=a.package.document,{start:e,end:o}=t.range;if(e.paragraphIndex===o.paragraphIndex){let p=g(r,e.paragraphIndex);if(p===-1)throw new Error(`Paragraph index ${e.paragraphIndex} not found`);let n=r.content[p];n.content=m(n,e.offset,o.offset);}else {let p=g(r,e.paragraphIndex),n=r.content[p],s=I(n);n.content=m(n,e.offset,s.length);let i=g(r,o.paragraphIndex),u=r.content[i];u.content=m(u,0,o.offset),n.content.push(...u.content);let l=[];for(let f=e.paragraphIndex+1;f<=o.paragraphIndex;f++)l.push(g(r,f));for(let f=l.length-1;f>=0;f--)l[f]!==-1&&r.content.splice(l[f],1);}return a}function E(c,t){let a=h(c),r=a.package.document,{start:e,end:o}=t.range;if(e.paragraphIndex===o.paragraphIndex){let p=g(r,e.paragraphIndex);if(p===-1)throw new Error(`Paragraph index ${e.paragraphIndex} not found`);let n=r.content[p];n.content=C(n,e.offset,o.offset,t.formatting);}else for(let p=e.paragraphIndex;p<=o.paragraphIndex;p++){let n=g(r,p);if(n===-1)continue;let s=r.content[n],i=I(s),u=0,l=i.length;p===e.paragraphIndex&&(u=e.offset),p===o.paragraphIndex&&(l=o.offset),s.content=C(s,u,l,t.formatting);}return a}function S(c,t){let a=h(c),r=a.package.document,e=g(r,t.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.paragraphIndex} not found`);let o=r.content[e];if(o.formatting={...o.formatting,...t.formatting},"numPr"in t.formatting){let p=t.formatting.numPr;if(p&&p.numId!==void 0&&p.numId!==0){let n=p.ilvl??0,s=p.numId===1,i=s?"\u2022":"1.";if(a.package.numbering){let u=a.package.numbering.nums.find(l=>l.numId===p.numId);if(u){let l=a.package.numbering.abstractNums.find(f=>f.abstractNumId===u.abstractNumId);if(l){let f=l.levels.find(x=>x.ilvl===n);f&&(i=f.lvlText||i);}}}o.listRendering={level:n,numId:p.numId,marker:i,isBullet:s};}else delete o.listRendering;}return a}function F(c,t){let a=h(c),r=a.package.document,e=g(r,t.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.paragraphIndex} not found`);let o=r.content[e];return o.formatting={...o.formatting,styleId:t.styleId},a}function V(c,t){let a=h(c),r=a.package.document,e=[];for(let n=0;n<t.rows;n++){let s=[];for(let i=0;i<t.columns;i++){let u=t.data?.[n]?.[i]||"";s.push({type:"tableCell",content:[{type:"paragraph",content:u?[b(u)]:[]}]});}e.push({type:"tableRow",formatting:n===0&&t.hasHeader?{header:true}:void 0,cells:s});}let o={type:"table",rows:e},p=g(r,t.position.paragraphIndex);return p===-1?r.content.push(o):r.content.splice(p+1,0,o),a}function H(c,t){let a=h(c),r=a.package.document,e=g(r,t.position.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.position.paragraphIndex} not found`);let o=r.content[e],n={type:"run",content:[{type:"drawing",image:{type:"image",rId:`rId_img_${Date.now()}`,src:t.src,alt:t.alt,size:{width:f(t.width||100),height:f(t.height||100)},wrap:{type:"inline"}}}]},s=P(o,t.position.offset,"",void 0),i=false,u=0;for(let l=0;l<s.length;l++){let f=s[l];if(f.type==="run"){let x=f.content.filter(d=>d.type==="text").map(d=>d.text).join("");if(u+=x.length,!i&&u>=t.position.offset){s.splice(l+1,0,n),i=true;break}}}return i||s.push(n),o.content=s,a}function $(c,t){let a=h(c),r=a.package.document,{start:e,end:o}=t.range;if(e.paragraphIndex!==o.paragraphIndex)throw new Error("Hyperlinks cannot span multiple paragraphs");let p=g(r,e.paragraphIndex);if(p===-1)throw new Error(`Paragraph index ${e.paragraphIndex} not found`);let n=r.content[p],s=I(n),i=t.displayText||s.slice(e.offset,o.offset);n.content=m(n,e.offset,o.offset);let u={type:"hyperlink",href:t.url,tooltip:t.tooltip,children:[b(i)]},l=false,f=0,x=[];for(let d of n.content)if(d.type==="run"){let T=d.content.filter(y=>y.type==="text").map(y=>y.text).join(""),w=f+T.length;if(!l&&f<=e.offset&&e.offset<=w){let y=e.offset-f;y>0&&x.push({...d,content:[{type:"text",text:T.slice(0,y)}]}),x.push(u),y<T.length&&x.push({...d,content:[{type:"text",text:T.slice(y)}]}),l=true;}else x.push(d);f=w;}else x.push(d);return l||x.push(u),n.content=x,a}function j(c,t){let a=h(c),r=a.package.document,{start:e}=t.range,o=g(r,e.paragraphIndex);if(o===-1)throw new Error(`Paragraph index ${e.paragraphIndex} not found`);let p=r.content[o],n=[];for(let s of p.content)if(s.type==="hyperlink")for(let i of s.children)i.type==="run"&&n.push(i);else n.push(s);return p.content=n,a}function D(c,t){let a=h(c),r=a.package.document,e=g(r,t.position.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.position.paragraphIndex} not found`);let o=r.content[e],p=I(o),n=m({...o,content:[...o.content]},t.position.offset,p.length),s=m({...o,content:[...o.content]},0,t.position.offset);o.content=n;let i={type:"paragraph",formatting:o.formatting,content:s};return r.content.splice(e+1,0,i),a}function M(c,t){let a=h(c),r=a.package.document,e=g(r,t.paragraphIndex);if(e===-1)throw new Error(`Paragraph index ${t.paragraphIndex} not found`);let o=r.content[e],p=[];for(let n=1;n<=t.count;n++){let s=g(r,t.paragraphIndex+n);if(s!==-1){let i=r.content[s];o.content.push(...i.content),p.push(s);}}for(let n=p.length-1;n>=0;n--)r.content.splice(p[n],1);return a}function N(c,t){return D(c,{position:t.position})}function O(c,t){let a=h(c);return a.templateVariables||(a.templateVariables=[]),a.templateVariables.includes(t.name)||a.templateVariables.push(t.name),a}function _(c,t){let a=h(c),r=a.package.document;function e(n){for(let s of n.content)if(s.type==="text")for(let[i,u]of Object.entries(t.values)){let l=new RegExp(`\\{${i}\\}`,"g");s.text=s.text.replace(l,u);}}function o(n){for(let s of n.content)if(s.type==="run")e(s);else if(s.type==="hyperlink")for(let i of s.children)i.type==="run"&&e(i);}function p(n){if(n.type==="paragraph")o(n);else if(n.type==="table")for(let s of n.rows)for(let i of s.cells)for(let u of i.content)p(u);}for(let n of r.content)p(n);return a}function J(c,t){let a=b$1.getCommandHandler(t.type);if(a)return a(c,t);switch(t.type){case "insertText":return v(c,t);case "replaceText":return B(c,t);case "deleteText":return A(c,t);case "formatText":return E(c,t);case "formatParagraph":return S(c,t);case "applyStyle":return F(c,t);case "insertTable":return V(c,t);case "insertImage":return H(c,t);case "insertHyperlink":return $(c,t);case "removeHyperlink":return j(c,t);case "insertParagraphBreak":return D(c,t);case "mergeParagraphs":return M(c,t);case "splitParagraph":return N(c,t);case "setVariable":return O(c,t);case "applyVariables":return _(c,t);default:{let r=t;throw new Error(`Unknown command type: ${r.type}`)}}}function at(c,t){return t.reduce((a,r)=>J(a,r),c)}export{J as a,at as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkHKVAW3RE_js=require('./chunk-HKVAW3RE.js'),chunkLTHT4A4S_js=require('./chunk-LTHT4A4S.js'),chunk7AMYZMCX_js=require('./chunk-7AMYZMCX.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js');function j(e,t){if(e.pages.length===0)return null;let a=e.pageGap??0,o=0,n=null,r=1/0;for(let s=0;s<e.pages.length;s++){let i=e.pages[s],l=i.size?.h??e.pageSize.h,u=o,f=u+l;if(t.y>=u&&t.y<f)return {pageIndex:s,page:i,pageY:t.y-u};let c=u+l/2,h=Math.abs(t.y-c);h<r&&(r=h,n=s),o=f+a;}if(n!==null){let s=e.pages[n],i=A(e,n);return {pageIndex:n,page:s,pageY:Math.max(0,Math.min(t.y-i,s.size?.h??e.pageSize.h))}}return null}function A(e,t){let a=e.pageGap??0,o=0;for(let n=0;n<t&&n<e.pages.length;n++){let s=e.pages[n].size?.h??e.pageSize.h;o+=s+a;}return o}function Me(e,t){return j(e,{y:t})?.pageIndex??null}function $(e,t){return e.findIndex(a=>a.id===t)}function ye(e,t){let a=0;for(let o=e.fromLine;o<e.toLine&&o<t.lines.length;o++)a+=t.lines[o].lineHeight;return a}function ae(e,t,a,o){let n=[...e.page.fragments].sort((r,s)=>{let i=r.y-s.y;return Math.abs(i)>.5?i:r.x-s.x});for(let r of n){let s=$(t,r.blockId);if(s===-1)continue;let i=t[s],l=a[s];if(!i||!l)continue;let u;if(r.kind==="paragraph"){if(i.kind!=="paragraph"||l.kind!=="paragraph")continue;u=ye(r,l);}else if(r.kind==="table")u=r.height;else if(r.kind==="image")u=r.height;else continue;let f=o.x>=r.x&&o.x<=r.x+r.width,c=o.y>=r.y&&o.y<=r.y+u;if(f&&c)return {fragment:r,block:i,measure:l,pageIndex:e.pageIndex,localX:o.x-r.x,localY:o.y-r.y}}return null}function He(e,t,a,o){for(let n of e.page.fragments){if(n.kind!=="image")continue;let r=$(t,n.blockId);if(r===-1)continue;let s=t[r],i=a[r];if(!s||!i)continue;let l=o.x>=n.x&&o.x<=n.x+n.width,u=o.y>=n.y&&o.y<=n.y+n.height;if(l&&u)return {fragment:n,block:s,measure:i,pageIndex:e.pageIndex,localX:o.x-n.x,localY:o.y-n.y}}return null}function se(e,t,a,o){for(let n of e.page.fragments){if(n.kind!=="table")continue;let r=n,s=o.x>=r.x&&o.x<=r.x+r.width,i=o.y>=r.y&&o.y<=r.y+r.height;if(!s||!i)continue;let l=$(t,r.blockId);if(l===-1)continue;let u=t[l],f=a[l];if(!u||u.kind!=="table"||!f||f.kind!=="table")continue;let c=u,h=f,p=o.x-r.x,m=o.y-r.y,g=r.headerRowCount??0,d=g>0&&r.continuesFromPrev?chunkLTHT4A4S_js.P(h,g):0,b=0,x=-1;if(h.rows.length===0||c.rows.length===0)continue;if(d>0&&m<d){let T=0;for(let M=0;M<g&&M<h.rows.length;M++){let L=h.rows[M];if(m>=T&&m<T+L.height){x=M;break}T+=L.height;}x===-1&&(x=0);}else {let T=m-d;for(let M=r.fromRow;M<r.toRow&&M<h.rows.length;M++){let L=h.rows[M];if(T>=b&&T<b+L.height){x=M;break}b+=L.height;}}if(x===-1&&(x=Math.min(r.toRow-1,h.rows.length-1),x<r.fromRow))continue;let k=h.rows[x],F=c.rows[x];if(!k||!F)continue;let P=0,y=-1;if(k.cells.length===0||F.cells.length===0)continue;for(let T=0;T<k.cells.length;T++){let M=k.cells[T];if(p>=P&&p<P+M.width){y=T;break}P+=M.width;}if(y===-1&&(y=k.cells.length-1,y<0))continue;let H=k.cells[y],w=F.cells[y];if(!H||!w)continue;let R=0;if(d>0&&x<g)for(let T=0;T<x;T++)R+=h.rows[T]?.height??0;else {R=d;for(let T=r.fromRow;T<x;T++)R+=h.rows[T]?.height??0;}let B=0;for(let T=0;T<y;T++)B+=k.cells[T]?.width??0;let C,S;if(w.blocks&&w.blocks.length>0){let T=w.blocks[0],M=H.blocks[0];T.kind==="paragraph"&&M?.kind==="paragraph"&&(C=T,S=M);}let D=p-B,E=m-R;return {fragment:r,block:c,measure:h,pageIndex:e.pageIndex,rowIndex:x,colIndex:y,cellBlock:C,cellMeasure:S,cellLocalX:Math.max(0,D),cellLocalY:Math.max(0,E)}}return null}function we(e,t,a,o){let n={pageHit:null,fragmentHit:null,tableCellHit:null};if(n.pageHit=j(e,o),!n.pageHit)return n;let r=A(e,n.pageHit.pageIndex),s={x:o.x,y:o.y-r};return n.fragmentHit=ae(n.pageHit,t,a,s),n.fragmentHit?.fragment.kind==="table"&&(n.tableCellHit=se(n.pageHit,t,a,s)),n}function Re(e){if(e.pages.length===0)return 0;let t=e.pageGap??0,a=0;for(let o=0;o<e.pages.length;o++){let n=e.pages[o];a+=n.size?.h??e.pageSize.h,o<e.pages.length-1&&(a+=t);}return a}function Be(e,t){return A(e,t)}function Ie(e,t){if(t<0||t>=e.pages.length)return null;let a=A(e,t),n=e.pages[t].size?.h??e.pageSize.h;return {top:a,bottom:a+n}}function J(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function le(e,t){let a=[];for(let o=t.fromRun;o<=t.toRun&&o<e.runs.length;o++){let n=e.runs[o];if(n){if(n.kind==="tab"||n.kind==="image"||n.kind==="lineBreak"){a.push(n);continue}if(n.kind==="text"){let r=n.text??"",s=o===t.fromRun,i=o===t.toRun;if(s||i){let l=s?t.fromChar:0,u=i?t.toChar:r.length,f=r.slice(l,u);f.length>0&&a.push({...n,text:f});}else a.push(n);}}}return a}function ce(e,t){let a,o,n=e.pmStart??0,r=0;for(let s=0;s<e.runs.length&&s<=t.toRun;s++){let i=e.runs[s];i&&(s<t.fromRun?i.kind==="text"?r+=(i.text??"").length:(i.kind==="tab"||i.kind==="lineBreak"||i.kind==="image")&&(r+=1):s===t.fromRun&&(r+=t.fromChar,a=n+r,i.kind==="text"&&(r=t.fromChar)));}if(a!==void 0){let s=0;for(let i=t.fromRun;i<=t.toRun&&i<e.runs.length;i++){let l=e.runs[i];if(l)if(l.kind==="text"){let u=l.text??"",f=i===t.fromRun?t.fromChar:0,c=i===t.toRun?t.toChar:u.length;s+=c-f;}else (l.kind==="tab"||l.kind==="lineBreak"||l.kind==="image")&&(s+=1);}o=a+s;}return {pmStart:a,pmEnd:o}}function Se(e,t,a,o){let n=0;for(let r=a;r<o&&r<e.lines.length;r++){let i=e.lines[r].lineHeight;if(t>=n&&t<n+i)return r;n+=i;}return o>a?Math.min(o-1,e.lines.length-1):null}function Ee(e,t,a,o){let{pmStart:n,pmEnd:r}=ce(e,t);if(n===void 0||r===void 0)return {charOffset:0,pmPosition:e.pmStart??0};let s=e.attrs?.alignment??"left",i=0;s==="center"?i=Math.max(0,(o-t.width)/2):s==="right"&&(i=Math.max(0,o-t.width));let l=Math.max(0,a-i);if(l<=0)return {charOffset:0,pmPosition:n};let u=le(e,t);if(u.length===0)return {charOffset:0,pmPosition:n};let f=0,c=0;for(let p of u){if(p.kind==="tab"){let m=p.width??48,g=f+m;if(l<=g){let d=f+m/2;return l<d?{charOffset:c,pmPosition:n+c}:{charOffset:c+1,pmPosition:n+c+1}}f=g,c+=1;continue}if(p.kind==="image"){let m=p.width,g=f+m;if(l<=g){let d=f+m/2;return l<d?{charOffset:c,pmPosition:n+c}:{charOffset:c+1,pmPosition:n+c+1}}f=g,c+=1;continue}if(p.kind==="lineBreak"){if(l>=f)return {charOffset:c,pmPosition:n+c};c+=1;continue}if(p.kind==="text"){let m=p.text??"";if(m.length===0)continue;let g=J(p),d=chunkLTHT4A4S_js.g(m,g),b=f+d.width;if(l<=b){let x=l-f,k=chunkLTHT4A4S_js.h(x,d.charWidths),F=c+k;return {charOffset:F,pmPosition:n+F}}f=b,c+=m.length;}}return {charOffset:r-n,pmPosition:r}}function K(e){let{fragment:t,block:a,measure:o,localX:n,localY:r}=e;if(t.kind!=="paragraph"||a.kind!=="paragraph"||o.kind!=="paragraph")return null;let s=t,i=a,l=o,u=Se(l,r,s.fromLine,s.toLine);if(u===null)return null;let f=l.lines[u];if(!f)return null;let c=0;for(let k=s.fromLine;k<u;k++)c+=l.lines[k]?.lineHeight??0;let h=i.attrs?.indent,p=h?.left??0,m=h?.right??0,g=Math.max(0,t.width-p-m),d=n-p,{charOffset:b,pmPosition:x}=Ee(i,f,d,g);return {pmPosition:x,charOffset:b,lineIndex:u}}function ue(e){let{cellBlock:t,cellMeasure:a,cellLocalX:o,cellLocalY:n}=e;if(!t||!a)return null;let r={fragment:{kind:"paragraph",blockId:t.id,x:0,y:0,width:a.lines.reduce((i,l)=>Math.max(i,l.width),100),fromLine:0,toLine:a.lines.length,height:a.totalHeight},block:t,measure:a,pageIndex:e.pageIndex,localX:o,localY:n};return K(r)?.pmPosition??null}function Le(e,t){if(t)return ue(t);if(!e)return null;let{fragment:a}=e;return a.kind==="paragraph"?K(e)?.pmPosition??null:a.kind==="image"?a.pmStart??null:null}function fe(e,t,a,o){let n=e.pmStart??0,r=e.pmEnd??n;if(a<n||a>r)return null;let s=a-n;for(let i=0;i<t.lines.length;i++){let l=t.lines[i],{pmStart:u,pmEnd:f}=ce(e,l);if(u===void 0||f===void 0)continue;let c=u-n,h=f-n;if(s>=c&&s<=h){let p=s-c,m=le(e,l),g=0,d=0;for(let b of m)if(b.kind==="tab"){if(p<=d+1)return p<=d?{x:g,lineIndex:i}:{x:g+(b.width??48),lineIndex:i};g+=b.width??48,d+=1;}else if(b.kind==="image"){if(p<=d+1)return p<=d?{x:g,lineIndex:i}:{x:g+b.width,lineIndex:i};g+=b.width,d+=1;}else if(b.kind==="lineBreak"){if(p<=d)return {x:g,lineIndex:i};d+=1;}else if(b.kind==="text"){let x=b.text??"";if(p<=d+x.length){let P=p-d,y=J(b),H=chunkLTHT4A4S_js.g(x.slice(0,P),y);return {x:g+H.width,lineIndex:i}}let k=J(b),F=chunkLTHT4A4S_js.g(x,k);g+=F.width,d+=x.length;}return {x:g,lineIndex:i}}}return null}function Ce(e,t,a,o,n,r,s){let i=fe(e,t,a);if(!i)return null;let l=e.attrs?.alignment??"left",u=e.attrs?.indent,f=u?.left??0,c=u?.right??0,h=Math.max(0,r-f-c),p=t.lines[i.lineIndex];if(!p)return null;let m=0;l==="center"?m=Math.max(0,(h-p.width)/2):l==="right"&&(m=Math.max(0,h-p.width));let g=0;for(let d=s;d<i.lineIndex;d++)g+=t.lines[d]?.lineHeight??0;return {x:o+f+m+i.x,y:n+g,height:p.lineHeight}}function ge(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function Q(e,t){return e.findIndex(a=>a.id===t)}function W(e,t){let o=(e.pmStart??0)+1,n=0,r;for(let l=0;l<e.runs.length&&l<=t.toRun;l++){let u=e.runs[l];if(u){if(l<t.fromRun)u.kind==="text"?n+=(u.text??"").length:n+=1;else if(l===t.fromRun){n+=t.fromChar,r=o+n;break}}}r===void 0&&(r=o);let s=0;for(let l=t.fromRun;l<=t.toRun&&l<e.runs.length;l++){let u=e.runs[l];if(u)if(u.kind==="text"){let f=u.text??"",c=l===t.fromRun?t.fromChar:0,h=l===t.toRun?t.toChar:f.length;s+=h-c;}else s+=1;}let i=r+s;return {pmStart:r,pmEnd:i}}function me(e,t,a,o){let n=[];for(let r=0;r<t.lines.length;r++){let s=t.lines[r],i=W(e,s);i.pmStart===void 0||i.pmEnd===void 0||i.pmEnd>a&&i.pmStart<o&&n.push({line:s,index:r});}return n}function N(e,t,a){let o=W(e,t);return o.pmStart===void 0?0:Math.max(0,a-o.pmStart)}function z(e,t,a,o){let n=0,r=0;for(let s=t.fromRun;s<=t.toRun&&s<e.runs.length;s++){let i=e.runs[s];if(i){if(i.kind==="tab"){let l=i.width??48;if(r+1>=a)return a<=r?n:n+l;n+=l,r+=1;continue}if(i.kind==="image"){let l=i.width;if(r+1>=a)return a<=r?n:n+l;n+=l,r+=1;continue}if(i.kind==="lineBreak"){if(a<=r)return n;r+=1;continue}if(i.kind==="text"){let l=i.text??"",u=s===t.fromRun,f=s===t.toRun,c=u?t.fromChar:0,h=f?t.toChar:l.length,p=l.slice(c,h);if(r+p.length>=a){let d=a-r,b=ge(i),x=chunkLTHT4A4S_js.g(p.slice(0,d),b);return n+x.width}let m=ge(i),g=chunkLTHT4A4S_js.g(p,m);n+=g.width,r+=p.length;}}}return n}function G(e,t){let a=0;for(let o=0;o<t&&o<e.lines.length;o++)a+=e.lines[o].lineHeight;return a}function De(e,t,a,o,n){if(o===n)return [];let r=Math.min(o,n),s=Math.max(o,n),i=[];for(let l=0;l<e.pages.length;l++){let u=e.pages[l],f=A(e,l);for(let c of u.fragments){if(c.kind==="paragraph"){let h=Q(t,c.blockId);if(h===-1)continue;let p=t[h],m=a[h];if(!p||p.kind!=="paragraph"||!m||m.kind!=="paragraph")continue;let g=p,d=m,b=c,x=me(g,d,r,s);for(let{line:k,index:F}of x){if(F<b.fromLine||F>=b.toLine)continue;let P=W(g,k);if(P.pmStart===void 0||P.pmEnd===void 0)continue;let y=Math.max(P.pmStart,r),H=Math.min(P.pmEnd,s);if(y>=H)continue;let w=N(g,k,y),R=N(g,k,H),I=g.attrs?.indent,B=I?.left??0,C=I?.right??0,S=Math.max(0,c.width-B-C),D=z(g,k,w),E=z(g,k,R),T=g.attrs?.alignment??"left",M=0;T==="center"?M=Math.max(0,(S-k.width)/2):T==="right"&&(M=Math.max(0,S-k.width));let L=G(d,F)-G(d,b.fromLine),_=c.x+B+M+Math.min(D,E),V=Math.max(1,Math.abs(E-D)),v=c.y+L;i.push({x:_,y:v+f,width:V,height:k.lineHeight,pageIndex:l});}}if(c.kind==="table"){let h=Q(t,c.blockId);if(h===-1)continue;let p=t[h],m=a[h];if(!p||p.kind!=="table"||!m||m.kind!=="table")continue;let g=p,d=m,b=c,x=b.headerRowCount??0,F=x>0&&b.continuesFromPrev?chunkLTHT4A4S_js.P(d,x):0;for(let P=b.fromRow;P<b.toRow&&P<g.rows.length;P++){let y=g.rows[P],H=d.rows[P];if(!y||!H)continue;let w=0;for(let R=0;R<y.cells.length;R++){let I=y.cells[R],B=H.cells[R];if(!(!I||!B)){for(let C=0;C<I.blocks.length;C++){let S=I.blocks[C],D=B.blocks[C];if(!S||S.kind!=="paragraph"||!D||D.kind!=="paragraph")continue;let E=S,T=D,M=me(E,T,r,s),L=0;for(let{line:_,index:V}of M){let v=W(E,_);if(v.pmStart===void 0||v.pmEnd===void 0)continue;let Z=Math.max(v.pmStart,r),ee=Math.min(v.pmEnd,s);if(Z>=ee)continue;let ke=N(E,_,Z),Fe=N(E,_,ee),te=z(E,_,ke,B.width),ne=z(E,_,Fe,B.width),Pe=G(T,V);i.push({x:b.x+w+Math.min(te,ne),y:b.y+F+L+Pe+f,width:Math.max(1,Math.abs(ne-te)),height:_.lineHeight,pageIndex:l});}L+=T.totalHeight;}w+=B.width;}}F+=H.height;}}if(c.kind==="image"){let h=c.pmStart??0;(c.pmEnd??h+1)>r&&h<s&&i.push({x:c.x,y:c.y+f,width:c.width,height:c.height,pageIndex:l});}}}return i}function _e(e,t,a,o){for(let n=0;n<e.pages.length;n++){let r=e.pages[n],s=A(e,n);for(let i of r.fragments){if(i.kind==="paragraph"){let l=Q(t,i.blockId);if(l===-1)continue;let u=t[l],f=a[l];if(!u||u.kind!=="paragraph"||!f||f.kind!=="paragraph")continue;let c=u,h=f,p=i,m=c.pmStart??0,g=c.pmEnd??m;if(o<m||o>g)continue;for(let d=p.fromLine;d<p.toLine;d++){let b=h.lines[d];if(!b)continue;let x=W(c,b);if(!(x.pmStart===void 0||x.pmEnd===void 0)&&o>=x.pmStart&&o<=x.pmEnd){let k=N(c,b,o),F=c.attrs?.indent,P=F?.left??0,y=F?.right??0,H=Math.max(0,i.width-P-y),w=z(c,b,k),R=c.attrs?.alignment??"left",I=0;R==="center"?I=Math.max(0,(H-b.width)/2):R==="right"&&(I=Math.max(0,H-b.width));let B=G(h,d)-G(h,p.fromLine);return {x:i.x+P+I+w,y:i.y+B+s,height:b.lineHeight,pageIndex:n}}}}if(i.kind==="image"){let l=i.pmStart??0,u=i.pmEnd??l+1;if(o>=l&&o<=u){let f=o===l?0:i.width;return {x:i.x+f,y:i.y+s,height:i.height,pageIndex:n}}}}}return null}function Ae(e){return e.length<=1?false:new Set(e.map(a=>a.pageIndex)).size>1}function Oe(e){let t=new Map;for(let a of e){let o=t.get(a.pageIndex)??[];o.push(a),t.set(a.pageIndex,o);}return t}function Xe(e){if(e.kind!=="paragraph")return false;let t=e.attrs;return t?!!(t.borders?.top||t.borders?.bottom||t.spacingExplicit?.before||t.spacingExplicit?.after):false}function de(e){return he(e)}function he(e){let t=new Set;for(let a=1;a<e.length;a++){let o=e[a-1],n=e[a];o.kind==="table"&&n.kind==="paragraph"&&(n.runs.length>0||Xe(n)||t.add(a));}return e.map((a,o)=>{if(a.kind==="table")return ve(a);if(a.kind!=="paragraph")return a;let n=t.has(o),r=a.attrs?.spacingExplicit,s=a.attrs?.spacing?.before!=null,i=a.attrs?.spacing?.after!=null,l=s&&!r?.before,u=i&&!r?.after,f=l||u;if(!f&&!n)return a;let c=a.attrs;return f&&c?.spacing&&(c={...c,spacing:{...c.spacing,before:r?.before?c.spacing.before:void 0,after:r?.after?c.spacing.after:void 0}}),n&&(c={...c??{},suppressEmptyParagraphHeight:true}),{...a,attrs:c}})}function ve(e){let t=false,a=e.rows.map(o=>{let n=false,r=o.cells.map(s=>{let i=he(s.blocks);return i.some((u,f)=>u!==s.blocks[f])?(n=true,{...s,blocks:i}):s});return n?(t=true,{...o,cells:r}):o});return t?{...e,rows:a}:e}function Ye(e){return e?.align??e?.alignment}function pe(e,t,a,o){let n=o.section==="header"?o.margins.header??48:o.pageSize.h-(o.margins.footer??48)-a,r=e.position?.vertical;if(!r)return t;let s=Ye(r),i=r.posOffset!==void 0?chunk4Q2IP5FW_js.e(r.posOffset):void 0;if(r.relativeTo==="page"){if(i!==void 0)return i-n;if(s==="top")return -n;if(s==="bottom")return o.pageSize.h-e.height-n;if(s==="center")return (o.pageSize.h-e.height)/2-n}if(r.relativeTo==="margin"){let l=o.margins.top,u=o.pageSize.h-o.margins.top-o.margins.bottom;if(i!==void 0)return l+i-n;if(s==="top")return l-n;if(s==="bottom")return l+u-e.height-n;if(s==="center")return l+(u-e.height)/2-n}return i!==void 0?t+i:t}function be(e,t,a,o){let n=0,r=a,s=0;for(let i=0;i<e.length;i++){let l=e[i],u=t[i];if(!(!l||!u)){if(l.kind==="paragraph"&&u.kind==="paragraph"){let f=s,c=f+u.totalHeight;n=Math.min(n,f),r=Math.max(r,c);for(let h of l.runs){if(h.kind!=="image"||!h.position)continue;let p=pe(h,f,a,o);n=Math.min(n,p),r=Math.max(r,p+h.height);}s=c;}else if(l.kind==="table"&&u.kind==="table"){let f=s+u.totalHeight;n=Math.min(n,s),r=Math.max(r,f),s=f;}else if(l.kind==="image"&&u.kind==="image"){let f=s+u.height;n=Math.min(n,s),r=Math.max(r,f),s=f;}else if(l.kind==="textBox"&&u.kind==="textBox"){let f=s+u.height;n=Math.min(n,s),r=Math.max(r,f),s=f;}}}return {visualTop:n,visualBottom:r}}function Ne(e,t,a,o){if(!e||!e.content||e.content.length===0)return;let n=chunk7AMYZMCX_js.b(e.content,{styles:o.styles??void 0,theme:o.theme??null,defaultTabStopTwips:o.defaultTabStopTwips??null});return xe(n,t,a,o)}function xe(e,t,a,o){let n=chunkHKVAW3RE_js.c(e,{theme:o.theme??void 0});if(n.length===0)return;let r=de(n),s=o.measureBlocks(r,t),i=s.reduce((f,c)=>c.kind==="paragraph"||c.kind==="table"?f+c.totalHeight:c.kind==="image"||c.kind==="textBox"?f+c.height:f,0),{visualTop:l,visualBottom:u}=be(n,s,i,a);return {blocks:r,measures:s,height:i,visualTop:l,visualBottom:u}}var Y=null;function ze(){Y=null;}function Te(e){if(Y&&Y.host.isConnected)return Y;let t=e.querySelector(".layout-page-header, .layout-page-footer");if(!t)return null;let a=Array.from(t.querySelectorAll("span[data-pm-start][data-pm-end]")),o=Array.from(t.querySelectorAll("[data-pm-start][data-pm-end]"));return Y={host:t,spans:a,ranged:o},Y}function Ge(e,t=globalThis.document){let a=e.state.selection;if(!a.empty)return null;let o=a.head,n=Te(t);if(!n)return null;let{host:r,spans:s}=n;for(let m of s){let g=Number(m.dataset.pmStart),d=Number(m.dataset.pmEnd);if(!(!Number.isFinite(g)||!Number.isFinite(d))&&o>=g&&o<=d){let b=r.ownerDocument.createRange(),x=r.ownerDocument.createTreeWalker(m,NodeFilter.SHOW_TEXT),k=o-g,F=x.nextNode();for(;F;){let H=F.data.length;if(k<=H){try{b.setStart(F,k),b.setEnd(F,k);let w=b.getClientRects()[0]??b.getBoundingClientRect();if(w&&w.height>0)return {top:w.top,left:w.left,height:w.height}}catch{}break}k-=H,F=x.nextNode();}let P=m.getBoundingClientRect(),y=(o-g)/Math.max(1,d-g);return {top:P.top,left:P.left+P.width*y,height:P.height}}}let i=r.querySelector(`[data-pm-start="${o}"]`);if(i){let m=i.getBoundingClientRect();return {top:m.top,left:m.left+1,height:m.height||16}}let l=n.ranged,u=null,f=1/0;for(let m of l){let g=Number(m.dataset.pmStart),d=Number(m.dataset.pmEnd);if(!Number.isFinite(g)||!Number.isFinite(d)||o<g||o>d)continue;let b=d-g;b<f&&(f=b,u=m);}if(u){let m=u.getBoundingClientRect(),g=Number(u.dataset.pmEnd),d=o>=g;return {top:m.top,left:d?m.right:m.left+1,height:m.height||16}}let c=null,h=-1/0;for(let m of l){let g=Number(m.dataset.pmStart);Number.isFinite(g)&&(g>o||g>h&&(h=g,c=m));}if(c){let m=c.getBoundingClientRect();return {top:m.top,left:m.right,height:m.height||16}}let p=r.getBoundingClientRect();return {top:p.top+2,left:p.left+2,height:16}}function We(e,t=globalThis.document){let a=e.state.selection;if(a.empty)return [];let o=a.from,n=a.to,r=[],s=Te(t);if(!s)return r;let{host:i,spans:l}=s;for(let u of l){let f=Number(u.dataset.pmStart),c=Number(u.dataset.pmEnd);if(!Number.isFinite(f)||!Number.isFinite(c)||c<=o||f>=n)continue;if(u.classList.contains("layout-run-tab")){let d=u.getBoundingClientRect();r.push({top:d.top,left:d.left,width:d.width,height:d.height});continue}let h=null;if(u.firstChild?.nodeType===Node.TEXT_NODE?h=u.firstChild:u.firstChild?.nodeType===Node.ELEMENT_NODE&&u.firstChild.tagName==="A"&&u.firstChild.firstChild?.nodeType===Node.TEXT_NODE&&(h=u.firstChild.firstChild),!h)continue;let p=Math.max(0,o-f),m=Math.min(h.length,n-f);if(p>=m)continue;let g=i.ownerDocument.createRange();g.setStart(h,p),g.setEnd(h,m);for(let d of Array.from(g.getClientRects()))r.push({top:d.top,left:d.left,width:d.width,height:d.height});}return r}var Ue=816,Ve=1056,qe=96,je=48;function O(e){return Math.round(e/1440*96)}function $e(e){return {w:e?.pageWidth?O(e.pageWidth):816,h:e?.pageHeight?O(e.pageHeight):1056}}function Je(e){return {top:e?.marginTop?O(e.marginTop):96,right:e?.marginRight?O(e.marginRight):96,bottom:e?.marginBottom?O(e.marginBottom):96,left:e?.marginLeft?O(e.marginLeft):96,header:e?.headerDistance?O(e.headerDistance):48,footer:e?.footerDistance?O(e.footerDistance):48}}function Ke(e,t){let a={header:null,footer:null,firstHeader:null,firstFooter:null};if(!e?.package)return a;let o=e.package.headers,n=e.package.footers,r=null,s=null,i=null,l=null;if(o&&t?.headerReferences){let u=t.headerReferences.find(c=>c.type==="default");u?.rId&&(r=o.get(u.rId)??null);let f=t.headerReferences.find(c=>c.type==="first");f?.rId&&(i=o.get(f.rId)??null);}if(n&&t?.footerReferences){let u=t.footerReferences.find(c=>c.type==="default");u?.rId&&(s=n.get(u.rId)??null);let f=t.footerReferences.find(c=>c.type==="first");f?.rId&&(l=n.get(f.rId)??null);}return t?.titlePg||(!r&&i&&(r=i),!s&&l&&(s=l)),{header:r,footer:s,firstHeader:i,firstFooter:l}}exports.A=We;exports.B=Ue;exports.C=Ve;exports.D=qe;exports.E=je;exports.F=$e;exports.G=Je;exports.H=Ke;exports.a=j;exports.b=A;exports.c=Me;exports.d=ae;exports.e=He;exports.f=se;exports.g=we;exports.h=Re;exports.i=Be;exports.j=Ie;exports.k=K;exports.l=ue;exports.m=Le;exports.n=fe;exports.o=Ce;exports.p=De;exports.q=_e;exports.r=Ae;exports.s=Oe;exports.t=de;exports.u=pe;exports.v=be;exports.w=Ne;exports.x=xe;exports.y=ze;exports.z=Ge;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkJFZIXFRC_js=require('./chunk-JFZIXFRC.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js');function l(t){return !!t.wrap&&t.wrap.type!=="inline"}function c(t){let i=t.wrap?.type??"inline",e=t.wrap?.wrapText,a=t.position?.horizontal?.alignment;return {displayMode:s(i),cssFloat:d(i,e,a),wrapType:i,wrapText:e,anchorTarget:l(t)?"followingBlock":void 0,position:t.position?f(t.position):void 0,distTop:t.wrap?.distT!=null?chunk4Q2IP5FW_js.e(t.wrap.distT):void 0,distBottom:t.wrap?.distB!=null?chunk4Q2IP5FW_js.e(t.wrap.distB):void 0,distLeft:t.wrap?.distL!=null?chunk4Q2IP5FW_js.e(t.wrap.distL):void 0,distRight:t.wrap?.distR!=null?chunk4Q2IP5FW_js.e(t.wrap.distR):void 0}}function m(t){return t.anchorTarget==="followingBlock"||p(t)}function x(t){let i=t.position;if(!(!i?.horizontal&&!i?.vertical))return {horizontal:{relativeTo:i.horizontal?.relativeTo??"margin",alignment:i.horizontal?.align,posOffset:i.horizontal?.posOffset},vertical:{relativeTo:i.vertical?.relativeTo??"paragraph",alignment:i.vertical?.align,posOffset:i.vertical?.posOffset}}}function h(t){let i=t.wrapType??(t.displayMode==="float"?"square":"inline");if(!i||i==="inline")return;let e={type:i};return t.wrapText&&(e.wrapText=t.wrapText),t.distTop!=null&&(e.distT=chunk4Q2IP5FW_js.f(t.distTop)),t.distBottom!=null&&(e.distB=chunk4Q2IP5FW_js.f(t.distBottom)),t.distLeft!=null&&(e.distL=chunk4Q2IP5FW_js.f(t.distLeft)),t.distRight!=null&&(e.distR=chunk4Q2IP5FW_js.f(t.distRight)),e}function s(t){return t==="inline"?"inline":t==="topAndBottom"?"block":"float"}function p(t){return t.displayMode==="float"||chunkJFZIXFRC_js.a(t.wrapType)}function d(t,i,e){return t==="inline"||t==="topAndBottom"?"none":i==="left"?"right":i==="right"||e==="left"?"left":e==="right"?"right":"none"}function f(t){return {horizontal:t.horizontal?{relativeTo:t.horizontal.relativeTo,posOffset:t.horizontal.posOffset,align:t.horizontal.alignment}:void 0,vertical:t.vertical?{relativeTo:t.vertical.relativeTo,posOffset:t.vertical.posOffset,align:t.vertical.alignment}:void 0}}exports.a=l;exports.b=c;exports.c=m;exports.d=x;exports.e=h;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-QYUPLKLP.mjs';var o=class{constructor(t){a(this,"listeners",new Set);a(this,"snapshot");a(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t);}));a(this,"getSnapshot",()=>this.snapshot);this.snapshot=t;}setSnapshot(t){this.snapshot=t,this.notify();}notify(){for(let t of this.listeners)t();}};export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var h=Object.defineProperty;var f=a=>{throw TypeError(a)};var i=(a,b,c)=>b in a?h(a,b,{enumerable:true,configurable:true,writable:true,value:c}):a[b]=c;var l=(a,b,c)=>i(a,typeof b!="symbol"?b+"":b,c),e=(a,b,c)=>b.has(a)||f("Cannot "+c);var j=(a,b,c)=>(e(a,b,"read from private field"),c?c.call(a):b.get(a)),m=(a,b,c)=>b.has(a)?f("Cannot add the same private member more than once"):b instanceof WeakSet?b.add(a):b.set(a,c),k=(a,b,c,d)=>(e(a,b,"write to private field"),d?d.call(a,c):b.set(a,c),c),n=(a,b,c)=>(e(a,b,"access private method"),c);var o=(a,b,c,d)=>({set _(g){k(a,b,g,c);},get _(){return j(a,b,d)}});exports.a=l;exports.b=j;exports.c=m;exports.d=k;exports.e=n;exports.f=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';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).`)}exports.a=n;exports.b=o;exports.c=a;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var xmlJs=require('xml-js');var a=/&(?!(?:[A-Za-z][A-Za-z0-9]*|#[0-9]+|#x[0-9a-fA-F]+);)/g;function d(e){return e.replace(a,"&")}function p(e){let t=d(e);try{return xmlJs.xml2js(t,{compact:!1,ignoreComment:!0,ignoreInstruction:!0,ignoreDoctype:!0,alwaysArray:!1,trim:!1,captureSpacesBetweenElements:!0,attributesKey:"attributes",textKey:"text"})}catch(n){if(!(n instanceof Error))throw n;let l=n.message.match(/Column:\s*(\d+)/);if(l){let r=parseInt(l[1],10),i=Math.max(0,r-30),m=JSON.stringify(t.slice(i,r+30)),o=new Error(`${n.message}
|
|
2
|
+
Near: ${m}`);throw o.stack=n.stack,o}throw n}}function w(e){return xmlJs.js2xml({elements:[e]},{compact:false,spaces:0})}function X(e){try{let t=p(e);return t.elements&&t.elements.length>0?t.elements.find(n=>n.type==="element")??null:t}catch(t){return console.warn("Failed to parse XML:",t),null}}function s(e){let t=e.indexOf(":");return t>=0?e.substring(t+1):e}function g(e,t,n){if(!e.name)return false;let l=`${t}:${n}`;return e.name===l||s(e.name)===n}function y(e,t,n){if(!e||!e.elements)return null;let l=`${t}:${n}`;for(let r of e.elements)if(r.type==="element"&&(r.name===l||s(r.name||"")===n))return r;return null}function b(e,t,n){if(!e||!e.elements)return [];let l=`${t}:${n}`,r=[];for(let i of e.elements)i.type==="element"&&(i.name===l||s(i.name||"")===n)&&r.push(i);return r}function A(e,t){return !e||!e.elements?[]:e.elements.filter(n=>n.type==="element"&&s(n.name||"")===t)}function C(e,t){if(!e||!e.elements)return null;for(let n of e.elements)if(n.type==="element"&&n.name===t)return n;return null}function N(e){return !e||!e.elements?[]:e.elements.filter(t=>t.type==="element")}function u(e,t,n){if(!e||!e.attributes)return null;let l=e.attributes;if(t){let r=`${t}:${n}`;if(r in l)return l[r]}return n in l?l[n]:null}function h(e){if(!e)return "";if("text"in e&&typeof e.text=="string")return e.text;if(!e.elements)return "";let t="";for(let n of e.elements)n.type==="text"&&"text"in n?t+=n.text??"":n.type==="element"&&(t+=h(n));return t}function v(e,t,n,l=1){let r=u(e,t,n);if(r===null)return;let i=parseInt(r,10);if(!isNaN(i))return i*l}function S(e,t="w"){if(!e)return false;let n=u(e,t,"val");return n===null?true:!(n==="0"||n==="false"||n==="off")}function x(e,t,n){if(!e)return null;if(g(e,t,n))return e;if(e.elements)for(let l of e.elements){if(l.type!=="element")continue;let r=x(l,t,n);if(r)return r}return null}exports.a=p;exports.b=w;exports.c=X;exports.d=s;exports.e=y;exports.f=b;exports.g=A;exports.h=C;exports.i=N;exports.j=u;exports.k=h;exports.l=v;exports.m=S;exports.n=x;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkSHJBS42Y_js=require('./chunk-SHJBS42Y.js'),chunkYTDWMXNS_js=require('./chunk-YTDWMXNS.js');function y(e){return chunkYTDWMXNS_js.e(e,chunkSHJBS42Y_js.b)}var t=chunkSHJBS42Y_js.a.getCommands(),F=t.toggleBold(),f=t.toggleItalic(),S=t.toggleUnderline(),H=t.toggleStrike(),T=t.toggleSuperscript(),h=t.toggleSubscript();function M(e){return t.setTextColor(e)}var A=t.clearTextColor();function v(e){return t.setHighlight(e)}var z=t.clearHighlight();function U(e){return t.setFontSize(e)}var b=t.clearFontSize();function B(e){return t.setFontFamily(e)}var I=t.clearFontFamily();function R(e,o){return t.setUnderlineStyle(e,o)}function _(e,o){return t.setHyperlink(e,o)}var j=t.removeHyperlink();function q(e,o,i){return t.insertHyperlink(e,o,i)}exports.a=y;exports.b=F;exports.c=f;exports.d=S;exports.e=H;exports.f=T;exports.g=h;exports.h=M;exports.i=A;exports.j=v;exports.k=z;exports.l=U;exports.m=b;exports.n=B;exports.o=I;exports.p=R;exports.q=_;exports.r=j;exports.s=q;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkHQPWFUP5_js=require('./chunk-HQPWFUP5.js'),chunkDV6GWBUJ_js=require('./chunk-DV6GWBUJ.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js');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=chunkDV6GWBUJ_js.i(n),i=t.find(r=>r.name==="a:shade");if(i){let r=chunkDV6GWBUJ_js.j(i,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=chunkDV6GWBUJ_js.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=chunkDV6GWBUJ_js.i(e),t=n.find(l=>l.name==="a:srgbClr");if(t){let l=chunkDV6GWBUJ_js.j(t,null,"val");if(l)return J({rgb:l},t)}let i=n.find(l=>l.name==="a:schemeClr");if(i){let l=chunkDV6GWBUJ_js.j(i,null,"val");if(l){let u={themeColor:pe[l]??"dk1"};return J(u,i)}}let o=n.find(l=>l.name==="a:sysClr");if(o)return {rgb:chunkDV6GWBUJ_js.j(o,null,"lastClr")??"000000"};let r=n.find(l=>l.name==="a:prstClr");if(r){let l=chunkDV6GWBUJ_js.j(r,null,"val");if(l&&G[l])return {rgb:G[l]}}}function N(e){if(!e)return;let n=chunkDV6GWBUJ_js.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?chunkDV6GWBUJ_js.h(e,"a:ln"):null;if(!n)return;let t=chunkDV6GWBUJ_js.i(n);if(t.find(u=>u.name==="a:noFill"))return;let i={},o=chunkDV6GWBUJ_js.j(n,null,"w");o&&(i.width=parseInt(o,10));let r=t.find(u=>u.name==="a:solidFill");r&&(i.color=K(r));let l=t.find(u=>u.name==="a:prstDash");if(l){let u=chunkDV6GWBUJ_js.j(l,null,"val");u&&(i.style=u);}return i}function L(e){if(!e)return;let n=chunkDV6GWBUJ_js.j(e,null,"relativeFrom")??"column",t=chunkDV6GWBUJ_js.h(e,"wp:align");if(t){let o=chunkDV6GWBUJ_js.k(t);return {relativeTo:n,alignment:o}}let i=chunkDV6GWBUJ_js.h(e,"wp:posOffset");if(i){let o=chunkDV6GWBUJ_js.k(i),r=parseInt(o,10);return {relativeTo:n,posOffset:isNaN(r)?0:r}}return {relativeTo:n}}function z(e){if(!e)return;let n=chunkDV6GWBUJ_js.j(e,null,"relativeFrom")??"paragraph",t=chunkDV6GWBUJ_js.h(e,"wp:align");if(t){let o=chunkDV6GWBUJ_js.k(t);return {relativeTo:n,alignment:o}}let i=chunkDV6GWBUJ_js.h(e,"wp:posOffset");if(i){let o=chunkDV6GWBUJ_js.k(i),r=parseInt(o,10);return {relativeTo:n,posOffset:isNaN(r)?0:r}}return {relativeTo:n}}function Q(e){let n=chunkDV6GWBUJ_js.h(e,"wp:positionH"),t=chunkDV6GWBUJ_js.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={type:r},u=chunkDV6GWBUJ_js.j(e,null,"wrapText");u&&(l.wrapText=u);let s=chunkDV6GWBUJ_js.l(e,null,"distT")??t?.distT,c=chunkDV6GWBUJ_js.l(e,null,"distB")??t?.distB,m=chunkDV6GWBUJ_js.l(e,null,"distL")??t?.distL,g=chunkDV6GWBUJ_js.l(e,null,"distR")??t?.distR;return s!==void 0&&(l.distT=s),c!==void 0&&(l.distB=c),m!==void 0&&(l.distL=m),g!==void 0&&(l.distR=g),l}function Y(e){let n=chunkDV6GWBUJ_js.i(e),t=chunkDV6GWBUJ_js.j(e,null,"behindDoc")==="1",i=n.find(r=>W.includes(r.name??"")),o={distT:chunkDV6GWBUJ_js.l(e,null,"distT")??void 0,distB:chunkDV6GWBUJ_js.l(e,null,"distB")??void 0,distL:chunkDV6GWBUJ_js.l(e,null,"distL")??void 0,distR:chunkDV6GWBUJ_js.l(e,null,"distR")??void 0};return D(i??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=chunkDV6GWBUJ_js.l(e,null,"lIns"),i=chunkDV6GWBUJ_js.l(e,null,"rIns"),o=chunkDV6GWBUJ_js.l(e,null,"tIns"),r=chunkDV6GWBUJ_js.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=chunkDV6GWBUJ_js.g(e,"p"),t=chunkDV6GWBUJ_js.g(e,"tbl");return {paragraphElements:n,tableElements:t}}function Be(e,n,t,i,o,r,l,u){if(!e)return [];let s=[],c=chunkDV6GWBUJ_js.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,o,r,l);s.push(b);}}return s}function ee(e){let t=chunkDV6GWBUJ_js.i(e).find(u=>u.name==="wp:inline"||u.name==="wp:anchor");if(!t)return false;let i=chunkDV6GWBUJ_js.h(t,"a:graphic");if(!i)return false;let o=chunkDV6GWBUJ_js.h(i,"a:graphicData");if(!o)return false;let r=chunkDV6GWBUJ_js.h(o,"wps:wsp");return r?chunkDV6GWBUJ_js.h(r,"wps:txbx")!==null:false}function Ce(e){return chunkDV6GWBUJ_js.h(e,"wps:txbx")!==null}function Me(e){let t=chunkDV6GWBUJ_js.i(e).find(x=>x.name==="wp:inline"||x.name==="wp:anchor");if(!t)return null;let i=t.name==="wp:anchor",o=chunkDV6GWBUJ_js.h(t,"a:graphic");if(!o)return null;let r=chunkDV6GWBUJ_js.h(o,"a:graphicData");if(!r)return null;let l=chunkDV6GWBUJ_js.h(r,"wps:wsp");if(!l||!chunkDV6GWBUJ_js.h(l,"wps:txbx"))return null;let s=chunkDV6GWBUJ_js.i(l),c=s.find(x=>x.name==="wps:spPr"),m=s.find(x=>x.name==="wps:bodyPr"),g=chunkDV6GWBUJ_js.h(t,"wp:extent"),p=chunkDV6GWBUJ_js.l(g,null,"cx")??0,T=chunkDV6GWBUJ_js.l(g,null,"cy")??0,b={width:p,height:T},C=chunkDV6GWBUJ_js.h(t,"wp:docPr"),P=C?chunkDV6GWBUJ_js.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){let x=Q(t);x&&(y.position=x);let h=Y(t);h&&(y.wrap=h);}return y}function Re(e){let n=chunkDV6GWBUJ_js.h(e,"wps:txbx");return n?chunkDV6GWBUJ_js.h(n,"w:txbxContent"):null}function Xe(e,n,t,i){if(!chunkDV6GWBUJ_js.h(e,"wps:txbx"))return null;let r=chunkDV6GWBUJ_js.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?chunkDV6GWBUJ_js.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&&(T.wrap=i),T}function ke(e){return chunk4Q2IP5FW_js.e(e.size.width)}function Ae(e){return chunk4Q2IP5FW_js.e(e.size.height)}function Oe(e){return {width:chunk4Q2IP5FW_js.e(e.size.width),height:chunk4Q2IP5FW_js.e(e.size.height)}}function Ne(e){let n=e.margins;return {top:chunk4Q2IP5FW_js.e(n?.top??k),bottom:chunk4Q2IP5FW_js.e(n?.bottom??k),left:chunk4Q2IP5FW_js.e(n?.left??k),right:chunk4Q2IP5FW_js.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){return e.outline?.width?chunk4Q2IP5FW_js.e(e.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=chunkDV6GWBUJ_js.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=chunkDV6GWBUJ_js.l(e,null,"cx")??0,t=chunkDV6GWBUJ_js.l(e,null,"cy")??0;return {width:n,height:t}}function te(e){if(!e)return;let n=chunkDV6GWBUJ_js.l(e,null,"l")??0,t=chunkDV6GWBUJ_js.l(e,null,"t")??0,i=chunkDV6GWBUJ_js.l(e,null,"r")??0,o=chunkDV6GWBUJ_js.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=chunkDV6GWBUJ_js.j(e,null,"id")??void 0,t=chunkDV6GWBUJ_js.j(e,null,"name")??void 0,i=chunkDV6GWBUJ_js.j(e,null,"descr")??void 0,o=chunkDV6GWBUJ_js.j(e,null,"title")??void 0,r=chunkDV6GWBUJ_js.j(e,null,"decorative")==="1",l=chunkDV6GWBUJ_js.e(e,"a","hlinkClick"),u=l?chunkDV6GWBUJ_js.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=chunkDV6GWBUJ_js.j(e,null,"rot"),t=chunkDV6GWBUJ_js.j(e,null,"flipH")==="1",i=chunkDV6GWBUJ_js.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=chunkDV6GWBUJ_js.h(e,"a:graphic");if(!n)return {blipFill:null,blip:null};let t=chunkDV6GWBUJ_js.h(n,"a:graphicData");if(!t)return {blipFill:null,blip:null};let i=chunkDV6GWBUJ_js.h(t,"pic:pic");if(!i)return {blipFill:null,blip:null};let o=chunkDV6GWBUJ_js.h(i,"pic:blipFill");return o?{blipFill:o,blip:chunkDV6GWBUJ_js.h(o,"a:blip")}:{blipFill:null,blip:null}}function le(e){if(!e)return;let n=chunkDV6GWBUJ_js.h(e,"a:srcRect");if(!n)return;let t=s=>{let c=chunkDV6GWBUJ_js.l(n,null,s);if(!(c===void 0||c===0))return c/1e5},i=t("l"),o=t("t"),r=t("r"),l=t("b");if(i===void 0&&o===void 0&&r===void 0&&l===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!==void 0&&(u.bottom=l),u}function ae(e){if(!e)return;let n=chunkDV6GWBUJ_js.h(e,"a:alphaModFix");if(!n)return;let t=chunkDV6GWBUJ_js.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=chunkDV6GWBUJ_js.j(e,"r","embed");if(n)return n;let t=chunkDV6GWBUJ_js.j(e,null,"embed");if(t)return t;let i=chunkDV6GWBUJ_js.j(e,"r","link");return i||""}function ue(e){let n=chunkDV6GWBUJ_js.h(e,"a:graphic");if(!n)return null;let t=chunkDV6GWBUJ_js.h(n,"a:graphicData");if(!t)return null;let i=chunkDV6GWBUJ_js.h(t,"pic:pic");if(!i)return null;let o=chunkDV6GWBUJ_js.h(i,"pic:spPr");return o?chunkDV6GWBUJ_js.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=chunkDV6GWBUJ_js.h(e,"wp:extent"),o=ne(i),r=chunkDV6GWBUJ_js.h(e,"wp:effectExtent"),l=te(r),u=chunkDV6GWBUJ_js.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=chunkDV6GWBUJ_js.l(e,null,"distT")??void 0,B=chunkDV6GWBUJ_js.l(e,null,"distB")??void 0,E=chunkDV6GWBUJ_js.l(e,null,"distL")??void 0,y=chunkDV6GWBUJ_js.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={type:"image",rId:g,size:o,wrap:x};if(s.id&&(h.id=s.id),s.alt&&(h.alt=s.alt),s.title&&(h.title=s.title),s.decorative&&(h.decorative=true),b.src&&(h.src=b.src),b.mimeType&&(h.mimeType=b.mimeType),b.filename&&(h.filename=b.filename),l&&(h.padding=l),P&&(h.transform=P),p&&(h.crop=p),T!==void 0&&(h.opacity=T),s.hlinkRId&&n){let X=chunkHQPWFUP5_js.d(n,s.hlinkRId);X&&(h.hlinkHref=X);}return h}function be(e,n,t){let i=chunkDV6GWBUJ_js.h(e,"wp:extent"),o=ne(i),r=chunkDV6GWBUJ_js.h(e,"wp:effectExtent"),l=te(r),u=chunkDV6GWBUJ_js.h(e,"wp:docPr"),s=ie(u),c=chunkDV6GWBUJ_js.j(e,null,"behindDoc")==="1",m=chunkDV6GWBUJ_js.j(e,null,"layoutInCell"),g=m===null?void 0:m==="1",p=chunkDV6GWBUJ_js.j(e,null,"allowOverlap"),T=p===null?void 0:p==="1",b={distT:chunkDV6GWBUJ_js.l(e,null,"distT")??void 0,distB:chunkDV6GWBUJ_js.l(e,null,"distB")??void 0,distL:chunkDV6GWBUJ_js.l(e,null,"distL")??void 0,distR:chunkDV6GWBUJ_js.l(e,null,"distR")??void 0},C=ge(e,W),P=D(C,c,b),v=chunkDV6GWBUJ_js.h(e,"wp:positionH"),B=chunkDV6GWBUJ_js.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,blipFill:X}=oe(e),V=se(h),_=le(X),U=ae(h),M=de(V,n,t),fe=ue(e),j=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&&(I.padding=l),j&&(I.transform=j),_&&(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=chunkHQPWFUP5_js.d(n,s.hlinkRId);q&&(I.hlinkHref=q);}return I}function we(e,n,t){if(ee(e))return null;let i=chunkDV6GWBUJ_js.i(e);for(let o of i){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){return chunk4Q2IP5FW_js.e(e.size.width)}function rn(e){return chunk4Q2IP5FW_js.e(e.size.height)}function on(e){return e.decorative===true}function ln(e){return {top:chunk4Q2IP5FW_js.e(e.wrap.distT),bottom:chunk4Q2IP5FW_js.e(e.wrap.distB),left:chunk4Q2IP5FW_js.e(e.wrap.distL),right:chunk4Q2IP5FW_js.e(e.wrap.distR)}}exports.A=Ye;exports.B=Ze;exports.C=en;exports.D=nn;exports.E=tn;exports.F=rn;exports.G=on;exports.H=ln;exports.a=K;exports.b=N;exports.c=Q;exports.d=Y;exports.e=H;exports.f=ve;exports.g=Be;exports.h=ee;exports.i=Ce;exports.j=Me;exports.k=Re;exports.l=Xe;exports.m=ke;exports.n=Ae;exports.o=Oe;exports.p=Ne;exports.q=Se;exports.r=Le;exports.s=ze;exports.t=We;exports.u=De;exports.v=He;exports.w=Ve;exports.x=_e;exports.y=we;exports.z=Qe;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use strict';var chunkFRYMBAHP_js=require('./chunk-FRYMBAHP.js'),chunkHQPWFUP5_js=require('./chunk-HQPWFUP5.js'),y=require('jszip');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var y__default=/*#__PURE__*/_interopDefault(y);var j=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"></Relationships>`;function E(r){return r.startsWith("/")?r.slice(1):`word/${r}`}function P(r){let e=[{relsPath:"word/_rels/document.xml.rels",blocks:r.package.document.content}],t=r.package.relationships;if(!t)return e;let o=(n,c)=>{if(n)for(let[a,s]of n.entries()){let i=t.get(a);if(!i||i.type!==c||!i.target)continue;let l=E(i.target).replace(/^word\//,"");e.push({relsPath:`word/_rels/${l}.rels`,blocks:s.content});}};return o(r.package.headers,chunkHQPWFUP5_js.a.header),o(r.package.footers,chunkHQPWFUP5_js.a.footer),e}async function T(r,e){let t=r.file(e);return (t?await t.async("text"):j).replace(/<Relationships([^>]*)\/>/,"<Relationships$1></Relationships>")}function g(r){let e=0;for(let t of r.matchAll(/Id="rId(\d+)"/g)){let o=parseInt(t[1],10);o>e&&(e=o);}return e}function D(r,e){return e||{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",tif:"image/tiff",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp",wmf:"image/x-wmf",emf:"image/x-emf"}[r]||"application/octet-stream"}function k(r){let e=[];for(let t of r)if(t.type==="paragraph"){for(let o of t.content)if(o.type==="run")for(let n of o.content)n.type==="drawing"&&n.image.src?.startsWith("data:")&&e.push(n.image);}else if(t.type==="table")for(let o of t.rows)for(let n of o.cells)e.push(...k(n.content));return e}var W={"image/png":"png","image/jpeg":"jpeg","image/gif":"gif","image/bmp":"bmp","image/tiff":"tiff","image/webp":"webp","image/svg+xml":"svg"};function z(r){let e=r.match(/^data:([^;]+);base64,(.+)$/);if(!e)throw new Error("Invalid data URL");let t=atob(e[2]),o=new Uint8Array(t.length);for(let n=0;n<t.length;n++)o[n]=t.charCodeAt(n);return {data:o.buffer,extension:W[e[1]]||"png"}}async function q(r,e,t){if(e.size===0)return;let o=r.file("[Content_Types].xml");if(!o)return;let n=await o.async("text"),c=false;for(let a of e)if(!n.includes(`Extension="${a}"`)){let s=D(a,"");n=n.replace("</Types>",`<Default Extension="${a}" ContentType="${s}"/></Types>`),c=true;}c&&r.file("[Content_Types].xml",n,{compression:"DEFLATE",compressionOptions:{level:t}});}function V(r){let e=0;return r.forEach(t=>{let o=t.match(/^word\/media\/image(\d+)\./);if(o){let n=parseInt(o[1],10);n>e&&(e=n);}}),e}async function A(r,e,t){let o=V(e),n=new Set;for(let{relsPath:c,blocks:a}of r){let s=k(a);if(s.length===0)continue;let i=await T(e,c),p=g(i),l=[];for(let d of s){let{data:u,extension:x}=z(d.src);o++,p++;let v=`image${o}.${x}`,R=`rId${p}`;e.file(`word/media/${v}`,u,{compression:"DEFLATE",compressionOptions:{level:t}}),l.push(`<Relationship Id="${R}" Type="${chunkHQPWFUP5_js.a.image}" Target="media/${v}"/>`),n.add(x),d.rId=R;}let m=i.replace("</Relationships>",l.join("")+"</Relationships>");e.file(c,m,{compression:"DEFLATE",compressionOptions:{level:t}});}await q(e,n,t);}function S(r){let e=[];for(let t of r)if(t.type==="paragraph")for(let o of t.content)o.type==="hyperlink"&&o.href&&!o.rId&&!o.anchor&&e.push(o);else if(t.type==="table")for(let o of t.rows)for(let n of o.cells)e.push(...S(n.content));return e}async function I(r,e,t){for(let{relsPath:o,blocks:n}of r){let c=S(n);if(c.length===0)continue;let a=await T(e,o),s=g(a),i=[];for(let l of c){s++;let m=`rId${s}`;i.push(`<Relationship Id="${m}" Type="${chunkHQPWFUP5_js.a.hyperlink}" Target="${chunkFRYMBAHP_js.a(l.href)}" TargetMode="External"/>`),l.rId=m;}let p=a.replace("</Relationships>",i.join("")+"</Relationships>");e.file(o,p,{compression:"DEFLATE",compressionOptions:{level:t}});}}var G="application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",K="application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",L="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml",X="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml",Z="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsIds+xml",H="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtensible+xml";async function O(r,e,t){let o=r.package.relationships;if(!o)return;let n=[];for(let[p,l]of o){if(!l.target)continue;let m=l.type===chunkHQPWFUP5_js.a.header?G:l.type===chunkHQPWFUP5_js.a.footer?K:null;m&&n.push({rId:p,target:l.target.replace(/^(\/?word\/)/,""),contentType:m,relType:l.type});}if(n.length===0)return;let c=e.file("[Content_Types].xml");if(c){let p=await c.async("text"),l=false;for(let{target:m,contentType:d}of n){let u=`/word/${m}`;p.includes(`PartName="${u}"`)||(p=p.replace("</Types>",`<Override PartName="${u}" ContentType="${d}"/></Types>`),l=true);}l&&e.file("[Content_Types].xml",p,{compression:"DEFLATE",compressionOptions:{level:t}});}let a="word/_rels/document.xml.rels",s=await T(e,a),i=false;for(let{rId:p,relType:l,target:m}of n)s.includes(`Id="${p}"`)||(s=s.replace("</Relationships>",`<Relationship Id="${p}" Type="${l}" Target="${m}"/></Relationships>`),i=true);i&&e.file(a,s,{compression:"DEFLATE",compressionOptions:{level:t}});}async function Q(r,e){let t=[{partName:"/word/comments.xml",contentType:L,target:"comments.xml",relType:chunkHQPWFUP5_js.a.comments},{partName:"/word/commentsExtended.xml",contentType:X,target:"commentsExtended.xml",relType:chunkHQPWFUP5_js.a.commentsExtended},{partName:"/word/commentsIds.xml",contentType:Z,target:"commentsIds.xml",relType:chunkHQPWFUP5_js.a.commentsIds},{partName:"/word/commentsExtensible.xml",contentType:H,target:"commentsExtensible.xml",relType:chunkHQPWFUP5_js.a.commentsExtensible}],o=r.file("[Content_Types].xml");if(o){let a=await o.async("text"),s=false;for(let{partName:i,contentType:p}of t)a.includes(i)||(a=a.replace("</Types>",`<Override PartName="${i}" ContentType="${p}"/></Types>`),s=true);s&&r.file("[Content_Types].xml",a,{compression:"DEFLATE",compressionOptions:{level:e}});}let n="word/_rels/document.xml.rels",c=r.file(n);if(c){let a=await c.async("text"),s=false;for(let{target:i,relType:p}of t)if(!a.includes(i)){let l=`rId${g(a)+1}`;a=a.replace("</Relationships>",`<Relationship Id="${l}" Type="${p}" Target="${i}"/></Relationships>`),s=true;}s&&r.file(n,a,{compression:"DEFLATE",compressionOptions:{level:e}});}}async function b(r,e,t){let o=r.package.document.comments;if(!o||o.length===0)return;let{xml:n,paraInfos:c}=chunkFRYMBAHP_js.i(o);e.file("word/comments.xml",n,{compression:"DEFLATE",compressionOptions:{level:t}});let a=chunkFRYMBAHP_js.k(c);a&&e.file("word/commentsExtended.xml",a,{compression:"DEFLATE",compressionOptions:{level:t}});let s=chunkFRYMBAHP_js.l(c);s&&e.file("word/commentsIds.xml",s,{compression:"DEFLATE",compressionOptions:{level:t}});let i=chunkFRYMBAHP_js.m(c,o);i&&e.file("word/commentsExtensible.xml",i,{compression:"DEFLATE",compressionOptions:{level:t}}),await Q(e,t);}function U(r){let e=new Map,t=r.package.relationships;if(!t)return e;let o=[{map:r.package.headers,type:chunkHQPWFUP5_js.a.header},{map:r.package.footers,type:chunkHQPWFUP5_js.a.footer}];for(let{map:n,type:c}of o)if(n)for(let[a,s]of n.entries()){let i=t.get(a);i&&i.type===c&&i.target&&e.set(E(i.target),chunkFRYMBAHP_js.h(s));}return e}function F(r,e,t){let o={level:t};for(let[n,c]of U(r))e.file(n,c,{compression:"DEFLATE",compressionOptions:o});}async function C(){let r=new y__default.default;r.file("[Content_Types].xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
3
|
+
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
|
|
4
|
+
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
|
|
5
|
+
<Default Extension="xml" ContentType="application/xml"/>
|
|
6
|
+
<Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/>
|
|
7
|
+
<Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/>
|
|
8
|
+
<Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
|
|
9
|
+
<Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
|
|
10
|
+
</Types>`),r.file("_rels/.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
11
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
12
|
+
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/>
|
|
13
|
+
<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>
|
|
14
|
+
<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
|
|
15
|
+
</Relationships>`),r.file("word/_rels/document.xml.rels",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
16
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
17
|
+
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>
|
|
18
|
+
</Relationships>`),r.file("word/document.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
19
|
+
<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
|
|
20
|
+
<w:body>
|
|
21
|
+
<w:p>
|
|
22
|
+
<w:r>
|
|
23
|
+
<w:t></w:t>
|
|
24
|
+
</w:r>
|
|
25
|
+
</w:p>
|
|
26
|
+
<w:sectPr>
|
|
27
|
+
<w:pgSz w:w="12240" w:h="15840"/>
|
|
28
|
+
<w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/>
|
|
29
|
+
</w:sectPr>
|
|
30
|
+
</w:body>
|
|
31
|
+
</w:document>`),r.file("word/styles.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
32
|
+
<w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
|
|
33
|
+
<w:docDefaults>
|
|
34
|
+
<w:rPrDefault>
|
|
35
|
+
<w:rPr>
|
|
36
|
+
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri"/>
|
|
37
|
+
<w:sz w:val="22"/>
|
|
38
|
+
</w:rPr>
|
|
39
|
+
</w:rPrDefault>
|
|
40
|
+
<w:pPrDefault>
|
|
41
|
+
<w:pPr>
|
|
42
|
+
<w:spacing w:after="200" w:line="276" w:lineRule="auto"/>
|
|
43
|
+
</w:pPr>
|
|
44
|
+
</w:pPrDefault>
|
|
45
|
+
</w:docDefaults>
|
|
46
|
+
<w:style w:type="paragraph" w:default="1" w:styleId="Normal">
|
|
47
|
+
<w:name w:val="Normal"/>
|
|
48
|
+
</w:style>
|
|
49
|
+
</w:styles>`);let e=new Date().toISOString();return r.file("docProps/core.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
50
|
+
<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
51
|
+
<dc:creator>EigenPal DOCX Editor</dc:creator>
|
|
52
|
+
<dcterms:created xsi:type="dcterms:W3CDTF">${e}</dcterms:created>
|
|
53
|
+
<dcterms:modified xsi:type="dcterms:W3CDTF">${e}</dcterms:modified>
|
|
54
|
+
</cp:coreProperties>`),r.file("docProps/app.xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
55
|
+
<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties">
|
|
56
|
+
<Application>EigenPal DOCX Editor</Application>
|
|
57
|
+
<AppVersion>1.0.0</AppVersion>
|
|
58
|
+
</Properties>`),r.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:6}})}async function J(r,e={}){if(!r.originalBuffer)throw new Error("Cannot repack document: no original buffer for round-trip. Use createDocx() for new documents.");let{compressionLevel:t=6,updateModifiedDate:o=true,modifiedBy:n}=e,c=r,a=await y__default.default.loadAsync(r.originalBuffer),s=new y__default.default;for(let[m,d]of Object.entries(a.files)){if(d.dir){s.folder(m.replace(/\/$/,""));continue}let u=await d.async("arraybuffer");s.file(m,u,{compression:"DEFLATE",compressionOptions:{level:t}});}let i=P(c);await A(i,s,t),await I(i,s,t);let p=chunkFRYMBAHP_js.g(c);if(s.file("word/document.xml",p,{compression:"DEFLATE",compressionOptions:{level:t}}),F(c,s,t),await O(c,s,t),await b(c,s,t),o){let m="docProps/core.xml",d=a.file(m);if(d){let u=await d.async("text"),x=Y(u,{updateModifiedDate:o,modifiedBy:n});s.file(m,x,{compression:"DEFLATE",compressionOptions:{level:t}});}}return await s.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:t}})}async function be(r,e,t={}){let{compressionLevel:o=6,updateModifiedDate:n=true,modifiedBy:c}=t,a=r,s=new y__default.default;for(let[m,d]of Object.entries(e.originalZip.files)){if(d.dir){s.folder(m.replace(/\/$/,""));continue}let u=await d.async("arraybuffer");s.file(m,u,{compression:"DEFLATE",compressionOptions:{level:o}});}let i=P(a);await A(i,s,o),await I(i,s,o);let p=chunkFRYMBAHP_js.g(a);if(s.file("word/document.xml",p,{compression:"DEFLATE",compressionOptions:{level:o}}),F(a,s,o),await O(a,s,o),await b(a,s,o),n&&e.corePropsXml){let m=Y(e.corePropsXml,{updateModifiedDate:n,modifiedBy:c});s.file("docProps/core.xml",m,{compression:"DEFLATE",compressionOptions:{level:o}});}return await s.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:o}})}async function Fe(r,e,t={}){let{compressionLevel:o=6}=t,n=await y__default.default.loadAsync(r);return n.file("word/document.xml",e,{compression:"DEFLATE",compressionOptions:{level:o}}),n.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:o}})}async function Ce(r,e,t,o={}){let{compressionLevel:n=6}=o,c=await y__default.default.loadAsync(r);return c.file(e,t,{compression:"DEFLATE",compressionOptions:{level:n}}),c.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:n}})}async function ve(r,e,t={}){let o=await y__default.default.loadAsync(r);return te(o,e,t)}async function te(r,e,t={}){let{compressionLevel:o=6}=t;for(let[n,c]of e)r.file(n,c,{compression:"DEFLATE",compressionOptions:{level:o}});return r.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:o}})}async function oe(r,e){let t=await y__default.default.loadAsync(r),o="word/_rels/document.xml.rels",n=t.file(o);if(!n)throw new Error("document.xml.rels not found in DOCX");let c=await n.async("text"),a=`rId${g(c)+1}`,s=e.targetMode==="External"?' TargetMode="External"':"",i=`<Relationship Id="${a}" Type="${e.type}" Target="${chunkFRYMBAHP_js.a(e.target)}"${s}/>`,p=c.replace("</Relationships>",`${i}</Relationships>`);return t.file(o,p),{buffer:await t.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:6}}),rId:a}}async function Re(r,e,t,o){let n=await y__default.default.loadAsync(r),c=`word/media/${e}`;n.file(c,t);let a=await oe(await n.generateAsync({type:"arraybuffer"}),{type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",target:`media/${e}`}),s=n.file("[Content_Types].xml");if(s){let i=await s.async("text"),p=e.split(".").pop()?.toLowerCase()||"";if(!i.includes(`Extension="${p}"`)&&p){let m=D(p,o),d=`<Default Extension="${p}" ContentType="${m}"/>`,u=i.replace("</Types>",`${d}</Types>`),x=await y__default.default.loadAsync(a.buffer);return x.file("[Content_Types].xml",u),{buffer:await x.generateAsync({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:6}}),rId:a.rId,path:c}}}return {buffer:a.buffer,rId:a.rId,path:c}}function Y(r,e){let t=r;if(e.updateModifiedDate){let o=new Date().toISOString();t.includes("<dcterms:modified")?t=t.replace(/<dcterms:modified[^>]*>[^<]*<\/dcterms:modified>/,`<dcterms:modified xsi:type="dcterms:W3CDTF">${o}</dcterms:modified>`):t=t.replace("</cp:coreProperties>",`<dcterms:modified xsi:type="dcterms:W3CDTF">${o}</dcterms:modified></cp:coreProperties>`);}return e.modifiedBy&&(t.includes("<cp:lastModifiedBy")?t=t.replace(/<cp:lastModifiedBy>[^<]*<\/cp:lastModifiedBy>/,`<cp:lastModifiedBy>${chunkFRYMBAHP_js.a(e.modifiedBy)}</cp:lastModifiedBy>`):t=t.replace("</cp:coreProperties>",`<cp:lastModifiedBy>${chunkFRYMBAHP_js.a(e.modifiedBy)}</cp:lastModifiedBy></cp:coreProperties>`)),t}async function Me(r){let e=[],t=[];try{let o=await y__default.default.loadAsync(r),n=["[Content_Types].xml","word/document.xml"];for(let i of n)o.file(i)||e.push(`Missing required file: ${i}`);let c=["_rels/.rels","word/_rels/document.xml.rels","word/styles.xml"];for(let i of c)o.file(i)||t.push(`Missing recommended file: ${i}`);let a=o.file("word/document.xml");if(a){let i=await a.async("text");i.includes("<?xml")||t.push("document.xml missing XML declaration"),i.includes("<w:document")||e.push("document.xml missing w:document element"),i.includes("<w:body>")||e.push("document.xml missing w:body element");}let s=o.file("[Content_Types].xml");if(s){let i=await s.async("text");!i.includes("word/document.xml")&&!i.includes("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml")&&t.push("Content_Types.xml may be missing document.xml type declaration");}}catch(o){e.push(`Failed to read as ZIP: ${o instanceof Error?o.message:"Unknown error"}`);}return {valid:e.length===0,errors:e,warnings:t}}function Ne(r){if(r.byteLength<4)return false;let e=new Uint8Array(r);return e[0]===80&&e[1]===75}async function _e(r){let e=await C(),t={...r,originalBuffer:e};return J(t)}var $e=J;
|
|
59
|
+
exports.a=g;exports.b=L;exports.c=X;exports.d=Z;exports.e=H;exports.f=U;exports.g=C;exports.h=J;exports.i=be;exports.j=Fe;exports.k=Ce;exports.l=ve;exports.m=te;exports.n=oe;exports.o=Re;exports.p=Y;exports.q=Me;exports.r=Ne;exports.s=_e;exports.t=$e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var p=require('pizzip'),l=require('docxtemplater');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var p__default=/*#__PURE__*/_interopDefault(p);var l__default=/*#__PURE__*/_interopDefault(l);function T(e,r,t={}){return b(e,r,t).buffer}function b(e,r,t={}){let{nullGetter:n="keep",linebreaks:s=true,delimiters:o}=t,a=[],i=[],g=[];try{let d=new p__default.default(e),m=new l__default.default(d,{paragraphLoop:!0,linebreaks:s,nullGetter:c=>{let f=c.value||"";if(n==="error")throw new Error(`Undefined variable: ${f}`);return n==="empty"?(g.push(f),""):(g.push(f),`{${f}}`)},delimiters:o?{start:o.start||"{",end:o.end||"}"}:void 0});return Object.keys(r).forEach(c=>{r[c]!==void 0&&r[c]!==null&&i.push(c);}),m.setData(r),m.render(),{buffer:m.getZip().generate({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:6}}),replacedVariables:i,unreplacedVariables:g,warnings:a}}catch(d){throw u(d)}}function x(e,r,t={}){let n=T(e,r,t);return new Blob([n],{type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"})}function k(e,r,t="document",n={}){let s=x(e,r,n);E(s,`${t}.docx`);}function R(e){try{let r=new p__default.default(e),n=new l__default.default(r,{paragraphLoop:!0,linebreaks:!0}).getFullText();return y(n)}catch(r){throw u(r)}}function D(e){let r=[],t=[];try{let n=new p__default.default(e),o=new l__default.default(n,{paragraphLoop:!0,linebreaks:!0}).getFullText();t=y(o);let a=h(o);for(let i of a)r.push({message:`Unclosed tag: ${i}`,variable:i,type:"parse"});return {valid:r.length===0,errors:r,tags:t}}catch(n){return r.push(u(n)),{valid:false,errors:r,tags:t}}}function L(e,r){return e.filter(t=>!(t in r)||r[t]===void 0||r[t]===null)}function O(e,r){try{let t=new p__default.default(e),n=new l__default.default(t,{paragraphLoop:!0,linebreaks:!0,nullGetter:s=>`[${s.value||""}]`});return n.setData(r),n.render(),n.getFullText()}catch(t){throw u(t)}}function y(e){let r=[],t=/\{([^{}]+)\}/g,n;for(;(n=t.exec(e))!==null;){let s=n[1].trim();s&&!r.includes(s)&&r.push(s);}return r.sort()}function h(e){let r=[],t=0,n="";for(let s of e)s==="{"?(t++,n=""):s==="}"?(t--,t<0&&(t=0)):t>0&&(n+=s);return t>0&&n.trim()&&r.push(n.trim()),r}function w(e){return "properties"in e&&typeof e.properties=="object"}function u(e){if(e instanceof Error){if(w(e)&&e.properties?.errors){let r=e.properties.errors[0];return {message:r?.message||"Template processing error",variable:r?.properties?.tag,type:"render",originalError:e}}if(e.message.includes("undefined")){let r=e.message.match(/undefined (?:variable|tag):\s*(\S+)/i);return {message:e.message,variable:r?r[1]:void 0,type:"undefined",originalError:e}}return e.message.includes("parse")||e.message.includes("unclosed")||e.message.includes("syntax")?{message:e.message,type:"parse",originalError:e}:{message:e.message,type:"unknown",originalError:e}}return {message:String(e),type:"unknown"}}function E(e,r){let t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=r,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t);}function P(e,r,t={}){let{linebreaks:n=true,delimiters:s}=t;try{let o=new p__default.default(e),a=new l__default.default(o,{paragraphLoop:!0,linebreaks:n,delimiters:s?{start:s.start||"{",end:s.end||"}"}:void 0});return a.setData(r),a.render(),a.getZip().generate({type:"arraybuffer",compression:"DEFLATE"})}catch(o){throw u(o)}}function U(e={}){return (r,t)=>T(r,t,e)}var z=T;exports.a=T;exports.b=b;exports.c=x;exports.d=k;exports.e=R;exports.f=D;exports.g=L;exports.h=O;exports.i=P;exports.j=U;exports.k=z;
|