@arbidocs/blocks 0.5.107 → 0.5.108
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ConnectedCallDock-TDYRHPAK.js → ConnectedCallDock-DV4FU376.js} +8 -8
- package/dist/{ConnectedCallDock-TDYRHPAK.js.map → ConnectedCallDock-DV4FU376.js.map} +1 -1
- package/dist/{ConnectedCallDock-H3WWFGXF.cjs → ConnectedCallDock-EM2VVGZK.cjs} +10 -10
- package/dist/{ConnectedCallDock-H3WWFGXF.cjs.map → ConnectedCallDock-EM2VVGZK.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-55O5OUN7.cjs → ConnectedCallRoom-7WEPEWUJ.cjs} +9 -9
- package/dist/{ConnectedCallRoom-55O5OUN7.cjs.map → ConnectedCallRoom-7WEPEWUJ.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-Z6F6WCLH.js → ConnectedCallRoom-RYTZP34O.js} +8 -8
- package/dist/{ConnectedCallRoom-Z6F6WCLH.js.map → ConnectedCallRoom-RYTZP34O.js.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-NVZRVNOS.js → ConnectedNativeDocxComparison-2NDXXZLQ.js} +15 -15
- package/dist/{ConnectedNativeDocxComparison-NVZRVNOS.js.map → ConnectedNativeDocxComparison-2NDXXZLQ.js.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-DGBZJ4XA.cjs → ConnectedNativeDocxComparison-7HOY3AVI.cjs} +16 -16
- package/dist/{ConnectedNativeDocxComparison-DGBZJ4XA.cjs.map → ConnectedNativeDocxComparison-7HOY3AVI.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-R4WINUUB.cjs → ConnectedNativeDocxEditor-CUWDPHXN.cjs} +16 -16
- package/dist/{ConnectedNativeDocxEditor-R4WINUUB.cjs.map → ConnectedNativeDocxEditor-CUWDPHXN.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-RSVBN7DY.js → ConnectedNativeDocxEditor-SPZB6Y27.js} +14 -14
- package/dist/{ConnectedNativeDocxEditor-RSVBN7DY.js.map → ConnectedNativeDocxEditor-SPZB6Y27.js.map} +1 -1
- package/dist/{ConnectedProductionSetDialog-2DFBXE2X.js → ConnectedProductionSetDialog-N3EDG3SU.js} +4 -4
- package/dist/{ConnectedProductionSetDialog-2DFBXE2X.js.map → ConnectedProductionSetDialog-N3EDG3SU.js.map} +1 -1
- package/dist/{ConnectedProductionSetDialog-KYDPQ7SG.cjs → ConnectedProductionSetDialog-XAEFEN3N.cjs} +4 -4
- package/dist/{ConnectedProductionSetDialog-KYDPQ7SG.cjs.map → ConnectedProductionSetDialog-XAEFEN3N.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-HLJ5IIOU.js → ConnectedStreamedWordArtifact-6LTGEAJO.js} +15 -15
- package/dist/ConnectedStreamedWordArtifact-6LTGEAJO.js.map +1 -0
- package/dist/{ConnectedStreamedWordArtifact-JQ34AOUU.cjs → ConnectedStreamedWordArtifact-HNCRKZTV.cjs} +16 -16
- package/dist/ConnectedStreamedWordArtifact-HNCRKZTV.cjs.map +1 -0
- package/dist/{DocumentReviewCard-7JSXRJZ2.js → DocumentReviewCard-RJD3CO32.js} +8 -8
- package/dist/{DocumentReviewCard-7JSXRJZ2.js.map → DocumentReviewCard-RJD3CO32.js.map} +1 -1
- package/dist/{DocumentReviewCard-C4HVT3WM.cjs → DocumentReviewCard-VON7LOOY.cjs} +8 -8
- package/dist/{DocumentReviewCard-C4HVT3WM.cjs.map → DocumentReviewCard-VON7LOOY.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-IMQTZWKD.js → FilesViewerDialog-7SJGY72Q.js} +21 -21
- package/dist/{FilesViewerDialog-IMQTZWKD.js.map → FilesViewerDialog-7SJGY72Q.js.map} +1 -1
- package/dist/{FilesViewerDialog-UP7GFHYN.cjs → FilesViewerDialog-VIPTC6OT.cjs} +27 -27
- package/dist/{FilesViewerDialog-UP7GFHYN.cjs.map → FilesViewerDialog-VIPTC6OT.cjs.map} +1 -1
- package/dist/{RechartsRenderer-GIRCW7DB.cjs → RechartsRenderer-THES2SE5.cjs} +6 -5
- package/dist/RechartsRenderer-THES2SE5.cjs.map +1 -0
- package/dist/{RechartsRenderer-23OF4H6X.js → RechartsRenderer-XIZLV6GH.js} +6 -5
- package/dist/RechartsRenderer-XIZLV6GH.js.map +1 -0
- package/dist/{WorkspaceTableView-PJM47B5F.cjs → WorkspaceTableView-FNME7TL6.cjs} +9 -9
- package/dist/{WorkspaceTableView-PJM47B5F.cjs.map → WorkspaceTableView-FNME7TL6.cjs.map} +1 -1
- package/dist/{WorkspaceTableView-YDA7A4UJ.js → WorkspaceTableView-XQ6J2JKI.js} +7 -7
- package/dist/{WorkspaceTableView-YDA7A4UJ.js.map → WorkspaceTableView-XQ6J2JKI.js.map} +1 -1
- package/dist/agents/index.cjs +202 -202
- package/dist/agents/index.js +8 -8
- package/dist/{ai-ADS6YSS2.cjs → ai-3SAMEYBB.cjs} +20 -20
- package/dist/ai-3SAMEYBB.cjs.map +1 -0
- package/dist/{ai-KHWTGBT5.js → ai-OTQWSYVK.js} +12 -12
- package/dist/ai-OTQWSYVK.js.map +1 -0
- package/dist/calls/index.cjs +57 -57
- package/dist/calls/index.js +9 -9
- package/dist/chat/index.cjs +3 -3
- package/dist/chat/index.js +3 -3
- package/dist/{chunk-O27K7KTZ.cjs → chunk-2TBQBF4Y.cjs} +5 -5
- package/dist/{chunk-O27K7KTZ.cjs.map → chunk-2TBQBF4Y.cjs.map} +1 -1
- package/dist/{chunk-YJWAGXYM.js → chunk-4ZA2RSQH.js} +3 -3
- package/dist/{chunk-YJWAGXYM.js.map → chunk-4ZA2RSQH.js.map} +1 -1
- package/dist/{chunk-6A4GNM4T.cjs → chunk-5D2ZINOJ.cjs} +16 -16
- package/dist/{chunk-6A4GNM4T.cjs.map → chunk-5D2ZINOJ.cjs.map} +1 -1
- package/dist/{chunk-BFVCYBND.cjs → chunk-5HXQOM3I.cjs} +5 -5
- package/dist/{chunk-BFVCYBND.cjs.map → chunk-5HXQOM3I.cjs.map} +1 -1
- package/dist/{chunk-GSD5U553.cjs → chunk-5KKT65WU.cjs} +3 -3
- package/dist/{chunk-GSD5U553.cjs.map → chunk-5KKT65WU.cjs.map} +1 -1
- package/dist/{chunk-AVGHTUPE.js → chunk-5PWLXLHY.js} +5 -5
- package/dist/chunk-5PWLXLHY.js.map +1 -0
- package/dist/{chunk-BBWLFK3C.js → chunk-5XIMUQ63.js} +3 -3
- package/dist/{chunk-BBWLFK3C.js.map → chunk-5XIMUQ63.js.map} +1 -1
- package/dist/{chunk-AHMRYY7J.cjs → chunk-6DAJXQZZ.cjs} +13 -13
- package/dist/{chunk-AHMRYY7J.cjs.map → chunk-6DAJXQZZ.cjs.map} +1 -1
- package/dist/{chunk-3PV25ICC.js → chunk-6KKVJ2V6.js} +3 -3
- package/dist/{chunk-3PV25ICC.js.map → chunk-6KKVJ2V6.js.map} +1 -1
- package/dist/{chunk-OLAYDOPC.js → chunk-6LUHNFEE.js} +6 -6
- package/dist/{chunk-OLAYDOPC.js.map → chunk-6LUHNFEE.js.map} +1 -1
- package/dist/{chunk-FSXQHEFQ.cjs → chunk-7CDV7Y4U.cjs} +25 -25
- package/dist/{chunk-FSXQHEFQ.cjs.map → chunk-7CDV7Y4U.cjs.map} +1 -1
- package/dist/{chunk-OAIOOVFN.cjs → chunk-7SJXYEZI.cjs} +36 -36
- package/dist/chunk-7SJXYEZI.cjs.map +1 -0
- package/dist/{chunk-LFYKB7KF.cjs → chunk-7V6APLF7.cjs} +19 -19
- package/dist/{chunk-LFYKB7KF.cjs.map → chunk-7V6APLF7.cjs.map} +1 -1
- package/dist/{chunk-4WMGFGYP.cjs → chunk-AJZ66VJC.cjs} +4 -4
- package/dist/{chunk-4WMGFGYP.cjs.map → chunk-AJZ66VJC.cjs.map} +1 -1
- package/dist/{chunk-KCP42W67.cjs → chunk-ARGQ5YZ5.cjs} +3 -3
- package/dist/{chunk-KCP42W67.cjs.map → chunk-ARGQ5YZ5.cjs.map} +1 -1
- package/dist/{chunk-BH6IKGZ3.js → chunk-AUAHGQY6.js} +5 -5
- package/dist/{chunk-BH6IKGZ3.js.map → chunk-AUAHGQY6.js.map} +1 -1
- package/dist/{chunk-KIXFXCHL.js → chunk-CEOCA7ID.js} +3 -3
- package/dist/{chunk-KIXFXCHL.js.map → chunk-CEOCA7ID.js.map} +1 -1
- package/dist/{chunk-TNKPQ3EF.js → chunk-CIRSOYGK.js} +12 -12
- package/dist/{chunk-TNKPQ3EF.js.map → chunk-CIRSOYGK.js.map} +1 -1
- package/dist/{chunk-BAUZUIHB.js → chunk-COL2TJGO.js} +83 -83
- package/dist/chunk-COL2TJGO.js.map +1 -0
- package/dist/{chunk-XHN5KOI2.cjs → chunk-DRLD4P2C.cjs} +8 -8
- package/dist/{chunk-XHN5KOI2.cjs.map → chunk-DRLD4P2C.cjs.map} +1 -1
- package/dist/{chunk-5AC52BHL.cjs → chunk-DYPFNQTQ.cjs} +140 -140
- package/dist/chunk-DYPFNQTQ.cjs.map +1 -0
- package/dist/{chunk-SCLGUHLU.cjs → chunk-E7TGSOPR.cjs} +4 -4
- package/dist/{chunk-SCLGUHLU.cjs.map → chunk-E7TGSOPR.cjs.map} +1 -1
- package/dist/{chunk-CRLFLMTK.cjs → chunk-EOXA4VJH.cjs} +3 -3
- package/dist/{chunk-CRLFLMTK.cjs.map → chunk-EOXA4VJH.cjs.map} +1 -1
- package/dist/{chunk-DBKZANTC.js → chunk-GA47YVW5.js} +3 -3
- package/dist/{chunk-DBKZANTC.js.map → chunk-GA47YVW5.js.map} +1 -1
- package/dist/{chunk-RCZRI72J.cjs → chunk-GMODJT4N.cjs} +4 -4
- package/dist/{chunk-RCZRI72J.cjs.map → chunk-GMODJT4N.cjs.map} +1 -1
- package/dist/{chunk-22KAKJ3W.cjs → chunk-GS5MFUPC.cjs} +4 -4
- package/dist/{chunk-22KAKJ3W.cjs.map → chunk-GS5MFUPC.cjs.map} +1 -1
- package/dist/{chunk-62OMGQHS.js → chunk-H6W3VXHU.js} +3 -3
- package/dist/{chunk-62OMGQHS.js.map → chunk-H6W3VXHU.js.map} +1 -1
- package/dist/{chunk-DX3Z2COD.cjs → chunk-HUYKO2ES.cjs} +3 -3
- package/dist/{chunk-DX3Z2COD.cjs.map → chunk-HUYKO2ES.cjs.map} +1 -1
- package/dist/{chunk-U5F5P4YU.js → chunk-IK234EFX.js} +12 -12
- package/dist/{chunk-U5F5P4YU.js.map → chunk-IK234EFX.js.map} +1 -1
- package/dist/{chunk-UQ2OBHMV.js → chunk-JUGEFTRC.js} +1010 -1010
- package/dist/chunk-JUGEFTRC.js.map +1 -0
- package/dist/{chunk-CHQMVIHR.js → chunk-LPGBRMYS.js} +36 -36
- package/dist/chunk-LPGBRMYS.js.map +1 -0
- package/dist/{chunk-D35EHOK5.cjs → chunk-M23W7IID.cjs} +12 -12
- package/dist/chunk-M23W7IID.cjs.map +1 -0
- package/dist/{chunk-FPOKWML2.js → chunk-MIVNNQO3.js} +21 -4
- package/dist/chunk-MIVNNQO3.js.map +1 -0
- package/dist/{chunk-WI3BVKEC.cjs → chunk-MNFI66H5.cjs} +5 -5
- package/dist/{chunk-WI3BVKEC.cjs.map → chunk-MNFI66H5.cjs.map} +1 -1
- package/dist/{chunk-T5ZMG6MC.js → chunk-NF4M7PUB.js} +3 -3
- package/dist/{chunk-T5ZMG6MC.js.map → chunk-NF4M7PUB.js.map} +1 -1
- package/dist/{chunk-ZNY5W3VX.js → chunk-NPSFPBIB.js} +3 -3
- package/dist/{chunk-ZNY5W3VX.js.map → chunk-NPSFPBIB.js.map} +1 -1
- package/dist/{chunk-LYW5A35J.js → chunk-OMIYTUVR.js} +12 -12
- package/dist/{chunk-LYW5A35J.js.map → chunk-OMIYTUVR.js.map} +1 -1
- package/dist/{chunk-ZMVF7EYJ.cjs → chunk-PBPO54KZ.cjs} +21 -3
- package/dist/chunk-PBPO54KZ.cjs.map +1 -0
- package/dist/{chunk-7V4OCZS6.cjs → chunk-RA3EGF6K.cjs} +6 -6
- package/dist/{chunk-7V4OCZS6.cjs.map → chunk-RA3EGF6K.cjs.map} +1 -1
- package/dist/{chunk-PL7O3RJJ.cjs → chunk-RKBAY7GZ.cjs} +3 -3
- package/dist/{chunk-PL7O3RJJ.cjs.map → chunk-RKBAY7GZ.cjs.map} +1 -1
- package/dist/{chunk-J3E5CSSC.js → chunk-RKFWBIKS.js} +3 -3
- package/dist/{chunk-J3E5CSSC.js.map → chunk-RKFWBIKS.js.map} +1 -1
- package/dist/{chunk-YLKHTBYA.js → chunk-RRP7MQAO.js} +3 -3
- package/dist/{chunk-YLKHTBYA.js.map → chunk-RRP7MQAO.js.map} +1 -1
- package/dist/{chunk-U6LQ6Z3P.cjs → chunk-SP3IKIPA.cjs} +6 -6
- package/dist/{chunk-U6LQ6Z3P.cjs.map → chunk-SP3IKIPA.cjs.map} +1 -1
- package/dist/{chunk-GX75YCWJ.cjs → chunk-SQUOXOY3.cjs} +560 -560
- package/dist/chunk-SQUOXOY3.cjs.map +1 -0
- package/dist/{chunk-6ZYOUT73.js → chunk-T5LORFHL.js} +7 -7
- package/dist/{chunk-6ZYOUT73.js.map → chunk-T5LORFHL.js.map} +1 -1
- package/dist/{chunk-45OU2UAA.cjs → chunk-TEMTKBBL.cjs} +10 -10
- package/dist/{chunk-45OU2UAA.cjs.map → chunk-TEMTKBBL.cjs.map} +1 -1
- package/dist/{chunk-PHDUN4SG.cjs → chunk-THCMGAFX.cjs} +41 -41
- package/dist/{chunk-PHDUN4SG.cjs.map → chunk-THCMGAFX.cjs.map} +1 -1
- package/dist/{chunk-HTGEAQOA.js → chunk-TOMDMKOD.js} +7 -7
- package/dist/{chunk-HTGEAQOA.js.map → chunk-TOMDMKOD.js.map} +1 -1
- package/dist/{chunk-WJHRWXWJ.js → chunk-TXIAF4PX.js} +3 -3
- package/dist/{chunk-WJHRWXWJ.js.map → chunk-TXIAF4PX.js.map} +1 -1
- package/dist/{chunk-6M5NAAWX.js → chunk-UCSEE52D.js} +3 -3
- package/dist/{chunk-6M5NAAWX.js.map → chunk-UCSEE52D.js.map} +1 -1
- package/dist/{chunk-I7CJDF3V.cjs → chunk-UHMP6S7M.cjs} +104 -103
- package/dist/chunk-UHMP6S7M.cjs.map +1 -0
- package/dist/{chunk-PGCKTXYH.js → chunk-UHUI6A36.js} +3 -3
- package/dist/{chunk-PGCKTXYH.js.map → chunk-UHUI6A36.js.map} +1 -1
- package/dist/{chunk-6KQVTMRL.cjs → chunk-UOGXKHTJ.cjs} +3 -3
- package/dist/{chunk-6KQVTMRL.cjs.map → chunk-UOGXKHTJ.cjs.map} +1 -1
- package/dist/{chunk-7S7YVBFK.js → chunk-VDSDG4FR.js} +3 -3
- package/dist/{chunk-7S7YVBFK.js.map → chunk-VDSDG4FR.js.map} +1 -1
- package/dist/{chunk-3GFQNJYE.js → chunk-VGWCHX6G.js} +104 -103
- package/dist/chunk-VGWCHX6G.js.map +1 -0
- package/dist/{chunk-VY3HTT37.js → chunk-VUH547VQ.js} +3 -3
- package/dist/{chunk-VY3HTT37.js.map → chunk-VUH547VQ.js.map} +1 -1
- package/dist/{chunk-AZCMKGDG.js → chunk-W37PFYFL.js} +4 -4
- package/dist/{chunk-AZCMKGDG.js.map → chunk-W37PFYFL.js.map} +1 -1
- package/dist/{chunk-JGUM4EXE.cjs → chunk-W3IX3GZS.cjs} +8 -8
- package/dist/{chunk-JGUM4EXE.cjs.map → chunk-W3IX3GZS.cjs.map} +1 -1
- package/dist/{chunk-UCA4JLLJ.cjs → chunk-X7GT57KW.cjs} +3 -3
- package/dist/{chunk-UCA4JLLJ.cjs.map → chunk-X7GT57KW.cjs.map} +1 -1
- package/dist/{chunk-IXL2KJOZ.cjs → chunk-XBEGD33U.cjs} +40 -40
- package/dist/{chunk-IXL2KJOZ.cjs.map → chunk-XBEGD33U.cjs.map} +1 -1
- package/dist/{chunk-FDNIK5YS.cjs → chunk-XBKIFGBB.cjs} +8 -8
- package/dist/{chunk-FDNIK5YS.cjs.map → chunk-XBKIFGBB.cjs.map} +1 -1
- package/dist/{chunk-HZE5MHQO.js → chunk-XT7HKQ4H.js} +3 -3
- package/dist/{chunk-HZE5MHQO.js.map → chunk-XT7HKQ4H.js.map} +1 -1
- package/dist/{chunk-M3OK6KGR.js → chunk-ZGQKED5T.js} +3 -3
- package/dist/{chunk-M3OK6KGR.js.map → chunk-ZGQKED5T.js.map} +1 -1
- package/dist/{chunk-NWBCZ4PA.js → chunk-ZKBYG6MN.js} +4 -4
- package/dist/{chunk-NWBCZ4PA.js.map → chunk-ZKBYG6MN.js.map} +1 -1
- package/dist/collaboration/index.cjs +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/connect/docx.cjs +19 -19
- package/dist/connect/docx.js +15 -15
- package/dist/connect/index.cjs +762 -762
- package/dist/connect/index.js +63 -63
- package/dist/connect/viewer.cjs +14 -14
- package/dist/connect/viewer.js +13 -13
- package/dist/connection/dashboards/ConnectedDashboardsPage.d.ts +6 -0
- package/dist/dashboards/chartModel.d.ts +12 -0
- package/dist/dashboards/index.cjs +113 -42
- package/dist/dashboards/index.cjs.map +1 -1
- package/dist/dashboards/index.js +95 -24
- package/dist/dashboards/index.js.map +1 -1
- package/dist/embed/index.cjs +29 -29
- package/dist/embed/index.js +23 -23
- package/dist/facts/index.cjs +43 -43
- package/dist/facts/index.js +2 -2
- package/dist/files/index.cjs +1 -1
- package/dist/files/index.js +1 -1
- package/dist/home/index.cjs +31 -31
- package/dist/home/index.js +3 -3
- package/dist/index.cjs +383 -383
- package/dist/index.js +21 -21
- package/dist/settings/index.cjs +153 -153
- package/dist/settings/index.js +4 -4
- package/dist/shell/index.cjs +36 -36
- package/dist/shell/index.js +4 -4
- package/dist/site/index.cjs +5 -5
- package/dist/site/index.js +1 -1
- package/dist/studio/index.cjs +19 -19
- package/dist/studio/index.js +14 -14
- package/dist/styles.css +1 -1
- package/dist/workflow-canvas/index.cjs +33 -33
- package/dist/workflow-canvas/index.js +22 -22
- package/node_modules/@arbidocs/coedit/package.json +2 -2
- package/node_modules/@docx-editor.dev/core/dist/automation.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/automation.d.ts +60 -13
- package/node_modules/@docx-editor.dev/core/dist/automation.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/binding.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/binding.d.ts +21 -13
- package/node_modules/@docx-editor.dev/core/dist/binding.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{index-Bsg7oIKP.d.ts → chrome-print-CAs51cpq.d.ts} +31 -21
- package/node_modules/@docx-editor.dev/core/dist/{chunk-VDNNLG6X.js → chunk-236O4YQW.js} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-4HENIAFG.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/{chunk-SRPILEWV.cjs → chunk-6JPL6ZAS.cjs} +5 -5
- package/node_modules/@docx-editor.dev/core/dist/{chunk-2RC2EPND.js → chunk-6ZQP4HQ7.js} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{chunk-ZUHOMK52.cjs → chunk-7WQ7AAHW.cjs} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{chunk-Z6WBFXJU.js → chunk-BCXH4BXB.js} +3 -3
- package/node_modules/@docx-editor.dev/core/dist/{chunk-QMLCVPCD.cjs → chunk-BY2ACZZ6.cjs} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-CAJEXXVG.cjs +4 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-CPWLFPWC.js +30 -0
- package/node_modules/@docx-editor.dev/core/dist/{chunk-6APGXLBB.cjs → chunk-D7ZMDMPX.cjs} +2 -2
- package/node_modules/@docx-editor.dev/core/dist/chunk-DOHF6FA7.cjs +30 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-DVX32P2P.js +27 -0
- package/node_modules/@docx-editor.dev/core/dist/{chunk-6EYYL7FL.js → chunk-E4LOMDNL.js} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-EKLM7NWB.cjs +7 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-G3K63G7P.cjs +27 -0
- package/node_modules/@docx-editor.dev/core/dist/{chunk-5CSUYANV.js → chunk-G4HOFIKJ.js} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{chunk-K5U2PLDP.cjs → chunk-JLVBDYVQ.cjs} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-LQX36Z5P.js +7 -0
- package/node_modules/@docx-editor.dev/core/dist/{chunk-TSLBZ26X.js → chunk-LSZ6KPKK.js} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{chunk-O2AL2HSJ.cjs → chunk-MM5QBMTE.cjs} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{chunk-ETTO6GK3.js → chunk-OMCG63ZF.js} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-OSFOJTHU.cjs +18 -0
- package/node_modules/@docx-editor.dev/core/dist/{chunk-E7BQA6UP.js → chunk-RCLZXP3B.js} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-T6K2QYNZ.cjs +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-TRGAVV2Y.js +4 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-U4JZVSOE.js +2 -0
- package/node_modules/@docx-editor.dev/core/dist/{chunk-2GO5T2JU.cjs → chunk-UHHYFIDT.cjs} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-V3N4SOAK.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/{chunk-6AWEKBLB.cjs → chunk-W35WTWAO.cjs} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-YQ5G6LC7.js +18 -0
- package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.d.ts +5 -5
- package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/collaboration.d.ts +4 -4
- package/node_modules/@docx-editor.dev/core/dist/contracts/document.d.ts +3 -3
- package/node_modules/@docx-editor.dev/core/dist/contracts/editor.d.ts +9 -10
- package/node_modules/@docx-editor.dev/core/dist/contracts/interaction.d.ts +2 -2
- package/node_modules/@docx-editor.dev/core/dist/contracts/modules.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/contracts/modules.d.ts +33 -9
- package/node_modules/@docx-editor.dev/core/dist/contracts/modules.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/contracts/types.d.ts +2 -2
- package/node_modules/@docx-editor.dev/core/dist/{custom-node-writes-cvL5rhcD.d.ts → custom-node-writes-Bn6uciLb.d.ts} +2 -2
- package/node_modules/@docx-editor.dev/core/dist/diagnostic-context-B8M79cfK.d.ts +30 -0
- package/node_modules/@docx-editor.dev/core/dist/diagnostic-hints-BeVjfNOv.d.ts +113 -0
- package/node_modules/@docx-editor.dev/core/dist/{document-protection-BAGVGqaP.d.ts → document-protection-CUb55pl_.d.ts} +2 -2
- package/node_modules/@docx-editor.dev/core/dist/{editor-Ci7IZGmG.d.ts → editor-CZQZmTIU.d.ts} +386 -9
- package/node_modules/@docx-editor.dev/core/dist/{editor-scope-OHPwVQ5l.d.ts → editor-scope-7o9xweiJ.d.ts} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/editor.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/editor.d.ts +54 -33
- package/node_modules/@docx-editor.dev/core/dist/editor.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/export.cjs +2 -2
- package/node_modules/@docx-editor.dev/core/dist/export.d.ts +13 -14
- package/node_modules/@docx-editor.dev/core/dist/export.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{font-resolver-BVQB14qT.d.ts → font-resolver-lSBLirLR.d.ts} +3 -3
- package/node_modules/@docx-editor.dev/core/dist/{headless-document-view-qH331moE.d.ts → headless-document-view-pp3q7wIh.d.ts} +2 -2
- package/node_modules/@docx-editor.dev/core/dist/{image-resources-BN-hUgCn.d.ts → image-resources-tXLQShoC.d.ts} +2 -2
- package/node_modules/@docx-editor.dev/core/dist/index.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/index.d.ts +65 -20
- package/node_modules/@docx-editor.dev/core/dist/index.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{layout-shaping-BEyuiQOk.d.ts → layout-shaping-BD-dF_rn.d.ts} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/layout.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/layout.d.ts +17 -20
- package/node_modules/@docx-editor.dev/core/dist/layout.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{note-properties-4Y9o6Gyk.d.ts → note-properties-qQUjO1GQ.d.ts} +3 -3
- package/node_modules/@docx-editor.dev/core/dist/{omml-equation-CuzBL5DD.d.ts → omml-equation-BUbU0utM.d.ts} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/output.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/output.d.ts +8 -9
- package/node_modules/@docx-editor.dev/core/dist/output.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{protocol-Bqk4Izjc.d.ts → protocol-DYzzz2ej.d.ts} +2 -2
- package/node_modules/@docx-editor.dev/core/dist/{review-paragraph-order-DT-n6ouC.d.ts → review-paragraph-order-CN_0l2Cb.d.ts} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{semantic-cell-selection-D9D1KSXq.d.ts → semantic-cell-selection-eYag3P47.d.ts} +4 -211
- package/node_modules/@docx-editor.dev/core/dist/{semantic-interaction-CIC-PooQ.d.ts → semantic-interaction-kR_QB845.d.ts} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{semantic-paint-BME37OMv.d.ts → semantic-paint-ZayFF3tD.d.ts} +17 -5
- package/node_modules/@docx-editor.dev/core/dist/{semantic-record-queries-CBlZqZNa.d.ts → semantic-record-queries-Bsgth6lv.d.ts} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{semantic-records-4B3WwFAi.d.ts → semantic-records-DQmumPgL.d.ts} +1279 -828
- package/node_modules/@docx-editor.dev/core/dist/store.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/store.d.ts +1466 -1464
- package/node_modules/@docx-editor.dev/core/dist/store.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{tree-package-fragment-BeeKxDw8.d.ts → tree-package-store-CovjNARF.d.ts} +83 -83
- package/node_modules/@docx-editor.dev/core/dist/{tree-session-contract-CVbmlMlq.d.ts → tree-session-contract-CZVAGl51.d.ts} +6 -6
- package/node_modules/@docx-editor.dev/core/dist/{types-barrel-D3xCgQX6.d.ts → types-barrel-DuC5QBNC.d.ts} +548 -527
- package/node_modules/@docx-editor.dev/core/package.json +3 -3
- package/node_modules/@docx-editor.dev/react/dist/index.js +3 -3
- package/node_modules/@docx-editor.dev/react/dist/index.mjs +3 -3
- package/node_modules/@docx-editor.dev/react/package.json +4 -4
- package/package.json +8 -8
- package/dist/ConnectedStreamedWordArtifact-HLJ5IIOU.js.map +0 -1
- package/dist/ConnectedStreamedWordArtifact-JQ34AOUU.cjs.map +0 -1
- package/dist/RechartsRenderer-23OF4H6X.js.map +0 -1
- package/dist/RechartsRenderer-GIRCW7DB.cjs.map +0 -1
- package/dist/ai-ADS6YSS2.cjs.map +0 -1
- package/dist/ai-KHWTGBT5.js.map +0 -1
- package/dist/chunk-3GFQNJYE.js.map +0 -1
- package/dist/chunk-5AC52BHL.cjs.map +0 -1
- package/dist/chunk-AVGHTUPE.js.map +0 -1
- package/dist/chunk-BAUZUIHB.js.map +0 -1
- package/dist/chunk-CHQMVIHR.js.map +0 -1
- package/dist/chunk-D35EHOK5.cjs.map +0 -1
- package/dist/chunk-FPOKWML2.js.map +0 -1
- package/dist/chunk-GX75YCWJ.cjs.map +0 -1
- package/dist/chunk-I7CJDF3V.cjs.map +0 -1
- package/dist/chunk-OAIOOVFN.cjs.map +0 -1
- package/dist/chunk-UQ2OBHMV.js.map +0 -1
- package/dist/chunk-ZMVF7EYJ.cjs.map +0 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-4GBTELJV.cjs +0 -28
- package/node_modules/@docx-editor.dev/core/dist/chunk-4R3TEXMN.js +0 -18
- package/node_modules/@docx-editor.dev/core/dist/chunk-EO4C5QJW.cjs +0 -2
- package/node_modules/@docx-editor.dev/core/dist/chunk-FIJZIQXA.cjs +0 -18
- package/node_modules/@docx-editor.dev/core/dist/chunk-FRXAOVTB.js +0 -28
- package/node_modules/@docx-editor.dev/core/dist/chunk-J6BVWIDB.js +0 -2
- package/node_modules/@docx-editor.dev/core/dist/chunk-JGNVNT2A.cjs +0 -2
- package/node_modules/@docx-editor.dev/core/dist/chunk-KKIJG3C6.js +0 -2
- package/node_modules/@docx-editor.dev/core/dist/chunk-LWDSDCMO.js +0 -27
- package/node_modules/@docx-editor.dev/core/dist/chunk-NBCVVZOM.cjs +0 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-O5INAWZQ.js +0 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-RCHS4ZEH.cjs +0 -27
- package/node_modules/@docx-editor.dev/core/dist/chunk-VHAVHCQY.js +0 -7
- package/node_modules/@docx-editor.dev/core/dist/chunk-VX43VBAX.cjs +0 -7
- package/node_modules/@docx-editor.dev/core/dist/review-pane-D9jm8DcY.d.ts +0 -128
- package/node_modules/@docx-editor.dev/core/dist/revision-projection-DZ4kKVev.d.ts +0 -242
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkNBCVVZOM_cjs=require('./chunk-NBCVVZOM.cjs'),chunkEO4C5QJW_cjs=require('./chunk-EO4C5QJW.cjs'),chunkK5U2PLDP_cjs=require('./chunk-K5U2PLDP.cjs'),chunk6APGXLBB_cjs=require('./chunk-6APGXLBB.cjs'),chunkVX43VBAX_cjs=require('./chunk-VX43VBAX.cjs'),chunk6AWEKBLB_cjs=require('./chunk-6AWEKBLB.cjs'),chunk4GBTELJV_cjs=require('./chunk-4GBTELJV.cjs'),chunkSRPILEWV_cjs=require('./chunk-SRPILEWV.cjs'),chunkQMLCVPCD_cjs=require('./chunk-QMLCVPCD.cjs'),chunkJGNVNT2A_cjs=require('./chunk-JGNVNT2A.cjs'),chunkBTQKU64Q_cjs=require('./chunk-BTQKU64Q.cjs'),chunk2GO5T2JU_cjs=require('./chunk-2GO5T2JU.cjs'),chunkFIJZIQXA_cjs=require('./chunk-FIJZIQXA.cjs'),chunkUKVVUHZL_cjs=require('./chunk-UKVVUHZL.cjs'),fflate=require('fflate'),i18n=require('@docx-editor.dev/i18n');function OM(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}var v0=false;function x0(e){if(v0)return;v0=true;let t=e.diagnostic?`: ${e.diagnostic}`:".";console.error(`[@docx-editor.dev/core] text shaping is disabled${t}
|
|
2
|
-
Text is being measured with fallback metrics, so line and page breaks will not match Word.`);}function Sa(e){if(e instanceof chunkUKVVUHZL_cjs.a)return e;if(e instanceof chunk4GBTELJV_cjs.d)return new chunkUKVVUHZL_cjs.a(e.code,e.message,{request:OM(e.request),diagnostic:e.diagnostic});if(e instanceof chunk6APGXLBB_cjs.j)return new chunkUKVVUHZL_cjs.a("overLimit",e.message,{diagnostic:e.message});if(e instanceof chunk6APGXLBB_cjs.f){let t=e.code==="wasmUnavailable"||e.code==="shapingLibraryMismatch"?"wasmUnavailable":"initializationFailed";return new chunkUKVVUHZL_cjs.a(t,e.message,{diagnostic:e.diagnostic??e.message,cause:e})}return new chunkUKVVUHZL_cjs.a("initializationFailed",e instanceof Error?e.message:"Font initialization failed",{diagnostic:e instanceof Error?e.message:String(e)})}async function Zi(e,t){try{return await chunk6APGXLBB_cjs.q(e,t)}catch(n){throw Sa(n)}}var Vl=Object.freeze({opening:"auto",overflow:"float",revisionsIn:"pane",commentMarkers:"icon"}),uf={opening:["auto","manual"],overflow:["float","shrinkPage","scroll"],revisionsIn:["pane","balloons"],commentMarkers:["initials","icon"]};function Kl(e,t=Vl){if(e===void 0)return t;if(e===null||typeof e!="object")throw new TypeError("review pane settings must be an object");let n=t;for(let[r,o]of Object.entries(e)){if(o===void 0)continue;if(!Object.hasOwn(uf,r))throw new TypeError(`unknown review pane setting ${r}`);let a=r;if(typeof o!="string"||!uf[a].includes(o))throw new TypeError(`review pane ${a} must be ${uf[a].join(" or ")}`);n[a]!==o&&(n={...n,[a]:o});}return n===t?t:Object.freeze(n)}function ff(e,t){return e==="pane"?true:t.kind==="revision"?false:!(t.kind==="comment"&&t.parentRevisionId!==void 0)}var MM=Object.freeze({revisionMarkup:chunk4GBTELJV_cjs.Ua,reviewPane:Vl,scope:Object.freeze({kind:"body"}),isLoading:true,isOpening:false,parseError:null,editable:false,zoom:1,selection:null,selectionCollapsed:true,formatting:null,table:null,tocContext:null,image:null,page:Object.freeze({current:0,total:0}),canUndo:false,canRedo:false,collaborationStatus:"inactive"});var w0="http://schemas.openxmlformats.org/wordprocessingml/2006/main",FM="http://schemas.openxmlformats.org/package/2006/content-types",S0="http://schemas.openxmlformats.org/package/2006/relationships",LM="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",NM="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",DM=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="${FM}"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/><Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/></Types>`,HM=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${S0}"><Relationship Id="rId1" Type="${LM}" Target="word/document.xml"/></Relationships>`,_M=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${S0}"><Relationship Id="rId1" Type="${NM}" Target="styles.xml"/></Relationships>`,BM=[{level:1,before:240,color:"2F5496",halfPoints:32,italic:false},{level:2,before:40,color:"2F5496",halfPoints:26,italic:false},{level:3,before:40,color:"1F3763",halfPoints:24,italic:false},{level:4,before:40,color:"2F5496",halfPoints:null,italic:true},{level:5,before:40,color:"2F5496",halfPoints:null,italic:false},{level:6,before:40,color:"1F3763",halfPoints:null,italic:false},{level:7,before:40,color:"1F3763",halfPoints:null,italic:true},{level:8,before:40,color:"272727",halfPoints:21,italic:false},{level:9,before:40,color:"272727",halfPoints:21,italic:true}],$M=e=>`<w:style w:type="paragraph" w:styleId="Heading${e.level}"><w:name w:val="heading ${e.level}"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="9"/><w:qFormat/><w:pPr><w:keepNext/><w:keepLines/><w:spacing w:before="${e.before}" w:after="0"/><w:outlineLvl w:val="${e.level-1}"/></w:pPr><w:rPr>`+(e.italic?"<w:i/><w:iCs/>":"")+`<w:color w:val="${e.color}"/>`+(e.halfPoints===null?"":`<w:sz w:val="${e.halfPoints}"/><w:szCs w:val="${e.halfPoints}"/>`)+"</w:rPr></w:style>",qM=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:styles xmlns:w="${w0}"><w:docDefaults><w:rPrDefault><w:rPr><w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:eastAsia="Calibri" w:cs="Calibri"/><w:sz w:val="22"/><w:szCs w:val="22"/></w:rPr></w:rPrDefault><w:pPrDefault><w:pPr><w:spacing w:after="160" w:line="259" w:lineRule="auto"/></w:pPr></w:pPrDefault></w:docDefaults><w:style w:type="paragraph" w:default="1" w:styleId="Normal"><w:name w:val="Normal"/><w:qFormat/></w:style>`+BM.map($M).join("")+'<w:style w:type="character" w:default="1" w:styleId="DefaultParagraphFont"><w:name w:val="Default Paragraph Font"/><w:uiPriority w:val="1"/><w:semiHidden/><w:unhideWhenUsed/></w:style><w:style w:type="table" w:default="1" w:styleId="TableNormal"><w:name w:val="Normal Table"/><w:uiPriority w:val="99"/><w:semiHidden/><w:unhideWhenUsed/><w:tblPr><w:tblInd w:w="0" w:type="dxa"/><w:tblCellMar><w:top w:w="0" w:type="dxa"/><w:left w:w="108" w:type="dxa"/><w:bottom w:w="0" w:type="dxa"/><w:right w:w="108" w:type="dxa"/></w:tblCellMar></w:tblPr></w:style><w:style w:type="numbering" w:default="1" w:styleId="NoList"><w:name w:val="No List"/><w:uiPriority w:val="99"/><w:semiHidden/><w:unhideWhenUsed/></w:style><w:style w:type="paragraph" w:styleId="Title"><w:name w:val="Title"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="10"/><w:qFormat/><w:pPr><w:spacing w:after="0" w:line="240" w:lineRule="auto"/><w:contextualSpacing/></w:pPr><w:rPr><w:spacing w:val="-10"/><w:kern w:val="28"/><w:sz w:val="56"/><w:szCs w:val="56"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Subtitle"><w:name w:val="Subtitle"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="11"/><w:qFormat/><w:rPr><w:color w:val="5A5A5A"/><w:spacing w:val="15"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Quote"><w:name w:val="Quote"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="29"/><w:qFormat/><w:pPr><w:spacing w:before="160"/><w:jc w:val="center"/></w:pPr><w:rPr><w:i/><w:iCs/><w:color w:val="404040"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Caption"><w:name w:val="caption"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="35"/><w:semiHidden/><w:unhideWhenUsed/><w:pPr><w:spacing w:after="0"/></w:pPr><w:rPr><w:i/><w:iCs/><w:color w:val="404040"/><w:sz w:val="18"/><w:szCs w:val="18"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="NoSpacing"><w:name w:val="No Spacing"/><w:uiPriority w:val="1"/><w:qFormat/><w:pPr><w:spacing w:after="0" w:line="240" w:lineRule="auto"/></w:pPr></w:style><w:style w:type="paragraph" w:styleId="ListParagraph"><w:name w:val="List Paragraph"/><w:basedOn w:val="Normal"/><w:uiPriority w:val="34"/><w:qFormat/><w:pPr><w:ind w:left="720"/><w:contextualSpacing/></w:pPr></w:style></w:styles>',VM=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:document xmlns:w="${w0}"><w:body><w:p/><w:sectPr><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/></w:sectPr></w:body></w:document>`;function pf(){return fflate.zipSync({"[Content_Types].xml":fflate.strToU8(DM),"_rels/.rels":fflate.strToU8(HM),"word/_rels/document.xml.rels":fflate.strToU8(_M),"word/document.xml":fflate.strToU8(VM),"word/styles.xml":fflate.strToU8(qM)})}var I0="http://schemas.microsoft.com/office/2004/12/omml",KM="http://www.w3.org/1998/Math/MathML",WM=4096,k0=32;function R0(e,t){return e.failed||t>k0||e.left<=0?(e.failed=true,false):(e.left-=1,true)}function Ui(e,t){return e.kind!=="textValue"&&e.namespaceUri===chunkFIJZIQXA_cjs.Re&&(t===void 0||e.localName===t)}function mf(e,t){if(e.kind!=="textValue")return e.attributes.find(n=>n.localName==="val"&&n.namespaceUri===t)?.value}function P0(e,t,n){if(!R0(t,n))return "";if(e.kind==="textValue")return e.value;let r="";for(let o of e.children)r+=P0(o,t,n+1);return r}function jM(e,t,n){if(e.kind==="textValue")return "";let r="",o,a=false,i;for(let c of e.children)if(Ui(c,"t"))r+=P0(c,t,n+1);else if(Ui(c,"rPr")&&c.kind!=="textValue")for(let u of c.children)Ui(u,"sty")&&(o=mf(u,chunkFIJZIQXA_cjs.Re)),Ui(u,"nor")&&(a=true);else if(c.kind!=="textValue"&&c.namespaceUri===chunkFIJZIQXA_cjs.la&&c.localName==="rPr"){let u=c.children.find(m=>m.kind!=="textValue"&&m.localName==="color"),p=u?mf(u,chunkFIJZIQXA_cjs.la):void 0;p&&/^[0-9A-Fa-f]{6}$/.test(p)&&(i=p.toUpperCase());}if(r.length===0)return "";let s=`<m:r>${chunkFIJZIQXA_cjs.R(r)}</m:r>`;i!==void 0&&(s=`<span style="color:#${i}">${s}</span>`);let l=!a&&(o===void 0||o==="i"||o==="bi"),d=o==="b"||o==="bi";return l&&(s=`<i>${s}</i>`),d&&(s=`<b>${s}</b>`),s}function T0(e,t,n){if(e.kind==="textValue"||!Ui(e)||!R0(t,n))return "";if(e.localName==="r")return jM(e,t,n);if(e.localName==="ctrlPr")return "";let r=mf(e,chunkFIJZIQXA_cjs.Re),o=r===void 0?"":` m:val="${chunkFIJZIQXA_cjs.S(r)}"`,a="";for(let i of e.children)a+=T0(i,t,n+1);return a.length>0?`<m:${e.localName}${o}>${a}</m:${e.localName}>`:`<m:${e.localName}${o}/>`}function ZM(e){let t="";for(let n of e.match(/\d+(?:\.\d+)?|\p{L}|\s+|./gu)??[]){if(/^\s+$/.test(n))continue;let r=chunkFIJZIQXA_cjs.R(n);/^\d/.test(n)?t+=`<mn>${r}</mn>`:/^\p{L}$/u.test(n)?t+=`<mi>${r}</mi>`:t+=`<mo>${r}</mo>`;}return t}function gf(e,t){if(t>k0)return "";let n=r=>`<mrow>${gf(r,t+1)}</mrow>`;switch(e.kind){case "text":return ZM(e.value);case "fallback":return `<mtext>${chunkFIJZIQXA_cjs.R(e.text)}</mtext>`;case "row":return e.items.map(r=>gf(r,t+1)).join("");case "fraction":return `<mfrac>${n(e.numerator)}${n(e.denominator)}</mfrac>`;case "radical":return e.degree===void 0?`<msqrt>${n(e.radicand)}</msqrt>`:`<mroot>${n(e.radicand)}${n(e.degree)}</mroot>`;case "script":{let r=n(e.base);return e.subscript&&e.superscript?`<msubsup>${r}${n(e.subscript)}${n(e.superscript)}</msubsup>`:e.subscript?`<msub>${r}${n(e.subscript)}</msub>`:e.superscript?`<msup>${r}${n(e.superscript)}</msup>`:r}case "nary":{let r=`<mo>${chunkFIJZIQXA_cjs.R(e.operator)}</mo>`,o=e.lowerLimit?n(e.lowerLimit):"",a=e.upperLimit?n(e.upperLimit):"";return `<mrow>${o&&a?`<munderover>${r}${o}${a}</munderover>`:o?`<munder>${r}${o}</munder>`:a?`<mover>${r}${a}</mover>`:r}${n(e.body)}</mrow>`}}}function C0(e){if(!chunkFIJZIQXA_cjs.Ye(e))return "";let t=chunkFIJZIQXA_cjs.Xe(e),n=t?chunkFIJZIQXA_cjs._e(e):chunkFIJZIQXA_cjs.Te(e),r={left:WM,failed:false},o=T0(e,r,0),a=n===null?"":`<math xmlns="${KM}"${t?' display="block"':""}>${gf(n.expression,0)}</math>`;return r.failed||o.length===0?a:`<!--[if gte msEquation 12]>${o}<![endif]--><![if !msEquation]>${a}<![endif]>`}function E0(e){return e.includes("<!--[if gte msEquation 12]>")}var Ia="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",zM=(()=>{let e=new Int16Array(128).fill(-1);for(let t=0;t<Ia.length;t+=1)e[Ia.charCodeAt(t)]=t;return e})();function Wl(e,t){if(e.length===0)return null;let n=e.length%4;if(n===1)return null;let r=n===0?e:e+"=".repeat(4-n),o=r.endsWith("==")?2:r.endsWith("=")?1:0,a=r.length/4*3-o;if(a<=0||a>t)return null;let i=new Uint8Array(a),s=0;for(let l=0;l<r.length;l+=4){let d=0,c=0;for(let u=0;u<4;u+=1){let p=r.charCodeAt(l+u);if(p===61){if(l+u<r.length-o)return null;continue}let m=p<128?zM[p]:-1;if(m<0)return null;d=d<<6|m,c+=6;}d<<=24-c,c>=12&&(i[s++]=d>>>16&255),c>=18&&(i[s++]=d>>>8&255),c>=24&&(i[s++]=d&255);}return s===a?i:null}function jl(e){let t=[],n="";for(let r=0;r<e.length;r+=3){let o=e[r],a=r+1<e.length?e[r+1]:0,i=r+2<e.length?e[r+2]:0;n+=Ia[o>>2]+Ia[(o&3)<<4|a>>4],n+=r+1<e.length?Ia[(a&15)<<2|i>>6]:"=",n+=r+2<e.length?Ia[i&63]:"=",n.length>=32768&&(t.push(n),n="");}return t.push(n),t.join("")}var UM=16*1024*1024,M0=64*1024*1024,A0="data-docx-fragment",F0="data-docx-fragment-end",GM=jl;function L0(e,t){let n=t?.lastMarkCovered?"covered":"open",r=t?`<div ${A0}="${GM(t.bytes)}" ${F0}="${n}">${e}</div>`:`<div>${e}</div>`;return E0(e)?`<html xmlns:m="${I0}"><body>${r}</body></html>`:r}function O0(e,t){let n=`${t}="`,r=e.indexOf(n);if(r===-1||r>M0)return null;let o=r+n.length,a=e.indexOf('"',o);return a===-1?null:e.slice(o,a)}function ka(e,t=UM){if(e.length>M0)return null;let n=O0(e,A0);if(n===null||n.length===0)return null;let r=Wl(n,t);if(r===null||r.byteLength===0)return null;let o=O0(e,F0);return {bytes:r,lastMarkCovered:o==="covered"}}function Eo(e){if(e==null)return null;let t=e.trim();return /^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{1,8}){0,3}$/.test(t)?t:null}var yf=["single","words","double","thick","dotted","dottedHeavy","dash","dashedHeavy","dashLong","dashLongHeavy","dotDash","dashDotHeavy","dotDotDash","dashDotDotHeavy","wave","wavyHeavy","wavyDouble"],hf={Normal:"MsoNormal",ListParagraph:"MsoListParagraph",Title:"MsoTitle",Subtitle:"MsoSubtitle",Caption:"MsoCaption",Quote:"MsoQuote",IntenseQuote:"MsoIntenseQuote",BodyText:"MsoBodyText",FootnoteText:"MsoFootnoteText"},bf=new Map([...Object.entries(hf).filter(([e])=>e!=="Normal").map(([e,t])=>[t,e]),["MsoListParagraphCxSpFirst","ListParagraph"],["MsoListParagraphCxSpMiddle","ListParagraph"],["MsoListParagraphCxSpLast","ListParagraph"]]);function N0(e){return e===void 0?null:/^Heading[7-9]$/.test(e)?`Mso${e}`:Object.hasOwn(hf,e)?hf[e]:null}var vf=Object.fromEntries(chunkEO4C5QJW_cjs.l),xf={left:"left",start:"left",center:"center",right:"right",end:"right",both:"justify",distribute:"justify"};function D0(e){let t=e.trim();if(t.length===0||t.length>255)return null;let n=t.replace(/[^\p{L}\p{N} _.,-]/gu,"");return n.length===0?null:`"${chunkFIJZIQXA_cjs.V(n)}"`}var XM=new Map([["single","solid"],["thick","solid"],["double","double"],["triple","double"],["dotted","dotted"],["dashed","dashed"],["dashSmallGap","dashed"],["dotDash","dashed"],["dotDotDash","dashed"],["wave","solid"],["hairline","solid"],["inset","solid"],["outset","solid"]]);function Oo(e){if(e===null)return null;let t=chunkFIJZIQXA_cjs.Yf(e,"val",chunkFIJZIQXA_cjs.la);if(t===void 0||t==="nil"||t==="none")return null;let n=XM.get(t)??"solid",r=chunkFIJZIQXA_cjs.Yf(e,"sz",chunkFIJZIQXA_cjs.la),o=r!==void 0&&/^\d{1,4}$/.test(r)?Number.parseInt(r,10):0,a=o>0?o/8:.5,i=`${Math.round(a*100)/100}pt`,s=chunkFIJZIQXA_cjs.Yf(e,"color",chunkFIJZIQXA_cjs.la),l=s!==void 0&&/^[0-9A-Fa-f]{6}$/.test(s)?`#${s}`:"#000000";return `${i} ${n} ${l.toLowerCase()}`}function H0(e,t){return e===null||e<=0?[]:t==="exact"||t==="atLeast"?[`line-height:${`${Math.round(e/20*100)/100}pt`}`,`mso-line-height-rule:${t==="exact"?"exactly":"at-least"}`]:[`line-height:${Math.round(e/240*100)/100}`]}var YM=new Map([["double","double"],["wavyDouble","double"],["dotted","dotted"],["dottedHeavy","dotted"],["dash","dashed"],["dashedHeavy","dashed"],["dashLong","dashed"],["dashLongHeavy","dashed"],["dotDash","dashed"],["dashDotHeavy","dashed"],["dotDotDash","dashed"],["dashDotDotHeavy","dashed"],["wave","wavy"],["wavyHeavy","wavy"]]),QM=new Set(yf);function _0(e){if(e===null)return [];let t=chunkFIJZIQXA_cjs.Yf(e,"val",chunkFIJZIQXA_cjs.la),n=[],r=t===void 0?void 0:YM.get(t);r!==void 0&&n.push(`text-decoration-style:${r}`),t!==void 0&&t!=="single"&&QM.has(t)&&n.push(`text-underline:${t}`);let o=chunkFIJZIQXA_cjs.Yf(e,"color",chunkFIJZIQXA_cjs.la);return o!==void 0&&/^[0-9A-Fa-f]{6}$/.test(o)&&n.push(`text-decoration-color:#${o.toLowerCase()}`),t==="thick"&&n.push("text-decoration-thickness:2px"),n}function B0(e,t){return e===null||e<=0?"":`height:${Math.round(e/20*100)/100}pt;mso-height-rule:${t==="exact"?"exactly":"at-least"}`}function $0(e,t,n,r){if(e.namespaceUri!==chunkFIJZIQXA_cjs.la)return "";let o=e.localName==="footnoteRef"?"footnote":e.localName==="endnoteRef"?"endnote":null,a=e.localName==="footnoteReference"?"footnote":e.localName==="endnoteReference"?"endnote":null,i=o??a;if(i===null)return "";let s=chunkFIJZIQXA_cjs.Yf(e,"id",chunkFIJZIQXA_cjs.la),l=o===null?s!==void 0&&/^\d{1,10}$/.test(s)?Number.parseInt(s,10):void 0:t?.id;if(l===void 0||!Number.isInteger(l)||l<1||o!==null&&t?.kind!==o||l>2147483647||o===null&&!r(i,l))return "";let d=i==="footnote",c=o!==null,u=d?"MsoFootnoteReference":"MsoEndnoteReference",p=d?"ftn":"edn",m=c?`#_${p}ref${l}`:`#_${p}${l}`,h=c?`_${p}${l}`:`_${p}ref${l}`;return `<a style="mso-${d?"footnote":"endnote"}-id:${p}${l}" href="${m}" name="${h}"><span class="${u}"><span style="mso-special-character:footnote">[${n(i,l)}]</span></span></a>`}function q0(e){if(e.namespaceUri!==chunkFIJZIQXA_cjs.la||e.localName!=="ptab")return "";let t=chunkFIJZIQXA_cjs.Yf(e,"alignment",chunkFIJZIQXA_cjs.la),n=chunkFIJZIQXA_cjs.Yf(e,"relativeTo",chunkFIJZIQXA_cjs.la),r=chunkFIJZIQXA_cjs.Yf(e,"leader",chunkFIJZIQXA_cjs.la)??"none";if(t!=="left"&&t!=="center"&&t!=="right")return "";let o=n==="margin"||n==="leftMargin"?"margin":n==="indent"?"indent":null;return o===null||r!=="none"&&r!=="dot"&&r!=="hyphen"&&r!=="underscore"&&r!=="middleDot"&&r!=="heavy"?"":`<w:PTab Alignment="${t.toUpperCase()}" RelativeTo="${o.toUpperCase()}" Leader="${r.toUpperCase()}"></w:PTab>`}function bt(e){let t=e.trim().toLowerCase();if(/^-?0+(\.0+)?$/.test(t))return 0;let n=/^(-?(?:\d+(?:\.\d+)?|\.\d+))(px|pt|in|cm|mm|pc)$/.exec(t);if(!n)return null;let r=Number.parseFloat(n[1]);if(!Number.isFinite(r))return null;switch(n[2]){case "px":return r*.75;case "in":return r*72;case "cm":return r*72/2.54;case "mm":return r*72/25.4;case "pc":return r*12;default:return r}}function W0(e){return e.includes("urn:schemas-microsoft-com:office")||e.includes("mso-")||e.includes("<o:p")||e.includes("class=Mso")||e.includes('class="Mso')||e.includes("class='Mso")}function j0(e,t){for(let r of e.classList){let o=/^MsoHeading([1-9])$/.exec(r);if(o)return `Heading${o[1]}`;let a=/^Heading([1-9])$/.exec(r);if(a)return `Heading${a[1]}`;let i=bf.get(r);if(i!==void 0)return i}if(e.classList.contains("docx-outline"))return;let n=t?/^h([1-6])$/.exec(Ue(e)):null;return n?`Heading${n[1]}`:void 0}var Z0=262144,JM=4096,eA=256,tA=2048,nA=8,rA=new Set(["MsoNormal",...bf.keys(),...Array.from({length:9},(e,t)=>`MsoHeading${t+1}`),...Array.from({length:9},(e,t)=>`Heading${t+1}`)]),oA=new Map([["left","left"],["start","start"],["center","center"],["right","right"],["end","end"],["justify","both"]]),aA=/^\s*(p|li|div)\.([A-Za-z][A-Za-z0-9]{0,31})\s*$/i;function iA(e){let t="";for(let n=0;n<e.length;n+=1){if(e.startsWith("<!--",n)){n+=3;continue}if(e.startsWith("-->",n)){n+=2;continue}t+=e[n];}return t}function sA(e,t){let n=0;for(let r=t;r<e.length;r+=1){let o=e[r];if(o==="{"){if(n+=1,n>4)return null}else if(o==="}"&&(n-=1,n===0))return r+1}return null}function lA(e,t){for(let n=t+1;n<e.length;n+=1){let r=e[n];if(r===";")return n+1;if(r==="{")return sA(e,n)}return null}function dA(e){let t=e.split(",");if(t.length===0||t.length>nA)return null;let n=[];for(let r of t){let o=aA.exec(r);if(!o)return null;let a=o[2];if(!rA.has(a))return null;n.includes(a)||n.push(a);}return n}function cA(e){let t;for(let n of e.split(";")){let r=n.indexOf(":");if(r<=0||n.slice(0,r).trim().toLowerCase()!=="text-align")continue;let a=n.slice(r+1).trim().toLowerCase();if(a.length===0||a.length>32||a.includes("("))continue;let i=0;for(;i<a.length&&a.charCodeAt(i)>32;)i+=1;let s=oA.get(a.slice(0,i));s!==void 0&&(t=s);}return t}function uA(e){let t=new Map,n=()=>({ok:false,alignments:new Map});if(e.length===0)return {ok:true,alignments:t};if(e.length>Z0)return n();let r=iA(e),o=0,a=0;for(;o<r.length&&a<JM;){for(;o<r.length&&r.charCodeAt(o)<=32;)o+=1;if(o>=r.length)break;if(r[o]==="@"){let p=lA(r,o);if(p===null)return n();o=p;continue}let i=r.indexOf("{",o);if(i<0)return n();let s=r.slice(o,i),l=r.indexOf("}",i+1);if(l<0)return n();let d=r.slice(i+1,l);if(a+=1,o=l+1,s.length>eA||d.length>tA||d.includes("{"))return n();let c=dA(s),u=cA(d);if(!(!c||u===void 0))for(let p of c)t.set(p,u);}for(;o<r.length&&r.charCodeAt(o)<=32;)o+=1;return o<r.length?n():{ok:true,alignments:t}}function z0(e){let t=new Map,n=e.getElementsByTagName("style");if(n.length>16)return new Map;for(let r=0;r<n.length;r+=1){let o=n[r]?.textContent??"";if(o.length>Z0)return new Map;let a=uA(o);if(!a.ok)return new Map;for(let[i,s]of a.alignments)t.set(i,s);}return t}var fA=262144;function U0(e,t=fA){let n=e.getElementsByTagName("style"),r="";for(let o=0;o<n.length&&o<16;o+=1){let a=n[o]?.textContent??"";a.length>t||r.length+a.length>t||(r+=`
|
|
3
|
-
${a}`);}return r}function G0(e,t,n){for(let o of t.classList){let a=n.get(o);if(a!==void 0){e.jc=a;break}}let r=t.getAttribute("align")?.trim().toLowerCase();r==="left"||r==="center"||r==="right"?e.jc=r:r==="justify"&&(e.jc="both");}function wf(e,t,n,r){let o=bt(t.get(n)??"");if(o!==null&&o>0)return o/.75;let a=e.getAttribute(n)?.trim()??"";if(!/^[1-9]\d{0,4}$/.test(a))return null;let i=Number.parseInt(a,10);return r?i/.75:i}function Ra(e){return e.nodeType===1}function Ue(e){return e.tagName.toLowerCase()}var pA=new Map("black:000000 white:FFFFFF red:FF0000 green:008000 blue:0000FF yellow:FFFF00 gray:808080 grey:808080 silver:C0C0C0 maroon:800000 navy:000080 purple:800080 orange:FFA500 aqua:00FFFF cyan:00FFFF fuchsia:FF00FF magenta:FF00FF lime:00FF00 olive:808000 windowtext:000000".split(" ").map(e=>e.split(":"))),mA=new Map([["yellow","yellow"],["aqua","cyan"],["cyan","cyan"],["fuchsia","magenta"],["magenta","magenta"],["lime","green"],["green","green"],["olive","darkYellow"],["red","red"],["blue","blue"],["black","black"],["white","white"],["darkblue","darkBlue"],["darkcyan","darkCyan"],["darkgray","darkGray"],["darkgrey","darkGray"],["darkgreen","darkGreen"],["darkmagenta","darkMagenta"],["darkred","darkRed"],["darkyellow","darkYellow"],["lightgray","lightGray"],["lightgrey","lightGray"]]),gA=/url\s*\(|image\s*\(|image-set\s*\(|element\s*\(|cross-fade\s*\(/i,hA=new Map(yf.map(e=>[e.toLowerCase(),e])),V0=new WeakMap;function lt(e){let t=V0.get(e);if(t!==void 0)return t;let n=new Map;V0.set(e,n);let r=e.getAttribute("style");if(!r||r.length>8192)return n;for(let o of r.split(";")){let a=o.indexOf(":");if(a<=0)continue;let i=o.slice(0,a).trim().toLowerCase(),s=o.slice(a+1).trim();i.length>0&&s.length>0&&(n.delete(i),n.set(i,s));}return n}function Zr(e){let t=e.trim().toLowerCase(),n=pA.get(t);if(n)return n;let r=/^#([0-9a-f]{6})$/.exec(t);if(r)return r[1].toUpperCase();let o=/^#([0-9a-f]{3})$/.exec(t);if(o){let[i,s,l]=o[1];return `${i}${i}${s}${s}${l}${l}`.toUpperCase()}let a=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,[^)]*)?\)$/.exec(t);if(a){let i=s=>Math.min(255,Number.parseInt(s,10)).toString(16).padStart(2,"0");return `${i(a[1])}${i(a[2])}${i(a[3])}`.toUpperCase()}return null}function yA(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(!(t.length===0||t.length>32||/[^a-z]/.test(t)))return mA.get(t)}function K0(e){if(e===void 0)return null;let t=e.trim();if(t.length===0||t.length>128||gA.test(t))return null;let n=t.toLowerCase();return n==="transparent"||n==="none"?null:Zr(t)}function mn(e,t,n){return Math.min(n,Math.max(t,e))}function zl(e){let t=null;for(let[n,r]of e)if(n==="background")t=K0(r);else if(n==="background-color"){let o=r.trim().toLowerCase();if(o==="transparent"||o==="none"||o==="initial"){t=null;continue}let a=K0(r);a!==null&&(t=a);}return t}var bA=new Set(["left","center","right","decimal","bar"]),vA=new Map([["dotted","dot"],["dot","dot"],["dashed","hyphen"],["hyphen","hyphen"],["lined","underscore"],["underscore","underscore"],["middledot","middleDot"],["heavy","heavy"]]);function xA(e){if(e===void 0||e.length===0||e.length>512)return;let t="left",n,r=[];for(let o of e.trim().toLowerCase().split(/\s+/)){if(bA.has(o)){t=o;continue}if(o==="list"){t="left";continue}let a=vA.get(o);if(a!==void 0){n=a;continue}let i=bt(o);if(!(i===null||i<0)){if(r.push({val:t,posTwips:mn(Math.round(i*20),0,31680),...n===void 0?{}:{leader:n}}),r.length>=32)break;t="left",n=void 0;}}return r.length>0?r:void 0}var wA=new Map([["solid","single"],["single","single"],["double","double"],["dotted","dotted"],["dashed","dashed"]]);function Sf(e){return e.trim().replace(/\([^)]*\)/g,t=>t.replace(/\s+/g,"")).split(/\s+/)}var SA=new Map([["thin",.75],["medium",2.25],["thick",3.75]]);function Zl(e){if(e===void 0||e.length===0||e.length>128)return;let t,n=false,r,o;for(let a of Sf(e)){let i=a.toLowerCase();if(i==="none"||i==="hidden"){n=true;continue}let s=wA.get(i);if(s!==void 0){t=s;continue}let l=SA.get(a.toLowerCase())??bt(a);if(l!==null){r=l;continue}let d=Zr(a);if(d!==null){o=d;continue}return}if(n)return "suppressed";if(t!==void 0)return r===void 0?{val:t,szEighthPoints:4,color:o??"000000"}:r<=0?"suppressed":{val:t,szEighthPoints:mn(Math.round(r*8),2,96),color:o??"000000"}}function Ul(e){let t=e.getAttribute("style");return t?/mso-list\s*:[^;]{0,128}ignore/i.test(t.slice(0,8192)):false}function Gi(e,t){return t==="b"||t==="strong"?{...e,bold:true}:t==="i"||t==="em"?{...e,italic:true}:t==="u"||t==="ins"?{...e,underline:true}:t==="s"||t==="strike"||t==="del"?{...e,strike:true}:t==="sub"?{...e,vertAlign:"subscript"}:t==="sup"?{...e,vertAlign:"superscript"}:t==="code"||t==="tt"||t==="kbd"||t==="samp"?{...e,font:"Courier New"}:e}function If(e,t){if(t.size===0)return e;let n={...e},r=t.get("font-weight")?.toLowerCase();if(r!==void 0){let x=Number.parseInt(r,10);r==="bold"||x>=600?n.bold=true:(r==="normal"||x<600)&&(n.bold=false);}let o=t.get("font-style");o!==void 0&&(n.italic=o.toLowerCase().includes("italic"));let a=(t.get("text-decoration")??t.get("text-decoration-line"))?.toLowerCase();a!==void 0&&(a.includes("underline")&&(n.underline=true),a.includes("line-through")&&(n.strike=true),a.includes("none")&&(n.underline=n.strike=false));let i=t.get("font-variant")?.toLowerCase();i!==void 0&&(i.includes("small-caps")?n.smallCaps=true:(i.includes("normal")||i.includes("none"))&&(n.smallCaps=false));let s=t.get("text-transform")?.trim().toLowerCase();s==="uppercase"?n.caps=true:s==="none"&&(n.caps=false);let l=t.get("text-underline");if(l!==void 0&&l.length<=128)for(let x of l.trim().split(/\s+/)){let I=x.toLowerCase(),M=hA.get(I);if(M!==void 0)n.underline=true,n.underlineVal=M;else {let k=Zr(x);k!==null&&(n.underlineColor=k);}}let d=t.get("text-decoration-style")?.trim().toLowerCase();if(d==="double"&&n.strike&&!n.underline&&(n.doubleStrike=true),n.underline){d==="double"?n.underlineVal="double":d==="dotted"?n.underlineVal="dotted":d==="dashed"?n.underlineVal="dash":d==="wavy"&&(n.underlineVal="wave");let x=Zr(t.get("text-decoration-color")??"");x!==null&&(n.underlineColor=x);}let c=Zr(t.get("color")??"");c&&(n.color=c);let u=yA(t.get("mso-highlight"));if(u)n.highlight=u,delete n.shdFill;else {let x=zl(t);x&&(n.shdFill=x);}let p=bt(t.get("font-size")??"");p!==null&&p>0&&(n.szHalfPoints=mn(Math.round(p*2),2,3276));let m=t.get("font-family");if(m!==void 0){let x=m.split(",")[0].trim().replace(/^['"]|['"]$/g,"");x.length>0&&x.length<=64&&(n.font=x);}let h=bt(t.get("letter-spacing")??"");h!==null&&(n.charSpacingTwentieths=mn(Math.round(h*20),-31680,31680));let y=t.get("vertical-align")?.trim().toLowerCase();y==="sub"?n.vertAlign="subscript":y==="super"&&(n.vertAlign="superscript");let g=Eo(t.get("mso-ansi-language")),b=Eo(t.get("mso-fareast-language")),S=Eo(t.get("mso-bidi-language"));return g!==null&&(n.langVal=g),b!==null&&(n.langEastAsia=b),S!==null&&(n.langBidi=S),t.get("direction")?.trim().toLowerCase()==="rtl"&&(n.rtl=true),n}function Mo(e,t){let n=If(e,lt(t)),r=Eo(t.getAttribute("lang"));return r!==null&&(n={...n,lang:r}),t.getAttribute("dir")?.trim().toLowerCase()==="rtl"&&(n={...n,rtl:true}),n}function X0(e,t){let n=t.get("text-align")?.toLowerCase();n==="left"||n==="right"||n==="start"||n==="end"?e.jc=n:n==="center"?e.jc="center":n==="justify"&&(e.jc="both"),t.get("direction")?.trim().toLowerCase()==="rtl"&&(e.bidi=true);let r={top:null,right:null,bottom:null,left:null},o=t.get("margin");if(o!==void 0&&o.length<=128){let b=o.trim().split(/\s+/).map(S=>bt(S));if(b.length>=1&&b.length<=4&&!b.some(S=>S===null)){let[S,x=S,I=S,M=x]=b.length===2?[b[0],b[1],b[0],b[1]]:b.length===3?[b[0],b[1],b[2],b[1]]:b;r.top=S??null,r.right=x??null,r.bottom=I??null,r.left=M??null;}}let a=bt(t.get("margin-left")??"")??r.left;a!==null&&(a>0||a===0&&!e.numPr)&&(e.indLeftTwips=mn(Math.round(a*20),0,31680));let i=bt(t.get("margin-right")??"")??r.right;i!==null&&i>=0&&(e.indRightTwips=mn(Math.round(i*20),0,31680));let s=bt(t.get("text-indent")??"");if(s!==null&&s!==0){let b=mn(Math.round(s*20),-31680,31680);b!==0&&(e.firstLineTwips=b);}let l=bt(t.get("margin-top")??"")??r.top;l!==null&&l>=0&&(e.spacingBeforeTwips=mn(Math.round(l*20),0,31680));let d=bt(t.get("margin-bottom")??"")??r.bottom;d!==null&&d>=0&&(e.spacingAfterTwips=mn(Math.round(d*20),0,31680));let c=t.get("line-height")?.trim()??"",u=t.get("mso-line-height-rule")?.trim().toLowerCase(),p=bt(c);if(p!==null&&p>0)e.lineTwentieths=mn(Math.round(p*20),24,31680),e.lineRule=u==="exactly"?"exact":"atLeast";else if(/^\d+(\.\d+)?$/.test(c)&&Number.parseFloat(c)>0)e.lineTwentieths=mn(Math.round(240*Number.parseFloat(c)),24,9600),e.lineRule="auto";else if(/^\d+(\.\d+)?%$/.test(c)){let b=Number.parseFloat(c);b>0&&(e.lineTwentieths=mn(Math.round(2.4*b),24,9600),e.lineRule="auto");}(t.get("page-break-before")?.trim().toLowerCase()==="always"||t.get("break-before")?.trim().toLowerCase()==="page")&&(e.pageBreakBefore=true),t.get("page-break-after")?.trim().toLowerCase()==="avoid"&&(e.keepNext=true),t.get("page-break-inside")?.trim().toLowerCase()==="avoid"&&(e.keepLines=true),(/^[2-9]\d?$/.test(t.get("widows")?.trim()??"")||/^[2-9]\d?$/.test(t.get("orphans")?.trim()??""))&&(e.widowControl=true);let m=zl(t);m&&(e.shdFill=m);let h=xA(t.get("tab-stops"));h!==void 0&&(e.tabs=h);let y=Zl(t.get("mso-border-alt"))??Zl(t.get("border")),g={};for(let b of ["top","left","bottom","right"]){let S=Zl(t.get(`mso-border-${b}-alt`))??Zl(t.get(`border-${b}`))??y;S!==void 0&&S!=="suppressed"&&(g[b]=S);}Object.keys(g).length>0&&(e.borders=g);}var IA="http://schemas.openxmlformats.org/drawingml/2006/picture",kA=/^data:image\/(?:png|jpeg|jpg|gif|bmp|webp|svg\+xml|tiff|tif|x-emf|emf|x-wmf|wmf);base64,([A-Za-z0-9+/=]+)$/i,RA=new Map([["image/png","png"],["image/jpeg","jpeg"],["image/gif","gif"],["image/bmp","bmp"],["image/webp","webp"],["image/svg+xml","svg"],["image/tiff","tiff"],["image/x-emf","emf"],["image/x-wmf","wmf"]]);function Y0(e,t,n){return Math.min(n,Math.max(t,e))}function Q0(e,t,n,r){let o=e.getAttribute("src");if(o===null||o.length>n.maxImageBytes*2)return;let a=kA.exec(o);if(!a)return;let i=n.mediaBySrc.get(o),s=i===void 0?void 0:n.media.get(i),l=s??Wl(a[1],n.maxImageBytes);if(l==null)return;let d=chunkFIJZIQXA_cjs.de(l),c=RA.get(d);if(c===void 0)return;let u=d==="image/png"||d==="image/jpeg"||d==="image/gif"||d==="image/bmp"||d==="image/webp"?chunkFIJZIQXA_cjs.ie(l,d):null,p=lt(e),m=wf(e,p,"width",n.wordHtml),h=wf(e,p,"height",n.wordHtml);u!==null?m===null&&h===null?(m=u.pixelWidth*96/(u.dpiX??96),h=u.pixelHeight*96/(u.dpiY??96)):m!==null&&h===null?h=m*u.pixelHeight/u.pixelWidth:m===null&&h!==null&&(m=h*u.pixelWidth/u.pixelHeight):m!==null&&h===null?h=m*2/3:m===null&&h!==null&&(m=h*3/2);let y=m===null?381e4:Y0(Math.round(m*9525),9525,3e7),g=h===null?254e4:Y0(Math.round(h*9525),9525,3e7),b=s===void 0?void 0:i;b===void 0&&(n.imageCount+=1,b=`word/media/image${n.imageCount}.${c}`,n.media.set(b,l),n.mediaBySrc.set(o,b),n.mediaExtensions.has(c)||n.mediaExtensions.set(c,d));let S=r(b.replace("word/",""));n.docPrId+=1,t.push(`<w:r><w:drawing><wp:inline distT="0" distB="0" distL="0" distR="0"><wp:extent cx="${y}" cy="${g}"/><wp:docPr id="${n.docPrId}" name=""/><wp:cNvGraphicFramePr/><a:graphic><a:graphicData uri="${IA}"><pic:pic><pic:nvPicPr><pic:cNvPr id="0" name="" descr=""/><pic:cNvPicPr/></pic:nvPicPr><pic:blipFill><a:blip r:embed="${S}"/><a:srcRect/><a:stretch><a:fillRect/></a:stretch></pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${y}" cy="${g}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic></wp:inline></w:drawing></w:r>`);}var PA="http://schemas.openxmlformats.org/wordprocessingml/2006/main",TA='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',J0=[{text:"\uF0B7",font:"Symbol"},{text:"o",font:"Courier New"},{text:"\uF0A7",font:"Wingdings"}];function ex(e,t,n){let r=720*(n+1);if(e==="bullet"){let a=J0[n%J0.length];return `<w:lvl w:ilvl="${n}"><w:start w:val="1"/><w:numFmt w:val="bullet"/><w:lvlText w:val="${chunkFIJZIQXA_cjs.S(a.text)}"/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="${r}" w:hanging="360"/></w:pPr><w:rPr><w:rFonts w:ascii="${a.font}" w:hAnsi="${a.font}" w:hint="default"/></w:rPr></w:lvl>`}let o=e==="lowerRoman"||e==="upperRoman";return `<w:lvl w:ilvl="${n}"><w:start w:val="${t}"/><w:numFmt w:val="${e}"/><w:lvlText w:val="%${n+1}."/><w:lvlJc w:val="${o?"right":"left"}"/><w:pPr><w:ind w:left="${r}" w:hanging="${o?180:360}"/></w:pPr></w:lvl>`}var CA=new Map([["i",1],["v",5],["x",10],["l",50],["c",100],["d",500],["m",1e3]]),EA=new Map([["alpha-lower","lowerLetter"],["alpha-upper","upperLetter"],["roman-lower","lowerRoman"],["roman-upper","upperRoman"],["bullet","bullet"],["image","bullet"],["decimal","decimal"],["arabic","decimal"]]),tx=/@list\s+l(\d{1,4}):level([1-9])(?:[\s:]+lfo(\d{1,4}))?\s*\{([^{}]{0,2048})\}/g;function nx(e){let t=new Map;if(e.length===0||e.length>262200)return t;tx.lastIndex=0;let n,r=0;for(;(n=tx.exec(e))!==null&&r<512;){r+=1;let o="decimal",a=null;for(let s of n[4].split(";")){let l=s.indexOf(":");if(l<=0)continue;let d=s.slice(0,l).trim().toLowerCase(),c=s.slice(l+1).trim().toLowerCase();d==="mso-level-number-format"?o=EA.get(c)??null:d==="mso-level-start-at"&&/^\d{1,5}$/.test(c)&&(a=Math.min(32767,Number.parseInt(c,10)));}if(o===null)continue;let i=n[3]===void 0?`l${n[1]}:level${n[2]}`:`l${n[1]}:level${n[2]}:lfo${n[3]}`;t.has(i)||t.set(i,{kind:o,start:a});}return t}function rx(e,t){let n=e.trim().replace(/^\(/,"");if(t==="decimal"){let r=/^(\d{1,5}(?:\.\d{1,5})*)/.exec(n);if(!r)return null;let o=r[1].split(".");return Math.min(32767,Number.parseInt(o[o.length-1],10))}if(t==="lowerRoman"||t==="upperRoman"){let r=/^([A-Za-z]{1,8})/.exec(n);return r?ox(r[1]):null}if(t==="lowerLetter"||t==="upperLetter"){let r=/^(([A-Za-z])\2{0,4})(?![A-Za-z])/.exec(n);if(!r)return null;let o=r[2].toLowerCase().charCodeAt(0);return Math.min(32767,(r[1].length-1)*26+(o-96))}return null}var OA=/^m{0,4}(cm|cd|d?c{0,3})(xc|xl|l?x{0,3})(ix|iv|v?i{0,3})$/;function ox(e){let t=e.toLowerCase();if(!OA.test(t))return null;let n=0,r=0;for(let o of t){let a=CA.get(o);if(a===void 0)return null;n+=a,r>0&&r<a&&(n-=2*r),r=a;}return n>0&&n<=32767?n:null}function ax(e){let t=e.trim().replace(/^\(/,""),n=/^(\d{1,5}(?:\.\d{1,5})*)[.)]/.exec(t);if(n){let i=n[1].split(".");return {kind:"decimal",start:Math.min(32767,Number.parseInt(i[i.length-1],10))}}let r=/^([A-Za-z])[.)]/.exec(t);if(r){let i=r[1].toLowerCase();if(i==="i"||i==="v"||i==="x"){let l=i==="i"?1:i==="v"?5:10;return {kind:r[1]===i?"lowerRoman":"upperRoman",start:l}}let s=r[1].charCodeAt(0);return s>=97?{kind:"lowerLetter",start:s-96}:{kind:"upperLetter",start:s-64}}let o=/^([A-Za-z]{2,8})[.)]/.exec(t);if(o){let i=o[1],s=i===i.toLowerCase(),l=/^([A-Za-z])\1+$/.test(i);if(!l||/^[iI]+$/.test(i)){let d=ox(i);if(d!==null)return {kind:s?"lowerRoman":"upperRoman",start:d}}if(l){let d=i.toLowerCase().charCodeAt(0),c=Math.min(32767,(i.length-1)*26+(d-96));return {kind:s?"lowerLetter":"upperLetter",start:c}}}let a=/\d{1,5}/.exec(t);return a?{kind:"decimal",start:Math.min(32767,Number.parseInt(a[0],10))}:{kind:"bullet",start:1}}var MA=new Map([["none","none"],["decimal","decimal"],["upper-alpha","upperLetter"],["upper-latin","upperLetter"],["lower-alpha","lowerLetter"],["lower-latin","lowerLetter"],["upper-roman","upperRoman"],["lower-roman","lowerRoman"]]);function ix(e){if(e.localName.toLowerCase()!=="ol")return "bullet";let t=lt(e).get("list-style-type")?.trim().toLowerCase(),n=t===void 0?void 0:MA.get(t);if(n!==void 0)return n;let r=e.getAttribute("type");return r==="A"?"upperLetter":r==="a"?"lowerLetter":r==="I"?"upperRoman":r==="i"?"lowerRoman":"decimal"}function kf(e){let t=e.getAttribute("start")?.trim();return t!==void 0&&/^\d{1,5}$/.test(t)?Math.min(32767,Number.parseInt(t,10)):1}function sx(e){let t=e.map((r,o)=>{let a=r.levels.get(0)??r.levels.values().next().value??{kind:"decimal"},i=Array.from({length:9},(s,l)=>{let d=r.levels.get(l);return d?ex(d.kind,d.start,l):ex(a.kind==="bullet"?"bullet":"decimal",1,l)}).join("");return `<w:abstractNum w:abstractNumId="${o}"><w:multiLevelType w:val="hybridMultilevel"/>${i}</w:abstractNum>`}).join(""),n=e.map((r,o)=>`<w:num w:numId="${r.numId}"><w:abstractNumId w:val="${o}"/></w:num>`).join("");return `${TA}<w:numbering xmlns:w="${PA}">${t}${n}</w:numbering>`}function Dn(e){if(e==null)return null;let t=e.trim();if(t.length===0||t.length>256)return null;if(/^[A-Za-z_][A-Za-z0-9_]{0,39}$/.test(t))return t;let n=t.replace(/[^A-Za-z0-9_]/g,"_");if(n.replace(/_/g,"").length===0)return null;let r=5381;for(let i=0;i<t.length;i+=1)r=(Math.imul(r,33)^t.charCodeAt(i))>>>0;let o=`_${r.toString(36)}`,a=n.slice(0,40-o.length);return /^[A-Za-z_]/.test(a)||(a=`_${a.slice(0,39-o.length)}`),`${a}${o}`}function lx(e){if(e===null)return false;if(e.startsWith("#"))return Dn(e.slice(1))!==null;let t=chunkFIJZIQXA_cjs.Q(e);return t?.ok===true&&t.href.length>0}function dx(e,t){if(e!==void 0&&e.startsWith("#")){let o=Dn(e.slice(1)),a=Dn(t)??o;return a===null?null:`#${a}`}let n=e===void 0?null:chunkFIJZIQXA_cjs.Q(e),r=Dn(t);return n?.ok===true&&n.href.length>0?r===null?n.href:`${n.href.split("#")[0]}#${r}`:r===null?null:`#${r}`}function cx(){let e=null;return (t,n,r)=>{if(e!==null&&e.html===t&&e.key===n){let i=e.value;return e=null,i}let o=r(),a={html:t,key:n,value:o};return e=a,setTimeout(()=>{e===a&&(e=null);},0),o}}var AA=/^(ftn|edn)([1-9]\d{0,9})$/i,FA={footnote:"ftn",endnote:"edn"};function ux(e,t){let n=e===null?null:AA.exec(e);if(!n||n[1].toLowerCase()!==FA[t])return null;let r=Number.parseInt(n[2],10);return r<=2147483647?r:null}function Rf(e){for(let t of ["footnote","endnote"]){let n=e.get(`mso-${t}-id`),r=ux(n??null,t);if(r!==null)return {kind:t,id:r}}return null}function LA(e,t){let n=t.get("mso-element")?.trim().toLowerCase();if(n!=="footnote"&&n!=="endnote")return null;let r=ux(e.getAttribute("id"),n);return r===null?null:{kind:n,id:r}}function fx(e){let t=[],n=e.getElementsByTagName("div");for(let r=0;r<n.length&&t.length<2048;r+=1){let o=n[r],a=LA(o,lt(o));a!==null&&t.push({...a,element:o});}return t}function px(e,t,n){let r=new Map(t.map(i=>[i.element,i])),o=i=>{let s=i.parentElement;for(let l=0;s!==null&&l<128;l+=1){let d=r.get(s);if(d!==void 0)return d;s=s.parentElement;}return null},a=e.getElementsByTagName("a");for(let i=0;i<a.length&&i<2e4;i+=1){let s=a[i],l=Rf(lt(s));if(l===null)continue;let d=o(s);d!==null&&d.kind===l.kind&&d.id===l.id||n[l.kind].add(l.id);}}function mx(e){let t=e.get("mso-element")?.trim().toLowerCase();return t==="footnote-list"||t==="endnote-list"}var NA=/<w:r>(?:<w:rPr>(?:(?!<\/w:r>)[\s\S])*?<\/w:rPr>)?<w:(footnote|endnote)Reference w:id="(\d{1,10})"\/><\/w:r>/g;function Pa(e,t,n){return e.replace(NA,(r,o,a)=>{let i=`${o}:${a}`;return t.has(i)?n?.get(i)??"":r})}function Pf(e,t){let n="";for(let[r,o]of t)n+=`<w:${e} w:id="${r}">${o.join("")}</w:${e}>`;return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:${e}s xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math">${n}</w:${e}s>`}function gx(e,t,n,r){let o=new Set,a={footnote:new Set,endnote:new Set},i=()=>{a.footnote.clear(),a.endnote.clear();let s=[],l=(d,c)=>{o.has(`${d}:${c}`)||!e.notes[d].has(c)||a[d].has(c)||(a[d].add(c),s.push({kind:d,id:c}));};for(let d of ["footnote","endnote"])for(let c of e.bodyNoteRefs[d])l(d,c);for(let d of o)for(let c of e.noteNoteRefs.get(d)??[])l(c.kind,c.id);for(;s.length>0;){let d=s.pop();for(let c of e.noteNoteRefs.get(`${d.kind}:${d.id}`)??[])l(c.kind,c.id);}};for(;;){i();let s=false;for(let l of ["footnote","endnote"]){for(let d of e.notes[l].keys()){let c=`${l}:${d}`;if(!(a[l].has(d)||o.has(c))){o.add(c),s=true;break}}if(s)break}if(!s)break}if(o.size>0)for(let s of ["footnote","endnote"])for(let[l,d]of e.notes[s])o.has(`${s}:${l}`)||e.notes[s].set(l,d.map(c=>Pa(c,o,e.noteMarkFallbacks)));for(let s of ["footnote","endnote"])for(let[l,d]of [...e.notes[s]]){if(!o.has(`${s}:${l}`))continue;e.notes[s].delete(l),t[s].delete(l);let c=new Map;for(let u of d){let p=Pa(u.replace(/<w:r>(?:<w:rPr>(?:(?!<\/w:r>)[\s\S])*?<\/w:rPr>)?<w:(?:footnote|endnote)Ref\/><\/w:r>/g,""),o,e.noteMarkFallbacks).replace(/ r:(id|embed)="([^"]{1,32})"/g,(m,h,y)=>{let g=c.get(y);if(g===void 0){let b=e.noteRels[s].find(S=>S.id===y);if(b===void 0)return m;g=r(e,b.type,b.target,b.external),c.set(y,g);}return ` r:${h}="${g}"`});n.push(p),e.lastMarkCovered=false;}}}function Tf(e,t,n,r=1,o=0){let a=e.lists.get(t);if(a)return a.levels.has(o)||a.levels.set(o,{kind:n,start:r}),a.numId;let i=String(1001+e.lists.size),s={numId:i,levels:new Map([[o,{kind:n,start:r}]])};return e.lists.set(t,s),e.listsByNumId.set(i,s),i}function hx(e,t,n,r){let o=t.get("mso-list");if(o===void 0)return;let a=/\bl(\d{1,4})\s+level(\d{1,2})\b/i.exec(o);if(!a)return;let i=Math.min(Math.max(Number.parseInt(a[2],10)-1,0),8),s=DA(e,n),l=/\blfo(\d{1,4})\b/i.exec(o),d=(l!==null?n.listDefinitions.get(`l${a[1]}:level${a[2]}:lfo${l[1]}`):void 0)??n.listDefinitions.get(`l${a[1]}:level${a[2]}`),c,u;d!==void 0?(c=d.kind,u=rx(s,c)??d.start??1):{kind:c,start:u}=ax(s);let m=`mso:${r===void 0?"":`${r.kind}${r.id}:`}l${a[1]}${l?`:lfo${l[1]}`:""}`;return {numId:Tf(n,m,c,u,i),ilvl:i}}function DA(e,t){let n="",r=(o,a)=>{if(!(n.length>0||a>8||t.nodesLeft<=0)&&Ra(o)){if(Ul(o)){n=(o.textContent??"").slice(0,16);return}for(let i of Array.from(o.childNodes))r(i,a+1);}};for(let o of Array.from(e.childNodes))r(o,0);return n}var HA="http://schemas.openxmlformats.org/package/2006/relationships",_A="http://schemas.openxmlformats.org/package/2006/content-types",BA="application/vnd.openxmlformats-package.relationships+xml",Of='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',$A="http://schemas.openxmlformats.org/wordprocessingml/2006/main",Ef="http://schemas.openxmlformats.org/officeDocument/2006/relationships",qA="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",VA="http://schemas.openxmlformats.org/drawingml/2006/main",KA="http://schemas.openxmlformats.org/drawingml/2006/picture",WA="http://schemas.openxmlformats.org/officeDocument/2006/math",yx={document:"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml",numbering:"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",footnotes:"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",endnotes:"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml"};function Cf(e){let t=e.map(n=>`<Relationship Id="${chunkFIJZIQXA_cjs.S(n.id)}" Type="${chunkFIJZIQXA_cjs.S(n.type)}" Target="${chunkFIJZIQXA_cjs.S(n.target)}"${n.external?' TargetMode="External"':""}/>`).join("");return `${Of}<Relationships xmlns="${HA}">${t}</Relationships>`}function jA(e){let t=new Map;t.set("word/document.xml",chunkFIJZIQXA_cjs.Td(e.documentXml)),t.set("word/_rels/document.xml.rels",chunkFIJZIQXA_cjs.Td(Cf(e.rels))),t.set("_rels/.rels",chunkFIJZIQXA_cjs.Td(Cf([{id:"rId1",type:`${Ef}/officeDocument`,target:"word/document.xml",external:false}])));let n=[["numbering",e.numberingXml],["footnotes",e.footnotesXml],["endnotes",e.endnotesXml]],r=`<Override PartName="/word/document.xml" ContentType="${yx.document}"/>`;for(let[a,i]of n)i!==void 0&&(t.set(`word/${a}.xml`,chunkFIJZIQXA_cjs.Td(i)),r+=`<Override PartName="/word/${a}.xml" ContentType="${yx[a]}"/>`);for(let[a,i]of [["footnotes",e.footnotesRels],["endnotes",e.endnotesRels]])i!==void 0&&i.length>0&&t.set(`word/_rels/${a}.xml.rels`,chunkFIJZIQXA_cjs.Td(Cf(i)));for(let[a,i]of e.media)t.set(a,i);let o=`<Default Extension="rels" ContentType="${BA}"/><Default Extension="xml" ContentType="application/xml"/>`;for(let[a,i]of e.mediaExtensions)o+=`<Default Extension="${chunkFIJZIQXA_cjs.S(a)}" ContentType="${chunkFIJZIQXA_cjs.S(i)}"/>`;return t.set("[Content_Types].xml",chunkFIJZIQXA_cjs.Td(`${Of}<Types xmlns="${_A}">${o}${r}</Types>`)),chunkFIJZIQXA_cjs.Sd(t)}function bx(e){let t=[...e.rels],n=o=>{t.push({id:`rId${t.length+1}`,type:`${Ef}/${o}`,target:`${o}.xml`,external:false});};e.lists.length>0&&n("numbering");for(let o of ["footnote","endnote"])e.notes[o].size>0&&n(`${o}s`);let r=`${Of}<w:document xmlns:w="${$A}" xmlns:r="${Ef}" xmlns:wp="${qA}" xmlns:a="${VA}" xmlns:pic="${KA}" xmlns:m="${WA}"><w:body>${e.blocks.join("")}</w:body></w:document>`;return jA({documentXml:r,rels:t,...e.lists.length>0?{numberingXml:sx(e.lists)}:{},...e.notes.footnote.size>0?{footnotesXml:Pf("footnote",e.notes.footnote),footnotesRels:e.noteRels.footnote}:{},...e.notes.endnote.size>0?{endnotesXml:Pf("endnote",e.notes.endnote),endnotesRels:e.noteRels.endnote}:{},media:e.media,mediaExtensions:e.mediaExtensions})}function Sr(e){let t="";for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(!(r!==9&&(r<32||r===65534||r===65535))){if(r>=55296&&r<=56319){let o=e.charCodeAt(n+1);o>=56320&&o<=57343&&(t+=e[n]+e[n+1],n+=1);continue}r>=56320&&r<=57343||(t+=e[n]);}}return t}function nr(e){let t="";if(e.rStyle!==void 0&&(t+=`<w:rStyle w:val="${chunkFIJZIQXA_cjs.S(e.rStyle)}"/>`),e.font!==void 0){let i=chunkFIJZIQXA_cjs.S(Sr(e.font));t+=e.rtl?`<w:rFonts w:cs="${i}"/>`:`<w:rFonts w:ascii="${i}" w:hAnsi="${i}"/>`;}e.bold?t+="<w:b/>":e.bold===false&&(t+='<w:b w:val="0"/>'),e.italic?t+="<w:i/>":e.italic===false&&(t+='<w:i w:val="0"/>'),e.caps?t+="<w:caps/>":e.caps===false&&(t+='<w:caps w:val="0"/>'),e.smallCaps?t+="<w:smallCaps/>":e.smallCaps===false&&(t+='<w:smallCaps w:val="0"/>'),e.doubleStrike?t+="<w:dstrike/>":e.strike?t+="<w:strike/>":e.strike===false&&(t+='<w:strike w:val="0"/>'),e.color!==void 0&&(t+=`<w:color w:val="${e.color}"/>`),e.charSpacingTwentieths!==void 0&&(t+=`<w:spacing w:val="${e.charSpacingTwentieths}"/>`),e.szHalfPoints!==void 0&&(t+=`<w:sz w:val="${e.szHalfPoints}"/>`),e.highlight!==void 0&&(t+=`<w:highlight w:val="${chunkFIJZIQXA_cjs.S(e.highlight)}"/>`),e.underline?t+=`<w:u w:val="${e.underlineVal??"single"}"${e.underlineColor===void 0?"":` w:color="${e.underlineColor}"`}/>`:e.underline===false&&(t+='<w:u w:val="none"/>'),e.shdFill!==void 0&&(t+=`<w:shd w:val="clear" w:color="auto" w:fill="${e.shdFill}"/>`),e.vertAlign!==void 0&&(t+=`<w:vertAlign w:val="${e.vertAlign}"/>`),e.rtl&&(t+="<w:rtl/>");let n=e.langVal,r=e.langEastAsia,o=e.langBidi;e.lang!==void 0&&(e.rtl?o??=e.lang:/^(?:zh|ja|ko)(?:-|$)/i.test(e.lang)?r??=e.lang:n??=e.lang);let a=`${n===void 0?"":` w:val="${chunkFIJZIQXA_cjs.S(n)}"`}${r===void 0?"":` w:eastAsia="${chunkFIJZIQXA_cjs.S(r)}"`}${o===void 0?"":` w:bidi="${chunkFIJZIQXA_cjs.S(o)}"`}`;return a.length>0&&(t+=`<w:lang${a}/>`),t.length>0?`<w:rPr>${t}</w:rPr>`:""}function Gl(e,t){return `<w:r>${nr(t)}<w:t xml:space="preserve">${chunkFIJZIQXA_cjs.R(Sr(e))}</w:t></w:r>`}function ZA(e){let t="";if(e.styleId!==void 0&&(t+=`<w:pStyle w:val="${chunkFIJZIQXA_cjs.S(e.styleId)}"/>`),e.keepNext&&(t+="<w:keepNext/>"),e.keepLines&&(t+="<w:keepLines/>"),e.pageBreakBefore&&(t+="<w:pageBreakBefore/>"),e.widowControl&&(t+="<w:widowControl/>"),e.numPr&&(t+=`<w:numPr><w:ilvl w:val="${e.numPr.ilvl}"/><w:numId w:val="${chunkFIJZIQXA_cjs.S(e.numPr.numId)}"/></w:numPr>`),e.borders!==void 0){let i="";for(let s of ["top","left","bottom","right"]){let l=e.borders[s];l!==void 0&&(i+=`<w:${s} w:val="${l.val}" w:sz="${l.szEighthPoints}" w:space="0" w:color="${l.color}"/>`);}i.length>0&&(t+=`<w:pBdr>${i}</w:pBdr>`);}if(e.shdFill!==void 0&&(t+=`<w:shd w:val="clear" w:color="auto" w:fill="${e.shdFill}"/>`),e.tabs!==void 0&&e.tabs.length>0&&(t+=`<w:tabs>${e.tabs.map(i=>`<w:tab w:val="${i.val}" w:pos="${i.posTwips}"`+(i.leader===void 0?"/>":` w:leader="${i.leader}"/>`)).join("")}</w:tabs>`),e.bidi&&(t+="<w:bidi/>"),e.spacingBeforeTwips!==void 0||e.spacingAfterTwips!==void 0||e.lineTwentieths!==void 0){let i="<w:spacing";e.spacingBeforeTwips!==void 0&&(i+=` w:before="${e.spacingBeforeTwips}"`),e.spacingAfterTwips!==void 0&&(i+=` w:after="${e.spacingAfterTwips}"`),e.lineTwentieths!==void 0&&(i+=` w:line="${e.lineTwentieths}" w:lineRule="${e.lineRule??"auto"}"`),t+=`${i}/>`;}let n=e.firstLineTwips,[r,o]=e.bidi?[e.indRightTwips,e.indLeftTwips]:[e.indLeftTwips,e.indRightTwips];if(r!==void 0||o!==void 0||n!==void 0){let i="<w:ind";r!==void 0&&(i+=` w:left="${r}"`),o!==void 0&&(i+=` w:right="${o}"`),n!==void 0&&(i+=n>=0?` w:firstLine="${n}"`:` w:hanging="${-n}"`),t+=`${i}/>`;}let a=e.jc==="start"?"left":e.jc==="end"?"right":e.bidi&&(e.jc==="left"||e.jc==="right")?e.jc==="left"?"right":"left":e.jc;return a!==void 0&&(t+=`<w:jc w:val="${a}"/>`),t.length>0?`<w:pPr>${t}</w:pPr>`:""}function Ao(e,t){return `<w:p>${ZA(e)}${t.join("")}</w:p>`}var xx={h1:64,h2:52,h3:44,h4:36,h5:32,h6:28};function Xl(e){let t=e[e.length-1];if(t?.endsWith("</w:p>")){e[e.length-1]=`${t.slice(0,-6)}<w:r><w:br w:type="page"/></w:r></w:p>`;return}e.push('<w:p><w:r><w:br w:type="page"/></w:r></w:p>');}var zA=/^(?:<w:bookmark(?:Start|End)\b[^>]*\/>)+$/,vx=new WeakMap;function Mf(e){let t=vx.get(e);for(t||(t={checked:0,furniture:true},vx.set(e,t));t.furniture&&t.checked<e.length;)t.furniture=zA.test(e[t.checked]),t.checked+=1;return t.furniture}var Fo=32;function gn(e){return e.left<=0?(e.truncated=true,false):(e.left-=1,e.visited+=1,true)}var wx=Object.freeze({});function Sx(e,t){let n={...t};return e.bold!==void 0&&(n.bold=e.bold),e.italic!==void 0&&(n.italic=e.italic),e.color!==void 0&&(n.color=e.color),e.highlight!==void 0&&(n.highlight=e.highlight),e.shdFill!==void 0&&(n.shdFill=e.shdFill),e.szHalfPoints!==void 0&&(n.szHalfPoints=e.szHalfPoints),n}function UA(e){return e.replace(/ /g," ").replace(/[-]/g,"").replace(/[ \t\r\n\f\v]+/g," ")}function Ir(e,t,n){let r=chunkFIJZIQXA_cjs.R(Sr(UA(e)));if(r.length===0)return "";let a=n.uprightUnlessItalic===true&&n.italic!==true?n.bold?"b":"p":n.bold?"bi":null,i=t.length>0?t:a?`<m:sty m:val="${a}"/>`:"",s=nr({...n.color!==void 0?{color:n.color}:{},...n.highlight!==void 0?{highlight:n.highlight}:{},...n.shdFill!==void 0?{shdFill:n.shdFill}:{},...n.szHalfPoints!==void 0?{szHalfPoints:n.szHalfPoints}:{}});return `<m:r>${i.length>0?`<m:rPr>${i}</m:rPr>`:""}${s}<m:t xml:space="preserve">${r}</m:t></m:r>`}var GA=512,Ix=new Set(["\u2211","\u220F","\u2210","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230","\u22C0","\u22C1","\u22C2","\u22C3","\u2A00","\u2A01","\u2A02","\u2A04","\u2A06"]),XA=new Map([["^","\u0302"],["\u02C6","\u0302"],["\u0302","\u0302"],["~","\u0303"],["\u02DC","\u0303"],["\u0303","\u0303"],["\u02D9","\u0307"],["\u0307","\u0307"],["\xA8","\u0308"],["\u0308","\u0308"],["\u2192","\u20D7"],["\u20D7","\u20D7"],["\xB4","\u0301"],["`","\u0300"],["\u02C7","\u030C"],["\u02D8","\u0306"]]),kx=new Set(["\xAF","\u203E","_","\u2015","\u2014","\u0305","-"]),Rx=new Map([["(",")"],["[","]"],["{","}"],["|","|"],["\u2016","\u2016"],["\u27E8","\u27E9"],["\u2329","\u232A"],["\u230A","\u230B"],["\u2308","\u2309"]]),YA=new Set(["annotation","annotation-xml","none","mprescripts","mspace","maligngroup","malignmark","mphantom"]),QA=new Set(["msub","msup","msubsup","munder","mover","munderover"]);function kr(e){return e.localName.toLowerCase()}function Yi(e){return Array.from(e.children)}function zr(e){return (e.textContent??"").replace(/[ \t\r\n\f\v]+/g," ").trim().slice(0,GA)}function Lo(e){return chunkFIJZIQXA_cjs.S(Sr(e))}function He(e,t){return t.length>0?`<m:${e}>${t}</m:${e}>`:`<m:${e}/>`}function Px(e,t){let n=t,r=e.getAttribute("mathcolor")?.trim()??"",o=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(r)?.[1];if(o!==void 0){let i=o.length===3?o.replace(/./g,s=>s+s):o;n={...n,color:i.toUpperCase()};}let a=e.getAttribute("mathvariant")?.trim().toLowerCase();return (a==="bold"||a==="bold-italic")&&(n={...n,bold:true}),n}function Xi(e){if(e===void 0||kr(e)!=="mo")return null;let t=zr(e);return [...t].length===1?t:null}var Af=class{constructor(t){this.state=t;}state;node(t,n,r){if(n>Fo)return this.state.truncated=true,"";if(!gn(this.state))return "";let o=kr(t),a=Px(t,r),i=Yi(t),s=l=>i[l]?this.node(i[l],n+1,a):"";if(YA.has(o))return "";switch(o){case "semantics":return s(0);case "mi":return this.identifier(t,a);case "mn":case "mo":return Ir(zr(t),"",a);case "mtext":return Ir(zr(t),"<m:nor/>",a);case "ms":return Ir(`"${zr(t)}"`,"<m:nor/>",a);case "msub":return `<m:sSub>${He("e",s(0))}${He("sub",s(1))}</m:sSub>`;case "msup":return `<m:sSup>${He("e",s(0))}${He("sup",s(1))}</m:sSup>`;case "msubsup":return `<m:sSubSup>${He("e",s(0))}${He("sub",s(1))}${He("sup",s(2))}</m:sSubSup>`;case "mfrac":return this.fraction(t,s(0),s(1));case "msqrt":return `<m:rad><m:radPr><m:degHide m:val="1"/></m:radPr><m:deg/>${He("e",this.row(i,n+1,a))}</m:rad>`;case "mroot":return `<m:rad>${He("deg",s(1))}${He("e",s(0))}</m:rad>`;case "munder":return this.under(i[1],s(0),s(1));case "mover":return this.over(t,i[1],s(0),s(1));case "munderover":return `<m:limUpp>${He("e",`<m:limLow>${He("e",s(0))}${He("lim",s(1))}</m:limLow>`)}${He("lim",s(2))}</m:limUpp>`;case "mfenced":return this.fenced(t,i,n,a);case "menclose":return `<m:borderBox>${He("e",this.row(i,n+1,a))}</m:borderBox>`;case "mtable":return this.table(i,n,a);case "mmultiscripts":return this.multiscripts(i,n,a);default:return this.row(i,n+1,a)}}identifier(t,n){let r=zr(t),o=t.getAttribute("mathvariant")?.trim().toLowerCase(),a="";return o==="normal"||o===void 0&&[...r].length>1?a='<m:sty m:val="p"/>':o==="bold"?a='<m:sty m:val="b"/>':o==="bold-italic"&&(a='<m:sty m:val="bi"/>'),Ir(r,a,n)}fraction(t,n,r){let o=t.getAttribute("linethickness")?.trim().toLowerCase(),a=t.getAttribute("bevelled")?.trim().toLowerCase()==="true",i=o!==void 0&&/^0(?:\.0*)?(?:px|pt|em|ex|%)?$/.test(o)?"noBar":a?"skw":null;return `<m:f>${i===null?"":`<m:fPr><m:type m:val="${i}"/></m:fPr>`}${He("num",n)}${He("den",r)}</m:f>`}under(t,n,r){let o=Xi(t);return o!==null&&kx.has(o)?`<m:bar><m:barPr><m:pos m:val="bot"/></m:barPr>${He("e",n)}</m:bar>`:`<m:limLow>${He("e",n)}${He("lim",r)}</m:limLow>`}over(t,n,r,o){let a=Xi(n);if(a!==null&&kx.has(a))return `<m:bar><m:barPr><m:pos m:val="top"/></m:barPr>${He("e",r)}</m:bar>`;let i=a===null?void 0:XA.get(a);return i!==void 0||a!==null&&t.getAttribute("accent")?.trim()==="true"?`<m:acc><m:accPr><m:chr m:val="${Lo(i??a)}"/></m:accPr>${He("e",r)}</m:acc>`:`<m:limUpp>${He("e",r)}${He("lim",o)}</m:limUpp>`}fenced(t,n,r,o){let a=[...t.getAttribute("open")??"("].slice(0,1).join(""),i=[...t.getAttribute("close")??")"].slice(0,1).join(""),s=[...(t.getAttribute("separators")??",").trim()][0]??"",l=n.map(d=>He("e",this.node(d,r+1,o)));return `<m:d><m:dPr><m:begChr m:val="${Lo(a)}"/>${s.length>0?`<m:sepChr m:val="${Lo(s)}"/>`:""}<m:endChr m:val="${Lo(i)}"/></m:dPr>${l.join("")||"<m:e/>"}</m:d>`}table(t,n,r){let o="";for(let a of t){if(!gn(this.state))break;let i=kr(a);if(i!=="mtr"&&i!=="mlabeledtr")continue;let s=Yi(a).slice(i==="mlabeledtr"?1:0);o+="<m:mr>"+s.map(l=>He("e",kr(l)==="mtd"?this.row(Yi(l),n+2,r):this.node(l,n+2,r))).join("")+"</m:mr>";}return o.length>0?`<m:m>${o}</m:m>`:""}multiscripts(t,n,r){let o=d=>d===void 0||kr(d)==="none"?"":this.node(d,n+1,r),a=t.findIndex(d=>kr(d)==="mprescripts"),i=a<0?t.slice(1):t.slice(1,a),s=a<0?[]:t.slice(a+1),l=o(t[0]);return i.length>0&&(l=`<m:sSubSup>${He("e",l)}${He("sub",o(i[0]))}${He("sup",o(i[1]))}</m:sSubSup>`),s.length>0?`<m:sPre>${He("sub",o(s[0]))}${He("sup",o(s[1]))}${He("e",l)}</m:sPre>`:l}nary(t,n,r,o){let a=kr(t),i=Yi(t),s=zr(a==="mo"?t:i[0]),l=h=>i[h]?this.node(i[h],r+1,o):"",d="",c="";a==="msub"||a==="munder"?d=l(1):a==="msup"||a==="mover"?c=l(1):(a==="msubsup"||a==="munderover")&&(d=l(1),c=l(2));let u=a==="munder"||a==="mover"||a==="munderover"?"undOvr":"subSup",p=`<m:chr m:val="${Lo(s)}"/><m:limLoc m:val="${u}"/>${d.length===0?'<m:subHide m:val="1"/>':""}${c.length===0?'<m:supHide m:val="1"/>':""}`,m=n?this.node(n,r+1,o):"";return `<m:nary><m:naryPr>${p}</m:naryPr>${He("sub",d)}${He("sup",c)}${He("e",m)}</m:nary>`}isNary(t){let n=kr(t);if(n==="mo")return Ix.has(zr(t));if(!QA.has(n))return false;let r=t.children[0];return r!==void 0&&Ix.has(Xi(r)??"")}row(t,n,r){if(n>Fo)return this.state.truncated=true,"";let o=Xi(t[0]),a=Xi(t[t.length-1]);if(t.length>=2&&o!==null&&a!==null&&Rx.has(o)&&[...Rx.values()].includes(a)){let l=this.row(t.slice(1,-1),n+1,r);return `<m:d><m:dPr><m:begChr m:val="${Lo(o)}"/><m:endChr m:val="${Lo(a)}"/></m:dPr>${He("e",l)}</m:d>`}let i="";for(let s=0;s<t.length;s+=1){let l=t[s];if(this.isNary(l)){let d=t[s+1];i+=this.nary(l,d,n,r),d!==void 0&&(s+=1);continue}i+=this.node(l,n,r);}return i}};function Ff(e){return kr(e)==="math"}function Tx(e){return e.getAttribute("display")?.trim().toLowerCase()==="block"||e.getAttribute("mode")?.trim().toLowerCase()==="display"}function Cx(e,t,n){return new Af(t).row(Yi(e),1,Px(e,n))}var JA="acc accPr aln alnScr argPr argSz bar barPr baseJc begChr borderBox borderBoxPr box boxPr brk brkBin brkBinSub cGp cGpRule chr count cSp ctrlPr d defJc deg degHide den diff dispDef dPr e endChr eqArr eqArrPr f fName fPr func funcPr groupChr groupChrPr grow hideBot hideLeft hideRight hideTop interSp intLim intraSp jc lim limLoc limLow limLowPr limUpp limUppPr lit lMargin m mathFont mathPr maxDist mc mcJc mcPr mcs mPr mr nary naryLim naryPr noBreak nor num objDist oMath oMathPara oMathParaPr opEmu phant phantPr plcHide pos postSp preSp r rad radPr rMargin rPr rSp rSpRule scr sepChr show shp smallFrac sPre sPrePr sSub sSubPr sSubSup sSubSupPr sSup sSupPr strikeBLTR strikeH strikeTLBR strikeV sty sub subHide sup supHide t transp type vertJc wrapIndent wrapRight zeroAsc zeroDesc zeroWid".split(" "),Ox=new Map(JA.map(e=>[`m:${e.toLowerCase()}`,e])),eF=new Set(["oMath","e","num","den","sub","sup","deg","lim","fName"]),tF=512,nF=512,rF=64,oF=64,aF=2,iF=256,Ex=/^\[if\s+gte\s+msEquation\b[^\]]*\]>([\s\S]*)<!\[endif\]$/i,sF=/^\[if\s+!msEquation\s*\]$/i,lF=/^\[if\b[^\]]*\]$/i,dF=/^\[endif\]$/i,cF=Object.freeze({byElement:new Map,visited:0,truncated:false});function Mx(e){return /<m:omath|msEquation|<math[\s>]/i.test(e)}function Qi(e){return e.nodeType===1?Ox.get(Ue(e)):void 0}function Ax(e,t,n,r){if(!(n>Fo||!gn(t))){if(e.nodeType===3){r.push(e.nodeValue??"");return}if(!(e.nodeType!==1||Ue(e)==="o:p"))for(let o of Array.from(e.childNodes))Ax(o,t,n+1,r);}}function Lf(e,t){return Sx(Mo(Gi({},Ue(e)),e),t)}function uF(e,t,n,r){let o="",a=[],i=r;for(let s of Array.from(e.childNodes)){let l=Qi(s);if(l==="rPr")o+=Yl(s,"rPr",t,n+1,r);else {if(s.nodeType===1&&Ue(s)==="w:rpr")continue;s.nodeType===1&&l===void 0&&(i=Lf(s,i)),Ax(s,t,n+1,a);}}return Ir(a.join(""),o,i)}function Yl(e,t,n,r,o){let a="",i="",s=eF.has(t);for(let l of Array.from(e.childNodes)){if(l.nodeType===3){if(!gn(n))break;s&&(i+=l.nodeValue??"");continue}l.nodeType===1&&(i.trim().length>0&&(a+=Ir(i,"",o)),i="",a+=Fx(l,t,n,r+1,o));}return i.trim().length>0&&(a+=Ir(i,"",o)),a}function Fx(e,t,n,r,o){if(r>Fo)return n.truncated=true,"";if(!gn(n))return "";let a=Ox.get(Ue(e));if(a===void 0)return Ue(e)==="o:p"?"":Yl(e,t,n,r,Lf(e,o));if(a==="ctrlPr"||a==="oMathPara"||a==="oMath")return "";if(a==="r"||a==="t")return uF(e,n,r,o);let i=e.getAttribute("m:val"),s=i!==null&&i.length<=rF?` m:val="${chunkFIJZIQXA_cjs.S(Sr(i))}"`:"",l=Yl(e,a,n,r,o);return l.length>0?`<m:${a}${s}>${l}</m:${a}>`:`<m:${a}${s}/>`}function Lx(e,t,n){if(!gn(t))return null;let r=Yl(e,"oMath",t,1,n);return r.length>0?`<m:oMath>${r}</m:oMath>`:null}function Nx(e,t,n,r,o){if(!(n>Fo||!gn(t)))for(let a of Array.from(e.children)){let i=Qi(a);if(i==="oMath"){let s=Lx(a,t,r);s!==null&&o.equations.push(s);}else i==="oMathParaPr"&&o.properties.length===0?o.properties=Fx(a,"oMathPara",t,n+1,r):i===void 0&&Nx(a,t,n+1,Lf(a,r),o);}}function fF(e){let t=Qi(e);return t==="oMath"||t==="oMathPara"||Ff(e)}function pF(e){let t=0;for(let n=e.parentElement;n!==null;n=n.parentElement)if((t+=1)>iF||fF(n))return true;return false}function mF(e,t){if(typeof e.createTreeWalker!="function")return;let n=e.createTreeWalker(e.body,128),r=[];for(let o=n.nextNode();o!==null;o=n.nextNode()){if(!gn(t))return;let a=o.data;if(/<m:omath|<math[\s>]/i.test(a)&&Ex.test(a)){if(r.length>=nF){t.truncated=true;break}r.push(o);}}for(let o of r){let a=Ex.exec(o.data)?.[1]??"",i;try{i=new DOMParser().parseFromString(a,"text/html");}catch{continue}let s=o.parentNode;if(!(s===null||i.body===null)){for(let l of Array.from(i.body.childNodes))s.insertBefore(e.importNode(l,true),o);s.removeChild(o);}}}function gF(e){return e.nodeType===3?(e.nodeValue??"").replace(/[\s ]/g,"").length>0:e.nodeType===1||e.nodeType===8}function hF(e){let t=e;for(let n=0;n<=aF;n+=1){let r=t.nextSibling;for(;r!==null&&!gF(r);)r=r.nextSibling;if(r!==null){if(r.nodeType!==8||!sF.test(r.data.trim()))return;let i=[r],s=1;for(let l=r.nextSibling;l!==null&&i.length<=oF;l=l.nextSibling)if(i.push(l),l.nodeType===8){let d=l.data.trim();if(dF.test(d)?s-=1:lF.test(d)&&(s+=1),s===0){for(let c of i)c.parentNode?.removeChild(c);return}}return}let o=t.parentElement;if(o===null||Qi(o)!==void 0)return;let a=Ue(o);if(a!=="span"&&a!=="i"&&a!=="b"&&a!=="font")return;t=o;}}function yF(e,t){let n=e.getElementsByTagName("i").length>0?{uprightUnlessItalic:true}:wx;if(Ff(e)){if(!gn(t))return null;let r=Cx(e,t,n);return r.length===0?null:Tx(e)?`<m:oMathPara><m:oMath>${r}</m:oMath></m:oMathPara>`:`<m:oMath>${r}</m:oMath>`}if(Qi(e)==="oMathPara"){let r={properties:"",equations:[]};return Nx(e,t,1,n,r),r.equations.length===0?null:`<m:oMathPara>${r.properties}${r.equations.join("")}</m:oMathPara>`}return Lx(e,t,n)}function Dx(e,t){if(e.body===null||t<=0)return cF;let n={left:t,visited:0,truncated:false};mF(e,n);let r=new Map,o=[];for(let a of ["m:omathpara","m:omath","math"]){let i=e.body.getElementsByTagName(a);for(let s=0;s<i.length;s+=1){if(o.length>=tF){n.truncated=true;break}if(!gn(n))break;let l=i[s];pF(l)||o.push(l);}}for(let a of o){if(n.left<=0){n.truncated=true;break}let i=yF(a,n);i===null||n.truncated||(r.set(a,[i]),hF(a));}return {byElement:r,visited:n.visited,truncated:n.truncated}}function Nf(e){return e.startsWith("<m:oMath>")||e.startsWith("<m:oMathPara>")}function Hn(e,t){return t?e==="left"?"right":e==="right"?"left":e:e}var Ur=31680;function Rr(e,t,n){return Math.min(n,Math.max(t,e))}function Hx(e){let t=bt(lt(e).get("width")??"");if(t!==null&&t>0)return t;let n=e.getAttribute("width")?.trim();if(n===void 0||!/^\d{1,6}(\.\d+)?$/.test(n))return null;let r=Number.parseFloat(n);return Number.isFinite(r)&&r>0?r*.75:null}function bF(e){return No(e,"colspan",63)}function _x(e){return Array.from(e.children).flatMap(t=>{let n=Ue(t);return n==="tr"?[t]:n!=="thead"&&n!=="tbody"&&n!=="tfoot"?[]:Array.from(t.children).filter(r=>Ue(r)==="tr")})}function No(e,t,n){let r=e.getAttribute(t);return r===null||!/^\d{1,4}$/.test(r.trim())?1:Rr(Number.parseInt(r,10),1,n)}function Bx(e,t){let n=(lt(e).get("width")??e.getAttribute("width")??"").trim(),r=/^(\d{1,3}(?:\.\d+)?)%$/.exec(n);if(r)return {xml:`<w:tblW w:w="${Rr(Math.round(Number.parseFloat(r[1])*50),50,5e3)}" w:type="pct"/>`,twips:t};let o=Hx(e);if(o===null)return {xml:'<w:tblW w:w="0" w:type="auto"/>',twips:t};let a=Rr(Math.round(o*20),1,Ur);return {xml:`<w:tblW w:w="${a}" w:type="dxa"/>`,twips:a}}function $x(e){let n=lt(e).get("mso-table-left")?.trim().toLowerCase(),r=(n==="left"||n==="center"||n==="right"?n:void 0)??e.getAttribute("align")?.trim().toLowerCase();return r==="left"||r==="center"||r==="right"?r:void 0}function qx(e){let t=lt(e),n=t.get("mso-table-anchor-horizontal")?.trim().toLowerCase(),r=t.get("mso-table-anchor-vertical")?.trim().toLowerCase();if(n===void 0&&r===void 0)return "";let o=l=>l==="margin"||l==="page"?l:"text",a=` w:horzAnchor="${o(n)}" w:vertAnchor="${o(r)}"`,i=t.get("mso-table-left")?.trim().toLowerCase();if(i==="left"||i==="center"||i==="right")a+=` w:tblpXSpec="${i}"`;else {let l=bt(i??"");l!==null&&(a+=` w:tblpX="${Rr(Math.round(l*20),-Ur,Ur)}"`);}let s=bt(t.get("mso-table-top")??"");return s!==null&&(a+=` w:tblpY="${Rr(Math.round(s*20),-Ur,Ur)}"`),`<w:tblpPr${a}/>`}function Vx(e,t,n){let r=Math.max(1,Math.floor(n/t)),o=-1,a=Array.from({length:t},()=>r),i=new Array(t).fill(null);for(let c of e){let u=Array.from({length:t},()=>r),p=0,m=0,h=i.map(b=>b?b.span:null);for(let b=0;b<t;b+=1){let S=i[b];S&&(S.remaining-=1,S.remaining<=0&&(i[b]=null));}let y=Array.from(c.children).filter(b=>/^t[dh]$/.test(Ue(b))),g=0;for(;m<t;){let b=h[m];if(b!==null){m+=b;continue}let S=y[g];if(S===void 0)break;g+=1;let x=Math.min(bF(S),t-m);for(let k=m+1;k<m+x;k+=1)if(h[k]!==null){x=k-m;break}let I=No(S,"rowspan",1e3);I>1&&(i[m]={remaining:I-1,span:x});let M=Hx(S);if(M!==null){let k=Rr(Math.round(M*20/x),1,Ur);for(let P=0;P<x;P+=1)u[m+P]=k;p+=x;}m+=x;}p>o&&(o=p,a=u);}let s=a.reduce((c,u)=>c+u,0);if(s<=0)return a;let l=a.map(c=>Math.max(1,Math.round(c*n/s))),d=n-l.reduce((c,u)=>c+u,0);return l[l.length-1]=Math.max(1,l[l.length-1]+d),l}function Df(e,t,n){let r=0;for(let o=0;o<n;o+=1)r+=e[t+o]??0;return Math.max(1,r)}var Kx=new Map([["solid","single"],["double","double"],["dotted","dotted"],["dashed","dashed"],["none","nil"],["hidden","nil"]]),Wx=new Map([["thin",.75],["medium",2.25],["thick",3.75]]);function jx(e){return Rr(Math.round(e*8),2,96)}function rr(e){if(e===void 0||e.length===0||e.length>128)return;let t,n,r;for(let o of Sf(e)){let a=Kx.get(o.toLowerCase());if(a!==void 0){t=a;continue}let i=Wx.get(o.toLowerCase())??bt(o);if(i!==null){n=i;continue}let s=Zr(o);if(s!==null){r=s;continue}return}if(t!==void 0){if(t==="nil")return {val:t,size:0,color:r??"auto"};if(n===void 0)return {val:t,size:4,color:r??"000000"};if(!(n<=0))return {val:t,size:jx(n),color:r??"000000"}}}function Ql(e,t){let n=e.get(`${t}-style`)?.trim();if(n===void 0||n.length===0||n.length>64)return;let r=Kx.get(n.split(/\s+/)[0].toLowerCase());if(r===void 0)return;if(r==="nil")return {val:r,size:0,color:"auto"};let o=e.get(`${t}-width`)?.trim().split(/\s+/)[0],a=o===void 0||o.length>64?null:Wx.get(o.toLowerCase())??bt(o);if(a!==null&&a<=0)return;let i=e.get(`${t}-color`)?.trim().split(/\s+/)[0],s=i===void 0||i.length>64?null:Zr(i);return {val:r,size:a===null?4:jx(a),color:s??"000000"}}function Zx(e,t){return `<w:${e} w:val="${t.val}" w:sz="${t.size}" w:space="0" w:color="${t.color}"/>`}function zx(e,t=false){let n=lt(e),o=rr(n.get("mso-border-alt"))??rr(n.get("border"))??Ql(n,"border")??(e.getAttribute("border")?.trim()&&e.getAttribute("border")?.trim()!=="0"?{val:"single",size:4,color:"auto"}:void 0),a=[["top","top"],["left","left"],["bottom","bottom"],["right","right"],["insideH","insideh"],["insideV","insidev"]],i="";for(let[s,l]of a){let d=Hn(l,t),c=rr(n.get(`mso-border-${d}-alt`))??rr(n.get(`mso-border-${d}`))??rr(n.get(`border-${d}`))??Ql(n,`border-${d}`)??o;c!==void 0&&(i+=Zx(s,c));}return i.length>0?`<w:tblBorders>${i}</w:tblBorders>`:""}function Ux(e){let t=lt(e),n=bt(t.get("height")??"");if(n===null||n<=0)return "";let r=Rr(Math.round(n*20),1,Ur),a=t.get("mso-height-rule")?.trim().toLowerCase()==="exactly"?"exact":"atLeast";return `<w:trPr><w:trHeight w:val="${r}" w:hRule="${a}"/></w:trPr>`}function vF(e,t){let n={top:null,right:null,bottom:null,left:null},r=e.get("padding");if(r!==void 0&&r.length<=128){let a=r.trim().split(/\s+/).map(i=>bt(i));if(a.length>=1&&a.length<=4&&!a.some(i=>i===null||i<0)){let[i,s=i,l=i,d=s]=a.length===2?[a[0],a[1],a[0],a[1]]:a.length===3?[a[0],a[1],a[2],a[1]]:a;n.top=i??null,n.right=s??null,n.bottom=l??null,n.left=d??null;}}for(let a of ["top","right","bottom","left"]){let i=bt(e.get(`padding-${a}`)??"");i!==null&&i>=0&&(n[a]=i);}let o="";for(let a of ["top","left","bottom","right"]){let i=Hn(a,t),s=n[i];s!==null&&(o+=`<w:${a} w:w="${Rr(Math.round(s*20),0,Ur)}" w:type="dxa"/>`);}return o.length>0?`<w:tcMar>${o}</w:tcMar>`:""}function Gx(e,t=false){let n=lt(e),r=rr(n.get("mso-border-alt"))??rr(n.get("border"))??Ql(n,"border"),o="";for(let l of ["top","left","bottom","right"]){let d=Hn(l,t),c=rr(n.get(`mso-border-${d}-alt`))??rr(n.get(`mso-border-${d}`))??rr(n.get(`border-${d}`))??Ql(n,`border-${d}`)??r;c!==void 0&&(o+=Zx(l,c));}let a=o.length>0?`<w:tcBorders>${o}</w:tcBorders>`:"",i=zl(n);i&&(a+=`<w:shd w:val="clear" w:color="auto" w:fill="${i}"/>`),a+=vF(n,t);let s=n.get("vertical-align")?.toLowerCase()??e.getAttribute("valign")?.toLowerCase();return s==="top"?a+='<w:vAlign w:val="top"/>':s==="middle"||s==="center"?a+='<w:vAlign w:val="center"/>':s==="bottom"&&(a+='<w:vAlign w:val="bottom"/>'),a}var xF=9360;function Xx(e,t,n,r,o,a){if(r.nodesLeft<=0){r.truncated=true;return}if(t>r.maxDepth)return;r.nodesLeft-=1;for(let P of Array.from(e.children))Ue(P)==="caption"&&a(Array.from(P.childNodes),t+1,n,r,o,true);let i=_x(e);if(i.length===0)return;let s=1,l=r.nodesLeft,d=[];for(let P of i){if(l<=0||s>=63)break;let R=d.map(A=>A?A.span:null);for(let A=0;A<d.length;A+=1){let V=d[A];V&&(V.remaining-=1,V.remaining<=0&&(d[A]=null));}let w=Array.from(P.children).filter(A=>/^t[dh]$/.test(Ue(A))),O=0,N=0;for(;N<63&&(l-=1,!(l<=0));){let A=N<R.length?R[N]:null;if(A!=null){N+=A;continue}let V=w[O];if(V===void 0)break;O+=1;let W=Math.min(No(V,"colspan",63),63-N);for(let _=N+1;_<N+W;_+=1)if(_<R.length&&R[_]!=null){W=_-N;break}let E=No(V,"rowspan",1e3);if(E>1){for(;d.length<=N;)d.push(null);d[N]={remaining:E-1,span:W};}N+=W;}for(let A=N;A<R.length&&A<63;A+=1){let V=R[A];V!=null&&(N=Math.max(N,A+V));}s=Math.max(s,N);}s=Math.min(Math.max(s,1),63);let c=Bx(e,xF),u=c.twips,p=i.length>r.nodesLeft?i.slice(0,Math.max(1,r.nodesLeft)):i,m=Vx(p,s,u),y=(lt(e).get("direction")??e.getAttribute("dir"))?.trim().toLowerCase()==="rtl",g=zx(e,y),b=qx(e),S=$x(e)??(y?"left":void 0),x=S===void 0?"":`<w:jc w:val="${Hn(S,y)}"/>`,I=m.map(P=>`<w:gridCol w:w="${P}"/>`).join(""),M=new Array(s).fill(null),k=[];for(let P of i){if(r.nodesLeft<=0){r.truncated=true;break}r.nodesLeft-=1;let R=M.map(W=>W?W.span:null);for(let W=0;W<s;W+=1){let E=M[W];E&&(E.remaining-=1,E.remaining<=0&&(M[W]=null));}let w=Array.from(P.children).filter(W=>/^t[dh]$/.test(Ue(W))),O=0,N=[],A=0,V=true;for(;A<s;){if(r.nodesLeft-=1,r.nodesLeft<=0){r.truncated=true,V=false;break}let W=R[A];if(W!==null){let U=W>1?`<w:gridSpan w:val="${W}"/>`:"";N.push(`<w:tc><w:tcPr><w:tcW w:w="${Df(m,A,W)}" w:type="dxa"/>${U}<w:vMerge/></w:tcPr><w:p/></w:tc>`),A+=W;continue}let E=w[O];if(E===void 0){N.push(`<w:tc><w:tcPr><w:tcW w:w="${m[A]}" w:type="dxa"/></w:tcPr><w:p/></w:tc>`),A+=1;continue}O+=1;let _=Math.min(No(E,"colspan",63),s-A);for(let U=A+1;U<A+_;U+=1)if(R[U]!==null){_=U-A;break}let G=No(E,"rowspan",1e3);G>1&&(M[A]={remaining:G-1,span:_}),N.push(wF(E,_,Df(m,A,_),G>1,t,n,r,a,y)),A+=_;}if(!V)break;k.push(`<w:tr>${Ux(P)}${N.join("")}</w:tr>`);}k.length!==0&&(o.push(`<w:tbl><w:tblPr>${y?"<w:bidiVisual/>":""}${b}${c.xml}${x}${g}</w:tblPr><w:tblGrid>${I}</w:tblGrid>${k.join("")}</w:tbl>`),r.lastMarkCovered=false);}function wF(e,t,n,r,o,a,i,s,l){let d=Ue(e)==="th",c=`<w:tcW w:w="${n}" w:type="dxa"/>`;t>1&&(c+=`<w:gridSpan w:val="${t}"/>`),r&&(c+='<w:vMerge w:val="restart"/>'),c+=Gx(e,l);let u={run:d?{...a.run,bold:true}:a.run,para:d?{jc:"center"}:{},paragraphMarkCovered:false,pre:false,list:null,...a.noteBody?{noteBody:a.noteBody}:{},...a.rels?{rels:a.rels}:{}},p=[];return s(Array.from(e.childNodes),o+2,u,i,p,true),(p.length===0||p[p.length-1].endsWith("</w:tbl>"))&&p.push("<w:p/>"),`<w:tc><w:tcPr>${c}</w:tcPr>${p.join("")}</w:tc>`}function Yx(e){if(e===void 0)return "";let t=e.trim();return /^\d{1,4}$/.test(t)?"<w:tab/>".repeat(Math.min(Number.parseInt(t,10),64)):""}function Qx(e){let t=e.getAttribute("alignment")?.trim().toLowerCase(),n=e.getAttribute("relativeto")?.trim().toLowerCase(),r=e.getAttribute("leader")?.trim().toLowerCase();return t!=="left"&&t!=="center"&&t!=="right"||n!=="margin"&&n!=="indent"||r!=="none"&&r!=="dot"&&r!=="hyphen"&&r!=="underscore"&&r!=="middledot"?"":`<w:ptab w:alignment="${t}" w:relativeTo="${n}" w:leader="${r==="middledot"?"middleDot":r}"/>`}function Jx(e){if(Ue(e)!=="br")return false;let t=lt(e);return t.get("page-break-before")?.trim().toLowerCase()==="always"||t.get("break-before")?.trim().toLowerCase()==="page"}function ew(e){if(Jx(e))return true;if(Ue(e)!=="span"||e.childNodes.length>8)return false;let t=false;for(let n=0;n<e.childNodes.length;n+=1){let r=e.childNodes[n];if(!(r.nodeType===3&&(r.nodeValue??"").trim().length===0)){if(r.nodeType!==1||t||!Jx(r))return false;t=true;}}return t}function tw(e){if(Ue(e)!=="p")return false;let t=null;for(let o=0;o<e.childNodes.length;o+=1){let a=e.childNodes[o];if(a.nodeType===3){if((a.nodeValue??"").replace(/[\s\u00a0]/g,"").length===0)continue;return false}if(a.nodeType!==1||t!==null)return false;t=a;}if(t===null)return false;let n=lt(e);for(let o of n.keys())if(o==="background"||o==="background-color"||o.startsWith("border"))return false;if(Ue(t)!=="o:p"||t.childNodes.length>3)return false;let r="";for(let o=0;o<t.childNodes.length;o+=1){let a=t.childNodes[o];if(a.nodeType!==3)return false;r+=a.nodeValue??"";}return r.includes("\xA0")&&r.replace(/[\s\u00a0]/g,"").length===0}function Hf(e){let t=0,n=e.parentElement;for(;n!==null&&t<256;)t+=1,n=n.parentElement;return t}var _f=new Set("script style head template iframe object embed noscript svg math meta link title base select textarea hr w:sdtpr".split(" ")),Bf=new Set("p div h1 h2 h3 h4 h5 h6 li blockquote pre".split(" ")),$f=new Set("thead tbody tfoot tr section article main header footer aside nav figure form body html".split(" ")),SF=new Set([...Bf,...$f,"table","ol","ul","w:sdt"]);function qf(e){for(let t=0;t<e.children.length;t+=1)if(SF.has(Ue(e.children[t])))return true;return false}var IF=new Set(["p","div","table","ol","ul","section","article","main","h1","h2","h3","h4","h5","h6"]);function nw(e){if(Ue(e)!=="w:sdt")return null;let t=[e],n=0;for(let r=0;r<t.length&&n<64;r+=1){let o=t[r];for(let a=0;a<o.children.length&&n<64;a+=1){let i=o.children[a];n+=1;let s=Ue(i);if(IF.has(s))return Array.from(e.childNodes);s!=="w:sdtpr"&&t.push(i);}}return null}var kF=4*1024*1024,RF=1e5,PF=64,TF=2*1024*1024,rw="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function Vf(e,t,n,r,o=e.rels){let a=`rId${o.length+1}`;return o.push({id:a,type:t,target:n,external:r}),a}function Jl(e,t,n,r,o){if(o.nodesLeft<=0){o.truncated=true;return}if(t>o.maxDepth)return;if(o.nodesLeft-=1,e.nodeType===3){let y=e.nodeValue??"";if(n.pre){let b=y.replace(/\r\n?/g,`
|
|
4
|
-
`).split(`
|
|
5
|
-
`);for(let S=0;S<b.length;S+=1){if(S>0){if(o.nodesLeft-=1,o.nodesLeft<=0){o.truncated=true;return}r.push(`<w:r>${nr(n.run)}<w:br/></w:r>`);}let x=b[S];x.length>0&&r.push(Gl(x,n.run));}return}let g=y.replace(/[ \t\r\n\f\v]+/g," ");if(g.length===0||g===" "&&Mf(r))return;r.push(Gl(g,n.run));return}if(!Ra(e))return;let a=o.equations.get(e);if(a!==void 0){for(let y of a)r.push(y);return}let i=Ue(e);if(_f.has(i))return;let s=lt(e);if(Ul(e)&&n.para.numPr!==void 0||s.get("mso-element")?.trim().toLowerCase()==="comment-reference"||s.get("mso-special-character")?.trim().toLowerCase()==="comment"||e.classList.contains("msocomanchor")||o.definedNoteElements.has(e))return;if(i==="w:ptab"){let y=Qx(e);y.length>0&&r.push(`<w:r>${nr(n.run)}${y}</w:r>`);return}let d=Yx(s.get("mso-tab-count"));if(d.length>0){if(o.nodesLeft-=d.split("<w:tab/>").length-2,o.nodesLeft<=0){o.truncated=true;return}let y=If(Gi(n.run,i),s);if(r.push(`<w:r>${nr(y)}${d}</w:r>`),(e.textContent??"").trim().length===0&&e.children.length===0)return}if(i==="br"){let y=s.get("page-break-before")?.trim().toLowerCase()==="always"||s.get("break-before")?.trim().toLowerCase()==="page";r.push(`<w:r>${nr(n.run)}${y?'<w:br w:type="page"/>':"<w:br/>"}</w:r>`);return}if(i==="img"){Q0(e,r,o,y=>Vf(o,`${rw}/image`,y,false,n.rels??o.rels));return}let c=Gi(n.run,i),u=i==="a"?e.getAttribute("href"):null,p=i==="a"?Rf(s):null;p===null&&lx(u)&&(c={...c,rStyle:"Hyperlink"});let m=Mo(c,e),h={...n,run:m,pre:n.pre||i==="pre"};if(p!==null){let y={...h.run,vertAlign:"superscript"};if(n.noteBody!==void 0&&n.noteBody.kind===p.kind&&n.noteBody.id===p.id){let g=p.kind==="footnote"?"footnoteRef":"endnoteRef";r.push(`<w:r>${nr(y)}<w:${g}/></w:r>`);return}if(o.definedNotes[p.kind].has(p.id)){let g=p.kind==="footnote"?"footnoteReference":"endnoteReference";r.push(`<w:r>${nr(y)}<w:${g} w:id="${p.id}"/></w:r>`);let b=(e.textContent??"").replace(/[ \t\r\n\f\v]+/g," ").trim(),S=`${p.kind}:${p.id}`;if(b.length>0&&!o.noteMarkFallbacks.has(S)&&o.noteMarkFallbacks.set(S,Gl(b,y)),n.noteBody===void 0)o.bodyNoteRefs[p.kind].add(p.id);else {let x=`${n.noteBody.kind}:${n.noteBody.id}`,I=o.noteNoteRefs.get(x)??[];I.push({kind:p.kind,id:p.id}),o.noteNoteRefs.set(x,I);}return}for(let g of Array.from(e.childNodes))Jl(g,t+1,h,r,o);return}if(i==="a"){let y=e.getAttribute("href"),g=Dn(e.getAttribute("name")||e.getAttribute("id")),b=[];for(let I of Array.from(e.childNodes))Jl(I,t+1,h,b,o);let S=y?.startsWith("#")?Dn(y.slice(1)):null,x=b.join("");if(S!==null)x=`<w:hyperlink w:anchor="${chunkFIJZIQXA_cjs.S(S)}">${x}</w:hyperlink>`;else if(y!==null&&!y.startsWith("#")){let I=chunkFIJZIQXA_cjs.Q(y);I.ok&&I.href.length>0&&(x=`<w:hyperlink r:id="${Vf(o,`${rw}/hyperlink`,I.href,true,n.rels??o.rels)}">${x}</w:hyperlink>`);}if(g!==null){let I=String(o.nextBookmarkId++);x=`<w:bookmarkStart w:id="${I}" w:name="${chunkFIJZIQXA_cjs.S(g)}"/>${x}<w:bookmarkEnd w:id="${I}"/>`;}x.length>0&&r.push(x);return}for(let y of Array.from(e.childNodes))Jl(y,t+1,h,r,o);}function ow(e,t,n,r){let o=Ue(e),a=lt(e),i={};r&&(i.pageBreakBefore=true);let s=j0(e,n.wordHtml);s!==void 0&&(i.styleId=s),t.para.numPr&&(i.numPr=t.para.numPr),t.para.jc&&(i.jc=t.para.jc),t.para.bidi&&(i.bidi=true);let l={...t.run},d=xx[o];d!==void 0&&s===void 0&&!e.classList.contains("docx-outline")&&(l.bold=true,l.szHalfPoints=d);let c=t.pre||o==="pre";o==="pre"&&(l.font="Courier New");let u=hx(e,a,n,t.noteBody);return u&&(i.numPr=u),G0(i,e,n.classAlignments),X0(i,a),l=Mo(l,e),e.getAttribute("dir")?.trim().toLowerCase()==="rtl"&&(i.bidi=true),{run:l,para:i,paragraphMarkCovered:i.styleId!==void 0||i.numPr!==void 0,pre:c,list:t.list,...t.noteBody?{noteBody:t.noteBody}:{},...t.rels?{rels:t.rels}:{}}}function aw(e,t,n,r,o,a=false){if(r.nodesLeft<=0){r.truncated=true;return}if(t>r.maxDepth)return;let i=ow(e,n,r,a);Gr(Array.from(e.childNodes),t+1,i,r,o,true,void 0,false);}function iw(e,t,n,r,o,a=false){if(r.nodesLeft<=0){r.truncated=true;return}if(t>r.maxDepth)return;r.nodesLeft-=1;let i=ix(e);n.list||(r.semanticListCount+=1);let s=n.list?{numId:n.list.numId,level:Math.min(n.list.level+1,8)}:{numId:Tf(r,`sem:${r.semanticListCount}`,i,kf(e)),level:0};if(n.list){let c=r.listsByNumId.get(s.numId);c!==void 0&&!c.levels.has(s.level)&&c.levels.set(s.level,{kind:i,start:kf(e)});}let l={...n,list:s,para:{numPr:{numId:s.numId,ilvl:s.level}}},d=a;for(let c of Array.from(e.childNodes)){if(r.nodesLeft<=0){r.truncated=true;break}if(!Ra(c))continue;let u=Ue(c);if(u==="li")r.nodesLeft-=1,aw(c,t+1,l,r,o,d),d=false;else if(u==="ol"||u==="ul"){let p=o.length;iw(c,t+1,{...n,list:s},r,o,d),o.length>p&&(d=false);}}}function Gr(e,t,n,r,o,a=false,i,s=true){if(t>r.maxDepth)return;let l=o.length,d=i===void 0,c=[],u=[],p=n.para,m=i??{pending:false,skipSpacer:false},h=()=>({...p,pageBreakBefore:void 0,numPr:void 0}),y=()=>{if(c.length===0)return;if(!c.some(b=>b.includes("<w:r")||Nf(b))){if(o.length===l){u=u.concat(c),c=[];return}let b=o[o.length-1];b?.endsWith("</w:p>")?(o[o.length-1]=`${b.slice(0,-6)}${c.join("")}</w:p>`,c=[]):b!==void 0&&c.length>0&&(o.push(Ao(h(),c)),c=[],r.lastMarkCovered=false);return}let g=m.pending?{...p,pageBreakBefore:true}:p;o.push(Ao(g,c)),p.pageBreakBefore&&(p={...p,pageBreakBefore:void 0}),m.pending=false,m.skipSpacer=false,r.lastMarkCovered=n.paragraphMarkCovered,c=[];};for(let g of e){if(r.nodesLeft<=0){r.truncated=true;break}if(Ra(g)){let b=Ue(g),S=b==="w:sdt"?nw(g):null;if(s&&ew(g)){y(),r.nodesLeft-=1,m.pending&&Xl(o),m.pending=true,m.skipSpacer=true;continue}if(_f.has(b)&&!r.equations.has(g)){r.nodesLeft-=1;continue}let x=lt(g);if(x.get("mso-element")?.trim().toLowerCase()==="comment-list"){r.nodesLeft-=1;continue}if(mx(x)){y(),r.nodesLeft-=1,Gr(Array.from(g.childNodes),t+1,n,r,o,false,m,s);continue}if(r.definedNoteElements.has(g)){r.nodesLeft-=1;continue}if(Bf.has(b)){if(y(),r.nodesLeft-=1,m.pending&&m.skipSpacer&&tw(g)){m.skipSpacer=false;continue}if(b==="div"&&qf(g)){let M=ow(g,n,r,false);M.para.pageBreakBefore&&(m.pending=true),Gr(Array.from(g.childNodes),t+1,M,r,o,false,m,s);continue}let I=o.length;aw(g,t,n,r,o,m.pending),o.length>I&&(m.pending=false,m.skipSpacer=false);continue}if(b==="ol"||b==="ul"){y();let I=o.length;iw(g,t,n,r,o,m.pending),o.length>I&&(m.pending=false,m.skipSpacer=false);continue}if(b==="table"){y(),m.pending&&Xl(o),CF(g,t,n,r,o),m.pending=false,m.skipSpacer=false;continue}if($f.has(b)||S!==null||b==="span"&&qf(g)){y(),r.nodesLeft-=1,Gr(S??Array.from(g.childNodes),t+1,n,r,o,false,m,s);continue}}if(g.nodeType===3&&/^[\s\u00a0]+$/.test(g.nodeValue??"")&&Mf(c)){r.nodesLeft-=1;continue}Jl(g,t,n,c,r);}if(a&&o.length===l&&c.length>0&&!c.some(g=>g.includes("<w:r")||Nf(g))&&(o.push(Ao(p,c)),c=[],r.lastMarkCovered=n.paragraphMarkCovered),y(),u.length>0){let g=o[l];g!==void 0&&g.startsWith("<w:p>")?o[l]=g.replace(/^(<w:p>(?:<w:pPr>(?:(?!<\/w:pPr>)[\s\S])*?<\/w:pPr>)?)/,`$1${u.join("")}`):g!==void 0?o.splice(l,0,Ao(h(),u)):c=u.concat(c),u=[];}c.length>0&&(o.push(Ao(h(),c)),c=[],r.lastMarkCovered=false),d&&m.pending&&(Xl(o),m.pending=false,m.skipSpacer=false,r.lastMarkCovered=false),a&&o.length===l&&(o.push(Ao(p,c)),c=[],r.lastMarkCovered=n.paragraphMarkCovered);}function CF(e,t,n,r,o){Xx(e,t,n,r,o,Gr);}function EF(e,t){return bx({blocks:t,rels:e.rels,lists:[...e.lists.values()],notes:e.notes,noteRels:e.noteRels,media:e.media,mediaExtensions:e.mediaExtensions})}function OF(e,t){let n=t.maxHtmlBytes??kF;if(e.length>n)return {ok:false,reason:"too-large"};if(e.length*3>n&&new TextEncoder().encode(e).byteLength>n)return {ok:false,reason:"too-large"};if(typeof DOMParser>"u")return {ok:false,reason:"parse-unavailable"};let r;try{r=new DOMParser().parseFromString(e,"text/html");}catch{return {ok:false,reason:"parse-unavailable"}}let o=r.body;if(!o)return {ok:false,reason:"no-content"};let a=t.maxNodes??RF,i=Mx(e)?Dx(r,a):null,s=fx(r),l={footnote:new Set,endnote:new Set},d=new Set,c={footnote:new Set,endnote:new Set};px(r,s,c);let u={nodesLeft:a-(i?.visited??0),maxDepth:t.maxDepth??PF,maxImageBytes:t.maxImageBytes??TF,wordHtml:W0(e),truncated:false,lastMarkCovered:false,rels:[],media:new Map,mediaExtensions:new Map,mediaBySrc:new Map,lists:new Map,listsByNumId:new Map,semanticListCount:0,imageCount:0,docPrId:0,nextBookmarkId:1,classAlignments:z0(r),listDefinitions:nx(U0(r)),notes:{footnote:new Map,endnote:new Map},noteRels:{footnote:[],endnote:[]},definedNotes:l,bodyNoteRefs:{footnote:new Set,endnote:new Set},noteNoteRefs:new Map,noteMarkFallbacks:new Map,definedNoteElements:d,equations:i?.byElement??new Map},p={};p=Mo(p,r.documentElement),p=Mo(p,o);let m={run:p,para:p.rtl?{bidi:true}:{},paragraphMarkCovered:false,pre:false,list:null},h=[];for(let x of s)c[x.kind].has(x.id)&&(l[x.kind].has(x.id)||(l[x.kind].add(x.id),d.add(x.element),h.push(x)));h.sort((x,I)=>Hf(I.element)-Hf(x.element)),u.lastMarkCovered=false;let y=[];Gr(Array.from(o.childNodes),0,m,u,y);let g=u.lastMarkCovered,b=u.truncated,S=false;for(let x=0;x<h.length;x+=1){let I=h[x];u.truncated=false;let M=u.nodesLeft,k=[];if(Gr(Array.from(I.element.childNodes),0,{...m,noteBody:{kind:I.kind,id:I.id},rels:u.noteRels[I.kind]},u,k,true),u.truncated||k.length===0){S=true;let P=new Set;for(let R=x;R<h.length;R+=1){let w=h[R];l[w.kind].delete(w.id),d.delete(w.element),u.notes[w.kind].delete(w.id),u.bodyNoteRefs[w.kind].delete(w.id),P.add(`${w.kind}:${w.id}`);}if(P.size>0){for(let R=0;R<y.length;R+=1)y[R]=Pa(y[R],P,u.noteMarkFallbacks);for(let R of ["footnote","endnote"])for(let[w,O]of u.notes[R])u.notes[R].set(w,O.map(N=>Pa(N,P,u.noteMarkFallbacks)));}u.nodesLeft=M;for(let R=x;R<h.length&&u.nodesLeft>0;R+=1)Gr(Array.from(h[R].element.childNodes),0,m,u,y);break}u.notes[I.kind].set(I.id,k);}return u.truncated=b||S,u.lastMarkCovered=g,gx(u,l,y,Vf),y.length===0?{ok:false,reason:"no-content"}:{ok:true,projection:u,blocks:y}}var MF=cx();function sw(e,t){let n=`${t.maxHtmlBytes??""}:${t.maxNodes??""}:${t.maxDepth??""}:${t.maxImageBytes??""}`;return MF(e,n,()=>OF(e,t))}function lw(e,t={}){let n=sw(e,t);return n.ok?{ok:true,fragmentBytes:EF(n.projection,n.blocks),lastMarkCovered:n.projection.lastMarkCovered,imageCount:n.projection.imageCount,truncated:n.projection.truncated}:n}function dw(e,t={}){let n=sw(e,t);return n.ok?{lands:true,imageCount:n.projection.imageCount,truncated:n.projection.truncated}:{lands:false,imageCount:0,truncated:false}}var AF={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0"};function cw(e){return e.replace(/&(#x[0-9a-fA-F]+|#\d+|[a-zA-Z]+);/g,(t,n)=>{if(n.startsWith("#")){let r=n.startsWith("#x")?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return !Number.isFinite(r)||r<0||r>1114111||r>=55296&&r<=57343?t:String.fromCodePoint(r)}return AF[n.toLowerCase()]??t})}var FF=new Set(["script","style","title","template"]),LF=new Set(["p","div","li","tr","h1","h2","h3","h4","h5","h6","blockquote","section","article","pre","table"]),NF=new Set(["td","th"]),uw=e=>e!==void 0&&(e>="a"&&e<="z"||e>="A"&&e<="Z"),DF=e=>uw(e)||e!==void 0&&e>="0"&&e<="9",fw=e=>e===" "||e===" "||e===`
|
|
6
|
-
`||e==="\r"||e==="\f";function HF(e,t){let n=t+1,r=e[n]==="/";if(r&&(n+=1),!uw(e[n]))return null;let o=n;for(;n<e.length&&DF(e[n]);)n+=1;let a=e.slice(o,n).toLowerCase(),i="",s=false;for(;n<e.length;){let l=e[n];if(i!=="")l===i&&(i="");else if(l==="=")s=true;else if(s&&(l==='"'||l==="'"))i=l,s=false;else {if(l===">")return {name:a,closing:r,end:n+1};fw(l)||(s=false);}n+=1;}return {name:a,closing:r,end:e.length}}function _F(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===9;)t-=1;return t===e.length?e:e.slice(0,t)}function BF(e,t,n){for(let r=n;r<e.length;){let o=e.indexOf("</",r);if(o===-1)return e.length;let a=o+2;if(e.slice(a,a+t.length).toLowerCase()===t){for(a+=t.length;a<e.length&&fw(e[a]);)a+=1;if(e[a]===">")return a+1}r=o+2;}return e.length}function*pw(e){let t=0;for(;t<e.length;){let n=e.indexOf("<",t);if(n===-1){yield e.slice(t);break}if(n>t&&(yield e.slice(t,n)),e.startsWith("<!--",n)){if(e[n+4]===">"){t=n+5;continue}if(e[n+4]==="-"&&e[n+5]===">"){t=n+6;continue}let o=e.indexOf("-->",n+4);t=o===-1?e.length:o+3;continue}if(e[n+1]==="!"||e[n+1]==="?"){let o=e.indexOf(">",n+1);t=o===-1?e.length:o+1;continue}let r=HF(e,n);if(r===null){yield "<",t=n+1;continue}t=r.end,!r.closing&&FF.has(r.name)?t=BF(e,r.name,r.end):!r.closing&&r.name==="br"?yield `
|
|
7
|
-
`:r.closing&&NF.has(r.name)?yield " ":r.closing&&LF.has(r.name)&&(yield `
|
|
8
|
-
`);}}function $F(e){let t=e.length>2e6?e.slice(0,2e6):e,n="";for(let r of pw(t))n+=r;return cw(n).replace(/\r\n?/g,`
|
|
9
|
-
`).split(`
|
|
10
|
-
`).map(_F).join(`
|
|
11
|
-
`).replace(/\n{3,}/g,`
|
|
12
|
-
|
|
13
|
-
`).trim()}function mw(e){let t="";for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r===12){t+=`
|
|
14
|
-
`;continue}if(r===13){t+=`
|
|
15
|
-
`,e.charCodeAt(n+1)===10&&(n+=1);continue}if(r===9||r===10){t+=e[n];continue}if(!(r<32||r===65534||r===65535)){if(r>=55296&&r<=56319){let o=e.charCodeAt(n+1);o>=56320&&o<=57343&&(t+=e[n]+e[n+1],n+=1);continue}r>=56320&&r<=57343||(t+=e[n]);}}return t}var gw=/[^\s\u200B-\u200F\u2060\u2066-\u2069\u061C\uFEFF\u00AD]/;function hw(e){return gw.test(e)}function Kf(e){let t=e.length>2e6?e.slice(0,2e6):e;for(let n of pw(t)){let r=n.includes("&")?cw(n):n;if(gw.test(r))return true}return false}function Wf(e){if(!e)return "";let t=e.getData("text/plain");if(t.length>0)return t;let n=e.getData("text/html");return n.length>0?$F(n):""}function jf(e,t){if(typeof e.getData!="function")return "";try{return e.getData(t)??""}catch{return ""}}function qF(e){if(!e)return false;if(hw(jf(e,"text/plain")))return true;let t=jf(e,"text/html");if(t.length===0)return false;if(Kf(t))return true;let n=ka(t);return n!==null&&n.bytes[0]===80&&n.bytes[1]===75?true:dw(t).imageCount>0}function VF(e){return e?Kf(jf(e,"text/html")):false}var KF=Object.freeze({kind:"body"});function Ae(e,t){let n=t?.indexOf("#")??-1;if(n===-1)return null;let r=t.slice(0,n);return r.length===0?null:e.currentPackage().parts.get(r)??null}function kt(e,t,n){let r=t?.indexOf("#")??-1,o=r===-1?"":t.slice(0,r);if(o.length===0||o===e.part().name)return {kind:"body"};for(let a of e.headerFooterResolutionBySection())for(let i of [a.headers,a.footers])for(let s of i.values())if(s.partName===o)return {kind:"headerFooter",rId:s.rId};for(let a of ["footnote","endnote"])if(e.partFor({kind:"notesPart",noteKind:a})?.name===o)return {kind:"notesPart",noteKind:a};return n}function ed(e,t){if(e)return {kind:"headerFooter",rId:e.scope.rId};if(t){let n=chunkFIJZIQXA_cjs.pc(t.id);if(n)return {kind:"notesPart",noteKind:n.noteKind}}return {kind:"body"}}function bw(e,t){return e?e.scope:t||KF}function WF(e,t,n){if(n){let o=[];for(let a of [e.footnotes,e.endnotes])if(a)for(let i of a.notes)i.scopeId===n&&o.push(...yw(i.fragments));return o}if(!t)return chunk4GBTELJV_cjs.xa(e);let r=Ta(e,t);return r?yw(r.fragments):[]}function Ta(e,t){let n=t.kind==="header"?e.header:e.footer;if(n&&(n.rId&&n.rId===t.scope.rId||!n.rId&&n.partName===t.partName))return n}function vw(e,t){for(let n of e.pages)for(let r of ["header","footer"]){let o=n[r];if(o?.rId===t)return {pageIndex:n.index,kind:r,story:o}}return null}function td(e,t){return !!(e.rId&&e.rId===t.scope.rId||!e.rId&&e.partName===t.partName&&e.kind===t.kind)}function Zf(e,t,n){let r=chunk4GBTELJV_cjs.Xd(e,t.y),o=e.pages[r];if(!o)return false;let a=t.x-n(r),i=t.y,s=o.contentBox;return a>=s.x&&a<s.x+s.width&&i>=s.y&&i<s.y+s.height}function zf(e,t,n,r,o={}){return chunk4GBTELJV_cjs.$d(e,t,n.fragments,r,o)}function jF(e,t,n){let r=e.pages[t.pageIndex]??e.pages[0];if(!r)return null;let o=Ta(r,t);return o?chunk4GBTELJV_cjs.me(e,t.pageIndex,o.fragments,n):null}function ZF(e,t,n){let r=[];for(let o of e.pages)for(let a of [o.footnotes,o.endnotes]){let i=a?.notes.find(s=>s.scopeId===t);i&&r.push(...chunk4GBTELJV_cjs.me(e,o.index,i.fragments,n));}return r.length>0?r:null}function xw(e,t){return e.querySelector(`[data-page-index="${t}"] > [data-docx-hf-active]`)??e.querySelector("[data-docx-hf-active]")}function ww(e,t,n){let r=e.querySelectorAll("[data-docx-note-scope]"),o=null;for(let a of r){if(a.dataset.docxNoteScope!==t||!a.matches("[data-docx-note]"))continue;o??=a;let i=Number(a.closest("[data-page-index]")?.dataset.pageIndex);if(n!==null&&i===n)return a}return o}function Sw(e,t,n){if((a=>{let i=e.pages[a];return !!i&&!!Ta(i,t)})(t.pageIndex)&&(n===void 0||n.has(t.pageIndex)))return t.pageIndex;let o=null;for(let a of e.pages)if(Ta(a,t)&&(o===null&&(o=a.index),n===void 0||n.has(a.index)))return a.index;return o??t.pageIndex}function Iw(e){return e?{rId:e.scope.rId,pageIndex:e.pageIndex,kind:e.kind,partName:e.partName,variant:e.variant}:null}function kw(e,t,n){e.classList.toggle("docx-paginated-surface--hf-editing",n),t.classList.toggle("docx-pages--hf-editing",n);}function Uf(e,t){e.classList.toggle("docx-paginated-surface--viewing",t==="view");}function Gf(e,t,n,r,o,a,i,s){let l=o?jF(e,o,i):a?ZF(e,a,i):null,d=chunk4GBTELJV_cjs.re(e,t,n,r,{...i?{measurer:i}:{},...l?{stops:l}:{},...s!==void 0?{lineId:s}:{}});if(!d)return null;let u=(l?.find(m=>m.position.paragraphId===d.position.paragraphId&&m.position.offset===d.position.offset&&(d.lineId===void 0||m.lineId===d.lineId))??l?.find(m=>m.position.paragraphId===d.position.paragraphId&&m.position.offset===d.position.offset))?.pageIndex,p=d.lineId===void 0?null:chunk4GBTELJV_cjs.ne(e,d.position,{...i?{measurer:i}:{},...u!==void 0?{preferredPageIndex:u}:{},preferredLineId:d.lineId});return {position:d.position,desiredX:d.desiredX,...u!==void 0?{pageIndex:u}:{},...p?{caret:p}:{}}}function nd(e,t,n){for(let r of e.pages){let o=n(r.index);for(let a of [r.footnotes,r.endnotes])if(a)for(let i of a.notes){let s=i.box,l=s.x+o,d=s.y;if(t.x>=l&&t.x<l+s.width&&t.y>=d&&t.y<d+s.height)return {pageIndex:r.index,scopeId:i.scopeId,noteKind:i.noteKind,noteId:i.noteId,local:{x:t.x-l,y:t.y-d},fragments:i.fragments}}}return null}function Rw(e,t){let n=e[t],r=e.contentBox,o=e.box;if(t==="header"){let d=o.y,c=r.y,u=n?Math.max(c,n.box.y+n.box.height):c,p=n?Math.min(d,n.box.y):d;return u<=p?null:{x:r.x,y:p,width:r.width,height:u-p}}let a=r.y+r.height,i=o.y+o.height,s=n?Math.min(a,n.box.y):a,l=n?Math.max(i,n.box.y+n.box.height):i;return l<=s?null:{x:r.x,y:s,width:r.width,height:l-s}}function Xf(e,t,n){for(let r of e.pages){if(r.parityBlank)continue;let o=n(r.index);for(let a of ["header","footer"]){if(r[a])continue;let i=Rw(r,a);if(!i)continue;let s=i.x+o;if(t.x>=s&&t.x<s+i.width&&t.y>=i.y&&t.y<i.y+i.height)return {pageIndex:r.index,kind:a}}}return null}function Yf(e,t,n){for(let r of e.pages){let o=n(r.index);for(let a of ["header","footer"]){let i=r[a];if(!i)continue;let s=i.box,l=Rw(r,a)??s,d=l.x+o,c=l.y;if(t.x>=d&&t.x<d+l.width&&t.y>=c&&t.y<c+l.height)return {pageIndex:r.index,kind:a,story:i,local:{x:t.x-(s.x+o),y:t.y-s.y}}}}return null}function Pw(e,t,n,r,o,a){let i=e.pages[t.pageIndex];if(!i)return false;let s=i.contentBox,l=n.x-r(i.index)-s.x,d=n.y-s.y;if(l<0||l>=s.width||d<0||d>=s.height)return false;let c=a?{measurer:a}:{},{story:u,local:p}=t,m=chunk4GBTELJV_cjs.Zd(u.anchoredDrawings,p,i.index)!==null||chunk4GBTELJV_cjs.$d(e,i.index,u.fragments,p,c)?.onGlyphs===true;if(o&&m)return false;let h=chunk4GBTELJV_cjs._d(e,i.index,{x:l,y:d},c),y=nd(e,n,r),g=h?.onGlyphs===true&&h.pageIndex===i.index||y?.pageIndex===i.index&&chunk4GBTELJV_cjs.$d(e,i.index,y.fragments,y.local,c)?.onGlyphs===true;return o?g:g||!m}function Ca(e,t,n){if(!t&&!n)return chunk4GBTELJV_cjs.Ra(e);let r=new Set,o=[];for(let a of e.pages)for(let i of WF(a,t,n)){for(let s of i.lines)for(let l of chunk4GBTELJV_cjs.Ma(s))r.has(l.paragraphId)||(r.add(l.paragraphId),o.push(l.paragraphId));i.lines.length===0&&!r.has(i.paragraphId)&&(r.add(i.paragraphId),o.push(i.paragraphId));}return o}function rd(e,t,n,r){let o=Ca(e,n,r);if(o.length===0)return t;let a=new Set(o),i=s=>a.has(s.paragraphId)?s:{paragraphId:o[0],offset:0};return {anchor:i(t.anchor),head:i(t.head)}}function yw(e){let t=[],n=r=>{for(let o of r){if(o.kind==="paragraph"){t.push(o);continue}for(let a of o.rows)if(!a.isHeaderRepeat)for(let i of a.cells)n(i.blocks);}};return n(e),t}function Tw(e){return e.family.trim().length===0?"font family must not be empty":!Number.isInteger(e.weight)||e.weight<1||e.weight>1e3?"font weight must be an integer from 1 through 1000":e.style!=="normal"&&e.style!=="italic"?"font style must be normal or italic":null}function zF(e){try{return typeof caches>"u"?Promise.resolve(null):caches.open(e).catch(()=>null)}catch{return Promise.resolve(null)}}async function UF(e,t){if(!e)return null;try{let n=await e.match(t);return n?new Uint8Array(await n.arrayBuffer()):null}catch{return null}}async function GF(e,t,n){if(e)try{await e.put(t,new Response(n.slice(),{headers:{"Content-Length":String(n.byteLength)}}));}catch{}}async function XF(e,t){if(e)try{await e.delete(t);}catch{}}async function Qf(e){let t=()=>{if(e.signal?.aborted)throw e.signal.reason};t();let n=e.fetcher??fetch,r=e.maxFontBytes??chunk4GBTELJV_cjs.a,o=await zF(e.cacheName??"docx-editor-fonts");t();async function a(d){t();let c=Object.freeze({family:d.family,weight:d.weight,style:d.style}),u=Tw(c);if(u)return {failure:{url:d.url,request:c,reason:"invalidRequest",diagnostic:u}};let p=(b,S)=>{if(b.byteLength===0)return {url:d.url,request:c,reason:"emptyResponse"};if(b.byteLength>r)return {url:d.url,request:c,reason:"overLimit"};let x=chunk4GBTELJV_cjs.l(b,d.faceIndex??0);if(!x.valid)return {url:d.url,request:c,reason:"malformed",diagnostic:x.diagnostic};let I=chunkFIJZIQXA_cjs.f(b);return d.hash!==void 0&&d.hash!==I?{url:d.url,request:c,reason:"hashMismatch",expectedHash:d.hash,actualHash:I,...S?{diagnostic:"cached bytes failed revalidation"}:{}}:{request:c,id:`url:${d.url}`,bytes:b,hash:I,faceIndex:d.faceIndex??0}},m=await UF(o,d.url);if(t(),m){let b=p(m,true);if(!("reason"in b))return {source:b};await XF(o,d.url),t();}let h;try{h=e.signal?await n(d.url,{signal:e.signal}):await n(d.url),t();}catch(b){return t(),{failure:{url:d.url,request:c,reason:"networkError",diagnostic:b instanceof Error?b.message:String(b)}}}if(!h.ok)return {failure:{url:d.url,request:c,reason:"httpError",status:h.status}};let y;try{y=new Uint8Array(await h.arrayBuffer()),t();}catch(b){return t(),{failure:{url:d.url,request:c,reason:"networkError",diagnostic:b instanceof Error?b.message:String(b)}}}let g=p(y,false);return "reason"in g?{failure:g}:(await GF(o,d.url,y),t(),{source:g})}let i=await Promise.all(e.sources.map(d=>a(d)));t();let s=[],l=[];for(let d of i)"source"in d?s.push(d.source):l.push(d.failure);return {sources:s,failures:l}}function YF(e,t,n={}){let r=Object.freeze({family:t.family,weight:t.weight,style:t.style}),o=n.id??`bytes:${r.family}#${r.weight}#${r.style}`,a=Tw(r);if(a)return {failure:{url:o,request:r,reason:"invalidRequest",diagnostic:a}};if(e.byteLength===0)return {failure:{url:o,request:r,reason:"emptyResponse"}};if(e.byteLength>(n.maxFontBytes??chunk4GBTELJV_cjs.a))return {failure:{url:o,request:r,reason:"overLimit"}};let i=t.faceIndex??0,s=chunk4GBTELJV_cjs.l(e,i);return s.valid?{source:{request:r,id:o,bytes:e,hash:chunkFIJZIQXA_cjs.f(e),faceIndex:i}}:{failure:{url:o,request:r,reason:"malformed",diagnostic:s.diagnostic}}}var QF=e=>e.trim().toLowerCase(),Cw=e=>JSON.stringify([QF(e.family),e.weight,e.style]);function JF(e){return chunkK5U2PLDP_cjs.j(async t=>{if(t.signal?.aborted)throw t.signal.reason;let n=new Set((t.resolvedFaces??[]).map(Cw)),r=e.sources.filter(s=>!n.has(Cw(s)));if(r.length===0)return {sources:[],failures:[]};let{onFailure:o,...a}=e,i=await Qf({...a,sources:r,signal:t.signal});if(t.signal?.aborted)throw t.signal.reason;for(let s of i.failures)o?o(s):console.warn(`[fonts] ${s.request.family} (${s.url}): ${s.reason}`);return i})}var e1=96,Ew=37.79527559055118;function t1(e,t){if(!Number.isFinite(e)||e<=0)return [];let n=[];if(t==="inch"){let i=Math.floor(e/12);for(let s=0;s<=i;s+=1){let l=s*12;if(s%8===0){let d=s/8;n.push({position:l,height:10,...d>0?{label:String(d)}:{}});}else s%4===0?n.push({position:l,height:6}):s%2===0?n.push({position:l,height:4}):n.push({position:l,height:2});}return n}let r=Ew/10,o=Math.floor(e/r);for(let a=0;a<=o;a+=1){let i=a*r;if(a%10===0){let s=a/10;n.push({position:i,height:10,...s>0?{label:String(s)}:{}});}else a%5===0?n.push({position:i,height:6}):n.push({position:i,height:3});}return n}function n1(e){let t=[...e].sort((n,r)=>n.index-r.index)[0];return t?t.box:null}var r1=1440,o1=567,a1=180,i1=56.7,Ow=e=>({pageWidth:e.pageWidth,leftMargin:e.rightMargin,rightMargin:e.leftMargin}),od=(e,t,n)=>n<t||e<t?t:e>n?n:e;function Mw(e,t,n){if(t.rtl)return n.pageWidth-Mw(e,{...t,rtl:false},Ow(n));switch(e){case "firstLine":return n.leftMargin+t.left+t.firstLine;case "hanging":case "left":return n.leftMargin+t.left;case "right":return n.pageWidth-n.rightMargin-t.right}}function Aw(e,t,n){if(n)return Math.round(e);let r=t==="cm"?56.7:180;return Math.round(Math.round(e/r)*r)}function Fw(e,t,n,r,o={}){if(n.rtl)return {...Fw(e,r.pageWidth-t,{...n,rtl:false},Ow(r),o),rtl:true};let a=Aw(t,o.unit??"inch",o.precise??false),i=r.pageWidth-r.rightMargin-n.right,s=r.leftMargin+n.left+Math.max(0,n.firstLine);switch(e){case "firstLine":{let l=od(a,0,i);return {...n,firstLine:l-r.leftMargin-n.left}}case "left":{let l=-r.leftMargin-Math.min(0,n.firstLine),d=i-r.leftMargin-Math.max(0,n.firstLine);return {...n,left:od(a-r.leftMargin,l,d)}}case "hanging":{let l=od(a-r.leftMargin,-r.leftMargin,i-r.leftMargin);return {...n,left:l,firstLine:n.firstLine+(n.left-l)}}case "right":{let l=od(a,s,r.pageWidth);return {...n,right:r.pageWidth-r.rightMargin-l}}}}function Lw(e,t){let n=e.snapshot().formatting;if(n)switch(t){case "text.color":return n.color?.kind==="hex"?n.color.value.replace(/^#/,""):void 0;case "text.highlight":return n.highlight;case "styles.style":return n.styleId;case "font.family":return n.fontFamily;case "font.size":return n.fontSizePt===void 0?void 0:String(n.fontSizePt*2);case "list.lineSpacing":return n.lineSpacing?.rule==="multiple"?String(n.lineSpacing.value):void 0;default:return}}function s1(e){if(!(!e||typeof e!="object"||"preventDefault"in e))return e}var Nw="no formatting has been copied",ad="there is nothing at the selection to copy",Jf="the selection has nothing to paint",id=Object.freeze({mode:"off",level:"none"});function Dw(e,t){let n=Math.round(t*12700),r=1143e3,o=`<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:body><w:p><w:r>
|
|
16
|
-
<w:drawing xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape">
|
|
17
|
-
<wp:anchor distT="0" distB="0" distL="91440" distR="91440" simplePos="0" relativeHeight="251658240" behindDoc="0" locked="0" layoutInCell="1" allowOverlap="1">
|
|
18
|
-
<wp:simplePos x="0" y="0"/><wp:positionH relativeFrom="column"><wp:posOffset>0</wp:posOffset></wp:positionH><wp:positionV relativeFrom="paragraph"><wp:posOffset>0</wp:posOffset></wp:positionV>
|
|
19
|
-
<wp:extent cx="${n}" cy="${r}"/><wp:effectExtent l="0" t="0" r="0" b="0"/><wp:wrapNone/><wp:docPr id="${e}" name="Text Box ${e}"/><wp:cNvGraphicFramePr/>
|
|
20
|
-
<a:graphic><a:graphicData uri="http://schemas.microsoft.com/office/word/2010/wordprocessingShape"><wps:wsp><wps:cNvSpPr txBox="1"/><wps:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${n}" cy="${r}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom><a:solidFill><a:srgbClr val="FFFFFF"/></a:solidFill><a:ln w="12700"><a:solidFill><a:srgbClr val="000000"/></a:solidFill></a:ln></wps:spPr><wps:txbx><w:txbxContent><w:p/></w:txbxContent></wps:txbx><wps:bodyPr lIns="91440" rIns="91440" tIns="45720" bIns="45720" anchor="t"><a:noAutofit/></wps:bodyPr></wps:wsp></a:graphicData></a:graphic>
|
|
21
|
-
</wp:anchor></w:drawing></w:r></w:p></w:body></w:document>`,a=chunkFIJZIQXA_cjs.Ia(o,{name:"/word/document.xml",contentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"});if(!a.ok)throw new Error("Cannot build textbox drawing");let i=l=>{if(l.kind==="drawing")return l;if(l.kind==="textValue")return null;for(let d of l.children){let c=i(d);if(c)return c}return null},s=i(a.part.root);if(!s)throw new Error("Textbox drawing is missing");return s}function ep(e){let t=e.activeScope();if(e.editingMode()!=="edit"||t.kind!=="body"&&t.kind!=="frame")return {ok:false,code:"unsupported",reason:"Textboxes can only be inserted in body editing mode"};let n=t.kind==="frame"?t.hostParagraphId:e.state().selection.head.paragraphId;return e.layout().pages.some(r=>r.fragments.some(o=>o.kind==="paragraph"&&o.paragraphId===n))?null:{ok:false,code:"unsupported",reason:"Select a body paragraph outside a table to insert a textbox"}}function Hw(e){let t=ep(e);if(t)return t;let n=e.activeScope(),r=n.kind==="frame"?n.hostParagraphId:e.state().selection.head.paragraphId,o=e.session.part(),a=chunkFIJZIQXA_cjs.Ta(o,r);if(!a||a.kind!=="paragraph")return {ok:false,code:"notFound",reason:"Textbox anchor is missing"};let i=chunkFIJZIQXA_cjs.pe(e.session.currentPackage(),e.collaborationSession()?.identity.actorId);if(!i.ok)return {ok:false,code:"invalidArgs",reason:"Cannot allocate textbox identity"};let s=new Set(chunkFIJZIQXA_cjs.mi(o).map(m=>m.root.id)),l=e.layout().pages.flatMap(m=>m.fragments).find(m=>m.kind==="paragraph"&&m.paragraphId===r),d=Math.min(300,l?.box.width??300);n.kind==="frame"&&e.setActiveScope({kind:"body"});let c=chunkFIJZIQXA_cjs.lg(a);e.setSelection({anchor:{paragraphId:r,offset:c},head:{paragraphId:r,offset:c}});let u=e.applyDrawingOps([{op:"insertDrawing",paragraphId:r,offset:c,drawing:Dw(i.id,d)}]);if(u.rejected)return {ok:false,code:"invalidArgs",reason:u.reason??"Textbox insertion was refused"};let p=chunkFIJZIQXA_cjs.mi(e.session.part()).find(m=>!s.has(m.root.id));return p&&e.setActiveScope({kind:"frame",id:p.root.id,drawingNodeId:p.drawingNodeId,hostParagraphId:p.hostParagraphId}),e.focus(),{ok:true,changed:u.committed}}var tp=new WeakMap;function Pr(e){let t=tp.get(e);if(t)return t;let n=chunkFIJZIQXA_cjs.Rf(e);if(n.length===0)return tp.set(e,[]),[];let r=[];for(let o of n){let a=chunkFIJZIQXA_cjs.Qf(o);for(let i of new Set([o.beginParagraphId,...o.resultParagraphIds,o.endParagraphId])){let s=chunkFIJZIQXA_cjs.Ta(e,i);if(s?.kind!=="paragraph")continue;let l=chunkFIJZIQXA_cjs.jg(s),d=i===o.beginParagraphId,c=i===o.endParagraphId;r.push({toc:o,paragraphId:i,length:l.length,startsHere:d,endsHere:c,start:d?l.spanOf(o.beginNodeId)?.start??0:0,end:c&&a?l.spanOf(a.endNodeId)?.end??l.length:l.length});}}return tp.set(e,r),r}function sd(e){return new Set(Pr(e).filter(t=>t.start===0&&t.end===t.length&&!(t.endsHere&&!t.startsHere&&t.end===0)).map(t=>t.paragraphId))}function np(e,t){return e.endsHere&&!e.startsHere&&e.end===0||e.startsHere&&e.start>0&&t<=e.start||e.endsHere&&e.end<e.length&&t>=e.end?false:t>=e.start&&t<=e.end}function hn(e,t){return Pr(e).find(n=>n.paragraphId===t.paragraphId&&np(n,t.offset))?.toc}function _w(e,t){let{anchor:n,head:r}=t;if(n.paragraphId===r.paragraphId){let o=Math.min(n.offset,r.offset),a=Math.max(n.offset,r.offset);return Pr(e).some(i=>i.paragraphId===n.paragraphId&&(o===a?np(i,o):o<i.end&&a>i.start))}return hn(e,n)!==void 0||hn(e,r)!==void 0}function Bw(e,t){let n=Pr(e);if(n.length===0)return false;let r=chunkFIJZIQXA_cjs.nk(t);if(r.kind==="nodes")return r.targets.some(i=>n.some(s=>{if(i.nodeId!==s.paragraphId)return false;if(i.range){let{start:l,end:d}=i.range;return l===d?np(s,l):l<s.end&&d>s.start}return t.op==="joinParagraphs"&&t.firstId===s.paragraphId&&s.endsHere&&s.end===0?false:i.removes||i.structural?true:s.end>s.start||s.length===0&&!s.endsHere}));let o=new Set(n.map(i=>i.paragraphId)),a=(i,s="")=>typeof i=="string"?/(?:Id|Ids)$/.test(s)&&o.has(i):Array.isArray(i)?i.some(l=>a(l,s)):!!i&&typeof i=="object"&&Object.entries(i).some(([l,d])=>a(d,l));return a(t)}function $w(e,t,n){let r=hn(e,t);if(!r)return null;let o=Pr(e).find(a=>a.toc.id===r.id&&(n?a.startsHere&&a.start>0:a.endsHere&&a.end<a.length));return o?{paragraphId:o.paragraphId,offset:n?o.start:o.end}:null}function qw(e,t){return !Pr(t).some(r=>r.toc.id===e.id&&(r.start>0||r.end<r.length))&&e.contentControlId?e.contentControlId:`toc:${e.id}`}function Vw(e,t,n){if(!t)return;let r=n?.closest("[data-start]");return Pr(e).find(o=>o.paragraphId===t&&(r?Number(r.dataset.start)<o.end&&Number(r.dataset.end)>o.start:sd(e).has(t)))?.toc}var Ji=/^[0-9A-Fa-f]{6}$/,Kw={dk1:"dk1",lt1:"lt1",dk2:"dk2",lt2:"lt2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hlink:"hlink",folhlink:"folHlink",dark1:"dk1",light1:"lt1",dark2:"dk2",light2:"lt2",hyperlink:"hlink",followedhyperlink:"folHlink",background1:"lt1",text1:"dk1",background2:"lt2",text2:"dk2",tx1:"dk1",tx2:"dk2",bg1:"lt1",bg2:"lt2"},l1={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"};function rp(e){return typeof e=="number"&&Number.isFinite(e)&&e>0&&e<=1}function ld(e){return Math.max(0,Math.min(1,e))}function Ww(e){let t=e.replace(/^#/,"").padStart(6,"0").slice(0,6);return {r:parseInt(t.slice(0,2),16)||0,g:parseInt(t.slice(2,4),16)||0,b:parseInt(t.slice(4,6),16)||0}}function jw(e,t,n){let r=o=>Math.max(0,Math.min(255,Math.round(o))).toString(16).padStart(2,"0");return `${r(e)}${r(t)}${r(n)}`.toUpperCase()}function Zw(e,t){if(t>=1)return e.toUpperCase();if(t<=0)return "FFFFFF";let r=Math.max(0,Math.min(255,Math.round((1-ld(t))*255)))/255,o=Ww(e);return jw(r*255+(1-r)*o.r,r*255+(1-r)*o.g,r*255+(1-r)*o.b)}function zw(e,t){if(t>=1)return e.toUpperCase();if(t<=0)return "000000";let r=Math.max(0,Math.min(255,Math.round(ld(t)*255)))/255,o=Ww(e);return jw(r*o.r,r*o.g,r*o.b)}function op(e){return Kw[e]??Kw[e.toLowerCase()]??null}function d1(e,t){let n=op(e);if(!n)return null;let r=t.find(a=>a.slot===n)?.hex;if(r&&Ji.test(r))return r.toUpperCase();let o=l1[n];return o&&Ji.test(o)?o.toUpperCase():null}function dd(e,t){let n=d1(e.slot,t);if(!n)return {ok:false,reason:"the theme colour could not be resolved for this document"};if(e.tint!==void 0&&!rp(e.tint))return {ok:false,reason:"theme tint is out of range"};if(e.shade!==void 0&&!rp(e.shade))return {ok:false,reason:"theme shade is out of range"};let r=n;return e.tint!==void 0?r=Zw(r,ld(e.tint)):e.shade!==void 0&&(r=zw(r,ld(e.shade))),{ok:true,hex:r}}var c1="000000";function ap(e,t){if(e.kind==="hex"){let o=e.value.toUpperCase();return Ji.test(o)?{ok:true,color:{kind:"hex",value:o}}:{ok:false,reason:"border colour requires a six-digit hex value"}}if(e.kind==="auto")return {ok:true,color:{kind:"auto",resolvedHex:c1}};let n=dd(e,t);return n.ok?{ok:true,color:{kind:"theme",slot:op(e.slot)??e.slot,resolvedHex:n.hex,...e.tint!==void 0?{tint:e.tint}:{},...e.shade!==void 0?{shade:e.shade}:{}}}:n}function ip(e,t){if(e.kind==="auto")return {ok:false,reason:"automatic fill cannot be written without a resolved colour"};if(e.kind==="hex"){let o=e.value.toUpperCase();return Ji.test(o)?{ok:true,color:{kind:"hex",value:o}}:{ok:false,reason:"fill colour requires a six-digit hex value"}}let n=dd(e,t);return n.ok?{ok:true,color:{kind:"theme",slot:op(e.slot)??e.slot,resolvedHex:n.hex,...e.tint!==void 0?{tint:e.tint}:{},...e.shade!==void 0?{shade:e.shade}:{}}}:n}function u1(e,t,n="000000"){if(!e||e.kind==="auto")return `#${n}`;if(e.kind==="hex"){let o=e.value.replace(/^#/,"").toUpperCase();return Ji.test(o)?`#${o}`:`#${n}`}let r=dd(e,t);return `#${r.ok?r.hex:n}`}function sp(e,t){return chunk4GBTELJV_cjs.Oe(e).occurrences.some(n=>n.table.tableId===t&&n.row.cells.some(r=>r.logicalGridColumn!==void 0))}function Uw(e,t){return t?e==="left"?"right":e==="right"?"left":e:e}var g1=new Set(["insertRow","deleteRow","insertColumn","deleteColumn","deleteTable","setCellFill","setTableCellVerticalAlignment","setTableBorders","commitTableColumnDividerResize","commitTableRightEdgeResize","mergeCells","splitCell","toggleHeaderRow","selectTableRegion","setTableProperties"]);function Xr(e){return g1.has(e.type)}function be(e,t){return {ok:false,code:e,reason:t}}function lp(e,t){switch(e){case "unknown-table":case "unknown-row":case "unknown-grid-column":return be("invalidArgs","the table target is no longer valid");case "table-has-merge":return be("unsupported","this table has merged cells");case "row-hides-cell":return be("unsupported","this table has a cell the editor cannot place in the grid");case "block-required":return be("unsupported","the table must keep at least one row or column");case "resource-limit":return be("unsupported","the table has reached the supported size limit");case "invalidArgs":case "invalid-property-value":case "unsupported-property":return be("invalidArgs","the table command arguments are invalid");default:return be("unsupported",`the table operation was refused (${e})`)}}function Bt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function on(e,t){return !Bt(e)||Object.keys(e).length!==t.length?false:t.every(r=>Object.prototype.hasOwnProperty.call(e,r))}function Qw(e){if(!Bt(e))return false;let t=e.kind;if(t==="hex")return on(e,["kind","value"])&&typeof e.value=="string";if(t==="auto")return on(e,["kind"]);if(t==="theme"){if(typeof e.slot!="string")return false;let n=["kind","slot"];if(e.tint!==void 0){if(typeof e.tint!="number"||!Number.isFinite(e.tint))return false;n.push("tint");}if(e.shade!==void 0){if(typeof e.shade!="number"||!Number.isFinite(e.shade))return false;n.push("shade");}return on(e,n)}return false}function Jw(e){return Bt(e)&&on(e,["sourceRevision","tableId","rowId","isHeaderRepeat"])&&typeof e.sourceRevision=="number"&&Number.isInteger(e.sourceRevision)&&typeof e.tableId=="string"&&e.tableId.length>0&&typeof e.rowId=="string"&&e.rowId.length>0&&typeof e.isHeaderRepeat=="boolean"}function eS(e){return Bt(e)&&on(e,["sourceRevision","tableId","gridColumnId","isHeaderRepeat"])&&typeof e.sourceRevision=="number"&&Number.isInteger(e.sourceRevision)&&typeof e.tableId=="string"&&e.tableId.length>0&&typeof e.gridColumnId=="string"&&e.gridColumnId.length>0&&typeof e.isHeaderRepeat=="boolean"}function h1(e){return Bt(e)&&on(e,["sourceRevision","tableId","leftGridColumnId","rightGridColumnId","isHeaderRepeat"])&&typeof e.sourceRevision=="number"&&Number.isInteger(e.sourceRevision)&&typeof e.tableId=="string"&&typeof e.leftGridColumnId=="string"&&typeof e.rightGridColumnId=="string"&&typeof e.isHeaderRepeat=="boolean"}function y1(e){return Bt(e)&&on(e,["sourceRevision","tableId","gridColumnId","isHeaderRepeat"])&&typeof e.sourceRevision=="number"&&Number.isInteger(e.sourceRevision)&&typeof e.tableId=="string"&&typeof e.gridColumnId=="string"&&typeof e.isHeaderRepeat=="boolean"}function b1(e){return !Bt(e)||!on(e,["style","size","color"])?false:typeof e.style=="string"&&typeof e.size=="number"&&Number.isInteger(e.size)&&Qw(e.color)}function Gw(e){return !("target"in e)||e.target===void 0||Jw(e.target)}function Xw(e){return !("target"in e)||e.target===void 0||eS(e.target)}function v1(e){switch(e.type){case "insertRow":return !Bt(e)||e.type!=="insertRow"?be("invalidArgs","insertRow command shape is invalid"):e.where!=="above"&&e.where!=="below"?be("invalidArgs","insertRow where must be above or below"):Gw(e)?null:be("invalidArgs","insertRow target shape is invalid");case "deleteRow":return !Bt(e)||e.type!=="deleteRow"?be("invalidArgs","deleteRow command shape is invalid"):Gw(e)?null:be("invalidArgs","deleteRow target shape is invalid");case "insertColumn":return !Bt(e)||e.type!=="insertColumn"?be("invalidArgs","insertColumn command shape is invalid"):e.where!=="left"&&e.where!=="right"?be("invalidArgs","insertColumn where must be left or right"):Xw(e)?null:be("invalidArgs","insertColumn target shape is invalid");case "deleteColumn":return !Bt(e)||e.type!=="deleteColumn"?be("invalidArgs","deleteColumn command shape is invalid"):Xw(e)?null:be("invalidArgs","deleteColumn target shape is invalid");case "deleteTable":return !Bt(e)||!on(e,["type"])?be("invalidArgs","deleteTable command shape is invalid"):null;case "setCellFill":return !Bt(e)||!on(e,["type","color"])?be("invalidArgs","setCellFill command shape is invalid"):e.color!==null&&!Qw(e.color)?be("invalidArgs","setCellFill color shape is invalid"):null;case "setTableCellVerticalAlignment":return !Bt(e)||!on(e,["type","alignment"])||!["top","center","bottom"].includes(e.alignment)?be("invalidArgs","cell vertical alignment command shape is invalid"):null;case "setTableBorders":return !Bt(e)||e.type!=="setTableBorders"?be("invalidArgs","setTableBorders command shape is invalid"):e.scope==="none"?typeof e.target!="string"?be("invalidArgs","border none scope requires a target edge"):null:!("spec"in e)||!b1(e.spec)?be("invalidArgs","concrete border scopes require a complete spec"):null;case "commitTableColumnDividerResize":return !Bt(e)||!on(e,["type","target","leftWidthTwips","rightWidthTwips"])||!h1(e.target)||typeof e.leftWidthTwips!="number"||typeof e.rightWidthTwips!="number"?be("invalidArgs","column divider resize command shape is invalid"):null;case "commitTableRightEdgeResize":return !Bt(e)||!on(e,["type","target","columnWidthTwips","tableWidthTwips"])||!y1(e.target)||typeof e.columnWidthTwips!="number"||typeof e.tableWidthTwips!="number"?be("invalidArgs","right-edge resize command shape is invalid"):null;default:return null}}function x1(e){return !("target"in e)||e.target===void 0?null:Jw(e.target)?e.target:null}function w1(e){return !("target"in e)||e.target===void 0?null:eS(e.target)?e.target:null}function S1(e,t){let n=chunkFIJZIQXA_cjs.aj(e.root,t.tableId);if(!n.ok)return {rowIds:[t.rowId],wholeTable:false};let r=new Set(t.cellIds),o=n.topology.rows.filter(a=>a.cells.some(i=>r.has(i.id))).map(a=>a.row.id);return o.length===0?{rowIds:[t.rowId],wholeTable:false}:{rowIds:o,wholeTable:o.length===n.topology.rows.length}}function I1(e,t){let n=chunkFIJZIQXA_cjs.aj(e.root,t.tableId);if(!n.ok||!n.topology.grid)return {gridColumnIds:[],wholeTable:false};let r=new Set(t.cellIds),o=new Set;for(let a of n.topology.rows){let i=0;for(let s of a.cells){let l=tS(s);if(r.has(s.id))for(let d=0;d<l;d+=1){let c=n.topology.gridColumns[i+d];c&&o.add(c.id);}i+=l;}}return {gridColumnIds:[...o],wholeTable:o.size>0&&o.size===n.topology.gridColumns.length}}function Yw(e,t,n){let r=chunkFIJZIQXA_cjs.aj(e.root,t);return !r.ok||!r.topology.grid?null:r.topology.gridColumns[n]?.id??null}function k1(e){let t=chunk6APGXLBB_cjs.la(e.layout,e.selection.head.paragraphId,e.cellSelection);return t?{tableId:t.tableId,rowId:t.rowId,cellId:t.cellId,cellIds:[...t.cellIds],gridColumnIndex:t.gridColumnIndex,isHeaderRepeat:t.isHeaderRepeat}:null}function tS(e){let t=chunkFIJZIQXA_cjs.Zi(e,"tcPr"),n=t&&chunkFIJZIQXA_cjs.Zi(t,"gridSpan"),r=n&&chunkFIJZIQXA_cjs._i(n,"val");if(!r||!/^\d{1,7}$/.test(r))return 1;let o=Number(r);return Number.isInteger(o)&&o>1?Math.min(o,1024):1}function R1(e,t,n){let r=e.gridColumns.findIndex(o=>o.id===n);if(r===-1)return null;for(let{row:o,cells:a}of e.rows){let i=0;for(let s of a){let l=tS(s);if(r>=i&&r<i+l)return {tableId:t,rowId:o.id,cellId:s.id,cellIds:[s.id],gridColumnIndex:r,isHeaderRepeat:false};i+=l;}}return null}function P1(e,t){if(t.sourceRevision!==e.storeRevision||t.isHeaderRepeat)return null;let n=chunkFIJZIQXA_cjs.aj(e.part.root,t.tableId);if(!n.ok)return null;let r=n.topology.rows.findIndex(i=>i.row.id===t.rowId);if(r===-1)return null;let a=n.topology.rows[r].cells[0];return a?{tableId:t.tableId,rowId:t.rowId,cellId:a.id,cellIds:[a.id],gridColumnIndex:0,isHeaderRepeat:false}:null}function T1(e,t){if(t.sourceRevision!==e.storeRevision||t.isHeaderRepeat)return null;let n=chunkFIJZIQXA_cjs.aj(e.part.root,t.tableId);return n.ok?R1(n.topology,t.tableId,t.gridColumnId):null}function C1(e,t){for(let n of t){let r=chunkFIJZIQXA_cjs.Wk(e,n);if(r)return lp(r)}return null}function rn(e,t,n){let r=C1(e,t);return r||{ok:true,ops:t,selection:n}}function E1(e,t){if(!chunkFIJZIQXA_cjs.Ck.includes(e.style))return {ok:false,reason:"border style is not allowlisted"};if(!Number.isInteger(e.size)||e.size<1)return {ok:false,reason:"border size is out of range"};if(e.size>96)return {ok:false,reason:"border size is out of range"};let n=ap(e.color,t);return n.ok?{ok:true,spec:{style:e.style,size:e.size,color:n.color}}:{ok:false,reason:n.reason}}function es(e,t,n){return n!==e.storeRevision?be("invalidArgs","the table target is stale"):chunkFIJZIQXA_cjs.aj(e.part.root,t).ok?null:be("invalidArgs","the table target is no longer valid")}function O1(e){return e?.isHeaderRepeat?be("unsupported","repeated header rows cannot be edited"):null}function M1(e,t,n,r){let o=es(e,t.tableId,t.sourceRevision);if(o)return o;if(t.isHeaderRepeat)return be("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||!Number.isInteger(r))return be("invalidArgs","column widths must be whole twips");if(n<300||r<300)return be("invalidArgs","column widths are below the minimum");let a=chunkFIJZIQXA_cjs.aj(e.part.root,t.tableId);if(!a.ok){let u=a.reason==="duplicate-node-id"?"unknown-table":a.reason;return lp(u)}let i=a.topology.gridColumns.find(u=>u.id===t.leftGridColumnId),s=a.topology.gridColumns.find(u=>u.id===t.rightGridColumnId);if(!i||!s)return be("invalidArgs","the table target is no longer valid");let l=a.topology.gridColumns.indexOf(i),d=a.topology.gridColumns.indexOf(s);if(Math.abs(d-l)!==1)return be("invalidArgs","the column divider target is not adjacent");let c={op:"setTableColumnWidths",tableId:t.tableId,leftGridColumnId:l<d?t.leftGridColumnId:t.rightGridColumnId,rightGridColumnId:l<d?t.rightGridColumnId:t.leftGridColumnId,leftWidthTwips:l<d?n:r,rightWidthTwips:l<d?r:n};return rn(e.part,[c],{kind:"preserveSelection"})}function A1(e,t,n,r){let o=es(e,t.tableId,t.sourceRevision);if(o)return o;if(t.isHeaderRepeat)return be("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||!Number.isInteger(r))return be("invalidArgs","column widths must be whole twips");if(n<300)return be("invalidArgs","column widths are below the minimum");let a=chunkFIJZIQXA_cjs.aj(e.part.root,t.tableId);if(!a.ok){let l=a.reason==="duplicate-node-id"?"unknown-table":a.reason;return lp(l)}let i=a.topology.gridColumns[a.topology.gridColumns.length-1];if(!i||i.id!==t.gridColumnId)return be("invalidArgs","the resize target is not the table right edge");let s={op:"setTableRightEdgeWidth",tableId:t.tableId,gridColumnId:t.gridColumnId,columnWidthTwips:n,tableWidthTwips:r};return rn(e.part,[s],{kind:"preserveSelection"})}function nS(e,t,n){if(e.viewing||!e.editable)return be("locked","the document is open for viewing");let r=es(e,t.tableId,t.sourceRevision);if(r)return r;if(t.isHeaderRepeat)return be("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||n<20||n>31680)return be("invalidArgs","row height is outside the supported range");let o={op:"setTableRowHeight",tableId:t.tableId,rowId:t.rowId,heightTwips:n};return rn(e.part,[o],{kind:"preserveSelection"})}function Tr(e){let{command:t,part:n,viewing:r,editable:o}=e;if(r||!o)return be("locked","the document is open for viewing");switch(t.type){case "mergeCells":return be("unsupported","cell merge is not supported yet");case "splitCell":return be("unsupported","cell split is not supported yet");case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":return be("unsupported",`command '${t.type}' is not supported by the tree editor`);}let a=v1(t);if(a)return a;let i=x1(t),s=w1(t),l=O1(i??s);if(l)return l;if(i){let c=es(e,i.tableId,i.sourceRevision);if(c)return c}if(s){let c=es(e,s.tableId,s.sourceRevision);if(c)return c}let d=i!==null?P1(e,i):s!==null?T1(e,s):k1(e);if(t.type!=="commitTableColumnDividerResize"&&t.type!=="commitTableRightEdgeResize"&&!d)return i||s?be("invalidArgs","the table target is no longer valid"):be("unsupported","the selection is not inside a table");if(d?.isHeaderRepeat)return be("unsupported","repeated header rows cannot be edited");switch(t.type){case "insertRow":{if(!d)return be("unsupported","the selection is not inside a table");let c={op:"insertTableRow",tableId:d.tableId,rowId:d.rowId,where:t.where};return rn(n,[c],{kind:"adoptCommittedCaret"})}case "deleteRow":{if(!d)return be("unsupported","the selection is not inside a table");let c=S1(n,d),u=c.wholeTable?[{op:"deleteBlock",blockId:d.tableId}]:c.rowIds.map(p=>({op:"deleteTableRow",tableId:d.tableId,rowId:p,...p===d.rowId?{referenceCellId:d.cellId}:{}}));return rn(n,u,{kind:"adoptCommittedCaret"})}case "insertColumn":{if(!d)return be("unsupported","the selection is not inside a table");let c=s?.tableId??d.tableId,u=s?.gridColumnId??Yw(n,c,d.gridColumnIndex),p=sp(e.layout,c)?t.where==="left"?"right":"left":t.where,m=u?{op:"insertTableColumn",tableId:c,where:p,gridColumnId:u}:{op:"insertTableColumn",tableId:c,where:p,referenceCellId:d.cellId};return rn(n,[m],{kind:"adoptCommittedCaret"})}case "deleteColumn":{if(!d)return be("unsupported","the selection is not inside a table");let c=s?.tableId??d.tableId,u=s?.gridColumnId??Yw(n,c,d.gridColumnIndex);if(!u)return be("invalidArgs","the table has no grid column to delete");let p=s?.gridColumnId===void 0?I1(n,d):{gridColumnIds:[u],wholeTable:false};if(p.wholeTable)return rn(n,[{op:"deleteBlock",blockId:c}],{kind:"adoptCommittedCaret"});let h=(p.gridColumnIds.length>0?p.gridColumnIds:[u]).map(y=>({op:"deleteTableColumn",tableId:c,gridColumnId:y}));return rn(n,h,{kind:"adoptCommittedCaret"})}case "deleteTable":{if(!d)return be("unsupported","the selection is not inside a table");let c={op:"deleteBlock",blockId:d.tableId};return rn(n,[c],{kind:"adoptCommittedCaret"})}case "setCellFill":{if(!d)return be("unsupported","the selection is not inside a table");let c;if(t.color===null)c=null;else {let p=ip(t.color,e.themeColors);if(!p.ok)return be("invalidArgs",p.reason);c=p.color;}let u={op:"setTableCellFill",tableId:d.tableId,cellIds:d.cellIds,color:c};return rn(n,[u],{kind:"preserveSelection"})}case "setTableCellVerticalAlignment":{if(!d)return be("unsupported","the selection is not inside a table");let c={op:"setTableCellVerticalAlignment",tableId:d.tableId,cellIds:d.cellIds,alignment:t.alignment};return rn(n,[c],{kind:"preserveSelection"})}case "setTableBorders":{if(!d)return be("unsupported","the selection is not inside a table");if(t.scope==="none"){let p={op:"setTableCellBorders",tableId:d.tableId,cellIds:d.cellIds,scope:"none",target:Uw(t.target,sp(e.layout,d.tableId))};return rn(n,[p],{kind:"preserveSelection"})}let c=E1(t.spec,e.themeColors);if(!c.ok)return be("invalidArgs",c.reason);let u={op:"setTableCellBorders",tableId:d.tableId,cellIds:d.cellIds,scope:Uw(t.scope,sp(e.layout,d.tableId)),spec:c.spec};return rn(n,[u],{kind:"preserveSelection"})}case "commitTableColumnDividerResize":return M1(e,t.target,t.leftWidthTwips,t.rightWidthTwips);case "commitTableRightEdgeResize":return A1(e,t.target,t.columnWidthTwips,t.tableWidthTwips);default:return be("unsupported",`command '${t.type}' is not a table command`)}}function rS(e){if(!Xr(e))return {supported:false,reason:`command '${e.type}' is not a table command`};switch(e.type){case "mergeCells":return {supported:false,reason:"cell merge is not supported yet"};case "splitCell":return {supported:false,reason:"cell split is not supported yet"};case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":return {supported:false,reason:`command '${e.type}' is not supported by the tree editor`};default:return {supported:true}}}function Ct(e){if(typeof e!="object"||e===null)return false;let t=e;return typeof t.paraId=="string"&&t.paraId.length>0&&(t.search===void 0||typeof t.search=="string"&&t.search.length>0)&&(t.occurrence===void 0||typeof t.occurrence=="number"&&Number.isInteger(t.occurrence)&&t.occurrence>=1)}function Do(e){if(typeof e!="object"||e===null)return false;let t=e;return Ct(t.from)&&Ct(t.to)}function oS(e,t,n){let r=[],o=e.indexOf(t);for(;o>=0&&r.length<n;)r.push(o),o=e.indexOf(t,o+1);return r}function an(e,t,n){if(typeof n.paraId!="string"||n.paraId.length===0)return {ok:false,code:"invalidArgs",reason:"paraId must be a non-empty string"};let r=n.paraId.toUpperCase();if(t.ambiguousParaIds.has(r))return {ok:false,code:"ambiguous",reason:`paraId '${n.paraId}' is claimed by more than one story`};let o=t.nodeByParaId.get(r);if(o===void 0)return {ok:false,code:"notFound",reason:`no paragraph with paraId '${n.paraId}'`};let a=chunkFIJZIQXA_cjs.Vi(t.partByNode.get(o)??e,o)??"";if(n.search===void 0)return {ok:true,span:{nodeId:o,start:0,end:a.length}};if(n.search.length===0)return {ok:false,code:"invalidArgs",reason:"search must be a non-empty phrase"};if(n.occurrence!==void 0){if(!Number.isInteger(n.occurrence)||n.occurrence<1)return {ok:false,code:"invalidArgs",reason:"occurrence must be a positive integer (1-based)"};let s=oS(a,n.search,n.occurrence),l=s[n.occurrence-1];return l===void 0?{ok:false,code:"notFound",reason:`'${n.search}' matches ${s.length} time(s) in paragraph '${n.paraId}'; occurrence ${n.occurrence} does not exist`}:{ok:true,span:{nodeId:o,start:l,end:l+n.search.length}}}let i=oS(a,n.search,2);return i.length===0?{ok:false,code:"notFound",reason:`'${n.search}' does not occur in paragraph '${n.paraId}'`}:i.length>1?{ok:false,code:"ambiguous",reason:`'${n.search}' matches more than once in paragraph '${n.paraId}'; pass occurrence to disambiguate`}:{ok:true,span:{nodeId:o,start:i[0],end:i[0]+n.search.length}}}function aS(e,t,n){if("anchor"in n){let s=an(e,t,n.anchor);if(!s.ok)return {ok:false,code:s.code,reason:s.reason,target:n.anchor};let l={paragraphId:s.span.nodeId,offset:s.span.start};return {ok:true,selection:{anchor:l,head:l}}}let{from:r,to:o}=n.range;if(!Ct(r)||!Ct(o))return {ok:false,code:"unsupported",reason:"DocLocation endpoints are not supported; address paragraphs by paraId",target:n.range};let a=an(e,t,r);if(!a.ok)return {ok:false,code:a.code,reason:a.reason,target:r};let i=an(e,t,o);return i.ok?{ok:true,selection:{anchor:{paragraphId:a.span.nodeId,offset:a.span.start},head:{paragraphId:i.span.nodeId,offset:i.span.end}}}:{ok:false,code:i.code,reason:i.reason,target:o}}var F1=["alignment","direction","spaceBeforePt","spaceAfterPt","lineSpacing","tabStops"];function L1(e,t){return e===t?true:!e||!t?false:F1.every(n=>e[n]===t[n])}function dp(e,t){if(e===t)return true;if(!e||!t||e.bold!==t.bold||e.italic!==t.italic||e.underline!==t.underline||e.strike!==t.strike||e.superscript!==t.superscript||e.subscript!==t.subscript||e.highlight!==t.highlight||e.fontFamily!==t.fontFamily||e.fontSizePt!==t.fontSizePt||e.alignment!==t.alignment||e.direction!==t.direction||e.styleId!==t.styleId||e.spaceBeforePt!==t.spaceBeforePt||e.spaceAfterPt!==t.spaceAfterPt||e.lineSpacing?.rule!==t.lineSpacing?.rule||e.lineSpacing?.value!==t.lineSpacing?.value||e.indent?.left!==t.indent?.left||e.indent?.right!==t.indent?.right||e.indent?.firstLine!==t.indent?.firstLine||e.indent?.mixed.left!==t.indent?.mixed.left||e.indent?.mixed.right!==t.indent?.mixed.right||e.indent?.mixed.firstLine!==t.indent?.mixed.firstLine||e.indent?.rtl!==t.indent?.rtl||e.paragraphFlags?.contextualSpacing!==t.paragraphFlags?.contextualSpacing||e.paragraphFlags?.keepNext!==t.paragraphFlags?.keepNext||e.paragraphFlags?.keepLines!==t.paragraphFlags?.keepLines||e.paragraphFlags?.widowControl!==t.paragraphFlags?.widowControl||e.paragraphFlags?.pageBreakBefore!==t.paragraphFlags?.pageBreakBefore||!L1(e.disagrees,t.disagrees)||e.tabStops?.length!==t.tabStops?.length||(e.tabStops??[]).some((a,i)=>a.positionTwips!==t.tabStops?.[i]?.positionTwips||a.alignment!==t.tabStops?.[i]?.alignment||(a.leader??"none")!==(t.tabStops?.[i]?.leader??"none")))return false;if(e.color===t.color)return true;if(!e.color||!t.color)return false;let n=e.color,r=t.color,o=new Set([...Object.keys(n),...Object.keys(r)]);for(let a of o)if(n[a]!==r[a])return false;return true}function cp(e,t){return e.current===t.current&&e.total===t.total}function up(e,t){return e===t?true:!e||!t?false:e.pageWidthTwips===t.pageWidthTwips&&e.pageHeightTwips===t.pageHeightTwips&&e.orientation===t.orientation&&e.marginsTwips.top===t.marginsTwips.top&&e.marginsTwips.right===t.marginsTwips.right&&e.marginsTwips.bottom===t.marginsTwips.bottom&&e.marginsTwips.left===t.marginsTwips.left&&e.gutterTwips===t.gutterTwips}function iS(e,t){if(e===t)return true;if(!e||!t)return false;let n=e,r=t;return n.paraId===r.paraId&&n.search===r.search&&n.occurrence===r.occurrence}function fp(e,t){return e===t?true:!e||!t||!Do(e)||!Do(t)?false:iS(e.from,t.from)&&iS(e.to,t.to)}function pp(){let e=null;return t=>(t===null?e=null:e?.id!==t&&(e=Object.freeze({id:t})),e)}var N1={scope:"compared",isLoading:"compared",isOpening:"compared",parseError:"compared",editable:"compared",zoom:"compared",zoomMode:"compared",selection:"compared",selectionCollapsed:"compared",formatting:"compared",table:"compared",tocContext:"compared",image:"compared",page:"compared",canUndo:"compared",canRedo:"compared",pageSetup:"compared",reviewPaneOpen:"compared",reviewPane:"compared",showParagraphMarks:"compared",documentProtection:"compared",reviewDisplayMode:"compared",revisionMarkup:"compared",hasReviewContent:"compared",hiddenReviewAuthors:"compared",collaborationStatus:"compared",editingMode:"compared",lastRejection:"compared",fontSubstitutions:"compared",formatPainter:"compared"},D1=Object.keys(N1);function mp(e,t){return D1.every(n=>e[n]===t[n])}function cd(e){if(e===null||typeof e!="object"||Object.isFrozen(e))return e;if(Array.isArray(e)){for(let n of e)cd(n);return Object.freeze(e)}let t=e;for(let n of Object.keys(t))cd(t[n]);return Object.freeze(e)}var gp=new Map([["bold",{localName:"b"}],["italic",{localName:"i"}],["underline",{localName:"u",attributes:{val:"single"}}],["strike",{localName:"strike"}],["superscript",{localName:"vertAlign",attributes:{val:"superscript"}}],["subscript",{localName:"vertAlign",attributes:{val:"subscript"}}]]),H1=new Set(["none","black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","red","yellow","white"]),_1=/^[0-9A-Fa-f]{6}$/;function hp(e){let{mark:t,value:n}=e;switch(t){case "fontFamily":return typeof n!="string"||chunkQMLCVPCD_cjs.a(n)===null?{ok:false,code:"invalidArgs",reason:"fontFamily requires a family name of 1-64 letters, digits, or [ -.+_,;]"}:{ok:true,localName:"rFonts",attributes:{ascii:n,hAnsi:n}};case "fontSize":return typeof n!="number"||!Number.isInteger(n)||n<2||n>3276?{ok:false,code:"invalidArgs",reason:"fontSize requires an integer half-point value between 2 and 3276"}:{ok:true,localName:"sz",attributes:{val:String(n)}};case "color":return typeof n!="string"||n!=="auto"&&!_1.test(n)?{ok:false,code:"invalidArgs",reason:"color requires a six-digit hex value like FF0000, or 'auto'"}:{ok:true,localName:"color",attributes:{val:n}};case "highlight":return typeof n!="string"||!H1.has(n)?{ok:false,code:"invalidArgs",reason:"highlight requires an ST_HighlightColor name (yellow, cyan, ...)"}:{ok:true,localName:"highlight",attributes:{val:n}};default:return {ok:false,code:"unsupported",reason:`mark '${t}' is not supported by setMarkAttr`}}}function cS(e){return typeof e=="object"&&e!==null&&typeof e.paragraphId=="string"&&typeof e.offset=="number"}function yp(e){return typeof e=="object"&&e!==null&&cS(e.anchor)&&cS(e.head)}function sn(e,t){let n=new Error(t);return n.code=e,n}function ud(e,t){return e===t?true:!e||!t?false:e.anchor.paragraphId===t.anchor.paragraphId&&e.anchor.offset===t.anchor.offset&&e.head.paragraphId===t.head.paragraphId&&e.head.offset===t.head.offset}function bp(e){return e==="blank"?pf():e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):null}function vp(e){return typeof e=="string"?`'${e}' is not a document; pass DOCX bytes, or 'blank' for an empty one`:"a DocumentHandle cannot be re-loaded; pass DOCX bytes"}function ts(e){switch(e.type){case "toggleMark":return gp.has(e.mark)?{supported:true,mutating:true}:{supported:false,reason:`mark '${e.mark}' is not supported`};case "setMarkAttr":{let t=hp(e);return t.ok?{supported:true,mutating:true}:{supported:false,reason:t.reason,code:t.code}}case "setAlignment":return {supported:true,mutating:true};case "setParagraphDirection":return e.direction==="ltr"||e.direction==="rtl"?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"setParagraphDirection requires a direction of 'ltr' or 'rtl'"};case "clearFormatting":return {supported:true,mutating:true};case "copyFormatting":return {supported:true,mutating:false};case "pasteFormatting":return {supported:true,mutating:true};case "setLineSpacing":{if(!["multiple","exact","atLeast"].includes(e.rule))return {supported:false,code:"invalidArgs",reason:"setLineSpacing requires a rule of 'multiple', 'exact' or 'atLeast'"};let n=e.rule==="multiple"?e.value*240:e.value*20;return !Number.isFinite(e.value)||e.value<=0||Math.round(n)>31680?{supported:false,code:"invalidArgs",reason:"setLineSpacing requires a positive value no taller than 1584pt"}:{supported:true,mutating:true}}case "setParagraphSpacing":{for(let t of ["beforePt","afterPt"]){let n=e[t];if(n!=null&&(!Number.isFinite(n)||n<0||n>1584))return {supported:false,code:"invalidArgs",reason:`setParagraphSpacing requires ${t} between 0 and 1584 points`}}return {supported:true,mutating:true}}case "setParagraphStyle":return e.target!==void 0?{supported:false,reason:"DocTarget addressing is not supported; the style applies at the selection"}:typeof e.styleId!="string"||e.styleId.length===0||e.styleId.length>128||/[\u0000-\u001f\u007f-\u009f]/.test(e.styleId)?{supported:false,code:"invalidArgs",reason:"setParagraphStyle requires a styleId of 1-128 printable characters"}:{supported:true,mutating:true};case "insertHyperlink":return e.target!==void 0?{supported:false,reason:"DocTarget addressing is not supported; a link applies at the selection"}:typeof e.href!="string"||e.href.length===0?{supported:false,code:"invalidArgs",reason:"insertHyperlink requires an href"}:{supported:true,mutating:true};case "removeHyperlink":return e.target===void 0?{supported:true,mutating:true}:{supported:false,reason:"DocTarget addressing is not supported; unlink acts at the selection"};case "setParagraphFormat":{let t=[e.indentLeftTwips,e.indentRightTwips,e.indentFirstLineTwips];for(let r of t)if(r!=null&&(!Number.isInteger(r)||Math.abs(r)>chunk4GBTELJV_cjs.fd))return {supported:false,code:"invalidArgs",reason:`indent values must be whole twips within \xB1${chunk4GBTELJV_cjs.fd}`};for(let r of ["spaceBeforePt","spaceAfterPt"]){let o=e[r];if(o!=null&&(!Number.isFinite(o)||o<0||o>1584))return {supported:false,code:"invalidArgs",reason:`setParagraphFormat requires ${r} between 0 and 1584 points`}}let n=e.lineSpacing;if(n!=null){if(n.rule!=="multiple"&&n.rule!=="exact"&&n.rule!=="atLeast")return {supported:false,code:"invalidArgs",reason:"lineSpacing requires a rule of 'multiple', 'exact' or 'atLeast'"};let r=n.rule==="multiple"?n.value*240:n.value*20;if(!Number.isFinite(n.value)||n.value<=0||Math.round(r)>31680)return {supported:false,code:"invalidArgs",reason:"lineSpacing requires a positive value no taller than 1584pt"}}if(e.alignment!==void 0&&!["left","center","right","justify"].includes(e.alignment))return {supported:false,code:"invalidArgs",reason:"unknown alignment"};if(e.direction!==void 0&&!["ltr","rtl"].includes(e.direction))return {supported:false,code:"invalidArgs",reason:"unknown direction"};if(e.tabStops!==void 0){if(e.tabStops.length>64)return {supported:false,code:"invalidArgs",reason:"setParagraphFormat accepts at most 64 tab stops"};let r=new Set;for(let o of e.tabStops){if(typeof o!="object"||o===null)return {supported:false,code:"invalidArgs",reason:"a tab stop must be an object"};if(!Number.isInteger(o.positionTwips)||o.positionTwips<0||o.positionTwips>31680)return {supported:false,code:"invalidArgs",reason:"tab stop positions must be whole twips between 0 and 31680"};if(!["left","center","right","decimal"].includes(o.alignment))return {supported:false,code:"invalidArgs",reason:"unknown tab alignment"};if(o.leader!==void 0&&!["none","dot","hyphen","underscore","heavy","middleDot"].includes(o.leader))return {supported:false,code:"invalidArgs",reason:"unknown tab leader"};if(r.has(o.positionTwips))return {supported:false,code:"invalidArgs",reason:"two tab stops cannot share a position"};r.add(o.positionTwips);}}return {supported:true,mutating:true}}case "setIndent":{let t=[e.left,e.right,e.firstLine];if(t.every(n=>n===void 0))return {supported:false,reason:"setIndent requires at least one indent field"};for(let n of t)if(n!=null){if(!Number.isInteger(n))return {supported:false,reason:"indent values must be whole twips"};if(Math.abs(n)>chunk4GBTELJV_cjs.fd)return {supported:false,reason:`indent values must be within \xB1${chunk4GBTELJV_cjs.fd} twips`}}return {supported:true,mutating:true}}case "toggleList":return e.kind==="bullet"||e.kind==="ordered"?{supported:true,mutating:true}:{supported:false,reason:`list kind '${e.kind}' is not supported`};case "adjustIndent":return e.direction==="increase"||e.direction==="decrease"?{supported:true,mutating:true}:{supported:false,reason:`indent direction '${e.direction}' is not supported`};case "insertBreak":return e.kind==="line"||e.kind==="page"||e.kind==="section"||e.kind==="sectionContinuous"?{supported:true,mutating:true}:{supported:false,reason:`break kind '${e.kind}' is not supported`};case "insertText":return e.target===void 0?{supported:true,mutating:true}:{supported:false,reason:"DocTarget addressing is not supported; text inserts at the selection"};case "deleteText":return e.target===void 0?{supported:true,mutating:true}:{supported:false,reason:"DocTarget addressing is not supported; deletion removes the selection"};case "proposeInsertion":case "proposeReplacement":{let t=e.type==="proposeInsertion"?e.text:e.replaceWith;return typeof t!="string"||t.length===0?{supported:false,code:"invalidArgs",reason:`${e.type} requires non-empty text`}:/[\r\n\v\f\u2028\u2029]/.test(t)?{supported:false,code:"invalidArgs",reason:`${e.type} requires text without a paragraph mark`}:e.author!==void 0&&e.author.trim().length===0?{supported:false,code:"invalidArgs",reason:`${e.type} requires a non-empty author`}:{supported:true,mutating:true}}case "proposeDeletion":return e.author!==void 0&&e.author.trim().length===0?{supported:false,code:"invalidArgs",reason:"proposeDeletion requires a non-empty author"}:{supported:true,mutating:true};case "setPageSetup":{let t=[e.pageWidth,e.pageHeight],n=[e.marginTop,e.marginRight,e.marginBottom,e.marginLeft];if(t.every(r=>r===void 0)&&n.every(r=>r===void 0)&&e.orientation===void 0)return {supported:false,reason:"setPageSetup requires at least one field"};for(let r of t)if(r!==void 0&&(!Number.isInteger(r)||r<1||r>63360))return {supported:false,code:"invalidArgs",reason:"page dimensions must be integer twips between 1 and 63360"};for(let r of n)if(r!==void 0&&(!Number.isInteger(r)||r<0||r>31680))return {supported:false,code:"invalidArgs",reason:"margins must be integer twips between 0 and 31680"};return e.orientation!==void 0&&e.orientation!=="portrait"&&e.orientation!=="landscape"?{supported:false,code:"invalidArgs",reason:"orientation must be 'portrait' or 'landscape'"}:e.scope!==void 0&&e.scope!=="document"&&e.scope!=="section"?{supported:false,code:"invalidArgs",reason:"scope must be 'document' or 'section'"}:{supported:true,mutating:true}}case "undo":case "redo":return {supported:true,mutating:true};case "insertTable":return Number.isInteger(e.rows)&&Number.isInteger(e.cols)&&e.rows>=1&&e.cols>=1&&e.rows<=32767&&e.cols<=63&&e.rows*e.cols<=2e4?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:`insertTable needs whole rows and cols of at least 1, at most ${32767}\xD7${63}, and at most ${2e4} cells`};case "insertToc":return {supported:true,mutating:true};case "editTextFormField":return {supported:true,mutating:false};case "refreshToc":return e.mode!==void 0&&e.mode!=="entire"&&e.mode!=="pageNumbers"?{supported:false,code:"invalidArgs",reason:"refreshToc mode must be 'entire' or 'pageNumbers'"}:e.tocId!==void 0&&(typeof e.tocId!="string"||e.tocId.length===0)?{supported:false,code:"invalidArgs",reason:"refreshToc tocId must be a non-empty string"}:{supported:true,mutating:true};case "editHeaderFooter":return e.position!=="header"&&e.position!=="footer"?{supported:false,reason:"editHeaderFooter requires position 'header' or 'footer'"}:e.variant!==void 0&&e.variant!=="default"&&e.variant!=="first"&&e.variant!=="even"?{supported:false,reason:"editHeaderFooter variant must be 'default', 'first', or 'even'"}:{supported:true,mutating:true};case "exitHeaderFooter":return {supported:true,mutating:false};case "removeHeaderFooter":case "linkHeaderFooterToPrevious":case "unlinkHeaderFooterFromPrevious":return "variant"in e&&e.variant!==void 0&&e.variant!=="default"&&e.variant!=="first"&&e.variant!=="even"?{supported:false,reason:"furniture variant must be 'default', 'first', or 'even'"}:{supported:true,mutating:true};case "setHeaderFooterOptions":return e.titlePage===void 0&&e.evenAndOddHeaders===void 0&&e.headerDistanceTwips===void 0&&e.footerDistanceTwips===void 0?{supported:false,reason:"setHeaderFooterOptions requires at least one option"}:{supported:true,mutating:true};case "insertPageField":return e.field==="PAGE"||e.field==="NUMPAGES"||e.field==="SECTIONPAGES"||e.field==="PAGE_X_OF_Y"?{supported:true,mutating:true}:{supported:false,reason:"insertPageField field must be 'PAGE', 'NUMPAGES', 'SECTIONPAGES', or 'PAGE_X_OF_Y'"};case "insertNote":return e.noteKind==="footnote"||e.noteKind==="endnote"?{supported:true,mutating:true}:{supported:false,reason:"insertNote noteKind must be 'footnote' or 'endnote'"};case "deleteNote":return e.noteKind==="footnote"||e.noteKind==="endnote"?{supported:true,mutating:true}:{supported:false,reason:"deleteNote noteKind must be 'footnote' or 'endnote'"};case "convertNote":return e.fromKind==="footnote"||e.fromKind==="endnote"?{supported:true,mutating:true}:{supported:false,reason:"convertNote fromKind must be 'footnote' or 'endnote'"};case "convertAllNotes":return e.fromKind==="footnote"||e.fromKind==="endnote"?{supported:true,mutating:true}:{supported:false,reason:"convertAllNotes fromKind must be 'footnote' or 'endnote'"};case "setNoteProperties":return e.endnote?.position==="pageBottom"?{supported:false,reason:"endnote-pageBottom"}:e.footnote!==void 0||e.endnote!==void 0?{supported:true,mutating:true}:{supported:false,reason:"setNoteProperties requires footnote and/or endnote fields"};case "selectAll":case "copy":return {supported:true,mutating:false};case "cut":return {supported:true,mutating:true};case "paste":case "pasteWithoutFormatting":{if(typeof e.text!="string")return {supported:false,code:"invalidArgs",reason:"paste requires text"};let t=e.type==="paste"?e.html:void 0;return t!==void 0&&typeof t!="string"?{supported:false,code:"invalidArgs",reason:"paste html must be a string"}:e.text===""&&(t===void 0||t==="")?{supported:false,code:"invalidArgs",reason:"there is nothing to paste"}:{supported:true,mutating:true}}case "insertRow":case "deleteRow":case "insertColumn":case "deleteColumn":case "deleteTable":case "setCellFill":case "setTableCellVerticalAlignment":case "setTableBorders":case "commitTableColumnDividerResize":case "commitTableRightEdgeResize":case "mergeCells":case "splitCell":case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":{let t=rS(e);return t.supported?{supported:true,mutating:true}:{supported:false,reason:t.reason??"unsupported table command"}}case "setSelection":return "range"in e&&(yp(e.range)||Do(e.range))||"anchor"in e&&Ct(e.anchor)?{supported:true,mutating:false}:{supported:false,reason:"setSelection accepts { anchor: { paraId } }, a { range } whose from/to are paraId anchors, or a { range } carrying a semantic { anchor: { paragraphId, offset }, head } selection"};case "insertTextBox":return {supported:true,mutating:true};case "insertImage":return e.data instanceof Uint8Array&&(e.mime==="image/png"||e.mime==="image/jpeg"||e.mime==="image/gif")&&Number.isFinite(e.widthPoints)&&Number.isFinite(e.heightPoints)&&e.widthPoints>0&&e.heightPoints>0?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"insertImage requires png/jpeg/gif bytes and finite dimensions"};case "replaceImage":return e.data instanceof Uint8Array?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"replaceImage requires image bytes"};case "deleteImage":return {supported:true,mutating:true};case "setImageWrapType":return ["inline","square","squareLeft","squareRight","tight","through","topAndBottom","behind","inFront"].includes(e.target)?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"unsupported wrap target"};case "transformImage":return e.action==="rotateCW"||e.action==="rotateCCW"||e.action==="flipH"||e.action==="flipV"?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"unsupported transform action"};case "setImagePosition":return {supported:true,mutating:true};case "setImageProperties":return {supported:true,mutating:true};default:return {supported:false,reason:`command '${e.type}' is not supported by the tree editor`}}}var ln="comments and tracked changes require the pro review module (@docx-editor.dev/pro)";var Yr="suggesting mode needs an author; configure author before enabling it",B1="this document asks for tracked changes, but no author is configured",uS="this document is protected for filling in forms, which does not track changes",ns="this document is protected against editing; open it in Word to change that",rs="this document is protected for comments only",xp={mode:null,rejection:null};function wp(e,t){if(e===void 0||e==="view")return xp;if(e==="edit")return {mode:"editing",rejection:null};let n=Sp(t);return n!==null?{mode:null,rejection:n.reason}:{mode:"suggesting",rejection:null}}function Sp(e){return e.reviewEnabled?e.hasAuthor?null:{ok:false,code:"invalidArgs",reason:Yr}:{ok:false,code:"unsupported",reason:ln}}function fS(e){let t=false,n=null,r=e.log??(o=>console.error(o));return {report(o){o!==Yr||t||n!==null||(n=setTimeout(()=>{if(n=null,!e.stillMissing())return;t=true;let a=`${Yr}. Edits are not tracked until an author is set (the author option at construction, setAuthor(), or the adapter author prop).`;e.emit(sn("suggestingNeedsAuthor",a)),r(`[@docx-editor.dev/core] ${a}`);},0));},dispose(){n!==null&&clearTimeout(n),n=null;}}}function Ip(e){if(e.restrictedToReadOnly)return e.currentMode==="viewing"?xp:{mode:"viewing",rejection:ns};let t=e.currentMode,n=null;e.engineAdoptedViewing&&t==="viewing"&&!e.viewOnly&&(n="editing",t="editing");let r=n===null?xp:{mode:n,rejection:null};return e.restrictedToComments?t==="suggesting"&&!e.viewOnly?{mode:"editing",rejection:rs}:r:e.restrictedToForms?t==="suggesting"&&!e.viewOnly?{mode:"editing",rejection:uS}:r:e.viewOnly||t!=="editing"||e.readerChoseMode||!(e.trackRevisions&&!e.hostChoseMode)&&!e.restrictedToTrackedChanges||!e.reviewEnabled?r:e.hasAuthor?{mode:"suggesting",rejection:null}:{mode:n,rejection:B1}}function pS(e){return e===null?{enter:true,rejection:null}:{enter:false,rejection:e.reason}}function kp(e,t){return t!=="viewing"&&e.restrictedToReadOnly?{ok:false,code:"locked",reason:ns}:t==="suggesting"&&e.restrictedToComments?{ok:false,code:"locked",reason:rs}:t==="suggesting"&&e.restrictedToForms?{ok:false,code:"locked",reason:uS}:t!=="editing"||!e.restrictedToTrackedChanges?null:{ok:false,code:"locked",reason:"this document permits editing only as tracked changes"}}function mS(e,t,n,r,o,a=false){let i=wp(e,t),s=e==="view"?"viewing":i.mode??o,l=Ip({...t,...n,viewOnly:e==="view",hostChoseMode:e!==void 0,readerChoseMode:false,currentMode:s,engineAdoptedViewing:a});l.mode!==null&&(s=l.mode);let d=kp(n,s),c=n.restrictedToReadOnly?"viewing":r;return {mode:d===null?s:c,rejection:l.rejection??d?.reason??null,configurationRejection:i.rejection}}var gS=new WeakMap;function hS(e,t){gS.set(e,t);}var $1="this document is protected for tracked changes; their authors cannot change",os="this document is protected; only form fields can be filled";function _n(e,t){if(e.type==="undo"||e.type==="redo"||e.type==="toggleDocumentProtection")return null;let n=chunkFIJZIQXA_cjs.Tg(t.session.currentPackage()),r=chunkFIJZIQXA_cjs.Lg(n?.root);if(!r.enforced)return null;if(r.edit==="readOnly"||r.edit==="comments")return {ok:false,code:"locked",reason:r.edit==="comments"?rs:ns};if(r.edit==="trackedChanges"&&e.type==="setReviewChangesAuthor")return {ok:false,code:"locked",reason:$1};if(r.edit!=="forms"||Xr(e))return null;let o="structure",a,i=false;switch(e.type){case "insertText":o="text",a=e.text;break;case "paste":case "pasteWithoutFormatting":o="text",a=e.text,i=true;break;case "deleteText":case "cut":o="text";break;case "toggleMark":case "setMarkAttr":case "pasteFormatting":o="runFormat";break;case "clearFormatting":case "setAlignment":case "setParagraphDirection":case "setLineSpacing":case "setParagraphSpacing":case "setIndent":case "adjustIndent":case "toggleList":case "setParagraphStyle":case "setParagraphFormat":case "removeTabMark":o="paragraph";break;case "setPageSetup":case "setHeaderFooterOptions":case "convertAllNotes":case "insertToc":case "refreshToc":case "replaceAllMatches":case "resolveAllReviewChanges":case "setReviewChangesAuthor":case "acceptRevision":case "rejectRevision":case "acceptAllRevisions":case "rejectAllRevisions":o="document";break}let s=t.state().selection,l=t.session.storyParts().find(p=>s.head.paragraphId.startsWith(`${p.name}#`));if(!l)return {ok:false,code:"locked",reason:os};let d=t.state().cellSelection;return (d&&(o==="runFormat"||o==="paragraph")?[...chunk6APGXLBB_cjs.ga(t.layout(),d.cellIds)].map(p=>({anchor:{paragraphId:p,offset:0},head:{paragraphId:p,offset:(chunkFIJZIQXA_cjs.Vi(l,p)??"").length}})):[s]).some(p=>chunkFIJZIQXA_cjs.rj(l,n,{selection:p,intent:o,text:a,paste:i,fieldId:gS.get(t)?.()??void 0}))?{ok:false,code:"locked",reason:os}:null}function yS(e,t){if(e!=="locked")return e;let n=chunkFIJZIQXA_cjs.Lg(t);return n.enforced?n.edit==="comments"?rs:n.edit==="forms"?os:ns:"this content is locked"}function bS(e){return e!==null&&_n({type:"resolveAllReviewChanges"},e)!==null}function vS(e,t){return ()=>e()??(t()?null:"the document is read-only")}function xS(e){return e.borderWidthEmu!==void 0||e.borderColor!==void 0}function wS(e){return e.horizontalEmu!==void 0||e.verticalEmu!==void 0||e.relativeToH!==void 0||e.relativeToV!==void 0}function SS(e){return e.widthEmu!==void 0||e.heightEmu!==void 0||e.alt!==void 0||e.title!==void 0||e.description!==void 0||e.hyperlink!==void 0||e.crop!==void 0||e.wrap!==void 0||e.resetToNaturalSize===true||chunkFIJZIQXA_cjs.Nk(e)}function q1(e){return [e.left,e.top,e.right,e.bottom]}function Rp(e){return Object.freeze({left:e.left*100,top:e.top*100,right:e.right*100,bottom:e.bottom*100})}function V1(e){return Object.freeze({left:e.left/100,top:e.top/100,right:e.right/100,bottom:e.bottom/100})}function as(e){return Math.round(e*1e3)}function is(e){return e/1e3}function Pp(e){return Object.freeze({left:as(e.left),top:as(e.top),right:as(e.right),bottom:as(e.bottom)})}function K1(e){return Object.freeze({left:is(e.left),top:is(e.top),right:is(e.right),bottom:is(e.bottom)})}function Tp(e){return q1(e).some(n=>!Number.isFinite(n)||n<0||n>100)?false:e.left+e.right<100&&e.top+e.bottom<100}var fd=12700;function Et(e){return Math.round(e*12700)}function Ho(e){return e/12700}function IS(e,t,n,r,o,a){let i=Ho(e),s=Ho(t),l=i/s,d=n.includes("e")?r:n.includes("w")?-r:0,c=n.includes("s")?o:n.includes("n")?-o:0;if(i=Math.max(1,i+d),s=Math.max(1,s+c),a)if(n.length===2){let p=Math.max(i/Ho(e),s/Ho(t));i=Math.max(1,Ho(e)*p),s=Math.max(1,i/l);}else n==="e"||n==="w"?s=Math.max(1,i/l):i=Math.max(1,s*l);return Object.freeze({cx:Et(i),cy:Et(s)})}function pd(e,t,n){return e.mode==="simple"?Object.freeze({mode:"simple",horizontalEmu:(e.horizontalEmu??0)+Et(t),verticalEmu:(e.verticalEmu??0)+Et(n)}):Object.freeze({mode:"frame",...e.horizontalEmu!==void 0?{horizontalEmu:e.horizontalEmu+Et(t)}:{},...e.verticalEmu!==void 0?{verticalEmu:e.verticalEmu+Et(n)}:{},...e.relativeToH!==void 0?{relativeToH:e.relativeToH}:{},...e.relativeToV!==void 0?{relativeToV:e.relativeToV}:{}})}var W1=new Set(["insertImage","replaceImage"]),j1=new Set(["insertImage","replaceImage","deleteImage","setImageWrapType","transformImage","setImagePosition","setImageProperties"]);function Cp(e,t,n){return e.accessibility.hidden||n!==null&&e.drawingNodeId!==n?false:e.start===t||e.start+1===t}function Z1(e,t,n,r){if(!e)return null;for(let o of e.drawings??[])if(o.paragraphId===t&&Cp(o,n,r))return o;return null}function z1(e,t,n,r){let o=e.layout();for(let a of o.pages){for(let i of a.anchoredDrawings??[])if(i.anchorParagraphId===t&&Cp(i,n,r))return i;for(let i of [a.header,a.footer])if(i){for(let s of i.anchoredDrawings??[])if(s.anchorParagraphId===t&&Cp(s,n,r))return s}}return null}function kS(e){return e.kind==="pointer"?`pointer:${e.drawingNodeId}`:e.kind}function Bn(e){if(!e)return null;let t=e.drawingSelectionIntent();if(t.kind==="none")return null;let{anchor:n,head:r}=e.state().selection;if(n.paragraphId!==r.paragraphId||n.offset!==r.offset)return null;let o=chunk4GBTELJV_cjs.vd(e.layout(),n.paragraphId,n.offset),a=t.kind==="pointer"?t.drawingNodeId:null;return Z1(o,n.paragraphId,n.offset,a)??z1(e,n.paragraphId,n.offset,a)}function RS(e,t){let n=e.storyScope(),r=e.session.partFor(n)??e.session.part(),o=chunkFIJZIQXA_cjs.Ta(r,t.drawingNodeId);return o?o.kind!=="drawing"?chunkFIJZIQXA_cjs.Jk(r,t.drawingNodeId):chunkFIJZIQXA_cjs.Nd(o,{ownerPartName:t.ownerPartName,supportedMcRequires:chunkFIJZIQXA_cjs.Gd,limits:chunkFIJZIQXA_cjs.Fd,resolveRelationship:chunkFIJZIQXA_cjs.Id(e.session.currentPackage(),t.ownerPartName)}):null}function PS(e){if(e.kind!=="anchored"||!e.position)return null;let t=e.position;return e.anchor?.simplePos?Object.freeze({mode:"simple",horizontalEmu:t.simplePosition.xEmu,verticalEmu:t.simplePosition.yEmu}):Object.freeze({mode:"frame",...t.horizontal.offsetEmu!==null?{horizontalEmu:t.horizontal.offsetEmu}:{},...t.vertical.offsetEmu!==null?{verticalEmu:t.vertical.offsetEmu}:{},relativeToH:t.horizontal.relativeFrom,relativeToV:t.vertical.relativeFrom})}function U1(e){let t=e.resource;return t.kind!=="ready"?null:Object.freeze({pixelWidth:t.pixelWidth,pixelHeight:t.pixelHeight,dpiX:t.dpiX,dpiY:t.dpiY})}function TS(e){let t=e.locks,n=e.kind==="inline"&&e.textboxStory!==null;return Object.freeze({canResize:!n&&!t.resize&&!e.hidden,canMove:!n&&!t.move&&!e.hidden,canChangeWrap:e.picture!==null&&!t.move&&e.kind==="anchored"&&!e.hidden,canCrop:e.picture!==null&&!t.resize&&!t.changeAspect&&!e.hidden})}function G1(e){return e.kind==="inlineDrawing"?"inline":e.wrap}var CS=e=>e.placeholderGraphicKind===null||!!e.textboxStory;function or(e){let t=Bn(e);if(!t||!CS(t))return null;let n=e?RS(e,t):null;if(!n||n.hidden||n.locks.select)return null;let r=t.transform;return Object.freeze({id:t.drawingNodeId,kind:n.kind,widthEmu:n.extentEmu.cx,heightEmu:n.extentEmu.cy,crop:Rp(t.crop),rotationDegrees:r.rotationDegrees,wrap:G1(t),position:PS(n),name:n.name,title:n.title,description:n.description,hyperlink:n.hyperlinkHref,locks:n.locks,hidden:n.hidden,resourceStatus:t.resource.kind,intrinsic:U1(t),...TS(n)})}function ES(e,t){return e===t?true:!e||!t?false:e.id===t.id&&e.kind===t.kind&&e.widthEmu===t.widthEmu&&e.heightEmu===t.heightEmu&&e.crop.left===t.crop.left&&e.crop.top===t.crop.top&&e.crop.right===t.crop.right&&e.crop.bottom===t.crop.bottom&&e.rotationDegrees===t.rotationDegrees&&e.wrap===t.wrap&&e.name===t.name&&e.title===t.title&&e.description===t.description&&e.hyperlink===t.hyperlink&&e.hidden===t.hidden&&e.resourceStatus===t.resourceStatus&&e.canResize===t.canResize&&e.canMove===t.canMove&&e.canChangeWrap===t.canChangeWrap&&e.canCrop===t.canCrop&&e.locks.select===t.locks.select&&e.locks.move===t.locks.move&&e.locks.resize===t.locks.resize&&e.locks.changeAspect===t.locks.changeAspect&&(e.position?.mode??"frame")===(t.position?.mode??"frame")&&(e.position?.horizontalEmu??null)===(t.position?.horizontalEmu??null)&&(e.position?.verticalEmu??null)===(t.position?.verticalEmu??null)&&(e.position?.relativeToH??null)===(t.position?.relativeToH??null)&&(e.position?.relativeToV??null)===(t.position?.relativeToV??null)&&(e.intrinsic?.pixelWidth??null)===(t.intrinsic?.pixelWidth??null)&&(e.intrinsic?.pixelHeight??null)===(t.intrinsic?.pixelHeight??null)&&(e.intrinsic?.dpiX??null)===(t.intrinsic?.dpiX??null)&&(e.intrinsic?.dpiY??null)===(t.intrinsic?.dpiY??null)}function Ep(e){if("drawingNodeId"in e&&typeof e.drawingNodeId=="string")return e.drawingNodeId}function OS(e){if("expectedPackageRevision"in e&&typeof e.expectedPackageRevision=="number")return e.expectedPackageRevision}function Op(e){return Ep(e)!==void 0||OS(e)!==void 0||e.type==="setImageProperties"&&e.selectionParagraphId!==void 0}function Mp(e,t,n){let r=e.surface;if(!r)return {ok:false,code:"notFound",reason:"no document is loaded"};let o=OS(t);if(o!==void 0&&r.session.packageRevision()!==o)return {ok:false,code:"notFound",reason:"stale package revision"};let a=Ep(t),i=or(r);if(a!==void 0&&(!i||i.id!==a))return {ok:false,code:"notFound",reason:"stale drawing selection"};if(t.type==="setImageProperties"&&t.selectionParagraphId!==void 0&&t.selectionOffset!==void 0){let{anchor:s,head:l}=r.state().selection;if(s.paragraphId!==t.selectionParagraphId||s.offset!==t.selectionOffset||l.paragraphId!==t.selectionParagraphId||l.offset!==t.selectionOffset)return {ok:false,code:"notFound",reason:"stale drawing selection"}}return Ea(e,n,{requireDrawing:a!==void 0||n.drawingNodeId!==null,drawingNodeId:a??n.drawingNodeId??void 0})}function Qr(e,t){let n=or(e),r=Ep(t);return r?!n||n.id!==r?{ok:false,code:"notFound",reason:"stale drawing selection"}:{id:r}:n?{id:n.id}:{ok:false,code:"notFound",reason:"no drawing is selected"}}function X1(e){return e.rejected?{ok:false,code:"invalidArgs",reason:e.reason==="drawing-locked"?"the drawing is locked":e.reason==="unknown-drawing"?"stale drawing selection":typeof e.reason=="string"?e.reason:"the image change was refused"}:null}function md(e,t){return X1(e.applyDrawingOps(t))}function Y1(e){if(!e.intrinsic)return null;let t=Math.round(e.intrinsic.pixelWidth*914400/e.intrinsic.dpiX),n=Math.round(e.intrinsic.pixelHeight*914400/e.intrinsic.dpiY);return !Number.isFinite(t)||!Number.isFinite(n)||t<=0||n<=0?null:{cx:t,cy:n}}function MS(e,t){return t?.position?.mode==="simple"?Object.freeze({mode:"simple",...e.horizontalEmu!==void 0?{horizontalEmu:e.horizontalEmu}:{},...e.verticalEmu!==void 0?{verticalEmu:e.verticalEmu}:{}}):Object.freeze({mode:"frame",...e.horizontalEmu!==void 0?{horizontalEmu:e.horizontalEmu}:{},...e.verticalEmu!==void 0?{verticalEmu:e.verticalEmu}:{},...e.relativeToH!==void 0?{relativeToH:e.relativeToH}:{},...e.relativeToV!==void 0?{relativeToV:e.relativeToV}:{}})}function ss(e){return j1.has(e.type)}function Q1(e){return W1.has(e.type)}function AS(e){return {ok:false,code:"unsupported",reason:`${e.type} is asynchronous; use executeImageCommand`}}function FS(e,t){if(!e)return {ok:false,code:"notFound",reason:"no document is loaded"};let n=e.editingMode();return n==="view"?{ok:false,code:"locked",reason:"the document is open for viewing"}:n==="suggest"&&t==="replaceImage"?{ok:false,code:"invalidArgs",reason:"image changes are not supported in suggesting mode"}:null}function ls(e){let t=e.surface;if(!t)return null;let{anchor:n}=t.state().selection,r=or(t);return Object.freeze({mountGeneration:e.mountGeneration,packageRevision:t.session.packageRevision(),drawingNodeId:r?.id??null,selectionParagraphId:n.paragraphId,selectionOffset:n.offset})}function Ea(e,t,n){let r=e.surface;if(!r)return {ok:false,code:"notFound",reason:"no document is loaded"};if(e.mountGeneration!==t.mountGeneration)return {ok:false,code:"notFound",reason:"the editor is no longer attached"};let{anchor:o,head:a}=r.state().selection;if(o.paragraphId!==t.selectionParagraphId||o.offset!==t.selectionOffset)return {ok:false,code:"notFound",reason:"stale drawing selection"};if(o.paragraphId!==a.paragraphId||o.offset!==a.offset)return {ok:false,code:"notFound",reason:"stale drawing selection"};if(n?.requireDrawing){let i=or(r),s=n.drawingNodeId??t.drawingNodeId;if(!i||!s||i.id!==s)return {ok:false,code:"notFound",reason:"stale drawing selection"}}return null}function Oa(e,t){if(!ss(e))return null;if(!t)return {ok:false,code:"notFound",reason:"no document is loaded"};let n=_n(e,t);if(n)return n;if(e.type==="insertImage")return !(e.data instanceof Uint8Array)||e.data.byteLength===0?{ok:false,code:"invalidArgs",reason:"insertImage requires image bytes"}:!Number.isFinite(e.widthPoints)||!Number.isFinite(e.heightPoints)?{ok:false,code:"invalidArgs",reason:"insertImage requires finite dimensions"}:e.widthPoints<=0||e.heightPoints<=0?{ok:false,code:"invalidArgs",reason:"insertImage dimensions must be positive"}:null;let r=Bn(t);if(r&&"textboxStory"in r&&r.textboxStory&&(e.type==="replaceImage"||e.type==="transformImage"||e.type==="setImageProperties"&&e.hyperlink!==void 0))return {ok:false,code:"unsupported",reason:"this operation is not supported for textboxes"};if(e.type==="replaceImage"){if(!(e.data instanceof Uint8Array)||e.data.byteLength===0)return {ok:false,code:"invalidArgs",reason:"replaceImage requires image bytes"};let s=Qr(t,e);return "ok"in s?s:null}let a=Qr(t,e);if("ok"in a)return a;let i=or(t);if(!i)return {ok:false,code:"notFound",reason:"no drawing is selected"};if(t.editingMode()==="suggest"&&e.type!=="deleteImage")return {ok:false,code:"invalidArgs",reason:"image changes are not supported in suggesting mode"};switch(e.type){case "deleteImage":return i.locks.select?{ok:false,code:"locked",reason:"the drawing cannot be selected"}:null;case "setImageWrapType":return i.canChangeWrap?null:{ok:false,code:"locked",reason:"wrap cannot be changed on this drawing"};case "transformImage":return i.locks.changeAspect||i.locks.resize?{ok:false,code:"locked",reason:"the drawing is locked"}:null;case "setImagePosition":if(!i.canMove||i.kind!=="anchored")return {ok:false,code:"locked",reason:"position cannot be changed on this drawing"};if(!wS(e))return {ok:false,code:"invalidArgs",reason:"setImagePosition requires at least one field"};let s=i.position?.mode??"frame";return chunkFIJZIQXA_cjs.Pk(e,s)?chunkFIJZIQXA_cjs.Kk(MS(e,i))?null:{ok:false,code:"invalidArgs",reason:"setImagePosition carries invalid position values"}:{ok:false,code:"invalidArgs",reason:"setImagePosition carries invalid position values"};case "setImageProperties":{if(xS(e))return {ok:false,code:"unsupported",reason:"image border properties are not supported yet"};if(!SS(e))return {ok:false,code:"invalidArgs",reason:"setImageProperties requires at least one field"};if(e.resetToNaturalSize&&!i.intrinsic)return {ok:false,code:"invalidArgs",reason:"natural size is unavailable for this image"};if(e.widthEmu!==void 0&&(!Number.isFinite(e.widthEmu)||e.widthEmu<=0))return {ok:false,code:"invalidArgs",reason:"widthEmu must be a positive finite number"};if(e.heightEmu!==void 0&&(!Number.isFinite(e.heightEmu)||e.heightEmu<=0))return {ok:false,code:"invalidArgs",reason:"heightEmu must be a positive finite number"};if(e.widthEmu!==void 0&&!i.canResize)return {ok:false,code:"locked",reason:"the drawing is locked"};if(e.heightEmu!==void 0&&!i.canResize)return {ok:false,code:"locked",reason:"the drawing is locked"};if(e.crop!==void 0&&!Tp(e.crop))return {ok:false,code:"invalidArgs",reason:"crop values are out of range"};if(e.crop!==void 0&&!i.canCrop)return {ok:false,code:"locked",reason:"crop cannot be changed on this drawing"};if(e.hyperlink!==void 0&&e.hyperlink!==null&&!chunkFIJZIQXA_cjs.Q(e.hyperlink).ok)return {ok:false,code:"invalidArgs",reason:"unsafe hyperlink URL"};if(e.wrap!==void 0&&!i.canChangeWrap)return {ok:false,code:"locked",reason:"wrap cannot be changed on this drawing"};if(chunkFIJZIQXA_cjs.Nk(e)){if(!i.canMove||i.kind!=="anchored")return {ok:false,code:"locked",reason:"position cannot be changed on this drawing"};let l=i.position?.mode??"frame";if(!chunkFIJZIQXA_cjs.Pk(e,l))return {ok:false,code:"invalidArgs",reason:"setImageProperties carries invalid position values"};if(!chunkFIJZIQXA_cjs.Kk(chunkFIJZIQXA_cjs.Ok(e,i)))return {ok:false,code:"invalidArgs",reason:"setImageProperties carries invalid position values"}}return null}default:return null}}function Ap(e,t){let n=FS(t,e.type);if(n)return n;let r=Oa(e,t);return r||{ok:true}}function LS(e,t){let n=Oa(e,t);return n||AS(e)}function Fp(e,t,n){if(Q1(t))return AS(t);let r=n&&Op(t)?ls(n):null;if(r&&n){let o=Mp(n,t,r);if(o)return o}switch(t.type){case "deleteImage":{let o=Qr(e,t);if("ok"in o)return o;let a=e.deleteImage(o.id);return a.ok?null:{ok:false,code:"invalidArgs",reason:a.detail??a.reason??"deleteImage was refused"}}case "setImageWrapType":{let o=Qr(e,t);return "ok"in o?o:md(e,[{op:"setDrawingWrap",drawingNodeId:o.id,wrap:t.target}])}case "transformImage":{let o=Qr(e,t);return "ok"in o?o:md(e,[{op:"transformDrawing",drawingNodeId:o.id,action:t.action}])}case "setImagePosition":{let o=Qr(e,t);if("ok"in o)return o;let a=or(e),i=MS(t,a);return md(e,[{op:"positionDrawing",drawingNodeId:o.id,position:i}])}case "setImageProperties":{let o=Qr(e,t);if("ok"in o)return o;let a=or(e);if(!a)return {ok:false,code:"notFound",reason:"no drawing is selected"};let i=[];if(t.resetToNaturalSize){let d=Y1(a);if(!d)return {ok:false,code:"invalidArgs",reason:"natural size is unavailable for this image"};i.push({op:"resizeDrawing",drawingNodeId:o.id,extentEmu:d});}else (t.widthEmu!==void 0||t.heightEmu!==void 0)&&i.push({op:"resizeDrawing",drawingNodeId:o.id,extentEmu:{cx:t.widthEmu??a.widthEmu,cy:t.heightEmu??a.heightEmu}});t.crop!==void 0&&i.push({op:"cropDrawing",drawingNodeId:o.id,crop:Pp(t.crop)});let s=t.title??t.alt,l=t.description??t.alt;if((s!==void 0||l!==void 0)&&i.push({op:"setDrawingMetadata",drawingNodeId:o.id,title:s??a.title,description:l??a.description}),t.wrap!==void 0&&i.push({op:"setDrawingWrap",drawingNodeId:o.id,wrap:t.wrap}),chunkFIJZIQXA_cjs.Nk(t)){let d=chunkFIJZIQXA_cjs.Ok(t,a);i.push({op:"positionDrawing",drawingNodeId:o.id,position:d});}if(t.hyperlink!==void 0){let d=e.applyImageProperties({drawingNodeId:o.id,ops:i,hyperlink:t.hyperlink});return d.ok?null:{ok:false,code:"invalidArgs",reason:d.detail??d.reason??"setImageProperties was refused"}}return i.length===0?{ok:false,code:"invalidArgs",reason:"setImageProperties requires at least one field"}:md(e,i)}default:return null}}function J1(e,t,n,r,o){let a=chunk4GBTELJV_cjs.Rc(e.sectionPropertiesAt(t)),i=a.width-a.margin.left-a.margin.right,s=chunk4GBTELJV_cjs.Gc(a),l=a.height-s.top-s.bottom,d=chunk4GBTELJV_cjs.vd(e.layout(),t,n),c=d&&d.box.width>0?Math.min(d.box.width,i):i,u=Math.min(1,c/r,l/o);return u>=1?{widthPoints:r,heightPoints:o}:{widthPoints:r*u,heightPoints:o*u}}async function Lp(e,t){let n=e.surface;if(!n)return {ok:false,code:"notFound",reason:"no document is loaded"};let r=FS(n,t.type);if(r)return r;let o=Oa(t,n);if(o)return o;let a=ls(e);if(!a)return {ok:false,code:"notFound",reason:"no document is loaded"};if(t.type==="insertImage"){let{anchor:u}=n.state().selection,p=t.expectedPackageRevision??a.packageRevision;if(t.expectedPackageRevision!==void 0&&n.session.packageRevision()!==t.expectedPackageRevision)return {ok:false,code:"notFound",reason:"stale package revision"};let m=J1(n,u.paragraphId,u.offset,t.widthPoints,t.heightPoints),h=await n.insertImage({paragraphId:u.paragraphId,offset:u.offset,bytes:t.data,mime:t.mime,widthPoints:m.widthPoints,heightPoints:m.heightPoints,expectedPackageRevision:p,commitGuard:()=>Ea(e,a)===null,...t.title!==void 0?{title:t.title}:{},...t.description!==void 0?{description:t.description}:{},...t.hyperlink!==void 0?{hyperlink:t.hyperlink}:{}}),y=Ea(e,a);return y||(h.ok?{ok:true,changed:h.change!==null}:{ok:false,code:"invalidArgs",reason:h.detail==="stale-package-epoch"?"stale package revision":h.detail??h.reason??"insertImage was refused"})}let i=Qr(n,t);if("ok"in i)return i;let s=t.expectedPackageRevision??a.packageRevision;if(t.expectedPackageRevision!==void 0&&n.session.packageRevision()!==t.expectedPackageRevision)return {ok:false,code:"notFound",reason:"stale package revision"};let l=t.mime??"image/png",d=await n.replaceImage(i.id,t.data,l,{expectedPackageRevision:s,commitGuard:()=>Ea(e,a,{requireDrawing:true,drawingNodeId:i.id})===null}),c=Ea(e,a,{requireDrawing:true,drawingNodeId:i.id});return c||(d.ok?{ok:true,changed:d.change!==null}:{ok:false,code:"invalidArgs",reason:d.detail==="stale-package-epoch"?"stale package revision":d.detail??d.reason??"replaceImage was refused"})}var eL=1,tL=10;function nL(e,t){if(!t||t.hidden||t.locks.select||!CS(e))return Object.freeze({canResize:false,canMove:false,aspectLocked:true});let n=TS(t);return Object.freeze({canResize:n.canResize,canMove:n.canMove,aspectLocked:t.locks.changeAspect})}function rL(e){if(!e)return null;let t=e.activeScope(),{anchor:n,head:r}=e.state().selection;if(t.kind!=="frame"&&(n.paragraphId!==r.paragraphId||n.offset!==r.offset))return null;let o=t.kind==="frame"?chunk4GBTELJV_cjs.fe(e.layout(),t.drawingNodeId)?.record:Bn(e);if(!o||o.accessibility.hidden)return null;let a=e.layout(),i=chunk4GBTELJV_cjs.fe(a,o.drawingNodeId);if(!i)return null;let s=RS(e,o);if(!s||s.locks.select)return null;let l=nL(o,s),c=e.editingMode()==="edit"&&e.session.editable?l:{...l,canResize:false,canMove:false},u=o.kind==="anchoredDrawing"?Object.freeze({x:o.horizontalFrameOrigin,y:o.verticalFrameOrigin}):null;return Object.freeze({id:o.drawingNodeId,textbox:"textboxStory"in o&&!!o.textboxStory,pageIndex:i.pageIndex,x:i.x,y:i.y,width:i.width,height:i.height,kind:o.kind==="inlineDrawing"?"inline":"anchored",widthEmu:s.extentEmu.cx,heightEmu:s.extentEmu.cy,position:PS(s),anchorFrameOrigin:u,transform:o.transform,...c})}function oL(e,t){let n=e.surface;return n?n.publishedLayout().revision!==t.layoutRevision?{ok:false,code:"notFound",reason:"stale layout revision"}:n.session.packageRevision()!==t.packageRevision?{ok:false,code:"notFound",reason:"stale package revision"}:Ea(e,t.preconditions,{requireDrawing:true,drawingNodeId:t.drawingNodeId}):{ok:false,code:"notFound",reason:"no document is loaded"}}function NS(e){if(!e)return null;let t=e.formatting();return {bold:t.bold,italic:t.italic,underline:t.underline,strike:t.strikethrough,superscript:t.superscript,subscript:t.subscript,...t.color?{color:{kind:"hex",value:t.color}}:{},...t.highlight?{highlight:t.highlight}:{},...t.fontFamily?{fontFamily:t.fontFamily}:{},...t.fontSizeHalfPoints!==null?{fontSizePt:t.fontSizeHalfPoints/2}:{},...t.alignment?{alignment:t.alignment}:{},...t.direction?{direction:t.direction}:{},...t.styleId?{styleId:t.styleId}:{},...t.lineSpacing?{lineSpacing:t.lineSpacing}:{},...t.spaceBeforePt!==null?{spaceBeforePt:t.spaceBeforePt}:{},...t.spaceAfterPt!==null?{spaceAfterPt:t.spaceAfterPt}:{},...t.indent!==null?{indent:t.indent}:{},paragraphFlags:t.paragraphFlags,disagrees:t.disagrees,...t.tabStops!==null?{tabStops:t.tabStops}:{}}}var Np=new WeakMap;function DS(e,t){let n=e.isScheduled(),r=Dp(t);return r?Np.set(e,r):n||Np.delete(e),r??(n?Np.get(e)??null:null)}function Dp(e){if(!e)return null;let t=e.sectionPropertiesAt(e.state().selection.head.paragraphId);return {pageWidthTwips:t.pageSize.widthTwips,pageHeightTwips:t.pageSize.heightTwips,orientation:t.landscape?"landscape":"portrait",marginsTwips:{top:t.margins.topTwips,right:t.margins.rightTwips,bottom:t.margins.bottomTwips,left:t.margins.leftTwips},gutterTwips:t.margins.gutterTwips}}function gd(e){if(!e)return null;let{anchor:t,head:n}=e.state().selection;if(t.paragraphId===n.paragraphId){let d=e.session.paraIdOf(t.paragraphId);return d===null?null:{from:{paraId:d},to:{paraId:d}}}let r=e.session.paragraphAnchors(),o=r.paraIdByNode.get(t.paragraphId),a=r.paraIdByNode.get(n.paragraphId);if(o===void 0||a===void 0)return null;let i=r.ordinalByNode.get(t.paragraphId)??0,s=r.ordinalByNode.get(n.paragraphId)??0;return s<i||s===i&&n.offset<t.offset?{from:{paraId:a},to:{paraId:o}}:{from:{paraId:o},to:{paraId:a}}}function HS(e){if(!e)return null;let t=e.hyperlinks.linkAtCaret();if(!t)return null;let n=e.session.paraIdOf(t.paragraphId);return n===null?null:{href:t.href??"",range:{from:{paraId:n},to:{paraId:n}},...t.tooltip!==void 0?{tooltip:t.tooltip}:{}}}function _S(e,t){if(!e)return [];if(t!==void 0&&t.part!=="body")return [];let n=e.session.part(),r=e.session.paragraphAnchors();return chunkSRPILEWV_cjs.d(n).map(o=>{let a=r.paraIdByNode.get(o.id),i=o.kind==="textValue"?void 0:chunkSRPILEWV_cjs.i(o);return {...a!==void 0?{paraId:a}:{},text:chunkFIJZIQXA_cjs.Vi(n,o.id)??"",...i!==void 0?{styleId:i}:{}}})}function Hp(e){return e?e.state().pageCount:0}function _p(e,t="caret"){return e?e.currentPage(t):1}function aL(e,t){if(!Xr(e))return {ok:false,refusal:{ok:false,code:"unsupported",reason:"not a table command"}};let n=hd(e,t);return n.can.ok?{ok:true,tablePlan:n.plan}:{ok:false,refusal:{ok:false,code:n.can.code,reason:n.can.reason}}}function iL(e,t){return {command:e,part:t.session.partFor(t.storyScope())??t.session.part(),layout:t.layout(),storeRevision:t.session.packageRevision(),selection:t.state().selection,cellSelection:t.state().cellSelection,themeColors:t.session.documentThemeColors(),editable:t.session.editable,viewing:t.editingMode()==="view"}}function hd(e,t){let n=iL(e,t),r=Tr(n),o=chunkFIJZIQXA_cjs.Tg(t.session.currentPackage());return r.ok&&r.ops.some(a=>chunkFIJZIQXA_cjs.pk(n.part,o,a))&&(r={ok:false,code:"locked",reason:os}),r.ok?{can:{ok:true},plan:r}:{can:{ok:false,code:r.code,reason:r.reason},plan:r}}function ds(e,t,n,r){if(r?.scope){if(r.scope.kind==="all")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"the all scope is read-only"}};if(r.scope.kind==="note"||r.scope.kind==="frame")return {ok:false,refusal:{ok:false,code:"unsupported",reason:`scope kind '${r.scope.kind}' is not supported`}};if(r.scope.kind==="headerFooter"){let s=t?.activeScope?.()??{kind:"body"};if(s.kind!=="headerFooter"||s.rId!==r.scope.rId)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"open that header or footer before dispatching against its scope"}}}}let o=ts(e);if(!o.supported)return {ok:false,refusal:{ok:false,code:o.code??"unsupported",reason:o.reason}};if(!t)return {ok:false,refusal:{ok:false,code:"notFound",reason:"no document is loaded"}};if(o.mutating&&(n==="view"||!t.session.editable))return {ok:false,refusal:{ok:false,code:"locked",reason:"the document is read-only"}};let a=o.mutating?_n(e,t):null;if(a)return {ok:false,refusal:a};if(e.type==="insertTextBox"){let s=ep(t);return s?{ok:false,refusal:s}:{ok:true}}if(e.type==="adjustIndent"&&!t.canAdjustIndent(e.direction))return {ok:false,refusal:{ok:false,code:"unsupported",reason:e.direction==="decrease"?"the selection is already at the outermost level":"the selection cannot indent any further"}};if(e.type==="deleteText"&&Bn(t)){let s=Oa({type:"deleteImage"},t);return s&&!s.ok?{ok:false,refusal:s}:{ok:true}}if(e.type==="copy"||e.type==="cut"||e.type==="deleteText"){let{anchor:s,head:l}=t.state().selection;if(s.paragraphId===l.paragraphId&&s.offset===l.offset)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"nothing is selected"}}}if(e.type==="setParagraphStyle"&&!t.session.documentStyles().some(s=>s.type==="paragraph"))return {ok:false,refusal:{ok:false,code:"unsupported",reason:"this document defines no paragraph styles"}};if(e.type==="pasteFormatting"&&t.formatPainter.state().level==="none")return {ok:false,refusal:{ok:false,code:"notFound",reason:Nw}};if(e.type==="undo"&&!t.state().canUndo)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"nothing to undo"}};if(e.type==="redo"&&!t.state().canRedo)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"nothing to redo"}};if(e.type==="insertTable"&&!t.canInsertTable(e.rows,e.cols))return {ok:false,refusal:{ok:false,code:"unsupported",reason:"a table can only be inserted at a caret in editable body, cell, or note text"}};if(e.type==="insertToc"&&!t.canInsertToc())return {ok:false,refusal:{ok:false,code:"unsupported",reason:"a table of contents can only be inserted in the editable document body"}};if(e.type==="editTextFormField"&&!t.canEditTextFormField())return {ok:false,refusal:{ok:false,code:"unsupported",reason:"field options are unavailable"}};if(e.type==="refreshToc"&&!t.canRefreshToc(e.tocId))return {ok:false,refusal:{ok:false,code:"notFound",reason:"there is no refreshable table of contents at the selection"}};if(e.type==="insertPageField"&&(t.activeScope?.()??{kind:"body"}).kind!=="headerFooter")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"insertPageField requires an open header or footer scope"}};if(e.type==="insertNote"&&(t.activeScope?.()??{kind:"body"}).kind!=="body")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"insertNote requires body scope"}};if(e.type==="insertBreak"&&(e.kind==="section"||e.kind==="sectionContinuous")){if((t.activeScope?.()??{kind:"body"}).kind!=="body")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"a section break can only be inserted in the editable document body"}};let l=t.sectionBreakRefusal(e.kind==="section"?"nextPage":"continuous");if(l)return {ok:false,refusal:{ok:false,code:"unsupported",reason:l}}}if(e.type==="insertBreak"&&e.kind==="page"&&(t.activeScope?.()??{kind:"body"}).kind!=="body")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"a page break can only be inserted in the editable document body"}};if(e.type==="linkHeaderFooterToPrevious"){let s=t.headerFooterState?.();if((e.sectionIndex??s?.sectionIndex??0)===0)return {ok:false,refusal:{ok:false,code:"invalidArgs",reason:"the first section cannot link to a previous header or footer"}}}if(Xr(e)){let s=aL(e,t);return s.ok?{ok:true,tablePlan:s.tablePlan}:s}let i=Oa(e,t);return i&&!i.ok?{ok:false,refusal:i}:{ok:true}}function BS(e,t){let n=e.session.part();if(!t.startsWith(`${n.name}#`)||!chunkFIJZIQXA_cjs.Ta(n,t))return true;let r=chunkFIJZIQXA_cjs.Ua(n,t),o=0;for(;r;){if(r.kind==="tableCell"||r.kind==="generic"&&r.localName==="tc"||(o+=1)>64)return true;r=chunkFIJZIQXA_cjs.Ua(n,r.id);}return false}function $S(e){if(!e)return null;let t=e.state(),n=t.cellSelection;if(!n&&!BS(e,t.selection.head.paragraphId))return null;let r=chunk6APGXLBB_cjs.ka(e.layout(),t.selection.head.paragraphId);return r?{blockId:r.tableId,rowCount:r.rows,columnCount:r.columns,cell:{row:n?n.rows.from:r.rowIndex,column:n?n.columns.from:r.columnIndex}}:null}function yd(e){if(!e)return null;let t=e.state(),n=t.cellSelection;if(!n&&!BS(e,t.selection.head.paragraphId))return null;let r=chunk6APGXLBB_cjs.ka(e.layout(),t.selection.head.paragraphId);return r?{rows:r.rows,columns:r.columns,rowIndex:n?n.rows.from:r.rowIndex,columnIndex:n?n.columns.from:r.columnIndex}:null}function qS(e){return e?{...e.bold!==void 0?{bold:e.bold}:{},...e.italic!==void 0?{italic:e.italic}:{},...e.underline!==void 0?{underline:e.underline}:{},...e.fontFamily?{fontFamily:e.fontFamily}:{},...e.fontSizePt!==void 0?{fontSizeHalfPoints:Math.round(e.fontSizePt*2)}:{},...e.styleId?{styleId:e.styleId}:{},...e.alignment?{alignment:e.alignment}:{}}:null}function VS(e){return !!e&&hn(e.session.part(),e.state().selection.head)!==void 0}var le={undo:["M280-200v-80h284q63 0 109.5-40T720-420q0-60-46.5-100T564-560H312l104 104-56 56-200-200 200-200 56 56-104 104h252q97 0 166.5 63T800-420q0 94-69.5 157T564-200H280Z"],redo:["M396-200q-97 0-166.5-63T160-420q0-94 69.5-157T396-640h252L544-744l56-56 200 200-200 200-56-56 104-104H396q-63 0-109.5 40T240-420q0 60 46.5 100T396-280h284v80H396Z"],print:["M640-640v-120H320v120h-80v-200h480v200h-80Zm-480 80h640-640Zm560 100q17 0 28.5-11.5T760-500q0-17-11.5-28.5T720-540q-17 0-28.5 11.5T680-500q0 17 11.5 28.5T720-460Zm-80 260v-160H320v160h320Zm80 80H240v-160H80v-240q0-51 35-85.5t85-34.5h560q51 0 85.5 34.5T880-520v240H720v160Zm80-240v-160q0-17-11.5-28.5T760-560H200q-17 0-28.5 11.5T160-520v160h80v-80h480v80h80Z"],file_download:["M480-320 280-520l56-58 104 104v-326h80v326l104-104 56 58-200 200ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z"],file_upload:["M440-320v-326L336-542l-56-58 200-200 200 200-56 58-104-104v326h-80ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z"],format_bold:["M272-200v-560h221q65 0 120 40t55 111q0 51-23 78.5T602-491q25 11 55.5 41t30.5 90q0 89-65 124.5T501-200H272Zm121-112h104q48 0 58.5-24.5T566-372q0-11-10.5-35.5T494-432H393v120Zm0-228h93q33 0 48-17t15-38q0-24-17-39t-44-15h-95v109Z"],format_italic:["M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z"],format_underlined:["M200-120v-80h560v80H200Zm123-223q-56-63-56-167v-330h103v336q0 56 28 91t82 35q54 0 82-35t28-91v-336h103v330q0 104-56 167t-157 63q-101 0-157-63Z"],strikethrough_s:["M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z"],superscript:["M760-600v-80q0-17 11.5-28.5T800-720h80v-40H760v-40h120q17 0 28.5 11.5T920-760v40q0 17-11.5 28.5T880-680h-80v40h120v40H760ZM235-160l185-291-172-269h106l124 200h4l123-200h107L539-451l186 291H618L482-377h-4L342-160H235Z"],subscript:["M760-160v-80q0-17 11.5-28.5T800-280h80v-40H760v-40h120q17 0 28.5 11.5T920-320v40q0 17-11.5 28.5T880-240h-80v40h120v40H760Zm-525-80 185-291-172-269h106l124 200h4l123-200h107L539-531l186 291H618L482-457h-4L342-240H235Z"],link:["M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"],format_clear:["m528-546-93-93-121-121h486v120H568l-40 94ZM792-56 460-388l-80 188H249l119-280L56-792l56-56 736 736-56 56Z"],format_paragraph:["M360-160v-240q-83 0-141.5-58.5T160-600q0-83 58.5-141.5T360-800h360v80h-80v560h-80v-560H440v560h-80Z"],format_shapes:["M40-40v-240h80v-400H40v-240h240v80h400v-80h240v240h-80v400h80v240H680v-80H280v80H40Zm240-160h400v-80h80v-400h-80v-80H280v80h-80v400h80v80Zm32-120 136-360h64l136 360h-62l-32-92H408l-32 92h-64Zm114-144h108l-52-150h-4l-52 150ZM120-760h80v-80h-80v80Zm640 0h80v-80h-80v80Zm0 640h80v-80h-80v80Zm-640 0h80v-80h-80v80Zm80-640Zm560 0Zm0 560Zm-560 0Z"],lock:["M240-80q-33 0-56.5-23.5T160-160v-400q0-33 23.5-56.5T240-640h40v-80q0-83 58.5-141.5T480-920q83 0 141.5 58.5T680-720v80h40q33 0 56.5 23.5T800-560v400q0 33-23.5 56.5T720-80H240Zm0-80h480v-400H240v400Zm240-120q33 0 56.5-23.5T560-360q0-33-23.5-56.5T480-440q-33 0-56.5 23.5T400-360q0 33 23.5 56.5T480-280ZM360-640h240v-80q0-50-35-85t-85-35q-50 0-85 35t-35 85v80Zm-120 480v-400 400Z"],format_align_left:["M120-120v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Z"],format_align_center:["M120-120v-80h720v80H120Zm160-160v-80h400v80H280ZM120-440v-80h720v80H120Zm160-160v-80h400v80H280ZM120-760v-80h720v80H120Z"],format_align_right:["M120-760v-80h720v80H120Zm240 160v-80h480v80H360ZM120-440v-80h720v80H120Zm240 160v-80h480v80H360ZM120-120v-80h720v80H120Z"],format_align_justify:["M120-120v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Z"],format_line_spacing:["M240-160 80-320l56-56 64 62v-332l-64 62-56-56 160-160 160 160-56 56-64-62v332l64-62 56 56-160 160Zm240-40v-80h400v80H480Zm0-240v-80h400v80H480Zm0-240v-80h400v80H480Z"],format_list_bulleted:["M360-200v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360ZM200-160q-33 0-56.5-23.5T120-240q0-33 23.5-56.5T200-320q33 0 56.5 23.5T280-240q0 33-23.5 56.5T200-160Zm0-240q-33 0-56.5-23.5T120-480q0-33 23.5-56.5T200-560q33 0 56.5 23.5T280-480q0 33-23.5 56.5T200-400Zm-56.5-263.5Q120-687 120-720t23.5-56.5Q167-800 200-800t56.5 23.5Q280-753 280-720t-23.5 56.5Q233-640 200-640t-56.5-23.5Z"],format_list_numbered:["M120-80v-60h100v-30h-60v-60h60v-30H120v-60h120q17 0 28.5 11.5T280-280v40q0 17-11.5 28.5T240-200q17 0 28.5 11.5T280-160v40q0 17-11.5 28.5T240-80H120Zm0-280v-110q0-17 11.5-28.5T160-510h60v-30H120v-60h120q17 0 28.5 11.5T280-560v70q0 17-11.5 28.5T240-450h-60v30h100v60H120Zm60-280v-180h-60v-60h120v240h-60Zm180 440v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360Z"],format_indent_increase:["M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm0 440v-320l160 160-160 160Z"],format_indent_decrease:["M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm160 440L120-480l160-160v320Z"],format_color_text:["M80 0v-160h800V0H80Zm140-280 210-560h100l210 560h-96l-50-144H368l-52 144h-96Zm176-224h168l-82-232h-4l-82 232Z"],ink_highlighter:["M544-400 440-504 240-304l104 104 200-200Zm-47-161 104 104 199-199-104-104-199 199Zm-84-28 216 216-229 229q-24 24-56 24t-56-24l-2-2-26 26H60l126-126-2-2q-24-24-24-56t24-56l229-229Zm0 0 227-227q24-24 56-24t56 24l104 104q24 24 24 56t-24 56L629-373 413-589Z"],format_color_reset:["M800-436q0 36-8 69t-22 63l-62-60q6-17 9-34.5t3-37.5q0-47-17.5-89T650-600L480-768l-88 86-56-56 144-142 226 222q44 42 69 99.5T800-436Zm-8 380L668-180q-41 29-88 44.5T480-120q-133 0-226.5-92.5T160-436q0-51 16-98t48-90L56-792l56-56 736 736-56 56ZM480-200q36 0 68.5-10t61.5-28L280-566q-21 32-30.5 64t-9.5 66q0 98 70 167t170 69Zm-37-204Zm110-116Z"],arrow_drop_down:["M480-360 280-560h400L480-360Z"],table:["M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z"],table_chart:["M760-120H200q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120ZM200-640h560v-120H200v120Zm100 80H200v360h100v-360Zm360 0v360h100v-360H660Zm-80 0H380v360h200v-360Z"],grid_on:["M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133ZM200-413h133v-134H200v134Zm213 0h134v-134H413v134Zm214 0h133v-134H627v134ZM200-627h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133Z"],table_rows:["M760-200v-120H200v120h560Zm0-200v-160H200v160h560Zm0-240v-120H200v120h560ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z"],view_column:["M121-280v-400q0-33 23.5-56.5T201-760h559q33 0 56.5 23.5T840-680v400q0 33-23.5 56.5T760-200H201q-33 0-56.5-23.5T121-280Zm79 0h133v-400H200v400Zm213 0h133v-400H413v400Zm213 0h133v-400H626v400Z"],border_all:["M120-120v-720h720v720H120Zm640-80v-240H520v240h240Zm0-560H520v240h240v-240Zm-560 0v240h240v-240H200Zm0 560h240v-240H200v240Z"],select_all:["M120-120v-720h720v720H120Zm640-80v-240H520v240h240Zm0-560H520v240h240v-240Zm-560 0v240h240v-240H200Zm0 560h240v-240H200v240Z"],border_outer:["M200-200h560v-560H200v560Zm-80 80v-720h720v720H120Zm160-320v-80h80v80h-80Zm160 160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 160v-80h80v80h-80Z"],border_inner:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm320 640v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm-160 0v-80h80v80h-80ZM440-120v-320H120v-80h320v-320h80v320h320v80H520v320h-80Z"],border_clear:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],add:["M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"],remove:["M200-440v-80h560v80H200Z"],delete:["M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z"],delete_sweep:["M600-240v-80h160v80H600Zm0-320v-80h280v80H600Zm0 160v-80h240v80H600ZM120-640H80v-80h160v-60h160v60h160v80h-40v360q0 33-23.5 56.5T440-200H200q-33 0-56.5-23.5T120-280v-360Zm80 0v360h240v-360H200Zm0 0v360-360Z"],call_merge:["m296-160-56-56 200-200v-269L337-582l-57-57 200-200 201 201-57 57-104-104v301L296-160Zm368 1L536-286l57-57 127 128-56 56Z"],call_split:["M440-160v-304L240-664v104h-80v-240h240v80H296l224 224v336h-80Zm154-376-58-58 128-126H560v-80h240v240h-80v-104L594-536Z"],drag_indicator:["M360-160q-33 0-56.5-23.5T280-240q0-33 23.5-56.5T360-320q33 0 56.5 23.5T440-240q0 33-23.5 56.5T360-160Zm240 0q-33 0-56.5-23.5T520-240q0-33 23.5-56.5T600-320q33 0 56.5 23.5T680-240q0 33-23.5 56.5T600-160ZM360-400q-33 0-56.5-23.5T280-480q0-33 23.5-56.5T360-560q33 0 56.5 23.5T440-480q0 33-23.5 56.5T360-400Zm240 0q-33 0-56.5-23.5T520-480q0-33 23.5-56.5T600-560q33 0 56.5 23.5T680-480q0 33-23.5 56.5T600-400ZM360-640q-33 0-56.5-23.5T280-720q0-33 23.5-56.5T360-800q33 0 56.5 23.5T440-720q0 33-23.5 56.5T360-640Zm240 0q-33 0-56.5-23.5T520-720q0-33 23.5-56.5T600-800q33 0 56.5 23.5T680-720q0 33-23.5 56.5T600-640Z"],image:["M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"],format_image_left:["M120-280v-400h400v400H120Zm80-80h240v-240H200v240Zm-80-400v-80h720v80H120Zm480 160v-80h240v80H600Zm0 160v-80h240v80H600Zm0 160v-80h240v80H600ZM120-120v-80h720v80H120Z"],format_image_right:["M440-280v-400h400v400H440Zm80-80h240v-240H520v240ZM120-120v-80h720v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h720v80H120Z"],horizontal_rule:["M160-440v-80h640v80H160Z"],flip_to_back:["M200-120q-33 0-56.5-23.5T120-200v-480h80v480h480v80H200Zm160-240v80q-33 0-56.5-23.5T280-360h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm80-160h-80q0-33 23.5-56.5T360-840v80Zm80 480v-80h80v80h-80Zm0-480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0 480v-80h80v80h-80Zm160-480v-80q33 0 56.5 23.5T840-760h-80Zm0 400h80q0 33-23.5 56.5T760-280v-80Zm0-80v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],flip_to_front:["M360-280q-33 0-56.5-23.5T280-360v-400q0-33 23.5-56.5T360-840h400q33 0 56.5 23.5T840-760v400q0 33-23.5 56.5T760-280H360Zm0-80h400v-400H360v400ZM200-200v80q-33 0-56.5-23.5T120-200h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"],open_with:["M480-80 310-250l57-57 73 73v-166h80v165l72-73 58 58L480-80ZM250-310 80-480l169-169 57 57-72 72h166v80H235l73 72-58 58Zm460 0-57-57 73-73H560v-80h165l-73-72 58-58 170 170-170 170ZM440-560v-166l-73 73-57-57 170-170 170 170-57 57-73-73v166h-80Z"],tune:["M440-120v-240h80v80h320v80H520v80h-80Zm-320-80v-80h240v80H120Zm160-160v-80H120v-80h160v-80h80v240h-80Zm160-80v-80h400v80H440Zm160-160v-240h80v80h160v80H680v80h-80Zm-480-80v-80h400v80H120Z"],rotate_right:["M522-80v-82q34-5 66.5-18t61.5-34l56 58q-42 32-88 51.5T522-80Zm-80 0Q304-98 213-199.5T122-438q0-75 28.5-140.5t77-114q48.5-48.5 114-77T482-798h6l-62-62 56-58 160 160-160 160-56-56 64-64h-8q-117 0-198.5 81.5T202-438q0 104 68 182.5T442-162v82Zm322-134-58-56q21-29 34-61.5t18-66.5h82q-5 50-24.5 96T764-214Zm76-264h-82q-5-34-18-66.5T706-606l58-56q32 39 51 86t25 98Z"],rotate_left:["M440-80q-50-5-96-24.5T256-156l56-58q29 21 61.5 34t66.5 18v82Zm80 0v-82q104-15 172-93.5T760-438q0-117-81.5-198.5T480-718h-8l64 64-56 56-160-160 160-160 56 58-62 62h6q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-438q0 137-91 238.5T520-80ZM198-214q-32-42-51.5-88T122-398h82q5 34 18 66.5t34 61.5l-58 56Zm-76-264q6-51 25-98t51-86l58 56q-21 29-34 61.5T204-478h-82Z"],swap_horiz:["M280-160 80-360l200-200 56 57-103 103h287v80H233l103 103-56 57Zm400-240-56-57 103-103H440v-80h287L624-743l56-57 200 200-200 200Z"],swap_vert:["M320-440v-287L217-624l-57-56 200-200 200 200-57 56-103-103v287h-80ZM600-80 400-280l57-56 103 103v-287h80v287l103-103 57 56L600-80Z"],shapes:["M600-360ZM320-242q10 1 19.5 1.5t20.5.5q11 0 20.5-.5T400-242v82h400v-400h-82q1-10 1.5-19.5t.5-20.5q0-11-.5-20.5T718-640h82q33 0 56.5 23.5T880-560v400q0 33-23.5 56.5T800-80H400q-33 0-56.5-23.5T320-160v-82Zm40-78q-117 0-198.5-81.5T80-600q0-117 81.5-198.5T360-880q117 0 198.5 81.5T640-600q0 117-81.5 198.5T360-320Zm0-80q83 0 141.5-58.5T560-600q0-83-58.5-141.5T360-800q-83 0-141.5 58.5T160-600q0 83 58.5 141.5T360-400Zm0-200Z"],format_paint:["M440-80q-33 0-56.5-23.5T360-160v-160H240q-33 0-56.5-23.5T160-400v-280q0-66 47-113t113-47h480v440q0 33-23.5 56.5T720-320H600v160q0 33-23.5 56.5T520-80h-80ZM240-560h480v-200h-40v160h-80v-160h-40v80h-80v-80H320q-33 0-56.5 23.5T240-680v120Zm0 160h480v-80H240v80Zm0 0v-80 80Z"],expand_more:["M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"],expand_less:["m296-345-56-56 240-240 240 240-56 56-184-184-184 184Z"],border_top:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h720v80H120Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],border_bottom:["M120-120v-80h720v80H120Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],border_left:["M120-120v-720h80v720h-80Zm160 0v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],border_right:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-720h80v720h-80Z"],border_horizontal:["M120-120v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h720v60H120Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-660v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-660v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-165v-60h60v60h-60Z"],border_vertical:["M120-120v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-330v-60h60v60h-60Zm165 660v-720h60v720h-60Zm165 0v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-330v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Z"],padding:["M320-600q17 0 28.5-11.5T360-640q0-17-11.5-28.5T320-680q-17 0-28.5 11.5T280-640q0 17 11.5 28.5T320-600Zm160 0q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm160 0q17 0 28.5-11.5T680-640q0-17-11.5-28.5T640-680q-17 0-28.5 11.5T600-640q0 17 11.5 28.5T640-600ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Z"],text_rotation_none:["M160-200v-80h528l-42-42 56-56 138 138-138 138-56-56 42-42H160Zm116-200 164-440h80l164 440h-76l-38-112H392l-40 112h-76Zm138-176h132l-64-182h-4l-64 182Z"],wrap_text:["M588-132 440-280l148-148 56 58-50 50h96q29 0 49.5-20.5T760-390q0-29-20.5-49.5T690-460H160v-80h530q63 0 106.5 43.5T840-390q0 63-43.5 106.5T690-240h-96l50 50-56 58ZM160-240v-80h200v80H160Zm0-440v-80h640v80H160Z"],height:["M480-120 320-280l56-56 64 63v-414l-64 63-56-56 160-160 160 160-56 57-64-64v414l64-63 56 56-160 160Z"],fit_width:["M120-120v-720h80v720h-80Zm640 0v-720h80v720h-80ZM280-440v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"],settings:["m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z"],border_color:["M80 0v-160h800V0H80Zm160-320h56l312-311-29-29-28-28-311 312v56Zm-80 80v-170l448-447q11-11 25.5-17t30.5-6q16 0 31 6t27 18l55 56q12 11 17.5 26t5.5 31q0 15-5.5 29.5T777-687L330-240H160Zm560-504-56-56 56 56ZM608-631l-29-29-28-28 57 57Z"],format_color_fill:["m247-904 57-56 343 343q23 23 23 57t-23 57L457-313q-23 23-57 23t-57-23L153-503q-23-23-23-57t23-57l190-191-96-96Zm153 153L209-560h382L400-751Zm360 471q-33 0-56.5-23.5T680-360q0-21 12.5-45t27.5-45q9-12 19-25t21-25q11 12 21 25t19 25q15 21 27.5 45t12.5 45q0 33-23.5 56.5T760-280ZM80 0v-160h800V0H80Z"],vertical_align_top:["M160-760v-80h640v80H160Zm280 640v-408L336-424l-56-56 200-200 200 200-56 56-104-104v408h-80Z"],vertical_align_center:["M440-80v-168l-64 64-56-56 160-160 160 160-56 56-64-64v168h-80ZM160-440v-80h640v80H160Zm320-120L320-720l56-56 64 64v-168h80v168l64-64 56 56-160 160Z"],vertical_align_bottom:["M160-120v-80h640v80H160Zm320-160L280-480l56-56 104 104v-408h80v408l104-104 56 56-200 200Z"],line_weight:["M120-160v-40h720v40H120Zm0-120v-80h720v80H120Zm0-160v-120h720v120H120Zm0-200v-160h720v160H120Z"],keyboard_arrow_up:["M480-528 296-344l-56-56 240-240 240 240-56 56-184-184Z"],keyboard_arrow_down:["M480-344 240-584l56-56 184 184 184-184 56 56-240 240Z"],keyboard_arrow_left:["M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"],keyboard_arrow_right:["M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"],more_vert:["M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"],page_break:["M120-440v-80h160v80H120Zm200 0v-80h160v80H320Zm200 0v-80h160v80H520Zm200 0v-80h120v80H720ZM240-120q-33 0-56.5-23.5T160-200v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-120H240Zm-80-520v-120q0-33 23.5-56.5T240-840h480q33 0 56.5 23.5T800-760v120h-80v-120H240v120h-80Z"],branding_watermark:["M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160H160Zm0-80h640v-480H160v480Zm320-60q66 0 113-37t47-93q0-29-13-58t-34-55q-21-26-50-49t-50-31q-21 8-50 31t-50 49q-21 26-34 55t-13 58q0 56 47 93t140 37Z"],arrow_back:["M313-440l224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"],search:["M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"],toc:["M120-240v-80h240v80H120Zm0-200v-80h480v80H120Zm0-200v-80h720v80H120Z"],done_all:["M268-240 42-466l57-56 170 170 56 56-57 56Zm226 0L268-466l56-57 170 170 368-368 57 57-425 424Zm0-226-57-56 198-198 57 56-198 198Z"],check_circle:["m424-296 282-282-56-56-226 226-114-114-56 56 170 170Zm56 216q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"],chat_bubble_outline:["M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],chat_bubble_check:["M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],check:["M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"],close:["m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"],add_comment:["M440-400h80v-120h120v-80H520v-120h-80v120H320v80h120v120ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],comment:["M240-400h480v-80H240v80Zm0-120h480v-80H240v80Zm0-120h480v-80H240v80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],edit_note:["M160-400h280v-80H160v80Zm0-160h440v-80H160v80Zm0-160h440v-80H160v80Zm360 360v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q8 9 12.5 20t4.5 22q0 11-4 22.5T863-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z"],rate_review:["M240-400h122l200-200q9-9 13.5-20.5T580-643q0-11-5-21.5T562-684l-36-38q-9-9-20-13.5t-23-4.5q-11 0-22.5 4.5T440-722L240-522v122Zm280-243-37-37 37 37ZM300-460v-38l101-101 20 18 18 20-101 101h-38Zm121-121 18 20-38-38 20 18Zm26 181h273v-80H527l-80 80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],visibility:["M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Zm0-300Zm0 220q113 0 207.5-59.5T832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280Z"],format_textdirection_l_to_r:["M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm0-280v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80ZM680-80l-56-56 64-64H120v-80h568l-64-64 56-56 160 160L680-80Z"],format_textdirection_r_to_l:["M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm-88 160 64 64-56 56-160-160 160-160 56 56-64 64h568v80H272Zm88-440v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80Z"],"agent-sparkle":["m760-600-50-110-110-50 110-50 50-110 50 110 110 50-110 50-50 110Zm0 560-50-110-110-50 110-50 50-110 50 110 110 50-110 50-50 110ZM360-160 260-380 40-480l220-100 100-220 100 220 220 100-220 100-100 220Zm0-194 40-86 86-40-86-40-40-86-40 86-86 40 86 40 40 86Zm0-126Z"]};var Ma={activeTarget:"all",spec:{style:"single",size:8,color:{kind:"hex",value:"000000"}}},WS=["table.borderTarget","table.borderColor","table.borderStyle","table.borderWidth","table.cellFill"];function Bp(e){return i18n.createT(i18n.en)(e)}function cs(e){return WS.includes(e)}function dL(e){return e!=null}var jS=[{value:"all",icon:"border_all",labelKey:"table.borders.all"},{value:"outside",icon:"border_outer",labelKey:"table.borders.outside"},{value:"inside",icon:"border_inner",labelKey:"table.borders.inside"},{value:"top",icon:"border_top",labelKey:"table.borders.top"},{value:"bottom",icon:"border_bottom",labelKey:"table.borders.bottom"},{value:"left",icon:"border_left",labelKey:"table.borders.left"},{value:"right",icon:"border_right",labelKey:"table.borders.right"},{value:"none",icon:"border_clear",labelKey:"table.borders.none"}],ZS=[{value:"single",labelKey:"table.borderStyles.single",previewClass:"docx-table-line--single"},{value:"dashed",labelKey:"table.borderStyles.dashed",previewClass:"docx-table-line--dashed"},{value:"dotted",labelKey:"table.borderStyles.dotted",previewClass:"docx-table-line--dotted"},{value:"double",labelKey:"table.borderStyles.double",previewClass:"docx-table-line--double"},{value:"triple",labelKey:"table.borderStyles.triple",previewClass:"docx-table-line--triple"},{value:"thick",labelKey:"table.borderStyles.thick",previewClass:"docx-table-line--thick"}],cL=[{size:4,labelKey:"table.borderWidths.halfPt",previewThickness:.5},{size:8,labelKey:"table.borderWidths.onePt",previewThickness:1},{size:12,labelKey:"table.borderWidths.oneHalfPt",previewThickness:1.5},{size:16,labelKey:"table.borderWidths.twoPt",previewThickness:2},{size:24,labelKey:"table.borderWidths.threePt",previewThickness:3}];function uL(e){return e==="all"||e==="outside"||e==="inside"||e==="top"||e==="bottom"||e==="left"||e==="right"}function fL(e){return e==="none"||uL(e)}function KS(e){if(!e||typeof e!="object")return false;let t=e.kind;return t==="hex"||t==="theme"||t==="auto"}function pL(e){return ZS.some(t=>t.value===e)}function _o(e,t,n){switch(t){case "table.borderTarget":return fL(n)?n==="none"?{command:{type:"setTableBorders",scope:"none",target:e.activeTarget},nextDraft:e}:{command:{type:"setTableBorders",scope:n,spec:e.spec},nextDraft:{activeTarget:n,spec:e.spec}}:null;case "table.borderColor":{if(!KS(n))return null;let r={...e.spec,color:n};return {command:{type:"setTableBorders",scope:e.activeTarget,spec:r},nextDraft:{activeTarget:e.activeTarget,spec:r}}}case "table.borderStyle":{if(!pL(n))return null;let r={...e.spec,style:n};return {command:{type:"setTableBorders",scope:e.activeTarget,spec:r},nextDraft:{activeTarget:e.activeTarget,spec:r}}}case "table.borderWidth":{if(typeof n!="number"||!Number.isInteger(n))return null;let r={...e.spec,size:n};return {command:{type:"setTableBorders",scope:e.activeTarget,spec:r},nextDraft:{activeTarget:e.activeTarget,spec:r}}}case "table.cellFill":return n!==null&&!KS(n)?null:{command:{type:"setCellFill",color:n},nextDraft:e};default:return null}}function $p(e,t=Ma){switch(e){case "table.borderTarget":return {type:"setTableBorders",scope:t.activeTarget,spec:t.spec};case "table.borderColor":return _o(t,e,{kind:"hex",value:"000000"})?.command??null;case "table.borderStyle":return _o(t,e,"single")?.command??null;case "table.borderWidth":return _o(t,e,8)?.command??null;case "table.cellFill":return {type:"setCellFill",color:{kind:"hex",value:"FFFF00"}};default:return null}}function mL(e){return jS.find(n=>n.value===e)?.labelKey??"table.borders.all"}function gL(e){return le[e]}function Jr(e){return e.surface??null}var hL={"review.revisionMarkup":{type:"openRevisionMarkupDialog"},"review.comments":{type:"toggleReviewPane"},"review.paragraphMarks":{type:"toggleParagraphMarks"},"review.protectDocument":{type:"toggleDocumentProtection"},"review.simpleMarkup":{type:"setReviewDisplayMode",mode:"simple-markup"},"review.allMarkup":{type:"setReviewDisplayMode",mode:"all-markup"},"review.noMarkup":{type:"setReviewDisplayMode",mode:"proposed"},"review.original":{type:"setReviewDisplayMode",mode:"original"},"review.previousChange":{type:"navigateReviewChange",direction:"previous"},"review.nextChange":{type:"navigateReviewChange",direction:"next"},"review.acceptAllChanges":{type:"resolveAllReviewChanges",action:"accept"},"review.rejectAllChanges":{type:"resolveAllReviewChanges",action:"reject"},"history.undo":{type:"undo"},"history.redo":{type:"redo"},"text.bold":{type:"toggleMark",mark:"bold"},"text.italic":{type:"toggleMark",mark:"italic"},"text.underline":{type:"toggleMark",mark:"underline"},"text.strike":{type:"toggleMark",mark:"strike"},"script.super":{type:"toggleMark",mark:"superscript"},"script.sub":{type:"toggleMark",mark:"subscript"},"format.clear":{type:"clearFormatting"},"alignment.left":{type:"setAlignment",align:"left"},"alignment.center":{type:"setAlignment",align:"center"},"alignment.right":{type:"setAlignment",align:"right"},"alignment.justify":{type:"setAlignment",align:"justify"},"direction.ltr":{type:"setParagraphDirection",direction:"ltr"},"direction.rtl":{type:"setParagraphDirection",direction:"rtl"},"list.bullet":{type:"toggleList",kind:"bullet"},"list.numbered":{type:"toggleList",kind:"ordered"},"list.indent":{type:"adjustIndent",direction:"increase"},"list.outdent":{type:"adjustIndent",direction:"decrease"},"insert.textBox":{type:"insertTextBox"},"insert.footnote":{type:"insertNote",noteKind:"footnote"},"insert.endnote":{type:"insertNote",noteKind:"endnote"},"insert.pageNumber":{type:"insertPageField",field:"PAGE"},"insert.totalPages":{type:"insertPageField",field:"NUMPAGES"},"insert.sectionPages":{type:"insertPageField",field:"SECTIONPAGES"},"insert.pageXofY":{type:"insertPageField",field:"PAGE_X_OF_Y"},"insert.pageBreak":{type:"insertBreak",kind:"page"},"insert.sectionBreakNextPage":{type:"insertBreak",kind:"section"},"insert.sectionBreakContinuous":{type:"insertBreak",kind:"sectionContinuous"},"insert.toc":{type:"insertToc"},"contentControl.remove":{type:"removeContentControl"}};function yL(e){return US[e]??null}var zS=Uint8Array.from(atob("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),e=>e.charCodeAt(0)),US={"text.link":{type:"insertHyperlink",href:"https://example.com"},"image.insert":{type:"insertImage",data:zS,mime:"image/png",widthPoints:72,heightPoints:72},"image.properties":{type:"setImageProperties",description:"probe"},"table.insert":{type:"insertTable",rows:1,cols:1},"file.pageSetup":{type:"setPageSetup",orientation:"portrait"},"paragraph.dialog":{type:"setParagraphFormat",alignment:"left"}};function vd(e){return hL[e]??null}var bL={"font.family":{mark:"fontFamily",attr:"family"},"font.size":{mark:"fontSize",attr:"val"},"text.color":{mark:"color",attr:"val"},"text.highlight":{mark:"highlight",attr:"val"}},GS={"font.family":"Arial","font.size":22,"text.color":"000000","text.highlight":"yellow","styles.style":"Normal","list.lineSpacing":1,"image.wrap":"square","image.altText":"probe alt text"};function XS(e,t,n){return _o(n,e,t)?.command??null}function bd(e,t){if(e==="review.editingMode")return {type:"setEditingMode",mode:t};if(e==="styles.style")return {type:"setParagraphStyle",styleId:t};if(e==="list.lineSpacing")return {type:"setLineSpacing",rule:"multiple",value:t};if(cs(e))return XS(e,t,Ma);if(e==="image.wrap")return typeof t!="string"||!chunkFIJZIQXA_cjs.Ed.includes(t)?null:{type:"setImageWrapType",target:t};if(e==="image.altText")return typeof t!="string"?null:{type:"setImageProperties",description:t};let n=bL[e];return n?{type:"setMarkAttr",mark:n.mark,attr:n.attr,value:t}:null}function YS(e,t,n=Ma){if(!e)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};let r=$p(t,n);if(!r)return {id:t,enabled:false,disabledReason:"not wired to an editor command",active:false};let o=e.can(r);return o.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:o.reason,active:false}}var vL=["editing","suggesting","viewing"];function xL(e){let t="review.addComment",n=o=>({id:t,enabled:false,disabledReason:o,active:false}),r=e.can({type:"toggleReviewPane"});return r.ok?(e.getEditingMode?.()??"editing")==="viewing"?n("the document is open for viewing"):e.getSelectionPlacement()===null?n("a comment needs a selected range"):{id:t,enabled:true,disabledReason:null,active:false}:n(r.reason)}function QS(e,t){if(!e)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};if(cs(t))return YS(e,t);if(t==="review.editingMode"){let a=e.getEditingMode?.()??"editing",i=vL.filter(d=>d!==a).map(d=>e.can(bd(t,d))),s=i.some(d=>d.ok),l=i.find(d=>!d.ok);return {id:t,enabled:s,disabledReason:!s&&l&&!l.ok?l.reason:null,active:false,value:a}}if(t==="format.painter"){let a=Jr(e);if(!a)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};let i=a.formatPainter.state();if(i.mode!=="off")return {id:t,enabled:true,disabledReason:null,active:true,value:i.mode};let s=e.can({type:"clearFormatting"});return s.ok?{id:t,enabled:true,disabledReason:null,active:false,value:i.mode}:{id:t,enabled:false,disabledReason:s.reason,active:false,value:i.mode}}if(t==="contentControl.showAll"||t==="contentControl.formFill"){let a=Jr(e),i=a?.state().contentControls,s=t==="contentControl.showAll"?i?.showAll??false:i?.formFill??false;return {id:t,enabled:a!==null,disabledReason:a?null:"editor is not ready",active:s}}if(t==="contentControl.inspector"){let a=Jr(e);return a?a.state().contentControls.activeControlId?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:"no content control at the selection",active:false}:{id:t,enabled:false,disabledReason:"editor is not ready",active:false}}if(t==="review.addComment")return xL(e);if(t==="review.authors"){let a=e.can({type:"toggleReviewPane"});return a.ok?(e.getReviewAuthors?.().length??0)>0?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:"the document has no review authors",active:false}:{id:t,enabled:false,disabledReason:a.reason,active:false}}let n=vd(t);if(!n){let a=GS[t];if(a!==void 0){let s=bd(t,a);if(!s)return {id:t,enabled:false,disabledReason:"not wired to an editor command",active:false};let l=e.can(s),d=e.getSelectedImage?.()??null,c=t==="image.wrap"?d?.wrap:t==="image.altText"?d?.description:Lw(e,t);return l.ok?{id:t,enabled:true,disabledReason:null,active:false,...c!==void 0?{value:c}:{}}:{id:t,enabled:false,disabledReason:l.reason,active:false,...c!==void 0?{value:c}:{}}}let i=US[t];if(i){if(t==="image.insert"&&i.type==="insertImage"){let l=e.canExecuteImageCommand?.({type:"insertImage",data:zS,mime:"image/png",widthPoints:72,heightPoints:72})??e.can(i);return l.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:l.reason,active:false}}if(t==="image.properties"&&i.type==="setImageProperties"){let l=e.can(i);return l.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:l.reason,active:false}}if(t==="table.insert"&&i.type==="insertTable"){let l=e.can(i);return l.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:l.reason,active:false}}if(t==="paragraph.dialog"&&i.type==="setParagraphFormat"){let l=e.can(i);return l.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:l.reason,active:false}}let s=e.can(i);if(!s.ok)return {id:t,enabled:false,disabledReason:s.reason,active:false}}return t==="file.exportMarkdown"||t==="file.exportPdf"?{id:t,enabled:false,active:false,disabledReason:"export is not a command; run it with runChromeExport(editor, format, handlers)"}:t==="file.print"?{id:t,enabled:false,active:false,disabledReason:"print is not a command; run it with runChromePrint(editor, handlers)"}:t==="file.save"?{id:t,enabled:false,disabledReason:"save is not a command; run it with runSave(editor)",active:false}:t==="file.open"?{id:t,enabled:false,disabledReason:"open is not a command; run it with editor.load(bytes)",active:false}:{id:t,enabled:false,disabledReason:"not wired to an editor command",active:false}}let r=e.can(n),o=e.isActive?.(n)??false;return r.ok?{id:t,enabled:true,disabledReason:null,active:o}:{id:t,enabled:false,disabledReason:r.reason,active:o}}function wL(e){if(e==="format.painter")return true;let t=vd(e);return t?.type==="toggleMark"||t?.type==="toggleParagraphMarks"||t?.type==="toggleDocumentProtection"||t?.type==="setReviewDisplayMode"||t?.type==="setAlignment"||t?.type==="setParagraphDirection"}function SL(e,t){return t.map(n=>QS(e,n))}function IL(e,t,n,r){if(!e)return {result:{ok:false,code:"unsupported",reason:"editor is not ready"},nextDraft:null};let o=_o(r,t,n);if(!o)return {result:{ok:false,code:"unsupported",reason:"invalid table chrome value"},nextDraft:null};let a=e.can(o.command);if(!a.ok)return {result:{ok:false,code:a.code,reason:a.reason},nextDraft:null};let i=e.exec(o.command);return i.ok?{result:i,nextDraft:o.nextDraft}:{result:i,nextDraft:null}}var kL=new Set(["format.painter","contentControl.showAll","contentControl.formFill","contentControl.inspector","contentControl.remove"]);function RL(e,t,n,r){if(!e)return {ok:false,code:"unsupported",reason:"editor is not ready"};if(n&&typeof n=="object"&&("historyGroup"in n||"scope"in n||Object.keys(n).length===0)){if(r||GS[t]!==void 0||cs(t))return {ok:false,code:"invalidArgs",reason:"pass a toolbar value before command options"};r=n,n=void 0;}if(r?.historyGroup!==void 0&&kL.has(t))return {ok:false,code:"unsupported",reason:`${t} does not take a history group`};if(t==="format.painter"){let i=Jr(e);if(!i)return {ok:false,code:"unsupported",reason:"editor is not ready"};if(i.formatPainter.state().mode==="off"){let s=e.can({type:"clearFormatting"});if(!s.ok)return {ok:false,code:s.code,reason:s.reason}}return i.formatPainter.press()?{ok:true,changed:false}:{ok:false,code:"notFound",reason:ad}}if(t==="contentControl.showAll"){let i=Jr(e);return i?(i.contentControls.setShowAll(!i.contentControls.showAll()),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:"editor is not ready"}}if(t==="contentControl.formFill"){let i=Jr(e);return i?(i.contentControls.setFormFill(!i.contentControls.formFill()),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:"editor is not ready"}}if(t==="contentControl.inspector"){let i=Jr(e);return i?i.state().contentControls.activeControlId?{ok:true,changed:false}:{ok:false,code:"notFound",reason:"no content control at the selection"}:{ok:false,code:"unsupported",reason:"editor is not ready"}}if(t==="contentControl.remove"){let i=Jr(e);if(!i)return {ok:false,code:"unsupported",reason:"editor is not ready"};let s=i.state().contentControls.activeControlId;if(!s)return {ok:false,code:"notFound",reason:"no content control at the selection"};let l=i.contentControls.disabledReason(s,"remove");return l?{ok:false,code:l==="bound"?"bound":"locked",reason:l}:i.contentControls.remove(s)?{ok:true,changed:true}:{ok:false,code:i.state().lastRejection??"unsupported",reason:i.state().lastRejection??"removeContentControl was refused"}}let o=n===void 0?vd(t):bd(t,n);if(!o)return n!==void 0?{ok:false,code:"unsupported",reason:"invalid value for toolbar command"}:t==="file.exportMarkdown"||t==="file.exportPdf"?{ok:false,code:"unsupported",reason:"export is not a command; run it with runChromeExport(editor, format, handlers)"}:t==="file.print"?{ok:false,code:"unsupported",reason:"print is not a command; run it with runChromePrint(editor, handlers)"}:t==="file.save"?{ok:false,code:"unsupported",reason:"save is not a command; run it with runSave(editor)"}:t==="file.open"?{ok:false,code:"unsupported",reason:"open is not a command; run it with editor.load(bytes)"}:{ok:false,code:"unsupported",reason:"not wired to an editor command"};let a=e.can(o,r);return a.ok?e.exec(o,r):{ok:false,code:a.code,reason:a.reason}}function PL(e){return e?e.save():Promise.reject(new Error("editor is not ready"))}function TL(e,t){if(!e)return {enabled:false,disabledReason:"editor is not ready"};let n=hd(t,e);return n.can.ok?{enabled:true,disabledReason:null}:{enabled:false,disabledReason:n.can.reason}}function CL(e,t,n){if(!e)return {ok:false,code:"unsupported",reason:"editor is not ready"};let r=e.can(t,n);return r.ok?e.exec(t,n):{ok:false,code:r.code,reason:r.reason}}function qp(e){return e instanceof Uint8Array?Array.from(e):Array.isArray(e)?e.map(qp):e===null||typeof e!="object"?e:Object.fromEntries(Object.keys(e).sort().map(t=>[t,qp(e[t])]))}function EL(e){return JSON.stringify(qp(e))}var Vp=["zoom","script","format","list","alignment","styles","font","text","history"],OL=new Set(["review"]),eI=24,tI=new Set;function nI(e,t=Vp){let n=t.indexOf(e);return n===-1?void 0:(n+1)*10}function ML(e,t=Vp,n){let r=[],o=[];return e.forEach((a,i)=>{let s=n?.get(a)??nI(a,t);s===void 0||Number.isNaN(s)?o.push(a):r.push({id:a,priority:s,position:i});}),r.sort((a,i)=>a.priority-i.priority||i.position-a.position),[...o.reverse(),...r.map(a=>a.id)]}function AL(e,t){let n=[...e],r=new Map,o=t.filter(a=>!e.includes(a.id));for(;o.length>0;){let a=[];for(let i of o){let s=i.after;if(s===void 0||s===i.id){n.push(i.id);continue}if(!n.includes(s)){a.push(i);continue}let l=r.get(s)??s;n.splice(n.indexOf(l)+1,0,i.id),r.set(s,i.id);}if(a.length===o.length){n.push(...a.map(i=>i.id));break}o=a;}return n}var Kp=8;function FL(e){let t=e.margin??Kp,n=Math.max(0,e.viewportWidth-t*2),r=Math.min(e.panelWidth,n),o=t,a=e.viewportWidth-t-r,i=e.triggerRight-r;if(i>=o&&i<=a)return {left:i,maxWidth:n,anchor:"end"};let s=e.triggerLeft;return s>=o&&s<=a?{left:s,maxWidth:n,anchor:"start"}:{left:Math.max(o,Math.min(i,a)),maxWidth:n,anchor:"clamped"}}function JS(e,t){let{widths:n,groups:r,order:o,fixed:a,more:i}=e,s=a;for(let d of r)s+=n.get(d)??0;if(s<=t)return tI;s+=i;let l=new Set;for(let d of o){if(s<=t)break;let c=n.get(d);c===void 0||l.has(d)||(l.add(d),s-=c);}return l}function rI(e,t){if(e===t)return true;if(e.size!==t.size)return false;for(let n of e)if(!t.has(n))return false;return true}var LL=rI;function NL(e){if(!(e.available>0))return tI;let t=JS(e,e.available),n=e.previous;if(!n||n.size===0||t.size>=n.size)return t;let r=JS(e,e.available-(e.hysteresis??eI));return rI(r,n)?n:r}function DL(e){let t=e.margin??Kp,n=e.viewportWidth-t-e.popupWidth;return Math.max(t,Math.min(e.anchorLeft,n))}function HL(e,t,n,r){return e+t+n+r*2}function _L(e,t){return e+t}function BL(e,t){return e+t}function $L(e){let t=Number.parseFloat(e.marginInlineStart||e.marginLeft),n=Number.parseFloat(e.marginInlineEnd||e.marginRight);return {start:Number.isFinite(t)?t:0,end:Number.isFinite(n)?n:0}}function $n(e){let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function qL(e){return $n(e.columnGap)}function oI(e){if(!(e.parentContent>0))return e.own;let t=e.parentContent-e.siblings-e.margins;return e.maxWidth!==null&&(t=Math.min(t,e.maxWidth)),Math.max(e.own,t-e.chrome)}function aI(e){return e.position==="absolute"||e.position==="fixed"||e.display==="none"}function iI(e){let t=e.computedStyleMap;if(typeof t!="function")return null;try{return t.call(e)}catch{return null}}function Wp(e,t){let n=e?.get(t);return n&&typeof n.value=="string"?n.value:null}var VL=new Set(["auto","max-content","fit-content","min-content"]);function sI(e){return e.display.includes("flex")&&!e.flexDirection.startsWith("column")&&!e.flexWrap.startsWith("wrap")}function wd(e,t,n){return Wp(e,`margin-${n}`)==="auto"?0:$n(n==="left"?t.marginLeft:t.marginRight)}function KL(e){return /^(input|textarea|select|button|img|video|canvas|iframe|svg)$/i.test(e.tagName)?true:e.children.length>0||(e.textContent??"").trim().length>0}function WL(e,t,n){let r=t.flexBasis.trim(),o=r.endsWith("px")?$n(r):0,a=Wp(n,"min-width")??t.minWidth.trim();return a==="auto"||a===""?KL(e)?null:o:/^[\d.]+px$/.test(a)?Math.max(o,$n(a)):null}function lI(e,t,n){for(let r of e.childNodes){if(r.nodeType===3&&(r.textContent??"").trim().length>0)return false;if(!(r instanceof Element))continue;let o=getComputedStyle(r);if(o.display==="contents"){if(!lI(r,t,n))return false;continue}if(aI(o)||(n.items+=1,r===t))continue;let a=iI(r),s=Number.parseFloat(o.flexGrow)>0?WL(r,o,a):r.getBoundingClientRect().width;if(s===null)return false;n.width+=s+wd(a,o,"left")+wd(a,o,"right");}return true}function jL(e,t){if(!sI(t)||!e.parentElement)return 0;let n={width:0,items:0};return lI(e.parentElement,e,n)?n.width+Math.max(0,n.items-1)*$n(t.columnGap):null}function ZL(e,t,n){let r=e.maxWidth.trim();if(r==="none"||r==="")return null;let o;if(/^-?[\d.]+%$/.test(r))o=Number.parseFloat(r)/100*t;else if(/^-?[\d.]+px$/.test(r))o=Number.parseFloat(r);else return;if(Number.isFinite(o))return e.boxSizing==="border-box"?o:o+n}var zL="[data-toolbar-group], [data-toolbar-fixed], [data-toolbar-more]";function dI(e,t){let n=e.getBoundingClientRect();if(!(n.width>0))return null;let r=n.left+e.clientLeft+$n(t.paddingLeft),o=n.left+e.clientLeft+e.clientWidth-$n(t.paddingRight);for(let a of e.querySelectorAll(zL)){let i=a.getBoundingClientRect();if(i.width!==0&&(i.right>o+1||i.left<r-1))return true}return false}var us=new WeakMap,xd=new WeakMap;function UL(e,t,n,r){let o=e.parentElement;if(!o||aI(t)||(t.cssFloat||t.getPropertyValue("float")||"none")!=="none")return null;let a=iI(e),i=Wp(a,"width");if(i===null||!VL.has(i))return null;let s=getComputedStyle(o),l=sI(s),d=s.display.includes("flex")&&s.flexDirection.startsWith("column"),c=(s.display==="block"||s.display==="flow-root"||d)&&!t.display.startsWith("inline");if(!l&&!c||l&&Number.parseFloat(t.flexGrow)>0)return null;let u=o.clientWidth-$n(s.paddingLeft)-$n(s.paddingRight),p=Math.max(0,e.offsetWidth-e.clientWidth)+r,m=jL(e,s),h=ZL(t,u,p);return m===null||h===void 0?null:{room:oI({own:n,parentContent:u,siblings:m,margins:wd(a,t,"left")+wd(a,t,"right"),chrome:p,maxWidth:h}),parentContent:u}}function GL(e,t){let n=$n(t.paddingLeft)+$n(t.paddingRight),r=e.clientWidth-n,o=UL(e,t,r,n);if(!o)return us.delete(e),xd.delete(e),r;let a=us.get(e);if(a&&a.parentContent!==o.parentContent&&us.delete(e),dI(e,t)===true)return xd.get(e)&&us.set(e,{parentContent:o.parentContent,cap:r}),xd.set(e,false),r;let i=us.get(e)?.cap??Number.POSITIVE_INFINITY,s=Math.max(r,Math.min(o.room,i));return xd.set(e,s>r),s}var XL=/^[a-z]$/;function jp(e){let t=e.key.toLowerCase();if(XL.test(t))return t;let n=e.code??"";return n.length===4&&n.startsWith("Key")?n[3].toLowerCase():""}function cI(e){let t=[],n=r=>{for(let o of r)o.kind==="item"?t.push(o.slot):o.kind==="submenu"&&n(o.items);};for(let r of e)n(r.entries);return t}var uI={id:"file",labelKey:"toolbar.file",contextual:true,controls:[{id:"open",labelKey:"toolbar.open",paths:le.file_upload,state:{kind:"load"}},{id:"save",labelKey:"toolbar.saveShortcut",paths:le.file_download,state:{kind:"save"}},{id:"exportMarkdown",labelKey:"toolbar.exportMarkdown",paths:le.file_download,state:{kind:"export"}},{id:"exportPdf",labelKey:"toolbar.exportPdf",paths:le.file_download,state:{kind:"export"}},{id:"print",labelKey:"toolbar.print",paths:le.print,state:{kind:"export"}},{id:"pageSetup",labelKey:"toolbar.pageSetup",paths:le.settings,state:{kind:"command"}}]};var fI={id:"review",labelKey:"formattingBar.commentsAndChanges",controls:[{id:"revisionMarkup",shape:"icon",labelKey:"revisionMarkup.title",defaultToolbar:false,paths:le.edit_note,state:{kind:"command"}},{id:"simpleMarkup",shape:"icon",labelKey:"review.simpleMarkup",defaultToolbar:false,paths:le.visibility,state:{kind:"command"}},{id:"allMarkup",shape:"icon",labelKey:"review.allMarkup",defaultToolbar:false,paths:le.visibility,state:{kind:"command"}},{id:"noMarkup",shape:"icon",labelKey:"review.noMarkup",defaultToolbar:false,paths:le.visibility,state:{kind:"command"}},{id:"original",shape:"icon",labelKey:"review.original",defaultToolbar:false,paths:le.visibility,state:{kind:"command"}},{id:"previousChange",shape:"icon",labelKey:"review.previousChange",defaultToolbar:false,paths:le.keyboard_arrow_up,state:{kind:"command"}},{id:"nextChange",shape:"icon",labelKey:"review.nextChange",defaultToolbar:false,paths:le.keyboard_arrow_down,state:{kind:"command"}},{id:"acceptAllChanges",shape:"icon",labelKey:"review.acceptAllChanges",defaultToolbar:false,paths:le.check,state:{kind:"command"}},{id:"rejectAllChanges",shape:"icon",labelKey:"review.rejectAllChanges",defaultToolbar:false,paths:le.close,state:{kind:"command"}},{id:"paragraphMarks",shape:"icon",labelKey:"formattingBar.paragraphMarks",defaultToolbar:false,paths:le.format_paragraph,state:{kind:"command"}},{id:"protectDocument",shape:"icon",labelKey:"review.protectDocument",defaultToolbar:false,paths:le.lock,state:{kind:"command"}},{id:"comments",shape:"icon",labelKey:"formattingBar.commentsAndChanges",paths:le.comment,state:{kind:"command"}},{id:"addComment",shape:"icon",labelKey:"formattingBar.addComment",defaultToolbar:false,paths:le.add_comment,state:{kind:"command"}},{id:"authors",shape:"dropdown",labelKey:"reviewers.label",paths:le.visibility,defaultToolbar:false,state:{kind:"command"}},{id:"editingMode",shape:"dropdown",labelKey:"editingMode.label",valueKey:"editingMode.editing",paths:le.edit_note,state:{kind:"command"}}]};var Zp=[{id:"history",labelKey:"formattingBar.groups.history",controls:[{id:"undo",labelKey:"formattingBar.undoShortcut",paths:le.undo,state:{kind:"command"}},{id:"redo",labelKey:"formattingBar.redoShortcut",paths:le.redo,state:{kind:"command"}}]},{id:"zoom",labelKey:"formattingBar.groups.zoom",controls:[{id:"level",shape:"stepper",valueText:"100%",labelKey:"formattingBar.groups.zoom",paths:null,valueKey:"zoom.zoomLevel",state:{kind:"command"}}]},{id:"styles",labelKey:"formattingBar.groups.styles",controls:[{id:"style",shape:"dropdown",labelKey:"styles.selectAriaLabel",paths:null,valueKey:"styles.normalText",state:{kind:"value"}}]},{id:"font",labelKey:"formattingBar.groups.font",controls:[{id:"family",shape:"dropdown",labelKey:"font.selectAriaLabel",paths:null,valueKey:"font.sansSerif",state:{kind:"value"}},{id:"size",shape:"stepper",valueText:"11",labelKey:"fontSize.listLabel",paths:null,valueKey:"fontSize.label",state:{kind:"value"}}]},{id:"text",labelKey:"formattingBar.groups.textFormatting",controls:[{id:"bold",labelKey:"formattingBar.boldShortcut",paths:le.format_bold,state:{kind:"command"}},{id:"italic",labelKey:"formattingBar.italicShortcut",paths:le.format_italic,state:{kind:"command"}},{id:"underline",labelKey:"formattingBar.underlineShortcut",paths:le.format_underlined,state:{kind:"command"}},{id:"strike",labelKey:"formattingBar.strikethrough",paths:le.strikethrough_s,state:{kind:"command"}},{id:"color",shape:"colorSplit",swatch:"#ff0000",labelKey:"formattingBar.fontColor",paths:le.format_color_text,state:{kind:"value"}},{id:"highlight",shape:"colorSplit",swatch:"#ffff00",labelKey:"formattingBar.highlightColor",paths:le.ink_highlighter,state:{kind:"value"}},{id:"link",labelKey:"formattingBar.insertLinkShortcut",paths:le.link,state:{kind:"command"}}]},{id:"script",labelKey:"formattingBar.groups.script",controls:[{id:"super",labelKey:"formattingBar.superscript",paths:le.superscript,state:{kind:"command"}},{id:"sub",labelKey:"formattingBar.subscript",paths:le.subscript,state:{kind:"command"}}]},{id:"alignment",labelKey:"formattingBar.groups.alignment",controls:[{id:"left",labelKey:"alignment.alignLeft",paths:le.format_align_left,state:{kind:"command"}},{id:"center",labelKey:"alignment.center",paths:le.format_align_center,state:{kind:"command"}},{id:"right",labelKey:"alignment.alignRight",paths:le.format_align_right,state:{kind:"command"}},{id:"justify",labelKey:"alignment.justify",paths:le.format_align_justify,state:{kind:"command"}}]},{id:"direction",labelKey:"formattingBar.groups.direction",contextual:true,controls:[{id:"ltr",labelKey:"toolbar.leftToRight",paths:le.format_textdirection_l_to_r,state:{kind:"command"}},{id:"rtl",labelKey:"toolbar.rightToLeft",paths:le.format_textdirection_r_to_l,state:{kind:"command"}}]},{id:"list",labelKey:"formattingBar.groups.listFormatting",controls:[{id:"bullet",labelKey:"lists.bulletList",paths:le.format_list_bulleted,state:{kind:"command"}},{id:"numbered",labelKey:"lists.numberedList",paths:le.format_list_numbered,state:{kind:"command"}},{id:"outdent",labelKey:"lists.decreaseIndent",paths:le.format_indent_decrease,state:{kind:"command"}},{id:"indent",labelKey:"lists.increaseIndent",paths:le.format_indent_increase,state:{kind:"command"}},{id:"lineSpacing",shape:"dropdown",labelKey:"lineSpacing.label",paths:le.format_line_spacing,state:{kind:"command"}}]},{id:"format",labelKey:"formattingBar.groups.format",controls:[{id:"painter",labelKey:"formattingBar.formatPainterShortcut",paths:le.format_paint,state:{kind:"command"}},{id:"clear",labelKey:"formattingBar.clearFormatting",paths:le.format_clear,state:{kind:"command"}}]},fI,{id:"contentControl",labelKey:"contentControl.group",contextual:true,controls:[{id:"showAll",labelKey:"contentControl.showAll",paths:le.visibility,state:{kind:"command"}},{id:"formFill",labelKey:"contentControl.formFill",paths:le.edit_note,state:{kind:"command"}},{id:"inspector",labelKey:"contentControl.inspector",paths:le.tune,state:{kind:"command"}},{id:"remove",labelKey:"contentControl.remove",paths:le.delete,state:{kind:"command"}}]},{id:"image",labelKey:"formattingBar.groups.image",contextual:true,controls:[{id:"insert",labelKey:"toolbar.image",paths:le.image,state:{kind:"command"}},{id:"properties",labelKey:"formattingBar.imagePropertiesShortcut",paths:le.tune,state:{kind:"command"}},{id:"wrap",shape:"dropdown",labelKey:"formattingBar.imageWrap",paths:le.wrap_text,valueKey:"imageWrap.inline",state:{kind:"value"}},{id:"altText",shape:"dropdown",labelKey:"formattingBar.altText",paths:null,valueKey:"imageProperties.altText",state:{kind:"value"}}]},{id:"table",labelKey:"formattingBar.groups.table",contextual:true,controls:[{id:"insert",labelKey:"toolbar.table",paths:le.table,state:{kind:"command"}},{id:"borderTarget",shape:"dropdown",labelKey:"table.borders.tooltip",paths:le.border_all,state:{kind:"value"}},{id:"borderColor",shape:"colorSplit",swatch:"#000000",labelKey:"table.borderColor",paths:le.border_color,state:{kind:"value"}},{id:"borderStyle",shape:"dropdown",labelKey:"table.borders.styleAriaLabel",paths:le.border_horizontal,state:{kind:"value"}},{id:"borderWidth",shape:"dropdown",labelKey:"table.borderWidth",paths:le.line_weight,state:{kind:"value"}},{id:"cellFill",shape:"colorSplit",swatch:"#ffffff",labelKey:"table.cellFillColor",paths:le.format_color_fill,state:{kind:"value"}}]},{id:"paragraph",labelKey:"dialogs.paragraph.title",contextual:true,controls:[{id:"dialog",labelKey:"lineSpacing.options",paths:le.format_line_spacing,state:{kind:"command"}}]},uI,{id:"insert",labelKey:"toolbar.insert",contextual:true,controls:[{id:"textBox",labelKey:"toolbar.insertTextBox",paths:le.format_shapes,state:{kind:"command"}},{id:"footnote",labelKey:"toolbar.insertFootnote",paths:le.superscript,state:{kind:"command"}},{id:"endnote",labelKey:"toolbar.insertEndnote",paths:le.edit_note,state:{kind:"command"}},{id:"pageNumber",labelKey:"headerFooter.insertPageNumber",paths:le.format_list_numbered,state:{kind:"command"}},{id:"totalPages",labelKey:"headerFooter.insertTotalPages",paths:le.format_list_numbered,state:{kind:"command"}},{id:"sectionPages",labelKey:"headerFooter.insertSectionPages",paths:le.format_list_numbered,state:{kind:"command"}},{id:"pageXofY",labelKey:"headerFooter.insertPageXofY",paths:le.format_list_numbered,state:{kind:"command"}},{id:"pageBreak",labelKey:"toolbar.pageBreak",paths:le.page_break,state:{kind:"command"}},{id:"sectionBreakNextPage",labelKey:"toolbar.sectionBreakNextPage",paths:le.horizontal_rule,state:{kind:"command"}},{id:"sectionBreakContinuous",labelKey:"toolbar.sectionBreakContinuous",paths:le.border_horizontal,state:{kind:"command"}},{id:"toc",labelKey:"toolbar.tableOfContents",paths:le.toc,state:{kind:"command"}}]}],pI=Zp;function YL(e,t){return `${e.id}.${t.id}`}function mI(){return pI.filter(e=>!e.contextual).map(e=>({...e,controls:e.controls.filter(t=>t.defaultToolbar!==false)}))}function QL(e){let t=mI();if(!e)return t;let n=pI.find(r=>r.id==="image");return n?[...t,n]:t}var gI=[{id:"file",labelKey:"toolbar.file",entries:[{kind:"item",slot:"file.open",shortcutKey:"toolbar.openShortcut"},{kind:"item",slot:"file.save",labelKey:"toolbar.save",shortcutKey:"toolbar.saveShortcut"},{kind:"separator"},{kind:"submenu",labelKey:"toolbar.export",paths:le.file_download,items:[{kind:"item",slot:"file.exportMarkdown"},{kind:"item",slot:"file.exportPdf"}]},{kind:"item",slot:"file.print",shortcutKey:"toolbar.printShortcut"},{kind:"item",slot:"file.pageSetup"}]},{id:"format",labelKey:"toolbar.format",entries:[{kind:"item",slot:"text.bold",labelKey:"formattingBar.bold"},{kind:"item",slot:"text.italic",labelKey:"formattingBar.italic"},{kind:"item",slot:"text.underline",labelKey:"formattingBar.underline"},{kind:"item",slot:"text.strike"},{kind:"separator"},{kind:"item",slot:"alignment.left"},{kind:"item",slot:"alignment.center"},{kind:"item",slot:"alignment.right"},{kind:"item",slot:"alignment.justify"},{kind:"separator"},{kind:"item",slot:"direction.ltr"},{kind:"item",slot:"direction.rtl"},{kind:"separator"},{kind:"item",slot:"paragraph.dialog"},{kind:"separator"},{kind:"item",slot:"format.painter",labelKey:"formattingBar.formatPainter"},{kind:"item",slot:"format.clear"}]},{id:"insert",labelKey:"toolbar.insert",entries:[{kind:"item",slot:"image.insert"},{kind:"item",slot:"insert.textBox"},{kind:"item",slot:"table.insert",picker:"tableGrid"},{kind:"separator"},{kind:"item",slot:"insert.footnote"},{kind:"item",slot:"insert.endnote"},{kind:"separator"},{kind:"submenu",labelKey:"toolbar.break",paths:le.page_break,items:[{kind:"item",slot:"insert.pageBreak"},{kind:"item",slot:"insert.sectionBreakNextPage"},{kind:"item",slot:"insert.sectionBreakContinuous"}]},{kind:"item",slot:"insert.toc"}]},{id:"review",labelKey:"toolbar.review",entries:[{kind:"submenu",labelKey:"review.displayForReview",paths:le.visibility,items:[{kind:"item",slot:"review.simpleMarkup"},{kind:"item",slot:"review.allMarkup"},{kind:"item",slot:"review.noMarkup"},{kind:"item",slot:"review.original"}]},{kind:"separator"},{kind:"item",slot:"review.revisionMarkup"},{kind:"item",slot:"review.previousChange"},{kind:"item",slot:"review.nextChange"},{kind:"separator"},{kind:"item",slot:"review.acceptAllChanges"},{kind:"item",slot:"review.rejectAllChanges"},{kind:"separator"},{kind:"item",slot:"review.paragraphMarks"},{kind:"separator"},{kind:"item",slot:"review.protectDocument"}]},{id:"help",labelKey:"toolbar.help",entries:[]}];function JL(){return cI(gI)}function eN(){return Zp.reduce((e,t)=>e+t.controls.length,0)}var tN="formattingBar.unavailableInPreview";var Sd=class{constructor(t,n,r,o){this.selection=n;this.part=r;this.revision=o;this.position=t?chunkFIJZIQXA_cjs.jl(t):void 0;}selection;part;revision;entries=new WeakMap;position;save(){let t=this.part(),n=o=>{let a=chunkFIJZIQXA_cjs.Ta(t,o.paragraphId);return {nodeId:o.paragraphId,stableId:a&&a.kind!=="textValue"?chunkFIJZIQXA_cjs.wb(a):null,offset:o.offset}},r=this.selection();return {partName:t.name,anchor:n(r.anchor),head:n(r.head)}}begin(){if(!this.position)return ()=>{};let t=this.revision(),n=this.save();return ()=>{let r=this.position.current();!r||t===this.revision()||this.entries.set(r,{before:this.entries.get(r)?.before??n,after:this.save()});}}step(t,n){let r=this.position?.current(),o=n(),a=t==="undo"?r:this.position?.current(),i=a?this.entries.get(a):void 0,s=t==="undo"?i?.before:i?.after;return {changed:o,selection:s?this.resolve(s):null}}resolve(t){let n=this.part();if(n.name!==t.partName)return null;let r=new Map,o=[n.root];for(;o.length;){let l=o.pop();for(let c of l.children)c.kind!=="textValue"&&o.push(c);if(l.kind!=="paragraph")continue;let d=chunkFIJZIQXA_cjs.wb(l);d&&r.set(d,l.id);}let a=l=>{let d=l.stableId?r.get(l.stableId):l.nodeId;return d?{paragraphId:d,offset:l.offset}:null},i=a(t.anchor),s=a(t.head);return i&&s?{anchor:i,head:s}:null}};var nN=new Set;function fs(e,t){let n=chunk4GBTELJV_cjs.pd(e,t.displayMode,t.authorFilter),r=chunk4GBTELJV_cjs.sc(n);if(r===n)return nN;let o=new Set(n.map(a=>a.id));return new Set(r.flatMap(a=>o.has(a.id)?[]:[a.id]))}function rN(e,t,n){let r=chunk4GBTELJV_cjs.pd(e,n.displayMode,n.authorFilter),o=chunk4GBTELJV_cjs.sc(r);if(o===r)return null;let a=new Set(r.map(l=>l.id));if(a.has(t))return null;let i=o.findIndex(l=>l.id===t);if(i===-1)return null;let s=o.slice(i+1).find(l=>a.has(l.id));return s?.kind==="paragraph"?s.id:null}function oN(e,t,n,r){let o=d=>e.findIndex(c=>c.kind!=="textValue"&&c.id===d),a=o(t),i=o(n);if(a===-1||i<=a)return null;let s=[];for(let d=a+1;d<i;d+=1){let c=e[d];if(c.kind==="textValue")return null;s.push(c.id);}if(s.length===0)return s;let l=r();return s.every(d=>l.has(d))?s:null}function hI(e,t,n,r){let o=chunkFIJZIQXA_cjs.Ua(e,t);if(o===null||chunkFIJZIQXA_cjs.Ua(e,n)?.id!==o.id)return null;let a=oN(o.children,t,n,()=>fs(o.children,r));return a===null?null:[...a,n].map(i=>({op:"joinParagraphs",firstId:t,secondId:i}))}function yI(e,t,n,r){if(chunk4GBTELJV_cjs.ud(e,n.paragraphId).length>0)return n;let o=chunkFIJZIQXA_cjs.Ua(t,n.paragraphId);if(o===null)return n;let a=rN(o.children,n.paragraphId,r);return a===null?n:{paragraphId:a,offset:0}}function aN(e,t,n,r,o){if(chunk4GBTELJV_cjs.ud(e,n.paragraphId).length>0)return null;let a=chunkFIJZIQXA_cjs.Ua(t,n.paragraphId);if(a===null||!fs(a.children,r).has(n.paragraphId))return null;let i=a.children,s=i.findIndex(c=>c.kind!=="textValue"&&c.id===n.paragraphId),l;for(let c=s-1;c>=0&&l===void 0;c-=1)i[c].kind!=="textValue"&&(l=i[c]);if(l===void 0||l.kind!=="paragraph")return null;let d=o==="backward"?{paragraphId:l.id,offset:(chunkFIJZIQXA_cjs.Vi(t,l.id)??"").length}:yI(e,t,n,r);return {ops:[{op:"joinParagraphs",firstId:l.id,secondId:n.paragraphId}],caret:d}}function iN(e,t,n){let r=chunkFIJZIQXA_cjs.Ua(e,t);if(r===null)return null;let o=r.children,a=o.findIndex(l=>l.kind!=="textValue"&&l.id===t);if(a===-1)return null;let i=null,s=[];for(let l=a+1;l<o.length;l+=1){let d=o[l];if(d.kind!=="textValue"){if(i??=fs(o,n),!i.has(d.id))break;s.push({op:"joinParagraphs",firstId:t,secondId:d.id});}}return s.length>0?s:null}function bI(e){let t=n=>yI(e.layout(),e.part(),n,e.view());return {joinOps:(n,r)=>hI(e.part(),n,r,e.view()),forwardJoinOps:(n,r)=>hI(e.part(),n,r,e.view())??iN(e.part(),n,e.view()),shown:t,removedCaretEdit:(n,r)=>aN(e.layout(),e.part(),n,e.view(),r),shownRange:n=>{let{from:r,to:o}=n;if(r.paragraphId!==o.paragraphId||r.offset!==o.offset)return n;let a=t(r);return a===r?n:{from:a,to:a}},shownSelection:n=>{let{anchor:r,head:o}=n;if(r.paragraphId!==o.paragraphId||r.offset!==o.offset)return n;let a=t(o);return a===o?n:{...n,anchor:a,head:a}}}}var sN=/[\p{L}\p{N}_'’]/u,vI=e=>e!==void 0&&sN.test(e);function Id(e,t,n){let r=chunk4GBTELJV_cjs.pe(e,t.paragraphId),o=t.paragraphId,a=Math.max(0,Math.min(t.offset,r.length)),i=-1;if(vI(r[a])?i=a:a>0&&vI(r[a-1])&&(i=a-1),i===-1){let s=a,l=a;for(;s>0&&/\s/.test(r[s-1]??"");)s-=1;for(;l<r.length&&/\s/.test(r[l]??"");)l+=1;return s===l&&l<r.length&&(l+=1),{from:{paragraphId:o,offset:s},to:{paragraphId:o,offset:l}}}return {from:{paragraphId:o,offset:chunk4GBTELJV_cjs.he(r,i+1,-1,n)},to:{paragraphId:o,offset:chunk4GBTELJV_cjs.he(r,i,1,n)}}}function $e(e){return {anchor:e,head:e}}function Bo(e){if(e.anchor.paragraphId!==e.head.paragraphId)return null;let t=Math.min(e.anchor.offset,e.head.offset),n=Math.max(e.anchor.offset,e.head.offset);return {paragraphId:e.head.paragraphId,start:t,end:n}}function kd(e,t,n){let{anchor:r,head:o}=t;if(r.paragraphId===o.paragraphId)return r.offset<=o.offset?{from:r,to:o}:{from:o,to:r};let a=n??chunk4GBTELJV_cjs.Ra(e);return a.indexOf(r.paragraphId)<=a.indexOf(o.paragraphId)?{from:r,to:o}:{from:o,to:r}}function eo(e,t,n){let r=t[0],o=a=>{let i=t.includes(a.paragraphId),s=i?a.paragraphId:r??a.paragraphId,l=i?a.offset:0,d=chunk4GBTELJV_cjs.pe(e,s).length;return {paragraphId:s,offset:Math.max(0,Math.min(l,d))}};return {anchor:o(n.anchor),head:o(n.head)}}function Rd(e,t,n,r,o,a=chunk4GBTELJV_cjs.pe){let i=(p,m,h)=>o===void 0||!m.includes("\uFFFC")?m:m.replace(/\uFFFC/g,(y,g)=>o(p,h+g)??y);if(t.paragraphId===n.paragraphId)return i(t.paragraphId,a(e,t.paragraphId).slice(t.offset,n.offset),t.offset);let s=r??chunk4GBTELJV_cjs.Ra(e),l=s.indexOf(t.paragraphId),d=s.indexOf(n.paragraphId);if(l===-1||d===-1)return "";let c=s.slice(l,d+1),u=i(t.paragraphId,a(e,t.paragraphId).slice(t.offset),t.offset);for(let p=1;p<c.length;p+=1){let m=c[p],h=a(e,m),y=chunk4GBTELJV_cjs.Oa(e,m).includes(c[p-1])?"":`
|
|
22
|
-
`;u+=y+i(m,p===c.length-1?h.slice(0,n.offset):h,0);}return u}function zp(e){let t=[],n=r=>{if(r.kind!=="textValue"){r.kind==="paragraph"&&t.push(r.id);for(let o of r.children)n(o);}};return n(e),t}function wI(e){return e.kind}function SI(e){return e.kind!=="textValue"&&wI(e)==="contentControl"}function xI(e){return e.kind!=="textValue"&&wI(e)==="contentControlContent"}function lN(e,t){let n=new Map,r=o=>{if(o.kind!=="textValue"){if(o.kind==="table"){let a=zp(o);if(a.length>0&&a.every(i=>t.has(i))){n.set(o.id,a);return}}for(let a of o.children)r(a);}};return r(e.root),n}function dN(e,t,n){let r=new Set,o=(a,i)=>{if(a.kind!=="textValue"){if(a.kind==="table"&&n.has(a.id)){for(let s of a.children)o(s,true);return}if(SI(a)){let s=zp(a);!i&&s.length>0&&s.every(l=>t.has(l))&&r.add(a.id);for(let l of a.children)o(l,i);return}for(let s of a.children)o(s,i);}};return o(e.root,false),r}function II(e,t,n,r,o,a){let i=new Set;for(let s=n;s<=r;s+=1){let l=t[s];(s===n?o.offset===0&&(s!==r||a.offset===e(l).length):s!==r||a.offset===e(l).length)&&i.add(l);}return i}function cN(e,t,n){let r=[],o=a=>{if(a.kind!=="textValue"){if(a.kind==="table"||SI(a)){let s=zp(a).filter(l=>n.has(l));if(s.length>0&&s.every(l=>t.has(l))){r.push(a.id);return}}for(let i of a.children)o(i);}};return o(e.root),r}function kI(e,t,n,r,o){let a=p=>chunk4GBTELJV_cjs.pe(e,p);if(n.paragraphId===r.paragraphId&&n.offset===r.offset)return null;let i=o??chunk4GBTELJV_cjs.Ra(e),s=i.indexOf(n.paragraphId),l=i.indexOf(r.paragraphId);if(s===-1||l===-1||s>l)return null;let d=i.slice(s,l+1),c=II(a,i,s,l,n,r),u=i[l];return {partName:t.name,paragraphIds:d,startOffset:n.offset,endOffset:r.offset,coveredParagraphIds:[...c],fullyCoveredBlockIds:cN(t,c,new Set(i)),lastMarkCovered:r.offset===a(u).length}}function RI(e,t,n,r,o,a={displayMode:e.displayMode??"all-markup",authorFilter:void 0}){let i=w=>chunk4GBTELJV_cjs.pe(e,w);if(n.paragraphId===r.paragraphId)return n.offset===r.offset?{ops:[],collapseTo:n}:{ops:[{op:"deleteText",paragraphId:n.paragraphId,start:n.offset,end:r.offset}],collapseTo:n};let s=o??chunk4GBTELJV_cjs.Ra(e),l=s.indexOf(n.paragraphId),d=s.indexOf(r.paragraphId);if(l===-1||d===-1)return {ops:[],collapseTo:n};let c=II(i,s,l,d,n,r),u=lN(t,c),p=new Map;for(let[w,O]of u)for(let N of O)p.set(N,w);let m=dN(t,c,u),h=l;if(p.has(n.paragraphId)){h=-1;for(let w=l+1;w<=d;w+=1)if(!p.has(s[w])){h=w;break}if(h===-1){let w=p.get(n.paragraphId);for(let O of u.get(w)??[])p.delete(O);u.delete(w),h=l;}}let y=s[h],g=h===l?n:{paragraphId:y,offset:0},b=[];for(let w=l;w<=d;w+=1){let O=s[w];if(p.has(O))continue;let N=i(O).length,A=w===l?n.offset:0,V=w===d?r.offset:N;A<V&&b.push({op:"deleteText",paragraphId:O,start:A,end:V});}for(let w of u.keys())b.push({op:"deleteBlock",blockId:w});for(let w of m)b.push({op:"removeContentControl",controlId:w});let S=w=>{let O=chunkFIJZIQXA_cjs.Ua(t,w);for(;O&&xI(O);){let N=chunkFIJZIQXA_cjs.Ua(t,O.id);if(!N||!m.has(N.id))break;O=chunkFIJZIQXA_cjs.Ua(t,N.id);}return O},x=new Map,I=w=>{let O=x.get(w.id);return O||x.set(w.id,O=fs(w.children,a)),O},M=w=>{let O=[],N=A=>{for(let V of A)if(V.kind!=="textValue"&&!u.has(V.id)){if(m.has(V.id)){let W=V.children.find(xI);W&&W.kind!=="textValue"&&N(W.children);continue}if(V.kind==="paragraph"){O.push(V.id);continue}O.push(`\0barrier:${V.id}`);}};return N(w.children),O},k=(w,O)=>{let N=S(w);if(!N||S(O)!==N)return null;let A=M(N),V=A.indexOf(w),W=A.indexOf(O);if(V===-1||W<=V)return null;let E=A.slice(V+1,W);if(E.length===0)return E;let _=I(N);return E.every(G=>_.has(G))?E:null},P=y,R=y;for(let w=h+1;w<=d;w+=1){let O=s[w];if(p.has(O))continue;let N=k(R,O);if(N)for(let A of [...N,O])b.push({op:"joinParagraphs",firstId:P,secondId:A});else P=O;R=O;}return {ops:b,collapseTo:g}}function PI(e,t,n,r){return t.anchor.paragraphId===t.head.paragraphId&&t.anchor.offset===t.head.offset?[]:chunk4GBTELJV_cjs.ve(e,t,n(),r)}function Up(e,t){if(!e)return null;let n=e.position,r=o=>o.paragraphId===n.paragraphId&&o.offset===n.offset;return r(t.anchor)&&r(t.head)?e:null}function TI(e,t,n,r){if(n===null||n.length===0)return t?null:void 0;let{anchor:o,head:a}=e;if(!(o.paragraphId!==a.paragraphId||o.offset!==a.offset))return {position:a,properties:n,base:Up(t,e)?.base??r()}}function CI(e,t,n){let r=eo(t,n,e.selection),o=n.includes(e.selection.head.paragraphId);return {selection:r,format:o&&e.format?{...e.format,position:r.head}:null}}var Pd=class{undo=[];redo=[];moving=false;group;position;constructor(t){this.position=chunkFIJZIQXA_cjs.jl(t);}get canUndo(){return this.matches(this.undo.at(-1))}get canRedo(){return this.matches(this.redo.at(-1))}matches(t){return !!t&&!!this.position&&t.anchor===this.position.current()}record(t,n,r){if(!this.position)return;let o=this.undo.at(-1);if(r!==void 0&&r===this.group&&this.matches(o)){this.undo[this.undo.length-1]={...o,after:n},chunkFIJZIQXA_cjs.hl(r,"extended");return}this.group=r,this.position.split(),this.redo.length=0,this.undo.push({anchor:this.position.current(),before:t,after:n}),this.undo.length>200&&this.undo.shift(),chunkFIJZIQXA_cjs.hl(r,"started");}endGroup(){this.group=void 0;}noteEdit(){this.endGroup(),this.moving||(this.redo.length=0);}step(t,n,r){let o=t==="undo"?this.undo:this.redo,a=t==="undo"?this.redo:this.undo;this.endGroup(),this.moving=true;try{if(this.matches(o.at(-1))){let i=o.pop();a.push(i),n(t==="undo"?i.before:i.after);}else r();}finally{this.moving=false;}}};function EI(e,t,n,r){let o=e??chunk4GBTELJV_cjs.Ua,a,i,s;return {current:()=>o,filter(){let l=t();return (!s||l!==a||o!==i)&&(a=l,i=o,s={...l,hiddenAuthors:l?.hiddenAuthors??new Set,revisionMarkup:o,cacheKey:`${l?.cacheKey??""}|markup:${JSON.stringify(o)}`}),s},set(l){JSON.stringify(l)!==JSON.stringify(o)&&(n(),o=l,r());}}}function OI(e){return e?.root.children.some(t=>t.kind!=="textValue"&&(t.localName==="mirrorMargins"||t.localName==="evenAndOddHeaders")&&!t.attributes.some(n=>n.localName==="val"&&["0","false","off"].includes(n.value)))??false}function MI(e,t,n,r){let o=chunkFIJZIQXA_cjs.Ta(e,t);if(o?.kind!=="paragraph")return false;if(!chunk4GBTELJV_cjs.qc(o,n,r))return true;let a=chunkFIJZIQXA_cjs.Ua(e,t);return a?chunk4GBTELJV_cjs.pd(a.children,n,r).some(i=>i.kind==="paragraph"&&i.id===t):false}var uN=new Set(["Shift","Control","Alt","Meta","CapsLock","NumLock","ScrollLock","ContextMenu"]);function AI(e){return {onDrawingPointerGesture(t){if(t instanceof PointerEvent&&t.button!==0||e.surface.editingMode()==="view")return;let n=t.target instanceof Element?t.target:null,o=!e.textbox()?.preparePointer(n)&&n?.closest("[data-drawing-node-id]")?.getAttribute("data-drawing-node-id");if(o&&n?.closest(".docx-drawing-textbox")){let a;for(let i of e.surface.layout().pages)if(a=chunk4GBTELJV_cjs.yd(i,o),a)break;if(a&&e.surface.selectDrawing(o,a.paragraphId)){t.preventDefault(),t.stopImmediatePropagation();return}}e.setIntent(o?{kind:"pointer",drawingNodeId:o}:{kind:"none"});},onDrawingKeyGesture(t){if(t instanceof KeyboardEvent&&uN.has(t.key))return;if(t instanceof KeyboardEvent&&t.key==="Escape"&&e.textbox()?.active()){e.textbox().exit(),t.preventDefault(),t.stopImmediatePropagation();return}if((t instanceof KeyboardEvent&&(t.key==="Delete"||t.key==="Backspace")&&!t.altKey&&!t.ctrlKey&&!t.metaKey||t instanceof InputEvent&&(t.inputType==="deleteContentBackward"||t.inputType==="deleteContentForward"))&&e.intent().kind==="pointer"){let r=Bn(e.surface);if(r!==null){t.preventDefault(),t.stopImmediatePropagation(),e.setIntent({kind:"none"}),e.surface.deleteImage(r.drawingNodeId);return}}e.setIntent({kind:"none"});}}}var NI=32,FI=new WeakMap,LI=new WeakMap,fN=new WeakMap,pN=new WeakMap;function Td(e){let t=FI.get(e);if(t)return t;let n=[e.fragments];e.header&&n.push(e.header.fragments),e.footer&&n.push(e.footer.fragments);for(let o of [e.footnotes,e.endnotes])if(o)for(let a of o.notes)n.push(a.fragments);let r={stories:n,sparse:new Map,complete:null};return FI.set(e,r),r}function DI(e,t){let n=t?pN:fN,r=n.get(e);return r||(r={fragment:e,indent:{indent:e.indent,inTable:t},emptyStyle:e.emptyParagraphStyle},n.set(e,r)),r}function HI(e,t){return e?!e.emptyStyle&&t.emptyStyle?{...e,emptyStyle:t.emptyStyle}:e:t}function ps(e,t,n){let r=e.get(t),o=HI(r,n);o!==r&&e.set(t,o);}function mN(e,t){let n=(r,o)=>{for(let a of r){if(a.kind==="paragraph"){t(a,o);continue}for(let i of a.rows)if(!i.isHeaderRepeat)for(let s of i.cells)n(s.blocks,true);}};for(let r of e)n(r,false);}function Gp(e){if(e.complete)return e.complete;let t=new Map;mN(e.stories,(n,r)=>{let o=DI(n,r);for(let a of chunk4GBTELJV_cjs.Pa(n))ps(t,a,o);});for(let[n,r]of e.sparse)r&&t.set(n,r);return e.sparse.clear(),e.complete=t,t}function gN(e,t){if(e.paragraphId===t)return true;for(let n of e.lines??[])if(n.range.paragraphId===t||n.spans.some(r=>r.range.paragraphId===t)||(n.drawings??[]).some(r=>r.paragraphId===t))return chunk4GBTELJV_cjs.Pa(e).includes(t);return false}function _I(e,t){if(e.complete)return e.complete.get(t);let n=e.sparse.get(t);if(n!==void 0)return n??void 0;if(e.sparse.size>=NI)return Gp(e).get(t);let r,o=(a,i)=>{for(let s of a){if(s.kind==="paragraph"){if(!gN(s,t))continue;if(r=HI(r,DI(s,i)),r.emptyStyle)return true;continue}if(chunk4GBTELJV_cjs.bf(s).has(t)){for(let l of s.rows)if(!l.isHeaderRepeat){for(let d of l.cells)if(o(d.blocks,true))return true}}}return false};for(let a of e.stories)if(o(a,false))break;return e.sparse.set(t,r??null),r}function hN(e,t,n){for(let[r,o]of n)BI(e,t,r,o);for(let r=0;r<t.frontier;r+=1)for(let[o,a]of Gp(Td(e.pages[r])))n.has(o)||ps(t.entries,o,a);t.progress=null;}function BI(e,t,n,r){for(let o=r;o<t.frontier;o+=1){let a=_I(Td(e.pages[o]),n);a&&ps(t.entries,n,a);}}function ms(e,t,n=false){let r=LI.get(e);r||(r={frontier:0,entries:new Map,progress:new Map},LI.set(e,r));let o=()=>{let s=r.entries.get(t);return s&&(!n||s.emptyStyle)?s:void 0},a=r.progress;if(a&&!a.has(t)&&a.size>=NI&&hN(e,r,a),r.progress){BI(e,r,t,r.progress.get(t)??0);let s=o();for(;!s&&r.frontier<e.pages.length;){let l=_I(Td(e.pages[r.frontier++]),t);l&&ps(r.entries,t,l),s=o();}return r.progress.set(t,r.frontier),s??r.entries.get(t)}let i=o();for(;!i&&r.frontier<e.pages.length;){for(let[s,l]of Gp(Td(e.pages[r.frontier++])))ps(r.entries,s,l);i=o();}return i??r.entries.get(t)}var Xp=e=>chunk4GBTELJV_cjs.sd(e)?"rtl":"ltr";function yN(e,t){return ms(e,t,true)?.emptyStyle}function ar(e,t){return ms(e,t)?.fragment.props??[]}function gs(e,t){return ms(e,t)?.fragment.tabStops??null}function Cd(e){return Math.round((e.hanging>0?-e.hanging:e.firstLine)*20)}function Yp(e,t){return ms(e,t)?.indent??null}function qI(e,t,n,r,o=chunkFIJZIQXA_cjs.th,a){let i=chunkFIJZIQXA_cjs.Ta(e,t);if(!i||i.kind!=="paragraph")return false;for(let s of chunkFIJZIQXA_cjs.uh(i,chunkFIJZIQXA_cjs.Hh(i),n,r,o,a))if(chunkFIJZIQXA_cjs.Ch(chunkFIJZIQXA_cjs.Bh(s.run,"runProperties","rPr"),chunkFIJZIQXA_cjs.zh).length>0)return true;return false}function La(e,t,n,r=chunkFIJZIQXA_cjs.th,o){let a=chunkFIJZIQXA_cjs.Ta(e,t);if(!a||a.kind!=="paragraph")return [];let i=chunkFIJZIQXA_cjs.Oh(a,n,r,o);return i?chunkFIJZIQXA_cjs.Ch(chunkFIJZIQXA_cjs.Bh(i,"runProperties","rPr"),chunkFIJZIQXA_cjs.zh):chunkFIJZIQXA_cjs.Eh(e,t)}function Fa(e,t,n){let r=e?.find(a=>a.localName===t);if(!r)return null;let o=r.attributes?.val;return t==="vertAlign"?o===n:(t==="u"||o!=="0"&&o!=="false"&&o!=="off")&&o!=="none"}function VI(e,t){if(!t||t.length===0)return e;let n=e;for(let r of t){let o=r.attributes?.val;switch(r.localName){case "b":n={...n,bold:Fa(t,"b")===true};break;case "i":n={...n,italic:Fa(t,"i")===true};break;case "u":n={...n,underline:Fa(t,"u")===true};break;case "strike":n={...n,strikethrough:Fa(t,"strike")===true};break;case "vertAlign":n={...n,superscript:o==="superscript",subscript:o==="subscript"};break;case "rFonts":n={...n,fontFamily:r.attributes?.ascii??n.fontFamily};break;case "sz":{let a=Number(o);Number.isFinite(a)&&(n={...n,fontSizeHalfPoints:a});break}case "color":n={...n,color:o==="auto"?null:o??n.color};break;case "highlight":n={...n,highlight:o==="none"?null:o??n.highlight};break;}}return n}function Qp(e,t,n,r){return (n&&n.length>0?chunk6APGXLBB_cjs.ha(e,n):chunk4GBTELJV_cjs.te(e,t,r??(t.anchor.paragraphId===t.head.paragraphId?[]:chunk4GBTELJV_cjs.Sa(e)))).map(a=>{let i=chunk4GBTELJV_cjs.v(chunk4GBTELJV_cjs.u(a.style));return i===a.style?a:{...a,style:i}})}function Ed(e,t){let n=e.indexOf(t.from.paragraphId),r=e.indexOf(t.to.paragraphId);if(n===-1||r===-1)return [];let o=r>n&&t.to.offset===0?r-1:r;return e.slice(n,o+1)}function Od(e,t,n,r){return Qp(e,t,n,r)[0]?.style??null}function Jp(e,t,n,r,o,a){let i=Qp(e,t,r,a);if(i.length===0)return false;let s=l=>{switch(n){case "b":return l.style.bold;case "i":return l.style.italic;case "u":return l.style.underline!==null;case "strike":return l.style.strike;case "vertAlign":return l.style.verticalAlign===o;default:return false}};return i.every(s)}function KI(e,t,n,r,o,a,i){let s=Qp(e,t,r,a),l=s.length===0?$I(e,t,r,a).map(_=>yN(e,_)).filter(_=>_!==void 0):[],d=l.length>0?l:s.map(_=>_.style),c=_=>{if(d.length===0)return null;let G=_(d[0]);return d.every(U=>_(U)===G)?G:null},u=(_,G=(U,$)=>U===$)=>_.length>0&&_.every(U=>G(U,_[0]))?_[0]:null,p=(_,G)=>_.props.some(U=>U.localName===G),m=_=>_.style.fontFamily??n?.(_.range.paragraphId,_.props).fontFamily??null,h=_=>p(_,"sz")?Math.round(_.style.fontSizePt*2):n?.(_.range.paragraphId,_.props).fontSizeHalfPoints??Math.round(_.style.fontSizePt*2),y=l.length>0?{fontFamily:c(_=>_.fontFamily??i??null),fontSizeHalfPoints:c(_=>Math.round(_.fontSizePt*2))}:s.length===0?n?.(t.head.paragraphId,[]):void 0,g=$I(e,t,r,a),b=_=>u(g.map(G=>_(ar(e,G)))),S=(_,G=(U,$)=>U===$)=>{if(g.length<2)return false;let U=_(ar(e,g[0]));return g.some(($,pe)=>pe>0&&!G(_(ar(e,$)),U))},x=b(_=>chunk4GBTELJV_cjs.bd(_)),I=b(Xp),M=b(_=>chunk4GBTELJV_cjs.O(_,"pStyle")?.val??o??void 0)??null,k=_=>chunk4GBTELJV_cjs.O(_,"spacing")??void 0,P=_=>{let G=k(_),U=chunkFIJZIQXA_cjs.nd(G?.line);if(U===null)return "";let $=G?.lineRule??"auto";return $==="auto"?`multiple:${Math.round(U/240*100)/100}`:`${$==="exact"?"exact":"atLeast"}:${Math.round(U/20*100)/100}`},R=b(P),w=(()=>{if(!R)return null;let[_,G]=R.split(":");return {rule:_,value:Number(G)}})(),O=(_,G)=>{let U=chunkFIJZIQXA_cjs.nd(k(_)?.[G]);return U===null?null:Math.round(U/20*100)/100},N=_=>b(G=>O(G,_)),A=(()=>{let _=B=>Xp(ar(e,B))==="rtl",G=g.map(B=>{let q=Yp(e,B);return !q||!_(B)?q:{...q,indent:{...q.indent,left:q.indent.right,right:q.indent.left}}}),U=G[0];if(!U||G.some(B=>B===null||B.inTable))return null;let $=_(g[0]),pe=B=>Math.round(B*20),he=G,Z=pe(U.indent.left),F=pe(U.indent.right),L=Cd(U.indent);return {left:Z,right:F,firstLine:L,mixed:{left:he.some(B=>pe(B.indent.left)!==Z),right:he.some(B=>pe(B.indent.right)!==F),firstLine:he.some(B=>Cd(B.indent)!==L)},...$?{rtl:$}:{}}})(),V=_=>b(G=>_(chunk4GBTELJV_cjs.nd(G))),W=b(chunk4GBTELJV_cjs.H),E=b(chunk4GBTELJV_cjs.S);return {bold:d.length>0&&d.every(_=>_.bold),italic:d.length>0&&d.every(_=>_.italic),underline:d.length>0&&d.every(_=>_.underline!==null),strikethrough:d.length>0&&d.every(_=>_.strike),superscript:d.length>0&&d.every(_=>_.verticalAlign==="superscript"),subscript:d.length>0&&d.every(_=>_.verticalAlign==="subscript"),fontFamily:s.length>0?u(s.map(m)):y?.fontFamily??null,fontSizeHalfPoints:s.length>0?u(s.map(h)):y?.fontSizeHalfPoints??null,color:c(_=>_.color),highlight:c(_=>_.highlight),alignment:x,direction:I,styleId:M,lineSpacing:w,spaceBeforePt:N("before"),spaceAfterPt:N("after"),disagrees:{alignment:S(_=>chunk4GBTELJV_cjs.bd(_)),direction:S(Xp),spaceBeforePt:S(_=>O(_,"before")),spaceAfterPt:S(_=>O(_,"after")),lineSpacing:S(P),tabStops:(()=>{if(g.length<2)return false;let _=JSON.stringify(gs(e,g[0])?.stops??null);return g.some((G,U)=>U>0&&JSON.stringify(gs(e,G)?.stops??null)!==_)})()},indent:A,tabStops:u(g.map(_=>gs(e,_)?.stops??null),(_,G)=>_===null||G===null?_===G:_.length===G.length&&_.every((U,$)=>Math.round(U.positionPt*20)===Math.round(G[$].positionPt*20)&&U.alignment===G[$].alignment&&(U.leader??"none")===(G[$].leader??"none")))?.map(_=>({positionTwips:Math.round(_.positionPt*20),alignment:_.alignment,..._.leader?{leader:_.leader}:{}}))??null,paragraphFlags:{contextualSpacing:E,keepNext:V(_=>_.keepNext),keepLines:V(_=>_.keepLines),widowControl:V(_=>_.widowControl),pageBreakBefore:W}}}function $I(e,t,n,r){if(n&&n.length>0)return [...chunk6APGXLBB_cjs.ga(e,n)];if(t.anchor.paragraphId===t.head.paragraphId)return [t.head.paragraphId];let o=r??chunk4GBTELJV_cjs.Sa(e),a=o.indexOf(t.anchor.paragraphId),i=o.indexOf(t.head.paragraphId);return a===-1||i===-1?[t.head.paragraphId]:o.slice(Math.min(a,i),Math.max(a,i)+1)}function WI(e,t,n,r){return t.paragraphId!==n.paragraphId?[]:t.offset!==0||n.offset!==e.length?[]:e.length===0?[]:[{op:"setParagraphMarkProperties",paragraphId:t.paragraphId,properties:r}]}function jI(e){let t=null,n=null,r=null,o=()=>t&&chunkFIJZIQXA_cjs.mi(e.session.part()).find(l=>l.root.id===t.id&&l.drawingNodeId===t.drawingNodeId),a=()=>{if(t&&!o()){i();return}for(let l of e.pagesLayer.querySelectorAll(".docx-drawing-textbox")){let d=l.dataset.drawingNodeId===t?.drawingNodeId;l.dataset.docxTextboxActive=String(d),l.contentEditable=d?"true":"false",l.setAttribute("role",d?"textbox":"img"),d?(l.removeAttribute("aria-hidden"),l.setAttribute("aria-multiline","true")):(l.removeAttribute("aria-multiline"),l.hasAttribute("aria-label")||l.setAttribute("aria-hidden","true"));for(let c of l.querySelectorAll("[data-textbox-paragraph-id]"))d?c.dataset.paragraphId=c.dataset.textboxParagraphId:delete c.dataset.paragraphId;}},i=(l=true)=>{t&&(e.flush(),t=null,r=null,a(),l&&n&&e.setSelection(n),n=null);},s=l=>{if(l.owner||!e.writable())return false;e.flush();let d=chunkFIJZIQXA_cjs.mi(e.session.part()).find(M=>M.root.id===l.id&&M.drawingNodeId===l.drawingNodeId&&M.hostParagraphId===l.hostParagraphId),c=d&&chunkFIJZIQXA_cjs.Ua(e.session.part(),d.root.id),u=c&&chunkFIJZIQXA_cjs.Ua(e.session.part(),c.id),p=u&&chunkFIJZIQXA_cjs.ud(u.children,{namespaceUri:chunkFIJZIQXA_cjs.ia,localName:"spPr"}),m=p&&chunkFIJZIQXA_cjs.ud(p.children,{namespaceUri:chunkFIJZIQXA_cjs.ra,localName:"xfrm"}),h=u&&chunkFIJZIQXA_cjs.ud(u.children,{namespaceUri:chunkFIJZIQXA_cjs.ia,localName:"bodyPr"}),y=m&&chunkFIJZIQXA_cjs.ka(m.attributes,"rot"),g=h&&chunkFIJZIQXA_cjs.ka(h.attributes,"rot"),b=h&&chunkFIJZIQXA_cjs.ka(h.attributes,"vert");if(y&&Number(y)!==0||g&&Number(g)!==0||b&&b!=="horz")return false;let S;for(let M of e.layout().pages)if(S=chunk4GBTELJV_cjs.yd(M,l.drawingNodeId),S)break;if(!d||!S?.textboxStory||S.transform.rotationDegrees!==0||S.textboxStory.fragments.some(M=>M.kind!=="paragraph"))return false;let x=S.textboxStory.fragments[0];if(!x||x.kind!=="paragraph")return false;if(t?.id===l.id)return true;i(),e.leaveOtherStories(),n=e.selection(),t=l,r=null,a();let I={paragraphId:x.paragraphId,offset:x.range.start};return e.setSelection({anchor:I,head:I}),true};return {active:()=>t,replacementFormatOps(l,d,c){let{anchor:u,head:p}=e.selection();if(!t||c===0||u.paragraphId===p.paragraphId&&u.offset===p.offset)return [];let m=La(e.session.part(),l,d);return m.length?[{op:"setRunProperties",paragraphId:l,start:d,end:d+c,properties:m}]:[]},enter:s,exit:i,syncDom:a,contains:l=>{let d=o();return !!d&&chunkFIJZIQXA_cjs.Rc(d.root).some(c=>c.id===l)},paragraphIds:()=>{let l=o();return l?chunkFIJZIQXA_cjs.Rc(l.root).map(d=>d.id):[]},caretInput(l){if(!t)return {};let d=t.drawingNodeId,c;for(let h of l.pages)if(c=chunk4GBTELJV_cjs.yd(h,d),c)break;let u=c?.textboxStory,m=[...e.pagesLayer.querySelectorAll(".docx-drawing-textbox")].find(h=>h.dataset.drawingNodeId===d)?.querySelector(".docx-drawing-textbox-content");return !c||!u||!m?{}:{scopedHost:m,scopedHostKind:"textbox",scopedOrigin:{x:c.x+u.contentOffset.x,y:c.y+u.contentOffset.y}}},layout(l){if(!t)return l;if(r?.base===l&&r.id===t.id)return r.layout;let d=t.drawingNodeId,c={...l,pages:l.pages.map(u=>{let p=chunk4GBTELJV_cjs.yd(u,d),m=p?.textboxStory;return {...u,header:void 0,footer:void 0,footnotes:void 0,endnotes:void 0,anchoredDrawings:[],fragments:p&&m?m.fragments.flatMap(h=>h.kind==="paragraph"?[chunk4GBTELJV_cjs.Le(h,p.x+m.contentOffset.x,p.y+m.contentOffset.y)]:[]):[]}})};return r={base:l,id:t.id,layout:c},c},preparePointer(l){let c=l?.closest(".docx-drawing-textbox-content")?.closest("[data-drawing-node-id]")?.dataset.drawingNodeId,u=c&&chunkFIJZIQXA_cjs.mi(e.session.part()).find(p=>p.drawingNodeId===c);return u&&s({kind:"frame",id:u.root.id,drawingNodeId:u.drawingNodeId,hostParagraphId:u.hostParagraphId})?true:(i(false),false)}}}function ZI(e,t,n){return (r,o)=>{let a=t(),i=n();return chunkFIJZIQXA_cjs.Nh(Ae(e,r)??e.part(),r,o,chunkVX43VBAX_cjs.a(e.stylesRoot(),e.settingsRoot(),a,i),a,i)}}function em(e,t){e.setAttribute("aria-label",t?.("editor.documentContent")??i18n.en.editor.documentContent);}var tm=new WeakSet,zI=new WeakMap,qn=e=>tm.has(e);function to(e,t){t?tm.add(e):tm.delete(e);}function UI(e,t){zI.set(e,t);}var GI=e=>zI.get(e)?.()??false;function XI(e){let t="select[data-docx-form-dropdown]",n=d=>d instanceof Element?d.closest(t):null,r=d=>{let c=d.closest("[data-start][data-paragraph-id]"),u=c?.dataset.paragraphId;if(!c||!u)return null;let p=e.part(u),m=chunkFIJZIQXA_cjs.Ta(p,u);if(m?.kind!=="paragraph")return null;let h=Number(c.dataset.start),y=chunkFIJZIQXA_cjs.Mi(m).find(b=>b.start<=h&&h<b.end);if(!y)return null;let g={op:"setLegacyDropdown",paragraphId:u,fieldNodeId:y.fieldNodeId,selectedIndex:d.selectedIndex};return {field:y,paragraphId:u,op:g,enabled:e.editable()&&e.canApply(g)&&chunkFIJZIQXA_cjs.nj(e.settings(),g)===null&&chunkFIJZIQXA_cjs.Wk(p,g)===null}},o=()=>{for(let d of e.pagesLayer.querySelectorAll(t))d.disabled=!r(d)?.enabled;},a=d=>{let c=n(d.target);c&&(d.stopPropagation(),r(c)?.enabled||d.preventDefault());},i=d=>{let c=n(d.target);c&&(c.disabled=!r(c)?.enabled);},s=d=>{let c=n(d.target);if(!c)return;d.stopPropagation();let u=r(c);if(!u)return;if(!u.enabled||!e.apply(u.op)){c.selectedIndex=u.field.selectedIndex;return}e.select({anchor:{paragraphId:u.paragraphId,offset:u.field.start},head:{paragraphId:u.paragraphId,offset:u.field.end}}),[...e.pagesLayer.querySelectorAll(t)].find(m=>{let h=m.closest("[data-start][data-paragraph-id]");return h?.dataset.paragraphId===u.paragraphId&&Number(h.dataset.start)===u.field.start})?.focus({preventScroll:true});},l=new MutationObserver(d=>{for(let c of d)for(let u of c.addedNodes){if(!(u instanceof Element))continue;let p=u.matches(t)?[u]:u.querySelectorAll(t);for(let m of p)m.disabled=!r(m)?.enabled;}});return l.observe(e.pagesLayer,{childList:true,subtree:true}),e.pagesLayer.addEventListener("pointerdown",a,true),e.pagesLayer.addEventListener("focusin",i),e.pagesLayer.addEventListener("change",s),o(),{sync:o,keydown(d){let c=n(d.target);if(!c)return false;d.stopPropagation();let u=d.key.toLowerCase();return (d.ctrlKey||d.metaKey)&&!d.altKey&&(u==="z"||u==="y")?(d.preventDefault(),e.pagesLayer.focus({preventScroll:true}),e.history(u==="y"||d.shiftKey?"redo":"undo"),true):(!r(c)?.enabled&&d.key!=="Tab"&&d.preventDefault(),true)},destroy(){l.disconnect(),e.pagesLayer.removeEventListener("pointerdown",a,true),e.pagesLayer.removeEventListener("focusin",i),e.pagesLayer.removeEventListener("change",s);}}}function YI(e,t){let n=chunkFIJZIQXA_cjs.Ua(e,t.id);for(let a=0;n&&a<64&&(n.namespaceUri===chunkFIJZIQXA_cjs.la&&n.localName==="customXml"||chunkFIJZIQXA_cjs.Uc(n)||chunkFIJZIQXA_cjs.Vc(n));a+=1)n=chunkFIJZIQXA_cjs.Ua(e,n.id);if(!n)return [];let r=chunkFIJZIQXA_cjs.Yc(n.children),o=r.findIndex(a=>a.id===t.id);return o>=2?r.slice(o-2,o):[]}function QI(e){let t=n=>n.kind==="textValue"?/^[ \t\u00a0]*$/.test(n.value):n.namespaceUri!==chunkFIJZIQXA_cjs.la?false:n.localName==="pPr"?!n.children.some(r=>r.kind!=="textValue"&&r.localName==="sectPr"):n.localName==="rPr"||n.localName==="tab"||["bookmarkStart","bookmarkEnd","commentRangeStart","commentRangeEnd","proofErr"].includes(n.localName)?true:["p","r","t","hyperlink"].includes(n.localName)?n.children.every(t):false;return t(e)}function JI(e,t,n,r,o,a,i,s){let l=chunkFIJZIQXA_cjs.Ta(e,n.paragraphId);if(l?.kind!=="paragraph")return null;let[d,c]=YI(e,l);if(c?.kind!=="paragraph"||d?.kind!=="paragraph"||!QI(c))return null;let u=chunk4GBTELJV_cjs.Qa(t,l.id),p=chunk4GBTELJV_cjs.Qa(t,d.id);if(!u||u.numId!==p?.numId||u.level!==p.level||chunk4GBTELJV_cjs.Qa(t,c.id))return null;let m=(k,P,R,w)=>({id:k,kind:P,localName:R,namespaceUri:chunkFIJZIQXA_cjs.la,prefix:"w",namespaceBindings:[],attributes:[],children:w}),h=l.children.find(k=>k.kind==="paragraphProperties"),y=h&&{...h,children:h.children.filter(k=>k.localName!=="sectPr")},g=chunkFIJZIQXA_cjs.Li({localName:"pStyle",attributes:{val:o}},"separator-style"),b=r.map((k,P)=>chunkFIJZIQXA_cjs.Li(k,`separator-format-${P}`));i&&b.push(chunkFIJZIQXA_cjs.Li({localName:"ins",attributes:{id:chunkFIJZIQXA_cjs.oh(e,s)(),author:i.author,...i.date?{date:i.date}:{}}},"separator-insertion"));let S=m("separator-mark","runProperties","rPr",b),x=m("separator-properties","paragraphProperties","pPr",[...g?[g]:[],...b.length?[S]:[]]),I=[...x.children],M=a?.styles.has(o)?x:m("separator-defaults","paragraphProperties","pPr",[]);return a&&chunk4GBTELJV_cjs.vc(chunk4GBTELJV_cjs.id(a,M).paragraphPropertyNodes)&&I.splice(g?1:0,0,m("separator-numbering","generic","numPr",[chunkFIJZIQXA_cjs.Li({localName:"numId",attributes:{val:"0"}},"separator-number-id")])),{op:"insertFragment",paragraphId:l.id,offset:n.offset,blocks:[m("separator-head","paragraph","p",y?[y]:[]),m("separator-blank","paragraph","p",[m("separator-properties-final","paragraphProperties","pPr",I)])],lastMarkCovered:true}}function ek(e,t=true){return e.ownerDocument.defaultView?.navigator?.scheduling?.isInputPending?.({includeContinuous:t})??false}function nm(e,t){let n=e.setScale;return typeof n!="function"?false:n.call(e,t)}var tk=new Set(["comment-add","comment-delete","comment-reply","comment-resolve","package-scoped","revision-resolve","revision-attribution"]);var vN="list paragraph",xN="ListParagraph";function nk(e){return e.find(t=>t.localName==="pStyle")?.attributes?.val}function Md(e){let t=null;for(let n of e)if(n.type==="paragraph"){if(n.name.trim().toLowerCase()===vN)return n.styleId;t===null&&n.styleId===xN&&(t=n.styleId);}return t}function rk(e){let{session:t}=e,n;function r(){let o=t.stylesRoot();return (n===void 0||n.root!==o)&&(n={root:o,styleId:chunk4GBTELJV_cjs.hd(o,t.documentThemeFonts()).defaultParagraphStyleId}),n.styleId}return {applyOps(o){let a=Md(t.documentStyles());if(a===null)return [];let i=r(),s=e.storyPart(),l=[];for(let d of o){let c=chunkFIJZIQXA_cjs.Dh(s,d),u=nk(c);u!==void 0&&u!==i||l.push({op:"setParagraphProperties",paragraphId:d,properties:chunkFIJZIQXA_cjs.Fh(c,{localName:"pStyle",attributes:{val:a}})});}return l},clearOp(o){let a=Md(t.documentStyles());if(a===null)return null;let i=chunkFIJZIQXA_cjs.Dh(e.storyPart(),o);return nk(i)!==a?null:{op:"setParagraphProperties",paragraphId:o,properties:i.filter(s=>s.localName!=="pStyle")}}}}function ok(e,t){return n=>{let r=chunkFIJZIQXA_cjs.bd(n),o=r?.name??"/word/styles.xml",a="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml",i=r?null:chunkFIJZIQXA_cjs.Ia('<w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"/>',{name:o,contentType:a}),s=r??(i?.ok?i.part:null);if(!s)throw new Error("Cannot create list paragraph style");if(s.root.children.some(h=>h.kind!=="textValue"&&h.attributes.some(y=>y.localName==="styleId"&&y.value===t)))return n;let l=chunkFIJZIQXA_cjs.Ra(s),d=(h,y={},g=[])=>({...chunkFIJZIQXA_cjs.Li({localName:h,attributes:y},l()),children:g,...h==="pPr"?{kind:"paragraphProperties"}:{}}),u={...d("style",{type:"paragraph",styleId:t},[d("name",{val:"List Paragraph"}),...e?[d("basedOn",{val:e})]:[],d("uiPriority",{val:"34"}),d("qFormat"),d("pPr",{},[d("ind",{left:"720"}),d("contextualSpacing")])]),namespaceBindings:[{prefix:"w",namespaceUri:chunkFIJZIQXA_cjs.la}]};if(r){let h=chunkFIJZIQXA_cjs.Ya(s,s.root.id,s.root.children.length,[u]);if(!h.ok)throw new Error("Cannot insert list paragraph style");return chunkFIJZIQXA_cjs.Fe(n,h.part)}let p=chunkFIJZIQXA_cjs.Pe(n,o,{...s.root,children:[u]},a);p=chunkFIJZIQXA_cjs.Ne(p,n.mainDocumentPart);let m=chunkFIJZIQXA_cjs.Oe(p,n.mainDocumentPart,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",o);if(!m.ok)throw new Error("Cannot link list paragraph style");return m.pkg}}function Ad(e,t){let n=e.ownerDocument,r=e.dataset.docxCcId,o=()=>{n.removeEventListener("pointerdown",a,true),n.removeEventListener("keydown",i,true);},a=s=>{if(e.parentNode===null){o();return}let l=s.target,d=l instanceof Element?l.closest("[data-docx-cc-widget]"):null;l&&(e.contains(l)||d?.getAttribute("data-docx-cc-id")===r)||(o(),t());},i=s=>{s.key!=="Escape"||s.isComposing||(s.preventDefault(),o(),e.parentNode!==null&&(s.stopPropagation(),t()));};return n.addEventListener("pointerdown",a,true),n.addEventListener("keydown",i,true),o}function ak(e,t,n,r,o){let i=chunk4GBTELJV_cjs.oe(e).find(u=>u.id===n)?.fragments[0],s=i?e.pages[i.pageIndex]:void 0;if(!i||!s)return null;let l=o?.get(i.pageIndex)??0,d=s.contentBox.x-s.box.x,c=s.contentBox.y-s.box.y;return {left:(s.box.x+l+d+i.box.x)*t,top:(s.box.y+c+i.box.y+i.box.height)*t,element:[...r.querySelectorAll("[data-docx-content-control]")].find(u=>u.dataset.docxContentControl===n)?.querySelector(".docx-content-control-boundary")??void 0,sheetLeft:(s.box.x+l)*t,sheetRight:(s.box.x+l+s.box.width)*t}}function ik(e){return e.kind==="textValue"?e.value:e.localName==="sdtPr"?"":e.children.map(ik).join("")}function rm(e,t){let n=e?ik(e):"";return t.find(r=>r.displayText===n)?.value??n}function sk(e){let t=e?.children.find(n=>n.kind!=="textValue"&&n.localName==="sdtPr");if(!(!t||t.kind==="textValue")){for(let n of t.children)if(n.kind!=="textValue"){if(n.localName==="dropDownList")return "dropdown";if(n.localName==="comboBox"||n.localName==="date")return n.localName;if(n.localName==="checkbox")return "checkbox";if(n.localName==="picture")return "picture";if(n.localName==="docPartList")return "buildingBlockGallery"}}}var wN=["dropdown","comboBox","date","checkbox","picture","buildingBlockGallery"];function lk(e){let t=null,n=false,r=()=>{let o=t;t=null,o&&(e.setOpen(o.id,false),o.controller.abort());};return {cancel:r,destroy(){n=true,r();},open(o,a){if(r(),n||!e.request||!wN.includes(a))return false;let i=new AbortController;t={controller:i,id:o};let s=()=>!n&&t?.controller===i&&!i.signal.aborted,l=()=>s()&&sk(e.find(o))===a&&e.allowed(o),d=e.find(o),c=e.items(o).map(y=>({...y})),u=rm(d,c),p=a==="picture"?e.picture(o):void 0;if(a==="picture"&&!p)return r(),false;let m=false,h={controlId:o,kind:a,items:c,value:a==="date"?e.date(o)??"":a==="checkbox"?String(e.checked(o)):a==="picture"?p:a==="buildingBlockGallery"?"":u,locale:e.locale(),anchor:[...e.layer.querySelectorAll("[data-docx-content-control]")].find(y=>y.getAttribute("data-docx-content-control")===o)?.querySelector(".docx-content-control-boundary")??null,signal:i.signal,canApply:l,apply(y){return a==="picture"||!l()||!e.apply(o,y)?false:(s()&&r(),true)},cancel(){s()&&r();},...a==="picture"?{async replaceImage(y){if(m||!l())return false;m=true;try{return await e.replaceImage(o,y,()=>l()&&e.picture(o)===p)?(s()&&r(),!0):!1}finally{m=false;}}}:{}};return e.setOpen(o,true),e.request(h)?true:(h.cancel(),false)}}}function dk(e,t){if(!e)return [];if(t&&uk(e))return chunkFIJZIQXA_cjs.Fg(t(),e).map(n=>({displayText:n.name,value:n.name}));for(let n of e.children)if(n.kind!=="textValue"&&!(n.kind!=="contentControlProperties"&&n.localName!=="sdtPr"))for(let r of n.children){if(r.kind==="textValue"||r.localName!=="dropDownList"&&r.localName!=="comboBox")continue;let o=[];for(let a of r.children){if(a.kind==="textValue"||a.localName!=="listItem")continue;let i=a.attributes.find(l=>l.localName==="value")?.value??"",s=a.attributes.find(l=>l.localName==="displayText")?.value??i;o.push({displayText:s,value:i});}return o}return []}function ck(e){if(e){for(let t of e.children)if(t.kind==="contentControlProperties"){for(let n of t.children)if(n.kind==="contentControlDate")return n.attributes.find(r=>r.localName==="fullDate")?.value}}}function uk(e){return sk(e&&e.kind!=="textValue"?e:null)==="buildingBlockGallery"}function fk(e,t,n,r){if(!e||!uk(e))return [{op:"setContentControlValue",controlId:n,value:r}];let o=chunkFIJZIQXA_cjs.Fg(t(),e).filter(i=>i.name===r),a=o.length===1?o[0]:void 0;return a?[{op:"insertBuildingBlock",controlId:n,name:a.name,blocks:a.blocks}]:null}function pk(e){let t=-1,n=true;return ()=>{let r=e.packageRevision();return t!==r&&(t=r,n=!chunkFIJZIQXA_cjs.ji(e.settingsRoot()).doNotShadeFormData),n}}var Fd="switch to field results before editing a form value";function mk(e,t){let{anchor:n,head:r}=t,o=n.paragraphId===r.paragraphId;for(let a of [n,r]){let i=e(a.paragraphId),s=i&&chunkFIJZIQXA_cjs.Ta(i,a.paragraphId);if(s?.kind!=="paragraph")continue;let l=o?Math.min(n.offset,r.offset):a.offset,d=o?Math.max(n.offset,r.offset):a.offset,c=chunkFIJZIQXA_cjs.jg(s);if(chunkFIJZIQXA_cjs.Hf(s).filter(p=>p.addressing==="editable-result").map(p=>{let m=c.spanOf(p.node)?.start??0,h=m;for(let y of p.removeNodeIds)h=Math.max(h,c.spanOf(y)?.end??h);return {start:m,end:h}}).some(p=>l===d?l>=p.start&&(l<p.end||p.start===p.end):l<p.end&&d>p.start))return true}return false}function gk(e,t,n,r){let o=e.contentControlId?chunk4GBTELJV_cjs.oe(t).find(c=>c.id===e.contentControlId):void 0,a=Pr(n).filter(c=>c.toc.id===e.id),i=a.some(c=>c.start>0||c.end<c.length);if(o&&!i)return {tocId:e.id,boundary:o,additional:false};let s=new Map(a.map(c=>[c.paragraphId,c])),l=a.filter(c=>c.start>0||c.end<c.length).flatMap(c=>chunk4GBTELJV_cjs.ue(t,{anchor:{paragraphId:c.paragraphId,offset:c.start},head:{paragraphId:c.paragraphId,offset:c.end}},[c.paragraphId],r)),d=t.pages.flatMap(c=>{let u=chunk4GBTELJV_cjs.xa(c).filter(g=>{let b=s.get(g.paragraphId);return b&&b.start===0&&b.end===b.length}).map(chunk4GBTELJV_cjs.Ed);if(u.push(...l.filter(g=>g.pageIndex===c.index)),u.length===0)return [];let p=Math.min(...u.map(g=>g.x)),m=Math.min(...u.map(g=>g.y)),h=Math.max(...u.map(g=>g.x+g.width)),y=Math.max(...u.map(g=>g.y+g.height));return [{pageIndex:c.index,box:{x:p,y:m,width:h-p,height:y-m}}]});return d.length===0?null:{tocId:e.id,additional:true,boundary:{id:`toc:${e.id}`,controlType:"richText",lock:"unlocked",effectiveLock:"unlocked",placeholder:false,bound:false,nestingDepth:0,level:"block",fragments:d}}}var hk=new WeakMap;function yk(e,t,n,r){hk.set(e,o=>{let a=t();e.flushPendingInput();try{n(o),r();}catch(i){throw n(a),r(),i}});}function bk(e,t){let n=hk.get(e);if(!n)throw new Error("Surface does not support measurement updates");n(t);}var Ld=new WeakMap;function vk(e){if(e.host){e.status.replaceChildren();return}let t=e.status.ownerDocument.createElement("span");t.className="docx-editor__loading-spinner",t.setAttribute("aria-hidden","true"),e.status.replaceChildren(t);}function xk(e,t){let n=t.ownerDocument,r=n.createElement("div");r.className="docx-opening-indicator",r.contentEditable="false";let o=n.createElement("div");o.className="docx-editor__loading-page-status",o.setAttribute("role","status"),r.append(o);let a={frame:r,status:o,host:null};Ld.set(e,a),vk(a);let i=()=>{let s=t.querySelector(':scope > .docx-pages > .docx-page[data-page-index="0"]');r.hidden=!s,s&&(r.style.left=s.style.left,r.style.top=s.style.top,r.style.width=s.style.width,r.style.height=s.style.height);};return t.append(r),i(),{place:i,remove:()=>{Ld.get(e)===a&&(Ld.delete(e),r.remove(),a.host?.publish(null));}}}function om(e,t){let n=Ld.get(e);if(!n||n.host===t)return;let r=n.host;n.host=t,r?.publish(null),vk(n),t?.publish(n.status);}var Nd=new WeakMap;function IN(e,t){Nd.set(e,t);}function am(e,t){let n=Nd.get(e);if(!n)return true;let r=n(t);return r&&Nd.delete(e),r}function Dd(e){return Nd.has(e)}var kN=40;function wk(e,t,n,r){let o=r,a=null,i=0,s=()=>{let d=a;a=null,d&&chunk4GBTELJV_cjs.ff(d);},l=d=>{let c=n.now()+d;for(;n.limit()!==null&&!n.destroyed();){if(!a){let h=n.limit(),y=n.bodyBlockCount();if(y!==void 0&&h>=y)return n.finish(),true;n.setLimit(h+o),a=n.prefixPass(h+o),i=0;}let u=n.now(),p=false;do p=a.next().done===true;while(!p&&n.now()<c);if(i+=n.now()-u,!p)return false;a=null;let m=Math.max(i,1)/o;if(o=Math.min(4096,Math.max(16,Math.round(kN/m))),n.now()>=c)return false}return true};if(t.removeAttribute("data-docx-opening-preview"),n.limit()!==null){t.setAttribute("data-docx-opening-preview","");let d=xk(e,t);IN(e,c=>{let u=l(c);return u?(t.removeAttribute("data-docx-opening-preview"),d.remove()):d.place(),u});}return s}var RN=40,PN=12,TN=8;function im(e){if(typeof MessageChannel=="function"){let t=new MessageChannel;t.port1.onmessage=()=>{t.port1.close(),e();},t.port2.postMessage(null);return}setTimeout(e,0);}function EN(e){if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>im(e));return}im(e);}function Sk(e){let t=null,n=a=>{let i=t===null!=(a===null);t=a,i&&e.pendingChanged?.(a!==null);},r=(a,i)=>{e.revision()===i&&e.publish(a);},o=()=>{let a=t;if(!a)return;let i=e.now()+PN;for(;;){let s=a.steps.next();if(s.done){n(null),r(s.value,a.revision);return}if(e.now()>=i)break}im(o);};return {run(a,i){let s=e.snapshot(),l=e.now()+RN,d=e.pageAfterView(),c=e.current(),u=null;for(;;){let p=a.next();if(p.done)return p.value;if(p.value&&(u=p.value),d===void 0||!u?.finalize||u.pages.length<=d||e.now()<l||!c||c.pages.length-u.pages.length<TN)continue;let m=[...u.pages,...c.pages.slice(u.pages.length)];return n({steps:a,revision:i,restore:s}),EN(o),u.finalize(m)}},finish(){let a=t;a&&(n(null),r(chunk4GBTELJV_cjs.ff(a.steps),a.revision));},abandon(){let a=t;a&&(n(null),a.restore());},pending:()=>t!==null,cancel(){n(null);}}}var ON=1e4;function Ik(e){let t=null,n=()=>{let i=[],s=new Set([e.part()]);for(let l of e.headerFooterPartsBySection())for(let d of [l.headers,l.footers])for(let c of d.values())s.has(c)||(s.add(c),i.push(c));for(let l of ["footnote","endnote"]){let d=e.partFor({kind:"notesPart",noteKind:l});!d||s.has(d)||(s.add(d),i.push(d));}return i},r=(i,s)=>i.length===s.length&&i.every((l,d)=>l===s[d]),o=i=>{let s=chunkFIJZIQXA_cjs.Ta(e.part(),i);if(!s||s.kind!=="paragraph")return false;let l=0,d=[...s.children];for(;d.length>0;){let c=d.pop();if(++l>ON)return false;if(c.kind!=="textValue"){if(c.namespaceUri===chunkFIJZIQXA_cjs.la&&c.localName==="p")return false;for(let u of c.children)d.push(u);}}return true},a=(i,s)=>{if(i.splitJoin.length!==1||i.story!==void 0&&i.story.kind!=="body")return false;let l=i.splitJoin[0];if("split"in l){let{from:u,tail:p}=l.split,m=s.get(u);if(m===void 0||s.has(p)||i.deleted.length>0||i.created.length!==1||i.created[0]!==p||!o(u)||!o(p))return false;for(let[h,y]of s)y>m&&s.set(h,y+1);return s.set(p,m+1),true}let{kept:d,removed:c}=l.join;return !s.has(d)||i.created.length>0||i.deleted.length!==1||i.deleted[0]!==c||!o(d)?false:(s.delete(c),true)};return {retain(i){if(!t)return;let s=i.created.length>0||i.deleted.length>0||i.splitJoin.length>0,l=i.impact==="text-local"&&!s?t.otherParts:n();i.impact!=="global"&&(i.impact==="text-local"||r(t.otherParts,l))&&(!s||r(t.otherParts,l)&&a(i,t.index))?t={packageRevision:e.packageRevision(),bodyRoot:e.part().root,index:t.index,otherParts:l}:t=null;},index(){let i=e.packageRevision(),s=e.part().root;if(t&&t.packageRevision===i&&t.bodyRoot===s)return t.index;let l=new Map,d=u=>{let p=l.size;for(let[m,h]of u)l.has(m)||l.set(m,p+h);};d(chunkFIJZIQXA_cjs.lj(e.part()));let c=n();for(let u of c)d(chunkFIJZIQXA_cjs.lj(u));return t={packageRevision:i,bodyRoot:s,index:l,otherParts:c},l}}}var FN=i18n.createT(i18n.en);function bn(e){return t=>{try{let n=e?.(t);if(typeof n=="string"&&n&&n!==t)return n}catch{}return FN(t)}}var kk=new WeakMap;function Hd(e,t){let n=new Map;return kk.set(e,n),(r,o,a="textContent")=>{let i=n.get(r);i||n.set(r,i=new Map),i.set(a,o),a==="textContent"?r.textContent=t(o):r.setAttribute(a,t(o));}}function Rk(e,t){let n=kk.get(e);if(n)for(let[r,o]of n){if(r!==e&&!e.contains(r)){n.delete(r);continue}for(let[a,i]of o)a==="textContent"?r.textContent=t(i):r.setAttribute(a,t(i));}}function Pk(e,t){let n=e.ownerDocument.defaultView;if(!n)return;if(n.getComputedStyle(e).position==="fixed"){let R=t.getBoundingClientRect();e.style.maxHeight="";let w=Number.parseFloat(n.getComputedStyle(e).maxHeight),O=Number.isFinite(w)?w:n.innerHeight;e.style.maxWidth=`${Math.max(0,n.innerWidth-16)}px`,e.style.maxHeight=`${Math.max(0,Math.min(O,n.innerHeight-16))}px`;let N=e.getBoundingClientRect(),A=Math.max(0,n.innerHeight-8-R.bottom-4),V=Math.max(0,R.top-8-4),W=N.height>A&&V>A,E=Math.min(N.height,W?V:A);e.style.maxHeight=`${E}px`,e.style.left=`${Math.max(8,Math.min(R.left,n.innerWidth-8-N.width))}px`;let _=W?R.top-4-E:R.bottom+4;e.style.top=`${Math.max(8,Math.min(_,n.innerHeight-8-E))}px`,e.dataset.placement=W?"top":"bottom";return}let r=e.offsetParent;if(!r)return;let o=t.getBoundingClientRect(),a=t.closest(".docx-page")?.getBoundingClientRect(),i=t.closest(".docx-editor__scroll-container")?.getBoundingClientRect(),s=Math.max(0,a?.left??0,i?.left??0),l=Math.min(n.innerWidth,a?.right??n.innerWidth,i?.right??n.innerWidth),d=Math.max(0,i?.top??0),c=Math.min(n.innerHeight,i?.bottom??n.innerHeight);e.style.maxWidth=`${Math.max(0,l-s)}px`,e.style.maxHeight=`${Math.max(0,c-d)}px`;let u=e.getBoundingClientRect(),p=c-o.bottom,m=o.top-d,h=u.height>p&&m>p,y=Math.max(0,h?m:p);e.style.maxHeight=`${Math.max(0,Math.min(c-d,y))}px`;let g=Math.min(u.height,y),b=Math.max(s,Math.min(o.left,l-u.width)),S=Math.max(d,h?o.top-g:o.bottom),x=r.getBoundingClientRect(),I=r.offsetWidth?x.width/r.offsetWidth:1,M=r.offsetHeight?x.height/r.offsetHeight:1;e.style.left=`${(b-x.left)/I-r.clientLeft+r.scrollLeft}px`,e.style.top=`${(S-x.top)/M-r.clientTop+r.scrollTop}px`,e.dataset.placement=h?"top":"bottom";}function hs(e,t){let n=e.ownerDocument.defaultView,r=t.closest(".docx-pages")??e.closest(".docx-editor")?.querySelector(".docx-pages"),o=t.closest("[data-docx-content-control]")?.dataset.docxContentControl,a=t,i=()=>{if(!a.isConnected&&r&&o){let d=[...r.querySelectorAll("[data-docx-content-control]")].find(c=>c.dataset.docxContentControl===o)?.querySelector(".docx-content-control-boundary");d&&(s?.unobserve(a),a=d,s?.observe(a));}a.isConnected&&Pk(e,a);},s=typeof ResizeObserver>"u"?null:new ResizeObserver(i);s?.observe(e),s?.observe(a);let l=typeof MutationObserver>"u"?null:new MutationObserver(i);return r&&l?.observe(r,{childList:true,subtree:true}),i(),n?.addEventListener("resize",i),e.ownerDocument.addEventListener("scroll",i,true),()=>{s?.disconnect(),l?.disconnect(),n?.removeEventListener("resize",i),e.ownerDocument.removeEventListener("scroll",i,true);}}function ys(e,t,n){if(t.stopPropagation(),t.isComposing||(t.key==="Escape"&&(t.preventDefault(),n()),t.key!=="Tab"))return;let r=[...e.querySelectorAll("button,input,select,textarea,[href],[tabindex]")].filter(i=>i.tabIndex>=0&&!i.hasAttribute("disabled")&&!i.closest("[hidden]")&&e.ownerDocument.defaultView?.getComputedStyle(i).display!=="none");if(!r.length){t.preventDefault(),e.focus();return}let o=e.ownerDocument.activeElement,a=t.shiftKey&&(o===r[0]||o===e)?r.at(-1):!t.shiftKey&&(o===r.at(-1)||o===e)?r[0]:null;a&&(t.preventDefault(),a.focus());}function LN(e){let t=e?.ownerDocument??(typeof document>"u"?null:document),n=t?.activeElement;return n&&n!==t?.body?n:e?.closest(".docx-pages")??null}var sm="image/png,image/jpeg,image/gif,image/bmp,image/webp",NN=new Set(sm.split(",")),DN=8;function HN(e){if(!e||e.kind==="textValue")return;let t=(n,r)=>{if(!(n.kind==="textValue"||r>DN)){if(n.kind==="drawing")return n.id;if(n.localName!=="sdtPr")for(let o of n.children){let a=t(o,r+1);if(a)return a}}};return t(e,0)}function Tk(e){let t=null,n=null,r=null,o,a,i=0,s=false,l=()=>{i++,o?.(),a?.(),r?.remove(),r=null;let u=n;t?.remove(),t=null,n=null,u&&(e.setOpen(u,false),s||e.layer.focus({preventScroll:true}));},d=u=>HN(e.find(u)),c=async(u,p,m=()=>true)=>{if(s||!m()||!e.allowed(u))return false;if(p.byteLength>chunkFIJZIQXA_cjs.r.maxEncodedBytes)return e.reject("image-resource-limit"),false;let h=d(u);if(!h)return e.reject("no-picture"),false;let y=chunkFIJZIQXA_cjs.de(p);if(!NN.has(y))return e.reject("unsupported-image"),false;let g=await e.replaceImage(h,p,y,()=>!s&&m()&&e.allowed(u)&&d(u)===h);return g.ok?true:(e.reject(g.detail??g.reason),false)};return {drawingOf:d,replace:c,cancel:l,select(u){let p=d(u),m=p?chunk4GBTELJV_cjs.fe(e.layout(),p):null;return m?e.selectDrawing(p,m.record.paragraphId):false},pick(u){if(l(),s||!e.allowed(u))return;let p=i,m=()=>!s&&i===p;if(!d(u)){e.reject("no-picture");return}let h=e.document.createElement("input");h.type="file",h.accept=sm,h.className="docx-content-control-picture-picker",h.dataset.docxMarker="",h.dataset.docxCcId=u,h.setAttribute("contenteditable","false"),h.setAttribute("aria-hidden","true"),h.tabIndex=-1;let y=bn(e.translate),g=e.document.createElement("div");g.className="docx-content-control-menu",g.style.position="absolute",g.style.zIndex="20",g.style.pointerEvents="auto",g.dataset.docxCcId=u,g.dataset.docxMarker="",g.setAttribute("role","dialog"),g.setAttribute("aria-label",y("contentControl.types.picture")),g.setAttribute("contenteditable","false"),g.hidden=true;let b=e.document.createElement("div");b.className="docx-content-control-widget-error",b.setAttribute("role","alert"),b.textContent=y("disabledReason.invalidValue");let S=e.document.createElement("button");S.type="button",S.textContent=y("common.cancel"),S.addEventListener("click",l),g.addEventListener("pointerdown",x=>x.stopPropagation()),g.addEventListener("keydown",x=>{ys(g,x,l),x.stopPropagation();}),g.append(b,S),h.addEventListener("change",()=>{let x=h.files?.[0];!x||!m()||(h.value="",h.disabled=true,(async()=>{let I=false;try{x.size>chunkFIJZIQXA_cjs.r.maxEncodedBytes?e.reject("image-resource-limit"):I=await c(u,new Uint8Array(await x.arrayBuffer()),m);}catch{m()&&e.reject("image-read-failed");}if(!m())return;if(I){l();return}h.disabled=false,h.className="docx-content-control-picture-input",h.removeAttribute("aria-hidden"),h.tabIndex=0,h.setAttribute("aria-label",y("contentControl.types.picture")),h.setAttribute("aria-invalid","true"),g.prepend(h),g.hidden=false;let M=[...e.layer.querySelectorAll("[data-docx-content-control]")].find(k=>k.getAttribute("data-docx-content-control")===u)?.querySelector(".docx-content-control-boundary");a?.(),o?.(),M&&(a=hs(g,M)),o=Ad(g,l),h.focus();})());}),h.addEventListener("cancel",l),e.layer.append(h),(e.layer.closest(".docx-editor__scroll-container")??e.layer).append(g),r=g,t=h,n=u,e.setOpen(u,true),h.click();},destroy(){s=true,l();}}}function Ck(e,t,n,r){return (chunkFIJZIQXA_cjs.tk(e,t,n)?.offset??n)+r}function Ek(e){if(e&&!(e.effectiveLock==="contentLocked"||e.effectiveLock==="sdtContentLocked")&&!e.bound&&!(e.controlType==="checkbox"||e.controlType==="picture"))return e.id}function Ok(e,t,n){return {op:"insertText",paragraphId:e.paragraphId,offset:e.offset,text:t,...n===void 0?{}:{inside:n}}}function _N(e,t,n){let r=e.ownerDocument;if(typeof r.elementFromPoint!="function")return null;let o=r.elementFromPoint(t,n)?.closest(".docx-page");if(!o)return null;for(let a of o.querySelectorAll("[data-docx-content-control]:not([data-docx-toc])"))for(let i of a.querySelectorAll(".docx-content-control-boundary")){let s=i.getBoundingClientRect();if(t>=s.left-3&&t<=s.right+22&&n>=s.top-3&&n<=s.bottom+3)return a}return null}function Mk(e){let t=null,n=0,r=null,o=l=>{l!==t&&(t?.isConnected&&delete t.dataset.hover,t=l,l&&(l.dataset.hover=""));},a=()=>{n=0,r&&o(_N(e,r.x,r.y));},i=l=>{r={x:l.clientX,y:l.clientY},n===0&&(n=e.ownerDocument.defaultView?.requestAnimationFrame(a)??0),n===0&&a();},s=()=>{r=null,o(null);};return e.addEventListener("pointermove",i),e.addEventListener("pointerleave",s),{destroy(){e.removeEventListener("pointermove",i),e.removeEventListener("pointerleave",s),n&&e.ownerDocument.defaultView?.cancelAnimationFrame(n),o(null);}}}var bs=.25;function Ak(e,t,n){let r=(s,l)=>{let d=chunk4GBTELJV_cjs.ne(e,s,n);return d?chunk4GBTELJV_cjs.ke(e,{x:d.x+l,y:d.y+d.height/2,pageIndex:d.pageIndex}):null},o=r(t.head,0);if(o)return o;if(t.anchor.paragraphId===t.head.paragraphId&&t.anchor.offset===t.head.offset)return r(t.head,-bs);let i=t.head.paragraphId===t.anchor.paragraphId&&t.head.offset<t.anchor.offset;return r(t.head,i?bs:-bs)??r(t.anchor,i?-bs:bs)}function Fk(e,t,n,r,o){let a=r==="left"?-1:1,i=chunk4GBTELJV_cjs.ne(e,t.from,o),s=chunk4GBTELJV_cjs.ne(e,t.to,o),l=i?chunk4GBTELJV_cjs.ie(e,i)??1:1,d=a*l===-1?t.from:t.to;if(!i||!s||i.lineId!==s.lineId||i.pageIndex!==s.pageIndex)return d;let c=chunk4GBTELJV_cjs.ud(e,t.from.paragraphId)?.find(({line:h})=>h.id===i.lineId)?.line;if(!c?.spans.some(h=>h.style.shaping))return d;let u=n.indexOf(t.from.paragraphId),p=n.indexOf(t.to.paragraphId),m;for(let h of c.spans){let y=h.range.paragraphId,g=n.indexOf(y);if(g<u||g>p)continue;let b=Math.max(h.range.start,y===t.from.paragraphId?t.from.offset:0),S=Math.min(h.range.end,y===t.to.paragraphId?t.to.offset:1/0);if(!(b>=S))for(let x of [b,S]){let I={paragraphId:y,offset:x},M=chunk4GBTELJV_cjs.ne(e,I,o);if(!M||M.lineId!==i.lineId||M.pageIndex!==i.pageIndex)continue;let k=M.x;(!m||(k-m.x)*a>0)&&(m={position:I,x:k});}}return m?.position??d}function Lk(e,t,n){let r=e;return {get:()=>r,set(o){o!==r&&(t(),r=o,n());}}}function Nk(e,t,n,r){let o=bn(r),a=e.ownerDocument,i=a.createElement("dialog"),s=Hd(i,o);i.className="docx-text-form-dialog",i.setAttribute("role","alertdialog"),i.setAttribute("data-docx-modal",""),s(i,"textFormField.invalidTitle","aria-label"),s(i,`textFormField.invalid${t==="number"?"Number":"Date"}`,"aria-description");let l=a.createElement("h2");l.className="docx-text-form-dialog__header",s(l,"textFormField.invalidTitle");let d=a.createElement("div");d.className="docx-text-form-dialog__body",s(d,`textFormField.invalid${t==="number"?"Number":"Date"}`);let c=a.createElement("div");c.className="docx-text-form-dialog__footer";let u=a.createElement("button");u.type="button",u.className="docx-text-form-dialog__button docx-text-form-dialog__button--primary",s(u,"textFormField.apply");let p=false,m=()=>{p||(p=true,n());};return u.addEventListener("click",m),i.addEventListener("keydown",h=>{h.key!=="Enter"||h.isComposing||(h.preventDefault(),h.stopPropagation(),m());}),i.addEventListener("cancel",h=>{h.preventDefault(),m();}),c.append(u),i.append(l,d,c),e.append(i),i.showModal(),u.focus(),i}function Dk(e,t,n,r,o){let a=bn(o),i=e.ownerDocument,s=i.createElement("dialog"),l=Hd(s,a);s.className="docx-text-form-dialog",s.setAttribute("data-docx-modal",""),l(s,"textFormField.title","aria-label");let d=i.createElement("h2");d.className="docx-text-form-dialog__header",l(d,"textFormField.title");let c=i.createElement("div");c.className="docx-text-form-dialog__body";let u=i.createElement("div");u.className="docx-text-form-dialog__footer",s.append(d,c,u);let p=(O,N)=>{let A=i.createElement("label");A.className="docx-text-form-dialog__row";let V=i.createElement("span");V.className="docx-text-form-dialog__label",l(V,O),N.className="docx-text-form-dialog__input",A.append(V,N),c.append(A);},m=i.createElement("input");m.type="text",m.value=t.defaultText,p("textFormField.defaultText",m);let h=i.createElement("select"),y=["regular","number","date"];for(let O of y){let N=i.createElement("option");N.value=O,l(N,`textFormField.${O}`),h.append(N);}if(!y.includes(t.type)){let O=i.createElement("option");O.value=t.type,l(O,"textFormField.preservedType"),O.disabled=true,h.append(O);}h.value=t.type,p("textFormField.type",h);let g=i.createElement("input");g.type="number",g.min="0",g.max="32767",g.step="1",g.value=String(t.maxLength),p("textFormField.maxLength",g);let b=i.createElement("select"),S=O=>{b.replaceChildren();let N=chunkFIJZIQXA_cjs.Qi[h.value]??[];for(let A of N){let V=i.createElement("option");V.value=A;let E={Uppercase:"textFormField.uppercase",Lowercase:"textFormField.lowercase","First capital":"textFormField.firstCapital","Title case":"textFormField.titleCase"}[A];E||!A?l(V,E??"textFormField.noFormat"):V.textContent=A,b.append(V);}if(!N.includes(O)){let A=i.createElement("option");A.value=O,O?A.textContent=O:l(A,"textFormField.noFormat"),A.disabled=true,b.append(A);}b.value=O;};S(t.format),h.addEventListener("change",()=>S("")),p("textFormField.format",b);let x=i.createElement("input");x.type="checkbox",x.checked=t.enabled;let I=i.createElement("label");I.className="docx-text-form-dialog__checkbox-row";let M=i.createElement("span");l(M,"textFormField.enabled"),I.append(x,M),c.append(I);let k=i.createElement("p");k.className="docx-text-form-dialog__error",k.setAttribute("role","alert"),c.append(k);let P=i.createElement("button");P.type="button",P.className="docx-text-form-dialog__button",l(P,"textFormField.cancel"),P.addEventListener("click",r);let R=i.createElement("button");R.type="button",R.className="docx-text-form-dialog__button docx-text-form-dialog__button--primary",l(R,"textFormField.apply");let w=()=>{if(!g.value||!g.checkValidity()||!n(m.value,{type:h.value,maxLength:Number(g.value),format:b.value,enabled:x.checked})){l(k,"textFormField.invalidOptions");return}r();};return R.addEventListener("click",w),s.addEventListener("keydown",O=>{O.key==="Enter"&&!O.isComposing&&O.target instanceof HTMLInputElement&&(O.preventDefault(),w());}),s.addEventListener("cancel",O=>{O.preventDefault(),r();}),u.append(P,R),e.append(s),s.showModal(),m.focus(),m.select(),s}function Hk(e,t,n){let r=[],o=[];for(let i of e)for(let s of chunkFIJZIQXA_cjs.lj(i).keys()){let l=chunkFIJZIQXA_cjs.Ta(i,s);if(l?.kind==="paragraph")for(let d of chunkFIJZIQXA_cjs.hj(l)){let c=t.get(d.fieldNodeId);if(!c)continue;let u=(chunkFIJZIQXA_cjs.Vi(i,s)??"").slice(d.start,d.end),p=chunkFIJZIQXA_cjs.Ri(u,d,"fill",c.locale);if(p===null)return {reason:"invalidArgs"};if(p===u)continue;let m={op:"commitTextFormField",paragraphId:s,fieldNodeId:d.fieldNodeId,locale:c.locale},h=chunkFIJZIQXA_cjs.Wk(i,m);if(h)return {reason:h};r.push(m),o.push({paragraphId:s,start:d.start,end:d.end,length:p.length});}}let a=i=>{let s=i.offset;for(let l of o)l.paragraphId!==i.paragraphId||i.offset<=l.start||(s+=i.offset>=l.end?l.length-(l.end-l.start):Math.min(i.offset-l.start,l.length)-(i.offset-l.start));return s===i.offset?i:{...i,offset:s}};return {ops:r,selection:{anchor:a(n.anchor),head:a(n.head)}}}var _d=new WeakMap,Bd=new WeakMap;function Bk(e){return Bd.get(e)?.()??null}function _k(e){return [...chunkFIJZIQXA_cjs.lj(e).keys()].flatMap(t=>{let n=chunkFIJZIQXA_cjs.Ta(e,t);return n?.kind==="paragraph"?chunkFIJZIQXA_cjs.hj(n):[]})}function lm(e){return _d.get(e)?.()}function $k(e,t){let n=bn(e.translate),r=e.container.ownerDocument,o,a=false,i=new Map,s=()=>e.parts?.()??[e.part()];if(t?.length)for(let F of s()){let L=t.filter(q=>q.partName===F.name);if(!L.length)continue;let B=_k(F);for(let q of L){let X=B[q.fieldIndex];X&&i.set(X.fieldNodeId,{text:q.text,locale:q.locale});}}let l=new WeakMap,d=new WeakMap,c=(F=e.part())=>{l.set(F,new Map([...i].filter(([L])=>L.startsWith(`${F.name}#`))));},u=()=>(i=new Map(s().flatMap(F=>[...l.get(F)??[]])),d.get(e.part())??null),p=F=>{i.delete(F),c();};s().forEach(c);let m=()=>{if(!i.size)return null;if(a)return "invalidState";let F=Hk(s(),i,e.selection());if("reason"in F)return F.reason;if(F.ops.length&&!e.editable())return "locked";let L=s();s().forEach(c);let B=i;F.ops.length&&d.set(e.part(),e.selection()),i=new Map,a=true;try{let q=F.ops.length?e.save?e.save(F.ops,F.selection):"unsupported":null;return q?i=B:(delete Z.dataset.fieldError,F.ops.length&&d.set(e.part(),F.selection)),s().forEach(c),q}catch(q){throw s().every(X=>L.includes(X))&&(i=B),s().forEach(c),q}finally{a=false;}};Bd.set(e.container,m);let h=()=>i.size?s().flatMap(F=>_k(F).flatMap((L,B)=>{let q=i.get(L.fieldNodeId);return q?[{partName:F.name,fieldIndex:B,...q}]:[]})):[];_d.set(e.container,h);let y,g=(F,L)=>(chunkFIJZIQXA_cjs.Vi(e.part(),F)??"").slice(L.start,L.end),b=null,S=null,x=null,I=false,M=false,k=()=>{let F=x;x=null,M=false,b?.remove(),b=null,F?.abort();},P=()=>{if(!b&&!x)return;let F=e.selection();k(),!I&&(e.pagesLayer.focus({preventScroll:true}),e.select(F));};function R(F,L,B="plain"){y={paragraphId:F,fieldNodeId:L.fieldNodeId},e.select({anchor:{paragraphId:F,offset:L.start},head:{paragraphId:F,offset:L.end}},B==="press"?"pressed":void 0);let q=e.selection().head.paragraphId===F&&e.selection().head.offset>=L.start&&e.selection().head.offset<=L.end;q&&(S=y??S),y=void 0,q&&B==="travel"&&e.reveal?.({paragraphId:F,offset:L.start});}function w(F,L){if(I)return;P();let B=e.locale?.()??"en-US",q=new AbortController;x=q;let X=()=>{if(I||q.signal.aborted||x!==q)return false;let j=chunkFIJZIQXA_cjs.Ta(e.part(F),F);return j?.kind==="paragraph"&&chunkFIJZIQXA_cjs.hj(j).some(z=>z.fieldNodeId===L.fieldNodeId)&&e.editable()&&!e.protected(F)},D={field:{...L},signal:q.signal,canApply:X,apply(j,z){if(!X()||!e.apply({op:"setTextFormFieldDefault",locale:B,paragraphId:F,fieldNodeId:L.fieldNodeId,text:j,options:z}))return false;if(I||x!==q||q.signal.aborted)return true;let ne=chunkFIJZIQXA_cjs.Ta(e.part(F),F),re=ne?.kind==="paragraph"?chunkFIJZIQXA_cjs.hj(ne).find(ee=>ee.fieldNodeId===L.fieldNodeId):null;return re&&R(F,re),P(),true},cancel(){x===q&&!q.signal.aborted&&P();}};e.onRequest?.(D)||q.signal.aborted||(b=Dk(e.container,L,D.apply,D.cancel,n));}let O=F=>{let B=F.target?.closest('[data-field-atom="form"][data-start]'),q=B?.closest("[data-paragraph-id]")?.dataset.paragraphId;if(!B||!q||!e.editable())return null;let X=chunkFIJZIQXA_cjs.Ta(e.part(),q);if(X?.kind!=="paragraph")return null;let D=Number(B.dataset.start),j=chunkFIJZIQXA_cjs.hj(X).find(z=>z.start<=D&&D<z.end);return j?{paragraphId:q,field:j}:null},N=null,A=F=>F.shiftKey||F.altKey||F.ctrlKey||F.metaKey,V=F=>{if(o=void 0,N=null,F.button!==0)return;let L=O(F);L&&!A(F)&&!e.protected(L.paragraphId)&&(N={x:F.clientX,y:F.clientY,paragraphId:L.paragraphId,fieldNodeId:L.field.fieldNodeId,moved:false}),y=L?{paragraphId:L.paragraphId,fieldNodeId:L.field.fieldNodeId}:null;};e.pagesLayer.addEventListener("pointerdown",V,{capture:true});let W=F=>{N&&Math.hypot(F.clientX-N.x,F.clientY-N.y)>4&&(N.moved=true);},E=()=>{N=null;},_=(F,L=false)=>{let B=N;if(N=null,!B||B.moved||b||F.button!==0||F.detail>1||Math.hypot(F.clientX-B.x,F.clientY-B.y)>4||!e.editable()||A(F)||e.protected(B.paragraphId))return;let q=chunkFIJZIQXA_cjs.Ta(e.part(),B.paragraphId),X=q?.kind==="paragraph"?chunkFIJZIQXA_cjs.hj(q).find(j=>j.fieldNodeId===B.fieldNodeId):null;if(!X)return;let D=e.selection();L&&(D.anchor.paragraphId!==D.head.paragraphId||D.anchor.offset!==D.head.offset)&&!(D.anchor.paragraphId===B.paragraphId&&D.head.paragraphId===B.paragraphId&&Math.min(D.anchor.offset,D.head.offset)===X.start&&Math.max(D.anchor.offset,D.head.offset)===X.end)||R(B.paragraphId,X,"press");};r.addEventListener("pointermove",W),r.addEventListener("pointercancel",E),e.pagesLayer.addEventListener("click",_);let G=F=>{if(F.shiftKey||F.altKey||F.ctrlKey||F.metaKey||e.pagesLayer.contentEditable==="false")return false;let L=O(F);if(!L)return false;let{paragraphId:B,field:q}=L;return F.preventDefault(),R(B,q,"press"),e.protected(B)||w(B,q),true};e.pagesLayer.addEventListener("dblclick",G);function U(){let F=e.selection();if(F.anchor.paragraphId!==F.head.paragraphId)return null;let L=F.head.paragraphId,B=chunkFIJZIQXA_cjs.Ta(e.part(),L);if(B?.kind!=="paragraph")return null;let q=Math.min(F.anchor.offset,F.head.offset),X=Math.max(F.anchor.offset,F.head.offset),D=chunkFIJZIQXA_cjs.hj(B).filter(z=>z.start<=q&&z.end>=X&&(z.start===z.end||q!==X||q<z.end||e.protected(L))),j=D.find(z=>S?.paragraphId===L&&z.fieldNodeId===S.fieldNodeId)??D.find(z=>z.start===q&&z.end===X)??D[0];return j?{paragraphId:L,field:j}:null}function $(){if(o===void 0)return U();if(!o)return null;let F=chunkFIJZIQXA_cjs.Ta(e.part(),o.paragraphId),L=F?.kind==="paragraph"?chunkFIJZIQXA_cjs.hj(F).find(B=>B.fieldNodeId===o.fieldNodeId):null;return L?{paragraphId:o.paragraphId,field:L}:null}let pe=F=>{let L=F.button===-1||F.clientX===0&&F.clientY===0?U():O(F);o=L?{paragraphId:L.paragraphId,fieldNodeId:L.field.fieldNodeId}:null;};e.pagesLayer.addEventListener("contextmenu",pe);let he=()=>{let F=$();return !!F&&e.editable()&&!e.protected(F.paragraphId)&&!chunkFIJZIQXA_cjs.Wk(e.part(),{op:"setTextFormFieldDefault",paragraphId:F.paragraphId,fieldNodeId:F.field.fieldNodeId,text:"",options:{type:"regular",maxLength:0,format:"",enabled:true}})},Z=r.createElement("span");return Z.className="docx-text-form-status",e.container.append(Z),{doubleClick:G,pointerUp:F=>_(F,true),canEdit:he,edit(){if(!he())return false;let F=$();return R(F.paragraphId,F.field,"travel"),w(F.paragraphId,F.field),true},selectForDeletion(F){let L=e.selection(),{paragraphId:B,offset:q}=L.head;if(!e.editable()||e.protected(B)||L.anchor.paragraphId!==B||L.anchor.offset!==q)return false;let X=chunkFIJZIQXA_cjs.Ta(e.part(),B);if(X?.kind!=="paragraph")return false;let D=chunkFIJZIQXA_cjs.hj(X).find(j=>j.start<j.end&&(F==="backward"?j.end===q:j.start===q));return D?(R(B,D),true):false},wordDeletionBoundary(F,L,B,q){let X=chunk4GBTELJV_cjs.he(F,L,B,q),D=e.selection().head.paragraphId;if(e.protected(D))return X;let j=chunkFIJZIQXA_cjs.Ta(e.part(D),D);if(j?.kind!=="paragraph")return X;let z=chunkFIJZIQXA_cjs.hj(j),ne=z.find(ee=>ee.start<ee.end&&(B===-1?ee.end===L:ee.start===L));if(ne)return B===-1?ne.start:ne.end;let re=X;for(let ee of z)for(let ie of [ee.start,ee.end])B===-1&&ie<L&&ie>re&&(re=ie),B===1&&ie>L&&ie<re&&(re=ie);return re},beforeSelect(F){let L=Le=>{if(y!==void 0)S=y;else if(F.anchor.paragraphId!==F.head.paragraphId||S?.paragraphId!==F.head.paragraphId)S=null;else {let Se=chunkFIJZIQXA_cjs.Ta(e.part(),F.head.paragraphId),mt=Se?.kind==="paragraph"?chunkFIJZIQXA_cjs.hj(Se).find(xt=>xt.fieldNodeId===S?.fieldNodeId):null;(!mt||Math.min(F.anchor.offset,F.head.offset)<mt.start||Math.max(F.anchor.offset,F.head.offset)>mt.end)&&(S=null);}return y=void 0,delete Z.dataset.fieldError,Le};if(a||M)return null;if(!e.editable())return F;let B=U();if(!B||!e.protected(B.paragraphId)||!B.field.enabled||!chunkFIJZIQXA_cjs.Si(B.field))return L(F);let{field:q,paragraphId:X}=B;if((!y||y.fieldNodeId===q.fieldNodeId)&&F.anchor.paragraphId===X&&F.head.paragraphId===X&&Math.min(F.anchor.offset,F.head.offset)>=q.start&&Math.max(F.anchor.offset,F.head.offset)<=q.end)return L(F);let D=i.get(q.fieldNodeId),j=D?.text,z=D?.locale??e.locale?.()??"en-US",ne=g(X,q);if(q.type==="date"&&j===void 0)return p(q.fieldNodeId),L(F);let re=chunkFIJZIQXA_cjs.Ri(ne,q,"fill",z);if(re===ne||re===null&&(j===void 0||j===ne))return p(q.fieldNodeId),L(F);a=true;let ee=e.part();c(ee);let ie=i;i=new Map(ie),i.delete(q.fieldNodeId);let de;try{de=e.apply({op:"commitTextFormField",locale:z,paragraphId:X,fieldNodeId:q.fieldNodeId}),de||(i=ie);}catch(Le){throw e.part()===ee&&(i=ie),Le}finally{c(),a=false;}if(!de){if(y=void 0,Z.setAttribute("role","alert"),Z.dataset.fieldError="true",Z.textContent=n("textFormField.invalidValue"),re===null&&(q.type==="number"||q.type==="date")){k();let Le=new AbortController;x=Le,M=true;let Se=()=>{if(I||Le.signal.aborted||x!==Le||(k(),I))return;let xt=e.selection(),tt=()=>{e.pagesLayer.focus({preventScroll:true}),e.select(xt);},me=chunkFIJZIQXA_cjs.Ta(e.part(),X),ue=me?.kind==="paragraph"?chunkFIJZIQXA_cjs.hj(me).find(Te=>Te.fieldNodeId===q.fieldNodeId):null;if(!ue||!e.editable()||!e.protected(X)||g(X,ue)!==ne||!ue.enabled||!chunkFIJZIQXA_cjs.Si(ue)||ue.type!==q.type||ue.format!==q.format||chunkFIJZIQXA_cjs.Ri(ne,ue,"fill",z)!==null){tt();return}a=true;try{if(e.apply({op:"deleteText",paragraphId:X,start:ue.start,end:ue.end,textFormFieldId:ue.fieldNodeId})){p(ue.fieldNodeId),delete Z.dataset.fieldError,e.pagesLayer.focus({preventScroll:!0});let Te={paragraphId:X,offset:ue.start};a=!1,e.select({anchor:Te,head:Te}),S={paragraphId:X,fieldNodeId:ue.fieldNodeId};}else a=!1,tt();}finally{a=false;}},mt={type:q.type,signal:Le.signal,acknowledge:Se,cancel(){x===Le&&!Le.signal.aborted&&P();}};!e.onInvalidRequest?.(mt)&&!Le.signal.aborted&&(b=Nk(e.container,q.type,Se,n));}return null}p(q.fieldNodeId);let Re=chunkFIJZIQXA_cjs.Ta(e.part(),X),Ke=Re?.kind==="paragraph"?chunkFIJZIQXA_cjs.hj(Re).find(Le=>Le.fieldNodeId===q.fieldNodeId):null,pt=Ke?Ke.end-q.end:0,ot=Le=>Le.paragraphId===X&&Le.offset>=q.end?{...Le,offset:Le.offset+pt}:Le;return L({anchor:ot(F.anchor),head:ot(F.head)})},update(){b&&Rk(b,n);let F=U(),L=e.selection(),B=!!F&&L.anchor.offset!==L.head.offset&&Math.min(L.anchor.offset,L.head.offset)===F.field.start&&Math.max(L.anchor.offset,L.head.offset)===F.field.end;for(let q of e.pagesLayer.querySelectorAll('[data-field-atom="form"][data-start]')){let X=q.closest("[data-paragraph-id]")?.dataset.paragraphId,D=Number(q.dataset.start);!!F&&X===F.paragraphId&&D>=F.field.start&&D<F.field.end?q.dataset.textFormSelection=B?"whole":"caret":delete q.dataset.textFormSelection;}if(Z.dataset.fieldError){Z.textContent=n("textFormField.invalidValue");return}F?Z.setAttribute("role","status"):Z.removeAttribute("role"),Z.textContent=F?n(B?"textFormField.selected":"textFormField.editing"):"";},fieldId:()=>U()?.field.fieldNodeId??null,afterApply(F){F?c():u();},restoreAfterHistory:u,annotate(F){(!a||F.some(B=>B.op!=="commitTextFormField"))&&c(),F.some(B=>B.op==="insertText"||B.op==="deleteText")&&delete Z.dataset.fieldError;let L=U();return S=L?{paragraphId:L.paragraphId,fieldNodeId:L.field.fieldNodeId}:null,F.map(B=>{if(!S||B.op!=="insertText"&&B.op!=="deleteText"||B.revision||B.paragraphId!==S.paragraphId||!e.protected(B.paragraphId))return B;let q=chunkFIJZIQXA_cjs.Ta(e.part(),B.paragraphId),X=q?.kind==="paragraph"?chunkFIJZIQXA_cjs.hj(q).find(z=>z.fieldNodeId===S.fieldNodeId):null,D=B.op==="insertText"?B.offset:B.start,j=B.op==="insertText"?B.offset:B.end;return !X||D<X.start||j>X.end?B:(i.has(X.fieldNodeId)||i.set(X.fieldNodeId,{text:g(B.paragraphId,X),locale:e.locale?.()??"en-US"}),{...B,textFormFieldId:X.fieldNodeId})})},keydown(F){if(F.key==="F10"&&F.shiftKey&&!F.altKey&&!F.ctrlKey&&!F.metaKey)return o=void 0,F.preventDefault(),e.pagesLayer.dispatchEvent(new MouseEvent("contextmenu",{bubbles:true,cancelable:true,button:-1})),true;if(F.key!=="Tab"||F.altKey||F.ctrlKey||F.metaKey||!e.editable()||!e.protected(e.selection().head.paragraphId))return false;let L=[],B=[e.part().root];for(;B.length;){let re=B.pop();if(re.kind==="paragraph")for(let ee of chunkFIJZIQXA_cjs.hj(re))e.protected(re.id)&&ee.enabled&&chunkFIJZIQXA_cjs.Si(ee)&&!chunkFIJZIQXA_cjs.Wk(e.part(),{op:"insertText",paragraphId:re.id,offset:ee.start,text:"x"})&&L.push({paragraphId:re.id,field:ee});else for(let ee=re.children.length-1;ee>=0;ee--){let ie=re.children[ee];ie.kind!=="textValue"&&B.push(ie);}}if(!L.length)return false;let q=e.selection(),X=q.head,D=S?L.findIndex(re=>re.paragraphId===S.paragraphId&&re.field.fieldNodeId===S.fieldNodeId&&re.field.start<=Math.min(q.anchor.offset,X.offset)&&re.field.end>=Math.max(q.anchor.offset,X.offset)):-1,j=D>=0?D:L.findIndex(re=>re.paragraphId===X.paragraphId&&re.field.start<=Math.min(q.anchor.offset,X.offset)&&re.field.end>=Math.max(q.anchor.offset,X.offset)),z=j<0?F.shiftKey?L.length-1:0:(j+(F.shiftKey?-1:1)+L.length)%L.length,ne=L[z];return F.preventDefault(),R(ne.paragraphId,ne.field,"travel"),true},destroy(){I=true,k(),Bd.get(e.container)===m&&Bd.delete(e.container),_d.get(e.container)===h&&_d.delete(e.container),r.removeEventListener("pointermove",W),r.removeEventListener("pointercancel",E),e.pagesLayer.removeEventListener("click",_),e.pagesLayer.removeEventListener("contextmenu",pe),Z.remove(),e.pagesLayer.removeEventListener("dblclick",G),e.pagesLayer.removeEventListener("pointerdown",V,{capture:true}),b?.remove(),b=null;}}}function qk(e,t,n,r=o=>o){let o,a=e.subscribe(i=>{for(let s of i.splitJoin)"split"in s&&s.split.from===t&&(o=s.split.tail);});try{n(()=>{let i=o&&r(o,t);if(!i)return null;let s={paragraphId:i,offset:0};return {anchor:s,head:s}});}finally{a();}}var $d=new WeakMap;function vs(e){let t=$d.get(e);if(t)return t.settled??=new Promise(n=>{t.resolve=n;}),t.settled}function Vk(e){let t=$d.get(e)??{depth:0};return t.depth++,$d.set(e,t),()=>{--t.depth===0&&($d.delete(e),t.resolve?.());}}async function Kk(e,t,n){if(!e)throw sn("notFound","no document is loaded");let r=t?vs(t):void 0;if(r&&(await r,n()!==e))throw sn("invalidState","The document changed before the pending save could finish.");return e.save().slice().buffer}function Wk(e,t,n){let r=()=>{if(n())throw sn("destroyed","Cannot save a destroyed surface.")};if(r(),vs(t))throw sn("invalidState","Cannot save during an active edit. Retry after the edit finishes.");e.flushPendingInput(),r();let o=Bk(t);if(o)throw sn(o,"Cannot save pending text form input. Enter a valid value in each field.");r(),e.refreshRefFieldResults(),r();let a=qn(t);to(t,true);try{return e.session.save()}finally{to(t,a);}}function qd(e,t,n){let r=false;return t(()=>{let o=n([e]);return r=!o.rejected,o}),r}function jk(e,t,n){let r=n.refusal();if(r)return r;let o=new Map;for(let i of e){if(i.op!=="commitTextFormField")return "invalidArgs";let s=kt(n.session,i.paragraphId,{kind:"body"}),l=JSON.stringify(s),d=o.get(l)??{scope:s,ops:[]};d.ops.push(i),o.set(l,d);}for(let i of o.values()){let s=n.gate(i.ops,i.scope);if(s)return s}if(n.collaborationActive)return "unsupported";let a;return n.commit(()=>a=n.session.applyTreeOpsAtomic([...o.values()]),()=>t),a?.rejected?a.reason??"invalidArgs":null}function Zk(e,t){let n=chunkFIJZIQXA_cjs.Ni(e);return {get:()=>n,set(r){let o=chunkFIJZIQXA_cjs.Ni(r);n!==o&&(t(),n=o);}}}var BN=42,$N=/^(\d{4})-(\d{2})-(\d{2})/,qN=new Set(["AG","AS","BD","BR","BS","BT","BW","BZ","CA","CO","DM","DO","ET","GT","GU","HK","HN","ID","IL","IN","JM","JP","KE","KH","KR","LA","MH","MM","MO","MT","MX","MZ","NI","NP","PA","PE","PH","PK","PR","PT","PY","SA","SG","SV","TH","TT","TW","UM","US","VE","VI","WS","YE","ZA","ZW"]),VN=new Set(["AE","AF","BH","DJ","DZ","EG","IQ","IR","JO","KW","LY","OM","QA","SD","SY"]);function $o(e){return `${String(e.getFullYear()).padStart(4,"0")}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Cr(e){let t=$N.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),o=Number(t[3]);if(r<1||r>12||o<1||o>31)return null;let a=new Date(n,r-1,o);return a.getFullYear()!==n||a.getMonth()!==r-1||a.getDate()!==o?null:a}function Vd(e){let t=chunkFIJZIQXA_cjs.Ni(e);try{let n=new Intl.Locale(t),r=n,o=r.getWeekInfo?.().firstDay??r.weekInfo?.firstDay;if(typeof o=="number"&&o>=1&&o<=7)return o%7;let a=n.maximize().region;if(a&&qN.has(a))return 0;if(a&&VN.has(a))return 6}catch{}return 1}function zk(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Uk(e,t,n){return new Intl.DateTimeFormat(chunkFIJZIQXA_cjs.Ni(n),{calendar:"gregory",month:"long",year:"numeric"}).format(new Date(e,t,1))}function Gk(e){let t=chunkFIJZIQXA_cjs.Ni(e),n=new Intl.DateTimeFormat(t,{calendar:"gregory",weekday:"narrow"}),r=Vd(t);return Array.from({length:7},(o,a)=>n.format(new Date(2024,0,7+(r+a)%7)))}function dm(e,t,n={}){let r=chunkFIJZIQXA_cjs.Ni(n.locale),o=n.selected?Cr(n.selected):null,a=n.today??new Date,i=new Intl.DateTimeFormat(r,{calendar:"gregory",weekday:"long",year:"numeric",month:"long",day:"numeric"}),s=Vd(r),l=(new Date(e,t,1).getDay()-s+7)%7,d=[];for(let c=0;c<BN;c+=1){let u=new Date(e,t,c-l+1);d.push({iso:$o(u),day:u.getDate(),label:i.format(u),otherMonth:u.getMonth()!==t,selected:o!==null&&zk(u,o),today:zk(u,a)});}return {year:e,month:t,title:Uk(e,t,r),weekdays:Gk(r),days:d}}function Kd(e,t,n){let r=new Date(e,t+n,1);return {year:r.getFullYear(),month:r.getMonth()}}function cm(e,t,n,r=false){let o=Cr(e);if(!o)return null;let a={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7},i=(o.getDay()-Vd(n)+7)%7;if(t==="PageUp"||t==="PageDown"){let s=o.getDate();o.setDate(1),o.setMonth(o.getMonth()+(t==="PageUp"?-1:1)*(r?12:1));let l=new Date(o.getFullYear(),o.getMonth()+1,0).getDate();o.setDate(Math.min(s,l));}else {let s=t==="Home"?-i:t==="End"?6-i:a[t];if(s===void 0)return null;o.setDate(o.getDate()+s);}return o.getFullYear()>=100&&o.getFullYear()<=9999?$o(o):null}function Wd(e,t){let n=Cr(e);if(!n)return "";let r=chunkFIJZIQXA_cjs.Ni(t),o=new Intl.NumberFormat(r,{useGrouping:false}).format(0);return new Intl.DateTimeFormat(r,{calendar:"gregory",year:"numeric",month:"numeric",day:"numeric"}).formatToParts(n).map(a=>a.type==="year"?a.value.padStart(4,o):a.value).join("")}function um(e,t){if(e.length>100)return null;let n=e.trim();if(/^\d{4}-\d{2}-\d{2}$/.test(n)){let s=Cr(n);return s?$o(s):null}let r=chunkFIJZIQXA_cjs.Oi(chunkFIJZIQXA_cjs.Ni(t)),o=r.pattern.exec(chunkFIJZIQXA_cjs.Pi(n,r));if(!o)return null;let a={year:"",month:"",day:""};if(r.order.forEach((s,l)=>{a[s]=o[l+1];}),a.year.length!==4)return null;let i=`${a.year}-${a.month.padStart(2,"0")}-${a.day.padStart(2,"0")}`;return Cr(i)?i:null}function fm(e){let t=new Intl.DateTimeFormat(chunkFIJZIQXA_cjs.Ni(e),{calendar:"gregory",month:"long"});return Array.from({length:12},(n,r)=>t.format(new Date(2e3,r,1)))}function pm(e){let t="",n=0,r=new Intl.Collator(chunkFIJZIQXA_cjs.Ni(e),{usage:"search",sensitivity:"base"});return {reset(){t="",n=0;},keyDown(o,a){if(o.defaultPrevented||o.isComposing||o.altKey||o.ctrlKey||o.metaKey)return;let i=o.target.tagName==="INPUT",s=[...a.querySelectorAll('[role="option"]')].filter(c=>!c.hasAttribute("disabled"));if(!s.length)return;let l=s.indexOf(a.ownerDocument.activeElement),d;if(o.key==="ArrowDown")d=Math.min(s.length-1,l+1);else if(o.key==="ArrowUp")d=l<0?s.length-1:Math.max(0,l-1);else if(!i&&o.key==="Home")d=0;else if(!i&&o.key==="End")d=s.length-1;else if(!i&&o.key.length===1&&o.key!==" "){let c=Date.now();t=c-n>700?o.key:(t+o.key).slice(-100),n=c;let u=[...t].every(p=>r.compare(p,o.key)===0)?o.key:t;for(let p=1;p<=s.length;p++){let m=(Math.max(-1,l)+p)%s.length;if(r.compare((s[m].textContent??"").slice(0,u.length),u)===0){d=m;break}}}d!==void 0&&(o.preventDefault(),s.forEach((c,u)=>{c.tabIndex=u===d?0:-1;}),s[d]?.focus({preventScroll:true}),s[d]?.scrollIntoView?.({block:"nearest"}));}}}var KN=0;function Xk(e,t){let n=e.document.createElement("div");n.className="docx-content-control-menu",n.dataset.docxMarker="",n.dataset.docxPart="popup",n.addEventListener("keydown",r=>ys(n,r,()=>e.close(n))),n.dataset.docxCcId=t,n.setAttribute("contenteditable","false"),n.style.position="absolute",n.style.zIndex="20",n.style.pointerEvents="auto",n.addEventListener("pointerdown",r=>r.stopPropagation());for(let r of ["keydown","beforeinput","input","compositionstart","compositionupdate","compositionend","copy","cut","paste"])n.addEventListener(r,o=>o.stopPropagation());return n}function Yk(e,t,n){if(!n){t.append(e);return}e.style.left=`${n.left}px`,e.style.top=`${n.top}px`;let r=n.element?t.closest(".docx-editor__scroll-container")??t.parentElement??t:t;if(r.append(e),n.element){let i=hs(e,n.element),s=new MutationObserver(()=>{e.isConnected||(i(),s.disconnect());});s.observe(r,{childList:true});return}let o=e.offsetWidth;if(o<=0)return;let a=n.left+o-n.sheetRight;a>0&&(e.style.left=`${Math.max(n.sheetLeft,n.left-a)}px`);}function jd(e,t,n,r){if(e.setValue(n,r))return e.close(t),true;let o=t.querySelector("[data-docx-part=error]");return o||(o=e.document.createElement("div"),o.dataset.docxPart="error",o.className="docx-content-control-widget-error",o.setAttribute("role","alert"),t.append(o)),o.hidden=false,o.textContent=bn(e.translate)("disabledReason.invalidValue"),false}function Qk(e,t,n,r,o,a){let i=Xk(e,t),s=bn(e.translate);i.setAttribute("role","dialog"),i.setAttribute("aria-label",o||s(`contentControl.types.${n}`));let l=e.document.createElement("div");l.className="docx-content-control-menu-list",l.dataset.docxPart="list",l.id=`docx-engine-cc-list-${++KN}`,l.setAttribute("role","listbox"),l.setAttribute("aria-label",o||s(`contentControl.types.${n}`));let d=pm(e.locale());i.addEventListener("keydown",u=>d.keyDown(u,i));let c=r.findIndex(u=>u.value===a);for(let[u,p]of r.entries()){let m=e.document.createElement("button");m.type="button",m.className="docx-content-control-menu-item",m.dataset.docxPart="item",m.dataset.value=p.value,m.setAttribute("role","option"),m.setAttribute("aria-selected",String(p.value===a)),m.tabIndex=u===Math.max(0,c)?0:-1,m.textContent=p.displayText,m.addEventListener("click",()=>{jd(e,i,t,p.value);}),l.append(m);}if(n==="buildingBlockGallery"&&r.length===0){let u=e.document.createElement("div");u.className="docx-content-control-menu-empty",u.dataset.docxPart="empty",u.setAttribute("role","note"),u.tabIndex=0,u.textContent=s("contentControl.gallery.empty"),l.append(u);}if(n==="comboBox"){let u=e.document.createElement("input");u.type="text",u.className="docx-content-control-menu-input",u.dataset.docxPart="input",u.value=a??"",u.setAttribute("aria-label",o||s("contentControl.types.comboBox")),u.setAttribute("aria-autocomplete","list"),u.setAttribute("role","combobox"),u.setAttribute("aria-expanded","true"),u.setAttribute("aria-controls",l.id),u.addEventListener("keydown",m=>{m.key!=="Enter"||m.isComposing||(m.preventDefault(),jd(e,i,t,u.value));}),i.append(u);let p=e.document.createElement("div");p.className="docx-dialog__footer",p.dataset.docxPart="footer";for(let m of ["cancel","apply"]){let h=e.document.createElement("button");h.type="button",h.className=`docx-dialog__button${m==="apply"?" docx-dialog__button--primary":""}`,h.dataset.docxPart=m,h.textContent=s(`common.${m}`),h.addEventListener("click",()=>{m==="apply"?jd(e,i,t,u.value):e.close(i);}),p.append(h);}i.append(l,p);}else i.append(l);return i}function Zd(e,t){let n=(t?e.querySelector(`[data-iso="${t}"]`):null)??e.querySelector("[data-selected]")??e.querySelector("[data-today]:not([data-other-month])")??e.querySelector(".docx-content-control-calendar-day:not([data-other-month])");for(let r of e.querySelectorAll("[data-iso]"))r.tabIndex=r===n?0:-1;n?.focus({preventScroll:true});}function Jk(e,t,n,r){let o=bn(e.translate),a=Xk(e,t);a.classList.add("docx-content-control-calendar"),a.setAttribute("role","dialog"),a.setAttribute("aria-label",r||o("contentControl.types.date"));let i=n?Cr(n):null,s=i?$o(i):null,l=new Date,d={year:(i??l).getFullYear(),month:(i??l).getMonth()},c=null,u=Wd(s??"",e.locale()),p=b=>{jd(e,a,t,b);},m=b=>{b.addEventListener("mousedown",S=>S.stopPropagation());},h=e.document.createElement("div");h.className="docx-content-control-calendar-title docx-content-control-calendar-announcement",h.dataset.docxPart="title",h.setAttribute("aria-live","polite");let y=()=>{let b=e.document.activeElement?.dataset.docxCalendarNav,S=dm(d.year,d.month,{locale:e.locale(),selected:s,today:l}),x=e.document.createElement("div");x.className="docx-content-control-calendar-header",x.dataset.docxPart="header";let I=e.document.createElement("button");I.type="button",I.className="docx-content-control-calendar-nav",I.dataset.docxPart="previousMonth",I.dataset.docxCalendarNav="previous",I.textContent="\u2039",I.setAttribute("aria-label",o("contentControl.calendar.previousMonth")),h.textContent=S.title;let M=e.document.createElement("button");M.type="button",M.className="docx-content-control-calendar-nav",M.dataset.docxPart="nextMonth",M.dataset.docxCalendarNav="next",M.textContent="\u203A",M.setAttribute("aria-label",o("contentControl.calendar.nextMonth")),m(I),m(M),I.addEventListener("click",()=>{d=Kd(d.year,d.month,-1),c=null,y();}),M.addEventListener("click",()=>{d=Kd(d.year,d.month,1),c=null,y();});let k=e.document.createElement("div");k.className="docx-content-control-calendar-navigation",k.dataset.docxPart="navigation";let P=e.document.createElement("select");P.className="docx-content-control-calendar-month",P.dataset.docxPart="month",P.dataset.docxCalendarNav="month",P.setAttribute("aria-label",o("contentControl.calendar.month"));for(let[G,U]of fm(e.locale()).entries()){let $=e.document.createElement("option");$.value=String(G),$.textContent=U,P.append($);}P.value=String(d.month);let R=e.document.createElement("input");R.type="number",R.min="100",R.max="9999",R.value=String(d.year),R.className="docx-content-control-calendar-year",R.dataset.docxPart="year",R.dataset.docxCalendarNav="year",R.addEventListener("keydown",G=>{G.key==="Enter"&&!G.isComposing&&(G.preventDefault(),R.blur());}),R.setAttribute("aria-label",o("contentControl.calendar.year")),P.addEventListener("change",()=>{d.month=Number(P.value),c=null,y();}),R.addEventListener("change",()=>{let G=Number(R.value);if(!Number.isInteger(G)||G<100||G>9999){R.value=String(d.year);return}d.year=G,c=null,y();}),k.append(P,R);let w=e.document.createElement("div");w.className="docx-content-control-calendar-weekdays",w.dataset.docxPart="weekdays";for(let G of S.weekdays){let U=e.document.createElement("span");U.textContent=G,w.append(U);}let O=e.document.createElement("div");O.className="docx-content-control-calendar-grid",O.dataset.docxPart="grid",O.setAttribute("role","grid"),O.setAttribute("aria-label",S.title);for(let G=0;G<S.days.length;G+=7){let U=e.document.createElement("div");U.className="docx-content-control-calendar-week",U.setAttribute("role","row");for(let $ of S.days.slice(G,G+7))U.append(g($));O.append(U);}let N=e.document.createElement("div");N.className="docx-content-control-calendar-entry",N.dataset.docxPart="dateEntry";let A=e.document.createElement("button");A.type="button",A.className="docx-content-control-calendar-today",A.dataset.docxPart="today",A.textContent=o("contentControl.calendar.today"),m(A),A.addEventListener("click",()=>p($o(l)));let V=e.document.createElement("input");V.type="text",V.className="docx-content-control-menu-input",V.dataset.docxPart="input",V.setAttribute("aria-label",o("contentControl.types.date")),V.placeholder=Wd("2006-11-22",e.locale()),V.value=u,V.addEventListener("input",()=>{u=V.value,V.removeAttribute("aria-invalid"),W.hidden=true;});let W=e.document.createElement("div");W.className="docx-content-control-widget-error",W.dataset.docxPart="error",W.setAttribute("role","alert"),W.hidden=true,W.textContent=o("disabledReason.invalidValue");let E=()=>{let G=um(u,e.locale());G?p(G):(W.hidden=false,V.setAttribute("aria-invalid","true"),V.focus());};V.addEventListener("keydown",G=>{G.key==="Enter"&&!G.isComposing&&(G.preventDefault(),E());});let _=e.document.createElement("div");_.className="docx-dialog__footer",_.dataset.docxPart="footer";for(let G of ["cancel","apply"]){let U=e.document.createElement("button");U.type="button",U.dataset.docxPart=G,U.className=`docx-dialog__button${G==="apply"?" docx-dialog__button--primary":""}`,U.textContent=o(`common.${G}`),U.addEventListener("click",G==="apply"?E:()=>e.close(a)),_.append(U);}x.append(I,k,M,h),N.append(A,V),a.replaceChildren(x,w,O,N,W,_),Zd(a,c),b==="previous"&&I.focus({preventScroll:true}),b==="next"&&M.focus({preventScroll:true}),b==="month"&&P.focus({preventScroll:true}),b==="year"&&R.focus({preventScroll:true});},g=b=>{let S=e.document.createElement("button");return S.type="button",S.className="docx-content-control-calendar-day",S.dataset.docxPart="day",S.textContent=String(b.day),S.dataset.iso=b.iso,S.setAttribute("role","gridcell"),S.setAttribute("aria-label",b.label),b.otherMonth&&(S.dataset.otherMonth=""),b.selected&&(S.dataset.selected="",S.setAttribute("aria-selected","true")),S.setAttribute("aria-selected",String(b.selected)),b.today&&(S.dataset.today="",S.setAttribute("aria-current","date")),m(S),S.addEventListener("click",()=>p(b.iso)),S.addEventListener("keydown",x=>{if(x.isComposing||x.altKey||x.ctrlKey||x.metaKey)return;let I=cm(b.iso,x.key,e.locale(),x.shiftKey);if(!I)return;x.preventDefault();let M=Cr(I);if(c=I,M.getFullYear()!==d.year||M.getMonth()!==d.month){d={year:M.getFullYear(),month:M.getMonth()},y();return}Zd(a,c);}),S};return y(),a}function mm(e,t){let r=(t instanceof Element?t:null)?.closest("[data-docx-form-checkbox][data-start]"),o=r?.closest("[data-paragraph-id]")?.dataset.paragraphId;if(!r||!o)return null;let a=chunkFIJZIQXA_cjs.Ta(e.part(o),o);if(a?.kind!=="paragraph")return null;let i=Number(r.dataset.start),s=chunkFIJZIQXA_cjs.jj(a).find(l=>l.start<=i&&i<l.end);return s?{paragraphId:o,field:s}:null}function eR(e){return e.shiftKey||e.altKey||e.ctrlKey||e.metaKey}function tR(e){let t=(a,i)=>{if(!e.editable()||!i.enabled)return false;let s=e.apply({op:"setLegacyCheckbox",paragraphId:a,fieldNodeId:i.fieldNodeId,checked:!i.checked});return s&&(e.pagesLayer.focus({preventScroll:true}),e.select({anchor:{paragraphId:a,offset:i.start},head:{paragraphId:a,offset:i.end}})),s},n=a=>{if(a.button!==0||eR(a))return;let i=mm(e,a.target);!i||!e.editable()||!i.field.enabled||(a.preventDefault(),a.stopPropagation(),t(i.paragraphId,i.field));};e.pagesLayer.addEventListener("pointerdown",n,{capture:true});let r=a=>{let i=mm(e,a.target);i&&a.target instanceof HTMLElement&&a.target.setAttribute("aria-disabled",String(!e.editable()||!i.field.enabled));};e.pagesLayer.addEventListener("focusin",r);let o=()=>{let a=e.selection();if(a.anchor.paragraphId!==a.head.paragraphId)return null;let i=a.head.paragraphId,s=chunkFIJZIQXA_cjs.Ta(e.part(i),i);if(s?.kind!=="paragraph")return null;let l=Math.min(a.anchor.offset,a.head.offset),d=Math.max(a.anchor.offset,a.head.offset),c=chunkFIJZIQXA_cjs.jj(s).find(u=>u.start===l&&u.end===d||l===d&&l===u.start&&e.protected(i));return c?{paragraphId:i,field:c}:null};return {keydown(a){let i=mm(e,a.target);if(i&&a.key==="Tab")return true;if(i&&a.key.length===1&&a.key!==" "&&!a.ctrlKey&&!a.metaKey&&!a.altKey)return a.preventDefault(),true;if(a.key!==" "||eR(a)||a.isComposing)return false;let s=i??o();if(!s)return false;if(!e.editable()||!s.field.enabled)return i?(a.preventDefault(),true):false;a.preventDefault();let l=t(s.paragraphId,s.field);return i&&l&&[...e.pagesLayer.querySelectorAll("[data-docx-form-checkbox][data-start]")].find(d=>d.dataset.paragraphId===s.paragraphId&&Number(d.dataset.start)===s.field.start)?.focus({preventScroll:true}),true},destroy(){e.pagesLayer.removeEventListener("pointerdown",n,{capture:true}),e.pagesLayer.removeEventListener("focusin",r);}}}var WN=new Set(["insertText","deleteText","insertTab","insertHardBreak","insertPageBreak","insertPageField","insertNote","insertTable","insertTableRow","deleteTableRow","setRunProperties","setParagraphProperties","setParagraphMarkProperties"]);function gm(e){return WN.has(e.op)}function hm(e){if(gm(e))return e.revision!==void 0;switch(e.op){case "setParagraphMarkRevision":case "proposeParagraphMerge":return true;case "insertContentControl":case "authorTable":case "setListNumbering":case "setListLevel":case "splitParagraphMany":return e.revision!==void 0;default:return false}}function ym(e){return e?.trim()||void 0}function nR(e){let t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.slice(0,2).map(n=>n[0].toUpperCase()).join("")}function rR(e){return e==="suggesting needs an author before it can propose a change"||e==="tracked changes need a non-empty author"}function Na(e,t,n){if(!e)return null;let r=chunk4GBTELJV_cjs.fe(e,t);return !r||r.record.paragraphId!==n?null:{paragraphId:n,offset:r.record.start}}var oR="docx-field-atom--active",jN="docx-field-atom",aR=new WeakMap;function bm(e,t,n){let r=aR.get(e);r||(r={caretKey:null,marked:[]},aR.set(e,r));let o=t?`${t.paragraphId}\0${t.offset}`:null;if(!n?.domReplaced&&o===r.caretKey)return;for(let i of r.marked)i.classList.remove(oR);if(r.marked=[],r.caretKey=o,!t)return;let a=e.querySelectorAll(`.${jN}`);for(let i of a){if(i.dataset.paragraphId!==t.paragraphId)continue;let s=Number(i.dataset.fieldResultStart??i.dataset.start),l=Number(i.dataset.fieldResultEnd??i.dataset.end);!Number.isFinite(s)||!Number.isFinite(l)||t.offset<s||t.offset>l||(i.classList.add(oR),r.marked.push(i));}}var ZN={kind:"body"};function iR(e){let{session:t}=e;if(e.editingMode==="view"||!t.editable)return true;if(e.collaborationActive)return false;let n,r=e.reviewerFilterActive?l=>(n??=chunk6APGXLBB_cjs.T(e.canonicalUnfilteredLayout()),n(l)):chunk6APGXLBB_cjs.T(e.layout),o={package:t.currentPackage(),styleCascade:e.styleCascade,numberingIndex:e.numberingIndex,displayMode:e.displayMode,pageRefPageNumberOf:r},a=chunk6APGXLBB_cjs.U(t.part(),o),i=chunk6APGXLBB_cjs.V(t.part(),o);if(!a&&i.length===0)return true;let s=[];a&&s.push({scope:ZN,ops:[a]});for(let l of i)s.push({scope:{kind:"notesPart",noteKind:l.noteKind},ops:[l.op]});return t.applyTreeOpsAtomic(s).committed}function lR(e){let t=0,n=null,r="",o=null,a=true,i=null,s="";return ()=>{let l=e.surface(),d=`${l?.session.packageRevision()??-1}:${l?.session.revision()??-1}`,c=e.activeKey(),u=e.paneOpen(),p=e.selectionAnchor(),m=e.authorFilterKey();return (l!==n||d!==r||c!==o||u!==a||p!==i||m!==s)&&(n=l,r=d,o=c,a=u,i=p,s=m,t+=1),t}}function zd(e=[]){let t=new Set(e),n=Object.freeze([...t]),r=chunk4GBTELJV_cjs.ab(t),o=null,a="accept",i=null,s="accept",l=new WeakMap,d=null,c=false,u=0,p=null,m=[],h=null,y=[],g=r,b=t,S=new Set,x="accept",I=new WeakSet,M=new WeakMap,k=new Map,P=()=>{u+=1,p=null,m=[],h=null;},R=N=>JSON.stringify([N.id,chunkFIJZIQXA_cjs.wj(N)]),w=(N,A,V)=>{let W=zN(V),E=t,_=r?.hiddenAuthors??chunk4GBTELJV_cjs.$a,G=a,U;E===b&&UN(W,S)&&(W.size===0||G===x)?U=g:W.size===0&&E.size===0?U=void 0:U=Object.freeze({hiddenAuthors:_,includes:pe=>!E.has(pe.author)&&!W.has(pe.nodeId),includesNode:(pe,he)=>!E.has(he)&&!W.has(pe),excludedNodeMode:(pe,he)=>E.has(he)?"proposed":W.has(pe)&&G==="reject"?"original":"proposed",cacheKey:GN(E,W,G)});let $=[];for(let pe of N){let he=sR(pe);he!==null&&E.has(he)||pe.kind==="revision"&&A.has(pe)||$.push(pe);}y=$.length===N.length?N:chunkFIJZIQXA_cjs.ik($),h=N,I=A,g=U,b=E,S=W,x=G,c=false,i=null,s="accept",l=new WeakMap,d=null;},O=N=>{if(N===h)return;let A=new WeakSet,V=[],W=[];try{for(let _ of N){if(_.kind!=="revision")continue;let G=!t.has(_.author),U=M.get(_);U===void 0&&(U=o?.(_)??!0,W.push([_,U])),!(G&&U)&&(A.add(_),U||V.push(_));}}catch(_){if(c)o=i,a=s,M=l,h=d,i=null,s="accept",l=new WeakMap,d=null,u+=1;else {let G=new WeakSet,U=[];for(let $ of N){if($.kind!=="revision")continue;let pe=k.get(R($))??true;(t.has($.author)||!pe)&&G.add($),pe||U.push($);}w(N,G,U);}throw c=false,_}for(let[_,G]of W)M.set(_,G);let E=new Map;for(let _ of N)_.kind==="revision"&&E.set(R(_),M.get(_)??true);k=E,w(N,A,V);};return {get hiddenAuthors(){return r?.hiddenAuthors??chunk4GBTELJV_cjs.$a},get hiddenAuthorList(){return n},get stateKey(){return String(u)},get hasFilter(){return t.size>0||o!==null},filterFor(N){return o?(O(N),g):r},filterForSession(N){return o?(O(N.reviewItems()),g):r},filterItems(N){if(!o){if(t.size===0)return N;if(N===p)return m;let A=N.filter(V=>{let W=sR(V);return W===null||!t.has(W)});return p=N,m=A.length===N.length?N:chunkFIJZIQXA_cjs.ik(A),m}return O(N),y},includesRevisionItem(N){return !I.has(N)},setPredicate(N,A="accept"){return o===null&&N===null?false:N===null?(o=null,a="accept",i=null,s="accept",c=false,M=new WeakMap,l=new WeakMap,k=new Map,d=null,y=[],I=new WeakSet,g=r,b=t,S=new Set,x="accept",P(),true):(i=o,s=a,l=M,d=h,c=true,o=N,a=A,M=new WeakMap,P(),true)},isVisible:N=>!t.has(N),setVisible(N,A){if(A===!t.has(N))return false;let V=new Set(t);return A?V.delete(N):V.add(N),t=V,n=Object.freeze([...V]),r=chunk4GBTELJV_cjs.ab(V),P(),true},setAllVisible(N,A){let V=A?new Set:new Set(N);return V.size===t.size&&[...V].every(W=>t.has(W))?false:(t=V,n=Object.freeze([...V]),r=chunk4GBTELJV_cjs.ab(V),P(),true)},showAll(){return t.size===0?false:(t=new Set,n=Object.freeze([]),r=void 0,P(),true)}}}function vm(e,t){return t.filterItems(e)}function zN(e){let t=new Set;for(let n of e)for(let r of chunkFIJZIQXA_cjs.wj(n))t.add(r);return t}function UN(e,t){if(e.size!==t.size)return false;for(let n of e)if(!t.has(n))return false;return true}function GN(e,t,n){return JSON.stringify({hiddenAuthors:[...e].sort(),excludedNodeIds:[...t].sort(),mode:t.size===0?"accept":n})}function sR(e){return e.kind==="comment"?e.comment?.author??"":e.author??null}function dR(e,t){let n=r=>{if(!t.enabled)return;let o=t.surface();if(o)return o.setAllRevisionAuthorsVisible(r);!r||!e.showAll()||t.notify();};return {isReviewAuthorVisible:e.isVisible,setReviewAuthorVisible(r,o){if(!t.enabled)return;let a=t.surface();if(a)return a.setRevisionAuthorVisible(r,o);e.setVisible(r,o)&&t.notify();},setAllReviewAuthorsVisible:n,showAllReviewAuthors:()=>n(true)}}var XN=Object.freeze({mode:"atomic",run:e=>e(),wrap:e=>e,methods:e=>e,listeners:()=>{},selectsWholeFieldWhen:()=>{},edits:e=>e});function YN(e){if(e===void 0||e==="atomic")return "atomic";if(e==="editable")return "editable";throw new TypeError('Invalid fieldResults: use "atomic" or "editable"')}var QN='fieldResults "editable" is not supported in a collaboration session: shared paragraph text keeps each field one unit';function JN(e){if(e==="atomic")return XN;let t=o=>chunkFIJZIQXA_cjs.kf(e,o),n=o=>function(...a){return t(()=>o.apply(this,a))},r=()=>false;return {mode:e,run:t,wrap:n,selectsWholeFieldWhen(o){r=o;},edits:o=>function(...a){return r()?chunkFIJZIQXA_cjs.lf(()=>o.apply(this,a)):o.apply(this,a)},methods(o){for(let a of Reflect.ownKeys(o)){let i=Object.getOwnPropertyDescriptor(o,a);if(i?.configurable){if(typeof i.value=="function")i.value=n(i.value);else if(i.get||i.set)i.get&&(i.get=n(i.get)),i.set&&(i.set=n(i.set));else continue;Object.defineProperty(o,a,i);}}return o},listeners(o){let a=o.addEventListener,i=o.removeEventListener,s=new WeakMap,l=d=>{let c=s.get(d);return c||(c=typeof d=="function"?function(u){return t(()=>d.call(this,u))}:u=>t(()=>d.handleEvent(u)),s.set(d,c)),c};Object.defineProperty(o,"addEventListener",{configurable:true,writable:true,value(d,c,u){c&&a.call(o,d,l(c),u);}}),Object.defineProperty(o,"removeEventListener",{configurable:true,writable:true,value(d,c,u){c&&i.call(o,d,s.get(c)??c,u);}});}}}function cR(e,t){if(t.mode==="atomic")return e;let n=e,r=n.subscribe.bind(n),o=n.applyTreeOps.bind(n),a=n.applyTreeOpsAtomic.bind(n);return n.subscribe=i=>r(t.wrap(i)),n.applyTreeOps=t.edits(o),n.applyTreeOpsAtomic=t.edits(a),t.methods(e)}function Ud(e){let t=YN(e.fieldResults);if(t==="editable"&&e.collaborationModel)throw new TypeError(QN);return JN(t)}function Gd(e,t){let n=e.part(t),r=n?chunkFIJZIQXA_cjs.Ta(n,t):null;return r?.kind!=="paragraph"?[]:chunkFIJZIQXA_cjs.Ki(r).filter(o=>o.start<o.end)}function eD(e,t){return Gd(e,t.paragraphId).find(n=>t.offset>n.start&&t.offset<n.end)}function tD(e,t){let n=(a,i)=>{let s=eD(e,a);if(!s||i.paragraphId===a.paragraphId&&i.offset>=s.start&&i.offset<=s.end)return a;let l=e.compare(i,a)<0?s.end:s.start;return {paragraphId:a.paragraphId,offset:l}},r=n(t.anchor,t.head),o=n(t.head,t.anchor);return r===t.anchor&&o===t.head?t:{anchor:r,head:o}}function nD(e,t){if(t.length!==2)return t;let[n,r]=t;if(n?.op!=="deleteText"||r?.op!=="insertText"||r.paragraphId!==n.paragraphId||n.start>=n.end||r.offset!==n.start&&r.offset!==n.end)return t;let{start:o,end:a}=n,i=Gd(e,n.paragraphId).find(l=>l.start<=o&&a<=l.end);if(!i||o!==i.start&&a!==i.end)return t;let s=r.text.length;return [{...r,offset:o,...o===i.start?{bias:"right"}:{}},{...n,start:o+s,end:a+s}]}function uR(e,t,n){if(n.mode==="atomic")return e;let{selectForDeletion:r,wordDeletionBoundary:o,beforeSelect:a,annotate:i}=e,s=null,l=c=>s!==null&&c.anchor.paragraphId===s.anchor.paragraphId&&c.head.paragraphId===s.head.paragraphId&&c.anchor.offset===s.anchor.offset&&c.head.offset===s.head.offset;n.selectsWholeFieldWhen(()=>l(t.selection()));let d=c=>{let{anchor:u,head:p}=t.selection();if(!(u.paragraphId!==p.paragraphId||u.offset!==p.offset))return Gd(t,p.paragraphId).find(m=>c===-1?m.end===p.offset:m.start===p.offset)};return Object.assign(e,{annotate:n.wrap(c=>i.call(e,l(t.selection())?c:nD(t,c))),selectForDeletion:n.wrap(c=>{let u=t.writable()?d(c==="backward"?-1:1):void 0;if(!u)return r.call(e,c);let{paragraphId:p}=t.selection().head;return s={anchor:{paragraphId:p,offset:u.start},head:{paragraphId:p,offset:u.end}},t.select(s),true}),wordDeletionBoundary:n.wrap((c,u,p,m)=>{let h=o.call(e,c,u,p,m),y=Gd(t,t.selection().head.paragraphId),g=y.find(S=>p===-1?S.end===u:S.start===u);if(g)return p===-1?g.start:g.end;let b=h;for(let S of y)for(let x of [S.start,S.end])p===-1&&x<u&&x>b&&(b=x),p===1&&x>u&&x<b&&(b=x);return b}),beforeSelect:n.wrap(c=>(l(c)||(s=null),a.call(e,tD(t,c))))})}function fR(e,t){let n=false,r=()=>{n=false,t();};return ()=>{if(n)return;n=true;let o=e.defaultView?.requestAnimationFrame;o?o(r):queueMicrotask(r);}}function xm(e){return e.kind==="comment"?e.comment.author:e.kind==="revision"?e.author:null}function pR(e){let t=null;return {get(){let n=e.layout(),r=e.items(),o=e.styles(),a=t;if(a?.layout===n&&a.items===r&&a.styles===o)return a;let i=e.slots.resolve(chunkEO4C5QJW_cjs.d(n),(function*(){for(let p of r){let m=xm(p);m!==null&&(yield m);}})()),s=a?.value,l=s!==void 0&&s.size===i.size&&[...i].every(([u,p])=>s.get(u)===p),d=l?s:i,c=a!==null&&l&&a.styles===o?a.resolved:new Map(chunkEO4C5QJW_cjs.c(d,o).map(u=>[u.author,u]));return t={layout:n,items:r,styles:o,value:d,resolved:c},t},releaseLayout(){t!==null&&(t={...t,layout:null,items:null});}}}function mR(e){let t=null;return {forAuthor(n){let r=e.roster(),o=r.resolved.get(n);if(o)return chunkBTQKU64Q_cjs.a(o.color)??chunkEO4C5QJW_cjs.a(o.slot);let a=e.slots.resolve(r.value,[n]).get(n);return a===void 0?void 0:chunkEO4C5QJW_cjs.a(a)},declaredFor(n){let r=e.styles();return (t===null||t.styles!==r)&&(t={styles:r,resolved:chunkEO4C5QJW_cjs.b(r)}),chunkBTQKU64Q_cjs.a(t.resolved.get(n)?.color)}}}function Da(e){try{return e.createElement("canvas").getContext("2d")}catch{return null}}var gR=new WeakMap;function rD(e){let t=[],n={x:e.box.x,y:e.box.y};for(let r of [e.header,e.footer]){if(!r)continue;let o={x:r.box.x,y:r.box.y};chunk4GBTELJV_cjs.Fa(r,(a,i)=>{i.textboxDepth===0||i.textboxOwner?.accessibility.hidden||t.push(chunk4GBTELJV_cjs.Le(a,i.storyOrigin.x-e.contentBox.x,i.storyOrigin.y-e.contentBox.y));},o,a=>chunk4GBTELJV_cjs.wa(a,o,n));}return t}function qo(e){let t=gR.get(e);if(t)return t;let n=e.pages.map(o=>{let a=chunk4GBTELJV_cjs.xd(o).flatMap(i=>{let s=i.textboxStory;return s.fragments.flatMap(l=>l.kind==="paragraph"?[chunk4GBTELJV_cjs.Le(l,i.x+s.contentOffset.x,i.y+s.contentOffset.y)]:[])});return a.push(...rD(o)),a.length?{...o,fragments:[...o.fragments,...a]}:o}),r=n.every((o,a)=>o===e.pages[a])?e:{...e,pages:n};return gR.set(e,r),r}function yR(e,t,n){let r=t(e.anchor.paragraphId),o=t(e.head.paragraphId);return !r||!o?null:{anchor:{paragraphId:r.paragraphId,offset:Math.max(0,e.anchor.offset)},head:{paragraphId:o.paragraphId,offset:Math.max(0,e.head.offset)},...n?{kind:n}:{}}}function bR(e,t){let n=chunkFIJZIQXA_cjs.Ta(e,t);if(!n||n.kind==="textValue")return null;let r=chunkFIJZIQXA_cjs.wb(n);return !r||!chunkFIJZIQXA_cjs.vb(r)?null:{paragraphId:r.toUpperCase(),nodeId:t,text:""}}var wm=new WeakMap;function oD(e,t,n){return e.map(r=>chunkBTQKU64Q_cjs.a(n?.(r.name))??chunkBTQKU64Q_cjs.a(r.color)??chunkBTQKU64Q_cjs.a(t?.(r.name)))}function aD(e,t){let n="";for(let[r,o]of e.entries())n+=`${o.actorId} ${o.name} ${t[r]??""} ${o.kind??""} `,n+=`${o.anchor.nodeId}:${o.anchor.offset} `,n+=`${o.head.nodeId}:${o.head.offset}
|
|
23
|
-
`;return n}function iD(e){if(!e)return "*";let t=[];for(let n of e)t.push(n);return t.sort((n,r)=>n-r),t.join(",")}function sD(e){if(!e||e.size===0)return "";let t=[];for(let[n,r]of e)t.push(`${n}:${r}`);return t.sort(),t.join(",")}function lD(e,t,n){return e.layout===n.layout&&e.fingerprint===n.fingerprint&&e.pagesKey===n.pagesKey&&e.scale===n.scale&&e.offsetKey===n.offsetKey&&e.labelHost===n.labelHost&&e.childCount===t.childElementCount}function hR(e){return e.anchor.nodeId===e.head.nodeId&&e.anchor.offset===e.head.offset}function dD(e,t){let n=chunk6APGXLBB_cjs.ma(e,t.anchor.nodeId),r=chunk6APGXLBB_cjs.ma(e,t.head.nodeId);if(!n||!r)return [];let o=chunk6APGXLBB_cjs.ea(e,n,r);return o?chunk6APGXLBB_cjs.ia(e,o.cellIds).map(a=>({...a,className:"docx-remote-selection-rect"})):[]}function vR(e,t,n,r){t=qo(t);let{scale:o,pageOffsetX:a,pages:i,colorForAuthor:s,declaredColorFor:l}=r,d=r.labelHost??null,c=oD(n,s,l),u={layout:t,fingerprint:aD(n,c),pagesKey:iD(i),scale:o,offsetKey:sD(a),labelHost:d},p=wm.get(e);if(p&&lD(p,e,u))return;wm.delete(e);let m=[],h=[],y=[],g=[];for(let[I,M]of n.entries())M.kind==="cells"||hR(M)||g.push({key:String(I),from:{paragraphId:M.anchor.nodeId,offset:M.anchor.offset},to:{paragraphId:M.head.nodeId,offset:M.head.offset}});let b=g.length>0?chunk4GBTELJV_cjs.Ae(t,g,chunk4GBTELJV_cjs.Sa(t),i,r.measurer):null;for(let[I,M]of n.entries()){let k=c[I],P=chunk4GBTELJV_cjs.ne(t,{paragraphId:M.head.nodeId,offset:M.head.offset},r.measurer);if(P){let w=chunk4GBTELJV_cjs.ze(t,M.head.nodeId,P.pageIndex);y.push({selection:M,...k?{color:k}:{},pageIndex:P.pageIndex,x:P.x+w.x,y:P.y+w.y});}if(M.kind==="cells"){let w=dD(t,M);if(w.length>0){for(let O of w)m.push(O),h.push(k);continue}}if(hR(M)){let w=chunk4GBTELJV_cjs.ne(t,{paragraphId:M.anchor.nodeId,offset:M.anchor.offset},r.measurer);if(!w)continue;let O=chunk4GBTELJV_cjs.ze(t,M.anchor.nodeId,w.pageIndex);m.push({pageIndex:w.pageIndex,x:w.x+O.x,y:w.y+O.y,width:Math.max(1/o,1),height:w.height,className:"docx-remote-caret"}),h.push(k);continue}let R=b?.get(String(I));if(R)for(let w of R)m.push({...w,className:"docx-remote-selection-rect"}),h.push(k);}chunkEO4C5QJW_cjs.p(e,t,m,{scale:o,pageOffsetX:a}),[...e.children].forEach((I,M)=>{let k=chunkBTQKU64Q_cjs.a(h[M]);!k||!(I instanceof HTMLElement)||I.style.setProperty("--doc-remote-color",k);});let S=e.ownerDocument,x=[];for(let I of y){let M=t.pages[I.pageIndex];if(!M)continue;let k=S.createElement("div");k.className="docx-remote-caret-label",d?(k.setAttribute("data-docx-remote-actor",I.selection.actorId),x.push({element:k,selection:I.selection})):k.textContent=I.selection.name,k.style.left=`${(M.contentBox.x+I.x+(a?.get(I.pageIndex)??0))*o}px`,k.style.top=`${(M.contentBox.y+I.y)*o}px`;let P=chunkBTQKU64Q_cjs.a(I.color);P&&k.style.setProperty("--doc-remote-color",P),e.append(k);}wm.set(e,{...u,childCount:e.childElementCount}),d&&d.publish(x);}function cD(e,t){let n=Math.max(0,e.end-e.start);return e.start+Math.max(0,Math.min(t,n))}var RR=/^[^\s]{1,512}$/,Sm=/["\\\u0000-\u001f\u007f]/;function PR(e,t){return !e||t===void 0||!/^\d{1,9}$/.test(t)||!RR.test(e)||e==="__proto__"?null:{paragraphId:e,offset:Number(t)}}function no(e){let t=PR(e.dataset?.paragraphId,e.dataset?.start);if(!t)return null;let{paragraphId:n,offset:r}=t,o=e.dataset?.end,a=o!==void 0&&/^\d{1,9}$/.test(o)&&Number(o)>=r?Number(o):r+(e.textContent?.length??0);return {paragraphId:n,start:r,end:a}}function Ha(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return null;let t=e;return !t.classList.contains("docx-inline-drawing-advance")||t.parentElement?.dataset.paragraphId===void 0?null:PR(t.dataset.drawingParagraphId,t.dataset.drawingStart)}function uD(e,t){let n=Sm.test(t)?"[data-paragraph-id][data-start], .docx-inline-drawing-advance":`[data-paragraph-id="${t}"][data-start], .docx-inline-drawing-advance[data-drawing-paragraph-id="${t}"]`,r=[],o=[];for(let a of e.querySelectorAll(n))a.classList.contains("docx-inline-drawing-advance")?Ha(a)?.paragraphId===t&&o.push(a):r.push(a);return {spans:r,spacers:o}}function Yd(e,t,n){return Sm.test(t)?e.querySelectorAll(`[data-paragraph-id]${n}`):e.querySelectorAll(`[data-paragraph-id="${t}"]${n}`)}function TR(e){let t=e.nodeType===Node.TEXT_NODE?e.parentNode:e;for(;t&&t.nodeType===Node.ELEMENT_NODE;){let n=no(t);if(n)return {element:t,identity:n};t=t.parentNode;}return null}function CR(e){return e.querySelector("[data-docx-hf-active]")}function Vo(e,t){if(!e||t&&!t.contains(e))return;let o=(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest("[data-page-index]")?.dataset?.pageIndex;if(!(o===void 0||!/^\d{1,9}$/.test(o)))return Number(o)}function fD(e,t){return t===void 0||!Number.isInteger(t)||t<0?null:e.querySelector(`[data-page-index="${t}"]`)}function Xd(e,t){let n=CR(e);if(n)return [n,e];let r=fD(e,t);return r&&r!==e?[r,e]:[e]}function xR(e,t){let n=l=>({paragraphId:l.paragraphId,offset:t?l.end:l.start}),r=l=>t?{...l,offset:l.offset+1}:l,o=TR(e);if(o)return n(o.identity);let a=Ha(e);if(a)return r(a);if(e.nodeType!==Node.ELEMENT_NODE)return null;let i=e.querySelectorAll("[data-paragraph-id][data-start], .docx-inline-drawing-advance"),s=t?[...i].reverse():[...i];for(let l of s){let d=Ha(l);if(d)return r(d);let c=no(l);if(c)return n(c)}return null}function wR(e,t,n=false){let r=[...e.childNodes];if(r.length===0)return null;let o=Ha(r[t-1]);if(o)return {paragraphId:o.paragraphId,offset:o.offset+1};for(let a=Math.max(0,t);!n&&a<r.length;a+=1){let i=xR(r[a],false);if(i)return i}for(let a=Math.min(t,r.length)-1;a>=0;a-=1){let i=xR(r[a],true);if(i)return i}return null}function SR(e,t,n){if(!n.contains(e))return null;let r=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement;if(r?.closest("[data-docx-field]"))return null;let o=r?.closest("[data-docx-hf]");if(o&&!o.hasAttribute("data-docx-hf-active")||CR(n)&&r?.closest(".docx-page-content"))return null;let a=r?.closest("[data-docx-marker]"),i=Ha(a??void 0);if(i)return t>0?{...i,offset:i.offset+1}:i;let s=r?.closest(".docx-terminator-seat");if(s?.querySelector(".docx-line-break-mark")&&s.parentElement){let c=s.parentElement,u=[...c.querySelectorAll(".layout-run[data-start]")].filter(h=>h.closest(".docx-line")===c).flatMap(h=>{let y=no(h);return y?[{run:h,identity:y}]:[]}),p=u.at(-1)?.identity.paragraphId,m;for(let h of u)h.identity.paragraphId===p&&(!m||h.identity.start>m.identity.start)&&(m=h);if(m){let h=m.run.textContent===`
|
|
24
|
-
`,{start:y,end:g}=m.identity;return {paragraphId:m.identity.paragraphId,offset:h?y:g}}}let l=s??(a?.classList.contains("docx-wrap-advance")?a:null);if(l?.parentElement){let c=[...l.parentElement.childNodes],u=c.indexOf(l);if(s){let h="[data-start], a, br, .docx-inline-drawing-advance, .docx-wrap-advance";for(;u>0&&!c[u-1].matches?.(h);)u-=1;}let p=!s&&t>0?1:0,m=wR(l.parentElement,u+p,!!s);if(m)return m}if(a)return a.parentElement?ER(a.parentElement):null;if(r?.closest("[data-docx-tab-leader]"))return null;if(e.nodeType===Node.ELEMENT_NODE){let c=e,u=no(c);if(u)return {paragraphId:u.paragraphId,offset:t>0?u.end:u.start};let p=wR(c,t);return p||hD(c)}let d=TR(e);return d?{paragraphId:d.identity.paragraphId,offset:cD(d.identity,t)}:null}function _a(e,t){if(!t||t.rangeCount===0)return null;let{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:a}=t;if(!n||!o)return null;let i=SR(n,r,e),s=SR(o,a,e);if(!i||!s){let l=i??s;return l?{anchor:l,head:l}:null}return {anchor:i,head:s}}function Im(e,t){if(!t||t.rangeCount===0)return false;let{anchorNode:n,focusNode:r}=t;return !!n&&e.contains(n)||!!r&&e.contains(r)}function IR(e,t,n,r){if(r!==void 0)for(let o of Xd(e,n)){let a=Sm.test(r)?"[data-line-id]":`[data-line-id="${r}"]`;for(let i of o.querySelectorAll(a)){if(i.dataset.lineId!==r)continue;let s=kR(i,t);if(s)return s}}for(let o of Xd(e,n)){let a=kR(o,t);if(a)return a}return null}function pD(e,t){let n=null;for(let r of e){if(!r.hasAttribute("data-docx-field")||!r.parentNode)continue;let o=no(r);if(o?.paragraphId===t.paragraphId){if(o.start===t.offset)return {node:r.parentNode,offset:[...r.parentNode.childNodes].indexOf(r)};o.end===t.offset&&(n=r);}}if(n){let r=no(n);for(let o of e){let a=no(o);a?.paragraphId===t.paragraphId&&a.start===r.start&&a.end===r.end&&(n=o);}}return n?.parentNode?{node:n.parentNode,offset:[...n.parentNode.childNodes].indexOf(n)+1}:null}function kR(e,t){let{spans:n,spacers:r}=uD(e,t.paragraphId),o=pD(n,t);if(o)return o;let a=null,i=false;for(let m of n){let h=no(m);if(!h||h.paragraphId!==t.paragraphId)continue;let y=mD(m),g=m.textContent?.length??0,b=h.end;if(y){if(m.closest?.("[data-docx-field]")){i=true;continue}if(i=true,t.offset>=h.start&&t.offset<=b){let S={node:y,offset:Math.min(t.offset-h.start,g)};if(t.offset<b)return S;a=S;}}}let s=m=>r.find(h=>Ha(h)?.offset===m)??null,l=s(t.offset);if(a&&l?.parentNode&&!l.parentNode.contains(a.node))return {node:l.parentNode,offset:[...l.parentNode.childNodes].indexOf(l)};if(a)return a;let d=l,c=d?null:s(t.offset-1),u=d??c;if(u?.parentNode)return {node:u.parentNode,offset:[...u.parentNode.childNodes].indexOf(u)+(c?1:0)};if(i||=r.length>0,i)return null;let p=gD(e,t.paragraphId);return p?{node:p,offset:0}:null}function mD(e){let t=e.firstChild;for(;t&&t.nodeType===Node.ELEMENT_NODE;)t=t.firstChild;return t&&t.nodeType===Node.TEXT_NODE?t:null}function gD(e,t){let n=null;for(let r of Yd(e,t,""))if(r.dataset?.paragraphId===t&&r.dataset?.start===void 0){if(r.dataset?.lineId!==void 0)return r;n??=r;}return n}function ER(e){let t=e.closest("[data-paragraph-id]");if(!t||t.dataset.start!==void 0)return null;let n=t.dataset.paragraphId;return !n||!RR.test(n)||n==="__proto__"?null:{paragraphId:n,offset:0}}function hD(e){let t=ER(e);return !t||e.closest("[data-paragraph-id]").querySelector("[data-paragraph-id][data-start]")?null:t}function OR(e,t,n,r){if(!n)return false;let o=r?.preferredPageIndex??Vo(n.anchorNode,e),i=Ot(t,{anchor:t.head,head:t.head})?r?.preferredLineId:void 0,s=IR(e,t.anchor,o,i),l=IR(e,t.head,o,i);if(!s||!l)return false;let d=_a(e,n);if(d&&Ot(d,t)){let c=Vo(n.anchorNode,e),p=(n.focusNode?.nodeType===Node.ELEMENT_NODE?n.focusNode:n.focusNode?.parentElement)?.closest("[data-line-id]")?.dataset.lineId;if((o===void 0||c===o)&&(i===void 0||p===i))return true}try{return n.setBaseAndExtent(s.node,s.offset,l.node,l.offset),!0}catch{return false}}function Ot(e,t){return e.anchor.paragraphId===t.anchor.paragraphId&&e.anchor.offset===t.anchor.offset&&e.head.paragraphId===t.head.paragraphId&&e.head.offset===t.head.offset}var yD='[data-docx-marker],[data-docx-tab-leader],[aria-hidden="true"],[contenteditable="false"],[data-drawing-node-id]';function MR(e,t,n){let r=e.dataset.end;if(r===void 0||!/^\d{1,9}$/.test(r))return n;let o=Number(r);return o>=t?o:n}function AR(e,t){if(e.dataset.paragraphId!==t)return null;let n=e.dataset.start;return n===void 0||!/^\d{1,9}$/.test(n)?null:Number(n)}function bD(e){return e?(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest(".docx-page")??null:null}function vD(e,t,n){return t&&e.contains(t)?2:n?.contains(e)?1:0}function FR(e,t,n,r){if(e.dataset.docxField!==void 0){let a=MR(e,t,t);return {start:t,end:a,text:n.slice(t,a),seq:r}}let o=e.textContent??"";return {start:t,end:MR(e,t,t+o.length),text:o,seq:r}}function LR(e,t){for(let n of e.childNodes){if(n.nodeType===Node.TEXT_NODE){let s=n.textContent??"";s.length>0&&(t.pieces.push({start:t.end,end:t.end,text:s,seq:t.seq}),t.seq+=1);continue}if(n.nodeType!==Node.ELEMENT_NODE)continue;let r=n,o=AR(r,t.paragraphId);if(o===null){if(r.dataset?.start!==void 0)continue;let s=r.dataset?.drawingStart;if(r.dataset?.drawingParagraphId===t.paragraphId&&s!==void 0&&/^\d{1,9}$/.test(s)){t.end=Math.max(t.end,Number(s)+1);continue}if(r.matches?.(yD))continue;LR(r,t);continue}let a=FR(r,o,t.modelText,t.seq);t.seq+=1,t.end=Math.max(t.end,a.end);let i=`${a.start}:${a.end}`;t.ranges.has(i)||(t.ranges.add(i),t.pieces.push(a));}}function xD(e,t,n,r){let o=[];for(let i of Yd(e,t,"")){let s=i;s.dataset.paragraphId===t&&s.dataset.start===void 0&&(o.some(l=>l.contains(s))||o.push(s));}let a=new Map;for(let i of o){let s=i.dataset.fragmentIndex??"",l=vD(i,n,r),d=a.get(s);(!d||l>d.affinity)&&a.set(s,{element:i,affinity:l});}return [...a.values()].map(i=>i.element)}function wD(e,t,n){for(let r of Yd(e,n.paragraphId,"[data-start]")){let o=r,a=AR(o,n.paragraphId);if(a===null||t.some(l=>l.contains(o)))continue;let i=FR(o,a,n.modelText,n.seq);n.seq+=1;let s=`${i.start}:${i.end}`;n.ranges.has(s)||(n.ranges.add(s),n.pieces.push(i));}}function SD(e,t){let n=[...e].sort((a,i)=>a.start-i.start||a.seq-i.seq),r="",o=0;for(let a of n)a.start>o&&(r+=t.slice(o,a.start)),r+=a.text,o=Math.max(o,a.end);return o<t.length&&(r+=t.slice(o)),r}function NR(e,t,n,r){let o=xD(e,t,r,bD(r)),a={paragraphId:t,modelText:n,pieces:[],ranges:new Set,end:0,seq:0};for(let i of o)LR(i,a);return wD(e,o,a),a.pieces.length===0?null:SD(a.pieces,n)}var $R={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down",Home:"lineStart",End:"lineEnd"};function ID(e){return $R[e.key]||e.key==="PageUp"||e.key==="PageDown"?true:(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="a"}var DR={l:"left",e:"center",r:"right",j:"both"},HR={1:"240",5:"360",2:"480"},_R={b:{localName:"b"},i:{localName:"i"},u:{localName:"u",attributes:{val:"single"}}};function kD(e,t){return e.altKey?e.metaKey?true:e.ctrlKey?e.getModifierState?.("AltGraph")??false?e.key.toLowerCase()===t:true:false:false}function qR(e,t={}){return n=>{if(n.defaultPrevented||e.editingMode()==="view"&&ID(n))return;if(n.key==="F9"&&n.altKey&&!n.ctrlKey&&!n.metaKey&&!n.shiftKey&&!n.isComposing&&t.onToggleFieldCodes){n.preventDefault(),t.onToggleFieldCodes();return}if(!n.altKey&&!n.isComposing&&(n.metaKey&&!n.ctrlKey&&!n.shiftKey&&n.key==="8"||n.ctrlKey&&!n.metaKey&&n.shiftKey&&(n.code==="Digit8"||n.key==="*"))&&t.onToggleParagraphMarks){n.preventDefault(),t.onToggleParagraphMarks();return}if(n.key==="Escape"&&e.formatPainter.state().mode!=="off"){e.formatPainter.disarm(),n.preventDefault();return}if(n.key==="Escape"&&e.activeScope().kind==="headerFooter"){e.exitHeaderFooter(),n.preventDefault();return}if(n.key==="Escape"&&e.activeScope().kind==="note"){e.exitNote(),n.preventDefault();return}let r=jp(n);if(kD(n,r)&&!n.shiftKey){let i=r;if(i==="f"){n.preventDefault(),e.insertNote("footnote");return}if(i==="d"){n.preventDefault(),e.insertNote("endnote");return}if(i==="c"){n.preventDefault(),e.formatPainter.capture();return}if(i==="v"){n.preventDefault(),e.formatPainter.apply();return}}let o=n.metaKey||n.ctrlKey,a=$R[n.key];if(a){let i=a;n.key==="Home"||n.key==="End"?o&&(i=n.key==="Home"?"documentStart":"documentEnd"):(n.key==="ArrowLeft"||n.key==="ArrowRight")&&(n.altKey||n.ctrlKey)?i=n.key==="ArrowLeft"?"wordLeft":"wordRight":n.metaKey&&(n.key==="ArrowLeft"||n.key==="ArrowRight")?i=n.key==="ArrowLeft"?"lineStart":"lineEnd":o&&(n.key==="ArrowUp"||n.key==="ArrowDown")&&(i=n.key==="ArrowUp"?"documentStart":"documentEnd"),e.navigate(i,n.shiftKey),n.preventDefault();return}if(n.key==="PageUp"||n.key==="PageDown"){e.navigate(o?n.key==="PageUp"?"documentStart":"documentEnd":n.key==="PageUp"?"pageUp":"pageDown",n.shiftKey),n.preventDefault();return}if(n.key==="Backspace"){o||n.altKey?e.deleteWordBackward():e.deleteBackward(),n.preventDefault();return}if(n.key==="Delete"){o||n.altKey?e.deleteWordForward():e.deleteForward(),n.preventDefault();return}if(n.key==="Tab"){if(e.contentControls.formFill()&&e.contentControls.navigate(n.shiftKey?"previous":"next")){n.preventDefault();return}let i=n.shiftKey?"decrease":"increase";e.isListParagraph()?e.adjustIndent(i):e.indentWithTab(i)||(n.shiftKey?e.adjustIndent("decrease"):e.insertTab()),n.preventDefault();return}if(n.key==="Enter"){o?e.insertPageBreak():n.shiftKey?e.insertLineBreak():e.exitListOnEmptyItem()||e.splitParagraph(),n.preventDefault();return}if(o&&n.key.toLowerCase()==="a"){e.selectAll(),n.preventDefault();return}if(o&&n.shiftKey&&n.key.toLowerCase()==="v"){e.armForcePlainPaste();return}if(o&&!n.shiftKey&&n.key.toLowerCase()==="k"&&t.onRequestHyperlink){t.onRequestHyperlink(),n.preventDefault();return}if(o&&!n.shiftKey&&_R[n.key.toLowerCase()]){let i=_R[n.key.toLowerCase()];e.toggleRunProperty(i.localName,i.attributes),n.preventDefault();return}if(o&&(n.key==="="||n.key==="+"||n.code==="Equal")){e.toggleRunProperty("vertAlign",{val:n.shiftKey?"superscript":"subscript"}),n.preventDefault();return}if(o&&n.shiftKey&&n.key.toLowerCase()==="m"){e.adjustIndent("decrease"),n.preventDefault();return}if(o&&!n.shiftKey&&n.key.toLowerCase()==="m"){e.adjustIndent("increase"),n.preventDefault();return}if(o&&!n.shiftKey&&DR[n.key.toLowerCase()]){if(n.metaKey&&n.key.toLowerCase()==="r")return;e.setParagraphProperties([{localName:"jc",attributes:{val:DR[n.key.toLowerCase()]},physicalAlignment:true}]),n.preventDefault();return}if(o&&!n.shiftKey&&HR[n.key]){e.setParagraphProperty("spacing",{line:HR[n.key],lineRule:"auto"},{mergeAttributes:true}),n.preventDefault();return}if(o&&n.key.toLowerCase()==="y"){e.redo(),n.preventDefault();return}(n.metaKey||n.ctrlKey)&&n.key.toLowerCase()==="z"&&(n.shiftKey?e.redo():e.undo(),n.preventDefault());}}function VR(e){let t=a=>{let i=e.copyFlavours();return i.reason?(a.preventDefault(),false):!i.text||!a.clipboardData?false:(a.clipboardData?.setData("text/plain",i.text),i.html&&a.clipboardData?.setData("text/html",i.html),true)};return {onCopy:a=>{t(a)&&a.preventDefault();},onCut:a=>{t(a)&&(e.deleteSelection(),a.preventDefault());},onPaste:a=>{let i=Wf(a.clipboardData),s=a.clipboardData?.getData("text/html")??"";a.preventDefault(),!(!i&&!s)&&e.pasteRich(i,s.length>0?s:null);}}}function BR(e){let t=Wf(e.dataTransfer);return t.length>0?t:null}function KR(e,t){return n=>{if(n.preventDefault(),!t.isComposing()){if(n.inputType==="insertText"&&n.data!=null){e.enqueueType(n.data);return}if(n.inputType!=="insertFromPaste"){if(n.inputType==="insertReplacementText"){let r=n.data??BR(n);if(!r)return;CD(e,PD(n),r),t.onBrowserSelectionFixup?.();return}if(n.inputType==="deleteContentBackward"){e.deleteBackward();return}if(n.inputType==="deleteWordBackward"){e.deleteWordBackward();return}if(n.inputType==="deleteContentForward"){e.deleteForward();return}if(n.inputType==="deleteWordForward"){e.deleteWordForward();return}if(n.inputType==="insertLineBreak"){e.insertLineBreak();return}if(n.inputType==="insertFromDrop"||n.inputType==="insertFromPasteAsQuotation"){let r=BR(n);r&&t.insertPlainText(r);return}n.inputType==="insertParagraph"&&e.splitParagraph();}}}}function RD(e){let{startContainer:t,endContainer:n}=e;if(t===n&&t.nodeType===Node.TEXT_NODE)return (t.textContent??"").slice(e.startOffset,e.endOffset);let r=t.ownerDocument;if(!r)return null;try{let o=r.createRange();return o.setStart(t,e.startOffset),o.setEnd(n,e.endOffset),o.toString()}catch{return null}}function PD(e){if(typeof e.getTargetRanges!="function")return null;let t=e.getTargetRanges();if(t.length!==1)return null;let n=t[0],r=RD(n);return r?{text:r,paragraphId:TD(n)}:null}function TD(e){let t=e.startContainer;return t.isConnected?(t.nodeType===Node.ELEMENT_NODE?t:t.parentElement??null)?.closest("[data-paragraph-id]")?.getAttribute("data-paragraph-id")??null:null}function CD(e,t,n){if(t!==null){e.flushPendingInput();let r=e.state(),o=r.selection.head,a=t.text;if(Ot(r.selection,$e(o))&&o.offset>=a.length&&(t.paragraphId===null||t.paragraphId===o.paragraphId)&&r.pendingFormat===null){let i=Ae(e.session,o.paragraphId)??e.session.part(),s=chunkFIJZIQXA_cjs.Vi(i,o.paragraphId);s!==null&&s.slice(o.offset-a.length,o.offset)===a&&e.setSelection({anchor:{paragraphId:o.paragraphId,offset:o.offset-a.length},head:o});}}e.type(n);}function WR(e,t,n,r=null){for(let o of Xd(e)){let a=NR(o,t,n,r);if(a!==null)return a}return null}function jR(e,t,n){if(n===t)return null;let r=0;for(;r<n.length&&r<t.length&&n[r]===t[r];)r+=1;let o=0;for(;o<n.length-r&&o<t.length-r&&n[n.length-1-o]===t[t.length-1-o];)o+=1;let a=n.slice(r,n.length-o),i=[];return t.length-o>r&&i.push({op:"deleteText",paragraphId:e,start:r,end:t.length-o}),a.length>0&&i.push({op:"insertText",paragraphId:e,offset:r,text:a}),i.length===0?null:{ops:i,caret:r+a.length}}var ED="equation replacement and removal are not supported in suggesting mode",ZR=new WeakMap;function km(e,t){let n=chunkFIJZIQXA_cjs.Ta(e,t);if(!n||n.kind!=="paragraph")return [];let r=ZR.get(n);if(r)return r;let o=[];for(let i of chunkFIJZIQXA_cjs.hg(n))for(let s of chunkFIJZIQXA_cjs.Ze(i.node)){let l=chunkFIJZIQXA_cjs.Te(s);l&&o.push(Object.freeze({id:s.id,paragraphId:t,start:i.start,end:i.end,linear:chunkFIJZIQXA_cjs.Ve(l.expression),fallbackText:l.fallbackText,supported:vn(l.expression)}));}let a=Object.freeze(o);return ZR.set(n,a),a}function zR(e,t,n){let r=km(e,t).filter(o=>o.start===n);return r.length===0?null:r.map(o=>o.linear||o.fallbackText).join(" ")}function vn(e){switch(e.kind){case "fallback":return false;case "text":return true;case "row":return e.items.every(vn);case "fraction":return vn(e.numerator)&&vn(e.denominator);case "radical":return vn(e.radicand)&&(e.degree===void 0||vn(e.degree));case "script":return vn(e.base)&&(e.subscript===void 0||vn(e.subscript))&&(e.superscript===void 0||vn(e.superscript));case "nary":return vn(e.body)&&(e.lowerLimit===void 0||vn(e.lowerLimit))&&(e.upperLimit===void 0||vn(e.upperLimit))}}function UR(e,t){return e.find(n=>n.paragraphId===t.paragraphId&&t.offset>=n.start&&t.offset<=n.end)??null}function GR(e){let t=null,n=i=>{let s=e.pagesLayer.ownerDocument.defaultView;if(!s||!(i instanceof s.Element))return null;let l=i.closest("[data-docx-equation]");return l&&e.pagesLayer.contains(l)?l:null},r=(i,s)=>{let l=e.equationById(i);l&&(e.pagesLayer.contentEditable!=="false"&&e.setSelection({anchor:{paragraphId:l.paragraphId,offset:l.start},head:{paragraphId:l.paragraphId,offset:l.end}}),e.onPopover?.({equation:l,rect:s}));},o=i=>{t=null;let s=n(i.target),l=s?.dataset.docxEquation;if(!s||!l)return;let d=s.getBoundingClientRect();t={equationId:l,rect:{left:d.left,top:d.top,right:d.right,bottom:d.bottom}};},a=i=>{let s=n(i.target),l=s?.dataset.docxEquation,d=t;if(t=null,!s||!l){if(!d)return;i.preventDefault(),r(d.equationId,d.rect);return}let c=s.getBoundingClientRect();i.preventDefault(),r(l,{left:c.left,top:c.top,right:c.right,bottom:c.bottom});};return e.pagesLayer.addEventListener("pointerdown",o,true),e.pagesLayer.addEventListener("click",a),{destroy:()=>{e.pagesLayer.removeEventListener("pointerdown",o,true),e.pagesLayer.removeEventListener("click",a);}}}function XR(e){let t=()=>e.session.partFor(e.storyScope()),n=l=>{let d=t();return d?km(d,l):[]},r=()=>{let l=e.selection().head;return UR(n(l.paragraphId),l)},o=l=>{let d=n(e.selection().head.paragraphId).find(c=>c.id===l);if(d)return d;for(let c of e.session.storyParts()){let u=chunkFIJZIQXA_cjs.Ta(c,l);if(!u||u.kind!=="generic"||u.namespaceUri!==chunkFIJZIQXA_cjs.Re||u.localName!=="oMath")continue;let p=u;for(;p&&p.kind!=="paragraph";)p=chunkFIJZIQXA_cjs.Ua(c,p.id);return !p||p.kind!=="paragraph"?null:km(c,p.id).find(m=>m.id===l)??null}return null},a=(l,d)=>{let c=false,u={paragraphId:l.paragraphId,offset:l.start};return e.commit(()=>{let p=e.session.applyTreeOps([d],e.selectionMark(),{paragraphId:u.paragraphId,start:u.offset,end:u.offset},e.storyScope());return c=p.committed,p},()=>({anchor:u,head:u})),c},i=(l,d)=>{let c=o(l);if(!c)return {ok:false,code:"notFound",reason:"no equation with that id"};if(e.editingMode()==="suggest")return {ok:false,code:"unsupported",reason:ED};let u=d==="replace"?{op:"setMathEquation",equationId:l,linear:c.linear}:{op:"removeMathEquation",equationId:l},p=e.writeRefusal(u);return p===null?{ok:true}:{ok:false,code:"locked",reason:p}},s=l=>(e.commit(()=>({committed:false,rejected:true,opCount:0,reason:l.reason})),false);return {equationsInCaretParagraph:()=>[...n(e.selection().head.paragraphId)],equationAtCaret:r,equationById:o,can:i,applyEquation(l,d){let c=o(l);if(!c)return false;let u=i(l,"replace");return u.ok?c.supported&&c.linear===d?true:a(c,{op:"setMathEquation",equationId:l,linear:d}):s(u)},removeEquation(l){let d=o(l);if(!d)return false;let c=i(l,"remove");return c.ok?a(d,{op:"removeMathEquation",equationId:l}):s(c)}}}function YR(e,t){for(let[n,r]of t){let o=chunkFIJZIQXA_cjs.Ta(e,n);if(o&&o.kind!=="textValue"&&o.kind==="paragraph"&&r&&r.end>r.start){let a=chunkFIJZIQXA_cjs.jg(o),i=[...o.children];for(;i.length;){let s=i.pop();if(s.kind!=="textValue"){if(chunkJGNVNT2A_cjs.G(s)){let l=a.spanOf(s);if(l?l.end>r.start&&l.start<r.end:r.start===0&&r.end===1/0)return true}for(let l of s.children)i.push(l);}}}}return false}function Qd(e){let t=chunkFIJZIQXA_cjs.Ce(e);if(!t.ok)return false;for(let n of t.package.parts.values())if(chunkJGNVNT2A_cjs.H([n.root]))return true;return false}function qe(e){return e.kind!=="textValue"}function ge(e,t){if(!e||e.kind==="textValue")return null;for(let n of e.children)if(qe(n)&&n.localName===t&&n.namespaceUri===chunkFIJZIQXA_cjs.la)return n;return null}function et(e,t="val"){return e?chunkFIJZIQXA_cjs.Yf(e,t,chunkFIJZIQXA_cjs.la):void 0}function xn(e,t,n){return e?chunkFIJZIQXA_cjs.Yf(e,t,n):void 0}function Rm(e){if(e.kind==="textValue")return e.value;let t="";for(let n of e.children)t+=Rm(n);return t}function Ba(e,t,n){if(e.kind==="textValue")return null;if(e.localName===t&&e.namespaceUri===n)return e;for(let r of e.children){let o=Ba(r,t,n);if(o)return o}return null}function ro(e){if(e===void 0||!/^-?\d+$/.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)?t:null}function Jt(e){return chunkFIJZIQXA_cjs.nd(e)}function Pm(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}var ir=Pm;function Jd(e){return e===void 0||e.toLowerCase()==="auto"?null:/^[0-9A-Fa-f]{6}$/.test(e)?`#${e.toLowerCase()}`:null}function Vn(e){return `${Math.round(e/20*100)/100}pt`}var OD="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",MD=chunk4GBTELJV_cjs.Ib;function xs(e,t,n){for(let o of chunkFIJZIQXA_cjs.He(e,e.mainDocumentPart)){if(o.type!==t||o.targetMode==="External")continue;let a=chunkFIJZIQXA_cjs.B(o.ownerPart,o.rawTarget);if(a.ok){let i=e.parts.get(a.partName);if(i&&qe(i.root))return i.root}}let r=e.parts.get(n);return r&&qe(r.root)?r.root:null}function QR(e){let t=xs(e,OD,"/word/styles.xml"),n=new Map,r=null,o=null,a=null,i=null,s=null;if(!t)return {byId:n,docDefaultsRPr:r,docDefaultsPPr:o,defaultParagraphStyleId:a,defaultCharacterStyleId:i,defaultTableStyleId:s};let l=0,d=null;for(let c of t.children){if(!qe(c)||c.namespaceUri!==chunkFIJZIQXA_cjs.la)continue;if(c.localName==="docDefaults"){d=c,r=ge(ge(c,"rPrDefault"),"rPr"),o=ge(ge(c,"pPrDefault"),"pPr");continue}if(c.localName!=="style")continue;if(l>=chunk4GBTELJV_cjs.gd)break;l+=1;let u=chunkFIJZIQXA_cjs.Yf(c,"styleId",chunkFIJZIQXA_cjs.la);if(!u)continue;n.set(u,c);let p=chunkFIJZIQXA_cjs.Yf(c,"default",chunkFIJZIQXA_cjs.la),m=chunkFIJZIQXA_cjs.Yf(c,"type",chunkFIJZIQXA_cjs.la);p==="1"||p==="true"||p==="on"?m==="paragraph"?a=u:m==="character"?i=u:m==="table"&&(s=u):(a===u&&(a=null),i===u&&(i=null),s===u&&(s=null));}if(t.namespaceUri===chunkFIJZIQXA_cjs.la){let c=chunkJGNVNT2A_cjs.K(d);c.run&&(r=chunkJGNVNT2A_cjs.M("rPr","application")),c.paragraph&&(o=chunkJGNVNT2A_cjs.M("pPr","application"));}return {byId:n,docDefaultsRPr:r,docDefaultsPPr:o,defaultParagraphStyleId:a,defaultCharacterStyleId:i,defaultTableStyleId:s}}function Er(e,t,n){let r=[],o=new Set,a=t;for(;a&&!o.has(a)&&r.length<MD;){o.add(a);let i=e.byId.get(a);if(!i)break;if(r.length===0&&n!==void 0){let s=chunkFIJZIQXA_cjs.Yf(i,"type",chunkFIJZIQXA_cjs.la);if(s!==void 0&&s!==n)return []}r.unshift(i),a=et(ge(i,"basedOn"));}return r}function Tm(e,t,n){let r=[];if(e.docDefaultsPPr&&r.push(e.docDefaultsPPr),n)for(let a of n)r.push(a);let o=et(ge(t,"pStyle"));for(let a of Er(e,o??e.defaultParagraphStyleId??void 0,"paragraph")){let i=ge(a,"pPr");i&&r.push(i);}return t&&r.push(t),r}function ec(e,t,n,r){let o=[];e.docDefaultsRPr&&o.push(e.docDefaultsRPr);let a=[];if(r)for(let u of r)a.push(u);let i=[],s=et(ge(t,"pStyle"));for(let u of Er(e,s??e.defaultParagraphStyleId??void 0,"paragraph")){let p=ge(u,"rPr");p&&i.push(p);}let l=[],d=et(ge(n,"rStyle"))??e.defaultCharacterStyleId??void 0;for(let u of Er(e,d,"character")){let p=ge(u,"rPr");p&&l.push(p);}let c=[...o,...a,...i,...l];return n&&c.push(n),{all:c,defaults:o,tableLevel:a,paragraphLevel:i,characterLevel:l,direct:n}}function wn(e,t){let n=null;for(let r of e){let o=ge(r,t);o&&(n=o);}return n}function vt(e,t,n){let r;for(let o of e){let a=ge(o,t);if(!a)continue;let i=chunkFIJZIQXA_cjs.Yf(a,n,chunkFIJZIQXA_cjs.la);i!==void 0&&(r=i);}return r}function tc(e){return !(e==="0"||e==="false"||e==="off")}function sr(e,t){let n=false;for(let r of e){let o=ge(r,t);o&&(n=tc(et(o)));}return n}function oo(e,t){let n;for(let r of e){let o=ge(r,t);o&&(n=tc(et(o)));}return n}function Kn(e,t){let n=e.direct?ge(e.direct,t):null;if(n)return tc(et(n));let r=oo(e.tableLevel,t),o=oo(e.paragraphLevel,t),a=oo(e.characterLevel,t);return a===false||a===void 0&&o===false||a===void 0&&o===void 0&&r===false?false:oo(e.defaults,t)===true?true:r===true!=(o===true)!=(a===true)}function Cm(e,t){let n=e.direct?ge(e.direct,t):null;if(n)return tc(et(n));let r=oo(e.characterLevel,t);if(r!==void 0)return r;let o=oo(e.paragraphLevel,t);if(o!==void 0)return o;let a=oo(e.tableLevel,t);return a!==void 0?a:oo(e.defaults,t)===true}function JR(e){return e.isLgl?"decimal":e.numFmt}function eP(e){let t=chunk4GBTELJV_cjs.lc(e),n=new Map,r=new Map,o=new Map,a=new Map,i=new Map,s=new Map;for(let[l,d]of t.abstractNums){d.numStyleLink!==void 0&&s.set(l,d.numStyleLink);let c=new Map,u=new Map;for(let[p,m]of d.levels)c.set(String(p),JR(m)),u.set(String(p),m.start);r.set(l,c),o.set(l,u);}for(let[l,d]of t.nums){n.set(l,d.abstractNumId);for(let[c,u]of d.overrides){let p=`${l}:${c}`,m=u.startOverride??u.level?.start;m!==void 0&&a.set(p,m),u.level!==void 0&&i.set(p,JR(u.level));}}return {numToAbstract:n,levelFormats:r,levelStarts:o,startOverrides:a,formatOverrides:i,styleLinks:s}}function tP(e,t){return e===null?null:chunkFIJZIQXA_cjs.nd(chunkFIJZIQXA_cjs.Yf(e,t,chunkFIJZIQXA_cjs.la))}function rP(e,t){if(e===null)return null;let n=chunkFIJZIQXA_cjs.Yf(e,t,chunkFIJZIQXA_cjs.la);return n!==void 0&&/^[0-9A-Fa-f]{6}$/.test(n)?`#${n.toLowerCase()}`:null}function nP(e){return `${Math.round(e/20*100)/100}pt`}var AD=["wholeTable","firstRow","lastRow","firstCol","lastCol","band1Horz","band2Horz","band1Vert","band2Vert","nwCell","neCell","swCell","seCell"];function $a(e,t,n){if(e===null)return null;let r=chunkFIJZIQXA_cjs.Yf(e,t,chunkFIJZIQXA_cjs.la);if(r!==void 0)return !(r==="0"||r==="false"||r==="off");let o=chunkFIJZIQXA_cjs.Yf(e,"val",chunkFIJZIQXA_cjs.la);return o===void 0||!/^[0-9A-Fa-f]{1,4}$/.test(o)?null:(Number.parseInt(o,16)&n)!==0}function Em(e,t){let n=new Map,r=new Set(AD);for(let o of e)for(let a of o.children){if(a.kind==="textValue"||a.localName!=="tblStylePr"||a.namespaceUri!==chunkFIJZIQXA_cjs.la)continue;let i=chunkFIJZIQXA_cjs.Yf(a,"type",chunkFIJZIQXA_cjs.la);i===void 0||!r.has(i)||n.set(i,{fill:rP(ge(ge(a,"tcPr"),"shd"),"fill"),rPr:ge(a,"rPr"),pPr:ge(a,"pPr")});}return {byType:n,firstRowEnabled:$a(t,"firstRow",32)??false,lastRowEnabled:$a(t,"lastRow",64)??false,firstColumnEnabled:$a(t,"firstColumn",128)??false,lastColumnEnabled:$a(t,"lastColumn",256)??false,hBandingEnabled:!($a(t,"noHBand",512)??false),vBandingEnabled:!($a(t,"noVBand",1024)??false)}}function Om(e,t,n,r,o,a){let i=e.firstRowEnabled&&t===0,s=e.lastRowEnabled&&t===n-1,l=e.firstColumnEnabled&&r,d=e.lastColumnEnabled&&o,c=u=>e.byType.get(u)??null;if(s&&l&&c("swCell"))return c("swCell");if(s&&d&&c("seCell"))return c("seCell");if(i&&l&&c("nwCell"))return c("nwCell");if(i&&d&&c("neCell"))return c("neCell");if(s&&c("lastRow"))return c("lastRow");if(i&&c("firstRow"))return c("firstRow");if(d&&c("lastCol"))return c("lastCol");if(l&&c("firstCol"))return c("firstCol");if(e.hBandingEnabled){let u=t-(e.firstRowEnabled?1:0);if(u>=0){let p=c(u%2===0?"band1Horz":"band2Horz");if(p)return p}}if(e.vBandingEnabled){let u=a-(e.firstColumnEnabled?1:0);if(u>=0){let p=c(u%2===0?"band1Vert":"band2Vert");if(p)return p}}return null}function oP(e,t,n,r,o,a,i,s,l=false,d=[]){let c=[],u=ge(e,"tcBorders"),p={top:n===0?"top":"insideH",bottom:n+o>=r?"bottom":"insideH",left:a?"left":"insideV",right:i?"right":"insideV"};for(let I of ["top","left","bottom","right"]){let M=I==="left"?"start":I==="right"?"end":I,k=ge(u,I)??ge(u,M),P=p[I],R=P==="left"?"start":P==="right"?"end":P,w=k!==null?Oo(k):Oo(ge(t,P)??ge(t,R));w&&c.push(`border-${Hn(I,l)}:${w}`);}let m=rP(ge(e,"shd"),"fill")??s;m&&c.push(`background-color:${m}`);let h=ge(e,"vAlign"),y=h===null?void 0:chunkFIJZIQXA_cjs.Yf(h,"val",chunkFIJZIQXA_cjs.la);y==="center"?c.push("vertical-align:middle"):(y==="bottom"||y==="top")&&c.push(`vertical-align:${y}`);let g=ge(e,"tcW"),b=tP(g,"w"),S=g===null?void 0:chunkFIJZIQXA_cjs.Yf(g,"type",chunkFIJZIQXA_cjs.la);b!==null&&b>0&&(S===void 0||S==="dxa")&&c.push(`width:${nP(b)}`);let x=ge(e,"tcMar");for(let I of ["top","right","bottom","left"]){let M=I==="left"?"start":I==="right"?"end":I,k=ge(x,I)??ge(x,M)??d.map(w=>ge(w,I)??ge(w,M)).find(w=>w!==null)??null,P=tP(k,"w"),R=k===null?void 0:chunkFIJZIQXA_cjs.Yf(k,"type",chunkFIJZIQXA_cjs.la);P!==null&&P>=0&&(R===void 0||R==="dxa")&&c.push(`padding-${Hn(I,l)}:${nP(P)}`);}return c.join(";")}function FD(e){return e.kind==="tableCell"?true:e.localName==="tc"&&e.namespaceUri===chunkFIJZIQXA_cjs.la}function aP(e){return e.localName==="customXml"&&e.namespaceUri===chunkFIJZIQXA_cjs.la}function iP(e){let t=[],n=[],r=o=>{for(let a of o)if(qe(a)){if(a.kind==="tableRow"||a.localName==="tr"&&a.namespaceUri===chunkFIJZIQXA_cjs.la){n.push({row:t.length}),t.push(a);continue}if(a.kind==="contentControl"){let i=a.children.find(s=>s.kind==="contentControlContent");i&&qe(i)&&r(i.children);continue}if(aP(a)){r(a.children);continue}n.push({skip:a});}};return r(e.children),{rows:t,tableItems:n}}function sP(e){let t=[],n=[],r=new Set;for(let o of e){let a=new Set,i=[],s=[],l=0,d=c=>{for(let u of c)if(qe(u)){if(FD(u)){let p=ge(u,"tcPr"),m=Math.min(Math.max(ro(et(ge(p,"gridSpan")))??1,1),63),h=ge(p,"vMerge"),y=h===null?null:et(h)==="restart"?"restart":"continue",g=y==="continue"&&!r.has(l)?"restart":y;y!==null&&a.add(l);let b={cell:u,startColumn:l,span:m,vMerge:g};i.push(b),s.push({placement:b}),l+=m;continue}if(u.kind==="contentControl"){let p=u.children.find(m=>m.kind==="contentControlContent");p&&qe(p)&&d(p.children);continue}if(aP(u)){d(u.children);continue}s.push({skip:u});}};d(o.children),r=a,t.push(i),n.push(s);}return {placements:t,items:n}}function lP(e){let t=1;for(let n of e)for(let r of n)t=Math.max(t,r.startColumn+r.span);return t}function dP(e,t,n,r){let o=new Map,a=t.byType.get("wholeTable")??null;for(let i=0;i<n.length;i+=1)for(let s of n[i]??[]){if(s.vMerge==="continue")continue;let l=Om(t,i,n.length,s.startColumn===0,s.startColumn+s.span>=r,s.startColumn),d=[],c=[];a?.rPr&&d.push(a.rPr),a?.pPr&&c.push(a.pPr),l?.rPr&&d.push(l.rPr),l?.pPr&&c.push(l.pPr),o.set(s.cell,d.length>0||c.length>0?{...e,tableRPr:d,tablePPr:c}:e);}return o}function cP(e,t){let n=Er(e.styles,et(ge(t,"tblStyle")),"table");return n.length>0?n:Er(e.styles,e.styles.defaultTableStyleId??void 0,"table")}function uP(e,t){let n=t.children.find(l=>l.kind==="tableProperties"),r=n&&qe(n)?n:null,o=cP(e,r),a=Em(o,ge(r,"tblLook")),{rows:i}=iP(t),{placements:s}=sP(i);return dP(e,a,s,lP(s))}function fP(e,t,n,r){let o=t.children.find(w=>w.kind==="tableProperties"),a=o&&qe(o)?o:null,i=null,s=cP(e,a);for(let w of s){let O=ge(ge(w,"tblPr"),"tblBorders");O&&(i=O);}let l=s.map(w=>ge(w,"tblPr")).filter(w=>w!==null);a&&l.push(a);let d=sr(l,"bidiVisual"),c=[],u;for(let w of l){let O=ge(w,"tblCellMar");O&&c.unshift(O),u=et(ge(w,"jc"))??u;}let p=ge(a,"tblBorders");p&&(i=p);let m=Em(s,ge(a,"tblLook")),{rows:h,tableItems:y}=iP(t),{placements:g,items:b}=sP(h),S=lP(g),x=dP(e,m,g,S),I=["border-collapse:collapse"],M=ge(a,"tblW"),k=Jt(xn(M,"w",chunkFIJZIQXA_cjs.la));k!==null&&k>0&&xn(M,"type",chunkFIJZIQXA_cjs.la)==="dxa"&&I.push(`width:${Vn(k)}`);let P=Hn(u==="right"||u==="end"?"right":u==="center"?"center":"left",d);P==="center"?I.push("margin-left:auto","margin-right:auto"):P==="right"?I.push("margin-left:auto","margin-right:0"):I.push("margin-left:0","margin-right:auto");for(let[w,O]of [["insideH","insideh"],["insideV","insidev"]]){let N=Oo(ge(i,w));N&&I.push(`mso-border-${O}-alt:${N}`);}let R=`<table dir="${d?"rtl":"ltr"}" align="${P}" style="${I.join(";")}">`;for(let w of y){if("skip"in w){r.advanceFieldState(w.skip,n);continue}let O=w.row,N=ge(ge(h[O]??null,"trPr"),"trHeight"),A=Jt(xn(N,"val",chunkFIJZIQXA_cjs.la)),V=B0(A,xn(N,"hRule",chunkFIJZIQXA_cjs.la)),W=V===""?"":` style="${V}"`;R+=`<tr${W}>`;for(let E of b[O]??[]){if("skip"in E){r.advanceFieldState(E.skip,n);continue}let _=E.placement;if(_.vMerge==="continue"){r.advanceFieldState(_.cell,n);continue}let G=1;if(_.vMerge==="restart")for(let B=O+1;B<g.length&&g[B].find(X=>X.startColumn===_.startColumn&&X.vMerge==="continue");B+=1)G+=1;let U=ge(_.cell,"tcPr"),$=_.startColumn+_.span>=S,pe=Om(m,O,g.length,_.startColumn===0,$,_.startColumn),he=m.byType.get("wholeTable")??null,Z=oP(U,i,O,g.length,G,_.startColumn===0,$,pe?.fill??he?.fill??null,d,c),F=(_.span>1?` colspan="${_.span}"`:"")+(G>1?` rowspan="${G}"`:"")+(Z===""?"":` style="${ir(Z)}"`),L=x.get(_.cell)??e;R+=`<td dir="ltr"${F}>${r.renderBlocks(L,_.cell.children,n)}</td>`;}R+="</tr>";}return `${R}</table>`}function nc(e){if(e===void 0||!/^\d{1,10}$/.test(e))return null;let t=Number.parseInt(e,10);return t>=1&&t<=2147483647?t:null}function Mm(e){let t=chunkFIJZIQXA_cjs.Yf(e,"type",chunkFIJZIQXA_cjs.la);return t==="separator"||t==="continuationSeparator"}function Am(e,t){let n=new Set;if(e===null)return n;for(let r of e.children){if(!qe(r)||r.namespaceUri!==chunkFIJZIQXA_cjs.la||r.localName!==t||Mm(r))continue;let o=nc(chunkFIJZIQXA_cjs.Yf(r,"id",chunkFIJZIQXA_cjs.la));o!==null&&n.add(o);}return n}function ws(e,t,n,r,o,a,i){for(let s of t.children)if(qe(s)&&s.kind!=="drawing"){if(s.kind==="revisionDelete"||s.kind==="revisionMoveFrom"){r.inert||o(s,r);continue}if(s.kind==="table"){ws(e,s,n,r,o,a,uP(e,s));continue}if(s.kind==="tableCell"||s.namespaceUri===chunkFIJZIQXA_cjs.la&&s.localName==="tc"){let l=i?.get(s);if(l===void 0){r.inert||o(s,r);continue}ws(l,s,n,r,o,a,i);continue}if(s.kind==="paragraph"){let l=s.children.find(d=>d.kind==="paragraphProperties");ws(e,s,n,r,o,l&&qe(l)?l:null,i);continue}if(s.kind==="run"){if(s.children.some(c=>c.kind==="fldChar")){r.inert||o(s,r);continue}if(s.children.some(c=>c.kind==="instrText")||!r.inert&&r.stack.some(c=>c==="instr"))continue;let l=s.children.find(c=>c.kind==="runProperties"),d=ec(e.styles,a,l&&qe(l)?l:null,e.tableRPr);if(Kn(d,"vanish"))continue}if(s.namespaceUri===chunkFIJZIQXA_cjs.la&&(s.localName==="footnoteReference"||s.localName==="endnoteReference")){let l=nc(chunkFIJZIQXA_cjs.Yf(s,"id",chunkFIJZIQXA_cjs.la));l!==null&&n.push({kind:s.localName==="footnoteReference"?"footnote":"endnote",id:l});continue}ws(e,s,n,r,o,a,i);}}function LD(e,t,n){if(e===null)return null;for(let r of e.children)if(!(!qe(r)||r.namespaceUri!==chunkFIJZIQXA_cjs.la)&&!(r.localName!==t||Mm(r))&&nc(chunkFIJZIQXA_cjs.Yf(r,"id",chunkFIJZIQXA_cjs.la))===n)return r;return null}function pP(e,t,n){let r={footnote:new Set(e.noteOrdinals.footnote.keys()),endnote:new Set(e.noteOrdinals.endnote.keys())},o=[];for(let a of ["footnote","endnote"])for(let i of r[a])o.push({kind:a,id:i});for(;o.length>0;){let a=o.pop(),i=LD(t[a.kind],a.kind,a.id);if(i===null)continue;let s={stack:[],inert:false};n(i,s);let l={stack:[],inert:s.stack.length>0},d=[];ws(e,i,d,l,n,null);for(let c of d)e.availableNotes[c.kind].has(c.id)&&(r[c.kind].has(c.id)||(r[c.kind].add(c.id),o.push(c)));}return r}function Fm(e,t,n,r,o){if(n===null)return "";let a=`/word/${t}s.xml`;for(let[l,d]of e.pkg.parts)d.root===n&&(a=l);let i=chunkFIJZIQXA_cjs.He(e.pkg,a),s="";for(let l of n.children){if(!qe(l)||l.namespaceUri!==chunkFIJZIQXA_cjs.la||l.localName!==t||Mm(l))continue;let d=chunkFIJZIQXA_cjs.Yf(l,"id",chunkFIJZIQXA_cjs.la),c=nc(d);if(d===void 0||c===null||!r.has(c))continue;let u=o({...e,noteBody:{kind:t,id:c},docRels:i},l.children);s+=`<div style="mso-element:${t}" id="${t==="footnote"?"ftn":"edn"}${c}">${u===""?"<p></p>":u}</div>`;}return s===""?"":`<div style="mso-element:${t}-list">${s}</div>`}function mP(e){if(!e)return null;let t=[];for(let n of e.children){if(!qe(n)||n.localName!=="tab")continue;let r=et(n),o=Jt(chunkFIJZIQXA_cjs.Yf(n,"pos",chunkFIJZIQXA_cjs.la));if(o===null||o<0||r!=="left"&&r!=="center"&&r!=="right"&&r!=="decimal"&&r!=="bar")continue;let a=et(n,"leader"),i=a==="dot"?"dotted":a==="hyphen"?"dashed":a==="underscore"?"lined":a==="middleDot"?"middledot":a==="heavy"?"heavy":"";t.push(`${r}${i?` ${i}`:""} ${Vn(o)}`);}return t.length>0?`tab-stops:${t.join(" ")}`:null}var Lm="http://schemas.openxmlformats.org/officeDocument/2006/relationships",ND=`${Lm}/numbering`,DD=`${Lm}/footnotes`,HD=`${Lm}/endnotes`,_D=2*1024*1024,BD=8*1024*1024,gP=9525,$D=new Map([["image/png","image/png"],["image/jpeg","image/jpeg"],["image/jpg","image/jpeg"],["image/gif","image/gif"],["image/bmp","image/bmp"],["image/x-ms-bmp","image/bmp"],["image/x-bmp","image/bmp"],["image/webp","image/webp"],["image/svg+xml","image/svg+xml"],["image/tiff","image/tiff"],["image/x-emf","image/x-emf"],["image/x-wmf","image/x-wmf"]]);function rc(e,t,n,r){let o=e.direct!==null&&ge(e.direct,r)!==null||wn(e.defaults,r)!==null||wn(e.tableLevel,r)!==null||wn(e.paragraphLevel,r)!==null||wn(e.characterLevel,r)!==null;return Kn(e,t&&o?r:n)}function qD(e){let t=e.all;if(Kn(e,"vanish"))return {css:"",vanish:true,vertAlign:null,lang:null,rtl:false};let n=[],r=sr(t,"rtl"),o=(r?vt(t,"rFonts","cs"):void 0)??vt(t,"rFonts","ascii")??vt(t,"rFonts","hAnsi")??vt(t,"rFonts","eastAsia")??(r?void 0:vt(t,"rFonts","cs"));if(o!==void 0){let I=D0(o);I&&n.push(`font-family:${I}`);}let a=ro((r?vt(t,"szCs","val"):void 0)??vt(t,"sz","val")??(r?void 0:vt(t,"szCs","val")));a!==null&&a>0&&n.push(`font-size:${Math.round(a/2*100)/100}pt`);let i={...e,direct:null},s=e.direct?t.slice(0,-1):t;rc(e,r,"b","bCs")?n.push("font-weight:bold"):rc(i,r,"b","bCs")&&n.push("font-weight:normal"),rc(e,r,"i","iCs")?n.push("font-style:italic"):rc(i,r,"i","iCs")&&n.push("font-style:normal");let l=[],d=wn(t,"u"),c=d!==null&&et(d)!=="none";c&&l.push("underline");let u=Cm(e,"dstrike");if((Kn(e,"strike")||u)&&l.push("line-through"),l.length>0)n.push(`text-decoration:${l.join(" ")}`);else {let I=wn(s,"u");(I!==null&&et(I)!=="none"||Kn(i,"strike")||Cm(i,"dstrike"))&&n.push("text-decoration:none");}c&&n.push(..._0(d)),u&&!c&&n.push("text-decoration-style:double");let p=Jd(vt(t,"color","val"));p&&n.push(`color:${p}`);let m=Jt(vt(t,"spacing","val"));m!==null&&n.push(`letter-spacing:${Math.round(m/20*100)/100}pt`);let h=et(wn(t,"highlight")),y=h!==void 0&&Object.hasOwn(vf,h)?vf[h]:void 0,g=Jd(vt(t,"shd","fill"));y?n.push(`background-color:${y}`,`mso-highlight:${h}`):g&&n.push(`background-color:${g}`),Kn(e,"caps")?n.push("text-transform:uppercase"):Kn(i,"caps")&&n.push("text-transform:none"),Kn(e,"smallCaps")?n.push("font-variant:small-caps"):Kn(i,"smallCaps")&&n.push("font-variant:normal");let b=et(wn(t,"vertAlign")),S=b==="superscript"||b==="subscript"?b:null,x=Eo((r?vt(t,"lang","bidi"):void 0)??vt(t,"lang","val")??vt(t,"lang","bidi")??vt(t,"lang","eastAsia"));return {css:n.join(";"),vanish:false,vertAlign:S,lang:x,rtl:r}}function VD(e,t,n=false){let r=[],o=et(wn(e,"jc")),a=o!==void 0&&Object.hasOwn(xf,o)?xf[o]:void 0;a&&r.push(`text-align:${n&&a!=="center"&&a!=="justify"?a==="left"?"right":"left":a}`);let i=Jt(vt(e,"spacing","before"));i!==null&&i>=0&&r.push(`margin-top:${Vn(i)}`);let s=Jt(vt(e,"spacing","after"));s!==null&&s>=0&&r.push(`margin-bottom:${Vn(s)}`);let l=Jt(vt(e,"spacing","line")),d=vt(e,"spacing","lineRule");r.push(...H0(l,d));let c=null,u=null,p=null,m=null;for(let b of e){let S=ge(b,"ind");if(!S)continue;let x=Jt(xn(S,"left",chunkFIJZIQXA_cjs.la)??xn(S,"start",chunkFIJZIQXA_cjs.la));x!==null&&(c=x);let I=Jt(xn(S,"right",chunkFIJZIQXA_cjs.la)??xn(S,"end",chunkFIJZIQXA_cjs.la));I!==null&&(u=I);let M=Jt(xn(S,"hanging",chunkFIJZIQXA_cjs.la)),k=Jt(xn(S,"firstLine",chunkFIJZIQXA_cjs.la));M!==null?(p=M,m=null):k!==null&&(m=k,p=null);}!t&&c!==null&&r.push(`margin-${n?"right":"left"}:${Vn(c)}`),u!==null&&r.push(`margin-${n?"left":"right"}:${Vn(u)}`),p!==null&&p!==0?r.push(`text-indent:${Vn(-p)}`):m!==null&&m!==0&&r.push(`text-indent:${Vn(m)}`);let h=mP(wn(e,"tabs"));h&&r.push(h),sr(e,"pageBreakBefore")&&r.push("page-break-before:always"),sr(e,"keepNext")&&r.push("page-break-after:avoid"),sr(e,"keepLines")&&r.push("page-break-inside:avoid"),sr(e,"widowControl")&&r.push("widows:2","orphans:2");let y=Jd(vt(e,"shd","fill"));y&&r.push(`background-color:${y}`);let g=wn(e,"pBdr");if(g)for(let b of ["top","left","bottom","right"]){let S=Oo(ge(g,b));S&&r.push(`border-${b}:${S}`,`mso-border-${b}-alt:${S}`);}return r.join(";")}function KD(e,t,n){let r=e.noteOrdinals[t],o=r.get(n);if(o!==void 0)return o;let a=r.size+1;return r.set(n,a),a}var hP={decimal:"decimal",decimalZero:"decimal-leading-zero",lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman",none:"none"};function bP(e,t,n,r){let o=e.numbering.formatOverrides.get(`${t}:${r}`)??e.numbering.levelFormats.get(n)?.get(String(r))??"decimal",a=e.numbering.startOverrides.get(`${t}:${r}`)??e.numbering.levelStarts.get(n)?.get(String(r))??1;return {fmt:o,start:a}}function WD(e,t){let n,r;for(let s of t){let l=ge(s,"numPr");if(!l)continue;let d=et(ge(l,"numId"));d!==void 0&&(n=d);let c=et(ge(l,"ilvl"));c!==void 0&&(r=c);}if(n===void 0||n==="0")return null;let o=e.numbering.numToAbstract.get(n);if(o===void 0)return null;for(let s=0;s<8&&!((e.numbering.levelFormats.get(o)?.size??0)>0);s+=1){let l=e.numbering.styleLinks.get(o),d=l===void 0?void 0:e.styles.byId.get(l),c=et(ge(ge(ge(d??null,"pPr"),"numPr"),"numId")),u=c===void 0?void 0:e.numbering.numToAbstract.get(c);if(u===void 0||u===o)break;o=u;}let a=Math.min(Math.max(ro(r)??0,0),8),i=bP(e,n,o,a);return {numId:n,abstractId:o,level:a,fmt:i.fmt,start:i.start}}function jD(e,t){let n=chunkFIJZIQXA_cjs.G(e.pkg.contentTypes,t);if(n.ok){let a=$D.get(n.contentType.toLowerCase());if(a!==void 0)return a}let r=t.lastIndexOf("."),o=r===-1?"":t.slice(r+1).toLowerCase();return o==="png"?"image/png":o==="jpg"||o==="jpeg"?"image/jpeg":o==="gif"?"image/gif":o==="bmp"?"image/bmp":o==="webp"?"image/webp":o==="svg"?"image/svg+xml":o==="tif"||o==="tiff"?"image/tiff":o==="emf"?"image/x-emf":o==="wmf"?"image/x-wmf":null}function ZD(e,t){let n=Ba(t,"inline",chunkFIJZIQXA_cjs.sa)??Ba(t,"anchor",chunkFIJZIQXA_cjs.sa);if(!n)return "";let r=Ba(n,"blip",chunkFIJZIQXA_cjs.ra);if(!r)return "";let o=chunkFIJZIQXA_cjs.Yf(r,"embed",chunkFIJZIQXA_cjs.ua);if(!o)return "";let a=e.docRels.find(y=>y.id===o&&y.targetMode!=="External");if(!a)return "";let i=chunkFIJZIQXA_cjs.B(a.ownerPart,a.rawTarget);if(!i.ok)return "";let s=e.pkg.partBytes.get(i.partName.replace(/^\//,""))??e.pkg.partBytes.get(i.partName);if(!s)return "";let l=jD(e,i.partName);if(!l||s.byteLength>e.maxImageBytes||e.imageBudget.used+s.byteLength>e.maxTotalImageBytes)return "";e.imageBudget.used+=s.byteLength;let d=e.imageDataUris.get(i.partName);d==null&&(d=`data:${l};base64,${jl(s)}`,e.imageDataUris.set(i.partName,d));let c=Ba(n,"extent",chunkFIJZIQXA_cjs.sa),u=c?ro(chunkFIJZIQXA_cjs.Yf(c,"cx","")):null,p=c?ro(chunkFIJZIQXA_cjs.Yf(c,"cy","")):null,m=y=>Math.round(y/12700*100)/100,h=u!==null&&p!==null&&u>0&&p>0?` width="${Math.round(u/gP)}" height="${Math.round(p/gP)}" style="width:${m(u)}pt;height:${m(p)}pt"`:"";return `<img src="${d}"${h}>`}function Wo(e,t,n=0){if(n>=chunkFIJZIQXA_cjs.wa)return;let r=chunkFIJZIQXA_cjs.vf(e)?n+1:chunkFIJZIQXA_cjs.xa(e,n);for(let o of e.children)if(qe(o)&&o.kind!=="drawing"){if(o.kind==="contentControl"){let a=o.children.find(i=>i.kind==="contentControlContent");a&&qe(a)&&Wo(a,t,r+1);continue}if(o.kind==="fldChar"){vP(o,t);continue}Wo(o,t,r);}}function vP(e,t){let n=chunkFIJZIQXA_cjs.Yf(e,"fldCharType",chunkFIJZIQXA_cjs.la);n==="begin"?t.stack.push("instr"):n==="separate"&&t.stack.length>0?t.stack[t.stack.length-1]="result":n==="end"&&t.stack.pop();}function zD(e,t,n,r){let o=t.children.find(d=>d.kind==="runProperties"),a=ec(e.styles,n,o&&qe(o)?o:null,e.tableRPr),i=qD(a),s="";for(let d of t.children){if(!qe(d))continue;if(d.kind==="fldChar"){r.inert||vP(d,r);continue}if(d.kind==="instrText"||!r.inert&&r.stack.some(p=>p==="instr")||i.vanish)continue;let c=q0(d);if(c!==""){s+=c;continue}let u=$0(d,e.noteBody,(p,m)=>KD(e,p,m),(p,m)=>e.availableNotes[p].has(m));if(u!==""){s+=u;continue}switch(d.kind){case "text":s+=Pm(Rm(d));break;case "tab":s+='<span style="white-space:pre;mso-tab-count:1"> </span>';break;case "hardBreak":{let p=chunkFIJZIQXA_cjs.Yf(d,"type",chunkFIJZIQXA_cjs.la);s+=p==="page"?'<br style="page-break-before:always">':"<br>";break}case "bookmarkStart":{let p=Dn(chunkFIJZIQXA_cjs.Yf(d,"name",chunkFIJZIQXA_cjs.la));p!==null&&(s+=`<a id="${ir(p)}"></a>`);break}case "drawing":s+=ZD(e,d);break;default:s+=chunk4GBTELJV_cjs.jb(d)?.text??"";break}}if(s==="")return "";i.vertAlign==="superscript"?s=`<sup>${s}</sup>`:i.vertAlign==="subscript"&&(s=`<sub>${s}</sub>`);let l=`${i.lang===null?"":` lang="${i.lang}"`}${i.rtl?' dir="rtl"':""}${i.css===""?"":` style="${ir(i.css)}"`}`;return l===""?s:`<span${l}>${s}</span>`}function Ko(e,t,n,r,o=0){if(o>=chunkFIJZIQXA_cjs.wa)return "";let a="";for(let i of t)if(qe(i))switch(chunkFIJZIQXA_cjs.vf(i)?"fldSimple":i.kind){case "run":a+=zD(e,i,n,r);break;case "hyperlink":{let s=Ko(e,i.children,n,r,o+1);if(s==="")break;let l=chunkFIJZIQXA_cjs.Yf(i,"id",chunkFIJZIQXA_cjs.ua),d=l?e.docRels.find(p=>p.id===l):void 0,c=d===void 0?void 0:d.targetMode==="External"||d.rawTarget.startsWith("#")?d.rawTarget:void 0,u=dx(c,chunkFIJZIQXA_cjs.Yf(i,"anchor",chunkFIJZIQXA_cjs.la));a+=u!==null?`<a href="${ir(u)}">${s}</a>`:s;break}case "bookmarkStart":{let s=Dn(chunkFIJZIQXA_cjs.Yf(i,"name",chunkFIJZIQXA_cjs.la));s!==null&&(a+=`<a id="${ir(s)}"></a>`);break}case "fldSimple":a+=Ko(e,i.children,n,r,o+1);break;case "contentControl":{let s=i.children.find(l=>l.kind==="contentControlContent");s&&qe(s)&&(a+=Ko(e,s.children,n,r,o+1));break}case "revisionInsert":case "revisionMoveTo":a+=Ko(e,i.children,n,r,o+1);break;case "revisionDelete":case "revisionMoveFrom":Wo(i,r,o);break;case "generic":if(chunkFIJZIQXA_cjs.Ye(i))a+=C0(i);else if(chunkFIJZIQXA_cjs.ya(i))a+=Ko(e,i.children,n,r,o+1);else {let s=chunkFIJZIQXA_cjs.Wc(i);s&&(a+=Ko(e,s,n,r,o+1));}break}return a}function UD(e,t){let n=et(ge(t,"pStyle")),r=Er(e.styles,n,"paragraph");for(let o=r.length-1;o>=0;o-=1){let a=chunkFIJZIQXA_cjs.Yf(r[o],"styleId",chunkFIJZIQXA_cjs.la),i=a?/^Heading([1-6])$/.exec(a):null;if(i)return {level:Number(i[1]),fromStyle:true}}if(n===void 0){let o=ro(et(ge(t,"outlineLvl")));if(o!==null&&o>=0&&o<=5)return {level:o+1,fromStyle:false}}return null}function GD(e,t){let n=Er(e.styles,et(ge(t,"pStyle")),"paragraph");for(let r=n.length-1;r>=0;r-=1){let o=N0(chunkFIJZIQXA_cjs.Yf(n[r],"styleId",chunkFIJZIQXA_cjs.la));if(o!==null)return o}return null}function yP(e,t,n,r){let o=t.children.find(g=>g.kind==="paragraphProperties"),a=o&&qe(o)?o:null,i=Tm(e.styles,a,e.tablePPr),s=VD(i,n.asListItem,sr(i,"bidi")),l=Ko(e,t.children,a,r),d=s===""?"":` style="${ir(s)}"`,c=sr(i,"bidi")?' dir="rtl"':"",u=GD(e,a),p=u===null?"":` class="${u}"`,m=UD(e,a);if(n.asListItem)return `<li${m?.fromStyle===true?` class="Heading${m.level}"`:p}${c}${d}>${l}</li>`;let h=m===null?"p":`h${m.level}`,y=m===null?p:m.fromStyle?` class="Heading${m.level}"`:' class="docx-outline"';return `<${h}${y}${c}${d}>${l}</${h}>`}var XD={renderBlocks:(e,t,n)=>oc(e,t,n),advanceFieldState:Wo};function oc(e,t,n){let r="",o=[],a=null,i=new Map,s=n;if(s===void 0){let p={stack:[]};for(let m of t)qe(m)&&Wo(m,p);s={stack:[],inert:p.stack.length>0};}let l=()=>{let p=o.pop();p&&(r+=`</${p.tag}>`);},d=()=>{for(;o.length>0;)l();a=null;},c=(p,m)=>{for(a!==null&&m.level<a&&d();o.length>0&&o[o.length-1].abstractId!==m.abstractId;)l();o.length===0&&(a=m.level);let h=a??m.level,y=m.level-h+1;for(;o.length>y;)l();for(o.length===y&&o[y-1].numId!==m.numId&&l();o.length<y;){let S=h+o.length,x=bP(e,m.numId,m.abstractId,S),I=i.get(`${m.abstractId}:${m.numId}:${S}`)??0,M=x.start+I,k=x.fmt==="bullet"?"ul":"ol",P=k==="ol"?Object.hasOwn(hP,x.fmt)?hP[x.fmt]:"decimal":null,R=k==="ol"&&M!==1?` start="${M}"`:"";r+=P?`<${k}${R} style="list-style-type:${ir(P)}">`:`<${k}>`,o.push({tag:k,numId:m.numId,abstractId:m.abstractId});}let g=`${m.abstractId}:${m.numId}:${m.level}`;i.set(g,(i.get(g)??0)+1);let b=`${m.abstractId}:`;for(let S of i.keys()){if(!S.startsWith(b))continue;let x=S.slice(S.lastIndexOf(":")+1);/^\d+$/.test(x)&&Number(x)>m.level&&i.delete(S);}r+=yP(e,p,{asListItem:true},s);},u=p=>{for(let m of p)if(qe(m))switch(m.kind){case "paragraph":{let h=m.children.find(b=>b.kind==="paragraphProperties"),y=h&&qe(h)?h:null,g=WD(e,Tm(e.styles,y));g?c(m,g):(d(),r+=yP(e,m,{asListItem:false},s));break}case "table":d(),r+=fP(e,m,s,XD);break;case "contentControl":{let h=m.children.find(y=>y.kind==="contentControlContent");h&&qe(h)&&u(h.children);break}case "generic":u(m.children);break;case "bookmarkStart":{let h=Dn(chunkFIJZIQXA_cjs.Yf(m,"name",chunkFIJZIQXA_cjs.la));h!==null&&(r+=`<a id="${ir(h)}"></a>`);break}default:s.inert||Wo(m,s);break}};return u(t),d(),r}function xP(e,t){let n=e.parts.get(e.mainDocumentPart);if(!n||!qe(n.root))return "";let r=n.root.children.find(d=>d.kind==="body");if(!r||!qe(r))return "";let o=xs(e,DD,"/word/footnotes.xml"),a=xs(e,HD,"/word/endnotes.xml"),i={pkg:e,styles:QR(e),numbering:eP(xs(e,ND,"/word/numbering.xml")),docRels:chunkFIJZIQXA_cjs.He(e,e.mainDocumentPart),maxImageBytes:_D,maxTotalImageBytes:BD,imageBudget:{used:0},imageDataUris:new Map,noteOrdinals:{footnote:new Map,endnote:new Map},availableNotes:{footnote:Am(o,"footnote"),endnote:Am(a,"endnote")},noteBody:null},s=oc(i,r.children),l=pP(i,{footnote:o,endnote:a},Wo);return s+Fm(i,"footnote",o,l.footnote,oc)+Fm(i,"endnote",a,l.endnote,oc)}var YD=12*1024*1024;function QD(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function JD(e){return `<div><table>${e.split(`
|
|
25
|
-
`).map(n=>`<tr>${n.split(" ").map(r=>`<td>${QD(r)}</td>`).join("")}</tr>`).join("")}</table></div>`}function Nm(e){if(e.cellRectangle)return {text:e.text,html:JD(e.text)};if(!e.coverage||!e.pkg)return {text:e.text,html:null};let t=chunkJGNVNT2A_cjs.N(e.pkg,e.coverage);if(!t.ok)return {text:e.text,html:null,...t.reason==="unsupported-content"?{reason:t.reason}:{}};let n=e.maxFragmentBytes??YD,r=t.bytes;if(t.bytes.byteLength>n){let i=chunkJGNVNT2A_cjs.N(e.pkg,e.coverage,{omitMedia:true});r=i.ok&&i.bytes.byteLength<=n?i.bytes:null;}let o;try{o=xP(t.package);}catch(i){console.error("docx-editor: copy HTML flavour failed to render",i),o="";}let a=L0(o,r?{bytes:r,lastMarkCovered:t.lastMarkCovered}:null);return {text:e.text,html:a}}function wP(e,t){let n=()=>t.text.length===0?"none":(e.insertPlainText(t.text),"plain");if(t.forcePlain)return n();let r=t.html;if(r===null||r.length===0)return n();let o=ka(r);if(!e.richLaneOpen)return o&&Qd(o.bytes)?"unsupported-content":n();if(o){let i=e.pasteFragment(o.bytes,o.lastMarkCovered);if(i==="unsupported-content")return "unsupported-content";if(i)return "fragment"}let a=lw(r);if(a.ok&&a.truncated&&t.text.length>0)return n();if(a.ok){let i=e.pasteFragment(a.fragmentBytes,a.lastMarkCovered);if(i==="unsupported-content")return "unsupported-content";if(i)return "external-html"}return n()}function Dm(e,t){let n=chunk4GBTELJV_cjs.pe(e,t);if(!n.includes("\xAD"))return n;let r=n.split("");for(let{line:o}of chunk4GBTELJV_cjs.ud(e,t)??[])for(let a of chunk4GBTELJV_cjs.Na(o,t)?.spans??[])chunk4GBTELJV_cjs.dd(a)&&a.range.start<r.length&&(r[a.range.start]=chunkFIJZIQXA_cjs.cb);return r.join("")}function SP(e){return e.includes(chunkFIJZIQXA_cjs.cb)?e.replaceAll(chunkFIJZIQXA_cjs.cb,""):e}function IP(e,t,n,r,o){if(!o||t.paragraphId!==n.paragraphId||/[\r\n\t]/.test(r)||!chunkFIJZIQXA_cjs.pj(e.settingsRoot()))return r;let a=Ae(e,t.paragraphId)??e.part();if(!chunkFIJZIQXA_cjs.qj(a,t.paragraphId))return r;let i=chunkFIJZIQXA_cjs.Ta(a,t.paragraphId);if(i?.kind!=="paragraph")return r;let s=chunkFIJZIQXA_cjs.hj(i).find(g=>g.fieldNodeId===o&&g.start<=t.offset&&g.end>=n.offset);if(!s?.enabled||!chunkFIJZIQXA_cjs.Si(s)||s.maxLength<=0)return r;let l=(chunkFIJZIQXA_cjs.Vi(a,t.paragraphId)??"").slice(s.start,s.end),d=l.slice(0,t.offset-s.start),c=l.slice(n.offset-s.start),u=d+c,p=g=>chunkFIJZIQXA_cjs.Ti(d+g+c,s,u)<=s.maxLength;if(p(r))return r;let m=[...r],h=s.maxLength-[...u].length;if(s.type==="number"&&s.format)for(let g of u)(g===","&&s.format.includes(",")||g==="%"&&s.format.endsWith("%"))&&h++;let y=new Set;if(s.type==="date"){let g=0;for(let b=0;b<m.length;b++)if(/\S/.test(m[b])){if(++g>18)break;y.add(b+1);}else (b+1===m.length||/\S/.test(m[b+1]))&&y.add(b+1);}else if(s.type==="number"&&s.format)for(let g=1;g<=3;g++)y.add(h+g);for(let g of [...y].sort((b,S)=>S-b)){if(g<=Math.max(0,h)||g>m.length)continue;let b=m.slice(0,g).join("");if(p(b))return b}return m.slice(0,Math.max(0,h)).join("")}var kP=SP,e2=2e3;function RP(e){let{session:t}=e,n=null;function r(s){let l=mw(s),d=e.orderedRange(),c=IP(t,d.from,d.to,l,e.textFormFieldId?.()??null).split(`
|
|
26
|
-
`),u=e.deleteSelectionPlan(),p=u.replaceAt??u.collapseTo,m=c.join(""),h=[...u.ops],y=e.consumePendingFormatOps(p.paragraphId,p.offset,m.length);m.length>0&&(h.push({op:"insertText",paragraphId:p.paragraphId,offset:p.offset,text:m}),h.push(...y));let g=[],b=0;for(let k=0;k<c.length-1;k+=1)b+=c[k].length,g.push(p.offset+b);if(g.length>0&&h.push({op:"splitParagraphMany",paragraphId:p.paragraphId,offsets:g}),h.length===0)return;let S=new Set(e.paragraphIds?.()??t.paragraphIdsIn(e.storyScope())),x=c[c.length-1],I=g.length===0?e.caretMark({paragraphId:p.paragraphId,offset:p.offset+x.length}):void 0,M=h.filter(k=>!y.includes(k));e.commit(()=>e.withoutPendingOnRejection(h,M,e.selectionMark(),I),()=>{if(g.length===0)return $e({paragraphId:p.paragraphId,offset:p.offset+x.length});let k=(e.paragraphIds?.()??t.paragraphIdsIn(e.storyScope())).filter(R=>!S.has(R)),P=k[k.length-1];return P?$e({paragraphId:P,offset:x.length}):null});}function o(){e.flushPendingInputAndLayout();let s=e.cellSelection(),l=e.orderedRange(),d=e.paragraphOrder(),c=s?chunk6APGXLBB_cjs.ga(e.layout(),s.cellIds):d.slice(d.indexOf(l.from.paragraphId),d.indexOf(l.to.paragraphId)+1),u=new Map(c.map(k=>[k,{start:!s&&k===l.from.paragraphId?l.from.offset:0,end:!s&&k===l.to.paragraphId?l.to.offset:1/0}])),m=e.storyScope().kind==="body"?t.part():Ae(t,c[0]??l.from.paragraphId);if(m&&YR(m,u))return e.commit(()=>({committed:false,rejected:true,opCount:0,reason:"unsupported-content"})),{text:"",html:null,reason:"unsupported-content"};if(s)return Nm({text:kP(chunk6APGXLBB_cjs.ja(e.layout(),s,Dm)),cellRectangle:true,coverage:null,pkg:null});let{from:h,to:y}=e.orderedRange(),g=t.part(),b=kP(Rd(e.layout(),h,y,e.paragraphOrder(),(k,P)=>g?zR(g,k,P):null,Dm)),S=e.storyScope();if(h.paragraphId===y.paragraphId&&h.offset===y.offset||S.kind!=="body")return {text:b,html:null};let I=t.part(),M=kI(e.layout(),I,h,y,e.paragraphOrder());return Nm({text:b,cellRectangle:false,coverage:M,pkg:t.currentPackage()})}function a(s,l){if(e.editingMode()!=="edit"||e.storyScope().kind!=="body"||e.cellSelection())return false;e.flushPendingInputAndLayout();let d=e.deleteSelectionPlan(),c=d.replaceAt??d.collapseTo,u=false,p=false;return e.commit(()=>{let m=e.collaborationGate(d.ops,{kind:"body"});if(m)return {committed:false,rejected:true,opCount:0,reason:m};let h=e.actorId(),y=t.applyFragmentPaste({kind:"body"},{paragraphId:c.paragraphId,offset:c.offset,fragmentBytes:s,lastMarkCovered:l,priorOps:d.ops,...h!==void 0?{actorId:h}:{}});return u=y.ok,p=!y.ok&&y.detail==="fragment-merge:unsupported-content",{committed:y.ok,rejected:!y.ok,opCount:y.ok?1:0,...y.ok?{}:{reason:y.detail??y.reason}}},()=>$e(c)),p?"unsupported-content":u}function i(s,l){let d=n!==null&&e.now()-n<e2;n=null;let c=wP({richLaneOpen:(e.richPasteAllowed?.()??true)&&e.editingMode()==="edit"&&e.storyScope().kind==="body"&&e.cellSelection()===null,pasteFragment:(u,p)=>a(u,p),insertPlainText:r},{html:l,text:s,forcePlain:d});return c==="unsupported-content"?(e.commit(()=>({committed:false,rejected:true,opCount:0,reason:"unsupported-content"})),false):c!=="none"}return {insertPlainText:r,copyFlavoursNow:o,pasteRichNow:i,armForcePlainPaste:()=>{n=e.now();}}}function PP(e){let{session:t}=e;function n(){return Bo(e.selection())}function r(){e.flushPendingInputAndLayout();let h=e.selection(),y=h.anchor.paragraphId===h.head.paragraphId?void 0:e.paragraphOrder();return kd(e.layout(),h,y)}function o(){return r().from}function a(h){return chunk4GBTELJV_cjs.pe(e.layout(),h)}function i(h,y){let g=t.partFor(e.storyScope())??t.part(),b=chunkFIJZIQXA_cjs.Ta(g,h.paragraphId);if(!b||b.kind!=="paragraph")return null;let S=y==="before"?chunkFIJZIQXA_cjs.mg(b,h.offset):chunkFIJZIQXA_cjs.ng(b,h.offset);if(!S)return null;let x=chunkFIJZIQXA_cjs._f(g,S.controlId),I=x?chunkFIJZIQXA_cjs.Zb(x):null;return I&&(I.lock==="contentLocked"||I.lock==="sdtContentLocked"||I.type==="checkbox"||I.type==="picture")?S:null}function s(h){if(e.trackedAuthorOrNone()!==void 0||e.cellSelection())return false;let y=r();return y.from.paragraphId===y.to.paragraphId&&y.from.offset===y.to.offset?e.atParagraphEnd(h.paragraphId,h.offset):e.atParagraphEnd(y.to.paragraphId,y.to.offset)}function l(h){let y=h?.trim()||void 0,g=d(),b=e.cellSelection(),S=null;return {...g,get replaceAt(){return S??=p(g,y,b),S}}}function d(){e.flushPendingInputAndLayout();let h=e.cellSelection();if(h){let S=[];for(let x of chunk6APGXLBB_cjs.ga(e.layout(),h.cellIds)){let I=chunk4GBTELJV_cjs.pe(e.layout(),x).length;I>0&&S.push({op:"deleteText",paragraphId:x,start:0,end:I});}return {ops:S,collapseTo:o()}}let y=e.selection();if(y.anchor.paragraphId===y.head.paragraphId&&y.anchor.offset===y.head.offset)return {ops:[],collapseTo:chunk4GBTELJV_cjs.wd(e.layout(),y.head)};let{from:g,to:b}=r();return RI(e.layout(),t.partFor(e.storyScope())??t.part(),g,b,e.paragraphOrder(),e.revisionView())}function c(){return l().ops}function u(h,y,g){if(!(g!==void 0||e.editingMode()==="suggest")||h.paragraphId!==y.paragraphId||y.offset<=h.offset)return h.offset;let S=(g??e.author())?.trim();if(!S)return chunk4GBTELJV_cjs.wd(e.layout(),y).offset;let x=Ae(t,y.paragraphId)??t.part(),I=chunkFIJZIQXA_cjs.Ta(x,y.paragraphId);if(!I||I.kind!=="paragraph")return chunk4GBTELJV_cjs.wd(e.layout(),y).offset;let M={start:h.offset,end:y.offset},{past:k,landing:P}=chunkFIJZIQXA_cjs.sh(I,M,y.offset,S,e.trackedDate()),R=chunkFIJZIQXA_cjs.qh(I,h.offset,k,S);return (k-h.offset>R?P:k)-R}function p(h,y,g){let b=h.collapseTo;if(y===void 0&&e.editingMode()!=="suggest")return b;if(g){for(let W of g.cellIds){let E=chunk6APGXLBB_cjs.fa(e.layout(),[W]),_=E.length>0?E:chunk6APGXLBB_cjs.ga(e.layout(),[W]);if(_.length===0)continue;let G=new Map,U=Z=>{let F=G.get(Z);return F===void 0&&(F=u({paragraphId:Z,offset:0},{paragraphId:Z,offset:a(Z).length},y),G.set(Z,F)),F},$=(y??e.author())?.trim(),pe=Z=>{let F=a(Z);if(!$)return /\S/.test(F);let L=chunkFIJZIQXA_cjs.Ta(Ae(t,Z)??t.part(),Z);if(!L||L.kind!=="paragraph")return /\S/.test(F);let B="",q=0;for(let X of chunkFIJZIQXA_cjs.rh(L,0,F.length,$))B+=F.slice(q,Math.max(q,X.start)),q=Math.max(q,X.end);return B+=F.slice(q),/\S/.test(B)},he=null;for(let Z=_.length-1;Z>=0;Z-=1){let F=_[Z];if(pe(F)){he=F;break}}if(he===null)for(let Z=_.length-1;Z>=0;Z-=1){let F=_[Z];if(U(F)!==0){he=F;break}}return he??=_[_.length-1],{paragraphId:he,offset:U(he)}}return b}let{from:S,to:x}=r();if(S.paragraphId===x.paragraphId&&S.offset===x.offset)return b;if(S.paragraphId===x.paragraphId)return {paragraphId:x.paragraphId,offset:u(S,x,y)};let I=new Set(h.ops.flatMap(W=>W.op==="deleteBlock"?[W.blockId]:[])),M=Ae(t,x.paragraphId)??t.part();if(I.size>0)for(let W=chunkFIJZIQXA_cjs.Ua(M,x.paragraphId);W;W=chunkFIJZIQXA_cjs.Ua(M,W.id)){if(!I.has(W.id))continue;let E={paragraphId:b.paragraphId,offset:a(b.paragraphId).length};return {paragraphId:b.paragraphId,offset:u(b,E,y)}}let k=(y??e.author())?.trim();if(!k)return b;let P=new Set(h.ops.flatMap(W=>W.op==="joinParagraphs"?[W.secondId]:[])),R=e.paragraphOrder(),w=R.indexOf(S.paragraphId),O=R.indexOf(x.paragraphId);if(w===-1||O===-1)return b;let N=W=>{let E=chunkFIJZIQXA_cjs.Ta(M,W);return E?.kind==="paragraph"&&chunkFIJZIQXA_cjs.bl(E,k)},A=O;for(;A>w&&P.has(R[A])&&N(R[A-1]);)A-=1;let V=0;for(let W=A;W<=O;W+=1){let E=R[W],_={paragraphId:E,offset:E===S.paragraphId?S.offset:0},G=E===x.paragraphId?chunk4GBTELJV_cjs.wd(e.layout(),x):{paragraphId:E,offset:a(E).length};W===A&&(V+=_.offset),V+=G.offset-_.offset-m(_,G,k);}return {paragraphId:R[A],offset:V}}function m(h,y,g){let b=g?.trim();if(!b||h.paragraphId!==y.paragraphId)return 0;let S=Ae(t,y.paragraphId)??t.partFor(e.storyScope())??t.part(),x=chunkFIJZIQXA_cjs.Ta(S,y.paragraphId);return !x||x.kind!=="paragraph"?0:chunkFIJZIQXA_cjs.qh(x,h.offset,y.offset,b)}return {selectionMark:n,orderedRange:r,orderedStart:o,textOf:a,inlineControlBeside:i,splitEndsTheParagraph:s,deleteSelectionPlan:l,deleteSelectionOps:c,replacementOffset:u}}function _m(e,t,n,r){if(r===n)return e;let o=a=>a.paragraphId===t?{...a,offset:chunk2GO5T2JU_cjs.c(a.offset,n,r)}:a;return {anchor:o(e.anchor),head:o(e.head)}}var CP=[24,16,12,8,6,4],t2=8;function TP(e,t,n,r,o){let a=r.textOf(e.paragraphId)??"",i=n.after.slice(0,t2);if(i&&a.slice(e.offset,e.offset+i.length)===i)return e;let s=new Set;for(let l of [e.paragraphId,t.paragraphId]){let d=o.indexOf(l);if(!(d<0))for(let c of [d,d-1,d+1])o[c]&&s.add(o[c]);}for(let l of CP){if(n.before.length<l)continue;let d=n.before.slice(-l);if(a.slice(Math.max(0,e.offset-l),e.offset)===d)return e;let c=null;for(let u of s){let p=r.textOf(u)??"";for(let m=p.indexOf(d);m>=0;m=p.indexOf(d,m+1)){if(c)return e;c={...e,paragraphId:u,offset:m+d.length};}}if(c)return c}return e}var ac="stale",n2=16;function Hm(e,t){return e.anchor.paragraphId===t.anchor.paragraphId&&e.anchor.offset===t.anchor.offset&&e.head.paragraphId===t.head.paragraphId&&e.head.offset===t.head.offset}function EP(e){let t=null,n=false,r=o=>{let a=new Set(e.order());return o.filter(i=>a.has(i)).slice(0,n2).map(i=>({id:i,text:e.textOf(i)??""}))};return {expectHistory(o){n=o;},note(o,a,i){let s=n;if(n=false,t!==null){s&&t!==ac&&t.history.length===0&&(t={...t,history:r(a)});return}if(!i){t=ac;return}let l=new Map;for(let c of [o.anchor.paragraphId,o.head.paragraphId]){let u=e.textOf(c);u!==null&&l.set(c,u);}let d=c=>{let u=l.get(c.paragraphId)??"",p=CP[0];return {before:u.slice(Math.max(0,c.offset-p),c.offset),after:u.slice(c.offset,c.offset+p)}};t={selection:o,before:l,order:e.order(),context:{anchor:d(o.anchor),head:d(o.head)},history:s?r(a):[]};},noteLocal(){t!==null&&(t=ac);},discard(){t=null;},map(o){let a=t;if(t=null,!a)return o;let i=e.carried?.()??null,s=x=>i&&Hm(i.from,x)&&Hm(o,x)&&e.textOf(i.to.anchor.paragraphId)!==null&&e.textOf(i.to.head.paragraphId)!==null?i.to:null;if(a===ac)return s(o)??o;let l=e.order(),d=new Set(l);for(let{id:x,text:I}of a.history){if(!d.has(x))continue;let M=e.textOf(x)??I;if(M===I)continue;let k=0;for(;k<I.length&&k<M.length&&I[k]===M[k];)k+=1;let P={paragraphId:x,offset:k+Math.max(0,M.length-I.length)};return {anchor:P,head:P}}let c=new Set(l),u=s(a.selection);if(u)return u;let p=new Set(a.order),m=x=>{let I=a.before.get(x.paragraphId),M=e.textOf(x.paragraphId);if(I===void 0||M===null||M.length>=I.length||!I.startsWith(M)||x.offset<=M.length)return null;let k=l[l.indexOf(x.paragraphId)+1];return k===void 0||p.has(k)||!(e.textOf(k)??"").startsWith(I.slice(M.length))?null:{paragraphId:k,offset:x.offset-M.length}},h=m(o.anchor),y=m(o.head),g=o;for(let[x,I]of a.before)c.has(x)&&(g=_m(g,x,I,e.textOf(x)??I));g={anchor:h??g.anchor,head:y??g.head};let b=x=>{if(c.has(x.paragraphId))return x;let I=a.order.indexOf(x.paragraphId),M=null;for(let R=I-1;R>=0&&M===null;R-=1)c.has(a.order[R])&&(M=a.order[R]);let k=a.before.get(x.paragraphId),P=M===null?"":e.textOf(M)??"";if(M!==null&&k!==void 0&&P.endsWith(k)){let R=P.length-k.length+x.offset;return {paragraphId:M,offset:R}}for(let R=I+1;I>=0&&R<a.order.length;R+=1){let w=a.order[R];if(c.has(w))return {paragraphId:w,offset:0}}return M===null?x:{paragraphId:M,offset:P.length}};return !(l.length!==a.order.length||l.some((x,I)=>x!==a.order[I]))||!Hm(o,a.selection)?{anchor:b(g.anchor),head:b(g.head)}:{anchor:TP(b(g.anchor),o.anchor,a.context.anchor,e,l),head:TP(b(g.head),o.head,a.context.head,e,l)}}}}function OP(e,t){let n=e?.historySelection?.()??null;return n&&t?r2(n,t):null}function MP(e){let t=e?.remoteSelectionMove?.();if(!t)return null;let n=o=>({paragraphId:o.nodeId,offset:o.offset}),r=o=>({anchor:n(o.anchor),head:n(o.head)});return {from:r(t.from),to:r(t.to)}}function r2(e,t){let n=a=>{let i=t.paragraphByStableId(a.paragraphId);return i?{paragraphId:i.nodeId,offset:Math.min(a.offset,i.text.length)}:null},r=n(e.anchor),o=n(e.head);return r&&o?{anchor:r,head:o}:null}function AP(e){return {atParagraphEnd(t,n){let r=chunkFIJZIQXA_cjs.Vi(e.partOf(t),t);return r!==null&&n===r.length},followerStyleId(t){let n=e.partOf(t),r=e.styleCascade();if(!r)return;let a=chunkFIJZIQXA_cjs.Dh(n,t).find(l=>l.localName==="pStyle")?.attributes?.val??r.defaultParagraphStyleId;if(a==null)return;let i=r.styles.get(a)?.next;if(!i||i===a)return;let s=r.styles.get(i);if(!(!s||s.type!=="paragraph"))return i===r.defaultParagraphStyleId?null:i}}}var FP=chunk4GBTELJV_cjs.Ke;function LP(e){let{session:t,...n}=e;return chunk4GBTELJV_cjs.Ye({view:t,...n})}function $t(e){return e.closest(".docx-editor__scroll-container")}function NP(e,t,n){let r=e.getBoundingClientRect(),o=t.getBoundingClientRect();return {top:(t.scrollTop!==0&&r.top===0&&o.top===0?t.scrollTop-e.offsetTop:o.top+t.clientTop-r.top)/n,height:t.clientHeight/n}}function DP(e,t,n){let r=$t(e);if(!r||r.clientHeight<=0||t.pages.length===0||n<=0)return null;let o=NP(e,r,n),a=o.top+o.height/2;for(let i of t.pages)if(a<i.box.y+i.box.height)return i.index+1;return t.pages.length}function HP(e,t,n,r){let o=$t(e);if(!o||o.clientHeight===0)return;let a=NP(e,o,r),i=[];for(let s of [n.anchor,n.head]){let l=chunk4GBTELJV_cjs.ne(t,s);l&&i.push(l.pageIndex);}return chunk6APGXLBB_cjs.ca({layout:t,viewport:a,overscanPages:1,pinnedPages:i})}function Bm(e,t){if(e===t)return true;if(!e||!t||e.size!==t.size)return false;for(let n of e)if(!t.has(n))return false;return true}function ic(e,t){let n=e.pages[e.pages.length-1],r=n?n.box.y+n.box.height:0,o=t?e.pages.filter(s=>t.has(s.index)):e.pages,a=0;for(let s of o)a=Math.max(a,s.box.x+s.box.width);let i=new Map;if(new Set(o.map(s=>s.box.width)).size>1)for(let s of e.pages)i.set(s.index,(a-s.box.width)/2-s.box.x);return {width:a,height:r,pageOffsetX:i}}function _P(e,t){if(e.width!==t.width||e.height!==t.height||e.pageOffsetX.size!==t.pageOffsetX.size)return false;for(let[n,r]of e.pageOffsetX)if(t.pageOffsetX.get(n)!==r)return false;return true}function $P(e){if(typeof e.defaultView?.createImageBitmap!="function")return null;let t=e.defaultView;return Object.freeze({async decode(n,r,o){let a=new Blob([new Uint8Array(n)],{type:r}),i;try{i=await t.createImageBitmap(a,{imageOrientation:"from-image"});}catch(s){if(s?.name!=="TypeError")throw s;i=await t.createImageBitmap(a);}try{let s=i.width,l=i.height;if(s<=0||l<=0)throw new Error("image dimensions invalid");if(s*l>o.maxPixels)throw new Error("image dimensions exceed limits");return Object.freeze({pixelWidth:s,pixelHeight:l,dpiX:96,dpiY:96})}finally{i.close();}},convertPreserved(n,r,o){return r==="image/tiff"?i2(e,n,o):o2(n,r)}})}async function o2(e,t,n){let{convertEmfToDataUrl:r,convertWmfToDataUrl:o}=await import('emf-converter'),a=new Uint8Array(e),i=a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength),s={maxWidth:4096,maxHeight:4096},l=t==="image/x-emf"?await r(i,s):await o(i,s);if(!l)return null;let d="data:image/png;base64,";if(!l.startsWith(d))return null;let c=atob(l.slice(d.length)),u=new Uint8Array(c.length);for(let p=0;p<c.length;p+=1)u[p]=c.charCodeAt(p);return Object.freeze({bytes:u,mime:"image/png"})}function BP(e,t){let n=e[t];if(!Array.isArray(n)||n.length===0)return null;let r=Number(n[0]);return Number.isSafeInteger(r)&&r>0?r:null}async function a2(e,t){let n=await import('utif2'),r=n.default??n,o=e.slice().buffer,a=r.decode(o)[0];if(!a)return null;let i=BP(a,"t256"),s=BP(a,"t257");if(i===null||s===null||i>t.maxDimension||s>t.maxDimension||i>t.maxPixels/s)return null;let l=i*s;if(l*4>t.maxDecodedBytes||(r.decodeImage(o,a),a.width!==i||a.height!==s))return null;let d=r.toRGBA8(a);return d.length!==l*4?null:Object.freeze({rgba:d,pixelWidth:i,pixelHeight:s})}async function i2(e,t,n){let r=await a2(t,n);if(r===null)return null;let o=await s2(e,r.rgba,r.pixelWidth,r.pixelHeight);return o===null?null:Object.freeze({bytes:o,mime:"image/png"})}async function s2(e,t,n,r){let o=e.createElement("canvas");if(o.width=n,o.height=r,o.width!==n||o.height!==r)return null;let a=o.getContext("2d");if(!a)return null;let i=a.createImageData(n,r);i.data.set(t),a.putImageData(i,0,0);let s=await new Promise(l=>{o.toBlob(d=>l(d),"image/png");});return s?new Uint8Array(await s.arrayBuffer()):null}function qP(){return Object.freeze({async decode(){throw new Error("Image decode unavailable in headless environment")}})}function VP(e){return typeof URL.createObjectURL!="function"||typeof URL.revokeObjectURL!="function"?null:Object.freeze({create(t,n){let r=e.mintValidatedBytes(t,t.contentId);if(!r)throw new Error(`PaintImageUrlSource: validated bytes unavailable for ${t.resourceKey}`);let o=new Uint8Array(r);return URL.createObjectURL(new Blob([o],{type:n}))},revoke(t){URL.revokeObjectURL(t);}})}var l2="docx-editor-one-surface__caret",$m="docx-editor-one-surface__caret--steady",d2=530;function KP(e,t,n){let r=e.ownerDocument,o=r.createElement("div");o.className=l2,o.dataset.docxCaret="",o.dataset.docxMarker="",o.setAttribute("contenteditable","false"),o.setAttribute("aria-hidden","true"),o.dataset.noColorInvert="",o.style.position="absolute",o.style.pointerEvents="none",o.style.userSelect="none",o.style.setProperty("-webkit-user-select","none");let a=false,i=null,s=null,l=null;function d(){let S=r.activeElement;return S===e||!!S&&e.contains(S)}function c(S){return S.anchor.paragraphId===S.head.paragraphId&&S.anchor.offset===S.head.offset}function u(){s=null,i!==null&&(clearTimeout(i),i=null),o.classList.remove($m),o.remove(),e.style.removeProperty("caret-color"),l?.style.removeProperty("caret-color"),l=null;}function p(){o.classList.add($m),i!==null&&clearTimeout(i),i=setTimeout(()=>{i=null,o.classList.remove($m);},d2);}function m(){if(a||!d()||n().suppress){u();return}let{layout:S,selection:x,scopedHost:I,scopedHostKind:M,scopedOrigin:k,preferredPageIndex:P,preferredLineId:R,measurer:w,typingStyle:O}=n(),N=t();if(!c(x)){u();return}let A=chunk4GBTELJV_cjs.ne(S,x.head,{...w?{measurer:w}:{},...P!==void 0?{preferredPageIndex:P}:{},...R!==void 0?{preferredLineId:R}:{}});if(!A||!Number.isInteger(A.pageIndex)){u();return}if(O&&w){let{pageIndex:G,lineId:U}=A,$=chunk4GBTELJV_cjs.ud(S,x.head.paragraphId)?.find(he=>he.pageIndex===G&&he.line.id===U),pe=$?.line;if(pe&&!pe.drawings?.length&&!chunk4GBTELJV_cjs.Vd(A)){let he=O();if(he){let Z={...Od(S,x)??chunk4GBTELJV_cjs.$,...he},F=w.lineMetrics(Z);if(F.height>0){let L=chunk4GBTELJV_cjs.Dd({...A,width:0,y:pe.spans.length>0?pe.box.y+pe.baseline-F.baseline-chunk4GBTELJV_cjs.ea(Z):A.y,height:F.height},$?.clipBox);if(!L){u();return}A=L;}}}}let V=I??e.querySelector(`[data-page-index="${A.pageIndex}"] > .docx-page-content`);if(!V){u();return}if(!(A.height>0)){u();return}o.style.left=`${(A.x-(k?.x??0))*N}px`,o.style.top=`${(A.y-(k?.y??0))*N}px`,o.style.height=`${A.height*N}px`;let W=chunk4GBTELJV_cjs.Vd(A);o.style.transformOrigin=W?"0 0":"",o.style.transform=W?"rotate(-90deg)":"",o.parentNode!==V&&V.append(o),e.style.caretColor="transparent",l&&l!==I&&l.style.removeProperty("caret-color"),l=I??null,l?.style.setProperty("caret-color","transparent");let E=V===I?M??"scoped":"body",_=`${A.pageIndex}:${E}:${A.x}:${A.y}:${A.height}`;_!==s&&(s=_,p());}let h=()=>{a=true,m();},y=()=>{a=false,m();},g=()=>m(),b=S=>{let x=S.relatedTarget;x&&e.contains(x)||u();};return e.addEventListener("compositionstart",h),e.addEventListener("compositionend",y),e.addEventListener("focusin",g),e.addEventListener("focusout",b),{update:m,destroy(){e.removeEventListener("compositionstart",h),e.removeEventListener("compositionend",y),e.removeEventListener("focusin",g),e.removeEventListener("focusout",b),u();}}}function qm(e){let t=e.indexOf("#");return t===-1?"":e.slice(0,t)}function jo(e,t){let n=qm(t);return n.length===0?e.part():e.currentPackage().parts.get(n)??e.part()}function Vm(e,t){return !e||e.kind==="tableBody"?null:qm(e.tableId)===qm(t)?e:null}function Ss(e,t,n){let r=i=>{for(let s of i)if(s.kind==="table"){if(s.tableId===t)return s;for(let l of s.rows)for(let d of l.cells){let c=r(d.blocks);if(c)return c}}return null},o=e.pages[n];if(!o)return null;let a=r(o.fragments);if(a)return {table:a,origin:o.contentBox};for(let i of [o.header,o.footer]){if(!i)continue;let s=r(i.fragments);if(s)return {table:s,origin:i.box}}return null}function Km(e,t){for(let n of e)if(n.kind==="table"){t(n);for(let r of n.rows)for(let o of r.cells)Km(o.blocks,t);}}function c2(e,t){for(let n of e.pages){let r=o=>{for(let a=0;a<o.rows.length;a+=1)t({table:o,row:o.rows[a],rowIndex:a});};Km(n.fragments,r);for(let o of [n.header,n.footer])o&&Km(o.fragments,r);}}function Wm(e,t,n,r){let o=null;return c2(e,a=>{a.table.tableId===t&&a.row.id===n&&a.row.isHeaderRepeat===r&&(o=a);}),o}function jm(e,t){return {sourceRevision:e,tableId:t.table.tableId,rowId:t.row.id,isHeaderRepeat:t.row.isHeaderRepeat}}function WP(e,t,n){let r=n.gridColumnId;return r?{sourceRevision:e,tableId:t.table.tableId,gridColumnId:r,isHeaderRepeat:t.row.isHeaderRepeat}:null}function jP(e,t,n,r){return {sourceRevision:e,tableId:t.table.tableId,leftGridColumnId:n,rightGridColumnId:r,isHeaderRepeat:t.row.isHeaderRepeat}}function ZP(e,t,n){return {sourceRevision:e,tableId:t.table.tableId,gridColumnId:n,isHeaderRepeat:t.row.isHeaderRepeat}}var u2=120,zP=20;function sc(e){return chunkFIJZIQXA_cjs.nd(chunkFIJZIQXA_cjs._i(e,"w"))??0}function f2(e,t,n){let r=e.pagesLayer.getBoundingClientRect(),o=e.scale();return {x:(t-r.left)/o,y:(n-r.top)/o}}function Zm(e){let t=e.editingMode==="view";return {editable:!t,viewing:t}}function zm(e,t){return t.kind==="insertColumn"?Wm(e,t.tableId,t.rowId,t.isHeaderRepeat):"rowId"in t?Wm(e,t.tableId,t.rowId,t.isHeaderRepeat):null}function UP(e){let t=e.furnitureLayer;t.className="docx-table-furniture",t.setAttribute("contenteditable","false"),t.style.position="absolute",t.style.left="0",t.style.top="0",t.style.pointerEvents="none";let n=null,r=null,o=null,a=null,i=null,s=null,l=false,d=0,c=0,u=null,p=null,m=null;function h(D){return D instanceof HTMLButtonElement&&(D.classList.contains("docx-table-insert-row")||D.classList.contains("docx-table-insert-column"))}function y(){let D=document.activeElement;return D!==null&&h(D)&&D.closest(".docx-table-furniture")===t?D:null}function g(D){for(let j of [...t.children])h(j)&&j!==D&&j.remove();}function b(){p=null,m=null;}function S(){n!==null&&(clearTimeout(n),n=null);}function x(){for(let j of [...t.children])h(j)||j.remove();let D=y();if(!D){g(null),b();return}p=D,g(D);}function I(D){let j=p??y(),z=j!==null&&document.activeElement===j;b(),t.replaceChildren(),D&&z&&e.pagesLayer.focus({preventScroll:true});}function M(){for(let D of [...t.children])h(D)||D.remove();}function k(D,j,z,ne){let ee=e.read().layout.pages[D];if(!ee)return {left:0,top:0};let ie=ne??ee.contentBox,de=e.scale(),Re=e.pageOffsetX(D);return {left:(ie.x+j+Re)*de,top:(ie.y+z)*de}}function P(D,j){let z=e.read(),ne=Ss(z.layout,j.tableId,j.pageIndex);if(!ne)return;let{table:re,origin:ee}=ne,ie=document.createElement("div");ie.className="docx-table-resize-preview",ie.style.position="absolute",ie.style.pointerEvents="none";let de=j.kind!=="rowDivider",Re=k(j.pageIndex,de?re.box.x+D:re.box.x,de?re.box.y:re.box.y+D,ee);ie.style.left=`${Re.left}px`,ie.style.top=`${Re.top}px`,ie.style.width=de?"2px":`${re.box.width*e.scale()}px`,ie.style.height=de?`${re.box.height*e.scale()}px`:"2px",t.append(ie);}function R(){let D=document.createElement("button");return D.type="button",D.textContent="+",D.style.position="absolute",D.style.pointerEvents="auto",D}function w(D){V(D);let j=m;if(!j)return;let z=e.read();j.kind==="insertRow"?E(j,z):j.kind==="insertColumn"&&_(j,z);}function O(){queueMicrotask(()=>{!p||document.activeElement===p||l||r?.kind==="insertRow"||r?.kind==="insertColumn"||(p.remove(),b());});}function N(){if(p&&t.contains(p))return p;let D=y();if(D)return p=D,D;let j=R();return j.addEventListener("pointerenter",()=>{l=true,S();}),j.addEventListener("pointerleave",()=>{l=false;}),j.addEventListener("pointerdown",V),j.addEventListener("mousedown",V),j.addEventListener("click",w),j.addEventListener("blur",O),p=j,j}function A(D,j){let z=Ss(j.layout,D.tableId,D.pageIndex);if(!z)return;let{table:ne,origin:re}=z,ee=N();if(g(ee),m=D,ee.dataset.tableId=D.tableId,D.kind==="insertRow"){let ie=ne.rows.find(Ke=>Ke.id===D.rowId);if(!ie)return;ee.dataset.rowId=D.rowId,delete ee.dataset.gridColumnId,ee.className="docx-table-insert-row",ee.setAttribute("aria-label",e.label("table.insertRowBelow"));let de=ie.box.y+ie.box.height/2,Re=k(D.pageIndex,ne.box.x-14,de,re);ee.style.left=`${Re.left}px`,ee.style.top=`${Re.top-8}px`;}else {let ie=ne.rows[0]?.cells.find(pt=>pt.gridColumnId===D.gridColumnId);if(!ie)return;ee.dataset.gridColumnId=D.gridColumnId,delete ee.dataset.rowId;let de=ne.columnEdges[ie.gridColumn]??0,Re=ne.columnEdges[ie.gridColumn+1]??ne.box.width;ee.className="docx-table-insert-column",ee.setAttribute("aria-label",e.label("table.insertColumnRight"));let Ke=k(D.pageIndex,ne.box.x+(de+Re)/2-8,ne.box.y-14,re);ee.style.left=`${Ke.left}px`,ee.style.top=`${Ke.top}px`;}t.contains(ee)||t.append(ee);}function V(D){D.preventDefault(),D.stopPropagation();}function W(D,j){if(M(),g(p??y()),!(s||j.editingMode==="view")){if((D.kind==="columnDivider"||D.kind==="rightEdge")&&!D.isHeaderRepeat){let z=Ss(j.layout,D.tableId,D.pageIndex);if(!z)return;let{table:ne,origin:re}=z,ee=document.createElement("div");ee.className=D.kind==="rightEdge"?"docx-table-edge-handle-right layout-table-edge-handle-right":"docx-table-divider-handle layout-table-resize-handle",ee.style.position="absolute",ee.style.pointerEvents="auto",ee.style.cursor="col-resize",ee.dataset.active="true";let ie=k(D.pageIndex,ne.box.x+D.edgeX,ne.box.y,re);ee.style.left=`${ie.left-3}px`,ee.style.top=`${ie.top}px`,ee.style.width="6px",ee.style.height=`${ne.box.height*e.scale()}px`,ee.addEventListener("pointerdown",G),t.append(ee);}if(D.kind==="rowDivider"&&!D.isHeaderRepeat){let z=Ss(j.layout,D.tableId,D.pageIndex);if(!z)return;let{table:ne,origin:re}=z,ee=document.createElement("div");ee.className="docx-table-row-divider-handle layout-table-row-resize-handle",ee.style.position="absolute",ee.style.pointerEvents="auto",ee.style.cursor="row-resize",ee.dataset.active="true";let ie=k(D.pageIndex,ne.box.x,ne.box.y+D.edgeY,re);ee.style.left=`${ie.left}px`,ee.style.top=`${ie.top-3}px`,ee.style.width=`${ne.box.width*e.scale()}px`,ee.style.height="6px",ee.addEventListener("pointerdown",G),t.append(ee);}D.kind==="insertRow"&&!D.isHeaderRepeat&&A(D,j),D.kind==="insertColumn"&&!D.isHeaderRepeat&&A(D,j);}}function E(D,j){let z=zm(j.layout,D);if(!z)return;let ne=Zm(j),re=Tr({command:{type:"insertRow",where:"below",target:jm(D.sourceRevision,z)},part:jo(e.session(),D.tableId),layout:j.layout,storeRevision:j.storeRevision,selection:j.selection,cellSelection:j.cellSelection,themeColors:j.themeColors,...ne});e.applyTableCommandPlan(re);}function _(D,j){let z=zm(j.layout,D);if(!z)return;let ne=z.row.cells.find(de=>de.gridColumnId===D.gridColumnId);if(!ne)return;let re=WP(D.sourceRevision,z,ne);if(!re)return;let ee=Zm(j),ie=Tr({command:{type:"insertColumn",where:"right",target:re},part:jo(e.session(),D.tableId),layout:j.layout,storeRevision:j.storeRevision,selection:j.selection,cellSelection:j.cellSelection,themeColors:j.themeColors,...ee});e.applyTableCommandPlan(ie);}function G(D){if(D.button!==0)return;let j=e.read();if(j.editingMode==="view"||!r||r.kind!=="columnDivider"&&r.kind!=="rightEdge"&&r.kind!=="rowDivider")return;D.preventDefault(),D.stopPropagation();let z=r,ne=zm(j.layout,z);if(!ne)return;let re=chunkFIJZIQXA_cjs.aj(jo(e.session(),z.tableId).root,z.tableId);if(!re.ok||z.kind!=="rowDivider"&&chunkFIJZIQXA_cjs.Bk(re.topology)!==null)return;let ee=0,ie=0,de=0,Re=re.topology.gridColumns.reduce((ot,Le)=>ot+sc(Le),0),Ke;if(z.kind==="columnDivider"){let ot=re.topology.gridColumns.find(Se=>Se.id===z.leftGridColumnId),Le=re.topology.gridColumns.find(Se=>Se.id===z.rightGridColumnId);if(!ot||!Le)return;ee=sc(ot),ie=sc(Le),Ke=jP(z.sourceRevision,ne,z.leftGridColumnId,z.rightGridColumnId);}else if(z.kind==="rightEdge"){let ot=re.topology.gridColumns.find(Le=>Le.id===z.gridColumnId);if(!ot)return;ee=sc(ot),ie=0,Ke=ZP(z.sourceRevision,ne,z.gridColumnId);}else de=Math.max(20,Math.round(ne.row.box.height*zP)),Ke=jm(z.sourceRevision,ne);let pt=D.currentTarget;pt.setPointerCapture(D.pointerId),d=D.clientX,c=D.clientY,s={pointerId:D.pointerId,startClientX:D.clientX,startClientY:D.clientY,startEdgePt:z.kind==="rowDivider"?z.edgeY:z.edgeX,leftTwips:ee,rightTwips:ie,tableWidthTwips:Re,rowHeightTwips:de,target:z,ref:ne,resizeTarget:Ke,captureElement:pt,rightEdge:z.kind==="rightEdge",vertical:z.kind==="rowDivider",cancelled:false};for(let ot of [...t.children])ot!==pt&&ot.remove();P(z.kind==="rowDivider"?z.edgeY:z.edgeX,z);}function U(){if(s){try{s.captureElement.hasPointerCapture(s.pointerId)&&s.captureElement.releasePointerCapture(s.pointerId);}catch{}s.cancelled=true,s=null,x(),r=null;}}function $(){if(!s||s.cancelled){s=null,x();return}let D=s;s=null;try{D.captureElement.hasPointerCapture(D.pointerId)&&D.captureElement.releasePointerCapture(D.pointerId);}catch{}if(D.vertical?c===D.startClientY:d===D.startClientX){x();return}let j=e.read(),z=Zm(j),ne=(D.vertical?c-D.startClientY:d-D.startClientX)/e.scale(),re=Math.round(ne*zP),ee;if(D.target.kind==="rowDivider")ee=nS({part:jo(e.session(),D.target.tableId),layout:j.layout,storeRevision:j.storeRevision,selection:j.selection,cellSelection:j.cellSelection,themeColors:j.themeColors,...z},D.resizeTarget,Math.max(20,D.rowHeightTwips+re));else if(D.rightEdge&&D.target.kind==="rightEdge"){let ie=Math.max(300,D.leftTwips+re),de=Math.max(ie,D.tableWidthTwips+re);ee=Tr({command:{type:"commitTableRightEdgeResize",target:D.resizeTarget,columnWidthTwips:ie,tableWidthTwips:de},part:jo(e.session(),D.target.tableId),layout:j.layout,storeRevision:j.storeRevision,selection:j.selection,cellSelection:j.cellSelection,themeColors:j.themeColors,...z});}else if(D.target.kind==="columnDivider"){let ie=D.leftTwips+re,de=D.rightTwips-re;ie=Math.max(300,ie),de=Math.max(300,de);let Re=D.leftTwips+D.rightTwips;ie+de!==Re&&(ie>Re-300?(ie=Re-300,de=300):de=Re-ie),ee=Tr({command:{type:"commitTableColumnDividerResize",target:D.resizeTarget,leftWidthTwips:ie,rightWidthTwips:de},part:jo(e.session(),D.target.tableId),layout:j.layout,storeRevision:j.storeRevision,selection:j.selection,cellSelection:j.cellSelection,themeColors:j.themeColors,...z});}else {x();return}e.applyTableCommandPlan(ee),x();}function pe(D){if(!u)return null;o??=chunk4GBTELJV_cjs.Oe(D.layout);let j=e.pageOffsetX(u.pageIndex);return chunk4GBTELJV_cjs.Se(o,u.x,u.y,D.layout,j,u.pageIndex)}function he(D){if(!r||s||D.editingMode==="view")return;S();let j=pe(D),z=Vm(j,D.selection.head.paragraphId);if(!z){r=null,x();return}if(chunk4GBTELJV_cjs.Qe(z)!==chunk4GBTELJV_cjs.Qe(r)){r=null,x();return}r=z,W(z,D);}function Z(){let D=p??y(),j=D!==null&&document.activeElement===D;b(),D&&t.contains(D)&&D.remove(),j&&e.pagesLayer.focus({preventScroll:true});}function F(D){if(s||D.editingMode==="view")return;let j=p??y();if(!j||!t.contains(j)){m&&b();return}if(p=j,!m||m.kind!=="insertRow"&&m.kind!=="insertColumn")return;o??=chunk4GBTELJV_cjs.Oe(D.layout);let z=chunk4GBTELJV_cjs.Qe(m),ne=chunk4GBTELJV_cjs.Re(o,m);if(!ne||chunk4GBTELJV_cjs.Qe(ne)!==z){Z();return}m=ne,A(ne,D);}function L(D){let j=e.read();if(s&&D.pointerId===s.pointerId){d=D.clientX,c=D.clientY;let de=(s.vertical?D.clientY-s.startClientY:D.clientX-s.startClientX)/e.scale();for(let Re of [...t.children])Re!==s.captureElement&&Re.remove();P(s.startEdgePt+de,s.target);return}if(j.editingMode==="view"){I(false);return}if(D.target instanceof Node&&p?.contains(D.target)){S();return}let z=f2(e,D.clientX,D.clientY),ne=chunk4GBTELJV_cjs.Xd(j.layout,z.y);ne>=0&&(u={x:z.x,y:z.y,pageIndex:ne});let re=ne>=0?e.pageOffsetX(ne):0;o??=chunk4GBTELJV_cjs.Oe(j.layout);let ee=o?chunk4GBTELJV_cjs.Se(o,z.x,z.y,j.layout,re,ne>=0?ne:void 0):null,ie=Vm(ee,j.selection.head.paragraphId);if(!ie){if(l)return;!n&&r&&(n=setTimeout(()=>{n=null,r=null,x();},u2));return}n&&(clearTimeout(n),n=null),!(r&&chunk4GBTELJV_cjs.Pe(ie)===chunk4GBTELJV_cjs.Pe(r))&&(r=ie,W(ie,j));}function B(D){if(!(!s||D.pointerId!==s.pointerId)){if(e.read().editingMode==="view"){U();return}$();}}function q(D){!s||D.pointerId!==s.pointerId||U();}function X(D){D.key!=="Escape"||!s||U();}return e.pagesLayer.addEventListener("pointermove",L),document.addEventListener("pointermove",L),document.addEventListener("pointerup",B),document.addEventListener("pointercancel",q),e.pagesLayer.addEventListener("keydown",X),{update(){let D=e.read(),j=a,z=i;o=null,a=D.layout.revision,i=D.storeRevision,D.editingMode==="view"?(U(),r=null,S(),I(true)):j!==null&&(j!==D.layout.revision||z!==D.storeRevision)&&(r!==null&&he(D),F(D)),t.style.width=e.pagesLayer.style.width,t.style.height=e.pagesLayer.style.height;},refreshLabels(){let D=e.read();if(D.editingMode==="view")return;let j=p??y();if(j&&t.contains(j)&&m&&(m.kind==="insertRow"||m.kind==="insertColumn")){A(m,D);return}r&&(r.kind==="insertRow"||r.kind==="insertColumn")&&A(r,D);},destroy(){S(),U(),b(),x(),e.pagesLayer.removeEventListener("pointermove",L),document.removeEventListener("pointermove",L),document.removeEventListener("pointerup",B),document.removeEventListener("pointercancel",q),e.pagesLayer.removeEventListener("keydown",X),t.remove();}}}var p2=e=>e==="left"||e==="center"||e==="right"||e==="both";function GP(e,t){if(!t.some(r=>r.localName==="bidi"))return e;let n=e.map(r=>r.localName).lastIndexOf("bidi");return n===-1?e:e.filter((r,o)=>o!==n)}function lc(e,t,n,r=n){let o=()=>chunk4GBTELJV_cjs.sd([...t,...n]);if(e.paragraphDirection!==void 0&&e.localName==="bidi"){let i=e.paragraphDirection==="rtl";return o()===i?null:i?chunk4GBTELJV_cjs.sd(GP(t,r))?{localName:"bidi",remove:true}:{localName:"bidi"}:chunk4GBTELJV_cjs.sd(GP(t,r))?{localName:"bidi",attributes:{val:"0"}}:{localName:"bidi",remove:true}}let a=e.attributes?.val;return !e.physicalAlignment||e.localName!=="jc"||!p2(a)?e:{localName:"jc",attributes:{val:chunk4GBTELJV_cjs.cd(a,o())}}}function XP(e){let{runPropertyEdits:t,mergedParagraphMarkProperties:n}=chunkVX43VBAX_cjs.b(()=>e.session.stylesRoot(),()=>e.session.settingsRoot(),()=>e.displayMode(),()=>e.authorFilter()),{session:r,commit:o,orderedRange:a,selectionMark:i,textOf:s}=e,l=()=>e.displayMode(),d=()=>e.authorFilter(),c=()=>r.partFor(e.storyScope())??r.part(),u=(x,I,M)=>r.applyTreeOps(x,I,M,e.storyScope()),p=()=>{let x=e.runFormatRefusal?.();return x?(e.commit(()=>({committed:false,rejected:true,opCount:0,reason:x})),true):false},m={get value(){return e.layout()}},h={get value(){return e.selection()}},y=(x,I,M)=>{let k=c();if(x.paragraphId===I.paragraphId){let N=t(k,x.paragraphId,x.offset,I.offset,M,l(),d());if(N.length===0)return;let A=n(k,x.paragraphId,M);o(()=>u([...N.map(V=>({op:"setRunProperties",paragraphId:x.paragraphId,start:V.start,end:V.end,properties:V.properties,...V.targetRunIds?{targetRunIds:V.targetRunIds}:{}})),...e.paragraphMarkVisible(x.paragraphId)?WI(s(x.paragraphId),x,I,A):[]],i()));return}let P=e.paragraphOrder(),R=P.indexOf(x.paragraphId),w=P.indexOf(I.paragraphId);if(R===-1||w===-1)return;let O=[];for(let N=R;N<=w;N+=1){let A=P[N],V=s(A),W=N===R?x.offset:0,E=N===w?I.offset:V.length,_=W<E?t(k,A,W,E,M,l(),d()):[];for(let U of _)O.push({op:"setRunProperties",paragraphId:A,start:U.start,end:U.end,properties:U.properties,...U.targetRunIds?{targetRunIds:U.targetRunIds}:{}});(N<w||W===0&&E===V.length&&V.length>0)&&e.paragraphMarkVisible(A)&&O.push({op:"setParagraphMarkProperties",paragraphId:A,properties:n(k,A,M)});}O.length!==0&&o(()=>u(O,i()));},g=(x,I)=>{let M=c(),k=[];for(let P of chunk6APGXLBB_cjs.ga(m.value,x)){let R=s(P);for(let w of t(M,P,0,R.length,I,l(),d()))k.push({op:"setRunProperties",paragraphId:P,start:w.start,end:w.end,properties:w.properties,...w.targetRunIds?{targetRunIds:w.targetRunIds}:{}});e.paragraphMarkVisible(P)&&k.push({op:"setParagraphMarkProperties",paragraphId:P,properties:n(M,P,I)});}return k.length===0?false:(o(()=>u(k,i()),void 0,{keepCellSelection:true}),true)},b=x=>{chunkFIJZIQXA_cjs.Ah(x.localName)&&e.setPendingFormats(chunkFIJZIQXA_cjs.Fh(e.pendingFormats()??[],x));},S=x=>{if(x.length===0)return;let I=e.selectedCells?.(),M=I&&I.length>0?[...chunk6APGXLBB_cjs.ga(m.value,I)]:null,{from:k,to:P}=a(),R=M??e.paragraphOrder(),w=M?0:R.indexOf(k.paragraphId),O=M?R.length-1:R.indexOf(P.paragraphId);if(w===-1||O===-1)return;let N=c(),A=R.slice(w,O+1).filter(V=>e.paragraphMarkVisible(V)).flatMap(V=>{let W=chunkFIJZIQXA_cjs.Dh(N,V),E=W,_=ar(m.value,V),G=false;for(let U of x){let $=lc(U,_,E,W);if(!$)continue;if(G=true,$.remove){E=E.filter(Z=>Z.localName!==$.localName);continue}let pe=$.mergeAttributes?{...E.find(Z=>Z.localName===$.localName)?.attributes??{},...$.attributes}:$.attributes??{},he=Object.fromEntries(Object.entries(pe).filter(([,Z])=>Z!=null));E=chunkFIJZIQXA_cjs.Fh(E,{localName:$.localName,...Object.keys(he).length>0?{attributes:he}:{}});}return G?[{op:"setParagraphProperties",paragraphId:V,properties:E}]:[]});A.length!==0&&o(()=>u(A,i()),void 0,{keepCellSelection:M!==null});};return {setRunProperty(x,I){if(p())return;let M={localName:x,...I?{attributes:I}:{}},k=e.selectedCells?.();if(k&&k.length>0){g(k,M);return}let{from:P,to:R}=a();if(P.paragraphId===R.paragraphId&&P.offset===R.offset){b(M);return}y(P,R,M);},setParagraphProperty(x,I,M){S([{localName:x,...I?{attributes:I}:{},...M??{}}]);},setParagraphProperties:S,formatting:()=>VI(KI(m.value,h.value,(x,I)=>{let M=r.effectiveRunDefaults(x,I);if(M.fontFamily!==null)return M;let k=e.defaultFontFamily?.()??null;return k===null?M:{...M,fontFamily:k}},e.selectedCells?.(),e.defaultParagraphStyleId?.()??null,h.value.anchor.paragraphId===h.value.head.paragraphId?[h.value.head.paragraphId]:e.paragraphOrder(),e.defaultFontFamily?.()??null),e.pendingFormats()),toggleRunProperty(x,I){if(p())return;let M=e.selectedCells?.(),k=I?.val,P=Fa(e.pendingFormats(),x,k)??Jp(m.value,h.value,x,M,k,e.paragraphOrder()),R=P?{localName:x,attributes:{val:m2[x]??"0"}}:{localName:x,...I?{attributes:I}:{}};if(M&&M.length>0){g(M,R);return}let{from:w,to:O}=a();if(w.paragraphId===O.paragraphId&&w.offset===O.offset){let N=e.pendingFormats()??[],A=Jp(m.value,h.value,x,void 0,k,e.paragraphOrder());if(!P===A){let V=N.filter(W=>W.localName!==x);e.setPendingFormats(V.length>0?V:null);}else b(R);return}y(w,O,R);},clearFormatting(){if(p())return;e.setPendingFormats(null);let x=m.value,I=e.paragraphOrder(),M=e.selectedCells?.(),k=M&&M.length>0?[...chunk6APGXLBB_cjs.ga(x,M)]:Ed(I,a());if(k.length===0)return;let{from:P,to:R}=a(),w=M!==void 0&&M.length>0,O=c(),N=[];for(let A of k){let V=s(A),W=w||A!==P.paragraphId?0:P.offset,E=w||A!==R.paragraphId?V.length:R.offset;for(let U of chunkFIJZIQXA_cjs.Rh(O,A,W,E,l(),d()))qI(O,A,U.start,U.end,l(),d())&&N.push({op:"setRunProperties",paragraphId:A,start:U.start,end:U.end,properties:[]});e.paragraphMarkVisible(A)&&chunkFIJZIQXA_cjs.Eh(O,A).length>0&&N.push({op:"setParagraphMarkProperties",paragraphId:A,properties:[]});let _=chunkFIJZIQXA_cjs.Dh(O,A),G=_.filter(U=>U.localName==="bidi");e.paragraphMarkVisible(A)&&_.length>G.length&&N.push({op:"setParagraphProperties",paragraphId:A,properties:G});}N.length!==0&&o(()=>u(N,i()),void 0,{keepCellSelection:w});}}}var m2={u:"none",vertAlign:"baseline"};var g2=new Set,YP=500;function h2(e){let t=l=>({val:l?"1":"0"}),n=l=>String(Math.max(2,Math.min(3276,Math.round(l*2)))),r=e.latinLane??e,o=e.complexLane??e,a=n(r.fontSizePt),i=[{localName:"b",attributes:t(r.bold)},{localName:"i",attributes:t(r.italic)},{localName:"bCs",attributes:t(o.bold)},{localName:"iCs",attributes:t(o.italic)},{localName:"u",attributes:{val:e.underline?e.underline.variant:"none",color:e.underline?.color??"auto",themeColor:"none"}},{localName:"strike",attributes:t(e.strike)},{localName:"dstrike",attributes:t(e.doubleStrike)},{localName:"caps",attributes:t(e.caps)},{localName:"smallCaps",attributes:t(e.smallCaps)},{localName:"vertAlign",attributes:{val:e.verticalAlign}},{localName:"color",attributes:{val:e.color??"auto"}},{localName:"highlight",attributes:{val:e.highlight??"none"}},{localName:"sz",attributes:{val:a}},{localName:"szCs",attributes:{val:n(o.fontSizePt)}},{localName:"spacing",attributes:{val:String(Math.round(e.characterSpacingPt*20))}},{localName:"position",attributes:{val:String(Math.round(e.baselineShiftPt*2))}},{localName:"w",attributes:{val:String(Math.round(e.horizontalScalePercent))}},{localName:"kern",attributes:{val:String(Math.round(e.kerningMinPt*2))}}],s=e.complexLane?.fontFamily??null;return (r.fontFamily||r.fontFamilyEastAsia||s)&&i.push({localName:"rFonts",attributes:{...r.fontFamily?{ascii:r.fontFamily,hAnsi:r.fontFamily}:{},...r.fontFamilyEastAsia?{eastAsia:r.fontFamilyEastAsia}:{},...s?{cs:s}:{}}}),i}function QP(e){let{runPropertyEdits:t,mergedParagraphMarkProperties:n}=chunkVX43VBAX_cjs.b(()=>e.session.stylesRoot(),()=>e.session.settingsRoot(),()=>e.displayMode(),()=>e.authorFilter()),r=e.session,o=()=>r.partFor(e.storyScope())??r.part(),a="off",i=null,s=null,l=null,d=id,c=()=>{let S=i===null?"none":i.paragraphProperties?"paragraph":"run";return (d.mode!==a||d.level!==S)&&(d={mode:a,level:S}),d},u=(S,x,I)=>{if(I||S.paragraphId!==x.paragraphId||S.offset===x.offset)return true;let M=e.textOf(S.paragraphId);return S.offset===0&&x.offset===M.length&&M.length>0},p=()=>{let S=e.selectedCells?.(),x=S!==void 0&&S.length>0,{from:I,to:M}=e.orderedRange();if(!e.paragraphOrder().includes(I.paragraphId))return false;let k=Od(e.layout(),e.selection(),S,e.paragraphOrder()),P=u(I,M,x)?chunkFIJZIQXA_cjs.Dh(o(),I.paragraphId):null;return !k&&P===null?false:(i={runProperties:k?h2(k):[],paragraphProperties:P},true)},m=()=>p()?(e.publish(),true):false,h=()=>{let S=i;if(!S)return {wrote:false,armed:false,built:false};let x=e.selectedCells?.(),I=x!==void 0&&x.length>0,{from:M,to:k}=e.orderedRange(),P=!I&&M.paragraphId===k.paragraphId&&M.offset===k.offset,R=P?Id(e.layout(),M,g2):null,w=R?.from??M,O=R?.to??k,N=P&&w.offset===O.offset,A=I?[...chunk6APGXLBB_cjs.ga(e.layout(),x)]:Ed(e.paragraphOrder(),{from:w,to:O});if(A.length===0)return {wrote:false,armed:false,built:false};let V=o(),W=e.displayMode(),E=[];for(let $ of A){let pe=e.textOf($),he=I||$!==w.paragraphId?0:w.offset,Z=I||$!==O.paragraphId?pe.length:O.offset;if(he<Z&&S.runProperties.length>0)for(let B of t(V,$,he,Z,S.runProperties,W,e.authorFilter()))E.push({op:"setRunProperties",paragraphId:$,start:B.start,end:B.end,properties:B.properties,...B.targetRunIds?{targetRunIds:B.targetRunIds}:{}});let F=S.paragraphProperties!==null||I||$!==O.paragraphId||he===0&&Z===pe.length&&pe.length>0,L=e.paragraphMarkVisible($);F&&L&&S.runProperties.length>0&&E.push({op:"setParagraphMarkProperties",paragraphId:$,properties:n(V,$,S.runProperties)}),S.paragraphProperties&&L&&E.push({op:"setParagraphProperties",paragraphId:$,properties:[...S.paragraphProperties]});}let _=r.packageRevision();E.length>0&&e.commit(()=>r.applyTreeOps(E,e.selectionMark(),void 0,e.storyScope()),void 0,{keepCellSelection:I});let G=r.packageRevision()!==_,U=N&&S.runProperties.length>0&&(G||E.length===0);return U&&e.armPendingFormats(S.runProperties),{wrote:G,armed:U,built:E.length>0}},y=()=>{let S=h();return S.wrote&&a==="once"&&b(),S.wrote?"painted":S.armed?"armed":S.built?"refused":"nothingToPaint"},g=()=>{a!=="off"&&(a="off",e.publish());},b=()=>{s=null,l=null,g();};return {state:c,capture:m,apply:y,disarm:b,press(){let S=e.now(),x=s!==null&&S-s<YP,I=a;s=S;let M=()=>(s=null,false);return I==="once"&&x?p()?(a="locked",e.publish(),true):(g(),M()):I!=="off"?(g(),l=I==="locked"?S:null,true):l!==null&&S-l<YP?(l=null,true):p()?(a="once",l=null,e.publish(),true):M()},applyIfArmed(){a==="off"||i===null||h().wrote&&a==="once"&&b();}}}var JP=new WeakMap;function y2(e){let t=JP.get(e);if(t!==void 0)return t;let n=[e],r=false;for(;n.length>0&&!r;){let o=n.pop();if(o.kind!=="textValue"){(o.localName==="bidi"||o.localName==="rtl")&&(r=true);for(let a of o.children)n.push(a);}}return JP.set(e,r),r}function eT(e,t=()=>null){let n=null;return {keydown(r){if(r.key==="Shift"&&(r.location===1||r.location===2)&&r.ctrlKey&&!r.altKey&&!r.metaKey&&!r.isComposing&&!r.defaultPrevented){n=r.location===2?"rtl":"ltr";return}r.key!=="Control"&&(n=null);},keyup(r){if(n===null||r.key!=="Shift"&&r.key!=="Control")return;let o=n;if(n=null,r.defaultPrevented)return;let a=t();a===null||!y2(a)||e.setParagraphProperties([{localName:"bidi",paragraphDirection:o}]);},disarm(){n=null;}}}function tT(e,t){return e.addEventListener("keyup",t.keyup),e.addEventListener("pointerdown",t.disarm,{capture:true}),e.addEventListener("focusout",t.disarm),()=>{e.removeEventListener("keyup",t.keyup),e.removeEventListener("pointerdown",t.disarm,{capture:true}),e.removeEventListener("focusout",t.disarm);}}var b2=500,nT=4,qa=40,dc=12;function v2(e,t){let n=Math.max(e.x,t.x),r=Math.max(e.y,t.y),o=Math.min(e.x+e.width,t.x+t.width),a=Math.min(e.y+e.height,t.y+t.height);return o<=n||a<=r?0:(o-n)*(a-r)}function rT(e,t){return v2(e,t)>0?true:e.width===0?t.x<=e.x&&e.x<=t.x+t.width&&!(e.y+e.height<t.y||t.y+t.height<e.y):false}function Sn(e,t,n){let r=chunk4GBTELJV_cjs.Ra(e),o=r.indexOf(t.paragraphId),a=r.indexOf(n.paragraphId);return o!==a?o-a:t.offset-n.offset}function aT(e,t,n){if(!(t>chunk4GBTELJV_cjs.Sd))for(let r of e){if(r.kind==="paragraph"){n(r);continue}if(!(t>=chunk4GBTELJV_cjs.Sd)){for(let o of r.rows)if(!o.isHeaderRepeat)for(let a of o.cells)aT(a.blocks,t+1,n);}}}function Is(e,t){if(!t.placeholder||t.fragments.length===0)return null;let n=null,r=null,o=(i,s)=>{(!n||Sn(e,i,n)<0)&&(n=i),(!r||Sn(e,s,r)>0)&&(r=s);},a=t.level!=="inline";for(let i of t.fragments){let s=e.pages[i.pageIndex];s&&aT(s.fragments,0,l=>{if(rT(i.box,l.box)){if(a){let d=chunk4GBTELJV_cjs.pe(e,l.paragraphId).length;o({paragraphId:l.paragraphId,offset:0},{paragraphId:l.paragraphId,offset:d});return}for(let d of l.lines)for(let c of d.spans)rT(i.box,c.box)&&o({paragraphId:c.range.paragraphId,offset:c.range.start},{paragraphId:c.range.paragraphId,offset:c.range.end});}});}return !n||!r?null:{from:n,to:r}}function x2(e,t){return (e.contentControls??[]).find(n=>n.id===t)??null}function oT(e,t){let n=t.contentControlId;if(!n){let o={x:t.caret.x,y:t.caret.y+t.caret.height/2},a=chunk4GBTELJV_cjs.be(e,t.pageIndex,o);return a?.placeholder?a:null}let r=x2(e,n);return r?.placeholder?r:null}function cc(e,t){let n=e.contentControls??[];if(n.length===0)return t;let r=Sn(e,t.anchor,t.head)<=0?t.anchor:t.head,o=Sn(e,t.anchor,t.head)<=0?t.head:t.anchor,a=true;for(;a;){a=false;for(let s of n){if(!s.placeholder)continue;let l=Is(e,s);!l||!(Sn(e,r,o)===0?Sn(e,r,l.from)>=0&&Sn(e,r,l.to)<0:Sn(e,r,l.to)<0&&Sn(e,o,l.from)>0)||(Sn(e,l.from,r)<0&&(r=l.from,a=true),Sn(e,l.to,o)>0&&(o=l.to,a=true));}}return Sn(e,t.anchor,t.head)<=0?{anchor:r,head:o}:{anchor:o,head:r}}var w2=new Set(["dropdown","comboBox","date","buildingBlockGallery"]);function iT(e,t={}){if(t.mode==="native")return {dragging:()=>false,destroy:()=>{}};let{pagesLayer:n,container:r}=e,o=n.ownerDocument,a=o.defaultView,i=null,s=null,l=0,d=0,c=0,u=0,p=null;function m(L,B){if(!s){let X=n.getBoundingClientRect();s={left:X.left,top:X.top};}let q=e.scale()||1;return {x:(L-s.left)/q,y:(B-s.top)/q}}function h(L){return {scope:{kind:"headerFooter",rId:L.rId},pageIndex:L.pageIndex,kind:L.kind,partName:L.partName,variant:L.variant}}function y(L,B){let q=e.layout(),X=m(L,B),D=chunk4GBTELJV_cjs.Xd(q,X.y),j=q.pages[D];if(!j)return null;let z=e.measurer();return chunk4GBTELJV_cjs._d(q,D,{x:X.x-j.contentBox.x-e.pageOffsetX(D),y:X.y-j.contentBox.y},z?{measurer:z}:{})}function g(L,B){let q=e.activeNote?.()??null;if(q){let ne=e.layout(),re=nd(ne,m(L,B),e.pageOffsetX);if(!re||re.scopeId!==q.scopeId)return null;let ee=e.measurer();return chunk4GBTELJV_cjs.$d(ne,re.pageIndex,re.fragments,re.local,{...ee?{measurer:ee}:{}})}let X=e.activeHeaderFooter?.()??null;if(!X)return y(L,B);let D=e.layout(),j=m(L,B),z=Yf(D,j,e.pageOffsetX);if(z&&td(z.story,h(X))){let ne=e.measurer();return zf(D,z.pageIndex,z.story,z.local,ne?{measurer:ne}:{})}return null}function b(L,B){let{story:q,pageIndex:X,kind:D}=L;return {rId:q.rId,pageIndex:X,kind:D,partName:q.partName,variant:q.variant,...B?{position:B}:{}}}function S(L){let B=e.measurer();return zf(e.layout(),L.pageIndex,L.story,L.local,B?{measurer:B}:{})?.position??void 0}let x=new WeakMap;function I(L,B){let q=e.activeNote?.();if(q){let z=Ca(L,null,q.scopeId).indexOf(B);return z===-1?-1:z}let X=e.activeHeaderFooter?.();if(X){let z=Ca(L,h(X)).indexOf(B);return z===-1?-1:z}let D=x.get(L);return D||(D=new Map(chunk4GBTELJV_cjs.Ra(L).map((j,z)=>[j,z])),x.set(L,D)),D.get(B)??-1}function M(L,B,q){let X=I(L,B.paragraphId),D=I(L,q.paragraphId);return X!==D?X<D:B.offset<q.offset}function k(L,B,q){if(q==="character")return {from:B,to:B};let X=B.paragraphId;if(q==="paragraph"){let D=chunk4GBTELJV_cjs.pe(L,X);return {from:{paragraphId:X,offset:0},to:{paragraphId:X,offset:D.length}}}return Id(L,B,chunk4GBTELJV_cjs.qe(L,X))}function P(L,B,q,X,D){let j=D?oT(L,D):null,z=j?Is(L,j)??k(L,q,X):k(L,q,X),ne=M(L,z.from,B.from)?{anchor:B.to,head:z.from}:{anchor:B.from,head:z.to};return cc(L,ne)}let R=r.closest(".docx-editor__scroll-container");function w(){return r.closest(".docx-editor__scroll-container")}function O(L,B,q){if(q<L+qa){let X=Math.max(0,L+qa-q);return -Math.min(dc,X/qa*dc)}if(q>B-qa){let X=Math.max(0,q-(B-qa));return Math.min(dc,X/qa*dc)}return 0}function N(){p!==null&&(a?.cancelAnimationFrame(p),p=null);}function A(){p=null;let L=i,B=w();if(!L||!B||!a)return;let q=B.getBoundingClientRect(),X=O(q.top,q.bottom,L.clientY);X!==0&&(B.scrollTop+=X,s=null,W(L.clientX,L.clientY),p=a.requestAnimationFrame(A));}function V(){if(p!==null||!a||!i)return;let L=w();if(!L)return;let B=L.getBoundingClientRect();O(B.top,B.bottom,i.clientY)!==0&&(p=a.requestAnimationFrame(A));}function W(L,B){let q=i;if(!q)return;let X=g(L,B);X&&((e.isReadOnlyPosition?.(X.position)??e.isReadOnlyParagraph?.(X.position.paragraphId))||E(q,X)||(q.caret=X.caret,e.setSelection(P(e.layout(),q.anchorRange,X.position,q.granularity,X),X.caret)));}function E(L,B){let q=L.anchorCell;if(!q)return false;if(!B.cell||B.cell.tableId!==q.tableId)return L.cellDragging;if(!L.cellDragging&&B.cell.cellId===q.cellId)return false;let X=chunk6APGXLBB_cjs.ea(e.layout(),q,B.cell);return X?(L.cellDragging=true,e.setCellSelection(X),true):L.cellDragging}function _(L){let B=Date.now(),q=B-d;return l=Math.abs(L.clientX-c)<=nT&&Math.abs(L.clientY-u)<=nT&&q>=0&&q<=b2?l+1:1,d=B,c=L.clientX,u=L.clientY,l}let G=["character","word","paragraph"],U=L=>{if(L.button!==0)return;if(e.onChangeBarToggle&&L.target?.closest?.("[data-docx-change-bar-toggle]")){L.preventDefault(),L.stopPropagation(),e.onChangeBarToggle();return}let B=L.target?.closest?.("[data-docx-cc-widget]");if(B){if(L.preventDefault(),L.stopPropagation(),B.hasAttribute("disabled")||B.dataset.disabledReason)return;let me=B.dataset.docxCcId,ue=B.dataset.docxCcWidget;me&&ue&&e.onContentControlWidget?.(me,ue);return}if(e.selectionLocked?.()||L.pointerType==="touch")return;i&&Z(),s=null;let q=e.layout(),X=m(L.clientX,L.clientY),D=e.activeHeaderFooter?.()??null,j=e.activeNote?.()??null,z=Yf(q,X,e.pageOffsetX),ne=z!==null&&Pw(q,z,X,e.pageOffsetX,D!==null&&td(z.story,h(D)),e.measurer()),re=ne?null:z,ee=nd(q,X,e.pageOffsetX),ie=ne?null:L.target?.closest("[data-docx-hf]"),de=!!(ie||re),Re=L.target,Ke=Re?.closest("[data-docx-note-ref]"),pt=Re?.closest("[data-docx-note-mark-back]"),ot=null,Le=()=>ot??=_(L);if(Ke?.dataset.docxNoteScope){L.preventDefault(),e.focus(),e.enterNote?.(Ke.dataset.docxNoteScope);return}if(pt){L.preventDefault(),e.focus(),e.exitNote?.(true);return}if(ee&&!de){let me=e.measurer?.(),ue=chunk4GBTELJV_cjs.$d(q,ee.pageIndex,ee.fragments,ee.local,{...me?{measurer:me}:{}});if(!j||j.scopeId!==ee.scopeId){L.preventDefault(),e.focus(),e.enterNote?.(ee.scopeId,ue?{paragraphId:ue.position.paragraphId,offset:ue.position.offset}:void 0,ee.pageIndex);return}if(j.pageIndex!==ee.pageIndex){L.preventDefault(),e.focus(),e.enterNote?.(ee.scopeId,ue?{paragraphId:ue.position.paragraphId,offset:ue.position.offset}:void 0,ee.pageIndex);return}}else if(j){if(!Zf(q,X,e.pageOffsetX))return;e.exitNote?.(false),e.focus();}if(D)if(re&&td(re.story,h(D)))re.pageIndex!==D.pageIndex&&e.enterHeaderFooter?.(b(re,S(re)));else if(re&&re.story.rId){L.preventDefault(),e.focus(),e.enterHeaderFooter?.(b(re,S(re)));return}else if(Zf(q,X,e.pageOffsetX)){L.preventDefault(),e.exitHeaderFooter?.(true),e.focus();return}else {let me=Le()>=2?Xf(q,X,e.pageOffsetX):null;me&&(L.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.(me.kind,me.pageIndex));return}else if(de&&Le()>=2){if(re?.story.rId)L.preventDefault(),e.focus(),e.enterHeaderFooter?.(b(re,S(re)));else if(ie instanceof HTMLElement){let me=ie.dataset.docxRId,ue=ie.dataset.docxHf,Te=ie.closest("[data-page-index]")?.getAttribute("data-page-index"),Ie=Te!=null?Number(Te):NaN;if((ue==="header"||ue==="footer")&&Number.isInteger(Ie))if(me){let zt=q.pages[Ie]?.[ue];L.preventDefault(),e.focus(),e.enterHeaderFooter?.({rId:me,pageIndex:Ie,kind:ue,partName:zt?.partName??"",variant:zt?.variant??"default"});}else q.pages[Ie]?.[ue]||(L.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.(ue,Ie));}return}else if(Le()>=2){let me=Xf(q,X,e.pageOffsetX);if(me){L.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.(me.kind,me.pageIndex);return}}let Se=g(L.clientX,L.clientY);if(!Se)return;if(e.isReadOnlyPosition?.(Se.position)??e.isReadOnlyParagraph?.(Se.position.paragraphId)){L.preventDefault();return}if(Le()===2&&e.onTextFormDoubleClick?.(L))return;L.preventDefault(),e.focus();try{n.setPointerCapture(L.pointerId);}catch{}o.addEventListener("pointermove",pe),o.addEventListener("pointerup",he),o.addEventListener("pointercancel",he);let mt=Le(),xt=L.shiftKey?"character":G[(mt-1)%G.length],tt=oT(q,Se);if(tt&&!L.shiftKey){let me=()=>{mt===1&&w2.has(tt.controlType)&&e.onContentControlWidget?.(tt.id,tt.controlType);};if(e.selectContentControl?.(tt.id)){let Te=e.selection(),Ie=M(q,Te.anchor,Te.head)||Te.anchor.paragraphId===Te.head.paragraphId&&Te.anchor.offset===Te.head.offset?{from:Te.anchor,to:Te.head}:{from:Te.head,to:Te.anchor};i={pointerId:L.pointerId,granularity:"character",anchorRange:Ie,anchorCell:Se.cell,cellDragging:false,clientX:L.clientX,clientY:L.clientY},me();return}let ue=Is(q,tt);if(ue){i={pointerId:L.pointerId,granularity:"character",anchorRange:ue,anchorCell:Se.cell,cellDragging:false,clientX:L.clientX,clientY:L.clientY},$(()=>e.setSelection({anchor:ue.from,head:ue.to})),me();return}}if(L.shiftKey){let me=e.selection();i={pointerId:L.pointerId,granularity:xt,caret:Se.caret,anchorRange:{from:me.anchor,to:me.anchor},anchorCell:Se.cell,cellDragging:false,clientX:L.clientX,clientY:L.clientY},$(()=>e.setSelection(P(q,{from:me.anchor,to:me.anchor},Se.position,xt,Se),Se.caret));}else {let me=k(q,Se.position,xt);i={pointerId:L.pointerId,granularity:xt,caret:Se.caret,anchorRange:me,anchorCell:Se.cell,cellDragging:false,clientX:L.clientX,clientY:L.clientY},$(()=>e.setSelection(cc(q,{anchor:me.from,head:me.to}),Se.caret));}};function $(L){try{L();}catch(B){throw Z(),B}}let pe=L=>{let B=i;if(!(!B||L.pointerId!==B.pointerId)){if(e.selectionLocked?.())return Z();L.preventDefault(),B.clientX=L.clientX,B.clientY=L.clientY,W(L.clientX,L.clientY),V();}},he=L=>{let B=i;if(!B||L.pointerId!==B.pointerId)return;Z();try{n.releasePointerCapture(B.pointerId);}catch{}let q=e.cellSelection();q?e.setCellSelection(q):e.setSelection(e.selection(),B.caret),L.type==="pointerup"&&(e.onTextFormPointerUp?.(L),e.onSelectionSettled?.());};function Z(){if(i)try{n.releasePointerCapture(i.pointerId);}catch{}i=null,s=null,N(),o.removeEventListener("pointermove",pe),o.removeEventListener("pointerup",he),o.removeEventListener("pointercancel",he);}let F=()=>{s=null;};return n.addEventListener("pointerdown",U),R?.addEventListener("scroll",F,{passive:true}),a?.addEventListener("scroll",F,{capture:true,passive:true}),a?.addEventListener("resize",F,{passive:true}),{dragging:()=>i!==null,destroy(){Z(),n.removeEventListener("pointerdown",U),R?.removeEventListener("scroll",F),a?.removeEventListener("scroll",F,{capture:true}),a?.removeEventListener("resize",F);}}}function sT(e,t,n){let r=e??chunk4GBTELJV_cjs.Za;return {view:()=>r,projection:()=>chunk4GBTELJV_cjs.Ya(r),changeBars:()=>t?r==="all-markup"||r==="simple-markup"?r:"none":"all-markup",set:o=>{r=o;},filter:o=>t&&chunk4GBTELJV_cjs.Ya(r)!=="all-markup"?chunk4GBTELJV_cjs._a(o):o,toggleByChangeBar:()=>{t&&n(r==="simple-markup"?"all-markup":"simple-markup");}}}function lT(e){let{document:t,pagesLayer:n,session:r}=e,o=false,a=null,i,s;function l(){let{head:w}=e.selection();return s&&s.position.paragraphId===w.paragraphId&&s.position.offset===w.offset?s.lineId:void 0}function d(w){let O=Vo(w?.anchorNode,n)??Vo(w?.focusNode,n);O!==void 0&&(i=O);}function c(w){return i??Vo(w?.anchorNode,n)??Vo(w?.focusNode,n)}let u=false,p=false,m=false,h=null,y=false;function g(){if(e.selectionLocked?.())return false;let w=t.getSelection(),O=_a(n,w);return !O||(d(w),Ot(O,e.selection()))?false:(e.adoptSelection(O),true)}function b(){let w=t.activeElement;if(w&&n.contains(w))return true;if(w&&w!==t.body&&w!==t.documentElement)return false;let O=t.getSelection();if(!O||O.rangeCount===0)return true;let N=O.anchorNode;return !N||!N.isConnected?true:n.contains(N)}let S=()=>{if(e.selectionLocked?.())return;let w=t.getSelection(),O=_a(n,w);if(!O){if(!Im(n,w))return;u=false;let N=$e(e.selection().head);if(Ot(N,e.selection()))return;e.setSelection(N);return}u=false,d(w),!Ot(O,e.selection())&&e.setSelection(O);};function x(w){let O=e.textOf(w),N=WR(n,w,O,t.getSelection()?.anchorNode??null);if(N===null)return;let A=jR(w,O,N);if(!A)return;let V=A.ops.find($=>$.op==="deleteText"),W=A.ops.find($=>$.op==="insertText"),E=W&&V?e.replacementOffset?.(w,V.start,V.end):void 0,_=W&&E!==void 0&&E!==W.offset?A.ops.map($=>$===W?{...W,offset:E}:$):A.ops,G=W?e.pendingFormatOps?.(w,E??W.offset,W.text.length,V?{start:V.start,end:V.end}:void 0)??[]:[],U=e.storyScope();e.commit(()=>{let $=e.applyOps([..._,...G],e.selectionMark(),U);return G.length===0||!$.rejected?$:e.applyOps(_,e.selectionMark(),U)}),e.setSelection($e({paragraphId:w,offset:W&&E!==void 0?E+W.text.length:A.caret}));}function I(){o||m||e.isGesturing?.()||e.holdsCellSelection?.()||M()||u&&S();}function M(){if(!p||u)return false;if(!a)return true;let w=_a(n,t.getSelection());return w!==null&&Ot(w,a)}function k(w){if(!(w instanceof PointerEvent&&w.button!==0)){if(w.type==="selectstart"&&e.selectionLocked?.()){w.preventDefault();return}u=true;}}let P=false;function R(w=false){if(e.updateCaret(),!w&&!b())return;o=true;let O=e.now(),N=e.domSelection?.()??e.selection();u=false;let A=t.getSelection(),V=c(A),W=l(),E=OR(n,N,A,{...V!==void 0?{preferredPageIndex:V}:{},...W!==void 0?{preferredLineId:W}:{}});E&&d(A),a=E?N:null,E||(p=true),e.recordSelectionMs(e.now()-O),queueMicrotask(()=>{o=false;});}return n.addEventListener("pointerdown",k,true),n.addEventListener("selectstart",k,true),{adoptBeforePaint(){let w=e.holdsCellSelection?.()===true||e.isGesturing?.()===true||e.hasPendingInput?.()===true,O=p||w||!u?false:g();return e.hasPendingInput?.()!==true&&(p=false),O},noteModelMoved(){p=true,s=void 0;},noteSelectionSettled(){p=false;},mirrorToDom:R,adoptBeforeInput:I,isComposing:()=>m,noteBrowserSelectionFixup(){P=true;},onSelectionChange:()=>{if(!o&&!m&&!e.isGesturing?.()&&!e.holdsCellSelection?.()){if(P&&Im(n,t.getSelection())){let w=_a(n,t.getSelection());if((w===null||!Ot(w,e.selection()))&&(P=false,!u)){R();return}}M()||S();}},onCompositionStart:()=>{I(),m=true;let w=e.selection();y=w.anchor.paragraphId!==w.head.paragraphId,h=w.head.paragraphId,r.beginComposition(e.storyScope());},onCompositionEnd:w=>{m=false;let O=h??e.selection().head.paragraphId;h=null;let N=y;y=false;let A=e.storyScope(),V=r.revisionFor(A);if(N){let W=w?.data??"";W.length>0&&e.replaceSelectionWith?.(W);}else x(O);r.endComposition(),r.revisionFor(A)===V&&e.discardPaint?.(),e.flushToPaint()||e.render();},selectionPageIndex:()=>i,selectionLineId:l,caretPreference(w=i){let O=l();return {...w!==void 0?{preferredPageIndex:w}:{},...O!==void 0?{preferredLineId:O}:{}}},notePointerCaret(w){s=w,w&&(i=w.pageIndex);},destroy(){n.removeEventListener("pointerdown",k,true),n.removeEventListener("selectstart",k,true),u=false;}}}var S2=32;function Um(e,t,n,r){if(!(e.kind==="textValue"||r>S2)){if(e.kind==="paragraph"){n.has(e.id)||n.set(e.id,t);return}for(let o of e.children)Um(o,t,n,r+1);}}var dT=new WeakMap;function cT(e,t,n,r){if(e.kind==="paragraph"||e.kind==="textValue"){Um(e,t,n,0);return}let o=dT.get(e);if(!o){let a=new Map;Um(e,0,a,0),o=[...a.keys()],dT.set(e,o);}for(let a of o)n.has(a)||n.set(a,t);}function R2(e,t){let n=chunk4GBTELJV_cjs.qd(e),r=chunk4GBTELJV_cjs.sc(n),o=0,a=chunk4GBTELJV_cjs.Oc(e),i=new Map;for(let s=0;s<a.length;s+=1){let l=a[s];for(let d=l.blockStart;d<l.blockEndExclusive;d+=1){let c=n[d];if(c){for(;o<r.length&&r[o]!==c;)cT(r[o],s,i),o+=1;o+=1,cT(c,s,i);}}}return i}var uT=new WeakMap;function P2(e){return !(!e.story||e.origin===chunkFIJZIQXA_cjs.g.mutationUndo||e.origin===chunkFIJZIQXA_cjs.g.mutationRedo||e.impact!=="text-local"||e.created.length>0||e.deleted.length>0||e.splitJoin.length>0||e.dependencyKeys.includes(chunkFIJZIQXA_cjs.l.section))}function T2(e,t){t.story&&t.story.kind!=="body"||P2(t)||(e.map=null);}function C2(e,t){t.subscribed||(t.subscribed=true,e.subscribe(n=>T2(t,n)));}function E2(e,t){let n=uT.get(e);return n||(n={map:null,subscribed:false},uT.set(e,n)),C2(e,n),n.map||(n.map=R2(t)),n.map}function fT(e,t,n){return n.startsWith(`${t.name}#`)?E2(e,t).get(n)??null:null}var pT=32;function ks(e,t,n,r,o="all-markup",a){let i=e.part(),s=chunk4GBTELJV_cjs.Oc(i,o,a);if(s.length<=1)return 0;let l=chunk4GBTELJV_cjs.Pc(i,o,a),d=p=>{let m=l.indexOf(p);if(m!==-1)return m;let h=l.findIndex(y=>y>p);return h===-1?Math.max(0,l.length-1):h},c=Gm(e,t);if(c!==null)return d(c);if(n.kind==="headerFooter"){if(r!==void 0&&s[r]!==void 0)return r;let p=e.headerFooterResolutionBySection().findIndex(m=>[m.headers,m.footers].some(h=>[...h.values()].some(y=>y.rId===n.rId)));return p===-1?0:d(p)}let u=M2(e,t);if(u!==null){let p=Gm(e,u);if(p!==null)return d(p)}return 0}function mT(e,t,n,r,o="all-markup",a){let i=e.part(),s=chunk4GBTELJV_cjs.Oc(i);if(s.length<=1)return {kind:"whole-document"};let l=chunk4GBTELJV_cjs.Pc(i,o,a),d=Gm(e,t),c=ks(e,t,n,r,o,a),u=l[c]??c;if(d!==null&&d===u)return {kind:"anchor",paragraphId:t};let p=s[u];if(!p)return {kind:"unaddressable"};let m=chunk4GBTELJV_cjs.qd(i);for(let h=p.blockStart;h<p.blockEndExclusive;h+=1){let y=O2(m[h]);if(y!==null)return {kind:"anchor",paragraphId:y}}return {kind:"unaddressable"}}function O2(e){if(!e)return null;let t=(n,r)=>{if(n.kind==="textValue"||r>pT)return null;if(n.kind==="paragraph")return n.id;for(let o of n.children){let a=t(o,r+1);if(a!==null)return a}return null};return t(e,0)}function Gm(e,t){return fT(e,e.part(),t)}function M2(e,t){let n=e.currentPackage();for(let r of ["footnote","endnote"]){let o=chunkFIJZIQXA_cjs.ch(n,r);if(!(!o||!t.startsWith(`${o.name}#`)))for(let a of chunkFIJZIQXA_cjs.Jc(o.root)){let i=chunkFIJZIQXA_cjs.yc(a);if(i===null||!A2(a,t))continue;return chunkFIJZIQXA_cjs.dh(e.part()).find(l=>l.noteKind===r&&l.noteId===i)?.paragraphId??null}}return null}function A2(e,t){let n=(r,o)=>{if(r.kind==="textValue"||o>pT)return false;if(r.kind==="paragraph"&&r.id===t)return true;for(let a of r.children)if(n(a,o+1))return true;return false};return n(e,0)}function Va(e,t){if(t===void 0)return {};let n=`${e}Autospacing`,r=`${e}Lines`;return t===null?{[e]:null,[n]:null,[r]:null}:{[e]:String(Math.round(t*20)),[n]:"0",[r]:null}}function uc(e){return e===void 0?{}:e===null?{line:null,lineRule:null}:e.rule==="multiple"?{line:String(Math.round(e.value*240)),lineRule:"auto"}:{line:String(Math.round(e.value*20)),lineRule:e.rule==="exact"?"exact":"atLeast"}}function gT(e){return {val:e?"1":"0"}}function yT(e){let t=null,n=null,r=null,o=(i,s)=>(e.setLastRejection(null),e.commit(()=>{let l=e.applyOps(Array.isArray(i)?i:[i],e.selectionMark());return l.rejected&&e.setLastRejection(String(l.reason??"rejected")),l},s),e.lastRejection()===null),a=(i,s,l)=>{let d=chunkFIJZIQXA_cjs.pc(i);if(!d)return e.setLastRejection("invalid note scope id"),false;let c=e.session.currentPackage(),u=chunkFIJZIQXA_cjs.ch(c,d.noteKind),p=u?chunkFIJZIQXA_cjs.Lc(u.root,d.noteId):null;if(!u||!p)return e.setLastRejection("note not found"),false;if(e.exitHeaderFooter?.(),e.activeScope().kind==="body"){let m=e.selection();r={anchor:{paragraphId:m.anchor.paragraphId,offset:m.anchor.offset},head:{paragraphId:m.head.paragraphId,offset:m.head.offset}};}if(t={kind:"note",id:chunkFIJZIQXA_cjs.oc(d.noteKind,d.noteId)},n=Number.isInteger(l)?l:null,s)e.setSelection({anchor:s,head:s});else {let m=F2(p),h=new Set(e.session.paragraphIdsIn({kind:"notesPart",noteKind:d.noteKind})),y=m.find(g=>h.has(g.id));if(y){let g=Xm(y);e.setSelection({anchor:{paragraphId:y.id,offset:g},head:{paragraphId:y.id,offset:g}});}}return e.noteModelMoved(),e.render(),n??=e.revealNote(t.id),e.notify(),true};return {insertNote(i){if(e.activeScope().kind!=="body")return e.setLastRejection("insertNote requires body scope"),false;let s=e.deleteSelectionPlan(),l=s.collapseTo;if(!(s.ops.length===0||o(s.ops,()=>({anchor:{...l},head:{...l}}))))return false;let c=hT(e.session.currentPackage(),i);if(!o({op:"insertNote",noteKind:i,paragraphId:l.paragraphId,offset:l.offset},()=>{let h={paragraphId:l.paragraphId,offset:l.offset+1};return {anchor:h,head:h}}))return s.ops.length>0&&e.undo(),false;let m=[...hT(e.session.currentPackage(),i)].find(h=>!c.has(h));return m===void 0?true:a(chunkFIJZIQXA_cjs.oc(i,m))},deleteNote(i,s){return o({op:"deleteNote",noteKind:i,noteId:s})},convertNote(i,s){return o({op:"convertNote",fromKind:i,noteId:s})},convertAllNotes(i){return o({op:"convertAllNotes",fromKind:i})},setNoteProperties(i){return o({op:"setNoteProperties",scope:i.scope,sectionIndex:i.sectionIndex,footnote:i.footnote,endnote:i.endnote})},enterNote:a,exitNote(i=true){if(!t)return;let s=r;t=null,n=null,r=null,e.setActiveScopeBodyOrHf({kind:"body"}),i&&s&&e.setSelection(s),e.noteModelMoved(),e.render(),e.notify();},activeNoteScope(){return t},activeNotePageIndex(){return n},setActiveNotePageIndex(i){!t||!Number.isInteger(i)||n!==i&&(n=i);}}}function F2(e){let t=[],n=(r,o)=>{if(!(o>32)){if(r.kind==="paragraph"){t.push(r);return}if("children"in r)for(let a of r.children)n(a,o+1);}};return n(e,0),t}function Xm(e){let t=chunkFIJZIQXA_cjs.hg(e)[0];return t&&chunkFIJZIQXA_cjs.uc(t.node)?t.end:0}function hT(e,t){let n=chunkFIJZIQXA_cjs.ch(e,t),r=new Set;if(!n)return r;for(let o of chunkFIJZIQXA_cjs.Jc(n.root)){if(!chunkFIJZIQXA_cjs.Ac(o))continue;let a=chunkFIJZIQXA_cjs.yc(o);a!==null&&r.add(a);}return r}var L2=720;function Ym(e,t,n=L2){return xT(e,t,e+t*n)}function vT(e,t,n){let r=t>0?Math.floor(e/n)+1:Math.ceil(e/n)-1;return xT(e,t,r*n)}function xT(e,t,n){return t>0?Math.max(e,Math.min(chunk4GBTELJV_cjs.fd,n)):Math.max(0,n)}function Qm(e){let t;for(let r of e){if(r.localName!=="ind")continue;let o=r.attributes?.left??r.attributes?.start;o!==void 0&&(t=o);}let n=chunkFIJZIQXA_cjs.nd(t);return n===null||Math.abs(n)>9999999?0:n}function bT(e,t){return e.kind==="midLine"?false:e.kind==="empty"||t<=e.offset}function wT(e,t,n,r,o){let{from:a,to:i}=e;if(a.paragraphId===i.paragraphId&&a.offset===i.offset)return null;let s=t.length>1?n.start(i.paragraphId):null,d=s!==null&&bT(s,i.offset)&&!(s.kind==="empty"&&n.endsStory(i.paragraphId))?t.slice(0,-1):t;if(d.length>1)return {write:"stepLeft",paragraphs:d};if(!bT(n.start(a.paragraphId),a.offset))return null;let{resolved:c,direct:u}=n.firstLine(a.paragraphId);return r==="increase"?{write:c>=0&&c<o?"setFirstLine":"stepLeft",paragraphs:d}:{write:u&&c>0?"clearFirstLine":"stepLeft",paragraphs:d}}function N2(e,t){let n=Number.POSITIVE_INFINITY,r=false;for(let{line:o}of chunk4GBTELJV_cjs.td(e).get(t)??[]){if(!r&&(r=true,chunk4GBTELJV_cjs.Ma(o)[0]?.paragraphId!==t))return {kind:"midLine"};let a=chunk4GBTELJV_cjs.Na(o,t);if(a){for(let i of a.spans)i.range.end>i.range.start&&(n=Math.min(n,i.range.start));for(let i of a.drawings)n=Math.min(n,i.start);if(Number.isFinite(n))break}}return Number.isFinite(n)?{kind:"start",offset:n}:{kind:"empty"}}var D2=["firstLine","hanging","firstLineChars","hangingChars"];function ST(e,t,n){let r=new Map;return {start(o){let a=r.get(o);if(a)return a;let i=N2(e,o);if(i.kind==="start"){let s=chunkFIJZIQXA_cjs.Ta(t,o),l=s?.kind==="paragraph"?Xm(s):0;l>i.offset&&(i={kind:"start",offset:l});}return r.set(o,i),i},endsStory:o=>n[n.length-1]===o,firstLine(o){let a=Yp(e,o),i=chunkFIJZIQXA_cjs.Dh(t,o).find(l=>l.localName==="ind")?.attributes,s=D2.some(l=>i?.[l]!==void 0);return {resolved:a?Cd(a.indent):0,direct:s}}}}function IT(e,t){let n=(r,o)=>r.paragraphId===o.paragraphId&&r.offset===o.offset;return (e.contentControls??[]).some(r=>{if(!r.placeholder)return false;let o=Is(e,r);return o!==null&&n(o.from,t.from)&&n(o.to,t.to)})}var Jm="a section break that changes where the next section starts cannot be suggested; turn off suggesting to insert it",pc="a section break cannot be inserted inside a table cell",kT="a section break cannot change a section that a locked or linked content control holds",tg="a section break cannot be inserted in locked or linked content";function H2(e){let t=new Set,n=new Set,r=a=>{if(a.kind==="textValue"||!("localName"in a)||a.localName!=="sdt")return false;let i=a.children?.find(s=>s.kind!=="textValue"&&"localName"in s&&s.localName==="sdtPr");return !i||i.kind==="textValue"?false:(i.children??[]).some(s=>{if(s.kind==="textValue"||!("localName"in s)||s.namespaceUri!==chunkFIJZIQXA_cjs.la)return false;if(s.localName==="dataBinding")return true;if(s.localName!=="lock")return false;let l=s.attributes?.find(d=>d.localName==="val"&&d.namespaceUri===chunkFIJZIQXA_cjs.la)?.value;return l==="contentLocked"||l==="sdtContentLocked"})},o=(a,i,s)=>{if(a.kind==="textValue")return;if(a.kind==="paragraph"){i&&t.add(a.id),s&&n.add(a.id);return}let l=i||a.kind==="table",d=s||r(a);for(let c of a.children??[])o(c,l,d);};return o(e.root,false,false),{inCell:t,held:n}}var _2=32;function B2(e){let t=new Set(chunkFIJZIQXA_cjs.Ek(e).map(n=>chunkFIJZIQXA_cjs.Hk(n)));return chunkFIJZIQXA_cjs.Dk(e)||t.add("nextPage"),t.size===1?[...t][0]:null}function ng(e,t){let n=t.replaceAt??t.collapseTo;return chunkFIJZIQXA_cjs.Fk(e,n.paragraphId)?t.collapseTo:n}var eg=(e,t)=>chunkFIJZIQXA_cjs.ag(e,t)||chunkFIJZIQXA_cjs.Zf(e,t).content;function fc(e,t,n,r){if(chunkFIJZIQXA_cjs.Fk(e,t))return pc;if(eg(e,t))return tg;let{section:o,ownerId:a}=chunkFIJZIQXA_cjs.Gk(e,t);return chunkFIJZIQXA_cjs.Hk(o)===n?null:a!==null&&eg(e,a)?kT:r?Jm:null}function RT(e){let{breakType:t,suggesting:n}=e;if(e.cellRectangle)return pc;if(e.caretParagraphId!==null)return fc(e.part(),e.caretParagraphId,t,n);let r=H2(e.part());if(!n&&r.inCell.size===0&&r.held.size===0)return null;let{from:o,to:a}=e.orderedRange(),i=e.part(),s=chunkFIJZIQXA_cjs.Gk(i,o.paragraphId),l=chunkFIJZIQXA_cjs.Gk(i,a.paragraphId),d=s.section===l.section,c=d?chunkFIJZIQXA_cjs.Hk(s.section):B2(i),u=e.paragraphOrder(),p=u.indexOf(o.paragraphId),m=u.indexOf(a.paragraphId),h=p===-1||m===-1?null:u.slice(p,m+1),y=h!==null&&!h.some(b=>r.inCell.has(b))&&!h.some(b=>r.held.has(b));if(c!==null&&c!==t){if(y&&d&&s.ownerId!==null&&eg(i,s.ownerId))return kT;if(n&&y)return Jm}if(y&&c!==null)return null;if(h===null||h.length-1>_2)return n&&c!==null&&c!==t?Jm:null;let g=ng(i,e.deleteSelectionPlan());return fc(i,g.paragraphId,t,n)}var $2=[["contextualSpacing","contextualSpacing"],["keepNext","keepNext"],["keepLines","keepLines"],["widowControl","widowControl"],["pageBreakBefore","pageBreakBefore"]];function q2(e,t){let n={...e??{}};return delete n.leftChars,delete n.startChars,e?.start!==void 0&&(n.start=t),(e?.start===void 0||e.left!==void 0)&&(n.left=t),n}function mc(e,t,n,r){let o={...e};if(delete o[`${t}Chars`],delete o[`${n}Chars`],r===null)return delete o[t],delete o[n],o;let a=String(r),i=e[n]!==void 0;return i&&(o[n]=a),(!i||e[t]!==void 0)&&(o[t]=a),o}function PT(e,t){let n={...e};return delete n.firstLineChars,delete n.hangingChars,t===null?(delete n.firstLine,delete n.hanging,n):(t>=0?(n.firstLine=String(t),n.hanging="0"):(n.hanging=String(-t),n.firstLine="0"),n)}function TT(e){let{session:t,commit:n,orderedStart:r,orderedRange:o,selectionMark:a,collapsedAt:i}=e,s=e.deleteSelectionPlan,l=()=>t.partFor(e.storyScope())??t.part(),d=(w,O,N)=>t.applyTreeOps(w,O,N,e.storyScope()),c=rk({session:t,storyPart:l}),u=()=>e.paragraphOrder(),p={get value(){return e.layout()}};function m(){let w=e.selectedCells?.();return w&&w.length>0?w:null}function h(w){let O=false;return n(()=>{let N=w();return O=N.committed,N},void 0,{keepCellSelection:m()!==null}),O}function y(w=o()){if(m()!==null)return [...chunk6APGXLBB_cjs.ga(p.value,m())];let{from:O,to:N}=w,A=u(),V=A.indexOf(O.paragraphId),W=A.indexOf(N.paragraphId);return V===-1||W===-1?null:A.slice(V,W+1)}let g=8;function b(w){return S(w)?.level??null}function S(w){return chunk4GBTELJV_cjs.Qa(p.value,w)}function x(w){let O=S(w);return O?O.numFmt==="bullet"?"bullet":"ordered":null}function I(w,O){let N=u(),A=N.indexOf(w[0]??""),V=N.indexOf(w[w.length-1]??"");if(A===-1||V===-1)return null;for(let W of [A-1,V+1]){let E=N[W];if(!E)continue;let _=S(E);if(_&&(_.numFmt==="bullet"?"bullet":"ordered")===O)return _.numId}return null}function M(w,O){return O<0||O>g?false:e.numberingLevelExists(w.numId,O)}function k(w,O){return O<0||O>g?false:e.numberingLevelExists(w.numId,O)?true:t.ensureNumberingLevel(w.numId,O,w.numFmt==="bullet"?"bullet":"ordered")&&e.numberingLevelExists(w.numId,O)}function P(w,O,N){let A=O==="increase"?1:-1,V=[];for(let W of w){let E=ar(p.value,W),_=S(W),G=_?.level??null;if(_&&G!==null){let Z=G+A;if(Z<0||Z>g||!k(_,Z))continue;V.push({op:"setListLevel",paragraphId:W,level:Z});continue}let U=Qm(E),$=N===void 0?Ym(U,A):vT(U,A,N);if($===U)continue;let pe=chunkFIJZIQXA_cjs.Dh(l(),W),he=pe.find(Z=>Z.localName==="ind");V.push({op:"setParagraphProperties",paragraphId:W,properties:chunkFIJZIQXA_cjs.Fh(pe,{localName:"ind",attributes:q2(he?.attributes,String($))})});}return V.length===0?false:h(()=>d(V,a()))}function R(w,O){let N=[];for(let A of w){let V=chunkFIJZIQXA_cjs.Dh(l(),A),E={...V.find(_=>_.localName==="ind")?.attributes??{}};O.left!==void 0&&(E=mc(E,"left","start",O.left)),O.right!==void 0&&(E=mc(E,"right","end",O.right)),O.firstLine!==void 0&&(E=PT(E,O.firstLine)),N.push({op:"setParagraphProperties",paragraphId:A,properties:chunkFIJZIQXA_cjs.Fh(V,{localName:"ind",...Object.keys(E).length>0?{attributes:E}:{}})});}return N.length===0?false:h(()=>d(N,a()))}return {insertTab(){let w=s(),O=w.replaceAt??w.collapseTo;n(()=>d([...w.ops,{op:"insertTab",paragraphId:O.paragraphId,offset:O.offset}],a()),()=>i({...O,offset:O.offset+1}));},insertLineBreak(){let w=s(),O=w.replaceAt??w.collapseTo;n(()=>d([...w.ops,{op:"insertHardBreak",paragraphId:O.paragraphId,offset:O.offset}],a()),()=>i({...O,offset:O.offset+1}));},insertPageBreak(){let w=s(),O=w.replaceAt??w.collapseTo;n(()=>d([...w.ops,{op:"insertPageBreak",paragraphId:O.paragraphId,offset:O.offset}],a()),()=>i({...O,offset:O.offset+1}));},exitListOnEmptyItem(){let{from:w,to:O}=o();if(w.paragraphId!==O.paragraphId||w.offset!==O.offset)return false;let N=S(w.paragraphId);if(!N||e.paragraphTextOf(w.paragraphId).length>0)return false;let V=N.level>0&&M(N,N.level-1),W=[];if(V)W.push({op:"setListLevel",paragraphId:w.paragraphId,level:N.level-1});else {let _=c.clearOp(w.paragraphId);_&&W.push(_),W.push({op:"setListNumbering",paragraphId:w.paragraphId,numId:null});}let E=false;return n(()=>{let _=d(W,a());return E=_.committed,_}),E},isListParagraph(){let{paragraphId:w}=r();return b(w)!==null},isListActive(w){let O=y();if(O===null)return false;let N=w==="bullet"?"bullet":"ordered";return O.length>0&&O.every(A=>x(A)===N)},toggleList(w){let O=y();if(O===null||O.length===0)return false;let N=O.every(W=>x(W)===w),A=N?null:I(O,w)??t.ensureListDefinition(w);if(!N&&A===null)return false;let V=N?[]:c.applyOps(O);for(let W of O){let E=b(W);V.push({op:"setListNumbering",paragraphId:W,numId:A,...E!==null?{level:E}:{}});}return h(()=>d(V,a()))},canAdjustIndent(w){let O=y();if(O===null)return false;let N=w==="increase"?1:-1;return O.some(A=>{let V=S(A);if(V){let E=V.level+N;return E>=0&&E<=g}let W=Qm(ar(p.value,A));return Ym(W,N)!==W})},adjustIndent(w){let O=y();return O!==null&&P(O,w)},setIndent(w){if(w.left===void 0&&w.right===void 0&&w.firstLine===void 0)return false;let O=y();return O!==null&&R(O,w)},indentWithTab(w){let O=o();if(O.from.paragraphId===O.to.paragraphId&&O.from.offset===O.to.offset&&m()===null||IT(p.value,O))return false;let A=y(O);if(A===null)return false;let V=Math.round(chunk4GBTELJV_cjs.zb(t.settingsRoot())*20),W=ST(p.value,l(),u()),E=m()===null?wT(O,A,W,w,V):{write:"stepLeft",paragraphs:A};return E===null?false:(E.write==="stepLeft"?P(E.paragraphs,w,V):R(E.paragraphs,{firstLine:E.write==="setFirstLine"?V:null}),true)},setParagraphFormat(w){let O=y();if(O===null||O.length===0)return false;let N=[];w.direction!==void 0&&N.push({localName:"bidi",paragraphDirection:w.direction}),w.alignment!==void 0&&N.push({localName:"jc",attributes:{val:w.alignment},physicalAlignment:true});let A={...Va("before",w.spaceBeforePt),...Va("after",w.spaceAfterPt),...uc(w.lineSpacing)};Object.keys(A).length>0&&N.push({localName:"spacing",attributes:A,mergeAttributes:true});for(let[_,G]of $2){let U=w[_];U!==void 0&&N.push({localName:G,attributes:gT(U)});}let V=w.tabStops!==void 0,W=w.indentLeftTwips!==void 0||w.indentRightTwips!==void 0||w.indentFirstLineTwips!==void 0;if(N.length===0&&!W&&!V)return false;let E=[];for(let _ of O){let G=chunkFIJZIQXA_cjs.Dh(l(),_),U=G;if(W){let F={...G.find(L=>L.localName==="ind")?.attributes??{}};w.indentLeftTwips!==void 0&&(F=mc(F,"left","start",w.indentLeftTwips)),w.indentRightTwips!==void 0&&(F=mc(F,"right","end",w.indentRightTwips)),w.indentFirstLineTwips!==void 0&&(F=PT(F,w.indentFirstLineTwips)),U=chunkFIJZIQXA_cjs.Fh(U,{localName:"ind",...Object.keys(F).length>0?{attributes:F}:{}});}let $=ar(p.value,_),pe=G,he=false;for(let Z of N){let F=lc(Z,$,U,pe);if(!F)continue;if(he=true,F.remove){U=U.filter(q=>q.localName!==F.localName);continue}let L=F.mergeAttributes?{...U.find(q=>q.localName===F.localName)?.attributes??{},...F.attributes}:F.attributes??{},B=Object.fromEntries(Object.entries(L).filter(([,q])=>q!=null));U=chunkFIJZIQXA_cjs.Fh(U,{localName:F.localName,...Object.keys(B).length>0?{attributes:B}:{}});}if((he||W)&&E.push({op:"setParagraphProperties",paragraphId:_,properties:U}),V){let Z=gs(e.layout(),_);E.push({op:"setParagraphTabStops",paragraphId:_,stops:w.tabStops.map(F=>({positionTwips:Math.round(F.positionTwips),alignment:F.alignment,...F.leader&&F.leader!=="none"?{leader:F.leader}:{}})),...Z?{inForcePositionsTwips:Z.stops.map(F=>Math.round(F.positionPt*20))}:{}});}}return E.length===0?false:h(()=>d(E,a()))},sectionProperties:()=>chunk4GBTELJV_cjs.Nc(t.part()),sectionPropertiesAt(w){let O=chunk4GBTELJV_cjs.Oc(t.part(),e.revisionDisplayMode(),e.revisionAuthorFilter()),N=ks(t,w,e.storyScope(),e.headerFooterSectionIndex?.(),e.revisionDisplayMode(),e.revisionAuthorFilter());return (O[N]??O[O.length-1]).properties},sectionAnchorParagraphAt(w){return mT(t,w,e.storyScope(),e.headerFooterSectionIndex?.(),e.revisionDisplayMode(),e.revisionAuthorFilter())},setSectionProperties(w){let O=false;return n(()=>{let N=e.storyScope().kind==="body",A=t.applyTreeOps([{op:"setSectionProperties",...w}],N?a():void 0,void 0,{kind:"body"});return O=A.committed,A}),O},sectionBreakRefusal(w="nextPage"){return e.storyScope().kind!=="body"?null:RT({part:()=>t.part(),breakType:w,suggesting:e.editingMode?.()==="suggest",cellRectangle:(e.selectedCells?.()?.length??0)>0,caretParagraphId:e.caretParagraphId?.()??null,orderedRange:o,paragraphOrder:u,deleteSelectionPlan:s})},insertSectionBreak(w="nextPage"){if(e.storyScope().kind!=="body")return false;let O=s(),N=ng(t.part(),O),A=(chunkFIJZIQXA_cjs.Fk(t.part(),N.paragraphId)?pc:null)??fc(t.part(),N.paragraphId,w,e.editingMode?.()==="suggest");if(A!==null)return e.publishRefusal?.(A),false;let V=new Set(t.paragraphIds()),W=false,E=false;return n(()=>{let _=t.applyTreeOps([...O.ops,{op:"splitParagraph",paragraphId:N.paragraphId,offset:N.offset},{op:"setSectionMark",paragraphId:N.paragraphId,breakType:w}],a(),void 0,{kind:"body"});return W=_.committed,E=_.reason==="locked"||_.reason==="bound",_},()=>{let _=t.paragraphIds().find(G=>!V.has(G));return _?i({paragraphId:_,offset:0}):null}),!W&&E&&e.publishRefusal?.(tg),W}}}var AT="http://schemas.openxmlformats.org/wordprocessingml/2006/main";function FT(e){return e.kind==="textValue"?false:e.kind==="contentControl"?true:e.kind==="generic"&&e.localName==="sdt"&&e.namespaceUri===AT}function V2(e){return e.kind==="textValue"?false:e.kind==="contentControlContent"?true:e.kind==="generic"&&e.localName==="sdtContent"&&e.namespaceUri===AT}function rg(e){return e.kind==="textValue"?[]:e.children}function LT(e,t=0){if(e.kind==="textValue")return e.value;if(t>=chunkFIJZIQXA_cjs.wa||e.kind==="deletedText"||K2(e.kind)||chunkFIJZIQXA_cjs.tf(e)||e.kind==="runProperties")return "";let n=chunkFIJZIQXA_cjs.fb(e);if(n!==null)return n;if(e.kind==="generic"&&!chunkFIJZIQXA_cjs.ya(e)&&!FT(e))return "";if(e.kind==="tab")return " ";if(e.kind==="hardBreak")return chunkFIJZIQXA_cjs.pb(e);let r=chunkFIJZIQXA_cjs.xa(e,t),o="";for(let a of e.children)o+=LT(a,r);return o}function K2(e){return e==="revisionDelete"||e==="revisionMoveFrom"}function og(e,t,n){if(!(t>=chunkFIJZIQXA_cjs.wa))for(let r of e){if(r.kind==="hyperlink"){chunkFIJZIQXA_cjs.xa(r,t)<chunkFIJZIQXA_cjs.wa&&n(r,t);continue}if(chunkFIJZIQXA_cjs.ya(r)){og(rg(r),chunkFIJZIQXA_cjs.xa(r,t),n);continue}if(FT(r)){for(let o of rg(r))V2(o)&&og(rg(o),chunkFIJZIQXA_cjs.xa(r,t),n);continue}n(r,t);}}function CT(e,t,n){let r=W2(e,t);if(!r||r.kind!=="paragraph")return [];let o=chunkFIJZIQXA_cjs.jg(r),a=[],i=0;return og(r.children,0,(s,l)=>{let d=o.spanOf(s);if(d&&(i=Math.max(i,d.end)),s.kind!=="hyperlink")return;let c=d?d.start:i,u=d?d.end:i,p=chunkFIJZIQXA_cjs.Bd(s,n);a.push({id:s.id,paragraphId:t,start:c,end:u,text:chunkFIJZIQXA_cjs.jb(LT(s,l)),kind:p.kind,href:p.href,authored:p.authored,...p.anchor!==void 0?{anchor:p.anchor}:{},...p.tooltip!==void 0?{tooltip:p.tooltip}:{}});}),a}function W2(e,t){let n=r=>{if(r.kind==="textValue")return r.id===t?r:null;if(r.id===t)return r;for(let o of r.children){let a=n(o);if(a)return a}return null};return n(e.root)}function j2(e,t){for(let n of e)if(n.paragraphId===t.paragraphId&&t.offset>=n.start&&t.offset<=n.end)return n;return null}function Z2(e,t){for(let n of chunk4GBTELJV_cjs.Ga(e,t.paragraphId))for(let r of n.lines)for(let o of r.spans)if(!(!o.fieldAtom||!o.link)&&t.offset>=o.range.start&&t.offset<=o.range.end)return o.link.id;return null}function NT(e){let t=()=>e.storyScope(),n=()=>e.session.partFor(t()),r=d=>e.session.relationshipTarget(d,t()),o=(d,c,u)=>e.session.applyTreeOps(d,c,u,t()),a=d=>{let c=n();return c?CT(c,d,r):[]},i=()=>j2(a(e.selection().head.paragraphId),e.selection().head),s=()=>{let d=e.selection().head,c=Z2(e.layout(),d);return c===null?null:e.fieldLinkById(c)},l=d=>{let c=e.selection().head.paragraphId,u=a(c).find(p=>p.id===d);if(u)return u;for(let p of e.session.storyParts()){let m=h=>chunkFIJZIQXA_cjs.Ig(e.session.currentPackage(),p.name,h);for(let h of chunkFIJZIQXA_cjs.Oc(p))for(let y of chunkFIJZIQXA_cjs.Rc(h.root)){let g=y.id,b=CT(p,g,m).find(S=>S.id===d);if(b)return b}}return null};return {linksInCaretParagraph:()=>a(e.selection().head.paragraphId),linkAtCaret:i,fieldLinkAtCaret:s,linkById:l,applyHyperlink(d){let c=d.text===void 0?d:{...d,text:chunkFIJZIQXA_cjs.kb(d.text)},u=c.url!==void 0&&c.url.length>0,p=c.anchor!==void 0&&c.anchor.length>0;if(u===p)return false;let m=t();if(!n()||e.refusesWrite())return false;let h;if(u){let O=()=>e.session.ensureHyperlinkRelationship(c.url,m),N=e.withMintActor?e.withMintActor(O):O();if(!N)return false;h=N;}let y={...h!==void 0?{relationshipId:h}:{},...p?{anchor:c.anchor}:{},...c.tooltip!==void 0?{tooltip:c.tooltip}:{}},g=i(),b=e.orderedRange(),S=b.from.paragraphId===b.to.paragraphId&&b.from.offset===b.to.offset;if(g&&(S||z2(g,b))){let O=[];if(c.text!==void 0&&c.text!==chunkFIJZIQXA_cjs.kb(g.text)){if(c.text.length===0)return false;let A=e.replacementLanding?.(g.paragraphId,g.start,g.end),V=e.textOf(g.paragraphId).slice(g.start,g.start+2),W=g.start+(V.length===2&&V.charCodeAt(0)>=55296&&V.charCodeAt(0)<=56319&&V.charCodeAt(1)>=56320&&V.charCodeAt(1)<=57343?2:1);if(A!=null&&A>g.start&&W<g.end)O.push({op:"setHyperlinkTarget",linkId:g.id,...y},{op:"deleteText",paragraphId:g.paragraphId,start:g.start,end:g.end},{op:"insertText",paragraphId:g.paragraphId,offset:W,text:c.text});else if(A!=null){let E=ET(e.session);O.push({op:"setHyperlinkTarget",linkId:g.id,...y},...OT(g,A,c.text),{op:"insertHyperlink",paragraphId:g.paragraphId,start:A,end:A+c.text.length,...y,...E?{styleId:E}:{}});}else {let E=MT(g.paragraphId,g.start,g.end,c.text);if(!E)return false;O.push({op:"setHyperlinkTarget",linkId:g.id,...y},...E);}}else O.push({op:"setHyperlinkTarget",linkId:g.id,...y});let N=false;return e.commit(()=>{let A=o(O,e.selectionMark());return N=A.committed,A},()=>null),N}let x=b.from.paragraphId;if(b.to.paragraphId!==x)return false;let I=[],M=b.from.offset,k=b.to.offset;if(S){let O=c.text??c.url??c.anchor??"";if(O.length===0)return false;M=e.insertionLanding?.(x,M)??M,I.push({op:"insertText",paragraphId:x,offset:M,text:O}),k=M+O.length;}else {let O=e.replacementLanding?.(x,M,k);if(O!=null){let N=c.text??e.textOf(x).slice(M,k);if(N.length===0)return false;I.push(...OT({paragraphId:x,start:M,end:k},O,N)),M=O,k=O+N.length;}else if(c.text!==void 0&&c.text!==e.textOf(x).slice(M,k)){let N=MT(x,M,k,c.text);if(!N)return false;I.push(...N),k=M+c.text.length;}}if(k<=M)return false;let P=ET(e.session);I.push({op:"insertHyperlink",paragraphId:x,start:M,end:k,...y,...P?{styleId:P}:{}});let R=false,w={paragraphId:x,offset:k};return e.commit(()=>{let O=o(I,e.selectionMark(),{paragraphId:x,start:k,end:k});return R=O.committed,O},()=>({anchor:w,head:w})),R},removeHyperlink(d){if(!n())return false;let c=d?l(d):i();if(!c)return false;let u=false,p={paragraphId:c.paragraphId,offset:c.end};return e.commit(()=>{let m=o([{op:"removeHyperlink",linkId:c.id}],e.selectionMark());return u=m.committed,m},()=>({anchor:p,head:p})),u}}}function ET(e){for(let t of e.documentStyles())if(t.type==="character"&&t.styleId.toLowerCase()==="hyperlink")return t.styleId;return null}function z2(e,t){return t.from.paragraphId===e.paragraphId&&t.to.paragraphId===e.paragraphId&&t.from.offset>=e.start&&t.to.offset<=e.end}function OT(e,t,n){return [{op:"deleteText",paragraphId:e.paragraphId,start:e.start,end:e.end},{op:"insertText",paragraphId:e.paragraphId,offset:t,text:n}]}function MT(e,t,n,r){if(r.length===0)return null;let o=[{op:"insertText",paragraphId:e,offset:t,text:r,bias:"right"}];return n>t&&o.push({op:"deleteText",paragraphId:e,start:t+r.length,end:n+r.length}),o}var U2=24;function DT(e){let{pagesLayer:t}=e,n=t.ownerDocument.defaultView;function r(){return e.container.closest(".docx-editor__scroll-container")}let o=p=>{if(!p||p.length===0||p.startsWith("#"))return false;let m=chunkFIJZIQXA_cjs.Q(p);return !m.ok||!m.href||!n?false:(n.open(m.href,"_blank","noopener,noreferrer"),true)},a=p=>{if(e.enterStoryFor&&!e.enterStoryFor(p.paragraphId))return false;let m=e.layout(),h=chunk4GBTELJV_cjs.ne(m,p);if(!h)return false;let y=m.pages[h.pageIndex];if(!y)return false;let g=y.box.y+(y.contentBox.y-y.box.y)+h.y,b=r();return b&&(b.scrollTop=Math.max(0,g*e.scale()-U2),e.onScrolled?.()),e.setSelection(p),true},i=p=>{let m=e.bookmarks().get(p);return m?a(m):false},s=null;function l(p){if(!p||p.closest("[data-docx-hf]"))return null;let m=p.closest("a.docx-hyperlink");if(m){let y=m.dataset.docxLink;return y?{linkId:y,drawing:false}:null}let h=p.closest("[data-docx-drawing-link]");if(h){let y=h.dataset.docxDrawingLink;return y?{linkId:y,drawing:true}:null}return null}let d=p=>{s=null;let m=p.target,h=l(m);if(!h)return;let g=m.closest("[data-docx-drawing-link], a.docx-hyperlink").getBoundingClientRect();s={linkId:h.linkId,drawing:h.drawing,rect:{left:g.left,top:g.top,bottom:g.bottom,right:g.right}};},c=p=>{let m=p.target,h=l(m);if(!h){let b=s;if(s=null,!b)return;p.preventDefault(),u(b.linkId,b.rect,p,b.drawing);return}s=null,p.preventDefault();let g=m.closest("[data-docx-drawing-link], a.docx-hyperlink").getBoundingClientRect();u(h.linkId,{left:g.left,top:g.top,bottom:g.bottom,right:g.right},p,h.drawing);};function u(p,m,h,y){let g=y?e.drawingLinkById?.(p)??null:e.linkById(p);if(!g)return;if(h.metaKey||h.ctrlKey){g.kind==="external"?o(g.href):g.anchor&&i(g.anchor);return}if(e.isCollapsedSelection()){if(g.kind==="internal"){g.anchor&&i(g.anchor);return}e.onPopover?.({link:g,rect:m});}}return t.addEventListener("pointerdown",d,true),t.addEventListener("click",c),{goToPosition:a,goToBookmark:i,openExternal:o,destroy(){t.removeEventListener("pointerdown",d,true),t.removeEventListener("click",c);}}}function G2(e){let t=e.hyperlinkHref;if(!t)return null;let n=e.kind==="anchoredDrawing"?e.anchorParagraphId:e.paragraphId,r=e.kind==="inlineDrawing"?e.start:0,o=t.startsWith("#")?"internal":"external";return Object.freeze({id:e.drawingNodeId,paragraphId:n,start:r,end:r+1,text:"",kind:o,href:t,authored:t,...o==="internal"?{anchor:t.slice(1)}:{}})}function ag(e,t){return e.drawingNodeId!==t?null:G2(e)}function HT(e,t){if(!e)return null;for(let n of e.anchoredDrawings??[]){let r=ag(n,t);if(r)return r}return null}function X2(e,t){for(let r of e.anchoredDrawings??[]){let o=ag(r,t);if(o)return o}for(let r of e.fragments){if(r.kind==="table"){for(let a of r.rows)for(let i of a.cells)for(let s of i.blocks){let l=BT(s,t);if(l)return l}continue}let o=_T(r,t);if(o)return o}let n=HT(e.header,t);return n||HT(e.footer,t)}function _T(e,t){for(let n of e.lines)for(let r of n.drawings??[]){let o=ag(r,t);if(o)return o}return null}function BT(e,t){if(e.kind==="table"){for(let n of e.rows)for(let r of n.cells)for(let o of r.blocks){let a=BT(o,t);if(a)return a}return null}return _T(e,t)}function $T(e,t){for(let n of e.pages){let r=X2(n,t);if(r)return r}return null}var gc=24;function qT(e){let t=null,n=false;return {without(r){let o=n;n=true;try{return r()}finally{n=o;}},follow(r,o){let a=n?"none":o;if(e.storyScopeOpen())return;let i=e.selection();if(!(i.anchor.paragraphId===i.head.paragraphId&&i.anchor.offset===i.head.offset)&&a!=="head")return;let l=e.pagesLayer.ownerDocument.activeElement;if(l!==e.pagesLayer&&(!l||!e.pagesLayer.contains(l)))return;let d=e.preferredPageIndex(),c=e.preferredLineId?.(),u=e.layout(),p=chunk4GBTELJV_cjs.ne(u,i.head,{measurer:e.measurer(),...d!==void 0?{preferredPageIndex:d}:{},...c!==void 0?{preferredLineId:c}:{}});if(!p)return;let m=t!==null&&t!==p.pageIndex;if(t=p.pageIndex,a==="none"||!r&&!m)return;let h=u.pages[p.pageIndex],y=e.scroller();if(!h||!y||y.clientHeight<=0)return;let g=e.scale(),b=h.contentBox.y-h.box.y,S=(h.box.y+b+p.y)*g+e.container.offsetTop,x=S+p.height*g,I=y.scrollTop,M=I+y.clientHeight,k=I;if(S<I+gc)k=S-gc;else if(x>M-gc)k=x+gc-y.clientHeight;else return;let P=Math.max(0,y.scrollHeight-y.clientHeight),R=Math.max(0,Math.min(k,P));Math.abs(R-y.scrollTop)<.5||(y.scrollTop=R,e.scheduleRematerialize());}}}function VT(e,t){let n=[],r=i=>{for(let s of i){if(s.kind==="paragraph"){n.push({id:s.id,length:chunkFIJZIQXA_cjs.jg(s).length});continue}if(s.kind==="textValue")continue;if(s.kind==="contentControl"){r(t.contentChildrenOf(s));continue}r(s.children);}};if(r(t.contentChildrenOf(e)),n.length>0){let i=n[0],s=n[n.length-1];return {anchor:{paragraphId:i.id,offset:0},head:{paragraphId:s.id,offset:s.length}}}let o=null,a=i=>{for(let s of i){if(s.kind==="paragraph"){let l=chunkFIJZIQXA_cjs.jg(s).spanOf(e);if(!l)continue;return o={anchor:{paragraphId:s.id,offset:l.start},head:{paragraphId:s.id,offset:l.end}},true}if(s.kind!=="textValue"&&a(s.children))return true}return false};return a(t.searchRoots()),o}function KT(e){return {applyHeaderFooterLifecycle(t){let n=null;return e.commit(()=>{let r=e.applyOps([t]);return r.rejected&&(n=String(r.reason??"rejected")),r}),n?{ok:false,reason:n}:{ok:true}},insertPageField(t){if(!e.isHeaderFooterOpen())return false;let n=e.deleteSelectionPlan(),r=n.replaceAt??n.collapseTo;return e.commit(()=>e.applyOps([...n.ops,{op:"insertPageField",paragraphId:r.paragraphId,offset:r.offset,field:t}],e.selectionMark()),()=>e.collapsedAt({paragraphId:r.paragraphId,offset:r.offset+(t==="PAGE_X_OF_Y"?6:1)})),e.lastRejection()===null}}}var Rs="the document is open for viewing",ig="image changes are not supported in suggesting mode",WT="tracked changes need a non-empty author";function jT(e){function t(){return {committed:false,rejected:true,opCount:0,reason:Rs}}function n(){return {committed:false,rejected:true,opCount:0,reason:ig}}return {applyDrawingOps(r){if(e.editingMode()==="view")return t();if(e.editingMode()==="suggest")return n();let o=e.selectionMark(),a={committed:false,rejected:true,opCount:0};return e.commit(()=>(a=e.applyOps(r,o,o),a)),a},applyImageProperties(r){if(e.editingMode()==="view")return {ok:false,reason:"invalidArgs",detail:Rs};if(e.editingMode()==="suggest")return {ok:false,reason:"invalidArgs",detail:ig};let o={ok:false,reason:"invalidArgs"};return e.commit(()=>(o=e.session.applyImageProperties(e.storyScope(),r),{committed:o.ok,rejected:!o.ok,opCount:o.ok?1:0,...o.ok?{}:{reason:o.detail??o.reason}})),o},deleteImage(r){if(e.editingMode()==="view")return {ok:false,reason:"invalidArgs",detail:Rs};let o=e.editingMode()==="suggest",a=e.author();if(o&&(a===void 0||a===""))return {ok:false,reason:"invalidArgs",detail:WT};let i={ok:false,reason:"invalidArgs"};return e.commit(()=>(i=o?e.session.deleteImageTracked(e.storyScope(),r,{author:a,date:e.trackedDate()}):e.session.deleteImage(e.storyScope(),r),{committed:i.ok,rejected:!i.ok,opCount:i.ok?1:0,...i.ok?{}:{reason:i.detail??i.reason}})),i},insertImage(r){if(e.editingMode()==="view")return Promise.resolve({ok:false,reason:"invalidArgs",detail:Rs});let o=e.editingMode()==="suggest",a=e.author();if(o&&(a===void 0||a===""))return Promise.resolve({ok:false,reason:"invalidArgs",detail:WT});let i=e.actorId();return e.session.insertImage(e.storyScope(),{...r,decodePort:e.decodePort(),...o?{revision:{author:a,date:e.trackedDate()}}:{},...i?{actorId:i}:{}})},replaceImage(r,o,a,i){if(e.editingMode()==="view")return Promise.resolve({ok:false,reason:"invalidArgs",detail:Rs});if(e.editingMode()==="suggest")return Promise.resolve({ok:false,reason:"invalidArgs",detail:ig});let s=e.actorId();return e.session.replaceImage(e.storyScope(),r,o,a,e.decodePort(),{...i,commitGuard:()=>e.editingMode()==="edit"&&i.commitGuard?.()!==false,...s?{actorId:s}:{}})}}}function ZT(e){let t=null,n=null,r="",o=()=>{let d=e.session.part(),c=e.revisionDisplayMode(),u=e.revisionAuthorFilter();return {sections:chunk4GBTELJV_cjs.Oc(d,c,u),sourceIndexes:chunk4GBTELJV_cjs.Pc(d,c,u)}},a=d=>{let{sourceIndexes:c}=o(),u=c.indexOf(d);if(u!==-1)return u;let p=c.findIndex(m=>m>d);return p===-1?Math.max(0,c.length-1):p},i=()=>{if(!t)return;let d=Sw(e.layout(),t,e.materializedPages?.());d!==t.pageIndex&&(t={...t,pageIndex:d,sectionIndex:e.sectionAtPage(d).sectionIndex});},s=d=>{if(e.entryRefused?.()===true&&t?.scope.rId!==d.rId||!d.rId||e.session.partFor({kind:"headerFooter",rId:d.rId})===null)return false;t?.scope.rId!==d.rId&&e.leaveOtherStories?.();let c=e.layout(),u=vw(c,d.rId),p=t,m=p?.scope.rId===d.rId,h=u?null:Y2(e.session,d.rId);if(!u&&!h)return false;let y=d.pageIndex??(m&&p?p.pageIndex:u?.pageIndex??0),g=d.kind??(m&&p?p.kind:u?.kind??h.kind),b=d.variant??(m&&p?p.variant:u?.story.variant??h.variant),S=m&&p?p.partName:u?.story.partName??h.partName,x=c.pages[y]??c.pages[u?.pageIndex??0],I=(x?Ta(x,{scope:{kind:"headerFooter",rId:d.rId},kind:g,partName:S}):null)??u?.story??{scope:{rId:d.rId},variant:b,partName:S},M=e.selection(),k=p?p.savedBodySelection:{anchor:{...M.anchor},head:{...M.head}},P=m&&p?.sectionIndex!==void 0&&y===p.pageIndex,R=d.sectionIndex??(P?p.sectionIndex:u?e.sectionAtPage(y).sectionIndex:h?a(h.sectionIndex):void 0);t={scope:{kind:"headerFooter",rId:d.rId},pageIndex:y,...R!==void 0?{sectionIndex:R}:{},kind:g,variant:I.variant,partName:I.partName,savedBodySelection:k};let O=e.session.paragraphIdsIn(ed(t))[0];if(!O)return t=null,false;let N=d.position?rd(c,{anchor:d.position,head:d.position},t):m?rd(c,M,t):{anchor:{paragraphId:O,offset:0},head:{paragraphId:O,offset:0}};return e.setScopeSelection(N),e.noteModelMoved(),e.render(),e.mirrorToDom(),e.notify(),true},l=()=>{if(!t)return;let d=t.savedBodySelection;t=null,e.setScopeSelection(rd(e.layout(),d,null)),e.noteModelMoved(),e.render(),e.mirrorToDom(),e.notify();};return {getActive:()=>t,activeScope:()=>bw(t),setActiveScope(d){return d.kind==="body"?(l(),true):d.kind==="headerFooter"?s({rId:d.rId}):false},enterHeaderFooter:s,exitHeaderFooter:l,reconcileOccurrence:i,headerFooterState(){if(!t)return null;let d=e.session.headerFooterResolutionBySection(),c=t.sectionIndex??0,u=o(),p,m,h,y=x=>{let I=u.sourceIndexes[x]??x,M=d[I];if(!M)return false;let P=(t.kind==="header"?M.headers:M.footers).get(t.variant);return !P||P.rId!==t.scope.rId?false:(c=x,p=P.inherited,m=M.titlePage,h=M.evenAndOddHeaders,true)};if(!(t.sectionIndex!==void 0&&y(t.sectionIndex))){let x;d.forEach((I,M)=>{let P=(t.kind==="header"?I.headers:I.footers).get(t.variant);!P||P.rId!==t.scope.rId||!(x===void 0||x&&!P.inherited||x===P.inherited&&a(M)<c)||(c=a(M),p=P.inherited,m=I.titlePage,h=I.evenAndOddHeaders,x=P.inherited);});}let g=u.sections[c]?.properties??u.sections.at(-1)?.properties,b=g?.margins.headerTwips,S=g?.margins.footerTwips;return {editing:t.kind,sectionIndex:c,variant:t.variant,rId:t.scope.rId,partName:t.partName,...p!==void 0?{inherited:p}:{},...m!==void 0?{titlePage:m}:{},...h!==void 0?{evenAndOddHeaders:h}:{},...b!==void 0?{headerDistanceTwips:b}:{},...S!==void 0?{footerDistanceTwips:S}:{}}},headerFooterStateStable(d){if(!t)return n=null,r="",null;let c=this.headerFooterState();if(!c)return null;let u=[d,c.editing,c.sectionIndex,c.variant??"",c.rId??"",c.partName??"",String(c.inherited),String(c.titlePage),String(c.evenAndOddHeaders),String(c.headerDistanceTwips??""),String(c.footerDistanceTwips??"")].join("|");return n&&r===u||(n=Object.freeze({...c}),r=u),n}}}function zT(e){return e.length>0&&e.every(t=>t.op==="setDocumentProtection")}function Y2(e,t){let n=e.headerFooterResolutionBySection();for(let r=0;r<n.length;r+=1){let o=n[r];for(let a of ["header","footer"]){let i=a==="header"?o.headers:o.footers;for(let[s,l]of i)if(l.rId===t)return {sectionIndex:r,kind:a,variant:s,partName:l.partName}}}return null}function UT(e,t,n){let{sectionIndex:r,sectionStart:o}=e.sectionAtPage(n),a=p=>p[Math.min(r,Math.max(0,p.length-1))],i=p=>{let m=a(p);return t==="header"?m?.headers:m?.footers},s=e.session.headerFooterResolutionBySection(),l=a(s),d=e.layout.pages[n]?.pageFieldSource?.pageNumber??n+1,c=l?.evenAndOddHeaders&&d%2===0?"even":l?.titlePage&&n===o?"first":"default",u=i(s)?.get(c)?.rId;if(!u){if(!e.create({op:"createHeaderFooter",sectionIndex:r,kind:t,variant:c,...c==="first"?{titlePage:true}:{},...c==="even"?{evenAndOddHeaders:true}:{}})?.ok)return;u=i(e.session.headerFooterResolutionBySection())?.get(c)?.rId,e.flushLayout();}u&&e.enter({rId:u,pageIndex:n,sectionIndex:r,kind:t,variant:c});}var Q2=500;function J2(e,t,n,r){let o=e.part(),a=chunk4GBTELJV_cjs.qd(o,n,r),i=chunk4GBTELJV_cjs.Lc(o);return t.map((s,l)=>{let d=s.blockStart<s.blockEndExclusive?a[s.blockEndExclusive-1]:void 0,c=d?.kind==="paragraph"?chunk4GBTELJV_cjs.Mc(d):void 0;return c||(l===t.length-1&&i?.kind!=="textValue"?i:void 0)})}function GT(e,t){if(!e)return null;let n=e.session,r=chunk4GBTELJV_cjs.Ya(e.revisionDisplayMode()),o=e.state().selection.head.paragraphId,a=ks(n,o,e.activeScope().kind==="headerFooter"?{kind:"headerFooter",rId:e.headerFooterState()?.rId??""}:kt(n,o,{kind:"body"}),e.headerFooterState()?.sectionIndex,r,t),i=n.currentPackage(),s=chunkFIJZIQXA_cjs.Tg(i),l=chunkFIJZIQXA_cjs.Ug(s),d=chunkFIJZIQXA_cjs.Vg(s),c=chunk4GBTELJV_cjs.Oc(n.part(),r,t),u=J2(n,c,r,t),p=chunkFIJZIQXA_cjs.Rg(u[a]),m=chunkFIJZIQXA_cjs.Sg(u[a]),h=chunkFIJZIQXA_cjs.Wg(p,l),y=chunkFIJZIQXA_cjs.Xg(m,d);return {sectionIndex:a,footnote:{resolved:h,...l?{documentAuthored:l}:{},...p?{sectionAuthored:p}:{}},endnote:{resolved:y,...d?{documentAuthored:d}:{},...m?{sectionAuthored:m}:{}}}}function XT(e,t){let n=chunkFIJZIQXA_cjs.pc(t);if(!n)return null;let r=chunkFIJZIQXA_cjs.ch(e.currentPackage(),n.noteKind);if(!r)return null;let o=r,a=chunkFIJZIQXA_cjs.Lc(o.root,n.noteId);if(!a)return null;let i=[],s=Q2,l=(c,u)=>{if(!(u>32||s<=0)){if(c.kind==="paragraph"&&typeof c.id=="string"){let p=(chunkFIJZIQXA_cjs.Vi(o,c.id)??"").replace(/\uFFFC/g,"").trim();if(p){let m=p.slice(0,s);i.push(m),s-=m.length;}return}if(c.kind!=="textValue")for(let p of c.children)l(p,u+1);}};l(a,0);let d=i.filter(Boolean).join(" ").trim();return d.length>0?d:null}function YT(e){return [()=>{chunkFIJZIQXA_cjs.zb(e().root);},()=>{chunkFIJZIQXA_cjs.lj(e());},()=>{chunkFIJZIQXA_cjs.Zj(e());}]}var eH=50,tH=16;function QT(e){let t=e.schedule??((s,l)=>{let d=setTimeout(s,l);return ()=>clearTimeout(d)}),n=false,r=null,o=0,a=0,i=s=>{r=t(()=>{if(r=null,!(n||a>=e.steps.length||!e.shouldRun())){if(e.hasPendingInput()){if(o+=1,o>eH)return;i(tH);return}try{e.steps[a]();}catch{return}a+=1,a<e.steps.length&&i(0);}},s);};return i(0),()=>{n=true,r&&r(),r=null;}}var Or=null;function Ps(e,t,n){let r=Or;Or=t===void 0?null:{owner:e,group:t};try{return n()}finally{Or=r;}}function sg(e){if(Or===null||Or.owner!==e)return;let{group:t}=Or;return Or=null,t}function nH(e,t){Or===null&&(Or={owner:e,group:t});}var hc=class{current;get value(){return this.current}around(t,n,r,o=true){let a=this.current,i=sg(t);this.current=i??(o?Symbol("command"):void 0);let s;try{s=n();}finally{this.current=a;}return i!==void 0&&!r(s)&&nH(t,i),s}};function JT(e,t){let n=t.indexOf("#"),r=n>0?t.slice(0,n):e.mainDocumentPart,o=e.parts.get(r);return o?chunkFIJZIQXA_cjs.Ta(o,t):null}function eC(e){let{anchor:t,head:n}=e;return t.paragraphId!==n.paragraphId||t.offset!==n.offset?null:`${n.paragraphId}\0${n.offset}`}var rH=1e3,oH=2e3,yc=class{constructor(t,n=()=>performance.now()){this.currentPackage=t;this.now=n;}currentPackage;now;group;expected=null;startedAt=0;lastTypedAt=0;paragraphId=null;landedNode=null;groupAt(t){let n=this.now();return (this.group===void 0||eC(t)!==this.expected||n-this.lastTypedAt>=rH||n-this.startedAt>=oH||n<this.lastTypedAt)&&(this.group=Symbol("typing"),this.startedAt=n),this.lastTypedAt=n,this.group}landed(t){this.expected=eC(t),this.paragraphId=this.expected===null?null:t.head.paragraphId;let n=this.paragraphId;this.landedNode=n===null?null:JT(this.currentPackage(),n),this.expected===null&&(this.group=void 0);}noteForeignChange(t){let n=this.paragraphId;if(n===null||t.origin===chunkFIJZIQXA_cjs.g.projection||t.origin===chunkFIJZIQXA_cjs.g.awareness)return;if(t.dirty.includes(n)||t.deleted.includes(n))return this.end();if(t.dirty.length>0||t.deleted.length>0)return;let r=this.landedNode,o=JT(this.currentPackage(),n);r!==o&&(r===null||o===null||!chunkFIJZIQXA_cjs.Da(r,o))&&this.end();}end(){this.group=void 0,this.expected=null,this.paragraphId=null,this.landedNode=null;}};function lg(e){return e.bound?"bound":e.effectiveLock==="contentLocked"||e.effectiveLock==="sdtContentLocked"?"locked":null}function tC(e){return e.effectiveLock==="sdtLocked"||e.effectiveLock==="sdtContentLocked"?"locked":null}function nC(e,t){for(let n of e.children)if(n.kind!=="textValue"&&!(n.kind!=="contentControlProperties"&&n.localName!=="sdtPr")){if(n.children.some(r=>r.kind!=="textValue"&&r.localName==="dataBinding")&&t==="edit")return "bound";for(let r of n.children){if(r.kind==="textValue"||r.localName!=="lock")continue;let o=r.attributes.find(a=>a.localName==="val")?.value;if(t==="remove"){if(o==="sdtLocked"||o==="sdtContentLocked")return "locked"}else if(o==="contentLocked"||o==="sdtContentLocked")return "locked"}}return null}function Ka(e,t,n=true){let r=e.createElement("div");return r.className=t,r.contentEditable="false",n&&r.setAttribute("aria-hidden","true"),r.style.position="absolute",r.style.left="0",r.style.top="0",r.style.pointerEvents="none",r}function rC(e,t,n){for(let r of e)r.style.width=t,r.style.height=n;}var oC=64;function dg(e,t,n={}){let r=n,o=Ud(n),a=r.openedSession??chunkSRPILEWV_cjs.j(t,n.reviewModel?{reviewModel:n.reviewModel}:{});if(!a.ok)return {ok:false,reason:a.reason,...a.detail?{detail:a.detail}:{}};let i=cR(a.session,o),s=Ik(i),l=s.index,d=n.collaborationModel?.session,c=n.author,u=n.scale??96/72,p={resolve:n.tableInteractionLabel??(f=>Bp(f))},m="the document is open for viewing",h="the table of contents is generated and read-only",y="\0range\0",g=()=>`${new Date().toISOString().slice(0,19)}Z`,b=n.measurer?null:chunk6APGXLBB_cjs.S(u,{context:Da(e.ownerDocument),...n.fontAlias?{fontAlias:n.fontAlias}:{}}),S=n.measurer??b.measurer,x=chunk4GBTELJV_cjs.Ge(),I=chunk4GBTELJV_cjs.Gf();function M(){return n.measurer?n.producer??"host-measurer":`${n.producer??b?.producer??"fixed-measurer"}@scale:${u}`}let k=M(),P=e.ownerDocument,R=P.createElement("div");R.className="docx-pages",R.style.position="relative",o.listeners(R),R.contentEditable="true",R.spellcheck=false,R.setAttribute("role","textbox"),R.setAttribute("aria-multiline","true"),em(R,n.translate),R.style.outline="none";let w=Ka(P,"docx-selection-overlay"),O=Ka(P,"docx-comment-overlay"),N=Ka(P,"docx-text-highlight-overlay"),A=null,V=Ka(P,"docx-remote-selection-overlay"),W=Ka(P,"docx-table-furniture",false);e.style.position="relative",e.replaceChildren(R,W,O,N,V,w);let E=KP(R,()=>u,()=>{let f=me?.getActive()??null,v=ue?.activeNoteScope()??null,T=ue?.activeNotePageIndex()??null,H=f?xw(R,f.pageIndex):v?ww(R,v.id,T):null;return {layout:Ie(),selection:Ft.shownSelection($),...je.caretPreference(f?.pageIndex??T??void 0),measurer:S,...Se()?{typingStyle:()=>{let K=Xt.formatting();return K.fontSizeHalfPoints?{fontSizePt:K.fontSizeHalfPoints/2,fontFamily:K.fontFamily,bold:K.bold,italic:K.italic,verticalAlign:K.superscript?"superscript":K.subscript?"subscript":"baseline"}:null}}:{},scopedHost:H,...f?{scopedHostKind:"headerFooter"}:v?{scopedHostKind:"note"}:{},...Te?.caretInput(xe)}}),_=sd(i.part()),G=i.paragraphIds(),U=G.find(f=>!_.has(f))??G[0]??"",$=r.initialSelection??{anchor:{paragraphId:U,offset:0},head:{paragraphId:U,offset:0}},pe=r.initialDrawingSelectionIntent??{kind:"none"};function he(f,v){f.kind===pe.kind&&(f.kind!=="pointer"||pe.kind==="pointer"&&f.drawingNodeId===pe.drawingNodeId)||(pe=f,v&&n.onChange?.(dt()));}let Z=null,F=null;function L(f){return F=f,n.onChange?.(dt()),false}let B=new hc,q=new yc(()=>i.currentPackage()),X="suggesting needs an author before it can propose a change",D=false,j=false,z=null,ne=new Map;function re(){z=null;for(let f of ne.values())z=f;}function ee(f,v){if(f.paragraphId===v.paragraphId)return f.offset-v.offset;let T=Ze();return T.indexOf(f.paragraphId)-T.indexOf(v.paragraphId)}function ie(f){if(!z)return;let{from:v,to:T}=kd(Ie(),z),H=f.head;ee(H,v)>=0&&ee(H,T)<=0||(ne.clear(),z=null);}let de=null,Re=new Pd(d??i),Ke=new Sd(d??i,()=>$,()=>Ae(i,$.head.paragraphId)??i.part(),()=>i.packageRevision());function pt(f){let v=null;d&&en.expectHistory(true);let T;try{T=Ke.step(f,()=>{if(d)return d[f]();let K=i.packageRevision();return v=i[f](),i.packageRevision()!==K});}finally{d&&en.expectHistory(false);}if(!T.changed)return;let H=f==="undo"?OP(d,qs):null;kM(H??T.selection??v);}function ot(f){je.noteModelMoved(),Lt();let v=CI(f,Ie(),Ze());ft(v.selection),de=v.format,E.update(),n.onChange?.(dt());}function Le(){return Se()?.properties??null}function Se(){return Up(de,$)}function mt(f){if(!de)return;let v=de.position;f.anchor.paragraphId===v.paragraphId&&f.anchor.offset===v.offset&&f.head.paragraphId===v.paragraphId&&f.head.offset===v.offset||(de=null);}function xt(f,v,T,H,K){let Y=Je([...f],T,H,Ye(),true,K);return f.length===v.length||!Y.rejected?Y:Je([...v],T,H,Ye(),true,K)}function tt(f,v,T,H){let K=Te?.replacementFormatOps(f,v,T);if(K?.length)return K;let Y=Se()??(Nt($.head.paragraphId).length===0?{base:[],properties:La(Ae(i,$.head.paragraphId)??i.part(),$.head.paragraphId,$.head.offset,qt(),gt())}:null);if(!Y||T===0||Y.properties.length===0&&Y.base.length===0)return [];let J=de?.position??$.head,se=H&&J.paragraphId===f&&J.offset>=H.start&&J.offset<=H.end?{paragraphId:f,offset:au({paragraphId:f,offset:H.start},{paragraphId:f,offset:H.end})}:chunk4GBTELJV_cjs.wd(Ie(),J);return se.paragraphId!==f||se.offset!==v?[]:[{op:"setRunProperties",paragraphId:f,start:v,end:v+T,properties:chunkFIJZIQXA_cjs.Mh(Y.base,Y.properties,_s(f,v))}]}let me=null,ue=null,Te=null,Ie=()=>Te?.layout(xe)??xe,At=()=>Te?.active()?Te.paragraphIds():i.paragraphIdsIn(Ye()),zt=null,Ye=()=>ed(me?.getActive()??null,ue?.activeNoteScope()??null),lr=()=>ue?.activeNoteScope()?.id??null,In=f=>{let v=I.multi?.spans,T=0,H=0;if(v&&v.length>0)for(let K=0;K<v.length;K+=1){let Y=v[K];if(T=K,H=Y.startIndex,f<Y.startIndex+Y.pageCount)break}return {sectionIndex:T,sectionStart:H}},Fe=(f,v)=>{if(Te?.active()){let J=Te.paragraphIds();return J.includes(f)?f:J[J.indexOf(v)+1]??null}let T=Ae(i,f)??Ae(i,v)??i.part();if(chunkFIJZIQXA_cjs.Ta(T,f))return f;let H=chunkFIJZIQXA_cjs.Ua(T,v),K=H?H.children.findIndex(J=>J.id===v):-1,Y=H&&K>=0?H.children[K+1]:void 0;return Y?.kind==="paragraph"?Y.id:null},Ze=()=>Ca(Ie(),me?.getActive()??null,lr()),en=EP({textOf:f=>Nt(f),order:Ze,carried:()=>MP(d)}),Ut=()=>globalThis.performance?.now()??Date.now(),ze=0,jn=0,Mr=0,{styleCascade:Rt,numberingIndex:Ar,defaultTabStopPt:dr,compatibilityMode:Xo}=FP(i),Ls=AP({styleCascade:Rt,partOf:f=>Ae(i,f)??i.part()}),so=null,Zn=n.imageDecodePort??$P(P)??qP(),Gt=chunk4GBTELJV_cjs.Me({session:i,decodePort:Zn,onResourcesChanged:()=>so?.()}),Yo=n.drawingStrings??chunkEO4C5QJW_cjs.i,Ns=n.tocLabels,za=()=>$.anchor.paragraphId!==$.head.paragraphId||$.anchor.offset!==$.head.offset?null:{paragraphId:$.head.paragraphId,offset:$.head.offset},cr=pk(i),Ds=VP({mintValidatedBytes:(f,v)=>Gt.mintValidatedBytes(f,v)}),dn=false,zn=sT(n.revisionDisplayMode,!!n.reviewModel,f=>Me.setRevisionDisplayMode(f)),Qo=zn.view,qt=zn.projection,Hs=zn.changeBars,cn=r.revisionAuthorVisibility??zd(n.hiddenRevisionAuthors),Ft=bI({layout:Ie,part:()=>i.partFor(Ye())??i.part(),view:hh}),lo=EI(n.revisionMarkup,()=>zn.filter(cn.filterForSession(i)),()=>rt(),()=>{kn=Mt(gt()),Qe.invalidateAll(i.packageRevision(),"revision-markup"),Qe.flush(),St(false);}),gt=lo.filter,_s=ZI(i,qt,gt),Bs=f=>{let v=Ae(i,f)??i.part();return MI(v,f,qt(),gt())},kn,Ua=chunk4GBTELJV_cjs.$e(i),Fr=chunk4GBTELJV_cjs.af(),Mt=(f,v=dn)=>LP({session:i,measurer:S,producer:k,cache:x,styleCascade:Rt,numberingIndex:Ar,defaultTabStopPt:dr,compatibilityMode:Xo,displayMode:qt(),showFieldCodes:v,revisionAuthorFilter:f,inlineDrawingLayoutForPart:T=>Gt.contextForPart(T),drawingLayoutTokenForPart:T=>Gt.cacheTokenForPart(T),drawingTokenForParagraphForPart:(T,H)=>Gt.drawingTokenForParagraph(H,T),linkProjectors:Ua,projectFieldLink:T=>Fr.project(T)});kn=Mt(gt());let Un={...i,applyTreeOps:(f,v,T,H)=>Je(f,v,T,H),ensureListDefinition:f=>chunkFIJZIQXA_cjs.Hb(d?.identity.actorId,()=>i.ensureListDefinition(f)),applyPmDoc:f=>Ne==="view"?{committed:false,rejected:true,opCount:0,reason:m}:d?{committed:false,rejected:true,opCount:0,reason:"collaboration-pm-doc-unproven"}:eu()?{committed:false,rejected:true,opCount:0,reason:h}:i.applyPmDoc(f)},Jo=()=>{},Gn=Sk({now:Ut,pageAfterView:()=>{let f=Dc();return f&&f.size>0?Math.max(...f)+1:void 0},current:()=>xe,revision:()=>i.packageRevision(),publish:f=>o.wrap(()=>$s(f))(),snapshot:()=>{let f={...I};return ()=>{Object.assign(I,f);}},pendingChanged:f=>e.toggleAttribute("data-docx-layout-pending",f)}),Rn=r.progressiveOpen?oC:null,xe=uo(),Xn=n.revisionStyles,co=Lk(n.showParagraphMarks??false,rt,()=>St(false)),ea=r.reviewAuthorSlots??chunkEO4C5QJW_cjs.e(),Yn=pR({layout:Ie,items:()=>i.reviewItems(),styles:()=>Xn,slots:ea});function Lr(f){Pt(),d?.flushPendingJournals();let v={selection:$,format:de},T=JSON.stringify(Xt.formatting()),H=TI($,de,f,()=>La(i.partFor(Ye())??i.part(),$.head.paragraphId,$.head.offset,qt(),gt()));H!==void 0&&(de=H,T!==JSON.stringify(Xt.formatting())&&Re.record(v,{selection:$,format:de},sg(Me)),q.end(),E.update(),n.onChange?.(dt()));}let Xt=XP({runFormatRefusal:()=>_n({type:"toggleMark"},Me)?.reason??null,session:Un,storyScope:Ye,paragraphOrder:Ze,layout:Ie,selection:()=>Ft.shownSelection($),displayMode:()=>qt(),authorFilter:gt,paragraphMarkVisible:Bs,commit:(f,v,T)=>De(f,v,T),orderedRange:()=>Ft.shownRange(qr()),selectionMark:()=>Xe(),textOf:f=>Nt(f),selectedCells:()=>Z?.cellIds,defaultParagraphStyleId:()=>Rt()?.defaultParagraphStyleId??null,defaultFontFamily:()=>n.defaultFontFamily??null,pendingFormats:()=>Le(),setPendingFormats:Lr}),C=QP({session:Un,storyScope:Ye,layout:Ie,selection:()=>Ft.shownSelection($),displayMode:()=>qt(),authorFilter:gt,paragraphMarkVisible:Bs,commit:(f,v,T)=>De(f,v,T),orderedRange:()=>Ft.shownRange(qr()),selectionMark:()=>Xe(),textOf:f=>Nt(f),paragraphOrder:Ze,selectedCells:()=>Z?.cellIds,armPendingFormats:f=>Lr(f),now:Ut,publish:()=>{C.state().mode!=="off"?R.dataset.formatPainter="":delete R.dataset.formatPainter,n.onChange?.(dt());}}),Q=TT({session:Un,storyScope:Ye,headerFooterSectionIndex:()=>me?.getActive()?.sectionIndex,revisionDisplayMode:qt,revisionAuthorFilter:gt,paragraphOrder:Ze,selectedCells:()=>Z?.cellIds,editingMode:()=>Ne,publishRefusal:L,caretParagraphId:()=>$.anchor.paragraphId===$.head.paragraphId&&$.anchor.offset===$.head.offset?$.head.paragraphId:null,layout:Ie,commit:(f,v,T)=>De(f,v,{rearmPending:Se()??void 0,...T?.keepCellSelection?{keepCellSelection:true}:{}}),orderedStart:()=>ou(),orderedRange:()=>qr(),selectionMark:()=>Xe(),collapsedAt:f=>$e(f),deleteSelectionPlan:()=>pr(),paragraphTextOf:f=>Nt(f),numberingLevelExists:(f,v)=>chunk4GBTELJV_cjs.mc(chunk4GBTELJV_cjs.wc(Ar(),Rt()),f,v)!==null});function te(f,v,T){return Ne!=="suggest"?null:au({paragraphId:f,offset:v},{paragraphId:f,offset:T})}let we=NT({session:Un,layout:Ie,fieldLinkById:f=>Fr.linkById(f),refusesWrite:()=>Br(true)!==null,withMintActor:f=>chunkFIJZIQXA_cjs.Hb(d?.identity.actorId,f),storyScope:Ye,replacementLanding:te,insertionLanding:(f,v)=>chunk4GBTELJV_cjs.wd(Ie(),{paragraphId:f,offset:v}).offset,selection:()=>$,orderedRange:()=>qr(),selectionMark:()=>Xe(),textOf:f=>Nt(f),commit:(f,v)=>De(f,v)}),ke=XR({session:Un,storyScope:Ye,editingMode:()=>Ne,writeRefusal:f=>Br(true,[f]),selection:()=>$,selectionMark:()=>Xe(),commit:(f,v)=>De(f,v)}),Oe=f=>{let v=kt(i,f,{kind:"body"});if(v.kind==="body")return ue?.exitNote(),me?.exitHeaderFooter(),true;if(v.kind==="headerFooter"){let H=me?.activeScope();return H?.kind==="headerFooter"&&H.rId===v.rId?true:(ue?.exitNote(),me?.enterHeaderFooter({rId:v.rId})??false)}let T=Ge(f);return T?ue?.activeNoteScope()?.id===T?true:(me?.exitHeaderFooter(),ue?.enterNote(T)??false):false},Ge=f=>{for(let v of xe.pages)for(let T of [v.footnotes,v.endnotes])if(T){for(let H of T.notes)for(let K of chunk4GBTELJV_cjs.ya(H.fragments))if(K.paragraphId===f)return H.scopeId}return null},oe=DT({pagesLayer:R,container:e,scale:()=>u,layout:Ie,bookmarks:()=>i.bookmarks(),linkById:f=>Fr.linkById(f)??we.linkById(f),drawingLinkById:f=>$T(xe,f),setSelection:f=>ft($e(f)),enterStoryFor:f=>Oe(f),isCollapsedSelection:()=>Ne==="view"||Ot($,$e($.head)),onScrolled:()=>Ws(),...n.onHyperlinkPopover?{onPopover:n.onHyperlinkPopover}:{}}),Ce=GR({pagesLayer:R,equationById:f=>ke.equationById(f),setSelection:f=>ft(f,false,"none"),...n.onEquationPopover?{onPopover:n.onEquationPopover}:{}});R.addEventListener("contextmenu",lh),R.addEventListener("click",dh),R.addEventListener("pointermove",nh),R.addEventListener("pointerleave",oh);let We=Mk(R),_e=null;function Yt(f,v,T,H){return Jo(),Gn.finish(),chunk4GBTELJV_cjs.ff(tn(f,v,T,H))}function*tn(f,v,T,H){let K=T?T.authorFilter:gt(),Y=T?.layoutSession??I,J=T?.furnitureSource??kn;return v&&chunk4GBTELJV_cjs.uc(Y,v),!T&&H===void 0&&(Rn=null),Gt.sync(i),yield*chunk6AWEKBLB_cjs.a({view:i,revision:f,measurer:S,cache:x,session:Y,producer:k,styleCascade:Rt,defaultTabStopPt:dr,numberingIndex:Ar,furniture:J,compatibilityMode:Xo,linkProjectors:Ua,projectFieldLink:se=>Fr.project(se),inlineDrawingLayout:Gt.bodyContext,inlineDrawingLayoutForPart:se=>Gt.contextForPart(se),drawingTokenForParagraph:se=>Gt.drawingTokenForParagraph(se,i.part().name),drawingTokenForParagraphForPart:(se,ye)=>Gt.drawingTokenForParagraph(ye,se),drawingLayoutEpoch:Gt.cacheTokenForPart(i.part().name),drawingLayoutEpochForPart:se=>Gt.cacheTokenForPart(se),displayMode:qt(),showFieldCodes:T?false:dn,fieldResults:o.mode,revisionAuthorFilter:K,bodyBlockLimit:H})}function Nr(){return Yt(i.packageRevision(),void 0,{layoutSession:chunk4GBTELJV_cjs.Gf(),furnitureSource:Mt(void 0,false)})}function uo(){let f=Ut(),v=Yt(i.packageRevision(),void 0,void 0,Rn??void 0);return ze=Ut()-f,v}let nt=null,wt=0,Pn=false,fo=null,Ga=false;function Dr(){if(Ga)return;Ga=true;let f=i.packageRevision();fo=QT({steps:YT(()=>i.part()),shouldRun:()=>Ne!=="view"&&i.editable&&i.packageRevision()===f,hasPendingInput:ta});}function ta(f=true){return ek(e,f)}function na(){if(wt>0){Pn=true,Dr();return}if(!ta()){St(),Dr();return}nt===null&&(nt=setTimeout(o.wrap(()=>{nt=null,Qe.pending()===null&&(St(),Dr());}),0));}let un="",Ve=null,ht=false;function Pt(){if(ht||(Ve!==null&&(clearTimeout(Ve),Ve=null),un.length===0))return;let f=un;un="",ht=true;try{Ps(Me,q.groupAt($),()=>Me.type(f)),q.landed($);}catch(v){throw un=f+un,v}finally{ht=false;}}function po(f){un+=f,Ve===null&&(Ve=setTimeout(o.wrap(()=>{Ve=null,Pt();}),0));}function Hr(f,v,T){Pt();let H=T?.trim()||c?.trim();if(!H)return L("tracked changes need a non-empty author");if(f!=="deletion"&&v.length===0)return L(`${f} requires non-empty text`);if(f!=="deletion"&&/[\r\n\v\f\u2028\u2029]/.test(v))return L(`${f} requires text without a paragraph mark`);let K={author:H,date:g()},Y=qr(),J=Y.from.paragraphId===Y.to.paragraphId&&Y.from.offset===Y.to.offset;if(f!=="insertion"&&J&&!(f==="replacement"&&Z))return L(`${f} needs a non-collapsed selection`);let se=f==="insertion"?{ops:[],collapseTo:chunk4GBTELJV_cjs.wd(Ie(),Y.from)}:pr(H),ye=gh(se.ops,K,mh()),Ee=se.collapseTo;if(f==="insertion"||f==="replacement"){let fe=f==="replacement"?se.replaceAt??se.collapseTo:se.collapseTo;ye.push({op:"insertText",paragraphId:fe.paragraphId,offset:fe.offset,text:v,revision:K}),Ee={paragraphId:fe.paragraphId,offset:fe.offset+v.length};}let ve=false;return De(()=>{let fe=Je(ye,Xe(),fr(Ee));return ve=fe.committed,fe},()=>$e(Ee)),ve}let Qe=chunk6APGXLBB_cjs.da({run:f=>{let v=Ut();Jo(),Gn.abandon();let T=tn(f.revision,f),H=Gn.run(T,f.revision);return ze=Ut()-v,H},currentRevision:()=>i.packageRevision(),schedule:f=>{let v=setTimeout(o.wrap(f),0);return ()=>clearTimeout(v)},publish:f=>$s(f)});function $s(f){Yn.releaseLayout(),xe=f;let v=en.map($);v!==$&&($=v,/* arbi patch: the model moved the caret */je.noteModelMoved(),mo()),na();}let ra=false;so=()=>{Qe.invalidateAll(i.packageRevision(),"drawing-resources"),!ra&&(ra=true,setTimeout(o.wrap(()=>{ra=false,Lt();}),0));};let Xa=i.subscribe(f=>{s.retain(f),f.origin!==chunkFIJZIQXA_cjs.g.mutationRemote&&f.origin!==chunkFIJZIQXA_cjs.g.mutationUndo&&f.origin!==chunkFIJZIQXA_cjs.g.mutationRedo&&Re.noteEdit(),de=null,ht||q.noteForeignChange(f),f.origin===chunkFIJZIQXA_cjs.g.mutationRemote?en.note($,f.dirty,xe.revision===f.fromRevision):en.noteLocal(),Qe.notify(f);}),qs=d?i.collaborationPort(d.documentId):null,Xg=()=>{},Yg=()=>{},Lc=false,Nc=null,Qg=null,KO=d?d.subscribeRemoteSelections(()=>{Lc&&Us();}):()=>{};function Dc(){let f=HP(e,xe,$,u),v=me?.getActive()?.pageIndex??je.selectionPageIndex();return v===void 0||f===void 0||f.has(v)?f:new Set([...f,v])}function Jg(){Pn&&St();}function Lt(){return Qe.pending()?Qe.flush():false}let WO=8;function jO(f){!f&&Qe.pending()!==null&&ze>WO&&ta(false)||(!Lt()||f&&Pn)&&St();}function rt(){Pt(),Lt();}function Hc(){Pt();let f=Lt();return nt!==null||Pn?(St(),Dr(),true):f}let Ya=null;function eh(f){return qw(f,i.part())}function ZO(){for(let f of R.querySelectorAll(".docx-content-control-chrome[data-docx-toc]")){if(f.getAttribute("data-docx-content-control")===Ya){f.dataset.hover="",f.dataset.boundaryVisible="";continue}delete f.dataset.hover,D||delete f.dataset.boundaryVisible;}}function th(f){Ya!==f&&(Ya=f,ZO());}function _c(f){return Vw(i.part(),rh(f),f.target)}function nh(f){let v=_c(f);th(v?eh(v):null);}function rh(f){let v=f.target,T=v?.isConnected?v.closest("[data-paragraph-id]"):void 0;if(T)return T.dataset.paragraphId;let H=R.ownerDocument;return typeof H.elementFromPoint!="function"?void 0:H.elementFromPoint(f.clientX,f.clientY)?.closest("[data-paragraph-id]")?.dataset.paragraphId}function oh(){th(null);}function zO(){let f=_r(),v=chunk4GBTELJV_cjs.mb(i.part()),T=chunkFIJZIQXA_cjs.Rf(i.part()),H=T.map(fe=>{let It=gk(fe,xe,i.part(),S);return It?{...It,empty:v.has(fe.beginParagraphId)}:null}).filter(fe=>fe!==null),K=new Set(H.map(fe=>fe.boundary.id)),Y=new Set(H.filter(fe=>fe.empty).map(fe=>fe.boundary.id));for(let fe of T)fe.contentControlId&&eh(fe)!==fe.contentControlId&&Y.add(fe.contentControlId);let J=f&&!K.has(f.id)?new Set([f.id]):void 0,se=Ya?new Set([Ya]):void 0,ye=new Set(chunk4GBTELJV_cjs.oe(xe).filter(fe=>fe.controlType==="checkbox"&&$c(fe.id)).map(fe=>fe.id)),Ee=H.filter(fe=>fe.additional&&!fe.empty).map(fe=>fe.boundary),ve=ph()!==null;if(!(!D&&!J&&!se&&!ve&&ye.size===0&&Ee.length===0&&K.size===0))return {...ve?{readOnly:true}:{},...D?{showAll:true}:{},...J?{activeIds:J}:{},...se?{hoverIds:se}:{},...ye.size>0?{checkedIds:ye}:{},...Ee.length>0?{additionalBoundaries:Ee}:{},...K.size>0?{tocControlIds:K}:{},...Y.size>0?{suppressedIds:Y}:{}}}let Qa=null;function _r(){let f=Ye();if(f.kind!=="body")return XO(f);if(Qa&&Qa.layout===xe&&Qa.selection===$)return Qa.result;let v=UO();return Qa={layout:xe,selection:$,result:v},v}function UO(){let f=Ak(xe,$,S);return f&&GO(f.id)===i.part().name?f:null}function GO(f){let v=f.indexOf("#");return v===-1?"":f.slice(0,v)}function XO(f){let v=i.partFor(f);return v?chunk4GBTELJV_cjs.df(v,$.head.paragraphId):null}function YO(f){return chunkFIJZIQXA_cjs.Uc(f)}function Qn(f){let v=Ae(i,f),T=chunkFIJZIQXA_cjs.Ta(v??i.part(),f);return !T||!YO(T)?null:T}function ah(f){let v=Qn(f);if(!v)return null;for(let T of v.children)if(T.kind!=="textValue"&&(T.kind==="contentControlProperties"||T.localName==="sdtPr"))for(let H of T.children){if(H.kind==="textValue"||H.localName!=="tabIndex")continue;let K=H.attributes.find(J=>J.localName==="val")?.value;if(K===void 0)return null;let Y=Number(K);return Number.isFinite(Y)?Y:null}return null}function QO(){let f=Ye(),v=f.kind==="body"?null:i.partFor(f),T=f.kind==="notesPart"?new Set(Ze()):void 0;return (v?[...chunk4GBTELJV_cjs.cf(v,T)]:[...chunk4GBTELJV_cjs.oe(xe)]).filter(K=>lg(K)===null).sort((K,Y)=>{let J=ah(K.id),se=ah(Y.id);return J!==null&&se!==null&&J!==se?J-se:J!==null&&se===null?-1:J===null&&se!==null?1:0})}function JO(f){for(let v of f.children)if(v.kind!=="textValue"&&(v.kind==="contentControlContent"||v.localName==="sdtContent"))return v.children;return []}function Bc(f){me?.getActive()||ue?.activeNoteScope()||kt(i,f.paragraphId,{kind:"body"}).kind==="body"&&Me.revealPosition(f);}function eM(f){let v=Qn(f);if(!v)return false;let T=VT(v,{contentChildrenOf:JO,searchRoots:()=>(i.partFor(kt(i,f,Ye()))??i.part()).root.children});if(!T)return false;let H=$;return ft(T,false,"none"),($!==H||Ot($,T))&&Bc($.anchor),true}let ih=f=>dk(Qn(f),()=>i.currentPackage());function $c(f){let v=Qn(f);if(!v)return false;for(let T of v.children)if(T.kind!=="textValue"&&!(T.kind!=="contentControlProperties"&&T.localName!=="sdtPr")){for(let H of T.children)if(H.kind==="contentControlCheckbox")for(let K of H.children){if(K.kind!=="contentControlChecked")continue;let Y=K.attributes.find(J=>J.localName==="val")?.value;return !(Y==="0"||Y==="false"||Y==="off")}}return false}let sh=f=>ck(Qn(f));function Vs(f,v){for(let T of R.querySelectorAll("[data-docx-content-control]"))T.getAttribute("data-docx-content-control")===f&&(v?T.dataset.open="":delete T.dataset.open);}let oa=Tk({document:P,layer:R,find:Qn,layout:Ie,selectDrawing:(f,v)=>Me.selectDrawing(f,v),allowed:f=>!ur.disabledReason(f,"edit"),translate:f=>ni?.(f)??f,replaceImage:(f,v,T,H)=>Me.replaceImage(f,v,T,{expectedPackageRevision:i.packageRevision(),commitGuard:H}),setOpen:Vs,reject:L}),qc=lk({find:Qn,allowed:f=>!ur.disabledReason(f,"edit"),apply:(f,v)=>ur.setValue(f,v),items:ih,date:sh,checked:$c,picture:oa.drawingOf,replaceImage:oa.replace,locale:()=>Zs.get(),layer:R,setOpen:Vs,request:n.onRequestContentControlWidget}),Ks=null,Vc;function Kc(f){Ks===f&&(Ks=null,Vc?.(),Vc=void 0);let v=f.dataset.docxCcId,T=f.contains(P.activeElement);f.remove(),v&&Vs(v,false),T&&R.focus({preventScroll:true});}function Wc(){qc.cancel();let f=Ks;return f&&Kc(f),f}function lh(f){let v=_c(f);tM(v&&ru(v.id)?v.id:null);}let Ja=null;function tM(f){Ja!==f&&(Ja=f,n.onChange?.(dt()));}function dh(f){if(f.button!==0||f.target?.closest("a.docx-hyperlink")||Ne!=="view"&&!Ot($,$e($.head)))return;let v=rh(f);if(!v)return;let T=chunkFIJZIQXA_cjs.Rf(i.part()).find(Y=>Y.resultParagraphIds.includes(v));if(!T||_c(f)?.id!==T.id)return;let K=chunkFIJZIQXA_cjs.wg(i.part(),T,i.documentOutline(),tu(T))[T.resultParagraphIds.indexOf(v)];K&&(f.preventDefault(),oe.goToPosition({paragraphId:K,offset:0}));}let ch={document:P,locale:()=>Zs.get(),translate:f=>ni?.(f)??f,setValue:(f,v)=>ur.setValue(f,v),close:f=>Kc(f)};function nM(f,v){let T=ur.disabledReason(f,"edit");if(T){F=T,n.onChange?.(dt());return}if(oa.cancel(),Wc()?.dataset.docxCcId===f||(v==="picture"&&oa.select(f),qc.open(f,v)))return;if(v==="picture")return oa.pick(f);if(v==="checkbox"){ur.setValue(f,$c(f)?"false":"true");return}let H=chunk4GBTELJV_cjs.oe(xe).find(Y=>Y.id===f)?.alias,K;if(v==="dropdown"||v==="comboBox"||v==="buildingBlockGallery"){let Y=ih(f);if(Y.length===0&&v==="dropdown")return;K=Qk(ch,f,v,Y,H,rm(Qn(f),Y));}else if(v==="date")K=Jk(ch,f,sh(f),H);else return;Ks=K,Yk(K,R,ak(xe,u,f,R,ct?.pageOffsetX)),Vs(f,true),Vc=Ad(K,()=>Kc(K)),v==="date"?Zd(K):(K.querySelector("input")??K.querySelector('[role=option][tabindex="0"]')??K.querySelector("button,[data-docx-part=empty]"))?.focus({preventScroll:true});}let ur={setShowAll(f){D!==f&&(D=f,St());},setFormFill(f){j!==f&&(j=f,n.onChange?.(dt()));},showAll:()=>D,formFill:()=>j,atCaret:()=>_r(),navigate(f){let v=QO();if(v.length===0)return false;let T=_r(),H=T?v.findIndex(Y=>Y.id===T.id):-1;f==="next"?H=H<0?0:(H+1)%v.length:H=H<0?v.length-1:(H-1+v.length)%v.length;let K=v[H];return eM(K.id)},setValue(f,v){let T=ur.disabledReason(f,"edit");if(T)return L(T);let H=fk(Qn(f),()=>i.currentPackage(),f,v);if(!H)return L("unknown-building-block");let K=false;return De(()=>{let Y=Je(H,Xe(),void 0,kt(i,f,Ye()),false);return K=Y.committed,Y}),K},remove(f){let v=f??_r()?.id;if(!v)return L("notFound");let T=ur.disabledReason(v,"remove");if(T)return L(T);let H=false;return De(()=>{let K=Je([{op:"removeContentControl",controlId:v}],Xe(),void 0,kt(i,v,Ye()),false);return H=K.committed,K}),H},disabledReason(f,v){let T=ph();if(T!==null)return T;let H=chunk4GBTELJV_cjs.oe(xe).find(Y=>Y.id===f);if(H)return v==="remove"?tC(H):lg(H);let K=Qn(f);return K?nC(K,v):"notFound"}};function jc(){let f=Uc&&Ne!=="view";R.contentEditable=f?"true":"false",R.setAttribute("aria-readonly",f?"false":"true");}function dt(){return {revision:i.packageRevision(),pageCount:xe.pages.length,selection:$,cellSelection:Z,canUndo:Re.canUndo||(d?.canUndo()??i.canUndo()),canRedo:Re.canRedo||(d?.canRedo()??i.canRedo()),collaborationStatus:d?.status()??"inactive",lastRejection:F,pendingFormat:Le(),contentControls:{showAll:D,formFill:j,activeControlId:_r()?.id??null},contextTocId:Ja,formatPainter:C.state(),perf:{layoutMs:ze,paintMs:jn,selectionMs:Mr,placed:I.stats.placed,total:I.stats.total,reusedPages:I.stats.reusedPages,fullPasses:I.stats.fullPasses,staleDiscards:Qe.staleDiscards,cancelledRuns:Qe.cancelledRuns}}}let Kt,ct,ei=false,ti=null,Zc=null;function rM(f){for(let v of xe.pages){let T=R.children.item(v.index);if(T?.dataset.pageIndex!==String(v.index))continue;let H=f.pageOffsetX.get(v.index)??0;T.style.left=`${(v.box.x+H)*u}px`;}}function St(f=true){nt!==null&&(clearTimeout(nt),nt=null,f=true),Pn=false;let v=je.adoptBeforePaint(),T=Ut();Kt=Dc(),me?.reconcileOccurrence();let H=me?.getActive()??null,K=zO(),Y=chunk4GBTELJV_cjs.mb(i.part());chunkEO4C5QJW_cjs.o(R,xe,{scale:u,readOnlyParagraphIds:sd(i.part()),...Y.size>0?{emptyTocPlaceholderIds:Y}:{},...n.fontAlias?{fontAlias:n.fontAlias}:{},...n.defaultFontFamily?{defaultFontFamily:n.defaultFontFamily}:{},materialize:Kt,ariaHidden:false,drawingStrings:Yo,...n.fieldShading?{fieldShading:n.fieldShading}:{},...Xn!==void 0?{revisionStyles:Xn}:{},revisionMarkup:lo.current(),facingPages:OI(chunkFIJZIQXA_cjs.Tg(i.currentPackage())),shadeFormFields:cr(),showParagraphMarks:co.get(),changeBars:Hs(),changeBarsToggle:!!n.reviewModel,...Ds?{imageUrlPort:Ds}:{},...H?{activeHeaderFooterRId:H.scope.rId,activeHeaderFooterPageIndex:H.pageIndex}:{},...K?{contentControlChrome:K}:{}},Yn.get().value),Te?.syncDom(),bm(R,za(),{domReplaced:true}),kw(e,R,H!=null),Uf(e,Ne),ct=ic(xe,Kt),rM(ct),R.style.width=`${ct.width*u}px`,R.style.height=`${ct.height*u}px`,e.style.width=`${ct.width*u}px`,e.style.height=`${ct.height*u}px`,rC([w,O,N,V,W],`${ct.width*u}px`,`${ct.height*u}px`),fi.update(),jn=Ut()-T,di(),Us(),aa(true),Jc(),Uh(),je.mirrorToDom(),uh(ei),ei=false,(f||v)&&n.onChange?.(dt());}function Ws(){rt();let f=Dc(),v=ic(xe,f);ct&&Bm(f,Kt)&&_P(v,ct)||St(false);}let zc=qT({storyScopeOpen:()=>!!(me?.getActive()||ue?.activeNoteScope()),selection:()=>Ft.shownSelection($),layout:Ie,measurer:()=>S,preferredPageIndex:()=>je.selectionPageIndex(),preferredLineId:()=>je.selectionLineId(),pagesLayer:R,container:e,scroller:()=>$t(e),scale:()=>u,scheduleRematerialize:()=>su()});function uh(f=false,v="caret"){zc.follow(f,v);}let Ne=n.editingMode??"edit",Uc=true,js=Object.freeze({kind:"body"}),fh=0,Zs=Zk(n.locale,Pt),ni=n.translate,yt=null,zs=null,Gc=null;function Je(f,v,T,H=Ye(),K=true,Y){Pt();let J=Br(f.some(oM)||!!Y?.length,f,K);if(J!==null)return {committed:false,rejected:true,opCount:0,reason:J};let se=iM(K&&yt?yt.annotate(f):f),ye=ri(se,v,T,H,Y);return K&&yt?.afterApply(ye.committed),ye.committed&&se.some(hm)&&r.onTrackedChange?.(),ye}function ri(f,v,T,H=Ye(),K){let Y=d?.gateOperations(f,H);if(Y)return {committed:false,rejected:true,opCount:0,reason:Y};fh+=1;let J=B.value;return i.applyTreeOps(f,v,T,H,d?{packageEdits:K,origin:chunkFIJZIQXA_cjs.g.mutationHuman,actorId:d.identity.actorId,operationId:`${d.identity.actorId}:${d.sessionId}:browser:${fh}`,recordsHistory:false,historyGroup:J}:{packageEdits:K,historyGroup:J})}function Br(f,v=[],T=true){if(qn(e))return "An external document refresh is in progress.";let H=zT(v);return Ne==="view"&&!H?m:dn&&f&&T&&!H&&mk(K=>Ae(i,K),$)?Fd:f&&!H&&(T&&eu()||v.some(K=>mM(K)))?h:Ne==="suggest"&&!c?.trim()&&f?X:Ne==="suggest"&&v.some(K=>K.op==="deleteNote")?"suggesting cannot delete a note outright; strike its reference to propose the deletion":null}let ph=vS(()=>Br(true,[],false),()=>i.editable);function oM(f){return f.op!=="acceptRevision"&&f.op!=="rejectRevision"&&f.op!=="acceptAllRevisions"&&f.op!=="rejectAllRevisions"&&f.op!=="setRevisionAttribution"}let aM=f=>chunkFIJZIQXA_cjs.Rj.has(f),mh=()=>lo.current().trackFormatting&&!i.trackingSettings().doNotTrackFormatting;function gh(f,v,T){return f.flatMap(H=>gm(H)?!T&&aM(H.op)?[H]:[H.revision!==void 0?H:{...H,revision:v}]:H.op==="splitParagraphMany"?[{...H,revision:v}]:H.op==="splitParagraph"?[H,{op:"setParagraphMarkRevision",paragraphId:H.paragraphId,kind:"ins",revision:v}]:H.op==="joinParagraphs"?[{op:"proposeParagraphMerge",paragraphId:H.secondId,revision:v}]:[H])}function Xc(){let f=c?.trim();return Ne==="suggest"&&f?f:void 0}function iM(f){let v=Xc();return v===void 0?[...f]:gh(f,{author:v,date:g()},mh())}function hh(){return {displayMode:qt(),authorFilter:gt()}}function yh(f){let v=Ft.removedCaretEdit($.head,f);return v===null?false:(De(()=>Je(v.ops,Xe(),fr(v.caret)),()=>$e(v.caret)),true)}function fr(f){return {paragraphId:f.paragraphId,start:f.offset,end:f.offset}}function De(...f){if(qn(e))return;let v=Vk(e);try{sM(...f);}finally{v();}}function sM(f,v,T={}){Pt(),ht||q.end();let H=Ke.begin();T?.keepCellSelection||(Z=null),de=null,je.noteModelMoved(),wt+=1;let K=false;try{let Y=B.around(Me,f,se=>typeof se=="boolean"?se:se.committed,!T?.automation),J=typeof Y=="boolean"||!Y.rejected?null:Y;if(K=J!==null,J)F=yS(String(J.reason??"rejected"),i.settingsRoot());else {F=null;let se=v?.();se&&(si(),$=se,he({kind:"none"},!1),_e=null,ei=!0);let ye=T?.rearmPending;if(ye&&ye.properties.length>0){let{anchor:Ee,head:ve}=$;Ee.paragraphId===ve.paragraphId&&Ee.offset===ve.offset&&(de={properties:ye.properties,base:ye.base,position:ve});}}H(),mo();}catch(Y){if((wt-=1)===0&&Pn)try{St();}catch{}throw Y}wt-=1,jO(K);}function lM(){if(!Kt)return true;for(let f of [$.anchor,$.head]){let v=chunk4GBTELJV_cjs.ne(Ie(),f);if(v&&!Kt.has(v.pageIndex))return false}return true}function mo(){let f=d;if(!f)return;let v=qs?yR(Z?.text??$,H=>{let K=Ae(i,H)??i.part();return bR(K,H)},Z?"cells":void 0):null,T=v?`${v.anchor.paragraphId}:${v.anchor.offset}|${v.head.paragraphId}:${v.head.offset}|${v.kind??""}`:"";T!==Qg&&(Qg=T,f.setLocalSelection(v));}function ft(f,v=false,T="caret",H){let K=!Ot(f,$);Te?.active()&&(!Te.contains(f.anchor.paragraphId)||!Te.contains(f.head.paragraphId))&&Te.exit(false),K&&un.length>0&&Pt();let Y=yt?.beforeSelect(f);if(Y===null)return;K&&!ht&&(q.end(),Re.endGroup()),f=Y??f,mt(f),ie(f);let J=_r()?.id??null,se=hn(i.part(),$.head)?.id;si(),$=f,Z=null,v||(_e=null),lM()||(je.noteModelMoved(),T==="none"?zc.without(()=>St(false)):St(false)),je.noteSelectionSettled(),je.notePointerCaret(H),je.mirrorToDom(true),uh(true,T),di(),go.clear(),aa();let ye=_r()?.id??null,Ee=hn(i.part(),$.head)?.id;(J!==ye||se!==Ee)&&St(false),mo(),n.onChange?.(dt());}let je=lT({session:i,storyScope:Ye,document:P,pagesLayer:R,selection:()=>$,setSelection:f=>ft(f),adoptSelection:f=>{let v=yt?.beforeSelect(f);v!==null&&(f=v??f,mt(f),ie(f),si(),$=f,_e=null,ei=true,mo());},commit:f=>De(f),applyOps:(f,v,T)=>Je(f,v,void 0,T),hasPendingInput:()=>un.length>0,replacementOffset:(f,v,T)=>au({paragraphId:f,offset:v},{paragraphId:f,offset:T}),render:()=>St(),flushLayout:()=>Lt(),flushToPaint:()=>Hc(),updateCaret:()=>{E.update(),bm(R,za());},textOf:f=>Nt(f),pendingFormatOps:(f,v,T,H)=>tt(f,v,T,H),selectionMark:()=>Xe(),now:Ut,recordSelectionMs:f=>{Mr=f;},isGesturing:()=>pe.kind==="pointer"||(iu?.dragging()??false),selectionLocked:()=>Ne==="view",domSelection:()=>Z?$e(Z.text.anchor):$,holdsCellSelection:()=>Z!==null,replaceSelectionWith:f=>Me.type(f),discardPaint:()=>chunkEO4C5QJW_cjs.m(R)});me=ZT({session:i,layout:Ie,sectionAtPage:In,revisionDisplayMode:qt,revisionAuthorFilter:gt,selection:()=>$,setScopeSelection:f=>{Pt(),si(),mt(f),go.clear(),$=f,Z=null,_e=null,mo();},noteModelMoved:()=>je.noteModelMoved(),render:()=>St(),mirrorToDom:()=>je.mirrorToDom(),notify:()=>n.onChange?.(dt()),materializedPages:()=>Kt,entryRefused:()=>Ne==="view",leaveOtherStories:()=>{ue?.exitNote(),Te?.exit();}}),ue=yT({session:i,exitHeaderFooter:()=>{me?.exitHeaderFooter(),Te?.exit();},applyOps:Je,commit:De,selection:()=>$,selectionMark:()=>Xe(),orderedStart:()=>ou(),deleteSelectionPlan:()=>pr(),undo:()=>Me.undo(),activeScope:()=>{let f=Te?.active();if(f)return f;let v=ue?.activeNoteScope();return v||(me?.activeScope()??{kind:"body"})},setActiveScopeBodyOrHf:f=>me.setActiveScope(f),setSelection:f=>ft(f),noteModelMoved:()=>je.noteModelMoved(),render:()=>{Lt()||St();},revealNote:f=>{Lt();for(let v of xe.pages){let T=[...v.footnotes?.notes??[],...v.endnotes?.notes??[]].find(H=>H.scopeId===f);if(T)return ui(T.box.y,T.box.height,{block:"nearest",offsetPx:48}),v.index}return null},notify:()=>n.onChange?.(dt()),lastRejection:()=>F,setLastRejection:f=>{F=f;}});function bh(f){f&&Pt(),Z=f,f&&(mt(f.text),si(),$=f.text),_e=null,je.noteSelectionSettled(),je.mirrorToDom(),di(),go.clear(),aa(),mo(),n.onChange?.(dt());}let $r=null;function dM(){let v=chunk4GBTELJV_cjs.ne(Ie(),$.head)?.pageIndex??0,T=new Set;for(let H=v-1;H<=v+1;H+=1)H>=0&&H<xe.pages.length&&T.add(H);return T}let vh=new WeakMap;function cM(f){let v=vh.get(f);if(v)return v;let T=new Map;for(let H of f.pages)for(let K of chunk4GBTELJV_cjs.xa(H))T.has(K.paragraphId)||T.set(K.paragraphId,H.index);return vh.set(f,T),T}function uM(){let f=i.revision(),v=Kt??dM();if($r?.layout===xe&&$r.revision===f&&Bm($r.pages,v))return $r.rects;let T=(J,se)=>{if(!v)return true;let ye=cM(xe),Ee=ye.get(J),ve=ye.get(se);if(Ee===void 0||ve===void 0)return true;for(let fe=Math.min(Ee,ve);fe<=Math.max(Ee,ve);fe+=1)if(v.has(fe))return true;return false},H=[];for(let J of li()){if(J.kind==="comment"){if(J.range===null||!T(J.range.start.paragraphId,J.range.end.paragraphId))continue;H.push({key:chunkFIJZIQXA_cjs.xj(J),from:{paragraphId:J.range.start.paragraphId,offset:J.range.start.offset},to:{paragraphId:J.range.end.paragraphId,offset:J.range.end.offset}});continue}let se=chunkFIJZIQXA_cjs.xj(J),ye=J.kind==="revision"?J.ranges:J.range?[J.range]:[];for(let[Ee,ve]of ye.entries())T(ve.start.paragraphId,ve.end.paragraphId)&&H.push({key:ye.length===1?se:`${se}${y}${Ee}`,from:{paragraphId:ve.start.paragraphId,offset:ve.start.offset},to:{paragraphId:ve.end.paragraphId,offset:ve.end.offset}});}let K=chunk4GBTELJV_cjs.we(xe,H,v,S),Y=[];for(let[J,se]of K)for(let ye of se)Y.push({...ye,key:J});return $r={layout:xe,revision:f,pages:v,rects:Y},Y}let go=new Set,oi=null,ai,ii=null,Yc=false,xh=false;function si(){Yc||(ii=null);}function wh(){let f=ii;if(!f||!$)return null;let v=(H,K)=>H.paragraphId===K.paragraphId&&H.offset===K.offset;if(!v($.anchor,f.anchor)||!v($.head,f.head))return null;let T=li().find(H=>chunkFIJZIQXA_cjs.xj(H)===f.key);return !T||T.kind==="custom"&&!T.carded||T.kind==="revision"&&oi!==null&&oi.has(T.revisionKind)&&(T.revisionKind!=="format"||ai===void 0||ai.has(T.formattingKind??""))&&!xh?null:T}function Qc(){let f=wh();if(f)return Sh(f);let v=$?.head;if(!v)return null;let H=chunkFIJZIQXA_cjs.Bj(li(),v,l()).filter(K=>!(K.kind==="comment"&&K.resolved)&&!go.has(chunkFIJZIQXA_cjs.xj(K))&&!(K.kind==="custom"&&!K.carded)&&!(K.kind==="revision"&&oi!==null&&oi.has(K.revisionKind)&&(K.revisionKind!=="format"||ai===void 0||ai.has(K.formattingKind??""))))[0];return H?Sh(H):null}function Sh(f){if(f.kind!=="comment")return f;let v=chunkFIJZIQXA_cjs.Dj(li(),f);return go.has(chunkFIJZIQXA_cjs.xj(v))?null:v}function li(){return cn.filterItems(i.reviewItems())}let Ih=mR({roster:Yn.get,styles:()=>Xn,slots:ea}),kh=Ih.forAuthor,fM=Ih.declaredFor;function pM(f,v,T){let H=f.split(y),K=H[0],Y=v!==null&&K===chunkFIJZIQXA_cjs.xj(v);if(f.startsWith("comment-")){let ve=T.get(K),fe=ve?.kind==="comment"&&ve.resolved;return fe&&!Y?null:Y?`docx-comment-band docx-comment-band--active${fe?" docx-comment-band--resolved-active":""}`:"docx-comment-band"}if(f.startsWith("custom-"))return Y?"docx-comment-band docx-comment-band--active":null;let J=T.get(K);if(!J||J.kind!=="revision")return null;let se=H.length>1?Number(H[1]):0;return `docx-revision-band docx-revision-band--${(ve=>ve==="delete"||ve==="moveFrom"?"delete":ve==="insert"||ve==="moveTo"?"insert":ve==="replace"&&J.replacedRangeCount!==void 0?se<J.replacedRangeCount?"delete":"insert":"other")(J.revisionKind)}${Y?" docx-revision-band--active":""}`}let Rh=null,Ph,Th=null;function aa(f=false){let v=Qc(),T=v?chunkFIJZIQXA_cjs.xj(v):null,H=Yn.get();if(!f&&Rh===xe&&Ph===T&&Th===H.resolved)return;let K=new Map;for(let J of li())K.set(chunkFIJZIQXA_cjs.xj(J),J);let Y=[];for(let J of uM()){let se=pM(J.key,v,K);if(!se)continue;let ye=J.key.split(y)[0],Ee=K.get(ye),ve=Ee?xm(Ee):null,fe=ve===null||ve===""?void 0:H.resolved.get(ve),It=Ee?.kind==="revision"&&v!==null&&ye===chunkFIJZIQXA_cjs.xj(v)?fe?.style?.activeBackground:void 0;Y.push({...J,className:se,...fe?{reviewAuthor:fe}:{},...It!==void 0?{activeBackground:It}:{}});}chunkEO4C5QJW_cjs.p(O,xe,Y,{scale:u,...ct?{pageOffsetX:ct.pageOffsetX}:{}}),Rh=xe,Ph=T,Th=H.resolved;}function di(){yt?.update();let f=Z?chunk6APGXLBB_cjs.ia(xe,Z.cellIds):z?chunk4GBTELJV_cjs.ue(Ie(),z,Ze(),S):PI(Ie(),$,Ze,S);chunkEO4C5QJW_cjs.p(w,xe,f,{scale:u,pageOffsetX:ct?.pageOffsetX,...Z?{}:{className:z?"docx-retained-selection-rect":"docx-selection-mark-rect"}});}function Jc(){A?.({layer:N,layout:xe,revision:i.packageRevision(),scale:u,measurer:S,...Kt?{pages:Kt}:{},...ct?{pageOffsetX:ct.pageOffsetX}:{}});}function Us(){if(!Lc){V.replaceChildren();return}let f=d;if(!f){V.replaceChildren();return}vR(V,xe,f.remoteSelections(),{scale:u,pageOffsetX:ct?.pageOffsetX,...Kt?{pages:Kt}:{},colorForAuthor:kh,declaredColorFor:fM,labelHost:Nc,measurer:S});}function Gs(f){let v=chunkFIJZIQXA_cjs.Rf(i.part());if(f)return v.find(K=>K.id===f)??null;let T=Ja?v.find(K=>K.id===Ja):void 0;if(T)return T;let H=$.head.paragraphId;return v.find(K=>K.beginParagraphId===H||K.endParagraphId===H||K.resultParagraphIds.includes(H))??(v.length===1?v[0]:null)}function eu(){return _w(i.part(),$)}function mM(f){return Bw(i.part(),f)}function Ch(){return new Set(chunkFIJZIQXA_cjs.Rf(i.part()).flatMap(f=>[f.beginParagraphId,...f.resultParagraphIds,f.endParagraphId]))}function tu(f){return new Set([f.beginParagraphId,f.endParagraphId,...f.resultParagraphIds])}function gM(f){let v=0;for(let T of xe.pages)for(let H of chunk4GBTELJV_cjs.xa(T))f.has(H.paragraphId)&&(v+=H.lines.length);return v}function nu(f,v){let T=new Set(v),H=new Map;for(let K of f.pages)for(let Y of chunk4GBTELJV_cjs.xa(K)){if(!T.has(Y.paragraphId)||H.has(Y.paragraphId))continue;let J=K.pageFieldSource;H.set(Y.paragraphId,chunk4GBTELJV_cjs.ec(J?.pageNumber??K.index+1,J?.format));}return H}function ru(f){if(Ne==="view"||!i.editable)return false;let v=Gs(f);return !v||!chunkFIJZIQXA_cjs.Tf(i.part(),i.documentOutline(),v.instruction)?false:chunkFIJZIQXA_cjs.Wk(i.part(),{op:"rewriteTocPageNumbers",tocId:v.id,updates:[]})===null}function Eh(f,v){if(!Number.isInteger(f)||!Number.isInteger(v)||f<1||v<1)return null;let T=Q.sectionPropertiesAt($.head.paragraphId),H=T.pageSize.widthTwips-T.margins.leftTwips-T.margins.rightTwips-T.margins.gutterTwips,K=Math.max(300,Math.floor(H/v));return {op:"insertTable",beforeParagraphId:$.head.paragraphId,rows:f,cols:v,columnWidthTwips:K}}function Oh(f,v){if(Te?.active()||Ne==="view"||!i.editable)return false;let T=Eh(f,v),H=i.partFor(Ye())??i.part();return T!==null&&chunkFIJZIQXA_cjs.Wk(H,T)===null}function hM(f,v){if(!Oh(f,v))return false;let T=Eh(f,v);if(!T)return false;let H=null,K=i.subscribe(J=>{J.caret&&(H=J.caret);}),Y=false;try{De(()=>{let J=Je([T],Xe());return J.committed||(F=J.reason??"the table could not be inserted here"),Y=J.committed,J},()=>{let J=H;return J?$e({paragraphId:J.paragraphId,offset:J.start}):null});}finally{K();}return Y}let Mh='TOC \\o "1-3" \\h';function Ah(){let f=chunkFIJZIQXA_cjs.Pf(Mh);if(!f)return null;let v=i.documentOutline(),T=chunkFIJZIQXA_cjs.ug(i.part(),v,f,nu(Me.layout(),v.map(H=>H.blockId)),Ch(),d?.identity.actorId);return {op:"insertToc",beforeParagraphId:$.head.paragraphId,instruction:Mh,alias:Ns?.title??"TOC",entries:T.entries,bookmarksToCreate:T.bookmarksToCreate}}function Fh(){if(Ne==="view"||!i.editable||eu())return false;let f=Ah();return f!==null&&chunkFIJZIQXA_cjs.Wk(i.part(),f)===null}function yM(){if(!Fh())return false;let f=Ah();if(!f)return false;let v=new Set(chunkFIJZIQXA_cjs.Rf(i.part()).map(K=>K.id)),T=ri([f],void 0,void 0,js);if(!T.committed)return F=T.reason??"the table of contents could not be inserted",false;let H=chunkFIJZIQXA_cjs.Rf(i.part()).find(K=>!v.has(K.id));return H?Lh(H.id,"pageNumbers"):true}function Lh(f,v="entire"){let T=Gs(f);if(!T||!ru(T.id))return false;let H=Me.layout(),K=i.documentOutline(),Y=chunkFIJZIQXA_cjs.Tf(i.part(),K,T.instruction);if(!Y)return false;let J=Y.map(ye=>ye.blockId);if(v==="entire"){let ye=chunkFIJZIQXA_cjs.ug(i.part(),K,T.instruction,nu(H,J),tu(T),d?.identity.actorId),Ee=ri([{op:"replaceTocResult",tocId:T.id,entries:ye.entries,bookmarksToCreate:ye.bookmarksToCreate}],void 0,void 0,js);if(!Ee.committed)return F=Ee.reason??"the table of contents could not be refreshed",false;if(H=Me.layout(),T=Gs(T.id),!T)return true}let se="";for(let ye=0;ye<3;ye+=1){let Ee=nu(H,J),ve=chunkFIJZIQXA_cjs.wg(i.part(),T,K,tu(T)),fe=T.resultParagraphIds.flatMap((Dt,Ys)=>{let Qs=ve[Ys],pi=Qs?Ee.get(Qs):void 0;return pi===void 0?[]:[{paragraphId:Dt,pageNumberText:pi}]});if(fe.length===0)break;let It=fe.map(Dt=>`${Dt.paragraphId}\0${Dt.pageNumberText}`).join("");if(It===se)break;se=It;let Vr=ri([{op:"rewriteTocPageNumbers",tocId:T.id,updates:fe}],void 0,void 0,js);if(!Vr.committed){if(Vr.rejected)return F=Vr.reason??"the table of contents page numbers were refused",false;break}H=Me.layout(),T=Gs(T.id)??T;}return true}function bM(){return iR({session:i,editingMode:Ne,collaborationActive:d!==void 0,reviewerFilterActive:cn.filterForSession(i)!==void 0,layout:Me.layout(),canonicalUnfilteredLayout:Nr,styleCascade:Rt(),numberingIndex:Ar(),displayMode:qt()})}let{selectionMark:Xe,orderedRange:qr,orderedStart:ou,textOf:Nt,inlineControlBeside:Nh,splitEndsTheParagraph:vM,deleteSelectionPlan:pr,deleteSelectionOps:xM,replacementOffset:au}=PP({session:i,layout:Ie,selection:()=>$,cellSelection:()=>Z,editingMode:()=>Ne,author:()=>c,trackedDate:g,storyScope:Ye,paragraphOrder:Ze,flushPendingInputAndLayout:rt,trackedAuthorOrNone:Xc,atParagraphEnd:(f,v)=>Ls.atParagraphEnd(f,v),revisionView:hh}),{insertPlainText:Dh,copyFlavoursNow:wM,pasteRichNow:SM,armForcePlainPaste:IM}=RP({session:i,textFormFieldId:()=>yt?.fieldId()??null,richPasteAllowed:()=>!Te?.active(),paragraphIds:At,layout:Ie,cellSelection:()=>Z,editingMode:()=>Ne,storyScope:Ye,paragraphOrder:Ze,actorId:()=>d?.identity.actorId,collaborationGate:(f,v)=>d?.gateOperations(f,v)??null,now:Ut,flushPendingInputAndLayout:rt,orderedRange:qr,selectionMark:Xe,deleteSelectionPlan:pr,consumePendingFormatOps:tt,withoutPendingOnRejection:xt,caretMark:fr,commit:De});function ci(f){f&&(zt=null,rt(),kn=Mt(gt()),Qe.invalidateAll(i.packageRevision(),"tracked-change-filter"),Qe.flush(),n.onChange?.(dt()));}let ia=false,Me={session:i,applyGatedTreeOps:(f,v,T,H)=>ri(f,v,T,H??Ye()),storyScope:Ye,imageDecodePort:()=>Zn,layout:()=>(rt(),xe),state:dt,currentPage:(f="caret")=>{if(rt(),f==="viewport"){let T=DP(e,xe,u);if(T!==null)return T}let v=chunk4GBTELJV_cjs.ne(Ie(),$.head);return v?v.pageIndex+1:1},setScale(f){if(!(f>0)||!Number.isFinite(f))return false;if(f===u)return true;let v={scale:u,defaults:b,measurer:S,producer:k,furnitureSource:kn};try{let T=$t(e),H=T?{x:(T.scrollLeft-e.offsetLeft+T.clientWidth/2)/u,y:(T.scrollTop-e.offsetTop+T.clientHeight/2)/u}:null;if(u=f,n.measurer||(b=chunk6APGXLBB_cjs.S(u,{context:Da(e.ownerDocument),...n.fontAlias?{fontAlias:n.fontAlias}:{}}),S=b.measurer),k=M(),kn=Mt(gt()),Kt=void 0,ct=void 0,$r=null,Qe.invalidateAll(i.packageRevision(),"zoom"),Qe.flush(),Jg(),T&&H){let K=Math.max(0,H.x*u+e.offsetLeft-T.clientWidth/2),Y=Math.max(0,H.y*u+e.offsetTop-T.clientHeight/2),J=Number.isFinite(T.scrollWidth)?Math.max(0,T.scrollWidth-T.clientWidth):null,se=Number.isFinite(T.scrollHeight)?Math.max(0,T.scrollHeight-T.clientHeight):null;T.scrollLeft=J===null?K:Math.min(K,J),T.scrollTop=se===null?Y:Math.min(Y,se),Ws();}return !0}catch{(({scale:u,defaults:b,measurer:S,producer:k,furnitureSource:kn}=v)),Kt=void 0,ct=void 0,$r=null;try{Qe.invalidateAll(i.packageRevision(),"zoom-rollback"),Qe.flush();}catch{}return false}},enqueueType:po,flushPendingInput:rt,type(f){let v=pr(),T=v.replaceAt??v.collapseTo,H=tt(T.paragraphId,T.offset,f.length),K=v.ops.length===0?Ek(_r()):void 0,Y=[...v.ops,Ok(T,f,K)],J=Ck(Ae(i,T.paragraphId)??i.part(),T.paragraphId,T.offset,f.length),se={paragraphId:T.paragraphId,start:J,end:J};De(()=>xt([...Y,...H],Y,Xe(),se),()=>$e({paragraphId:T.paragraphId,offset:J}));},proposeTextChange:(f,v,T)=>Hr(f,v,T),insertPlainText:f=>Dh(f),deleteBackward(){if(yt?.selectForDeletion("backward"))return;let f=pr();if(f.ops.length>0){De(()=>Je(f.ops,Xe(),fr(f.collapseTo)),()=>$e(f.collapseTo));return}if(yh("backward"))return;let v=Se()??void 0,T=Ft.shown($.head);if(T.offset===0){for(let Ee of chunk4GBTELJV_cjs.Oa(Ie(),T.paragraphId)){let ve=Nt(Ee);if(ve.length!==0){De(()=>Je([{op:"deleteText",paragraphId:Ee,start:ve.length-1,end:ve.length}],Xe(),fr({paragraphId:Ee,offset:ve.length-1})),()=>$e({paragraphId:Ee,offset:ve.length-1}),{rearmPending:v});return}}let K=Ze(),Y=K.indexOf(T.paragraphId),J=K[Y-1];if(!J)return;let se=Ft.joinOps(J,T.paragraphId);if(!se){ft($e({paragraphId:J,offset:Nt(J).length}));return}let ye=Nt(J).length;De(()=>Je(se,Xe(),fr({paragraphId:J,offset:ye})),()=>$e({paragraphId:J,offset:ye}),{rearmPending:v});return}let H=Nh(T,"before");if(H){De(()=>Je([{op:"removeContentControl",controlId:H.controlId,keepContent:false}],Xe(),fr({paragraphId:T.paragraphId,offset:H.start})),()=>$e({paragraphId:T.paragraphId,offset:H.start}),{rearmPending:v});return}De(()=>Je([{op:"deleteText",paragraphId:T.paragraphId,start:T.offset-1,end:T.offset}],Xe(),fr({...T,offset:T.offset-1})),()=>$e({...T,offset:T.offset-1}),{rearmPending:v});},splitParagraph(){let f=pr(),v=f.replaceAt??f.collapseTo,T=Se()??{properties:La(Ae(i,v.paragraphId)??i.part(),v.paragraphId,v.offset,qt(),gt()),base:[]},H=vM(v),K=H?Ls.followerStyleId(v.paragraphId):void 0,Y=chunkFIJZIQXA_cjs.Mh(T.base,T.properties,_s(v.paragraphId,v.offset)),J=H&&Ne==="edit"&&Y.length>0?[{op:"setParagraphMarkProperties",paragraphId:v.paragraphId,properties:Y}]:[],se={op:"splitParagraph",paragraphId:v.paragraphId,offset:v.offset,tailStyleId:K},ye=Xc(),Ee=ye?{author:ye,date:g()}:void 0,ve=i.documentStyles(),fe=Md(ve),It=fe??"ListParagraph",Vr=new Set(ve.map(mr=>mr.styleId));for(let mr=1;!fe&&Vr.has(It);mr++)It=`ListParagraph${mr}`;let Dt=Ne!=="view"&&f.ops.every(mr=>mr.op==="deleteText"&&mr.paragraphId===v.paragraphId)&&K===void 0?JI(Ae(i,v.paragraphId)??i.part(),xe,v,Y,It,Rt(),Ee,d?.identity.actorId):null,Ys=Ee?[{op:"setParagraphMarkRevision",paragraphId:v.paragraphId,kind:"ins",revision:Ee}]:[],Qs=Dt?[Dt,...J,...Ys]:[se],pi=Dt?new Set(At()):null;qk(i,v.paragraphId,mr=>De(()=>xt([...f.ops,...J,...Qs],[...f.ops,...Dt?[Dt,...Ys]:[se]],Xe(),void 0,Dt&&!fe?[ok(Rt()?.defaultParagraphStyleId??null,It)]:void 0),()=>{if(!pi)return mr();let Gh=At().filter(EM=>!pi.has(EM)),Xh=Dt?Gh.at(-1):Gh[0];return Xh?$e({paragraphId:Xh,offset:0}):null},{rearmPending:T}),Fe);},navigate(f,v=false){if(rt(),!v&&(f==="left"||f==="right")&&($.anchor.paragraphId!==$.head.paragraphId||$.anchor.offset!==$.head.offset)){let ve=qr();_e=null;let fe=Fk(Ie(),ve,Ze(),f,S);ft($e(fe),true);return}let T=Gf(Ie(),Ft.shown($.head),f,_e,me?.getActive()??null,lr(),S,je.selectionLineId());if(!T)return;let H=Ch(),K=$w(i.part(),T.position,["left","wordLeft","lineStart","up","pageUp"].includes(f));if(K&&(T={...T,position:K,caret:void 0}),hn(i.part(),T.position)){if(v)return;let fe=new Set(["left","wordLeft","lineStart","up","pageUp"]).has(f)?"up":"down",It=gM(H)+4;for(let Vr=0;Vr<It;Vr+=1){let Dt=Gf(Ie(),T.position,fe,T.desiredX,me?.getActive()??null,lr(),S);if(!Dt||Dt.position.paragraphId===T.position.paragraphId&&Dt.position.offset===T.position.offset)return;if(T=Dt,!hn(i.part(),T.position))break}if(hn(i.part(),T.position))return}_e=T.desiredX,ue?.activeNoteScope()&&T.pageIndex!==void 0&&Number.isInteger(T.pageIndex)&&ue.setActiveNotePageIndex(T.pageIndex);let J={anchor:v?Ft.shown($.anchor):T.position,head:T.position},se=v?J:cc(xe,J),ye=!v&&!Ot(se,J),Ee=$;ft(se,true,ye?"none":"head",ye?void 0:T.caret),ye&&($!==Ee||Ot($,se))&&Bc($.anchor);},deleteWordBackward(){if(Me.deleteSelection())return;let f=$.head,v=(yt?.wordDeletionBoundary??chunk4GBTELJV_cjs.he)(Nt(f.paragraphId),f.offset,-1,chunk4GBTELJV_cjs.qe(Ie(),f.paragraphId));if(v===f.offset){Me.deleteBackward();return}De(()=>Je([{op:"deleteText",paragraphId:f.paragraphId,start:v,end:f.offset}],Xe()),()=>$e({...f,offset:v}),{rearmPending:Se()??void 0});},deleteWordForward(){if(Me.deleteSelection())return;let f=$.head,v=(yt?.wordDeletionBoundary??chunk4GBTELJV_cjs.he)(Nt(f.paragraphId),f.offset,1,chunk4GBTELJV_cjs.qe(Ie(),f.paragraphId));if(v===f.offset){Me.deleteForward();return}De(()=>Je([{op:"deleteText",paragraphId:f.paragraphId,start:f.offset,end:v}],Xe()),void 0,{rearmPending:Se()??void 0});},deleteForward(){if(yt?.selectForDeletion("forward")||Me.deleteSelection()||yh("forward"))return;let f=Se()??void 0,v=Ft.shown($.head),T=Nt(v.paragraphId);if(v.offset<T.length){let Y=Nh(v,"after");if(Y){De(()=>Je([{op:"removeContentControl",controlId:Y.controlId,keepContent:false}],Xe()),()=>$e(v),{rearmPending:f});return}De(()=>Je([{op:"deleteText",paragraphId:v.paragraphId,start:v.offset,end:v.offset+1}],Xe()),void 0,{rearmPending:f});return}let H=Ze(),K=H[H.indexOf(v.paragraphId)+1];if(K){if(chunk4GBTELJV_cjs.Oa(Ie(),K).includes(v.paragraphId)){if(Nt(K).length===0)return;De(()=>Je([{op:"deleteText",paragraphId:K,start:0,end:1}],Xe()),()=>$e(v),{rearmPending:f});return}De(()=>Je(Ft.forwardJoinOps(v.paragraphId,K)??[{op:"joinParagraphs",firstId:v.paragraphId,secondId:K}],Xe()),()=>$e(v),{rearmPending:f});}},...Q,...Xt,setSelection:f=>{Ot(f,$)||he({kind:"programmatic"},false),en.discard(),ft(f);},selectDrawing(f,v){Lt();let T=Na(xe,f,v);if(!T)return false;let H=$e(T);return he({kind:"pointer",drawingNodeId:f},Ot(H,$)),ft(H,true,"none"),Bn(Me)?.drawingNodeId===f},revealPage(f,v){Lt();let T=xe.pages.find(H=>H.index===f);return T?ui(T.box.y,T.box.height,v):false},revealParagraph(f,v){Lt();let T=chunk4GBTELJV_cjs.ne(Ie(),{paragraphId:f,offset:0});if(!T)return false;let H=xe.pages.find(K=>K.index===T.pageIndex);return H?ui(H.contentBox.y+T.y,T.height,v):false},revealPosition(f,v){Lt();let T=chunk4GBTELJV_cjs.ne(Ie(),f);if(!T)return false;let H=xe.pages.find(K=>K.index===T.pageIndex);return H?ui(H.contentBox.y+T.y,T.height,{block:"nearest",...v}):false},setEditable(f){Uc=f,f||Te?.exit(),jc();},selectAll(){let f=Ze(),v=f[0],T=f[f.length-1];!v||!T||ft({anchor:{paragraphId:v,offset:0},head:{paragraphId:T,offset:Nt(T).length}});},hyperlinks:we,equations:ke,contentControls:ur,formatPainter:C,canInsertTable:Oh,insertTable:hM,canInsertToc:Fh,insertToc:yM,canRefreshToc:ru,canEditTextFormField:()=>yt?.canEdit()??false,editTextFormField:()=>yt?.edit()??false,refreshToc:Lh,refreshRefFieldResults:bM,save:()=>Wk(Me,e,()=>ia),isInsideToc:f=>chunkFIJZIQXA_cjs.Rf(i.part()).some(v=>v.beginParagraphId===f||v.endParagraphId===f||v.resultParagraphIds.includes(f)),retainSelection:()=>{let f=Symbol("selection-pin");return ne.set(f,$),z=$,di(),f},releaseSelection:f=>{ne.delete(f)&&(re(),di());},retainedSelection:()=>z,publishedLayout:()=>xe,drawingSelectionIntent:()=>pe,overlayCoordinates:()=>Object.freeze({paintScale:u,pageOffsetX:ct?.pageOffsetX??new Map}),commitReviewOps:(f,v)=>{rt();let T=$.head.paragraphId,H=Nt(T);return De(()=>{if(Ne==="view")return {committed:false,rejected:true,opCount:0,reason:m};if(d&&(v===void 0||!tk.has(v)))return {committed:false,rejected:true,opCount:0,reason:"experimental-collaboration-body-text-only"};if(d){let Y=d.gateOperations([],Ye());if(Y)return {committed:false,rejected:true,opCount:0,reason:Y}}let K=chunkFIJZIQXA_cjs.Hb(d?.identity.actorId,f);return {committed:K.committed,rejected:!K.committed,opCount:0,...typeof K.reason=="string"?{reason:K.reason}:{}}},()=>{Lt(),je.noteModelMoved();let K=Ze();if(K.length===0)return null;let Y=_m($,T,H,Nt(T));return eo(Ie(),K,Y)})},revisionDisplayMode:Qo,replacementLanding:te,applyAutomationOps:(f,v,T,H=false)=>{let K={committed:false,rejected:false,opCount:0},Y=v??js;return De(()=>{let J=Br(false);if(J!==null)return K={committed:false,rejected:true,opCount:0,reason:J};let se=null,ye=f(Ee=>{let ve=Br(true,[],false);return ve===null?chunkFIJZIQXA_cjs.Hb(d?.identity.actorId,()=>i.ensureHyperlinkRelationship(Ee,Y)):(se=ve,null)});return ye===null?K={committed:false,rejected:true,opCount:0,reason:se??"this engine will not author that hyperlink target"}:!n.reviewModel&&(H||ye.some(hm))?K={committed:false,rejected:true,opCount:0,reason:"review-module-required"}:K=Je(ye,void 0,void 0,Y,false,T)},()=>{Lt(),je.noteModelMoved();let J=Ze();return J.length===0?null:eo(Ie(),J,$)},{automation:true}),K},editingMode:()=>Ne,author:()=>c,setAuthor:f=>{c!==f&&(Pt(),c=f,f?.trim()&&rR(F)&&(F=null,n.onChange?.(dt())));},setDrawingStrings:f=>{Yo!==f&&chunkEO4C5QJW_cjs.h(Yo)!==chunkEO4C5QJW_cjs.h(f)&&(Yo=f,rt(),St(false));},setLocale:Zs.set,setTranslate:f=>{ni!==f&&(ni=f,em(R,f),yt?.update());},setTocLabels:f=>{Ns=f;},setEditingMode:f=>{rt();let v=Ne!==f;Ne=f,v&&f!=="edit"&&Te?.exit(),v&&f==="view"&&me?.exitHeaderFooter(),v&&f==="view"&&ue?.exitNote(),v&&f==="view"&&C.disarm(),Wc(),jc(),Uf(e,Ne),v&&St(false),F=null,n.onChange?.(dt());},revisionAuthors:()=>Yn.get().value,setRevisionDisplayMode(f){ia||f===zn.view()||(rt(),zn.set(f),ci(true));},hiddenRevisionAuthors:()=>cn.hiddenAuthors,setRevisionAuthorVisible(f,v){ci(cn.setVisible(f,v));},setAllRevisionAuthorsVisible(f){ci(cn.setAllVisible(Yn.get().value.keys(),f));},showAllRevisionAuthors(){ci(cn.showAll());},setTrackedChangesFilter(f,v){ci(cn.setPredicate(f,v));},collaborationSession:()=>d??null,remotePresenceColor:kh,setShowParagraphMarks:co.set,setRevisionMarkup:lo.set,setRevisionStyles:f=>{f!==Xn&&(Xn=f,rt(),St(false));},setHighlightPainter(f){A=f,f||N.replaceChildren(),Jc();},repaintHighlights:Jc,setRemoteCaretLabelHost:f=>{f!==Nc&&(Nc=f,Us());},setReviewActivationExclusions(f,v){ai=v?.formattingKinds?new Set(v.formattingKinds):void 0,oi=f===null?null:new Set(f),aa(),n.onChange?.(dt());},activeReviewKey:()=>{let f=Qc();return f?chunkFIJZIQXA_cjs.xj(f):null},activateReview:(f,v,T)=>{if(go.clear(),xh=T?.allowExcluded??false,ii=v?{key:f,anchor:v.anchor,head:v.head}:{key:f,anchor:$.anchor,head:$.head},v){Yc=true;try{ft(v);}finally{Yc=false;}return}aa(),n.onChange?.(dt());},activatedReviewKey:()=>wh()===null?null:ii?.key??null,dismissActiveReview:()=>{let f=Qc();f&&(go.add(chunkFIJZIQXA_cjs.xj(f)),ii=null,aa(),n.onChange?.(dt()));},navigation:oe,bookmarks:()=>i.bookmarks(),selectedText(){if(Z)return chunk6APGXLBB_cjs.ja(xe,Z);let{from:f,to:v}=qr();return Rd(Ie(),f,v,Ze())},copyFlavours:()=>wM(),pasteRich:(f,v)=>SM(f,v),armForcePlainPaste:IM,deleteSelection(){let f=pr();return f.ops.length===0?false:(De(()=>Je(f.ops,Xe(),fr(f.collapseTo)),()=>$e(f.collapseTo)),true)},setCellSelection:bh,layoutSession:()=>I,undo:()=>{if(Ne==="view"||qn(e)){F=m,n.onChange?.(dt());return}Pt(),q.end(),d?.flushPendingJournals(),Re.step("undo",ot,()=>pt("undo"));},redo:()=>{if(Ne==="view"||qn(e)){F=m,n.onChange?.(dt());return}Pt(),q.end(),d?.flushPendingJournals(),Re.step("redo",ot,()=>pt("redo"));},sectionAtPage:In,activeScope:()=>{let f=Te?.active();if(f)return f;let v=ue?.activeNoteScope();return v||me.activeScope()},setActiveScope:f=>(rt(),f.kind==="frame"?Te.enter(f):f.kind!=="body"&&f.kind!=="headerFooter"&&f.kind!=="note"?false:(Te?.exit(),f.kind==="note"?ue.enterNote(f.id):(ue?.exitNote(),me.setActiveScope(f)))),insertNote:f=>(rt(),ue.insertNote(f)),deleteNote:(f,v)=>ue.deleteNote(f,v),convertNote:(f,v)=>ue.convertNote(f,v),convertAllNotes:f=>ue.convertAllNotes(f),setNoteProperties:f=>ue.setNoteProperties(f),enterNote:(f,v)=>(rt(),ue.enterNote(f,v)),exitNote:()=>(rt(),ue.exitNote()),notePropertiesState:()=>{let f=Me.state().selection.head.paragraphId,v=i.packageRevision(),T=i.currentPackage(),H=i.part(),K=chunkFIJZIQXA_cjs.Tg(T),Y=chunkFIJZIQXA_cjs.ch(T,"footnote"),J=chunkFIJZIQXA_cjs.ch(T,"endnote"),se=Me.activeScope().kind==="headerFooter",ye=Me.headerFooterState(),Ee=ye?.rId??null,ve=ye?.sectionIndex??null,fe=zt;if(fe&&fe.packageRevision===v&&fe.paragraphId===f&&fe.bodyPart===H&&fe.settingsPart===K&&fe.footnotesPart===Y&&fe.endnotesPart===J&&fe.headerFooterOpen===se&&fe.headerFooterRId===Ee&&fe.headerFooterSectionIndex===ve)return fe.result;let It=GT(Me,gt());return zt={packageRevision:v,paragraphId:f,bodyPart:H,settingsPart:K,footnotesPart:Y,endnotesPart:J,headerFooterOpen:se,headerFooterRId:Ee,headerFooterSectionIndex:ve,result:It},It},notePreviewText:f=>XT(i,f),applyTableCommandPlan(f){if(!f.ok)return {ok:false,code:f.code,reason:f.reason};let v=null,T=i.subscribe(H=>{H.caret&&(v=H.caret);});try{let H=Xe(),K=f.selection.kind==="adoptCommittedCaret";De(()=>Je(f.ops,H),K?()=>{let Y=v;return Y?$e({paragraphId:Y.paragraphId,offset:Y.start}):null}:void 0,f.selection.kind==="preserveSelection"?{keepCellSelection:!0}:void 0);}finally{T();}return F?{ok:false,code:"invalidArgs",reason:F}:{ok:true,changed:true}},enterHeaderFooter:f=>{rt();let v=me.enterHeaderFooter(f);if(!v)return v;let T=me.getActive(),H=T?xe.pages[T.pageIndex]:void 0;if(T&&H){let K=T.kind==="header"?H.header:H.footer,Y=K?.box.y??(T.kind==="header"?H.box.y:H.box.y+H.box.height-1),J=K?.box.height??1;ui(Y,J,{block:"nearest"});}return v},exitHeaderFooter:()=>(rt(),me.exitHeaderFooter()),headerFooterState:()=>me.headerFooterStateStable(i.packageRevision()),...KT({applyOps:Je,commit:De,deleteSelectionOps:xM,deleteSelectionPlan:()=>pr(),orderedStart:ou,selectionMark:Xe,collapsedAt:$e,isHeaderFooterOpen:()=>me?.getActive()!==null,lastRejection:()=>F}),...jT({session:i,applyOps:Je,commit:De,storyScope:Ye,selectionMark:Xe,editingMode:()=>Ne,author:()=>c,trackedDate:g,decodePort:()=>Zn,actorId:()=>d?.identity.actorId}),focus:()=>{P.activeElement!==R&&(R.focus({preventScroll:true}),je.mirrorToDom(true));},setTableInteractionLabel(f){p.resolve=f;},refreshTableInteractionLabels(){fi.refreshLabels();},destroy(){if(!ia){ia=true,Gn.cancel();try{Hc();}finally{P.removeEventListener("selectionchange",Hh),R.removeEventListener("pointerdown",Zh,{capture:true}),R.removeEventListener("keydown",Xs,{capture:true}),R.removeEventListener("beforeinput",Xs,{capture:true}),R.removeEventListener("keydown",qh),CM(),R.removeEventListener("beforeinput",jh),R.removeEventListener("copy",Vh),R.removeEventListener("cut",Kh),R.removeEventListener("paste",Wh),R.removeEventListener("compositionstart",Bh),R.removeEventListener("compositionend",_h),P.removeEventListener("scroll",zh,{capture:true}),e.ownerDocument.defaultView?.removeEventListener("resize",lu),ti?.disconnect(),Zc=null,Wc(),qc.destroy(),oa.destroy(),yt?.destroy(),zs?.destroy(),Gc?.destroy(),iu?.destroy(),fi.destroy(),oe.destroy(),Ce.destroy(),je.destroy(),R.removeEventListener("contextmenu",lh),R.removeEventListener("click",dh),R.removeEventListener("pointermove",nh),R.removeEventListener("pointerleave",oh),We.destroy(),Qe.cancel(),nt!==null&&clearTimeout(nt),nt=null,fo&&fo(),fo=null,Gt.dispose(),chunkEO4C5QJW_cjs.g(R),E.destroy(),KO(),Yg(),Xg(),Xa(),e.replaceChildren();}}}};function kM(f){de=null;let v=yt?.restoreAfterHistory();if(!f&&v&&($=v),je.noteModelMoved(),Lt(),!f){ft(eo(Ie(),Ze(),$));return}if("anchor"in f){let H=Ze(),K=!d&&[f.anchor,f.head].every(Y=>H.includes(Y.paragraphId));ft(K?f:eo(Ie(),H,f));return}let T={anchor:{paragraphId:f.paragraphId,offset:f.start},head:{paragraphId:f.paragraphId,offset:f.end}};ft(Ze().includes(f.paragraphId)?T:eo(Ie(),Ze(),T));}function ui(f,v,T){let H=$t(e);if(!H||H.clientHeight===0)return false;Jg();let K=f*u+e.offsetTop,Y=v*u,J=T?.offsetPx??24,se=T?.block??"start",ye=H.clientHeight;if(se==="nearest"||se==="centerIfNeeded"){let fe=K<H.scrollTop,It=K+Y>H.scrollTop+ye;if(!fe&&!It)return true}let Ee=se==="center"||se==="centerIfNeeded"?K-Math.max(0,(ye-Y)/2):se==="nearest"&&K>H.scrollTop?K+Y+J-ye:K-J,ve=Math.max(0,H.scrollHeight-ye);return H.scrollTo({top:Math.max(0,Math.min(Ee,ve)),behavior:T?.behavior??"auto"}),Ws(),true}let{onSelectionChange:Hh,onCompositionEnd:_h}=o.methods({...je}),Bh=(...f)=>{je.adoptBeforeInput(),Hc(),je.onCompositionStart(...f);},iu=null,RM=$k({onRequest:n.onRequestTextFormField,onInvalidRequest:n.onRequestInvalidTextFormField,locale:Zs.get,translate:(f,v)=>ni?.(f,v)??f,pagesLayer:R,container:e,part:f=>Ae(i,f??$.head.paragraphId)??i.part(),parts:()=>i.storyParts(),protected:(f=$.head.paragraphId)=>chunkFIJZIQXA_cjs.pj(i.settingsRoot())&&chunkFIJZIQXA_cjs.qj(Ae(i,f)??i.part(),f),selection:()=>$,select:(f,v)=>ft(f,false,v?"none":"caret"),reveal:Bc,editable:()=>Ne==="edit"&&!dn,apply:f=>qd(f,De,Je),save:(f,v)=>jk(f,v,{session:i,commit:De,refusal:()=>Br(true,f,false),gate:(T,H)=>d?.gateOperations(T,H)??null,collaborationActive:d!==void 0})},r.initialTextFormInput);yt=uR(RM,{part:f=>Ae(i,f),selection:()=>$,select:f=>ft(f),writable:()=>Ne!=="view"&&!dn,compare:ee},o),hS(Me,yt.fieldId),Gc=tR({pagesLayer:R,part:f=>Ae(i,f??$.head.paragraphId)??i.part(),editable:()=>Ne==="edit"&&!dn,protected:f=>chunkFIJZIQXA_cjs.pj(i.settingsRoot())&&chunkFIJZIQXA_cjs.qj(Ae(i,f)??i.part(),f),selection:()=>$,select:f=>ft(f,false,"none"),apply:f=>qd(f,De,Je)}),zs=XI({pagesLayer:R,settings:()=>chunkFIJZIQXA_cjs.Tg(i.currentPackage()),part:f=>Ae(i,f??$.head.paragraphId)??i.part(),editable:()=>Ne==="edit"&&!dn,select:f=>ft(f,false,"none"),canApply:f=>i.editable&&Br(true,[f],false)===null,history:f=>Me[f](),apply:f=>qd(f,De,Je)});let PM=qR(Me,{...n,onToggleFieldCodes:()=>{rt(),dn=!dn,kn=Mt(gt()),Qe.invalidateAll(i.packageRevision(),"field-code-view"),Qe.flush();}}),$h=eT(Me,()=>(Ae(i,$.head.paragraphId)??i.part()).root),qh=f=>{$h.keydown(f),!zs?.keydown(f)&&(f.defaultPrevented||je.adoptBeforeInput(),!(Gc?.keydown(f)||yt?.keydown(f))&&PM(f));},{onCopy:Vh,onCut:Kh,onPaste:Wh}=VR(Me),TM=KR(Me,{isComposing:()=>je.isComposing(),insertPlainText:Dh,onBrowserSelectionFixup:()=>{je.mirrorToDom(),je.noteBrowserSelectionFixup();}}),jh=f=>{je.adoptBeforeInput(),TM(f);};P.addEventListener("selectionchange",Hh);let{onDrawingPointerGesture:Zh,onDrawingKeyGesture:Xs}=AI({surface:Me,textbox:()=>Te,intent:()=>pe,setIntent:f=>he(f,true)});R.addEventListener("pointerdown",Zh,{capture:true}),R.addEventListener("keydown",Xs,{capture:true}),R.addEventListener("beforeinput",Xs,{capture:true}),R.addEventListener("keydown",qh);let CM=tT(R,$h);R.addEventListener("beforeinput",jh),R.addEventListener("copy",Vh),R.addEventListener("cut",Kh),R.addEventListener("paste",Wh),R.addEventListener("compositionstart",Bh),R.addEventListener("compositionend",_h);let su=fR(P,o.wrap(Ws)),zh=f=>{let v=$t(e);!v||f.target!==v||su();};P.addEventListener("scroll",zh,{capture:true,passive:true});let lu=()=>{su();},du=e.ownerDocument.defaultView;du?.addEventListener("resize",lu,{passive:true}),ti=typeof du?.ResizeObserver=="function"?new du.ResizeObserver(lu):null;function Uh(){if(!ti)return;let f=$t(e);f!==Zc&&(ti.disconnect(),Zc=f,f&&ti.observe(f));}Uh(),Te=jI({session:i,pagesLayer:R,layout:()=>xe,selection:()=>$,setSelection:f=>ft(f,false,"none"),flush:rt,leaveOtherStories:()=>{ue?.exitNote(),me?.exitHeaderFooter();},writable:()=>Uc&&Ne==="edit"&&i.editable}),iu=iT({onTextFormDoubleClick:f=>yt?.doubleClick(f)??false,onTextFormPointerUp:f=>yt?.pointerUp(f),pagesLayer:R,container:e,scale:()=>u,pageOffsetX:f=>ct?.pageOffsetX.get(f)??0,layout:()=>(ei=false,zc.without(Lt),Ie()),measurer:()=>S,selection:()=>Ft.shownSelection($),setSelection:(f,v)=>ft(f,false,"none",v),cellSelection:()=>Z,setCellSelection:f=>bh(f),focus:()=>R.focus({preventScroll:true}),onSelectionSettled:()=>C.applyIfArmed(),selectionLocked:()=>Ne==="view",activeHeaderFooter:()=>Iw(me?.getActive()??null),activeNote:()=>{let f=ue?.activeNoteScope();return f?{scopeId:f.id,pageIndex:ue?.activeNotePageIndex()??null}:null},enterHeaderFooter:f=>{rt(),me?.enterHeaderFooter({rId:f.rId,pageIndex:f.pageIndex,sectionIndex:In(f.pageIndex).sectionIndex,kind:f.kind,...f.position?{position:f.position}:{}});},enterNote:(f,v,T)=>{rt(),ue?.enterNote(f,v,T);},exitNote:f=>{rt(),ue?.exitNote(f);},exitHeaderFooter:()=>(rt(),me?.exitHeaderFooter()),enterEmptyHeaderFooter:(f,v)=>{if(Ne==="view")return;rt();let T=me;T&&UT({session:i,layout:xe,sectionAtPage:In,create:H=>Me.applyHeaderFooterLifecycle?.(H),flushLayout:Lt,enter:H=>T.enterHeaderFooter(H)},f,v);},onContentControlWidget:(f,v)=>nM(f,v),...n.reviewModel?{onChangeBarToggle:zn.toggleByChangeBar}:{},isReadOnlyPosition:f=>hn(i.part(),f)!==void 0},n.pointer?{mode:n.pointer}:{});let fi=UP({pagesLayer:R,furnitureLayer:W,scale:()=>u,pageOffsetX:f=>ct?.pageOffsetX.get(f)??0,read:()=>({layout:xe,storeRevision:i.packageRevision(),selection:$,cellSelection:Z,editingMode:Ne,themeColors:i.documentThemeColors()}),session:()=>i,applyTableCommandPlan:f=>Me.applyTableCommandPlan(f),label:f=>p.resolve(f)});if(St(),zs?.sync(),Lc=true,Us(),d&&(Yg=d.subscribeStatus(()=>{n.onChange?.(dt());})),d&&qs)try{Xg=d.attach(qs);}catch{try{d.destroy();}catch{}}return mo(),jc(),Me.setTableInteractionLabel=f=>{p.resolve=f,fi.refreshLabels();},Me.refreshTableInteractionLabels=()=>{fi.refreshLabels();},yk(Me,()=>({measurer:n.measurer,producer:n.producer,fontAlias:n.fontAlias,defaultFontFamily:n.defaultFontFamily}),f=>{n={...n,...f},S=n.measurer??b.measurer,k=M();},()=>{ia||(kn=Mt(gt()),Kt=void 0,ct=void 0,$r=null,Qe.invalidateAll(i.packageRevision(),"fonts"),Qe.flush());}),UI(Me,()=>je.isComposing()),Jo=wk(Me,e,{now:Ut,destroyed:()=>ia,limit:()=>Rn,setLimit:f=>Rn=f,bodyBlockCount:()=>chunk4GBTELJV_cjs.Ff(I),prefixPass:f=>tn(i.packageRevision(),void 0,void 0,f),finish:o.wrap(()=>{Qe.invalidateAll(i.packageRevision(),"opening"),Qe.flush(),Rn=null;})},oC),{ok:true,surface:o.methods(Me)}}function aC(e){let t={change:new Set,selectionChange:new Set,error:new Set,historyDiagnostic:new Set,revisionMarkupChange:new Set,reviewItemReveal:new Set};return {emitError(n){for(let r of [...t.error])r(n);},emitDocumentChange(n){for(let r of [...t.change])r(n);},emitSelectionChange(){if(!t.selectionChange.size)return;let n=e();for(let r of [...t.selectionChange])r(n);},emitHistoryDiagnostic(n){for(let r of [...t.historyDiagnostic])r(n);},emitRevisionMarkupChange(n){for(let r of [...t.revisionMarkupChange])r(n);},emitReviewItemReveal(n){let r=Object.freeze({...n});for(let o of [...t.reviewItemReveal])o(r);},hasErrorHandlers:()=>t.error.size>0,clear(){for(let n of Object.values(t))n.clear();},on(n,r){return t[n].add(r),()=>{t[n].delete(r);}}}}function Ts(e){let t=[],n=(r,o)=>{let a=o.kind,i=r.handlers.kinds??e;return typeof a!="string"||!i||i.includes(a)};return {request(r){let o=t.filter(l=>n(l,r)),a=[...o].reverse().find(l=>!l.fallback)??o.at(-1);if(!a?.handlers.onRequest)return false;let{sessions:i,handlers:s}=a;return i.add(r),r.signal.addEventListener("abort",()=>i.delete(r),{once:true}),s.onRequest(r),true},register(r,o){let a={handlers:r,fallback:o?.fallback===true,sessions:new Set};return t.push(a),()=>{let i=t.indexOf(a);if(!(i<0)){t.splice(i,1);for(let s of a.sessions)s.cancel();}}}}}var aH=()=>Ts();function iC(){let e=aH(),t=Ts(["dropdown","comboBox","date","buildingBlockGallery"]),n=Ts();return {surfaceOptions:{onRequestTextFormField:e.request,onRequestContentControlWidget:t.request,onRequestInvalidTextFormField:n.request},setters:{setTextFormFieldChrome:e.register,setContentControlWidgetChrome:t.register,setInvalidTextFormFieldChrome:n.register}}}function sC(e,t){let n=chunk4GBTELJV_cjs.Va(e),r=null,o=null,a=null,i=Ts(),s=()=>t.destroyed()?{ok:false,code:"notFound",reason:"the editor was destroyed"}:t.contribution()?.createRevisionMarkupDialog?t.container()?{ok:true}:{ok:false,code:"notFound",reason:"the editor is not attached"}:{ok:false,code:"unsupported",reason:"the review module does not supply a settings dialog"},l=p=>{if(t.destroyed())return;let m=chunk4GBTELJV_cjs.Va(p,n);JSON.stringify(m)!==JSON.stringify(n)&&(n=m,t.apply(n),a?.(),t.changed(n));},d=()=>{if(o){o.cancel();return}let p=r;r=null,p?.destroy();},c=()=>{let p=new AbortController,m=new Set,h=n,y=b=>{if(!(p.signal.aborted||JSON.stringify(b)===JSON.stringify(h))){h=b;for(let S of [...m])S();}},g={signal:p.signal,get:()=>h,set(b){p.signal.aborted||y(chunk4GBTELJV_cjs.Va(b,h));},reset:()=>y(chunk4GBTELJV_cjs.Ua),subscribe(b){return p.signal.aborted?()=>{}:(m.add(b),()=>{m.delete(b);})},canApply:()=>o===g&&!p.signal.aborted&&s().ok,apply(){return g.canApply()?(l(h),g.cancel(),true):false},cancel(){if(p.signal.aborted)return;o===g&&(o=null,a=null),m.clear();let b=r;r=null,p.abort(),b?.destroy();}};return a=()=>y(n),g},u=p=>{r=t.contribution().createRevisionMarkupDialog({...p,container:t.container(),translate:m=>t.translate()?.(m)}),p.signal.aborted?d():r.open();};return {current:()=>n,set:l,canOpen:s,register(p,m){return i.register(p??{onRequest:u},m)},open(){let p=s();if(!p.ok)return p;d();let m=c();o=m;try{i.request(m)||u(m);}catch(h){throw m.cancel(),h}return {ok:true,changed:false}},destroyDialog:d}}var lC=new WeakMap;function dH(e){return !(!e.story||e.origin===chunkFIJZIQXA_cjs.g.mutationUndo||e.origin===chunkFIJZIQXA_cjs.g.mutationRedo||e.impact!=="text-local"||e.created.length>0||e.deleted.length>0||e.splitJoin.length>0||e.dependencyKeys.some(t=>t!==chunkFIJZIQXA_cjs.l.story))}function cH(e,t){dH(t)||(e.summaries=null);}function uH(e,t){t.subscribed||(t.subscribed=true,e.subscribe(n=>cH(t,n)));}function cC(e){}function uC(e,t){let n=lC.get(e);return n||(n={summaries:null,subscribed:false},lC.set(e,n)),uH(e,n),n.summaries||(n.summaries=t()),n.summaries}var fH=new Map([["richText","richText"],["plainText","plainText"],["dropdown","dropDownList"],["dropDownList","dropDownList"],["comboBox","comboBox"],["date","date"]]);function pH(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function mH(e,t){let n=e.session.part(),r=e.session.paragraphAnchors();if(Ct(t)){let o=an(n,r,t);return o.ok?{ok:true,span:{paragraphId:o.span.nodeId,start:o.span.start,end:o.span.end}}:{ok:false,code:o.code,reason:o.reason,target:t}}if(pH(t)){if(!Ct(t.from)||!Ct(t.to))return {ok:false,code:"unsupported",reason:"address the span with paraId anchors; DocLocation endpoints are not supported",target:t};let o=an(n,r,t.from);if(!o.ok)return {ok:false,code:o.code,reason:o.reason,target:t};let a=an(n,r,t.to);if(!a.ok)return {ok:false,code:a.code,reason:a.reason,target:t};if(o.span.nodeId!==a.span.nodeId)return {ok:false,code:"unsupported",reason:"wrapping several paragraphs in one content control is not supported",target:t};let i=Math.min(o.span.start,a.span.start),s=Math.max(o.span.end,a.span.end);return {ok:true,span:{paragraphId:o.span.nodeId,start:i,end:s}}}return {ok:false,code:"unsupported",reason:"address the span with a paraId anchor; DocLocation targeting is not supported",target:t}}function cg(e,t){let n=fH.get(t.subtype);if(!n)return {ok:false,code:"invalidArgs",reason:`that control type cannot be inserted (${String(t.subtype)})`,...t.target===void 0?{}:{target:t.target}};let r;if(t.target===void 0){let o=Bo(e.state().selection);if(!o)return {ok:false,code:"unsupported",reason:"wrapping several paragraphs in one content control is not supported"};r=o;}else {let o=mH(e,t.target);if(!o.ok)return o;r=o.span;}return {ok:true,span:r,op:{op:"insertContentControl",paragraphId:r.paragraphId,start:r.start,end:r.end,type:n,...t.tag===void 0?{}:{tag:t.tag},...t.title===void 0?{}:{alias:t.title}}}}var gH="http://schemas.microsoft.com/office/word/2010/wordml",hH="http://schemas.microsoft.com/office/word/2012/wordml";function Zo(e){return chunkFIJZIQXA_cjs.Uc(e)}function Cs(e){for(let t of e.children)if(t.kind!=="textValue"&&(t.kind==="contentControlProperties"||t.localName==="sdtPr"))return t}function yH(e){if(e.kind!=="textValue"){for(let t of e.attributes)if(t.localName==="val"&&t.namespaceUri===chunkFIJZIQXA_cjs.la)return t.value}}function ug(e,t){if(e){for(let n of e.children)if(n.kind!=="textValue"&&n.localName===t)return yH(n)}}function bH(e){if(!e)return "richText";for(let t of e.children){if(t.kind==="textValue")continue;let n=vH(t);if(n!==void 0)return n}return "richText"}function vH(e){if(e.kind==="textValue")return;let t=e.kind,n=e.localName,r=e.namespaceUri;if(t==="contentControlDropDownList"||n==="dropDownList")return "dropdown";if(t==="contentControlComboBox"||n==="comboBox")return "comboBox";if(t==="contentControlDate"||n==="date")return "date";if(n==="picture")return "picture";if(n==="docPartList")return "buildingBlockGallery";if(t==="contentControlText"||n==="text")return "plainText";if(n==="richText")return "richText";if(n==="checkbox"&&(r===gH||t==="contentControlCheckbox"))return "checkbox";if(n==="repeatingSection"&&r===hH)return "repeatingSection"}function bc(e){let t=ug(e,"lock");return t==="contentLocked"||t==="sdtContentLocked"}function xH(e,t){if(bc(Cs(t)))return true;let n=chunkFIJZIQXA_cjs.Ua(e,t.id);for(;n;){if(Zo(n)&&bc(Cs(n)))return true;n=chunkFIJZIQXA_cjs.Ua(e,n.id);}return false}function pg(e,t){let n=Cs(e),r=ug(n,"tag"),o=ug(n,"alias"),a=t?xH(t,e):bc(n);return {id:e.id,controlType:bH(n),...r!==void 0?{tag:r}:{},...o!==void 0?{alias:o}:{},...a?{locked:true}:{}}}var fC=new WeakMap;function wH(e,t){let n=[],r=chunkFIJZIQXA_cjs.Ua(e,t.id);for(;r;)Zo(r)&&n.push(`${r.id}:${bc(Cs(r))?1:0}`),r=chunkFIJZIQXA_cjs.Ua(e,r.id);return n.join("|")}function mC(e){return Object.freeze({...e,...e.tag!==void 0?{tag:e.tag}:{},...e.alias!==void 0?{alias:e.alias}:{},...e.locked?{locked:true}:{}})}function SH(e){return Object.freeze(e.map(t=>mC(t)))}function IH(e,t){let n=e.node,r=Cs(n),o=wH(t,n),a=fC.get(n);if(a&&a.properties===r&&a.lockAncestors===o)return a.summary;let i=mC(pg(n,t));return fC.set(n,{properties:r,lockAncestors:o,summary:i}),i}function kH(e){let t=chunkFIJZIQXA_cjs.$b(e.root);return cC(t.length),t.map(n=>IH(n,e))}function RH(e){return SH(e.storyParts().flatMap(t=>kH(t)))}function PH(e){return uC(e,()=>RH(e))}function fg(e,t){return t?!(t.tag!==void 0&&e.tag!==t.tag||t.alias!==void 0&&e.alias!==t.alias||t.controlType!==void 0&&e.controlType!==t.controlType):true}function TH(e){let t=[];if(e.kind!=="paragraph")return t;let n=(r,o,a,i)=>{if(i>=chunkFIJZIQXA_cjs.wa)return o;let s=o;for(let l of r)if(l.kind!=="paragraphProperties"){if(l.kind==="run"){s+=chunkFIJZIQXA_cjs.kg(e,l);continue}if(chunkFIJZIQXA_cjs.ya(l)){s=n(l.children,s,a,i+1);continue}if(Zo(l)){let d=s,c=a+1;s=n(chunkFIJZIQXA_cjs.Tb(l),s,c,i+1),t.push({control:l,start:d,end:s,depth:c});continue}s+=chunkFIJZIQXA_cjs.kg(e,l);}return s};return n(e.children,0,-1,0),t}function mg(e,t,n){return TH(e).filter(r=>t>=r.start&&t<r.end).sort((r,o)=>o.depth-r.depth).map(r=>pg(r.control,n))}function gg(e,t){let n=[],r=chunkFIJZIQXA_cjs.Ua(e,t);for(;r;)Zo(r)&&n.push(pg(r,e)),r=chunkFIJZIQXA_cjs.Ua(e,r.id);return n.reverse()}function gC(e,t){if(!e)return [];let n=PH(e.session);return t?n.filter(r=>fg(r,t)):n}function hg(e,t){if(!e)return null;let{paragraphId:n,offset:r}=e.state().selection.head,o=Ae(e.session,n)??e.session.part(),a=chunkFIJZIQXA_cjs.Ta(o,n);if(a&&a.kind==="paragraph"){for(let s of mg(a,r,o))if(fg(s,t))return s}let i=gg(o,n);for(let s=i.length-1;s>=0;s-=1){let l=i[s];if(fg(l,t))return l}return null}function yg(e){return e.type==="insertContentControl"||e.type==="setContentControlValue"||e.type==="removeContentControl"}function CH(e){return typeof e=="object"&&e!==null&&"container"in e&&"path"in e}function EH(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function OH(e){let t=n=>{if(n.kind==="textValue")return null;if(n.kind==="body")return n;for(let r of n.children){let o=t(r);if(o)return o}return null};return t(e.root)}function vc(e){let t=[];for(let n of e)n.kind!=="textValue"&&(n.kind==="paragraph"||n.kind==="table"||Zo(n))&&t.push(n);return t}function MH(e){let t=[];for(let n of e.children)if(n.kind==="tableRow")for(let r of n.children)r.kind==="tableCell"&&t.push(...vc(r.children));return t}function AH(e){return e.kind==="table"?MH(e):Zo(e)?vc(chunkFIJZIQXA_cjs.Tb(e)):e.kind==="body"?vc(e.children):[]}function FH(e,t,n){if(Zo(t))return {ok:true,controlId:t.id};if(t.kind==="paragraph"){let r=n??0;for(let i of mg(t,r,e))return {ok:true,controlId:i.id};let a=gg(e,t.id).at(-1);if(a)return {ok:true,controlId:a.id}}return {ok:false,code:"notFound",reason:"no content control at the addressed block"}}function LH(e,t){if(t.container.part!=="body")return {ok:false,code:"unsupported",reason:"only the body container is supported",target:t};let n=OH(e);if(!n)return {ok:false,code:"notFound",reason:"the document body was not found",target:t};if(t.path.length===0)return {ok:false,code:"notFound",reason:"DocLocation path is empty",target:t};let r=vc(n.children),o=null;for(let i=0;i<t.path.length;i+=1){if(o=r[t.path[i]]??null,!o)return {ok:false,code:"notFound",reason:`block index ${t.path[i]} is out of range`,target:t};i<t.path.length-1&&(r=AH(o));}if(!o)return {ok:false,code:"notFound",reason:"the addressed block was not found",target:t};let a=FH(e,o,t.offset);return a.ok?a:{...a,target:t}}function NH(e,t,n){let r=an(e,t,n);if(!r.ok)return {ok:false,code:r.code,reason:r.reason,target:n};let o=t.partByNode.get(r.span.nodeId)??e,a=chunkFIJZIQXA_cjs.Ta(o,r.span.nodeId);if(!a||a.kind!=="paragraph")return {ok:false,code:"notFound",reason:`paragraph '${n.paraId}' was not found`,target:n};let i=r.span.start;for(let d of mg(a,i,o))return {ok:true,controlId:d.id};let l=gg(o,a.id).at(-1);return l?{ok:true,controlId:l.id}:{ok:false,code:"notFound",reason:`no content control encloses paragraph '${n.paraId}'`,target:n}}function hC(e,t){if(t===void 0){let r=hg(e);return r?{ok:true,controlId:r.id}:{ok:false,code:"notFound",reason:"no content control at the current selection"}}if(EH(t))return {ok:false,code:"unsupported",reason:"DocRange targeting is not supported for content controls",target:t};let n=e.session.part();return CH(t)?LH(n,t):Ct(t)?NH(n,e.session.paragraphAnchors(),t):{ok:false,code:"invalidArgs",reason:"unrecognized target shape",target:t}}function yC(e){switch(e){case "locked":case "bound":case "typeMismatch":case "invalidArgs":case "unsupported":return e;case "unknown-control":return "notFound";case "indivisible-content":return "unsupported";default:return "unsupported"}}function bC(e){switch(e){case "locked":return "the content control is locked";case "bound":return "the content control is bound to external data";case "typeMismatch":return "the value does not match the control type";case "invalidArgs":return "the value is not valid for this control";case "unsupported":return "this control type is not supported";case "unknown-control":return "the content control was not found";case "indivisible-content":return "a content control cannot start or end inside a hyperlink, a field, or another inline control";default:return `the edit was refused (${e})`}}function vC(e,t){return {ok:false,code:yC(e),reason:bC(e),...t!==void 0?{target:t}:{}}}function DH(e,t,n,r){return r?.scope&&r.scope.kind!=="body"&&e.target!==void 0?{ok:false,refusal:{ok:false,code:"unsupported",reason:"a location or anchor target resolves in the body only; omit it to use the caret"}}:t?n==="view"||!t.session.editable?{ok:false,refusal:{ok:false,code:"locked",reason:"the document is read-only"}}:e.type==="setContentControlValue"&&typeof e.value!="string"?{ok:false,refusal:{ok:false,code:"invalidArgs",reason:"setContentControlValue requires a string value"}}:{ok:true}:{ok:false,refusal:{ok:false,code:"notFound",reason:"no document is loaded"}}}function bg(e){return e==="viewing"?"view":e==="suggesting"?"suggesting":"edit"}function vg(e,t,n,r){let o=DH(e,t,n,r);if(!o.ok)return o.refusal;if(e.type==="insertContentControl"){let s=cg(t,e);return s.ok?pC(t,s.op,s.span.paragraphId):{ok:false,code:s.code,reason:s.reason}}let a=hC(t,e.target);if(!a.ok)return {ok:false,code:a.code,reason:a.reason};let i=e.type==="setContentControlValue"?{op:"setContentControlValue",controlId:a.controlId,value:e.value}:{op:"removeContentControl",controlId:a.controlId};return pC(t,i,a.controlId)}function pC(e,t,n){let r=Ae(e.session,n)??e.session.part(),o=chunkFIJZIQXA_cjs.Tg(e.session.currentPackage()),a=chunkFIJZIQXA_cjs.nj(o,t)??chunkFIJZIQXA_cjs.pk(r,o,t)??chunkFIJZIQXA_cjs.Wk(r,t);return a?{ok:false,code:yC(a),reason:bC(a)}:{ok:true}}function xC(e,t,n,r){t?.flushPendingInput();let o=vg(e,t,n,r);return o.ok?HH(t,e):o}function wC(e,t,n,r,o){let a=e.applyGatedTreeOps;return typeof a=="function"?a.call(e,t,n,r,o):e.session.applyTreeOps(t,n,r,o)}function HH(e,t){if(t.type==="insertContentControl")return _H(e,t);let n=hC(e,t.target);if(!n.ok){let i=n.target??t.target;return {ok:false,code:n.code,reason:n.reason,...i!==void 0?{target:i}:{}}}e.flushPendingInput();let r=Bo(e.state().selection),o=t.type==="setContentControlValue"?{op:"setContentControlValue",controlId:n.controlId,value:t.value}:{op:"removeContentControl",controlId:n.controlId},a=wC(e,[o],r,r,kt(e.session,n.controlId,{kind:"body"}));return a.rejected?vC(a.reason??"unsupported",t.target):(e.layout(),{ok:true,changed:a.committed})}function _H(e,t){e.flushPendingInput();let n=cg(e,t);if(!n.ok){let d=n.target??t.target;return {ok:false,code:n.code,reason:n.reason,...d!==void 0?{target:d}:{}}}let{paragraphId:r,start:o,end:a}=n.span,i=Bo(e.state().selection),s={paragraphId:r,start:o,end:a},l=wC(e,[n.op],i,s,kt(e.session,r,{kind:"body"}));return l.rejected?vC(l.reason??"unsupported",t.target):(e.layout(),{ok:true,changed:l.committed})}function SC(e,t,n){switch(n.type){case "selectedText":return e?.selectedText()??"";case "selectionFormatting":return e?t():null;case "selection":return gd(e);case "paragraphs":return _S(e,n.container);case "isInsideToc":return VS(e);case "hyperlinkAt":return HS(e);case "contentControls":return gC(e,n.filter);case "trackedChanges":case "revisions":case "findText":case "comments":return [];case "styles":return {paragraph:new Map,character:new Map,table:new Map};case "variables":return {};case "contentControlAt":return hg(e,n.filter);case "tableContext":return yd(e);default:return null}}var IC=new WeakMap;function kC(e){let t=IC.get(e);if(!t)throw new Error("External refresh requires a mounted createDocxEditor instance.");return t}function RC(e,t){let n=null,r=null,o={...t,epoch:0,revision:0,mountedRevision:0,source:void 0,invalidated:new Set,cancel(){if(!r||r.mountedRevision!==null)return;t.cancelLoad();let a=r;r=null,to(a.container,false),t.surface()?.setEditable(e.snapshot().editingMode!=="viewing"),o.source=void 0,a.resolve(false);try{t.changed();}catch{}},invalidate(){o.cancel(),o.epoch++,n=null,r&&(to(r.container,false),r.resolve(false),r=null),o.source=void 0;for(let a of o.invalidated)a();},contentMounted(a){r?.bytes===a&&(r.mountedRevision=o.revision);},mounted(a,i){if(!r||r.bytes!==a)return;let s=r,l=!i&&!!t.surface();o.mountedRevision=s.mountedRevision??o.revision,l?n=null:n={top:s.top,left:s.left};let d=$t(s.container);if(l&&d&&(d.scrollTop=Math.max(0,Math.min(s.top,d.scrollHeight-d.clientHeight)),d.scrollLeft=Math.max(0,Math.min(s.left,d.scrollWidth-d.clientWidth)),d.dispatchEvent(new Event("scroll"))),r===s){r=null,to(s.container,false),t.surface()?.setEditable(e.snapshot().editingMode!=="viewing"),o.source=void 0,s.resolve(l);try{t.changed();}catch{}}},replace(a,i){let s=t.container();if(!s||r)return Promise.resolve(false);let l=$t(s);return new Promise(d=>{r={bytes:a,resolve:d,container:s,top:i==="recovery"&&n?n.top:l?.scrollTop??0,left:i==="recovery"&&n?n.left:l?.scrollLeft??0,mountedRevision:null},o.source=i,to(s,true),t.surface()?.setEditable(false);try{t.load(a);}catch(c){o.mounted(a,c);}})}};return e.on("change",a=>{a.source||o.revision++;}),IC.set(e,o),o}function PC(e,t,n,r,o){let a=new Map,i=chunk6APGXLBB_cjs.ba(e,{resolveFont:l=>{let d=l.fontFamily??t.defaultFont.family;if(d.trim().length===0)return null;let c={family:d,weight:l.bold?700:400,style:l.italic?"italic":"normal"},u=chunk4GBTELJV_cjs.h(c);if(a.has(u))return a.get(u)??null;let p;try{p=e.fonts.resolve(c);}catch{return a.set(u,null),null}let m=p instanceof chunk4GBTELJV_cjs.d?null:p;return a.set(u,m),m},fallback:n.measurer}),s=`shaped:${e.operation.extensionFingerprint}+algorithm:${e.operation.shapingHash}+producer:${e.operation.producerVersion}+fallback:${n.producer}@scale:${r}+fonts:${o}`;return {measurer:i,producer:s}}var BH="The quick brown fox 0123 \u2014 {}#@",$H=["monospace","serif"],qH=/^[\p{L}\p{N}\p{M} \-.+_,;]{1,64}$/u;function CC(e){if(!e)return ()=>true;let t=new Map,n=r=>(e.font=r,e.measureText(BH).width);return r=>{let o=t.get(r);if(o!==void 0)return o;if(!qH.test(r))return t.set(r,true),true;let a=false;for(let i of $H){let s=n(`32px ${i}`);if(n(`32px "${r}", ${i}`)!==s){a=true;break}}return t.set(r,a),a}}var TC=4;function EC(e,t,n){let r=new Set,o=[];for(let c of t){let u=c.toLowerCase();r.has(u)||(r.add(u),o.push(c));}let a=c=>new Set(e.slice(0,Math.max(c,0)).map(u=>u.toLowerCase())),i=0;for(let c=0;c<=TC;c+=1){let u=a(n-i),p=o.filter(h=>!u.has(h.toLowerCase())).length,m=Math.min(p,TC,Math.floor(n/2));if(m===i)break;i=m;}let s=e.slice(0,Math.max(n-i,0)),l=a(n-i),d=o.filter(c=>!l.has(c.toLowerCase()));return [...s,...d].slice(0,n)}function OC(e,t,n,r=new Set){let o=[];for(let a of e){if(r.has(a.toLowerCase())){o.push(a);continue}if(t(a)||n(a))continue;let i=chunk6APGXLBB_cjs.P.get(a.toLowerCase());i!==void 0&&n(i)||o.push(a);}return o}function MC(e,t){let n=new Set(e.map(r=>r.request.family.toLowerCase()));for(let r=0;r<t.length;r+=1){let o=false;for(let a of t){let i=a.from.family.toLowerCase();n.has(i)||!n.has(a.to.family.toLowerCase())||(n.add(i),o=true);}if(!o)break}return n}var AC=new WeakMap,VH=0,KH=chunkK5U2PLDP_cjs.p((e,t)=>{if(e.kind==="paragraphProperties"){let n=AC.get(e);return n||(n=String(++VH),AC.set(e,n)),{families:[n],children:[]}}return {families:e.kind==="paragraph"&&!e.children.some(n=>n.kind==="paragraphProperties")?["default-paragraph"]:[],children:chunkK5U2PLDP_cjs.q(e,t)}});function xc(e){return KH(e,{key:""})}var FC=new WeakMap,LC=new WeakMap;function xg(e){let t=LC.get(e);return t||LC.set(e,t=chunkK5U2PLDP_cjs.r()),t}function wg(e,t){xg(e)(t,e.stylesRoot(),e.documentThemeFonts()),chunkK5U2PLDP_cjs.t(t),xc(t);}function NC(e,t,n,r){let o=xg(e).warmTableRows(t,n,r,e.stylesRoot(),e.documentThemeFonts()),a=t.children.slice(n,r);return chunkK5U2PLDP_cjs.t(a),xc(a),Math.max(o,t.children.length)}function DC(e){let t=e.packageRevision(),n=FC.get(e);if(n?.revision===t)return n.families;let r=n?.eastAsianFonts??xg(e),o=e.storyParts().map(p=>p.root),a=e.stylesRoot(),i=e.numberingRoot(),s=e.documentThemeFonts(),l=xc(o),c=n&&n.stylesRoot===a&&n.numberingRoot===i&&n.theme===s&&n.numberingInputs.length===l.length&&n.numberingInputs.every((p,m)=>p===l[m])?n.numberingFamilies:chunkK5U2PLDP_cjs.v(o,i,a,s),u=[...e.symbolFontFamilies(),...r(o,a,s),...chunkK5U2PLDP_cjs.t(o),...c];return FC.set(e,{eastAsianFonts:r,revision:t,families:u,numberingInputs:l,numberingFamilies:c,numberingRoot:i,stylesRoot:a,theme:s}),u}function HC(e,t,n){let[r]=chunkK5U2PLDP_cjs.a([[t]]);return EC([...new Set([...r&&r!==n?[r]:[],...e.documentFonts()])],DC(e),chunkK5U2PLDP_cjs.c)}function _C(e,t){let n,r=false,o=()=>{r=false;let i=e();if(!i)return;let s=n?.generation!==i.generation;s&&(n={generation:i.generation,requested:new Set,running:false});let l=n;if(l.running||!s&&!i.dynamic)return;let d=i.dynamic?i.families().filter(u=>!l.requested.has(u.toLowerCase())):[];if(!s&&d.length===0)return;for(let u of d)l.requested.add(u.toLowerCase());l.running=true;let c=t(d);return c.finally(()=>{l.running=false,n===l&&a();}),c},a=(i=false)=>{if(i)return o();r||(r=true,queueMicrotask(o));};return {schedule:a}}var $C="replace:",WH=`revision-${$C}`,Es=new WeakMap;function Sg(e){return e?Es.get(e)??null:null}function wc(e){let t=Es.get(e);return t?[e,t.deletion,t.insertion]:[e]}function jH(e,t){let n=e.ranges[e.ranges.length-1],r=t.ranges[0];return n!==void 0&&r!==void 0&&n.partName===r.partName&&n.end.paragraphId===r.start.paragraphId&&n.end.offset===r.start.offset}function ZH(e,t){return e.revisionKind==="delete"&&t.revisionKind==="insert"&&e.author===t.author&&e.readOnly===t.readOnly&&e.nesting===t.nesting&&jH(e,t)}var BC=new WeakMap;function zH(e,t){let n=BC.get(e);if(n&&Es.get(n)?.insertion===t)return n;let r=t.date??e.date,o={kind:"revision",id:`${$C}${e.id}+${t.id}`,address:e.address,addresses:[...e.addresses,...t.addresses],replacedText:e.text,revisionKind:"replace",author:t.author,...r!==void 0?{date:r}:{},text:t.text,ranges:[...e.ranges,...t.ranges],nesting:e.nesting,replacedRangeCount:e.ranges.length,readOnly:e.readOnly||t.readOnly,replyIds:[...e.replyIds,...t.replyIds]};return Es.set(o,{deletion:e,insertion:t}),BC.set(e,o),chunkFIJZIQXA_cjs.vj(o,[...chunkFIJZIQXA_cjs.wj(e),...chunkFIJZIQXA_cjs.wj(t)])}function UH(e){let t=e.filter(i=>i.kind==="revision"),n=new Map,r=new Set,o=new Map;for(let i=0;i+1<t.length;i+=1){let s=t[i],l=t[i+1];if(!ZH(s,l))continue;let d=zH(s,l);n.set(s,d),r.add(l),o.set(s.id,d.id),o.set(l.id,d.id),i+=1;}if(n.size===0)return {items:e,renamed:o};let a=[];for(let i of e)r.has(i)||a.push(n.get(i)??i);return {items:a,renamed:o}}function qC(e,t){let n=new Set(t?.excludeRevisionKinds??[]),r=s=>s.kind!=="revision"||!n.has(s.revisionKind),o=n.size>0?e.filter(r):e,a=new Map;if(t?.pairReplacements===true){let s=UH(o);a=s.renamed,o=n.size>0?s.items.filter(r):s.items;}if(n.size===0&&a.size===0)return o;let i=new Set(o.filter(s=>s.kind==="revision").map(s=>s.id));return o.map(s=>{if(s.kind!=="comment"||s.parentRevisionId===void 0)return s;let l=a.get(s.parentRevisionId)??s.parentRevisionId;if(i.has(l))return l===s.parentRevisionId?s:{...s,parentRevisionId:l};let{parentRevisionId:d,...c}=s;return c})}function zo(e){return e.startsWith(WH)}function ao(e,t){let n=zo(t)?{placement:false,pairReplacements:true}:{placement:false};return e(n).find(r=>r.key===t)}function Sc(e){let t=Es.get(e);return t?[chunkFIJZIQXA_cjs.xj(t.deletion),chunkFIJZIQXA_cjs.xj(t.insertion)]:[chunkFIJZIQXA_cjs.xj(e)]}function Ig(e,t,n){return t===null||n?.pairReplacements!==true?t:e({...n,placement:false}).find(o=>zo(o.key)&&Sc(o.item).includes(t))?.key??t}function kg(e,t){let n=zo(t.key)?t.key:Ig(e,t.key,{pairReplacements:true});return n!==null&&zo(n)?{...t,pairKey:n}:t}function KC(e){return e.kind==="custom"?`custom node '${e.name}' has no reviewCard, so it has no card to activate`:`review items of kind '${e.kind==="revision"?e.revisionKind:e.kind}' are excluded from activation`}function Rg(e,t){let n=e.review;return n?{reviewModel:{...n,collectReviewItems:r=>n.collectReviewItems(e.customNodes.length>0?{...r,customNodes:e.customNodes,...e.customNodeDiagnostics.length>0?{reportCustomNodeDiagnostic:t}:{}}:r)}}:{}}var GH=["all-markup","simple-markup","proposed","original"];function WC(e){let t=()=>e.placements().filter(y=>y.kind==="revision"&&(y.activatable||y.revisionKind==="format")),n=()=>e.surface()?.session.reviewItems().filter(y=>y.kind==="revision")??[],r=y=>{let g=n(),b,S=k=>(b??=new Map(e.placements({placement:false,pairReplacements:true}).filter(P=>zo(P.key)).map(P=>[P.key,P])),b.get(k)),x=new Set(y.keys?.flatMap(k=>{if(!zo(k))return [k];let P=S(k);return P?Sc(P.item):[k]})??(y.scope==="document"?g:e.visible()).filter(k=>k.kind==="revision").map(chunkFIJZIQXA_cjs.xj)),I=new Map,M=y.scope==="document"&&y.keys===void 0;if(M){let k=e.surface().session;for(let P of k.storyParts())I.set(P.name,{scope:kt(k,P.root.id,{kind:"body"}),part:P,keys:[]});}for(let k of g){let P=e.scope(k),R=Ae(e.surface().session,chunkFIJZIQXA_cjs.wj(k)[0]);if(!R)continue;let w=I.get(R.name);w||(w={scope:P,part:R,keys:[]},I.set(R.name,w));let O=chunkFIJZIQXA_cjs.xj(k);x.delete(O)&&w.keys.push(O);}return {scopes:[...I.values()],missing:[...x],unfilteredDocument:M}},o=y=>{let g=chunkFIJZIQXA_cjs.bd(e.surface().session.currentPackage()),b=[],S=[];for(let{scope:x,part:I,ops:M}of y)M.length&&(I.name===g?.name?S.push({partName:I.name,ops:M}):b.push({scope:x,ops:M}));return {groups:b,partOps:S}},a=y=>{let{scopes:g,missing:b,unfilteredDocument:S}=r(y),x=[],I=b.map(P=>({key:P,reason:"unknown-revision"})),M=[],k=0;for(let{scope:P,part:R,keys:w}of g){let O=chunkJGNVNT2A_cjs.va(R,y.action,S?void 0:w);x.push(...O.result.resolved),I.push(...O.result.skipped),k+=O.result.remaining,M.push({scope:P,part:R,ops:O.ops});}return {...o(M),result:{resolved:x,skipped:I,remaining:k}}},i=y=>y.author===void 0?e.surface()?.author():y.author,s=y=>{let{scopes:g,missing:b}=r(y),S={author:i(y)??"",...y.date===void 0?{}:{date:y.date}},x=b.map(k=>({key:k,reason:"unknown-revision"})),I=[];for(let{scope:k,part:P,keys:R}of g){if(!R.length)continue;let w=chunkFIJZIQXA_cjs.kk(P,S,R,void 0,y.authors);I.push({scope:k,part:P,ops:w.ops,plan:w});}let M=k=>({updated:k.flatMap(P=>P.updated),skipped:[...x,...k.flatMap(P=>P.skipped)]});return {...o(I),result:M(I.map(({plan:k})=>k.result)),finish:()=>{let k=e.surface().session.currentPackage().parts;return M(I.map(({part:P,plan:R})=>{let w=k.get(P.name);return w?R.finish(w):R.result}))}}},l=()=>e.destroyed()?{ok:false,code:"notFound",reason:"the editor was destroyed"}:e.enabled()?e.surface()?{ok:true}:{ok:false,code:"notFound",reason:"no document is open"}:{ok:false,code:"unsupported",reason:ln},d=y=>y.scope!==void 0&&!["visible","document"].includes(y.scope)||y.unsupported!==void 0&&!["skip","fail"].includes(y.unsupported)||y.keys!==void 0&&(!Array.isArray(y.keys)||y.keys.some(g=>typeof g!="string"))?{ok:false,code:"invalidArgs",reason:"invalid bulk revision selection"}:null,c=y=>{let g=l();if(!g.ok)return {gate:g};if(e.viewing())return {gate:{ok:false,code:"locked",reason:"the document is open for viewing"}};let b=_n(y,e.surface());if(b)return {gate:b};let S=i(y);if(S===void 0)return {gate:{ok:false,code:"invalidArgs",reason:"pass an author, or configure the editor author, to change the author"}};if(typeof S!="string"||y.date!==void 0&&typeof y.date!="string"||chunkFIJZIQXA_cjs.jk({author:S,...y.date===void 0?{}:{date:y.date}}))return {gate:{ok:false,code:"invalidArgs",reason:"author must be nonblank text, and date an ISO 8601 date and time"}};let x=d(y);if(x)return {gate:x};if(y.keys!==void 0&&(y.scope!==void 0||y.authors!==void 0)||y.authors!==void 0&&(!Array.isArray(y.authors)||y.authors.some(k=>typeof k!="string")))return {gate:{ok:false,code:"invalidArgs",reason:"select by keys, or by scope and authors; authors must be a list of names"}};let I=s(y),{result:M}=I;return y.unsupported==="fail"&&M.skipped.length?{gate:{ok:false,code:"unsupported",reason:"some selected changes cannot change author"},plan:I}:M.updated.length?{gate:{ok:true},plan:I}:{gate:{ok:false,code:M.skipped.some(k=>k.reason==="unsupported-revision")?"unsupported":"notFound",reason:"no eligible selected changes to update"},plan:I}},u=y=>{e.surface()?.flushPendingInput();let{gate:g,plan:b}=c(y);if(!g.ok)return b?{...g,revisionAuthors:{...b.result,updated:[]}}:g;let S=e.surface(),{groups:x,partOps:I}=b;if(!x.length&&!I.length)return {ok:true,changed:false,revisionAuthors:b.result};let M=e.placements().find(w=>w.isActive)?.key,k;if(S.commitReviewOps(()=>(k=S.session.applyTreeOpsAtomic(x,{partOps:I}),k),"revision-attribution"),!k?.committed)return {ok:false,code:"unsupported",reason:typeof k?.reason=="string"?k.reason:"the changes were refused"};let P=b.finish(),R=P.updated.find(w=>w.previousKey===M);return R&&e.activate(R.key),{ok:true,changed:true,revisionAuthors:P}},p=y=>{if(y.type==="setReviewChangesAuthor")return c(y).gate;if(y.type!=="navigateReviewChange"&&y.type!=="resolveAllReviewChanges"&&y.type!=="setReviewDisplayMode")return null;let g=l();if(!g.ok)return g;if(y.type==="setReviewDisplayMode")return GH.includes(y.mode)?{ok:true}:{ok:false,code:"invalidArgs",reason:"unknown review display mode"};if(y.type==="navigateReviewChange"&&!["next","previous"].includes(y.direction))return {ok:false,code:"invalidArgs",reason:"unknown review navigation direction"};if(y.type==="resolveAllReviewChanges"&&!["accept","reject"].includes(y.action))return {ok:false,code:"invalidArgs",reason:"unknown review resolution action"};if(y.type==="navigateReviewChange")return t().length?{ok:true}:{ok:false,code:"notFound",reason:"no visible changes to review"};if(e.viewing())return {ok:false,code:"locked",reason:"the document is open for viewing"};let b=_n(y,e.surface());if(b)return b;let S=d(y);if(S)return S;let{result:x,groups:I,partOps:M}=a(y);return y.unsupported==="fail"&&x.skipped.length?{ok:false,code:"unsupported",reason:"some selected changes cannot be resolved"}:!x.resolved.length&&!I.length&&!M.length?{ok:false,code:x.skipped.length?"unsupported":"notFound",reason:"no eligible selected changes to review"}:{ok:true}};return {can:p,exec:y=>{if(y.type==="setReviewChangesAuthor")return u(y);if(!["navigateReviewChange","resolveAllReviewChanges","setReviewDisplayMode"].includes(y.type))return null;e.surface()?.flushPendingInput();let g=p(y);if(!g)return null;if(!g.ok){if(y.type==="resolveAllReviewChanges"&&(g.code==="notFound"||g.code==="unsupported")&&l().ok&&!e.viewing()){let{result:k}=a(y);return {...g,revisions:{...k,resolved:[],remaining:k.remaining+k.resolved.length}}}return g}let b=e.surface();if(y.type==="setReviewDisplayMode")return e.setDisplayMode(y.mode),{ok:true,changed:false};if(y.type==="navigateReviewChange"){let k=t(),P=k.findIndex(A=>A.isActive),R=y.direction==="next"?1:-1,w=P<0?XH(k,b,R):(P+R+k.length)%k.length,O=k[w],N=e.activate(O.key,!O.activatable&&O.revisionKind==="format");return N.ok&&e.reveal({key:O.key,source:"navigate"}),N}if(y.type!=="resolveAllReviewChanges")return null;let{groups:S,partOps:x,result:I}=a(y),M;return b.commitReviewOps(()=>(M=b.session.applyTreeOpsAtomic(S,{partOps:x}),M),"revision-resolve"),M?.committed?(e.activate(null),{ok:true,changed:true,revisions:{...I,remaining:n().length}}):{ok:false,code:"unsupported",reason:typeof M?.reason=="string"?M.reason:"the revisions were refused"}},resolveReviewItem:(y,g)=>{let b=l();if(!b.ok)return b;if(e.viewing())return e.surface().commitReviewOps(()=>({committed:false,reason:"the document is open for viewing"}),"revision-resolve"),{ok:false,code:"locked",reason:"the document is open for viewing"};let S=_n({type:"resolveAllReviewChanges"},e.surface());if(S)return S;e.surface().flushPendingInput();let x=ao(e.placements,y)?.item;if(!x||x.kind!=="revision")return {ok:false,code:"notFound",reason:"no revision with that key"};if(x.readOnly)return {ok:false,code:"unsupported",reason:"this revision kind has no structural accept/reject yet"};let I;return e.surface().commitReviewOps(()=>{let M=e.surface().session,k=Ae(M,chunkFIJZIQXA_cjs.wj(x)[0]);return k&&k.name===chunkFIJZIQXA_cjs.bd(M.currentPackage())?.name?(I=M.applyTreeOpsAtomic([],{partOps:[{partName:k.name,ops:VC(x,g,k)}]}),I):(I=e.surface().session.applyTreeOps(VC(x,g,e.surface().session.partFor(e.scope(x))),void 0,void 0,e.scope(x)),I)},"revision-resolve"),I?.committed?{ok:true,changed:true}:{ok:false,code:"unsupported",reason:typeof I?.reason=="string"?I.reason:"the revision was refused"}}}}function XH(e,t,n){let r=t.state().selection.head,o=t.session.storyParts().find(s=>r.paragraphId.startsWith(`${s.name}#`)),a=o?chunkFIJZIQXA_cjs.lj(o):new Map,i=a.get(r.paragraphId);if(i!==void 0)for(let s=n>0?0:e.length-1;s>=0&&s<e.length;s+=n){let l=e[s],d=l.kind==="revision"?l.item.ranges[0]?.start:void 0,c=d?a.get(d.paragraphId):void 0;if(d&&c!==void 0&&(n>0?c>i||c===i&&d.offset>=r.offset:c<i||c===i&&d.offset<=r.offset))return s}return n>0?0:e.length-1}function VC(e,t,n){let r=t==="accept"?"acceptRevision":"rejectRevision";if(!n)return [];if(e.revisionKind==="structural"||chunkFIJZIQXA_cjs.tj(n.root).length>0||e.revisionKind==="format"&&chunkFIJZIQXA_cjs.wj(e).length>1)return [...chunkJGNVNT2A_cjs.va(n,t,Sc(e)).ops];let o=new Set(chunkFIJZIQXA_cjs.wj(e)),a=new Map;for(let i of chunkFIJZIQXA_cjs.Zj(n)){if(!o.has(i.node.id))continue;let s=p=>i.node.attributes.find(m=>m.namespaceUri===chunkFIJZIQXA_cjs.la&&m.localName===p)?.value,l=e.addresses.find(p=>p.id===s("id")&&p.author===(s("author")??"")&&(p.date??"")===(s("date")??""));if(!l)continue;let d=i.node.localName,c=JSON.stringify([l,d]),u=a.get(c);u?u.siteNodeIds.push(i.node.id):a.set(c,{revision:l,localName:d,siteNodeIds:[i.node.id]});}return [...a.values()].map(({revision:i,localName:s,siteNodeIds:l})=>({op:r,revision:i,...s===void 0?{}:{localName:s},siteNodeIds:l}))}function Pg(e){return e.kind==="comment"?e.comment.date:e.kind==="revision"?e.date:void 0}function Tg(e,t,n,r){return e.type!=="toggleReviewPane"&&e.type!=="toggleParagraphMarks"&&e.type!=="setEditingMode"?null:t?{ok:false,code:"notFound",reason:"the editor was destroyed"}:e.type==="toggleReviewPane"&&!n?{ok:false,code:"unsupported",reason:ln}:e.type==="setEditingMode"?r(e.mode)??{ok:true}:{ok:true}}function jC(e){let t=false;return {get:()=>t,toggle:()=>{t=!t,e(t);}}}function ZC(e,t,n){if(!t)return false;switch(e.type){case "toggleMark":switch(e.mark){case "bold":return t.bold===true;case "italic":return t.italic===true;case "underline":return t.underline===true;case "strike":return t.strike===true;case "superscript":return t.superscript===true;case "subscript":return t.subscript===true;default:return false}case "setParagraphDirection":return t.direction===e.direction;case "setAlignment":return t.alignment===(e.align==="justify"?"both":e.align);case "toggleList":return n(e.kind);default:return false}}function Ic(e,t,n){return t.kind==="note"?e.enterNote?.(t.id,n)?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"the note could not be opened"}:(t.furnitureKind?e.enterHeaderFooter?.({rId:t.rId,kind:t.furnitureKind,position:n}):e.enterHeaderFooter?.({rId:t.rId,position:n}))?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"the header or footer could not be opened"}}function YH(e){return e?.kind==="headerFooter"||e?.kind==="note"}function zC(e,t){return t!=="viewing"&&typeof e.enterHeaderFooter=="function"&&typeof e.enterNote=="function"?"all":"body"}function kc(e,t){e.activeScope().kind!=="body"&&e.session.paragraphIds().includes(t)&&(e.activeScope().kind==="frame"&&e.setActiveScope({kind:"body"}),e.exitNote?.(),e.exitHeaderFooter?.());}function UC(e,t){if(typeof t?.blockId!="string"||t.blockId.length===0||!Number.isInteger(t.start)||t.start<0||!Number.isInteger(t.length)||t.length<0)return {ok:false,code:"invalidArgs",reason:"match must carry a blockId and offsets"};if(t.scope?.kind==="frame"){let{drawingNodeId:r,hostParagraphId:o}=t.scope;if(typeof r!="string"||r.length===0||typeof o!="string"||o.length===0)return {ok:false,code:"invalidArgs",reason:"a frame match must carry drawing and host paragraph ids"};let a={ok:false,code:"unsupported",reason:"the text box drawing could not be selected"};if(!Na(e.layout(),r,o))return a;let i=t.scope.owner;if(i){let s=Ic(e,i,{paragraphId:o,offset:0});if(!s.ok)return s}else kc(e,o);return e.revealParagraph(o),e.selectDrawing(r,o)?{ok:true,changed:false}:a}let n={paragraphId:t.blockId,offset:t.start};if(YH(t.scope)){let r=Ic(e,t.scope,n);if(!r.ok)return r}else {if(t.scope&&t.scope.kind!=="body")return {ok:false,code:"unsupported",reason:"the match scope cannot be opened"};kc(e,t.blockId);}return e.setSelection({anchor:n,head:{paragraphId:t.blockId,offset:t.start+t.length}}),e.revealParagraph(t.blockId),{ok:true,changed:false}}function Wa(e,t,n){let r=e.block??t,o=e.behavior??"instant",a=e.offsetPx??24;if(!["start","center","centerIfNeeded","nearest"].includes(r))throw new TypeError("block must be start, center, centerIfNeeded, or nearest.");if(!["instant","smooth"].includes(o))throw new TypeError("behavior must be instant or smooth.");if(!Number.isFinite(a)||a<0)throw new RangeError("offsetPx must be finite and nonnegative.");let i=n?.ownerDocument.defaultView?.matchMedia?.("(prefers-reduced-motion: reduce)").matches??false;return {block:r,offsetPx:a,behavior:i?"instant":o}}function GC(e,t,n=()=>null){return {scrollToPage(r){return !Number.isInteger(r)||r<1?false:(t(),e()?.revealPage(r-1)??false)},scrollToBlock(r,o){if(typeof r!="string"||r.length===0)return false;let a;try{a=Wa(o??{},"start",n());}catch{return false}t();let i=e();return i&&kc(i,r),i?.revealParagraph(r,a)??false}}}var XC="cubic-bezier(0.23, 1, 0.32, 1)";function Uo(e,t,n,r=1/0){let o=e??t;if(!Number.isFinite(o)||o<0||o>r)throw new RangeError(r===1/0?`${n} must be a finite, nonnegative number.`:`${n} must be finite and between 0 and ${r}.`);return o}function YC(e,t=180){if(e!==void 0&&typeof e!="boolean"&&(typeof e!="object"||e===null||Array.isArray(e)))throw new TypeError("animation must be a boolean or a durationMs settings object.");return e===false?0:Uo(typeof e=="object"?e.durationMs:void 0,e===true||typeof e=="object"?180:t,"animation.durationMs",1e4)}function Rc(e,t,{marker:n,defaultColor:r},o){let a=[],i=new Map,s=new Set,l=null,d=null,c=r,u=.14,p=4,m=6,h=0,y=r,g="solid",b="",S=180,x=180,I,M=XC,k,P=0,R=()=>{P++,k!==void 0&&clearTimeout(k),k=void 0;},w=Z=>{let F=t.container()?.ownerDocument.defaultView?.CSS??globalThis.CSS;if(Z!==void 0&&(typeof Z!="string"||!Z.trim()||/var\(|^(inherit|initial|unset|revert|revert-layer)$/i.test(Z.trim())||F?.supports&&!F.supports("animation-timing-function",Z)))throw new TypeError("animation.easing must be a CSS timing function without variables.");let L=t.container()?.ownerDocument.defaultView?.KeyframeEffect??globalThis.KeyframeEffect;if(Z!==void 0&&L)try{new L(null,[],{easing:Z});}catch{throw new TypeError("animation.easing must be one valid animation timing function.")}return Z},O=(Z,F)=>Uo(typeof Z=="object"?Z.exitDurationMs:void 0,F,"animation.exitDurationMs",1e4),N=(Z={})=>{if(Z.includePrevious!==void 0&&typeof Z.includePrevious!="boolean")throw new TypeError("includePrevious must be a boolean.");let F=Uo(Z.opacity,.14,"opacity",1),L=Uo(Z.padding,4,"padding"),B=Uo(Z.borderRadius,6,"borderRadius"),q=YC(Z.animation),X=O(Z.animation,q),D=w(typeof Z.animation=="object"?Z.animation.easing:void 0),j=Z.timeoutMs===null?null:Uo(Z.timeoutMs,3e3,"timeoutMs",2147483647),z=Z.color??r,ne=Uo(Z.borderWidth,0,"borderWidth"),re=Z.borderColor??z,ee=Z.borderStyle??"solid",ie=Z.className??"";if(!["solid","dashed","dotted"].includes(ee))throw new TypeError("borderStyle must be solid, dashed, or dotted.");if(typeof ie!="string")throw new TypeError("className must be a string.");let de=t.container()?.ownerDocument.defaultView?.CSS??globalThis.CSS;if(typeof z!="string"||!z.trim()||de?.supports&&!de.supports("color",z))throw new TypeError("color must be a CSS color or var() expression.");if(de?.supports&&!de.supports("color",`color-mix(in srgb, ${z} ${F*100}%, transparent)`))throw new TypeError("color must be valid inside color-mix(), including var() expressions.");if(typeof re!="string"||!re.trim()||de?.supports&&!de.supports("color",re))throw new TypeError("borderColor must be a CSS color or var() expression.");if(Z.changeIds!==void 0&&(!Array.isArray(Z.changeIds)||Z.changeIds.length>1e4||Z.changeIds.some(Re=>typeof Re!="string"||!Re)))throw new TypeError("changeIds must contain at most 10000 nonempty string IDs.");return {nextOpacity:F,nextPadding:L,nextRadius:B,nextDuration:q,nextExitDuration:X,nextEasing:D,nextTimeout:j,nextColor:z,nextBorderWidth:ne,nextBorderColor:re,nextBorderStyle:ee,nextClassName:ie}},A=()=>I||t.container()?.ownerDocument.defaultView?.getComputedStyle(t.container()).getPropertyValue("--doc-motion-ease-out").trim()||XC,V=Z=>{Z.animation&&(Z.animation.onfinish=null,Z.animation.cancel(),Z.animation=void 0);},W=(Z,F)=>{V(F),F.element.remove(),i.get(Z)===F&&i.delete(Z);},E=()=>(d||(d=t.container()?.ownerDocument.defaultView?.matchMedia?.("(prefers-reduced-motion: reduce)")??null,d?.addEventListener("change",G)),d?.matches??false),_=()=>{d?.removeEventListener("change",G),d=null;};function G(){if(d?.matches){for(let[Z,F]of i)V(F),F.exiting&&W(Z,F);i.size||_();}}let U=(Z,F,L,B,q=false)=>{if(!q&&F.target===L&&!F.exiting)return;let X=F.element.ownerDocument.defaultView,D=q?0:Number.parseFloat(X?.getComputedStyle(F.element).opacity??String(F.target));V(F),F.target=L,F.element.style.opacity=String(L);let j=E()?Math.min(B,125):B;if(j===0||typeof F.element.animate!="function"){F.exiting&&W(Z,F);return}try{let z=F.element.animate([{opacity:Number.isFinite(D)?D:L},{opacity:L}],{duration:j,easing:M});F.animation=z,z.onfinish=()=>{F.animation===z&&(F.animation=void 0,F.exiting&&W(Z,F),i.size||_());};}catch{F.exiting&&W(Z,F);}},$=()=>{l?.disconnect();let Z=t.surface(),F=t.container();if(!Z||!F||a.length===0)return;M=A();let L=new Set(a.map(j=>j.paragraphId)),B=e.getRenderScale(),q=e.snapshot().zoom,X=new Set,D=new Set;for(let j of Z.layout().pages){let z=F.querySelector(`[data-page-index="${j.index}"] > .docx-page-content`);if(z)for(let ne of chunk4GBTELJV_cjs.xa(j)){if(!L.has(ne.paragraphId))continue;let re=`${j.index}:${ne.id}`;X.add(re);let ee=chunk4GBTELJV_cjs.Ed(ne),ie=ne.lines.length&&!ne.clipToBox?1/0:ee.y,de=ne.lines.length&&!ne.clipToBox?-1/0:ee.y+ee.height;for(let tt of ne.clipToBox?[]:ne.lines)ie=Math.min(ie,tt.box.y),de=Math.max(de,tt.box.y+tt.box.height);let Re=ne.clipToBox?0:p*q,Ke=j.contentBox.x-j.box.x,pt=j.contentBox.y-j.box.y,ot=Math.max(-Ke*B,ee.x*B-Re),Le=Math.min((j.box.width-Ke)*B,(ee.x+ee.width)*B+Re);ie=Math.max(-pt*B,ie*B-Re),de=Math.min((j.box.height-pt)*B,de*B+Re);let Se=i.get(re);Se&&Se.element.parentElement!==z&&(W(re,Se),Se=void 0);let mt=!Se;if(!Se){let tt=F.ownerDocument.createElement("div");tt.setAttribute("data-docx-marker",""),tt.setAttribute(n,""),tt.setAttribute("contenteditable","false"),tt.setAttribute("aria-hidden","true"),tt.style.cssText="position:absolute;pointer-events:none;box-sizing:border-box;",Se={element:tt,paragraphId:ne.paragraphId,target:-1,exiting:false},i.set(re,Se),z.append(tt);}let xt=Se.exiting;Se.exiting=false,xt&&(Se.target=-1),Se.element.className=b,Object.assign(Se.element.style,{border:h?`${h*q}px ${g} ${y}`:"0",backgroundColor:`color-mix(in srgb, ${c} ${u*100}%, transparent)`,borderRadius:`${m*q}px`,left:`${ot}px`,top:`${ie}px`,width:`${Math.max(0,Le-ot)}px`,height:`${Math.max(0,de-ie)}px`}),U(re,Se,1,mt&&s.has(ne.paragraphId)?0:S,mt),D.add(ne.paragraphId);}}for(let j of D)s.add(j);for(let[j,z]of i)X.has(j)||(!z.element.isConnected||L.has(z.paragraphId)||x===0?W(j,z):z.exiting||(z.exiting=true,U(j,z,0,x)));l??=new MutationObserver($),l.observe(F,{childList:true,subtree:true});},pe=()=>{R(),a=[],s.clear(),l?.disconnect();for(let[Z,F]of i)W(Z,F);_();},he=(Z={})=>{let F=O(Z.animation,YC(Z.animation,x));M=w(typeof Z.animation=="object"?Z.animation.easing:void 0)??A(),R(),a=[],s.clear(),l?.disconnect();for(let[B,q]of i)q.exiting&&F>0||(q.exiting=true,U(B,q,0,F));i.size||_();};return e.on("selectionChange",()=>{a.length&&$();}),{show(Z,F={}){let{nextOpacity:L,nextPadding:B,nextRadius:q,nextDuration:X,nextExitDuration:D,nextEasing:j,nextTimeout:z,nextColor:ne,nextBorderWidth:re,nextBorderColor:ee,nextBorderStyle:ie,nextClassName:de}=N(F),Re=new Set(a.map(Ke=>Ke.paragraphId));if(s=new Set([...s].filter(Ke=>Re.has(Ke))),c=ne,h=re,y=ee,g=ie,b=de,u=L,p=B,m=q,S=X,x=D,I=j,a=Z,S===0)for(let Ke of i.values())Ke.exiting||V(Ke);if(!a.length){he();return}if($(),R(),z!==null){let Ke=P;k=setTimeout(()=>{Ke===P&&(k=void 0,he(),o());},z);}},validate:N,hide:he,clear:pe,repaint:$}}function QC(e,t){e.flushPendingInput();let n=an(e.session.part(),e.session.paragraphAnchors(),t);return n.ok?n.span:null}function JC(e,t,n){let r=null,o=a=>{if(r)return r;let i=e(),s=Rc(i,a,{marker:"data-docx-anchor-highlight",defaultColor:"var(--doc-anchor-highlight-color)"},()=>{});return a.invalidated.add(()=>s.clear()),i.on("change",l=>{l.source&&s.clear();}),r=s,s};return {scrollToAnchor(a,i={}){let s=t(),l=Wa(i,"centerIfNeeded",s?.container()??null);if(!Ct(a))return false;n();let d=s?.surface();if(!d)return false;let c=QC(d,a);return !!c&&d.revealPosition({paragraphId:c.nodeId,offset:c.start},l)},highlightAnchor(a,i){let s=t();if(!s)return false;let l=o(s);if(l.validate(i),!Ct(a))return false;n();let d=s.surface();if(!d||!s.container()||s.source)return false;let c=QC(d,a)?.nodeId;return !c||!d.layout().pages.some(p=>chunk4GBTELJV_cjs.xa(p).some(m=>m.paragraphId===c))?false:(l.show([{paragraphId:c}],i),true)},clearAnchorHighlight(a){let i=t();i&&o(i).hide(a);}}}function eE(e,t){if(!t.some(o=>o.scope?.kind==="frame"))return t;let n=e.publishedLayout();if(n.revision!==e.session.packageRevision())return t;let r=new Map;return t.filter(o=>{let a=o.scope;if(a?.kind!=="frame")return true;let i=`${a.drawingNodeId}\0${a.hostParagraphId}`,s=r.get(i);return s===void 0&&(s=!!Na(n,a.drawingNodeId,a.hostParagraphId),r.set(i,s)),s})}var QH=/^[A-Za-z][A-Za-z0-9_-]{0,63}$/,JH=/^-?[A-Za-z_][A-Za-z0-9_-]*$/,e8=1e4,tE=32,Cg=1e3;function t8(e,t,n){let r=e?.ownerDocument.defaultView?.CSS??globalThis.CSS;return !r?.supports||r.supports(t,n)}function nE(e,t,n){if(e!==void 0){if(typeof e!="string"||!e.trim()||!t8(n,"color",e))throw new TypeError(`${t} must be a CSS color or var() expression.`);return e}}function rE(e){if(typeof e!="string"||!QH.test(e))throw new TypeError('Highlight set names are 1 to 64 letters, digits, "-", or "_", starting with a letter.');return e}function n8(e,t,n,r,o){if(!Array.isArray(t))throw new TypeError("ranges must be an array of HighlightRange.");if(n!==void 0&&(typeof n!="object"||n===null))throw new TypeError("options must be an object.");let a=t.slice(0,e8),i=t.length-a.length,s=[],l=new Int32Array(a.length),d=new Int32Array(a.length);for(let[g,b]of a.entries()){if(!(typeof b=="object"&&b!==null&&typeof b.blockId=="string"&&b.blockId.length>0&&Number.isSafeInteger(b.start)&&b.start>=0&&Number.isSafeInteger(b.length)&&b.length>=0&&b.start+b.length<=2147483647&&(b.expectedText===void 0||typeof b.expectedText=="string")))throw new TypeError(`ranges[${g}] must have a blockId string, nonnegative integer start and length, and an optional expectedText string.`);s.push(b.blockId),l[g]=b.start,d[g]=b.start+b.length;}let c=n?.activeIndex??-1;if(!Number.isInteger(c)||c<-1)throw new RangeError("activeIndex must be an integer of -1 or more.");let u=n?.priority??0;if(!Number.isInteger(u)||Math.abs(u)>Cg)throw new RangeError(`priority must be an integer from -${Cg} to ${Cg}.`);let p=n?.className??"";if(typeof p!="string")throw new TypeError("className must be a string.");let m=p.split(/\s+/).filter(Boolean);if(m.some(g=>!JH.test(g)))throw new TypeError("className must hold space-separated CSS class names.");let h=nE(n?.color,"color",o),y=nE(n?.activeColor,"activeColor",o);return {name:e,ranges:a,overflow:i,blockIds:s,starts:l,ends:d,...h!==void 0?{color:h}:{},...y!==void 0?{activeColor:y}:{},activeIndex:c,classes:m,priority:u,order:r,expected:null,seen:new Array(a.length).fill(null),resolved:new Uint8Array(a.length),live:new Uint8Array(a.length),checkedAt:null}}function r8(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e.charCodeAt(r)===t.charCodeAt(r);)r+=1;let o=0;for(;o<n-r&&e.charCodeAt(e.length-1-o)===t.charCodeAt(t.length-1-o);)o+=1;return {from:r,oldTo:e.length-o,delta:t.length-e.length}}function o8(e,t,n){return t<=n.from?0:e>=n.oldTo?n.delta:0}var Ag=new WeakMap,dE=new WeakMap,oE=new WeakSet,Eg=new WeakMap,Og=new WeakMap;function a8(e,t){return Ag.has(e)?Ag.get(e):typeof e.expectedText=="string"?e.expectedText:(Eg.has(e)||Eg.set(e,t),Eg.get(e))}var Mg=new WeakMap;function cE(e){let t=new Map;return n=>{if(t.has(n))return t.get(n);let r=Ae(e.session,n),o=r?chunkFIJZIQXA_cjs.Ta(r,n):null,a=null;return r&&o&&(Mg.has(o)?a=Mg.get(o):(a=chunkFIJZIQXA_cjs.Vi(r,n),Mg.set(o,a))),t.set(n,a),a}}function aE(e,t,n){let r=t.session,o=r.packageRevision(),a=e.checkedAt;if(a?.session===r&&a.revision===o&&a.layout===n)return;let i=cE(t),s=chunk4GBTELJV_cjs.Ce(n),l=e.expected===null,d=e.expected??new Array(e.ranges.length).fill(null),c=new Map;for(let u=0;u<e.ranges.length;u+=1){let p=e.ranges[u],m=e.ends[u]>e.starts[u]?i(e.blockIds[u]):null;if(!l&&m!==null&&m===e.seen[u]){e.live[u]=e.resolved[u]&&s.has(e.blockIds[u])?1:0;continue}let h=l?dE.get(p)??Og.get(p)??m:e.seen[u];if(m!==null&&h!==null&&h!==m){let x=e.blockIds[u],I=c.get(x);I?.seen!==h&&(I={seen:h,edit:r8(h,m)},c.set(x,I));let M=o8(e.starts[u],e.ends[u],I.edit);e.starts[u]=e.starts[u]+M,e.ends[u]=e.ends[u]+M;}e.seen[u]=m;let y=e.starts[u],g=e.ends[u],b=m!==null&&g<=m.length?m.slice(y,g):null;if(!l&&m!==null&&b!==d[u]&&h!==null){let x=m.length-h.length,I=y+x>=0?m.slice(y+x,g+x):null;x!==0&&I!==null&&I===d[u]&&(e.starts[u]=y+x,e.ends[u]=g+x,b=I);}l&&(d[u]=a8(p,b),m!==null&&!Og.has(p)&&Og.set(p,m));let S=b!==null&&b===d[u];e.resolved[u]=S?1:0,e.live[u]=S&&s.has(e.blockIds[u])?1:0;}e.expected=d,e.checkedAt={session:r,revision:o,layout:n};}var iE=new WeakMap,sE=new WeakMap,lE=new WeakMap;function i8(e){let t=new Map;for(let n=0;n<e.ranges.length;n+=1){if(!e.live[n])continue;let r=e.blockIds[n],o=t.get(r)??[];o.push({key:n,start:e.starts[n],end:e.ends[n]}),t.set(r,o);}return t}function s8(e,t,n,r,o){let a=t.children[n];a||(a=e.createElement("div"),a.style.position="absolute",t.append(a));let i=r.index===o.activeIndex,s=`${r.index}|${i?1:0}|${r.left}|${r.top}|${r.width}|${r.height}`;lE.get(a)?.key!==s&&(a.className=i?"docx-text-highlight docx-text-highlight--active":"docx-text-highlight",o.classes.length>0&&a.classList.add(...o.classes),a.setAttribute("data-highlight-index",String(r.index)),a.style.left=`${r.left}px`,a.style.top=`${r.top}px`,a.style.width=`${r.width}px`,a.style.height=`${r.height}px`,lE.set(a,{key:s}));}function l8(e){return e?[...e].sort((t,n)=>t-n).join(","):"*"}function d8(e){return e?[...e].map(([t,n])=>`${t}:${n}`).join(","):""}function uE(e){let t=new Map,n=0,r=0,o=[],a=null,i=null,s=null,l=null,d=()=>[...t.values()].sort((g,b)=>g.priority-b.priority||g.order-b.order);function c(g){let b=e.surface();if(a=g.layer,l=g,!b||t.size===0){g.layer.childElementCount>0&&g.layer.replaceChildren(),o=[],i=null;return}let S=d();for(let w of S)aE(w,b,g.layout);let x=qo(g.layout),I=[r,b.session.packageRevision(),l8(g.pages),g.scale,d8(g.pageOffsetX)].join("|");if(I===i&&x===s&&g.layer.childElementCount>0)return;i=I,s=x;let M=g.layer.ownerDocument,k=[],P=[];for(let w of S){let O=u(w,x,g),N=p(M,w),A=0;for(let V of O){let W=x.pages[V.pageIndex];if(!W)continue;let E=g.pageOffsetX?.get(V.pageIndex)??0,_={set:w,index:V.key,left:(W.contentBox.x+V.x+E)*g.scale,top:(W.contentBox.y+V.y)*g.scale,width:V.width*g.scale,height:V.height*g.scale};s8(M,N,A,_,w),A+=1,P.push(_);}for(;N.childElementCount>A;)N.lastElementChild.remove();k.push(N);}let R=g.layer.children;(R.length!==k.length||k.some((w,O)=>R[O]!==w))&&g.layer.replaceChildren(...k),o=P;}function u(g,b,S){let x=iE.get(g);x||(x=new WeakMap,iE.set(g,x));let I=[],M=new Map;for(let P of b.pages)S.pages&&!S.pages.has(P.index)||(I.push(P),x.has(P)||M.set(P.index,{page:P,rects:[]}));if(M.size>0){let P=chunk4GBTELJV_cjs.Be(b,i8(g),new Set(M.keys()),S.measurer);for(let R of P)M.get(R.pageIndex).rects.push(R);for(let{page:R,rects:w}of M.values())x.set(R,w);}let k=[];for(let P of I)for(let R of x.get(P))k.push(R);return g.activeIndex>=0&&k.sort((P,R)=>+(P.key===g.activeIndex)-+(R.key===g.activeIndex)),k}function p(g,b){let S=sE.get(b);if(S)return S;let x=g.createElement("div");return x.className="docx-text-highlight-set",x.setAttribute("data-highlight-set",b.name),b.color&&x.style.setProperty("--doc-text-highlight-set-color",b.color),b.activeColor&&x.style.setProperty("--doc-text-highlight-set-active-color",b.activeColor),sE.set(b,x),x}function m(){r+=1,e.surface()?.repaintHighlights();}function h(g){let b=e.surface();if(!b)return {applied:0,unavailable:g.ranges.length+g.overflow};let S=b.publishedLayout();aE(g,b,S);let x=S.revision!==b.session.packageRevision(),I=0;for(let M=0;M<g.ranges.length;M+=1)I+=x?g.resolved[M]:g.live[M];return {applied:I,unavailable:g.ranges.length-I+g.overflow}}return {members:{setHighlights(g,b,S){rE(g),Array.isArray(b)&&b.length>0&&e.flushOpen();let x=t.get(g),I=n8(g,b,S,x?.order??n,e.container());if(!x&&I.ranges.length>0&&t.size>=tE)throw new RangeError(`At most ${tE} highlight sets exist at once.`);if(I.ranges.length===0)return x&&(t.delete(g),m()),{applied:0,unavailable:0};x||(n+=1),t.set(g,I);let M=h(I);return m(),M},clearHighlights(g){if(g===void 0){if(t.size===0)return;t.clear();}else if(!t.delete(rE(g)))return;m();},getHighlightsAt(g,b){if(!Number.isFinite(g)||!Number.isFinite(b))return [];let S=a;if(!S?.isConnected||o.length===0)return [];let x=S.getBoundingClientRect(),I=g-x.left,M=b-x.top,k=[],P=new Set;for(let R=o.length-1;R>=0;R-=1){let w=o[R];if(I<w.left||I>=w.left+w.width||M<w.top||M>=w.top+w.height)continue;let O=`${w.set.name}\0${w.index}`;if(P.has(O)||t.get(w.set.name)!==w.set)continue;P.add(O);let N=x.left+w.left,A=x.top+w.top;k.push({name:w.set.name,index:w.index,range:w.set.ranges[w.index],start:w.set.starts[w.index],length:w.set.ends[w.index]-w.set.starts[w.index],active:w.index===w.set.activeIndex,rect:{x:N,y:A,left:N,top:A,width:w.width,height:w.height,right:N+w.width,bottom:A+w.height}});}return k}},frame:()=>{let g=e.surface();if(!l||!g)return l;let b=g.session.packageRevision();if(l.layout.revision===b)return l;let S=g.layout();return l.layout===S?l:{...l,layout:S,revision:b}},noteMatches(g){let b=e.surface();if(!b||oE.has(g))return g;let S=eE(b,g);oE.add(S);let x=cE(b);for(let I of S){let M=x(I.blockId);M!==null&&dE.set(I,M);let k=I.start+I.length;Ag.set(I,M!==null&&k<=M.length?M.slice(I.start,k):null);}return S},attach(g,b=false){i=null,l=null,b&&t.clear(),g?.setHighlightPainter(c);},reset(){t.size!==0&&(t.clear(),m());}}}var fE=new WeakMap;function pE(e){let t=fE.get(e);if(t)return t;let n=new Map,r=new Map,o=(s,l)=>{if(n.has(l))return;let d=r.get(s);d||(d=[],r.set(s,d)),n.set(l,{story:s,index:d.length}),d.push(l);},a=(s,l)=>{for(let d of chunk4GBTELJV_cjs.ya(l)){for(let c of d.lines)for(let u of chunk4GBTELJV_cjs.Ma(c))o(s,u.paragraphId);d.lines.length===0&&o(s,d.paragraphId);}};for(let s of e.pages){a("body",s.fragments);for(let l of [s.header,s.footer])l&&a(`part:${l.partName}`,l.fragments);for(let l of [s.footnotes,s.endnotes])for(let d of l?.notes??[])a(`notes:${d.noteKind}`,d.fragments);}let i={positions:n,paragraphs:r};return fE.set(e,i),i}function c8(e,t,n,r){let o=(c,u,p)=>{if(p<=u)return;let m=r.get(c);m?m.push({key:t,start:u,end:p}):r.set(c,[{key:t,start:u,end:p}]);},{start:a,end:i}=e;if(a.paragraphId===i.paragraphId){o(a.paragraphId,a.offset,i.offset);return}let s=n.positions.get(a.paragraphId),l=n.positions.get(i.paragraphId);if(o(a.paragraphId,a.offset,Number.POSITIVE_INFINITY),o(i.paragraphId,0,i.offset),!s||!l||s.story!==l.story||l.index<=s.index)return;let d=n.paragraphs.get(s.story);for(let c=s.index+1;c<l.index;c+=1)o(d[c],0,Number.POSITIVE_INFINITY);}function u8(e,t){if(e.start.paragraphId===e.end.paragraphId)return e.end.offset-e.start.offset;let n=t.positions.get(e.start.paragraphId),r=t.positions.get(e.end.paragraphId);return !n||!r||n.story!==r.story?Number.MAX_SAFE_INTEGER:(r.index-n.index)*1e6+(e.end.offset-e.start.offset)}function f8(e){let t=e.item;return t.kind==="revision"?t.ranges:t.range?[t.range]:[]}var mE={comment:0,custom:1,revision:2};function gE(e,t){let n=new Map,r=[];return e.forEach((o,a)=>{for(let i of f8(o)){let s=r.length;r.push({placement:a,width:u8(i,t)}),c8(i,s,t,n);}}),{byParagraph:n,sources:r}}function hE(e,t){return !e.pages||e.pages.has(t.index)}function yE(e,t,n,r){let o=e.pageOffsetX?.get(n.index)??0,a=t.left+(n.contentBox.x+r.x+o)*e.scale,i=t.top+(n.contentBox.y+r.y)*e.scale,s=r.width*e.scale,l=r.height*e.scale;return {x:a,y:i,left:a,top:i,width:s,height:l,right:a+s,bottom:i+l}}function bE(e){function t(){let n=e.frame();return !n?.layer.isConnected||!(n.scale>0)?null:{frame:n,origin:n.layer.getBoundingClientRect()}}return {getReviewItemsAt(n,r,o){if(!Number.isFinite(n)||!Number.isFinite(r))return [];let a=t();if(!a)return [];let{frame:i,origin:s}=a,l=(n-s.left)/i.scale,d=(r-s.top)/i.scale,c=i.layout.pages.find(I=>{if(!hE(i,I))return false;let M=I.box.x+(i.pageOffsetX?.get(I.index)??0);return l>=M&&l<M+I.box.width&&d>=I.box.y&&d<I.box.y+I.box.height});if(!c)return [];let u=e.placements(o);if(u.length===0)return [];let p=pE(i.layout),{byParagraph:m,sources:h}=gE(u,p),y=l-(i.pageOffsetX?.get(c.index)??0)-c.contentBox.x,g=d-c.contentBox.y,b=new Map,S=chunk4GBTELJV_cjs.Be(qo(i.layout),m,new Set([c.index]),i.measurer);for(let I of S){if(y<I.x||y>=I.x+I.width||g<I.y||g>=I.y+I.height)continue;let M=h[I.key],k=b.get(M.placement);(!k||M.width<k.width)&&b.set(M.placement,{width:M.width,rect:I});}let x=[...b.entries()].map(([I,M])=>({at:I,...M}));return x.sort((I,M)=>{if(I.width!==M.width)return I.width-M.width;let k=u[I.at],P=u[M.at];if(k.kind!==P.kind)return mE[k.kind]-mE[P.kind];if(k.kind==="revision"&&P.kind==="revision"){let R=P.item.nesting-k.item.nesting;if(R!==0)return R}return I.at-M.at}),x.map(I=>({placement:u[I.at],rect:yE(i,s,c,I.rect)}))},getReviewItemRects(n){if(typeof n!="string"||n.length===0)return [];let r=t();if(!r)return [];let{frame:o,origin:a}=r,i=ao(e.placements,n);if(!i)return [];let s=new Set(o.layout.pages.filter(d=>hE(o,d)).map(d=>d.index)),{byParagraph:l}=gE([i],pE(o.layout));return chunk4GBTELJV_cjs.Be(qo(o.layout),l,s,o.measurer).map(d=>yE(o,a,o.layout.pages[d.pageIndex],d))}}}var vE=new WeakMap;function Fg(e,t){let n=t(e?.matches??[]);return vE.set(n,e?.truncated??false),n}function xE(e){return vE.get(e)}function p8(e){return e==="password"?{ok:false,code:"locked",reason:wE}:e==="other-restriction"?{ok:false,code:"locked",reason:"this document declares a different editing restriction; open it in Word to change that"}:e==="no-change"?{ok:false,code:"invalidArgs",reason:"the document protection is already set"}:{ok:false,code:"unsupported",reason:"document protection could not be written"}}var wE="this document is protected with a password; open it in Word to change that";function SE(e){let t=null,n=null,r=()=>{let l=e.tracking();return [l.restrictedToReadOnly,l.restrictedToComments,l.restrictedToForms,l.restrictedToTrackedChanges].join("|")},o,a=null,i=()=>{let l=e.surface();if(!l)return null;let d=l.session.settingsRoot();return (d!==o||a===null)&&(o=d,a=d?chunkFIJZIQXA_cjs.Lg(d):chunkFIJZIQXA_cjs.Kg),a},s=()=>{if(e.destroyed())return {ok:false,code:"notFound",reason:"the editor was destroyed"};let l=i();return l===null?{ok:false,code:"notFound",reason:"no document is loaded"}:e.hostViewOnly()?{ok:false,code:"locked",reason:"this document was opened for viewing"}:l.enforced&&l.password?{ok:false,code:"locked",reason:wE}:!l.enforced&&l.edit!=="none"&&l.edit!=="forms"?{ok:false,code:"locked",reason:"this document declares a different editing restriction; open it in Word to change that"}:null};return {sync(){let l=e.surface()?.session.settingsRoot()??null;if(l===n&&t!==null)return;n=l;let d=r();d!==t&&(t=d,e.adopt(e.decision()));},prime:()=>{n=e.surface()?.session.settingsRoot()??null,t=r();},state:i,isActive:()=>i()?.enforced===true,can(l){return l.type!=="toggleDocumentProtection"?null:s()??{ok:true}},exec(l){if(l.type!=="toggleDocumentProtection")return null;let d=s();if(d&&!d.ok)return d;let c=e.surface(),u=!i().enforced,p=c.applyHeaderFooterLifecycle?.({op:"setDocumentProtection",enforce:u});return p?p.ok?(e.publish(),{ok:true,changed:true}):p8(p.reason):{ok:false,code:"unsupported",reason:"document protection is not available"}}}}function IE(e,t){return ff(e.revisionsIn,t)}function kE(e,t){let n=Kl(e);return {current:()=>n,set(r){if(!t.enabled)return {ok:false,code:"unsupported",reason:ln};let o;try{o=Kl(r,n);}catch(i){return {ok:false,code:"invalidArgs",reason:i.message}}if(o===n)return {ok:true,changed:false};let a=n;return n=o,t.changed(n,a),{ok:true,changed:false}},shows:r=>r.some(o=>IE(n,o)),opensOnLoad:r=>n.opening==="auto"&&r.some(o=>IE(n,o)),opensOnTrackedChange:()=>n.opening==="auto"&&n.revisionsIn==="pane"}}var m8=e=>chunk4GBTELJV_cjs.xa(e);function PE(){let e=new WeakMap;return t=>{let n=e.get(t);if(n)return n;let r=chunk6APGXLBB_cjs.Y(t,m8);for(let o of t.pages){for(let a of [o.header,o.footer])a&&RE(r,a.fragments,o.index,a.box.y);for(let a of [o.footnotes,o.endnotes])if(a)for(let i of a.notes)RE(r,i.fragments,o.index,i.box.y);}return e.set(t,r),r}}function RE(e,t,n,r){for(let o of chunk4GBTELJV_cjs.ya(t))for(let a of chunk4GBTELJV_cjs.Pa(o))e.has(a)||e.set(a,{pageIndex:n,contentY:r,fragmentY:o.box.y,...o.lines?{lines:o.lines}:{}});}var TE=new WeakMap;function EE(e){let t=TE.get(e);if(t)return t;let n=new Map;for(let r of e.pages)for(let o of [r.footnotes,r.endnotes])if(o)for(let a of o.notes)for(let i of chunk4GBTELJV_cjs.ya(a.fragments))for(let s of chunk4GBTELJV_cjs.Pa(i))n.has(s)||n.set(s,a.scopeId);return TE.set(e,n),n}var CE=new WeakMap;function OE(e){let t=CE.get(e);if(t)return t;let n=new Map;for(let[r,o]of chunk4GBTELJV_cjs.Ra(e).entries())n.set(o,r);return CE.set(e,n),n}function ME(e){if(e==="")return;let t=globalThis.navigator?.clipboard;if(t?.writeText)try{t.writeText(e).catch(()=>{});}catch{}}function Lg(e,t){if(e===""&&(t===null||t===""))return;let n=globalThis.navigator?.clipboard;if(!n)return;let r=globalThis.ClipboardItem;if(t&&n.write&&r&&typeof Blob<"u")try{let o=new r({"text/plain":new Blob([e],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})});n.write([o]).catch(()=>{ME(e);});return}catch{}ME(e);}function g8(e){return typeof e=="object"&&e!==null&&"container"in e&&Array.isArray(e.path)}function h8(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function AE(e){return FE(e.children)}function FE(e){let t=[];for(let n of e)n.kind!=="textValue"&&(n.kind==="paragraph"||n.kind==="table"||chunkFIJZIQXA_cjs.Qb(n))&&t.push(n);return t}function y8(e){if(chunkFIJZIQXA_cjs.Qb(e))return FE(chunkFIJZIQXA_cjs.Tb(e));if(e.kind!=="table")return [];let t=[];for(let n of e.children)if(n.kind==="tableRow")for(let r of n.children)r.kind==="tableCell"&&t.push(...AE(r));return t}function b8(e,t,n){let r=t.container,o=r.part==="body"?{kind:"body"}:r.part==="header"||r.part==="footer"?{kind:"headerFooter",rId:r.rId}:{kind:"notesPart",noteKind:r.part==="footnote"?"footnote":"endnote"},a=e.session.partFor(o);if(!a)return {ok:false,code:"notFound",reason:"the target story was not found"};let i="noteId"in r?r.noteId:null,s=r.part==="body"?chunkFIJZIQXA_cjs.Qc(a):chunkFIJZIQXA_cjs.Oc(a).find(m=>r.part==="header"||r.part==="footer"?m.kind===r.part:m.kind==="note"&&chunkFIJZIQXA_cjs.yc(m.root)===i)?.root;if(!s||s.kind==="textValue")return {ok:false,code:"notFound",reason:"the target story was not found"};if(t.path.length===0)return {ok:false,code:"invalidArgs",reason:"DocLocation path must not be empty"};let l=AE(s),d;for(let m=0;m<t.path.length;m+=1){let h=t.path[m];if(!Number.isInteger(h)||h<0)return {ok:false,code:"invalidArgs",reason:"DocLocation indices must be non-negative"};if(d=l[h],!d)return {ok:false,code:"notFound",reason:`block index ${h} is out of range`};m<t.path.length-1&&(l=y8(d));}if(!d||d.kind!=="paragraph"||!chunkFIJZIQXA_cjs.Ta(a,d.id))return {ok:false,code:"invalidArgs",reason:"DocLocation must resolve to a paragraph"};let c=(chunkFIJZIQXA_cjs.Vi(a,d.id)??"").length,u=t.offset??(n==="start"?0:c);if(!Number.isInteger(u)||u<0||u>c)return {ok:false,code:"invalidArgs",reason:"DocLocation offset is outside the paragraph"};let p={paragraphId:d.id,offset:u};return {ok:true,selection:{anchor:p,head:p}}}function Pc(e,t,n){if(g8(t))return b8(e,t,n);if(!Ct(t))return {ok:false,code:"invalidArgs",reason:"unrecognized DocTarget endpoint"};let r=e.session.paragraphAnchors(),o=r.nodeByParaId.get(t.paraId.toUpperCase());if(!o)return {ok:false,code:"notFound",reason:"the paragraph was not found"};let a=kt(e.session,o,{kind:"body"}),i=e.session.partFor(a);if(!i)return {ok:false,code:"notFound",reason:"the target story was not found"};let s=an(i,r,t);if(!s.ok)return s;let l=n==="start"?s.span.start:s.span.end,d={paragraphId:s.span.nodeId,offset:l};return {ok:true,selection:{anchor:d,head:d}}}function Tc(e,t){if(!h8(t)){let o=Pc(e,t,"start");if(!o.ok)return o;let a=Pc(e,t,"end");return a.ok?{ok:true,selection:{anchor:o.selection.anchor,head:a.selection.head}}:a}let n=Pc(e,t.from,"start");if(!n.ok)return n;let r=Pc(e,t.to,"end");return r.ok?{ok:true,selection:{anchor:n.selection.anchor,head:r.selection.head}}:r}function v8(e){return e.evenPage?"even":e.firstPage?"first":"default"}function LE(e){return e.variant!==void 0?e.variant==="default"||e.variant==="first"||e.variant==="even"?e.variant:{ok:false,reason:"variant must be 'default', 'first', or 'even'"}:v8(e)}function Ng(e,t){let n=e.headerFooterState(),r=t.position??n?.editing??null;if(r!=="header"&&r!=="footer")return {ok:false,refusal:{ok:false,code:"invalidArgs",reason:"header/footer position is required when no furniture scope is open"}};let a=t.variant!==void 0||t.firstPage!==void 0||t.evenPage!==void 0?LE(t):n?.variant??"default";if(typeof a=="object"&&a.ok===false)return {ok:false,refusal:{ok:false,code:"invalidArgs",reason:a.reason}};let i=a,s=t.sectionIndex??n?.sectionIndex??0;return !Number.isInteger(s)||s<0?{ok:false,refusal:{ok:false,code:"invalidArgs",reason:"sectionIndex must be a non-negative integer"}}:{ok:true,sectionIndex:s,kind:r,variant:i}}function x8(e){let t=e??"rejected";return t==="first-section"||t.includes("first-section")?{ok:false,code:"invalidArgs",reason:"the first section cannot link to a previous header or footer"}:{ok:false,code:"invalidArgs",reason:`header/footer lifecycle refused: ${t}`}}function Os(e,t){if(typeof e.applyHeaderFooterLifecycle!="function")return {ok:false,code:"unsupported",reason:"header/footer lifecycle is not available"};let n=e.applyHeaderFooterLifecycle(t);return n.ok?{ok:true,changed:true}:x8(n.reason)}function Cc(e,t,n,r){let a=e.session.headerFooterResolutionBySection()[t];if(!a)return null;let s=(n==="header"?a.headers:a.footers).get(r);return s?{rId:s.rId,partName:s.partName,inherited:s.inherited,titlePage:a.titlePage,evenAndOddHeaders:a.evenAndOddHeaders}:null}function NE(e,t){if(typeof e.enterHeaderFooter!="function")return {ok:false,code:"unsupported",reason:"header/footer editing is not available"};let n=t.sectionIndex??0;if(!Number.isInteger(n)||n<0)return {ok:false,code:"invalidArgs",reason:"sectionIndex must be a non-negative integer"};let r=t.position,o=LE(t);if(typeof o=="object"&&o.ok===false)return {ok:false,code:"invalidArgs",reason:o.reason};let a=o,s=Cc(e,n,r,a)?.rId,l=false;if(!s){let c=Os(e,{op:"createHeaderFooter",sectionIndex:n,kind:r,variant:a,...a==="first"?{titlePage:true}:{},...a==="even"?{evenAndOddHeaders:true}:{}});if(!c.ok)return c;l=true,s=Cc(e,n,r,a)?.rId;}return s?e.enterHeaderFooter({rId:s,kind:r,sectionIndex:n,variant:a})?{ok:true,changed:l}:{ok:false,code:"invalidArgs",reason:"the header/footer relationship could not be opened"}:{ok:false,code:"notFound",reason:`no ${r} story is available to edit`}}function DE(e,t){let n=Ng(e,t);if(!n.ok)return n.refusal;let r=e.headerFooterState(),o=r?.rId,a=Os(e,{op:"deleteHeaderFooter",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});return a.ok&&o&&r?.editing===n.kind&&r.sectionIndex===n.sectionIndex&&r.variant===n.variant&&e.exitHeaderFooter(),a}function HE(e,t){let n=Ng(e,t);if(!n.ok)return n.refusal;if(n.sectionIndex===0)return {ok:false,code:"invalidArgs",reason:"the first section cannot link to a previous header or footer"};let r=e.headerFooterState(),o=r?.editing===n.kind&&r.sectionIndex===n.sectionIndex&&r.variant===n.variant,a=Os(e,{op:"linkToPrevious",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});if(!a.ok)return a;if(o){let i=Cc(e,n.sectionIndex,n.kind,n.variant);i?e.enterHeaderFooter({rId:i.rId,kind:n.kind,sectionIndex:n.sectionIndex}):e.exitHeaderFooter();}return a}function _E(e,t){let n=Ng(e,t);if(!n.ok)return n.refusal;let r=e.headerFooterState(),o=!!r&&r.editing===n.kind&&r.sectionIndex===n.sectionIndex&&r.variant===n.variant,a=r?.rId,i=Os(e,{op:"unlinkFromPrevious",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});if(!i.ok)return i;let s=Cc(e,n.sectionIndex,n.kind,n.variant);return o&&s&&s.rId!==a&&e.enterHeaderFooter({rId:s.rId,kind:n.kind,sectionIndex:n.sectionIndex}),i}function BE(e,t){let n=e.headerFooterState(),r=t.sectionIndex??n?.sectionIndex;return Os(e,{op:"setSectionFurnitureOptions",...r!==void 0?{sectionIndex:r}:{},...t.titlePage!==void 0?{titlePage:t.titlePage}:{},...t.evenAndOddHeaders!==void 0?{evenAndOddHeaders:t.evenAndOddHeaders}:{},...t.headerDistanceTwips!==void 0?{headerDistanceTwips:t.headerDistanceTwips}:{},...t.footerDistanceTwips!==void 0?{footerDistanceTwips:t.footerDistanceTwips}:{}})}function $E(e,t){return e.activeScope().kind!=="headerFooter"?{ok:false,code:"unsupported",reason:"insertPageField requires an open header or footer scope"}:typeof e.insertPageField!="function"?{ok:false,code:"unsupported",reason:"page field insertion is not available"}:e.insertPageField(t.field)?{ok:true,changed:true}:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"page field insertion was refused"}}function qE(e,t){let n=e.activeScope();return n.kind==="headerFooter"?{ok:false,code:"invalidArgs",reason:"cannot insert a note reference inside a header or footer"}:n.kind==="note"?{ok:false,code:"invalidArgs",reason:"cannot insert a note reference inside another note"}:typeof e.insertNote!="function"?{ok:false,code:"unsupported",reason:"insertNote is not available"}:e.insertNote(t.noteKind)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"insertNote was refused"}}function VE(e,t){return typeof e.deleteNote!="function"?{ok:false,code:"unsupported",reason:"deleteNote is not available"}:e.deleteNote(t.noteKind,t.noteId)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"deleteNote was refused"}}function KE(e,t){return typeof e.convertNote!="function"?{ok:false,code:"unsupported",reason:"convertNote is not available"}:e.convertNote(t.fromKind,t.noteId)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"convertNote was refused"}}function WE(e,t){return typeof e.convertAllNotes!="function"?{ok:false,code:"unsupported",reason:"convertAllNotes is not available"}:e.convertAllNotes(t.fromKind)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"convertAllNotes was refused"}}function jE(e,t){if(typeof e.setNoteProperties!="function")return {ok:false,code:"unsupported",reason:"setNoteProperties is not available"};let n=t.scope??"document";return e.setNoteProperties({scope:n,sectionIndex:t.sectionIndex,footnote:t.footnote,endnote:t.endnote})?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"setNoteProperties was refused"}}function zE(e,t,n){switch(t.type){case "toggleMark":{let r=gp.get(t.mark);e.toggleRunProperty(r.localName,r.attributes);break}case "setMarkAttr":{let r=hp(t);if(!r.ok)return {ok:false,code:r.code,reason:r.reason};e.setRunProperty(r.localName,r.attributes);break}case "clearFormatting":e.clearFormatting();break;case "copyFormatting":return e.formatPainter.capture()?{ok:true,changed:false}:{ok:false,code:"notFound",reason:ad};case "pasteFormatting":{let r=e.formatPainter.apply();if(r==="nothingToPaint")return {ok:false,code:"notFound",reason:Jf};if(r==="refused")return {ok:false,code:"locked",reason:e.state().lastRejection??Jf};break}case "setLineSpacing":e.setParagraphProperty("spacing",uc({rule:t.rule,value:t.value}),{mergeAttributes:true});break;case "setParagraphSpacing":e.setParagraphProperty("spacing",{...Va("before",t.beforePt),...Va("after",t.afterPt)},{mergeAttributes:true});break;case "setAlignment":e.setParagraphProperties([{localName:"jc",attributes:{val:t.align==="justify"?"both":t.align},physicalAlignment:true}]);break;case "setParagraphDirection":e.setParagraphProperties([{localName:"bidi",paragraphDirection:t.direction}]);break;case "setParagraphStyle":{if(!e.session.documentStyles().some(o=>o.type==="paragraph"&&o.styleId===t.styleId))return {ok:false,code:"invalidArgs",reason:`style '${t.styleId}' is not a paragraph style of this document`};e.setParagraphProperty("pStyle",{val:t.styleId});break}case "setIndent":{e.setIndent({...t.left!==void 0?{left:t.left}:{},...t.right!==void 0?{right:t.right}:{},...t.firstLine!==void 0?{firstLine:t.firstLine}:{}});break}case "setParagraphFormat":{if(!e.setParagraphFormat({...t.alignment!==void 0?{alignment:t.alignment==="justify"?"both":t.alignment}:{},...t.direction!==void 0?{direction:t.direction}:{},...t.spaceBeforePt!==void 0?{spaceBeforePt:t.spaceBeforePt}:{},...t.spaceAfterPt!==void 0?{spaceAfterPt:t.spaceAfterPt}:{},...t.lineSpacing!==void 0?{lineSpacing:t.lineSpacing}:{},...t.indentLeftTwips!==void 0?{indentLeftTwips:t.indentLeftTwips}:{},...t.indentRightTwips!==void 0?{indentRightTwips:t.indentRightTwips}:{},...t.indentFirstLineTwips!==void 0?{indentFirstLineTwips:t.indentFirstLineTwips}:{},...t.contextualSpacing!==void 0?{contextualSpacing:t.contextualSpacing}:{},...t.keepNext!==void 0?{keepNext:t.keepNext}:{},...t.keepLines!==void 0?{keepLines:t.keepLines}:{},...t.widowControl!==void 0?{widowControl:t.widowControl}:{},...t.pageBreakBefore!==void 0?{pageBreakBefore:t.pageBreakBefore}:{},...t.tabStops!==void 0?{tabStops:t.tabStops}:{}}))return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the paragraph format could not be written here"};break}case "setPageSetup":{let r;if(t.scope==="section"){let s=e.sectionAnchorParagraphAt(e.state().selection.head.paragraphId);if(s.kind==="unaddressable")return {ok:false,code:"unsupported",reason:"this section holds no paragraph to address it by"};r=s.kind==="anchor"?s.paragraphId:void 0;}let o=t.pageWidth,a=t.pageHeight;if(t.orientation!==void 0&&(o!==void 0||a!==void 0)){let s=r?e.sectionPropertiesAt(r):e.sectionProperties(),l=o??s.pageSize.widthTwips,d=a??s.pageSize.heightTwips;o=t.orientation==="landscape"?Math.max(l,d):Math.min(l,d),a=t.orientation==="landscape"?Math.min(l,d):Math.max(l,d);}if(!e.setSectionProperties({...o!==void 0?{pageWidthTwips:o}:{},...a!==void 0?{pageHeightTwips:a}:{},...t.orientation!==void 0?{orientation:t.orientation}:{},...t.marginTop!==void 0?{marginTopTwips:t.marginTop}:{},...t.marginRight!==void 0?{marginRightTwips:t.marginRight}:{},...t.marginBottom!==void 0?{marginBottomTwips:t.marginBottom}:{},...t.marginLeft!==void 0?{marginLeftTwips:t.marginLeft}:{},...r!==void 0?{anchorParagraphId:r}:{}}))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the page setup change was refused"};break}case "toggleList":if(!e.toggleList(t.kind))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the list change was refused"};break;case "adjustIndent":if(!e.adjustIndent(t.direction))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the selection is already at that indent level"};break;case "insertBreak":if(t.kind==="section"||t.kind==="sectionContinuous"){let r=t.kind==="section"?"nextPage":"continuous";if(!e.insertSectionBreak(r))return {ok:false,code:"invalidArgs",reason:e.sectionBreakRefusal(r)??e.state().lastRejection??"the section break was refused"};break}if(t.kind==="page"){e.insertPageBreak();break}e.insertLineBreak();break;case "insertHyperlink":{let r=t.href.startsWith("#");if(!e.hyperlinks.applyHyperlink({...r?{anchor:t.href.slice(1)}:{url:t.href},...t.text!==void 0?{text:t.text}:{}}))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the link was refused: the target is not an allowed scheme, or there is no text to link"};break}case "removeHyperlink":if(!e.hyperlinks.removeHyperlink())return {ok:false,code:"notFound",reason:"there is no hyperlink at the selection"};break;case "insertTextBox":return Hw(e);case "insertText":if(e.type(t.text),e.state().lastRejection==="the table of contents is generated and read-only"||e.state().lastRejection===Fd)return {ok:false,code:"invalidArgs",reason:e.state().lastRejection};break;case "deleteText":if(Bn(e))return Fp(e,{type:"deleteImage"},n?.editor);e.deleteSelection();break;case "proposeInsertion":case "proposeDeletion":case "proposeReplacement":{if(t.target!==void 0){let a=Tc(e,t.target);if(!a.ok)return {ok:false,code:a.code,reason:a.reason};e.setSelection(a.selection);}let r=t.type==="proposeInsertion"?"insertion":t.type==="proposeDeletion"?"deletion":"replacement",o=t.type==="proposeInsertion"?t.text:t.type==="proposeReplacement"?t.replaceWith:"";if(!e.proposeTextChange(r,o,t.author))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??`${t.type} was refused`};break}case "undo":e.undo();break;case "redo":e.redo();break;case "insertTable":if(!e.insertTable(t.rows,t.cols))return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the table could not be inserted here"};break;case "insertToc":if(!e.insertToc())return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the table of contents could not be inserted"};break;case "editTextFormField":return e.editTextFormField()?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"field options are unavailable"};case "refreshToc":if(!e.refreshToc(t.tocId,t.mode))return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the table of contents could not be refreshed"};break;case "editHeaderFooter":return NE(e,t);case "exitHeaderFooter":return typeof e.exitHeaderFooter=="function"&&e.exitHeaderFooter(),{ok:true,changed:false};case "removeHeaderFooter":return DE(e,t);case "linkHeaderFooterToPrevious":return HE(e,t);case "unlinkHeaderFooterFromPrevious":return _E(e,t);case "setHeaderFooterOptions":return BE(e,t);case "insertPageField":return $E(e,t);case "insertNote":return qE(e,t);case "deleteNote":return VE(e,t);case "convertNote":return KE(e,t);case "convertAllNotes":return WE(e,t);case "setNoteProperties":return jE(e,t);case "insertRow":case "deleteRow":case "insertColumn":case "deleteColumn":case "deleteTable":case "setCellFill":case "setTableCellVerticalAlignment":case "setTableBorders":case "commitTableColumnDividerResize":case "commitTableRightEdgeResize":case "mergeCells":case "splitCell":case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":{if(!Xr(t))return {ok:false,code:"unsupported",reason:"unsupported command"};let r=n?.admittedTablePlan??Tr({command:t,part:e.session.part(),layout:e.layout(),storeRevision:e.session.packageRevision(),selection:e.state().selection,cellSelection:e.state().cellSelection,themeColors:e.session.documentThemeColors(),editable:e.session.editable,viewing:e.editingMode()==="view"});return e.applyTableCommandPlan(r)}case "selectAll":return e.selectAll(),{ok:true,changed:false};case "copy":{let r=e.copyFlavours();return r.reason?{ok:false,code:"unsupported",reason:r.reason}:(Lg(r.text,r.html),{ok:true,changed:false})}case "cut":{let r=e.copyFlavours();if(r.reason)return {ok:false,code:"unsupported",reason:r.reason};Lg(r.text,r.html),e.deleteSelection();break}case "paste":{let r=t.html?ka(t.html):null;if(r&&Qd(r.bytes))return {ok:false,code:"unsupported",reason:"unsupported-content"};if(!e.pasteRich(t.text,t.html??null))return {ok:true,changed:false};break}case "pasteWithoutFormatting":e.insertPlainText(t.text);break;case "setSelection":{if("range"in t&&yp(t.range))return e.setSelection(t.range),e.revealPosition(t.range.head,{block:"centerIfNeeded"}),{ok:true,changed:false};let r="anchor"in t&&Ct(t.anchor)?{anchor:t.anchor}:"range"in t&&Do(t.range)?{range:t.range}:null;if(r===null)return {ok:false,code:"unsupported",reason:"unsupported selection form"};let o=aS(e.session.part(),e.session.paragraphAnchors(),r);if(!o.ok)return o;let a=I8(e,o.selection);return a.ok?(e.setSelection(o.selection),e.revealPosition(o.selection.head,{block:"centerIfNeeded"}),{ok:true,changed:false}):a}default:return ss(t)?Fp(e,t,n?.editor):{ok:false,code:"unsupported",reason:"unsupported command"}}return null}function ZE(e,t){for(let n of e.layout().pages)for(let r of [n.footnotes,n.endnotes])if(r){for(let o of r.notes)for(let a of chunk4GBTELJV_cjs.ya(o.fragments))if(a.paragraphId===t)return o.scopeId}return null}function w8(e,t){let n=e.layout().pages;for(let r=0;r<n.length;r+=1){let o=n[r];for(let a of [o.header,o.footer])if(a){for(let i of chunk4GBTELJV_cjs.ya(a.fragments))if(i.paragraphId===t)return {pageIndex:r,sectionIndex:e.sectionAtPage(r).sectionIndex}}}return null}function S8(e,t){return e.kind!==t.kind?false:e.kind==="headerFooter"&&t.kind==="headerFooter"?e.rId===t.rId:e.kind==="notesPart"&&t.kind==="notesPart"?e.noteKind===t.noteKind:true}function I8(e,t){let n=kt(e.session,t.head.paragraphId,{kind:"body"}),r=kt(e.session,t.anchor.paragraphId,{kind:"body"});if(!S8(n,r))return {ok:false,code:"unsupported",reason:"a selection cannot span two stories"};let o=e.activeScope();if(n.kind==="body")return o.kind!=="body"&&(e.exitNote?.(),e.exitHeaderFooter?.()),{ok:true,changed:false};if(n.kind==="headerFooter"){if(o.kind==="headerFooter"&&o.rId===n.rId)return {ok:true,changed:false};e.exitNote?.();let l=w8(e,t.head.paragraphId);return e.enterHeaderFooter?.({rId:n.rId,...l?{pageIndex:l.pageIndex,sectionIndex:l.sectionIndex}:{}})?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"that header or footer could not be opened"}}let a=ZE(e,t.head.paragraphId);return a?(t.anchor.paragraphId===t.head.paragraphId?a:ZE(e,t.anchor.paragraphId))!==a?{ok:false,code:"unsupported",reason:"a selection cannot span two stories"}:o.kind==="note"&&o.id===a?{ok:true,changed:false}:(e.exitHeaderFooter?.(),e.enterNote?.(a)?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"that note could not be opened"}):{ok:false,code:"notFound",reason:"that note is not laid out"}}var k8=new Set(["toggleMark","setMarkAttr","setAlignment","setParagraphDirection","clearFormatting","setLineSpacing","setParagraphSpacing","setParagraphStyle","setParagraphFormat"]),Ec=class{constructor(t,n,r){this.owner=t;this.diagnose=n;this.target=r;}owner;diagnose;target;records=new WeakMap;undoEpoch=0;burst;diagnoseWrites(t,n,r=false){if(t.type!=="setMarkAttr"||!n.ok||!n.changed)return;let o=`${r}:${t.mark}:${t.attr}:${this.target()}`,a=Date.now(),i=this.burst,s=i?.key===o&&a-i.time<=250?i.count+1:1;this.burst={key:o,time:a,count:s},s===3&&this.diagnose({kind:r?"possible-fragmented-gesture":"possible-ungrouped-gesture",reason:"Three rapid formatting writes started separate groups at the same selection. For a continuous control, retain one handle with bindHistoryGroup; separate clicks may be intentional."});}begin(){let t=this.owner(),n={token:Symbol("gesture"),owner:t?new WeakRef(t):void 0,closed:false,committed:false,undoEpoch:this.undoEpoch},r=R8(n,new WeakRef(this));return this.records.set(r,n),r}owns(t){return t!==void 0&&t===this.owner()}gate(t,n){let r=n?.historyGroup;return r===void 0?null:!this.records.get(r)||r.state!=="open"?{ok:false,code:"unsupported",reason:"historyGroup must be an open handle from this editor and document"}:k8.has(t.type)?null:{ok:false,code:"unsupported",reason:`${t.type} does not support history grouping`}}note(t){(t.type==="undo"||t.type==="redo")&&this.undoEpoch++;}run(t,n,r,o){let a=r?.historyGroup,i=a&&this.records.get(a);if(!i){let m=Ps(t,void 0,o);return this.diagnoseWrites(n,m),m}let s=i.committed,l,d,c=chunkFIJZIQXA_cjs.gl(i.token,(m,h)=>{l=m,d=h;},()=>Ps(t,i.token,o));if(!c.ok)return c;let p=l===void 0?{kind:"none",reason:"no-history"}:l==="split"||l==="started"&&s?{kind:"split",reason:d??(i.undoEpoch!==this.undoEpoch?"undo-redo":"history-boundary")}:{kind:l};return l&&(i.committed=true,i.undoEpoch=this.undoEpoch),p.kind==="started"?this.diagnoseWrites(n,c,true):this.burst=void 0,p.kind==="split"&&this.diagnose({kind:"split",reason:p.reason??"history-boundary"}),{...c,history:p}}};function R8(e,t){return Object.freeze({get state(){return !e.closed&&t.deref()?.owns(e.owner?.deref())?"open":"closed"},end(){e.closed=true,e.owner=void 0;}})}var UE={selection:null,pendingFormat:null,headerFooter:null,drawingIntent:"none",formatPainter:"off/none"};function GE(e,t){let n=t.headerFooterState?.();return {selection:e.selection,pendingFormat:e.pendingFormat,headerFooter:n?.editing&&n.rId?`${n.editing}:${n.rId}`:null,drawingIntent:kS(t.drawingSelectionIntent()),formatPainter:`${e.formatPainter.mode}/${e.formatPainter.level}`}}function XE(){let e={...UE};return {moved(t,n){let r=GE(t,n),o=ud(r.selection,e.selection)&&r.pendingFormat===e.pendingFormat&&r.headerFooter===e.headerFooter&&r.drawingIntent===e.drawingIntent&&r.formatPainter===e.formatPainter;return e=r,!o},adopt(t){e=GE(t.state(),t);},reset(){e={...UE};}}}function P8(e,t){let n=e.byteLength;if(n<22)return false;let r=new DataView(e.buffer,e.byteOffset,n),o=Math.max(0,n-(64*1024+22)),a=-1;for(let d=n-22;d>=o;d-=1)if(r.getUint32(d,true)===101010256){a=d;break}if(a<0)return false;let i=r.getUint16(a+10,true),s=r.getUint32(a+16,true),l=0;for(let d=0;d<i;d+=1){if(s+46>n||r.getUint32(s,true)!==33639248)return false;if(l+=r.getUint32(s+24,true),l>=t)return true;s+=46+r.getUint16(s+28,true)+r.getUint16(s+30,true)+r.getUint16(s+32,true);}return false}var T8=2e3,C8=40;function Dg(e){if(typeof MessageChannel!="function"){setTimeout(e,0);return}let t=new MessageChannel;t.port1.onmessage=()=>{t.port1.close(),e();},t.port2.postMessage(null);}function YE(e){let t=null,n=()=>{if(!t)return null;let{bytes:r}=t;return t.cancel(),t=null,r};return {shouldYield:r=>typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"&&(r.byteLength>=524288||P8(r,524288)),schedule(r){let o=null,a=null,i=e.prepare?()=>e.prepare(r):null,s=false,l=false,d=()=>{if(s)return;if(i){let m=i;i=null;let h;try{h=m();}catch{}if(typeof h=="function"){i=h,Dg(d);return}if(!h){o=setTimeout(d,0);return}let y=true,g=()=>{y&&(y=false,o!==null&&clearTimeout(o),o=setTimeout(d,0));};o=setTimeout(g,T8),h.then(g,g);return}l=true,e.mount(r);let p=()=>{if(!(s||t!==u)){if(e.continueOpen&&!e.continueOpen(C8)){Dg(p);return}t=null,e.continueOpen&&e.scheduled();}};e.continueOpen?Dg(p):t=null;},c=requestAnimationFrame(()=>{a!==null&&clearTimeout(a),a=null,o=setTimeout(d,0);});a=setTimeout(()=>{cancelAnimationFrame(c),d();},250);let u={bytes:r,mounted:()=>l,cancel:()=>{s=true,cancelAnimationFrame(c),o!==null&&clearTimeout(o),a!==null&&clearTimeout(a);}};t=u,e.scheduled();},cancel:n,flush(){let r=t;if(!r)return;let o=r.mounted();if(n(),o||e.mount(r.bytes),e.continueOpen)for(;!e.continueOpen(Number.POSITIVE_INFINITY););o&&e.scheduled();},isScheduled:()=>t!==null}}var _g=40,Hg=16,QE=32,Bg=new WeakMap;function E8(e,t,n){let r=chunkFIJZIQXA_cjs.De(e),o=()=>{let a=performance.now()+_g;for(;;){let i=r.next();if(i.done){let s=chunkSRPILEWV_cjs.k(i.value,t.reviewModel?{reviewModel:t.reviewModel}:{});return Bg.set(e,s),n(s)}if(performance.now()>=a)return o}};return o}function JE(e){let t=Bg.get(e);return t===void 0?{}:(Bg.delete(e),{openedSession:t,progressiveOpen:true})}function eO(e,t,n){return r=>E8(r,e(),o=>{let a=o.ok?t(r,o.session):null;return o.ok&&a?O8(o.session,a,n):void 0})}function tO(e){let t=null;return {set(n){t=n;let r=e();r&&om(r,n);},adopt:n=>om(n,t)}}function O8(e,t,n){let r=e.part().root.children.find(h=>h.kind==="body"),o=r?.kind==="body"?r.children:[],a=[];for(let h of o){if(h.kind==="table")for(let y of h.children)a.push(y);a.push(h);}let i=[];for(let h=0;h<o.length;){let y=o[h];if(y.kind==="table"){for(let S=0;S<y.children.length;S+=QE){let x=S;i.push(()=>{NC(e,y,x,x+QE);});}i.push(()=>wg(e,[y])),h+=1;continue}let g=h;for(;g<o.length&&g-h<Hg&&o[g].kind!=="table";)g+=1;let b=o.slice(h,g);i.push(()=>wg(e,b)),h=g;}let s=0,l=0,d=false,c,u=chunkFIJZIQXA_cjs.Pa(e.part().root),p=[()=>{let h=performance.now()+_g;return u(()=>performance.now()>=h)},()=>(e.reviewItems(),true)],m=()=>{if(!t())return;let h=performance.now()+_g;if(!d){for(;s<i.length&&performance.now()<h;)i[s++]();return s<i.length||(d=true,c=n()),m}if(l<a.length){for(;l<a.length&&performance.now()<h;)chunk4GBTELJV_cjs.Ee(a.slice(l,l+Hg)),l+=Hg;return m}let y=p[0];return y?(y()&&p.shift(),m):c};return m}function nO(e){return t=>{for(let n of e.customNodeDiagnostics)try{n(t);}catch{}}}function rO(e,t){t.customNodePayloadNamespaces.length!==0&&e.session.sweepCustomNodePayloads(t.customNodePayloadNamespaces);}function oO(e){return e.kind==="comment"}function aO(e){let{surface:t}=e,n=t?.retainedSelection()??t?.state().selection??null;if(!n)return null;let{anchor:r,head:o}=n;if(r.paragraphId===o.paragraphId&&r.offset===o.offset||!t?.publishedLayout())return null;let a=e.bodyOrder(),i=a.get(r.paragraphId)??-1,s=a.get(o.paragraphId)??-1;if(i===-1||s===-1){let d=e.openStoryOrder();i=d.get(r.paragraphId)??-1,s=d.get(o.paragraphId)??-1;}return i===-1||s===-1?null:i<s||i===s&&r.offset<=o.offset?{from:r,to:o}:{from:o,to:r}}function A8(e){let t=new Map;for(let n of e){let r=n.item;if(!oO(r))continue;let o=t.get(r.id);if(o===void 0){t.set(r.id,r);continue}if(o.comment!==r.comment)return "ambiguous"}return t}function F8(e,t){let n=e.filter(a=>a.key===t);if(n.length===0)return {ok:false,code:"notFound",reason:"no review item with that key"};let r=n.map(a=>a.item).filter(oO);if(r.length===0)return {ok:false,code:"kindMismatch",reason:"the review item is not a comment"};let o=r[0];for(let a of r)if(a.comment!==o.comment)return {ok:false,code:"ambiguous",reason:"duplicate comment records share that key"};return o}function iO(e,t,n){if(!e.reviewEnabled)return {ok:false,code:"unsupported",reason:e.proReviewReason};if(e.editingMode==="viewing")return {ok:false,code:"locked",reason:"the document is open for viewing"};let r=e.placements(),o=F8(r,t);if(!("kind"in o))return o;if(!e.surface)return {ok:false,code:"notFound",reason:"no review item with that key"};let a=A8(r);if(a==="ambiguous")return {ok:false,code:"ambiguous",reason:"duplicate comment records share an id"};let i=o,s=new Set;for(;i.parentId!==void 0&&!s.has(i.id);){s.add(i.id);let c=a.get(i.parentId);if(!c)break;i=c;}let l=false,d=false;return e.surface.commitReviewOps(()=>{let c=e.surface.session.packageRevision();return l=e.surface.session.setCommentResolved(i.id,n),d=l&&e.surface.session.packageRevision()!==c,{committed:d}},"comment-resolve"),l?(d&&e.bump(),{ok:true,changed:d}):{ok:false,code:"notFound",reason:"the comment could not be resolved"}}function sO(e,t,n){return e.kind==="comment"&&e.resolved?{ok:false,code:"unsupported",reason:"a resolved comment takes no replies"}:n.length===0||t.trim().length===0?{ok:false,code:"invalidArgs",reason:"a reply needs both an author and text"}:e.kind==="custom"?{ok:false,code:"unsupported",reason:"a custom node card takes no replies"}:null}var L8=Object.freeze(["Arial","Calibri","Cambria","Consolas","Courier New","Garamond","Georgia","Helvetica","Open Sans","Roboto","Times New Roman","Verdana"]),N8=/^[\p{L}\p{N}\p{M} \-.+_,;]{1,64}$/u;function lO(e,t){let n=new Map,r=s=>{if(s===void 0||!N8.test(s))return;let l=s.toLowerCase();n.has(l)||n.set(l,s);};r(chunkK5U2PLDP_cjs.g(e));let o=e?.substitutions??[],a=new Set(o.map(s=>s.to.family.toLowerCase()));for(let s of o)r(s.from.family);for(let s of e?.sources??[])a.has(s.request.family.toLowerCase())||r(s.request.family);for(let s of chunkK5U2PLDP_cjs.a([e?.supportedFamilies]))r(s);for(let s of L8)r(s);for(let s of t)r(s);let i=[...n.values()];return i.sort((s,l)=>s<l?-1:s>l?1:0),i}var dO=e=>new chunkUKVVUHZL_cjs.a("overLimit",`font source ${e.id} exceeds the font byte budget`,{request:e.request}),cO=e=>new chunkUKVVUHZL_cjs.a(e.reason,e.reason==="overLimit"?`embedded font ${e.request.family} (${e.partName}) exceeds the font byte budget`:`embedded font part ${e.partName} declares an invalid family name`,{request:e.request});function uO(e,t){return chunkK5U2PLDP_cjs.A(e,t)}function $g(e,t,n){return chunkK5U2PLDP_cjs.B(e,t,n)}var fO=Object.freeze({installed:0,alias:()=>{},dispose(){}});function D8(e){let t=0;for(let n of e)for(let r=0;r<n.length;r+=1)t=t*31+n.charCodeAt(r)>>>0;return `docx-embedded-${t.toString(36)}`}var Oc=e=>e.trim().toLowerCase();function H8(){let t=(typeof document<"u"?document:void 0)?.fonts;return !t||typeof FontFace>"u"?{}:{fontSet:t,createFontFace:(n,r,o)=>new FontFace(n,r.slice().buffer,o)}}async function pO(e,t=H8(),n=[]){let{fontSet:r,createFontFace:o}=t;if(!r||!o||e.length===0)return fO;let a=new Map;for(let d of e){let c=Oc(d.request.family),u=a.get(c);u?u.push(d):a.set(c,[d]);}let i=new Map,s=[];if(await Promise.all([...a].map(async([d,c])=>{let u=D8(c.map(m=>m.hash)),p=false;await Promise.all(c.map(async m=>{try{let h=o(u,m.bytes,{weight:String(m.request.weight),style:m.request.style});await h.load(),r.add(h),s.push(h),p=!0;}catch{}})),p&&i.set(d,u);})),s.length===0)return fO;for(let d of n){let c=Oc(d.from.family);if(i.has(c))continue;let u=i.get(Oc(d.to.family));u!==void 0&&i.set(c,u);}let l=false;return {installed:s.length,alias:d=>l?void 0:i.get(Oc(d)),dispose(){if(!l){l=true;for(let d of s)try{r.delete(d);}catch{}}}}}var Vg=44,Ms=.1,As=5;var ja={type:"fit",fit:"pageWidth",minZoom:.5,maxZoom:1},_8={type:"fit",fit:"pageWidth"},Mc={type:"fixed"};function Ac(e){return e==="auto"?ja:!e||typeof e!="object"?null:e.type==="fixed"?Mc:e.type==="fit"&&e.fit==="pageWidth"?Fc(e,ja)?ja:e:null}function Fc(e,t){return e===t?true:e.type!==t.type?false:e.type!=="fit"||t.type!=="fit"?true:e.fit===t.fit&&Object.is(e.minZoom,t.minZoom)&&Object.is(e.maxZoom,t.maxZoom)}function Kg(e,t,n="float"){return e?.type!=="fit"?t:n==="shrinkPage"?e.minZoom!==void 0&&Number.isFinite(e.minZoom)?qg(e.minZoom):.1:e.maxZoom!==void 0&&e.maxZoom<5?e.maxZoom:null}function Za(e){return e.type==="fit"}function mO({availableWidthPx:e,pageWidthPx:t,gutterPx:n=24,minZoom:r=.1,maxZoom:o=5}){if(!Number.isFinite(e)||e<=0||!Number.isFinite(t)||t<=0)return null;let a=Number.isFinite(n)&&n>0?n:0,i=Math.max(e-2*a,e*.5),s=Number.isFinite(r)?qg(r):.1,l=Number.isFinite(o)?qg(o):5,d=Math.floor(i/t*100)/100;return Math.min(Math.max(d,s),Math.max(l,s))}function qg(e){return Math.min(Math.max(e,.1),5)}var B8=88;function $8(e,t=false){let n=$t(e);if(!n)return null;let r=n.clientWidth;if(!Number.isFinite(r)||r<=0)return null;let o=n.ownerDocument.defaultView?.getComputedStyle(n);if(t&&n.hasAttribute("data-review-pane")){let s=Number.parseFloat(o?.getPropertyValue("--docx-review-strip")??""),l=Number.isFinite(s)?s:B8,d=l/2,c=Number.parseFloat(o?.getPropertyValue("--docx-nav-shift")??""),u=Number.parseFloat(o?.getPropertyValue("--docx-review-gutter-start")??""),p=(Number.isFinite(c)?c:0)+(Number.isFinite(u)?u:d)-d;return Math.max(r-l-Math.max(p,0),0)}if(!o)return r;let a=Number.parseFloat(o.paddingLeft)||0,i=Number.parseFloat(o.paddingRight)||0;return Math.max(r-a-i,0)}function gO(e){let t=null,n=null,r=null,o=null;function a(){if(r===null)return;n?.ownerDocument.defaultView?.cancelAnimationFrame(r),r=null;}function i(){let l=e.mode();if(!Za(l))return;let d=e.container();if(!d)return;let c=e.reviewPaneScrolls?.()===true&&Kg(l,e.zoom())!==null,u=$8(d,c);if(u===null)return;let p=e.pageWidthPx();if(p===null)return;o=e.pageWidthTwips();let m=mO({availableWidthPx:u,pageWidthPx:p,...l.minZoom!==void 0?{minZoom:l.minZoom}:{},...l.maxZoom!==void 0?{maxZoom:l.maxZoom}:{}});if(m===null||m===e.zoom())return;let h=$t(d),y=h!==null&&h.scrollLeft===0;e.applyZoom(m),y&&h&&h.scrollLeft!==0&&(h.scrollLeft=0);}function s(){let l=n?.ownerDocument.defaultView;if(!l?.requestAnimationFrame){i();return}r===null&&(r=l.requestAnimationFrame(()=>{r=null,i();}));}return {refitIfPageResized(){let l=e.pageWidthTwips();l===null||l===o||i();},attach(){this.detach();let l=e.container();if(!l)return;let d=$t(l);d&&(n=d,typeof ResizeObserver<"u"&&(t=new ResizeObserver(s),t.observe(d)),i());},refit:i,detach(){a(),t?.disconnect(),t=null,n=null,o=null;}}}function yO(e,t){let n=e.zoom!==void 0&&Number.isFinite(e.zoom)&&e.zoom>=.1&&e.zoom<=5?e.zoom:null,r=n??1,o=Ac(e.zoomMode??(n!==null?Mc:"auto"))??ja;function a(l,d){if(l===r)return d?.(),true;let c=t.surface();return c&&!nm(c,l*(96/72))?false:(r=l,d?.(),t.bump(),t.emitSelectionChange(),true)}function i(){o=Mc,s.detach();}let s=gO({container:t.container,mode:()=>o,pageWidthPx:()=>{let l=t.surface()?.layout().pages[0]?.box;return l?l.width*(96/72):null},pageWidthTwips:()=>t.surface()?.sectionProperties().pageSize.widthTwips??null,zoom:()=>r,applyZoom:l=>{a(l);},reviewPaneScrolls:()=>t.reviewPaneScrolls?.()===true});return {zoom:()=>r,mode:()=>o,scale:()=>r*(96/72),attach:()=>{Za(o)&&s.attach();},detach:()=>s.detach(),refit:()=>s.refit(),refitIfPageResized:()=>s.refitIfPageResized(),setZoom(l){if(!Number.isFinite(l)||l<.1||l>5)return {ok:false,code:"invalidArgs",reason:`zoom must be between ${.1} and ${5}, got ${l}`};let d=Za(o);return l===r?d?(i(),t.bump(),t.emitSelectionChange(),{ok:true,changed:true}):{ok:true,changed:false}:a(l,d?i:void 0)?{ok:true,changed:true}:{ok:false,code:"unsupported",reason:`the mounted surface could not apply zoom ${l}`}},setZoomMode(l){let d=Ac(l);return d?Fc(d,o)?{ok:true,changed:false}:(o=d,Za(d)?s.attach():s.detach(),t.bump(),t.emitSelectionChange(),{ok:true,changed:true}):{ok:false,code:"invalidArgs",reason:`unknown zoom mode ${JSON.stringify(l)}`}}}}function hO(e){let t=1.3333333333333333;return {x:e.x*t,y:e.y*t,width:e.width*t,height:e.height*t}}function bO(e,t){return {getZoom:()=>e.zoom(),setZoom:n=>e.setZoom(n),getZoomMode:()=>e.mode(),setZoomMode:n=>e.setZoomMode(n),getRenderScale:()=>e.scale(),getPageGeometry:()=>{let n=t();return n?n.layout().pages.map(r=>({index:r.index,box:hO(r.box),contentBox:hO(r.contentBox)})):[]}}}var vO=new Map;function xO(e){let t=e,n=null,r=null;return {current:()=>t,set:o=>{t=o;},authorsFor:o=>{if(n&&n.slots===o&&n.colors===t)return n.value;let a=chunkEO4C5QJW_cjs.c(o,t);return n={slots:o,colors:t,value:a},a},styleFor:o=>((!r||r.colors!==t)&&(r={colors:t,value:chunkEO4C5QJW_cjs.b(t)}),r.value.get(o))}}function Wg(e){let t=[];return {current:()=>t[t.length-1]??e,push:n=>(t.push(n),()=>{let r=t.lastIndexOf(n);r>=0&&t.splice(r,1);})}}function wO(e){let t=chunkFIJZIQXA_cjs.Ni(e),n=new Intl.Locale(t).baseName;for(;n&&!Object.hasOwn(i18n.locales,n);){let s=n.lastIndexOf("-");n=s<0?"":n.slice(0,s);}let r=new Intl.Locale(t).maximize(),o=n?void 0:Object.keys(i18n.locales).find(s=>{let l=new Intl.Locale(s).maximize();return l.language===r.language&&l.script===r.script}),a=n||o||"en",i=i18n.createT(i18n.deepMerge(i18n.en,a==="en"?void 0:i18n.locales[a]),a);return {locale:t,labels:{title:i("toolbar.tableOfContents")}}}function SO(e){let t=e.mode,n=e.translate,r=n?chunkEO4C5QJW_cjs.j(n):chunkEO4C5QJW_cjs.i,o=wO(e.locale);return {mode:()=>t,modeForGate:()=>t??"edit",openingModeDecision:a=>wp(t,a),setMode(a){return t===a?false:(t=a,true)},translate:()=>n,drawingStrings:()=>r,setTranslate(a){if(n===a)return null;n=a;let i=a?chunkEO4C5QJW_cjs.j(a):chunkEO4C5QJW_cjs.i;return chunkEO4C5QJW_cjs.h(r)===chunkEO4C5QJW_cjs.h(i)?(r=i,null):(r=i,r)},locale:()=>o.locale,tocLabels:()=>o.labels,setLocale(a){let i=wO(a);return o.locale===i.locale?null:(o=i,o.labels)}}}function IO(e,t){return {setTranslate(n){let r=e.setTranslate(n);t.surface()?.setTranslate(e.translate()),r!==null&&(t.surface()?.setDrawingStrings(r),t.bump(),t.emitSelectionChange());},setLocale(n){let r=e.setLocale(n);r!==null&&(t.surface()?.setLocale(e.locale()),t.surface()?.setTocLabels(r),t.bump(),t.emitSelectionChange());}}}var W8=Object.freeze({kind:"body"}),j8=Object.freeze([]);function Z8(e){let t,n=null,r=null,o=-1,a=()=>r!==null||!!E&&Dd(E),i=SO(e),s=ym(e.author),l=e.container??null,d=chunkNBCVVZOM_cjs.a(e.modules),c=nO(d),u=d.review!==null,p=kE(d.review?.pane,{enabled:u,changed:(C,Q)=>{At&&C.revisionsIn!==Q.revisionsIn&&!p.shows(E?.session.reviewItems()??[])&&(At=false),Fe(),ze(),Rt.refit();}}),m=null,h=new WeakMap,y=YE({mount:C=>Xo(C),continueOpen:C=>!E||am(E,C),prepare:eO(()=>Rg(d,c),(C,Q)=>n===C?null:(r=Q,()=>r===Q),()=>ie.schedule(true)),scheduled:()=>{Fe(),ze();}}),g=i.mode()==="view"?"viewing":"editing",b=null,S,x=false,I=zd(),M=xO(e.revisionStyles),k=chunkEO4C5QJW_cjs.e(),P=false,R=false,w=null,O=()=>({reviewEnabled:u,hasAuthor:!!s}),N=false,A=null,V=fS({stillMissing:()=>!L&&s===void 0&&Rn(null)===Yr,emit:C=>en(C)}),W=i.openingModeDecision(O());W.mode!==null&&(g=W.mode),W.rejection!==null&&(w=W.rejection),V.report(W.rejection);let E=null,_=null,G=tO(()=>E),U=null,$=null,pe=XE(),he=iC(),Z=Wg({}),F=Wg({}),L=false,B,q,X=null,D=()=>{},j=0;function z(){X?.dispose(),X=null;}let ne=0,re,ee=()=>typeof e.fonts=="function"?re:e.fonts,ie=_C(()=>{let C=r??E?.session;if(L||!C)return null;let Q=r?void 0:cr().formatting?.fontFamily;return {generation:ne,dynamic:typeof e.fonts=="function",families:()=>HC(C,Q,chunkK5U2PLDP_cjs.g(ee()))}},async C=>{let Q=r?{session:r}:E;Q&&await Gt(ne,Q,C);}),de=false,Re=null,Ke=C=>(Re||(Re=CC(l?Da(l.ownerDocument):null)),Re(C)),pt=new Set,ot=new Set,Le=C=>pt.has(C.toLowerCase())||X?.alias(C)!==void 0,Se=()=>!E||de?j8:OC(E.session.renderedFontFamilies(),Le,Ke,ot),mt=0,xt=null,tt,me=null,ue=-1,Te=0,Ie=-1,At=false,zt=e.reviewDisplayMode??(u?"all-markup":"proposed");if(!["all-markup","simple-markup","proposed","original"].includes(zt))throw new TypeError("Invalid reviewDisplayMode");if(e.reviewDisplayMode&&e.reviewDisplayMode!=="proposed"&&!u)throw new TypeError("reviewDisplayMode requires a review module");let Ye=Ud({fieldResults:e.fieldResults,collaborationModel:d.collaboration??void 0}),lr=jC(C=>{E?.setShowParagraphMarks(C),Fe(),ze();}),In=SE({surface:()=>E,destroyed:()=>L,editingMode:()=>g,hostViewOnly:()=>i.mode()==="view",publish:()=>{Fe(),ze();},decision:()=>Jo(),tracking:Un,adopt:C=>{w=C.rejection??Rn(null),C.mode!==null&&(R=C.mode==="viewing",Gn(C.mode)),Fe(),ze();}});function Fe(){mt+=1;}let Ze=aC(cr),{emitError:en,emitDocumentChange:Ut,emitSelectionChange:ze}=Ze,jn=sC(e.revisionMarkup,{container:()=>l,destroyed:()=>L,contribution:()=>d.review,translate:()=>i.translate(),apply:C=>{E?.setRevisionMarkup(C),Fe();},changed:C=>{ze(),Ze.emitRevisionMarkupChange(C);}});function Mr(){jn.destroyDialog(),$?.(),$=null,E?.destroy(),E=null,pe.reset(),Te+=1;}let Rt=yO(e,{container:()=>l,surface:()=>E,bump:Fe,emitSelectionChange:ze,reviewPaneScrolls:()=>p.current().overflow==="scroll"}),Ar=()=>Rt.scale(),dr=uE({surface:()=>E,container:()=>l,flushOpen:()=>y.flush()});function Xo(...C){let Q=t?.source!==void 0;try{if(n===C[0]){n=null,so(C[0],!0);return}Ls(...C),t?.mounted(C[0]);}catch(te){if(t?.mounted(C[0],te),!Q)throw te}}function Ls(C,Q,te){if(te??=h.get(C),h.delete(C),r=null,!l){m=C,te&&h.set(C,te),U=null,Fe();return}Mr();let we=I.stateKey,ke=dg(l,C,{scale:Ar(),showParagraphMarks:lr.get(),onToggleParagraphMarks:lr.toggle,defaultFontFamily:chunkK5U2PLDP_cjs.g(ee()),translate:i.translate(),drawingStrings:i.drawingStrings(),locale:i.locale(),...s?{author:s}:{},...M.current()!==void 0?{revisionStyles:M.current()}:{},reviewAuthorSlots:k,revisionAuthorVisibility:I,initialSelection:Q,initialTextFormInput:te,editingMode:g==="suggesting"?"suggest":g==="viewing"?"view":"edit",revisionDisplayMode:u?zt:"proposed",revisionMarkup:jn.current(),...Rg(d,c),...JE(C),...B?{measurer:B,...q?{producer:q}:{}}:{},...X?{fontAlias:X.alias}:{},...e.tableInteractionLabel?{tableInteractionLabel:e.tableInteractionLabel}:{},...e.imageDecodePort?{imageDecodePort:e.imageDecodePort}:{},...d.collaboration?{collaborationModel:d.collaboration}:{},...Ye.mode==="editable"?{fieldResults:Ye.mode}:{},onHyperlinkPopover:Oe=>Z.current().onPopover?.(Oe),...he.surfaceOptions,onRequestHyperlink:()=>Z.current().onRequest?.(),onEquationPopover:Oe=>F.current().onPopover?.(Oe),onTrackedChange:()=>{At||!p.opensOnTrackedChange()||(At=true,Fe(),ze());},tocLabels:i.tocLabels(),onChange:Oe=>{if(!E)return;Fe(),In.sync(),ie.schedule();let Ge=u&&zt!==E.revisionDisplayMode();Ge&&(zt=E.revisionDisplayMode());let oe=we!==I.stateKey||Ge;we=I.stateKey,!(!oe&&!pe.moved(Oe,E))&&ze();}});if(!ke.ok){U=ke.detail?`${ke.reason}: ${ke.detail}`:ke.reason,Fe(),en(sn(ke.reason,`failed to open document: ${U}`));return}U=null,E=ke.surface,o=ne,dr.attach(E,t?.source!==void 0),In.prime(),At=u&&p.opensOnLoad(E.session.reviewItems()),pe.adopt(E),A!==null?Xn(A,false):xe(),rO(E,d),Te+=1,E.setEditable(g!=="viewing"),_!==null&&E.setRemoteCaretLabelHost(_),G.adopt(E),b!==null&&E.setReviewActivationExclusions(b,{formattingKinds:S}),$=ke.surface.session.subscribe(Oe=>{let Ge={revision:ke.surface.session.packageRevision(),created:Oe.created,deleted:Oe.deleted,dirty:Oe.dirty};Rt.refitIfPageResized(),Fe(),Ut(Ge);}),t?.contentMounted(C),Rt.attach(),Fe(),Ut({revision:E.session.packageRevision(),source:t?.source??"load"}),ze(),ie.schedule(true);}function so(C,Q=false){if(y.cancel(),r=null,n=null,t?.source&&!Q&&l&&y.shouldYield(C)){n=C,y.schedule(C);return}if(h=new WeakMap,At=false,ne+=1,k=chunkEO4C5QJW_cjs.e(),I.showAll(),B=void 0,q=void 0,re=void 0,pt=new Set,ot=new Set,z(),D(),D=()=>{},de=false,l&&!t?.source){let te=$t(l);te&&(te.scrollTop=0,te.scrollLeft=0);}!Q&&l&&y.shouldYield(C)?(Mr(),y.schedule(C)):Xo(C);}function Zn(C){(C.code==="wasmUnavailable"||C.cause instanceof chunk6APGXLBB_cjs.f&&C.cause.code==="unsupportedRuntime")&&!e.onFontError&&!Ze.hasErrorHandlers()&&x0(C);try{e.onFontError?.(C);}catch{}en(C);}async function Gt(C,Q,te){let we=e.fonts,ke=Q.session.embeddedFonts();if(!(!we&&ke.length===0)){de=true,Fe();try{let{plan:Oe,request:Ge}=chunkK5U2PLDP_cjs.y(Q.session,te,ee()),oe=typeof we!="function"?we:re?await chunkK5U2PLDP_cjs.n([re,chunkK5U2PLDP_cjs.j(Ve=>we(Ve))],Ge,{onOriginFailure:({cause:Ve})=>Zn(Sa(Ve))}):await we(Ge),Ce=typeof we=="function"?chunkK5U2PLDP_cjs.b(oe):oe;if(L||C!==ne){C===ne&&(de=!1);return}if(re=oe,ke.length===0&&(!Ce||oe?.supportedFamilies?.length&&!chunkK5U2PLDP_cjs.b(oe))){de=!1,Fe(),ze();return}let We=(Ce&&"maxFontBytes"in Ce?Ce.maxFontBytes:void 0)??chunk4GBTELJV_cjs.a,_e=uO(Ce?.sources??[],We),Yt=_e.sources;for(let Ve of _e.dropped)Zn(dO(Ve));let tn=$g(ke,Yt,We),Nr=!1,uo=()=>{if(!Nr){Nr=!0;for(let Ve of tn.dropped)Zn(cO(Ve));}},nt=chunkK5U2PLDP_cjs.z(chunkK5U2PLDP_cjs.f({epoch:C,...Ce,sources:Yt},tn),Oe);if(nt.sources.length===0){uo(),de=!1,Fe(),Ce&&Zn(new chunkUKVVUHZL_cjs.a("missing","the supplied font configuration contains no usable sources; the fixed measurer stays in effect"));return}let wt=await Zi(nt),Pn=()=>!L&&C===ne?!1:(chunk6APGXLBB_cjs.s(wt),C===ne&&(de=!1),!0);if(Pn())return;let fo=Ve=>{uo(),Ve&&chunk6APGXLBB_cjs.s(Ve),de=!1,Fe();},Ga=(Ve,ht)=>{let Pt=new Set;for(let po of ht.sources??[]){let Hr=Ve.fonts.resolve(po.request);Hr instanceof chunk4GBTELJV_cjs.d&&(Zn(Sa(Hr)),Pt.add(chunk4GBTELJV_cjs.h(po.request)));}return Pt},Dr=Ga(wt,nt);try{if(Dr.size>0){let Ve=Yt.filter(Qe=>!Dr.has(chunk4GBTELJV_cjs.h(Qe.request))),ht=Ve.length!==Yt.length;ht&&(tn=$g(ke,Ve,We));let Pt=tn.sources.filter(Qe=>ht||!Dr.has(chunk4GBTELJV_cjs.h(Qe.request))),po=wt;if(nt=chunkK5U2PLDP_cjs.z(chunkK5U2PLDP_cjs.f({epoch:C,...Ce,sources:Ve},{sources:Pt}),Oe),nt.sources.length===0)return fo(po);if(wt=await Zi(nt),chunk6APGXLBB_cjs.s(po),Pn())return;let Hr=Ga(wt,nt);if(Hr.size>0){let Qe=Ve.filter(Xa=>!Hr.has(chunk4GBTELJV_cjs.h(Xa.request))),$s=tn.sources.filter(Xa=>!Hr.has(chunk4GBTELJV_cjs.h(Xa.request))),ra=wt;if(nt=chunkK5U2PLDP_cjs.z(chunkK5U2PLDP_cjs.f({epoch:C,...Ce,sources:Qe},{sources:$s}),Oe),nt.sources.length===0)return fo(ra);if(wt=await Zi(nt),chunk6APGXLBB_cjs.s(ra),Pn())return}}}finally{uo();}let ta=nt.sources.map(Ve=>{let ht=wt.fonts.resolve(Ve.request);return ht instanceof chunk4GBTELJV_cjs.d||ht.id!==Ve.id?null:{request:Ve.request,id:ht.id,bytes:ht.bytes,hash:ht.hash,faceIndex:ht.faceIndex}}).filter(Ve=>Ve!==null),na=await pO(ta,void 0,nt.substitutions??[]);if(L||C!==ne){na.dispose(),Pn();return}let un={embeddedFaces:X,coveredFontFamilies:pt,documentSubstitutedFamilies:ot,shapedMeasurer:B,shapedProducer:q,disposeShapedFonts:D};try{X=na,pt=MC(ta,nt.substitutions??[]),ot=chunkK5U2PLDP_cjs.w(nt,Oe,wt.fonts);let Ve=chunk6APGXLBB_cjs.S(Ar(),{context:l?Da(l.ownerDocument):null,...X?{fontAlias:X.alias}:{}}),ht=PC(wt,nt,Ve,Ar(),++j);if(B=ht.measurer,q=ht.producer,de=!1,E&&o===C&&bk(E,{measurer:B,producer:q,fontAlias:X?.alias,defaultFontFamily:chunkK5U2PLDP_cjs.g(ee())}),L||C!==ne){na.dispose(),chunk6APGXLBB_cjs.s(wt);return}}catch(Ve){throw !L&&C===ne&&({embeddedFaces:X,coveredFontFamilies:pt,documentSubstitutedFamilies:ot,shapedMeasurer:B,shapedProducer:q,disposeShapedFonts:D}=un),na.dispose(),chunk6APGXLBB_cjs.s(wt),Ve}D=()=>chunk6APGXLBB_cjs.s(wt),un.disposeShapedFonts(),un.embeddedFaces?.dispose(),Fe(),ze();}catch(Oe){if(L||C!==ne)return;de=false,Fe(),Zn(Sa(Oe));}}}let Yo=pp();function Ns(){let C=E?.state()??null;return {scope:E?.activeScope?.()??W8,isLoading:U===null&&E===null&&m===null&&!y.isScheduled(),isOpening:y.isScheduled()&&!t?.source,parseError:U,editable:E!==null&&E.session.editable&&i.mode()!=="view"&&g!=="viewing"&&!(l&&qn(l)),zoom:Rt.zoom(),zoomMode:Rt.mode(),selection:gd(E),selectionCollapsed:C===null||C.selection.anchor.paragraphId===C.selection.head.paragraphId&&C.selection.anchor.offset===C.selection.head.offset,formatting:NS(E),table:yd(E),tocContext:Yo(C?.contextTocId??null),image:or(E),page:{current:_p(E),total:Hp(E)},canUndo:C?.canUndo??false,canRedo:C?.canRedo??false,pageSetup:DS(y,E),reviewPaneOpen:At,reviewPane:p.current(),showParagraphMarks:lr.get(),documentProtection:In.state(),revisionMarkup:jn.current(),reviewDisplayMode:E&&u?E.revisionDisplayMode():zt,hasReviewContent:E?.session.hasReviewContent()??false,hiddenReviewAuthors:I.hiddenAuthorList,collaborationStatus:C?.collaborationStatus??"inactive",editingMode:g,lastRejection:w??C?.lastRejection??null,fontSubstitutions:Se(),formatPainter:C?.formatPainter??id}}let za;function cr(){if(xt&&Ie===mt)return xt;let C=xt,Q=ee()===za;za=ee();let te=s===tt;tt=s;let we=E?.state().selection??null,ke=ud(we,me);me=we;let Oe=E?.session.packageRevision()??-1,Ge=Oe===ue;ue=Oe;let oe=Ns(),Ce=oe;if(C){let We=dp(oe.formatting,C.formatting)?C.formatting:oe.formatting,_e=cp(oe.page,C.page)?C.page:oe.page,Yt=up(oe.pageSetup??null,C.pageSetup??null)?C.pageSetup:oe.pageSetup,tn=fp(oe.selection,C.selection)?C.selection:oe.selection,Nr=ES(oe.image,C.image)?C.image:oe.image,uo=C.fontSubstitutions!==void 0&&oe.fontSubstitutions!==void 0&&C.fontSubstitutions.length===oe.fontSubstitutions.length&&oe.fontSubstitutions.every((nt,wt)=>C.fontSubstitutions[wt]===nt)?C.fontSubstitutions:oe.fontSubstitutions;Ce={...oe,formatting:We,page:_e,pageSetup:Yt,selection:tn,image:Nr,fontSubstitutions:uo},mp(Ce,C)&&ke&&Ge&&te&&Q&&(Ce=C);}return xt=cd(Ce),Ie=mt,xt}if(e.document){let C=bp(e.document);C?so(C):(U=vp(e.document),en(sn("unsupported",U)));}let Ds=lR({surface:()=>E,activeKey:Fr,paneOpen:()=>At,selectionAnchor:()=>Ua()?.anchorY??null,authorFilterKey:()=>I.stateKey});function dn(C){return chunkFIJZIQXA_cjs.zj(C)===null||C.kind==="custom"&&!C.carded?false:!(C.kind==="revision"&&b!==null&&b.includes(C.revisionKind)&&(C.revisionKind!=="format"||S===void 0||S.includes(C.formattingKind??"")))}let zn=PE();function Qo(C){let Q=chunkFIJZIQXA_cjs.zj(C)?.partName;if(!Q||!E||Q===E.session.part().name)return null;for(let te of E.session.headerFooterResolutionBySection())for(let we of ["header","footer"]){let ke=we==="header"?te.headers:te.footers;for(let Oe of ke.values())if(Oe.partName===Q)return {kind:we,rId:Oe.rId}}return null}function qt(C){let Q=chunkFIJZIQXA_cjs.zj(C),te=E?.publishedLayout();return !Q||!te?null:EE(te).get(Q.start.paragraphId)??null}function Hs(C){let Q=chunkFIJZIQXA_cjs.zj(C)?.partName;if(!Q||!E)return null;for(let te of ["footnote","endnote"])if(chunkFIJZIQXA_cjs.ch(E.session.currentPackage(),te)?.name===Q)return {kind:"notesPart",noteKind:te};return null}function cn(C){let Q=Qo(C);return Q!==null?{kind:"headerFooter",rId:Q.rId}:Hs(C)??{kind:"body"}}let Ft=()=>`${new Date().toISOString().slice(0,19)}Z`;function lo(){return aO({surface:E,bodyOrder:()=>{let C=E?.publishedLayout();return C?OE(C):new Map},openStoryOrder:Bs})}function gt(){let C=E?.activeScope();if(C?.kind==="headerFooter")return {kind:"headerFooter",rId:C.rId};if(C?.kind==="note"){let Q=chunkFIJZIQXA_cjs.pc(C.id);if(Q)return {kind:"notesPart",noteKind:Q.noteKind}}return {kind:"body"}}function _s(C){if(!E)return {kind:"body"};let Q=C.slice(0,C.indexOf("#"));if(Q.length===0||Q===E.session.part().name)return {kind:"body"};for(let te of E.session.headerFooterResolutionBySection())for(let we of [te.headers,te.footers])for(let ke of we.values())if(ke.partName===Q)return {kind:"headerFooter",rId:ke.rId};for(let te of ["footnote","endnote"])if(chunkFIJZIQXA_cjs.ch(E.session.currentPackage(),te)?.name===Q)return {kind:"notesPart",noteKind:te};return gt()}function Bs(){if(!E)return new Map;let C=gt();if(C.kind==="body")return new Map;let Q=new Map;for(let[te,we]of E.session.paragraphIdsIn(C).entries())Q.set(we,te);return Q}function kn(C){if(C.kind==="revision"){let te=C.ranges;if(te.length===0)return null;let ke=C.revisionKind==="replace"||C.revisionKind==="insert"||C.revisionKind==="delete"?te[te.length-1]:te[0];return {start:te[0].start,end:ke.end}}let Q=chunkFIJZIQXA_cjs.zj(C);return Q?{start:Q.start,end:Q.end}:null}function Ua(){if(E&&E.activatedReviewKey()!==null)return null;let C=lo(),Q=E?.publishedLayout();if(!C||!Q)return null;let te=zn(Q).get(C.from.paragraphId);return te?{pageIndex:te.pageIndex,anchorY:te.contentY+chunk6APGXLBB_cjs.X(te,C.from.paragraphId,C.from.offset)}:null}function Fr(){return E?.activeReviewKey()??null}function Mt(C){if(!u)return [];let Q=qC(vm(E?.session.reviewItems()??[],I),C),te=C?.placement!==false,we=null;if(te&&Q.length>0){let oe=E?.publishedLayout()??null;oe&&(we=zn(oe));}let ke=Fr(),Oe=oe=>{let Ce=Qo(oe);return Ce===null?1:Ce.kind==="header"?0:2},Ge=Q.map((oe,Ce)=>({item:oe,position:Ce,pageIndex:we?chunk6APGXLBB_cjs.Z(oe,we)?.pageIndex??null:null,group:Oe(oe)}));return Ge.sort((oe,Ce)=>{let We=oe.pageIndex??Number.MAX_SAFE_INTEGER,_e=Ce.pageIndex??Number.MAX_SAFE_INTEGER;return We!==_e?We-_e:oe.group!==Ce.group?oe.group-Ce.group:oe.position-Ce.position}),Ge.map(({item:oe})=>{let Ce=chunkFIJZIQXA_cjs.xj(oe),We=we?chunk6APGXLBB_cjs.Z(oe,we):null,_e={key:Ce,id:oe.id,...Pg(oe)!==void 0?{date:Pg(oe)}:{},activatable:wc(oe).every(dn),anchorY:We?.y??null,pageIndex:We?.pageIndex??null,isActive:wc(oe).some(Yt=>chunkFIJZIQXA_cjs.xj(Yt)===ke)};return oe.kind==="comment"?{..._e,kind:"comment",author:oe.comment.author,initials:chunkFIJZIQXA_cjs.Nj(oe.comment),text:chunkFIJZIQXA_cjs.Lj(oe.comment),resolved:oe.resolved,...oe.parentId!==void 0?{parentId:oe.parentId}:{},...oe.parentRevisionId!==void 0?{parentRevisionId:oe.parentRevisionId}:{},replyIds:oe.replyIds,readOnly:false,item:oe}:oe.kind==="revision"?{..._e,kind:"revision",revisionKind:oe.revisionKind,author:oe.author,initials:nR(oe.author),text:chunkFIJZIQXA_cjs.lb(oe.text),...oe.replacedText?{replacedText:chunkFIJZIQXA_cjs.lb(oe.replacedText)}:{},replyIds:oe.replyIds,readOnly:oe.readOnly||bS(E),item:oe}:{..._e,kind:"custom",author:"",initials:"",text:oe.detail??oe.text,replyIds:[],readOnly:true,item:oe}})}function Un(){return E?.session.trackingSettings()??chunkFIJZIQXA_cjs.gi}function Jo(C=g,Q=P){let te=Un();return Ip({...O(),viewOnly:i.mode()==="view",hostChoseMode:i.mode()!==void 0,readerChoseMode:Q,currentMode:C,trackRevisions:te.trackRevisions,restrictedToTrackedChanges:te.restrictedToTrackedChanges,restrictedToForms:te.restrictedToForms,restrictedToReadOnly:te.restrictedToReadOnly,restrictedToComments:te.restrictedToComments,engineAdoptedViewing:R})}function Gn(C){A=null,g=C,E?.setEditingMode(C==="suggesting"?"suggest":C==="viewing"?"view":"edit"),E?.setEditable(C!=="viewing");}function Rn(C){return C!==null?C:g==="suggesting"&&s===void 0?Yr:N?Yr:P?null:i.openingModeDecision(O()).rejection}function xe(){let C=Jo();w=Rn(C.rejection),C.mode!==null&&(R=C.mode==="viewing",Gn(C.mode));}function Xn(C="editing",Q=true){if(y.isScheduled()){A=C;return}A=null;let te=mS(i.mode(),O(),Un(),g,C,R);R=te.mode==="viewing"&&i.mode()!=="view",te.mode!==g&&Gn(te.mode),w=Rn(te.rejection),V.report(te.configurationRejection),Q&&(Fe(),ze());}function co(C){return i.mode()==="view"&&C!=="viewing"?{ok:false,code:"locked",reason:"this document was opened for viewing"}:(C==="suggesting"?Sp(O()):null)??kp(Un(),C)}let ea=WC({surface:()=>E,enabled:()=>u,destroyed:()=>L,viewing:()=>g==="viewing",placements:Mt,visible:()=>vm(E?.session.reviewItems()??[],I),scope:cn,reveal:C=>Ze.emitReviewItemReveal(kg(Mt,C)),activate:(C,Q)=>{x=Q??false;try{return Xt.setActiveReviewItem(C,{announce:!1})}finally{x=false;}},setDisplayMode:C=>{zt=C,E?.setRevisionDisplayMode(C),Fe(),ze();}}),{resolveReviewItem:Yn}=ea,Lr=new Ec(()=>E,Ze.emitHistoryDiagnostic,()=>JSON.stringify(E?.state().selection)),Xt={beginHistoryGroup(){return y.flush(),Lr.begin()},get mountGeneration(){return Te},get surface(){return E&&Dd(E)?null:E},...he.setters,setHyperlinkChrome:Z.push,setEquationChrome:F.push,stateVersion:()=>mt,fontMeasurement:()=>({measurer:B&&!a()?"shaped":"fixed",resolving:de||a(),...B&&q&&!a()?{producer:q}:{}}),attach(C){if(l!==C&&t?.invalidate(),L){en(sn("destroyed","this editor was destroyed; create a new instance to remount"));return}if(E&&l===C)return;if(E){E.flushPendingInput(),m=E.session.save();let we=l?lm(l):void 0;we&&h.set(m,we),Mr();}let Q=y.cancel();Q&&(m=Q),Rt.detach(),l=C,Re=null;let te=m;m=null,te&&y.shouldYield(te)?y.schedule(te):te?Xo(te):Fe();},detach(){if(t?.invalidate(),L)return;Rt.detach();let C=y.cancel();if(E){E.flushPendingInput(),m=E.session.save();let Q=l?lm(l):void 0;Q&&h.set(m,Q),Mr();}C&&(m=C),l=null,Re=null,Fe();},load(C){let Q=bp(C);if(!Q){en(sn("unsupported",vp(C)));return}t?.invalidate(),dr.reset(),so(Q);},save(){return y.flush(),Kk(E,l,()=>E)},getDocumentHandle(){return Object.freeze({revision:E?.session.packageRevision()??0})},exec(C,Q){if(l&&qn(l))return {ok:false,code:"unsupported",reason:"An external document refresh is in progress."};if(y.flush(),C.type==="openRevisionMarkupDialog")return jn.open();let te=Lr.gate(C,Q);if(te)return te;Lr.note(C);let we=Tg(C,L,u,co);if(L&&we&&!we.ok)return we;if(C.type==="setEditingMode"){let _e=co(C.mode);return _e!==null?(_e.reason===Yr&&(N=true,w=_e.reason,V.report(_e.reason),Fe(),ze()),_e):(P=true,N=false,w=null,Gn(C.mode),Fe(),ze(),{ok:true,changed:false})}if(C.type==="toggleParagraphMarks")return lr.toggle(),{ok:true,changed:false};if(C.type==="toggleReviewPane")return u?(At=!At,Fe(),ze(),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:ln};let ke=In.exec(C);if(ke)return ke;let Oe=ea.exec(C);if(Oe)return Oe;if(yg(C))return xC(C,E,bg(g),Q);let Ge=ts(C);if(g==="viewing"&&Ge.supported&&Ge.mutating)return {ok:false,code:"locked",reason:"the document is open for viewing"};let oe=ds(C,E,i.modeForGate(),Q);if(!oe.ok)return oe.refusal;let Ce=E,We=Ce.session.packageRevision();return Lr.run(Ce,C,Q,()=>{let _e=zE(Ce,C,{...oe.tablePlan?{admittedTablePlan:oe.tablePlan}:{},editor:Xt});return _e||{ok:true,changed:Ce.session.packageRevision()!==We}})},can(C,Q){if(l&&qn(l))return {ok:false,code:"unsupported",reason:"An external document refresh is in progress."};if(C.type==="openRevisionMarkupDialog")return jn.canOpen();let te=Lr.gate(C,Q);if(te)return te;if(C.type==="insertImage"||C.type==="replaceImage"){if(L)return {ok:false,code:"notFound",reason:"the editor was destroyed"};if(Q?.scope){let Ce=ds(C,E,i.modeForGate(),Q);if(!Ce.ok)return Ce.refusal}return LS(C,E)}let we=Tg(C,L,u,co);if(we)return we;let ke=In.can(C);if(ke)return ke;let Oe=ea.can(C);if(Oe)return Oe;if(yg(C))return vg(C,E,bg(g),Q);let Ge=ts(C);if(g==="viewing"&&Ge.supported&&Ge.mutating)return {ok:false,code:"locked",reason:"the document is open for viewing"};let oe=ds(C,E,i.modeForGate(),Q);if(!oe.ok)return oe.refusal;if(C.type==="proposeInsertion"||C.type==="proposeDeletion"||C.type==="proposeReplacement"){if(!(C.author??s??"").trim())return {ok:false,code:"invalidArgs",reason:`${C.type} requires a non-empty author`};let We=C.target===void 0?{ok:true,selection:E.state().selection}:Tc(E,C.target);if(!We.ok)return We;let{anchor:_e,head:Yt}=We.selection,tn=_e.paragraphId===Yt.paragraphId&&_e.offset===Yt.offset,Nr=C.type==="proposeReplacement"&&C.target===void 0&&E.state().cellSelection!==null;if(C.type!=="proposeInsertion"&&tn&&!Nr)return {ok:false,code:"invalidArgs",reason:`${C.type} needs a non-collapsed selection`}}if(ss(C)&&Op(C)){let Ce=ls(Xt);if(Ce){let We=Mp(Xt,C,Ce);if(We)return We}}return {ok:true}},isActive(C){return C.type==="toggleParagraphMarks"?lr.get():C.type==="toggleDocumentProtection"?In.isActive():C.type==="setReviewDisplayMode"?zt===C.mode:C.type==="toggleReviewPane"?At:C.type==="setEditingMode"?g===C.mode:ZC(C,E?cr().formatting:null,Q=>E?.isListActive(Q)??false)},getDocumentStyles:()=>E?.session.documentStyles()??[],getDocumentFonts:()=>E?.session.documentFonts()??[],getAvailableFonts:()=>lO(ee(),E?.session.documentFonts()??[]),getDocumentThemeColors:()=>E?.session.documentThemeColors()??[],getOutline:()=>E?.session.documentOutline()??[],getComments:()=>[],getSelectionFormatting:()=>qS(E?cr().formatting:null),findMatches:((C,Q)=>{let te={...Q?.matchCase!==void 0?{matchCase:Q.matchCase}:{},...Q?.wholeWord!==void 0?{wholeWord:Q.wholeWord}:{},...E?{stories:zC(E,g)}:{}};if(typeof C=="string")return Fg(E?.session.findText(C,te),dr.noteMatches);let we=E?.session.findText(C,te);return C.map((ke,Oe)=>Fg(we?.[Oe],dr.noteMatches))}),selectMatch(C){return y.flush(),E?UC(E,C):{ok:false,code:"notFound",reason:"no document is loaded"}},getSelectedImage:()=>cr().image,getSelectedTable:()=>$S(E),getTableCellSelection:()=>{let C=E?.state().cellSelection;return C?{tableId:C.tableId,rows:C.rows,columns:C.columns,cellIds:C.cellIds}:null},setTableInteractionLabel(C){E?.setTableInteractionLabel(C);},canExecuteImageCommand(C,Q){if(L)return {ok:false,code:"notFound",reason:"the editor was destroyed"};if(Q?.scope){let te=ds(C,E,i.modeForGate(),Q);if(!te.ok)return te.refusal}return Ap(C,E)},executeImageCommand(C){return L?Promise.resolve({ok:false,code:"notFound",reason:"the editor was destroyed"}):Lp(Xt,C)},getPageSetup:()=>Dp(E),getWatermark:()=>null,getTrackedChanges:()=>(E?.session.reviewItems()??[]).filter(C=>C.kind==="revision").map(C=>{let Q=Qo(C);return {id:C.id,kind:C.kind==="revision"?C.revisionKind:"revision",...C.kind==="revision"&&C.author?{author:C.author}:{},story:Q!==null?Q.kind:Hs(C)?.noteKind??"body"}}),getReviewItems:C=>Mt(C),getCustomNodeDefinitions:()=>d.customNodes,reportCustomNodeDiagnostic:c,addComment(C,Q){if(!u)return {ok:false,code:"unsupported",reason:ln};E?.flushPendingInput();let te=lo();if(!te||!E)return {ok:false,code:"invalidArgs",reason:"a comment needs a selected range"};let we=(Q??s??"").trim();if(we.length===0||C.trim().length===0)return {ok:false,code:"invalidArgs",reason:"a comment needs both an author and text"};let ke=null;return E.commitReviewOps(()=>(ke=E.session.replyToComment(null,{paragraphId:te.from.paragraphId,start:te.from.offset,end:te.to.offset,...te.to.paragraphId===te.from.paragraphId?{}:{endParagraphId:te.to.paragraphId}},C,we,Ft(),_s(te.from.paragraphId)),{committed:ke!==null}),"comment-add"),ke===null?{ok:false,code:"unsupported",reason:"the comment could not be committed"}:{ok:true,changed:true}},getSelectionPlacement:()=>Ua(),isReviewPaneOpen:()=>At,getEditingMode:()=>g,getReviewAuthors:()=>M.authorsFor(E?.revisionAuthors()??vO),...dR(I,{enabled:u,surface:()=>E,notify:()=>{Fe(),ze();}}),setTrackedChangesFilter(C,Q){if(E)return E.setTrackedChangesFilter(C,Q);I.setPredicate(C,Q)&&(Fe(),ze());},getConfiguredAuthor:()=>s??null,setAuthor(C){let Q=ym(C);if(s!==Q){if(s=Q,E?.setAuthor(s),s!==void 0&&N){N=false;let te=pS(co("suggesting"));if(te.enter)P=true,Gn("suggesting");else {w=te.rejection,Fe(),ze();return}}else if(!P){let te=A??g;Xn(i.mode()===void 0?te:"editing");return}w=Rn(null),V.report(w),Fe(),ze();}},setMode(C){i.setMode(C)&&(P=false,N=false,Xn());},...IO(i,{surface:()=>E,bump:Fe,emitSelectionChange:ze}),presenceColorFor:C=>E?.remotePresenceColor(C)??"var(--doc-accent)",collaborationSession:()=>E?.collaborationSession()??null,getReviewAuthorStyle:C=>M.styleFor(C),setOpeningIndicatorHost:G.set,setRemoteCaretLabelHost(C){_=C,E?.setRemoteCaretLabelHost(C);},setReviewPaneOptions:p.set,setRevisionMarkup:jn.set,setRevisionMarkupChrome:jn.register,setRevisionStyles(C){M.set(C),E?.setRevisionStyles(C),Fe(),ze();},setEditingMode:C=>Xt.exec({type:"setEditingMode",mode:C}),getReviewRevision:()=>Ds(),getActivatedReviewItemKey:C=>Ig(Mt,E?.activatedReviewKey()??null,C),setActiveReviewItem(C,Q){if(C===null)return E?.dismissActiveReview(),Fe(),ze(),{ok:true,changed:false};if(!E)return {ok:false,code:"notFound",reason:"no document is open"};E.flushPendingInput();let te=ao(Mt,C)?.item;if(!te)return {ok:false,code:"notFound",reason:"no review item with that key"};let we=Sg(te),ke=we?chunkFIJZIQXA_cjs.xj(we.deletion):C,Oe=chunkFIJZIQXA_cjs.zj(te);if(!Oe)return {ok:false,code:"unsupported",reason:"this review item has no resolvable range"};if(!wc(te).every(dn)&&!(x&&te.kind==="revision"&&te.revisionKind==="format"))return {ok:false,code:"unsupported",reason:KC(te)};let Ge=te?Qo(te):null,oe=Ge===null&&te?qt(te):null;if(Ge!==null||oe!==null){let Ce=Ge!==null?{kind:"headerFooter",rId:Ge.rId,furnitureKind:Ge.kind}:{kind:"note",id:oe},We=Ic(E,Ce,Oe.start);if(!We.ok)return We}else {E.exitNote?.(),E.exitHeaderFooter?.();let Ce=kn(te)??Oe,We={paragraphId:Ce.start.paragraphId,offset:Ce.start.offset};E.activateReview(ke,{anchor:We,head:We},{allowExcluded:x});let _e=Q?.reveal??"centerIfNeeded";_e!==false&&E.revealPosition?.(Ce.start,{block:_e});}return (Ge!==null||oe!==null)&&E.activateReview(ke,void 0,{allowExcluded:x}),Fe(),ze(),Q?.announce===true&&Ze.emitReviewItemReveal(kg(Mt,{key:C,source:"host"})),{ok:true,changed:false}},setReviewActivationExclusions(C,Q){b=C===null?null:[...C],S=Q?.formattingKinds?[...Q.formattingKinds]:void 0,E?.setReviewActivationExclusions(b,{formattingKinds:S});},acceptReviewItem:C=>Yn(C,"accept"),rejectReviewItem:C=>Yn(C,"reject"),setCommentResolved(C,Q){return iO({reviewEnabled:u,editingMode:g,placements:Mt,surface:E,proReviewReason:ln,bump:Fe},C,Q)},deleteReviewItem(C){if(!u)return {ok:false,code:"unsupported",reason:ln};let Q=ao(Mt,C)?.item;if(!Q||!E)return {ok:false,code:"notFound",reason:"no review item with that key"};if(Q.kind==="revision")return Yn(C,"reject");if(Q.kind!=="comment")return {ok:false,code:"unsupported",reason:"a custom node card cannot be deleted"};Fr()===C&&E.dismissActiveReview();let te=false;return E.commitReviewOps(()=>{let we=qt(Q),ke=we===null?null:chunkFIJZIQXA_cjs.pc(we);return te=E.session.deleteComment(Q.id,cn(Q),ke?.noteId),{committed:te}},"comment-delete"),te?(Fe(),{ok:true,changed:true}):{ok:false,code:"unsupported",reason:"the comment could not be deleted"}},replyToReviewItem(C,Q,te){if(!u)return {ok:false,code:"unsupported",reason:ln};E?.flushPendingInput();let we=ao(Mt,C)?.item,ke=Sg(we)?.insertion??we;if(!ke||!E)return {ok:false,code:"notFound",reason:"no review item with that key"};let Oe=chunkFIJZIQXA_cjs.zj(ke);if(!Oe)return {ok:false,code:"invalidArgs",reason:"the item has no anchorable range"};let Ge=(te??s??"").trim(),oe=sO(ke,Q,Ge);if(oe)return oe;let Ce=ke.kind==="comment"?ke.id:null,We=null;return E.commitReviewOps(()=>(We=E.session.replyToComment(Ce,{paragraphId:Oe.start.paragraphId,start:Oe.start.offset,end:Oe.end.offset},Q,Ge,Ft(),cn(ke)),{committed:We!==null}),"comment-reply"),We===null?{ok:false,code:"unsupported",reason:"the reply could not be committed"}:{ok:true,changed:true}},getHeaderFooterState:()=>E?.headerFooterState()??null,getNotePropertiesState:()=>E?.notePropertiesState?.()??null,getNotePreviewText:C=>E?.notePreviewText?.(C)??null,setActiveScope(C){E?.setActiveScope(C)&&Fe();},getActiveScope:()=>E?.activeScope()??{kind:"body"},query:C=>SC(E,()=>cr().formatting,C),snapshot:()=>cr(),getTotalPages:()=>Hp(E),getCurrentPage:C=>_p(E,C),...GC(()=>E,()=>y.flush(),()=>l),...JC(()=>Xt,()=>t,()=>y.flush()),...bO(Rt,()=>E),...dr.members,...bE({frame:dr.frame,placements:Mt}),relayout(C){C?.sync,E?.layout();},retainSelection:()=>E?.retainSelection()??null,releaseSelection:C=>E?.releaseSelection(C),focus(C){return y.flush(),E?C&&C.kind==="all"?{ok:false,code:"invalidTarget",reason:"the all scope cannot take focus"}:C&&!E.setActiveScope(C)?{ok:false,code:"invalidTarget",reason:"that scope cannot be opened"}:(E.focus(),{ok:true,value:void 0}):{ok:false,code:"invalidTarget",reason:"no document is loaded"}},destroy(){t?.invalidate(),L=true,V.dispose(),y.cancel(),Rt.detach(),z(),D(),D=()=>{},Mr(),l=null,m=null,h=new WeakMap,Te+=1,Fe(),Ze.clear();},on:Ze.on};return t=RC(Xt,{surface:()=>E,container:()=>l,collaboration:()=>d.collaboration!==null,load:so,changed:()=>{Fe(),ze();},cancelLoad:()=>{n=null,y.cancel();}}),Ye.methods(Xt)}var kO=Object.freeze({document:true,save:true,events:true,selection:true,scrolling:true,layout:true});function z8(e){if(e.length===0)return;if(e.every(n=>n.kind==="delete"))return "comment-delete";if(e.length!==1)return;let t=e[0];if(t.kind==="resolve")return "comment-resolve";if(t.kind==="create")return "comment-add";if(t.kind==="reply")return "comment-reply"}function U8(e){let t=chunkVX43VBAX_cjs.m({port:G8(e),capabilities:kO}),n=false;return {...t,save:()=>{try{return t.save()}catch(r){return {ok:false,error:{code:"transaction-refused",message:r instanceof Error?r.message:"Cannot save the document."}}}},dispose:()=>{n=true,t.dispose();},execute:r=>(n||e.surface?.flushPendingInput(),t.execute(r))}}function G8(e){let t=0,n=0,r=null,o=false,a=false,i=()=>{if(a)return null;let d=e.surface?.session??null;return d!==r&&(o&&(t+=n+1),o=true,r=d,n=0),d&&(n=d.packageRevision()),d},s,l=null;return {localChangeTracking:true,suggesting:()=>e.surface?.editingMode()==="suggest",async prepare(d){if(!d.operations.some(p=>p.op==="updateFieldResult"))return;s=void 0,l=null;let c=e.surface;if(!c)return;let u=c.layout();s=chunkVX43VBAX_cjs.c(u),l=i()?.currentPackage()??null;},fieldPageContext(d,c,u){let p=i()?.currentPackage()??null;if(!p||p!==l)return null;let m=chunkVX43VBAX_cjs.g(p).story(d);return m?chunkVX43VBAX_cjs.d(s,m.part,c,u):null},revision(){return i(),t+n},currentPackage:()=>i()?.currentPackage()??null,revisionDisplayMode:()=>e.surface?chunk4GBTELJV_cjs.Ya(e.surface.revisionDisplayMode()):chunkFIJZIQXA_cjs.th,collaborative:()=>!!e.surface?.collaborationSession(),trackedRangeReplacement:()=>!e.surface?.collaborationSession(),replacementLanding:(d,c,u)=>e.surface?.replacementLanding(d,c,u)??null,apply(d,c,u=[],p=false){i();let m=e.surface;if(!m)return {ok:false,reason:"no-document"};let h=m.applyAutomationOps(d,c,u,p);return h.rejected?{ok:false,reason:String(h.reason??"refused")}:{ok:true,changed:h.committed}},applyLifecycle(d){i();let c=e.surface;if(!c)return {ok:false,reason:"no-document"};let u=c.applyAutomationOps(()=>[d]);return u.rejected?{ok:false,reason:String(u.reason??"refused")}:{ok:true,changed:u.committed}},applyCommentWrites(d,c){let u=e.surface,p=i();if(!u||!p)return {ok:false,reason:"no-document"};if(d.length===0)return {ok:true,changed:false};if(c.kind!=="body")return {ok:false,reason:"unsupported-story"};let m=e.can({type:"toggleReviewPane"});if(!m.ok)return {ok:false,reason:m.reason??"review-module-required"};let h={ok:false,reason:"refused"};return u.commitReviewOps(()=>{if(d.every(b=>b.kind==="delete")){let b=d.find(x=>x.kind==="delete"),S=p.deleteComments(d.map(x=>{if(x.kind!=="delete")throw new Error("unreachable mixed comment write");return {commentId:x.commentId,...x.parentCommentId===void 0?{}:{parentCommentId:x.parentCommentId}}}),c,b?.kind==="delete"?b.noteId:void 0);return h=S?{ok:true,changed:true}:{ok:false,reason:"unknown-comment"},{committed:S}}if(d.length!==1)return h={ok:false,reason:"mixed-comment-writes"},{committed:false};let y=d[0];if(y.kind==="resolve"){let b=p.setCommentResolved(y.commentId,y.resolved);return h=b?{ok:true,changed:true}:{ok:false,reason:"unknown-comment"},{committed:b}}if(y.kind!=="create"&&y.kind!=="reply")return h={ok:false,reason:"unsupported-comment-write"},{committed:false};let g=p.replyToComment(y.kind==="reply"?y.parentCommentId:null,y.anchor,y.text,y.author,y.date);return h=g===null?{ok:false,reason:"refused"}:{ok:true,changed:true,commentId:g},{committed:g!==null}},z8(d)),h},applyCustomNodeWrite(d,c){let u=e.surface,p=i();if(!u||!p)return {ok:false,reason:"no-document"};if(c.kind!=="body")return {ok:false,reason:"unsupported-story"};let m={ok:false,reason:"refused"};return u.commitReviewOps(()=>{let h=p.insertCustomNode(d);return m=h.ok?{ok:true,changed:h.change!==null}:{ok:false,reason:h.detail?`${h.reason}: ${h.detail}`:h.reason},{committed:h.ok}},"package-scoped"),m},save:()=>i()?e.surface?.save()??null:null,select(d,c){if(!e.surface)return;let p=c==="end"?d.end:d.start,m=c==="start"?d.start:d.end;e.exec({type:"setSelection",range:{anchor:{paragraphId:p.paragraphId,offset:p.offset},head:{paragraphId:m.paragraphId,offset:m.offset}}});},subscribe:d=>e.on("change",()=>d()),dispose(){a=true,r=null;}}}function Zg(e){let t=e?.closest(".docx-editor")??null;for(;t&&!t.querySelector(".docx-pages");)t=t.parentElement?.closest(".docx-editor")??null;return t}function X8(e){let t=e.popup.ownerDocument,n=r=>{if(r.key!=="Escape"||r.isComposing||r.keyCode===229||e.skip?.(r))return;let o=r.composedPath(),a=o[0]??r.target,i=a instanceof Node?a:null,s=i!==null&&e.contains(i);if(!s&&RO(i,e.popup))return;let l=[Zg(e.popup),e.chromeRoot?.(),...e.editorElements?.()??[]],d=s||l.some(c=>c!=null&&o.includes(c));e.close(s),d&&(r.preventDefault(),r.stopPropagation());};return t.addEventListener("keydown",n,true),()=>t.removeEventListener("keydown",n,true)}function RO(e,t){let r=(e instanceof Element?e:e?.parentElement??null)?.closest('[aria-modal="true"], [data-docx-modal]');return r?r.hasAttribute("data-docx-dialog")||r.hasAttribute("data-docx-modal")?true:Zg(t)?.contains(r)===true:false}var Y8='[aria-expanded="true"], [role="menu"], [role="listbox"], [role="dialog"]';function Q8(e){return e?.querySelector(Y8)!=null}function J8(e){let t=e.popup.ownerDocument,n=r=>{let o=r.composedPath()[0]??r.target;if(!(o instanceof Node)||e.contains(o))return;let a=o instanceof Element?o:o.parentElement;a===null||a===t.body||a===t.documentElement||a.closest(".docx-pages")||RO(a,e.popup)||e.close();};return t.addEventListener("focusin",n,true),()=>t.removeEventListener("focusin",n,true)}function e6(e){return e*(96/72)}function t6(e,t){return e*t}function n6(e,t){return e/t}function r6(e,t,n){let r=e.pages.find(i=>i.index===t.pageIndex)??e.pages[t.pageIndex];if(!r)return {left:0,top:0,width:0,height:0};let o=n.pageOffsetX.get(r.index)??0,a=n.paintScale;return Object.freeze({left:(r.contentBox.x+t.x+o)*a,top:(r.contentBox.y+t.y)*a,width:t.width*a,height:t.height*a})}function o6(e){return Object.freeze(e?{left:e.offsetLeft,top:e.offsetTop}:{left:0,top:0})}function TO(e,t,n,r=false){return t?true:e.length===1?false:r?n:!n}var PO=["e","se","s","sw","w","nw","n","ne"];function a6(e,t){let n=PO.indexOf(e);t.flipHorizontal&&(n=(4-n+8)%8),t.flipVertical&&(n=(8-n)%8);let r=Math.round(t.rotationDegrees/45)%8;return PO[(n-r+8)%8]}function i6(e,t,n){let r=e,o=t,a=-n.rotationDegrees*Math.PI/180,i=Math.cos(a),s=Math.sin(a),l=r*i-o*s,d=r*s+o*i;return r=l,o=d,n.flipHorizontal&&(r=-r),n.flipVertical&&(o=-o),Object.freeze({x:r,y:o})}function Go(e){return e/12700}function CO(e){let t=i6(e.deltaXPt,e.deltaYPt,e.transform),n=Go(e.startWidthEmu),r=Go(e.startHeightEmu),o=n/r,a=a6(e.handle,e.transform),i=a.includes("e")?t.x:a.includes("w")?-t.x:0,s=a.includes("s")?t.y:a.includes("n")?-t.y:0;if(n=Math.max(1,n+i),r=Math.max(1,r+s),e.preserveAspect)if(a.length===2){let x=Math.max(n/Go(e.startWidthEmu),r/Go(e.startHeightEmu));n=Math.max(1,Go(e.startWidthEmu)*x),r=Math.max(1,n/o);}else a==="e"||a==="w"?r=Math.max(1,n/o):n=Math.max(1,r*o);let l=Go(e.startWidthEmu),d=Go(e.startHeightEmu),c=n/l,u=r/d,p=Math.max(1,e.startBounds.width*c),m=Math.max(1,e.startBounds.height*u),h=e.startBounds.x,y=e.startBounds.y,g=e.handle;g.includes("w")&&(h=e.startBounds.x+e.startBounds.width-p),g.includes("n")&&(y=e.startBounds.y+e.startBounds.height-m);let b=null;if(e.kind==="anchored"&&e.startPosition&&(g.includes("w")||g.includes("n")||e.anchorFrameOrigin&&(e.startPosition.horizontalEmu===void 0&&n!==l||e.startPosition.verticalEmu===void 0&&r!==d)))if(e.startPosition.mode==="simple"){let S=g.includes("w")?Et(h-e.startBounds.x):0,x=g.includes("n")?Et(y-e.startBounds.y):0;b=Object.freeze({mode:"simple",horizontalEmu:(e.startPosition.horizontalEmu??0)+S,verticalEmu:(e.startPosition.verticalEmu??0)+x});}else if(e.anchorFrameOrigin)b=Object.freeze({mode:"frame",...e.startPosition.relativeToH!==void 0?{relativeToH:e.startPosition.relativeToH}:{},...e.startPosition.relativeToV!==void 0?{relativeToV:e.startPosition.relativeToV}:{},...g.includes("w")||e.startPosition.horizontalEmu===void 0&&n!==l?{horizontalEmu:Et(h-e.anchorFrameOrigin.x)}:e.startPosition.horizontalEmu!==void 0?{horizontalEmu:e.startPosition.horizontalEmu}:{},...g.includes("n")||e.startPosition.verticalEmu===void 0&&r!==d?{verticalEmu:Et(y-e.anchorFrameOrigin.y)}:e.startPosition.verticalEmu!==void 0?{verticalEmu:e.startPosition.verticalEmu}:{}});else {let S=g.includes("w")?Et(h-e.startBounds.x):0,x=g.includes("n")?Et(y-e.startBounds.y):0;b=Object.freeze({mode:"frame",...e.startPosition.horizontalEmu!==void 0?{horizontalEmu:e.startPosition.horizontalEmu+S}:{},...e.startPosition.verticalEmu!==void 0?{verticalEmu:e.startPosition.verticalEmu+x}:{},...e.startPosition.relativeToH!==void 0?{relativeToH:e.startPosition.relativeToH}:{},...e.startPosition.relativeToV!==void 0?{relativeToV:e.startPosition.relativeToV}:{}});}return Object.freeze({widthEmu:Et(n),heightEmu:Et(r),previewBounds:Object.freeze({x:h,y,width:p,height:m}),position:b})}function s6(e,t){return Object.freeze({scrollBy(n){if(!Number.isFinite(n)||n===0)return 0;let r=e.scrollTop;return e.scrollTop+=n*t,(e.scrollTop-r)/t}})}function l6(e){if(e.session.mode==="move"){let t=e.session.startBounds.x+e.deltaXPt,n=e.session.startBounds.y+e.deltaYPt+e.accumulatedScrollPt,r=e.session.startPosition&&pd(e.session.startPosition.mode==="frame"&&e.anchorFrameOrigin?{...e.session.startPosition,horizontalEmu:e.session.startPosition.horizontalEmu??Et(e.session.startBounds.x-e.anchorFrameOrigin.x),verticalEmu:e.session.startPosition.verticalEmu??Et(e.session.startBounds.y-e.anchorFrameOrigin.y)}:e.session.startPosition,e.deltaXPt,e.deltaYPt+e.accumulatedScrollPt);return Object.freeze({widthEmu:e.session.startWidthEmu,heightEmu:e.session.startHeightEmu,previewBounds:Object.freeze({x:t,y:n,width:e.session.startBounds.width,height:e.session.startBounds.height}),position:r??null})}return e.session.handle?CO({handle:e.session.handle,startWidthEmu:e.session.startWidthEmu,startHeightEmu:e.session.startHeightEmu,startBounds:e.session.startBounds,startPosition:e.session.startPosition,anchorFrameOrigin:e.anchorFrameOrigin,deltaXPt:e.deltaXPt,deltaYPt:e.deltaYPt,transform:e.session.transform,preserveAspect:TO(e.session.handle,e.aspectLocked,e.shiftKey,e.textbox),kind:e.session.kind}):Object.freeze({widthEmu:e.session.startWidthEmu,heightEmu:e.session.startHeightEmu,previewBounds:e.session.startBounds,position:null})}var EO=e=>Math.round(e/1440*100)/100,d6=e=>EO(e).toLocaleString(void 0,{maximumFractionDigits:2}),c6=e=>Math.round(e*1440),u6={left:"dialogs.paragraph.tabAlignLeft",center:"dialogs.paragraph.tabAlignCenter",right:"dialogs.paragraph.tabAlignRight",decimal:"dialogs.paragraph.tabAlignDecimal",bar:"dialogs.paragraph.tabAlignBar"},OO=e=>e===null||e===0?"none":e<0?"hanging":"firstLine",MO=(e,t)=>e==="none"?0:e==="hanging"?-Math.abs(t):Math.abs(t);function f6(e){let t=e.indentFirstLineTwips;return {alignment:e.alignment??"left",direction:e.direction??"ltr",indentLeft:e.indentLeftTwips??0,indentRight:e.indentRightTwips??0,special:OO(t),specialBy:Math.abs(t??0),spaceBefore:e.spaceBeforePt??0,spaceAfter:e.spaceAfterPt??0,lineRule:e.lineSpacing?.rule??"multiple",lineValue:e.lineSpacing?.value??1.08,contextualSpacing:e.contextualSpacing===true,keepNext:e.keepNext===true,keepLines:e.keepLines===true,widowControl:e.widowControl!==false,pageBreakBefore:e.pageBreakBefore===true,tabStops:e.tabStops??[],clearedAllTabStops:false}}var AO={contextualSpacing:false,keepNext:false,keepLines:false,widowControl:false,pageBreakBefore:false,tabStops:false,alignment:false,direction:false,indentLeft:false,indentRight:false,special:false,spaceBefore:false,spaceAfter:false,lineSpacing:false};function p6(e){return {contextualSpacing:e.contextualSpacing===null,keepNext:e.keepNext===null,keepLines:e.keepLines===null,widowControl:e.widowControl===null,pageBreakBefore:e.pageBreakBefore===null,tabStops:e.disagrees.tabStops,alignment:e.disagrees.alignment,direction:e.disagrees.direction,indentLeft:e.disagrees.indentLeft||e.indentUnknown,indentRight:e.disagrees.indentRight||e.indentUnknown,special:e.disagrees.indentFirstLine||e.indentUnknown,spaceBefore:e.disagrees.spaceBeforePt,spaceAfter:e.disagrees.spaceAfterPt,lineSpacing:e.disagrees.lineSpacing}}function FO(e,t){return e===t?true:e.length!==t.length?false:e.every((n,r)=>{let o=t[r];return o!==void 0&&n.positionTwips===o.positionTwips&&n.alignment===o.alignment&&(n.leader??"none")===(o.leader??"none")})}function m6(e,t,n=AO,r=n){let o={},a=false,i=(d,c)=>{o[d]=c,a=true;},s=d=>n[d]&&!r[d];(e.direction!==t.direction||s("direction"))&&i("direction",t.direction);let l=!n.direction&&!n.alignment&&e.direction!==t.direction&&t.alignment===LO(e.alignment);return (e.alignment!==t.alignment&&!l||s("alignment"))&&i("alignment",t.alignment),(e.indentLeft!==t.indentLeft||s("indentLeft"))&&i("indentLeftTwips",t.indentLeft),(e.indentRight!==t.indentRight||s("indentRight"))&&i("indentRightTwips",t.indentRight),(e.special!==t.special||e.specialBy!==t.specialBy||s("special"))&&i("indentFirstLineTwips",MO(t.special,t.specialBy)),(e.spaceBefore!==t.spaceBefore||s("spaceBefore"))&&i("spaceBeforePt",t.spaceBefore),(e.spaceAfter!==t.spaceAfter||s("spaceAfter"))&&i("spaceAfterPt",t.spaceAfter),!r.lineSpacing&&(e.lineRule!==t.lineRule||e.lineValue!==t.lineValue||s("lineSpacing"))&&i("lineSpacing",{rule:t.lineRule,value:t.lineValue}),(e.contextualSpacing!==t.contextualSpacing||s("contextualSpacing"))&&i("contextualSpacing",t.contextualSpacing),(e.keepNext!==t.keepNext||s("keepNext"))&&i("keepNext",t.keepNext),(e.keepLines!==t.keepLines||s("keepLines"))&&i("keepLines",t.keepLines),(e.widowControl!==t.widowControl||s("widowControl"))&&i("widowControl",t.widowControl),(e.pageBreakBefore!==t.pageBreakBefore||s("pageBreakBefore"))&&i("pageBreakBefore",t.pageBreakBefore),(!FO(e.tabStops,t.tabStops)||s("tabStops")&&t.clearedAllTabStops)&&i("tabStops",t.tabStops),a?o:null}function LO(e){return e==="left"?"right":e==="right"?"left":e}function g6(e,t){return [...e.filter(r=>r.positionTwips!==t.positionTwips),t].sort((r,o)=>r.positionTwips-o.positionTwips)}function h6(e,t){if(t.key!=="Tab")return false;let n=[...e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')].filter(i=>!i.hasAttribute("disabled")&&i.tabIndex!==-1);if(n.length===0)return false;let r=n[0],o=n[n.length-1],a=e.ownerDocument.activeElement;return t.shiftKey&&(a===r||a===e)?(o.focus(),true):!t.shiftKey&&a===o?(r.focus(),true):false}function y6(e,t,n){let r,o=false,a,i,s=new Set,l=[],d=()=>{clearTimeout(i),i=void 0,r?.end(),r=void 0,a=void 0,s.clear();},c=()=>{if(o)throw new Error("history group binding was disposed");return (!r||r.state==="closed")&&(r=e.beginHistoryGroup()),r},u=()=>{d(),c();},p=()=>{let y=r;a=void 0,s.clear(),clearTimeout(i),i=setTimeout(()=>{r===y&&d();},0);},m=(y,g,b,S=false)=>{y.addEventListener(g,b,S),l.push(()=>y.removeEventListener(g,b,S));},h=y=>n.kind==="native-color"?y==="Enter"||y===" ":["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"," ","Enter"].includes(y);if(m(t,"pointerdown",y=>{let g=y;if(!(g.button!==0||n.kind==="keyboard")&&(u(),a=g.pointerId,n.kind!=="native-color"))try{t.setPointerCapture?.(g.pointerId);}catch{}},true),m(t,"keydown",y=>{let g=y;if(g.key==="Escape"){p();return}!h(g.key)||g.altKey||g.ctrlKey||g.metaKey||(!g.repeat&&s.size===0&&u(),s.add(g.key),c());},true),m(t.ownerDocument,"keyup",y=>{let g=y.key;s.delete(g)&&n.kind!=="native-color"&&s.size===0&&p();},true),n.kind!=="native-color")for(let y of ["pointerup","pointercancel","lostpointercapture"])m(y==="lostpointercapture"?t:t.ownerDocument,y,g=>{a!==void 0&&g.pointerId===a&&p();},true);return m(t,"input",()=>{i!==void 0?u():c();},true),m(t,"change",()=>{(n.kind==="native-color"||a===void 0&&s.size===0)&&p();}),m(t,"blur",p,true),t.ownerDocument.defaultView&&m(t.ownerDocument.defaultView,"blur",p),{options:()=>({historyGroup:c()}),dispose(){if(!o){o=true,d();for(let y of l)y();}}}}var io=class extends Error{code;constructor(t,n){super(`Document capture failed: ${t}.`,{cause:n}),this.name="DocumentRefreshError",this.code=t;}};function NO(e){return JSON.stringify([e.revisionKind,e.author,e.date,e.text,e.replacedText])}function DO(e){return new Map(e.surface()?.session.reviewItems().filter(t=>t.kind==="revision").map(t=>[t.id,NO(t)]))}function HO(e,t,n,r){let o=e.surface();if(!o)return {located:[],available:false};let a=o.session.part(),i=chunkSRPILEWV_cjs.d(a),s=o.session.paragraphAnchors().paraIdByNode,l=new Map,d=new Map;i.forEach((h,y)=>{d.set(h.id,y);let g=s.get(h.id);if(g){let b=g.toUpperCase();l.set(b,l.has(b)?null:h);}});let c=new Set(o.layout().pages.flatMap(h=>chunk4GBTELJV_cjs.xa(h).map(y=>y.paragraphId))),u=(h,y=JSON.stringify([typeof h.location?.text=="string"?h.location.text:null,h.unavailableReason,h.description]))=>{let g={id:h.id,resultId:t,isNew:r.get(h.id)!==y,...h.description!==void 0?{description:h.description}:{}};if(!h.location)return {fingerprint:y,change:{...g,status:h.unavailableReason??"unavailable",diagnostic:Object.freeze({code:h.unavailableReason==="deleted"?"deleted":"missing-location"})}};let b=h.location,S=k=>({fingerprint:y,change:{...g,status:"invalid",diagnostic:Object.freeze({code:k,location:Object.freeze({...b})})}});if(b.paragraphId===void 0==(b.paragraphIndex===void 0)||b.paragraphIndex!==void 0&&(!Number.isSafeInteger(b.paragraphIndex)||b.paragraphIndex<0))return S("invalid-selector");if(b.paragraphId!==void 0&&(typeof b.paragraphId!="string"||!chunkFIJZIQXA_cjs.vb(b.paragraphId)))return S("invalid-paragraph-id");let x=b.paragraphId!==void 0?l.get(b.paragraphId.toUpperCase()):i[b.paragraphIndex];if(x===null)return S("ambiguous-paragraph-id");if(!x)return S("paragraph-not-found");let I=x?chunkFIJZIQXA_cjs.Vi(a,x.id)??"":"";if(!Number.isSafeInteger(b.start)||!Number.isSafeInteger(b.end)||b.start<0||b.end<=b.start||b.end>I.length)return S("invalid-offsets");if(I.slice(b.start,b.end)!==b.text)return S("text-mismatch");let M=c.has(x.id);return {fingerprint:y,change:{...g,status:M?"available":"unavailable",location:Object.freeze({...b}),...M?{}:{diagnostic:Object.freeze({code:"not-rendered",location:Object.freeze({...b})})}},...M?{paragraphId:x.id,offset:b.start}:{}}};if(n)return {located:n.map(h=>u(h)),available:true};let p=o.session.reviewItems().filter(h=>h.kind==="revision");return {located:p.map(h=>{let y=NO(h),g=h.ranges[0];if(!g||g.partName!==a.name)return {fingerprint:y,change:{id:h.id,resultId:t,isNew:r.get(h.id)!==y,status:g?"unsupported-story":"unavailable",diagnostic:Object.freeze({code:g?"unsupported-story":"missing-location"})}};let b=d.get(g.start.paragraphId)??-1;if(h.revisionKind==="delete"||h.revisionKind==="moveFrom")return {fingerprint:y,change:{id:h.id,resultId:t,isNew:r.get(h.id)!==y,status:"deleted",diagnostic:Object.freeze({code:"deleted"})}};if(g.start.paragraphId!==g.end.paragraphId)return {fingerprint:y,change:{id:h.id,resultId:t,isNew:r.get(h.id)!==y,status:"unavailable",diagnostic:Object.freeze({code:"multiple-paragraphs"})}};let S=chunkFIJZIQXA_cjs.Vi(a,g.start.paragraphId)??"",x={paragraphIndex:b,start:g.start.offset,end:g.end.offset,text:S.slice(g.start.offset,g.end.offset)};return u({id:h.id,location:x},y)}),available:p.length>0}}var _O=new WeakMap,b6=0;function v6(e){let t=_O.get(e);if(t)return t;let n=kC(e),r=`refresh-${++b6}`,o=0,a=null,i=new AbortController,s=false,l=Promise.resolve(),d=null,c=[],u=null,p=new Set,m=new Set,h=Object.freeze({phase:"idle",result:null,changes:[],highlightsVisible:false,recoveryAvailable:false}),y=P=>{h=Object.freeze({...h,...P});for(let R of p)try{R();}catch{}},g=Rc(e,n,{marker:"data-docx-refresh-highlight",defaultColor:"var(--doc-refresh-highlight-color)"},()=>{h.highlightsVisible&&y({highlightsVisible:false});}),b=(P,R)=>{R&&y({phase:R,result:P,recoveryAvailable:d!==null});for(let w of m)try{w(P);}catch{}return P},S=(P,R,w)=>({ok:false,resultId:P,code:R,...w===void 0?{}:{recovered:w}}),x=()=>n.collaboration()?"collaboration":!n.surface()||!n.container()||e.snapshot().isOpening?"unavailable":null,I=()=>{o++,a=null,i.abort(),i=new AbortController,c=[],u=null,g.clear();};n.invalidated.add(()=>{I(),d=null,y({phase:"idle",result:null,changes:[],highlightsVisible:false,recoveryAvailable:false});}),e.on("change",P=>{P.source||u===null||n.revision===u||(c=[],g.clear(),u=null,y({changes:[],highlightsVisible:false}));});let M=async P=>{let R=n.surface(),w=n.container();if(!R||!w)throw new Error("unavailable");GI(R)&&await new Promise((A,V)=>{let W=()=>{w.removeEventListener("compositionend",E),P.removeEventListener("abort",_);},E=()=>{W(),A();},_=()=>{W(),V(new Error("cancelled"));};w.addEventListener("compositionend",E),P.addEventListener("abort",_,{once:true}),P.aborted&&_();});let O=vs(w);if(O&&await O,P.aborted||n.surface()!==R)throw new Error("document-changed");let N=R.save();if(n.surface()!==R)throw new Error("document-changed");return {bytes:N,revision:n.revision}},k={async capture(){let P=x();if(d)throw new io("recovery-failed");if(P||s)throw new io(P??"busy");I(),d=null;let R=o,w=n.epoch,O=i.signal;y({phase:"capturing",result:null,changes:[],highlightsVisible:false,recoveryAvailable:false});try{let N=await M(O);if(R!==o||w!==n.epoch)throw new Error("superseded");let A=Object.freeze({id:`${r}-${R}`,bytes:N.bytes.slice().buffer});return a={token:A,epoch:w,revision:N.revision,sequence:-1,seen:DO(n)},y({phase:"processing"}),A}catch(N){throw R===o&&y({phase:"failed"}),new io(R===o?"input-failed":"superseded",N)}},applyUpdate(P){let R=`${P.submission?.id??"unknown"}:${P.sequence}`,w;try{if(!Number.isSafeInteger(P.sequence)||P.sequence<0||!(P.bytes instanceof Uint8Array||P.bytes instanceof ArrayBuffer)||P.failures!==void 0&&(!Array.isArray(P.failures)||P.failures.length>1e4||Array.from(P.failures).some(A=>typeof A!="string"))||P.changes!==void 0&&(!Array.isArray(P.changes)||P.changes.length>1e4||new Set(P.changes.map(A=>A.id)).size!==P.changes.length||Array.from(P.changes).some(A=>!A||typeof A.id!="string"||!A.id||A.description!==void 0&&(typeof A.description!="string"||A.description.length>1e3)||A.location!==void 0&&(!A.location||typeof A.location!="object"||A.location.paragraphId!==void 0&&typeof A.location.paragraphId!="string"||A.location.paragraphIndex!==void 0&&typeof A.location.paragraphIndex!="number"||typeof A.location.start!="number"||typeof A.location.end!="number"||typeof A.location.text!="string")||A.unavailableReason!==void 0&&!["deleted","unavailable"].includes(A.unavailableReason))))throw new Error("invalid-result");w={...P,bytes:new Uint8Array((P.bytes instanceof Uint8Array,P.bytes)).slice(),changes:P.changes?.map(A=>({id:A.id,description:A.description,unavailableReason:A.unavailableReason,location:A.location?{paragraphId:A.location.paragraphId,paragraphIndex:A.location.paragraphIndex,start:A.location.start,end:A.location.end,text:A.location.text}:void 0})),failures:P.failures?.slice()};}catch{return Promise.resolve(b(S(R,"invalid-result")))}let O=async()=>{let A=a,V=x();if(V)return b(S(R,V));if(!A||A.token!==w.submission)return b(S(R,"superseded"));if(w.sequence<=A.sequence)return b(S(R,"out-of-order"));if(A.epoch!==n.epoch)return b(S(R,"document-changed"));s=true;let W=i.signal,E=()=>a===A&&A.epoch===n.epoch&&!W.aborted;try{let _=await M(W);if(!E())return b(S(R,"cancelled"));if(_.revision!==A.revision)return b(S(R,"local-edits"),"failed");let G=w.bytes;if(!chunkFIJZIQXA_cjs.Ce(G).ok)return b(S(R,"invalid-document"),"failed");if(g.clear(),c=[],u=null,y({phase:"refreshing",changes:[],highlightsVisible:!1}),!E())return b(S(R,"cancelled"));let U=n.surface().save();if(!E())return b(S(R,"cancelled"));if(n.revision!==A.revision)return b(S(R,"local-edits"),"failed");d={bytes:U.slice(),epoch:n.epoch};let $=await n.replace(G,"refresh");if(A.epoch!==n.epoch)return b(S(R,"document-changed"));if(!$&&!E())return d=null,b(S(R,"cancelled"));if(!$){if(y({phase:"recovering"}),A.epoch!==n.epoch)return b(S(R,"document-changed"));let F=d&&await n.replace(d.bytes,"recovery");return A.epoch!==n.epoch?b(S(R,"document-changed")):(F&&(d=null),a=null,b(S(R,F?"load-failed":"recovery-failed",!!F),"failed"))}d=null,g.clear(),A.revision=n.mountedRevision,A.sequence=w.sequence;let pe=HO(n,R,w.changes,A.seen);c=n.revision===A.revision?pe.located:[];for(let F of c)A.seen.set(F.change.id,F.fingerprint);u=A.revision;let he=Object.freeze(c.map(F=>Object.freeze(F.change))),Z=Object.freeze({ok:!0,resultId:R,changes:he,changeInformation:n.revision===A.revision&&pe.available?"available":"unavailable",failures:Object.freeze(w.failures??[])});return y({changes:he,result:Z,phase:"complete",recoveryAvailable:!1}),b(Z)}catch{return b(S(R,E()?"input-failed":"cancelled"),E()?"failed":void 0)}finally{s=false;}},N=l.then(O);return l=N.then(()=>{},()=>{}),N},cancel(){let P=h.phase==="recovering"||!n.surface()&&d!==null;n.cancel(),o++,a=null,i.abort(),i=new AbortController,P||(d=null),y({phase:P?"failed":h.result?.ok?"complete":"idle",result:P||h.result?.ok?h.result:null,recoveryAvailable:d!==null});},finish(P){a?.token===P&&!s&&(a=null,y({phase:h.phase==="processing"?"idle":h.phase}));},snapshot:()=>h,subscribe(P){return p.add(P),()=>{p.delete(P);}},onResult(P){return m.add(P),()=>{m.delete(P);}},highlightChanges(P){if(g.validate(P),u!==n.revision)return 0;let R=P?.changeIds===void 0?null:new Set(P.changeIds),w=c.filter(O=>O.change.status==="available"&&(R?R.has(O.change.id):P?.includePrevious||O.change.isNew));return g.show(w,P),y({highlightsVisible:w.length>0}),w.length},clearHighlights(P){g.hide(P),y({highlightsVisible:false});},navigateToChange(P,R={}){if(R.focus!==void 0&&typeof R.focus!="boolean")throw new TypeError("focus must be a boolean.");let w=Wa(R,"center",n.container());if(u!==n.revision)return false;let O=c.find(A=>A.change.id===P);if(!O?.paragraphId||O.offset===void 0)return false;let N=n.surface();if(!N?.revealPosition({paragraphId:O.paragraphId,offset:O.offset},w))return false;if(R?.focus){N.setActiveScope({kind:"body"});let A={paragraphId:O.paragraphId,offset:O.offset};N.setSelection({anchor:A,head:A}),N.focus();}return true},recoveryBytes:()=>d?d.bytes.slice().buffer:null,async recover(){if(!d||d.epoch!==n.epoch||s)return false;s=true;let P=d;y({phase:"recovering"});try{if(P.epoch!==n.epoch)return !1;let R=await n.replace(P.bytes,"recovery");return P.epoch!==n.epoch?!1:(R&&(d=null),y({phase:R?"idle":"failed",recoveryAvailable:!R}),R)}finally{s=false;}}};return _O.set(e,k),k}var x6=150;var w6=Object.freeze({applied:0,unavailable:0});function S6(e,t,n,r={}){let{onResult:o,...a}=r,i=n,s=a,l=w6,d=false,c,u=0,p=g=>{g.applied===l.applied&&g.unavailable===l.unavailable||(l=g,o?.(g));},m=()=>{if(clearTimeout(c),c=void 0,u=0,d)return;let g=typeof i=="function"?i(e):i;p(e.setHighlights(t,g,s));},h=()=>{let g=Date.now();u===0&&(u=g),clearTimeout(c);let b=Math.min(150,1e3-(g-u));c=setTimeout(m,Math.max(0,b));},y=e.on("change",g=>{typeof i=="function"?g.source?m():h():g.source==="refresh"||g.source==="recovery"?m():g.source==="load"&&p({applied:0,unavailable:i.length});});return m(),{get result(){return l},refresh:m,update(g,b){i=g,b!==void 0&&(s=b),m();},stop(){d||(d=true,clearTimeout(c),y(),e.clearHighlights(t));}}}var Ug=150,$O=2e3,qO="search",VO=10,zg=Object.freeze([]),I6=1e3;function k6(e,t){let n=e.activeIndex>=0?e.matches[e.activeIndex]:void 0;if(!n)return -1;let r=-1;for(let[o,a]of t.entries())a.blockId===n.blockId&&(r<0||Math.abs(a.start-n.start)<Math.abs(t[r].start-n.start))&&(r=o);return r}var BO=new WeakMap;function R6(e){let t=BO.get(e);if(t)return t;let n={query:"",matchCase:false,wholeWord:false,matches:zg,truncated:false,activeIndex:-1,activeMatch:null,isPending:false},r="",o={},a,i=new Set,s=new Map,l=false;function d(){let k="none";for(let P of s.values()){if(P==="all")return "all";P==="active"&&(k="active");}return k}function c(){let k=d(),{matches:P,activeIndex:R}=n,w=R>=0?P[R]:void 0,O=k==="all"?P:k==="active"&&w?[w]:[];O.length===0&&!l||(e.setHighlights(qO,O,{activeIndex:k==="all"?R:O.length>0?0:-1,priority:VO}),l=O.length>0);}function u(k){let P={...n,...k};if(P.matches!==n.matches&&k.activeIndex===void 0&&(P.activeIndex=k6(n,P.matches)),P.truncated=xE(P.matches)??P.matches.length>=$O,P.activeMatch=P.matches[P.activeIndex]??null,!!Object.keys(P).some(w=>P[w]!==n[w])){n=P,c();for(let w of [...i])w();}}function p(k=r,P=n){return k.length===0?zg:e.findMatches(k,{matchCase:P.matchCase??false,wholeWord:P.wholeWord??false})}function m(){clearTimeout(a),a=void 0;}function h(){m(),r=n.query,u({matches:p(),isPending:false});}let y,g=0,b=()=>{clearTimeout(y),y=void 0,g=0,r.length>0&&u({matches:p()});},S=()=>{y!==void 0&&b();};e.on("change",k=>{if(r.length===0)return;if(k.source)return b();let P=Date.now();g===0&&(g=P),clearTimeout(y);let R=Math.min(Ug,I6-(P-g));y=setTimeout(b,Math.max(0,R));});let x=e.snapshot().editingMode;e.on("selectionChange",k=>{k.editingMode!==x&&(x=k.editingMode,b());});let I=(k,P)=>{S();let R=n.matches.length;if(R===0)return false;let w=n.activeIndex<0?k>0?-1:0:n.activeIndex;return M.goTo((w+k+R)%R,P)},M={getState:()=>n,subscribe(k){return i.add(k),()=>i.delete(k)},find(k,P={}){m(),r=k;let R=P.matchCase??n.matchCase,w=P.wholeWord??n.wholeWord,O=p(k,{matchCase:R,wholeWord:w});return P.highlight===void 0||P.highlight==="none"?s.delete(o):s.set(o,P.highlight),u({query:k,matchCase:R,wholeWord:w,matches:O,activeIndex:-1,isPending:false}),c(),P.selectFirst&&M.goTo(0),n.matches},setQuery(k){k!==n.query&&(m(),k!==r&&(a=setTimeout(h,Ug)),u({query:k,isPending:k!==r}));},setMatchCase(k){u({matchCase:k,matches:p(r,{...n,matchCase:k})});},setWholeWord(k){u({wholeWord:k,matches:p(r,{...n,wholeWord:k})});},goTo(k,P){S();let R=n.matches[k];return !R||(P?.focus&&e.focus(),!e.selectMatch(R).ok)?false:(u({activeIndex:k}),true)},next:k=>I(1,k),previous:k=>I(-1,k),clear(){m(),r="",s.delete(o),u({query:"",matches:zg,activeIndex:-1,isPending:false});},showHighlights(k){let P={};return s.set(P,k),c(),()=>{s.delete(P)&&c();}}};return BO.set(e,M),M}var P6=[37,80,68,70,45],Fs=class extends Error{constructor(n){super(`Install @docx-editor.dev/docx-to-${n} and configure menu.exporters.${n}.`+(n==="pdf"?" PDF conversion requires a Node.js server.":""));this.format=n;this.name="ChromeExportError";}format;code="missing-exporter"};async function Gg(e,t,n={}){if(t==="markdown"){if(!n.markdown)throw new Fs(t);let i=await n.markdown(new Uint8Array(await e.save()));if(typeof i?.markdown!="string")throw new TypeError("The Markdown converter returned no Markdown.");return {bytes:new TextEncoder().encode(i.markdown),extension:"md",mimeType:"text/markdown;charset=utf-8"}}if(t!=="pdf")throw new TypeError("Unsupported export format.");if(!n.pdf)throw new Fs(t);let r=e.snapshot?.(),o=r?{displayMode:r.reviewDisplayMode??"proposed",revisionMarkup:r.revisionMarkup,...e.getReviewAuthors?{revisionAuthorSlots:Object.freeze(Object.fromEntries(e.getReviewAuthors().map(({author:i,slot:s})=>[i,s])))}:{}}:void 0,a=await n.pdf(new Uint8Array(await e.save()),o);if(!(a?.bytes instanceof Uint8Array)||a.bytes.length===0)throw new TypeError("The PDF converter returned no PDF bytes.");if(!P6.every((i,s)=>a.bytes[s]===i))throw new TypeError("The PDF converter returned a file without a PDF header.");return {bytes:a.bytes,extension:"pdf",mimeType:"application/pdf"}}var C6=15e3,Wn=class extends Error{code;constructor(t){super(t==="pdf-viewer-unavailable"?"This browser cannot display PDF files in the page.":t==="pdf-load-failed"?"The PDF did not load for printing.":t==="print-refused"?"The browser refused to print the PDF from the page.":"The print job has ended."),this.code=t,this.name="ChromePrintError";}};function E6(e){if(e.altKey||e.shiftKey||typeof e.key!="string")return false;let t=e.key.toLowerCase();return t!=="p"&&(e.code!=="KeyP"||/^[a-z]$/.test(t))?false:i18n.isApplePlatform()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}async function O6(e,t={},n=document){let{bytes:r,mimeType:o}=await Gg(e,"pdf",t);return M6(r,o,n)}function M6(e,t,n){let r=n.nodeType===9?n.body:n;if(!r)throw new TypeError("Printing requires a document body.");let o=r.ownerDocument,a=o.defaultView;if(!a)throw new TypeError("Printing requires a document with a window.");let i=e.buffer instanceof ArrayBuffer?e:e.slice(),s=a.URL.createObjectURL(new a.Blob([i],{type:t})),l=null,d=null,c,u=null,p=false,m=g=>{a.clearTimeout(c),u?.(g),u=null,l?.remove(),l=null,d=null;},h=()=>{if(d)return d;let g=o.createElement("iframe");return l=g,g.setAttribute("aria-hidden","true"),g.setAttribute("tabindex","-1"),g.setAttribute("data-docx-print-frame",""),g.style.cssText="position:fixed;right:0;bottom:0;width:0;height:0;border:0;visibility:hidden;",d=new Promise((b,S)=>{u=S,c=a.setTimeout(()=>m(new Wn("pdf-load-failed")),C6),g.addEventListener("load",()=>{if(a.clearTimeout(c),!g.contentWindow){m(new Wn("pdf-load-failed"));return}u=null,b(g.contentWindow);},{once:true});}),d.catch(()=>{}),g.src=s,r.append(g),d};return {url:s,async print(g={}){if(p)throw new Wn("print-ended");if(a.navigator.pdfViewerEnabled===false)throw new Wn("pdf-viewer-unavailable");let b=await h();if(p)throw new Wn("print-ended");if(await g.beforePrint?.(),p)throw new Wn("print-ended");let S=o.activeElement;try{b.focus(),b.print();}catch{throw new Wn("print-refused")}finally{S?.isConnected&&S.focus({preventScroll:true});}},dispose(){p||(p=true,m(new Wn("print-ended")),a.URL.revokeObjectURL(s));}}}
|
|
27
|
-
exports.$=Ma;exports.$a=Pk;exports.$b=m6;exports.A=Zw;exports.Aa=OL;exports.Ab=Kg;exports.B=zw;exports.Ba=eI;exports.Bb=Z8;exports.C=dd;exports.Ca=nI;exports.Cb=kO;exports.D=ap;exports.Da=ML;exports.Db=U8;exports.E=ip;exports.Ea=AL;exports.Eb=Zg;exports.F=u1;exports.Fa=Kp;exports.Fb=X8;exports.G=Rp;exports.Ga=FL;exports.Gb=Q8;exports.H=V1;exports.Ha=LL;exports.Hb=J8;exports.I=as;exports.Ia=NL;exports.Ib=e6;exports.J=is;exports.Ja=DL;exports.Jb=t6;exports.K=Pp;exports.Ka=HL;exports.Kb=n6;exports.L=K1;exports.La=_L;exports.Lb=r6;exports.M=Tp;exports.Ma=BL;exports.Mb=o6;exports.N=fd;exports.Na=$L;exports.Nb=TO;exports.O=Et;exports.Oa=qL;exports.Ob=CO;exports.P=Ho;exports.Pa=oI;exports.Pb=s6;exports.Q=IS;exports.Qa=dI;exports.Qb=l6;exports.R=pd;exports.Ra=GL;exports.Rb=EO;exports.S=or;exports.Sa=jp;exports.Sb=d6;exports.T=ls;exports.Ta=Zp;exports.Tb=c6;exports.U=Ap;exports.Ua=YL;exports.Ub=u6;exports.V=Lp;exports.Va=mI;exports.Vb=OO;exports.W=eL;exports.Wa=QL;exports.Wb=MO;exports.X=tL;exports.Xa=gI;exports.Xb=f6;exports.Y=rL;exports.Ya=JL;exports.Yb=AO;exports.Z=oL;exports.Za=eN;exports.Zb=p6;exports._=hd;exports._a=tN;exports._b=FO;exports.a=Sa;exports.aa=WS;exports.ab=hs;exports.ac=LO;exports.b=Zi;exports.ba=Bp;exports.bb=ys;exports.bc=g6;exports.c=Vl;exports.ca=cs;exports.cb=LN;exports.cc=h6;exports.d=Kl;exports.da=dL;exports.db=sm;exports.dc=y6;exports.e=ff;exports.ea=jS;exports.eb=$o;exports.ec=io;exports.f=MM;exports.fa=ZS;exports.fb=Cr;exports.fc=v6;exports.g=pf;exports.ga=cL;exports.gb=Vd;exports.gc=x6;exports.h=qF;exports.ha=_o;exports.hb=Uk;exports.hc=S6;exports.i=VF;exports.ia=$p;exports.ib=Gk;exports.ic=Ug;exports.j=Ae;exports.ja=mL;exports.jb=dm;exports.jc=$O;exports.k=Qf;exports.ka=gL;exports.kb=Kd;exports.kc=qO;exports.l=YF;exports.la=yL;exports.lb=cm;exports.lc=VO;exports.m=JF;exports.ma=vd;exports.mb=Wd;exports.mc=R6;exports.n=e1;exports.na=XS;exports.nb=um;exports.nc=Fs;exports.o=Ew;exports.oa=bd;exports.ob=fm;exports.oc=Gg;exports.p=t1;exports.pa=YS;exports.pb=pm;exports.pc=Wn;exports.q=n1;exports.qa=QS;exports.qb=UR;exports.qc=E6;exports.r=r1;exports.ra=wL;exports.rb=ic;exports.rc=O6;exports.s=o1;exports.sa=SL;exports.sb=dg;exports.t=a1;exports.ta=IL;exports.tb=Vg;exports.u=i1;exports.ua=RL;exports.ub=Ms;exports.v=Mw;exports.va=PL;exports.vb=As;exports.w=Aw;exports.wa=TL;exports.wb=ja;exports.x=Fw;exports.xa=CL;exports.xb=_8;exports.y=s1;exports.ya=EL;exports.yb=Ac;exports.z=rp;exports.za=Vp;exports.zb=Fc;
|